diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..d157f7eca64e74dca194148078c7b9594bad9bb0
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__init__.py
@@ -0,0 +1,42 @@
+# --------------------------------------------------------------------------------------
+# Copyright (c) 2013-2024, Nucleic Development Team.
+#
+# Distributed under the terms of the Modified BSD License.
+#
+# The full license is in the file LICENSE, distributed with this software.
+# --------------------------------------------------------------------------------------
+from ._cext import (
+ Constraint,
+ Expression,
+ Solver,
+ Term,
+ Variable,
+ __kiwi_version__,
+ __version__,
+ strength,
+)
+from .exceptions import (
+ BadRequiredStrength,
+ DuplicateConstraint,
+ DuplicateEditVariable,
+ UnknownConstraint,
+ UnknownEditVariable,
+ UnsatisfiableConstraint,
+)
+
+__all__ = [
+ "BadRequiredStrength",
+ "Constraint",
+ "DuplicateConstraint",
+ "DuplicateEditVariable",
+ "Expression",
+ "Solver",
+ "Term",
+ "UnknownConstraint",
+ "UnknownEditVariable",
+ "UnsatisfiableConstraint",
+ "Variable",
+ "__kiwi_version__",
+ "__version__",
+ "strength",
+]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f41ef1750b1aba4eec0bb1e3865f76713d303c32
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__pycache__/exceptions.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__pycache__/exceptions.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..1e19ad0d0b14da9e63270c6d36bfe8b6b6b568f5
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/__pycache__/exceptions.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/_cext.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/_cext.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..47290749fba1ccb3878b8fe9eac871096f9bc8e6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/_cext.pyi
@@ -0,0 +1,228 @@
+# --------------------------------------------------------------------------------------
+# Copyright (c) 2021-2024, Nucleic Development Team.
+#
+# Distributed under the terms of the Modified BSD License.
+#
+# The full license is in the file LICENSE, distributed with this software.
+# --------------------------------------------------------------------------------------
+
+from typing import Any, Iterable, NoReturn, Tuple, type_check_only
+
+try:
+ from typing import Literal
+except ImportError:
+ from typing_extensions import Literal # type: ignore
+
+__version__: str
+__kiwi_version__: str
+
+# Types
+@type_check_only
+class Strength:
+ @property
+ def weak(self) -> float: ...
+ @property
+ def medium(self) -> float: ...
+ @property
+ def strong(self) -> float: ...
+ @property
+ def required(self) -> float: ...
+ def create(
+ self,
+ a: int | float,
+ b: int | float,
+ c: int | float,
+ weight: int | float = 1.0,
+ /,
+ ) -> float: ...
+
+# This is meant as a singleton and users should not access the Strength type.
+strength: Strength
+
+class Variable:
+ """Variable to express a constraint in a solver."""
+
+ __hash__: None # type: ignore
+ def __init__(self, name: str = "", context: Any = None, /) -> None: ...
+ def name(self) -> str:
+ """Get the name of the variable."""
+ ...
+ def setName(self, name: str, /) -> Any:
+ """Set the name of the variable."""
+ ...
+ def value(self) -> float:
+ """Get the current value of the variable."""
+ ...
+ def context(self) -> Any:
+ """Get the context object associated with the variable."""
+ ...
+ def setContext(self, context: Any, /) -> Any:
+ """Set the context object associated with the variable."""
+ ...
+ def __neg__(self) -> Term: ...
+ def __add__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __radd__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __sub__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __rsub__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __mul__(self, other: float) -> Term: ...
+ def __rmul__(self, other: float) -> Term: ...
+ def __truediv__(self, other: float) -> Term: ...
+ def __rtruediv__(self, other: float) -> Term: ...
+ def __eq__(self, other: float | Variable | Term | Expression) -> Constraint: ... # type: ignore
+ def __ge__(self, other: float | Variable | Term | Expression) -> Constraint: ...
+ def __le__(self, other: float | Variable | Term | Expression) -> Constraint: ...
+ def __ne__(self, other: Any) -> NoReturn: ...
+ def __gt__(self, other: Any) -> NoReturn: ...
+ def __lt__(self, other: Any) -> NoReturn: ...
+
+class Term:
+ """Product of a variable by a constant pre-factor."""
+
+ __hash__: None # type: ignore
+ def __init__(
+ self, variable: Variable, coefficient: int | float = 1.0, /
+ ) -> None: ...
+ def coefficient(self) -> float:
+ """Get the coefficient for the term."""
+ ...
+ def variable(self) -> Variable:
+ """Get the variable for the term."""
+ ...
+ def value(self) -> float:
+ """Get the value for the term."""
+ ...
+ def __neg__(self) -> Term: ...
+ def __add__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __radd__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __sub__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __rsub__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __mul__(self, other: float) -> Term: ...
+ def __rmul__(self, other: float) -> Term: ...
+ def __truediv__(self, other: float) -> Term: ...
+ def __rtruediv__(self, other: float) -> Term: ...
+ def __eq__(self, other: float | Variable | Term | Expression) -> Constraint: ... # type: ignore
+ def __ge__(self, other: float | Variable | Term | Expression) -> Constraint: ...
+ def __le__(self, other: float | Variable | Term | Expression) -> Constraint: ...
+ def __ne__(self, other: Any) -> NoReturn: ...
+ def __gt__(self, other: Any) -> NoReturn: ...
+ def __lt__(self, other: Any) -> NoReturn: ...
+
+class Expression:
+ """Sum of terms and an additional constant."""
+
+ __hash__: None # type: ignore
+ def __init__(
+ self, terms: Iterable[Term], constant: int | float = 0.0, /
+ ) -> None: ...
+ def constant(self) -> float:
+ "" "Get the constant for the expression." ""
+ ...
+ def terms(self) -> Tuple[Term, ...]:
+ """Get the tuple of terms for the expression."""
+ ...
+ def value(self) -> float:
+ """Get the value for the expression."""
+ ...
+ def __neg__(self) -> Expression: ...
+ def __add__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __radd__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __sub__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __rsub__(self, other: float | Variable | Term | Expression) -> Expression: ...
+ def __mul__(self, other: float) -> Expression: ...
+ def __rmul__(self, other: float) -> Expression: ...
+ def __truediv__(self, other: float) -> Expression: ...
+ def __rtruediv__(self, other: float) -> Expression: ...
+ def __eq__(self, other: float | Variable | Term | Expression) -> Constraint: ... # type: ignore
+ def __ge__(self, other: float | Variable | Term | Expression) -> Constraint: ...
+ def __le__(self, other: float | Variable | Term | Expression) -> Constraint: ...
+ def __ne__(self, other: Any) -> NoReturn: ...
+ def __gt__(self, other: Any) -> NoReturn: ...
+ def __lt__(self, other: Any) -> NoReturn: ...
+
+class Constraint:
+ def __init__(
+ self,
+ expression: Expression,
+ op: Literal["=="] | Literal["<="] | Literal[">="],
+ strength: float
+ | Literal["weak"]
+ | Literal["medium"]
+ | Literal["strong"]
+ | Literal["required"] = "required",
+ /,
+ ) -> None: ...
+ def expression(self) -> Expression:
+ """Get the expression object for the constraint."""
+ ...
+ def op(self) -> Literal["=="] | Literal["<="] | Literal[">="]:
+ """Get the relational operator for the constraint."""
+ ...
+ def strength(self) -> float:
+ """Get the strength for the constraint."""
+ ...
+ def violated(self) -> bool:
+ """Indicate if the constraint is violated in teh current state of the solver."""
+ ...
+ def __or__(
+ self,
+ other: float
+ | Literal["weak"]
+ | Literal["medium"]
+ | Literal["strong"]
+ | Literal["required"],
+ ) -> Constraint: ...
+ def __ror__(
+ self,
+ other: float
+ | Literal["weak"]
+ | Literal["medium"]
+ | Literal["strong"]
+ | Literal["required"],
+ ) -> Constraint: ...
+
+class Solver:
+ """Kiwi solver class."""
+
+ def __init__(self) -> None: ...
+ def addConstraint(self, constraint: Constraint, /) -> None:
+ """Add a constraint to the solver."""
+ ...
+ def removeConstraint(self, constraint: Constraint, /) -> None:
+ """Remove a constraint from the solver."""
+ ...
+ def hasConstraint(self, constraint: Constraint, /) -> bool:
+ """Check whether the solver contains a constraint."""
+ ...
+ def addEditVariable(
+ self,
+ variable: Variable,
+ strength: float
+ | Literal["weak"]
+ | Literal["medium"]
+ | Literal["strong"]
+ | Literal["required"],
+ /,
+ ) -> None:
+ """Add an edit variable to the solver."""
+ ...
+ def removeEditVariable(self, variable: Variable, /) -> None:
+ """Remove an edit variable from the solver."""
+ ...
+ def hasEditVariable(self, variable: Variable, /) -> bool:
+ """Check whether the solver contains an edit variable."""
+ ...
+ def suggestValue(self, variable: Variable, value: int | float, /) -> None:
+ """Suggest a desired value for an edit variable."""
+ ...
+ def updateVariables(self) -> None:
+ """Update the values of the solver variables."""
+ ...
+ def reset(self) -> None:
+ """Reset the solver to the initial empty starting condition."""
+ ...
+ def dump(self) -> None:
+ """Dump a representation of the solver internals to stdout."""
+ ...
+ def dumps(self) -> str:
+ """Dump a representation of the solver internals to a string."""
+ ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/exceptions.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/exceptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..fd06f23f3a76dae34f03708a831b7f34ff175343
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/exceptions.py
@@ -0,0 +1,51 @@
+# --------------------------------------------------------------------------------------
+# Copyright (c) 2023-2024, Nucleic Development Team.
+#
+# Distributed under the terms of the Modified BSD License.
+#
+# The full license is in the file LICENSE, distributed with this software.
+# --------------------------------------------------------------------------------------
+"""Kiwi exceptions.
+
+Imported by the kiwisolver C extension.
+
+"""
+
+
+class BadRequiredStrength(Exception):
+ pass
+
+
+class DuplicateConstraint(Exception):
+ __slots__ = ("constraint",)
+
+ def __init__(self, constraint):
+ self.constraint = constraint
+
+
+class DuplicateEditVariable(Exception):
+ __slots__ = ("edit_variable",)
+
+ def __init__(self, edit_variable):
+ self.edit_variable = edit_variable
+
+
+class UnknownConstraint(Exception):
+ __slots__ = ("constraint",)
+
+ def __init__(self, constraint):
+ self.constraint = constraint
+
+
+class UnknownEditVariable(Exception):
+ __slots__ = ("edit_variable",)
+
+ def __init__(self, edit_variable):
+ self.edit_variable = edit_variable
+
+
+class UnsatisfiableConstraint(Exception):
+ __slots__ = ("constraint",)
+
+ def __init__(self, constraint):
+ self.constraint = constraint
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/py.typed b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/kiwisolver/py.typed
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..5f964e0b34dea11f572136a3bb6e3d9968ebe754
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__init__.py
@@ -0,0 +1,1576 @@
+"""
+An object-oriented plotting library.
+
+A procedural interface is provided by the companion pyplot module,
+which may be imported directly, e.g.::
+
+ import matplotlib.pyplot as plt
+
+or using ipython::
+
+ ipython
+
+at your terminal, followed by::
+
+ In [1]: %matplotlib
+ In [2]: import matplotlib.pyplot as plt
+
+at the ipython shell prompt.
+
+For the most part, direct use of the explicit object-oriented library is
+encouraged when programming; the implicit pyplot interface is primarily for
+working interactively. The exceptions to this suggestion are the pyplot
+functions `.pyplot.figure`, `.pyplot.subplot`, `.pyplot.subplots`, and
+`.pyplot.savefig`, which can greatly simplify scripting. See
+:ref:`api_interfaces` for an explanation of the tradeoffs between the implicit
+and explicit interfaces.
+
+Modules include:
+
+:mod:`matplotlib.axes`
+ The `~.axes.Axes` class. Most pyplot functions are wrappers for
+ `~.axes.Axes` methods. The axes module is the highest level of OO
+ access to the library.
+
+:mod:`matplotlib.figure`
+ The `.Figure` class.
+
+:mod:`matplotlib.artist`
+ The `.Artist` base class for all classes that draw things.
+
+:mod:`matplotlib.lines`
+ The `.Line2D` class for drawing lines and markers.
+
+:mod:`matplotlib.patches`
+ Classes for drawing polygons.
+
+:mod:`matplotlib.text`
+ The `.Text` and `.Annotation` classes.
+
+:mod:`matplotlib.image`
+ The `.AxesImage` and `.FigureImage` classes.
+
+:mod:`matplotlib.collections`
+ Classes for efficient drawing of groups of lines or polygons.
+
+:mod:`matplotlib.colors`
+ Color specifications and making colormaps.
+
+:mod:`matplotlib.cm`
+ Colormaps, and the `.ScalarMappable` mixin class for providing color
+ mapping functionality to other classes.
+
+:mod:`matplotlib.ticker`
+ Calculation of tick mark locations and formatting of tick labels.
+
+:mod:`matplotlib.backends`
+ A subpackage with modules for various GUI libraries and output formats.
+
+The base matplotlib namespace includes:
+
+`~matplotlib.rcParams`
+ Default configuration settings; their defaults may be overridden using
+ a :file:`matplotlibrc` file.
+
+`~matplotlib.use`
+ Setting the Matplotlib backend. This should be called before any
+ figure is created, because it is not possible to switch between
+ different GUI backends after that.
+
+The following environment variables can be used to customize the behavior:
+
+:envvar:`MPLBACKEND`
+ This optional variable can be set to choose the Matplotlib backend. See
+ :ref:`what-is-a-backend`.
+
+:envvar:`MPLCONFIGDIR`
+ This is the directory used to store user customizations to
+ Matplotlib, as well as some caches to improve performance. If
+ :envvar:`MPLCONFIGDIR` is not defined, :file:`{HOME}/.config/matplotlib`
+ and :file:`{HOME}/.cache/matplotlib` are used on Linux, and
+ :file:`{HOME}/.matplotlib` on other platforms, if they are
+ writable. Otherwise, the Python standard library's `tempfile.gettempdir`
+ is used to find a base directory in which the :file:`matplotlib`
+ subdirectory is created.
+
+Matplotlib was initially written by John D. Hunter (1968-2012) and is now
+developed and maintained by a host of others.
+
+Occasionally the internal documentation (python docstrings) will refer
+to MATLABĀ®, a registered trademark of The MathWorks, Inc.
+
+"""
+
+__all__ = [
+ "__bibtex__",
+ "__version__",
+ "__version_info__",
+ "set_loglevel",
+ "ExecutableNotFoundError",
+ "get_configdir",
+ "get_cachedir",
+ "get_data_path",
+ "matplotlib_fname",
+ "MatplotlibDeprecationWarning",
+ "RcParams",
+ "rc_params",
+ "rc_params_from_file",
+ "rcParamsDefault",
+ "rcParams",
+ "rcParamsOrig",
+ "defaultParams",
+ "rc",
+ "rcdefaults",
+ "rc_file_defaults",
+ "rc_file",
+ "rc_context",
+ "use",
+ "get_backend",
+ "interactive",
+ "is_interactive",
+ "colormaps",
+ "multivar_colormaps",
+ "bivar_colormaps",
+ "color_sequences",
+]
+
+
+import atexit
+from collections import namedtuple
+from collections.abc import MutableMapping
+import contextlib
+import functools
+import importlib
+import inspect
+from inspect import Parameter
+import locale
+import logging
+import os
+from pathlib import Path
+import pprint
+import re
+import shutil
+import subprocess
+import sys
+import tempfile
+
+from packaging.version import parse as parse_version
+
+# cbook must import matplotlib only within function
+# definitions, so it is safe to import from it here.
+from . import _api, _version, cbook, _docstring, rcsetup
+from matplotlib._api import MatplotlibDeprecationWarning
+from matplotlib.rcsetup import cycler # noqa: F401
+
+
+_log = logging.getLogger(__name__)
+
+__bibtex__ = r"""@Article{Hunter:2007,
+ Author = {Hunter, J. D.},
+ Title = {Matplotlib: A 2D graphics environment},
+ Journal = {Computing in Science \& Engineering},
+ Volume = {9},
+ Number = {3},
+ Pages = {90--95},
+ abstract = {Matplotlib is a 2D graphics package used for Python
+ for application development, interactive scripting, and
+ publication-quality image generation across user
+ interfaces and operating systems.},
+ publisher = {IEEE COMPUTER SOC},
+ year = 2007
+}"""
+
+# modelled after sys.version_info
+_VersionInfo = namedtuple('_VersionInfo',
+ 'major, minor, micro, releaselevel, serial')
+
+
+def _parse_to_version_info(version_str):
+ """
+ Parse a version string to a namedtuple analogous to sys.version_info.
+
+ See:
+ https://packaging.pypa.io/en/latest/version.html#packaging.version.parse
+ https://docs.python.org/3/library/sys.html#sys.version_info
+ """
+ v = parse_version(version_str)
+ if v.pre is None and v.post is None and v.dev is None:
+ return _VersionInfo(v.major, v.minor, v.micro, 'final', 0)
+ elif v.dev is not None:
+ return _VersionInfo(v.major, v.minor, v.micro, 'alpha', v.dev)
+ elif v.pre is not None:
+ releaselevel = {
+ 'a': 'alpha',
+ 'b': 'beta',
+ 'rc': 'candidate'}.get(v.pre[0], 'alpha')
+ return _VersionInfo(v.major, v.minor, v.micro, releaselevel, v.pre[1])
+ else:
+ # fallback for v.post: guess-next-dev scheme from setuptools_scm
+ return _VersionInfo(v.major, v.minor, v.micro + 1, 'alpha', v.post)
+
+
+def _get_version():
+ """Return the version string used for __version__."""
+ # Only shell out to a git subprocess if really needed, i.e. when we are in
+ # a matplotlib git repo but not in a shallow clone, such as those used by
+ # CI, as the latter would trigger a warning from setuptools_scm.
+ root = Path(__file__).resolve().parents[2]
+ if ((root / ".matplotlib-repo").exists()
+ and (root / ".git").exists()
+ and not (root / ".git/shallow").exists()):
+ try:
+ import setuptools_scm
+ except ImportError:
+ pass
+ else:
+ return setuptools_scm.get_version(
+ root=root,
+ dist_name="matplotlib",
+ version_scheme="release-branch-semver",
+ local_scheme="node-and-date",
+ fallback_version=_version.version,
+ )
+ # Get the version from the _version.py file if not in repo or setuptools_scm is
+ # unavailable.
+ return _version.version
+
+
+@_api.caching_module_getattr
+class __getattr__:
+ __version__ = property(lambda self: _get_version())
+ __version_info__ = property(
+ lambda self: _parse_to_version_info(self.__version__))
+
+
+def _check_versions():
+
+ # Quickfix to ensure Microsoft Visual C++ redistributable
+ # DLLs are loaded before importing kiwisolver
+ from . import ft2font # noqa: F401
+
+ for modname, minver in [
+ ("cycler", "0.10"),
+ ("dateutil", "2.7"),
+ ("kiwisolver", "1.3.1"),
+ ("numpy", "1.23"),
+ ("pyparsing", "2.3.1"),
+ ]:
+ module = importlib.import_module(modname)
+ if parse_version(module.__version__) < parse_version(minver):
+ raise ImportError(f"Matplotlib requires {modname}>={minver}; "
+ f"you have {module.__version__}")
+
+
+_check_versions()
+
+
+# The decorator ensures this always returns the same handler (and it is only
+# attached once).
+@functools.cache
+def _ensure_handler():
+ """
+ The first time this function is called, attach a `StreamHandler` using the
+ same format as `logging.basicConfig` to the Matplotlib root logger.
+
+ Return this handler every time this function is called.
+ """
+ handler = logging.StreamHandler()
+ handler.setFormatter(logging.Formatter(logging.BASIC_FORMAT))
+ _log.addHandler(handler)
+ return handler
+
+
+def set_loglevel(level):
+ """
+ Configure Matplotlib's logging levels.
+
+ Matplotlib uses the standard library `logging` framework under the root
+ logger 'matplotlib'. This is a helper function to:
+
+ - set Matplotlib's root logger level
+ - set the root logger handler's level, creating the handler
+ if it does not exist yet
+
+ Typically, one should call ``set_loglevel("info")`` or
+ ``set_loglevel("debug")`` to get additional debugging information.
+
+ Users or applications that are installing their own logging handlers
+ may want to directly manipulate ``logging.getLogger('matplotlib')`` rather
+ than use this function.
+
+ Parameters
+ ----------
+ level : {"notset", "debug", "info", "warning", "error", "critical"}
+ The log level of the handler.
+
+ Notes
+ -----
+ The first time this function is called, an additional handler is attached
+ to Matplotlib's root handler; this handler is reused every time and this
+ function simply manipulates the logger and handler's level.
+
+ """
+ _log.setLevel(level.upper())
+ _ensure_handler().setLevel(level.upper())
+
+
+def _logged_cached(fmt, func=None):
+ """
+ Decorator that logs a function's return value, and memoizes that value.
+
+ After ::
+
+ @_logged_cached(fmt)
+ def func(): ...
+
+ the first call to *func* will log its return value at the DEBUG level using
+ %-format string *fmt*, and memoize it; later calls to *func* will directly
+ return that value.
+ """
+ if func is None: # Return the actual decorator.
+ return functools.partial(_logged_cached, fmt)
+
+ called = False
+ ret = None
+
+ @functools.wraps(func)
+ def wrapper(**kwargs):
+ nonlocal called, ret
+ if not called:
+ ret = func(**kwargs)
+ called = True
+ _log.debug(fmt, ret)
+ return ret
+
+ return wrapper
+
+
+_ExecInfo = namedtuple("_ExecInfo", "executable raw_version version")
+
+
+class ExecutableNotFoundError(FileNotFoundError):
+ """
+ Error raised when an executable that Matplotlib optionally
+ depends on can't be found.
+ """
+ pass
+
+
+@functools.cache
+def _get_executable_info(name):
+ """
+ Get the version of some executable that Matplotlib optionally depends on.
+
+ .. warning::
+ The list of executables that this function supports is set according to
+ Matplotlib's internal needs, and may change without notice.
+
+ Parameters
+ ----------
+ name : str
+ The executable to query. The following values are currently supported:
+ "dvipng", "gs", "inkscape", "magick", "pdftocairo", "pdftops". This
+ list is subject to change without notice.
+
+ Returns
+ -------
+ tuple
+ A namedtuple with fields ``executable`` (`str`) and ``version``
+ (`packaging.Version`, or ``None`` if the version cannot be determined).
+
+ Raises
+ ------
+ ExecutableNotFoundError
+ If the executable is not found or older than the oldest version
+ supported by Matplotlib. For debugging purposes, it is also
+ possible to "hide" an executable from Matplotlib by adding it to the
+ :envvar:`_MPLHIDEEXECUTABLES` environment variable (a comma-separated
+ list), which must be set prior to any calls to this function.
+ ValueError
+ If the executable is not one that we know how to query.
+ """
+
+ def impl(args, regex, min_ver=None, ignore_exit_code=False):
+ # Execute the subprocess specified by args; capture stdout and stderr.
+ # Search for a regex match in the output; if the match succeeds, the
+ # first group of the match is the version.
+ # Return an _ExecInfo if the executable exists, and has a version of
+ # at least min_ver (if set); else, raise ExecutableNotFoundError.
+ try:
+ output = subprocess.check_output(
+ args, stderr=subprocess.STDOUT,
+ text=True, errors="replace")
+ except subprocess.CalledProcessError as _cpe:
+ if ignore_exit_code:
+ output = _cpe.output
+ else:
+ raise ExecutableNotFoundError(str(_cpe)) from _cpe
+ except OSError as _ose:
+ raise ExecutableNotFoundError(str(_ose)) from _ose
+ match = re.search(regex, output)
+ if match:
+ raw_version = match.group(1)
+ version = parse_version(raw_version)
+ if min_ver is not None and version < parse_version(min_ver):
+ raise ExecutableNotFoundError(
+ f"You have {args[0]} version {version} but the minimum "
+ f"version supported by Matplotlib is {min_ver}")
+ return _ExecInfo(args[0], raw_version, version)
+ else:
+ raise ExecutableNotFoundError(
+ f"Failed to determine the version of {args[0]} from "
+ f"{' '.join(args)}, which output {output}")
+
+ if name in os.environ.get("_MPLHIDEEXECUTABLES", "").split(","):
+ raise ExecutableNotFoundError(f"{name} was hidden")
+
+ if name == "dvipng":
+ return impl(["dvipng", "-version"], "(?m)^dvipng(?: .*)? (.+)", "1.6")
+ elif name == "gs":
+ execs = (["gswin32c", "gswin64c", "mgs", "gs"] # "mgs" for miktex.
+ if sys.platform == "win32" else
+ ["gs"])
+ for e in execs:
+ try:
+ return impl([e, "--version"], "(.*)", "9")
+ except ExecutableNotFoundError:
+ pass
+ message = "Failed to find a Ghostscript installation"
+ raise ExecutableNotFoundError(message)
+ elif name == "inkscape":
+ try:
+ # Try headless option first (needed for Inkscape version < 1.0):
+ return impl(["inkscape", "--without-gui", "-V"],
+ "Inkscape ([^ ]*)")
+ except ExecutableNotFoundError:
+ pass # Suppress exception chaining.
+ # If --without-gui is not accepted, we may be using Inkscape >= 1.0 so
+ # try without it:
+ return impl(["inkscape", "-V"], "Inkscape ([^ ]*)")
+ elif name == "magick":
+ if sys.platform == "win32":
+ # Check the registry to avoid confusing ImageMagick's convert with
+ # Windows's builtin convert.exe.
+ import winreg
+ binpath = ""
+ for flag in [0, winreg.KEY_WOW64_32KEY, winreg.KEY_WOW64_64KEY]:
+ try:
+ with winreg.OpenKeyEx(
+ winreg.HKEY_LOCAL_MACHINE,
+ r"Software\Imagemagick\Current",
+ 0, winreg.KEY_QUERY_VALUE | flag) as hkey:
+ binpath = winreg.QueryValueEx(hkey, "BinPath")[0]
+ except OSError:
+ pass
+ path = None
+ if binpath:
+ for name in ["convert.exe", "magick.exe"]:
+ candidate = Path(binpath, name)
+ if candidate.exists():
+ path = str(candidate)
+ break
+ if path is None:
+ raise ExecutableNotFoundError(
+ "Failed to find an ImageMagick installation")
+ else:
+ path = "convert"
+ info = impl([path, "--version"], r"^Version: ImageMagick (\S*)")
+ if info.raw_version == "7.0.10-34":
+ # https://github.com/ImageMagick/ImageMagick/issues/2720
+ raise ExecutableNotFoundError(
+ f"You have ImageMagick {info.version}, which is unsupported")
+ return info
+ elif name == "pdftocairo":
+ return impl(["pdftocairo", "-v"], "pdftocairo version (.*)")
+ elif name == "pdftops":
+ info = impl(["pdftops", "-v"], "^pdftops version (.*)",
+ ignore_exit_code=True)
+ if info and not (
+ 3 <= info.version.major or
+ # poppler version numbers.
+ parse_version("0.9") <= info.version < parse_version("1.0")):
+ raise ExecutableNotFoundError(
+ f"You have pdftops version {info.version} but the minimum "
+ f"version supported by Matplotlib is 3.0")
+ return info
+ else:
+ raise ValueError(f"Unknown executable: {name!r}")
+
+
+def _get_xdg_config_dir():
+ """
+ Return the XDG configuration directory, according to the XDG base
+ directory spec:
+
+ https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
+ """
+ return os.environ.get('XDG_CONFIG_HOME') or str(Path.home() / ".config")
+
+
+def _get_xdg_cache_dir():
+ """
+ Return the XDG cache directory, according to the XDG base directory spec:
+
+ https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
+ """
+ return os.environ.get('XDG_CACHE_HOME') or str(Path.home() / ".cache")
+
+
+def _get_config_or_cache_dir(xdg_base_getter):
+ configdir = os.environ.get('MPLCONFIGDIR')
+ if configdir:
+ configdir = Path(configdir)
+ elif sys.platform.startswith(('linux', 'freebsd')):
+ # Only call _xdg_base_getter here so that MPLCONFIGDIR is tried first,
+ # as _xdg_base_getter can throw.
+ configdir = Path(xdg_base_getter(), "matplotlib")
+ else:
+ configdir = Path.home() / ".matplotlib"
+ # Resolve the path to handle potential issues with inaccessible symlinks.
+ configdir = configdir.resolve()
+ try:
+ configdir.mkdir(parents=True, exist_ok=True)
+ except OSError as exc:
+ _log.warning("mkdir -p failed for path %s: %s", configdir, exc)
+ else:
+ if os.access(str(configdir), os.W_OK) and configdir.is_dir():
+ return str(configdir)
+ _log.warning("%s is not a writable directory", configdir)
+ # If the config or cache directory cannot be created or is not a writable
+ # directory, create a temporary one.
+ try:
+ tmpdir = tempfile.mkdtemp(prefix="matplotlib-")
+ except OSError as exc:
+ raise OSError(
+ f"Matplotlib requires access to a writable cache directory, but there "
+ f"was an issue with the default path ({configdir}), and a temporary "
+ f"directory could not be created; set the MPLCONFIGDIR environment "
+ f"variable to a writable directory") from exc
+ os.environ["MPLCONFIGDIR"] = tmpdir
+ atexit.register(shutil.rmtree, tmpdir)
+ _log.warning(
+ "Matplotlib created a temporary cache directory at %s because there was "
+ "an issue with the default path (%s); it is highly recommended to set the "
+ "MPLCONFIGDIR environment variable to a writable directory, in particular to "
+ "speed up the import of Matplotlib and to better support multiprocessing.",
+ tmpdir, configdir)
+ return tmpdir
+
+
+@_logged_cached('CONFIGDIR=%s')
+def get_configdir():
+ """
+ Return the string path of the configuration directory.
+
+ The directory is chosen as follows:
+
+ 1. If the MPLCONFIGDIR environment variable is supplied, choose that.
+ 2. On Linux, follow the XDG specification and look first in
+ ``$XDG_CONFIG_HOME``, if defined, or ``$HOME/.config``. On other
+ platforms, choose ``$HOME/.matplotlib``.
+ 3. If the chosen directory exists and is writable, use that as the
+ configuration directory.
+ 4. Else, create a temporary directory, and use it as the configuration
+ directory.
+ """
+ return _get_config_or_cache_dir(_get_xdg_config_dir)
+
+
+@_logged_cached('CACHEDIR=%s')
+def get_cachedir():
+ """
+ Return the string path of the cache directory.
+
+ The procedure used to find the directory is the same as for
+ `get_configdir`, except using ``$XDG_CACHE_HOME``/``$HOME/.cache`` instead.
+ """
+ return _get_config_or_cache_dir(_get_xdg_cache_dir)
+
+
+@_logged_cached('matplotlib data path: %s')
+def get_data_path():
+ """Return the path to Matplotlib data."""
+ return str(Path(__file__).with_name("mpl-data"))
+
+
+def matplotlib_fname():
+ """
+ Get the location of the config file.
+
+ The file location is determined in the following order
+
+ - ``$PWD/matplotlibrc``
+ - ``$MATPLOTLIBRC`` if it is not a directory
+ - ``$MATPLOTLIBRC/matplotlibrc``
+ - ``$MPLCONFIGDIR/matplotlibrc``
+ - On Linux,
+ - ``$XDG_CONFIG_HOME/matplotlib/matplotlibrc`` (if ``$XDG_CONFIG_HOME``
+ is defined)
+ - or ``$HOME/.config/matplotlib/matplotlibrc`` (if ``$XDG_CONFIG_HOME``
+ is not defined)
+ - On other platforms,
+ - ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined
+ - Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always
+ exist.
+ """
+
+ def gen_candidates():
+ # rely on down-stream code to make absolute. This protects us
+ # from having to directly get the current working directory
+ # which can fail if the user has ended up with a cwd that is
+ # non-existent.
+ yield 'matplotlibrc'
+ try:
+ matplotlibrc = os.environ['MATPLOTLIBRC']
+ except KeyError:
+ pass
+ else:
+ yield matplotlibrc
+ yield os.path.join(matplotlibrc, 'matplotlibrc')
+ yield os.path.join(get_configdir(), 'matplotlibrc')
+ yield os.path.join(get_data_path(), 'matplotlibrc')
+
+ for fname in gen_candidates():
+ if os.path.exists(fname) and not os.path.isdir(fname):
+ return fname
+
+ raise RuntimeError("Could not find matplotlibrc file; your Matplotlib "
+ "install is broken")
+
+
+# rcParams deprecated and automatically mapped to another key.
+# Values are tuples of (version, new_name, f_old2new, f_new2old).
+_deprecated_map = {}
+# rcParams deprecated; some can manually be mapped to another key.
+# Values are tuples of (version, new_name_or_None).
+_deprecated_ignore_map = {}
+# rcParams deprecated; can use None to suppress warnings; remain actually
+# listed in the rcParams.
+# Values are tuples of (version,)
+_deprecated_remain_as_none = {}
+
+
+@_docstring.Substitution(
+ "\n".join(map("- {}".format, sorted(rcsetup._validators, key=str.lower)))
+)
+class RcParams(MutableMapping, dict):
+ """
+ A dict-like key-value store for config parameters, including validation.
+
+ Validating functions are defined and associated with rc parameters in
+ :mod:`matplotlib.rcsetup`.
+
+ The list of rcParams is:
+
+ %s
+
+ See Also
+ --------
+ :ref:`customizing-with-matplotlibrc-files`
+ """
+
+ validate = rcsetup._validators
+
+ # validate values on the way in
+ def __init__(self, *args, **kwargs):
+ self.update(*args, **kwargs)
+
+ def _set(self, key, val):
+ """
+ Directly write data bypassing deprecation and validation logic.
+
+ Notes
+ -----
+ As end user or downstream library you almost always should use
+ ``rcParams[key] = val`` and not ``_set()``.
+
+ There are only very few special cases that need direct data access.
+ These cases previously used ``dict.__setitem__(rcParams, key, val)``,
+ which is now deprecated and replaced by ``rcParams._set(key, val)``.
+
+ Even though private, we guarantee API stability for ``rcParams._set``,
+ i.e. it is subject to Matplotlib's API and deprecation policy.
+
+ :meta public:
+ """
+ dict.__setitem__(self, key, val)
+
+ def _get(self, key):
+ """
+ Directly read data bypassing deprecation, backend and validation
+ logic.
+
+ Notes
+ -----
+ As end user or downstream library you almost always should use
+ ``val = rcParams[key]`` and not ``_get()``.
+
+ There are only very few special cases that need direct data access.
+ These cases previously used ``dict.__getitem__(rcParams, key, val)``,
+ which is now deprecated and replaced by ``rcParams._get(key)``.
+
+ Even though private, we guarantee API stability for ``rcParams._get``,
+ i.e. it is subject to Matplotlib's API and deprecation policy.
+
+ :meta public:
+ """
+ return dict.__getitem__(self, key)
+
+ def _update_raw(self, other_params):
+ """
+ Directly update the data from *other_params*, bypassing deprecation,
+ backend and validation logic on both sides.
+
+ This ``rcParams._update_raw(params)`` replaces the previous pattern
+ ``dict.update(rcParams, params)``.
+
+ Parameters
+ ----------
+ other_params : dict or `.RcParams`
+ The input mapping from which to update.
+ """
+ if isinstance(other_params, RcParams):
+ other_params = dict.items(other_params)
+ dict.update(self, other_params)
+
+ def _ensure_has_backend(self):
+ """
+ Ensure that a "backend" entry exists.
+
+ Normally, the default matplotlibrc file contains *no* entry for "backend" (the
+ corresponding line starts with ##, not #; we fill in _auto_backend_sentinel
+ in that case. However, packagers can set a different default backend
+ (resulting in a normal `#backend: foo` line) in which case we should *not*
+ fill in _auto_backend_sentinel.
+ """
+ dict.setdefault(self, "backend", rcsetup._auto_backend_sentinel)
+
+ def __setitem__(self, key, val):
+ try:
+ if key in _deprecated_map:
+ version, alt_key, alt_val, inverse_alt = _deprecated_map[key]
+ _api.warn_deprecated(
+ version, name=key, obj_type="rcparam", alternative=alt_key)
+ key = alt_key
+ val = alt_val(val)
+ elif key in _deprecated_remain_as_none and val is not None:
+ version, = _deprecated_remain_as_none[key]
+ _api.warn_deprecated(version, name=key, obj_type="rcparam")
+ elif key in _deprecated_ignore_map:
+ version, alt_key = _deprecated_ignore_map[key]
+ _api.warn_deprecated(
+ version, name=key, obj_type="rcparam", alternative=alt_key)
+ return
+ elif key == 'backend':
+ if val is rcsetup._auto_backend_sentinel:
+ if 'backend' in self:
+ return
+ try:
+ cval = self.validate[key](val)
+ except ValueError as ve:
+ raise ValueError(f"Key {key}: {ve}") from None
+ self._set(key, cval)
+ except KeyError as err:
+ raise KeyError(
+ f"{key} is not a valid rc parameter (see rcParams.keys() for "
+ f"a list of valid parameters)") from err
+
+ def __getitem__(self, key):
+ if key in _deprecated_map:
+ version, alt_key, alt_val, inverse_alt = _deprecated_map[key]
+ _api.warn_deprecated(
+ version, name=key, obj_type="rcparam", alternative=alt_key)
+ return inverse_alt(self._get(alt_key))
+
+ elif key in _deprecated_ignore_map:
+ version, alt_key = _deprecated_ignore_map[key]
+ _api.warn_deprecated(
+ version, name=key, obj_type="rcparam", alternative=alt_key)
+ return self._get(alt_key) if alt_key else None
+
+ # In theory, this should only ever be used after the global rcParams
+ # has been set up, but better be safe e.g. in presence of breakpoints.
+ elif key == "backend" and self is globals().get("rcParams"):
+ val = self._get(key)
+ if val is rcsetup._auto_backend_sentinel:
+ from matplotlib import pyplot as plt
+ plt.switch_backend(rcsetup._auto_backend_sentinel)
+
+ return self._get(key)
+
+ def _get_backend_or_none(self):
+ """Get the requested backend, if any, without triggering resolution."""
+ backend = self._get("backend")
+ return None if backend is rcsetup._auto_backend_sentinel else backend
+
+ def __repr__(self):
+ class_name = self.__class__.__name__
+ indent = len(class_name) + 1
+ with _api.suppress_matplotlib_deprecation_warning():
+ repr_split = pprint.pformat(dict(self), indent=1,
+ width=80 - indent).split('\n')
+ repr_indented = ('\n' + ' ' * indent).join(repr_split)
+ return f'{class_name}({repr_indented})'
+
+ def __str__(self):
+ return '\n'.join(map('{0[0]}: {0[1]}'.format, sorted(self.items())))
+
+ def __iter__(self):
+ """Yield sorted list of keys."""
+ with _api.suppress_matplotlib_deprecation_warning():
+ yield from sorted(dict.__iter__(self))
+
+ def __len__(self):
+ return dict.__len__(self)
+
+ def find_all(self, pattern):
+ """
+ Return the subset of this RcParams dictionary whose keys match,
+ using :func:`re.search`, the given ``pattern``.
+
+ .. note::
+
+ Changes to the returned dictionary are *not* propagated to
+ the parent RcParams dictionary.
+
+ """
+ pattern_re = re.compile(pattern)
+ return RcParams((key, value)
+ for key, value in self.items()
+ if pattern_re.search(key))
+
+ def copy(self):
+ """Copy this RcParams instance."""
+ rccopy = RcParams()
+ for k in self: # Skip deprecations and revalidation.
+ rccopy._set(k, self._get(k))
+ return rccopy
+
+
+def rc_params(fail_on_error=False):
+ """Construct a `RcParams` instance from the default Matplotlib rc file."""
+ return rc_params_from_file(matplotlib_fname(), fail_on_error)
+
+
+@functools.cache
+def _get_ssl_context():
+ try:
+ import certifi
+ except ImportError:
+ _log.debug("Could not import certifi.")
+ return None
+ import ssl
+ return ssl.create_default_context(cafile=certifi.where())
+
+
+@contextlib.contextmanager
+def _open_file_or_url(fname):
+ if (isinstance(fname, str)
+ and fname.startswith(('http://', 'https://', 'ftp://', 'file:'))):
+ import urllib.request
+ ssl_ctx = _get_ssl_context()
+ if ssl_ctx is None:
+ _log.debug(
+ "Could not get certifi ssl context, https may not work."
+ )
+ with urllib.request.urlopen(fname, context=ssl_ctx) as f:
+ yield (line.decode('utf-8') for line in f)
+ else:
+ fname = os.path.expanduser(fname)
+ with open(fname, encoding='utf-8') as f:
+ yield f
+
+
+def _rc_params_in_file(fname, transform=lambda x: x, fail_on_error=False):
+ """
+ Construct a `RcParams` instance from file *fname*.
+
+ Unlike `rc_params_from_file`, the configuration class only contains the
+ parameters specified in the file (i.e. default values are not filled in).
+
+ Parameters
+ ----------
+ fname : path-like
+ The loaded file.
+ transform : callable, default: the identity function
+ A function called on each individual line of the file to transform it,
+ before further parsing.
+ fail_on_error : bool, default: False
+ Whether invalid entries should result in an exception or a warning.
+ """
+ import matplotlib as mpl
+ rc_temp = {}
+ with _open_file_or_url(fname) as fd:
+ try:
+ for line_no, line in enumerate(fd, 1):
+ line = transform(line)
+ strippedline = cbook._strip_comment(line)
+ if not strippedline:
+ continue
+ tup = strippedline.split(':', 1)
+ if len(tup) != 2:
+ _log.warning('Missing colon in file %r, line %d (%r)',
+ fname, line_no, line.rstrip('\n'))
+ continue
+ key, val = tup
+ key = key.strip()
+ val = val.strip()
+ if val.startswith('"') and val.endswith('"'):
+ val = val[1:-1] # strip double quotes
+ if key in rc_temp:
+ _log.warning('Duplicate key in file %r, line %d (%r)',
+ fname, line_no, line.rstrip('\n'))
+ rc_temp[key] = (val, line, line_no)
+ except UnicodeDecodeError:
+ _log.warning('Cannot decode configuration file %r as utf-8.',
+ fname)
+ raise
+
+ config = RcParams()
+
+ for key, (val, line, line_no) in rc_temp.items():
+ if key in rcsetup._validators:
+ if fail_on_error:
+ config[key] = val # try to convert to proper type or raise
+ else:
+ try:
+ config[key] = val # try to convert to proper type or skip
+ except Exception as msg:
+ _log.warning('Bad value in file %r, line %d (%r): %s',
+ fname, line_no, line.rstrip('\n'), msg)
+ elif key in _deprecated_ignore_map:
+ version, alt_key = _deprecated_ignore_map[key]
+ _api.warn_deprecated(
+ version, name=key, alternative=alt_key, obj_type='rcparam',
+ addendum="Please update your matplotlibrc.")
+ else:
+ # __version__ must be looked up as an attribute to trigger the
+ # module-level __getattr__.
+ version = ('main' if '.post' in mpl.__version__
+ else f'v{mpl.__version__}')
+ _log.warning("""
+Bad key %(key)s in file %(fname)s, line %(line_no)s (%(line)r)
+You probably need to get an updated matplotlibrc file from
+https://github.com/matplotlib/matplotlib/blob/%(version)s/lib/matplotlib/mpl-data/matplotlibrc
+or from the matplotlib source distribution""",
+ dict(key=key, fname=fname, line_no=line_no,
+ line=line.rstrip('\n'), version=version))
+ return config
+
+
+def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
+ """
+ Construct a `RcParams` from file *fname*.
+
+ Parameters
+ ----------
+ fname : str or path-like
+ A file with Matplotlib rc settings.
+ fail_on_error : bool
+ If True, raise an error when the parser fails to convert a parameter.
+ use_default_template : bool
+ If True, initialize with default parameters before updating with those
+ in the given file. If False, the configuration class only contains the
+ parameters specified in the file. (Useful for updating dicts.)
+ """
+ config_from_file = _rc_params_in_file(fname, fail_on_error=fail_on_error)
+
+ if not use_default_template:
+ return config_from_file
+
+ with _api.suppress_matplotlib_deprecation_warning():
+ config = RcParams({**rcParamsDefault, **config_from_file})
+
+ if "".join(config['text.latex.preamble']):
+ _log.info("""
+*****************************************************************
+You have the following UNSUPPORTED LaTeX preamble customizations:
+%s
+Please do not ask for support with these customizations active.
+*****************************************************************
+""", '\n'.join(config['text.latex.preamble']))
+ _log.debug('loaded rc file %s', fname)
+
+ return config
+
+
+rcParamsDefault = _rc_params_in_file(
+ cbook._get_data_path("matplotlibrc"),
+ # Strip leading comment.
+ transform=lambda line: line[1:] if line.startswith("#") else line,
+ fail_on_error=True)
+rcParamsDefault._update_raw(rcsetup._hardcoded_defaults)
+rcParamsDefault._ensure_has_backend()
+
+rcParams = RcParams() # The global instance.
+rcParams._update_raw(rcParamsDefault)
+rcParams._update_raw(_rc_params_in_file(matplotlib_fname()))
+rcParamsOrig = rcParams.copy()
+with _api.suppress_matplotlib_deprecation_warning():
+ # This also checks that all rcParams are indeed listed in the template.
+ # Assigning to rcsetup.defaultParams is left only for backcompat.
+ defaultParams = rcsetup.defaultParams = {
+ # We want to resolve deprecated rcParams, but not backend...
+ key: [(rcsetup._auto_backend_sentinel if key == "backend" else
+ rcParamsDefault[key]),
+ validator]
+ for key, validator in rcsetup._validators.items()}
+if rcParams['axes.formatter.use_locale']:
+ locale.setlocale(locale.LC_ALL, '')
+
+
+def rc(group, **kwargs):
+ """
+ Set the current `.rcParams`. *group* is the grouping for the rc, e.g.,
+ for ``lines.linewidth`` the group is ``lines``, for
+ ``axes.facecolor``, the group is ``axes``, and so on. Group may
+ also be a list or tuple of group names, e.g., (*xtick*, *ytick*).
+ *kwargs* is a dictionary attribute name/value pairs, e.g.,::
+
+ rc('lines', linewidth=2, color='r')
+
+ sets the current `.rcParams` and is equivalent to::
+
+ rcParams['lines.linewidth'] = 2
+ rcParams['lines.color'] = 'r'
+
+ The following aliases are available to save typing for interactive users:
+
+ ===== =================
+ Alias Property
+ ===== =================
+ 'lw' 'linewidth'
+ 'ls' 'linestyle'
+ 'c' 'color'
+ 'fc' 'facecolor'
+ 'ec' 'edgecolor'
+ 'mew' 'markeredgewidth'
+ 'aa' 'antialiased'
+ ===== =================
+
+ Thus you could abbreviate the above call as::
+
+ rc('lines', lw=2, c='r')
+
+ Note you can use python's kwargs dictionary facility to store
+ dictionaries of default parameters. e.g., you can customize the
+ font rc as follows::
+
+ font = {'family' : 'monospace',
+ 'weight' : 'bold',
+ 'size' : 'larger'}
+ rc('font', **font) # pass in the font dict as kwargs
+
+ This enables you to easily switch between several configurations. Use
+ ``matplotlib.style.use('default')`` or :func:`~matplotlib.rcdefaults` to
+ restore the default `.rcParams` after changes.
+
+ Notes
+ -----
+ Similar functionality is available by using the normal dict interface, i.e.
+ ``rcParams.update({"lines.linewidth": 2, ...})`` (but ``rcParams.update``
+ does not support abbreviations or grouping).
+ """
+
+ aliases = {
+ 'lw': 'linewidth',
+ 'ls': 'linestyle',
+ 'c': 'color',
+ 'fc': 'facecolor',
+ 'ec': 'edgecolor',
+ 'mew': 'markeredgewidth',
+ 'aa': 'antialiased',
+ }
+
+ if isinstance(group, str):
+ group = (group,)
+ for g in group:
+ for k, v in kwargs.items():
+ name = aliases.get(k) or k
+ key = f'{g}.{name}'
+ try:
+ rcParams[key] = v
+ except KeyError as err:
+ raise KeyError(('Unrecognized key "%s" for group "%s" and '
+ 'name "%s"') % (key, g, name)) from err
+
+
+def rcdefaults():
+ """
+ Restore the `.rcParams` from Matplotlib's internal default style.
+
+ Style-blacklisted `.rcParams` (defined in
+ ``matplotlib.style.core.STYLE_BLACKLIST``) are not updated.
+
+ See Also
+ --------
+ matplotlib.rc_file_defaults
+ Restore the `.rcParams` from the rc file originally loaded by
+ Matplotlib.
+ matplotlib.style.use
+ Use a specific style file. Call ``style.use('default')`` to restore
+ the default style.
+ """
+ # Deprecation warnings were already handled when creating rcParamsDefault,
+ # no need to reemit them here.
+ with _api.suppress_matplotlib_deprecation_warning():
+ from .style.core import STYLE_BLACKLIST
+ rcParams.clear()
+ rcParams.update({k: v for k, v in rcParamsDefault.items()
+ if k not in STYLE_BLACKLIST})
+
+
+def rc_file_defaults():
+ """
+ Restore the `.rcParams` from the original rc file loaded by Matplotlib.
+
+ Style-blacklisted `.rcParams` (defined in
+ ``matplotlib.style.core.STYLE_BLACKLIST``) are not updated.
+ """
+ # Deprecation warnings were already handled when creating rcParamsOrig, no
+ # need to reemit them here.
+ with _api.suppress_matplotlib_deprecation_warning():
+ from .style.core import STYLE_BLACKLIST
+ rcParams.update({k: rcParamsOrig[k] for k in rcParamsOrig
+ if k not in STYLE_BLACKLIST})
+
+
+def rc_file(fname, *, use_default_template=True):
+ """
+ Update `.rcParams` from file.
+
+ Style-blacklisted `.rcParams` (defined in
+ ``matplotlib.style.core.STYLE_BLACKLIST``) are not updated.
+
+ Parameters
+ ----------
+ fname : str or path-like
+ A file with Matplotlib rc settings.
+
+ use_default_template : bool
+ If True, initialize with default parameters before updating with those
+ in the given file. If False, the current configuration persists
+ and only the parameters specified in the file are updated.
+ """
+ # Deprecation warnings were already handled in rc_params_from_file, no need
+ # to reemit them here.
+ with _api.suppress_matplotlib_deprecation_warning():
+ from .style.core import STYLE_BLACKLIST
+ rc_from_file = rc_params_from_file(
+ fname, use_default_template=use_default_template)
+ rcParams.update({k: rc_from_file[k] for k in rc_from_file
+ if k not in STYLE_BLACKLIST})
+
+
+@contextlib.contextmanager
+def rc_context(rc=None, fname=None):
+ """
+ Return a context manager for temporarily changing rcParams.
+
+ The :rc:`backend` will not be reset by the context manager.
+
+ rcParams changed both through the context manager invocation and
+ in the body of the context will be reset on context exit.
+
+ Parameters
+ ----------
+ rc : dict
+ The rcParams to temporarily set.
+ fname : str or path-like
+ A file with Matplotlib rc settings. If both *fname* and *rc* are given,
+ settings from *rc* take precedence.
+
+ See Also
+ --------
+ :ref:`customizing-with-matplotlibrc-files`
+
+ Examples
+ --------
+ Passing explicit values via a dict::
+
+ with mpl.rc_context({'interactive': False}):
+ fig, ax = plt.subplots()
+ ax.plot(range(3), range(3))
+ fig.savefig('example.png')
+ plt.close(fig)
+
+ Loading settings from a file::
+
+ with mpl.rc_context(fname='print.rc'):
+ plt.plot(x, y) # uses 'print.rc'
+
+ Setting in the context body::
+
+ with mpl.rc_context():
+ # will be reset
+ mpl.rcParams['lines.linewidth'] = 5
+ plt.plot(x, y)
+
+ """
+ orig = dict(rcParams.copy())
+ del orig['backend']
+ try:
+ if fname:
+ rc_file(fname)
+ if rc:
+ rcParams.update(rc)
+ yield
+ finally:
+ rcParams._update_raw(orig) # Revert to the original rcs.
+
+
+def use(backend, *, force=True):
+ """
+ Select the backend used for rendering and GUI integration.
+
+ If pyplot is already imported, `~matplotlib.pyplot.switch_backend` is used
+ and if the new backend is different than the current backend, all Figures
+ will be closed.
+
+ Parameters
+ ----------
+ backend : str
+ The backend to switch to. This can either be one of the standard
+ backend names, which are case-insensitive:
+
+ - interactive backends:
+ GTK3Agg, GTK3Cairo, GTK4Agg, GTK4Cairo, MacOSX, nbAgg, notebook, QtAgg,
+ QtCairo, TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo, Qt5Agg, Qt5Cairo
+
+ - non-interactive backends:
+ agg, cairo, pdf, pgf, ps, svg, template
+
+ or a string of the form: ``module://my.module.name``.
+
+ notebook is a synonym for nbAgg.
+
+ Switching to an interactive backend is not possible if an unrelated
+ event loop has already been started (e.g., switching to GTK3Agg if a
+ TkAgg window has already been opened). Switching to a non-interactive
+ backend is always possible.
+
+ force : bool, default: True
+ If True (the default), raise an `ImportError` if the backend cannot be
+ set up (either because it fails to import, or because an incompatible
+ GUI interactive framework is already running); if False, silently
+ ignore the failure.
+
+ See Also
+ --------
+ :ref:`backends`
+ matplotlib.get_backend
+ matplotlib.pyplot.switch_backend
+
+ """
+ name = rcsetup.validate_backend(backend)
+ # don't (prematurely) resolve the "auto" backend setting
+ if rcParams._get_backend_or_none() == name:
+ # Nothing to do if the requested backend is already set
+ pass
+ else:
+ # if pyplot is not already imported, do not import it. Doing
+ # so may trigger a `plt.switch_backend` to the _default_ backend
+ # before we get a chance to change to the one the user just requested
+ plt = sys.modules.get('matplotlib.pyplot')
+ # if pyplot is imported, then try to change backends
+ if plt is not None:
+ try:
+ # we need this import check here to re-raise if the
+ # user does not have the libraries to support their
+ # chosen backend installed.
+ plt.switch_backend(name)
+ except ImportError:
+ if force:
+ raise
+ # if we have not imported pyplot, then we can set the rcParam
+ # value which will be respected when the user finally imports
+ # pyplot
+ else:
+ rcParams['backend'] = backend
+ # if the user has asked for a given backend, do not helpfully
+ # fallback
+ rcParams['backend_fallback'] = False
+
+
+if os.environ.get('MPLBACKEND'):
+ rcParams['backend'] = os.environ.get('MPLBACKEND')
+
+
+def get_backend(*, auto_select=True):
+ """
+ Return the name of the current backend.
+
+ Parameters
+ ----------
+ auto_select : bool, default: True
+ Whether to trigger backend resolution if no backend has been
+ selected so far. If True, this ensures that a valid backend
+ is returned. If False, this returns None if no backend has been
+ selected so far.
+
+ .. versionadded:: 3.10
+
+ .. admonition:: Provisional
+
+ The *auto_select* flag is provisional. It may be changed or removed
+ without prior warning.
+
+ See Also
+ --------
+ matplotlib.use
+ """
+ if auto_select:
+ return rcParams['backend']
+ else:
+ backend = rcParams._get('backend')
+ if backend is rcsetup._auto_backend_sentinel:
+ return None
+ else:
+ return backend
+
+
+def interactive(b):
+ """
+ Set whether to redraw after every plotting command (e.g. `.pyplot.xlabel`).
+ """
+ rcParams['interactive'] = b
+
+
+def is_interactive():
+ """
+ Return whether to redraw after every plotting command.
+
+ .. note::
+
+ This function is only intended for use in backends. End users should
+ use `.pyplot.isinteractive` instead.
+ """
+ return rcParams['interactive']
+
+
+def _val_or_rc(val, rc_name):
+ """
+ If *val* is None, return ``mpl.rcParams[rc_name]``, otherwise return val.
+ """
+ return val if val is not None else rcParams[rc_name]
+
+
+def _init_tests():
+ # The version of FreeType to install locally for running the tests. This must match
+ # the value in `meson.build`.
+ LOCAL_FREETYPE_VERSION = '2.6.1'
+
+ from matplotlib import ft2font
+ if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
+ ft2font.__freetype_build_type__ != 'local'):
+ _log.warning(
+ "Matplotlib is not built with the correct FreeType version to run tests. "
+ "Rebuild without setting system-freetype=true in Meson setup options. "
+ "Expect many image comparison failures below. "
+ "Expected freetype version %s. "
+ "Found freetype version %s. "
+ "Freetype build type is %slocal.",
+ LOCAL_FREETYPE_VERSION,
+ ft2font.__freetype_version__,
+ "" if ft2font.__freetype_build_type__ == 'local' else "not ")
+
+
+def _replacer(data, value):
+ """
+ Either returns ``data[value]`` or passes ``data`` back, converts either to
+ a sequence.
+ """
+ try:
+ # if key isn't a string don't bother
+ if isinstance(value, str):
+ # try to use __getitem__
+ value = data[value]
+ except Exception:
+ # key does not exist, silently fall back to key
+ pass
+ return cbook.sanitize_sequence(value)
+
+
+def _label_from_arg(y, default_name):
+ try:
+ return y.name
+ except AttributeError:
+ if isinstance(default_name, str):
+ return default_name
+ return None
+
+
+def _add_data_doc(docstring, replace_names):
+ """
+ Add documentation for a *data* field to the given docstring.
+
+ Parameters
+ ----------
+ docstring : str
+ The input docstring.
+ replace_names : list of str or None
+ The list of parameter names which arguments should be replaced by
+ ``data[name]`` (if ``data[name]`` does not throw an exception). If
+ None, replacement is attempted for all arguments.
+
+ Returns
+ -------
+ str
+ The augmented docstring.
+ """
+ if (docstring is None
+ or replace_names is not None and len(replace_names) == 0):
+ return docstring
+ docstring = inspect.cleandoc(docstring)
+
+ data_doc = ("""\
+ If given, all parameters also accept a string ``s``, which is
+ interpreted as ``data[s]`` if ``s`` is a key in ``data``."""
+ if replace_names is None else f"""\
+ If given, the following parameters also accept a string ``s``, which is
+ interpreted as ``data[s]`` if ``s`` is a key in ``data``:
+
+ {', '.join(map('*{}*'.format, replace_names))}""")
+ # using string replacement instead of formatting has the advantages
+ # 1) simpler indent handling
+ # 2) prevent problems with formatting characters '{', '%' in the docstring
+ if _log.level <= logging.DEBUG:
+ # test_data_parameter_replacement() tests against these log messages
+ # make sure to keep message and test in sync
+ if "data : indexable object, optional" not in docstring:
+ _log.debug("data parameter docstring error: no data parameter")
+ if 'DATA_PARAMETER_PLACEHOLDER' not in docstring:
+ _log.debug("data parameter docstring error: missing placeholder")
+ return docstring.replace(' DATA_PARAMETER_PLACEHOLDER', data_doc)
+
+
+def _preprocess_data(func=None, *, replace_names=None, label_namer=None):
+ """
+ A decorator to add a 'data' kwarg to a function.
+
+ When applied::
+
+ @_preprocess_data()
+ def func(ax, *args, **kwargs): ...
+
+ the signature is modified to ``decorated(ax, *args, data=None, **kwargs)``
+ with the following behavior:
+
+ - if called with ``data=None``, forward the other arguments to ``func``;
+ - otherwise, *data* must be a mapping; for any argument passed in as a
+ string ``name``, replace the argument by ``data[name]`` (if this does not
+ throw an exception), then forward the arguments to ``func``.
+
+ In either case, any argument that is a `MappingView` is also converted to a
+ list.
+
+ Parameters
+ ----------
+ replace_names : list of str or None, default: None
+ The list of parameter names for which lookup into *data* should be
+ attempted. If None, replacement is attempted for all arguments.
+ label_namer : str, default: None
+ If set e.g. to "namer" (which must be a kwarg in the function's
+ signature -- not as ``**kwargs``), if the *namer* argument passed in is
+ a (string) key of *data* and no *label* kwarg is passed, then use the
+ (string) value of the *namer* as *label*. ::
+
+ @_preprocess_data(label_namer="foo")
+ def func(foo, label=None): ...
+
+ func("key", data={"key": value})
+ # is equivalent to
+ func.__wrapped__(value, label="key")
+ """
+
+ if func is None: # Return the actual decorator.
+ return functools.partial(
+ _preprocess_data,
+ replace_names=replace_names, label_namer=label_namer)
+
+ sig = inspect.signature(func)
+ varargs_name = None
+ varkwargs_name = None
+ arg_names = []
+ params = list(sig.parameters.values())
+ for p in params:
+ if p.kind is Parameter.VAR_POSITIONAL:
+ varargs_name = p.name
+ elif p.kind is Parameter.VAR_KEYWORD:
+ varkwargs_name = p.name
+ else:
+ arg_names.append(p.name)
+ data_param = Parameter("data", Parameter.KEYWORD_ONLY, default=None)
+ if varkwargs_name:
+ params.insert(-1, data_param)
+ else:
+ params.append(data_param)
+ new_sig = sig.replace(parameters=params)
+ arg_names = arg_names[1:] # remove the first "ax" / self arg
+
+ assert {*arg_names}.issuperset(replace_names or []) or varkwargs_name, (
+ "Matplotlib internal error: invalid replace_names "
+ f"({replace_names!r}) for {func.__name__!r}")
+ assert label_namer is None or label_namer in arg_names, (
+ "Matplotlib internal error: invalid label_namer "
+ f"({label_namer!r}) for {func.__name__!r}")
+
+ @functools.wraps(func)
+ def inner(ax, *args, data=None, **kwargs):
+ if data is None:
+ return func(
+ ax,
+ *map(cbook.sanitize_sequence, args),
+ **{k: cbook.sanitize_sequence(v) for k, v in kwargs.items()})
+
+ bound = new_sig.bind(ax, *args, **kwargs)
+ auto_label = (bound.arguments.get(label_namer)
+ or bound.kwargs.get(label_namer))
+
+ for k, v in bound.arguments.items():
+ if k == varkwargs_name:
+ for k1, v1 in v.items():
+ if replace_names is None or k1 in replace_names:
+ v[k1] = _replacer(data, v1)
+ elif k == varargs_name:
+ if replace_names is None:
+ bound.arguments[k] = tuple(_replacer(data, v1) for v1 in v)
+ else:
+ if replace_names is None or k in replace_names:
+ bound.arguments[k] = _replacer(data, v)
+
+ new_args = bound.args
+ new_kwargs = bound.kwargs
+
+ args_and_kwargs = {**bound.arguments, **bound.kwargs}
+ if label_namer and "label" not in args_and_kwargs:
+ new_kwargs["label"] = _label_from_arg(
+ args_and_kwargs.get(label_namer), auto_label)
+
+ return func(*new_args, **new_kwargs)
+
+ inner.__doc__ = _add_data_doc(inner.__doc__, replace_names)
+ inner.__signature__ = new_sig
+ return inner
+
+
+_log.debug('interactive is %s', is_interactive())
+_log.debug('platform is %s', sys.platform)
+
+
+@_api.deprecated("3.10", alternative="matplotlib.cbook.sanitize_sequence")
+def sanitize_sequence(data):
+ return cbook.sanitize_sequence(data)
+
+
+@_api.deprecated("3.10", alternative="matplotlib.rcsetup.validate_backend")
+def validate_backend(s):
+ return rcsetup.validate_backend(s)
+
+
+# workaround: we must defer colormaps import to after loading rcParams, because
+# colormap creation depends on rcParams
+from matplotlib.cm import _colormaps as colormaps # noqa: E402
+from matplotlib.cm import _multivar_colormaps as multivar_colormaps # noqa: E402
+from matplotlib.cm import _bivar_colormaps as bivar_colormaps # noqa: E402
+from matplotlib.colors import _color_sequences as color_sequences # noqa: E402
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__init__.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__init__.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..88058ffd7def28740b4942d3851a5f43e49b086a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__init__.pyi
@@ -0,0 +1,124 @@
+__all__ = [
+ "__bibtex__",
+ "__version__",
+ "__version_info__",
+ "set_loglevel",
+ "ExecutableNotFoundError",
+ "get_configdir",
+ "get_cachedir",
+ "get_data_path",
+ "matplotlib_fname",
+ "MatplotlibDeprecationWarning",
+ "RcParams",
+ "rc_params",
+ "rc_params_from_file",
+ "rcParamsDefault",
+ "rcParams",
+ "rcParamsOrig",
+ "defaultParams",
+ "rc",
+ "rcdefaults",
+ "rc_file_defaults",
+ "rc_file",
+ "rc_context",
+ "use",
+ "get_backend",
+ "interactive",
+ "is_interactive",
+ "colormaps",
+ "color_sequences",
+]
+
+import os
+from pathlib import Path
+
+from collections.abc import Callable, Generator
+import contextlib
+from packaging.version import Version
+
+from matplotlib._api import MatplotlibDeprecationWarning
+from typing import Any, Literal, NamedTuple, overload
+
+class _VersionInfo(NamedTuple):
+ major: int
+ minor: int
+ micro: int
+ releaselevel: str
+ serial: int
+
+__bibtex__: str
+__version__: str
+__version_info__: _VersionInfo
+
+def set_loglevel(level: str) -> None: ...
+
+class _ExecInfo(NamedTuple):
+ executable: str
+ raw_version: str
+ version: Version
+
+class ExecutableNotFoundError(FileNotFoundError): ...
+
+def _get_executable_info(name: str) -> _ExecInfo: ...
+def get_configdir() -> str: ...
+def get_cachedir() -> str: ...
+def get_data_path() -> str: ...
+def matplotlib_fname() -> str: ...
+
+class RcParams(dict[str, Any]):
+ validate: dict[str, Callable]
+ def __init__(self, *args, **kwargs) -> None: ...
+ def _set(self, key: str, val: Any) -> None: ...
+ def _get(self, key: str) -> Any: ...
+
+ def _update_raw(self, other_params: dict | RcParams) -> None: ...
+
+ def _ensure_has_backend(self) -> None: ...
+ def __setitem__(self, key: str, val: Any) -> None: ...
+ def __getitem__(self, key: str) -> Any: ...
+ def __iter__(self) -> Generator[str, None, None]: ...
+ def __len__(self) -> int: ...
+ def find_all(self, pattern: str) -> RcParams: ...
+ def copy(self) -> RcParams: ...
+
+def rc_params(fail_on_error: bool = ...) -> RcParams: ...
+def rc_params_from_file(
+ fname: str | Path | os.PathLike,
+ fail_on_error: bool = ...,
+ use_default_template: bool = ...,
+) -> RcParams: ...
+
+rcParamsDefault: RcParams
+rcParams: RcParams
+rcParamsOrig: RcParams
+defaultParams: dict[str, Any]
+
+def rc(group: str, **kwargs) -> None: ...
+def rcdefaults() -> None: ...
+def rc_file_defaults() -> None: ...
+def rc_file(
+ fname: str | Path | os.PathLike, *, use_default_template: bool = ...
+) -> None: ...
+@contextlib.contextmanager
+def rc_context(
+ rc: dict[str, Any] | None = ..., fname: str | Path | os.PathLike | None = ...
+) -> Generator[None, None, None]: ...
+def use(backend: str, *, force: bool = ...) -> None: ...
+@overload
+def get_backend(*, auto_select: Literal[True] = True) -> str: ...
+@overload
+def get_backend(*, auto_select: Literal[False]) -> str | None: ...
+def interactive(b: bool) -> None: ...
+def is_interactive() -> bool: ...
+
+def _preprocess_data(
+ func: Callable | None = ...,
+ *,
+ replace_names: list[str] | None = ...,
+ label_namer: str | None = ...
+) -> Callable: ...
+
+from matplotlib.cm import _colormaps as colormaps # noqa: E402
+from matplotlib.cm import _multivar_colormaps as multivar_colormaps # noqa: E402
+from matplotlib.cm import _bivar_colormaps as bivar_colormaps # noqa: E402
+from matplotlib.colors import _color_sequences as color_sequences # noqa: E402
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_afm.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_afm.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ddb13aa1152305c3ac185f1027c994d8257c691a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_afm.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_blocking_input.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_blocking_input.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b6b7b3f4d9ddb070182c699d2c075b2e975c278c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_blocking_input.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..73d25b7f522ceeaf985eb5bea7c078c468eeb2bd
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm_bivar.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm_bivar.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a8f97d05cc0efc8ca7abb3445c6e95e3bf620646
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm_bivar.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm_multivar.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm_multivar.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c93ead816e66627518d385b6ba26f58913e72446
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_cm_multivar.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_color_data.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_color_data.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..02e2eec07e12c0428d4f39d082f6b7e7f662a170
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_color_data.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_constrained_layout.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_constrained_layout.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..6a4c444b0a2f811bdef4a2e058ff9f4ba4b13ede
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_constrained_layout.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_enums.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_enums.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0201f309f2539b04263ee3b91919e5d8f89219a8
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_enums.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_fontconfig_pattern.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_fontconfig_pattern.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..1f561852a970fe3974d4e8dc704472118b0861a3
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_fontconfig_pattern.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_layoutgrid.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_layoutgrid.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b506307513f483d3548103abf23d92de1f653d7f
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_layoutgrid.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_mathtext.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_mathtext.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..9f8caff3842e49439a5bf499ab0f31913119de7c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_mathtext.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_mathtext_data.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_mathtext_data.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fd3137b44c457896818803599a34a912045e5f6f
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_mathtext_data.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_pylab_helpers.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_pylab_helpers.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0badc27a84d95e8ac0b9261e0339e9b6cd13f99c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_pylab_helpers.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_text_helpers.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_text_helpers.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..bc40eb720c87f503a06a3fe3bfc1af62f2b7cb30
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_text_helpers.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_tight_bbox.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_tight_bbox.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..64c225116ee24682b65cbae6b0a569d54467a74e
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_tight_bbox.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_tight_layout.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_tight_layout.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ea0fba0653037f72f30c0cb945d018ab969539b7
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/_tight_layout.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/artist.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/artist.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8a951f46cfe11bc9c5ae8f8b7562d5e672d777c8
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/artist.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/axis.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/axis.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5e0d0f2e7c22eef51fd083aa13cefbec0da0e424
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/axis.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/backend_managers.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/backend_managers.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7ad8da32a88fe60426d9ea9b7e834f69ad5a3574
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/backend_managers.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/backend_tools.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/backend_tools.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c64fd38dc5b503750b079839b6ebc0368931ad3d
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/backend_tools.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/category.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/category.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c5fb7332a8fc2de6c3be98a2272041b2e4bf35a7
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/category.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/cm.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/cm.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..369c9df97bc07f72a8ca7c3651b42a1737024202
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/cm.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/collections.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/collections.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..eed1a0ccfe290146a4f1a85406927662343c07d4
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/collections.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/colorbar.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/colorbar.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c5c7f3f2e547c2b5cdde7f83c616a3657aa88e3c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/colorbar.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/colorizer.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/colorizer.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..cb349a7ae8e7493ebbbeab2e0b6e88f505a9d84c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/colorizer.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/container.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/container.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f8bc68171e2fc219205e074cf322ab8df87238cf
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/container.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/contour.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/contour.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e725d92e511a66dd002acf5f613f208b009ad86d
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/contour.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/dates.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/dates.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..48b8fd1db9dbe611246301bd56139f3d4e3db670
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/dates.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/dviread.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/dviread.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3407c9474604738a74236deb77eb1b4d9dfadacc
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/dviread.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/font_manager.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/font_manager.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ff59a016cf05ecaa24956a6cae0effff749e2b2f
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/font_manager.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/gridspec.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/gridspec.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..53e726b04262530a036431dbe4a77b5ecb9302ce
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/gridspec.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/hatch.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/hatch.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a1a2f9680ee6736176dbe843d834f4a1df091cb5
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/hatch.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/image.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/image.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..efbecccf031da756bd2e7a3ccd659603f62aab38
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/image.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/inset.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/inset.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e642d2a981d03ee513a3506ffa30b717b86644c4
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/inset.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/layout_engine.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/layout_engine.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..9cb97b33f8eb7f2594b67e541fa080ab0fedd38c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/layout_engine.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/legend.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/legend.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a3636d41378c95f6b089327026d75eb36be7e570
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/legend.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/legend_handler.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/legend_handler.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ee7f86bfd297dd32b068cdb889b0a7615d49bfa9
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/legend_handler.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/lines.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/lines.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4171c57a54171acd9785aff4bf685342158cfdd9
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/lines.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/markers.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/markers.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f1c933678ba338c77b4495b54c80fa20df769b5a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/markers.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/mathtext.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/mathtext.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b67bb4b916db7692d8778a436eb5162dfbdbd9eb
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/mathtext.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/mlab.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/mlab.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b57ca8dc2972f35b5f5d35bda2ab7888a0aa8e39
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/mlab.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/offsetbox.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/offsetbox.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0b445e1c87c34bde5cfa52414eb2115143015ea4
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/offsetbox.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/quiver.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/quiver.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..54a3230abd3e88b636fb2b52aa136b2a150d7b53
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/quiver.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/scale.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/scale.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d180c88f87dc92f4313c03e106b47b8d19ac0f58
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/scale.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/spines.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/spines.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..738d1dbbb4a47a646836f06a0a91868240cf9c9e
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/spines.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/stackplot.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/stackplot.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fc7b19dadd461c86acfcfaeb4a160cde068e9042
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/stackplot.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/streamplot.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/streamplot.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..eb8e640eebb8bf339c691d757f75fd01c33dd388
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/streamplot.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/table.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/table.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..909be9c840c98603786b6ba7b73c4fcf11669717
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/table.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/texmanager.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/texmanager.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..9075d0a7cce23156e1bfc9c22b3d34cc1c98cf23
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/texmanager.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/text.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/text.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..76ec4b3792f9283aaf01ff9c7b464513256f72a2
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/text.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/textpath.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/textpath.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c97649236c437ff8f5a213b01badc1369c26280d
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/textpath.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/units.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/units.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b7b26b8fef3b5cb69ef440ad5d3318dda8f2401a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/__pycache__/units.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_afm.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_afm.py
new file mode 100644
index 0000000000000000000000000000000000000000..558efe16392f7d386f642c86a8b028d10a778f25
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_afm.py
@@ -0,0 +1,532 @@
+"""
+A python interface to Adobe Font Metrics Files.
+
+Although a number of other Python implementations exist, and may be more
+complete than this, it was decided not to go with them because they were
+either:
+
+1) copyrighted or used a non-BSD compatible license
+2) had too many dependencies and a free standing lib was needed
+3) did more than needed and it was easier to write afresh rather than
+ figure out how to get just what was needed.
+
+It is pretty easy to use, and has no external dependencies:
+
+>>> import matplotlib as mpl
+>>> from pathlib import Path
+>>> afm_path = Path(mpl.get_data_path(), 'fonts', 'afm', 'ptmr8a.afm')
+>>>
+>>> from matplotlib.afm import AFM
+>>> with afm_path.open('rb') as fh:
+... afm = AFM(fh)
+>>> afm.string_width_height('What the heck?')
+(6220.0, 694)
+>>> afm.get_fontname()
+'Times-Roman'
+>>> afm.get_kern_dist('A', 'f')
+0
+>>> afm.get_kern_dist('A', 'y')
+-92.0
+>>> afm.get_bbox_char('!')
+[130, -9, 238, 676]
+
+As in the Adobe Font Metrics File Format Specification, all dimensions
+are given in units of 1/1000 of the scale factor (point size) of the font
+being used.
+"""
+
+from collections import namedtuple
+import logging
+import re
+
+from ._mathtext_data import uni2type1
+
+
+_log = logging.getLogger(__name__)
+
+
+def _to_int(x):
+ # Some AFM files have floats where we are expecting ints -- there is
+ # probably a better way to handle this (support floats, round rather than
+ # truncate). But I don't know what the best approach is now and this
+ # change to _to_int should at least prevent Matplotlib from crashing on
+ # these. JDH (2009-11-06)
+ return int(float(x))
+
+
+def _to_float(x):
+ # Some AFM files use "," instead of "." as decimal separator -- this
+ # shouldn't be ambiguous (unless someone is wicked enough to use "," as
+ # thousands separator...).
+ if isinstance(x, bytes):
+ # Encoding doesn't really matter -- if we have codepoints >127 the call
+ # to float() will error anyways.
+ x = x.decode('latin-1')
+ return float(x.replace(',', '.'))
+
+
+def _to_str(x):
+ return x.decode('utf8')
+
+
+def _to_list_of_ints(s):
+ s = s.replace(b',', b' ')
+ return [_to_int(val) for val in s.split()]
+
+
+def _to_list_of_floats(s):
+ return [_to_float(val) for val in s.split()]
+
+
+def _to_bool(s):
+ if s.lower().strip() in (b'false', b'0', b'no'):
+ return False
+ else:
+ return True
+
+
+def _parse_header(fh):
+ """
+ Read the font metrics header (up to the char metrics) and returns
+ a dictionary mapping *key* to *val*. *val* will be converted to the
+ appropriate python type as necessary; e.g.:
+
+ * 'False'->False
+ * '0'->0
+ * '-168 -218 1000 898'-> [-168, -218, 1000, 898]
+
+ Dictionary keys are
+
+ StartFontMetrics, FontName, FullName, FamilyName, Weight,
+ ItalicAngle, IsFixedPitch, FontBBox, UnderlinePosition,
+ UnderlineThickness, Version, Notice, EncodingScheme, CapHeight,
+ XHeight, Ascender, Descender, StartCharMetrics
+ """
+ header_converters = {
+ b'StartFontMetrics': _to_float,
+ b'FontName': _to_str,
+ b'FullName': _to_str,
+ b'FamilyName': _to_str,
+ b'Weight': _to_str,
+ b'ItalicAngle': _to_float,
+ b'IsFixedPitch': _to_bool,
+ b'FontBBox': _to_list_of_ints,
+ b'UnderlinePosition': _to_float,
+ b'UnderlineThickness': _to_float,
+ b'Version': _to_str,
+ # Some AFM files have non-ASCII characters (which are not allowed by
+ # the spec). Given that there is actually no public API to even access
+ # this field, just return it as straight bytes.
+ b'Notice': lambda x: x,
+ b'EncodingScheme': _to_str,
+ b'CapHeight': _to_float, # Is the second version a mistake, or
+ b'Capheight': _to_float, # do some AFM files contain 'Capheight'? -JKS
+ b'XHeight': _to_float,
+ b'Ascender': _to_float,
+ b'Descender': _to_float,
+ b'StdHW': _to_float,
+ b'StdVW': _to_float,
+ b'StartCharMetrics': _to_int,
+ b'CharacterSet': _to_str,
+ b'Characters': _to_int,
+ }
+ d = {}
+ first_line = True
+ for line in fh:
+ line = line.rstrip()
+ if line.startswith(b'Comment'):
+ continue
+ lst = line.split(b' ', 1)
+ key = lst[0]
+ if first_line:
+ # AFM spec, Section 4: The StartFontMetrics keyword
+ # [followed by a version number] must be the first line in
+ # the file, and the EndFontMetrics keyword must be the
+ # last non-empty line in the file. We just check the
+ # first header entry.
+ if key != b'StartFontMetrics':
+ raise RuntimeError('Not an AFM file')
+ first_line = False
+ if len(lst) == 2:
+ val = lst[1]
+ else:
+ val = b''
+ try:
+ converter = header_converters[key]
+ except KeyError:
+ _log.error("Found an unknown keyword in AFM header (was %r)", key)
+ continue
+ try:
+ d[key] = converter(val)
+ except ValueError:
+ _log.error('Value error parsing header in AFM: %s, %s', key, val)
+ continue
+ if key == b'StartCharMetrics':
+ break
+ else:
+ raise RuntimeError('Bad parse')
+ return d
+
+
+CharMetrics = namedtuple('CharMetrics', 'width, name, bbox')
+CharMetrics.__doc__ = """
+ Represents the character metrics of a single character.
+
+ Notes
+ -----
+ The fields do currently only describe a subset of character metrics
+ information defined in the AFM standard.
+ """
+CharMetrics.width.__doc__ = """The character width (WX)."""
+CharMetrics.name.__doc__ = """The character name (N)."""
+CharMetrics.bbox.__doc__ = """
+ The bbox of the character (B) as a tuple (*llx*, *lly*, *urx*, *ury*)."""
+
+
+def _parse_char_metrics(fh):
+ """
+ Parse the given filehandle for character metrics information and return
+ the information as dicts.
+
+ It is assumed that the file cursor is on the line behind
+ 'StartCharMetrics'.
+
+ Returns
+ -------
+ ascii_d : dict
+ A mapping "ASCII num of the character" to `.CharMetrics`.
+ name_d : dict
+ A mapping "character name" to `.CharMetrics`.
+
+ Notes
+ -----
+ This function is incomplete per the standard, but thus far parses
+ all the sample afm files tried.
+ """
+ required_keys = {'C', 'WX', 'N', 'B'}
+
+ ascii_d = {}
+ name_d = {}
+ for line in fh:
+ # We are defensively letting values be utf8. The spec requires
+ # ascii, but there are non-compliant fonts in circulation
+ line = _to_str(line.rstrip()) # Convert from byte-literal
+ if line.startswith('EndCharMetrics'):
+ return ascii_d, name_d
+ # Split the metric line into a dictionary, keyed by metric identifiers
+ vals = dict(s.strip().split(' ', 1) for s in line.split(';') if s)
+ # There may be other metrics present, but only these are needed
+ if not required_keys.issubset(vals):
+ raise RuntimeError('Bad char metrics line: %s' % line)
+ num = _to_int(vals['C'])
+ wx = _to_float(vals['WX'])
+ name = vals['N']
+ bbox = _to_list_of_floats(vals['B'])
+ bbox = list(map(int, bbox))
+ metrics = CharMetrics(wx, name, bbox)
+ # Workaround: If the character name is 'Euro', give it the
+ # corresponding character code, according to WinAnsiEncoding (see PDF
+ # Reference).
+ if name == 'Euro':
+ num = 128
+ elif name == 'minus':
+ num = ord("\N{MINUS SIGN}") # 0x2212
+ if num != -1:
+ ascii_d[num] = metrics
+ name_d[name] = metrics
+ raise RuntimeError('Bad parse')
+
+
+def _parse_kern_pairs(fh):
+ """
+ Return a kern pairs dictionary; keys are (*char1*, *char2*) tuples and
+ values are the kern pair value. For example, a kern pairs line like
+ ``KPX A y -50``
+
+ will be represented as::
+
+ d[ ('A', 'y') ] = -50
+
+ """
+
+ line = next(fh)
+ if not line.startswith(b'StartKernPairs'):
+ raise RuntimeError('Bad start of kern pairs data: %s' % line)
+
+ d = {}
+ for line in fh:
+ line = line.rstrip()
+ if not line:
+ continue
+ if line.startswith(b'EndKernPairs'):
+ next(fh) # EndKernData
+ return d
+ vals = line.split()
+ if len(vals) != 4 or vals[0] != b'KPX':
+ raise RuntimeError('Bad kern pairs line: %s' % line)
+ c1, c2, val = _to_str(vals[1]), _to_str(vals[2]), _to_float(vals[3])
+ d[(c1, c2)] = val
+ raise RuntimeError('Bad kern pairs parse')
+
+
+CompositePart = namedtuple('CompositePart', 'name, dx, dy')
+CompositePart.__doc__ = """
+ Represents the information on a composite element of a composite char."""
+CompositePart.name.__doc__ = """Name of the part, e.g. 'acute'."""
+CompositePart.dx.__doc__ = """x-displacement of the part from the origin."""
+CompositePart.dy.__doc__ = """y-displacement of the part from the origin."""
+
+
+def _parse_composites(fh):
+ """
+ Parse the given filehandle for composites information return them as a
+ dict.
+
+ It is assumed that the file cursor is on the line behind 'StartComposites'.
+
+ Returns
+ -------
+ dict
+ A dict mapping composite character names to a parts list. The parts
+ list is a list of `.CompositePart` entries describing the parts of
+ the composite.
+
+ Examples
+ --------
+ A composite definition line::
+
+ CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 170 ;
+
+ will be represented as::
+
+ composites['Aacute'] = [CompositePart(name='A', dx=0, dy=0),
+ CompositePart(name='acute', dx=160, dy=170)]
+
+ """
+ composites = {}
+ for line in fh:
+ line = line.rstrip()
+ if not line:
+ continue
+ if line.startswith(b'EndComposites'):
+ return composites
+ vals = line.split(b';')
+ cc = vals[0].split()
+ name, _num_parts = cc[1], _to_int(cc[2])
+ pccParts = []
+ for s in vals[1:-1]:
+ pcc = s.split()
+ part = CompositePart(pcc[1], _to_float(pcc[2]), _to_float(pcc[3]))
+ pccParts.append(part)
+ composites[name] = pccParts
+
+ raise RuntimeError('Bad composites parse')
+
+
+def _parse_optional(fh):
+ """
+ Parse the optional fields for kern pair data and composites.
+
+ Returns
+ -------
+ kern_data : dict
+ A dict containing kerning information. May be empty.
+ See `._parse_kern_pairs`.
+ composites : dict
+ A dict containing composite information. May be empty.
+ See `._parse_composites`.
+ """
+ optional = {
+ b'StartKernData': _parse_kern_pairs,
+ b'StartComposites': _parse_composites,
+ }
+
+ d = {b'StartKernData': {},
+ b'StartComposites': {}}
+ for line in fh:
+ line = line.rstrip()
+ if not line:
+ continue
+ key = line.split()[0]
+
+ if key in optional:
+ d[key] = optional[key](fh)
+
+ return d[b'StartKernData'], d[b'StartComposites']
+
+
+class AFM:
+
+ def __init__(self, fh):
+ """Parse the AFM file in file object *fh*."""
+ self._header = _parse_header(fh)
+ self._metrics, self._metrics_by_name = _parse_char_metrics(fh)
+ self._kern, self._composite = _parse_optional(fh)
+
+ def get_bbox_char(self, c, isord=False):
+ if not isord:
+ c = ord(c)
+ return self._metrics[c].bbox
+
+ def string_width_height(self, s):
+ """
+ Return the string width (including kerning) and string height
+ as a (*w*, *h*) tuple.
+ """
+ if not len(s):
+ return 0, 0
+ total_width = 0
+ namelast = None
+ miny = 1e9
+ maxy = 0
+ for c in s:
+ if c == '\n':
+ continue
+ wx, name, bbox = self._metrics[ord(c)]
+
+ total_width += wx + self._kern.get((namelast, name), 0)
+ l, b, w, h = bbox
+ miny = min(miny, b)
+ maxy = max(maxy, b + h)
+
+ namelast = name
+
+ return total_width, maxy - miny
+
+ def get_str_bbox_and_descent(self, s):
+ """Return the string bounding box and the maximal descent."""
+ if not len(s):
+ return 0, 0, 0, 0, 0
+ total_width = 0
+ namelast = None
+ miny = 1e9
+ maxy = 0
+ left = 0
+ if not isinstance(s, str):
+ s = _to_str(s)
+ for c in s:
+ if c == '\n':
+ continue
+ name = uni2type1.get(ord(c), f"uni{ord(c):04X}")
+ try:
+ wx, _, bbox = self._metrics_by_name[name]
+ except KeyError:
+ name = 'question'
+ wx, _, bbox = self._metrics_by_name[name]
+ total_width += wx + self._kern.get((namelast, name), 0)
+ l, b, w, h = bbox
+ left = min(left, l)
+ miny = min(miny, b)
+ maxy = max(maxy, b + h)
+
+ namelast = name
+
+ return left, miny, total_width, maxy - miny, -miny
+
+ def get_str_bbox(self, s):
+ """Return the string bounding box."""
+ return self.get_str_bbox_and_descent(s)[:4]
+
+ def get_name_char(self, c, isord=False):
+ """Get the name of the character, i.e., ';' is 'semicolon'."""
+ if not isord:
+ c = ord(c)
+ return self._metrics[c].name
+
+ def get_width_char(self, c, isord=False):
+ """
+ Get the width of the character from the character metric WX field.
+ """
+ if not isord:
+ c = ord(c)
+ return self._metrics[c].width
+
+ def get_width_from_char_name(self, name):
+ """Get the width of the character from a type1 character name."""
+ return self._metrics_by_name[name].width
+
+ def get_height_char(self, c, isord=False):
+ """Get the bounding box (ink) height of character *c* (space is 0)."""
+ if not isord:
+ c = ord(c)
+ return self._metrics[c].bbox[-1]
+
+ def get_kern_dist(self, c1, c2):
+ """
+ Return the kerning pair distance (possibly 0) for chars *c1* and *c2*.
+ """
+ name1, name2 = self.get_name_char(c1), self.get_name_char(c2)
+ return self.get_kern_dist_from_name(name1, name2)
+
+ def get_kern_dist_from_name(self, name1, name2):
+ """
+ Return the kerning pair distance (possibly 0) for chars
+ *name1* and *name2*.
+ """
+ return self._kern.get((name1, name2), 0)
+
+ def get_fontname(self):
+ """Return the font name, e.g., 'Times-Roman'."""
+ return self._header[b'FontName']
+
+ @property
+ def postscript_name(self): # For consistency with FT2Font.
+ return self.get_fontname()
+
+ def get_fullname(self):
+ """Return the font full name, e.g., 'Times-Roman'."""
+ name = self._header.get(b'FullName')
+ if name is None: # use FontName as a substitute
+ name = self._header[b'FontName']
+ return name
+
+ def get_familyname(self):
+ """Return the font family name, e.g., 'Times'."""
+ name = self._header.get(b'FamilyName')
+ if name is not None:
+ return name
+
+ # FamilyName not specified so we'll make a guess
+ name = self.get_fullname()
+ extras = (r'(?i)([ -](regular|plain|italic|oblique|bold|semibold|'
+ r'light|ultralight|extra|condensed))+$')
+ return re.sub(extras, '', name)
+
+ @property
+ def family_name(self):
+ """The font family name, e.g., 'Times'."""
+ return self.get_familyname()
+
+ def get_weight(self):
+ """Return the font weight, e.g., 'Bold' or 'Roman'."""
+ return self._header[b'Weight']
+
+ def get_angle(self):
+ """Return the fontangle as float."""
+ return self._header[b'ItalicAngle']
+
+ def get_capheight(self):
+ """Return the cap height as float."""
+ return self._header[b'CapHeight']
+
+ def get_xheight(self):
+ """Return the xheight as float."""
+ return self._header[b'XHeight']
+
+ def get_underline_thickness(self):
+ """Return the underline thickness as float."""
+ return self._header[b'UnderlineThickness']
+
+ def get_horizontal_stem_width(self):
+ """
+ Return the standard horizontal stem width as float, or *None* if
+ not specified in AFM file.
+ """
+ return self._header.get(b'StdHW', None)
+
+ def get_vertical_stem_width(self):
+ """
+ Return the standard vertical stem width as float, or *None* if
+ not specified in AFM file.
+ """
+ return self._header.get(b'StdVW', None)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_animation_data.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_animation_data.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cbd312d8f142d8b4ec3a3ad3e005a14f380ec13
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_animation_data.py
@@ -0,0 +1,262 @@
+# JavaScript template for HTMLWriter
+JS_INCLUDE = """
+
+
+"""
+
+
+# Style definitions for the HTML template
+STYLE_INCLUDE = """
+
+"""
+
+
+# HTML template for HTMLWriter
+DISPLAY_TEMPLATE = """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+""" # noqa: E501
+
+
+INCLUDED_FRAMES = """
+ for (var i=0; i<{Nframes}; i++){{
+ frames[i] = "{frame_dir}/frame" + ("0000000" + i).slice(-7) +
+ ".{frame_format}";
+ }}
+"""
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..22b58b62ff8e7f83043c9d99cc6d0dcefb0a93d2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__init__.py
@@ -0,0 +1,391 @@
+"""
+Helper functions for managing the Matplotlib API.
+
+This documentation is only relevant for Matplotlib developers, not for users.
+
+.. warning::
+
+ This module and its submodules are for internal use only. Do not use them
+ in your own code. We may change the API at any time with no warning.
+
+"""
+
+import functools
+import itertools
+import pathlib
+import re
+import sys
+import warnings
+
+from .deprecation import ( # noqa: F401
+ deprecated, warn_deprecated,
+ rename_parameter, delete_parameter, make_keyword_only,
+ deprecate_method_override, deprecate_privatize_attribute,
+ suppress_matplotlib_deprecation_warning,
+ MatplotlibDeprecationWarning)
+
+
+class classproperty:
+ """
+ Like `property`, but also triggers on access via the class, and it is the
+ *class* that's passed as argument.
+
+ Examples
+ --------
+ ::
+
+ class C:
+ @classproperty
+ def foo(cls):
+ return cls.__name__
+
+ assert C.foo == "C"
+ """
+
+ def __init__(self, fget, fset=None, fdel=None, doc=None):
+ self._fget = fget
+ if fset is not None or fdel is not None:
+ raise ValueError('classproperty only implements fget.')
+ self.fset = fset
+ self.fdel = fdel
+ # docs are ignored for now
+ self._doc = doc
+
+ def __get__(self, instance, owner):
+ return self._fget(owner)
+
+ @property
+ def fget(self):
+ return self._fget
+
+
+# In the following check_foo() functions, the first parameter is positional-only to make
+# e.g. `_api.check_isinstance([...], types=foo)` work.
+
+def check_isinstance(types, /, **kwargs):
+ """
+ For each *key, value* pair in *kwargs*, check that *value* is an instance
+ of one of *types*; if not, raise an appropriate TypeError.
+
+ As a special case, a ``None`` entry in *types* is treated as NoneType.
+
+ Examples
+ --------
+ >>> _api.check_isinstance((SomeClass, None), arg=arg)
+ """
+ none_type = type(None)
+ types = ((types,) if isinstance(types, type) else
+ (none_type,) if types is None else
+ tuple(none_type if tp is None else tp for tp in types))
+
+ def type_name(tp):
+ return ("None" if tp is none_type
+ else tp.__qualname__ if tp.__module__ == "builtins"
+ else f"{tp.__module__}.{tp.__qualname__}")
+
+ for k, v in kwargs.items():
+ if not isinstance(v, types):
+ names = [*map(type_name, types)]
+ if "None" in names: # Move it to the end for better wording.
+ names.remove("None")
+ names.append("None")
+ raise TypeError(
+ "{!r} must be an instance of {}, not a {}".format(
+ k,
+ ", ".join(names[:-1]) + " or " + names[-1]
+ if len(names) > 1 else names[0],
+ type_name(type(v))))
+
+
+def check_in_list(values, /, *, _print_supported_values=True, **kwargs):
+ """
+ For each *key, value* pair in *kwargs*, check that *value* is in *values*;
+ if not, raise an appropriate ValueError.
+
+ Parameters
+ ----------
+ values : iterable
+ Sequence of values to check on.
+ _print_supported_values : bool, default: True
+ Whether to print *values* when raising ValueError.
+ **kwargs : dict
+ *key, value* pairs as keyword arguments to find in *values*.
+
+ Raises
+ ------
+ ValueError
+ If any *value* in *kwargs* is not found in *values*.
+
+ Examples
+ --------
+ >>> _api.check_in_list(["foo", "bar"], arg=arg, other_arg=other_arg)
+ """
+ if not kwargs:
+ raise TypeError("No argument to check!")
+ for key, val in kwargs.items():
+ if val not in values:
+ msg = f"{val!r} is not a valid value for {key}"
+ if _print_supported_values:
+ msg += f"; supported values are {', '.join(map(repr, values))}"
+ raise ValueError(msg)
+
+
+def check_shape(shape, /, **kwargs):
+ """
+ For each *key, value* pair in *kwargs*, check that *value* has the shape *shape*;
+ if not, raise an appropriate ValueError.
+
+ *None* in the shape is treated as a "free" size that can have any length.
+ e.g. (None, 2) -> (N, 2)
+
+ The values checked must be numpy arrays.
+
+ Examples
+ --------
+ To check for (N, 2) shaped arrays
+
+ >>> _api.check_shape((None, 2), arg=arg, other_arg=other_arg)
+ """
+ for k, v in kwargs.items():
+ data_shape = v.shape
+
+ if (len(data_shape) != len(shape)
+ or any(s != t and t is not None for s, t in zip(data_shape, shape))):
+ dim_labels = iter(itertools.chain(
+ 'NMLKJIH',
+ (f"D{i}" for i in itertools.count())))
+ text_shape = ", ".join([str(n) if n is not None else next(dim_labels)
+ for n in shape[::-1]][::-1])
+ if len(shape) == 1:
+ text_shape += ","
+
+ raise ValueError(
+ f"{k!r} must be {len(shape)}D with shape ({text_shape}), "
+ f"but your input has shape {v.shape}"
+ )
+
+
+def check_getitem(mapping, /, **kwargs):
+ """
+ *kwargs* must consist of a single *key, value* pair. If *key* is in
+ *mapping*, return ``mapping[value]``; else, raise an appropriate
+ ValueError.
+
+ Examples
+ --------
+ >>> _api.check_getitem({"foo": "bar"}, arg=arg)
+ """
+ if len(kwargs) != 1:
+ raise ValueError("check_getitem takes a single keyword argument")
+ (k, v), = kwargs.items()
+ try:
+ return mapping[v]
+ except KeyError:
+ raise ValueError(
+ f"{v!r} is not a valid value for {k}; supported values are "
+ f"{', '.join(map(repr, mapping))}") from None
+
+
+def caching_module_getattr(cls):
+ """
+ Helper decorator for implementing module-level ``__getattr__`` as a class.
+
+ This decorator must be used at the module toplevel as follows::
+
+ @caching_module_getattr
+ class __getattr__: # The class *must* be named ``__getattr__``.
+ @property # Only properties are taken into account.
+ def name(self): ...
+
+ The ``__getattr__`` class will be replaced by a ``__getattr__``
+ function such that trying to access ``name`` on the module will
+ resolve the corresponding property (which may be decorated e.g. with
+ ``_api.deprecated`` for deprecating module globals). The properties are
+ all implicitly cached. Moreover, a suitable AttributeError is generated
+ and raised if no property with the given name exists.
+ """
+
+ assert cls.__name__ == "__getattr__"
+ # Don't accidentally export cls dunders.
+ props = {name: prop for name, prop in vars(cls).items()
+ if isinstance(prop, property)}
+ instance = cls()
+
+ @functools.cache
+ def __getattr__(name):
+ if name in props:
+ return props[name].__get__(instance)
+ raise AttributeError(
+ f"module {cls.__module__!r} has no attribute {name!r}")
+
+ return __getattr__
+
+
+def define_aliases(alias_d, cls=None):
+ """
+ Class decorator for defining property aliases.
+
+ Use as ::
+
+ @_api.define_aliases({"property": ["alias", ...], ...})
+ class C: ...
+
+ For each property, if the corresponding ``get_property`` is defined in the
+ class so far, an alias named ``get_alias`` will be defined; the same will
+ be done for setters. If neither the getter nor the setter exists, an
+ exception will be raised.
+
+ The alias map is stored as the ``_alias_map`` attribute on the class and
+ can be used by `.normalize_kwargs` (which assumes that higher priority
+ aliases come last).
+ """
+ if cls is None: # Return the actual class decorator.
+ return functools.partial(define_aliases, alias_d)
+
+ def make_alias(name): # Enforce a closure over *name*.
+ @functools.wraps(getattr(cls, name))
+ def method(self, *args, **kwargs):
+ return getattr(self, name)(*args, **kwargs)
+ return method
+
+ for prop, aliases in alias_d.items():
+ exists = False
+ for prefix in ["get_", "set_"]:
+ if prefix + prop in vars(cls):
+ exists = True
+ for alias in aliases:
+ method = make_alias(prefix + prop)
+ method.__name__ = prefix + alias
+ method.__doc__ = f"Alias for `{prefix + prop}`."
+ setattr(cls, prefix + alias, method)
+ if not exists:
+ raise ValueError(
+ f"Neither getter nor setter exists for {prop!r}")
+
+ def get_aliased_and_aliases(d):
+ return {*d, *(alias for aliases in d.values() for alias in aliases)}
+
+ preexisting_aliases = getattr(cls, "_alias_map", {})
+ conflicting = (get_aliased_and_aliases(preexisting_aliases)
+ & get_aliased_and_aliases(alias_d))
+ if conflicting:
+ # Need to decide on conflict resolution policy.
+ raise NotImplementedError(
+ f"Parent class already defines conflicting aliases: {conflicting}")
+ cls._alias_map = {**preexisting_aliases, **alias_d}
+ return cls
+
+
+def select_matching_signature(funcs, *args, **kwargs):
+ """
+ Select and call the function that accepts ``*args, **kwargs``.
+
+ *funcs* is a list of functions which should not raise any exception (other
+ than `TypeError` if the arguments passed do not match their signature).
+
+ `select_matching_signature` tries to call each of the functions in *funcs*
+ with ``*args, **kwargs`` (in the order in which they are given). Calls
+ that fail with a `TypeError` are silently skipped. As soon as a call
+ succeeds, `select_matching_signature` returns its return value. If no
+ function accepts ``*args, **kwargs``, then the `TypeError` raised by the
+ last failing call is re-raised.
+
+ Callers should normally make sure that any ``*args, **kwargs`` can only
+ bind a single *func* (to avoid any ambiguity), although this is not checked
+ by `select_matching_signature`.
+
+ Notes
+ -----
+ `select_matching_signature` is intended to help implementing
+ signature-overloaded functions. In general, such functions should be
+ avoided, except for back-compatibility concerns. A typical use pattern is
+ ::
+
+ def my_func(*args, **kwargs):
+ params = select_matching_signature(
+ [lambda old1, old2: locals(), lambda new: locals()],
+ *args, **kwargs)
+ if "old1" in params:
+ warn_deprecated(...)
+ old1, old2 = params.values() # note that locals() is ordered.
+ else:
+ new, = params.values()
+ # do things with params
+
+ which allows *my_func* to be called either with two parameters (*old1* and
+ *old2*) or a single one (*new*). Note that the new signature is given
+ last, so that callers get a `TypeError` corresponding to the new signature
+ if the arguments they passed in do not match any signature.
+ """
+ # Rather than relying on locals() ordering, one could have just used func's
+ # signature (``bound = inspect.signature(func).bind(*args, **kwargs);
+ # bound.apply_defaults(); return bound``) but that is significantly slower.
+ for i, func in enumerate(funcs):
+ try:
+ return func(*args, **kwargs)
+ except TypeError:
+ if i == len(funcs) - 1:
+ raise
+
+
+def nargs_error(name, takes, given):
+ """Generate a TypeError to be raised by function calls with wrong arity."""
+ return TypeError(f"{name}() takes {takes} positional arguments but "
+ f"{given} were given")
+
+
+def kwarg_error(name, kw):
+ """
+ Generate a TypeError to be raised by function calls with wrong kwarg.
+
+ Parameters
+ ----------
+ name : str
+ The name of the calling function.
+ kw : str or Iterable[str]
+ Either the invalid keyword argument name, or an iterable yielding
+ invalid keyword arguments (e.g., a ``kwargs`` dict).
+ """
+ if not isinstance(kw, str):
+ kw = next(iter(kw))
+ return TypeError(f"{name}() got an unexpected keyword argument '{kw}'")
+
+
+def recursive_subclasses(cls):
+ """Yield *cls* and direct and indirect subclasses of *cls*."""
+ yield cls
+ for subcls in cls.__subclasses__():
+ yield from recursive_subclasses(subcls)
+
+
+def warn_external(message, category=None):
+ """
+ `warnings.warn` wrapper that sets *stacklevel* to "outside Matplotlib".
+
+ The original emitter of the warning can be obtained by patching this
+ function back to `warnings.warn`, i.e. ``_api.warn_external =
+ warnings.warn`` (or ``functools.partial(warnings.warn, stacklevel=2)``,
+ etc.).
+ """
+ kwargs = {}
+ if sys.version_info[:2] >= (3, 12):
+ # Go to Python's `site-packages` or `lib` from an editable install.
+ basedir = pathlib.Path(__file__).parents[2]
+ kwargs['skip_file_prefixes'] = (str(basedir / 'matplotlib'),
+ str(basedir / 'mpl_toolkits'))
+ else:
+ frame = sys._getframe()
+ for stacklevel in itertools.count(1):
+ if frame is None:
+ # when called in embedded context may hit frame is None
+ kwargs['stacklevel'] = stacklevel
+ break
+ if not re.match(r"\A(matplotlib|mpl_toolkits)(\Z|\.(?!tests\.))",
+ # Work around sphinx-gallery not setting __name__.
+ frame.f_globals.get("__name__", "")):
+ kwargs['stacklevel'] = stacklevel
+ break
+ frame = frame.f_back
+ # preemptively break reference cycle between locals and the frame
+ del frame
+ warnings.warn(message, category, **kwargs)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__init__.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__init__.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..ea7076feac3c415be6d789e92f87020ea89db7a1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__init__.pyi
@@ -0,0 +1,59 @@
+from collections.abc import Callable, Generator, Iterable, Mapping, Sequence
+from typing import Any, TypeVar, overload
+from typing_extensions import Self # < Py 3.11
+
+from numpy.typing import NDArray
+
+from .deprecation import ( # noqa: F401, re-exported API
+ deprecated as deprecated,
+ warn_deprecated as warn_deprecated,
+ rename_parameter as rename_parameter,
+ delete_parameter as delete_parameter,
+ make_keyword_only as make_keyword_only,
+ deprecate_method_override as deprecate_method_override,
+ deprecate_privatize_attribute as deprecate_privatize_attribute,
+ suppress_matplotlib_deprecation_warning as suppress_matplotlib_deprecation_warning,
+ MatplotlibDeprecationWarning as MatplotlibDeprecationWarning,
+)
+
+_T = TypeVar("_T")
+
+class classproperty(Any):
+ def __init__(
+ self,
+ fget: Callable[[_T], Any],
+ fset: None = ...,
+ fdel: None = ...,
+ doc: str | None = None,
+ ): ...
+ @overload
+ def __get__(self, instance: None, owner: None) -> Self: ...
+ @overload
+ def __get__(self, instance: object, owner: type[object]) -> Any: ...
+ @property
+ def fget(self) -> Callable[[_T], Any]: ...
+
+def check_isinstance(
+ types: type | tuple[type | None, ...], /, **kwargs: Any
+) -> None: ...
+def check_in_list(
+ values: Sequence[Any], /, *, _print_supported_values: bool = ..., **kwargs: Any
+) -> None: ...
+def check_shape(shape: tuple[int | None, ...], /, **kwargs: NDArray) -> None: ...
+def check_getitem(mapping: Mapping[Any, Any], /, **kwargs: Any) -> Any: ...
+def caching_module_getattr(cls: type) -> Callable[[str], Any]: ...
+@overload
+def define_aliases(
+ alias_d: dict[str, list[str]], cls: None = ...
+) -> Callable[[type[_T]], type[_T]]: ...
+@overload
+def define_aliases(alias_d: dict[str, list[str]], cls: type[_T]) -> type[_T]: ...
+def select_matching_signature(
+ funcs: list[Callable], *args: Any, **kwargs: Any
+) -> Any: ...
+def nargs_error(name: str, takes: int | str, given: int) -> TypeError: ...
+def kwarg_error(name: str, kw: str | Iterable[str]) -> TypeError: ...
+def recursive_subclasses(cls: type) -> Generator[type, None, None]: ...
+def warn_external(
+ message: str | Warning, category: type[Warning] | None = ...
+) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f3e494cdb9d6db6d1926b99d22e8d11acbb66a00
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__pycache__/deprecation.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__pycache__/deprecation.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..824609c426c3cd62b2c7b7ce7e042f5ab5f392d9
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/__pycache__/deprecation.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/deprecation.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/deprecation.py
new file mode 100644
index 0000000000000000000000000000000000000000..65a754bbb43d424f52e9b11f4580ba5d08dc6e59
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/deprecation.py
@@ -0,0 +1,509 @@
+"""
+Helper functions for deprecating parts of the Matplotlib API.
+
+This documentation is only relevant for Matplotlib developers, not for users.
+
+.. warning::
+
+ This module is for internal use only. Do not use it in your own code.
+ We may change the API at any time with no warning.
+
+"""
+
+import contextlib
+import functools
+import inspect
+import math
+import warnings
+
+
+class MatplotlibDeprecationWarning(DeprecationWarning):
+ """A class for issuing deprecation warnings for Matplotlib users."""
+
+
+def _generate_deprecation_warning(
+ since, message='', name='', alternative='', pending=False, obj_type='',
+ addendum='', *, removal=''):
+ if pending:
+ if removal:
+ raise ValueError("A pending deprecation cannot have a scheduled removal")
+ elif removal == '':
+ macro, meso, *_ = since.split('.')
+ removal = f'{macro}.{int(meso) + 2}'
+ if not message:
+ message = (
+ ("The %(name)s %(obj_type)s" if obj_type else "%(name)s") +
+ (" will be deprecated in a future version" if pending else
+ (" was deprecated in Matplotlib %(since)s" +
+ (" and will be removed in %(removal)s" if removal else ""))) +
+ "." +
+ (" Use %(alternative)s instead." if alternative else "") +
+ (" %(addendum)s" if addendum else ""))
+ warning_cls = PendingDeprecationWarning if pending else MatplotlibDeprecationWarning
+ return warning_cls(message % dict(
+ func=name, name=name, obj_type=obj_type, since=since, removal=removal,
+ alternative=alternative, addendum=addendum))
+
+
+def warn_deprecated(
+ since, *, message='', name='', alternative='', pending=False,
+ obj_type='', addendum='', removal=''):
+ """
+ Display a standardized deprecation.
+
+ Parameters
+ ----------
+ since : str
+ The release at which this API became deprecated.
+ message : str, optional
+ Override the default deprecation message. The ``%(since)s``,
+ ``%(name)s``, ``%(alternative)s``, ``%(obj_type)s``, ``%(addendum)s``,
+ and ``%(removal)s`` format specifiers will be replaced by the values
+ of the respective arguments passed to this function.
+ name : str, optional
+ The name of the deprecated object.
+ alternative : str, optional
+ An alternative API that the user may use in place of the deprecated
+ API. The deprecation warning will tell the user about this alternative
+ if provided.
+ pending : bool, optional
+ If True, uses a PendingDeprecationWarning instead of a
+ DeprecationWarning. Cannot be used together with *removal*.
+ obj_type : str, optional
+ The object type being deprecated.
+ addendum : str, optional
+ Additional text appended directly to the final message.
+ removal : str, optional
+ The expected removal version. With the default (an empty string), a
+ removal version is automatically computed from *since*. Set to other
+ Falsy values to not schedule a removal date. Cannot be used together
+ with *pending*.
+
+ Examples
+ --------
+ ::
+
+ # To warn of the deprecation of "matplotlib.name_of_module"
+ warn_deprecated('1.4.0', name='matplotlib.name_of_module',
+ obj_type='module')
+ """
+ warning = _generate_deprecation_warning(
+ since, message, name, alternative, pending, obj_type, addendum,
+ removal=removal)
+ from . import warn_external
+ warn_external(warning, category=MatplotlibDeprecationWarning)
+
+
+def deprecated(since, *, message='', name='', alternative='', pending=False,
+ obj_type=None, addendum='', removal=''):
+ """
+ Decorator to mark a function, a class, or a property as deprecated.
+
+ When deprecating a classmethod, a staticmethod, or a property, the
+ ``@deprecated`` decorator should go *under* ``@classmethod`` and
+ ``@staticmethod`` (i.e., `deprecated` should directly decorate the
+ underlying callable), but *over* ``@property``.
+
+ When deprecating a class ``C`` intended to be used as a base class in a
+ multiple inheritance hierarchy, ``C`` *must* define an ``__init__`` method
+ (if ``C`` instead inherited its ``__init__`` from its own base class, then
+ ``@deprecated`` would mess up ``__init__`` inheritance when installing its
+ own (deprecation-emitting) ``C.__init__``).
+
+ Parameters are the same as for `warn_deprecated`, except that *obj_type*
+ defaults to 'class' if decorating a class, 'attribute' if decorating a
+ property, and 'function' otherwise.
+
+ Examples
+ --------
+ ::
+
+ @deprecated('1.4.0')
+ def the_function_to_deprecate():
+ pass
+ """
+
+ def deprecate(obj, message=message, name=name, alternative=alternative,
+ pending=pending, obj_type=obj_type, addendum=addendum):
+ from matplotlib._api import classproperty
+
+ if isinstance(obj, type):
+ if obj_type is None:
+ obj_type = "class"
+ func = obj.__init__
+ name = name or obj.__name__
+ old_doc = obj.__doc__
+
+ def finalize(wrapper, new_doc):
+ try:
+ obj.__doc__ = new_doc
+ except AttributeError: # Can't set on some extension objects.
+ pass
+ obj.__init__ = functools.wraps(obj.__init__)(wrapper)
+ return obj
+
+ elif isinstance(obj, (property, classproperty)):
+ if obj_type is None:
+ obj_type = "attribute"
+ func = None
+ name = name or obj.fget.__name__
+ old_doc = obj.__doc__
+
+ class _deprecated_property(type(obj)):
+ def __get__(self, instance, owner=None):
+ if instance is not None or owner is not None \
+ and isinstance(self, classproperty):
+ emit_warning()
+ return super().__get__(instance, owner)
+
+ def __set__(self, instance, value):
+ if instance is not None:
+ emit_warning()
+ return super().__set__(instance, value)
+
+ def __delete__(self, instance):
+ if instance is not None:
+ emit_warning()
+ return super().__delete__(instance)
+
+ def __set_name__(self, owner, set_name):
+ nonlocal name
+ if name == "":
+ name = set_name
+
+ def finalize(_, new_doc):
+ return _deprecated_property(
+ fget=obj.fget, fset=obj.fset, fdel=obj.fdel, doc=new_doc)
+
+ else:
+ if obj_type is None:
+ obj_type = "function"
+ func = obj
+ name = name or obj.__name__
+ old_doc = func.__doc__
+
+ def finalize(wrapper, new_doc):
+ wrapper = functools.wraps(func)(wrapper)
+ wrapper.__doc__ = new_doc
+ return wrapper
+
+ def emit_warning():
+ warn_deprecated(
+ since, message=message, name=name, alternative=alternative,
+ pending=pending, obj_type=obj_type, addendum=addendum,
+ removal=removal)
+
+ def wrapper(*args, **kwargs):
+ emit_warning()
+ return func(*args, **kwargs)
+
+ old_doc = inspect.cleandoc(old_doc or '').strip('\n')
+
+ notes_header = '\nNotes\n-----'
+ second_arg = ' '.join([t.strip() for t in
+ (message, f"Use {alternative} instead."
+ if alternative else "", addendum) if t])
+ new_doc = (f"[*Deprecated*] {old_doc}\n"
+ f"{notes_header if notes_header not in old_doc else ''}\n"
+ f".. deprecated:: {since}\n"
+ f" {second_arg}")
+
+ if not old_doc:
+ # This is to prevent a spurious 'unexpected unindent' warning from
+ # docutils when the original docstring was blank.
+ new_doc += r'\ '
+
+ return finalize(wrapper, new_doc)
+
+ return deprecate
+
+
+class deprecate_privatize_attribute:
+ """
+ Helper to deprecate public access to an attribute (or method).
+
+ This helper should only be used at class scope, as follows::
+
+ class Foo:
+ attr = _deprecate_privatize_attribute(*args, **kwargs)
+
+ where *all* parameters are forwarded to `deprecated`. This form makes
+ ``attr`` a property which forwards read and write access to ``self._attr``
+ (same name but with a leading underscore), with a deprecation warning.
+ Note that the attribute name is derived from *the name this helper is
+ assigned to*. This helper also works for deprecating methods.
+ """
+
+ def __init__(self, *args, **kwargs):
+ self.deprecator = deprecated(*args, **kwargs)
+
+ def __set_name__(self, owner, name):
+ setattr(owner, name, self.deprecator(
+ property(lambda self: getattr(self, f"_{name}"),
+ lambda self, value: setattr(self, f"_{name}", value)),
+ name=name))
+
+
+# Used by _copy_docstring_and_deprecators to redecorate pyplot wrappers and
+# boilerplate.py to retrieve original signatures. It may seem natural to store
+# this information as an attribute on the wrapper, but if the wrapper gets
+# itself functools.wraps()ed, then such attributes are silently propagated to
+# the outer wrapper, which is not desired.
+DECORATORS = {}
+
+
+def rename_parameter(since, old, new, func=None):
+ """
+ Decorator indicating that parameter *old* of *func* is renamed to *new*.
+
+ The actual implementation of *func* should use *new*, not *old*. If *old*
+ is passed to *func*, a DeprecationWarning is emitted, and its value is
+ used, even if *new* is also passed by keyword (this is to simplify pyplot
+ wrapper functions, which always pass *new* explicitly to the Axes method).
+ If *new* is also passed but positionally, a TypeError will be raised by the
+ underlying function during argument binding.
+
+ Examples
+ --------
+ ::
+
+ @_api.rename_parameter("3.1", "bad_name", "good_name")
+ def func(good_name): ...
+ """
+
+ decorator = functools.partial(rename_parameter, since, old, new)
+
+ if func is None:
+ return decorator
+
+ signature = inspect.signature(func)
+ assert old not in signature.parameters, (
+ f"Matplotlib internal error: {old!r} cannot be a parameter for "
+ f"{func.__name__}()")
+ assert new in signature.parameters, (
+ f"Matplotlib internal error: {new!r} must be a parameter for "
+ f"{func.__name__}()")
+
+ @functools.wraps(func)
+ def wrapper(*args, **kwargs):
+ if old in kwargs:
+ warn_deprecated(
+ since, message=f"The {old!r} parameter of {func.__name__}() "
+ f"has been renamed {new!r} since Matplotlib {since}; support "
+ f"for the old name will be dropped in %(removal)s.")
+ kwargs[new] = kwargs.pop(old)
+ return func(*args, **kwargs)
+
+ # wrapper() must keep the same documented signature as func(): if we
+ # instead made both *old* and *new* appear in wrapper()'s signature, they
+ # would both show up in the pyplot function for an Axes method as well and
+ # pyplot would explicitly pass both arguments to the Axes method.
+
+ DECORATORS[wrapper] = decorator
+ return wrapper
+
+
+class _deprecated_parameter_class:
+ def __repr__(self):
+ return ""
+
+
+_deprecated_parameter = _deprecated_parameter_class()
+
+
+def delete_parameter(since, name, func=None, **kwargs):
+ """
+ Decorator indicating that parameter *name* of *func* is being deprecated.
+
+ The actual implementation of *func* should keep the *name* parameter in its
+ signature, or accept a ``**kwargs`` argument (through which *name* would be
+ passed).
+
+ Parameters that come after the deprecated parameter effectively become
+ keyword-only (as they cannot be passed positionally without triggering the
+ DeprecationWarning on the deprecated parameter), and should be marked as
+ such after the deprecation period has passed and the deprecated parameter
+ is removed.
+
+ Parameters other than *since*, *name*, and *func* are keyword-only and
+ forwarded to `.warn_deprecated`.
+
+ Examples
+ --------
+ ::
+
+ @_api.delete_parameter("3.1", "unused")
+ def func(used_arg, other_arg, unused, more_args): ...
+ """
+
+ decorator = functools.partial(delete_parameter, since, name, **kwargs)
+
+ if func is None:
+ return decorator
+
+ signature = inspect.signature(func)
+ # Name of `**kwargs` parameter of the decorated function, typically
+ # "kwargs" if such a parameter exists, or None if the decorated function
+ # doesn't accept `**kwargs`.
+ kwargs_name = next((param.name for param in signature.parameters.values()
+ if param.kind == inspect.Parameter.VAR_KEYWORD), None)
+ if name in signature.parameters:
+ kind = signature.parameters[name].kind
+ is_varargs = kind is inspect.Parameter.VAR_POSITIONAL
+ is_varkwargs = kind is inspect.Parameter.VAR_KEYWORD
+ if not is_varargs and not is_varkwargs:
+ name_idx = (
+ # Deprecated parameter can't be passed positionally.
+ math.inf if kind is inspect.Parameter.KEYWORD_ONLY
+ # If call site has no more than this number of parameters, the
+ # deprecated parameter can't have been passed positionally.
+ else [*signature.parameters].index(name))
+ func.__signature__ = signature = signature.replace(parameters=[
+ param.replace(default=_deprecated_parameter)
+ if param.name == name else param
+ for param in signature.parameters.values()])
+ else:
+ name_idx = -1 # Deprecated parameter can always have been passed.
+ else:
+ is_varargs = is_varkwargs = False
+ # Deprecated parameter can't be passed positionally.
+ name_idx = math.inf
+ assert kwargs_name, (
+ f"Matplotlib internal error: {name!r} must be a parameter for "
+ f"{func.__name__}()")
+
+ addendum = kwargs.pop('addendum', None)
+
+ @functools.wraps(func)
+ def wrapper(*inner_args, **inner_kwargs):
+ if len(inner_args) <= name_idx and name not in inner_kwargs:
+ # Early return in the simple, non-deprecated case (much faster than
+ # calling bind()).
+ return func(*inner_args, **inner_kwargs)
+ arguments = signature.bind(*inner_args, **inner_kwargs).arguments
+ if is_varargs and arguments.get(name):
+ warn_deprecated(
+ since, message=f"Additional positional arguments to "
+ f"{func.__name__}() are deprecated since %(since)s and "
+ f"support for them will be removed in %(removal)s.")
+ elif is_varkwargs and arguments.get(name):
+ warn_deprecated(
+ since, message=f"Additional keyword arguments to "
+ f"{func.__name__}() are deprecated since %(since)s and "
+ f"support for them will be removed in %(removal)s.")
+ # We cannot just check `name not in arguments` because the pyplot
+ # wrappers always pass all arguments explicitly.
+ elif any(name in d and d[name] != _deprecated_parameter
+ for d in [arguments, arguments.get(kwargs_name, {})]):
+ deprecation_addendum = (
+ f"If any parameter follows {name!r}, they should be passed as "
+ f"keyword, not positionally.")
+ warn_deprecated(
+ since,
+ name=repr(name),
+ obj_type=f"parameter of {func.__name__}()",
+ addendum=(addendum + " " + deprecation_addendum) if addendum
+ else deprecation_addendum,
+ **kwargs)
+ return func(*inner_args, **inner_kwargs)
+
+ DECORATORS[wrapper] = decorator
+ return wrapper
+
+
+def make_keyword_only(since, name, func=None):
+ """
+ Decorator indicating that passing parameter *name* (or any of the following
+ ones) positionally to *func* is being deprecated.
+
+ When used on a method that has a pyplot wrapper, this should be the
+ outermost decorator, so that :file:`boilerplate.py` can access the original
+ signature.
+ """
+
+ decorator = functools.partial(make_keyword_only, since, name)
+
+ if func is None:
+ return decorator
+
+ signature = inspect.signature(func)
+ POK = inspect.Parameter.POSITIONAL_OR_KEYWORD
+ KWO = inspect.Parameter.KEYWORD_ONLY
+ assert (name in signature.parameters
+ and signature.parameters[name].kind == POK), (
+ f"Matplotlib internal error: {name!r} must be a positional-or-keyword "
+ f"parameter for {func.__name__}(). If this error happens on a function with a "
+ f"pyplot wrapper, make sure make_keyword_only() is the outermost decorator.")
+ names = [*signature.parameters]
+ name_idx = names.index(name)
+ kwonly = [name for name in names[name_idx:]
+ if signature.parameters[name].kind == POK]
+
+ @functools.wraps(func)
+ def wrapper(*args, **kwargs):
+ # Don't use signature.bind here, as it would fail when stacked with
+ # rename_parameter and an "old" argument name is passed in
+ # (signature.bind would fail, but the actual call would succeed).
+ if len(args) > name_idx:
+ warn_deprecated(
+ since, message="Passing the %(name)s %(obj_type)s "
+ "positionally is deprecated since Matplotlib %(since)s; the "
+ "parameter will become keyword-only in %(removal)s.",
+ name=name, obj_type=f"parameter of {func.__name__}()")
+ return func(*args, **kwargs)
+
+ # Don't modify *func*'s signature, as boilerplate.py needs it.
+ wrapper.__signature__ = signature.replace(parameters=[
+ param.replace(kind=KWO) if param.name in kwonly else param
+ for param in signature.parameters.values()])
+ DECORATORS[wrapper] = decorator
+ return wrapper
+
+
+def deprecate_method_override(method, obj, *, allow_empty=False, **kwargs):
+ """
+ Return ``obj.method`` with a deprecation if it was overridden, else None.
+
+ Parameters
+ ----------
+ method
+ An unbound method, i.e. an expression of the form
+ ``Class.method_name``. Remember that within the body of a method, one
+ can always use ``__class__`` to refer to the class that is currently
+ being defined.
+ obj
+ Either an object of the class where *method* is defined, or a subclass
+ of that class.
+ allow_empty : bool, default: False
+ Whether to allow overrides by "empty" methods without emitting a
+ warning.
+ **kwargs
+ Additional parameters passed to `warn_deprecated` to generate the
+ deprecation warning; must at least include the "since" key.
+ """
+
+ def empty(): pass
+ def empty_with_docstring(): """doc"""
+
+ name = method.__name__
+ bound_child = getattr(obj, name)
+ bound_base = (
+ method # If obj is a class, then we need to use unbound methods.
+ if isinstance(bound_child, type(empty)) and isinstance(obj, type)
+ else method.__get__(obj))
+ if (bound_child != bound_base
+ and (not allow_empty
+ or (getattr(getattr(bound_child, "__code__", None),
+ "co_code", None)
+ not in [empty.__code__.co_code,
+ empty_with_docstring.__code__.co_code]))):
+ warn_deprecated(**{"name": name, "obj_type": "method", **kwargs})
+ return bound_child
+ return None
+
+
+@contextlib.contextmanager
+def suppress_matplotlib_deprecation_warning():
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", MatplotlibDeprecationWarning)
+ yield
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/deprecation.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/deprecation.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..e050290662d925fd68bd534881512e86db13a4bb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_api/deprecation.pyi
@@ -0,0 +1,75 @@
+from collections.abc import Callable
+import contextlib
+from typing import Any, Literal, ParamSpec, TypedDict, TypeVar, overload
+from typing_extensions import (
+ Unpack, # < Py 3.11
+)
+
+_P = ParamSpec("_P")
+_R = TypeVar("_R")
+_T = TypeVar("_T")
+
+class MatplotlibDeprecationWarning(DeprecationWarning): ...
+
+class DeprecationKwargs(TypedDict, total=False):
+ message: str
+ alternative: str
+ pending: bool
+ obj_type: str
+ addendum: str
+ removal: str | Literal[False]
+
+class NamedDeprecationKwargs(DeprecationKwargs, total=False):
+ name: str
+
+def warn_deprecated(since: str, **kwargs: Unpack[NamedDeprecationKwargs]) -> None: ...
+def deprecated(
+ since: str, **kwargs: Unpack[NamedDeprecationKwargs]
+) -> Callable[[_T], _T]: ...
+
+class deprecate_privatize_attribute(Any):
+ def __init__(self, since: str, **kwargs: Unpack[NamedDeprecationKwargs]): ...
+ def __set_name__(self, owner: type[object], name: str) -> None: ...
+
+DECORATORS: dict[Callable, Callable] = ...
+
+@overload
+def rename_parameter(
+ since: str, old: str, new: str, func: None = ...
+) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
+@overload
+def rename_parameter(
+ since: str, old: str, new: str, func: Callable[_P, _R]
+) -> Callable[_P, _R]: ...
+
+class _deprecated_parameter_class: ...
+
+_deprecated_parameter: _deprecated_parameter_class
+
+@overload
+def delete_parameter(
+ since: str, name: str, func: None = ..., **kwargs: Unpack[DeprecationKwargs]
+) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
+@overload
+def delete_parameter(
+ since: str, name: str, func: Callable[_P, _R], **kwargs: Unpack[DeprecationKwargs]
+) -> Callable[_P, _R]: ...
+@overload
+def make_keyword_only(
+ since: str, name: str, func: None = ...
+) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
+@overload
+def make_keyword_only(
+ since: str, name: str, func: Callable[_P, _R]
+) -> Callable[_P, _R]: ...
+def deprecate_method_override(
+ method: Callable[_P, _R],
+ obj: object | type,
+ *,
+ allow_empty: bool = ...,
+ since: str,
+ **kwargs: Unpack[NamedDeprecationKwargs]
+) -> Callable[_P, _R]: ...
+def suppress_matplotlib_deprecation_warning() -> (
+ contextlib.AbstractContextManager[None]
+): ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_blocking_input.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_blocking_input.py
new file mode 100644
index 0000000000000000000000000000000000000000..45f0775714431e73c283fede1f0cf12d7eaabb8d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_blocking_input.py
@@ -0,0 +1,30 @@
+def blocking_input_loop(figure, event_names, timeout, handler):
+ """
+ Run *figure*'s event loop while listening to interactive events.
+
+ The events listed in *event_names* are passed to *handler*.
+
+ This function is used to implement `.Figure.waitforbuttonpress`,
+ `.Figure.ginput`, and `.Axes.clabel`.
+
+ Parameters
+ ----------
+ figure : `~matplotlib.figure.Figure`
+ event_names : list of str
+ The names of the events passed to *handler*.
+ timeout : float
+ If positive, the event loop is stopped after *timeout* seconds.
+ handler : Callable[[Event], Any]
+ Function called for each event; it can force an early exit of the event
+ loop by calling ``canvas.stop_event_loop()``.
+ """
+ if figure.canvas.manager:
+ figure.show() # Ensure that the figure is shown if we are managing it.
+ # Connect the events to the on_event function call.
+ cids = [figure.canvas.mpl_connect(name, handler) for name in event_names]
+ try:
+ figure.canvas.start_event_loop(timeout) # Start event loop.
+ finally: # Run even on exception like ctrl-c.
+ # Disconnect the callbacks.
+ for cid in cids:
+ figure.canvas.mpl_disconnect(cid)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_c_internal_utils.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_c_internal_utils.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..ccc172cde27a35ad930cc618b86fdf5c8d44728e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_c_internal_utils.pyi
@@ -0,0 +1,8 @@
+def display_is_valid() -> bool: ...
+def xdisplay_is_valid() -> bool: ...
+
+def Win32_GetForegroundWindow() -> int | None: ...
+def Win32_SetForegroundWindow(hwnd: int) -> None: ...
+def Win32_SetProcessDpiAwareness_max() -> None: ...
+def Win32_SetCurrentProcessExplicitAppUserModelID(appid: str) -> None: ...
+def Win32_GetCurrentProcessExplicitAppUserModelID() -> str | None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm.py
new file mode 100644
index 0000000000000000000000000000000000000000..b942d1697934789f26c522b3e7592671540919a6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm.py
@@ -0,0 +1,1460 @@
+"""
+Nothing here but dictionaries for generating LinearSegmentedColormaps,
+and a dictionary of these dictionaries.
+
+Documentation for each is in pyplot.colormaps(). Please update this
+with the purpose and type of your colormap if you add data for one here.
+"""
+
+from functools import partial
+
+import numpy as np
+
+_binary_data = {
+ 'red': ((0., 1., 1.), (1., 0., 0.)),
+ 'green': ((0., 1., 1.), (1., 0., 0.)),
+ 'blue': ((0., 1., 1.), (1., 0., 0.))
+ }
+
+_autumn_data = {'red': ((0., 1.0, 1.0), (1.0, 1.0, 1.0)),
+ 'green': ((0., 0., 0.), (1.0, 1.0, 1.0)),
+ 'blue': ((0., 0., 0.), (1.0, 0., 0.))}
+
+_bone_data = {'red': ((0., 0., 0.),
+ (0.746032, 0.652778, 0.652778),
+ (1.0, 1.0, 1.0)),
+ 'green': ((0., 0., 0.),
+ (0.365079, 0.319444, 0.319444),
+ (0.746032, 0.777778, 0.777778),
+ (1.0, 1.0, 1.0)),
+ 'blue': ((0., 0., 0.),
+ (0.365079, 0.444444, 0.444444),
+ (1.0, 1.0, 1.0))}
+
+_cool_data = {'red': ((0., 0., 0.), (1.0, 1.0, 1.0)),
+ 'green': ((0., 1., 1.), (1.0, 0., 0.)),
+ 'blue': ((0., 1., 1.), (1.0, 1., 1.))}
+
+_copper_data = {'red': ((0., 0., 0.),
+ (0.809524, 1.000000, 1.000000),
+ (1.0, 1.0, 1.0)),
+ 'green': ((0., 0., 0.),
+ (1.0, 0.7812, 0.7812)),
+ 'blue': ((0., 0., 0.),
+ (1.0, 0.4975, 0.4975))}
+
+def _flag_red(x): return 0.75 * np.sin((x * 31.5 + 0.25) * np.pi) + 0.5
+def _flag_green(x): return np.sin(x * 31.5 * np.pi)
+def _flag_blue(x): return 0.75 * np.sin((x * 31.5 - 0.25) * np.pi) + 0.5
+_flag_data = {'red': _flag_red, 'green': _flag_green, 'blue': _flag_blue}
+
+def _prism_red(x): return 0.75 * np.sin((x * 20.9 + 0.25) * np.pi) + 0.67
+def _prism_green(x): return 0.75 * np.sin((x * 20.9 - 0.25) * np.pi) + 0.33
+def _prism_blue(x): return -1.1 * np.sin((x * 20.9) * np.pi)
+_prism_data = {'red': _prism_red, 'green': _prism_green, 'blue': _prism_blue}
+
+def _ch_helper(gamma, s, r, h, p0, p1, x):
+ """Helper function for generating picklable cubehelix colormaps."""
+ # Apply gamma factor to emphasise low or high intensity values
+ xg = x ** gamma
+ # Calculate amplitude and angle of deviation from the black to white
+ # diagonal in the plane of constant perceived intensity.
+ a = h * xg * (1 - xg) / 2
+ phi = 2 * np.pi * (s / 3 + r * x)
+ return xg + a * (p0 * np.cos(phi) + p1 * np.sin(phi))
+
+def cubehelix(gamma=1.0, s=0.5, r=-1.5, h=1.0):
+ """
+ Return custom data dictionary of (r, g, b) conversion functions, which can
+ be used with `.ColormapRegistry.register`, for the cubehelix color scheme.
+
+ Unlike most other color schemes cubehelix was designed by D.A. Green to
+ be monotonically increasing in terms of perceived brightness.
+ Also, when printed on a black and white postscript printer, the scheme
+ results in a greyscale with monotonically increasing brightness.
+ This color scheme is named cubehelix because the (r, g, b) values produced
+ can be visualised as a squashed helix around the diagonal in the
+ (r, g, b) color cube.
+
+ For a unit color cube (i.e. 3D coordinates for (r, g, b) each in the
+ range 0 to 1) the color scheme starts at (r, g, b) = (0, 0, 0), i.e. black,
+ and finishes at (r, g, b) = (1, 1, 1), i.e. white. For some fraction *x*,
+ between 0 and 1, the color is the corresponding grey value at that
+ fraction along the black to white diagonal (x, x, x) plus a color
+ element. This color element is calculated in a plane of constant
+ perceived intensity and controlled by the following parameters.
+
+ Parameters
+ ----------
+ gamma : float, default: 1
+ Gamma factor emphasizing either low intensity values (gamma < 1), or
+ high intensity values (gamma > 1).
+ s : float, default: 0.5 (purple)
+ The starting color.
+ r : float, default: -1.5
+ The number of r, g, b rotations in color that are made from the start
+ to the end of the color scheme. The default of -1.5 corresponds to ->
+ B -> G -> R -> B.
+ h : float, default: 1
+ The hue, i.e. how saturated the colors are. If this parameter is zero
+ then the color scheme is purely a greyscale.
+ """
+ return {'red': partial(_ch_helper, gamma, s, r, h, -0.14861, 1.78277),
+ 'green': partial(_ch_helper, gamma, s, r, h, -0.29227, -0.90649),
+ 'blue': partial(_ch_helper, gamma, s, r, h, 1.97294, 0.0)}
+
+_cubehelix_data = cubehelix()
+
+_bwr_data = ((0.0, 0.0, 1.0), (1.0, 1.0, 1.0), (1.0, 0.0, 0.0))
+_brg_data = ((0.0, 0.0, 1.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0))
+
+# Gnuplot palette functions
+def _g0(x): return 0
+def _g1(x): return 0.5
+def _g2(x): return 1
+def _g3(x): return x
+def _g4(x): return x ** 2
+def _g5(x): return x ** 3
+def _g6(x): return x ** 4
+def _g7(x): return np.sqrt(x)
+def _g8(x): return np.sqrt(np.sqrt(x))
+def _g9(x): return np.sin(x * np.pi / 2)
+def _g10(x): return np.cos(x * np.pi / 2)
+def _g11(x): return np.abs(x - 0.5)
+def _g12(x): return (2 * x - 1) ** 2
+def _g13(x): return np.sin(x * np.pi)
+def _g14(x): return np.abs(np.cos(x * np.pi))
+def _g15(x): return np.sin(x * 2 * np.pi)
+def _g16(x): return np.cos(x * 2 * np.pi)
+def _g17(x): return np.abs(np.sin(x * 2 * np.pi))
+def _g18(x): return np.abs(np.cos(x * 2 * np.pi))
+def _g19(x): return np.abs(np.sin(x * 4 * np.pi))
+def _g20(x): return np.abs(np.cos(x * 4 * np.pi))
+def _g21(x): return 3 * x
+def _g22(x): return 3 * x - 1
+def _g23(x): return 3 * x - 2
+def _g24(x): return np.abs(3 * x - 1)
+def _g25(x): return np.abs(3 * x - 2)
+def _g26(x): return (3 * x - 1) / 2
+def _g27(x): return (3 * x - 2) / 2
+def _g28(x): return np.abs((3 * x - 1) / 2)
+def _g29(x): return np.abs((3 * x - 2) / 2)
+def _g30(x): return x / 0.32 - 0.78125
+def _g31(x): return 2 * x - 0.84
+def _g32(x):
+ ret = np.zeros(len(x))
+ m = (x < 0.25)
+ ret[m] = 4 * x[m]
+ m = (x >= 0.25) & (x < 0.92)
+ ret[m] = -2 * x[m] + 1.84
+ m = (x >= 0.92)
+ ret[m] = x[m] / 0.08 - 11.5
+ return ret
+def _g33(x): return np.abs(2 * x - 0.5)
+def _g34(x): return 2 * x
+def _g35(x): return 2 * x - 0.5
+def _g36(x): return 2 * x - 1
+
+gfunc = {i: globals()[f"_g{i}"] for i in range(37)}
+
+_gnuplot_data = {
+ 'red': gfunc[7],
+ 'green': gfunc[5],
+ 'blue': gfunc[15],
+}
+
+_gnuplot2_data = {
+ 'red': gfunc[30],
+ 'green': gfunc[31],
+ 'blue': gfunc[32],
+}
+
+_ocean_data = {
+ 'red': gfunc[23],
+ 'green': gfunc[28],
+ 'blue': gfunc[3],
+}
+
+_afmhot_data = {
+ 'red': gfunc[34],
+ 'green': gfunc[35],
+ 'blue': gfunc[36],
+}
+
+_rainbow_data = {
+ 'red': gfunc[33],
+ 'green': gfunc[13],
+ 'blue': gfunc[10],
+}
+
+_seismic_data = (
+ (0.0, 0.0, 0.3), (0.0, 0.0, 1.0),
+ (1.0, 1.0, 1.0), (1.0, 0.0, 0.0),
+ (0.5, 0.0, 0.0))
+
+_terrain_data = (
+ (0.00, (0.2, 0.2, 0.6)),
+ (0.15, (0.0, 0.6, 1.0)),
+ (0.25, (0.0, 0.8, 0.4)),
+ (0.50, (1.0, 1.0, 0.6)),
+ (0.75, (0.5, 0.36, 0.33)),
+ (1.00, (1.0, 1.0, 1.0)))
+
+_gray_data = {'red': ((0., 0, 0), (1., 1, 1)),
+ 'green': ((0., 0, 0), (1., 1, 1)),
+ 'blue': ((0., 0, 0), (1., 1, 1))}
+
+_hot_data = {'red': ((0., 0.0416, 0.0416),
+ (0.365079, 1.000000, 1.000000),
+ (1.0, 1.0, 1.0)),
+ 'green': ((0., 0., 0.),
+ (0.365079, 0.000000, 0.000000),
+ (0.746032, 1.000000, 1.000000),
+ (1.0, 1.0, 1.0)),
+ 'blue': ((0., 0., 0.),
+ (0.746032, 0.000000, 0.000000),
+ (1.0, 1.0, 1.0))}
+
+_hsv_data = {'red': ((0., 1., 1.),
+ (0.158730, 1.000000, 1.000000),
+ (0.174603, 0.968750, 0.968750),
+ (0.333333, 0.031250, 0.031250),
+ (0.349206, 0.000000, 0.000000),
+ (0.666667, 0.000000, 0.000000),
+ (0.682540, 0.031250, 0.031250),
+ (0.841270, 0.968750, 0.968750),
+ (0.857143, 1.000000, 1.000000),
+ (1.0, 1.0, 1.0)),
+ 'green': ((0., 0., 0.),
+ (0.158730, 0.937500, 0.937500),
+ (0.174603, 1.000000, 1.000000),
+ (0.507937, 1.000000, 1.000000),
+ (0.666667, 0.062500, 0.062500),
+ (0.682540, 0.000000, 0.000000),
+ (1.0, 0., 0.)),
+ 'blue': ((0., 0., 0.),
+ (0.333333, 0.000000, 0.000000),
+ (0.349206, 0.062500, 0.062500),
+ (0.507937, 1.000000, 1.000000),
+ (0.841270, 1.000000, 1.000000),
+ (0.857143, 0.937500, 0.937500),
+ (1.0, 0.09375, 0.09375))}
+
+_jet_data = {'red': ((0.00, 0, 0),
+ (0.35, 0, 0),
+ (0.66, 1, 1),
+ (0.89, 1, 1),
+ (1.00, 0.5, 0.5)),
+ 'green': ((0.000, 0, 0),
+ (0.125, 0, 0),
+ (0.375, 1, 1),
+ (0.640, 1, 1),
+ (0.910, 0, 0),
+ (1.000, 0, 0)),
+ 'blue': ((0.00, 0.5, 0.5),
+ (0.11, 1, 1),
+ (0.34, 1, 1),
+ (0.65, 0, 0),
+ (1.00, 0, 0))}
+
+_pink_data = {'red': ((0., 0.1178, 0.1178), (0.015873, 0.195857, 0.195857),
+ (0.031746, 0.250661, 0.250661),
+ (0.047619, 0.295468, 0.295468),
+ (0.063492, 0.334324, 0.334324),
+ (0.079365, 0.369112, 0.369112),
+ (0.095238, 0.400892, 0.400892),
+ (0.111111, 0.430331, 0.430331),
+ (0.126984, 0.457882, 0.457882),
+ (0.142857, 0.483867, 0.483867),
+ (0.158730, 0.508525, 0.508525),
+ (0.174603, 0.532042, 0.532042),
+ (0.190476, 0.554563, 0.554563),
+ (0.206349, 0.576204, 0.576204),
+ (0.222222, 0.597061, 0.597061),
+ (0.238095, 0.617213, 0.617213),
+ (0.253968, 0.636729, 0.636729),
+ (0.269841, 0.655663, 0.655663),
+ (0.285714, 0.674066, 0.674066),
+ (0.301587, 0.691980, 0.691980),
+ (0.317460, 0.709441, 0.709441),
+ (0.333333, 0.726483, 0.726483),
+ (0.349206, 0.743134, 0.743134),
+ (0.365079, 0.759421, 0.759421),
+ (0.380952, 0.766356, 0.766356),
+ (0.396825, 0.773229, 0.773229),
+ (0.412698, 0.780042, 0.780042),
+ (0.428571, 0.786796, 0.786796),
+ (0.444444, 0.793492, 0.793492),
+ (0.460317, 0.800132, 0.800132),
+ (0.476190, 0.806718, 0.806718),
+ (0.492063, 0.813250, 0.813250),
+ (0.507937, 0.819730, 0.819730),
+ (0.523810, 0.826160, 0.826160),
+ (0.539683, 0.832539, 0.832539),
+ (0.555556, 0.838870, 0.838870),
+ (0.571429, 0.845154, 0.845154),
+ (0.587302, 0.851392, 0.851392),
+ (0.603175, 0.857584, 0.857584),
+ (0.619048, 0.863731, 0.863731),
+ (0.634921, 0.869835, 0.869835),
+ (0.650794, 0.875897, 0.875897),
+ (0.666667, 0.881917, 0.881917),
+ (0.682540, 0.887896, 0.887896),
+ (0.698413, 0.893835, 0.893835),
+ (0.714286, 0.899735, 0.899735),
+ (0.730159, 0.905597, 0.905597),
+ (0.746032, 0.911421, 0.911421),
+ (0.761905, 0.917208, 0.917208),
+ (0.777778, 0.922958, 0.922958),
+ (0.793651, 0.928673, 0.928673),
+ (0.809524, 0.934353, 0.934353),
+ (0.825397, 0.939999, 0.939999),
+ (0.841270, 0.945611, 0.945611),
+ (0.857143, 0.951190, 0.951190),
+ (0.873016, 0.956736, 0.956736),
+ (0.888889, 0.962250, 0.962250),
+ (0.904762, 0.967733, 0.967733),
+ (0.920635, 0.973185, 0.973185),
+ (0.936508, 0.978607, 0.978607),
+ (0.952381, 0.983999, 0.983999),
+ (0.968254, 0.989361, 0.989361),
+ (0.984127, 0.994695, 0.994695), (1.0, 1.0, 1.0)),
+ 'green': ((0., 0., 0.), (0.015873, 0.102869, 0.102869),
+ (0.031746, 0.145479, 0.145479),
+ (0.047619, 0.178174, 0.178174),
+ (0.063492, 0.205738, 0.205738),
+ (0.079365, 0.230022, 0.230022),
+ (0.095238, 0.251976, 0.251976),
+ (0.111111, 0.272166, 0.272166),
+ (0.126984, 0.290957, 0.290957),
+ (0.142857, 0.308607, 0.308607),
+ (0.158730, 0.325300, 0.325300),
+ (0.174603, 0.341178, 0.341178),
+ (0.190476, 0.356348, 0.356348),
+ (0.206349, 0.370899, 0.370899),
+ (0.222222, 0.384900, 0.384900),
+ (0.238095, 0.398410, 0.398410),
+ (0.253968, 0.411476, 0.411476),
+ (0.269841, 0.424139, 0.424139),
+ (0.285714, 0.436436, 0.436436),
+ (0.301587, 0.448395, 0.448395),
+ (0.317460, 0.460044, 0.460044),
+ (0.333333, 0.471405, 0.471405),
+ (0.349206, 0.482498, 0.482498),
+ (0.365079, 0.493342, 0.493342),
+ (0.380952, 0.517549, 0.517549),
+ (0.396825, 0.540674, 0.540674),
+ (0.412698, 0.562849, 0.562849),
+ (0.428571, 0.584183, 0.584183),
+ (0.444444, 0.604765, 0.604765),
+ (0.460317, 0.624669, 0.624669),
+ (0.476190, 0.643958, 0.643958),
+ (0.492063, 0.662687, 0.662687),
+ (0.507937, 0.680900, 0.680900),
+ (0.523810, 0.698638, 0.698638),
+ (0.539683, 0.715937, 0.715937),
+ (0.555556, 0.732828, 0.732828),
+ (0.571429, 0.749338, 0.749338),
+ (0.587302, 0.765493, 0.765493),
+ (0.603175, 0.781313, 0.781313),
+ (0.619048, 0.796819, 0.796819),
+ (0.634921, 0.812029, 0.812029),
+ (0.650794, 0.826960, 0.826960),
+ (0.666667, 0.841625, 0.841625),
+ (0.682540, 0.856040, 0.856040),
+ (0.698413, 0.870216, 0.870216),
+ (0.714286, 0.884164, 0.884164),
+ (0.730159, 0.897896, 0.897896),
+ (0.746032, 0.911421, 0.911421),
+ (0.761905, 0.917208, 0.917208),
+ (0.777778, 0.922958, 0.922958),
+ (0.793651, 0.928673, 0.928673),
+ (0.809524, 0.934353, 0.934353),
+ (0.825397, 0.939999, 0.939999),
+ (0.841270, 0.945611, 0.945611),
+ (0.857143, 0.951190, 0.951190),
+ (0.873016, 0.956736, 0.956736),
+ (0.888889, 0.962250, 0.962250),
+ (0.904762, 0.967733, 0.967733),
+ (0.920635, 0.973185, 0.973185),
+ (0.936508, 0.978607, 0.978607),
+ (0.952381, 0.983999, 0.983999),
+ (0.968254, 0.989361, 0.989361),
+ (0.984127, 0.994695, 0.994695), (1.0, 1.0, 1.0)),
+ 'blue': ((0., 0., 0.), (0.015873, 0.102869, 0.102869),
+ (0.031746, 0.145479, 0.145479),
+ (0.047619, 0.178174, 0.178174),
+ (0.063492, 0.205738, 0.205738),
+ (0.079365, 0.230022, 0.230022),
+ (0.095238, 0.251976, 0.251976),
+ (0.111111, 0.272166, 0.272166),
+ (0.126984, 0.290957, 0.290957),
+ (0.142857, 0.308607, 0.308607),
+ (0.158730, 0.325300, 0.325300),
+ (0.174603, 0.341178, 0.341178),
+ (0.190476, 0.356348, 0.356348),
+ (0.206349, 0.370899, 0.370899),
+ (0.222222, 0.384900, 0.384900),
+ (0.238095, 0.398410, 0.398410),
+ (0.253968, 0.411476, 0.411476),
+ (0.269841, 0.424139, 0.424139),
+ (0.285714, 0.436436, 0.436436),
+ (0.301587, 0.448395, 0.448395),
+ (0.317460, 0.460044, 0.460044),
+ (0.333333, 0.471405, 0.471405),
+ (0.349206, 0.482498, 0.482498),
+ (0.365079, 0.493342, 0.493342),
+ (0.380952, 0.503953, 0.503953),
+ (0.396825, 0.514344, 0.514344),
+ (0.412698, 0.524531, 0.524531),
+ (0.428571, 0.534522, 0.534522),
+ (0.444444, 0.544331, 0.544331),
+ (0.460317, 0.553966, 0.553966),
+ (0.476190, 0.563436, 0.563436),
+ (0.492063, 0.572750, 0.572750),
+ (0.507937, 0.581914, 0.581914),
+ (0.523810, 0.590937, 0.590937),
+ (0.539683, 0.599824, 0.599824),
+ (0.555556, 0.608581, 0.608581),
+ (0.571429, 0.617213, 0.617213),
+ (0.587302, 0.625727, 0.625727),
+ (0.603175, 0.634126, 0.634126),
+ (0.619048, 0.642416, 0.642416),
+ (0.634921, 0.650600, 0.650600),
+ (0.650794, 0.658682, 0.658682),
+ (0.666667, 0.666667, 0.666667),
+ (0.682540, 0.674556, 0.674556),
+ (0.698413, 0.682355, 0.682355),
+ (0.714286, 0.690066, 0.690066),
+ (0.730159, 0.697691, 0.697691),
+ (0.746032, 0.705234, 0.705234),
+ (0.761905, 0.727166, 0.727166),
+ (0.777778, 0.748455, 0.748455),
+ (0.793651, 0.769156, 0.769156),
+ (0.809524, 0.789314, 0.789314),
+ (0.825397, 0.808969, 0.808969),
+ (0.841270, 0.828159, 0.828159),
+ (0.857143, 0.846913, 0.846913),
+ (0.873016, 0.865261, 0.865261),
+ (0.888889, 0.883229, 0.883229),
+ (0.904762, 0.900837, 0.900837),
+ (0.920635, 0.918109, 0.918109),
+ (0.936508, 0.935061, 0.935061),
+ (0.952381, 0.951711, 0.951711),
+ (0.968254, 0.968075, 0.968075),
+ (0.984127, 0.984167, 0.984167), (1.0, 1.0, 1.0))}
+
+_spring_data = {'red': ((0., 1., 1.), (1.0, 1.0, 1.0)),
+ 'green': ((0., 0., 0.), (1.0, 1.0, 1.0)),
+ 'blue': ((0., 1., 1.), (1.0, 0.0, 0.0))}
+
+
+_summer_data = {'red': ((0., 0., 0.), (1.0, 1.0, 1.0)),
+ 'green': ((0., 0.5, 0.5), (1.0, 1.0, 1.0)),
+ 'blue': ((0., 0.4, 0.4), (1.0, 0.4, 0.4))}
+
+
+_winter_data = {'red': ((0., 0., 0.), (1.0, 0.0, 0.0)),
+ 'green': ((0., 0., 0.), (1.0, 1.0, 1.0)),
+ 'blue': ((0., 1., 1.), (1.0, 0.5, 0.5))}
+
+_nipy_spectral_data = {
+ 'red': [
+ (0.0, 0.0, 0.0), (0.05, 0.4667, 0.4667),
+ (0.10, 0.5333, 0.5333), (0.15, 0.0, 0.0),
+ (0.20, 0.0, 0.0), (0.25, 0.0, 0.0),
+ (0.30, 0.0, 0.0), (0.35, 0.0, 0.0),
+ (0.40, 0.0, 0.0), (0.45, 0.0, 0.0),
+ (0.50, 0.0, 0.0), (0.55, 0.0, 0.0),
+ (0.60, 0.0, 0.0), (0.65, 0.7333, 0.7333),
+ (0.70, 0.9333, 0.9333), (0.75, 1.0, 1.0),
+ (0.80, 1.0, 1.0), (0.85, 1.0, 1.0),
+ (0.90, 0.8667, 0.8667), (0.95, 0.80, 0.80),
+ (1.0, 0.80, 0.80),
+ ],
+ 'green': [
+ (0.0, 0.0, 0.0), (0.05, 0.0, 0.0),
+ (0.10, 0.0, 0.0), (0.15, 0.0, 0.0),
+ (0.20, 0.0, 0.0), (0.25, 0.4667, 0.4667),
+ (0.30, 0.6000, 0.6000), (0.35, 0.6667, 0.6667),
+ (0.40, 0.6667, 0.6667), (0.45, 0.6000, 0.6000),
+ (0.50, 0.7333, 0.7333), (0.55, 0.8667, 0.8667),
+ (0.60, 1.0, 1.0), (0.65, 1.0, 1.0),
+ (0.70, 0.9333, 0.9333), (0.75, 0.8000, 0.8000),
+ (0.80, 0.6000, 0.6000), (0.85, 0.0, 0.0),
+ (0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
+ (1.0, 0.80, 0.80),
+ ],
+ 'blue': [
+ (0.0, 0.0, 0.0), (0.05, 0.5333, 0.5333),
+ (0.10, 0.6000, 0.6000), (0.15, 0.6667, 0.6667),
+ (0.20, 0.8667, 0.8667), (0.25, 0.8667, 0.8667),
+ (0.30, 0.8667, 0.8667), (0.35, 0.6667, 0.6667),
+ (0.40, 0.5333, 0.5333), (0.45, 0.0, 0.0),
+ (0.5, 0.0, 0.0), (0.55, 0.0, 0.0),
+ (0.60, 0.0, 0.0), (0.65, 0.0, 0.0),
+ (0.70, 0.0, 0.0), (0.75, 0.0, 0.0),
+ (0.80, 0.0, 0.0), (0.85, 0.0, 0.0),
+ (0.90, 0.0, 0.0), (0.95, 0.0, 0.0),
+ (1.0, 0.80, 0.80),
+ ],
+}
+
+
+# 34 colormaps based on color specifications and designs
+# developed by Cynthia Brewer (https://colorbrewer2.org/).
+# The ColorBrewer palettes have been included under the terms
+# of an Apache-stype license (for details, see the file
+# LICENSE_COLORBREWER in the license directory of the matplotlib
+# source distribution).
+
+# RGB values taken from Brewer's Excel sheet, divided by 255
+
+_Blues_data = (
+ (0.96862745098039216, 0.98431372549019602, 1.0 ),
+ (0.87058823529411766, 0.92156862745098034, 0.96862745098039216),
+ (0.77647058823529413, 0.85882352941176465, 0.93725490196078431),
+ (0.61960784313725492, 0.792156862745098 , 0.88235294117647056),
+ (0.41960784313725491, 0.68235294117647061, 0.83921568627450982),
+ (0.25882352941176473, 0.5725490196078431 , 0.77647058823529413),
+ (0.12941176470588237, 0.44313725490196076, 0.70980392156862748),
+ (0.03137254901960784, 0.31764705882352939, 0.61176470588235299),
+ (0.03137254901960784, 0.18823529411764706, 0.41960784313725491)
+ )
+
+_BrBG_data = (
+ (0.32941176470588235, 0.18823529411764706, 0.0196078431372549 ),
+ (0.5490196078431373 , 0.31764705882352939, 0.0392156862745098 ),
+ (0.74901960784313726, 0.50588235294117645, 0.17647058823529413),
+ (0.87450980392156863, 0.76078431372549016, 0.49019607843137253),
+ (0.96470588235294119, 0.90980392156862744, 0.76470588235294112),
+ (0.96078431372549022, 0.96078431372549022, 0.96078431372549022),
+ (0.7803921568627451 , 0.91764705882352937, 0.89803921568627454),
+ (0.50196078431372548, 0.80392156862745101, 0.75686274509803919),
+ (0.20784313725490197, 0.59215686274509804, 0.5607843137254902 ),
+ (0.00392156862745098, 0.4 , 0.36862745098039218),
+ (0.0 , 0.23529411764705882, 0.18823529411764706)
+ )
+
+_BuGn_data = (
+ (0.96862745098039216, 0.9882352941176471 , 0.99215686274509807),
+ (0.89803921568627454, 0.96078431372549022, 0.97647058823529409),
+ (0.8 , 0.92549019607843142, 0.90196078431372551),
+ (0.6 , 0.84705882352941175, 0.78823529411764703),
+ (0.4 , 0.76078431372549016, 0.64313725490196083),
+ (0.25490196078431371, 0.68235294117647061, 0.46274509803921571),
+ (0.13725490196078433, 0.54509803921568623, 0.27058823529411763),
+ (0.0 , 0.42745098039215684, 0.17254901960784313),
+ (0.0 , 0.26666666666666666, 0.10588235294117647)
+ )
+
+_BuPu_data = (
+ (0.96862745098039216, 0.9882352941176471 , 0.99215686274509807),
+ (0.8784313725490196 , 0.92549019607843142, 0.95686274509803926),
+ (0.74901960784313726, 0.82745098039215681, 0.90196078431372551),
+ (0.61960784313725492, 0.73725490196078436, 0.85490196078431369),
+ (0.5490196078431373 , 0.58823529411764708, 0.77647058823529413),
+ (0.5490196078431373 , 0.41960784313725491, 0.69411764705882351),
+ (0.53333333333333333, 0.25490196078431371, 0.61568627450980395),
+ (0.50588235294117645, 0.05882352941176471, 0.48627450980392156),
+ (0.30196078431372547, 0.0 , 0.29411764705882354)
+ )
+
+_GnBu_data = (
+ (0.96862745098039216, 0.9882352941176471 , 0.94117647058823528),
+ (0.8784313725490196 , 0.95294117647058818, 0.85882352941176465),
+ (0.8 , 0.92156862745098034, 0.77254901960784317),
+ (0.6588235294117647 , 0.8666666666666667 , 0.70980392156862748),
+ (0.4823529411764706 , 0.8 , 0.7686274509803922 ),
+ (0.30588235294117649, 0.70196078431372544, 0.82745098039215681),
+ (0.16862745098039217, 0.5490196078431373 , 0.74509803921568629),
+ (0.03137254901960784, 0.40784313725490196, 0.67450980392156867),
+ (0.03137254901960784, 0.25098039215686274, 0.50588235294117645)
+ )
+
+_Greens_data = (
+ (0.96862745098039216, 0.9882352941176471 , 0.96078431372549022),
+ (0.89803921568627454, 0.96078431372549022, 0.8784313725490196 ),
+ (0.7803921568627451 , 0.9137254901960784 , 0.75294117647058822),
+ (0.63137254901960782, 0.85098039215686272, 0.60784313725490191),
+ (0.45490196078431372, 0.7686274509803922 , 0.46274509803921571),
+ (0.25490196078431371, 0.6705882352941176 , 0.36470588235294116),
+ (0.13725490196078433, 0.54509803921568623, 0.27058823529411763),
+ (0.0 , 0.42745098039215684, 0.17254901960784313),
+ (0.0 , 0.26666666666666666, 0.10588235294117647)
+ )
+
+_Greys_data = (
+ (1.0 , 1.0 , 1.0 ),
+ (0.94117647058823528, 0.94117647058823528, 0.94117647058823528),
+ (0.85098039215686272, 0.85098039215686272, 0.85098039215686272),
+ (0.74117647058823533, 0.74117647058823533, 0.74117647058823533),
+ (0.58823529411764708, 0.58823529411764708, 0.58823529411764708),
+ (0.45098039215686275, 0.45098039215686275, 0.45098039215686275),
+ (0.32156862745098042, 0.32156862745098042, 0.32156862745098042),
+ (0.14509803921568629, 0.14509803921568629, 0.14509803921568629),
+ (0.0 , 0.0 , 0.0 )
+ )
+
+_Oranges_data = (
+ (1.0 , 0.96078431372549022, 0.92156862745098034),
+ (0.99607843137254903, 0.90196078431372551, 0.80784313725490198),
+ (0.99215686274509807, 0.81568627450980391, 0.63529411764705879),
+ (0.99215686274509807, 0.68235294117647061, 0.41960784313725491),
+ (0.99215686274509807, 0.55294117647058827, 0.23529411764705882),
+ (0.94509803921568625, 0.41176470588235292, 0.07450980392156863),
+ (0.85098039215686272, 0.28235294117647058, 0.00392156862745098),
+ (0.65098039215686276, 0.21176470588235294, 0.01176470588235294),
+ (0.49803921568627452, 0.15294117647058825, 0.01568627450980392)
+ )
+
+_OrRd_data = (
+ (1.0 , 0.96862745098039216, 0.92549019607843142),
+ (0.99607843137254903, 0.90980392156862744, 0.78431372549019607),
+ (0.99215686274509807, 0.83137254901960789, 0.61960784313725492),
+ (0.99215686274509807, 0.73333333333333328, 0.51764705882352946),
+ (0.9882352941176471 , 0.55294117647058827, 0.34901960784313724),
+ (0.93725490196078431, 0.396078431372549 , 0.28235294117647058),
+ (0.84313725490196079, 0.18823529411764706, 0.12156862745098039),
+ (0.70196078431372544, 0.0 , 0.0 ),
+ (0.49803921568627452, 0.0 , 0.0 )
+ )
+
+_PiYG_data = (
+ (0.55686274509803924, 0.00392156862745098, 0.32156862745098042),
+ (0.77254901960784317, 0.10588235294117647, 0.49019607843137253),
+ (0.87058823529411766, 0.46666666666666667, 0.68235294117647061),
+ (0.94509803921568625, 0.71372549019607845, 0.85490196078431369),
+ (0.99215686274509807, 0.8784313725490196 , 0.93725490196078431),
+ (0.96862745098039216, 0.96862745098039216, 0.96862745098039216),
+ (0.90196078431372551, 0.96078431372549022, 0.81568627450980391),
+ (0.72156862745098038, 0.88235294117647056, 0.52549019607843139),
+ (0.49803921568627452, 0.73725490196078436, 0.25490196078431371),
+ (0.30196078431372547, 0.5725490196078431 , 0.12941176470588237),
+ (0.15294117647058825, 0.39215686274509803, 0.09803921568627451)
+ )
+
+_PRGn_data = (
+ (0.25098039215686274, 0.0 , 0.29411764705882354),
+ (0.46274509803921571, 0.16470588235294117, 0.51372549019607838),
+ (0.6 , 0.4392156862745098 , 0.6705882352941176 ),
+ (0.76078431372549016, 0.6470588235294118 , 0.81176470588235294),
+ (0.90588235294117647, 0.83137254901960789, 0.90980392156862744),
+ (0.96862745098039216, 0.96862745098039216, 0.96862745098039216),
+ (0.85098039215686272, 0.94117647058823528, 0.82745098039215681),
+ (0.65098039215686276, 0.85882352941176465, 0.62745098039215685),
+ (0.35294117647058826, 0.68235294117647061, 0.38039215686274508),
+ (0.10588235294117647, 0.47058823529411764, 0.21568627450980393),
+ (0.0 , 0.26666666666666666, 0.10588235294117647)
+ )
+
+_PuBu_data = (
+ (1.0 , 0.96862745098039216, 0.98431372549019602),
+ (0.92549019607843142, 0.90588235294117647, 0.94901960784313721),
+ (0.81568627450980391, 0.81960784313725488, 0.90196078431372551),
+ (0.65098039215686276, 0.74117647058823533, 0.85882352941176465),
+ (0.45490196078431372, 0.66274509803921566, 0.81176470588235294),
+ (0.21176470588235294, 0.56470588235294117, 0.75294117647058822),
+ (0.0196078431372549 , 0.4392156862745098 , 0.69019607843137254),
+ (0.01568627450980392, 0.35294117647058826, 0.55294117647058827),
+ (0.00784313725490196, 0.2196078431372549 , 0.34509803921568627)
+ )
+
+_PuBuGn_data = (
+ (1.0 , 0.96862745098039216, 0.98431372549019602),
+ (0.92549019607843142, 0.88627450980392153, 0.94117647058823528),
+ (0.81568627450980391, 0.81960784313725488, 0.90196078431372551),
+ (0.65098039215686276, 0.74117647058823533, 0.85882352941176465),
+ (0.40392156862745099, 0.66274509803921566, 0.81176470588235294),
+ (0.21176470588235294, 0.56470588235294117, 0.75294117647058822),
+ (0.00784313725490196, 0.50588235294117645, 0.54117647058823526),
+ (0.00392156862745098, 0.42352941176470588, 0.34901960784313724),
+ (0.00392156862745098, 0.27450980392156865, 0.21176470588235294)
+ )
+
+_PuOr_data = (
+ (0.49803921568627452, 0.23137254901960785, 0.03137254901960784),
+ (0.70196078431372544, 0.34509803921568627, 0.02352941176470588),
+ (0.8784313725490196 , 0.50980392156862742, 0.07843137254901961),
+ (0.99215686274509807, 0.72156862745098038, 0.38823529411764707),
+ (0.99607843137254903, 0.8784313725490196 , 0.71372549019607845),
+ (0.96862745098039216, 0.96862745098039216, 0.96862745098039216),
+ (0.84705882352941175, 0.85490196078431369, 0.92156862745098034),
+ (0.69803921568627447, 0.6705882352941176 , 0.82352941176470584),
+ (0.50196078431372548, 0.45098039215686275, 0.67450980392156867),
+ (0.32941176470588235, 0.15294117647058825, 0.53333333333333333),
+ (0.17647058823529413, 0.0 , 0.29411764705882354)
+ )
+
+_PuRd_data = (
+ (0.96862745098039216, 0.95686274509803926, 0.97647058823529409),
+ (0.90588235294117647, 0.88235294117647056, 0.93725490196078431),
+ (0.83137254901960789, 0.72549019607843135, 0.85490196078431369),
+ (0.78823529411764703, 0.58039215686274515, 0.7803921568627451 ),
+ (0.87450980392156863, 0.396078431372549 , 0.69019607843137254),
+ (0.90588235294117647, 0.16078431372549021, 0.54117647058823526),
+ (0.80784313725490198, 0.07058823529411765, 0.33725490196078434),
+ (0.59607843137254901, 0.0 , 0.2627450980392157 ),
+ (0.40392156862745099, 0.0 , 0.12156862745098039)
+ )
+
+_Purples_data = (
+ (0.9882352941176471 , 0.98431372549019602, 0.99215686274509807),
+ (0.93725490196078431, 0.92941176470588238, 0.96078431372549022),
+ (0.85490196078431369, 0.85490196078431369, 0.92156862745098034),
+ (0.73725490196078436, 0.74117647058823533, 0.86274509803921573),
+ (0.61960784313725492, 0.60392156862745094, 0.78431372549019607),
+ (0.50196078431372548, 0.49019607843137253, 0.72941176470588232),
+ (0.41568627450980394, 0.31764705882352939, 0.63921568627450975),
+ (0.32941176470588235, 0.15294117647058825, 0.5607843137254902 ),
+ (0.24705882352941178, 0.0 , 0.49019607843137253)
+ )
+
+_RdBu_data = (
+ (0.40392156862745099, 0.0 , 0.12156862745098039),
+ (0.69803921568627447, 0.09411764705882353, 0.16862745098039217),
+ (0.83921568627450982, 0.37647058823529411, 0.30196078431372547),
+ (0.95686274509803926, 0.6470588235294118 , 0.50980392156862742),
+ (0.99215686274509807, 0.85882352941176465, 0.7803921568627451 ),
+ (0.96862745098039216, 0.96862745098039216, 0.96862745098039216),
+ (0.81960784313725488, 0.89803921568627454, 0.94117647058823528),
+ (0.5725490196078431 , 0.77254901960784317, 0.87058823529411766),
+ (0.2627450980392157 , 0.57647058823529407, 0.76470588235294112),
+ (0.12941176470588237, 0.4 , 0.67450980392156867),
+ (0.0196078431372549 , 0.18823529411764706, 0.38039215686274508)
+ )
+
+_RdGy_data = (
+ (0.40392156862745099, 0.0 , 0.12156862745098039),
+ (0.69803921568627447, 0.09411764705882353, 0.16862745098039217),
+ (0.83921568627450982, 0.37647058823529411, 0.30196078431372547),
+ (0.95686274509803926, 0.6470588235294118 , 0.50980392156862742),
+ (0.99215686274509807, 0.85882352941176465, 0.7803921568627451 ),
+ (1.0 , 1.0 , 1.0 ),
+ (0.8784313725490196 , 0.8784313725490196 , 0.8784313725490196 ),
+ (0.72941176470588232, 0.72941176470588232, 0.72941176470588232),
+ (0.52941176470588236, 0.52941176470588236, 0.52941176470588236),
+ (0.30196078431372547, 0.30196078431372547, 0.30196078431372547),
+ (0.10196078431372549, 0.10196078431372549, 0.10196078431372549)
+ )
+
+_RdPu_data = (
+ (1.0 , 0.96862745098039216, 0.95294117647058818),
+ (0.99215686274509807, 0.8784313725490196 , 0.86666666666666667),
+ (0.9882352941176471 , 0.77254901960784317, 0.75294117647058822),
+ (0.98039215686274506, 0.62352941176470589, 0.70980392156862748),
+ (0.96862745098039216, 0.40784313725490196, 0.63137254901960782),
+ (0.86666666666666667, 0.20392156862745098, 0.59215686274509804),
+ (0.68235294117647061, 0.00392156862745098, 0.49411764705882355),
+ (0.47843137254901963, 0.00392156862745098, 0.46666666666666667),
+ (0.28627450980392155, 0.0 , 0.41568627450980394)
+ )
+
+_RdYlBu_data = (
+ (0.6470588235294118 , 0.0 , 0.14901960784313725),
+ (0.84313725490196079, 0.18823529411764706 , 0.15294117647058825),
+ (0.95686274509803926, 0.42745098039215684 , 0.2627450980392157 ),
+ (0.99215686274509807, 0.68235294117647061 , 0.38039215686274508),
+ (0.99607843137254903, 0.8784313725490196 , 0.56470588235294117),
+ (1.0 , 1.0 , 0.74901960784313726),
+ (0.8784313725490196 , 0.95294117647058818 , 0.97254901960784312),
+ (0.6705882352941176 , 0.85098039215686272 , 0.9137254901960784 ),
+ (0.45490196078431372, 0.67843137254901964 , 0.81960784313725488),
+ (0.27058823529411763, 0.45882352941176469 , 0.70588235294117652),
+ (0.19215686274509805, 0.21176470588235294 , 0.58431372549019611)
+ )
+
+_RdYlGn_data = (
+ (0.6470588235294118 , 0.0 , 0.14901960784313725),
+ (0.84313725490196079, 0.18823529411764706 , 0.15294117647058825),
+ (0.95686274509803926, 0.42745098039215684 , 0.2627450980392157 ),
+ (0.99215686274509807, 0.68235294117647061 , 0.38039215686274508),
+ (0.99607843137254903, 0.8784313725490196 , 0.54509803921568623),
+ (1.0 , 1.0 , 0.74901960784313726),
+ (0.85098039215686272, 0.93725490196078431 , 0.54509803921568623),
+ (0.65098039215686276, 0.85098039215686272 , 0.41568627450980394),
+ (0.4 , 0.74117647058823533 , 0.38823529411764707),
+ (0.10196078431372549, 0.59607843137254901 , 0.31372549019607843),
+ (0.0 , 0.40784313725490196 , 0.21568627450980393)
+ )
+
+_Reds_data = (
+ (1.0 , 0.96078431372549022 , 0.94117647058823528),
+ (0.99607843137254903, 0.8784313725490196 , 0.82352941176470584),
+ (0.9882352941176471 , 0.73333333333333328 , 0.63137254901960782),
+ (0.9882352941176471 , 0.5725490196078431 , 0.44705882352941179),
+ (0.98431372549019602, 0.41568627450980394 , 0.29019607843137257),
+ (0.93725490196078431, 0.23137254901960785 , 0.17254901960784313),
+ (0.79607843137254897, 0.094117647058823528, 0.11372549019607843),
+ (0.6470588235294118 , 0.058823529411764705, 0.08235294117647058),
+ (0.40392156862745099, 0.0 , 0.05098039215686274)
+ )
+
+_Spectral_data = (
+ (0.61960784313725492, 0.003921568627450980, 0.25882352941176473),
+ (0.83529411764705885, 0.24313725490196078 , 0.30980392156862746),
+ (0.95686274509803926, 0.42745098039215684 , 0.2627450980392157 ),
+ (0.99215686274509807, 0.68235294117647061 , 0.38039215686274508),
+ (0.99607843137254903, 0.8784313725490196 , 0.54509803921568623),
+ (1.0 , 1.0 , 0.74901960784313726),
+ (0.90196078431372551, 0.96078431372549022 , 0.59607843137254901),
+ (0.6705882352941176 , 0.8666666666666667 , 0.64313725490196083),
+ (0.4 , 0.76078431372549016 , 0.6470588235294118 ),
+ (0.19607843137254902, 0.53333333333333333 , 0.74117647058823533),
+ (0.36862745098039218, 0.30980392156862746 , 0.63529411764705879)
+ )
+
+_YlGn_data = (
+ (1.0 , 1.0 , 0.89803921568627454),
+ (0.96862745098039216, 0.9882352941176471 , 0.72549019607843135),
+ (0.85098039215686272, 0.94117647058823528 , 0.63921568627450975),
+ (0.67843137254901964, 0.8666666666666667 , 0.55686274509803924),
+ (0.47058823529411764, 0.77647058823529413 , 0.47450980392156861),
+ (0.25490196078431371, 0.6705882352941176 , 0.36470588235294116),
+ (0.13725490196078433, 0.51764705882352946 , 0.2627450980392157 ),
+ (0.0 , 0.40784313725490196 , 0.21568627450980393),
+ (0.0 , 0.27058823529411763 , 0.16078431372549021)
+ )
+
+_YlGnBu_data = (
+ (1.0 , 1.0 , 0.85098039215686272),
+ (0.92941176470588238, 0.97254901960784312 , 0.69411764705882351),
+ (0.7803921568627451 , 0.9137254901960784 , 0.70588235294117652),
+ (0.49803921568627452, 0.80392156862745101 , 0.73333333333333328),
+ (0.25490196078431371, 0.71372549019607845 , 0.7686274509803922 ),
+ (0.11372549019607843, 0.56862745098039214 , 0.75294117647058822),
+ (0.13333333333333333, 0.36862745098039218 , 0.6588235294117647 ),
+ (0.14509803921568629, 0.20392156862745098 , 0.58039215686274515),
+ (0.03137254901960784, 0.11372549019607843 , 0.34509803921568627)
+ )
+
+_YlOrBr_data = (
+ (1.0 , 1.0 , 0.89803921568627454),
+ (1.0 , 0.96862745098039216 , 0.73725490196078436),
+ (0.99607843137254903, 0.8901960784313725 , 0.56862745098039214),
+ (0.99607843137254903, 0.7686274509803922 , 0.30980392156862746),
+ (0.99607843137254903, 0.6 , 0.16078431372549021),
+ (0.92549019607843142, 0.4392156862745098 , 0.07843137254901961),
+ (0.8 , 0.29803921568627451 , 0.00784313725490196),
+ (0.6 , 0.20392156862745098 , 0.01568627450980392),
+ (0.4 , 0.14509803921568629 , 0.02352941176470588)
+ )
+
+_YlOrRd_data = (
+ (1.0 , 1.0 , 0.8 ),
+ (1.0 , 0.92941176470588238 , 0.62745098039215685),
+ (0.99607843137254903, 0.85098039215686272 , 0.46274509803921571),
+ (0.99607843137254903, 0.69803921568627447 , 0.29803921568627451),
+ (0.99215686274509807, 0.55294117647058827 , 0.23529411764705882),
+ (0.9882352941176471 , 0.30588235294117649 , 0.16470588235294117),
+ (0.8901960784313725 , 0.10196078431372549 , 0.10980392156862745),
+ (0.74117647058823533, 0.0 , 0.14901960784313725),
+ (0.50196078431372548, 0.0 , 0.14901960784313725)
+ )
+
+
+# ColorBrewer's qualitative maps, implemented using ListedColormap
+# for use with mpl.colors.NoNorm
+
+_Accent_data = (
+ (0.49803921568627452, 0.78823529411764703, 0.49803921568627452),
+ (0.74509803921568629, 0.68235294117647061, 0.83137254901960789),
+ (0.99215686274509807, 0.75294117647058822, 0.52549019607843139),
+ (1.0, 1.0, 0.6 ),
+ (0.2196078431372549, 0.42352941176470588, 0.69019607843137254),
+ (0.94117647058823528, 0.00784313725490196, 0.49803921568627452),
+ (0.74901960784313726, 0.35686274509803922, 0.09019607843137254),
+ (0.4, 0.4, 0.4 ),
+ )
+
+_Dark2_data = (
+ (0.10588235294117647, 0.61960784313725492, 0.46666666666666667),
+ (0.85098039215686272, 0.37254901960784315, 0.00784313725490196),
+ (0.45882352941176469, 0.4392156862745098, 0.70196078431372544),
+ (0.90588235294117647, 0.16078431372549021, 0.54117647058823526),
+ (0.4, 0.65098039215686276, 0.11764705882352941),
+ (0.90196078431372551, 0.6705882352941176, 0.00784313725490196),
+ (0.65098039215686276, 0.46274509803921571, 0.11372549019607843),
+ (0.4, 0.4, 0.4 ),
+ )
+
+_Paired_data = (
+ (0.65098039215686276, 0.80784313725490198, 0.8901960784313725 ),
+ (0.12156862745098039, 0.47058823529411764, 0.70588235294117652),
+ (0.69803921568627447, 0.87450980392156863, 0.54117647058823526),
+ (0.2, 0.62745098039215685, 0.17254901960784313),
+ (0.98431372549019602, 0.60392156862745094, 0.6 ),
+ (0.8901960784313725, 0.10196078431372549, 0.10980392156862745),
+ (0.99215686274509807, 0.74901960784313726, 0.43529411764705883),
+ (1.0, 0.49803921568627452, 0.0 ),
+ (0.792156862745098, 0.69803921568627447, 0.83921568627450982),
+ (0.41568627450980394, 0.23921568627450981, 0.60392156862745094),
+ (1.0, 1.0, 0.6 ),
+ (0.69411764705882351, 0.34901960784313724, 0.15686274509803921),
+ )
+
+_Pastel1_data = (
+ (0.98431372549019602, 0.70588235294117652, 0.68235294117647061),
+ (0.70196078431372544, 0.80392156862745101, 0.8901960784313725 ),
+ (0.8, 0.92156862745098034, 0.77254901960784317),
+ (0.87058823529411766, 0.79607843137254897, 0.89411764705882357),
+ (0.99607843137254903, 0.85098039215686272, 0.65098039215686276),
+ (1.0, 1.0, 0.8 ),
+ (0.89803921568627454, 0.84705882352941175, 0.74117647058823533),
+ (0.99215686274509807, 0.85490196078431369, 0.92549019607843142),
+ (0.94901960784313721, 0.94901960784313721, 0.94901960784313721),
+ )
+
+_Pastel2_data = (
+ (0.70196078431372544, 0.88627450980392153, 0.80392156862745101),
+ (0.99215686274509807, 0.80392156862745101, 0.67450980392156867),
+ (0.79607843137254897, 0.83529411764705885, 0.90980392156862744),
+ (0.95686274509803926, 0.792156862745098, 0.89411764705882357),
+ (0.90196078431372551, 0.96078431372549022, 0.78823529411764703),
+ (1.0, 0.94901960784313721, 0.68235294117647061),
+ (0.94509803921568625, 0.88627450980392153, 0.8 ),
+ (0.8, 0.8, 0.8 ),
+ )
+
+_Set1_data = (
+ (0.89411764705882357, 0.10196078431372549, 0.10980392156862745),
+ (0.21568627450980393, 0.49411764705882355, 0.72156862745098038),
+ (0.30196078431372547, 0.68627450980392157, 0.29019607843137257),
+ (0.59607843137254901, 0.30588235294117649, 0.63921568627450975),
+ (1.0, 0.49803921568627452, 0.0 ),
+ (1.0, 1.0, 0.2 ),
+ (0.65098039215686276, 0.33725490196078434, 0.15686274509803921),
+ (0.96862745098039216, 0.50588235294117645, 0.74901960784313726),
+ (0.6, 0.6, 0.6),
+ )
+
+_Set2_data = (
+ (0.4, 0.76078431372549016, 0.6470588235294118 ),
+ (0.9882352941176471, 0.55294117647058827, 0.3843137254901961 ),
+ (0.55294117647058827, 0.62745098039215685, 0.79607843137254897),
+ (0.90588235294117647, 0.54117647058823526, 0.76470588235294112),
+ (0.65098039215686276, 0.84705882352941175, 0.32941176470588235),
+ (1.0, 0.85098039215686272, 0.18431372549019609),
+ (0.89803921568627454, 0.7686274509803922, 0.58039215686274515),
+ (0.70196078431372544, 0.70196078431372544, 0.70196078431372544),
+ )
+
+_Set3_data = (
+ (0.55294117647058827, 0.82745098039215681, 0.7803921568627451 ),
+ (1.0, 1.0, 0.70196078431372544),
+ (0.74509803921568629, 0.72941176470588232, 0.85490196078431369),
+ (0.98431372549019602, 0.50196078431372548, 0.44705882352941179),
+ (0.50196078431372548, 0.69411764705882351, 0.82745098039215681),
+ (0.99215686274509807, 0.70588235294117652, 0.3843137254901961 ),
+ (0.70196078431372544, 0.87058823529411766, 0.41176470588235292),
+ (0.9882352941176471, 0.80392156862745101, 0.89803921568627454),
+ (0.85098039215686272, 0.85098039215686272, 0.85098039215686272),
+ (0.73725490196078436, 0.50196078431372548, 0.74117647058823533),
+ (0.8, 0.92156862745098034, 0.77254901960784317),
+ (1.0, 0.92941176470588238, 0.43529411764705883),
+ )
+
+
+# The next 7 palettes are from the Yorick scientific visualization package,
+# an evolution of the GIST package, both by David H. Munro.
+# They are released under a BSD-like license (see LICENSE_YORICK in
+# the license directory of the matplotlib source distribution).
+#
+# Most palette functions have been reduced to simple function descriptions
+# by Reinier Heeres, since the rgb components were mostly straight lines.
+# gist_earth_data and gist_ncar_data were simplified by a script and some
+# manual effort.
+
+_gist_earth_data = {
+ 'red': (
+ (0.0, 0.0, 0.0000),
+ (0.2824, 0.1882, 0.1882),
+ (0.4588, 0.2714, 0.2714),
+ (0.5490, 0.4719, 0.4719),
+ (0.6980, 0.7176, 0.7176),
+ (0.7882, 0.7553, 0.7553),
+ (1.0000, 0.9922, 0.9922),
+ ),
+ 'green': (
+ (0.0, 0.0, 0.0000),
+ (0.0275, 0.0000, 0.0000),
+ (0.1098, 0.1893, 0.1893),
+ (0.1647, 0.3035, 0.3035),
+ (0.2078, 0.3841, 0.3841),
+ (0.2824, 0.5020, 0.5020),
+ (0.5216, 0.6397, 0.6397),
+ (0.6980, 0.7171, 0.7171),
+ (0.7882, 0.6392, 0.6392),
+ (0.7922, 0.6413, 0.6413),
+ (0.8000, 0.6447, 0.6447),
+ (0.8078, 0.6481, 0.6481),
+ (0.8157, 0.6549, 0.6549),
+ (0.8667, 0.6991, 0.6991),
+ (0.8745, 0.7103, 0.7103),
+ (0.8824, 0.7216, 0.7216),
+ (0.8902, 0.7323, 0.7323),
+ (0.8980, 0.7430, 0.7430),
+ (0.9412, 0.8275, 0.8275),
+ (0.9569, 0.8635, 0.8635),
+ (0.9647, 0.8816, 0.8816),
+ (0.9961, 0.9733, 0.9733),
+ (1.0000, 0.9843, 0.9843),
+ ),
+ 'blue': (
+ (0.0, 0.0, 0.0000),
+ (0.0039, 0.1684, 0.1684),
+ (0.0078, 0.2212, 0.2212),
+ (0.0275, 0.4329, 0.4329),
+ (0.0314, 0.4549, 0.4549),
+ (0.2824, 0.5004, 0.5004),
+ (0.4667, 0.2748, 0.2748),
+ (0.5451, 0.3205, 0.3205),
+ (0.7843, 0.3961, 0.3961),
+ (0.8941, 0.6651, 0.6651),
+ (1.0000, 0.9843, 0.9843),
+ )
+}
+
+_gist_gray_data = {
+ 'red': gfunc[3],
+ 'green': gfunc[3],
+ 'blue': gfunc[3],
+}
+
+def _gist_heat_red(x): return 1.5 * x
+def _gist_heat_green(x): return 2 * x - 1
+def _gist_heat_blue(x): return 4 * x - 3
+_gist_heat_data = {
+ 'red': _gist_heat_red, 'green': _gist_heat_green, 'blue': _gist_heat_blue}
+
+_gist_ncar_data = {
+ 'red': (
+ (0.0, 0.0, 0.0000),
+ (0.3098, 0.0000, 0.0000),
+ (0.3725, 0.3993, 0.3993),
+ (0.4235, 0.5003, 0.5003),
+ (0.5333, 1.0000, 1.0000),
+ (0.7922, 1.0000, 1.0000),
+ (0.8471, 0.6218, 0.6218),
+ (0.8980, 0.9235, 0.9235),
+ (1.0000, 0.9961, 0.9961),
+ ),
+ 'green': (
+ (0.0, 0.0, 0.0000),
+ (0.0510, 0.3722, 0.3722),
+ (0.1059, 0.0000, 0.0000),
+ (0.1569, 0.7202, 0.7202),
+ (0.1608, 0.7537, 0.7537),
+ (0.1647, 0.7752, 0.7752),
+ (0.2157, 1.0000, 1.0000),
+ (0.2588, 0.9804, 0.9804),
+ (0.2706, 0.9804, 0.9804),
+ (0.3176, 1.0000, 1.0000),
+ (0.3686, 0.8081, 0.8081),
+ (0.4275, 1.0000, 1.0000),
+ (0.5216, 1.0000, 1.0000),
+ (0.6314, 0.7292, 0.7292),
+ (0.6863, 0.2796, 0.2796),
+ (0.7451, 0.0000, 0.0000),
+ (0.7922, 0.0000, 0.0000),
+ (0.8431, 0.1753, 0.1753),
+ (0.8980, 0.5000, 0.5000),
+ (1.0000, 0.9725, 0.9725),
+ ),
+ 'blue': (
+ (0.0, 0.5020, 0.5020),
+ (0.0510, 0.0222, 0.0222),
+ (0.1098, 1.0000, 1.0000),
+ (0.2039, 1.0000, 1.0000),
+ (0.2627, 0.6145, 0.6145),
+ (0.3216, 0.0000, 0.0000),
+ (0.4157, 0.0000, 0.0000),
+ (0.4745, 0.2342, 0.2342),
+ (0.5333, 0.0000, 0.0000),
+ (0.5804, 0.0000, 0.0000),
+ (0.6314, 0.0549, 0.0549),
+ (0.6902, 0.0000, 0.0000),
+ (0.7373, 0.0000, 0.0000),
+ (0.7922, 0.9738, 0.9738),
+ (0.8000, 1.0000, 1.0000),
+ (0.8431, 1.0000, 1.0000),
+ (0.8980, 0.9341, 0.9341),
+ (1.0000, 0.9961, 0.9961),
+ )
+}
+
+_gist_rainbow_data = (
+ (0.000, (1.00, 0.00, 0.16)),
+ (0.030, (1.00, 0.00, 0.00)),
+ (0.215, (1.00, 1.00, 0.00)),
+ (0.400, (0.00, 1.00, 0.00)),
+ (0.586, (0.00, 1.00, 1.00)),
+ (0.770, (0.00, 0.00, 1.00)),
+ (0.954, (1.00, 0.00, 1.00)),
+ (1.000, (1.00, 0.00, 0.75))
+)
+
+_gist_stern_data = {
+ 'red': (
+ (0.000, 0.000, 0.000), (0.0547, 1.000, 1.000),
+ (0.250, 0.027, 0.250), # (0.2500, 0.250, 0.250),
+ (1.000, 1.000, 1.000)),
+ 'green': ((0, 0, 0), (1, 1, 1)),
+ 'blue': (
+ (0.000, 0.000, 0.000), (0.500, 1.000, 1.000),
+ (0.735, 0.000, 0.000), (1.000, 1.000, 1.000))
+}
+
+def _gist_yarg(x): return 1 - x
+_gist_yarg_data = {'red': _gist_yarg, 'green': _gist_yarg, 'blue': _gist_yarg}
+
+# This bipolar colormap was generated from CoolWarmFloat33.csv of
+# "Diverging Color Maps for Scientific Visualization" by Kenneth Moreland.
+#
+_coolwarm_data = {
+ 'red': [
+ (0.0, 0.2298057, 0.2298057),
+ (0.03125, 0.26623388, 0.26623388),
+ (0.0625, 0.30386891, 0.30386891),
+ (0.09375, 0.342804478, 0.342804478),
+ (0.125, 0.38301334, 0.38301334),
+ (0.15625, 0.424369608, 0.424369608),
+ (0.1875, 0.46666708, 0.46666708),
+ (0.21875, 0.509635204, 0.509635204),
+ (0.25, 0.552953156, 0.552953156),
+ (0.28125, 0.596262162, 0.596262162),
+ (0.3125, 0.639176211, 0.639176211),
+ (0.34375, 0.681291281, 0.681291281),
+ (0.375, 0.722193294, 0.722193294),
+ (0.40625, 0.761464949, 0.761464949),
+ (0.4375, 0.798691636, 0.798691636),
+ (0.46875, 0.833466556, 0.833466556),
+ (0.5, 0.865395197, 0.865395197),
+ (0.53125, 0.897787179, 0.897787179),
+ (0.5625, 0.924127593, 0.924127593),
+ (0.59375, 0.944468518, 0.944468518),
+ (0.625, 0.958852946, 0.958852946),
+ (0.65625, 0.96732803, 0.96732803),
+ (0.6875, 0.969954137, 0.969954137),
+ (0.71875, 0.966811177, 0.966811177),
+ (0.75, 0.958003065, 0.958003065),
+ (0.78125, 0.943660866, 0.943660866),
+ (0.8125, 0.923944917, 0.923944917),
+ (0.84375, 0.89904617, 0.89904617),
+ (0.875, 0.869186849, 0.869186849),
+ (0.90625, 0.834620542, 0.834620542),
+ (0.9375, 0.795631745, 0.795631745),
+ (0.96875, 0.752534934, 0.752534934),
+ (1.0, 0.705673158, 0.705673158)],
+ 'green': [
+ (0.0, 0.298717966, 0.298717966),
+ (0.03125, 0.353094838, 0.353094838),
+ (0.0625, 0.406535296, 0.406535296),
+ (0.09375, 0.458757618, 0.458757618),
+ (0.125, 0.50941904, 0.50941904),
+ (0.15625, 0.558148092, 0.558148092),
+ (0.1875, 0.604562568, 0.604562568),
+ (0.21875, 0.648280772, 0.648280772),
+ (0.25, 0.688929332, 0.688929332),
+ (0.28125, 0.726149107, 0.726149107),
+ (0.3125, 0.759599947, 0.759599947),
+ (0.34375, 0.788964712, 0.788964712),
+ (0.375, 0.813952739, 0.813952739),
+ (0.40625, 0.834302879, 0.834302879),
+ (0.4375, 0.849786142, 0.849786142),
+ (0.46875, 0.860207984, 0.860207984),
+ (0.5, 0.86541021, 0.86541021),
+ (0.53125, 0.848937047, 0.848937047),
+ (0.5625, 0.827384882, 0.827384882),
+ (0.59375, 0.800927443, 0.800927443),
+ (0.625, 0.769767752, 0.769767752),
+ (0.65625, 0.734132809, 0.734132809),
+ (0.6875, 0.694266682, 0.694266682),
+ (0.71875, 0.650421156, 0.650421156),
+ (0.75, 0.602842431, 0.602842431),
+ (0.78125, 0.551750968, 0.551750968),
+ (0.8125, 0.49730856, 0.49730856),
+ (0.84375, 0.439559467, 0.439559467),
+ (0.875, 0.378313092, 0.378313092),
+ (0.90625, 0.312874446, 0.312874446),
+ (0.9375, 0.24128379, 0.24128379),
+ (0.96875, 0.157246067, 0.157246067),
+ (1.0, 0.01555616, 0.01555616)],
+ 'blue': [
+ (0.0, 0.753683153, 0.753683153),
+ (0.03125, 0.801466763, 0.801466763),
+ (0.0625, 0.84495867, 0.84495867),
+ (0.09375, 0.883725899, 0.883725899),
+ (0.125, 0.917387822, 0.917387822),
+ (0.15625, 0.945619588, 0.945619588),
+ (0.1875, 0.968154911, 0.968154911),
+ (0.21875, 0.98478814, 0.98478814),
+ (0.25, 0.995375608, 0.995375608),
+ (0.28125, 0.999836203, 0.999836203),
+ (0.3125, 0.998151185, 0.998151185),
+ (0.34375, 0.990363227, 0.990363227),
+ (0.375, 0.976574709, 0.976574709),
+ (0.40625, 0.956945269, 0.956945269),
+ (0.4375, 0.931688648, 0.931688648),
+ (0.46875, 0.901068838, 0.901068838),
+ (0.5, 0.865395561, 0.865395561),
+ (0.53125, 0.820880546, 0.820880546),
+ (0.5625, 0.774508472, 0.774508472),
+ (0.59375, 0.726736146, 0.726736146),
+ (0.625, 0.678007945, 0.678007945),
+ (0.65625, 0.628751763, 0.628751763),
+ (0.6875, 0.579375448, 0.579375448),
+ (0.71875, 0.530263762, 0.530263762),
+ (0.75, 0.481775914, 0.481775914),
+ (0.78125, 0.434243684, 0.434243684),
+ (0.8125, 0.387970225, 0.387970225),
+ (0.84375, 0.343229596, 0.343229596),
+ (0.875, 0.300267182, 0.300267182),
+ (0.90625, 0.259301199, 0.259301199),
+ (0.9375, 0.220525627, 0.220525627),
+ (0.96875, 0.184115123, 0.184115123),
+ (1.0, 0.150232812, 0.150232812)]
+ }
+
+# Implementation of Carey Rappaport's CMRmap.
+# See `A Color Map for Effective Black-and-White Rendering of Color-Scale
+# Images' by Carey Rappaport
+# https://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m
+_CMRmap_data = {'red': ((0.000, 0.00, 0.00),
+ (0.125, 0.15, 0.15),
+ (0.250, 0.30, 0.30),
+ (0.375, 0.60, 0.60),
+ (0.500, 1.00, 1.00),
+ (0.625, 0.90, 0.90),
+ (0.750, 0.90, 0.90),
+ (0.875, 0.90, 0.90),
+ (1.000, 1.00, 1.00)),
+ 'green': ((0.000, 0.00, 0.00),
+ (0.125, 0.15, 0.15),
+ (0.250, 0.15, 0.15),
+ (0.375, 0.20, 0.20),
+ (0.500, 0.25, 0.25),
+ (0.625, 0.50, 0.50),
+ (0.750, 0.75, 0.75),
+ (0.875, 0.90, 0.90),
+ (1.000, 1.00, 1.00)),
+ 'blue': ((0.000, 0.00, 0.00),
+ (0.125, 0.50, 0.50),
+ (0.250, 0.75, 0.75),
+ (0.375, 0.50, 0.50),
+ (0.500, 0.15, 0.15),
+ (0.625, 0.00, 0.00),
+ (0.750, 0.10, 0.10),
+ (0.875, 0.50, 0.50),
+ (1.000, 1.00, 1.00))}
+
+
+# An MIT licensed, colorblind-friendly heatmap from Wistia:
+# https://github.com/wistia/heatmap-palette
+# https://wistia.com/learn/culture/heatmaps-for-colorblindness
+#
+# >>> import matplotlib.colors as c
+# >>> colors = ["#e4ff7a", "#ffe81a", "#ffbd00", "#ffa000", "#fc7f00"]
+# >>> cm = c.LinearSegmentedColormap.from_list('wistia', colors)
+# >>> _wistia_data = cm._segmentdata
+# >>> del _wistia_data['alpha']
+#
+_wistia_data = {
+ 'red': [(0.0, 0.8941176470588236, 0.8941176470588236),
+ (0.25, 1.0, 1.0),
+ (0.5, 1.0, 1.0),
+ (0.75, 1.0, 1.0),
+ (1.0, 0.9882352941176471, 0.9882352941176471)],
+ 'green': [(0.0, 1.0, 1.0),
+ (0.25, 0.9098039215686274, 0.9098039215686274),
+ (0.5, 0.7411764705882353, 0.7411764705882353),
+ (0.75, 0.6274509803921569, 0.6274509803921569),
+ (1.0, 0.4980392156862745, 0.4980392156862745)],
+ 'blue': [(0.0, 0.47843137254901963, 0.47843137254901963),
+ (0.25, 0.10196078431372549, 0.10196078431372549),
+ (0.5, 0.0, 0.0),
+ (0.75, 0.0, 0.0),
+ (1.0, 0.0, 0.0)],
+}
+
+
+# Categorical palettes from Vega:
+# https://github.com/vega/vega/wiki/Scales
+# (divided by 255)
+#
+
+_tab10_data = (
+ (0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
+ (1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
+ (0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
+ (0.8392156862745098, 0.15294117647058825, 0.1568627450980392 ), # d62728
+ (0.5803921568627451, 0.403921568627451, 0.7411764705882353 ), # 9467bd
+ (0.5490196078431373, 0.33725490196078434, 0.29411764705882354 ), # 8c564b
+ (0.8901960784313725, 0.4666666666666667, 0.7607843137254902 ), # e377c2
+ (0.4980392156862745, 0.4980392156862745, 0.4980392156862745 ), # 7f7f7f
+ (0.7372549019607844, 0.7411764705882353, 0.13333333333333333 ), # bcbd22
+ (0.09019607843137255, 0.7450980392156863, 0.8117647058823529), # 17becf
+)
+
+_tab20_data = (
+ (0.12156862745098039, 0.4666666666666667, 0.7058823529411765 ), # 1f77b4
+ (0.6823529411764706, 0.7803921568627451, 0.9098039215686274 ), # aec7e8
+ (1.0, 0.4980392156862745, 0.054901960784313725), # ff7f0e
+ (1.0, 0.7333333333333333, 0.47058823529411764 ), # ffbb78
+ (0.17254901960784313, 0.6274509803921569, 0.17254901960784313 ), # 2ca02c
+ (0.596078431372549, 0.8745098039215686, 0.5411764705882353 ), # 98df8a
+ (0.8392156862745098, 0.15294117647058825, 0.1568627450980392 ), # d62728
+ (1.0, 0.596078431372549, 0.5882352941176471 ), # ff9896
+ (0.5803921568627451, 0.403921568627451, 0.7411764705882353 ), # 9467bd
+ (0.7725490196078432, 0.6901960784313725, 0.8352941176470589 ), # c5b0d5
+ (0.5490196078431373, 0.33725490196078434, 0.29411764705882354 ), # 8c564b
+ (0.7686274509803922, 0.611764705882353, 0.5803921568627451 ), # c49c94
+ (0.8901960784313725, 0.4666666666666667, 0.7607843137254902 ), # e377c2
+ (0.9686274509803922, 0.7137254901960784, 0.8235294117647058 ), # f7b6d2
+ (0.4980392156862745, 0.4980392156862745, 0.4980392156862745 ), # 7f7f7f
+ (0.7803921568627451, 0.7803921568627451, 0.7803921568627451 ), # c7c7c7
+ (0.7372549019607844, 0.7411764705882353, 0.13333333333333333 ), # bcbd22
+ (0.8588235294117647, 0.8588235294117647, 0.5529411764705883 ), # dbdb8d
+ (0.09019607843137255, 0.7450980392156863, 0.8117647058823529 ), # 17becf
+ (0.6196078431372549, 0.8549019607843137, 0.8980392156862745), # 9edae5
+)
+
+_tab20b_data = (
+ (0.2235294117647059, 0.23137254901960785, 0.4745098039215686 ), # 393b79
+ (0.3215686274509804, 0.32941176470588235, 0.6392156862745098 ), # 5254a3
+ (0.4196078431372549, 0.43137254901960786, 0.8117647058823529 ), # 6b6ecf
+ (0.611764705882353, 0.6196078431372549, 0.8705882352941177 ), # 9c9ede
+ (0.38823529411764707, 0.4745098039215686, 0.2235294117647059 ), # 637939
+ (0.5490196078431373, 0.6352941176470588, 0.3215686274509804 ), # 8ca252
+ (0.7098039215686275, 0.8117647058823529, 0.4196078431372549 ), # b5cf6b
+ (0.807843137254902, 0.8588235294117647, 0.611764705882353 ), # cedb9c
+ (0.5490196078431373, 0.42745098039215684, 0.19215686274509805), # 8c6d31
+ (0.7411764705882353, 0.6196078431372549, 0.2235294117647059 ), # bd9e39
+ (0.9058823529411765, 0.7294117647058823, 0.3215686274509804 ), # e7ba52
+ (0.9058823529411765, 0.796078431372549, 0.5803921568627451 ), # e7cb94
+ (0.5176470588235295, 0.23529411764705882, 0.2235294117647059 ), # 843c39
+ (0.6784313725490196, 0.28627450980392155, 0.2901960784313726 ), # ad494a
+ (0.8392156862745098, 0.3803921568627451, 0.4196078431372549 ), # d6616b
+ (0.9058823529411765, 0.5882352941176471, 0.611764705882353 ), # e7969c
+ (0.4823529411764706, 0.2549019607843137, 0.45098039215686275), # 7b4173
+ (0.6470588235294118, 0.3176470588235294, 0.5803921568627451 ), # a55194
+ (0.807843137254902, 0.42745098039215684, 0.7411764705882353 ), # ce6dbd
+ (0.8705882352941177, 0.6196078431372549, 0.8392156862745098 ), # de9ed6
+)
+
+_tab20c_data = (
+ (0.19215686274509805, 0.5098039215686274, 0.7411764705882353 ), # 3182bd
+ (0.4196078431372549, 0.6823529411764706, 0.8392156862745098 ), # 6baed6
+ (0.6196078431372549, 0.792156862745098, 0.8823529411764706 ), # 9ecae1
+ (0.7764705882352941, 0.8588235294117647, 0.9372549019607843 ), # c6dbef
+ (0.9019607843137255, 0.3333333333333333, 0.050980392156862744), # e6550d
+ (0.9921568627450981, 0.5529411764705883, 0.23529411764705882 ), # fd8d3c
+ (0.9921568627450981, 0.6823529411764706, 0.4196078431372549 ), # fdae6b
+ (0.9921568627450981, 0.8156862745098039, 0.6352941176470588 ), # fdd0a2
+ (0.19215686274509805, 0.6392156862745098, 0.32941176470588235 ), # 31a354
+ (0.4549019607843137, 0.7686274509803922, 0.4627450980392157 ), # 74c476
+ (0.6313725490196078, 0.8509803921568627, 0.6078431372549019 ), # a1d99b
+ (0.7803921568627451, 0.9137254901960784, 0.7529411764705882 ), # c7e9c0
+ (0.4588235294117647, 0.4196078431372549, 0.6941176470588235 ), # 756bb1
+ (0.6196078431372549, 0.6039215686274509, 0.7843137254901961 ), # 9e9ac8
+ (0.7372549019607844, 0.7411764705882353, 0.8627450980392157 ), # bcbddc
+ (0.8549019607843137, 0.8549019607843137, 0.9215686274509803 ), # dadaeb
+ (0.38823529411764707, 0.38823529411764707, 0.38823529411764707 ), # 636363
+ (0.5882352941176471, 0.5882352941176471, 0.5882352941176471 ), # 969696
+ (0.7411764705882353, 0.7411764705882353, 0.7411764705882353 ), # bdbdbd
+ (0.8509803921568627, 0.8509803921568627, 0.8509803921568627 ), # d9d9d9
+)
+
+
+_petroff10_data = (
+ (0.24705882352941178, 0.5647058823529412, 0.8549019607843137), # 3f90da
+ (1.0, 0.6627450980392157, 0.054901960784313725), # ffa90e
+ (0.7411764705882353, 0.12156862745098039, 0.00392156862745098), # bd1f01
+ (0.5803921568627451, 0.6431372549019608, 0.6352941176470588), # 94a4a2
+ (0.5137254901960784, 0.17647058823529413, 0.7137254901960784), # 832db6
+ (0.6627450980392157, 0.4196078431372549, 0.34901960784313724), # a96b59
+ (0.9058823529411765, 0.38823529411764707, 0.0), # e76300
+ (0.7254901960784313, 0.6745098039215687, 0.4392156862745098), # b9ac70
+ (0.44313725490196076, 0.4588235294117647, 0.5058823529411764), # 717581
+ (0.5725490196078431, 0.8549019607843137, 0.8666666666666667), # 92dadd
+)
+
+
+datad = {
+ 'Blues': _Blues_data,
+ 'BrBG': _BrBG_data,
+ 'BuGn': _BuGn_data,
+ 'BuPu': _BuPu_data,
+ 'CMRmap': _CMRmap_data,
+ 'GnBu': _GnBu_data,
+ 'Greens': _Greens_data,
+ 'Greys': _Greys_data,
+ 'OrRd': _OrRd_data,
+ 'Oranges': _Oranges_data,
+ 'PRGn': _PRGn_data,
+ 'PiYG': _PiYG_data,
+ 'PuBu': _PuBu_data,
+ 'PuBuGn': _PuBuGn_data,
+ 'PuOr': _PuOr_data,
+ 'PuRd': _PuRd_data,
+ 'Purples': _Purples_data,
+ 'RdBu': _RdBu_data,
+ 'RdGy': _RdGy_data,
+ 'RdPu': _RdPu_data,
+ 'RdYlBu': _RdYlBu_data,
+ 'RdYlGn': _RdYlGn_data,
+ 'Reds': _Reds_data,
+ 'Spectral': _Spectral_data,
+ 'Wistia': _wistia_data,
+ 'YlGn': _YlGn_data,
+ 'YlGnBu': _YlGnBu_data,
+ 'YlOrBr': _YlOrBr_data,
+ 'YlOrRd': _YlOrRd_data,
+ 'afmhot': _afmhot_data,
+ 'autumn': _autumn_data,
+ 'binary': _binary_data,
+ 'bone': _bone_data,
+ 'brg': _brg_data,
+ 'bwr': _bwr_data,
+ 'cool': _cool_data,
+ 'coolwarm': _coolwarm_data,
+ 'copper': _copper_data,
+ 'cubehelix': _cubehelix_data,
+ 'flag': _flag_data,
+ 'gist_earth': _gist_earth_data,
+ 'gist_gray': _gist_gray_data,
+ 'gist_heat': _gist_heat_data,
+ 'gist_ncar': _gist_ncar_data,
+ 'gist_rainbow': _gist_rainbow_data,
+ 'gist_stern': _gist_stern_data,
+ 'gist_yarg': _gist_yarg_data,
+ 'gnuplot': _gnuplot_data,
+ 'gnuplot2': _gnuplot2_data,
+ 'gray': _gray_data,
+ 'hot': _hot_data,
+ 'hsv': _hsv_data,
+ 'jet': _jet_data,
+ 'nipy_spectral': _nipy_spectral_data,
+ 'ocean': _ocean_data,
+ 'pink': _pink_data,
+ 'prism': _prism_data,
+ 'rainbow': _rainbow_data,
+ 'seismic': _seismic_data,
+ 'spring': _spring_data,
+ 'summer': _summer_data,
+ 'terrain': _terrain_data,
+ 'winter': _winter_data,
+ # Qualitative
+ 'Accent': {'listed': _Accent_data},
+ 'Dark2': {'listed': _Dark2_data},
+ 'Paired': {'listed': _Paired_data},
+ 'Pastel1': {'listed': _Pastel1_data},
+ 'Pastel2': {'listed': _Pastel2_data},
+ 'Set1': {'listed': _Set1_data},
+ 'Set2': {'listed': _Set2_data},
+ 'Set3': {'listed': _Set3_data},
+ 'tab10': {'listed': _tab10_data},
+ 'tab20': {'listed': _tab20_data},
+ 'tab20b': {'listed': _tab20b_data},
+ 'tab20c': {'listed': _tab20c_data},
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_bivar.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_bivar.py
new file mode 100644
index 0000000000000000000000000000000000000000..53c0d48d7d6c5d3818a33df783a284e11c16662d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_bivar.py
@@ -0,0 +1,1312 @@
+# auto-generated by https://github.com/trygvrad/multivariate_colormaps
+# date: 2024-05-24
+
+import numpy as np
+from matplotlib.colors import SegmentedBivarColormap
+
+BiPeak = np.array(
+ [0.000, 0.674, 0.931, 0.000, 0.680, 0.922, 0.000, 0.685, 0.914, 0.000,
+ 0.691, 0.906, 0.000, 0.696, 0.898, 0.000, 0.701, 0.890, 0.000, 0.706,
+ 0.882, 0.000, 0.711, 0.875, 0.000, 0.715, 0.867, 0.000, 0.720, 0.860,
+ 0.000, 0.725, 0.853, 0.000, 0.729, 0.845, 0.000, 0.733, 0.838, 0.000,
+ 0.737, 0.831, 0.000, 0.741, 0.824, 0.000, 0.745, 0.816, 0.000, 0.749,
+ 0.809, 0.000, 0.752, 0.802, 0.000, 0.756, 0.794, 0.000, 0.759, 0.787,
+ 0.000, 0.762, 0.779, 0.000, 0.765, 0.771, 0.000, 0.767, 0.764, 0.000,
+ 0.770, 0.755, 0.000, 0.772, 0.747, 0.000, 0.774, 0.739, 0.000, 0.776,
+ 0.730, 0.000, 0.777, 0.721, 0.000, 0.779, 0.712, 0.021, 0.780, 0.702,
+ 0.055, 0.781, 0.693, 0.079, 0.782, 0.682, 0.097, 0.782, 0.672, 0.111,
+ 0.782, 0.661, 0.122, 0.782, 0.650, 0.132, 0.782, 0.639, 0.140, 0.781,
+ 0.627, 0.147, 0.781, 0.615, 0.154, 0.780, 0.602, 0.159, 0.778, 0.589,
+ 0.164, 0.777, 0.576, 0.169, 0.775, 0.563, 0.173, 0.773, 0.549, 0.177,
+ 0.771, 0.535, 0.180, 0.768, 0.520, 0.184, 0.766, 0.505, 0.187, 0.763,
+ 0.490, 0.190, 0.760, 0.474, 0.193, 0.756, 0.458, 0.196, 0.753, 0.442,
+ 0.200, 0.749, 0.425, 0.203, 0.745, 0.408, 0.206, 0.741, 0.391, 0.210,
+ 0.736, 0.373, 0.213, 0.732, 0.355, 0.216, 0.727, 0.337, 0.220, 0.722,
+ 0.318, 0.224, 0.717, 0.298, 0.227, 0.712, 0.278, 0.231, 0.707, 0.258,
+ 0.235, 0.701, 0.236, 0.239, 0.696, 0.214, 0.242, 0.690, 0.190, 0.246,
+ 0.684, 0.165, 0.250, 0.678, 0.136, 0.000, 0.675, 0.934, 0.000, 0.681,
+ 0.925, 0.000, 0.687, 0.917, 0.000, 0.692, 0.909, 0.000, 0.697, 0.901,
+ 0.000, 0.703, 0.894, 0.000, 0.708, 0.886, 0.000, 0.713, 0.879, 0.000,
+ 0.718, 0.872, 0.000, 0.722, 0.864, 0.000, 0.727, 0.857, 0.000, 0.731,
+ 0.850, 0.000, 0.736, 0.843, 0.000, 0.740, 0.836, 0.000, 0.744, 0.829,
+ 0.000, 0.748, 0.822, 0.000, 0.752, 0.815, 0.000, 0.755, 0.808, 0.000,
+ 0.759, 0.800, 0.000, 0.762, 0.793, 0.000, 0.765, 0.786, 0.000, 0.768,
+ 0.778, 0.000, 0.771, 0.770, 0.000, 0.773, 0.762, 0.051, 0.776, 0.754,
+ 0.087, 0.778, 0.746, 0.111, 0.780, 0.737, 0.131, 0.782, 0.728, 0.146,
+ 0.783, 0.719, 0.159, 0.784, 0.710, 0.171, 0.785, 0.700, 0.180, 0.786,
+ 0.690, 0.189, 0.786, 0.680, 0.196, 0.787, 0.669, 0.202, 0.787, 0.658,
+ 0.208, 0.786, 0.647, 0.213, 0.786, 0.635, 0.217, 0.785, 0.623, 0.221,
+ 0.784, 0.610, 0.224, 0.782, 0.597, 0.227, 0.781, 0.584, 0.230, 0.779,
+ 0.570, 0.232, 0.777, 0.556, 0.234, 0.775, 0.542, 0.236, 0.772, 0.527,
+ 0.238, 0.769, 0.512, 0.240, 0.766, 0.497, 0.242, 0.763, 0.481, 0.244,
+ 0.760, 0.465, 0.246, 0.756, 0.448, 0.248, 0.752, 0.432, 0.250, 0.748,
+ 0.415, 0.252, 0.744, 0.397, 0.254, 0.739, 0.379, 0.256, 0.735, 0.361,
+ 0.259, 0.730, 0.343, 0.261, 0.725, 0.324, 0.264, 0.720, 0.304, 0.266,
+ 0.715, 0.284, 0.269, 0.709, 0.263, 0.271, 0.704, 0.242, 0.274, 0.698,
+ 0.220, 0.277, 0.692, 0.196, 0.280, 0.686, 0.170, 0.283, 0.680, 0.143,
+ 0.000, 0.676, 0.937, 0.000, 0.682, 0.928, 0.000, 0.688, 0.920, 0.000,
+ 0.694, 0.913, 0.000, 0.699, 0.905, 0.000, 0.704, 0.897, 0.000, 0.710,
+ 0.890, 0.000, 0.715, 0.883, 0.000, 0.720, 0.876, 0.000, 0.724, 0.869,
+ 0.000, 0.729, 0.862, 0.000, 0.734, 0.855, 0.000, 0.738, 0.848, 0.000,
+ 0.743, 0.841, 0.000, 0.747, 0.834, 0.000, 0.751, 0.827, 0.000, 0.755,
+ 0.820, 0.000, 0.759, 0.813, 0.000, 0.762, 0.806, 0.003, 0.766, 0.799,
+ 0.066, 0.769, 0.792, 0.104, 0.772, 0.784, 0.131, 0.775, 0.777, 0.152,
+ 0.777, 0.769, 0.170, 0.780, 0.761, 0.185, 0.782, 0.753, 0.198, 0.784,
+ 0.744, 0.209, 0.786, 0.736, 0.219, 0.787, 0.727, 0.228, 0.788, 0.717,
+ 0.236, 0.789, 0.708, 0.243, 0.790, 0.698, 0.249, 0.791, 0.688, 0.254,
+ 0.791, 0.677, 0.259, 0.791, 0.666, 0.263, 0.791, 0.654, 0.266, 0.790,
+ 0.643, 0.269, 0.789, 0.631, 0.272, 0.788, 0.618, 0.274, 0.787, 0.605,
+ 0.276, 0.785, 0.592, 0.278, 0.783, 0.578, 0.279, 0.781, 0.564, 0.280,
+ 0.779, 0.549, 0.282, 0.776, 0.535, 0.283, 0.773, 0.519, 0.284, 0.770,
+ 0.504, 0.285, 0.767, 0.488, 0.286, 0.763, 0.472, 0.287, 0.759, 0.455,
+ 0.288, 0.756, 0.438, 0.289, 0.751, 0.421, 0.291, 0.747, 0.403, 0.292,
+ 0.742, 0.385, 0.293, 0.738, 0.367, 0.295, 0.733, 0.348, 0.296, 0.728,
+ 0.329, 0.298, 0.723, 0.310, 0.300, 0.717, 0.290, 0.302, 0.712, 0.269,
+ 0.304, 0.706, 0.247, 0.306, 0.700, 0.225, 0.308, 0.694, 0.201, 0.310,
+ 0.688, 0.176, 0.312, 0.682, 0.149, 0.000, 0.678, 0.939, 0.000, 0.683,
+ 0.931, 0.000, 0.689, 0.923, 0.000, 0.695, 0.916, 0.000, 0.701, 0.908,
+ 0.000, 0.706, 0.901, 0.000, 0.711, 0.894, 0.000, 0.717, 0.887, 0.000,
+ 0.722, 0.880, 0.000, 0.727, 0.873, 0.000, 0.732, 0.866, 0.000, 0.736,
+ 0.859, 0.000, 0.741, 0.853, 0.000, 0.745, 0.846, 0.000, 0.750, 0.839,
+ 0.000, 0.754, 0.833, 0.035, 0.758, 0.826, 0.091, 0.762, 0.819, 0.126,
+ 0.765, 0.812, 0.153, 0.769, 0.805, 0.174, 0.772, 0.798, 0.193, 0.775,
+ 0.791, 0.209, 0.778, 0.783, 0.223, 0.781, 0.776, 0.236, 0.784, 0.768,
+ 0.247, 0.786, 0.760, 0.257, 0.788, 0.752, 0.266, 0.790, 0.743, 0.273,
+ 0.791, 0.734, 0.280, 0.793, 0.725, 0.287, 0.794, 0.715, 0.292, 0.794,
+ 0.706, 0.297, 0.795, 0.695, 0.301, 0.795, 0.685, 0.305, 0.795, 0.674,
+ 0.308, 0.795, 0.662, 0.310, 0.794, 0.651, 0.312, 0.794, 0.638, 0.314,
+ 0.792, 0.626, 0.316, 0.791, 0.613, 0.317, 0.789, 0.599, 0.318, 0.787,
+ 0.586, 0.319, 0.785, 0.571, 0.320, 0.783, 0.557, 0.320, 0.780, 0.542,
+ 0.321, 0.777, 0.527, 0.321, 0.774, 0.511, 0.322, 0.770, 0.495, 0.322,
+ 0.767, 0.478, 0.323, 0.763, 0.462, 0.323, 0.759, 0.445, 0.324, 0.755,
+ 0.427, 0.325, 0.750, 0.410, 0.325, 0.745, 0.391, 0.326, 0.741, 0.373,
+ 0.327, 0.736, 0.354, 0.328, 0.730, 0.335, 0.329, 0.725, 0.315, 0.330,
+ 0.720, 0.295, 0.331, 0.714, 0.274, 0.333, 0.708, 0.253, 0.334, 0.702,
+ 0.230, 0.336, 0.696, 0.207, 0.337, 0.690, 0.182, 0.339, 0.684, 0.154,
+ 0.000, 0.679, 0.942, 0.000, 0.685, 0.934, 0.000, 0.691, 0.927, 0.000,
+ 0.696, 0.919, 0.000, 0.702, 0.912, 0.000, 0.708, 0.905, 0.000, 0.713,
+ 0.898, 0.000, 0.718, 0.891, 0.000, 0.724, 0.884, 0.000, 0.729, 0.877,
+ 0.000, 0.734, 0.871, 0.000, 0.739, 0.864, 0.000, 0.743, 0.857, 0.035,
+ 0.748, 0.851, 0.096, 0.752, 0.844, 0.133, 0.757, 0.838, 0.161, 0.761,
+ 0.831, 0.185, 0.765, 0.825, 0.205, 0.769, 0.818, 0.223, 0.772, 0.811,
+ 0.238, 0.776, 0.804, 0.252, 0.779, 0.797, 0.265, 0.782, 0.790, 0.276,
+ 0.785, 0.783, 0.286, 0.788, 0.775, 0.296, 0.790, 0.767, 0.304, 0.792,
+ 0.759, 0.311, 0.794, 0.751, 0.318, 0.796, 0.742, 0.324, 0.797, 0.733,
+ 0.329, 0.798, 0.723, 0.334, 0.799, 0.714, 0.338, 0.799, 0.703, 0.341,
+ 0.800, 0.693, 0.344, 0.800, 0.682, 0.347, 0.799, 0.670, 0.349, 0.799,
+ 0.659, 0.351, 0.798, 0.646, 0.352, 0.797, 0.634, 0.353, 0.795, 0.621,
+ 0.354, 0.794, 0.607, 0.354, 0.792, 0.593, 0.355, 0.789, 0.579, 0.355,
+ 0.787, 0.564, 0.355, 0.784, 0.549, 0.355, 0.781, 0.534, 0.355, 0.778,
+ 0.518, 0.355, 0.774, 0.502, 0.355, 0.770, 0.485, 0.355, 0.766, 0.468,
+ 0.355, 0.762, 0.451, 0.355, 0.758, 0.434, 0.355, 0.753, 0.416, 0.356,
+ 0.748, 0.397, 0.356, 0.743, 0.379, 0.356, 0.738, 0.360, 0.357, 0.733,
+ 0.340, 0.357, 0.728, 0.321, 0.358, 0.722, 0.300, 0.359, 0.716, 0.279,
+ 0.360, 0.710, 0.258, 0.361, 0.704, 0.235, 0.361, 0.698, 0.212, 0.362,
+ 0.692, 0.187, 0.363, 0.686, 0.160, 0.000, 0.680, 0.945, 0.000, 0.686,
+ 0.937, 0.000, 0.692, 0.930, 0.000, 0.698, 0.922, 0.000, 0.703, 0.915,
+ 0.000, 0.709, 0.908, 0.000, 0.715, 0.901, 0.000, 0.720, 0.894, 0.000,
+ 0.726, 0.888, 0.000, 0.731, 0.881, 0.007, 0.736, 0.875, 0.084, 0.741,
+ 0.869, 0.127, 0.746, 0.862, 0.159, 0.751, 0.856, 0.185, 0.755, 0.850,
+ 0.208, 0.760, 0.843, 0.227, 0.764, 0.837, 0.245, 0.768, 0.830, 0.260,
+ 0.772, 0.824, 0.275, 0.776, 0.817, 0.288, 0.779, 0.811, 0.300, 0.783,
+ 0.804, 0.310, 0.786, 0.797, 0.320, 0.789, 0.789, 0.329, 0.792, 0.782,
+ 0.337, 0.794, 0.774, 0.345, 0.796, 0.766, 0.351, 0.798, 0.758, 0.357,
+ 0.800, 0.749, 0.363, 0.801, 0.740, 0.367, 0.803, 0.731, 0.371, 0.803,
+ 0.721, 0.375, 0.804, 0.711, 0.378, 0.804, 0.701, 0.380, 0.804, 0.690,
+ 0.382, 0.804, 0.679, 0.384, 0.803, 0.667, 0.385, 0.802, 0.654, 0.386,
+ 0.801, 0.642, 0.386, 0.800, 0.629, 0.387, 0.798, 0.615, 0.387, 0.796,
+ 0.601, 0.387, 0.793, 0.587, 0.387, 0.791, 0.572, 0.387, 0.788, 0.557,
+ 0.386, 0.785, 0.541, 0.386, 0.781, 0.525, 0.385, 0.778, 0.509, 0.385,
+ 0.774, 0.492, 0.385, 0.770, 0.475, 0.384, 0.765, 0.457, 0.384, 0.761,
+ 0.440, 0.384, 0.756, 0.422, 0.384, 0.751, 0.403, 0.384, 0.746, 0.384,
+ 0.384, 0.741, 0.365, 0.384, 0.735, 0.346, 0.384, 0.730, 0.326, 0.384,
+ 0.724, 0.305, 0.384, 0.718, 0.284, 0.385, 0.712, 0.263, 0.385, 0.706,
+ 0.240, 0.386, 0.700, 0.217, 0.386, 0.694, 0.192, 0.387, 0.687, 0.165,
+ 0.000, 0.680, 0.948, 0.000, 0.687, 0.940, 0.000, 0.693, 0.933, 0.000,
+ 0.699, 0.925, 0.000, 0.705, 0.918, 0.000, 0.711, 0.912, 0.000, 0.716,
+ 0.905, 0.000, 0.722, 0.898, 0.050, 0.728, 0.892, 0.109, 0.733, 0.886,
+ 0.147, 0.738, 0.879, 0.177, 0.743, 0.873, 0.202, 0.748, 0.867, 0.224,
+ 0.753, 0.861, 0.243, 0.758, 0.855, 0.261, 0.763, 0.849, 0.277, 0.767,
+ 0.842, 0.292, 0.771, 0.836, 0.305, 0.775, 0.830, 0.318, 0.779, 0.823,
+ 0.329, 0.783, 0.817, 0.340, 0.787, 0.810, 0.350, 0.790, 0.803, 0.359,
+ 0.793, 0.796, 0.367, 0.796, 0.789, 0.374, 0.798, 0.782, 0.381, 0.801,
+ 0.774, 0.387, 0.803, 0.766, 0.393, 0.804, 0.757, 0.397, 0.806, 0.748,
+ 0.402, 0.807, 0.739, 0.405, 0.808, 0.729, 0.408, 0.809, 0.719, 0.411,
+ 0.809, 0.709, 0.413, 0.809, 0.698, 0.415, 0.808, 0.687, 0.416, 0.808,
+ 0.675, 0.417, 0.807, 0.663, 0.417, 0.806, 0.650, 0.417, 0.804, 0.637,
+ 0.418, 0.802, 0.623, 0.417, 0.800, 0.609, 0.417, 0.798, 0.594, 0.416,
+ 0.795, 0.579, 0.416, 0.792, 0.564, 0.415, 0.789, 0.548, 0.414, 0.785,
+ 0.532, 0.414, 0.781, 0.515, 0.413, 0.777, 0.499, 0.412, 0.773, 0.481,
+ 0.412, 0.769, 0.464, 0.411, 0.764, 0.446, 0.410, 0.759, 0.428, 0.410,
+ 0.754, 0.409, 0.409, 0.749, 0.390, 0.409, 0.743, 0.371, 0.409, 0.738,
+ 0.351, 0.409, 0.732, 0.331, 0.408, 0.726, 0.310, 0.408, 0.720, 0.289,
+ 0.408, 0.714, 0.268, 0.408, 0.708, 0.245, 0.409, 0.702, 0.222, 0.409,
+ 0.695, 0.197, 0.409, 0.689, 0.170, 0.000, 0.681, 0.950, 0.000, 0.688,
+ 0.943, 0.000, 0.694, 0.936, 0.000, 0.700, 0.929, 0.000, 0.706, 0.922,
+ 0.000, 0.712, 0.915, 0.074, 0.718, 0.908, 0.124, 0.724, 0.902, 0.159,
+ 0.730, 0.896, 0.188, 0.735, 0.890, 0.213, 0.740, 0.884, 0.235, 0.746,
+ 0.878, 0.255, 0.751, 0.872, 0.273, 0.756, 0.866, 0.289, 0.761, 0.860,
+ 0.305, 0.766, 0.854, 0.319, 0.770, 0.848, 0.332, 0.775, 0.842, 0.344,
+ 0.779, 0.836, 0.356, 0.783, 0.830, 0.366, 0.787, 0.823, 0.376, 0.790,
+ 0.817, 0.385, 0.794, 0.810, 0.394, 0.797, 0.803, 0.401, 0.800, 0.796,
+ 0.408, 0.802, 0.789, 0.414, 0.805, 0.781, 0.420, 0.807, 0.773, 0.425,
+ 0.809, 0.765, 0.430, 0.810, 0.756, 0.433, 0.812, 0.747, 0.437, 0.813,
+ 0.738, 0.440, 0.813, 0.728, 0.442, 0.814, 0.717, 0.444, 0.813, 0.706,
+ 0.445, 0.813, 0.695, 0.446, 0.812, 0.683, 0.446, 0.811, 0.671, 0.447,
+ 0.810, 0.658, 0.447, 0.809, 0.645, 0.446, 0.807, 0.631, 0.446, 0.804,
+ 0.617, 0.445, 0.802, 0.602, 0.444, 0.799, 0.587, 0.443, 0.796, 0.571,
+ 0.442, 0.792, 0.555, 0.441, 0.789, 0.539, 0.440, 0.785, 0.522, 0.439,
+ 0.781, 0.505, 0.438, 0.776, 0.488, 0.437, 0.772, 0.470, 0.436, 0.767,
+ 0.452, 0.435, 0.762, 0.433, 0.435, 0.757, 0.415, 0.434, 0.751, 0.396,
+ 0.433, 0.746, 0.376, 0.432, 0.740, 0.356, 0.432, 0.734, 0.336, 0.431,
+ 0.728, 0.315, 0.431, 0.722, 0.294, 0.431, 0.716, 0.272, 0.430, 0.710,
+ 0.250, 0.430, 0.703, 0.226, 0.430, 0.697, 0.201, 0.430, 0.690, 0.175,
+ 0.000, 0.682, 0.953, 0.000, 0.689, 0.946, 0.000, 0.695, 0.938, 0.002,
+ 0.701, 0.932, 0.086, 0.708, 0.925, 0.133, 0.714, 0.918, 0.167, 0.720,
+ 0.912, 0.196, 0.726, 0.906, 0.221, 0.731, 0.900, 0.243, 0.737, 0.894,
+ 0.263, 0.743, 0.888, 0.281, 0.748, 0.882, 0.298, 0.753, 0.876, 0.314,
+ 0.759, 0.870, 0.329, 0.764, 0.865, 0.342, 0.768, 0.859, 0.355, 0.773,
+ 0.853, 0.368, 0.778, 0.847, 0.379, 0.782, 0.842, 0.390, 0.786, 0.836,
+ 0.400, 0.790, 0.830, 0.409, 0.794, 0.823, 0.417, 0.798, 0.817, 0.425,
+ 0.801, 0.810, 0.433, 0.804, 0.803, 0.439, 0.807, 0.796, 0.445, 0.809,
+ 0.789, 0.451, 0.811, 0.781, 0.456, 0.813, 0.773, 0.460, 0.815, 0.764,
+ 0.463, 0.816, 0.755, 0.466, 0.817, 0.746, 0.469, 0.818, 0.736, 0.471,
+ 0.818, 0.725, 0.472, 0.818, 0.715, 0.473, 0.818, 0.703, 0.474, 0.817,
+ 0.691, 0.474, 0.816, 0.679, 0.474, 0.815, 0.666, 0.474, 0.813, 0.653,
+ 0.473, 0.811, 0.639, 0.473, 0.809, 0.624, 0.472, 0.806, 0.610, 0.471,
+ 0.803, 0.594, 0.469, 0.800, 0.579, 0.468, 0.796, 0.562, 0.467, 0.792,
+ 0.546, 0.466, 0.788, 0.529, 0.464, 0.784, 0.512, 0.463, 0.780, 0.494,
+ 0.462, 0.775, 0.476, 0.460, 0.770, 0.458, 0.459, 0.765, 0.439, 0.458,
+ 0.759, 0.420, 0.457, 0.754, 0.401, 0.456, 0.748, 0.381, 0.455, 0.742,
+ 0.361, 0.454, 0.736, 0.341, 0.453, 0.730, 0.320, 0.453, 0.724, 0.299,
+ 0.452, 0.718, 0.277, 0.452, 0.711, 0.254, 0.451, 0.705, 0.231, 0.451,
+ 0.698, 0.206, 0.450, 0.691, 0.179, 0.000, 0.683, 0.955, 0.013, 0.689,
+ 0.948, 0.092, 0.696, 0.941, 0.137, 0.702, 0.935, 0.171, 0.709, 0.928,
+ 0.200, 0.715, 0.922, 0.225, 0.721, 0.916, 0.247, 0.727, 0.909, 0.267,
+ 0.733, 0.904, 0.286, 0.739, 0.898, 0.303, 0.745, 0.892, 0.320, 0.750,
+ 0.886, 0.335, 0.756, 0.881, 0.350, 0.761, 0.875, 0.363, 0.766, 0.870,
+ 0.376, 0.771, 0.864, 0.388, 0.776, 0.859, 0.400, 0.781, 0.853, 0.411,
+ 0.785, 0.847, 0.421, 0.790, 0.842, 0.430, 0.794, 0.836, 0.439, 0.798,
+ 0.830, 0.448, 0.802, 0.824, 0.455, 0.805, 0.817, 0.462, 0.808, 0.810,
+ 0.469, 0.811, 0.804, 0.475, 0.814, 0.796, 0.480, 0.816, 0.789, 0.484,
+ 0.818, 0.781, 0.488, 0.820, 0.772, 0.492, 0.821, 0.763, 0.495, 0.822,
+ 0.754, 0.497, 0.823, 0.744, 0.499, 0.823, 0.734, 0.500, 0.823, 0.723,
+ 0.501, 0.823, 0.712, 0.501, 0.822, 0.700, 0.501, 0.821, 0.687, 0.501,
+ 0.819, 0.674, 0.500, 0.818, 0.661, 0.499, 0.815, 0.647, 0.498, 0.813,
+ 0.632, 0.497, 0.810, 0.617, 0.496, 0.807, 0.602, 0.494, 0.804, 0.586,
+ 0.493, 0.800, 0.569, 0.491, 0.796, 0.553, 0.490, 0.792, 0.536, 0.488,
+ 0.787, 0.518, 0.486, 0.783, 0.500, 0.485, 0.778, 0.482, 0.483, 0.773,
+ 0.463, 0.482, 0.767, 0.445, 0.480, 0.762, 0.425, 0.479, 0.756, 0.406,
+ 0.478, 0.750, 0.386, 0.477, 0.744, 0.366, 0.476, 0.738, 0.345, 0.475,
+ 0.732, 0.325, 0.474, 0.726, 0.303, 0.473, 0.719, 0.281, 0.472, 0.713,
+ 0.258, 0.471, 0.706, 0.235, 0.470, 0.699, 0.210, 0.469, 0.692, 0.184,
+ 0.095, 0.683, 0.958, 0.139, 0.690, 0.951, 0.173, 0.697, 0.944, 0.201,
+ 0.703, 0.938, 0.226, 0.710, 0.931, 0.249, 0.716, 0.925, 0.269, 0.723,
+ 0.919, 0.288, 0.729, 0.913, 0.306, 0.735, 0.907, 0.323, 0.741, 0.902,
+ 0.339, 0.747, 0.896, 0.354, 0.752, 0.891, 0.368, 0.758, 0.885, 0.382,
+ 0.764, 0.880, 0.394, 0.769, 0.875, 0.407, 0.774, 0.869, 0.418, 0.779,
+ 0.864, 0.429, 0.784, 0.859, 0.440, 0.789, 0.853, 0.450, 0.793, 0.848,
+ 0.459, 0.798, 0.842, 0.468, 0.802, 0.836, 0.476, 0.806, 0.830, 0.483,
+ 0.809, 0.824, 0.490, 0.812, 0.818, 0.496, 0.815, 0.811, 0.502, 0.818,
+ 0.804, 0.507, 0.821, 0.796, 0.512, 0.823, 0.789, 0.515, 0.825, 0.780,
+ 0.519, 0.826, 0.772, 0.521, 0.827, 0.762, 0.524, 0.828, 0.753, 0.525,
+ 0.828, 0.742, 0.526, 0.828, 0.732, 0.527, 0.828, 0.720, 0.527, 0.827,
+ 0.708, 0.527, 0.826, 0.696, 0.526, 0.824, 0.683, 0.525, 0.822, 0.669,
+ 0.524, 0.820, 0.655, 0.523, 0.817, 0.640, 0.522, 0.814, 0.625, 0.520,
+ 0.811, 0.609, 0.518, 0.808, 0.593, 0.516, 0.804, 0.576, 0.515, 0.800,
+ 0.559, 0.513, 0.795, 0.542, 0.511, 0.791, 0.524, 0.509, 0.786, 0.506,
+ 0.507, 0.781, 0.488, 0.505, 0.775, 0.469, 0.504, 0.770, 0.450, 0.502,
+ 0.764, 0.431, 0.500, 0.759, 0.411, 0.499, 0.753, 0.391, 0.497, 0.746,
+ 0.371, 0.496, 0.740, 0.350, 0.495, 0.734, 0.329, 0.494, 0.727, 0.307,
+ 0.492, 0.721, 0.285, 0.491, 0.714, 0.262, 0.490, 0.707, 0.239, 0.489,
+ 0.700, 0.214, 0.488, 0.693, 0.188, 0.172, 0.684, 0.961, 0.201, 0.691,
+ 0.954, 0.226, 0.698, 0.947, 0.248, 0.704, 0.941, 0.269, 0.711, 0.934,
+ 0.289, 0.717, 0.928, 0.307, 0.724, 0.922, 0.324, 0.730, 0.917, 0.340,
+ 0.736, 0.911, 0.356, 0.743, 0.906, 0.370, 0.749, 0.900, 0.384, 0.755,
+ 0.895, 0.398, 0.760, 0.890, 0.411, 0.766, 0.885, 0.423, 0.772, 0.880,
+ 0.435, 0.777, 0.874, 0.446, 0.782, 0.869, 0.457, 0.787, 0.864, 0.467,
+ 0.792, 0.859, 0.477, 0.797, 0.854, 0.486, 0.801, 0.848, 0.494, 0.806,
+ 0.843, 0.502, 0.810, 0.837, 0.510, 0.813, 0.831, 0.517, 0.817, 0.825,
+ 0.523, 0.820, 0.818, 0.528, 0.823, 0.811, 0.533, 0.825, 0.804, 0.538,
+ 0.828, 0.797, 0.542, 0.829, 0.788, 0.545, 0.831, 0.780, 0.547, 0.832,
+ 0.771, 0.549, 0.833, 0.761, 0.551, 0.833, 0.751, 0.552, 0.833, 0.740,
+ 0.552, 0.833, 0.729, 0.552, 0.832, 0.717, 0.551, 0.830, 0.704, 0.551,
+ 0.829, 0.691, 0.550, 0.827, 0.677, 0.548, 0.824, 0.663, 0.547, 0.822,
+ 0.648, 0.545, 0.819, 0.632, 0.543, 0.815, 0.617, 0.541, 0.812, 0.600,
+ 0.539, 0.808, 0.583, 0.537, 0.803, 0.566, 0.535, 0.799, 0.549, 0.533,
+ 0.794, 0.531, 0.531, 0.789, 0.512, 0.529, 0.784, 0.494, 0.527, 0.778,
+ 0.475, 0.525, 0.773, 0.455, 0.523, 0.767, 0.436, 0.521, 0.761, 0.416,
+ 0.519, 0.755, 0.396, 0.517, 0.748, 0.375, 0.516, 0.742, 0.354, 0.514,
+ 0.735, 0.333, 0.513, 0.729, 0.311, 0.511, 0.722, 0.289, 0.510, 0.715,
+ 0.266, 0.509, 0.708, 0.242, 0.507, 0.701, 0.218, 0.506, 0.694, 0.191,
+ 0.224, 0.684, 0.963, 0.247, 0.691, 0.956, 0.268, 0.698, 0.950, 0.287,
+ 0.705, 0.943, 0.305, 0.712, 0.937, 0.323, 0.719, 0.931, 0.339, 0.725,
+ 0.926, 0.355, 0.732, 0.920, 0.370, 0.738, 0.915, 0.385, 0.744, 0.909,
+ 0.399, 0.751, 0.904, 0.412, 0.757, 0.899, 0.425, 0.763, 0.894, 0.438,
+ 0.768, 0.889, 0.450, 0.774, 0.884, 0.461, 0.780, 0.879, 0.472, 0.785,
+ 0.875, 0.483, 0.790, 0.870, 0.493, 0.795, 0.865, 0.502, 0.800, 0.860,
+ 0.511, 0.805, 0.855, 0.520, 0.809, 0.849, 0.528, 0.814, 0.844, 0.535,
+ 0.818, 0.838, 0.542, 0.821, 0.832, 0.548, 0.824, 0.826, 0.554, 0.827,
+ 0.819, 0.559, 0.830, 0.812, 0.563, 0.832, 0.805, 0.567, 0.834, 0.797,
+ 0.570, 0.836, 0.788, 0.572, 0.837, 0.779, 0.574, 0.838, 0.770, 0.575,
+ 0.838, 0.760, 0.576, 0.838, 0.749, 0.576, 0.838, 0.737, 0.576, 0.837,
+ 0.725, 0.575, 0.835, 0.713, 0.574, 0.834, 0.699, 0.573, 0.831, 0.685,
+ 0.571, 0.829, 0.671, 0.570, 0.826, 0.656, 0.568, 0.823, 0.640, 0.566,
+ 0.819, 0.624, 0.563, 0.815, 0.607, 0.561, 0.811, 0.590, 0.559, 0.807,
+ 0.573, 0.556, 0.802, 0.555, 0.554, 0.797, 0.537, 0.552, 0.792, 0.518,
+ 0.549, 0.786, 0.499, 0.547, 0.781, 0.480, 0.545, 0.775, 0.460, 0.543,
+ 0.769, 0.441, 0.541, 0.763, 0.420, 0.539, 0.756, 0.400, 0.537, 0.750,
+ 0.379, 0.535, 0.743, 0.358, 0.533, 0.737, 0.337, 0.531, 0.730, 0.315,
+ 0.530, 0.723, 0.293, 0.528, 0.716, 0.270, 0.527, 0.709, 0.246, 0.525,
+ 0.702, 0.221, 0.524, 0.694, 0.195, 0.265, 0.685, 0.965, 0.284, 0.692,
+ 0.959, 0.303, 0.699, 0.952, 0.320, 0.706, 0.946, 0.337, 0.713, 0.940,
+ 0.353, 0.720, 0.935, 0.369, 0.726, 0.929, 0.384, 0.733, 0.924, 0.398,
+ 0.739, 0.918, 0.412, 0.746, 0.913, 0.425, 0.752, 0.908, 0.438, 0.759,
+ 0.903, 0.451, 0.765, 0.899, 0.463, 0.771, 0.894, 0.475, 0.777, 0.889,
+ 0.486, 0.782, 0.884, 0.497, 0.788, 0.880, 0.507, 0.793, 0.875, 0.517,
+ 0.799, 0.870, 0.527, 0.804, 0.866, 0.536, 0.809, 0.861, 0.544, 0.813,
+ 0.856, 0.552, 0.818, 0.850, 0.560, 0.822, 0.845, 0.566, 0.826, 0.839,
+ 0.573, 0.829, 0.833, 0.578, 0.832, 0.827, 0.583, 0.835, 0.820, 0.587,
+ 0.837, 0.813, 0.591, 0.839, 0.805, 0.594, 0.841, 0.797, 0.596, 0.842,
+ 0.788, 0.598, 0.843, 0.778, 0.599, 0.843, 0.768, 0.600, 0.843, 0.758,
+ 0.600, 0.843, 0.746, 0.599, 0.842, 0.734, 0.599, 0.840, 0.721, 0.597,
+ 0.838, 0.708, 0.596, 0.836, 0.694, 0.594, 0.834, 0.679, 0.592, 0.831,
+ 0.663, 0.590, 0.827, 0.648, 0.587, 0.823, 0.631, 0.585, 0.819, 0.614,
+ 0.582, 0.815, 0.597, 0.580, 0.810, 0.579, 0.577, 0.805, 0.561, 0.575,
+ 0.800, 0.542, 0.572, 0.795, 0.524, 0.569, 0.789, 0.504, 0.567, 0.783,
+ 0.485, 0.565, 0.777, 0.465, 0.562, 0.771, 0.445, 0.560, 0.765, 0.425,
+ 0.558, 0.758, 0.404, 0.556, 0.752, 0.383, 0.554, 0.745, 0.362, 0.552,
+ 0.738, 0.341, 0.550, 0.731, 0.319, 0.548, 0.724, 0.296, 0.546, 0.717,
+ 0.273, 0.544, 0.709, 0.249, 0.542, 0.702, 0.224, 0.541, 0.695, 0.198,
+ 0.299, 0.685, 0.968, 0.317, 0.692, 0.961, 0.334, 0.699, 0.955, 0.350,
+ 0.706, 0.949, 0.366, 0.713, 0.943, 0.381, 0.720, 0.938, 0.395, 0.727,
+ 0.932, 0.410, 0.734, 0.927, 0.423, 0.741, 0.922, 0.437, 0.747, 0.917,
+ 0.450, 0.754, 0.912, 0.463, 0.760, 0.907, 0.475, 0.767, 0.903, 0.487,
+ 0.773, 0.898, 0.498, 0.779, 0.894, 0.509, 0.785, 0.889, 0.520, 0.791,
+ 0.885, 0.531, 0.796, 0.880, 0.540, 0.802, 0.876, 0.550, 0.807, 0.871,
+ 0.559, 0.812, 0.867, 0.568, 0.817, 0.862, 0.576, 0.822, 0.857, 0.583,
+ 0.826, 0.852, 0.590, 0.830, 0.847, 0.596, 0.834, 0.841, 0.602, 0.837,
+ 0.835, 0.607, 0.840, 0.828, 0.611, 0.843, 0.821, 0.615, 0.845, 0.814,
+ 0.618, 0.846, 0.805, 0.620, 0.848, 0.797, 0.622, 0.848, 0.787, 0.623,
+ 0.849, 0.777, 0.623, 0.849, 0.766, 0.623, 0.848, 0.755, 0.622, 0.847,
+ 0.743, 0.621, 0.845, 0.730, 0.620, 0.843, 0.716, 0.618, 0.841, 0.702,
+ 0.616, 0.838, 0.687, 0.613, 0.835, 0.671, 0.611, 0.831, 0.655, 0.608,
+ 0.827, 0.638, 0.606, 0.823, 0.621, 0.603, 0.818, 0.604, 0.600, 0.814,
+ 0.585, 0.597, 0.808, 0.567, 0.594, 0.803, 0.548, 0.592, 0.797, 0.529,
+ 0.589, 0.792, 0.510, 0.586, 0.785, 0.490, 0.584, 0.779, 0.470, 0.581,
+ 0.773, 0.450, 0.579, 0.766, 0.429, 0.576, 0.760, 0.408, 0.574, 0.753,
+ 0.387, 0.572, 0.746, 0.366, 0.569, 0.739, 0.344, 0.567, 0.732, 0.322,
+ 0.565, 0.725, 0.299, 0.563, 0.717, 0.276, 0.561, 0.710, 0.252, 0.559,
+ 0.703, 0.227, 0.557, 0.695, 0.201, 0.329, 0.685, 0.970, 0.346, 0.692,
+ 0.964, 0.362, 0.699, 0.958, 0.377, 0.707, 0.952, 0.392, 0.714, 0.946,
+ 0.406, 0.721, 0.941, 0.420, 0.728, 0.935, 0.434, 0.735, 0.930, 0.447,
+ 0.742, 0.925, 0.460, 0.749, 0.920, 0.473, 0.756, 0.916, 0.485, 0.762,
+ 0.911, 0.497, 0.769, 0.907, 0.509, 0.775, 0.903, 0.521, 0.781, 0.898,
+ 0.532, 0.788, 0.894, 0.542, 0.794, 0.890, 0.553, 0.799, 0.886, 0.563,
+ 0.805, 0.882, 0.572, 0.811, 0.877, 0.581, 0.816, 0.873, 0.590, 0.821,
+ 0.868, 0.598, 0.826, 0.864, 0.606, 0.830, 0.859, 0.613, 0.834, 0.854,
+ 0.619, 0.838, 0.848, 0.625, 0.842, 0.842, 0.630, 0.845, 0.836, 0.634,
+ 0.848, 0.829, 0.638, 0.850, 0.822, 0.641, 0.852, 0.814, 0.643, 0.853,
+ 0.805, 0.645, 0.854, 0.796, 0.645, 0.854, 0.786, 0.646, 0.854, 0.775,
+ 0.645, 0.853, 0.764, 0.645, 0.852, 0.751, 0.643, 0.851, 0.738, 0.642,
+ 0.848, 0.725, 0.639, 0.846, 0.710, 0.637, 0.843, 0.695, 0.635, 0.839,
+ 0.679, 0.632, 0.836, 0.662, 0.629, 0.831, 0.645, 0.626, 0.827, 0.628,
+ 0.623, 0.822, 0.610, 0.620, 0.817, 0.592, 0.617, 0.811, 0.573, 0.614,
+ 0.806, 0.554, 0.611, 0.800, 0.534, 0.608, 0.794, 0.515, 0.605, 0.788,
+ 0.495, 0.602, 0.781, 0.474, 0.599, 0.775, 0.454, 0.597, 0.768, 0.433,
+ 0.594, 0.761, 0.412, 0.592, 0.754, 0.391, 0.589, 0.747, 0.369, 0.587,
+ 0.740, 0.347, 0.584, 0.733, 0.325, 0.582, 0.725, 0.302, 0.580, 0.718,
+ 0.279, 0.577, 0.710, 0.255, 0.575, 0.703, 0.230, 0.573, 0.695, 0.204,
+ 0.357, 0.685, 0.972, 0.372, 0.692, 0.966, 0.387, 0.700, 0.960, 0.401,
+ 0.707, 0.954, 0.416, 0.714, 0.949, 0.429, 0.722, 0.943, 0.443, 0.729,
+ 0.938, 0.456, 0.736, 0.933, 0.469, 0.743, 0.929, 0.482, 0.750, 0.924,
+ 0.494, 0.757, 0.919, 0.507, 0.764, 0.915, 0.519, 0.771, 0.911, 0.530,
+ 0.777, 0.907, 0.542, 0.784, 0.903, 0.553, 0.790, 0.899, 0.563, 0.796,
+ 0.895, 0.574, 0.802, 0.891, 0.584, 0.808, 0.887, 0.593, 0.814, 0.883,
+ 0.603, 0.820, 0.879, 0.611, 0.825, 0.875, 0.620, 0.830, 0.870, 0.627,
+ 0.835, 0.866, 0.635, 0.839, 0.861, 0.641, 0.843, 0.856, 0.647, 0.847,
+ 0.850, 0.652, 0.850, 0.844, 0.657, 0.853, 0.838, 0.660, 0.855, 0.831,
+ 0.663, 0.857, 0.823, 0.666, 0.859, 0.814, 0.667, 0.859, 0.805, 0.668,
+ 0.860, 0.795, 0.668, 0.860, 0.784, 0.667, 0.859, 0.773, 0.666, 0.858,
+ 0.760, 0.665, 0.856, 0.747, 0.663, 0.853, 0.733, 0.661, 0.851, 0.718,
+ 0.658, 0.847, 0.703, 0.655, 0.844, 0.687, 0.652, 0.840, 0.670, 0.649,
+ 0.835, 0.652, 0.646, 0.830, 0.635, 0.642, 0.825, 0.616, 0.639, 0.820,
+ 0.598, 0.636, 0.814, 0.579, 0.633, 0.808, 0.559, 0.629, 0.802, 0.539,
+ 0.626, 0.796, 0.519, 0.623, 0.790, 0.499, 0.620, 0.783, 0.479, 0.617,
+ 0.776, 0.458, 0.614, 0.769, 0.437, 0.611, 0.762, 0.416, 0.609, 0.755,
+ 0.394, 0.606, 0.748, 0.372, 0.603, 0.740, 0.350, 0.601, 0.733, 0.328,
+ 0.598, 0.726, 0.305, 0.596, 0.718, 0.282, 0.593, 0.710, 0.257, 0.591,
+ 0.703, 0.232, 0.589, 0.695, 0.206, 0.381, 0.684, 0.974, 0.396, 0.692,
+ 0.968, 0.410, 0.700, 0.962, 0.424, 0.707, 0.957, 0.438, 0.715, 0.951,
+ 0.451, 0.722, 0.946, 0.464, 0.729, 0.941, 0.477, 0.737, 0.936, 0.490,
+ 0.744, 0.932, 0.503, 0.751, 0.927, 0.515, 0.758, 0.923, 0.527, 0.765,
+ 0.919, 0.539, 0.772, 0.915, 0.550, 0.779, 0.911, 0.562, 0.786, 0.907,
+ 0.573, 0.792, 0.903, 0.584, 0.799, 0.900, 0.594, 0.805, 0.896, 0.604,
+ 0.811, 0.892, 0.614, 0.817, 0.889, 0.623, 0.823, 0.885, 0.632, 0.829,
+ 0.881, 0.641, 0.834, 0.877, 0.649, 0.839, 0.873, 0.656, 0.844, 0.868,
+ 0.663, 0.848, 0.863, 0.669, 0.852, 0.858, 0.674, 0.855, 0.852, 0.679,
+ 0.858, 0.846, 0.682, 0.861, 0.839, 0.685, 0.863, 0.832, 0.688, 0.864,
+ 0.823, 0.689, 0.865, 0.814, 0.690, 0.865, 0.804, 0.690, 0.865, 0.794,
+ 0.689, 0.864, 0.782, 0.688, 0.863, 0.769, 0.686, 0.861, 0.756, 0.684,
+ 0.858, 0.742, 0.681, 0.855, 0.726, 0.678, 0.852, 0.711, 0.675, 0.848,
+ 0.694, 0.672, 0.844, 0.677, 0.668, 0.839, 0.659, 0.665, 0.834, 0.641,
+ 0.662, 0.829, 0.622, 0.658, 0.823, 0.603, 0.655, 0.817, 0.584, 0.651,
+ 0.811, 0.564, 0.648, 0.805, 0.544, 0.644, 0.798, 0.524, 0.641, 0.791,
+ 0.503, 0.638, 0.785, 0.483, 0.635, 0.778, 0.462, 0.631, 0.770, 0.440,
+ 0.628, 0.763, 0.419, 0.625, 0.756, 0.397, 0.623, 0.748, 0.375, 0.620,
+ 0.741, 0.353, 0.617, 0.733, 0.330, 0.614, 0.726, 0.307, 0.612, 0.718,
+ 0.284, 0.609, 0.710, 0.260, 0.606, 0.702, 0.235, 0.604, 0.694, 0.208,
+ 0.404, 0.684, 0.977, 0.418, 0.692, 0.971, 0.432, 0.699, 0.965, 0.445,
+ 0.707, 0.959, 0.458, 0.715, 0.954, 0.472, 0.722, 0.949, 0.484, 0.730,
+ 0.944, 0.497, 0.737, 0.939, 0.510, 0.745, 0.935, 0.522, 0.752, 0.931,
+ 0.534, 0.759, 0.926, 0.546, 0.767, 0.922, 0.558, 0.774, 0.919, 0.569,
+ 0.781, 0.915, 0.581, 0.788, 0.911, 0.592, 0.794, 0.908, 0.603, 0.801,
+ 0.904, 0.613, 0.808, 0.901, 0.624, 0.814, 0.897, 0.633, 0.820, 0.894,
+ 0.643, 0.826, 0.891, 0.652, 0.832, 0.887, 0.661, 0.838, 0.883, 0.669,
+ 0.843, 0.879, 0.677, 0.848, 0.875, 0.684, 0.853, 0.871, 0.690, 0.857,
+ 0.866, 0.695, 0.860, 0.860, 0.700, 0.864, 0.855, 0.704, 0.866, 0.848,
+ 0.707, 0.869, 0.841, 0.709, 0.870, 0.833, 0.711, 0.871, 0.824, 0.711,
+ 0.871, 0.814, 0.711, 0.871, 0.803, 0.710, 0.870, 0.791, 0.709, 0.868,
+ 0.778, 0.707, 0.866, 0.765, 0.704, 0.864, 0.750, 0.701, 0.860, 0.735,
+ 0.698, 0.857, 0.718, 0.695, 0.852, 0.702, 0.691, 0.848, 0.684, 0.688,
+ 0.843, 0.666, 0.684, 0.837, 0.647, 0.680, 0.832, 0.628, 0.676, 0.826,
+ 0.609, 0.673, 0.820, 0.589, 0.669, 0.813, 0.569, 0.665, 0.807, 0.549,
+ 0.662, 0.800, 0.528, 0.658, 0.793, 0.507, 0.655, 0.786, 0.486, 0.651,
+ 0.779, 0.465, 0.648, 0.771, 0.444, 0.645, 0.764, 0.422, 0.642, 0.756,
+ 0.400, 0.639, 0.749, 0.378, 0.636, 0.741, 0.356, 0.633, 0.733, 0.333,
+ 0.630, 0.726, 0.310, 0.627, 0.718, 0.286, 0.624, 0.710, 0.262, 0.621,
+ 0.702, 0.237, 0.619, 0.694, 0.210, 0.425, 0.683, 0.979, 0.439, 0.691,
+ 0.973, 0.452, 0.699, 0.967, 0.465, 0.707, 0.962, 0.478, 0.715, 0.956,
+ 0.491, 0.722, 0.951, 0.503, 0.730, 0.947, 0.516, 0.738, 0.942, 0.528,
+ 0.745, 0.938, 0.540, 0.753, 0.934, 0.552, 0.760, 0.930, 0.564, 0.768,
+ 0.926, 0.576, 0.775, 0.922, 0.588, 0.782, 0.919, 0.599, 0.789, 0.915,
+ 0.610, 0.797, 0.912, 0.621, 0.803, 0.909, 0.632, 0.810, 0.906, 0.642,
+ 0.817, 0.902, 0.652, 0.823, 0.899, 0.662, 0.830, 0.896, 0.671, 0.836,
+ 0.893, 0.680, 0.842, 0.890, 0.689, 0.847, 0.886, 0.697, 0.853, 0.882,
+ 0.704, 0.857, 0.878, 0.710, 0.862, 0.874, 0.716, 0.866, 0.869, 0.721,
+ 0.869, 0.863, 0.725, 0.872, 0.857, 0.729, 0.874, 0.850, 0.731, 0.876,
+ 0.842, 0.732, 0.877, 0.833, 0.733, 0.877, 0.823, 0.732, 0.877, 0.812,
+ 0.731, 0.876, 0.800, 0.729, 0.874, 0.787, 0.727, 0.872, 0.773, 0.724,
+ 0.869, 0.759, 0.721, 0.865, 0.743, 0.718, 0.861, 0.726, 0.714, 0.857,
+ 0.709, 0.710, 0.852, 0.691, 0.706, 0.846, 0.672, 0.702, 0.841, 0.653,
+ 0.698, 0.835, 0.634, 0.694, 0.828, 0.614, 0.690, 0.822, 0.594, 0.686,
+ 0.815, 0.574, 0.683, 0.808, 0.553, 0.679, 0.801, 0.532, 0.675, 0.794,
+ 0.511, 0.672, 0.787, 0.490, 0.668, 0.779, 0.468, 0.665, 0.772, 0.446,
+ 0.661, 0.764, 0.425, 0.658, 0.757, 0.403, 0.654, 0.749, 0.380, 0.651,
+ 0.741, 0.358, 0.648, 0.733, 0.335, 0.645, 0.725, 0.312, 0.642, 0.717,
+ 0.288, 0.639, 0.709, 0.264, 0.636, 0.701, 0.238, 0.633, 0.693, 0.212,
+ 0.445, 0.682, 0.981, 0.458, 0.691, 0.975, 0.471, 0.699, 0.969, 0.484,
+ 0.707, 0.964, 0.496, 0.715, 0.959, 0.509, 0.722, 0.954, 0.521, 0.730,
+ 0.949, 0.534, 0.738, 0.945, 0.546, 0.746, 0.941, 0.558, 0.753, 0.937,
+ 0.570, 0.761, 0.933, 0.582, 0.769, 0.929, 0.593, 0.776, 0.926, 0.605,
+ 0.784, 0.922, 0.616, 0.791, 0.919, 0.628, 0.798, 0.916, 0.639, 0.806,
+ 0.913, 0.649, 0.813, 0.910, 0.660, 0.820, 0.907, 0.670, 0.826, 0.904,
+ 0.680, 0.833, 0.902, 0.690, 0.839, 0.899, 0.699, 0.846, 0.896, 0.708,
+ 0.851, 0.893, 0.716, 0.857, 0.889, 0.724, 0.862, 0.885, 0.731, 0.867,
+ 0.881, 0.737, 0.871, 0.877, 0.742, 0.875, 0.872, 0.746, 0.878, 0.866,
+ 0.750, 0.880, 0.859, 0.752, 0.882, 0.851, 0.753, 0.883, 0.843, 0.754,
+ 0.883, 0.833, 0.753, 0.883, 0.822, 0.752, 0.882, 0.810, 0.750, 0.880,
+ 0.797, 0.747, 0.877, 0.782, 0.744, 0.874, 0.767, 0.740, 0.870, 0.751,
+ 0.737, 0.866, 0.734, 0.733, 0.861, 0.716, 0.729, 0.855, 0.697, 0.724,
+ 0.850, 0.678, 0.720, 0.844, 0.659, 0.716, 0.837, 0.639, 0.712, 0.831,
+ 0.619, 0.708, 0.824, 0.598, 0.704, 0.817, 0.578, 0.699, 0.810, 0.557,
+ 0.696, 0.803, 0.535, 0.692, 0.795, 0.514, 0.688, 0.788, 0.493, 0.684,
+ 0.780, 0.471, 0.680, 0.772, 0.449, 0.677, 0.765, 0.427, 0.673, 0.757,
+ 0.405, 0.670, 0.749, 0.382, 0.666, 0.741, 0.360, 0.663, 0.733, 0.337,
+ 0.660, 0.725, 0.313, 0.657, 0.716, 0.289, 0.653, 0.708, 0.265, 0.650,
+ 0.700, 0.240, 0.647, 0.692, 0.213, 0.464, 0.681, 0.982, 0.476, 0.690,
+ 0.977, 0.489, 0.698, 0.971, 0.501, 0.706, 0.966, 0.514, 0.714, 0.961,
+ 0.526, 0.722, 0.956, 0.538, 0.730, 0.952, 0.550, 0.738, 0.947, 0.562,
+ 0.746, 0.943, 0.574, 0.754, 0.939, 0.586, 0.762, 0.936, 0.598, 0.769,
+ 0.932, 0.610, 0.777, 0.929, 0.621, 0.785, 0.926, 0.633, 0.792, 0.923,
+ 0.644, 0.800, 0.920, 0.655, 0.807, 0.917, 0.666, 0.815, 0.915, 0.677,
+ 0.822, 0.912, 0.688, 0.829, 0.909, 0.698, 0.836, 0.907, 0.708, 0.843,
+ 0.904, 0.717, 0.849, 0.902, 0.727, 0.855, 0.899, 0.735, 0.861, 0.896,
+ 0.743, 0.867, 0.893, 0.750, 0.872, 0.889, 0.757, 0.877, 0.885, 0.762,
+ 0.881, 0.880, 0.767, 0.884, 0.875, 0.770, 0.887, 0.868, 0.773, 0.888,
+ 0.861, 0.774, 0.889, 0.852, 0.774, 0.890, 0.842, 0.774, 0.889, 0.831,
+ 0.772, 0.888, 0.819, 0.770, 0.885, 0.806, 0.767, 0.883, 0.791, 0.763,
+ 0.879, 0.775, 0.759, 0.875, 0.759, 0.755, 0.870, 0.741, 0.751, 0.865,
+ 0.723, 0.747, 0.859, 0.704, 0.742, 0.853, 0.684, 0.738, 0.847, 0.664,
+ 0.733, 0.840, 0.644, 0.729, 0.833, 0.623, 0.724, 0.826, 0.603, 0.720,
+ 0.819, 0.581, 0.716, 0.811, 0.560, 0.712, 0.804, 0.539, 0.708, 0.796,
+ 0.517, 0.704, 0.788, 0.495, 0.700, 0.780, 0.473, 0.696, 0.772, 0.451,
+ 0.692, 0.764, 0.429, 0.688, 0.756, 0.407, 0.685, 0.748, 0.384, 0.681,
+ 0.740, 0.361, 0.678, 0.732, 0.338, 0.674, 0.724, 0.315, 0.671, 0.715,
+ 0.291, 0.667, 0.707, 0.266, 0.664, 0.699, 0.241, 0.661, 0.691, 0.214,
+ 0.481, 0.680, 0.984, 0.494, 0.689, 0.978, 0.506, 0.697, 0.973, 0.518,
+ 0.705, 0.968, 0.530, 0.713, 0.963, 0.542, 0.722, 0.958, 0.554, 0.730,
+ 0.954, 0.566, 0.738, 0.950, 0.578, 0.746, 0.946, 0.590, 0.754, 0.942,
+ 0.602, 0.762, 0.939, 0.614, 0.770, 0.935, 0.626, 0.778, 0.932, 0.637,
+ 0.786, 0.929, 0.649, 0.794, 0.926, 0.660, 0.801, 0.924, 0.671, 0.809,
+ 0.921, 0.683, 0.817, 0.919, 0.694, 0.824, 0.916, 0.704, 0.832, 0.914,
+ 0.715, 0.839, 0.912, 0.725, 0.846, 0.910, 0.735, 0.853, 0.908, 0.744,
+ 0.859, 0.905, 0.753, 0.866, 0.903, 0.762, 0.872, 0.900, 0.770, 0.877,
+ 0.897, 0.776, 0.882, 0.893, 0.782, 0.886, 0.889, 0.787, 0.890, 0.884,
+ 0.791, 0.893, 0.878, 0.794, 0.895, 0.871, 0.795, 0.896, 0.862, 0.795,
+ 0.896, 0.852, 0.794, 0.895, 0.841, 0.792, 0.894, 0.829, 0.789, 0.891,
+ 0.815, 0.786, 0.888, 0.800, 0.782, 0.884, 0.783, 0.778, 0.879, 0.766,
+ 0.774, 0.874, 0.748, 0.769, 0.868, 0.729, 0.764, 0.862, 0.710, 0.760,
+ 0.856, 0.690, 0.755, 0.849, 0.669, 0.750, 0.842, 0.649, 0.745, 0.835,
+ 0.628, 0.741, 0.827, 0.606, 0.736, 0.820, 0.585, 0.732, 0.812, 0.563,
+ 0.728, 0.804, 0.542, 0.723, 0.796, 0.520, 0.719, 0.788, 0.498, 0.715,
+ 0.780, 0.475, 0.711, 0.772, 0.453, 0.707, 0.764, 0.431, 0.703, 0.756,
+ 0.408, 0.699, 0.748, 0.386, 0.696, 0.739, 0.363, 0.692, 0.731, 0.339,
+ 0.688, 0.723, 0.316, 0.685, 0.714, 0.292, 0.681, 0.706, 0.267, 0.678,
+ 0.697, 0.242, 0.674, 0.689, 0.215, 0.498, 0.679, 0.986, 0.510, 0.687,
+ 0.980, 0.522, 0.696, 0.975, 0.534, 0.704, 0.970, 0.546, 0.712, 0.965,
+ 0.558, 0.721, 0.961, 0.570, 0.729, 0.956, 0.581, 0.737, 0.952, 0.593,
+ 0.746, 0.948, 0.605, 0.754, 0.945, 0.617, 0.762, 0.941, 0.629, 0.770,
+ 0.938, 0.640, 0.778, 0.935, 0.652, 0.786, 0.932, 0.664, 0.794, 0.930,
+ 0.675, 0.802, 0.927, 0.687, 0.810, 0.925, 0.698, 0.818, 0.923, 0.709,
+ 0.826, 0.921, 0.720, 0.834, 0.919, 0.731, 0.841, 0.917, 0.742, 0.849,
+ 0.915, 0.752, 0.856, 0.913, 0.762, 0.863, 0.911, 0.771, 0.870, 0.909,
+ 0.780, 0.876, 0.907, 0.788, 0.882, 0.904, 0.796, 0.887, 0.901, 0.802,
+ 0.892, 0.897, 0.807, 0.896, 0.893, 0.811, 0.899, 0.887, 0.814, 0.902,
+ 0.880, 0.815, 0.903, 0.872, 0.815, 0.903, 0.862, 0.814, 0.902, 0.851,
+ 0.812, 0.900, 0.838, 0.809, 0.897, 0.824, 0.805, 0.893, 0.808, 0.801,
+ 0.889, 0.791, 0.796, 0.884, 0.774, 0.791, 0.878, 0.755, 0.786, 0.872,
+ 0.735, 0.781, 0.865, 0.715, 0.776, 0.858, 0.695, 0.771, 0.851, 0.674,
+ 0.767, 0.844, 0.653, 0.762, 0.836, 0.631, 0.757, 0.829, 0.610, 0.752,
+ 0.821, 0.588, 0.748, 0.813, 0.566, 0.743, 0.805, 0.544, 0.739, 0.796,
+ 0.522, 0.734, 0.788, 0.500, 0.730, 0.780, 0.477, 0.726, 0.772, 0.455,
+ 0.722, 0.763, 0.432, 0.718, 0.755, 0.410, 0.714, 0.746, 0.387, 0.710,
+ 0.738, 0.364, 0.706, 0.730, 0.340, 0.702, 0.721, 0.317, 0.698, 0.713,
+ 0.293, 0.694, 0.704, 0.268, 0.691, 0.696, 0.243, 0.687, 0.687, 0.216,
+ 0.513, 0.677, 0.987, 0.525, 0.686, 0.982, 0.537, 0.694, 0.977, 0.549,
+ 0.703, 0.972, 0.561, 0.711, 0.967, 0.572, 0.720, 0.962, 0.584, 0.728,
+ 0.958, 0.596, 0.737, 0.954, 0.608, 0.745, 0.951, 0.619, 0.753, 0.947,
+ 0.631, 0.762, 0.944, 0.643, 0.770, 0.941, 0.655, 0.778, 0.938, 0.666,
+ 0.787, 0.935, 0.678, 0.795, 0.933, 0.689, 0.803, 0.930, 0.701, 0.811,
+ 0.928, 0.713, 0.820, 0.926, 0.724, 0.828, 0.925, 0.735, 0.836, 0.923,
+ 0.746, 0.844, 0.921, 0.757, 0.852, 0.920, 0.768, 0.859, 0.918, 0.778,
+ 0.867, 0.917, 0.788, 0.874, 0.915, 0.797, 0.881, 0.913, 0.806, 0.887,
+ 0.911, 0.814, 0.893, 0.909, 0.821, 0.898, 0.906, 0.827, 0.902, 0.902,
+ 0.831, 0.906, 0.897, 0.834, 0.908, 0.890, 0.836, 0.910, 0.882, 0.836,
+ 0.910, 0.873, 0.834, 0.909, 0.861, 0.832, 0.906, 0.848, 0.828, 0.903,
+ 0.833, 0.824, 0.899, 0.817, 0.819, 0.894, 0.799, 0.814, 0.888, 0.781,
+ 0.809, 0.882, 0.761, 0.804, 0.875, 0.741, 0.798, 0.868, 0.720, 0.793,
+ 0.861, 0.699, 0.788, 0.853, 0.678, 0.783, 0.845, 0.656, 0.777, 0.837,
+ 0.635, 0.772, 0.829, 0.613, 0.768, 0.821, 0.590, 0.763, 0.813, 0.568,
+ 0.758, 0.804, 0.546, 0.753, 0.796, 0.524, 0.749, 0.788, 0.501, 0.744,
+ 0.779, 0.479, 0.740, 0.771, 0.456, 0.736, 0.762, 0.433, 0.731, 0.754,
+ 0.411, 0.727, 0.745, 0.388, 0.723, 0.736, 0.365, 0.719, 0.728, 0.341,
+ 0.715, 0.719, 0.317, 0.711, 0.711, 0.293, 0.707, 0.702, 0.268, 0.704,
+ 0.694, 0.243, 0.700, 0.685, 0.216, 0.528, 0.675, 0.989, 0.540, 0.684,
+ 0.983, 0.551, 0.693, 0.978, 0.563, 0.701, 0.973, 0.575, 0.710, 0.969,
+ 0.586, 0.718, 0.964, 0.598, 0.727, 0.960, 0.610, 0.736, 0.956, 0.621,
+ 0.744, 0.953, 0.633, 0.753, 0.949, 0.645, 0.761, 0.946, 0.656, 0.770,
+ 0.943, 0.668, 0.778, 0.940, 0.680, 0.787, 0.938, 0.691, 0.795, 0.936,
+ 0.703, 0.804, 0.933, 0.715, 0.812, 0.932, 0.726, 0.821, 0.930, 0.738,
+ 0.829, 0.928, 0.749, 0.837, 0.927, 0.761, 0.846, 0.926, 0.772, 0.854,
+ 0.924, 0.783, 0.862, 0.923, 0.794, 0.870, 0.922, 0.804, 0.877, 0.921,
+ 0.814, 0.885, 0.920, 0.824, 0.892, 0.918, 0.832, 0.898, 0.917, 0.840,
+ 0.904, 0.914, 0.846, 0.909, 0.911, 0.851, 0.913, 0.906, 0.855, 0.915,
+ 0.901, 0.856, 0.917, 0.893, 0.856, 0.917, 0.883, 0.854, 0.915, 0.871,
+ 0.851, 0.913, 0.858, 0.847, 0.909, 0.842, 0.842, 0.904, 0.825, 0.837,
+ 0.898, 0.806, 0.831, 0.892, 0.787, 0.826, 0.885, 0.767, 0.820, 0.878,
+ 0.746, 0.814, 0.870, 0.725, 0.809, 0.862, 0.703, 0.803, 0.854, 0.681,
+ 0.798, 0.846, 0.659, 0.793, 0.838, 0.637, 0.788, 0.829, 0.615, 0.782,
+ 0.821, 0.592, 0.777, 0.812, 0.570, 0.773, 0.804, 0.548, 0.768, 0.795,
+ 0.525, 0.763, 0.787, 0.502, 0.758, 0.778, 0.480, 0.754, 0.769, 0.457,
+ 0.749, 0.761, 0.434, 0.745, 0.752, 0.411, 0.741, 0.743, 0.388, 0.737,
+ 0.735, 0.365, 0.732, 0.726, 0.342, 0.728, 0.717, 0.318, 0.724, 0.709,
+ 0.293, 0.720, 0.700, 0.269, 0.716, 0.691, 0.243, 0.712, 0.683, 0.216,
+ 0.542, 0.673, 0.990, 0.554, 0.682, 0.985, 0.565, 0.691, 0.980, 0.577,
+ 0.700, 0.975, 0.588, 0.708, 0.970, 0.600, 0.717, 0.966, 0.611, 0.726,
+ 0.962, 0.623, 0.734, 0.958, 0.634, 0.743, 0.955, 0.646, 0.752, 0.951,
+ 0.657, 0.760, 0.948, 0.669, 0.769, 0.945, 0.681, 0.778, 0.943, 0.692,
+ 0.786, 0.940, 0.704, 0.795, 0.938, 0.716, 0.804, 0.936, 0.728, 0.812,
+ 0.934, 0.739, 0.821, 0.933, 0.751, 0.830, 0.932, 0.763, 0.838, 0.930,
+ 0.774, 0.847, 0.929, 0.786, 0.856, 0.929, 0.797, 0.864, 0.928, 0.809,
+ 0.873, 0.927, 0.819, 0.881, 0.927, 0.830, 0.889, 0.926, 0.840, 0.896,
+ 0.925, 0.850, 0.903, 0.924, 0.858, 0.910, 0.922, 0.865, 0.915, 0.920,
+ 0.871, 0.920, 0.916, 0.875, 0.923, 0.911, 0.876, 0.924, 0.903, 0.876,
+ 0.924, 0.894, 0.873, 0.922, 0.882, 0.870, 0.919, 0.867, 0.865, 0.914,
+ 0.851, 0.860, 0.909, 0.832, 0.854, 0.902, 0.813, 0.848, 0.895, 0.793,
+ 0.842, 0.888, 0.772, 0.836, 0.880, 0.750, 0.830, 0.872, 0.729, 0.824,
+ 0.864, 0.707, 0.819, 0.855, 0.684, 0.813, 0.847, 0.662, 0.808, 0.838,
+ 0.639, 0.802, 0.829, 0.617, 0.797, 0.820, 0.594, 0.792, 0.812, 0.571,
+ 0.787, 0.803, 0.549, 0.782, 0.794, 0.526, 0.777, 0.785, 0.503, 0.772,
+ 0.776, 0.480, 0.767, 0.768, 0.458, 0.763, 0.759, 0.435, 0.758, 0.750,
+ 0.412, 0.754, 0.741, 0.388, 0.749, 0.732, 0.365, 0.745, 0.724, 0.342,
+ 0.741, 0.715, 0.318, 0.737, 0.706, 0.293, 0.732, 0.697, 0.269, 0.728,
+ 0.689, 0.243, 0.724, 0.680, 0.216, 0.556, 0.671, 0.992, 0.567, 0.680,
+ 0.986, 0.578, 0.689, 0.981, 0.590, 0.697, 0.976, 0.601, 0.706, 0.972,
+ 0.612, 0.715, 0.968, 0.624, 0.724, 0.964, 0.635, 0.733, 0.960, 0.646,
+ 0.741, 0.956, 0.658, 0.750, 0.953, 0.670, 0.759, 0.950, 0.681, 0.768,
+ 0.947, 0.693, 0.777, 0.945, 0.704, 0.786, 0.943, 0.716, 0.794, 0.941,
+ 0.728, 0.803, 0.939, 0.740, 0.812, 0.937, 0.752, 0.821, 0.936, 0.763,
+ 0.830, 0.935, 0.775, 0.839, 0.934, 0.787, 0.848, 0.933, 0.799, 0.857,
+ 0.932, 0.811, 0.866, 0.932, 0.822, 0.875, 0.932, 0.834, 0.883, 0.932,
+ 0.845, 0.892, 0.931, 0.856, 0.900, 0.931, 0.866, 0.908, 0.931, 0.876,
+ 0.915, 0.930, 0.884, 0.922, 0.929, 0.890, 0.927, 0.926, 0.895, 0.930,
+ 0.921, 0.896, 0.932, 0.914, 0.896, 0.932, 0.905, 0.893, 0.929, 0.892,
+ 0.888, 0.925, 0.876, 0.883, 0.920, 0.859, 0.877, 0.913, 0.840, 0.871,
+ 0.906, 0.819, 0.864, 0.898, 0.798, 0.858, 0.890, 0.776, 0.852, 0.882,
+ 0.754, 0.845, 0.873, 0.732, 0.839, 0.864, 0.709, 0.833, 0.855, 0.686,
+ 0.828, 0.846, 0.664, 0.822, 0.837, 0.641, 0.816, 0.828, 0.618, 0.811,
+ 0.819, 0.595, 0.806, 0.810, 0.572, 0.800, 0.801, 0.549, 0.795, 0.792,
+ 0.526, 0.790, 0.783, 0.504, 0.785, 0.774, 0.481, 0.781, 0.765, 0.458,
+ 0.776, 0.756, 0.435, 0.771, 0.748, 0.412, 0.766, 0.739, 0.388, 0.762,
+ 0.730, 0.365, 0.757, 0.721, 0.341, 0.753, 0.712, 0.318, 0.749, 0.703,
+ 0.293, 0.744, 0.695, 0.268, 0.740, 0.686, 0.243, 0.736, 0.677, 0.216,
+ 0.569, 0.668, 0.993, 0.580, 0.677, 0.987, 0.591, 0.686, 0.982, 0.602,
+ 0.695, 0.978, 0.613, 0.704, 0.973, 0.624, 0.713, 0.969, 0.635, 0.722,
+ 0.965, 0.647, 0.731, 0.961, 0.658, 0.740, 0.958, 0.670, 0.748, 0.955,
+ 0.681, 0.757, 0.952, 0.693, 0.766, 0.949, 0.704, 0.775, 0.947, 0.716,
+ 0.784, 0.945, 0.728, 0.793, 0.943, 0.739, 0.802, 0.941, 0.751, 0.812,
+ 0.939, 0.763, 0.821, 0.938, 0.775, 0.830, 0.937, 0.787, 0.839, 0.936,
+ 0.799, 0.848, 0.936, 0.811, 0.858, 0.936, 0.823, 0.867, 0.935, 0.835,
+ 0.876, 0.936, 0.847, 0.886, 0.936, 0.859, 0.895, 0.936, 0.870, 0.904,
+ 0.937, 0.882, 0.912, 0.937, 0.892, 0.920, 0.937, 0.901, 0.928, 0.937,
+ 0.909, 0.934, 0.936, 0.914, 0.938, 0.932, 0.917, 0.940, 0.926, 0.915,
+ 0.940, 0.916, 0.912, 0.936, 0.902, 0.906, 0.931, 0.885, 0.900, 0.925,
+ 0.866, 0.893, 0.917, 0.846, 0.887, 0.909, 0.824, 0.880, 0.900, 0.802,
+ 0.873, 0.891, 0.780, 0.867, 0.882, 0.757, 0.860, 0.873, 0.734, 0.854,
+ 0.864, 0.711, 0.848, 0.855, 0.688, 0.842, 0.845, 0.665, 0.836, 0.836,
+ 0.642, 0.830, 0.827, 0.619, 0.824, 0.818, 0.596, 0.819, 0.808, 0.573,
+ 0.814, 0.799, 0.549, 0.808, 0.790, 0.527, 0.803, 0.781, 0.504, 0.798,
+ 0.772, 0.481, 0.793, 0.763, 0.458, 0.788, 0.754, 0.434, 0.783, 0.745,
+ 0.411, 0.779, 0.736, 0.388, 0.774, 0.727, 0.365, 0.769, 0.718, 0.341,
+ 0.765, 0.709, 0.317, 0.760, 0.700, 0.293, 0.756, 0.691, 0.268, 0.751,
+ 0.683, 0.242, 0.747, 0.674, 0.215, 0.581, 0.665, 0.994, 0.592, 0.674,
+ 0.989, 0.603, 0.683, 0.984, 0.614, 0.692, 0.979, 0.625, 0.701, 0.974,
+ 0.636, 0.710, 0.970, 0.647, 0.719, 0.966, 0.658, 0.728, 0.963, 0.669,
+ 0.737, 0.959, 0.681, 0.746, 0.956, 0.692, 0.755, 0.953, 0.703, 0.765,
+ 0.951, 0.715, 0.774, 0.948, 0.727, 0.783, 0.946, 0.738, 0.792, 0.944,
+ 0.750, 0.801, 0.943, 0.762, 0.810, 0.941, 0.774, 0.820, 0.940, 0.786,
+ 0.829, 0.939, 0.798, 0.839, 0.939, 0.810, 0.848, 0.938, 0.822, 0.858,
+ 0.938, 0.834, 0.867, 0.939, 0.847, 0.877, 0.939, 0.859, 0.887, 0.940,
+ 0.871, 0.897, 0.940, 0.883, 0.906, 0.942, 0.896, 0.916, 0.943, 0.907,
+ 0.925, 0.944, 0.918, 0.933, 0.945, 0.927, 0.941, 0.945, 0.934, 0.946,
+ 0.943, 0.937, 0.949, 0.937, 0.935, 0.948, 0.927, 0.930, 0.943, 0.912,
+ 0.924, 0.937, 0.893, 0.916, 0.929, 0.872, 0.909, 0.920, 0.850, 0.902,
+ 0.911, 0.828, 0.895, 0.901, 0.805, 0.888, 0.892, 0.782, 0.881, 0.882,
+ 0.759, 0.874, 0.872, 0.735, 0.868, 0.863, 0.712, 0.861, 0.853, 0.689,
+ 0.855, 0.844, 0.665, 0.849, 0.834, 0.642, 0.843, 0.825, 0.619, 0.838,
+ 0.815, 0.596, 0.832, 0.806, 0.572, 0.826, 0.797, 0.549, 0.821, 0.787,
+ 0.526, 0.816, 0.778, 0.503, 0.811, 0.769, 0.480, 0.805, 0.760, 0.457,
+ 0.800, 0.751, 0.434, 0.795, 0.742, 0.411, 0.791, 0.733, 0.387, 0.786,
+ 0.724, 0.364, 0.781, 0.715, 0.340, 0.776, 0.706, 0.316, 0.772, 0.697,
+ 0.292, 0.767, 0.688, 0.267, 0.762, 0.679, 0.241, 0.758, 0.670, 0.215,
+ 0.593, 0.662, 0.995, 0.603, 0.671, 0.990, 0.614, 0.680, 0.985, 0.625,
+ 0.689, 0.980, 0.636, 0.699, 0.975, 0.647, 0.708, 0.971, 0.658, 0.717,
+ 0.967, 0.669, 0.726, 0.964, 0.680, 0.735, 0.960, 0.691, 0.744, 0.957,
+ 0.702, 0.753, 0.955, 0.714, 0.762, 0.952, 0.725, 0.771, 0.950, 0.737,
+ 0.781, 0.948, 0.748, 0.790, 0.946, 0.760, 0.799, 0.944, 0.772, 0.809,
+ 0.943, 0.784, 0.818, 0.942, 0.796, 0.828, 0.941, 0.808, 0.837, 0.941,
+ 0.820, 0.847, 0.940, 0.832, 0.857, 0.941, 0.844, 0.867, 0.941, 0.857,
+ 0.877, 0.942, 0.869, 0.887, 0.943, 0.882, 0.897, 0.944, 0.895, 0.908,
+ 0.945, 0.908, 0.918, 0.947, 0.920, 0.928, 0.949, 0.933, 0.938, 0.951,
+ 0.944, 0.947, 0.953, 0.953, 0.955, 0.954, 0.957, 0.958, 0.950, 0.954,
+ 0.956, 0.938, 0.948, 0.949, 0.920, 0.940, 0.941, 0.899, 0.932, 0.931,
+ 0.877, 0.924, 0.921, 0.854, 0.916, 0.911, 0.830, 0.909, 0.901, 0.807,
+ 0.901, 0.891, 0.783, 0.894, 0.881, 0.759, 0.887, 0.871, 0.736, 0.881,
+ 0.861, 0.712, 0.874, 0.851, 0.688, 0.868, 0.841, 0.665, 0.862, 0.832,
+ 0.642, 0.856, 0.822, 0.618, 0.850, 0.812, 0.595, 0.844, 0.803, 0.572,
+ 0.839, 0.793, 0.549, 0.833, 0.784, 0.525, 0.828, 0.775, 0.502, 0.822,
+ 0.766, 0.479, 0.817, 0.756, 0.456, 0.812, 0.747, 0.433, 0.807, 0.738,
+ 0.410, 0.802, 0.729, 0.387, 0.797, 0.720, 0.363, 0.792, 0.711, 0.339,
+ 0.787, 0.702, 0.315, 0.782, 0.693, 0.291, 0.778, 0.684, 0.266, 0.773,
+ 0.675, 0.240, 0.768, 0.666, 0.214, 0.604, 0.659, 0.996, 0.614, 0.668,
+ 0.990, 0.625, 0.677, 0.985, 0.636, 0.686, 0.981, 0.646, 0.695, 0.976,
+ 0.657, 0.704, 0.972, 0.668, 0.714, 0.968, 0.679, 0.723, 0.965, 0.690,
+ 0.732, 0.961, 0.701, 0.741, 0.958, 0.712, 0.750, 0.956, 0.723, 0.759,
+ 0.953, 0.735, 0.769, 0.951, 0.746, 0.778, 0.949, 0.758, 0.787, 0.947,
+ 0.769, 0.797, 0.945, 0.781, 0.806, 0.944, 0.793, 0.816, 0.943, 0.805,
+ 0.826, 0.943, 0.817, 0.836, 0.942, 0.829, 0.845, 0.942, 0.841, 0.855,
+ 0.942, 0.853, 0.866, 0.943, 0.866, 0.876, 0.943, 0.879, 0.886, 0.945,
+ 0.892, 0.897, 0.946, 0.905, 0.907, 0.948, 0.918, 0.918, 0.950, 0.931,
+ 0.930, 0.953, 0.945, 0.941, 0.956, 0.958, 0.952, 0.960, 0.971, 0.963,
+ 0.963, 0.978, 0.968, 0.963, 0.972, 0.963, 0.948, 0.963, 0.954, 0.926,
+ 0.954, 0.943, 0.903, 0.945, 0.931, 0.879, 0.937, 0.921, 0.855, 0.929,
+ 0.910, 0.831, 0.921, 0.899, 0.807, 0.914, 0.889, 0.783, 0.907, 0.878,
+ 0.759, 0.900, 0.868, 0.735, 0.893, 0.858, 0.711, 0.887, 0.848, 0.688,
+ 0.880, 0.838, 0.664, 0.874, 0.828, 0.641, 0.868, 0.818, 0.617, 0.862,
+ 0.809, 0.594, 0.856, 0.799, 0.571, 0.850, 0.790, 0.547, 0.845, 0.780,
+ 0.524, 0.839, 0.771, 0.501, 0.834, 0.762, 0.478, 0.828, 0.752, 0.455,
+ 0.823, 0.743, 0.432, 0.818, 0.734, 0.409, 0.813, 0.725, 0.385, 0.808,
+ 0.716, 0.362, 0.803, 0.707, 0.338, 0.798, 0.698, 0.314, 0.793, 0.689,
+ 0.290, 0.788, 0.680, 0.265, 0.783, 0.671, 0.239, 0.778, 0.662, 0.213,
+ 0.615, 0.655, 0.996, 0.625, 0.664, 0.991, 0.635, 0.673, 0.986, 0.646,
+ 0.683, 0.982, 0.656, 0.692, 0.977, 0.667, 0.701, 0.973, 0.678, 0.710,
+ 0.969, 0.688, 0.719, 0.966, 0.699, 0.729, 0.962, 0.710, 0.738, 0.959,
+ 0.721, 0.747, 0.956, 0.732, 0.756, 0.954, 0.744, 0.766, 0.952, 0.755,
+ 0.775, 0.950, 0.766, 0.784, 0.948, 0.778, 0.794, 0.946, 0.789, 0.804,
+ 0.945, 0.801, 0.813, 0.944, 0.813, 0.823, 0.943, 0.825, 0.833, 0.943,
+ 0.837, 0.843, 0.943, 0.849, 0.853, 0.943, 0.861, 0.863, 0.944, 0.874,
+ 0.873, 0.944, 0.886, 0.884, 0.946, 0.899, 0.895, 0.947, 0.912, 0.906,
+ 0.949, 0.926, 0.917, 0.952, 0.939, 0.928, 0.955, 0.953, 0.940, 0.958,
+ 0.967, 0.953, 0.963, 0.982, 0.966, 0.969, 0.994, 0.976, 0.972, 0.986,
+ 0.966, 0.952, 0.976, 0.953, 0.928, 0.966, 0.941, 0.903, 0.957, 0.929,
+ 0.878, 0.949, 0.918, 0.854, 0.941, 0.906, 0.830, 0.933, 0.896, 0.806,
+ 0.926, 0.885, 0.782, 0.918, 0.874, 0.758, 0.911, 0.864, 0.734, 0.905,
+ 0.854, 0.710, 0.898, 0.844, 0.686, 0.892, 0.834, 0.663, 0.885, 0.824,
+ 0.639, 0.879, 0.814, 0.616, 0.873, 0.804, 0.592, 0.867, 0.795, 0.569,
+ 0.861, 0.785, 0.546, 0.856, 0.776, 0.523, 0.850, 0.766, 0.500, 0.845,
+ 0.757, 0.477, 0.839, 0.748, 0.454, 0.834, 0.739, 0.430, 0.829, 0.729,
+ 0.407, 0.823, 0.720, 0.384, 0.818, 0.711, 0.361, 0.813, 0.702, 0.337,
+ 0.808, 0.693, 0.313, 0.803, 0.684, 0.289, 0.798, 0.675, 0.264, 0.793,
+ 0.666, 0.238, 0.788, 0.657, 0.211, 0.625, 0.651, 0.997, 0.635, 0.660,
+ 0.992, 0.645, 0.669, 0.987, 0.656, 0.679, 0.982, 0.666, 0.688, 0.978,
+ 0.676, 0.697, 0.974, 0.687, 0.706, 0.970, 0.698, 0.716, 0.966, 0.708,
+ 0.725, 0.963, 0.719, 0.734, 0.960, 0.730, 0.743, 0.957, 0.741, 0.753,
+ 0.954, 0.752, 0.762, 0.952, 0.763, 0.771, 0.950, 0.774, 0.781, 0.948,
+ 0.786, 0.790, 0.947, 0.797, 0.800, 0.945, 0.809, 0.810, 0.945, 0.820,
+ 0.819, 0.944, 0.832, 0.829, 0.943, 0.844, 0.839, 0.943, 0.856, 0.849,
+ 0.943, 0.868, 0.860, 0.944, 0.880, 0.870, 0.945, 0.893, 0.880, 0.946,
+ 0.905, 0.891, 0.947, 0.918, 0.902, 0.949, 0.931, 0.913, 0.951, 0.944,
+ 0.924, 0.954, 0.957, 0.936, 0.957, 0.971, 0.947, 0.961, 0.983, 0.958,
+ 0.964, 0.991, 0.963, 0.962, 0.990, 0.957, 0.946, 0.983, 0.946, 0.924,
+ 0.975, 0.935, 0.900, 0.967, 0.923, 0.876, 0.959, 0.912, 0.851, 0.951,
+ 0.901, 0.827, 0.943, 0.890, 0.803, 0.936, 0.880, 0.779, 0.929, 0.869,
+ 0.755, 0.922, 0.859, 0.732, 0.915, 0.849, 0.708, 0.909, 0.839, 0.684,
+ 0.902, 0.829, 0.661, 0.896, 0.819, 0.637, 0.890, 0.809, 0.614, 0.884,
+ 0.800, 0.591, 0.878, 0.790, 0.567, 0.872, 0.780, 0.544, 0.866, 0.771,
+ 0.521, 0.861, 0.762, 0.498, 0.855, 0.752, 0.475, 0.850, 0.743, 0.452,
+ 0.844, 0.734, 0.429, 0.839, 0.725, 0.406, 0.834, 0.715, 0.382, 0.828,
+ 0.706, 0.359, 0.823, 0.697, 0.335, 0.818, 0.688, 0.311, 0.813, 0.679,
+ 0.287, 0.808, 0.670, 0.262, 0.803, 0.662, 0.236, 0.798, 0.653, 0.210,
+ 0.635, 0.646, 0.998, 0.645, 0.656, 0.992, 0.655, 0.665, 0.987, 0.665,
+ 0.674, 0.983, 0.675, 0.684, 0.978, 0.685, 0.693, 0.974, 0.696, 0.702,
+ 0.970, 0.706, 0.711, 0.966, 0.717, 0.721, 0.963, 0.727, 0.730, 0.960,
+ 0.738, 0.739, 0.957, 0.749, 0.748, 0.955, 0.760, 0.758, 0.952, 0.771,
+ 0.767, 0.950, 0.782, 0.777, 0.948, 0.793, 0.786, 0.947, 0.804, 0.796,
+ 0.946, 0.816, 0.805, 0.945, 0.827, 0.815, 0.944, 0.839, 0.825, 0.943,
+ 0.850, 0.835, 0.943, 0.862, 0.845, 0.943, 0.874, 0.855, 0.943, 0.886,
+ 0.865, 0.944, 0.898, 0.875, 0.945, 0.910, 0.886, 0.946, 0.923, 0.896,
+ 0.948, 0.935, 0.907, 0.949, 0.947, 0.917, 0.951, 0.959, 0.927, 0.953,
+ 0.970, 0.937, 0.955, 0.980, 0.944, 0.955, 0.987, 0.946, 0.949, 0.989,
+ 0.942, 0.936, 0.985, 0.935, 0.916, 0.980, 0.925, 0.894, 0.973, 0.915,
+ 0.871, 0.966, 0.904, 0.847, 0.959, 0.894, 0.824, 0.952, 0.883, 0.800,
+ 0.945, 0.873, 0.776, 0.938, 0.863, 0.752, 0.932, 0.853, 0.729, 0.925,
+ 0.843, 0.705, 0.919, 0.833, 0.682, 0.912, 0.823, 0.658, 0.906, 0.813,
+ 0.635, 0.900, 0.803, 0.611, 0.894, 0.794, 0.588, 0.888, 0.784, 0.565,
+ 0.882, 0.775, 0.542, 0.876, 0.765, 0.519, 0.871, 0.756, 0.496, 0.865,
+ 0.747, 0.473, 0.859, 0.738, 0.450, 0.854, 0.728, 0.427, 0.848, 0.719,
+ 0.404, 0.843, 0.710, 0.380, 0.838, 0.701, 0.357, 0.833, 0.692, 0.333,
+ 0.827, 0.683, 0.310, 0.822, 0.674, 0.285, 0.817, 0.665, 0.260, 0.812,
+ 0.656, 0.235, 0.807, 0.648, 0.208, 0.644, 0.642, 0.998, 0.654, 0.651,
+ 0.993, 0.664, 0.660, 0.988, 0.674, 0.670, 0.983, 0.684, 0.679, 0.978,
+ 0.694, 0.688, 0.974, 0.704, 0.697, 0.970, 0.715, 0.707, 0.967, 0.725,
+ 0.716, 0.963, 0.735, 0.725, 0.960, 0.746, 0.735, 0.957, 0.757, 0.744,
+ 0.955, 0.767, 0.753, 0.952, 0.778, 0.763, 0.950, 0.789, 0.772, 0.948,
+ 0.800, 0.781, 0.947, 0.811, 0.791, 0.945, 0.822, 0.801, 0.944, 0.833,
+ 0.810, 0.943, 0.845, 0.820, 0.943, 0.856, 0.830, 0.942, 0.868, 0.839,
+ 0.942, 0.879, 0.849, 0.942, 0.891, 0.859, 0.943, 0.902, 0.869, 0.943,
+ 0.914, 0.879, 0.944, 0.926, 0.889, 0.945, 0.937, 0.899, 0.946, 0.949,
+ 0.908, 0.947, 0.959, 0.917, 0.948, 0.969, 0.924, 0.947, 0.978, 0.929,
+ 0.944, 0.984, 0.930, 0.937, 0.986, 0.927, 0.924, 0.986, 0.921, 0.907,
+ 0.982, 0.913, 0.887, 0.978, 0.904, 0.865, 0.972, 0.895, 0.842, 0.966,
+ 0.885, 0.819, 0.959, 0.875, 0.795, 0.953, 0.865, 0.772, 0.946, 0.855,
+ 0.749, 0.940, 0.846, 0.725, 0.934, 0.836, 0.702, 0.927, 0.826, 0.678,
+ 0.921, 0.816, 0.655, 0.915, 0.807, 0.632, 0.909, 0.797, 0.609, 0.903,
+ 0.788, 0.586, 0.897, 0.778, 0.562, 0.891, 0.769, 0.539, 0.886, 0.759,
+ 0.516, 0.880, 0.750, 0.493, 0.874, 0.741, 0.471, 0.869, 0.732, 0.448,
+ 0.863, 0.723, 0.425, 0.858, 0.713, 0.402, 0.852, 0.704, 0.378, 0.847,
+ 0.695, 0.355, 0.842, 0.686, 0.331, 0.836, 0.677, 0.308, 0.831, 0.669,
+ 0.283, 0.826, 0.660, 0.258, 0.821, 0.651, 0.233, 0.815, 0.642, 0.206,
+ 0.653, 0.636, 0.998, 0.663, 0.646, 0.993, 0.673, 0.655, 0.988, 0.682,
+ 0.665, 0.983, 0.692, 0.674, 0.979, 0.702, 0.683, 0.974, 0.712, 0.692,
+ 0.970, 0.722, 0.702, 0.967, 0.733, 0.711, 0.963, 0.743, 0.720, 0.960,
+ 0.753, 0.730, 0.957, 0.764, 0.739, 0.954, 0.774, 0.748, 0.952, 0.785,
+ 0.757, 0.950, 0.796, 0.767, 0.948, 0.806, 0.776, 0.946, 0.817, 0.786,
+ 0.945, 0.828, 0.795, 0.943, 0.839, 0.804, 0.942, 0.850, 0.814, 0.941,
+ 0.861, 0.824, 0.941, 0.872, 0.833, 0.940, 0.884, 0.843, 0.940, 0.895,
+ 0.852, 0.940, 0.906, 0.862, 0.940, 0.917, 0.871, 0.941, 0.928, 0.880,
+ 0.941, 0.939, 0.889, 0.941, 0.949, 0.897, 0.941, 0.959, 0.904, 0.940,
+ 0.968, 0.910, 0.938, 0.975, 0.914, 0.933, 0.981, 0.914, 0.925, 0.984,
+ 0.912, 0.913, 0.985, 0.907, 0.897, 0.983, 0.900, 0.878, 0.980, 0.893,
+ 0.857, 0.976, 0.884, 0.836, 0.971, 0.875, 0.813, 0.965, 0.866, 0.790,
+ 0.959, 0.856, 0.767, 0.954, 0.847, 0.744, 0.947, 0.837, 0.721, 0.941,
+ 0.828, 0.698, 0.935, 0.818, 0.675, 0.929, 0.809, 0.652, 0.923, 0.800,
+ 0.629, 0.917, 0.790, 0.605, 0.912, 0.781, 0.582, 0.906, 0.771, 0.560,
+ 0.900, 0.762, 0.537, 0.894, 0.753, 0.514, 0.889, 0.744, 0.491, 0.883,
+ 0.735, 0.468, 0.877, 0.725, 0.445, 0.872, 0.716, 0.422, 0.866, 0.707,
+ 0.399, 0.861, 0.698, 0.376, 0.856, 0.689, 0.353, 0.850, 0.680, 0.329,
+ 0.845, 0.672, 0.305, 0.840, 0.663, 0.281, 0.834, 0.654, 0.256, 0.829,
+ 0.645, 0.231, 0.824, 0.636, 0.204, 0.662, 0.631, 0.998, 0.672, 0.641,
+ 0.993, 0.681, 0.650, 0.988, 0.691, 0.659, 0.983, 0.700, 0.669, 0.979,
+ 0.710, 0.678, 0.974, 0.720, 0.687, 0.970, 0.730, 0.696, 0.966, 0.740,
+ 0.706, 0.963, 0.750, 0.715, 0.960, 0.760, 0.724, 0.957, 0.771, 0.733,
+ 0.954, 0.781, 0.742, 0.951, 0.791, 0.752, 0.949, 0.802, 0.761, 0.947,
+ 0.812, 0.770, 0.945, 0.823, 0.779, 0.943, 0.834, 0.789, 0.942, 0.844,
+ 0.798, 0.941, 0.855, 0.807, 0.940, 0.866, 0.817, 0.939, 0.877, 0.826,
+ 0.938, 0.887, 0.835, 0.938, 0.898, 0.844, 0.937, 0.909, 0.853, 0.937,
+ 0.919, 0.862, 0.937, 0.930, 0.870, 0.936, 0.940, 0.878, 0.936, 0.950,
+ 0.885, 0.934, 0.958, 0.891, 0.932, 0.967, 0.896, 0.928, 0.974, 0.898,
+ 0.922, 0.979, 0.899, 0.914, 0.982, 0.897, 0.902, 0.984, 0.893, 0.886,
+ 0.984, 0.887, 0.869, 0.982, 0.880, 0.849, 0.979, 0.872, 0.828, 0.975,
+ 0.864, 0.807, 0.970, 0.856, 0.785, 0.965, 0.847, 0.762, 0.959, 0.838,
+ 0.739, 0.954, 0.829, 0.717, 0.948, 0.819, 0.694, 0.943, 0.810, 0.671,
+ 0.937, 0.801, 0.648, 0.931, 0.792, 0.625, 0.925, 0.782, 0.602, 0.919,
+ 0.773, 0.579, 0.914, 0.764, 0.556, 0.908, 0.755, 0.533, 0.902, 0.746,
+ 0.511, 0.897, 0.737, 0.488, 0.891, 0.728, 0.465, 0.886, 0.719, 0.442,
+ 0.880, 0.710, 0.420, 0.875, 0.701, 0.397, 0.869, 0.692, 0.374, 0.864,
+ 0.683, 0.350, 0.858, 0.674, 0.327, 0.853, 0.665, 0.303, 0.848, 0.657,
+ 0.279, 0.842, 0.648, 0.254, 0.837, 0.639, 0.229, 0.832, 0.630, 0.202,
+ 0.671, 0.625, 0.998, 0.680, 0.635, 0.993, 0.689, 0.644, 0.988, 0.698,
+ 0.654, 0.983, 0.708, 0.663, 0.978, 0.718, 0.672, 0.974, 0.727, 0.681,
+ 0.970, 0.737, 0.691, 0.966, 0.747, 0.700, 0.962, 0.757, 0.709, 0.959,
+ 0.767, 0.718, 0.956, 0.777, 0.727, 0.953, 0.787, 0.736, 0.950, 0.797,
+ 0.745, 0.948, 0.807, 0.755, 0.946, 0.818, 0.764, 0.944, 0.828, 0.773,
+ 0.942, 0.839, 0.782, 0.940, 0.849, 0.791, 0.939, 0.859, 0.800, 0.938,
+ 0.870, 0.809, 0.937, 0.880, 0.818, 0.936, 0.891, 0.827, 0.935, 0.901,
+ 0.835, 0.934, 0.911, 0.844, 0.933, 0.921, 0.852, 0.932, 0.931, 0.859,
+ 0.931, 0.941, 0.866, 0.929, 0.950, 0.873, 0.927, 0.958, 0.878, 0.923,
+ 0.966, 0.881, 0.919, 0.972, 0.883, 0.912, 0.977, 0.883, 0.903, 0.981,
+ 0.882, 0.891, 0.983, 0.878, 0.876, 0.984, 0.873, 0.859, 0.983, 0.867,
+ 0.841, 0.980, 0.860, 0.821, 0.977, 0.853, 0.800, 0.974, 0.845, 0.778,
+ 0.969, 0.836, 0.756, 0.964, 0.828, 0.734, 0.959, 0.819, 0.712, 0.954,
+ 0.810, 0.689, 0.949, 0.801, 0.666, 0.943, 0.792, 0.644, 0.938, 0.783,
+ 0.621, 0.932, 0.774, 0.598, 0.927, 0.765, 0.575, 0.921, 0.756, 0.553,
+ 0.916, 0.747, 0.530, 0.910, 0.738, 0.507, 0.904, 0.729, 0.485, 0.899,
+ 0.721, 0.462, 0.893, 0.712, 0.439, 0.888, 0.703, 0.417, 0.882, 0.694,
+ 0.394, 0.877, 0.685, 0.371, 0.871, 0.676, 0.348, 0.866, 0.668, 0.324,
+ 0.861, 0.659, 0.301, 0.855, 0.650, 0.277, 0.850, 0.641, 0.252, 0.845,
+ 0.633, 0.226, 0.839, 0.624, 0.200, 0.679, 0.619, 0.998, 0.688, 0.629,
+ 0.993, 0.697, 0.638, 0.988, 0.706, 0.648, 0.983, 0.715, 0.657, 0.978,
+ 0.725, 0.666, 0.974, 0.734, 0.675, 0.969, 0.744, 0.684, 0.965, 0.754,
+ 0.693, 0.962, 0.763, 0.703, 0.958, 0.773, 0.712, 0.955, 0.783, 0.721,
+ 0.952, 0.793, 0.730, 0.949, 0.803, 0.739, 0.947, 0.813, 0.748, 0.944,
+ 0.823, 0.757, 0.942, 0.833, 0.766, 0.940, 0.843, 0.774, 0.938, 0.853,
+ 0.783, 0.937, 0.863, 0.792, 0.935, 0.874, 0.801, 0.934, 0.884, 0.809,
+ 0.932, 0.894, 0.818, 0.931, 0.904, 0.826, 0.930, 0.913, 0.833, 0.928,
+ 0.923, 0.841, 0.927, 0.932, 0.848, 0.925, 0.941, 0.854, 0.922, 0.950,
+ 0.859, 0.919, 0.957, 0.864, 0.915, 0.965, 0.867, 0.909, 0.971, 0.868,
+ 0.901, 0.976, 0.868, 0.892, 0.980, 0.867, 0.880, 0.982, 0.863, 0.866,
+ 0.983, 0.859, 0.849, 0.983, 0.854, 0.832, 0.982, 0.847, 0.812, 0.979,
+ 0.840, 0.792, 0.976, 0.833, 0.771, 0.973, 0.825, 0.750, 0.969, 0.817,
+ 0.728, 0.964, 0.809, 0.706, 0.959, 0.800, 0.684, 0.954, 0.792, 0.661,
+ 0.949, 0.783, 0.639, 0.944, 0.774, 0.617, 0.939, 0.766, 0.594, 0.933,
+ 0.757, 0.572, 0.928, 0.748, 0.549, 0.922, 0.739, 0.527, 0.917, 0.731,
+ 0.504, 0.911, 0.722, 0.481, 0.906, 0.713, 0.459, 0.901, 0.704, 0.436,
+ 0.895, 0.695, 0.414, 0.890, 0.687, 0.391, 0.884, 0.678, 0.368, 0.879,
+ 0.669, 0.345, 0.873, 0.661, 0.322, 0.868, 0.652, 0.298, 0.863, 0.643,
+ 0.274, 0.857, 0.635, 0.249, 0.852, 0.626, 0.224, 0.846, 0.617, 0.197,
+ 0.686, 0.613, 0.998, 0.695, 0.622, 0.993, 0.704, 0.632, 0.987, 0.713,
+ 0.641, 0.982, 0.722, 0.650, 0.977, 0.732, 0.660, 0.973, 0.741, 0.669,
+ 0.969, 0.750, 0.678, 0.965, 0.760, 0.687, 0.961, 0.769, 0.696, 0.957,
+ 0.779, 0.705, 0.954, 0.789, 0.714, 0.951, 0.798, 0.723, 0.948, 0.808,
+ 0.731, 0.945, 0.818, 0.740, 0.943, 0.828, 0.749, 0.940, 0.838, 0.758,
+ 0.938, 0.847, 0.766, 0.936, 0.857, 0.775, 0.934, 0.867, 0.783, 0.932,
+ 0.877, 0.792, 0.930, 0.887, 0.800, 0.929, 0.896, 0.808, 0.927, 0.906,
+ 0.815, 0.925, 0.915, 0.823, 0.923, 0.924, 0.829, 0.921, 0.933, 0.836,
+ 0.918, 0.942, 0.841, 0.915, 0.950, 0.846, 0.911, 0.957, 0.850, 0.906,
+ 0.964, 0.852, 0.899, 0.970, 0.853, 0.891, 0.975, 0.853, 0.881, 0.979,
+ 0.852, 0.869, 0.981, 0.849, 0.855, 0.983, 0.845, 0.840, 0.983, 0.840,
+ 0.822, 0.982, 0.834, 0.804, 0.981, 0.828, 0.784, 0.978, 0.821, 0.764,
+ 0.975, 0.814, 0.743, 0.972, 0.806, 0.722, 0.968, 0.798, 0.700, 0.964,
+ 0.790, 0.678, 0.959, 0.782, 0.656, 0.954, 0.773, 0.634, 0.949, 0.765,
+ 0.612, 0.944, 0.757, 0.590, 0.939, 0.748, 0.567, 0.934, 0.739, 0.545,
+ 0.929, 0.731, 0.523, 0.923, 0.722, 0.500, 0.918, 0.714, 0.478, 0.913,
+ 0.705, 0.456, 0.907, 0.696, 0.433, 0.902, 0.688, 0.411, 0.896, 0.679,
+ 0.388, 0.891, 0.670, 0.365, 0.886, 0.662, 0.342, 0.880, 0.653, 0.319,
+ 0.875, 0.645, 0.295, 0.869, 0.636, 0.271, 0.864, 0.628, 0.247, 0.859,
+ 0.619, 0.221, 0.853, 0.611, 0.195, 0.694, 0.606, 0.998, 0.703, 0.616,
+ 0.992, 0.711, 0.625, 0.987, 0.720, 0.634, 0.982, 0.729, 0.644, 0.977,
+ 0.738, 0.653, 0.972, 0.747, 0.662, 0.968, 0.757, 0.671, 0.964, 0.766,
+ 0.680, 0.960, 0.775, 0.689, 0.956, 0.785, 0.698, 0.953, 0.794, 0.706,
+ 0.949, 0.804, 0.715, 0.946, 0.813, 0.724, 0.943, 0.823, 0.732, 0.941,
+ 0.832, 0.741, 0.938, 0.842, 0.749, 0.936, 0.851, 0.758, 0.933, 0.861,
+ 0.766, 0.931, 0.870, 0.774, 0.929, 0.880, 0.782, 0.927, 0.889, 0.790,
+ 0.924, 0.899, 0.797, 0.922, 0.908, 0.805, 0.920, 0.917, 0.811, 0.917,
+ 0.925, 0.818, 0.914, 0.934, 0.823, 0.911, 0.942, 0.828, 0.907, 0.950,
+ 0.832, 0.902, 0.957, 0.836, 0.896, 0.963, 0.838, 0.889, 0.969, 0.839,
+ 0.881, 0.974, 0.838, 0.871, 0.978, 0.837, 0.859, 0.980, 0.834, 0.845,
+ 0.982, 0.831, 0.830, 0.983, 0.826, 0.813, 0.983, 0.821, 0.795, 0.982,
+ 0.815, 0.776, 0.980, 0.809, 0.757, 0.978, 0.802, 0.736, 0.975, 0.794,
+ 0.715, 0.971, 0.787, 0.694, 0.967, 0.779, 0.673, 0.963, 0.771, 0.651,
+ 0.959, 0.763, 0.629, 0.954, 0.755, 0.607, 0.949, 0.747, 0.585, 0.944,
+ 0.739, 0.563, 0.939, 0.730, 0.541, 0.934, 0.722, 0.519, 0.929, 0.714,
+ 0.496, 0.924, 0.705, 0.474, 0.919, 0.697, 0.452, 0.913, 0.688, 0.430,
+ 0.908, 0.680, 0.407, 0.903, 0.671, 0.385, 0.897, 0.663, 0.362, 0.892,
+ 0.654, 0.339, 0.887, 0.646, 0.316, 0.881, 0.637, 0.293, 0.876, 0.629,
+ 0.269, 0.870, 0.620, 0.244, 0.865, 0.612, 0.219, 0.860, 0.604, 0.192,
+ 0.701, 0.599, 0.997, 0.710, 0.609, 0.992, 0.718, 0.618, 0.986, 0.727,
+ 0.627, 0.981, 0.736, 0.636, 0.976, 0.745, 0.645, 0.971, 0.754, 0.655,
+ 0.967, 0.763, 0.663, 0.963, 0.772, 0.672, 0.959, 0.781, 0.681, 0.955,
+ 0.790, 0.690, 0.951, 0.799, 0.699, 0.948, 0.808, 0.707, 0.944, 0.818,
+ 0.716, 0.941, 0.827, 0.724, 0.938, 0.836, 0.732, 0.935, 0.846, 0.741,
+ 0.933, 0.855, 0.749, 0.930, 0.864, 0.757, 0.928, 0.874, 0.765, 0.925,
+ 0.883, 0.772, 0.923, 0.892, 0.780, 0.920, 0.901, 0.787, 0.917, 0.910,
+ 0.793, 0.914, 0.918, 0.800, 0.911, 0.927, 0.805, 0.908, 0.935, 0.811,
+ 0.904, 0.942, 0.815, 0.899, 0.950, 0.819, 0.894, 0.956, 0.821, 0.887,
+ 0.963, 0.823, 0.880, 0.968, 0.824, 0.871, 0.973, 0.824, 0.860, 0.977,
+ 0.822, 0.849, 0.980, 0.820, 0.835, 0.982, 0.817, 0.820, 0.983, 0.812,
+ 0.804, 0.983, 0.808, 0.786, 0.983, 0.802, 0.768, 0.981, 0.796, 0.749,
+ 0.979, 0.789, 0.729, 0.977, 0.783, 0.709, 0.974, 0.776, 0.688, 0.970,
+ 0.768, 0.667, 0.967, 0.761, 0.645, 0.963, 0.753, 0.624, 0.958, 0.745,
+ 0.602, 0.954, 0.737, 0.580, 0.949, 0.729, 0.558, 0.944, 0.721, 0.536,
+ 0.939, 0.713, 0.514, 0.934, 0.704, 0.492, 0.929, 0.696, 0.470, 0.924,
+ 0.688, 0.448, 0.919, 0.680, 0.426, 0.914, 0.671, 0.404, 0.908, 0.663,
+ 0.381, 0.903, 0.655, 0.359, 0.898, 0.646, 0.336, 0.893, 0.638, 0.313,
+ 0.887, 0.629, 0.290, 0.882, 0.621, 0.266, 0.876, 0.613, 0.241, 0.871,
+ 0.604, 0.216, 0.866, 0.596, 0.189, 0.708, 0.592, 0.997, 0.716, 0.601,
+ 0.991, 0.725, 0.611, 0.985, 0.733, 0.620, 0.980, 0.742, 0.629, 0.975,
+ 0.751, 0.638, 0.970, 0.759, 0.647, 0.966, 0.768, 0.656, 0.961, 0.777,
+ 0.665, 0.957, 0.786, 0.673, 0.953, 0.795, 0.682, 0.949, 0.804, 0.690,
+ 0.946, 0.813, 0.699, 0.942, 0.822, 0.707, 0.939, 0.831, 0.715, 0.936,
+ 0.840, 0.723, 0.933, 0.849, 0.731, 0.930, 0.859, 0.739, 0.927, 0.868,
+ 0.747, 0.924, 0.876, 0.754, 0.921, 0.885, 0.762, 0.918, 0.894, 0.769,
+ 0.915, 0.903, 0.775, 0.912, 0.911, 0.782, 0.909, 0.920, 0.787, 0.905,
+ 0.928, 0.793, 0.901, 0.935, 0.798, 0.896, 0.943, 0.802, 0.891, 0.950,
+ 0.805, 0.885, 0.956, 0.807, 0.878, 0.962, 0.809, 0.870, 0.967, 0.809,
+ 0.861, 0.972, 0.809, 0.850, 0.976, 0.808, 0.838, 0.979, 0.805, 0.825,
+ 0.981, 0.802, 0.810, 0.983, 0.799, 0.795, 0.983, 0.794, 0.778, 0.983,
+ 0.789, 0.760, 0.982, 0.783, 0.741, 0.981, 0.777, 0.721, 0.979, 0.771,
+ 0.701, 0.976, 0.764, 0.681, 0.973, 0.757, 0.660, 0.970, 0.750, 0.639,
+ 0.966, 0.742, 0.618, 0.962, 0.735, 0.597, 0.958, 0.727, 0.575, 0.953,
+ 0.719, 0.553, 0.949, 0.711, 0.532, 0.944, 0.703, 0.510, 0.939, 0.695,
+ 0.488, 0.934, 0.687, 0.466, 0.929, 0.679, 0.444, 0.924, 0.671, 0.422,
+ 0.919, 0.663, 0.400, 0.914, 0.654, 0.378, 0.909, 0.646, 0.355, 0.903,
+ 0.638, 0.333, 0.898, 0.630, 0.310, 0.893, 0.621, 0.287, 0.887, 0.613,
+ 0.263, 0.882, 0.605, 0.238, 0.877, 0.597, 0.213, 0.871, 0.589, 0.186,
+ 0.715, 0.584, 0.996, 0.723, 0.593, 0.990, 0.731, 0.603, 0.984, 0.739,
+ 0.612, 0.979, 0.748, 0.621, 0.974, 0.756, 0.630, 0.969, 0.765, 0.639,
+ 0.964, 0.774, 0.648, 0.960, 0.782, 0.656, 0.955, 0.791, 0.665, 0.951,
+ 0.800, 0.673, 0.947, 0.809, 0.682, 0.943, 0.818, 0.690, 0.940, 0.826,
+ 0.698, 0.936, 0.835, 0.706, 0.933, 0.844, 0.714, 0.930, 0.853, 0.722,
+ 0.926, 0.862, 0.729, 0.923, 0.871, 0.737, 0.920, 0.879, 0.744, 0.917,
+ 0.888, 0.751, 0.913, 0.896, 0.758, 0.910, 0.905, 0.764, 0.906, 0.913,
+ 0.770, 0.903, 0.921, 0.775, 0.898, 0.929, 0.780, 0.894, 0.936, 0.784,
+ 0.889, 0.943, 0.788, 0.883, 0.950, 0.791, 0.877, 0.956, 0.793, 0.869,
+ 0.962, 0.794, 0.861, 0.967, 0.795, 0.851, 0.971, 0.794, 0.841, 0.975,
+ 0.793, 0.829, 0.978, 0.791, 0.815, 0.981, 0.788, 0.801, 0.982, 0.785,
+ 0.785, 0.983, 0.780, 0.769, 0.983, 0.776, 0.751, 0.983, 0.770, 0.733,
+ 0.982, 0.764, 0.714, 0.980, 0.758, 0.694, 0.978, 0.752, 0.674, 0.975,
+ 0.745, 0.654, 0.972, 0.738, 0.633, 0.969, 0.731, 0.612, 0.965, 0.724,
+ 0.591, 0.961, 0.716, 0.570, 0.957, 0.709, 0.548, 0.953, 0.701, 0.527,
+ 0.948, 0.693, 0.505, 0.943, 0.685, 0.484, 0.939, 0.678, 0.462, 0.934,
+ 0.670, 0.440, 0.929, 0.662, 0.418, 0.924, 0.654, 0.396, 0.919, 0.646,
+ 0.374, 0.914, 0.637, 0.352, 0.908, 0.629, 0.329, 0.903, 0.621, 0.307,
+ 0.898, 0.613, 0.283, 0.893, 0.605, 0.260, 0.887, 0.597, 0.235, 0.882,
+ 0.589, 0.210, 0.876, 0.581, 0.183, 0.721, 0.576, 0.995, 0.729, 0.585,
+ 0.989, 0.737, 0.595, 0.983, 0.745, 0.604, 0.978, 0.754, 0.613, 0.973,
+ 0.762, 0.622, 0.968, 0.770, 0.631, 0.963, 0.779, 0.639, 0.958, 0.787,
+ 0.648, 0.954, 0.796, 0.656, 0.949, 0.805, 0.665, 0.945, 0.813, 0.673,
+ 0.941, 0.822, 0.681, 0.937, 0.830, 0.689, 0.933, 0.839, 0.697, 0.930,
+ 0.848, 0.704, 0.926, 0.856, 0.712, 0.923, 0.865, 0.719, 0.919, 0.873,
+ 0.726, 0.916, 0.882, 0.733, 0.912, 0.890, 0.740, 0.908, 0.898, 0.746,
+ 0.905, 0.906, 0.752, 0.901, 0.914, 0.757, 0.896, 0.922, 0.762, 0.892,
+ 0.929, 0.767, 0.887, 0.937, 0.771, 0.881, 0.943, 0.774, 0.875, 0.950,
+ 0.777, 0.868, 0.956, 0.779, 0.860, 0.961, 0.780, 0.851, 0.966, 0.780,
+ 0.842, 0.971, 0.780, 0.831, 0.975, 0.779, 0.819, 0.978, 0.777, 0.806,
+ 0.980, 0.774, 0.791, 0.982, 0.771, 0.776, 0.983, 0.767, 0.760, 0.984,
+ 0.762, 0.742, 0.983, 0.757, 0.725, 0.983, 0.752, 0.706, 0.981, 0.746,
+ 0.687, 0.979, 0.740, 0.667, 0.977, 0.733, 0.647, 0.974, 0.727, 0.627,
+ 0.971, 0.720, 0.606, 0.968, 0.713, 0.585, 0.964, 0.706, 0.564, 0.960,
+ 0.698, 0.543, 0.956, 0.691, 0.522, 0.952, 0.683, 0.501, 0.947, 0.676,
+ 0.479, 0.943, 0.668, 0.458, 0.938, 0.660, 0.436, 0.933, 0.652, 0.414,
+ 0.928, 0.644, 0.392, 0.923, 0.636, 0.370, 0.918, 0.629, 0.348, 0.913,
+ 0.621, 0.326, 0.908, 0.613, 0.303, 0.903, 0.605, 0.280, 0.897, 0.597,
+ 0.257, 0.892, 0.589, 0.232, 0.887, 0.581, 0.207, 0.881, 0.573, 0.180,
+ 0.727, 0.568, 0.994, 0.735, 0.577, 0.988, 0.743, 0.586, 0.982, 0.751,
+ 0.595, 0.977, 0.759, 0.604, 0.971, 0.767, 0.613, 0.966, 0.776, 0.622,
+ 0.961, 0.784, 0.630, 0.956, 0.792, 0.639, 0.951, 0.801, 0.647, 0.947,
+ 0.809, 0.655, 0.943, 0.817, 0.663, 0.938, 0.826, 0.671, 0.934, 0.834,
+ 0.679, 0.930, 0.843, 0.687, 0.927, 0.851, 0.694, 0.923, 0.859, 0.702,
+ 0.919, 0.868, 0.709, 0.915, 0.876, 0.715, 0.911, 0.884, 0.722, 0.907,
+ 0.892, 0.728, 0.903, 0.900, 0.734, 0.899, 0.908, 0.740, 0.895, 0.916,
+ 0.745, 0.890, 0.923, 0.750, 0.885, 0.930, 0.754, 0.879, 0.937, 0.758,
+ 0.873, 0.944, 0.761, 0.867, 0.950, 0.763, 0.859, 0.956, 0.765, 0.851,
+ 0.961, 0.766, 0.842, 0.966, 0.766, 0.832, 0.970, 0.766, 0.821, 0.974,
+ 0.764, 0.809, 0.977, 0.762, 0.796, 0.980, 0.760, 0.782, 0.982, 0.757,
+ 0.767, 0.983, 0.753, 0.751, 0.984, 0.749, 0.734, 0.984, 0.744, 0.716,
+ 0.983, 0.739, 0.698, 0.982, 0.733, 0.679, 0.980, 0.727, 0.660, 0.978,
+ 0.721, 0.640, 0.976, 0.715, 0.620, 0.973, 0.708, 0.600, 0.970, 0.701,
+ 0.579, 0.967, 0.694, 0.559, 0.963, 0.687, 0.538, 0.959, 0.680, 0.517,
+ 0.955, 0.673, 0.496, 0.951, 0.665, 0.474, 0.946, 0.658, 0.453, 0.942,
+ 0.650, 0.432, 0.937, 0.643, 0.410, 0.932, 0.635, 0.388, 0.927, 0.627,
+ 0.367, 0.922, 0.619, 0.345, 0.917, 0.612, 0.322, 0.912, 0.604, 0.300,
+ 0.907, 0.596, 0.277, 0.902, 0.588, 0.253, 0.897, 0.580, 0.229, 0.891,
+ 0.572, 0.204, 0.886, 0.564, 0.177, 0.733, 0.559, 0.993, 0.741, 0.568,
+ 0.987, 0.749, 0.577, 0.981, 0.757, 0.587, 0.975, 0.765, 0.595, 0.970,
+ 0.773, 0.604, 0.964, 0.781, 0.613, 0.959, 0.789, 0.621, 0.954, 0.797,
+ 0.630, 0.949, 0.805, 0.638, 0.945, 0.813, 0.646, 0.940, 0.821, 0.654,
+ 0.936, 0.830, 0.662, 0.931, 0.838, 0.669, 0.927, 0.846, 0.677, 0.923,
+ 0.854, 0.684, 0.919, 0.862, 0.691, 0.915, 0.870, 0.698, 0.911, 0.879,
+ 0.704, 0.907, 0.886, 0.711, 0.902, 0.894, 0.717, 0.898, 0.902, 0.722,
+ 0.893, 0.910, 0.727, 0.889, 0.917, 0.732, 0.883, 0.924, 0.737, 0.878,
+ 0.931, 0.741, 0.872, 0.938, 0.744, 0.866, 0.944, 0.747, 0.859, 0.950,
+ 0.749, 0.851, 0.956, 0.751, 0.842, 0.961, 0.751, 0.833, 0.966, 0.752,
+ 0.823, 0.970, 0.751, 0.812, 0.974, 0.750, 0.800, 0.977, 0.748, 0.787,
+ 0.979, 0.746, 0.773, 0.981, 0.743, 0.758, 0.983, 0.739, 0.742, 0.984,
+ 0.735, 0.725, 0.984, 0.731, 0.708, 0.983, 0.726, 0.690, 0.983, 0.721,
+ 0.672, 0.981, 0.715, 0.653, 0.980, 0.709, 0.633, 0.977, 0.703, 0.614,
+ 0.975, 0.697, 0.594, 0.972, 0.690, 0.573, 0.969, 0.683, 0.553, 0.965,
+ 0.676, 0.532, 0.962, 0.669, 0.512, 0.958, 0.662, 0.491, 0.954, 0.655,
+ 0.470, 0.949, 0.648, 0.448, 0.945, 0.640, 0.427, 0.941, 0.633, 0.406,
+ 0.936, 0.625, 0.384, 0.931, 0.618, 0.363, 0.926, 0.610, 0.341, 0.921,
+ 0.602, 0.319, 0.916, 0.595, 0.296, 0.911, 0.587, 0.273, 0.906, 0.579,
+ 0.250, 0.901, 0.571, 0.226, 0.896, 0.563, 0.201, 0.890, 0.556, 0.174,
+ 0.739, 0.550, 0.992, 0.747, 0.559, 0.986, 0.754, 0.568, 0.980, 0.762,
+ 0.577, 0.974, 0.770, 0.586, 0.968, 0.778, 0.595, 0.962, 0.785, 0.603,
+ 0.957, 0.793, 0.612, 0.952, 0.801, 0.620, 0.947, 0.809, 0.628, 0.942,
+ 0.817, 0.636, 0.937, 0.825, 0.644, 0.933, 0.833, 0.651, 0.928, 0.841,
+ 0.659, 0.924, 0.849, 0.666, 0.919, 0.857, 0.673, 0.915, 0.865, 0.680,
+ 0.911, 0.873, 0.686, 0.906, 0.881, 0.693, 0.902, 0.889, 0.699, 0.897,
+ 0.896, 0.705, 0.892, 0.904, 0.710, 0.887, 0.911, 0.715, 0.882, 0.918,
+ 0.720, 0.877, 0.925, 0.724, 0.871, 0.932, 0.727, 0.865, 0.938, 0.730,
+ 0.858, 0.944, 0.733, 0.850, 0.950, 0.735, 0.842, 0.956, 0.736, 0.834,
+ 0.961, 0.737, 0.824, 0.965, 0.737, 0.814, 0.970, 0.737, 0.802, 0.973,
+ 0.736, 0.790, 0.976, 0.734, 0.777, 0.979, 0.732, 0.763, 0.981, 0.729,
+ 0.749, 0.982, 0.726, 0.733, 0.983, 0.722, 0.717, 0.984, 0.717, 0.700,
+ 0.984, 0.713, 0.682, 0.983, 0.708, 0.664, 0.982, 0.702, 0.645, 0.980,
+ 0.697, 0.626, 0.979, 0.691, 0.607, 0.976, 0.685, 0.587, 0.974, 0.678,
+ 0.567, 0.971, 0.672, 0.547, 0.967, 0.665, 0.527, 0.964, 0.658, 0.506,
+ 0.960, 0.651, 0.485, 0.956, 0.644, 0.465, 0.952, 0.637, 0.444, 0.948,
+ 0.630, 0.423, 0.944, 0.623, 0.401, 0.939, 0.615, 0.380, 0.934, 0.608,
+ 0.358, 0.930, 0.600, 0.337, 0.925, 0.593, 0.315, 0.920, 0.585, 0.292,
+ 0.915, 0.578, 0.270, 0.910, 0.570, 0.246, 0.905, 0.562, 0.222, 0.899,
+ 0.555, 0.197, 0.894, 0.547, 0.171, 0.745, 0.540, 0.991, 0.752, 0.550,
+ 0.984, 0.760, 0.559, 0.978, 0.767, 0.568, 0.972, 0.775, 0.577, 0.966,
+ 0.782, 0.585, 0.960, 0.790, 0.594, 0.955, 0.798, 0.602, 0.950, 0.806,
+ 0.610, 0.944, 0.813, 0.618, 0.939, 0.821, 0.626, 0.934, 0.829, 0.634,
+ 0.930, 0.837, 0.641, 0.925, 0.845, 0.648, 0.920, 0.852, 0.655, 0.915,
+ 0.860, 0.662, 0.911, 0.868, 0.669, 0.906, 0.876, 0.675, 0.901, 0.883,
+ 0.681, 0.897, 0.891, 0.687, 0.892, 0.898, 0.692, 0.887, 0.905, 0.697,
+ 0.881, 0.912, 0.702, 0.876, 0.919, 0.707, 0.870, 0.926, 0.710, 0.864,
+ 0.932, 0.714, 0.857, 0.939, 0.717, 0.850, 0.945, 0.719, 0.842, 0.950,
+ 0.721, 0.834, 0.956, 0.722, 0.825, 0.961, 0.723, 0.815, 0.965, 0.723,
+ 0.804, 0.969, 0.723, 0.793, 0.973, 0.722, 0.781, 0.976, 0.720, 0.768,
+ 0.978, 0.718, 0.754, 0.981, 0.715, 0.739, 0.982, 0.712, 0.724, 0.983,
+ 0.708, 0.708, 0.984, 0.704, 0.691, 0.984, 0.700, 0.674, 0.983, 0.695,
+ 0.656, 0.982, 0.690, 0.638, 0.981, 0.684, 0.619, 0.979, 0.679, 0.600,
+ 0.977, 0.673, 0.581, 0.975, 0.666, 0.561, 0.972, 0.660, 0.541, 0.969,
+ 0.654, 0.521, 0.966, 0.647, 0.501, 0.962, 0.640, 0.480, 0.959, 0.634,
+ 0.459, 0.955, 0.627, 0.439, 0.951, 0.620, 0.418, 0.946, 0.612, 0.397,
+ 0.942, 0.605, 0.376, 0.937, 0.598, 0.354, 0.933, 0.591, 0.333, 0.928,
+ 0.583, 0.311, 0.923, 0.576, 0.289, 0.918, 0.568, 0.266, 0.913, 0.561,
+ 0.243, 0.908, 0.553, 0.219, 0.903, 0.546, 0.194, 0.898, 0.538, 0.167,
+ 0.750, 0.531, 0.989, 0.757, 0.540, 0.983, 0.765, 0.549, 0.976, 0.772,
+ 0.558, 0.970, 0.779, 0.567, 0.964, 0.787, 0.575, 0.958, 0.794, 0.584,
+ 0.953, 0.802, 0.592, 0.947, 0.810, 0.600, 0.942, 0.817, 0.608, 0.936,
+ 0.825, 0.615, 0.931, 0.833, 0.623, 0.926, 0.840, 0.630, 0.921, 0.848,
+ 0.637, 0.916, 0.855, 0.644, 0.911, 0.863, 0.651, 0.907, 0.870, 0.657,
+ 0.902, 0.878, 0.663, 0.897, 0.885, 0.669, 0.891, 0.893, 0.675, 0.886,
+ 0.900, 0.680, 0.881, 0.907, 0.685, 0.875, 0.914, 0.689, 0.869, 0.920,
+ 0.693, 0.863, 0.927, 0.697, 0.857, 0.933, 0.700, 0.850, 0.939, 0.703,
+ 0.842, 0.945, 0.705, 0.834, 0.950, 0.707, 0.825, 0.956, 0.708, 0.816,
+ 0.960, 0.709, 0.806, 0.965, 0.709, 0.795, 0.969, 0.708, 0.784, 0.972,
+ 0.707, 0.772, 0.975, 0.706, 0.759, 0.978, 0.704, 0.745, 0.980, 0.701,
+ 0.731, 0.982, 0.698, 0.715, 0.983, 0.694, 0.699, 0.984, 0.691, 0.683,
+ 0.984, 0.686, 0.666, 0.983, 0.682, 0.648, 0.983, 0.677, 0.630, 0.982,
+ 0.672, 0.612, 0.980, 0.666, 0.593, 0.978, 0.660, 0.574, 0.976, 0.655,
+ 0.554, 0.973, 0.648, 0.535, 0.971, 0.642, 0.515, 0.967, 0.636, 0.495,
+ 0.964, 0.629, 0.475, 0.961, 0.623, 0.454, 0.957, 0.616, 0.434, 0.953,
+ 0.609, 0.413, 0.949, 0.602, 0.392, 0.944, 0.595, 0.371, 0.940, 0.588,
+ 0.350, 0.936, 0.580, 0.328, 0.931, 0.573, 0.307, 0.926, 0.566, 0.285,
+ 0.921, 0.559, 0.262, 0.916, 0.551, 0.239, 0.911, 0.544, 0.215, 0.906,
+ 0.536, 0.190, 0.901, 0.529, 0.164, 0.755, 0.521, 0.988, 0.762, 0.530,
+ 0.981, 0.770, 0.539, 0.975, 0.777, 0.548, 0.968, 0.784, 0.557, 0.962,
+ 0.791, 0.565, 0.956, 0.799, 0.573, 0.950, 0.806, 0.582, 0.944, 0.814,
+ 0.589, 0.939, 0.821, 0.597, 0.933, 0.828, 0.605, 0.928, 0.836, 0.612,
+ 0.923, 0.843, 0.619, 0.918, 0.851, 0.626, 0.912, 0.858, 0.633, 0.907,
+ 0.866, 0.639, 0.902, 0.873, 0.645, 0.897, 0.880, 0.651, 0.892, 0.887,
+ 0.657, 0.886, 0.894, 0.662, 0.881, 0.901, 0.667, 0.875, 0.908, 0.672,
+ 0.869, 0.915, 0.676, 0.863, 0.921, 0.680, 0.856, 0.928, 0.684, 0.849,
+ 0.934, 0.687, 0.842, 0.940, 0.689, 0.834, 0.945, 0.691, 0.826, 0.951,
+ 0.693, 0.817, 0.956, 0.694, 0.807, 0.960, 0.695, 0.797, 0.964, 0.695,
+ 0.787, 0.968, 0.694, 0.775, 0.972, 0.693, 0.763, 0.975, 0.692, 0.750,
+ 0.977, 0.690, 0.736, 0.980, 0.687, 0.722, 0.981, 0.684, 0.707, 0.982,
+ 0.681, 0.691, 0.983, 0.677, 0.675, 0.984, 0.673, 0.658, 0.983, 0.669,
+ 0.641, 0.983, 0.664, 0.623, 0.982, 0.659, 0.605, 0.980, 0.654, 0.586,
+ 0.979, 0.648, 0.567, 0.977, 0.642, 0.548, 0.974, 0.637, 0.529, 0.972,
+ 0.630, 0.509, 0.969, 0.624, 0.489, 0.966, 0.618, 0.469, 0.962, 0.611,
+ 0.449, 0.959, 0.605, 0.429, 0.955, 0.598, 0.408, 0.951, 0.591, 0.387,
+ 0.947, 0.584, 0.367, 0.942, 0.577, 0.346, 0.938, 0.570, 0.324, 0.933,
+ 0.563, 0.303, 0.929, 0.556, 0.281, 0.924, 0.549, 0.258, 0.919, 0.541,
+ 0.235, 0.914, 0.534, 0.212, 0.909, 0.527, 0.187, 0.904, 0.519, 0.160,
+ 0.760, 0.510, 0.986, 0.767, 0.520, 0.979, 0.774, 0.529, 0.973, 0.781,
+ 0.538, 0.966, 0.788, 0.546, 0.960, 0.796, 0.555, 0.954, 0.803, 0.563,
+ 0.948, 0.810, 0.571, 0.942, 0.817, 0.579, 0.936, 0.825, 0.586, 0.930,
+ 0.832, 0.594, 0.925, 0.839, 0.601, 0.919, 0.846, 0.608, 0.914, 0.854,
+ 0.615, 0.908, 0.861, 0.621, 0.903, 0.868, 0.627, 0.897, 0.875, 0.633,
+ 0.892, 0.882, 0.639, 0.886, 0.889, 0.645, 0.881, 0.896, 0.650, 0.875,
+ 0.903, 0.655, 0.869, 0.909, 0.659, 0.863, 0.916, 0.663, 0.856, 0.922,
+ 0.667, 0.849, 0.928, 0.670, 0.842, 0.934, 0.673, 0.834, 0.940, 0.675,
+ 0.826, 0.945, 0.677, 0.818, 0.951, 0.679, 0.809, 0.955, 0.680, 0.799,
+ 0.960, 0.680, 0.789, 0.964, 0.680, 0.778, 0.968, 0.680, 0.766, 0.971,
+ 0.679, 0.754, 0.974, 0.677, 0.741, 0.977, 0.676, 0.727, 0.979, 0.673,
+ 0.713, 0.981, 0.670, 0.698, 0.982, 0.667, 0.682, 0.983, 0.664, 0.666,
+ 0.983, 0.660, 0.650, 0.983, 0.655, 0.633, 0.983, 0.651, 0.615, 0.982,
+ 0.646, 0.597, 0.981, 0.641, 0.579, 0.979, 0.636, 0.560, 0.977, 0.630,
+ 0.541, 0.975, 0.625, 0.522, 0.973, 0.619, 0.503, 0.970, 0.613, 0.483,
+ 0.967, 0.606, 0.463, 0.964, 0.600, 0.443, 0.960, 0.594, 0.423, 0.956,
+ 0.587, 0.403, 0.953, 0.580, 0.383, 0.949, 0.574, 0.362, 0.944, 0.567,
+ 0.341, 0.940, 0.560, 0.320, 0.936, 0.553, 0.298, 0.931, 0.546, 0.277,
+ 0.926, 0.539, 0.254, 0.922, 0.532, 0.232, 0.917, 0.524, 0.208, 0.912,
+ 0.517, 0.183, 0.906, 0.510, 0.156, 0.765, 0.499, 0.985, 0.772, 0.509,
+ 0.978, 0.779, 0.518, 0.971, 0.786, 0.527, 0.964, 0.793, 0.535, 0.957,
+ 0.800, 0.544, 0.951, 0.807, 0.552, 0.945, 0.814, 0.560, 0.939, 0.821,
+ 0.568, 0.933, 0.828, 0.575, 0.927, 0.835, 0.582, 0.921, 0.842, 0.589,
+ 0.915, 0.849, 0.596, 0.910, 0.856, 0.603, 0.904, 0.863, 0.609, 0.898,
+ 0.870, 0.615, 0.893, 0.877, 0.621, 0.887, 0.884, 0.627, 0.881, 0.891,
+ 0.632, 0.875, 0.898, 0.637, 0.869, 0.904, 0.642, 0.863, 0.911, 0.646,
+ 0.856, 0.917, 0.650, 0.849, 0.923, 0.653, 0.842, 0.929, 0.657, 0.835,
+ 0.935, 0.659, 0.827, 0.940, 0.662, 0.818, 0.946, 0.663, 0.810, 0.951,
+ 0.665, 0.800, 0.955, 0.666, 0.790, 0.960, 0.666, 0.780, 0.964, 0.666,
+ 0.769, 0.967, 0.666, 0.757, 0.971, 0.665, 0.745, 0.974, 0.663, 0.732,
+ 0.976, 0.662, 0.718, 0.978, 0.659, 0.704, 0.980, 0.657, 0.689, 0.981,
+ 0.654, 0.674, 0.982, 0.650, 0.658, 0.983, 0.646, 0.642, 0.983, 0.642,
+ 0.625, 0.983, 0.638, 0.608, 0.982, 0.633, 0.590, 0.981, 0.628, 0.572,
+ 0.979, 0.623, 0.553, 0.978, 0.618, 0.535, 0.976, 0.612, 0.516, 0.973,
+ 0.607, 0.497, 0.971, 0.601, 0.477, 0.968, 0.595, 0.458, 0.965, 0.589,
+ 0.438, 0.961, 0.582, 0.418, 0.958, 0.576, 0.398, 0.954, 0.569, 0.378,
+ 0.950, 0.563, 0.357, 0.946, 0.556, 0.336, 0.942, 0.549, 0.315, 0.938,
+ 0.542, 0.294, 0.933, 0.536, 0.273, 0.928, 0.529, 0.250, 0.924, 0.522,
+ 0.228, 0.919, 0.514, 0.204, 0.914, 0.507, 0.179, 0.909, 0.500, 0.153,
+ 0.770, 0.488, 0.983, 0.777, 0.498, 0.976, 0.783, 0.507, 0.969, 0.790,
+ 0.516, 0.962, 0.797, 0.524, 0.955, 0.804, 0.533, 0.948, 0.811, 0.541,
+ 0.942, 0.817, 0.549, 0.936, 0.824, 0.556, 0.930, 0.831, 0.564, 0.924,
+ 0.838, 0.571, 0.918, 0.845, 0.578, 0.912, 0.852, 0.584, 0.906, 0.859,
+ 0.591, 0.900, 0.866, 0.597, 0.894, 0.873, 0.603, 0.888, 0.879, 0.609,
+ 0.882, 0.886, 0.614, 0.876, 0.893, 0.619, 0.869, 0.899, 0.624, 0.863,
+ 0.906, 0.629, 0.856, 0.912, 0.633, 0.850, 0.918, 0.637, 0.843, 0.924,
+ 0.640, 0.835, 0.930, 0.643, 0.827, 0.935, 0.646, 0.819, 0.941, 0.648,
+ 0.811, 0.946, 0.649, 0.802, 0.951, 0.651, 0.792, 0.955, 0.652, 0.782,
+ 0.959, 0.652, 0.771, 0.963, 0.652, 0.760, 0.967, 0.652, 0.749, 0.970,
+ 0.651, 0.736, 0.973, 0.649, 0.723, 0.976, 0.647, 0.710, 0.978, 0.645,
+ 0.696, 0.980, 0.643, 0.681, 0.981, 0.640, 0.666, 0.982, 0.637, 0.650,
+ 0.982, 0.633, 0.634, 0.983, 0.629, 0.617, 0.982, 0.625, 0.600, 0.982,
+ 0.620, 0.582, 0.981, 0.616, 0.565, 0.979, 0.611, 0.546, 0.978, 0.605,
+ 0.528, 0.976, 0.600, 0.509, 0.974, 0.595, 0.490, 0.971, 0.589, 0.471,
+ 0.969, 0.583, 0.452, 0.966, 0.577, 0.432, 0.962, 0.571, 0.413, 0.959,
+ 0.565, 0.393, 0.955, 0.558, 0.373, 0.952, 0.552, 0.352, 0.948, 0.545,
+ 0.332, 0.943, 0.539, 0.311, 0.939, 0.532, 0.290, 0.935, 0.525, 0.268,
+ 0.930, 0.518, 0.246, 0.926, 0.511, 0.224, 0.921, 0.504, 0.200, 0.916,
+ 0.497, 0.175, 0.911, 0.490, 0.149, 0.775, 0.477, 0.981, 0.781, 0.486,
+ 0.974, 0.788, 0.495, 0.966, 0.794, 0.504, 0.959, 0.801, 0.513, 0.952,
+ 0.808, 0.521, 0.946, 0.814, 0.529, 0.939, 0.821, 0.537, 0.933, 0.828,
+ 0.545, 0.926, 0.835, 0.552, 0.920, 0.841, 0.559, 0.914, 0.848, 0.566,
+ 0.908, 0.855, 0.572, 0.901, 0.862, 0.579, 0.895, 0.868, 0.585, 0.889,
+ 0.875, 0.591, 0.883, 0.881, 0.596, 0.877, 0.888, 0.601, 0.870, 0.894,
+ 0.606, 0.864, 0.901, 0.611, 0.857, 0.907, 0.615, 0.850, 0.913, 0.619,
+ 0.843, 0.919, 0.623, 0.836, 0.925, 0.626, 0.828, 0.930, 0.629, 0.820,
+ 0.936, 0.632, 0.812, 0.941, 0.634, 0.803, 0.946, 0.635, 0.794, 0.951,
+ 0.637, 0.784, 0.955, 0.637, 0.774, 0.959, 0.638, 0.763, 0.963, 0.638,
+ 0.752, 0.967, 0.637, 0.740, 0.970, 0.636, 0.728, 0.973, 0.635, 0.715,
+ 0.975, 0.633, 0.701, 0.977, 0.631, 0.687, 0.979, 0.629, 0.672, 0.980,
+ 0.626, 0.657, 0.981, 0.623, 0.642, 0.982, 0.619, 0.626, 0.982, 0.616,
+ 0.609, 0.982, 0.612, 0.592, 0.981, 0.607, 0.575, 0.981, 0.603, 0.557,
+ 0.979, 0.598, 0.540, 0.978, 0.593, 0.521, 0.976, 0.588, 0.503, 0.974,
+ 0.582, 0.484, 0.972, 0.577, 0.465, 0.969, 0.571, 0.446, 0.966, 0.565,
+ 0.427, 0.963, 0.559, 0.407, 0.960, 0.553, 0.387, 0.956, 0.547, 0.368,
+ 0.953, 0.541, 0.347, 0.949, 0.534, 0.327, 0.945, 0.528, 0.306, 0.941,
+ 0.521, 0.285, 0.936, 0.514, 0.264, 0.932, 0.508, 0.242, 0.927, 0.501,
+ 0.220, 0.922, 0.494, 0.196, 0.918, 0.487, 0.172, 0.913, 0.480, 0.145,
+ 0.779, 0.465, 0.979, 0.785, 0.474, 0.971, 0.792, 0.484, 0.964, 0.798,
+ 0.492, 0.957, 0.805, 0.501, 0.950, 0.811, 0.509, 0.943, 0.818, 0.517,
+ 0.936, 0.824, 0.525, 0.929, 0.831, 0.533, 0.923, 0.838, 0.540, 0.916,
+ 0.844, 0.547, 0.910, 0.851, 0.554, 0.904, 0.857, 0.560, 0.897, 0.864,
+ 0.566, 0.891, 0.870, 0.572, 0.884, 0.877, 0.578, 0.878, 0.883, 0.583,
+ 0.871, 0.890, 0.589, 0.865, 0.896, 0.593, 0.858, 0.902, 0.598, 0.851,
+ 0.908, 0.602, 0.844, 0.914, 0.606, 0.837, 0.920, 0.609, 0.829, 0.925,
+ 0.613, 0.821, 0.931, 0.615, 0.813, 0.936, 0.618, 0.804, 0.941, 0.620,
+ 0.795, 0.946, 0.621, 0.786, 0.950, 0.622, 0.776, 0.955, 0.623, 0.765,
+ 0.959, 0.624, 0.755, 0.963, 0.624, 0.743, 0.966, 0.623, 0.731, 0.969,
+ 0.622, 0.719, 0.972, 0.621, 0.706, 0.974, 0.619, 0.693, 0.976, 0.617,
+ 0.679, 0.978, 0.615, 0.664, 0.979, 0.612, 0.649, 0.980, 0.609, 0.634,
+ 0.981, 0.606, 0.618, 0.981, 0.602, 0.601, 0.981, 0.598, 0.585, 0.981,
+ 0.594, 0.568, 0.980, 0.590, 0.550, 0.979, 0.585, 0.533, 0.978, 0.580,
+ 0.515, 0.976, 0.575, 0.496, 0.974, 0.570, 0.478, 0.972, 0.565, 0.459,
+ 0.969, 0.559, 0.440, 0.967, 0.553, 0.421, 0.964, 0.547, 0.402, 0.960,
+ 0.542, 0.382, 0.957, 0.535, 0.362, 0.953, 0.529, 0.342, 0.950, 0.523,
+ 0.322, 0.946, 0.517, 0.302, 0.942, 0.510, 0.281, 0.937, 0.504, 0.260,
+ 0.933, 0.497, 0.238, 0.929, 0.490, 0.216, 0.924, 0.484, 0.192, 0.919,
+ 0.477, 0.168, 0.914, 0.470, 0.141, 0.783, 0.453, 0.977, 0.789, 0.462,
+ 0.969, 0.796, 0.471, 0.962, 0.802, 0.480, 0.954, 0.808, 0.489, 0.947,
+ 0.815, 0.497, 0.940, 0.821, 0.505, 0.933, 0.828, 0.513, 0.926, 0.834,
+ 0.520, 0.919, 0.840, 0.527, 0.913, 0.847, 0.534, 0.906, 0.853, 0.541,
+ 0.899, 0.860, 0.548, 0.893, 0.866, 0.554, 0.886, 0.873, 0.560, 0.880,
+ 0.879, 0.565, 0.873, 0.885, 0.570, 0.866, 0.891, 0.575, 0.859, 0.897,
+ 0.580, 0.852, 0.903, 0.585, 0.845, 0.909, 0.589, 0.838, 0.915, 0.592,
+ 0.830, 0.921, 0.596, 0.822, 0.926, 0.599, 0.814, 0.931, 0.601, 0.805,
+ 0.936, 0.604, 0.797, 0.941, 0.606, 0.787, 0.946, 0.607, 0.778, 0.950,
+ 0.608, 0.768, 0.955, 0.609, 0.757, 0.958, 0.609, 0.746, 0.962, 0.609,
+ 0.735, 0.965, 0.609, 0.723, 0.968, 0.608, 0.710, 0.971, 0.607, 0.698,
+ 0.974, 0.605, 0.684, 0.976, 0.603, 0.670, 0.977, 0.601, 0.656, 0.979,
+ 0.598, 0.641, 0.980, 0.596, 0.626, 0.980, 0.592, 0.610, 0.981, 0.589,
+ 0.594, 0.981, 0.585, 0.577, 0.980, 0.581, 0.560, 0.980, 0.577, 0.543,
+ 0.979, 0.572, 0.526, 0.977, 0.568, 0.508, 0.976, 0.563, 0.490, 0.974,
+ 0.558, 0.471, 0.972, 0.552, 0.453, 0.969, 0.547, 0.434, 0.967, 0.541,
+ 0.415, 0.964, 0.536, 0.396, 0.961, 0.530, 0.377, 0.958, 0.524, 0.357,
+ 0.954, 0.518, 0.337, 0.950, 0.512, 0.317, 0.947, 0.505, 0.297, 0.943,
+ 0.499, 0.276, 0.938, 0.493, 0.255, 0.934, 0.486, 0.234, 0.930, 0.480,
+ 0.211, 0.925, 0.473, 0.188, 0.920, 0.466, 0.164, 0.916, 0.459, 0.137,
+ 0.787, 0.440, 0.975, 0.793, 0.450, 0.967, 0.799, 0.459, 0.959, 0.806,
+ 0.468, 0.952, 0.812, 0.476, 0.944, 0.818, 0.485, 0.937, 0.824, 0.493,
+ 0.930, 0.831, 0.500, 0.923, 0.837, 0.508, 0.916, 0.843, 0.515, 0.909,
+ 0.850, 0.522, 0.902, 0.856, 0.528, 0.895, 0.862, 0.535, 0.888, 0.868,
+ 0.541, 0.881, 0.874, 0.547, 0.875, 0.881, 0.552, 0.868, 0.887, 0.557,
+ 0.861, 0.893, 0.562, 0.853, 0.899, 0.567, 0.846, 0.904, 0.571, 0.839,
+ 0.910, 0.575, 0.831, 0.916, 0.579, 0.823, 0.921, 0.582, 0.815, 0.926,
+ 0.585, 0.807, 0.932, 0.587, 0.798, 0.937, 0.590, 0.789, 0.941, 0.591,
+ 0.780, 0.946, 0.593, 0.770, 0.950, 0.594, 0.760, 0.954, 0.595, 0.749,
+ 0.958, 0.595, 0.738, 0.962, 0.595, 0.727, 0.965, 0.595, 0.715, 0.968,
+ 0.594, 0.702, 0.970, 0.593, 0.689, 0.973, 0.591, 0.676, 0.975, 0.589,
+ 0.662, 0.976, 0.587, 0.648, 0.978, 0.585, 0.633, 0.979, 0.582, 0.618,
+ 0.980, 0.579, 0.602, 0.980, 0.575, 0.586, 0.980, 0.572, 0.570, 0.980,
+ 0.568, 0.553, 0.979, 0.564, 0.536, 0.978, 0.559, 0.518, 0.977, 0.555,
+ 0.501, 0.975, 0.550, 0.483, 0.974, 0.545, 0.465, 0.972, 0.540, 0.447,
+ 0.969, 0.535, 0.428, 0.967, 0.529, 0.409, 0.964, 0.524, 0.390, 0.961,
+ 0.518, 0.371, 0.958, 0.512, 0.352, 0.954, 0.506, 0.332, 0.951, 0.500,
+ 0.312, 0.947, 0.494, 0.292, 0.943, 0.488, 0.272, 0.939, 0.481, 0.251,
+ 0.935, 0.475, 0.229, 0.931, 0.469, 0.207, 0.926, 0.462, 0.184, 0.921,
+ 0.455, 0.159, 0.917, 0.449, 0.133, 0.791, 0.427, 0.973, 0.797, 0.437,
+ 0.964, 0.803, 0.446, 0.957, 0.809, 0.455, 0.949, 0.815, 0.464, 0.941,
+ 0.821, 0.472, 0.934, 0.827, 0.480, 0.926, 0.834, 0.488, 0.919, 0.840,
+ 0.495, 0.912, 0.846, 0.502, 0.905, 0.852, 0.509, 0.898, 0.858, 0.515,
+ 0.891, 0.864, 0.522, 0.884, 0.870, 0.528, 0.877, 0.876, 0.533, 0.870,
+ 0.882, 0.539, 0.862, 0.888, 0.544, 0.855, 0.894, 0.549, 0.848, 0.900,
+ 0.553, 0.840, 0.906, 0.557, 0.833, 0.911, 0.561, 0.825, 0.916, 0.565,
+ 0.817, 0.922, 0.568, 0.808, 0.927, 0.571, 0.800, 0.932, 0.573, 0.791,
+ 0.937, 0.575, 0.782, 0.941, 0.577, 0.772, 0.946, 0.579, 0.762, 0.950,
+ 0.580, 0.752, 0.954, 0.580, 0.741, 0.958, 0.581, 0.730, 0.961, 0.581,
+ 0.718, 0.964, 0.580, 0.706, 0.967, 0.580, 0.694, 0.970, 0.578, 0.681,
+ 0.972, 0.577, 0.667, 0.974, 0.575, 0.654, 0.976, 0.573, 0.639, 0.977,
+ 0.571, 0.625, 0.978, 0.568, 0.610, 0.979, 0.565, 0.594, 0.979, 0.562,
+ 0.578, 0.979, 0.558, 0.562, 0.979, 0.554, 0.545, 0.978, 0.550, 0.529,
+ 0.977, 0.546, 0.511, 0.976, 0.542, 0.494, 0.975, 0.537, 0.476, 0.973,
+ 0.532, 0.458, 0.971, 0.527, 0.440, 0.969, 0.522, 0.422, 0.967, 0.517,
+ 0.403, 0.964, 0.511, 0.385, 0.961, 0.506, 0.366, 0.958, 0.500, 0.347,
+ 0.955, 0.494, 0.327, 0.951, 0.488, 0.307, 0.947, 0.482, 0.287, 0.944,
+ 0.476, 0.267, 0.940, 0.470, 0.246, 0.935, 0.464, 0.225, 0.931, 0.458,
+ 0.203, 0.927, 0.451, 0.180, 0.922, 0.445, 0.155, 0.917, 0.438, 0.129,
+ 0.795, 0.413, 0.970, 0.801, 0.423, 0.962, 0.807, 0.433, 0.954, 0.813,
+ 0.442, 0.946, 0.818, 0.450, 0.938, 0.824, 0.459, 0.930, 0.830, 0.467,
+ 0.923, 0.836, 0.474, 0.915, 0.842, 0.482, 0.908, 0.848, 0.489, 0.901,
+ 0.854, 0.496, 0.894, 0.860, 0.502, 0.886, 0.866, 0.508, 0.879, 0.872,
+ 0.514, 0.872, 0.878, 0.520, 0.864, 0.884, 0.525, 0.857, 0.890, 0.530,
+ 0.850, 0.895, 0.535, 0.842, 0.901, 0.539, 0.834, 0.906, 0.543, 0.826,
+ 0.912, 0.547, 0.818, 0.917, 0.551, 0.810, 0.922, 0.554, 0.801, 0.927,
+ 0.557, 0.793, 0.932, 0.559, 0.783, 0.937, 0.561, 0.774, 0.941, 0.563,
+ 0.764, 0.946, 0.564, 0.754, 0.950, 0.565, 0.744, 0.953, 0.566, 0.733,
+ 0.957, 0.566, 0.722, 0.960, 0.566, 0.710, 0.963, 0.566, 0.698, 0.966,
+ 0.565, 0.685, 0.969, 0.564, 0.673, 0.971, 0.563, 0.659, 0.973, 0.561,
+ 0.645, 0.975, 0.559, 0.631, 0.976, 0.557, 0.617, 0.977, 0.554, 0.602,
+ 0.978, 0.551, 0.586, 0.978, 0.548, 0.571, 0.978, 0.545, 0.554, 0.978,
+ 0.541, 0.538, 0.977, 0.537, 0.521, 0.977, 0.533, 0.504, 0.976, 0.529,
+ 0.487, 0.974, 0.524, 0.470, 0.973, 0.519, 0.452, 0.971, 0.515, 0.434,
+ 0.969, 0.510, 0.416, 0.966, 0.504, 0.398, 0.964, 0.499, 0.379, 0.961,
+ 0.494, 0.360, 0.958, 0.488, 0.341, 0.955, 0.482, 0.322, 0.951, 0.477,
+ 0.302, 0.948, 0.471, 0.283, 0.944, 0.465, 0.262, 0.940, 0.459, 0.242,
+ 0.936, 0.452, 0.220, 0.932, 0.446, 0.198, 0.927, 0.440, 0.175, 0.923,
+ 0.434, 0.151, 0.918, 0.427, 0.124, 0.799, 0.399, 0.968, 0.804, 0.409,
+ 0.959, 0.810, 0.419, 0.951, 0.816, 0.428, 0.943, 0.822, 0.437, 0.935,
+ 0.827, 0.445, 0.927, 0.833, 0.453, 0.919, 0.839, 0.461, 0.912, 0.845,
+ 0.468, 0.904, 0.851, 0.475, 0.897, 0.857, 0.482, 0.889, 0.862, 0.489,
+ 0.882, 0.868, 0.495, 0.874, 0.874, 0.501, 0.867, 0.880, 0.506, 0.859,
+ 0.885, 0.511, 0.852, 0.891, 0.516, 0.844, 0.897, 0.521, 0.836, 0.902,
+ 0.525, 0.828, 0.907, 0.529, 0.820, 0.913, 0.533, 0.812, 0.918, 0.537,
+ 0.803, 0.923, 0.540, 0.794, 0.928, 0.542, 0.785, 0.932, 0.545, 0.776,
+ 0.937, 0.547, 0.767, 0.941, 0.549, 0.757, 0.945, 0.550, 0.747, 0.949,
+ 0.551, 0.736, 0.953, 0.552, 0.725, 0.956, 0.552, 0.714, 0.960, 0.552,
+ 0.702, 0.963, 0.552, 0.690, 0.965, 0.551, 0.677, 0.968, 0.550, 0.664,
+ 0.970, 0.549, 0.651, 0.972, 0.547, 0.637, 0.974, 0.545, 0.623, 0.975,
+ 0.543, 0.609, 0.976, 0.540, 0.594, 0.977, 0.537, 0.578, 0.977, 0.534,
+ 0.563, 0.977, 0.531, 0.547, 0.977, 0.527, 0.531, 0.976, 0.524, 0.514,
+ 0.976, 0.520, 0.497, 0.975, 0.516, 0.480, 0.973, 0.511, 0.463, 0.972,
+ 0.507, 0.446, 0.970, 0.502, 0.428, 0.968, 0.497, 0.410, 0.966, 0.492,
+ 0.392, 0.963, 0.487, 0.373, 0.960, 0.481, 0.355, 0.957, 0.476, 0.336,
+ 0.954, 0.470, 0.317, 0.951, 0.465, 0.297, 0.947, 0.459, 0.278, 0.944,
+ 0.453, 0.258, 0.940, 0.447, 0.237, 0.936, 0.441, 0.216, 0.932, 0.435,
+ 0.194, 0.927, 0.429, 0.171, 0.923, 0.422, 0.147, 0.918, 0.416, 0.120,
+ 0.802, 0.385, 0.965, 0.808, 0.395, 0.957, 0.813, 0.405, 0.948, 0.819,
+ 0.414, 0.940, 0.825, 0.423, 0.932, 0.830, 0.431, 0.924, 0.836, 0.439,
+ 0.916, 0.842, 0.447, 0.908, 0.847, 0.454, 0.900, 0.853, 0.462, 0.892,
+ 0.859, 0.468, 0.885, 0.864, 0.475, 0.877, 0.870, 0.481, 0.869, 0.876,
+ 0.487, 0.862, 0.881, 0.492, 0.854, 0.887, 0.498, 0.846, 0.892, 0.502,
+ 0.838, 0.898, 0.507, 0.830, 0.903, 0.511, 0.822, 0.908, 0.515, 0.814,
+ 0.913, 0.519, 0.805, 0.918, 0.522, 0.797, 0.923, 0.525, 0.788, 0.928,
+ 0.528, 0.778, 0.932, 0.530, 0.769, 0.937, 0.532, 0.759, 0.941, 0.534,
+ 0.749, 0.945, 0.535, 0.739, 0.949, 0.536, 0.728, 0.952, 0.537, 0.717,
+ 0.956, 0.537, 0.706, 0.959, 0.537, 0.694, 0.962, 0.537, 0.682, 0.964,
+ 0.536, 0.669, 0.967, 0.536, 0.656, 0.969, 0.534, 0.643, 0.971, 0.533,
+ 0.629, 0.972, 0.531, 0.615, 0.974, 0.529, 0.601, 0.975, 0.526, 0.586,
+ 0.975, 0.523, 0.571, 0.976, 0.521, 0.555, 0.976, 0.517, 0.540, 0.976,
+ 0.514, 0.523, 0.975, 0.510, 0.507, 0.975, 0.506, 0.490, 0.974, 0.502,
+ 0.474, 0.972, 0.498, 0.456, 0.971, 0.494, 0.439, 0.969, 0.489, 0.421,
+ 0.967, 0.484, 0.404, 0.965, 0.479, 0.386, 0.963, 0.474, 0.367, 0.960,
+ 0.469, 0.349, 0.957, 0.464, 0.330, 0.954, 0.458, 0.311, 0.951, 0.453,
+ 0.292, 0.947, 0.447, 0.273, 0.944, 0.441, 0.253, 0.940, 0.435, 0.232,
+ 0.936, 0.429, 0.211, 0.932, 0.423, 0.190, 0.927, 0.417, 0.167, 0.923,
+ 0.411, 0.142, 0.919, 0.405, 0.116, 0.806, 0.370, 0.963, 0.811, 0.380,
+ 0.954, 0.816, 0.390, 0.945, 0.822, 0.399, 0.937, 0.827, 0.408, 0.929,
+ 0.833, 0.417, 0.920, 0.838, 0.425, 0.912, 0.844, 0.433, 0.904, 0.850,
+ 0.440, 0.896, 0.855, 0.447, 0.888, 0.861, 0.454, 0.880, 0.866, 0.461,
+ 0.872, 0.872, 0.467, 0.865, 0.877, 0.473, 0.857, 0.883, 0.478, 0.849,
+ 0.888, 0.483, 0.841, 0.893, 0.488, 0.833, 0.899, 0.493, 0.824, 0.904,
+ 0.497, 0.816, 0.909, 0.501, 0.807, 0.914, 0.505, 0.799, 0.919, 0.508,
+ 0.790, 0.923, 0.511, 0.781, 0.928, 0.514, 0.771, 0.932, 0.516, 0.762,
+ 0.937, 0.518, 0.752, 0.941, 0.520, 0.742, 0.945, 0.521, 0.731, 0.948,
+ 0.522, 0.720, 0.952, 0.523, 0.709, 0.955, 0.523, 0.698, 0.958, 0.523,
+ 0.686, 0.961, 0.523, 0.674, 0.964, 0.522, 0.661, 0.966, 0.521, 0.648,
+ 0.968, 0.520, 0.635, 0.970, 0.518, 0.621, 0.971, 0.517, 0.607, 0.972,
+ 0.514, 0.593, 0.973, 0.512, 0.578, 0.974, 0.509, 0.563, 0.975, 0.507,
+ 0.548, 0.975, 0.503, 0.532, 0.975, 0.500, 0.516, 0.974, 0.497, 0.500,
+ 0.974, 0.493, 0.483, 0.973, 0.489, 0.467, 0.971, 0.485, 0.450, 0.970,
+ 0.480, 0.433, 0.968, 0.476, 0.415, 0.966, 0.471, 0.397, 0.964, 0.466,
+ 0.380, 0.962, 0.461, 0.362, 0.959, 0.456, 0.343, 0.956, 0.451, 0.325,
+ 0.953, 0.446, 0.306, 0.950, 0.440, 0.287, 0.947, 0.435, 0.268, 0.943,
+ 0.429, 0.248, 0.939, 0.423, 0.228, 0.936, 0.417, 0.207, 0.931, 0.411,
+ 0.185, 0.927, 0.405, 0.162, 0.923, 0.399, 0.138, 0.918, 0.393, 0.111,
+ 0.809, 0.354, 0.960, 0.814, 0.364, 0.951, 0.819, 0.375, 0.942, 0.825,
+ 0.384, 0.934, 0.830, 0.393, 0.925, 0.835, 0.402, 0.917, 0.841, 0.410,
+ 0.908, 0.846, 0.418, 0.900, 0.852, 0.426, 0.892, 0.857, 0.433, 0.884,
+ 0.863, 0.440, 0.876, 0.868, 0.446, 0.868, 0.873, 0.452, 0.860, 0.879,
+ 0.458, 0.852, 0.884, 0.464, 0.843, 0.889, 0.469, 0.835, 0.894, 0.474,
+ 0.827, 0.899, 0.478, 0.818, 0.904, 0.483, 0.810, 0.909, 0.486, 0.801,
+ 0.914, 0.490, 0.792, 0.919, 0.493, 0.783, 0.923, 0.496, 0.774, 0.928,
+ 0.499, 0.764, 0.932, 0.501, 0.755, 0.936, 0.503, 0.745, 0.940, 0.505,
+ 0.734, 0.944, 0.506, 0.724, 0.948, 0.507, 0.713, 0.951, 0.508, 0.701,
+ 0.954, 0.508, 0.690, 0.957, 0.508, 0.678, 0.960, 0.508, 0.666, 0.962,
+ 0.507, 0.653, 0.965, 0.507, 0.640, 0.967, 0.505, 0.627, 0.968, 0.504,
+ 0.613, 0.970, 0.502, 0.599, 0.971, 0.500, 0.585, 0.972, 0.498, 0.570,
+ 0.973, 0.495, 0.555, 0.973, 0.493, 0.540, 0.973, 0.490, 0.525, 0.973,
+ 0.486, 0.509, 0.973, 0.483, 0.493, 0.972, 0.479, 0.476, 0.971, 0.475,
+ 0.460, 0.970, 0.471, 0.443, 0.969, 0.467, 0.426, 0.967, 0.463, 0.409,
+ 0.965, 0.458, 0.391, 0.963, 0.453, 0.374, 0.961, 0.449, 0.356, 0.958,
+ 0.444, 0.338, 0.956, 0.438, 0.319, 0.953, 0.433, 0.301, 0.949, 0.428,
+ 0.282, 0.946, 0.422, 0.263, 0.943, 0.417, 0.243, 0.939, 0.411, 0.223,
+ 0.935, 0.405, 0.202, 0.931, 0.399, 0.181, 0.927, 0.393, 0.158, 0.923,
+ 0.387, 0.134, 0.918, 0.381, 0.107,
+ ]).reshape((65, 65, 3))
+
+BiOrangeBlue = np.array(
+ [0.000, 0.000, 0.000, 0.000, 0.062, 0.125, 0.000, 0.125, 0.250, 0.000,
+ 0.188, 0.375, 0.000, 0.250, 0.500, 0.000, 0.312, 0.625, 0.000, 0.375,
+ 0.750, 0.000, 0.438, 0.875, 0.000, 0.500, 1.000, 0.125, 0.062, 0.000,
+ 0.125, 0.125, 0.125, 0.125, 0.188, 0.250, 0.125, 0.250, 0.375, 0.125,
+ 0.312, 0.500, 0.125, 0.375, 0.625, 0.125, 0.438, 0.750, 0.125, 0.500,
+ 0.875, 0.125, 0.562, 1.000, 0.250, 0.125, 0.000, 0.250, 0.188, 0.125,
+ 0.250, 0.250, 0.250, 0.250, 0.312, 0.375, 0.250, 0.375, 0.500, 0.250,
+ 0.438, 0.625, 0.250, 0.500, 0.750, 0.250, 0.562, 0.875, 0.250, 0.625,
+ 1.000, 0.375, 0.188, 0.000, 0.375, 0.250, 0.125, 0.375, 0.312, 0.250,
+ 0.375, 0.375, 0.375, 0.375, 0.438, 0.500, 0.375, 0.500, 0.625, 0.375,
+ 0.562, 0.750, 0.375, 0.625, 0.875, 0.375, 0.688, 1.000, 0.500, 0.250,
+ 0.000, 0.500, 0.312, 0.125, 0.500, 0.375, 0.250, 0.500, 0.438, 0.375,
+ 0.500, 0.500, 0.500, 0.500, 0.562, 0.625, 0.500, 0.625, 0.750, 0.500,
+ 0.688, 0.875, 0.500, 0.750, 1.000, 0.625, 0.312, 0.000, 0.625, 0.375,
+ 0.125, 0.625, 0.438, 0.250, 0.625, 0.500, 0.375, 0.625, 0.562, 0.500,
+ 0.625, 0.625, 0.625, 0.625, 0.688, 0.750, 0.625, 0.750, 0.875, 0.625,
+ 0.812, 1.000, 0.750, 0.375, 0.000, 0.750, 0.438, 0.125, 0.750, 0.500,
+ 0.250, 0.750, 0.562, 0.375, 0.750, 0.625, 0.500, 0.750, 0.688, 0.625,
+ 0.750, 0.750, 0.750, 0.750, 0.812, 0.875, 0.750, 0.875, 1.000, 0.875,
+ 0.438, 0.000, 0.875, 0.500, 0.125, 0.875, 0.562, 0.250, 0.875, 0.625,
+ 0.375, 0.875, 0.688, 0.500, 0.875, 0.750, 0.625, 0.875, 0.812, 0.750,
+ 0.875, 0.875, 0.875, 0.875, 0.938, 1.000, 1.000, 0.500, 0.000, 1.000,
+ 0.562, 0.125, 1.000, 0.625, 0.250, 1.000, 0.688, 0.375, 1.000, 0.750,
+ 0.500, 1.000, 0.812, 0.625, 1.000, 0.875, 0.750, 1.000, 0.938, 0.875,
+ 1.000, 1.000, 1.000,
+ ]).reshape((9, 9, 3))
+
+cmaps = {
+ "BiPeak": SegmentedBivarColormap(
+ BiPeak, 256, "square", (.5, .5), name="BiPeak"),
+ "BiOrangeBlue": SegmentedBivarColormap(
+ BiOrangeBlue, 256, "square", (0, 0), name="BiOrangeBlue"),
+ "BiCone": SegmentedBivarColormap(BiPeak, 256, "circle", (.5, .5), name="BiCone"),
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_listed.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_listed.py
new file mode 100644
index 0000000000000000000000000000000000000000..b90e0a23acb08a80a71e4911ee6e487f4a297bc4
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_listed.py
@@ -0,0 +1,2847 @@
+from .colors import ListedColormap
+
+_magma_data = [[0.001462, 0.000466, 0.013866],
+ [0.002258, 0.001295, 0.018331],
+ [0.003279, 0.002305, 0.023708],
+ [0.004512, 0.003490, 0.029965],
+ [0.005950, 0.004843, 0.037130],
+ [0.007588, 0.006356, 0.044973],
+ [0.009426, 0.008022, 0.052844],
+ [0.011465, 0.009828, 0.060750],
+ [0.013708, 0.011771, 0.068667],
+ [0.016156, 0.013840, 0.076603],
+ [0.018815, 0.016026, 0.084584],
+ [0.021692, 0.018320, 0.092610],
+ [0.024792, 0.020715, 0.100676],
+ [0.028123, 0.023201, 0.108787],
+ [0.031696, 0.025765, 0.116965],
+ [0.035520, 0.028397, 0.125209],
+ [0.039608, 0.031090, 0.133515],
+ [0.043830, 0.033830, 0.141886],
+ [0.048062, 0.036607, 0.150327],
+ [0.052320, 0.039407, 0.158841],
+ [0.056615, 0.042160, 0.167446],
+ [0.060949, 0.044794, 0.176129],
+ [0.065330, 0.047318, 0.184892],
+ [0.069764, 0.049726, 0.193735],
+ [0.074257, 0.052017, 0.202660],
+ [0.078815, 0.054184, 0.211667],
+ [0.083446, 0.056225, 0.220755],
+ [0.088155, 0.058133, 0.229922],
+ [0.092949, 0.059904, 0.239164],
+ [0.097833, 0.061531, 0.248477],
+ [0.102815, 0.063010, 0.257854],
+ [0.107899, 0.064335, 0.267289],
+ [0.113094, 0.065492, 0.276784],
+ [0.118405, 0.066479, 0.286321],
+ [0.123833, 0.067295, 0.295879],
+ [0.129380, 0.067935, 0.305443],
+ [0.135053, 0.068391, 0.315000],
+ [0.140858, 0.068654, 0.324538],
+ [0.146785, 0.068738, 0.334011],
+ [0.152839, 0.068637, 0.343404],
+ [0.159018, 0.068354, 0.352688],
+ [0.165308, 0.067911, 0.361816],
+ [0.171713, 0.067305, 0.370771],
+ [0.178212, 0.066576, 0.379497],
+ [0.184801, 0.065732, 0.387973],
+ [0.191460, 0.064818, 0.396152],
+ [0.198177, 0.063862, 0.404009],
+ [0.204935, 0.062907, 0.411514],
+ [0.211718, 0.061992, 0.418647],
+ [0.218512, 0.061158, 0.425392],
+ [0.225302, 0.060445, 0.431742],
+ [0.232077, 0.059889, 0.437695],
+ [0.238826, 0.059517, 0.443256],
+ [0.245543, 0.059352, 0.448436],
+ [0.252220, 0.059415, 0.453248],
+ [0.258857, 0.059706, 0.457710],
+ [0.265447, 0.060237, 0.461840],
+ [0.271994, 0.060994, 0.465660],
+ [0.278493, 0.061978, 0.469190],
+ [0.284951, 0.063168, 0.472451],
+ [0.291366, 0.064553, 0.475462],
+ [0.297740, 0.066117, 0.478243],
+ [0.304081, 0.067835, 0.480812],
+ [0.310382, 0.069702, 0.483186],
+ [0.316654, 0.071690, 0.485380],
+ [0.322899, 0.073782, 0.487408],
+ [0.329114, 0.075972, 0.489287],
+ [0.335308, 0.078236, 0.491024],
+ [0.341482, 0.080564, 0.492631],
+ [0.347636, 0.082946, 0.494121],
+ [0.353773, 0.085373, 0.495501],
+ [0.359898, 0.087831, 0.496778],
+ [0.366012, 0.090314, 0.497960],
+ [0.372116, 0.092816, 0.499053],
+ [0.378211, 0.095332, 0.500067],
+ [0.384299, 0.097855, 0.501002],
+ [0.390384, 0.100379, 0.501864],
+ [0.396467, 0.102902, 0.502658],
+ [0.402548, 0.105420, 0.503386],
+ [0.408629, 0.107930, 0.504052],
+ [0.414709, 0.110431, 0.504662],
+ [0.420791, 0.112920, 0.505215],
+ [0.426877, 0.115395, 0.505714],
+ [0.432967, 0.117855, 0.506160],
+ [0.439062, 0.120298, 0.506555],
+ [0.445163, 0.122724, 0.506901],
+ [0.451271, 0.125132, 0.507198],
+ [0.457386, 0.127522, 0.507448],
+ [0.463508, 0.129893, 0.507652],
+ [0.469640, 0.132245, 0.507809],
+ [0.475780, 0.134577, 0.507921],
+ [0.481929, 0.136891, 0.507989],
+ [0.488088, 0.139186, 0.508011],
+ [0.494258, 0.141462, 0.507988],
+ [0.500438, 0.143719, 0.507920],
+ [0.506629, 0.145958, 0.507806],
+ [0.512831, 0.148179, 0.507648],
+ [0.519045, 0.150383, 0.507443],
+ [0.525270, 0.152569, 0.507192],
+ [0.531507, 0.154739, 0.506895],
+ [0.537755, 0.156894, 0.506551],
+ [0.544015, 0.159033, 0.506159],
+ [0.550287, 0.161158, 0.505719],
+ [0.556571, 0.163269, 0.505230],
+ [0.562866, 0.165368, 0.504692],
+ [0.569172, 0.167454, 0.504105],
+ [0.575490, 0.169530, 0.503466],
+ [0.581819, 0.171596, 0.502777],
+ [0.588158, 0.173652, 0.502035],
+ [0.594508, 0.175701, 0.501241],
+ [0.600868, 0.177743, 0.500394],
+ [0.607238, 0.179779, 0.499492],
+ [0.613617, 0.181811, 0.498536],
+ [0.620005, 0.183840, 0.497524],
+ [0.626401, 0.185867, 0.496456],
+ [0.632805, 0.187893, 0.495332],
+ [0.639216, 0.189921, 0.494150],
+ [0.645633, 0.191952, 0.492910],
+ [0.652056, 0.193986, 0.491611],
+ [0.658483, 0.196027, 0.490253],
+ [0.664915, 0.198075, 0.488836],
+ [0.671349, 0.200133, 0.487358],
+ [0.677786, 0.202203, 0.485819],
+ [0.684224, 0.204286, 0.484219],
+ [0.690661, 0.206384, 0.482558],
+ [0.697098, 0.208501, 0.480835],
+ [0.703532, 0.210638, 0.479049],
+ [0.709962, 0.212797, 0.477201],
+ [0.716387, 0.214982, 0.475290],
+ [0.722805, 0.217194, 0.473316],
+ [0.729216, 0.219437, 0.471279],
+ [0.735616, 0.221713, 0.469180],
+ [0.742004, 0.224025, 0.467018],
+ [0.748378, 0.226377, 0.464794],
+ [0.754737, 0.228772, 0.462509],
+ [0.761077, 0.231214, 0.460162],
+ [0.767398, 0.233705, 0.457755],
+ [0.773695, 0.236249, 0.455289],
+ [0.779968, 0.238851, 0.452765],
+ [0.786212, 0.241514, 0.450184],
+ [0.792427, 0.244242, 0.447543],
+ [0.798608, 0.247040, 0.444848],
+ [0.804752, 0.249911, 0.442102],
+ [0.810855, 0.252861, 0.439305],
+ [0.816914, 0.255895, 0.436461],
+ [0.822926, 0.259016, 0.433573],
+ [0.828886, 0.262229, 0.430644],
+ [0.834791, 0.265540, 0.427671],
+ [0.840636, 0.268953, 0.424666],
+ [0.846416, 0.272473, 0.421631],
+ [0.852126, 0.276106, 0.418573],
+ [0.857763, 0.279857, 0.415496],
+ [0.863320, 0.283729, 0.412403],
+ [0.868793, 0.287728, 0.409303],
+ [0.874176, 0.291859, 0.406205],
+ [0.879464, 0.296125, 0.403118],
+ [0.884651, 0.300530, 0.400047],
+ [0.889731, 0.305079, 0.397002],
+ [0.894700, 0.309773, 0.393995],
+ [0.899552, 0.314616, 0.391037],
+ [0.904281, 0.319610, 0.388137],
+ [0.908884, 0.324755, 0.385308],
+ [0.913354, 0.330052, 0.382563],
+ [0.917689, 0.335500, 0.379915],
+ [0.921884, 0.341098, 0.377376],
+ [0.925937, 0.346844, 0.374959],
+ [0.929845, 0.352734, 0.372677],
+ [0.933606, 0.358764, 0.370541],
+ [0.937221, 0.364929, 0.368567],
+ [0.940687, 0.371224, 0.366762],
+ [0.944006, 0.377643, 0.365136],
+ [0.947180, 0.384178, 0.363701],
+ [0.950210, 0.390820, 0.362468],
+ [0.953099, 0.397563, 0.361438],
+ [0.955849, 0.404400, 0.360619],
+ [0.958464, 0.411324, 0.360014],
+ [0.960949, 0.418323, 0.359630],
+ [0.963310, 0.425390, 0.359469],
+ [0.965549, 0.432519, 0.359529],
+ [0.967671, 0.439703, 0.359810],
+ [0.969680, 0.446936, 0.360311],
+ [0.971582, 0.454210, 0.361030],
+ [0.973381, 0.461520, 0.361965],
+ [0.975082, 0.468861, 0.363111],
+ [0.976690, 0.476226, 0.364466],
+ [0.978210, 0.483612, 0.366025],
+ [0.979645, 0.491014, 0.367783],
+ [0.981000, 0.498428, 0.369734],
+ [0.982279, 0.505851, 0.371874],
+ [0.983485, 0.513280, 0.374198],
+ [0.984622, 0.520713, 0.376698],
+ [0.985693, 0.528148, 0.379371],
+ [0.986700, 0.535582, 0.382210],
+ [0.987646, 0.543015, 0.385210],
+ [0.988533, 0.550446, 0.388365],
+ [0.989363, 0.557873, 0.391671],
+ [0.990138, 0.565296, 0.395122],
+ [0.990871, 0.572706, 0.398714],
+ [0.991558, 0.580107, 0.402441],
+ [0.992196, 0.587502, 0.406299],
+ [0.992785, 0.594891, 0.410283],
+ [0.993326, 0.602275, 0.414390],
+ [0.993834, 0.609644, 0.418613],
+ [0.994309, 0.616999, 0.422950],
+ [0.994738, 0.624350, 0.427397],
+ [0.995122, 0.631696, 0.431951],
+ [0.995480, 0.639027, 0.436607],
+ [0.995810, 0.646344, 0.441361],
+ [0.996096, 0.653659, 0.446213],
+ [0.996341, 0.660969, 0.451160],
+ [0.996580, 0.668256, 0.456192],
+ [0.996775, 0.675541, 0.461314],
+ [0.996925, 0.682828, 0.466526],
+ [0.997077, 0.690088, 0.471811],
+ [0.997186, 0.697349, 0.477182],
+ [0.997254, 0.704611, 0.482635],
+ [0.997325, 0.711848, 0.488154],
+ [0.997351, 0.719089, 0.493755],
+ [0.997351, 0.726324, 0.499428],
+ [0.997341, 0.733545, 0.505167],
+ [0.997285, 0.740772, 0.510983],
+ [0.997228, 0.747981, 0.516859],
+ [0.997138, 0.755190, 0.522806],
+ [0.997019, 0.762398, 0.528821],
+ [0.996898, 0.769591, 0.534892],
+ [0.996727, 0.776795, 0.541039],
+ [0.996571, 0.783977, 0.547233],
+ [0.996369, 0.791167, 0.553499],
+ [0.996162, 0.798348, 0.559820],
+ [0.995932, 0.805527, 0.566202],
+ [0.995680, 0.812706, 0.572645],
+ [0.995424, 0.819875, 0.579140],
+ [0.995131, 0.827052, 0.585701],
+ [0.994851, 0.834213, 0.592307],
+ [0.994524, 0.841387, 0.598983],
+ [0.994222, 0.848540, 0.605696],
+ [0.993866, 0.855711, 0.612482],
+ [0.993545, 0.862859, 0.619299],
+ [0.993170, 0.870024, 0.626189],
+ [0.992831, 0.877168, 0.633109],
+ [0.992440, 0.884330, 0.640099],
+ [0.992089, 0.891470, 0.647116],
+ [0.991688, 0.898627, 0.654202],
+ [0.991332, 0.905763, 0.661309],
+ [0.990930, 0.912915, 0.668481],
+ [0.990570, 0.920049, 0.675675],
+ [0.990175, 0.927196, 0.682926],
+ [0.989815, 0.934329, 0.690198],
+ [0.989434, 0.941470, 0.697519],
+ [0.989077, 0.948604, 0.704863],
+ [0.988717, 0.955742, 0.712242],
+ [0.988367, 0.962878, 0.719649],
+ [0.988033, 0.970012, 0.727077],
+ [0.987691, 0.977154, 0.734536],
+ [0.987387, 0.984288, 0.742002],
+ [0.987053, 0.991438, 0.749504]]
+
+_inferno_data = [[0.001462, 0.000466, 0.013866],
+ [0.002267, 0.001270, 0.018570],
+ [0.003299, 0.002249, 0.024239],
+ [0.004547, 0.003392, 0.030909],
+ [0.006006, 0.004692, 0.038558],
+ [0.007676, 0.006136, 0.046836],
+ [0.009561, 0.007713, 0.055143],
+ [0.011663, 0.009417, 0.063460],
+ [0.013995, 0.011225, 0.071862],
+ [0.016561, 0.013136, 0.080282],
+ [0.019373, 0.015133, 0.088767],
+ [0.022447, 0.017199, 0.097327],
+ [0.025793, 0.019331, 0.105930],
+ [0.029432, 0.021503, 0.114621],
+ [0.033385, 0.023702, 0.123397],
+ [0.037668, 0.025921, 0.132232],
+ [0.042253, 0.028139, 0.141141],
+ [0.046915, 0.030324, 0.150164],
+ [0.051644, 0.032474, 0.159254],
+ [0.056449, 0.034569, 0.168414],
+ [0.061340, 0.036590, 0.177642],
+ [0.066331, 0.038504, 0.186962],
+ [0.071429, 0.040294, 0.196354],
+ [0.076637, 0.041905, 0.205799],
+ [0.081962, 0.043328, 0.215289],
+ [0.087411, 0.044556, 0.224813],
+ [0.092990, 0.045583, 0.234358],
+ [0.098702, 0.046402, 0.243904],
+ [0.104551, 0.047008, 0.253430],
+ [0.110536, 0.047399, 0.262912],
+ [0.116656, 0.047574, 0.272321],
+ [0.122908, 0.047536, 0.281624],
+ [0.129285, 0.047293, 0.290788],
+ [0.135778, 0.046856, 0.299776],
+ [0.142378, 0.046242, 0.308553],
+ [0.149073, 0.045468, 0.317085],
+ [0.155850, 0.044559, 0.325338],
+ [0.162689, 0.043554, 0.333277],
+ [0.169575, 0.042489, 0.340874],
+ [0.176493, 0.041402, 0.348111],
+ [0.183429, 0.040329, 0.354971],
+ [0.190367, 0.039309, 0.361447],
+ [0.197297, 0.038400, 0.367535],
+ [0.204209, 0.037632, 0.373238],
+ [0.211095, 0.037030, 0.378563],
+ [0.217949, 0.036615, 0.383522],
+ [0.224763, 0.036405, 0.388129],
+ [0.231538, 0.036405, 0.392400],
+ [0.238273, 0.036621, 0.396353],
+ [0.244967, 0.037055, 0.400007],
+ [0.251620, 0.037705, 0.403378],
+ [0.258234, 0.038571, 0.406485],
+ [0.264810, 0.039647, 0.409345],
+ [0.271347, 0.040922, 0.411976],
+ [0.277850, 0.042353, 0.414392],
+ [0.284321, 0.043933, 0.416608],
+ [0.290763, 0.045644, 0.418637],
+ [0.297178, 0.047470, 0.420491],
+ [0.303568, 0.049396, 0.422182],
+ [0.309935, 0.051407, 0.423721],
+ [0.316282, 0.053490, 0.425116],
+ [0.322610, 0.055634, 0.426377],
+ [0.328921, 0.057827, 0.427511],
+ [0.335217, 0.060060, 0.428524],
+ [0.341500, 0.062325, 0.429425],
+ [0.347771, 0.064616, 0.430217],
+ [0.354032, 0.066925, 0.430906],
+ [0.360284, 0.069247, 0.431497],
+ [0.366529, 0.071579, 0.431994],
+ [0.372768, 0.073915, 0.432400],
+ [0.379001, 0.076253, 0.432719],
+ [0.385228, 0.078591, 0.432955],
+ [0.391453, 0.080927, 0.433109],
+ [0.397674, 0.083257, 0.433183],
+ [0.403894, 0.085580, 0.433179],
+ [0.410113, 0.087896, 0.433098],
+ [0.416331, 0.090203, 0.432943],
+ [0.422549, 0.092501, 0.432714],
+ [0.428768, 0.094790, 0.432412],
+ [0.434987, 0.097069, 0.432039],
+ [0.441207, 0.099338, 0.431594],
+ [0.447428, 0.101597, 0.431080],
+ [0.453651, 0.103848, 0.430498],
+ [0.459875, 0.106089, 0.429846],
+ [0.466100, 0.108322, 0.429125],
+ [0.472328, 0.110547, 0.428334],
+ [0.478558, 0.112764, 0.427475],
+ [0.484789, 0.114974, 0.426548],
+ [0.491022, 0.117179, 0.425552],
+ [0.497257, 0.119379, 0.424488],
+ [0.503493, 0.121575, 0.423356],
+ [0.509730, 0.123769, 0.422156],
+ [0.515967, 0.125960, 0.420887],
+ [0.522206, 0.128150, 0.419549],
+ [0.528444, 0.130341, 0.418142],
+ [0.534683, 0.132534, 0.416667],
+ [0.540920, 0.134729, 0.415123],
+ [0.547157, 0.136929, 0.413511],
+ [0.553392, 0.139134, 0.411829],
+ [0.559624, 0.141346, 0.410078],
+ [0.565854, 0.143567, 0.408258],
+ [0.572081, 0.145797, 0.406369],
+ [0.578304, 0.148039, 0.404411],
+ [0.584521, 0.150294, 0.402385],
+ [0.590734, 0.152563, 0.400290],
+ [0.596940, 0.154848, 0.398125],
+ [0.603139, 0.157151, 0.395891],
+ [0.609330, 0.159474, 0.393589],
+ [0.615513, 0.161817, 0.391219],
+ [0.621685, 0.164184, 0.388781],
+ [0.627847, 0.166575, 0.386276],
+ [0.633998, 0.168992, 0.383704],
+ [0.640135, 0.171438, 0.381065],
+ [0.646260, 0.173914, 0.378359],
+ [0.652369, 0.176421, 0.375586],
+ [0.658463, 0.178962, 0.372748],
+ [0.664540, 0.181539, 0.369846],
+ [0.670599, 0.184153, 0.366879],
+ [0.676638, 0.186807, 0.363849],
+ [0.682656, 0.189501, 0.360757],
+ [0.688653, 0.192239, 0.357603],
+ [0.694627, 0.195021, 0.354388],
+ [0.700576, 0.197851, 0.351113],
+ [0.706500, 0.200728, 0.347777],
+ [0.712396, 0.203656, 0.344383],
+ [0.718264, 0.206636, 0.340931],
+ [0.724103, 0.209670, 0.337424],
+ [0.729909, 0.212759, 0.333861],
+ [0.735683, 0.215906, 0.330245],
+ [0.741423, 0.219112, 0.326576],
+ [0.747127, 0.222378, 0.322856],
+ [0.752794, 0.225706, 0.319085],
+ [0.758422, 0.229097, 0.315266],
+ [0.764010, 0.232554, 0.311399],
+ [0.769556, 0.236077, 0.307485],
+ [0.775059, 0.239667, 0.303526],
+ [0.780517, 0.243327, 0.299523],
+ [0.785929, 0.247056, 0.295477],
+ [0.791293, 0.250856, 0.291390],
+ [0.796607, 0.254728, 0.287264],
+ [0.801871, 0.258674, 0.283099],
+ [0.807082, 0.262692, 0.278898],
+ [0.812239, 0.266786, 0.274661],
+ [0.817341, 0.270954, 0.270390],
+ [0.822386, 0.275197, 0.266085],
+ [0.827372, 0.279517, 0.261750],
+ [0.832299, 0.283913, 0.257383],
+ [0.837165, 0.288385, 0.252988],
+ [0.841969, 0.292933, 0.248564],
+ [0.846709, 0.297559, 0.244113],
+ [0.851384, 0.302260, 0.239636],
+ [0.855992, 0.307038, 0.235133],
+ [0.860533, 0.311892, 0.230606],
+ [0.865006, 0.316822, 0.226055],
+ [0.869409, 0.321827, 0.221482],
+ [0.873741, 0.326906, 0.216886],
+ [0.878001, 0.332060, 0.212268],
+ [0.882188, 0.337287, 0.207628],
+ [0.886302, 0.342586, 0.202968],
+ [0.890341, 0.347957, 0.198286],
+ [0.894305, 0.353399, 0.193584],
+ [0.898192, 0.358911, 0.188860],
+ [0.902003, 0.364492, 0.184116],
+ [0.905735, 0.370140, 0.179350],
+ [0.909390, 0.375856, 0.174563],
+ [0.912966, 0.381636, 0.169755],
+ [0.916462, 0.387481, 0.164924],
+ [0.919879, 0.393389, 0.160070],
+ [0.923215, 0.399359, 0.155193],
+ [0.926470, 0.405389, 0.150292],
+ [0.929644, 0.411479, 0.145367],
+ [0.932737, 0.417627, 0.140417],
+ [0.935747, 0.423831, 0.135440],
+ [0.938675, 0.430091, 0.130438],
+ [0.941521, 0.436405, 0.125409],
+ [0.944285, 0.442772, 0.120354],
+ [0.946965, 0.449191, 0.115272],
+ [0.949562, 0.455660, 0.110164],
+ [0.952075, 0.462178, 0.105031],
+ [0.954506, 0.468744, 0.099874],
+ [0.956852, 0.475356, 0.094695],
+ [0.959114, 0.482014, 0.089499],
+ [0.961293, 0.488716, 0.084289],
+ [0.963387, 0.495462, 0.079073],
+ [0.965397, 0.502249, 0.073859],
+ [0.967322, 0.509078, 0.068659],
+ [0.969163, 0.515946, 0.063488],
+ [0.970919, 0.522853, 0.058367],
+ [0.972590, 0.529798, 0.053324],
+ [0.974176, 0.536780, 0.048392],
+ [0.975677, 0.543798, 0.043618],
+ [0.977092, 0.550850, 0.039050],
+ [0.978422, 0.557937, 0.034931],
+ [0.979666, 0.565057, 0.031409],
+ [0.980824, 0.572209, 0.028508],
+ [0.981895, 0.579392, 0.026250],
+ [0.982881, 0.586606, 0.024661],
+ [0.983779, 0.593849, 0.023770],
+ [0.984591, 0.601122, 0.023606],
+ [0.985315, 0.608422, 0.024202],
+ [0.985952, 0.615750, 0.025592],
+ [0.986502, 0.623105, 0.027814],
+ [0.986964, 0.630485, 0.030908],
+ [0.987337, 0.637890, 0.034916],
+ [0.987622, 0.645320, 0.039886],
+ [0.987819, 0.652773, 0.045581],
+ [0.987926, 0.660250, 0.051750],
+ [0.987945, 0.667748, 0.058329],
+ [0.987874, 0.675267, 0.065257],
+ [0.987714, 0.682807, 0.072489],
+ [0.987464, 0.690366, 0.079990],
+ [0.987124, 0.697944, 0.087731],
+ [0.986694, 0.705540, 0.095694],
+ [0.986175, 0.713153, 0.103863],
+ [0.985566, 0.720782, 0.112229],
+ [0.984865, 0.728427, 0.120785],
+ [0.984075, 0.736087, 0.129527],
+ [0.983196, 0.743758, 0.138453],
+ [0.982228, 0.751442, 0.147565],
+ [0.981173, 0.759135, 0.156863],
+ [0.980032, 0.766837, 0.166353],
+ [0.978806, 0.774545, 0.176037],
+ [0.977497, 0.782258, 0.185923],
+ [0.976108, 0.789974, 0.196018],
+ [0.974638, 0.797692, 0.206332],
+ [0.973088, 0.805409, 0.216877],
+ [0.971468, 0.813122, 0.227658],
+ [0.969783, 0.820825, 0.238686],
+ [0.968041, 0.828515, 0.249972],
+ [0.966243, 0.836191, 0.261534],
+ [0.964394, 0.843848, 0.273391],
+ [0.962517, 0.851476, 0.285546],
+ [0.960626, 0.859069, 0.298010],
+ [0.958720, 0.866624, 0.310820],
+ [0.956834, 0.874129, 0.323974],
+ [0.954997, 0.881569, 0.337475],
+ [0.953215, 0.888942, 0.351369],
+ [0.951546, 0.896226, 0.365627],
+ [0.950018, 0.903409, 0.380271],
+ [0.948683, 0.910473, 0.395289],
+ [0.947594, 0.917399, 0.410665],
+ [0.946809, 0.924168, 0.426373],
+ [0.946392, 0.930761, 0.442367],
+ [0.946403, 0.937159, 0.458592],
+ [0.946903, 0.943348, 0.474970],
+ [0.947937, 0.949318, 0.491426],
+ [0.949545, 0.955063, 0.507860],
+ [0.951740, 0.960587, 0.524203],
+ [0.954529, 0.965896, 0.540361],
+ [0.957896, 0.971003, 0.556275],
+ [0.961812, 0.975924, 0.571925],
+ [0.966249, 0.980678, 0.587206],
+ [0.971162, 0.985282, 0.602154],
+ [0.976511, 0.989753, 0.616760],
+ [0.982257, 0.994109, 0.631017],
+ [0.988362, 0.998364, 0.644924]]
+
+_plasma_data = [[0.050383, 0.029803, 0.527975],
+ [0.063536, 0.028426, 0.533124],
+ [0.075353, 0.027206, 0.538007],
+ [0.086222, 0.026125, 0.542658],
+ [0.096379, 0.025165, 0.547103],
+ [0.105980, 0.024309, 0.551368],
+ [0.115124, 0.023556, 0.555468],
+ [0.123903, 0.022878, 0.559423],
+ [0.132381, 0.022258, 0.563250],
+ [0.140603, 0.021687, 0.566959],
+ [0.148607, 0.021154, 0.570562],
+ [0.156421, 0.020651, 0.574065],
+ [0.164070, 0.020171, 0.577478],
+ [0.171574, 0.019706, 0.580806],
+ [0.178950, 0.019252, 0.584054],
+ [0.186213, 0.018803, 0.587228],
+ [0.193374, 0.018354, 0.590330],
+ [0.200445, 0.017902, 0.593364],
+ [0.207435, 0.017442, 0.596333],
+ [0.214350, 0.016973, 0.599239],
+ [0.221197, 0.016497, 0.602083],
+ [0.227983, 0.016007, 0.604867],
+ [0.234715, 0.015502, 0.607592],
+ [0.241396, 0.014979, 0.610259],
+ [0.248032, 0.014439, 0.612868],
+ [0.254627, 0.013882, 0.615419],
+ [0.261183, 0.013308, 0.617911],
+ [0.267703, 0.012716, 0.620346],
+ [0.274191, 0.012109, 0.622722],
+ [0.280648, 0.011488, 0.625038],
+ [0.287076, 0.010855, 0.627295],
+ [0.293478, 0.010213, 0.629490],
+ [0.299855, 0.009561, 0.631624],
+ [0.306210, 0.008902, 0.633694],
+ [0.312543, 0.008239, 0.635700],
+ [0.318856, 0.007576, 0.637640],
+ [0.325150, 0.006915, 0.639512],
+ [0.331426, 0.006261, 0.641316],
+ [0.337683, 0.005618, 0.643049],
+ [0.343925, 0.004991, 0.644710],
+ [0.350150, 0.004382, 0.646298],
+ [0.356359, 0.003798, 0.647810],
+ [0.362553, 0.003243, 0.649245],
+ [0.368733, 0.002724, 0.650601],
+ [0.374897, 0.002245, 0.651876],
+ [0.381047, 0.001814, 0.653068],
+ [0.387183, 0.001434, 0.654177],
+ [0.393304, 0.001114, 0.655199],
+ [0.399411, 0.000859, 0.656133],
+ [0.405503, 0.000678, 0.656977],
+ [0.411580, 0.000577, 0.657730],
+ [0.417642, 0.000564, 0.658390],
+ [0.423689, 0.000646, 0.658956],
+ [0.429719, 0.000831, 0.659425],
+ [0.435734, 0.001127, 0.659797],
+ [0.441732, 0.001540, 0.660069],
+ [0.447714, 0.002080, 0.660240],
+ [0.453677, 0.002755, 0.660310],
+ [0.459623, 0.003574, 0.660277],
+ [0.465550, 0.004545, 0.660139],
+ [0.471457, 0.005678, 0.659897],
+ [0.477344, 0.006980, 0.659549],
+ [0.483210, 0.008460, 0.659095],
+ [0.489055, 0.010127, 0.658534],
+ [0.494877, 0.011990, 0.657865],
+ [0.500678, 0.014055, 0.657088],
+ [0.506454, 0.016333, 0.656202],
+ [0.512206, 0.018833, 0.655209],
+ [0.517933, 0.021563, 0.654109],
+ [0.523633, 0.024532, 0.652901],
+ [0.529306, 0.027747, 0.651586],
+ [0.534952, 0.031217, 0.650165],
+ [0.540570, 0.034950, 0.648640],
+ [0.546157, 0.038954, 0.647010],
+ [0.551715, 0.043136, 0.645277],
+ [0.557243, 0.047331, 0.643443],
+ [0.562738, 0.051545, 0.641509],
+ [0.568201, 0.055778, 0.639477],
+ [0.573632, 0.060028, 0.637349],
+ [0.579029, 0.064296, 0.635126],
+ [0.584391, 0.068579, 0.632812],
+ [0.589719, 0.072878, 0.630408],
+ [0.595011, 0.077190, 0.627917],
+ [0.600266, 0.081516, 0.625342],
+ [0.605485, 0.085854, 0.622686],
+ [0.610667, 0.090204, 0.619951],
+ [0.615812, 0.094564, 0.617140],
+ [0.620919, 0.098934, 0.614257],
+ [0.625987, 0.103312, 0.611305],
+ [0.631017, 0.107699, 0.608287],
+ [0.636008, 0.112092, 0.605205],
+ [0.640959, 0.116492, 0.602065],
+ [0.645872, 0.120898, 0.598867],
+ [0.650746, 0.125309, 0.595617],
+ [0.655580, 0.129725, 0.592317],
+ [0.660374, 0.134144, 0.588971],
+ [0.665129, 0.138566, 0.585582],
+ [0.669845, 0.142992, 0.582154],
+ [0.674522, 0.147419, 0.578688],
+ [0.679160, 0.151848, 0.575189],
+ [0.683758, 0.156278, 0.571660],
+ [0.688318, 0.160709, 0.568103],
+ [0.692840, 0.165141, 0.564522],
+ [0.697324, 0.169573, 0.560919],
+ [0.701769, 0.174005, 0.557296],
+ [0.706178, 0.178437, 0.553657],
+ [0.710549, 0.182868, 0.550004],
+ [0.714883, 0.187299, 0.546338],
+ [0.719181, 0.191729, 0.542663],
+ [0.723444, 0.196158, 0.538981],
+ [0.727670, 0.200586, 0.535293],
+ [0.731862, 0.205013, 0.531601],
+ [0.736019, 0.209439, 0.527908],
+ [0.740143, 0.213864, 0.524216],
+ [0.744232, 0.218288, 0.520524],
+ [0.748289, 0.222711, 0.516834],
+ [0.752312, 0.227133, 0.513149],
+ [0.756304, 0.231555, 0.509468],
+ [0.760264, 0.235976, 0.505794],
+ [0.764193, 0.240396, 0.502126],
+ [0.768090, 0.244817, 0.498465],
+ [0.771958, 0.249237, 0.494813],
+ [0.775796, 0.253658, 0.491171],
+ [0.779604, 0.258078, 0.487539],
+ [0.783383, 0.262500, 0.483918],
+ [0.787133, 0.266922, 0.480307],
+ [0.790855, 0.271345, 0.476706],
+ [0.794549, 0.275770, 0.473117],
+ [0.798216, 0.280197, 0.469538],
+ [0.801855, 0.284626, 0.465971],
+ [0.805467, 0.289057, 0.462415],
+ [0.809052, 0.293491, 0.458870],
+ [0.812612, 0.297928, 0.455338],
+ [0.816144, 0.302368, 0.451816],
+ [0.819651, 0.306812, 0.448306],
+ [0.823132, 0.311261, 0.444806],
+ [0.826588, 0.315714, 0.441316],
+ [0.830018, 0.320172, 0.437836],
+ [0.833422, 0.324635, 0.434366],
+ [0.836801, 0.329105, 0.430905],
+ [0.840155, 0.333580, 0.427455],
+ [0.843484, 0.338062, 0.424013],
+ [0.846788, 0.342551, 0.420579],
+ [0.850066, 0.347048, 0.417153],
+ [0.853319, 0.351553, 0.413734],
+ [0.856547, 0.356066, 0.410322],
+ [0.859750, 0.360588, 0.406917],
+ [0.862927, 0.365119, 0.403519],
+ [0.866078, 0.369660, 0.400126],
+ [0.869203, 0.374212, 0.396738],
+ [0.872303, 0.378774, 0.393355],
+ [0.875376, 0.383347, 0.389976],
+ [0.878423, 0.387932, 0.386600],
+ [0.881443, 0.392529, 0.383229],
+ [0.884436, 0.397139, 0.379860],
+ [0.887402, 0.401762, 0.376494],
+ [0.890340, 0.406398, 0.373130],
+ [0.893250, 0.411048, 0.369768],
+ [0.896131, 0.415712, 0.366407],
+ [0.898984, 0.420392, 0.363047],
+ [0.901807, 0.425087, 0.359688],
+ [0.904601, 0.429797, 0.356329],
+ [0.907365, 0.434524, 0.352970],
+ [0.910098, 0.439268, 0.349610],
+ [0.912800, 0.444029, 0.346251],
+ [0.915471, 0.448807, 0.342890],
+ [0.918109, 0.453603, 0.339529],
+ [0.920714, 0.458417, 0.336166],
+ [0.923287, 0.463251, 0.332801],
+ [0.925825, 0.468103, 0.329435],
+ [0.928329, 0.472975, 0.326067],
+ [0.930798, 0.477867, 0.322697],
+ [0.933232, 0.482780, 0.319325],
+ [0.935630, 0.487712, 0.315952],
+ [0.937990, 0.492667, 0.312575],
+ [0.940313, 0.497642, 0.309197],
+ [0.942598, 0.502639, 0.305816],
+ [0.944844, 0.507658, 0.302433],
+ [0.947051, 0.512699, 0.299049],
+ [0.949217, 0.517763, 0.295662],
+ [0.951344, 0.522850, 0.292275],
+ [0.953428, 0.527960, 0.288883],
+ [0.955470, 0.533093, 0.285490],
+ [0.957469, 0.538250, 0.282096],
+ [0.959424, 0.543431, 0.278701],
+ [0.961336, 0.548636, 0.275305],
+ [0.963203, 0.553865, 0.271909],
+ [0.965024, 0.559118, 0.268513],
+ [0.966798, 0.564396, 0.265118],
+ [0.968526, 0.569700, 0.261721],
+ [0.970205, 0.575028, 0.258325],
+ [0.971835, 0.580382, 0.254931],
+ [0.973416, 0.585761, 0.251540],
+ [0.974947, 0.591165, 0.248151],
+ [0.976428, 0.596595, 0.244767],
+ [0.977856, 0.602051, 0.241387],
+ [0.979233, 0.607532, 0.238013],
+ [0.980556, 0.613039, 0.234646],
+ [0.981826, 0.618572, 0.231287],
+ [0.983041, 0.624131, 0.227937],
+ [0.984199, 0.629718, 0.224595],
+ [0.985301, 0.635330, 0.221265],
+ [0.986345, 0.640969, 0.217948],
+ [0.987332, 0.646633, 0.214648],
+ [0.988260, 0.652325, 0.211364],
+ [0.989128, 0.658043, 0.208100],
+ [0.989935, 0.663787, 0.204859],
+ [0.990681, 0.669558, 0.201642],
+ [0.991365, 0.675355, 0.198453],
+ [0.991985, 0.681179, 0.195295],
+ [0.992541, 0.687030, 0.192170],
+ [0.993032, 0.692907, 0.189084],
+ [0.993456, 0.698810, 0.186041],
+ [0.993814, 0.704741, 0.183043],
+ [0.994103, 0.710698, 0.180097],
+ [0.994324, 0.716681, 0.177208],
+ [0.994474, 0.722691, 0.174381],
+ [0.994553, 0.728728, 0.171622],
+ [0.994561, 0.734791, 0.168938],
+ [0.994495, 0.740880, 0.166335],
+ [0.994355, 0.746995, 0.163821],
+ [0.994141, 0.753137, 0.161404],
+ [0.993851, 0.759304, 0.159092],
+ [0.993482, 0.765499, 0.156891],
+ [0.993033, 0.771720, 0.154808],
+ [0.992505, 0.777967, 0.152855],
+ [0.991897, 0.784239, 0.151042],
+ [0.991209, 0.790537, 0.149377],
+ [0.990439, 0.796859, 0.147870],
+ [0.989587, 0.803205, 0.146529],
+ [0.988648, 0.809579, 0.145357],
+ [0.987621, 0.815978, 0.144363],
+ [0.986509, 0.822401, 0.143557],
+ [0.985314, 0.828846, 0.142945],
+ [0.984031, 0.835315, 0.142528],
+ [0.982653, 0.841812, 0.142303],
+ [0.981190, 0.848329, 0.142279],
+ [0.979644, 0.854866, 0.142453],
+ [0.977995, 0.861432, 0.142808],
+ [0.976265, 0.868016, 0.143351],
+ [0.974443, 0.874622, 0.144061],
+ [0.972530, 0.881250, 0.144923],
+ [0.970533, 0.887896, 0.145919],
+ [0.968443, 0.894564, 0.147014],
+ [0.966271, 0.901249, 0.148180],
+ [0.964021, 0.907950, 0.149370],
+ [0.961681, 0.914672, 0.150520],
+ [0.959276, 0.921407, 0.151566],
+ [0.956808, 0.928152, 0.152409],
+ [0.954287, 0.934908, 0.152921],
+ [0.951726, 0.941671, 0.152925],
+ [0.949151, 0.948435, 0.152178],
+ [0.946602, 0.955190, 0.150328],
+ [0.944152, 0.961916, 0.146861],
+ [0.941896, 0.968590, 0.140956],
+ [0.940015, 0.975158, 0.131326]]
+
+_viridis_data = [[0.267004, 0.004874, 0.329415],
+ [0.268510, 0.009605, 0.335427],
+ [0.269944, 0.014625, 0.341379],
+ [0.271305, 0.019942, 0.347269],
+ [0.272594, 0.025563, 0.353093],
+ [0.273809, 0.031497, 0.358853],
+ [0.274952, 0.037752, 0.364543],
+ [0.276022, 0.044167, 0.370164],
+ [0.277018, 0.050344, 0.375715],
+ [0.277941, 0.056324, 0.381191],
+ [0.278791, 0.062145, 0.386592],
+ [0.279566, 0.067836, 0.391917],
+ [0.280267, 0.073417, 0.397163],
+ [0.280894, 0.078907, 0.402329],
+ [0.281446, 0.084320, 0.407414],
+ [0.281924, 0.089666, 0.412415],
+ [0.282327, 0.094955, 0.417331],
+ [0.282656, 0.100196, 0.422160],
+ [0.282910, 0.105393, 0.426902],
+ [0.283091, 0.110553, 0.431554],
+ [0.283197, 0.115680, 0.436115],
+ [0.283229, 0.120777, 0.440584],
+ [0.283187, 0.125848, 0.444960],
+ [0.283072, 0.130895, 0.449241],
+ [0.282884, 0.135920, 0.453427],
+ [0.282623, 0.140926, 0.457517],
+ [0.282290, 0.145912, 0.461510],
+ [0.281887, 0.150881, 0.465405],
+ [0.281412, 0.155834, 0.469201],
+ [0.280868, 0.160771, 0.472899],
+ [0.280255, 0.165693, 0.476498],
+ [0.279574, 0.170599, 0.479997],
+ [0.278826, 0.175490, 0.483397],
+ [0.278012, 0.180367, 0.486697],
+ [0.277134, 0.185228, 0.489898],
+ [0.276194, 0.190074, 0.493001],
+ [0.275191, 0.194905, 0.496005],
+ [0.274128, 0.199721, 0.498911],
+ [0.273006, 0.204520, 0.501721],
+ [0.271828, 0.209303, 0.504434],
+ [0.270595, 0.214069, 0.507052],
+ [0.269308, 0.218818, 0.509577],
+ [0.267968, 0.223549, 0.512008],
+ [0.266580, 0.228262, 0.514349],
+ [0.265145, 0.232956, 0.516599],
+ [0.263663, 0.237631, 0.518762],
+ [0.262138, 0.242286, 0.520837],
+ [0.260571, 0.246922, 0.522828],
+ [0.258965, 0.251537, 0.524736],
+ [0.257322, 0.256130, 0.526563],
+ [0.255645, 0.260703, 0.528312],
+ [0.253935, 0.265254, 0.529983],
+ [0.252194, 0.269783, 0.531579],
+ [0.250425, 0.274290, 0.533103],
+ [0.248629, 0.278775, 0.534556],
+ [0.246811, 0.283237, 0.535941],
+ [0.244972, 0.287675, 0.537260],
+ [0.243113, 0.292092, 0.538516],
+ [0.241237, 0.296485, 0.539709],
+ [0.239346, 0.300855, 0.540844],
+ [0.237441, 0.305202, 0.541921],
+ [0.235526, 0.309527, 0.542944],
+ [0.233603, 0.313828, 0.543914],
+ [0.231674, 0.318106, 0.544834],
+ [0.229739, 0.322361, 0.545706],
+ [0.227802, 0.326594, 0.546532],
+ [0.225863, 0.330805, 0.547314],
+ [0.223925, 0.334994, 0.548053],
+ [0.221989, 0.339161, 0.548752],
+ [0.220057, 0.343307, 0.549413],
+ [0.218130, 0.347432, 0.550038],
+ [0.216210, 0.351535, 0.550627],
+ [0.214298, 0.355619, 0.551184],
+ [0.212395, 0.359683, 0.551710],
+ [0.210503, 0.363727, 0.552206],
+ [0.208623, 0.367752, 0.552675],
+ [0.206756, 0.371758, 0.553117],
+ [0.204903, 0.375746, 0.553533],
+ [0.203063, 0.379716, 0.553925],
+ [0.201239, 0.383670, 0.554294],
+ [0.199430, 0.387607, 0.554642],
+ [0.197636, 0.391528, 0.554969],
+ [0.195860, 0.395433, 0.555276],
+ [0.194100, 0.399323, 0.555565],
+ [0.192357, 0.403199, 0.555836],
+ [0.190631, 0.407061, 0.556089],
+ [0.188923, 0.410910, 0.556326],
+ [0.187231, 0.414746, 0.556547],
+ [0.185556, 0.418570, 0.556753],
+ [0.183898, 0.422383, 0.556944],
+ [0.182256, 0.426184, 0.557120],
+ [0.180629, 0.429975, 0.557282],
+ [0.179019, 0.433756, 0.557430],
+ [0.177423, 0.437527, 0.557565],
+ [0.175841, 0.441290, 0.557685],
+ [0.174274, 0.445044, 0.557792],
+ [0.172719, 0.448791, 0.557885],
+ [0.171176, 0.452530, 0.557965],
+ [0.169646, 0.456262, 0.558030],
+ [0.168126, 0.459988, 0.558082],
+ [0.166617, 0.463708, 0.558119],
+ [0.165117, 0.467423, 0.558141],
+ [0.163625, 0.471133, 0.558148],
+ [0.162142, 0.474838, 0.558140],
+ [0.160665, 0.478540, 0.558115],
+ [0.159194, 0.482237, 0.558073],
+ [0.157729, 0.485932, 0.558013],
+ [0.156270, 0.489624, 0.557936],
+ [0.154815, 0.493313, 0.557840],
+ [0.153364, 0.497000, 0.557724],
+ [0.151918, 0.500685, 0.557587],
+ [0.150476, 0.504369, 0.557430],
+ [0.149039, 0.508051, 0.557250],
+ [0.147607, 0.511733, 0.557049],
+ [0.146180, 0.515413, 0.556823],
+ [0.144759, 0.519093, 0.556572],
+ [0.143343, 0.522773, 0.556295],
+ [0.141935, 0.526453, 0.555991],
+ [0.140536, 0.530132, 0.555659],
+ [0.139147, 0.533812, 0.555298],
+ [0.137770, 0.537492, 0.554906],
+ [0.136408, 0.541173, 0.554483],
+ [0.135066, 0.544853, 0.554029],
+ [0.133743, 0.548535, 0.553541],
+ [0.132444, 0.552216, 0.553018],
+ [0.131172, 0.555899, 0.552459],
+ [0.129933, 0.559582, 0.551864],
+ [0.128729, 0.563265, 0.551229],
+ [0.127568, 0.566949, 0.550556],
+ [0.126453, 0.570633, 0.549841],
+ [0.125394, 0.574318, 0.549086],
+ [0.124395, 0.578002, 0.548287],
+ [0.123463, 0.581687, 0.547445],
+ [0.122606, 0.585371, 0.546557],
+ [0.121831, 0.589055, 0.545623],
+ [0.121148, 0.592739, 0.544641],
+ [0.120565, 0.596422, 0.543611],
+ [0.120092, 0.600104, 0.542530],
+ [0.119738, 0.603785, 0.541400],
+ [0.119512, 0.607464, 0.540218],
+ [0.119423, 0.611141, 0.538982],
+ [0.119483, 0.614817, 0.537692],
+ [0.119699, 0.618490, 0.536347],
+ [0.120081, 0.622161, 0.534946],
+ [0.120638, 0.625828, 0.533488],
+ [0.121380, 0.629492, 0.531973],
+ [0.122312, 0.633153, 0.530398],
+ [0.123444, 0.636809, 0.528763],
+ [0.124780, 0.640461, 0.527068],
+ [0.126326, 0.644107, 0.525311],
+ [0.128087, 0.647749, 0.523491],
+ [0.130067, 0.651384, 0.521608],
+ [0.132268, 0.655014, 0.519661],
+ [0.134692, 0.658636, 0.517649],
+ [0.137339, 0.662252, 0.515571],
+ [0.140210, 0.665859, 0.513427],
+ [0.143303, 0.669459, 0.511215],
+ [0.146616, 0.673050, 0.508936],
+ [0.150148, 0.676631, 0.506589],
+ [0.153894, 0.680203, 0.504172],
+ [0.157851, 0.683765, 0.501686],
+ [0.162016, 0.687316, 0.499129],
+ [0.166383, 0.690856, 0.496502],
+ [0.170948, 0.694384, 0.493803],
+ [0.175707, 0.697900, 0.491033],
+ [0.180653, 0.701402, 0.488189],
+ [0.185783, 0.704891, 0.485273],
+ [0.191090, 0.708366, 0.482284],
+ [0.196571, 0.711827, 0.479221],
+ [0.202219, 0.715272, 0.476084],
+ [0.208030, 0.718701, 0.472873],
+ [0.214000, 0.722114, 0.469588],
+ [0.220124, 0.725509, 0.466226],
+ [0.226397, 0.728888, 0.462789],
+ [0.232815, 0.732247, 0.459277],
+ [0.239374, 0.735588, 0.455688],
+ [0.246070, 0.738910, 0.452024],
+ [0.252899, 0.742211, 0.448284],
+ [0.259857, 0.745492, 0.444467],
+ [0.266941, 0.748751, 0.440573],
+ [0.274149, 0.751988, 0.436601],
+ [0.281477, 0.755203, 0.432552],
+ [0.288921, 0.758394, 0.428426],
+ [0.296479, 0.761561, 0.424223],
+ [0.304148, 0.764704, 0.419943],
+ [0.311925, 0.767822, 0.415586],
+ [0.319809, 0.770914, 0.411152],
+ [0.327796, 0.773980, 0.406640],
+ [0.335885, 0.777018, 0.402049],
+ [0.344074, 0.780029, 0.397381],
+ [0.352360, 0.783011, 0.392636],
+ [0.360741, 0.785964, 0.387814],
+ [0.369214, 0.788888, 0.382914],
+ [0.377779, 0.791781, 0.377939],
+ [0.386433, 0.794644, 0.372886],
+ [0.395174, 0.797475, 0.367757],
+ [0.404001, 0.800275, 0.362552],
+ [0.412913, 0.803041, 0.357269],
+ [0.421908, 0.805774, 0.351910],
+ [0.430983, 0.808473, 0.346476],
+ [0.440137, 0.811138, 0.340967],
+ [0.449368, 0.813768, 0.335384],
+ [0.458674, 0.816363, 0.329727],
+ [0.468053, 0.818921, 0.323998],
+ [0.477504, 0.821444, 0.318195],
+ [0.487026, 0.823929, 0.312321],
+ [0.496615, 0.826376, 0.306377],
+ [0.506271, 0.828786, 0.300362],
+ [0.515992, 0.831158, 0.294279],
+ [0.525776, 0.833491, 0.288127],
+ [0.535621, 0.835785, 0.281908],
+ [0.545524, 0.838039, 0.275626],
+ [0.555484, 0.840254, 0.269281],
+ [0.565498, 0.842430, 0.262877],
+ [0.575563, 0.844566, 0.256415],
+ [0.585678, 0.846661, 0.249897],
+ [0.595839, 0.848717, 0.243329],
+ [0.606045, 0.850733, 0.236712],
+ [0.616293, 0.852709, 0.230052],
+ [0.626579, 0.854645, 0.223353],
+ [0.636902, 0.856542, 0.216620],
+ [0.647257, 0.858400, 0.209861],
+ [0.657642, 0.860219, 0.203082],
+ [0.668054, 0.861999, 0.196293],
+ [0.678489, 0.863742, 0.189503],
+ [0.688944, 0.865448, 0.182725],
+ [0.699415, 0.867117, 0.175971],
+ [0.709898, 0.868751, 0.169257],
+ [0.720391, 0.870350, 0.162603],
+ [0.730889, 0.871916, 0.156029],
+ [0.741388, 0.873449, 0.149561],
+ [0.751884, 0.874951, 0.143228],
+ [0.762373, 0.876424, 0.137064],
+ [0.772852, 0.877868, 0.131109],
+ [0.783315, 0.879285, 0.125405],
+ [0.793760, 0.880678, 0.120005],
+ [0.804182, 0.882046, 0.114965],
+ [0.814576, 0.883393, 0.110347],
+ [0.824940, 0.884720, 0.106217],
+ [0.835270, 0.886029, 0.102646],
+ [0.845561, 0.887322, 0.099702],
+ [0.855810, 0.888601, 0.097452],
+ [0.866013, 0.889868, 0.095953],
+ [0.876168, 0.891125, 0.095250],
+ [0.886271, 0.892374, 0.095374],
+ [0.896320, 0.893616, 0.096335],
+ [0.906311, 0.894855, 0.098125],
+ [0.916242, 0.896091, 0.100717],
+ [0.926106, 0.897330, 0.104071],
+ [0.935904, 0.898570, 0.108131],
+ [0.945636, 0.899815, 0.112838],
+ [0.955300, 0.901065, 0.118128],
+ [0.964894, 0.902323, 0.123941],
+ [0.974417, 0.903590, 0.130215],
+ [0.983868, 0.904867, 0.136897],
+ [0.993248, 0.906157, 0.143936]]
+
+_cividis_data = [[0.000000, 0.135112, 0.304751],
+ [0.000000, 0.138068, 0.311105],
+ [0.000000, 0.141013, 0.317579],
+ [0.000000, 0.143951, 0.323982],
+ [0.000000, 0.146877, 0.330479],
+ [0.000000, 0.149791, 0.337065],
+ [0.000000, 0.152673, 0.343704],
+ [0.000000, 0.155377, 0.350500],
+ [0.000000, 0.157932, 0.357521],
+ [0.000000, 0.160495, 0.364534],
+ [0.000000, 0.163058, 0.371608],
+ [0.000000, 0.165621, 0.378769],
+ [0.000000, 0.168204, 0.385902],
+ [0.000000, 0.170800, 0.393100],
+ [0.000000, 0.173420, 0.400353],
+ [0.000000, 0.176082, 0.407577],
+ [0.000000, 0.178802, 0.414764],
+ [0.000000, 0.181610, 0.421859],
+ [0.000000, 0.184550, 0.428802],
+ [0.000000, 0.186915, 0.435532],
+ [0.000000, 0.188769, 0.439563],
+ [0.000000, 0.190950, 0.441085],
+ [0.000000, 0.193366, 0.441561],
+ [0.003602, 0.195911, 0.441564],
+ [0.017852, 0.198528, 0.441248],
+ [0.032110, 0.201199, 0.440785],
+ [0.046205, 0.203903, 0.440196],
+ [0.058378, 0.206629, 0.439531],
+ [0.068968, 0.209372, 0.438863],
+ [0.078624, 0.212122, 0.438105],
+ [0.087465, 0.214879, 0.437342],
+ [0.095645, 0.217643, 0.436593],
+ [0.103401, 0.220406, 0.435790],
+ [0.110658, 0.223170, 0.435067],
+ [0.117612, 0.225935, 0.434308],
+ [0.124291, 0.228697, 0.433547],
+ [0.130669, 0.231458, 0.432840],
+ [0.136830, 0.234216, 0.432148],
+ [0.142852, 0.236972, 0.431404],
+ [0.148638, 0.239724, 0.430752],
+ [0.154261, 0.242475, 0.430120],
+ [0.159733, 0.245221, 0.429528],
+ [0.165113, 0.247965, 0.428908],
+ [0.170362, 0.250707, 0.428325],
+ [0.175490, 0.253444, 0.427790],
+ [0.180503, 0.256180, 0.427299],
+ [0.185453, 0.258914, 0.426788],
+ [0.190303, 0.261644, 0.426329],
+ [0.195057, 0.264372, 0.425924],
+ [0.199764, 0.267099, 0.425497],
+ [0.204385, 0.269823, 0.425126],
+ [0.208926, 0.272546, 0.424809],
+ [0.213431, 0.275266, 0.424480],
+ [0.217863, 0.277985, 0.424206],
+ [0.222264, 0.280702, 0.423914],
+ [0.226598, 0.283419, 0.423678],
+ [0.230871, 0.286134, 0.423498],
+ [0.235120, 0.288848, 0.423304],
+ [0.239312, 0.291562, 0.423167],
+ [0.243485, 0.294274, 0.423014],
+ [0.247605, 0.296986, 0.422917],
+ [0.251675, 0.299698, 0.422873],
+ [0.255731, 0.302409, 0.422814],
+ [0.259740, 0.305120, 0.422810],
+ [0.263738, 0.307831, 0.422789],
+ [0.267693, 0.310542, 0.422821],
+ [0.271639, 0.313253, 0.422837],
+ [0.275513, 0.315965, 0.422979],
+ [0.279411, 0.318677, 0.423031],
+ [0.283240, 0.321390, 0.423211],
+ [0.287065, 0.324103, 0.423373],
+ [0.290884, 0.326816, 0.423517],
+ [0.294669, 0.329531, 0.423716],
+ [0.298421, 0.332247, 0.423973],
+ [0.302169, 0.334963, 0.424213],
+ [0.305886, 0.337681, 0.424512],
+ [0.309601, 0.340399, 0.424790],
+ [0.313287, 0.343120, 0.425120],
+ [0.316941, 0.345842, 0.425512],
+ [0.320595, 0.348565, 0.425889],
+ [0.324250, 0.351289, 0.426250],
+ [0.327875, 0.354016, 0.426670],
+ [0.331474, 0.356744, 0.427144],
+ [0.335073, 0.359474, 0.427605],
+ [0.338673, 0.362206, 0.428053],
+ [0.342246, 0.364939, 0.428559],
+ [0.345793, 0.367676, 0.429127],
+ [0.349341, 0.370414, 0.429685],
+ [0.352892, 0.373153, 0.430226],
+ [0.356418, 0.375896, 0.430823],
+ [0.359916, 0.378641, 0.431501],
+ [0.363446, 0.381388, 0.432075],
+ [0.366923, 0.384139, 0.432796],
+ [0.370430, 0.386890, 0.433428],
+ [0.373884, 0.389646, 0.434209],
+ [0.377371, 0.392404, 0.434890],
+ [0.380830, 0.395164, 0.435653],
+ [0.384268, 0.397928, 0.436475],
+ [0.387705, 0.400694, 0.437305],
+ [0.391151, 0.403464, 0.438096],
+ [0.394568, 0.406236, 0.438986],
+ [0.397991, 0.409011, 0.439848],
+ [0.401418, 0.411790, 0.440708],
+ [0.404820, 0.414572, 0.441642],
+ [0.408226, 0.417357, 0.442570],
+ [0.411607, 0.420145, 0.443577],
+ [0.414992, 0.422937, 0.444578],
+ [0.418383, 0.425733, 0.445560],
+ [0.421748, 0.428531, 0.446640],
+ [0.425120, 0.431334, 0.447692],
+ [0.428462, 0.434140, 0.448864],
+ [0.431817, 0.436950, 0.449982],
+ [0.435168, 0.439763, 0.451134],
+ [0.438504, 0.442580, 0.452341],
+ [0.441810, 0.445402, 0.453659],
+ [0.445148, 0.448226, 0.454885],
+ [0.448447, 0.451053, 0.456264],
+ [0.451759, 0.453887, 0.457582],
+ [0.455072, 0.456718, 0.458976],
+ [0.458366, 0.459552, 0.460457],
+ [0.461616, 0.462405, 0.461969],
+ [0.464947, 0.465241, 0.463395],
+ [0.468254, 0.468083, 0.464908],
+ [0.471501, 0.470960, 0.466357],
+ [0.474812, 0.473832, 0.467681],
+ [0.478186, 0.476699, 0.468845],
+ [0.481622, 0.479573, 0.469767],
+ [0.485141, 0.482451, 0.470384],
+ [0.488697, 0.485318, 0.471008],
+ [0.492278, 0.488198, 0.471453],
+ [0.495913, 0.491076, 0.471751],
+ [0.499552, 0.493960, 0.472032],
+ [0.503185, 0.496851, 0.472305],
+ [0.506866, 0.499743, 0.472432],
+ [0.510540, 0.502643, 0.472550],
+ [0.514226, 0.505546, 0.472640],
+ [0.517920, 0.508454, 0.472707],
+ [0.521643, 0.511367, 0.472639],
+ [0.525348, 0.514285, 0.472660],
+ [0.529086, 0.517207, 0.472543],
+ [0.532829, 0.520135, 0.472401],
+ [0.536553, 0.523067, 0.472352],
+ [0.540307, 0.526005, 0.472163],
+ [0.544069, 0.528948, 0.471947],
+ [0.547840, 0.531895, 0.471704],
+ [0.551612, 0.534849, 0.471439],
+ [0.555393, 0.537807, 0.471147],
+ [0.559181, 0.540771, 0.470829],
+ [0.562972, 0.543741, 0.470488],
+ [0.566802, 0.546715, 0.469988],
+ [0.570607, 0.549695, 0.469593],
+ [0.574417, 0.552682, 0.469172],
+ [0.578236, 0.555673, 0.468724],
+ [0.582087, 0.558670, 0.468118],
+ [0.585916, 0.561674, 0.467618],
+ [0.589753, 0.564682, 0.467090],
+ [0.593622, 0.567697, 0.466401],
+ [0.597469, 0.570718, 0.465821],
+ [0.601354, 0.573743, 0.465074],
+ [0.605211, 0.576777, 0.464441],
+ [0.609105, 0.579816, 0.463638],
+ [0.612977, 0.582861, 0.462950],
+ [0.616852, 0.585913, 0.462237],
+ [0.620765, 0.588970, 0.461351],
+ [0.624654, 0.592034, 0.460583],
+ [0.628576, 0.595104, 0.459641],
+ [0.632506, 0.598180, 0.458668],
+ [0.636412, 0.601264, 0.457818],
+ [0.640352, 0.604354, 0.456791],
+ [0.644270, 0.607450, 0.455886],
+ [0.648222, 0.610553, 0.454801],
+ [0.652178, 0.613664, 0.453689],
+ [0.656114, 0.616780, 0.452702],
+ [0.660082, 0.619904, 0.451534],
+ [0.664055, 0.623034, 0.450338],
+ [0.668008, 0.626171, 0.449270],
+ [0.671991, 0.629316, 0.448018],
+ [0.675981, 0.632468, 0.446736],
+ [0.679979, 0.635626, 0.445424],
+ [0.683950, 0.638793, 0.444251],
+ [0.687957, 0.641966, 0.442886],
+ [0.691971, 0.645145, 0.441491],
+ [0.695985, 0.648334, 0.440072],
+ [0.700008, 0.651529, 0.438624],
+ [0.704037, 0.654731, 0.437147],
+ [0.708067, 0.657942, 0.435647],
+ [0.712105, 0.661160, 0.434117],
+ [0.716177, 0.664384, 0.432386],
+ [0.720222, 0.667618, 0.430805],
+ [0.724274, 0.670859, 0.429194],
+ [0.728334, 0.674107, 0.427554],
+ [0.732422, 0.677364, 0.425717],
+ [0.736488, 0.680629, 0.424028],
+ [0.740589, 0.683900, 0.422131],
+ [0.744664, 0.687181, 0.420393],
+ [0.748772, 0.690470, 0.418448],
+ [0.752886, 0.693766, 0.416472],
+ [0.756975, 0.697071, 0.414659],
+ [0.761096, 0.700384, 0.412638],
+ [0.765223, 0.703705, 0.410587],
+ [0.769353, 0.707035, 0.408516],
+ [0.773486, 0.710373, 0.406422],
+ [0.777651, 0.713719, 0.404112],
+ [0.781795, 0.717074, 0.401966],
+ [0.785965, 0.720438, 0.399613],
+ [0.790116, 0.723810, 0.397423],
+ [0.794298, 0.727190, 0.395016],
+ [0.798480, 0.730580, 0.392597],
+ [0.802667, 0.733978, 0.390153],
+ [0.806859, 0.737385, 0.387684],
+ [0.811054, 0.740801, 0.385198],
+ [0.815274, 0.744226, 0.382504],
+ [0.819499, 0.747659, 0.379785],
+ [0.823729, 0.751101, 0.377043],
+ [0.827959, 0.754553, 0.374292],
+ [0.832192, 0.758014, 0.371529],
+ [0.836429, 0.761483, 0.368747],
+ [0.840693, 0.764962, 0.365746],
+ [0.844957, 0.768450, 0.362741],
+ [0.849223, 0.771947, 0.359729],
+ [0.853515, 0.775454, 0.356500],
+ [0.857809, 0.778969, 0.353259],
+ [0.862105, 0.782494, 0.350011],
+ [0.866421, 0.786028, 0.346571],
+ [0.870717, 0.789572, 0.343333],
+ [0.875057, 0.793125, 0.339685],
+ [0.879378, 0.796687, 0.336241],
+ [0.883720, 0.800258, 0.332599],
+ [0.888081, 0.803839, 0.328770],
+ [0.892440, 0.807430, 0.324968],
+ [0.896818, 0.811030, 0.320982],
+ [0.901195, 0.814639, 0.317021],
+ [0.905589, 0.818257, 0.312889],
+ [0.910000, 0.821885, 0.308594],
+ [0.914407, 0.825522, 0.304348],
+ [0.918828, 0.829168, 0.299960],
+ [0.923279, 0.832822, 0.295244],
+ [0.927724, 0.836486, 0.290611],
+ [0.932180, 0.840159, 0.285880],
+ [0.936660, 0.843841, 0.280876],
+ [0.941147, 0.847530, 0.275815],
+ [0.945654, 0.851228, 0.270532],
+ [0.950178, 0.854933, 0.265085],
+ [0.954725, 0.858646, 0.259365],
+ [0.959284, 0.862365, 0.253563],
+ [0.963872, 0.866089, 0.247445],
+ [0.968469, 0.869819, 0.241310],
+ [0.973114, 0.873550, 0.234677],
+ [0.977780, 0.877281, 0.227954],
+ [0.982497, 0.881008, 0.220878],
+ [0.987293, 0.884718, 0.213336],
+ [0.992218, 0.888385, 0.205468],
+ [0.994847, 0.892954, 0.203445],
+ [0.995249, 0.898384, 0.207561],
+ [0.995503, 0.903866, 0.212370],
+ [0.995737, 0.909344, 0.217772]]
+
+_twilight_data = [
+ [0.88575015840754434, 0.85000924943067835, 0.8879736506427196],
+ [0.88378520195539056, 0.85072940540310626, 0.88723222096949894],
+ [0.88172231059285788, 0.85127594077653468, 0.88638056925514819],
+ [0.8795410528270573, 0.85165675407495722, 0.8854143767924102],
+ [0.87724880858965482, 0.85187028338870274, 0.88434120381311432],
+ [0.87485347508575972, 0.85191526123023187, 0.88316926967613829],
+ [0.87233134085124076, 0.85180165478080894, 0.88189704355001619],
+ [0.86970474853509816, 0.85152403004797894, 0.88053883390003362],
+ [0.86696015505333579, 0.8510896085314068, 0.87909766977173343],
+ [0.86408985081463996, 0.85050391167507788, 0.87757925784892632],
+ [0.86110245436899846, 0.84976754857001258, 0.87599242923439569],
+ [0.85798259245670372, 0.84888934810281835, 0.87434038553446281],
+ [0.85472593189256985, 0.84787488124672816, 0.8726282980930582],
+ [0.85133714570857189, 0.84672735796116472, 0.87086081657350445],
+ [0.84780710702577922, 0.8454546229209523, 0.86904036783694438],
+ [0.8441261828674842, 0.84406482711037389, 0.86716973322690072],
+ [0.84030420805957784, 0.8425605950855084, 0.865250882410458],
+ [0.83634031809191178, 0.84094796518951942, 0.86328528001070159],
+ [0.83222705712934408, 0.83923490627754482, 0.86127563500427884],
+ [0.82796894316013536, 0.83742600751395202, 0.85922399451306786],
+ [0.82357429680252847, 0.83552487764795436, 0.85713191328514948],
+ [0.81904654677937527, 0.8335364929949034, 0.85500206287010105],
+ [0.81438982121143089, 0.83146558694197847, 0.85283759062147024],
+ [0.8095999819094809, 0.82931896673505456, 0.85064441601050367],
+ [0.80469164429814577, 0.82709838780560663, 0.84842449296974021],
+ [0.79967075421267997, 0.82480781812080928, 0.84618210029578533],
+ [0.79454305089231114, 0.82245116226304615, 0.84392184786827984],
+ [0.78931445564608915, 0.82003213188702007, 0.8416486380471222],
+ [0.78399101042764918, 0.81755426400533426, 0.83936747464036732],
+ [0.77857892008227592, 0.81502089378742548, 0.8370834463093898],
+ [0.77308416590170936, 0.81243524735466011, 0.83480172950579679],
+ [0.76751108504417864, 0.8098007598713145, 0.83252816638059668],
+ [0.76186907937980286, 0.80711949387647486, 0.830266486168872],
+ [0.75616443584381976, 0.80439408733477935, 0.82802138994719998],
+ [0.75040346765406696, 0.80162699008965321, 0.82579737851082424],
+ [0.74459247771890169, 0.79882047719583249, 0.82359867586156521],
+ [0.73873771700494939, 0.79597665735031009, 0.82142922780433014],
+ [0.73284543645523459, 0.79309746468844067, 0.81929263384230377],
+ [0.72692177512829703, 0.7901846863592763, 0.81719217466726379],
+ [0.72097280665536778, 0.78723995923452639, 0.81513073920879264],
+ [0.71500403076252128, 0.78426487091581187, 0.81311116559949914],
+ [0.70902078134539304, 0.78126088716070907, 0.81113591855117928],
+ [0.7030297722540817, 0.77822904973358131, 0.80920618848056969],
+ [0.6970365443886174, 0.77517050008066057, 0.80732335380063447],
+ [0.69104641009309098, 0.77208629460678091, 0.80548841690679074],
+ [0.68506446154395928, 0.7689774029354699, 0.80370206267176914],
+ [0.67909554499882152, 0.76584472131395898, 0.8019646617300199],
+ [0.67314422559426212, 0.76268908733890484, 0.80027628545809526],
+ [0.66721479803752815, 0.7595112803730375, 0.79863674654537764],
+ [0.6613112930078745, 0.75631202708719025, 0.7970456043491897],
+ [0.65543692326454717, 0.75309208756768431, 0.79550271129031047],
+ [0.64959573004253479, 0.74985201221941766, 0.79400674021499107],
+ [0.6437910831099849, 0.7465923800833657, 0.79255653201306053],
+ [0.63802586828545982, 0.74331376714033193, 0.79115100459573173],
+ [0.6323027138710603, 0.74001672160131404, 0.78978892762640429],
+ [0.62662402022604591, 0.73670175403699445, 0.78846901316334561],
+ [0.62099193064817548, 0.73336934798923203, 0.78718994624696581],
+ [0.61540846411770478, 0.73001995232739691, 0.78595022706750484],
+ [0.60987543176093062, 0.72665398759758293, 0.78474835732694714],
+ [0.60439434200274855, 0.7232718614323369, 0.78358295593535587],
+ [0.5989665814482068, 0.71987394892246725, 0.78245259899346642],
+ [0.59359335696837223, 0.7164606049658685, 0.78135588237640097],
+ [0.58827579780555495, 0.71303214646458135, 0.78029141405636515],
+ [0.58301487036932409, 0.70958887676997473, 0.77925781820476592],
+ [0.5778116438998202, 0.70613106157153982, 0.77825345121025524],
+ [0.5726668948158774, 0.7026589535425779, 0.77727702680911992],
+ [0.56758117853861967, 0.69917279302646274, 0.77632748534275298],
+ [0.56255515357219343, 0.69567278381629649, 0.77540359142309845],
+ [0.55758940419605174, 0.69215911458254054, 0.7745041337932782],
+ [0.55268450589347129, 0.68863194515166382, 0.7736279426902245],
+ [0.54784098153018634, 0.68509142218509878, 0.77277386473440868],
+ [0.54305932424018233, 0.68153767253065878, 0.77194079697835083],
+ [0.53834015575176275, 0.67797081129095405, 0.77112734439057717],
+ [0.53368389147728401, 0.67439093705212727, 0.7703325054879735],
+ [0.529090861832473, 0.67079812302806219, 0.76955552292313134],
+ [0.52456151470593582, 0.66719242996142225, 0.76879541714230948],
+ [0.52009627392235558, 0.66357391434030388, 0.76805119403344102],
+ [0.5156955988596057, 0.65994260812897998, 0.76732191489596169],
+ [0.51135992541601927, 0.65629853981831865, 0.76660663780645333],
+ [0.50708969576451657, 0.65264172403146448, 0.76590445660835849],
+ [0.5028853540415561, 0.64897216734095264, 0.76521446718174913],
+ [0.49874733661356069, 0.6452898684900934, 0.76453578734180083],
+ [0.4946761847863938, 0.64159484119504429, 0.76386719002130909],
+ [0.49067224938561221, 0.63788704858847078, 0.76320812763163837],
+ [0.4867359599430568, 0.63416646251100506, 0.76255780085924041],
+ [0.4828677867260272, 0.6304330455306234, 0.76191537149895305],
+ [0.47906816236197386, 0.62668676251860134, 0.76128000375662419],
+ [0.47533752394906287, 0.62292757283835809, 0.76065085571817748],
+ [0.47167629518877091, 0.61915543242884641, 0.76002709227883047],
+ [0.46808490970531597, 0.61537028695790286, 0.75940789891092741],
+ [0.46456376716303932, 0.61157208822864151, 0.75879242623025811],
+ [0.46111326647023881, 0.607760777169989, 0.75817986436807139],
+ [0.45773377230160567, 0.60393630046586455, 0.75756936901859162],
+ [0.45442563977552913, 0.60009859503858665, 0.75696013660606487],
+ [0.45118918687617743, 0.59624762051353541, 0.75635120643246645],
+ [0.44802470933589172, 0.59238331452146575, 0.75574176474107924],
+ [0.44493246854215379, 0.5885055998308617, 0.7551311041857901],
+ [0.44191271766696399, 0.58461441100175571, 0.75451838884410671],
+ [0.43896563958048396, 0.58070969241098491, 0.75390276208285945],
+ [0.43609138958356369, 0.57679137998186081, 0.7532834105961016],
+ [0.43329008867358393, 0.57285941625606673, 0.75265946532566674],
+ [0.43056179073057571, 0.56891374572457176, 0.75203008099312696],
+ [0.42790652284925834, 0.5649543060909209, 0.75139443521914839],
+ [0.42532423665011354, 0.56098104959950301, 0.75075164989005116],
+ [0.42281485675772662, 0.55699392126996583, 0.75010086988227642],
+ [0.42037822361396326, 0.55299287158108168, 0.7494412559451894],
+ [0.41801414079233629, 0.54897785421888889, 0.74877193167001121],
+ [0.4157223260454232, 0.54494882715350401, 0.74809204459000522],
+ [0.41350245743314729, 0.54090574771098476, 0.74740073297543086],
+ [0.41135414697304568, 0.53684857765005933, 0.74669712855065784],
+ [0.4092768899914751, 0.53277730177130322, 0.74598030635707824],
+ [0.40727018694219069, 0.52869188011057411, 0.74524942637581271],
+ [0.40533343789303178, 0.52459228174983119, 0.74450365836708132],
+ [0.40346600333905397, 0.52047847653840029, 0.74374215223567086],
+ [0.40166714010896104, 0.51635044969688759, 0.7429640345324835],
+ [0.39993606933454834, 0.51220818143218516, 0.74216844571317986],
+ [0.3982719152586337, 0.50805166539276136, 0.74135450918099721],
+ [0.39667374905665609, 0.50388089053847973, 0.74052138580516735],
+ [0.39514058808207631, 0.49969585326377758, 0.73966820211715711],
+ [0.39367135736822567, 0.49549655777451179, 0.738794102296364],
+ [0.39226494876209317, 0.49128300332899261, 0.73789824784475078],
+ [0.39092017571994903, 0.48705520251223039, 0.73697977133881254],
+ [0.38963580160340855, 0.48281316715123496, 0.73603782546932739],
+ [0.38841053300842432, 0.47855691131792805, 0.73507157641157261],
+ [0.38724301459330251, 0.47428645933635388, 0.73408016787854391],
+ [0.38613184178892102, 0.4700018340988123, 0.7330627749243106],
+ [0.38507556793651387, 0.46570306719930193, 0.73201854033690505],
+ [0.38407269378943537, 0.46139018782416635, 0.73094665432902683],
+ [0.38312168084402748, 0.45706323581407199, 0.72984626791353258],
+ [0.38222094988570376, 0.45272225034283325, 0.72871656144003782],
+ [0.38136887930454161, 0.44836727669277859, 0.72755671317141346],
+ [0.38056380696565623, 0.44399837208633719, 0.72636587045135315],
+ [0.37980403744848751, 0.43961558821222629, 0.72514323778761092],
+ [0.37908789283110761, 0.43521897612544935, 0.72388798691323131],
+ [0.378413635091359, 0.43080859411413064, 0.72259931993061044],
+ [0.37777949753513729, 0.4263845142616835, 0.72127639993530235],
+ [0.37718371844251231, 0.42194680223454828, 0.71991841524475775],
+ [0.37662448930806297, 0.41749553747893614, 0.71852454736176108],
+ [0.37610001286385814, 0.41303079952477062, 0.71709396919920232],
+ [0.37560846919442398, 0.40855267638072096, 0.71562585091587549],
+ [0.37514802505380473, 0.4040612609993941, 0.7141193695725726],
+ [0.37471686019302231, 0.3995566498711684, 0.71257368516500463],
+ [0.37431313199312338, 0.39503894828283309, 0.71098796522377461],
+ [0.37393499330475782, 0.39050827529375831, 0.70936134293478448],
+ [0.3735806215098284, 0.38596474386057539, 0.70769297607310577],
+ [0.37324816143326384, 0.38140848555753937, 0.70598200974806036],
+ [0.37293578646665032, 0.37683963835219841, 0.70422755780589941],
+ [0.37264166757849604, 0.37225835004836849, 0.7024287314570723],
+ [0.37236397858465387, 0.36766477862108266, 0.70058463496520773],
+ [0.37210089702443822, 0.36305909736982378, 0.69869434615073722],
+ [0.3718506155898596, 0.35844148285875221, 0.69675695810256544],
+ [0.37161133234400479, 0.3538121372967869, 0.69477149919380887],
+ [0.37138124223736607, 0.34917126878479027, 0.69273703471928827],
+ [0.37115856636209105, 0.34451911410230168, 0.69065253586464992],
+ [0.37094151551337329, 0.33985591488818123, 0.68851703379505125],
+ [0.37072833279422668, 0.33518193808489577, 0.68632948169606767],
+ [0.37051738634484427, 0.33049741244307851, 0.68408888788857214],
+ [0.37030682071842685, 0.32580269697872455, 0.68179411684486679],
+ [0.37009487130772695, 0.3210981375964933, 0.67944405399056851],
+ [0.36987980329025361, 0.31638410101153364, 0.67703755438090574],
+ [0.36965987626565955, 0.31166098762951971, 0.67457344743419545],
+ [0.36943334591276228, 0.30692923551862339, 0.67205052849120617],
+ [0.36919847837592484, 0.30218932176507068, 0.66946754331614522],
+ [0.36895355306596778, 0.29744175492366276, 0.66682322089824264],
+ [0.36869682231895268, 0.29268709856150099, 0.66411625298236909],
+ [0.36842655638020444, 0.28792596437778462, 0.66134526910944602],
+ [0.36814101479899719, 0.28315901221182987, 0.65850888806972308],
+ [0.36783843696531082, 0.27838697181297761, 0.65560566838453704],
+ [0.36751707094367697, 0.27361063317090978, 0.65263411711618635],
+ [0.36717513650699446, 0.26883085667326956, 0.64959272297892245],
+ [0.36681085540107988, 0.26404857724525643, 0.64647991652908243],
+ [0.36642243251550632, 0.25926481158628106, 0.64329409140765537],
+ [0.36600853966739794, 0.25448043878086224, 0.64003361803368586],
+ [0.36556698373538982, 0.24969683475296395, 0.63669675187488584],
+ [0.36509579845886808, 0.24491536803550484, 0.63328173520055586],
+ [0.36459308890125008, 0.24013747024823828, 0.62978680155026101],
+ [0.36405693022088509, 0.23536470386204195, 0.62621013451953023],
+ [0.36348537610385145, 0.23059876218396419, 0.62254988622392882],
+ [0.36287643560041027, 0.22584149293287031, 0.61880417410823019],
+ [0.36222809558295926, 0.22109488427338303, 0.61497112346096128],
+ [0.36153829010998356, 0.21636111429594002, 0.61104880679640927],
+ [0.36080493826624654, 0.21164251793458128, 0.60703532172064711],
+ [0.36002681809096376, 0.20694122817889948, 0.60292845431916875],
+ [0.35920088560930186, 0.20226037920758122, 0.5987265295935138],
+ [0.35832489966617809, 0.197602942459778, 0.59442768517501066],
+ [0.35739663292915563, 0.19297208197842461, 0.59003011251063131],
+ [0.35641381143126327, 0.18837119869242164, 0.5855320765920552],
+ [0.35537415306906722, 0.18380392577704466, 0.58093191431832802],
+ [0.35427534960663759, 0.17927413271618647, 0.57622809660668717],
+ [0.35311574421123737, 0.17478570377561287, 0.57141871523555288],
+ [0.35189248608873791, 0.17034320478524959, 0.56650284911216653],
+ [0.35060304441931012, 0.16595129984720861, 0.56147964703993225],
+ [0.34924513554955644, 0.16161477763045118, 0.55634837474163779],
+ [0.34781653238777782, 0.15733863511152979, 0.55110853452703257],
+ [0.34631507175793091, 0.15312802296627787, 0.5457599924248665],
+ [0.34473901574536375, 0.14898820589826409, 0.54030245920406539],
+ [0.34308600291572294, 0.14492465359918028, 0.53473704282067103],
+ [0.34135411074506483, 0.1409427920655632, 0.52906500940336754],
+ [0.33954168752669694, 0.13704801896718169, 0.52328797535085236],
+ [0.33764732090671112, 0.13324562282438077, 0.51740807573979475],
+ [0.33566978565015315, 0.12954074251271822, 0.51142807215168951],
+ [0.33360804901486002, 0.12593818301005921, 0.50535164796654897],
+ [0.33146154891145124, 0.12244245263391232, 0.49918274588431072],
+ [0.32923005203231409, 0.11905764321981127, 0.49292595612342666],
+ [0.3269137124539796, 0.1157873496841953, 0.48658646495697461],
+ [0.32451307931207785, 0.11263459791730848, 0.48017007211645196],
+ [0.32202882276069322, 0.10960114111258401, 0.47368494725726878],
+ [0.31946262395497965, 0.10668879882392659, 0.46713728801395243],
+ [0.31681648089023501, 0.10389861387653518, 0.46053414662739794],
+ [0.31409278414755532, 0.10123077676403242, 0.45388335612058467],
+ [0.31129434479712365, 0.098684771934052201, 0.44719313715161618],
+ [0.30842444457210105, 0.096259385340577736, 0.44047194882050544],
+ [0.30548675819945936, 0.093952764840823738, 0.43372849999361113],
+ [0.30248536364574252, 0.091761187397303601, 0.42697404043749887],
+ [0.29942483960214772, 0.089682253716750038, 0.42021619665853854],
+ [0.29631000388905288, 0.087713250960463951, 0.41346259134143476],
+ [0.29314593096985248, 0.085850656889620708, 0.40672178082365834],
+ [0.28993792445176608, 0.08409078829085731, 0.40000214725256295],
+ [0.28669151388283165, 0.082429873848480689, 0.39331182532243375],
+ [0.28341239797185225, 0.080864153365499375, 0.38665868550105914],
+ [0.28010638576975472, 0.079389994802261526, 0.38005028528138707],
+ [0.27677939615815589, 0.078003941033788216, 0.37349382846504675],
+ [0.27343739342450812, 0.076702800237496066, 0.36699616136347685],
+ [0.27008637749114051, 0.075483675584275545, 0.36056376228111864],
+ [0.26673233211995284, 0.074344018028546205, 0.35420276066240958],
+ [0.26338121807151404, 0.073281657939897077, 0.34791888996380105],
+ [0.26003895187439957, 0.072294781043362205, 0.3417175669546984],
+ [0.25671191651083902, 0.071380106242082242, 0.33560648984600089],
+ [0.25340685873736807, 0.070533582926851829, 0.3295945757321303],
+ [0.25012845306199383, 0.069758206429106989, 0.32368100685760637],
+ [0.24688226237958999, 0.069053639449204451, 0.31786993834254956],
+ [0.24367372557466271, 0.068419855150922693, 0.31216524050888372],
+ [0.24050813332295939, 0.067857103814855602, 0.30657054493678321],
+ [0.23739062429054825, 0.067365888050555517, 0.30108922184065873],
+ [0.23433055727563878, 0.066935599661639394, 0.29574009929867601],
+ [0.23132955273021344, 0.066576186939090592, 0.29051361067988485],
+ [0.2283917709422868, 0.06628997924139618, 0.28541074411068496],
+ [0.22552164337737857, 0.066078173119395595, 0.28043398847505197],
+ [0.22272706739121817, 0.065933790675651943, 0.27559714652053702],
+ [0.22001251100779617, 0.065857918918907604, 0.27090279994325861],
+ [0.21737845072382705, 0.065859661233562045, 0.26634209349669508],
+ [0.21482843531473683, 0.065940385613778491, 0.26191675992376573],
+ [0.21237411048541005, 0.066085024661758446, 0.25765165093569542],
+ [0.21001214221188125, 0.066308573918947178, 0.2535289048041211],
+ [0.2077442377448806, 0.06661453200418091, 0.24954644291943817],
+ [0.20558051999470117, 0.066990462397868739, 0.24572497420147632],
+ [0.20352007949514977, 0.067444179612424215, 0.24205576625191821],
+ [0.20156133764129841, 0.067983271026200248, 0.23852974228695395],
+ [0.19971571438603364, 0.068592710553704722, 0.23517094067076993],
+ [0.19794834061899208, 0.069314066071660657, 0.23194647381302336],
+ [0.1960826032659409, 0.070321227242423623, 0.22874673279569585],
+ [0.19410351363791453, 0.071608304856891569, 0.22558727307410353],
+ [0.19199449184606268, 0.073182830649273306, 0.22243385243433622],
+ [0.18975853639094634, 0.075019861862143766, 0.2193005075652994],
+ [0.18739228342697645, 0.077102096899588329, 0.21618875376309582],
+ [0.18488035509396164, 0.079425730279723883, 0.21307651648984993],
+ [0.18774482037046955, 0.077251588468039312, 0.21387448578597812],
+ [0.19049578401722037, 0.075311278416787641, 0.2146562337112265],
+ [0.1931548636579131, 0.073606819040117955, 0.21542362939081539],
+ [0.19571853588267552, 0.072157781039602742, 0.21617499187076789],
+ [0.19819343656336558, 0.070974625252738788, 0.21690975060032436],
+ [0.20058760685133747, 0.070064576149984209, 0.21762721310371608],
+ [0.20290365333558247, 0.069435248580458964, 0.21833167885096033],
+ [0.20531725273301316, 0.068919592266397572, 0.21911516689288835],
+ [0.20785704662965598, 0.068484398797025281, 0.22000133917653536],
+ [0.21052882914958676, 0.06812195249816172, 0.22098759107715404],
+ [0.2133313859647627, 0.067830148426026665, 0.22207043213024291],
+ [0.21625279838647882, 0.067616330270516389, 0.22324568672294431],
+ [0.21930503925136402, 0.067465786362940039, 0.22451023616807558],
+ [0.22247308588973624, 0.067388214053092838, 0.22585960379408354],
+ [0.2257539681670791, 0.067382132300147474, 0.22728984778098055],
+ [0.22915620278592841, 0.067434730871152565, 0.22879681433956656],
+ [0.23266299920501882, 0.067557104388479783, 0.23037617493752832],
+ [0.23627495835774248, 0.06774359820987802, 0.23202360805926608],
+ [0.23999586188690308, 0.067985029964779953, 0.23373434258507808],
+ [0.24381149720247919, 0.068289851529011875, 0.23550427698321885],
+ [0.24772092990501099, 0.068653337909486523, 0.2373288009471749],
+ [0.25172899728289466, 0.069064630826035506, 0.23920260612763083],
+ [0.25582135547481771, 0.06953231029187984, 0.24112190491594204],
+ [0.25999463887892144, 0.070053855603861875, 0.24308218808684579],
+ [0.26425512207060942, 0.070616595622995437, 0.24507758869355967],
+ [0.26859095948172862, 0.071226716277922458, 0.24710443563450618],
+ [0.27299701518897301, 0.071883555446163511, 0.24915847093232929],
+ [0.27747150809142801, 0.072582969899254779, 0.25123493995942769],
+ [0.28201746297366942, 0.073315693214040967, 0.25332800295084507],
+ [0.28662309235899847, 0.074088460826808866, 0.25543478673717029],
+ [0.29128515387578635, 0.074899049847466703, 0.25755101595750435],
+ [0.2960004726065818, 0.075745336000958424, 0.25967245030364566],
+ [0.30077276812918691, 0.076617824336164764, 0.26179294097819672],
+ [0.30559226007249934, 0.077521963107537312, 0.26391006692119662],
+ [0.31045520848595526, 0.078456871676182177, 0.2660200572779356],
+ [0.31535870009205808, 0.079420997315243186, 0.26811904076941961],
+ [0.32029986557994061, 0.080412994737554838, 0.27020322893039511],
+ [0.32527888860401261, 0.081428390076546092, 0.27226772884656186],
+ [0.33029174471181438, 0.08246763389003825, 0.27430929404579435],
+ [0.33533353224455448, 0.083532434119003962, 0.27632534356790039],
+ [0.34040164359597463, 0.084622236191702671, 0.27831254595259397],
+ [0.34549355713871799, 0.085736654965126335, 0.28026769921081435],
+ [0.35060678246032478, 0.08687555176033529, 0.28218770540182386],
+ [0.35573889947341125, 0.088038974350243354, 0.2840695897279818],
+ [0.36088752387578377, 0.089227194362745205, 0.28591050458531014],
+ [0.36605031412464006, 0.090440685427697898, 0.2877077458811747],
+ [0.37122508431309342, 0.091679997480262732, 0.28945865397633169],
+ [0.3764103053221462, 0.092945198093777909, 0.29116024157313919],
+ [0.38160247377467543, 0.094238731263712183, 0.29281107506269488],
+ [0.38679939079544168, 0.09556181960083443, 0.29440901248173756],
+ [0.39199887556812907, 0.09691583650296684, 0.29595212005509081],
+ [0.39719876876325577, 0.098302320968278623, 0.29743856476285779],
+ [0.40239692379737496, 0.099722930314950553, 0.29886674369733968],
+ [0.40759120392688708, 0.10117945586419633, 0.30023519507728602],
+ [0.41277985630360303, 0.1026734006932461, 0.30154226437468967],
+ [0.41796105205173684, 0.10420644885760968, 0.30278652039631843],
+ [0.42313214269556043, 0.10578120994917611, 0.3039675809469457],
+ [0.42829101315789753, 0.1073997763055258, 0.30508479060294547],
+ [0.4334355841041439, 0.1090642347484701, 0.30613767928289148],
+ [0.43856378187931538, 0.11077667828375456, 0.30712600062348083],
+ [0.44367358645071275, 0.11253912421257944, 0.30804973095465449],
+ [0.44876299173174822, 0.11435355574622549, 0.30890905921943196],
+ [0.45383005086999889, 0.11622183788331528, 0.30970441249844921],
+ [0.45887288947308297, 0.11814571137706886, 0.31043636979038808],
+ [0.46389102840284874, 0.12012561256850712, 0.31110343446582983],
+ [0.46888111384598413, 0.12216445576414045, 0.31170911458932665],
+ [0.473841437035254, 0.12426354237989065, 0.31225470169927194],
+ [0.47877034239726296, 0.12642401401409453, 0.31274172735821959],
+ [0.48366628618847957, 0.12864679022013889, 0.31317188565991266],
+ [0.48852847371852987, 0.13093210934893723, 0.31354553695453014],
+ [0.49335504375145617, 0.13328091630401023, 0.31386561956734976],
+ [0.49814435462074153, 0.13569380302451714, 0.314135190862664],
+ [0.50289524974970612, 0.13817086581280427, 0.31435662153833671],
+ [0.50760681181053691, 0.14071192654913128, 0.31453200120082569],
+ [0.51227835105321762, 0.14331656120063752, 0.3146630922831542],
+ [0.51690848800544464, 0.14598463068714407, 0.31475407592280041],
+ [0.52149652863229956, 0.14871544765633712, 0.31480767954534428],
+ [0.52604189625477482, 0.15150818660835483, 0.31482653406646727],
+ [0.53054420489856446, 0.15436183633886777, 0.31481299789187128],
+ [0.5350027976174474, 0.15727540775107324, 0.31477085207396532],
+ [0.53941736649199057, 0.16024769309971934, 0.31470295028655965],
+ [0.54378771313608565, 0.16327738551419116, 0.31461204226295625],
+ [0.54811370033467621, 0.1663630904279047, 0.31450102990914708],
+ [0.55239521572711914, 0.16950338809328983, 0.31437291554615371],
+ [0.55663229034969341, 0.17269677158182117, 0.31423043195101424],
+ [0.56082499039117173, 0.17594170887918095, 0.31407639883970623],
+ [0.56497343529017696, 0.17923664950367169, 0.3139136046337036],
+ [0.56907784784011428, 0.18258004462335425, 0.31374440956796529],
+ [0.57313845754107873, 0.18597036007065024, 0.31357126868520002],
+ [0.57715550812992045, 0.18940601489760422, 0.31339704333572083],
+ [0.58112932761586555, 0.19288548904692518, 0.31322399394183942],
+ [0.58506024396466882, 0.19640737049066315, 0.31305401163732732],
+ [0.58894861935544707, 0.19997020971775276, 0.31288922211590126],
+ [0.59279480536520257, 0.20357251410079796, 0.31273234839304942],
+ [0.59659918109122367, 0.207212956082026, 0.31258523031121233],
+ [0.60036213010411577, 0.21089030138947745, 0.31244934410414688],
+ [0.60408401696732739, 0.21460331490206347, 0.31232652641170694],
+ [0.60776523994818654, 0.21835070166659282, 0.31221903291870201],
+ [0.6114062072731884, 0.22213124697023234, 0.31212881396435238],
+ [0.61500723236391375, 0.22594402043981826, 0.31205680685765741],
+ [0.61856865258877192, 0.22978799249179921, 0.31200463838728931],
+ [0.62209079821082613, 0.2336621873300741, 0.31197383273627388],
+ [0.62557416500434959, 0.23756535071152696, 0.31196698314912269],
+ [0.62901892016985872, 0.24149689191922535, 0.31198447195645718],
+ [0.63242534854210275, 0.24545598775548677, 0.31202765974624452],
+ [0.6357937104834237, 0.24944185818822678, 0.31209793953300591],
+ [0.6391243387840212, 0.25345365461983138, 0.31219689612063978],
+ [0.642417577481186, 0.257490519876798, 0.31232631707560987],
+ [0.64567349382645434, 0.26155203161615281, 0.31248673753935263],
+ [0.64889230169458245, 0.26563755336209077, 0.31267941819570189],
+ [0.65207417290277303, 0.26974650525236699, 0.31290560605819168],
+ [0.65521932609327127, 0.27387826652410152, 0.3131666792687211],
+ [0.6583280801134499, 0.27803210957665631, 0.3134643447952643],
+ [0.66140037532601781, 0.28220778870555907, 0.31379912926498488],
+ [0.66443632469878844, 0.28640483614256179, 0.31417223403606975],
+ [0.66743603766369131, 0.29062280081258873, 0.31458483752056837],
+ [0.67039959547676198, 0.29486126309253047, 0.31503813956872212],
+ [0.67332725564817331, 0.29911962764489264, 0.31553372323982209],
+ [0.67621897924409746, 0.30339762792450425, 0.3160724937230589],
+ [0.67907474028157344, 0.30769497879760166, 0.31665545668946665],
+ [0.68189457150944521, 0.31201133280550686, 0.31728380489244951],
+ [0.68467850942494535, 0.31634634821222207, 0.31795870784057567],
+ [0.68742656435169625, 0.32069970535138104, 0.31868137622277692],
+ [0.6901389321505248, 0.32507091815606004, 0.31945332332898302],
+ [0.69281544846764931, 0.32945984647042675, 0.3202754315314667],
+ [0.69545608346891119, 0.33386622163232865, 0.32114884306985791],
+ [0.6980608153581771, 0.33828976326048621, 0.32207478855218091],
+ [0.70062962477242097, 0.34273019305341756, 0.32305449047765694],
+ [0.70316249458814151, 0.34718723719597999, 0.32408913679491225],
+ [0.70565951122610093, 0.35166052978120937, 0.32518014084085567],
+ [0.70812059568420482, 0.35614985523380299, 0.32632861885644465],
+ [0.7105456546582587, 0.36065500290840113, 0.32753574162788762],
+ [0.71293466839773467, 0.36517570519856757, 0.3288027427038317],
+ [0.71528760614847287, 0.36971170225223449, 0.3301308728723546],
+ [0.71760444908133847, 0.37426272710686193, 0.33152138620958932],
+ [0.71988521490549851, 0.37882848839337313, 0.33297555200245399],
+ [0.7221299918421461, 0.38340864508963057, 0.33449469983585844],
+ [0.72433865647781592, 0.38800301593162145, 0.33607995965691828],
+ [0.72651122900227549, 0.3926113126792577, 0.3377325942005665],
+ [0.72864773856716547, 0.39723324476747235, 0.33945384341064017],
+ [0.73074820754845171, 0.401868526884681, 0.3412449533046818],
+ [0.73281270506268747, 0.4065168468778026, 0.34310715173410822],
+ [0.73484133598564938, 0.41117787004519513, 0.34504169470809071],
+ [0.73683422173585866, 0.41585125850290111, 0.34704978520758401],
+ [0.73879140024599266, 0.42053672992315327, 0.34913260148542435],
+ [0.74071301619506091, 0.4252339389526239, 0.35129130890802607],
+ [0.7425992159973317, 0.42994254036133867, 0.35352709245374592],
+ [0.74445018676570673, 0.43466217184617112, 0.35584108091122535],
+ [0.74626615789163442, 0.43939245044973502, 0.35823439142300639],
+ [0.74804739275559562, 0.44413297780351974, 0.36070813602540136],
+ [0.74979420547170472, 0.44888333481548809, 0.36326337558360278],
+ [0.75150685045891663, 0.45364314496866825, 0.36590112443835765],
+ [0.75318566369046569, 0.45841199172949604, 0.36862236642234769],
+ [0.75483105066959544, 0.46318942799460555, 0.3714280448394211],
+ [0.75644341577140706, 0.46797501437948458, 0.37431909037543515],
+ [0.75802325538455839, 0.4727682731566229, 0.37729635531096678],
+ [0.75957111105340058, 0.47756871222057079, 0.380360657784311],
+ [0.7610876378057071, 0.48237579130289127, 0.38351275723852291],
+ [0.76257333554052609, 0.48718906673415824, 0.38675335037837993],
+ [0.76402885609288662, 0.49200802533379656, 0.39008308392311997],
+ [0.76545492593330511, 0.49683212909727231, 0.39350254000115381],
+ [0.76685228950643891, 0.5016608471009063, 0.39701221751773474],
+ [0.76822176599735303, 0.50649362371287909, 0.40061257089416885],
+ [0.7695642334401418, 0.5113298901696085, 0.40430398069682483],
+ [0.77088091962302474, 0.51616892643469103, 0.40808667584648967],
+ [0.77217257229605551, 0.5210102658711383, 0.41196089987122869],
+ [0.77344021829889886, 0.52585332093451564, 0.41592679539764366],
+ [0.77468494746063199, 0.53069749384776732, 0.41998440356963762],
+ [0.77590790730685699, 0.53554217882461186, 0.42413367909988375],
+ [0.7771103295521099, 0.54038674910561235, 0.42837450371258479],
+ [0.77829345807633121, 0.54523059488426595, 0.432706647838971],
+ [0.77945862731506643, 0.55007308413977274, 0.43712979856444761],
+ [0.78060774749483774, 0.55491335744890613, 0.44164332426364639],
+ [0.78174180478981836, 0.55975098052594863, 0.44624687186865436],
+ [0.78286225264440912, 0.56458533111166875, 0.45093985823706345],
+ [0.78397060836414478, 0.56941578326710418, 0.45572154742892063],
+ [0.78506845019606841, 0.5742417003617839, 0.46059116206904965],
+ [0.78615737132332963, 0.5790624629815756, 0.46554778281918402],
+ [0.78723904108188347, 0.58387743744557208, 0.47059039582133383],
+ [0.78831514045623963, 0.58868600173562435, 0.47571791879076081],
+ [0.78938737766251943, 0.5934875421745599, 0.48092913815357724],
+ [0.79045776847727878, 0.59828134277062461, 0.48622257801969754],
+ [0.79152832843475607, 0.60306670593147205, 0.49159667021646397],
+ [0.79260034304237448, 0.60784322087037024, 0.49705020621532009],
+ [0.79367559698664958, 0.61261029334072192, 0.50258161291269432],
+ [0.79475585972654039, 0.61736734400220705, 0.50818921213102985],
+ [0.79584292379583765, 0.62211378808451145, 0.51387124091909786],
+ [0.79693854719951607, 0.62684905679296699, 0.5196258425240281],
+ [0.79804447815136637, 0.63157258225089552, 0.52545108144834785],
+ [0.7991624518501963, 0.63628379372029187, 0.53134495942561433],
+ [0.80029415389753977, 0.64098213306749863, 0.53730535185141037],
+ [0.80144124292560048, 0.64566703459218766, 0.5433300863249918],
+ [0.80260531146112946, 0.65033793748103852, 0.54941691584603647],
+ [0.80378792531077625, 0.65499426549472628, 0.55556350867083815],
+ [0.80499054790810298, 0.65963545027564163, 0.56176745110546977],
+ [0.80621460526927058, 0.66426089585282289, 0.56802629178649788],
+ [0.8074614045096935, 0.6688700095398864, 0.57433746373459582],
+ [0.80873219170089694, 0.67346216702194517, 0.58069834805576737],
+ [0.81002809466520687, 0.67803672673971815, 0.58710626908082753],
+ [0.81135014011763329, 0.68259301546243389, 0.59355848909050757],
+ [0.81269922039881493, 0.68713033714618876, 0.60005214820435104],
+ [0.81407611046993344, 0.69164794791482131, 0.6065843782630862],
+ [0.81548146627279483, 0.69614505508308089, 0.61315221209322646],
+ [0.81691575775055891, 0.70062083014783982, 0.61975260637257923],
+ [0.81837931164498223, 0.70507438189635097, 0.62638245478933297],
+ [0.81987230650455289, 0.70950474978787481, 0.63303857040067113],
+ [0.8213947205565636, 0.7139109141951604, 0.63971766697672761],
+ [0.82294635110428427, 0.71829177331290062, 0.6464164243818421],
+ [0.8245268129450285, 0.72264614312088882, 0.65313137915422603],
+ [0.82613549710580259, 0.72697275518238258, 0.65985900156216504],
+ [0.8277716072353446, 0.73127023324078089, 0.66659570204682972],
+ [0.82943407816481474, 0.7355371221572935, 0.67333772009301907],
+ [0.83112163529096306, 0.73977184647638616, 0.68008125203631464],
+ [0.83283277185777982, 0.74397271817459876, 0.68682235874648545],
+ [0.8345656905566583, 0.7481379479992134, 0.69355697649863846],
+ [0.83631898844737929, 0.75226548952875261, 0.70027999028864962],
+ [0.83809123476131964, 0.75635314860808633, 0.70698561390212977],
+ [0.83987839884120874, 0.76039907199779677, 0.71367147811129228],
+ [0.84167750766845151, 0.76440101200982946, 0.72033299387284622],
+ [0.84348529222933699, 0.76835660399870176, 0.72696536998972039],
+ [0.84529810731955113, 0.77226338601044719, 0.73356368240541492],
+ [0.84711195507965098, 0.77611880236047159, 0.74012275762807056],
+ [0.84892245563117641, 0.77992021407650147, 0.74663719293664366],
+ [0.85072697023178789, 0.78366457342383888, 0.7530974636118285],
+ [0.85251907207708444, 0.78734936133548439, 0.7594994148789691],
+ [0.85429219611470464, 0.79097196777091994, 0.76583801477914104],
+ [0.85604022314725403, 0.79452963601550608, 0.77210610037674143],
+ [0.85775662943504905, 0.79801963142713928, 0.77829571667247499],
+ [0.8594346370300241, 0.8014392309950078, 0.78439788751383921],
+ [0.86107117027565516, 0.80478517909812231, 0.79039529663736285],
+ [0.86265601051127572, 0.80805523804261525, 0.796282666437655],
+ [0.86418343723941027, 0.81124644224653542, 0.80204612696863953],
+ [0.86564934325605325, 0.81435544067514909, 0.80766972324164554],
+ [0.86705314907048503, 0.81737804041911244, 0.81313419626911398],
+ [0.86839954695818633, 0.82030875512181523, 0.81841638963128993],
+ [0.86969131502613806, 0.82314158859569164, 0.82350476683173168],
+ [0.87093846717297507, 0.82586857889438514, 0.82838497261149613],
+ [0.87215331978454325, 0.82848052823709672, 0.8330486712880828],
+ [0.87335171360916275, 0.83096715251272624, 0.83748851001197089],
+ [0.87453793320260187, 0.83331972948645461, 0.84171925358069011],
+ [0.87571458709961403, 0.8355302318472394, 0.84575537519027078],
+ [0.87687848451614692, 0.83759238071186537, 0.84961373549150254],
+ [0.87802298436649007, 0.83950165618540074, 0.85330645352458923],
+ [0.87913244240792765, 0.84125554884475906, 0.85685572291039636],
+ [0.88019293315695812, 0.84285224824778615, 0.86027399927156634],
+ [0.88119169871341951, 0.84429066717717349, 0.86356595168669881],
+ [0.88211542489401606, 0.84557007254559347, 0.86673765046233331],
+ [0.88295168595448525, 0.84668970275699273, 0.86979617048190971],
+ [0.88369127145898041, 0.84764891761519268, 0.87274147101441557],
+ [0.88432713054113543, 0.84844741572055415, 0.87556785228242973],
+ [0.88485138159908572, 0.84908426422893801, 0.87828235285372469],
+ [0.88525897972630474, 0.84955892810989209, 0.88088414794024839],
+ [0.88554714811952384, 0.84987174283631584, 0.88336206121170946],
+ [0.88571155122845646, 0.85002186115856315, 0.88572538990087124]]
+
+_twilight_shifted_data = (_twilight_data[len(_twilight_data)//2:] +
+ _twilight_data[:len(_twilight_data)//2])
+_twilight_shifted_data.reverse()
+_turbo_data = [[0.18995, 0.07176, 0.23217],
+ [0.19483, 0.08339, 0.26149],
+ [0.19956, 0.09498, 0.29024],
+ [0.20415, 0.10652, 0.31844],
+ [0.20860, 0.11802, 0.34607],
+ [0.21291, 0.12947, 0.37314],
+ [0.21708, 0.14087, 0.39964],
+ [0.22111, 0.15223, 0.42558],
+ [0.22500, 0.16354, 0.45096],
+ [0.22875, 0.17481, 0.47578],
+ [0.23236, 0.18603, 0.50004],
+ [0.23582, 0.19720, 0.52373],
+ [0.23915, 0.20833, 0.54686],
+ [0.24234, 0.21941, 0.56942],
+ [0.24539, 0.23044, 0.59142],
+ [0.24830, 0.24143, 0.61286],
+ [0.25107, 0.25237, 0.63374],
+ [0.25369, 0.26327, 0.65406],
+ [0.25618, 0.27412, 0.67381],
+ [0.25853, 0.28492, 0.69300],
+ [0.26074, 0.29568, 0.71162],
+ [0.26280, 0.30639, 0.72968],
+ [0.26473, 0.31706, 0.74718],
+ [0.26652, 0.32768, 0.76412],
+ [0.26816, 0.33825, 0.78050],
+ [0.26967, 0.34878, 0.79631],
+ [0.27103, 0.35926, 0.81156],
+ [0.27226, 0.36970, 0.82624],
+ [0.27334, 0.38008, 0.84037],
+ [0.27429, 0.39043, 0.85393],
+ [0.27509, 0.40072, 0.86692],
+ [0.27576, 0.41097, 0.87936],
+ [0.27628, 0.42118, 0.89123],
+ [0.27667, 0.43134, 0.90254],
+ [0.27691, 0.44145, 0.91328],
+ [0.27701, 0.45152, 0.92347],
+ [0.27698, 0.46153, 0.93309],
+ [0.27680, 0.47151, 0.94214],
+ [0.27648, 0.48144, 0.95064],
+ [0.27603, 0.49132, 0.95857],
+ [0.27543, 0.50115, 0.96594],
+ [0.27469, 0.51094, 0.97275],
+ [0.27381, 0.52069, 0.97899],
+ [0.27273, 0.53040, 0.98461],
+ [0.27106, 0.54015, 0.98930],
+ [0.26878, 0.54995, 0.99303],
+ [0.26592, 0.55979, 0.99583],
+ [0.26252, 0.56967, 0.99773],
+ [0.25862, 0.57958, 0.99876],
+ [0.25425, 0.58950, 0.99896],
+ [0.24946, 0.59943, 0.99835],
+ [0.24427, 0.60937, 0.99697],
+ [0.23874, 0.61931, 0.99485],
+ [0.23288, 0.62923, 0.99202],
+ [0.22676, 0.63913, 0.98851],
+ [0.22039, 0.64901, 0.98436],
+ [0.21382, 0.65886, 0.97959],
+ [0.20708, 0.66866, 0.97423],
+ [0.20021, 0.67842, 0.96833],
+ [0.19326, 0.68812, 0.96190],
+ [0.18625, 0.69775, 0.95498],
+ [0.17923, 0.70732, 0.94761],
+ [0.17223, 0.71680, 0.93981],
+ [0.16529, 0.72620, 0.93161],
+ [0.15844, 0.73551, 0.92305],
+ [0.15173, 0.74472, 0.91416],
+ [0.14519, 0.75381, 0.90496],
+ [0.13886, 0.76279, 0.89550],
+ [0.13278, 0.77165, 0.88580],
+ [0.12698, 0.78037, 0.87590],
+ [0.12151, 0.78896, 0.86581],
+ [0.11639, 0.79740, 0.85559],
+ [0.11167, 0.80569, 0.84525],
+ [0.10738, 0.81381, 0.83484],
+ [0.10357, 0.82177, 0.82437],
+ [0.10026, 0.82955, 0.81389],
+ [0.09750, 0.83714, 0.80342],
+ [0.09532, 0.84455, 0.79299],
+ [0.09377, 0.85175, 0.78264],
+ [0.09287, 0.85875, 0.77240],
+ [0.09267, 0.86554, 0.76230],
+ [0.09320, 0.87211, 0.75237],
+ [0.09451, 0.87844, 0.74265],
+ [0.09662, 0.88454, 0.73316],
+ [0.09958, 0.89040, 0.72393],
+ [0.10342, 0.89600, 0.71500],
+ [0.10815, 0.90142, 0.70599],
+ [0.11374, 0.90673, 0.69651],
+ [0.12014, 0.91193, 0.68660],
+ [0.12733, 0.91701, 0.67627],
+ [0.13526, 0.92197, 0.66556],
+ [0.14391, 0.92680, 0.65448],
+ [0.15323, 0.93151, 0.64308],
+ [0.16319, 0.93609, 0.63137],
+ [0.17377, 0.94053, 0.61938],
+ [0.18491, 0.94484, 0.60713],
+ [0.19659, 0.94901, 0.59466],
+ [0.20877, 0.95304, 0.58199],
+ [0.22142, 0.95692, 0.56914],
+ [0.23449, 0.96065, 0.55614],
+ [0.24797, 0.96423, 0.54303],
+ [0.26180, 0.96765, 0.52981],
+ [0.27597, 0.97092, 0.51653],
+ [0.29042, 0.97403, 0.50321],
+ [0.30513, 0.97697, 0.48987],
+ [0.32006, 0.97974, 0.47654],
+ [0.33517, 0.98234, 0.46325],
+ [0.35043, 0.98477, 0.45002],
+ [0.36581, 0.98702, 0.43688],
+ [0.38127, 0.98909, 0.42386],
+ [0.39678, 0.99098, 0.41098],
+ [0.41229, 0.99268, 0.39826],
+ [0.42778, 0.99419, 0.38575],
+ [0.44321, 0.99551, 0.37345],
+ [0.45854, 0.99663, 0.36140],
+ [0.47375, 0.99755, 0.34963],
+ [0.48879, 0.99828, 0.33816],
+ [0.50362, 0.99879, 0.32701],
+ [0.51822, 0.99910, 0.31622],
+ [0.53255, 0.99919, 0.30581],
+ [0.54658, 0.99907, 0.29581],
+ [0.56026, 0.99873, 0.28623],
+ [0.57357, 0.99817, 0.27712],
+ [0.58646, 0.99739, 0.26849],
+ [0.59891, 0.99638, 0.26038],
+ [0.61088, 0.99514, 0.25280],
+ [0.62233, 0.99366, 0.24579],
+ [0.63323, 0.99195, 0.23937],
+ [0.64362, 0.98999, 0.23356],
+ [0.65394, 0.98775, 0.22835],
+ [0.66428, 0.98524, 0.22370],
+ [0.67462, 0.98246, 0.21960],
+ [0.68494, 0.97941, 0.21602],
+ [0.69525, 0.97610, 0.21294],
+ [0.70553, 0.97255, 0.21032],
+ [0.71577, 0.96875, 0.20815],
+ [0.72596, 0.96470, 0.20640],
+ [0.73610, 0.96043, 0.20504],
+ [0.74617, 0.95593, 0.20406],
+ [0.75617, 0.95121, 0.20343],
+ [0.76608, 0.94627, 0.20311],
+ [0.77591, 0.94113, 0.20310],
+ [0.78563, 0.93579, 0.20336],
+ [0.79524, 0.93025, 0.20386],
+ [0.80473, 0.92452, 0.20459],
+ [0.81410, 0.91861, 0.20552],
+ [0.82333, 0.91253, 0.20663],
+ [0.83241, 0.90627, 0.20788],
+ [0.84133, 0.89986, 0.20926],
+ [0.85010, 0.89328, 0.21074],
+ [0.85868, 0.88655, 0.21230],
+ [0.86709, 0.87968, 0.21391],
+ [0.87530, 0.87267, 0.21555],
+ [0.88331, 0.86553, 0.21719],
+ [0.89112, 0.85826, 0.21880],
+ [0.89870, 0.85087, 0.22038],
+ [0.90605, 0.84337, 0.22188],
+ [0.91317, 0.83576, 0.22328],
+ [0.92004, 0.82806, 0.22456],
+ [0.92666, 0.82025, 0.22570],
+ [0.93301, 0.81236, 0.22667],
+ [0.93909, 0.80439, 0.22744],
+ [0.94489, 0.79634, 0.22800],
+ [0.95039, 0.78823, 0.22831],
+ [0.95560, 0.78005, 0.22836],
+ [0.96049, 0.77181, 0.22811],
+ [0.96507, 0.76352, 0.22754],
+ [0.96931, 0.75519, 0.22663],
+ [0.97323, 0.74682, 0.22536],
+ [0.97679, 0.73842, 0.22369],
+ [0.98000, 0.73000, 0.22161],
+ [0.98289, 0.72140, 0.21918],
+ [0.98549, 0.71250, 0.21650],
+ [0.98781, 0.70330, 0.21358],
+ [0.98986, 0.69382, 0.21043],
+ [0.99163, 0.68408, 0.20706],
+ [0.99314, 0.67408, 0.20348],
+ [0.99438, 0.66386, 0.19971],
+ [0.99535, 0.65341, 0.19577],
+ [0.99607, 0.64277, 0.19165],
+ [0.99654, 0.63193, 0.18738],
+ [0.99675, 0.62093, 0.18297],
+ [0.99672, 0.60977, 0.17842],
+ [0.99644, 0.59846, 0.17376],
+ [0.99593, 0.58703, 0.16899],
+ [0.99517, 0.57549, 0.16412],
+ [0.99419, 0.56386, 0.15918],
+ [0.99297, 0.55214, 0.15417],
+ [0.99153, 0.54036, 0.14910],
+ [0.98987, 0.52854, 0.14398],
+ [0.98799, 0.51667, 0.13883],
+ [0.98590, 0.50479, 0.13367],
+ [0.98360, 0.49291, 0.12849],
+ [0.98108, 0.48104, 0.12332],
+ [0.97837, 0.46920, 0.11817],
+ [0.97545, 0.45740, 0.11305],
+ [0.97234, 0.44565, 0.10797],
+ [0.96904, 0.43399, 0.10294],
+ [0.96555, 0.42241, 0.09798],
+ [0.96187, 0.41093, 0.09310],
+ [0.95801, 0.39958, 0.08831],
+ [0.95398, 0.38836, 0.08362],
+ [0.94977, 0.37729, 0.07905],
+ [0.94538, 0.36638, 0.07461],
+ [0.94084, 0.35566, 0.07031],
+ [0.93612, 0.34513, 0.06616],
+ [0.93125, 0.33482, 0.06218],
+ [0.92623, 0.32473, 0.05837],
+ [0.92105, 0.31489, 0.05475],
+ [0.91572, 0.30530, 0.05134],
+ [0.91024, 0.29599, 0.04814],
+ [0.90463, 0.28696, 0.04516],
+ [0.89888, 0.27824, 0.04243],
+ [0.89298, 0.26981, 0.03993],
+ [0.88691, 0.26152, 0.03753],
+ [0.88066, 0.25334, 0.03521],
+ [0.87422, 0.24526, 0.03297],
+ [0.86760, 0.23730, 0.03082],
+ [0.86079, 0.22945, 0.02875],
+ [0.85380, 0.22170, 0.02677],
+ [0.84662, 0.21407, 0.02487],
+ [0.83926, 0.20654, 0.02305],
+ [0.83172, 0.19912, 0.02131],
+ [0.82399, 0.19182, 0.01966],
+ [0.81608, 0.18462, 0.01809],
+ [0.80799, 0.17753, 0.01660],
+ [0.79971, 0.17055, 0.01520],
+ [0.79125, 0.16368, 0.01387],
+ [0.78260, 0.15693, 0.01264],
+ [0.77377, 0.15028, 0.01148],
+ [0.76476, 0.14374, 0.01041],
+ [0.75556, 0.13731, 0.00942],
+ [0.74617, 0.13098, 0.00851],
+ [0.73661, 0.12477, 0.00769],
+ [0.72686, 0.11867, 0.00695],
+ [0.71692, 0.11268, 0.00629],
+ [0.70680, 0.10680, 0.00571],
+ [0.69650, 0.10102, 0.00522],
+ [0.68602, 0.09536, 0.00481],
+ [0.67535, 0.08980, 0.00449],
+ [0.66449, 0.08436, 0.00424],
+ [0.65345, 0.07902, 0.00408],
+ [0.64223, 0.07380, 0.00401],
+ [0.63082, 0.06868, 0.00401],
+ [0.61923, 0.06367, 0.00410],
+ [0.60746, 0.05878, 0.00427],
+ [0.59550, 0.05399, 0.00453],
+ [0.58336, 0.04931, 0.00486],
+ [0.57103, 0.04474, 0.00529],
+ [0.55852, 0.04028, 0.00579],
+ [0.54583, 0.03593, 0.00638],
+ [0.53295, 0.03169, 0.00705],
+ [0.51989, 0.02756, 0.00780],
+ [0.50664, 0.02354, 0.00863],
+ [0.49321, 0.01963, 0.00955],
+ [0.47960, 0.01583, 0.01055]]
+
+_berlin_data = [
+ [0.62108, 0.69018, 0.99951],
+ [0.61216, 0.68923, 0.99537],
+ [0.6032, 0.68825, 0.99124],
+ [0.5942, 0.68726, 0.98709],
+ [0.58517, 0.68625, 0.98292],
+ [0.57609, 0.68522, 0.97873],
+ [0.56696, 0.68417, 0.97452],
+ [0.55779, 0.6831, 0.97029],
+ [0.54859, 0.68199, 0.96602],
+ [0.53933, 0.68086, 0.9617],
+ [0.53003, 0.67969, 0.95735],
+ [0.52069, 0.67848, 0.95294],
+ [0.51129, 0.67723, 0.94847],
+ [0.50186, 0.67591, 0.94392],
+ [0.49237, 0.67453, 0.9393],
+ [0.48283, 0.67308, 0.93457],
+ [0.47324, 0.67153, 0.92975],
+ [0.46361, 0.6699, 0.92481],
+ [0.45393, 0.66815, 0.91974],
+ [0.44421, 0.66628, 0.91452],
+ [0.43444, 0.66427, 0.90914],
+ [0.42465, 0.66212, 0.90359],
+ [0.41482, 0.65979, 0.89785],
+ [0.40498, 0.65729, 0.89191],
+ [0.39514, 0.65458, 0.88575],
+ [0.3853, 0.65167, 0.87937],
+ [0.37549, 0.64854, 0.87276],
+ [0.36574, 0.64516, 0.8659],
+ [0.35606, 0.64155, 0.8588],
+ [0.34645, 0.63769, 0.85145],
+ [0.33698, 0.63357, 0.84386],
+ [0.32764, 0.62919, 0.83602],
+ [0.31849, 0.62455, 0.82794],
+ [0.30954, 0.61966, 0.81963],
+ [0.30078, 0.6145, 0.81111],
+ [0.29231, 0.60911, 0.80238],
+ [0.2841, 0.60348, 0.79347],
+ [0.27621, 0.59763, 0.78439],
+ [0.26859, 0.59158, 0.77514],
+ [0.26131, 0.58534, 0.76578],
+ [0.25437, 0.57891, 0.7563],
+ [0.24775, 0.57233, 0.74672],
+ [0.24146, 0.5656, 0.73707],
+ [0.23552, 0.55875, 0.72735],
+ [0.22984, 0.5518, 0.7176],
+ [0.2245, 0.54475, 0.7078],
+ [0.21948, 0.53763, 0.698],
+ [0.21469, 0.53043, 0.68819],
+ [0.21017, 0.52319, 0.67838],
+ [0.20589, 0.5159, 0.66858],
+ [0.20177, 0.5086, 0.65879],
+ [0.19788, 0.50126, 0.64903],
+ [0.19417, 0.4939, 0.63929],
+ [0.19056, 0.48654, 0.62957],
+ [0.18711, 0.47918, 0.6199],
+ [0.18375, 0.47183, 0.61024],
+ [0.1805, 0.46447, 0.60062],
+ [0.17737, 0.45712, 0.59104],
+ [0.17426, 0.44979, 0.58148],
+ [0.17122, 0.44247, 0.57197],
+ [0.16824, 0.43517, 0.56249],
+ [0.16529, 0.42788, 0.55302],
+ [0.16244, 0.42061, 0.5436],
+ [0.15954, 0.41337, 0.53421],
+ [0.15674, 0.40615, 0.52486],
+ [0.15391, 0.39893, 0.51552],
+ [0.15112, 0.39176, 0.50623],
+ [0.14835, 0.38459, 0.49697],
+ [0.14564, 0.37746, 0.48775],
+ [0.14288, 0.37034, 0.47854],
+ [0.14014, 0.36326, 0.46939],
+ [0.13747, 0.3562, 0.46024],
+ [0.13478, 0.34916, 0.45115],
+ [0.13208, 0.34215, 0.44209],
+ [0.1294, 0.33517, 0.43304],
+ [0.12674, 0.3282, 0.42404],
+ [0.12409, 0.32126, 0.41507],
+ [0.12146, 0.31435, 0.40614],
+ [0.1189, 0.30746, 0.39723],
+ [0.11632, 0.30061, 0.38838],
+ [0.11373, 0.29378, 0.37955],
+ [0.11119, 0.28698, 0.37075],
+ [0.10861, 0.28022, 0.362],
+ [0.10616, 0.2735, 0.35328],
+ [0.10367, 0.26678, 0.34459],
+ [0.10118, 0.26011, 0.33595],
+ [0.098776, 0.25347, 0.32734],
+ [0.096347, 0.24685, 0.31878],
+ [0.094059, 0.24026, 0.31027],
+ [0.091788, 0.23373, 0.30176],
+ [0.089506, 0.22725, 0.29332],
+ [0.087341, 0.2208, 0.28491],
+ [0.085142, 0.21436, 0.27658],
+ [0.083069, 0.20798, 0.26825],
+ [0.081098, 0.20163, 0.25999],
+ [0.07913, 0.19536, 0.25178],
+ [0.077286, 0.18914, 0.24359],
+ [0.075571, 0.18294, 0.2355],
+ [0.073993, 0.17683, 0.22743],
+ [0.07241, 0.17079, 0.21943],
+ [0.071045, 0.1648, 0.2115],
+ [0.069767, 0.1589, 0.20363],
+ [0.068618, 0.15304, 0.19582],
+ [0.06756, 0.14732, 0.18812],
+ [0.066665, 0.14167, 0.18045],
+ [0.065923, 0.13608, 0.17292],
+ [0.065339, 0.1307, 0.16546],
+ [0.064911, 0.12535, 0.15817],
+ [0.064636, 0.12013, 0.15095],
+ [0.064517, 0.11507, 0.14389],
+ [0.064554, 0.11022, 0.13696],
+ [0.064749, 0.10543, 0.13023],
+ [0.0651, 0.10085, 0.12357],
+ [0.065383, 0.096469, 0.11717],
+ [0.065574, 0.092338, 0.11101],
+ [0.065892, 0.088201, 0.10498],
+ [0.066388, 0.084134, 0.099288],
+ [0.067108, 0.080051, 0.093829],
+ [0.068193, 0.076099, 0.08847],
+ [0.06972, 0.072283, 0.083025],
+ [0.071639, 0.068654, 0.077544],
+ [0.073978, 0.065058, 0.07211],
+ [0.076596, 0.061657, 0.066651],
+ [0.079637, 0.05855, 0.061133],
+ [0.082963, 0.055666, 0.055745],
+ [0.086537, 0.052997, 0.050336],
+ [0.090315, 0.050699, 0.04504],
+ [0.09426, 0.048753, 0.039773],
+ [0.098319, 0.047041, 0.034683],
+ [0.10246, 0.045624, 0.030074],
+ [0.10673, 0.044705, 0.026012],
+ [0.11099, 0.043972, 0.022379],
+ [0.11524, 0.043596, 0.01915],
+ [0.11955, 0.043567, 0.016299],
+ [0.12381, 0.043861, 0.013797],
+ [0.1281, 0.044459, 0.011588],
+ [0.13232, 0.045229, 0.0095315],
+ [0.13645, 0.046164, 0.0078947],
+ [0.14063, 0.047374, 0.006502],
+ [0.14488, 0.048634, 0.0053266],
+ [0.14923, 0.049836, 0.0043455],
+ [0.15369, 0.050997, 0.0035374],
+ [0.15831, 0.05213, 0.0028824],
+ [0.16301, 0.053218, 0.0023628],
+ [0.16781, 0.05424, 0.0019629],
+ [0.17274, 0.055172, 0.001669],
+ [0.1778, 0.056018, 0.0014692],
+ [0.18286, 0.05682, 0.0013401],
+ [0.18806, 0.057574, 0.0012617],
+ [0.19323, 0.058514, 0.0012261],
+ [0.19846, 0.05955, 0.0012271],
+ [0.20378, 0.060501, 0.0012601],
+ [0.20909, 0.061486, 0.0013221],
+ [0.21447, 0.06271, 0.0014116],
+ [0.2199, 0.063823, 0.0015287],
+ [0.22535, 0.065027, 0.0016748],
+ [0.23086, 0.066297, 0.0018529],
+ [0.23642, 0.067645, 0.0020675],
+ [0.24202, 0.069092, 0.0023247],
+ [0.24768, 0.070458, 0.0026319],
+ [0.25339, 0.071986, 0.0029984],
+ [0.25918, 0.07364, 0.003435],
+ [0.265, 0.075237, 0.0039545],
+ [0.27093, 0.076965, 0.004571],
+ [0.27693, 0.078822, 0.0053006],
+ [0.28302, 0.080819, 0.0061608],
+ [0.2892, 0.082879, 0.0071713],
+ [0.29547, 0.085075, 0.0083494],
+ [0.30186, 0.08746, 0.0097258],
+ [0.30839, 0.089912, 0.011455],
+ [0.31502, 0.09253, 0.013324],
+ [0.32181, 0.095392, 0.015413],
+ [0.32874, 0.098396, 0.01778],
+ [0.3358, 0.10158, 0.020449],
+ [0.34304, 0.10498, 0.02344],
+ [0.35041, 0.10864, 0.026771],
+ [0.35795, 0.11256, 0.030456],
+ [0.36563, 0.11666, 0.034571],
+ [0.37347, 0.12097, 0.039115],
+ [0.38146, 0.12561, 0.043693],
+ [0.38958, 0.13046, 0.048471],
+ [0.39785, 0.13547, 0.053136],
+ [0.40622, 0.1408, 0.057848],
+ [0.41469, 0.14627, 0.062715],
+ [0.42323, 0.15198, 0.067685],
+ [0.43184, 0.15791, 0.073044],
+ [0.44044, 0.16403, 0.07862],
+ [0.44909, 0.17027, 0.084644],
+ [0.4577, 0.17667, 0.090869],
+ [0.46631, 0.18321, 0.097335],
+ [0.4749, 0.18989, 0.10406],
+ [0.48342, 0.19668, 0.11104],
+ [0.49191, 0.20352, 0.11819],
+ [0.50032, 0.21043, 0.1255],
+ [0.50869, 0.21742, 0.13298],
+ [0.51698, 0.22443, 0.14062],
+ [0.5252, 0.23154, 0.14835],
+ [0.53335, 0.23862, 0.15626],
+ [0.54144, 0.24575, 0.16423],
+ [0.54948, 0.25292, 0.17226],
+ [0.55746, 0.26009, 0.1804],
+ [0.56538, 0.26726, 0.18864],
+ [0.57327, 0.27446, 0.19692],
+ [0.58111, 0.28167, 0.20524],
+ [0.58892, 0.28889, 0.21362],
+ [0.59672, 0.29611, 0.22205],
+ [0.60448, 0.30335, 0.23053],
+ [0.61223, 0.31062, 0.23905],
+ [0.61998, 0.31787, 0.24762],
+ [0.62771, 0.32513, 0.25619],
+ [0.63544, 0.33244, 0.26481],
+ [0.64317, 0.33975, 0.27349],
+ [0.65092, 0.34706, 0.28218],
+ [0.65866, 0.3544, 0.29089],
+ [0.66642, 0.36175, 0.29964],
+ [0.67419, 0.36912, 0.30842],
+ [0.68198, 0.37652, 0.31722],
+ [0.68978, 0.38392, 0.32604],
+ [0.6976, 0.39135, 0.33493],
+ [0.70543, 0.39879, 0.3438],
+ [0.71329, 0.40627, 0.35272],
+ [0.72116, 0.41376, 0.36166],
+ [0.72905, 0.42126, 0.37062],
+ [0.73697, 0.4288, 0.37962],
+ [0.7449, 0.43635, 0.38864],
+ [0.75285, 0.44392, 0.39768],
+ [0.76083, 0.45151, 0.40675],
+ [0.76882, 0.45912, 0.41584],
+ [0.77684, 0.46676, 0.42496],
+ [0.78488, 0.47441, 0.43409],
+ [0.79293, 0.48208, 0.44327],
+ [0.80101, 0.48976, 0.45246],
+ [0.80911, 0.49749, 0.46167],
+ [0.81722, 0.50521, 0.47091],
+ [0.82536, 0.51296, 0.48017],
+ [0.83352, 0.52073, 0.48945],
+ [0.84169, 0.52853, 0.49876],
+ [0.84988, 0.53634, 0.5081],
+ [0.85809, 0.54416, 0.51745],
+ [0.86632, 0.55201, 0.52683],
+ [0.87457, 0.55988, 0.53622],
+ [0.88283, 0.56776, 0.54564],
+ [0.89111, 0.57567, 0.55508],
+ [0.89941, 0.58358, 0.56455],
+ [0.90772, 0.59153, 0.57404],
+ [0.91603, 0.59949, 0.58355],
+ [0.92437, 0.60747, 0.59309],
+ [0.93271, 0.61546, 0.60265],
+ [0.94108, 0.62348, 0.61223],
+ [0.94945, 0.63151, 0.62183],
+ [0.95783, 0.63956, 0.63147],
+ [0.96622, 0.64763, 0.64111],
+ [0.97462, 0.65572, 0.65079],
+ [0.98303, 0.66382, 0.66049],
+ [0.99145, 0.67194, 0.67022],
+ [0.99987, 0.68007, 0.67995]]
+
+_managua_data = [
+ [1, 0.81263, 0.40424],
+ [0.99516, 0.80455, 0.40155],
+ [0.99024, 0.79649, 0.39888],
+ [0.98532, 0.78848, 0.39622],
+ [0.98041, 0.7805, 0.39356],
+ [0.97551, 0.77257, 0.39093],
+ [0.97062, 0.76468, 0.3883],
+ [0.96573, 0.75684, 0.38568],
+ [0.96087, 0.74904, 0.3831],
+ [0.95601, 0.74129, 0.38052],
+ [0.95116, 0.7336, 0.37795],
+ [0.94631, 0.72595, 0.37539],
+ [0.94149, 0.71835, 0.37286],
+ [0.93667, 0.7108, 0.37034],
+ [0.93186, 0.7033, 0.36784],
+ [0.92706, 0.69585, 0.36536],
+ [0.92228, 0.68845, 0.36289],
+ [0.9175, 0.68109, 0.36042],
+ [0.91273, 0.67379, 0.358],
+ [0.90797, 0.66653, 0.35558],
+ [0.90321, 0.65932, 0.35316],
+ [0.89846, 0.65216, 0.35078],
+ [0.89372, 0.64503, 0.34839],
+ [0.88899, 0.63796, 0.34601],
+ [0.88426, 0.63093, 0.34367],
+ [0.87953, 0.62395, 0.34134],
+ [0.87481, 0.617, 0.33902],
+ [0.87009, 0.61009, 0.3367],
+ [0.86538, 0.60323, 0.33442],
+ [0.86067, 0.59641, 0.33213],
+ [0.85597, 0.58963, 0.32987],
+ [0.85125, 0.5829, 0.3276],
+ [0.84655, 0.57621, 0.32536],
+ [0.84185, 0.56954, 0.32315],
+ [0.83714, 0.56294, 0.32094],
+ [0.83243, 0.55635, 0.31874],
+ [0.82772, 0.54983, 0.31656],
+ [0.82301, 0.54333, 0.31438],
+ [0.81829, 0.53688, 0.31222],
+ [0.81357, 0.53046, 0.3101],
+ [0.80886, 0.52408, 0.30796],
+ [0.80413, 0.51775, 0.30587],
+ [0.7994, 0.51145, 0.30375],
+ [0.79466, 0.50519, 0.30167],
+ [0.78991, 0.49898, 0.29962],
+ [0.78516, 0.4928, 0.29757],
+ [0.7804, 0.48668, 0.29553],
+ [0.77564, 0.48058, 0.29351],
+ [0.77086, 0.47454, 0.29153],
+ [0.76608, 0.46853, 0.28954],
+ [0.76128, 0.46255, 0.28756],
+ [0.75647, 0.45663, 0.28561],
+ [0.75166, 0.45075, 0.28369],
+ [0.74682, 0.44491, 0.28178],
+ [0.74197, 0.4391, 0.27988],
+ [0.73711, 0.43333, 0.27801],
+ [0.73223, 0.42762, 0.27616],
+ [0.72732, 0.42192, 0.2743],
+ [0.72239, 0.41628, 0.27247],
+ [0.71746, 0.41067, 0.27069],
+ [0.71247, 0.40508, 0.26891],
+ [0.70747, 0.39952, 0.26712],
+ [0.70244, 0.39401, 0.26538],
+ [0.69737, 0.38852, 0.26367],
+ [0.69227, 0.38306, 0.26194],
+ [0.68712, 0.37761, 0.26025],
+ [0.68193, 0.37219, 0.25857],
+ [0.67671, 0.3668, 0.25692],
+ [0.67143, 0.36142, 0.25529],
+ [0.6661, 0.35607, 0.25367],
+ [0.66071, 0.35073, 0.25208],
+ [0.65528, 0.34539, 0.25049],
+ [0.6498, 0.34009, 0.24895],
+ [0.64425, 0.3348, 0.24742],
+ [0.63866, 0.32953, 0.2459],
+ [0.633, 0.32425, 0.24442],
+ [0.62729, 0.31901, 0.24298],
+ [0.62152, 0.3138, 0.24157],
+ [0.6157, 0.3086, 0.24017],
+ [0.60983, 0.30341, 0.23881],
+ [0.60391, 0.29826, 0.23752],
+ [0.59793, 0.29314, 0.23623],
+ [0.59191, 0.28805, 0.235],
+ [0.58585, 0.28302, 0.23377],
+ [0.57974, 0.27799, 0.23263],
+ [0.57359, 0.27302, 0.23155],
+ [0.56741, 0.26808, 0.23047],
+ [0.5612, 0.26321, 0.22948],
+ [0.55496, 0.25837, 0.22857],
+ [0.54871, 0.25361, 0.22769],
+ [0.54243, 0.24891, 0.22689],
+ [0.53614, 0.24424, 0.22616],
+ [0.52984, 0.23968, 0.22548],
+ [0.52354, 0.2352, 0.22487],
+ [0.51724, 0.23076, 0.22436],
+ [0.51094, 0.22643, 0.22395],
+ [0.50467, 0.22217, 0.22363],
+ [0.49841, 0.21802, 0.22339],
+ [0.49217, 0.21397, 0.22325],
+ [0.48595, 0.21, 0.22321],
+ [0.47979, 0.20618, 0.22328],
+ [0.47364, 0.20242, 0.22345],
+ [0.46756, 0.1988, 0.22373],
+ [0.46152, 0.19532, 0.22413],
+ [0.45554, 0.19195, 0.22465],
+ [0.44962, 0.18873, 0.22534],
+ [0.44377, 0.18566, 0.22616],
+ [0.43799, 0.18266, 0.22708],
+ [0.43229, 0.17987, 0.22817],
+ [0.42665, 0.17723, 0.22938],
+ [0.42111, 0.17474, 0.23077],
+ [0.41567, 0.17238, 0.23232],
+ [0.41033, 0.17023, 0.23401],
+ [0.40507, 0.16822, 0.2359],
+ [0.39992, 0.1664, 0.23794],
+ [0.39489, 0.16475, 0.24014],
+ [0.38996, 0.16331, 0.24254],
+ [0.38515, 0.16203, 0.24512],
+ [0.38046, 0.16093, 0.24792],
+ [0.37589, 0.16, 0.25087],
+ [0.37143, 0.15932, 0.25403],
+ [0.36711, 0.15883, 0.25738],
+ [0.36292, 0.15853, 0.26092],
+ [0.35885, 0.15843, 0.26466],
+ [0.35494, 0.15853, 0.26862],
+ [0.35114, 0.15882, 0.27276],
+ [0.34748, 0.15931, 0.27711],
+ [0.34394, 0.15999, 0.28164],
+ [0.34056, 0.16094, 0.28636],
+ [0.33731, 0.16207, 0.29131],
+ [0.3342, 0.16338, 0.29642],
+ [0.33121, 0.16486, 0.3017],
+ [0.32837, 0.16658, 0.30719],
+ [0.32565, 0.16847, 0.31284],
+ [0.3231, 0.17056, 0.31867],
+ [0.32066, 0.17283, 0.32465],
+ [0.31834, 0.1753, 0.33079],
+ [0.31616, 0.17797, 0.3371],
+ [0.3141, 0.18074, 0.34354],
+ [0.31216, 0.18373, 0.35011],
+ [0.31038, 0.1869, 0.35682],
+ [0.3087, 0.19021, 0.36363],
+ [0.30712, 0.1937, 0.37056],
+ [0.3057, 0.19732, 0.3776],
+ [0.30435, 0.20106, 0.38473],
+ [0.30314, 0.205, 0.39195],
+ [0.30204, 0.20905, 0.39924],
+ [0.30106, 0.21323, 0.40661],
+ [0.30019, 0.21756, 0.41404],
+ [0.29944, 0.22198, 0.42151],
+ [0.29878, 0.22656, 0.42904],
+ [0.29822, 0.23122, 0.4366],
+ [0.29778, 0.23599, 0.44419],
+ [0.29745, 0.24085, 0.45179],
+ [0.29721, 0.24582, 0.45941],
+ [0.29708, 0.2509, 0.46703],
+ [0.29704, 0.25603, 0.47465],
+ [0.2971, 0.26127, 0.48225],
+ [0.29726, 0.26658, 0.48983],
+ [0.2975, 0.27194, 0.4974],
+ [0.29784, 0.27741, 0.50493],
+ [0.29828, 0.28292, 0.51242],
+ [0.29881, 0.28847, 0.51987],
+ [0.29943, 0.29408, 0.52728],
+ [0.30012, 0.29976, 0.53463],
+ [0.3009, 0.30548, 0.54191],
+ [0.30176, 0.31122, 0.54915],
+ [0.30271, 0.317, 0.5563],
+ [0.30373, 0.32283, 0.56339],
+ [0.30483, 0.32866, 0.5704],
+ [0.30601, 0.33454, 0.57733],
+ [0.30722, 0.34042, 0.58418],
+ [0.30853, 0.34631, 0.59095],
+ [0.30989, 0.35224, 0.59763],
+ [0.3113, 0.35817, 0.60423],
+ [0.31277, 0.3641, 0.61073],
+ [0.31431, 0.37005, 0.61715],
+ [0.3159, 0.376, 0.62347],
+ [0.31752, 0.38195, 0.62969],
+ [0.3192, 0.3879, 0.63583],
+ [0.32092, 0.39385, 0.64188],
+ [0.32268, 0.39979, 0.64783],
+ [0.32446, 0.40575, 0.6537],
+ [0.3263, 0.41168, 0.65948],
+ [0.32817, 0.41763, 0.66517],
+ [0.33008, 0.42355, 0.67079],
+ [0.33201, 0.4295, 0.67632],
+ [0.33398, 0.43544, 0.68176],
+ [0.33596, 0.44137, 0.68715],
+ [0.33798, 0.44731, 0.69246],
+ [0.34003, 0.45327, 0.69769],
+ [0.3421, 0.45923, 0.70288],
+ [0.34419, 0.4652, 0.70799],
+ [0.34631, 0.4712, 0.71306],
+ [0.34847, 0.4772, 0.71808],
+ [0.35064, 0.48323, 0.72305],
+ [0.35283, 0.48928, 0.72798],
+ [0.35506, 0.49537, 0.73288],
+ [0.3573, 0.50149, 0.73773],
+ [0.35955, 0.50763, 0.74256],
+ [0.36185, 0.51381, 0.74736],
+ [0.36414, 0.52001, 0.75213],
+ [0.36649, 0.52627, 0.75689],
+ [0.36884, 0.53256, 0.76162],
+ [0.37119, 0.53889, 0.76633],
+ [0.37359, 0.54525, 0.77103],
+ [0.376, 0.55166, 0.77571],
+ [0.37842, 0.55809, 0.78037],
+ [0.38087, 0.56458, 0.78503],
+ [0.38333, 0.5711, 0.78966],
+ [0.38579, 0.57766, 0.79429],
+ [0.38828, 0.58426, 0.7989],
+ [0.39078, 0.59088, 0.8035],
+ [0.39329, 0.59755, 0.8081],
+ [0.39582, 0.60426, 0.81268],
+ [0.39835, 0.61099, 0.81725],
+ [0.4009, 0.61774, 0.82182],
+ [0.40344, 0.62454, 0.82637],
+ [0.406, 0.63137, 0.83092],
+ [0.40856, 0.63822, 0.83546],
+ [0.41114, 0.6451, 0.83999],
+ [0.41372, 0.65202, 0.84451],
+ [0.41631, 0.65896, 0.84903],
+ [0.4189, 0.66593, 0.85354],
+ [0.42149, 0.67294, 0.85805],
+ [0.4241, 0.67996, 0.86256],
+ [0.42671, 0.68702, 0.86705],
+ [0.42932, 0.69411, 0.87156],
+ [0.43195, 0.70123, 0.87606],
+ [0.43457, 0.70839, 0.88056],
+ [0.4372, 0.71557, 0.88506],
+ [0.43983, 0.72278, 0.88956],
+ [0.44248, 0.73004, 0.89407],
+ [0.44512, 0.73732, 0.89858],
+ [0.44776, 0.74464, 0.9031],
+ [0.45042, 0.752, 0.90763],
+ [0.45308, 0.75939, 0.91216],
+ [0.45574, 0.76682, 0.9167],
+ [0.45841, 0.77429, 0.92124],
+ [0.46109, 0.78181, 0.9258],
+ [0.46377, 0.78936, 0.93036],
+ [0.46645, 0.79694, 0.93494],
+ [0.46914, 0.80458, 0.93952],
+ [0.47183, 0.81224, 0.94412],
+ [0.47453, 0.81995, 0.94872],
+ [0.47721, 0.8277, 0.95334],
+ [0.47992, 0.83549, 0.95796],
+ [0.48261, 0.84331, 0.96259],
+ [0.4853, 0.85117, 0.96722],
+ [0.48801, 0.85906, 0.97186],
+ [0.49071, 0.86699, 0.97651],
+ [0.49339, 0.87495, 0.98116],
+ [0.49607, 0.88294, 0.98581],
+ [0.49877, 0.89096, 0.99047],
+ [0.50144, 0.89901, 0.99512],
+ [0.50411, 0.90708, 0.99978]]
+
+_vanimo_data = [
+ [1, 0.80346, 0.99215],
+ [0.99397, 0.79197, 0.98374],
+ [0.98791, 0.78052, 0.97535],
+ [0.98185, 0.7691, 0.96699],
+ [0.97578, 0.75774, 0.95867],
+ [0.96971, 0.74643, 0.95037],
+ [0.96363, 0.73517, 0.94211],
+ [0.95755, 0.72397, 0.93389],
+ [0.95147, 0.71284, 0.9257],
+ [0.94539, 0.70177, 0.91756],
+ [0.93931, 0.69077, 0.90945],
+ [0.93322, 0.67984, 0.90137],
+ [0.92713, 0.66899, 0.89334],
+ [0.92104, 0.65821, 0.88534],
+ [0.91495, 0.64751, 0.87738],
+ [0.90886, 0.63689, 0.86946],
+ [0.90276, 0.62634, 0.86158],
+ [0.89666, 0.61588, 0.85372],
+ [0.89055, 0.60551, 0.84591],
+ [0.88444, 0.59522, 0.83813],
+ [0.87831, 0.58503, 0.83039],
+ [0.87219, 0.57491, 0.82268],
+ [0.86605, 0.5649, 0.815],
+ [0.8599, 0.55499, 0.80736],
+ [0.85373, 0.54517, 0.79974],
+ [0.84756, 0.53544, 0.79216],
+ [0.84138, 0.52583, 0.78461],
+ [0.83517, 0.5163, 0.77709],
+ [0.82896, 0.5069, 0.76959],
+ [0.82272, 0.49761, 0.76212],
+ [0.81647, 0.48841, 0.75469],
+ [0.81018, 0.47934, 0.74728],
+ [0.80389, 0.47038, 0.7399],
+ [0.79757, 0.46154, 0.73255],
+ [0.79123, 0.45283, 0.72522],
+ [0.78487, 0.44424, 0.71792],
+ [0.77847, 0.43578, 0.71064],
+ [0.77206, 0.42745, 0.70339],
+ [0.76562, 0.41925, 0.69617],
+ [0.75914, 0.41118, 0.68897],
+ [0.75264, 0.40327, 0.68179],
+ [0.74612, 0.39549, 0.67465],
+ [0.73957, 0.38783, 0.66752],
+ [0.73297, 0.38034, 0.66041],
+ [0.72634, 0.37297, 0.65331],
+ [0.71967, 0.36575, 0.64623],
+ [0.71293, 0.35864, 0.63915],
+ [0.70615, 0.35166, 0.63206],
+ [0.69929, 0.34481, 0.62496],
+ [0.69236, 0.33804, 0.61782],
+ [0.68532, 0.33137, 0.61064],
+ [0.67817, 0.32479, 0.6034],
+ [0.67091, 0.3183, 0.59609],
+ [0.66351, 0.31184, 0.5887],
+ [0.65598, 0.30549, 0.58123],
+ [0.64828, 0.29917, 0.57366],
+ [0.64045, 0.29289, 0.56599],
+ [0.63245, 0.28667, 0.55822],
+ [0.6243, 0.28051, 0.55035],
+ [0.61598, 0.27442, 0.54237],
+ [0.60752, 0.26838, 0.53428],
+ [0.59889, 0.2624, 0.5261],
+ [0.59012, 0.25648, 0.51782],
+ [0.5812, 0.25063, 0.50944],
+ [0.57214, 0.24483, 0.50097],
+ [0.56294, 0.23914, 0.4924],
+ [0.55359, 0.23348, 0.48376],
+ [0.54413, 0.22795, 0.47505],
+ [0.53454, 0.22245, 0.46623],
+ [0.52483, 0.21706, 0.45736],
+ [0.51501, 0.21174, 0.44843],
+ [0.50508, 0.20651, 0.43942],
+ [0.49507, 0.20131, 0.43036],
+ [0.48495, 0.19628, 0.42125],
+ [0.47476, 0.19128, 0.4121],
+ [0.4645, 0.18639, 0.4029],
+ [0.45415, 0.18157, 0.39367],
+ [0.44376, 0.17688, 0.38441],
+ [0.43331, 0.17225, 0.37513],
+ [0.42282, 0.16773, 0.36585],
+ [0.41232, 0.16332, 0.35655],
+ [0.40178, 0.15897, 0.34726],
+ [0.39125, 0.15471, 0.33796],
+ [0.38071, 0.15058, 0.32869],
+ [0.37017, 0.14651, 0.31945],
+ [0.35969, 0.14258, 0.31025],
+ [0.34923, 0.13872, 0.30106],
+ [0.33883, 0.13499, 0.29196],
+ [0.32849, 0.13133, 0.28293],
+ [0.31824, 0.12778, 0.27396],
+ [0.30808, 0.12431, 0.26508],
+ [0.29805, 0.12097, 0.25631],
+ [0.28815, 0.11778, 0.24768],
+ [0.27841, 0.11462, 0.23916],
+ [0.26885, 0.11169, 0.23079],
+ [0.25946, 0.10877, 0.22259],
+ [0.25025, 0.10605, 0.21455],
+ [0.24131, 0.10341, 0.20673],
+ [0.23258, 0.10086, 0.19905],
+ [0.2241, 0.098494, 0.19163],
+ [0.21593, 0.096182, 0.18443],
+ [0.20799, 0.094098, 0.17748],
+ [0.20032, 0.092102, 0.17072],
+ [0.19299, 0.09021, 0.16425],
+ [0.18596, 0.088461, 0.15799],
+ [0.17918, 0.086861, 0.15197],
+ [0.17272, 0.08531, 0.14623],
+ [0.16658, 0.084017, 0.14075],
+ [0.1607, 0.082745, 0.13546],
+ [0.15515, 0.081683, 0.13049],
+ [0.1499, 0.080653, 0.1257],
+ [0.14493, 0.07978, 0.12112],
+ [0.1402, 0.079037, 0.11685],
+ [0.13578, 0.078426, 0.11282],
+ [0.13168, 0.077944, 0.10894],
+ [0.12782, 0.077586, 0.10529],
+ [0.12422, 0.077332, 0.1019],
+ [0.12091, 0.077161, 0.098724],
+ [0.11793, 0.077088, 0.095739],
+ [0.11512, 0.077124, 0.092921],
+ [0.11267, 0.077278, 0.090344],
+ [0.11042, 0.077557, 0.087858],
+ [0.10835, 0.077968, 0.085431],
+ [0.10665, 0.078516, 0.083233],
+ [0.105, 0.079207, 0.081185],
+ [0.10368, 0.080048, 0.079202],
+ [0.10245, 0.081036, 0.077408],
+ [0.10143, 0.082173, 0.075793],
+ [0.1006, 0.083343, 0.074344],
+ [0.099957, 0.084733, 0.073021],
+ [0.099492, 0.086174, 0.071799],
+ [0.099204, 0.087868, 0.070716],
+ [0.099092, 0.089631, 0.069813],
+ [0.099154, 0.091582, 0.069047],
+ [0.099384, 0.093597, 0.068337],
+ [0.099759, 0.095871, 0.067776],
+ [0.10029, 0.098368, 0.067351],
+ [0.10099, 0.101, 0.067056],
+ [0.10185, 0.1039, 0.066891],
+ [0.1029, 0.10702, 0.066853],
+ [0.10407, 0.11031, 0.066942],
+ [0.10543, 0.1138, 0.067155],
+ [0.10701, 0.1175, 0.067485],
+ [0.10866, 0.12142, 0.067929],
+ [0.11059, 0.12561, 0.06849],
+ [0.11265, 0.12998, 0.069162],
+ [0.11483, 0.13453, 0.069842],
+ [0.11725, 0.13923, 0.07061],
+ [0.11985, 0.14422, 0.071528],
+ [0.12259, 0.14937, 0.072403],
+ [0.12558, 0.15467, 0.073463],
+ [0.12867, 0.16015, 0.074429],
+ [0.13196, 0.16584, 0.075451],
+ [0.1354, 0.17169, 0.076499],
+ [0.13898, 0.17771, 0.077615],
+ [0.14273, 0.18382, 0.078814],
+ [0.14658, 0.1901, 0.080098],
+ [0.15058, 0.19654, 0.081473],
+ [0.15468, 0.20304, 0.08282],
+ [0.15891, 0.20968, 0.084315],
+ [0.16324, 0.21644, 0.085726],
+ [0.16764, 0.22326, 0.087378],
+ [0.17214, 0.23015, 0.088955],
+ [0.17673, 0.23717, 0.090617],
+ [0.18139, 0.24418, 0.092314],
+ [0.18615, 0.25132, 0.094071],
+ [0.19092, 0.25846, 0.095839],
+ [0.19578, 0.26567, 0.097702],
+ [0.20067, 0.2729, 0.099539],
+ [0.20564, 0.28016, 0.10144],
+ [0.21062, 0.28744, 0.10342],
+ [0.21565, 0.29475, 0.10534],
+ [0.22072, 0.30207, 0.10737],
+ [0.22579, 0.30942, 0.10942],
+ [0.23087, 0.31675, 0.11146],
+ [0.236, 0.32407, 0.11354],
+ [0.24112, 0.3314, 0.11563],
+ [0.24625, 0.33874, 0.11774],
+ [0.25142, 0.34605, 0.11988],
+ [0.25656, 0.35337, 0.12202],
+ [0.26171, 0.36065, 0.12422],
+ [0.26686, 0.36793, 0.12645],
+ [0.272, 0.37519, 0.12865],
+ [0.27717, 0.38242, 0.13092],
+ [0.28231, 0.38964, 0.13316],
+ [0.28741, 0.39682, 0.13541],
+ [0.29253, 0.40398, 0.13773],
+ [0.29763, 0.41111, 0.13998],
+ [0.30271, 0.4182, 0.14232],
+ [0.30778, 0.42527, 0.14466],
+ [0.31283, 0.43231, 0.14699],
+ [0.31787, 0.43929, 0.14937],
+ [0.32289, 0.44625, 0.15173],
+ [0.32787, 0.45318, 0.15414],
+ [0.33286, 0.46006, 0.1566],
+ [0.33781, 0.46693, 0.15904],
+ [0.34276, 0.47374, 0.16155],
+ [0.34769, 0.48054, 0.16407],
+ [0.3526, 0.48733, 0.16661],
+ [0.35753, 0.4941, 0.16923],
+ [0.36245, 0.50086, 0.17185],
+ [0.36738, 0.50764, 0.17458],
+ [0.37234, 0.51443, 0.17738],
+ [0.37735, 0.52125, 0.18022],
+ [0.38238, 0.52812, 0.18318],
+ [0.38746, 0.53505, 0.18626],
+ [0.39261, 0.54204, 0.18942],
+ [0.39783, 0.54911, 0.19272],
+ [0.40311, 0.55624, 0.19616],
+ [0.40846, 0.56348, 0.1997],
+ [0.4139, 0.57078, 0.20345],
+ [0.41942, 0.57819, 0.20734],
+ [0.42503, 0.5857, 0.2114],
+ [0.43071, 0.59329, 0.21565],
+ [0.43649, 0.60098, 0.22009],
+ [0.44237, 0.60878, 0.2247],
+ [0.44833, 0.61667, 0.22956],
+ [0.45439, 0.62465, 0.23468],
+ [0.46053, 0.63274, 0.23997],
+ [0.46679, 0.64092, 0.24553],
+ [0.47313, 0.64921, 0.25138],
+ [0.47959, 0.6576, 0.25745],
+ [0.48612, 0.66608, 0.26382],
+ [0.49277, 0.67466, 0.27047],
+ [0.49951, 0.68335, 0.2774],
+ [0.50636, 0.69213, 0.28464],
+ [0.51331, 0.70101, 0.2922],
+ [0.52035, 0.70998, 0.30008],
+ [0.5275, 0.71905, 0.30828],
+ [0.53474, 0.72821, 0.31682],
+ [0.54207, 0.73747, 0.32567],
+ [0.5495, 0.74682, 0.33491],
+ [0.55702, 0.75625, 0.34443],
+ [0.56461, 0.76577, 0.35434],
+ [0.5723, 0.77537, 0.36457],
+ [0.58006, 0.78506, 0.37515],
+ [0.58789, 0.79482, 0.38607],
+ [0.59581, 0.80465, 0.39734],
+ [0.60379, 0.81455, 0.40894],
+ [0.61182, 0.82453, 0.42086],
+ [0.61991, 0.83457, 0.43311],
+ [0.62805, 0.84467, 0.44566],
+ [0.63623, 0.85482, 0.45852],
+ [0.64445, 0.86503, 0.47168],
+ [0.6527, 0.8753, 0.48511],
+ [0.66099, 0.88562, 0.49882],
+ [0.6693, 0.89599, 0.51278],
+ [0.67763, 0.90641, 0.52699],
+ [0.68597, 0.91687, 0.54141],
+ [0.69432, 0.92738, 0.55605],
+ [0.70269, 0.93794, 0.5709],
+ [0.71107, 0.94855, 0.58593],
+ [0.71945, 0.9592, 0.60112],
+ [0.72782, 0.96989, 0.61646],
+ [0.7362, 0.98063, 0.63191],
+ [0.74458, 0.99141, 0.64748]]
+
+cmaps = {
+ name: ListedColormap(data, name=name) for name, data in [
+ ('magma', _magma_data),
+ ('inferno', _inferno_data),
+ ('plasma', _plasma_data),
+ ('viridis', _viridis_data),
+ ('cividis', _cividis_data),
+ ('twilight', _twilight_data),
+ ('twilight_shifted', _twilight_shifted_data),
+ ('turbo', _turbo_data),
+ ('berlin', _berlin_data),
+ ('managua', _managua_data),
+ ('vanimo', _vanimo_data),
+ ]}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_multivar.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_multivar.py
new file mode 100644
index 0000000000000000000000000000000000000000..610d7c40935b0999fe7de38515f316ce816023f7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_cm_multivar.py
@@ -0,0 +1,166 @@
+# auto-generated by https://github.com/trygvrad/multivariate_colormaps
+# date: 2024-05-28
+
+from .colors import LinearSegmentedColormap, MultivarColormap
+import matplotlib as mpl
+_LUTSIZE = mpl.rcParams['image.lut']
+
+_2VarAddA0_data = [[0.000, 0.000, 0.000],
+ [0.020, 0.026, 0.031],
+ [0.049, 0.068, 0.085],
+ [0.075, 0.107, 0.135],
+ [0.097, 0.144, 0.183],
+ [0.116, 0.178, 0.231],
+ [0.133, 0.212, 0.279],
+ [0.148, 0.244, 0.326],
+ [0.161, 0.276, 0.374],
+ [0.173, 0.308, 0.422],
+ [0.182, 0.339, 0.471],
+ [0.190, 0.370, 0.521],
+ [0.197, 0.400, 0.572],
+ [0.201, 0.431, 0.623],
+ [0.204, 0.461, 0.675],
+ [0.204, 0.491, 0.728],
+ [0.202, 0.520, 0.783],
+ [0.197, 0.549, 0.838],
+ [0.187, 0.577, 0.895]]
+
+_2VarAddA1_data = [[0.000, 0.000, 0.000],
+ [0.030, 0.023, 0.018],
+ [0.079, 0.060, 0.043],
+ [0.125, 0.093, 0.065],
+ [0.170, 0.123, 0.083],
+ [0.213, 0.151, 0.098],
+ [0.255, 0.177, 0.110],
+ [0.298, 0.202, 0.120],
+ [0.341, 0.226, 0.128],
+ [0.384, 0.249, 0.134],
+ [0.427, 0.271, 0.138],
+ [0.472, 0.292, 0.141],
+ [0.517, 0.313, 0.142],
+ [0.563, 0.333, 0.141],
+ [0.610, 0.353, 0.139],
+ [0.658, 0.372, 0.134],
+ [0.708, 0.390, 0.127],
+ [0.759, 0.407, 0.118],
+ [0.813, 0.423, 0.105]]
+
+_2VarSubA0_data = [[1.000, 1.000, 1.000],
+ [0.959, 0.973, 0.986],
+ [0.916, 0.948, 0.974],
+ [0.874, 0.923, 0.965],
+ [0.832, 0.899, 0.956],
+ [0.790, 0.875, 0.948],
+ [0.748, 0.852, 0.940],
+ [0.707, 0.829, 0.934],
+ [0.665, 0.806, 0.927],
+ [0.624, 0.784, 0.921],
+ [0.583, 0.762, 0.916],
+ [0.541, 0.740, 0.910],
+ [0.500, 0.718, 0.905],
+ [0.457, 0.697, 0.901],
+ [0.414, 0.675, 0.896],
+ [0.369, 0.652, 0.892],
+ [0.320, 0.629, 0.888],
+ [0.266, 0.604, 0.884],
+ [0.199, 0.574, 0.881]]
+
+_2VarSubA1_data = [[1.000, 1.000, 1.000],
+ [0.982, 0.967, 0.955],
+ [0.966, 0.935, 0.908],
+ [0.951, 0.902, 0.860],
+ [0.937, 0.870, 0.813],
+ [0.923, 0.838, 0.765],
+ [0.910, 0.807, 0.718],
+ [0.898, 0.776, 0.671],
+ [0.886, 0.745, 0.624],
+ [0.874, 0.714, 0.577],
+ [0.862, 0.683, 0.530],
+ [0.851, 0.653, 0.483],
+ [0.841, 0.622, 0.435],
+ [0.831, 0.592, 0.388],
+ [0.822, 0.561, 0.340],
+ [0.813, 0.530, 0.290],
+ [0.806, 0.498, 0.239],
+ [0.802, 0.464, 0.184],
+ [0.801, 0.426, 0.119]]
+
+_3VarAddA0_data = [[0.000, 0.000, 0.000],
+ [0.018, 0.023, 0.028],
+ [0.040, 0.056, 0.071],
+ [0.059, 0.087, 0.110],
+ [0.074, 0.114, 0.147],
+ [0.086, 0.139, 0.183],
+ [0.095, 0.163, 0.219],
+ [0.101, 0.187, 0.255],
+ [0.105, 0.209, 0.290],
+ [0.107, 0.230, 0.326],
+ [0.105, 0.251, 0.362],
+ [0.101, 0.271, 0.398],
+ [0.091, 0.291, 0.434],
+ [0.075, 0.309, 0.471],
+ [0.046, 0.325, 0.507],
+ [0.021, 0.341, 0.546],
+ [0.021, 0.363, 0.584],
+ [0.022, 0.385, 0.622],
+ [0.023, 0.408, 0.661]]
+
+_3VarAddA1_data = [[0.000, 0.000, 0.000],
+ [0.020, 0.024, 0.016],
+ [0.047, 0.058, 0.034],
+ [0.072, 0.088, 0.048],
+ [0.093, 0.116, 0.059],
+ [0.113, 0.142, 0.067],
+ [0.131, 0.167, 0.071],
+ [0.149, 0.190, 0.074],
+ [0.166, 0.213, 0.074],
+ [0.182, 0.235, 0.072],
+ [0.198, 0.256, 0.068],
+ [0.215, 0.276, 0.061],
+ [0.232, 0.296, 0.051],
+ [0.249, 0.314, 0.037],
+ [0.270, 0.330, 0.018],
+ [0.288, 0.347, 0.000],
+ [0.302, 0.369, 0.000],
+ [0.315, 0.391, 0.000],
+ [0.328, 0.414, 0.000]]
+
+_3VarAddA2_data = [[0.000, 0.000, 0.000],
+ [0.029, 0.020, 0.023],
+ [0.072, 0.045, 0.055],
+ [0.111, 0.067, 0.084],
+ [0.148, 0.085, 0.109],
+ [0.184, 0.101, 0.133],
+ [0.219, 0.115, 0.155],
+ [0.254, 0.127, 0.176],
+ [0.289, 0.138, 0.195],
+ [0.323, 0.147, 0.214],
+ [0.358, 0.155, 0.232],
+ [0.393, 0.161, 0.250],
+ [0.429, 0.166, 0.267],
+ [0.467, 0.169, 0.283],
+ [0.507, 0.168, 0.298],
+ [0.546, 0.168, 0.313],
+ [0.580, 0.172, 0.328],
+ [0.615, 0.175, 0.341],
+ [0.649, 0.178, 0.355]]
+
+cmaps = {
+ name: LinearSegmentedColormap.from_list(name, data, _LUTSIZE) for name, data in [
+ ('2VarAddA0', _2VarAddA0_data),
+ ('2VarAddA1', _2VarAddA1_data),
+ ('2VarSubA0', _2VarSubA0_data),
+ ('2VarSubA1', _2VarSubA1_data),
+ ('3VarAddA0', _3VarAddA0_data),
+ ('3VarAddA1', _3VarAddA1_data),
+ ('3VarAddA2', _3VarAddA2_data),
+ ]}
+
+cmap_families = {
+ '2VarAddA': MultivarColormap([cmaps[f'2VarAddA{i}'] for i in range(2)],
+ 'sRGB_add', name='2VarAddA'),
+ '2VarSubA': MultivarColormap([cmaps[f'2VarSubA{i}'] for i in range(2)],
+ 'sRGB_sub', name='2VarSubA'),
+ '3VarAddA': MultivarColormap([cmaps[f'3VarAddA{i}'] for i in range(3)],
+ 'sRGB_add', name='3VarAddA'),
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_color_data.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_color_data.py
new file mode 100644
index 0000000000000000000000000000000000000000..44f97adbb76aeaec2578cedfe60219a3278fd2ca
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_color_data.py
@@ -0,0 +1,1141 @@
+BASE_COLORS = {
+ 'b': (0, 0, 1), # blue
+ 'g': (0, 0.5, 0), # green
+ 'r': (1, 0, 0), # red
+ 'c': (0, 0.75, 0.75), # cyan
+ 'm': (0.75, 0, 0.75), # magenta
+ 'y': (0.75, 0.75, 0), # yellow
+ 'k': (0, 0, 0), # black
+ 'w': (1, 1, 1), # white
+}
+
+
+# These colors are from Tableau
+TABLEAU_COLORS = {
+ 'tab:blue': '#1f77b4',
+ 'tab:orange': '#ff7f0e',
+ 'tab:green': '#2ca02c',
+ 'tab:red': '#d62728',
+ 'tab:purple': '#9467bd',
+ 'tab:brown': '#8c564b',
+ 'tab:pink': '#e377c2',
+ 'tab:gray': '#7f7f7f',
+ 'tab:olive': '#bcbd22',
+ 'tab:cyan': '#17becf',
+}
+
+
+# This mapping of color names -> hex values is taken from
+# a survey run by Randall Munroe see:
+# https://blog.xkcd.com/2010/05/03/color-survey-results/
+# for more details. The results are hosted at
+# https://xkcd.com/color/rgb/
+# and also available as a text file at
+# https://xkcd.com/color/rgb.txt
+#
+# License: https://creativecommons.org/publicdomain/zero/1.0/
+XKCD_COLORS = {
+ 'cloudy blue': '#acc2d9',
+ 'dark pastel green': '#56ae57',
+ 'dust': '#b2996e',
+ 'electric lime': '#a8ff04',
+ 'fresh green': '#69d84f',
+ 'light eggplant': '#894585',
+ 'nasty green': '#70b23f',
+ 'really light blue': '#d4ffff',
+ 'tea': '#65ab7c',
+ 'warm purple': '#952e8f',
+ 'yellowish tan': '#fcfc81',
+ 'cement': '#a5a391',
+ 'dark grass green': '#388004',
+ 'dusty teal': '#4c9085',
+ 'grey teal': '#5e9b8a',
+ 'macaroni and cheese': '#efb435',
+ 'pinkish tan': '#d99b82',
+ 'spruce': '#0a5f38',
+ 'strong blue': '#0c06f7',
+ 'toxic green': '#61de2a',
+ 'windows blue': '#3778bf',
+ 'blue blue': '#2242c7',
+ 'blue with a hint of purple': '#533cc6',
+ 'booger': '#9bb53c',
+ 'bright sea green': '#05ffa6',
+ 'dark green blue': '#1f6357',
+ 'deep turquoise': '#017374',
+ 'green teal': '#0cb577',
+ 'strong pink': '#ff0789',
+ 'bland': '#afa88b',
+ 'deep aqua': '#08787f',
+ 'lavender pink': '#dd85d7',
+ 'light moss green': '#a6c875',
+ 'light seafoam green': '#a7ffb5',
+ 'olive yellow': '#c2b709',
+ 'pig pink': '#e78ea5',
+ 'deep lilac': '#966ebd',
+ 'desert': '#ccad60',
+ 'dusty lavender': '#ac86a8',
+ 'purpley grey': '#947e94',
+ 'purply': '#983fb2',
+ 'candy pink': '#ff63e9',
+ 'light pastel green': '#b2fba5',
+ 'boring green': '#63b365',
+ 'kiwi green': '#8ee53f',
+ 'light grey green': '#b7e1a1',
+ 'orange pink': '#ff6f52',
+ 'tea green': '#bdf8a3',
+ 'very light brown': '#d3b683',
+ 'egg shell': '#fffcc4',
+ 'eggplant purple': '#430541',
+ 'powder pink': '#ffb2d0',
+ 'reddish grey': '#997570',
+ 'baby shit brown': '#ad900d',
+ 'liliac': '#c48efd',
+ 'stormy blue': '#507b9c',
+ 'ugly brown': '#7d7103',
+ 'custard': '#fffd78',
+ 'darkish pink': '#da467d',
+ 'deep brown': '#410200',
+ 'greenish beige': '#c9d179',
+ 'manilla': '#fffa86',
+ 'off blue': '#5684ae',
+ 'battleship grey': '#6b7c85',
+ 'browny green': '#6f6c0a',
+ 'bruise': '#7e4071',
+ 'kelley green': '#009337',
+ 'sickly yellow': '#d0e429',
+ 'sunny yellow': '#fff917',
+ 'azul': '#1d5dec',
+ 'darkgreen': '#054907',
+ 'green/yellow': '#b5ce08',
+ 'lichen': '#8fb67b',
+ 'light light green': '#c8ffb0',
+ 'pale gold': '#fdde6c',
+ 'sun yellow': '#ffdf22',
+ 'tan green': '#a9be70',
+ 'burple': '#6832e3',
+ 'butterscotch': '#fdb147',
+ 'toupe': '#c7ac7d',
+ 'dark cream': '#fff39a',
+ 'indian red': '#850e04',
+ 'light lavendar': '#efc0fe',
+ 'poison green': '#40fd14',
+ 'baby puke green': '#b6c406',
+ 'bright yellow green': '#9dff00',
+ 'charcoal grey': '#3c4142',
+ 'squash': '#f2ab15',
+ 'cinnamon': '#ac4f06',
+ 'light pea green': '#c4fe82',
+ 'radioactive green': '#2cfa1f',
+ 'raw sienna': '#9a6200',
+ 'baby purple': '#ca9bf7',
+ 'cocoa': '#875f42',
+ 'light royal blue': '#3a2efe',
+ 'orangeish': '#fd8d49',
+ 'rust brown': '#8b3103',
+ 'sand brown': '#cba560',
+ 'swamp': '#698339',
+ 'tealish green': '#0cdc73',
+ 'burnt siena': '#b75203',
+ 'camo': '#7f8f4e',
+ 'dusk blue': '#26538d',
+ 'fern': '#63a950',
+ 'old rose': '#c87f89',
+ 'pale light green': '#b1fc99',
+ 'peachy pink': '#ff9a8a',
+ 'rosy pink': '#f6688e',
+ 'light bluish green': '#76fda8',
+ 'light bright green': '#53fe5c',
+ 'light neon green': '#4efd54',
+ 'light seafoam': '#a0febf',
+ 'tiffany blue': '#7bf2da',
+ 'washed out green': '#bcf5a6',
+ 'browny orange': '#ca6b02',
+ 'nice blue': '#107ab0',
+ 'sapphire': '#2138ab',
+ 'greyish teal': '#719f91',
+ 'orangey yellow': '#fdb915',
+ 'parchment': '#fefcaf',
+ 'straw': '#fcf679',
+ 'very dark brown': '#1d0200',
+ 'terracota': '#cb6843',
+ 'ugly blue': '#31668a',
+ 'clear blue': '#247afd',
+ 'creme': '#ffffb6',
+ 'foam green': '#90fda9',
+ 'grey/green': '#86a17d',
+ 'light gold': '#fddc5c',
+ 'seafoam blue': '#78d1b6',
+ 'topaz': '#13bbaf',
+ 'violet pink': '#fb5ffc',
+ 'wintergreen': '#20f986',
+ 'yellow tan': '#ffe36e',
+ 'dark fuchsia': '#9d0759',
+ 'indigo blue': '#3a18b1',
+ 'light yellowish green': '#c2ff89',
+ 'pale magenta': '#d767ad',
+ 'rich purple': '#720058',
+ 'sunflower yellow': '#ffda03',
+ 'green/blue': '#01c08d',
+ 'leather': '#ac7434',
+ 'racing green': '#014600',
+ 'vivid purple': '#9900fa',
+ 'dark royal blue': '#02066f',
+ 'hazel': '#8e7618',
+ 'muted pink': '#d1768f',
+ 'booger green': '#96b403',
+ 'canary': '#fdff63',
+ 'cool grey': '#95a3a6',
+ 'dark taupe': '#7f684e',
+ 'darkish purple': '#751973',
+ 'true green': '#089404',
+ 'coral pink': '#ff6163',
+ 'dark sage': '#598556',
+ 'dark slate blue': '#214761',
+ 'flat blue': '#3c73a8',
+ 'mushroom': '#ba9e88',
+ 'rich blue': '#021bf9',
+ 'dirty purple': '#734a65',
+ 'greenblue': '#23c48b',
+ 'icky green': '#8fae22',
+ 'light khaki': '#e6f2a2',
+ 'warm blue': '#4b57db',
+ 'dark hot pink': '#d90166',
+ 'deep sea blue': '#015482',
+ 'carmine': '#9d0216',
+ 'dark yellow green': '#728f02',
+ 'pale peach': '#ffe5ad',
+ 'plum purple': '#4e0550',
+ 'golden rod': '#f9bc08',
+ 'neon red': '#ff073a',
+ 'old pink': '#c77986',
+ 'very pale blue': '#d6fffe',
+ 'blood orange': '#fe4b03',
+ 'grapefruit': '#fd5956',
+ 'sand yellow': '#fce166',
+ 'clay brown': '#b2713d',
+ 'dark blue grey': '#1f3b4d',
+ 'flat green': '#699d4c',
+ 'light green blue': '#56fca2',
+ 'warm pink': '#fb5581',
+ 'dodger blue': '#3e82fc',
+ 'gross green': '#a0bf16',
+ 'ice': '#d6fffa',
+ 'metallic blue': '#4f738e',
+ 'pale salmon': '#ffb19a',
+ 'sap green': '#5c8b15',
+ 'algae': '#54ac68',
+ 'bluey grey': '#89a0b0',
+ 'greeny grey': '#7ea07a',
+ 'highlighter green': '#1bfc06',
+ 'light light blue': '#cafffb',
+ 'light mint': '#b6ffbb',
+ 'raw umber': '#a75e09',
+ 'vivid blue': '#152eff',
+ 'deep lavender': '#8d5eb7',
+ 'dull teal': '#5f9e8f',
+ 'light greenish blue': '#63f7b4',
+ 'mud green': '#606602',
+ 'pinky': '#fc86aa',
+ 'red wine': '#8c0034',
+ 'shit green': '#758000',
+ 'tan brown': '#ab7e4c',
+ 'darkblue': '#030764',
+ 'rosa': '#fe86a4',
+ 'lipstick': '#d5174e',
+ 'pale mauve': '#fed0fc',
+ 'claret': '#680018',
+ 'dandelion': '#fedf08',
+ 'orangered': '#fe420f',
+ 'poop green': '#6f7c00',
+ 'ruby': '#ca0147',
+ 'dark': '#1b2431',
+ 'greenish turquoise': '#00fbb0',
+ 'pastel red': '#db5856',
+ 'piss yellow': '#ddd618',
+ 'bright cyan': '#41fdfe',
+ 'dark coral': '#cf524e',
+ 'algae green': '#21c36f',
+ 'darkish red': '#a90308',
+ 'reddy brown': '#6e1005',
+ 'blush pink': '#fe828c',
+ 'camouflage green': '#4b6113',
+ 'lawn green': '#4da409',
+ 'putty': '#beae8a',
+ 'vibrant blue': '#0339f8',
+ 'dark sand': '#a88f59',
+ 'purple/blue': '#5d21d0',
+ 'saffron': '#feb209',
+ 'twilight': '#4e518b',
+ 'warm brown': '#964e02',
+ 'bluegrey': '#85a3b2',
+ 'bubble gum pink': '#ff69af',
+ 'duck egg blue': '#c3fbf4',
+ 'greenish cyan': '#2afeb7',
+ 'petrol': '#005f6a',
+ 'royal': '#0c1793',
+ 'butter': '#ffff81',
+ 'dusty orange': '#f0833a',
+ 'off yellow': '#f1f33f',
+ 'pale olive green': '#b1d27b',
+ 'orangish': '#fc824a',
+ 'leaf': '#71aa34',
+ 'light blue grey': '#b7c9e2',
+ 'dried blood': '#4b0101',
+ 'lightish purple': '#a552e6',
+ 'rusty red': '#af2f0d',
+ 'lavender blue': '#8b88f8',
+ 'light grass green': '#9af764',
+ 'light mint green': '#a6fbb2',
+ 'sunflower': '#ffc512',
+ 'velvet': '#750851',
+ 'brick orange': '#c14a09',
+ 'lightish red': '#fe2f4a',
+ 'pure blue': '#0203e2',
+ 'twilight blue': '#0a437a',
+ 'violet red': '#a50055',
+ 'yellowy brown': '#ae8b0c',
+ 'carnation': '#fd798f',
+ 'muddy yellow': '#bfac05',
+ 'dark seafoam green': '#3eaf76',
+ 'deep rose': '#c74767',
+ 'dusty red': '#b9484e',
+ 'grey/blue': '#647d8e',
+ 'lemon lime': '#bffe28',
+ 'purple/pink': '#d725de',
+ 'brown yellow': '#b29705',
+ 'purple brown': '#673a3f',
+ 'wisteria': '#a87dc2',
+ 'banana yellow': '#fafe4b',
+ 'lipstick red': '#c0022f',
+ 'water blue': '#0e87cc',
+ 'brown grey': '#8d8468',
+ 'vibrant purple': '#ad03de',
+ 'baby green': '#8cff9e',
+ 'barf green': '#94ac02',
+ 'eggshell blue': '#c4fff7',
+ 'sandy yellow': '#fdee73',
+ 'cool green': '#33b864',
+ 'pale': '#fff9d0',
+ 'blue/grey': '#758da3',
+ 'hot magenta': '#f504c9',
+ 'greyblue': '#77a1b5',
+ 'purpley': '#8756e4',
+ 'baby shit green': '#889717',
+ 'brownish pink': '#c27e79',
+ 'dark aquamarine': '#017371',
+ 'diarrhea': '#9f8303',
+ 'light mustard': '#f7d560',
+ 'pale sky blue': '#bdf6fe',
+ 'turtle green': '#75b84f',
+ 'bright olive': '#9cbb04',
+ 'dark grey blue': '#29465b',
+ 'greeny brown': '#696006',
+ 'lemon green': '#adf802',
+ 'light periwinkle': '#c1c6fc',
+ 'seaweed green': '#35ad6b',
+ 'sunshine yellow': '#fffd37',
+ 'ugly purple': '#a442a0',
+ 'medium pink': '#f36196',
+ 'puke brown': '#947706',
+ 'very light pink': '#fff4f2',
+ 'viridian': '#1e9167',
+ 'bile': '#b5c306',
+ 'faded yellow': '#feff7f',
+ 'very pale green': '#cffdbc',
+ 'vibrant green': '#0add08',
+ 'bright lime': '#87fd05',
+ 'spearmint': '#1ef876',
+ 'light aquamarine': '#7bfdc7',
+ 'light sage': '#bcecac',
+ 'yellowgreen': '#bbf90f',
+ 'baby poo': '#ab9004',
+ 'dark seafoam': '#1fb57a',
+ 'deep teal': '#00555a',
+ 'heather': '#a484ac',
+ 'rust orange': '#c45508',
+ 'dirty blue': '#3f829d',
+ 'fern green': '#548d44',
+ 'bright lilac': '#c95efb',
+ 'weird green': '#3ae57f',
+ 'peacock blue': '#016795',
+ 'avocado green': '#87a922',
+ 'faded orange': '#f0944d',
+ 'grape purple': '#5d1451',
+ 'hot green': '#25ff29',
+ 'lime yellow': '#d0fe1d',
+ 'mango': '#ffa62b',
+ 'shamrock': '#01b44c',
+ 'bubblegum': '#ff6cb5',
+ 'purplish brown': '#6b4247',
+ 'vomit yellow': '#c7c10c',
+ 'pale cyan': '#b7fffa',
+ 'key lime': '#aeff6e',
+ 'tomato red': '#ec2d01',
+ 'lightgreen': '#76ff7b',
+ 'merlot': '#730039',
+ 'night blue': '#040348',
+ 'purpleish pink': '#df4ec8',
+ 'apple': '#6ecb3c',
+ 'baby poop green': '#8f9805',
+ 'green apple': '#5edc1f',
+ 'heliotrope': '#d94ff5',
+ 'yellow/green': '#c8fd3d',
+ 'almost black': '#070d0d',
+ 'cool blue': '#4984b8',
+ 'leafy green': '#51b73b',
+ 'mustard brown': '#ac7e04',
+ 'dusk': '#4e5481',
+ 'dull brown': '#876e4b',
+ 'frog green': '#58bc08',
+ 'vivid green': '#2fef10',
+ 'bright light green': '#2dfe54',
+ 'fluro green': '#0aff02',
+ 'kiwi': '#9cef43',
+ 'seaweed': '#18d17b',
+ 'navy green': '#35530a',
+ 'ultramarine blue': '#1805db',
+ 'iris': '#6258c4',
+ 'pastel orange': '#ff964f',
+ 'yellowish orange': '#ffab0f',
+ 'perrywinkle': '#8f8ce7',
+ 'tealish': '#24bca8',
+ 'dark plum': '#3f012c',
+ 'pear': '#cbf85f',
+ 'pinkish orange': '#ff724c',
+ 'midnight purple': '#280137',
+ 'light urple': '#b36ff6',
+ 'dark mint': '#48c072',
+ 'greenish tan': '#bccb7a',
+ 'light burgundy': '#a8415b',
+ 'turquoise blue': '#06b1c4',
+ 'ugly pink': '#cd7584',
+ 'sandy': '#f1da7a',
+ 'electric pink': '#ff0490',
+ 'muted purple': '#805b87',
+ 'mid green': '#50a747',
+ 'greyish': '#a8a495',
+ 'neon yellow': '#cfff04',
+ 'banana': '#ffff7e',
+ 'carnation pink': '#ff7fa7',
+ 'tomato': '#ef4026',
+ 'sea': '#3c9992',
+ 'muddy brown': '#886806',
+ 'turquoise green': '#04f489',
+ 'buff': '#fef69e',
+ 'fawn': '#cfaf7b',
+ 'muted blue': '#3b719f',
+ 'pale rose': '#fdc1c5',
+ 'dark mint green': '#20c073',
+ 'amethyst': '#9b5fc0',
+ 'blue/green': '#0f9b8e',
+ 'chestnut': '#742802',
+ 'sick green': '#9db92c',
+ 'pea': '#a4bf20',
+ 'rusty orange': '#cd5909',
+ 'stone': '#ada587',
+ 'rose red': '#be013c',
+ 'pale aqua': '#b8ffeb',
+ 'deep orange': '#dc4d01',
+ 'earth': '#a2653e',
+ 'mossy green': '#638b27',
+ 'grassy green': '#419c03',
+ 'pale lime green': '#b1ff65',
+ 'light grey blue': '#9dbcd4',
+ 'pale grey': '#fdfdfe',
+ 'asparagus': '#77ab56',
+ 'blueberry': '#464196',
+ 'purple red': '#990147',
+ 'pale lime': '#befd73',
+ 'greenish teal': '#32bf84',
+ 'caramel': '#af6f09',
+ 'deep magenta': '#a0025c',
+ 'light peach': '#ffd8b1',
+ 'milk chocolate': '#7f4e1e',
+ 'ocher': '#bf9b0c',
+ 'off green': '#6ba353',
+ 'purply pink': '#f075e6',
+ 'lightblue': '#7bc8f6',
+ 'dusky blue': '#475f94',
+ 'golden': '#f5bf03',
+ 'light beige': '#fffeb6',
+ 'butter yellow': '#fffd74',
+ 'dusky purple': '#895b7b',
+ 'french blue': '#436bad',
+ 'ugly yellow': '#d0c101',
+ 'greeny yellow': '#c6f808',
+ 'orangish red': '#f43605',
+ 'shamrock green': '#02c14d',
+ 'orangish brown': '#b25f03',
+ 'tree green': '#2a7e19',
+ 'deep violet': '#490648',
+ 'gunmetal': '#536267',
+ 'blue/purple': '#5a06ef',
+ 'cherry': '#cf0234',
+ 'sandy brown': '#c4a661',
+ 'warm grey': '#978a84',
+ 'dark indigo': '#1f0954',
+ 'midnight': '#03012d',
+ 'bluey green': '#2bb179',
+ 'grey pink': '#c3909b',
+ 'soft purple': '#a66fb5',
+ 'blood': '#770001',
+ 'brown red': '#922b05',
+ 'medium grey': '#7d7f7c',
+ 'berry': '#990f4b',
+ 'poo': '#8f7303',
+ 'purpley pink': '#c83cb9',
+ 'light salmon': '#fea993',
+ 'snot': '#acbb0d',
+ 'easter purple': '#c071fe',
+ 'light yellow green': '#ccfd7f',
+ 'dark navy blue': '#00022e',
+ 'drab': '#828344',
+ 'light rose': '#ffc5cb',
+ 'rouge': '#ab1239',
+ 'purplish red': '#b0054b',
+ 'slime green': '#99cc04',
+ 'baby poop': '#937c00',
+ 'irish green': '#019529',
+ 'pink/purple': '#ef1de7',
+ 'dark navy': '#000435',
+ 'greeny blue': '#42b395',
+ 'light plum': '#9d5783',
+ 'pinkish grey': '#c8aca9',
+ 'dirty orange': '#c87606',
+ 'rust red': '#aa2704',
+ 'pale lilac': '#e4cbff',
+ 'orangey red': '#fa4224',
+ 'primary blue': '#0804f9',
+ 'kermit green': '#5cb200',
+ 'brownish purple': '#76424e',
+ 'murky green': '#6c7a0e',
+ 'wheat': '#fbdd7e',
+ 'very dark purple': '#2a0134',
+ 'bottle green': '#044a05',
+ 'watermelon': '#fd4659',
+ 'deep sky blue': '#0d75f8',
+ 'fire engine red': '#fe0002',
+ 'yellow ochre': '#cb9d06',
+ 'pumpkin orange': '#fb7d07',
+ 'pale olive': '#b9cc81',
+ 'light lilac': '#edc8ff',
+ 'lightish green': '#61e160',
+ 'carolina blue': '#8ab8fe',
+ 'mulberry': '#920a4e',
+ 'shocking pink': '#fe02a2',
+ 'auburn': '#9a3001',
+ 'bright lime green': '#65fe08',
+ 'celadon': '#befdb7',
+ 'pinkish brown': '#b17261',
+ 'poo brown': '#885f01',
+ 'bright sky blue': '#02ccfe',
+ 'celery': '#c1fd95',
+ 'dirt brown': '#836539',
+ 'strawberry': '#fb2943',
+ 'dark lime': '#84b701',
+ 'copper': '#b66325',
+ 'medium brown': '#7f5112',
+ 'muted green': '#5fa052',
+ "robin's egg": '#6dedfd',
+ 'bright aqua': '#0bf9ea',
+ 'bright lavender': '#c760ff',
+ 'ivory': '#ffffcb',
+ 'very light purple': '#f6cefc',
+ 'light navy': '#155084',
+ 'pink red': '#f5054f',
+ 'olive brown': '#645403',
+ 'poop brown': '#7a5901',
+ 'mustard green': '#a8b504',
+ 'ocean green': '#3d9973',
+ 'very dark blue': '#000133',
+ 'dusty green': '#76a973',
+ 'light navy blue': '#2e5a88',
+ 'minty green': '#0bf77d',
+ 'adobe': '#bd6c48',
+ 'barney': '#ac1db8',
+ 'jade green': '#2baf6a',
+ 'bright light blue': '#26f7fd',
+ 'light lime': '#aefd6c',
+ 'dark khaki': '#9b8f55',
+ 'orange yellow': '#ffad01',
+ 'ocre': '#c69c04',
+ 'maize': '#f4d054',
+ 'faded pink': '#de9dac',
+ 'british racing green': '#05480d',
+ 'sandstone': '#c9ae74',
+ 'mud brown': '#60460f',
+ 'light sea green': '#98f6b0',
+ 'robin egg blue': '#8af1fe',
+ 'aqua marine': '#2ee8bb',
+ 'dark sea green': '#11875d',
+ 'soft pink': '#fdb0c0',
+ 'orangey brown': '#b16002',
+ 'cherry red': '#f7022a',
+ 'burnt yellow': '#d5ab09',
+ 'brownish grey': '#86775f',
+ 'camel': '#c69f59',
+ 'purplish grey': '#7a687f',
+ 'marine': '#042e60',
+ 'greyish pink': '#c88d94',
+ 'pale turquoise': '#a5fbd5',
+ 'pastel yellow': '#fffe71',
+ 'bluey purple': '#6241c7',
+ 'canary yellow': '#fffe40',
+ 'faded red': '#d3494e',
+ 'sepia': '#985e2b',
+ 'coffee': '#a6814c',
+ 'bright magenta': '#ff08e8',
+ 'mocha': '#9d7651',
+ 'ecru': '#feffca',
+ 'purpleish': '#98568d',
+ 'cranberry': '#9e003a',
+ 'darkish green': '#287c37',
+ 'brown orange': '#b96902',
+ 'dusky rose': '#ba6873',
+ 'melon': '#ff7855',
+ 'sickly green': '#94b21c',
+ 'silver': '#c5c9c7',
+ 'purply blue': '#661aee',
+ 'purpleish blue': '#6140ef',
+ 'hospital green': '#9be5aa',
+ 'shit brown': '#7b5804',
+ 'mid blue': '#276ab3',
+ 'amber': '#feb308',
+ 'easter green': '#8cfd7e',
+ 'soft blue': '#6488ea',
+ 'cerulean blue': '#056eee',
+ 'golden brown': '#b27a01',
+ 'bright turquoise': '#0ffef9',
+ 'red pink': '#fa2a55',
+ 'red purple': '#820747',
+ 'greyish brown': '#7a6a4f',
+ 'vermillion': '#f4320c',
+ 'russet': '#a13905',
+ 'steel grey': '#6f828a',
+ 'lighter purple': '#a55af4',
+ 'bright violet': '#ad0afd',
+ 'prussian blue': '#004577',
+ 'slate green': '#658d6d',
+ 'dirty pink': '#ca7b80',
+ 'dark blue green': '#005249',
+ 'pine': '#2b5d34',
+ 'yellowy green': '#bff128',
+ 'dark gold': '#b59410',
+ 'bluish': '#2976bb',
+ 'darkish blue': '#014182',
+ 'dull red': '#bb3f3f',
+ 'pinky red': '#fc2647',
+ 'bronze': '#a87900',
+ 'pale teal': '#82cbb2',
+ 'military green': '#667c3e',
+ 'barbie pink': '#fe46a5',
+ 'bubblegum pink': '#fe83cc',
+ 'pea soup green': '#94a617',
+ 'dark mustard': '#a88905',
+ 'shit': '#7f5f00',
+ 'medium purple': '#9e43a2',
+ 'very dark green': '#062e03',
+ 'dirt': '#8a6e45',
+ 'dusky pink': '#cc7a8b',
+ 'red violet': '#9e0168',
+ 'lemon yellow': '#fdff38',
+ 'pistachio': '#c0fa8b',
+ 'dull yellow': '#eedc5b',
+ 'dark lime green': '#7ebd01',
+ 'denim blue': '#3b5b92',
+ 'teal blue': '#01889f',
+ 'lightish blue': '#3d7afd',
+ 'purpley blue': '#5f34e7',
+ 'light indigo': '#6d5acf',
+ 'swamp green': '#748500',
+ 'brown green': '#706c11',
+ 'dark maroon': '#3c0008',
+ 'hot purple': '#cb00f5',
+ 'dark forest green': '#002d04',
+ 'faded blue': '#658cbb',
+ 'drab green': '#749551',
+ 'light lime green': '#b9ff66',
+ 'snot green': '#9dc100',
+ 'yellowish': '#faee66',
+ 'light blue green': '#7efbb3',
+ 'bordeaux': '#7b002c',
+ 'light mauve': '#c292a1',
+ 'ocean': '#017b92',
+ 'marigold': '#fcc006',
+ 'muddy green': '#657432',
+ 'dull orange': '#d8863b',
+ 'steel': '#738595',
+ 'electric purple': '#aa23ff',
+ 'fluorescent green': '#08ff08',
+ 'yellowish brown': '#9b7a01',
+ 'blush': '#f29e8e',
+ 'soft green': '#6fc276',
+ 'bright orange': '#ff5b00',
+ 'lemon': '#fdff52',
+ 'purple grey': '#866f85',
+ 'acid green': '#8ffe09',
+ 'pale lavender': '#eecffe',
+ 'violet blue': '#510ac9',
+ 'light forest green': '#4f9153',
+ 'burnt red': '#9f2305',
+ 'khaki green': '#728639',
+ 'cerise': '#de0c62',
+ 'faded purple': '#916e99',
+ 'apricot': '#ffb16d',
+ 'dark olive green': '#3c4d03',
+ 'grey brown': '#7f7053',
+ 'green grey': '#77926f',
+ 'true blue': '#010fcc',
+ 'pale violet': '#ceaefa',
+ 'periwinkle blue': '#8f99fb',
+ 'light sky blue': '#c6fcff',
+ 'blurple': '#5539cc',
+ 'green brown': '#544e03',
+ 'bluegreen': '#017a79',
+ 'bright teal': '#01f9c6',
+ 'brownish yellow': '#c9b003',
+ 'pea soup': '#929901',
+ 'forest': '#0b5509',
+ 'barney purple': '#a00498',
+ 'ultramarine': '#2000b1',
+ 'purplish': '#94568c',
+ 'puke yellow': '#c2be0e',
+ 'bluish grey': '#748b97',
+ 'dark periwinkle': '#665fd1',
+ 'dark lilac': '#9c6da5',
+ 'reddish': '#c44240',
+ 'light maroon': '#a24857',
+ 'dusty purple': '#825f87',
+ 'terra cotta': '#c9643b',
+ 'avocado': '#90b134',
+ 'marine blue': '#01386a',
+ 'teal green': '#25a36f',
+ 'slate grey': '#59656d',
+ 'lighter green': '#75fd63',
+ 'electric green': '#21fc0d',
+ 'dusty blue': '#5a86ad',
+ 'golden yellow': '#fec615',
+ 'bright yellow': '#fffd01',
+ 'light lavender': '#dfc5fe',
+ 'umber': '#b26400',
+ 'poop': '#7f5e00',
+ 'dark peach': '#de7e5d',
+ 'jungle green': '#048243',
+ 'eggshell': '#ffffd4',
+ 'denim': '#3b638c',
+ 'yellow brown': '#b79400',
+ 'dull purple': '#84597e',
+ 'chocolate brown': '#411900',
+ 'wine red': '#7b0323',
+ 'neon blue': '#04d9ff',
+ 'dirty green': '#667e2c',
+ 'light tan': '#fbeeac',
+ 'ice blue': '#d7fffe',
+ 'cadet blue': '#4e7496',
+ 'dark mauve': '#874c62',
+ 'very light blue': '#d5ffff',
+ 'grey purple': '#826d8c',
+ 'pastel pink': '#ffbacd',
+ 'very light green': '#d1ffbd',
+ 'dark sky blue': '#448ee4',
+ 'evergreen': '#05472a',
+ 'dull pink': '#d5869d',
+ 'aubergine': '#3d0734',
+ 'mahogany': '#4a0100',
+ 'reddish orange': '#f8481c',
+ 'deep green': '#02590f',
+ 'vomit green': '#89a203',
+ 'purple pink': '#e03fd8',
+ 'dusty pink': '#d58a94',
+ 'faded green': '#7bb274',
+ 'camo green': '#526525',
+ 'pinky purple': '#c94cbe',
+ 'pink purple': '#db4bda',
+ 'brownish red': '#9e3623',
+ 'dark rose': '#b5485d',
+ 'mud': '#735c12',
+ 'brownish': '#9c6d57',
+ 'emerald green': '#028f1e',
+ 'pale brown': '#b1916e',
+ 'dull blue': '#49759c',
+ 'burnt umber': '#a0450e',
+ 'medium green': '#39ad48',
+ 'clay': '#b66a50',
+ 'light aqua': '#8cffdb',
+ 'light olive green': '#a4be5c',
+ 'brownish orange': '#cb7723',
+ 'dark aqua': '#05696b',
+ 'purplish pink': '#ce5dae',
+ 'dark salmon': '#c85a53',
+ 'greenish grey': '#96ae8d',
+ 'jade': '#1fa774',
+ 'ugly green': '#7a9703',
+ 'dark beige': '#ac9362',
+ 'emerald': '#01a049',
+ 'pale red': '#d9544d',
+ 'light magenta': '#fa5ff7',
+ 'sky': '#82cafc',
+ 'light cyan': '#acfffc',
+ 'yellow orange': '#fcb001',
+ 'reddish purple': '#910951',
+ 'reddish pink': '#fe2c54',
+ 'orchid': '#c875c4',
+ 'dirty yellow': '#cdc50a',
+ 'orange red': '#fd411e',
+ 'deep red': '#9a0200',
+ 'orange brown': '#be6400',
+ 'cobalt blue': '#030aa7',
+ 'neon pink': '#fe019a',
+ 'rose pink': '#f7879a',
+ 'greyish purple': '#887191',
+ 'raspberry': '#b00149',
+ 'aqua green': '#12e193',
+ 'salmon pink': '#fe7b7c',
+ 'tangerine': '#ff9408',
+ 'brownish green': '#6a6e09',
+ 'red brown': '#8b2e16',
+ 'greenish brown': '#696112',
+ 'pumpkin': '#e17701',
+ 'pine green': '#0a481e',
+ 'charcoal': '#343837',
+ 'baby pink': '#ffb7ce',
+ 'cornflower': '#6a79f7',
+ 'blue violet': '#5d06e9',
+ 'chocolate': '#3d1c02',
+ 'greyish green': '#82a67d',
+ 'scarlet': '#be0119',
+ 'green yellow': '#c9ff27',
+ 'dark olive': '#373e02',
+ 'sienna': '#a9561e',
+ 'pastel purple': '#caa0ff',
+ 'terracotta': '#ca6641',
+ 'aqua blue': '#02d8e9',
+ 'sage green': '#88b378',
+ 'blood red': '#980002',
+ 'deep pink': '#cb0162',
+ 'grass': '#5cac2d',
+ 'moss': '#769958',
+ 'pastel blue': '#a2bffe',
+ 'bluish green': '#10a674',
+ 'green blue': '#06b48b',
+ 'dark tan': '#af884a',
+ 'greenish blue': '#0b8b87',
+ 'pale orange': '#ffa756',
+ 'vomit': '#a2a415',
+ 'forrest green': '#154406',
+ 'dark lavender': '#856798',
+ 'dark violet': '#34013f',
+ 'purple blue': '#632de9',
+ 'dark cyan': '#0a888a',
+ 'olive drab': '#6f7632',
+ 'pinkish': '#d46a7e',
+ 'cobalt': '#1e488f',
+ 'neon purple': '#bc13fe',
+ 'light turquoise': '#7ef4cc',
+ 'apple green': '#76cd26',
+ 'dull green': '#74a662',
+ 'wine': '#80013f',
+ 'powder blue': '#b1d1fc',
+ 'off white': '#ffffe4',
+ 'electric blue': '#0652ff',
+ 'dark turquoise': '#045c5a',
+ 'blue purple': '#5729ce',
+ 'azure': '#069af3',
+ 'bright red': '#ff000d',
+ 'pinkish red': '#f10c45',
+ 'cornflower blue': '#5170d7',
+ 'light olive': '#acbf69',
+ 'grape': '#6c3461',
+ 'greyish blue': '#5e819d',
+ 'purplish blue': '#601ef9',
+ 'yellowish green': '#b0dd16',
+ 'greenish yellow': '#cdfd02',
+ 'medium blue': '#2c6fbb',
+ 'dusty rose': '#c0737a',
+ 'light violet': '#d6b4fc',
+ 'midnight blue': '#020035',
+ 'bluish purple': '#703be7',
+ 'red orange': '#fd3c06',
+ 'dark magenta': '#960056',
+ 'greenish': '#40a368',
+ 'ocean blue': '#03719c',
+ 'coral': '#fc5a50',
+ 'cream': '#ffffc2',
+ 'reddish brown': '#7f2b0a',
+ 'burnt sienna': '#b04e0f',
+ 'brick': '#a03623',
+ 'sage': '#87ae73',
+ 'grey green': '#789b73',
+ 'white': '#ffffff',
+ "robin's egg blue": '#98eff9',
+ 'moss green': '#658b38',
+ 'steel blue': '#5a7d9a',
+ 'eggplant': '#380835',
+ 'light yellow': '#fffe7a',
+ 'leaf green': '#5ca904',
+ 'light grey': '#d8dcd6',
+ 'puke': '#a5a502',
+ 'pinkish purple': '#d648d7',
+ 'sea blue': '#047495',
+ 'pale purple': '#b790d4',
+ 'slate blue': '#5b7c99',
+ 'blue grey': '#607c8e',
+ 'hunter green': '#0b4008',
+ 'fuchsia': '#ed0dd9',
+ 'crimson': '#8c000f',
+ 'pale yellow': '#ffff84',
+ 'ochre': '#bf9005',
+ 'mustard yellow': '#d2bd0a',
+ 'light red': '#ff474c',
+ 'cerulean': '#0485d1',
+ 'pale pink': '#ffcfdc',
+ 'deep blue': '#040273',
+ 'rust': '#a83c09',
+ 'light teal': '#90e4c1',
+ 'slate': '#516572',
+ 'goldenrod': '#fac205',
+ 'dark yellow': '#d5b60a',
+ 'dark grey': '#363737',
+ 'army green': '#4b5d16',
+ 'grey blue': '#6b8ba4',
+ 'seafoam': '#80f9ad',
+ 'puce': '#a57e52',
+ 'spring green': '#a9f971',
+ 'dark orange': '#c65102',
+ 'sand': '#e2ca76',
+ 'pastel green': '#b0ff9d',
+ 'mint': '#9ffeb0',
+ 'light orange': '#fdaa48',
+ 'bright pink': '#fe01b1',
+ 'chartreuse': '#c1f80a',
+ 'deep purple': '#36013f',
+ 'dark brown': '#341c02',
+ 'taupe': '#b9a281',
+ 'pea green': '#8eab12',
+ 'puke green': '#9aae07',
+ 'kelly green': '#02ab2e',
+ 'seafoam green': '#7af9ab',
+ 'blue green': '#137e6d',
+ 'khaki': '#aaa662',
+ 'burgundy': '#610023',
+ 'dark teal': '#014d4e',
+ 'brick red': '#8f1402',
+ 'royal purple': '#4b006e',
+ 'plum': '#580f41',
+ 'mint green': '#8fff9f',
+ 'gold': '#dbb40c',
+ 'baby blue': '#a2cffe',
+ 'yellow green': '#c0fb2d',
+ 'bright purple': '#be03fd',
+ 'dark red': '#840000',
+ 'pale blue': '#d0fefe',
+ 'grass green': '#3f9b0b',
+ 'navy': '#01153e',
+ 'aquamarine': '#04d8b2',
+ 'burnt orange': '#c04e01',
+ 'neon green': '#0cff0c',
+ 'bright blue': '#0165fc',
+ 'rose': '#cf6275',
+ 'light pink': '#ffd1df',
+ 'mustard': '#ceb301',
+ 'indigo': '#380282',
+ 'lime': '#aaff32',
+ 'sea green': '#53fca1',
+ 'periwinkle': '#8e82fe',
+ 'dark pink': '#cb416b',
+ 'olive green': '#677a04',
+ 'peach': '#ffb07c',
+ 'pale green': '#c7fdb5',
+ 'light brown': '#ad8150',
+ 'hot pink': '#ff028d',
+ 'black': '#000000',
+ 'lilac': '#cea2fd',
+ 'navy blue': '#001146',
+ 'royal blue': '#0504aa',
+ 'beige': '#e6daa6',
+ 'salmon': '#ff796c',
+ 'olive': '#6e750e',
+ 'maroon': '#650021',
+ 'bright green': '#01ff07',
+ 'dark purple': '#35063e',
+ 'mauve': '#ae7181',
+ 'forest green': '#06470c',
+ 'aqua': '#13eac9',
+ 'cyan': '#00ffff',
+ 'tan': '#d1b26f',
+ 'dark blue': '#00035b',
+ 'lavender': '#c79fef',
+ 'turquoise': '#06c2ac',
+ 'dark green': '#033500',
+ 'violet': '#9a0eea',
+ 'light purple': '#bf77f6',
+ 'lime green': '#89fe05',
+ 'grey': '#929591',
+ 'sky blue': '#75bbfd',
+ 'yellow': '#ffff14',
+ 'magenta': '#c20078',
+ 'light green': '#96f97b',
+ 'orange': '#f97306',
+ 'teal': '#029386',
+ 'light blue': '#95d0fc',
+ 'red': '#e50000',
+ 'brown': '#653700',
+ 'pink': '#ff81c0',
+ 'blue': '#0343df',
+ 'green': '#15b01a',
+ 'purple': '#7e1e9c'}
+
+# Normalize name to "xkcd:" to avoid name collisions.
+XKCD_COLORS = {'xkcd:' + name: value for name, value in XKCD_COLORS.items()}
+
+
+# https://drafts.csswg.org/css-color-4/#named-colors
+CSS4_COLORS = {
+ 'aliceblue': '#F0F8FF',
+ 'antiquewhite': '#FAEBD7',
+ 'aqua': '#00FFFF',
+ 'aquamarine': '#7FFFD4',
+ 'azure': '#F0FFFF',
+ 'beige': '#F5F5DC',
+ 'bisque': '#FFE4C4',
+ 'black': '#000000',
+ 'blanchedalmond': '#FFEBCD',
+ 'blue': '#0000FF',
+ 'blueviolet': '#8A2BE2',
+ 'brown': '#A52A2A',
+ 'burlywood': '#DEB887',
+ 'cadetblue': '#5F9EA0',
+ 'chartreuse': '#7FFF00',
+ 'chocolate': '#D2691E',
+ 'coral': '#FF7F50',
+ 'cornflowerblue': '#6495ED',
+ 'cornsilk': '#FFF8DC',
+ 'crimson': '#DC143C',
+ 'cyan': '#00FFFF',
+ 'darkblue': '#00008B',
+ 'darkcyan': '#008B8B',
+ 'darkgoldenrod': '#B8860B',
+ 'darkgray': '#A9A9A9',
+ 'darkgreen': '#006400',
+ 'darkgrey': '#A9A9A9',
+ 'darkkhaki': '#BDB76B',
+ 'darkmagenta': '#8B008B',
+ 'darkolivegreen': '#556B2F',
+ 'darkorange': '#FF8C00',
+ 'darkorchid': '#9932CC',
+ 'darkred': '#8B0000',
+ 'darksalmon': '#E9967A',
+ 'darkseagreen': '#8FBC8F',
+ 'darkslateblue': '#483D8B',
+ 'darkslategray': '#2F4F4F',
+ 'darkslategrey': '#2F4F4F',
+ 'darkturquoise': '#00CED1',
+ 'darkviolet': '#9400D3',
+ 'deeppink': '#FF1493',
+ 'deepskyblue': '#00BFFF',
+ 'dimgray': '#696969',
+ 'dimgrey': '#696969',
+ 'dodgerblue': '#1E90FF',
+ 'firebrick': '#B22222',
+ 'floralwhite': '#FFFAF0',
+ 'forestgreen': '#228B22',
+ 'fuchsia': '#FF00FF',
+ 'gainsboro': '#DCDCDC',
+ 'ghostwhite': '#F8F8FF',
+ 'gold': '#FFD700',
+ 'goldenrod': '#DAA520',
+ 'gray': '#808080',
+ 'green': '#008000',
+ 'greenyellow': '#ADFF2F',
+ 'grey': '#808080',
+ 'honeydew': '#F0FFF0',
+ 'hotpink': '#FF69B4',
+ 'indianred': '#CD5C5C',
+ 'indigo': '#4B0082',
+ 'ivory': '#FFFFF0',
+ 'khaki': '#F0E68C',
+ 'lavender': '#E6E6FA',
+ 'lavenderblush': '#FFF0F5',
+ 'lawngreen': '#7CFC00',
+ 'lemonchiffon': '#FFFACD',
+ 'lightblue': '#ADD8E6',
+ 'lightcoral': '#F08080',
+ 'lightcyan': '#E0FFFF',
+ 'lightgoldenrodyellow': '#FAFAD2',
+ 'lightgray': '#D3D3D3',
+ 'lightgreen': '#90EE90',
+ 'lightgrey': '#D3D3D3',
+ 'lightpink': '#FFB6C1',
+ 'lightsalmon': '#FFA07A',
+ 'lightseagreen': '#20B2AA',
+ 'lightskyblue': '#87CEFA',
+ 'lightslategray': '#778899',
+ 'lightslategrey': '#778899',
+ 'lightsteelblue': '#B0C4DE',
+ 'lightyellow': '#FFFFE0',
+ 'lime': '#00FF00',
+ 'limegreen': '#32CD32',
+ 'linen': '#FAF0E6',
+ 'magenta': '#FF00FF',
+ 'maroon': '#800000',
+ 'mediumaquamarine': '#66CDAA',
+ 'mediumblue': '#0000CD',
+ 'mediumorchid': '#BA55D3',
+ 'mediumpurple': '#9370DB',
+ 'mediumseagreen': '#3CB371',
+ 'mediumslateblue': '#7B68EE',
+ 'mediumspringgreen': '#00FA9A',
+ 'mediumturquoise': '#48D1CC',
+ 'mediumvioletred': '#C71585',
+ 'midnightblue': '#191970',
+ 'mintcream': '#F5FFFA',
+ 'mistyrose': '#FFE4E1',
+ 'moccasin': '#FFE4B5',
+ 'navajowhite': '#FFDEAD',
+ 'navy': '#000080',
+ 'oldlace': '#FDF5E6',
+ 'olive': '#808000',
+ 'olivedrab': '#6B8E23',
+ 'orange': '#FFA500',
+ 'orangered': '#FF4500',
+ 'orchid': '#DA70D6',
+ 'palegoldenrod': '#EEE8AA',
+ 'palegreen': '#98FB98',
+ 'paleturquoise': '#AFEEEE',
+ 'palevioletred': '#DB7093',
+ 'papayawhip': '#FFEFD5',
+ 'peachpuff': '#FFDAB9',
+ 'peru': '#CD853F',
+ 'pink': '#FFC0CB',
+ 'plum': '#DDA0DD',
+ 'powderblue': '#B0E0E6',
+ 'purple': '#800080',
+ 'rebeccapurple': '#663399',
+ 'red': '#FF0000',
+ 'rosybrown': '#BC8F8F',
+ 'royalblue': '#4169E1',
+ 'saddlebrown': '#8B4513',
+ 'salmon': '#FA8072',
+ 'sandybrown': '#F4A460',
+ 'seagreen': '#2E8B57',
+ 'seashell': '#FFF5EE',
+ 'sienna': '#A0522D',
+ 'silver': '#C0C0C0',
+ 'skyblue': '#87CEEB',
+ 'slateblue': '#6A5ACD',
+ 'slategray': '#708090',
+ 'slategrey': '#708090',
+ 'snow': '#FFFAFA',
+ 'springgreen': '#00FF7F',
+ 'steelblue': '#4682B4',
+ 'tan': '#D2B48C',
+ 'teal': '#008080',
+ 'thistle': '#D8BFD8',
+ 'tomato': '#FF6347',
+ 'turquoise': '#40E0D0',
+ 'violet': '#EE82EE',
+ 'wheat': '#F5DEB3',
+ 'white': '#FFFFFF',
+ 'whitesmoke': '#F5F5F5',
+ 'yellow': '#FFFF00',
+ 'yellowgreen': '#9ACD32'}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_color_data.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_color_data.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..feb3de9c3043d55910e2649804352ae96ccbd1ec
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_color_data.pyi
@@ -0,0 +1,6 @@
+from .typing import ColorType
+
+BASE_COLORS: dict[str, ColorType]
+TABLEAU_COLORS: dict[str, ColorType]
+XKCD_COLORS: dict[str, ColorType]
+CSS4_COLORS: dict[str, ColorType]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_constrained_layout.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_constrained_layout.py
new file mode 100644
index 0000000000000000000000000000000000000000..5623e12a3c41d0d0d35041fd1dd9fb23e9938e51
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_constrained_layout.py
@@ -0,0 +1,801 @@
+"""
+Adjust subplot layouts so that there are no overlapping Axes or Axes
+decorations. All Axes decorations are dealt with (labels, ticks, titles,
+ticklabels) and some dependent artists are also dealt with (colorbar,
+suptitle).
+
+Layout is done via `~matplotlib.gridspec`, with one constraint per gridspec,
+so it is possible to have overlapping Axes if the gridspecs overlap (i.e.
+using `~matplotlib.gridspec.GridSpecFromSubplotSpec`). Axes placed using
+``figure.subplots()`` or ``figure.add_subplots()`` will participate in the
+layout. Axes manually placed via ``figure.add_axes()`` will not.
+
+See Tutorial: :ref:`constrainedlayout_guide`
+
+General idea:
+-------------
+
+First, a figure has a gridspec that divides the figure into nrows and ncols,
+with heights and widths set by ``height_ratios`` and ``width_ratios``,
+often just set to 1 for an equal grid.
+
+Subplotspecs that are derived from this gridspec can contain either a
+``SubPanel``, a ``GridSpecFromSubplotSpec``, or an ``Axes``. The ``SubPanel``
+and ``GridSpecFromSubplotSpec`` are dealt with recursively and each contain an
+analogous layout.
+
+Each ``GridSpec`` has a ``_layoutgrid`` attached to it. The ``_layoutgrid``
+has the same logical layout as the ``GridSpec``. Each row of the grid spec
+has a top and bottom "margin" and each column has a left and right "margin".
+The "inner" height of each row is constrained to be the same (or as modified
+by ``height_ratio``), and the "inner" width of each column is
+constrained to be the same (as modified by ``width_ratio``), where "inner"
+is the width or height of each column/row minus the size of the margins.
+
+Then the size of the margins for each row and column are determined as the
+max width of the decorators on each Axes that has decorators in that margin.
+For instance, a normal Axes would have a left margin that includes the
+left ticklabels, and the ylabel if it exists. The right margin may include a
+colorbar, the bottom margin the xaxis decorations, and the top margin the
+title.
+
+With these constraints, the solver then finds appropriate bounds for the
+columns and rows. It's possible that the margins take up the whole figure,
+in which case the algorithm is not applied and a warning is raised.
+
+See the tutorial :ref:`constrainedlayout_guide`
+for more discussion of the algorithm with examples.
+"""
+
+import logging
+
+import numpy as np
+
+from matplotlib import _api, artist as martist
+import matplotlib.transforms as mtransforms
+import matplotlib._layoutgrid as mlayoutgrid
+
+
+_log = logging.getLogger(__name__)
+
+
+######################################################
+def do_constrained_layout(fig, h_pad, w_pad,
+ hspace=None, wspace=None, rect=(0, 0, 1, 1),
+ compress=False):
+ """
+ Do the constrained_layout. Called at draw time in
+ ``figure.constrained_layout()``
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ `.Figure` instance to do the layout in.
+
+ h_pad, w_pad : float
+ Padding around the Axes elements in figure-normalized units.
+
+ hspace, wspace : float
+ Fraction of the figure to dedicate to space between the
+ Axes. These are evenly spread between the gaps between the Axes.
+ A value of 0.2 for a three-column layout would have a space
+ of 0.1 of the figure width between each column.
+ If h/wspace < h/w_pad, then the pads are used instead.
+
+ rect : tuple of 4 floats
+ Rectangle in figure coordinates to perform constrained layout in
+ [left, bottom, width, height], each from 0-1.
+
+ compress : bool
+ Whether to shift Axes so that white space in between them is
+ removed. This is useful for simple grids of fixed-aspect Axes (e.g.
+ a grid of images).
+
+ Returns
+ -------
+ layoutgrid : private debugging structure
+ """
+
+ renderer = fig._get_renderer()
+ # make layoutgrid tree...
+ layoutgrids = make_layoutgrids(fig, None, rect=rect)
+ if not layoutgrids['hasgrids']:
+ _api.warn_external('There are no gridspecs with layoutgrids. '
+ 'Possibly did not call parent GridSpec with the'
+ ' "figure" keyword')
+ return
+
+ for _ in range(2):
+ # do the algorithm twice. This has to be done because decorations
+ # change size after the first re-position (i.e. x/yticklabels get
+ # larger/smaller). This second reposition tends to be much milder,
+ # so doing twice makes things work OK.
+
+ # make margins for all the Axes and subfigures in the
+ # figure. Add margins for colorbars...
+ make_layout_margins(layoutgrids, fig, renderer, h_pad=h_pad,
+ w_pad=w_pad, hspace=hspace, wspace=wspace)
+ make_margin_suptitles(layoutgrids, fig, renderer, h_pad=h_pad,
+ w_pad=w_pad)
+
+ # if a layout is such that a columns (or rows) margin has no
+ # constraints, we need to make all such instances in the grid
+ # match in margin size.
+ match_submerged_margins(layoutgrids, fig)
+
+ # update all the variables in the layout.
+ layoutgrids[fig].update_variables()
+
+ warn_collapsed = ('constrained_layout not applied because '
+ 'axes sizes collapsed to zero. Try making '
+ 'figure larger or Axes decorations smaller.')
+ if check_no_collapsed_axes(layoutgrids, fig):
+ reposition_axes(layoutgrids, fig, renderer, h_pad=h_pad,
+ w_pad=w_pad, hspace=hspace, wspace=wspace)
+ if compress:
+ layoutgrids = compress_fixed_aspect(layoutgrids, fig)
+ layoutgrids[fig].update_variables()
+ if check_no_collapsed_axes(layoutgrids, fig):
+ reposition_axes(layoutgrids, fig, renderer, h_pad=h_pad,
+ w_pad=w_pad, hspace=hspace, wspace=wspace)
+ else:
+ _api.warn_external(warn_collapsed)
+
+ if ((suptitle := fig._suptitle) is not None and
+ suptitle.get_in_layout() and suptitle._autopos):
+ x, _ = suptitle.get_position()
+ suptitle.set_position(
+ (x, layoutgrids[fig].get_inner_bbox().y1 + h_pad))
+ suptitle.set_verticalalignment('bottom')
+ else:
+ _api.warn_external(warn_collapsed)
+ reset_margins(layoutgrids, fig)
+ return layoutgrids
+
+
+def make_layoutgrids(fig, layoutgrids, rect=(0, 0, 1, 1)):
+ """
+ Make the layoutgrid tree.
+
+ (Sub)Figures get a layoutgrid so we can have figure margins.
+
+ Gridspecs that are attached to Axes get a layoutgrid so Axes
+ can have margins.
+ """
+
+ if layoutgrids is None:
+ layoutgrids = dict()
+ layoutgrids['hasgrids'] = False
+ if not hasattr(fig, '_parent'):
+ # top figure; pass rect as parent to allow user-specified
+ # margins
+ layoutgrids[fig] = mlayoutgrid.LayoutGrid(parent=rect, name='figlb')
+ else:
+ # subfigure
+ gs = fig._subplotspec.get_gridspec()
+ # it is possible the gridspec containing this subfigure hasn't
+ # been added to the tree yet:
+ layoutgrids = make_layoutgrids_gs(layoutgrids, gs)
+ # add the layoutgrid for the subfigure:
+ parentlb = layoutgrids[gs]
+ layoutgrids[fig] = mlayoutgrid.LayoutGrid(
+ parent=parentlb,
+ name='panellb',
+ parent_inner=True,
+ nrows=1, ncols=1,
+ parent_pos=(fig._subplotspec.rowspan,
+ fig._subplotspec.colspan))
+ # recursively do all subfigures in this figure...
+ for sfig in fig.subfigs:
+ layoutgrids = make_layoutgrids(sfig, layoutgrids)
+
+ # for each Axes at the local level add its gridspec:
+ for ax in fig._localaxes:
+ gs = ax.get_gridspec()
+ if gs is not None:
+ layoutgrids = make_layoutgrids_gs(layoutgrids, gs)
+
+ return layoutgrids
+
+
+def make_layoutgrids_gs(layoutgrids, gs):
+ """
+ Make the layoutgrid for a gridspec (and anything nested in the gridspec)
+ """
+
+ if gs in layoutgrids or gs.figure is None:
+ return layoutgrids
+ # in order to do constrained_layout there has to be at least *one*
+ # gridspec in the tree:
+ layoutgrids['hasgrids'] = True
+ if not hasattr(gs, '_subplot_spec'):
+ # normal gridspec
+ parent = layoutgrids[gs.figure]
+ layoutgrids[gs] = mlayoutgrid.LayoutGrid(
+ parent=parent,
+ parent_inner=True,
+ name='gridspec',
+ ncols=gs._ncols, nrows=gs._nrows,
+ width_ratios=gs.get_width_ratios(),
+ height_ratios=gs.get_height_ratios())
+ else:
+ # this is a gridspecfromsubplotspec:
+ subplot_spec = gs._subplot_spec
+ parentgs = subplot_spec.get_gridspec()
+ # if a nested gridspec it is possible the parent is not in there yet:
+ if parentgs not in layoutgrids:
+ layoutgrids = make_layoutgrids_gs(layoutgrids, parentgs)
+ subspeclb = layoutgrids[parentgs]
+ # gridspecfromsubplotspec need an outer container:
+ # get a unique representation:
+ rep = (gs, 'top')
+ if rep not in layoutgrids:
+ layoutgrids[rep] = mlayoutgrid.LayoutGrid(
+ parent=subspeclb,
+ name='top',
+ nrows=1, ncols=1,
+ parent_pos=(subplot_spec.rowspan, subplot_spec.colspan))
+ layoutgrids[gs] = mlayoutgrid.LayoutGrid(
+ parent=layoutgrids[rep],
+ name='gridspec',
+ nrows=gs._nrows, ncols=gs._ncols,
+ width_ratios=gs.get_width_ratios(),
+ height_ratios=gs.get_height_ratios())
+ return layoutgrids
+
+
+def check_no_collapsed_axes(layoutgrids, fig):
+ """
+ Check that no Axes have collapsed to zero size.
+ """
+ for sfig in fig.subfigs:
+ ok = check_no_collapsed_axes(layoutgrids, sfig)
+ if not ok:
+ return False
+ for ax in fig.axes:
+ gs = ax.get_gridspec()
+ if gs in layoutgrids: # also implies gs is not None.
+ lg = layoutgrids[gs]
+ for i in range(gs.nrows):
+ for j in range(gs.ncols):
+ bb = lg.get_inner_bbox(i, j)
+ if bb.width <= 0 or bb.height <= 0:
+ return False
+ return True
+
+
+def compress_fixed_aspect(layoutgrids, fig):
+ gs = None
+ for ax in fig.axes:
+ if ax.get_subplotspec() is None:
+ continue
+ ax.apply_aspect()
+ sub = ax.get_subplotspec()
+ _gs = sub.get_gridspec()
+ if gs is None:
+ gs = _gs
+ extraw = np.zeros(gs.ncols)
+ extrah = np.zeros(gs.nrows)
+ elif _gs != gs:
+ raise ValueError('Cannot do compressed layout if Axes are not'
+ 'all from the same gridspec')
+ orig = ax.get_position(original=True)
+ actual = ax.get_position(original=False)
+ dw = orig.width - actual.width
+ if dw > 0:
+ extraw[sub.colspan] = np.maximum(extraw[sub.colspan], dw)
+ dh = orig.height - actual.height
+ if dh > 0:
+ extrah[sub.rowspan] = np.maximum(extrah[sub.rowspan], dh)
+
+ if gs is None:
+ raise ValueError('Cannot do compressed layout if no Axes '
+ 'are part of a gridspec.')
+ w = np.sum(extraw) / 2
+ layoutgrids[fig].edit_margin_min('left', w)
+ layoutgrids[fig].edit_margin_min('right', w)
+
+ h = np.sum(extrah) / 2
+ layoutgrids[fig].edit_margin_min('top', h)
+ layoutgrids[fig].edit_margin_min('bottom', h)
+ return layoutgrids
+
+
+def get_margin_from_padding(obj, *, w_pad=0, h_pad=0,
+ hspace=0, wspace=0):
+
+ ss = obj._subplotspec
+ gs = ss.get_gridspec()
+
+ if hasattr(gs, 'hspace'):
+ _hspace = (gs.hspace if gs.hspace is not None else hspace)
+ _wspace = (gs.wspace if gs.wspace is not None else wspace)
+ else:
+ _hspace = (gs._hspace if gs._hspace is not None else hspace)
+ _wspace = (gs._wspace if gs._wspace is not None else wspace)
+
+ _wspace = _wspace / 2
+ _hspace = _hspace / 2
+
+ nrows, ncols = gs.get_geometry()
+ # there are two margins for each direction. The "cb"
+ # margins are for pads and colorbars, the non-"cb" are
+ # for the Axes decorations (labels etc).
+ margin = {'leftcb': w_pad, 'rightcb': w_pad,
+ 'bottomcb': h_pad, 'topcb': h_pad,
+ 'left': 0, 'right': 0,
+ 'top': 0, 'bottom': 0}
+ if _wspace / ncols > w_pad:
+ if ss.colspan.start > 0:
+ margin['leftcb'] = _wspace / ncols
+ if ss.colspan.stop < ncols:
+ margin['rightcb'] = _wspace / ncols
+ if _hspace / nrows > h_pad:
+ if ss.rowspan.stop < nrows:
+ margin['bottomcb'] = _hspace / nrows
+ if ss.rowspan.start > 0:
+ margin['topcb'] = _hspace / nrows
+
+ return margin
+
+
+def make_layout_margins(layoutgrids, fig, renderer, *, w_pad=0, h_pad=0,
+ hspace=0, wspace=0):
+ """
+ For each Axes, make a margin between the *pos* layoutbox and the
+ *axes* layoutbox be a minimum size that can accommodate the
+ decorations on the axis.
+
+ Then make room for colorbars.
+
+ Parameters
+ ----------
+ layoutgrids : dict
+ fig : `~matplotlib.figure.Figure`
+ `.Figure` instance to do the layout in.
+ renderer : `~matplotlib.backend_bases.RendererBase` subclass.
+ The renderer to use.
+ w_pad, h_pad : float, default: 0
+ Width and height padding (in fraction of figure).
+ hspace, wspace : float, default: 0
+ Width and height padding as fraction of figure size divided by
+ number of columns or rows.
+ """
+ for sfig in fig.subfigs: # recursively make child panel margins
+ ss = sfig._subplotspec
+ gs = ss.get_gridspec()
+
+ make_layout_margins(layoutgrids, sfig, renderer,
+ w_pad=w_pad, h_pad=h_pad,
+ hspace=hspace, wspace=wspace)
+
+ margins = get_margin_from_padding(sfig, w_pad=0, h_pad=0,
+ hspace=hspace, wspace=wspace)
+ layoutgrids[gs].edit_outer_margin_mins(margins, ss)
+
+ for ax in fig._localaxes:
+ if not ax.get_subplotspec() or not ax.get_in_layout():
+ continue
+
+ ss = ax.get_subplotspec()
+ gs = ss.get_gridspec()
+
+ if gs not in layoutgrids:
+ return
+
+ margin = get_margin_from_padding(ax, w_pad=w_pad, h_pad=h_pad,
+ hspace=hspace, wspace=wspace)
+ pos, bbox = get_pos_and_bbox(ax, renderer)
+ # the margin is the distance between the bounding box of the Axes
+ # and its position (plus the padding from above)
+ margin['left'] += pos.x0 - bbox.x0
+ margin['right'] += bbox.x1 - pos.x1
+ # remember that rows are ordered from top:
+ margin['bottom'] += pos.y0 - bbox.y0
+ margin['top'] += bbox.y1 - pos.y1
+
+ # make margin for colorbars. These margins go in the
+ # padding margin, versus the margin for Axes decorators.
+ for cbax in ax._colorbars:
+ # note pad is a fraction of the parent width...
+ pad = colorbar_get_pad(layoutgrids, cbax)
+ # colorbars can be child of more than one subplot spec:
+ cbp_rspan, cbp_cspan = get_cb_parent_spans(cbax)
+ loc = cbax._colorbar_info['location']
+ cbpos, cbbbox = get_pos_and_bbox(cbax, renderer)
+ if loc == 'right':
+ if cbp_cspan.stop == ss.colspan.stop:
+ # only increase if the colorbar is on the right edge
+ margin['rightcb'] += cbbbox.width + pad
+ elif loc == 'left':
+ if cbp_cspan.start == ss.colspan.start:
+ # only increase if the colorbar is on the left edge
+ margin['leftcb'] += cbbbox.width + pad
+ elif loc == 'top':
+ if cbp_rspan.start == ss.rowspan.start:
+ margin['topcb'] += cbbbox.height + pad
+ else:
+ if cbp_rspan.stop == ss.rowspan.stop:
+ margin['bottomcb'] += cbbbox.height + pad
+ # If the colorbars are wider than the parent box in the
+ # cross direction
+ if loc in ['top', 'bottom']:
+ if (cbp_cspan.start == ss.colspan.start and
+ cbbbox.x0 < bbox.x0):
+ margin['left'] += bbox.x0 - cbbbox.x0
+ if (cbp_cspan.stop == ss.colspan.stop and
+ cbbbox.x1 > bbox.x1):
+ margin['right'] += cbbbox.x1 - bbox.x1
+ # or taller:
+ if loc in ['left', 'right']:
+ if (cbp_rspan.stop == ss.rowspan.stop and
+ cbbbox.y0 < bbox.y0):
+ margin['bottom'] += bbox.y0 - cbbbox.y0
+ if (cbp_rspan.start == ss.rowspan.start and
+ cbbbox.y1 > bbox.y1):
+ margin['top'] += cbbbox.y1 - bbox.y1
+ # pass the new margins down to the layout grid for the solution...
+ layoutgrids[gs].edit_outer_margin_mins(margin, ss)
+
+ # make margins for figure-level legends:
+ for leg in fig.legends:
+ inv_trans_fig = None
+ if leg._outside_loc and leg._bbox_to_anchor is None:
+ if inv_trans_fig is None:
+ inv_trans_fig = fig.transFigure.inverted().transform_bbox
+ bbox = inv_trans_fig(leg.get_tightbbox(renderer))
+ w = bbox.width + 2 * w_pad
+ h = bbox.height + 2 * h_pad
+ legendloc = leg._outside_loc
+ if legendloc == 'lower':
+ layoutgrids[fig].edit_margin_min('bottom', h)
+ elif legendloc == 'upper':
+ layoutgrids[fig].edit_margin_min('top', h)
+ if legendloc == 'right':
+ layoutgrids[fig].edit_margin_min('right', w)
+ elif legendloc == 'left':
+ layoutgrids[fig].edit_margin_min('left', w)
+
+
+def make_margin_suptitles(layoutgrids, fig, renderer, *, w_pad=0, h_pad=0):
+ # Figure out how large the suptitle is and make the
+ # top level figure margin larger.
+
+ inv_trans_fig = fig.transFigure.inverted().transform_bbox
+ # get the h_pad and w_pad as distances in the local subfigure coordinates:
+ padbox = mtransforms.Bbox([[0, 0], [w_pad, h_pad]])
+ padbox = (fig.transFigure -
+ fig.transSubfigure).transform_bbox(padbox)
+ h_pad_local = padbox.height
+ w_pad_local = padbox.width
+
+ for sfig in fig.subfigs:
+ make_margin_suptitles(layoutgrids, sfig, renderer,
+ w_pad=w_pad, h_pad=h_pad)
+
+ if fig._suptitle is not None and fig._suptitle.get_in_layout():
+ p = fig._suptitle.get_position()
+ if getattr(fig._suptitle, '_autopos', False):
+ fig._suptitle.set_position((p[0], 1 - h_pad_local))
+ bbox = inv_trans_fig(fig._suptitle.get_tightbbox(renderer))
+ layoutgrids[fig].edit_margin_min('top', bbox.height + 2 * h_pad)
+
+ if fig._supxlabel is not None and fig._supxlabel.get_in_layout():
+ p = fig._supxlabel.get_position()
+ if getattr(fig._supxlabel, '_autopos', False):
+ fig._supxlabel.set_position((p[0], h_pad_local))
+ bbox = inv_trans_fig(fig._supxlabel.get_tightbbox(renderer))
+ layoutgrids[fig].edit_margin_min('bottom',
+ bbox.height + 2 * h_pad)
+
+ if fig._supylabel is not None and fig._supylabel.get_in_layout():
+ p = fig._supylabel.get_position()
+ if getattr(fig._supylabel, '_autopos', False):
+ fig._supylabel.set_position((w_pad_local, p[1]))
+ bbox = inv_trans_fig(fig._supylabel.get_tightbbox(renderer))
+ layoutgrids[fig].edit_margin_min('left', bbox.width + 2 * w_pad)
+
+
+def match_submerged_margins(layoutgrids, fig):
+ """
+ Make the margins that are submerged inside an Axes the same size.
+
+ This allows Axes that span two columns (or rows) that are offset
+ from one another to have the same size.
+
+ This gives the proper layout for something like::
+ fig = plt.figure(constrained_layout=True)
+ axs = fig.subplot_mosaic("AAAB\nCCDD")
+
+ Without this routine, the Axes D will be wider than C, because the
+ margin width between the two columns in C has no width by default,
+ whereas the margins between the two columns of D are set by the
+ width of the margin between A and B. However, obviously the user would
+ like C and D to be the same size, so we need to add constraints to these
+ "submerged" margins.
+
+ This routine makes all the interior margins the same, and the spacing
+ between the three columns in A and the two column in C are all set to the
+ margins between the two columns of D.
+
+ See test_constrained_layout::test_constrained_layout12 for an example.
+ """
+
+ for sfig in fig.subfigs:
+ match_submerged_margins(layoutgrids, sfig)
+
+ axs = [a for a in fig.get_axes()
+ if a.get_subplotspec() is not None and a.get_in_layout()]
+
+ for ax1 in axs:
+ ss1 = ax1.get_subplotspec()
+ if ss1.get_gridspec() not in layoutgrids:
+ axs.remove(ax1)
+ continue
+ lg1 = layoutgrids[ss1.get_gridspec()]
+
+ # interior columns:
+ if len(ss1.colspan) > 1:
+ maxsubl = np.max(
+ lg1.margin_vals['left'][ss1.colspan[1:]] +
+ lg1.margin_vals['leftcb'][ss1.colspan[1:]]
+ )
+ maxsubr = np.max(
+ lg1.margin_vals['right'][ss1.colspan[:-1]] +
+ lg1.margin_vals['rightcb'][ss1.colspan[:-1]]
+ )
+ for ax2 in axs:
+ ss2 = ax2.get_subplotspec()
+ lg2 = layoutgrids[ss2.get_gridspec()]
+ if lg2 is not None and len(ss2.colspan) > 1:
+ maxsubl2 = np.max(
+ lg2.margin_vals['left'][ss2.colspan[1:]] +
+ lg2.margin_vals['leftcb'][ss2.colspan[1:]])
+ if maxsubl2 > maxsubl:
+ maxsubl = maxsubl2
+ maxsubr2 = np.max(
+ lg2.margin_vals['right'][ss2.colspan[:-1]] +
+ lg2.margin_vals['rightcb'][ss2.colspan[:-1]])
+ if maxsubr2 > maxsubr:
+ maxsubr = maxsubr2
+ for i in ss1.colspan[1:]:
+ lg1.edit_margin_min('left', maxsubl, cell=i)
+ for i in ss1.colspan[:-1]:
+ lg1.edit_margin_min('right', maxsubr, cell=i)
+
+ # interior rows:
+ if len(ss1.rowspan) > 1:
+ maxsubt = np.max(
+ lg1.margin_vals['top'][ss1.rowspan[1:]] +
+ lg1.margin_vals['topcb'][ss1.rowspan[1:]]
+ )
+ maxsubb = np.max(
+ lg1.margin_vals['bottom'][ss1.rowspan[:-1]] +
+ lg1.margin_vals['bottomcb'][ss1.rowspan[:-1]]
+ )
+
+ for ax2 in axs:
+ ss2 = ax2.get_subplotspec()
+ lg2 = layoutgrids[ss2.get_gridspec()]
+ if lg2 is not None:
+ if len(ss2.rowspan) > 1:
+ maxsubt = np.max([np.max(
+ lg2.margin_vals['top'][ss2.rowspan[1:]] +
+ lg2.margin_vals['topcb'][ss2.rowspan[1:]]
+ ), maxsubt])
+ maxsubb = np.max([np.max(
+ lg2.margin_vals['bottom'][ss2.rowspan[:-1]] +
+ lg2.margin_vals['bottomcb'][ss2.rowspan[:-1]]
+ ), maxsubb])
+ for i in ss1.rowspan[1:]:
+ lg1.edit_margin_min('top', maxsubt, cell=i)
+ for i in ss1.rowspan[:-1]:
+ lg1.edit_margin_min('bottom', maxsubb, cell=i)
+
+
+def get_cb_parent_spans(cbax):
+ """
+ Figure out which subplotspecs this colorbar belongs to.
+
+ Parameters
+ ----------
+ cbax : `~matplotlib.axes.Axes`
+ Axes for the colorbar.
+ """
+ rowstart = np.inf
+ rowstop = -np.inf
+ colstart = np.inf
+ colstop = -np.inf
+ for parent in cbax._colorbar_info['parents']:
+ ss = parent.get_subplotspec()
+ rowstart = min(ss.rowspan.start, rowstart)
+ rowstop = max(ss.rowspan.stop, rowstop)
+ colstart = min(ss.colspan.start, colstart)
+ colstop = max(ss.colspan.stop, colstop)
+
+ rowspan = range(rowstart, rowstop)
+ colspan = range(colstart, colstop)
+ return rowspan, colspan
+
+
+def get_pos_and_bbox(ax, renderer):
+ """
+ Get the position and the bbox for the Axes.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ renderer : `~matplotlib.backend_bases.RendererBase` subclass.
+
+ Returns
+ -------
+ pos : `~matplotlib.transforms.Bbox`
+ Position in figure coordinates.
+ bbox : `~matplotlib.transforms.Bbox`
+ Tight bounding box in figure coordinates.
+ """
+ fig = ax.get_figure(root=False)
+ pos = ax.get_position(original=True)
+ # pos is in panel co-ords, but we need in figure for the layout
+ pos = pos.transformed(fig.transSubfigure - fig.transFigure)
+ tightbbox = martist._get_tightbbox_for_layout_only(ax, renderer)
+ if tightbbox is None:
+ bbox = pos
+ else:
+ bbox = tightbbox.transformed(fig.transFigure.inverted())
+ return pos, bbox
+
+
+def reposition_axes(layoutgrids, fig, renderer, *,
+ w_pad=0, h_pad=0, hspace=0, wspace=0):
+ """
+ Reposition all the Axes based on the new inner bounding box.
+ """
+ trans_fig_to_subfig = fig.transFigure - fig.transSubfigure
+ for sfig in fig.subfigs:
+ bbox = layoutgrids[sfig].get_outer_bbox()
+ sfig._redo_transform_rel_fig(
+ bbox=bbox.transformed(trans_fig_to_subfig))
+ reposition_axes(layoutgrids, sfig, renderer,
+ w_pad=w_pad, h_pad=h_pad,
+ wspace=wspace, hspace=hspace)
+
+ for ax in fig._localaxes:
+ if ax.get_subplotspec() is None or not ax.get_in_layout():
+ continue
+
+ # grid bbox is in Figure coordinates, but we specify in panel
+ # coordinates...
+ ss = ax.get_subplotspec()
+ gs = ss.get_gridspec()
+ if gs not in layoutgrids:
+ return
+
+ bbox = layoutgrids[gs].get_inner_bbox(rows=ss.rowspan,
+ cols=ss.colspan)
+
+ # transform from figure to panel for set_position:
+ newbbox = trans_fig_to_subfig.transform_bbox(bbox)
+ ax._set_position(newbbox)
+
+ # move the colorbars:
+ # we need to keep track of oldw and oldh if there is more than
+ # one colorbar:
+ offset = {'left': 0, 'right': 0, 'bottom': 0, 'top': 0}
+ for nn, cbax in enumerate(ax._colorbars[::-1]):
+ if ax == cbax._colorbar_info['parents'][0]:
+ reposition_colorbar(layoutgrids, cbax, renderer,
+ offset=offset)
+
+
+def reposition_colorbar(layoutgrids, cbax, renderer, *, offset=None):
+ """
+ Place the colorbar in its new place.
+
+ Parameters
+ ----------
+ layoutgrids : dict
+ cbax : `~matplotlib.axes.Axes`
+ Axes for the colorbar.
+ renderer : `~matplotlib.backend_bases.RendererBase` subclass.
+ The renderer to use.
+ offset : array-like
+ Offset the colorbar needs to be pushed to in order to
+ account for multiple colorbars.
+ """
+
+ parents = cbax._colorbar_info['parents']
+ gs = parents[0].get_gridspec()
+ fig = cbax.get_figure(root=False)
+ trans_fig_to_subfig = fig.transFigure - fig.transSubfigure
+
+ cb_rspans, cb_cspans = get_cb_parent_spans(cbax)
+ bboxparent = layoutgrids[gs].get_bbox_for_cb(rows=cb_rspans,
+ cols=cb_cspans)
+ pb = layoutgrids[gs].get_inner_bbox(rows=cb_rspans, cols=cb_cspans)
+
+ location = cbax._colorbar_info['location']
+ anchor = cbax._colorbar_info['anchor']
+ fraction = cbax._colorbar_info['fraction']
+ aspect = cbax._colorbar_info['aspect']
+ shrink = cbax._colorbar_info['shrink']
+
+ cbpos, cbbbox = get_pos_and_bbox(cbax, renderer)
+
+ # Colorbar gets put at extreme edge of outer bbox of the subplotspec
+ # It needs to be moved in by: 1) a pad 2) its "margin" 3) by
+ # any colorbars already added at this location:
+ cbpad = colorbar_get_pad(layoutgrids, cbax)
+ if location in ('left', 'right'):
+ # fraction and shrink are fractions of parent
+ pbcb = pb.shrunk(fraction, shrink).anchored(anchor, pb)
+ # The colorbar is at the left side of the parent. Need
+ # to translate to right (or left)
+ if location == 'right':
+ lmargin = cbpos.x0 - cbbbox.x0
+ dx = bboxparent.x1 - pbcb.x0 + offset['right']
+ dx += cbpad + lmargin
+ offset['right'] += cbbbox.width + cbpad
+ pbcb = pbcb.translated(dx, 0)
+ else:
+ lmargin = cbpos.x0 - cbbbox.x0
+ dx = bboxparent.x0 - pbcb.x0 # edge of parent
+ dx += -cbbbox.width - cbpad + lmargin - offset['left']
+ offset['left'] += cbbbox.width + cbpad
+ pbcb = pbcb.translated(dx, 0)
+ else: # horizontal axes:
+ pbcb = pb.shrunk(shrink, fraction).anchored(anchor, pb)
+ if location == 'top':
+ bmargin = cbpos.y0 - cbbbox.y0
+ dy = bboxparent.y1 - pbcb.y0 + offset['top']
+ dy += cbpad + bmargin
+ offset['top'] += cbbbox.height + cbpad
+ pbcb = pbcb.translated(0, dy)
+ else:
+ bmargin = cbpos.y0 - cbbbox.y0
+ dy = bboxparent.y0 - pbcb.y0
+ dy += -cbbbox.height - cbpad + bmargin - offset['bottom']
+ offset['bottom'] += cbbbox.height + cbpad
+ pbcb = pbcb.translated(0, dy)
+
+ pbcb = trans_fig_to_subfig.transform_bbox(pbcb)
+ cbax.set_transform(fig.transSubfigure)
+ cbax._set_position(pbcb)
+ cbax.set_anchor(anchor)
+ if location in ['bottom', 'top']:
+ aspect = 1 / aspect
+ cbax.set_box_aspect(aspect)
+ cbax.set_aspect('auto')
+ return offset
+
+
+def reset_margins(layoutgrids, fig):
+ """
+ Reset the margins in the layoutboxes of *fig*.
+
+ Margins are usually set as a minimum, so if the figure gets smaller
+ the minimum needs to be zero in order for it to grow again.
+ """
+ for sfig in fig.subfigs:
+ reset_margins(layoutgrids, sfig)
+ for ax in fig.axes:
+ if ax.get_in_layout():
+ gs = ax.get_gridspec()
+ if gs in layoutgrids: # also implies gs is not None.
+ layoutgrids[gs].reset_margins()
+ layoutgrids[fig].reset_margins()
+
+
+def colorbar_get_pad(layoutgrids, cax):
+ parents = cax._colorbar_info['parents']
+ gs = parents[0].get_gridspec()
+
+ cb_rspans, cb_cspans = get_cb_parent_spans(cax)
+ bboxouter = layoutgrids[gs].get_inner_bbox(rows=cb_rspans, cols=cb_cspans)
+
+ if cax._colorbar_info['location'] in ['right', 'left']:
+ size = bboxouter.width
+ else:
+ size = bboxouter.height
+
+ return cax._colorbar_info['pad'] * size
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_docstring.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_docstring.py
new file mode 100644
index 0000000000000000000000000000000000000000..8cc7d623efe5c3bb3421e78bccf63b75ee76614d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_docstring.py
@@ -0,0 +1,141 @@
+import inspect
+
+from . import _api
+
+
+def kwarg_doc(text):
+ """
+ Decorator for defining the kwdoc documentation of artist properties.
+
+ This decorator can be applied to artist property setter methods.
+ The given text is stored in a private attribute ``_kwarg_doc`` on
+ the method. It is used to overwrite auto-generated documentation
+ in the *kwdoc list* for artists. The kwdoc list is used to document
+ ``**kwargs`` when they are properties of an artist. See e.g. the
+ ``**kwargs`` section in `.Axes.text`.
+
+ The text should contain the supported types, as well as the default
+ value if applicable, e.g.:
+
+ @_docstring.kwarg_doc("bool, default: :rc:`text.usetex`")
+ def set_usetex(self, usetex):
+
+ See Also
+ --------
+ matplotlib.artist.kwdoc
+
+ """
+ def decorator(func):
+ func._kwarg_doc = text
+ return func
+ return decorator
+
+
+class Substitution:
+ """
+ A decorator that performs %-substitution on an object's docstring.
+
+ This decorator should be robust even if ``obj.__doc__`` is None (for
+ example, if -OO was passed to the interpreter).
+
+ Usage: construct a docstring.Substitution with a sequence or dictionary
+ suitable for performing substitution; then decorate a suitable function
+ with the constructed object, e.g.::
+
+ sub_author_name = Substitution(author='Jason')
+
+ @sub_author_name
+ def some_function(x):
+ "%(author)s wrote this function"
+
+ # note that some_function.__doc__ is now "Jason wrote this function"
+
+ One can also use positional arguments::
+
+ sub_first_last_names = Substitution('Edgar Allen', 'Poe')
+
+ @sub_first_last_names
+ def some_function(x):
+ "%s %s wrote the Raven"
+ """
+ def __init__(self, *args, **kwargs):
+ if args and kwargs:
+ raise TypeError("Only positional or keyword args are allowed")
+ self.params = args or kwargs
+
+ def __call__(self, func):
+ if func.__doc__:
+ func.__doc__ = inspect.cleandoc(func.__doc__) % self.params
+ return func
+
+
+class _ArtistKwdocLoader(dict):
+ def __missing__(self, key):
+ if not key.endswith(":kwdoc"):
+ raise KeyError(key)
+ name = key[:-len(":kwdoc")]
+ from matplotlib.artist import Artist, kwdoc
+ try:
+ cls, = (cls for cls in _api.recursive_subclasses(Artist)
+ if cls.__name__ == name)
+ except ValueError as e:
+ raise KeyError(key) from e
+ return self.setdefault(key, kwdoc(cls))
+
+
+class _ArtistPropertiesSubstitution:
+ """
+ A class to substitute formatted placeholders in docstrings.
+
+ This is realized in a single instance ``_docstring.interpd``.
+
+ Use `~._ArtistPropertiesSubstition.register` to define placeholders and
+ their substitution, e.g. ``_docstring.interpd.register(name="some value")``.
+
+ Use this as a decorator to apply the substitution::
+
+ @_docstring.interpd
+ def some_func():
+ '''Replace %(name)s.'''
+
+ Decorating a class triggers substitution both on the class docstring and
+ on the class' ``__init__`` docstring (which is a commonly required
+ pattern for Artist subclasses).
+
+ Substitutions of the form ``%(classname:kwdoc)s`` (ending with the
+ literal ":kwdoc" suffix) trigger lookup of an Artist subclass with the
+ given *classname*, and are substituted with the `.kwdoc` of that class.
+ """
+
+ def __init__(self):
+ self.params = _ArtistKwdocLoader()
+
+ def register(self, **kwargs):
+ """
+ Register substitutions.
+
+ ``_docstring.interpd.register(name="some value")`` makes "name" available
+ as a named parameter that will be replaced by "some value".
+ """
+ self.params.update(**kwargs)
+
+ def __call__(self, obj):
+ if obj.__doc__:
+ obj.__doc__ = inspect.cleandoc(obj.__doc__) % self.params
+ if isinstance(obj, type) and obj.__init__ != object.__init__:
+ self(obj.__init__)
+ return obj
+
+
+def copy(source):
+ """Copy a docstring from another source function (if present)."""
+ def do_copy(target):
+ if source.__doc__:
+ target.__doc__ = source.__doc__
+ return target
+ return do_copy
+
+
+# Create a decorator that will house the various docstring snippets reused
+# throughout Matplotlib.
+interpd = _ArtistPropertiesSubstitution()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_docstring.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_docstring.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..fb52d084612399f399e6bcd3f07bca85bb010ba0
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_docstring.pyi
@@ -0,0 +1,34 @@
+from collections.abc import Callable
+from typing import Any, TypeVar, overload
+
+
+_T = TypeVar('_T')
+
+
+def kwarg_doc(text: str) -> Callable[[_T], _T]: ...
+
+
+class Substitution:
+ @overload
+ def __init__(self, *args: str): ...
+ @overload
+ def __init__(self, **kwargs: str): ...
+ def __call__(self, func: _T) -> _T: ...
+ def update(self, *args, **kwargs): ... # type: ignore[no-untyped-def]
+
+
+class _ArtistKwdocLoader(dict[str, str]):
+ def __missing__(self, key: str) -> str: ...
+
+
+class _ArtistPropertiesSubstitution:
+ def __init__(self) -> None: ...
+ def register(self, **kwargs) -> None: ...
+ def __call__(self, obj: _T) -> _T: ...
+
+
+def copy(source: Any) -> Callable[[_T], _T]: ...
+
+
+dedent_interpd: _ArtistPropertiesSubstitution
+interpd: _ArtistPropertiesSubstitution
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_enums.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_enums.py
new file mode 100644
index 0000000000000000000000000000000000000000..75a09b7b5d8c7f9097e965d76fbae7bab2b41a01
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_enums.py
@@ -0,0 +1,177 @@
+"""
+Enums representing sets of strings that Matplotlib uses as input parameters.
+
+Matplotlib often uses simple data types like strings or tuples to define a
+concept; e.g. the line capstyle can be specified as one of 'butt', 'round',
+or 'projecting'. The classes in this module are used internally and serve to
+document these concepts formally.
+
+As an end-user you will not use these classes directly, but only the values
+they define.
+"""
+
+from enum import Enum
+from matplotlib import _docstring
+
+
+class JoinStyle(str, Enum):
+ """
+ Define how the connection between two line segments is drawn.
+
+ For a visual impression of each *JoinStyle*, `view these docs online
+ `, or run `JoinStyle.demo`.
+
+ Lines in Matplotlib are typically defined by a 1D `~.path.Path` and a
+ finite ``linewidth``, where the underlying 1D `~.path.Path` represents the
+ center of the stroked line.
+
+ By default, `~.backend_bases.GraphicsContextBase` defines the boundaries of
+ a stroked line to simply be every point within some radius,
+ ``linewidth/2``, away from any point of the center line. However, this
+ results in corners appearing "rounded", which may not be the desired
+ behavior if you are drawing, for example, a polygon or pointed star.
+
+ **Supported values:**
+
+ .. rst-class:: value-list
+
+ 'miter'
+ the "arrow-tip" style. Each boundary of the filled-in area will
+ extend in a straight line parallel to the tangent vector of the
+ centerline at the point it meets the corner, until they meet in a
+ sharp point.
+ 'round'
+ stokes every point within a radius of ``linewidth/2`` of the center
+ lines.
+ 'bevel'
+ the "squared-off" style. It can be thought of as a rounded corner
+ where the "circular" part of the corner has been cut off.
+
+ .. note::
+
+ Very long miter tips are cut off (to form a *bevel*) after a
+ backend-dependent limit called the "miter limit", which specifies the
+ maximum allowed ratio of miter length to line width. For example, the
+ PDF backend uses the default value of 10 specified by the PDF standard,
+ while the SVG backend does not even specify the miter limit, resulting
+ in a default value of 4 per the SVG specification. Matplotlib does not
+ currently allow the user to adjust this parameter.
+
+ A more detailed description of the effect of a miter limit can be found
+ in the `Mozilla Developer Docs
+ `_
+
+ .. plot::
+ :alt: Demo of possible JoinStyle's
+
+ from matplotlib._enums import JoinStyle
+ JoinStyle.demo()
+
+ """
+
+ miter = "miter"
+ round = "round"
+ bevel = "bevel"
+
+ @staticmethod
+ def demo():
+ """Demonstrate how each JoinStyle looks for various join angles."""
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ def plot_angle(ax, x, y, angle, style):
+ phi = np.radians(angle)
+ xx = [x + .5, x, x + .5*np.cos(phi)]
+ yy = [y, y, y + .5*np.sin(phi)]
+ ax.plot(xx, yy, lw=12, color='tab:blue', solid_joinstyle=style)
+ ax.plot(xx, yy, lw=1, color='black')
+ ax.plot(xx[1], yy[1], 'o', color='tab:red', markersize=3)
+
+ fig, ax = plt.subplots(figsize=(5, 4), constrained_layout=True)
+ ax.set_title('Join style')
+ for x, style in enumerate(['miter', 'round', 'bevel']):
+ ax.text(x, 5, style)
+ for y, angle in enumerate([20, 45, 60, 90, 120]):
+ plot_angle(ax, x, y, angle, style)
+ if x == 0:
+ ax.text(-1.3, y, f'{angle} degrees')
+ ax.set_xlim(-1.5, 2.75)
+ ax.set_ylim(-.5, 5.5)
+ ax.set_axis_off()
+ fig.show()
+
+
+JoinStyle.input_description = "{" \
+ + ", ".join([f"'{js.name}'" for js in JoinStyle]) \
+ + "}"
+
+
+class CapStyle(str, Enum):
+ r"""
+ Define how the two endpoints (caps) of an unclosed line are drawn.
+
+ How to draw the start and end points of lines that represent a closed curve
+ (i.e. that end in a `~.path.Path.CLOSEPOLY`) is controlled by the line's
+ `JoinStyle`. For all other lines, how the start and end points are drawn is
+ controlled by the *CapStyle*.
+
+ For a visual impression of each *CapStyle*, `view these docs online
+ ` or run `CapStyle.demo`.
+
+ By default, `~.backend_bases.GraphicsContextBase` draws a stroked line as
+ squared off at its endpoints.
+
+ **Supported values:**
+
+ .. rst-class:: value-list
+
+ 'butt'
+ the line is squared off at its endpoint.
+ 'projecting'
+ the line is squared off as in *butt*, but the filled in area
+ extends beyond the endpoint a distance of ``linewidth/2``.
+ 'round'
+ like *butt*, but a semicircular cap is added to the end of the
+ line, of radius ``linewidth/2``.
+
+ .. plot::
+ :alt: Demo of possible CapStyle's
+
+ from matplotlib._enums import CapStyle
+ CapStyle.demo()
+
+ """
+ butt = "butt"
+ projecting = "projecting"
+ round = "round"
+
+ @staticmethod
+ def demo():
+ """Demonstrate how each CapStyle looks for a thick line segment."""
+ import matplotlib.pyplot as plt
+
+ fig = plt.figure(figsize=(4, 1.2))
+ ax = fig.add_axes([0, 0, 1, 0.8])
+ ax.set_title('Cap style')
+
+ for x, style in enumerate(['butt', 'round', 'projecting']):
+ ax.text(x+0.25, 0.85, style, ha='center')
+ xx = [x, x+0.5]
+ yy = [0, 0]
+ ax.plot(xx, yy, lw=12, color='tab:blue', solid_capstyle=style)
+ ax.plot(xx, yy, lw=1, color='black')
+ ax.plot(xx, yy, 'o', color='tab:red', markersize=3)
+
+ ax.set_ylim(-.5, 1.5)
+ ax.set_axis_off()
+ fig.show()
+
+
+CapStyle.input_description = "{" \
+ + ", ".join([f"'{cs.name}'" for cs in CapStyle]) \
+ + "}"
+
+_docstring.interpd.register(
+ JoinStyle=JoinStyle.input_description,
+ CapStyle=CapStyle.input_description,
+)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_enums.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_enums.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..714e6cfe03faab19b2a3f939a6be4ac95415e061
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_enums.pyi
@@ -0,0 +1,19 @@
+from typing import cast
+from enum import Enum
+
+
+class JoinStyle(str, Enum):
+ miter = "miter"
+ round = "round"
+ bevel = "bevel"
+ @staticmethod
+ def demo() -> None: ...
+
+
+class CapStyle(str, Enum):
+ butt = "butt"
+ projecting = "projecting"
+ round = "round"
+
+ @staticmethod
+ def demo() -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py
new file mode 100644
index 0000000000000000000000000000000000000000..a1341c633243905be30141ecb7273d0fb325f2de
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py
@@ -0,0 +1,111 @@
+"""
+A module for parsing and generating `fontconfig patterns`_.
+
+.. _fontconfig patterns:
+ https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
+"""
+
+# This class logically belongs in `matplotlib.font_manager`, but placing it
+# there would have created cyclical dependency problems, because it also needs
+# to be available from `matplotlib.rcsetup` (for parsing matplotlibrc files).
+
+from functools import lru_cache, partial
+import re
+
+from pyparsing import (
+ Group, Optional, ParseException, Regex, StringEnd, Suppress, ZeroOrMore, oneOf)
+
+
+_family_punc = r'\\\-:,'
+_family_unescape = partial(re.compile(r'\\(?=[%s])' % _family_punc).sub, '')
+_family_escape = partial(re.compile(r'(?=[%s])' % _family_punc).sub, r'\\')
+_value_punc = r'\\=_:,'
+_value_unescape = partial(re.compile(r'\\(?=[%s])' % _value_punc).sub, '')
+_value_escape = partial(re.compile(r'(?=[%s])' % _value_punc).sub, r'\\')
+
+
+_CONSTANTS = {
+ 'thin': ('weight', 'light'),
+ 'extralight': ('weight', 'light'),
+ 'ultralight': ('weight', 'light'),
+ 'light': ('weight', 'light'),
+ 'book': ('weight', 'book'),
+ 'regular': ('weight', 'regular'),
+ 'normal': ('weight', 'normal'),
+ 'medium': ('weight', 'medium'),
+ 'demibold': ('weight', 'demibold'),
+ 'semibold': ('weight', 'semibold'),
+ 'bold': ('weight', 'bold'),
+ 'extrabold': ('weight', 'extra bold'),
+ 'black': ('weight', 'black'),
+ 'heavy': ('weight', 'heavy'),
+ 'roman': ('slant', 'normal'),
+ 'italic': ('slant', 'italic'),
+ 'oblique': ('slant', 'oblique'),
+ 'ultracondensed': ('width', 'ultra-condensed'),
+ 'extracondensed': ('width', 'extra-condensed'),
+ 'condensed': ('width', 'condensed'),
+ 'semicondensed': ('width', 'semi-condensed'),
+ 'expanded': ('width', 'expanded'),
+ 'extraexpanded': ('width', 'extra-expanded'),
+ 'ultraexpanded': ('width', 'ultra-expanded'),
+}
+
+
+@lru_cache # The parser instance is a singleton.
+def _make_fontconfig_parser():
+ def comma_separated(elem):
+ return elem + ZeroOrMore(Suppress(",") + elem)
+
+ family = Regex(fr"([^{_family_punc}]|(\\[{_family_punc}]))*")
+ size = Regex(r"([0-9]+\.?[0-9]*|\.[0-9]+)")
+ name = Regex(r"[a-z]+")
+ value = Regex(fr"([^{_value_punc}]|(\\[{_value_punc}]))*")
+ prop = Group((name + Suppress("=") + comma_separated(value)) | oneOf(_CONSTANTS))
+ return (
+ Optional(comma_separated(family)("families"))
+ + Optional("-" + comma_separated(size)("sizes"))
+ + ZeroOrMore(":" + prop("properties*"))
+ + StringEnd()
+ )
+
+
+# `parse_fontconfig_pattern` is a bottleneck during the tests because it is
+# repeatedly called when the rcParams are reset (to validate the default
+# fonts). In practice, the cache size doesn't grow beyond a few dozen entries
+# during the test suite.
+@lru_cache
+def parse_fontconfig_pattern(pattern):
+ """
+ Parse a fontconfig *pattern* into a dict that can initialize a
+ `.font_manager.FontProperties` object.
+ """
+ parser = _make_fontconfig_parser()
+ try:
+ parse = parser.parseString(pattern)
+ except ParseException as err:
+ # explain becomes a plain method on pyparsing 3 (err.explain(0)).
+ raise ValueError("\n" + ParseException.explain(err, 0)) from None
+ parser.resetCache()
+ props = {}
+ if "families" in parse:
+ props["family"] = [*map(_family_unescape, parse["families"])]
+ if "sizes" in parse:
+ props["size"] = [*parse["sizes"]]
+ for prop in parse.get("properties", []):
+ if len(prop) == 1:
+ prop = _CONSTANTS[prop[0]]
+ k, *v = prop
+ props.setdefault(k, []).extend(map(_value_unescape, v))
+ return props
+
+
+def generate_fontconfig_pattern(d):
+ """Convert a `.FontProperties` to a fontconfig pattern string."""
+ kvs = [(k, getattr(d, f"get_{k}")())
+ for k in ["style", "variant", "weight", "stretch", "file", "size"]]
+ # Families is given first without a leading keyword. Other entries (which
+ # are necessarily scalar) are given as key=value, skipping Nones.
+ return (",".join(_family_escape(f) for f in d.get_family())
+ + "".join(f":{k}={_value_escape(str(v))}"
+ for k, v in kvs if v is not None))
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_image.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_image.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_internal_utils.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_internal_utils.py
new file mode 100644
index 0000000000000000000000000000000000000000..0223aa593bb2cb20b58f2b9e41bdc0dfa5ceed35
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_internal_utils.py
@@ -0,0 +1,64 @@
+"""
+Internal debugging utilities, that are not expected to be used in the rest of
+the codebase.
+
+WARNING: Code in this module may change without prior notice!
+"""
+
+from io import StringIO
+from pathlib import Path
+import subprocess
+
+from matplotlib.transforms import TransformNode
+
+
+def graphviz_dump_transform(transform, dest, *, highlight=None):
+ """
+ Generate a graphical representation of the transform tree for *transform*
+ using the :program:`dot` program (which this function depends on). The
+ output format (png, dot, etc.) is determined from the suffix of *dest*.
+
+ Parameters
+ ----------
+ transform : `~matplotlib.transform.Transform`
+ The represented transform.
+ dest : str
+ Output filename. The extension must be one of the formats supported
+ by :program:`dot`, e.g. png, svg, dot, ...
+ (see https://www.graphviz.org/doc/info/output.html).
+ highlight : list of `~matplotlib.transform.Transform` or None
+ The transforms in the tree to be drawn in bold.
+ If *None*, *transform* is highlighted.
+ """
+
+ if highlight is None:
+ highlight = [transform]
+ seen = set()
+
+ def recurse(root, buf):
+ if id(root) in seen:
+ return
+ seen.add(id(root))
+ props = {}
+ label = type(root).__name__
+ if root._invalid:
+ label = f'[{label}]'
+ if root in highlight:
+ props['style'] = 'bold'
+ props['shape'] = 'box'
+ props['label'] = '"%s"' % label
+ props = ' '.join(map('{0[0]}={0[1]}'.format, props.items()))
+ buf.write(f'{id(root)} [{props}];\n')
+ for key, val in vars(root).items():
+ if isinstance(val, TransformNode) and id(root) in val._parents:
+ buf.write(f'"{id(root)}" -> "{id(val)}" '
+ f'[label="{key}", fontsize=10];\n')
+ recurse(val, buf)
+
+ buf = StringIO()
+ buf.write('digraph G {\n')
+ recurse(transform, buf)
+ buf.write('}\n')
+ subprocess.run(
+ ['dot', '-T', Path(dest).suffix[1:], '-o', dest],
+ input=buf.getvalue().encode('utf-8'), check=True)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_layoutgrid.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_layoutgrid.py
new file mode 100644
index 0000000000000000000000000000000000000000..8f81b14765b68fa1f7480c3d34ba74245e39b84f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_layoutgrid.py
@@ -0,0 +1,547 @@
+"""
+A layoutgrid is a nrows by ncols set of boxes, meant to be used by
+`._constrained_layout`, each box is analogous to a subplotspec element of
+a gridspec.
+
+Each box is defined by left[ncols], right[ncols], bottom[nrows] and top[nrows],
+and by two editable margins for each side. The main margin gets its value
+set by the size of ticklabels, titles, etc on each Axes that is in the figure.
+The outer margin is the padding around the Axes, and space for any
+colorbars.
+
+The "inner" widths and heights of these boxes are then constrained to be the
+same (relative the values of `width_ratios[ncols]` and `height_ratios[nrows]`).
+
+The layoutgrid is then constrained to be contained within a parent layoutgrid,
+its column(s) and row(s) specified when it is created.
+"""
+
+import itertools
+import kiwisolver as kiwi
+import logging
+import numpy as np
+
+import matplotlib as mpl
+import matplotlib.patches as mpatches
+from matplotlib.transforms import Bbox
+
+_log = logging.getLogger(__name__)
+
+
+class LayoutGrid:
+ """
+ Analogous to a gridspec, and contained in another LayoutGrid.
+ """
+
+ def __init__(self, parent=None, parent_pos=(0, 0),
+ parent_inner=False, name='', ncols=1, nrows=1,
+ h_pad=None, w_pad=None, width_ratios=None,
+ height_ratios=None):
+ Variable = kiwi.Variable
+ self.parent_pos = parent_pos
+ self.parent_inner = parent_inner
+ self.name = name + seq_id()
+ if isinstance(parent, LayoutGrid):
+ self.name = f'{parent.name}.{self.name}'
+ self.nrows = nrows
+ self.ncols = ncols
+ self.height_ratios = np.atleast_1d(height_ratios)
+ if height_ratios is None:
+ self.height_ratios = np.ones(nrows)
+ self.width_ratios = np.atleast_1d(width_ratios)
+ if width_ratios is None:
+ self.width_ratios = np.ones(ncols)
+
+ sn = self.name + '_'
+ if not isinstance(parent, LayoutGrid):
+ # parent can be a rect if not a LayoutGrid
+ # allows specifying a rectangle to contain the layout.
+ self.solver = kiwi.Solver()
+ else:
+ parent.add_child(self, *parent_pos)
+ self.solver = parent.solver
+ # keep track of artist associated w/ this layout. Can be none
+ self.artists = np.empty((nrows, ncols), dtype=object)
+ self.children = np.empty((nrows, ncols), dtype=object)
+
+ self.margins = {}
+ self.margin_vals = {}
+ # all the boxes in each column share the same left/right margins:
+ for todo in ['left', 'right', 'leftcb', 'rightcb']:
+ # track the value so we can change only if a margin is larger
+ # than the current value
+ self.margin_vals[todo] = np.zeros(ncols)
+
+ sol = self.solver
+
+ self.lefts = [Variable(f'{sn}lefts[{i}]') for i in range(ncols)]
+ self.rights = [Variable(f'{sn}rights[{i}]') for i in range(ncols)]
+ for todo in ['left', 'right', 'leftcb', 'rightcb']:
+ self.margins[todo] = [Variable(f'{sn}margins[{todo}][{i}]')
+ for i in range(ncols)]
+ for i in range(ncols):
+ sol.addEditVariable(self.margins[todo][i], 'strong')
+
+ for todo in ['bottom', 'top', 'bottomcb', 'topcb']:
+ self.margins[todo] = np.empty((nrows), dtype=object)
+ self.margin_vals[todo] = np.zeros(nrows)
+
+ self.bottoms = [Variable(f'{sn}bottoms[{i}]') for i in range(nrows)]
+ self.tops = [Variable(f'{sn}tops[{i}]') for i in range(nrows)]
+ for todo in ['bottom', 'top', 'bottomcb', 'topcb']:
+ self.margins[todo] = [Variable(f'{sn}margins[{todo}][{i}]')
+ for i in range(nrows)]
+ for i in range(nrows):
+ sol.addEditVariable(self.margins[todo][i], 'strong')
+
+ # set these margins to zero by default. They will be edited as
+ # children are filled.
+ self.reset_margins()
+ self.add_constraints(parent)
+
+ self.h_pad = h_pad
+ self.w_pad = w_pad
+
+ def __repr__(self):
+ str = f'LayoutBox: {self.name:25s} {self.nrows}x{self.ncols},\n'
+ for i in range(self.nrows):
+ for j in range(self.ncols):
+ str += f'{i}, {j}: '\
+ f'L{self.lefts[j].value():1.3f}, ' \
+ f'B{self.bottoms[i].value():1.3f}, ' \
+ f'R{self.rights[j].value():1.3f}, ' \
+ f'T{self.tops[i].value():1.3f}, ' \
+ f'ML{self.margins["left"][j].value():1.3f}, ' \
+ f'MR{self.margins["right"][j].value():1.3f}, ' \
+ f'MB{self.margins["bottom"][i].value():1.3f}, ' \
+ f'MT{self.margins["top"][i].value():1.3f}, \n'
+ return str
+
+ def reset_margins(self):
+ """
+ Reset all the margins to zero. Must do this after changing
+ figure size, for instance, because the relative size of the
+ axes labels etc changes.
+ """
+ for todo in ['left', 'right', 'bottom', 'top',
+ 'leftcb', 'rightcb', 'bottomcb', 'topcb']:
+ self.edit_margins(todo, 0.0)
+
+ def add_constraints(self, parent):
+ # define self-consistent constraints
+ self.hard_constraints()
+ # define relationship with parent layoutgrid:
+ self.parent_constraints(parent)
+ # define relative widths of the grid cells to each other
+ # and stack horizontally and vertically.
+ self.grid_constraints()
+
+ def hard_constraints(self):
+ """
+ These are the redundant constraints, plus ones that make the
+ rest of the code easier.
+ """
+ for i in range(self.ncols):
+ hc = [self.rights[i] >= self.lefts[i],
+ (self.rights[i] - self.margins['right'][i] -
+ self.margins['rightcb'][i] >=
+ self.lefts[i] - self.margins['left'][i] -
+ self.margins['leftcb'][i])
+ ]
+ for c in hc:
+ self.solver.addConstraint(c | 'required')
+
+ for i in range(self.nrows):
+ hc = [self.tops[i] >= self.bottoms[i],
+ (self.tops[i] - self.margins['top'][i] -
+ self.margins['topcb'][i] >=
+ self.bottoms[i] - self.margins['bottom'][i] -
+ self.margins['bottomcb'][i])
+ ]
+ for c in hc:
+ self.solver.addConstraint(c | 'required')
+
+ def add_child(self, child, i=0, j=0):
+ # np.ix_ returns the cross product of i and j indices
+ self.children[np.ix_(np.atleast_1d(i), np.atleast_1d(j))] = child
+
+ def parent_constraints(self, parent):
+ # constraints that are due to the parent...
+ # i.e. the first column's left is equal to the
+ # parent's left, the last column right equal to the
+ # parent's right...
+ if not isinstance(parent, LayoutGrid):
+ # specify a rectangle in figure coordinates
+ hc = [self.lefts[0] == parent[0],
+ self.rights[-1] == parent[0] + parent[2],
+ # top and bottom reversed order...
+ self.tops[0] == parent[1] + parent[3],
+ self.bottoms[-1] == parent[1]]
+ else:
+ rows, cols = self.parent_pos
+ rows = np.atleast_1d(rows)
+ cols = np.atleast_1d(cols)
+
+ left = parent.lefts[cols[0]]
+ right = parent.rights[cols[-1]]
+ top = parent.tops[rows[0]]
+ bottom = parent.bottoms[rows[-1]]
+ if self.parent_inner:
+ # the layout grid is contained inside the inner
+ # grid of the parent.
+ left += parent.margins['left'][cols[0]]
+ left += parent.margins['leftcb'][cols[0]]
+ right -= parent.margins['right'][cols[-1]]
+ right -= parent.margins['rightcb'][cols[-1]]
+ top -= parent.margins['top'][rows[0]]
+ top -= parent.margins['topcb'][rows[0]]
+ bottom += parent.margins['bottom'][rows[-1]]
+ bottom += parent.margins['bottomcb'][rows[-1]]
+ hc = [self.lefts[0] == left,
+ self.rights[-1] == right,
+ # from top to bottom
+ self.tops[0] == top,
+ self.bottoms[-1] == bottom]
+ for c in hc:
+ self.solver.addConstraint(c | 'required')
+
+ def grid_constraints(self):
+ # constrain the ratio of the inner part of the grids
+ # to be the same (relative to width_ratios)
+
+ # constrain widths:
+ w = (self.rights[0] - self.margins['right'][0] -
+ self.margins['rightcb'][0])
+ w = (w - self.lefts[0] - self.margins['left'][0] -
+ self.margins['leftcb'][0])
+ w0 = w / self.width_ratios[0]
+ # from left to right
+ for i in range(1, self.ncols):
+ w = (self.rights[i] - self.margins['right'][i] -
+ self.margins['rightcb'][i])
+ w = (w - self.lefts[i] - self.margins['left'][i] -
+ self.margins['leftcb'][i])
+ c = (w == w0 * self.width_ratios[i])
+ self.solver.addConstraint(c | 'strong')
+ # constrain the grid cells to be directly next to each other.
+ c = (self.rights[i - 1] == self.lefts[i])
+ self.solver.addConstraint(c | 'strong')
+
+ # constrain heights:
+ h = self.tops[0] - self.margins['top'][0] - self.margins['topcb'][0]
+ h = (h - self.bottoms[0] - self.margins['bottom'][0] -
+ self.margins['bottomcb'][0])
+ h0 = h / self.height_ratios[0]
+ # from top to bottom:
+ for i in range(1, self.nrows):
+ h = (self.tops[i] - self.margins['top'][i] -
+ self.margins['topcb'][i])
+ h = (h - self.bottoms[i] - self.margins['bottom'][i] -
+ self.margins['bottomcb'][i])
+ c = (h == h0 * self.height_ratios[i])
+ self.solver.addConstraint(c | 'strong')
+ # constrain the grid cells to be directly above each other.
+ c = (self.bottoms[i - 1] == self.tops[i])
+ self.solver.addConstraint(c | 'strong')
+
+ # Margin editing: The margins are variable and meant to
+ # contain things of a fixed size like axes labels, tick labels, titles
+ # etc
+ def edit_margin(self, todo, size, cell):
+ """
+ Change the size of the margin for one cell.
+
+ Parameters
+ ----------
+ todo : string (one of 'left', 'right', 'bottom', 'top')
+ margin to alter.
+
+ size : float
+ Size of the margin. If it is larger than the existing minimum it
+ updates the margin size. Fraction of figure size.
+
+ cell : int
+ Cell column or row to edit.
+ """
+ self.solver.suggestValue(self.margins[todo][cell], size)
+ self.margin_vals[todo][cell] = size
+
+ def edit_margin_min(self, todo, size, cell=0):
+ """
+ Change the minimum size of the margin for one cell.
+
+ Parameters
+ ----------
+ todo : string (one of 'left', 'right', 'bottom', 'top')
+ margin to alter.
+
+ size : float
+ Minimum size of the margin . If it is larger than the
+ existing minimum it updates the margin size. Fraction of
+ figure size.
+
+ cell : int
+ Cell column or row to edit.
+ """
+
+ if size > self.margin_vals[todo][cell]:
+ self.edit_margin(todo, size, cell)
+
+ def edit_margins(self, todo, size):
+ """
+ Change the size of all the margin of all the cells in the layout grid.
+
+ Parameters
+ ----------
+ todo : string (one of 'left', 'right', 'bottom', 'top')
+ margin to alter.
+
+ size : float
+ Size to set the margins. Fraction of figure size.
+ """
+
+ for i in range(len(self.margin_vals[todo])):
+ self.edit_margin(todo, size, i)
+
+ def edit_all_margins_min(self, todo, size):
+ """
+ Change the minimum size of all the margin of all
+ the cells in the layout grid.
+
+ Parameters
+ ----------
+ todo : {'left', 'right', 'bottom', 'top'}
+ The margin to alter.
+
+ size : float
+ Minimum size of the margin. If it is larger than the
+ existing minimum it updates the margin size. Fraction of
+ figure size.
+ """
+
+ for i in range(len(self.margin_vals[todo])):
+ self.edit_margin_min(todo, size, i)
+
+ def edit_outer_margin_mins(self, margin, ss):
+ """
+ Edit all four margin minimums in one statement.
+
+ Parameters
+ ----------
+ margin : dict
+ size of margins in a dict with keys 'left', 'right', 'bottom',
+ 'top'
+
+ ss : SubplotSpec
+ defines the subplotspec these margins should be applied to
+ """
+
+ self.edit_margin_min('left', margin['left'], ss.colspan.start)
+ self.edit_margin_min('leftcb', margin['leftcb'], ss.colspan.start)
+ self.edit_margin_min('right', margin['right'], ss.colspan.stop - 1)
+ self.edit_margin_min('rightcb', margin['rightcb'], ss.colspan.stop - 1)
+ # rows are from the top down:
+ self.edit_margin_min('top', margin['top'], ss.rowspan.start)
+ self.edit_margin_min('topcb', margin['topcb'], ss.rowspan.start)
+ self.edit_margin_min('bottom', margin['bottom'], ss.rowspan.stop - 1)
+ self.edit_margin_min('bottomcb', margin['bottomcb'],
+ ss.rowspan.stop - 1)
+
+ def get_margins(self, todo, col):
+ """Return the margin at this position"""
+ return self.margin_vals[todo][col]
+
+ def get_outer_bbox(self, rows=0, cols=0):
+ """
+ Return the outer bounding box of the subplot specs
+ given by rows and cols. rows and cols can be spans.
+ """
+ rows = np.atleast_1d(rows)
+ cols = np.atleast_1d(cols)
+
+ bbox = Bbox.from_extents(
+ self.lefts[cols[0]].value(),
+ self.bottoms[rows[-1]].value(),
+ self.rights[cols[-1]].value(),
+ self.tops[rows[0]].value())
+ return bbox
+
+ def get_inner_bbox(self, rows=0, cols=0):
+ """
+ Return the inner bounding box of the subplot specs
+ given by rows and cols. rows and cols can be spans.
+ """
+ rows = np.atleast_1d(rows)
+ cols = np.atleast_1d(cols)
+
+ bbox = Bbox.from_extents(
+ (self.lefts[cols[0]].value() +
+ self.margins['left'][cols[0]].value() +
+ self.margins['leftcb'][cols[0]].value()),
+ (self.bottoms[rows[-1]].value() +
+ self.margins['bottom'][rows[-1]].value() +
+ self.margins['bottomcb'][rows[-1]].value()),
+ (self.rights[cols[-1]].value() -
+ self.margins['right'][cols[-1]].value() -
+ self.margins['rightcb'][cols[-1]].value()),
+ (self.tops[rows[0]].value() -
+ self.margins['top'][rows[0]].value() -
+ self.margins['topcb'][rows[0]].value())
+ )
+ return bbox
+
+ def get_bbox_for_cb(self, rows=0, cols=0):
+ """
+ Return the bounding box that includes the
+ decorations but, *not* the colorbar...
+ """
+ rows = np.atleast_1d(rows)
+ cols = np.atleast_1d(cols)
+
+ bbox = Bbox.from_extents(
+ (self.lefts[cols[0]].value() +
+ self.margins['leftcb'][cols[0]].value()),
+ (self.bottoms[rows[-1]].value() +
+ self.margins['bottomcb'][rows[-1]].value()),
+ (self.rights[cols[-1]].value() -
+ self.margins['rightcb'][cols[-1]].value()),
+ (self.tops[rows[0]].value() -
+ self.margins['topcb'][rows[0]].value())
+ )
+ return bbox
+
+ def get_left_margin_bbox(self, rows=0, cols=0):
+ """
+ Return the left margin bounding box of the subplot specs
+ given by rows and cols. rows and cols can be spans.
+ """
+ rows = np.atleast_1d(rows)
+ cols = np.atleast_1d(cols)
+
+ bbox = Bbox.from_extents(
+ (self.lefts[cols[0]].value() +
+ self.margins['leftcb'][cols[0]].value()),
+ (self.bottoms[rows[-1]].value()),
+ (self.lefts[cols[0]].value() +
+ self.margins['leftcb'][cols[0]].value() +
+ self.margins['left'][cols[0]].value()),
+ (self.tops[rows[0]].value()))
+ return bbox
+
+ def get_bottom_margin_bbox(self, rows=0, cols=0):
+ """
+ Return the left margin bounding box of the subplot specs
+ given by rows and cols. rows and cols can be spans.
+ """
+ rows = np.atleast_1d(rows)
+ cols = np.atleast_1d(cols)
+
+ bbox = Bbox.from_extents(
+ (self.lefts[cols[0]].value()),
+ (self.bottoms[rows[-1]].value() +
+ self.margins['bottomcb'][rows[-1]].value()),
+ (self.rights[cols[-1]].value()),
+ (self.bottoms[rows[-1]].value() +
+ self.margins['bottom'][rows[-1]].value() +
+ self.margins['bottomcb'][rows[-1]].value()
+ ))
+ return bbox
+
+ def get_right_margin_bbox(self, rows=0, cols=0):
+ """
+ Return the left margin bounding box of the subplot specs
+ given by rows and cols. rows and cols can be spans.
+ """
+ rows = np.atleast_1d(rows)
+ cols = np.atleast_1d(cols)
+
+ bbox = Bbox.from_extents(
+ (self.rights[cols[-1]].value() -
+ self.margins['right'][cols[-1]].value() -
+ self.margins['rightcb'][cols[-1]].value()),
+ (self.bottoms[rows[-1]].value()),
+ (self.rights[cols[-1]].value() -
+ self.margins['rightcb'][cols[-1]].value()),
+ (self.tops[rows[0]].value()))
+ return bbox
+
+ def get_top_margin_bbox(self, rows=0, cols=0):
+ """
+ Return the left margin bounding box of the subplot specs
+ given by rows and cols. rows and cols can be spans.
+ """
+ rows = np.atleast_1d(rows)
+ cols = np.atleast_1d(cols)
+
+ bbox = Bbox.from_extents(
+ (self.lefts[cols[0]].value()),
+ (self.tops[rows[0]].value() -
+ self.margins['topcb'][rows[0]].value()),
+ (self.rights[cols[-1]].value()),
+ (self.tops[rows[0]].value() -
+ self.margins['topcb'][rows[0]].value() -
+ self.margins['top'][rows[0]].value()))
+ return bbox
+
+ def update_variables(self):
+ """
+ Update the variables for the solver attached to this layoutgrid.
+ """
+ self.solver.updateVariables()
+
+_layoutboxobjnum = itertools.count()
+
+
+def seq_id():
+ """Generate a short sequential id for layoutbox objects."""
+ return '%06d' % next(_layoutboxobjnum)
+
+
+def plot_children(fig, lg=None, level=0):
+ """Simple plotting to show where boxes are."""
+ if lg is None:
+ _layoutgrids = fig.get_layout_engine().execute(fig)
+ lg = _layoutgrids[fig]
+ colors = mpl.rcParams["axes.prop_cycle"].by_key()["color"]
+ col = colors[level]
+ for i in range(lg.nrows):
+ for j in range(lg.ncols):
+ bb = lg.get_outer_bbox(rows=i, cols=j)
+ fig.add_artist(
+ mpatches.Rectangle(bb.p0, bb.width, bb.height, linewidth=1,
+ edgecolor='0.7', facecolor='0.7',
+ alpha=0.2, transform=fig.transFigure,
+ zorder=-3))
+ bbi = lg.get_inner_bbox(rows=i, cols=j)
+ fig.add_artist(
+ mpatches.Rectangle(bbi.p0, bbi.width, bbi.height, linewidth=2,
+ edgecolor=col, facecolor='none',
+ transform=fig.transFigure, zorder=-2))
+
+ bbi = lg.get_left_margin_bbox(rows=i, cols=j)
+ fig.add_artist(
+ mpatches.Rectangle(bbi.p0, bbi.width, bbi.height, linewidth=0,
+ edgecolor='none', alpha=0.2,
+ facecolor=[0.5, 0.7, 0.5],
+ transform=fig.transFigure, zorder=-2))
+ bbi = lg.get_right_margin_bbox(rows=i, cols=j)
+ fig.add_artist(
+ mpatches.Rectangle(bbi.p0, bbi.width, bbi.height, linewidth=0,
+ edgecolor='none', alpha=0.2,
+ facecolor=[0.7, 0.5, 0.5],
+ transform=fig.transFigure, zorder=-2))
+ bbi = lg.get_bottom_margin_bbox(rows=i, cols=j)
+ fig.add_artist(
+ mpatches.Rectangle(bbi.p0, bbi.width, bbi.height, linewidth=0,
+ edgecolor='none', alpha=0.2,
+ facecolor=[0.5, 0.5, 0.7],
+ transform=fig.transFigure, zorder=-2))
+ bbi = lg.get_top_margin_bbox(rows=i, cols=j)
+ fig.add_artist(
+ mpatches.Rectangle(bbi.p0, bbi.width, bbi.height, linewidth=0,
+ edgecolor='none', alpha=0.2,
+ facecolor=[0.7, 0.2, 0.7],
+ transform=fig.transFigure, zorder=-2))
+ for ch in lg.children.flat:
+ if ch is not None:
+ plot_children(fig, ch, level=level+1)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_mathtext.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_mathtext.py
new file mode 100644
index 0000000000000000000000000000000000000000..7085a986414e74c046998ebc5925e803656074e7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_mathtext.py
@@ -0,0 +1,2861 @@
+"""
+Implementation details for :mod:`.mathtext`.
+"""
+
+from __future__ import annotations
+
+import abc
+import copy
+import enum
+import functools
+import logging
+import os
+import re
+import types
+import unicodedata
+import string
+import typing as T
+from typing import NamedTuple
+
+import numpy as np
+from pyparsing import (
+ Empty, Forward, Literal, NotAny, oneOf, OneOrMore, Optional,
+ ParseBaseException, ParseException, ParseExpression, ParseFatalException,
+ ParserElement, ParseResults, QuotedString, Regex, StringEnd, ZeroOrMore,
+ pyparsing_common, Group)
+
+import matplotlib as mpl
+from . import cbook
+from ._mathtext_data import (
+ latex_to_bakoma, stix_glyph_fixes, stix_virtual_fonts, tex2uni)
+from .font_manager import FontProperties, findfont, get_font
+from .ft2font import FT2Font, FT2Image, Kerning, LoadFlags
+
+from packaging.version import parse as parse_version
+from pyparsing import __version__ as pyparsing_version
+if parse_version(pyparsing_version).major < 3:
+ from pyparsing import nestedExpr as nested_expr
+else:
+ from pyparsing import nested_expr
+
+if T.TYPE_CHECKING:
+ from collections.abc import Iterable
+ from .ft2font import Glyph
+
+ParserElement.enablePackrat()
+_log = logging.getLogger("matplotlib.mathtext")
+
+
+##############################################################################
+# FONTS
+
+
+def get_unicode_index(symbol: str) -> int: # Publicly exported.
+ r"""
+ Return the integer index (from the Unicode table) of *symbol*.
+
+ Parameters
+ ----------
+ symbol : str
+ A single (Unicode) character, a TeX command (e.g. r'\pi') or a Type1
+ symbol name (e.g. 'phi').
+ """
+ try: # This will succeed if symbol is a single Unicode char
+ return ord(symbol)
+ except TypeError:
+ pass
+ try: # Is symbol a TeX symbol (i.e. \alpha)
+ return tex2uni[symbol.strip("\\")]
+ except KeyError as err:
+ raise ValueError(
+ f"{symbol!r} is not a valid Unicode character or TeX/Type1 symbol"
+ ) from err
+
+
+class VectorParse(NamedTuple):
+ """
+ The namedtuple type returned by ``MathTextParser("path").parse(...)``.
+
+ Attributes
+ ----------
+ width, height, depth : float
+ The global metrics.
+ glyphs : list
+ The glyphs including their positions.
+ rect : list
+ The list of rectangles.
+ """
+ width: float
+ height: float
+ depth: float
+ glyphs: list[tuple[FT2Font, float, int, float, float]]
+ rects: list[tuple[float, float, float, float]]
+
+VectorParse.__module__ = "matplotlib.mathtext"
+
+
+class RasterParse(NamedTuple):
+ """
+ The namedtuple type returned by ``MathTextParser("agg").parse(...)``.
+
+ Attributes
+ ----------
+ ox, oy : float
+ The offsets are always zero.
+ width, height, depth : float
+ The global metrics.
+ image : FT2Image
+ A raster image.
+ """
+ ox: float
+ oy: float
+ width: float
+ height: float
+ depth: float
+ image: FT2Image
+
+RasterParse.__module__ = "matplotlib.mathtext"
+
+
+class Output:
+ r"""
+ Result of `ship`\ping a box: lists of positioned glyphs and rectangles.
+
+ This class is not exposed to end users, but converted to a `VectorParse` or
+ a `RasterParse` by `.MathTextParser.parse`.
+ """
+
+ def __init__(self, box: Box):
+ self.box = box
+ self.glyphs: list[tuple[float, float, FontInfo]] = [] # (ox, oy, info)
+ self.rects: list[tuple[float, float, float, float]] = [] # (x1, y1, x2, y2)
+
+ def to_vector(self) -> VectorParse:
+ w, h, d = map(
+ np.ceil, [self.box.width, self.box.height, self.box.depth])
+ gs = [(info.font, info.fontsize, info.num, ox, h - oy + info.offset)
+ for ox, oy, info in self.glyphs]
+ rs = [(x1, h - y2, x2 - x1, y2 - y1)
+ for x1, y1, x2, y2 in self.rects]
+ return VectorParse(w, h + d, d, gs, rs)
+
+ def to_raster(self, *, antialiased: bool) -> RasterParse:
+ # Metrics y's and mathtext y's are oriented in opposite directions,
+ # hence the switch between ymin and ymax.
+ xmin = min([*[ox + info.metrics.xmin for ox, oy, info in self.glyphs],
+ *[x1 for x1, y1, x2, y2 in self.rects], 0]) - 1
+ ymin = min([*[oy - info.metrics.ymax for ox, oy, info in self.glyphs],
+ *[y1 for x1, y1, x2, y2 in self.rects], 0]) - 1
+ xmax = max([*[ox + info.metrics.xmax for ox, oy, info in self.glyphs],
+ *[x2 for x1, y1, x2, y2 in self.rects], 0]) + 1
+ ymax = max([*[oy - info.metrics.ymin for ox, oy, info in self.glyphs],
+ *[y2 for x1, y1, x2, y2 in self.rects], 0]) + 1
+ w = xmax - xmin
+ h = ymax - ymin - self.box.depth
+ d = ymax - ymin - self.box.height
+ image = FT2Image(int(np.ceil(w)), int(np.ceil(h + max(d, 0))))
+
+ # Ideally, we could just use self.glyphs and self.rects here, shifting
+ # their coordinates by (-xmin, -ymin), but this yields slightly
+ # different results due to floating point slop; shipping twice is the
+ # old approach and keeps baseline images backcompat.
+ shifted = ship(self.box, (-xmin, -ymin))
+
+ for ox, oy, info in shifted.glyphs:
+ info.font.draw_glyph_to_bitmap(
+ image, int(ox), int(oy - info.metrics.iceberg), info.glyph,
+ antialiased=antialiased)
+ for x1, y1, x2, y2 in shifted.rects:
+ height = max(int(y2 - y1) - 1, 0)
+ if height == 0:
+ center = (y2 + y1) / 2
+ y = int(center - (height + 1) / 2)
+ else:
+ y = int(y1)
+ image.draw_rect_filled(int(x1), y, int(np.ceil(x2)), y + height)
+ return RasterParse(0, 0, w, h + d, d, image)
+
+
+class FontMetrics(NamedTuple):
+ """
+ Metrics of a font.
+
+ Attributes
+ ----------
+ advance : float
+ The advance distance (in points) of the glyph.
+ height : float
+ The height of the glyph in points.
+ width : float
+ The width of the glyph in points.
+ xmin, xmax, ymin, ymax : float
+ The ink rectangle of the glyph.
+ iceberg : float
+ The distance from the baseline to the top of the glyph. (This corresponds to
+ TeX's definition of "height".)
+ slanted : bool
+ Whether the glyph should be considered as "slanted" (currently used for kerning
+ sub/superscripts).
+ """
+ advance: float
+ height: float
+ width: float
+ xmin: float
+ xmax: float
+ ymin: float
+ ymax: float
+ iceberg: float
+ slanted: bool
+
+
+class FontInfo(NamedTuple):
+ font: FT2Font
+ fontsize: float
+ postscript_name: str
+ metrics: FontMetrics
+ num: int
+ glyph: Glyph
+ offset: float
+
+
+class Fonts(abc.ABC):
+ """
+ An abstract base class for a system of fonts to use for mathtext.
+
+ The class must be able to take symbol keys and font file names and
+ return the character metrics. It also delegates to a backend class
+ to do the actual drawing.
+ """
+
+ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags):
+ """
+ Parameters
+ ----------
+ default_font_prop : `~.font_manager.FontProperties`
+ The default non-math font, or the base font for Unicode (generic)
+ font rendering.
+ load_glyph_flags : `.ft2font.LoadFlags`
+ Flags passed to the glyph loader (e.g. ``FT_Load_Glyph`` and
+ ``FT_Load_Char`` for FreeType-based fonts).
+ """
+ self.default_font_prop = default_font_prop
+ self.load_glyph_flags = load_glyph_flags
+
+ def get_kern(self, font1: str, fontclass1: str, sym1: str, fontsize1: float,
+ font2: str, fontclass2: str, sym2: str, fontsize2: float,
+ dpi: float) -> float:
+ """
+ Get the kerning distance for font between *sym1* and *sym2*.
+
+ See `~.Fonts.get_metrics` for a detailed description of the parameters.
+ """
+ return 0.
+
+ def _get_font(self, font: str) -> FT2Font:
+ raise NotImplementedError
+
+ def _get_info(self, font: str, font_class: str, sym: str, fontsize: float,
+ dpi: float) -> FontInfo:
+ raise NotImplementedError
+
+ def get_metrics(self, font: str, font_class: str, sym: str, fontsize: float,
+ dpi: float) -> FontMetrics:
+ r"""
+ Parameters
+ ----------
+ font : str
+ One of the TeX font names: "tt", "it", "rm", "cal", "sf", "bf",
+ "default", "regular", "bb", "frak", "scr". "default" and "regular"
+ are synonyms and use the non-math font.
+ font_class : str
+ One of the TeX font names (as for *font*), but **not** "bb",
+ "frak", or "scr". This is used to combine two font classes. The
+ only supported combination currently is ``get_metrics("frak", "bf",
+ ...)``.
+ sym : str
+ A symbol in raw TeX form, e.g., "1", "x", or "\sigma".
+ fontsize : float
+ Font size in points.
+ dpi : float
+ Rendering dots-per-inch.
+
+ Returns
+ -------
+ FontMetrics
+ """
+ info = self._get_info(font, font_class, sym, fontsize, dpi)
+ return info.metrics
+
+ def render_glyph(self, output: Output, ox: float, oy: float, font: str,
+ font_class: str, sym: str, fontsize: float, dpi: float) -> None:
+ """
+ At position (*ox*, *oy*), draw the glyph specified by the remaining
+ parameters (see `get_metrics` for their detailed description).
+ """
+ info = self._get_info(font, font_class, sym, fontsize, dpi)
+ output.glyphs.append((ox, oy, info))
+
+ def render_rect_filled(self, output: Output,
+ x1: float, y1: float, x2: float, y2: float) -> None:
+ """
+ Draw a filled rectangle from (*x1*, *y1*) to (*x2*, *y2*).
+ """
+ output.rects.append((x1, y1, x2, y2))
+
+ def get_xheight(self, font: str, fontsize: float, dpi: float) -> float:
+ """
+ Get the xheight for the given *font* and *fontsize*.
+ """
+ raise NotImplementedError()
+
+ def get_underline_thickness(self, font: str, fontsize: float, dpi: float) -> float:
+ """
+ Get the line thickness that matches the given font. Used as a
+ base unit for drawing lines such as in a fraction or radical.
+ """
+ raise NotImplementedError()
+
+ def get_sized_alternatives_for_symbol(self, fontname: str,
+ sym: str) -> list[tuple[str, str]]:
+ """
+ Override if your font provides multiple sizes of the same
+ symbol. Should return a list of symbols matching *sym* in
+ various sizes. The expression renderer will select the most
+ appropriate size for a given situation from this list.
+ """
+ return [(fontname, sym)]
+
+
+class TruetypeFonts(Fonts, metaclass=abc.ABCMeta):
+ """
+ A generic base class for all font setups that use Truetype fonts
+ (through FT2Font).
+ """
+
+ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags):
+ super().__init__(default_font_prop, load_glyph_flags)
+ # Per-instance cache.
+ self._get_info = functools.cache(self._get_info) # type: ignore[method-assign]
+ self._fonts = {}
+ self.fontmap: dict[str | int, str] = {}
+
+ filename = findfont(self.default_font_prop)
+ default_font = get_font(filename)
+ self._fonts['default'] = default_font
+ self._fonts['regular'] = default_font
+
+ def _get_font(self, font: str | int) -> FT2Font:
+ if font in self.fontmap:
+ basename = self.fontmap[font]
+ else:
+ # NOTE: An int is only passed by subclasses which have placed int keys into
+ # `self.fontmap`, so we must cast this to confirm it to typing.
+ basename = T.cast(str, font)
+ cached_font = self._fonts.get(basename)
+ if cached_font is None and os.path.exists(basename):
+ cached_font = get_font(basename)
+ self._fonts[basename] = cached_font
+ self._fonts[cached_font.postscript_name] = cached_font
+ self._fonts[cached_font.postscript_name.lower()] = cached_font
+ return T.cast(FT2Font, cached_font) # FIXME: Not sure this is guaranteed.
+
+ def _get_offset(self, font: FT2Font, glyph: Glyph, fontsize: float,
+ dpi: float) -> float:
+ if font.postscript_name == 'Cmex10':
+ return (glyph.height / 64 / 2) + (fontsize/3 * dpi/72)
+ return 0.
+
+ def _get_glyph(self, fontname: str, font_class: str,
+ sym: str) -> tuple[FT2Font, int, bool]:
+ raise NotImplementedError
+
+ # The return value of _get_info is cached per-instance.
+ def _get_info(self, fontname: str, font_class: str, sym: str, fontsize: float,
+ dpi: float) -> FontInfo:
+ font, num, slanted = self._get_glyph(fontname, font_class, sym)
+ font.set_size(fontsize, dpi)
+ glyph = font.load_char(num, flags=self.load_glyph_flags)
+
+ xmin, ymin, xmax, ymax = (val / 64 for val in glyph.bbox)
+ offset = self._get_offset(font, glyph, fontsize, dpi)
+ metrics = FontMetrics(
+ advance=glyph.linearHoriAdvance / 65536,
+ height=glyph.height / 64,
+ width=glyph.width / 64,
+ xmin=xmin,
+ xmax=xmax,
+ ymin=ymin + offset,
+ ymax=ymax + offset,
+ # iceberg is the equivalent of TeX's "height"
+ iceberg=glyph.horiBearingY / 64 + offset,
+ slanted=slanted
+ )
+
+ return FontInfo(
+ font=font,
+ fontsize=fontsize,
+ postscript_name=font.postscript_name,
+ metrics=metrics,
+ num=num,
+ glyph=glyph,
+ offset=offset
+ )
+
+ def get_xheight(self, fontname: str, fontsize: float, dpi: float) -> float:
+ font = self._get_font(fontname)
+ font.set_size(fontsize, dpi)
+ pclt = font.get_sfnt_table('pclt')
+ if pclt is None:
+ # Some fonts don't store the xHeight, so we do a poor man's xHeight
+ metrics = self.get_metrics(
+ fontname, mpl.rcParams['mathtext.default'], 'x', fontsize, dpi)
+ return metrics.iceberg
+ xHeight = (pclt['xHeight'] / 64.0) * (fontsize / 12.0) * (dpi / 100.0)
+ return xHeight
+
+ def get_underline_thickness(self, font: str, fontsize: float, dpi: float) -> float:
+ # This function used to grab underline thickness from the font
+ # metrics, but that information is just too un-reliable, so it
+ # is now hardcoded.
+ return ((0.75 / 12.0) * fontsize * dpi) / 72.0
+
+ def get_kern(self, font1: str, fontclass1: str, sym1: str, fontsize1: float,
+ font2: str, fontclass2: str, sym2: str, fontsize2: float,
+ dpi: float) -> float:
+ if font1 == font2 and fontsize1 == fontsize2:
+ info1 = self._get_info(font1, fontclass1, sym1, fontsize1, dpi)
+ info2 = self._get_info(font2, fontclass2, sym2, fontsize2, dpi)
+ font = info1.font
+ return font.get_kerning(info1.num, info2.num, Kerning.DEFAULT) / 64
+ return super().get_kern(font1, fontclass1, sym1, fontsize1,
+ font2, fontclass2, sym2, fontsize2, dpi)
+
+
+class BakomaFonts(TruetypeFonts):
+ """
+ Use the Bakoma TrueType fonts for rendering.
+
+ Symbols are strewn about a number of font files, each of which has
+ its own proprietary 8-bit encoding.
+ """
+ _fontmap = {
+ 'cal': 'cmsy10',
+ 'rm': 'cmr10',
+ 'tt': 'cmtt10',
+ 'it': 'cmmi10',
+ 'bf': 'cmb10',
+ 'sf': 'cmss10',
+ 'ex': 'cmex10',
+ }
+
+ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags):
+ self._stix_fallback = StixFonts(default_font_prop, load_glyph_flags)
+
+ super().__init__(default_font_prop, load_glyph_flags)
+ for key, val in self._fontmap.items():
+ fullpath = findfont(val)
+ self.fontmap[key] = fullpath
+ self.fontmap[val] = fullpath
+
+ _slanted_symbols = set(r"\int \oint".split())
+
+ def _get_glyph(self, fontname: str, font_class: str,
+ sym: str) -> tuple[FT2Font, int, bool]:
+ font = None
+ if fontname in self.fontmap and sym in latex_to_bakoma:
+ basename, num = latex_to_bakoma[sym]
+ slanted = (basename == "cmmi10") or sym in self._slanted_symbols
+ font = self._get_font(basename)
+ elif len(sym) == 1:
+ slanted = (fontname == "it")
+ font = self._get_font(fontname)
+ if font is not None:
+ num = ord(sym)
+ if font is not None and font.get_char_index(num) != 0:
+ return font, num, slanted
+ else:
+ return self._stix_fallback._get_glyph(fontname, font_class, sym)
+
+ # The Bakoma fonts contain many pre-sized alternatives for the
+ # delimiters. The AutoSizedChar class will use these alternatives
+ # and select the best (closest sized) glyph.
+ _size_alternatives = {
+ '(': [('rm', '('), ('ex', '\xa1'), ('ex', '\xb3'),
+ ('ex', '\xb5'), ('ex', '\xc3')],
+ ')': [('rm', ')'), ('ex', '\xa2'), ('ex', '\xb4'),
+ ('ex', '\xb6'), ('ex', '\x21')],
+ '{': [('cal', '{'), ('ex', '\xa9'), ('ex', '\x6e'),
+ ('ex', '\xbd'), ('ex', '\x28')],
+ '}': [('cal', '}'), ('ex', '\xaa'), ('ex', '\x6f'),
+ ('ex', '\xbe'), ('ex', '\x29')],
+ # The fourth size of '[' is mysteriously missing from the BaKoMa
+ # font, so I've omitted it for both '[' and ']'
+ '[': [('rm', '['), ('ex', '\xa3'), ('ex', '\x68'),
+ ('ex', '\x22')],
+ ']': [('rm', ']'), ('ex', '\xa4'), ('ex', '\x69'),
+ ('ex', '\x23')],
+ r'\lfloor': [('ex', '\xa5'), ('ex', '\x6a'),
+ ('ex', '\xb9'), ('ex', '\x24')],
+ r'\rfloor': [('ex', '\xa6'), ('ex', '\x6b'),
+ ('ex', '\xba'), ('ex', '\x25')],
+ r'\lceil': [('ex', '\xa7'), ('ex', '\x6c'),
+ ('ex', '\xbb'), ('ex', '\x26')],
+ r'\rceil': [('ex', '\xa8'), ('ex', '\x6d'),
+ ('ex', '\xbc'), ('ex', '\x27')],
+ r'\langle': [('ex', '\xad'), ('ex', '\x44'),
+ ('ex', '\xbf'), ('ex', '\x2a')],
+ r'\rangle': [('ex', '\xae'), ('ex', '\x45'),
+ ('ex', '\xc0'), ('ex', '\x2b')],
+ r'\__sqrt__': [('ex', '\x70'), ('ex', '\x71'),
+ ('ex', '\x72'), ('ex', '\x73')],
+ r'\backslash': [('ex', '\xb2'), ('ex', '\x2f'),
+ ('ex', '\xc2'), ('ex', '\x2d')],
+ r'/': [('rm', '/'), ('ex', '\xb1'), ('ex', '\x2e'),
+ ('ex', '\xcb'), ('ex', '\x2c')],
+ r'\widehat': [('rm', '\x5e'), ('ex', '\x62'), ('ex', '\x63'),
+ ('ex', '\x64')],
+ r'\widetilde': [('rm', '\x7e'), ('ex', '\x65'), ('ex', '\x66'),
+ ('ex', '\x67')],
+ r'<': [('cal', 'h'), ('ex', 'D')],
+ r'>': [('cal', 'i'), ('ex', 'E')]
+ }
+
+ for alias, target in [(r'\leftparen', '('),
+ (r'\rightparen', ')'),
+ (r'\leftbrace', '{'),
+ (r'\rightbrace', '}'),
+ (r'\leftbracket', '['),
+ (r'\rightbracket', ']'),
+ (r'\{', '{'),
+ (r'\}', '}'),
+ (r'\[', '['),
+ (r'\]', ']')]:
+ _size_alternatives[alias] = _size_alternatives[target]
+
+ def get_sized_alternatives_for_symbol(self, fontname: str,
+ sym: str) -> list[tuple[str, str]]:
+ return self._size_alternatives.get(sym, [(fontname, sym)])
+
+
+class UnicodeFonts(TruetypeFonts):
+ """
+ An abstract base class for handling Unicode fonts.
+
+ While some reasonably complete Unicode fonts (such as DejaVu) may
+ work in some situations, the only Unicode font I'm aware of with a
+ complete set of math symbols is STIX.
+
+ This class will "fallback" on the Bakoma fonts when a required
+ symbol cannot be found in the font.
+ """
+
+ # Some glyphs are not present in the `cmr10` font, and must be brought in
+ # from `cmsy10`. Map the Unicode indices of those glyphs to the indices at
+ # which they are found in `cmsy10`.
+ _cmr10_substitutions = {
+ 0x00D7: 0x00A3, # Multiplication sign.
+ 0x2212: 0x00A1, # Minus sign.
+ }
+
+ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags):
+ # This must come first so the backend's owner is set correctly
+ fallback_rc = mpl.rcParams['mathtext.fallback']
+ font_cls: type[TruetypeFonts] | None = {
+ 'stix': StixFonts,
+ 'stixsans': StixSansFonts,
+ 'cm': BakomaFonts
+ }.get(fallback_rc)
+ self._fallback_font = (font_cls(default_font_prop, load_glyph_flags)
+ if font_cls else None)
+
+ super().__init__(default_font_prop, load_glyph_flags)
+ for texfont in "cal rm tt it bf sf bfit".split():
+ prop = mpl.rcParams['mathtext.' + texfont]
+ font = findfont(prop)
+ self.fontmap[texfont] = font
+ prop = FontProperties('cmex10')
+ font = findfont(prop)
+ self.fontmap['ex'] = font
+
+ # include STIX sized alternatives for glyphs if fallback is STIX
+ if isinstance(self._fallback_font, StixFonts):
+ stixsizedaltfonts = {
+ 0: 'STIXGeneral',
+ 1: 'STIXSizeOneSym',
+ 2: 'STIXSizeTwoSym',
+ 3: 'STIXSizeThreeSym',
+ 4: 'STIXSizeFourSym',
+ 5: 'STIXSizeFiveSym'}
+
+ for size, name in stixsizedaltfonts.items():
+ fullpath = findfont(name)
+ self.fontmap[size] = fullpath
+ self.fontmap[name] = fullpath
+
+ _slanted_symbols = set(r"\int \oint".split())
+
+ def _map_virtual_font(self, fontname: str, font_class: str,
+ uniindex: int) -> tuple[str, int]:
+ return fontname, uniindex
+
+ def _get_glyph(self, fontname: str, font_class: str,
+ sym: str) -> tuple[FT2Font, int, bool]:
+ try:
+ uniindex = get_unicode_index(sym)
+ found_symbol = True
+ except ValueError:
+ uniindex = ord('?')
+ found_symbol = False
+ _log.warning("No TeX to Unicode mapping for %a.", sym)
+
+ fontname, uniindex = self._map_virtual_font(
+ fontname, font_class, uniindex)
+
+ new_fontname = fontname
+
+ # Only characters in the "Letter" class should be italicized in 'it'
+ # mode. Greek capital letters should be Roman.
+ if found_symbol:
+ if fontname == 'it' and uniindex < 0x10000:
+ char = chr(uniindex)
+ if (unicodedata.category(char)[0] != "L"
+ or unicodedata.name(char).startswith("GREEK CAPITAL")):
+ new_fontname = 'rm'
+
+ slanted = (new_fontname == 'it') or sym in self._slanted_symbols
+ found_symbol = False
+ font = self._get_font(new_fontname)
+ if font is not None:
+ if (uniindex in self._cmr10_substitutions
+ and font.family_name == "cmr10"):
+ font = get_font(
+ cbook._get_data_path("fonts/ttf/cmsy10.ttf"))
+ uniindex = self._cmr10_substitutions[uniindex]
+ glyphindex = font.get_char_index(uniindex)
+ if glyphindex != 0:
+ found_symbol = True
+
+ if not found_symbol:
+ if self._fallback_font:
+ if (fontname in ('it', 'regular')
+ and isinstance(self._fallback_font, StixFonts)):
+ fontname = 'rm'
+
+ g = self._fallback_font._get_glyph(fontname, font_class, sym)
+ family = g[0].family_name
+ if family in list(BakomaFonts._fontmap.values()):
+ family = "Computer Modern"
+ _log.info("Substituting symbol %s from %s", sym, family)
+ return g
+
+ else:
+ if (fontname in ('it', 'regular')
+ and isinstance(self, StixFonts)):
+ return self._get_glyph('rm', font_class, sym)
+ _log.warning("Font %r does not have a glyph for %a [U+%x], "
+ "substituting with a dummy symbol.",
+ new_fontname, sym, uniindex)
+ font = self._get_font('rm')
+ uniindex = 0xA4 # currency char, for lack of anything better
+ slanted = False
+
+ return font, uniindex, slanted
+
+ def get_sized_alternatives_for_symbol(self, fontname: str,
+ sym: str) -> list[tuple[str, str]]:
+ if self._fallback_font:
+ return self._fallback_font.get_sized_alternatives_for_symbol(
+ fontname, sym)
+ return [(fontname, sym)]
+
+
+class DejaVuFonts(UnicodeFonts, metaclass=abc.ABCMeta):
+ _fontmap: dict[str | int, str] = {}
+
+ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags):
+ # This must come first so the backend's owner is set correctly
+ if isinstance(self, DejaVuSerifFonts):
+ self._fallback_font = StixFonts(default_font_prop, load_glyph_flags)
+ else:
+ self._fallback_font = StixSansFonts(default_font_prop, load_glyph_flags)
+ self.bakoma = BakomaFonts(default_font_prop, load_glyph_flags)
+ TruetypeFonts.__init__(self, default_font_prop, load_glyph_flags)
+ # Include Stix sized alternatives for glyphs
+ self._fontmap.update({
+ 1: 'STIXSizeOneSym',
+ 2: 'STIXSizeTwoSym',
+ 3: 'STIXSizeThreeSym',
+ 4: 'STIXSizeFourSym',
+ 5: 'STIXSizeFiveSym',
+ })
+ for key, name in self._fontmap.items():
+ fullpath = findfont(name)
+ self.fontmap[key] = fullpath
+ self.fontmap[name] = fullpath
+
+ def _get_glyph(self, fontname: str, font_class: str,
+ sym: str) -> tuple[FT2Font, int, bool]:
+ # Override prime symbol to use Bakoma.
+ if sym == r'\prime':
+ return self.bakoma._get_glyph(fontname, font_class, sym)
+ else:
+ # check whether the glyph is available in the display font
+ uniindex = get_unicode_index(sym)
+ font = self._get_font('ex')
+ if font is not None:
+ glyphindex = font.get_char_index(uniindex)
+ if glyphindex != 0:
+ return super()._get_glyph('ex', font_class, sym)
+ # otherwise return regular glyph
+ return super()._get_glyph(fontname, font_class, sym)
+
+
+class DejaVuSerifFonts(DejaVuFonts):
+ """
+ A font handling class for the DejaVu Serif fonts
+
+ If a glyph is not found it will fallback to Stix Serif
+ """
+ _fontmap = {
+ 'rm': 'DejaVu Serif',
+ 'it': 'DejaVu Serif:italic',
+ 'bf': 'DejaVu Serif:weight=bold',
+ 'bfit': 'DejaVu Serif:italic:bold',
+ 'sf': 'DejaVu Sans',
+ 'tt': 'DejaVu Sans Mono',
+ 'ex': 'DejaVu Serif Display',
+ 0: 'DejaVu Serif',
+ }
+
+
+class DejaVuSansFonts(DejaVuFonts):
+ """
+ A font handling class for the DejaVu Sans fonts
+
+ If a glyph is not found it will fallback to Stix Sans
+ """
+ _fontmap = {
+ 'rm': 'DejaVu Sans',
+ 'it': 'DejaVu Sans:italic',
+ 'bf': 'DejaVu Sans:weight=bold',
+ 'bfit': 'DejaVu Sans:italic:bold',
+ 'sf': 'DejaVu Sans',
+ 'tt': 'DejaVu Sans Mono',
+ 'ex': 'DejaVu Sans Display',
+ 0: 'DejaVu Sans',
+ }
+
+
+class StixFonts(UnicodeFonts):
+ """
+ A font handling class for the STIX fonts.
+
+ In addition to what UnicodeFonts provides, this class:
+
+ - supports "virtual fonts" which are complete alpha numeric
+ character sets with different font styles at special Unicode
+ code points, such as "Blackboard".
+
+ - handles sized alternative characters for the STIXSizeX fonts.
+ """
+ _fontmap: dict[str | int, str] = {
+ 'rm': 'STIXGeneral',
+ 'it': 'STIXGeneral:italic',
+ 'bf': 'STIXGeneral:weight=bold',
+ 'bfit': 'STIXGeneral:italic:bold',
+ 'nonunirm': 'STIXNonUnicode',
+ 'nonuniit': 'STIXNonUnicode:italic',
+ 'nonunibf': 'STIXNonUnicode:weight=bold',
+ 0: 'STIXGeneral',
+ 1: 'STIXSizeOneSym',
+ 2: 'STIXSizeTwoSym',
+ 3: 'STIXSizeThreeSym',
+ 4: 'STIXSizeFourSym',
+ 5: 'STIXSizeFiveSym',
+ }
+ _fallback_font = None
+ _sans = False
+
+ def __init__(self, default_font_prop: FontProperties, load_glyph_flags: LoadFlags):
+ TruetypeFonts.__init__(self, default_font_prop, load_glyph_flags)
+ for key, name in self._fontmap.items():
+ fullpath = findfont(name)
+ self.fontmap[key] = fullpath
+ self.fontmap[name] = fullpath
+
+ def _map_virtual_font(self, fontname: str, font_class: str,
+ uniindex: int) -> tuple[str, int]:
+ # Handle these "fonts" that are actually embedded in
+ # other fonts.
+ font_mapping = stix_virtual_fonts.get(fontname)
+ if (self._sans and font_mapping is None
+ and fontname not in ('regular', 'default')):
+ font_mapping = stix_virtual_fonts['sf']
+ doing_sans_conversion = True
+ else:
+ doing_sans_conversion = False
+
+ if isinstance(font_mapping, dict):
+ try:
+ mapping = font_mapping[font_class]
+ except KeyError:
+ mapping = font_mapping['rm']
+ elif isinstance(font_mapping, list):
+ mapping = font_mapping
+ else:
+ mapping = None
+
+ if mapping is not None:
+ # Binary search for the source glyph
+ lo = 0
+ hi = len(mapping)
+ while lo < hi:
+ mid = (lo+hi)//2
+ range = mapping[mid]
+ if uniindex < range[0]:
+ hi = mid
+ elif uniindex <= range[1]:
+ break
+ else:
+ lo = mid + 1
+
+ if range[0] <= uniindex <= range[1]:
+ uniindex = uniindex - range[0] + range[3]
+ fontname = range[2]
+ elif not doing_sans_conversion:
+ # This will generate a dummy character
+ uniindex = 0x1
+ fontname = mpl.rcParams['mathtext.default']
+
+ # Fix some incorrect glyphs.
+ if fontname in ('rm', 'it'):
+ uniindex = stix_glyph_fixes.get(uniindex, uniindex)
+
+ # Handle private use area glyphs
+ if fontname in ('it', 'rm', 'bf', 'bfit') and 0xe000 <= uniindex <= 0xf8ff:
+ fontname = 'nonuni' + fontname
+
+ return fontname, uniindex
+
+ @functools.cache
+ def get_sized_alternatives_for_symbol( # type: ignore[override]
+ self,
+ fontname: str,
+ sym: str) -> list[tuple[str, str]] | list[tuple[int, str]]:
+ fixes = {
+ '\\{': '{', '\\}': '}', '\\[': '[', '\\]': ']',
+ '<': '\N{MATHEMATICAL LEFT ANGLE BRACKET}',
+ '>': '\N{MATHEMATICAL RIGHT ANGLE BRACKET}',
+ }
+ sym = fixes.get(sym, sym)
+ try:
+ uniindex = get_unicode_index(sym)
+ except ValueError:
+ return [(fontname, sym)]
+ alternatives = [(i, chr(uniindex)) for i in range(6)
+ if self._get_font(i).get_char_index(uniindex) != 0]
+ # The largest size of the radical symbol in STIX has incorrect
+ # metrics that cause it to be disconnected from the stem.
+ if sym == r'\__sqrt__':
+ alternatives = alternatives[:-1]
+ return alternatives
+
+
+class StixSansFonts(StixFonts):
+ """
+ A font handling class for the STIX fonts (that uses sans-serif
+ characters by default).
+ """
+ _sans = True
+
+
+##############################################################################
+# TeX-LIKE BOX MODEL
+
+# The following is based directly on the document 'woven' from the
+# TeX82 source code. This information is also available in printed
+# form:
+#
+# Knuth, Donald E.. 1986. Computers and Typesetting, Volume B:
+# TeX: The Program. Addison-Wesley Professional.
+#
+# The most relevant "chapters" are:
+# Data structures for boxes and their friends
+# Shipping pages out (ship())
+# Packaging (hpack() and vpack())
+# Data structures for math mode
+# Subroutines for math mode
+# Typesetting math formulas
+#
+# Many of the docstrings below refer to a numbered "node" in that
+# book, e.g., node123
+#
+# Note that (as TeX) y increases downward, unlike many other parts of
+# matplotlib.
+
+# How much text shrinks when going to the next-smallest level.
+SHRINK_FACTOR = 0.7
+# The number of different sizes of chars to use, beyond which they will not
+# get any smaller
+NUM_SIZE_LEVELS = 6
+
+
+class FontConstantsBase:
+ """
+ A set of constants that controls how certain things, such as sub-
+ and superscripts are laid out. These are all metrics that can't
+ be reliably retrieved from the font metrics in the font itself.
+ """
+ # Percentage of x-height of additional horiz. space after sub/superscripts
+ script_space: T.ClassVar[float] = 0.05
+
+ # Percentage of x-height that sub/superscripts drop below the baseline
+ subdrop: T.ClassVar[float] = 0.4
+
+ # Percentage of x-height that superscripts are raised from the baseline
+ sup1: T.ClassVar[float] = 0.7
+
+ # Percentage of x-height that subscripts drop below the baseline
+ sub1: T.ClassVar[float] = 0.3
+
+ # Percentage of x-height that subscripts drop below the baseline when a
+ # superscript is present
+ sub2: T.ClassVar[float] = 0.5
+
+ # Percentage of x-height that sub/superscripts are offset relative to the
+ # nucleus edge for non-slanted nuclei
+ delta: T.ClassVar[float] = 0.025
+
+ # Additional percentage of last character height above 2/3 of the
+ # x-height that superscripts are offset relative to the subscript
+ # for slanted nuclei
+ delta_slanted: T.ClassVar[float] = 0.2
+
+ # Percentage of x-height that superscripts and subscripts are offset for
+ # integrals
+ delta_integral: T.ClassVar[float] = 0.1
+
+
+class ComputerModernFontConstants(FontConstantsBase):
+ script_space = 0.075
+ subdrop = 0.2
+ sup1 = 0.45
+ sub1 = 0.2
+ sub2 = 0.3
+ delta = 0.075
+ delta_slanted = 0.3
+ delta_integral = 0.3
+
+
+class STIXFontConstants(FontConstantsBase):
+ script_space = 0.1
+ sup1 = 0.8
+ sub2 = 0.6
+ delta = 0.05
+ delta_slanted = 0.3
+ delta_integral = 0.3
+
+
+class STIXSansFontConstants(FontConstantsBase):
+ script_space = 0.05
+ sup1 = 0.8
+ delta_slanted = 0.6
+ delta_integral = 0.3
+
+
+class DejaVuSerifFontConstants(FontConstantsBase):
+ pass
+
+
+class DejaVuSansFontConstants(FontConstantsBase):
+ pass
+
+
+# Maps font family names to the FontConstantBase subclass to use
+_font_constant_mapping = {
+ 'DejaVu Sans': DejaVuSansFontConstants,
+ 'DejaVu Sans Mono': DejaVuSansFontConstants,
+ 'DejaVu Serif': DejaVuSerifFontConstants,
+ 'cmb10': ComputerModernFontConstants,
+ 'cmex10': ComputerModernFontConstants,
+ 'cmmi10': ComputerModernFontConstants,
+ 'cmr10': ComputerModernFontConstants,
+ 'cmss10': ComputerModernFontConstants,
+ 'cmsy10': ComputerModernFontConstants,
+ 'cmtt10': ComputerModernFontConstants,
+ 'STIXGeneral': STIXFontConstants,
+ 'STIXNonUnicode': STIXFontConstants,
+ 'STIXSizeFiveSym': STIXFontConstants,
+ 'STIXSizeFourSym': STIXFontConstants,
+ 'STIXSizeThreeSym': STIXFontConstants,
+ 'STIXSizeTwoSym': STIXFontConstants,
+ 'STIXSizeOneSym': STIXFontConstants,
+ # Map the fonts we used to ship, just for good measure
+ 'Bitstream Vera Sans': DejaVuSansFontConstants,
+ 'Bitstream Vera': DejaVuSansFontConstants,
+ }
+
+
+def _get_font_constant_set(state: ParserState) -> type[FontConstantsBase]:
+ constants = _font_constant_mapping.get(
+ state.fontset._get_font(state.font).family_name, FontConstantsBase)
+ # STIX sans isn't really its own fonts, just different code points
+ # in the STIX fonts, so we have to detect this one separately.
+ if (constants is STIXFontConstants and
+ isinstance(state.fontset, StixSansFonts)):
+ return STIXSansFontConstants
+ return constants
+
+
+class Node:
+ """A node in the TeX box model."""
+
+ def __init__(self) -> None:
+ self.size = 0
+
+ def __repr__(self) -> str:
+ return type(self).__name__
+
+ def get_kerning(self, next: Node | None) -> float:
+ return 0.0
+
+ def shrink(self) -> None:
+ """
+ Shrinks one level smaller. There are only three levels of
+ sizes, after which things will no longer get smaller.
+ """
+ self.size += 1
+
+ def render(self, output: Output, x: float, y: float) -> None:
+ """Render this node."""
+
+
+class Box(Node):
+ """A node with a physical location."""
+
+ def __init__(self, width: float, height: float, depth: float) -> None:
+ super().__init__()
+ self.width = width
+ self.height = height
+ self.depth = depth
+
+ def shrink(self) -> None:
+ super().shrink()
+ if self.size < NUM_SIZE_LEVELS:
+ self.width *= SHRINK_FACTOR
+ self.height *= SHRINK_FACTOR
+ self.depth *= SHRINK_FACTOR
+
+ def render(self, output: Output, # type: ignore[override]
+ x1: float, y1: float, x2: float, y2: float) -> None:
+ pass
+
+
+class Vbox(Box):
+ """A box with only height (zero width)."""
+
+ def __init__(self, height: float, depth: float):
+ super().__init__(0., height, depth)
+
+
+class Hbox(Box):
+ """A box with only width (zero height and depth)."""
+
+ def __init__(self, width: float):
+ super().__init__(width, 0., 0.)
+
+
+class Char(Node):
+ """
+ A single character.
+
+ Unlike TeX, the font information and metrics are stored with each `Char`
+ to make it easier to lookup the font metrics when needed. Note that TeX
+ boxes have a width, height, and depth, unlike Type1 and TrueType which use
+ a full bounding box and an advance in the x-direction. The metrics must
+ be converted to the TeX model, and the advance (if different from width)
+ must be converted into a `Kern` node when the `Char` is added to its parent
+ `Hlist`.
+ """
+
+ def __init__(self, c: str, state: ParserState):
+ super().__init__()
+ self.c = c
+ self.fontset = state.fontset
+ self.font = state.font
+ self.font_class = state.font_class
+ self.fontsize = state.fontsize
+ self.dpi = state.dpi
+ # The real width, height and depth will be set during the
+ # pack phase, after we know the real fontsize
+ self._update_metrics()
+
+ def __repr__(self) -> str:
+ return '`%s`' % self.c
+
+ def _update_metrics(self) -> None:
+ metrics = self._metrics = self.fontset.get_metrics(
+ self.font, self.font_class, self.c, self.fontsize, self.dpi)
+ if self.c == ' ':
+ self.width = metrics.advance
+ else:
+ self.width = metrics.width
+ self.height = metrics.iceberg
+ self.depth = -(metrics.iceberg - metrics.height)
+
+ def is_slanted(self) -> bool:
+ return self._metrics.slanted
+
+ def get_kerning(self, next: Node | None) -> float:
+ """
+ Return the amount of kerning between this and the given character.
+
+ This method is called when characters are strung together into `Hlist`
+ to create `Kern` nodes.
+ """
+ advance = self._metrics.advance - self.width
+ kern = 0.
+ if isinstance(next, Char):
+ kern = self.fontset.get_kern(
+ self.font, self.font_class, self.c, self.fontsize,
+ next.font, next.font_class, next.c, next.fontsize,
+ self.dpi)
+ return advance + kern
+
+ def render(self, output: Output, x: float, y: float) -> None:
+ self.fontset.render_glyph(
+ output, x, y,
+ self.font, self.font_class, self.c, self.fontsize, self.dpi)
+
+ def shrink(self) -> None:
+ super().shrink()
+ if self.size < NUM_SIZE_LEVELS:
+ self.fontsize *= SHRINK_FACTOR
+ self.width *= SHRINK_FACTOR
+ self.height *= SHRINK_FACTOR
+ self.depth *= SHRINK_FACTOR
+
+
+class Accent(Char):
+ """
+ The font metrics need to be dealt with differently for accents,
+ since they are already offset correctly from the baseline in
+ TrueType fonts.
+ """
+ def _update_metrics(self) -> None:
+ metrics = self._metrics = self.fontset.get_metrics(
+ self.font, self.font_class, self.c, self.fontsize, self.dpi)
+ self.width = metrics.xmax - metrics.xmin
+ self.height = metrics.ymax - metrics.ymin
+ self.depth = 0
+
+ def shrink(self) -> None:
+ super().shrink()
+ self._update_metrics()
+
+ def render(self, output: Output, x: float, y: float) -> None:
+ self.fontset.render_glyph(
+ output, x - self._metrics.xmin, y + self._metrics.ymin,
+ self.font, self.font_class, self.c, self.fontsize, self.dpi)
+
+
+class List(Box):
+ """A list of nodes (either horizontal or vertical)."""
+
+ def __init__(self, elements: T.Sequence[Node]):
+ super().__init__(0., 0., 0.)
+ self.shift_amount = 0. # An arbitrary offset
+ self.children = [*elements] # The child nodes of this list
+ # The following parameters are set in the vpack and hpack functions
+ self.glue_set = 0. # The glue setting of this list
+ self.glue_sign = 0 # 0: normal, -1: shrinking, 1: stretching
+ self.glue_order = 0 # The order of infinity (0 - 3) for the glue
+
+ def __repr__(self) -> str:
+ return '{}[{}]'.format(
+ super().__repr__(),
+ self.width, self.height,
+ self.depth, self.shift_amount,
+ ', '.join([repr(x) for x in self.children]))
+
+ def _set_glue(self, x: float, sign: int, totals: list[float],
+ error_type: str) -> None:
+ self.glue_order = o = next(
+ # Highest order of glue used by the members of this list.
+ (i for i in range(len(totals))[::-1] if totals[i] != 0), 0)
+ self.glue_sign = sign
+ if totals[o] != 0.:
+ self.glue_set = x / totals[o]
+ else:
+ self.glue_sign = 0
+ self.glue_ratio = 0.
+ if o == 0:
+ if len(self.children):
+ _log.warning("%s %s: %r",
+ error_type, type(self).__name__, self)
+
+ def shrink(self) -> None:
+ for child in self.children:
+ child.shrink()
+ super().shrink()
+ if self.size < NUM_SIZE_LEVELS:
+ self.shift_amount *= SHRINK_FACTOR
+ self.glue_set *= SHRINK_FACTOR
+
+
+class Hlist(List):
+ """A horizontal list of boxes."""
+
+ def __init__(self, elements: T.Sequence[Node], w: float = 0.0,
+ m: T.Literal['additional', 'exactly'] = 'additional',
+ do_kern: bool = True):
+ super().__init__(elements)
+ if do_kern:
+ self.kern()
+ self.hpack(w=w, m=m)
+
+ def kern(self) -> None:
+ """
+ Insert `Kern` nodes between `Char` nodes to set kerning.
+
+ The `Char` nodes themselves determine the amount of kerning they need
+ (in `~Char.get_kerning`), and this function just creates the correct
+ linked list.
+ """
+ new_children = []
+ num_children = len(self.children)
+ if num_children:
+ for i in range(num_children):
+ elem = self.children[i]
+ if i < num_children - 1:
+ next = self.children[i + 1]
+ else:
+ next = None
+
+ new_children.append(elem)
+ kerning_distance = elem.get_kerning(next)
+ if kerning_distance != 0.:
+ kern = Kern(kerning_distance)
+ new_children.append(kern)
+ self.children = new_children
+
+ def hpack(self, w: float = 0.0,
+ m: T.Literal['additional', 'exactly'] = 'additional') -> None:
+ r"""
+ Compute the dimensions of the resulting boxes, and adjust the glue if
+ one of those dimensions is pre-specified. The computed sizes normally
+ enclose all of the material inside the new box; but some items may
+ stick out if negative glue is used, if the box is overfull, or if a
+ ``\vbox`` includes other boxes that have been shifted left.
+
+ Parameters
+ ----------
+ w : float, default: 0
+ A width.
+ m : {'exactly', 'additional'}, default: 'additional'
+ Whether to produce a box whose width is 'exactly' *w*; or a box
+ with the natural width of the contents, plus *w* ('additional').
+
+ Notes
+ -----
+ The defaults produce a box with the natural width of the contents.
+ """
+ # I don't know why these get reset in TeX. Shift_amount is pretty
+ # much useless if we do.
+ # self.shift_amount = 0.
+ h = 0.
+ d = 0.
+ x = 0.
+ total_stretch = [0.] * 4
+ total_shrink = [0.] * 4
+ for p in self.children:
+ if isinstance(p, Char):
+ x += p.width
+ h = max(h, p.height)
+ d = max(d, p.depth)
+ elif isinstance(p, Box):
+ x += p.width
+ if not np.isinf(p.height) and not np.isinf(p.depth):
+ s = getattr(p, 'shift_amount', 0.)
+ h = max(h, p.height - s)
+ d = max(d, p.depth + s)
+ elif isinstance(p, Glue):
+ glue_spec = p.glue_spec
+ x += glue_spec.width
+ total_stretch[glue_spec.stretch_order] += glue_spec.stretch
+ total_shrink[glue_spec.shrink_order] += glue_spec.shrink
+ elif isinstance(p, Kern):
+ x += p.width
+ self.height = h
+ self.depth = d
+
+ if m == 'additional':
+ w += x
+ self.width = w
+ x = w - x
+
+ if x == 0.:
+ self.glue_sign = 0
+ self.glue_order = 0
+ self.glue_ratio = 0.
+ return
+ if x > 0.:
+ self._set_glue(x, 1, total_stretch, "Overful")
+ else:
+ self._set_glue(x, -1, total_shrink, "Underful")
+
+
+class Vlist(List):
+ """A vertical list of boxes."""
+
+ def __init__(self, elements: T.Sequence[Node], h: float = 0.0,
+ m: T.Literal['additional', 'exactly'] = 'additional'):
+ super().__init__(elements)
+ self.vpack(h=h, m=m)
+
+ def vpack(self, h: float = 0.0,
+ m: T.Literal['additional', 'exactly'] = 'additional',
+ l: float = np.inf) -> None:
+ """
+ Compute the dimensions of the resulting boxes, and to adjust the glue
+ if one of those dimensions is pre-specified.
+
+ Parameters
+ ----------
+ h : float, default: 0
+ A height.
+ m : {'exactly', 'additional'}, default: 'additional'
+ Whether to produce a box whose height is 'exactly' *h*; or a box
+ with the natural height of the contents, plus *h* ('additional').
+ l : float, default: np.inf
+ The maximum height.
+
+ Notes
+ -----
+ The defaults produce a box with the natural height of the contents.
+ """
+ # I don't know why these get reset in TeX. Shift_amount is pretty
+ # much useless if we do.
+ # self.shift_amount = 0.
+ w = 0.
+ d = 0.
+ x = 0.
+ total_stretch = [0.] * 4
+ total_shrink = [0.] * 4
+ for p in self.children:
+ if isinstance(p, Box):
+ x += d + p.height
+ d = p.depth
+ if not np.isinf(p.width):
+ s = getattr(p, 'shift_amount', 0.)
+ w = max(w, p.width + s)
+ elif isinstance(p, Glue):
+ x += d
+ d = 0.
+ glue_spec = p.glue_spec
+ x += glue_spec.width
+ total_stretch[glue_spec.stretch_order] += glue_spec.stretch
+ total_shrink[glue_spec.shrink_order] += glue_spec.shrink
+ elif isinstance(p, Kern):
+ x += d + p.width
+ d = 0.
+ elif isinstance(p, Char):
+ raise RuntimeError(
+ "Internal mathtext error: Char node found in Vlist")
+
+ self.width = w
+ if d > l:
+ x += d - l
+ self.depth = l
+ else:
+ self.depth = d
+
+ if m == 'additional':
+ h += x
+ self.height = h
+ x = h - x
+
+ if x == 0:
+ self.glue_sign = 0
+ self.glue_order = 0
+ self.glue_ratio = 0.
+ return
+
+ if x > 0.:
+ self._set_glue(x, 1, total_stretch, "Overful")
+ else:
+ self._set_glue(x, -1, total_shrink, "Underful")
+
+
+class Rule(Box):
+ """
+ A solid black rectangle.
+
+ It has *width*, *depth*, and *height* fields just as in an `Hlist`.
+ However, if any of these dimensions is inf, the actual value will be
+ determined by running the rule up to the boundary of the innermost
+ enclosing box. This is called a "running dimension". The width is never
+ running in an `Hlist`; the height and depth are never running in a `Vlist`.
+ """
+
+ def __init__(self, width: float, height: float, depth: float, state: ParserState):
+ super().__init__(width, height, depth)
+ self.fontset = state.fontset
+
+ def render(self, output: Output, # type: ignore[override]
+ x: float, y: float, w: float, h: float) -> None:
+ self.fontset.render_rect_filled(output, x, y, x + w, y + h)
+
+
+class Hrule(Rule):
+ """Convenience class to create a horizontal rule."""
+
+ def __init__(self, state: ParserState, thickness: float | None = None):
+ if thickness is None:
+ thickness = state.get_current_underline_thickness()
+ height = depth = thickness * 0.5
+ super().__init__(np.inf, height, depth, state)
+
+
+class Vrule(Rule):
+ """Convenience class to create a vertical rule."""
+
+ def __init__(self, state: ParserState):
+ thickness = state.get_current_underline_thickness()
+ super().__init__(thickness, np.inf, np.inf, state)
+
+
+class _GlueSpec(NamedTuple):
+ width: float
+ stretch: float
+ stretch_order: int
+ shrink: float
+ shrink_order: int
+
+
+_GlueSpec._named = { # type: ignore[attr-defined]
+ 'fil': _GlueSpec(0., 1., 1, 0., 0),
+ 'fill': _GlueSpec(0., 1., 2, 0., 0),
+ 'filll': _GlueSpec(0., 1., 3, 0., 0),
+ 'neg_fil': _GlueSpec(0., 0., 0, 1., 1),
+ 'neg_fill': _GlueSpec(0., 0., 0, 1., 2),
+ 'neg_filll': _GlueSpec(0., 0., 0, 1., 3),
+ 'empty': _GlueSpec(0., 0., 0, 0., 0),
+ 'ss': _GlueSpec(0., 1., 1, -1., 1),
+}
+
+
+class Glue(Node):
+ """
+ Most of the information in this object is stored in the underlying
+ ``_GlueSpec`` class, which is shared between multiple glue objects.
+ (This is a memory optimization which probably doesn't matter anymore, but
+ it's easier to stick to what TeX does.)
+ """
+
+ def __init__(self,
+ glue_type: _GlueSpec | T.Literal["fil", "fill", "filll",
+ "neg_fil", "neg_fill", "neg_filll",
+ "empty", "ss"]):
+ super().__init__()
+ if isinstance(glue_type, str):
+ glue_spec = _GlueSpec._named[glue_type] # type: ignore[attr-defined]
+ elif isinstance(glue_type, _GlueSpec):
+ glue_spec = glue_type
+ else:
+ raise ValueError("glue_type must be a glue spec name or instance")
+ self.glue_spec = glue_spec
+
+ def shrink(self) -> None:
+ super().shrink()
+ if self.size < NUM_SIZE_LEVELS:
+ g = self.glue_spec
+ self.glue_spec = g._replace(width=g.width * SHRINK_FACTOR)
+
+
+class HCentered(Hlist):
+ """
+ A convenience class to create an `Hlist` whose contents are
+ centered within its enclosing box.
+ """
+
+ def __init__(self, elements: list[Node]):
+ super().__init__([Glue('ss'), *elements, Glue('ss')], do_kern=False)
+
+
+class VCentered(Vlist):
+ """
+ A convenience class to create a `Vlist` whose contents are
+ centered within its enclosing box.
+ """
+
+ def __init__(self, elements: list[Node]):
+ super().__init__([Glue('ss'), *elements, Glue('ss')])
+
+
+class Kern(Node):
+ """
+ A `Kern` node has a width field to specify a (normally
+ negative) amount of spacing. This spacing correction appears in
+ horizontal lists between letters like A and V when the font
+ designer said that it looks better to move them closer together or
+ further apart. A kern node can also appear in a vertical list,
+ when its *width* denotes additional spacing in the vertical
+ direction.
+ """
+
+ height = 0
+ depth = 0
+
+ def __init__(self, width: float):
+ super().__init__()
+ self.width = width
+
+ def __repr__(self) -> str:
+ return "k%.02f" % self.width
+
+ def shrink(self) -> None:
+ super().shrink()
+ if self.size < NUM_SIZE_LEVELS:
+ self.width *= SHRINK_FACTOR
+
+
+class AutoHeightChar(Hlist):
+ """
+ A character as close to the given height and depth as possible.
+
+ When using a font with multiple height versions of some characters (such as
+ the BaKoMa fonts), the correct glyph will be selected, otherwise this will
+ always just return a scaled version of the glyph.
+ """
+
+ def __init__(self, c: str, height: float, depth: float, state: ParserState,
+ always: bool = False, factor: float | None = None):
+ alternatives = state.fontset.get_sized_alternatives_for_symbol(
+ state.font, c)
+
+ xHeight = state.fontset.get_xheight(
+ state.font, state.fontsize, state.dpi)
+
+ state = state.copy()
+ target_total = height + depth
+ for fontname, sym in alternatives:
+ state.font = fontname
+ char = Char(sym, state)
+ # Ensure that size 0 is chosen when the text is regular sized but
+ # with descender glyphs by subtracting 0.2 * xHeight
+ if char.height + char.depth >= target_total - 0.2 * xHeight:
+ break
+
+ shift = 0.0
+ if state.font != 0 or len(alternatives) == 1:
+ if factor is None:
+ factor = target_total / (char.height + char.depth)
+ state.fontsize *= factor
+ char = Char(sym, state)
+
+ shift = (depth - char.depth)
+
+ super().__init__([char])
+ self.shift_amount = shift
+
+
+class AutoWidthChar(Hlist):
+ """
+ A character as close to the given width as possible.
+
+ When using a font with multiple width versions of some characters (such as
+ the BaKoMa fonts), the correct glyph will be selected, otherwise this will
+ always just return a scaled version of the glyph.
+ """
+
+ def __init__(self, c: str, width: float, state: ParserState, always: bool = False,
+ char_class: type[Char] = Char):
+ alternatives = state.fontset.get_sized_alternatives_for_symbol(
+ state.font, c)
+
+ state = state.copy()
+ for fontname, sym in alternatives:
+ state.font = fontname
+ char = char_class(sym, state)
+ if char.width >= width:
+ break
+
+ factor = width / char.width
+ state.fontsize *= factor
+ char = char_class(sym, state)
+
+ super().__init__([char])
+ self.width = char.width
+
+
+def ship(box: Box, xy: tuple[float, float] = (0, 0)) -> Output:
+ """
+ Ship out *box* at offset *xy*, converting it to an `Output`.
+
+ Since boxes can be inside of boxes inside of boxes, the main work of `ship`
+ is done by two mutually recursive routines, `hlist_out` and `vlist_out`,
+ which traverse the `Hlist` nodes and `Vlist` nodes inside of horizontal
+ and vertical boxes. The global variables used in TeX to store state as it
+ processes have become local variables here.
+ """
+ ox, oy = xy
+ cur_v = 0.
+ cur_h = 0.
+ off_h = ox
+ off_v = oy + box.height
+ output = Output(box)
+
+ def clamp(value: float) -> float:
+ return -1e9 if value < -1e9 else +1e9 if value > +1e9 else value
+
+ def hlist_out(box: Hlist) -> None:
+ nonlocal cur_v, cur_h, off_h, off_v
+
+ cur_g = 0
+ cur_glue = 0.
+ glue_order = box.glue_order
+ glue_sign = box.glue_sign
+ base_line = cur_v
+ left_edge = cur_h
+
+ for p in box.children:
+ if isinstance(p, Char):
+ p.render(output, cur_h + off_h, cur_v + off_v)
+ cur_h += p.width
+ elif isinstance(p, Kern):
+ cur_h += p.width
+ elif isinstance(p, List):
+ # node623
+ if len(p.children) == 0:
+ cur_h += p.width
+ else:
+ edge = cur_h
+ cur_v = base_line + p.shift_amount
+ if isinstance(p, Hlist):
+ hlist_out(p)
+ elif isinstance(p, Vlist):
+ # p.vpack(box.height + box.depth, 'exactly')
+ vlist_out(p)
+ else:
+ assert False, "unreachable code"
+ cur_h = edge + p.width
+ cur_v = base_line
+ elif isinstance(p, Box):
+ # node624
+ rule_height = p.height
+ rule_depth = p.depth
+ rule_width = p.width
+ if np.isinf(rule_height):
+ rule_height = box.height
+ if np.isinf(rule_depth):
+ rule_depth = box.depth
+ if rule_height > 0 and rule_width > 0:
+ cur_v = base_line + rule_depth
+ p.render(output,
+ cur_h + off_h, cur_v + off_v,
+ rule_width, rule_height)
+ cur_v = base_line
+ cur_h += rule_width
+ elif isinstance(p, Glue):
+ # node625
+ glue_spec = p.glue_spec
+ rule_width = glue_spec.width - cur_g
+ if glue_sign != 0: # normal
+ if glue_sign == 1: # stretching
+ if glue_spec.stretch_order == glue_order:
+ cur_glue += glue_spec.stretch
+ cur_g = round(clamp(box.glue_set * cur_glue))
+ elif glue_spec.shrink_order == glue_order:
+ cur_glue += glue_spec.shrink
+ cur_g = round(clamp(box.glue_set * cur_glue))
+ rule_width += cur_g
+ cur_h += rule_width
+
+ def vlist_out(box: Vlist) -> None:
+ nonlocal cur_v, cur_h, off_h, off_v
+
+ cur_g = 0
+ cur_glue = 0.
+ glue_order = box.glue_order
+ glue_sign = box.glue_sign
+ left_edge = cur_h
+ cur_v -= box.height
+ top_edge = cur_v
+
+ for p in box.children:
+ if isinstance(p, Kern):
+ cur_v += p.width
+ elif isinstance(p, List):
+ if len(p.children) == 0:
+ cur_v += p.height + p.depth
+ else:
+ cur_v += p.height
+ cur_h = left_edge + p.shift_amount
+ save_v = cur_v
+ p.width = box.width
+ if isinstance(p, Hlist):
+ hlist_out(p)
+ elif isinstance(p, Vlist):
+ vlist_out(p)
+ else:
+ assert False, "unreachable code"
+ cur_v = save_v + p.depth
+ cur_h = left_edge
+ elif isinstance(p, Box):
+ rule_height = p.height
+ rule_depth = p.depth
+ rule_width = p.width
+ if np.isinf(rule_width):
+ rule_width = box.width
+ rule_height += rule_depth
+ if rule_height > 0 and rule_depth > 0:
+ cur_v += rule_height
+ p.render(output,
+ cur_h + off_h, cur_v + off_v,
+ rule_width, rule_height)
+ elif isinstance(p, Glue):
+ glue_spec = p.glue_spec
+ rule_height = glue_spec.width - cur_g
+ if glue_sign != 0: # normal
+ if glue_sign == 1: # stretching
+ if glue_spec.stretch_order == glue_order:
+ cur_glue += glue_spec.stretch
+ cur_g = round(clamp(box.glue_set * cur_glue))
+ elif glue_spec.shrink_order == glue_order: # shrinking
+ cur_glue += glue_spec.shrink
+ cur_g = round(clamp(box.glue_set * cur_glue))
+ rule_height += cur_g
+ cur_v += rule_height
+ elif isinstance(p, Char):
+ raise RuntimeError(
+ "Internal mathtext error: Char node found in vlist")
+
+ assert isinstance(box, Hlist)
+ hlist_out(box)
+ return output
+
+
+##############################################################################
+# PARSER
+
+
+def Error(msg: str) -> ParserElement:
+ """Helper class to raise parser errors."""
+ def raise_error(s: str, loc: int, toks: ParseResults) -> T.Any:
+ raise ParseFatalException(s, loc, msg)
+
+ return Empty().setParseAction(raise_error)
+
+
+class ParserState:
+ """
+ Parser state.
+
+ States are pushed and popped from a stack as necessary, and the "current"
+ state is always at the top of the stack.
+
+ Upon entering and leaving a group { } or math/non-math, the stack is pushed
+ and popped accordingly.
+ """
+
+ def __init__(self, fontset: Fonts, font: str, font_class: str, fontsize: float,
+ dpi: float):
+ self.fontset = fontset
+ self._font = font
+ self.font_class = font_class
+ self.fontsize = fontsize
+ self.dpi = dpi
+
+ def copy(self) -> ParserState:
+ return copy.copy(self)
+
+ @property
+ def font(self) -> str:
+ return self._font
+
+ @font.setter
+ def font(self, name: str) -> None:
+ if name in ('rm', 'it', 'bf', 'bfit'):
+ self.font_class = name
+ self._font = name
+
+ def get_current_underline_thickness(self) -> float:
+ """Return the underline thickness for this state."""
+ return self.fontset.get_underline_thickness(
+ self.font, self.fontsize, self.dpi)
+
+
+def cmd(expr: str, args: ParserElement) -> ParserElement:
+ r"""
+ Helper to define TeX commands.
+
+ ``cmd("\cmd", args)`` is equivalent to
+ ``"\cmd" - (args | Error("Expected \cmd{arg}{...}"))`` where the names in
+ the error message are taken from element names in *args*. If *expr*
+ already includes arguments (e.g. "\cmd{arg}{...}"), then they are stripped
+ when constructing the parse element, but kept (and *expr* is used as is) in
+ the error message.
+ """
+
+ def names(elt: ParserElement) -> T.Generator[str, None, None]:
+ if isinstance(elt, ParseExpression):
+ for expr in elt.exprs:
+ yield from names(expr)
+ elif elt.resultsName:
+ yield elt.resultsName
+
+ csname = expr.split("{", 1)[0]
+ err = (csname + "".join("{%s}" % name for name in names(args))
+ if expr == csname else expr)
+ return csname - (args | Error(f"Expected {err}"))
+
+
+class Parser:
+ """
+ A pyparsing-based parser for strings containing math expressions.
+
+ Raw text may also appear outside of pairs of ``$``.
+
+ The grammar is based directly on that in TeX, though it cuts a few corners.
+ """
+
+ class _MathStyle(enum.Enum):
+ DISPLAYSTYLE = 0
+ TEXTSTYLE = 1
+ SCRIPTSTYLE = 2
+ SCRIPTSCRIPTSTYLE = 3
+
+ _binary_operators = set(
+ '+ * - \N{MINUS SIGN}'
+ r'''
+ \pm \sqcap \rhd
+ \mp \sqcup \unlhd
+ \times \vee \unrhd
+ \div \wedge \oplus
+ \ast \setminus \ominus
+ \star \wr \otimes
+ \circ \diamond \oslash
+ \bullet \bigtriangleup \odot
+ \cdot \bigtriangledown \bigcirc
+ \cap \triangleleft \dagger
+ \cup \triangleright \ddagger
+ \uplus \lhd \amalg
+ \dotplus \dotminus \Cap
+ \Cup \barwedge \boxdot
+ \boxminus \boxplus \boxtimes
+ \curlyvee \curlywedge \divideontimes
+ \doublebarwedge \leftthreetimes \rightthreetimes
+ \slash \veebar \barvee
+ \cupdot \intercal \amalg
+ \circledcirc \circleddash \circledast
+ \boxbar \obar \merge
+ \minuscolon \dotsminusdots
+ '''.split())
+
+ _relation_symbols = set(r'''
+ = < > :
+ \leq \geq \equiv \models
+ \prec \succ \sim \perp
+ \preceq \succeq \simeq \mid
+ \ll \gg \asymp \parallel
+ \subset \supset \approx \bowtie
+ \subseteq \supseteq \cong \Join
+ \sqsubset \sqsupset \neq \smile
+ \sqsubseteq \sqsupseteq \doteq \frown
+ \in \ni \propto \vdash
+ \dashv \dots \doteqdot \leqq
+ \geqq \lneqq \gneqq \lessgtr
+ \leqslant \geqslant \eqgtr \eqless
+ \eqslantless \eqslantgtr \lesseqgtr \backsim
+ \backsimeq \lesssim \gtrsim \precsim
+ \precnsim \gnsim \lnsim \succsim
+ \succnsim \nsim \lesseqqgtr \gtreqqless
+ \gtreqless \subseteqq \supseteqq \subsetneqq
+ \supsetneqq \lessapprox \approxeq \gtrapprox
+ \precapprox \succapprox \precnapprox \succnapprox
+ \npreccurlyeq \nsucccurlyeq \nsqsubseteq \nsqsupseteq
+ \sqsubsetneq \sqsupsetneq \nlesssim \ngtrsim
+ \nlessgtr \ngtrless \lnapprox \gnapprox
+ \napprox \approxeq \approxident \lll
+ \ggg \nparallel \Vdash \Vvdash
+ \nVdash \nvdash \vDash \nvDash
+ \nVDash \oequal \simneqq \triangle
+ \triangleq \triangleeq \triangleleft
+ \triangleright \ntriangleleft \ntriangleright
+ \trianglelefteq \ntrianglelefteq \trianglerighteq
+ \ntrianglerighteq \blacktriangleleft \blacktriangleright
+ \equalparallel \measuredrightangle \varlrtriangle
+ \Doteq \Bumpeq \Subset \Supset
+ \backepsilon \because \therefore \bot
+ \top \bumpeq \circeq \coloneq
+ \curlyeqprec \curlyeqsucc \eqcirc \eqcolon
+ \eqsim \fallingdotseq \gtrdot \gtrless
+ \ltimes \rtimes \lessdot \ne
+ \ncong \nequiv \ngeq \ngtr
+ \nleq \nless \nmid \notin
+ \nprec \nsubset \nsubseteq \nsucc
+ \nsupset \nsupseteq \pitchfork \preccurlyeq
+ \risingdotseq \subsetneq \succcurlyeq \supsetneq
+ \varpropto \vartriangleleft \scurel
+ \vartriangleright \rightangle \equal \backcong
+ \eqdef \wedgeq \questeq \between
+ \veeeq \disin \varisins \isins
+ \isindot \varisinobar \isinobar \isinvb
+ \isinE \nisd \varnis \nis
+ \varniobar \niobar \bagmember \ratio
+ \Equiv \stareq \measeq \arceq
+ \rightassert \rightModels \smallin \smallowns
+ \notsmallowns \nsimeq'''.split())
+
+ _arrow_symbols = set(r"""
+ \leftarrow \longleftarrow \uparrow \Leftarrow \Longleftarrow
+ \Uparrow \rightarrow \longrightarrow \downarrow \Rightarrow
+ \Longrightarrow \Downarrow \leftrightarrow \updownarrow
+ \longleftrightarrow \updownarrow \Leftrightarrow
+ \Longleftrightarrow \Updownarrow \mapsto \longmapsto \nearrow
+ \hookleftarrow \hookrightarrow \searrow \leftharpoonup
+ \rightharpoonup \swarrow \leftharpoondown \rightharpoondown
+ \nwarrow \rightleftharpoons \leadsto \dashrightarrow
+ \dashleftarrow \leftleftarrows \leftrightarrows \Lleftarrow
+ \Rrightarrow \twoheadleftarrow \leftarrowtail \looparrowleft
+ \leftrightharpoons \curvearrowleft \circlearrowleft \Lsh
+ \upuparrows \upharpoonleft \downharpoonleft \multimap
+ \leftrightsquigarrow \rightrightarrows \rightleftarrows
+ \rightrightarrows \rightleftarrows \twoheadrightarrow
+ \rightarrowtail \looparrowright \rightleftharpoons
+ \curvearrowright \circlearrowright \Rsh \downdownarrows
+ \upharpoonright \downharpoonright \rightsquigarrow \nleftarrow
+ \nrightarrow \nLeftarrow \nRightarrow \nleftrightarrow
+ \nLeftrightarrow \to \Swarrow \Searrow \Nwarrow \Nearrow
+ \leftsquigarrow \overleftarrow \overleftrightarrow \cwopencirclearrow
+ \downzigzagarrow \cupleftarrow \rightzigzagarrow \twoheaddownarrow
+ \updownarrowbar \twoheaduparrow \rightarrowbar \updownarrows
+ \barleftarrow \mapsfrom \mapsdown \mapsup \Ldsh \Rdsh
+ """.split())
+
+ _spaced_symbols = _binary_operators | _relation_symbols | _arrow_symbols
+
+ _punctuation_symbols = set(r', ; . ! \ldotp \cdotp'.split())
+
+ _overunder_symbols = set(r'''
+ \sum \prod \coprod \bigcap \bigcup \bigsqcup \bigvee
+ \bigwedge \bigodot \bigotimes \bigoplus \biguplus
+ '''.split())
+
+ _overunder_functions = set("lim liminf limsup sup max min".split())
+
+ _dropsub_symbols = set(r'\int \oint \iint \oiint \iiint \oiiint \iiiint'.split())
+
+ _fontnames = set("rm cal it tt sf bf bfit "
+ "default bb frak scr regular".split())
+
+ _function_names = set("""
+ arccos csc ker min arcsin deg lg Pr arctan det lim sec arg dim
+ liminf sin cos exp limsup sinh cosh gcd ln sup cot hom log tan
+ coth inf max tanh""".split())
+
+ _ambi_delims = set(r"""
+ | \| / \backslash \uparrow \downarrow \updownarrow \Uparrow
+ \Downarrow \Updownarrow . \vert \Vert""".split())
+ _left_delims = set(r"""
+ ( [ \{ < \lfloor \langle \lceil \lbrace \leftbrace \lbrack \leftparen \lgroup
+ """.split())
+ _right_delims = set(r"""
+ ) ] \} > \rfloor \rangle \rceil \rbrace \rightbrace \rbrack \rightparen \rgroup
+ """.split())
+ _delims = _left_delims | _right_delims | _ambi_delims
+
+ _small_greek = set([unicodedata.name(chr(i)).split()[-1].lower() for i in
+ range(ord('\N{GREEK SMALL LETTER ALPHA}'),
+ ord('\N{GREEK SMALL LETTER OMEGA}') + 1)])
+ _latin_alphabets = set(string.ascii_letters)
+
+ def __init__(self) -> None:
+ p = types.SimpleNamespace()
+
+ def set_names_and_parse_actions() -> None:
+ for key, val in vars(p).items():
+ if not key.startswith('_'):
+ # Set names on (almost) everything -- very useful for debugging
+ # token, placeable, and auto_delim are forward references which
+ # are left without names to ensure useful error messages
+ if key not in ("token", "placeable", "auto_delim"):
+ val.setName(key)
+ # Set actions
+ if hasattr(self, key):
+ val.setParseAction(getattr(self, key))
+
+ # Root definitions.
+
+ # In TeX parlance, a csname is a control sequence name (a "\foo").
+ def csnames(group: str, names: Iterable[str]) -> Regex:
+ ends_with_alpha = []
+ ends_with_nonalpha = []
+ for name in names:
+ if name[-1].isalpha():
+ ends_with_alpha.append(name)
+ else:
+ ends_with_nonalpha.append(name)
+ return Regex(
+ r"\\(?P<{group}>(?:{alpha})(?![A-Za-z]){additional}{nonalpha})".format(
+ group=group,
+ alpha="|".join(map(re.escape, ends_with_alpha)),
+ additional="|" if ends_with_nonalpha else "",
+ nonalpha="|".join(map(re.escape, ends_with_nonalpha)),
+ )
+ )
+
+ p.float_literal = Regex(r"[-+]?([0-9]+\.?[0-9]*|\.[0-9]+)")
+ p.space = oneOf(self._space_widths)("space")
+
+ p.style_literal = oneOf(
+ [str(e.value) for e in self._MathStyle])("style_literal")
+
+ p.symbol = Regex(
+ r"[a-zA-Z0-9 +\-*/<>=:,.;!\?&'@()\[\]|\U00000080-\U0001ffff]"
+ r"|\\[%${}\[\]_|]"
+ + r"|\\(?:{})(?![A-Za-z])".format(
+ "|".join(map(re.escape, tex2uni)))
+ )("sym").leaveWhitespace()
+ p.unknown_symbol = Regex(r"\\[A-Za-z]+")("name")
+
+ p.font = csnames("font", self._fontnames)
+ p.start_group = Optional(r"\math" + oneOf(self._fontnames)("font")) + "{"
+ p.end_group = Literal("}")
+
+ p.delim = oneOf(self._delims)
+
+ # Mutually recursive definitions. (Minimizing the number of Forward
+ # elements is important for speed.)
+ p.auto_delim = Forward()
+ p.placeable = Forward()
+ p.named_placeable = Forward()
+ p.required_group = Forward()
+ p.optional_group = Forward()
+ p.token = Forward()
+
+ # Workaround for placable being part of a cycle of definitions
+ # calling `p.placeable("name")` results in a copy, so not guaranteed
+ # to get the definition added after it is used.
+ # ref https://github.com/matplotlib/matplotlib/issues/25204
+ # xref https://github.com/pyparsing/pyparsing/issues/95
+ p.named_placeable <<= p.placeable
+
+ set_names_and_parse_actions() # for mutually recursive definitions.
+
+ p.optional_group <<= "{" + ZeroOrMore(p.token)("group") + "}"
+ p.required_group <<= "{" + OneOrMore(p.token)("group") + "}"
+
+ p.customspace = cmd(r"\hspace", "{" + p.float_literal("space") + "}")
+
+ p.accent = (
+ csnames("accent", [*self._accent_map, *self._wide_accents])
+ - p.named_placeable("sym"))
+
+ p.function = csnames("name", self._function_names)
+
+ p.group = p.start_group + ZeroOrMore(p.token)("group") + p.end_group
+ p.unclosed_group = (p.start_group + ZeroOrMore(p.token)("group") + StringEnd())
+
+ p.frac = cmd(r"\frac", p.required_group("num") + p.required_group("den"))
+ p.dfrac = cmd(r"\dfrac", p.required_group("num") + p.required_group("den"))
+ p.binom = cmd(r"\binom", p.required_group("num") + p.required_group("den"))
+
+ p.genfrac = cmd(
+ r"\genfrac",
+ "{" + Optional(p.delim)("ldelim") + "}"
+ + "{" + Optional(p.delim)("rdelim") + "}"
+ + "{" + p.float_literal("rulesize") + "}"
+ + "{" + Optional(p.style_literal)("style") + "}"
+ + p.required_group("num")
+ + p.required_group("den"))
+
+ p.sqrt = cmd(
+ r"\sqrt{value}",
+ Optional("[" + OneOrMore(NotAny("]") + p.token)("root") + "]")
+ + p.required_group("value"))
+
+ p.overline = cmd(r"\overline", p.required_group("body"))
+
+ p.overset = cmd(
+ r"\overset",
+ p.optional_group("annotation") + p.optional_group("body"))
+ p.underset = cmd(
+ r"\underset",
+ p.optional_group("annotation") + p.optional_group("body"))
+
+ p.text = cmd(r"\text", QuotedString('{', '\\', endQuoteChar="}"))
+
+ p.substack = cmd(r"\substack",
+ nested_expr(opener="{", closer="}",
+ content=Group(OneOrMore(p.token)) +
+ ZeroOrMore(Literal("\\\\").suppress()))("parts"))
+
+ p.subsuper = (
+ (Optional(p.placeable)("nucleus")
+ + OneOrMore(oneOf(["_", "^"]) - p.placeable)("subsuper")
+ + Regex("'*")("apostrophes"))
+ | Regex("'+")("apostrophes")
+ | (p.named_placeable("nucleus") + Regex("'*")("apostrophes"))
+ )
+
+ p.simple = p.space | p.customspace | p.font | p.subsuper
+
+ p.token <<= (
+ p.simple
+ | p.auto_delim
+ | p.unclosed_group
+ | p.unknown_symbol # Must be last
+ )
+
+ p.operatorname = cmd(r"\operatorname", "{" + ZeroOrMore(p.simple)("name") + "}")
+
+ p.boldsymbol = cmd(
+ r"\boldsymbol", "{" + ZeroOrMore(p.simple)("value") + "}")
+
+ p.placeable <<= (
+ p.accent # Must be before symbol as all accents are symbols
+ | p.symbol # Must be second to catch all named symbols and single
+ # chars not in a group
+ | p.function
+ | p.operatorname
+ | p.group
+ | p.frac
+ | p.dfrac
+ | p.binom
+ | p.genfrac
+ | p.overset
+ | p.underset
+ | p.sqrt
+ | p.overline
+ | p.text
+ | p.boldsymbol
+ | p.substack
+ )
+
+ mdelim = r"\middle" - (p.delim("mdelim") | Error("Expected a delimiter"))
+ p.auto_delim <<= (
+ r"\left" - (p.delim("left") | Error("Expected a delimiter"))
+ + ZeroOrMore(p.simple | p.auto_delim | mdelim)("mid")
+ + r"\right" - (p.delim("right") | Error("Expected a delimiter"))
+ )
+
+ # Leaf definitions.
+ p.math = OneOrMore(p.token)
+ p.math_string = QuotedString('$', '\\', unquoteResults=False)
+ p.non_math = Regex(r"(?:(?:\\[$])|[^$])*").leaveWhitespace()
+ p.main = (
+ p.non_math + ZeroOrMore(p.math_string + p.non_math) + StringEnd()
+ )
+ set_names_and_parse_actions() # for leaf definitions.
+
+ self._expression = p.main
+ self._math_expression = p.math
+
+ # To add space to nucleus operators after sub/superscripts
+ self._in_subscript_or_superscript = False
+
+ def parse(self, s: str, fonts_object: Fonts, fontsize: float, dpi: float) -> Hlist:
+ """
+ Parse expression *s* using the given *fonts_object* for
+ output, at the given *fontsize* and *dpi*.
+
+ Returns the parse tree of `Node` instances.
+ """
+ self._state_stack = [
+ ParserState(fonts_object, 'default', 'rm', fontsize, dpi)]
+ self._em_width_cache: dict[tuple[str, float, float], float] = {}
+ try:
+ result = self._expression.parseString(s)
+ except ParseBaseException as err:
+ # explain becomes a plain method on pyparsing 3 (err.explain(0)).
+ raise ValueError("\n" + ParseException.explain(err, 0)) from None
+ self._state_stack = []
+ self._in_subscript_or_superscript = False
+ # prevent operator spacing from leaking into a new expression
+ self._em_width_cache = {}
+ ParserElement.resetCache()
+ return T.cast(Hlist, result[0]) # Known return type from main.
+
+ def get_state(self) -> ParserState:
+ """Get the current `State` of the parser."""
+ return self._state_stack[-1]
+
+ def pop_state(self) -> None:
+ """Pop a `State` off of the stack."""
+ self._state_stack.pop()
+
+ def push_state(self) -> None:
+ """Push a new `State` onto the stack, copying the current state."""
+ self._state_stack.append(self.get_state().copy())
+
+ def main(self, toks: ParseResults) -> list[Hlist]:
+ return [Hlist(toks.asList())]
+
+ def math_string(self, toks: ParseResults) -> ParseResults:
+ return self._math_expression.parseString(toks[0][1:-1], parseAll=True)
+
+ def math(self, toks: ParseResults) -> T.Any:
+ hlist = Hlist(toks.asList())
+ self.pop_state()
+ return [hlist]
+
+ def non_math(self, toks: ParseResults) -> T.Any:
+ s = toks[0].replace(r'\$', '$')
+ symbols = [Char(c, self.get_state()) for c in s]
+ hlist = Hlist(symbols)
+ # We're going into math now, so set font to 'it'
+ self.push_state()
+ self.get_state().font = mpl.rcParams['mathtext.default']
+ return [hlist]
+
+ float_literal = staticmethod(pyparsing_common.convertToFloat)
+
+ def text(self, toks: ParseResults) -> T.Any:
+ self.push_state()
+ state = self.get_state()
+ state.font = 'rm'
+ hlist = Hlist([Char(c, state) for c in toks[1]])
+ self.pop_state()
+ return [hlist]
+
+ def _make_space(self, percentage: float) -> Kern:
+ # In TeX, an em (the unit usually used to measure horizontal lengths)
+ # is not the width of the character 'm'; it is the same in different
+ # font styles (e.g. roman or italic). Mathtext, however, uses 'm' in
+ # the italic style so that horizontal spaces don't depend on the
+ # current font style.
+ state = self.get_state()
+ key = (state.font, state.fontsize, state.dpi)
+ width = self._em_width_cache.get(key)
+ if width is None:
+ metrics = state.fontset.get_metrics(
+ 'it', mpl.rcParams['mathtext.default'], 'm',
+ state.fontsize, state.dpi)
+ width = metrics.advance
+ self._em_width_cache[key] = width
+ return Kern(width * percentage)
+
+ _space_widths = {
+ r'\,': 0.16667, # 3/18 em = 3 mu
+ r'\thinspace': 0.16667, # 3/18 em = 3 mu
+ r'\/': 0.16667, # 3/18 em = 3 mu
+ r'\>': 0.22222, # 4/18 em = 4 mu
+ r'\:': 0.22222, # 4/18 em = 4 mu
+ r'\;': 0.27778, # 5/18 em = 5 mu
+ r'\ ': 0.33333, # 6/18 em = 6 mu
+ r'~': 0.33333, # 6/18 em = 6 mu, nonbreakable
+ r'\enspace': 0.5, # 9/18 em = 9 mu
+ r'\quad': 1, # 1 em = 18 mu
+ r'\qquad': 2, # 2 em = 36 mu
+ r'\!': -0.16667, # -3/18 em = -3 mu
+ }
+
+ def space(self, toks: ParseResults) -> T.Any:
+ num = self._space_widths[toks["space"]]
+ box = self._make_space(num)
+ return [box]
+
+ def customspace(self, toks: ParseResults) -> T.Any:
+ return [self._make_space(toks["space"])]
+
+ def symbol(self, s: str, loc: int,
+ toks: ParseResults | dict[str, str]) -> T.Any:
+ c = toks["sym"]
+ if c == "-":
+ # "U+2212 minus sign is the preferred representation of the unary
+ # and binary minus sign rather than the ASCII-derived U+002D
+ # hyphen-minus, because minus sign is unambiguous and because it
+ # is rendered with a more desirable length, usually longer than a
+ # hyphen." (https://www.unicode.org/reports/tr25/)
+ c = "\N{MINUS SIGN}"
+ try:
+ char = Char(c, self.get_state())
+ except ValueError as err:
+ raise ParseFatalException(s, loc,
+ "Unknown symbol: %s" % c) from err
+
+ if c in self._spaced_symbols:
+ # iterate until we find previous character, needed for cases
+ # such as $=-2$, ${ -2}$, $ -2$, or $ -2$.
+ prev_char = next((c for c in s[:loc][::-1] if c != ' '), '')
+ # Binary operators at start of string should not be spaced
+ # Also, operators in sub- or superscripts should not be spaced
+ if (self._in_subscript_or_superscript or (
+ c in self._binary_operators and (
+ len(s[:loc].split()) == 0 or prev_char in {
+ '{', *self._left_delims, *self._relation_symbols}))):
+ return [char]
+ else:
+ return [Hlist([self._make_space(0.2),
+ char,
+ self._make_space(0.2)],
+ do_kern=True)]
+ elif c in self._punctuation_symbols:
+ prev_char = next((c for c in s[:loc][::-1] if c != ' '), '')
+ next_char = next((c for c in s[loc + 1:] if c != ' '), '')
+
+ # Do not space commas between brackets
+ if c == ',':
+ if prev_char == '{' and next_char == '}':
+ return [char]
+
+ # Do not space dots as decimal separators
+ if c == '.' and prev_char.isdigit() and next_char.isdigit():
+ return [char]
+ else:
+ return [Hlist([char, self._make_space(0.2)], do_kern=True)]
+ return [char]
+
+ def unknown_symbol(self, s: str, loc: int, toks: ParseResults) -> T.Any:
+ raise ParseFatalException(s, loc, f"Unknown symbol: {toks['name']}")
+
+ _accent_map = {
+ r'hat': r'\circumflexaccent',
+ r'breve': r'\combiningbreve',
+ r'bar': r'\combiningoverline',
+ r'grave': r'\combininggraveaccent',
+ r'acute': r'\combiningacuteaccent',
+ r'tilde': r'\combiningtilde',
+ r'dot': r'\combiningdotabove',
+ r'ddot': r'\combiningdiaeresis',
+ r'dddot': r'\combiningthreedotsabove',
+ r'ddddot': r'\combiningfourdotsabove',
+ r'vec': r'\combiningrightarrowabove',
+ r'"': r'\combiningdiaeresis',
+ r"`": r'\combininggraveaccent',
+ r"'": r'\combiningacuteaccent',
+ r'~': r'\combiningtilde',
+ r'.': r'\combiningdotabove',
+ r'^': r'\circumflexaccent',
+ r'overrightarrow': r'\rightarrow',
+ r'overleftarrow': r'\leftarrow',
+ r'mathring': r'\circ',
+ }
+
+ _wide_accents = set(r"widehat widetilde widebar".split())
+
+ def accent(self, toks: ParseResults) -> T.Any:
+ state = self.get_state()
+ thickness = state.get_current_underline_thickness()
+ accent = toks["accent"]
+ sym = toks["sym"]
+ accent_box: Node
+ if accent in self._wide_accents:
+ accent_box = AutoWidthChar(
+ '\\' + accent, sym.width, state, char_class=Accent)
+ else:
+ accent_box = Accent(self._accent_map[accent], state)
+ if accent == 'mathring':
+ accent_box.shrink()
+ accent_box.shrink()
+ centered = HCentered([Hbox(sym.width / 4.0), accent_box])
+ centered.hpack(sym.width, 'exactly')
+ return Vlist([
+ centered,
+ Vbox(0., thickness * 2.0),
+ Hlist([sym])
+ ])
+
+ def function(self, s: str, loc: int, toks: ParseResults) -> T.Any:
+ hlist = self.operatorname(s, loc, toks)
+ hlist.function_name = toks["name"]
+ return hlist
+
+ def operatorname(self, s: str, loc: int, toks: ParseResults) -> T.Any:
+ self.push_state()
+ state = self.get_state()
+ state.font = 'rm'
+ hlist_list: list[Node] = []
+ # Change the font of Chars, but leave Kerns alone
+ name = toks["name"]
+ for c in name:
+ if isinstance(c, Char):
+ c.font = 'rm'
+ c._update_metrics()
+ hlist_list.append(c)
+ elif isinstance(c, str):
+ hlist_list.append(Char(c, state))
+ else:
+ hlist_list.append(c)
+ next_char_loc = loc + len(name) + 1
+ if isinstance(name, ParseResults):
+ next_char_loc += len('operatorname{}')
+ next_char = next((c for c in s[next_char_loc:] if c != ' '), '')
+ delimiters = self._delims | {'^', '_'}
+ if (next_char not in delimiters and
+ name not in self._overunder_functions):
+ # Add thin space except when followed by parenthesis, bracket, etc.
+ hlist_list += [self._make_space(self._space_widths[r'\,'])]
+ self.pop_state()
+ # if followed by a super/subscript, set flag to true
+ # This flag tells subsuper to add space after this operator
+ if next_char in {'^', '_'}:
+ self._in_subscript_or_superscript = True
+ else:
+ self._in_subscript_or_superscript = False
+
+ return Hlist(hlist_list)
+
+ def start_group(self, toks: ParseResults) -> T.Any:
+ self.push_state()
+ # Deal with LaTeX-style font tokens
+ if toks.get("font"):
+ self.get_state().font = toks.get("font")
+ return []
+
+ def group(self, toks: ParseResults) -> T.Any:
+ grp = Hlist(toks.get("group", []))
+ return [grp]
+
+ def required_group(self, toks: ParseResults) -> T.Any:
+ return Hlist(toks.get("group", []))
+
+ optional_group = required_group
+
+ def end_group(self) -> T.Any:
+ self.pop_state()
+ return []
+
+ def unclosed_group(self, s: str, loc: int, toks: ParseResults) -> T.Any:
+ raise ParseFatalException(s, len(s), "Expected '}'")
+
+ def font(self, toks: ParseResults) -> T.Any:
+ self.get_state().font = toks["font"]
+ return []
+
+ def is_overunder(self, nucleus: Node) -> bool:
+ if isinstance(nucleus, Char):
+ return nucleus.c in self._overunder_symbols
+ elif isinstance(nucleus, Hlist) and hasattr(nucleus, 'function_name'):
+ return nucleus.function_name in self._overunder_functions
+ return False
+
+ def is_dropsub(self, nucleus: Node) -> bool:
+ if isinstance(nucleus, Char):
+ return nucleus.c in self._dropsub_symbols
+ return False
+
+ def is_slanted(self, nucleus: Node) -> bool:
+ if isinstance(nucleus, Char):
+ return nucleus.is_slanted()
+ return False
+
+ def subsuper(self, s: str, loc: int, toks: ParseResults) -> T.Any:
+ nucleus = toks.get("nucleus", Hbox(0))
+ subsuper = toks.get("subsuper", [])
+ napostrophes = len(toks.get("apostrophes", []))
+
+ if not subsuper and not napostrophes:
+ return nucleus
+
+ sub = super = None
+ while subsuper:
+ op, arg, *subsuper = subsuper
+ if op == '_':
+ if sub is not None:
+ raise ParseFatalException("Double subscript")
+ sub = arg
+ else:
+ if super is not None:
+ raise ParseFatalException("Double superscript")
+ super = arg
+
+ state = self.get_state()
+ rule_thickness = state.fontset.get_underline_thickness(
+ state.font, state.fontsize, state.dpi)
+ xHeight = state.fontset.get_xheight(
+ state.font, state.fontsize, state.dpi)
+
+ if napostrophes:
+ if super is None:
+ super = Hlist([])
+ for i in range(napostrophes):
+ super.children.extend(self.symbol(s, loc, {"sym": "\\prime"}))
+ # kern() and hpack() needed to get the metrics right after
+ # extending
+ super.kern()
+ super.hpack()
+
+ # Handle over/under symbols, such as sum or prod
+ if self.is_overunder(nucleus):
+ vlist = []
+ shift = 0.
+ width = nucleus.width
+ if super is not None:
+ super.shrink()
+ width = max(width, super.width)
+ if sub is not None:
+ sub.shrink()
+ width = max(width, sub.width)
+
+ vgap = rule_thickness * 3.0
+ if super is not None:
+ hlist = HCentered([super])
+ hlist.hpack(width, 'exactly')
+ vlist.extend([hlist, Vbox(0, vgap)])
+ hlist = HCentered([nucleus])
+ hlist.hpack(width, 'exactly')
+ vlist.append(hlist)
+ if sub is not None:
+ hlist = HCentered([sub])
+ hlist.hpack(width, 'exactly')
+ vlist.extend([Vbox(0, vgap), hlist])
+ shift = hlist.height + vgap + nucleus.depth
+ vlt = Vlist(vlist)
+ vlt.shift_amount = shift
+ result = Hlist([vlt])
+ return [result]
+
+ # We remove kerning on the last character for consistency (otherwise
+ # it will compute kerning based on non-shrunk characters and may put
+ # them too close together when superscripted)
+ # We change the width of the last character to match the advance to
+ # consider some fonts with weird metrics: e.g. stix's f has a width of
+ # 7.75 and a kerning of -4.0 for an advance of 3.72, and we want to put
+ # the superscript at the advance
+ last_char = nucleus
+ if isinstance(nucleus, Hlist):
+ new_children = nucleus.children
+ if len(new_children):
+ # remove last kern
+ if (isinstance(new_children[-1], Kern) and
+ hasattr(new_children[-2], '_metrics')):
+ new_children = new_children[:-1]
+ last_char = new_children[-1]
+ if hasattr(last_char, '_metrics'):
+ last_char.width = last_char._metrics.advance
+ # create new Hlist without kerning
+ nucleus = Hlist(new_children, do_kern=False)
+ else:
+ if isinstance(nucleus, Char):
+ last_char.width = last_char._metrics.advance
+ nucleus = Hlist([nucleus])
+
+ # Handle regular sub/superscripts
+ constants = _get_font_constant_set(state)
+ lc_height = last_char.height
+ lc_baseline = 0
+ if self.is_dropsub(last_char):
+ lc_baseline = last_char.depth
+
+ # Compute kerning for sub and super
+ superkern = constants.delta * xHeight
+ subkern = constants.delta * xHeight
+ if self.is_slanted(last_char):
+ superkern += constants.delta * xHeight
+ superkern += (constants.delta_slanted *
+ (lc_height - xHeight * 2. / 3.))
+ if self.is_dropsub(last_char):
+ subkern = (3 * constants.delta -
+ constants.delta_integral) * lc_height
+ superkern = (3 * constants.delta +
+ constants.delta_integral) * lc_height
+ else:
+ subkern = 0
+
+ x: List
+ if super is None:
+ # node757
+ # Note: One of super or sub must be a Node if we're in this function, but
+ # mypy can't know this, since it can't interpret pyparsing expressions,
+ # hence the cast.
+ x = Hlist([Kern(subkern), T.cast(Node, sub)])
+ x.shrink()
+ if self.is_dropsub(last_char):
+ shift_down = lc_baseline + constants.subdrop * xHeight
+ else:
+ shift_down = constants.sub1 * xHeight
+ x.shift_amount = shift_down
+ else:
+ x = Hlist([Kern(superkern), super])
+ x.shrink()
+ if self.is_dropsub(last_char):
+ shift_up = lc_height - constants.subdrop * xHeight
+ else:
+ shift_up = constants.sup1 * xHeight
+ if sub is None:
+ x.shift_amount = -shift_up
+ else: # Both sub and superscript
+ y = Hlist([Kern(subkern), sub])
+ y.shrink()
+ if self.is_dropsub(last_char):
+ shift_down = lc_baseline + constants.subdrop * xHeight
+ else:
+ shift_down = constants.sub2 * xHeight
+ # If sub and superscript collide, move super up
+ clr = (2.0 * rule_thickness -
+ ((shift_up - x.depth) - (y.height - shift_down)))
+ if clr > 0.:
+ shift_up += clr
+ x = Vlist([
+ x,
+ Kern((shift_up - x.depth) - (y.height - shift_down)),
+ y])
+ x.shift_amount = shift_down
+
+ if not self.is_dropsub(last_char):
+ x.width += constants.script_space * xHeight
+
+ # Do we need to add a space after the nucleus?
+ # To find out, check the flag set by operatorname
+ spaced_nucleus = [nucleus, x]
+ if self._in_subscript_or_superscript:
+ spaced_nucleus += [self._make_space(self._space_widths[r'\,'])]
+ self._in_subscript_or_superscript = False
+
+ result = Hlist(spaced_nucleus)
+ return [result]
+
+ def _genfrac(self, ldelim: str, rdelim: str, rule: float | None, style: _MathStyle,
+ num: Hlist, den: Hlist) -> T.Any:
+ state = self.get_state()
+ thickness = state.get_current_underline_thickness()
+
+ for _ in range(style.value):
+ num.shrink()
+ den.shrink()
+ cnum = HCentered([num])
+ cden = HCentered([den])
+ width = max(num.width, den.width)
+ cnum.hpack(width, 'exactly')
+ cden.hpack(width, 'exactly')
+ vlist = Vlist([cnum, # numerator
+ Vbox(0, thickness * 2.0), # space
+ Hrule(state, rule), # rule
+ Vbox(0, thickness * 2.0), # space
+ cden # denominator
+ ])
+
+ # Shift so the fraction line sits in the middle of the
+ # equals sign
+ metrics = state.fontset.get_metrics(
+ state.font, mpl.rcParams['mathtext.default'],
+ '=', state.fontsize, state.dpi)
+ shift = (cden.height -
+ ((metrics.ymax + metrics.ymin) / 2 -
+ thickness * 3.0))
+ vlist.shift_amount = shift
+
+ result = [Hlist([vlist, Hbox(thickness * 2.)])]
+ if ldelim or rdelim:
+ if ldelim == '':
+ ldelim = '.'
+ if rdelim == '':
+ rdelim = '.'
+ return self._auto_sized_delimiter(ldelim,
+ T.cast(list[Box | Char | str],
+ result),
+ rdelim)
+ return result
+
+ def style_literal(self, toks: ParseResults) -> T.Any:
+ return self._MathStyle(int(toks["style_literal"]))
+
+ def genfrac(self, toks: ParseResults) -> T.Any:
+ return self._genfrac(
+ toks.get("ldelim", ""), toks.get("rdelim", ""),
+ toks["rulesize"], toks.get("style", self._MathStyle.TEXTSTYLE),
+ toks["num"], toks["den"])
+
+ def frac(self, toks: ParseResults) -> T.Any:
+ return self._genfrac(
+ "", "", self.get_state().get_current_underline_thickness(),
+ self._MathStyle.TEXTSTYLE, toks["num"], toks["den"])
+
+ def dfrac(self, toks: ParseResults) -> T.Any:
+ return self._genfrac(
+ "", "", self.get_state().get_current_underline_thickness(),
+ self._MathStyle.DISPLAYSTYLE, toks["num"], toks["den"])
+
+ def binom(self, toks: ParseResults) -> T.Any:
+ return self._genfrac(
+ "(", ")", 0,
+ self._MathStyle.TEXTSTYLE, toks["num"], toks["den"])
+
+ def _genset(self, s: str, loc: int, toks: ParseResults) -> T.Any:
+ annotation = toks["annotation"]
+ body = toks["body"]
+ thickness = self.get_state().get_current_underline_thickness()
+
+ annotation.shrink()
+ centered_annotation = HCentered([annotation])
+ centered_body = HCentered([body])
+ width = max(centered_annotation.width, centered_body.width)
+ centered_annotation.hpack(width, 'exactly')
+ centered_body.hpack(width, 'exactly')
+
+ vgap = thickness * 3
+ if s[loc + 1] == "u": # \underset
+ vlist = Vlist([
+ centered_body, # body
+ Vbox(0, vgap), # space
+ centered_annotation # annotation
+ ])
+ # Shift so the body sits in the same vertical position
+ vlist.shift_amount = centered_body.depth + centered_annotation.height + vgap
+ else: # \overset
+ vlist = Vlist([
+ centered_annotation, # annotation
+ Vbox(0, vgap), # space
+ centered_body # body
+ ])
+
+ # To add horizontal gap between symbols: wrap the Vlist into
+ # an Hlist and extend it with an Hbox(0, horizontal_gap)
+ return vlist
+
+ overset = underset = _genset
+
+ def sqrt(self, toks: ParseResults) -> T.Any:
+ root = toks.get("root")
+ body = toks["value"]
+ state = self.get_state()
+ thickness = state.get_current_underline_thickness()
+
+ # Determine the height of the body, and add a little extra to
+ # the height so it doesn't seem cramped
+ height = body.height - body.shift_amount + thickness * 5.0
+ depth = body.depth + body.shift_amount
+ check = AutoHeightChar(r'\__sqrt__', height, depth, state, always=True)
+ height = check.height - check.shift_amount
+ depth = check.depth + check.shift_amount
+
+ # Put a little extra space to the left and right of the body
+ padded_body = Hlist([Hbox(2 * thickness), body, Hbox(2 * thickness)])
+ rightside = Vlist([Hrule(state), Glue('fill'), padded_body])
+ # Stretch the glue between the hrule and the body
+ rightside.vpack(height + (state.fontsize * state.dpi) / (100.0 * 12.0),
+ 'exactly', depth)
+
+ # Add the root and shift it upward so it is above the tick.
+ # The value of 0.6 is a hard-coded hack ;)
+ if not root:
+ root = Box(check.width * 0.5, 0., 0.)
+ else:
+ root = Hlist(root)
+ root.shrink()
+ root.shrink()
+
+ root_vlist = Vlist([Hlist([root])])
+ root_vlist.shift_amount = -height * 0.6
+
+ hlist = Hlist([root_vlist, # Root
+ # Negative kerning to put root over tick
+ Kern(-check.width * 0.5),
+ check, # Check
+ rightside]) # Body
+ return [hlist]
+
+ def overline(self, toks: ParseResults) -> T.Any:
+ body = toks["body"]
+
+ state = self.get_state()
+ thickness = state.get_current_underline_thickness()
+
+ height = body.height - body.shift_amount + thickness * 3.0
+ depth = body.depth + body.shift_amount
+
+ # Place overline above body
+ rightside = Vlist([Hrule(state), Glue('fill'), Hlist([body])])
+
+ # Stretch the glue between the hrule and the body
+ rightside.vpack(height + (state.fontsize * state.dpi) / (100.0 * 12.0),
+ 'exactly', depth)
+
+ hlist = Hlist([rightside])
+ return [hlist]
+
+ def _auto_sized_delimiter(self, front: str,
+ middle: list[Box | Char | str],
+ back: str) -> T.Any:
+ state = self.get_state()
+ if len(middle):
+ height = max([x.height for x in middle if not isinstance(x, str)])
+ depth = max([x.depth for x in middle if not isinstance(x, str)])
+ factor = None
+ for idx, el in enumerate(middle):
+ if el == r'\middle':
+ c = T.cast(str, middle[idx + 1]) # Should be one of p.delims.
+ if c != '.':
+ middle[idx + 1] = AutoHeightChar(
+ c, height, depth, state, factor=factor)
+ else:
+ middle.remove(c)
+ del middle[idx]
+ # There should only be \middle and its delimiter as str, which have
+ # just been removed.
+ middle_part = T.cast(list[Box | Char], middle)
+ else:
+ height = 0
+ depth = 0
+ factor = 1.0
+ middle_part = []
+
+ parts: list[Node] = []
+ # \left. and \right. aren't supposed to produce any symbols
+ if front != '.':
+ parts.append(
+ AutoHeightChar(front, height, depth, state, factor=factor))
+ parts.extend(middle_part)
+ if back != '.':
+ parts.append(
+ AutoHeightChar(back, height, depth, state, factor=factor))
+ hlist = Hlist(parts)
+ return hlist
+
+ def auto_delim(self, toks: ParseResults) -> T.Any:
+ return self._auto_sized_delimiter(
+ toks["left"],
+ # if "mid" in toks ... can be removed when requiring pyparsing 3.
+ toks["mid"].asList() if "mid" in toks else [],
+ toks["right"])
+
+ def boldsymbol(self, toks: ParseResults) -> T.Any:
+ self.push_state()
+ state = self.get_state()
+ hlist: list[Node] = []
+ name = toks["value"]
+ for c in name:
+ if isinstance(c, Hlist):
+ k = c.children[1]
+ if isinstance(k, Char):
+ k.font = "bf"
+ k._update_metrics()
+ hlist.append(c)
+ elif isinstance(c, Char):
+ c.font = "bf"
+ if (c.c in self._latin_alphabets or
+ c.c[1:] in self._small_greek):
+ c.font = "bfit"
+ c._update_metrics()
+ c._update_metrics()
+ hlist.append(c)
+ else:
+ hlist.append(c)
+ self.pop_state()
+
+ return Hlist(hlist)
+
+ def substack(self, toks: ParseResults) -> T.Any:
+ parts = toks["parts"]
+ state = self.get_state()
+ thickness = state.get_current_underline_thickness()
+
+ hlist = [Hlist(k) for k in parts[0]]
+ max_width = max(map(lambda c: c.width, hlist))
+
+ vlist = []
+ for sub in hlist:
+ cp = HCentered([sub])
+ cp.hpack(max_width, 'exactly')
+ vlist.append(cp)
+
+ stack = [val
+ for pair in zip(vlist, [Vbox(0, thickness * 2)] * len(vlist))
+ for val in pair]
+ del stack[-1]
+ vlt = Vlist(stack)
+ result = [Hlist([vlt])]
+ return result
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_mathtext_data.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_mathtext_data.py
new file mode 100644
index 0000000000000000000000000000000000000000..5819ee7430447f9ef5f6e760b65cdd5933ef9395
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_mathtext_data.py
@@ -0,0 +1,1742 @@
+"""
+font data tables for truetype and afm computer modern fonts
+"""
+
+from __future__ import annotations
+from typing import overload
+
+latex_to_bakoma = {
+ '\\__sqrt__' : ('cmex10', 0x70),
+ '\\bigcap' : ('cmex10', 0x5c),
+ '\\bigcup' : ('cmex10', 0x5b),
+ '\\bigodot' : ('cmex10', 0x4b),
+ '\\bigoplus' : ('cmex10', 0x4d),
+ '\\bigotimes' : ('cmex10', 0x4f),
+ '\\biguplus' : ('cmex10', 0x5d),
+ '\\bigvee' : ('cmex10', 0x5f),
+ '\\bigwedge' : ('cmex10', 0x5e),
+ '\\coprod' : ('cmex10', 0x61),
+ '\\int' : ('cmex10', 0x5a),
+ '\\langle' : ('cmex10', 0xad),
+ '\\leftangle' : ('cmex10', 0xad),
+ '\\leftbrace' : ('cmex10', 0xa9),
+ '\\oint' : ('cmex10', 0x49),
+ '\\prod' : ('cmex10', 0x59),
+ '\\rangle' : ('cmex10', 0xae),
+ '\\rightangle' : ('cmex10', 0xae),
+ '\\rightbrace' : ('cmex10', 0xaa),
+ '\\sum' : ('cmex10', 0x58),
+ '\\widehat' : ('cmex10', 0x62),
+ '\\widetilde' : ('cmex10', 0x65),
+ '\\{' : ('cmex10', 0xa9),
+ '\\}' : ('cmex10', 0xaa),
+ '{' : ('cmex10', 0xa9),
+ '}' : ('cmex10', 0xaa),
+
+ ',' : ('cmmi10', 0x3b),
+ '.' : ('cmmi10', 0x3a),
+ '/' : ('cmmi10', 0x3d),
+ '<' : ('cmmi10', 0x3c),
+ '>' : ('cmmi10', 0x3e),
+ '\\alpha' : ('cmmi10', 0xae),
+ '\\beta' : ('cmmi10', 0xaf),
+ '\\chi' : ('cmmi10', 0xc2),
+ '\\combiningrightarrowabove' : ('cmmi10', 0x7e),
+ '\\delta' : ('cmmi10', 0xb1),
+ '\\ell' : ('cmmi10', 0x60),
+ '\\epsilon' : ('cmmi10', 0xb2),
+ '\\eta' : ('cmmi10', 0xb4),
+ '\\flat' : ('cmmi10', 0x5b),
+ '\\frown' : ('cmmi10', 0x5f),
+ '\\gamma' : ('cmmi10', 0xb0),
+ '\\imath' : ('cmmi10', 0x7b),
+ '\\iota' : ('cmmi10', 0xb6),
+ '\\jmath' : ('cmmi10', 0x7c),
+ '\\kappa' : ('cmmi10', 0x2219),
+ '\\lambda' : ('cmmi10', 0xb8),
+ '\\leftharpoondown' : ('cmmi10', 0x29),
+ '\\leftharpoonup' : ('cmmi10', 0x28),
+ '\\mu' : ('cmmi10', 0xb9),
+ '\\natural' : ('cmmi10', 0x5c),
+ '\\nu' : ('cmmi10', 0xba),
+ '\\omega' : ('cmmi10', 0x21),
+ '\\phi' : ('cmmi10', 0xc1),
+ '\\pi' : ('cmmi10', 0xbc),
+ '\\psi' : ('cmmi10', 0xc3),
+ '\\rho' : ('cmmi10', 0xbd),
+ '\\rightharpoondown' : ('cmmi10', 0x2b),
+ '\\rightharpoonup' : ('cmmi10', 0x2a),
+ '\\sharp' : ('cmmi10', 0x5d),
+ '\\sigma' : ('cmmi10', 0xbe),
+ '\\smile' : ('cmmi10', 0x5e),
+ '\\tau' : ('cmmi10', 0xbf),
+ '\\theta' : ('cmmi10', 0xb5),
+ '\\triangleleft' : ('cmmi10', 0x2f),
+ '\\triangleright' : ('cmmi10', 0x2e),
+ '\\upsilon' : ('cmmi10', 0xc0),
+ '\\varepsilon' : ('cmmi10', 0x22),
+ '\\varphi' : ('cmmi10', 0x27),
+ '\\varrho' : ('cmmi10', 0x25),
+ '\\varsigma' : ('cmmi10', 0x26),
+ '\\vartheta' : ('cmmi10', 0x23),
+ '\\wp' : ('cmmi10', 0x7d),
+ '\\xi' : ('cmmi10', 0xbb),
+ '\\zeta' : ('cmmi10', 0xb3),
+
+ '!' : ('cmr10', 0x21),
+ '%' : ('cmr10', 0x25),
+ '&' : ('cmr10', 0x26),
+ '(' : ('cmr10', 0x28),
+ ')' : ('cmr10', 0x29),
+ '+' : ('cmr10', 0x2b),
+ '0' : ('cmr10', 0x30),
+ '1' : ('cmr10', 0x31),
+ '2' : ('cmr10', 0x32),
+ '3' : ('cmr10', 0x33),
+ '4' : ('cmr10', 0x34),
+ '5' : ('cmr10', 0x35),
+ '6' : ('cmr10', 0x36),
+ '7' : ('cmr10', 0x37),
+ '8' : ('cmr10', 0x38),
+ '9' : ('cmr10', 0x39),
+ ':' : ('cmr10', 0x3a),
+ ';' : ('cmr10', 0x3b),
+ '=' : ('cmr10', 0x3d),
+ '?' : ('cmr10', 0x3f),
+ '@' : ('cmr10', 0x40),
+ '[' : ('cmr10', 0x5b),
+ '\\#' : ('cmr10', 0x23),
+ '\\$' : ('cmr10', 0x24),
+ '\\%' : ('cmr10', 0x25),
+ '\\Delta' : ('cmr10', 0xa2),
+ '\\Gamma' : ('cmr10', 0xa1),
+ '\\Lambda' : ('cmr10', 0xa4),
+ '\\Omega' : ('cmr10', 0xad),
+ '\\Phi' : ('cmr10', 0xa9),
+ '\\Pi' : ('cmr10', 0xa6),
+ '\\Psi' : ('cmr10', 0xaa),
+ '\\Sigma' : ('cmr10', 0xa7),
+ '\\Theta' : ('cmr10', 0xa3),
+ '\\Upsilon' : ('cmr10', 0xa8),
+ '\\Xi' : ('cmr10', 0xa5),
+ '\\circumflexaccent' : ('cmr10', 0x5e),
+ '\\combiningacuteaccent' : ('cmr10', 0xb6),
+ '\\combiningbreve' : ('cmr10', 0xb8),
+ '\\combiningdiaeresis' : ('cmr10', 0xc4),
+ '\\combiningdotabove' : ('cmr10', 0x5f),
+ '\\combininggraveaccent' : ('cmr10', 0xb5),
+ '\\combiningoverline' : ('cmr10', 0xb9),
+ '\\combiningtilde' : ('cmr10', 0x7e),
+ '\\leftbracket' : ('cmr10', 0x5b),
+ '\\leftparen' : ('cmr10', 0x28),
+ '\\rightbracket' : ('cmr10', 0x5d),
+ '\\rightparen' : ('cmr10', 0x29),
+ '\\widebar' : ('cmr10', 0xb9),
+ ']' : ('cmr10', 0x5d),
+
+ '*' : ('cmsy10', 0xa4),
+ '\N{MINUS SIGN}' : ('cmsy10', 0xa1),
+ '\\Downarrow' : ('cmsy10', 0x2b),
+ '\\Im' : ('cmsy10', 0x3d),
+ '\\Leftarrow' : ('cmsy10', 0x28),
+ '\\Leftrightarrow' : ('cmsy10', 0x2c),
+ '\\P' : ('cmsy10', 0x7b),
+ '\\Re' : ('cmsy10', 0x3c),
+ '\\Rightarrow' : ('cmsy10', 0x29),
+ '\\S' : ('cmsy10', 0x78),
+ '\\Uparrow' : ('cmsy10', 0x2a),
+ '\\Updownarrow' : ('cmsy10', 0x6d),
+ '\\Vert' : ('cmsy10', 0x6b),
+ '\\aleph' : ('cmsy10', 0x40),
+ '\\approx' : ('cmsy10', 0xbc),
+ '\\ast' : ('cmsy10', 0xa4),
+ '\\asymp' : ('cmsy10', 0xb3),
+ '\\backslash' : ('cmsy10', 0x6e),
+ '\\bigcirc' : ('cmsy10', 0xb0),
+ '\\bigtriangledown' : ('cmsy10', 0x35),
+ '\\bigtriangleup' : ('cmsy10', 0x34),
+ '\\bot' : ('cmsy10', 0x3f),
+ '\\bullet' : ('cmsy10', 0xb2),
+ '\\cap' : ('cmsy10', 0x5c),
+ '\\cdot' : ('cmsy10', 0xa2),
+ '\\circ' : ('cmsy10', 0xb1),
+ '\\clubsuit' : ('cmsy10', 0x7c),
+ '\\cup' : ('cmsy10', 0x5b),
+ '\\dag' : ('cmsy10', 0x79),
+ '\\dashv' : ('cmsy10', 0x61),
+ '\\ddag' : ('cmsy10', 0x7a),
+ '\\diamond' : ('cmsy10', 0xa6),
+ '\\diamondsuit' : ('cmsy10', 0x7d),
+ '\\div' : ('cmsy10', 0xa5),
+ '\\downarrow' : ('cmsy10', 0x23),
+ '\\emptyset' : ('cmsy10', 0x3b),
+ '\\equiv' : ('cmsy10', 0xb4),
+ '\\exists' : ('cmsy10', 0x39),
+ '\\forall' : ('cmsy10', 0x38),
+ '\\geq' : ('cmsy10', 0xb8),
+ '\\gg' : ('cmsy10', 0xc0),
+ '\\heartsuit' : ('cmsy10', 0x7e),
+ '\\in' : ('cmsy10', 0x32),
+ '\\infty' : ('cmsy10', 0x31),
+ '\\lbrace' : ('cmsy10', 0x66),
+ '\\lceil' : ('cmsy10', 0x64),
+ '\\leftarrow' : ('cmsy10', 0xc3),
+ '\\leftrightarrow' : ('cmsy10', 0x24),
+ '\\leq' : ('cmsy10', 0x2219),
+ '\\lfloor' : ('cmsy10', 0x62),
+ '\\ll' : ('cmsy10', 0xbf),
+ '\\mid' : ('cmsy10', 0x6a),
+ '\\mp' : ('cmsy10', 0xa8),
+ '\\nabla' : ('cmsy10', 0x72),
+ '\\nearrow' : ('cmsy10', 0x25),
+ '\\neg' : ('cmsy10', 0x3a),
+ '\\ni' : ('cmsy10', 0x33),
+ '\\nwarrow' : ('cmsy10', 0x2d),
+ '\\odot' : ('cmsy10', 0xaf),
+ '\\ominus' : ('cmsy10', 0xaa),
+ '\\oplus' : ('cmsy10', 0xa9),
+ '\\oslash' : ('cmsy10', 0xae),
+ '\\otimes' : ('cmsy10', 0xad),
+ '\\pm' : ('cmsy10', 0xa7),
+ '\\prec' : ('cmsy10', 0xc1),
+ '\\preceq' : ('cmsy10', 0xb9),
+ '\\prime' : ('cmsy10', 0x30),
+ '\\propto' : ('cmsy10', 0x2f),
+ '\\rbrace' : ('cmsy10', 0x67),
+ '\\rceil' : ('cmsy10', 0x65),
+ '\\rfloor' : ('cmsy10', 0x63),
+ '\\rightarrow' : ('cmsy10', 0x21),
+ '\\searrow' : ('cmsy10', 0x26),
+ '\\sim' : ('cmsy10', 0xbb),
+ '\\simeq' : ('cmsy10', 0x27),
+ '\\slash' : ('cmsy10', 0x36),
+ '\\spadesuit' : ('cmsy10', 0xc4),
+ '\\sqcap' : ('cmsy10', 0x75),
+ '\\sqcup' : ('cmsy10', 0x74),
+ '\\sqsubseteq' : ('cmsy10', 0x76),
+ '\\sqsupseteq' : ('cmsy10', 0x77),
+ '\\subset' : ('cmsy10', 0xbd),
+ '\\subseteq' : ('cmsy10', 0xb5),
+ '\\succ' : ('cmsy10', 0xc2),
+ '\\succeq' : ('cmsy10', 0xba),
+ '\\supset' : ('cmsy10', 0xbe),
+ '\\supseteq' : ('cmsy10', 0xb6),
+ '\\swarrow' : ('cmsy10', 0x2e),
+ '\\times' : ('cmsy10', 0xa3),
+ '\\to' : ('cmsy10', 0x21),
+ '\\top' : ('cmsy10', 0x3e),
+ '\\uparrow' : ('cmsy10', 0x22),
+ '\\updownarrow' : ('cmsy10', 0x6c),
+ '\\uplus' : ('cmsy10', 0x5d),
+ '\\vdash' : ('cmsy10', 0x60),
+ '\\vee' : ('cmsy10', 0x5f),
+ '\\vert' : ('cmsy10', 0x6a),
+ '\\wedge' : ('cmsy10', 0x5e),
+ '\\wr' : ('cmsy10', 0x6f),
+ '\\|' : ('cmsy10', 0x6b),
+ '|' : ('cmsy10', 0x6a),
+
+ '\\_' : ('cmtt10', 0x5f)
+}
+
+# Automatically generated.
+
+type12uni = {
+ 'aring' : 229,
+ 'quotedblright' : 8221,
+ 'V' : 86,
+ 'dollar' : 36,
+ 'four' : 52,
+ 'Yacute' : 221,
+ 'P' : 80,
+ 'underscore' : 95,
+ 'p' : 112,
+ 'Otilde' : 213,
+ 'perthousand' : 8240,
+ 'zero' : 48,
+ 'dotlessi' : 305,
+ 'Scaron' : 352,
+ 'zcaron' : 382,
+ 'egrave' : 232,
+ 'section' : 167,
+ 'Icircumflex' : 206,
+ 'ntilde' : 241,
+ 'ampersand' : 38,
+ 'dotaccent' : 729,
+ 'degree' : 176,
+ 'K' : 75,
+ 'acircumflex' : 226,
+ 'Aring' : 197,
+ 'k' : 107,
+ 'smalltilde' : 732,
+ 'Agrave' : 192,
+ 'divide' : 247,
+ 'ocircumflex' : 244,
+ 'asciitilde' : 126,
+ 'two' : 50,
+ 'E' : 69,
+ 'scaron' : 353,
+ 'F' : 70,
+ 'bracketleft' : 91,
+ 'asciicircum' : 94,
+ 'f' : 102,
+ 'ordmasculine' : 186,
+ 'mu' : 181,
+ 'paragraph' : 182,
+ 'nine' : 57,
+ 'v' : 118,
+ 'guilsinglleft' : 8249,
+ 'backslash' : 92,
+ 'six' : 54,
+ 'A' : 65,
+ 'icircumflex' : 238,
+ 'a' : 97,
+ 'ogonek' : 731,
+ 'q' : 113,
+ 'oacute' : 243,
+ 'ograve' : 242,
+ 'edieresis' : 235,
+ 'comma' : 44,
+ 'otilde' : 245,
+ 'guillemotright' : 187,
+ 'ecircumflex' : 234,
+ 'greater' : 62,
+ 'uacute' : 250,
+ 'L' : 76,
+ 'bullet' : 8226,
+ 'cedilla' : 184,
+ 'ydieresis' : 255,
+ 'l' : 108,
+ 'logicalnot' : 172,
+ 'exclamdown' : 161,
+ 'endash' : 8211,
+ 'agrave' : 224,
+ 'Adieresis' : 196,
+ 'germandbls' : 223,
+ 'Odieresis' : 214,
+ 'space' : 32,
+ 'quoteright' : 8217,
+ 'ucircumflex' : 251,
+ 'G' : 71,
+ 'quoteleft' : 8216,
+ 'W' : 87,
+ 'Q' : 81,
+ 'g' : 103,
+ 'w' : 119,
+ 'question' : 63,
+ 'one' : 49,
+ 'ring' : 730,
+ 'figuredash' : 8210,
+ 'B' : 66,
+ 'iacute' : 237,
+ 'Ydieresis' : 376,
+ 'R' : 82,
+ 'b' : 98,
+ 'r' : 114,
+ 'Ccedilla' : 199,
+ 'minus' : 8722,
+ 'Lslash' : 321,
+ 'Uacute' : 218,
+ 'yacute' : 253,
+ 'Ucircumflex' : 219,
+ 'quotedbl' : 34,
+ 'onehalf' : 189,
+ 'Thorn' : 222,
+ 'M' : 77,
+ 'eight' : 56,
+ 'multiply' : 215,
+ 'grave' : 96,
+ 'Ocircumflex' : 212,
+ 'm' : 109,
+ 'Ugrave' : 217,
+ 'guilsinglright' : 8250,
+ 'Ntilde' : 209,
+ 'questiondown' : 191,
+ 'Atilde' : 195,
+ 'ccedilla' : 231,
+ 'Z' : 90,
+ 'copyright' : 169,
+ 'yen' : 165,
+ 'Eacute' : 201,
+ 'H' : 72,
+ 'X' : 88,
+ 'Idieresis' : 207,
+ 'bar' : 124,
+ 'h' : 104,
+ 'x' : 120,
+ 'udieresis' : 252,
+ 'ordfeminine' : 170,
+ 'braceleft' : 123,
+ 'macron' : 175,
+ 'atilde' : 227,
+ 'Acircumflex' : 194,
+ 'Oslash' : 216,
+ 'C' : 67,
+ 'quotedblleft' : 8220,
+ 'S' : 83,
+ 'exclam' : 33,
+ 'Zcaron' : 381,
+ 'equal' : 61,
+ 's' : 115,
+ 'eth' : 240,
+ 'Egrave' : 200,
+ 'hyphen' : 45,
+ 'period' : 46,
+ 'igrave' : 236,
+ 'colon' : 58,
+ 'Ecircumflex' : 202,
+ 'trademark' : 8482,
+ 'Aacute' : 193,
+ 'cent' : 162,
+ 'lslash' : 322,
+ 'c' : 99,
+ 'N' : 78,
+ 'breve' : 728,
+ 'Oacute' : 211,
+ 'guillemotleft' : 171,
+ 'n' : 110,
+ 'idieresis' : 239,
+ 'braceright' : 125,
+ 'seven' : 55,
+ 'brokenbar' : 166,
+ 'ugrave' : 249,
+ 'periodcentered' : 183,
+ 'sterling' : 163,
+ 'I' : 73,
+ 'Y' : 89,
+ 'Eth' : 208,
+ 'emdash' : 8212,
+ 'i' : 105,
+ 'daggerdbl' : 8225,
+ 'y' : 121,
+ 'plusminus' : 177,
+ 'less' : 60,
+ 'Udieresis' : 220,
+ 'D' : 68,
+ 'five' : 53,
+ 'T' : 84,
+ 'oslash' : 248,
+ 'acute' : 180,
+ 'd' : 100,
+ 'OE' : 338,
+ 'Igrave' : 204,
+ 't' : 116,
+ 'parenright' : 41,
+ 'adieresis' : 228,
+ 'quotesingle' : 39,
+ 'twodotenleader' : 8229,
+ 'slash' : 47,
+ 'ellipsis' : 8230,
+ 'numbersign' : 35,
+ 'odieresis' : 246,
+ 'O' : 79,
+ 'oe' : 339,
+ 'o' : 111,
+ 'Edieresis' : 203,
+ 'plus' : 43,
+ 'dagger' : 8224,
+ 'three' : 51,
+ 'hungarumlaut' : 733,
+ 'parenleft' : 40,
+ 'fraction' : 8260,
+ 'registered' : 174,
+ 'J' : 74,
+ 'dieresis' : 168,
+ 'Ograve' : 210,
+ 'j' : 106,
+ 'z' : 122,
+ 'ae' : 230,
+ 'semicolon' : 59,
+ 'at' : 64,
+ 'Iacute' : 205,
+ 'percent' : 37,
+ 'bracketright' : 93,
+ 'AE' : 198,
+ 'asterisk' : 42,
+ 'aacute' : 225,
+ 'U' : 85,
+ 'eacute' : 233,
+ 'e' : 101,
+ 'thorn' : 254,
+ 'u' : 117,
+}
+
+uni2type1 = {v: k for k, v in type12uni.items()}
+
+# The script below is to sort and format the tex2uni dict
+
+## For decimal values: int(hex(v), 16)
+# newtex = {k: hex(v) for k, v in tex2uni.items()}
+# sd = dict(sorted(newtex.items(), key=lambda item: item[0]))
+#
+## For formatting the sorted dictionary with proper spacing
+## the value '24' comes from finding the longest string in
+## the newtex keys with len(max(newtex, key=len))
+# for key in sd:
+# print("{0:24} : {1: _EntryTypeOut: ...
+
+
+@overload
+def _normalize_stix_fontcodes(d: list[_EntryTypeIn]) -> list[_EntryTypeOut]: ...
+
+
+@overload
+def _normalize_stix_fontcodes(d: dict[str, list[_EntryTypeIn] |
+ dict[str, list[_EntryTypeIn]]]
+ ) -> dict[str, list[_EntryTypeOut] |
+ dict[str, list[_EntryTypeOut]]]: ...
+
+
+def _normalize_stix_fontcodes(d):
+ if isinstance(d, tuple):
+ return tuple(ord(x) if isinstance(x, str) and len(x) == 1 else x for x in d)
+ elif isinstance(d, list):
+ return [_normalize_stix_fontcodes(x) for x in d]
+ elif isinstance(d, dict):
+ return {k: _normalize_stix_fontcodes(v) for k, v in d.items()}
+
+
+stix_virtual_fonts: dict[str, dict[str, list[_EntryTypeOut]] | list[_EntryTypeOut]]
+stix_virtual_fonts = _normalize_stix_fontcodes(_stix_virtual_fonts)
+
+# Free redundant list now that it has been normalized
+del _stix_virtual_fonts
+
+# Fix some incorrect glyphs.
+stix_glyph_fixes = {
+ # Cap and Cup glyphs are swapped.
+ 0x22d2: 0x22d3,
+ 0x22d3: 0x22d2,
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_path.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_path.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..456905528b28e0f4eea31ec9d86433fb43767b85
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_path.pyi
@@ -0,0 +1,9 @@
+from collections.abc import Sequence
+
+import numpy as np
+
+from .transforms import BboxBase
+
+def affine_transform(points: np.ndarray, trans: np.ndarray) -> np.ndarray: ...
+def count_bboxes_overlapping_bbox(bbox: BboxBase, bboxes: Sequence[BboxBase]) -> int: ...
+def update_path_extents(path, trans, rect, minpos, ignore): ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_pylab_helpers.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_pylab_helpers.py
new file mode 100644
index 0000000000000000000000000000000000000000..a3861aef592008a84ffddadb7a0c76c8833a30af
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_pylab_helpers.py
@@ -0,0 +1,134 @@
+"""
+Manage figures for the pyplot interface.
+"""
+
+import atexit
+from collections import OrderedDict
+
+
+class Gcf:
+ """
+ Singleton to maintain the relation between figures and their managers, and
+ keep track of and "active" figure and manager.
+
+ The canvas of a figure created through pyplot is associated with a figure
+ manager, which handles the interaction between the figure and the backend.
+ pyplot keeps track of figure managers using an identifier, the "figure
+ number" or "manager number" (which can actually be any hashable value);
+ this number is available as the :attr:`number` attribute of the manager.
+
+ This class is never instantiated; it consists of an `OrderedDict` mapping
+ figure/manager numbers to managers, and a set of class methods that
+ manipulate this `OrderedDict`.
+
+ Attributes
+ ----------
+ figs : OrderedDict
+ `OrderedDict` mapping numbers to managers; the active manager is at the
+ end.
+ """
+
+ figs = OrderedDict()
+
+ @classmethod
+ def get_fig_manager(cls, num):
+ """
+ If manager number *num* exists, make it the active one and return it;
+ otherwise return *None*.
+ """
+ manager = cls.figs.get(num, None)
+ if manager is not None:
+ cls.set_active(manager)
+ return manager
+
+ @classmethod
+ def destroy(cls, num):
+ """
+ Destroy manager *num* -- either a manager instance or a manager number.
+
+ In the interactive backends, this is bound to the window "destroy" and
+ "delete" events.
+
+ It is recommended to pass a manager instance, to avoid confusion when
+ two managers share the same number.
+ """
+ if all(hasattr(num, attr) for attr in ["num", "destroy"]):
+ manager = num
+ if cls.figs.get(manager.num) is manager:
+ cls.figs.pop(manager.num)
+ else:
+ try:
+ manager = cls.figs.pop(num)
+ except KeyError:
+ return
+ if hasattr(manager, "_cidgcf"):
+ manager.canvas.mpl_disconnect(manager._cidgcf)
+ manager.destroy()
+
+ @classmethod
+ def destroy_fig(cls, fig):
+ """Destroy figure *fig*."""
+ num = next((manager.num for manager in cls.figs.values()
+ if manager.canvas.figure == fig), None)
+ if num is not None:
+ cls.destroy(num)
+
+ @classmethod
+ def destroy_all(cls):
+ """Destroy all figures."""
+ for manager in list(cls.figs.values()):
+ manager.canvas.mpl_disconnect(manager._cidgcf)
+ manager.destroy()
+ cls.figs.clear()
+
+ @classmethod
+ def has_fignum(cls, num):
+ """Return whether figure number *num* exists."""
+ return num in cls.figs
+
+ @classmethod
+ def get_all_fig_managers(cls):
+ """Return a list of figure managers."""
+ return list(cls.figs.values())
+
+ @classmethod
+ def get_num_fig_managers(cls):
+ """Return the number of figures being managed."""
+ return len(cls.figs)
+
+ @classmethod
+ def get_active(cls):
+ """Return the active manager, or *None* if there is no manager."""
+ return next(reversed(cls.figs.values())) if cls.figs else None
+
+ @classmethod
+ def _set_new_active_manager(cls, manager):
+ """Adopt *manager* into pyplot and make it the active manager."""
+ if not hasattr(manager, "_cidgcf"):
+ manager._cidgcf = manager.canvas.mpl_connect(
+ "button_press_event", lambda event: cls.set_active(manager))
+ fig = manager.canvas.figure
+ fig._number = manager.num
+ label = fig.get_label()
+ if label:
+ manager.set_window_title(label)
+ cls.set_active(manager)
+
+ @classmethod
+ def set_active(cls, manager):
+ """Make *manager* the active manager."""
+ cls.figs[manager.num] = manager
+ cls.figs.move_to_end(manager.num)
+
+ @classmethod
+ def draw_all(cls, force=False):
+ """
+ Redraw all stale managed figures, or, if *force* is True, all managed
+ figures.
+ """
+ for manager in cls.get_all_fig_managers():
+ if force or manager.canvas.figure.stale:
+ manager.canvas.draw_idle()
+
+
+atexit.register(Gcf.destroy_all)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_pylab_helpers.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_pylab_helpers.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..bdd8cfba3173030b37b24af412970cbb62fee3ef
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_pylab_helpers.pyi
@@ -0,0 +1,29 @@
+from collections import OrderedDict
+
+from matplotlib.backend_bases import FigureManagerBase
+from matplotlib.figure import Figure
+
+class Gcf:
+ figs: OrderedDict[int, FigureManagerBase]
+ @classmethod
+ def get_fig_manager(cls, num: int) -> FigureManagerBase | None: ...
+ @classmethod
+ def destroy(cls, num: int | FigureManagerBase) -> None: ...
+ @classmethod
+ def destroy_fig(cls, fig: Figure) -> None: ...
+ @classmethod
+ def destroy_all(cls) -> None: ...
+ @classmethod
+ def has_fignum(cls, num: int) -> bool: ...
+ @classmethod
+ def get_all_fig_managers(cls) -> list[FigureManagerBase]: ...
+ @classmethod
+ def get_num_fig_managers(cls) -> int: ...
+ @classmethod
+ def get_active(cls) -> FigureManagerBase | None: ...
+ @classmethod
+ def _set_new_active_manager(cls, manager: FigureManagerBase) -> None: ...
+ @classmethod
+ def set_active(cls, manager: FigureManagerBase) -> None: ...
+ @classmethod
+ def draw_all(cls, force: bool = ...) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_qhull.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_qhull.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_text_helpers.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_text_helpers.py
new file mode 100644
index 0000000000000000000000000000000000000000..b9603b114bc245ecf32da926573ddb4157210c7a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_text_helpers.py
@@ -0,0 +1,82 @@
+"""
+Low-level text helper utilities.
+"""
+
+from __future__ import annotations
+
+import dataclasses
+
+from . import _api
+from .ft2font import FT2Font, Kerning, LoadFlags
+
+
+@dataclasses.dataclass(frozen=True)
+class LayoutItem:
+ ft_object: FT2Font
+ char: str
+ glyph_idx: int
+ x: float
+ prev_kern: float
+
+
+def warn_on_missing_glyph(codepoint, fontnames):
+ _api.warn_external(
+ f"Glyph {codepoint} "
+ f"({chr(codepoint).encode('ascii', 'namereplace').decode('ascii')}) "
+ f"missing from font(s) {fontnames}.")
+
+ block = ("Hebrew" if 0x0590 <= codepoint <= 0x05ff else
+ "Arabic" if 0x0600 <= codepoint <= 0x06ff else
+ "Devanagari" if 0x0900 <= codepoint <= 0x097f else
+ "Bengali" if 0x0980 <= codepoint <= 0x09ff else
+ "Gurmukhi" if 0x0a00 <= codepoint <= 0x0a7f else
+ "Gujarati" if 0x0a80 <= codepoint <= 0x0aff else
+ "Oriya" if 0x0b00 <= codepoint <= 0x0b7f else
+ "Tamil" if 0x0b80 <= codepoint <= 0x0bff else
+ "Telugu" if 0x0c00 <= codepoint <= 0x0c7f else
+ "Kannada" if 0x0c80 <= codepoint <= 0x0cff else
+ "Malayalam" if 0x0d00 <= codepoint <= 0x0d7f else
+ "Sinhala" if 0x0d80 <= codepoint <= 0x0dff else
+ None)
+ if block:
+ _api.warn_external(
+ f"Matplotlib currently does not support {block} natively.")
+
+
+def layout(string, font, *, kern_mode=Kerning.DEFAULT):
+ """
+ Render *string* with *font*.
+
+ For each character in *string*, yield a LayoutItem instance. When such an instance
+ is yielded, the font's glyph is set to the corresponding character.
+
+ Parameters
+ ----------
+ string : str
+ The string to be rendered.
+ font : FT2Font
+ The font.
+ kern_mode : Kerning
+ A FreeType kerning mode.
+
+ Yields
+ ------
+ LayoutItem
+ """
+ x = 0
+ prev_glyph_idx = None
+ char_to_font = font._get_fontmap(string)
+ base_font = font
+ for char in string:
+ # This has done the fallback logic
+ font = char_to_font.get(char, base_font)
+ glyph_idx = font.get_char_index(ord(char))
+ kern = (
+ base_font.get_kerning(prev_glyph_idx, glyph_idx, kern_mode) / 64
+ if prev_glyph_idx is not None else 0.
+ )
+ x += kern
+ glyph = font.load_glyph(glyph_idx, flags=LoadFlags.NO_HINTING)
+ yield LayoutItem(font, char, glyph_idx, x, kern)
+ x += glyph.linearHoriAdvance / 65536
+ prev_glyph_idx = glyph_idx
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tight_bbox.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tight_bbox.py
new file mode 100644
index 0000000000000000000000000000000000000000..db72bbdff020680dfd833229cac41e9b33e428ee
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tight_bbox.py
@@ -0,0 +1,84 @@
+"""
+Helper module for the *bbox_inches* parameter in `.Figure.savefig`.
+"""
+
+from matplotlib.transforms import Bbox, TransformedBbox, Affine2D
+
+
+def adjust_bbox(fig, bbox_inches, fixed_dpi=None):
+ """
+ Temporarily adjust the figure so that only the specified area
+ (bbox_inches) is saved.
+
+ It modifies fig.bbox, fig.bbox_inches,
+ fig.transFigure._boxout, and fig.patch. While the figure size
+ changes, the scale of the original figure is conserved. A
+ function which restores the original values are returned.
+ """
+ origBbox = fig.bbox
+ origBboxInches = fig.bbox_inches
+ _boxout = fig.transFigure._boxout
+
+ old_aspect = []
+ locator_list = []
+ sentinel = object()
+ for ax in fig.axes:
+ locator = ax.get_axes_locator()
+ if locator is not None:
+ ax.apply_aspect(locator(ax, None))
+ locator_list.append(locator)
+ current_pos = ax.get_position(original=False).frozen()
+ ax.set_axes_locator(lambda a, r, _pos=current_pos: _pos)
+ # override the method that enforces the aspect ratio on the Axes
+ if 'apply_aspect' in ax.__dict__:
+ old_aspect.append(ax.apply_aspect)
+ else:
+ old_aspect.append(sentinel)
+ ax.apply_aspect = lambda pos=None: None
+
+ def restore_bbox():
+ for ax, loc, aspect in zip(fig.axes, locator_list, old_aspect):
+ ax.set_axes_locator(loc)
+ if aspect is sentinel:
+ # delete our no-op function which un-hides the original method
+ del ax.apply_aspect
+ else:
+ ax.apply_aspect = aspect
+
+ fig.bbox = origBbox
+ fig.bbox_inches = origBboxInches
+ fig.transFigure._boxout = _boxout
+ fig.transFigure.invalidate()
+ fig.patch.set_bounds(0, 0, 1, 1)
+
+ if fixed_dpi is None:
+ fixed_dpi = fig.dpi
+ tr = Affine2D().scale(fixed_dpi)
+ dpi_scale = fixed_dpi / fig.dpi
+
+ fig.bbox_inches = Bbox.from_bounds(0, 0, *bbox_inches.size)
+ x0, y0 = tr.transform(bbox_inches.p0)
+ w1, h1 = fig.bbox.size * dpi_scale
+ fig.transFigure._boxout = Bbox.from_bounds(-x0, -y0, w1, h1)
+ fig.transFigure.invalidate()
+
+ fig.bbox = TransformedBbox(fig.bbox_inches, tr)
+
+ fig.patch.set_bounds(x0 / w1, y0 / h1,
+ fig.bbox.width / w1, fig.bbox.height / h1)
+
+ return restore_bbox
+
+
+def process_figure_for_rasterizing(fig, bbox_inches_restore, fixed_dpi=None):
+ """
+ A function that needs to be called when figure dpi changes during the
+ drawing (e.g., rasterizing). It recovers the bbox and re-adjust it with
+ the new dpi.
+ """
+
+ bbox_inches, restore_bbox = bbox_inches_restore
+ restore_bbox()
+ r = adjust_bbox(fig, bbox_inches, fixed_dpi)
+
+ return bbox_inches, r
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tight_layout.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tight_layout.py
new file mode 100644
index 0000000000000000000000000000000000000000..548da79fff04320193a7170d5cf0f9b9fa743c0a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tight_layout.py
@@ -0,0 +1,301 @@
+"""
+Routines to adjust subplot params so that subplots are
+nicely fit in the figure. In doing so, only axis labels, tick labels, Axes
+titles and offsetboxes that are anchored to Axes are currently considered.
+
+Internally, this module assumes that the margins (left margin, etc.) which are
+differences between ``Axes.get_tightbbox`` and ``Axes.bbox`` are independent of
+Axes position. This may fail if ``Axes.adjustable`` is ``datalim`` as well as
+such cases as when left or right margin are affected by xlabel.
+"""
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, artist as martist
+from matplotlib.font_manager import FontProperties
+from matplotlib.transforms import Bbox
+
+
+def _auto_adjust_subplotpars(
+ fig, renderer, shape, span_pairs, subplot_list,
+ ax_bbox_list=None, pad=1.08, h_pad=None, w_pad=None, rect=None):
+ """
+ Return a dict of subplot parameters to adjust spacing between subplots
+ or ``None`` if resulting Axes would have zero height or width.
+
+ Note that this function ignores geometry information of subplot itself, but
+ uses what is given by the *shape* and *subplot_list* parameters. Also, the
+ results could be incorrect if some subplots have ``adjustable=datalim``.
+
+ Parameters
+ ----------
+ shape : tuple[int, int]
+ Number of rows and columns of the grid.
+ span_pairs : list[tuple[slice, slice]]
+ List of rowspans and colspans occupied by each subplot.
+ subplot_list : list of subplots
+ List of subplots that will be used to calculate optimal subplot_params.
+ pad : float
+ Padding between the figure edge and the edges of subplots, as a
+ fraction of the font size.
+ h_pad, w_pad : float
+ Padding (height/width) between edges of adjacent subplots, as a
+ fraction of the font size. Defaults to *pad*.
+ rect : tuple
+ (left, bottom, right, top), default: None.
+ """
+ rows, cols = shape
+
+ font_size_inch = (FontProperties(
+ size=mpl.rcParams["font.size"]).get_size_in_points() / 72)
+ pad_inch = pad * font_size_inch
+ vpad_inch = h_pad * font_size_inch if h_pad is not None else pad_inch
+ hpad_inch = w_pad * font_size_inch if w_pad is not None else pad_inch
+
+ if len(span_pairs) != len(subplot_list) or len(subplot_list) == 0:
+ raise ValueError
+
+ if rect is None:
+ margin_left = margin_bottom = margin_right = margin_top = None
+ else:
+ margin_left, margin_bottom, _right, _top = rect
+ margin_right = 1 - _right if _right else None
+ margin_top = 1 - _top if _top else None
+
+ vspaces = np.zeros((rows + 1, cols))
+ hspaces = np.zeros((rows, cols + 1))
+
+ if ax_bbox_list is None:
+ ax_bbox_list = [
+ Bbox.union([ax.get_position(original=True) for ax in subplots])
+ for subplots in subplot_list]
+
+ for subplots, ax_bbox, (rowspan, colspan) in zip(
+ subplot_list, ax_bbox_list, span_pairs):
+ if all(not ax.get_visible() for ax in subplots):
+ continue
+
+ bb = []
+ for ax in subplots:
+ if ax.get_visible():
+ bb += [martist._get_tightbbox_for_layout_only(ax, renderer)]
+
+ tight_bbox_raw = Bbox.union(bb)
+ tight_bbox = fig.transFigure.inverted().transform_bbox(tight_bbox_raw)
+
+ hspaces[rowspan, colspan.start] += ax_bbox.xmin - tight_bbox.xmin # l
+ hspaces[rowspan, colspan.stop] += tight_bbox.xmax - ax_bbox.xmax # r
+ vspaces[rowspan.start, colspan] += tight_bbox.ymax - ax_bbox.ymax # t
+ vspaces[rowspan.stop, colspan] += ax_bbox.ymin - tight_bbox.ymin # b
+
+ fig_width_inch, fig_height_inch = fig.get_size_inches()
+
+ # margins can be negative for Axes with aspect applied, so use max(, 0) to
+ # make them nonnegative.
+ if not margin_left:
+ margin_left = max(hspaces[:, 0].max(), 0) + pad_inch/fig_width_inch
+ suplabel = fig._supylabel
+ if suplabel and suplabel.get_in_layout():
+ rel_width = fig.transFigure.inverted().transform_bbox(
+ suplabel.get_window_extent(renderer)).width
+ margin_left += rel_width + pad_inch/fig_width_inch
+ if not margin_right:
+ margin_right = max(hspaces[:, -1].max(), 0) + pad_inch/fig_width_inch
+ if not margin_top:
+ margin_top = max(vspaces[0, :].max(), 0) + pad_inch/fig_height_inch
+ if fig._suptitle and fig._suptitle.get_in_layout():
+ rel_height = fig.transFigure.inverted().transform_bbox(
+ fig._suptitle.get_window_extent(renderer)).height
+ margin_top += rel_height + pad_inch/fig_height_inch
+ if not margin_bottom:
+ margin_bottom = max(vspaces[-1, :].max(), 0) + pad_inch/fig_height_inch
+ suplabel = fig._supxlabel
+ if suplabel and suplabel.get_in_layout():
+ rel_height = fig.transFigure.inverted().transform_bbox(
+ suplabel.get_window_extent(renderer)).height
+ margin_bottom += rel_height + pad_inch/fig_height_inch
+
+ if margin_left + margin_right >= 1:
+ _api.warn_external('Tight layout not applied. The left and right '
+ 'margins cannot be made large enough to '
+ 'accommodate all Axes decorations.')
+ return None
+ if margin_bottom + margin_top >= 1:
+ _api.warn_external('Tight layout not applied. The bottom and top '
+ 'margins cannot be made large enough to '
+ 'accommodate all Axes decorations.')
+ return None
+
+ kwargs = dict(left=margin_left,
+ right=1 - margin_right,
+ bottom=margin_bottom,
+ top=1 - margin_top)
+
+ if cols > 1:
+ hspace = hspaces[:, 1:-1].max() + hpad_inch / fig_width_inch
+ # axes widths:
+ h_axes = (1 - margin_right - margin_left - hspace * (cols - 1)) / cols
+ if h_axes < 0:
+ _api.warn_external('Tight layout not applied. tight_layout '
+ 'cannot make Axes width small enough to '
+ 'accommodate all Axes decorations')
+ return None
+ else:
+ kwargs["wspace"] = hspace / h_axes
+ if rows > 1:
+ vspace = vspaces[1:-1, :].max() + vpad_inch / fig_height_inch
+ v_axes = (1 - margin_top - margin_bottom - vspace * (rows - 1)) / rows
+ if v_axes < 0:
+ _api.warn_external('Tight layout not applied. tight_layout '
+ 'cannot make Axes height small enough to '
+ 'accommodate all Axes decorations.')
+ return None
+ else:
+ kwargs["hspace"] = vspace / v_axes
+
+ return kwargs
+
+
+def get_subplotspec_list(axes_list, grid_spec=None):
+ """
+ Return a list of subplotspec from the given list of Axes.
+
+ For an instance of Axes that does not support subplotspec, None is inserted
+ in the list.
+
+ If grid_spec is given, None is inserted for those not from the given
+ grid_spec.
+ """
+ subplotspec_list = []
+ for ax in axes_list:
+ axes_or_locator = ax.get_axes_locator()
+ if axes_or_locator is None:
+ axes_or_locator = ax
+
+ if hasattr(axes_or_locator, "get_subplotspec"):
+ subplotspec = axes_or_locator.get_subplotspec()
+ if subplotspec is not None:
+ subplotspec = subplotspec.get_topmost_subplotspec()
+ gs = subplotspec.get_gridspec()
+ if grid_spec is not None:
+ if gs != grid_spec:
+ subplotspec = None
+ elif gs.locally_modified_subplot_params():
+ subplotspec = None
+ else:
+ subplotspec = None
+
+ subplotspec_list.append(subplotspec)
+
+ return subplotspec_list
+
+
+def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
+ pad=1.08, h_pad=None, w_pad=None, rect=None):
+ """
+ Return subplot parameters for tight-layouted-figure with specified padding.
+
+ Parameters
+ ----------
+ fig : Figure
+ axes_list : list of Axes
+ subplotspec_list : list of `.SubplotSpec`
+ The subplotspecs of each Axes.
+ renderer : renderer
+ pad : float
+ Padding between the figure edge and the edges of subplots, as a
+ fraction of the font size.
+ h_pad, w_pad : float
+ Padding (height/width) between edges of adjacent subplots. Defaults to
+ *pad*.
+ rect : tuple (left, bottom, right, top), default: None.
+ rectangle in normalized figure coordinates
+ that the whole subplots area (including labels) will fit into.
+ Defaults to using the entire figure.
+
+ Returns
+ -------
+ subplotspec or None
+ subplotspec kwargs to be passed to `.Figure.subplots_adjust` or
+ None if tight_layout could not be accomplished.
+ """
+
+ # Multiple Axes can share same subplotspec (e.g., if using axes_grid1);
+ # we need to group them together.
+ ss_to_subplots = {ss: [] for ss in subplotspec_list}
+ for ax, ss in zip(axes_list, subplotspec_list):
+ ss_to_subplots[ss].append(ax)
+ if ss_to_subplots.pop(None, None):
+ _api.warn_external(
+ "This figure includes Axes that are not compatible with "
+ "tight_layout, so results might be incorrect.")
+ if not ss_to_subplots:
+ return {}
+ subplot_list = list(ss_to_subplots.values())
+ ax_bbox_list = [ss.get_position(fig) for ss in ss_to_subplots]
+
+ max_nrows = max(ss.get_gridspec().nrows for ss in ss_to_subplots)
+ max_ncols = max(ss.get_gridspec().ncols for ss in ss_to_subplots)
+
+ span_pairs = []
+ for ss in ss_to_subplots:
+ # The intent here is to support Axes from different gridspecs where
+ # one's nrows (or ncols) is a multiple of the other (e.g. 2 and 4),
+ # but this doesn't actually work because the computed wspace, in
+ # relative-axes-height, corresponds to different physical spacings for
+ # the 2-row grid and the 4-row grid. Still, this code is left, mostly
+ # for backcompat.
+ rows, cols = ss.get_gridspec().get_geometry()
+ div_row, mod_row = divmod(max_nrows, rows)
+ div_col, mod_col = divmod(max_ncols, cols)
+ if mod_row != 0:
+ _api.warn_external('tight_layout not applied: number of rows '
+ 'in subplot specifications must be '
+ 'multiples of one another.')
+ return {}
+ if mod_col != 0:
+ _api.warn_external('tight_layout not applied: number of '
+ 'columns in subplot specifications must be '
+ 'multiples of one another.')
+ return {}
+ span_pairs.append((
+ slice(ss.rowspan.start * div_row, ss.rowspan.stop * div_row),
+ slice(ss.colspan.start * div_col, ss.colspan.stop * div_col)))
+
+ kwargs = _auto_adjust_subplotpars(fig, renderer,
+ shape=(max_nrows, max_ncols),
+ span_pairs=span_pairs,
+ subplot_list=subplot_list,
+ ax_bbox_list=ax_bbox_list,
+ pad=pad, h_pad=h_pad, w_pad=w_pad)
+
+ # kwargs can be none if tight_layout fails...
+ if rect is not None and kwargs is not None:
+ # if rect is given, the whole subplots area (including
+ # labels) will fit into the rect instead of the
+ # figure. Note that the rect argument of
+ # *auto_adjust_subplotpars* specify the area that will be
+ # covered by the total area of axes.bbox. Thus we call
+ # auto_adjust_subplotpars twice, where the second run
+ # with adjusted rect parameters.
+
+ left, bottom, right, top = rect
+ if left is not None:
+ left += kwargs["left"]
+ if bottom is not None:
+ bottom += kwargs["bottom"]
+ if right is not None:
+ right -= (1 - kwargs["right"])
+ if top is not None:
+ top -= (1 - kwargs["top"])
+
+ kwargs = _auto_adjust_subplotpars(fig, renderer,
+ shape=(max_nrows, max_ncols),
+ span_pairs=span_pairs,
+ subplot_list=subplot_list,
+ ax_bbox_list=ax_bbox_list,
+ pad=pad, h_pad=h_pad, w_pad=w_pad,
+ rect=(left, bottom, right, top))
+
+ return kwargs
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tri.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tri.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..a0c710fc2309fbfac3f37297eda919d86de32c76
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_tri.pyi
@@ -0,0 +1,36 @@
+# This is a private module implemented in C++
+from typing import final
+
+import numpy as np
+import numpy.typing as npt
+
+@final
+class TrapezoidMapTriFinder:
+ def __init__(self, triangulation: Triangulation): ...
+ def find_many(self, x: npt.NDArray[np.float64], y: npt.NDArray[np.float64]) -> npt.NDArray[np.int_]: ...
+ def get_tree_stats(self) -> list[int | float]: ...
+ def initialize(self) -> None: ...
+ def print_tree(self) -> None: ...
+
+@final
+class TriContourGenerator:
+ def __init__(self, triangulation: Triangulation, z: npt.NDArray[np.float64]): ...
+ def create_contour(self, level: float) -> tuple[list[float], list[int]]: ...
+ def create_filled_contour(self, lower_level: float, upper_level: float) -> tuple[list[float], list[int]]: ...
+
+@final
+class Triangulation:
+ def __init__(
+ self,
+ x: npt.NDArray[np.float64],
+ y: npt.NDArray[np.float64],
+ triangles: npt.NDArray[np.int_],
+ mask: npt.NDArray[np.bool_] | tuple[()],
+ edges: npt.NDArray[np.int_] | tuple[()],
+ neighbors: npt.NDArray[np.int_] | tuple[()],
+ correct_triangle_orientation: bool,
+ ): ...
+ def calculate_plane_coefficients(self, z: npt.ArrayLike) -> npt.NDArray[np.float64]: ...
+ def get_edges(self) -> npt.NDArray[np.int_]: ...
+ def get_neighbors(self) -> npt.NDArray[np.int_]: ...
+ def set_mask(self, mask: npt.NDArray[np.bool_] | tuple[()]) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_type1font.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_type1font.py
new file mode 100644
index 0000000000000000000000000000000000000000..b3e08f52c035e65837e489bf79da60d28e3ac0a8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_type1font.py
@@ -0,0 +1,879 @@
+"""
+A class representing a Type 1 font.
+
+This version reads pfa and pfb files and splits them for embedding in
+pdf files. It also supports SlantFont and ExtendFont transformations,
+similarly to pdfTeX and friends. There is no support yet for subsetting.
+
+Usage::
+
+ font = Type1Font(filename)
+ clear_part, encrypted_part, finale = font.parts
+ slanted_font = font.transform({'slant': 0.167})
+ extended_font = font.transform({'extend': 1.2})
+
+Sources:
+
+* Adobe Technical Note #5040, Supporting Downloadable PostScript
+ Language Fonts.
+
+* Adobe Type 1 Font Format, Adobe Systems Incorporated, third printing,
+ v1.1, 1993. ISBN 0-201-57044-0.
+"""
+
+from __future__ import annotations
+
+import binascii
+import functools
+import logging
+import re
+import string
+import struct
+import typing as T
+
+import numpy as np
+
+from matplotlib.cbook import _format_approx
+from . import _api
+
+_log = logging.getLogger(__name__)
+
+
+class _Token:
+ """
+ A token in a PostScript stream.
+
+ Attributes
+ ----------
+ pos : int
+ Position, i.e. offset from the beginning of the data.
+ raw : str
+ Raw text of the token.
+ kind : str
+ Description of the token (for debugging or testing).
+ """
+ __slots__ = ('pos', 'raw')
+ kind = '?'
+
+ def __init__(self, pos, raw):
+ _log.debug('type1font._Token %s at %d: %r', self.kind, pos, raw)
+ self.pos = pos
+ self.raw = raw
+
+ def __str__(self):
+ return f"<{self.kind} {self.raw} @{self.pos}>"
+
+ def endpos(self):
+ """Position one past the end of the token"""
+ return self.pos + len(self.raw)
+
+ def is_keyword(self, *names):
+ """Is this a name token with one of the names?"""
+ return False
+
+ def is_slash_name(self):
+ """Is this a name token that starts with a slash?"""
+ return False
+
+ def is_delim(self):
+ """Is this a delimiter token?"""
+ return False
+
+ def is_number(self):
+ """Is this a number token?"""
+ return False
+
+ def value(self):
+ return self.raw
+
+
+class _NameToken(_Token):
+ kind = 'name'
+
+ def is_slash_name(self):
+ return self.raw.startswith('/')
+
+ def value(self):
+ return self.raw[1:]
+
+
+class _BooleanToken(_Token):
+ kind = 'boolean'
+
+ def value(self):
+ return self.raw == 'true'
+
+
+class _KeywordToken(_Token):
+ kind = 'keyword'
+
+ def is_keyword(self, *names):
+ return self.raw in names
+
+
+class _DelimiterToken(_Token):
+ kind = 'delimiter'
+
+ def is_delim(self):
+ return True
+
+ def opposite(self):
+ return {'[': ']', ']': '[',
+ '{': '}', '}': '{',
+ '<<': '>>', '>>': '<<'
+ }[self.raw]
+
+
+class _WhitespaceToken(_Token):
+ kind = 'whitespace'
+
+
+class _StringToken(_Token):
+ kind = 'string'
+ _escapes_re = re.compile(r'\\([\\()nrtbf]|[0-7]{1,3})')
+ _replacements = {'\\': '\\', '(': '(', ')': ')', 'n': '\n',
+ 'r': '\r', 't': '\t', 'b': '\b', 'f': '\f'}
+ _ws_re = re.compile('[\0\t\r\f\n ]')
+
+ @classmethod
+ def _escape(cls, match):
+ group = match.group(1)
+ try:
+ return cls._replacements[group]
+ except KeyError:
+ return chr(int(group, 8))
+
+ @functools.lru_cache
+ def value(self):
+ if self.raw[0] == '(':
+ return self._escapes_re.sub(self._escape, self.raw[1:-1])
+ else:
+ data = self._ws_re.sub('', self.raw[1:-1])
+ if len(data) % 2 == 1:
+ data += '0'
+ return binascii.unhexlify(data)
+
+
+class _BinaryToken(_Token):
+ kind = 'binary'
+
+ def value(self):
+ return self.raw[1:]
+
+
+class _NumberToken(_Token):
+ kind = 'number'
+
+ def is_number(self):
+ return True
+
+ def value(self):
+ if '.' not in self.raw:
+ return int(self.raw)
+ else:
+ return float(self.raw)
+
+
+def _tokenize(data: bytes, skip_ws: bool) -> T.Generator[_Token, int, None]:
+ """
+ A generator that produces _Token instances from Type-1 font code.
+
+ The consumer of the generator may send an integer to the tokenizer to
+ indicate that the next token should be _BinaryToken of the given length.
+
+ Parameters
+ ----------
+ data : bytes
+ The data of the font to tokenize.
+
+ skip_ws : bool
+ If true, the generator will drop any _WhitespaceTokens from the output.
+ """
+
+ text = data.decode('ascii', 'replace')
+ whitespace_or_comment_re = re.compile(r'[\0\t\r\f\n ]+|%[^\r\n]*')
+ token_re = re.compile(r'/{0,2}[^]\0\t\r\f\n ()<>{}/%[]+')
+ instring_re = re.compile(r'[()\\]')
+ hex_re = re.compile(r'^<[0-9a-fA-F\0\t\r\f\n ]*>$')
+ oct_re = re.compile(r'[0-7]{1,3}')
+ pos = 0
+ next_binary: int | None = None
+
+ while pos < len(text):
+ if next_binary is not None:
+ n = next_binary
+ next_binary = (yield _BinaryToken(pos, data[pos:pos+n]))
+ pos += n
+ continue
+ match = whitespace_or_comment_re.match(text, pos)
+ if match:
+ if not skip_ws:
+ next_binary = (yield _WhitespaceToken(pos, match.group()))
+ pos = match.end()
+ elif text[pos] == '(':
+ # PostScript string rules:
+ # - parentheses must be balanced
+ # - backslashes escape backslashes and parens
+ # - also codes \n\r\t\b\f and octal escapes are recognized
+ # - other backslashes do not escape anything
+ start = pos
+ pos += 1
+ depth = 1
+ while depth:
+ match = instring_re.search(text, pos)
+ if match is None:
+ raise ValueError(
+ f'Unterminated string starting at {start}')
+ pos = match.end()
+ if match.group() == '(':
+ depth += 1
+ elif match.group() == ')':
+ depth -= 1
+ else: # a backslash
+ char = text[pos]
+ if char in r'\()nrtbf':
+ pos += 1
+ else:
+ octal = oct_re.match(text, pos)
+ if octal:
+ pos = octal.end()
+ else:
+ pass # non-escaping backslash
+ next_binary = (yield _StringToken(start, text[start:pos]))
+ elif text[pos:pos + 2] in ('<<', '>>'):
+ next_binary = (yield _DelimiterToken(pos, text[pos:pos + 2]))
+ pos += 2
+ elif text[pos] == '<':
+ start = pos
+ try:
+ pos = text.index('>', pos) + 1
+ except ValueError as e:
+ raise ValueError(f'Unterminated hex string starting at {start}'
+ ) from e
+ if not hex_re.match(text[start:pos]):
+ raise ValueError(f'Malformed hex string starting at {start}')
+ next_binary = (yield _StringToken(pos, text[start:pos]))
+ else:
+ match = token_re.match(text, pos)
+ if match:
+ raw = match.group()
+ if raw.startswith('/'):
+ next_binary = (yield _NameToken(pos, raw))
+ elif match.group() in ('true', 'false'):
+ next_binary = (yield _BooleanToken(pos, raw))
+ else:
+ try:
+ float(raw)
+ next_binary = (yield _NumberToken(pos, raw))
+ except ValueError:
+ next_binary = (yield _KeywordToken(pos, raw))
+ pos = match.end()
+ else:
+ next_binary = (yield _DelimiterToken(pos, text[pos]))
+ pos += 1
+
+
+class _BalancedExpression(_Token):
+ pass
+
+
+def _expression(initial, tokens, data):
+ """
+ Consume some number of tokens and return a balanced PostScript expression.
+
+ Parameters
+ ----------
+ initial : _Token
+ The token that triggered parsing a balanced expression.
+ tokens : iterator of _Token
+ Following tokens.
+ data : bytes
+ Underlying data that the token positions point to.
+
+ Returns
+ -------
+ _BalancedExpression
+ """
+ delim_stack = []
+ token = initial
+ while True:
+ if token.is_delim():
+ if token.raw in ('[', '{'):
+ delim_stack.append(token)
+ elif token.raw in (']', '}'):
+ if not delim_stack:
+ raise RuntimeError(f"unmatched closing token {token}")
+ match = delim_stack.pop()
+ if match.raw != token.opposite():
+ raise RuntimeError(
+ f"opening token {match} closed by {token}"
+ )
+ if not delim_stack:
+ break
+ else:
+ raise RuntimeError(f'unknown delimiter {token}')
+ elif not delim_stack:
+ break
+ token = next(tokens)
+ return _BalancedExpression(
+ initial.pos,
+ data[initial.pos:token.endpos()].decode('ascii', 'replace')
+ )
+
+
+class Type1Font:
+ """
+ A class representing a Type-1 font, for use by backends.
+
+ Attributes
+ ----------
+ parts : tuple
+ A 3-tuple of the cleartext part, the encrypted part, and the finale of
+ zeros.
+
+ decrypted : bytes
+ The decrypted form of ``parts[1]``.
+
+ prop : dict[str, Any]
+ A dictionary of font properties. Noteworthy keys include:
+
+ - FontName: PostScript name of the font
+ - Encoding: dict from numeric codes to glyph names
+ - FontMatrix: bytes object encoding a matrix
+ - UniqueID: optional font identifier, dropped when modifying the font
+ - CharStrings: dict from glyph names to byte code
+ - Subrs: array of byte code subroutines
+ - OtherSubrs: bytes object encoding some PostScript code
+ """
+ __slots__ = ('parts', 'decrypted', 'prop', '_pos', '_abbr')
+ # the _pos dict contains (begin, end) indices to parts[0] + decrypted
+ # so that they can be replaced when transforming the font;
+ # but since sometimes a definition appears in both parts[0] and decrypted,
+ # _pos[name] is an array of such pairs
+ #
+ # _abbr maps three standard abbreviations to their particular names in
+ # this font (e.g. 'RD' is named '-|' in some fonts)
+
+ def __init__(self, input):
+ """
+ Initialize a Type-1 font.
+
+ Parameters
+ ----------
+ input : str or 3-tuple
+ Either a pfb file name, or a 3-tuple of already-decoded Type-1
+ font `~.Type1Font.parts`.
+ """
+ if isinstance(input, tuple) and len(input) == 3:
+ self.parts = input
+ else:
+ with open(input, 'rb') as file:
+ data = self._read(file)
+ self.parts = self._split(data)
+
+ self.decrypted = self._decrypt(self.parts[1], 'eexec')
+ self._abbr = {'RD': 'RD', 'ND': 'ND', 'NP': 'NP'}
+ self._parse()
+
+ def _read(self, file):
+ """Read the font from a file, decoding into usable parts."""
+ rawdata = file.read()
+ if not rawdata.startswith(b'\x80'):
+ return rawdata
+
+ data = b''
+ while rawdata:
+ if not rawdata.startswith(b'\x80'):
+ raise RuntimeError('Broken pfb file (expected byte 128, '
+ 'got %d)' % rawdata[0])
+ type = rawdata[1]
+ if type in (1, 2):
+ length, = struct.unpack('> 8))
+ key = ((key+byte) * 52845 + 22719) & 0xffff
+
+ return bytes(plaintext[ndiscard:])
+
+ @staticmethod
+ def _encrypt(plaintext, key, ndiscard=4):
+ """
+ Encrypt plaintext using the Type-1 font algorithm.
+
+ The algorithm is described in Adobe's "Adobe Type 1 Font Format".
+ The key argument can be an integer, or one of the strings
+ 'eexec' and 'charstring', which map to the key specified for the
+ corresponding part of Type-1 fonts.
+
+ The ndiscard argument should be an integer, usually 4. That
+ number of bytes is prepended to the plaintext before encryption.
+ This function prepends NUL bytes for reproducibility, even though
+ the original algorithm uses random bytes, presumably to avoid
+ cryptanalysis.
+ """
+
+ key = _api.check_getitem({'eexec': 55665, 'charstring': 4330}, key=key)
+ ciphertext = []
+ for byte in b'\0' * ndiscard + plaintext:
+ c = byte ^ (key >> 8)
+ ciphertext.append(c)
+ key = ((key + c) * 52845 + 22719) & 0xffff
+
+ return bytes(ciphertext)
+
+ def _parse(self):
+ """
+ Find the values of various font properties. This limited kind
+ of parsing is described in Chapter 10 "Adobe Type Manager
+ Compatibility" of the Type-1 spec.
+ """
+ # Start with reasonable defaults
+ prop = {'Weight': 'Regular', 'ItalicAngle': 0.0, 'isFixedPitch': False,
+ 'UnderlinePosition': -100, 'UnderlineThickness': 50}
+ pos = {}
+ data = self.parts[0] + self.decrypted
+
+ source = _tokenize(data, True)
+ while True:
+ # See if there is a key to be assigned a value
+ # e.g. /FontName in /FontName /Helvetica def
+ try:
+ token = next(source)
+ except StopIteration:
+ break
+ if token.is_delim():
+ # skip over this - we want top-level keys only
+ _expression(token, source, data)
+ if token.is_slash_name():
+ key = token.value()
+ keypos = token.pos
+ else:
+ continue
+
+ # Some values need special parsing
+ if key in ('Subrs', 'CharStrings', 'Encoding', 'OtherSubrs'):
+ prop[key], endpos = {
+ 'Subrs': self._parse_subrs,
+ 'CharStrings': self._parse_charstrings,
+ 'Encoding': self._parse_encoding,
+ 'OtherSubrs': self._parse_othersubrs
+ }[key](source, data)
+ pos.setdefault(key, []).append((keypos, endpos))
+ continue
+
+ try:
+ token = next(source)
+ except StopIteration:
+ break
+
+ if isinstance(token, _KeywordToken):
+ # constructs like
+ # FontDirectory /Helvetica known {...} {...} ifelse
+ # mean the key was not really a key
+ continue
+
+ if token.is_delim():
+ value = _expression(token, source, data).raw
+ else:
+ value = token.value()
+
+ # look for a 'def' possibly preceded by access modifiers
+ try:
+ kw = next(
+ kw for kw in source
+ if not kw.is_keyword('readonly', 'noaccess', 'executeonly')
+ )
+ except StopIteration:
+ break
+
+ # sometimes noaccess def and readonly def are abbreviated
+ if kw.is_keyword('def', self._abbr['ND'], self._abbr['NP']):
+ prop[key] = value
+ pos.setdefault(key, []).append((keypos, kw.endpos()))
+
+ # detect the standard abbreviations
+ if value == '{noaccess def}':
+ self._abbr['ND'] = key
+ elif value == '{noaccess put}':
+ self._abbr['NP'] = key
+ elif value == '{string currentfile exch readstring pop}':
+ self._abbr['RD'] = key
+
+ # Fill in the various *Name properties
+ if 'FontName' not in prop:
+ prop['FontName'] = (prop.get('FullName') or
+ prop.get('FamilyName') or
+ 'Unknown')
+ if 'FullName' not in prop:
+ prop['FullName'] = prop['FontName']
+ if 'FamilyName' not in prop:
+ extras = ('(?i)([ -](regular|plain|italic|oblique|(semi)?bold|'
+ '(ultra)?light|extra|condensed))+$')
+ prop['FamilyName'] = re.sub(extras, '', prop['FullName'])
+ # Decrypt the encrypted parts
+ ndiscard = prop.get('lenIV', 4)
+ cs = prop['CharStrings']
+ for key, value in cs.items():
+ cs[key] = self._decrypt(value, 'charstring', ndiscard)
+ if 'Subrs' in prop:
+ prop['Subrs'] = [
+ self._decrypt(value, 'charstring', ndiscard)
+ for value in prop['Subrs']
+ ]
+
+ self.prop = prop
+ self._pos = pos
+
+ def _parse_subrs(self, tokens, _data):
+ count_token = next(tokens)
+ if not count_token.is_number():
+ raise RuntimeError(
+ f"Token following /Subrs must be a number, was {count_token}"
+ )
+ count = count_token.value()
+ array = [None] * count
+ next(t for t in tokens if t.is_keyword('array'))
+ for _ in range(count):
+ next(t for t in tokens if t.is_keyword('dup'))
+ index_token = next(tokens)
+ if not index_token.is_number():
+ raise RuntimeError(
+ "Token following dup in Subrs definition must be a "
+ f"number, was {index_token}"
+ )
+ nbytes_token = next(tokens)
+ if not nbytes_token.is_number():
+ raise RuntimeError(
+ "Second token following dup in Subrs definition must "
+ f"be a number, was {nbytes_token}"
+ )
+ token = next(tokens)
+ if not token.is_keyword(self._abbr['RD']):
+ raise RuntimeError(
+ f"Token preceding subr must be {self._abbr['RD']}, "
+ f"was {token}"
+ )
+ binary_token = tokens.send(1+nbytes_token.value())
+ array[index_token.value()] = binary_token.value()
+
+ return array, next(tokens).endpos()
+
+ @staticmethod
+ def _parse_charstrings(tokens, _data):
+ count_token = next(tokens)
+ if not count_token.is_number():
+ raise RuntimeError(
+ "Token following /CharStrings must be a number, "
+ f"was {count_token}"
+ )
+ count = count_token.value()
+ charstrings = {}
+ next(t for t in tokens if t.is_keyword('begin'))
+ while True:
+ token = next(t for t in tokens
+ if t.is_keyword('end') or t.is_slash_name())
+ if token.raw == 'end':
+ return charstrings, token.endpos()
+ glyphname = token.value()
+ nbytes_token = next(tokens)
+ if not nbytes_token.is_number():
+ raise RuntimeError(
+ f"Token following /{glyphname} in CharStrings definition "
+ f"must be a number, was {nbytes_token}"
+ )
+ next(tokens) # usually RD or |-
+ binary_token = tokens.send(1+nbytes_token.value())
+ charstrings[glyphname] = binary_token.value()
+
+ @staticmethod
+ def _parse_encoding(tokens, _data):
+ # this only works for encodings that follow the Adobe manual
+ # but some old fonts include non-compliant data - we log a warning
+ # and return a possibly incomplete encoding
+ encoding = {}
+ while True:
+ token = next(t for t in tokens
+ if t.is_keyword('StandardEncoding', 'dup', 'def'))
+ if token.is_keyword('StandardEncoding'):
+ return _StandardEncoding, token.endpos()
+ if token.is_keyword('def'):
+ return encoding, token.endpos()
+ index_token = next(tokens)
+ if not index_token.is_number():
+ _log.warning(
+ f"Parsing encoding: expected number, got {index_token}"
+ )
+ continue
+ name_token = next(tokens)
+ if not name_token.is_slash_name():
+ _log.warning(
+ f"Parsing encoding: expected slash-name, got {name_token}"
+ )
+ continue
+ encoding[index_token.value()] = name_token.value()
+
+ @staticmethod
+ def _parse_othersubrs(tokens, data):
+ init_pos = None
+ while True:
+ token = next(tokens)
+ if init_pos is None:
+ init_pos = token.pos
+ if token.is_delim():
+ _expression(token, tokens, data)
+ elif token.is_keyword('def', 'ND', '|-'):
+ return data[init_pos:token.endpos()], token.endpos()
+
+ def transform(self, effects):
+ """
+ Return a new font that is slanted and/or extended.
+
+ Parameters
+ ----------
+ effects : dict
+ A dict with optional entries:
+
+ - 'slant' : float, default: 0
+ Tangent of the angle that the font is to be slanted to the
+ right. Negative values slant to the left.
+ - 'extend' : float, default: 1
+ Scaling factor for the font width. Values less than 1 condense
+ the glyphs.
+
+ Returns
+ -------
+ `Type1Font`
+ """
+ fontname = self.prop['FontName']
+ italicangle = self.prop['ItalicAngle']
+
+ array = [
+ float(x) for x in (self.prop['FontMatrix']
+ .lstrip('[').rstrip(']').split())
+ ]
+ oldmatrix = np.eye(3, 3)
+ oldmatrix[0:3, 0] = array[::2]
+ oldmatrix[0:3, 1] = array[1::2]
+ modifier = np.eye(3, 3)
+
+ if 'slant' in effects:
+ slant = effects['slant']
+ fontname += f'_Slant_{int(1000 * slant)}'
+ italicangle = round(
+ float(italicangle) - np.arctan(slant) / np.pi * 180,
+ 5
+ )
+ modifier[1, 0] = slant
+
+ if 'extend' in effects:
+ extend = effects['extend']
+ fontname += f'_Extend_{int(1000 * extend)}'
+ modifier[0, 0] = extend
+
+ newmatrix = np.dot(modifier, oldmatrix)
+ array[::2] = newmatrix[0:3, 0]
+ array[1::2] = newmatrix[0:3, 1]
+ fontmatrix = (
+ f"[{' '.join(_format_approx(x, 6) for x in array)}]"
+ )
+ replacements = (
+ [(x, f'/FontName/{fontname} def')
+ for x in self._pos['FontName']]
+ + [(x, f'/ItalicAngle {italicangle} def')
+ for x in self._pos['ItalicAngle']]
+ + [(x, f'/FontMatrix {fontmatrix} readonly def')
+ for x in self._pos['FontMatrix']]
+ + [(x, '') for x in self._pos.get('UniqueID', [])]
+ )
+
+ data = bytearray(self.parts[0])
+ data.extend(self.decrypted)
+ len0 = len(self.parts[0])
+ for (pos0, pos1), value in sorted(replacements, reverse=True):
+ data[pos0:pos1] = value.encode('ascii', 'replace')
+ if pos0 < len(self.parts[0]):
+ if pos1 >= len(self.parts[0]):
+ raise RuntimeError(
+ f"text to be replaced with {value} spans "
+ "the eexec boundary"
+ )
+ len0 += len(value) - pos1 + pos0
+
+ data = bytes(data)
+ return Type1Font((
+ data[:len0],
+ self._encrypt(data[len0:], 'eexec'),
+ self.parts[2]
+ ))
+
+
+_StandardEncoding = {
+ **{ord(letter): letter for letter in string.ascii_letters},
+ 0: '.notdef',
+ 32: 'space',
+ 33: 'exclam',
+ 34: 'quotedbl',
+ 35: 'numbersign',
+ 36: 'dollar',
+ 37: 'percent',
+ 38: 'ampersand',
+ 39: 'quoteright',
+ 40: 'parenleft',
+ 41: 'parenright',
+ 42: 'asterisk',
+ 43: 'plus',
+ 44: 'comma',
+ 45: 'hyphen',
+ 46: 'period',
+ 47: 'slash',
+ 48: 'zero',
+ 49: 'one',
+ 50: 'two',
+ 51: 'three',
+ 52: 'four',
+ 53: 'five',
+ 54: 'six',
+ 55: 'seven',
+ 56: 'eight',
+ 57: 'nine',
+ 58: 'colon',
+ 59: 'semicolon',
+ 60: 'less',
+ 61: 'equal',
+ 62: 'greater',
+ 63: 'question',
+ 64: 'at',
+ 91: 'bracketleft',
+ 92: 'backslash',
+ 93: 'bracketright',
+ 94: 'asciicircum',
+ 95: 'underscore',
+ 96: 'quoteleft',
+ 123: 'braceleft',
+ 124: 'bar',
+ 125: 'braceright',
+ 126: 'asciitilde',
+ 161: 'exclamdown',
+ 162: 'cent',
+ 163: 'sterling',
+ 164: 'fraction',
+ 165: 'yen',
+ 166: 'florin',
+ 167: 'section',
+ 168: 'currency',
+ 169: 'quotesingle',
+ 170: 'quotedblleft',
+ 171: 'guillemotleft',
+ 172: 'guilsinglleft',
+ 173: 'guilsinglright',
+ 174: 'fi',
+ 175: 'fl',
+ 177: 'endash',
+ 178: 'dagger',
+ 179: 'daggerdbl',
+ 180: 'periodcentered',
+ 182: 'paragraph',
+ 183: 'bullet',
+ 184: 'quotesinglbase',
+ 185: 'quotedblbase',
+ 186: 'quotedblright',
+ 187: 'guillemotright',
+ 188: 'ellipsis',
+ 189: 'perthousand',
+ 191: 'questiondown',
+ 193: 'grave',
+ 194: 'acute',
+ 195: 'circumflex',
+ 196: 'tilde',
+ 197: 'macron',
+ 198: 'breve',
+ 199: 'dotaccent',
+ 200: 'dieresis',
+ 202: 'ring',
+ 203: 'cedilla',
+ 205: 'hungarumlaut',
+ 206: 'ogonek',
+ 207: 'caron',
+ 208: 'emdash',
+ 225: 'AE',
+ 227: 'ordfeminine',
+ 232: 'Lslash',
+ 233: 'Oslash',
+ 234: 'OE',
+ 235: 'ordmasculine',
+ 241: 'ae',
+ 245: 'dotlessi',
+ 248: 'lslash',
+ 249: 'oslash',
+ 250: 'oe',
+ 251: 'germandbls',
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_version.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_version.py
new file mode 100644
index 0000000000000000000000000000000000000000..90807445c956c6ca454fbac2a45b1112f59030be
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/_version.py
@@ -0,0 +1 @@
+version = "3.10.3"
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/animation.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/animation.py
new file mode 100644
index 0000000000000000000000000000000000000000..a87f002011249f353bd740363e55a0d32c62bc38
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/animation.py
@@ -0,0 +1,1823 @@
+import abc
+import base64
+import contextlib
+from io import BytesIO, TextIOWrapper
+import itertools
+import logging
+from pathlib import Path
+import shutil
+import subprocess
+import sys
+from tempfile import TemporaryDirectory
+import uuid
+import warnings
+
+import numpy as np
+from PIL import Image
+
+import matplotlib as mpl
+from matplotlib._animation_data import (
+ DISPLAY_TEMPLATE, INCLUDED_FRAMES, JS_INCLUDE, STYLE_INCLUDE)
+from matplotlib import _api, cbook
+import matplotlib.colors as mcolors
+
+_log = logging.getLogger(__name__)
+
+# Process creation flag for subprocess to prevent it raising a terminal
+# window. See for example https://stackoverflow.com/q/24130623/
+subprocess_creation_flags = (
+ subprocess.CREATE_NO_WINDOW if sys.platform == 'win32' else 0)
+
+
+def adjusted_figsize(w, h, dpi, n):
+ """
+ Compute figure size so that pixels are a multiple of n.
+
+ Parameters
+ ----------
+ w, h : float
+ Size in inches.
+
+ dpi : float
+ The dpi.
+
+ n : int
+ The target multiple.
+
+ Returns
+ -------
+ wnew, hnew : float
+ The new figure size in inches.
+ """
+
+ # this maybe simplified if / when we adopt consistent rounding for
+ # pixel size across the whole library
+ def correct_roundoff(x, dpi, n):
+ if int(x*dpi) % n != 0:
+ if int(np.nextafter(x, np.inf)*dpi) % n == 0:
+ x = np.nextafter(x, np.inf)
+ elif int(np.nextafter(x, -np.inf)*dpi) % n == 0:
+ x = np.nextafter(x, -np.inf)
+ return x
+
+ wnew = int(w * dpi / n) * n / dpi
+ hnew = int(h * dpi / n) * n / dpi
+ return correct_roundoff(wnew, dpi, n), correct_roundoff(hnew, dpi, n)
+
+
+class MovieWriterRegistry:
+ """Registry of available writer classes by human readable name."""
+
+ def __init__(self):
+ self._registered = dict()
+
+ def register(self, name):
+ """
+ Decorator for registering a class under a name.
+
+ Example use::
+
+ @registry.register(name)
+ class Foo:
+ pass
+ """
+ def wrapper(writer_cls):
+ self._registered[name] = writer_cls
+ return writer_cls
+ return wrapper
+
+ def is_available(self, name):
+ """
+ Check if given writer is available by name.
+
+ Parameters
+ ----------
+ name : str
+
+ Returns
+ -------
+ bool
+ """
+ try:
+ cls = self._registered[name]
+ except KeyError:
+ return False
+ return cls.isAvailable()
+
+ def __iter__(self):
+ """Iterate over names of available writer class."""
+ for name in self._registered:
+ if self.is_available(name):
+ yield name
+
+ def list(self):
+ """Get a list of available MovieWriters."""
+ return [*self]
+
+ def __getitem__(self, name):
+ """Get an available writer class from its name."""
+ if self.is_available(name):
+ return self._registered[name]
+ raise RuntimeError(f"Requested MovieWriter ({name}) not available")
+
+
+writers = MovieWriterRegistry()
+
+
+class AbstractMovieWriter(abc.ABC):
+ """
+ Abstract base class for writing movies, providing a way to grab frames by
+ calling `~AbstractMovieWriter.grab_frame`.
+
+ `setup` is called to start the process and `finish` is called afterwards.
+ `saving` is provided as a context manager to facilitate this process as ::
+
+ with moviewriter.saving(fig, outfile='myfile.mp4', dpi=100):
+ # Iterate over frames
+ moviewriter.grab_frame(**savefig_kwargs)
+
+ The use of the context manager ensures that `setup` and `finish` are
+ performed as necessary.
+
+ An instance of a concrete subclass of this class can be given as the
+ ``writer`` argument of `Animation.save()`.
+ """
+
+ def __init__(self, fps=5, metadata=None, codec=None, bitrate=None):
+ self.fps = fps
+ self.metadata = metadata if metadata is not None else {}
+ self.codec = mpl._val_or_rc(codec, 'animation.codec')
+ self.bitrate = mpl._val_or_rc(bitrate, 'animation.bitrate')
+
+ @abc.abstractmethod
+ def setup(self, fig, outfile, dpi=None):
+ """
+ Setup for writing the movie file.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ The figure object that contains the information for frames.
+ outfile : str
+ The filename of the resulting movie file.
+ dpi : float, default: ``fig.dpi``
+ The DPI (or resolution) for the file. This controls the size
+ in pixels of the resulting movie file.
+ """
+ # Check that path is valid
+ Path(outfile).parent.resolve(strict=True)
+ self.outfile = outfile
+ self.fig = fig
+ if dpi is None:
+ dpi = self.fig.dpi
+ self.dpi = dpi
+
+ @property
+ def frame_size(self):
+ """A tuple ``(width, height)`` in pixels of a movie frame."""
+ w, h = self.fig.get_size_inches()
+ return int(w * self.dpi), int(h * self.dpi)
+
+ def _supports_transparency(self):
+ """
+ Whether this writer supports transparency.
+
+ Writers may consult output file type and codec to determine this at runtime.
+ """
+ return False
+
+ @abc.abstractmethod
+ def grab_frame(self, **savefig_kwargs):
+ """
+ Grab the image information from the figure and save as a movie frame.
+
+ All keyword arguments in *savefig_kwargs* are passed on to the
+ `~.Figure.savefig` call that saves the figure. However, several
+ keyword arguments that are supported by `~.Figure.savefig` may not be
+ passed as they are controlled by the MovieWriter:
+
+ - *dpi*, *bbox_inches*: These may not be passed because each frame of the
+ animation much be exactly the same size in pixels.
+ - *format*: This is controlled by the MovieWriter.
+ """
+
+ @abc.abstractmethod
+ def finish(self):
+ """Finish any processing for writing the movie."""
+
+ @contextlib.contextmanager
+ def saving(self, fig, outfile, dpi, *args, **kwargs):
+ """
+ Context manager to facilitate writing the movie file.
+
+ ``*args, **kw`` are any parameters that should be passed to `setup`.
+ """
+ if mpl.rcParams['savefig.bbox'] == 'tight':
+ _log.info("Disabling savefig.bbox = 'tight', as it may cause "
+ "frame size to vary, which is inappropriate for "
+ "animation.")
+
+ # This particular sequence is what contextlib.contextmanager wants
+ self.setup(fig, outfile, dpi, *args, **kwargs)
+ with mpl.rc_context({'savefig.bbox': None}):
+ try:
+ yield self
+ finally:
+ self.finish()
+
+
+class MovieWriter(AbstractMovieWriter):
+ """
+ Base class for writing movies.
+
+ This is a base class for MovieWriter subclasses that write a movie frame
+ data to a pipe. You cannot instantiate this class directly.
+ See examples for how to use its subclasses.
+
+ Attributes
+ ----------
+ frame_format : str
+ The format used in writing frame data, defaults to 'rgba'.
+ fig : `~matplotlib.figure.Figure`
+ The figure to capture data from.
+ This must be provided by the subclasses.
+ """
+
+ # Builtin writer subclasses additionally define the _exec_key and _args_key
+ # attributes, which indicate the rcParams entries where the path to the
+ # executable and additional command-line arguments to the executable are
+ # stored. Third-party writers cannot meaningfully set these as they cannot
+ # extend rcParams with new keys.
+
+ # Pipe-based writers only support RGBA, but file-based ones support more
+ # formats.
+ supported_formats = ["rgba"]
+
+ def __init__(self, fps=5, codec=None, bitrate=None, extra_args=None,
+ metadata=None):
+ """
+ Parameters
+ ----------
+ fps : int, default: 5
+ Movie frame rate (per second).
+ codec : str or None, default: :rc:`animation.codec`
+ The codec to use.
+ bitrate : int, default: :rc:`animation.bitrate`
+ The bitrate of the movie, in kilobits per second. Higher values
+ means higher quality movies, but increase the file size. A value
+ of -1 lets the underlying movie encoder select the bitrate.
+ extra_args : list of str or None, optional
+ Extra command-line arguments passed to the underlying movie encoder. These
+ arguments are passed last to the encoder, just before the filename. The
+ default, None, means to use :rc:`animation.[name-of-encoder]_args` for the
+ builtin writers.
+ metadata : dict[str, str], default: {}
+ A dictionary of keys and values for metadata to include in the
+ output file. Some keys that may be of use include:
+ title, artist, genre, subject, copyright, srcform, comment.
+ """
+ if type(self) is MovieWriter:
+ # TODO MovieWriter is still an abstract class and needs to be
+ # extended with a mixin. This should be clearer in naming
+ # and description. For now, just give a reasonable error
+ # message to users.
+ raise TypeError(
+ 'MovieWriter cannot be instantiated directly. Please use one '
+ 'of its subclasses.')
+
+ super().__init__(fps=fps, metadata=metadata, codec=codec,
+ bitrate=bitrate)
+ self.frame_format = self.supported_formats[0]
+ self.extra_args = extra_args
+
+ def _adjust_frame_size(self):
+ if self.codec == 'h264':
+ wo, ho = self.fig.get_size_inches()
+ w, h = adjusted_figsize(wo, ho, self.dpi, 2)
+ if (wo, ho) != (w, h):
+ self.fig.set_size_inches(w, h, forward=True)
+ _log.info('figure size in inches has been adjusted '
+ 'from %s x %s to %s x %s', wo, ho, w, h)
+ else:
+ w, h = self.fig.get_size_inches()
+ _log.debug('frame size in pixels is %s x %s', *self.frame_size)
+ return w, h
+
+ def setup(self, fig, outfile, dpi=None):
+ # docstring inherited
+ super().setup(fig, outfile, dpi=dpi)
+ self._w, self._h = self._adjust_frame_size()
+ # Run here so that grab_frame() can write the data to a pipe. This
+ # eliminates the need for temp files.
+ self._run()
+
+ def _run(self):
+ # Uses subprocess to call the program for assembling frames into a
+ # movie file. *args* returns the sequence of command line arguments
+ # from a few configuration options.
+ command = self._args()
+ _log.info('MovieWriter._run: running command: %s',
+ cbook._pformat_subprocess(command))
+ PIPE = subprocess.PIPE
+ self._proc = subprocess.Popen(
+ command, stdin=PIPE, stdout=PIPE, stderr=PIPE,
+ creationflags=subprocess_creation_flags)
+
+ def finish(self):
+ """Finish any processing for writing the movie."""
+ out, err = self._proc.communicate()
+ # Use the encoding/errors that universal_newlines would use.
+ out = TextIOWrapper(BytesIO(out)).read()
+ err = TextIOWrapper(BytesIO(err)).read()
+ if out:
+ _log.log(
+ logging.WARNING if self._proc.returncode else logging.DEBUG,
+ "MovieWriter stdout:\n%s", out)
+ if err:
+ _log.log(
+ logging.WARNING if self._proc.returncode else logging.DEBUG,
+ "MovieWriter stderr:\n%s", err)
+ if self._proc.returncode:
+ raise subprocess.CalledProcessError(
+ self._proc.returncode, self._proc.args, out, err)
+
+ def grab_frame(self, **savefig_kwargs):
+ # docstring inherited
+ _validate_grabframe_kwargs(savefig_kwargs)
+ _log.debug('MovieWriter.grab_frame: Grabbing frame.')
+ # Readjust the figure size in case it has been changed by the user.
+ # All frames must have the same size to save the movie correctly.
+ self.fig.set_size_inches(self._w, self._h)
+ # Save the figure data to the sink, using the frame format and dpi.
+ self.fig.savefig(self._proc.stdin, format=self.frame_format,
+ dpi=self.dpi, **savefig_kwargs)
+
+ def _args(self):
+ """Assemble list of encoder-specific command-line arguments."""
+ return NotImplementedError("args needs to be implemented by subclass.")
+
+ @classmethod
+ def bin_path(cls):
+ """
+ Return the binary path to the commandline tool used by a specific
+ subclass. This is a class method so that the tool can be looked for
+ before making a particular MovieWriter subclass available.
+ """
+ return str(mpl.rcParams[cls._exec_key])
+
+ @classmethod
+ def isAvailable(cls):
+ """Return whether a MovieWriter subclass is actually available."""
+ return shutil.which(cls.bin_path()) is not None
+
+
+class FileMovieWriter(MovieWriter):
+ """
+ `MovieWriter` for writing to individual files and stitching at the end.
+
+ This must be sub-classed to be useful.
+ """
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.frame_format = mpl.rcParams['animation.frame_format']
+
+ def setup(self, fig, outfile, dpi=None, frame_prefix=None):
+ """
+ Setup for writing the movie file.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ The figure to grab the rendered frames from.
+ outfile : str
+ The filename of the resulting movie file.
+ dpi : float, default: ``fig.dpi``
+ The dpi of the output file. This, with the figure size,
+ controls the size in pixels of the resulting movie file.
+ frame_prefix : str, optional
+ The filename prefix to use for temporary files. If *None* (the
+ default), files are written to a temporary directory which is
+ deleted by `finish`; if not *None*, no temporary files are
+ deleted.
+ """
+ # Check that path is valid
+ Path(outfile).parent.resolve(strict=True)
+ self.fig = fig
+ self.outfile = outfile
+ if dpi is None:
+ dpi = self.fig.dpi
+ self.dpi = dpi
+ self._adjust_frame_size()
+
+ if frame_prefix is None:
+ self._tmpdir = TemporaryDirectory()
+ self.temp_prefix = str(Path(self._tmpdir.name, 'tmp'))
+ else:
+ self._tmpdir = None
+ self.temp_prefix = frame_prefix
+ self._frame_counter = 0 # used for generating sequential file names
+ self._temp_paths = list()
+ self.fname_format_str = '%s%%07d.%s'
+
+ def __del__(self):
+ if hasattr(self, '_tmpdir') and self._tmpdir:
+ self._tmpdir.cleanup()
+
+ @property
+ def frame_format(self):
+ """
+ Format (png, jpeg, etc.) to use for saving the frames, which can be
+ decided by the individual subclasses.
+ """
+ return self._frame_format
+
+ @frame_format.setter
+ def frame_format(self, frame_format):
+ if frame_format in self.supported_formats:
+ self._frame_format = frame_format
+ else:
+ _api.warn_external(
+ f"Ignoring file format {frame_format!r} which is not "
+ f"supported by {type(self).__name__}; using "
+ f"{self.supported_formats[0]} instead.")
+ self._frame_format = self.supported_formats[0]
+
+ def _base_temp_name(self):
+ # Generates a template name (without number) given the frame format
+ # for extension and the prefix.
+ return self.fname_format_str % (self.temp_prefix, self.frame_format)
+
+ def grab_frame(self, **savefig_kwargs):
+ # docstring inherited
+ # Creates a filename for saving using basename and counter.
+ _validate_grabframe_kwargs(savefig_kwargs)
+ path = Path(self._base_temp_name() % self._frame_counter)
+ self._temp_paths.append(path) # Record the filename for later use.
+ self._frame_counter += 1 # Ensures each created name is unique.
+ _log.debug('FileMovieWriter.grab_frame: Grabbing frame %d to path=%s',
+ self._frame_counter, path)
+ with open(path, 'wb') as sink: # Save figure to the sink.
+ self.fig.savefig(sink, format=self.frame_format, dpi=self.dpi,
+ **savefig_kwargs)
+
+ def finish(self):
+ # Call run here now that all frame grabbing is done. All temp files
+ # are available to be assembled.
+ try:
+ self._run()
+ super().finish()
+ finally:
+ if self._tmpdir:
+ _log.debug(
+ 'MovieWriter: clearing temporary path=%s', self._tmpdir
+ )
+ self._tmpdir.cleanup()
+
+
+@writers.register('pillow')
+class PillowWriter(AbstractMovieWriter):
+ def _supports_transparency(self):
+ return True
+
+ @classmethod
+ def isAvailable(cls):
+ return True
+
+ def setup(self, fig, outfile, dpi=None):
+ super().setup(fig, outfile, dpi=dpi)
+ self._frames = []
+
+ def grab_frame(self, **savefig_kwargs):
+ _validate_grabframe_kwargs(savefig_kwargs)
+ buf = BytesIO()
+ self.fig.savefig(
+ buf, **{**savefig_kwargs, "format": "rgba", "dpi": self.dpi})
+ im = Image.frombuffer(
+ "RGBA", self.frame_size, buf.getbuffer(), "raw", "RGBA", 0, 1)
+ if im.getextrema()[3][0] < 255:
+ # This frame has transparency, so we'll just add it as is.
+ self._frames.append(im)
+ else:
+ # Without transparency, we switch to RGB mode, which converts to P mode a
+ # little better if needed (specifically, this helps with GIF output.)
+ self._frames.append(im.convert("RGB"))
+
+ def finish(self):
+ self._frames[0].save(
+ self.outfile, save_all=True, append_images=self._frames[1:],
+ duration=int(1000 / self.fps), loop=0)
+
+
+# Base class of ffmpeg information. Has the config keys and the common set
+# of arguments that controls the *output* side of things.
+class FFMpegBase:
+ """
+ Mixin class for FFMpeg output.
+
+ This is a base class for the concrete `FFMpegWriter` and `FFMpegFileWriter`
+ classes.
+ """
+
+ _exec_key = 'animation.ffmpeg_path'
+ _args_key = 'animation.ffmpeg_args'
+
+ def _supports_transparency(self):
+ suffix = Path(self.outfile).suffix
+ if suffix in {'.apng', '.avif', '.gif', '.webm', '.webp'}:
+ return True
+ # This list was found by going through `ffmpeg -codecs` for video encoders,
+ # running them with _support_transparency() forced to True, and checking that
+ # the "Pixel format" in Kdenlive included alpha. Note this is not a guarantee
+ # that transparency will work; you may also need to pass `-pix_fmt`, but we
+ # trust the user has done so if they are asking for these formats.
+ return self.codec in {
+ 'apng', 'avrp', 'bmp', 'cfhd', 'dpx', 'ffv1', 'ffvhuff', 'gif', 'huffyuv',
+ 'jpeg2000', 'ljpeg', 'png', 'prores', 'prores_aw', 'prores_ks', 'qtrle',
+ 'rawvideo', 'targa', 'tiff', 'utvideo', 'v408', }
+
+ @property
+ def output_args(self):
+ args = []
+ suffix = Path(self.outfile).suffix
+ if suffix in {'.apng', '.avif', '.gif', '.webm', '.webp'}:
+ self.codec = suffix[1:]
+ else:
+ args.extend(['-vcodec', self.codec])
+ extra_args = (self.extra_args if self.extra_args is not None
+ else mpl.rcParams[self._args_key])
+ # For h264, the default format is yuv444p, which is not compatible
+ # with quicktime (and others). Specifying yuv420p fixes playback on
+ # iOS, as well as HTML5 video in firefox and safari (on both Windows and
+ # macOS). Also fixes internet explorer. This is as of 2015/10/29.
+ if self.codec == 'h264' and '-pix_fmt' not in extra_args:
+ args.extend(['-pix_fmt', 'yuv420p'])
+ # For GIF, we're telling FFmpeg to split the video stream, to generate
+ # a palette, and then use it for encoding.
+ elif self.codec == 'gif' and '-filter_complex' not in extra_args:
+ args.extend(['-filter_complex',
+ 'split [a][b];[a] palettegen [p];[b][p] paletteuse'])
+ # For AVIF, we're telling FFmpeg to split the video stream, extract the alpha,
+ # in order to place it in a secondary stream, as needed by AVIF-in-FFmpeg.
+ elif self.codec == 'avif' and '-filter_complex' not in extra_args:
+ args.extend(['-filter_complex',
+ 'split [rgb][rgba]; [rgba] alphaextract [alpha]',
+ '-map', '[rgb]', '-map', '[alpha]'])
+ if self.bitrate > 0:
+ args.extend(['-b', '%dk' % self.bitrate]) # %dk: bitrate in kbps.
+ for k, v in self.metadata.items():
+ args.extend(['-metadata', f'{k}={v}'])
+ args.extend(extra_args)
+
+ return args + ['-y', self.outfile]
+
+
+# Combine FFMpeg options with pipe-based writing
+@writers.register('ffmpeg')
+class FFMpegWriter(FFMpegBase, MovieWriter):
+ """
+ Pipe-based ffmpeg writer.
+
+ Frames are streamed directly to ffmpeg via a pipe and written in a single pass.
+
+ This effectively works as a slideshow input to ffmpeg with the fps passed as
+ ``-framerate``, so see also `their notes on frame rates`_ for further details.
+
+ .. _their notes on frame rates: https://trac.ffmpeg.org/wiki/Slideshow#Framerates
+ """
+ def _args(self):
+ # Returns the command line parameters for subprocess to use
+ # ffmpeg to create a movie using a pipe.
+ args = [self.bin_path(), '-f', 'rawvideo', '-vcodec', 'rawvideo',
+ '-s', '%dx%d' % self.frame_size, '-pix_fmt', self.frame_format,
+ '-framerate', str(self.fps)]
+ # Logging is quieted because subprocess.PIPE has limited buffer size.
+ # If you have a lot of frames in your animation and set logging to
+ # DEBUG, you will have a buffer overrun.
+ if _log.getEffectiveLevel() > logging.DEBUG:
+ args += ['-loglevel', 'error']
+ args += ['-i', 'pipe:'] + self.output_args
+ return args
+
+
+# Combine FFMpeg options with temp file-based writing
+@writers.register('ffmpeg_file')
+class FFMpegFileWriter(FFMpegBase, FileMovieWriter):
+ """
+ File-based ffmpeg writer.
+
+ Frames are written to temporary files on disk and then stitched together at the end.
+
+ This effectively works as a slideshow input to ffmpeg with the fps passed as
+ ``-framerate``, so see also `their notes on frame rates`_ for further details.
+
+ .. _their notes on frame rates: https://trac.ffmpeg.org/wiki/Slideshow#Framerates
+ """
+ supported_formats = ['png', 'jpeg', 'tiff', 'raw', 'rgba']
+
+ def _args(self):
+ # Returns the command line parameters for subprocess to use
+ # ffmpeg to create a movie using a collection of temp images
+ args = []
+ # For raw frames, we need to explicitly tell ffmpeg the metadata.
+ if self.frame_format in {'raw', 'rgba'}:
+ args += [
+ '-f', 'image2', '-vcodec', 'rawvideo',
+ '-video_size', '%dx%d' % self.frame_size,
+ '-pixel_format', 'rgba',
+ ]
+ args += ['-framerate', str(self.fps), '-i', self._base_temp_name()]
+ if not self._tmpdir:
+ args += ['-frames:v', str(self._frame_counter)]
+ # Logging is quieted because subprocess.PIPE has limited buffer size.
+ # If you have a lot of frames in your animation and set logging to
+ # DEBUG, you will have a buffer overrun.
+ if _log.getEffectiveLevel() > logging.DEBUG:
+ args += ['-loglevel', 'error']
+ return [self.bin_path(), *args, *self.output_args]
+
+
+# Base class for animated GIFs with ImageMagick
+class ImageMagickBase:
+ """
+ Mixin class for ImageMagick output.
+
+ This is a base class for the concrete `ImageMagickWriter` and
+ `ImageMagickFileWriter` classes, which define an ``input_names`` attribute
+ (or property) specifying the input names passed to ImageMagick.
+ """
+
+ _exec_key = 'animation.convert_path'
+ _args_key = 'animation.convert_args'
+
+ def _supports_transparency(self):
+ suffix = Path(self.outfile).suffix
+ return suffix in {'.apng', '.avif', '.gif', '.webm', '.webp'}
+
+ def _args(self):
+ # ImageMagick does not recognize "raw".
+ fmt = "rgba" if self.frame_format == "raw" else self.frame_format
+ extra_args = (self.extra_args if self.extra_args is not None
+ else mpl.rcParams[self._args_key])
+ return [
+ self.bin_path(),
+ "-size", "%ix%i" % self.frame_size,
+ "-depth", "8",
+ "-delay", str(100 / self.fps),
+ "-loop", "0",
+ f"{fmt}:{self.input_names}",
+ *extra_args,
+ self.outfile,
+ ]
+
+ @classmethod
+ def bin_path(cls):
+ binpath = super().bin_path()
+ if binpath == 'convert':
+ binpath = mpl._get_executable_info('magick').executable
+ return binpath
+
+ @classmethod
+ def isAvailable(cls):
+ try:
+ return super().isAvailable()
+ except mpl.ExecutableNotFoundError as _enf:
+ # May be raised by get_executable_info.
+ _log.debug('ImageMagick unavailable due to: %s', _enf)
+ return False
+
+
+# Combine ImageMagick options with pipe-based writing
+@writers.register('imagemagick')
+class ImageMagickWriter(ImageMagickBase, MovieWriter):
+ """
+ Pipe-based animated gif writer.
+
+ Frames are streamed directly to ImageMagick via a pipe and written
+ in a single pass.
+ """
+
+ input_names = "-" # stdin
+
+
+# Combine ImageMagick options with temp file-based writing
+@writers.register('imagemagick_file')
+class ImageMagickFileWriter(ImageMagickBase, FileMovieWriter):
+ """
+ File-based animated gif writer.
+
+ Frames are written to temporary files on disk and then stitched
+ together at the end.
+ """
+
+ supported_formats = ['png', 'jpeg', 'tiff', 'raw', 'rgba']
+ input_names = property(
+ lambda self: f'{self.temp_prefix}*.{self.frame_format}')
+
+
+# Taken directly from jakevdp's JSAnimation package at
+# http://github.com/jakevdp/JSAnimation
+def _included_frames(frame_count, frame_format, frame_dir):
+ return INCLUDED_FRAMES.format(Nframes=frame_count,
+ frame_dir=frame_dir,
+ frame_format=frame_format)
+
+
+def _embedded_frames(frame_list, frame_format):
+ """frame_list should be a list of base64-encoded png files"""
+ if frame_format == 'svg':
+ # Fix MIME type for svg
+ frame_format = 'svg+xml'
+ template = ' frames[{0}] = "data:image/{1};base64,{2}"\n'
+ return "\n" + "".join(
+ template.format(i, frame_format, frame_data.replace('\n', '\\\n'))
+ for i, frame_data in enumerate(frame_list))
+
+
+@writers.register('html')
+class HTMLWriter(FileMovieWriter):
+ """Writer for JavaScript-based HTML movies."""
+
+ supported_formats = ['png', 'jpeg', 'tiff', 'svg']
+
+ @classmethod
+ def isAvailable(cls):
+ return True
+
+ def __init__(self, fps=30, codec=None, bitrate=None, extra_args=None,
+ metadata=None, embed_frames=False, default_mode='loop',
+ embed_limit=None):
+
+ if extra_args:
+ _log.warning("HTMLWriter ignores 'extra_args'")
+ extra_args = () # Don't lookup nonexistent rcParam[args_key].
+ self.embed_frames = embed_frames
+ self.default_mode = default_mode.lower()
+ _api.check_in_list(['loop', 'once', 'reflect'],
+ default_mode=self.default_mode)
+
+ # Save embed limit, which is given in MB
+ self._bytes_limit = mpl._val_or_rc(embed_limit, 'animation.embed_limit')
+ # Convert from MB to bytes
+ self._bytes_limit *= 1024 * 1024
+
+ super().__init__(fps, codec, bitrate, extra_args, metadata)
+
+ def setup(self, fig, outfile, dpi=None, frame_dir=None):
+ outfile = Path(outfile)
+ _api.check_in_list(['.html', '.htm'], outfile_extension=outfile.suffix)
+
+ self._saved_frames = []
+ self._total_bytes = 0
+ self._hit_limit = False
+
+ if not self.embed_frames:
+ if frame_dir is None:
+ frame_dir = outfile.with_name(outfile.stem + '_frames')
+ frame_dir.mkdir(parents=True, exist_ok=True)
+ frame_prefix = frame_dir / 'frame'
+ else:
+ frame_prefix = None
+
+ super().setup(fig, outfile, dpi, frame_prefix)
+ self._clear_temp = False
+
+ def grab_frame(self, **savefig_kwargs):
+ _validate_grabframe_kwargs(savefig_kwargs)
+ if self.embed_frames:
+ # Just stop processing if we hit the limit
+ if self._hit_limit:
+ return
+ f = BytesIO()
+ self.fig.savefig(f, format=self.frame_format,
+ dpi=self.dpi, **savefig_kwargs)
+ imgdata64 = base64.encodebytes(f.getvalue()).decode('ascii')
+ self._total_bytes += len(imgdata64)
+ if self._total_bytes >= self._bytes_limit:
+ _log.warning(
+ "Animation size has reached %s bytes, exceeding the limit "
+ "of %s. If you're sure you want a larger animation "
+ "embedded, set the animation.embed_limit rc parameter to "
+ "a larger value (in MB). This and further frames will be "
+ "dropped.", self._total_bytes, self._bytes_limit)
+ self._hit_limit = True
+ else:
+ self._saved_frames.append(imgdata64)
+ else:
+ return super().grab_frame(**savefig_kwargs)
+
+ def finish(self):
+ # save the frames to an html file
+ if self.embed_frames:
+ fill_frames = _embedded_frames(self._saved_frames,
+ self.frame_format)
+ frame_count = len(self._saved_frames)
+ else:
+ # temp names is filled by FileMovieWriter
+ frame_count = len(self._temp_paths)
+ fill_frames = _included_frames(
+ frame_count, self.frame_format,
+ self._temp_paths[0].parent.relative_to(self.outfile.parent))
+ mode_dict = dict(once_checked='',
+ loop_checked='',
+ reflect_checked='')
+ mode_dict[self.default_mode + '_checked'] = 'checked'
+
+ interval = 1000 // self.fps
+
+ with open(self.outfile, 'w') as of:
+ of.write(JS_INCLUDE + STYLE_INCLUDE)
+ of.write(DISPLAY_TEMPLATE.format(id=uuid.uuid4().hex,
+ Nframes=frame_count,
+ fill_frames=fill_frames,
+ interval=interval,
+ **mode_dict))
+
+ # Duplicate the temporary file clean up logic from
+ # FileMovieWriter.finish. We cannot call the inherited version of
+ # finish because it assumes that there is a subprocess that we either
+ # need to call to merge many frames together or that there is a
+ # subprocess call that we need to clean up.
+ if self._tmpdir:
+ _log.debug('MovieWriter: clearing temporary path=%s', self._tmpdir)
+ self._tmpdir.cleanup()
+
+
+class Animation:
+ """
+ A base class for Animations.
+
+ This class is not usable as is, and should be subclassed to provide needed
+ behavior.
+
+ .. note::
+
+ You must store the created Animation in a variable that lives as long
+ as the animation should run. Otherwise, the Animation object will be
+ garbage-collected and the animation stops.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ The figure object used to get needed events, such as draw or resize.
+
+ event_source : object, optional
+ A class that can run a callback when desired events
+ are generated, as well as be stopped and started.
+
+ Examples include timers (see `TimedAnimation`) and file
+ system notifications.
+
+ blit : bool, default: False
+ Whether blitting is used to optimize drawing. If the backend does not
+ support blitting, then this parameter has no effect.
+
+ See Also
+ --------
+ FuncAnimation, ArtistAnimation
+ """
+
+ def __init__(self, fig, event_source=None, blit=False):
+ self._draw_was_started = False
+
+ self._fig = fig
+ # Disables blitting for backends that don't support it. This
+ # allows users to request it if available, but still have a
+ # fallback that works if it is not.
+ self._blit = blit and fig.canvas.supports_blit
+
+ # These are the basics of the animation. The frame sequence represents
+ # information for each frame of the animation and depends on how the
+ # drawing is handled by the subclasses. The event source fires events
+ # that cause the frame sequence to be iterated.
+ self.frame_seq = self.new_frame_seq()
+ self.event_source = event_source
+
+ # Instead of starting the event source now, we connect to the figure's
+ # draw_event, so that we only start once the figure has been drawn.
+ self._first_draw_id = fig.canvas.mpl_connect('draw_event', self._start)
+
+ # Connect to the figure's close_event so that we don't continue to
+ # fire events and try to draw to a deleted figure.
+ self._close_id = self._fig.canvas.mpl_connect('close_event',
+ self._stop)
+ if self._blit:
+ self._setup_blit()
+
+ def __del__(self):
+ if not getattr(self, '_draw_was_started', True):
+ warnings.warn(
+ 'Animation was deleted without rendering anything. This is '
+ 'most likely not intended. To prevent deletion, assign the '
+ 'Animation to a variable, e.g. `anim`, that exists until you '
+ 'output the Animation using `plt.show()` or '
+ '`anim.save()`.'
+ )
+
+ def _start(self, *args):
+ """
+ Starts interactive animation. Adds the draw frame command to the GUI
+ handler, calls show to start the event loop.
+ """
+ # Do not start the event source if saving() it.
+ if self._fig.canvas.is_saving():
+ return
+ # First disconnect our draw event handler
+ self._fig.canvas.mpl_disconnect(self._first_draw_id)
+
+ # Now do any initial draw
+ self._init_draw()
+
+ # Add our callback for stepping the animation and
+ # actually start the event_source.
+ self.event_source.add_callback(self._step)
+ self.event_source.start()
+
+ def _stop(self, *args):
+ # On stop we disconnect all of our events.
+ if self._blit:
+ self._fig.canvas.mpl_disconnect(self._resize_id)
+ self._fig.canvas.mpl_disconnect(self._close_id)
+ self.event_source.remove_callback(self._step)
+ self.event_source = None
+
+ def save(self, filename, writer=None, fps=None, dpi=None, codec=None,
+ bitrate=None, extra_args=None, metadata=None, extra_anim=None,
+ savefig_kwargs=None, *, progress_callback=None):
+ """
+ Save the animation as a movie file by drawing every frame.
+
+ Parameters
+ ----------
+ filename : str
+ The output filename, e.g., :file:`mymovie.mp4`.
+
+ writer : `MovieWriter` or str, default: :rc:`animation.writer`
+ A `MovieWriter` instance to use or a key that identifies a
+ class to use, such as 'ffmpeg'.
+
+ fps : int, optional
+ Movie frame rate (per second). If not set, the frame rate from the
+ animation's frame interval.
+
+ dpi : float, default: :rc:`savefig.dpi`
+ Controls the dots per inch for the movie frames. Together with
+ the figure's size in inches, this controls the size of the movie.
+
+ codec : str, default: :rc:`animation.codec`.
+ The video codec to use. Not all codecs are supported by a given
+ `MovieWriter`.
+
+ bitrate : int, default: :rc:`animation.bitrate`
+ The bitrate of the movie, in kilobits per second. Higher values
+ means higher quality movies, but increase the file size. A value
+ of -1 lets the underlying movie encoder select the bitrate.
+
+ extra_args : list of str or None, optional
+ Extra command-line arguments passed to the underlying movie encoder. These
+ arguments are passed last to the encoder, just before the output filename.
+ The default, None, means to use :rc:`animation.[name-of-encoder]_args` for
+ the builtin writers.
+
+ metadata : dict[str, str], default: {}
+ Dictionary of keys and values for metadata to include in
+ the output file. Some keys that may be of use include:
+ title, artist, genre, subject, copyright, srcform, comment.
+
+ extra_anim : list, default: []
+ Additional `Animation` objects that should be included
+ in the saved movie file. These need to be from the same
+ `.Figure` instance. Also, animation frames will
+ just be simply combined, so there should be a 1:1 correspondence
+ between the frames from the different animations.
+
+ savefig_kwargs : dict, default: {}
+ Keyword arguments passed to each `~.Figure.savefig` call used to
+ save the individual frames.
+
+ progress_callback : function, optional
+ A callback function that will be called for every frame to notify
+ the saving progress. It must have the signature ::
+
+ def func(current_frame: int, total_frames: int) -> Any
+
+ where *current_frame* is the current frame number and *total_frames* is the
+ total number of frames to be saved. *total_frames* is set to None, if the
+ total number of frames cannot be determined. Return values may exist but are
+ ignored.
+
+ Example code to write the progress to stdout::
+
+ progress_callback = lambda i, n: print(f'Saving frame {i}/{n}')
+
+ Notes
+ -----
+ *fps*, *codec*, *bitrate*, *extra_args* and *metadata* are used to
+ construct a `.MovieWriter` instance and can only be passed if
+ *writer* is a string. If they are passed as non-*None* and *writer*
+ is a `.MovieWriter`, a `RuntimeError` will be raised.
+ """
+
+ all_anim = [self]
+ if extra_anim is not None:
+ all_anim.extend(anim for anim in extra_anim
+ if anim._fig is self._fig)
+
+ # Disable "Animation was deleted without rendering" warning.
+ for anim in all_anim:
+ anim._draw_was_started = True
+
+ if writer is None:
+ writer = mpl.rcParams['animation.writer']
+ elif (not isinstance(writer, str) and
+ any(arg is not None
+ for arg in (fps, codec, bitrate, extra_args, metadata))):
+ raise RuntimeError('Passing in values for arguments '
+ 'fps, codec, bitrate, extra_args, or metadata '
+ 'is not supported when writer is an existing '
+ 'MovieWriter instance. These should instead be '
+ 'passed as arguments when creating the '
+ 'MovieWriter instance.')
+
+ if savefig_kwargs is None:
+ savefig_kwargs = {}
+ else:
+ # we are going to mutate this below
+ savefig_kwargs = dict(savefig_kwargs)
+
+ if fps is None and hasattr(self, '_interval'):
+ # Convert interval in ms to frames per second
+ fps = 1000. / self._interval
+
+ # Reuse the savefig DPI for ours if none is given.
+ dpi = mpl._val_or_rc(dpi, 'savefig.dpi')
+ if dpi == 'figure':
+ dpi = self._fig.dpi
+
+ writer_kwargs = {}
+ if codec is not None:
+ writer_kwargs['codec'] = codec
+ if bitrate is not None:
+ writer_kwargs['bitrate'] = bitrate
+ if extra_args is not None:
+ writer_kwargs['extra_args'] = extra_args
+ if metadata is not None:
+ writer_kwargs['metadata'] = metadata
+
+ # If we have the name of a writer, instantiate an instance of the
+ # registered class.
+ if isinstance(writer, str):
+ try:
+ writer_cls = writers[writer]
+ except RuntimeError: # Raised if not available.
+ writer_cls = PillowWriter # Always available.
+ _log.warning("MovieWriter %s unavailable; using Pillow "
+ "instead.", writer)
+ writer = writer_cls(fps, **writer_kwargs)
+ _log.info('Animation.save using %s', type(writer))
+
+ if 'bbox_inches' in savefig_kwargs:
+ _log.warning("Warning: discarding the 'bbox_inches' argument in "
+ "'savefig_kwargs' as it may cause frame size "
+ "to vary, which is inappropriate for animation.")
+ savefig_kwargs.pop('bbox_inches')
+
+ # Create a new sequence of frames for saved data. This is different
+ # from new_frame_seq() to give the ability to save 'live' generated
+ # frame information to be saved later.
+ # TODO: Right now, after closing the figure, saving a movie won't work
+ # since GUI widgets are gone. Either need to remove extra code to
+ # allow for this non-existent use case or find a way to make it work.
+
+ def _pre_composite_to_white(color):
+ r, g, b, a = mcolors.to_rgba(color)
+ return a * np.array([r, g, b]) + 1 - a
+
+ # canvas._is_saving = True makes the draw_event animation-starting
+ # callback a no-op; canvas.manager = None prevents resizing the GUI
+ # widget (both are likewise done in savefig()).
+ with (writer.saving(self._fig, filename, dpi),
+ cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None)):
+ if not writer._supports_transparency():
+ facecolor = savefig_kwargs.get('facecolor',
+ mpl.rcParams['savefig.facecolor'])
+ if facecolor == 'auto':
+ facecolor = self._fig.get_facecolor()
+ savefig_kwargs['facecolor'] = _pre_composite_to_white(facecolor)
+ savefig_kwargs['transparent'] = False # just to be safe!
+
+ for anim in all_anim:
+ anim._init_draw() # Clear the initial frame
+ frame_number = 0
+ # TODO: Currently only FuncAnimation has a save_count
+ # attribute. Can we generalize this to all Animations?
+ save_count_list = [getattr(a, '_save_count', None)
+ for a in all_anim]
+ if None in save_count_list:
+ total_frames = None
+ else:
+ total_frames = sum(save_count_list)
+ for data in zip(*[a.new_saved_frame_seq() for a in all_anim]):
+ for anim, d in zip(all_anim, data):
+ # TODO: See if turning off blit is really necessary
+ anim._draw_next_frame(d, blit=False)
+ if progress_callback is not None:
+ progress_callback(frame_number, total_frames)
+ frame_number += 1
+ writer.grab_frame(**savefig_kwargs)
+
+ def _step(self, *args):
+ """
+ Handler for getting events. By default, gets the next frame in the
+ sequence and hands the data off to be drawn.
+ """
+ # Returns True to indicate that the event source should continue to
+ # call _step, until the frame sequence reaches the end of iteration,
+ # at which point False will be returned.
+ try:
+ framedata = next(self.frame_seq)
+ self._draw_next_frame(framedata, self._blit)
+ return True
+ except StopIteration:
+ return False
+
+ def new_frame_seq(self):
+ """Return a new sequence of frame information."""
+ # Default implementation is just an iterator over self._framedata
+ return iter(self._framedata)
+
+ def new_saved_frame_seq(self):
+ """Return a new sequence of saved/cached frame information."""
+ # Default is the same as the regular frame sequence
+ return self.new_frame_seq()
+
+ def _draw_next_frame(self, framedata, blit):
+ # Breaks down the drawing of the next frame into steps of pre- and
+ # post- draw, as well as the drawing of the frame itself.
+ self._pre_draw(framedata, blit)
+ self._draw_frame(framedata)
+ self._post_draw(framedata, blit)
+
+ def _init_draw(self):
+ # Initial draw to clear the frame. Also used by the blitting code
+ # when a clean base is required.
+ self._draw_was_started = True
+
+ def _pre_draw(self, framedata, blit):
+ # Perform any cleaning or whatnot before the drawing of the frame.
+ # This default implementation allows blit to clear the frame.
+ if blit:
+ self._blit_clear(self._drawn_artists)
+
+ def _draw_frame(self, framedata):
+ # Performs actual drawing of the frame.
+ raise NotImplementedError('Needs to be implemented by subclasses to'
+ ' actually make an animation.')
+
+ def _post_draw(self, framedata, blit):
+ # After the frame is rendered, this handles the actual flushing of
+ # the draw, which can be a direct draw_idle() or make use of the
+ # blitting.
+ if blit and self._drawn_artists:
+ self._blit_draw(self._drawn_artists)
+ else:
+ self._fig.canvas.draw_idle()
+
+ # The rest of the code in this class is to facilitate easy blitting
+ def _blit_draw(self, artists):
+ # Handles blitted drawing, which renders only the artists given instead
+ # of the entire figure.
+ updated_ax = {a.axes for a in artists}
+ # Enumerate artists to cache Axes backgrounds. We do not draw
+ # artists yet to not cache foreground from plots with shared Axes
+ for ax in updated_ax:
+ # If we haven't cached the background for the current view of this
+ # Axes object, do so now. This might not always be reliable, but
+ # it's an attempt to automate the process.
+ cur_view = ax._get_view()
+ view, bg = self._blit_cache.get(ax, (object(), None))
+ if cur_view != view:
+ self._blit_cache[ax] = (
+ cur_view, ax.figure.canvas.copy_from_bbox(ax.bbox))
+ # Make a separate pass to draw foreground.
+ for a in artists:
+ a.axes.draw_artist(a)
+ # After rendering all the needed artists, blit each Axes individually.
+ for ax in updated_ax:
+ ax.figure.canvas.blit(ax.bbox)
+
+ def _blit_clear(self, artists):
+ # Get a list of the Axes that need clearing from the artists that
+ # have been drawn. Grab the appropriate saved background from the
+ # cache and restore.
+ axes = {a.axes for a in artists}
+ for ax in axes:
+ try:
+ view, bg = self._blit_cache[ax]
+ except KeyError:
+ continue
+ if ax._get_view() == view:
+ ax.figure.canvas.restore_region(bg)
+ else:
+ self._blit_cache.pop(ax)
+
+ def _setup_blit(self):
+ # Setting up the blit requires: a cache of the background for the Axes
+ self._blit_cache = dict()
+ self._drawn_artists = []
+ # _post_draw needs to be called first to initialize the renderer
+ self._post_draw(None, self._blit)
+ # Then we need to clear the Frame for the initial draw
+ # This is typically handled in _on_resize because QT and Tk
+ # emit a resize event on launch, but the macosx backend does not,
+ # thus we force it here for everyone for consistency
+ self._init_draw()
+ # Connect to future resize events
+ self._resize_id = self._fig.canvas.mpl_connect('resize_event',
+ self._on_resize)
+
+ def _on_resize(self, event):
+ # On resize, we need to disable the resize event handling so we don't
+ # get too many events. Also stop the animation events, so that
+ # we're paused. Reset the cache and re-init. Set up an event handler
+ # to catch once the draw has actually taken place.
+ self._fig.canvas.mpl_disconnect(self._resize_id)
+ self.event_source.stop()
+ self._blit_cache.clear()
+ self._init_draw()
+ self._resize_id = self._fig.canvas.mpl_connect('draw_event',
+ self._end_redraw)
+
+ def _end_redraw(self, event):
+ # Now that the redraw has happened, do the post draw flushing and
+ # blit handling. Then re-enable all of the original events.
+ self._post_draw(None, False)
+ self.event_source.start()
+ self._fig.canvas.mpl_disconnect(self._resize_id)
+ self._resize_id = self._fig.canvas.mpl_connect('resize_event',
+ self._on_resize)
+
+ def to_html5_video(self, embed_limit=None):
+ """
+ Convert the animation to an HTML5 ```` tag.
+
+ This saves the animation as an h264 video, encoded in base64
+ directly into the HTML5 video tag. This respects :rc:`animation.writer`
+ and :rc:`animation.bitrate`. This also makes use of the
+ *interval* to control the speed, and uses the *repeat*
+ parameter to decide whether to loop.
+
+ Parameters
+ ----------
+ embed_limit : float, optional
+ Limit, in MB, of the returned animation. No animation is created
+ if the limit is exceeded.
+ Defaults to :rc:`animation.embed_limit` = 20.0.
+
+ Returns
+ -------
+ str
+ An HTML5 video tag with the animation embedded as base64 encoded
+ h264 video.
+ If the *embed_limit* is exceeded, this returns the string
+ "Video too large to embed."
+ """
+ VIDEO_TAG = r'''
+
+ Your browser does not support the video tag.
+ '''
+ # Cache the rendering of the video as HTML
+ if not hasattr(self, '_base64_video'):
+ # Save embed limit, which is given in MB
+ embed_limit = mpl._val_or_rc(embed_limit, 'animation.embed_limit')
+
+ # Convert from MB to bytes
+ embed_limit *= 1024 * 1024
+
+ # Can't open a NamedTemporaryFile twice on Windows, so use a
+ # TemporaryDirectory instead.
+ with TemporaryDirectory() as tmpdir:
+ path = Path(tmpdir, "temp.m4v")
+ # We create a writer manually so that we can get the
+ # appropriate size for the tag
+ Writer = writers[mpl.rcParams['animation.writer']]
+ writer = Writer(codec='h264',
+ bitrate=mpl.rcParams['animation.bitrate'],
+ fps=1000. / self._interval)
+ self.save(str(path), writer=writer)
+ # Now open and base64 encode.
+ vid64 = base64.encodebytes(path.read_bytes())
+
+ vid_len = len(vid64)
+ if vid_len >= embed_limit:
+ _log.warning(
+ "Animation movie is %s bytes, exceeding the limit of %s. "
+ "If you're sure you want a large animation embedded, set "
+ "the animation.embed_limit rc parameter to a larger value "
+ "(in MB).", vid_len, embed_limit)
+ else:
+ self._base64_video = vid64.decode('ascii')
+ self._video_size = 'width="{}" height="{}"'.format(
+ *writer.frame_size)
+
+ # If we exceeded the size, this attribute won't exist
+ if hasattr(self, '_base64_video'):
+ # Default HTML5 options are to autoplay and display video controls
+ options = ['controls', 'autoplay']
+
+ # If we're set to repeat, make it loop
+ if getattr(self, '_repeat', False):
+ options.append('loop')
+
+ return VIDEO_TAG.format(video=self._base64_video,
+ size=self._video_size,
+ options=' '.join(options))
+ else:
+ return 'Video too large to embed.'
+
+ def to_jshtml(self, fps=None, embed_frames=True, default_mode=None):
+ """
+ Generate HTML representation of the animation.
+
+ Parameters
+ ----------
+ fps : int, optional
+ Movie frame rate (per second). If not set, the frame rate from
+ the animation's frame interval.
+ embed_frames : bool, optional
+ default_mode : str, optional
+ What to do when the animation ends. Must be one of ``{'loop',
+ 'once', 'reflect'}``. Defaults to ``'loop'`` if the *repeat*
+ parameter is True, otherwise ``'once'``.
+
+ Returns
+ -------
+ str
+ An HTML representation of the animation embedded as a js object as
+ produced with the `.HTMLWriter`.
+ """
+ if fps is None and hasattr(self, '_interval'):
+ # Convert interval in ms to frames per second
+ fps = 1000 / self._interval
+
+ # If we're not given a default mode, choose one base on the value of
+ # the _repeat attribute
+ if default_mode is None:
+ default_mode = 'loop' if getattr(self, '_repeat',
+ False) else 'once'
+
+ if not hasattr(self, "_html_representation"):
+ # Can't open a NamedTemporaryFile twice on Windows, so use a
+ # TemporaryDirectory instead.
+ with TemporaryDirectory() as tmpdir:
+ path = Path(tmpdir, "temp.html")
+ writer = HTMLWriter(fps=fps,
+ embed_frames=embed_frames,
+ default_mode=default_mode)
+ self.save(str(path), writer=writer)
+ self._html_representation = path.read_text()
+
+ return self._html_representation
+
+ def _repr_html_(self):
+ """IPython display hook for rendering."""
+ fmt = mpl.rcParams['animation.html']
+ if fmt == 'html5':
+ return self.to_html5_video()
+ elif fmt == 'jshtml':
+ return self.to_jshtml()
+
+ def pause(self):
+ """Pause the animation."""
+ self.event_source.stop()
+ if self._blit:
+ for artist in self._drawn_artists:
+ artist.set_animated(False)
+
+ def resume(self):
+ """Resume the animation."""
+ self.event_source.start()
+ if self._blit:
+ for artist in self._drawn_artists:
+ artist.set_animated(True)
+
+
+class TimedAnimation(Animation):
+ """
+ `Animation` subclass for time-based animation.
+
+ A new frame is drawn every *interval* milliseconds.
+
+ .. note::
+
+ You must store the created Animation in a variable that lives as long
+ as the animation should run. Otherwise, the Animation object will be
+ garbage-collected and the animation stops.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ The figure object used to get needed events, such as draw or resize.
+ interval : int, default: 200
+ Delay between frames in milliseconds.
+ repeat_delay : int, default: 0
+ The delay in milliseconds between consecutive animation runs, if
+ *repeat* is True.
+ repeat : bool, default: True
+ Whether the animation repeats when the sequence of frames is completed.
+ blit : bool, default: False
+ Whether blitting is used to optimize drawing.
+ """
+ def __init__(self, fig, interval=200, repeat_delay=0, repeat=True,
+ event_source=None, *args, **kwargs):
+ self._interval = interval
+ # Undocumented support for repeat_delay = None as backcompat.
+ self._repeat_delay = repeat_delay if repeat_delay is not None else 0
+ self._repeat = repeat
+ # If we're not given an event source, create a new timer. This permits
+ # sharing timers between animation objects for syncing animations.
+ if event_source is None:
+ event_source = fig.canvas.new_timer(interval=self._interval)
+ super().__init__(fig, event_source=event_source, *args, **kwargs)
+
+ def _step(self, *args):
+ """Handler for getting events."""
+ # Extends the _step() method for the Animation class. If
+ # Animation._step signals that it reached the end and we want to
+ # repeat, we refresh the frame sequence and return True. If
+ # _repeat_delay is set, change the event_source's interval to our loop
+ # delay and set the callback to one which will then set the interval
+ # back.
+ still_going = super()._step(*args)
+ if not still_going:
+ if self._repeat:
+ # Restart the draw loop
+ self._init_draw()
+ self.frame_seq = self.new_frame_seq()
+ self.event_source.interval = self._repeat_delay
+ return True
+ else:
+ # We are done with the animation. Call pause to remove
+ # animated flags from artists that were using blitting
+ self.pause()
+ if self._blit:
+ # Remove the resize callback if we were blitting
+ self._fig.canvas.mpl_disconnect(self._resize_id)
+ self._fig.canvas.mpl_disconnect(self._close_id)
+ self.event_source = None
+ return False
+
+ self.event_source.interval = self._interval
+ return True
+
+
+class ArtistAnimation(TimedAnimation):
+ """
+ `TimedAnimation` subclass that creates an animation by using a fixed
+ set of `.Artist` objects.
+
+ Before creating an instance, all plotting should have taken place
+ and the relevant artists saved.
+
+ .. note::
+
+ You must store the created Animation in a variable that lives as long
+ as the animation should run. Otherwise, the Animation object will be
+ garbage-collected and the animation stops.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ The figure object used to get needed events, such as draw or resize.
+ artists : list
+ Each list entry is a collection of `.Artist` objects that are made
+ visible on the corresponding frame. Other artists are made invisible.
+ interval : int, default: 200
+ Delay between frames in milliseconds.
+ repeat_delay : int, default: 0
+ The delay in milliseconds between consecutive animation runs, if
+ *repeat* is True.
+ repeat : bool, default: True
+ Whether the animation repeats when the sequence of frames is completed.
+ blit : bool, default: False
+ Whether blitting is used to optimize drawing.
+ """
+
+ def __init__(self, fig, artists, *args, **kwargs):
+ # Internal list of artists drawn in the most recent frame.
+ self._drawn_artists = []
+
+ # Use the list of artists as the framedata, which will be iterated
+ # over by the machinery.
+ self._framedata = artists
+ super().__init__(fig, *args, **kwargs)
+
+ def _init_draw(self):
+ super()._init_draw()
+ # Make all the artists involved in *any* frame invisible
+ figs = set()
+ for f in self.new_frame_seq():
+ for artist in f:
+ artist.set_visible(False)
+ artist.set_animated(self._blit)
+ # Assemble a list of unique figures that need flushing
+ if artist.get_figure() not in figs:
+ figs.add(artist.get_figure())
+
+ # Flush the needed figures
+ for fig in figs:
+ fig.canvas.draw_idle()
+
+ def _pre_draw(self, framedata, blit):
+ """Clears artists from the last frame."""
+ if blit:
+ # Let blit handle clearing
+ self._blit_clear(self._drawn_artists)
+ else:
+ # Otherwise, make all the artists from the previous frame invisible
+ for artist in self._drawn_artists:
+ artist.set_visible(False)
+
+ def _draw_frame(self, artists):
+ # Save the artists that were passed in as framedata for the other
+ # steps (esp. blitting) to use.
+ self._drawn_artists = artists
+
+ # Make all the artists from the current frame visible
+ for artist in artists:
+ artist.set_visible(True)
+
+
+class FuncAnimation(TimedAnimation):
+ """
+ `TimedAnimation` subclass that makes an animation by repeatedly calling
+ a function *func*.
+
+ .. note::
+
+ You must store the created Animation in a variable that lives as long
+ as the animation should run. Otherwise, the Animation object will be
+ garbage-collected and the animation stops.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ The figure object used to get needed events, such as draw or resize.
+
+ func : callable
+ The function to call at each frame. The first argument will
+ be the next value in *frames*. Any additional positional
+ arguments can be supplied using `functools.partial` or via the *fargs*
+ parameter.
+
+ The required signature is::
+
+ def func(frame, *fargs) -> iterable_of_artists
+
+ It is often more convenient to provide the arguments using
+ `functools.partial`. In this way it is also possible to pass keyword
+ arguments. To pass a function with both positional and keyword
+ arguments, set all arguments as keyword arguments, just leaving the
+ *frame* argument unset::
+
+ def func(frame, art, *, y=None):
+ ...
+
+ ani = FuncAnimation(fig, partial(func, art=ln, y='foo'))
+
+ If ``blit == True``, *func* must return an iterable of all artists
+ that were modified or created. This information is used by the blitting
+ algorithm to determine which parts of the figure have to be updated.
+ The return value is unused if ``blit == False`` and may be omitted in
+ that case.
+
+ frames : iterable, int, generator function, or None, optional
+ Source of data to pass *func* and each frame of the animation
+
+ - If an iterable, then simply use the values provided. If the
+ iterable has a length, it will override the *save_count* kwarg.
+
+ - If an integer, then equivalent to passing ``range(frames)``
+
+ - If a generator function, then must have the signature::
+
+ def gen_function() -> obj
+
+ - If *None*, then equivalent to passing ``itertools.count``.
+
+ In all of these cases, the values in *frames* is simply passed through
+ to the user-supplied *func* and thus can be of any type.
+
+ init_func : callable, optional
+ A function used to draw a clear frame. If not given, the results of
+ drawing from the first item in the frames sequence will be used. This
+ function will be called once before the first frame.
+
+ The required signature is::
+
+ def init_func() -> iterable_of_artists
+
+ If ``blit == True``, *init_func* must return an iterable of artists
+ to be re-drawn. This information is used by the blitting algorithm to
+ determine which parts of the figure have to be updated. The return
+ value is unused if ``blit == False`` and may be omitted in that case.
+
+ fargs : tuple or None, optional
+ Additional arguments to pass to each call to *func*. Note: the use of
+ `functools.partial` is preferred over *fargs*. See *func* for details.
+
+ save_count : int, optional
+ Fallback for the number of values from *frames* to cache. This is
+ only used if the number of frames cannot be inferred from *frames*,
+ i.e. when it's an iterator without length or a generator.
+
+ interval : int, default: 200
+ Delay between frames in milliseconds.
+
+ repeat_delay : int, default: 0
+ The delay in milliseconds between consecutive animation runs, if
+ *repeat* is True.
+
+ repeat : bool, default: True
+ Whether the animation repeats when the sequence of frames is completed.
+
+ blit : bool, default: False
+ Whether blitting is used to optimize drawing. Note: when using
+ blitting, any animated artists will be drawn according to their zorder;
+ however, they will be drawn on top of any previous artists, regardless
+ of their zorder.
+
+ cache_frame_data : bool, default: True
+ Whether frame data is cached. Disabling cache might be helpful when
+ frames contain large objects.
+ """
+ def __init__(self, fig, func, frames=None, init_func=None, fargs=None,
+ save_count=None, *, cache_frame_data=True, **kwargs):
+ if fargs:
+ self._args = fargs
+ else:
+ self._args = ()
+ self._func = func
+ self._init_func = init_func
+
+ # Amount of framedata to keep around for saving movies. This is only
+ # used if we don't know how many frames there will be: in the case
+ # of no generator or in the case of a callable.
+ self._save_count = save_count
+ # Set up a function that creates a new iterable when needed. If nothing
+ # is passed in for frames, just use itertools.count, which will just
+ # keep counting from 0. A callable passed in for frames is assumed to
+ # be a generator. An iterable will be used as is, and anything else
+ # will be treated as a number of frames.
+ if frames is None:
+ self._iter_gen = itertools.count
+ elif callable(frames):
+ self._iter_gen = frames
+ elif np.iterable(frames):
+ if kwargs.get('repeat', True):
+ self._tee_from = frames
+ def iter_frames(frames=frames):
+ this, self._tee_from = itertools.tee(self._tee_from, 2)
+ yield from this
+ self._iter_gen = iter_frames
+ else:
+ self._iter_gen = lambda: iter(frames)
+ if hasattr(frames, '__len__'):
+ self._save_count = len(frames)
+ if save_count is not None:
+ _api.warn_external(
+ f"You passed in an explicit {save_count=} "
+ "which is being ignored in favor of "
+ f"{len(frames)=}."
+ )
+ else:
+ self._iter_gen = lambda: iter(range(frames))
+ self._save_count = frames
+ if save_count is not None:
+ _api.warn_external(
+ f"You passed in an explicit {save_count=} which is being "
+ f"ignored in favor of {frames=}."
+ )
+ if self._save_count is None and cache_frame_data:
+ _api.warn_external(
+ f"{frames=!r} which we can infer the length of, "
+ "did not pass an explicit *save_count* "
+ f"and passed {cache_frame_data=}. To avoid a possibly "
+ "unbounded cache, frame data caching has been disabled. "
+ "To suppress this warning either pass "
+ "`cache_frame_data=False` or `save_count=MAX_FRAMES`."
+ )
+ cache_frame_data = False
+
+ self._cache_frame_data = cache_frame_data
+
+ # Needs to be initialized so the draw functions work without checking
+ self._save_seq = []
+
+ super().__init__(fig, **kwargs)
+
+ # Need to reset the saved seq, since right now it will contain data
+ # for a single frame from init, which is not what we want.
+ self._save_seq = []
+
+ def new_frame_seq(self):
+ # Use the generating function to generate a new frame sequence
+ return self._iter_gen()
+
+ def new_saved_frame_seq(self):
+ # Generate an iterator for the sequence of saved data. If there are
+ # no saved frames, generate a new frame sequence and take the first
+ # save_count entries in it.
+ if self._save_seq:
+ # While iterating we are going to update _save_seq
+ # so make a copy to safely iterate over
+ self._old_saved_seq = list(self._save_seq)
+ return iter(self._old_saved_seq)
+ else:
+ if self._save_count is None:
+ frame_seq = self.new_frame_seq()
+
+ def gen():
+ try:
+ while True:
+ yield next(frame_seq)
+ except StopIteration:
+ pass
+ return gen()
+ else:
+ return itertools.islice(self.new_frame_seq(), self._save_count)
+
+ def _init_draw(self):
+ super()._init_draw()
+ # Initialize the drawing either using the given init_func or by
+ # calling the draw function with the first item of the frame sequence.
+ # For blitting, the init_func should return a sequence of modified
+ # artists.
+ if self._init_func is None:
+ try:
+ frame_data = next(self.new_frame_seq())
+ except StopIteration:
+ # we can't start the iteration, it may have already been
+ # exhausted by a previous save or just be 0 length.
+ # warn and bail.
+ warnings.warn(
+ "Can not start iterating the frames for the initial draw. "
+ "This can be caused by passing in a 0 length sequence "
+ "for *frames*.\n\n"
+ "If you passed *frames* as a generator "
+ "it may be exhausted due to a previous display or save."
+ )
+ return
+ self._draw_frame(frame_data)
+ else:
+ self._drawn_artists = self._init_func()
+ if self._blit:
+ if self._drawn_artists is None:
+ raise RuntimeError('The init_func must return a '
+ 'sequence of Artist objects.')
+ for a in self._drawn_artists:
+ a.set_animated(self._blit)
+ self._save_seq = []
+
+ def _draw_frame(self, framedata):
+ if self._cache_frame_data:
+ # Save the data for potential saving of movies.
+ self._save_seq.append(framedata)
+ self._save_seq = self._save_seq[-self._save_count:]
+
+ # Call the func with framedata and args. If blitting is desired,
+ # func needs to return a sequence of any artists that were modified.
+ self._drawn_artists = self._func(framedata, *self._args)
+
+ if self._blit:
+
+ err = RuntimeError('The animation function must return a sequence '
+ 'of Artist objects.')
+ try:
+ # check if a sequence
+ iter(self._drawn_artists)
+ except TypeError:
+ raise err from None
+
+ # check each item if it's artist
+ for i in self._drawn_artists:
+ if not isinstance(i, mpl.artist.Artist):
+ raise err
+
+ self._drawn_artists = sorted(self._drawn_artists,
+ key=lambda x: x.get_zorder())
+
+ for a in self._drawn_artists:
+ a.set_animated(self._blit)
+
+
+def _validate_grabframe_kwargs(savefig_kwargs):
+ if mpl.rcParams['savefig.bbox'] == 'tight':
+ raise ValueError(
+ f"{mpl.rcParams['savefig.bbox']=} must not be 'tight' as it "
+ "may cause frame size to vary, which is inappropriate for animation."
+ )
+ for k in ('dpi', 'bbox_inches', 'format'):
+ if k in savefig_kwargs:
+ raise TypeError(
+ f"grab_frame got an unexpected keyword argument {k!r}"
+ )
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/animation.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/animation.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..345e3c6dbe61f1b3c99eba4c9e77edb0c51cff3e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/animation.pyi
@@ -0,0 +1,217 @@
+import abc
+from collections.abc import Callable, Collection, Iterable, Sequence, Generator
+import contextlib
+from pathlib import Path
+from matplotlib.artist import Artist
+from matplotlib.backend_bases import TimerBase
+from matplotlib.figure import Figure
+
+from typing import Any
+
+subprocess_creation_flags: int
+
+def adjusted_figsize(w: float, h: float, dpi: float, n: int) -> tuple[float, float]: ...
+
+class MovieWriterRegistry:
+ def __init__(self) -> None: ...
+ def register(
+ self, name: str
+ ) -> Callable[[type[AbstractMovieWriter]], type[AbstractMovieWriter]]: ...
+ def is_available(self, name: str) -> bool: ...
+ def __iter__(self) -> Generator[str, None, None]: ...
+ def list(self) -> list[str]: ...
+ def __getitem__(self, name: str) -> type[AbstractMovieWriter]: ...
+
+writers: MovieWriterRegistry
+
+class AbstractMovieWriter(abc.ABC, metaclass=abc.ABCMeta):
+ fps: int
+ metadata: dict[str, str]
+ codec: str
+ bitrate: int
+ def __init__(
+ self,
+ fps: int = ...,
+ metadata: dict[str, str] | None = ...,
+ codec: str | None = ...,
+ bitrate: int | None = ...,
+ ) -> None: ...
+ outfile: str | Path
+ fig: Figure
+ dpi: float
+
+ @abc.abstractmethod
+ def setup(self, fig: Figure, outfile: str | Path, dpi: float | None = ...) -> None: ...
+ @property
+ def frame_size(self) -> tuple[int, int]: ...
+ @abc.abstractmethod
+ def grab_frame(self, **savefig_kwargs) -> None: ...
+ @abc.abstractmethod
+ def finish(self) -> None: ...
+ @contextlib.contextmanager
+ def saving(
+ self, fig: Figure, outfile: str | Path, dpi: float | None, *args, **kwargs
+ ) -> Generator[AbstractMovieWriter, None, None]: ...
+
+class MovieWriter(AbstractMovieWriter):
+ supported_formats: list[str]
+ frame_format: str
+ extra_args: list[str] | None
+ def __init__(
+ self,
+ fps: int = ...,
+ codec: str | None = ...,
+ bitrate: int | None = ...,
+ extra_args: list[str] | None = ...,
+ metadata: dict[str, str] | None = ...,
+ ) -> None: ...
+ def setup(self, fig: Figure, outfile: str | Path, dpi: float | None = ...) -> None: ...
+ def grab_frame(self, **savefig_kwargs) -> None: ...
+ def finish(self) -> None: ...
+ @classmethod
+ def bin_path(cls) -> str: ...
+ @classmethod
+ def isAvailable(cls) -> bool: ...
+
+class FileMovieWriter(MovieWriter):
+ fig: Figure
+ outfile: str | Path
+ dpi: float
+ temp_prefix: str
+ fname_format_str: str
+ def setup(
+ self,
+ fig: Figure,
+ outfile: str | Path,
+ dpi: float | None = ...,
+ frame_prefix: str | Path | None = ...,
+ ) -> None: ...
+ def __del__(self) -> None: ...
+ @property
+ def frame_format(self) -> str: ...
+ @frame_format.setter
+ def frame_format(self, frame_format: str) -> None: ...
+
+class PillowWriter(AbstractMovieWriter):
+ @classmethod
+ def isAvailable(cls) -> bool: ...
+ def setup(
+ self, fig: Figure, outfile: str | Path, dpi: float | None = ...
+ ) -> None: ...
+ def grab_frame(self, **savefig_kwargs) -> None: ...
+ def finish(self) -> None: ...
+
+class FFMpegBase:
+ codec: str
+ @property
+ def output_args(self) -> list[str]: ...
+
+class FFMpegWriter(FFMpegBase, MovieWriter): ...
+
+class FFMpegFileWriter(FFMpegBase, FileMovieWriter):
+ supported_formats: list[str]
+
+class ImageMagickBase:
+ @classmethod
+ def bin_path(cls) -> str: ...
+ @classmethod
+ def isAvailable(cls) -> bool: ...
+
+class ImageMagickWriter(ImageMagickBase, MovieWriter):
+ input_names: str
+
+class ImageMagickFileWriter(ImageMagickBase, FileMovieWriter):
+ supported_formats: list[str]
+ @property
+ def input_names(self) -> str: ...
+
+class HTMLWriter(FileMovieWriter):
+ supported_formats: list[str]
+ @classmethod
+ def isAvailable(cls) -> bool: ...
+ embed_frames: bool
+ default_mode: str
+ def __init__(
+ self,
+ fps: int = ...,
+ codec: str | None = ...,
+ bitrate: int | None = ...,
+ extra_args: list[str] | None = ...,
+ metadata: dict[str, str] | None = ...,
+ embed_frames: bool = ...,
+ default_mode: str = ...,
+ embed_limit: float | None = ...,
+ ) -> None: ...
+ def setup(
+ self,
+ fig: Figure,
+ outfile: str | Path,
+ dpi: float | None = ...,
+ frame_dir: str | Path | None = ...,
+ ) -> None: ...
+ def grab_frame(self, **savefig_kwargs): ...
+ def finish(self) -> None: ...
+
+class Animation:
+ frame_seq: Iterable[Artist]
+ event_source: Any
+ def __init__(
+ self, fig: Figure, event_source: Any | None = ..., blit: bool = ...
+ ) -> None: ...
+ def __del__(self) -> None: ...
+ def save(
+ self,
+ filename: str | Path,
+ writer: AbstractMovieWriter | str | None = ...,
+ fps: int | None = ...,
+ dpi: float | None = ...,
+ codec: str | None = ...,
+ bitrate: int | None = ...,
+ extra_args: list[str] | None = ...,
+ metadata: dict[str, str] | None = ...,
+ extra_anim: list[Animation] | None = ...,
+ savefig_kwargs: dict[str, Any] | None = ...,
+ *,
+ progress_callback: Callable[[int, int], Any] | None = ...
+ ) -> None: ...
+ def new_frame_seq(self) -> Iterable[Artist]: ...
+ def new_saved_frame_seq(self) -> Iterable[Artist]: ...
+ def to_html5_video(self, embed_limit: float | None = ...) -> str: ...
+ def to_jshtml(
+ self,
+ fps: int | None = ...,
+ embed_frames: bool = ...,
+ default_mode: str | None = ...,
+ ) -> str: ...
+ def _repr_html_(self) -> str: ...
+ def pause(self) -> None: ...
+ def resume(self) -> None: ...
+
+class TimedAnimation(Animation):
+ def __init__(
+ self,
+ fig: Figure,
+ interval: int = ...,
+ repeat_delay: int = ...,
+ repeat: bool = ...,
+ event_source: TimerBase | None = ...,
+ *args,
+ **kwargs
+ ) -> None: ...
+
+class ArtistAnimation(TimedAnimation):
+ def __init__(self, fig: Figure, artists: Sequence[Collection[Artist]], *args, **kwargs) -> None: ...
+
+class FuncAnimation(TimedAnimation):
+ def __init__(
+ self,
+ fig: Figure,
+ func: Callable[..., Iterable[Artist]],
+ frames: Iterable | int | Callable[[], Generator] | None = ...,
+ init_func: Callable[[], Iterable[Artist]] | None = ...,
+ fargs: tuple[Any, ...] | None = ...,
+ save_count: int | None = ...,
+ *,
+ cache_frame_data: bool = ...,
+ **kwargs
+ ) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/artist.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/artist.py
new file mode 100644
index 0000000000000000000000000000000000000000..c87c789048c4982e1b25507fe3c360e003a0def6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/artist.py
@@ -0,0 +1,1855 @@
+from collections import namedtuple
+import contextlib
+from functools import cache, reduce, wraps
+import inspect
+from inspect import Signature, Parameter
+import logging
+from numbers import Number, Real
+import operator
+import re
+import warnings
+
+import numpy as np
+
+import matplotlib as mpl
+from . import _api, cbook
+from .path import Path
+from .transforms import (BboxBase, Bbox, IdentityTransform, Transform, TransformedBbox,
+ TransformedPatchPath, TransformedPath)
+
+_log = logging.getLogger(__name__)
+
+
+def _prevent_rasterization(draw):
+ # We assume that by default artists are not allowed to rasterize (unless
+ # its draw method is explicitly decorated). If it is being drawn after a
+ # rasterized artist and it has reached a raster_depth of 0, we stop
+ # rasterization so that it does not affect the behavior of normal artist
+ # (e.g., change in dpi).
+
+ @wraps(draw)
+ def draw_wrapper(artist, renderer, *args, **kwargs):
+ if renderer._raster_depth == 0 and renderer._rasterizing:
+ # Only stop when we are not in a rasterized parent
+ # and something has been rasterized since last stop.
+ renderer.stop_rasterizing()
+ renderer._rasterizing = False
+
+ return draw(artist, renderer, *args, **kwargs)
+
+ draw_wrapper._supports_rasterization = False
+ return draw_wrapper
+
+
+def allow_rasterization(draw):
+ """
+ Decorator for Artist.draw method. Provides routines
+ that run before and after the draw call. The before and after functions
+ are useful for changing artist-dependent renderer attributes or making
+ other setup function calls, such as starting and flushing a mixed-mode
+ renderer.
+ """
+
+ @wraps(draw)
+ def draw_wrapper(artist, renderer):
+ try:
+ if artist.get_rasterized():
+ if renderer._raster_depth == 0 and not renderer._rasterizing:
+ renderer.start_rasterizing()
+ renderer._rasterizing = True
+ renderer._raster_depth += 1
+ else:
+ if renderer._raster_depth == 0 and renderer._rasterizing:
+ # Only stop when we are not in a rasterized parent
+ # and something has be rasterized since last stop
+ renderer.stop_rasterizing()
+ renderer._rasterizing = False
+
+ if artist.get_agg_filter() is not None:
+ renderer.start_filter()
+
+ return draw(artist, renderer)
+ finally:
+ if artist.get_agg_filter() is not None:
+ renderer.stop_filter(artist.get_agg_filter())
+ if artist.get_rasterized():
+ renderer._raster_depth -= 1
+ if (renderer._rasterizing and (fig := artist.get_figure(root=True)) and
+ fig.suppressComposite):
+ # restart rasterizing to prevent merging
+ renderer.stop_rasterizing()
+ renderer.start_rasterizing()
+
+ draw_wrapper._supports_rasterization = True
+ return draw_wrapper
+
+
+def _finalize_rasterization(draw):
+ """
+ Decorator for Artist.draw method. Needed on the outermost artist, i.e.
+ Figure, to finish up if the render is still in rasterized mode.
+ """
+ @wraps(draw)
+ def draw_wrapper(artist, renderer, *args, **kwargs):
+ result = draw(artist, renderer, *args, **kwargs)
+ if renderer._rasterizing:
+ renderer.stop_rasterizing()
+ renderer._rasterizing = False
+ return result
+ return draw_wrapper
+
+
+def _stale_axes_callback(self, val):
+ if self.axes:
+ self.axes.stale = val
+
+
+_XYPair = namedtuple("_XYPair", "x y")
+
+
+class _Unset:
+ def __repr__(self):
+ return ""
+_UNSET = _Unset()
+
+
+class Artist:
+ """
+ Abstract base class for objects that render into a FigureCanvas.
+
+ Typically, all visible elements in a figure are subclasses of Artist.
+ """
+
+ zorder = 0
+
+ def __init_subclass__(cls):
+
+ # Decorate draw() method so that all artists are able to stop
+ # rastrization when necessary. If the artist's draw method is already
+ # decorated (has a `_supports_rasterization` attribute), it won't be
+ # decorated.
+
+ if not hasattr(cls.draw, "_supports_rasterization"):
+ cls.draw = _prevent_rasterization(cls.draw)
+
+ # Inject custom set() methods into the subclass with signature and
+ # docstring based on the subclasses' properties.
+
+ if not hasattr(cls.set, '_autogenerated_signature'):
+ # Don't overwrite cls.set if the subclass or one of its parents
+ # has defined a set method set itself.
+ # If there was no explicit definition, cls.set is inherited from
+ # the hierarchy of auto-generated set methods, which hold the
+ # flag _autogenerated_signature.
+ return
+
+ cls.set = lambda self, **kwargs: Artist.set(self, **kwargs)
+ cls.set.__name__ = "set"
+ cls.set.__qualname__ = f"{cls.__qualname__}.set"
+ cls._update_set_signature_and_docstring()
+
+ _PROPERTIES_EXCLUDED_FROM_SET = [
+ 'navigate_mode', # not a user-facing function
+ 'figure', # changing the figure is such a profound operation
+ # that we don't want this in set()
+ '3d_properties', # cannot be used as a keyword due to leading digit
+ ]
+
+ @classmethod
+ def _update_set_signature_and_docstring(cls):
+ """
+ Update the signature of the set function to list all properties
+ as keyword arguments.
+
+ Property aliases are not listed in the signature for brevity, but
+ are still accepted as keyword arguments.
+ """
+ cls.set.__signature__ = Signature(
+ [Parameter("self", Parameter.POSITIONAL_OR_KEYWORD),
+ *[Parameter(prop, Parameter.KEYWORD_ONLY, default=_UNSET)
+ for prop in ArtistInspector(cls).get_setters()
+ if prop not in Artist._PROPERTIES_EXCLUDED_FROM_SET]])
+ cls.set._autogenerated_signature = True
+
+ cls.set.__doc__ = (
+ "Set multiple properties at once.\n\n"
+ "Supported properties are\n\n"
+ + kwdoc(cls))
+
+ def __init__(self):
+ self._stale = True
+ self.stale_callback = None
+ self._axes = None
+ self._parent_figure = None
+
+ self._transform = None
+ self._transformSet = False
+ self._visible = True
+ self._animated = False
+ self._alpha = None
+ self.clipbox = None
+ self._clippath = None
+ self._clipon = True
+ self._label = ''
+ self._picker = None
+ self._rasterized = False
+ self._agg_filter = None
+ # Normally, artist classes need to be queried for mouseover info if and
+ # only if they override get_cursor_data.
+ self._mouseover = type(self).get_cursor_data != Artist.get_cursor_data
+ self._callbacks = cbook.CallbackRegistry(signals=["pchanged"])
+ try:
+ self.axes = None
+ except AttributeError:
+ # Handle self.axes as a read-only property, as in Figure.
+ pass
+ self._remove_method = None
+ self._url = None
+ self._gid = None
+ self._snap = None
+ self._sketch = mpl.rcParams['path.sketch']
+ self._path_effects = mpl.rcParams['path.effects']
+ self._sticky_edges = _XYPair([], [])
+ self._in_layout = True
+
+ def __getstate__(self):
+ d = self.__dict__.copy()
+ d['stale_callback'] = None
+ return d
+
+ def remove(self):
+ """
+ Remove the artist from the figure if possible.
+
+ The effect will not be visible until the figure is redrawn, e.g.,
+ with `.FigureCanvasBase.draw_idle`. Call `~.axes.Axes.relim` to
+ update the Axes limits if desired.
+
+ Note: `~.axes.Axes.relim` will not see collections even if the
+ collection was added to the Axes with *autolim* = True.
+
+ Note: there is no support for removing the artist's legend entry.
+ """
+
+ # There is no method to set the callback. Instead, the parent should
+ # set the _remove_method attribute directly. This would be a
+ # protected attribute if Python supported that sort of thing. The
+ # callback has one parameter, which is the child to be removed.
+ if self._remove_method is not None:
+ self._remove_method(self)
+ # clear stale callback
+ self.stale_callback = None
+ _ax_flag = False
+ if hasattr(self, 'axes') and self.axes:
+ # remove from the mouse hit list
+ self.axes._mouseover_set.discard(self)
+ self.axes.stale = True
+ self.axes = None # decouple the artist from the Axes
+ _ax_flag = True
+
+ if (fig := self.get_figure(root=False)) is not None:
+ if not _ax_flag:
+ fig.stale = True
+ self._parent_figure = None
+
+ else:
+ raise NotImplementedError('cannot remove artist')
+ # TODO: the fix for the collections relim problem is to move the
+ # limits calculation into the artist itself, including the property of
+ # whether or not the artist should affect the limits. Then there will
+ # be no distinction between axes.add_line, axes.add_patch, etc.
+ # TODO: add legend support
+
+ def have_units(self):
+ """Return whether units are set on any axis."""
+ ax = self.axes
+ return ax and any(axis.have_units() for axis in ax._axis_map.values())
+
+ def convert_xunits(self, x):
+ """
+ Convert *x* using the unit type of the xaxis.
+
+ If the artist is not contained in an Axes or if the xaxis does not
+ have units, *x* itself is returned.
+ """
+ ax = getattr(self, 'axes', None)
+ if ax is None or ax.xaxis is None:
+ return x
+ return ax.xaxis.convert_units(x)
+
+ def convert_yunits(self, y):
+ """
+ Convert *y* using the unit type of the yaxis.
+
+ If the artist is not contained in an Axes or if the yaxis does not
+ have units, *y* itself is returned.
+ """
+ ax = getattr(self, 'axes', None)
+ if ax is None or ax.yaxis is None:
+ return y
+ return ax.yaxis.convert_units(y)
+
+ @property
+ def axes(self):
+ """The `~.axes.Axes` instance the artist resides in, or *None*."""
+ return self._axes
+
+ @axes.setter
+ def axes(self, new_axes):
+ if (new_axes is not None and self._axes is not None
+ and new_axes != self._axes):
+ raise ValueError("Can not reset the Axes. You are probably trying to reuse "
+ "an artist in more than one Axes which is not supported")
+ self._axes = new_axes
+ if new_axes is not None and new_axes is not self:
+ self.stale_callback = _stale_axes_callback
+
+ @property
+ def stale(self):
+ """
+ Whether the artist is 'stale' and needs to be re-drawn for the output
+ to match the internal state of the artist.
+ """
+ return self._stale
+
+ @stale.setter
+ def stale(self, val):
+ self._stale = val
+
+ # if the artist is animated it does not take normal part in the
+ # draw stack and is not expected to be drawn as part of the normal
+ # draw loop (when not saving) so do not propagate this change
+ if self._animated:
+ return
+
+ if val and self.stale_callback is not None:
+ self.stale_callback(self, val)
+
+ def get_window_extent(self, renderer=None):
+ """
+ Get the artist's bounding box in display space.
+
+ The bounding box' width and height are nonnegative.
+
+ Subclasses should override for inclusion in the bounding box
+ "tight" calculation. Default is to return an empty bounding
+ box at 0, 0.
+
+ Be careful when using this function, the results will not update
+ if the artist window extent of the artist changes. The extent
+ can change due to any changes in the transform stack, such as
+ changing the Axes limits, the figure size, or the canvas used
+ (as is done when saving a figure). This can lead to unexpected
+ behavior where interactive figures will look fine on the screen,
+ but will save incorrectly.
+ """
+ return Bbox([[0, 0], [0, 0]])
+
+ def get_tightbbox(self, renderer=None):
+ """
+ Like `.Artist.get_window_extent`, but includes any clipping.
+
+ Parameters
+ ----------
+ renderer : `~matplotlib.backend_bases.RendererBase` subclass, optional
+ renderer that will be used to draw the figures (i.e.
+ ``fig.canvas.get_renderer()``)
+
+ Returns
+ -------
+ `.Bbox` or None
+ The enclosing bounding box (in figure pixel coordinates).
+ Returns None if clipping results in no intersection.
+ """
+ bbox = self.get_window_extent(renderer)
+ if self.get_clip_on():
+ clip_box = self.get_clip_box()
+ if clip_box is not None:
+ bbox = Bbox.intersection(bbox, clip_box)
+ clip_path = self.get_clip_path()
+ if clip_path is not None and bbox is not None:
+ clip_path = clip_path.get_fully_transformed_path()
+ bbox = Bbox.intersection(bbox, clip_path.get_extents())
+ return bbox
+
+ def add_callback(self, func):
+ """
+ Add a callback function that will be called whenever one of the
+ `.Artist`'s properties changes.
+
+ Parameters
+ ----------
+ func : callable
+ The callback function. It must have the signature::
+
+ def func(artist: Artist) -> Any
+
+ where *artist* is the calling `.Artist`. Return values may exist
+ but are ignored.
+
+ Returns
+ -------
+ int
+ The observer id associated with the callback. This id can be
+ used for removing the callback with `.remove_callback` later.
+
+ See Also
+ --------
+ remove_callback
+ """
+ # Wrapping func in a lambda ensures it can be connected multiple times
+ # and never gets weakref-gc'ed.
+ return self._callbacks.connect("pchanged", lambda: func(self))
+
+ def remove_callback(self, oid):
+ """
+ Remove a callback based on its observer id.
+
+ See Also
+ --------
+ add_callback
+ """
+ self._callbacks.disconnect(oid)
+
+ def pchanged(self):
+ """
+ Call all of the registered callbacks.
+
+ This function is triggered internally when a property is changed.
+
+ See Also
+ --------
+ add_callback
+ remove_callback
+ """
+ self._callbacks.process("pchanged")
+
+ def is_transform_set(self):
+ """
+ Return whether the Artist has an explicitly set transform.
+
+ This is *True* after `.set_transform` has been called.
+ """
+ return self._transformSet
+
+ def set_transform(self, t):
+ """
+ Set the artist transform.
+
+ Parameters
+ ----------
+ t : `~matplotlib.transforms.Transform`
+ """
+ self._transform = t
+ self._transformSet = True
+ self.pchanged()
+ self.stale = True
+
+ def get_transform(self):
+ """Return the `.Transform` instance used by this artist."""
+ if self._transform is None:
+ self._transform = IdentityTransform()
+ elif (not isinstance(self._transform, Transform)
+ and hasattr(self._transform, '_as_mpl_transform')):
+ self._transform = self._transform._as_mpl_transform(self.axes)
+ return self._transform
+
+ def get_children(self):
+ r"""Return a list of the child `.Artist`\s of this `.Artist`."""
+ return []
+
+ def _different_canvas(self, event):
+ """
+ Check whether an *event* occurred on a canvas other that this artist's canvas.
+
+ If this method returns True, the event definitely occurred on a different
+ canvas; if it returns False, either it occurred on the same canvas, or we may
+ not have enough information to know.
+
+ Subclasses should start their definition of `contains` as follows::
+
+ if self._different_canvas(mouseevent):
+ return False, {}
+ # subclass-specific implementation follows
+ """
+ return (getattr(event, "canvas", None) is not None
+ and (fig := self.get_figure(root=True)) is not None
+ and event.canvas is not fig.canvas)
+
+ def contains(self, mouseevent):
+ """
+ Test whether the artist contains the mouse event.
+
+ Parameters
+ ----------
+ mouseevent : `~matplotlib.backend_bases.MouseEvent`
+
+ Returns
+ -------
+ contains : bool
+ Whether any values are within the radius.
+ details : dict
+ An artist-specific dictionary of details of the event context,
+ such as which points are contained in the pick radius. See the
+ individual Artist subclasses for details.
+ """
+ _log.warning("%r needs 'contains' method", self.__class__.__name__)
+ return False, {}
+
+ def pickable(self):
+ """
+ Return whether the artist is pickable.
+
+ See Also
+ --------
+ .Artist.set_picker, .Artist.get_picker, .Artist.pick
+ """
+ return self.get_figure(root=False) is not None and self._picker is not None
+
+ def pick(self, mouseevent):
+ """
+ Process a pick event.
+
+ Each child artist will fire a pick event if *mouseevent* is over
+ the artist and the artist has picker set.
+
+ See Also
+ --------
+ .Artist.set_picker, .Artist.get_picker, .Artist.pickable
+ """
+ from .backend_bases import PickEvent # Circular import.
+ # Pick self
+ if self.pickable():
+ picker = self.get_picker()
+ if callable(picker):
+ inside, prop = picker(self, mouseevent)
+ else:
+ inside, prop = self.contains(mouseevent)
+ if inside:
+ PickEvent("pick_event", self.get_figure(root=True).canvas,
+ mouseevent, self, **prop)._process()
+
+ # Pick children
+ for a in self.get_children():
+ # make sure the event happened in the same Axes
+ ax = getattr(a, 'axes', None)
+ if (isinstance(a, mpl.figure.SubFigure)
+ or mouseevent.inaxes is None or ax is None
+ or mouseevent.inaxes == ax):
+ # we need to check if mouseevent.inaxes is None
+ # because some objects associated with an Axes (e.g., a
+ # tick label) can be outside the bounding box of the
+ # Axes and inaxes will be None
+ # also check that ax is None so that it traverse objects
+ # which do not have an axes property but children might
+ a.pick(mouseevent)
+
+ def set_picker(self, picker):
+ """
+ Define the picking behavior of the artist.
+
+ Parameters
+ ----------
+ picker : None or bool or float or callable
+ This can be one of the following:
+
+ - *None*: Picking is disabled for this artist (default).
+
+ - A boolean: If *True* then picking will be enabled and the
+ artist will fire a pick event if the mouse event is over
+ the artist.
+
+ - A float: If picker is a number it is interpreted as an
+ epsilon tolerance in points and the artist will fire
+ off an event if its data is within epsilon of the mouse
+ event. For some artists like lines and patch collections,
+ the artist may provide additional data to the pick event
+ that is generated, e.g., the indices of the data within
+ epsilon of the pick event
+
+ - A function: If picker is callable, it is a user supplied
+ function which determines whether the artist is hit by the
+ mouse event::
+
+ hit, props = picker(artist, mouseevent)
+
+ to determine the hit test. if the mouse event is over the
+ artist, return *hit=True* and props is a dictionary of
+ properties you want added to the PickEvent attributes.
+ """
+ self._picker = picker
+
+ def get_picker(self):
+ """
+ Return the picking behavior of the artist.
+
+ The possible values are described in `.Artist.set_picker`.
+
+ See Also
+ --------
+ .Artist.set_picker, .Artist.pickable, .Artist.pick
+ """
+ return self._picker
+
+ def get_url(self):
+ """Return the url."""
+ return self._url
+
+ def set_url(self, url):
+ """
+ Set the url for the artist.
+
+ Parameters
+ ----------
+ url : str
+ """
+ self._url = url
+
+ def get_gid(self):
+ """Return the group id."""
+ return self._gid
+
+ def set_gid(self, gid):
+ """
+ Set the (group) id for the artist.
+
+ Parameters
+ ----------
+ gid : str
+ """
+ self._gid = gid
+
+ def get_snap(self):
+ """
+ Return the snap setting.
+
+ See `.set_snap` for details.
+ """
+ if mpl.rcParams['path.snap']:
+ return self._snap
+ else:
+ return False
+
+ def set_snap(self, snap):
+ """
+ Set the snapping behavior.
+
+ Snapping aligns positions with the pixel grid, which results in
+ clearer images. For example, if a black line of 1px width was
+ defined at a position in between two pixels, the resulting image
+ would contain the interpolated value of that line in the pixel grid,
+ which would be a grey value on both adjacent pixel positions. In
+ contrast, snapping will move the line to the nearest integer pixel
+ value, so that the resulting image will really contain a 1px wide
+ black line.
+
+ Snapping is currently only supported by the Agg and MacOSX backends.
+
+ Parameters
+ ----------
+ snap : bool or None
+ Possible values:
+
+ - *True*: Snap vertices to the nearest pixel center.
+ - *False*: Do not modify vertex positions.
+ - *None*: (auto) If the path contains only rectilinear line
+ segments, round to the nearest pixel center.
+ """
+ self._snap = snap
+ self.stale = True
+
+ def get_sketch_params(self):
+ """
+ Return the sketch parameters for the artist.
+
+ Returns
+ -------
+ tuple or None
+
+ A 3-tuple with the following elements:
+
+ - *scale*: The amplitude of the wiggle perpendicular to the
+ source line.
+ - *length*: The length of the wiggle along the line.
+ - *randomness*: The scale factor by which the length is
+ shrunken or expanded.
+
+ Returns *None* if no sketch parameters were set.
+ """
+ return self._sketch
+
+ def set_sketch_params(self, scale=None, length=None, randomness=None):
+ """
+ Set the sketch parameters.
+
+ Parameters
+ ----------
+ scale : float, optional
+ The amplitude of the wiggle perpendicular to the source
+ line, in pixels. If scale is `None`, or not provided, no
+ sketch filter will be provided.
+ length : float, optional
+ The length of the wiggle along the line, in pixels
+ (default 128.0)
+ randomness : float, optional
+ The scale factor by which the length is shrunken or
+ expanded (default 16.0)
+
+ The PGF backend uses this argument as an RNG seed and not as
+ described above. Using the same seed yields the same random shape.
+
+ .. ACCEPTS: (scale: float, length: float, randomness: float)
+ """
+ if scale is None:
+ self._sketch = None
+ else:
+ self._sketch = (scale, length or 128.0, randomness or 16.0)
+ self.stale = True
+
+ def set_path_effects(self, path_effects):
+ """
+ Set the path effects.
+
+ Parameters
+ ----------
+ path_effects : list of `.AbstractPathEffect`
+ """
+ self._path_effects = path_effects
+ self.stale = True
+
+ def get_path_effects(self):
+ return self._path_effects
+
+ def get_figure(self, root=False):
+ """
+ Return the `.Figure` or `.SubFigure` instance the artist belongs to.
+
+ Parameters
+ ----------
+ root : bool, default=False
+ If False, return the (Sub)Figure this artist is on. If True,
+ return the root Figure for a nested tree of SubFigures.
+ """
+ if root and self._parent_figure is not None:
+ return self._parent_figure.get_figure(root=True)
+
+ return self._parent_figure
+
+ def set_figure(self, fig):
+ """
+ Set the `.Figure` or `.SubFigure` instance the artist belongs to.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure` or `~matplotlib.figure.SubFigure`
+ """
+ # if this is a no-op just return
+ if self._parent_figure is fig:
+ return
+ # if we currently have a figure (the case of both `self.figure`
+ # and *fig* being none is taken care of above) we then user is
+ # trying to change the figure an artist is associated with which
+ # is not allowed for the same reason as adding the same instance
+ # to more than one Axes
+ if self._parent_figure is not None:
+ raise RuntimeError("Can not put single artist in "
+ "more than one figure")
+ self._parent_figure = fig
+ if self._parent_figure and self._parent_figure is not self:
+ self.pchanged()
+ self.stale = True
+
+ figure = property(get_figure, set_figure,
+ doc=("The (Sub)Figure that the artist is on. For more "
+ "control, use the `get_figure` method."))
+
+ def set_clip_box(self, clipbox):
+ """
+ Set the artist's clip `.Bbox`.
+
+ Parameters
+ ----------
+ clipbox : `~matplotlib.transforms.BboxBase` or None
+ Will typically be created from a `.TransformedBbox`. For instance,
+ ``TransformedBbox(Bbox([[0, 0], [1, 1]]), ax.transAxes)`` is the default
+ clipping for an artist added to an Axes.
+
+ """
+ _api.check_isinstance((BboxBase, None), clipbox=clipbox)
+ if clipbox != self.clipbox:
+ self.clipbox = clipbox
+ self.pchanged()
+ self.stale = True
+
+ def set_clip_path(self, path, transform=None):
+ """
+ Set the artist's clip path.
+
+ Parameters
+ ----------
+ path : `~matplotlib.patches.Patch` or `.Path` or `.TransformedPath` or None
+ The clip path. If given a `.Path`, *transform* must be provided as
+ well. If *None*, a previously set clip path is removed.
+ transform : `~matplotlib.transforms.Transform`, optional
+ Only used if *path* is a `.Path`, in which case the given `.Path`
+ is converted to a `.TransformedPath` using *transform*.
+
+ Notes
+ -----
+ For efficiency, if *path* is a `.Rectangle` this method will set the
+ clipping box to the corresponding rectangle and set the clipping path
+ to ``None``.
+
+ For technical reasons (support of `~.Artist.set`), a tuple
+ (*path*, *transform*) is also accepted as a single positional
+ parameter.
+
+ .. ACCEPTS: Patch or (Path, Transform) or None
+ """
+ from matplotlib.patches import Patch, Rectangle
+
+ success = False
+ if transform is None:
+ if isinstance(path, Rectangle):
+ self.clipbox = TransformedBbox(Bbox.unit(),
+ path.get_transform())
+ self._clippath = None
+ success = True
+ elif isinstance(path, Patch):
+ self._clippath = TransformedPatchPath(path)
+ success = True
+ elif isinstance(path, tuple):
+ path, transform = path
+
+ if path is None:
+ self._clippath = None
+ success = True
+ elif isinstance(path, Path):
+ self._clippath = TransformedPath(path, transform)
+ success = True
+ elif isinstance(path, TransformedPatchPath):
+ self._clippath = path
+ success = True
+ elif isinstance(path, TransformedPath):
+ self._clippath = path
+ success = True
+
+ if not success:
+ raise TypeError(
+ "Invalid arguments to set_clip_path, of type "
+ f"{type(path).__name__} and {type(transform).__name__}")
+ # This may result in the callbacks being hit twice, but guarantees they
+ # will be hit at least once.
+ self.pchanged()
+ self.stale = True
+
+ def get_alpha(self):
+ """
+ Return the alpha value used for blending - not supported on all
+ backends.
+ """
+ return self._alpha
+
+ def get_visible(self):
+ """Return the visibility."""
+ return self._visible
+
+ def get_animated(self):
+ """Return whether the artist is animated."""
+ return self._animated
+
+ def get_in_layout(self):
+ """
+ Return boolean flag, ``True`` if artist is included in layout
+ calculations.
+
+ E.g. :ref:`constrainedlayout_guide`,
+ `.Figure.tight_layout()`, and
+ ``fig.savefig(fname, bbox_inches='tight')``.
+ """
+ return self._in_layout
+
+ def _fully_clipped_to_axes(self):
+ """
+ Return a boolean flag, ``True`` if the artist is clipped to the Axes
+ and can thus be skipped in layout calculations. Requires `get_clip_on`
+ is True, one of `clip_box` or `clip_path` is set, ``clip_box.extents``
+ is equivalent to ``ax.bbox.extents`` (if set), and ``clip_path._patch``
+ is equivalent to ``ax.patch`` (if set).
+ """
+ # Note that ``clip_path.get_fully_transformed_path().get_extents()``
+ # cannot be directly compared to ``axes.bbox.extents`` because the
+ # extents may be undefined (i.e. equivalent to ``Bbox.null()``)
+ # before the associated artist is drawn, and this method is meant
+ # to determine whether ``axes.get_tightbbox()`` may bypass drawing
+ clip_box = self.get_clip_box()
+ clip_path = self.get_clip_path()
+ return (self.axes is not None
+ and self.get_clip_on()
+ and (clip_box is not None or clip_path is not None)
+ and (clip_box is None
+ or np.all(clip_box.extents == self.axes.bbox.extents))
+ and (clip_path is None
+ or isinstance(clip_path, TransformedPatchPath)
+ and clip_path._patch is self.axes.patch))
+
+ def get_clip_on(self):
+ """Return whether the artist uses clipping."""
+ return self._clipon
+
+ def get_clip_box(self):
+ """Return the clipbox."""
+ return self.clipbox
+
+ def get_clip_path(self):
+ """Return the clip path."""
+ return self._clippath
+
+ def get_transformed_clip_path_and_affine(self):
+ """
+ Return the clip path with the non-affine part of its
+ transformation applied, and the remaining affine part of its
+ transformation.
+ """
+ if self._clippath is not None:
+ return self._clippath.get_transformed_path_and_affine()
+ return None, None
+
+ def set_clip_on(self, b):
+ """
+ Set whether the artist uses clipping.
+
+ When False, artists will be visible outside the Axes which
+ can lead to unexpected results.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ self._clipon = b
+ # This may result in the callbacks being hit twice, but ensures they
+ # are hit at least once
+ self.pchanged()
+ self.stale = True
+
+ def _set_gc_clip(self, gc):
+ """Set the clip properly for the gc."""
+ if self._clipon:
+ if self.clipbox is not None:
+ gc.set_clip_rectangle(self.clipbox)
+ gc.set_clip_path(self._clippath)
+ else:
+ gc.set_clip_rectangle(None)
+ gc.set_clip_path(None)
+
+ def get_rasterized(self):
+ """Return whether the artist is to be rasterized."""
+ return self._rasterized
+
+ def set_rasterized(self, rasterized):
+ """
+ Force rasterized (bitmap) drawing for vector graphics output.
+
+ Rasterized drawing is not supported by all artists. If you try to
+ enable this on an artist that does not support it, the command has no
+ effect and a warning will be issued.
+
+ This setting is ignored for pixel-based output.
+
+ See also :doc:`/gallery/misc/rasterization_demo`.
+
+ Parameters
+ ----------
+ rasterized : bool
+ """
+ supports_rasterization = getattr(self.draw,
+ "_supports_rasterization", False)
+ if rasterized and not supports_rasterization:
+ _api.warn_external(f"Rasterization of '{self}' will be ignored")
+
+ self._rasterized = rasterized
+
+ def get_agg_filter(self):
+ """Return filter function to be used for agg filter."""
+ return self._agg_filter
+
+ def set_agg_filter(self, filter_func):
+ """
+ Set the agg filter.
+
+ Parameters
+ ----------
+ filter_func : callable
+ A filter function, which takes a (m, n, depth) float array
+ and a dpi value, and returns a (m, n, depth) array and two
+ offsets from the bottom left corner of the image
+
+ .. ACCEPTS: a filter function, which takes a (m, n, 3) float array
+ and a dpi value, and returns a (m, n, 3) array and two offsets
+ from the bottom left corner of the image
+ """
+ self._agg_filter = filter_func
+ self.stale = True
+
+ def draw(self, renderer):
+ """
+ Draw the Artist (and its children) using the given renderer.
+
+ This has no effect if the artist is not visible (`.Artist.get_visible`
+ returns False).
+
+ Parameters
+ ----------
+ renderer : `~matplotlib.backend_bases.RendererBase` subclass.
+
+ Notes
+ -----
+ This method is overridden in the Artist subclasses.
+ """
+ if not self.get_visible():
+ return
+ self.stale = False
+
+ def set_alpha(self, alpha):
+ """
+ Set the alpha value used for blending - not supported on all backends.
+
+ Parameters
+ ----------
+ alpha : float or None
+ *alpha* must be within the 0-1 range, inclusive.
+ """
+ if alpha is not None and not isinstance(alpha, Real):
+ raise TypeError(
+ f'alpha must be numeric or None, not {type(alpha)}')
+ if alpha is not None and not (0 <= alpha <= 1):
+ raise ValueError(f'alpha ({alpha}) is outside 0-1 range')
+ if alpha != self._alpha:
+ self._alpha = alpha
+ self.pchanged()
+ self.stale = True
+
+ def _set_alpha_for_array(self, alpha):
+ """
+ Set the alpha value used for blending - not supported on all backends.
+
+ Parameters
+ ----------
+ alpha : array-like or float or None
+ All values must be within the 0-1 range, inclusive.
+ Masked values and nans are not supported.
+ """
+ if isinstance(alpha, str):
+ raise TypeError("alpha must be numeric or None, not a string")
+ if not np.iterable(alpha):
+ Artist.set_alpha(self, alpha)
+ return
+ alpha = np.asarray(alpha)
+ if not (0 <= alpha.min() and alpha.max() <= 1):
+ raise ValueError('alpha must be between 0 and 1, inclusive, '
+ f'but min is {alpha.min()}, max is {alpha.max()}')
+ self._alpha = alpha
+ self.pchanged()
+ self.stale = True
+
+ def set_visible(self, b):
+ """
+ Set the artist's visibility.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ if b != self._visible:
+ self._visible = b
+ self.pchanged()
+ self.stale = True
+
+ def set_animated(self, b):
+ """
+ Set whether the artist is intended to be used in an animation.
+
+ If True, the artist is excluded from regular drawing of the figure.
+ You have to call `.Figure.draw_artist` / `.Axes.draw_artist`
+ explicitly on the artist. This approach is used to speed up animations
+ using blitting.
+
+ See also `matplotlib.animation` and
+ :ref:`blitting`.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ if self._animated != b:
+ self._animated = b
+ self.pchanged()
+
+ def set_in_layout(self, in_layout):
+ """
+ Set if artist is to be included in layout calculations,
+ E.g. :ref:`constrainedlayout_guide`,
+ `.Figure.tight_layout()`, and
+ ``fig.savefig(fname, bbox_inches='tight')``.
+
+ Parameters
+ ----------
+ in_layout : bool
+ """
+ self._in_layout = in_layout
+
+ def get_label(self):
+ """Return the label used for this artist in the legend."""
+ return self._label
+
+ def set_label(self, s):
+ """
+ Set a label that will be displayed in the legend.
+
+ Parameters
+ ----------
+ s : object
+ *s* will be converted to a string by calling `str`.
+ """
+ label = str(s) if s is not None else None
+ if label != self._label:
+ self._label = label
+ self.pchanged()
+ self.stale = True
+
+ def get_zorder(self):
+ """Return the artist's zorder."""
+ return self.zorder
+
+ def set_zorder(self, level):
+ """
+ Set the zorder for the artist. Artists with lower zorder
+ values are drawn first.
+
+ Parameters
+ ----------
+ level : float
+ """
+ if level is None:
+ level = self.__class__.zorder
+ if level != self.zorder:
+ self.zorder = level
+ self.pchanged()
+ self.stale = True
+
+ @property
+ def sticky_edges(self):
+ """
+ ``x`` and ``y`` sticky edge lists for autoscaling.
+
+ When performing autoscaling, if a data limit coincides with a value in
+ the corresponding sticky_edges list, then no margin will be added--the
+ view limit "sticks" to the edge. A typical use case is histograms,
+ where one usually expects no margin on the bottom edge (0) of the
+ histogram.
+
+ Moreover, margin expansion "bumps" against sticky edges and cannot
+ cross them. For example, if the upper data limit is 1.0, the upper
+ view limit computed by simple margin application is 1.2, but there is a
+ sticky edge at 1.1, then the actual upper view limit will be 1.1.
+
+ This attribute cannot be assigned to; however, the ``x`` and ``y``
+ lists can be modified in place as needed.
+
+ Examples
+ --------
+ >>> artist.sticky_edges.x[:] = (xmin, xmax)
+ >>> artist.sticky_edges.y[:] = (ymin, ymax)
+
+ """
+ return self._sticky_edges
+
+ def update_from(self, other):
+ """Copy properties from *other* to *self*."""
+ self._transform = other._transform
+ self._transformSet = other._transformSet
+ self._visible = other._visible
+ self._alpha = other._alpha
+ self.clipbox = other.clipbox
+ self._clipon = other._clipon
+ self._clippath = other._clippath
+ self._label = other._label
+ self._sketch = other._sketch
+ self._path_effects = other._path_effects
+ self.sticky_edges.x[:] = other.sticky_edges.x.copy()
+ self.sticky_edges.y[:] = other.sticky_edges.y.copy()
+ self.pchanged()
+ self.stale = True
+
+ def properties(self):
+ """Return a dictionary of all the properties of the artist."""
+ return ArtistInspector(self).properties()
+
+ def _update_props(self, props, errfmt):
+ """
+ Helper for `.Artist.set` and `.Artist.update`.
+
+ *errfmt* is used to generate error messages for invalid property
+ names; it gets formatted with ``type(self)`` for "{cls}" and the
+ property name for "{prop_name}".
+ """
+ ret = []
+ with cbook._setattr_cm(self, eventson=False):
+ for k, v in props.items():
+ # Allow attributes we want to be able to update through
+ # art.update, art.set, setp.
+ if k == "axes":
+ ret.append(setattr(self, k, v))
+ else:
+ func = getattr(self, f"set_{k}", None)
+ if not callable(func):
+ raise AttributeError(
+ errfmt.format(cls=type(self), prop_name=k),
+ name=k)
+ ret.append(func(v))
+ if ret:
+ self.pchanged()
+ self.stale = True
+ return ret
+
+ def update(self, props):
+ """
+ Update this artist's properties from the dict *props*.
+
+ Parameters
+ ----------
+ props : dict
+ """
+ return self._update_props(
+ props, "{cls.__name__!r} object has no property {prop_name!r}")
+
+ def _internal_update(self, kwargs):
+ """
+ Update artist properties without prenormalizing them, but generating
+ errors as if calling `set`.
+
+ The lack of prenormalization is to maintain backcompatibility.
+ """
+ return self._update_props(
+ kwargs, "{cls.__name__}.set() got an unexpected keyword argument "
+ "{prop_name!r}")
+
+ def set(self, **kwargs):
+ # docstring and signature are auto-generated via
+ # Artist._update_set_signature_and_docstring() at the end of the
+ # module.
+ return self._internal_update(cbook.normalize_kwargs(kwargs, self))
+
+ @contextlib.contextmanager
+ def _cm_set(self, **kwargs):
+ """
+ `.Artist.set` context-manager that restores original values at exit.
+ """
+ orig_vals = {k: getattr(self, f"get_{k}")() for k in kwargs}
+ try:
+ self.set(**kwargs)
+ yield
+ finally:
+ self.set(**orig_vals)
+
+ def findobj(self, match=None, include_self=True):
+ """
+ Find artist objects.
+
+ Recursively find all `.Artist` instances contained in the artist.
+
+ Parameters
+ ----------
+ match
+ A filter criterion for the matches. This can be
+
+ - *None*: Return all objects contained in artist.
+ - A function with signature ``def match(artist: Artist) -> bool``.
+ The result will only contain artists for which the function
+ returns *True*.
+ - A class instance: e.g., `.Line2D`. The result will only contain
+ artists of this class or its subclasses (``isinstance`` check).
+
+ include_self : bool
+ Include *self* in the list to be checked for a match.
+
+ Returns
+ -------
+ list of `.Artist`
+
+ """
+ if match is None: # always return True
+ def matchfunc(x):
+ return True
+ elif isinstance(match, type) and issubclass(match, Artist):
+ def matchfunc(x):
+ return isinstance(x, match)
+ elif callable(match):
+ matchfunc = match
+ else:
+ raise ValueError('match must be None, a matplotlib.artist.Artist '
+ 'subclass, or a callable')
+
+ artists = reduce(operator.iadd,
+ [c.findobj(matchfunc) for c in self.get_children()], [])
+ if include_self and matchfunc(self):
+ artists.append(self)
+ return artists
+
+ def get_cursor_data(self, event):
+ """
+ Return the cursor data for a given event.
+
+ .. note::
+ This method is intended to be overridden by artist subclasses.
+ As an end-user of Matplotlib you will most likely not call this
+ method yourself.
+
+ Cursor data can be used by Artists to provide additional context
+ information for a given event. The default implementation just returns
+ *None*.
+
+ Subclasses can override the method and return arbitrary data. However,
+ when doing so, they must ensure that `.format_cursor_data` can convert
+ the data to a string representation.
+
+ The only current use case is displaying the z-value of an `.AxesImage`
+ in the status bar of a plot window, while moving the mouse.
+
+ Parameters
+ ----------
+ event : `~matplotlib.backend_bases.MouseEvent`
+
+ See Also
+ --------
+ format_cursor_data
+
+ """
+ return None
+
+ def format_cursor_data(self, data):
+ """
+ Return a string representation of *data*.
+
+ .. note::
+ This method is intended to be overridden by artist subclasses.
+ As an end-user of Matplotlib you will most likely not call this
+ method yourself.
+
+ The default implementation converts ints and floats and arrays of ints
+ and floats into a comma-separated string enclosed in square brackets,
+ unless the artist has an associated colorbar, in which case scalar
+ values are formatted using the colorbar's formatter.
+
+ See Also
+ --------
+ get_cursor_data
+ """
+ if np.ndim(data) == 0 and hasattr(self, "_format_cursor_data_override"):
+ # workaround for ScalarMappable to be able to define its own
+ # format_cursor_data(). See ScalarMappable._format_cursor_data_override
+ # for details.
+ return self._format_cursor_data_override(data)
+ else:
+ try:
+ data[0]
+ except (TypeError, IndexError):
+ data = [data]
+ data_str = ', '.join(f'{item:0.3g}' for item in data
+ if isinstance(item, Number))
+ return "[" + data_str + "]"
+
+ def get_mouseover(self):
+ """
+ Return whether this artist is queried for custom context information
+ when the mouse cursor moves over it.
+ """
+ return self._mouseover
+
+ def set_mouseover(self, mouseover):
+ """
+ Set whether this artist is queried for custom context information when
+ the mouse cursor moves over it.
+
+ Parameters
+ ----------
+ mouseover : bool
+
+ See Also
+ --------
+ get_cursor_data
+ .ToolCursorPosition
+ .NavigationToolbar2
+ """
+ self._mouseover = bool(mouseover)
+ ax = self.axes
+ if ax:
+ if self._mouseover:
+ ax._mouseover_set.add(self)
+ else:
+ ax._mouseover_set.discard(self)
+
+ mouseover = property(get_mouseover, set_mouseover) # backcompat.
+
+
+def _get_tightbbox_for_layout_only(obj, *args, **kwargs):
+ """
+ Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
+ *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
+ when encountering third-party subclasses that do not support it.
+ """
+ try:
+ return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
+ except TypeError:
+ return obj.get_tightbbox(*args, **kwargs)
+
+
+class ArtistInspector:
+ """
+ A helper class to inspect an `~matplotlib.artist.Artist` and return
+ information about its settable properties and their current values.
+ """
+
+ def __init__(self, o):
+ r"""
+ Initialize the artist inspector with an `Artist` or an iterable of
+ `Artist`\s. If an iterable is used, we assume it is a homogeneous
+ sequence (all `Artist`\s are of the same type) and it is your
+ responsibility to make sure this is so.
+ """
+ if not isinstance(o, Artist):
+ if np.iterable(o):
+ o = list(o)
+ if len(o):
+ o = o[0]
+
+ self.oorig = o
+ if not isinstance(o, type):
+ o = type(o)
+ self.o = o
+
+ self.aliasd = self.get_aliases()
+
+ def get_aliases(self):
+ """
+ Get a dict mapping property fullnames to sets of aliases for each alias
+ in the :class:`~matplotlib.artist.ArtistInspector`.
+
+ e.g., for lines::
+
+ {'markerfacecolor': {'mfc'},
+ 'linewidth' : {'lw'},
+ }
+ """
+ names = [name for name in dir(self.o)
+ if name.startswith(('set_', 'get_'))
+ and callable(getattr(self.o, name))]
+ aliases = {}
+ for name in names:
+ func = getattr(self.o, name)
+ if not self.is_alias(func):
+ continue
+ propname = re.search(f"`({name[:4]}.*)`", # get_.*/set_.*
+ inspect.getdoc(func)).group(1)
+ aliases.setdefault(propname[4:], set()).add(name[4:])
+ return aliases
+
+ _get_valid_values_regex = re.compile(
+ r"\n\s*(?:\.\.\s+)?ACCEPTS:\s*((?:.|\n)*?)(?:$|(?:\n\n))"
+ )
+
+ def get_valid_values(self, attr):
+ """
+ Get the legal arguments for the setter associated with *attr*.
+
+ This is done by querying the docstring of the setter for a line that
+ begins with "ACCEPTS:" or ".. ACCEPTS:", and then by looking for a
+ numpydoc-style documentation for the setter's first argument.
+ """
+
+ name = 'set_%s' % attr
+ if not hasattr(self.o, name):
+ raise AttributeError(f'{self.o} has no function {name}')
+ func = getattr(self.o, name)
+
+ if hasattr(func, '_kwarg_doc'):
+ return func._kwarg_doc
+
+ docstring = inspect.getdoc(func)
+ if docstring is None:
+ return 'unknown'
+
+ if docstring.startswith('Alias for '):
+ return None
+
+ match = self._get_valid_values_regex.search(docstring)
+ if match is not None:
+ return re.sub("\n *", " ", match.group(1))
+
+ # Much faster than list(inspect.signature(func).parameters)[1],
+ # although barely relevant wrt. matplotlib's total import time.
+ param_name = func.__code__.co_varnames[1]
+ # We could set the presence * based on whether the parameter is a
+ # varargs (it can't be a varkwargs) but it's not really worth it.
+ match = re.search(fr"(?m)^ *\*?{param_name} : (.+)", docstring)
+ if match:
+ return match.group(1)
+
+ return 'unknown'
+
+ def _replace_path(self, source_class):
+ """
+ Changes the full path to the public API path that is used
+ in sphinx. This is needed for links to work.
+ """
+ replace_dict = {'_base._AxesBase': 'Axes',
+ '_axes.Axes': 'Axes'}
+ for key, value in replace_dict.items():
+ source_class = source_class.replace(key, value)
+ return source_class
+
+ def get_setters(self):
+ """
+ Get the attribute strings with setters for object.
+
+ For example, for a line, return ``['markerfacecolor', 'linewidth',
+ ....]``.
+ """
+ setters = []
+ for name in dir(self.o):
+ if not name.startswith('set_'):
+ continue
+ func = getattr(self.o, name)
+ if (not callable(func)
+ or self.number_of_parameters(func) < 2
+ or self.is_alias(func)):
+ continue
+ setters.append(name[4:])
+ return setters
+
+ @staticmethod
+ @cache
+ def number_of_parameters(func):
+ """Return number of parameters of the callable *func*."""
+ return len(inspect.signature(func).parameters)
+
+ @staticmethod
+ @cache
+ def is_alias(method):
+ """
+ Return whether the object *method* is an alias for another method.
+ """
+
+ ds = inspect.getdoc(method)
+ if ds is None:
+ return False
+
+ return ds.startswith('Alias for ')
+
+ def aliased_name(self, s):
+ """
+ Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME'.
+
+ For example, for the line markerfacecolor property, which has an
+ alias, return 'markerfacecolor or mfc' and for the transform
+ property, which does not, return 'transform'.
+ """
+ aliases = ''.join(' or %s' % x for x in sorted(self.aliasd.get(s, [])))
+ return s + aliases
+
+ _NOT_LINKABLE = {
+ # A set of property setter methods that are not available in our
+ # current docs. This is a workaround used to prevent trying to link
+ # these setters which would lead to "target reference not found"
+ # warnings during doc build.
+ 'matplotlib.image._ImageBase.set_alpha',
+ 'matplotlib.image._ImageBase.set_array',
+ 'matplotlib.image._ImageBase.set_data',
+ 'matplotlib.image._ImageBase.set_filternorm',
+ 'matplotlib.image._ImageBase.set_filterrad',
+ 'matplotlib.image._ImageBase.set_interpolation',
+ 'matplotlib.image._ImageBase.set_interpolation_stage',
+ 'matplotlib.image._ImageBase.set_resample',
+ 'matplotlib.text._AnnotationBase.set_annotation_clip',
+ }
+
+ def aliased_name_rest(self, s, target):
+ """
+ Return 'PROPNAME or alias' if *s* has an alias, else return 'PROPNAME',
+ formatted for reST.
+
+ For example, for the line markerfacecolor property, which has an
+ alias, return 'markerfacecolor or mfc' and for the transform
+ property, which does not, return 'transform'.
+ """
+ # workaround to prevent "reference target not found"
+ if target in self._NOT_LINKABLE:
+ return f'``{s}``'
+
+ aliases = ''.join(
+ f' or :meth:`{a} <{target}>`' for a in sorted(self.aliasd.get(s, [])))
+ return f':meth:`{s} <{target}>`{aliases}'
+
+ def pprint_setters(self, prop=None, leadingspace=2):
+ """
+ If *prop* is *None*, return a list of strings of all settable
+ properties and their valid values.
+
+ If *prop* is not *None*, it is a valid property name and that
+ property will be returned as a string of property : valid
+ values.
+ """
+ if leadingspace:
+ pad = ' ' * leadingspace
+ else:
+ pad = ''
+ if prop is not None:
+ accepts = self.get_valid_values(prop)
+ return f'{pad}{prop}: {accepts}'
+
+ lines = []
+ for prop in sorted(self.get_setters()):
+ accepts = self.get_valid_values(prop)
+ name = self.aliased_name(prop)
+ lines.append(f'{pad}{name}: {accepts}')
+ return lines
+
+ def pprint_setters_rest(self, prop=None, leadingspace=4):
+ """
+ If *prop* is *None*, return a list of reST-formatted strings of all
+ settable properties and their valid values.
+
+ If *prop* is not *None*, it is a valid property name and that
+ property will be returned as a string of "property : valid"
+ values.
+ """
+ if leadingspace:
+ pad = ' ' * leadingspace
+ else:
+ pad = ''
+ if prop is not None:
+ accepts = self.get_valid_values(prop)
+ return f'{pad}{prop}: {accepts}'
+
+ prop_and_qualnames = []
+ for prop in sorted(self.get_setters()):
+ # Find the parent method which actually provides the docstring.
+ for cls in self.o.__mro__:
+ method = getattr(cls, f"set_{prop}", None)
+ if method and method.__doc__ is not None:
+ break
+ else: # No docstring available.
+ method = getattr(self.o, f"set_{prop}")
+ prop_and_qualnames.append(
+ (prop, f"{method.__module__}.{method.__qualname__}"))
+
+ names = [self.aliased_name_rest(prop, target)
+ .replace('_base._AxesBase', 'Axes')
+ .replace('_axes.Axes', 'Axes')
+ for prop, target in prop_and_qualnames]
+ accepts = [self.get_valid_values(prop)
+ for prop, _ in prop_and_qualnames]
+
+ col0_len = max(len(n) for n in names)
+ col1_len = max(len(a) for a in accepts)
+ table_formatstr = pad + ' ' + '=' * col0_len + ' ' + '=' * col1_len
+
+ return [
+ '',
+ pad + '.. table::',
+ pad + ' :class: property-table',
+ '',
+ table_formatstr,
+ pad + ' ' + 'Property'.ljust(col0_len)
+ + ' ' + 'Description'.ljust(col1_len),
+ table_formatstr,
+ *[pad + ' ' + n.ljust(col0_len) + ' ' + a.ljust(col1_len)
+ for n, a in zip(names, accepts)],
+ table_formatstr,
+ '',
+ ]
+
+ def properties(self):
+ """Return a dictionary mapping property name -> value."""
+ o = self.oorig
+ getters = [name for name in dir(o)
+ if name.startswith('get_') and callable(getattr(o, name))]
+ getters.sort()
+ d = {}
+ for name in getters:
+ func = getattr(o, name)
+ if self.is_alias(func):
+ continue
+ try:
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore')
+ val = func()
+ except Exception:
+ continue
+ else:
+ d[name[4:]] = val
+ return d
+
+ def pprint_getters(self):
+ """Return the getters and actual values as list of strings."""
+ lines = []
+ for name, val in sorted(self.properties().items()):
+ if getattr(val, 'shape', ()) != () and len(val) > 6:
+ s = str(val[:6]) + '...'
+ else:
+ s = str(val)
+ s = s.replace('\n', ' ')
+ if len(s) > 50:
+ s = s[:50] + '...'
+ name = self.aliased_name(name)
+ lines.append(f' {name} = {s}')
+ return lines
+
+
+def getp(obj, property=None):
+ """
+ Return the value of an `.Artist`'s *property*, or print all of them.
+
+ Parameters
+ ----------
+ obj : `~matplotlib.artist.Artist`
+ The queried artist; e.g., a `.Line2D`, a `.Text`, or an `~.axes.Axes`.
+
+ property : str or None, default: None
+ If *property* is 'somename', this function returns
+ ``obj.get_somename()``.
+
+ If it's None (or unset), it *prints* all gettable properties from
+ *obj*. Many properties have aliases for shorter typing, e.g. 'lw' is
+ an alias for 'linewidth'. In the output, aliases and full property
+ names will be listed as:
+
+ property or alias = value
+
+ e.g.:
+
+ linewidth or lw = 2
+
+ See Also
+ --------
+ setp
+ """
+ if property is None:
+ insp = ArtistInspector(obj)
+ ret = insp.pprint_getters()
+ print('\n'.join(ret))
+ return
+ return getattr(obj, 'get_' + property)()
+
+# alias
+get = getp
+
+
+def setp(obj, *args, file=None, **kwargs):
+ """
+ Set one or more properties on an `.Artist`, or list allowed values.
+
+ Parameters
+ ----------
+ obj : `~matplotlib.artist.Artist` or list of `.Artist`
+ The artist(s) whose properties are being set or queried. When setting
+ properties, all artists are affected; when querying the allowed values,
+ only the first instance in the sequence is queried.
+
+ For example, two lines can be made thicker and red with a single call:
+
+ >>> x = arange(0, 1, 0.01)
+ >>> lines = plot(x, sin(2*pi*x), x, sin(4*pi*x))
+ >>> setp(lines, linewidth=2, color='r')
+
+ file : file-like, default: `sys.stdout`
+ Where `setp` writes its output when asked to list allowed values.
+
+ >>> with open('output.log') as file:
+ ... setp(line, file=file)
+
+ The default, ``None``, means `sys.stdout`.
+
+ *args, **kwargs
+ The properties to set. The following combinations are supported:
+
+ - Set the linestyle of a line to be dashed:
+
+ >>> line, = plot([1, 2, 3])
+ >>> setp(line, linestyle='--')
+
+ - Set multiple properties at once:
+
+ >>> setp(line, linewidth=2, color='r')
+
+ - List allowed values for a line's linestyle:
+
+ >>> setp(line, 'linestyle')
+ linestyle: {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
+
+ - List all properties that can be set, and their allowed values:
+
+ >>> setp(line)
+ agg_filter: a filter function, ...
+ [long output listing omitted]
+
+ `setp` also supports MATLAB style string/value pairs. For example, the
+ following are equivalent:
+
+ >>> setp(lines, 'linewidth', 2, 'color', 'r') # MATLAB style
+ >>> setp(lines, linewidth=2, color='r') # Python style
+
+ See Also
+ --------
+ getp
+ """
+
+ if isinstance(obj, Artist):
+ objs = [obj]
+ else:
+ objs = list(cbook.flatten(obj))
+
+ if not objs:
+ return
+
+ insp = ArtistInspector(objs[0])
+
+ if not kwargs and len(args) < 2:
+ if args:
+ print(insp.pprint_setters(prop=args[0]), file=file)
+ else:
+ print('\n'.join(insp.pprint_setters()), file=file)
+ return
+
+ if len(args) % 2:
+ raise ValueError('The set args must be string, value pairs')
+
+ funcvals = dict(zip(args[::2], args[1::2]))
+ ret = [o.update(funcvals) for o in objs] + [o.set(**kwargs) for o in objs]
+ return list(cbook.flatten(ret))
+
+
+def kwdoc(artist):
+ r"""
+ Inspect an `~matplotlib.artist.Artist` class (using `.ArtistInspector`) and
+ return information about its settable properties and their current values.
+
+ Parameters
+ ----------
+ artist : `~matplotlib.artist.Artist` or an iterable of `Artist`\s
+
+ Returns
+ -------
+ str
+ The settable properties of *artist*, as plain text if
+ :rc:`docstring.hardcopy` is False and as a rst table (intended for
+ use in Sphinx) if it is True.
+ """
+ ai = ArtistInspector(artist)
+ return ('\n'.join(ai.pprint_setters_rest(leadingspace=4))
+ if mpl.rcParams['docstring.hardcopy'] else
+ 'Properties:\n' + '\n'.join(ai.pprint_setters(leadingspace=4)))
+
+# We defer this to the end of them module, because it needs ArtistInspector
+# to be defined.
+Artist._update_set_signature_and_docstring()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/artist.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/artist.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..be23f69d44a6df19fef57131eadede93bf4875bc
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/artist.pyi
@@ -0,0 +1,199 @@
+from .axes._base import _AxesBase
+from .backend_bases import RendererBase, MouseEvent
+from .figure import Figure, SubFigure
+from .path import Path
+from .patches import Patch
+from .patheffects import AbstractPathEffect
+from .transforms import (
+ BboxBase,
+ Bbox,
+ Transform,
+ TransformedPatchPath,
+ TransformedPath,
+)
+
+import numpy as np
+
+from collections.abc import Callable, Iterable
+from typing import Any, Literal, NamedTuple, TextIO, overload, TypeVar
+from numpy.typing import ArrayLike
+
+_T_Artist = TypeVar("_T_Artist", bound=Artist)
+
+def allow_rasterization(draw): ...
+
+class _XYPair(NamedTuple):
+ x: ArrayLike
+ y: ArrayLike
+
+class _Unset: ...
+
+class Artist:
+ zorder: float
+ stale_callback: Callable[[Artist, bool], None] | None
+ @property
+ def figure(self) -> Figure | SubFigure: ...
+ clipbox: BboxBase | None
+ def __init__(self) -> None: ...
+ def remove(self) -> None: ...
+ def have_units(self) -> bool: ...
+ # TODO units
+ def convert_xunits(self, x): ...
+ def convert_yunits(self, y): ...
+ @property
+ def axes(self) -> _AxesBase | None: ...
+ @axes.setter
+ def axes(self, new_axes: _AxesBase | None) -> None: ...
+ @property
+ def stale(self) -> bool: ...
+ @stale.setter
+ def stale(self, val: bool) -> None: ...
+ def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ...
+ def get_tightbbox(self, renderer: RendererBase | None = ...) -> Bbox | None: ...
+ def add_callback(self, func: Callable[[Artist], Any]) -> int: ...
+ def remove_callback(self, oid: int) -> None: ...
+ def pchanged(self) -> None: ...
+ def is_transform_set(self) -> bool: ...
+ def set_transform(self, t: Transform | None) -> None: ...
+ def get_transform(self) -> Transform: ...
+ def get_children(self) -> list[Artist]: ...
+ # TODO can these dicts be type narrowed? e.g. str keys
+ def contains(self, mouseevent: MouseEvent) -> tuple[bool, dict[Any, Any]]: ...
+ def pickable(self) -> bool: ...
+ def pick(self, mouseevent: MouseEvent) -> None: ...
+ def set_picker(
+ self,
+ picker: None
+ | bool
+ | float
+ | Callable[[Artist, MouseEvent], tuple[bool, dict[Any, Any]]],
+ ) -> None: ...
+ def get_picker(
+ self,
+ ) -> None | bool | float | Callable[
+ [Artist, MouseEvent], tuple[bool, dict[Any, Any]]
+ ]: ...
+ def get_url(self) -> str | None: ...
+ def set_url(self, url: str | None) -> None: ...
+ def get_gid(self) -> str | None: ...
+ def set_gid(self, gid: str | None) -> None: ...
+ def get_snap(self) -> bool | None: ...
+ def set_snap(self, snap: bool | None) -> None: ...
+ def get_sketch_params(self) -> tuple[float, float, float] | None: ...
+ def set_sketch_params(
+ self,
+ scale: float | None = ...,
+ length: float | None = ...,
+ randomness: float | None = ...,
+ ) -> None: ...
+ def set_path_effects(self, path_effects: list[AbstractPathEffect]) -> None: ...
+ def get_path_effects(self) -> list[AbstractPathEffect]: ...
+ @overload
+ def get_figure(self, root: Literal[True]) -> Figure | None: ...
+ @overload
+ def get_figure(self, root: Literal[False]) -> Figure | SubFigure | None: ...
+ @overload
+ def get_figure(self, root: bool = ...) -> Figure | SubFigure | None: ...
+ def set_figure(self, fig: Figure | SubFigure) -> None: ...
+ def set_clip_box(self, clipbox: BboxBase | None) -> None: ...
+ def set_clip_path(
+ self,
+ path: Patch | Path | TransformedPath | TransformedPatchPath | None,
+ transform: Transform | None = ...,
+ ) -> None: ...
+ def get_alpha(self) -> float | None: ...
+ def get_visible(self) -> bool: ...
+ def get_animated(self) -> bool: ...
+ def get_in_layout(self) -> bool: ...
+ def get_clip_on(self) -> bool: ...
+ def get_clip_box(self) -> Bbox | None: ...
+ def get_clip_path(
+ self,
+ ) -> Patch | Path | TransformedPath | TransformedPatchPath | None: ...
+ def get_transformed_clip_path_and_affine(
+ self,
+ ) -> tuple[None, None] | tuple[Path, Transform]: ...
+ def set_clip_on(self, b: bool) -> None: ...
+ def get_rasterized(self) -> bool: ...
+ def set_rasterized(self, rasterized: bool) -> None: ...
+ def get_agg_filter(self) -> Callable[[ArrayLike, float], tuple[np.ndarray, float, float]] | None: ...
+ def set_agg_filter(
+ self, filter_func: Callable[[ArrayLike, float], tuple[np.ndarray, float, float]] | None
+ ) -> None: ...
+ def draw(self, renderer: RendererBase) -> None: ...
+ def set_alpha(self, alpha: float | None) -> None: ...
+ def set_visible(self, b: bool) -> None: ...
+ def set_animated(self, b: bool) -> None: ...
+ def set_in_layout(self, in_layout: bool) -> None: ...
+ def get_label(self) -> object: ...
+ def set_label(self, s: object) -> None: ...
+ def get_zorder(self) -> float: ...
+ def set_zorder(self, level: float) -> None: ...
+ @property
+ def sticky_edges(self) -> _XYPair: ...
+ def update_from(self, other: Artist) -> None: ...
+ def properties(self) -> dict[str, Any]: ...
+ def update(self, props: dict[str, Any]) -> list[Any]: ...
+ def _internal_update(self, kwargs: Any) -> list[Any]: ...
+ def set(self, **kwargs: Any) -> list[Any]: ...
+
+ @overload
+ def findobj(
+ self,
+ match: None | Callable[[Artist], bool] = ...,
+ include_self: bool = ...,
+ ) -> list[Artist]: ...
+
+ @overload
+ def findobj(
+ self,
+ match: type[_T_Artist],
+ include_self: bool = ...,
+ ) -> list[_T_Artist]: ...
+
+ def get_cursor_data(self, event: MouseEvent) -> Any: ...
+ def format_cursor_data(self, data: Any) -> str: ...
+ def get_mouseover(self) -> bool: ...
+ def set_mouseover(self, mouseover: bool) -> None: ...
+ @property
+ def mouseover(self) -> bool: ...
+ @mouseover.setter
+ def mouseover(self, mouseover: bool) -> None: ...
+
+class ArtistInspector:
+ oorig: Artist | type[Artist]
+ o: type[Artist]
+ aliasd: dict[str, set[str]]
+ def __init__(
+ self, o: Artist | type[Artist] | Iterable[Artist | type[Artist]]
+ ) -> None: ...
+ def get_aliases(self) -> dict[str, set[str]]: ...
+ def get_valid_values(self, attr: str) -> str | None: ...
+ def get_setters(self) -> list[str]: ...
+ @staticmethod
+ def number_of_parameters(func: Callable) -> int: ...
+ @staticmethod
+ def is_alias(method: Callable) -> bool: ...
+ def aliased_name(self, s: str) -> str: ...
+ def aliased_name_rest(self, s: str, target: str) -> str: ...
+ @overload
+ def pprint_setters(
+ self, prop: None = ..., leadingspace: int = ...
+ ) -> list[str]: ...
+ @overload
+ def pprint_setters(self, prop: str, leadingspace: int = ...) -> str: ...
+ @overload
+ def pprint_setters_rest(
+ self, prop: None = ..., leadingspace: int = ...
+ ) -> list[str]: ...
+ @overload
+ def pprint_setters_rest(self, prop: str, leadingspace: int = ...) -> str: ...
+ def properties(self) -> dict[str, Any]: ...
+ def pprint_getters(self) -> list[str]: ...
+
+def getp(obj: Artist, property: str | None = ...) -> Any: ...
+
+get = getp
+
+def setp(obj: Artist, *args, file: TextIO | None = ..., **kwargs) -> list[Any] | None: ...
+def kwdoc(artist: Artist | type[Artist] | Iterable[Artist | type[Artist]]) -> str: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..cdc31f17aae693cd914528513f52776167d7d8d2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__init__.py
@@ -0,0 +1,18 @@
+from . import _base
+from ._axes import Axes
+
+# Backcompat.
+Subplot = Axes
+
+
+class _SubplotBaseMeta(type):
+ def __instancecheck__(self, obj):
+ return (isinstance(obj, _base._AxesBase)
+ and obj.get_subplotspec() is not None)
+
+
+class SubplotBase(metaclass=_SubplotBaseMeta):
+ pass
+
+
+def subplot_class_factory(cls): return cls
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__init__.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__init__.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..7df38b8bde9edc06720e08f41c245ab8d61fc091
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__init__.pyi
@@ -0,0 +1,16 @@
+from typing import TypeVar
+
+from ._axes import Axes as Axes
+
+
+_T = TypeVar("_T")
+
+# Backcompat.
+Subplot = Axes
+
+class _SubplotBaseMeta(type):
+ def __instancecheck__(self, obj) -> bool: ...
+
+class SubplotBase(metaclass=_SubplotBaseMeta): ...
+
+def subplot_class_factory(cls: type[_T]) -> type[_T]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..7ef80ed5ea63ef97926d056e26eced2d5d8ce014
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__pycache__/_secondary_axes.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__pycache__/_secondary_axes.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..76d3d156765d085a809a321dd9e3a1c0903531e2
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/__pycache__/_secondary_axes.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_axes.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_axes.py
new file mode 100644
index 0000000000000000000000000000000000000000..91dcf5a58acfa50b55c821e5cef785ef6b97de05
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_axes.py
@@ -0,0 +1,8868 @@
+import functools
+import itertools
+import logging
+import math
+from numbers import Integral, Number, Real
+
+import re
+import numpy as np
+
+import matplotlib as mpl
+import matplotlib.category # Register category unit converter as side effect.
+import matplotlib.cbook as cbook
+import matplotlib.collections as mcoll
+import matplotlib.colorizer as mcolorizer
+import matplotlib.colors as mcolors
+import matplotlib.contour as mcontour
+import matplotlib.dates # noqa: F401, Register date unit converter as side effect.
+import matplotlib.image as mimage
+import matplotlib.inset as minset
+import matplotlib.legend as mlegend
+import matplotlib.lines as mlines
+import matplotlib.markers as mmarkers
+import matplotlib.mlab as mlab
+import matplotlib.patches as mpatches
+import matplotlib.path as mpath
+import matplotlib.quiver as mquiver
+import matplotlib.stackplot as mstack
+import matplotlib.streamplot as mstream
+import matplotlib.table as mtable
+import matplotlib.text as mtext
+import matplotlib.ticker as mticker
+import matplotlib.transforms as mtransforms
+import matplotlib.tri as mtri
+import matplotlib.units as munits
+from matplotlib import _api, _docstring, _preprocess_data
+from matplotlib.axes._base import (
+ _AxesBase, _TransformedBoundsLocator, _process_plot_format)
+from matplotlib.axes._secondary_axes import SecondaryAxis
+from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
+from matplotlib.transforms import _ScaledRotation
+
+_log = logging.getLogger(__name__)
+
+
+# The axes module contains all the wrappers to plotting functions.
+# All the other methods should go in the _AxesBase class.
+
+
+def _make_axes_method(func):
+ """
+ Patch the qualname for functions that are directly added to Axes.
+
+ Some Axes functionality is defined in functions in other submodules.
+ These are simply added as attributes to Axes. As a result, their
+ ``__qualname__`` is e.g. only "table" and not "Axes.table". This
+ function fixes that.
+
+ Note that the function itself is patched, so that
+ ``matplotlib.table.table.__qualname__` will also show "Axes.table".
+ However, since these functions are not intended to be standalone,
+ this is bearable.
+ """
+ func.__qualname__ = f"Axes.{func.__name__}"
+ return func
+
+
+@_docstring.interpd
+class Axes(_AxesBase):
+ """
+ An Axes object encapsulates all the elements of an individual (sub-)plot in
+ a figure.
+
+ It contains most of the (sub-)plot elements: `~.axis.Axis`,
+ `~.axis.Tick`, `~.lines.Line2D`, `~.text.Text`, `~.patches.Polygon`, etc.,
+ and sets the coordinate system.
+
+ Like all visible elements in a figure, Axes is an `.Artist` subclass.
+
+ The `Axes` instance supports callbacks through a callbacks attribute which
+ is a `~.cbook.CallbackRegistry` instance. The events you can connect to
+ are 'xlim_changed' and 'ylim_changed' and the callback will be called with
+ func(*ax*) where *ax* is the `Axes` instance.
+
+ .. note::
+
+ As a user, you do not instantiate Axes directly, but use Axes creation
+ methods instead; e.g. from `.pyplot` or `.Figure`:
+ `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` or `.Figure.add_axes`.
+
+ """
+ ### Labelling, legend and texts
+
+ def get_title(self, loc="center"):
+ """
+ Get an Axes title.
+
+ Get one of the three available Axes titles. The available titles
+ are positioned above the Axes in the center, flush with the left
+ edge, and flush with the right edge.
+
+ Parameters
+ ----------
+ loc : {'center', 'left', 'right'}, str, default: 'center'
+ Which title to return.
+
+ Returns
+ -------
+ str
+ The title text string.
+
+ """
+ titles = {'left': self._left_title,
+ 'center': self.title,
+ 'right': self._right_title}
+ title = _api.check_getitem(titles, loc=loc.lower())
+ return title.get_text()
+
+ def set_title(self, label, fontdict=None, loc=None, pad=None, *, y=None,
+ **kwargs):
+ """
+ Set a title for the Axes.
+
+ Set one of the three available Axes titles. The available titles
+ are positioned above the Axes in the center, flush with the left
+ edge, and flush with the right edge.
+
+ Parameters
+ ----------
+ label : str
+ Text to use for the title
+
+ fontdict : dict
+
+ .. admonition:: Discouraged
+
+ The use of *fontdict* is discouraged. Parameters should be passed as
+ individual keyword arguments or using dictionary-unpacking
+ ``set_title(..., **fontdict)``.
+
+ A dictionary controlling the appearance of the title text,
+ the default *fontdict* is::
+
+ {'fontsize': rcParams['axes.titlesize'],
+ 'fontweight': rcParams['axes.titleweight'],
+ 'color': rcParams['axes.titlecolor'],
+ 'verticalalignment': 'baseline',
+ 'horizontalalignment': loc}
+
+ loc : {'center', 'left', 'right'}, default: :rc:`axes.titlelocation`
+ Which title to set.
+
+ y : float, default: :rc:`axes.titley`
+ Vertical Axes location for the title (1.0 is the top). If
+ None (the default) and :rc:`axes.titley` is also None, y is
+ determined automatically to avoid decorators on the Axes.
+
+ pad : float, default: :rc:`axes.titlepad`
+ The offset of the title from the top of the Axes, in points.
+
+ Returns
+ -------
+ `.Text`
+ The matplotlib text instance representing the title
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.text.Text` properties
+ Other keyword arguments are text properties, see `.Text` for a list
+ of valid text properties.
+ """
+ if loc is None:
+ loc = mpl.rcParams['axes.titlelocation']
+
+ if y is None:
+ y = mpl.rcParams['axes.titley']
+ if y is None:
+ y = 1.0
+ else:
+ self._autotitlepos = False
+ kwargs['y'] = y
+
+ titles = {'left': self._left_title,
+ 'center': self.title,
+ 'right': self._right_title}
+ title = _api.check_getitem(titles, loc=loc.lower())
+ default = {
+ 'fontsize': mpl.rcParams['axes.titlesize'],
+ 'fontweight': mpl.rcParams['axes.titleweight'],
+ 'verticalalignment': 'baseline',
+ 'horizontalalignment': loc.lower()}
+ titlecolor = mpl.rcParams['axes.titlecolor']
+ if not cbook._str_lower_equal(titlecolor, 'auto'):
+ default["color"] = titlecolor
+ if pad is None:
+ pad = mpl.rcParams['axes.titlepad']
+ self._set_title_offset_trans(float(pad))
+ title.set_text(label)
+ title.update(default)
+ if fontdict is not None:
+ title.update(fontdict)
+ title._internal_update(kwargs)
+ return title
+
+ def get_legend_handles_labels(self, legend_handler_map=None):
+ """
+ Return handles and labels for legend
+
+ ``ax.legend()`` is equivalent to ::
+
+ h, l = ax.get_legend_handles_labels()
+ ax.legend(h, l)
+ """
+ # pass through to legend.
+ handles, labels = mlegend._get_legend_handles_labels(
+ [self], legend_handler_map)
+ return handles, labels
+
+ @_docstring.interpd
+ def legend(self, *args, **kwargs):
+ """
+ Place a legend on the Axes.
+
+ Call signatures::
+
+ legend()
+ legend(handles, labels)
+ legend(handles=handles)
+ legend(labels)
+
+ The call signatures correspond to the following different ways to use
+ this method:
+
+ **1. Automatic detection of elements to be shown in the legend**
+
+ The elements to be added to the legend are automatically determined,
+ when you do not pass in any extra arguments.
+
+ In this case, the labels are taken from the artist. You can specify
+ them either at artist creation or by calling the
+ :meth:`~.Artist.set_label` method on the artist::
+
+ ax.plot([1, 2, 3], label='Inline label')
+ ax.legend()
+
+ or::
+
+ line, = ax.plot([1, 2, 3])
+ line.set_label('Label via method')
+ ax.legend()
+
+ .. note::
+ Specific artists can be excluded from the automatic legend element
+ selection by using a label starting with an underscore, "_".
+ A string starting with an underscore is the default label for all
+ artists, so calling `.Axes.legend` without any arguments and
+ without setting the labels manually will result in a ``UserWarning``
+ and an empty legend being drawn.
+
+
+ **2. Explicitly listing the artists and labels in the legend**
+
+ For full control of which artists have a legend entry, it is possible
+ to pass an iterable of legend artists followed by an iterable of
+ legend labels respectively::
+
+ ax.legend([line1, line2, line3], ['label1', 'label2', 'label3'])
+
+
+ **3. Explicitly listing the artists in the legend**
+
+ This is similar to 2, but the labels are taken from the artists'
+ label properties. Example::
+
+ line1, = ax.plot([1, 2, 3], label='label1')
+ line2, = ax.plot([1, 2, 3], label='label2')
+ ax.legend(handles=[line1, line2])
+
+
+ **4. Labeling existing plot elements**
+
+ .. admonition:: Discouraged
+
+ This call signature is discouraged, because the relation between
+ plot elements and labels is only implicit by their order and can
+ easily be mixed up.
+
+ To make a legend for all artists on an Axes, call this function with
+ an iterable of strings, one for each legend item. For example::
+
+ ax.plot([1, 2, 3])
+ ax.plot([5, 6, 7])
+ ax.legend(['First line', 'Second line'])
+
+
+ Parameters
+ ----------
+ handles : list of (`.Artist` or tuple of `.Artist`), optional
+ A list of Artists (lines, patches) to be added to the legend.
+ Use this together with *labels*, if you need full control on what
+ is shown in the legend and the automatic mechanism described above
+ is not sufficient.
+
+ The length of handles and labels should be the same in this
+ case. If they are not, they are truncated to the smaller length.
+
+ If an entry contains a tuple, then the legend handler for all Artists in the
+ tuple will be placed alongside a single label.
+
+ labels : list of str, optional
+ A list of labels to show next to the artists.
+ Use this together with *handles*, if you need full control on what
+ is shown in the legend and the automatic mechanism described above
+ is not sufficient.
+
+ Returns
+ -------
+ `~matplotlib.legend.Legend`
+
+ Other Parameters
+ ----------------
+ %(_legend_kw_axes)s
+
+ See Also
+ --------
+ .Figure.legend
+
+ Notes
+ -----
+ Some artists are not supported by this function. See
+ :ref:`legend_guide` for details.
+
+ Examples
+ --------
+ .. plot:: gallery/text_labels_and_annotations/legend.py
+ """
+ handles, labels, kwargs = mlegend._parse_legend_args([self], *args, **kwargs)
+ self.legend_ = mlegend.Legend(self, handles, labels, **kwargs)
+ self.legend_._remove_method = self._remove_legend
+ return self.legend_
+
+ def _remove_legend(self, legend):
+ self.legend_ = None
+
+ def inset_axes(self, bounds, *, transform=None, zorder=5, **kwargs):
+ """
+ Add a child inset Axes to this existing Axes.
+
+
+ Parameters
+ ----------
+ bounds : [x0, y0, width, height]
+ Lower-left corner of inset Axes, and its width and height.
+
+ transform : `.Transform`
+ Defaults to `ax.transAxes`, i.e. the units of *rect* are in
+ Axes-relative coordinates.
+
+ projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \
+'polar', 'rectilinear', str}, optional
+ The projection type of the inset `~.axes.Axes`. *str* is the name
+ of a custom projection, see `~matplotlib.projections`. The default
+ None results in a 'rectilinear' projection.
+
+ polar : bool, default: False
+ If True, equivalent to projection='polar'.
+
+ axes_class : subclass type of `~.axes.Axes`, optional
+ The `.axes.Axes` subclass that is instantiated. This parameter
+ is incompatible with *projection* and *polar*. See
+ :ref:`axisartist_users-guide-index` for examples.
+
+ zorder : number
+ Defaults to 5 (same as `.Axes.legend`). Adjust higher or lower
+ to change whether it is above or below data plotted on the
+ parent Axes.
+
+ **kwargs
+ Other keyword arguments are passed on to the inset Axes class.
+
+ Returns
+ -------
+ ax
+ The created `~.axes.Axes` instance.
+
+ Examples
+ --------
+ This example makes two inset Axes, the first is in Axes-relative
+ coordinates, and the second in data-coordinates::
+
+ fig, ax = plt.subplots()
+ ax.plot(range(10))
+ axin1 = ax.inset_axes([0.8, 0.1, 0.15, 0.15])
+ axin2 = ax.inset_axes(
+ [5, 7, 2.3, 2.3], transform=ax.transData)
+
+ """
+ if transform is None:
+ transform = self.transAxes
+ kwargs.setdefault('label', 'inset_axes')
+
+ # This puts the rectangle into figure-relative coordinates.
+ inset_locator = _TransformedBoundsLocator(bounds, transform)
+ bounds = inset_locator(self, None).bounds
+ fig = self.get_figure(root=False)
+ projection_class, pkw = fig._process_projection_requirements(**kwargs)
+ inset_ax = projection_class(fig, bounds, zorder=zorder, **pkw)
+
+ # this locator lets the axes move if in data coordinates.
+ # it gets called in `ax.apply_aspect() (of all places)
+ inset_ax.set_axes_locator(inset_locator)
+
+ self.add_child_axes(inset_ax)
+
+ return inset_ax
+
+ @_docstring.interpd
+ def indicate_inset(self, bounds=None, inset_ax=None, *, transform=None,
+ facecolor='none', edgecolor='0.5', alpha=0.5,
+ zorder=None, **kwargs):
+ """
+ Add an inset indicator to the Axes. This is a rectangle on the plot
+ at the position indicated by *bounds* that optionally has lines that
+ connect the rectangle to an inset Axes (`.Axes.inset_axes`).
+
+ Warnings
+ --------
+ This method is experimental as of 3.0, and the API may change.
+
+ Parameters
+ ----------
+ bounds : [x0, y0, width, height], optional
+ Lower-left corner of rectangle to be marked, and its width
+ and height. If not set, the bounds will be calculated from the
+ data limits of *inset_ax*, which must be supplied.
+
+ inset_ax : `.Axes`, optional
+ An optional inset Axes to draw connecting lines to. Two lines are
+ drawn connecting the indicator box to the inset Axes on corners
+ chosen so as to not overlap with the indicator box.
+
+ transform : `.Transform`
+ Transform for the rectangle coordinates. Defaults to
+ ``ax.transAxes``, i.e. the units of *rect* are in Axes-relative
+ coordinates.
+
+ facecolor : :mpltype:`color`, default: 'none'
+ Facecolor of the rectangle.
+
+ edgecolor : :mpltype:`color`, default: '0.5'
+ Color of the rectangle and color of the connecting lines.
+
+ alpha : float or None, default: 0.5
+ Transparency of the rectangle and connector lines. If not
+ ``None``, this overrides any alpha value included in the
+ *facecolor* and *edgecolor* parameters.
+
+ zorder : float, default: 4.99
+ Drawing order of the rectangle and connector lines. The default,
+ 4.99, is just below the default level of inset Axes.
+
+ **kwargs
+ Other keyword arguments are passed on to the `.Rectangle` patch:
+
+ %(Rectangle:kwdoc)s
+
+ Returns
+ -------
+ inset_indicator : `.inset.InsetIndicator`
+ An artist which contains
+
+ inset_indicator.rectangle : `.Rectangle`
+ The indicator frame.
+
+ inset_indicator.connectors : 4-tuple of `.patches.ConnectionPatch`
+ The four connector lines connecting to (lower_left, upper_left,
+ lower_right upper_right) corners of *inset_ax*. Two lines are
+ set with visibility to *False*, but the user can set the
+ visibility to True if the automatic choice is not deemed correct.
+
+ .. versionchanged:: 3.10
+ Previously the rectangle and connectors tuple were returned.
+ """
+ # to make the Axes connectors work, we need to apply the aspect to
+ # the parent Axes.
+ self.apply_aspect()
+
+ if transform is None:
+ transform = self.transData
+ kwargs.setdefault('label', '_indicate_inset')
+
+ indicator_patch = minset.InsetIndicator(
+ bounds, inset_ax=inset_ax,
+ facecolor=facecolor, edgecolor=edgecolor, alpha=alpha,
+ zorder=zorder, transform=transform, **kwargs)
+ self.add_artist(indicator_patch)
+
+ return indicator_patch
+
+ def indicate_inset_zoom(self, inset_ax, **kwargs):
+ """
+ Add an inset indicator rectangle to the Axes based on the axis
+ limits for an *inset_ax* and draw connectors between *inset_ax*
+ and the rectangle.
+
+ Warnings
+ --------
+ This method is experimental as of 3.0, and the API may change.
+
+ Parameters
+ ----------
+ inset_ax : `.Axes`
+ Inset Axes to draw connecting lines to. Two lines are
+ drawn connecting the indicator box to the inset Axes on corners
+ chosen so as to not overlap with the indicator box.
+
+ **kwargs
+ Other keyword arguments are passed on to `.Axes.indicate_inset`
+
+ Returns
+ -------
+ inset_indicator : `.inset.InsetIndicator`
+ An artist which contains
+
+ inset_indicator.rectangle : `.Rectangle`
+ The indicator frame.
+
+ inset_indicator.connectors : 4-tuple of `.patches.ConnectionPatch`
+ The four connector lines connecting to (lower_left, upper_left,
+ lower_right upper_right) corners of *inset_ax*. Two lines are
+ set with visibility to *False*, but the user can set the
+ visibility to True if the automatic choice is not deemed correct.
+
+ .. versionchanged:: 3.10
+ Previously the rectangle and connectors tuple were returned.
+ """
+
+ return self.indicate_inset(None, inset_ax, **kwargs)
+
+ @_docstring.interpd
+ def secondary_xaxis(self, location, functions=None, *, transform=None, **kwargs):
+ """
+ Add a second x-axis to this `~.axes.Axes`.
+
+ For example if we want to have a second scale for the data plotted on
+ the xaxis.
+
+ %(_secax_docstring)s
+
+ Examples
+ --------
+ The main axis shows frequency, and the secondary axis shows period.
+
+ .. plot::
+
+ fig, ax = plt.subplots()
+ ax.loglog(range(1, 360, 5), range(1, 360, 5))
+ ax.set_xlabel('frequency [Hz]')
+
+ def invert(x):
+ # 1/x with special treatment of x == 0
+ x = np.array(x).astype(float)
+ near_zero = np.isclose(x, 0)
+ x[near_zero] = np.inf
+ x[~near_zero] = 1 / x[~near_zero]
+ return x
+
+ # the inverse of 1/x is itself
+ secax = ax.secondary_xaxis('top', functions=(invert, invert))
+ secax.set_xlabel('Period [s]')
+ plt.show()
+
+ To add a secondary axis relative to your data, you can pass a transform
+ to the new axis.
+
+ .. plot::
+
+ fig, ax = plt.subplots()
+ ax.plot(range(0, 5), range(-1, 4))
+
+ # Pass 'ax.transData' as a transform to place the axis
+ # relative to your data at y=0
+ secax = ax.secondary_xaxis(0, transform=ax.transData)
+ """
+ if not (location in ['top', 'bottom'] or isinstance(location, Real)):
+ raise ValueError('secondary_xaxis location must be either '
+ 'a float or "top"/"bottom"')
+
+ secondary_ax = SecondaryAxis(self, 'x', location, functions,
+ transform, **kwargs)
+ self.add_child_axes(secondary_ax)
+ return secondary_ax
+
+ @_docstring.interpd
+ def secondary_yaxis(self, location, functions=None, *, transform=None, **kwargs):
+ """
+ Add a second y-axis to this `~.axes.Axes`.
+
+ For example if we want to have a second scale for the data plotted on
+ the yaxis.
+
+ %(_secax_docstring)s
+
+ Examples
+ --------
+ Add a secondary Axes that converts from radians to degrees
+
+ .. plot::
+
+ fig, ax = plt.subplots()
+ ax.plot(range(1, 360, 5), range(1, 360, 5))
+ ax.set_ylabel('degrees')
+ secax = ax.secondary_yaxis('right', functions=(np.deg2rad,
+ np.rad2deg))
+ secax.set_ylabel('radians')
+
+ To add a secondary axis relative to your data, you can pass a transform
+ to the new axis.
+
+ .. plot::
+
+ fig, ax = plt.subplots()
+ ax.plot(range(0, 5), range(-1, 4))
+
+ # Pass 'ax.transData' as a transform to place the axis
+ # relative to your data at x=3
+ secax = ax.secondary_yaxis(3, transform=ax.transData)
+ """
+ if not (location in ['left', 'right'] or isinstance(location, Real)):
+ raise ValueError('secondary_yaxis location must be either '
+ 'a float or "left"/"right"')
+
+ secondary_ax = SecondaryAxis(self, 'y', location, functions,
+ transform, **kwargs)
+ self.add_child_axes(secondary_ax)
+ return secondary_ax
+
+ @_docstring.interpd
+ def text(self, x, y, s, fontdict=None, **kwargs):
+ """
+ Add text to the Axes.
+
+ Add the text *s* to the Axes at location *x*, *y* in data coordinates,
+ with a default ``horizontalalignment`` on the ``left`` and
+ ``verticalalignment`` at the ``baseline``. See
+ :doc:`/gallery/text_labels_and_annotations/text_alignment`.
+
+ Parameters
+ ----------
+ x, y : float
+ The position to place the text. By default, this is in data
+ coordinates. The coordinate system can be changed using the
+ *transform* parameter.
+
+ s : str
+ The text.
+
+ fontdict : dict, default: None
+
+ .. admonition:: Discouraged
+
+ The use of *fontdict* is discouraged. Parameters should be passed as
+ individual keyword arguments or using dictionary-unpacking
+ ``text(..., **fontdict)``.
+
+ A dictionary to override the default text properties. If fontdict
+ is None, the defaults are determined by `.rcParams`.
+
+ Returns
+ -------
+ `.Text`
+ The created `.Text` instance.
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.text.Text` properties.
+ Other miscellaneous text parameters.
+
+ %(Text:kwdoc)s
+
+ Examples
+ --------
+ Individual keyword arguments can be used to override any given
+ parameter::
+
+ >>> text(x, y, s, fontsize=12)
+
+ The default transform specifies that text is in data coords,
+ alternatively, you can specify text in axis coords ((0, 0) is
+ lower-left and (1, 1) is upper-right). The example below places
+ text in the center of the Axes::
+
+ >>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
+ ... verticalalignment='center', transform=ax.transAxes)
+
+ You can put a rectangular box around the text instance (e.g., to
+ set a background color) by using the keyword *bbox*. *bbox* is
+ a dictionary of `~matplotlib.patches.Rectangle`
+ properties. For example::
+
+ >>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
+ """
+ effective_kwargs = {
+ 'verticalalignment': 'baseline',
+ 'horizontalalignment': 'left',
+ 'transform': self.transData,
+ 'clip_on': False,
+ **(fontdict if fontdict is not None else {}),
+ **kwargs,
+ }
+ t = mtext.Text(x, y, text=s, **effective_kwargs)
+ if t.get_clip_path() is None:
+ t.set_clip_path(self.patch)
+ self._add_text(t)
+ return t
+
+ @_docstring.interpd
+ def annotate(self, text, xy, xytext=None, xycoords='data', textcoords=None,
+ arrowprops=None, annotation_clip=None, **kwargs):
+ # Signature must match Annotation. This is verified in
+ # test_annotate_signature().
+ a = mtext.Annotation(text, xy, xytext=xytext, xycoords=xycoords,
+ textcoords=textcoords, arrowprops=arrowprops,
+ annotation_clip=annotation_clip, **kwargs)
+ a.set_transform(mtransforms.IdentityTransform())
+ if kwargs.get('clip_on', False) and a.get_clip_path() is None:
+ a.set_clip_path(self.patch)
+ self._add_text(a)
+ return a
+ annotate.__doc__ = mtext.Annotation.__init__.__doc__
+ #### Lines and spans
+
+ @_docstring.interpd
+ def axhline(self, y=0, xmin=0, xmax=1, **kwargs):
+ """
+ Add a horizontal line spanning the whole or fraction of the Axes.
+
+ Note: If you want to set x-limits in data coordinates, use
+ `~.Axes.hlines` instead.
+
+ Parameters
+ ----------
+ y : float, default: 0
+ y position in :ref:`data coordinates `.
+
+ xmin : float, default: 0
+ The start x-position in :ref:`axes coordinates `.
+ Should be between 0 and 1, 0 being the far left of the plot,
+ 1 the far right of the plot.
+
+ xmax : float, default: 1
+ The end x-position in :ref:`axes coordinates `.
+ Should be between 0 and 1, 0 being the far left of the plot,
+ 1 the far right of the plot.
+
+ Returns
+ -------
+ `~matplotlib.lines.Line2D`
+ A `.Line2D` specified via two points ``(xmin, y)``, ``(xmax, y)``.
+ Its transform is set such that *x* is in
+ :ref:`axes coordinates ` and *y* is in
+ :ref:`data coordinates `.
+
+ This is still a generic line and the horizontal character is only
+ realized through using identical *y* values for both points. Thus,
+ if you want to change the *y* value later, you have to provide two
+ values ``line.set_ydata([3, 3])``.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Valid keyword arguments are `.Line2D` properties, except for
+ 'transform':
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ hlines : Add horizontal lines in data coordinates.
+ axhspan : Add a horizontal span (rectangle) across the axis.
+ axline : Add a line with an arbitrary slope.
+
+ Examples
+ --------
+ * draw a thick red hline at 'y' = 0 that spans the xrange::
+
+ >>> axhline(linewidth=4, color='r')
+
+ * draw a default hline at 'y' = 1 that spans the xrange::
+
+ >>> axhline(y=1)
+
+ * draw a default hline at 'y' = .5 that spans the middle half of
+ the xrange::
+
+ >>> axhline(y=.5, xmin=0.25, xmax=0.75)
+ """
+ self._check_no_units([xmin, xmax], ['xmin', 'xmax'])
+ if "transform" in kwargs:
+ raise ValueError("'transform' is not allowed as a keyword "
+ "argument; axhline generates its own transform.")
+ ymin, ymax = self.get_ybound()
+
+ # Strip away the units for comparison with non-unitized bounds.
+ yy, = self._process_unit_info([("y", y)], kwargs)
+ scaley = (yy < ymin) or (yy > ymax)
+
+ trans = self.get_yaxis_transform(which='grid')
+ l = mlines.Line2D([xmin, xmax], [y, y], transform=trans, **kwargs)
+ self.add_line(l)
+ l.get_path()._interpolation_steps = mpl.axis.GRIDLINE_INTERPOLATION_STEPS
+ if scaley:
+ self._request_autoscale_view("y")
+ return l
+
+ @_docstring.interpd
+ def axvline(self, x=0, ymin=0, ymax=1, **kwargs):
+ """
+ Add a vertical line spanning the whole or fraction of the Axes.
+
+ Note: If you want to set y-limits in data coordinates, use
+ `~.Axes.vlines` instead.
+
+ Parameters
+ ----------
+ x : float, default: 0
+ x position in :ref:`data coordinates `.
+
+ ymin : float, default: 0
+ The start y-position in :ref:`axes coordinates `.
+ Should be between 0 and 1, 0 being the bottom of the plot, 1 the
+ top of the plot.
+
+ ymax : float, default: 1
+ The end y-position in :ref:`axes coordinates `.
+ Should be between 0 and 1, 0 being the bottom of the plot, 1 the
+ top of the plot.
+
+ Returns
+ -------
+ `~matplotlib.lines.Line2D`
+ A `.Line2D` specified via two points ``(x, ymin)``, ``(x, ymax)``.
+ Its transform is set such that *x* is in
+ :ref:`data coordinates ` and *y* is in
+ :ref:`axes coordinates `.
+
+ This is still a generic line and the vertical character is only
+ realized through using identical *x* values for both points. Thus,
+ if you want to change the *x* value later, you have to provide two
+ values ``line.set_xdata([3, 3])``.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Valid keyword arguments are `.Line2D` properties, except for
+ 'transform':
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ vlines : Add vertical lines in data coordinates.
+ axvspan : Add a vertical span (rectangle) across the axis.
+ axline : Add a line with an arbitrary slope.
+
+ Examples
+ --------
+ * draw a thick red vline at *x* = 0 that spans the yrange::
+
+ >>> axvline(linewidth=4, color='r')
+
+ * draw a default vline at *x* = 1 that spans the yrange::
+
+ >>> axvline(x=1)
+
+ * draw a default vline at *x* = .5 that spans the middle half of
+ the yrange::
+
+ >>> axvline(x=.5, ymin=0.25, ymax=0.75)
+ """
+ self._check_no_units([ymin, ymax], ['ymin', 'ymax'])
+ if "transform" in kwargs:
+ raise ValueError("'transform' is not allowed as a keyword "
+ "argument; axvline generates its own transform.")
+ xmin, xmax = self.get_xbound()
+
+ # Strip away the units for comparison with non-unitized bounds.
+ xx, = self._process_unit_info([("x", x)], kwargs)
+ scalex = (xx < xmin) or (xx > xmax)
+
+ trans = self.get_xaxis_transform(which='grid')
+ l = mlines.Line2D([x, x], [ymin, ymax], transform=trans, **kwargs)
+ self.add_line(l)
+ l.get_path()._interpolation_steps = mpl.axis.GRIDLINE_INTERPOLATION_STEPS
+ if scalex:
+ self._request_autoscale_view("x")
+ return l
+
+ @staticmethod
+ def _check_no_units(vals, names):
+ # Helper method to check that vals are not unitized
+ for val, name in zip(vals, names):
+ if not munits._is_natively_supported(val):
+ raise ValueError(f"{name} must be a single scalar value, "
+ f"but got {val}")
+
+ @_docstring.interpd
+ def axline(self, xy1, xy2=None, *, slope=None, **kwargs):
+ """
+ Add an infinitely long straight line.
+
+ The line can be defined either by two points *xy1* and *xy2*, or
+ by one point *xy1* and a *slope*.
+
+ This draws a straight line "on the screen", regardless of the x and y
+ scales, and is thus also suitable for drawing exponential decays in
+ semilog plots, power laws in loglog plots, etc. However, *slope*
+ should only be used with linear scales; It has no clear meaning for
+ all other scales, and thus the behavior is undefined. Please specify
+ the line using the points *xy1*, *xy2* for non-linear scales.
+
+ The *transform* keyword argument only applies to the points *xy1*,
+ *xy2*. The *slope* (if given) is always in data coordinates. This can
+ be used e.g. with ``ax.transAxes`` for drawing grid lines with a fixed
+ slope.
+
+ Parameters
+ ----------
+ xy1, xy2 : (float, float)
+ Points for the line to pass through.
+ Either *xy2* or *slope* has to be given.
+ slope : float, optional
+ The slope of the line. Either *xy2* or *slope* has to be given.
+
+ Returns
+ -------
+ `.AxLine`
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Valid kwargs are `.Line2D` properties
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ axhline : for horizontal lines
+ axvline : for vertical lines
+
+ Examples
+ --------
+ Draw a thick red line passing through (0, 0) and (1, 1)::
+
+ >>> axline((0, 0), (1, 1), linewidth=4, color='r')
+ """
+ if slope is not None and (self.get_xscale() != 'linear' or
+ self.get_yscale() != 'linear'):
+ raise TypeError("'slope' cannot be used with non-linear scales")
+
+ datalim = [xy1] if xy2 is None else [xy1, xy2]
+ if "transform" in kwargs:
+ # if a transform is passed (i.e. line points not in data space),
+ # data limits should not be adjusted.
+ datalim = []
+
+ line = mlines.AxLine(xy1, xy2, slope, **kwargs)
+ # Like add_line, but correctly handling data limits.
+ self._set_artist_props(line)
+ if line.get_clip_path() is None:
+ line.set_clip_path(self.patch)
+ if not line.get_label():
+ line.set_label(f"_child{len(self._children)}")
+ self._children.append(line)
+ line._remove_method = self._children.remove
+ self.update_datalim(datalim)
+
+ self._request_autoscale_view()
+ return line
+
+ @_docstring.interpd
+ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
+ """
+ Add a horizontal span (rectangle) across the Axes.
+
+ The rectangle spans from *ymin* to *ymax* vertically, and, by default,
+ the whole x-axis horizontally. The x-span can be set using *xmin*
+ (default: 0) and *xmax* (default: 1) which are in axis units; e.g.
+ ``xmin = 0.5`` always refers to the middle of the x-axis regardless of
+ the limits set by `~.Axes.set_xlim`.
+
+ Parameters
+ ----------
+ ymin : float
+ Lower y-coordinate of the span, in data units.
+ ymax : float
+ Upper y-coordinate of the span, in data units.
+ xmin : float, default: 0
+ Lower x-coordinate of the span, in x-axis (0-1) units.
+ xmax : float, default: 1
+ Upper x-coordinate of the span, in x-axis (0-1) units.
+
+ Returns
+ -------
+ `~matplotlib.patches.Rectangle`
+ Horizontal span (rectangle) from (xmin, ymin) to (xmax, ymax).
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.patches.Rectangle` properties
+
+ %(Rectangle:kwdoc)s
+
+ See Also
+ --------
+ axvspan : Add a vertical span across the Axes.
+ """
+ # Strip units away.
+ self._check_no_units([xmin, xmax], ['xmin', 'xmax'])
+ (ymin, ymax), = self._process_unit_info([("y", [ymin, ymax])], kwargs)
+
+ p = mpatches.Rectangle((xmin, ymin), xmax - xmin, ymax - ymin, **kwargs)
+ p.set_transform(self.get_yaxis_transform(which="grid"))
+ # For Rectangles and non-separable transforms, add_patch can be buggy
+ # and update the x limits even though it shouldn't do so for an
+ # yaxis_transformed patch, so undo that update.
+ ix = self.dataLim.intervalx.copy()
+ mx = self.dataLim.minposx
+ self.add_patch(p)
+ self.dataLim.intervalx = ix
+ self.dataLim.minposx = mx
+ p.get_path()._interpolation_steps = mpl.axis.GRIDLINE_INTERPOLATION_STEPS
+ self._request_autoscale_view("y")
+ return p
+
+ @_docstring.interpd
+ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
+ """
+ Add a vertical span (rectangle) across the Axes.
+
+ The rectangle spans from *xmin* to *xmax* horizontally, and, by
+ default, the whole y-axis vertically. The y-span can be set using
+ *ymin* (default: 0) and *ymax* (default: 1) which are in axis units;
+ e.g. ``ymin = 0.5`` always refers to the middle of the y-axis
+ regardless of the limits set by `~.Axes.set_ylim`.
+
+ Parameters
+ ----------
+ xmin : float
+ Lower x-coordinate of the span, in data units.
+ xmax : float
+ Upper x-coordinate of the span, in data units.
+ ymin : float, default: 0
+ Lower y-coordinate of the span, in y-axis units (0-1).
+ ymax : float, default: 1
+ Upper y-coordinate of the span, in y-axis units (0-1).
+
+ Returns
+ -------
+ `~matplotlib.patches.Rectangle`
+ Vertical span (rectangle) from (xmin, ymin) to (xmax, ymax).
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.patches.Rectangle` properties
+
+ %(Rectangle:kwdoc)s
+
+ See Also
+ --------
+ axhspan : Add a horizontal span across the Axes.
+
+ Examples
+ --------
+ Draw a vertical, green, translucent rectangle from x = 1.25 to
+ x = 1.55 that spans the yrange of the Axes.
+
+ >>> axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
+
+ """
+ # Strip units away.
+ self._check_no_units([ymin, ymax], ['ymin', 'ymax'])
+ (xmin, xmax), = self._process_unit_info([("x", [xmin, xmax])], kwargs)
+
+ p = mpatches.Rectangle((xmin, ymin), xmax - xmin, ymax - ymin, **kwargs)
+ p.set_transform(self.get_xaxis_transform(which="grid"))
+ # For Rectangles and non-separable transforms, add_patch can be buggy
+ # and update the y limits even though it shouldn't do so for an
+ # xaxis_transformed patch, so undo that update.
+ iy = self.dataLim.intervaly.copy()
+ my = self.dataLim.minposy
+ self.add_patch(p)
+ self.dataLim.intervaly = iy
+ self.dataLim.minposy = my
+ p.get_path()._interpolation_steps = mpl.axis.GRIDLINE_INTERPOLATION_STEPS
+ self._request_autoscale_view("x")
+ return p
+
+ @_api.make_keyword_only("3.10", "label")
+ @_preprocess_data(replace_names=["y", "xmin", "xmax", "colors"],
+ label_namer="y")
+ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
+ label='', **kwargs):
+ """
+ Plot horizontal lines at each *y* from *xmin* to *xmax*.
+
+ Parameters
+ ----------
+ y : float or array-like
+ y-indexes where to plot the lines.
+
+ xmin, xmax : float or array-like
+ Respective beginning and end of each line. If scalars are
+ provided, all lines will have the same length.
+
+ colors : :mpltype:`color` or list of color , default: :rc:`lines.color`
+
+ linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
+
+ label : str, default: ''
+
+ Returns
+ -------
+ `~matplotlib.collections.LineCollection`
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+ **kwargs : `~matplotlib.collections.LineCollection` properties.
+
+ See Also
+ --------
+ vlines : vertical lines
+ axhline : horizontal line across the Axes
+ """
+
+ # We do the conversion first since not all unitized data is uniform
+ xmin, xmax, y = self._process_unit_info(
+ [("x", xmin), ("x", xmax), ("y", y)], kwargs)
+
+ if not np.iterable(y):
+ y = [y]
+ if not np.iterable(xmin):
+ xmin = [xmin]
+ if not np.iterable(xmax):
+ xmax = [xmax]
+
+ # Create and combine masked_arrays from input
+ y, xmin, xmax = cbook._combine_masks(y, xmin, xmax)
+ y = np.ravel(y)
+ xmin = np.ravel(xmin)
+ xmax = np.ravel(xmax)
+
+ masked_verts = np.ma.empty((len(y), 2, 2))
+ masked_verts[:, 0, 0] = xmin
+ masked_verts[:, 0, 1] = y
+ masked_verts[:, 1, 0] = xmax
+ masked_verts[:, 1, 1] = y
+
+ lines = mcoll.LineCollection(masked_verts, colors=colors,
+ linestyles=linestyles, label=label)
+ self.add_collection(lines, autolim=False)
+ lines._internal_update(kwargs)
+
+ if len(y) > 0:
+ # Extreme values of xmin/xmax/y. Using masked_verts here handles
+ # the case of y being a masked *object* array (as can be generated
+ # e.g. by errorbar()), which would make nanmin/nanmax stumble.
+ updatex = True
+ updatey = True
+ if self.name == "rectilinear":
+ datalim = lines.get_datalim(self.transData)
+ t = lines.get_transform()
+ updatex, updatey = t.contains_branch_seperately(self.transData)
+ minx = np.nanmin(datalim.xmin)
+ maxx = np.nanmax(datalim.xmax)
+ miny = np.nanmin(datalim.ymin)
+ maxy = np.nanmax(datalim.ymax)
+ else:
+ minx = np.nanmin(masked_verts[..., 0])
+ maxx = np.nanmax(masked_verts[..., 0])
+ miny = np.nanmin(masked_verts[..., 1])
+ maxy = np.nanmax(masked_verts[..., 1])
+
+ corners = (minx, miny), (maxx, maxy)
+ self.update_datalim(corners, updatex, updatey)
+ self._request_autoscale_view()
+ return lines
+
+ @_api.make_keyword_only("3.10", "label")
+ @_preprocess_data(replace_names=["x", "ymin", "ymax", "colors"],
+ label_namer="x")
+ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
+ label='', **kwargs):
+ """
+ Plot vertical lines at each *x* from *ymin* to *ymax*.
+
+ Parameters
+ ----------
+ x : float or array-like
+ x-indexes where to plot the lines.
+
+ ymin, ymax : float or array-like
+ Respective beginning and end of each line. If scalars are
+ provided, all lines will have the same length.
+
+ colors : :mpltype:`color` or list of color, default: :rc:`lines.color`
+
+ linestyles : {'solid', 'dashed', 'dashdot', 'dotted'}, default: 'solid'
+
+ label : str, default: ''
+
+ Returns
+ -------
+ `~matplotlib.collections.LineCollection`
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+ **kwargs : `~matplotlib.collections.LineCollection` properties.
+
+ See Also
+ --------
+ hlines : horizontal lines
+ axvline : vertical line across the Axes
+ """
+
+ # We do the conversion first since not all unitized data is uniform
+ x, ymin, ymax = self._process_unit_info(
+ [("x", x), ("y", ymin), ("y", ymax)], kwargs)
+
+ if not np.iterable(x):
+ x = [x]
+ if not np.iterable(ymin):
+ ymin = [ymin]
+ if not np.iterable(ymax):
+ ymax = [ymax]
+
+ # Create and combine masked_arrays from input
+ x, ymin, ymax = cbook._combine_masks(x, ymin, ymax)
+ x = np.ravel(x)
+ ymin = np.ravel(ymin)
+ ymax = np.ravel(ymax)
+
+ masked_verts = np.ma.empty((len(x), 2, 2))
+ masked_verts[:, 0, 0] = x
+ masked_verts[:, 0, 1] = ymin
+ masked_verts[:, 1, 0] = x
+ masked_verts[:, 1, 1] = ymax
+
+ lines = mcoll.LineCollection(masked_verts, colors=colors,
+ linestyles=linestyles, label=label)
+ self.add_collection(lines, autolim=False)
+ lines._internal_update(kwargs)
+
+ if len(x) > 0:
+ # Extreme values of x/ymin/ymax. Using masked_verts here handles
+ # the case of x being a masked *object* array (as can be generated
+ # e.g. by errorbar()), which would make nanmin/nanmax stumble.
+ updatex = True
+ updatey = True
+ if self.name == "rectilinear":
+ datalim = lines.get_datalim(self.transData)
+ t = lines.get_transform()
+ updatex, updatey = t.contains_branch_seperately(self.transData)
+ minx = np.nanmin(datalim.xmin)
+ maxx = np.nanmax(datalim.xmax)
+ miny = np.nanmin(datalim.ymin)
+ maxy = np.nanmax(datalim.ymax)
+ else:
+ minx = np.nanmin(masked_verts[..., 0])
+ maxx = np.nanmax(masked_verts[..., 0])
+ miny = np.nanmin(masked_verts[..., 1])
+ maxy = np.nanmax(masked_verts[..., 1])
+
+ corners = (minx, miny), (maxx, maxy)
+ self.update_datalim(corners, updatex, updatey)
+ self._request_autoscale_view()
+ return lines
+
+ @_api.make_keyword_only("3.10", "orientation")
+ @_preprocess_data(replace_names=["positions", "lineoffsets",
+ "linelengths", "linewidths",
+ "colors", "linestyles"])
+ @_docstring.interpd
+ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
+ linelengths=1, linewidths=None, colors=None, alpha=None,
+ linestyles='solid', **kwargs):
+ """
+ Plot identical parallel lines at the given positions.
+
+ This type of plot is commonly used in neuroscience for representing
+ neural events, where it is usually called a spike raster, dot raster,
+ or raster plot.
+
+ However, it is useful in any situation where you wish to show the
+ timing or position of multiple sets of discrete events, such as the
+ arrival times of people to a business on each day of the month or the
+ date of hurricanes each year of the last century.
+
+ Parameters
+ ----------
+ positions : array-like or list of array-like
+ A 1D array-like defines the positions of one sequence of events.
+
+ Multiple groups of events may be passed as a list of array-likes.
+ Each group can be styled independently by passing lists of values
+ to *lineoffsets*, *linelengths*, *linewidths*, *colors* and
+ *linestyles*.
+
+ Note that *positions* can be a 2D array, but in practice different
+ event groups usually have different counts so that one will use a
+ list of different-length arrays rather than a 2D array.
+
+ orientation : {'horizontal', 'vertical'}, default: 'horizontal'
+ The direction of the event sequence:
+
+ - 'horizontal': the events are arranged horizontally.
+ The indicator lines are vertical.
+ - 'vertical': the events are arranged vertically.
+ The indicator lines are horizontal.
+
+ lineoffsets : float or array-like, default: 1
+ The offset of the center of the lines from the origin, in the
+ direction orthogonal to *orientation*.
+
+ If *positions* is 2D, this can be a sequence with length matching
+ the length of *positions*.
+
+ linelengths : float or array-like, default: 1
+ The total height of the lines (i.e. the lines stretches from
+ ``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
+
+ If *positions* is 2D, this can be a sequence with length matching
+ the length of *positions*.
+
+ linewidths : float or array-like, default: :rc:`lines.linewidth`
+ The line width(s) of the event lines, in points.
+
+ If *positions* is 2D, this can be a sequence with length matching
+ the length of *positions*.
+
+ colors : :mpltype:`color` or list of color, default: :rc:`lines.color`
+ The color(s) of the event lines.
+
+ If *positions* is 2D, this can be a sequence with length matching
+ the length of *positions*.
+
+ alpha : float or array-like, default: 1
+ The alpha blending value(s), between 0 (transparent) and 1
+ (opaque).
+
+ If *positions* is 2D, this can be a sequence with length matching
+ the length of *positions*.
+
+ linestyles : str or tuple or list of such values, default: 'solid'
+ Default is 'solid'. Valid strings are ['solid', 'dashed',
+ 'dashdot', 'dotted', '-', '--', '-.', ':']. Dash tuples
+ should be of the form::
+
+ (offset, onoffseq),
+
+ where *onoffseq* is an even length tuple of on and off ink
+ in points.
+
+ If *positions* is 2D, this can be a sequence with length matching
+ the length of *positions*.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Other keyword arguments are line collection properties. See
+ `.LineCollection` for a list of the valid properties.
+
+ Returns
+ -------
+ list of `.EventCollection`
+ The `.EventCollection` that were added.
+
+ Notes
+ -----
+ For *linelengths*, *linewidths*, *colors*, *alpha* and *linestyles*, if
+ only a single value is given, that value is applied to all lines. If an
+ array-like is given, it must have the same length as *positions*, and
+ each value will be applied to the corresponding row of the array.
+
+ Examples
+ --------
+ .. plot:: gallery/lines_bars_and_markers/eventplot_demo.py
+ """
+
+ lineoffsets, linelengths = self._process_unit_info(
+ [("y", lineoffsets), ("y", linelengths)], kwargs)
+
+ # fix positions, noting that it can be a list of lists:
+ if not np.iterable(positions):
+ positions = [positions]
+ elif any(np.iterable(position) for position in positions):
+ positions = [np.asanyarray(position) for position in positions]
+ else:
+ positions = [np.asanyarray(positions)]
+
+ poss = []
+ for position in positions:
+ poss += self._process_unit_info([("x", position)], kwargs)
+ positions = poss
+
+ # prevent 'singular' keys from **kwargs dict from overriding the effect
+ # of 'plural' keyword arguments (e.g. 'color' overriding 'colors')
+ colors = cbook._local_over_kwdict(colors, kwargs, 'color')
+ linewidths = cbook._local_over_kwdict(linewidths, kwargs, 'linewidth')
+ linestyles = cbook._local_over_kwdict(linestyles, kwargs, 'linestyle')
+
+ if not np.iterable(lineoffsets):
+ lineoffsets = [lineoffsets]
+ if not np.iterable(linelengths):
+ linelengths = [linelengths]
+ if not np.iterable(linewidths):
+ linewidths = [linewidths]
+ if not np.iterable(colors):
+ colors = [colors]
+ if not np.iterable(alpha):
+ alpha = [alpha]
+ if hasattr(linestyles, 'lower') or not np.iterable(linestyles):
+ linestyles = [linestyles]
+
+ lineoffsets = np.asarray(lineoffsets)
+ linelengths = np.asarray(linelengths)
+ linewidths = np.asarray(linewidths)
+
+ if len(lineoffsets) == 0:
+ raise ValueError('lineoffsets cannot be empty')
+ if len(linelengths) == 0:
+ raise ValueError('linelengths cannot be empty')
+ if len(linestyles) == 0:
+ raise ValueError('linestyles cannot be empty')
+ if len(linewidths) == 0:
+ raise ValueError('linewidths cannot be empty')
+ if len(alpha) == 0:
+ raise ValueError('alpha cannot be empty')
+ if len(colors) == 0:
+ colors = [None]
+ try:
+ # Early conversion of the colors into RGBA values to take care
+ # of cases like colors='0.5' or colors='C1'. (Issue #8193)
+ colors = mcolors.to_rgba_array(colors)
+ except ValueError:
+ # Will fail if any element of *colors* is None. But as long
+ # as len(colors) == 1 or len(positions), the rest of the
+ # code should process *colors* properly.
+ pass
+
+ if len(lineoffsets) == 1 and len(positions) != 1:
+ lineoffsets = np.tile(lineoffsets, len(positions))
+ lineoffsets[0] = 0
+ lineoffsets = np.cumsum(lineoffsets)
+ if len(linelengths) == 1:
+ linelengths = np.tile(linelengths, len(positions))
+ if len(linewidths) == 1:
+ linewidths = np.tile(linewidths, len(positions))
+ if len(colors) == 1:
+ colors = list(colors) * len(positions)
+ if len(alpha) == 1:
+ alpha = list(alpha) * len(positions)
+ if len(linestyles) == 1:
+ linestyles = [linestyles] * len(positions)
+
+ if len(lineoffsets) != len(positions):
+ raise ValueError('lineoffsets and positions are unequal sized '
+ 'sequences')
+ if len(linelengths) != len(positions):
+ raise ValueError('linelengths and positions are unequal sized '
+ 'sequences')
+ if len(linewidths) != len(positions):
+ raise ValueError('linewidths and positions are unequal sized '
+ 'sequences')
+ if len(colors) != len(positions):
+ raise ValueError('colors and positions are unequal sized '
+ 'sequences')
+ if len(alpha) != len(positions):
+ raise ValueError('alpha and positions are unequal sized '
+ 'sequences')
+ if len(linestyles) != len(positions):
+ raise ValueError('linestyles and positions are unequal sized '
+ 'sequences')
+
+ colls = []
+ for position, lineoffset, linelength, linewidth, color, alpha_, \
+ linestyle in \
+ zip(positions, lineoffsets, linelengths, linewidths,
+ colors, alpha, linestyles):
+ coll = mcoll.EventCollection(position,
+ orientation=orientation,
+ lineoffset=lineoffset,
+ linelength=linelength,
+ linewidth=linewidth,
+ color=color,
+ alpha=alpha_,
+ linestyle=linestyle)
+ self.add_collection(coll, autolim=False)
+ coll._internal_update(kwargs)
+ colls.append(coll)
+
+ if len(positions) > 0:
+ # try to get min/max
+ min_max = [(np.min(_p), np.max(_p)) for _p in positions
+ if len(_p) > 0]
+ # if we have any non-empty positions, try to autoscale
+ if len(min_max) > 0:
+ mins, maxes = zip(*min_max)
+ minpos = np.min(mins)
+ maxpos = np.max(maxes)
+
+ minline = (lineoffsets - linelengths).min()
+ maxline = (lineoffsets + linelengths).max()
+
+ if orientation == "vertical":
+ corners = (minline, minpos), (maxline, maxpos)
+ else: # "horizontal"
+ corners = (minpos, minline), (maxpos, maxline)
+ self.update_datalim(corners)
+ self._request_autoscale_view()
+
+ return colls
+
+ #### Basic plotting
+
+ # Uses a custom implementation of data-kwarg handling in
+ # _process_plot_var_args.
+ @_docstring.interpd
+ def plot(self, *args, scalex=True, scaley=True, data=None, **kwargs):
+ """
+ Plot y versus x as lines and/or markers.
+
+ Call signatures::
+
+ plot([x], y, [fmt], *, data=None, **kwargs)
+ plot([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
+
+ The coordinates of the points or line nodes are given by *x*, *y*.
+
+ The optional parameter *fmt* is a convenient way for defining basic
+ formatting like color, marker and linestyle. It's a shortcut string
+ notation described in the *Notes* section below.
+
+ >>> plot(x, y) # plot x and y using default line style and color
+ >>> plot(x, y, 'bo') # plot x and y using blue circle markers
+ >>> plot(y) # plot y using x as index array 0..N-1
+ >>> plot(y, 'r+') # ditto, but with red plusses
+
+ You can use `.Line2D` properties as keyword arguments for more
+ control on the appearance. Line properties and *fmt* can be mixed.
+ The following two calls yield identical results:
+
+ >>> plot(x, y, 'go--', linewidth=2, markersize=12)
+ >>> plot(x, y, color='green', marker='o', linestyle='dashed',
+ ... linewidth=2, markersize=12)
+
+ When conflicting with *fmt*, keyword arguments take precedence.
+
+
+ **Plotting labelled data**
+
+ There's a convenient way for plotting objects with labelled data (i.e.
+ data that can be accessed by index ``obj['y']``). Instead of giving
+ the data in *x* and *y*, you can provide the object in the *data*
+ parameter and just give the labels for *x* and *y*::
+
+ >>> plot('xlabel', 'ylabel', data=obj)
+
+ All indexable objects are supported. This could e.g. be a `dict`, a
+ `pandas.DataFrame` or a structured numpy array.
+
+
+ **Plotting multiple sets of data**
+
+ There are various ways to plot multiple sets of data.
+
+ - The most straight forward way is just to call `plot` multiple times.
+ Example:
+
+ >>> plot(x1, y1, 'bo')
+ >>> plot(x2, y2, 'go')
+
+ - If *x* and/or *y* are 2D arrays, a separate data set will be drawn
+ for every column. If both *x* and *y* are 2D, they must have the
+ same shape. If only one of them is 2D with shape (N, m) the other
+ must have length N and will be used for every data set m.
+
+ Example:
+
+ >>> x = [1, 2, 3]
+ >>> y = np.array([[1, 2], [3, 4], [5, 6]])
+ >>> plot(x, y)
+
+ is equivalent to:
+
+ >>> for col in range(y.shape[1]):
+ ... plot(x, y[:, col])
+
+ - The third way is to specify multiple sets of *[x]*, *y*, *[fmt]*
+ groups::
+
+ >>> plot(x1, y1, 'g^', x2, y2, 'g-')
+
+ In this case, any additional keyword argument applies to all
+ datasets. Also, this syntax cannot be combined with the *data*
+ parameter.
+
+ By default, each line is assigned a different style specified by a
+ 'style cycle'. The *fmt* and line property parameters are only
+ necessary if you want explicit deviations from these defaults.
+ Alternatively, you can also change the style cycle using
+ :rc:`axes.prop_cycle`.
+
+
+ Parameters
+ ----------
+ x, y : array-like or float
+ The horizontal / vertical coordinates of the data points.
+ *x* values are optional and default to ``range(len(y))``.
+
+ Commonly, these parameters are 1D arrays.
+
+ They can also be scalars, or two-dimensional (in that case, the
+ columns represent separate data sets).
+
+ These arguments cannot be passed as keywords.
+
+ fmt : str, optional
+ A format string, e.g. 'ro' for red circles. See the *Notes*
+ section for a full description of the format strings.
+
+ Format strings are just an abbreviation for quickly setting
+ basic line properties. All of these and more can also be
+ controlled by keyword arguments.
+
+ This argument cannot be passed as keyword.
+
+ data : indexable object, optional
+ An object with labelled data. If given, provide the label names to
+ plot in *x* and *y*.
+
+ .. note::
+ Technically there's a slight ambiguity in calls where the
+ second label is a valid *fmt*. ``plot('n', 'o', data=obj)``
+ could be ``plt(x, y)`` or ``plt(y, fmt)``. In such cases,
+ the former interpretation is chosen, but a warning is issued.
+ You may suppress the warning by adding an empty format string
+ ``plot('n', 'o', '', data=obj)``.
+
+ Returns
+ -------
+ list of `.Line2D`
+ A list of lines representing the plotted data.
+
+ Other Parameters
+ ----------------
+ scalex, scaley : bool, default: True
+ These parameters determine if the view limits are adapted to the
+ data limits. The values are passed on to
+ `~.axes.Axes.autoscale_view`.
+
+ **kwargs : `~matplotlib.lines.Line2D` properties, optional
+ *kwargs* are used to specify properties like a line label (for
+ auto legends), linewidth, antialiasing, marker face color.
+ Example::
+
+ >>> plot([1, 2, 3], [1, 2, 3], 'go-', label='line 1', linewidth=2)
+ >>> plot([1, 2, 3], [1, 4, 9], 'rs', label='line 2')
+
+ If you specify multiple lines with one plot call, the kwargs apply
+ to all those lines. In case the label object is iterable, each
+ element is used as labels for each set of data.
+
+ Here is a list of available `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ scatter : XY scatter plot with markers of varying size and/or color (
+ sometimes also called bubble chart).
+
+ Notes
+ -----
+ **Format Strings**
+
+ A format string consists of a part for color, marker and line::
+
+ fmt = '[marker][line][color]'
+
+ Each of them is optional. If not provided, the value from the style
+ cycle is used. Exception: If ``line`` is given, but no ``marker``,
+ the data will be a line without markers.
+
+ Other combinations such as ``[color][marker][line]`` are also
+ supported, but note that their parsing may be ambiguous.
+
+ **Markers**
+
+ ============= ===============================
+ character description
+ ============= ===============================
+ ``'.'`` point marker
+ ``','`` pixel marker
+ ``'o'`` circle marker
+ ``'v'`` triangle_down marker
+ ``'^'`` triangle_up marker
+ ``'<'`` triangle_left marker
+ ``'>'`` triangle_right marker
+ ``'1'`` tri_down marker
+ ``'2'`` tri_up marker
+ ``'3'`` tri_left marker
+ ``'4'`` tri_right marker
+ ``'8'`` octagon marker
+ ``'s'`` square marker
+ ``'p'`` pentagon marker
+ ``'P'`` plus (filled) marker
+ ``'*'`` star marker
+ ``'h'`` hexagon1 marker
+ ``'H'`` hexagon2 marker
+ ``'+'`` plus marker
+ ``'x'`` x marker
+ ``'X'`` x (filled) marker
+ ``'D'`` diamond marker
+ ``'d'`` thin_diamond marker
+ ``'|'`` vline marker
+ ``'_'`` hline marker
+ ============= ===============================
+
+ **Line Styles**
+
+ ============= ===============================
+ character description
+ ============= ===============================
+ ``'-'`` solid line style
+ ``'--'`` dashed line style
+ ``'-.'`` dash-dot line style
+ ``':'`` dotted line style
+ ============= ===============================
+
+ Example format strings::
+
+ 'b' # blue markers with default shape
+ 'or' # red circles
+ '-g' # green solid line
+ '--' # dashed line with default color
+ '^k:' # black triangle_up markers connected by a dotted line
+
+ **Colors**
+
+ The supported color abbreviations are the single letter codes
+
+ ============= ===============================
+ character color
+ ============= ===============================
+ ``'b'`` blue
+ ``'g'`` green
+ ``'r'`` red
+ ``'c'`` cyan
+ ``'m'`` magenta
+ ``'y'`` yellow
+ ``'k'`` black
+ ``'w'`` white
+ ============= ===============================
+
+ and the ``'CN'`` colors that index into the default property cycle.
+
+ If the color is the only part of the format string, you can
+ additionally use any `matplotlib.colors` spec, e.g. full names
+ (``'green'``) or hex strings (``'#008000'``).
+ """
+ kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
+ lines = [*self._get_lines(self, *args, data=data, **kwargs)]
+ for line in lines:
+ self.add_line(line)
+ if scalex:
+ self._request_autoscale_view("x")
+ if scaley:
+ self._request_autoscale_view("y")
+ return lines
+
+ @_api.deprecated("3.9", alternative="plot")
+ @_preprocess_data(replace_names=["x", "y"], label_namer="y")
+ @_docstring.interpd
+ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
+ **kwargs):
+ """
+ Plot coercing the axis to treat floats as dates.
+
+ .. deprecated:: 3.9
+
+ This method exists for historic reasons and will be removed in version 3.11.
+
+ - ``datetime``-like data should directly be plotted using
+ `~.Axes.plot`.
+ - If you need to plot plain numeric data as :ref:`date-format` or
+ need to set a timezone, call ``ax.xaxis.axis_date`` /
+ ``ax.yaxis.axis_date`` before `~.Axes.plot`. See
+ `.Axis.axis_date`.
+
+ Similar to `.plot`, this plots *y* vs. *x* as lines or markers.
+ However, the axis labels are formatted as dates depending on *xdate*
+ and *ydate*. Note that `.plot` will work with `datetime` and
+ `numpy.datetime64` objects without resorting to this method.
+
+ Parameters
+ ----------
+ x, y : array-like
+ The coordinates of the data points. If *xdate* or *ydate* is
+ *True*, the respective values *x* or *y* are interpreted as
+ :ref:`Matplotlib dates `.
+
+ fmt : str, optional
+ The plot format string. For details, see the corresponding
+ parameter in `.plot`.
+
+ tz : timezone string or `datetime.tzinfo`, default: :rc:`timezone`
+ The time zone to use in labeling dates.
+
+ xdate : bool, default: True
+ If *True*, the *x*-axis will be interpreted as Matplotlib dates.
+
+ ydate : bool, default: False
+ If *True*, the *y*-axis will be interpreted as Matplotlib dates.
+
+ Returns
+ -------
+ list of `.Line2D`
+ Objects representing the plotted data.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+ **kwargs
+ Keyword arguments control the `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ matplotlib.dates : Helper functions on dates.
+ matplotlib.dates.date2num : Convert dates to num.
+ matplotlib.dates.num2date : Convert num to dates.
+ matplotlib.dates.drange : Create an equally spaced sequence of dates.
+
+ Notes
+ -----
+ If you are using custom date tickers and formatters, it may be
+ necessary to set the formatters/locators after the call to
+ `.plot_date`. `.plot_date` will set the default tick locator to
+ `.AutoDateLocator` (if the tick locator is not already set to a
+ `.DateLocator` instance) and the default tick formatter to
+ `.AutoDateFormatter` (if the tick formatter is not already set to a
+ `.DateFormatter` instance).
+ """
+ if xdate:
+ self.xaxis_date(tz)
+ if ydate:
+ self.yaxis_date(tz)
+ return self.plot(x, y, fmt, **kwargs)
+
+ # @_preprocess_data() # let 'plot' do the unpacking..
+ @_docstring.interpd
+ def loglog(self, *args, **kwargs):
+ """
+ Make a plot with log scaling on both the x- and y-axis.
+
+ Call signatures::
+
+ loglog([x], y, [fmt], data=None, **kwargs)
+ loglog([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
+
+ This is just a thin wrapper around `.plot` which additionally changes
+ both the x-axis and the y-axis to log scaling. All the concepts and
+ parameters of plot can be used here as well.
+
+ The additional parameters *base*, *subs* and *nonpositive* control the
+ x/y-axis properties. They are just forwarded to `.Axes.set_xscale` and
+ `.Axes.set_yscale`. To use different properties on the x-axis and the
+ y-axis, use e.g.
+ ``ax.set_xscale("log", base=10); ax.set_yscale("log", base=2)``.
+
+ Parameters
+ ----------
+ base : float, default: 10
+ Base of the logarithm.
+
+ subs : sequence, optional
+ The location of the minor ticks. If *None*, reasonable locations
+ are automatically chosen depending on the number of decades in the
+ plot. See `.Axes.set_xscale`/`.Axes.set_yscale` for details.
+
+ nonpositive : {'mask', 'clip'}, default: 'clip'
+ Non-positive values can be masked as invalid, or clipped to a very
+ small positive number.
+
+ **kwargs
+ All parameters supported by `.plot`.
+
+ Returns
+ -------
+ list of `.Line2D`
+ Objects representing the plotted data.
+ """
+ dx = {k: v for k, v in kwargs.items()
+ if k in ['base', 'subs', 'nonpositive',
+ 'basex', 'subsx', 'nonposx']}
+ self.set_xscale('log', **dx)
+ dy = {k: v for k, v in kwargs.items()
+ if k in ['base', 'subs', 'nonpositive',
+ 'basey', 'subsy', 'nonposy']}
+ self.set_yscale('log', **dy)
+ return self.plot(
+ *args, **{k: v for k, v in kwargs.items() if k not in {*dx, *dy}})
+
+ # @_preprocess_data() # let 'plot' do the unpacking..
+ @_docstring.interpd
+ def semilogx(self, *args, **kwargs):
+ """
+ Make a plot with log scaling on the x-axis.
+
+ Call signatures::
+
+ semilogx([x], y, [fmt], data=None, **kwargs)
+ semilogx([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
+
+ This is just a thin wrapper around `.plot` which additionally changes
+ the x-axis to log scaling. All the concepts and parameters of plot can
+ be used here as well.
+
+ The additional parameters *base*, *subs*, and *nonpositive* control the
+ x-axis properties. They are just forwarded to `.Axes.set_xscale`.
+
+ Parameters
+ ----------
+ base : float, default: 10
+ Base of the x logarithm.
+
+ subs : array-like, optional
+ The location of the minor xticks. If *None*, reasonable locations
+ are automatically chosen depending on the number of decades in the
+ plot. See `.Axes.set_xscale` for details.
+
+ nonpositive : {'mask', 'clip'}, default: 'clip'
+ Non-positive values in x can be masked as invalid, or clipped to a
+ very small positive number.
+
+ **kwargs
+ All parameters supported by `.plot`.
+
+ Returns
+ -------
+ list of `.Line2D`
+ Objects representing the plotted data.
+ """
+ d = {k: v for k, v in kwargs.items()
+ if k in ['base', 'subs', 'nonpositive',
+ 'basex', 'subsx', 'nonposx']}
+ self.set_xscale('log', **d)
+ return self.plot(
+ *args, **{k: v for k, v in kwargs.items() if k not in d})
+
+ # @_preprocess_data() # let 'plot' do the unpacking..
+ @_docstring.interpd
+ def semilogy(self, *args, **kwargs):
+ """
+ Make a plot with log scaling on the y-axis.
+
+ Call signatures::
+
+ semilogy([x], y, [fmt], data=None, **kwargs)
+ semilogy([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
+
+ This is just a thin wrapper around `.plot` which additionally changes
+ the y-axis to log scaling. All the concepts and parameters of plot can
+ be used here as well.
+
+ The additional parameters *base*, *subs*, and *nonpositive* control the
+ y-axis properties. They are just forwarded to `.Axes.set_yscale`.
+
+ Parameters
+ ----------
+ base : float, default: 10
+ Base of the y logarithm.
+
+ subs : array-like, optional
+ The location of the minor yticks. If *None*, reasonable locations
+ are automatically chosen depending on the number of decades in the
+ plot. See `.Axes.set_yscale` for details.
+
+ nonpositive : {'mask', 'clip'}, default: 'clip'
+ Non-positive values in y can be masked as invalid, or clipped to a
+ very small positive number.
+
+ **kwargs
+ All parameters supported by `.plot`.
+
+ Returns
+ -------
+ list of `.Line2D`
+ Objects representing the plotted data.
+ """
+ d = {k: v for k, v in kwargs.items()
+ if k in ['base', 'subs', 'nonpositive',
+ 'basey', 'subsy', 'nonposy']}
+ self.set_yscale('log', **d)
+ return self.plot(
+ *args, **{k: v for k, v in kwargs.items() if k not in d})
+
+ @_preprocess_data(replace_names=["x"], label_namer="x")
+ def acorr(self, x, **kwargs):
+ """
+ Plot the autocorrelation of *x*.
+
+ Parameters
+ ----------
+ x : array-like
+ Not run through Matplotlib's unit conversion, so this should
+ be a unit-less array.
+
+ detrend : callable, default: `.mlab.detrend_none` (no detrending)
+ A detrending function applied to *x*. It must have the
+ signature ::
+
+ detrend(x: np.ndarray) -> np.ndarray
+
+ normed : bool, default: True
+ If ``True``, input vectors are normalised to unit length.
+
+ usevlines : bool, default: True
+ Determines the plot style.
+
+ If ``True``, vertical lines are plotted from 0 to the acorr value
+ using `.Axes.vlines`. Additionally, a horizontal line is plotted
+ at y=0 using `.Axes.axhline`.
+
+ If ``False``, markers are plotted at the acorr values using
+ `.Axes.plot`.
+
+ maxlags : int, default: 10
+ Number of lags to show. If ``None``, will return all
+ ``2 * len(x) - 1`` lags.
+
+ Returns
+ -------
+ lags : array (length ``2*maxlags+1``)
+ The lag vector.
+ c : array (length ``2*maxlags+1``)
+ The auto correlation vector.
+ line : `.LineCollection` or `.Line2D`
+ `.Artist` added to the Axes of the correlation:
+
+ - `.LineCollection` if *usevlines* is True.
+ - `.Line2D` if *usevlines* is False.
+ b : `~matplotlib.lines.Line2D` or None
+ Horizontal line at 0 if *usevlines* is True
+ None *usevlines* is False.
+
+ Other Parameters
+ ----------------
+ linestyle : `~matplotlib.lines.Line2D` property, optional
+ The linestyle for plotting the data points.
+ Only used if *usevlines* is ``False``.
+
+ marker : str, default: 'o'
+ The marker for plotting the data points.
+ Only used if *usevlines* is ``False``.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Additional parameters are passed to `.Axes.vlines` and
+ `.Axes.axhline` if *usevlines* is ``True``; otherwise they are
+ passed to `.Axes.plot`.
+
+ Notes
+ -----
+ The cross correlation is performed with `numpy.correlate` with
+ ``mode = "full"``.
+ """
+ return self.xcorr(x, x, **kwargs)
+
+ @_api.make_keyword_only("3.10", "normed")
+ @_preprocess_data(replace_names=["x", "y"], label_namer="y")
+ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
+ usevlines=True, maxlags=10, **kwargs):
+ r"""
+ Plot the cross correlation between *x* and *y*.
+
+ The correlation with lag k is defined as
+ :math:`\sum_n x[n+k] \cdot y^*[n]`, where :math:`y^*` is the complex
+ conjugate of :math:`y`.
+
+ Parameters
+ ----------
+ x, y : array-like of length n
+ Neither *x* nor *y* are run through Matplotlib's unit conversion, so
+ these should be unit-less arrays.
+
+ detrend : callable, default: `.mlab.detrend_none` (no detrending)
+ A detrending function applied to *x* and *y*. It must have the
+ signature ::
+
+ detrend(x: np.ndarray) -> np.ndarray
+
+ normed : bool, default: True
+ If ``True``, input vectors are normalised to unit length.
+
+ usevlines : bool, default: True
+ Determines the plot style.
+
+ If ``True``, vertical lines are plotted from 0 to the xcorr value
+ using `.Axes.vlines`. Additionally, a horizontal line is plotted
+ at y=0 using `.Axes.axhline`.
+
+ If ``False``, markers are plotted at the xcorr values using
+ `.Axes.plot`.
+
+ maxlags : int, default: 10
+ Number of lags to show. If None, will return all ``2 * len(x) - 1``
+ lags.
+
+ Returns
+ -------
+ lags : array (length ``2*maxlags+1``)
+ The lag vector.
+ c : array (length ``2*maxlags+1``)
+ The auto correlation vector.
+ line : `.LineCollection` or `.Line2D`
+ `.Artist` added to the Axes of the correlation:
+
+ - `.LineCollection` if *usevlines* is True.
+ - `.Line2D` if *usevlines* is False.
+ b : `~matplotlib.lines.Line2D` or None
+ Horizontal line at 0 if *usevlines* is True
+ None *usevlines* is False.
+
+ Other Parameters
+ ----------------
+ linestyle : `~matplotlib.lines.Line2D` property, optional
+ The linestyle for plotting the data points.
+ Only used if *usevlines* is ``False``.
+
+ marker : str, default: 'o'
+ The marker for plotting the data points.
+ Only used if *usevlines* is ``False``.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Additional parameters are passed to `.Axes.vlines` and
+ `.Axes.axhline` if *usevlines* is ``True``; otherwise they are
+ passed to `.Axes.plot`.
+
+ Notes
+ -----
+ The cross correlation is performed with `numpy.correlate` with
+ ``mode = "full"``.
+ """
+ Nx = len(x)
+ if Nx != len(y):
+ raise ValueError('x and y must be equal length')
+
+ x = detrend(np.asarray(x))
+ y = detrend(np.asarray(y))
+
+ correls = np.correlate(x, y, mode="full")
+
+ if normed:
+ correls = correls / np.sqrt(np.dot(x, x) * np.dot(y, y))
+
+ if maxlags is None:
+ maxlags = Nx - 1
+
+ if maxlags >= Nx or maxlags < 1:
+ raise ValueError('maxlags must be None or strictly '
+ 'positive < %d' % Nx)
+
+ lags = np.arange(-maxlags, maxlags + 1)
+ correls = correls[Nx - 1 - maxlags:Nx + maxlags]
+
+ if usevlines:
+ a = self.vlines(lags, [0], correls, **kwargs)
+ # Make label empty so only vertical lines get a legend entry
+ kwargs.pop('label', '')
+ b = self.axhline(**kwargs)
+ else:
+ kwargs.setdefault('marker', 'o')
+ kwargs.setdefault('linestyle', 'None')
+ a, = self.plot(lags, correls, **kwargs)
+ b = None
+ return lags, correls, a, b
+
+ #### Specialized plotting
+
+ # @_preprocess_data() # let 'plot' do the unpacking..
+ def step(self, x, y, *args, where='pre', data=None, **kwargs):
+ """
+ Make a step plot.
+
+ Call signatures::
+
+ step(x, y, [fmt], *, data=None, where='pre', **kwargs)
+ step(x, y, [fmt], x2, y2, [fmt2], ..., *, where='pre', **kwargs)
+
+ This is just a thin wrapper around `.plot` which changes some
+ formatting options. Most of the concepts and parameters of plot can be
+ used here as well.
+
+ .. note::
+
+ This method uses a standard plot with a step drawstyle: The *x*
+ values are the reference positions and steps extend left/right/both
+ directions depending on *where*.
+
+ For the common case where you know the values and edges of the
+ steps, use `~.Axes.stairs` instead.
+
+ Parameters
+ ----------
+ x : array-like
+ 1D sequence of x positions. It is assumed, but not checked, that
+ it is uniformly increasing.
+
+ y : array-like
+ 1D sequence of y levels.
+
+ fmt : str, optional
+ A format string, e.g. 'g' for a green line. See `.plot` for a more
+ detailed description.
+
+ Note: While full format strings are accepted, it is recommended to
+ only specify the color. Line styles are currently ignored (use
+ the keyword argument *linestyle* instead). Markers are accepted
+ and plotted on the given positions, however, this is a rarely
+ needed feature for step plots.
+
+ where : {'pre', 'post', 'mid'}, default: 'pre'
+ Define where the steps should be placed:
+
+ - 'pre': The y value is continued constantly to the left from
+ every *x* position, i.e. the interval ``(x[i-1], x[i]]`` has the
+ value ``y[i]``.
+ - 'post': The y value is continued constantly to the right from
+ every *x* position, i.e. the interval ``[x[i], x[i+1])`` has the
+ value ``y[i]``.
+ - 'mid': Steps occur half-way between the *x* positions.
+
+ data : indexable object, optional
+ An object with labelled data. If given, provide the label names to
+ plot in *x* and *y*.
+
+ **kwargs
+ Additional parameters are the same as those for `.plot`.
+
+ Returns
+ -------
+ list of `.Line2D`
+ Objects representing the plotted data.
+ """
+ _api.check_in_list(('pre', 'post', 'mid'), where=where)
+ kwargs['drawstyle'] = 'steps-' + where
+ return self.plot(x, y, *args, data=data, **kwargs)
+
+ @staticmethod
+ def _convert_dx(dx, x0, xconv, convert):
+ """
+ Small helper to do logic of width conversion flexibly.
+
+ *dx* and *x0* have units, but *xconv* has already been converted
+ to unitless (and is an ndarray). This allows the *dx* to have units
+ that are different from *x0*, but are still accepted by the
+ ``__add__`` operator of *x0*.
+ """
+
+ # x should be an array...
+ assert type(xconv) is np.ndarray
+
+ if xconv.size == 0:
+ # xconv has already been converted, but maybe empty...
+ return convert(dx)
+
+ try:
+ # attempt to add the width to x0; this works for
+ # datetime+timedelta, for instance
+
+ # only use the first element of x and x0. This saves
+ # having to be sure addition works across the whole
+ # vector. This is particularly an issue if
+ # x0 and dx are lists so x0 + dx just concatenates the lists.
+ # We can't just cast x0 and dx to numpy arrays because that
+ # removes the units from unit packages like `pint` that
+ # wrap numpy arrays.
+ try:
+ x0 = cbook._safe_first_finite(x0)
+ except (TypeError, IndexError, KeyError):
+ pass
+
+ try:
+ x = cbook._safe_first_finite(xconv)
+ except (TypeError, IndexError, KeyError):
+ x = xconv
+
+ delist = False
+ if not np.iterable(dx):
+ dx = [dx]
+ delist = True
+ dx = [convert(x0 + ddx) - x for ddx in dx]
+ if delist:
+ dx = dx[0]
+ except (ValueError, TypeError, AttributeError):
+ # if the above fails (for any reason) just fallback to what
+ # we do by default and convert dx by itself.
+ dx = convert(dx)
+ return dx
+
+ def _parse_bar_color_args(self, kwargs):
+ """
+ Helper function to process color-related arguments of `.Axes.bar`.
+
+ Argument precedence for facecolors:
+
+ - kwargs['facecolor']
+ - kwargs['color']
+ - 'Result of ``self._get_patches_for_fill.get_next_color``
+
+ Argument precedence for edgecolors:
+
+ - kwargs['edgecolor']
+ - None
+
+ Parameters
+ ----------
+ self : Axes
+
+ kwargs : dict
+ Additional kwargs. If these keys exist, we pop and process them:
+ 'facecolor', 'edgecolor', 'color'
+ Note: The dict is modified by this function.
+
+
+ Returns
+ -------
+ facecolor
+ The facecolor. One or more colors as (N, 4) rgba array.
+ edgecolor
+ The edgecolor. Not normalized; may be any valid color spec or None.
+ """
+ color = kwargs.pop('color', None)
+
+ facecolor = kwargs.pop('facecolor', color)
+ edgecolor = kwargs.pop('edgecolor', None)
+
+ facecolor = (facecolor if facecolor is not None
+ else self._get_patches_for_fill.get_next_color())
+
+ try:
+ facecolor = mcolors.to_rgba_array(facecolor)
+ except ValueError as err:
+ raise ValueError(
+ "'facecolor' or 'color' argument must be a valid color or"
+ "sequence of colors."
+ ) from err
+
+ return facecolor, edgecolor
+
+ @_preprocess_data()
+ @_docstring.interpd
+ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
+ **kwargs):
+ r"""
+ Make a bar plot.
+
+ The bars are positioned at *x* with the given *align*\ment. Their
+ dimensions are given by *height* and *width*. The vertical baseline
+ is *bottom* (default 0).
+
+ Many parameters can take either a single value applying to all bars
+ or a sequence of values, one for each bar.
+
+ Parameters
+ ----------
+ x : float or array-like
+ The x coordinates of the bars. See also *align* for the
+ alignment of the bars to the coordinates.
+
+ Bars are often used for categorical data, i.e. string labels below
+ the bars. You can provide a list of strings directly to *x*.
+ ``bar(['A', 'B', 'C'], [1, 2, 3])`` is often a shorter and more
+ convenient notation compared to
+ ``bar(range(3), [1, 2, 3], tick_label=['A', 'B', 'C'])``. They are
+ equivalent as long as the names are unique. The explicit *tick_label*
+ notation draws the names in the sequence given. However, when having
+ duplicate values in categorical *x* data, these values map to the same
+ numerical x coordinate, and hence the corresponding bars are drawn on
+ top of each other.
+
+ height : float or array-like
+ The height(s) of the bars.
+
+ Note that if *bottom* has units (e.g. datetime), *height* should be in
+ units that are a difference from the value of *bottom* (e.g. timedelta).
+
+ width : float or array-like, default: 0.8
+ The width(s) of the bars.
+
+ Note that if *x* has units (e.g. datetime), then *width* should be in
+ units that are a difference (e.g. timedelta) around the *x* values.
+
+ bottom : float or array-like, default: 0
+ The y coordinate(s) of the bottom side(s) of the bars.
+
+ Note that if *bottom* has units, then the y-axis will get a Locator and
+ Formatter appropriate for the units (e.g. dates, or categorical).
+
+ align : {'center', 'edge'}, default: 'center'
+ Alignment of the bars to the *x* coordinates:
+
+ - 'center': Center the base on the *x* positions.
+ - 'edge': Align the left edges of the bars with the *x* positions.
+
+ To align the bars on the right edge pass a negative *width* and
+ ``align='edge'``.
+
+ Returns
+ -------
+ `.BarContainer`
+ Container with all the bars and optionally errorbars.
+
+ Other Parameters
+ ----------------
+ color : :mpltype:`color` or list of :mpltype:`color`, optional
+ The colors of the bar faces. This is an alias for *facecolor*.
+ If both are given, *facecolor* takes precedence.
+
+ facecolor : :mpltype:`color` or list of :mpltype:`color`, optional
+ The colors of the bar faces.
+ If both *color* and *facecolor are given, *facecolor* takes precedence.
+
+ edgecolor : :mpltype:`color` or list of :mpltype:`color`, optional
+ The colors of the bar edges.
+
+ linewidth : float or array-like, optional
+ Width of the bar edge(s). If 0, don't draw edges.
+
+ tick_label : str or list of str, optional
+ The tick labels of the bars.
+ Default: None (Use default numeric labels.)
+
+ label : str or list of str, optional
+ A single label is attached to the resulting `.BarContainer` as a
+ label for the whole dataset.
+ If a list is provided, it must be the same length as *x* and
+ labels the individual bars. Repeated labels are not de-duplicated
+ and will cause repeated label entries, so this is best used when
+ bars also differ in style (e.g., by passing a list to *color*.)
+
+ xerr, yerr : float or array-like of shape(N,) or shape(2, N), optional
+ If not *None*, add horizontal / vertical errorbars to the bar tips.
+ The values are +/- sizes relative to the data:
+
+ - scalar: symmetric +/- values for all bars
+ - shape(N,): symmetric +/- values for each bar
+ - shape(2, N): Separate - and + values for each bar. First row
+ contains the lower errors, the second row contains the upper
+ errors.
+ - *None*: No errorbar. (Default)
+
+ See :doc:`/gallery/statistics/errorbar_features` for an example on
+ the usage of *xerr* and *yerr*.
+
+ ecolor : :mpltype:`color` or list of :mpltype:`color`, default: 'black'
+ The line color of the errorbars.
+
+ capsize : float, default: :rc:`errorbar.capsize`
+ The length of the error bar caps in points.
+
+ error_kw : dict, optional
+ Dictionary of keyword arguments to be passed to the
+ `~.Axes.errorbar` method. Values of *ecolor* or *capsize* defined
+ here take precedence over the independent keyword arguments.
+
+ log : bool, default: False
+ If *True*, set the y-axis to be log scale.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs : `.Rectangle` properties
+
+ %(Rectangle:kwdoc)s
+
+ See Also
+ --------
+ barh : Plot a horizontal bar plot.
+
+ Notes
+ -----
+ Stacked bars can be achieved by passing individual *bottom* values per
+ bar. See :doc:`/gallery/lines_bars_and_markers/bar_stacked`.
+ """
+ kwargs = cbook.normalize_kwargs(kwargs, mpatches.Patch)
+ facecolor, edgecolor = self._parse_bar_color_args(kwargs)
+
+ linewidth = kwargs.pop('linewidth', None)
+ hatch = kwargs.pop('hatch', None)
+
+ # Because xerr and yerr will be passed to errorbar, most dimension
+ # checking and processing will be left to the errorbar method.
+ xerr = kwargs.pop('xerr', None)
+ yerr = kwargs.pop('yerr', None)
+ error_kw = kwargs.pop('error_kw', None)
+ error_kw = {} if error_kw is None else error_kw.copy()
+ ezorder = error_kw.pop('zorder', None)
+ if ezorder is None:
+ ezorder = kwargs.get('zorder', None)
+ if ezorder is not None:
+ # If using the bar zorder, increment slightly to make sure
+ # errorbars are drawn on top of bars
+ ezorder += 0.01
+ error_kw.setdefault('zorder', ezorder)
+ ecolor = kwargs.pop('ecolor', 'k')
+ capsize = kwargs.pop('capsize', mpl.rcParams["errorbar.capsize"])
+ error_kw.setdefault('ecolor', ecolor)
+ error_kw.setdefault('capsize', capsize)
+
+ # The keyword argument *orientation* is used by barh() to defer all
+ # logic and drawing to bar(). It is considered internal and is
+ # intentionally not mentioned in the docstring.
+ orientation = kwargs.pop('orientation', 'vertical')
+ _api.check_in_list(['vertical', 'horizontal'], orientation=orientation)
+ log = kwargs.pop('log', False)
+ label = kwargs.pop('label', '')
+ tick_labels = kwargs.pop('tick_label', None)
+
+ y = bottom # Matches barh call signature.
+ if orientation == 'vertical':
+ if y is None:
+ y = 0
+ else: # horizontal
+ if x is None:
+ x = 0
+
+ if orientation == 'vertical':
+ # It is possible for y (bottom) to contain unit information.
+ # However, it is also possible for y=0 for the default and height
+ # to contain unit information. This will prioritize the units of y.
+ self._process_unit_info(
+ [("x", x), ("y", y), ("y", height)], kwargs, convert=False)
+ if log:
+ self.set_yscale('log', nonpositive='clip')
+ else: # horizontal
+ # It is possible for x (left) to contain unit information.
+ # However, it is also possible for x=0 for the default and width
+ # to contain unit information. This will prioritize the units of x.
+ self._process_unit_info(
+ [("x", x), ("x", width), ("y", y)], kwargs, convert=False)
+ if log:
+ self.set_xscale('log', nonpositive='clip')
+
+ # lets do some conversions now since some types cannot be
+ # subtracted uniformly
+ if self.xaxis is not None:
+ x0 = x
+ x = np.asarray(self.convert_xunits(x))
+ width = self._convert_dx(width, x0, x, self.convert_xunits)
+ if xerr is not None:
+ xerr = self._convert_dx(xerr, x0, x, self.convert_xunits)
+ if self.yaxis is not None:
+ y0 = y
+ y = np.asarray(self.convert_yunits(y))
+ height = self._convert_dx(height, y0, y, self.convert_yunits)
+ if yerr is not None:
+ yerr = self._convert_dx(yerr, y0, y, self.convert_yunits)
+
+ x, height, width, y, linewidth, hatch = np.broadcast_arrays(
+ # Make args iterable too.
+ np.atleast_1d(x), height, width, y, linewidth, hatch)
+
+ # Now that units have been converted, set the tick locations.
+ if orientation == 'vertical':
+ tick_label_axis = self.xaxis
+ tick_label_position = x
+ else: # horizontal
+ tick_label_axis = self.yaxis
+ tick_label_position = y
+
+ if not isinstance(label, str) and np.iterable(label):
+ bar_container_label = '_nolegend_'
+ patch_labels = label
+ else:
+ bar_container_label = label
+ patch_labels = ['_nolegend_'] * len(x)
+ if len(patch_labels) != len(x):
+ raise ValueError(f'number of labels ({len(patch_labels)}) '
+ f'does not match number of bars ({len(x)}).')
+
+ linewidth = itertools.cycle(np.atleast_1d(linewidth))
+ hatch = itertools.cycle(np.atleast_1d(hatch))
+ facecolor = itertools.chain(itertools.cycle(facecolor),
+ # Fallback if color == "none".
+ itertools.repeat('none'))
+ if edgecolor is None:
+ edgecolor = itertools.repeat(None)
+ else:
+ edgecolor = itertools.chain(
+ itertools.cycle(mcolors.to_rgba_array(edgecolor)),
+ # Fallback if edgecolor == "none".
+ itertools.repeat('none'))
+
+ # We will now resolve the alignment and really have
+ # left, bottom, width, height vectors
+ _api.check_in_list(['center', 'edge'], align=align)
+ if align == 'center':
+ if orientation == 'vertical':
+ try:
+ left = x - width / 2
+ except TypeError as e:
+ raise TypeError(f'the dtypes of parameters x ({x.dtype}) '
+ f'and width ({width.dtype}) '
+ f'are incompatible') from e
+ bottom = y
+ else: # horizontal
+ try:
+ bottom = y - height / 2
+ except TypeError as e:
+ raise TypeError(f'the dtypes of parameters y ({y.dtype}) '
+ f'and height ({height.dtype}) '
+ f'are incompatible') from e
+ left = x
+ else: # edge
+ left = x
+ bottom = y
+
+ patches = []
+ args = zip(left, bottom, width, height, facecolor, edgecolor, linewidth,
+ hatch, patch_labels)
+ for l, b, w, h, c, e, lw, htch, lbl in args:
+ r = mpatches.Rectangle(
+ xy=(l, b), width=w, height=h,
+ facecolor=c,
+ edgecolor=e,
+ linewidth=lw,
+ label=lbl,
+ hatch=htch,
+ )
+ r._internal_update(kwargs)
+ r.get_path()._interpolation_steps = 100
+ if orientation == 'vertical':
+ r.sticky_edges.y.append(b)
+ else: # horizontal
+ r.sticky_edges.x.append(l)
+ self.add_patch(r)
+ patches.append(r)
+
+ if xerr is not None or yerr is not None:
+ if orientation == 'vertical':
+ # using list comps rather than arrays to preserve unit info
+ ex = [l + 0.5 * w for l, w in zip(left, width)]
+ ey = [b + h for b, h in zip(bottom, height)]
+
+ else: # horizontal
+ # using list comps rather than arrays to preserve unit info
+ ex = [l + w for l, w in zip(left, width)]
+ ey = [b + 0.5 * h for b, h in zip(bottom, height)]
+
+ error_kw.setdefault("label", '_nolegend_')
+
+ errorbar = self.errorbar(ex, ey, yerr=yerr, xerr=xerr, fmt='none',
+ **error_kw)
+ else:
+ errorbar = None
+
+ self._request_autoscale_view()
+
+ if orientation == 'vertical':
+ datavalues = height
+ else: # horizontal
+ datavalues = width
+
+ bar_container = BarContainer(patches, errorbar, datavalues=datavalues,
+ orientation=orientation,
+ label=bar_container_label)
+ self.add_container(bar_container)
+
+ if tick_labels is not None:
+ tick_labels = np.broadcast_to(tick_labels, len(patches))
+ tick_label_axis.set_ticks(tick_label_position)
+ tick_label_axis.set_ticklabels(tick_labels)
+
+ return bar_container
+
+ # @_preprocess_data() # let 'bar' do the unpacking..
+ @_docstring.interpd
+ def barh(self, y, width, height=0.8, left=None, *, align="center",
+ data=None, **kwargs):
+ r"""
+ Make a horizontal bar plot.
+
+ The bars are positioned at *y* with the given *align*\ment. Their
+ dimensions are given by *width* and *height*. The horizontal baseline
+ is *left* (default 0).
+
+ Many parameters can take either a single value applying to all bars
+ or a sequence of values, one for each bar.
+
+ Parameters
+ ----------
+ y : float or array-like
+ The y coordinates of the bars. See also *align* for the
+ alignment of the bars to the coordinates.
+
+ Bars are often used for categorical data, i.e. string labels below
+ the bars. You can provide a list of strings directly to *y*.
+ ``barh(['A', 'B', 'C'], [1, 2, 3])`` is often a shorter and more
+ convenient notation compared to
+ ``barh(range(3), [1, 2, 3], tick_label=['A', 'B', 'C'])``. They are
+ equivalent as long as the names are unique. The explicit *tick_label*
+ notation draws the names in the sequence given. However, when having
+ duplicate values in categorical *y* data, these values map to the same
+ numerical y coordinate, and hence the corresponding bars are drawn on
+ top of each other.
+
+ width : float or array-like
+ The width(s) of the bars.
+
+ Note that if *left* has units (e.g. datetime), *width* should be in
+ units that are a difference from the value of *left* (e.g. timedelta).
+
+ height : float or array-like, default: 0.8
+ The heights of the bars.
+
+ Note that if *y* has units (e.g. datetime), then *height* should be in
+ units that are a difference (e.g. timedelta) around the *y* values.
+
+ left : float or array-like, default: 0
+ The x coordinates of the left side(s) of the bars.
+
+ Note that if *left* has units, then the x-axis will get a Locator and
+ Formatter appropriate for the units (e.g. dates, or categorical).
+
+ align : {'center', 'edge'}, default: 'center'
+ Alignment of the base to the *y* coordinates*:
+
+ - 'center': Center the bars on the *y* positions.
+ - 'edge': Align the bottom edges of the bars with the *y*
+ positions.
+
+ To align the bars on the top edge pass a negative *height* and
+ ``align='edge'``.
+
+ Returns
+ -------
+ `.BarContainer`
+ Container with all the bars and optionally errorbars.
+
+ Other Parameters
+ ----------------
+ color : :mpltype:`color` or list of :mpltype:`color`, optional
+ The colors of the bar faces.
+
+ edgecolor : :mpltype:`color` or list of :mpltype:`color`, optional
+ The colors of the bar edges.
+
+ linewidth : float or array-like, optional
+ Width of the bar edge(s). If 0, don't draw edges.
+
+ tick_label : str or list of str, optional
+ The tick labels of the bars.
+ Default: None (Use default numeric labels.)
+
+ label : str or list of str, optional
+ A single label is attached to the resulting `.BarContainer` as a
+ label for the whole dataset.
+ If a list is provided, it must be the same length as *y* and
+ labels the individual bars. Repeated labels are not de-duplicated
+ and will cause repeated label entries, so this is best used when
+ bars also differ in style (e.g., by passing a list to *color*.)
+
+ xerr, yerr : float or array-like of shape(N,) or shape(2, N), optional
+ If not *None*, add horizontal / vertical errorbars to the bar tips.
+ The values are +/- sizes relative to the data:
+
+ - scalar: symmetric +/- values for all bars
+ - shape(N,): symmetric +/- values for each bar
+ - shape(2, N): Separate - and + values for each bar. First row
+ contains the lower errors, the second row contains the upper
+ errors.
+ - *None*: No errorbar. (default)
+
+ See :doc:`/gallery/statistics/errorbar_features` for an example on
+ the usage of *xerr* and *yerr*.
+
+ ecolor : :mpltype:`color` or list of :mpltype:`color`, default: 'black'
+ The line color of the errorbars.
+
+ capsize : float, default: :rc:`errorbar.capsize`
+ The length of the error bar caps in points.
+
+ error_kw : dict, optional
+ Dictionary of keyword arguments to be passed to the
+ `~.Axes.errorbar` method. Values of *ecolor* or *capsize* defined
+ here take precedence over the independent keyword arguments.
+
+ log : bool, default: False
+ If ``True``, set the x-axis to be log scale.
+
+ data : indexable object, optional
+ If given, all parameters also accept a string ``s``, which is
+ interpreted as ``data[s]`` if ``s`` is a key in ``data``.
+
+ **kwargs : `.Rectangle` properties
+
+ %(Rectangle:kwdoc)s
+
+ See Also
+ --------
+ bar : Plot a vertical bar plot.
+
+ Notes
+ -----
+ Stacked bars can be achieved by passing individual *left* values per
+ bar. See
+ :doc:`/gallery/lines_bars_and_markers/horizontal_barchart_distribution`.
+ """
+ kwargs.setdefault('orientation', 'horizontal')
+ patches = self.bar(x=left, height=height, width=width, bottom=y,
+ align=align, data=data, **kwargs)
+ return patches
+
+ def bar_label(self, container, labels=None, *, fmt="%g", label_type="edge",
+ padding=0, **kwargs):
+ """
+ Label a bar plot.
+
+ Adds labels to bars in the given `.BarContainer`.
+ You may need to adjust the axis limits to fit the labels.
+
+ Parameters
+ ----------
+ container : `.BarContainer`
+ Container with all the bars and optionally errorbars, likely
+ returned from `.bar` or `.barh`.
+
+ labels : array-like, optional
+ A list of label texts, that should be displayed. If not given, the
+ label texts will be the data values formatted with *fmt*.
+
+ fmt : str or callable, default: '%g'
+ An unnamed %-style or {}-style format string for the label or a
+ function to call with the value as the first argument.
+ When *fmt* is a string and can be interpreted in both formats,
+ %-style takes precedence over {}-style.
+
+ .. versionadded:: 3.7
+ Support for {}-style format string and callables.
+
+ label_type : {'edge', 'center'}, default: 'edge'
+ The label type. Possible values:
+
+ - 'edge': label placed at the end-point of the bar segment, and the
+ value displayed will be the position of that end-point.
+ - 'center': label placed in the center of the bar segment, and the
+ value displayed will be the length of that segment.
+ (useful for stacked bars, i.e.,
+ :doc:`/gallery/lines_bars_and_markers/bar_label_demo`)
+
+ padding : float, default: 0
+ Distance of label from the end of the bar, in points.
+
+ **kwargs
+ Any remaining keyword arguments are passed through to
+ `.Axes.annotate`. The alignment parameters (
+ *horizontalalignment* / *ha*, *verticalalignment* / *va*) are
+ not supported because the labels are automatically aligned to
+ the bars.
+
+ Returns
+ -------
+ list of `.Annotation`
+ A list of `.Annotation` instances for the labels.
+ """
+ for key in ['horizontalalignment', 'ha', 'verticalalignment', 'va']:
+ if key in kwargs:
+ raise ValueError(
+ f"Passing {key!r} to bar_label() is not supported.")
+
+ a, b = self.yaxis.get_view_interval()
+ y_inverted = a > b
+ c, d = self.xaxis.get_view_interval()
+ x_inverted = c > d
+
+ # want to know whether to put label on positive or negative direction
+ # cannot use np.sign here because it will return 0 if x == 0
+ def sign(x):
+ return 1 if x >= 0 else -1
+
+ _api.check_in_list(['edge', 'center'], label_type=label_type)
+
+ bars = container.patches
+ errorbar = container.errorbar
+ datavalues = container.datavalues
+ orientation = container.orientation
+
+ if errorbar:
+ # check "ErrorbarContainer" for the definition of these elements
+ lines = errorbar.lines # attribute of "ErrorbarContainer" (tuple)
+ barlinecols = lines[2] # 0: data_line, 1: caplines, 2: barlinecols
+ barlinecol = barlinecols[0] # the "LineCollection" of error bars
+ errs = barlinecol.get_segments()
+ else:
+ errs = []
+
+ if labels is None:
+ labels = []
+
+ annotations = []
+
+ for bar, err, dat, lbl in itertools.zip_longest(
+ bars, errs, datavalues, labels
+ ):
+ (x0, y0), (x1, y1) = bar.get_bbox().get_points()
+ xc, yc = (x0 + x1) / 2, (y0 + y1) / 2
+
+ if orientation == "vertical":
+ extrema = max(y0, y1) if dat >= 0 else min(y0, y1)
+ length = abs(y0 - y1)
+ else: # horizontal
+ extrema = max(x0, x1) if dat >= 0 else min(x0, x1)
+ length = abs(x0 - x1)
+
+ if err is None or np.size(err) == 0:
+ endpt = extrema
+ elif orientation == "vertical":
+ endpt = err[:, 1].max() if dat >= 0 else err[:, 1].min()
+ else: # horizontal
+ endpt = err[:, 0].max() if dat >= 0 else err[:, 0].min()
+
+ if label_type == "center":
+ value = sign(dat) * length
+ else: # edge
+ value = extrema
+
+ if label_type == "center":
+ xy = (0.5, 0.5)
+ kwargs["xycoords"] = (
+ lambda r, b=bar:
+ mtransforms.Bbox.intersection(
+ b.get_window_extent(r), b.get_clip_box()
+ ) or mtransforms.Bbox.null()
+ )
+ else: # edge
+ if orientation == "vertical":
+ xy = xc, endpt
+ else: # horizontal
+ xy = endpt, yc
+
+ if orientation == "vertical":
+ y_direction = -1 if y_inverted else 1
+ xytext = 0, y_direction * sign(dat) * padding
+ else: # horizontal
+ x_direction = -1 if x_inverted else 1
+ xytext = x_direction * sign(dat) * padding, 0
+
+ if label_type == "center":
+ ha, va = "center", "center"
+ else: # edge
+ if orientation == "vertical":
+ ha = 'center'
+ if y_inverted:
+ va = 'top' if dat > 0 else 'bottom' # also handles NaN
+ else:
+ va = 'top' if dat < 0 else 'bottom' # also handles NaN
+ else: # horizontal
+ if x_inverted:
+ ha = 'right' if dat > 0 else 'left' # also handles NaN
+ else:
+ ha = 'right' if dat < 0 else 'left' # also handles NaN
+ va = 'center'
+
+ if np.isnan(dat):
+ lbl = ''
+
+ if lbl is None:
+ if isinstance(fmt, str):
+ lbl = cbook._auto_format_str(fmt, value)
+ elif callable(fmt):
+ lbl = fmt(value)
+ else:
+ raise TypeError("fmt must be a str or callable")
+ annotation = self.annotate(lbl,
+ xy, xytext, textcoords="offset points",
+ ha=ha, va=va, **kwargs)
+ annotations.append(annotation)
+
+ return annotations
+
+ @_preprocess_data()
+ @_docstring.interpd
+ def broken_barh(self, xranges, yrange, **kwargs):
+ """
+ Plot a horizontal sequence of rectangles.
+
+ A rectangle is drawn for each element of *xranges*. All rectangles
+ have the same vertical position and size defined by *yrange*.
+
+ Parameters
+ ----------
+ xranges : sequence of tuples (*xmin*, *xwidth*)
+ The x-positions and extents of the rectangles. For each tuple
+ (*xmin*, *xwidth*) a rectangle is drawn from *xmin* to *xmin* +
+ *xwidth*.
+ yrange : (*ymin*, *yheight*)
+ The y-position and extent for all the rectangles.
+
+ Returns
+ -------
+ `~.collections.PolyCollection`
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+ **kwargs : `.PolyCollection` properties
+
+ Each *kwarg* can be either a single argument applying to all
+ rectangles, e.g.::
+
+ facecolors='black'
+
+ or a sequence of arguments over which is cycled, e.g.::
+
+ facecolors=('black', 'blue')
+
+ would create interleaving black and blue rectangles.
+
+ Supported keywords:
+
+ %(PolyCollection:kwdoc)s
+ """
+ # process the unit information
+ xdata = cbook._safe_first_finite(xranges) if len(xranges) else None
+ ydata = cbook._safe_first_finite(yrange) if len(yrange) else None
+ self._process_unit_info(
+ [("x", xdata), ("y", ydata)], kwargs, convert=False)
+
+ vertices = []
+ y0, dy = yrange
+ y0, y1 = self.convert_yunits((y0, y0 + dy))
+ for xr in xranges: # convert the absolute values, not the x and dx
+ try:
+ x0, dx = xr
+ except Exception:
+ raise ValueError(
+ "each range in xrange must be a sequence with two "
+ "elements (i.e. xrange must be an (N, 2) array)") from None
+ x0, x1 = self.convert_xunits((x0, x0 + dx))
+ vertices.append([(x0, y0), (x0, y1), (x1, y1), (x1, y0)])
+
+ col = mcoll.PolyCollection(np.array(vertices), **kwargs)
+ self.add_collection(col, autolim=True)
+ self._request_autoscale_view()
+
+ return col
+
+ @_preprocess_data()
+ def stem(self, *args, linefmt=None, markerfmt=None, basefmt=None, bottom=0,
+ label=None, orientation='vertical'):
+ """
+ Create a stem plot.
+
+ A stem plot draws lines perpendicular to a baseline at each location
+ *locs* from the baseline to *heads*, and places a marker there. For
+ vertical stem plots (the default), the *locs* are *x* positions, and
+ the *heads* are *y* values. For horizontal stem plots, the *locs* are
+ *y* positions, and the *heads* are *x* values.
+
+ Call signature::
+
+ stem([locs,] heads, linefmt=None, markerfmt=None, basefmt=None)
+
+ The *locs*-positions are optional. *linefmt* may be provided as
+ positional, but all other formats must be provided as keyword
+ arguments.
+
+ Parameters
+ ----------
+ locs : array-like, default: (0, 1, ..., len(heads) - 1)
+ For vertical stem plots, the x-positions of the stems.
+ For horizontal stem plots, the y-positions of the stems.
+
+ heads : array-like
+ For vertical stem plots, the y-values of the stem heads.
+ For horizontal stem plots, the x-values of the stem heads.
+
+ linefmt : str, optional
+ A string defining the color and/or linestyle of the vertical lines:
+
+ ========= =============
+ Character Line Style
+ ========= =============
+ ``'-'`` solid line
+ ``'--'`` dashed line
+ ``'-.'`` dash-dot line
+ ``':'`` dotted line
+ ========= =============
+
+ Default: 'C0-', i.e. solid line with the first color of the color
+ cycle.
+
+ Note: Markers specified through this parameter (e.g. 'x') will be
+ silently ignored. Instead, markers should be specified using
+ *markerfmt*.
+
+ markerfmt : str, optional
+ A string defining the color and/or shape of the markers at the stem
+ heads. If the marker is not given, use the marker 'o', i.e. filled
+ circles. If the color is not given, use the color from *linefmt*.
+
+ basefmt : str, default: 'C3-' ('C2-' in classic mode)
+ A format string defining the properties of the baseline.
+
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
+ The orientation of the stems.
+
+ bottom : float, default: 0
+ The y/x-position of the baseline (depending on *orientation*).
+
+ label : str, optional
+ The label to use for the stems in legends.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ Returns
+ -------
+ `.StemContainer`
+ The container may be treated like a tuple
+ (*markerline*, *stemlines*, *baseline*)
+
+ Notes
+ -----
+ .. seealso::
+ The MATLAB function
+ `stem `_
+ which inspired this method.
+ """
+ if not 1 <= len(args) <= 3:
+ raise _api.nargs_error('stem', '1-3', len(args))
+ _api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
+
+ if len(args) == 1:
+ heads, = args
+ locs = np.arange(len(heads))
+ args = ()
+ elif isinstance(args[1], str):
+ heads, *args = args
+ locs = np.arange(len(heads))
+ else:
+ locs, heads, *args = args
+
+ if orientation == 'vertical':
+ locs, heads = self._process_unit_info([("x", locs), ("y", heads)])
+ else: # horizontal
+ heads, locs = self._process_unit_info([("x", heads), ("y", locs)])
+
+ # resolve line format
+ if linefmt is None:
+ linefmt = args[0] if len(args) > 0 else "C0-"
+ linestyle, linemarker, linecolor = _process_plot_format(linefmt)
+
+ # resolve marker format
+ if markerfmt is None:
+ # if not given as kwarg, fall back to 'o'
+ markerfmt = "o"
+ if markerfmt == '':
+ markerfmt = ' ' # = empty line style; '' would resolve rcParams
+ markerstyle, markermarker, markercolor = \
+ _process_plot_format(markerfmt)
+ if markermarker is None:
+ markermarker = 'o'
+ if markerstyle is None:
+ markerstyle = 'None'
+ if markercolor is None:
+ markercolor = linecolor
+
+ # resolve baseline format
+ if basefmt is None:
+ basefmt = ("C2-" if mpl.rcParams["_internal.classic_mode"] else
+ "C3-")
+ basestyle, basemarker, basecolor = _process_plot_format(basefmt)
+
+ # New behaviour in 3.1 is to use a LineCollection for the stemlines
+ if linestyle is None:
+ linestyle = mpl.rcParams['lines.linestyle']
+ xlines = self.vlines if orientation == "vertical" else self.hlines
+ stemlines = xlines(
+ locs, bottom, heads,
+ colors=linecolor, linestyles=linestyle, label="_nolegend_")
+
+ if orientation == 'horizontal':
+ marker_x = heads
+ marker_y = locs
+ baseline_x = [bottom, bottom]
+ baseline_y = [np.min(locs), np.max(locs)]
+ else:
+ marker_x = locs
+ marker_y = heads
+ baseline_x = [np.min(locs), np.max(locs)]
+ baseline_y = [bottom, bottom]
+
+ markerline, = self.plot(marker_x, marker_y,
+ color=markercolor, linestyle=markerstyle,
+ marker=markermarker, label="_nolegend_")
+
+ baseline, = self.plot(baseline_x, baseline_y,
+ color=basecolor, linestyle=basestyle,
+ marker=basemarker, label="_nolegend_")
+
+ stem_container = StemContainer((markerline, stemlines, baseline),
+ label=label)
+ self.add_container(stem_container)
+ return stem_container
+
+ @_api.make_keyword_only("3.10", "explode")
+ @_preprocess_data(replace_names=["x", "explode", "labels", "colors"])
+ def pie(self, x, explode=None, labels=None, colors=None,
+ autopct=None, pctdistance=0.6, shadow=False, labeldistance=1.1,
+ startangle=0, radius=1, counterclock=True,
+ wedgeprops=None, textprops=None, center=(0, 0),
+ frame=False, rotatelabels=False, *, normalize=True, hatch=None):
+ """
+ Plot a pie chart.
+
+ Make a pie chart of array *x*. The fractional area of each wedge is
+ given by ``x/sum(x)``.
+
+ The wedges are plotted counterclockwise, by default starting from the
+ x-axis.
+
+ Parameters
+ ----------
+ x : 1D array-like
+ The wedge sizes.
+
+ explode : array-like, default: None
+ If not *None*, is a ``len(x)`` array which specifies the fraction
+ of the radius with which to offset each wedge.
+
+ labels : list, default: None
+ A sequence of strings providing the labels for each wedge
+
+ colors : :mpltype:`color` or list of :mpltype:`color`, default: None
+ A sequence of colors through which the pie chart will cycle. If
+ *None*, will use the colors in the currently active cycle.
+
+ hatch : str or list, default: None
+ Hatching pattern applied to all pie wedges or sequence of patterns
+ through which the chart will cycle. For a list of valid patterns,
+ see :doc:`/gallery/shapes_and_collections/hatch_style_reference`.
+
+ .. versionadded:: 3.7
+
+ autopct : None or str or callable, default: None
+ If not *None*, *autopct* is a string or function used to label the
+ wedges with their numeric value. The label will be placed inside
+ the wedge. If *autopct* is a format string, the label will be
+ ``fmt % pct``. If *autopct* is a function, then it will be called.
+
+ pctdistance : float, default: 0.6
+ The relative distance along the radius at which the text
+ generated by *autopct* is drawn. To draw the text outside the pie,
+ set *pctdistance* > 1. This parameter is ignored if *autopct* is
+ ``None``.
+
+ labeldistance : float or None, default: 1.1
+ The relative distance along the radius at which the labels are
+ drawn. To draw the labels inside the pie, set *labeldistance* < 1.
+ If set to ``None``, labels are not drawn but are still stored for
+ use in `.legend`.
+
+ shadow : bool or dict, default: False
+ If bool, whether to draw a shadow beneath the pie. If dict, draw a shadow
+ passing the properties in the dict to `.Shadow`.
+
+ .. versionadded:: 3.8
+ *shadow* can be a dict.
+
+ startangle : float, default: 0 degrees
+ The angle by which the start of the pie is rotated,
+ counterclockwise from the x-axis.
+
+ radius : float, default: 1
+ The radius of the pie.
+
+ counterclock : bool, default: True
+ Specify fractions direction, clockwise or counterclockwise.
+
+ wedgeprops : dict, default: None
+ Dict of arguments passed to each `.patches.Wedge` of the pie.
+ For example, ``wedgeprops = {'linewidth': 3}`` sets the width of
+ the wedge border lines equal to 3. By default, ``clip_on=False``.
+ When there is a conflict between these properties and other
+ keywords, properties passed to *wedgeprops* take precedence.
+
+ textprops : dict, default: None
+ Dict of arguments to pass to the text objects.
+
+ center : (float, float), default: (0, 0)
+ The coordinates of the center of the chart.
+
+ frame : bool, default: False
+ Plot Axes frame with the chart if true.
+
+ rotatelabels : bool, default: False
+ Rotate each label to the angle of the corresponding slice if true.
+
+ normalize : bool, default: True
+ When *True*, always make a full pie by normalizing x so that
+ ``sum(x) == 1``. *False* makes a partial pie if ``sum(x) <= 1``
+ and raises a `ValueError` for ``sum(x) > 1``.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ Returns
+ -------
+ patches : list
+ A sequence of `matplotlib.patches.Wedge` instances
+
+ texts : list
+ A list of the label `.Text` instances.
+
+ autotexts : list
+ A list of `.Text` instances for the numeric labels. This will only
+ be returned if the parameter *autopct* is not *None*.
+
+ Notes
+ -----
+ The pie chart will probably look best if the figure and Axes are
+ square, or the Axes aspect is equal.
+ This method sets the aspect ratio of the axis to "equal".
+ The Axes aspect ratio can be controlled with `.Axes.set_aspect`.
+ """
+ self.set_aspect('equal')
+ # The use of float32 is "historical", but can't be changed without
+ # regenerating the test baselines.
+ x = np.asarray(x, np.float32)
+ if x.ndim > 1:
+ raise ValueError("x must be 1D")
+
+ if np.any(x < 0):
+ raise ValueError("Wedge sizes 'x' must be non negative values")
+
+ sx = x.sum()
+
+ if normalize:
+ x = x / sx
+ elif sx > 1:
+ raise ValueError('Cannot plot an unnormalized pie with sum(x) > 1')
+ if labels is None:
+ labels = [''] * len(x)
+ if explode is None:
+ explode = [0] * len(x)
+ if len(x) != len(labels):
+ raise ValueError(f"'labels' must be of length 'x', not {len(labels)}")
+ if len(x) != len(explode):
+ raise ValueError(f"'explode' must be of length 'x', not {len(explode)}")
+ if colors is None:
+ get_next_color = self._get_patches_for_fill.get_next_color
+ else:
+ color_cycle = itertools.cycle(colors)
+
+ def get_next_color():
+ return next(color_cycle)
+
+ hatch_cycle = itertools.cycle(np.atleast_1d(hatch))
+
+ _api.check_isinstance(Real, radius=radius, startangle=startangle)
+ if radius <= 0:
+ raise ValueError(f"'radius' must be a positive number, not {radius}")
+
+ # Starting theta1 is the start fraction of the circle
+ theta1 = startangle / 360
+
+ if wedgeprops is None:
+ wedgeprops = {}
+ if textprops is None:
+ textprops = {}
+
+ texts = []
+ slices = []
+ autotexts = []
+
+ for frac, label, expl in zip(x, labels, explode):
+ x, y = center
+ theta2 = (theta1 + frac) if counterclock else (theta1 - frac)
+ thetam = 2 * np.pi * 0.5 * (theta1 + theta2)
+ x += expl * math.cos(thetam)
+ y += expl * math.sin(thetam)
+
+ w = mpatches.Wedge((x, y), radius, 360. * min(theta1, theta2),
+ 360. * max(theta1, theta2),
+ facecolor=get_next_color(),
+ hatch=next(hatch_cycle),
+ clip_on=False,
+ label=label)
+ w.set(**wedgeprops)
+ slices.append(w)
+ self.add_patch(w)
+
+ if shadow:
+ # Make sure to add a shadow after the call to add_patch so the
+ # figure and transform props will be set.
+ shadow_dict = {'ox': -0.02, 'oy': -0.02, 'label': '_nolegend_'}
+ if isinstance(shadow, dict):
+ shadow_dict.update(shadow)
+ self.add_patch(mpatches.Shadow(w, **shadow_dict))
+
+ if labeldistance is not None:
+ xt = x + labeldistance * radius * math.cos(thetam)
+ yt = y + labeldistance * radius * math.sin(thetam)
+ label_alignment_h = 'left' if xt > 0 else 'right'
+ label_alignment_v = 'center'
+ label_rotation = 'horizontal'
+ if rotatelabels:
+ label_alignment_v = 'bottom' if yt > 0 else 'top'
+ label_rotation = (np.rad2deg(thetam)
+ + (0 if xt > 0 else 180))
+ t = self.text(xt, yt, label,
+ clip_on=False,
+ horizontalalignment=label_alignment_h,
+ verticalalignment=label_alignment_v,
+ rotation=label_rotation,
+ size=mpl.rcParams['xtick.labelsize'])
+ t.set(**textprops)
+ texts.append(t)
+
+ if autopct is not None:
+ xt = x + pctdistance * radius * math.cos(thetam)
+ yt = y + pctdistance * radius * math.sin(thetam)
+ if isinstance(autopct, str):
+ s = autopct % (100. * frac)
+ elif callable(autopct):
+ s = autopct(100. * frac)
+ else:
+ raise TypeError(
+ 'autopct must be callable or a format string')
+ if mpl._val_or_rc(textprops.get("usetex"), "text.usetex"):
+ # escape % (i.e. \%) if it is not already escaped
+ s = re.sub(r"([^\\])%", r"\1\\%", s)
+ t = self.text(xt, yt, s,
+ clip_on=False,
+ horizontalalignment='center',
+ verticalalignment='center')
+ t.set(**textprops)
+ autotexts.append(t)
+
+ theta1 = theta2
+
+ if frame:
+ self._request_autoscale_view()
+ else:
+ self.set(frame_on=False, xticks=[], yticks=[],
+ xlim=(-1.25 + center[0], 1.25 + center[0]),
+ ylim=(-1.25 + center[1], 1.25 + center[1]))
+
+ if autopct is None:
+ return slices, texts
+ else:
+ return slices, texts, autotexts
+
+ @staticmethod
+ def _errorevery_to_mask(x, errorevery):
+ """
+ Normalize `errorbar`'s *errorevery* to be a boolean mask for data *x*.
+
+ This function is split out to be usable both by 2D and 3D errorbars.
+ """
+ if isinstance(errorevery, Integral):
+ errorevery = (0, errorevery)
+ if isinstance(errorevery, tuple):
+ if (len(errorevery) == 2 and
+ isinstance(errorevery[0], Integral) and
+ isinstance(errorevery[1], Integral)):
+ errorevery = slice(errorevery[0], None, errorevery[1])
+ else:
+ raise ValueError(
+ f'{errorevery=!r} is a not a tuple of two integers')
+ elif isinstance(errorevery, slice):
+ pass
+ elif not isinstance(errorevery, str) and np.iterable(errorevery):
+ try:
+ x[errorevery] # fancy indexing
+ except (ValueError, IndexError) as err:
+ raise ValueError(
+ f"{errorevery=!r} is iterable but not a valid NumPy fancy "
+ "index to match 'xerr'/'yerr'") from err
+ else:
+ raise ValueError(f"{errorevery=!r} is not a recognized value")
+ everymask = np.zeros(len(x), bool)
+ everymask[errorevery] = True
+ return everymask
+
+ @_api.make_keyword_only("3.10", "ecolor")
+ @_preprocess_data(replace_names=["x", "y", "xerr", "yerr"],
+ label_namer="y")
+ @_docstring.interpd
+ def errorbar(self, x, y, yerr=None, xerr=None,
+ fmt='', ecolor=None, elinewidth=None, capsize=None,
+ barsabove=False, lolims=False, uplims=False,
+ xlolims=False, xuplims=False, errorevery=1, capthick=None,
+ **kwargs):
+ """
+ Plot y versus x as lines and/or markers with attached errorbars.
+
+ *x*, *y* define the data locations, *xerr*, *yerr* define the errorbar
+ sizes. By default, this draws the data markers/lines as well as the
+ errorbars. Use fmt='none' to draw errorbars without any data markers.
+
+ .. versionadded:: 3.7
+ Caps and error lines are drawn in polar coordinates on polar plots.
+
+
+ Parameters
+ ----------
+ x, y : float or array-like
+ The data positions.
+
+ xerr, yerr : float or array-like, shape(N,) or shape(2, N), optional
+ The errorbar sizes:
+
+ - scalar: Symmetric +/- values for all data points.
+ - shape(N,): Symmetric +/-values for each data point.
+ - shape(2, N): Separate - and + values for each bar. First row
+ contains the lower errors, the second row contains the upper
+ errors.
+ - *None*: No errorbar.
+
+ All values must be >= 0.
+
+ See :doc:`/gallery/statistics/errorbar_features`
+ for an example on the usage of ``xerr`` and ``yerr``.
+
+ fmt : str, default: ''
+ The format for the data points / data lines. See `.plot` for
+ details.
+
+ Use 'none' (case-insensitive) to plot errorbars without any data
+ markers.
+
+ ecolor : :mpltype:`color`, default: None
+ The color of the errorbar lines. If None, use the color of the
+ line connecting the markers.
+
+ elinewidth : float, default: None
+ The linewidth of the errorbar lines. If None, the linewidth of
+ the current style is used.
+
+ capsize : float, default: :rc:`errorbar.capsize`
+ The length of the error bar caps in points.
+
+ capthick : float, default: None
+ An alias to the keyword argument *markeredgewidth* (a.k.a. *mew*).
+ This setting is a more sensible name for the property that
+ controls the thickness of the error bar cap in points. For
+ backwards compatibility, if *mew* or *markeredgewidth* are given,
+ then they will over-ride *capthick*. This may change in future
+ releases.
+
+ barsabove : bool, default: False
+ If True, will plot the errorbars above the plot
+ symbols. Default is below.
+
+ lolims, uplims, xlolims, xuplims : bool or array-like, default: False
+ These arguments can be used to indicate that a value gives only
+ upper/lower limits. In that case a caret symbol is used to
+ indicate this. *lims*-arguments may be scalars, or array-likes of
+ the same length as *xerr* and *yerr*. To use limits with inverted
+ axes, `~.Axes.set_xlim` or `~.Axes.set_ylim` must be called before
+ :meth:`errorbar`. Note the tricky parameter names: setting e.g.
+ *lolims* to True means that the y-value is a *lower* limit of the
+ True value, so, only an *upward*-pointing arrow will be drawn!
+
+ errorevery : int or (int, int), default: 1
+ draws error bars on a subset of the data. *errorevery* =N draws
+ error bars on the points (x[::N], y[::N]).
+ *errorevery* =(start, N) draws error bars on the points
+ (x[start::N], y[start::N]). e.g. errorevery=(6, 3)
+ adds error bars to the data at (x[6], x[9], x[12], x[15], ...).
+ Used to avoid overlapping error bars when two series share x-axis
+ values.
+
+ Returns
+ -------
+ `.ErrorbarContainer`
+ The container contains:
+
+ - data_line : A `~matplotlib.lines.Line2D` instance of x, y plot markers
+ and/or line.
+ - caplines : A tuple of `~matplotlib.lines.Line2D` instances of the error
+ bar caps.
+ - barlinecols : A tuple of `.LineCollection` with the horizontal and
+ vertical error ranges.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ All other keyword arguments are passed on to the `~.Axes.plot` call
+ drawing the markers. For example, this code makes big red squares
+ with thick green edges::
+
+ x, y, yerr = rand(3, 10)
+ errorbar(x, y, yerr, marker='s', mfc='red',
+ mec='green', ms=20, mew=4)
+
+ where *mfc*, *mec*, *ms* and *mew* are aliases for the longer
+ property names, *markerfacecolor*, *markeredgecolor*, *markersize*
+ and *markeredgewidth*.
+
+ Valid kwargs for the marker properties are:
+
+ - *dashes*
+ - *dash_capstyle*
+ - *dash_joinstyle*
+ - *drawstyle*
+ - *fillstyle*
+ - *linestyle*
+ - *marker*
+ - *markeredgecolor*
+ - *markeredgewidth*
+ - *markerfacecolor*
+ - *markerfacecoloralt*
+ - *markersize*
+ - *markevery*
+ - *solid_capstyle*
+ - *solid_joinstyle*
+
+ Refer to the corresponding `.Line2D` property for more details:
+
+ %(Line2D:kwdoc)s
+ """
+ kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
+ # Drop anything that comes in as None to use the default instead.
+ kwargs = {k: v for k, v in kwargs.items() if v is not None}
+ kwargs.setdefault('zorder', 2)
+
+ # Casting to object arrays preserves units.
+ if not isinstance(x, np.ndarray):
+ x = np.asarray(x, dtype=object)
+ if not isinstance(y, np.ndarray):
+ y = np.asarray(y, dtype=object)
+
+ def _upcast_err(err):
+ """
+ Safely handle tuple of containers that carry units.
+
+ This function covers the case where the input to the xerr/yerr is a
+ length 2 tuple of equal length ndarray-subclasses that carry the
+ unit information in the container.
+
+ If we have a tuple of nested numpy array (subclasses), we defer
+ coercing the units to be consistent to the underlying unit
+ library (and implicitly the broadcasting).
+
+ Otherwise, fallback to casting to an object array.
+ """
+
+ if (
+ # make sure it is not a scalar
+ np.iterable(err) and
+ # and it is not empty
+ len(err) > 0 and
+ # and the first element is an array sub-class use
+ # safe_first_element because getitem is index-first not
+ # location first on pandas objects so err[0] almost always
+ # fails.
+ isinstance(cbook._safe_first_finite(err), np.ndarray)
+ ):
+ # Get the type of the first element
+ atype = type(cbook._safe_first_finite(err))
+ # Promote the outer container to match the inner container
+ if atype is np.ndarray:
+ # Converts using np.asarray, because data cannot
+ # be directly passed to init of np.ndarray
+ return np.asarray(err, dtype=object)
+ # If atype is not np.ndarray, directly pass data to init.
+ # This works for types such as unyts and astropy units
+ return atype(err)
+ # Otherwise wrap it in an object array
+ return np.asarray(err, dtype=object)
+
+ if xerr is not None and not isinstance(xerr, np.ndarray):
+ xerr = _upcast_err(xerr)
+ if yerr is not None and not isinstance(yerr, np.ndarray):
+ yerr = _upcast_err(yerr)
+ x, y = np.atleast_1d(x, y) # Make sure all the args are iterable.
+ if len(x) != len(y):
+ raise ValueError("'x' and 'y' must have the same size")
+
+ everymask = self._errorevery_to_mask(x, errorevery)
+
+ label = kwargs.pop("label", None)
+ kwargs['label'] = '_nolegend_'
+
+ # Create the main line and determine overall kwargs for child artists.
+ # We avoid calling self.plot() directly, or self._get_lines(), because
+ # that would call self._process_unit_info again, and do other indirect
+ # data processing.
+ (data_line, base_style), = self._get_lines._plot_args(
+ self, (x, y) if fmt == '' else (x, y, fmt), kwargs, return_kwargs=True)
+
+ # Do this after creating `data_line` to avoid modifying `base_style`.
+ if barsabove:
+ data_line.set_zorder(kwargs['zorder'] - .1)
+ else:
+ data_line.set_zorder(kwargs['zorder'] + .1)
+
+ # Add line to plot, or throw it away and use it to determine kwargs.
+ if fmt.lower() != 'none':
+ self.add_line(data_line)
+ else:
+ data_line = None
+ # Remove alpha=0 color that _get_lines._plot_args returns for
+ # 'none' format, and replace it with user-specified color, if
+ # supplied.
+ base_style.pop('color')
+ if 'color' in kwargs:
+ base_style['color'] = kwargs.pop('color')
+
+ if 'color' not in base_style:
+ base_style['color'] = 'C0'
+ if ecolor is None:
+ ecolor = base_style['color']
+
+ # Eject any line-specific information from format string, as it's not
+ # needed for bars or caps.
+ for key in ['marker', 'markersize', 'markerfacecolor',
+ 'markerfacecoloralt',
+ 'markeredgewidth', 'markeredgecolor', 'markevery',
+ 'linestyle', 'fillstyle', 'drawstyle', 'dash_capstyle',
+ 'dash_joinstyle', 'solid_capstyle', 'solid_joinstyle',
+ 'dashes']:
+ base_style.pop(key, None)
+
+ # Make the style dict for the line collections (the bars).
+ eb_lines_style = {**base_style, 'color': ecolor}
+
+ if elinewidth is not None:
+ eb_lines_style['linewidth'] = elinewidth
+ elif 'linewidth' in kwargs:
+ eb_lines_style['linewidth'] = kwargs['linewidth']
+
+ for key in ('transform', 'alpha', 'zorder', 'rasterized'):
+ if key in kwargs:
+ eb_lines_style[key] = kwargs[key]
+
+ # Make the style dict for caps (the "hats").
+ eb_cap_style = {**base_style, 'linestyle': 'none'}
+ if capsize is None:
+ capsize = mpl.rcParams["errorbar.capsize"]
+ if capsize > 0:
+ eb_cap_style['markersize'] = 2. * capsize
+ if capthick is not None:
+ eb_cap_style['markeredgewidth'] = capthick
+
+ # For backwards-compat, allow explicit setting of
+ # 'markeredgewidth' to over-ride capthick.
+ for key in ('markeredgewidth', 'transform', 'alpha',
+ 'zorder', 'rasterized'):
+ if key in kwargs:
+ eb_cap_style[key] = kwargs[key]
+ eb_cap_style['color'] = ecolor
+
+ barcols = []
+ caplines = {'x': [], 'y': []}
+
+ # Vectorized fancy-indexer.
+ def apply_mask(arrays, mask):
+ return [array[mask] for array in arrays]
+
+ # dep: dependent dataset, indep: independent dataset
+ for (dep_axis, dep, err, lolims, uplims, indep, lines_func,
+ marker, lomarker, himarker) in [
+ ("x", x, xerr, xlolims, xuplims, y, self.hlines,
+ "|", mlines.CARETRIGHTBASE, mlines.CARETLEFTBASE),
+ ("y", y, yerr, lolims, uplims, x, self.vlines,
+ "_", mlines.CARETUPBASE, mlines.CARETDOWNBASE),
+ ]:
+ if err is None:
+ continue
+ lolims = np.broadcast_to(lolims, len(dep)).astype(bool)
+ uplims = np.broadcast_to(uplims, len(dep)).astype(bool)
+ try:
+ np.broadcast_to(err, (2, len(dep)))
+ except ValueError:
+ raise ValueError(
+ f"'{dep_axis}err' (shape: {np.shape(err)}) must be a "
+ f"scalar or a 1D or (2, n) array-like whose shape matches "
+ f"'{dep_axis}' (shape: {np.shape(dep)})") from None
+ if err.dtype is np.dtype(object) and np.any(err == None): # noqa: E711
+ raise ValueError(
+ f"'{dep_axis}err' must not contain None. "
+ "Use NaN if you want to skip a value.")
+
+ # Raise if any errors are negative, but not if they are nan.
+ # To avoid nan comparisons (which lead to warnings on some
+ # platforms), we select with `err==err` (which is False for nan).
+ # Also, since datetime.timedelta cannot be compared with 0,
+ # we compare with the negative error instead.
+ if np.any((check := err[err == err]) < -check):
+ raise ValueError(
+ f"'{dep_axis}err' must not contain negative values")
+ # This is like
+ # elow, ehigh = np.broadcast_to(...)
+ # return dep - elow * ~lolims, dep + ehigh * ~uplims
+ # except that broadcast_to would strip units.
+ low, high = dep + np.vstack([-(1 - lolims), 1 - uplims]) * err
+ barcols.append(lines_func(
+ *apply_mask([indep, low, high], everymask), **eb_lines_style))
+ if self.name == "polar" and dep_axis == "x":
+ for b in barcols:
+ for p in b.get_paths():
+ p._interpolation_steps = 2
+ # Normal errorbars for points without upper/lower limits.
+ nolims = ~(lolims | uplims)
+ if nolims.any() and capsize > 0:
+ indep_masked, lo_masked, hi_masked = apply_mask(
+ [indep, low, high], nolims & everymask)
+ for lh_masked in [lo_masked, hi_masked]:
+ # Since this has to work for x and y as dependent data, we
+ # first set both x and y to the independent variable and
+ # overwrite the respective dependent data in a second step.
+ line = mlines.Line2D(indep_masked, indep_masked,
+ marker=marker, **eb_cap_style)
+ line.set(**{f"{dep_axis}data": lh_masked})
+ caplines[dep_axis].append(line)
+ for idx, (lims, hl) in enumerate([(lolims, high), (uplims, low)]):
+ if not lims.any():
+ continue
+ hlmarker = (
+ himarker
+ if self._axis_map[dep_axis].get_inverted() ^ idx
+ else lomarker)
+ x_masked, y_masked, hl_masked = apply_mask(
+ [x, y, hl], lims & everymask)
+ # As above, we set the dependent data in a second step.
+ line = mlines.Line2D(x_masked, y_masked,
+ marker=hlmarker, **eb_cap_style)
+ line.set(**{f"{dep_axis}data": hl_masked})
+ caplines[dep_axis].append(line)
+ if capsize > 0:
+ caplines[dep_axis].append(mlines.Line2D(
+ x_masked, y_masked, marker=marker, **eb_cap_style))
+ if self.name == 'polar':
+ trans_shift = self.transShift
+ for axis in caplines:
+ for l in caplines[axis]:
+ # Rotate caps to be perpendicular to the error bars
+ for theta, r in zip(l.get_xdata(), l.get_ydata()):
+ rotation = _ScaledRotation(theta=theta, trans_shift=trans_shift)
+ if axis == 'y':
+ rotation += mtransforms.Affine2D().rotate(np.pi / 2)
+ ms = mmarkers.MarkerStyle(marker=marker,
+ transform=rotation)
+ self.add_line(mlines.Line2D([theta], [r], marker=ms,
+ **eb_cap_style))
+ else:
+ for axis in caplines:
+ for l in caplines[axis]:
+ self.add_line(l)
+
+ self._request_autoscale_view()
+ caplines = caplines['x'] + caplines['y']
+ errorbar_container = ErrorbarContainer(
+ (data_line, tuple(caplines), tuple(barcols)),
+ has_xerr=(xerr is not None), has_yerr=(yerr is not None),
+ label=label)
+ self.add_container(errorbar_container)
+
+ return errorbar_container # (l0, caplines, barcols)
+
+ @_api.make_keyword_only("3.10", "notch")
+ @_preprocess_data()
+ @_api.rename_parameter("3.9", "labels", "tick_labels")
+ def boxplot(self, x, notch=None, sym=None, vert=None,
+ orientation='vertical', whis=None, positions=None,
+ widths=None, patch_artist=None, bootstrap=None,
+ usermedians=None, conf_intervals=None,
+ meanline=None, showmeans=None, showcaps=None,
+ showbox=None, showfliers=None, boxprops=None,
+ tick_labels=None, flierprops=None, medianprops=None,
+ meanprops=None, capprops=None, whiskerprops=None,
+ manage_ticks=True, autorange=False, zorder=None,
+ capwidths=None, label=None):
+ """
+ Draw a box and whisker plot.
+
+ The box extends from the first quartile (Q1) to the third
+ quartile (Q3) of the data, with a line at the median.
+ The whiskers extend from the box to the farthest data point
+ lying within 1.5x the inter-quartile range (IQR) from the box.
+ Flier points are those past the end of the whiskers.
+ See https://en.wikipedia.org/wiki/Box_plot for reference.
+
+ .. code-block:: none
+
+ Q1-1.5IQR Q1 median Q3 Q3+1.5IQR
+ |-----:-----|
+ o |--------| : |--------| o o
+ |-----:-----|
+ flier <-----------> fliers
+ IQR
+
+
+ Parameters
+ ----------
+ x : Array or a sequence of vectors.
+ The input data. If a 2D array, a boxplot is drawn for each column
+ in *x*. If a sequence of 1D arrays, a boxplot is drawn for each
+ array in *x*.
+
+ notch : bool, default: :rc:`boxplot.notch`
+ Whether to draw a notched boxplot (`True`), or a rectangular
+ boxplot (`False`). The notches represent the confidence interval
+ (CI) around the median. The documentation for *bootstrap*
+ describes how the locations of the notches are computed by
+ default, but their locations may also be overridden by setting the
+ *conf_intervals* parameter.
+
+ .. note::
+
+ In cases where the values of the CI are less than the
+ lower quartile or greater than the upper quartile, the
+ notches will extend beyond the box, giving it a
+ distinctive "flipped" appearance. This is expected
+ behavior and consistent with other statistical
+ visualization packages.
+
+ sym : str, optional
+ The default symbol for flier points. An empty string ('') hides
+ the fliers. If `None`, then the fliers default to 'b+'. More
+ control is provided by the *flierprops* parameter.
+
+ vert : bool, optional
+ .. deprecated:: 3.11
+ Use *orientation* instead.
+
+ This is a pending deprecation for 3.10, with full deprecation
+ in 3.11 and removal in 3.13.
+ If this is given during the deprecation period, it overrides
+ the *orientation* parameter.
+
+ If True, plots the boxes vertically.
+ If False, plots the boxes horizontally.
+
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
+ If 'horizontal', plots the boxes horizontally.
+ Otherwise, plots the boxes vertically.
+
+ .. versionadded:: 3.10
+
+ whis : float or (float, float), default: 1.5
+ The position of the whiskers.
+
+ If a float, the lower whisker is at the lowest datum above
+ ``Q1 - whis*(Q3-Q1)``, and the upper whisker at the highest datum
+ below ``Q3 + whis*(Q3-Q1)``, where Q1 and Q3 are the first and
+ third quartiles. The default value of ``whis = 1.5`` corresponds
+ to Tukey's original definition of boxplots.
+
+ If a pair of floats, they indicate the percentiles at which to
+ draw the whiskers (e.g., (5, 95)). In particular, setting this to
+ (0, 100) results in whiskers covering the whole range of the data.
+
+ In the edge case where ``Q1 == Q3``, *whis* is automatically set
+ to (0, 100) (cover the whole range of the data) if *autorange* is
+ True.
+
+ Beyond the whiskers, data are considered outliers and are plotted
+ as individual points.
+
+ bootstrap : int, optional
+ Specifies whether to bootstrap the confidence intervals
+ around the median for notched boxplots. If *bootstrap* is
+ None, no bootstrapping is performed, and notches are
+ calculated using a Gaussian-based asymptotic approximation
+ (see McGill, R., Tukey, J.W., and Larsen, W.A., 1978, and
+ Kendall and Stuart, 1967). Otherwise, bootstrap specifies
+ the number of times to bootstrap the median to determine its
+ 95% confidence intervals. Values between 1000 and 10000 are
+ recommended.
+
+ usermedians : 1D array-like, optional
+ A 1D array-like of length ``len(x)``. Each entry that is not
+ `None` forces the value of the median for the corresponding
+ dataset. For entries that are `None`, the medians are computed
+ by Matplotlib as normal.
+
+ conf_intervals : array-like, optional
+ A 2D array-like of shape ``(len(x), 2)``. Each entry that is not
+ None forces the location of the corresponding notch (which is
+ only drawn if *notch* is `True`). For entries that are `None`,
+ the notches are computed by the method specified by the other
+ parameters (e.g., *bootstrap*).
+
+ positions : array-like, optional
+ The positions of the boxes. The ticks and limits are
+ automatically set to match the positions. Defaults to
+ ``range(1, N+1)`` where N is the number of boxes to be drawn.
+
+ widths : float or array-like
+ The widths of the boxes. The default is 0.5, or ``0.15*(distance
+ between extreme positions)``, if that is smaller.
+
+ patch_artist : bool, default: :rc:`boxplot.patchartist`
+ If `False` produces boxes with the Line2D artist. Otherwise,
+ boxes are drawn with Patch artists.
+
+ tick_labels : list of str, optional
+ The tick labels of each boxplot.
+ Ticks are always placed at the box *positions*. If *tick_labels* is given,
+ the ticks are labelled accordingly. Otherwise, they keep their numeric
+ values.
+
+ .. versionchanged:: 3.9
+ Renamed from *labels*, which is deprecated since 3.9
+ and will be removed in 3.11.
+
+ manage_ticks : bool, default: True
+ If True, the tick locations and labels will be adjusted to match
+ the boxplot positions.
+
+ autorange : bool, default: False
+ When `True` and the data are distributed such that the 25th and
+ 75th percentiles are equal, *whis* is set to (0, 100) such
+ that the whisker ends are at the minimum and maximum of the data.
+
+ meanline : bool, default: :rc:`boxplot.meanline`
+ If `True` (and *showmeans* is `True`), will try to render the
+ mean as a line spanning the full width of the box according to
+ *meanprops* (see below). Not recommended if *shownotches* is also
+ True. Otherwise, means will be shown as points.
+
+ zorder : float, default: ``Line2D.zorder = 2``
+ The zorder of the boxplot.
+
+ Returns
+ -------
+ dict
+ A dictionary mapping each component of the boxplot to a list
+ of the `.Line2D` instances created. That dictionary has the
+ following keys (assuming vertical boxplots):
+
+ - ``boxes``: the main body of the boxplot showing the
+ quartiles and the median's confidence intervals if
+ enabled.
+
+ - ``medians``: horizontal lines at the median of each box.
+
+ - ``whiskers``: the vertical lines extending to the most
+ extreme, non-outlier data points.
+
+ - ``caps``: the horizontal lines at the ends of the
+ whiskers.
+
+ - ``fliers``: points representing data that extend beyond
+ the whiskers (fliers).
+
+ - ``means``: points or lines representing the means.
+
+ Other Parameters
+ ----------------
+ showcaps : bool, default: :rc:`boxplot.showcaps`
+ Show the caps on the ends of whiskers.
+ showbox : bool, default: :rc:`boxplot.showbox`
+ Show the central box.
+ showfliers : bool, default: :rc:`boxplot.showfliers`
+ Show the outliers beyond the caps.
+ showmeans : bool, default: :rc:`boxplot.showmeans`
+ Show the arithmetic means.
+ capprops : dict, default: None
+ The style of the caps.
+ capwidths : float or array, default: None
+ The widths of the caps.
+ boxprops : dict, default: None
+ The style of the box.
+ whiskerprops : dict, default: None
+ The style of the whiskers.
+ flierprops : dict, default: None
+ The style of the fliers.
+ medianprops : dict, default: None
+ The style of the median.
+ meanprops : dict, default: None
+ The style of the mean.
+ label : str or list of str, optional
+ Legend labels. Use a single string when all boxes have the same style and
+ you only want a single legend entry for them. Use a list of strings to
+ label all boxes individually. To be distinguishable, the boxes should be
+ styled individually, which is currently only possible by modifying the
+ returned artists, see e.g. :doc:`/gallery/statistics/boxplot_demo`.
+
+ In the case of a single string, the legend entry will technically be
+ associated with the first box only. By default, the legend will show the
+ median line (``result["medians"]``); if *patch_artist* is True, the legend
+ will show the box `.Patch` artists (``result["boxes"]``) instead.
+
+ .. versionadded:: 3.9
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ See Also
+ --------
+ .Axes.bxp : Draw a boxplot from pre-computed statistics.
+ violinplot : Draw an estimate of the probability density function.
+ """
+
+ # Missing arguments default to rcParams.
+ if whis is None:
+ whis = mpl.rcParams['boxplot.whiskers']
+ if bootstrap is None:
+ bootstrap = mpl.rcParams['boxplot.bootstrap']
+
+ bxpstats = cbook.boxplot_stats(x, whis=whis, bootstrap=bootstrap,
+ labels=tick_labels, autorange=autorange)
+ if notch is None:
+ notch = mpl.rcParams['boxplot.notch']
+ if patch_artist is None:
+ patch_artist = mpl.rcParams['boxplot.patchartist']
+ if meanline is None:
+ meanline = mpl.rcParams['boxplot.meanline']
+ if showmeans is None:
+ showmeans = mpl.rcParams['boxplot.showmeans']
+ if showcaps is None:
+ showcaps = mpl.rcParams['boxplot.showcaps']
+ if showbox is None:
+ showbox = mpl.rcParams['boxplot.showbox']
+ if showfliers is None:
+ showfliers = mpl.rcParams['boxplot.showfliers']
+
+ if boxprops is None:
+ boxprops = {}
+ if whiskerprops is None:
+ whiskerprops = {}
+ if capprops is None:
+ capprops = {}
+ if medianprops is None:
+ medianprops = {}
+ if meanprops is None:
+ meanprops = {}
+ if flierprops is None:
+ flierprops = {}
+
+ if patch_artist:
+ boxprops['linestyle'] = 'solid' # Not consistent with bxp.
+ if 'color' in boxprops:
+ boxprops['edgecolor'] = boxprops.pop('color')
+
+ # if non-default sym value, put it into the flier dictionary
+ # the logic for providing the default symbol ('b+') now lives
+ # in bxp in the initial value of flierkw
+ # handle all of the *sym* related logic here so we only have to pass
+ # on the flierprops dict.
+ if sym is not None:
+ # no-flier case, which should really be done with
+ # 'showfliers=False' but none-the-less deal with it to keep back
+ # compatibility
+ if sym == '':
+ # blow away existing dict and make one for invisible markers
+ flierprops = dict(linestyle='none', marker='', color='none')
+ # turn the fliers off just to be safe
+ showfliers = False
+ # now process the symbol string
+ else:
+ # process the symbol string
+ # discarded linestyle
+ _, marker, color = _process_plot_format(sym)
+ # if we have a marker, use it
+ if marker is not None:
+ flierprops['marker'] = marker
+ # if we have a color, use it
+ if color is not None:
+ # assume that if color is passed in the user want
+ # filled symbol, if the users want more control use
+ # flierprops
+ flierprops['color'] = color
+ flierprops['markerfacecolor'] = color
+ flierprops['markeredgecolor'] = color
+
+ # replace medians if necessary:
+ if usermedians is not None:
+ if (len(np.ravel(usermedians)) != len(bxpstats) or
+ np.shape(usermedians)[0] != len(bxpstats)):
+ raise ValueError(
+ "'usermedians' and 'x' have different lengths")
+ else:
+ # reassign medians as necessary
+ for stats, med in zip(bxpstats, usermedians):
+ if med is not None:
+ stats['med'] = med
+
+ if conf_intervals is not None:
+ if len(conf_intervals) != len(bxpstats):
+ raise ValueError(
+ "'conf_intervals' and 'x' have different lengths")
+ else:
+ for stats, ci in zip(bxpstats, conf_intervals):
+ if ci is not None:
+ if len(ci) != 2:
+ raise ValueError('each confidence interval must '
+ 'have two values')
+ else:
+ if ci[0] is not None:
+ stats['cilo'] = ci[0]
+ if ci[1] is not None:
+ stats['cihi'] = ci[1]
+
+ artists = self.bxp(bxpstats, positions=positions, widths=widths,
+ vert=vert, patch_artist=patch_artist,
+ shownotches=notch, showmeans=showmeans,
+ showcaps=showcaps, showbox=showbox,
+ boxprops=boxprops, flierprops=flierprops,
+ medianprops=medianprops, meanprops=meanprops,
+ meanline=meanline, showfliers=showfliers,
+ capprops=capprops, whiskerprops=whiskerprops,
+ manage_ticks=manage_ticks, zorder=zorder,
+ capwidths=capwidths, label=label,
+ orientation=orientation)
+ return artists
+
+ @_api.make_keyword_only("3.10", "widths")
+ def bxp(self, bxpstats, positions=None, widths=None, vert=None,
+ orientation='vertical', patch_artist=False, shownotches=False,
+ showmeans=False, showcaps=True, showbox=True, showfliers=True,
+ boxprops=None, whiskerprops=None, flierprops=None,
+ medianprops=None, capprops=None, meanprops=None,
+ meanline=False, manage_ticks=True, zorder=None,
+ capwidths=None, label=None):
+ """
+ Draw a box and whisker plot from pre-computed statistics.
+
+ The box extends from the first quartile *q1* to the third
+ quartile *q3* of the data, with a line at the median (*med*).
+ The whiskers extend from *whislow* to *whishi*.
+ Flier points are markers past the end of the whiskers.
+ See https://en.wikipedia.org/wiki/Box_plot for reference.
+
+ .. code-block:: none
+
+ whislow q1 med q3 whishi
+ |-----:-----|
+ o |--------| : |--------| o o
+ |-----:-----|
+ flier fliers
+
+ .. note::
+ This is a low-level drawing function for when you already
+ have the statistical parameters. If you want a boxplot based
+ on a dataset, use `~.Axes.boxplot` instead.
+
+ Parameters
+ ----------
+ bxpstats : list of dicts
+ A list of dictionaries containing stats for each boxplot.
+ Required keys are:
+
+ - ``med``: Median (float).
+ - ``q1``, ``q3``: First & third quartiles (float).
+ - ``whislo``, ``whishi``: Lower & upper whisker positions (float).
+
+ Optional keys are:
+
+ - ``mean``: Mean (float). Needed if ``showmeans=True``.
+ - ``fliers``: Data beyond the whiskers (array-like).
+ Needed if ``showfliers=True``.
+ - ``cilo``, ``cihi``: Lower & upper confidence intervals
+ about the median. Needed if ``shownotches=True``.
+ - ``label``: Name of the dataset (str). If available,
+ this will be used a tick label for the boxplot
+
+ positions : array-like, default: [1, 2, ..., n]
+ The positions of the boxes. The ticks and limits
+ are automatically set to match the positions.
+
+ widths : float or array-like, default: None
+ The widths of the boxes. The default is
+ ``clip(0.15*(distance between extreme positions), 0.15, 0.5)``.
+
+ capwidths : float or array-like, default: None
+ Either a scalar or a vector and sets the width of each cap.
+ The default is ``0.5*(width of the box)``, see *widths*.
+
+ vert : bool, optional
+ .. deprecated:: 3.11
+ Use *orientation* instead.
+
+ This is a pending deprecation for 3.10, with full deprecation
+ in 3.11 and removal in 3.13.
+ If this is given during the deprecation period, it overrides
+ the *orientation* parameter.
+
+ If True, plots the boxes vertically.
+ If False, plots the boxes horizontally.
+
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
+ If 'horizontal', plots the boxes horizontally.
+ Otherwise, plots the boxes vertically.
+
+ .. versionadded:: 3.10
+
+ patch_artist : bool, default: False
+ If `False` produces boxes with the `.Line2D` artist.
+ If `True` produces boxes with the `~matplotlib.patches.Patch` artist.
+
+ shownotches, showmeans, showcaps, showbox, showfliers : bool
+ Whether to draw the CI notches, the mean value (both default to
+ False), the caps, the box, and the fliers (all three default to
+ True).
+
+ boxprops, whiskerprops, capprops, flierprops, medianprops, meanprops :\
+ dict, optional
+ Artist properties for the boxes, whiskers, caps, fliers, medians, and
+ means.
+
+ meanline : bool, default: False
+ If `True` (and *showmeans* is `True`), will try to render the mean
+ as a line spanning the full width of the box according to
+ *meanprops*. Not recommended if *shownotches* is also True.
+ Otherwise, means will be shown as points.
+
+ manage_ticks : bool, default: True
+ If True, the tick locations and labels will be adjusted to match the
+ boxplot positions.
+
+ label : str or list of str, optional
+ Legend labels. Use a single string when all boxes have the same style and
+ you only want a single legend entry for them. Use a list of strings to
+ label all boxes individually. To be distinguishable, the boxes should be
+ styled individually, which is currently only possible by modifying the
+ returned artists, see e.g. :doc:`/gallery/statistics/boxplot_demo`.
+
+ In the case of a single string, the legend entry will technically be
+ associated with the first box only. By default, the legend will show the
+ median line (``result["medians"]``); if *patch_artist* is True, the legend
+ will show the box `.Patch` artists (``result["boxes"]``) instead.
+
+ .. versionadded:: 3.9
+
+ zorder : float, default: ``Line2D.zorder = 2``
+ The zorder of the resulting boxplot.
+
+ Returns
+ -------
+ dict
+ A dictionary mapping each component of the boxplot to a list
+ of the `.Line2D` instances created. That dictionary has the
+ following keys (assuming vertical boxplots):
+
+ - ``boxes``: main bodies of the boxplot showing the quartiles, and
+ the median's confidence intervals if enabled.
+ - ``medians``: horizontal lines at the median of each box.
+ - ``whiskers``: vertical lines up to the last non-outlier data.
+ - ``caps``: horizontal lines at the ends of the whiskers.
+ - ``fliers``: points representing data beyond the whiskers (fliers).
+ - ``means``: points or lines representing the means.
+
+ See Also
+ --------
+ boxplot : Draw a boxplot from data instead of pre-computed statistics.
+ """
+ # Clamp median line to edge of box by default.
+ medianprops = {
+ "solid_capstyle": "butt",
+ "dash_capstyle": "butt",
+ **(medianprops or {}),
+ }
+ meanprops = {
+ "solid_capstyle": "butt",
+ "dash_capstyle": "butt",
+ **(meanprops or {}),
+ }
+
+ # lists of artists to be output
+ whiskers = []
+ caps = []
+ boxes = []
+ medians = []
+ means = []
+ fliers = []
+
+ # empty list of xticklabels
+ datalabels = []
+
+ # Use default zorder if none specified
+ if zorder is None:
+ zorder = mlines.Line2D.zorder
+
+ zdelta = 0.1
+
+ def merge_kw_rc(subkey, explicit, zdelta=0, usemarker=True):
+ d = {k.split('.')[-1]: v for k, v in mpl.rcParams.items()
+ if k.startswith(f'boxplot.{subkey}props')}
+ d['zorder'] = zorder + zdelta
+ if not usemarker:
+ d['marker'] = ''
+ d.update(cbook.normalize_kwargs(explicit, mlines.Line2D))
+ return d
+
+ box_kw = {
+ 'linestyle': mpl.rcParams['boxplot.boxprops.linestyle'],
+ 'linewidth': mpl.rcParams['boxplot.boxprops.linewidth'],
+ 'edgecolor': mpl.rcParams['boxplot.boxprops.color'],
+ 'facecolor': ('white' if mpl.rcParams['_internal.classic_mode']
+ else mpl.rcParams['patch.facecolor']),
+ 'zorder': zorder,
+ **cbook.normalize_kwargs(boxprops, mpatches.PathPatch)
+ } if patch_artist else merge_kw_rc('box', boxprops, usemarker=False)
+ whisker_kw = merge_kw_rc('whisker', whiskerprops, usemarker=False)
+ cap_kw = merge_kw_rc('cap', capprops, usemarker=False)
+ flier_kw = merge_kw_rc('flier', flierprops)
+ median_kw = merge_kw_rc('median', medianprops, zdelta, usemarker=False)
+ mean_kw = merge_kw_rc('mean', meanprops, zdelta)
+ removed_prop = 'marker' if meanline else 'linestyle'
+ # Only remove the property if it's not set explicitly as a parameter.
+ if meanprops is None or removed_prop not in meanprops:
+ mean_kw[removed_prop] = ''
+
+ # vert and orientation parameters are linked until vert's
+ # deprecation period expires. vert only takes precedence
+ # if set to False.
+ if vert is None:
+ vert = mpl.rcParams['boxplot.vertical']
+ else:
+ _api.warn_deprecated(
+ "3.11",
+ name="vert: bool",
+ alternative="orientation: {'vertical', 'horizontal'}",
+ pending=True,
+ )
+ if vert is False:
+ orientation = 'horizontal'
+ _api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
+
+ if not mpl.rcParams['boxplot.vertical']:
+ _api.warn_deprecated(
+ "3.10",
+ name='boxplot.vertical', obj_type="rcparam"
+ )
+
+ # vertical or horizontal plot?
+ maybe_swap = slice(None) if orientation == 'vertical' else slice(None, None, -1)
+
+ def do_plot(xs, ys, **kwargs):
+ return self.plot(*[xs, ys][maybe_swap], **kwargs)[0]
+
+ def do_patch(xs, ys, **kwargs):
+ path = mpath.Path._create_closed(
+ np.column_stack([xs, ys][maybe_swap]))
+ patch = mpatches.PathPatch(path, **kwargs)
+ self.add_artist(patch)
+ return patch
+
+ # input validation
+ N = len(bxpstats)
+ datashape_message = ("List of boxplot statistics and `{0}` "
+ "values must have same the length")
+ # check position
+ if positions is None:
+ positions = list(range(1, N + 1))
+ elif len(positions) != N:
+ raise ValueError(datashape_message.format("positions"))
+
+ positions = np.array(positions)
+ if len(positions) > 0 and not all(isinstance(p, Real) for p in positions):
+ raise TypeError("positions should be an iterable of numbers")
+
+ # width
+ if widths is None:
+ widths = [np.clip(0.15 * np.ptp(positions), 0.15, 0.5)] * N
+ elif np.isscalar(widths):
+ widths = [widths] * N
+ elif len(widths) != N:
+ raise ValueError(datashape_message.format("widths"))
+
+ # capwidth
+ if capwidths is None:
+ capwidths = 0.5 * np.array(widths)
+ elif np.isscalar(capwidths):
+ capwidths = [capwidths] * N
+ elif len(capwidths) != N:
+ raise ValueError(datashape_message.format("capwidths"))
+
+ for pos, width, stats, capwidth in zip(positions, widths, bxpstats,
+ capwidths):
+ # try to find a new label
+ datalabels.append(stats.get('label', pos))
+
+ # whisker coords
+ whis_x = [pos, pos]
+ whislo_y = [stats['q1'], stats['whislo']]
+ whishi_y = [stats['q3'], stats['whishi']]
+ # cap coords
+ cap_left = pos - capwidth * 0.5
+ cap_right = pos + capwidth * 0.5
+ cap_x = [cap_left, cap_right]
+ cap_lo = np.full(2, stats['whislo'])
+ cap_hi = np.full(2, stats['whishi'])
+ # box and median coords
+ box_left = pos - width * 0.5
+ box_right = pos + width * 0.5
+ med_y = [stats['med'], stats['med']]
+ # notched boxes
+ if shownotches:
+ notch_left = pos - width * 0.25
+ notch_right = pos + width * 0.25
+ box_x = [box_left, box_right, box_right, notch_right,
+ box_right, box_right, box_left, box_left, notch_left,
+ box_left, box_left]
+ box_y = [stats['q1'], stats['q1'], stats['cilo'],
+ stats['med'], stats['cihi'], stats['q3'],
+ stats['q3'], stats['cihi'], stats['med'],
+ stats['cilo'], stats['q1']]
+ med_x = [notch_left, notch_right]
+ # plain boxes
+ else:
+ box_x = [box_left, box_right, box_right, box_left, box_left]
+ box_y = [stats['q1'], stats['q1'], stats['q3'], stats['q3'],
+ stats['q1']]
+ med_x = [box_left, box_right]
+
+ # maybe draw the box
+ if showbox:
+ do_box = do_patch if patch_artist else do_plot
+ boxes.append(do_box(box_x, box_y, **box_kw))
+ median_kw.setdefault('label', '_nolegend_')
+ # draw the whiskers
+ whisker_kw.setdefault('label', '_nolegend_')
+ whiskers.append(do_plot(whis_x, whislo_y, **whisker_kw))
+ whiskers.append(do_plot(whis_x, whishi_y, **whisker_kw))
+ # maybe draw the caps
+ if showcaps:
+ cap_kw.setdefault('label', '_nolegend_')
+ caps.append(do_plot(cap_x, cap_lo, **cap_kw))
+ caps.append(do_plot(cap_x, cap_hi, **cap_kw))
+ # draw the medians
+ medians.append(do_plot(med_x, med_y, **median_kw))
+ # maybe draw the means
+ if showmeans:
+ if meanline:
+ means.append(do_plot(
+ [box_left, box_right], [stats['mean'], stats['mean']],
+ **mean_kw
+ ))
+ else:
+ means.append(do_plot([pos], [stats['mean']], **mean_kw))
+ # maybe draw the fliers
+ if showfliers:
+ flier_kw.setdefault('label', '_nolegend_')
+ flier_x = np.full(len(stats['fliers']), pos, dtype=np.float64)
+ flier_y = stats['fliers']
+ fliers.append(do_plot(flier_x, flier_y, **flier_kw))
+
+ # Set legend labels
+ if label:
+ box_or_med = boxes if showbox and patch_artist else medians
+ if cbook.is_scalar_or_string(label):
+ # assign the label only to the first box
+ box_or_med[0].set_label(label)
+ else: # label is a sequence
+ if len(box_or_med) != len(label):
+ raise ValueError(datashape_message.format("label"))
+ for artist, lbl in zip(box_or_med, label):
+ artist.set_label(lbl)
+
+ if manage_ticks:
+ axis_name = "x" if orientation == 'vertical' else "y"
+ interval = getattr(self.dataLim, f"interval{axis_name}")
+ axis = self._axis_map[axis_name]
+ positions = axis.convert_units(positions)
+ # The 0.5 additional padding ensures reasonable-looking boxes
+ # even when drawing a single box. We set the sticky edge to
+ # prevent margins expansion, in order to match old behavior (back
+ # when separate calls to boxplot() would completely reset the axis
+ # limits regardless of what was drawn before). The sticky edges
+ # are attached to the median lines, as they are always present.
+ interval[:] = (min(interval[0], min(positions) - .5),
+ max(interval[1], max(positions) + .5))
+ for median, position in zip(medians, positions):
+ getattr(median.sticky_edges, axis_name).extend(
+ [position - .5, position + .5])
+ # Modified from Axis.set_ticks and Axis.set_ticklabels.
+ locator = axis.get_major_locator()
+ if not isinstance(axis.get_major_locator(),
+ mticker.FixedLocator):
+ locator = mticker.FixedLocator([])
+ axis.set_major_locator(locator)
+ locator.locs = np.array([*locator.locs, *positions])
+ formatter = axis.get_major_formatter()
+ if not isinstance(axis.get_major_formatter(),
+ mticker.FixedFormatter):
+ formatter = mticker.FixedFormatter([])
+ axis.set_major_formatter(formatter)
+ formatter.seq = [*formatter.seq, *datalabels]
+
+ self._request_autoscale_view()
+
+ return dict(whiskers=whiskers, caps=caps, boxes=boxes,
+ medians=medians, fliers=fliers, means=means)
+
+ @staticmethod
+ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
+ get_next_color_func):
+ """
+ Helper function to process color related arguments of `.Axes.scatter`.
+
+ Argument precedence for facecolors:
+
+ - c (if not None)
+ - kwargs['facecolor']
+ - kwargs['facecolors']
+ - kwargs['color'] (==kwcolor)
+ - 'b' if in classic mode else the result of ``get_next_color_func()``
+
+ Argument precedence for edgecolors:
+
+ - kwargs['edgecolor']
+ - edgecolors (is an explicit kw argument in scatter())
+ - kwargs['color'] (==kwcolor)
+ - 'face' if not in classic mode else None
+
+ Parameters
+ ----------
+ c : :mpltype:`color` or array-like or list of :mpltype:`color` or None
+ See argument description of `.Axes.scatter`.
+ edgecolors : :mpltype:`color` or sequence of color or {'face', 'none'} or None
+ See argument description of `.Axes.scatter`.
+ kwargs : dict
+ Additional kwargs. If these keys exist, we pop and process them:
+ 'facecolors', 'facecolor', 'edgecolor', 'color'
+ Note: The dict is modified by this function.
+ xsize : int
+ The size of the x and y arrays passed to `.Axes.scatter`.
+ get_next_color_func : callable
+ A callable that returns a color. This color is used as facecolor
+ if no other color is provided.
+
+ Note, that this is a function rather than a fixed color value to
+ support conditional evaluation of the next color. As of the
+ current implementation obtaining the next color from the
+ property cycle advances the cycle. This must only happen if we
+ actually use the color, which will only be decided within this
+ method.
+
+ Returns
+ -------
+ c
+ The input *c* if it was not *None*, else a color derived from the
+ other inputs or defaults.
+ colors : array(N, 4) or None
+ The facecolors as RGBA values, or *None* if a colormap is used.
+ edgecolors
+ The edgecolor.
+
+ """
+ facecolors = kwargs.pop('facecolors', None)
+ facecolors = kwargs.pop('facecolor', facecolors)
+ edgecolors = kwargs.pop('edgecolor', edgecolors)
+
+ kwcolor = kwargs.pop('color', None)
+
+ if kwcolor is not None and c is not None:
+ raise ValueError("Supply a 'c' argument or a 'color'"
+ " kwarg but not both; they differ but"
+ " their functionalities overlap.")
+
+ if kwcolor is not None:
+ try:
+ mcolors.to_rgba_array(kwcolor)
+ except ValueError as err:
+ raise ValueError(
+ "'color' kwarg must be a color or sequence of color "
+ "specs. For a sequence of values to be color-mapped, use "
+ "the 'c' argument instead.") from err
+ if edgecolors is None:
+ edgecolors = kwcolor
+ if facecolors is None:
+ facecolors = kwcolor
+
+ if edgecolors is None and not mpl.rcParams['_internal.classic_mode']:
+ edgecolors = mpl.rcParams['scatter.edgecolors']
+
+ # Raise a warning if both `c` and `facecolor` are set (issue #24404).
+ if c is not None and facecolors is not None:
+ _api.warn_external(
+ "You passed both c and facecolor/facecolors for the markers. "
+ "c has precedence over facecolor/facecolors. "
+ "This behavior may change in the future."
+ )
+
+ c_was_none = c is None
+ if c is None:
+ c = (facecolors if facecolors is not None
+ else "b" if mpl.rcParams['_internal.classic_mode']
+ else get_next_color_func())
+ c_is_string_or_strings = (
+ isinstance(c, str)
+ or (np.iterable(c) and len(c) > 0
+ and isinstance(cbook._safe_first_finite(c), str)))
+
+ def invalid_shape_exception(csize, xsize):
+ return ValueError(
+ f"'c' argument has {csize} elements, which is inconsistent "
+ f"with 'x' and 'y' with size {xsize}.")
+
+ c_is_mapped = False # Unless proven otherwise below.
+ valid_shape = True # Unless proven otherwise below.
+ if not c_was_none and kwcolor is None and not c_is_string_or_strings:
+ try: # First, does 'c' look suitable for value-mapping?
+ c = np.asanyarray(c, dtype=float)
+ except ValueError:
+ pass # Failed to convert to float array; must be color specs.
+ else:
+ # handle the documented special case of a 2D array with 1
+ # row which as RGB(A) to broadcast.
+ if c.shape == (1, 4) or c.shape == (1, 3):
+ c_is_mapped = False
+ if c.size != xsize:
+ valid_shape = False
+ # If c can be either mapped values or an RGB(A) color, prefer
+ # the former if shapes match, the latter otherwise.
+ elif c.size == xsize:
+ c = c.ravel()
+ c_is_mapped = True
+ else: # Wrong size; it must not be intended for mapping.
+ if c.shape in ((3,), (4,)):
+ _api.warn_external(
+ "*c* argument looks like a single numeric RGB or "
+ "RGBA sequence, which should be avoided as value-"
+ "mapping will have precedence in case its length "
+ "matches with *x* & *y*. Please use the *color* "
+ "keyword-argument or provide a 2D array "
+ "with a single row if you intend to specify "
+ "the same RGB or RGBA value for all points.")
+ valid_shape = False
+ if not c_is_mapped:
+ try: # Is 'c' acceptable as PathCollection facecolors?
+ colors = mcolors.to_rgba_array(c)
+ except (TypeError, ValueError) as err:
+ if "RGBA values should be within 0-1 range" in str(err):
+ raise
+ else:
+ if not valid_shape:
+ raise invalid_shape_exception(c.size, xsize) from err
+ # Both the mapping *and* the RGBA conversion failed: pretty
+ # severe failure => one may appreciate a verbose feedback.
+ raise ValueError(
+ f"'c' argument must be a color, a sequence of colors, "
+ f"or a sequence of numbers, not {c!r}") from err
+ else:
+ if len(colors) not in (0, 1, xsize):
+ # NB: remember that a single color is also acceptable.
+ # Besides *colors* will be an empty array if c == 'none'.
+ raise invalid_shape_exception(len(colors), xsize)
+ else:
+ colors = None # use cmap, norm after collection is created
+ return c, colors, edgecolors
+
+ @_api.make_keyword_only("3.10", "marker")
+ @_preprocess_data(replace_names=["x", "y", "s", "linewidths",
+ "edgecolors", "c", "facecolor",
+ "facecolors", "color"],
+ label_namer="y")
+ @_docstring.interpd
+ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
+ vmin=None, vmax=None, alpha=None, linewidths=None, *,
+ edgecolors=None, colorizer=None, plotnonfinite=False, **kwargs):
+ """
+ A scatter plot of *y* vs. *x* with varying marker size and/or color.
+
+ Parameters
+ ----------
+ x, y : float or array-like, shape (n, )
+ The data positions.
+
+ s : float or array-like, shape (n, ), optional
+ The marker size in points**2 (typographic points are 1/72 in.).
+ Default is ``rcParams['lines.markersize'] ** 2``.
+
+ The linewidth and edgecolor can visually interact with the marker
+ size, and can lead to artifacts if the marker size is smaller than
+ the linewidth.
+
+ If the linewidth is greater than 0 and the edgecolor is anything
+ but *'none'*, then the effective size of the marker will be
+ increased by half the linewidth because the stroke will be centered
+ on the edge of the shape.
+
+ To eliminate the marker edge either set *linewidth=0* or
+ *edgecolor='none'*.
+
+ c : array-like or list of :mpltype:`color` or :mpltype:`color`, optional
+ The marker colors. Possible values:
+
+ - A scalar or sequence of n numbers to be mapped to colors using
+ *cmap* and *norm*.
+ - A 2D array in which the rows are RGB or RGBA.
+ - A sequence of colors of length n.
+ - A single color format string.
+
+ Note that *c* should not be a single numeric RGB or RGBA sequence
+ because that is indistinguishable from an array of values to be
+ colormapped. If you want to specify the same RGB or RGBA value for
+ all points, use a 2D array with a single row. Otherwise,
+ value-matching will have precedence in case of a size matching with
+ *x* and *y*.
+
+ If you wish to specify a single color for all points
+ prefer the *color* keyword argument.
+
+ Defaults to `None`. In that case the marker color is determined
+ by the value of *color*, *facecolor* or *facecolors*. In case
+ those are not specified or `None`, the marker color is determined
+ by the next color of the ``Axes``' current "shape and fill" color
+ cycle. This cycle defaults to :rc:`axes.prop_cycle`.
+
+ marker : `~.markers.MarkerStyle`, default: :rc:`scatter.marker`
+ The marker style. *marker* can be either an instance of the class
+ or the text shorthand for a particular marker.
+ See :mod:`matplotlib.markers` for more information about marker
+ styles.
+
+ %(cmap_doc)s
+
+ This parameter is ignored if *c* is RGB(A).
+
+ %(norm_doc)s
+
+ This parameter is ignored if *c* is RGB(A).
+
+ %(vmin_vmax_doc)s
+
+ This parameter is ignored if *c* is RGB(A).
+
+ alpha : float, default: None
+ The alpha blending value, between 0 (transparent) and 1 (opaque).
+
+ linewidths : float or array-like, default: :rc:`lines.linewidth`
+ The linewidth of the marker edges. Note: The default *edgecolors*
+ is 'face'. You may want to change this as well.
+
+ edgecolors : {'face', 'none', *None*} or :mpltype:`color` or list of \
+:mpltype:`color`, default: :rc:`scatter.edgecolors`
+ The edge color of the marker. Possible values:
+
+ - 'face': The edge color will always be the same as the face color.
+ - 'none': No patch boundary will be drawn.
+ - A color or sequence of colors.
+
+ For non-filled markers, *edgecolors* is ignored. Instead, the color
+ is determined like with 'face', i.e. from *c*, *colors*, or
+ *facecolors*.
+
+ %(colorizer_doc)s
+
+ This parameter is ignored if *c* is RGB(A).
+
+ plotnonfinite : bool, default: False
+ Whether to plot points with nonfinite *c* (i.e. ``inf``, ``-inf``
+ or ``nan``). If ``True`` the points are drawn with the *bad*
+ colormap color (see `.Colormap.set_bad`).
+
+ Returns
+ -------
+ `~matplotlib.collections.PathCollection`
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+ **kwargs : `~matplotlib.collections.PathCollection` properties
+ %(PathCollection:kwdoc)s
+
+ See Also
+ --------
+ plot : To plot scatter plots when markers are identical in size and
+ color.
+
+ Notes
+ -----
+ * The `.plot` function will be faster for scatterplots where markers
+ don't vary in size or color.
+
+ * Any or all of *x*, *y*, *s*, and *c* may be masked arrays, in which
+ case all masks will be combined and only unmasked points will be
+ plotted.
+
+ * Fundamentally, scatter works with 1D arrays; *x*, *y*, *s*, and *c*
+ may be input as N-D arrays, but within scatter they will be
+ flattened. The exception is *c*, which will be flattened only if its
+ size matches the size of *x* and *y*.
+
+ """
+ # add edgecolors and linewidths to kwargs so they
+ # can be processed by normailze_kwargs
+ if edgecolors is not None:
+ kwargs.update({'edgecolors': edgecolors})
+ if linewidths is not None:
+ kwargs.update({'linewidths': linewidths})
+
+ kwargs = cbook.normalize_kwargs(kwargs, mcoll.Collection)
+ # re direct linewidth and edgecolor so it can be
+ # further processed by the rest of the function
+ linewidths = kwargs.pop('linewidth', None)
+ edgecolors = kwargs.pop('edgecolor', None)
+ # Process **kwargs to handle aliases, conflicts with explicit kwargs:
+ x, y = self._process_unit_info([("x", x), ("y", y)], kwargs)
+ # np.ma.ravel yields an ndarray, not a masked array,
+ # unless its argument is a masked array.
+ x = np.ma.ravel(x)
+ y = np.ma.ravel(y)
+ if x.size != y.size:
+ raise ValueError("x and y must be the same size")
+
+ if s is None:
+ s = (20 if mpl.rcParams['_internal.classic_mode'] else
+ mpl.rcParams['lines.markersize'] ** 2.0)
+ s = np.ma.ravel(s)
+ if (len(s) not in (1, x.size) or
+ (not np.issubdtype(s.dtype, np.floating) and
+ not np.issubdtype(s.dtype, np.integer))):
+ raise ValueError(
+ "s must be a scalar, "
+ "or float array-like with the same size as x and y")
+
+ # get the original edgecolor the user passed before we normalize
+ orig_edgecolor = edgecolors
+ if edgecolors is None:
+ orig_edgecolor = kwargs.get('edgecolor', None)
+ c, colors, edgecolors = \
+ self._parse_scatter_color_args(
+ c, edgecolors, kwargs, x.size,
+ get_next_color_func=self._get_patches_for_fill.get_next_color)
+
+ if plotnonfinite and colors is None:
+ c = np.ma.masked_invalid(c)
+ x, y, s, edgecolors, linewidths = \
+ cbook._combine_masks(x, y, s, edgecolors, linewidths)
+ else:
+ x, y, s, c, colors, edgecolors, linewidths = \
+ cbook._combine_masks(
+ x, y, s, c, colors, edgecolors, linewidths)
+ # Unmask edgecolors if it was actually a single RGB or RGBA.
+ if (x.size in (3, 4)
+ and np.ma.is_masked(edgecolors)
+ and not np.ma.is_masked(orig_edgecolor)):
+ edgecolors = edgecolors.data
+
+ scales = s # Renamed for readability below.
+
+ # load default marker from rcParams
+ if marker is None:
+ marker = mpl.rcParams['scatter.marker']
+
+ if isinstance(marker, mmarkers.MarkerStyle):
+ marker_obj = marker
+ else:
+ marker_obj = mmarkers.MarkerStyle(marker)
+
+ path = marker_obj.get_path().transformed(
+ marker_obj.get_transform())
+ if not marker_obj.is_filled():
+ if orig_edgecolor is not None:
+ _api.warn_external(
+ f"You passed a edgecolor/edgecolors ({orig_edgecolor!r}) "
+ f"for an unfilled marker ({marker!r}). Matplotlib is "
+ "ignoring the edgecolor in favor of the facecolor. This "
+ "behavior may change in the future."
+ )
+ # We need to handle markers that cannot be filled (like
+ # '+' and 'x') differently than markers that can be
+ # filled, but have their fillstyle set to 'none'. This is
+ # to get:
+ #
+ # - respecting the fillestyle if set
+ # - maintaining back-compatibility for querying the facecolor of
+ # the un-fillable markers.
+ #
+ # While not an ideal situation, but is better than the
+ # alternatives.
+ if marker_obj.get_fillstyle() == 'none':
+ # promote the facecolor to be the edgecolor
+ edgecolors = colors
+ # set the facecolor to 'none' (at the last chance) because
+ # we cannot fill a path if the facecolor is non-null
+ # (which is defendable at the renderer level).
+ colors = 'none'
+ else:
+ # if we are not nulling the face color we can do this
+ # simpler
+ edgecolors = 'face'
+
+ if linewidths is None:
+ linewidths = mpl.rcParams['lines.linewidth']
+ elif np.iterable(linewidths):
+ linewidths = [
+ lw if lw is not None else mpl.rcParams['lines.linewidth']
+ for lw in linewidths]
+
+ offsets = np.ma.column_stack([x, y])
+
+ collection = mcoll.PathCollection(
+ (path,), scales,
+ facecolors=colors,
+ edgecolors=edgecolors,
+ linewidths=linewidths,
+ offsets=offsets,
+ offset_transform=kwargs.pop('transform', self.transData),
+ alpha=alpha,
+ )
+ collection.set_transform(mtransforms.IdentityTransform())
+ if colors is None:
+ if colorizer:
+ collection._set_colorizer_check_keywords(colorizer, cmap=cmap,
+ norm=norm, vmin=vmin,
+ vmax=vmax)
+ else:
+ collection.set_cmap(cmap)
+ collection.set_norm(norm)
+ collection.set_array(c)
+ collection._scale_norm(norm, vmin, vmax)
+ else:
+ extra_kwargs = {
+ 'cmap': cmap, 'norm': norm, 'vmin': vmin, 'vmax': vmax
+ }
+ extra_keys = [k for k, v in extra_kwargs.items() if v is not None]
+ if any(extra_keys):
+ keys_str = ", ".join(f"'{k}'" for k in extra_keys)
+ _api.warn_external(
+ "No data for colormapping provided via 'c'. "
+ f"Parameters {keys_str} will be ignored")
+ collection._internal_update(kwargs)
+
+ # Classic mode only:
+ # ensure there are margins to allow for the
+ # finite size of the symbols. In v2.x, margins
+ # are present by default, so we disable this
+ # scatter-specific override.
+ if mpl.rcParams['_internal.classic_mode']:
+ if self._xmargin < 0.05 and x.size > 0:
+ self.set_xmargin(0.05)
+ if self._ymargin < 0.05 and x.size > 0:
+ self.set_ymargin(0.05)
+
+ self.add_collection(collection)
+ self._request_autoscale_view()
+
+ return collection
+
+ @_api.make_keyword_only("3.10", "gridsize")
+ @_preprocess_data(replace_names=["x", "y", "C"], label_namer="y")
+ @_docstring.interpd
+ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
+ xscale='linear', yscale='linear', extent=None,
+ cmap=None, norm=None, vmin=None, vmax=None,
+ alpha=None, linewidths=None, edgecolors='face',
+ reduce_C_function=np.mean, mincnt=None, marginals=False,
+ colorizer=None, **kwargs):
+ """
+ Make a 2D hexagonal binning plot of points *x*, *y*.
+
+ If *C* is *None*, the value of the hexagon is determined by the number
+ of points in the hexagon. Otherwise, *C* specifies values at the
+ coordinate (x[i], y[i]). For each hexagon, these values are reduced
+ using *reduce_C_function*.
+
+ Parameters
+ ----------
+ x, y : array-like
+ The data positions. *x* and *y* must be of the same length.
+
+ C : array-like, optional
+ If given, these values are accumulated in the bins. Otherwise,
+ every point has a value of 1. Must be of the same length as *x*
+ and *y*.
+
+ gridsize : int or (int, int), default: 100
+ If a single int, the number of hexagons in the *x*-direction.
+ The number of hexagons in the *y*-direction is chosen such that
+ the hexagons are approximately regular.
+
+ Alternatively, if a tuple (*nx*, *ny*), the number of hexagons
+ in the *x*-direction and the *y*-direction. In the
+ *y*-direction, counting is done along vertically aligned
+ hexagons, not along the zig-zag chains of hexagons; see the
+ following illustration.
+
+ .. plot::
+
+ import numpy
+ import matplotlib.pyplot as plt
+
+ np.random.seed(19680801)
+ n= 300
+ x = np.random.standard_normal(n)
+ y = np.random.standard_normal(n)
+
+ fig, ax = plt.subplots(figsize=(4, 4))
+ h = ax.hexbin(x, y, gridsize=(5, 3))
+ hx, hy = h.get_offsets().T
+ ax.plot(hx[24::3], hy[24::3], 'ro-')
+ ax.plot(hx[-3:], hy[-3:], 'ro-')
+ ax.set_title('gridsize=(5, 3)')
+ ax.axis('off')
+
+ To get approximately regular hexagons, choose
+ :math:`n_x = \\sqrt{3}\\,n_y`.
+
+ bins : 'log' or int or sequence, default: None
+ Discretization of the hexagon values.
+
+ - If *None*, no binning is applied; the color of each hexagon
+ directly corresponds to its count value.
+ - If 'log', use a logarithmic scale for the colormap.
+ Internally, :math:`log_{10}(i+1)` is used to determine the
+ hexagon color. This is equivalent to ``norm=LogNorm()``.
+ - If an integer, divide the counts in the specified number
+ of bins, and color the hexagons accordingly.
+ - If a sequence of values, the values of the lower bound of
+ the bins to be used.
+
+ xscale : {'linear', 'log'}, default: 'linear'
+ Use a linear or log10 scale on the horizontal axis.
+
+ yscale : {'linear', 'log'}, default: 'linear'
+ Use a linear or log10 scale on the vertical axis.
+
+ mincnt : int >= 0, default: *None*
+ If not *None*, only display cells with at least *mincnt*
+ number of points in the cell.
+
+ marginals : bool, default: *False*
+ If marginals is *True*, plot the marginal density as
+ colormapped rectangles along the bottom of the x-axis and
+ left of the y-axis.
+
+ extent : 4-tuple of float, default: *None*
+ The limits of the bins (xmin, xmax, ymin, ymax).
+ The default assigns the limits based on
+ *gridsize*, *x*, *y*, *xscale* and *yscale*.
+
+ If *xscale* or *yscale* is set to 'log', the limits are
+ expected to be the exponent for a power of 10. E.g. for
+ x-limits of 1 and 50 in 'linear' scale and y-limits
+ of 10 and 1000 in 'log' scale, enter (1, 50, 1, 3).
+
+ Returns
+ -------
+ `~matplotlib.collections.PolyCollection`
+ A `.PolyCollection` defining the hexagonal bins.
+
+ - `.PolyCollection.get_offsets` contains a Mx2 array containing
+ the x, y positions of the M hexagon centers in data coordinates.
+ - `.PolyCollection.get_array` contains the values of the M
+ hexagons.
+
+ If *marginals* is *True*, horizontal
+ bar and vertical bar (both PolyCollections) will be attached
+ to the return collection as attributes *hbar* and *vbar*.
+
+ Other Parameters
+ ----------------
+ %(cmap_doc)s
+
+ %(norm_doc)s
+
+ %(vmin_vmax_doc)s
+
+ alpha : float between 0 and 1, optional
+ The alpha blending value, between 0 (transparent) and 1 (opaque).
+
+ linewidths : float, default: *None*
+ If *None*, defaults to :rc:`patch.linewidth`.
+
+ edgecolors : {'face', 'none', *None*} or color, default: 'face'
+ The color of the hexagon edges. Possible values are:
+
+ - 'face': Draw the edges in the same color as the fill color.
+ - 'none': No edges are drawn. This can sometimes lead to unsightly
+ unpainted pixels between the hexagons.
+ - *None*: Draw outlines in the default color.
+ - An explicit color.
+
+ reduce_C_function : callable, default: `numpy.mean`
+ The function to aggregate *C* within the bins. It is ignored if
+ *C* is not given. This must have the signature::
+
+ def reduce_C_function(C: array) -> float
+
+ Commonly used functions are:
+
+ - `numpy.mean`: average of the points
+ - `numpy.sum`: integral of the point values
+ - `numpy.amax`: value taken from the largest point
+
+ By default will only reduce cells with at least 1 point because some
+ reduction functions (such as `numpy.amax`) will error/warn with empty
+ input. Changing *mincnt* will adjust the cutoff, and if set to 0 will
+ pass empty input to the reduction function.
+
+ %(colorizer_doc)s
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs : `~matplotlib.collections.PolyCollection` properties
+ All other keyword arguments are passed on to `.PolyCollection`:
+
+ %(PolyCollection:kwdoc)s
+
+ See Also
+ --------
+ hist2d : 2D histogram rectangular bins
+ """
+ self._process_unit_info([("x", x), ("y", y)], kwargs, convert=False)
+
+ x, y, C = cbook.delete_masked_points(x, y, C)
+
+ # Set the size of the hexagon grid
+ if np.iterable(gridsize):
+ nx, ny = gridsize
+ else:
+ nx = gridsize
+ ny = int(nx / math.sqrt(3))
+ # Count the number of data in each hexagon
+ x = np.asarray(x, float)
+ y = np.asarray(y, float)
+
+ # Will be log()'d if necessary, and then rescaled.
+ tx = x
+ ty = y
+
+ if xscale == 'log':
+ if np.any(x <= 0.0):
+ raise ValueError(
+ "x contains non-positive values, so cannot be log-scaled")
+ tx = np.log10(tx)
+ if yscale == 'log':
+ if np.any(y <= 0.0):
+ raise ValueError(
+ "y contains non-positive values, so cannot be log-scaled")
+ ty = np.log10(ty)
+ if extent is not None:
+ xmin, xmax, ymin, ymax = extent
+ if xmin > xmax:
+ raise ValueError("In extent, xmax must be greater than xmin")
+ if ymin > ymax:
+ raise ValueError("In extent, ymax must be greater than ymin")
+ else:
+ xmin, xmax = (tx.min(), tx.max()) if len(x) else (0, 1)
+ ymin, ymax = (ty.min(), ty.max()) if len(y) else (0, 1)
+
+ # to avoid issues with singular data, expand the min/max pairs
+ xmin, xmax = mtransforms.nonsingular(xmin, xmax, expander=0.1)
+ ymin, ymax = mtransforms.nonsingular(ymin, ymax, expander=0.1)
+
+ nx1 = nx + 1
+ ny1 = ny + 1
+ nx2 = nx
+ ny2 = ny
+ n = nx1 * ny1 + nx2 * ny2
+
+ # In the x-direction, the hexagons exactly cover the region from
+ # xmin to xmax. Need some padding to avoid roundoff errors.
+ padding = 1.e-9 * (xmax - xmin)
+ xmin -= padding
+ xmax += padding
+ sx = (xmax - xmin) / nx
+ sy = (ymax - ymin) / ny
+ # Positions in hexagon index coordinates.
+ ix = (tx - xmin) / sx
+ iy = (ty - ymin) / sy
+ ix1 = np.round(ix).astype(int)
+ iy1 = np.round(iy).astype(int)
+ ix2 = np.floor(ix).astype(int)
+ iy2 = np.floor(iy).astype(int)
+ # flat indices, plus one so that out-of-range points go to position 0.
+ i1 = np.where((0 <= ix1) & (ix1 < nx1) & (0 <= iy1) & (iy1 < ny1),
+ ix1 * ny1 + iy1 + 1, 0)
+ i2 = np.where((0 <= ix2) & (ix2 < nx2) & (0 <= iy2) & (iy2 < ny2),
+ ix2 * ny2 + iy2 + 1, 0)
+
+ d1 = (ix - ix1) ** 2 + 3.0 * (iy - iy1) ** 2
+ d2 = (ix - ix2 - 0.5) ** 2 + 3.0 * (iy - iy2 - 0.5) ** 2
+ bdist = (d1 < d2)
+
+ if C is None: # [1:] drops out-of-range points.
+ counts1 = np.bincount(i1[bdist], minlength=1 + nx1 * ny1)[1:]
+ counts2 = np.bincount(i2[~bdist], minlength=1 + nx2 * ny2)[1:]
+ accum = np.concatenate([counts1, counts2]).astype(float)
+ if mincnt is not None:
+ accum[accum < mincnt] = np.nan
+ C = np.ones(len(x))
+ else:
+ # store the C values in a list per hexagon index
+ Cs_at_i1 = [[] for _ in range(1 + nx1 * ny1)]
+ Cs_at_i2 = [[] for _ in range(1 + nx2 * ny2)]
+ for i in range(len(x)):
+ if bdist[i]:
+ Cs_at_i1[i1[i]].append(C[i])
+ else:
+ Cs_at_i2[i2[i]].append(C[i])
+ if mincnt is None:
+ mincnt = 1
+ accum = np.array(
+ [reduce_C_function(acc) if len(acc) >= mincnt else np.nan
+ for Cs_at_i in [Cs_at_i1, Cs_at_i2]
+ for acc in Cs_at_i[1:]], # [1:] drops out-of-range points.
+ float)
+
+ good_idxs = ~np.isnan(accum)
+
+ offsets = np.zeros((n, 2), float)
+ offsets[:nx1 * ny1, 0] = np.repeat(np.arange(nx1), ny1)
+ offsets[:nx1 * ny1, 1] = np.tile(np.arange(ny1), nx1)
+ offsets[nx1 * ny1:, 0] = np.repeat(np.arange(nx2) + 0.5, ny2)
+ offsets[nx1 * ny1:, 1] = np.tile(np.arange(ny2), nx2) + 0.5
+ offsets[:, 0] *= sx
+ offsets[:, 1] *= sy
+ offsets[:, 0] += xmin
+ offsets[:, 1] += ymin
+ # remove accumulation bins with no data
+ offsets = offsets[good_idxs, :]
+ accum = accum[good_idxs]
+
+ polygon = [sx, sy / 3] * np.array(
+ [[.5, -.5], [.5, .5], [0., 1.], [-.5, .5], [-.5, -.5], [0., -1.]])
+
+ if linewidths is None:
+ linewidths = [mpl.rcParams['patch.linewidth']]
+
+ if xscale == 'log' or yscale == 'log':
+ polygons = np.expand_dims(polygon, 0)
+ if xscale == 'log':
+ polygons[:, :, 0] = 10.0 ** polygons[:, :, 0]
+ xmin = 10.0 ** xmin
+ xmax = 10.0 ** xmax
+ self.set_xscale(xscale)
+ if yscale == 'log':
+ polygons[:, :, 1] = 10.0 ** polygons[:, :, 1]
+ ymin = 10.0 ** ymin
+ ymax = 10.0 ** ymax
+ self.set_yscale(yscale)
+ else:
+ polygons = [polygon]
+
+ collection = mcoll.PolyCollection(
+ polygons,
+ edgecolors=edgecolors,
+ linewidths=linewidths,
+ offsets=offsets,
+ offset_transform=mtransforms.AffineDeltaTransform(self.transData)
+ )
+
+ # Set normalizer if bins is 'log'
+ if cbook._str_equal(bins, 'log'):
+ if norm is not None:
+ _api.warn_external("Only one of 'bins' and 'norm' arguments "
+ f"can be supplied, ignoring {bins=}")
+ else:
+ norm = mcolors.LogNorm(vmin=vmin, vmax=vmax)
+ vmin = vmax = None
+ bins = None
+
+ if bins is not None:
+ if not np.iterable(bins):
+ minimum, maximum = min(accum), max(accum)
+ bins -= 1 # one less edge than bins
+ bins = minimum + (maximum - minimum) * np.arange(bins) / bins
+ bins = np.sort(bins)
+ accum = bins.searchsorted(accum)
+
+ if colorizer:
+ collection._set_colorizer_check_keywords(colorizer, cmap=cmap,
+ norm=norm, vmin=vmin,
+ vmax=vmax)
+ else:
+ collection.set_cmap(cmap)
+ collection.set_norm(norm)
+ collection.set_array(accum)
+ collection.set_alpha(alpha)
+ collection._internal_update(kwargs)
+ collection._scale_norm(norm, vmin, vmax)
+
+ # autoscale the norm with current accum values if it hasn't been set
+ if norm is not None:
+ if collection.norm.vmin is None and collection.norm.vmax is None:
+ collection.norm.autoscale()
+
+ corners = ((xmin, ymin), (xmax, ymax))
+ self.update_datalim(corners)
+ self._request_autoscale_view(tight=True)
+
+ # add the collection last
+ self.add_collection(collection, autolim=False)
+ if not marginals:
+ return collection
+
+ # Process marginals
+ bars = []
+ for zname, z, zmin, zmax, zscale, nbins in [
+ ("x", x, xmin, xmax, xscale, nx),
+ ("y", y, ymin, ymax, yscale, 2 * ny),
+ ]:
+
+ if zscale == "log":
+ bin_edges = np.geomspace(zmin, zmax, nbins + 1)
+ else:
+ bin_edges = np.linspace(zmin, zmax, nbins + 1)
+
+ verts = np.empty((nbins, 4, 2))
+ verts[:, 0, 0] = verts[:, 1, 0] = bin_edges[:-1]
+ verts[:, 2, 0] = verts[:, 3, 0] = bin_edges[1:]
+ verts[:, 0, 1] = verts[:, 3, 1] = .00
+ verts[:, 1, 1] = verts[:, 2, 1] = .05
+ if zname == "y":
+ verts = verts[:, :, ::-1] # Swap x and y.
+
+ # Sort z-values into bins defined by bin_edges.
+ bin_idxs = np.searchsorted(bin_edges, z) - 1
+ values = np.empty(nbins)
+ for i in range(nbins):
+ # Get C-values for each bin, and compute bin value with
+ # reduce_C_function.
+ ci = C[bin_idxs == i]
+ values[i] = reduce_C_function(ci) if len(ci) > 0 else np.nan
+
+ mask = ~np.isnan(values)
+ verts = verts[mask]
+ values = values[mask]
+
+ trans = getattr(self, f"get_{zname}axis_transform")(which="grid")
+ bar = mcoll.PolyCollection(
+ verts, transform=trans, edgecolors="face")
+ bar.set_array(values)
+ bar.set_cmap(cmap)
+ bar.set_norm(norm)
+ bar.set_alpha(alpha)
+ bar._internal_update(kwargs)
+ bars.append(self.add_collection(bar, autolim=False))
+
+ collection.hbar, collection.vbar = bars
+
+ def on_changed(collection):
+ collection.hbar.set_cmap(collection.get_cmap())
+ collection.hbar.set_cmap(collection.get_cmap())
+ collection.vbar.set_clim(collection.get_clim())
+ collection.vbar.set_clim(collection.get_clim())
+
+ collection.callbacks.connect('changed', on_changed)
+
+ return collection
+
+ @_docstring.interpd
+ def arrow(self, x, y, dx, dy, **kwargs):
+ """
+ [*Discouraged*] Add an arrow to the Axes.
+
+ This draws an arrow from ``(x, y)`` to ``(x+dx, y+dy)``.
+
+ .. admonition:: Discouraged
+
+ The use of this method is discouraged because it is not guaranteed
+ that the arrow renders reasonably. For example, the resulting arrow
+ is affected by the Axes aspect ratio and limits, which may distort
+ the arrow.
+
+ Consider using `~.Axes.annotate` without a text instead, e.g. ::
+
+ ax.annotate("", xytext=(0, 0), xy=(0.5, 0.5),
+ arrowprops=dict(arrowstyle="->"))
+
+ Parameters
+ ----------
+ %(FancyArrow)s
+
+ Returns
+ -------
+ `.FancyArrow`
+ The created `.FancyArrow` object.
+ """
+ # Strip away units for the underlying patch since units
+ # do not make sense to most patch-like code
+ x = self.convert_xunits(x)
+ y = self.convert_yunits(y)
+ dx = self.convert_xunits(dx)
+ dy = self.convert_yunits(dy)
+
+ a = mpatches.FancyArrow(x, y, dx, dy, **kwargs)
+ self.add_patch(a)
+ self._request_autoscale_view()
+ return a
+
+ @_docstring.copy(mquiver.QuiverKey.__init__)
+ def quiverkey(self, Q, X, Y, U, label, **kwargs):
+ qk = mquiver.QuiverKey(Q, X, Y, U, label, **kwargs)
+ self.add_artist(qk)
+ return qk
+
+ # Handle units for x and y, if they've been passed
+ def _quiver_units(self, args, kwargs):
+ if len(args) > 3:
+ x, y = args[0:2]
+ x, y = self._process_unit_info([("x", x), ("y", y)], kwargs)
+ return (x, y) + args[2:]
+ return args
+
+ # args can be a combination of X, Y, U, V, C and all should be replaced
+ @_preprocess_data()
+ @_docstring.interpd
+ def quiver(self, *args, **kwargs):
+ """%(quiver_doc)s"""
+ # Make sure units are handled for x and y values
+ args = self._quiver_units(args, kwargs)
+ q = mquiver.Quiver(self, *args, **kwargs)
+ self.add_collection(q, autolim=True)
+ self._request_autoscale_view()
+ return q
+
+ # args can be some combination of X, Y, U, V, C and all should be replaced
+ @_preprocess_data()
+ @_docstring.interpd
+ def barbs(self, *args, **kwargs):
+ """%(barbs_doc)s"""
+ # Make sure units are handled for x and y values
+ args = self._quiver_units(args, kwargs)
+ b = mquiver.Barbs(self, *args, **kwargs)
+ self.add_collection(b, autolim=True)
+ self._request_autoscale_view()
+ return b
+
+ # Uses a custom implementation of data-kwarg handling in
+ # _process_plot_var_args.
+ def fill(self, *args, data=None, **kwargs):
+ """
+ Plot filled polygons.
+
+ Parameters
+ ----------
+ *args : sequence of x, y, [color]
+ Each polygon is defined by the lists of *x* and *y* positions of
+ its nodes, optionally followed by a *color* specifier. See
+ :mod:`matplotlib.colors` for supported color specifiers. The
+ standard color cycle is used for polygons without a color
+ specifier.
+
+ You can plot multiple polygons by providing multiple *x*, *y*,
+ *[color]* groups.
+
+ For example, each of the following is legal::
+
+ ax.fill(x, y) # a polygon with default color
+ ax.fill(x, y, "b") # a blue polygon
+ ax.fill(x, y, x2, y2) # two polygons
+ ax.fill(x, y, "b", x2, y2, "r") # a blue and a red polygon
+
+ data : indexable object, optional
+ An object with labelled data. If given, provide the label names to
+ plot in *x* and *y*, e.g.::
+
+ ax.fill("time", "signal",
+ data={"time": [0, 1, 2], "signal": [0, 1, 0]})
+
+ Returns
+ -------
+ list of `~matplotlib.patches.Polygon`
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.patches.Polygon` properties
+
+ Notes
+ -----
+ Use :meth:`fill_between` if you would like to fill the region between
+ two curves.
+ """
+ # For compatibility(!), get aliases from Line2D rather than Patch.
+ kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
+ # _get_patches_for_fill returns a generator, convert it to a list.
+ patches = [*self._get_patches_for_fill(self, *args, data=data, **kwargs)]
+ for poly in patches:
+ self.add_patch(poly)
+ self._request_autoscale_view()
+ return patches
+
+ def _fill_between_x_or_y(
+ self, ind_dir, ind, dep1, dep2=0, *,
+ where=None, interpolate=False, step=None, **kwargs):
+ # Common implementation between fill_between (*ind_dir*="x") and
+ # fill_betweenx (*ind_dir*="y"). *ind* is the independent variable,
+ # *dep* the dependent variable. The docstring below is interpolated
+ # to generate both methods' docstrings.
+ """
+ Fill the area between two {dir} curves.
+
+ The curves are defined by the points (*{ind}*, *{dep}1*) and (*{ind}*,
+ *{dep}2*). This creates one or multiple polygons describing the filled
+ area.
+
+ You may exclude some {dir} sections from filling using *where*.
+
+ By default, the edges connect the given points directly. Use *step*
+ if the filling should be a step function, i.e. constant in between
+ *{ind}*.
+
+ Parameters
+ ----------
+ {ind} : array-like
+ The {ind} coordinates of the nodes defining the curves.
+
+ {dep}1 : array-like or float
+ The {dep} coordinates of the nodes defining the first curve.
+
+ {dep}2 : array-like or float, default: 0
+ The {dep} coordinates of the nodes defining the second curve.
+
+ where : array-like of bool, optional
+ Define *where* to exclude some {dir} regions from being filled.
+ The filled regions are defined by the coordinates ``{ind}[where]``.
+ More precisely, fill between ``{ind}[i]`` and ``{ind}[i+1]`` if
+ ``where[i] and where[i+1]``. Note that this definition implies
+ that an isolated *True* value between two *False* values in *where*
+ will not result in filling. Both sides of the *True* position
+ remain unfilled due to the adjacent *False* values.
+
+ interpolate : bool, default: False
+ This option is only relevant if *where* is used and the two curves
+ are crossing each other.
+
+ Semantically, *where* is often used for *{dep}1* > *{dep}2* or
+ similar. By default, the nodes of the polygon defining the filled
+ region will only be placed at the positions in the *{ind}* array.
+ Such a polygon cannot describe the above semantics close to the
+ intersection. The {ind}-sections containing the intersection are
+ simply clipped.
+
+ Setting *interpolate* to *True* will calculate the actual
+ intersection point and extend the filled region up to this point.
+
+ step : {{'pre', 'post', 'mid'}}, optional
+ Define *step* if the filling should be a step function,
+ i.e. constant in between *{ind}*. The value determines where the
+ step will occur:
+
+ - 'pre': The {dep} value is continued constantly to the left from
+ every *{ind}* position, i.e. the interval ``({ind}[i-1], {ind}[i]]``
+ has the value ``{dep}[i]``.
+ - 'post': The y value is continued constantly to the right from
+ every *{ind}* position, i.e. the interval ``[{ind}[i], {ind}[i+1])``
+ has the value ``{dep}[i]``.
+ - 'mid': Steps occur half-way between the *{ind}* positions.
+
+ Returns
+ -------
+ `.FillBetweenPolyCollection`
+ A `.FillBetweenPolyCollection` containing the plotted polygons.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ All other keyword arguments are passed on to
+ `.FillBetweenPolyCollection`. They control the `.Polygon` properties:
+
+ %(FillBetweenPolyCollection:kwdoc)s
+
+ See Also
+ --------
+ fill_between : Fill between two sets of y-values.
+ fill_betweenx : Fill between two sets of x-values.
+ """
+ dep_dir = mcoll.FillBetweenPolyCollection._f_dir_from_t(ind_dir)
+
+ if not mpl.rcParams["_internal.classic_mode"]:
+ kwargs = cbook.normalize_kwargs(kwargs, mcoll.Collection)
+ if not any(c in kwargs for c in ("color", "facecolor")):
+ kwargs["facecolor"] = self._get_patches_for_fill.get_next_color()
+
+ ind, dep1, dep2 = self._fill_between_process_units(
+ ind_dir, dep_dir, ind, dep1, dep2, **kwargs)
+
+ collection = mcoll.FillBetweenPolyCollection(
+ ind_dir, ind, dep1, dep2,
+ where=where, interpolate=interpolate, step=step, **kwargs)
+
+ self.add_collection(collection)
+ self._request_autoscale_view()
+ return collection
+
+ def _fill_between_process_units(self, ind_dir, dep_dir, ind, dep1, dep2, **kwargs):
+ """Handle united data, such as dates."""
+ return map(np.ma.masked_invalid, self._process_unit_info(
+ [(ind_dir, ind), (dep_dir, dep1), (dep_dir, dep2)], kwargs))
+
+ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
+ step=None, **kwargs):
+ return self._fill_between_x_or_y(
+ "x", x, y1, y2,
+ where=where, interpolate=interpolate, step=step, **kwargs)
+
+ if _fill_between_x_or_y.__doc__:
+ fill_between.__doc__ = _fill_between_x_or_y.__doc__.format(
+ dir="horizontal", ind="x", dep="y"
+ )
+ fill_between = _preprocess_data(
+ _docstring.interpd(fill_between),
+ replace_names=["x", "y1", "y2", "where"])
+
+ def fill_betweenx(self, y, x1, x2=0, where=None,
+ step=None, interpolate=False, **kwargs):
+ return self._fill_between_x_or_y(
+ "y", y, x1, x2,
+ where=where, interpolate=interpolate, step=step, **kwargs)
+
+ if _fill_between_x_or_y.__doc__:
+ fill_betweenx.__doc__ = _fill_between_x_or_y.__doc__.format(
+ dir="vertical", ind="y", dep="x"
+ )
+ fill_betweenx = _preprocess_data(
+ _docstring.interpd(fill_betweenx),
+ replace_names=["y", "x1", "x2", "where"])
+
+ #### plotting z(x, y): imshow, pcolor and relatives, contour
+
+ @_preprocess_data()
+ @_docstring.interpd
+ def imshow(self, X, cmap=None, norm=None, *, aspect=None,
+ interpolation=None, alpha=None,
+ vmin=None, vmax=None, colorizer=None, origin=None, extent=None,
+ interpolation_stage=None, filternorm=True, filterrad=4.0,
+ resample=None, url=None, **kwargs):
+ """
+ Display data as an image, i.e., on a 2D regular raster.
+
+ The input may either be actual RGB(A) data, or 2D scalar data, which
+ will be rendered as a pseudocolor image. For displaying a grayscale
+ image, set up the colormapping using the parameters
+ ``cmap='gray', vmin=0, vmax=255``.
+
+ The number of pixels used to render an image is set by the Axes size
+ and the figure *dpi*. This can lead to aliasing artifacts when
+ the image is resampled, because the displayed image size will usually
+ not match the size of *X* (see
+ :doc:`/gallery/images_contours_and_fields/image_antialiasing`).
+ The resampling can be controlled via the *interpolation* parameter
+ and/or :rc:`image.interpolation`.
+
+ Parameters
+ ----------
+ X : array-like or PIL image
+ The image data. Supported array shapes are:
+
+ - (M, N): an image with scalar data. The values are mapped to
+ colors using normalization and a colormap. See parameters *norm*,
+ *cmap*, *vmin*, *vmax*.
+ - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
+ - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
+ i.e. including transparency.
+
+ The first two dimensions (M, N) define the rows and columns of
+ the image.
+
+ Out-of-range RGB(A) values are clipped.
+
+ %(cmap_doc)s
+
+ This parameter is ignored if *X* is RGB(A).
+
+ %(norm_doc)s
+
+ This parameter is ignored if *X* is RGB(A).
+
+ %(vmin_vmax_doc)s
+
+ This parameter is ignored if *X* is RGB(A).
+
+ %(colorizer_doc)s
+
+ This parameter is ignored if *X* is RGB(A).
+
+ aspect : {'equal', 'auto'} or float or None, default: None
+ The aspect ratio of the Axes. This parameter is particularly
+ relevant for images since it determines whether data pixels are
+ square.
+
+ This parameter is a shortcut for explicitly calling
+ `.Axes.set_aspect`. See there for further details.
+
+ - 'equal': Ensures an aspect ratio of 1. Pixels will be square
+ (unless pixel sizes are explicitly made non-square in data
+ coordinates using *extent*).
+ - 'auto': The Axes is kept fixed and the aspect is adjusted so
+ that the data fit in the Axes. In general, this will result in
+ non-square pixels.
+
+ Normally, None (the default) means to use :rc:`image.aspect`. However, if
+ the image uses a transform that does not contain the axes data transform,
+ then None means to not modify the axes aspect at all (in that case, directly
+ call `.Axes.set_aspect` if desired).
+
+ interpolation : str, default: :rc:`image.interpolation`
+ The interpolation method used.
+
+ Supported values are 'none', 'auto', 'nearest', 'bilinear',
+ 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
+ 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
+ 'sinc', 'lanczos', 'blackman'.
+
+ The data *X* is resampled to the pixel size of the image on the
+ figure canvas, using the interpolation method to either up- or
+ downsample the data.
+
+ If *interpolation* is 'none', then for the ps, pdf, and svg
+ backends no down- or upsampling occurs, and the image data is
+ passed to the backend as a native image. Note that different ps,
+ pdf, and svg viewers may display these raw pixels differently. On
+ other backends, 'none' is the same as 'nearest'.
+
+ If *interpolation* is the default 'auto', then 'nearest'
+ interpolation is used if the image is upsampled by more than a
+ factor of three (i.e. the number of display pixels is at least
+ three times the size of the data array). If the upsampling rate is
+ smaller than 3, or the image is downsampled, then 'hanning'
+ interpolation is used to act as an anti-aliasing filter, unless the
+ image happens to be upsampled by exactly a factor of two or one.
+
+ See
+ :doc:`/gallery/images_contours_and_fields/interpolation_methods`
+ for an overview of the supported interpolation methods, and
+ :doc:`/gallery/images_contours_and_fields/image_antialiasing` for
+ a discussion of image antialiasing.
+
+ Some interpolation methods require an additional radius parameter,
+ which can be set by *filterrad*. Additionally, the antigrain image
+ resize filter is controlled by the parameter *filternorm*.
+
+ interpolation_stage : {'auto', 'data', 'rgba'}, default: 'auto'
+ Supported values:
+
+ - 'data': Interpolation is carried out on the data provided by the user
+ This is useful if interpolating between pixels during upsampling.
+ - 'rgba': The interpolation is carried out in RGBA-space after the
+ color-mapping has been applied. This is useful if downsampling and
+ combining pixels visually.
+ - 'auto': Select a suitable interpolation stage automatically. This uses
+ 'rgba' when downsampling, or upsampling at a rate less than 3, and
+ 'data' when upsampling at a higher rate.
+
+ See :doc:`/gallery/images_contours_and_fields/image_antialiasing` for
+ a discussion of image antialiasing.
+
+ alpha : float or array-like, optional
+ The alpha blending value, between 0 (transparent) and 1 (opaque).
+ If *alpha* is an array, the alpha blending values are applied pixel
+ by pixel, and *alpha* must have the same shape as *X*.
+
+ origin : {'upper', 'lower'}, default: :rc:`image.origin`
+ Place the [0, 0] index of the array in the upper left or lower
+ left corner of the Axes. The convention (the default) 'upper' is
+ typically used for matrices and images.
+
+ Note that the vertical axis points upward for 'lower'
+ but downward for 'upper'.
+
+ See the :ref:`imshow_extent` tutorial for
+ examples and a more detailed description.
+
+ extent : floats (left, right, bottom, top), optional
+ The bounding box in data coordinates that the image will fill.
+ These values may be unitful and match the units of the Axes.
+ The image is stretched individually along x and y to fill the box.
+
+ The default extent is determined by the following conditions.
+ Pixels have unit size in data coordinates. Their centers are on
+ integer coordinates, and their center coordinates range from 0 to
+ columns-1 horizontally and from 0 to rows-1 vertically.
+
+ Note that the direction of the vertical axis and thus the default
+ values for top and bottom depend on *origin*:
+
+ - For ``origin == 'upper'`` the default is
+ ``(-0.5, numcols-0.5, numrows-0.5, -0.5)``.
+ - For ``origin == 'lower'`` the default is
+ ``(-0.5, numcols-0.5, -0.5, numrows-0.5)``.
+
+ See the :ref:`imshow_extent` tutorial for
+ examples and a more detailed description.
+
+ filternorm : bool, default: True
+ A parameter for the antigrain image resize filter (see the
+ antigrain documentation). If *filternorm* is set, the filter
+ normalizes integer values and corrects the rounding errors. It
+ doesn't do anything with the source floating point values, it
+ corrects only integers according to the rule of 1.0 which means
+ that any sum of pixel weights must be equal to 1.0. So, the
+ filter function must produce a graph of the proper shape.
+
+ filterrad : float > 0, default: 4.0
+ The filter radius for filters that have a radius parameter, i.e.
+ when interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
+
+ resample : bool, default: :rc:`image.resample`
+ When *True*, use a full resampling method. When *False*, only
+ resample when the output image is larger than the input image.
+
+ url : str, optional
+ Set the url of the created `.AxesImage`. See `.Artist.set_url`.
+
+ Returns
+ -------
+ `~matplotlib.image.AxesImage`
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs : `~matplotlib.artist.Artist` properties
+ These parameters are passed on to the constructor of the
+ `.AxesImage` artist.
+
+ See Also
+ --------
+ matshow : Plot a matrix or an array as an image.
+
+ Notes
+ -----
+ Unless *extent* is used, pixel centers will be located at integer
+ coordinates. In other words: the origin will coincide with the center
+ of pixel (0, 0).
+
+ There are two common representations for RGB images with an alpha
+ channel:
+
+ - Straight (unassociated) alpha: R, G, and B channels represent the
+ color of the pixel, disregarding its opacity.
+ - Premultiplied (associated) alpha: R, G, and B channels represent
+ the color of the pixel, adjusted for its opacity by multiplication.
+
+ `~matplotlib.pyplot.imshow` expects RGB images adopting the straight
+ (unassociated) alpha representation.
+ """
+ im = mimage.AxesImage(self, cmap=cmap, norm=norm, colorizer=colorizer,
+ interpolation=interpolation, origin=origin,
+ extent=extent, filternorm=filternorm,
+ filterrad=filterrad, resample=resample,
+ interpolation_stage=interpolation_stage,
+ **kwargs)
+
+ if aspect is None and not (
+ im.is_transform_set()
+ and not im.get_transform().contains_branch(self.transData)):
+ aspect = mpl.rcParams['image.aspect']
+ if aspect is not None:
+ self.set_aspect(aspect)
+
+ im.set_data(X)
+ im.set_alpha(alpha)
+ if im.get_clip_path() is None:
+ # image does not already have clipping set, clip to Axes patch
+ im.set_clip_path(self.patch)
+ im._check_exclusionary_keywords(colorizer, vmin=vmin, vmax=vmax)
+ im._scale_norm(norm, vmin, vmax)
+ im.set_url(url)
+
+ # update ax.dataLim, and, if autoscaling, set viewLim
+ # to tightly fit the image, regardless of dataLim.
+ im.set_extent(im.get_extent())
+
+ self.add_image(im)
+ return im
+
+ def _pcolorargs(self, funcname, *args, shading='auto', **kwargs):
+ # - create X and Y if not present;
+ # - reshape X and Y as needed if they are 1-D;
+ # - check for proper sizes based on `shading` kwarg;
+ # - reset shading if shading='auto' to flat or nearest
+ # depending on size;
+
+ _valid_shading = ['gouraud', 'nearest', 'flat', 'auto']
+ try:
+ _api.check_in_list(_valid_shading, shading=shading)
+ except ValueError:
+ _api.warn_external(f"shading value '{shading}' not in list of "
+ f"valid values {_valid_shading}. Setting "
+ "shading='auto'.")
+ shading = 'auto'
+
+ if len(args) == 1:
+ C = np.asanyarray(args[0])
+ nrows, ncols = C.shape[:2]
+ if shading in ['gouraud', 'nearest']:
+ X, Y = np.meshgrid(np.arange(ncols), np.arange(nrows))
+ else:
+ X, Y = np.meshgrid(np.arange(ncols + 1), np.arange(nrows + 1))
+ shading = 'flat'
+ elif len(args) == 3:
+ # Check x and y for bad data...
+ C = np.asanyarray(args[2])
+ # unit conversion allows e.g. datetime objects as axis values
+ X, Y = args[:2]
+ X, Y = self._process_unit_info([("x", X), ("y", Y)], kwargs)
+ X, Y = (cbook.safe_masked_invalid(a, copy=True) for a in [X, Y])
+
+ if funcname == 'pcolormesh':
+ if np.ma.is_masked(X) or np.ma.is_masked(Y):
+ raise ValueError(
+ 'x and y arguments to pcolormesh cannot have '
+ 'non-finite values or be of type '
+ 'numpy.ma.MaskedArray with masked values')
+ nrows, ncols = C.shape[:2]
+ else:
+ raise _api.nargs_error(funcname, takes="1 or 3", given=len(args))
+
+ Nx = X.shape[-1]
+ Ny = Y.shape[0]
+ if X.ndim != 2 or X.shape[0] == 1:
+ x = X.reshape(1, Nx)
+ X = x.repeat(Ny, axis=0)
+ if Y.ndim != 2 or Y.shape[1] == 1:
+ y = Y.reshape(Ny, 1)
+ Y = y.repeat(Nx, axis=1)
+ if X.shape != Y.shape:
+ raise TypeError(f'Incompatible X, Y inputs to {funcname}; '
+ f'see help({funcname})')
+
+ if shading == 'auto':
+ if ncols == Nx and nrows == Ny:
+ shading = 'nearest'
+ else:
+ shading = 'flat'
+
+ if shading == 'flat':
+ if (Nx, Ny) != (ncols + 1, nrows + 1):
+ raise TypeError(f"Dimensions of C {C.shape} should"
+ f" be one smaller than X({Nx}) and Y({Ny})"
+ f" while using shading='flat'"
+ f" see help({funcname})")
+ else: # ['nearest', 'gouraud']:
+ if (Nx, Ny) != (ncols, nrows):
+ raise TypeError('Dimensions of C %s are incompatible with'
+ ' X (%d) and/or Y (%d); see help(%s)' % (
+ C.shape, Nx, Ny, funcname))
+ if shading == 'nearest':
+ # grid is specified at the center, so define corners
+ # at the midpoints between the grid centers and then use the
+ # flat algorithm.
+ def _interp_grid(X, require_monotonicity=False):
+ # helper for below. To ensure the cell edges are calculated
+ # correctly, when expanding columns, the monotonicity of
+ # X coords needs to be checked. When expanding rows, the
+ # monotonicity of Y coords needs to be checked.
+ if np.shape(X)[1] > 1:
+ dX = np.diff(X, axis=1) * 0.5
+ if (require_monotonicity and
+ not (np.all(dX >= 0) or np.all(dX <= 0))):
+ _api.warn_external(
+ f"The input coordinates to {funcname} are "
+ "interpreted as cell centers, but are not "
+ "monotonically increasing or decreasing. "
+ "This may lead to incorrectly calculated cell "
+ "edges, in which case, please supply "
+ f"explicit cell edges to {funcname}.")
+
+ hstack = np.ma.hstack if np.ma.isMA(X) else np.hstack
+ X = hstack((X[:, [0]] - dX[:, [0]],
+ X[:, :-1] + dX,
+ X[:, [-1]] + dX[:, [-1]]))
+ else:
+ # This is just degenerate, but we can't reliably guess
+ # a dX if there is just one value.
+ X = np.hstack((X, X))
+ return X
+
+ if ncols == Nx:
+ X = _interp_grid(X, require_monotonicity=True)
+ Y = _interp_grid(Y)
+ if nrows == Ny:
+ X = _interp_grid(X.T).T
+ Y = _interp_grid(Y.T, require_monotonicity=True).T
+ shading = 'flat'
+
+ C = cbook.safe_masked_invalid(C, copy=True)
+ return X, Y, C, shading
+
+ @_preprocess_data()
+ @_docstring.interpd
+ def pcolor(self, *args, shading=None, alpha=None, norm=None, cmap=None,
+ vmin=None, vmax=None, colorizer=None, **kwargs):
+ r"""
+ Create a pseudocolor plot with a non-regular rectangular grid.
+
+ Call signature::
+
+ pcolor([X, Y,] C, /, **kwargs)
+
+ *X* and *Y* can be used to specify the corners of the quadrilaterals.
+
+ The arguments *X*, *Y*, *C* are positional-only.
+
+ .. hint::
+
+ ``pcolor()`` can be very slow for large arrays. In most
+ cases you should use the similar but much faster
+ `~.Axes.pcolormesh` instead. See
+ :ref:`Differences between pcolor() and pcolormesh()
+ ` for a discussion of the
+ differences.
+
+ Parameters
+ ----------
+ C : 2D array-like
+ The color-mapped values. Color-mapping is controlled by *cmap*,
+ *norm*, *vmin*, and *vmax*.
+
+ X, Y : array-like, optional
+ The coordinates of the corners of quadrilaterals of a pcolormesh::
+
+ (X[i+1, j], Y[i+1, j]) (X[i+1, j+1], Y[i+1, j+1])
+ āā¶āāāā“ā
+ ā ā
+ āā¶āāāā“ā
+ (X[i, j], Y[i, j]) (X[i, j+1], Y[i, j+1])
+
+ Note that the column index corresponds to the x-coordinate, and
+ the row index corresponds to y. For details, see the
+ :ref:`Notes ` section below.
+
+ If ``shading='flat'`` the dimensions of *X* and *Y* should be one
+ greater than those of *C*, and the quadrilateral is colored due
+ to the value at ``C[i, j]``. If *X*, *Y* and *C* have equal
+ dimensions, a warning will be raised and the last row and column
+ of *C* will be ignored.
+
+ If ``shading='nearest'``, the dimensions of *X* and *Y* should be
+ the same as those of *C* (if not, a ValueError will be raised). The
+ color ``C[i, j]`` will be centered on ``(X[i, j], Y[i, j])``.
+
+ If *X* and/or *Y* are 1-D arrays or column vectors they will be
+ expanded as needed into the appropriate 2D arrays, making a
+ rectangular grid.
+
+ shading : {'flat', 'nearest', 'auto'}, default: :rc:`pcolor.shading`
+ The fill style for the quadrilateral. Possible values:
+
+ - 'flat': A solid color is used for each quad. The color of the
+ quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by
+ ``C[i, j]``. The dimensions of *X* and *Y* should be
+ one greater than those of *C*; if they are the same as *C*,
+ then a deprecation warning is raised, and the last row
+ and column of *C* are dropped.
+ - 'nearest': Each grid point will have a color centered on it,
+ extending halfway between the adjacent grid centers. The
+ dimensions of *X* and *Y* must be the same as *C*.
+ - 'auto': Choose 'flat' if dimensions of *X* and *Y* are one
+ larger than *C*. Choose 'nearest' if dimensions are the same.
+
+ See :doc:`/gallery/images_contours_and_fields/pcolormesh_grids`
+ for more description.
+
+ %(cmap_doc)s
+
+ %(norm_doc)s
+
+ %(vmin_vmax_doc)s
+
+ %(colorizer_doc)s
+
+ edgecolors : {'none', None, 'face', color, color sequence}, optional
+ The color of the edges. Defaults to 'none'. Possible values:
+
+ - 'none' or '': No edge.
+ - *None*: :rc:`patch.edgecolor` will be used. Note that currently
+ :rc:`patch.force_edgecolor` has to be True for this to work.
+ - 'face': Use the adjacent face color.
+ - A color or sequence of colors will set the edge color.
+
+ The singular form *edgecolor* works as an alias.
+
+ alpha : float, default: None
+ The alpha blending value of the face color, between 0 (transparent)
+ and 1 (opaque). Note: The edgecolor is currently not affected by
+ this.
+
+ snap : bool, default: False
+ Whether to snap the mesh to pixel boundaries.
+
+ Returns
+ -------
+ `matplotlib.collections.PolyQuadMesh`
+
+ Other Parameters
+ ----------------
+ antialiaseds : bool, default: False
+ The default *antialiaseds* is False if the default
+ *edgecolors*\ ="none" is used. This eliminates artificial lines
+ at patch boundaries, and works regardless of the value of alpha.
+ If *edgecolors* is not "none", then the default *antialiaseds*
+ is taken from :rc:`patch.antialiased`.
+ Stroking the edges may be preferred if *alpha* is 1, but will
+ cause artifacts otherwise.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Additionally, the following arguments are allowed. They are passed
+ along to the `~matplotlib.collections.PolyQuadMesh` constructor:
+
+ %(PolyCollection:kwdoc)s
+
+ See Also
+ --------
+ pcolormesh : for an explanation of the differences between
+ pcolor and pcolormesh.
+ imshow : If *X* and *Y* are each equidistant, `~.Axes.imshow` can be a
+ faster alternative.
+
+ Notes
+ -----
+ **Masked arrays**
+
+ *X*, *Y* and *C* may be masked arrays. If either ``C[i, j]``, or one
+ of the vertices surrounding ``C[i, j]`` (*X* or *Y* at
+ ``[i, j], [i+1, j], [i, j+1], [i+1, j+1]``) is masked, nothing is
+ plotted.
+
+ .. _axes-pcolor-grid-orientation:
+
+ **Grid orientation**
+
+ The grid orientation follows the standard matrix convention: An array
+ *C* with shape (nrows, ncolumns) is plotted with the column number as
+ *X* and the row number as *Y*.
+ """
+
+ if shading is None:
+ shading = mpl.rcParams['pcolor.shading']
+ shading = shading.lower()
+ X, Y, C, shading = self._pcolorargs('pcolor', *args, shading=shading,
+ kwargs=kwargs)
+ linewidths = (0.25,)
+ if 'linewidth' in kwargs:
+ kwargs['linewidths'] = kwargs.pop('linewidth')
+ kwargs.setdefault('linewidths', linewidths)
+
+ if 'edgecolor' in kwargs:
+ kwargs['edgecolors'] = kwargs.pop('edgecolor')
+ ec = kwargs.setdefault('edgecolors', 'none')
+
+ # aa setting will default via collections to patch.antialiased
+ # unless the boundary is not stroked, in which case the
+ # default will be False; with unstroked boundaries, aa
+ # makes artifacts that are often disturbing.
+ if 'antialiaseds' in kwargs:
+ kwargs['antialiased'] = kwargs.pop('antialiaseds')
+ if 'antialiased' not in kwargs and cbook._str_lower_equal(ec, "none"):
+ kwargs['antialiased'] = False
+
+ kwargs.setdefault('snap', False)
+
+ if np.ma.isMaskedArray(X) or np.ma.isMaskedArray(Y):
+ stack = np.ma.stack
+ X = np.ma.asarray(X)
+ Y = np.ma.asarray(Y)
+ # For bounds collections later
+ x = X.compressed()
+ y = Y.compressed()
+ else:
+ stack = np.stack
+ x = X
+ y = Y
+ coords = stack([X, Y], axis=-1)
+
+ collection = mcoll.PolyQuadMesh(
+ coords, array=C, cmap=cmap, norm=norm, colorizer=colorizer,
+ alpha=alpha, **kwargs)
+ collection._check_exclusionary_keywords(colorizer, vmin=vmin, vmax=vmax)
+ collection._scale_norm(norm, vmin, vmax)
+
+ # Transform from native to data coordinates?
+ t = collection._transform
+ if (not isinstance(t, mtransforms.Transform) and
+ hasattr(t, '_as_mpl_transform')):
+ t = t._as_mpl_transform(self.axes)
+
+ if t and any(t.contains_branch_seperately(self.transData)):
+ trans_to_data = t - self.transData
+ pts = np.vstack([x, y]).T.astype(float)
+ transformed_pts = trans_to_data.transform(pts)
+ x = transformed_pts[..., 0]
+ y = transformed_pts[..., 1]
+
+ self.add_collection(collection, autolim=False)
+
+ minx = np.min(x)
+ maxx = np.max(x)
+ miny = np.min(y)
+ maxy = np.max(y)
+ collection.sticky_edges.x[:] = [minx, maxx]
+ collection.sticky_edges.y[:] = [miny, maxy]
+ corners = (minx, miny), (maxx, maxy)
+ self.update_datalim(corners)
+ self._request_autoscale_view()
+ return collection
+
+ @_preprocess_data()
+ @_docstring.interpd
+ def pcolormesh(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
+ vmax=None, colorizer=None, shading=None, antialiased=False,
+ **kwargs):
+ """
+ Create a pseudocolor plot with a non-regular rectangular grid.
+
+ Call signature::
+
+ pcolormesh([X, Y,] C, /, **kwargs)
+
+ *X* and *Y* can be used to specify the corners of the quadrilaterals.
+
+ The arguments *X*, *Y*, *C* are positional-only.
+
+ .. hint::
+
+ `~.Axes.pcolormesh` is similar to `~.Axes.pcolor`. It is much faster
+ and preferred in most cases. For a detailed discussion on the
+ differences see :ref:`Differences between pcolor() and pcolormesh()
+ `.
+
+ Parameters
+ ----------
+ C : array-like
+ The mesh data. Supported array shapes are:
+
+ - (M, N) or M*N: a mesh with scalar data. The values are mapped to
+ colors using normalization and a colormap. See parameters *norm*,
+ *cmap*, *vmin*, *vmax*.
+ - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
+ - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
+ i.e. including transparency.
+
+ The first two dimensions (M, N) define the rows and columns of
+ the mesh data.
+
+ X, Y : array-like, optional
+ The coordinates of the corners of quadrilaterals of a pcolormesh::
+
+ (X[i+1, j], Y[i+1, j]) (X[i+1, j+1], Y[i+1, j+1])
+ āā¶āāāā“ā
+ ā ā
+ āā¶āāāā“ā
+ (X[i, j], Y[i, j]) (X[i, j+1], Y[i, j+1])
+
+ Note that the column index corresponds to the x-coordinate, and
+ the row index corresponds to y. For details, see the
+ :ref:`Notes ` section below.
+
+ If ``shading='flat'`` the dimensions of *X* and *Y* should be one
+ greater than those of *C*, and the quadrilateral is colored due
+ to the value at ``C[i, j]``. If *X*, *Y* and *C* have equal
+ dimensions, a warning will be raised and the last row and column
+ of *C* will be ignored.
+
+ If ``shading='nearest'`` or ``'gouraud'``, the dimensions of *X*
+ and *Y* should be the same as those of *C* (if not, a ValueError
+ will be raised). For ``'nearest'`` the color ``C[i, j]`` is
+ centered on ``(X[i, j], Y[i, j])``. For ``'gouraud'``, a smooth
+ interpolation is carried out between the quadrilateral corners.
+
+ If *X* and/or *Y* are 1-D arrays or column vectors they will be
+ expanded as needed into the appropriate 2D arrays, making a
+ rectangular grid.
+
+ %(cmap_doc)s
+
+ %(norm_doc)s
+
+ %(vmin_vmax_doc)s
+
+ %(colorizer_doc)s
+
+ edgecolors : {'none', None, 'face', color, color sequence}, optional
+ The color of the edges. Defaults to 'none'. Possible values:
+
+ - 'none' or '': No edge.
+ - *None*: :rc:`patch.edgecolor` will be used. Note that currently
+ :rc:`patch.force_edgecolor` has to be True for this to work.
+ - 'face': Use the adjacent face color.
+ - A color or sequence of colors will set the edge color.
+
+ The singular form *edgecolor* works as an alias.
+
+ alpha : float, default: None
+ The alpha blending value, between 0 (transparent) and 1 (opaque).
+
+ shading : {'flat', 'nearest', 'gouraud', 'auto'}, optional
+ The fill style for the quadrilateral; defaults to
+ :rc:`pcolor.shading`. Possible values:
+
+ - 'flat': A solid color is used for each quad. The color of the
+ quad (i, j), (i+1, j), (i, j+1), (i+1, j+1) is given by
+ ``C[i, j]``. The dimensions of *X* and *Y* should be
+ one greater than those of *C*; if they are the same as *C*,
+ then a deprecation warning is raised, and the last row
+ and column of *C* are dropped.
+ - 'nearest': Each grid point will have a color centered on it,
+ extending halfway between the adjacent grid centers. The
+ dimensions of *X* and *Y* must be the same as *C*.
+ - 'gouraud': Each quad will be Gouraud shaded: The color of the
+ corners (i', j') are given by ``C[i', j']``. The color values of
+ the area in between is interpolated from the corner values.
+ The dimensions of *X* and *Y* must be the same as *C*. When
+ Gouraud shading is used, *edgecolors* is ignored.
+ - 'auto': Choose 'flat' if dimensions of *X* and *Y* are one
+ larger than *C*. Choose 'nearest' if dimensions are the same.
+
+ See :doc:`/gallery/images_contours_and_fields/pcolormesh_grids`
+ for more description.
+
+ snap : bool, default: False
+ Whether to snap the mesh to pixel boundaries.
+
+ rasterized : bool, optional
+ Rasterize the pcolormesh when drawing vector graphics. This can
+ speed up rendering and produce smaller files for large data sets.
+ See also :doc:`/gallery/misc/rasterization_demo`.
+
+ Returns
+ -------
+ `matplotlib.collections.QuadMesh`
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Additionally, the following arguments are allowed. They are passed
+ along to the `~matplotlib.collections.QuadMesh` constructor:
+
+ %(QuadMesh:kwdoc)s
+
+ See Also
+ --------
+ pcolor : An alternative implementation with slightly different
+ features. For a detailed discussion on the differences see
+ :ref:`Differences between pcolor() and pcolormesh()
+ `.
+ imshow : If *X* and *Y* are each equidistant, `~.Axes.imshow` can be a
+ faster alternative.
+
+ Notes
+ -----
+ **Masked arrays**
+
+ *C* may be a masked array. If ``C[i, j]`` is masked, the corresponding
+ quadrilateral will be transparent. Masking of *X* and *Y* is not
+ supported. Use `~.Axes.pcolor` if you need this functionality.
+
+ .. _axes-pcolormesh-grid-orientation:
+
+ **Grid orientation**
+
+ The grid orientation follows the standard matrix convention: An array
+ *C* with shape (nrows, ncolumns) is plotted with the column number as
+ *X* and the row number as *Y*.
+
+ .. _differences-pcolor-pcolormesh:
+
+ **Differences between pcolor() and pcolormesh()**
+
+ Both methods are used to create a pseudocolor plot of a 2D array
+ using quadrilaterals.
+
+ The main difference lies in the created object and internal data
+ handling:
+ While `~.Axes.pcolor` returns a `.PolyQuadMesh`, `~.Axes.pcolormesh`
+ returns a `.QuadMesh`. The latter is more specialized for the given
+ purpose and thus is faster. It should almost always be preferred.
+
+ There is also a slight difference in the handling of masked arrays.
+ Both `~.Axes.pcolor` and `~.Axes.pcolormesh` support masked arrays
+ for *C*. However, only `~.Axes.pcolor` supports masked arrays for *X*
+ and *Y*. The reason lies in the internal handling of the masked values.
+ `~.Axes.pcolor` leaves out the respective polygons from the
+ PolyQuadMesh. `~.Axes.pcolormesh` sets the facecolor of the masked
+ elements to transparent. You can see the difference when using
+ edgecolors. While all edges are drawn irrespective of masking in a
+ QuadMesh, the edge between two adjacent masked quadrilaterals in
+ `~.Axes.pcolor` is not drawn as the corresponding polygons do not
+ exist in the PolyQuadMesh. Because PolyQuadMesh draws each individual
+ polygon, it also supports applying hatches and linestyles to the collection.
+
+ Another difference is the support of Gouraud shading in
+ `~.Axes.pcolormesh`, which is not available with `~.Axes.pcolor`.
+
+ """
+ if shading is None:
+ shading = mpl.rcParams['pcolor.shading']
+ shading = shading.lower()
+ kwargs.setdefault('edgecolors', 'none')
+
+ X, Y, C, shading = self._pcolorargs('pcolormesh', *args,
+ shading=shading, kwargs=kwargs)
+ coords = np.stack([X, Y], axis=-1)
+
+ kwargs.setdefault('snap', mpl.rcParams['pcolormesh.snap'])
+
+ collection = mcoll.QuadMesh(
+ coords, antialiased=antialiased, shading=shading,
+ array=C, cmap=cmap, norm=norm, colorizer=colorizer, alpha=alpha, **kwargs)
+ collection._check_exclusionary_keywords(colorizer, vmin=vmin, vmax=vmax)
+ collection._scale_norm(norm, vmin, vmax)
+
+ coords = coords.reshape(-1, 2) # flatten the grid structure; keep x, y
+
+ # Transform from native to data coordinates?
+ t = collection._transform
+ if (not isinstance(t, mtransforms.Transform) and
+ hasattr(t, '_as_mpl_transform')):
+ t = t._as_mpl_transform(self.axes)
+
+ if t and any(t.contains_branch_seperately(self.transData)):
+ trans_to_data = t - self.transData
+ coords = trans_to_data.transform(coords)
+
+ self.add_collection(collection, autolim=False)
+
+ minx, miny = np.min(coords, axis=0)
+ maxx, maxy = np.max(coords, axis=0)
+ collection.sticky_edges.x[:] = [minx, maxx]
+ collection.sticky_edges.y[:] = [miny, maxy]
+ corners = (minx, miny), (maxx, maxy)
+ self.update_datalim(corners)
+ self._request_autoscale_view()
+ return collection
+
+ @_preprocess_data()
+ @_docstring.interpd
+ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
+ vmax=None, colorizer=None, **kwargs):
+ """
+ Create a pseudocolor plot with a non-regular rectangular grid.
+
+ Call signature::
+
+ ax.pcolorfast([X, Y], C, /, **kwargs)
+
+ The arguments *X*, *Y*, *C* are positional-only.
+
+ This method is similar to `~.Axes.pcolor` and `~.Axes.pcolormesh`.
+ It's designed to provide the fastest pcolor-type plotting with the
+ Agg backend. To achieve this, it uses different algorithms internally
+ depending on the complexity of the input grid (regular rectangular,
+ non-regular rectangular or arbitrary quadrilateral).
+
+ .. warning::
+
+ This method is experimental. Compared to `~.Axes.pcolor` or
+ `~.Axes.pcolormesh` it has some limitations:
+
+ - It supports only flat shading (no outlines)
+ - It lacks support for log scaling of the axes.
+ - It does not have a pyplot wrapper.
+
+ Parameters
+ ----------
+ C : array-like
+ The image data. Supported array shapes are:
+
+ - (M, N): an image with scalar data. Color-mapping is controlled
+ by *cmap*, *norm*, *vmin*, and *vmax*.
+ - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
+ - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
+ i.e. including transparency.
+
+ The first two dimensions (M, N) define the rows and columns of
+ the image.
+
+ This parameter can only be passed positionally.
+
+ X, Y : tuple or array-like, default: ``(0, N)``, ``(0, M)``
+ *X* and *Y* are used to specify the coordinates of the
+ quadrilaterals. There are different ways to do this:
+
+ - Use tuples ``X=(xmin, xmax)`` and ``Y=(ymin, ymax)`` to define
+ a *uniform rectangular grid*.
+
+ The tuples define the outer edges of the grid. All individual
+ quadrilaterals will be of the same size. This is the fastest
+ version.
+
+ - Use 1D arrays *X*, *Y* to specify a *non-uniform rectangular
+ grid*.
+
+ In this case *X* and *Y* have to be monotonic 1D arrays of length
+ *N+1* and *M+1*, specifying the x and y boundaries of the cells.
+
+ The speed is intermediate. Note: The grid is checked, and if
+ found to be uniform the fast version is used.
+
+ - Use 2D arrays *X*, *Y* if you need an *arbitrary quadrilateral
+ grid* (i.e. if the quadrilaterals are not rectangular).
+
+ In this case *X* and *Y* are 2D arrays with shape (M + 1, N + 1),
+ specifying the x and y coordinates of the corners of the colored
+ quadrilaterals.
+
+ This is the most general, but the slowest to render. It may
+ produce faster and more compact output using ps, pdf, and
+ svg backends, however.
+
+ These arguments can only be passed positionally.
+
+ %(cmap_doc)s
+
+ This parameter is ignored if *C* is RGB(A).
+
+ %(norm_doc)s
+
+ This parameter is ignored if *C* is RGB(A).
+
+ %(vmin_vmax_doc)s
+
+ This parameter is ignored if *C* is RGB(A).
+
+ %(colorizer_doc)s
+
+ This parameter is ignored if *C* is RGB(A).
+
+ alpha : float, default: None
+ The alpha blending value, between 0 (transparent) and 1 (opaque).
+
+ snap : bool, default: False
+ Whether to snap the mesh to pixel boundaries.
+
+ Returns
+ -------
+ `.AxesImage` or `.PcolorImage` or `.QuadMesh`
+ The return type depends on the type of grid:
+
+ - `.AxesImage` for a regular rectangular grid.
+ - `.PcolorImage` for a non-regular rectangular grid.
+ - `.QuadMesh` for a non-rectangular grid.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Supported additional parameters depend on the type of grid.
+ See return types of *image* for further description.
+ """
+
+ C = args[-1]
+ nr, nc = np.shape(C)[:2]
+ if len(args) == 1:
+ style = "image"
+ x = [0, nc]
+ y = [0, nr]
+ elif len(args) == 3:
+ x, y = args[:2]
+ x = np.asarray(x)
+ y = np.asarray(y)
+ if x.ndim == 1 and y.ndim == 1:
+ if x.size == 2 and y.size == 2:
+ style = "image"
+ else:
+ if x.size != nc + 1:
+ raise ValueError(
+ f"Length of X ({x.size}) must be one larger than the "
+ f"number of columns in C ({nc})")
+ if y.size != nr + 1:
+ raise ValueError(
+ f"Length of Y ({y.size}) must be one larger than the "
+ f"number of rows in C ({nr})"
+ )
+ dx = np.diff(x)
+ dy = np.diff(y)
+ if (np.ptp(dx) < 0.01 * abs(dx.mean()) and
+ np.ptp(dy) < 0.01 * abs(dy.mean())):
+ style = "image"
+ else:
+ style = "pcolorimage"
+ elif x.ndim == 2 and y.ndim == 2:
+ style = "quadmesh"
+ else:
+ raise TypeError(
+ f"When 3 positional parameters are passed to pcolorfast, the first "
+ f"two (X and Y) must be both 1D or both 2D; the given X was "
+ f"{x.ndim}D and the given Y was {y.ndim}D")
+ else:
+ raise _api.nargs_error('pcolorfast', '1 or 3', len(args))
+
+ mcolorizer.ColorizingArtist._check_exclusionary_keywords(colorizer, vmin=vmin,
+ vmax=vmax)
+ if style == "quadmesh":
+ # data point in each cell is value at lower left corner
+ coords = np.stack([x, y], axis=-1)
+ if np.ndim(C) not in {2, 3}:
+ raise ValueError("C must be 2D or 3D")
+ collection = mcoll.QuadMesh(
+ coords, array=C,
+ alpha=alpha, cmap=cmap, norm=norm, colorizer=colorizer,
+ antialiased=False, edgecolors="none")
+ self.add_collection(collection, autolim=False)
+ xl, xr, yb, yt = x.min(), x.max(), y.min(), y.max()
+ ret = collection
+
+ else: # It's one of the two image styles.
+ extent = xl, xr, yb, yt = x[0], x[-1], y[0], y[-1]
+ if style == "image":
+ im = mimage.AxesImage(
+ self, cmap=cmap, norm=norm, colorizer=colorizer,
+ data=C, alpha=alpha, extent=extent,
+ interpolation='nearest', origin='lower',
+ **kwargs)
+ elif style == "pcolorimage":
+ im = mimage.PcolorImage(
+ self, x, y, C,
+ cmap=cmap, norm=norm, colorizer=colorizer, alpha=alpha,
+ extent=extent, **kwargs)
+ self.add_image(im)
+ ret = im
+
+ if np.ndim(C) == 2: # C.ndim == 3 is RGB(A) so doesn't need scaling.
+ ret._scale_norm(norm, vmin, vmax)
+
+ if ret.get_clip_path() is None:
+ # image does not already have clipping set, clip to Axes patch
+ ret.set_clip_path(self.patch)
+
+ ret.sticky_edges.x[:] = [xl, xr]
+ ret.sticky_edges.y[:] = [yb, yt]
+ self.update_datalim(np.array([[xl, yb], [xr, yt]]))
+ self._request_autoscale_view(tight=True)
+ return ret
+
+ @_preprocess_data()
+ @_docstring.interpd
+ def contour(self, *args, **kwargs):
+ """
+ Plot contour lines.
+
+ Call signature::
+
+ contour([X, Y,] Z, /, [levels], **kwargs)
+
+ The arguments *X*, *Y*, *Z* are positional-only.
+ %(contour_doc)s
+ """
+ kwargs['filled'] = False
+ contours = mcontour.QuadContourSet(self, *args, **kwargs)
+ self._request_autoscale_view()
+ return contours
+
+ @_preprocess_data()
+ @_docstring.interpd
+ def contourf(self, *args, **kwargs):
+ """
+ Plot filled contours.
+
+ Call signature::
+
+ contourf([X, Y,] Z, /, [levels], **kwargs)
+
+ The arguments *X*, *Y*, *Z* are positional-only.
+ %(contour_doc)s
+ """
+ kwargs['filled'] = True
+ contours = mcontour.QuadContourSet(self, *args, **kwargs)
+ self._request_autoscale_view()
+ return contours
+
+ def clabel(self, CS, levels=None, **kwargs):
+ """
+ Label a contour plot.
+
+ Adds labels to line contours in given `.ContourSet`.
+
+ Parameters
+ ----------
+ CS : `.ContourSet` instance
+ Line contours to label.
+
+ levels : array-like, optional
+ A list of level values, that should be labeled. The list must be
+ a subset of ``CS.levels``. If not given, all levels are labeled.
+
+ **kwargs
+ All other parameters are documented in `~.ContourLabeler.clabel`.
+ """
+ return CS.clabel(levels, **kwargs)
+
+ #### Data analysis
+
+ @_api.make_keyword_only("3.10", "range")
+ @_preprocess_data(replace_names=["x", 'weights'], label_namer="x")
+ def hist(self, x, bins=None, range=None, density=False, weights=None,
+ cumulative=False, bottom=None, histtype='bar', align='mid',
+ orientation='vertical', rwidth=None, log=False,
+ color=None, label=None, stacked=False, **kwargs):
+ """
+ Compute and plot a histogram.
+
+ This method uses `numpy.histogram` to bin the data in *x* and count the
+ number of values in each bin, then draws the distribution either as a
+ `.BarContainer` or `.Polygon`. The *bins*, *range*, *density*, and
+ *weights* parameters are forwarded to `numpy.histogram`.
+
+ If the data has already been binned and counted, use `~.bar` or
+ `~.stairs` to plot the distribution::
+
+ counts, bins = np.histogram(x)
+ plt.stairs(counts, bins)
+
+ Alternatively, plot pre-computed bins and counts using ``hist()`` by
+ treating each bin as a single point with a weight equal to its count::
+
+ plt.hist(bins[:-1], bins, weights=counts)
+
+ The data input *x* can be a singular array, a list of datasets of
+ potentially different lengths ([*x0*, *x1*, ...]), or a 2D ndarray in
+ which each column is a dataset. Note that the ndarray form is
+ transposed relative to the list form. If the input is an array, then
+ the return value is a tuple (*n*, *bins*, *patches*); if the input is a
+ sequence of arrays, then the return value is a tuple
+ ([*n0*, *n1*, ...], *bins*, [*patches0*, *patches1*, ...]).
+
+ Masked arrays are not supported.
+
+ Parameters
+ ----------
+ x : (n,) array or sequence of (n,) arrays
+ Input values, this takes either a single array or a sequence of
+ arrays which are not required to be of the same length.
+
+ bins : int or sequence or str, default: :rc:`hist.bins`
+ If *bins* is an integer, it defines the number of equal-width bins
+ in the range.
+
+ If *bins* is a sequence, it defines the bin edges, including the
+ left edge of the first bin and the right edge of the last bin;
+ in this case, bins may be unequally spaced. All but the last
+ (righthand-most) bin is half-open. In other words, if *bins* is::
+
+ [1, 2, 3, 4]
+
+ then the first bin is ``[1, 2)`` (including 1, but excluding 2) and
+ the second ``[2, 3)``. The last bin, however, is ``[3, 4]``, which
+ *includes* 4.
+
+ If *bins* is a string, it is one of the binning strategies
+ supported by `numpy.histogram_bin_edges`: 'auto', 'fd', 'doane',
+ 'scott', 'stone', 'rice', 'sturges', or 'sqrt'.
+
+ range : tuple or None, default: None
+ The lower and upper range of the bins. Lower and upper outliers
+ are ignored. If not provided, *range* is ``(x.min(), x.max())``.
+ Range has no effect if *bins* is a sequence.
+
+ If *bins* is a sequence or *range* is specified, autoscaling
+ is based on the specified bin range instead of the
+ range of x.
+
+ density : bool, default: False
+ If ``True``, draw and return a probability density: each bin
+ will display the bin's raw count divided by the total number of
+ counts *and the bin width*
+ (``density = counts / (sum(counts) * np.diff(bins))``),
+ so that the area under the histogram integrates to 1
+ (``np.sum(density * np.diff(bins)) == 1``).
+
+ If *stacked* is also ``True``, the sum of the histograms is
+ normalized to 1.
+
+ weights : (n,) array-like or None, default: None
+ An array of weights, of the same shape as *x*. Each value in
+ *x* only contributes its associated weight towards the bin count
+ (instead of 1). If *density* is ``True``, the weights are
+ normalized, so that the integral of the density over the range
+ remains 1.
+
+ cumulative : bool or -1, default: False
+ If ``True``, then a histogram is computed where each bin gives the
+ counts in that bin plus all bins for smaller values. The last bin
+ gives the total number of datapoints.
+
+ If *density* is also ``True`` then the histogram is normalized such
+ that the last bin equals 1.
+
+ If *cumulative* is a number less than 0 (e.g., -1), the direction
+ of accumulation is reversed. In this case, if *density* is also
+ ``True``, then the histogram is normalized such that the first bin
+ equals 1.
+
+ bottom : array-like or float, default: 0
+ Location of the bottom of each bin, i.e. bins are drawn from
+ ``bottom`` to ``bottom + hist(x, bins)`` If a scalar, the bottom
+ of each bin is shifted by the same amount. If an array, each bin
+ is shifted independently and the length of bottom must match the
+ number of bins. If None, defaults to 0.
+
+ histtype : {'bar', 'barstacked', 'step', 'stepfilled'}, default: 'bar'
+ The type of histogram to draw.
+
+ - 'bar' is a traditional bar-type histogram. If multiple data
+ are given the bars are arranged side by side.
+ - 'barstacked' is a bar-type histogram where multiple
+ data are stacked on top of each other.
+ - 'step' generates a lineplot that is by default unfilled.
+ - 'stepfilled' generates a lineplot that is by default filled.
+
+ align : {'left', 'mid', 'right'}, default: 'mid'
+ The horizontal alignment of the histogram bars.
+
+ - 'left': bars are centered on the left bin edges.
+ - 'mid': bars are centered between the bin edges.
+ - 'right': bars are centered on the right bin edges.
+
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
+ If 'horizontal', `~.Axes.barh` will be used for bar-type histograms
+ and the *bottom* kwarg will be the left edges.
+
+ rwidth : float or None, default: None
+ The relative width of the bars as a fraction of the bin width. If
+ ``None``, automatically compute the width.
+
+ Ignored if *histtype* is 'step' or 'stepfilled'.
+
+ log : bool, default: False
+ If ``True``, the histogram axis will be set to a log scale.
+
+ color : :mpltype:`color` or list of :mpltype:`color` or None, default: None
+ Color or sequence of colors, one per dataset. Default (``None``)
+ uses the standard line color sequence.
+
+ label : str or list of str, optional
+ String, or sequence of strings to match multiple datasets. Bar
+ charts yield multiple patches per dataset, but only the first gets
+ the label, so that `~.Axes.legend` will work as expected.
+
+ stacked : bool, default: False
+ If ``True``, multiple data are stacked on top of each other If
+ ``False`` multiple data are arranged side by side if histtype is
+ 'bar' or on top of each other if histtype is 'step'
+
+ Returns
+ -------
+ n : array or list of arrays
+ The values of the histogram bins. See *density* and *weights* for a
+ description of the possible semantics. If input *x* is an array,
+ then this is an array of length *nbins*. If input is a sequence of
+ arrays ``[data1, data2, ...]``, then this is a list of arrays with
+ the values of the histograms for each of the arrays in the same
+ order. The dtype of the array *n* (or of its element arrays) will
+ always be float even if no weighting or normalization is used.
+
+ bins : array
+ The edges of the bins. Length nbins + 1 (nbins left edges and right
+ edge of last bin). Always a single array even when multiple data
+ sets are passed in.
+
+ patches : `.BarContainer` or list of a single `.Polygon` or list of \
+such objects
+ Container of individual artists used to create the histogram
+ or list of such containers if there are multiple input datasets.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ `~matplotlib.patches.Patch` properties. The following properties
+ additionally accept a sequence of values corresponding to the
+ datasets in *x*:
+ *edgecolor*, *facecolor*, *linewidth*, *linestyle*, *hatch*.
+
+ .. versionadded:: 3.10
+ Allowing sequences of values in above listed Patch properties.
+
+ See Also
+ --------
+ hist2d : 2D histogram with rectangular bins
+ hexbin : 2D histogram with hexagonal bins
+ stairs : Plot a pre-computed histogram
+ bar : Plot a pre-computed histogram
+
+ Notes
+ -----
+ For large numbers of bins (>1000), plotting can be significantly
+ accelerated by using `~.Axes.stairs` to plot a pre-computed histogram
+ (``plt.stairs(*np.histogram(data))``), or by setting *histtype* to
+ 'step' or 'stepfilled' rather than 'bar' or 'barstacked'.
+ """
+ # Avoid shadowing the builtin.
+ bin_range = range
+ from builtins import range
+
+ kwargs = cbook.normalize_kwargs(kwargs, mpatches.Patch)
+
+ if np.isscalar(x):
+ x = [x]
+
+ if bins is None:
+ bins = mpl.rcParams['hist.bins']
+
+ # Validate string inputs here to avoid cluttering subsequent code.
+ _api.check_in_list(['bar', 'barstacked', 'step', 'stepfilled'],
+ histtype=histtype)
+ _api.check_in_list(['left', 'mid', 'right'], align=align)
+ _api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
+
+ if histtype == 'barstacked' and not stacked:
+ stacked = True
+
+ # Massage 'x' for processing.
+ x = cbook._reshape_2D(x, 'x')
+ nx = len(x) # number of datasets
+
+ # Process unit information. _process_unit_info sets the unit and
+ # converts the first dataset; then we convert each following dataset
+ # one at a time.
+ if orientation == "vertical":
+ convert_units = self.convert_xunits
+ x = [*self._process_unit_info([("x", x[0])], kwargs),
+ *map(convert_units, x[1:])]
+ else: # horizontal
+ convert_units = self.convert_yunits
+ x = [*self._process_unit_info([("y", x[0])], kwargs),
+ *map(convert_units, x[1:])]
+
+ if bin_range is not None:
+ bin_range = convert_units(bin_range)
+
+ if not cbook.is_scalar_or_string(bins):
+ bins = convert_units(bins)
+
+ # We need to do to 'weights' what was done to 'x'
+ if weights is not None:
+ w = cbook._reshape_2D(weights, 'weights')
+ else:
+ w = [None] * nx
+
+ if len(w) != nx:
+ raise ValueError('weights should have the same shape as x')
+
+ input_empty = True
+ for xi, wi in zip(x, w):
+ len_xi = len(xi)
+ if wi is not None and len(wi) != len_xi:
+ raise ValueError('weights should have the same shape as x')
+ if len_xi:
+ input_empty = False
+
+ if color is None:
+ colors = [self._get_lines.get_next_color() for i in range(nx)]
+ else:
+ colors = mcolors.to_rgba_array(color)
+ if len(colors) != nx:
+ raise ValueError(f"The 'color' keyword argument must have one "
+ f"color per dataset, but {nx} datasets and "
+ f"{len(colors)} colors were provided")
+
+ hist_kwargs = dict()
+
+ # if the bin_range is not given, compute without nan numpy
+ # does not do this for us when guessing the range (but will
+ # happily ignore nans when computing the histogram).
+ if bin_range is None:
+ xmin = np.inf
+ xmax = -np.inf
+ for xi in x:
+ if len(xi):
+ # python's min/max ignore nan,
+ # np.minnan returns nan for all nan input
+ xmin = min(xmin, np.nanmin(xi))
+ xmax = max(xmax, np.nanmax(xi))
+ if xmin <= xmax: # Only happens if we have seen a finite value.
+ bin_range = (xmin, xmax)
+
+ # If bins are not specified either explicitly or via range,
+ # we need to figure out the range required for all datasets,
+ # and supply that to np.histogram.
+ if not input_empty and len(x) > 1:
+ if weights is not None:
+ _w = np.concatenate(w)
+ else:
+ _w = None
+ bins = np.histogram_bin_edges(
+ np.concatenate(x), bins, bin_range, _w)
+ else:
+ hist_kwargs['range'] = bin_range
+
+ density = bool(density)
+ if density and not stacked:
+ hist_kwargs['density'] = density
+
+ # List to store all the top coordinates of the histograms
+ tops = [] # Will have shape (n_datasets, n_bins).
+ # Loop through datasets
+ for i in range(nx):
+ # this will automatically overwrite bins,
+ # so that each histogram uses the same bins
+ m, bins = np.histogram(x[i], bins, weights=w[i], **hist_kwargs)
+ tops.append(m)
+ tops = np.array(tops, float) # causes problems later if it's an int
+ bins = np.array(bins, float) # causes problems if float16
+ if stacked:
+ tops = tops.cumsum(axis=0)
+ # If a stacked density plot, normalize so the area of all the
+ # stacked histograms together is 1
+ if density:
+ tops = (tops / np.diff(bins)) / tops[-1].sum()
+ if cumulative:
+ slc = slice(None)
+ if isinstance(cumulative, Number) and cumulative < 0:
+ slc = slice(None, None, -1)
+ if density:
+ tops = (tops * np.diff(bins))[:, slc].cumsum(axis=1)[:, slc]
+ else:
+ tops = tops[:, slc].cumsum(axis=1)[:, slc]
+
+ patches = []
+
+ if histtype.startswith('bar'):
+
+ totwidth = np.diff(bins)
+
+ if rwidth is not None:
+ dr = np.clip(rwidth, 0, 1)
+ elif (len(tops) > 1 and
+ ((not stacked) or mpl.rcParams['_internal.classic_mode'])):
+ dr = 0.8
+ else:
+ dr = 1.0
+
+ if histtype == 'bar' and not stacked:
+ width = dr * totwidth / nx
+ dw = width
+ boffset = -0.5 * dr * totwidth * (1 - 1 / nx)
+ elif histtype == 'barstacked' or stacked:
+ width = dr * totwidth
+ boffset, dw = 0.0, 0.0
+
+ if align == 'mid':
+ boffset += 0.5 * totwidth
+ elif align == 'right':
+ boffset += totwidth
+
+ if orientation == 'horizontal':
+ _barfunc = self.barh
+ bottom_kwarg = 'left'
+ else: # orientation == 'vertical'
+ _barfunc = self.bar
+ bottom_kwarg = 'bottom'
+
+ for top, color in zip(tops, colors):
+ if bottom is None:
+ bottom = np.zeros(len(top))
+ if stacked:
+ height = top - bottom
+ else:
+ height = top
+ bars = _barfunc(bins[:-1]+boffset, height, width,
+ align='center', log=log,
+ color=color, **{bottom_kwarg: bottom})
+ patches.append(bars)
+ if stacked:
+ bottom = top
+ boffset += dw
+ # Remove stickies from all bars but the lowest ones, as otherwise
+ # margin expansion would be unable to cross the stickies in the
+ # middle of the bars.
+ for bars in patches[1:]:
+ for patch in bars:
+ patch.sticky_edges.x[:] = patch.sticky_edges.y[:] = []
+
+ elif histtype.startswith('step'):
+ # these define the perimeter of the polygon
+ x = np.zeros(4 * len(bins) - 3)
+ y = np.zeros(4 * len(bins) - 3)
+
+ x[0:2*len(bins)-1:2], x[1:2*len(bins)-1:2] = bins, bins[:-1]
+ x[2*len(bins)-1:] = x[1:2*len(bins)-1][::-1]
+
+ if bottom is None:
+ bottom = 0
+
+ y[1:2*len(bins)-1:2] = y[2:2*len(bins):2] = bottom
+ y[2*len(bins)-1:] = y[1:2*len(bins)-1][::-1]
+
+ if log:
+ if orientation == 'horizontal':
+ self.set_xscale('log', nonpositive='clip')
+ else: # orientation == 'vertical'
+ self.set_yscale('log', nonpositive='clip')
+
+ if align == 'left':
+ x -= 0.5*(bins[1]-bins[0])
+ elif align == 'right':
+ x += 0.5*(bins[1]-bins[0])
+
+ # If fill kwarg is set, it will be passed to the patch collection,
+ # overriding this
+ fill = (histtype == 'stepfilled')
+
+ xvals, yvals = [], []
+ for top in tops:
+ if stacked:
+ # top of the previous polygon becomes the bottom
+ y[2*len(bins)-1:] = y[1:2*len(bins)-1][::-1]
+ # set the top of this polygon
+ y[1:2*len(bins)-1:2] = y[2:2*len(bins):2] = top + bottom
+
+ # The starting point of the polygon has not yet been
+ # updated. So far only the endpoint was adjusted. This
+ # assignment closes the polygon. The redundant endpoint is
+ # later discarded (for step and stepfilled).
+ y[0] = y[-1]
+
+ if orientation == 'horizontal':
+ xvals.append(y.copy())
+ yvals.append(x.copy())
+ else:
+ xvals.append(x.copy())
+ yvals.append(y.copy())
+
+ # stepfill is closed, step is not
+ split = -1 if fill else 2 * len(bins)
+ # add patches in reverse order so that when stacking,
+ # items lower in the stack are plotted on top of
+ # items higher in the stack
+ for x, y, color in reversed(list(zip(xvals, yvals, colors))):
+ patches.append(self.fill(
+ x[:split], y[:split],
+ closed=True if fill else None,
+ facecolor=color,
+ edgecolor=None if fill else color,
+ fill=fill if fill else None,
+ zorder=None if fill else mlines.Line2D.zorder))
+ for patch_list in patches:
+ for patch in patch_list:
+ if orientation == 'vertical':
+ patch.sticky_edges.y.append(0)
+ elif orientation == 'horizontal':
+ patch.sticky_edges.x.append(0)
+
+ # we return patches, so put it back in the expected order
+ patches.reverse()
+
+ # If None, make all labels None (via zip_longest below); otherwise,
+ # cast each element to str, but keep a single str as it.
+ labels = [] if label is None else np.atleast_1d(np.asarray(label, str))
+
+ if histtype == "step":
+ ec = kwargs.get('edgecolor', colors)
+ else:
+ ec = kwargs.get('edgecolor', None)
+ if ec is None or cbook._str_lower_equal(ec, 'none'):
+ edgecolors = itertools.repeat(ec)
+ else:
+ edgecolors = itertools.cycle(mcolors.to_rgba_array(ec))
+
+ fc = kwargs.get('facecolor', colors)
+ if cbook._str_lower_equal(fc, 'none'):
+ facecolors = itertools.repeat(fc)
+ else:
+ facecolors = itertools.cycle(mcolors.to_rgba_array(fc))
+
+ hatches = itertools.cycle(np.atleast_1d(kwargs.get('hatch', None)))
+ linewidths = itertools.cycle(np.atleast_1d(kwargs.get('linewidth', None)))
+ if 'linestyle' in kwargs:
+ linestyles = itertools.cycle(mlines._get_dash_patterns(kwargs['linestyle']))
+ else:
+ linestyles = itertools.repeat(None)
+
+ for patch, lbl in itertools.zip_longest(patches, labels):
+ if not patch:
+ continue
+ p = patch[0]
+ kwargs.update({
+ 'hatch': next(hatches),
+ 'linewidth': next(linewidths),
+ 'linestyle': next(linestyles),
+ 'edgecolor': next(edgecolors),
+ 'facecolor': next(facecolors),
+ })
+ p._internal_update(kwargs)
+ if lbl is not None:
+ p.set_label(lbl)
+ for p in patch[1:]:
+ p._internal_update(kwargs)
+ p.set_label('_nolegend_')
+
+ if nx == 1:
+ return tops[0], bins, patches[0]
+ else:
+ patch_type = ("BarContainer" if histtype.startswith("bar")
+ else "list[Polygon]")
+ return tops, bins, cbook.silent_list(patch_type, patches)
+
+ @_preprocess_data()
+ def stairs(self, values, edges=None, *,
+ orientation='vertical', baseline=0, fill=False, **kwargs):
+ """
+ Draw a stepwise constant function as a line or a filled plot.
+
+ *edges* define the x-axis positions of the steps. *values* the function values
+ between these steps. Depending on *fill*, the function is drawn either as a
+ continuous line with vertical segments at the edges, or as a filled area.
+
+ Parameters
+ ----------
+ values : array-like
+ The step heights.
+
+ edges : array-like
+ The step positions, with ``len(edges) == len(vals) + 1``,
+ between which the curve takes on vals values.
+
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
+ The direction of the steps. Vertical means that *values* are along
+ the y-axis, and edges are along the x-axis.
+
+ baseline : float, array-like or None, default: 0
+ The bottom value of the bounding edges or when
+ ``fill=True``, position of lower edge. If *fill* is
+ True or an array is passed to *baseline*, a closed
+ path is drawn.
+
+ If None, then drawn as an unclosed Path.
+
+ fill : bool, default: False
+ Whether the area under the step curve should be filled.
+
+ Passing both ``fill=True` and ``baseline=None`` will likely result in
+ undesired filling: the first and last points will be connected
+ with a straight line and the fill will be between this line and the stairs.
+
+
+ Returns
+ -------
+ StepPatch : `~matplotlib.patches.StepPatch`
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ `~matplotlib.patches.StepPatch` properties
+
+ """
+
+ if 'color' in kwargs:
+ _color = kwargs.pop('color')
+ else:
+ _color = self._get_lines.get_next_color()
+ if fill:
+ kwargs.setdefault('linewidth', 0)
+ kwargs.setdefault('facecolor', _color)
+ else:
+ kwargs.setdefault('edgecolor', _color)
+
+ if edges is None:
+ edges = np.arange(len(values) + 1)
+
+ edges, values, baseline = self._process_unit_info(
+ [("x", edges), ("y", values), ("y", baseline)], kwargs)
+
+ patch = mpatches.StepPatch(values,
+ edges,
+ baseline=baseline,
+ orientation=orientation,
+ fill=fill,
+ **kwargs)
+ self.add_patch(patch)
+ if baseline is None and fill:
+ _api.warn_external(
+ f"Both {baseline=} and {fill=} have been passed. "
+ "baseline=None is only intended for unfilled stair plots. "
+ "Because baseline is None, the Path used to draw the stairs will "
+ "not be closed, thus because fill is True the polygon will be closed "
+ "by drawing an (unstroked) edge from the first to last point. It is "
+ "very likely that the resulting fill patterns is not the desired "
+ "result."
+ )
+
+ if baseline is not None:
+ if orientation == 'vertical':
+ patch.sticky_edges.y.append(np.min(baseline))
+ self.update_datalim([(edges[0], np.min(baseline))])
+ else:
+ patch.sticky_edges.x.append(np.min(baseline))
+ self.update_datalim([(np.min(baseline), edges[0])])
+ self._request_autoscale_view()
+ return patch
+
+ @_api.make_keyword_only("3.10", "range")
+ @_preprocess_data(replace_names=["x", "y", "weights"])
+ @_docstring.interpd
+ def hist2d(self, x, y, bins=10, range=None, density=False, weights=None,
+ cmin=None, cmax=None, **kwargs):
+ """
+ Make a 2D histogram plot.
+
+ Parameters
+ ----------
+ x, y : array-like, shape (n, )
+ Input values
+
+ bins : None or int or [int, int] or array-like or [array, array]
+
+ The bin specification:
+
+ - If int, the number of bins for the two dimensions
+ (``nx = ny = bins``).
+ - If ``[int, int]``, the number of bins in each dimension
+ (``nx, ny = bins``).
+ - If array-like, the bin edges for the two dimensions
+ (``x_edges = y_edges = bins``).
+ - If ``[array, array]``, the bin edges in each dimension
+ (``x_edges, y_edges = bins``).
+
+ The default value is 10.
+
+ range : array-like shape(2, 2), optional
+ The leftmost and rightmost edges of the bins along each dimension
+ (if not specified explicitly in the bins parameters): ``[[xmin,
+ xmax], [ymin, ymax]]``. All values outside of this range will be
+ considered outliers and not tallied in the histogram.
+
+ density : bool, default: False
+ Normalize histogram. See the documentation for the *density*
+ parameter of `~.Axes.hist` for more details.
+
+ weights : array-like, shape (n, ), optional
+ An array of values w_i weighing each sample (x_i, y_i).
+
+ cmin, cmax : float, default: None
+ All bins that has count less than *cmin* or more than *cmax* will not be
+ displayed (set to NaN before passing to `~.Axes.pcolormesh`) and these count
+ values in the return value count histogram will also be set to nan upon
+ return.
+
+ Returns
+ -------
+ h : 2D array
+ The bi-dimensional histogram of samples x and y. Values in x are
+ histogrammed along the first dimension and values in y are
+ histogrammed along the second dimension.
+ xedges : 1D array
+ The bin edges along the x-axis.
+ yedges : 1D array
+ The bin edges along the y-axis.
+ image : `~.matplotlib.collections.QuadMesh`
+
+ Other Parameters
+ ----------------
+ %(cmap_doc)s
+
+ %(norm_doc)s
+
+ %(vmin_vmax_doc)s
+
+ %(colorizer_doc)s
+
+ alpha : ``0 <= scalar <= 1`` or ``None``, optional
+ The alpha blending value.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Additional parameters are passed along to the
+ `~.Axes.pcolormesh` method and `~matplotlib.collections.QuadMesh`
+ constructor.
+
+ See Also
+ --------
+ hist : 1D histogram plotting
+ hexbin : 2D histogram with hexagonal bins
+
+ Notes
+ -----
+ - Currently ``hist2d`` calculates its own axis limits, and any limits
+ previously set are ignored.
+ - Rendering the histogram with a logarithmic color scale is
+ accomplished by passing a `.colors.LogNorm` instance to the *norm*
+ keyword argument. Likewise, power-law normalization (similar
+ in effect to gamma correction) can be accomplished with
+ `.colors.PowerNorm`.
+ """
+
+ h, xedges, yedges = np.histogram2d(x, y, bins=bins, range=range,
+ density=density, weights=weights)
+
+ if cmin is not None:
+ h[h < cmin] = None
+ if cmax is not None:
+ h[h > cmax] = None
+
+ pc = self.pcolormesh(xedges, yedges, h.T, **kwargs)
+ self.set_xlim(xedges[0], xedges[-1])
+ self.set_ylim(yedges[0], yedges[-1])
+
+ return h, xedges, yedges, pc
+
+ @_preprocess_data(replace_names=["x", "weights"], label_namer="x")
+ @_docstring.interpd
+ def ecdf(self, x, weights=None, *, complementary=False,
+ orientation="vertical", compress=False, **kwargs):
+ """
+ Compute and plot the empirical cumulative distribution function of *x*.
+
+ .. versionadded:: 3.8
+
+ Parameters
+ ----------
+ x : 1d array-like
+ The input data. Infinite entries are kept (and move the relevant
+ end of the ecdf from 0/1), but NaNs and masked values are errors.
+
+ weights : 1d array-like or None, default: None
+ The weights of the entries; must have the same shape as *x*.
+ Weights corresponding to NaN data points are dropped, and then the
+ remaining weights are normalized to sum to 1. If unset, all
+ entries have the same weight.
+
+ complementary : bool, default: False
+ Whether to plot a cumulative distribution function, which increases
+ from 0 to 1 (the default), or a complementary cumulative
+ distribution function, which decreases from 1 to 0.
+
+ orientation : {"vertical", "horizontal"}, default: "vertical"
+ Whether the entries are plotted along the x-axis ("vertical", the
+ default) or the y-axis ("horizontal"). This parameter takes the
+ same values as in `~.Axes.hist`.
+
+ compress : bool, default: False
+ Whether multiple entries with the same values are grouped together
+ (with a summed weight) before plotting. This is mainly useful if
+ *x* contains many identical data points, to decrease the rendering
+ complexity of the plot. If *x* contains no duplicate points, this
+ has no effect and just uses some time and memory.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Keyword arguments control the `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ Returns
+ -------
+ `.Line2D`
+
+ Notes
+ -----
+ The ecdf plot can be thought of as a cumulative histogram with one bin
+ per data entry; i.e. it reports on the entire dataset without any
+ arbitrary binning.
+
+ If *x* contains NaNs or masked entries, either remove them first from
+ the array (if they should not taken into account), or replace them by
+ -inf or +inf (if they should be sorted at the beginning or the end of
+ the array).
+ """
+ _api.check_in_list(["horizontal", "vertical"], orientation=orientation)
+ if "drawstyle" in kwargs or "ds" in kwargs:
+ raise TypeError("Cannot pass 'drawstyle' or 'ds' to ecdf()")
+ if np.ma.getmask(x).any():
+ raise ValueError("ecdf() does not support masked entries")
+ x = np.asarray(x)
+ if np.isnan(x).any():
+ raise ValueError("ecdf() does not support NaNs")
+ argsort = np.argsort(x)
+ x = x[argsort]
+ if weights is None:
+ # Ensure that we end at exactly 1, avoiding floating point errors.
+ cum_weights = (1 + np.arange(len(x))) / len(x)
+ else:
+ weights = np.take(weights, argsort) # Reorder weights like we reordered x.
+ cum_weights = np.cumsum(weights / np.sum(weights))
+ if compress:
+ # Get indices of unique x values.
+ compress_idxs = [0, *(x[:-1] != x[1:]).nonzero()[0] + 1]
+ x = x[compress_idxs]
+ cum_weights = cum_weights[compress_idxs]
+ if orientation == "vertical":
+ if not complementary:
+ line, = self.plot([x[0], *x], [0, *cum_weights],
+ drawstyle="steps-post", **kwargs)
+ else:
+ line, = self.plot([*x, x[-1]], [1, *1 - cum_weights],
+ drawstyle="steps-pre", **kwargs)
+ line.sticky_edges.y[:] = [0, 1]
+ else: # orientation == "horizontal":
+ if not complementary:
+ line, = self.plot([0, *cum_weights], [x[0], *x],
+ drawstyle="steps-pre", **kwargs)
+ else:
+ line, = self.plot([1, *1 - cum_weights], [*x, x[-1]],
+ drawstyle="steps-post", **kwargs)
+ line.sticky_edges.x[:] = [0, 1]
+ return line
+
+ @_api.make_keyword_only("3.10", "NFFT")
+ @_preprocess_data(replace_names=["x"])
+ @_docstring.interpd
+ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
+ window=None, noverlap=None, pad_to=None,
+ sides=None, scale_by_freq=None, return_line=None, **kwargs):
+ r"""
+ Plot the power spectral density.
+
+ The power spectral density :math:`P_{xx}` by Welch's average
+ periodogram method. The vector *x* is divided into *NFFT* length
+ segments. Each segment is detrended by function *detrend* and
+ windowed by function *window*. *noverlap* gives the length of
+ the overlap between segments. The :math:`|\mathrm{fft}(i)|^2`
+ of each segment :math:`i` are averaged to compute :math:`P_{xx}`,
+ with a scaling to correct for power loss due to windowing.
+
+ If len(*x*) < *NFFT*, it will be zero padded to *NFFT*.
+
+ Parameters
+ ----------
+ x : 1-D array or sequence
+ Array or sequence containing the data
+
+ %(Spectral)s
+
+ %(PSD)s
+
+ noverlap : int, default: 0 (no overlap)
+ The number of points of overlap between segments.
+
+ Fc : int, default: 0
+ The center frequency of *x*, which offsets the x extents of the
+ plot to reflect the frequency range used when a signal is acquired
+ and then filtered and downsampled to baseband.
+
+ return_line : bool, default: False
+ Whether to include the line object plotted in the returned values.
+
+ Returns
+ -------
+ Pxx : 1-D array
+ The values for the power spectrum :math:`P_{xx}` before scaling
+ (real valued).
+
+ freqs : 1-D array
+ The frequencies corresponding to the elements in *Pxx*.
+
+ line : `~matplotlib.lines.Line2D`
+ The line created by this function.
+ Only returned if *return_line* is True.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Keyword arguments control the `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ specgram
+ Differs in the default overlap; in not returning the mean of the
+ segment periodograms; in returning the times of the segments; and
+ in plotting a colormap instead of a line.
+ magnitude_spectrum
+ Plots the magnitude spectrum.
+ csd
+ Plots the spectral density between two signals.
+
+ Notes
+ -----
+ For plotting, the power is plotted as
+ :math:`10\log_{10}(P_{xx})` for decibels, though *Pxx* itself
+ is returned.
+
+ References
+ ----------
+ Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
+ John Wiley & Sons (1986)
+ """
+ if Fc is None:
+ Fc = 0
+
+ pxx, freqs = mlab.psd(x=x, NFFT=NFFT, Fs=Fs, detrend=detrend,
+ window=window, noverlap=noverlap, pad_to=pad_to,
+ sides=sides, scale_by_freq=scale_by_freq)
+ freqs += Fc
+
+ if scale_by_freq in (None, True):
+ psd_units = 'dB/Hz'
+ else:
+ psd_units = 'dB'
+
+ line = self.plot(freqs, 10 * np.log10(pxx), **kwargs)
+ self.set_xlabel('Frequency')
+ self.set_ylabel('Power Spectral Density (%s)' % psd_units)
+ self.grid(True)
+
+ vmin, vmax = self.get_ybound()
+ step = max(10 * int(np.log10(vmax - vmin)), 1)
+ ticks = np.arange(math.floor(vmin), math.ceil(vmax) + 1, step)
+ self.set_yticks(ticks)
+
+ if return_line is None or not return_line:
+ return pxx, freqs
+ else:
+ return pxx, freqs, line
+
+ @_api.make_keyword_only("3.10", "NFFT")
+ @_preprocess_data(replace_names=["x", "y"], label_namer="y")
+ @_docstring.interpd
+ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
+ window=None, noverlap=None, pad_to=None,
+ sides=None, scale_by_freq=None, return_line=None, **kwargs):
+ r"""
+ Plot the cross-spectral density.
+
+ The cross spectral density :math:`P_{xy}` by Welch's average
+ periodogram method. The vectors *x* and *y* are divided into
+ *NFFT* length segments. Each segment is detrended by function
+ *detrend* and windowed by function *window*. *noverlap* gives
+ the length of the overlap between segments. The product of
+ the direct FFTs of *x* and *y* are averaged over each segment
+ to compute :math:`P_{xy}`, with a scaling to correct for power
+ loss due to windowing.
+
+ If len(*x*) < *NFFT* or len(*y*) < *NFFT*, they will be zero
+ padded to *NFFT*.
+
+ Parameters
+ ----------
+ x, y : 1-D arrays or sequences
+ Arrays or sequences containing the data.
+
+ %(Spectral)s
+
+ %(PSD)s
+
+ noverlap : int, default: 0 (no overlap)
+ The number of points of overlap between segments.
+
+ Fc : int, default: 0
+ The center frequency of *x*, which offsets the x extents of the
+ plot to reflect the frequency range used when a signal is acquired
+ and then filtered and downsampled to baseband.
+
+ return_line : bool, default: False
+ Whether to include the line object plotted in the returned values.
+
+ Returns
+ -------
+ Pxy : 1-D array
+ The values for the cross spectrum :math:`P_{xy}` before scaling
+ (complex valued).
+
+ freqs : 1-D array
+ The frequencies corresponding to the elements in *Pxy*.
+
+ line : `~matplotlib.lines.Line2D`
+ The line created by this function.
+ Only returned if *return_line* is True.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Keyword arguments control the `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ psd : is equivalent to setting ``y = x``.
+
+ Notes
+ -----
+ For plotting, the power is plotted as
+ :math:`10 \log_{10}(P_{xy})` for decibels, though :math:`P_{xy}` itself
+ is returned.
+
+ References
+ ----------
+ Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
+ John Wiley & Sons (1986)
+ """
+ if Fc is None:
+ Fc = 0
+
+ pxy, freqs = mlab.csd(x=x, y=y, NFFT=NFFT, Fs=Fs, detrend=detrend,
+ window=window, noverlap=noverlap, pad_to=pad_to,
+ sides=sides, scale_by_freq=scale_by_freq)
+ # pxy is complex
+ freqs += Fc
+
+ line = self.plot(freqs, 10 * np.log10(np.abs(pxy)), **kwargs)
+ self.set_xlabel('Frequency')
+ self.set_ylabel('Cross Spectrum Magnitude (dB)')
+ self.grid(True)
+
+ vmin, vmax = self.get_ybound()
+ step = max(10 * int(np.log10(vmax - vmin)), 1)
+ ticks = np.arange(math.floor(vmin), math.ceil(vmax) + 1, step)
+ self.set_yticks(ticks)
+
+ if return_line is None or not return_line:
+ return pxy, freqs
+ else:
+ return pxy, freqs, line
+
+ @_api.make_keyword_only("3.10", "Fs")
+ @_preprocess_data(replace_names=["x"])
+ @_docstring.interpd
+ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None,
+ pad_to=None, sides=None, scale=None,
+ **kwargs):
+ """
+ Plot the magnitude spectrum.
+
+ Compute the magnitude spectrum of *x*. Data is padded to a
+ length of *pad_to* and the windowing function *window* is applied to
+ the signal.
+
+ Parameters
+ ----------
+ x : 1-D array or sequence
+ Array or sequence containing the data.
+
+ %(Spectral)s
+
+ %(Single_Spectrum)s
+
+ scale : {'default', 'linear', 'dB'}
+ The scaling of the values in the *spec*. 'linear' is no scaling.
+ 'dB' returns the values in dB scale, i.e., the dB amplitude
+ (20 * log10). 'default' is 'linear'.
+
+ Fc : int, default: 0
+ The center frequency of *x*, which offsets the x extents of the
+ plot to reflect the frequency range used when a signal is acquired
+ and then filtered and downsampled to baseband.
+
+ Returns
+ -------
+ spectrum : 1-D array
+ The values for the magnitude spectrum before scaling (real valued).
+
+ freqs : 1-D array
+ The frequencies corresponding to the elements in *spectrum*.
+
+ line : `~matplotlib.lines.Line2D`
+ The line created by this function.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Keyword arguments control the `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ psd
+ Plots the power spectral density.
+ angle_spectrum
+ Plots the angles of the corresponding frequencies.
+ phase_spectrum
+ Plots the phase (unwrapped angle) of the corresponding frequencies.
+ specgram
+ Can plot the magnitude spectrum of segments within the signal in a
+ colormap.
+ """
+ if Fc is None:
+ Fc = 0
+
+ spec, freqs = mlab.magnitude_spectrum(x=x, Fs=Fs, window=window,
+ pad_to=pad_to, sides=sides)
+ freqs += Fc
+
+ yunits = _api.check_getitem(
+ {None: 'energy', 'default': 'energy', 'linear': 'energy',
+ 'dB': 'dB'},
+ scale=scale)
+ if yunits == 'energy':
+ Z = spec
+ else: # yunits == 'dB'
+ Z = 20. * np.log10(spec)
+
+ line, = self.plot(freqs, Z, **kwargs)
+ self.set_xlabel('Frequency')
+ self.set_ylabel('Magnitude (%s)' % yunits)
+
+ return spec, freqs, line
+
+ @_api.make_keyword_only("3.10", "Fs")
+ @_preprocess_data(replace_names=["x"])
+ @_docstring.interpd
+ def angle_spectrum(self, x, Fs=None, Fc=None, window=None,
+ pad_to=None, sides=None, **kwargs):
+ """
+ Plot the angle spectrum.
+
+ Compute the angle spectrum (wrapped phase spectrum) of *x*.
+ Data is padded to a length of *pad_to* and the windowing function
+ *window* is applied to the signal.
+
+ Parameters
+ ----------
+ x : 1-D array or sequence
+ Array or sequence containing the data.
+
+ %(Spectral)s
+
+ %(Single_Spectrum)s
+
+ Fc : int, default: 0
+ The center frequency of *x*, which offsets the x extents of the
+ plot to reflect the frequency range used when a signal is acquired
+ and then filtered and downsampled to baseband.
+
+ Returns
+ -------
+ spectrum : 1-D array
+ The values for the angle spectrum in radians (real valued).
+
+ freqs : 1-D array
+ The frequencies corresponding to the elements in *spectrum*.
+
+ line : `~matplotlib.lines.Line2D`
+ The line created by this function.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Keyword arguments control the `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ magnitude_spectrum
+ Plots the magnitudes of the corresponding frequencies.
+ phase_spectrum
+ Plots the unwrapped version of this function.
+ specgram
+ Can plot the angle spectrum of segments within the signal in a
+ colormap.
+ """
+ if Fc is None:
+ Fc = 0
+
+ spec, freqs = mlab.angle_spectrum(x=x, Fs=Fs, window=window,
+ pad_to=pad_to, sides=sides)
+ freqs += Fc
+
+ lines = self.plot(freqs, spec, **kwargs)
+ self.set_xlabel('Frequency')
+ self.set_ylabel('Angle (radians)')
+
+ return spec, freqs, lines[0]
+
+ @_api.make_keyword_only("3.10", "Fs")
+ @_preprocess_data(replace_names=["x"])
+ @_docstring.interpd
+ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
+ pad_to=None, sides=None, **kwargs):
+ """
+ Plot the phase spectrum.
+
+ Compute the phase spectrum (unwrapped angle spectrum) of *x*.
+ Data is padded to a length of *pad_to* and the windowing function
+ *window* is applied to the signal.
+
+ Parameters
+ ----------
+ x : 1-D array or sequence
+ Array or sequence containing the data
+
+ %(Spectral)s
+
+ %(Single_Spectrum)s
+
+ Fc : int, default: 0
+ The center frequency of *x*, which offsets the x extents of the
+ plot to reflect the frequency range used when a signal is acquired
+ and then filtered and downsampled to baseband.
+
+ Returns
+ -------
+ spectrum : 1-D array
+ The values for the phase spectrum in radians (real valued).
+
+ freqs : 1-D array
+ The frequencies corresponding to the elements in *spectrum*.
+
+ line : `~matplotlib.lines.Line2D`
+ The line created by this function.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Keyword arguments control the `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ See Also
+ --------
+ magnitude_spectrum
+ Plots the magnitudes of the corresponding frequencies.
+ angle_spectrum
+ Plots the wrapped version of this function.
+ specgram
+ Can plot the phase spectrum of segments within the signal in a
+ colormap.
+ """
+ if Fc is None:
+ Fc = 0
+
+ spec, freqs = mlab.phase_spectrum(x=x, Fs=Fs, window=window,
+ pad_to=pad_to, sides=sides)
+ freqs += Fc
+
+ lines = self.plot(freqs, spec, **kwargs)
+ self.set_xlabel('Frequency')
+ self.set_ylabel('Phase (radians)')
+
+ return spec, freqs, lines[0]
+
+ @_api.make_keyword_only("3.10", "NFFT")
+ @_preprocess_data(replace_names=["x", "y"])
+ @_docstring.interpd
+ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
+ window=mlab.window_hanning, noverlap=0, pad_to=None,
+ sides='default', scale_by_freq=None, **kwargs):
+ r"""
+ Plot the coherence between *x* and *y*.
+
+ Coherence is the normalized cross spectral density:
+
+ .. math::
+
+ C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}
+
+ Parameters
+ ----------
+ %(Spectral)s
+
+ %(PSD)s
+
+ noverlap : int, default: 0 (no overlap)
+ The number of points of overlap between blocks.
+
+ Fc : int, default: 0
+ The center frequency of *x*, which offsets the x extents of the
+ plot to reflect the frequency range used when a signal is acquired
+ and then filtered and downsampled to baseband.
+
+ Returns
+ -------
+ Cxy : 1-D array
+ The coherence vector.
+
+ freqs : 1-D array
+ The frequencies for the elements in *Cxy*.
+
+ Other Parameters
+ ----------------
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ Keyword arguments control the `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ References
+ ----------
+ Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
+ John Wiley & Sons (1986)
+ """
+ cxy, freqs = mlab.cohere(x=x, y=y, NFFT=NFFT, Fs=Fs, detrend=detrend,
+ window=window, noverlap=noverlap,
+ scale_by_freq=scale_by_freq, sides=sides,
+ pad_to=pad_to)
+ freqs += Fc
+
+ self.plot(freqs, cxy, **kwargs)
+ self.set_xlabel('Frequency')
+ self.set_ylabel('Coherence')
+ self.grid(True)
+
+ return cxy, freqs
+
+ @_api.make_keyword_only("3.10", "NFFT")
+ @_preprocess_data(replace_names=["x"])
+ @_docstring.interpd
+ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
+ window=None, noverlap=None,
+ cmap=None, xextent=None, pad_to=None, sides=None,
+ scale_by_freq=None, mode=None, scale=None,
+ vmin=None, vmax=None, **kwargs):
+ """
+ Plot a spectrogram.
+
+ Compute and plot a spectrogram of data in *x*. Data are split into
+ *NFFT* length segments and the spectrum of each section is
+ computed. The windowing function *window* is applied to each
+ segment, and the amount of overlap of each segment is
+ specified with *noverlap*. The spectrogram is plotted as a colormap
+ (using imshow).
+
+ Parameters
+ ----------
+ x : 1-D array or sequence
+ Array or sequence containing the data.
+
+ %(Spectral)s
+
+ %(PSD)s
+
+ mode : {'default', 'psd', 'magnitude', 'angle', 'phase'}
+ What sort of spectrum to use. Default is 'psd', which takes the
+ power spectral density. 'magnitude' returns the magnitude
+ spectrum. 'angle' returns the phase spectrum without unwrapping.
+ 'phase' returns the phase spectrum with unwrapping.
+
+ noverlap : int, default: 128
+ The number of points of overlap between blocks.
+
+ scale : {'default', 'linear', 'dB'}
+ The scaling of the values in the *spec*. 'linear' is no scaling.
+ 'dB' returns the values in dB scale. When *mode* is 'psd',
+ this is dB power (10 * log10). Otherwise, this is dB amplitude
+ (20 * log10). 'default' is 'dB' if *mode* is 'psd' or
+ 'magnitude' and 'linear' otherwise. This must be 'linear'
+ if *mode* is 'angle' or 'phase'.
+
+ Fc : int, default: 0
+ The center frequency of *x*, which offsets the x extents of the
+ plot to reflect the frequency range used when a signal is acquired
+ and then filtered and downsampled to baseband.
+
+ cmap : `.Colormap`, default: :rc:`image.cmap`
+
+ xextent : *None* or (xmin, xmax)
+ The image extent along the x-axis. The default sets *xmin* to the
+ left border of the first bin (*spectrum* column) and *xmax* to the
+ right border of the last bin. Note that for *noverlap>0* the width
+ of the bins is smaller than those of the segments.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ vmin, vmax : float, optional
+ vmin and vmax define the data range that the colormap covers.
+ By default, the colormap covers the complete value range of the
+ data.
+
+ **kwargs
+ Additional keyword arguments are passed on to `~.axes.Axes.imshow`
+ which makes the specgram image. The origin keyword argument
+ is not supported.
+
+ Returns
+ -------
+ spectrum : 2D array
+ Columns are the periodograms of successive segments.
+
+ freqs : 1-D array
+ The frequencies corresponding to the rows in *spectrum*.
+
+ t : 1-D array
+ The times corresponding to midpoints of segments (i.e., the columns
+ in *spectrum*).
+
+ im : `.AxesImage`
+ The image created by imshow containing the spectrogram.
+
+ See Also
+ --------
+ psd
+ Differs in the default overlap; in returning the mean of the
+ segment periodograms; in not returning times; and in generating a
+ line plot instead of colormap.
+ magnitude_spectrum
+ A single spectrum, similar to having a single segment when *mode*
+ is 'magnitude'. Plots a line instead of a colormap.
+ angle_spectrum
+ A single spectrum, similar to having a single segment when *mode*
+ is 'angle'. Plots a line instead of a colormap.
+ phase_spectrum
+ A single spectrum, similar to having a single segment when *mode*
+ is 'phase'. Plots a line instead of a colormap.
+
+ Notes
+ -----
+ The parameters *detrend* and *scale_by_freq* do only apply when *mode*
+ is set to 'psd'.
+ """
+ if NFFT is None:
+ NFFT = 256 # same default as in mlab.specgram()
+ if Fc is None:
+ Fc = 0 # same default as in mlab._spectral_helper()
+ if noverlap is None:
+ noverlap = 128 # same default as in mlab.specgram()
+ if Fs is None:
+ Fs = 2 # same default as in mlab._spectral_helper()
+
+ if mode == 'complex':
+ raise ValueError('Cannot plot a complex specgram')
+
+ if scale is None or scale == 'default':
+ if mode in ['angle', 'phase']:
+ scale = 'linear'
+ else:
+ scale = 'dB'
+ elif mode in ['angle', 'phase'] and scale == 'dB':
+ raise ValueError('Cannot use dB scale with angle or phase mode')
+
+ spec, freqs, t = mlab.specgram(x=x, NFFT=NFFT, Fs=Fs,
+ detrend=detrend, window=window,
+ noverlap=noverlap, pad_to=pad_to,
+ sides=sides,
+ scale_by_freq=scale_by_freq,
+ mode=mode)
+
+ if scale == 'linear':
+ Z = spec
+ elif scale == 'dB':
+ if mode is None or mode == 'default' or mode == 'psd':
+ Z = 10. * np.log10(spec)
+ else:
+ Z = 20. * np.log10(spec)
+ else:
+ raise ValueError(f'Unknown scale {scale!r}')
+
+ Z = np.flipud(Z)
+
+ if xextent is None:
+ # padding is needed for first and last segment:
+ pad_xextent = (NFFT-noverlap) / Fs / 2
+ xextent = np.min(t) - pad_xextent, np.max(t) + pad_xextent
+ xmin, xmax = xextent
+ freqs += Fc
+ extent = xmin, xmax, freqs[0], freqs[-1]
+
+ if 'origin' in kwargs:
+ raise _api.kwarg_error("specgram", "origin")
+
+ im = self.imshow(Z, cmap, extent=extent, vmin=vmin, vmax=vmax,
+ origin='upper', **kwargs)
+ self.axis('auto')
+
+ return spec, freqs, t, im
+
+ @_api.make_keyword_only("3.10", "precision")
+ @_docstring.interpd
+ def spy(self, Z, precision=0, marker=None, markersize=None,
+ aspect='equal', origin="upper", **kwargs):
+ """
+ Plot the sparsity pattern of a 2D array.
+
+ This visualizes the non-zero values of the array.
+
+ Two plotting styles are available: image and marker. Both
+ are available for full arrays, but only the marker style
+ works for `scipy.sparse.spmatrix` instances.
+
+ **Image style**
+
+ If *marker* and *markersize* are *None*, `~.Axes.imshow` is used. Any
+ extra remaining keyword arguments are passed to this method.
+
+ **Marker style**
+
+ If *Z* is a `scipy.sparse.spmatrix` or *marker* or *markersize* are
+ *None*, a `.Line2D` object will be returned with the value of marker
+ determining the marker type, and any remaining keyword arguments
+ passed to `~.Axes.plot`.
+
+ Parameters
+ ----------
+ Z : (M, N) array-like
+ The array to be plotted.
+
+ precision : float or 'present', default: 0
+ If *precision* is 0, any non-zero value will be plotted. Otherwise,
+ values of :math:`|Z| > precision` will be plotted.
+
+ For `scipy.sparse.spmatrix` instances, you can also
+ pass 'present'. In this case any value present in the array
+ will be plotted, even if it is identically zero.
+
+ aspect : {'equal', 'auto', None} or float, default: 'equal'
+ The aspect ratio of the Axes. This parameter is particularly
+ relevant for images since it determines whether data pixels are
+ square.
+
+ This parameter is a shortcut for explicitly calling
+ `.Axes.set_aspect`. See there for further details.
+
+ - 'equal': Ensures an aspect ratio of 1. Pixels will be square.
+ - 'auto': The Axes is kept fixed and the aspect is adjusted so
+ that the data fit in the Axes. In general, this will result in
+ non-square pixels.
+ - *None*: Use :rc:`image.aspect`.
+
+ origin : {'upper', 'lower'}, default: :rc:`image.origin`
+ Place the [0, 0] index of the array in the upper left or lower left
+ corner of the Axes. The convention 'upper' is typically used for
+ matrices and images.
+
+ Returns
+ -------
+ `~matplotlib.image.AxesImage` or `.Line2D`
+ The return type depends on the plotting style (see above).
+
+ Other Parameters
+ ----------------
+ **kwargs
+ The supported additional parameters depend on the plotting style.
+
+ For the image style, you can pass the following additional
+ parameters of `~.Axes.imshow`:
+
+ - *cmap*
+ - *alpha*
+ - *url*
+ - any `.Artist` properties (passed on to the `.AxesImage`)
+
+ For the marker style, you can pass any `.Line2D` property except
+ for *linestyle*:
+
+ %(Line2D:kwdoc)s
+ """
+ if marker is None and markersize is None and hasattr(Z, 'tocoo'):
+ marker = 's'
+ _api.check_in_list(["upper", "lower"], origin=origin)
+ if marker is None and markersize is None:
+ Z = np.asarray(Z)
+ mask = np.abs(Z) > precision
+
+ if 'cmap' not in kwargs:
+ kwargs['cmap'] = mcolors.ListedColormap(['w', 'k'],
+ name='binary')
+ if 'interpolation' in kwargs:
+ raise _api.kwarg_error("spy", "interpolation")
+ if 'norm' not in kwargs:
+ kwargs['norm'] = mcolors.NoNorm()
+ ret = self.imshow(mask, interpolation='nearest',
+ aspect=aspect, origin=origin,
+ **kwargs)
+ else:
+ if hasattr(Z, 'tocoo'):
+ c = Z.tocoo()
+ if precision == 'present':
+ y = c.row
+ x = c.col
+ else:
+ nonzero = np.abs(c.data) > precision
+ y = c.row[nonzero]
+ x = c.col[nonzero]
+ else:
+ Z = np.asarray(Z)
+ nonzero = np.abs(Z) > precision
+ y, x = np.nonzero(nonzero)
+ if marker is None:
+ marker = 's'
+ if markersize is None:
+ markersize = 10
+ if 'linestyle' in kwargs:
+ raise _api.kwarg_error("spy", "linestyle")
+ ret = mlines.Line2D(
+ x, y, linestyle='None', marker=marker, markersize=markersize,
+ **kwargs)
+ self.add_line(ret)
+ nr, nc = Z.shape
+ self.set_xlim(-0.5, nc - 0.5)
+ if origin == "upper":
+ self.set_ylim(nr - 0.5, -0.5)
+ else:
+ self.set_ylim(-0.5, nr - 0.5)
+ self.set_aspect(aspect)
+ self.title.set_y(1.05)
+ if origin == "upper":
+ self.xaxis.tick_top()
+ else: # lower
+ self.xaxis.tick_bottom()
+ self.xaxis.set_ticks_position('both')
+ self.xaxis.set_major_locator(
+ mticker.MaxNLocator(nbins=9, steps=[1, 2, 5, 10], integer=True))
+ self.yaxis.set_major_locator(
+ mticker.MaxNLocator(nbins=9, steps=[1, 2, 5, 10], integer=True))
+ return ret
+
+ def matshow(self, Z, **kwargs):
+ """
+ Plot the values of a 2D matrix or array as color-coded image.
+
+ The matrix will be shown the way it would be printed, with the first
+ row at the top. Row and column numbering is zero-based.
+
+ Parameters
+ ----------
+ Z : (M, N) array-like
+ The matrix to be displayed.
+
+ Returns
+ -------
+ `~matplotlib.image.AxesImage`
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.axes.Axes.imshow` arguments
+
+ See Also
+ --------
+ imshow : More general function to plot data on a 2D regular raster.
+
+ Notes
+ -----
+ This is just a convenience function wrapping `.imshow` to set useful
+ defaults for displaying a matrix. In particular:
+
+ - Set ``origin='upper'``.
+ - Set ``interpolation='nearest'``.
+ - Set ``aspect='equal'``.
+ - Ticks are placed to the left and above.
+ - Ticks are formatted to show integer indices.
+
+ """
+ Z = np.asanyarray(Z)
+ kw = {'origin': 'upper',
+ 'interpolation': 'nearest',
+ 'aspect': 'equal', # (already the imshow default)
+ **kwargs}
+ im = self.imshow(Z, **kw)
+ self.title.set_y(1.05)
+ self.xaxis.tick_top()
+ self.xaxis.set_ticks_position('both')
+ self.xaxis.set_major_locator(
+ mticker.MaxNLocator(nbins=9, steps=[1, 2, 5, 10], integer=True))
+ self.yaxis.set_major_locator(
+ mticker.MaxNLocator(nbins=9, steps=[1, 2, 5, 10], integer=True))
+ return im
+
+ @_api.make_keyword_only("3.10", "vert")
+ @_preprocess_data(replace_names=["dataset"])
+ def violinplot(self, dataset, positions=None, vert=None,
+ orientation='vertical', widths=0.5, showmeans=False,
+ showextrema=True, showmedians=False, quantiles=None,
+ points=100, bw_method=None, side='both',):
+ """
+ Make a violin plot.
+
+ Make a violin plot for each column of *dataset* or each vector in
+ sequence *dataset*. Each filled area extends to represent the
+ entire data range, with optional lines at the mean, the median,
+ the minimum, the maximum, and user-specified quantiles.
+
+ Parameters
+ ----------
+ dataset : Array or a sequence of vectors.
+ The input data.
+
+ positions : array-like, default: [1, 2, ..., n]
+ The positions of the violins; i.e. coordinates on the x-axis for
+ vertical violins (or y-axis for horizontal violins).
+
+ vert : bool, optional
+ .. deprecated:: 3.10
+ Use *orientation* instead.
+
+ If this is given during the deprecation period, it overrides
+ the *orientation* parameter.
+
+ If True, plots the violins vertically.
+ If False, plots the violins horizontally.
+
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
+ If 'horizontal', plots the violins horizontally.
+ Otherwise, plots the violins vertically.
+
+ .. versionadded:: 3.10
+
+ widths : float or array-like, default: 0.5
+ The maximum width of each violin in units of the *positions* axis.
+ The default is 0.5, which is half the available space when using default
+ *positions*.
+
+ showmeans : bool, default: False
+ Whether to show the mean with a line.
+
+ showextrema : bool, default: True
+ Whether to show extrema with a line.
+
+ showmedians : bool, default: False
+ Whether to show the median with a line.
+
+ quantiles : array-like, default: None
+ If not None, set a list of floats in interval [0, 1] for each violin,
+ which stands for the quantiles that will be rendered for that
+ violin.
+
+ points : int, default: 100
+ The number of points to evaluate each of the gaussian kernel density
+ estimations at.
+
+ bw_method : {'scott', 'silverman'} or float or callable, default: 'scott'
+ The method used to calculate the estimator bandwidth. If a
+ float, this will be used directly as `kde.factor`. If a
+ callable, it should take a `matplotlib.mlab.GaussianKDE` instance as
+ its only parameter and return a float.
+
+ side : {'both', 'low', 'high'}, default: 'both'
+ 'both' plots standard violins. 'low'/'high' only
+ plots the side below/above the positions value.
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ Returns
+ -------
+ dict
+ A dictionary mapping each component of the violinplot to a
+ list of the corresponding collection instances created. The
+ dictionary has the following keys:
+
+ - ``bodies``: A list of the `~.collections.PolyCollection`
+ instances containing the filled area of each violin.
+
+ - ``cmeans``: A `~.collections.LineCollection` instance that marks
+ the mean values of each of the violin's distribution.
+
+ - ``cmins``: A `~.collections.LineCollection` instance that marks
+ the bottom of each violin's distribution.
+
+ - ``cmaxes``: A `~.collections.LineCollection` instance that marks
+ the top of each violin's distribution.
+
+ - ``cbars``: A `~.collections.LineCollection` instance that marks
+ the centers of each violin's distribution.
+
+ - ``cmedians``: A `~.collections.LineCollection` instance that
+ marks the median values of each of the violin's distribution.
+
+ - ``cquantiles``: A `~.collections.LineCollection` instance created
+ to identify the quantile values of each of the violin's
+ distribution.
+
+ See Also
+ --------
+ .Axes.violin : Draw a violin from pre-computed statistics.
+ boxplot : Draw a box and whisker plot.
+ """
+
+ def _kde_method(X, coords):
+ # Unpack in case of e.g. Pandas or xarray object
+ X = cbook._unpack_to_numpy(X)
+ # fallback gracefully if the vector contains only one value
+ if np.all(X[0] == X):
+ return (X[0] == coords).astype(float)
+ kde = mlab.GaussianKDE(X, bw_method)
+ return kde.evaluate(coords)
+
+ vpstats = cbook.violin_stats(dataset, _kde_method, points=points,
+ quantiles=quantiles)
+ return self.violin(vpstats, positions=positions, vert=vert,
+ orientation=orientation, widths=widths,
+ showmeans=showmeans, showextrema=showextrema,
+ showmedians=showmedians, side=side)
+
+ @_api.make_keyword_only("3.10", "vert")
+ def violin(self, vpstats, positions=None, vert=None,
+ orientation='vertical', widths=0.5, showmeans=False,
+ showextrema=True, showmedians=False, side='both'):
+ """
+ Draw a violin plot from pre-computed statistics.
+
+ Draw a violin plot for each column of *vpstats*. Each filled area
+ extends to represent the entire data range, with optional lines at the
+ mean, the median, the minimum, the maximum, and the quantiles values.
+
+ Parameters
+ ----------
+ vpstats : list of dicts
+ A list of dictionaries containing stats for each violin plot.
+ Required keys are:
+
+ - ``coords``: A list of scalars containing the coordinates that
+ the violin's kernel density estimate were evaluated at.
+
+ - ``vals``: A list of scalars containing the values of the
+ kernel density estimate at each of the coordinates given
+ in *coords*.
+
+ - ``mean``: The mean value for this violin's dataset.
+
+ - ``median``: The median value for this violin's dataset.
+
+ - ``min``: The minimum value for this violin's dataset.
+
+ - ``max``: The maximum value for this violin's dataset.
+
+ Optional keys are:
+
+ - ``quantiles``: A list of scalars containing the quantile values
+ for this violin's dataset.
+
+ positions : array-like, default: [1, 2, ..., n]
+ The positions of the violins; i.e. coordinates on the x-axis for
+ vertical violins (or y-axis for horizontal violins).
+
+ vert : bool, optional
+ .. deprecated:: 3.10
+ Use *orientation* instead.
+
+ If this is given during the deprecation period, it overrides
+ the *orientation* parameter.
+
+ If True, plots the violins vertically.
+ If False, plots the violins horizontally.
+
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
+ If 'horizontal', plots the violins horizontally.
+ Otherwise, plots the violins vertically.
+
+ .. versionadded:: 3.10
+
+ widths : float or array-like, default: 0.5
+ The maximum width of each violin in units of the *positions* axis.
+ The default is 0.5, which is half available space when using default
+ *positions*.
+
+ showmeans : bool, default: False
+ Whether to show the mean with a line.
+
+ showextrema : bool, default: True
+ Whether to show extrema with a line.
+
+ showmedians : bool, default: False
+ Whether to show the median with a line.
+
+ side : {'both', 'low', 'high'}, default: 'both'
+ 'both' plots standard violins. 'low'/'high' only
+ plots the side below/above the positions value.
+
+ Returns
+ -------
+ dict
+ A dictionary mapping each component of the violinplot to a
+ list of the corresponding collection instances created. The
+ dictionary has the following keys:
+
+ - ``bodies``: A list of the `~.collections.PolyCollection`
+ instances containing the filled area of each violin.
+
+ - ``cmeans``: A `~.collections.LineCollection` instance that marks
+ the mean values of each of the violin's distribution.
+
+ - ``cmins``: A `~.collections.LineCollection` instance that marks
+ the bottom of each violin's distribution.
+
+ - ``cmaxes``: A `~.collections.LineCollection` instance that marks
+ the top of each violin's distribution.
+
+ - ``cbars``: A `~.collections.LineCollection` instance that marks
+ the centers of each violin's distribution.
+
+ - ``cmedians``: A `~.collections.LineCollection` instance that
+ marks the median values of each of the violin's distribution.
+
+ - ``cquantiles``: A `~.collections.LineCollection` instance created
+ to identify the quantiles values of each of the violin's
+ distribution.
+
+ See Also
+ --------
+ violinplot :
+ Draw a violin plot from data instead of pre-computed statistics.
+ """
+
+ # Statistical quantities to be plotted on the violins
+ means = []
+ mins = []
+ maxes = []
+ medians = []
+ quantiles = []
+
+ qlens = [] # Number of quantiles in each dataset.
+
+ artists = {} # Collections to be returned
+
+ N = len(vpstats)
+ datashape_message = ("List of violinplot statistics and `{0}` "
+ "values must have the same length")
+
+ # vert and orientation parameters are linked until vert's
+ # deprecation period expires. If both are selected,
+ # vert takes precedence.
+ if vert is not None:
+ _api.warn_deprecated(
+ "3.11",
+ name="vert: bool",
+ alternative="orientation: {'vertical', 'horizontal'}",
+ pending=True,
+ )
+ orientation = 'vertical' if vert else 'horizontal'
+ _api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
+
+ # Validate positions
+ if positions is None:
+ positions = range(1, N + 1)
+ elif len(positions) != N:
+ raise ValueError(datashape_message.format("positions"))
+
+ # Validate widths
+ if np.isscalar(widths):
+ widths = [widths] * N
+ elif len(widths) != N:
+ raise ValueError(datashape_message.format("widths"))
+
+ # Validate side
+ _api.check_in_list(["both", "low", "high"], side=side)
+
+ # Calculate ranges for statistics lines (shape (2, N)).
+ line_ends = [[-0.25 if side in ['both', 'low'] else 0],
+ [0.25 if side in ['both', 'high'] else 0]] \
+ * np.array(widths) + positions
+
+ # Colors.
+ if mpl.rcParams['_internal.classic_mode']:
+ fillcolor = 'y'
+ linecolor = 'r'
+ else:
+ fillcolor = linecolor = self._get_lines.get_next_color()
+
+ # Check whether we are rendering vertically or horizontally
+ if orientation == 'vertical':
+ fill = self.fill_betweenx
+ if side in ['low', 'high']:
+ perp_lines = functools.partial(self.hlines, colors=linecolor,
+ capstyle='projecting')
+ par_lines = functools.partial(self.vlines, colors=linecolor,
+ capstyle='projecting')
+ else:
+ perp_lines = functools.partial(self.hlines, colors=linecolor)
+ par_lines = functools.partial(self.vlines, colors=linecolor)
+ else:
+ fill = self.fill_between
+ if side in ['low', 'high']:
+ perp_lines = functools.partial(self.vlines, colors=linecolor,
+ capstyle='projecting')
+ par_lines = functools.partial(self.hlines, colors=linecolor,
+ capstyle='projecting')
+ else:
+ perp_lines = functools.partial(self.vlines, colors=linecolor)
+ par_lines = functools.partial(self.hlines, colors=linecolor)
+
+ # Render violins
+ bodies = []
+ for stats, pos, width in zip(vpstats, positions, widths):
+ # The 0.5 factor reflects the fact that we plot from v-p to v+p.
+ vals = np.array(stats['vals'])
+ vals = 0.5 * width * vals / vals.max()
+ bodies += [fill(stats['coords'],
+ -vals + pos if side in ['both', 'low'] else pos,
+ vals + pos if side in ['both', 'high'] else pos,
+ facecolor=fillcolor, alpha=0.3)]
+ means.append(stats['mean'])
+ mins.append(stats['min'])
+ maxes.append(stats['max'])
+ medians.append(stats['median'])
+ q = stats.get('quantiles') # a list of floats, or None
+ if q is None:
+ q = []
+ quantiles.extend(q)
+ qlens.append(len(q))
+ artists['bodies'] = bodies
+
+ if showmeans: # Render means
+ artists['cmeans'] = perp_lines(means, *line_ends)
+ if showextrema: # Render extrema
+ artists['cmaxes'] = perp_lines(maxes, *line_ends)
+ artists['cmins'] = perp_lines(mins, *line_ends)
+ artists['cbars'] = par_lines(positions, mins, maxes)
+ if showmedians: # Render medians
+ artists['cmedians'] = perp_lines(medians, *line_ends)
+ if quantiles: # Render quantiles: each width is repeated qlen times.
+ artists['cquantiles'] = perp_lines(
+ quantiles, *np.repeat(line_ends, qlens, axis=1))
+
+ return artists
+
+ # Methods that are entirely implemented in other modules.
+
+ table = _make_axes_method(mtable.table)
+
+ # args can be either Y or y1, y2, ... and all should be replaced
+ stackplot = _preprocess_data()(_make_axes_method(mstack.stackplot))
+
+ streamplot = _preprocess_data(
+ replace_names=["x", "y", "u", "v", "start_points"])(
+ _make_axes_method(mstream.streamplot))
+
+ tricontour = _make_axes_method(mtri.tricontour)
+ tricontourf = _make_axes_method(mtri.tricontourf)
+ tripcolor = _make_axes_method(mtri.tripcolor)
+ triplot = _make_axes_method(mtri.triplot)
+
+ def _get_aspect_ratio(self):
+ """
+ Convenience method to calculate the aspect ratio of the Axes in
+ the display coordinate system.
+ """
+ figure_size = self.get_figure().get_size_inches()
+ ll, ur = self.get_position() * figure_size
+ width, height = ur - ll
+ return height / (width * self.get_data_ratio())
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_axes.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_axes.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..0c4be37b064b2a76ba89d5fd0a3a4c0e1cc91e93
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_axes.pyi
@@ -0,0 +1,780 @@
+from matplotlib.axes._base import _AxesBase
+from matplotlib.axes._secondary_axes import SecondaryAxis
+
+from matplotlib.artist import Artist
+from matplotlib.backend_bases import RendererBase
+from matplotlib.collections import (
+ Collection,
+ FillBetweenPolyCollection,
+ LineCollection,
+ PathCollection,
+ PolyCollection,
+ EventCollection,
+ QuadMesh,
+)
+from matplotlib.colorizer import Colorizer
+from matplotlib.colors import Colormap, Normalize
+from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
+from matplotlib.contour import ContourSet, QuadContourSet
+from matplotlib.image import AxesImage, PcolorImage
+from matplotlib.inset import InsetIndicator
+from matplotlib.legend import Legend
+from matplotlib.legend_handler import HandlerBase
+from matplotlib.lines import Line2D, AxLine
+from matplotlib.mlab import GaussianKDE
+from matplotlib.patches import Rectangle, FancyArrow, Polygon, StepPatch, Wedge
+from matplotlib.quiver import Quiver, QuiverKey, Barbs
+from matplotlib.text import Annotation, Text
+from matplotlib.transforms import Transform
+from matplotlib.typing import CoordsType
+import matplotlib.tri as mtri
+import matplotlib.table as mtable
+import matplotlib.stackplot as mstack
+import matplotlib.streamplot as mstream
+
+import datetime
+import PIL.Image
+from collections.abc import Callable, Iterable, Sequence
+from typing import Any, Literal, overload
+import numpy as np
+from numpy.typing import ArrayLike
+from matplotlib.typing import ColorType, MarkerType, LineStyleType
+
+class Axes(_AxesBase):
+ def get_title(self, loc: Literal["left", "center", "right"] = ...) -> str: ...
+ def set_title(
+ self,
+ label: str,
+ fontdict: dict[str, Any] | None = ...,
+ loc: Literal["left", "center", "right"] | None = ...,
+ pad: float | None = ...,
+ *,
+ y: float | None = ...,
+ **kwargs
+ ) -> Text: ...
+ def get_legend_handles_labels(
+ self, legend_handler_map: dict[type, HandlerBase] | None = ...
+ ) -> tuple[list[Artist], list[Any]]: ...
+ legend_: Legend | None
+
+ @overload
+ def legend(self) -> Legend: ...
+ @overload
+ def legend(self, handles: Iterable[Artist | tuple[Artist, ...]], labels: Iterable[str], **kwargs) -> Legend: ...
+ @overload
+ def legend(self, *, handles: Iterable[Artist | tuple[Artist, ...]], **kwargs) -> Legend: ...
+ @overload
+ def legend(self, labels: Iterable[str], **kwargs) -> Legend: ...
+ @overload
+ def legend(self, **kwargs) -> Legend: ...
+
+ def inset_axes(
+ self,
+ bounds: tuple[float, float, float, float],
+ *,
+ transform: Transform | None = ...,
+ zorder: float = ...,
+ **kwargs
+ ) -> Axes: ...
+ def indicate_inset(
+ self,
+ bounds: tuple[float, float, float, float] | None = ...,
+ inset_ax: Axes | None = ...,
+ *,
+ transform: Transform | None = ...,
+ facecolor: ColorType = ...,
+ edgecolor: ColorType = ...,
+ alpha: float = ...,
+ zorder: float | None = ...,
+ **kwargs
+ ) -> InsetIndicator: ...
+ def indicate_inset_zoom(self, inset_ax: Axes, **kwargs) -> InsetIndicator: ...
+ def secondary_xaxis(
+ self,
+ location: Literal["top", "bottom"] | float,
+ functions: tuple[
+ Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
+ ]
+ | Transform
+ | None = ...,
+ *,
+ transform: Transform | None = ...,
+ **kwargs
+ ) -> SecondaryAxis: ...
+ def secondary_yaxis(
+ self,
+ location: Literal["left", "right"] | float,
+ functions: tuple[
+ Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
+ ]
+ | Transform
+ | None = ...,
+ *,
+ transform: Transform | None = ...,
+ **kwargs
+ ) -> SecondaryAxis: ...
+ def text(
+ self,
+ x: float,
+ y: float,
+ s: str,
+ fontdict: dict[str, Any] | None = ...,
+ **kwargs
+ ) -> Text: ...
+ def annotate(
+ self,
+ text: str,
+ xy: tuple[float, float],
+ xytext: tuple[float, float] | None = ...,
+ xycoords: CoordsType = ...,
+ textcoords: CoordsType | None = ...,
+ arrowprops: dict[str, Any] | None = ...,
+ annotation_clip: bool | None = ...,
+ **kwargs
+ ) -> Annotation: ...
+ def axhline(
+ self, y: float = ..., xmin: float = ..., xmax: float = ..., **kwargs
+ ) -> Line2D: ...
+ def axvline(
+ self, x: float = ..., ymin: float = ..., ymax: float = ..., **kwargs
+ ) -> Line2D: ...
+
+ # TODO: Could separate the xy2 and slope signatures
+ def axline(
+ self,
+ xy1: tuple[float, float],
+ xy2: tuple[float, float] | None = ...,
+ *,
+ slope: float | None = ...,
+ **kwargs
+ ) -> AxLine: ...
+ def axhspan(
+ self, ymin: float, ymax: float, xmin: float = ..., xmax: float = ..., **kwargs
+ ) -> Rectangle: ...
+ def axvspan(
+ self, xmin: float, xmax: float, ymin: float = ..., ymax: float = ..., **kwargs
+ ) -> Rectangle: ...
+ def hlines(
+ self,
+ y: float | ArrayLike,
+ xmin: float | ArrayLike,
+ xmax: float | ArrayLike,
+ colors: ColorType | Sequence[ColorType] | None = ...,
+ linestyles: LineStyleType = ...,
+ *,
+ label: str = ...,
+ data=...,
+ **kwargs
+ ) -> LineCollection: ...
+ def vlines(
+ self,
+ x: float | ArrayLike,
+ ymin: float | ArrayLike,
+ ymax: float | ArrayLike,
+ colors: ColorType | Sequence[ColorType] | None = ...,
+ linestyles: LineStyleType = ...,
+ *,
+ label: str = ...,
+ data=...,
+ **kwargs
+ ) -> LineCollection: ...
+ def eventplot(
+ self,
+ positions: ArrayLike | Sequence[ArrayLike],
+ *,
+ orientation: Literal["horizontal", "vertical"] = ...,
+ lineoffsets: float | Sequence[float] = ...,
+ linelengths: float | Sequence[float] = ...,
+ linewidths: float | Sequence[float] | None = ...,
+ colors: ColorType | Sequence[ColorType] | None = ...,
+ alpha: float | Sequence[float] | None = ...,
+ linestyles: LineStyleType | Sequence[LineStyleType] = ...,
+ data=...,
+ **kwargs
+ ) -> EventCollection: ...
+ def plot(
+ self,
+ *args: float | ArrayLike | str,
+ scalex: bool = ...,
+ scaley: bool = ...,
+ data=...,
+ **kwargs
+ ) -> list[Line2D]: ...
+ def plot_date(
+ self,
+ x: ArrayLike,
+ y: ArrayLike,
+ fmt: str = ...,
+ tz: str | datetime.tzinfo | None = ...,
+ xdate: bool = ...,
+ ydate: bool = ...,
+ *,
+ data=...,
+ **kwargs
+ ) -> list[Line2D]: ...
+ def loglog(self, *args, **kwargs) -> list[Line2D]: ...
+ def semilogx(self, *args, **kwargs) -> list[Line2D]: ...
+ def semilogy(self, *args, **kwargs) -> list[Line2D]: ...
+ def acorr(
+ self, x: ArrayLike, *, data=..., **kwargs
+ ) -> tuple[np.ndarray, np.ndarray, LineCollection | Line2D, Line2D | None]: ...
+ def xcorr(
+ self,
+ x: ArrayLike,
+ y: ArrayLike,
+ *,
+ normed: bool = ...,
+ detrend: Callable[[ArrayLike], ArrayLike] = ...,
+ usevlines: bool = ...,
+ maxlags: int = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray, LineCollection | Line2D, Line2D | None]: ...
+ def step(
+ self,
+ x: ArrayLike,
+ y: ArrayLike,
+ *args,
+ where: Literal["pre", "post", "mid"] = ...,
+ data=...,
+ **kwargs
+ ) -> list[Line2D]: ...
+ def bar(
+ self,
+ x: float | ArrayLike,
+ height: float | ArrayLike,
+ width: float | ArrayLike = ...,
+ bottom: float | ArrayLike | None = ...,
+ *,
+ align: Literal["center", "edge"] = ...,
+ data=...,
+ **kwargs
+ ) -> BarContainer: ...
+ def barh(
+ self,
+ y: float | ArrayLike,
+ width: float | ArrayLike,
+ height: float | ArrayLike = ...,
+ left: float | ArrayLike | None = ...,
+ *,
+ align: Literal["center", "edge"] = ...,
+ data=...,
+ **kwargs
+ ) -> BarContainer: ...
+ def bar_label(
+ self,
+ container: BarContainer,
+ labels: ArrayLike | None = ...,
+ *,
+ fmt: str | Callable[[float], str] = ...,
+ label_type: Literal["center", "edge"] = ...,
+ padding: float = ...,
+ **kwargs
+ ) -> list[Annotation]: ...
+ def broken_barh(
+ self,
+ xranges: Sequence[tuple[float, float]],
+ yrange: tuple[float, float],
+ *,
+ data=...,
+ **kwargs
+ ) -> PolyCollection: ...
+ def stem(
+ self,
+ *args: ArrayLike | str,
+ linefmt: str | None = ...,
+ markerfmt: str | None = ...,
+ basefmt: str | None = ...,
+ bottom: float = ...,
+ label: str | None = ...,
+ orientation: Literal["vertical", "horizontal"] = ...,
+ data=...,
+ ) -> StemContainer: ...
+
+ # TODO: data kwarg preprocessor?
+ def pie(
+ self,
+ x: ArrayLike,
+ *,
+ explode: ArrayLike | None = ...,
+ labels: Sequence[str] | None = ...,
+ colors: ColorType | Sequence[ColorType] | None = ...,
+ autopct: str | Callable[[float], str] | None = ...,
+ pctdistance: float = ...,
+ shadow: bool = ...,
+ labeldistance: float | None = ...,
+ startangle: float = ...,
+ radius: float = ...,
+ counterclock: bool = ...,
+ wedgeprops: dict[str, Any] | None = ...,
+ textprops: dict[str, Any] | None = ...,
+ center: tuple[float, float] = ...,
+ frame: bool = ...,
+ rotatelabels: bool = ...,
+ normalize: bool = ...,
+ hatch: str | Sequence[str] | None = ...,
+ data=...,
+ ) -> tuple[list[Wedge], list[Text]] | tuple[
+ list[Wedge], list[Text], list[Text]
+ ]: ...
+ def errorbar(
+ self,
+ x: float | ArrayLike,
+ y: float | ArrayLike,
+ yerr: float | ArrayLike | None = ...,
+ xerr: float | ArrayLike | None = ...,
+ fmt: str = ...,
+ *,
+ ecolor: ColorType | None = ...,
+ elinewidth: float | None = ...,
+ capsize: float | None = ...,
+ barsabove: bool = ...,
+ lolims: bool | ArrayLike = ...,
+ uplims: bool | ArrayLike = ...,
+ xlolims: bool | ArrayLike = ...,
+ xuplims: bool | ArrayLike = ...,
+ errorevery: int | tuple[int, int] = ...,
+ capthick: float | None = ...,
+ data=...,
+ **kwargs
+ ) -> ErrorbarContainer: ...
+ def boxplot(
+ self,
+ x: ArrayLike | Sequence[ArrayLike],
+ *,
+ notch: bool | None = ...,
+ sym: str | None = ...,
+ vert: bool | None = ...,
+ orientation: Literal["vertical", "horizontal"] = ...,
+ whis: float | tuple[float, float] | None = ...,
+ positions: ArrayLike | None = ...,
+ widths: float | ArrayLike | None = ...,
+ patch_artist: bool | None = ...,
+ bootstrap: int | None = ...,
+ usermedians: ArrayLike | None = ...,
+ conf_intervals: ArrayLike | None = ...,
+ meanline: bool | None = ...,
+ showmeans: bool | None = ...,
+ showcaps: bool | None = ...,
+ showbox: bool | None = ...,
+ showfliers: bool | None = ...,
+ boxprops: dict[str, Any] | None = ...,
+ tick_labels: Sequence[str] | None = ...,
+ flierprops: dict[str, Any] | None = ...,
+ medianprops: dict[str, Any] | None = ...,
+ meanprops: dict[str, Any] | None = ...,
+ capprops: dict[str, Any] | None = ...,
+ whiskerprops: dict[str, Any] | None = ...,
+ manage_ticks: bool = ...,
+ autorange: bool = ...,
+ zorder: float | None = ...,
+ capwidths: float | ArrayLike | None = ...,
+ label: Sequence[str] | None = ...,
+ data=...,
+ ) -> dict[str, Any]: ...
+ def bxp(
+ self,
+ bxpstats: Sequence[dict[str, Any]],
+ positions: ArrayLike | None = ...,
+ *,
+ widths: float | ArrayLike | None = ...,
+ vert: bool | None = ...,
+ orientation: Literal["vertical", "horizontal"] = ...,
+ patch_artist: bool = ...,
+ shownotches: bool = ...,
+ showmeans: bool = ...,
+ showcaps: bool = ...,
+ showbox: bool = ...,
+ showfliers: bool = ...,
+ boxprops: dict[str, Any] | None = ...,
+ whiskerprops: dict[str, Any] | None = ...,
+ flierprops: dict[str, Any] | None = ...,
+ medianprops: dict[str, Any] | None = ...,
+ capprops: dict[str, Any] | None = ...,
+ meanprops: dict[str, Any] | None = ...,
+ meanline: bool = ...,
+ manage_ticks: bool = ...,
+ zorder: float | None = ...,
+ capwidths: float | ArrayLike | None = ...,
+ label: Sequence[str] | None = ...,
+ ) -> dict[str, Any]: ...
+ def scatter(
+ self,
+ x: float | ArrayLike,
+ y: float | ArrayLike,
+ s: float | ArrayLike | None = ...,
+ c: ArrayLike | Sequence[ColorType] | ColorType | None = ...,
+ *,
+ marker: MarkerType | None = ...,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ alpha: float | None = ...,
+ linewidths: float | Sequence[float] | None = ...,
+ edgecolors: Literal["face", "none"] | ColorType | Sequence[ColorType] | None = ...,
+ colorizer: Colorizer | None = ...,
+ plotnonfinite: bool = ...,
+ data=...,
+ **kwargs
+ ) -> PathCollection: ...
+ def hexbin(
+ self,
+ x: ArrayLike,
+ y: ArrayLike,
+ C: ArrayLike | None = ...,
+ *,
+ gridsize: int | tuple[int, int] = ...,
+ bins: Literal["log"] | int | Sequence[float] | None = ...,
+ xscale: Literal["linear", "log"] = ...,
+ yscale: Literal["linear", "log"] = ...,
+ extent: tuple[float, float, float, float] | None = ...,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ alpha: float | None = ...,
+ linewidths: float | None = ...,
+ edgecolors: Literal["face", "none"] | ColorType = ...,
+ reduce_C_function: Callable[[np.ndarray | list[float]], float] = ...,
+ mincnt: int | None = ...,
+ marginals: bool = ...,
+ colorizer: Colorizer | None = ...,
+ data=...,
+ **kwargs
+ ) -> PolyCollection: ...
+ def arrow(
+ self, x: float, y: float, dx: float, dy: float, **kwargs
+ ) -> FancyArrow: ...
+ def quiverkey(
+ self, Q: Quiver, X: float, Y: float, U: float, label: str, **kwargs
+ ) -> QuiverKey: ...
+ def quiver(self, *args, data=..., **kwargs) -> Quiver: ...
+ def barbs(self, *args, data=..., **kwargs) -> Barbs: ...
+ def fill(self, *args, data=..., **kwargs) -> list[Polygon]: ...
+ def fill_between(
+ self,
+ x: ArrayLike,
+ y1: ArrayLike | float,
+ y2: ArrayLike | float = ...,
+ where: Sequence[bool] | None = ...,
+ interpolate: bool = ...,
+ step: Literal["pre", "post", "mid"] | None = ...,
+ *,
+ data=...,
+ **kwargs
+ ) -> FillBetweenPolyCollection: ...
+ def fill_betweenx(
+ self,
+ y: ArrayLike,
+ x1: ArrayLike | float,
+ x2: ArrayLike | float = ...,
+ where: Sequence[bool] | None = ...,
+ step: Literal["pre", "post", "mid"] | None = ...,
+ interpolate: bool = ...,
+ *,
+ data=...,
+ **kwargs
+ ) -> FillBetweenPolyCollection: ...
+ def imshow(
+ self,
+ X: ArrayLike | PIL.Image.Image,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ *,
+ aspect: Literal["equal", "auto"] | float | None = ...,
+ interpolation: str | None = ...,
+ alpha: float | ArrayLike | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ colorizer: Colorizer | None = ...,
+ origin: Literal["upper", "lower"] | None = ...,
+ extent: tuple[float, float, float, float] | None = ...,
+ interpolation_stage: Literal["data", "rgba", "auto"] | None = ...,
+ filternorm: bool = ...,
+ filterrad: float = ...,
+ resample: bool | None = ...,
+ url: str | None = ...,
+ data=...,
+ **kwargs
+ ) -> AxesImage: ...
+ def pcolor(
+ self,
+ *args: ArrayLike,
+ shading: Literal["flat", "nearest", "auto"] | None = ...,
+ alpha: float | None = ...,
+ norm: str | Normalize | None = ...,
+ cmap: str | Colormap | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ colorizer: Colorizer | None = ...,
+ data=...,
+ **kwargs
+ ) -> Collection: ...
+ def pcolormesh(
+ self,
+ *args: ArrayLike,
+ alpha: float | None = ...,
+ norm: str | Normalize | None = ...,
+ cmap: str | Colormap | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ colorizer: Colorizer | None = ...,
+ shading: Literal["flat", "nearest", "gouraud", "auto"] | None = ...,
+ antialiased: bool = ...,
+ data=...,
+ **kwargs
+ ) -> QuadMesh: ...
+ def pcolorfast(
+ self,
+ *args: ArrayLike | tuple[float, float],
+ alpha: float | None = ...,
+ norm: str | Normalize | None = ...,
+ cmap: str | Colormap | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ colorizer: Colorizer | None = ...,
+ data=...,
+ **kwargs
+ ) -> AxesImage | PcolorImage | QuadMesh: ...
+ def contour(self, *args, data=..., **kwargs) -> QuadContourSet: ...
+ def contourf(self, *args, data=..., **kwargs) -> QuadContourSet: ...
+ def clabel(
+ self, CS: ContourSet, levels: ArrayLike | None = ..., **kwargs
+ ) -> list[Text]: ...
+ def hist(
+ self,
+ x: ArrayLike | Sequence[ArrayLike],
+ bins: int | Sequence[float] | str | None = ...,
+ *,
+ range: tuple[float, float] | None = ...,
+ density: bool = ...,
+ weights: ArrayLike | None = ...,
+ cumulative: bool | float = ...,
+ bottom: ArrayLike | float | None = ...,
+ histtype: Literal["bar", "barstacked", "step", "stepfilled"] = ...,
+ align: Literal["left", "mid", "right"] = ...,
+ orientation: Literal["vertical", "horizontal"] = ...,
+ rwidth: float | None = ...,
+ log: bool = ...,
+ color: ColorType | Sequence[ColorType] | None = ...,
+ label: str | Sequence[str] | None = ...,
+ stacked: bool = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[
+ np.ndarray | list[np.ndarray],
+ np.ndarray,
+ BarContainer | Polygon | list[BarContainer | Polygon],
+ ]: ...
+ def stairs(
+ self,
+ values: ArrayLike,
+ edges: ArrayLike | None = ...,
+ *,
+ orientation: Literal["vertical", "horizontal"] = ...,
+ baseline: float | ArrayLike | None = ...,
+ fill: bool = ...,
+ data=...,
+ **kwargs
+ ) -> StepPatch: ...
+ def hist2d(
+ self,
+ x: ArrayLike,
+ y: ArrayLike,
+ bins: None
+ | int
+ | tuple[int, int]
+ | ArrayLike
+ | tuple[ArrayLike, ArrayLike] = ...,
+ *,
+ range: ArrayLike | None = ...,
+ density: bool = ...,
+ weights: ArrayLike | None = ...,
+ cmin: float | None = ...,
+ cmax: float | None = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray, np.ndarray, QuadMesh]: ...
+ def ecdf(
+ self,
+ x: ArrayLike,
+ weights: ArrayLike | None = ...,
+ *,
+ complementary: bool=...,
+ orientation: Literal["vertical", "horizontal"]=...,
+ compress: bool=...,
+ data=...,
+ **kwargs
+ ) -> Line2D: ...
+ def psd(
+ self,
+ x: ArrayLike,
+ *,
+ NFFT: int | None = ...,
+ Fs: float | None = ...,
+ Fc: int | None = ...,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike], ArrayLike]
+ | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ noverlap: int | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ scale_by_freq: bool | None = ...,
+ return_line: bool | None = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray] | tuple[np.ndarray, np.ndarray, Line2D]: ...
+ def csd(
+ self,
+ x: ArrayLike,
+ y: ArrayLike,
+ *,
+ NFFT: int | None = ...,
+ Fs: float | None = ...,
+ Fc: int | None = ...,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike], ArrayLike]
+ | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ noverlap: int | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ scale_by_freq: bool | None = ...,
+ return_line: bool | None = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray] | tuple[np.ndarray, np.ndarray, Line2D]: ...
+ def magnitude_spectrum(
+ self,
+ x: ArrayLike,
+ *,
+ Fs: float | None = ...,
+ Fc: int | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ scale: Literal["default", "linear", "dB"] | None = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray, Line2D]: ...
+ def angle_spectrum(
+ self,
+ x: ArrayLike,
+ *,
+ Fs: float | None = ...,
+ Fc: int | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray, Line2D]: ...
+ def phase_spectrum(
+ self,
+ x: ArrayLike,
+ *,
+ Fs: float | None = ...,
+ Fc: int | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray, Line2D]: ...
+ def cohere(
+ self,
+ x: ArrayLike,
+ y: ArrayLike,
+ *,
+ NFFT: int = ...,
+ Fs: float = ...,
+ Fc: int = ...,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike], ArrayLike] = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike = ...,
+ noverlap: int = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] = ...,
+ scale_by_freq: bool | None = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray]: ...
+ def specgram(
+ self,
+ x: ArrayLike,
+ *,
+ NFFT: int | None = ...,
+ Fs: float | None = ...,
+ Fc: int | None = ...,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike], ArrayLike]
+ | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ noverlap: int | None = ...,
+ cmap: str | Colormap | None = ...,
+ xextent: tuple[float, float] | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ scale_by_freq: bool | None = ...,
+ mode: Literal["default", "psd", "magnitude", "angle", "phase"] | None = ...,
+ scale: Literal["default", "linear", "dB"] | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ data=...,
+ **kwargs
+ ) -> tuple[np.ndarray, np.ndarray, np.ndarray, AxesImage]: ...
+ def spy(
+ self,
+ Z: ArrayLike,
+ *,
+ precision: float | Literal["present"] = ...,
+ marker: str | None = ...,
+ markersize: float | None = ...,
+ aspect: Literal["equal", "auto"] | float | None = ...,
+ origin: Literal["upper", "lower"] = ...,
+ **kwargs
+ ) -> AxesImage: ...
+ def matshow(self, Z: ArrayLike, **kwargs) -> AxesImage: ...
+ def violinplot(
+ self,
+ dataset: ArrayLike | Sequence[ArrayLike],
+ positions: ArrayLike | None = ...,
+ *,
+ vert: bool | None = ...,
+ orientation: Literal["vertical", "horizontal"] = ...,
+ widths: float | ArrayLike = ...,
+ showmeans: bool = ...,
+ showextrema: bool = ...,
+ showmedians: bool = ...,
+ quantiles: Sequence[float | Sequence[float]] | None = ...,
+ points: int = ...,
+ bw_method: Literal["scott", "silverman"]
+ | float
+ | Callable[[GaussianKDE], float]
+ | None = ...,
+ side: Literal["both", "low", "high"] = ...,
+ data=...,
+ ) -> dict[str, Collection]: ...
+ def violin(
+ self,
+ vpstats: Sequence[dict[str, Any]],
+ positions: ArrayLike | None = ...,
+ *,
+ vert: bool | None = ...,
+ orientation: Literal["vertical", "horizontal"] = ...,
+ widths: float | ArrayLike = ...,
+ showmeans: bool = ...,
+ showextrema: bool = ...,
+ showmedians: bool = ...,
+ side: Literal["both", "low", "high"] = ...,
+ ) -> dict[str, Collection]: ...
+
+ table = mtable.table
+ stackplot = mstack.stackplot
+ streamplot = mstream.streamplot
+ tricontour = mtri.tricontour
+ tricontourf = mtri.tricontourf
+ tripcolor = mtri.tripcolor
+ triplot = mtri.triplot
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_base.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_base.py
new file mode 100644
index 0000000000000000000000000000000000000000..0078b799b159b5d493c5a189c8f3c0bc7e077367
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_base.py
@@ -0,0 +1,4836 @@
+from collections.abc import Iterable, Sequence
+from contextlib import ExitStack
+import functools
+import inspect
+import logging
+from numbers import Real
+from operator import attrgetter
+import re
+import types
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cbook, _docstring, offsetbox
+import matplotlib.artist as martist
+import matplotlib.axis as maxis
+from matplotlib.cbook import _OrderedSet, _check_1d, index_of
+import matplotlib.collections as mcoll
+import matplotlib.colors as mcolors
+import matplotlib.font_manager as font_manager
+from matplotlib.gridspec import SubplotSpec
+import matplotlib.image as mimage
+import matplotlib.lines as mlines
+import matplotlib.patches as mpatches
+from matplotlib.rcsetup import cycler, validate_axisbelow
+import matplotlib.spines as mspines
+import matplotlib.table as mtable
+import matplotlib.text as mtext
+import matplotlib.ticker as mticker
+import matplotlib.transforms as mtransforms
+
+_log = logging.getLogger(__name__)
+
+
+class _axis_method_wrapper:
+ """
+ Helper to generate Axes methods wrapping Axis methods.
+
+ After ::
+
+ get_foo = _axis_method_wrapper("xaxis", "get_bar")
+
+ (in the body of a class) ``get_foo`` is a method that forwards it arguments
+ to the ``get_bar`` method of the ``xaxis`` attribute, and gets its
+ signature and docstring from ``Axis.get_bar``.
+
+ The docstring of ``get_foo`` is built by replacing "this Axis" by "the
+ {attr_name}" (i.e., "the xaxis", "the yaxis") in the wrapped method's
+ dedented docstring; additional replacements can be given in *doc_sub*.
+ """
+
+ def __init__(self, attr_name, method_name, *, doc_sub=None):
+ self.attr_name = attr_name
+ self.method_name = method_name
+ # Immediately put the docstring in ``self.__doc__`` so that docstring
+ # manipulations within the class body work as expected.
+ doc = inspect.getdoc(getattr(maxis.Axis, method_name))
+ self._missing_subs = []
+ if doc:
+ doc_sub = {"this Axis": f"the {self.attr_name}", **(doc_sub or {})}
+ for k, v in doc_sub.items():
+ if k not in doc: # Delay raising error until we know qualname.
+ self._missing_subs.append(k)
+ doc = doc.replace(k, v)
+ self.__doc__ = doc
+
+ def __set_name__(self, owner, name):
+ # This is called at the end of the class body as
+ # ``self.__set_name__(cls, name_under_which_self_is_assigned)``; we
+ # rely on that to give the wrapper the correct __name__/__qualname__.
+ get_method = attrgetter(f"{self.attr_name}.{self.method_name}")
+
+ def wrapper(self, *args, **kwargs):
+ return get_method(self)(*args, **kwargs)
+
+ wrapper.__module__ = owner.__module__
+ wrapper.__name__ = name
+ wrapper.__qualname__ = f"{owner.__qualname__}.{name}"
+ wrapper.__doc__ = self.__doc__
+ # Manually copy the signature instead of using functools.wraps because
+ # displaying the Axis method source when asking for the Axes method
+ # source would be confusing.
+ wrapper.__signature__ = inspect.signature(
+ getattr(maxis.Axis, self.method_name))
+
+ if self._missing_subs:
+ raise ValueError(
+ "The definition of {} expected that the docstring of Axis.{} "
+ "contains {!r} as substrings".format(
+ wrapper.__qualname__, self.method_name,
+ ", ".join(map(repr, self._missing_subs))))
+
+ setattr(owner, name, wrapper)
+
+
+class _TransformedBoundsLocator:
+ """
+ Axes locator for `.Axes.inset_axes` and similarly positioned Axes.
+
+ The locator is a callable object used in `.Axes.set_aspect` to compute the
+ Axes location depending on the renderer.
+ """
+
+ def __init__(self, bounds, transform):
+ """
+ *bounds* (a ``[l, b, w, h]`` rectangle) and *transform* together
+ specify the position of the inset Axes.
+ """
+ self._bounds = bounds
+ self._transform = transform
+
+ def __call__(self, ax, renderer):
+ # Subtracting transSubfigure will typically rely on inverted(),
+ # freezing the transform; thus, this needs to be delayed until draw
+ # time as transSubfigure may otherwise change after this is evaluated.
+ return mtransforms.TransformedBbox(
+ mtransforms.Bbox.from_bounds(*self._bounds),
+ self._transform - ax.get_figure(root=False).transSubfigure)
+
+
+def _process_plot_format(fmt, *, ambiguous_fmt_datakey=False):
+ """
+ Convert a MATLAB style color/line style format string to a (*linestyle*,
+ *marker*, *color*) tuple.
+
+ Example format strings include:
+
+ * 'ko': black circles
+ * '.b': blue dots
+ * 'r--': red dashed lines
+ * 'C2--': the third color in the color cycle, dashed lines
+
+ The format is absolute in the sense that if a linestyle or marker is not
+ defined in *fmt*, there is no line or marker. This is expressed by
+ returning 'None' for the respective quantity.
+
+ See Also
+ --------
+ matplotlib.Line2D.lineStyles, matplotlib.colors.cnames
+ All possible styles and color format strings.
+ """
+
+ linestyle = None
+ marker = None
+ color = None
+
+ # First check whether fmt is just a colorspec, but specifically exclude the
+ # grayscale string "1" (not "1.0"), which is interpreted as the tri_down
+ # marker "1". The grayscale string "0" could be unambiguously understood
+ # as a color (black) but also excluded for consistency.
+ if fmt not in ["0", "1"]:
+ try:
+ color = mcolors.to_rgba(fmt)
+ return linestyle, marker, color
+ except ValueError:
+ pass
+
+ errfmt = ("{!r} is neither a data key nor a valid format string ({})"
+ if ambiguous_fmt_datakey else
+ "{!r} is not a valid format string ({})")
+
+ i = 0
+ while i < len(fmt):
+ c = fmt[i]
+ if fmt[i:i+2] in mlines.lineStyles: # First, the two-char styles.
+ if linestyle is not None:
+ raise ValueError(errfmt.format(fmt, "two linestyle symbols"))
+ linestyle = fmt[i:i+2]
+ i += 2
+ elif c in mlines.lineStyles:
+ if linestyle is not None:
+ raise ValueError(errfmt.format(fmt, "two linestyle symbols"))
+ linestyle = c
+ i += 1
+ elif c in mlines.lineMarkers:
+ if marker is not None:
+ raise ValueError(errfmt.format(fmt, "two marker symbols"))
+ marker = c
+ i += 1
+ elif c in mcolors.get_named_colors_mapping():
+ if color is not None:
+ raise ValueError(errfmt.format(fmt, "two color symbols"))
+ color = c
+ i += 1
+ elif c == "C":
+ cn_color = re.match(r"C\d+", fmt[i:])
+ if not cn_color:
+ raise ValueError(errfmt.format(fmt, "'C' must be followed by a number"))
+ color = mcolors.to_rgba(cn_color[0])
+ i += len(cn_color[0])
+ else:
+ raise ValueError(errfmt.format(fmt, f"unrecognized character {c!r}"))
+
+ if linestyle is None and marker is None:
+ linestyle = mpl.rcParams['lines.linestyle']
+ if linestyle is None:
+ linestyle = 'None'
+ if marker is None:
+ marker = 'None'
+
+ return linestyle, marker, color
+
+
+class _process_plot_var_args:
+ """
+ Process variable length arguments to `~.Axes.plot`, to support ::
+
+ plot(t, s)
+ plot(t1, s1, t2, s2)
+ plot(t1, s1, 'ko', t2, s2)
+ plot(t1, s1, 'ko', t2, s2, 'r--', t3, e3)
+
+ an arbitrary number of *x*, *y*, *fmt* are allowed
+ """
+
+ def __init__(self, output='Line2D'):
+ _api.check_in_list(['Line2D', 'Polygon', 'coordinates'], output=output)
+ self.output = output
+ self.set_prop_cycle(None)
+
+ def set_prop_cycle(self, cycler):
+ if cycler is None:
+ cycler = mpl.rcParams['axes.prop_cycle']
+ self._idx = 0
+ self._cycler_items = [*cycler]
+
+ def __call__(self, axes, *args, data=None, return_kwargs=False, **kwargs):
+ axes._process_unit_info(kwargs=kwargs)
+
+ for pos_only in "xy":
+ if pos_only in kwargs:
+ raise _api.kwarg_error(inspect.stack()[1].function, pos_only)
+
+ if not args:
+ return
+
+ if data is None: # Process dict views
+ args = [cbook.sanitize_sequence(a) for a in args]
+ else: # Process the 'data' kwarg.
+ replaced = [mpl._replacer(data, arg) for arg in args]
+ if len(args) == 1:
+ label_namer_idx = 0
+ elif len(args) == 2: # Can be x, y or y, c.
+ # Figure out what the second argument is.
+ # 1) If the second argument cannot be a format shorthand, the
+ # second argument is the label_namer.
+ # 2) Otherwise (it could have been a format shorthand),
+ # a) if we did perform a substitution, emit a warning, and
+ # use it as label_namer.
+ # b) otherwise, it is indeed a format shorthand; use the
+ # first argument as label_namer.
+ try:
+ _process_plot_format(args[1])
+ except ValueError: # case 1)
+ label_namer_idx = 1
+ else:
+ if replaced[1] is not args[1]: # case 2a)
+ _api.warn_external(
+ f"Second argument {args[1]!r} is ambiguous: could "
+ f"be a format string but is in 'data'; using as "
+ f"data. If it was intended as data, set the "
+ f"format string to an empty string to suppress "
+ f"this warning. If it was intended as a format "
+ f"string, explicitly pass the x-values as well. "
+ f"Alternatively, rename the entry in 'data'.",
+ RuntimeWarning)
+ label_namer_idx = 1
+ else: # case 2b)
+ label_namer_idx = 0
+ elif len(args) == 3:
+ label_namer_idx = 1
+ else:
+ raise ValueError(
+ "Using arbitrary long args with data is not supported due "
+ "to ambiguity of arguments; use multiple plotting calls "
+ "instead")
+ if kwargs.get("label") is None:
+ kwargs["label"] = mpl._label_from_arg(
+ replaced[label_namer_idx], args[label_namer_idx])
+ args = replaced
+ ambiguous_fmt_datakey = data is not None and len(args) == 2
+
+ if len(args) >= 4 and not cbook.is_scalar_or_string(
+ kwargs.get("label")):
+ raise ValueError("plot() with multiple groups of data (i.e., "
+ "pairs of x and y) does not support multiple "
+ "labels")
+
+ # Repeatedly grab (x, y) or (x, y, format) from the front of args and
+ # massage them into arguments to plot() or fill().
+
+ while args:
+ this, args = args[:2], args[2:]
+ if args and isinstance(args[0], str):
+ this += args[0],
+ args = args[1:]
+ yield from self._plot_args(
+ axes, this, kwargs, ambiguous_fmt_datakey=ambiguous_fmt_datakey,
+ return_kwargs=return_kwargs
+ )
+
+ def get_next_color(self):
+ """Return the next color in the cycle."""
+ entry = self._cycler_items[self._idx]
+ if "color" in entry:
+ self._idx = (self._idx + 1) % len(self._cycler_items) # Advance cycler.
+ return entry["color"]
+ else:
+ return "k"
+
+ def _getdefaults(self, kw, ignore=frozenset()):
+ """
+ If some keys in the property cycle (excluding those in the set
+ *ignore*) are absent or set to None in the dict *kw*, return a copy
+ of the next entry in the property cycle, excluding keys in *ignore*.
+ Otherwise, don't advance the property cycle, and return an empty dict.
+ """
+ defaults = self._cycler_items[self._idx]
+ if any(kw.get(k, None) is None for k in {*defaults} - ignore):
+ self._idx = (self._idx + 1) % len(self._cycler_items) # Advance cycler.
+ # Return a new dict to avoid exposing _cycler_items entries to mutation.
+ return {k: v for k, v in defaults.items() if k not in ignore}
+ else:
+ return {}
+
+ def _setdefaults(self, defaults, kw):
+ """
+ Add to the dict *kw* the entries in the dict *default* that are absent
+ or set to None in *kw*.
+ """
+ for k in defaults:
+ if kw.get(k, None) is None:
+ kw[k] = defaults[k]
+
+ def _make_line(self, axes, x, y, kw, kwargs):
+ kw = {**kw, **kwargs} # Don't modify the original kw.
+ self._setdefaults(self._getdefaults(kw), kw)
+ seg = mlines.Line2D(x, y, **kw)
+ return seg, kw
+
+ def _make_coordinates(self, axes, x, y, kw, kwargs):
+ kw = {**kw, **kwargs} # Don't modify the original kw.
+ self._setdefaults(self._getdefaults(kw), kw)
+ return (x, y), kw
+
+ def _make_polygon(self, axes, x, y, kw, kwargs):
+ # Polygon doesn't directly support unitized inputs.
+ x = axes.convert_xunits(x)
+ y = axes.convert_yunits(y)
+
+ kw = kw.copy() # Don't modify the original kw.
+ kwargs = kwargs.copy()
+
+ # Ignore 'marker'-related properties as they aren't Polygon
+ # properties, but they are Line2D properties, and so they are
+ # likely to appear in the default cycler construction.
+ # This is done here to the defaults dictionary as opposed to the
+ # other two dictionaries because we do want to capture when a
+ # *user* explicitly specifies a marker which should be an error.
+ # We also want to prevent advancing the cycler if there are no
+ # defaults needed after ignoring the given properties.
+ ignores = ({'marker', 'markersize', 'markeredgecolor',
+ 'markerfacecolor', 'markeredgewidth'}
+ # Also ignore anything provided by *kwargs*.
+ | {k for k, v in kwargs.items() if v is not None})
+
+ # Only using the first dictionary to use as basis
+ # for getting defaults for back-compat reasons.
+ # Doing it with both seems to mess things up in
+ # various places (probably due to logic bugs elsewhere).
+ default_dict = self._getdefaults(kw, ignores)
+ self._setdefaults(default_dict, kw)
+
+ # Looks like we don't want "color" to be interpreted to
+ # mean both facecolor and edgecolor for some reason.
+ # So the "kw" dictionary is thrown out, and only its
+ # 'color' value is kept and translated as a 'facecolor'.
+ # This design should probably be revisited as it increases
+ # complexity.
+ facecolor = kw.get('color', None)
+
+ # Throw out 'color' as it is now handled as a facecolor
+ default_dict.pop('color', None)
+
+ # To get other properties set from the cycler
+ # modify the kwargs dictionary.
+ self._setdefaults(default_dict, kwargs)
+
+ seg = mpatches.Polygon(np.column_stack((x, y)),
+ facecolor=facecolor,
+ fill=kwargs.get('fill', True),
+ closed=kw['closed'])
+ seg.set(**kwargs)
+ return seg, kwargs
+
+ def _plot_args(self, axes, tup, kwargs, *,
+ return_kwargs=False, ambiguous_fmt_datakey=False):
+ """
+ Process the arguments of ``plot([x], y, [fmt], **kwargs)`` calls.
+
+ This processes a single set of ([x], y, [fmt]) parameters; i.e. for
+ ``plot(x, y, x2, y2)`` it will be called twice. Once for (x, y) and
+ once for (x2, y2).
+
+ x and y may be 2D and thus can still represent multiple datasets.
+
+ For multiple datasets, if the keyword argument *label* is a list, this
+ will unpack the list and assign the individual labels to the datasets.
+
+ Parameters
+ ----------
+ tup : tuple
+ A tuple of the positional parameters. This can be one of
+
+ - (y,)
+ - (x, y)
+ - (y, fmt)
+ - (x, y, fmt)
+
+ kwargs : dict
+ The keyword arguments passed to ``plot()``.
+
+ return_kwargs : bool
+ Whether to also return the effective keyword arguments after label
+ unpacking as well.
+
+ ambiguous_fmt_datakey : bool
+ Whether the format string in *tup* could also have been a
+ misspelled data key.
+
+ Returns
+ -------
+ result
+ If *return_kwargs* is false, a list of Artists representing the
+ dataset(s).
+ If *return_kwargs* is true, a list of (Artist, effective_kwargs)
+ representing the dataset(s). See *return_kwargs*.
+ The Artist is either `.Line2D` (if called from ``plot()``) or
+ `.Polygon` otherwise.
+ """
+ if len(tup) > 1 and isinstance(tup[-1], str):
+ # xy is tup with fmt stripped (could still be (y,) only)
+ *xy, fmt = tup
+ linestyle, marker, color = _process_plot_format(
+ fmt, ambiguous_fmt_datakey=ambiguous_fmt_datakey)
+ elif len(tup) == 3:
+ raise ValueError('third arg must be a format string')
+ else:
+ xy = tup
+ linestyle, marker, color = None, None, None
+
+ # Don't allow any None value; these would be up-converted to one
+ # element array of None which causes problems downstream.
+ if any(v is None for v in tup):
+ raise ValueError("x, y, and format string must not be None")
+
+ kw = {}
+ for prop_name, val in zip(('linestyle', 'marker', 'color'),
+ (linestyle, marker, color)):
+ if val is not None:
+ # check for conflicts between fmt and kwargs
+ if (fmt.lower() != 'none'
+ and prop_name in kwargs
+ and val != 'None'):
+ # Technically ``plot(x, y, 'o', ls='--')`` is a conflict
+ # because 'o' implicitly unsets the linestyle
+ # (linestyle='None').
+ # We'll gracefully not warn in this case because an
+ # explicit set via kwargs can be seen as intention to
+ # override an implicit unset.
+ # Note: We don't val.lower() != 'none' because val is not
+ # necessarily a string (can be a tuple for colors). This
+ # is safe, because *val* comes from _process_plot_format()
+ # which only returns 'None'.
+ _api.warn_external(
+ f"{prop_name} is redundantly defined by the "
+ f"'{prop_name}' keyword argument and the fmt string "
+ f'"{fmt}" (-> {prop_name}={val!r}). The keyword '
+ f"argument will take precedence.")
+ kw[prop_name] = val
+
+ if len(xy) == 2:
+ x = _check_1d(xy[0])
+ y = _check_1d(xy[1])
+ else:
+ x, y = index_of(xy[-1])
+
+ if axes.xaxis is not None:
+ axes.xaxis.update_units(x)
+ if axes.yaxis is not None:
+ axes.yaxis.update_units(y)
+
+ if x.shape[0] != y.shape[0]:
+ raise ValueError(f"x and y must have same first dimension, but "
+ f"have shapes {x.shape} and {y.shape}")
+ if x.ndim > 2 or y.ndim > 2:
+ raise ValueError(f"x and y can be no greater than 2D, but have "
+ f"shapes {x.shape} and {y.shape}")
+ if x.ndim == 1:
+ x = x[:, np.newaxis]
+ if y.ndim == 1:
+ y = y[:, np.newaxis]
+
+ if self.output == 'Line2D':
+ make_artist = self._make_line
+ elif self.output == 'Polygon':
+ kw['closed'] = kwargs.get('closed', True)
+ make_artist = self._make_polygon
+ elif self.output == 'coordinates':
+ make_artist = self._make_coordinates
+ else:
+ _api.check_in_list(['Line2D', 'Polygon', 'coordinates'], output=self.output)
+
+ ncx, ncy = x.shape[1], y.shape[1]
+ if ncx > 1 and ncy > 1 and ncx != ncy:
+ raise ValueError(f"x has {ncx} columns but y has {ncy} columns")
+ if ncx == 0 or ncy == 0:
+ return []
+
+ label = kwargs.get('label')
+ n_datasets = max(ncx, ncy)
+
+ if cbook.is_scalar_or_string(label):
+ labels = [label] * n_datasets
+ elif len(label) == n_datasets:
+ labels = label
+ elif n_datasets == 1:
+ msg = (f'Passing label as a length {len(label)} sequence when '
+ 'plotting a single dataset is deprecated in Matplotlib 3.9 '
+ 'and will error in 3.11. To keep the current behavior, '
+ 'cast the sequence to string before passing.')
+ _api.warn_deprecated('3.9', message=msg)
+ labels = [label]
+ else:
+ raise ValueError(
+ f"label must be scalar or have the same length as the input "
+ f"data, but found {len(label)} for {n_datasets} datasets.")
+
+ result = (make_artist(axes, x[:, j % ncx], y[:, j % ncy], kw,
+ {**kwargs, 'label': label})
+ for j, label in enumerate(labels))
+
+ if return_kwargs:
+ return list(result)
+ else:
+ return [l[0] for l in result]
+
+
+@_api.define_aliases({"facecolor": ["fc"]})
+class _AxesBase(martist.Artist):
+ name = "rectilinear"
+
+ # axis names are the prefixes for the attributes that contain the
+ # respective axis; e.g. 'x' <-> self.xaxis, containing an XAxis.
+ # Note that PolarAxes uses these attributes as well, so that we have
+ # 'x' <-> self.xaxis, containing a ThetaAxis. In particular we do not
+ # have 'theta' in _axis_names.
+ # In practice, this is ('x', 'y') for all 2D Axes and ('x', 'y', 'z')
+ # for Axes3D.
+ _axis_names = ("x", "y")
+ _shared_axes = {name: cbook.Grouper() for name in _axis_names}
+ _twinned_axes = cbook.Grouper()
+
+ _subclass_uses_cla = False
+
+ dataLim: mtransforms.Bbox
+ """The bounding `.Bbox` enclosing all data displayed in the Axes."""
+
+ spines: mspines.Spines
+ """
+ The `.Spines` container for the Axes' spines, i.e. the lines denoting the
+ data area boundaries.
+ """
+
+ xaxis: maxis.XAxis
+ """
+ The `.XAxis` instance.
+
+ Common axis-related configuration can be achieved through high-level wrapper
+ methods on Axes; e.g. `ax.set_xticks <.Axes.set_xticks>` is a shortcut for
+ `ax.xaxis.set_ticks <.Axis.set_ticks>`. The *xaxis* attribute gives direct
+ direct access to the underlying `~.axis.Axis` if you need more control.
+
+ See also
+
+ - :ref:`Axis wrapper methods on Axes `
+ - :doc:`Axis API `
+ """
+
+ yaxis: maxis.YAxis
+ """
+ The `.YAxis` instance.
+
+ Common axis-related configuration can be achieved through high-level wrapper
+ methods on Axes; e.g. `ax.set_yticks <.Axes.set_yticks>` is a shortcut for
+ `ax.yaxis.set_ticks <.Axis.set_ticks>`. The *yaxis* attribute gives direct
+ access to the underlying `~.axis.Axis` if you need more control.
+
+ See also
+
+ - :ref:`Axis wrapper methods on Axes `
+ - :doc:`Axis API `
+ """
+
+ @property
+ def _axis_map(self):
+ """A mapping of axis names, e.g. 'x', to `Axis` instances."""
+ return {name: getattr(self, f"{name}axis")
+ for name in self._axis_names}
+
+ def __str__(self):
+ return "{0}({1[0]:g},{1[1]:g};{1[2]:g}x{1[3]:g})".format(
+ type(self).__name__, self._position.bounds)
+
+ def __init__(self, fig,
+ *args,
+ facecolor=None, # defaults to rc axes.facecolor
+ frameon=True,
+ sharex=None, # use Axes instance's xaxis info
+ sharey=None, # use Axes instance's yaxis info
+ label='',
+ xscale=None,
+ yscale=None,
+ box_aspect=None,
+ forward_navigation_events="auto",
+ **kwargs
+ ):
+ """
+ Build an Axes in a figure.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ The Axes is built in the `.Figure` *fig*.
+
+ *args
+ ``*args`` can be a single ``(left, bottom, width, height)``
+ rectangle or a single `.Bbox`. This specifies the rectangle (in
+ figure coordinates) where the Axes is positioned.
+
+ ``*args`` can also consist of three numbers or a single three-digit
+ number; in the latter case, the digits are considered as
+ independent numbers. The numbers are interpreted as ``(nrows,
+ ncols, index)``: ``(nrows, ncols)`` specifies the size of an array
+ of subplots, and ``index`` is the 1-based index of the subplot
+ being created. Finally, ``*args`` can also directly be a
+ `.SubplotSpec` instance.
+
+ sharex, sharey : `~matplotlib.axes.Axes`, optional
+ The x- or y-`~.matplotlib.axis` is shared with the x- or y-axis in
+ the input `~.axes.Axes`. Note that it is not possible to unshare
+ axes.
+
+ frameon : bool, default: True
+ Whether the Axes frame is visible.
+
+ box_aspect : float, optional
+ Set a fixed aspect for the Axes box, i.e. the ratio of height to
+ width. See `~.axes.Axes.set_box_aspect` for details.
+
+ forward_navigation_events : bool or "auto", default: "auto"
+ Control whether pan/zoom events are passed through to Axes below
+ this one. "auto" is *True* for axes with an invisible patch and
+ *False* otherwise.
+
+ **kwargs
+ Other optional keyword arguments:
+
+ %(Axes:kwdoc)s
+
+ Returns
+ -------
+ `~.axes.Axes`
+ The new `~.axes.Axes` object.
+ """
+
+ super().__init__()
+ if "rect" in kwargs:
+ if args:
+ raise TypeError(
+ "'rect' cannot be used together with positional arguments")
+ rect = kwargs.pop("rect")
+ _api.check_isinstance((mtransforms.Bbox, Iterable), rect=rect)
+ args = (rect,)
+ subplotspec = None
+ if len(args) == 1 and isinstance(args[0], mtransforms.Bbox):
+ self._position = args[0].frozen()
+ elif len(args) == 1 and np.iterable(args[0]):
+ self._position = mtransforms.Bbox.from_bounds(*args[0])
+ else:
+ self._position = self._originalPosition = mtransforms.Bbox.unit()
+ subplotspec = SubplotSpec._from_subplot_args(fig, args)
+ if self._position.width < 0 or self._position.height < 0:
+ raise ValueError('Width and height specified must be non-negative')
+ self._originalPosition = self._position.frozen()
+ self.axes = self
+ self._aspect = 'auto'
+ self._adjustable = 'box'
+ self._anchor = 'C'
+ self._stale_viewlims = dict.fromkeys(self._axis_names, False)
+ self._forward_navigation_events = forward_navigation_events
+ self._sharex = sharex
+ self._sharey = sharey
+ self.set_label(label)
+ self.set_figure(fig)
+ # The subplotspec needs to be set after the figure (so that
+ # figure-level subplotpars are taken into account), but the figure
+ # needs to be set after self._position is initialized.
+ if subplotspec:
+ self.set_subplotspec(subplotspec)
+ else:
+ self._subplotspec = None
+ self.set_box_aspect(box_aspect)
+ self._axes_locator = None # Optionally set via update(kwargs).
+
+ self._children = []
+
+ # placeholder for any colorbars added that use this Axes.
+ # (see colorbar.py):
+ self._colorbars = []
+ self.spines = mspines.Spines.from_dict(self._gen_axes_spines())
+
+ # this call may differ for non-sep axes, e.g., polar
+ self._init_axis()
+ if facecolor is None:
+ facecolor = mpl.rcParams['axes.facecolor']
+ self._facecolor = facecolor
+ self._frameon = frameon
+ self.set_axisbelow(mpl.rcParams['axes.axisbelow'])
+
+ self._rasterization_zorder = None
+ self.clear()
+
+ # funcs used to format x and y - fall back on major formatters
+ self.fmt_xdata = None
+ self.fmt_ydata = None
+
+ self.set_navigate(True)
+ self.set_navigate_mode(None)
+
+ if xscale:
+ self.set_xscale(xscale)
+ if yscale:
+ self.set_yscale(yscale)
+
+ self._internal_update(kwargs)
+
+ for name, axis in self._axis_map.items():
+ axis.callbacks._connect_picklable(
+ 'units', self._unit_change_handler(name))
+
+ rcParams = mpl.rcParams
+ self.tick_params(
+ top=rcParams['xtick.top'] and rcParams['xtick.minor.top'],
+ bottom=rcParams['xtick.bottom'] and rcParams['xtick.minor.bottom'],
+ labeltop=(rcParams['xtick.labeltop'] and
+ rcParams['xtick.minor.top']),
+ labelbottom=(rcParams['xtick.labelbottom'] and
+ rcParams['xtick.minor.bottom']),
+ left=rcParams['ytick.left'] and rcParams['ytick.minor.left'],
+ right=rcParams['ytick.right'] and rcParams['ytick.minor.right'],
+ labelleft=(rcParams['ytick.labelleft'] and
+ rcParams['ytick.minor.left']),
+ labelright=(rcParams['ytick.labelright'] and
+ rcParams['ytick.minor.right']),
+ which='minor')
+
+ self.tick_params(
+ top=rcParams['xtick.top'] and rcParams['xtick.major.top'],
+ bottom=rcParams['xtick.bottom'] and rcParams['xtick.major.bottom'],
+ labeltop=(rcParams['xtick.labeltop'] and
+ rcParams['xtick.major.top']),
+ labelbottom=(rcParams['xtick.labelbottom'] and
+ rcParams['xtick.major.bottom']),
+ left=rcParams['ytick.left'] and rcParams['ytick.major.left'],
+ right=rcParams['ytick.right'] and rcParams['ytick.major.right'],
+ labelleft=(rcParams['ytick.labelleft'] and
+ rcParams['ytick.major.left']),
+ labelright=(rcParams['ytick.labelright'] and
+ rcParams['ytick.major.right']),
+ which='major')
+
+ def __init_subclass__(cls, **kwargs):
+ parent_uses_cla = super(cls, cls)._subclass_uses_cla
+ if 'cla' in cls.__dict__:
+ _api.warn_deprecated(
+ '3.6',
+ pending=True,
+ message=f'Overriding `Axes.cla` in {cls.__qualname__} is '
+ 'pending deprecation in %(since)s and will be fully '
+ 'deprecated in favor of `Axes.clear` in the future. '
+ 'Please report '
+ f'this to the {cls.__module__!r} author.')
+ cls._subclass_uses_cla = 'cla' in cls.__dict__ or parent_uses_cla
+ super().__init_subclass__(**kwargs)
+
+ def __getstate__(self):
+ state = super().__getstate__()
+ # Prune the sharing & twinning info to only contain the current group.
+ state["_shared_axes"] = {
+ name: self._shared_axes[name].get_siblings(self)
+ for name in self._axis_names if self in self._shared_axes[name]}
+ state["_twinned_axes"] = (self._twinned_axes.get_siblings(self)
+ if self in self._twinned_axes else None)
+ return state
+
+ def __setstate__(self, state):
+ # Merge the grouping info back into the global groupers.
+ shared_axes = state.pop("_shared_axes")
+ for name, shared_siblings in shared_axes.items():
+ self._shared_axes[name].join(*shared_siblings)
+ twinned_siblings = state.pop("_twinned_axes")
+ if twinned_siblings:
+ self._twinned_axes.join(*twinned_siblings)
+ self.__dict__ = state
+ self._stale = True
+
+ def __repr__(self):
+ fields = []
+ if self.get_label():
+ fields += [f"label={self.get_label()!r}"]
+ if hasattr(self, "get_title"):
+ titles = {}
+ for k in ["left", "center", "right"]:
+ title = self.get_title(loc=k)
+ if title:
+ titles[k] = title
+ if titles:
+ fields += [f"title={titles}"]
+ for name, axis in self._axis_map.items():
+ if axis.label and axis.label.get_text():
+ fields += [f"{name}label={axis.label.get_text()!r}"]
+ return f"<{self.__class__.__name__}: " + ", ".join(fields) + ">"
+
+ def get_subplotspec(self):
+ """Return the `.SubplotSpec` associated with the subplot, or None."""
+ return self._subplotspec
+
+ def set_subplotspec(self, subplotspec):
+ """Set the `.SubplotSpec`. associated with the subplot."""
+ self._subplotspec = subplotspec
+ self._set_position(subplotspec.get_position(self.get_figure(root=False)))
+
+ def get_gridspec(self):
+ """Return the `.GridSpec` associated with the subplot, or None."""
+ return self._subplotspec.get_gridspec() if self._subplotspec else None
+
+ def get_window_extent(self, renderer=None):
+ """
+ Return the Axes bounding box in display space.
+
+ This bounding box does not include the spines, ticks, ticklabels,
+ or other labels. For a bounding box including these elements use
+ `~matplotlib.axes.Axes.get_tightbbox`.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.get_tightbbox
+ matplotlib.axis.Axis.get_tightbbox
+ matplotlib.spines.Spine.get_window_extent
+ """
+ return self.bbox
+
+ def _init_axis(self):
+ # This is moved out of __init__ because non-separable axes don't use it
+ self.xaxis = maxis.XAxis(self, clear=False)
+ self.spines.bottom.register_axis(self.xaxis)
+ self.spines.top.register_axis(self.xaxis)
+ self.yaxis = maxis.YAxis(self, clear=False)
+ self.spines.left.register_axis(self.yaxis)
+ self.spines.right.register_axis(self.yaxis)
+
+ def set_figure(self, fig):
+ # docstring inherited
+ super().set_figure(fig)
+
+ self.bbox = mtransforms.TransformedBbox(self._position,
+ fig.transSubfigure)
+ # these will be updated later as data is added
+ self.dataLim = mtransforms.Bbox.null()
+ self._viewLim = mtransforms.Bbox.unit()
+ self.transScale = mtransforms.TransformWrapper(
+ mtransforms.IdentityTransform())
+
+ self._set_lim_and_transforms()
+
+ def _unstale_viewLim(self):
+ # We should arrange to store this information once per share-group
+ # instead of on every axis.
+ need_scale = {
+ name: any(ax._stale_viewlims[name]
+ for ax in self._shared_axes[name].get_siblings(self))
+ for name in self._axis_names}
+ if any(need_scale.values()):
+ for name in need_scale:
+ for ax in self._shared_axes[name].get_siblings(self):
+ ax._stale_viewlims[name] = False
+ self.autoscale_view(**{f"scale{name}": scale
+ for name, scale in need_scale.items()})
+
+ @property
+ def viewLim(self):
+ """The view limits as `.Bbox` in data coordinates."""
+ self._unstale_viewLim()
+ return self._viewLim
+
+ def _request_autoscale_view(self, axis="all", tight=None):
+ """
+ Mark a single axis, or all of them, as stale wrt. autoscaling.
+
+ No computation is performed until the next autoscaling; thus, separate
+ calls to control individual axises incur negligible performance cost.
+
+ Parameters
+ ----------
+ axis : str, default: "all"
+ Either an element of ``self._axis_names``, or "all".
+ tight : bool or None, default: None
+ """
+ axis_names = _api.check_getitem(
+ {**{k: [k] for k in self._axis_names}, "all": self._axis_names},
+ axis=axis)
+ for name in axis_names:
+ self._stale_viewlims[name] = True
+ if tight is not None:
+ self._tight = tight
+
+ def _set_lim_and_transforms(self):
+ """
+ Set the *_xaxis_transform*, *_yaxis_transform*, *transScale*,
+ *transData*, *transLimits* and *transAxes* transformations.
+
+ .. note::
+
+ This method is primarily used by rectilinear projections of the
+ `~matplotlib.axes.Axes` class, and is meant to be overridden by
+ new kinds of projection Axes that need different transformations
+ and limits. (See `~matplotlib.projections.polar.PolarAxes` for an
+ example.)
+ """
+ self.transAxes = mtransforms.BboxTransformTo(self.bbox)
+
+ # Transforms the x and y axis separately by a scale factor.
+ # It is assumed that this part will have non-linear components
+ # (e.g., for a log scale).
+ self.transScale = mtransforms.TransformWrapper(
+ mtransforms.IdentityTransform())
+
+ # An affine transformation on the data, generally to limit the
+ # range of the axes
+ self.transLimits = mtransforms.BboxTransformFrom(
+ mtransforms.TransformedBbox(self._viewLim, self.transScale))
+
+ # The parentheses are important for efficiency here -- they
+ # group the last two (which are usually affines) separately
+ # from the first (which, with log-scaling can be non-affine).
+ self.transData = self.transScale + (self.transLimits + self.transAxes)
+
+ self._xaxis_transform = mtransforms.blended_transform_factory(
+ self.transData, self.transAxes)
+ self._yaxis_transform = mtransforms.blended_transform_factory(
+ self.transAxes, self.transData)
+
+ def get_xaxis_transform(self, which='grid'):
+ """
+ Get the transformation used for drawing x-axis labels, ticks
+ and gridlines. The x-direction is in data coordinates and the
+ y-direction is in axis coordinates.
+
+ .. note::
+
+ This transformation is primarily used by the
+ `~matplotlib.axis.Axis` class, and is meant to be
+ overridden by new kinds of projections that may need to
+ place axis elements in different locations.
+
+ Parameters
+ ----------
+ which : {'grid', 'tick1', 'tick2'}
+ """
+ if which == 'grid':
+ return self._xaxis_transform
+ elif which == 'tick1':
+ # for cartesian projection, this is bottom spine
+ return self.spines.bottom.get_spine_transform()
+ elif which == 'tick2':
+ # for cartesian projection, this is top spine
+ return self.spines.top.get_spine_transform()
+ else:
+ raise ValueError(f'unknown value for which: {which!r}')
+
+ def get_xaxis_text1_transform(self, pad_points):
+ """
+ Returns
+ -------
+ transform : Transform
+ The transform used for drawing x-axis labels, which will add
+ *pad_points* of padding (in points) between the axis and the label.
+ The x-direction is in data coordinates and the y-direction is in
+ axis coordinates
+ valign : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
+ The text vertical alignment.
+ halign : {'center', 'left', 'right'}
+ The text horizontal alignment.
+
+ Notes
+ -----
+ This transformation is primarily used by the `~matplotlib.axis.Axis`
+ class, and is meant to be overridden by new kinds of projections that
+ may need to place axis elements in different locations.
+ """
+ labels_align = mpl.rcParams["xtick.alignment"]
+ return (self.get_xaxis_transform(which='tick1') +
+ mtransforms.ScaledTranslation(
+ 0, -1 * pad_points / 72,
+ self.get_figure(root=False).dpi_scale_trans),
+ "top", labels_align)
+
+ def get_xaxis_text2_transform(self, pad_points):
+ """
+ Returns
+ -------
+ transform : Transform
+ The transform used for drawing secondary x-axis labels, which will
+ add *pad_points* of padding (in points) between the axis and the
+ label. The x-direction is in data coordinates and the y-direction
+ is in axis coordinates
+ valign : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
+ The text vertical alignment.
+ halign : {'center', 'left', 'right'}
+ The text horizontal alignment.
+
+ Notes
+ -----
+ This transformation is primarily used by the `~matplotlib.axis.Axis`
+ class, and is meant to be overridden by new kinds of projections that
+ may need to place axis elements in different locations.
+ """
+ labels_align = mpl.rcParams["xtick.alignment"]
+ return (self.get_xaxis_transform(which='tick2') +
+ mtransforms.ScaledTranslation(
+ 0, pad_points / 72,
+ self.get_figure(root=False).dpi_scale_trans),
+ "bottom", labels_align)
+
+ def get_yaxis_transform(self, which='grid'):
+ """
+ Get the transformation used for drawing y-axis labels, ticks
+ and gridlines. The x-direction is in axis coordinates and the
+ y-direction is in data coordinates.
+
+ .. note::
+
+ This transformation is primarily used by the
+ `~matplotlib.axis.Axis` class, and is meant to be
+ overridden by new kinds of projections that may need to
+ place axis elements in different locations.
+
+ Parameters
+ ----------
+ which : {'grid', 'tick1', 'tick2'}
+ """
+ if which == 'grid':
+ return self._yaxis_transform
+ elif which == 'tick1':
+ # for cartesian projection, this is bottom spine
+ return self.spines.left.get_spine_transform()
+ elif which == 'tick2':
+ # for cartesian projection, this is top spine
+ return self.spines.right.get_spine_transform()
+ else:
+ raise ValueError(f'unknown value for which: {which!r}')
+
+ def get_yaxis_text1_transform(self, pad_points):
+ """
+ Returns
+ -------
+ transform : Transform
+ The transform used for drawing y-axis labels, which will add
+ *pad_points* of padding (in points) between the axis and the label.
+ The x-direction is in axis coordinates and the y-direction is in
+ data coordinates
+ valign : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
+ The text vertical alignment.
+ halign : {'center', 'left', 'right'}
+ The text horizontal alignment.
+
+ Notes
+ -----
+ This transformation is primarily used by the `~matplotlib.axis.Axis`
+ class, and is meant to be overridden by new kinds of projections that
+ may need to place axis elements in different locations.
+ """
+ labels_align = mpl.rcParams["ytick.alignment"]
+ return (self.get_yaxis_transform(which='tick1') +
+ mtransforms.ScaledTranslation(
+ -1 * pad_points / 72, 0,
+ self.get_figure(root=False).dpi_scale_trans),
+ labels_align, "right")
+
+ def get_yaxis_text2_transform(self, pad_points):
+ """
+ Returns
+ -------
+ transform : Transform
+ The transform used for drawing secondart y-axis labels, which will
+ add *pad_points* of padding (in points) between the axis and the
+ label. The x-direction is in axis coordinates and the y-direction
+ is in data coordinates
+ valign : {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
+ The text vertical alignment.
+ halign : {'center', 'left', 'right'}
+ The text horizontal alignment.
+
+ Notes
+ -----
+ This transformation is primarily used by the `~matplotlib.axis.Axis`
+ class, and is meant to be overridden by new kinds of projections that
+ may need to place axis elements in different locations.
+ """
+ labels_align = mpl.rcParams["ytick.alignment"]
+ return (self.get_yaxis_transform(which='tick2') +
+ mtransforms.ScaledTranslation(
+ pad_points / 72, 0,
+ self.get_figure(root=False).dpi_scale_trans),
+ labels_align, "left")
+
+ def _update_transScale(self):
+ self.transScale.set(
+ mtransforms.blended_transform_factory(
+ self.xaxis.get_transform(), self.yaxis.get_transform()))
+
+ def get_position(self, original=False):
+ """
+ Return the position of the Axes within the figure as a `.Bbox`.
+
+ Parameters
+ ----------
+ original : bool
+ If ``True``, return the original position. Otherwise, return the
+ active position. For an explanation of the positions see
+ `.set_position`.
+
+ Returns
+ -------
+ `.Bbox`
+
+ """
+ if original:
+ return self._originalPosition.frozen()
+ else:
+ locator = self.get_axes_locator()
+ if not locator:
+ self.apply_aspect()
+ return self._position.frozen()
+
+ def set_position(self, pos, which='both'):
+ """
+ Set the Axes position.
+
+ Axes have two position attributes. The 'original' position is the
+ position allocated for the Axes. The 'active' position is the
+ position the Axes is actually drawn at. These positions are usually
+ the same unless a fixed aspect is set to the Axes. See
+ `.Axes.set_aspect` for details.
+
+ Parameters
+ ----------
+ pos : [left, bottom, width, height] or `~matplotlib.transforms.Bbox`
+ The new position of the Axes in `.Figure` coordinates.
+
+ which : {'both', 'active', 'original'}, default: 'both'
+ Determines which position variables to change.
+
+ See Also
+ --------
+ matplotlib.transforms.Bbox.from_bounds
+ matplotlib.transforms.Bbox.from_extents
+ """
+ self._set_position(pos, which=which)
+ # because this is being called externally to the library we
+ # don't let it be in the layout.
+ self.set_in_layout(False)
+
+ def _set_position(self, pos, which='both'):
+ """
+ Private version of set_position.
+
+ Call this internally to get the same functionality of `set_position`,
+ but not to take the axis out of the constrained_layout hierarchy.
+ """
+ if not isinstance(pos, mtransforms.BboxBase):
+ pos = mtransforms.Bbox.from_bounds(*pos)
+ for ax in self._twinned_axes.get_siblings(self):
+ if which in ('both', 'active'):
+ ax._position.set(pos)
+ if which in ('both', 'original'):
+ ax._originalPosition.set(pos)
+ self.stale = True
+
+ def reset_position(self):
+ """
+ Reset the active position to the original position.
+
+ This undoes changes to the active position (as defined in
+ `.set_position`) which may have been performed to satisfy fixed-aspect
+ constraints.
+ """
+ for ax in self._twinned_axes.get_siblings(self):
+ pos = ax.get_position(original=True)
+ ax.set_position(pos, which='active')
+
+ def set_axes_locator(self, locator):
+ """
+ Set the Axes locator.
+
+ Parameters
+ ----------
+ locator : Callable[[Axes, Renderer], Bbox]
+ """
+ self._axes_locator = locator
+ self.stale = True
+
+ def get_axes_locator(self):
+ """
+ Return the axes_locator.
+ """
+ return self._axes_locator
+
+ def _set_artist_props(self, a):
+ """Set the boilerplate props for artists added to Axes."""
+ a.set_figure(self.get_figure(root=False))
+ if not a.is_transform_set():
+ a.set_transform(self.transData)
+
+ a.axes = self
+ if a.get_mouseover():
+ self._mouseover_set.add(a)
+
+ def _gen_axes_patch(self):
+ """
+ Returns
+ -------
+ Patch
+ The patch used to draw the background of the Axes. It is also used
+ as the clipping path for any data elements on the Axes.
+
+ In the standard Axes, this is a rectangle, but in other projections
+ it may not be.
+
+ Notes
+ -----
+ Intended to be overridden by new projection types.
+ """
+ return mpatches.Rectangle((0.0, 0.0), 1.0, 1.0)
+
+ def _gen_axes_spines(self, locations=None, offset=0.0, units='inches'):
+ """
+ Returns
+ -------
+ dict
+ Mapping of spine names to `.Line2D` or `.Patch` instances that are
+ used to draw Axes spines.
+
+ In the standard Axes, spines are single line segments, but in other
+ projections they may not be.
+
+ Notes
+ -----
+ Intended to be overridden by new projection types.
+ """
+ return {side: mspines.Spine.linear_spine(self, side)
+ for side in ['left', 'right', 'bottom', 'top']}
+
+ def sharex(self, other):
+ """
+ Share the x-axis with *other*.
+
+ This is equivalent to passing ``sharex=other`` when constructing the
+ Axes, and cannot be used if the x-axis is already being shared with
+ another Axes. Note that it is not possible to unshare axes.
+ """
+ _api.check_isinstance(_AxesBase, other=other)
+ if self._sharex is not None and other is not self._sharex:
+ raise ValueError("x-axis is already shared")
+ self._shared_axes["x"].join(self, other)
+ self._sharex = other
+ self.xaxis.major = other.xaxis.major # Ticker instances holding
+ self.xaxis.minor = other.xaxis.minor # locator and formatter.
+ x0, x1 = other.get_xlim()
+ self.set_xlim(x0, x1, emit=False, auto=other.get_autoscalex_on())
+ self.xaxis._scale = other.xaxis._scale
+
+ def sharey(self, other):
+ """
+ Share the y-axis with *other*.
+
+ This is equivalent to passing ``sharey=other`` when constructing the
+ Axes, and cannot be used if the y-axis is already being shared with
+ another Axes. Note that it is not possible to unshare axes.
+ """
+ _api.check_isinstance(_AxesBase, other=other)
+ if self._sharey is not None and other is not self._sharey:
+ raise ValueError("y-axis is already shared")
+ self._shared_axes["y"].join(self, other)
+ self._sharey = other
+ self.yaxis.major = other.yaxis.major # Ticker instances holding
+ self.yaxis.minor = other.yaxis.minor # locator and formatter.
+ y0, y1 = other.get_ylim()
+ self.set_ylim(y0, y1, emit=False, auto=other.get_autoscaley_on())
+ self.yaxis._scale = other.yaxis._scale
+
+ def __clear(self):
+ """Clear the Axes."""
+ # The actual implementation of clear() as long as clear() has to be
+ # an adapter delegating to the correct implementation.
+ # The implementation can move back into clear() when the
+ # deprecation on cla() subclassing expires.
+
+ # stash the current visibility state
+ if hasattr(self, 'patch'):
+ patch_visible = self.patch.get_visible()
+ else:
+ patch_visible = True
+
+ xaxis_visible = self.xaxis.get_visible()
+ yaxis_visible = self.yaxis.get_visible()
+
+ for axis in self._axis_map.values():
+ axis.clear() # Also resets the scale to linear.
+ for spine in self.spines.values():
+ spine._clear() # Use _clear to not clear Axis again
+
+ self.ignore_existing_data_limits = True
+ self.callbacks = cbook.CallbackRegistry(
+ signals=["xlim_changed", "ylim_changed", "zlim_changed"])
+
+ # update the minor locator for x and y axis based on rcParams
+ if mpl.rcParams['xtick.minor.visible']:
+ self.xaxis.set_minor_locator(mticker.AutoMinorLocator())
+ if mpl.rcParams['ytick.minor.visible']:
+ self.yaxis.set_minor_locator(mticker.AutoMinorLocator())
+
+ self._xmargin = mpl.rcParams['axes.xmargin']
+ self._ymargin = mpl.rcParams['axes.ymargin']
+ self._tight = None
+ self._use_sticky_edges = True
+
+ self._get_lines = _process_plot_var_args()
+ self._get_patches_for_fill = _process_plot_var_args('Polygon')
+
+ self._gridOn = mpl.rcParams['axes.grid']
+ # Swap children to minimize time we spend in an invalid state
+ old_children, self._children = self._children, []
+ for chld in old_children:
+ chld._remove_method = None
+ chld._parent_figure = None
+ chld.axes = None
+ # Use list.clear to break the `artist._remove_method` reference cycle
+ old_children.clear()
+ self._mouseover_set = _OrderedSet()
+ self.child_axes = []
+ self._current_image = None # strictly for pyplot via _sci, _gci
+ self._projection_init = None # strictly for pyplot.subplot
+ self.legend_ = None
+ self.containers = []
+
+ self.grid(False) # Disable grid on init to use rcParameter
+ self.grid(self._gridOn, which=mpl.rcParams['axes.grid.which'],
+ axis=mpl.rcParams['axes.grid.axis'])
+ props = font_manager.FontProperties(
+ size=mpl.rcParams['axes.titlesize'],
+ weight=mpl.rcParams['axes.titleweight'])
+
+ y = mpl.rcParams['axes.titley']
+ if y is None:
+ y = 1.0
+ self._autotitlepos = True
+ else:
+ self._autotitlepos = False
+
+ self.title = mtext.Text(
+ x=0.5, y=y, text='',
+ fontproperties=props,
+ verticalalignment='baseline',
+ horizontalalignment='center',
+ )
+ self._left_title = mtext.Text(
+ x=0.0, y=y, text='',
+ fontproperties=props.copy(),
+ verticalalignment='baseline',
+ horizontalalignment='left', )
+ self._right_title = mtext.Text(
+ x=1.0, y=y, text='',
+ fontproperties=props.copy(),
+ verticalalignment='baseline',
+ horizontalalignment='right',
+ )
+ title_offset_points = mpl.rcParams['axes.titlepad']
+ # refactor this out so it can be called in ax.set_title if
+ # pad argument used...
+ self._set_title_offset_trans(title_offset_points)
+
+ for _title in (self.title, self._left_title, self._right_title):
+ self._set_artist_props(_title)
+
+ # The patch draws the background of the Axes. We want this to be below
+ # the other artists. We use the frame to draw the edges so we are
+ # setting the edgecolor to None.
+ self.patch = self._gen_axes_patch()
+ self.patch.set_figure(self.get_figure(root=False))
+ self.patch.set_facecolor(self._facecolor)
+ self.patch.set_edgecolor('none')
+ self.patch.set_linewidth(0)
+ self.patch.set_transform(self.transAxes)
+
+ self.set_axis_on()
+
+ self.xaxis.set_clip_path(self.patch)
+ self.yaxis.set_clip_path(self.patch)
+
+ if self._sharex is not None:
+ self.xaxis.set_visible(xaxis_visible)
+ self.patch.set_visible(patch_visible)
+ if self._sharey is not None:
+ self.yaxis.set_visible(yaxis_visible)
+ self.patch.set_visible(patch_visible)
+
+ # This comes last, as the call to _set_lim may trigger an autoscale (in
+ # case of shared axes), requiring children to be already set up.
+ for name, axis in self._axis_map.items():
+ share = getattr(self, f"_share{name}")
+ if share is not None:
+ getattr(self, f"share{name}")(share)
+ else:
+ # Although the scale was set to linear as part of clear,
+ # polar requires that _set_scale is called again
+ if self.name == "polar":
+ axis._set_scale("linear")
+ axis._set_lim(0, 1, auto=True)
+ self._update_transScale()
+
+ self.stale = True
+
+ def clear(self):
+ """Clear the Axes."""
+ # Act as an alias, or as the superclass implementation depending on the
+ # subclass implementation.
+ if self._subclass_uses_cla:
+ self.cla()
+ else:
+ self.__clear()
+
+ def cla(self):
+ """Clear the Axes."""
+ # Act as an alias, or as the superclass implementation depending on the
+ # subclass implementation.
+ if self._subclass_uses_cla:
+ self.__clear()
+ else:
+ self.clear()
+
+ class ArtistList(Sequence):
+ """
+ A sublist of Axes children based on their type.
+
+ The type-specific children sublists were made immutable in Matplotlib
+ 3.7. In the future these artist lists may be replaced by tuples. Use
+ as if this is a tuple already.
+ """
+ def __init__(self, axes, prop_name,
+ valid_types=None, invalid_types=None):
+ """
+ Parameters
+ ----------
+ axes : `~matplotlib.axes.Axes`
+ The Axes from which this sublist will pull the children
+ Artists.
+ prop_name : str
+ The property name used to access this sublist from the Axes;
+ used to generate deprecation warnings.
+ valid_types : list of type, optional
+ A list of types that determine which children will be returned
+ by this sublist. If specified, then the Artists in the sublist
+ must be instances of any of these types. If unspecified, then
+ any type of Artist is valid (unless limited by
+ *invalid_types*.)
+ invalid_types : tuple, optional
+ A list of types that determine which children will *not* be
+ returned by this sublist. If specified, then Artists in the
+ sublist will never be an instance of these types. Otherwise, no
+ types will be excluded.
+ """
+ self._axes = axes
+ self._prop_name = prop_name
+ self._type_check = lambda artist: (
+ (not valid_types or isinstance(artist, valid_types)) and
+ (not invalid_types or not isinstance(artist, invalid_types))
+ )
+
+ def __repr__(self):
+ return f''
+
+ def __len__(self):
+ return sum(self._type_check(artist)
+ for artist in self._axes._children)
+
+ def __iter__(self):
+ for artist in list(self._axes._children):
+ if self._type_check(artist):
+ yield artist
+
+ def __getitem__(self, key):
+ return [artist
+ for artist in self._axes._children
+ if self._type_check(artist)][key]
+
+ def __add__(self, other):
+ if isinstance(other, (list, _AxesBase.ArtistList)):
+ return [*self, *other]
+ if isinstance(other, (tuple, _AxesBase.ArtistList)):
+ return (*self, *other)
+ return NotImplemented
+
+ def __radd__(self, other):
+ if isinstance(other, list):
+ return other + list(self)
+ if isinstance(other, tuple):
+ return other + tuple(self)
+ return NotImplemented
+
+ @property
+ def artists(self):
+ return self.ArtistList(self, 'artists', invalid_types=(
+ mcoll.Collection, mimage.AxesImage, mlines.Line2D, mpatches.Patch,
+ mtable.Table, mtext.Text))
+
+ @property
+ def collections(self):
+ return self.ArtistList(self, 'collections',
+ valid_types=mcoll.Collection)
+
+ @property
+ def images(self):
+ return self.ArtistList(self, 'images', valid_types=mimage.AxesImage)
+
+ @property
+ def lines(self):
+ return self.ArtistList(self, 'lines', valid_types=mlines.Line2D)
+
+ @property
+ def patches(self):
+ return self.ArtistList(self, 'patches', valid_types=mpatches.Patch)
+
+ @property
+ def tables(self):
+ return self.ArtistList(self, 'tables', valid_types=mtable.Table)
+
+ @property
+ def texts(self):
+ return self.ArtistList(self, 'texts', valid_types=mtext.Text)
+
+ def get_facecolor(self):
+ """Get the facecolor of the Axes."""
+ return self.patch.get_facecolor()
+
+ def set_facecolor(self, color):
+ """
+ Set the facecolor of the Axes.
+
+ Parameters
+ ----------
+ color : :mpltype:`color`
+ """
+ self._facecolor = color
+ self.stale = True
+ return self.patch.set_facecolor(color)
+
+ def _set_title_offset_trans(self, title_offset_points):
+ """
+ Set the offset for the title either from :rc:`axes.titlepad`
+ or from set_title kwarg ``pad``.
+ """
+ self.titleOffsetTrans = mtransforms.ScaledTranslation(
+ 0.0, title_offset_points / 72,
+ self.get_figure(root=False).dpi_scale_trans)
+ for _title in (self.title, self._left_title, self._right_title):
+ _title.set_transform(self.transAxes + self.titleOffsetTrans)
+ _title.set_clip_box(None)
+
+ def set_prop_cycle(self, *args, **kwargs):
+ """
+ Set the property cycle of the Axes.
+
+ The property cycle controls the style properties such as color,
+ marker and linestyle of future plot commands. The style properties
+ of data already added to the Axes are not modified.
+
+ Call signatures::
+
+ set_prop_cycle(cycler)
+ set_prop_cycle(label=values, label2=values2, ...)
+ set_prop_cycle(label, values)
+
+ Form 1 sets given `~cycler.Cycler` object.
+
+ Form 2 creates a `~cycler.Cycler` which cycles over one or more
+ properties simultaneously and set it as the property cycle of the
+ Axes. If multiple properties are given, their value lists must have
+ the same length. This is just a shortcut for explicitly creating a
+ cycler and passing it to the function, i.e. it's short for
+ ``set_prop_cycle(cycler(label=values, label2=values2, ...))``.
+
+ Form 3 creates a `~cycler.Cycler` for a single property and set it
+ as the property cycle of the Axes. This form exists for compatibility
+ with the original `cycler.cycler` interface. Its use is discouraged
+ in favor of the kwarg form, i.e. ``set_prop_cycle(label=values)``.
+
+ Parameters
+ ----------
+ cycler : `~cycler.Cycler` or ``None``
+ Set the given Cycler. *None* resets to the cycle defined by the
+ current style.
+
+ .. ACCEPTS: `~cycler.Cycler`
+
+ label : str
+ The property key. Must be a valid `.Artist` property.
+ For example, 'color' or 'linestyle'. Aliases are allowed,
+ such as 'c' for 'color' and 'lw' for 'linewidth'.
+
+ values : iterable
+ Finite-length iterable of the property values. These values
+ are validated and will raise a ValueError if invalid.
+
+ See Also
+ --------
+ matplotlib.rcsetup.cycler
+ Convenience function for creating validated cyclers for properties.
+ cycler.cycler
+ The original function for creating unvalidated cyclers.
+
+ Examples
+ --------
+ Setting the property cycle for a single property:
+
+ >>> ax.set_prop_cycle(color=['red', 'green', 'blue'])
+
+ Setting the property cycle for simultaneously cycling over multiple
+ properties (e.g. red circle, green plus, blue cross):
+
+ >>> ax.set_prop_cycle(color=['red', 'green', 'blue'],
+ ... marker=['o', '+', 'x'])
+
+ """
+ if args and kwargs:
+ raise TypeError("Cannot supply both positional and keyword "
+ "arguments to this method.")
+ # Can't do `args == (None,)` as that crashes cycler.
+ if len(args) == 1 and args[0] is None:
+ prop_cycle = None
+ else:
+ prop_cycle = cycler(*args, **kwargs)
+ self._get_lines.set_prop_cycle(prop_cycle)
+ self._get_patches_for_fill.set_prop_cycle(prop_cycle)
+
+ def get_aspect(self):
+ """
+ Return the aspect ratio of the Axes scaling.
+
+ This is either "auto" or a float giving the ratio of y/x-scale.
+ """
+ return self._aspect
+
+ def set_aspect(self, aspect, adjustable=None, anchor=None, share=False):
+ """
+ Set the aspect ratio of the Axes scaling, i.e. y/x-scale.
+
+ Parameters
+ ----------
+ aspect : {'auto', 'equal'} or float
+ Possible values:
+
+ - 'auto': fill the position rectangle with data.
+ - 'equal': same as ``aspect=1``, i.e. same scaling for x and y.
+ - *float*: The displayed size of 1 unit in y-data coordinates will
+ be *aspect* times the displayed size of 1 unit in x-data
+ coordinates; e.g. for ``aspect=2`` a square in data coordinates
+ will be rendered with a height of twice its width.
+
+ adjustable : None or {'box', 'datalim'}, optional
+ If not ``None``, this defines which parameter will be adjusted to
+ meet the required aspect. See `.set_adjustable` for further
+ details.
+
+ anchor : None or str or (float, float), optional
+ If not ``None``, this defines where the Axes will be drawn if there
+ is extra space due to aspect constraints. The most common way
+ to specify the anchor are abbreviations of cardinal directions:
+
+ ===== =====================
+ value description
+ ===== =====================
+ 'C' centered
+ 'SW' lower left corner
+ 'S' middle of bottom edge
+ 'SE' lower right corner
+ etc.
+ ===== =====================
+
+ See `~.Axes.set_anchor` for further details.
+
+ share : bool, default: False
+ If ``True``, apply the settings to all shared Axes.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_adjustable
+ Set how the Axes adjusts to achieve the required aspect ratio.
+ matplotlib.axes.Axes.set_anchor
+ Set the position in case of extra space.
+ """
+ if cbook._str_equal(aspect, 'equal'):
+ aspect = 1
+ if not cbook._str_equal(aspect, 'auto'):
+ aspect = float(aspect) # raise ValueError if necessary
+ if aspect <= 0 or not np.isfinite(aspect):
+ raise ValueError("aspect must be finite and positive ")
+
+ if share:
+ axes = {sibling for name in self._axis_names
+ for sibling in self._shared_axes[name].get_siblings(self)}
+ else:
+ axes = [self]
+
+ for ax in axes:
+ ax._aspect = aspect
+
+ if adjustable is None:
+ adjustable = self._adjustable
+ self.set_adjustable(adjustable, share=share) # Handle sharing.
+
+ if anchor is not None:
+ self.set_anchor(anchor, share=share)
+ self.stale = True
+
+ def get_adjustable(self):
+ """
+ Return whether the Axes will adjust its physical dimension ('box') or
+ its data limits ('datalim') to achieve the desired aspect ratio.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_adjustable
+ Set how the Axes adjusts to achieve the required aspect ratio.
+ matplotlib.axes.Axes.set_aspect
+ For a description of aspect handling.
+ """
+ return self._adjustable
+
+ def set_adjustable(self, adjustable, share=False):
+ """
+ Set how the Axes adjusts to achieve the required aspect ratio.
+
+ Parameters
+ ----------
+ adjustable : {'box', 'datalim'}
+ If 'box', change the physical dimensions of the Axes.
+ If 'datalim', change the ``x`` or ``y`` data limits. This
+ may ignore explicitly defined axis limits.
+
+ share : bool, default: False
+ If ``True``, apply the settings to all shared Axes.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_aspect
+ For a description of aspect handling.
+
+ Notes
+ -----
+ Shared Axes (of which twinned Axes are a special case)
+ impose restrictions on how aspect ratios can be imposed.
+ For twinned Axes, use 'datalim'. For Axes that share both
+ x and y, use 'box'. Otherwise, either 'datalim' or 'box'
+ may be used. These limitations are partly a requirement
+ to avoid over-specification, and partly a result of the
+ particular implementation we are currently using, in
+ which the adjustments for aspect ratios are done sequentially
+ and independently on each Axes as it is drawn.
+ """
+ _api.check_in_list(["box", "datalim"], adjustable=adjustable)
+ if share:
+ axs = {sibling for name in self._axis_names
+ for sibling in self._shared_axes[name].get_siblings(self)}
+ else:
+ axs = [self]
+ if (adjustable == "datalim"
+ and any(getattr(ax.get_data_ratio, "__func__", None)
+ != _AxesBase.get_data_ratio
+ for ax in axs)):
+ # Limits adjustment by apply_aspect assumes that the axes' aspect
+ # ratio can be computed from the data limits and scales.
+ raise ValueError("Cannot set Axes adjustable to 'datalim' for "
+ "Axes which override 'get_data_ratio'")
+ for ax in axs:
+ ax._adjustable = adjustable
+ self.stale = True
+
+ def get_box_aspect(self):
+ """
+ Return the Axes box aspect, i.e. the ratio of height to width.
+
+ The box aspect is ``None`` (i.e. chosen depending on the available
+ figure space) unless explicitly specified.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_box_aspect
+ for a description of box aspect.
+ matplotlib.axes.Axes.set_aspect
+ for a description of aspect handling.
+ """
+ return self._box_aspect
+
+ def set_box_aspect(self, aspect=None):
+ """
+ Set the Axes box aspect, i.e. the ratio of height to width.
+
+ This defines the aspect of the Axes in figure space and is not to be
+ confused with the data aspect (see `~.Axes.set_aspect`).
+
+ Parameters
+ ----------
+ aspect : float or None
+ Changes the physical dimensions of the Axes, such that the ratio
+ of the Axes height to the Axes width in physical units is equal to
+ *aspect*. Defining a box aspect will change the *adjustable*
+ property to 'datalim' (see `~.Axes.set_adjustable`).
+
+ *None* will disable a fixed box aspect so that height and width
+ of the Axes are chosen independently.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_aspect
+ for a description of aspect handling.
+ """
+ axs = {*self._twinned_axes.get_siblings(self),
+ *self._twinned_axes.get_siblings(self)}
+
+ if aspect is not None:
+ aspect = float(aspect)
+ # when box_aspect is set to other than “None`,
+ # adjustable must be "datalim"
+ for ax in axs:
+ ax.set_adjustable("datalim")
+
+ for ax in axs:
+ ax._box_aspect = aspect
+ ax.stale = True
+
+ def get_anchor(self):
+ """
+ Get the anchor location.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_anchor
+ for a description of the anchor.
+ matplotlib.axes.Axes.set_aspect
+ for a description of aspect handling.
+ """
+ return self._anchor
+
+ def set_anchor(self, anchor, share=False):
+ """
+ Define the anchor location.
+
+ The actual drawing area (active position) of the Axes may be smaller
+ than the Bbox (original position) when a fixed aspect is required. The
+ anchor defines where the drawing area will be located within the
+ available space.
+
+ Parameters
+ ----------
+ anchor : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
+ Either an (*x*, *y*) pair of relative coordinates (0 is left or
+ bottom, 1 is right or top), 'C' (center), or a cardinal direction
+ ('SW', southwest, is bottom left, etc.). str inputs are shorthands
+ for (*x*, *y*) coordinates, as shown in the following diagram::
+
+ āāāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāā¬āāāāāāāāāāāāāāāāāā
+ ā 'NW' (0.0, 1.0) ā 'N' (0.5, 1.0) ā 'NE' (1.0, 1.0) ā
+ āāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāā¤
+ ā 'W' (0.0, 0.5) ā 'C' (0.5, 0.5) ā 'E' (1.0, 0.5) ā
+ āāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāā¤
+ ā 'SW' (0.0, 0.0) ā 'S' (0.5, 0.0) ā 'SE' (1.0, 0.0) ā
+ āāāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāā“āāāāāāāāāāāāāāāāāā
+
+ share : bool, default: False
+ If ``True``, apply the settings to all shared Axes.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_aspect
+ for a description of aspect handling.
+ """
+ if not (anchor in mtransforms.Bbox.coefs or len(anchor) == 2):
+ raise ValueError('argument must be among %s' %
+ ', '.join(mtransforms.Bbox.coefs))
+ if share:
+ axes = {sibling for name in self._axis_names
+ for sibling in self._shared_axes[name].get_siblings(self)}
+ else:
+ axes = [self]
+ for ax in axes:
+ ax._anchor = anchor
+
+ self.stale = True
+
+ def get_data_ratio(self):
+ """
+ Return the aspect ratio of the scaled data.
+
+ Notes
+ -----
+ This method is intended to be overridden by new projection types.
+ """
+ txmin, txmax = self.xaxis.get_transform().transform(self.get_xbound())
+ tymin, tymax = self.yaxis.get_transform().transform(self.get_ybound())
+ xsize = max(abs(txmax - txmin), 1e-30)
+ ysize = max(abs(tymax - tymin), 1e-30)
+ return ysize / xsize
+
+ def apply_aspect(self, position=None):
+ """
+ Adjust the Axes for a specified data aspect ratio.
+
+ Depending on `.get_adjustable` this will modify either the
+ Axes box (position) or the view limits. In the former case,
+ `~matplotlib.axes.Axes.get_anchor` will affect the position.
+
+ Parameters
+ ----------
+ position : None or .Bbox
+
+ .. note::
+ This parameter exists for historic reasons and is considered
+ internal. End users should not use it.
+
+ If not ``None``, this defines the position of the
+ Axes within the figure as a Bbox. See `~.Axes.get_position`
+ for further details.
+
+ Notes
+ -----
+ This is called automatically when each Axes is drawn. You may need
+ to call it yourself if you need to update the Axes position and/or
+ view limits before the Figure is drawn.
+
+ An alternative with a broader scope is `.Figure.draw_without_rendering`,
+ which updates all stale components of a figure, not only the positioning /
+ view limits of a single Axes.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_aspect
+ For a description of aspect ratio handling.
+ matplotlib.axes.Axes.set_adjustable
+ Set how the Axes adjusts to achieve the required aspect ratio.
+ matplotlib.axes.Axes.set_anchor
+ Set the position in case of extra space.
+ matplotlib.figure.Figure.draw_without_rendering
+ Update all stale components of a figure.
+
+ Examples
+ --------
+ A typical usage example would be the following. `~.Axes.imshow` sets the
+ aspect to 1, but adapting the Axes position and extent to reflect this is
+ deferred until rendering for performance reasons. If you want to know the
+ Axes size before, you need to call `.apply_aspect` to get the correct
+ values.
+
+ >>> fig, ax = plt.subplots()
+ >>> ax.imshow(np.zeros((3, 3)))
+ >>> ax.bbox.width, ax.bbox.height
+ (496.0, 369.59999999999997)
+ >>> ax.apply_aspect()
+ >>> ax.bbox.width, ax.bbox.height
+ (369.59999999999997, 369.59999999999997)
+ """
+ if position is None:
+ position = self.get_position(original=True)
+
+ aspect = self.get_aspect()
+
+ if aspect == 'auto' and self._box_aspect is None:
+ self._set_position(position, which='active')
+ return
+
+ trans = self.get_figure(root=False).transSubfigure
+ bb = mtransforms.Bbox.unit().transformed(trans)
+ # this is the physical aspect of the panel (or figure):
+ fig_aspect = bb.height / bb.width
+
+ if self._adjustable == 'box':
+ if self in self._twinned_axes:
+ raise RuntimeError("Adjustable 'box' is not allowed in a "
+ "twinned Axes; use 'datalim' instead")
+ box_aspect = aspect * self.get_data_ratio()
+ pb = position.frozen()
+ pb1 = pb.shrunk_to_aspect(box_aspect, pb, fig_aspect)
+ self._set_position(pb1.anchored(self.get_anchor(), pb), 'active')
+ return
+
+ # The following is only seen if self._adjustable == 'datalim'
+ if self._box_aspect is not None:
+ pb = position.frozen()
+ pb1 = pb.shrunk_to_aspect(self._box_aspect, pb, fig_aspect)
+ self._set_position(pb1.anchored(self.get_anchor(), pb), 'active')
+ if aspect == "auto":
+ return
+
+ # reset active to original in case it had been changed by prior use
+ # of 'box'
+ if self._box_aspect is None:
+ self._set_position(position, which='active')
+ else:
+ position = pb1.anchored(self.get_anchor(), pb)
+
+ x_trf = self.xaxis.get_transform()
+ y_trf = self.yaxis.get_transform()
+ xmin, xmax = x_trf.transform(self.get_xbound())
+ ymin, ymax = y_trf.transform(self.get_ybound())
+ xsize = max(abs(xmax - xmin), 1e-30)
+ ysize = max(abs(ymax - ymin), 1e-30)
+
+ box_aspect = fig_aspect * (position.height / position.width)
+ data_ratio = box_aspect / aspect
+
+ y_expander = data_ratio * xsize / ysize - 1
+ # If y_expander > 0, the dy/dx viewLim ratio needs to increase
+ if abs(y_expander) < 0.005:
+ return
+
+ dL = self.dataLim
+ x0, x1 = x_trf.transform(dL.intervalx)
+ y0, y1 = y_trf.transform(dL.intervaly)
+ xr = 1.05 * (x1 - x0)
+ yr = 1.05 * (y1 - y0)
+
+ xmarg = xsize - xr
+ ymarg = ysize - yr
+ Ysize = data_ratio * xsize
+ Xsize = ysize / data_ratio
+ Xmarg = Xsize - xr
+ Ymarg = Ysize - yr
+ # Setting these targets to, e.g., 0.05*xr does not seem to help.
+ xm = 0
+ ym = 0
+
+ shared_x = self in self._shared_axes["x"]
+ shared_y = self in self._shared_axes["y"]
+
+ if shared_x and shared_y:
+ raise RuntimeError("set_aspect(..., adjustable='datalim') or "
+ "axis('equal') are not allowed when both axes "
+ "are shared. Try set_aspect(..., "
+ "adjustable='box').")
+
+ # If y is shared, then we are only allowed to change x, etc.
+ if shared_y:
+ adjust_y = False
+ else:
+ if xmarg > xm and ymarg > ym:
+ adjy = ((Ymarg > 0 and y_expander < 0) or
+ (Xmarg < 0 and y_expander > 0))
+ else:
+ adjy = y_expander > 0
+ adjust_y = shared_x or adjy # (Ymarg > xmarg)
+
+ if adjust_y:
+ yc = 0.5 * (ymin + ymax)
+ y0 = yc - Ysize / 2.0
+ y1 = yc + Ysize / 2.0
+ if not self.get_autoscaley_on():
+ _log.warning("Ignoring fixed y limits to fulfill fixed data aspect "
+ "with adjustable data limits.")
+ self.set_ybound(y_trf.inverted().transform([y0, y1]))
+ else:
+ xc = 0.5 * (xmin + xmax)
+ x0 = xc - Xsize / 2.0
+ x1 = xc + Xsize / 2.0
+ if not self.get_autoscalex_on():
+ _log.warning("Ignoring fixed x limits to fulfill fixed data aspect "
+ "with adjustable data limits.")
+ self.set_xbound(x_trf.inverted().transform([x0, x1]))
+
+ def axis(self, arg=None, /, *, emit=True, **kwargs):
+ """
+ Convenience method to get or set some axis properties.
+
+ Call signatures::
+
+ xmin, xmax, ymin, ymax = axis()
+ xmin, xmax, ymin, ymax = axis([xmin, xmax, ymin, ymax])
+ xmin, xmax, ymin, ymax = axis(option)
+ xmin, xmax, ymin, ymax = axis(**kwargs)
+
+ Parameters
+ ----------
+ xmin, xmax, ymin, ymax : float, optional
+ The axis limits to be set. This can also be achieved using ::
+
+ ax.set(xlim=(xmin, xmax), ylim=(ymin, ymax))
+
+ option : bool or str
+ If a bool, turns axis lines and labels on or off. If a string,
+ possible values are:
+
+ ================ ===========================================================
+ Value Description
+ ================ ===========================================================
+ 'off' or `False` Hide all axis decorations, i.e. axis labels, spines,
+ tick marks, tick labels, and grid lines.
+ This is the same as `~.Axes.set_axis_off()`.
+ 'on' or `True` Do not hide all axis decorations, i.e. axis labels, spines,
+ tick marks, tick labels, and grid lines.
+ This is the same as `~.Axes.set_axis_on()`.
+ 'equal' Set equal scaling (i.e., make circles circular) by
+ changing the axis limits. This is the same as
+ ``ax.set_aspect('equal', adjustable='datalim')``.
+ Explicit data limits may not be respected in this case.
+ 'scaled' Set equal scaling (i.e., make circles circular) by
+ changing dimensions of the plot box. This is the same as
+ ``ax.set_aspect('equal', adjustable='box', anchor='C')``.
+ Additionally, further autoscaling will be disabled.
+ 'tight' Set limits just large enough to show all data, then
+ disable further autoscaling.
+ 'auto' Automatic scaling (fill plot box with data).
+ 'image' 'scaled' with axis limits equal to data limits.
+ 'square' Square plot; similar to 'scaled', but initially forcing
+ ``xmax-xmin == ymax-ymin``.
+ ================ ===========================================================
+
+ emit : bool, default: True
+ Whether observers are notified of the axis limit change.
+ This option is passed on to `~.Axes.set_xlim` and
+ `~.Axes.set_ylim`.
+
+ Returns
+ -------
+ xmin, xmax, ymin, ymax : float
+ The axis limits.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_xlim
+ matplotlib.axes.Axes.set_ylim
+
+ Notes
+ -----
+ For 3D Axes, this method additionally takes *zmin*, *zmax* as
+ parameters and likewise returns them.
+ """
+ if isinstance(arg, (str, bool)):
+ if arg is True:
+ arg = 'on'
+ if arg is False:
+ arg = 'off'
+ arg = arg.lower()
+ if arg == 'on':
+ self.set_axis_on()
+ elif arg == 'off':
+ self.set_axis_off()
+ elif arg in [
+ 'equal', 'tight', 'scaled', 'auto', 'image', 'square']:
+ self.set_autoscale_on(True)
+ self.set_aspect('auto')
+ self.autoscale_view(tight=False)
+ if arg == 'equal':
+ self.set_aspect('equal', adjustable='datalim')
+ elif arg == 'scaled':
+ self.set_aspect('equal', adjustable='box', anchor='C')
+ self.set_autoscale_on(False) # Req. by Mark Bakker
+ elif arg == 'tight':
+ self.autoscale_view(tight=True)
+ self.set_autoscale_on(False)
+ elif arg == 'image':
+ self.autoscale_view(tight=True)
+ self.set_autoscale_on(False)
+ self.set_aspect('equal', adjustable='box', anchor='C')
+ elif arg == 'square':
+ self.set_aspect('equal', adjustable='box', anchor='C')
+ self.set_autoscale_on(False)
+ xlim = self.get_xlim()
+ ylim = self.get_ylim()
+ edge_size = max(np.diff(xlim), np.diff(ylim))[0]
+ self.set_xlim([xlim[0], xlim[0] + edge_size],
+ emit=emit, auto=False)
+ self.set_ylim([ylim[0], ylim[0] + edge_size],
+ emit=emit, auto=False)
+ else:
+ raise ValueError(f"Unrecognized string {arg!r} to axis; "
+ "try 'on' or 'off'")
+ else:
+ if arg is not None:
+ if len(arg) != 2*len(self._axis_names):
+ raise TypeError(
+ "The first argument to axis() must be an iterable of the form "
+ "[{}]".format(", ".join(
+ f"{name}min, {name}max" for name in self._axis_names)))
+ limits = {
+ name: arg[2*i:2*(i+1)]
+ for i, name in enumerate(self._axis_names)
+ }
+ else:
+ limits = {}
+ for name in self._axis_names:
+ ax_min = kwargs.pop(f'{name}min', None)
+ ax_max = kwargs.pop(f'{name}max', None)
+ limits[name] = (ax_min, ax_max)
+ for name, (ax_min, ax_max) in limits.items():
+ ax_auto = (None # Keep autoscale state as is.
+ if ax_min is None and ax_max is None
+ else False) # Turn off autoscale.
+ set_ax_lim = getattr(self, f'set_{name}lim')
+ set_ax_lim(ax_min, ax_max, emit=emit, auto=ax_auto)
+ if kwargs:
+ raise _api.kwarg_error("axis", kwargs)
+ lims = ()
+ for name in self._axis_names:
+ get_ax_lim = getattr(self, f'get_{name}lim')
+ lims += get_ax_lim()
+ return lims
+
+ def get_legend(self):
+ """Return the `.Legend` instance, or None if no legend is defined."""
+ return self.legend_
+
+ def get_images(self):
+ r"""Return a list of `.AxesImage`\s contained by the Axes."""
+ return cbook.silent_list('AxesImage', self.images)
+
+ def get_lines(self):
+ """Return a list of lines contained by the Axes."""
+ return cbook.silent_list('Line2D', self.lines)
+
+ def get_xaxis(self):
+ """
+ [*Discouraged*] Return the XAxis instance.
+
+ .. admonition:: Discouraged
+
+ The use of this function is discouraged. You should instead
+ directly access the attribute `~.Axes.xaxis`.
+ """
+ return self.xaxis
+
+ def get_yaxis(self):
+ """
+ [*Discouraged*] Return the YAxis instance.
+
+ .. admonition:: Discouraged
+
+ The use of this function is discouraged. You should instead
+ directly access the attribute `~.Axes.yaxis`.
+ """
+ return self.yaxis
+
+ get_xgridlines = _axis_method_wrapper("xaxis", "get_gridlines")
+ get_xticklines = _axis_method_wrapper("xaxis", "get_ticklines")
+ get_ygridlines = _axis_method_wrapper("yaxis", "get_gridlines")
+ get_yticklines = _axis_method_wrapper("yaxis", "get_ticklines")
+
+ # Adding and tracking artists
+
+ def _sci(self, im):
+ """
+ Set the current image.
+
+ This image will be the target of colormap functions like
+ ``pyplot.viridis``, and other functions such as `~.pyplot.clim`. The
+ current image is an attribute of the current Axes.
+ """
+ _api.check_isinstance((mcoll.Collection, mimage.AxesImage), im=im)
+ if im not in self._children:
+ raise ValueError("Argument must be an image or collection in this Axes")
+ self._current_image = im
+
+ def _gci(self):
+ """Helper for `~matplotlib.pyplot.gci`; do not use elsewhere."""
+ return self._current_image
+
+ def has_data(self):
+ """
+ Return whether any artists have been added to the Axes.
+
+ This should not be used to determine whether the *dataLim*
+ need to be updated, and may not actually be useful for
+ anything.
+ """
+ return any(isinstance(a, (mcoll.Collection, mimage.AxesImage,
+ mlines.Line2D, mpatches.Patch))
+ for a in self._children)
+
+ def add_artist(self, a):
+ """
+ Add an `.Artist` to the Axes; return the artist.
+
+ Use `add_artist` only for artists for which there is no dedicated
+ "add" method; and if necessary, use a method such as `update_datalim`
+ to manually update the `~.Axes.dataLim` if the artist is to be included
+ in autoscaling.
+
+ If no ``transform`` has been specified when creating the artist (e.g.
+ ``artist.get_transform() == None``) then the transform is set to
+ ``ax.transData``.
+ """
+ a.axes = self
+ self._children.append(a)
+ a._remove_method = self._children.remove
+ self._set_artist_props(a)
+ if a.get_clip_path() is None:
+ a.set_clip_path(self.patch)
+ self.stale = True
+ return a
+
+ def add_child_axes(self, ax):
+ """
+ Add an `.Axes` to the Axes' children; return the child Axes.
+
+ This is the lowlevel version. See `.axes.Axes.inset_axes`.
+ """
+
+ # normally Axes have themselves as the Axes, but these need to have
+ # their parent...
+ # Need to bypass the getter...
+ ax._axes = self
+ ax.stale_callback = martist._stale_axes_callback
+
+ self.child_axes.append(ax)
+ ax._remove_method = functools.partial(
+ self.get_figure(root=False)._remove_axes, owners=[self.child_axes])
+ self.stale = True
+ return ax
+
+ def add_collection(self, collection, autolim=True):
+ """
+ Add a `.Collection` to the Axes; return the collection.
+ """
+ _api.check_isinstance(mcoll.Collection, collection=collection)
+ if not collection.get_label():
+ collection.set_label(f'_child{len(self._children)}')
+ self._children.append(collection)
+ collection._remove_method = self._children.remove
+ self._set_artist_props(collection)
+
+ if collection.get_clip_path() is None:
+ collection.set_clip_path(self.patch)
+
+ if autolim:
+ # Make sure viewLim is not stale (mostly to match
+ # pre-lazy-autoscale behavior, which is not really better).
+ self._unstale_viewLim()
+ datalim = collection.get_datalim(self.transData)
+ points = datalim.get_points()
+ if not np.isinf(datalim.minpos).all():
+ # By definition, if minpos (minimum positive value) is set
+ # (i.e., non-inf), then min(points) <= minpos <= max(points),
+ # and minpos would be superfluous. However, we add minpos to
+ # the call so that self.dataLim will update its own minpos.
+ # This ensures that log scales see the correct minimum.
+ points = np.concatenate([points, [datalim.minpos]])
+ self.update_datalim(points)
+
+ self.stale = True
+ return collection
+
+ def add_image(self, image):
+ """
+ Add an `.AxesImage` to the Axes; return the image.
+ """
+ _api.check_isinstance(mimage.AxesImage, image=image)
+ self._set_artist_props(image)
+ if not image.get_label():
+ image.set_label(f'_child{len(self._children)}')
+ self._children.append(image)
+ image._remove_method = self._children.remove
+ self.stale = True
+ return image
+
+ def _update_image_limits(self, image):
+ xmin, xmax, ymin, ymax = image.get_extent()
+ self.axes.update_datalim(((xmin, ymin), (xmax, ymax)))
+
+ def add_line(self, line):
+ """
+ Add a `.Line2D` to the Axes; return the line.
+ """
+ _api.check_isinstance(mlines.Line2D, line=line)
+ self._set_artist_props(line)
+ if line.get_clip_path() is None:
+ line.set_clip_path(self.patch)
+
+ self._update_line_limits(line)
+ if not line.get_label():
+ line.set_label(f'_child{len(self._children)}')
+ self._children.append(line)
+ line._remove_method = self._children.remove
+ self.stale = True
+ return line
+
+ def _add_text(self, txt):
+ """
+ Add a `.Text` to the Axes; return the text.
+ """
+ _api.check_isinstance(mtext.Text, txt=txt)
+ self._set_artist_props(txt)
+ self._children.append(txt)
+ txt._remove_method = self._children.remove
+ self.stale = True
+ return txt
+
+ def _update_line_limits(self, line):
+ """
+ Figures out the data limit of the given line, updating `.Axes.dataLim`.
+ """
+ path = line.get_path()
+ if path.vertices.size == 0:
+ return
+
+ line_trf = line.get_transform()
+
+ if line_trf == self.transData:
+ data_path = path
+ elif any(line_trf.contains_branch_seperately(self.transData)):
+ # Compute the transform from line coordinates to data coordinates.
+ trf_to_data = line_trf - self.transData
+ # If transData is affine we can use the cached non-affine component
+ # of line's path (since the non-affine part of line_trf is
+ # entirely encapsulated in trf_to_data).
+ if self.transData.is_affine:
+ line_trans_path = line._get_transformed_path()
+ na_path, _ = line_trans_path.get_transformed_path_and_affine()
+ data_path = trf_to_data.transform_path_affine(na_path)
+ else:
+ data_path = trf_to_data.transform_path(path)
+ else:
+ # For backwards compatibility we update the dataLim with the
+ # coordinate range of the given path, even though the coordinate
+ # systems are completely different. This may occur in situations
+ # such as when ax.transAxes is passed through for absolute
+ # positioning.
+ data_path = path
+
+ if not data_path.vertices.size:
+ return
+
+ updatex, updatey = line_trf.contains_branch_seperately(self.transData)
+ if self.name != "rectilinear":
+ # This block is mostly intended to handle axvline in polar plots,
+ # for which updatey would otherwise be True.
+ if updatex and line_trf == self.get_yaxis_transform():
+ updatex = False
+ if updatey and line_trf == self.get_xaxis_transform():
+ updatey = False
+ self.dataLim.update_from_path(data_path,
+ self.ignore_existing_data_limits,
+ updatex=updatex, updatey=updatey)
+ self.ignore_existing_data_limits = False
+
+ def add_patch(self, p):
+ """
+ Add a `.Patch` to the Axes; return the patch.
+ """
+ _api.check_isinstance(mpatches.Patch, p=p)
+ self._set_artist_props(p)
+ if p.get_clip_path() is None:
+ p.set_clip_path(self.patch)
+ self._update_patch_limits(p)
+ self._children.append(p)
+ p._remove_method = self._children.remove
+ return p
+
+ def _update_patch_limits(self, patch):
+ """Update the data limits for the given patch."""
+ # hist can add zero height Rectangles, which is useful to keep
+ # the bins, counts and patches lined up, but it throws off log
+ # scaling. We'll ignore rects with zero height or width in
+ # the auto-scaling
+
+ # cannot check for '==0' since unitized data may not compare to zero
+ # issue #2150 - we update the limits if patch has non zero width
+ # or height.
+ if (isinstance(patch, mpatches.Rectangle) and
+ ((not patch.get_width()) and (not patch.get_height()))):
+ return
+ p = patch.get_path()
+ # Get all vertices on the path
+ # Loop through each segment to get extrema for Bezier curve sections
+ vertices = []
+ for curve, code in p.iter_bezier(simplify=False):
+ # Get distance along the curve of any extrema
+ _, dzeros = curve.axis_aligned_extrema()
+ # Calculate vertices of start, end and any extrema in between
+ vertices.append(curve([0, *dzeros, 1]))
+
+ if len(vertices):
+ vertices = np.vstack(vertices)
+
+ patch_trf = patch.get_transform()
+ updatex, updatey = patch_trf.contains_branch_seperately(self.transData)
+ if not (updatex or updatey):
+ return
+ if self.name != "rectilinear":
+ # As in _update_line_limits, but for axvspan.
+ if updatex and patch_trf == self.get_yaxis_transform():
+ updatex = False
+ if updatey and patch_trf == self.get_xaxis_transform():
+ updatey = False
+ trf_to_data = patch_trf - self.transData
+ xys = trf_to_data.transform(vertices)
+ self.update_datalim(xys, updatex=updatex, updatey=updatey)
+
+ def add_table(self, tab):
+ """
+ Add a `.Table` to the Axes; return the table.
+ """
+ _api.check_isinstance(mtable.Table, tab=tab)
+ self._set_artist_props(tab)
+ self._children.append(tab)
+ if tab.get_clip_path() is None:
+ tab.set_clip_path(self.patch)
+ tab._remove_method = self._children.remove
+ return tab
+
+ def add_container(self, container):
+ """
+ Add a `.Container` to the Axes' containers; return the container.
+ """
+ label = container.get_label()
+ if not label:
+ container.set_label('_container%d' % len(self.containers))
+ self.containers.append(container)
+ container._remove_method = self.containers.remove
+ return container
+
+ def _unit_change_handler(self, axis_name, event=None):
+ """
+ Process axis units changes: requests updates to data and view limits.
+ """
+ if event is None: # Allow connecting `self._unit_change_handler(name)`
+ return functools.partial(
+ self._unit_change_handler, axis_name, event=object())
+ _api.check_in_list(self._axis_map, axis_name=axis_name)
+ for line in self.lines:
+ line.recache_always()
+ self.relim()
+ self._request_autoscale_view(axis_name)
+
+ def relim(self, visible_only=False):
+ """
+ Recompute the data limits based on current artists.
+
+ At present, `.Collection` instances are not supported.
+
+ Parameters
+ ----------
+ visible_only : bool, default: False
+ Whether to exclude invisible artists.
+ """
+ # Collections are deliberately not supported (yet); see
+ # the TODO note in artists.py.
+ self.dataLim.ignore(True)
+ self.dataLim.set_points(mtransforms.Bbox.null().get_points())
+ self.ignore_existing_data_limits = True
+
+ for artist in self._children:
+ if not visible_only or artist.get_visible():
+ if isinstance(artist, mlines.Line2D):
+ self._update_line_limits(artist)
+ elif isinstance(artist, mpatches.Patch):
+ self._update_patch_limits(artist)
+ elif isinstance(artist, mimage.AxesImage):
+ self._update_image_limits(artist)
+
+ def update_datalim(self, xys, updatex=True, updatey=True):
+ """
+ Extend the `~.Axes.dataLim` Bbox to include the given points.
+
+ If no data is set currently, the Bbox will ignore its limits and set
+ the bound to be the bounds of the xydata (*xys*). Otherwise, it will
+ compute the bounds of the union of its current data and the data in
+ *xys*.
+
+ Parameters
+ ----------
+ xys : 2D array-like
+ The points to include in the data limits Bbox. This can be either
+ a list of (x, y) tuples or a (N, 2) array.
+
+ updatex, updatey : bool, default: True
+ Whether to update the x/y limits.
+ """
+ xys = np.asarray(xys)
+ if not np.any(np.isfinite(xys)):
+ return
+ self.dataLim.update_from_data_xy(xys, self.ignore_existing_data_limits,
+ updatex=updatex, updatey=updatey)
+ self.ignore_existing_data_limits = False
+
+ def _process_unit_info(self, datasets=None, kwargs=None, *, convert=True):
+ """
+ Set axis units based on *datasets* and *kwargs*, and optionally apply
+ unit conversions to *datasets*.
+
+ Parameters
+ ----------
+ datasets : list
+ List of (axis_name, dataset) pairs (where the axis name is defined
+ as in `._axis_map`). Individual datasets can also be None
+ (which gets passed through).
+ kwargs : dict
+ Other parameters from which unit info (i.e., the *xunits*,
+ *yunits*, *zunits* (for 3D Axes), *runits* and *thetaunits* (for
+ polar) entries) is popped, if present. Note that this dict is
+ mutated in-place!
+ convert : bool, default: True
+ Whether to return the original datasets or the converted ones.
+
+ Returns
+ -------
+ list
+ Either the original datasets if *convert* is False, or the
+ converted ones if *convert* is True (the default).
+ """
+ # The API makes datasets a list of pairs rather than an axis_name to
+ # dataset mapping because it is sometimes necessary to process multiple
+ # datasets for a single axis, and concatenating them may be tricky
+ # (e.g. if some are scalars, etc.).
+ datasets = datasets or []
+ kwargs = kwargs or {}
+ axis_map = self._axis_map
+ for axis_name, data in datasets:
+ try:
+ axis = axis_map[axis_name]
+ except KeyError:
+ raise ValueError(f"Invalid axis name: {axis_name!r}") from None
+ # Update from data if axis is already set but no unit is set yet.
+ if axis is not None and data is not None and not axis.have_units():
+ axis.update_units(data)
+ for axis_name, axis in axis_map.items():
+ # Return if no axis is set.
+ if axis is None:
+ continue
+ # Check for units in the kwargs, and if present update axis.
+ units = kwargs.pop(f"{axis_name}units", axis.units)
+ if self.name == "polar":
+ # Special case: polar supports "thetaunits"/"runits".
+ polar_units = {"x": "thetaunits", "y": "runits"}
+ units = kwargs.pop(polar_units[axis_name], units)
+ if units != axis.units and units is not None:
+ axis.set_units(units)
+ # If the units being set imply a different converter,
+ # we need to update again.
+ for dataset_axis_name, data in datasets:
+ if dataset_axis_name == axis_name and data is not None:
+ axis.update_units(data)
+ return [axis_map[axis_name].convert_units(data)
+ if convert and data is not None else data
+ for axis_name, data in datasets]
+
+ def in_axes(self, mouseevent):
+ """
+ Return whether the given event (in display coords) is in the Axes.
+ """
+ return self.patch.contains(mouseevent)[0]
+
+ get_autoscalex_on = _axis_method_wrapper("xaxis", "_get_autoscale_on")
+ get_autoscaley_on = _axis_method_wrapper("yaxis", "_get_autoscale_on")
+ set_autoscalex_on = _axis_method_wrapper("xaxis", "_set_autoscale_on")
+ set_autoscaley_on = _axis_method_wrapper("yaxis", "_set_autoscale_on")
+
+ def get_autoscale_on(self):
+ """Return True if each axis is autoscaled, False otherwise."""
+ return all(axis._get_autoscale_on()
+ for axis in self._axis_map.values())
+
+ def set_autoscale_on(self, b):
+ """
+ Set whether autoscaling is applied to each axis on the next draw or
+ call to `.Axes.autoscale_view`.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ for axis in self._axis_map.values():
+ axis._set_autoscale_on(b)
+
+ @property
+ def use_sticky_edges(self):
+ """
+ When autoscaling, whether to obey all `.Artist.sticky_edges`.
+
+ Default is ``True``.
+
+ Setting this to ``False`` ensures that the specified margins
+ will be applied, even if the plot includes an image, for
+ example, which would otherwise force a view limit to coincide
+ with its data limit.
+
+ The changing this property does not change the plot until
+ `autoscale` or `autoscale_view` is called.
+ """
+ return self._use_sticky_edges
+
+ @use_sticky_edges.setter
+ def use_sticky_edges(self, b):
+ self._use_sticky_edges = bool(b)
+ # No effect until next autoscaling, which will mark the Axes as stale.
+
+ def get_xmargin(self):
+ """
+ Retrieve autoscaling margin of the x-axis.
+
+ .. versionadded:: 3.9
+
+ Returns
+ -------
+ xmargin : float
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_xmargin
+ """
+ return self._xmargin
+
+ def get_ymargin(self):
+ """
+ Retrieve autoscaling margin of the y-axis.
+
+ .. versionadded:: 3.9
+
+ Returns
+ -------
+ ymargin : float
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_ymargin
+ """
+ return self._ymargin
+
+ def set_xmargin(self, m):
+ """
+ Set padding of X data limits prior to autoscaling.
+
+ *m* times the data interval will be added to each end of that interval
+ before it is used in autoscaling. If *m* is negative, this will clip
+ the data range instead of expanding it.
+
+ For example, if your data is in the range [0, 2], a margin of 0.1 will
+ result in a range [-0.2, 2.2]; a margin of -0.1 will result in a range
+ of [0.2, 1.8].
+
+ Parameters
+ ----------
+ m : float greater than -0.5
+ """
+ if m <= -0.5:
+ raise ValueError("margin must be greater than -0.5")
+ self._xmargin = m
+ self._request_autoscale_view("x")
+ self.stale = True
+
+ def set_ymargin(self, m):
+ """
+ Set padding of Y data limits prior to autoscaling.
+
+ *m* times the data interval will be added to each end of that interval
+ before it is used in autoscaling. If *m* is negative, this will clip
+ the data range instead of expanding it.
+
+ For example, if your data is in the range [0, 2], a margin of 0.1 will
+ result in a range [-0.2, 2.2]; a margin of -0.1 will result in a range
+ of [0.2, 1.8].
+
+ Parameters
+ ----------
+ m : float greater than -0.5
+ """
+ if m <= -0.5:
+ raise ValueError("margin must be greater than -0.5")
+ self._ymargin = m
+ self._request_autoscale_view("y")
+ self.stale = True
+
+ def margins(self, *margins, x=None, y=None, tight=True):
+ """
+ Set or retrieve margins around the data for autoscaling axis limits.
+
+ This allows to configure the padding around the data without having to
+ set explicit limits using `~.Axes.set_xlim` / `~.Axes.set_ylim`.
+
+ Autoscaling determines the axis limits by adding *margin* times the
+ data interval as padding around the data. See the following illustration:
+
+ .. plot:: _embedded_plots/axes_margins.py
+
+ All input parameters must be floats greater than -0.5. Passing both
+ positional and keyword arguments is invalid and will raise a TypeError.
+ If no arguments (positional or otherwise) are provided, the current
+ margins will remain unchanged and simply be returned.
+
+ The default margins are :rc:`axes.xmargin` and :rc:`axes.ymargin`.
+
+ Parameters
+ ----------
+ *margins : float, optional
+ If a single positional argument is provided, it specifies
+ both margins of the x-axis and y-axis limits. If two
+ positional arguments are provided, they will be interpreted
+ as *xmargin*, *ymargin*. If setting the margin on a single
+ axis is desired, use the keyword arguments described below.
+
+ x, y : float, optional
+ Specific margin values for the x-axis and y-axis,
+ respectively. These cannot be used with positional
+ arguments, but can be used individually to alter on e.g.,
+ only the y-axis.
+
+ tight : bool or None, default: True
+ The *tight* parameter is passed to `~.axes.Axes.autoscale_view`,
+ which is executed after a margin is changed; the default
+ here is *True*, on the assumption that when margins are
+ specified, no additional padding to match tick marks is
+ usually desired. Setting *tight* to *None* preserves
+ the previous setting.
+
+ Returns
+ -------
+ xmargin, ymargin : float
+
+ Notes
+ -----
+ If a previously used Axes method such as :meth:`pcolor` has set
+ `~.Axes.use_sticky_edges` to `True`, only the limits not set by
+ the "sticky artists" will be modified. To force all
+ margins to be set, set `~.Axes.use_sticky_edges` to `False`
+ before calling :meth:`margins`.
+
+ See Also
+ --------
+ .Axes.set_xmargin, .Axes.set_ymargin
+ """
+
+ if margins and (x is not None or y is not None):
+ raise TypeError('Cannot pass both positional and keyword '
+ 'arguments for x and/or y.')
+ elif len(margins) == 1:
+ x = y = margins[0]
+ elif len(margins) == 2:
+ x, y = margins
+ elif margins:
+ raise TypeError('Must pass a single positional argument for all '
+ 'margins, or one for each margin (x, y).')
+
+ if x is None and y is None:
+ if tight is not True:
+ _api.warn_external(f'ignoring tight={tight!r} in get mode')
+ return self._xmargin, self._ymargin
+
+ if tight is not None:
+ self._tight = tight
+ if x is not None:
+ self.set_xmargin(x)
+ if y is not None:
+ self.set_ymargin(y)
+
+ def set_rasterization_zorder(self, z):
+ """
+ Set the zorder threshold for rasterization for vector graphics output.
+
+ All artists with a zorder below the given value will be rasterized if
+ they support rasterization.
+
+ This setting is ignored for pixel-based output.
+
+ See also :doc:`/gallery/misc/rasterization_demo`.
+
+ Parameters
+ ----------
+ z : float or None
+ The zorder below which artists are rasterized.
+ If ``None`` rasterization based on zorder is deactivated.
+ """
+ self._rasterization_zorder = z
+ self.stale = True
+
+ def get_rasterization_zorder(self):
+ """Return the zorder value below which artists will be rasterized."""
+ return self._rasterization_zorder
+
+ def autoscale(self, enable=True, axis='both', tight=None):
+ """
+ Autoscale the axis view to the data (toggle).
+
+ Convenience method for simple axis view autoscaling.
+ It turns autoscaling on or off, and then,
+ if autoscaling for either axis is on, it performs
+ the autoscaling on the specified axis or Axes.
+
+ Parameters
+ ----------
+ enable : bool or None, default: True
+ True turns autoscaling on, False turns it off.
+ None leaves the autoscaling state unchanged.
+ axis : {'both', 'x', 'y'}, default: 'both'
+ The axis on which to operate. (For 3D Axes, *axis* can also be set
+ to 'z', and 'both' refers to all three Axes.)
+ tight : bool or None, default: None
+ If True, first set the margins to zero. Then, this argument is
+ forwarded to `~.axes.Axes.autoscale_view` (regardless of
+ its value); see the description of its behavior there.
+ """
+ if enable is None:
+ scalex = True
+ scaley = True
+ else:
+ if axis in ['x', 'both']:
+ self.set_autoscalex_on(bool(enable))
+ scalex = self.get_autoscalex_on()
+ else:
+ scalex = False
+ if axis in ['y', 'both']:
+ self.set_autoscaley_on(bool(enable))
+ scaley = self.get_autoscaley_on()
+ else:
+ scaley = False
+ if tight and scalex:
+ self._xmargin = 0
+ if tight and scaley:
+ self._ymargin = 0
+ if scalex:
+ self._request_autoscale_view("x", tight=tight)
+ if scaley:
+ self._request_autoscale_view("y", tight=tight)
+
+ def autoscale_view(self, tight=None, scalex=True, scaley=True):
+ """
+ Autoscale the view limits using the data limits.
+
+ Parameters
+ ----------
+ tight : bool or None
+ If *True*, only expand the axis limits using the margins. Note
+ that unlike for `autoscale`, ``tight=True`` does *not* set the
+ margins to zero.
+
+ If *False* and :rc:`axes.autolimit_mode` is 'round_numbers', then
+ after expansion by the margins, further expand the axis limits
+ using the axis major locator.
+
+ If None (the default), reuse the value set in the previous call to
+ `autoscale_view` (the initial value is False, but the default style
+ sets :rc:`axes.autolimit_mode` to 'data', in which case this
+ behaves like True).
+
+ scalex : bool, default: True
+ Whether to autoscale the x-axis.
+
+ scaley : bool, default: True
+ Whether to autoscale the y-axis.
+
+ Notes
+ -----
+ The autoscaling preserves any preexisting axis direction reversal.
+
+ The data limits are not updated automatically when artist data are
+ changed after the artist has been added to an Axes instance. In that
+ case, use :meth:`matplotlib.axes.Axes.relim` prior to calling
+ autoscale_view.
+
+ If the views of the Axes are fixed, e.g. via `set_xlim`, they will
+ not be changed by autoscale_view().
+ See :meth:`matplotlib.axes.Axes.autoscale` for an alternative.
+ """
+ if tight is not None:
+ self._tight = bool(tight)
+
+ x_stickies = y_stickies = np.array([])
+ if self.use_sticky_edges:
+ if self._xmargin and scalex and self.get_autoscalex_on():
+ x_stickies = np.sort(np.concatenate([
+ artist.sticky_edges.x
+ for ax in self._shared_axes["x"].get_siblings(self)
+ for artist in ax.get_children()]))
+ if self._ymargin and scaley and self.get_autoscaley_on():
+ y_stickies = np.sort(np.concatenate([
+ artist.sticky_edges.y
+ for ax in self._shared_axes["y"].get_siblings(self)
+ for artist in ax.get_children()]))
+ if self.get_xscale() == 'log':
+ x_stickies = x_stickies[x_stickies > 0]
+ if self.get_yscale() == 'log':
+ y_stickies = y_stickies[y_stickies > 0]
+
+ def handle_single_axis(
+ scale, shared_axes, name, axis, margin, stickies, set_bound):
+
+ if not (scale and axis._get_autoscale_on()):
+ return # nothing to do...
+
+ shared = shared_axes.get_siblings(self)
+ # Base autoscaling on finite data limits when there is at least one
+ # finite data limit among all the shared_axes and intervals.
+ values = [val for ax in shared
+ for val in getattr(ax.dataLim, f"interval{name}")
+ if np.isfinite(val)]
+ if values:
+ x0, x1 = (min(values), max(values))
+ elif getattr(self._viewLim, f"mutated{name}")():
+ # No data, but explicit viewLims already set:
+ # in mutatedx or mutatedy.
+ return
+ else:
+ x0, x1 = (-np.inf, np.inf)
+ # If x0 and x1 are nonfinite, get default limits from the locator.
+ locator = axis.get_major_locator()
+ x0, x1 = locator.nonsingular(x0, x1)
+ # Find the minimum minpos for use in the margin calculation.
+ minimum_minpos = min(
+ getattr(ax.dataLim, f"minpos{name}") for ax in shared)
+
+ # Prevent margin addition from crossing a sticky value. A small
+ # tolerance must be added due to floating point issues with
+ # streamplot; it is defined relative to x1-x0 but has
+ # no absolute term (e.g. "+1e-8") to avoid issues when working with
+ # datasets where all values are tiny (less than 1e-8).
+ tol = 1e-5 * abs(x1 - x0)
+ # Index of largest element < x0 + tol, if any.
+ i0 = stickies.searchsorted(x0 + tol) - 1
+ x0bound = stickies[i0] if i0 != -1 else None
+ # Index of smallest element > x1 - tol, if any.
+ i1 = stickies.searchsorted(x1 - tol)
+ x1bound = stickies[i1] if i1 != len(stickies) else None
+
+ # Add the margin in figure space and then transform back, to handle
+ # non-linear scales.
+ transform = axis.get_transform()
+ inverse_trans = transform.inverted()
+ x0, x1 = axis._scale.limit_range_for_scale(x0, x1, minimum_minpos)
+ x0t, x1t = transform.transform([x0, x1])
+ delta = (x1t - x0t) * margin
+ if not np.isfinite(delta):
+ delta = 0 # If a bound isn't finite, set margin to zero.
+ x0, x1 = inverse_trans.transform([x0t - delta, x1t + delta])
+
+ # Apply sticky bounds.
+ if x0bound is not None:
+ x0 = max(x0, x0bound)
+ if x1bound is not None:
+ x1 = min(x1, x1bound)
+
+ if not self._tight:
+ x0, x1 = locator.view_limits(x0, x1)
+ set_bound(x0, x1)
+ # End of definition of internal function 'handle_single_axis'.
+
+ handle_single_axis(
+ scalex, self._shared_axes["x"], 'x', self.xaxis, self._xmargin,
+ x_stickies, self.set_xbound)
+ handle_single_axis(
+ scaley, self._shared_axes["y"], 'y', self.yaxis, self._ymargin,
+ y_stickies, self.set_ybound)
+
+ def _update_title_position(self, renderer):
+ """
+ Update the title position based on the bounding box enclosing
+ all the ticklabels and x-axis spine and xlabel...
+ """
+ if self._autotitlepos is not None and not self._autotitlepos:
+ _log.debug('title position was updated manually, not adjusting')
+ return
+
+ titles = (self.title, self._left_title, self._right_title)
+
+ if not any(title.get_text() for title in titles):
+ # If the titles are all empty, there is no need to update their positions.
+ return
+
+ # Need to check all our twins too, aligned axes, and all the children
+ # as well.
+ axs = set()
+ axs.update(self.child_axes)
+ axs.update(self._twinned_axes.get_siblings(self))
+ axs.update(
+ self.get_figure(root=False)._align_label_groups['title'].get_siblings(self))
+
+ for ax in self.child_axes: # Child positions must be updated first.
+ locator = ax.get_axes_locator()
+ ax.apply_aspect(locator(self, renderer) if locator else None)
+
+ top = -np.inf
+ for ax in axs:
+ bb = None
+ if (ax.xaxis.get_ticks_position() in ['top', 'unknown'] or
+ ax.xaxis.get_label_position() == 'top'):
+ bb = ax.xaxis.get_tightbbox(renderer)
+ if bb is None:
+ # Extent of the outline for colorbars, of the axes otherwise.
+ bb = ax.spines.get("outline", ax).get_window_extent()
+ top = max(top, bb.ymax)
+
+ for title in titles:
+ x, _ = title.get_position()
+ # need to start again in case of window resizing
+ title.set_position((x, 1.0))
+ if title.get_text():
+ for ax in axs:
+ ax.yaxis.get_tightbbox(renderer) # update offsetText
+ if ax.yaxis.offsetText.get_text():
+ bb = ax.yaxis.offsetText.get_tightbbox(renderer)
+ if bb.intersection(title.get_tightbbox(renderer), bb):
+ top = bb.ymax
+ if top < 0:
+ # the top of Axes is not even on the figure, so don't try and
+ # automatically place it.
+ _log.debug('top of Axes not in the figure, so title not moved')
+ return
+ if title.get_window_extent(renderer).ymin < top:
+ _, y = self.transAxes.inverted().transform((0, top))
+ title.set_position((x, y))
+ # empirically, this doesn't always get the min to top,
+ # so we need to adjust again.
+ if title.get_window_extent(renderer).ymin < top:
+ _, y = self.transAxes.inverted().transform(
+ (0., 2 * top - title.get_window_extent(renderer).ymin))
+ title.set_position((x, y))
+
+ ymax = max(title.get_position()[1] for title in titles)
+ for title in titles:
+ # now line up all the titles at the highest baseline.
+ x, _ = title.get_position()
+ title.set_position((x, ymax))
+
+ # Drawing
+ @martist.allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+ if renderer is None:
+ raise RuntimeError('No renderer defined')
+ if not self.get_visible():
+ return
+ self._unstale_viewLim()
+
+ renderer.open_group('axes', gid=self.get_gid())
+
+ # prevent triggering call backs during the draw process
+ self._stale = True
+
+ # loop over self and child Axes...
+ locator = self.get_axes_locator()
+ self.apply_aspect(locator(self, renderer) if locator else None)
+
+ artists = self.get_children()
+ artists.remove(self.patch)
+
+ # the frame draws the edges around the Axes patch -- we
+ # decouple these so the patch can be in the background and the
+ # frame in the foreground. Do this before drawing the axis
+ # objects so that the spine has the opportunity to update them.
+ if not (self.axison and self._frameon):
+ for spine in self.spines.values():
+ artists.remove(spine)
+
+ self._update_title_position(renderer)
+
+ if not self.axison:
+ for _axis in self._axis_map.values():
+ artists.remove(_axis)
+
+ if not self.get_figure(root=True).canvas.is_saving():
+ artists = [
+ a for a in artists
+ if not a.get_animated() or isinstance(a, mimage.AxesImage)]
+ artists = sorted(artists, key=attrgetter('zorder'))
+
+ # rasterize artists with negative zorder
+ # if the minimum zorder is negative, start rasterization
+ rasterization_zorder = self._rasterization_zorder
+
+ if (rasterization_zorder is not None and
+ artists and artists[0].zorder < rasterization_zorder):
+ split_index = np.searchsorted(
+ [art.zorder for art in artists],
+ rasterization_zorder, side='right'
+ )
+ artists_rasterized = artists[:split_index]
+ artists = artists[split_index:]
+ else:
+ artists_rasterized = []
+
+ if self.axison and self._frameon:
+ if artists_rasterized:
+ artists_rasterized = [self.patch] + artists_rasterized
+ else:
+ artists = [self.patch] + artists
+
+ if artists_rasterized:
+ _draw_rasterized(self.get_figure(root=True), artists_rasterized, renderer)
+
+ mimage._draw_list_compositing_images(
+ renderer, self, artists, self.get_figure(root=True).suppressComposite)
+
+ renderer.close_group('axes')
+ self.stale = False
+
+ def draw_artist(self, a):
+ """
+ Efficiently redraw a single artist.
+ """
+ a.draw(self.get_figure(root=True).canvas.get_renderer())
+
+ def redraw_in_frame(self):
+ """
+ Efficiently redraw Axes data, but not axis ticks, labels, etc.
+ """
+ with ExitStack() as stack:
+ for artist in [*self._axis_map.values(),
+ self.title, self._left_title, self._right_title]:
+ stack.enter_context(artist._cm_set(visible=False))
+ self.draw(self.get_figure(root=True).canvas.get_renderer())
+
+ # Axes rectangle characteristics
+
+ def get_frame_on(self):
+ """Get whether the Axes rectangle patch is drawn."""
+ return self._frameon
+
+ def set_frame_on(self, b):
+ """
+ Set whether the Axes rectangle patch is drawn.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ self._frameon = b
+ self.stale = True
+
+ def get_axisbelow(self):
+ """
+ Get whether axis ticks and gridlines are above or below most artists.
+
+ Returns
+ -------
+ bool or 'line'
+
+ See Also
+ --------
+ set_axisbelow
+ """
+ return self._axisbelow
+
+ def set_axisbelow(self, b):
+ """
+ Set whether axis ticks and gridlines are above or below most artists.
+
+ This controls the zorder of the ticks and gridlines. For more
+ information on the zorder see :doc:`/gallery/misc/zorder_demo`.
+
+ Parameters
+ ----------
+ b : bool or 'line'
+ Possible values:
+
+ - *True* (zorder = 0.5): Ticks and gridlines are below patches and
+ lines, though still above images.
+ - 'line' (zorder = 1.5): Ticks and gridlines are above patches
+ (e.g. rectangles, with default zorder = 1) but still below lines
+ and markers (with their default zorder = 2).
+ - *False* (zorder = 2.5): Ticks and gridlines are above patches
+ and lines / markers.
+
+ Notes
+ -----
+ For more control, call the `~.Artist.set_zorder` method of each axis.
+
+ See Also
+ --------
+ get_axisbelow
+ """
+ # Check that b is True, False or 'line'
+ self._axisbelow = axisbelow = validate_axisbelow(b)
+ zorder = {
+ True: 0.5,
+ 'line': 1.5,
+ False: 2.5,
+ }[axisbelow]
+ for axis in self._axis_map.values():
+ axis.set_zorder(zorder)
+ self.stale = True
+
+ @_docstring.interpd
+ def grid(self, visible=None, which='major', axis='both', **kwargs):
+ """
+ Configure the grid lines.
+
+ Parameters
+ ----------
+ visible : bool or None, optional
+ Whether to show the grid lines. If any *kwargs* are supplied, it
+ is assumed you want the grid on and *visible* will be set to True.
+
+ If *visible* is *None* and there are no *kwargs*, this toggles the
+ visibility of the lines.
+
+ which : {'major', 'minor', 'both'}, optional
+ The grid lines to apply the changes on.
+
+ axis : {'both', 'x', 'y'}, optional
+ The axis to apply the changes on.
+
+ **kwargs : `~matplotlib.lines.Line2D` properties
+ Define the line properties of the grid, e.g.::
+
+ grid(color='r', linestyle='-', linewidth=2)
+
+ Valid keyword arguments are:
+
+ %(Line2D:kwdoc)s
+
+ Notes
+ -----
+ The axis is drawn as a unit, so the effective zorder for drawing the
+ grid is determined by the zorder of each axis, not by the zorder of the
+ `.Line2D` objects comprising the grid. Therefore, to set grid zorder,
+ use `.set_axisbelow` or, for more control, call the
+ `~.Artist.set_zorder` method of each axis.
+ """
+ _api.check_in_list(['x', 'y', 'both'], axis=axis)
+ if axis in ['x', 'both']:
+ self.xaxis.grid(visible, which=which, **kwargs)
+ if axis in ['y', 'both']:
+ self.yaxis.grid(visible, which=which, **kwargs)
+
+ def ticklabel_format(self, *, axis='both', style=None, scilimits=None,
+ useOffset=None, useLocale=None, useMathText=None):
+ r"""
+ Configure the `.ScalarFormatter` used by default for linear Axes.
+
+ If a parameter is not set, the corresponding property of the formatter
+ is left unchanged.
+
+ Parameters
+ ----------
+ axis : {'x', 'y', 'both'}, default: 'both'
+ The axis to configure. Only major ticks are affected.
+
+ style : {'sci', 'scientific', 'plain'}
+ Whether to use scientific notation.
+ The formatter default is to use scientific notation.
+ 'sci' is equivalent to 'scientific'.
+
+ scilimits : pair of ints (m, n)
+ Scientific notation is used only for numbers outside the range
+ 10\ :sup:`m` to 10\ :sup:`n` (and only if the formatter is
+ configured to use scientific notation at all). Use (0, 0) to
+ include all numbers. Use (m, m) where m != 0 to fix the order of
+ magnitude to 10\ :sup:`m`.
+ The formatter default is :rc:`axes.formatter.limits`.
+
+ useOffset : bool or float
+ If True, the offset is calculated as needed.
+ If False, no offset is used.
+ If a numeric value, it sets the offset.
+ The formatter default is :rc:`axes.formatter.useoffset`.
+
+ useLocale : bool
+ Whether to format the number using the current locale or using the
+ C (English) locale. This affects e.g. the decimal separator. The
+ formatter default is :rc:`axes.formatter.use_locale`.
+
+ useMathText : bool
+ Render the offset and scientific notation in mathtext.
+ The formatter default is :rc:`axes.formatter.use_mathtext`.
+
+ Raises
+ ------
+ AttributeError
+ If the current formatter is not a `.ScalarFormatter`.
+ """
+ if isinstance(style, str):
+ style = style.lower()
+ axis = axis.lower()
+ if scilimits is not None:
+ try:
+ m, n = scilimits
+ m + n + 1 # check that both are numbers
+ except (ValueError, TypeError) as err:
+ raise ValueError("scilimits must be a sequence of 2 integers"
+ ) from err
+ STYLES = {'sci': True, 'scientific': True, 'plain': False, '': None, None: None}
+ # The '' option is included for backwards-compatibility.
+ is_sci_style = _api.check_getitem(STYLES, style=style)
+ axis_map = {**{k: [v] for k, v in self._axis_map.items()},
+ 'both': list(self._axis_map.values())}
+ axises = _api.check_getitem(axis_map, axis=axis)
+ try:
+ for axis in axises:
+ if is_sci_style is not None:
+ axis.major.formatter.set_scientific(is_sci_style)
+ if scilimits is not None:
+ axis.major.formatter.set_powerlimits(scilimits)
+ if useOffset is not None:
+ axis.major.formatter.set_useOffset(useOffset)
+ if useLocale is not None:
+ axis.major.formatter.set_useLocale(useLocale)
+ if useMathText is not None:
+ axis.major.formatter.set_useMathText(useMathText)
+ except AttributeError as err:
+ raise AttributeError(
+ "This method only works with the ScalarFormatter") from err
+
+ def locator_params(self, axis='both', tight=None, **kwargs):
+ """
+ Control behavior of major tick locators.
+
+ Because the locator is involved in autoscaling, `~.Axes.autoscale_view`
+ is called automatically after the parameters are changed.
+
+ Parameters
+ ----------
+ axis : {'both', 'x', 'y'}, default: 'both'
+ The axis on which to operate. (For 3D Axes, *axis* can also be
+ set to 'z', and 'both' refers to all three axes.)
+ tight : bool or None, optional
+ Parameter passed to `~.Axes.autoscale_view`.
+ Default is None, for no change.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Remaining keyword arguments are passed to directly to the
+ ``set_params()`` method of the locator. Supported keywords depend
+ on the type of the locator. See for example
+ `~.ticker.MaxNLocator.set_params` for the `.ticker.MaxNLocator`
+ used by default for linear.
+
+ Examples
+ --------
+ When plotting small subplots, one might want to reduce the maximum
+ number of ticks and use tight bounds, for example::
+
+ ax.locator_params(tight=True, nbins=4)
+
+ """
+ _api.check_in_list([*self._axis_names, "both"], axis=axis)
+ for name in self._axis_names:
+ if axis in [name, "both"]:
+ loc = self._axis_map[name].get_major_locator()
+ loc.set_params(**kwargs)
+ self._request_autoscale_view(name, tight=tight)
+ self.stale = True
+
+ def tick_params(self, axis='both', **kwargs):
+ """
+ Change the appearance of ticks, tick labels, and gridlines.
+
+ Tick properties that are not explicitly set using the keyword
+ arguments remain unchanged unless *reset* is True. For the current
+ style settings, see `.Axis.get_tick_params`.
+
+ Parameters
+ ----------
+ axis : {'x', 'y', 'both'}, default: 'both'
+ The axis to which the parameters are applied.
+ which : {'major', 'minor', 'both'}, default: 'major'
+ The group of ticks to which the parameters are applied.
+ reset : bool, default: False
+ Whether to reset the ticks to defaults before updating them.
+
+ Other Parameters
+ ----------------
+ direction : {'in', 'out', 'inout'}
+ Puts ticks inside the Axes, outside the Axes, or both.
+ length : float
+ Tick length in points.
+ width : float
+ Tick width in points.
+ color : :mpltype:`color`
+ Tick color.
+ pad : float
+ Distance in points between tick and label.
+ labelsize : float or str
+ Tick label font size in points or as a string (e.g., 'large').
+ labelcolor : :mpltype:`color`
+ Tick label color.
+ labelfontfamily : str
+ Tick label font.
+ colors : :mpltype:`color`
+ Tick color and label color.
+ zorder : float
+ Tick and label zorder.
+ bottom, top, left, right : bool
+ Whether to draw the respective ticks.
+ labelbottom, labeltop, labelleft, labelright : bool
+ Whether to draw the respective tick labels.
+ labelrotation : float
+ Tick label rotation
+ grid_color : :mpltype:`color`
+ Gridline color.
+ grid_alpha : float
+ Transparency of gridlines: 0 (transparent) to 1 (opaque).
+ grid_linewidth : float
+ Width of gridlines in points.
+ grid_linestyle : str
+ Any valid `.Line2D` line style spec.
+
+ Examples
+ --------
+ ::
+
+ ax.tick_params(direction='out', length=6, width=2, colors='r',
+ grid_color='r', grid_alpha=0.5)
+
+ This will make all major ticks be red, pointing out of the box,
+ and with dimensions 6 points by 2 points. Tick labels will
+ also be red. Gridlines will be red and translucent.
+
+ """
+ _api.check_in_list(['x', 'y', 'both'], axis=axis)
+ if axis in ['x', 'both']:
+ xkw = dict(kwargs)
+ xkw.pop('left', None)
+ xkw.pop('right', None)
+ xkw.pop('labelleft', None)
+ xkw.pop('labelright', None)
+ self.xaxis.set_tick_params(**xkw)
+ if axis in ['y', 'both']:
+ ykw = dict(kwargs)
+ ykw.pop('top', None)
+ ykw.pop('bottom', None)
+ ykw.pop('labeltop', None)
+ ykw.pop('labelbottom', None)
+ self.yaxis.set_tick_params(**ykw)
+
+ def set_axis_off(self):
+ """
+ Hide all visual components of the x- and y-axis.
+
+ This sets a flag to suppress drawing of all axis decorations, i.e.
+ axis labels, axis spines, and the axis tick component (tick markers,
+ tick labels, and grid lines). Individual visibility settings of these
+ components are ignored as long as `set_axis_off()` is in effect.
+ """
+ self.axison = False
+ self.stale = True
+
+ def set_axis_on(self):
+ """
+ Do not hide all visual components of the x- and y-axis.
+
+ This reverts the effect of a prior `.set_axis_off()` call. Whether the
+ individual axis decorations are drawn is controlled by their respective
+ visibility settings.
+
+ This is on by default.
+ """
+ self.axison = True
+ self.stale = True
+
+ # data limits, ticks, tick labels, and formatting
+
+ def get_xlabel(self):
+ """
+ Get the xlabel text string.
+ """
+ label = self.xaxis.label
+ return label.get_text()
+
+ def set_xlabel(self, xlabel, fontdict=None, labelpad=None, *,
+ loc=None, **kwargs):
+ """
+ Set the label for the x-axis.
+
+ Parameters
+ ----------
+ xlabel : str
+ The label text.
+
+ labelpad : float, default: :rc:`axes.labelpad`
+ Spacing in points from the Axes bounding box including ticks
+ and tick labels. If None, the previous value is left as is.
+
+ loc : {'left', 'center', 'right'}, default: :rc:`xaxis.labellocation`
+ The label position. This is a high-level alternative for passing
+ parameters *x* and *horizontalalignment*.
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.text.Text` properties
+ `.Text` properties control the appearance of the label.
+
+ See Also
+ --------
+ text : Documents the properties supported by `.Text`.
+ """
+ if labelpad is not None:
+ self.xaxis.labelpad = labelpad
+ protected_kw = ['x', 'horizontalalignment', 'ha']
+ if {*kwargs} & {*protected_kw}:
+ if loc is not None:
+ raise TypeError(f"Specifying 'loc' is disallowed when any of "
+ f"its corresponding low level keyword "
+ f"arguments ({protected_kw}) are also "
+ f"supplied")
+
+ else:
+ loc = (loc if loc is not None
+ else mpl.rcParams['xaxis.labellocation'])
+ _api.check_in_list(('left', 'center', 'right'), loc=loc)
+
+ x = {
+ 'left': 0,
+ 'center': 0.5,
+ 'right': 1,
+ }[loc]
+ kwargs.update(x=x, horizontalalignment=loc)
+
+ return self.xaxis.set_label_text(xlabel, fontdict, **kwargs)
+
+ def invert_xaxis(self):
+ """
+ Invert the x-axis.
+
+ See Also
+ --------
+ xaxis_inverted
+ get_xlim, set_xlim
+ get_xbound, set_xbound
+ """
+ self.xaxis.set_inverted(not self.xaxis.get_inverted())
+
+ xaxis_inverted = _axis_method_wrapper("xaxis", "get_inverted")
+
+ def get_xbound(self):
+ """
+ Return the lower and upper x-axis bounds, in increasing order.
+
+ See Also
+ --------
+ set_xbound
+ get_xlim, set_xlim
+ invert_xaxis, xaxis_inverted
+ """
+ left, right = self.get_xlim()
+ if left < right:
+ return left, right
+ else:
+ return right, left
+
+ def set_xbound(self, lower=None, upper=None):
+ """
+ Set the lower and upper numerical bounds of the x-axis.
+
+ This method will honor axis inversion regardless of parameter order.
+ It will not change the autoscaling setting (`.get_autoscalex_on()`).
+
+ Parameters
+ ----------
+ lower, upper : float or None
+ The lower and upper bounds. If *None*, the respective axis bound
+ is not modified.
+
+ .. ACCEPTS: (lower: float, upper: float)
+
+ See Also
+ --------
+ get_xbound
+ get_xlim, set_xlim
+ invert_xaxis, xaxis_inverted
+ """
+ if upper is None and np.iterable(lower):
+ lower, upper = lower
+
+ old_lower, old_upper = self.get_xbound()
+ if lower is None:
+ lower = old_lower
+ if upper is None:
+ upper = old_upper
+
+ self.set_xlim(sorted((lower, upper),
+ reverse=bool(self.xaxis_inverted())),
+ auto=None)
+
+ def get_xlim(self):
+ """
+ Return the x-axis view limits.
+
+ Returns
+ -------
+ left, right : (float, float)
+ The current x-axis limits in data coordinates.
+
+ See Also
+ --------
+ .Axes.set_xlim
+ .Axes.set_xbound, .Axes.get_xbound
+ .Axes.invert_xaxis, .Axes.xaxis_inverted
+
+ Notes
+ -----
+ The x-axis may be inverted, in which case the *left* value will
+ be greater than the *right* value.
+ """
+ return tuple(self.viewLim.intervalx)
+
+ def _validate_converted_limits(self, limit, convert):
+ """
+ Raise ValueError if converted limits are non-finite.
+
+ Note that this function also accepts None as a limit argument.
+
+ Returns
+ -------
+ The limit value after call to convert(), or None if limit is None.
+ """
+ if limit is not None:
+ converted_limit = convert(limit)
+ if isinstance(converted_limit, np.ndarray):
+ converted_limit = converted_limit.squeeze()
+ if (isinstance(converted_limit, Real)
+ and not np.isfinite(converted_limit)):
+ raise ValueError("Axis limits cannot be NaN or Inf")
+ return converted_limit
+
+ def set_xlim(self, left=None, right=None, *, emit=True, auto=False,
+ xmin=None, xmax=None):
+ """
+ Set the x-axis view limits.
+
+ Parameters
+ ----------
+ left : float, optional
+ The left xlim in data coordinates. Passing *None* leaves the
+ limit unchanged.
+
+ The left and right xlims may also be passed as the tuple
+ (*left*, *right*) as the first positional argument (or as
+ the *left* keyword argument).
+
+ .. ACCEPTS: (left: float, right: float)
+
+ right : float, optional
+ The right xlim in data coordinates. Passing *None* leaves the
+ limit unchanged.
+
+ emit : bool, default: True
+ Whether to notify observers of limit change.
+
+ auto : bool or None, default: False
+ Whether to turn on autoscaling of the x-axis. True turns on,
+ False turns off, None leaves unchanged.
+
+ xmin, xmax : float, optional
+ They are equivalent to left and right respectively, and it is an
+ error to pass both *xmin* and *left* or *xmax* and *right*.
+
+ Returns
+ -------
+ left, right : (float, float)
+ The new x-axis limits in data coordinates.
+
+ See Also
+ --------
+ get_xlim
+ set_xbound, get_xbound
+ invert_xaxis, xaxis_inverted
+
+ Notes
+ -----
+ The *left* value may be greater than the *right* value, in which
+ case the x-axis values will decrease from left to right.
+
+ Examples
+ --------
+ >>> set_xlim(left, right)
+ >>> set_xlim((left, right))
+ >>> left, right = set_xlim(left, right)
+
+ One limit may be left unchanged.
+
+ >>> set_xlim(right=right_lim)
+
+ Limits may be passed in reverse order to flip the direction of
+ the x-axis. For example, suppose *x* represents the number of
+ years before present. The x-axis limits might be set like the
+ following so 5000 years ago is on the left of the plot and the
+ present is on the right.
+
+ >>> set_xlim(5000, 0)
+ """
+ if right is None and np.iterable(left):
+ left, right = left
+ if xmin is not None:
+ if left is not None:
+ raise TypeError("Cannot pass both 'left' and 'xmin'")
+ left = xmin
+ if xmax is not None:
+ if right is not None:
+ raise TypeError("Cannot pass both 'right' and 'xmax'")
+ right = xmax
+ return self.xaxis._set_lim(left, right, emit=emit, auto=auto)
+
+ get_xscale = _axis_method_wrapper("xaxis", "get_scale")
+ set_xscale = _axis_method_wrapper("xaxis", "_set_axes_scale")
+ get_xticks = _axis_method_wrapper("xaxis", "get_ticklocs")
+ set_xticks = _axis_method_wrapper("xaxis", "set_ticks",
+ doc_sub={'set_ticks': 'set_xticks'})
+ get_xmajorticklabels = _axis_method_wrapper("xaxis", "get_majorticklabels")
+ get_xminorticklabels = _axis_method_wrapper("xaxis", "get_minorticklabels")
+ get_xticklabels = _axis_method_wrapper("xaxis", "get_ticklabels")
+ set_xticklabels = _axis_method_wrapper(
+ "xaxis", "set_ticklabels",
+ doc_sub={"Axis.set_ticks": "Axes.set_xticks"})
+
+ def get_ylabel(self):
+ """
+ Get the ylabel text string.
+ """
+ label = self.yaxis.label
+ return label.get_text()
+
+ def set_ylabel(self, ylabel, fontdict=None, labelpad=None, *,
+ loc=None, **kwargs):
+ """
+ Set the label for the y-axis.
+
+ Parameters
+ ----------
+ ylabel : str
+ The label text.
+
+ labelpad : float, default: :rc:`axes.labelpad`
+ Spacing in points from the Axes bounding box including ticks
+ and tick labels. If None, the previous value is left as is.
+
+ loc : {'bottom', 'center', 'top'}, default: :rc:`yaxis.labellocation`
+ The label position. This is a high-level alternative for passing
+ parameters *y* and *horizontalalignment*.
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.text.Text` properties
+ `.Text` properties control the appearance of the label.
+
+ See Also
+ --------
+ text : Documents the properties supported by `.Text`.
+ """
+ if labelpad is not None:
+ self.yaxis.labelpad = labelpad
+ protected_kw = ['y', 'horizontalalignment', 'ha']
+ if {*kwargs} & {*protected_kw}:
+ if loc is not None:
+ raise TypeError(f"Specifying 'loc' is disallowed when any of "
+ f"its corresponding low level keyword "
+ f"arguments ({protected_kw}) are also "
+ f"supplied")
+
+ else:
+ loc = (loc if loc is not None
+ else mpl.rcParams['yaxis.labellocation'])
+ _api.check_in_list(('bottom', 'center', 'top'), loc=loc)
+
+ y, ha = {
+ 'bottom': (0, 'left'),
+ 'center': (0.5, 'center'),
+ 'top': (1, 'right')
+ }[loc]
+ kwargs.update(y=y, horizontalalignment=ha)
+
+ return self.yaxis.set_label_text(ylabel, fontdict, **kwargs)
+
+ def invert_yaxis(self):
+ """
+ Invert the y-axis.
+
+ See Also
+ --------
+ yaxis_inverted
+ get_ylim, set_ylim
+ get_ybound, set_ybound
+ """
+ self.yaxis.set_inverted(not self.yaxis.get_inverted())
+
+ yaxis_inverted = _axis_method_wrapper("yaxis", "get_inverted")
+
+ def get_ybound(self):
+ """
+ Return the lower and upper y-axis bounds, in increasing order.
+
+ See Also
+ --------
+ set_ybound
+ get_ylim, set_ylim
+ invert_yaxis, yaxis_inverted
+ """
+ bottom, top = self.get_ylim()
+ if bottom < top:
+ return bottom, top
+ else:
+ return top, bottom
+
+ def set_ybound(self, lower=None, upper=None):
+ """
+ Set the lower and upper numerical bounds of the y-axis.
+
+ This method will honor axis inversion regardless of parameter order.
+ It will not change the autoscaling setting (`.get_autoscaley_on()`).
+
+ Parameters
+ ----------
+ lower, upper : float or None
+ The lower and upper bounds. If *None*, the respective axis bound
+ is not modified.
+
+ .. ACCEPTS: (lower: float, upper: float)
+
+ See Also
+ --------
+ get_ybound
+ get_ylim, set_ylim
+ invert_yaxis, yaxis_inverted
+ """
+ if upper is None and np.iterable(lower):
+ lower, upper = lower
+
+ old_lower, old_upper = self.get_ybound()
+ if lower is None:
+ lower = old_lower
+ if upper is None:
+ upper = old_upper
+
+ self.set_ylim(sorted((lower, upper),
+ reverse=bool(self.yaxis_inverted())),
+ auto=None)
+
+ def get_ylim(self):
+ """
+ Return the y-axis view limits.
+
+ Returns
+ -------
+ bottom, top : (float, float)
+ The current y-axis limits in data coordinates.
+
+ See Also
+ --------
+ .Axes.set_ylim
+ .Axes.set_ybound, .Axes.get_ybound
+ .Axes.invert_yaxis, .Axes.yaxis_inverted
+
+ Notes
+ -----
+ The y-axis may be inverted, in which case the *bottom* value
+ will be greater than the *top* value.
+ """
+ return tuple(self.viewLim.intervaly)
+
+ def set_ylim(self, bottom=None, top=None, *, emit=True, auto=False,
+ ymin=None, ymax=None):
+ """
+ Set the y-axis view limits.
+
+ Parameters
+ ----------
+ bottom : float, optional
+ The bottom ylim in data coordinates. Passing *None* leaves the
+ limit unchanged.
+
+ The bottom and top ylims may also be passed as the tuple
+ (*bottom*, *top*) as the first positional argument (or as
+ the *bottom* keyword argument).
+
+ .. ACCEPTS: (bottom: float, top: float)
+
+ top : float, optional
+ The top ylim in data coordinates. Passing *None* leaves the
+ limit unchanged.
+
+ emit : bool, default: True
+ Whether to notify observers of limit change.
+
+ auto : bool or None, default: False
+ Whether to turn on autoscaling of the y-axis. *True* turns on,
+ *False* turns off, *None* leaves unchanged.
+
+ ymin, ymax : float, optional
+ They are equivalent to bottom and top respectively, and it is an
+ error to pass both *ymin* and *bottom* or *ymax* and *top*.
+
+ Returns
+ -------
+ bottom, top : (float, float)
+ The new y-axis limits in data coordinates.
+
+ See Also
+ --------
+ get_ylim
+ set_ybound, get_ybound
+ invert_yaxis, yaxis_inverted
+
+ Notes
+ -----
+ The *bottom* value may be greater than the *top* value, in which
+ case the y-axis values will decrease from *bottom* to *top*.
+
+ Examples
+ --------
+ >>> set_ylim(bottom, top)
+ >>> set_ylim((bottom, top))
+ >>> bottom, top = set_ylim(bottom, top)
+
+ One limit may be left unchanged.
+
+ >>> set_ylim(top=top_lim)
+
+ Limits may be passed in reverse order to flip the direction of
+ the y-axis. For example, suppose ``y`` represents depth of the
+ ocean in m. The y-axis limits might be set like the following
+ so 5000 m depth is at the bottom of the plot and the surface,
+ 0 m, is at the top.
+
+ >>> set_ylim(5000, 0)
+ """
+ if top is None and np.iterable(bottom):
+ bottom, top = bottom
+ if ymin is not None:
+ if bottom is not None:
+ raise TypeError("Cannot pass both 'bottom' and 'ymin'")
+ bottom = ymin
+ if ymax is not None:
+ if top is not None:
+ raise TypeError("Cannot pass both 'top' and 'ymax'")
+ top = ymax
+ return self.yaxis._set_lim(bottom, top, emit=emit, auto=auto)
+
+ get_yscale = _axis_method_wrapper("yaxis", "get_scale")
+ set_yscale = _axis_method_wrapper("yaxis", "_set_axes_scale")
+ get_yticks = _axis_method_wrapper("yaxis", "get_ticklocs")
+ set_yticks = _axis_method_wrapper("yaxis", "set_ticks",
+ doc_sub={'set_ticks': 'set_yticks'})
+ get_ymajorticklabels = _axis_method_wrapper("yaxis", "get_majorticklabels")
+ get_yminorticklabels = _axis_method_wrapper("yaxis", "get_minorticklabels")
+ get_yticklabels = _axis_method_wrapper("yaxis", "get_ticklabels")
+ set_yticklabels = _axis_method_wrapper(
+ "yaxis", "set_ticklabels",
+ doc_sub={"Axis.set_ticks": "Axes.set_yticks"})
+
+ xaxis_date = _axis_method_wrapper("xaxis", "axis_date")
+ yaxis_date = _axis_method_wrapper("yaxis", "axis_date")
+
+ def format_xdata(self, x):
+ """
+ Return *x* formatted as an x-value.
+
+ This function will use the `.fmt_xdata` attribute if it is not None,
+ else will fall back on the xaxis major formatter.
+ """
+ return (self.fmt_xdata if self.fmt_xdata is not None
+ else self.xaxis.get_major_formatter().format_data_short)(x)
+
+ def format_ydata(self, y):
+ """
+ Return *y* formatted as a y-value.
+
+ This function will use the `.fmt_ydata` attribute if it is not None,
+ else will fall back on the yaxis major formatter.
+ """
+ return (self.fmt_ydata if self.fmt_ydata is not None
+ else self.yaxis.get_major_formatter().format_data_short)(y)
+
+ def format_coord(self, x, y):
+ """Return a format string formatting the *x*, *y* coordinates."""
+ twins = self._twinned_axes.get_siblings(self)
+ if len(twins) == 1:
+ return "(x, y) = ({}, {})".format(
+ "???" if x is None else self.format_xdata(x),
+ "???" if y is None else self.format_ydata(y))
+ screen_xy = self.transData.transform((x, y))
+ xy_strs = []
+ # Retrieve twins in the order of self.figure.axes to sort tied zorders (which is
+ # the common case) by the order in which they are added to the figure.
+ for ax in sorted(twins, key=attrgetter("zorder")):
+ data_x, data_y = ax.transData.inverted().transform(screen_xy)
+ xy_strs.append(
+ "({}, {})".format(ax.format_xdata(data_x), ax.format_ydata(data_y)))
+ return "(x, y) = {}".format(" | ".join(xy_strs))
+
+ def minorticks_on(self):
+ """
+ Display minor ticks on the Axes.
+
+ Displaying minor ticks may reduce performance; you may turn them off
+ using `minorticks_off()` if drawing speed is a problem.
+ """
+ self.xaxis.minorticks_on()
+ self.yaxis.minorticks_on()
+
+ def minorticks_off(self):
+ """Remove minor ticks from the Axes."""
+ self.xaxis.minorticks_off()
+ self.yaxis.minorticks_off()
+
+ # Interactive manipulation
+
+ def can_zoom(self):
+ """
+ Return whether this Axes supports the zoom box button functionality.
+ """
+ return True
+
+ def can_pan(self):
+ """
+ Return whether this Axes supports any pan/zoom button functionality.
+ """
+ return True
+
+ def get_navigate(self):
+ """
+ Get whether the Axes responds to navigation commands.
+ """
+ return self._navigate
+
+ def set_navigate(self, b):
+ """
+ Set whether the Axes responds to navigation toolbar commands.
+
+ Parameters
+ ----------
+ b : bool
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_forward_navigation_events
+
+ """
+ self._navigate = b
+
+ def get_navigate_mode(self):
+ """
+ Get the navigation toolbar button status: 'PAN', 'ZOOM', or None.
+ """
+ return self._navigate_mode
+
+ def set_navigate_mode(self, b):
+ """
+ Set the navigation toolbar button status.
+
+ .. warning::
+ This is not a user-API function.
+
+ """
+ self._navigate_mode = b
+
+ def _get_view(self):
+ """
+ Save information required to reproduce the current view.
+
+ This method is called before a view is changed, such as during a pan or zoom
+ initiated by the user. It returns an opaque object that describes the current
+ view, in a format compatible with :meth:`_set_view`.
+
+ The default implementation saves the view limits and autoscaling state.
+ Subclasses may override this as needed, as long as :meth:`_set_view` is also
+ adjusted accordingly.
+ """
+ return {
+ "xlim": self.get_xlim(), "autoscalex_on": self.get_autoscalex_on(),
+ "ylim": self.get_ylim(), "autoscaley_on": self.get_autoscaley_on(),
+ }
+
+ def _set_view(self, view):
+ """
+ Apply a previously saved view.
+
+ This method is called when restoring a view (with the return value of
+ :meth:`_get_view` as argument), such as with the navigation buttons.
+
+ Subclasses that override :meth:`_get_view` also need to override this method
+ accordingly.
+ """
+ self.set(**view)
+
+ def _prepare_view_from_bbox(self, bbox, direction='in',
+ mode=None, twinx=False, twiny=False):
+ """
+ Helper function to prepare the new bounds from a bbox.
+
+ This helper function returns the new x and y bounds from the zoom
+ bbox. This a convenience method to abstract the bbox logic
+ out of the base setter.
+ """
+ if len(bbox) == 3:
+ xp, yp, scl = bbox # Zooming code
+ if scl == 0: # Should not happen
+ scl = 1.
+ if scl > 1:
+ direction = 'in'
+ else:
+ direction = 'out'
+ scl = 1/scl
+ # get the limits of the axes
+ (xmin, ymin), (xmax, ymax) = self.transData.transform(
+ np.transpose([self.get_xlim(), self.get_ylim()]))
+ # set the range
+ xwidth = xmax - xmin
+ ywidth = ymax - ymin
+ xcen = (xmax + xmin)*.5
+ ycen = (ymax + ymin)*.5
+ xzc = (xp*(scl - 1) + xcen)/scl
+ yzc = (yp*(scl - 1) + ycen)/scl
+ bbox = [xzc - xwidth/2./scl, yzc - ywidth/2./scl,
+ xzc + xwidth/2./scl, yzc + ywidth/2./scl]
+ elif len(bbox) != 4:
+ # should be len 3 or 4 but nothing else
+ _api.warn_external(
+ "Warning in _set_view_from_bbox: bounding box is not a tuple "
+ "of length 3 or 4. Ignoring the view change.")
+ return
+
+ # Original limits.
+ xmin0, xmax0 = self.get_xbound()
+ ymin0, ymax0 = self.get_ybound()
+ # The zoom box in screen coords.
+ startx, starty, stopx, stopy = bbox
+ # Convert to data coords.
+ (startx, starty), (stopx, stopy) = self.transData.inverted().transform(
+ [(startx, starty), (stopx, stopy)])
+ # Clip to axes limits.
+ xmin, xmax = np.clip(sorted([startx, stopx]), xmin0, xmax0)
+ ymin, ymax = np.clip(sorted([starty, stopy]), ymin0, ymax0)
+ # Don't double-zoom twinned axes or if zooming only the other axis.
+ if twinx or mode == "y":
+ xmin, xmax = xmin0, xmax0
+ if twiny or mode == "x":
+ ymin, ymax = ymin0, ymax0
+
+ if direction == "in":
+ new_xbound = xmin, xmax
+ new_ybound = ymin, ymax
+
+ elif direction == "out":
+ x_trf = self.xaxis.get_transform()
+ sxmin0, sxmax0, sxmin, sxmax = x_trf.transform(
+ [xmin0, xmax0, xmin, xmax]) # To screen space.
+ factor = (sxmax0 - sxmin0) / (sxmax - sxmin) # Unzoom factor.
+ # Move original bounds away by
+ # (factor) x (distance between unzoom box and Axes bbox).
+ sxmin1 = sxmin0 - factor * (sxmin - sxmin0)
+ sxmax1 = sxmax0 + factor * (sxmax0 - sxmax)
+ # And back to data space.
+ new_xbound = x_trf.inverted().transform([sxmin1, sxmax1])
+
+ y_trf = self.yaxis.get_transform()
+ symin0, symax0, symin, symax = y_trf.transform(
+ [ymin0, ymax0, ymin, ymax])
+ factor = (symax0 - symin0) / (symax - symin)
+ symin1 = symin0 - factor * (symin - symin0)
+ symax1 = symax0 + factor * (symax0 - symax)
+ new_ybound = y_trf.inverted().transform([symin1, symax1])
+
+ return new_xbound, new_ybound
+
+ def _set_view_from_bbox(self, bbox, direction='in',
+ mode=None, twinx=False, twiny=False):
+ """
+ Update view from a selection bbox.
+
+ .. note::
+
+ Intended to be overridden by new projection types, but if not, the
+ default implementation sets the view limits to the bbox directly.
+
+ Parameters
+ ----------
+ bbox : 4-tuple or 3 tuple
+ * If bbox is a 4 tuple, it is the selected bounding box limits,
+ in *display* coordinates.
+ * If bbox is a 3 tuple, it is an (xp, yp, scl) triple, where
+ (xp, yp) is the center of zooming and scl the scale factor to
+ zoom by.
+
+ direction : str
+ The direction to apply the bounding box.
+ * `'in'` - The bounding box describes the view directly, i.e.,
+ it zooms in.
+ * `'out'` - The bounding box describes the size to make the
+ existing view, i.e., it zooms out.
+
+ mode : str or None
+ The selection mode, whether to apply the bounding box in only the
+ `'x'` direction, `'y'` direction or both (`None`).
+
+ twinx : bool
+ Whether this axis is twinned in the *x*-direction.
+
+ twiny : bool
+ Whether this axis is twinned in the *y*-direction.
+ """
+ new_xbound, new_ybound = self._prepare_view_from_bbox(
+ bbox, direction=direction, mode=mode, twinx=twinx, twiny=twiny)
+ if not twinx and mode != "y":
+ self.set_xbound(new_xbound)
+ self.set_autoscalex_on(False)
+ if not twiny and mode != "x":
+ self.set_ybound(new_ybound)
+ self.set_autoscaley_on(False)
+
+ def start_pan(self, x, y, button):
+ """
+ Called when a pan operation has started.
+
+ Parameters
+ ----------
+ x, y : float
+ The mouse coordinates in display coords.
+ button : `.MouseButton`
+ The pressed mouse button.
+
+ Notes
+ -----
+ This is intended to be overridden by new projection types.
+ """
+ self._pan_start = types.SimpleNamespace(
+ lim=self.viewLim.frozen(),
+ trans=self.transData.frozen(),
+ trans_inverse=self.transData.inverted().frozen(),
+ bbox=self.bbox.frozen(),
+ x=x,
+ y=y)
+
+ def end_pan(self):
+ """
+ Called when a pan operation completes (when the mouse button is up.)
+
+ Notes
+ -----
+ This is intended to be overridden by new projection types.
+ """
+ del self._pan_start
+
+ def _get_pan_points(self, button, key, x, y):
+ """
+ Helper function to return the new points after a pan.
+
+ This helper function returns the points on the axis after a pan has
+ occurred. This is a convenience method to abstract the pan logic
+ out of the base setter.
+ """
+ def format_deltas(key, dx, dy):
+ if key == 'control':
+ if abs(dx) > abs(dy):
+ dy = dx
+ else:
+ dx = dy
+ elif key == 'x':
+ dy = 0
+ elif key == 'y':
+ dx = 0
+ elif key == 'shift':
+ if 2 * abs(dx) < abs(dy):
+ dx = 0
+ elif 2 * abs(dy) < abs(dx):
+ dy = 0
+ elif abs(dx) > abs(dy):
+ dy = dy / abs(dy) * abs(dx)
+ else:
+ dx = dx / abs(dx) * abs(dy)
+ return dx, dy
+
+ p = self._pan_start
+ dx = x - p.x
+ dy = y - p.y
+ if dx == dy == 0:
+ return
+ if button == 1:
+ dx, dy = format_deltas(key, dx, dy)
+ result = p.bbox.translated(-dx, -dy).transformed(p.trans_inverse)
+ elif button == 3:
+ try:
+ dx = -dx / self.bbox.width
+ dy = -dy / self.bbox.height
+ dx, dy = format_deltas(key, dx, dy)
+ if self.get_aspect() != 'auto':
+ dx = dy = 0.5 * (dx + dy)
+ alpha = np.power(10.0, (dx, dy))
+ start = np.array([p.x, p.y])
+ oldpoints = p.lim.transformed(p.trans)
+ newpoints = start + alpha * (oldpoints - start)
+ result = (mtransforms.Bbox(newpoints)
+ .transformed(p.trans_inverse))
+ except OverflowError:
+ _api.warn_external('Overflow while panning')
+ return
+ else:
+ return
+
+ valid = np.isfinite(result.transformed(p.trans))
+ points = result.get_points().astype(object)
+ # Just ignore invalid limits (typically, underflow in log-scale).
+ points[~valid] = None
+ return points
+
+ def drag_pan(self, button, key, x, y):
+ """
+ Called when the mouse moves during a pan operation.
+
+ Parameters
+ ----------
+ button : `.MouseButton`
+ The pressed mouse button.
+ key : str or None
+ The pressed key, if any.
+ x, y : float
+ The mouse coordinates in display coords.
+
+ Notes
+ -----
+ This is intended to be overridden by new projection types.
+ """
+ points = self._get_pan_points(button, key, x, y)
+ if points is not None:
+ self.set_xlim(points[:, 0])
+ self.set_ylim(points[:, 1])
+
+ def get_children(self):
+ # docstring inherited.
+ return [
+ *self._children,
+ *self.spines.values(),
+ *self._axis_map.values(),
+ self.title, self._left_title, self._right_title,
+ *self.child_axes,
+ *([self.legend_] if self.legend_ is not None else []),
+ self.patch,
+ ]
+
+ def contains(self, mouseevent):
+ # docstring inherited.
+ return self.patch.contains(mouseevent)
+
+ def contains_point(self, point):
+ """
+ Return whether *point* (pair of pixel coordinates) is inside the Axes
+ patch.
+ """
+ return self.patch.contains_point(point, radius=1.0)
+
+ def get_default_bbox_extra_artists(self):
+ """
+ Return a default list of artists that are used for the bounding box
+ calculation.
+
+ Artists are excluded either by not being visible or
+ ``artist.set_in_layout(False)``.
+ """
+
+ artists = self.get_children()
+
+ for axis in self._axis_map.values():
+ # axis tight bboxes are calculated separately inside
+ # Axes.get_tightbbox() using for_layout_only=True
+ artists.remove(axis)
+ if not (self.axison and self._frameon):
+ # don't do bbox on spines if frame not on.
+ for spine in self.spines.values():
+ artists.remove(spine)
+
+ artists.remove(self.title)
+ artists.remove(self._left_title)
+ artists.remove(self._right_title)
+
+ # always include types that do not internally implement clipping
+ # to Axes. may have clip_on set to True and clip_box equivalent
+ # to ax.bbox but then ignore these properties during draws.
+ noclip = (_AxesBase, maxis.Axis,
+ offsetbox.AnnotationBbox, offsetbox.OffsetBox)
+ return [a for a in artists if a.get_visible() and a.get_in_layout()
+ and (isinstance(a, noclip) or not a._fully_clipped_to_axes())]
+
+ def get_tightbbox(self, renderer=None, *, call_axes_locator=True,
+ bbox_extra_artists=None, for_layout_only=False):
+ """
+ Return the tight bounding box of the Axes, including axis and their
+ decorators (xlabel, title, etc).
+
+ Artists that have ``artist.set_in_layout(False)`` are not included
+ in the bbox.
+
+ Parameters
+ ----------
+ renderer : `.RendererBase` subclass
+ renderer that will be used to draw the figures (i.e.
+ ``fig.canvas.get_renderer()``)
+
+ bbox_extra_artists : list of `.Artist` or ``None``
+ List of artists to include in the tight bounding box. If
+ ``None`` (default), then all artist children of the Axes are
+ included in the tight bounding box.
+
+ call_axes_locator : bool, default: True
+ If *call_axes_locator* is ``False``, it does not call the
+ ``_axes_locator`` attribute, which is necessary to get the correct
+ bounding box. ``call_axes_locator=False`` can be used if the
+ caller is only interested in the relative size of the tightbbox
+ compared to the Axes bbox.
+
+ for_layout_only : default: False
+ The bounding box will *not* include the x-extent of the title and
+ the xlabel, or the y-extent of the ylabel.
+
+ Returns
+ -------
+ `.BboxBase`
+ Bounding box in figure pixel coordinates.
+
+ See Also
+ --------
+ matplotlib.axes.Axes.get_window_extent
+ matplotlib.axis.Axis.get_tightbbox
+ matplotlib.spines.Spine.get_window_extent
+ """
+
+ bb = []
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+
+ if not self.get_visible():
+ return None
+
+ locator = self.get_axes_locator()
+ self.apply_aspect(
+ locator(self, renderer) if locator and call_axes_locator else None)
+
+ for axis in self._axis_map.values():
+ if self.axison and axis.get_visible():
+ ba = martist._get_tightbbox_for_layout_only(axis, renderer)
+ if ba:
+ bb.append(ba)
+ self._update_title_position(renderer)
+ axbbox = self.get_window_extent(renderer)
+ bb.append(axbbox)
+
+ for title in [self.title, self._left_title, self._right_title]:
+ if title.get_visible():
+ bt = title.get_window_extent(renderer)
+ if for_layout_only and bt.width > 0:
+ # make the title bbox 1 pixel wide so its width
+ # is not accounted for in bbox calculations in
+ # tight/constrained_layout
+ bt.x0 = (bt.x0 + bt.x1) / 2 - 0.5
+ bt.x1 = bt.x0 + 1.0
+ bb.append(bt)
+
+ bbox_artists = bbox_extra_artists
+ if bbox_artists is None:
+ bbox_artists = self.get_default_bbox_extra_artists()
+
+ for a in bbox_artists:
+ bbox = a.get_tightbbox(renderer)
+ if (bbox is not None
+ and 0 < bbox.width < np.inf
+ and 0 < bbox.height < np.inf):
+ bb.append(bbox)
+ return mtransforms.Bbox.union(
+ [b for b in bb if b.width != 0 or b.height != 0])
+
+ def _make_twin_axes(self, *args, **kwargs):
+ """Make a twinx Axes of self. This is used for twinx and twiny."""
+ if 'sharex' in kwargs and 'sharey' in kwargs:
+ # The following line is added in v2.2 to avoid breaking Seaborn,
+ # which currently uses this internal API.
+ if kwargs["sharex"] is not self and kwargs["sharey"] is not self:
+ raise ValueError("Twinned Axes may share only one axis")
+ ss = self.get_subplotspec()
+ if ss:
+ twin = self.get_figure(root=False).add_subplot(ss, *args, **kwargs)
+ else:
+ twin = self.get_figure(root=False).add_axes(
+ self.get_position(True), *args, **kwargs,
+ axes_locator=_TransformedBoundsLocator(
+ [0, 0, 1, 1], self.transAxes))
+ self.set_adjustable('datalim')
+ twin.set_adjustable('datalim')
+ twin.set_zorder(self.zorder)
+
+ self._twinned_axes.join(self, twin)
+ return twin
+
+ def twinx(self):
+ """
+ Create a twin Axes sharing the xaxis.
+
+ Create a new Axes with an invisible x-axis and an independent
+ y-axis positioned opposite to the original one (i.e. at right). The
+ x-axis autoscale setting will be inherited from the original
+ Axes. To ensure that the tick marks of both y-axes align, see
+ `~matplotlib.ticker.LinearLocator`.
+
+ Returns
+ -------
+ Axes
+ The newly created Axes instance
+
+ Notes
+ -----
+ For those who are 'picking' artists while using twinx, pick
+ events are only called for the artists in the top-most Axes.
+ """
+ ax2 = self._make_twin_axes(sharex=self)
+ ax2.yaxis.tick_right()
+ ax2.yaxis.set_label_position('right')
+ ax2.yaxis.set_offset_position('right')
+ ax2.set_autoscalex_on(self.get_autoscalex_on())
+ self.yaxis.tick_left()
+ ax2.xaxis.set_visible(False)
+ ax2.patch.set_visible(False)
+ ax2.xaxis.units = self.xaxis.units
+ return ax2
+
+ def twiny(self):
+ """
+ Create a twin Axes sharing the yaxis.
+
+ Create a new Axes with an invisible y-axis and an independent
+ x-axis positioned opposite to the original one (i.e. at top). The
+ y-axis autoscale setting will be inherited from the original Axes.
+ To ensure that the tick marks of both x-axes align, see
+ `~matplotlib.ticker.LinearLocator`.
+
+ Returns
+ -------
+ Axes
+ The newly created Axes instance
+
+ Notes
+ -----
+ For those who are 'picking' artists while using twiny, pick
+ events are only called for the artists in the top-most Axes.
+ """
+ ax2 = self._make_twin_axes(sharey=self)
+ ax2.xaxis.tick_top()
+ ax2.xaxis.set_label_position('top')
+ ax2.set_autoscaley_on(self.get_autoscaley_on())
+ self.xaxis.tick_bottom()
+ ax2.yaxis.set_visible(False)
+ ax2.patch.set_visible(False)
+ ax2.yaxis.units = self.yaxis.units
+ return ax2
+
+ def get_shared_x_axes(self):
+ """Return an immutable view on the shared x-axes Grouper."""
+ return cbook.GrouperView(self._shared_axes["x"])
+
+ def get_shared_y_axes(self):
+ """Return an immutable view on the shared y-axes Grouper."""
+ return cbook.GrouperView(self._shared_axes["y"])
+
+ def label_outer(self, remove_inner_ticks=False):
+ """
+ Only show "outer" labels and tick labels.
+
+ x-labels are only kept for subplots on the last row (or first row, if
+ labels are on the top side); y-labels only for subplots on the first
+ column (or last column, if labels are on the right side).
+
+ Parameters
+ ----------
+ remove_inner_ticks : bool, default: False
+ If True, remove the inner ticks as well (not only tick labels).
+
+ .. versionadded:: 3.8
+ """
+ self._label_outer_xaxis(skip_non_rectangular_axes=False,
+ remove_inner_ticks=remove_inner_ticks)
+ self._label_outer_yaxis(skip_non_rectangular_axes=False,
+ remove_inner_ticks=remove_inner_ticks)
+
+ def _label_outer_xaxis(self, *, skip_non_rectangular_axes,
+ remove_inner_ticks=False):
+ # see documentation in label_outer.
+ if skip_non_rectangular_axes and not isinstance(self.patch,
+ mpl.patches.Rectangle):
+ return
+ ss = self.get_subplotspec()
+ if not ss:
+ return
+ label_position = self.xaxis.get_label_position()
+ if not ss.is_first_row(): # Remove top label/ticklabels/offsettext.
+ if label_position == "top":
+ self.set_xlabel("")
+ top_kw = {'top': False} if remove_inner_ticks else {}
+ self.xaxis.set_tick_params(
+ which="both", labeltop=False, **top_kw)
+ if self.xaxis.offsetText.get_position()[1] == 1:
+ self.xaxis.offsetText.set_visible(False)
+ if not ss.is_last_row(): # Remove bottom label/ticklabels/offsettext.
+ if label_position == "bottom":
+ self.set_xlabel("")
+ bottom_kw = {'bottom': False} if remove_inner_ticks else {}
+ self.xaxis.set_tick_params(
+ which="both", labelbottom=False, **bottom_kw)
+ if self.xaxis.offsetText.get_position()[1] == 0:
+ self.xaxis.offsetText.set_visible(False)
+
+ def _label_outer_yaxis(self, *, skip_non_rectangular_axes,
+ remove_inner_ticks=False):
+ # see documentation in label_outer.
+ if skip_non_rectangular_axes and not isinstance(self.patch,
+ mpl.patches.Rectangle):
+ return
+ ss = self.get_subplotspec()
+ if not ss:
+ return
+ label_position = self.yaxis.get_label_position()
+ if not ss.is_first_col(): # Remove left label/ticklabels/offsettext.
+ if label_position == "left":
+ self.set_ylabel("")
+ left_kw = {'left': False} if remove_inner_ticks else {}
+ self.yaxis.set_tick_params(
+ which="both", labelleft=False, **left_kw)
+ if self.yaxis.offsetText.get_position()[0] == 0:
+ self.yaxis.offsetText.set_visible(False)
+ if not ss.is_last_col(): # Remove right label/ticklabels/offsettext.
+ if label_position == "right":
+ self.set_ylabel("")
+ right_kw = {'right': False} if remove_inner_ticks else {}
+ self.yaxis.set_tick_params(
+ which="both", labelright=False, **right_kw)
+ if self.yaxis.offsetText.get_position()[0] == 1:
+ self.yaxis.offsetText.set_visible(False)
+
+ def set_forward_navigation_events(self, forward):
+ """
+ Set how pan/zoom events are forwarded to Axes below this one.
+
+ Parameters
+ ----------
+ forward : bool or "auto"
+ Possible values:
+
+ - True: Forward events to other axes with lower or equal zorder.
+ - False: Events are only executed on this axes.
+ - "auto": Default behaviour (*True* for axes with an invisible
+ patch and *False* otherwise)
+
+ See Also
+ --------
+ matplotlib.axes.Axes.set_navigate
+
+ """
+ self._forward_navigation_events = forward
+
+ def get_forward_navigation_events(self):
+ """Get how pan/zoom events are forwarded to Axes below this one."""
+ return self._forward_navigation_events
+
+
+def _draw_rasterized(figure, artists, renderer):
+ """
+ A helper function for rasterizing the list of artists.
+
+ The bookkeeping to track if we are or are not in rasterizing mode
+ with the mixed-mode backends is relatively complicated and is now
+ handled in the matplotlib.artist.allow_rasterization decorator.
+
+ This helper defines the absolute minimum methods and attributes on a
+ shim class to be compatible with that decorator and then uses it to
+ rasterize the list of artists.
+
+ This is maybe too-clever, but allows us to reuse the same code that is
+ used on normal artists to participate in the "are we rasterizing"
+ accounting.
+
+ Please do not use this outside of the "rasterize below a given zorder"
+ functionality of Axes.
+
+ Parameters
+ ----------
+ figure : matplotlib.figure.Figure
+ The figure all of the artists belong to (not checked). We need this
+ because we can at the figure level suppress composition and insert each
+ rasterized artist as its own image.
+
+ artists : List[matplotlib.artist.Artist]
+ The list of Artists to be rasterized. These are assumed to all
+ be in the same Figure.
+
+ renderer : matplotlib.backendbases.RendererBase
+ The currently active renderer
+
+ Returns
+ -------
+ None
+
+ """
+ class _MinimalArtist:
+ def get_rasterized(self):
+ return True
+
+ def get_agg_filter(self):
+ return None
+
+ def __init__(self, figure, artists):
+ self.figure = figure
+ self.artists = artists
+
+ def get_figure(self, root=False):
+ if root:
+ return self.figure.get_figure(root=True)
+ else:
+ return self.figure
+
+ @martist.allow_rasterization
+ def draw(self, renderer):
+ for a in self.artists:
+ a.draw(renderer)
+
+ return _MinimalArtist(figure, artists).draw(renderer)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_base.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_base.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..df82ad7ec4a5aa2459ccc81d46afceacfeb86951
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_base.pyi
@@ -0,0 +1,459 @@
+import matplotlib.artist as martist
+
+import datetime
+from collections.abc import Callable, Iterable, Iterator, Sequence
+from matplotlib import cbook
+from matplotlib.artist import Artist
+from matplotlib.axes import Axes
+from matplotlib.axis import XAxis, YAxis, Tick
+from matplotlib.backend_bases import RendererBase, MouseButton, MouseEvent
+from matplotlib.cbook import CallbackRegistry
+from matplotlib.container import Container
+from matplotlib.collections import Collection
+from matplotlib.colorizer import ColorizingArtist
+from matplotlib.legend import Legend
+from matplotlib.lines import Line2D
+from matplotlib.gridspec import SubplotSpec, GridSpec
+from matplotlib.figure import Figure, SubFigure
+from matplotlib.image import AxesImage
+from matplotlib.patches import Patch
+from matplotlib.scale import ScaleBase
+from matplotlib.spines import Spines
+from matplotlib.table import Table
+from matplotlib.text import Text
+from matplotlib.transforms import Transform, Bbox
+
+from cycler import Cycler
+
+import numpy as np
+from numpy.typing import ArrayLike
+from typing import Any, Literal, TypeVar, overload
+from matplotlib.typing import ColorType
+
+_T = TypeVar("_T", bound=Artist)
+
+class _axis_method_wrapper:
+ attr_name: str
+ method_name: str
+ __doc__: str
+ def __init__(
+ self, attr_name: str, method_name: str, *, doc_sub: dict[str, str] | None = ...
+ ) -> None: ...
+ def __set_name__(self, owner: Any, name: str) -> None: ...
+
+class _AxesBase(martist.Artist):
+ name: str
+ patch: Patch
+ spines: Spines
+ fmt_xdata: Callable[[float], str] | None
+ fmt_ydata: Callable[[float], str] | None
+ xaxis: XAxis
+ yaxis: YAxis
+ bbox: Bbox
+ dataLim: Bbox
+ transAxes: Transform
+ transScale: Transform
+ transLimits: Transform
+ transData: Transform
+ ignore_existing_data_limits: bool
+ axison: bool
+ containers: list[Container]
+ callbacks: CallbackRegistry
+ child_axes: list[_AxesBase]
+ legend_: Legend | None
+ title: Text
+ _projection_init: Any
+
+ def __init__(
+ self,
+ fig: Figure,
+ *args: tuple[float, float, float, float] | Bbox | int,
+ facecolor: ColorType | None = ...,
+ frameon: bool = ...,
+ sharex: _AxesBase | None = ...,
+ sharey: _AxesBase | None = ...,
+ label: Any = ...,
+ xscale: str | ScaleBase | None = ...,
+ yscale: str | ScaleBase | None = ...,
+ box_aspect: float | None = ...,
+ forward_navigation_events: bool | Literal["auto"] = ...,
+ **kwargs
+ ) -> None: ...
+ def get_subplotspec(self) -> SubplotSpec | None: ...
+ def set_subplotspec(self, subplotspec: SubplotSpec) -> None: ...
+ def get_gridspec(self) -> GridSpec | None: ...
+ def set_figure(self, fig: Figure | SubFigure) -> None: ...
+ @property
+ def viewLim(self) -> Bbox: ...
+ def get_xaxis_transform(
+ self, which: Literal["grid", "tick1", "tick2"] = ...
+ ) -> Transform: ...
+ def get_xaxis_text1_transform(
+ self, pad_points: float
+ ) -> tuple[
+ Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_xaxis_text2_transform(
+ self, pad_points
+ ) -> tuple[
+ Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_yaxis_transform(
+ self, which: Literal["grid", "tick1", "tick2"] = ...
+ ) -> Transform: ...
+ def get_yaxis_text1_transform(
+ self, pad_points
+ ) -> tuple[
+ Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_yaxis_text2_transform(
+ self, pad_points
+ ) -> tuple[
+ Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_position(self, original: bool = ...) -> Bbox: ...
+ def set_position(
+ self,
+ pos: Bbox | tuple[float, float, float, float],
+ which: Literal["both", "active", "original"] = ...,
+ ) -> None: ...
+ def reset_position(self) -> None: ...
+ def set_axes_locator(
+ self, locator: Callable[[_AxesBase, RendererBase], Bbox]
+ ) -> None: ...
+ def get_axes_locator(self) -> Callable[[_AxesBase, RendererBase], Bbox]: ...
+ def sharex(self, other: _AxesBase) -> None: ...
+ def sharey(self, other: _AxesBase) -> None: ...
+ def clear(self) -> None: ...
+ def cla(self) -> None: ...
+
+ class ArtistList(Sequence[_T]):
+ def __init__(
+ self,
+ axes: _AxesBase,
+ prop_name: str,
+ valid_types: type | Iterable[type] | None = ...,
+ invalid_types: type | Iterable[type] | None = ...,
+ ) -> None: ...
+ def __len__(self) -> int: ...
+ def __iter__(self) -> Iterator[_T]: ...
+ @overload
+ def __getitem__(self, key: int) -> _T: ...
+ @overload
+ def __getitem__(self, key: slice) -> list[_T]: ...
+
+ @overload
+ def __add__(self, other: _AxesBase.ArtistList[_T]) -> list[_T]: ...
+ @overload
+ def __add__(self, other: list[Any]) -> list[Any]: ...
+ @overload
+ def __add__(self, other: tuple[Any]) -> tuple[Any]: ...
+
+ @overload
+ def __radd__(self, other: _AxesBase.ArtistList[_T]) -> list[_T]: ...
+ @overload
+ def __radd__(self, other: list[Any]) -> list[Any]: ...
+ @overload
+ def __radd__(self, other: tuple[Any]) -> tuple[Any]: ...
+
+ @property
+ def artists(self) -> _AxesBase.ArtistList[Artist]: ...
+ @property
+ def collections(self) -> _AxesBase.ArtistList[Collection]: ...
+ @property
+ def images(self) -> _AxesBase.ArtistList[AxesImage]: ...
+ @property
+ def lines(self) -> _AxesBase.ArtistList[Line2D]: ...
+ @property
+ def patches(self) -> _AxesBase.ArtistList[Patch]: ...
+ @property
+ def tables(self) -> _AxesBase.ArtistList[Table]: ...
+ @property
+ def texts(self) -> _AxesBase.ArtistList[Text]: ...
+ def get_facecolor(self) -> ColorType: ...
+ def set_facecolor(self, color: ColorType | None) -> None: ...
+ @overload
+ def set_prop_cycle(self, cycler: Cycler | None) -> None: ...
+ @overload
+ def set_prop_cycle(self, label: str, values: Iterable[Any]) -> None: ...
+ @overload
+ def set_prop_cycle(self, **kwargs: Iterable[Any]) -> None: ...
+ def get_aspect(self) -> float | Literal["auto"]: ...
+ def set_aspect(
+ self,
+ aspect: float | Literal["auto", "equal"],
+ adjustable: Literal["box", "datalim"] | None = ...,
+ anchor: str | tuple[float, float] | None = ...,
+ share: bool = ...,
+ ) -> None: ...
+ def get_adjustable(self) -> Literal["box", "datalim"]: ...
+ def set_adjustable(
+ self, adjustable: Literal["box", "datalim"], share: bool = ...
+ ) -> None: ...
+ def get_box_aspect(self) -> float | None: ...
+ def set_box_aspect(self, aspect: float | None = ...) -> None: ...
+ def get_anchor(self) -> str | tuple[float, float]: ...
+ def set_anchor(
+ self, anchor: str | tuple[float, float], share: bool = ...
+ ) -> None: ...
+ def get_data_ratio(self) -> float: ...
+ def apply_aspect(self, position: Bbox | None = ...) -> None: ...
+ @overload
+ def axis(
+ self,
+ arg: tuple[float, float, float, float] | bool | str | None = ...,
+ /,
+ *,
+ emit: bool = ...
+ ) -> tuple[float, float, float, float]: ...
+ @overload
+ def axis(
+ self,
+ *,
+ emit: bool = ...,
+ xmin: float | None = ...,
+ xmax: float | None = ...,
+ ymin: float | None = ...,
+ ymax: float | None = ...
+ ) -> tuple[float, float, float, float]: ...
+ def get_legend(self) -> Legend: ...
+ def get_images(self) -> list[AxesImage]: ...
+ def get_lines(self) -> list[Line2D]: ...
+ def get_xaxis(self) -> XAxis: ...
+ def get_yaxis(self) -> YAxis: ...
+ def has_data(self) -> bool: ...
+ def add_artist(self, a: Artist) -> Artist: ...
+ def add_child_axes(self, ax: _AxesBase) -> _AxesBase: ...
+ def add_collection(
+ self, collection: Collection, autolim: bool = ...
+ ) -> Collection: ...
+ def add_image(self, image: AxesImage) -> AxesImage: ...
+ def add_line(self, line: Line2D) -> Line2D: ...
+ def add_patch(self, p: Patch) -> Patch: ...
+ def add_table(self, tab: Table) -> Table: ...
+ def add_container(self, container: Container) -> Container: ...
+ def relim(self, visible_only: bool = ...) -> None: ...
+ def update_datalim(
+ self, xys: ArrayLike, updatex: bool = ..., updatey: bool = ...
+ ) -> None: ...
+ def in_axes(self, mouseevent: MouseEvent) -> bool: ...
+ def get_autoscale_on(self) -> bool: ...
+ def set_autoscale_on(self, b: bool) -> None: ...
+ @property
+ def use_sticky_edges(self) -> bool: ...
+ @use_sticky_edges.setter
+ def use_sticky_edges(self, b: bool) -> None: ...
+ def get_xmargin(self) -> float: ...
+ def get_ymargin(self) -> float: ...
+ def set_xmargin(self, m: float) -> None: ...
+ def set_ymargin(self, m: float) -> None: ...
+
+ # Probably could be made better with overloads
+ def margins(
+ self,
+ *margins: float,
+ x: float | None = ...,
+ y: float | None = ...,
+ tight: bool | None = ...
+ ) -> tuple[float, float] | None: ...
+ def set_rasterization_zorder(self, z: float | None) -> None: ...
+ def get_rasterization_zorder(self) -> float | None: ...
+ def autoscale(
+ self,
+ enable: bool = ...,
+ axis: Literal["both", "x", "y"] = ...,
+ tight: bool | None = ...,
+ ) -> None: ...
+ def autoscale_view(
+ self, tight: bool | None = ..., scalex: bool = ..., scaley: bool = ...
+ ) -> None: ...
+ def draw_artist(self, a: Artist) -> None: ...
+ def redraw_in_frame(self) -> None: ...
+ def get_frame_on(self) -> bool: ...
+ def set_frame_on(self, b: bool) -> None: ...
+ def get_axisbelow(self) -> bool | Literal["line"]: ...
+ def set_axisbelow(self, b: bool | Literal["line"]) -> None: ...
+ def grid(
+ self,
+ visible: bool | None = ...,
+ which: Literal["major", "minor", "both"] = ...,
+ axis: Literal["both", "x", "y"] = ...,
+ **kwargs
+ ) -> None: ...
+ def ticklabel_format(
+ self,
+ *,
+ axis: Literal["both", "x", "y"] = ...,
+ style: Literal["", "sci", "scientific", "plain"] | None = ...,
+ scilimits: tuple[int, int] | None = ...,
+ useOffset: bool | float | None = ...,
+ useLocale: bool | None = ...,
+ useMathText: bool | None = ...
+ ) -> None: ...
+ def locator_params(
+ self, axis: Literal["both", "x", "y"] = ..., tight: bool | None = ..., **kwargs
+ ) -> None: ...
+ def tick_params(self, axis: Literal["both", "x", "y"] = ..., **kwargs) -> None: ...
+ def set_axis_off(self) -> None: ...
+ def set_axis_on(self) -> None: ...
+ def get_xlabel(self) -> str: ...
+ def set_xlabel(
+ self,
+ xlabel: str,
+ fontdict: dict[str, Any] | None = ...,
+ labelpad: float | None = ...,
+ *,
+ loc: Literal["left", "center", "right"] | None = ...,
+ **kwargs
+ ) -> Text: ...
+ def invert_xaxis(self) -> None: ...
+ def get_xbound(self) -> tuple[float, float]: ...
+ def set_xbound(
+ self, lower: float | None = ..., upper: float | None = ...
+ ) -> None: ...
+ def get_xlim(self) -> tuple[float, float]: ...
+ def set_xlim(
+ self,
+ left: float | tuple[float, float] | None = ...,
+ right: float | None = ...,
+ *,
+ emit: bool = ...,
+ auto: bool | None = ...,
+ xmin: float | None = ...,
+ xmax: float | None = ...
+ ) -> tuple[float, float]: ...
+ def get_ylabel(self) -> str: ...
+ def set_ylabel(
+ self,
+ ylabel: str,
+ fontdict: dict[str, Any] | None = ...,
+ labelpad: float | None = ...,
+ *,
+ loc: Literal["bottom", "center", "top"] | None = ...,
+ **kwargs
+ ) -> Text: ...
+ def invert_yaxis(self) -> None: ...
+ def get_ybound(self) -> tuple[float, float]: ...
+ def set_ybound(
+ self, lower: float | None = ..., upper: float | None = ...
+ ) -> None: ...
+ def get_ylim(self) -> tuple[float, float]: ...
+ def set_ylim(
+ self,
+ bottom: float | tuple[float, float] | None = ...,
+ top: float | None = ...,
+ *,
+ emit: bool = ...,
+ auto: bool | None = ...,
+ ymin: float | None = ...,
+ ymax: float | None = ...
+ ) -> tuple[float, float]: ...
+ def format_xdata(self, x: float) -> str: ...
+ def format_ydata(self, y: float) -> str: ...
+ def format_coord(self, x: float, y: float) -> str: ...
+ def minorticks_on(self) -> None: ...
+ def minorticks_off(self) -> None: ...
+ def can_zoom(self) -> bool: ...
+ def can_pan(self) -> bool: ...
+ def get_navigate(self) -> bool: ...
+ def set_navigate(self, b: bool) -> None: ...
+ def get_forward_navigation_events(self) -> bool | Literal["auto"]: ...
+ def set_forward_navigation_events(self, forward: bool | Literal["auto"]) -> None: ...
+ def get_navigate_mode(self) -> Literal["PAN", "ZOOM"] | None: ...
+ def set_navigate_mode(self, b: Literal["PAN", "ZOOM"] | None) -> None: ...
+ def start_pan(self, x: float, y: float, button: MouseButton) -> None: ...
+ def end_pan(self) -> None: ...
+ def drag_pan(
+ self, button: MouseButton, key: str | None, x: float, y: float
+ ) -> None: ...
+ def get_children(self) -> list[Artist]: ...
+ def contains_point(self, point: tuple[int, int]) -> bool: ...
+ def get_default_bbox_extra_artists(self) -> list[Artist]: ...
+ def get_tightbbox(
+ self,
+ renderer: RendererBase | None = ...,
+ *,
+ call_axes_locator: bool = ...,
+ bbox_extra_artists: Sequence[Artist] | None = ...,
+ for_layout_only: bool = ...
+ ) -> Bbox | None: ...
+ def twinx(self) -> Axes: ...
+ def twiny(self) -> Axes: ...
+ def get_shared_x_axes(self) -> cbook.GrouperView: ...
+ def get_shared_y_axes(self) -> cbook.GrouperView: ...
+ def label_outer(self, remove_inner_ticks: bool = ...) -> None: ...
+
+ # The methods underneath this line are added via the `_axis_method_wrapper` class
+ # Initially they are set to an object, but that object uses `__set_name__` to override
+ # itself with a method modified from the Axis methods for the x or y Axis.
+ # As such, they are typed according to the resultant method rather than as that object.
+
+ def get_xgridlines(self) -> list[Line2D]: ...
+ def get_xticklines(self, minor: bool = ...) -> list[Line2D]: ...
+ def get_ygridlines(self) -> list[Line2D]: ...
+ def get_yticklines(self, minor: bool = ...) -> list[Line2D]: ...
+ def _sci(self, im: ColorizingArtist) -> None: ...
+ def get_autoscalex_on(self) -> bool: ...
+ def get_autoscaley_on(self) -> bool: ...
+ def set_autoscalex_on(self, b: bool) -> None: ...
+ def set_autoscaley_on(self, b: bool) -> None: ...
+ def xaxis_inverted(self) -> bool: ...
+ def get_xscale(self) -> str: ...
+ def set_xscale(self, value: str | ScaleBase, **kwargs) -> None: ...
+ def get_xticks(self, *, minor: bool = ...) -> np.ndarray: ...
+ def set_xticks(
+ self,
+ ticks: ArrayLike,
+ labels: Iterable[str] | None = ...,
+ *,
+ minor: bool = ...,
+ **kwargs
+ ) -> list[Tick]: ...
+ def get_xmajorticklabels(self) -> list[Text]: ...
+ def get_xminorticklabels(self) -> list[Text]: ...
+ def get_xticklabels(
+ self, minor: bool = ..., which: Literal["major", "minor", "both"] | None = ...
+ ) -> list[Text]: ...
+ def set_xticklabels(
+ self,
+ labels: Iterable[str | Text],
+ *,
+ minor: bool = ...,
+ fontdict: dict[str, Any] | None = ...,
+ **kwargs
+ ) -> list[Text]: ...
+ def yaxis_inverted(self) -> bool: ...
+ def get_yscale(self) -> str: ...
+ def set_yscale(self, value: str | ScaleBase, **kwargs) -> None: ...
+ def get_yticks(self, *, minor: bool = ...) -> np.ndarray: ...
+ def set_yticks(
+ self,
+ ticks: ArrayLike,
+ labels: Iterable[str] | None = ...,
+ *,
+ minor: bool = ...,
+ **kwargs
+ ) -> list[Tick]: ...
+ def get_ymajorticklabels(self) -> list[Text]: ...
+ def get_yminorticklabels(self) -> list[Text]: ...
+ def get_yticklabels(
+ self, minor: bool = ..., which: Literal["major", "minor", "both"] | None = ...
+ ) -> list[Text]: ...
+ def set_yticklabels(
+ self,
+ labels: Iterable[str | Text],
+ *,
+ minor: bool = ...,
+ fontdict: dict[str, Any] | None = ...,
+ **kwargs
+ ) -> list[Text]: ...
+ def xaxis_date(self, tz: str | datetime.tzinfo | None = ...) -> None: ...
+ def yaxis_date(self, tz: str | datetime.tzinfo | None = ...) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_secondary_axes.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_secondary_axes.py
new file mode 100644
index 0000000000000000000000000000000000000000..15a1970fa4a6e7762da98b58c6c5317e0ede7ec1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_secondary_axes.py
@@ -0,0 +1,322 @@
+import numbers
+
+import numpy as np
+
+from matplotlib import _api, _docstring, transforms
+import matplotlib.ticker as mticker
+from matplotlib.axes._base import _AxesBase, _TransformedBoundsLocator
+from matplotlib.axis import Axis
+from matplotlib.transforms import Transform
+
+
+class SecondaryAxis(_AxesBase):
+ """
+ General class to hold a Secondary_X/Yaxis.
+ """
+
+ def __init__(self, parent, orientation, location, functions, transform=None,
+ **kwargs):
+ """
+ See `.secondary_xaxis` and `.secondary_yaxis` for the doc string.
+ While there is no need for this to be private, it should really be
+ called by those higher level functions.
+ """
+ _api.check_in_list(["x", "y"], orientation=orientation)
+ self._functions = functions
+ self._parent = parent
+ self._orientation = orientation
+ self._ticks_set = False
+
+ fig = self._parent.get_figure(root=False)
+ if self._orientation == 'x':
+ super().__init__(fig, [0, 1., 1, 0.0001], **kwargs)
+ self._axis = self.xaxis
+ self._locstrings = ['top', 'bottom']
+ self._otherstrings = ['left', 'right']
+ else: # 'y'
+ super().__init__(fig, [0, 1., 0.0001, 1], **kwargs)
+ self._axis = self.yaxis
+ self._locstrings = ['right', 'left']
+ self._otherstrings = ['top', 'bottom']
+ self._parentscale = None
+ # this gets positioned w/o constrained_layout so exclude:
+
+ self.set_location(location, transform)
+ self.set_functions(functions)
+
+ # styling:
+ otheraxis = self.yaxis if self._orientation == 'x' else self.xaxis
+ otheraxis.set_major_locator(mticker.NullLocator())
+ otheraxis.set_ticks_position('none')
+
+ self.spines[self._otherstrings].set_visible(False)
+ self.spines[self._locstrings].set_visible(True)
+
+ if self._pos < 0.5:
+ # flip the location strings...
+ self._locstrings = self._locstrings[::-1]
+ self.set_alignment(self._locstrings[0])
+
+ def set_alignment(self, align):
+ """
+ Set if axes spine and labels are drawn at top or bottom (or left/right)
+ of the Axes.
+
+ Parameters
+ ----------
+ align : {'top', 'bottom', 'left', 'right'}
+ Either 'top' or 'bottom' for orientation='x' or
+ 'left' or 'right' for orientation='y' axis.
+ """
+ _api.check_in_list(self._locstrings, align=align)
+ if align == self._locstrings[1]: # Need to change the orientation.
+ self._locstrings = self._locstrings[::-1]
+ self.spines[self._locstrings[0]].set_visible(True)
+ self.spines[self._locstrings[1]].set_visible(False)
+ self._axis.set_ticks_position(align)
+ self._axis.set_label_position(align)
+
+ def set_location(self, location, transform=None):
+ """
+ Set the vertical or horizontal location of the axes in
+ parent-normalized coordinates.
+
+ Parameters
+ ----------
+ location : {'top', 'bottom', 'left', 'right'} or float
+ The position to put the secondary axis. Strings can be 'top' or
+ 'bottom' for orientation='x' and 'right' or 'left' for
+ orientation='y'. A float indicates the relative position on the
+ parent Axes to put the new Axes, 0.0 being the bottom (or left)
+ and 1.0 being the top (or right).
+
+ transform : `.Transform`, optional
+ Transform for the location to use. Defaults to
+ the parent's ``transAxes``, so locations are normally relative to
+ the parent axes.
+
+ .. versionadded:: 3.9
+ """
+
+ _api.check_isinstance((transforms.Transform, None), transform=transform)
+
+ # This puts the rectangle into figure-relative coordinates.
+ if isinstance(location, str):
+ _api.check_in_list(self._locstrings, location=location)
+ self._pos = 1. if location in ('top', 'right') else 0.
+ elif isinstance(location, numbers.Real):
+ self._pos = location
+ else:
+ raise ValueError(
+ f"location must be {self._locstrings[0]!r}, "
+ f"{self._locstrings[1]!r}, or a float, not {location!r}")
+
+ self._loc = location
+
+ if self._orientation == 'x':
+ # An x-secondary axes is like an inset axes from x = 0 to x = 1 and
+ # from y = pos to y = pos + eps, in the parent's transAxes coords.
+ bounds = [0, self._pos, 1., 1e-10]
+
+ # If a transformation is provided, use its y component rather than
+ # the parent's transAxes. This can be used to place axes in the data
+ # coords, for instance.
+ if transform is not None:
+ transform = transforms.blended_transform_factory(
+ self._parent.transAxes, transform)
+ else: # 'y'
+ bounds = [self._pos, 0, 1e-10, 1]
+ if transform is not None:
+ transform = transforms.blended_transform_factory(
+ transform, self._parent.transAxes) # Use provided x axis
+
+ # If no transform is provided, use the parent's transAxes
+ if transform is None:
+ transform = self._parent.transAxes
+
+ # this locator lets the axes move in the parent axes coordinates.
+ # so it never needs to know where the parent is explicitly in
+ # figure coordinates.
+ # it gets called in ax.apply_aspect() (of all places)
+ self.set_axes_locator(_TransformedBoundsLocator(bounds, transform))
+
+ def apply_aspect(self, position=None):
+ # docstring inherited.
+ self._set_lims()
+ super().apply_aspect(position)
+
+ @_docstring.copy(Axis.set_ticks)
+ def set_ticks(self, ticks, labels=None, *, minor=False, **kwargs):
+ ret = self._axis.set_ticks(ticks, labels, minor=minor, **kwargs)
+ self.stale = True
+ self._ticks_set = True
+ return ret
+
+ def set_functions(self, functions):
+ """
+ Set how the secondary axis converts limits from the parent Axes.
+
+ Parameters
+ ----------
+ functions : 2-tuple of func, or `Transform` with an inverse.
+ Transform between the parent axis values and the secondary axis
+ values.
+
+ If supplied as a 2-tuple of functions, the first function is
+ the forward transform function and the second is the inverse
+ transform.
+
+ If a transform is supplied, then the transform must have an
+ inverse.
+ """
+
+ if (isinstance(functions, tuple) and len(functions) == 2 and
+ callable(functions[0]) and callable(functions[1])):
+ # make an arbitrary convert from a two-tuple of functions
+ # forward and inverse.
+ self._functions = functions
+ elif isinstance(functions, Transform):
+ self._functions = (
+ functions.transform,
+ lambda x: functions.inverted().transform(x)
+ )
+ elif functions is None:
+ self._functions = (lambda x: x, lambda x: x)
+ else:
+ raise ValueError('functions argument of secondary Axes '
+ 'must be a two-tuple of callable functions '
+ 'with the first function being the transform '
+ 'and the second being the inverse')
+ self._set_scale()
+
+ def draw(self, renderer):
+ """
+ Draw the secondary Axes.
+
+ Consults the parent Axes for its limits and converts them
+ using the converter specified by
+ `~.axes._secondary_axes.set_functions` (or *functions*
+ parameter when Axes initialized.)
+ """
+ self._set_lims()
+ # this sets the scale in case the parent has set its scale.
+ self._set_scale()
+ super().draw(renderer)
+
+ def _set_scale(self):
+ """
+ Check if parent has set its scale
+ """
+
+ if self._orientation == 'x':
+ pscale = self._parent.xaxis.get_scale()
+ set_scale = self.set_xscale
+ else: # 'y'
+ pscale = self._parent.yaxis.get_scale()
+ set_scale = self.set_yscale
+ if pscale == self._parentscale:
+ return
+
+ if self._ticks_set:
+ ticks = self._axis.get_ticklocs()
+
+ # need to invert the roles here for the ticks to line up.
+ set_scale('functionlog' if pscale == 'log' else 'function',
+ functions=self._functions[::-1])
+
+ # OK, set_scale sets the locators, but if we've called
+ # axsecond.set_ticks, we want to keep those.
+ if self._ticks_set:
+ self._axis.set_major_locator(mticker.FixedLocator(ticks))
+
+ # If the parent scale doesn't change, we can skip this next time.
+ self._parentscale = pscale
+
+ def _set_lims(self):
+ """
+ Set the limits based on parent limits and the convert method
+ between the parent and this secondary Axes.
+ """
+ if self._orientation == 'x':
+ lims = self._parent.get_xlim()
+ set_lim = self.set_xlim
+ else: # 'y'
+ lims = self._parent.get_ylim()
+ set_lim = self.set_ylim
+ order = lims[0] < lims[1]
+ lims = self._functions[0](np.array(lims))
+ neworder = lims[0] < lims[1]
+ if neworder != order:
+ # Flip because the transform will take care of the flipping.
+ lims = lims[::-1]
+ set_lim(lims)
+
+ def set_aspect(self, *args, **kwargs):
+ """
+ Secondary Axes cannot set the aspect ratio, so calling this just
+ sets a warning.
+ """
+ _api.warn_external("Secondary Axes can't set the aspect ratio")
+
+ def set_color(self, color):
+ """
+ Change the color of the secondary Axes and all decorators.
+
+ Parameters
+ ----------
+ color : :mpltype:`color`
+ """
+ axis = self._axis_map[self._orientation]
+ axis.set_tick_params(colors=color)
+ for spine in self.spines.values():
+ if spine.axis is axis:
+ spine.set_color(color)
+ axis.label.set_color(color)
+
+
+_secax_docstring = '''
+Warnings
+--------
+This method is experimental as of 3.1, and the API may change.
+
+Parameters
+----------
+location : {'top', 'bottom', 'left', 'right'} or float
+ The position to put the secondary axis. Strings can be 'top' or
+ 'bottom' for orientation='x' and 'right' or 'left' for
+ orientation='y'. A float indicates the relative position on the
+ parent Axes to put the new Axes, 0.0 being the bottom (or left)
+ and 1.0 being the top (or right).
+
+functions : 2-tuple of func, or Transform with an inverse
+
+ If a 2-tuple of functions, the user specifies the transform
+ function and its inverse. i.e.
+ ``functions=(lambda x: 2 / x, lambda x: 2 / x)`` would be an
+ reciprocal transform with a factor of 2. Both functions must accept
+ numpy arrays as input.
+
+ The user can also directly supply a subclass of
+ `.transforms.Transform` so long as it has an inverse.
+
+ See :doc:`/gallery/subplots_axes_and_figures/secondary_axis`
+ for examples of making these conversions.
+
+transform : `.Transform`, optional
+ If specified, *location* will be
+ placed relative to this transform (in the direction of the axis)
+ rather than the parent's axis. i.e. a secondary x-axis will
+ use the provided y transform and the x transform of the parent.
+
+ .. versionadded:: 3.9
+
+Returns
+-------
+ax : axes._secondary_axes.SecondaryAxis
+
+Other Parameters
+----------------
+**kwargs : `~matplotlib.axes.Axes` properties.
+ Other miscellaneous Axes parameters.
+'''
+_docstring.interpd.register(_secax_docstring=_secax_docstring)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_secondary_axes.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_secondary_axes.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..afb429f740c4aa58a42b64f9209e1e0bd9ee57f7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axes/_secondary_axes.pyi
@@ -0,0 +1,45 @@
+from matplotlib.axes._base import _AxesBase
+from matplotlib.axis import Tick
+
+from matplotlib.transforms import Transform
+
+from collections.abc import Callable, Iterable
+from typing import Literal
+from numpy.typing import ArrayLike
+from matplotlib.typing import ColorType
+
+class SecondaryAxis(_AxesBase):
+ def __init__(
+ self,
+ parent: _AxesBase,
+ orientation: Literal["x", "y"],
+ location: Literal["top", "bottom", "right", "left"] | float,
+ functions: tuple[
+ Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
+ ]
+ | Transform,
+ transform: Transform | None = ...,
+ **kwargs
+ ) -> None: ...
+ def set_alignment(
+ self, align: Literal["top", "bottom", "right", "left"]
+ ) -> None: ...
+ def set_location(
+ self,
+ location: Literal["top", "bottom", "right", "left"] | float,
+ transform: Transform | None = ...
+ ) -> None: ...
+ def set_ticks(
+ self,
+ ticks: ArrayLike,
+ labels: Iterable[str] | None = ...,
+ *,
+ minor: bool = ...,
+ **kwargs
+ ) -> list[Tick]: ...
+ def set_functions(
+ self,
+ functions: tuple[Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]] | Transform,
+ ) -> None: ...
+ def set_aspect(self, *args, **kwargs) -> None: ...
+ def set_color(self, color: ColorType) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axis.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axis.py
new file mode 100644
index 0000000000000000000000000000000000000000..714fb08f55be9a2a7967073960031785b50e0df1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axis.py
@@ -0,0 +1,2819 @@
+"""
+Classes for the ticks and x- and y-axis.
+"""
+
+import datetime
+import functools
+import logging
+from numbers import Real
+import warnings
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cbook
+import matplotlib.artist as martist
+import matplotlib.colors as mcolors
+import matplotlib.lines as mlines
+import matplotlib.scale as mscale
+import matplotlib.text as mtext
+import matplotlib.ticker as mticker
+import matplotlib.transforms as mtransforms
+import matplotlib.units as munits
+
+_log = logging.getLogger(__name__)
+
+GRIDLINE_INTERPOLATION_STEPS = 180
+
+# This list is being used for compatibility with Axes.grid, which
+# allows all Line2D kwargs.
+_line_inspector = martist.ArtistInspector(mlines.Line2D)
+_line_param_names = _line_inspector.get_setters()
+_line_param_aliases = [next(iter(d)) for d in _line_inspector.aliasd.values()]
+_gridline_param_names = ['grid_' + name
+ for name in _line_param_names + _line_param_aliases]
+
+
+class Tick(martist.Artist):
+ """
+ Abstract base class for the axis ticks, grid lines and labels.
+
+ Ticks mark a position on an Axis. They contain two lines as markers and
+ two labels; one each for the bottom and top positions (in case of an
+ `.XAxis`) or for the left and right positions (in case of a `.YAxis`).
+
+ Attributes
+ ----------
+ tick1line : `~matplotlib.lines.Line2D`
+ The left/bottom tick marker.
+ tick2line : `~matplotlib.lines.Line2D`
+ The right/top tick marker.
+ gridline : `~matplotlib.lines.Line2D`
+ The grid line associated with the label position.
+ label1 : `~matplotlib.text.Text`
+ The left/bottom tick label.
+ label2 : `~matplotlib.text.Text`
+ The right/top tick label.
+
+ """
+ def __init__(
+ self, axes, loc, *,
+ size=None, # points
+ width=None,
+ color=None,
+ tickdir=None,
+ pad=None,
+ labelsize=None,
+ labelcolor=None,
+ labelfontfamily=None,
+ zorder=None,
+ gridOn=None, # defaults to axes.grid depending on axes.grid.which
+ tick1On=True,
+ tick2On=True,
+ label1On=True,
+ label2On=False,
+ major=True,
+ labelrotation=0,
+ grid_color=None,
+ grid_linestyle=None,
+ grid_linewidth=None,
+ grid_alpha=None,
+ **kwargs, # Other Line2D kwargs applied to gridlines.
+ ):
+ """
+ bbox is the Bound2D bounding box in display coords of the Axes
+ loc is the tick location in data coords
+ size is the tick size in points
+ """
+ super().__init__()
+
+ if gridOn is None:
+ which = mpl.rcParams['axes.grid.which']
+ if major and (which in ('both', 'major')):
+ gridOn = mpl.rcParams['axes.grid']
+ elif (not major) and (which in ('both', 'minor')):
+ gridOn = mpl.rcParams['axes.grid']
+ else:
+ gridOn = False
+
+ self.set_figure(axes.get_figure(root=False))
+ self.axes = axes
+
+ self._loc = loc
+ self._major = major
+
+ name = self.__name__
+ major_minor = "major" if major else "minor"
+
+ if size is None:
+ size = mpl.rcParams[f"{name}.{major_minor}.size"]
+ self._size = size
+
+ if width is None:
+ width = mpl.rcParams[f"{name}.{major_minor}.width"]
+ self._width = width
+
+ if color is None:
+ color = mpl.rcParams[f"{name}.color"]
+
+ if pad is None:
+ pad = mpl.rcParams[f"{name}.{major_minor}.pad"]
+ self._base_pad = pad
+
+ if labelcolor is None:
+ labelcolor = mpl.rcParams[f"{name}.labelcolor"]
+
+ if cbook._str_equal(labelcolor, 'inherit'):
+ # inherit from tick color
+ labelcolor = mpl.rcParams[f"{name}.color"]
+
+ if labelsize is None:
+ labelsize = mpl.rcParams[f"{name}.labelsize"]
+
+ self._set_labelrotation(labelrotation)
+
+ if zorder is None:
+ if major:
+ zorder = mlines.Line2D.zorder + 0.01
+ else:
+ zorder = mlines.Line2D.zorder
+ self._zorder = zorder
+
+ grid_color = mpl._val_or_rc(grid_color, "grid.color")
+ grid_linestyle = mpl._val_or_rc(grid_linestyle, "grid.linestyle")
+ grid_linewidth = mpl._val_or_rc(grid_linewidth, "grid.linewidth")
+ if grid_alpha is None and not mcolors._has_alpha_channel(grid_color):
+ # alpha precedence: kwarg > color alpha > rcParams['grid.alpha']
+ # Note: only resolve to rcParams if the color does not have alpha
+ # otherwise `grid(color=(1, 1, 1, 0.5))` would work like
+ # grid(color=(1, 1, 1, 0.5), alpha=rcParams['grid.alpha'])
+ # so the that the rcParams default would override color alpha.
+ grid_alpha = mpl.rcParams["grid.alpha"]
+ grid_kw = {k[5:]: v for k, v in kwargs.items()}
+
+ self.tick1line = mlines.Line2D(
+ [], [],
+ color=color, linestyle="none", zorder=zorder, visible=tick1On,
+ markeredgecolor=color, markersize=size, markeredgewidth=width,
+ )
+ self.tick2line = mlines.Line2D(
+ [], [],
+ color=color, linestyle="none", zorder=zorder, visible=tick2On,
+ markeredgecolor=color, markersize=size, markeredgewidth=width,
+ )
+ self.gridline = mlines.Line2D(
+ [], [],
+ color=grid_color, alpha=grid_alpha, visible=gridOn,
+ linestyle=grid_linestyle, linewidth=grid_linewidth, marker="",
+ **grid_kw,
+ )
+ self.gridline.get_path()._interpolation_steps = \
+ GRIDLINE_INTERPOLATION_STEPS
+ self.label1 = mtext.Text(
+ np.nan, np.nan,
+ fontsize=labelsize, color=labelcolor, visible=label1On,
+ fontfamily=labelfontfamily, rotation=self._labelrotation[1])
+ self.label2 = mtext.Text(
+ np.nan, np.nan,
+ fontsize=labelsize, color=labelcolor, visible=label2On,
+ fontfamily=labelfontfamily, rotation=self._labelrotation[1])
+
+ self._apply_tickdir(tickdir)
+
+ for artist in [self.tick1line, self.tick2line, self.gridline,
+ self.label1, self.label2]:
+ self._set_artist_props(artist)
+
+ self.update_position(loc)
+
+ def _set_labelrotation(self, labelrotation):
+ if isinstance(labelrotation, str):
+ mode = labelrotation
+ angle = 0
+ elif isinstance(labelrotation, (tuple, list)):
+ mode, angle = labelrotation
+ else:
+ mode = 'default'
+ angle = labelrotation
+ _api.check_in_list(['auto', 'default'], labelrotation=mode)
+ self._labelrotation = (mode, angle)
+
+ @property
+ def _pad(self):
+ return self._base_pad + self.get_tick_padding()
+
+ def _apply_tickdir(self, tickdir):
+ """Set tick direction. Valid values are 'out', 'in', 'inout'."""
+ # This method is responsible for verifying input and, in subclasses, for setting
+ # the tick{1,2}line markers. From the user perspective this should always be
+ # called through _apply_params, which further updates ticklabel positions using
+ # the new pads.
+ if tickdir is None:
+ tickdir = mpl.rcParams[f'{self.__name__}.direction']
+ else:
+ _api.check_in_list(['in', 'out', 'inout'], tickdir=tickdir)
+ self._tickdir = tickdir
+
+ def get_tickdir(self):
+ return self._tickdir
+
+ def get_tick_padding(self):
+ """Get the length of the tick outside of the Axes."""
+ padding = {
+ 'in': 0.0,
+ 'inout': 0.5,
+ 'out': 1.0
+ }
+ return self._size * padding[self._tickdir]
+
+ def get_children(self):
+ children = [self.tick1line, self.tick2line,
+ self.gridline, self.label1, self.label2]
+ return children
+
+ def set_clip_path(self, path, transform=None):
+ # docstring inherited
+ super().set_clip_path(path, transform)
+ self.gridline.set_clip_path(path, transform)
+ self.stale = True
+
+ def contains(self, mouseevent):
+ """
+ Test whether the mouse event occurred in the Tick marks.
+
+ This function always returns false. It is more useful to test if the
+ axis as a whole contains the mouse rather than the set of tick marks.
+ """
+ return False, {}
+
+ def set_pad(self, val):
+ """
+ Set the tick label pad in points
+
+ Parameters
+ ----------
+ val : float
+ """
+ self._apply_params(pad=val)
+ self.stale = True
+
+ def get_pad(self):
+ """Get the value of the tick label pad in points."""
+ return self._base_pad
+
+ def get_loc(self):
+ """Return the tick location (data coords) as a scalar."""
+ return self._loc
+
+ @martist.allow_rasterization
+ def draw(self, renderer):
+ if not self.get_visible():
+ self.stale = False
+ return
+ renderer.open_group(self.__name__, gid=self.get_gid())
+ for artist in [self.gridline, self.tick1line, self.tick2line,
+ self.label1, self.label2]:
+ artist.draw(renderer)
+ renderer.close_group(self.__name__)
+ self.stale = False
+
+ def set_url(self, url):
+ """
+ Set the url of label1 and label2.
+
+ Parameters
+ ----------
+ url : str
+ """
+ super().set_url(url)
+ self.label1.set_url(url)
+ self.label2.set_url(url)
+ self.stale = True
+
+ def _set_artist_props(self, a):
+ a.set_figure(self.get_figure(root=False))
+
+ def get_view_interval(self):
+ """
+ Return the view limits ``(min, max)`` of the axis the tick belongs to.
+ """
+ raise NotImplementedError('Derived must override')
+
+ def _apply_params(self, **kwargs):
+ for name, target in [("gridOn", self.gridline),
+ ("tick1On", self.tick1line),
+ ("tick2On", self.tick2line),
+ ("label1On", self.label1),
+ ("label2On", self.label2)]:
+ if name in kwargs:
+ target.set_visible(kwargs.pop(name))
+ if any(k in kwargs for k in ['size', 'width', 'pad', 'tickdir']):
+ self._size = kwargs.pop('size', self._size)
+ # Width could be handled outside this block, but it is
+ # convenient to leave it here.
+ self._width = kwargs.pop('width', self._width)
+ self._base_pad = kwargs.pop('pad', self._base_pad)
+ # _apply_tickdir uses _size and _base_pad to make _pad, and also
+ # sets the ticklines markers.
+ self._apply_tickdir(kwargs.pop('tickdir', self._tickdir))
+ for line in (self.tick1line, self.tick2line):
+ line.set_markersize(self._size)
+ line.set_markeredgewidth(self._width)
+ # _get_text1_transform uses _pad from _apply_tickdir.
+ trans = self._get_text1_transform()[0]
+ self.label1.set_transform(trans)
+ trans = self._get_text2_transform()[0]
+ self.label2.set_transform(trans)
+ tick_kw = {k: v for k, v in kwargs.items() if k in ['color', 'zorder']}
+ if 'color' in kwargs:
+ tick_kw['markeredgecolor'] = kwargs['color']
+ self.tick1line.set(**tick_kw)
+ self.tick2line.set(**tick_kw)
+ for k, v in tick_kw.items():
+ setattr(self, '_' + k, v)
+
+ if 'labelrotation' in kwargs:
+ self._set_labelrotation(kwargs.pop('labelrotation'))
+ self.label1.set(rotation=self._labelrotation[1])
+ self.label2.set(rotation=self._labelrotation[1])
+
+ label_kw = {k[5:]: v for k, v in kwargs.items()
+ if k in ['labelsize', 'labelcolor', 'labelfontfamily']}
+ self.label1.set(**label_kw)
+ self.label2.set(**label_kw)
+
+ grid_kw = {k[5:]: v for k, v in kwargs.items()
+ if k in _gridline_param_names}
+ self.gridline.set(**grid_kw)
+
+ def update_position(self, loc):
+ """Set the location of tick in data coords with scalar *loc*."""
+ raise NotImplementedError('Derived must override')
+
+ def _get_text1_transform(self):
+ raise NotImplementedError('Derived must override')
+
+ def _get_text2_transform(self):
+ raise NotImplementedError('Derived must override')
+
+
+class XTick(Tick):
+ """
+ Contains all the Artists needed to make an x tick - the tick line,
+ the label text and the grid line
+ """
+ __name__ = 'xtick'
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # x in data coords, y in axes coords
+ ax = self.axes
+ self.tick1line.set(
+ data=([0], [0]), transform=ax.get_xaxis_transform("tick1"))
+ self.tick2line.set(
+ data=([0], [1]), transform=ax.get_xaxis_transform("tick2"))
+ self.gridline.set(
+ data=([0, 0], [0, 1]), transform=ax.get_xaxis_transform("grid"))
+ # the y loc is 3 points below the min of y axis
+ trans, va, ha = self._get_text1_transform()
+ self.label1.set(
+ x=0, y=0,
+ verticalalignment=va, horizontalalignment=ha, transform=trans,
+ )
+ trans, va, ha = self._get_text2_transform()
+ self.label2.set(
+ x=0, y=1,
+ verticalalignment=va, horizontalalignment=ha, transform=trans,
+ )
+
+ def _get_text1_transform(self):
+ return self.axes.get_xaxis_text1_transform(self._pad)
+
+ def _get_text2_transform(self):
+ return self.axes.get_xaxis_text2_transform(self._pad)
+
+ def _apply_tickdir(self, tickdir):
+ # docstring inherited
+ super()._apply_tickdir(tickdir)
+ mark1, mark2 = {
+ 'out': (mlines.TICKDOWN, mlines.TICKUP),
+ 'in': (mlines.TICKUP, mlines.TICKDOWN),
+ 'inout': ('|', '|'),
+ }[self._tickdir]
+ self.tick1line.set_marker(mark1)
+ self.tick2line.set_marker(mark2)
+
+ def update_position(self, loc):
+ """Set the location of tick in data coords with scalar *loc*."""
+ self.tick1line.set_xdata((loc,))
+ self.tick2line.set_xdata((loc,))
+ self.gridline.set_xdata((loc,))
+ self.label1.set_x(loc)
+ self.label2.set_x(loc)
+ self._loc = loc
+ self.stale = True
+
+ def get_view_interval(self):
+ # docstring inherited
+ return self.axes.viewLim.intervalx
+
+
+class YTick(Tick):
+ """
+ Contains all the Artists needed to make a Y tick - the tick line,
+ the label text and the grid line
+ """
+ __name__ = 'ytick'
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # x in axes coords, y in data coords
+ ax = self.axes
+ self.tick1line.set(
+ data=([0], [0]), transform=ax.get_yaxis_transform("tick1"))
+ self.tick2line.set(
+ data=([1], [0]), transform=ax.get_yaxis_transform("tick2"))
+ self.gridline.set(
+ data=([0, 1], [0, 0]), transform=ax.get_yaxis_transform("grid"))
+ # the y loc is 3 points below the min of y axis
+ trans, va, ha = self._get_text1_transform()
+ self.label1.set(
+ x=0, y=0,
+ verticalalignment=va, horizontalalignment=ha, transform=trans,
+ )
+ trans, va, ha = self._get_text2_transform()
+ self.label2.set(
+ x=1, y=0,
+ verticalalignment=va, horizontalalignment=ha, transform=trans,
+ )
+
+ def _get_text1_transform(self):
+ return self.axes.get_yaxis_text1_transform(self._pad)
+
+ def _get_text2_transform(self):
+ return self.axes.get_yaxis_text2_transform(self._pad)
+
+ def _apply_tickdir(self, tickdir):
+ # docstring inherited
+ super()._apply_tickdir(tickdir)
+ mark1, mark2 = {
+ 'out': (mlines.TICKLEFT, mlines.TICKRIGHT),
+ 'in': (mlines.TICKRIGHT, mlines.TICKLEFT),
+ 'inout': ('_', '_'),
+ }[self._tickdir]
+ self.tick1line.set_marker(mark1)
+ self.tick2line.set_marker(mark2)
+
+ def update_position(self, loc):
+ """Set the location of tick in data coords with scalar *loc*."""
+ self.tick1line.set_ydata((loc,))
+ self.tick2line.set_ydata((loc,))
+ self.gridline.set_ydata((loc,))
+ self.label1.set_y(loc)
+ self.label2.set_y(loc)
+ self._loc = loc
+ self.stale = True
+
+ def get_view_interval(self):
+ # docstring inherited
+ return self.axes.viewLim.intervaly
+
+
+class Ticker:
+ """
+ A container for the objects defining tick position and format.
+
+ Attributes
+ ----------
+ locator : `~matplotlib.ticker.Locator` subclass
+ Determines the positions of the ticks.
+ formatter : `~matplotlib.ticker.Formatter` subclass
+ Determines the format of the tick labels.
+ """
+
+ def __init__(self):
+ self._locator = None
+ self._formatter = None
+ self._locator_is_default = True
+ self._formatter_is_default = True
+
+ @property
+ def locator(self):
+ return self._locator
+
+ @locator.setter
+ def locator(self, locator):
+ if not isinstance(locator, mticker.Locator):
+ raise TypeError('locator must be a subclass of '
+ 'matplotlib.ticker.Locator')
+ self._locator = locator
+
+ @property
+ def formatter(self):
+ return self._formatter
+
+ @formatter.setter
+ def formatter(self, formatter):
+ if not isinstance(formatter, mticker.Formatter):
+ raise TypeError('formatter must be a subclass of '
+ 'matplotlib.ticker.Formatter')
+ self._formatter = formatter
+
+
+class _LazyTickList:
+ """
+ A descriptor for lazy instantiation of tick lists.
+
+ See comment above definition of the ``majorTicks`` and ``minorTicks``
+ attributes.
+ """
+
+ def __init__(self, major):
+ self._major = major
+
+ def __get__(self, instance, owner):
+ if instance is None:
+ return self
+ else:
+ # instance._get_tick() can itself try to access the majorTicks
+ # attribute (e.g. in certain projection classes which override
+ # e.g. get_xaxis_text1_transform). In order to avoid infinite
+ # recursion, first set the majorTicks on the instance temporarily
+ # to an empty lis. Then create the tick; note that _get_tick()
+ # may call reset_ticks(). Therefore, the final tick list is
+ # created and assigned afterwards.
+ if self._major:
+ instance.majorTicks = []
+ tick = instance._get_tick(major=True)
+ instance.majorTicks = [tick]
+ return instance.majorTicks
+ else:
+ instance.minorTicks = []
+ tick = instance._get_tick(major=False)
+ instance.minorTicks = [tick]
+ return instance.minorTicks
+
+
+class Axis(martist.Artist):
+ """
+ Base class for `.XAxis` and `.YAxis`.
+
+ Attributes
+ ----------
+ isDefault_label : bool
+
+ axes : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` to which the Axis belongs.
+ major : `~matplotlib.axis.Ticker`
+ Determines the major tick positions and their label format.
+ minor : `~matplotlib.axis.Ticker`
+ Determines the minor tick positions and their label format.
+ callbacks : `~matplotlib.cbook.CallbackRegistry`
+
+ label : `~matplotlib.text.Text`
+ The axis label.
+ labelpad : float
+ The distance between the axis label and the tick labels.
+ Defaults to :rc:`axes.labelpad`.
+ offsetText : `~matplotlib.text.Text`
+ A `.Text` object containing the data offset of the ticks (if any).
+ pickradius : float
+ The acceptance radius for containment tests. See also `.Axis.contains`.
+ majorTicks : list of `.Tick`
+ The major ticks.
+
+ .. warning::
+
+ Ticks are not guaranteed to be persistent. Various operations
+ can create, delete and modify the Tick instances. There is an
+ imminent risk that changes to individual ticks will not
+ survive if you work on the figure further (including also
+ panning/zooming on a displayed figure).
+
+ Working on the individual ticks is a method of last resort.
+ Use `.set_tick_params` instead if possible.
+
+ minorTicks : list of `.Tick`
+ The minor ticks.
+ """
+ OFFSETTEXTPAD = 3
+ # The class used in _get_tick() to create tick instances. Must either be
+ # overwritten in subclasses, or subclasses must reimplement _get_tick().
+ _tick_class = None
+ converter = _api.deprecate_privatize_attribute(
+ "3.10",
+ alternative="get_converter and set_converter methods"
+ )
+
+ def __str__(self):
+ return "{}({},{})".format(
+ type(self).__name__, *self.axes.transAxes.transform((0, 0)))
+
+ def __init__(self, axes, *, pickradius=15, clear=True):
+ """
+ Parameters
+ ----------
+ axes : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` to which the created Axis belongs.
+ pickradius : float
+ The acceptance radius for containment tests. See also
+ `.Axis.contains`.
+ clear : bool, default: True
+ Whether to clear the Axis on creation. This is not required, e.g., when
+ creating an Axis as part of an Axes, as ``Axes.clear`` will call
+ ``Axis.clear``.
+ .. versionadded:: 3.8
+ """
+ super().__init__()
+ self._remove_overlapping_locs = True
+
+ self.set_figure(axes.get_figure(root=False))
+
+ self.isDefault_label = True
+
+ self.axes = axes
+ self.major = Ticker()
+ self.minor = Ticker()
+ self.callbacks = cbook.CallbackRegistry(signals=["units"])
+
+ self._autolabelpos = True
+
+ self.label = mtext.Text(
+ np.nan, np.nan,
+ fontsize=mpl.rcParams['axes.labelsize'],
+ fontweight=mpl.rcParams['axes.labelweight'],
+ color=mpl.rcParams['axes.labelcolor'],
+ ) #: The `.Text` object of the axis label.
+
+ self._set_artist_props(self.label)
+ self.offsetText = mtext.Text(np.nan, np.nan)
+ self._set_artist_props(self.offsetText)
+
+ self.labelpad = mpl.rcParams['axes.labelpad']
+
+ self.pickradius = pickradius
+
+ # Initialize here for testing; later add API
+ self._major_tick_kw = dict()
+ self._minor_tick_kw = dict()
+
+ if clear:
+ self.clear()
+ else:
+ self._converter = None
+ self._converter_is_explicit = False
+ self.units = None
+
+ self._autoscale_on = True
+
+ @property
+ def isDefault_majloc(self):
+ return self.major._locator_is_default
+
+ @isDefault_majloc.setter
+ def isDefault_majloc(self, value):
+ self.major._locator_is_default = value
+
+ @property
+ def isDefault_majfmt(self):
+ return self.major._formatter_is_default
+
+ @isDefault_majfmt.setter
+ def isDefault_majfmt(self, value):
+ self.major._formatter_is_default = value
+
+ @property
+ def isDefault_minloc(self):
+ return self.minor._locator_is_default
+
+ @isDefault_minloc.setter
+ def isDefault_minloc(self, value):
+ self.minor._locator_is_default = value
+
+ @property
+ def isDefault_minfmt(self):
+ return self.minor._formatter_is_default
+
+ @isDefault_minfmt.setter
+ def isDefault_minfmt(self, value):
+ self.minor._formatter_is_default = value
+
+ def _get_shared_axes(self):
+ """Return Grouper of shared Axes for current axis."""
+ return self.axes._shared_axes[
+ self._get_axis_name()].get_siblings(self.axes)
+
+ def _get_shared_axis(self):
+ """Return list of shared axis for current axis."""
+ name = self._get_axis_name()
+ return [ax._axis_map[name] for ax in self._get_shared_axes()]
+
+ def _get_axis_name(self):
+ """Return the axis name."""
+ return next(name for name, axis in self.axes._axis_map.items()
+ if axis is self)
+
+ # During initialization, Axis objects often create ticks that are later
+ # unused; this turns out to be a very slow step. Instead, use a custom
+ # descriptor to make the tick lists lazy and instantiate them as needed.
+ majorTicks = _LazyTickList(major=True)
+ minorTicks = _LazyTickList(major=False)
+
+ def get_remove_overlapping_locs(self):
+ return self._remove_overlapping_locs
+
+ def set_remove_overlapping_locs(self, val):
+ self._remove_overlapping_locs = bool(val)
+
+ remove_overlapping_locs = property(
+ get_remove_overlapping_locs, set_remove_overlapping_locs,
+ doc=('If minor ticker locations that overlap with major '
+ 'ticker locations should be trimmed.'))
+
+ def set_label_coords(self, x, y, transform=None):
+ """
+ Set the coordinates of the label.
+
+ By default, the x coordinate of the y label and the y coordinate of the
+ x label are determined by the tick label bounding boxes, but this can
+ lead to poor alignment of multiple labels if there are multiple Axes.
+
+ You can also specify the coordinate system of the label with the
+ transform. If None, the default coordinate system will be the axes
+ coordinate system: (0, 0) is bottom left, (0.5, 0.5) is center, etc.
+ """
+ self._autolabelpos = False
+ if transform is None:
+ transform = self.axes.transAxes
+
+ self.label.set_transform(transform)
+ self.label.set_position((x, y))
+ self.stale = True
+
+ def get_transform(self):
+ """Return the transform used in the Axis' scale"""
+ return self._scale.get_transform()
+
+ def get_scale(self):
+ """Return this Axis' scale (as a str)."""
+ return self._scale.name
+
+ def _set_scale(self, value, **kwargs):
+ if not isinstance(value, mscale.ScaleBase):
+ self._scale = mscale.scale_factory(value, self, **kwargs)
+ else:
+ self._scale = value
+ self._scale.set_default_locators_and_formatters(self)
+
+ self.isDefault_majloc = True
+ self.isDefault_minloc = True
+ self.isDefault_majfmt = True
+ self.isDefault_minfmt = True
+
+ # This method is directly wrapped by Axes.set_{x,y}scale.
+ def _set_axes_scale(self, value, **kwargs):
+ """
+ Set this Axis' scale.
+
+ Parameters
+ ----------
+ value : str or `.ScaleBase`
+ The axis scale type to apply. Valid string values are the names of scale
+ classes ("linear", "log", "function",...). These may be the names of any
+ of the :ref:`built-in scales` or of any custom scales
+ registered using `matplotlib.scale.register_scale`.
+
+ **kwargs
+ If *value* is a string, keywords are passed to the instantiation method of
+ the respective class.
+ """
+ name = self._get_axis_name()
+ old_default_lims = (self.get_major_locator()
+ .nonsingular(-np.inf, np.inf))
+ for ax in self._get_shared_axes():
+ ax._axis_map[name]._set_scale(value, **kwargs)
+ ax._update_transScale()
+ ax.stale = True
+ new_default_lims = (self.get_major_locator()
+ .nonsingular(-np.inf, np.inf))
+ if old_default_lims != new_default_lims:
+ # Force autoscaling now, to take advantage of the scale locator's
+ # nonsingular() before it possibly gets swapped out by the user.
+ self.axes.autoscale_view(
+ **{f"scale{k}": k == name for k in self.axes._axis_names})
+
+ def limit_range_for_scale(self, vmin, vmax):
+ """
+ Return the range *vmin*, *vmax*, restricted to the domain supported by the
+ current scale.
+ """
+ return self._scale.limit_range_for_scale(vmin, vmax, self.get_minpos())
+
+ def _get_autoscale_on(self):
+ """Return whether this Axis is autoscaled."""
+ return self._autoscale_on
+
+ def _set_autoscale_on(self, b):
+ """
+ Set whether this Axis is autoscaled when drawing or by `.Axes.autoscale_view`.
+
+ If b is None, then the value is not changed.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ if b is not None:
+ self._autoscale_on = b
+
+ def get_children(self):
+ return [self.label, self.offsetText,
+ *self.get_major_ticks(), *self.get_minor_ticks()]
+
+ def _reset_major_tick_kw(self):
+ self._major_tick_kw.clear()
+ self._major_tick_kw['gridOn'] = (
+ mpl.rcParams['axes.grid'] and
+ mpl.rcParams['axes.grid.which'] in ('both', 'major'))
+
+ def _reset_minor_tick_kw(self):
+ self._minor_tick_kw.clear()
+ self._minor_tick_kw['gridOn'] = (
+ mpl.rcParams['axes.grid'] and
+ mpl.rcParams['axes.grid.which'] in ('both', 'minor'))
+
+ def clear(self):
+ """
+ Clear the axis.
+
+ This resets axis properties to their default values:
+
+ - the label
+ - the scale
+ - locators, formatters and ticks
+ - major and minor grid
+ - units
+ - registered callbacks
+ """
+ self.label._reset_visual_defaults()
+ # The above resets the label formatting using text rcParams,
+ # so we then update the formatting using axes rcParams
+ self.label.set_color(mpl.rcParams['axes.labelcolor'])
+ self.label.set_fontsize(mpl.rcParams['axes.labelsize'])
+ self.label.set_fontweight(mpl.rcParams['axes.labelweight'])
+ self.offsetText._reset_visual_defaults()
+ self.labelpad = mpl.rcParams['axes.labelpad']
+
+ self._init()
+
+ self._set_scale('linear')
+
+ # Clear the callback registry for this axis, or it may "leak"
+ self.callbacks = cbook.CallbackRegistry(signals=["units"])
+
+ # whether the grids are on
+ self._major_tick_kw['gridOn'] = (
+ mpl.rcParams['axes.grid'] and
+ mpl.rcParams['axes.grid.which'] in ('both', 'major'))
+ self._minor_tick_kw['gridOn'] = (
+ mpl.rcParams['axes.grid'] and
+ mpl.rcParams['axes.grid.which'] in ('both', 'minor'))
+ self.reset_ticks()
+
+ self._converter = None
+ self._converter_is_explicit = False
+ self.units = None
+ self.stale = True
+
+ def reset_ticks(self):
+ """
+ Re-initialize the major and minor Tick lists.
+
+ Each list starts with a single fresh Tick.
+ """
+ # Restore the lazy tick lists.
+ try:
+ del self.majorTicks
+ except AttributeError:
+ pass
+ try:
+ del self.minorTicks
+ except AttributeError:
+ pass
+ try:
+ self.set_clip_path(self.axes.patch)
+ except AttributeError:
+ pass
+
+ def minorticks_on(self):
+ """
+ Display default minor ticks on the Axis, depending on the scale
+ (`~.axis.Axis.get_scale`).
+
+ Scales use specific minor locators:
+
+ - log: `~.LogLocator`
+ - symlog: `~.SymmetricalLogLocator`
+ - asinh: `~.AsinhLocator`
+ - logit: `~.LogitLocator`
+ - default: `~.AutoMinorLocator`
+
+ Displaying minor ticks may reduce performance; you may turn them off
+ using `minorticks_off()` if drawing speed is a problem.
+ """
+ scale = self.get_scale()
+ if scale == 'log':
+ s = self._scale
+ self.set_minor_locator(mticker.LogLocator(s.base, s.subs))
+ elif scale == 'symlog':
+ s = self._scale
+ self.set_minor_locator(
+ mticker.SymmetricalLogLocator(s._transform, s.subs))
+ elif scale == 'asinh':
+ s = self._scale
+ self.set_minor_locator(
+ mticker.AsinhLocator(s.linear_width, base=s._base,
+ subs=s._subs))
+ elif scale == 'logit':
+ self.set_minor_locator(mticker.LogitLocator(minor=True))
+ else:
+ self.set_minor_locator(mticker.AutoMinorLocator())
+
+ def minorticks_off(self):
+ """Remove minor ticks from the Axis."""
+ self.set_minor_locator(mticker.NullLocator())
+
+ def set_tick_params(self, which='major', reset=False, **kwargs):
+ """
+ Set appearance parameters for ticks, ticklabels, and gridlines.
+
+ For documentation of keyword arguments, see
+ :meth:`matplotlib.axes.Axes.tick_params`.
+
+ See Also
+ --------
+ .Axis.get_tick_params
+ View the current style settings for ticks, ticklabels, and
+ gridlines.
+ """
+ _api.check_in_list(['major', 'minor', 'both'], which=which)
+ kwtrans = self._translate_tick_params(kwargs)
+
+ # the kwargs are stored in self._major/minor_tick_kw so that any
+ # future new ticks will automatically get them
+ if reset:
+ if which in ['major', 'both']:
+ self._reset_major_tick_kw()
+ self._major_tick_kw.update(kwtrans)
+ if which in ['minor', 'both']:
+ self._reset_minor_tick_kw()
+ self._minor_tick_kw.update(kwtrans)
+ self.reset_ticks()
+ else:
+ if which in ['major', 'both']:
+ self._major_tick_kw.update(kwtrans)
+ for tick in self.majorTicks:
+ tick._apply_params(**kwtrans)
+ if which in ['minor', 'both']:
+ self._minor_tick_kw.update(kwtrans)
+ for tick in self.minorTicks:
+ tick._apply_params(**kwtrans)
+ # labelOn and labelcolor also apply to the offset text.
+ if 'label1On' in kwtrans or 'label2On' in kwtrans:
+ self.offsetText.set_visible(
+ self._major_tick_kw.get('label1On', False)
+ or self._major_tick_kw.get('label2On', False))
+ if 'labelcolor' in kwtrans:
+ self.offsetText.set_color(kwtrans['labelcolor'])
+
+ self.stale = True
+
+ def get_tick_params(self, which='major'):
+ """
+ Get appearance parameters for ticks, ticklabels, and gridlines.
+
+ .. versionadded:: 3.7
+
+ Parameters
+ ----------
+ which : {'major', 'minor'}, default: 'major'
+ The group of ticks for which the parameters are retrieved.
+
+ Returns
+ -------
+ dict
+ Properties for styling tick elements added to the axis.
+
+ Notes
+ -----
+ This method returns the appearance parameters for styling *new*
+ elements added to this axis and may be different from the values
+ on current elements if they were modified directly by the user
+ (e.g., via ``set_*`` methods on individual tick objects).
+
+ Examples
+ --------
+ ::
+
+ >>> ax.yaxis.set_tick_params(labelsize=30, labelcolor='red',
+ ... direction='out', which='major')
+ >>> ax.yaxis.get_tick_params(which='major')
+ {'direction': 'out',
+ 'left': True,
+ 'right': False,
+ 'labelleft': True,
+ 'labelright': False,
+ 'gridOn': False,
+ 'labelsize': 30,
+ 'labelcolor': 'red'}
+ >>> ax.yaxis.get_tick_params(which='minor')
+ {'left': True,
+ 'right': False,
+ 'labelleft': True,
+ 'labelright': False,
+ 'gridOn': False}
+
+
+ """
+ _api.check_in_list(['major', 'minor'], which=which)
+ if which == 'major':
+ return self._translate_tick_params(
+ self._major_tick_kw, reverse=True
+ )
+ return self._translate_tick_params(self._minor_tick_kw, reverse=True)
+
+ @classmethod
+ def _translate_tick_params(cls, kw, reverse=False):
+ """
+ Translate the kwargs supported by `.Axis.set_tick_params` to kwargs
+ supported by `.Tick._apply_params`.
+
+ In particular, this maps axis specific names like 'top', 'left'
+ to the generic tick1, tick2 logic of the axis. Additionally, there
+ are some other name translations.
+
+ Returns a new dict of translated kwargs.
+
+ Note: Use reverse=True to translate from those supported by
+ `.Tick._apply_params` back to those supported by
+ `.Axis.set_tick_params`.
+ """
+ kw_ = {**kw}
+
+ # The following lists may be moved to a more accessible location.
+ allowed_keys = [
+ 'size', 'width', 'color', 'tickdir', 'pad',
+ 'labelsize', 'labelcolor', 'labelfontfamily', 'zorder', 'gridOn',
+ 'tick1On', 'tick2On', 'label1On', 'label2On',
+ 'length', 'direction', 'left', 'bottom', 'right', 'top',
+ 'labelleft', 'labelbottom', 'labelright', 'labeltop',
+ 'labelrotation',
+ *_gridline_param_names]
+
+ keymap = {
+ # tick_params key -> axis key
+ 'length': 'size',
+ 'direction': 'tickdir',
+ 'rotation': 'labelrotation',
+ 'left': 'tick1On',
+ 'bottom': 'tick1On',
+ 'right': 'tick2On',
+ 'top': 'tick2On',
+ 'labelleft': 'label1On',
+ 'labelbottom': 'label1On',
+ 'labelright': 'label2On',
+ 'labeltop': 'label2On',
+ }
+ if reverse:
+ kwtrans = {}
+ is_x_axis = cls.axis_name == 'x'
+ y_axis_keys = ['left', 'right', 'labelleft', 'labelright']
+ for oldkey, newkey in keymap.items():
+ if newkey in kw_:
+ if is_x_axis and oldkey in y_axis_keys:
+ continue
+ else:
+ kwtrans[oldkey] = kw_.pop(newkey)
+ else:
+ kwtrans = {
+ newkey: kw_.pop(oldkey)
+ for oldkey, newkey in keymap.items() if oldkey in kw_
+ }
+ if 'colors' in kw_:
+ c = kw_.pop('colors')
+ kwtrans['color'] = c
+ kwtrans['labelcolor'] = c
+ # Maybe move the checking up to the caller of this method.
+ for key in kw_:
+ if key not in allowed_keys:
+ raise ValueError(
+ "keyword %s is not recognized; valid keywords are %s"
+ % (key, allowed_keys))
+ kwtrans.update(kw_)
+ return kwtrans
+
+ def set_clip_path(self, path, transform=None):
+ super().set_clip_path(path, transform)
+ for child in self.majorTicks + self.minorTicks:
+ child.set_clip_path(path, transform)
+ self.stale = True
+
+ def get_view_interval(self):
+ """Return the ``(min, max)`` view limits of this axis."""
+ raise NotImplementedError('Derived must override')
+
+ def set_view_interval(self, vmin, vmax, ignore=False):
+ """
+ Set the axis view limits. This method is for internal use; Matplotlib
+ users should typically use e.g. `~.Axes.set_xlim` or `~.Axes.set_ylim`.
+
+ If *ignore* is False (the default), this method will never reduce the
+ preexisting view limits, only expand them if *vmin* or *vmax* are not
+ within them. Moreover, the order of *vmin* and *vmax* does not matter;
+ the orientation of the axis will not change.
+
+ If *ignore* is True, the view limits will be set exactly to ``(vmin,
+ vmax)`` in that order.
+ """
+ raise NotImplementedError('Derived must override')
+
+ def get_data_interval(self):
+ """Return the ``(min, max)`` data limits of this axis."""
+ raise NotImplementedError('Derived must override')
+
+ def set_data_interval(self, vmin, vmax, ignore=False):
+ """
+ Set the axis data limits. This method is for internal use.
+
+ If *ignore* is False (the default), this method will never reduce the
+ preexisting data limits, only expand them if *vmin* or *vmax* are not
+ within them. Moreover, the order of *vmin* and *vmax* does not matter;
+ the orientation of the axis will not change.
+
+ If *ignore* is True, the data limits will be set exactly to ``(vmin,
+ vmax)`` in that order.
+ """
+ raise NotImplementedError('Derived must override')
+
+ def get_inverted(self):
+ """
+ Return whether this Axis is oriented in the "inverse" direction.
+
+ The "normal" direction is increasing to the right for the x-axis and to
+ the top for the y-axis; the "inverse" direction is increasing to the
+ left for the x-axis and to the bottom for the y-axis.
+ """
+ low, high = self.get_view_interval()
+ return high < low
+
+ def set_inverted(self, inverted):
+ """
+ Set whether this Axis is oriented in the "inverse" direction.
+
+ The "normal" direction is increasing to the right for the x-axis and to
+ the top for the y-axis; the "inverse" direction is increasing to the
+ left for the x-axis and to the bottom for the y-axis.
+ """
+ a, b = self.get_view_interval()
+ # cast to bool to avoid bad interaction between python 3.8 and np.bool_
+ self._set_lim(*sorted((a, b), reverse=bool(inverted)), auto=None)
+
+ def set_default_intervals(self):
+ """
+ Set the default limits for the axis data and view interval if they
+ have not been not mutated yet.
+ """
+ # this is mainly in support of custom object plotting. For
+ # example, if someone passes in a datetime object, we do not
+ # know automagically how to set the default min/max of the
+ # data and view limits. The unit conversion AxisInfo
+ # interface provides a hook for custom types to register
+ # default limits through the AxisInfo.default_limits
+ # attribute, and the derived code below will check for that
+ # and use it if it's available (else just use 0..1)
+
+ def _set_lim(self, v0, v1, *, emit=True, auto):
+ """
+ Set view limits.
+
+ This method is a helper for the Axes ``set_xlim``, ``set_ylim``, and
+ ``set_zlim`` methods.
+
+ Parameters
+ ----------
+ v0, v1 : float
+ The view limits. (Passing *v0* as a (low, high) pair is not
+ supported; normalization must occur in the Axes setters.)
+ emit : bool, default: True
+ Whether to notify observers of limit change.
+ auto : bool or None, default: False
+ Whether to turn on autoscaling of the x-axis. True turns on, False
+ turns off, None leaves unchanged.
+ """
+ name = self._get_axis_name()
+
+ self.axes._process_unit_info([(name, (v0, v1))], convert=False)
+ v0 = self.axes._validate_converted_limits(v0, self.convert_units)
+ v1 = self.axes._validate_converted_limits(v1, self.convert_units)
+
+ if v0 is None or v1 is None:
+ # Axes init calls set_xlim(0, 1) before get_xlim() can be called,
+ # so only grab the limits if we really need them.
+ old0, old1 = self.get_view_interval()
+ if v0 is None:
+ v0 = old0
+ if v1 is None:
+ v1 = old1
+
+ if self.get_scale() == 'log' and (v0 <= 0 or v1 <= 0):
+ # Axes init calls set_xlim(0, 1) before get_xlim() can be called,
+ # so only grab the limits if we really need them.
+ old0, old1 = self.get_view_interval()
+ if v0 <= 0:
+ _api.warn_external(f"Attempt to set non-positive {name}lim on "
+ f"a log-scaled axis will be ignored.")
+ v0 = old0
+ if v1 <= 0:
+ _api.warn_external(f"Attempt to set non-positive {name}lim on "
+ f"a log-scaled axis will be ignored.")
+ v1 = old1
+ if v0 == v1:
+ _api.warn_external(
+ f"Attempting to set identical low and high {name}lims "
+ f"makes transformation singular; automatically expanding.")
+ reverse = bool(v0 > v1) # explicit cast needed for python3.8+np.bool_.
+ v0, v1 = self.get_major_locator().nonsingular(v0, v1)
+ v0, v1 = self.limit_range_for_scale(v0, v1)
+ v0, v1 = sorted([v0, v1], reverse=bool(reverse))
+
+ self.set_view_interval(v0, v1, ignore=True)
+ # Mark viewlims as no longer stale without triggering an autoscale.
+ for ax in self._get_shared_axes():
+ ax._stale_viewlims[name] = False
+ self._set_autoscale_on(auto)
+
+ if emit:
+ self.axes.callbacks.process(f"{name}lim_changed", self.axes)
+ # Call all of the other Axes that are shared with this one
+ for other in self._get_shared_axes():
+ if other is self.axes:
+ continue
+ other._axis_map[name]._set_lim(v0, v1, emit=False, auto=auto)
+ if emit:
+ other.callbacks.process(f"{name}lim_changed", other)
+ if ((other_fig := other.get_figure(root=False)) !=
+ self.get_figure(root=False)):
+ other_fig.canvas.draw_idle()
+
+ self.stale = True
+ return v0, v1
+
+ def _set_artist_props(self, a):
+ if a is None:
+ return
+ a.set_figure(self.get_figure(root=False))
+
+ def _update_ticks(self):
+ """
+ Update ticks (position and labels) using the current data interval of
+ the axes. Return the list of ticks that will be drawn.
+ """
+ major_locs = self.get_majorticklocs()
+ major_labels = self.major.formatter.format_ticks(major_locs)
+ major_ticks = self.get_major_ticks(len(major_locs))
+ for tick, loc, label in zip(major_ticks, major_locs, major_labels):
+ tick.update_position(loc)
+ tick.label1.set_text(label)
+ tick.label2.set_text(label)
+ minor_locs = self.get_minorticklocs()
+ minor_labels = self.minor.formatter.format_ticks(minor_locs)
+ minor_ticks = self.get_minor_ticks(len(minor_locs))
+ for tick, loc, label in zip(minor_ticks, minor_locs, minor_labels):
+ tick.update_position(loc)
+ tick.label1.set_text(label)
+ tick.label2.set_text(label)
+ ticks = [*major_ticks, *minor_ticks]
+
+ view_low, view_high = self.get_view_interval()
+ if view_low > view_high:
+ view_low, view_high = view_high, view_low
+
+ if (hasattr(self, "axes") and self.axes.name == '3d'
+ and mpl.rcParams['axes3d.automargin']):
+ # In mpl3.8, the margin was 1/48. Due to the change in automargin
+ # behavior in mpl3.9, we need to adjust this to compensate for a
+ # zoom factor of 2/48, giving us a 23/24 modifier. So the new
+ # margin is 0.019965277777777776 = 1/48*23/24.
+ margin = 0.019965277777777776
+ delta = view_high - view_low
+ view_high = view_high - delta * margin
+ view_low = view_low + delta * margin
+
+ interval_t = self.get_transform().transform([view_low, view_high])
+
+ ticks_to_draw = []
+ for tick in ticks:
+ try:
+ loc_t = self.get_transform().transform(tick.get_loc())
+ except AssertionError:
+ # transforms.transform doesn't allow masked values but
+ # some scales might make them, so we need this try/except.
+ pass
+ else:
+ if mtransforms._interval_contains_close(interval_t, loc_t):
+ ticks_to_draw.append(tick)
+
+ return ticks_to_draw
+
+ def _get_ticklabel_bboxes(self, ticks, renderer=None):
+ """Return lists of bboxes for ticks' label1's and label2's."""
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ return ([tick.label1.get_window_extent(renderer)
+ for tick in ticks if tick.label1.get_visible()],
+ [tick.label2.get_window_extent(renderer)
+ for tick in ticks if tick.label2.get_visible()])
+
+ def get_tightbbox(self, renderer=None, *, for_layout_only=False):
+ """
+ Return a bounding box that encloses the axis. It only accounts
+ tick labels, axis label, and offsetText.
+
+ If *for_layout_only* is True, then the width of the label (if this
+ is an x-axis) or the height of the label (if this is a y-axis) is
+ collapsed to near zero. This allows tight/constrained_layout to ignore
+ too-long labels when doing their layout.
+ """
+ if not self.get_visible() or for_layout_only and not self.get_in_layout():
+ return
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ ticks_to_draw = self._update_ticks()
+
+ self._update_label_position(renderer)
+
+ # go back to just this axis's tick labels
+ tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
+
+ self._update_offset_text_position(tlb1, tlb2)
+ self.offsetText.set_text(self.major.formatter.get_offset())
+
+ bboxes = [
+ *(a.get_window_extent(renderer)
+ for a in [self.offsetText]
+ if a.get_visible()),
+ *tlb1, *tlb2,
+ ]
+ # take care of label
+ if self.label.get_visible():
+ bb = self.label.get_window_extent(renderer)
+ # for constrained/tight_layout, we want to ignore the label's
+ # width/height because the adjustments they make can't be improved.
+ # this code collapses the relevant direction
+ if for_layout_only:
+ if self.axis_name == "x" and bb.width > 0:
+ bb.x0 = (bb.x0 + bb.x1) / 2 - 0.5
+ bb.x1 = bb.x0 + 1.0
+ if self.axis_name == "y" and bb.height > 0:
+ bb.y0 = (bb.y0 + bb.y1) / 2 - 0.5
+ bb.y1 = bb.y0 + 1.0
+ bboxes.append(bb)
+ bboxes = [b for b in bboxes
+ if 0 < b.width < np.inf and 0 < b.height < np.inf]
+ if bboxes:
+ return mtransforms.Bbox.union(bboxes)
+ else:
+ return None
+
+ def get_tick_padding(self):
+ values = []
+ if len(self.majorTicks):
+ values.append(self.majorTicks[0].get_tick_padding())
+ if len(self.minorTicks):
+ values.append(self.minorTicks[0].get_tick_padding())
+ return max(values, default=0)
+
+ @martist.allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+
+ if not self.get_visible():
+ return
+ renderer.open_group(__name__, gid=self.get_gid())
+
+ ticks_to_draw = self._update_ticks()
+ tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
+
+ for tick in ticks_to_draw:
+ tick.draw(renderer)
+
+ # Shift label away from axes to avoid overlapping ticklabels.
+ self._update_label_position(renderer)
+ self.label.draw(renderer)
+
+ self._update_offset_text_position(tlb1, tlb2)
+ self.offsetText.set_text(self.major.formatter.get_offset())
+ self.offsetText.draw(renderer)
+
+ renderer.close_group(__name__)
+ self.stale = False
+
+ def get_gridlines(self):
+ r"""Return this Axis' grid lines as a list of `.Line2D`\s."""
+ ticks = self.get_major_ticks()
+ return cbook.silent_list('Line2D gridline',
+ [tick.gridline for tick in ticks])
+
+ def set_label(self, s):
+ """Assigning legend labels is not supported. Raises RuntimeError."""
+ raise RuntimeError(
+ "A legend label cannot be assigned to an Axis. Did you mean to "
+ "set the axis label via set_label_text()?")
+
+ def get_label(self):
+ """
+ Return the axis label as a Text instance.
+
+ .. admonition:: Discouraged
+
+ This overrides `.Artist.get_label`, which is for legend labels, with a new
+ semantic. It is recommended to use the attribute ``Axis.label`` instead.
+ """
+ return self.label
+
+ def get_offset_text(self):
+ """Return the axis offsetText as a Text instance."""
+ return self.offsetText
+
+ def get_pickradius(self):
+ """Return the depth of the axis used by the picker."""
+ return self._pickradius
+
+ def get_majorticklabels(self):
+ """Return this Axis' major tick labels, as a list of `~.text.Text`."""
+ self._update_ticks()
+ ticks = self.get_major_ticks()
+ labels1 = [tick.label1 for tick in ticks if tick.label1.get_visible()]
+ labels2 = [tick.label2 for tick in ticks if tick.label2.get_visible()]
+ return labels1 + labels2
+
+ def get_minorticklabels(self):
+ """Return this Axis' minor tick labels, as a list of `~.text.Text`."""
+ self._update_ticks()
+ ticks = self.get_minor_ticks()
+ labels1 = [tick.label1 for tick in ticks if tick.label1.get_visible()]
+ labels2 = [tick.label2 for tick in ticks if tick.label2.get_visible()]
+ return labels1 + labels2
+
+ def get_ticklabels(self, minor=False, which=None):
+ """
+ Get this Axis' tick labels.
+
+ Parameters
+ ----------
+ minor : bool
+ Whether to return the minor or the major ticklabels.
+
+ which : None, ('minor', 'major', 'both')
+ Overrides *minor*.
+
+ Selects which ticklabels to return
+
+ Returns
+ -------
+ list of `~matplotlib.text.Text`
+ """
+ if which is not None:
+ if which == 'minor':
+ return self.get_minorticklabels()
+ elif which == 'major':
+ return self.get_majorticklabels()
+ elif which == 'both':
+ return self.get_majorticklabels() + self.get_minorticklabels()
+ else:
+ _api.check_in_list(['major', 'minor', 'both'], which=which)
+ if minor:
+ return self.get_minorticklabels()
+ return self.get_majorticklabels()
+
+ def get_majorticklines(self):
+ r"""Return this Axis' major tick lines as a list of `.Line2D`\s."""
+ lines = []
+ ticks = self.get_major_ticks()
+ for tick in ticks:
+ lines.append(tick.tick1line)
+ lines.append(tick.tick2line)
+ return cbook.silent_list('Line2D ticklines', lines)
+
+ def get_minorticklines(self):
+ r"""Return this Axis' minor tick lines as a list of `.Line2D`\s."""
+ lines = []
+ ticks = self.get_minor_ticks()
+ for tick in ticks:
+ lines.append(tick.tick1line)
+ lines.append(tick.tick2line)
+ return cbook.silent_list('Line2D ticklines', lines)
+
+ def get_ticklines(self, minor=False):
+ r"""Return this Axis' tick lines as a list of `.Line2D`\s."""
+ if minor:
+ return self.get_minorticklines()
+ return self.get_majorticklines()
+
+ def get_majorticklocs(self):
+ """Return this Axis' major tick locations in data coordinates."""
+ return self.major.locator()
+
+ def get_minorticklocs(self):
+ """Return this Axis' minor tick locations in data coordinates."""
+ # Remove minor ticks duplicating major ticks.
+ minor_locs = np.asarray(self.minor.locator())
+ if self.remove_overlapping_locs:
+ major_locs = self.major.locator()
+ transform = self._scale.get_transform()
+ tr_minor_locs = transform.transform(minor_locs)
+ tr_major_locs = transform.transform(major_locs)
+ lo, hi = sorted(transform.transform(self.get_view_interval()))
+ # Use the transformed view limits as scale. 1e-5 is the default
+ # rtol for np.isclose.
+ tol = (hi - lo) * 1e-5
+ mask = np.isclose(tr_minor_locs[:, None], tr_major_locs[None, :],
+ atol=tol, rtol=0).any(axis=1)
+ minor_locs = minor_locs[~mask]
+ return minor_locs
+
+ def get_ticklocs(self, *, minor=False):
+ """
+ Return this Axis' tick locations in data coordinates.
+
+ The locations are not clipped to the current axis limits and hence
+ may contain locations that are not visible in the output.
+
+ Parameters
+ ----------
+ minor : bool, default: False
+ True to return the minor tick directions,
+ False to return the major tick directions.
+
+ Returns
+ -------
+ array of tick locations
+ """
+ return self.get_minorticklocs() if minor else self.get_majorticklocs()
+
+ def get_ticks_direction(self, minor=False):
+ """
+ Return an array of this Axis' tick directions.
+
+ Parameters
+ ----------
+ minor : bool, default: False
+ True to return the minor tick directions,
+ False to return the major tick directions.
+
+ Returns
+ -------
+ array of tick directions
+ """
+ if minor:
+ return np.array(
+ [tick._tickdir for tick in self.get_minor_ticks()])
+ else:
+ return np.array(
+ [tick._tickdir for tick in self.get_major_ticks()])
+
+ def _get_tick(self, major):
+ """Return the default tick instance."""
+ if self._tick_class is None:
+ raise NotImplementedError(
+ f"The Axis subclass {self.__class__.__name__} must define "
+ "_tick_class or reimplement _get_tick()")
+ tick_kw = self._major_tick_kw if major else self._minor_tick_kw
+ return self._tick_class(self.axes, 0, major=major, **tick_kw)
+
+ def _get_tick_label_size(self, axis_name):
+ """
+ Return the text size of tick labels for this Axis.
+
+ This is a convenience function to avoid having to create a `Tick` in
+ `.get_tick_space`, since it is expensive.
+ """
+ tick_kw = self._major_tick_kw
+ size = tick_kw.get('labelsize',
+ mpl.rcParams[f'{axis_name}tick.labelsize'])
+ return mtext.FontProperties(size=size).get_size_in_points()
+
+ def _copy_tick_props(self, src, dest):
+ """Copy the properties from *src* tick to *dest* tick."""
+ if src is None or dest is None:
+ return
+ dest.label1.update_from(src.label1)
+ dest.label2.update_from(src.label2)
+ dest.tick1line.update_from(src.tick1line)
+ dest.tick2line.update_from(src.tick2line)
+ dest.gridline.update_from(src.gridline)
+ dest.update_from(src)
+ dest._loc = src._loc
+ dest._size = src._size
+ dest._width = src._width
+ dest._base_pad = src._base_pad
+ dest._labelrotation = src._labelrotation
+ dest._zorder = src._zorder
+ dest._tickdir = src._tickdir
+
+ def get_label_text(self):
+ """Get the text of the label."""
+ return self.label.get_text()
+
+ def get_major_locator(self):
+ """Get the locator of the major ticker."""
+ return self.major.locator
+
+ def get_minor_locator(self):
+ """Get the locator of the minor ticker."""
+ return self.minor.locator
+
+ def get_major_formatter(self):
+ """Get the formatter of the major ticker."""
+ return self.major.formatter
+
+ def get_minor_formatter(self):
+ """Get the formatter of the minor ticker."""
+ return self.minor.formatter
+
+ def get_major_ticks(self, numticks=None):
+ r"""
+ Return the list of major `.Tick`\s.
+
+ .. warning::
+
+ Ticks are not guaranteed to be persistent. Various operations
+ can create, delete and modify the Tick instances. There is an
+ imminent risk that changes to individual ticks will not
+ survive if you work on the figure further (including also
+ panning/zooming on a displayed figure).
+
+ Working on the individual ticks is a method of last resort.
+ Use `.set_tick_params` instead if possible.
+ """
+ if numticks is None:
+ numticks = len(self.get_majorticklocs())
+
+ while len(self.majorTicks) < numticks:
+ # Update the new tick label properties from the old.
+ tick = self._get_tick(major=True)
+ self.majorTicks.append(tick)
+ self._copy_tick_props(self.majorTicks[0], tick)
+
+ return self.majorTicks[:numticks]
+
+ def get_minor_ticks(self, numticks=None):
+ r"""
+ Return the list of minor `.Tick`\s.
+
+ .. warning::
+
+ Ticks are not guaranteed to be persistent. Various operations
+ can create, delete and modify the Tick instances. There is an
+ imminent risk that changes to individual ticks will not
+ survive if you work on the figure further (including also
+ panning/zooming on a displayed figure).
+
+ Working on the individual ticks is a method of last resort.
+ Use `.set_tick_params` instead if possible.
+ """
+ if numticks is None:
+ numticks = len(self.get_minorticklocs())
+
+ while len(self.minorTicks) < numticks:
+ # Update the new tick label properties from the old.
+ tick = self._get_tick(major=False)
+ self.minorTicks.append(tick)
+ self._copy_tick_props(self.minorTicks[0], tick)
+
+ return self.minorTicks[:numticks]
+
+ def grid(self, visible=None, which='major', **kwargs):
+ """
+ Configure the grid lines.
+
+ Parameters
+ ----------
+ visible : bool or None
+ Whether to show the grid lines. If any *kwargs* are supplied, it
+ is assumed you want the grid on and *visible* will be set to True.
+
+ If *visible* is *None* and there are no *kwargs*, this toggles the
+ visibility of the lines.
+
+ which : {'major', 'minor', 'both'}
+ The grid lines to apply the changes on.
+
+ **kwargs : `~matplotlib.lines.Line2D` properties
+ Define the line properties of the grid, e.g.::
+
+ grid(color='r', linestyle='-', linewidth=2)
+ """
+ if kwargs:
+ if visible is None:
+ visible = True
+ elif not visible: # something false-like but not None
+ _api.warn_external('First parameter to grid() is false, '
+ 'but line properties are supplied. The '
+ 'grid will be enabled.')
+ visible = True
+ which = which.lower()
+ _api.check_in_list(['major', 'minor', 'both'], which=which)
+ gridkw = {f'grid_{name}': value for name, value in kwargs.items()}
+ if which in ['minor', 'both']:
+ gridkw['gridOn'] = (not self._minor_tick_kw['gridOn']
+ if visible is None else visible)
+ self.set_tick_params(which='minor', **gridkw)
+ if which in ['major', 'both']:
+ gridkw['gridOn'] = (not self._major_tick_kw['gridOn']
+ if visible is None else visible)
+ self.set_tick_params(which='major', **gridkw)
+ self.stale = True
+
+ def update_units(self, data):
+ """
+ Introspect *data* for units converter and update the
+ ``axis.get_converter`` instance if necessary. Return *True*
+ if *data* is registered for unit conversion.
+ """
+ if not self._converter_is_explicit:
+ converter = munits.registry.get_converter(data)
+ else:
+ converter = self._converter
+
+ if converter is None:
+ return False
+
+ neednew = self._converter != converter
+ self._set_converter(converter)
+ default = self._converter.default_units(data, self)
+ if default is not None and self.units is None:
+ self.set_units(default)
+
+ elif neednew:
+ self._update_axisinfo()
+ self.stale = True
+ return True
+
+ def _update_axisinfo(self):
+ """
+ Check the axis converter for the stored units to see if the
+ axis info needs to be updated.
+ """
+ if self._converter is None:
+ return
+
+ info = self._converter.axisinfo(self.units, self)
+
+ if info is None:
+ return
+ if info.majloc is not None and \
+ self.major.locator != info.majloc and self.isDefault_majloc:
+ self.set_major_locator(info.majloc)
+ self.isDefault_majloc = True
+ if info.minloc is not None and \
+ self.minor.locator != info.minloc and self.isDefault_minloc:
+ self.set_minor_locator(info.minloc)
+ self.isDefault_minloc = True
+ if info.majfmt is not None and \
+ self.major.formatter != info.majfmt and self.isDefault_majfmt:
+ self.set_major_formatter(info.majfmt)
+ self.isDefault_majfmt = True
+ if info.minfmt is not None and \
+ self.minor.formatter != info.minfmt and self.isDefault_minfmt:
+ self.set_minor_formatter(info.minfmt)
+ self.isDefault_minfmt = True
+ if info.label is not None and self.isDefault_label:
+ self.set_label_text(info.label)
+ self.isDefault_label = True
+
+ self.set_default_intervals()
+
+ def have_units(self):
+ return self._converter is not None or self.units is not None
+
+ def convert_units(self, x):
+ # If x is natively supported by Matplotlib, doesn't need converting
+ if munits._is_natively_supported(x):
+ return x
+
+ if self._converter is None:
+ self._set_converter(munits.registry.get_converter(x))
+
+ if self._converter is None:
+ return x
+ try:
+ ret = self._converter.convert(x, self.units, self)
+ except Exception as e:
+ raise munits.ConversionError('Failed to convert value(s) to axis '
+ f'units: {x!r}') from e
+ return ret
+
+ def get_converter(self):
+ """
+ Get the unit converter for axis.
+
+ Returns
+ -------
+ `~matplotlib.units.ConversionInterface` or None
+ """
+ return self._converter
+
+ def set_converter(self, converter):
+ """
+ Set the unit converter for axis.
+
+ Parameters
+ ----------
+ converter : `~matplotlib.units.ConversionInterface`
+ """
+ self._set_converter(converter)
+ self._converter_is_explicit = True
+
+ def _set_converter(self, converter):
+ if self._converter is converter or self._converter == converter:
+ return
+ if self._converter_is_explicit:
+ raise RuntimeError("Axis already has an explicit converter set")
+ elif (
+ self._converter is not None and
+ not isinstance(converter, type(self._converter)) and
+ not isinstance(self._converter, type(converter))
+ ):
+ _api.warn_external(
+ "This axis already has a converter set and "
+ "is updating to a potentially incompatible converter"
+ )
+ self._converter = converter
+
+ def set_units(self, u):
+ """
+ Set the units for axis.
+
+ Parameters
+ ----------
+ u : units tag
+
+ Notes
+ -----
+ The units of any shared axis will also be updated.
+ """
+ if u == self.units:
+ return
+ for axis in self._get_shared_axis():
+ axis.units = u
+ axis._update_axisinfo()
+ axis.callbacks.process('units')
+ axis.stale = True
+
+ def get_units(self):
+ """Return the units for axis."""
+ return self.units
+
+ def set_label_text(self, label, fontdict=None, **kwargs):
+ """
+ Set the text value of the axis label.
+
+ Parameters
+ ----------
+ label : str
+ Text string.
+ fontdict : dict
+ Text properties.
+
+ .. admonition:: Discouraged
+
+ The use of *fontdict* is discouraged. Parameters should be passed as
+ individual keyword arguments or using dictionary-unpacking
+ ``set_label_text(..., **fontdict)``.
+
+ **kwargs
+ Merged into fontdict.
+ """
+ self.isDefault_label = False
+ self.label.set_text(label)
+ if fontdict is not None:
+ self.label.update(fontdict)
+ self.label.update(kwargs)
+ self.stale = True
+ return self.label
+
+ def set_major_formatter(self, formatter):
+ """
+ Set the formatter of the major ticker.
+
+ In addition to a `~matplotlib.ticker.Formatter` instance,
+ this also accepts a ``str`` or function.
+
+ For a ``str`` a `~matplotlib.ticker.StrMethodFormatter` is used.
+ The field used for the value must be labeled ``'x'`` and the field used
+ for the position must be labeled ``'pos'``.
+ See the `~matplotlib.ticker.StrMethodFormatter` documentation for
+ more information.
+
+ For a function, a `~matplotlib.ticker.FuncFormatter` is used.
+ The function must take two inputs (a tick value ``x`` and a
+ position ``pos``), and return a string containing the corresponding
+ tick label.
+ See the `~matplotlib.ticker.FuncFormatter` documentation for
+ more information.
+
+ Parameters
+ ----------
+ formatter : `~matplotlib.ticker.Formatter`, ``str``, or function
+ """
+ self._set_formatter(formatter, self.major)
+
+ def set_minor_formatter(self, formatter):
+ """
+ Set the formatter of the minor ticker.
+
+ In addition to a `~matplotlib.ticker.Formatter` instance,
+ this also accepts a ``str`` or function.
+ See `.Axis.set_major_formatter` for more information.
+
+ Parameters
+ ----------
+ formatter : `~matplotlib.ticker.Formatter`, ``str``, or function
+ """
+ self._set_formatter(formatter, self.minor)
+
+ def _set_formatter(self, formatter, level):
+ if isinstance(formatter, str):
+ formatter = mticker.StrMethodFormatter(formatter)
+ # Don't allow any other TickHelper to avoid easy-to-make errors,
+ # like using a Locator instead of a Formatter.
+ elif (callable(formatter) and
+ not isinstance(formatter, mticker.TickHelper)):
+ formatter = mticker.FuncFormatter(formatter)
+ else:
+ _api.check_isinstance(mticker.Formatter, formatter=formatter)
+
+ if (isinstance(formatter, mticker.FixedFormatter)
+ and len(formatter.seq) > 0
+ and not isinstance(level.locator, mticker.FixedLocator)):
+ _api.warn_external('FixedFormatter should only be used together '
+ 'with FixedLocator')
+
+ if level == self.major:
+ self.isDefault_majfmt = False
+ else:
+ self.isDefault_minfmt = False
+
+ level.formatter = formatter
+ formatter.set_axis(self)
+ self.stale = True
+
+ def set_major_locator(self, locator):
+ """
+ Set the locator of the major ticker.
+
+ Parameters
+ ----------
+ locator : `~matplotlib.ticker.Locator`
+ """
+ _api.check_isinstance(mticker.Locator, locator=locator)
+ self.isDefault_majloc = False
+ self.major.locator = locator
+ if self.major.formatter:
+ self.major.formatter._set_locator(locator)
+ locator.set_axis(self)
+ self.stale = True
+
+ def set_minor_locator(self, locator):
+ """
+ Set the locator of the minor ticker.
+
+ Parameters
+ ----------
+ locator : `~matplotlib.ticker.Locator`
+ """
+ _api.check_isinstance(mticker.Locator, locator=locator)
+ self.isDefault_minloc = False
+ self.minor.locator = locator
+ if self.minor.formatter:
+ self.minor.formatter._set_locator(locator)
+ locator.set_axis(self)
+ self.stale = True
+
+ def set_pickradius(self, pickradius):
+ """
+ Set the depth of the axis used by the picker.
+
+ Parameters
+ ----------
+ pickradius : float
+ The acceptance radius for containment tests.
+ See also `.Axis.contains`.
+ """
+ if not isinstance(pickradius, Real) or pickradius < 0:
+ raise ValueError("pick radius should be a distance")
+ self._pickradius = pickradius
+
+ pickradius = property(
+ get_pickradius, set_pickradius, doc="The acceptance radius for "
+ "containment tests. See also `.Axis.contains`.")
+
+ # Helper for set_ticklabels. Defining it here makes it picklable.
+ @staticmethod
+ def _format_with_dict(tickd, x, pos):
+ return tickd.get(x, "")
+
+ def set_ticklabels(self, labels, *, minor=False, fontdict=None, **kwargs):
+ r"""
+ [*Discouraged*] Set this Axis' tick labels with list of string labels.
+
+ .. admonition:: Discouraged
+
+ The use of this method is discouraged, because of the dependency on
+ tick positions. In most cases, you'll want to use
+ ``Axes.set_[x/y/z]ticks(positions, labels)`` or ``Axis.set_ticks``
+ instead.
+
+ If you are using this method, you should always fix the tick
+ positions before, e.g. by using `.Axis.set_ticks` or by explicitly
+ setting a `~.ticker.FixedLocator`. Otherwise, ticks are free to
+ move and the labels may end up in unexpected positions.
+
+ Parameters
+ ----------
+ labels : sequence of str or of `.Text`\s
+ Texts for labeling each tick location in the sequence set by
+ `.Axis.set_ticks`; the number of labels must match the number of locations.
+ The labels are used as is, via a `.FixedFormatter` (without further
+ formatting).
+
+ minor : bool
+ If True, set minor ticks instead of major ticks.
+
+ fontdict : dict, optional
+
+ .. admonition:: Discouraged
+
+ The use of *fontdict* is discouraged. Parameters should be passed as
+ individual keyword arguments or using dictionary-unpacking
+ ``set_ticklabels(..., **fontdict)``.
+
+ A dictionary controlling the appearance of the ticklabels.
+ The default *fontdict* is::
+
+ {'fontsize': rcParams['axes.titlesize'],
+ 'fontweight': rcParams['axes.titleweight'],
+ 'verticalalignment': 'baseline',
+ 'horizontalalignment': loc}
+
+ **kwargs
+ Text properties.
+
+ .. warning::
+
+ This only sets the properties of the current ticks, which is
+ only sufficient for static plots.
+
+ Ticks are not guaranteed to be persistent. Various operations
+ can create, delete and modify the Tick instances. There is an
+ imminent risk that these settings can get lost if you work on
+ the figure further (including also panning/zooming on a
+ displayed figure).
+
+ Use `.set_tick_params` instead if possible.
+
+ Returns
+ -------
+ list of `.Text`\s
+ For each tick, includes ``tick.label1`` if it is visible, then
+ ``tick.label2`` if it is visible, in that order.
+ """
+ try:
+ labels = [t.get_text() if hasattr(t, 'get_text') else t
+ for t in labels]
+ except TypeError:
+ raise TypeError(f"{labels:=} must be a sequence") from None
+ locator = (self.get_minor_locator() if minor
+ else self.get_major_locator())
+ if not labels:
+ # eg labels=[]:
+ formatter = mticker.NullFormatter()
+ elif isinstance(locator, mticker.FixedLocator):
+ # Passing [] as a list of labels is often used as a way to
+ # remove all tick labels, so only error for > 0 labels
+ if len(locator.locs) != len(labels) and len(labels) != 0:
+ raise ValueError(
+ "The number of FixedLocator locations"
+ f" ({len(locator.locs)}), usually from a call to"
+ " set_ticks, does not match"
+ f" the number of labels ({len(labels)}).")
+ tickd = {loc: lab for loc, lab in zip(locator.locs, labels)}
+ func = functools.partial(self._format_with_dict, tickd)
+ formatter = mticker.FuncFormatter(func)
+ else:
+ _api.warn_external(
+ "set_ticklabels() should only be used with a fixed number of "
+ "ticks, i.e. after set_ticks() or using a FixedLocator.")
+ formatter = mticker.FixedFormatter(labels)
+
+ with warnings.catch_warnings():
+ warnings.filterwarnings(
+ "ignore",
+ message="FixedFormatter should only be used together with FixedLocator")
+ if minor:
+ self.set_minor_formatter(formatter)
+ locs = self.get_minorticklocs()
+ ticks = self.get_minor_ticks(len(locs))
+ else:
+ self.set_major_formatter(formatter)
+ locs = self.get_majorticklocs()
+ ticks = self.get_major_ticks(len(locs))
+
+ ret = []
+ if fontdict is not None:
+ kwargs.update(fontdict)
+ for pos, (loc, tick) in enumerate(zip(locs, ticks)):
+ tick.update_position(loc)
+ tick_label = formatter(loc, pos)
+ # deal with label1
+ tick.label1.set_text(tick_label)
+ tick.label1._internal_update(kwargs)
+ # deal with label2
+ tick.label2.set_text(tick_label)
+ tick.label2._internal_update(kwargs)
+ # only return visible tick labels
+ if tick.label1.get_visible():
+ ret.append(tick.label1)
+ if tick.label2.get_visible():
+ ret.append(tick.label2)
+
+ self.stale = True
+ return ret
+
+ def _set_tick_locations(self, ticks, *, minor=False):
+ # see docstring of set_ticks
+
+ # XXX if the user changes units, the information will be lost here
+ ticks = self.convert_units(ticks)
+ locator = mticker.FixedLocator(ticks) # validate ticks early.
+ if len(ticks):
+ for axis in self._get_shared_axis():
+ # set_view_interval maintains any preexisting inversion.
+ axis.set_view_interval(min(ticks), max(ticks))
+ self.axes.stale = True
+ if minor:
+ self.set_minor_locator(locator)
+ return self.get_minor_ticks(len(ticks))
+ else:
+ self.set_major_locator(locator)
+ return self.get_major_ticks(len(ticks))
+
+ def set_ticks(self, ticks, labels=None, *, minor=False, **kwargs):
+ """
+ Set this Axis' tick locations and optionally tick labels.
+
+ If necessary, the view limits of the Axis are expanded so that all
+ given ticks are visible.
+
+ Parameters
+ ----------
+ ticks : 1D array-like
+ Array of tick locations (either floats or in axis units). The axis
+ `.Locator` is replaced by a `~.ticker.FixedLocator`.
+
+ Pass an empty list (``set_ticks([])``) to remove all ticks.
+
+ Some tick formatters will not label arbitrary tick positions;
+ e.g. log formatters only label decade ticks by default. In
+ such a case you can set a formatter explicitly on the axis
+ using `.Axis.set_major_formatter` or provide formatted
+ *labels* yourself.
+
+ labels : list of str, optional
+ Tick labels for each location in *ticks*; must have the same length as
+ *ticks*. If set, the labels are used as is, via a `.FixedFormatter`.
+ If not set, the labels are generated using the axis tick `.Formatter`.
+
+ minor : bool, default: False
+ If ``False``, set only the major ticks; if ``True``, only the minor ticks.
+
+ **kwargs
+ `.Text` properties for the labels. Using these is only allowed if
+ you pass *labels*. In other cases, please use `~.Axes.tick_params`.
+
+ Notes
+ -----
+ The mandatory expansion of the view limits is an intentional design
+ choice to prevent the surprise of a non-visible tick. If you need
+ other limits, you should set the limits explicitly after setting the
+ ticks.
+ """
+ if labels is None and kwargs:
+ first_key = next(iter(kwargs))
+ raise ValueError(
+ f"Incorrect use of keyword argument {first_key!r}. Keyword arguments "
+ "other than 'minor' modify the text labels and can only be used if "
+ "'labels' are passed as well.")
+ result = self._set_tick_locations(ticks, minor=minor)
+ if labels is not None:
+ self.set_ticklabels(labels, minor=minor, **kwargs)
+ return result
+
+ def _get_tick_boxes_siblings(self, renderer):
+ """
+ Get the bounding boxes for this `.axis` and its siblings
+ as set by `.Figure.align_xlabels` or `.Figure.align_ylabels`.
+
+ By default, it just gets bboxes for *self*.
+ """
+ # Get the Grouper keeping track of x or y label groups for this figure.
+ name = self._get_axis_name()
+ if name not in self.get_figure(root=False)._align_label_groups:
+ return [], []
+ grouper = self.get_figure(root=False)._align_label_groups[name]
+ bboxes = []
+ bboxes2 = []
+ # If we want to align labels from other Axes:
+ for ax in grouper.get_siblings(self.axes):
+ axis = ax._axis_map[name]
+ ticks_to_draw = axis._update_ticks()
+ tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
+ bboxes.extend(tlb)
+ bboxes2.extend(tlb2)
+ return bboxes, bboxes2
+
+ def _update_label_position(self, renderer):
+ """
+ Update the label position based on the bounding box enclosing
+ all the ticklabels and axis spine.
+ """
+ raise NotImplementedError('Derived must override')
+
+ def _update_offset_text_position(self, bboxes, bboxes2):
+ """
+ Update the offset text position based on the sequence of bounding
+ boxes of all the ticklabels.
+ """
+ raise NotImplementedError('Derived must override')
+
+ def axis_date(self, tz=None):
+ """
+ Set up axis ticks and labels to treat data along this Axis as dates.
+
+ Parameters
+ ----------
+ tz : str or `datetime.tzinfo`, default: :rc:`timezone`
+ The timezone used to create date labels.
+ """
+ # By providing a sample datetime instance with the desired timezone,
+ # the registered converter can be selected, and the "units" attribute,
+ # which is the timezone, can be set.
+ if isinstance(tz, str):
+ import dateutil.tz
+ tz = dateutil.tz.gettz(tz)
+ self.update_units(datetime.datetime(2009, 1, 1, 0, 0, 0, 0, tz))
+
+ def get_tick_space(self):
+ """Return the estimated number of ticks that can fit on the axis."""
+ # Must be overridden in the subclass
+ raise NotImplementedError()
+
+ def _get_ticks_position(self):
+ """
+ Helper for `XAxis.get_ticks_position` and `YAxis.get_ticks_position`.
+
+ Check the visibility of tick1line, label1, tick2line, and label2 on
+ the first major and the first minor ticks, and return
+
+ - 1 if only tick1line and label1 are visible (which corresponds to
+ "bottom" for the x-axis and "left" for the y-axis);
+ - 2 if only tick2line and label2 are visible (which corresponds to
+ "top" for the x-axis and "right" for the y-axis);
+ - "default" if only tick1line, tick2line and label1 are visible;
+ - "unknown" otherwise.
+ """
+ major = self.majorTicks[0]
+ minor = self.minorTicks[0]
+ if all(tick.tick1line.get_visible()
+ and not tick.tick2line.get_visible()
+ and tick.label1.get_visible()
+ and not tick.label2.get_visible()
+ for tick in [major, minor]):
+ return 1
+ elif all(tick.tick2line.get_visible()
+ and not tick.tick1line.get_visible()
+ and tick.label2.get_visible()
+ and not tick.label1.get_visible()
+ for tick in [major, minor]):
+ return 2
+ elif all(tick.tick1line.get_visible()
+ and tick.tick2line.get_visible()
+ and tick.label1.get_visible()
+ and not tick.label2.get_visible()
+ for tick in [major, minor]):
+ return "default"
+ else:
+ return "unknown"
+
+ def get_label_position(self):
+ """
+ Return the label position (top or bottom)
+ """
+ return self.label_position
+
+ def set_label_position(self, position):
+ """
+ Set the label position (top or bottom)
+
+ Parameters
+ ----------
+ position : {'top', 'bottom'}
+ """
+ raise NotImplementedError()
+
+ def get_minpos(self):
+ raise NotImplementedError()
+
+
+def _make_getset_interval(method_name, lim_name, attr_name):
+ """
+ Helper to generate ``get_{data,view}_interval`` and
+ ``set_{data,view}_interval`` implementations.
+ """
+
+ def getter(self):
+ # docstring inherited.
+ return getattr(getattr(self.axes, lim_name), attr_name)
+
+ def setter(self, vmin, vmax, ignore=False):
+ # docstring inherited.
+ if ignore:
+ setattr(getattr(self.axes, lim_name), attr_name, (vmin, vmax))
+ else:
+ oldmin, oldmax = getter(self)
+ if oldmin < oldmax:
+ setter(self, min(vmin, vmax, oldmin), max(vmin, vmax, oldmax),
+ ignore=True)
+ else:
+ setter(self, max(vmin, vmax, oldmin), min(vmin, vmax, oldmax),
+ ignore=True)
+ self.stale = True
+
+ getter.__name__ = f"get_{method_name}_interval"
+ setter.__name__ = f"set_{method_name}_interval"
+
+ return getter, setter
+
+
+class XAxis(Axis):
+ __name__ = 'xaxis'
+ axis_name = 'x' #: Read-only name identifying the axis.
+ _tick_class = XTick
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._init()
+
+ def _init(self):
+ """
+ Initialize the label and offsetText instance values and
+ `label_position` / `offset_text_position`.
+ """
+ # x in axes coords, y in display coords (to be updated at draw time by
+ # _update_label_positions and _update_offset_text_position).
+ self.label.set(
+ x=0.5, y=0,
+ verticalalignment='top', horizontalalignment='center',
+ transform=mtransforms.blended_transform_factory(
+ self.axes.transAxes, mtransforms.IdentityTransform()),
+ )
+ self.label_position = 'bottom'
+
+ if mpl.rcParams['xtick.labelcolor'] == 'inherit':
+ tick_color = mpl.rcParams['xtick.color']
+ else:
+ tick_color = mpl.rcParams['xtick.labelcolor']
+
+ self.offsetText.set(
+ x=1, y=0,
+ verticalalignment='top', horizontalalignment='right',
+ transform=mtransforms.blended_transform_factory(
+ self.axes.transAxes, mtransforms.IdentityTransform()),
+ fontsize=mpl.rcParams['xtick.labelsize'],
+ color=tick_color
+ )
+ self.offset_text_position = 'bottom'
+
+ def contains(self, mouseevent):
+ """Test whether the mouse event occurred in the x-axis."""
+ if self._different_canvas(mouseevent):
+ return False, {}
+ x, y = mouseevent.x, mouseevent.y
+ try:
+ trans = self.axes.transAxes.inverted()
+ xaxes, yaxes = trans.transform((x, y))
+ except ValueError:
+ return False, {}
+ (l, b), (r, t) = self.axes.transAxes.transform([(0, 0), (1, 1)])
+ inaxis = 0 <= xaxes <= 1 and (
+ b - self._pickradius < y < b or
+ t < y < t + self._pickradius)
+ return inaxis, {}
+
+ def set_label_position(self, position):
+ """
+ Set the label position (top or bottom)
+
+ Parameters
+ ----------
+ position : {'top', 'bottom'}
+ """
+ self.label.set_verticalalignment(_api.check_getitem({
+ 'top': 'baseline', 'bottom': 'top',
+ }, position=position))
+ self.label_position = position
+ self.stale = True
+
+ def _update_label_position(self, renderer):
+ """
+ Update the label position based on the bounding box enclosing
+ all the ticklabels and axis spine
+ """
+ if not self._autolabelpos:
+ return
+
+ # get bounding boxes for this axis and any siblings
+ # that have been set by `fig.align_xlabels()`
+ bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
+ x, y = self.label.get_position()
+
+ if self.label_position == 'bottom':
+ # Union with extents of the bottom spine if present, of the axes otherwise.
+ bbox = mtransforms.Bbox.union([
+ *bboxes, self.axes.spines.get("bottom", self.axes).get_window_extent()])
+ self.label.set_position(
+ (x, bbox.y0 - self.labelpad * self.get_figure(root=True).dpi / 72))
+ else:
+ # Union with extents of the top spine if present, of the axes otherwise.
+ bbox = mtransforms.Bbox.union([
+ *bboxes2, self.axes.spines.get("top", self.axes).get_window_extent()])
+ self.label.set_position(
+ (x, bbox.y1 + self.labelpad * self.get_figure(root=True).dpi / 72))
+
+ def _update_offset_text_position(self, bboxes, bboxes2):
+ """
+ Update the offset_text position based on the sequence of bounding
+ boxes of all the ticklabels
+ """
+ x, y = self.offsetText.get_position()
+ if not hasattr(self, '_tick_position'):
+ self._tick_position = 'bottom'
+ if self._tick_position == 'bottom':
+ if not len(bboxes):
+ bottom = self.axes.bbox.ymin
+ else:
+ bbox = mtransforms.Bbox.union(bboxes)
+ bottom = bbox.y0
+ y = bottom - self.OFFSETTEXTPAD * self.get_figure(root=True).dpi / 72
+ else:
+ if not len(bboxes2):
+ top = self.axes.bbox.ymax
+ else:
+ bbox = mtransforms.Bbox.union(bboxes2)
+ top = bbox.y1
+ y = top + self.OFFSETTEXTPAD * self.get_figure(root=True).dpi / 72
+ self.offsetText.set_position((x, y))
+
+ def set_ticks_position(self, position):
+ """
+ Set the ticks position.
+
+ Parameters
+ ----------
+ position : {'top', 'bottom', 'both', 'default', 'none'}
+ 'both' sets the ticks to appear on both positions, but does not
+ change the tick labels. 'default' resets the tick positions to
+ the default: ticks on both positions, labels at bottom. 'none'
+ can be used if you don't want any ticks. 'none' and 'both'
+ affect only the ticks, not the labels.
+ """
+ if position == 'top':
+ self.set_tick_params(which='both', top=True, labeltop=True,
+ bottom=False, labelbottom=False)
+ self._tick_position = 'top'
+ self.offsetText.set_verticalalignment('bottom')
+ elif position == 'bottom':
+ self.set_tick_params(which='both', top=False, labeltop=False,
+ bottom=True, labelbottom=True)
+ self._tick_position = 'bottom'
+ self.offsetText.set_verticalalignment('top')
+ elif position == 'both':
+ self.set_tick_params(which='both', top=True,
+ bottom=True)
+ elif position == 'none':
+ self.set_tick_params(which='both', top=False,
+ bottom=False)
+ elif position == 'default':
+ self.set_tick_params(which='both', top=True, labeltop=False,
+ bottom=True, labelbottom=True)
+ self._tick_position = 'bottom'
+ self.offsetText.set_verticalalignment('top')
+ else:
+ _api.check_in_list(['top', 'bottom', 'both', 'default', 'none'],
+ position=position)
+ self.stale = True
+
+ def tick_top(self):
+ """
+ Move ticks and ticklabels (if present) to the top of the Axes.
+ """
+ label = True
+ if 'label1On' in self._major_tick_kw:
+ label = (self._major_tick_kw['label1On']
+ or self._major_tick_kw['label2On'])
+ self.set_ticks_position('top')
+ # If labels were turned off before this was called, leave them off.
+ self.set_tick_params(which='both', labeltop=label)
+
+ def tick_bottom(self):
+ """
+ Move ticks and ticklabels (if present) to the bottom of the Axes.
+ """
+ label = True
+ if 'label1On' in self._major_tick_kw:
+ label = (self._major_tick_kw['label1On']
+ or self._major_tick_kw['label2On'])
+ self.set_ticks_position('bottom')
+ # If labels were turned off before this was called, leave them off.
+ self.set_tick_params(which='both', labelbottom=label)
+
+ def get_ticks_position(self):
+ """
+ Return the ticks position ("top", "bottom", "default", or "unknown").
+ """
+ return {1: "bottom", 2: "top",
+ "default": "default", "unknown": "unknown"}[
+ self._get_ticks_position()]
+
+ get_view_interval, set_view_interval = _make_getset_interval(
+ "view", "viewLim", "intervalx")
+ get_data_interval, set_data_interval = _make_getset_interval(
+ "data", "dataLim", "intervalx")
+
+ def get_minpos(self):
+ return self.axes.dataLim.minposx
+
+ def set_default_intervals(self):
+ # docstring inherited
+ # only change view if dataLim has not changed and user has
+ # not changed the view:
+ if (not self.axes.dataLim.mutatedx() and
+ not self.axes.viewLim.mutatedx()):
+ if self._converter is not None:
+ info = self._converter.axisinfo(self.units, self)
+ if info.default_limits is not None:
+ xmin, xmax = self.convert_units(info.default_limits)
+ self.axes.viewLim.intervalx = xmin, xmax
+ self.stale = True
+
+ def get_tick_space(self):
+ ends = mtransforms.Bbox.unit().transformed(
+ self.axes.transAxes - self.get_figure(root=False).dpi_scale_trans)
+ length = ends.width * 72
+ # There is a heuristic here that the aspect ratio of tick text
+ # is no more than 3:1
+ size = self._get_tick_label_size('x') * 3
+ if size > 0:
+ return int(np.floor(length / size))
+ else:
+ return 2**31 - 1
+
+
+class YAxis(Axis):
+ __name__ = 'yaxis'
+ axis_name = 'y' #: Read-only name identifying the axis.
+ _tick_class = YTick
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._init()
+
+ def _init(self):
+ """
+ Initialize the label and offsetText instance values and
+ `label_position` / `offset_text_position`.
+ """
+ # x in display coords, y in axes coords (to be updated at draw time by
+ # _update_label_positions and _update_offset_text_position).
+ self.label.set(
+ x=0, y=0.5,
+ verticalalignment='bottom', horizontalalignment='center',
+ rotation='vertical', rotation_mode='anchor',
+ transform=mtransforms.blended_transform_factory(
+ mtransforms.IdentityTransform(), self.axes.transAxes),
+ )
+ self.label_position = 'left'
+
+ if mpl.rcParams['ytick.labelcolor'] == 'inherit':
+ tick_color = mpl.rcParams['ytick.color']
+ else:
+ tick_color = mpl.rcParams['ytick.labelcolor']
+
+ # x in axes coords, y in display coords(!).
+ self.offsetText.set(
+ x=0, y=0.5,
+ verticalalignment='baseline', horizontalalignment='left',
+ transform=mtransforms.blended_transform_factory(
+ self.axes.transAxes, mtransforms.IdentityTransform()),
+ fontsize=mpl.rcParams['ytick.labelsize'],
+ color=tick_color
+ )
+ self.offset_text_position = 'left'
+
+ def contains(self, mouseevent):
+ # docstring inherited
+ if self._different_canvas(mouseevent):
+ return False, {}
+ x, y = mouseevent.x, mouseevent.y
+ try:
+ trans = self.axes.transAxes.inverted()
+ xaxes, yaxes = trans.transform((x, y))
+ except ValueError:
+ return False, {}
+ (l, b), (r, t) = self.axes.transAxes.transform([(0, 0), (1, 1)])
+ inaxis = 0 <= yaxes <= 1 and (
+ l - self._pickradius < x < l or
+ r < x < r + self._pickradius)
+ return inaxis, {}
+
+ def set_label_position(self, position):
+ """
+ Set the label position (left or right)
+
+ Parameters
+ ----------
+ position : {'left', 'right'}
+ """
+ self.label.set_rotation_mode('anchor')
+ self.label.set_verticalalignment(_api.check_getitem({
+ 'left': 'bottom', 'right': 'top',
+ }, position=position))
+ self.label_position = position
+ self.stale = True
+
+ def _update_label_position(self, renderer):
+ """
+ Update the label position based on the bounding box enclosing
+ all the ticklabels and axis spine
+ """
+ if not self._autolabelpos:
+ return
+
+ # get bounding boxes for this axis and any siblings
+ # that have been set by `fig.align_ylabels()`
+ bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
+ x, y = self.label.get_position()
+
+ if self.label_position == 'left':
+ # Union with extents of the left spine if present, of the axes otherwise.
+ bbox = mtransforms.Bbox.union([
+ *bboxes, self.axes.spines.get("left", self.axes).get_window_extent()])
+ self.label.set_position(
+ (bbox.x0 - self.labelpad * self.get_figure(root=True).dpi / 72, y))
+ else:
+ # Union with extents of the right spine if present, of the axes otherwise.
+ bbox = mtransforms.Bbox.union([
+ *bboxes2, self.axes.spines.get("right", self.axes).get_window_extent()])
+ self.label.set_position(
+ (bbox.x1 + self.labelpad * self.get_figure(root=True).dpi / 72, y))
+
+ def _update_offset_text_position(self, bboxes, bboxes2):
+ """
+ Update the offset_text position based on the sequence of bounding
+ boxes of all the ticklabels
+ """
+ x, _ = self.offsetText.get_position()
+ if 'outline' in self.axes.spines:
+ # Special case for colorbars:
+ bbox = self.axes.spines['outline'].get_window_extent()
+ else:
+ bbox = self.axes.bbox
+ top = bbox.ymax
+ self.offsetText.set_position(
+ (x, top + self.OFFSETTEXTPAD * self.get_figure(root=True).dpi / 72)
+ )
+
+ def set_offset_position(self, position):
+ """
+ Parameters
+ ----------
+ position : {'left', 'right'}
+ """
+ x, y = self.offsetText.get_position()
+ x = _api.check_getitem({'left': 0, 'right': 1}, position=position)
+
+ self.offsetText.set_ha(position)
+ self.offsetText.set_position((x, y))
+ self.stale = True
+
+ def set_ticks_position(self, position):
+ """
+ Set the ticks position.
+
+ Parameters
+ ----------
+ position : {'left', 'right', 'both', 'default', 'none'}
+ 'both' sets the ticks to appear on both positions, but does not
+ change the tick labels. 'default' resets the tick positions to
+ the default: ticks on both positions, labels at left. 'none'
+ can be used if you don't want any ticks. 'none' and 'both'
+ affect only the ticks, not the labels.
+ """
+ if position == 'right':
+ self.set_tick_params(which='both', right=True, labelright=True,
+ left=False, labelleft=False)
+ self.set_offset_position(position)
+ elif position == 'left':
+ self.set_tick_params(which='both', right=False, labelright=False,
+ left=True, labelleft=True)
+ self.set_offset_position(position)
+ elif position == 'both':
+ self.set_tick_params(which='both', right=True,
+ left=True)
+ elif position == 'none':
+ self.set_tick_params(which='both', right=False,
+ left=False)
+ elif position == 'default':
+ self.set_tick_params(which='both', right=True, labelright=False,
+ left=True, labelleft=True)
+ else:
+ _api.check_in_list(['left', 'right', 'both', 'default', 'none'],
+ position=position)
+ self.stale = True
+
+ def tick_right(self):
+ """
+ Move ticks and ticklabels (if present) to the right of the Axes.
+ """
+ label = True
+ if 'label1On' in self._major_tick_kw:
+ label = (self._major_tick_kw['label1On']
+ or self._major_tick_kw['label2On'])
+ self.set_ticks_position('right')
+ # if labels were turned off before this was called
+ # leave them off
+ self.set_tick_params(which='both', labelright=label)
+
+ def tick_left(self):
+ """
+ Move ticks and ticklabels (if present) to the left of the Axes.
+ """
+ label = True
+ if 'label1On' in self._major_tick_kw:
+ label = (self._major_tick_kw['label1On']
+ or self._major_tick_kw['label2On'])
+ self.set_ticks_position('left')
+ # if labels were turned off before this was called
+ # leave them off
+ self.set_tick_params(which='both', labelleft=label)
+
+ def get_ticks_position(self):
+ """
+ Return the ticks position ("left", "right", "default", or "unknown").
+ """
+ return {1: "left", 2: "right",
+ "default": "default", "unknown": "unknown"}[
+ self._get_ticks_position()]
+
+ get_view_interval, set_view_interval = _make_getset_interval(
+ "view", "viewLim", "intervaly")
+ get_data_interval, set_data_interval = _make_getset_interval(
+ "data", "dataLim", "intervaly")
+
+ def get_minpos(self):
+ return self.axes.dataLim.minposy
+
+ def set_default_intervals(self):
+ # docstring inherited
+ # only change view if dataLim has not changed and user has
+ # not changed the view:
+ if (not self.axes.dataLim.mutatedy() and
+ not self.axes.viewLim.mutatedy()):
+ if self._converter is not None:
+ info = self._converter.axisinfo(self.units, self)
+ if info.default_limits is not None:
+ ymin, ymax = self.convert_units(info.default_limits)
+ self.axes.viewLim.intervaly = ymin, ymax
+ self.stale = True
+
+ def get_tick_space(self):
+ ends = mtransforms.Bbox.unit().transformed(
+ self.axes.transAxes - self.get_figure(root=False).dpi_scale_trans)
+ length = ends.height * 72
+ # Having a spacing of at least 2 just looks good.
+ size = self._get_tick_label_size('y') * 2
+ if size > 0:
+ return int(np.floor(length / size))
+ else:
+ return 2**31 - 1
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axis.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axis.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..f2c5b1fc586d5a33237ace5ec264b6f6fde49080
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/axis.pyi
@@ -0,0 +1,280 @@
+from collections.abc import Callable, Iterable, Sequence
+import datetime
+from typing import Any, Literal, overload
+from typing_extensions import Self # < Py 3.11
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+import matplotlib.artist as martist
+from matplotlib import cbook
+from matplotlib.axes import Axes
+from matplotlib.backend_bases import RendererBase
+from matplotlib.lines import Line2D
+from matplotlib.text import Text
+from matplotlib.ticker import Locator, Formatter
+from matplotlib.transforms import Transform, Bbox
+from matplotlib.typing import ColorType
+from matplotlib.units import ConversionInterface
+
+
+GRIDLINE_INTERPOLATION_STEPS: int
+
+class Tick(martist.Artist):
+ axes: Axes
+ tick1line: Line2D
+ tick2line: Line2D
+ gridline: Line2D
+ label1: Text
+ label2: Text
+ def __init__(
+ self,
+ axes: Axes,
+ loc: float,
+ *,
+ size: float | None = ...,
+ width: float | None = ...,
+ color: ColorType | None = ...,
+ tickdir: Literal["in", "inout", "out"] | None = ...,
+ pad: float | None = ...,
+ labelsize: float | None = ...,
+ labelcolor: ColorType | None = ...,
+ labelfontfamily: str | Sequence[str] | None = ...,
+ zorder: float | None = ...,
+ gridOn: bool | None = ...,
+ tick1On: bool = ...,
+ tick2On: bool = ...,
+ label1On: bool = ...,
+ label2On: bool = ...,
+ major: bool = ...,
+ labelrotation: float = ...,
+ grid_color: ColorType | None = ...,
+ grid_linestyle: str | None = ...,
+ grid_linewidth: float | None = ...,
+ grid_alpha: float | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_tickdir(self) -> Literal["in", "inout", "out"]: ...
+ def get_tick_padding(self) -> float: ...
+ def get_children(self) -> list[martist.Artist]: ...
+ stale: bool
+ def set_pad(self, val: float) -> None: ...
+ def get_pad(self) -> None: ...
+ def get_loc(self) -> float: ...
+ def set_url(self, url: str | None) -> None: ...
+ def get_view_interval(self) -> ArrayLike: ...
+ def update_position(self, loc: float) -> None: ...
+
+class XTick(Tick):
+ __name__: str
+ def __init__(self, *args, **kwargs) -> None: ...
+ stale: bool
+ def update_position(self, loc: float) -> None: ...
+ def get_view_interval(self) -> np.ndarray: ...
+
+class YTick(Tick):
+ __name__: str
+ def __init__(self, *args, **kwargs) -> None: ...
+ stale: bool
+ def update_position(self, loc: float) -> None: ...
+ def get_view_interval(self) -> np.ndarray: ...
+
+class Ticker:
+ def __init__(self) -> None: ...
+ @property
+ def locator(self) -> Locator | None: ...
+ @locator.setter
+ def locator(self, locator: Locator) -> None: ...
+ @property
+ def formatter(self) -> Formatter | None: ...
+ @formatter.setter
+ def formatter(self, formatter: Formatter) -> None: ...
+
+class _LazyTickList:
+ def __init__(self, major: bool) -> None: ...
+ @overload
+ def __get__(self, instance: None, owner: None) -> Self: ...
+ @overload
+ def __get__(self, instance: Axis, owner: type[Axis]) -> list[Tick]: ...
+
+class Axis(martist.Artist):
+ OFFSETTEXTPAD: int
+ isDefault_label: bool
+ axes: Axes
+ major: Ticker
+ minor: Ticker
+ callbacks: cbook.CallbackRegistry
+ label: Text
+ offsetText: Text
+ labelpad: float
+ pickradius: float
+ def __init__(self, axes, *, pickradius: float = ...,
+ clear: bool = ...) -> None: ...
+ @property
+ def isDefault_majloc(self) -> bool: ...
+ @isDefault_majloc.setter
+ def isDefault_majloc(self, value: bool) -> None: ...
+ @property
+ def isDefault_majfmt(self) -> bool: ...
+ @isDefault_majfmt.setter
+ def isDefault_majfmt(self, value: bool) -> None: ...
+ @property
+ def isDefault_minloc(self) -> bool: ...
+ @isDefault_minloc.setter
+ def isDefault_minloc(self, value: bool) -> None: ...
+ @property
+ def isDefault_minfmt(self) -> bool: ...
+ @isDefault_minfmt.setter
+ def isDefault_minfmt(self, value: bool) -> None: ...
+ majorTicks: _LazyTickList
+ minorTicks: _LazyTickList
+ def get_remove_overlapping_locs(self) -> bool: ...
+ def set_remove_overlapping_locs(self, val: bool) -> None: ...
+ @property
+ def remove_overlapping_locs(self) -> bool: ...
+ @remove_overlapping_locs.setter
+ def remove_overlapping_locs(self, val: bool) -> None: ...
+ stale: bool
+ def set_label_coords(
+ self, x: float, y: float, transform: Transform | None = ...
+ ) -> None: ...
+ def get_transform(self) -> Transform: ...
+ def get_scale(self) -> str: ...
+ def limit_range_for_scale(
+ self, vmin: float, vmax: float
+ ) -> tuple[float, float]: ...
+ def get_children(self) -> list[martist.Artist]: ...
+ # TODO units
+ converter: Any
+ units: Any
+ def clear(self) -> None: ...
+ def reset_ticks(self) -> None: ...
+ def minorticks_on(self) -> None: ...
+ def minorticks_off(self) -> None: ...
+ def set_tick_params(
+ self,
+ which: Literal["major", "minor", "both"] = ...,
+ reset: bool = ...,
+ **kwargs
+ ) -> None: ...
+ def get_tick_params(
+ self, which: Literal["major", "minor"] = ...
+ ) -> dict[str, Any]: ...
+ def get_view_interval(self) -> tuple[float, float]: ...
+ def set_view_interval(
+ self, vmin: float, vmax: float, ignore: bool = ...
+ ) -> None: ...
+ def get_data_interval(self) -> tuple[float, float]: ...
+ def set_data_interval(
+ self, vmin: float, vmax: float, ignore: bool = ...
+ ) -> None: ...
+ def get_inverted(self) -> bool: ...
+ def set_inverted(self, inverted: bool) -> None: ...
+ def set_default_intervals(self) -> None: ...
+ def get_tightbbox(
+ self, renderer: RendererBase | None = ..., *, for_layout_only: bool = ...
+ ) -> Bbox | None: ...
+ def get_tick_padding(self) -> float: ...
+ def get_gridlines(self) -> list[Line2D]: ...
+ def get_label(self) -> Text: ...
+ def get_offset_text(self) -> Text: ...
+ def get_pickradius(self) -> float: ...
+ def get_majorticklabels(self) -> list[Text]: ...
+ def get_minorticklabels(self) -> list[Text]: ...
+ def get_ticklabels(
+ self, minor: bool = ..., which: Literal["major", "minor", "both"] | None = ...
+ ) -> list[Text]: ...
+ def get_majorticklines(self) -> list[Line2D]: ...
+ def get_minorticklines(self) -> list[Line2D]: ...
+ def get_ticklines(self, minor: bool = ...) -> list[Line2D]: ...
+ def get_majorticklocs(self) -> np.ndarray: ...
+ def get_minorticklocs(self) -> np.ndarray: ...
+ def get_ticklocs(self, *, minor: bool = ...) -> np.ndarray: ...
+ def get_ticks_direction(self, minor: bool = ...) -> np.ndarray: ...
+ def get_label_text(self) -> str: ...
+ def get_major_locator(self) -> Locator: ...
+ def get_minor_locator(self) -> Locator: ...
+ def get_major_formatter(self) -> Formatter: ...
+ def get_minor_formatter(self) -> Formatter: ...
+ def get_major_ticks(self, numticks: int | None = ...) -> list[Tick]: ...
+ def get_minor_ticks(self, numticks: int | None = ...) -> list[Tick]: ...
+ def grid(
+ self,
+ visible: bool | None = ...,
+ which: Literal["major", "minor", "both"] = ...,
+ **kwargs
+ ) -> None: ...
+ # TODO units
+ def update_units(self, data): ...
+ def have_units(self) -> bool: ...
+ def convert_units(self, x): ...
+ def get_converter(self) -> ConversionInterface | None: ...
+ def set_converter(self, converter: ConversionInterface) -> None: ...
+ def set_units(self, u) -> None: ...
+ def get_units(self): ...
+ def set_label_text(
+ self, label: str, fontdict: dict[str, Any] | None = ..., **kwargs
+ ) -> Text: ...
+ def set_major_formatter(
+ self, formatter: Formatter | str | Callable[[float, float], str]
+ ) -> None: ...
+ def set_minor_formatter(
+ self, formatter: Formatter | str | Callable[[float, float], str]
+ ) -> None: ...
+ def set_major_locator(self, locator: Locator) -> None: ...
+ def set_minor_locator(self, locator: Locator) -> None: ...
+ def set_pickradius(self, pickradius: float) -> None: ...
+ def set_ticklabels(
+ self,
+ labels: Iterable[str | Text],
+ *,
+ minor: bool = ...,
+ fontdict: dict[str, Any] | None = ...,
+ **kwargs
+ ) -> list[Text]: ...
+ def set_ticks(
+ self,
+ ticks: ArrayLike,
+ labels: Iterable[str] | None = ...,
+ *,
+ minor: bool = ...,
+ **kwargs
+ ) -> list[Tick]: ...
+ def axis_date(self, tz: str | datetime.tzinfo | None = ...) -> None: ...
+ def get_tick_space(self) -> int: ...
+ def get_label_position(self) -> Literal["top", "bottom"]: ...
+ def set_label_position(
+ self, position: Literal["top", "bottom", "left", "right"]
+ ) -> None: ...
+ def get_minpos(self) -> float: ...
+
+class XAxis(Axis):
+ __name__: str
+ axis_name: str
+ def __init__(self, *args, **kwargs) -> None: ...
+ label_position: Literal["bottom", "top"]
+ stale: bool
+ def set_label_position(self, position: Literal["bottom", "top"]) -> None: ... # type: ignore[override]
+ def set_ticks_position(
+ self, position: Literal["top", "bottom", "both", "default", "none"]
+ ) -> None: ...
+ def tick_top(self) -> None: ...
+ def tick_bottom(self) -> None: ...
+ def get_ticks_position(self) -> Literal["top", "bottom", "default", "unknown"]: ...
+ def get_tick_space(self) -> int: ...
+
+class YAxis(Axis):
+ __name__: str
+ axis_name: str
+ def __init__(self, *args, **kwargs) -> None: ...
+ label_position: Literal["left", "right"]
+ stale: bool
+ def set_label_position(self, position: Literal["left", "right"]) -> None: ... # type: ignore[override]
+ def set_offset_position(self, position: Literal["left", "right"]) -> None: ...
+ def set_ticks_position(
+ self, position: Literal["left", "right", "both", "default", "none"]
+ ) -> None: ...
+ def tick_right(self) -> None: ...
+ def tick_left(self) -> None: ...
+ def get_ticks_position(self) -> Literal["left", "right", "default", "unknown"]: ...
+ def get_tick_space(self) -> int: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_bases.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_bases.py
new file mode 100644
index 0000000000000000000000000000000000000000..a889a6b26e8e64e8f30e91ad2f66bdf2ff7c05d6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_bases.py
@@ -0,0 +1,3583 @@
+"""
+Abstract base classes define the primitives that renderers and
+graphics contexts must implement to serve as a Matplotlib backend.
+
+`RendererBase`
+ An abstract base class to handle drawing/rendering operations.
+
+`FigureCanvasBase`
+ The abstraction layer that separates the `.Figure` from the backend
+ specific details like a user interface drawing area.
+
+`GraphicsContextBase`
+ An abstract base class that provides color, line styles, etc.
+
+`Event`
+ The base class for all of the Matplotlib event handling. Derived classes
+ such as `KeyEvent` and `MouseEvent` store the meta data like keys and
+ buttons pressed, x and y locations in pixel and `~.axes.Axes` coordinates.
+
+`ShowBase`
+ The base class for the ``Show`` class of each interactive backend; the
+ 'show' callable is then set to ``Show.__call__``.
+
+`ToolContainerBase`
+ The base class for the Toolbar class of each interactive backend.
+"""
+
+from collections import namedtuple
+from contextlib import ExitStack, contextmanager, nullcontext
+from enum import Enum, IntEnum
+import functools
+import importlib
+import inspect
+import io
+import itertools
+import logging
+import os
+import pathlib
+import signal
+import socket
+import sys
+import time
+import weakref
+from weakref import WeakKeyDictionary
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import (
+ _api, backend_tools as tools, cbook, colors, _docstring, text,
+ _tight_bbox, transforms, widgets, is_interactive, rcParams)
+from matplotlib._pylab_helpers import Gcf
+from matplotlib.backend_managers import ToolManager
+from matplotlib.cbook import _setattr_cm
+from matplotlib.layout_engine import ConstrainedLayoutEngine
+from matplotlib.path import Path
+from matplotlib.texmanager import TexManager
+from matplotlib.transforms import Affine2D
+from matplotlib._enums import JoinStyle, CapStyle
+
+
+_log = logging.getLogger(__name__)
+_default_filetypes = {
+ 'eps': 'Encapsulated Postscript',
+ 'jpg': 'Joint Photographic Experts Group',
+ 'jpeg': 'Joint Photographic Experts Group',
+ 'pdf': 'Portable Document Format',
+ 'pgf': 'PGF code for LaTeX',
+ 'png': 'Portable Network Graphics',
+ 'ps': 'Postscript',
+ 'raw': 'Raw RGBA bitmap',
+ 'rgba': 'Raw RGBA bitmap',
+ 'svg': 'Scalable Vector Graphics',
+ 'svgz': 'Scalable Vector Graphics',
+ 'tif': 'Tagged Image File Format',
+ 'tiff': 'Tagged Image File Format',
+ 'webp': 'WebP Image Format',
+}
+_default_backends = {
+ 'eps': 'matplotlib.backends.backend_ps',
+ 'jpg': 'matplotlib.backends.backend_agg',
+ 'jpeg': 'matplotlib.backends.backend_agg',
+ 'pdf': 'matplotlib.backends.backend_pdf',
+ 'pgf': 'matplotlib.backends.backend_pgf',
+ 'png': 'matplotlib.backends.backend_agg',
+ 'ps': 'matplotlib.backends.backend_ps',
+ 'raw': 'matplotlib.backends.backend_agg',
+ 'rgba': 'matplotlib.backends.backend_agg',
+ 'svg': 'matplotlib.backends.backend_svg',
+ 'svgz': 'matplotlib.backends.backend_svg',
+ 'tif': 'matplotlib.backends.backend_agg',
+ 'tiff': 'matplotlib.backends.backend_agg',
+ 'webp': 'matplotlib.backends.backend_agg',
+}
+
+
+def register_backend(format, backend, description=None):
+ """
+ Register a backend for saving to a given file format.
+
+ Parameters
+ ----------
+ format : str
+ File extension
+ backend : module string or canvas class
+ Backend for handling file output
+ description : str, default: ""
+ Description of the file type.
+ """
+ if description is None:
+ description = ''
+ _default_backends[format] = backend
+ _default_filetypes[format] = description
+
+
+def get_registered_canvas_class(format):
+ """
+ Return the registered default canvas for given file format.
+ Handles deferred import of required backend.
+ """
+ if format not in _default_backends:
+ return None
+ backend_class = _default_backends[format]
+ if isinstance(backend_class, str):
+ backend_class = importlib.import_module(backend_class).FigureCanvas
+ _default_backends[format] = backend_class
+ return backend_class
+
+
+class RendererBase:
+ """
+ An abstract base class to handle drawing/rendering operations.
+
+ The following methods must be implemented in the backend for full
+ functionality (though just implementing `draw_path` alone would give a
+ highly capable backend):
+
+ * `draw_path`
+ * `draw_image`
+ * `draw_gouraud_triangles`
+
+ The following methods *should* be implemented in the backend for
+ optimization reasons:
+
+ * `draw_text`
+ * `draw_markers`
+ * `draw_path_collection`
+ * `draw_quad_mesh`
+ """
+ def __init__(self):
+ super().__init__()
+ self._texmanager = None
+ self._text2path = text.TextToPath()
+ self._raster_depth = 0
+ self._rasterizing = False
+
+ def open_group(self, s, gid=None):
+ """
+ Open a grouping element with label *s* and *gid* (if set) as id.
+
+ Only used by the SVG renderer.
+ """
+
+ def close_group(self, s):
+ """
+ Close a grouping element with label *s*.
+
+ Only used by the SVG renderer.
+ """
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ """Draw a `~.path.Path` instance using the given affine transform."""
+ raise NotImplementedError
+
+ def draw_markers(self, gc, marker_path, marker_trans, path,
+ trans, rgbFace=None):
+ """
+ Draw a marker at each of *path*'s vertices (excluding control points).
+
+ The base (fallback) implementation makes multiple calls to `draw_path`.
+ Backends may want to override this method in order to draw the marker
+ only once and reuse it multiple times.
+
+ Parameters
+ ----------
+ gc : `.GraphicsContextBase`
+ The graphics context.
+ marker_path : `~matplotlib.path.Path`
+ The path for the marker.
+ marker_trans : `~matplotlib.transforms.Transform`
+ An affine transform applied to the marker.
+ path : `~matplotlib.path.Path`
+ The locations to draw the markers.
+ trans : `~matplotlib.transforms.Transform`
+ An affine transform applied to the path.
+ rgbFace : :mpltype:`color`, optional
+ """
+ for vertices, codes in path.iter_segments(trans, simplify=False):
+ if len(vertices):
+ x, y = vertices[-2:]
+ self.draw_path(gc, marker_path,
+ marker_trans +
+ transforms.Affine2D().translate(x, y),
+ rgbFace)
+
+ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
+ offsets, offset_trans, facecolors, edgecolors,
+ linewidths, linestyles, antialiaseds, urls,
+ offset_position):
+ """
+ Draw a collection of *paths*.
+
+ Each path is first transformed by the corresponding entry
+ in *all_transforms* (a list of (3, 3) matrices) and then by
+ *master_transform*. They are then translated by the corresponding
+ entry in *offsets*, which has been first transformed by *offset_trans*.
+
+ *facecolors*, *edgecolors*, *linewidths*, *linestyles*, and
+ *antialiased* are lists that set the corresponding properties.
+
+ *offset_position* is unused now, but the argument is kept for
+ backwards compatibility.
+
+ The base (fallback) implementation makes multiple calls to `draw_path`.
+ Backends may want to override this in order to render each set of
+ path data only once, and then reference that path multiple times with
+ the different offsets, colors, styles etc. The generator methods
+ `_iter_collection_raw_paths` and `_iter_collection` are provided to
+ help with (and standardize) the implementation across backends. It
+ is highly recommended to use those generators, so that changes to the
+ behavior of `draw_path_collection` can be made globally.
+ """
+ path_ids = self._iter_collection_raw_paths(master_transform,
+ paths, all_transforms)
+
+ for xo, yo, path_id, gc0, rgbFace in self._iter_collection(
+ gc, list(path_ids), offsets, offset_trans,
+ facecolors, edgecolors, linewidths, linestyles,
+ antialiaseds, urls, offset_position):
+ path, transform = path_id
+ # Only apply another translation if we have an offset, else we
+ # reuse the initial transform.
+ if xo != 0 or yo != 0:
+ # The transformation can be used by multiple paths. Since
+ # translate is a inplace operation, we need to copy the
+ # transformation by .frozen() before applying the translation.
+ transform = transform.frozen()
+ transform.translate(xo, yo)
+ self.draw_path(gc0, path, transform, rgbFace)
+
+ def draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight,
+ coordinates, offsets, offsetTrans, facecolors,
+ antialiased, edgecolors):
+ """
+ Draw a quadmesh.
+
+ The base (fallback) implementation converts the quadmesh to paths and
+ then calls `draw_path_collection`.
+ """
+
+ from matplotlib.collections import QuadMesh
+ paths = QuadMesh._convert_mesh_to_paths(coordinates)
+
+ if edgecolors is None:
+ edgecolors = facecolors
+ linewidths = np.array([gc.get_linewidth()], float)
+
+ return self.draw_path_collection(
+ gc, master_transform, paths, [], offsets, offsetTrans, facecolors,
+ edgecolors, linewidths, [], [antialiased], [None], 'screen')
+
+ def draw_gouraud_triangles(self, gc, triangles_array, colors_array,
+ transform):
+ """
+ Draw a series of Gouraud triangles.
+
+ Parameters
+ ----------
+ gc : `.GraphicsContextBase`
+ The graphics context.
+ triangles_array : (N, 3, 2) array-like
+ Array of *N* (x, y) points for the triangles.
+ colors_array : (N, 3, 4) array-like
+ Array of *N* RGBA colors for each point of the triangles.
+ transform : `~matplotlib.transforms.Transform`
+ An affine transform to apply to the points.
+ """
+ raise NotImplementedError
+
+ def _iter_collection_raw_paths(self, master_transform, paths,
+ all_transforms):
+ """
+ Helper method (along with `_iter_collection`) to implement
+ `draw_path_collection` in a memory-efficient manner.
+
+ This method yields all of the base path/transform combinations, given a
+ master transform, a list of paths and list of transforms.
+
+ The arguments should be exactly what is passed in to
+ `draw_path_collection`.
+
+ The backend should take each yielded path and transform and create an
+ object that can be referenced (reused) later.
+ """
+ Npaths = len(paths)
+ Ntransforms = len(all_transforms)
+ N = max(Npaths, Ntransforms)
+
+ if Npaths == 0:
+ return
+
+ transform = transforms.IdentityTransform()
+ for i in range(N):
+ path = paths[i % Npaths]
+ if Ntransforms:
+ transform = Affine2D(all_transforms[i % Ntransforms])
+ yield path, transform + master_transform
+
+ def _iter_collection_uses_per_path(self, paths, all_transforms,
+ offsets, facecolors, edgecolors):
+ """
+ Compute how many times each raw path object returned by
+ `_iter_collection_raw_paths` would be used when calling
+ `_iter_collection`. This is intended for the backend to decide
+ on the tradeoff between using the paths in-line and storing
+ them once and reusing. Rounds up in case the number of uses
+ is not the same for every path.
+ """
+ Npaths = len(paths)
+ if Npaths == 0 or len(facecolors) == len(edgecolors) == 0:
+ return 0
+ Npath_ids = max(Npaths, len(all_transforms))
+ N = max(Npath_ids, len(offsets))
+ return (N + Npath_ids - 1) // Npath_ids
+
+ def _iter_collection(self, gc, path_ids, offsets, offset_trans, facecolors,
+ edgecolors, linewidths, linestyles,
+ antialiaseds, urls, offset_position):
+ """
+ Helper method (along with `_iter_collection_raw_paths`) to implement
+ `draw_path_collection` in a memory-efficient manner.
+
+ This method yields all of the path, offset and graphics context
+ combinations to draw the path collection. The caller should already
+ have looped over the results of `_iter_collection_raw_paths` to draw
+ this collection.
+
+ The arguments should be the same as that passed into
+ `draw_path_collection`, with the exception of *path_ids*, which is a
+ list of arbitrary objects that the backend will use to reference one of
+ the paths created in the `_iter_collection_raw_paths` stage.
+
+ Each yielded result is of the form::
+
+ xo, yo, path_id, gc, rgbFace
+
+ where *xo*, *yo* is an offset; *path_id* is one of the elements of
+ *path_ids*; *gc* is a graphics context and *rgbFace* is a color to
+ use for filling the path.
+ """
+ Npaths = len(path_ids)
+ Noffsets = len(offsets)
+ N = max(Npaths, Noffsets)
+ Nfacecolors = len(facecolors)
+ Nedgecolors = len(edgecolors)
+ Nlinewidths = len(linewidths)
+ Nlinestyles = len(linestyles)
+ Nurls = len(urls)
+
+ if (Nfacecolors == 0 and Nedgecolors == 0) or Npaths == 0:
+ return
+
+ gc0 = self.new_gc()
+ gc0.copy_properties(gc)
+
+ def cycle_or_default(seq, default=None):
+ # Cycle over *seq* if it is not empty; else always yield *default*.
+ return (itertools.cycle(seq) if len(seq)
+ else itertools.repeat(default))
+
+ pathids = cycle_or_default(path_ids)
+ toffsets = cycle_or_default(offset_trans.transform(offsets), (0, 0))
+ fcs = cycle_or_default(facecolors)
+ ecs = cycle_or_default(edgecolors)
+ lws = cycle_or_default(linewidths)
+ lss = cycle_or_default(linestyles)
+ aas = cycle_or_default(antialiaseds)
+ urls = cycle_or_default(urls)
+
+ if Nedgecolors == 0:
+ gc0.set_linewidth(0.0)
+
+ for pathid, (xo, yo), fc, ec, lw, ls, aa, url in itertools.islice(
+ zip(pathids, toffsets, fcs, ecs, lws, lss, aas, urls), N):
+ if not (np.isfinite(xo) and np.isfinite(yo)):
+ continue
+ if Nedgecolors:
+ if Nlinewidths:
+ gc0.set_linewidth(lw)
+ if Nlinestyles:
+ gc0.set_dashes(*ls)
+ if len(ec) == 4 and ec[3] == 0.0:
+ gc0.set_linewidth(0)
+ else:
+ gc0.set_foreground(ec)
+ if fc is not None and len(fc) == 4 and fc[3] == 0:
+ fc = None
+ gc0.set_antialiased(aa)
+ if Nurls:
+ gc0.set_url(url)
+ yield xo, yo, pathid, gc0, fc
+ gc0.restore()
+
+ def get_image_magnification(self):
+ """
+ Get the factor by which to magnify images passed to `draw_image`.
+ Allows a backend to have images at a different resolution to other
+ artists.
+ """
+ return 1.0
+
+ def draw_image(self, gc, x, y, im, transform=None):
+ """
+ Draw an RGBA image.
+
+ Parameters
+ ----------
+ gc : `.GraphicsContextBase`
+ A graphics context with clipping information.
+
+ x : float
+ The distance in physical units (i.e., dots or pixels) from the left
+ hand side of the canvas.
+
+ y : float
+ The distance in physical units (i.e., dots or pixels) from the
+ bottom side of the canvas.
+
+ im : (N, M, 4) array of `numpy.uint8`
+ An array of RGBA pixels.
+
+ transform : `~matplotlib.transforms.Affine2DBase`
+ If and only if the concrete backend is written such that
+ `option_scale_image` returns ``True``, an affine transformation
+ (i.e., an `.Affine2DBase`) *may* be passed to `draw_image`. The
+ translation vector of the transformation is given in physical units
+ (i.e., dots or pixels). Note that the transformation does not
+ override *x* and *y*, and has to be applied *before* translating
+ the result by *x* and *y* (this can be accomplished by adding *x*
+ and *y* to the translation vector defined by *transform*).
+ """
+ raise NotImplementedError
+
+ def option_image_nocomposite(self):
+ """
+ Return whether image composition by Matplotlib should be skipped.
+
+ Raster backends should usually return False (letting the C-level
+ rasterizer take care of image composition); vector backends should
+ usually return ``not rcParams["image.composite_image"]``.
+ """
+ return False
+
+ def option_scale_image(self):
+ """
+ Return whether arbitrary affine transformations in `draw_image` are
+ supported (True for most vector backends).
+ """
+ return False
+
+ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
+ """
+ Draw a TeX instance.
+
+ Parameters
+ ----------
+ gc : `.GraphicsContextBase`
+ The graphics context.
+ x : float
+ The x location of the text in display coords.
+ y : float
+ The y location of the text baseline in display coords.
+ s : str
+ The TeX text string.
+ prop : `~matplotlib.font_manager.FontProperties`
+ The font properties.
+ angle : float
+ The rotation angle in degrees anti-clockwise.
+ mtext : `~matplotlib.text.Text`
+ The original text object to be rendered.
+ """
+ self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ """
+ Draw a text instance.
+
+ Parameters
+ ----------
+ gc : `.GraphicsContextBase`
+ The graphics context.
+ x : float
+ The x location of the text in display coords.
+ y : float
+ The y location of the text baseline in display coords.
+ s : str
+ The text string.
+ prop : `~matplotlib.font_manager.FontProperties`
+ The font properties.
+ angle : float
+ The rotation angle in degrees anti-clockwise.
+ ismath : bool or "TeX"
+ If True, use mathtext parser.
+ mtext : `~matplotlib.text.Text`
+ The original text object to be rendered.
+
+ Notes
+ -----
+ **Notes for backend implementers:**
+
+ `.RendererBase.draw_text` also supports passing "TeX" to the *ismath*
+ parameter to use TeX rendering, but this is not required for actual
+ rendering backends, and indeed many builtin backends do not support
+ this. Rather, TeX rendering is provided by `~.RendererBase.draw_tex`.
+ """
+ self._draw_text_as_path(gc, x, y, s, prop, angle, ismath)
+
+ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath):
+ """
+ Draw the text by converting them to paths using `.TextToPath`.
+
+ This private helper supports the same parameters as
+ `~.RendererBase.draw_text`; setting *ismath* to "TeX" triggers TeX
+ rendering.
+ """
+ text2path = self._text2path
+ fontsize = self.points_to_pixels(prop.get_size_in_points())
+ verts, codes = text2path.get_text_path(prop, s, ismath=ismath)
+ path = Path(verts, codes)
+ if self.flipy():
+ width, height = self.get_canvas_width_height()
+ transform = (Affine2D()
+ .scale(fontsize / text2path.FONT_SCALE)
+ .rotate_deg(angle)
+ .translate(x, height - y))
+ else:
+ transform = (Affine2D()
+ .scale(fontsize / text2path.FONT_SCALE)
+ .rotate_deg(angle)
+ .translate(x, y))
+ color = gc.get_rgb()
+ gc.set_linewidth(0.0)
+ self.draw_path(gc, path, transform, rgbFace=color)
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ """
+ Get the width, height, and descent (offset from the bottom to the baseline), in
+ display coords, of the string *s* with `.FontProperties` *prop*.
+
+ Whitespace at the start and the end of *s* is included in the reported width.
+ """
+ fontsize = prop.get_size_in_points()
+
+ if ismath == 'TeX':
+ # todo: handle properties
+ return self.get_texmanager().get_text_width_height_descent(
+ s, fontsize, renderer=self)
+
+ dpi = self.points_to_pixels(72)
+ if ismath:
+ dims = self._text2path.mathtext_parser.parse(s, dpi, prop)
+ return dims[0:3] # return width, height, descent
+
+ flags = self._text2path._get_hinting_flag()
+ font = self._text2path._get_font(prop)
+ font.set_size(fontsize, dpi)
+ # the width and height of unrotated string
+ font.set_text(s, 0.0, flags=flags)
+ w, h = font.get_width_height()
+ d = font.get_descent()
+ w /= 64.0 # convert from subpixels
+ h /= 64.0
+ d /= 64.0
+ return w, h, d
+
+ def flipy(self):
+ """
+ Return whether y values increase from top to bottom.
+
+ Note that this only affects drawing of texts.
+ """
+ return True
+
+ def get_canvas_width_height(self):
+ """Return the canvas width and height in display coords."""
+ return 1, 1
+
+ def get_texmanager(self):
+ """Return the `.TexManager` instance."""
+ if self._texmanager is None:
+ self._texmanager = TexManager()
+ return self._texmanager
+
+ def new_gc(self):
+ """Return an instance of a `.GraphicsContextBase`."""
+ return GraphicsContextBase()
+
+ def points_to_pixels(self, points):
+ """
+ Convert points to display units.
+
+ You need to override this function (unless your backend
+ doesn't have a dpi, e.g., postscript or svg). Some imaging
+ systems assume some value for pixels per inch::
+
+ points to pixels = points * pixels_per_inch/72 * dpi/72
+
+ Parameters
+ ----------
+ points : float or array-like
+
+ Returns
+ -------
+ Points converted to pixels
+ """
+ return points
+
+ def start_rasterizing(self):
+ """
+ Switch to the raster renderer.
+
+ Used by `.MixedModeRenderer`.
+ """
+
+ def stop_rasterizing(self):
+ """
+ Switch back to the vector renderer and draw the contents of the raster
+ renderer as an image on the vector renderer.
+
+ Used by `.MixedModeRenderer`.
+ """
+
+ def start_filter(self):
+ """
+ Switch to a temporary renderer for image filtering effects.
+
+ Currently only supported by the agg renderer.
+ """
+
+ def stop_filter(self, filter_func):
+ """
+ Switch back to the original renderer. The contents of the temporary
+ renderer is processed with the *filter_func* and is drawn on the
+ original renderer as an image.
+
+ Currently only supported by the agg renderer.
+ """
+
+ def _draw_disabled(self):
+ """
+ Context manager to temporary disable drawing.
+
+ This is used for getting the drawn size of Artists. This lets us
+ run the draw process to update any Python state but does not pay the
+ cost of the draw_XYZ calls on the canvas.
+ """
+ no_ops = {
+ meth_name: lambda *args, **kwargs: None
+ for meth_name in dir(RendererBase)
+ if (meth_name.startswith("draw_")
+ or meth_name in ["open_group", "close_group"])
+ }
+
+ return _setattr_cm(self, **no_ops)
+
+
+class GraphicsContextBase:
+ """An abstract base class that provides color, line styles, etc."""
+
+ def __init__(self):
+ self._alpha = 1.0
+ self._forced_alpha = False # if True, _alpha overrides A from RGBA
+ self._antialiased = 1 # use 0, 1 not True, False for extension code
+ self._capstyle = CapStyle('butt')
+ self._cliprect = None
+ self._clippath = None
+ self._dashes = 0, None
+ self._joinstyle = JoinStyle('round')
+ self._linestyle = 'solid'
+ self._linewidth = 1
+ self._rgb = (0.0, 0.0, 0.0, 1.0)
+ self._hatch = None
+ self._hatch_color = colors.to_rgba(rcParams['hatch.color'])
+ self._hatch_linewidth = rcParams['hatch.linewidth']
+ self._url = None
+ self._gid = None
+ self._snap = None
+ self._sketch = None
+
+ def copy_properties(self, gc):
+ """Copy properties from *gc* to self."""
+ self._alpha = gc._alpha
+ self._forced_alpha = gc._forced_alpha
+ self._antialiased = gc._antialiased
+ self._capstyle = gc._capstyle
+ self._cliprect = gc._cliprect
+ self._clippath = gc._clippath
+ self._dashes = gc._dashes
+ self._joinstyle = gc._joinstyle
+ self._linestyle = gc._linestyle
+ self._linewidth = gc._linewidth
+ self._rgb = gc._rgb
+ self._hatch = gc._hatch
+ self._hatch_color = gc._hatch_color
+ self._hatch_linewidth = gc._hatch_linewidth
+ self._url = gc._url
+ self._gid = gc._gid
+ self._snap = gc._snap
+ self._sketch = gc._sketch
+
+ def restore(self):
+ """
+ Restore the graphics context from the stack - needed only
+ for backends that save graphics contexts on a stack.
+ """
+
+ def get_alpha(self):
+ """
+ Return the alpha value used for blending - not supported on all
+ backends.
+ """
+ return self._alpha
+
+ def get_antialiased(self):
+ """Return whether the object should try to do antialiased rendering."""
+ return self._antialiased
+
+ def get_capstyle(self):
+ """Return the `.CapStyle`."""
+ return self._capstyle.name
+
+ def get_clip_rectangle(self):
+ """
+ Return the clip rectangle as a `~matplotlib.transforms.Bbox` instance.
+ """
+ return self._cliprect
+
+ def get_clip_path(self):
+ """
+ Return the clip path in the form (path, transform), where path
+ is a `~.path.Path` instance, and transform is
+ an affine transform to apply to the path before clipping.
+ """
+ if self._clippath is not None:
+ tpath, tr = self._clippath.get_transformed_path_and_affine()
+ if np.all(np.isfinite(tpath.vertices)):
+ return tpath, tr
+ else:
+ _log.warning("Ill-defined clip_path detected. Returning None.")
+ return None, None
+ return None, None
+
+ def get_dashes(self):
+ """
+ Return the dash style as an (offset, dash-list) pair.
+
+ See `.set_dashes` for details.
+
+ Default value is (None, None).
+ """
+ return self._dashes
+
+ def get_forced_alpha(self):
+ """
+ Return whether the value given by get_alpha() should be used to
+ override any other alpha-channel values.
+ """
+ return self._forced_alpha
+
+ def get_joinstyle(self):
+ """Return the `.JoinStyle`."""
+ return self._joinstyle.name
+
+ def get_linewidth(self):
+ """Return the line width in points."""
+ return self._linewidth
+
+ def get_rgb(self):
+ """Return a tuple of three or four floats from 0-1."""
+ return self._rgb
+
+ def get_url(self):
+ """Return a url if one is set, None otherwise."""
+ return self._url
+
+ def get_gid(self):
+ """Return the object identifier if one is set, None otherwise."""
+ return self._gid
+
+ def get_snap(self):
+ """
+ Return the snap setting, which can be:
+
+ * True: snap vertices to the nearest pixel center
+ * False: leave vertices as-is
+ * None: (auto) If the path contains only rectilinear line segments,
+ round to the nearest pixel center
+ """
+ return self._snap
+
+ def set_alpha(self, alpha):
+ """
+ Set the alpha value used for blending - not supported on all backends.
+
+ If ``alpha=None`` (the default), the alpha components of the
+ foreground and fill colors will be used to set their respective
+ transparencies (where applicable); otherwise, ``alpha`` will override
+ them.
+ """
+ if alpha is not None:
+ self._alpha = alpha
+ self._forced_alpha = True
+ else:
+ self._alpha = 1.0
+ self._forced_alpha = False
+ self.set_foreground(self._rgb, isRGBA=True)
+
+ def set_antialiased(self, b):
+ """Set whether object should be drawn with antialiased rendering."""
+ # Use ints to make life easier on extension code trying to read the gc.
+ self._antialiased = int(bool(b))
+
+ @_docstring.interpd
+ def set_capstyle(self, cs):
+ """
+ Set how to draw endpoints of lines.
+
+ Parameters
+ ----------
+ cs : `.CapStyle` or %(CapStyle)s
+ """
+ self._capstyle = CapStyle(cs)
+
+ def set_clip_rectangle(self, rectangle):
+ """Set the clip rectangle to a `.Bbox` or None."""
+ self._cliprect = rectangle
+
+ def set_clip_path(self, path):
+ """Set the clip path to a `.TransformedPath` or None."""
+ _api.check_isinstance((transforms.TransformedPath, None), path=path)
+ self._clippath = path
+
+ def set_dashes(self, dash_offset, dash_list):
+ """
+ Set the dash style for the gc.
+
+ Parameters
+ ----------
+ dash_offset : float
+ Distance, in points, into the dash pattern at which to
+ start the pattern. It is usually set to 0.
+ dash_list : array-like or None
+ The on-off sequence as points. None specifies a solid line. All
+ values must otherwise be non-negative (:math:`\\ge 0`).
+
+ Notes
+ -----
+ See p. 666 of the PostScript
+ `Language Reference
+ `_
+ for more info.
+ """
+ if dash_list is not None:
+ dl = np.asarray(dash_list)
+ if np.any(dl < 0.0):
+ raise ValueError(
+ "All values in the dash list must be non-negative")
+ if dl.size and not np.any(dl > 0.0):
+ raise ValueError(
+ 'At least one value in the dash list must be positive')
+ self._dashes = dash_offset, dash_list
+
+ def set_foreground(self, fg, isRGBA=False):
+ """
+ Set the foreground color.
+
+ Parameters
+ ----------
+ fg : :mpltype:`color`
+ isRGBA : bool
+ If *fg* is known to be an ``(r, g, b, a)`` tuple, *isRGBA* can be
+ set to True to improve performance.
+ """
+ if self._forced_alpha and isRGBA:
+ self._rgb = fg[:3] + (self._alpha,)
+ elif self._forced_alpha:
+ self._rgb = colors.to_rgba(fg, self._alpha)
+ elif isRGBA:
+ self._rgb = fg
+ else:
+ self._rgb = colors.to_rgba(fg)
+
+ @_docstring.interpd
+ def set_joinstyle(self, js):
+ """
+ Set how to draw connections between line segments.
+
+ Parameters
+ ----------
+ js : `.JoinStyle` or %(JoinStyle)s
+ """
+ self._joinstyle = JoinStyle(js)
+
+ def set_linewidth(self, w):
+ """Set the linewidth in points."""
+ self._linewidth = float(w)
+
+ def set_url(self, url):
+ """Set the url for links in compatible backends."""
+ self._url = url
+
+ def set_gid(self, id):
+ """Set the id."""
+ self._gid = id
+
+ def set_snap(self, snap):
+ """
+ Set the snap setting which may be:
+
+ * True: snap vertices to the nearest pixel center
+ * False: leave vertices as-is
+ * None: (auto) If the path contains only rectilinear line segments,
+ round to the nearest pixel center
+ """
+ self._snap = snap
+
+ def set_hatch(self, hatch):
+ """Set the hatch style (for fills)."""
+ self._hatch = hatch
+
+ def get_hatch(self):
+ """Get the current hatch style."""
+ return self._hatch
+
+ def get_hatch_path(self, density=6.0):
+ """Return a `.Path` for the current hatch."""
+ hatch = self.get_hatch()
+ if hatch is None:
+ return None
+ return Path.hatch(hatch, density)
+
+ def get_hatch_color(self):
+ """Get the hatch color."""
+ return self._hatch_color
+
+ def set_hatch_color(self, hatch_color):
+ """Set the hatch color."""
+ self._hatch_color = hatch_color
+
+ def get_hatch_linewidth(self):
+ """Get the hatch linewidth."""
+ return self._hatch_linewidth
+
+ def set_hatch_linewidth(self, hatch_linewidth):
+ """Set the hatch linewidth."""
+ self._hatch_linewidth = hatch_linewidth
+
+ def get_sketch_params(self):
+ """
+ Return the sketch parameters for the artist.
+
+ Returns
+ -------
+ tuple or `None`
+
+ A 3-tuple with the following elements:
+
+ * ``scale``: The amplitude of the wiggle perpendicular to the
+ source line.
+ * ``length``: The length of the wiggle along the line.
+ * ``randomness``: The scale factor by which the length is
+ shrunken or expanded.
+
+ May return `None` if no sketch parameters were set.
+ """
+ return self._sketch
+
+ def set_sketch_params(self, scale=None, length=None, randomness=None):
+ """
+ Set the sketch parameters.
+
+ Parameters
+ ----------
+ scale : float, optional
+ The amplitude of the wiggle perpendicular to the source line, in
+ pixels. If scale is `None`, or not provided, no sketch filter will
+ be provided.
+ length : float, default: 128
+ The length of the wiggle along the line, in pixels.
+ randomness : float, default: 16
+ The scale factor by which the length is shrunken or expanded.
+ """
+ self._sketch = (
+ None if scale is None
+ else (scale, length or 128., randomness or 16.))
+
+
+class TimerBase:
+ """
+ A base class for providing timer events, useful for things animations.
+ Backends need to implement a few specific methods in order to use their
+ own timing mechanisms so that the timer events are integrated into their
+ event loops.
+
+ Subclasses must override the following methods:
+
+ - ``_timer_start``: Backend-specific code for starting the timer.
+ - ``_timer_stop``: Backend-specific code for stopping the timer.
+
+ Subclasses may additionally override the following methods:
+
+ - ``_timer_set_single_shot``: Code for setting the timer to single shot
+ operating mode, if supported by the timer object. If not, the `Timer`
+ class itself will store the flag and the ``_on_timer`` method should be
+ overridden to support such behavior.
+
+ - ``_timer_set_interval``: Code for setting the interval on the timer, if
+ there is a method for doing so on the timer object.
+
+ - ``_on_timer``: The internal function that any timer object should call,
+ which will handle the task of running all callbacks that have been set.
+ """
+
+ def __init__(self, interval=None, callbacks=None):
+ """
+ Parameters
+ ----------
+ interval : int, default: 1000ms
+ The time between timer events in milliseconds. Will be stored as
+ ``timer.interval``.
+ callbacks : list[tuple[callable, tuple, dict]]
+ List of (func, args, kwargs) tuples that will be called upon timer
+ events. This list is accessible as ``timer.callbacks`` and can be
+ manipulated directly, or the functions `~.TimerBase.add_callback`
+ and `~.TimerBase.remove_callback` can be used.
+ """
+ self.callbacks = [] if callbacks is None else callbacks.copy()
+ # Set .interval and not ._interval to go through the property setter.
+ self.interval = 1000 if interval is None else interval
+ self.single_shot = False
+
+ def __del__(self):
+ """Need to stop timer and possibly disconnect timer."""
+ self._timer_stop()
+
+ @_api.delete_parameter("3.9", "interval", alternative="timer.interval")
+ def start(self, interval=None):
+ """
+ Start the timer object.
+
+ Parameters
+ ----------
+ interval : int, optional
+ Timer interval in milliseconds; overrides a previously set interval
+ if provided.
+ """
+ if interval is not None:
+ self.interval = interval
+ self._timer_start()
+
+ def stop(self):
+ """Stop the timer."""
+ self._timer_stop()
+
+ def _timer_start(self):
+ pass
+
+ def _timer_stop(self):
+ pass
+
+ @property
+ def interval(self):
+ """The time between timer events, in milliseconds."""
+ return self._interval
+
+ @interval.setter
+ def interval(self, interval):
+ # Force to int since none of the backends actually support fractional
+ # milliseconds, and some error or give warnings.
+ # Some backends also fail when interval == 0, so ensure >= 1 msec
+ interval = max(int(interval), 1)
+ self._interval = interval
+ self._timer_set_interval()
+
+ @property
+ def single_shot(self):
+ """Whether this timer should stop after a single run."""
+ return self._single
+
+ @single_shot.setter
+ def single_shot(self, ss):
+ self._single = ss
+ self._timer_set_single_shot()
+
+ def add_callback(self, func, *args, **kwargs):
+ """
+ Register *func* to be called by timer when the event fires. Any
+ additional arguments provided will be passed to *func*.
+
+ This function returns *func*, which makes it possible to use it as a
+ decorator.
+ """
+ self.callbacks.append((func, args, kwargs))
+ return func
+
+ def remove_callback(self, func, *args, **kwargs):
+ """
+ Remove *func* from list of callbacks.
+
+ *args* and *kwargs* are optional and used to distinguish between copies
+ of the same function registered to be called with different arguments.
+ This behavior is deprecated. In the future, ``*args, **kwargs`` won't
+ be considered anymore; to keep a specific callback removable by itself,
+ pass it to `add_callback` as a `functools.partial` object.
+ """
+ if args or kwargs:
+ _api.warn_deprecated(
+ "3.1", message="In a future version, Timer.remove_callback "
+ "will not take *args, **kwargs anymore, but remove all "
+ "callbacks where the callable matches; to keep a specific "
+ "callback removable by itself, pass it to add_callback as a "
+ "functools.partial object.")
+ self.callbacks.remove((func, args, kwargs))
+ else:
+ funcs = [c[0] for c in self.callbacks]
+ if func in funcs:
+ self.callbacks.pop(funcs.index(func))
+
+ def _timer_set_interval(self):
+ """Used to set interval on underlying timer object."""
+
+ def _timer_set_single_shot(self):
+ """Used to set single shot on underlying timer object."""
+
+ def _on_timer(self):
+ """
+ Runs all function that have been registered as callbacks. Functions
+ can return False (or 0) if they should not be called any more. If there
+ are no callbacks, the timer is automatically stopped.
+ """
+ for func, args, kwargs in self.callbacks:
+ ret = func(*args, **kwargs)
+ # docstring above explains why we use `if ret == 0` here,
+ # instead of `if not ret`.
+ # This will also catch `ret == False` as `False == 0`
+ # but does not annoy the linters
+ # https://docs.python.org/3/library/stdtypes.html#boolean-values
+ if ret == 0:
+ self.callbacks.remove((func, args, kwargs))
+
+ if len(self.callbacks) == 0:
+ self.stop()
+
+
+class Event:
+ """
+ A Matplotlib event.
+
+ The following attributes are defined and shown with their default values.
+ Subclasses may define additional attributes.
+
+ Attributes
+ ----------
+ name : str
+ The event name.
+ canvas : `FigureCanvasBase`
+ The backend-specific canvas instance generating the event.
+ guiEvent
+ The GUI event that triggered the Matplotlib event.
+ """
+
+ def __init__(self, name, canvas, guiEvent=None):
+ self.name = name
+ self.canvas = canvas
+ self.guiEvent = guiEvent
+
+ def _process(self):
+ """Process this event on ``self.canvas``, then unset ``guiEvent``."""
+ self.canvas.callbacks.process(self.name, self)
+ self.guiEvent = None
+
+
+class DrawEvent(Event):
+ """
+ An event triggered by a draw operation on the canvas.
+
+ In most backends, callbacks subscribed to this event will be fired after
+ the rendering is complete but before the screen is updated. Any extra
+ artists drawn to the canvas's renderer will be reflected without an
+ explicit call to ``blit``.
+
+ .. warning::
+
+ Calling ``canvas.draw`` and ``canvas.blit`` in these callbacks may
+ not be safe with all backends and may cause infinite recursion.
+
+ A DrawEvent has a number of special attributes in addition to those defined
+ by the parent `Event` class.
+
+ Attributes
+ ----------
+ renderer : `RendererBase`
+ The renderer for the draw event.
+ """
+ def __init__(self, name, canvas, renderer):
+ super().__init__(name, canvas)
+ self.renderer = renderer
+
+
+class ResizeEvent(Event):
+ """
+ An event triggered by a canvas resize.
+
+ A ResizeEvent has a number of special attributes in addition to those
+ defined by the parent `Event` class.
+
+ Attributes
+ ----------
+ width : int
+ Width of the canvas in pixels.
+ height : int
+ Height of the canvas in pixels.
+ """
+
+ def __init__(self, name, canvas):
+ super().__init__(name, canvas)
+ self.width, self.height = canvas.get_width_height()
+
+
+class CloseEvent(Event):
+ """An event triggered by a figure being closed."""
+
+
+class LocationEvent(Event):
+ """
+ An event that has a screen location.
+
+ A LocationEvent has a number of special attributes in addition to those
+ defined by the parent `Event` class.
+
+ Attributes
+ ----------
+ x, y : int or None
+ Event location in pixels from bottom left of canvas.
+ inaxes : `~matplotlib.axes.Axes` or None
+ The `~.axes.Axes` instance over which the mouse is, if any.
+ xdata, ydata : float or None
+ Data coordinates of the mouse within *inaxes*, or *None* if the mouse
+ is not over an Axes.
+ modifiers : frozenset
+ The keyboard modifiers currently being pressed (except for KeyEvent).
+ """
+
+ _last_axes_ref = None
+
+ def __init__(self, name, canvas, x, y, guiEvent=None, *, modifiers=None):
+ super().__init__(name, canvas, guiEvent=guiEvent)
+ # x position - pixels from left of canvas
+ self.x = int(x) if x is not None else x
+ # y position - pixels from right of canvas
+ self.y = int(y) if y is not None else y
+ self.inaxes = None # the Axes instance the mouse is over
+ self.xdata = None # x coord of mouse in data coords
+ self.ydata = None # y coord of mouse in data coords
+ self.modifiers = frozenset(modifiers if modifiers is not None else [])
+
+ if x is None or y is None:
+ # cannot check if event was in Axes if no (x, y) info
+ return
+
+ self._set_inaxes(self.canvas.inaxes((x, y))
+ if self.canvas.mouse_grabber is None else
+ self.canvas.mouse_grabber,
+ (x, y))
+
+ # Splitting _set_inaxes out is useful for the axes_leave_event handler: it
+ # needs to generate synthetic LocationEvents with manually-set inaxes. In
+ # that latter case, xy has already been cast to int so it can directly be
+ # read from self.x, self.y; in the normal case, however, it is more
+ # accurate to pass the untruncated float x, y values passed to the ctor.
+
+ def _set_inaxes(self, inaxes, xy=None):
+ self.inaxes = inaxes
+ if inaxes is not None:
+ try:
+ self.xdata, self.ydata = inaxes.transData.inverted().transform(
+ xy if xy is not None else (self.x, self.y))
+ except ValueError:
+ pass
+
+
+class MouseButton(IntEnum):
+ LEFT = 1
+ MIDDLE = 2
+ RIGHT = 3
+ BACK = 8
+ FORWARD = 9
+
+
+class MouseEvent(LocationEvent):
+ """
+ A mouse event ('button_press_event', 'button_release_event', \
+'scroll_event', 'motion_notify_event').
+
+ A MouseEvent has a number of special attributes in addition to those
+ defined by the parent `Event` and `LocationEvent` classes.
+
+ Attributes
+ ----------
+ button : None or `MouseButton` or {'up', 'down'}
+ The button pressed. 'up' and 'down' are used for scroll events.
+
+ Note that LEFT and RIGHT actually refer to the "primary" and
+ "secondary" buttons, i.e. if the user inverts their left and right
+ buttons ("left-handed setting") then the LEFT button will be the one
+ physically on the right.
+
+ If this is unset, *name* is "scroll_event", and *step* is nonzero, then
+ this will be set to "up" or "down" depending on the sign of *step*.
+
+ buttons : None or frozenset
+ For 'motion_notify_event', the mouse buttons currently being pressed
+ (a set of zero or more MouseButtons);
+ for other events, None.
+
+ .. note::
+ For 'motion_notify_event', this attribute is more accurate than
+ the ``button`` (singular) attribute, which is obtained from the last
+ 'button_press_event' or 'button_release_event' that occurred within
+ the canvas (and thus 1. be wrong if the last change in mouse state
+ occurred when the canvas did not have focus, and 2. cannot report
+ when multiple buttons are pressed).
+
+ This attribute is not set for 'button_press_event' and
+ 'button_release_event' because GUI toolkits are inconsistent as to
+ whether they report the button state *before* or *after* the
+ press/release occurred.
+
+ .. warning::
+ On macOS, the Tk backends only report a single button even if
+ multiple buttons are pressed.
+
+ key : None or str
+ The key pressed when the mouse event triggered, e.g. 'shift'.
+ See `KeyEvent`.
+
+ .. warning::
+ This key is currently obtained from the last 'key_press_event' or
+ 'key_release_event' that occurred within the canvas. Thus, if the
+ last change of keyboard state occurred while the canvas did not have
+ focus, this attribute will be wrong. On the other hand, the
+ ``modifiers`` attribute should always be correct, but it can only
+ report on modifier keys.
+
+ step : float
+ The number of scroll steps (positive for 'up', negative for 'down').
+ This applies only to 'scroll_event' and defaults to 0 otherwise.
+
+ dblclick : bool
+ Whether the event is a double-click. This applies only to
+ 'button_press_event' and is False otherwise. In particular, it's
+ not used in 'button_release_event'.
+
+ Examples
+ --------
+ ::
+
+ def on_press(event):
+ print('you pressed', event.button, event.xdata, event.ydata)
+
+ cid = fig.canvas.mpl_connect('button_press_event', on_press)
+ """
+
+ def __init__(self, name, canvas, x, y, button=None, key=None,
+ step=0, dblclick=False, guiEvent=None, *,
+ buttons=None, modifiers=None):
+ super().__init__(
+ name, canvas, x, y, guiEvent=guiEvent, modifiers=modifiers)
+ if button in MouseButton.__members__.values():
+ button = MouseButton(button)
+ if name == "scroll_event" and button is None:
+ if step > 0:
+ button = "up"
+ elif step < 0:
+ button = "down"
+ self.button = button
+ if name == "motion_notify_event":
+ self.buttons = frozenset(buttons if buttons is not None else [])
+ else:
+ # We don't support 'buttons' for button_press/release_event because
+ # toolkits are inconsistent as to whether they report the state
+ # before or after the event.
+ if buttons:
+ raise ValueError(
+ "'buttons' is only supported for 'motion_notify_event'")
+ self.buttons = None
+ self.key = key
+ self.step = step
+ self.dblclick = dblclick
+
+ def __str__(self):
+ return (f"{self.name}: "
+ f"xy=({self.x}, {self.y}) xydata=({self.xdata}, {self.ydata}) "
+ f"button={self.button} dblclick={self.dblclick} "
+ f"inaxes={self.inaxes}")
+
+
+class PickEvent(Event):
+ """
+ A pick event.
+
+ This event is fired when the user picks a location on the canvas
+ sufficiently close to an artist that has been made pickable with
+ `.Artist.set_picker`.
+
+ A PickEvent has a number of special attributes in addition to those defined
+ by the parent `Event` class.
+
+ Attributes
+ ----------
+ mouseevent : `MouseEvent`
+ The mouse event that generated the pick.
+ artist : `~matplotlib.artist.Artist`
+ The picked artist. Note that artists are not pickable by default
+ (see `.Artist.set_picker`).
+ other
+ Additional attributes may be present depending on the type of the
+ picked object; e.g., a `.Line2D` pick may define different extra
+ attributes than a `.PatchCollection` pick.
+
+ Examples
+ --------
+ Bind a function ``on_pick()`` to pick events, that prints the coordinates
+ of the picked data point::
+
+ ax.plot(np.rand(100), 'o', picker=5) # 5 points tolerance
+
+ def on_pick(event):
+ line = event.artist
+ xdata, ydata = line.get_data()
+ ind = event.ind
+ print(f'on pick line: {xdata[ind]:.3f}, {ydata[ind]:.3f}')
+
+ cid = fig.canvas.mpl_connect('pick_event', on_pick)
+ """
+
+ def __init__(self, name, canvas, mouseevent, artist,
+ guiEvent=None, **kwargs):
+ if guiEvent is None:
+ guiEvent = mouseevent.guiEvent
+ super().__init__(name, canvas, guiEvent)
+ self.mouseevent = mouseevent
+ self.artist = artist
+ self.__dict__.update(kwargs)
+
+
+class KeyEvent(LocationEvent):
+ """
+ A key event (key press, key release).
+
+ A KeyEvent has a number of special attributes in addition to those defined
+ by the parent `Event` and `LocationEvent` classes.
+
+ Attributes
+ ----------
+ key : None or str
+ The key(s) pressed. Could be *None*, a single case sensitive Unicode
+ character ("g", "G", "#", etc.), a special key ("control", "shift",
+ "f1", "up", etc.) or a combination of the above (e.g., "ctrl+alt+g",
+ "ctrl+alt+G").
+
+ Notes
+ -----
+ Modifier keys will be prefixed to the pressed key and will be in the order
+ "ctrl", "alt", "super". The exception to this rule is when the pressed key
+ is itself a modifier key, therefore "ctrl+alt" and "alt+control" can both
+ be valid key values.
+
+ Examples
+ --------
+ ::
+
+ def on_key(event):
+ print('you pressed', event.key, event.xdata, event.ydata)
+
+ cid = fig.canvas.mpl_connect('key_press_event', on_key)
+ """
+
+ def __init__(self, name, canvas, key, x=0, y=0, guiEvent=None):
+ super().__init__(name, canvas, x, y, guiEvent=guiEvent)
+ self.key = key
+
+
+# Default callback for key events.
+def _key_handler(event):
+ # Dead reckoning of key.
+ if event.name == "key_press_event":
+ event.canvas._key = event.key
+ elif event.name == "key_release_event":
+ event.canvas._key = None
+
+
+# Default callback for mouse events.
+def _mouse_handler(event):
+ # Dead-reckoning of button and key.
+ if event.name == "button_press_event":
+ event.canvas._button = event.button
+ elif event.name == "button_release_event":
+ event.canvas._button = None
+ elif event.name == "motion_notify_event" and event.button is None:
+ event.button = event.canvas._button
+ if event.key is None:
+ event.key = event.canvas._key
+ # Emit axes_enter/axes_leave.
+ if event.name == "motion_notify_event":
+ last_ref = LocationEvent._last_axes_ref
+ last_axes = last_ref() if last_ref else None
+ if last_axes != event.inaxes:
+ if last_axes is not None:
+ # Create a synthetic LocationEvent for the axes_leave_event.
+ # Its inaxes attribute needs to be manually set (because the
+ # cursor is actually *out* of that Axes at that point); this is
+ # done with the internal _set_inaxes method which ensures that
+ # the xdata and ydata attributes are also correct.
+ try:
+ canvas = last_axes.get_figure(root=True).canvas
+ leave_event = LocationEvent(
+ "axes_leave_event", canvas,
+ event.x, event.y, event.guiEvent,
+ modifiers=event.modifiers)
+ leave_event._set_inaxes(last_axes)
+ canvas.callbacks.process("axes_leave_event", leave_event)
+ except Exception:
+ pass # The last canvas may already have been torn down.
+ if event.inaxes is not None:
+ event.canvas.callbacks.process("axes_enter_event", event)
+ LocationEvent._last_axes_ref = (
+ weakref.ref(event.inaxes) if event.inaxes else None)
+
+
+def _get_renderer(figure, print_method=None):
+ """
+ Get the renderer that would be used to save a `.Figure`.
+
+ If you need a renderer without any active draw methods use
+ renderer._draw_disabled to temporary patch them out at your call site.
+ """
+ # This is implemented by triggering a draw, then immediately jumping out of
+ # Figure.draw() by raising an exception.
+
+ class Done(Exception):
+ pass
+
+ def _draw(renderer): raise Done(renderer)
+
+ with cbook._setattr_cm(figure, draw=_draw), ExitStack() as stack:
+ if print_method is None:
+ fmt = figure.canvas.get_default_filetype()
+ # Even for a canvas' default output type, a canvas switch may be
+ # needed, e.g. for FigureCanvasBase.
+ print_method = stack.enter_context(
+ figure.canvas._switch_canvas_and_return_print_method(fmt))
+ try:
+ print_method(io.BytesIO())
+ except Done as exc:
+ renderer, = exc.args
+ return renderer
+ else:
+ raise RuntimeError(f"{print_method} did not call Figure.draw, so "
+ f"no renderer is available")
+
+
+def _no_output_draw(figure):
+ # _no_output_draw was promoted to the figure level, but
+ # keep this here in case someone was calling it...
+ figure.draw_without_rendering()
+
+
+def _is_non_interactive_terminal_ipython(ip):
+ """
+ Return whether we are in a terminal IPython, but non interactive.
+
+ When in _terminal_ IPython, ip.parent will have and `interact` attribute,
+ if this attribute is False we do not setup eventloop integration as the
+ user will _not_ interact with IPython. In all other case (ZMQKernel, or is
+ interactive), we do.
+ """
+ return (hasattr(ip, 'parent')
+ and (ip.parent is not None)
+ and getattr(ip.parent, 'interact', None) is False)
+
+
+@contextmanager
+def _allow_interrupt(prepare_notifier, handle_sigint):
+ """
+ A context manager that allows terminating a plot by sending a SIGINT. It
+ is necessary because the running backend prevents the Python interpreter
+ from running and processing signals (i.e., to raise a KeyboardInterrupt).
+ To solve this, one needs to somehow wake up the interpreter and make it
+ close the plot window. We do this by using the signal.set_wakeup_fd()
+ function which organizes a write of the signal number into a socketpair.
+ A backend-specific function, *prepare_notifier*, arranges to listen to
+ the pair's read socket while the event loop is running. (If it returns a
+ notifier object, that object is kept alive while the context manager runs.)
+
+ If SIGINT was indeed caught, after exiting the on_signal() function the
+ interpreter reacts to the signal according to the handler function which
+ had been set up by a signal.signal() call; here, we arrange to call the
+ backend-specific *handle_sigint* function. Finally, we call the old SIGINT
+ handler with the same arguments that were given to our custom handler.
+
+ We do this only if the old handler for SIGINT was not None, which means
+ that a non-python handler was installed, i.e. in Julia, and not SIG_IGN
+ which means we should ignore the interrupts.
+
+ Parameters
+ ----------
+ prepare_notifier : Callable[[socket.socket], object]
+ handle_sigint : Callable[[], object]
+ """
+
+ old_sigint_handler = signal.getsignal(signal.SIGINT)
+ if old_sigint_handler in (None, signal.SIG_IGN, signal.SIG_DFL):
+ yield
+ return
+
+ handler_args = None
+ wsock, rsock = socket.socketpair()
+ wsock.setblocking(False)
+ rsock.setblocking(False)
+ old_wakeup_fd = signal.set_wakeup_fd(wsock.fileno())
+ notifier = prepare_notifier(rsock)
+
+ def save_args_and_handle_sigint(*args):
+ nonlocal handler_args
+ handler_args = args
+ handle_sigint()
+
+ signal.signal(signal.SIGINT, save_args_and_handle_sigint)
+ try:
+ yield
+ finally:
+ wsock.close()
+ rsock.close()
+ signal.set_wakeup_fd(old_wakeup_fd)
+ signal.signal(signal.SIGINT, old_sigint_handler)
+ if handler_args is not None:
+ old_sigint_handler(*handler_args)
+
+
+class FigureCanvasBase:
+ """
+ The canvas the figure renders into.
+
+ Attributes
+ ----------
+ figure : `~matplotlib.figure.Figure`
+ A high-level figure instance.
+ """
+
+ # Set to one of {"qt", "gtk3", "gtk4", "wx", "tk", "macosx"} if an
+ # interactive framework is required, or None otherwise.
+ required_interactive_framework = None
+
+ # The manager class instantiated by new_manager.
+ # (This is defined as a classproperty because the manager class is
+ # currently defined *after* the canvas class, but one could also assign
+ # ``FigureCanvasBase.manager_class = FigureManagerBase``
+ # after defining both classes.)
+ manager_class = _api.classproperty(lambda cls: FigureManagerBase)
+
+ events = [
+ 'resize_event',
+ 'draw_event',
+ 'key_press_event',
+ 'key_release_event',
+ 'button_press_event',
+ 'button_release_event',
+ 'scroll_event',
+ 'motion_notify_event',
+ 'pick_event',
+ 'figure_enter_event',
+ 'figure_leave_event',
+ 'axes_enter_event',
+ 'axes_leave_event',
+ 'close_event'
+ ]
+
+ fixed_dpi = None
+
+ filetypes = _default_filetypes
+
+ @_api.classproperty
+ def supports_blit(cls):
+ """If this Canvas sub-class supports blitting."""
+ return (hasattr(cls, "copy_from_bbox")
+ and hasattr(cls, "restore_region"))
+
+ def __init__(self, figure=None):
+ from matplotlib.figure import Figure
+ self._fix_ipython_backend2gui()
+ self._is_idle_drawing = True
+ self._is_saving = False
+ if figure is None:
+ figure = Figure()
+ figure.set_canvas(self)
+ self.figure = figure
+ self.manager = None
+ self.widgetlock = widgets.LockDraw()
+ self._button = None # the button pressed
+ self._key = None # the key pressed
+ self.mouse_grabber = None # the Axes currently grabbing mouse
+ self.toolbar = None # NavigationToolbar2 will set me
+ self._is_idle_drawing = False
+ # We don't want to scale up the figure DPI more than once.
+ figure._original_dpi = figure.dpi
+ self._device_pixel_ratio = 1
+ super().__init__() # Typically the GUI widget init (if any).
+
+ callbacks = property(lambda self: self.figure._canvas_callbacks)
+ button_pick_id = property(lambda self: self.figure._button_pick_id)
+ scroll_pick_id = property(lambda self: self.figure._scroll_pick_id)
+
+ @classmethod
+ @functools.cache
+ def _fix_ipython_backend2gui(cls):
+ # Fix hard-coded module -> toolkit mapping in IPython (used for
+ # `ipython --auto`). This cannot be done at import time due to
+ # ordering issues, so we do it when creating a canvas, and should only
+ # be done once per class (hence the `cache`).
+
+ # This function will not be needed when Python 3.12, the latest version
+ # supported by IPython < 8.24, reaches end-of-life in late 2028.
+ # At that time this function can be made a no-op and deprecated.
+ mod_ipython = sys.modules.get("IPython")
+ if mod_ipython is None or mod_ipython.version_info[:2] >= (8, 24):
+ # Use of backend2gui is not needed for IPython >= 8.24 as the
+ # functionality has been moved to Matplotlib.
+ return
+
+ import IPython
+ ip = IPython.get_ipython()
+ if not ip:
+ return
+ from IPython.core import pylabtools as pt
+ if (not hasattr(pt, "backend2gui")
+ or not hasattr(ip, "enable_matplotlib")):
+ # In case we ever move the patch to IPython and remove these APIs,
+ # don't break on our side.
+ return
+ backend2gui_rif = {
+ "qt": "qt",
+ "gtk3": "gtk3",
+ "gtk4": "gtk4",
+ "wx": "wx",
+ "macosx": "osx",
+ }.get(cls.required_interactive_framework)
+ if backend2gui_rif:
+ if _is_non_interactive_terminal_ipython(ip):
+ ip.enable_gui(backend2gui_rif)
+
+ @classmethod
+ def new_manager(cls, figure, num):
+ """
+ Create a new figure manager for *figure*, using this canvas class.
+
+ Notes
+ -----
+ This method should not be reimplemented in subclasses. If
+ custom manager creation logic is needed, please reimplement
+ ``FigureManager.create_with_canvas``.
+ """
+ return cls.manager_class.create_with_canvas(cls, figure, num)
+
+ @contextmanager
+ def _idle_draw_cntx(self):
+ self._is_idle_drawing = True
+ try:
+ yield
+ finally:
+ self._is_idle_drawing = False
+
+ def is_saving(self):
+ """
+ Return whether the renderer is in the process of saving
+ to a file, rather than rendering for an on-screen buffer.
+ """
+ return self._is_saving
+
+ def blit(self, bbox=None):
+ """Blit the canvas in bbox (default entire canvas)."""
+
+ def inaxes(self, xy):
+ """
+ Return the topmost visible `~.axes.Axes` containing the point *xy*.
+
+ Parameters
+ ----------
+ xy : (float, float)
+ (x, y) pixel positions from left/bottom of the canvas.
+
+ Returns
+ -------
+ `~matplotlib.axes.Axes` or None
+ The topmost visible Axes containing the point, or None if there
+ is no Axes at the point.
+ """
+ axes_list = [a for a in self.figure.get_axes()
+ if a.patch.contains_point(xy) and a.get_visible()]
+ if axes_list:
+ axes = cbook._topmost_artist(axes_list)
+ else:
+ axes = None
+
+ return axes
+
+ def grab_mouse(self, ax):
+ """
+ Set the child `~.axes.Axes` which is grabbing the mouse events.
+
+ Usually called by the widgets themselves. It is an error to call this
+ if the mouse is already grabbed by another Axes.
+ """
+ if self.mouse_grabber not in (None, ax):
+ raise RuntimeError("Another Axes already grabs mouse input")
+ self.mouse_grabber = ax
+
+ def release_mouse(self, ax):
+ """
+ Release the mouse grab held by the `~.axes.Axes` *ax*.
+
+ Usually called by the widgets. It is ok to call this even if *ax*
+ doesn't have the mouse grab currently.
+ """
+ if self.mouse_grabber is ax:
+ self.mouse_grabber = None
+
+ def set_cursor(self, cursor):
+ """
+ Set the current cursor.
+
+ This may have no effect if the backend does not display anything.
+
+ If required by the backend, this method should trigger an update in
+ the backend event loop after the cursor is set, as this method may be
+ called e.g. before a long-running task during which the GUI is not
+ updated.
+
+ Parameters
+ ----------
+ cursor : `.Cursors`
+ The cursor to display over the canvas. Note: some backends may
+ change the cursor for the entire window.
+ """
+
+ def draw(self, *args, **kwargs):
+ """
+ Render the `.Figure`.
+
+ This method must walk the artist tree, even if no output is produced,
+ because it triggers deferred work that users may want to access
+ before saving output to disk. For example computing limits,
+ auto-limits, and tick values.
+ """
+
+ def draw_idle(self, *args, **kwargs):
+ """
+ Request a widget redraw once control returns to the GUI event loop.
+
+ Even if multiple calls to `draw_idle` occur before control returns
+ to the GUI event loop, the figure will only be rendered once.
+
+ Notes
+ -----
+ Backends may choose to override the method and implement their own
+ strategy to prevent multiple renderings.
+
+ """
+ if not self._is_idle_drawing:
+ with self._idle_draw_cntx():
+ self.draw(*args, **kwargs)
+
+ @property
+ def device_pixel_ratio(self):
+ """
+ The ratio of physical to logical pixels used for the canvas on screen.
+
+ By default, this is 1, meaning physical and logical pixels are the same
+ size. Subclasses that support High DPI screens may set this property to
+ indicate that said ratio is different. All Matplotlib interaction,
+ unless working directly with the canvas, remains in logical pixels.
+
+ """
+ return self._device_pixel_ratio
+
+ def _set_device_pixel_ratio(self, ratio):
+ """
+ Set the ratio of physical to logical pixels used for the canvas.
+
+ Subclasses that support High DPI screens can set this property to
+ indicate that said ratio is different. The canvas itself will be
+ created at the physical size, while the client side will use the
+ logical size. Thus the DPI of the Figure will change to be scaled by
+ this ratio. Implementations that support High DPI screens should use
+ physical pixels for events so that transforms back to Axes space are
+ correct.
+
+ By default, this is 1, meaning physical and logical pixels are the same
+ size.
+
+ Parameters
+ ----------
+ ratio : float
+ The ratio of logical to physical pixels used for the canvas.
+
+ Returns
+ -------
+ bool
+ Whether the ratio has changed. Backends may interpret this as a
+ signal to resize the window, repaint the canvas, or change any
+ other relevant properties.
+ """
+ if self._device_pixel_ratio == ratio:
+ return False
+ # In cases with mixed resolution displays, we need to be careful if the
+ # device pixel ratio changes - in this case we need to resize the
+ # canvas accordingly. Some backends provide events that indicate a
+ # change in DPI, but those that don't will update this before drawing.
+ dpi = ratio * self.figure._original_dpi
+ self.figure._set_dpi(dpi, forward=False)
+ self._device_pixel_ratio = ratio
+ return True
+
+ def get_width_height(self, *, physical=False):
+ """
+ Return the figure width and height in integral points or pixels.
+
+ When the figure is used on High DPI screens (and the backend supports
+ it), the truncation to integers occurs after scaling by the device
+ pixel ratio.
+
+ Parameters
+ ----------
+ physical : bool, default: False
+ Whether to return true physical pixels or logical pixels. Physical
+ pixels may be used by backends that support HiDPI, but still
+ configure the canvas using its actual size.
+
+ Returns
+ -------
+ width, height : int
+ The size of the figure, in points or pixels, depending on the
+ backend.
+ """
+ return tuple(int(size / (1 if physical else self.device_pixel_ratio))
+ for size in self.figure.bbox.max)
+
+ @classmethod
+ def get_supported_filetypes(cls):
+ """Return dict of savefig file formats supported by this backend."""
+ return cls.filetypes
+
+ @classmethod
+ def get_supported_filetypes_grouped(cls):
+ """
+ Return a dict of savefig file formats supported by this backend,
+ where the keys are a file type name, such as 'Joint Photographic
+ Experts Group', and the values are a list of filename extensions used
+ for that filetype, such as ['jpg', 'jpeg'].
+ """
+ groupings = {}
+ for ext, name in cls.filetypes.items():
+ groupings.setdefault(name, []).append(ext)
+ groupings[name].sort()
+ return groupings
+
+ @contextmanager
+ def _switch_canvas_and_return_print_method(self, fmt, backend=None):
+ """
+ Context manager temporarily setting the canvas for saving the figure::
+
+ with (canvas._switch_canvas_and_return_print_method(fmt, backend)
+ as print_method):
+ # ``print_method`` is a suitable ``print_{fmt}`` method, and
+ # the figure's canvas is temporarily switched to the method's
+ # canvas within the with... block. ``print_method`` is also
+ # wrapped to suppress extra kwargs passed by ``print_figure``.
+
+ Parameters
+ ----------
+ fmt : str
+ If *backend* is None, then determine a suitable canvas class for
+ saving to format *fmt* -- either the current canvas class, if it
+ supports *fmt*, or whatever `get_registered_canvas_class` returns;
+ switch the figure canvas to that canvas class.
+ backend : str or None, default: None
+ If not None, switch the figure canvas to the ``FigureCanvas`` class
+ of the given backend.
+ """
+ canvas = None
+ if backend is not None:
+ # Return a specific canvas class, if requested.
+ from .backends.registry import backend_registry
+ canvas_class = backend_registry.load_backend_module(backend).FigureCanvas
+ if not hasattr(canvas_class, f"print_{fmt}"):
+ raise ValueError(
+ f"The {backend!r} backend does not support {fmt} output")
+ canvas = canvas_class(self.figure)
+ elif hasattr(self, f"print_{fmt}"):
+ # Return the current canvas if it supports the requested format.
+ canvas = self
+ else:
+ # Return a default canvas for the requested format, if it exists.
+ canvas_class = get_registered_canvas_class(fmt)
+ if canvas_class is None:
+ raise ValueError(
+ "Format {!r} is not supported (supported formats: {})".format(
+ fmt, ", ".join(sorted(self.get_supported_filetypes()))))
+ canvas = canvas_class(self.figure)
+ canvas._is_saving = self._is_saving
+ meth = getattr(canvas, f"print_{fmt}")
+ mod = (meth.func.__module__
+ if hasattr(meth, "func") # partialmethod, e.g. backend_wx.
+ else meth.__module__)
+ if mod.startswith(("matplotlib.", "mpl_toolkits.")):
+ optional_kws = { # Passed by print_figure for other renderers.
+ "dpi", "facecolor", "edgecolor", "orientation",
+ "bbox_inches_restore"}
+ skip = optional_kws - {*inspect.signature(meth).parameters}
+ print_method = functools.wraps(meth)(lambda *args, **kwargs: meth(
+ *args, **{k: v for k, v in kwargs.items() if k not in skip}))
+ else: # Let third-parties do as they see fit.
+ print_method = meth
+ try:
+ yield print_method
+ finally:
+ self.figure.canvas = self
+
+ def print_figure(
+ self, filename, dpi=None, facecolor=None, edgecolor=None,
+ orientation='portrait', format=None, *,
+ bbox_inches=None, pad_inches=None, bbox_extra_artists=None,
+ backend=None, **kwargs):
+ """
+ Render the figure to hardcopy. Set the figure patch face and edge
+ colors. This is useful because some of the GUIs have a gray figure
+ face color background and you'll probably want to override this on
+ hardcopy.
+
+ Parameters
+ ----------
+ filename : str or path-like or file-like
+ The file where the figure is saved.
+
+ dpi : float, default: :rc:`savefig.dpi`
+ The dots per inch to save the figure in.
+
+ facecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.facecolor`
+ The facecolor of the figure. If 'auto', use the current figure
+ facecolor.
+
+ edgecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.edgecolor`
+ The edgecolor of the figure. If 'auto', use the current figure
+ edgecolor.
+
+ orientation : {'landscape', 'portrait'}, default: 'portrait'
+ Only currently applies to PostScript printing.
+
+ format : str, optional
+ Force a specific file format. If not given, the format is inferred
+ from the *filename* extension, and if that fails from
+ :rc:`savefig.format`.
+
+ bbox_inches : 'tight' or `.Bbox`, default: :rc:`savefig.bbox`
+ Bounding box in inches: only the given portion of the figure is
+ saved. If 'tight', try to figure out the tight bbox of the figure.
+
+ pad_inches : float or 'layout', default: :rc:`savefig.pad_inches`
+ Amount of padding in inches around the figure when bbox_inches is
+ 'tight'. If 'layout' use the padding from the constrained or
+ compressed layout engine; ignored if one of those engines is not in
+ use.
+
+ bbox_extra_artists : list of `~matplotlib.artist.Artist`, optional
+ A list of extra artists that will be considered when the
+ tight bbox is calculated.
+
+ backend : str, optional
+ Use a non-default backend to render the file, e.g. to render a
+ png file with the "cairo" backend rather than the default "agg",
+ or a pdf file with the "pgf" backend rather than the default
+ "pdf". Note that the default backend is normally sufficient. See
+ :ref:`the-builtin-backends` for a list of valid backends for each
+ file format. Custom backends can be referenced as "module://...".
+ """
+ if format is None:
+ # get format from filename, or from backend's default filetype
+ if isinstance(filename, os.PathLike):
+ filename = os.fspath(filename)
+ if isinstance(filename, str):
+ format = os.path.splitext(filename)[1][1:]
+ if format is None or format == '':
+ format = self.get_default_filetype()
+ if isinstance(filename, str):
+ filename = filename.rstrip('.') + '.' + format
+ format = format.lower()
+
+ if dpi is None:
+ dpi = rcParams['savefig.dpi']
+ if dpi == 'figure':
+ dpi = getattr(self.figure, '_original_dpi', self.figure.dpi)
+
+ # Remove the figure manager, if any, to avoid resizing the GUI widget.
+ with (cbook._setattr_cm(self, manager=None),
+ self._switch_canvas_and_return_print_method(format, backend)
+ as print_method,
+ cbook._setattr_cm(self.figure, dpi=dpi),
+ cbook._setattr_cm(self.figure.canvas, _device_pixel_ratio=1),
+ cbook._setattr_cm(self.figure.canvas, _is_saving=True),
+ ExitStack() as stack):
+
+ for prop in ["facecolor", "edgecolor"]:
+ color = locals()[prop]
+ if color is None:
+ color = rcParams[f"savefig.{prop}"]
+ if not cbook._str_equal(color, "auto"):
+ stack.enter_context(self.figure._cm_set(**{prop: color}))
+
+ if bbox_inches is None:
+ bbox_inches = rcParams['savefig.bbox']
+
+ layout_engine = self.figure.get_layout_engine()
+ if layout_engine is not None or bbox_inches == "tight":
+ # we need to trigger a draw before printing to make sure
+ # CL works. "tight" also needs a draw to get the right
+ # locations:
+ renderer = _get_renderer(
+ self.figure,
+ functools.partial(
+ print_method, orientation=orientation)
+ )
+ # we do this instead of `self.figure.draw_without_rendering`
+ # so that we can inject the orientation
+ with getattr(renderer, "_draw_disabled", nullcontext)():
+ self.figure.draw(renderer)
+ if bbox_inches:
+ if bbox_inches == "tight":
+ bbox_inches = self.figure.get_tightbbox(
+ renderer, bbox_extra_artists=bbox_extra_artists)
+ if (isinstance(layout_engine, ConstrainedLayoutEngine) and
+ pad_inches == "layout"):
+ h_pad = layout_engine.get()["h_pad"]
+ w_pad = layout_engine.get()["w_pad"]
+ else:
+ if pad_inches in [None, "layout"]:
+ pad_inches = rcParams['savefig.pad_inches']
+ h_pad = w_pad = pad_inches
+ bbox_inches = bbox_inches.padded(w_pad, h_pad)
+
+ # call adjust_bbox to save only the given area
+ restore_bbox = _tight_bbox.adjust_bbox(
+ self.figure, bbox_inches, self.figure.canvas.fixed_dpi)
+
+ _bbox_inches_restore = (bbox_inches, restore_bbox)
+ else:
+ _bbox_inches_restore = None
+
+ # we have already done layout above, so turn it off:
+ stack.enter_context(self.figure._cm_set(layout_engine='none'))
+ try:
+ # _get_renderer may change the figure dpi (as vector formats
+ # force the figure dpi to 72), so we need to set it again here.
+ with cbook._setattr_cm(self.figure, dpi=dpi):
+ result = print_method(
+ filename,
+ facecolor=facecolor,
+ edgecolor=edgecolor,
+ orientation=orientation,
+ bbox_inches_restore=_bbox_inches_restore,
+ **kwargs)
+ finally:
+ if bbox_inches and restore_bbox:
+ restore_bbox()
+
+ return result
+
+ @classmethod
+ def get_default_filetype(cls):
+ """
+ Return the default savefig file format as specified in
+ :rc:`savefig.format`.
+
+ The returned string does not include a period. This method is
+ overridden in backends that only support a single file type.
+ """
+ return rcParams['savefig.format']
+
+ def get_default_filename(self):
+ """
+ Return a suitable default filename, including the extension.
+ """
+ default_basename = (
+ self.manager.get_window_title()
+ if self.manager is not None
+ else ''
+ )
+ default_basename = default_basename or 'image'
+ # Characters to be avoided in a NT path:
+ # https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#naming_conventions
+ # plus ' '
+ removed_chars = '<>:"/\\|?*\0 '
+ default_basename = default_basename.translate(
+ {ord(c): "_" for c in removed_chars})
+ default_filetype = self.get_default_filetype()
+ return f'{default_basename}.{default_filetype}'
+
+ def mpl_connect(self, s, func):
+ """
+ Bind function *func* to event *s*.
+
+ Parameters
+ ----------
+ s : str
+ One of the following events ids:
+
+ - 'button_press_event'
+ - 'button_release_event'
+ - 'draw_event'
+ - 'key_press_event'
+ - 'key_release_event'
+ - 'motion_notify_event'
+ - 'pick_event'
+ - 'resize_event'
+ - 'scroll_event'
+ - 'figure_enter_event',
+ - 'figure_leave_event',
+ - 'axes_enter_event',
+ - 'axes_leave_event'
+ - 'close_event'.
+
+ func : callable
+ The callback function to be executed, which must have the
+ signature::
+
+ def func(event: Event) -> Any
+
+ For the location events (button and key press/release), if the
+ mouse is over the Axes, the ``inaxes`` attribute of the event will
+ be set to the `~matplotlib.axes.Axes` the event occurs is over, and
+ additionally, the variables ``xdata`` and ``ydata`` attributes will
+ be set to the mouse location in data coordinates. See `.KeyEvent`
+ and `.MouseEvent` for more info.
+
+ .. note::
+
+ If func is a method, this only stores a weak reference to the
+ method. Thus, the figure does not influence the lifetime of
+ the associated object. Usually, you want to make sure that the
+ object is kept alive throughout the lifetime of the figure by
+ holding a reference to it.
+
+ Returns
+ -------
+ cid
+ A connection id that can be used with
+ `.FigureCanvasBase.mpl_disconnect`.
+
+ Examples
+ --------
+ ::
+
+ def on_press(event):
+ print('you pressed', event.button, event.xdata, event.ydata)
+
+ cid = canvas.mpl_connect('button_press_event', on_press)
+ """
+
+ return self.callbacks.connect(s, func)
+
+ def mpl_disconnect(self, cid):
+ """
+ Disconnect the callback with id *cid*.
+
+ Examples
+ --------
+ ::
+
+ cid = canvas.mpl_connect('button_press_event', on_press)
+ # ... later
+ canvas.mpl_disconnect(cid)
+ """
+ self.callbacks.disconnect(cid)
+
+ # Internal subclasses can override _timer_cls instead of new_timer, though
+ # this is not a public API for third-party subclasses.
+ _timer_cls = TimerBase
+
+ def new_timer(self, interval=None, callbacks=None):
+ """
+ Create a new backend-specific subclass of `.Timer`.
+
+ This is useful for getting periodic events through the backend's native
+ event loop. Implemented only for backends with GUIs.
+
+ Parameters
+ ----------
+ interval : int
+ Timer interval in milliseconds.
+
+ callbacks : list[tuple[callable, tuple, dict]]
+ Sequence of (func, args, kwargs) where ``func(*args, **kwargs)``
+ will be executed by the timer every *interval*.
+
+ Callbacks which return ``False`` or ``0`` will be removed from the
+ timer.
+
+ Examples
+ --------
+ >>> timer = fig.canvas.new_timer(callbacks=[(f1, (1,), {'a': 3})])
+ """
+ return self._timer_cls(interval=interval, callbacks=callbacks)
+
+ def flush_events(self):
+ """
+ Flush the GUI events for the figure.
+
+ Interactive backends need to reimplement this method.
+ """
+
+ def start_event_loop(self, timeout=0):
+ """
+ Start a blocking event loop.
+
+ Such an event loop is used by interactive functions, such as
+ `~.Figure.ginput` and `~.Figure.waitforbuttonpress`, to wait for
+ events.
+
+ The event loop blocks until a callback function triggers
+ `stop_event_loop`, or *timeout* is reached.
+
+ If *timeout* is 0 or negative, never timeout.
+
+ Only interactive backends need to reimplement this method and it relies
+ on `flush_events` being properly implemented.
+
+ Interactive backends should implement this in a more native way.
+ """
+ if timeout <= 0:
+ timeout = np.inf
+ timestep = 0.01
+ counter = 0
+ self._looping = True
+ while self._looping and counter * timestep < timeout:
+ self.flush_events()
+ time.sleep(timestep)
+ counter += 1
+
+ def stop_event_loop(self):
+ """
+ Stop the current blocking event loop.
+
+ Interactive backends need to reimplement this to match
+ `start_event_loop`
+ """
+ self._looping = False
+
+
+def key_press_handler(event, canvas=None, toolbar=None):
+ """
+ Implement the default Matplotlib key bindings for the canvas and toolbar
+ described at :ref:`key-event-handling`.
+
+ Parameters
+ ----------
+ event : `KeyEvent`
+ A key press/release event.
+ canvas : `FigureCanvasBase`, default: ``event.canvas``
+ The backend-specific canvas instance. This parameter is kept for
+ back-compatibility, but, if set, should always be equal to
+ ``event.canvas``.
+ toolbar : `NavigationToolbar2`, default: ``event.canvas.toolbar``
+ The navigation cursor toolbar. This parameter is kept for
+ back-compatibility, but, if set, should always be equal to
+ ``event.canvas.toolbar``.
+ """
+ if event.key is None:
+ return
+ if canvas is None:
+ canvas = event.canvas
+ if toolbar is None:
+ toolbar = canvas.toolbar
+
+ # toggle fullscreen mode (default key 'f', 'ctrl + f')
+ if event.key in rcParams['keymap.fullscreen']:
+ try:
+ canvas.manager.full_screen_toggle()
+ except AttributeError:
+ pass
+
+ # quit the figure (default key 'ctrl+w')
+ if event.key in rcParams['keymap.quit']:
+ Gcf.destroy_fig(canvas.figure)
+ if event.key in rcParams['keymap.quit_all']:
+ Gcf.destroy_all()
+
+ if toolbar is not None:
+ # home or reset mnemonic (default key 'h', 'home' and 'r')
+ if event.key in rcParams['keymap.home']:
+ toolbar.home()
+ # forward / backward keys to enable left handed quick navigation
+ # (default key for backward: 'left', 'backspace' and 'c')
+ elif event.key in rcParams['keymap.back']:
+ toolbar.back()
+ # (default key for forward: 'right' and 'v')
+ elif event.key in rcParams['keymap.forward']:
+ toolbar.forward()
+ # pan mnemonic (default key 'p')
+ elif event.key in rcParams['keymap.pan']:
+ toolbar.pan()
+ toolbar._update_cursor(event)
+ # zoom mnemonic (default key 'o')
+ elif event.key in rcParams['keymap.zoom']:
+ toolbar.zoom()
+ toolbar._update_cursor(event)
+ # saving current figure (default key 's')
+ elif event.key in rcParams['keymap.save']:
+ toolbar.save_figure()
+
+ if event.inaxes is None:
+ return
+
+ # these bindings require the mouse to be over an Axes to trigger
+ def _get_uniform_gridstate(ticks):
+ # Return True/False if all grid lines are on or off, None if they are
+ # not all in the same state.
+ return (True if all(tick.gridline.get_visible() for tick in ticks) else
+ False if not any(tick.gridline.get_visible() for tick in ticks) else
+ None)
+
+ ax = event.inaxes
+ # toggle major grids in current Axes (default key 'g')
+ # Both here and below (for 'G'), we do nothing if *any* grid (major or
+ # minor, x or y) is not in a uniform state, to avoid messing up user
+ # customization.
+ if (event.key in rcParams['keymap.grid']
+ # Exclude minor grids not in a uniform state.
+ and None not in [_get_uniform_gridstate(ax.xaxis.minorTicks),
+ _get_uniform_gridstate(ax.yaxis.minorTicks)]):
+ x_state = _get_uniform_gridstate(ax.xaxis.majorTicks)
+ y_state = _get_uniform_gridstate(ax.yaxis.majorTicks)
+ cycle = [(False, False), (True, False), (True, True), (False, True)]
+ try:
+ x_state, y_state = (
+ cycle[(cycle.index((x_state, y_state)) + 1) % len(cycle)])
+ except ValueError:
+ # Exclude major grids not in a uniform state.
+ pass
+ else:
+ # If turning major grids off, also turn minor grids off.
+ ax.grid(x_state, which="major" if x_state else "both", axis="x")
+ ax.grid(y_state, which="major" if y_state else "both", axis="y")
+ canvas.draw_idle()
+ # toggle major and minor grids in current Axes (default key 'G')
+ if (event.key in rcParams['keymap.grid_minor']
+ # Exclude major grids not in a uniform state.
+ and None not in [_get_uniform_gridstate(ax.xaxis.majorTicks),
+ _get_uniform_gridstate(ax.yaxis.majorTicks)]):
+ x_state = _get_uniform_gridstate(ax.xaxis.minorTicks)
+ y_state = _get_uniform_gridstate(ax.yaxis.minorTicks)
+ cycle = [(False, False), (True, False), (True, True), (False, True)]
+ try:
+ x_state, y_state = (
+ cycle[(cycle.index((x_state, y_state)) + 1) % len(cycle)])
+ except ValueError:
+ # Exclude minor grids not in a uniform state.
+ pass
+ else:
+ ax.grid(x_state, which="both", axis="x")
+ ax.grid(y_state, which="both", axis="y")
+ canvas.draw_idle()
+ # toggle scaling of y-axes between 'log and 'linear' (default key 'l')
+ elif event.key in rcParams['keymap.yscale']:
+ scale = ax.get_yscale()
+ if scale == 'log':
+ ax.set_yscale('linear')
+ ax.get_figure(root=True).canvas.draw_idle()
+ elif scale == 'linear':
+ try:
+ ax.set_yscale('log')
+ except ValueError as exc:
+ _log.warning(str(exc))
+ ax.set_yscale('linear')
+ ax.get_figure(root=True).canvas.draw_idle()
+ # toggle scaling of x-axes between 'log and 'linear' (default key 'k')
+ elif event.key in rcParams['keymap.xscale']:
+ scalex = ax.get_xscale()
+ if scalex == 'log':
+ ax.set_xscale('linear')
+ ax.get_figure(root=True).canvas.draw_idle()
+ elif scalex == 'linear':
+ try:
+ ax.set_xscale('log')
+ except ValueError as exc:
+ _log.warning(str(exc))
+ ax.set_xscale('linear')
+ ax.get_figure(root=True).canvas.draw_idle()
+
+
+def button_press_handler(event, canvas=None, toolbar=None):
+ """
+ The default Matplotlib button actions for extra mouse buttons.
+
+ Parameters are as for `key_press_handler`, except that *event* is a
+ `MouseEvent`.
+ """
+ if canvas is None:
+ canvas = event.canvas
+ if toolbar is None:
+ toolbar = canvas.toolbar
+ if toolbar is not None:
+ button_name = str(MouseButton(event.button))
+ if button_name in rcParams['keymap.back']:
+ toolbar.back()
+ elif button_name in rcParams['keymap.forward']:
+ toolbar.forward()
+
+
+class NonGuiException(Exception):
+ """Raised when trying show a figure in a non-GUI backend."""
+ pass
+
+
+class FigureManagerBase:
+ """
+ A backend-independent abstraction of a figure container and controller.
+
+ The figure manager is used by pyplot to interact with the window in a
+ backend-independent way. It's an adapter for the real (GUI) framework that
+ represents the visual figure on screen.
+
+ The figure manager is connected to a specific canvas instance, which in turn
+ is connected to a specific figure instance. To access a figure manager for
+ a given figure in user code, you typically use ``fig.canvas.manager``.
+
+ GUI backends derive from this class to translate common operations such
+ as *show* or *resize* to the GUI-specific code. Non-GUI backends do not
+ support these operations and can just use the base class.
+
+ This following basic operations are accessible:
+
+ **Window operations**
+
+ - `~.FigureManagerBase.show`
+ - `~.FigureManagerBase.destroy`
+ - `~.FigureManagerBase.full_screen_toggle`
+ - `~.FigureManagerBase.resize`
+ - `~.FigureManagerBase.get_window_title`
+ - `~.FigureManagerBase.set_window_title`
+
+ **Key and mouse button press handling**
+
+ The figure manager sets up default key and mouse button press handling by
+ hooking up the `.key_press_handler` to the matplotlib event system. This
+ ensures the same shortcuts and mouse actions across backends.
+
+ **Other operations**
+
+ Subclasses will have additional attributes and functions to access
+ additional functionality. This is of course backend-specific. For example,
+ most GUI backends have ``window`` and ``toolbar`` attributes that give
+ access to the native GUI widgets of the respective framework.
+
+ Attributes
+ ----------
+ canvas : `FigureCanvasBase`
+ The backend-specific canvas instance.
+
+ num : int or str
+ The figure number.
+
+ key_press_handler_id : int
+ The default key handler cid, when using the toolmanager.
+ To disable the default key press handling use::
+
+ figure.canvas.mpl_disconnect(
+ figure.canvas.manager.key_press_handler_id)
+
+ button_press_handler_id : int
+ The default mouse button handler cid, when using the toolmanager.
+ To disable the default button press handling use::
+
+ figure.canvas.mpl_disconnect(
+ figure.canvas.manager.button_press_handler_id)
+ """
+
+ _toolbar2_class = None
+ _toolmanager_toolbar_class = None
+
+ def __init__(self, canvas, num):
+ self.canvas = canvas
+ canvas.manager = self # store a pointer to parent
+ self.num = num
+ self.set_window_title(f"Figure {num:d}")
+
+ self.key_press_handler_id = None
+ self.button_press_handler_id = None
+ if rcParams['toolbar'] != 'toolmanager':
+ self.key_press_handler_id = self.canvas.mpl_connect(
+ 'key_press_event', key_press_handler)
+ self.button_press_handler_id = self.canvas.mpl_connect(
+ 'button_press_event', button_press_handler)
+
+ self.toolmanager = (ToolManager(canvas.figure)
+ if mpl.rcParams['toolbar'] == 'toolmanager'
+ else None)
+ if (mpl.rcParams["toolbar"] == "toolbar2"
+ and self._toolbar2_class):
+ self.toolbar = self._toolbar2_class(self.canvas)
+ elif (mpl.rcParams["toolbar"] == "toolmanager"
+ and self._toolmanager_toolbar_class):
+ self.toolbar = self._toolmanager_toolbar_class(self.toolmanager)
+ else:
+ self.toolbar = None
+
+ if self.toolmanager:
+ tools.add_tools_to_manager(self.toolmanager)
+ if self.toolbar:
+ tools.add_tools_to_container(self.toolbar)
+
+ @self.canvas.figure.add_axobserver
+ def notify_axes_change(fig):
+ # Called whenever the current Axes is changed.
+ if self.toolmanager is None and self.toolbar is not None:
+ self.toolbar.update()
+
+ @classmethod
+ def create_with_canvas(cls, canvas_class, figure, num):
+ """
+ Create a manager for a given *figure* using a specific *canvas_class*.
+
+ Backends should override this method if they have specific needs for
+ setting up the canvas or the manager.
+ """
+ return cls(canvas_class(figure), num)
+
+ @classmethod
+ def start_main_loop(cls):
+ """
+ Start the main event loop.
+
+ This method is called by `.FigureManagerBase.pyplot_show`, which is the
+ implementation of `.pyplot.show`. To customize the behavior of
+ `.pyplot.show`, interactive backends should usually override
+ `~.FigureManagerBase.start_main_loop`; if more customized logic is
+ necessary, `~.FigureManagerBase.pyplot_show` can also be overridden.
+ """
+
+ @classmethod
+ def pyplot_show(cls, *, block=None):
+ """
+ Show all figures. This method is the implementation of `.pyplot.show`.
+
+ To customize the behavior of `.pyplot.show`, interactive backends
+ should usually override `~.FigureManagerBase.start_main_loop`; if more
+ customized logic is necessary, `~.FigureManagerBase.pyplot_show` can
+ also be overridden.
+
+ Parameters
+ ----------
+ block : bool, optional
+ Whether to block by calling ``start_main_loop``. The default,
+ None, means to block if we are neither in IPython's ``%pylab`` mode
+ nor in ``interactive`` mode.
+ """
+ managers = Gcf.get_all_fig_managers()
+ if not managers:
+ return
+ for manager in managers:
+ try:
+ manager.show() # Emits a warning for non-interactive backend.
+ except NonGuiException as exc:
+ _api.warn_external(str(exc))
+ if block is None:
+ # Hack: Are we in IPython's %pylab mode? In pylab mode, IPython
+ # (>= 0.10) tacks a _needmain attribute onto pyplot.show (always
+ # set to False).
+ pyplot_show = getattr(sys.modules.get("matplotlib.pyplot"), "show", None)
+ ipython_pylab = hasattr(pyplot_show, "_needmain")
+ block = not ipython_pylab and not is_interactive()
+ if block:
+ cls.start_main_loop()
+
+ def show(self):
+ """
+ For GUI backends, show the figure window and redraw.
+ For non-GUI backends, raise an exception, unless running headless (i.e.
+ on Linux with an unset DISPLAY); this exception is converted to a
+ warning in `.Figure.show`.
+ """
+ # This should be overridden in GUI backends.
+ if sys.platform == "linux" and not os.environ.get("DISPLAY"):
+ # We cannot check _get_running_interactive_framework() ==
+ # "headless" because that would also suppress the warning when
+ # $DISPLAY exists but is invalid, which is more likely an error and
+ # thus warrants a warning.
+ return
+ raise NonGuiException(
+ f"{type(self.canvas).__name__} is non-interactive, and thus cannot be "
+ f"shown")
+
+ def destroy(self):
+ pass
+
+ def full_screen_toggle(self):
+ pass
+
+ def resize(self, w, h):
+ """For GUI backends, resize the window (in physical pixels)."""
+
+ def get_window_title(self):
+ """Return the title text of the window containing the figure."""
+ return self._window_title
+
+ def set_window_title(self, title):
+ """
+ Set the title text of the window containing the figure.
+
+ Examples
+ --------
+ >>> fig = plt.figure()
+ >>> fig.canvas.manager.set_window_title('My figure')
+ """
+ # This attribute is not defined in __init__ (but __init__ calls this
+ # setter), as derived classes (real GUI managers) will store this
+ # information directly on the widget; only the base (non-GUI) manager
+ # class needs a specific attribute for it (so that filename escaping
+ # can be checked in the test suite).
+ self._window_title = title
+
+
+cursors = tools.cursors
+
+
+class _Mode(str, Enum):
+ NONE = ""
+ PAN = "pan/zoom"
+ ZOOM = "zoom rect"
+
+ def __str__(self):
+ return self.value
+
+ @property
+ def _navigate_mode(self):
+ return self.name if self is not _Mode.NONE else None
+
+
+class NavigationToolbar2:
+ """
+ Base class for the navigation cursor, version 2.
+
+ Backends must implement a canvas that handles connections for
+ 'button_press_event' and 'button_release_event'. See
+ :meth:`FigureCanvasBase.mpl_connect` for more information.
+
+ They must also define
+
+ :meth:`save_figure`
+ Save the current figure.
+
+ :meth:`draw_rubberband` (optional)
+ Draw the zoom to rect "rubberband" rectangle.
+
+ :meth:`set_message` (optional)
+ Display message.
+
+ :meth:`set_history_buttons` (optional)
+ You can change the history back / forward buttons to indicate disabled / enabled
+ state.
+
+ and override ``__init__`` to set up the toolbar -- without forgetting to
+ call the base-class init. Typically, ``__init__`` needs to set up toolbar
+ buttons connected to the `home`, `back`, `forward`, `pan`, `zoom`, and
+ `save_figure` methods and using standard icons in the "images" subdirectory
+ of the data path.
+
+ That's it, we'll do the rest!
+ """
+
+ # list of toolitems to add to the toolbar, format is:
+ # (
+ # text, # the text of the button (often not visible to users)
+ # tooltip_text, # the tooltip shown on hover (where possible)
+ # image_file, # name of the image for the button (without the extension)
+ # name_of_method, # name of the method in NavigationToolbar2 to call
+ # )
+ toolitems = (
+ ('Home', 'Reset original view', 'home', 'home'),
+ ('Back', 'Back to previous view', 'back', 'back'),
+ ('Forward', 'Forward to next view', 'forward', 'forward'),
+ (None, None, None, None),
+ ('Pan',
+ 'Left button pans, Right button zooms\n'
+ 'x/y fixes axis, CTRL fixes aspect',
+ 'move', 'pan'),
+ ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'zoom_to_rect', 'zoom'),
+ ('Subplots', 'Configure subplots', 'subplots', 'configure_subplots'),
+ (None, None, None, None),
+ ('Save', 'Save the figure', 'filesave', 'save_figure'),
+ )
+
+ UNKNOWN_SAVED_STATUS = object()
+
+ def __init__(self, canvas):
+ self.canvas = canvas
+ canvas.toolbar = self
+ self._nav_stack = cbook._Stack()
+ # This cursor will be set after the initial draw.
+ self._last_cursor = tools.Cursors.POINTER
+
+ self._id_press = self.canvas.mpl_connect(
+ 'button_press_event', self._zoom_pan_handler)
+ self._id_release = self.canvas.mpl_connect(
+ 'button_release_event', self._zoom_pan_handler)
+ self._id_drag = self.canvas.mpl_connect(
+ 'motion_notify_event', self.mouse_move)
+ self._pan_info = None
+ self._zoom_info = None
+
+ self.mode = _Mode.NONE # a mode string for the status bar
+ self.set_history_buttons()
+
+ def set_message(self, s):
+ """Display a message on toolbar or in status bar."""
+
+ def draw_rubberband(self, event, x0, y0, x1, y1):
+ """
+ Draw a rectangle rubberband to indicate zoom limits.
+
+ Note that it is not guaranteed that ``x0 <= x1`` and ``y0 <= y1``.
+ """
+
+ def remove_rubberband(self):
+ """Remove the rubberband."""
+
+ def home(self, *args):
+ """
+ Restore the original view.
+
+ For convenience of being directly connected as a GUI callback, which
+ often get passed additional parameters, this method accepts arbitrary
+ parameters, but does not use them.
+ """
+ self._nav_stack.home()
+ self.set_history_buttons()
+ self._update_view()
+
+ def back(self, *args):
+ """
+ Move back up the view lim stack.
+
+ For convenience of being directly connected as a GUI callback, which
+ often get passed additional parameters, this method accepts arbitrary
+ parameters, but does not use them.
+ """
+ self._nav_stack.back()
+ self.set_history_buttons()
+ self._update_view()
+
+ def forward(self, *args):
+ """
+ Move forward in the view lim stack.
+
+ For convenience of being directly connected as a GUI callback, which
+ often get passed additional parameters, this method accepts arbitrary
+ parameters, but does not use them.
+ """
+ self._nav_stack.forward()
+ self.set_history_buttons()
+ self._update_view()
+
+ def _update_cursor(self, event):
+ """
+ Update the cursor after a mouse move event or a tool (de)activation.
+ """
+ if self.mode and event.inaxes and event.inaxes.get_navigate():
+ if (self.mode == _Mode.ZOOM
+ and self._last_cursor != tools.Cursors.SELECT_REGION):
+ self.canvas.set_cursor(tools.Cursors.SELECT_REGION)
+ self._last_cursor = tools.Cursors.SELECT_REGION
+ elif (self.mode == _Mode.PAN
+ and self._last_cursor != tools.Cursors.MOVE):
+ self.canvas.set_cursor(tools.Cursors.MOVE)
+ self._last_cursor = tools.Cursors.MOVE
+ elif self._last_cursor != tools.Cursors.POINTER:
+ self.canvas.set_cursor(tools.Cursors.POINTER)
+ self._last_cursor = tools.Cursors.POINTER
+
+ @contextmanager
+ def _wait_cursor_for_draw_cm(self):
+ """
+ Set the cursor to a wait cursor when drawing the canvas.
+
+ In order to avoid constantly changing the cursor when the canvas
+ changes frequently, do nothing if this context was triggered during the
+ last second. (Optimally we'd prefer only setting the wait cursor if
+ the *current* draw takes too long, but the current draw blocks the GUI
+ thread).
+ """
+ self._draw_time, last_draw_time = (
+ time.time(), getattr(self, "_draw_time", -np.inf))
+ if self._draw_time - last_draw_time > 1:
+ try:
+ self.canvas.set_cursor(tools.Cursors.WAIT)
+ yield
+ finally:
+ self.canvas.set_cursor(self._last_cursor)
+ else:
+ yield
+
+ @staticmethod
+ def _mouse_event_to_message(event):
+ if event.inaxes and event.inaxes.get_navigate():
+ try:
+ s = event.inaxes.format_coord(event.xdata, event.ydata)
+ except (ValueError, OverflowError):
+ pass
+ else:
+ s = s.rstrip()
+ artists = [a for a in event.inaxes._mouseover_set
+ if a.contains(event)[0] and a.get_visible()]
+ if artists:
+ a = cbook._topmost_artist(artists)
+ if a is not event.inaxes.patch:
+ data = a.get_cursor_data(event)
+ if data is not None:
+ data_str = a.format_cursor_data(data).rstrip()
+ if data_str:
+ s = s + '\n' + data_str
+ return s
+ return ""
+
+ def mouse_move(self, event):
+ self._update_cursor(event)
+ self.set_message(self._mouse_event_to_message(event))
+
+ def _zoom_pan_handler(self, event):
+ if self.mode == _Mode.PAN:
+ if event.name == "button_press_event":
+ self.press_pan(event)
+ elif event.name == "button_release_event":
+ self.release_pan(event)
+ if self.mode == _Mode.ZOOM:
+ if event.name == "button_press_event":
+ self.press_zoom(event)
+ elif event.name == "button_release_event":
+ self.release_zoom(event)
+
+ def _start_event_axes_interaction(self, event, *, method):
+
+ def _ax_filter(ax):
+ return (ax.in_axes(event) and
+ ax.get_navigate() and
+ getattr(ax, f"can_{method}")()
+ )
+
+ def _capture_events(ax):
+ f = ax.get_forward_navigation_events()
+ if f == "auto": # (capture = patch visibility)
+ f = not ax.patch.get_visible()
+ return not f
+
+ # get all relevant axes for the event
+ axes = list(filter(_ax_filter, self.canvas.figure.get_axes()))
+
+ if len(axes) == 0:
+ return []
+
+ if self._nav_stack() is None:
+ self.push_current() # Set the home button to this view.
+
+ # group axes by zorder (reverse to trigger later axes first)
+ grps = dict()
+ for ax in reversed(axes):
+ grps.setdefault(ax.get_zorder(), []).append(ax)
+
+ axes_to_trigger = []
+ # go through zorders in reverse until we hit a capturing axes
+ for zorder in sorted(grps, reverse=True):
+ for ax in grps[zorder]:
+ axes_to_trigger.append(ax)
+ # NOTE: shared axes are automatically triggered, but twin-axes not!
+ axes_to_trigger.extend(ax._twinned_axes.get_siblings(ax))
+
+ if _capture_events(ax):
+ break # break if we hit a capturing axes
+ else:
+ # If the inner loop finished without an explicit break,
+ # (e.g. no capturing axes was found) continue the
+ # outer loop to the next zorder.
+ continue
+
+ # If the inner loop was terminated with an explicit break,
+ # terminate the outer loop as well.
+ break
+
+ # avoid duplicated triggers (but keep order of list)
+ axes_to_trigger = list(dict.fromkeys(axes_to_trigger))
+
+ return axes_to_trigger
+
+ def pan(self, *args):
+ """
+ Toggle the pan/zoom tool.
+
+ Pan with left button, zoom with right.
+ """
+ if not self.canvas.widgetlock.available(self):
+ self.set_message("pan unavailable")
+ return
+ if self.mode == _Mode.PAN:
+ self.mode = _Mode.NONE
+ self.canvas.widgetlock.release(self)
+ else:
+ self.mode = _Mode.PAN
+ self.canvas.widgetlock(self)
+ for a in self.canvas.figure.get_axes():
+ a.set_navigate_mode(self.mode._navigate_mode)
+
+ _PanInfo = namedtuple("_PanInfo", "button axes cid")
+
+ def press_pan(self, event):
+ """Callback for mouse button press in pan/zoom mode."""
+ if (event.button not in [MouseButton.LEFT, MouseButton.RIGHT]
+ or event.x is None or event.y is None):
+ return
+
+ axes = self._start_event_axes_interaction(event, method="pan")
+ if not axes:
+ return
+
+ # call "ax.start_pan(..)" on all relevant axes of an event
+ for ax in axes:
+ ax.start_pan(event.x, event.y, event.button)
+
+ self.canvas.mpl_disconnect(self._id_drag)
+ id_drag = self.canvas.mpl_connect("motion_notify_event", self.drag_pan)
+
+ self._pan_info = self._PanInfo(
+ button=event.button, axes=axes, cid=id_drag)
+
+ def drag_pan(self, event):
+ """Callback for dragging in pan/zoom mode."""
+ for ax in self._pan_info.axes:
+ # Using the recorded button at the press is safer than the current
+ # button, as multiple buttons can get pressed during motion.
+ ax.drag_pan(self._pan_info.button, event.key, event.x, event.y)
+ self.canvas.draw_idle()
+
+ def release_pan(self, event):
+ """Callback for mouse button release in pan/zoom mode."""
+ if self._pan_info is None:
+ return
+ self.canvas.mpl_disconnect(self._pan_info.cid)
+ self._id_drag = self.canvas.mpl_connect(
+ 'motion_notify_event', self.mouse_move)
+ for ax in self._pan_info.axes:
+ ax.end_pan()
+ self.canvas.draw_idle()
+ self._pan_info = None
+ self.push_current()
+
+ def zoom(self, *args):
+ if not self.canvas.widgetlock.available(self):
+ self.set_message("zoom unavailable")
+ return
+ """Toggle zoom to rect mode."""
+ if self.mode == _Mode.ZOOM:
+ self.mode = _Mode.NONE
+ self.canvas.widgetlock.release(self)
+ else:
+ self.mode = _Mode.ZOOM
+ self.canvas.widgetlock(self)
+ for a in self.canvas.figure.get_axes():
+ a.set_navigate_mode(self.mode._navigate_mode)
+
+ _ZoomInfo = namedtuple("_ZoomInfo", "direction start_xy axes cid cbar")
+
+ def press_zoom(self, event):
+ """Callback for mouse button press in zoom to rect mode."""
+ if (event.button not in [MouseButton.LEFT, MouseButton.RIGHT]
+ or event.x is None or event.y is None):
+ return
+
+ axes = self._start_event_axes_interaction(event, method="zoom")
+ if not axes:
+ return
+
+ id_zoom = self.canvas.mpl_connect(
+ "motion_notify_event", self.drag_zoom)
+
+ # A colorbar is one-dimensional, so we extend the zoom rectangle out
+ # to the edge of the Axes bbox in the other dimension. To do that we
+ # store the orientation of the colorbar for later.
+ parent_ax = axes[0]
+ if hasattr(parent_ax, "_colorbar"):
+ cbar = parent_ax._colorbar.orientation
+ else:
+ cbar = None
+
+ self._zoom_info = self._ZoomInfo(
+ direction="in" if event.button == 1 else "out",
+ start_xy=(event.x, event.y), axes=axes, cid=id_zoom, cbar=cbar)
+
+ def drag_zoom(self, event):
+ """Callback for dragging in zoom mode."""
+ start_xy = self._zoom_info.start_xy
+ ax = self._zoom_info.axes[0]
+ (x1, y1), (x2, y2) = np.clip(
+ [start_xy, [event.x, event.y]], ax.bbox.min, ax.bbox.max)
+ key = event.key
+ # Force the key on colorbars to extend the short-axis bbox
+ if self._zoom_info.cbar == "horizontal":
+ key = "x"
+ elif self._zoom_info.cbar == "vertical":
+ key = "y"
+ if key == "x":
+ y1, y2 = ax.bbox.intervaly
+ elif key == "y":
+ x1, x2 = ax.bbox.intervalx
+
+ self.draw_rubberband(event, x1, y1, x2, y2)
+
+ def release_zoom(self, event):
+ """Callback for mouse button release in zoom to rect mode."""
+ if self._zoom_info is None:
+ return
+
+ # We don't check the event button here, so that zooms can be cancelled
+ # by (pressing and) releasing another mouse button.
+ self.canvas.mpl_disconnect(self._zoom_info.cid)
+ self.remove_rubberband()
+
+ start_x, start_y = self._zoom_info.start_xy
+ key = event.key
+ # Force the key on colorbars to ignore the zoom-cancel on the
+ # short-axis side
+ if self._zoom_info.cbar == "horizontal":
+ key = "x"
+ elif self._zoom_info.cbar == "vertical":
+ key = "y"
+ # Ignore single clicks: 5 pixels is a threshold that allows the user to
+ # "cancel" a zoom action by zooming by less than 5 pixels.
+ if ((abs(event.x - start_x) < 5 and key != "y") or
+ (abs(event.y - start_y) < 5 and key != "x")):
+ self.canvas.draw_idle()
+ self._zoom_info = None
+ return
+
+ for i, ax in enumerate(self._zoom_info.axes):
+ # Detect whether this Axes is twinned with an earlier Axes in the
+ # list of zoomed Axes, to avoid double zooming.
+ twinx = any(ax.get_shared_x_axes().joined(ax, prev)
+ for prev in self._zoom_info.axes[:i])
+ twiny = any(ax.get_shared_y_axes().joined(ax, prev)
+ for prev in self._zoom_info.axes[:i])
+ ax._set_view_from_bbox(
+ (start_x, start_y, event.x, event.y),
+ self._zoom_info.direction, key, twinx, twiny)
+
+ self.canvas.draw_idle()
+ self._zoom_info = None
+ self.push_current()
+
+ def push_current(self):
+ """Push the current view limits and position onto the stack."""
+ self._nav_stack.push(
+ WeakKeyDictionary(
+ {ax: (ax._get_view(),
+ # Store both the original and modified positions.
+ (ax.get_position(True).frozen(),
+ ax.get_position().frozen()))
+ for ax in self.canvas.figure.axes}))
+ self.set_history_buttons()
+
+ def _update_view(self):
+ """
+ Update the viewlim and position from the view and position stack for
+ each Axes.
+ """
+ nav_info = self._nav_stack()
+ if nav_info is None:
+ return
+ # Retrieve all items at once to avoid any risk of GC deleting an Axes
+ # while in the middle of the loop below.
+ items = list(nav_info.items())
+ for ax, (view, (pos_orig, pos_active)) in items:
+ ax._set_view(view)
+ # Restore both the original and modified positions
+ ax._set_position(pos_orig, 'original')
+ ax._set_position(pos_active, 'active')
+ self.canvas.draw_idle()
+
+ def configure_subplots(self, *args):
+ if hasattr(self, "subplot_tool"):
+ self.subplot_tool.figure.canvas.manager.show()
+ return
+ # This import needs to happen here due to circular imports.
+ from matplotlib.figure import Figure
+ with mpl.rc_context({"toolbar": "none"}): # No navbar for the toolfig.
+ manager = type(self.canvas).new_manager(Figure(figsize=(6, 3)), -1)
+ manager.set_window_title("Subplot configuration tool")
+ tool_fig = manager.canvas.figure
+ tool_fig.subplots_adjust(top=0.9)
+ self.subplot_tool = widgets.SubplotTool(self.canvas.figure, tool_fig)
+ cid = self.canvas.mpl_connect(
+ "close_event", lambda e: manager.destroy())
+
+ def on_tool_fig_close(e):
+ self.canvas.mpl_disconnect(cid)
+ del self.subplot_tool
+
+ tool_fig.canvas.mpl_connect("close_event", on_tool_fig_close)
+ manager.show()
+ return self.subplot_tool
+
+ def save_figure(self, *args):
+ """
+ Save the current figure.
+
+ Backend implementations may choose to return
+ the absolute path of the saved file, if any, as
+ a string.
+
+ If no file is created then `None` is returned.
+
+ If the backend does not implement this functionality
+ then `NavigationToolbar2.UNKNOWN_SAVED_STATUS` is returned.
+
+ Returns
+ -------
+ str or `NavigationToolbar2.UNKNOWN_SAVED_STATUS` or `None`
+ The filepath of the saved figure.
+ Returns `None` if figure is not saved.
+ Returns `NavigationToolbar2.UNKNOWN_SAVED_STATUS` when
+ the backend does not provide the information.
+ """
+ raise NotImplementedError
+
+ def update(self):
+ """Reset the Axes stack."""
+ self._nav_stack.clear()
+ self.set_history_buttons()
+
+ def set_history_buttons(self):
+ """Enable or disable the back/forward button."""
+
+
+class ToolContainerBase:
+ """
+ Base class for all tool containers, e.g. toolbars.
+
+ Attributes
+ ----------
+ toolmanager : `.ToolManager`
+ The tools with which this `ToolContainer` wants to communicate.
+ """
+
+ _icon_extension = '.png'
+ """
+ Toolcontainer button icon image format extension
+
+ **String**: Image extension
+ """
+
+ def __init__(self, toolmanager):
+ self.toolmanager = toolmanager
+ toolmanager.toolmanager_connect(
+ 'tool_message_event',
+ lambda event: self.set_message(event.message))
+ toolmanager.toolmanager_connect(
+ 'tool_removed_event',
+ lambda event: self.remove_toolitem(event.tool.name))
+
+ def _tool_toggled_cbk(self, event):
+ """
+ Capture the 'tool_trigger_[name]'
+
+ This only gets used for toggled tools.
+ """
+ self.toggle_toolitem(event.tool.name, event.tool.toggled)
+
+ def add_tool(self, tool, group, position=-1):
+ """
+ Add a tool to this container.
+
+ Parameters
+ ----------
+ tool : tool_like
+ The tool to add, see `.ToolManager.get_tool`.
+ group : str
+ The name of the group to add this tool to.
+ position : int, default: -1
+ The position within the group to place this tool.
+ """
+ tool = self.toolmanager.get_tool(tool)
+ image = self._get_image_filename(tool)
+ toggle = getattr(tool, 'toggled', None) is not None
+ self.add_toolitem(tool.name, group, position,
+ image, tool.description, toggle)
+ if toggle:
+ self.toolmanager.toolmanager_connect('tool_trigger_%s' % tool.name,
+ self._tool_toggled_cbk)
+ # If initially toggled
+ if tool.toggled:
+ self.toggle_toolitem(tool.name, True)
+
+ def _get_image_filename(self, tool):
+ """Resolve a tool icon's filename."""
+ if not tool.image:
+ return None
+ if os.path.isabs(tool.image):
+ filename = tool.image
+ else:
+ if "image" in getattr(tool, "__dict__", {}):
+ raise ValueError("If 'tool.image' is an instance variable, "
+ "it must be an absolute path")
+ for cls in type(tool).__mro__:
+ if "image" in vars(cls):
+ try:
+ src = inspect.getfile(cls)
+ break
+ except (OSError, TypeError):
+ raise ValueError("Failed to locate source file "
+ "where 'tool.image' is defined") from None
+ else:
+ raise ValueError("Failed to find parent class defining 'tool.image'")
+ filename = str(pathlib.Path(src).parent / tool.image)
+ for filename in [filename, filename + self._icon_extension]:
+ if os.path.isfile(filename):
+ return os.path.abspath(filename)
+ for fname in [ # Fallback; once deprecation elapses.
+ tool.image,
+ tool.image + self._icon_extension,
+ cbook._get_data_path("images", tool.image),
+ cbook._get_data_path("images", tool.image + self._icon_extension),
+ ]:
+ if os.path.isfile(fname):
+ _api.warn_deprecated(
+ "3.9", message=f"Loading icon {tool.image!r} from the current "
+ "directory or from Matplotlib's image directory. This behavior "
+ "is deprecated since %(since)s and will be removed in %(removal)s; "
+ "Tool.image should be set to a path relative to the Tool's source "
+ "file, or to an absolute path.")
+ return os.path.abspath(fname)
+
+ def trigger_tool(self, name):
+ """
+ Trigger the tool.
+
+ Parameters
+ ----------
+ name : str
+ Name (id) of the tool triggered from within the container.
+ """
+ self.toolmanager.trigger_tool(name, sender=self)
+
+ def add_toolitem(self, name, group, position, image, description, toggle):
+ """
+ A hook to add a toolitem to the container.
+
+ This hook must be implemented in each backend and contains the
+ backend-specific code to add an element to the toolbar.
+
+ .. warning::
+ This is part of the backend implementation and should
+ not be called by end-users. They should instead call
+ `.ToolContainerBase.add_tool`.
+
+ The callback associated with the button click event
+ must be *exactly* ``self.trigger_tool(name)``.
+
+ Parameters
+ ----------
+ name : str
+ Name of the tool to add, this gets used as the tool's ID and as the
+ default label of the buttons.
+ group : str
+ Name of the group that this tool belongs to.
+ position : int
+ Position of the tool within its group, if -1 it goes at the end.
+ image : str
+ Filename of the image for the button or `None`.
+ description : str
+ Description of the tool, used for the tooltips.
+ toggle : bool
+ * `True` : The button is a toggle (change the pressed/unpressed
+ state between consecutive clicks).
+ * `False` : The button is a normal button (returns to unpressed
+ state after release).
+ """
+ raise NotImplementedError
+
+ def toggle_toolitem(self, name, toggled):
+ """
+ A hook to toggle a toolitem without firing an event.
+
+ This hook must be implemented in each backend and contains the
+ backend-specific code to silently toggle a toolbar element.
+
+ .. warning::
+ This is part of the backend implementation and should
+ not be called by end-users. They should instead call
+ `.ToolManager.trigger_tool` or `.ToolContainerBase.trigger_tool`
+ (which are equivalent).
+
+ Parameters
+ ----------
+ name : str
+ Id of the tool to toggle.
+ toggled : bool
+ Whether to set this tool as toggled or not.
+ """
+ raise NotImplementedError
+
+ def remove_toolitem(self, name):
+ """
+ A hook to remove a toolitem from the container.
+
+ This hook must be implemented in each backend and contains the
+ backend-specific code to remove an element from the toolbar; it is
+ called when `.ToolManager` emits a ``tool_removed_event``.
+
+ Because some tools are present only on the `.ToolManager` but not on
+ the `ToolContainer`, this method must be a no-op when called on a tool
+ absent from the container.
+
+ .. warning::
+ This is part of the backend implementation and should
+ not be called by end-users. They should instead call
+ `.ToolManager.remove_tool`.
+
+ Parameters
+ ----------
+ name : str
+ Name of the tool to remove.
+ """
+ raise NotImplementedError
+
+ def set_message(self, s):
+ """
+ Display a message on the toolbar.
+
+ Parameters
+ ----------
+ s : str
+ Message text.
+ """
+ raise NotImplementedError
+
+
+class _Backend:
+ # A backend can be defined by using the following pattern:
+ #
+ # @_Backend.export
+ # class FooBackend(_Backend):
+ # # override the attributes and methods documented below.
+
+ # `backend_version` may be overridden by the subclass.
+ backend_version = "unknown"
+
+ # The `FigureCanvas` class must be defined.
+ FigureCanvas = None
+
+ # For interactive backends, the `FigureManager` class must be overridden.
+ FigureManager = FigureManagerBase
+
+ # For interactive backends, `mainloop` should be a function taking no
+ # argument and starting the backend main loop. It should be left as None
+ # for non-interactive backends.
+ mainloop = None
+
+ # The following methods will be automatically defined and exported, but
+ # can be overridden.
+
+ @classmethod
+ def new_figure_manager(cls, num, *args, **kwargs):
+ """Create a new figure manager instance."""
+ # This import needs to happen here due to circular imports.
+ from matplotlib.figure import Figure
+ fig_cls = kwargs.pop('FigureClass', Figure)
+ fig = fig_cls(*args, **kwargs)
+ return cls.new_figure_manager_given_figure(num, fig)
+
+ @classmethod
+ def new_figure_manager_given_figure(cls, num, figure):
+ """Create a new figure manager instance for the given figure."""
+ return cls.FigureCanvas.new_manager(figure, num)
+
+ @classmethod
+ def draw_if_interactive(cls):
+ manager_class = cls.FigureCanvas.manager_class
+ # Interactive backends reimplement start_main_loop or pyplot_show.
+ backend_is_interactive = (
+ manager_class.start_main_loop != FigureManagerBase.start_main_loop
+ or manager_class.pyplot_show != FigureManagerBase.pyplot_show)
+ if backend_is_interactive and is_interactive():
+ manager = Gcf.get_active()
+ if manager:
+ manager.canvas.draw_idle()
+
+ @classmethod
+ def show(cls, *, block=None):
+ """
+ Show all figures.
+
+ `show` blocks by calling `mainloop` if *block* is ``True``, or if it is
+ ``None`` and we are not in `interactive` mode and if IPython's
+ ``%matplotlib`` integration has not been activated.
+ """
+ managers = Gcf.get_all_fig_managers()
+ if not managers:
+ return
+ for manager in managers:
+ try:
+ manager.show() # Emits a warning for non-interactive backend.
+ except NonGuiException as exc:
+ _api.warn_external(str(exc))
+ if cls.mainloop is None:
+ return
+ if block is None:
+ # Hack: Is IPython's %matplotlib integration activated? If so,
+ # IPython's activate_matplotlib (>= 0.10) tacks a _needmain
+ # attribute onto pyplot.show (always set to False).
+ pyplot_show = getattr(sys.modules.get("matplotlib.pyplot"), "show", None)
+ ipython_pylab = hasattr(pyplot_show, "_needmain")
+ block = not ipython_pylab and not is_interactive()
+ if block:
+ cls.mainloop()
+
+ # This method is the one actually exporting the required methods.
+
+ @staticmethod
+ def export(cls):
+ for name in [
+ "backend_version",
+ "FigureCanvas",
+ "FigureManager",
+ "new_figure_manager",
+ "new_figure_manager_given_figure",
+ "draw_if_interactive",
+ "show",
+ ]:
+ setattr(sys.modules[cls.__module__], name, getattr(cls, name))
+
+ # For back-compatibility, generate a shim `Show` class.
+
+ class Show(ShowBase):
+ def mainloop(self):
+ return cls.mainloop()
+
+ setattr(sys.modules[cls.__module__], "Show", Show)
+ return cls
+
+
+class ShowBase(_Backend):
+ """
+ Simple base class to generate a ``show()`` function in backends.
+
+ Subclass must override ``mainloop()`` method.
+ """
+
+ def __call__(self, block=None):
+ return self.show(block=block)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_bases.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_bases.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..23a19b79d3be43f707ff02cf33540aa1102e06cc
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_bases.pyi
@@ -0,0 +1,482 @@
+from enum import Enum, IntEnum
+import os
+from matplotlib import (
+ cbook,
+ transforms,
+ widgets,
+ _api,
+)
+from matplotlib.artist import Artist
+from matplotlib.axes import Axes
+from matplotlib.backend_managers import ToolManager
+from matplotlib.backend_tools import Cursors, ToolBase
+from matplotlib.colorbar import Colorbar
+from matplotlib.figure import Figure
+from matplotlib.font_manager import FontProperties
+from matplotlib.path import Path
+from matplotlib.texmanager import TexManager
+from matplotlib.text import Text
+from matplotlib.transforms import Bbox, BboxBase, Transform, TransformedPath
+
+from collections.abc import Callable, Iterable, Sequence
+from typing import Any, IO, Literal, NamedTuple, TypeVar
+from numpy.typing import ArrayLike
+from .typing import ColorType, LineStyleType, CapStyleType, JoinStyleType
+
+def register_backend(
+ format: str, backend: str | type[FigureCanvasBase], description: str | None = ...
+) -> None: ...
+def get_registered_canvas_class(format: str) -> type[FigureCanvasBase]: ...
+
+class RendererBase:
+ def __init__(self) -> None: ...
+ def open_group(self, s: str, gid: str | None = ...) -> None: ...
+ def close_group(self, s: str) -> None: ...
+ def draw_path(
+ self,
+ gc: GraphicsContextBase,
+ path: Path,
+ transform: Transform,
+ rgbFace: ColorType | None = ...,
+ ) -> None: ...
+ def draw_markers(
+ self,
+ gc: GraphicsContextBase,
+ marker_path: Path,
+ marker_trans: Transform,
+ path: Path,
+ trans: Transform,
+ rgbFace: ColorType | None = ...,
+ ) -> None: ...
+ def draw_path_collection(
+ self,
+ gc: GraphicsContextBase,
+ master_transform: Transform,
+ paths: Sequence[Path],
+ all_transforms: Sequence[ArrayLike],
+ offsets: ArrayLike | Sequence[ArrayLike],
+ offset_trans: Transform,
+ facecolors: ColorType | Sequence[ColorType],
+ edgecolors: ColorType | Sequence[ColorType],
+ linewidths: float | Sequence[float],
+ linestyles: LineStyleType | Sequence[LineStyleType],
+ antialiaseds: bool | Sequence[bool],
+ urls: str | Sequence[str],
+ offset_position: Any,
+ ) -> None: ...
+ def draw_quad_mesh(
+ self,
+ gc: GraphicsContextBase,
+ master_transform: Transform,
+ meshWidth,
+ meshHeight,
+ coordinates: ArrayLike,
+ offsets: ArrayLike | Sequence[ArrayLike],
+ offsetTrans: Transform,
+ facecolors: Sequence[ColorType],
+ antialiased: bool,
+ edgecolors: Sequence[ColorType] | ColorType | None,
+ ) -> None: ...
+ def draw_gouraud_triangles(
+ self,
+ gc: GraphicsContextBase,
+ triangles_array: ArrayLike,
+ colors_array: ArrayLike,
+ transform: Transform,
+ ) -> None: ...
+ def get_image_magnification(self) -> float: ...
+ def draw_image(
+ self,
+ gc: GraphicsContextBase,
+ x: float,
+ y: float,
+ im: ArrayLike,
+ transform: transforms.Affine2DBase | None = ...,
+ ) -> None: ...
+ def option_image_nocomposite(self) -> bool: ...
+ def option_scale_image(self) -> bool: ...
+ def draw_tex(
+ self,
+ gc: GraphicsContextBase,
+ x: float,
+ y: float,
+ s: str,
+ prop: FontProperties,
+ angle: float,
+ *,
+ mtext: Text | None = ...
+ ) -> None: ...
+ def draw_text(
+ self,
+ gc: GraphicsContextBase,
+ x: float,
+ y: float,
+ s: str,
+ prop: FontProperties,
+ angle: float,
+ ismath: bool | Literal["TeX"] = ...,
+ mtext: Text | None = ...,
+ ) -> None: ...
+ def get_text_width_height_descent(
+ self, s: str, prop: FontProperties, ismath: bool | Literal["TeX"]
+ ) -> tuple[float, float, float]: ...
+ def flipy(self) -> bool: ...
+ def get_canvas_width_height(self) -> tuple[float, float]: ...
+ def get_texmanager(self) -> TexManager: ...
+ def new_gc(self) -> GraphicsContextBase: ...
+ def points_to_pixels(self, points: ArrayLike) -> ArrayLike: ...
+ def start_rasterizing(self) -> None: ...
+ def stop_rasterizing(self) -> None: ...
+ def start_filter(self) -> None: ...
+ def stop_filter(self, filter_func) -> None: ...
+
+class GraphicsContextBase:
+ def __init__(self) -> None: ...
+ def copy_properties(self, gc: GraphicsContextBase) -> None: ...
+ def restore(self) -> None: ...
+ def get_alpha(self) -> float: ...
+ def get_antialiased(self) -> int: ...
+ def get_capstyle(self) -> Literal["butt", "projecting", "round"]: ...
+ def get_clip_rectangle(self) -> Bbox | None: ...
+ def get_clip_path(
+ self,
+ ) -> tuple[TransformedPath, Transform] | tuple[None, None]: ...
+ def get_dashes(self) -> tuple[float, ArrayLike | None]: ...
+ def get_forced_alpha(self) -> bool: ...
+ def get_joinstyle(self) -> Literal["miter", "round", "bevel"]: ...
+ def get_linewidth(self) -> float: ...
+ def get_rgb(self) -> tuple[float, float, float, float]: ...
+ def get_url(self) -> str | None: ...
+ def get_gid(self) -> int | None: ...
+ def get_snap(self) -> bool | None: ...
+ def set_alpha(self, alpha: float) -> None: ...
+ def set_antialiased(self, b: bool) -> None: ...
+ def set_capstyle(self, cs: CapStyleType) -> None: ...
+ def set_clip_rectangle(self, rectangle: Bbox | None) -> None: ...
+ def set_clip_path(self, path: TransformedPath | None) -> None: ...
+ def set_dashes(self, dash_offset: float, dash_list: ArrayLike | None) -> None: ...
+ def set_foreground(self, fg: ColorType, isRGBA: bool = ...) -> None: ...
+ def set_joinstyle(self, js: JoinStyleType) -> None: ...
+ def set_linewidth(self, w: float) -> None: ...
+ def set_url(self, url: str | None) -> None: ...
+ def set_gid(self, id: int | None) -> None: ...
+ def set_snap(self, snap: bool | None) -> None: ...
+ def set_hatch(self, hatch: str | None) -> None: ...
+ def get_hatch(self) -> str | None: ...
+ def get_hatch_path(self, density: float = ...) -> Path: ...
+ def get_hatch_color(self) -> ColorType: ...
+ def set_hatch_color(self, hatch_color: ColorType) -> None: ...
+ def get_hatch_linewidth(self) -> float: ...
+ def set_hatch_linewidth(self, hatch_linewidth: float) -> None: ...
+ def get_sketch_params(self) -> tuple[float, float, float] | None: ...
+ def set_sketch_params(
+ self,
+ scale: float | None = ...,
+ length: float | None = ...,
+ randomness: float | None = ...,
+ ) -> None: ...
+
+class TimerBase:
+ callbacks: list[tuple[Callable, tuple, dict[str, Any]]]
+ def __init__(
+ self,
+ interval: int | None = ...,
+ callbacks: list[tuple[Callable, tuple, dict[str, Any]]] | None = ...,
+ ) -> None: ...
+ def __del__(self) -> None: ...
+ def start(self, interval: int | None = ...) -> None: ...
+ def stop(self) -> None: ...
+ @property
+ def interval(self) -> int: ...
+ @interval.setter
+ def interval(self, interval: int) -> None: ...
+ @property
+ def single_shot(self) -> bool: ...
+ @single_shot.setter
+ def single_shot(self, ss: bool) -> None: ...
+ def add_callback(self, func: Callable, *args, **kwargs) -> Callable: ...
+ def remove_callback(self, func: Callable, *args, **kwargs) -> None: ...
+
+class Event:
+ name: str
+ canvas: FigureCanvasBase
+ guiEvent: Any
+ def __init__(
+ self, name: str, canvas: FigureCanvasBase, guiEvent: Any | None = ...
+ ) -> None: ...
+
+class DrawEvent(Event):
+ renderer: RendererBase
+ def __init__(
+ self, name: str, canvas: FigureCanvasBase, renderer: RendererBase
+ ) -> None: ...
+
+class ResizeEvent(Event):
+ width: int
+ height: int
+ def __init__(self, name: str, canvas: FigureCanvasBase) -> None: ...
+
+class CloseEvent(Event): ...
+
+class LocationEvent(Event):
+ x: int
+ y: int
+ inaxes: Axes | None
+ xdata: float | None
+ ydata: float | None
+ def __init__(
+ self,
+ name: str,
+ canvas: FigureCanvasBase,
+ x: int,
+ y: int,
+ guiEvent: Any | None = ...,
+ *,
+ modifiers: Iterable[str] | None = ...,
+ ) -> None: ...
+
+class MouseButton(IntEnum):
+ LEFT = 1
+ MIDDLE = 2
+ RIGHT = 3
+ BACK = 8
+ FORWARD = 9
+
+class MouseEvent(LocationEvent):
+ button: MouseButton | Literal["up", "down"] | None
+ key: str | None
+ step: float
+ dblclick: bool
+ def __init__(
+ self,
+ name: str,
+ canvas: FigureCanvasBase,
+ x: int,
+ y: int,
+ button: MouseButton | Literal["up", "down"] | None = ...,
+ key: str | None = ...,
+ step: float = ...,
+ dblclick: bool = ...,
+ guiEvent: Any | None = ...,
+ *,
+ buttons: Iterable[MouseButton] | None = ...,
+ modifiers: Iterable[str] | None = ...,
+ ) -> None: ...
+
+class PickEvent(Event):
+ mouseevent: MouseEvent
+ artist: Artist
+ def __init__(
+ self,
+ name: str,
+ canvas: FigureCanvasBase,
+ mouseevent: MouseEvent,
+ artist: Artist,
+ guiEvent: Any | None = ...,
+ **kwargs
+ ) -> None: ...
+
+class KeyEvent(LocationEvent):
+ key: str | None
+ def __init__(
+ self,
+ name: str,
+ canvas: FigureCanvasBase,
+ key: str | None,
+ x: int = ...,
+ y: int = ...,
+ guiEvent: Any | None = ...,
+ ) -> None: ...
+
+class FigureCanvasBase:
+ required_interactive_framework: str | None
+
+ @_api.classproperty
+ def manager_class(cls) -> type[FigureManagerBase]: ...
+ events: list[str]
+ fixed_dpi: None | float
+ filetypes: dict[str, str]
+
+ @_api.classproperty
+ def supports_blit(cls) -> bool: ...
+
+ figure: Figure
+ manager: None | FigureManagerBase
+ widgetlock: widgets.LockDraw
+ mouse_grabber: None | Axes
+ toolbar: None | NavigationToolbar2
+ def __init__(self, figure: Figure | None = ...) -> None: ...
+ @property
+ def callbacks(self) -> cbook.CallbackRegistry: ...
+ @property
+ def button_pick_id(self) -> int: ...
+ @property
+ def scroll_pick_id(self) -> int: ...
+ @classmethod
+ def new_manager(cls, figure: Figure, num: int | str) -> FigureManagerBase: ...
+ def is_saving(self) -> bool: ...
+ def blit(self, bbox: BboxBase | None = ...) -> None: ...
+ def inaxes(self, xy: tuple[float, float]) -> Axes | None: ...
+ def grab_mouse(self, ax: Axes) -> None: ...
+ def release_mouse(self, ax: Axes) -> None: ...
+ def set_cursor(self, cursor: Cursors) -> None: ...
+ def draw(self, *args, **kwargs) -> None: ...
+ def draw_idle(self, *args, **kwargs) -> None: ...
+ @property
+ def device_pixel_ratio(self) -> float: ...
+ def get_width_height(self, *, physical: bool = ...) -> tuple[int, int]: ...
+ @classmethod
+ def get_supported_filetypes(cls) -> dict[str, str]: ...
+ @classmethod
+ def get_supported_filetypes_grouped(cls) -> dict[str, list[str]]: ...
+ def print_figure(
+ self,
+ filename: str | os.PathLike | IO,
+ dpi: float | None = ...,
+ facecolor: ColorType | Literal["auto"] | None = ...,
+ edgecolor: ColorType | Literal["auto"] | None = ...,
+ orientation: str = ...,
+ format: str | None = ...,
+ *,
+ bbox_inches: Literal["tight"] | Bbox | None = ...,
+ pad_inches: float | None = ...,
+ bbox_extra_artists: list[Artist] | None = ...,
+ backend: str | None = ...,
+ **kwargs
+ ) -> Any: ...
+ @classmethod
+ def get_default_filetype(cls) -> str: ...
+ def get_default_filename(self) -> str: ...
+ _T = TypeVar("_T", bound=FigureCanvasBase)
+ def mpl_connect(self, s: str, func: Callable[[Event], Any]) -> int: ...
+ def mpl_disconnect(self, cid: int) -> None: ...
+ def new_timer(
+ self,
+ interval: int | None = ...,
+ callbacks: list[tuple[Callable, tuple, dict[str, Any]]] | None = ...,
+ ) -> TimerBase: ...
+ def flush_events(self) -> None: ...
+ def start_event_loop(self, timeout: float = ...) -> None: ...
+ def stop_event_loop(self) -> None: ...
+
+def key_press_handler(
+ event: KeyEvent,
+ canvas: FigureCanvasBase | None = ...,
+ toolbar: NavigationToolbar2 | None = ...,
+) -> None: ...
+def button_press_handler(
+ event: MouseEvent,
+ canvas: FigureCanvasBase | None = ...,
+ toolbar: NavigationToolbar2 | None = ...,
+) -> None: ...
+
+class NonGuiException(Exception): ...
+
+class FigureManagerBase:
+ canvas: FigureCanvasBase
+ num: int | str
+ key_press_handler_id: int | None
+ button_press_handler_id: int | None
+ toolmanager: ToolManager | None
+ toolbar: NavigationToolbar2 | ToolContainerBase | None
+ def __init__(self, canvas: FigureCanvasBase, num: int | str) -> None: ...
+ @classmethod
+ def create_with_canvas(
+ cls, canvas_class: type[FigureCanvasBase], figure: Figure, num: int | str
+ ) -> FigureManagerBase: ...
+ @classmethod
+ def start_main_loop(cls) -> None: ...
+ @classmethod
+ def pyplot_show(cls, *, block: bool | None = ...) -> None: ...
+ def show(self) -> None: ...
+ def destroy(self) -> None: ...
+ def full_screen_toggle(self) -> None: ...
+ def resize(self, w: int, h: int) -> None: ...
+ def get_window_title(self) -> str: ...
+ def set_window_title(self, title: str) -> None: ...
+
+cursors = Cursors
+
+class _Mode(str, Enum):
+ NONE = ""
+ PAN = "pan/zoom"
+ ZOOM = "zoom rect"
+
+class NavigationToolbar2:
+ toolitems: tuple[tuple[str, ...] | tuple[None, ...], ...]
+ UNKNOWN_SAVED_STATUS: object
+ canvas: FigureCanvasBase
+ mode: _Mode
+ def __init__(self, canvas: FigureCanvasBase) -> None: ...
+ def set_message(self, s: str) -> None: ...
+ def draw_rubberband(
+ self, event: Event, x0: float, y0: float, x1: float, y1: float
+ ) -> None: ...
+ def remove_rubberband(self) -> None: ...
+ def home(self, *args) -> None: ...
+ def back(self, *args) -> None: ...
+ def forward(self, *args) -> None: ...
+ def mouse_move(self, event: MouseEvent) -> None: ...
+ def pan(self, *args) -> None: ...
+
+ class _PanInfo(NamedTuple):
+ button: MouseButton
+ axes: list[Axes]
+ cid: int
+ def press_pan(self, event: Event) -> None: ...
+ def drag_pan(self, event: Event) -> None: ...
+ def release_pan(self, event: Event) -> None: ...
+ def zoom(self, *args) -> None: ...
+
+ class _ZoomInfo(NamedTuple):
+ direction: Literal["in", "out"]
+ start_xy: tuple[float, float]
+ axes: list[Axes]
+ cid: int
+ cbar: Colorbar
+ def press_zoom(self, event: Event) -> None: ...
+ def drag_zoom(self, event: Event) -> None: ...
+ def release_zoom(self, event: Event) -> None: ...
+ def push_current(self) -> None: ...
+ subplot_tool: widgets.SubplotTool
+ def configure_subplots(self, *args): ...
+ def save_figure(self, *args) -> str | None | object: ...
+ def update(self) -> None: ...
+ def set_history_buttons(self) -> None: ...
+
+class ToolContainerBase:
+ toolmanager: ToolManager
+ def __init__(self, toolmanager: ToolManager) -> None: ...
+ def add_tool(self, tool: ToolBase, group: str, position: int = ...) -> None: ...
+ def trigger_tool(self, name: str) -> None: ...
+ def add_toolitem(
+ self,
+ name: str,
+ group: str,
+ position: int,
+ image: str,
+ description: str,
+ toggle: bool,
+ ) -> None: ...
+ def toggle_toolitem(self, name: str, toggled: bool) -> None: ...
+ def remove_toolitem(self, name: str) -> None: ...
+ def set_message(self, s: str) -> None: ...
+
+class _Backend:
+ backend_version: str
+ FigureCanvas: type[FigureCanvasBase] | None
+ FigureManager: type[FigureManagerBase]
+ mainloop: None | Callable[[], Any]
+ @classmethod
+ def new_figure_manager(cls, num: int | str, *args, **kwargs) -> FigureManagerBase: ...
+ @classmethod
+ def new_figure_manager_given_figure(cls, num: int | str, figure: Figure) -> FigureManagerBase: ...
+ @classmethod
+ def draw_if_interactive(cls) -> None: ...
+ @classmethod
+ def show(cls, *, block: bool | None = ...) -> None: ...
+ @staticmethod
+ def export(cls) -> type[_Backend]: ...
+
+class ShowBase(_Backend):
+ def __call__(self, block: bool | None = ...) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_managers.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_managers.py
new file mode 100644
index 0000000000000000000000000000000000000000..76f15030bcc5e2c112b9aa72ca9cbf18334599e2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_managers.py
@@ -0,0 +1,387 @@
+from matplotlib import _api, backend_tools, cbook, widgets
+
+
+class ToolEvent:
+ """Event for tool manipulation (add/remove)."""
+ def __init__(self, name, sender, tool, data=None):
+ self.name = name
+ self.sender = sender
+ self.tool = tool
+ self.data = data
+
+
+class ToolTriggerEvent(ToolEvent):
+ """Event to inform that a tool has been triggered."""
+ def __init__(self, name, sender, tool, canvasevent=None, data=None):
+ super().__init__(name, sender, tool, data)
+ self.canvasevent = canvasevent
+
+
+class ToolManagerMessageEvent:
+ """
+ Event carrying messages from toolmanager.
+
+ Messages usually get displayed to the user by the toolbar.
+ """
+ def __init__(self, name, sender, message):
+ self.name = name
+ self.sender = sender
+ self.message = message
+
+
+class ToolManager:
+ """
+ Manager for actions triggered by user interactions (key press, toolbar
+ clicks, ...) on a Figure.
+
+ Attributes
+ ----------
+ figure : `.Figure`
+ keypresslock : `~matplotlib.widgets.LockDraw`
+ `.LockDraw` object to know if the `canvas` key_press_event is locked.
+ messagelock : `~matplotlib.widgets.LockDraw`
+ `.LockDraw` object to know if the message is available to write.
+ """
+
+ def __init__(self, figure=None):
+
+ self._key_press_handler_id = None
+
+ self._tools = {}
+ self._keys = {}
+ self._toggled = {}
+ self._callbacks = cbook.CallbackRegistry()
+
+ # to process keypress event
+ self.keypresslock = widgets.LockDraw()
+ self.messagelock = widgets.LockDraw()
+
+ self._figure = None
+ self.set_figure(figure)
+
+ @property
+ def canvas(self):
+ """Canvas managed by FigureManager."""
+ if not self._figure:
+ return None
+ return self._figure.canvas
+
+ @property
+ def figure(self):
+ """Figure that holds the canvas."""
+ return self._figure
+
+ @figure.setter
+ def figure(self, figure):
+ self.set_figure(figure)
+
+ def set_figure(self, figure, update_tools=True):
+ """
+ Bind the given figure to the tools.
+
+ Parameters
+ ----------
+ figure : `.Figure`
+ update_tools : bool, default: True
+ Force tools to update figure.
+ """
+ if self._key_press_handler_id:
+ self.canvas.mpl_disconnect(self._key_press_handler_id)
+ self._figure = figure
+ if figure:
+ self._key_press_handler_id = self.canvas.mpl_connect(
+ 'key_press_event', self._key_press)
+ if update_tools:
+ for tool in self._tools.values():
+ tool.figure = figure
+
+ def toolmanager_connect(self, s, func):
+ """
+ Connect event with string *s* to *func*.
+
+ Parameters
+ ----------
+ s : str
+ The name of the event. The following events are recognized:
+
+ - 'tool_message_event'
+ - 'tool_removed_event'
+ - 'tool_added_event'
+
+ For every tool added a new event is created
+
+ - 'tool_trigger_TOOLNAME', where TOOLNAME is the id of the tool.
+
+ func : callable
+ Callback function for the toolmanager event with signature::
+
+ def func(event: ToolEvent) -> Any
+
+ Returns
+ -------
+ cid
+ The callback id for the connection. This can be used in
+ `.toolmanager_disconnect`.
+ """
+ return self._callbacks.connect(s, func)
+
+ def toolmanager_disconnect(self, cid):
+ """
+ Disconnect callback id *cid*.
+
+ Example usage::
+
+ cid = toolmanager.toolmanager_connect('tool_trigger_zoom', onpress)
+ #...later
+ toolmanager.toolmanager_disconnect(cid)
+ """
+ return self._callbacks.disconnect(cid)
+
+ def message_event(self, message, sender=None):
+ """Emit a `ToolManagerMessageEvent`."""
+ if sender is None:
+ sender = self
+
+ s = 'tool_message_event'
+ event = ToolManagerMessageEvent(s, sender, message)
+ self._callbacks.process(s, event)
+
+ @property
+ def active_toggle(self):
+ """Currently toggled tools."""
+ return self._toggled
+
+ def get_tool_keymap(self, name):
+ """
+ Return the keymap associated with the specified tool.
+
+ Parameters
+ ----------
+ name : str
+ Name of the Tool.
+
+ Returns
+ -------
+ list of str
+ List of keys associated with the tool.
+ """
+
+ keys = [k for k, i in self._keys.items() if i == name]
+ return keys
+
+ def _remove_keys(self, name):
+ for k in self.get_tool_keymap(name):
+ del self._keys[k]
+
+ def update_keymap(self, name, key):
+ """
+ Set the keymap to associate with the specified tool.
+
+ Parameters
+ ----------
+ name : str
+ Name of the Tool.
+ key : str or list of str
+ Keys to associate with the tool.
+ """
+ if name not in self._tools:
+ raise KeyError(f'{name!r} not in Tools')
+ self._remove_keys(name)
+ if isinstance(key, str):
+ key = [key]
+ for k in key:
+ if k in self._keys:
+ _api.warn_external(
+ f'Key {k} changed from {self._keys[k]} to {name}')
+ self._keys[k] = name
+
+ def remove_tool(self, name):
+ """
+ Remove tool named *name*.
+
+ Parameters
+ ----------
+ name : str
+ Name of the tool.
+ """
+ tool = self.get_tool(name)
+ if getattr(tool, 'toggled', False): # If it's a toggled toggle tool, untoggle
+ self.trigger_tool(tool, 'toolmanager')
+ self._remove_keys(name)
+ event = ToolEvent('tool_removed_event', self, tool)
+ self._callbacks.process(event.name, event)
+ del self._tools[name]
+
+ def add_tool(self, name, tool, *args, **kwargs):
+ """
+ Add *tool* to `ToolManager`.
+
+ If successful, adds a new event ``tool_trigger_{name}`` where
+ ``{name}`` is the *name* of the tool; the event is fired every time the
+ tool is triggered.
+
+ Parameters
+ ----------
+ name : str
+ Name of the tool, treated as the ID, has to be unique.
+ tool : type
+ Class of the tool to be added. A subclass will be used
+ instead if one was registered for the current canvas class.
+ *args, **kwargs
+ Passed to the *tool*'s constructor.
+
+ See Also
+ --------
+ matplotlib.backend_tools.ToolBase : The base class for tools.
+ """
+
+ tool_cls = backend_tools._find_tool_class(type(self.canvas), tool)
+ if not tool_cls:
+ raise ValueError('Impossible to find class for %s' % str(tool))
+
+ if name in self._tools:
+ _api.warn_external('A "Tool class" with the same name already '
+ 'exists, not added')
+ return self._tools[name]
+
+ tool_obj = tool_cls(self, name, *args, **kwargs)
+ self._tools[name] = tool_obj
+
+ if tool_obj.default_keymap is not None:
+ self.update_keymap(name, tool_obj.default_keymap)
+
+ # For toggle tools init the radio_group in self._toggled
+ if isinstance(tool_obj, backend_tools.ToolToggleBase):
+ # None group is not mutually exclusive, a set is used to keep track
+ # of all toggled tools in this group
+ if tool_obj.radio_group is None:
+ self._toggled.setdefault(None, set())
+ else:
+ self._toggled.setdefault(tool_obj.radio_group, None)
+
+ # If initially toggled
+ if tool_obj.toggled:
+ self._handle_toggle(tool_obj, None, None)
+ tool_obj.set_figure(self.figure)
+
+ event = ToolEvent('tool_added_event', self, tool_obj)
+ self._callbacks.process(event.name, event)
+
+ return tool_obj
+
+ def _handle_toggle(self, tool, canvasevent, data):
+ """
+ Toggle tools, need to untoggle prior to using other Toggle tool.
+ Called from trigger_tool.
+
+ Parameters
+ ----------
+ tool : `.ToolBase`
+ canvasevent : Event
+ Original Canvas event or None.
+ data : object
+ Extra data to pass to the tool when triggering.
+ """
+
+ radio_group = tool.radio_group
+ # radio_group None is not mutually exclusive
+ # just keep track of toggled tools in this group
+ if radio_group is None:
+ if tool.name in self._toggled[None]:
+ self._toggled[None].remove(tool.name)
+ else:
+ self._toggled[None].add(tool.name)
+ return
+
+ # If the tool already has a toggled state, untoggle it
+ if self._toggled[radio_group] == tool.name:
+ toggled = None
+ # If no tool was toggled in the radio_group
+ # toggle it
+ elif self._toggled[radio_group] is None:
+ toggled = tool.name
+ # Other tool in the radio_group is toggled
+ else:
+ # Untoggle previously toggled tool
+ self.trigger_tool(self._toggled[radio_group],
+ self,
+ canvasevent,
+ data)
+ toggled = tool.name
+
+ # Keep track of the toggled tool in the radio_group
+ self._toggled[radio_group] = toggled
+
+ def trigger_tool(self, name, sender=None, canvasevent=None, data=None):
+ """
+ Trigger a tool and emit the ``tool_trigger_{name}`` event.
+
+ Parameters
+ ----------
+ name : str
+ Name of the tool.
+ sender : object
+ Object that wishes to trigger the tool.
+ canvasevent : Event
+ Original Canvas event or None.
+ data : object
+ Extra data to pass to the tool when triggering.
+ """
+ tool = self.get_tool(name)
+ if tool is None:
+ return
+
+ if sender is None:
+ sender = self
+
+ if isinstance(tool, backend_tools.ToolToggleBase):
+ self._handle_toggle(tool, canvasevent, data)
+
+ tool.trigger(sender, canvasevent, data) # Actually trigger Tool.
+
+ s = 'tool_trigger_%s' % name
+ event = ToolTriggerEvent(s, sender, tool, canvasevent, data)
+ self._callbacks.process(s, event)
+
+ def _key_press(self, event):
+ if event.key is None or self.keypresslock.locked():
+ return
+
+ name = self._keys.get(event.key, None)
+ if name is None:
+ return
+ self.trigger_tool(name, canvasevent=event)
+
+ @property
+ def tools(self):
+ """A dict mapping tool name -> controlled tool."""
+ return self._tools
+
+ def get_tool(self, name, warn=True):
+ """
+ Return the tool object with the given name.
+
+ For convenience, this passes tool objects through.
+
+ Parameters
+ ----------
+ name : str or `.ToolBase`
+ Name of the tool, or the tool itself.
+ warn : bool, default: True
+ Whether a warning should be emitted it no tool with the given name
+ exists.
+
+ Returns
+ -------
+ `.ToolBase` or None
+ The tool or None if no tool with the given name exists.
+ """
+ if (isinstance(name, backend_tools.ToolBase)
+ and name.name in self._tools):
+ return name
+ if name not in self._tools:
+ if warn:
+ _api.warn_external(
+ f"ToolManager does not control tool {name!r}")
+ return None
+ return self._tools[name]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_managers.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_managers.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..9e59acb14eda98b25e2dcb3f6e2004ca99d0ae5e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_managers.pyi
@@ -0,0 +1,64 @@
+from matplotlib import backend_tools, widgets
+from matplotlib.backend_bases import FigureCanvasBase
+from matplotlib.figure import Figure
+
+from collections.abc import Callable, Iterable
+from typing import Any, TypeVar
+
+class ToolEvent:
+ name: str
+ sender: Any
+ tool: backend_tools.ToolBase
+ data: Any
+ def __init__(self, name, sender, tool, data: Any | None = ...) -> None: ...
+
+class ToolTriggerEvent(ToolEvent):
+ canvasevent: ToolEvent
+ def __init__(
+ self,
+ name,
+ sender,
+ tool,
+ canvasevent: ToolEvent | None = ...,
+ data: Any | None = ...,
+ ) -> None: ...
+
+class ToolManagerMessageEvent:
+ name: str
+ sender: Any
+ message: str
+ def __init__(self, name: str, sender: Any, message: str) -> None: ...
+
+class ToolManager:
+ keypresslock: widgets.LockDraw
+ messagelock: widgets.LockDraw
+ def __init__(self, figure: Figure | None = ...) -> None: ...
+ @property
+ def canvas(self) -> FigureCanvasBase | None: ...
+ @property
+ def figure(self) -> Figure | None: ...
+ @figure.setter
+ def figure(self, figure: Figure) -> None: ...
+ def set_figure(self, figure: Figure, update_tools: bool = ...) -> None: ...
+ def toolmanager_connect(self, s: str, func: Callable[[ToolEvent], Any]) -> int: ...
+ def toolmanager_disconnect(self, cid: int) -> None: ...
+ def message_event(self, message: str, sender: Any | None = ...) -> None: ...
+ @property
+ def active_toggle(self) -> dict[str | None, list[str] | str]: ...
+ def get_tool_keymap(self, name: str) -> list[str]: ...
+ def update_keymap(self, name: str, key: str | Iterable[str]) -> None: ...
+ def remove_tool(self, name: str) -> None: ...
+ _T = TypeVar("_T", bound=backend_tools.ToolBase)
+ def add_tool(self, name: str, tool: type[_T], *args, **kwargs) -> _T: ...
+ def trigger_tool(
+ self,
+ name: str | backend_tools.ToolBase,
+ sender: Any | None = ...,
+ canvasevent: ToolEvent | None = ...,
+ data: Any | None = ...,
+ ) -> None: ...
+ @property
+ def tools(self) -> dict[str, backend_tools.ToolBase]: ...
+ def get_tool(
+ self, name: str | backend_tools.ToolBase, warn: bool = ...
+ ) -> backend_tools.ToolBase | None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_tools.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_tools.py
new file mode 100644
index 0000000000000000000000000000000000000000..87ed794022a0eee732da01ac9627b84020c83013
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_tools.py
@@ -0,0 +1,998 @@
+"""
+Abstract base classes define the primitives for Tools.
+These tools are used by `matplotlib.backend_managers.ToolManager`
+
+:class:`ToolBase`
+ Simple stateless tool
+
+:class:`ToolToggleBase`
+ Tool that has two states, only one Toggle tool can be
+ active at any given time for the same
+ `matplotlib.backend_managers.ToolManager`
+"""
+
+import enum
+import functools
+import re
+import time
+from types import SimpleNamespace
+import uuid
+from weakref import WeakKeyDictionary
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib._pylab_helpers import Gcf
+from matplotlib import _api, cbook
+
+
+class Cursors(enum.IntEnum): # Must subclass int for the macOS backend.
+ """Backend-independent cursor types."""
+ POINTER = enum.auto()
+ HAND = enum.auto()
+ SELECT_REGION = enum.auto()
+ MOVE = enum.auto()
+ WAIT = enum.auto()
+ RESIZE_HORIZONTAL = enum.auto()
+ RESIZE_VERTICAL = enum.auto()
+cursors = Cursors # Backcompat.
+
+
+# _tool_registry, _register_tool_class, and _find_tool_class implement a
+# mechanism through which ToolManager.add_tool can determine whether a subclass
+# of the requested tool class has been registered (either for the current
+# canvas class or for a parent class), in which case that tool subclass will be
+# instantiated instead. This is the mechanism used e.g. to allow different
+# GUI backends to implement different specializations for ConfigureSubplots.
+
+
+_tool_registry = set()
+
+
+def _register_tool_class(canvas_cls, tool_cls=None):
+ """Decorator registering *tool_cls* as a tool class for *canvas_cls*."""
+ if tool_cls is None:
+ return functools.partial(_register_tool_class, canvas_cls)
+ _tool_registry.add((canvas_cls, tool_cls))
+ return tool_cls
+
+
+def _find_tool_class(canvas_cls, tool_cls):
+ """Find a subclass of *tool_cls* registered for *canvas_cls*."""
+ for canvas_parent in canvas_cls.__mro__:
+ for tool_child in _api.recursive_subclasses(tool_cls):
+ if (canvas_parent, tool_child) in _tool_registry:
+ return tool_child
+ return tool_cls
+
+
+# Views positions tool
+_views_positions = 'viewpos'
+
+
+class ToolBase:
+ """
+ Base tool class.
+
+ A base tool, only implements `trigger` method or no method at all.
+ The tool is instantiated by `matplotlib.backend_managers.ToolManager`.
+ """
+
+ default_keymap = None
+ """
+ Keymap to associate with this tool.
+
+ ``list[str]``: List of keys that will trigger this tool when a keypress
+ event is emitted on ``self.figure.canvas``. Note that this attribute is
+ looked up on the instance, and can therefore be a property (this is used
+ e.g. by the built-in tools to load the rcParams at instantiation time).
+ """
+
+ description = None
+ """
+ Description of the Tool.
+
+ `str`: Tooltip used if the Tool is included in a Toolbar.
+ """
+
+ image = None
+ """
+ Icon filename.
+
+ ``str | None``: Filename of the Toolbar icon; either absolute, or relative to the
+ directory containing the Python source file where the ``Tool.image`` class attribute
+ is defined (in the latter case, this cannot be defined as an instance attribute).
+ In either case, the extension is optional; leaving it off lets individual backends
+ select the icon format they prefer. If None, the *name* is used as a label in the
+ toolbar button.
+ """
+
+ def __init__(self, toolmanager, name):
+ self._name = name
+ self._toolmanager = toolmanager
+ self._figure = None
+
+ name = property(
+ lambda self: self._name,
+ doc="The tool id (str, must be unique among tools of a tool manager).")
+ toolmanager = property(
+ lambda self: self._toolmanager,
+ doc="The `.ToolManager` that controls this tool.")
+ canvas = property(
+ lambda self: self._figure.canvas if self._figure is not None else None,
+ doc="The canvas of the figure affected by this tool, or None.")
+
+ def set_figure(self, figure):
+ self._figure = figure
+
+ figure = property(
+ lambda self: self._figure,
+ # The setter must explicitly call self.set_figure so that subclasses can
+ # meaningfully override it.
+ lambda self, figure: self.set_figure(figure),
+ doc="The Figure affected by this tool, or None.")
+
+ def _make_classic_style_pseudo_toolbar(self):
+ """
+ Return a placeholder object with a single `canvas` attribute.
+
+ This is useful to reuse the implementations of tools already provided
+ by the classic Toolbars.
+ """
+ return SimpleNamespace(canvas=self.canvas)
+
+ def trigger(self, sender, event, data=None):
+ """
+ Called when this tool gets used.
+
+ This method is called by `.ToolManager.trigger_tool`.
+
+ Parameters
+ ----------
+ event : `.Event`
+ The canvas event that caused this tool to be called.
+ sender : object
+ Object that requested the tool to be triggered.
+ data : object
+ Extra data.
+ """
+ pass
+
+
+class ToolToggleBase(ToolBase):
+ """
+ Toggleable tool.
+
+ Every time it is triggered, it switches between enable and disable.
+
+ Parameters
+ ----------
+ ``*args``
+ Variable length argument to be used by the Tool.
+ ``**kwargs``
+ `toggled` if present and True, sets the initial state of the Tool
+ Arbitrary keyword arguments to be consumed by the Tool
+ """
+
+ radio_group = None
+ """
+ Attribute to group 'radio' like tools (mutually exclusive).
+
+ `str` that identifies the group or **None** if not belonging to a group.
+ """
+
+ cursor = None
+ """Cursor to use when the tool is active."""
+
+ default_toggled = False
+ """Default of toggled state."""
+
+ def __init__(self, *args, **kwargs):
+ self._toggled = kwargs.pop('toggled', self.default_toggled)
+ super().__init__(*args, **kwargs)
+
+ def trigger(self, sender, event, data=None):
+ """Calls `enable` or `disable` based on `toggled` value."""
+ if self._toggled:
+ self.disable(event)
+ else:
+ self.enable(event)
+ self._toggled = not self._toggled
+
+ def enable(self, event=None):
+ """
+ Enable the toggle tool.
+
+ `trigger` calls this method when `toggled` is False.
+ """
+ pass
+
+ def disable(self, event=None):
+ """
+ Disable the toggle tool.
+
+ `trigger` call this method when `toggled` is True.
+
+ This can happen in different circumstances.
+
+ * Click on the toolbar tool button.
+ * Call to `matplotlib.backend_managers.ToolManager.trigger_tool`.
+ * Another `ToolToggleBase` derived tool is triggered
+ (from the same `.ToolManager`).
+ """
+ pass
+
+ @property
+ def toggled(self):
+ """State of the toggled tool."""
+ return self._toggled
+
+ def set_figure(self, figure):
+ toggled = self.toggled
+ if toggled:
+ if self.figure:
+ self.trigger(self, None)
+ else:
+ # if no figure the internal state is not changed
+ # we change it here so next call to trigger will change it back
+ self._toggled = False
+ super().set_figure(figure)
+ if toggled:
+ if figure:
+ self.trigger(self, None)
+ else:
+ # if there is no figure, trigger won't change the internal
+ # state we change it back
+ self._toggled = True
+
+
+class ToolSetCursor(ToolBase):
+ """
+ Change to the current cursor while inaxes.
+
+ This tool, keeps track of all `ToolToggleBase` derived tools, and updates
+ the cursor when a tool gets triggered.
+ """
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._id_drag = None
+ self._current_tool = None
+ self._default_cursor = cursors.POINTER
+ self._last_cursor = self._default_cursor
+ self.toolmanager.toolmanager_connect('tool_added_event',
+ self._add_tool_cbk)
+ for tool in self.toolmanager.tools.values(): # process current tools
+ self._add_tool_cbk(mpl.backend_managers.ToolEvent(
+ 'tool_added_event', self.toolmanager, tool))
+
+ def set_figure(self, figure):
+ if self._id_drag:
+ self.canvas.mpl_disconnect(self._id_drag)
+ super().set_figure(figure)
+ if figure:
+ self._id_drag = self.canvas.mpl_connect(
+ 'motion_notify_event', self._set_cursor_cbk)
+
+ def _add_tool_cbk(self, event):
+ """Process every newly added tool."""
+ if getattr(event.tool, 'cursor', None) is not None:
+ self.toolmanager.toolmanager_connect(
+ f'tool_trigger_{event.tool.name}', self._tool_trigger_cbk)
+
+ def _tool_trigger_cbk(self, event):
+ self._current_tool = event.tool if event.tool.toggled else None
+ self._set_cursor_cbk(event.canvasevent)
+
+ def _set_cursor_cbk(self, event):
+ if not event or not self.canvas:
+ return
+ if (self._current_tool and getattr(event, "inaxes", None)
+ and event.inaxes.get_navigate()):
+ if self._last_cursor != self._current_tool.cursor:
+ self.canvas.set_cursor(self._current_tool.cursor)
+ self._last_cursor = self._current_tool.cursor
+ elif self._last_cursor != self._default_cursor:
+ self.canvas.set_cursor(self._default_cursor)
+ self._last_cursor = self._default_cursor
+
+
+class ToolCursorPosition(ToolBase):
+ """
+ Send message with the current pointer position.
+
+ This tool runs in the background reporting the position of the cursor.
+ """
+ def __init__(self, *args, **kwargs):
+ self._id_drag = None
+ super().__init__(*args, **kwargs)
+
+ def set_figure(self, figure):
+ if self._id_drag:
+ self.canvas.mpl_disconnect(self._id_drag)
+ super().set_figure(figure)
+ if figure:
+ self._id_drag = self.canvas.mpl_connect(
+ 'motion_notify_event', self.send_message)
+
+ def send_message(self, event):
+ """Call `matplotlib.backend_managers.ToolManager.message_event`."""
+ if self.toolmanager.messagelock.locked():
+ return
+
+ from matplotlib.backend_bases import NavigationToolbar2
+ message = NavigationToolbar2._mouse_event_to_message(event)
+ self.toolmanager.message_event(message, self)
+
+
+class RubberbandBase(ToolBase):
+ """Draw and remove a rubberband."""
+ def trigger(self, sender, event, data=None):
+ """Call `draw_rubberband` or `remove_rubberband` based on data."""
+ if not self.figure.canvas.widgetlock.available(sender):
+ return
+ if data is not None:
+ self.draw_rubberband(*data)
+ else:
+ self.remove_rubberband()
+
+ def draw_rubberband(self, *data):
+ """
+ Draw rubberband.
+
+ This method must get implemented per backend.
+ """
+ raise NotImplementedError
+
+ def remove_rubberband(self):
+ """
+ Remove rubberband.
+
+ This method should get implemented per backend.
+ """
+ pass
+
+
+class ToolQuit(ToolBase):
+ """Tool to call the figure manager destroy method."""
+
+ description = 'Quit the figure'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.quit'])
+
+ def trigger(self, sender, event, data=None):
+ Gcf.destroy_fig(self.figure)
+
+
+class ToolQuitAll(ToolBase):
+ """Tool to call the figure manager destroy method."""
+
+ description = 'Quit all figures'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.quit_all'])
+
+ def trigger(self, sender, event, data=None):
+ Gcf.destroy_all()
+
+
+class ToolGrid(ToolBase):
+ """Tool to toggle the major grids of the figure."""
+
+ description = 'Toggle major grids'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.grid'])
+
+ def trigger(self, sender, event, data=None):
+ sentinel = str(uuid.uuid4())
+ # Trigger grid switching by temporarily setting :rc:`keymap.grid`
+ # to a unique key and sending an appropriate event.
+ with (cbook._setattr_cm(event, key=sentinel),
+ mpl.rc_context({'keymap.grid': sentinel})):
+ mpl.backend_bases.key_press_handler(event, self.figure.canvas)
+
+
+class ToolMinorGrid(ToolBase):
+ """Tool to toggle the major and minor grids of the figure."""
+
+ description = 'Toggle major and minor grids'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.grid_minor'])
+
+ def trigger(self, sender, event, data=None):
+ sentinel = str(uuid.uuid4())
+ # Trigger grid switching by temporarily setting :rc:`keymap.grid_minor`
+ # to a unique key and sending an appropriate event.
+ with (cbook._setattr_cm(event, key=sentinel),
+ mpl.rc_context({'keymap.grid_minor': sentinel})):
+ mpl.backend_bases.key_press_handler(event, self.figure.canvas)
+
+
+class ToolFullScreen(ToolBase):
+ """Tool to toggle full screen."""
+
+ description = 'Toggle fullscreen mode'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.fullscreen'])
+
+ def trigger(self, sender, event, data=None):
+ self.figure.canvas.manager.full_screen_toggle()
+
+
+class AxisScaleBase(ToolToggleBase):
+ """Base Tool to toggle between linear and logarithmic."""
+
+ def trigger(self, sender, event, data=None):
+ if event.inaxes is None:
+ return
+ super().trigger(sender, event, data)
+
+ def enable(self, event=None):
+ self.set_scale(event.inaxes, 'log')
+ self.figure.canvas.draw_idle()
+
+ def disable(self, event=None):
+ self.set_scale(event.inaxes, 'linear')
+ self.figure.canvas.draw_idle()
+
+
+class ToolYScale(AxisScaleBase):
+ """Tool to toggle between linear and logarithmic scales on the Y axis."""
+
+ description = 'Toggle scale Y axis'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.yscale'])
+
+ def set_scale(self, ax, scale):
+ ax.set_yscale(scale)
+
+
+class ToolXScale(AxisScaleBase):
+ """Tool to toggle between linear and logarithmic scales on the X axis."""
+
+ description = 'Toggle scale X axis'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.xscale'])
+
+ def set_scale(self, ax, scale):
+ ax.set_xscale(scale)
+
+
+class ToolViewsPositions(ToolBase):
+ """
+ Auxiliary Tool to handle changes in views and positions.
+
+ Runs in the background and should get used by all the tools that
+ need to access the figure's history of views and positions, e.g.
+
+ * `ToolZoom`
+ * `ToolPan`
+ * `ToolHome`
+ * `ToolBack`
+ * `ToolForward`
+ """
+
+ def __init__(self, *args, **kwargs):
+ self.views = WeakKeyDictionary()
+ self.positions = WeakKeyDictionary()
+ self.home_views = WeakKeyDictionary()
+ super().__init__(*args, **kwargs)
+
+ def add_figure(self, figure):
+ """Add the current figure to the stack of views and positions."""
+
+ if figure not in self.views:
+ self.views[figure] = cbook._Stack()
+ self.positions[figure] = cbook._Stack()
+ self.home_views[figure] = WeakKeyDictionary()
+ # Define Home
+ self.push_current(figure)
+ # Make sure we add a home view for new Axes as they're added
+ figure.add_axobserver(lambda fig: self.update_home_views(fig))
+
+ def clear(self, figure):
+ """Reset the Axes stack."""
+ if figure in self.views:
+ self.views[figure].clear()
+ self.positions[figure].clear()
+ self.home_views[figure].clear()
+ self.update_home_views()
+
+ def update_view(self):
+ """
+ Update the view limits and position for each Axes from the current
+ stack position. If any Axes are present in the figure that aren't in
+ the current stack position, use the home view limits for those Axes and
+ don't update *any* positions.
+ """
+
+ views = self.views[self.figure]()
+ if views is None:
+ return
+ pos = self.positions[self.figure]()
+ if pos is None:
+ return
+ home_views = self.home_views[self.figure]
+ all_axes = self.figure.get_axes()
+ for a in all_axes:
+ if a in views:
+ cur_view = views[a]
+ else:
+ cur_view = home_views[a]
+ a._set_view(cur_view)
+
+ if set(all_axes).issubset(pos):
+ for a in all_axes:
+ # Restore both the original and modified positions
+ a._set_position(pos[a][0], 'original')
+ a._set_position(pos[a][1], 'active')
+
+ self.figure.canvas.draw_idle()
+
+ def push_current(self, figure=None):
+ """
+ Push the current view limits and position onto their respective stacks.
+ """
+ if not figure:
+ figure = self.figure
+ views = WeakKeyDictionary()
+ pos = WeakKeyDictionary()
+ for a in figure.get_axes():
+ views[a] = a._get_view()
+ pos[a] = self._axes_pos(a)
+ self.views[figure].push(views)
+ self.positions[figure].push(pos)
+
+ def _axes_pos(self, ax):
+ """
+ Return the original and modified positions for the specified Axes.
+
+ Parameters
+ ----------
+ ax : matplotlib.axes.Axes
+ The `.Axes` to get the positions for.
+
+ Returns
+ -------
+ original_position, modified_position
+ A tuple of the original and modified positions.
+ """
+
+ return (ax.get_position(True).frozen(),
+ ax.get_position().frozen())
+
+ def update_home_views(self, figure=None):
+ """
+ Make sure that ``self.home_views`` has an entry for all Axes present
+ in the figure.
+ """
+
+ if not figure:
+ figure = self.figure
+ for a in figure.get_axes():
+ if a not in self.home_views[figure]:
+ self.home_views[figure][a] = a._get_view()
+
+ def home(self):
+ """Recall the first view and position from the stack."""
+ self.views[self.figure].home()
+ self.positions[self.figure].home()
+
+ def back(self):
+ """Back one step in the stack of views and positions."""
+ self.views[self.figure].back()
+ self.positions[self.figure].back()
+
+ def forward(self):
+ """Forward one step in the stack of views and positions."""
+ self.views[self.figure].forward()
+ self.positions[self.figure].forward()
+
+
+class ViewsPositionsBase(ToolBase):
+ """Base class for `ToolHome`, `ToolBack` and `ToolForward`."""
+
+ _on_trigger = None
+
+ def trigger(self, sender, event, data=None):
+ self.toolmanager.get_tool(_views_positions).add_figure(self.figure)
+ getattr(self.toolmanager.get_tool(_views_positions),
+ self._on_trigger)()
+ self.toolmanager.get_tool(_views_positions).update_view()
+
+
+class ToolHome(ViewsPositionsBase):
+ """Restore the original view limits."""
+
+ description = 'Reset original view'
+ image = 'mpl-data/images/home'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.home'])
+ _on_trigger = 'home'
+
+
+class ToolBack(ViewsPositionsBase):
+ """Move back up the view limits stack."""
+
+ description = 'Back to previous view'
+ image = 'mpl-data/images/back'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.back'])
+ _on_trigger = 'back'
+
+
+class ToolForward(ViewsPositionsBase):
+ """Move forward in the view lim stack."""
+
+ description = 'Forward to next view'
+ image = 'mpl-data/images/forward'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.forward'])
+ _on_trigger = 'forward'
+
+
+class ConfigureSubplotsBase(ToolBase):
+ """Base tool for the configuration of subplots."""
+
+ description = 'Configure subplots'
+ image = 'mpl-data/images/subplots'
+
+
+class SaveFigureBase(ToolBase):
+ """Base tool for figure saving."""
+
+ description = 'Save the figure'
+ image = 'mpl-data/images/filesave'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.save'])
+
+
+class ZoomPanBase(ToolToggleBase):
+ """Base class for `ToolZoom` and `ToolPan`."""
+ def __init__(self, *args):
+ super().__init__(*args)
+ self._button_pressed = None
+ self._xypress = None
+ self._idPress = None
+ self._idRelease = None
+ self._idScroll = None
+ self.base_scale = 2.
+ self.scrollthresh = .5 # .5 second scroll threshold
+ self.lastscroll = time.time()-self.scrollthresh
+
+ def enable(self, event=None):
+ """Connect press/release events and lock the canvas."""
+ self.figure.canvas.widgetlock(self)
+ self._idPress = self.figure.canvas.mpl_connect(
+ 'button_press_event', self._press)
+ self._idRelease = self.figure.canvas.mpl_connect(
+ 'button_release_event', self._release)
+ self._idScroll = self.figure.canvas.mpl_connect(
+ 'scroll_event', self.scroll_zoom)
+
+ def disable(self, event=None):
+ """Release the canvas and disconnect press/release events."""
+ self._cancel_action()
+ self.figure.canvas.widgetlock.release(self)
+ self.figure.canvas.mpl_disconnect(self._idPress)
+ self.figure.canvas.mpl_disconnect(self._idRelease)
+ self.figure.canvas.mpl_disconnect(self._idScroll)
+
+ def trigger(self, sender, event, data=None):
+ self.toolmanager.get_tool(_views_positions).add_figure(self.figure)
+ super().trigger(sender, event, data)
+ new_navigate_mode = self.name.upper() if self.toggled else None
+ for ax in self.figure.axes:
+ ax.set_navigate_mode(new_navigate_mode)
+
+ def scroll_zoom(self, event):
+ # https://gist.github.com/tacaswell/3144287
+ if event.inaxes is None:
+ return
+
+ if event.button == 'up':
+ # deal with zoom in
+ scl = self.base_scale
+ elif event.button == 'down':
+ # deal with zoom out
+ scl = 1/self.base_scale
+ else:
+ # deal with something that should never happen
+ scl = 1
+
+ ax = event.inaxes
+ ax._set_view_from_bbox([event.x, event.y, scl])
+
+ # If last scroll was done within the timing threshold, delete the
+ # previous view
+ if (time.time()-self.lastscroll) < self.scrollthresh:
+ self.toolmanager.get_tool(_views_positions).back()
+
+ self.figure.canvas.draw_idle() # force re-draw
+
+ self.lastscroll = time.time()
+ self.toolmanager.get_tool(_views_positions).push_current()
+
+
+class ToolZoom(ZoomPanBase):
+ """A Tool for zooming using a rectangle selector."""
+
+ description = 'Zoom to rectangle'
+ image = 'mpl-data/images/zoom_to_rect'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.zoom'])
+ cursor = cursors.SELECT_REGION
+ radio_group = 'default'
+
+ def __init__(self, *args):
+ super().__init__(*args)
+ self._ids_zoom = []
+
+ def _cancel_action(self):
+ for zoom_id in self._ids_zoom:
+ self.figure.canvas.mpl_disconnect(zoom_id)
+ self.toolmanager.trigger_tool('rubberband', self)
+ self.figure.canvas.draw_idle()
+ self._xypress = None
+ self._button_pressed = None
+ self._ids_zoom = []
+ return
+
+ def _press(self, event):
+ """Callback for mouse button presses in zoom-to-rectangle mode."""
+
+ # If we're already in the middle of a zoom, pressing another
+ # button works to "cancel"
+ if self._ids_zoom:
+ self._cancel_action()
+
+ if event.button == 1:
+ self._button_pressed = 1
+ elif event.button == 3:
+ self._button_pressed = 3
+ else:
+ self._cancel_action()
+ return
+
+ x, y = event.x, event.y
+
+ self._xypress = []
+ for i, a in enumerate(self.figure.get_axes()):
+ if (x is not None and y is not None and a.in_axes(event) and
+ a.get_navigate() and a.can_zoom()):
+ self._xypress.append((x, y, a, i, a._get_view()))
+
+ id1 = self.figure.canvas.mpl_connect(
+ 'motion_notify_event', self._mouse_move)
+ id2 = self.figure.canvas.mpl_connect(
+ 'key_press_event', self._switch_on_zoom_mode)
+ id3 = self.figure.canvas.mpl_connect(
+ 'key_release_event', self._switch_off_zoom_mode)
+
+ self._ids_zoom = id1, id2, id3
+ self._zoom_mode = event.key
+
+ def _switch_on_zoom_mode(self, event):
+ self._zoom_mode = event.key
+ self._mouse_move(event)
+
+ def _switch_off_zoom_mode(self, event):
+ self._zoom_mode = None
+ self._mouse_move(event)
+
+ def _mouse_move(self, event):
+ """Callback for mouse moves in zoom-to-rectangle mode."""
+
+ if self._xypress:
+ x, y = event.x, event.y
+ lastx, lasty, a, ind, view = self._xypress[0]
+ (x1, y1), (x2, y2) = np.clip(
+ [[lastx, lasty], [x, y]], a.bbox.min, a.bbox.max)
+ if self._zoom_mode == "x":
+ y1, y2 = a.bbox.intervaly
+ elif self._zoom_mode == "y":
+ x1, x2 = a.bbox.intervalx
+ self.toolmanager.trigger_tool(
+ 'rubberband', self, data=(x1, y1, x2, y2))
+
+ def _release(self, event):
+ """Callback for mouse button releases in zoom-to-rectangle mode."""
+
+ for zoom_id in self._ids_zoom:
+ self.figure.canvas.mpl_disconnect(zoom_id)
+ self._ids_zoom = []
+
+ if not self._xypress:
+ self._cancel_action()
+ return
+
+ done_ax = []
+
+ for cur_xypress in self._xypress:
+ x, y = event.x, event.y
+ lastx, lasty, a, _ind, view = cur_xypress
+ # ignore singular clicks - 5 pixels is a threshold
+ if abs(x - lastx) < 5 or abs(y - lasty) < 5:
+ self._cancel_action()
+ return
+
+ # detect twinx, twiny Axes and avoid double zooming
+ twinx = any(a.get_shared_x_axes().joined(a, a1) for a1 in done_ax)
+ twiny = any(a.get_shared_y_axes().joined(a, a1) for a1 in done_ax)
+ done_ax.append(a)
+
+ if self._button_pressed == 1:
+ direction = 'in'
+ elif self._button_pressed == 3:
+ direction = 'out'
+ else:
+ continue
+
+ a._set_view_from_bbox((lastx, lasty, x, y), direction,
+ self._zoom_mode, twinx, twiny)
+
+ self._zoom_mode = None
+ self.toolmanager.get_tool(_views_positions).push_current()
+ self._cancel_action()
+
+
+class ToolPan(ZoomPanBase):
+ """Pan Axes with left mouse, zoom with right."""
+
+ default_keymap = property(lambda self: mpl.rcParams['keymap.pan'])
+ description = 'Pan axes with left mouse, zoom with right'
+ image = 'mpl-data/images/move'
+ cursor = cursors.MOVE
+ radio_group = 'default'
+
+ def __init__(self, *args):
+ super().__init__(*args)
+ self._id_drag = None
+
+ def _cancel_action(self):
+ self._button_pressed = None
+ self._xypress = []
+ self.figure.canvas.mpl_disconnect(self._id_drag)
+ self.toolmanager.messagelock.release(self)
+ self.figure.canvas.draw_idle()
+
+ def _press(self, event):
+ if event.button == 1:
+ self._button_pressed = 1
+ elif event.button == 3:
+ self._button_pressed = 3
+ else:
+ self._cancel_action()
+ return
+
+ x, y = event.x, event.y
+
+ self._xypress = []
+ for i, a in enumerate(self.figure.get_axes()):
+ if (x is not None and y is not None and a.in_axes(event) and
+ a.get_navigate() and a.can_pan()):
+ a.start_pan(x, y, event.button)
+ self._xypress.append((a, i))
+ self.toolmanager.messagelock(self)
+ self._id_drag = self.figure.canvas.mpl_connect(
+ 'motion_notify_event', self._mouse_move)
+
+ def _release(self, event):
+ if self._button_pressed is None:
+ self._cancel_action()
+ return
+
+ self.figure.canvas.mpl_disconnect(self._id_drag)
+ self.toolmanager.messagelock.release(self)
+
+ for a, _ind in self._xypress:
+ a.end_pan()
+ if not self._xypress:
+ self._cancel_action()
+ return
+
+ self.toolmanager.get_tool(_views_positions).push_current()
+ self._cancel_action()
+
+ def _mouse_move(self, event):
+ for a, _ind in self._xypress:
+ # safer to use the recorded button at the _press than current
+ # button: # multiple button can get pressed during motion...
+ a.drag_pan(self._button_pressed, event.key, event.x, event.y)
+ self.toolmanager.canvas.draw_idle()
+
+
+class ToolHelpBase(ToolBase):
+ description = 'Print tool list, shortcuts and description'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.help'])
+ image = 'mpl-data/images/help'
+
+ @staticmethod
+ def format_shortcut(key_sequence):
+ """
+ Convert a shortcut string from the notation used in rc config to the
+ standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'.
+ """
+ return (key_sequence if len(key_sequence) == 1 else
+ re.sub(r"\+[A-Z]", r"+Shift\g<0>", key_sequence).title())
+
+ def _format_tool_keymap(self, name):
+ keymaps = self.toolmanager.get_tool_keymap(name)
+ return ", ".join(self.format_shortcut(keymap) for keymap in keymaps)
+
+ def _get_help_entries(self):
+ return [(name, self._format_tool_keymap(name), tool.description)
+ for name, tool in sorted(self.toolmanager.tools.items())
+ if tool.description]
+
+ def _get_help_text(self):
+ entries = self._get_help_entries()
+ entries = ["{}: {}\n\t{}".format(*entry) for entry in entries]
+ return "\n".join(entries)
+
+ def _get_help_html(self):
+ fmt = "{} {} {} "
+ rows = [fmt.format(
+ "Action ", "Shortcuts ", "Description ")]
+ rows += [fmt.format(*row) for row in self._get_help_entries()]
+ return (""
+ "" + rows[0] + " "
+ "".join(rows[1:]) + "
")
+
+
+class ToolCopyToClipboardBase(ToolBase):
+ """Tool to copy the figure to the clipboard."""
+
+ description = 'Copy the canvas figure to clipboard'
+ default_keymap = property(lambda self: mpl.rcParams['keymap.copy'])
+
+ def trigger(self, *args, **kwargs):
+ message = "Copy tool is not available"
+ self.toolmanager.message_event(message, self)
+
+
+default_tools = {'home': ToolHome, 'back': ToolBack, 'forward': ToolForward,
+ 'zoom': ToolZoom, 'pan': ToolPan,
+ 'subplots': ConfigureSubplotsBase,
+ 'save': SaveFigureBase,
+ 'grid': ToolGrid,
+ 'grid_minor': ToolMinorGrid,
+ 'fullscreen': ToolFullScreen,
+ 'quit': ToolQuit,
+ 'quit_all': ToolQuitAll,
+ 'xscale': ToolXScale,
+ 'yscale': ToolYScale,
+ 'position': ToolCursorPosition,
+ _views_positions: ToolViewsPositions,
+ 'cursor': ToolSetCursor,
+ 'rubberband': RubberbandBase,
+ 'help': ToolHelpBase,
+ 'copy': ToolCopyToClipboardBase,
+ }
+
+default_toolbar_tools = [['navigation', ['home', 'back', 'forward']],
+ ['zoompan', ['pan', 'zoom', 'subplots']],
+ ['io', ['save', 'help']]]
+
+
+def add_tools_to_manager(toolmanager, tools=default_tools):
+ """
+ Add multiple tools to a `.ToolManager`.
+
+ Parameters
+ ----------
+ toolmanager : `.backend_managers.ToolManager`
+ Manager to which the tools are added.
+ tools : {str: class_like}, optional
+ The tools to add in a {name: tool} dict, see
+ `.backend_managers.ToolManager.add_tool` for more info.
+ """
+
+ for name, tool in tools.items():
+ toolmanager.add_tool(name, tool)
+
+
+def add_tools_to_container(container, tools=default_toolbar_tools):
+ """
+ Add multiple tools to the container.
+
+ Parameters
+ ----------
+ container : Container
+ `.backend_bases.ToolContainerBase` object that will get the tools
+ added.
+ tools : list, optional
+ List in the form ``[[group1, [tool1, tool2 ...]], [group2, [...]]]``
+ where the tools ``[tool1, tool2, ...]`` will display in group1.
+ See `.backend_bases.ToolContainerBase.add_tool` for details.
+ """
+
+ for group, grouptools in tools:
+ for position, tool in enumerate(grouptools):
+ container.add_tool(tool, group, position)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_tools.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_tools.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..32fe8c2f5a7982ce5e2b07a58ac142c645a9ce2b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backend_tools.pyi
@@ -0,0 +1,121 @@
+import enum
+from matplotlib import cbook
+from matplotlib.axes import Axes
+from matplotlib.backend_bases import ToolContainerBase, FigureCanvasBase
+from matplotlib.backend_managers import ToolManager, ToolEvent
+from matplotlib.figure import Figure
+from matplotlib.scale import ScaleBase
+
+from typing import Any, cast
+
+class Cursors(enum.IntEnum):
+ POINTER = cast(int, ...)
+ HAND = cast(int, ...)
+ SELECT_REGION = cast(int, ...)
+ MOVE = cast(int, ...)
+ WAIT = cast(int, ...)
+ RESIZE_HORIZONTAL = cast(int, ...)
+ RESIZE_VERTICAL = cast(int, ...)
+
+cursors = Cursors
+
+class ToolBase:
+ @property
+ def default_keymap(self) -> list[str] | None: ...
+ description: str | None
+ image: str | None
+ def __init__(self, toolmanager: ToolManager, name: str) -> None: ...
+ @property
+ def name(self) -> str: ...
+ @property
+ def toolmanager(self) -> ToolManager: ...
+ @property
+ def canvas(self) -> FigureCanvasBase | None: ...
+ @property
+ def figure(self) -> Figure | None: ...
+ @figure.setter
+ def figure(self, figure: Figure | None) -> None: ...
+ def set_figure(self, figure: Figure | None) -> None: ...
+ def trigger(self, sender: Any, event: ToolEvent, data: Any = ...) -> None: ...
+
+class ToolToggleBase(ToolBase):
+ radio_group: str | None
+ cursor: Cursors | None
+ default_toggled: bool
+ def __init__(self, *args, **kwargs) -> None: ...
+ def enable(self, event: ToolEvent | None = ...) -> None: ...
+ def disable(self, event: ToolEvent | None = ...) -> None: ...
+ @property
+ def toggled(self) -> bool: ...
+ def set_figure(self, figure: Figure | None) -> None: ...
+
+class ToolSetCursor(ToolBase): ...
+
+class ToolCursorPosition(ToolBase):
+ def send_message(self, event: ToolEvent) -> None: ...
+
+class RubberbandBase(ToolBase):
+ def draw_rubberband(self, *data) -> None: ...
+ def remove_rubberband(self) -> None: ...
+
+class ToolQuit(ToolBase): ...
+class ToolQuitAll(ToolBase): ...
+class ToolGrid(ToolBase): ...
+class ToolMinorGrid(ToolBase): ...
+class ToolFullScreen(ToolBase): ...
+
+class AxisScaleBase(ToolToggleBase):
+ def enable(self, event: ToolEvent | None = ...) -> None: ...
+ def disable(self, event: ToolEvent | None = ...) -> None: ...
+
+class ToolYScale(AxisScaleBase):
+ def set_scale(self, ax: Axes, scale: str | ScaleBase) -> None: ...
+
+class ToolXScale(AxisScaleBase):
+ def set_scale(self, ax, scale: str | ScaleBase) -> None: ...
+
+class ToolViewsPositions(ToolBase):
+ views: dict[Figure | Axes, cbook._Stack]
+ positions: dict[Figure | Axes, cbook._Stack]
+ home_views: dict[Figure, dict[Axes, tuple[float, float, float, float]]]
+ def add_figure(self, figure: Figure) -> None: ...
+ def clear(self, figure: Figure) -> None: ...
+ def update_view(self) -> None: ...
+ def push_current(self, figure: Figure | None = ...) -> None: ...
+ def update_home_views(self, figure: Figure | None = ...) -> None: ...
+ def home(self) -> None: ...
+ def back(self) -> None: ...
+ def forward(self) -> None: ...
+
+class ViewsPositionsBase(ToolBase): ...
+class ToolHome(ViewsPositionsBase): ...
+class ToolBack(ViewsPositionsBase): ...
+class ToolForward(ViewsPositionsBase): ...
+class ConfigureSubplotsBase(ToolBase): ...
+class SaveFigureBase(ToolBase): ...
+
+class ZoomPanBase(ToolToggleBase):
+ base_scale: float
+ scrollthresh: float
+ lastscroll: float
+ def __init__(self, *args) -> None: ...
+ def enable(self, event: ToolEvent | None = ...) -> None: ...
+ def disable(self, event: ToolEvent | None = ...) -> None: ...
+ def scroll_zoom(self, event: ToolEvent) -> None: ...
+
+class ToolZoom(ZoomPanBase): ...
+class ToolPan(ZoomPanBase): ...
+
+class ToolHelpBase(ToolBase):
+ @staticmethod
+ def format_shortcut(key_sequence: str) -> str: ...
+
+class ToolCopyToClipboardBase(ToolBase): ...
+
+default_tools: dict[str, ToolBase]
+default_toolbar_tools: list[list[str | list[str]]]
+
+def add_tools_to_manager(
+ toolmanager: ToolManager, tools: dict[str, type[ToolBase]] = ...
+) -> None: ...
+def add_tools_to_container(container: ToolContainerBase, tools: list[Any] = ...) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..cf0f682d5d4b4772426ea2ff0e62251ce947a827
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__init__.py
@@ -0,0 +1,5 @@
+from .registry import BackendFilter, backend_registry # noqa: F401
+
+# NOTE: plt.switch_backend() (called at import time) will add a "backend"
+# attribute here for backcompat.
+_QT_FORCE_QT5_BINDING = False
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..9366fec02b024797d6b59fe1b2f357a2dd35010d
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/_backend_tk.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/_backend_tk.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b2fdbf39318ee6e1a38a2035729eb7d1a97f1afe
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/_backend_tk.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_agg.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_agg.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..46420250a6c048e384317c7976825836c14c0340
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_agg.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk3.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk3.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..791e31d7623c29a7912a9930f443a0606ad9b903
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk3.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk3agg.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk3agg.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..09e9fbe749750e895374cc948f0903717960982c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk3agg.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk4.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk4.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0e999894b26686bc7a2eea72e8fa5f90fa5895c3
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk4.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk4agg.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk4agg.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..767bbd48853461ca672f3cf780f29652c877a59a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_gtk4agg.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_macosx.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_macosx.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ba5276e07e9445922b5b995e71728a0879ee829d
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_macosx.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_qtagg.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_qtagg.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4e6b6f7b2e43ba1455d458fbe875dacbe779579a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_qtagg.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_tkagg.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_tkagg.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2fa290c87ccbbf176f36e8e96255564a17aed726
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_tkagg.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_wxagg.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_wxagg.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..52136dcf8affabfaea12340d8ad06404eed7c894
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/backend_wxagg.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/qt_compat.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/qt_compat.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0541a4f0db85afcc902879226e0d0bc92b6a15e1
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/qt_compat.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/registry.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/registry.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..83c3cd708c9aa3fc632b14f72a33bed1253e0bc5
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/__pycache__/registry.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_agg.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_agg.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py
new file mode 100644
index 0000000000000000000000000000000000000000..ac443730e28a89ffb8c31d9163e343835aa6d9fe
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_gtk.py
@@ -0,0 +1,331 @@
+"""
+Common code for GTK3 and GTK4 backends.
+"""
+
+import logging
+import sys
+
+import matplotlib as mpl
+from matplotlib import _api, backend_tools, cbook
+from matplotlib._pylab_helpers import Gcf
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2,
+ TimerBase)
+from matplotlib.backend_tools import Cursors
+
+import gi
+# The GTK3/GTK4 backends will have already called `gi.require_version` to set
+# the desired GTK.
+from gi.repository import Gdk, Gio, GLib, Gtk
+
+
+try:
+ gi.require_foreign("cairo")
+except ImportError as e:
+ raise ImportError("Gtk-based backends require cairo") from e
+
+_log = logging.getLogger(__name__)
+_application = None # Placeholder
+
+
+def _shutdown_application(app):
+ # The application might prematurely shut down if Ctrl-C'd out of IPython,
+ # so close all windows.
+ for win in app.get_windows():
+ win.close()
+ # The PyGObject wrapper incorrectly thinks that None is not allowed, or we
+ # would call this:
+ # Gio.Application.set_default(None)
+ # Instead, we set this property and ignore default applications with it:
+ app._created_by_matplotlib = True
+ global _application
+ _application = None
+
+
+def _create_application():
+ global _application
+
+ if _application is None:
+ app = Gio.Application.get_default()
+ if app is None or getattr(app, '_created_by_matplotlib', False):
+ # display_is_valid returns False only if on Linux and neither X11
+ # nor Wayland display can be opened.
+ if not mpl._c_internal_utils.display_is_valid():
+ raise RuntimeError('Invalid DISPLAY variable')
+ _application = Gtk.Application.new('org.matplotlib.Matplotlib3',
+ Gio.ApplicationFlags.NON_UNIQUE)
+ # The activate signal must be connected, but we don't care for
+ # handling it, since we don't do any remote processing.
+ _application.connect('activate', lambda *args, **kwargs: None)
+ _application.connect('shutdown', _shutdown_application)
+ _application.register()
+ cbook._setup_new_guiapp()
+ else:
+ _application = app
+
+ return _application
+
+
+def mpl_to_gtk_cursor_name(mpl_cursor):
+ return _api.check_getitem({
+ Cursors.MOVE: "move",
+ Cursors.HAND: "pointer",
+ Cursors.POINTER: "default",
+ Cursors.SELECT_REGION: "crosshair",
+ Cursors.WAIT: "wait",
+ Cursors.RESIZE_HORIZONTAL: "ew-resize",
+ Cursors.RESIZE_VERTICAL: "ns-resize",
+ }, cursor=mpl_cursor)
+
+
+class TimerGTK(TimerBase):
+ """Subclass of `.TimerBase` using GTK timer events."""
+
+ def __init__(self, *args, **kwargs):
+ self._timer = None
+ super().__init__(*args, **kwargs)
+
+ def _timer_start(self):
+ # Need to stop it, otherwise we potentially leak a timer id that will
+ # never be stopped.
+ self._timer_stop()
+ self._timer = GLib.timeout_add(self._interval, self._on_timer)
+
+ def _timer_stop(self):
+ if self._timer is not None:
+ GLib.source_remove(self._timer)
+ self._timer = None
+
+ def _timer_set_interval(self):
+ # Only stop and restart it if the timer has already been started.
+ if self._timer is not None:
+ self._timer_stop()
+ self._timer_start()
+
+ def _on_timer(self):
+ super()._on_timer()
+
+ # Gtk timeout_add() requires that the callback returns True if it
+ # is to be called again.
+ if self.callbacks and not self._single:
+ return True
+ else:
+ self._timer = None
+ return False
+
+
+class _FigureCanvasGTK(FigureCanvasBase):
+ _timer_cls = TimerGTK
+
+
+class _FigureManagerGTK(FigureManagerBase):
+ """
+ Attributes
+ ----------
+ canvas : `FigureCanvas`
+ The FigureCanvas instance
+ num : int or str
+ The Figure number
+ toolbar : Gtk.Toolbar or Gtk.Box
+ The toolbar
+ vbox : Gtk.VBox
+ The Gtk.VBox containing the canvas and toolbar
+ window : Gtk.Window
+ The Gtk.Window
+ """
+
+ def __init__(self, canvas, num):
+ self._gtk_ver = gtk_ver = Gtk.get_major_version()
+
+ app = _create_application()
+ self.window = Gtk.Window()
+ app.add_window(self.window)
+ super().__init__(canvas, num)
+
+ if gtk_ver == 3:
+ icon_ext = "png" if sys.platform == "win32" else "svg"
+ self.window.set_icon_from_file(
+ str(cbook._get_data_path(f"images/matplotlib.{icon_ext}")))
+
+ self.vbox = Gtk.Box()
+ self.vbox.set_property("orientation", Gtk.Orientation.VERTICAL)
+
+ if gtk_ver == 3:
+ self.window.add(self.vbox)
+ self.vbox.show()
+ self.canvas.show()
+ self.vbox.pack_start(self.canvas, True, True, 0)
+ elif gtk_ver == 4:
+ self.window.set_child(self.vbox)
+ self.vbox.prepend(self.canvas)
+
+ # calculate size for window
+ w, h = self.canvas.get_width_height()
+
+ if self.toolbar is not None:
+ if gtk_ver == 3:
+ self.toolbar.show()
+ self.vbox.pack_end(self.toolbar, False, False, 0)
+ elif gtk_ver == 4:
+ sw = Gtk.ScrolledWindow(vscrollbar_policy=Gtk.PolicyType.NEVER)
+ sw.set_child(self.toolbar)
+ self.vbox.append(sw)
+ min_size, nat_size = self.toolbar.get_preferred_size()
+ h += nat_size.height
+
+ self.window.set_default_size(w, h)
+
+ self._destroying = False
+ self.window.connect("destroy", lambda *args: Gcf.destroy(self))
+ self.window.connect({3: "delete_event", 4: "close-request"}[gtk_ver],
+ lambda *args: Gcf.destroy(self))
+ if mpl.is_interactive():
+ self.window.show()
+ self.canvas.draw_idle()
+
+ self.canvas.grab_focus()
+
+ def destroy(self, *args):
+ if self._destroying:
+ # Otherwise, this can be called twice when the user presses 'q',
+ # which calls Gcf.destroy(self), then this destroy(), then triggers
+ # Gcf.destroy(self) once again via
+ # `connect("destroy", lambda *args: Gcf.destroy(self))`.
+ return
+ self._destroying = True
+ self.window.destroy()
+ self.canvas.destroy()
+
+ @classmethod
+ def start_main_loop(cls):
+ global _application
+ if _application is None:
+ return
+
+ try:
+ _application.run() # Quits when all added windows close.
+ except KeyboardInterrupt:
+ # Ensure all windows can process their close event from
+ # _shutdown_application.
+ context = GLib.MainContext.default()
+ while context.pending():
+ context.iteration(True)
+ raise
+ finally:
+ # Running after quit is undefined, so create a new one next time.
+ _application = None
+
+ def show(self):
+ # show the figure window
+ self.window.show()
+ self.canvas.draw()
+ if mpl.rcParams["figure.raise_window"]:
+ meth_name = {3: "get_window", 4: "get_surface"}[self._gtk_ver]
+ if getattr(self.window, meth_name)():
+ self.window.present()
+ else:
+ # If this is called by a callback early during init,
+ # self.window (a GtkWindow) may not have an associated
+ # low-level GdkWindow (on GTK3) or GdkSurface (on GTK4) yet,
+ # and present() would crash.
+ _api.warn_external("Cannot raise window yet to be setup")
+
+ def full_screen_toggle(self):
+ is_fullscreen = {
+ 3: lambda w: (w.get_window().get_state()
+ & Gdk.WindowState.FULLSCREEN),
+ 4: lambda w: w.is_fullscreen(),
+ }[self._gtk_ver]
+ if is_fullscreen(self.window):
+ self.window.unfullscreen()
+ else:
+ self.window.fullscreen()
+
+ def get_window_title(self):
+ return self.window.get_title()
+
+ def set_window_title(self, title):
+ self.window.set_title(title)
+
+ def resize(self, width, height):
+ width = int(width / self.canvas.device_pixel_ratio)
+ height = int(height / self.canvas.device_pixel_ratio)
+ if self.toolbar:
+ min_size, nat_size = self.toolbar.get_preferred_size()
+ height += nat_size.height
+ canvas_size = self.canvas.get_allocation()
+ if self._gtk_ver >= 4 or canvas_size.width == canvas_size.height == 1:
+ # A canvas size of (1, 1) cannot exist in most cases, because
+ # window decorations would prevent such a small window. This call
+ # must be before the window has been mapped and widgets have been
+ # sized, so just change the window's starting size.
+ self.window.set_default_size(width, height)
+ else:
+ self.window.resize(width, height)
+
+
+class _NavigationToolbar2GTK(NavigationToolbar2):
+ # Must be implemented in GTK3/GTK4 backends:
+ # * __init__
+ # * save_figure
+
+ def set_message(self, s):
+ escaped = GLib.markup_escape_text(s)
+ self.message.set_markup(f'{escaped} ')
+
+ def draw_rubberband(self, event, x0, y0, x1, y1):
+ height = self.canvas.figure.bbox.height
+ y1 = height - y1
+ y0 = height - y0
+ rect = [int(val) for val in (x0, y0, x1 - x0, y1 - y0)]
+ self.canvas._draw_rubberband(rect)
+
+ def remove_rubberband(self):
+ self.canvas._draw_rubberband(None)
+
+ def _update_buttons_checked(self):
+ for name, active in [("Pan", "PAN"), ("Zoom", "ZOOM")]:
+ button = self._gtk_ids.get(name)
+ if button:
+ with button.handler_block(button._signal_handler):
+ button.set_active(self.mode.name == active)
+
+ def pan(self, *args):
+ super().pan(*args)
+ self._update_buttons_checked()
+
+ def zoom(self, *args):
+ super().zoom(*args)
+ self._update_buttons_checked()
+
+ def set_history_buttons(self):
+ can_backward = self._nav_stack._pos > 0
+ can_forward = self._nav_stack._pos < len(self._nav_stack) - 1
+ if 'Back' in self._gtk_ids:
+ self._gtk_ids['Back'].set_sensitive(can_backward)
+ if 'Forward' in self._gtk_ids:
+ self._gtk_ids['Forward'].set_sensitive(can_forward)
+
+
+class RubberbandGTK(backend_tools.RubberbandBase):
+ def draw_rubberband(self, x0, y0, x1, y1):
+ _NavigationToolbar2GTK.draw_rubberband(
+ self._make_classic_style_pseudo_toolbar(), None, x0, y0, x1, y1)
+
+ def remove_rubberband(self):
+ _NavigationToolbar2GTK.remove_rubberband(
+ self._make_classic_style_pseudo_toolbar())
+
+
+class ConfigureSubplotsGTK(backend_tools.ConfigureSubplotsBase):
+ def trigger(self, *args):
+ _NavigationToolbar2GTK.configure_subplots(self, None)
+
+
+class _BackendGTK(_Backend):
+ backend_version = "{}.{}.{}".format(
+ Gtk.get_major_version(),
+ Gtk.get_minor_version(),
+ Gtk.get_micro_version(),
+ )
+ mainloop = _FigureManagerGTK.start_main_loop
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_pdf_ps.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_pdf_ps.py
new file mode 100644
index 0000000000000000000000000000000000000000..a2a878d54156f7fb54ad31c1c109f7a5be23e0ee
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_pdf_ps.py
@@ -0,0 +1,189 @@
+"""
+Common functionality between the PDF and PS backends.
+"""
+
+from io import BytesIO
+import functools
+import logging
+
+from fontTools import subset
+
+import matplotlib as mpl
+from .. import font_manager, ft2font
+from .._afm import AFM
+from ..backend_bases import RendererBase
+
+
+@functools.lru_cache(50)
+def _cached_get_afm_from_fname(fname):
+ with open(fname, "rb") as fh:
+ return AFM(fh)
+
+
+def get_glyphs_subset(fontfile, characters):
+ """
+ Subset a TTF font
+
+ Reads the named fontfile and restricts the font to the characters.
+
+ Parameters
+ ----------
+ fontfile : str
+ Path to the font file
+ characters : str
+ Continuous set of characters to include in subset
+
+ Returns
+ -------
+ fontTools.ttLib.ttFont.TTFont
+ An open font object representing the subset, which needs to
+ be closed by the caller.
+ """
+
+ options = subset.Options(glyph_names=True, recommended_glyphs=True)
+
+ # Prevent subsetting extra tables.
+ options.drop_tables += [
+ 'FFTM', # FontForge Timestamp.
+ 'PfEd', # FontForge personal table.
+ 'BDF', # X11 BDF header.
+ 'meta', # Metadata stores design/supported languages (meaningless for subsets).
+ 'MERG', # Merge Table.
+ 'TSIV', # Microsoft Visual TrueType extension.
+ 'Zapf', # Information about the individual glyphs in the font.
+ 'bdat', # The bitmap data table.
+ 'bloc', # The bitmap location table.
+ 'cidg', # CID to Glyph ID table (Apple Advanced Typography).
+ 'fdsc', # The font descriptors table.
+ 'feat', # Feature name table (Apple Advanced Typography).
+ 'fmtx', # The Font Metrics Table.
+ 'fond', # Data-fork font information (Apple Advanced Typography).
+ 'just', # The justification table (Apple Advanced Typography).
+ 'kerx', # An extended kerning table (Apple Advanced Typography).
+ 'ltag', # Language Tag.
+ 'morx', # Extended Glyph Metamorphosis Table.
+ 'trak', # Tracking table.
+ 'xref', # The cross-reference table (some Apple font tooling information).
+ ]
+ # if fontfile is a ttc, specify font number
+ if fontfile.endswith(".ttc"):
+ options.font_number = 0
+
+ font = subset.load_font(fontfile, options)
+ subsetter = subset.Subsetter(options=options)
+ subsetter.populate(text=characters)
+ subsetter.subset(font)
+ return font
+
+
+def font_as_file(font):
+ """
+ Convert a TTFont object into a file-like object.
+
+ Parameters
+ ----------
+ font : fontTools.ttLib.ttFont.TTFont
+ A font object
+
+ Returns
+ -------
+ BytesIO
+ A file object with the font saved into it
+ """
+ fh = BytesIO()
+ font.save(fh, reorderTables=False)
+ return fh
+
+
+class CharacterTracker:
+ """
+ Helper for font subsetting by the pdf and ps backends.
+
+ Maintains a mapping of font paths to the set of character codepoints that
+ are being used from that font.
+ """
+
+ def __init__(self):
+ self.used = {}
+
+ def track(self, font, s):
+ """Record that string *s* is being typeset using font *font*."""
+ char_to_font = font._get_fontmap(s)
+ for _c, _f in char_to_font.items():
+ self.used.setdefault(_f.fname, set()).add(ord(_c))
+
+ def track_glyph(self, font, glyph):
+ """Record that codepoint *glyph* is being typeset using font *font*."""
+ self.used.setdefault(font.fname, set()).add(glyph)
+
+
+class RendererPDFPSBase(RendererBase):
+ # The following attributes must be defined by the subclasses:
+ # - _afm_font_dir
+ # - _use_afm_rc_name
+
+ def __init__(self, width, height):
+ super().__init__()
+ self.width = width
+ self.height = height
+
+ def flipy(self):
+ # docstring inherited
+ return False # y increases from bottom to top.
+
+ def option_scale_image(self):
+ # docstring inherited
+ return True # PDF and PS support arbitrary image scaling.
+
+ def option_image_nocomposite(self):
+ # docstring inherited
+ # Decide whether to composite image based on rcParam value.
+ return not mpl.rcParams["image.composite_image"]
+
+ def get_canvas_width_height(self):
+ # docstring inherited
+ return self.width * 72.0, self.height * 72.0
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ # docstring inherited
+ if ismath == "TeX":
+ return super().get_text_width_height_descent(s, prop, ismath)
+ elif ismath:
+ parse = self._text2path.mathtext_parser.parse(s, 72, prop)
+ return parse.width, parse.height, parse.depth
+ elif mpl.rcParams[self._use_afm_rc_name]:
+ font = self._get_font_afm(prop)
+ l, b, w, h, d = font.get_str_bbox_and_descent(s)
+ scale = prop.get_size_in_points() / 1000
+ w *= scale
+ h *= scale
+ d *= scale
+ return w, h, d
+ else:
+ font = self._get_font_ttf(prop)
+ font.set_text(s, 0.0, flags=ft2font.LoadFlags.NO_HINTING)
+ w, h = font.get_width_height()
+ d = font.get_descent()
+ scale = 1 / 64
+ w *= scale
+ h *= scale
+ d *= scale
+ return w, h, d
+
+ def _get_font_afm(self, prop):
+ fname = font_manager.findfont(
+ prop, fontext="afm", directory=self._afm_font_dir)
+ return _cached_get_afm_from_fname(fname)
+
+ def _get_font_ttf(self, prop):
+ fnames = font_manager.fontManager._find_fonts_by_props(prop)
+ try:
+ font = font_manager.get_font(fnames)
+ font.clear()
+ font.set_size(prop.get_size_in_points(), 72)
+ return font
+ except RuntimeError:
+ logging.getLogger(__name__).warning(
+ "The PostScript/PDF backend does not currently "
+ "support the selected font (%s).", fnames)
+ raise
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_tk.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_tk.py
new file mode 100644
index 0000000000000000000000000000000000000000..0bbff1379ffae2adb946a2987d92966b034e01f1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_backend_tk.py
@@ -0,0 +1,1077 @@
+import uuid
+import weakref
+from contextlib import contextmanager
+import logging
+import math
+import os.path
+import pathlib
+import sys
+import tkinter as tk
+import tkinter.filedialog
+import tkinter.font
+import tkinter.messagebox
+from tkinter.simpledialog import SimpleDialog
+
+import numpy as np
+from PIL import Image, ImageTk
+
+import matplotlib as mpl
+from matplotlib import _api, backend_tools, cbook, _c_internal_utils
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2,
+ TimerBase, ToolContainerBase, cursors, _Mode, MouseButton,
+ CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent)
+from matplotlib._pylab_helpers import Gcf
+from . import _tkagg
+from ._tkagg import TK_PHOTO_COMPOSITE_OVERLAY, TK_PHOTO_COMPOSITE_SET
+
+
+_log = logging.getLogger(__name__)
+cursord = {
+ cursors.MOVE: "fleur",
+ cursors.HAND: "hand2",
+ cursors.POINTER: "arrow",
+ cursors.SELECT_REGION: "crosshair",
+ cursors.WAIT: "watch",
+ cursors.RESIZE_HORIZONTAL: "sb_h_double_arrow",
+ cursors.RESIZE_VERTICAL: "sb_v_double_arrow",
+}
+
+
+@contextmanager
+def _restore_foreground_window_at_end():
+ foreground = _c_internal_utils.Win32_GetForegroundWindow()
+ try:
+ yield
+ finally:
+ if foreground and mpl.rcParams['tk.window_focus']:
+ _c_internal_utils.Win32_SetForegroundWindow(foreground)
+
+
+_blit_args = {}
+# Initialize to a non-empty string that is not a Tcl command
+_blit_tcl_name = "mpl_blit_" + uuid.uuid4().hex
+
+
+def _blit(argsid):
+ """
+ Thin wrapper to blit called via tkapp.call.
+
+ *argsid* is a unique string identifier to fetch the correct arguments from
+ the ``_blit_args`` dict, since arguments cannot be passed directly.
+ """
+ photoimage, data, offsets, bbox, comp_rule = _blit_args.pop(argsid)
+ if not photoimage.tk.call("info", "commands", photoimage):
+ return
+ _tkagg.blit(photoimage.tk.interpaddr(), str(photoimage), data, comp_rule, offsets,
+ bbox)
+
+
+def blit(photoimage, aggimage, offsets, bbox=None):
+ """
+ Blit *aggimage* to *photoimage*.
+
+ *offsets* is a tuple describing how to fill the ``offset`` field of the
+ ``Tk_PhotoImageBlock`` struct: it should be (0, 1, 2, 3) for RGBA8888 data,
+ (2, 1, 0, 3) for little-endian ARBG32 (i.e. GBRA8888) data and (1, 2, 3, 0)
+ for big-endian ARGB32 (i.e. ARGB8888) data.
+
+ If *bbox* is passed, it defines the region that gets blitted. That region
+ will be composed with the previous data according to the alpha channel.
+ Blitting will be clipped to pixels inside the canvas, including silently
+ doing nothing if the *bbox* region is entirely outside the canvas.
+
+ Tcl events must be dispatched to trigger a blit from a non-Tcl thread.
+ """
+ data = np.asarray(aggimage)
+ height, width = data.shape[:2]
+ if bbox is not None:
+ (x1, y1), (x2, y2) = bbox.__array__()
+ x1 = max(math.floor(x1), 0)
+ x2 = min(math.ceil(x2), width)
+ y1 = max(math.floor(y1), 0)
+ y2 = min(math.ceil(y2), height)
+ if (x1 > x2) or (y1 > y2):
+ return
+ bboxptr = (x1, x2, y1, y2)
+ comp_rule = TK_PHOTO_COMPOSITE_OVERLAY
+ else:
+ bboxptr = (0, width, 0, height)
+ comp_rule = TK_PHOTO_COMPOSITE_SET
+
+ # NOTE: _tkagg.blit is thread unsafe and will crash the process if called
+ # from a thread (GH#13293). Instead of blanking and blitting here,
+ # use tkapp.call to post a cross-thread event if this function is called
+ # from a non-Tcl thread.
+
+ # tkapp.call coerces all arguments to strings, so to avoid string parsing
+ # within _blit, pack up the arguments into a global data structure.
+ args = photoimage, data, offsets, bboxptr, comp_rule
+ # Need a unique key to avoid thread races.
+ # Again, make the key a string to avoid string parsing in _blit.
+ argsid = str(id(args))
+ _blit_args[argsid] = args
+
+ try:
+ photoimage.tk.call(_blit_tcl_name, argsid)
+ except tk.TclError as e:
+ if "invalid command name" not in str(e):
+ raise
+ photoimage.tk.createcommand(_blit_tcl_name, _blit)
+ photoimage.tk.call(_blit_tcl_name, argsid)
+
+
+class TimerTk(TimerBase):
+ """Subclass of `backend_bases.TimerBase` using Tk timer events."""
+
+ def __init__(self, parent, *args, **kwargs):
+ self._timer = None
+ super().__init__(*args, **kwargs)
+ self.parent = parent
+
+ def _timer_start(self):
+ self._timer_stop()
+ self._timer = self.parent.after(self._interval, self._on_timer)
+
+ def _timer_stop(self):
+ if self._timer is not None:
+ self.parent.after_cancel(self._timer)
+ self._timer = None
+
+ def _on_timer(self):
+ super()._on_timer()
+ # Tk after() is only a single shot, so we need to add code here to
+ # reset the timer if we're not operating in single shot mode. However,
+ # if _timer is None, this means that _timer_stop has been called; so
+ # don't recreate the timer in that case.
+ if not self._single and self._timer:
+ if self._interval > 0:
+ self._timer = self.parent.after(self._interval, self._on_timer)
+ else:
+ # Edge case: Tcl after 0 *prepends* events to the queue
+ # so a 0 interval does not allow any other events to run.
+ # This incantation is cancellable and runs as fast as possible
+ # while also allowing events and drawing every frame. GH#18236
+ self._timer = self.parent.after_idle(
+ lambda: self.parent.after(self._interval, self._on_timer)
+ )
+ else:
+ self._timer = None
+
+
+class FigureCanvasTk(FigureCanvasBase):
+ required_interactive_framework = "tk"
+ manager_class = _api.classproperty(lambda cls: FigureManagerTk)
+
+ def __init__(self, figure=None, master=None):
+ super().__init__(figure)
+ self._idle_draw_id = None
+ self._event_loop_id = None
+ w, h = self.get_width_height(physical=True)
+ self._tkcanvas = tk.Canvas(
+ master=master, background="white",
+ width=w, height=h, borderwidth=0, highlightthickness=0)
+ self._tkphoto = tk.PhotoImage(
+ master=self._tkcanvas, width=w, height=h)
+ self._tkcanvas_image_region = self._tkcanvas.create_image(
+ w//2, h//2, image=self._tkphoto)
+ self._tkcanvas.bind("", self.resize)
+ self._tkcanvas.bind("", self._update_device_pixel_ratio)
+ self._tkcanvas.bind("", self.key_press)
+ self._tkcanvas.bind("", self.motion_notify_event)
+ self._tkcanvas.bind("", self.enter_notify_event)
+ self._tkcanvas.bind("", self.leave_notify_event)
+ self._tkcanvas.bind("", self.key_release)
+ for name in ["", "", ""]:
+ self._tkcanvas.bind(name, self.button_press_event)
+ for name in [
+ "", "", ""]:
+ self._tkcanvas.bind(name, self.button_dblclick_event)
+ for name in [
+ "", "", ""]:
+ self._tkcanvas.bind(name, self.button_release_event)
+
+ # Mouse wheel on Linux generates button 4/5 events
+ for name in "", "":
+ self._tkcanvas.bind(name, self.scroll_event)
+ # Mouse wheel for windows goes to the window with the focus.
+ # Since the canvas won't usually have the focus, bind the
+ # event to the window containing the canvas instead.
+ # See https://wiki.tcl-lang.org/3893 (mousewheel) for details
+ root = self._tkcanvas.winfo_toplevel()
+
+ # Prevent long-lived references via tkinter callback structure GH-24820
+ weakself = weakref.ref(self)
+ weakroot = weakref.ref(root)
+
+ def scroll_event_windows(event):
+ self = weakself()
+ if self is None:
+ root = weakroot()
+ if root is not None:
+ root.unbind("", scroll_event_windows_id)
+ return
+ return self.scroll_event_windows(event)
+ scroll_event_windows_id = root.bind("", scroll_event_windows, "+")
+
+ # Can't get destroy events by binding to _tkcanvas. Therefore, bind
+ # to the window and filter.
+ def filter_destroy(event):
+ self = weakself()
+ if self is None:
+ root = weakroot()
+ if root is not None:
+ root.unbind("", filter_destroy_id)
+ return
+ if event.widget is self._tkcanvas:
+ CloseEvent("close_event", self)._process()
+ filter_destroy_id = root.bind("", filter_destroy, "+")
+
+ self._tkcanvas.focus_set()
+
+ self._rubberband_rect_black = None
+ self._rubberband_rect_white = None
+
+ def _update_device_pixel_ratio(self, event=None):
+ ratio = None
+ if sys.platform == 'win32':
+ # Tk gives scaling with respect to 72 DPI, but Windows screens are
+ # scaled vs 96 dpi, and pixel ratio settings are given in whole
+ # percentages, so round to 2 digits.
+ ratio = round(self._tkcanvas.tk.call('tk', 'scaling') / (96 / 72), 2)
+ elif sys.platform == "linux":
+ ratio = self._tkcanvas.winfo_fpixels('1i') / 96
+ if ratio is not None and self._set_device_pixel_ratio(ratio):
+ # The easiest way to resize the canvas is to resize the canvas
+ # widget itself, since we implement all the logic for resizing the
+ # canvas backing store on that event.
+ w, h = self.get_width_height(physical=True)
+ self._tkcanvas.configure(width=w, height=h)
+
+ def resize(self, event):
+ width, height = event.width, event.height
+
+ # compute desired figure size in inches
+ dpival = self.figure.dpi
+ winch = width / dpival
+ hinch = height / dpival
+ self.figure.set_size_inches(winch, hinch, forward=False)
+
+ self._tkcanvas.delete(self._tkcanvas_image_region)
+ self._tkphoto.configure(width=int(width), height=int(height))
+ self._tkcanvas_image_region = self._tkcanvas.create_image(
+ int(width / 2), int(height / 2), image=self._tkphoto)
+ ResizeEvent("resize_event", self)._process()
+ self.draw_idle()
+
+ def draw_idle(self):
+ # docstring inherited
+ if self._idle_draw_id:
+ return
+
+ def idle_draw(*args):
+ try:
+ self.draw()
+ finally:
+ self._idle_draw_id = None
+
+ self._idle_draw_id = self._tkcanvas.after_idle(idle_draw)
+
+ def get_tk_widget(self):
+ """
+ Return the Tk widget used to implement FigureCanvasTkAgg.
+
+ Although the initial implementation uses a Tk canvas, this routine
+ is intended to hide that fact.
+ """
+ return self._tkcanvas
+
+ def _event_mpl_coords(self, event):
+ # calling canvasx/canvasy allows taking scrollbars into account (i.e.
+ # the top of the widget may have been scrolled out of view).
+ return (self._tkcanvas.canvasx(event.x),
+ # flipy so y=0 is bottom of canvas
+ self.figure.bbox.height - self._tkcanvas.canvasy(event.y))
+
+ def motion_notify_event(self, event):
+ MouseEvent("motion_notify_event", self,
+ *self._event_mpl_coords(event),
+ buttons=self._mpl_buttons(event),
+ modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ def enter_notify_event(self, event):
+ LocationEvent("figure_enter_event", self,
+ *self._event_mpl_coords(event),
+ modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ def leave_notify_event(self, event):
+ LocationEvent("figure_leave_event", self,
+ *self._event_mpl_coords(event),
+ modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ def button_press_event(self, event, dblclick=False):
+ # set focus to the canvas so that it can receive keyboard events
+ self._tkcanvas.focus_set()
+
+ num = getattr(event, 'num', None)
+ if sys.platform == 'darwin': # 2 and 3 are reversed.
+ num = {2: 3, 3: 2}.get(num, num)
+ MouseEvent("button_press_event", self,
+ *self._event_mpl_coords(event), num, dblclick=dblclick,
+ modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ def button_dblclick_event(self, event):
+ self.button_press_event(event, dblclick=True)
+
+ def button_release_event(self, event):
+ num = getattr(event, 'num', None)
+ if sys.platform == 'darwin': # 2 and 3 are reversed.
+ num = {2: 3, 3: 2}.get(num, num)
+ MouseEvent("button_release_event", self,
+ *self._event_mpl_coords(event), num,
+ modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ def scroll_event(self, event):
+ num = getattr(event, 'num', None)
+ step = 1 if num == 4 else -1 if num == 5 else 0
+ MouseEvent("scroll_event", self,
+ *self._event_mpl_coords(event), step=step,
+ modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ def scroll_event_windows(self, event):
+ """MouseWheel event processor"""
+ # need to find the window that contains the mouse
+ w = event.widget.winfo_containing(event.x_root, event.y_root)
+ if w != self._tkcanvas:
+ return
+ x = self._tkcanvas.canvasx(event.x_root - w.winfo_rootx())
+ y = (self.figure.bbox.height
+ - self._tkcanvas.canvasy(event.y_root - w.winfo_rooty()))
+ step = event.delta / 120
+ MouseEvent("scroll_event", self,
+ x, y, step=step, modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ @staticmethod
+ def _mpl_buttons(event): # See _mpl_modifiers.
+ # NOTE: This fails to report multiclicks on macOS; only one button is
+ # reported (multiclicks work correctly on Linux & Windows).
+ modifiers = [
+ # macOS appears to swap right and middle (look for "Swap buttons
+ # 2/3" in tk/macosx/tkMacOSXMouseEvent.c).
+ (MouseButton.LEFT, 1 << 8),
+ (MouseButton.RIGHT, 1 << 9),
+ (MouseButton.MIDDLE, 1 << 10),
+ (MouseButton.BACK, 1 << 11),
+ (MouseButton.FORWARD, 1 << 12),
+ ] if sys.platform == "darwin" else [
+ (MouseButton.LEFT, 1 << 8),
+ (MouseButton.MIDDLE, 1 << 9),
+ (MouseButton.RIGHT, 1 << 10),
+ (MouseButton.BACK, 1 << 11),
+ (MouseButton.FORWARD, 1 << 12),
+ ]
+ # State *before* press/release.
+ return [name for name, mask in modifiers if event.state & mask]
+
+ @staticmethod
+ def _mpl_modifiers(event, *, exclude=None):
+ # Add modifier keys to the key string. Bit values are inferred from
+ # the implementation of tkinter.Event.__repr__ (1, 2, 4, 8, ... =
+ # Shift, Lock, Control, Mod1, ..., Mod5, Button1, ..., Button5)
+ # In general, the modifier key is excluded from the modifier flag,
+ # however this is not the case on "darwin", so double check that
+ # we aren't adding repeat modifier flags to a modifier key.
+ modifiers = [
+ ("ctrl", 1 << 2, "control"),
+ ("alt", 1 << 17, "alt"),
+ ("shift", 1 << 0, "shift"),
+ ] if sys.platform == "win32" else [
+ ("ctrl", 1 << 2, "control"),
+ ("alt", 1 << 4, "alt"),
+ ("shift", 1 << 0, "shift"),
+ ("cmd", 1 << 3, "cmd"),
+ ] if sys.platform == "darwin" else [
+ ("ctrl", 1 << 2, "control"),
+ ("alt", 1 << 3, "alt"),
+ ("shift", 1 << 0, "shift"),
+ ("super", 1 << 6, "super"),
+ ]
+ return [name for name, mask, key in modifiers
+ if event.state & mask and exclude != key]
+
+ def _get_key(self, event):
+ unikey = event.char
+ key = cbook._unikey_or_keysym_to_mplkey(unikey, event.keysym)
+ if key is not None:
+ mods = self._mpl_modifiers(event, exclude=key)
+ # shift is not added to the keys as this is already accounted for.
+ if "shift" in mods and unikey:
+ mods.remove("shift")
+ return "+".join([*mods, key])
+
+ def key_press(self, event):
+ KeyEvent("key_press_event", self,
+ self._get_key(event), *self._event_mpl_coords(event),
+ guiEvent=event)._process()
+
+ def key_release(self, event):
+ KeyEvent("key_release_event", self,
+ self._get_key(event), *self._event_mpl_coords(event),
+ guiEvent=event)._process()
+
+ def new_timer(self, *args, **kwargs):
+ # docstring inherited
+ return TimerTk(self._tkcanvas, *args, **kwargs)
+
+ def flush_events(self):
+ # docstring inherited
+ self._tkcanvas.update()
+
+ def start_event_loop(self, timeout=0):
+ # docstring inherited
+ if timeout > 0:
+ milliseconds = int(1000 * timeout)
+ if milliseconds > 0:
+ self._event_loop_id = self._tkcanvas.after(
+ milliseconds, self.stop_event_loop)
+ else:
+ self._event_loop_id = self._tkcanvas.after_idle(
+ self.stop_event_loop)
+ self._tkcanvas.mainloop()
+
+ def stop_event_loop(self):
+ # docstring inherited
+ if self._event_loop_id:
+ self._tkcanvas.after_cancel(self._event_loop_id)
+ self._event_loop_id = None
+ self._tkcanvas.quit()
+
+ def set_cursor(self, cursor):
+ try:
+ self._tkcanvas.configure(cursor=cursord[cursor])
+ except tkinter.TclError:
+ pass
+
+
+class FigureManagerTk(FigureManagerBase):
+ """
+ Attributes
+ ----------
+ canvas : `FigureCanvas`
+ The FigureCanvas instance
+ num : int or str
+ The Figure number
+ toolbar : tk.Toolbar
+ The tk.Toolbar
+ window : tk.Window
+ The tk.Window
+ """
+
+ _owns_mainloop = False
+
+ def __init__(self, canvas, num, window):
+ self.window = window
+ super().__init__(canvas, num)
+ self.window.withdraw()
+ # packing toolbar first, because if space is getting low, last packed
+ # widget is getting shrunk first (-> the canvas)
+ self.canvas._tkcanvas.pack(side=tk.TOP, fill=tk.BOTH, expand=1)
+
+ # If the window has per-monitor DPI awareness, then setup a Tk variable
+ # to store the DPI, which will be updated by the C code, and the trace
+ # will handle it on the Python side.
+ window_frame = int(window.wm_frame(), 16)
+ self._window_dpi = tk.IntVar(master=window, value=96,
+ name=f'window_dpi{window_frame}')
+ self._window_dpi_cbname = ''
+ if _tkagg.enable_dpi_awareness(window_frame, window.tk.interpaddr()):
+ self._window_dpi_cbname = self._window_dpi.trace_add(
+ 'write', self._update_window_dpi)
+
+ self._shown = False
+
+ @classmethod
+ def create_with_canvas(cls, canvas_class, figure, num):
+ # docstring inherited
+ with _restore_foreground_window_at_end():
+ if cbook._get_running_interactive_framework() is None:
+ cbook._setup_new_guiapp()
+ _c_internal_utils.Win32_SetProcessDpiAwareness_max()
+ window = tk.Tk(className="matplotlib")
+ window.withdraw()
+
+ # Put a Matplotlib icon on the window rather than the default tk
+ # icon. See https://www.tcl.tk/man/tcl/TkCmd/wm.html#M50
+ #
+ # `ImageTk` can be replaced with `tk` whenever the minimum
+ # supported Tk version is increased to 8.6, as Tk 8.6+ natively
+ # supports PNG images.
+ icon_fname = str(cbook._get_data_path(
+ 'images/matplotlib.png'))
+ icon_img = ImageTk.PhotoImage(file=icon_fname, master=window)
+
+ icon_fname_large = str(cbook._get_data_path(
+ 'images/matplotlib_large.png'))
+ icon_img_large = ImageTk.PhotoImage(
+ file=icon_fname_large, master=window)
+
+ window.iconphoto(False, icon_img_large, icon_img)
+
+ canvas = canvas_class(figure, master=window)
+ manager = cls(canvas, num, window)
+ if mpl.is_interactive():
+ manager.show()
+ canvas.draw_idle()
+ return manager
+
+ @classmethod
+ def start_main_loop(cls):
+ managers = Gcf.get_all_fig_managers()
+ if managers:
+ first_manager = managers[0]
+ manager_class = type(first_manager)
+ if manager_class._owns_mainloop:
+ return
+ manager_class._owns_mainloop = True
+ try:
+ first_manager.window.mainloop()
+ finally:
+ manager_class._owns_mainloop = False
+
+ def _update_window_dpi(self, *args):
+ newdpi = self._window_dpi.get()
+ self.window.call('tk', 'scaling', newdpi / 72)
+ if self.toolbar and hasattr(self.toolbar, '_rescale'):
+ self.toolbar._rescale()
+ self.canvas._update_device_pixel_ratio()
+
+ def resize(self, width, height):
+ max_size = 1_400_000 # the measured max on xorg 1.20.8 was 1_409_023
+
+ if (width > max_size or height > max_size) and sys.platform == 'linux':
+ raise ValueError(
+ 'You have requested to resize the '
+ f'Tk window to ({width}, {height}), one of which '
+ f'is bigger than {max_size}. At larger sizes xorg will '
+ 'either exit with an error on newer versions (~1.20) or '
+ 'cause corruption on older version (~1.19). We '
+ 'do not expect a window over a million pixel wide or tall '
+ 'to be intended behavior.')
+ self.canvas._tkcanvas.configure(width=width, height=height)
+
+ def show(self):
+ with _restore_foreground_window_at_end():
+ if not self._shown:
+ def destroy(*args):
+ Gcf.destroy(self)
+ self.window.protocol("WM_DELETE_WINDOW", destroy)
+ self.window.deiconify()
+ self.canvas._tkcanvas.focus_set()
+ else:
+ self.canvas.draw_idle()
+ if mpl.rcParams['figure.raise_window']:
+ self.canvas.manager.window.attributes('-topmost', 1)
+ self.canvas.manager.window.attributes('-topmost', 0)
+ self._shown = True
+
+ def destroy(self, *args):
+ if self.canvas._idle_draw_id:
+ self.canvas._tkcanvas.after_cancel(self.canvas._idle_draw_id)
+ if self.canvas._event_loop_id:
+ self.canvas._tkcanvas.after_cancel(self.canvas._event_loop_id)
+ if self._window_dpi_cbname:
+ self._window_dpi.trace_remove('write', self._window_dpi_cbname)
+
+ # NOTE: events need to be flushed before issuing destroy (GH #9956),
+ # however, self.window.update() can break user code. An async callback
+ # is the safest way to achieve a complete draining of the event queue,
+ # but it leaks if no tk event loop is running. Therefore we explicitly
+ # check for an event loop and choose our best guess.
+ def delayed_destroy():
+ self.window.destroy()
+
+ if self._owns_mainloop and not Gcf.get_num_fig_managers():
+ self.window.quit()
+
+ if cbook._get_running_interactive_framework() == "tk":
+ # "after idle after 0" avoids Tcl error/race (GH #19940)
+ self.window.after_idle(self.window.after, 0, delayed_destroy)
+ else:
+ self.window.update()
+ delayed_destroy()
+
+ def get_window_title(self):
+ return self.window.wm_title()
+
+ def set_window_title(self, title):
+ self.window.wm_title(title)
+
+ def full_screen_toggle(self):
+ is_fullscreen = bool(self.window.attributes('-fullscreen'))
+ self.window.attributes('-fullscreen', not is_fullscreen)
+
+
+class NavigationToolbar2Tk(NavigationToolbar2, tk.Frame):
+ def __init__(self, canvas, window=None, *, pack_toolbar=True):
+ """
+ Parameters
+ ----------
+ canvas : `FigureCanvas`
+ The figure canvas on which to operate.
+ window : tk.Window
+ The tk.Window which owns this toolbar.
+ pack_toolbar : bool, default: True
+ If True, add the toolbar to the parent's pack manager's packing
+ list during initialization with ``side="bottom"`` and ``fill="x"``.
+ If you want to use the toolbar with a different layout manager, use
+ ``pack_toolbar=False``.
+ """
+
+ if window is None:
+ window = canvas.get_tk_widget().master
+ tk.Frame.__init__(self, master=window, borderwidth=2,
+ width=int(canvas.figure.bbox.width), height=50)
+
+ self._buttons = {}
+ for text, tooltip_text, image_file, callback in self.toolitems:
+ if text is None:
+ # Add a spacer; return value is unused.
+ self._Spacer()
+ else:
+ self._buttons[text] = button = self._Button(
+ text,
+ str(cbook._get_data_path(f"images/{image_file}.png")),
+ toggle=callback in ["zoom", "pan"],
+ command=getattr(self, callback),
+ )
+ if tooltip_text is not None:
+ add_tooltip(button, tooltip_text)
+
+ self._label_font = tkinter.font.Font(root=window, size=10)
+
+ # This filler item ensures the toolbar is always at least two text
+ # lines high. Otherwise the canvas gets redrawn as the mouse hovers
+ # over images because those use two-line messages which resize the
+ # toolbar.
+ label = tk.Label(master=self, font=self._label_font,
+ text='\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE}')
+ label.pack(side=tk.RIGHT)
+
+ self.message = tk.StringVar(master=self)
+ self._message_label = tk.Label(master=self, font=self._label_font,
+ textvariable=self.message,
+ justify=tk.RIGHT)
+ self._message_label.pack(side=tk.RIGHT)
+
+ NavigationToolbar2.__init__(self, canvas)
+ if pack_toolbar:
+ self.pack(side=tk.BOTTOM, fill=tk.X)
+
+ def _rescale(self):
+ """
+ Scale all children of the toolbar to current DPI setting.
+
+ Before this is called, the Tk scaling setting will have been updated to
+ match the new DPI. Tk widgets do not update for changes to scaling, but
+ all measurements made after the change will match the new scaling. Thus
+ this function re-applies all the same sizes in points, which Tk will
+ scale correctly to pixels.
+ """
+ for widget in self.winfo_children():
+ if isinstance(widget, (tk.Button, tk.Checkbutton)):
+ if hasattr(widget, '_image_file'):
+ # Explicit class because ToolbarTk calls _rescale.
+ NavigationToolbar2Tk._set_image_for_button(self, widget)
+ else:
+ # Text-only button is handled by the font setting instead.
+ pass
+ elif isinstance(widget, tk.Frame):
+ widget.configure(height='18p')
+ widget.pack_configure(padx='3p')
+ elif isinstance(widget, tk.Label):
+ pass # Text is handled by the font setting instead.
+ else:
+ _log.warning('Unknown child class %s', widget.winfo_class)
+ self._label_font.configure(size=10)
+
+ def _update_buttons_checked(self):
+ # sync button checkstates to match active mode
+ for text, mode in [('Zoom', _Mode.ZOOM), ('Pan', _Mode.PAN)]:
+ if text in self._buttons:
+ if self.mode == mode:
+ self._buttons[text].select() # NOT .invoke()
+ else:
+ self._buttons[text].deselect()
+
+ def pan(self, *args):
+ super().pan(*args)
+ self._update_buttons_checked()
+
+ def zoom(self, *args):
+ super().zoom(*args)
+ self._update_buttons_checked()
+
+ def set_message(self, s):
+ self.message.set(s)
+
+ def draw_rubberband(self, event, x0, y0, x1, y1):
+ # Block copied from remove_rubberband for backend_tools convenience.
+ if self.canvas._rubberband_rect_white:
+ self.canvas._tkcanvas.delete(self.canvas._rubberband_rect_white)
+ if self.canvas._rubberband_rect_black:
+ self.canvas._tkcanvas.delete(self.canvas._rubberband_rect_black)
+ height = self.canvas.figure.bbox.height
+ y0 = height - y0
+ y1 = height - y1
+ self.canvas._rubberband_rect_black = (
+ self.canvas._tkcanvas.create_rectangle(
+ x0, y0, x1, y1))
+ self.canvas._rubberband_rect_white = (
+ self.canvas._tkcanvas.create_rectangle(
+ x0, y0, x1, y1, outline='white', dash=(3, 3)))
+
+ def remove_rubberband(self):
+ if self.canvas._rubberband_rect_white:
+ self.canvas._tkcanvas.delete(self.canvas._rubberband_rect_white)
+ self.canvas._rubberband_rect_white = None
+ if self.canvas._rubberband_rect_black:
+ self.canvas._tkcanvas.delete(self.canvas._rubberband_rect_black)
+ self.canvas._rubberband_rect_black = None
+
+ def _set_image_for_button(self, button):
+ """
+ Set the image for a button based on its pixel size.
+
+ The pixel size is determined by the DPI scaling of the window.
+ """
+ if button._image_file is None:
+ return
+
+ # Allow _image_file to be relative to Matplotlib's "images" data
+ # directory.
+ path_regular = cbook._get_data_path('images', button._image_file)
+ path_large = path_regular.with_name(
+ path_regular.name.replace('.png', '_large.png'))
+ size = button.winfo_pixels('18p')
+
+ # Nested functions because ToolbarTk calls _Button.
+ def _get_color(color_name):
+ # `winfo_rgb` returns an (r, g, b) tuple in the range 0-65535
+ return button.winfo_rgb(button.cget(color_name))
+
+ def _is_dark(color):
+ if isinstance(color, str):
+ color = _get_color(color)
+ return max(color) < 65535 / 2
+
+ def _recolor_icon(image, color):
+ image_data = np.asarray(image).copy()
+ black_mask = (image_data[..., :3] == 0).all(axis=-1)
+ image_data[black_mask, :3] = color
+ return Image.fromarray(image_data, mode="RGBA")
+
+ # Use the high-resolution (48x48 px) icon if it exists and is needed
+ with Image.open(path_large if (size > 24 and path_large.exists())
+ else path_regular) as im:
+ # assure a RGBA image as foreground color is RGB
+ im = im.convert("RGBA")
+ image = ImageTk.PhotoImage(im.resize((size, size)), master=self)
+ button._ntimage = image
+
+ # create a version of the icon with the button's text color
+ foreground = (255 / 65535) * np.array(
+ button.winfo_rgb(button.cget("foreground")))
+ im_alt = _recolor_icon(im, foreground)
+ image_alt = ImageTk.PhotoImage(
+ im_alt.resize((size, size)), master=self)
+ button._ntimage_alt = image_alt
+
+ if _is_dark("background"):
+ # For Checkbuttons, we need to set `image` and `selectimage` at
+ # the same time. Otherwise, when updating the `image` option
+ # (such as when changing DPI), if the old `selectimage` has
+ # just been overwritten, Tk will throw an error.
+ image_kwargs = {"image": image_alt}
+ else:
+ image_kwargs = {"image": image}
+ # Checkbuttons may switch the background to `selectcolor` in the
+ # checked state, so check separately which image it needs to use in
+ # that state to still ensure enough contrast with the background.
+ if (
+ isinstance(button, tk.Checkbutton)
+ and button.cget("selectcolor") != ""
+ ):
+ if self._windowingsystem != "x11":
+ selectcolor = "selectcolor"
+ else:
+ # On X11, selectcolor isn't used directly for indicator-less
+ # buttons. See `::tk::CheckEnter` in the Tk button.tcl source
+ # code for details.
+ r1, g1, b1 = _get_color("selectcolor")
+ r2, g2, b2 = _get_color("activebackground")
+ selectcolor = ((r1+r2)/2, (g1+g2)/2, (b1+b2)/2)
+ if _is_dark(selectcolor):
+ image_kwargs["selectimage"] = image_alt
+ else:
+ image_kwargs["selectimage"] = image
+
+ button.configure(**image_kwargs, height='18p', width='18p')
+
+ def _Button(self, text, image_file, toggle, command):
+ if not toggle:
+ b = tk.Button(
+ master=self, text=text, command=command,
+ relief="flat", overrelief="groove", borderwidth=1,
+ )
+ else:
+ # There is a bug in tkinter included in some python 3.6 versions
+ # that without this variable, produces a "visual" toggling of
+ # other near checkbuttons
+ # https://bugs.python.org/issue29402
+ # https://bugs.python.org/issue25684
+ var = tk.IntVar(master=self)
+ b = tk.Checkbutton(
+ master=self, text=text, command=command, indicatoron=False,
+ variable=var, offrelief="flat", overrelief="groove",
+ borderwidth=1
+ )
+ b.var = var
+ b._image_file = image_file
+ if image_file is not None:
+ # Explicit class because ToolbarTk calls _Button.
+ NavigationToolbar2Tk._set_image_for_button(self, b)
+ else:
+ b.configure(font=self._label_font)
+ b.pack(side=tk.LEFT)
+ return b
+
+ def _Spacer(self):
+ # Buttons are also 18pt high.
+ s = tk.Frame(master=self, height='18p', relief=tk.RIDGE, bg='DarkGray')
+ s.pack(side=tk.LEFT, padx='3p')
+ return s
+
+ def save_figure(self, *args):
+ filetypes = self.canvas.get_supported_filetypes_grouped()
+ tk_filetypes = [
+ (name, " ".join(f"*.{ext}" for ext in exts))
+ for name, exts in sorted(filetypes.items())
+ ]
+
+ default_extension = self.canvas.get_default_filetype()
+ default_filetype = self.canvas.get_supported_filetypes()[default_extension]
+ filetype_variable = tk.StringVar(self.canvas.get_tk_widget(), default_filetype)
+
+ # adding a default extension seems to break the
+ # asksaveasfilename dialog when you choose various save types
+ # from the dropdown. Passing in the empty string seems to
+ # work - JDH!
+ # defaultextension = self.canvas.get_default_filetype()
+ defaultextension = ''
+ initialdir = os.path.expanduser(mpl.rcParams['savefig.directory'])
+ # get_default_filename() contains the default extension. On some platforms,
+ # choosing a different extension from the dropdown does not overwrite it,
+ # so we need to remove it to make the dropdown functional.
+ initialfile = pathlib.Path(self.canvas.get_default_filename()).stem
+ fname = tkinter.filedialog.asksaveasfilename(
+ master=self.canvas.get_tk_widget().master,
+ title='Save the figure',
+ filetypes=tk_filetypes,
+ defaultextension=defaultextension,
+ initialdir=initialdir,
+ initialfile=initialfile,
+ typevariable=filetype_variable
+ )
+
+ if fname in ["", ()]:
+ return None
+ # Save dir for next time, unless empty str (i.e., use cwd).
+ if initialdir != "":
+ mpl.rcParams['savefig.directory'] = (
+ os.path.dirname(str(fname)))
+
+ # If the filename contains an extension, let savefig() infer the file
+ # format from that. If it does not, use the selected dropdown option.
+ if pathlib.Path(fname).suffix[1:] != "":
+ extension = None
+ else:
+ extension = filetypes[filetype_variable.get()][0]
+
+ try:
+ self.canvas.figure.savefig(fname, format=extension)
+ return fname
+ except Exception as e:
+ tkinter.messagebox.showerror("Error saving file", str(e))
+
+ def set_history_buttons(self):
+ state_map = {True: tk.NORMAL, False: tk.DISABLED}
+ can_back = self._nav_stack._pos > 0
+ can_forward = self._nav_stack._pos < len(self._nav_stack) - 1
+ if "Back" in self._buttons:
+ self._buttons['Back']['state'] = state_map[can_back]
+ if "Forward" in self._buttons:
+ self._buttons['Forward']['state'] = state_map[can_forward]
+
+
+def add_tooltip(widget, text):
+ tipwindow = None
+
+ def showtip(event):
+ """Display text in tooltip window."""
+ nonlocal tipwindow
+ if tipwindow or not text:
+ return
+ x, y, _, _ = widget.bbox("insert")
+ x = x + widget.winfo_rootx() + widget.winfo_width()
+ y = y + widget.winfo_rooty()
+ tipwindow = tk.Toplevel(widget)
+ tipwindow.overrideredirect(1)
+ tipwindow.geometry(f"+{x}+{y}")
+ try: # For Mac OS
+ tipwindow.tk.call("::tk::unsupported::MacWindowStyle",
+ "style", tipwindow._w,
+ "help", "noActivates")
+ except tk.TclError:
+ pass
+ label = tk.Label(tipwindow, text=text, justify=tk.LEFT,
+ relief=tk.SOLID, borderwidth=1)
+ label.pack(ipadx=1)
+
+ def hidetip(event):
+ nonlocal tipwindow
+ if tipwindow:
+ tipwindow.destroy()
+ tipwindow = None
+
+ widget.bind("", showtip)
+ widget.bind("", hidetip)
+
+
+@backend_tools._register_tool_class(FigureCanvasTk)
+class RubberbandTk(backend_tools.RubberbandBase):
+ def draw_rubberband(self, x0, y0, x1, y1):
+ NavigationToolbar2Tk.draw_rubberband(
+ self._make_classic_style_pseudo_toolbar(), None, x0, y0, x1, y1)
+
+ def remove_rubberband(self):
+ NavigationToolbar2Tk.remove_rubberband(
+ self._make_classic_style_pseudo_toolbar())
+
+
+class ToolbarTk(ToolContainerBase, tk.Frame):
+ def __init__(self, toolmanager, window=None):
+ ToolContainerBase.__init__(self, toolmanager)
+ if window is None:
+ window = self.toolmanager.canvas.get_tk_widget().master
+ xmin, xmax = self.toolmanager.canvas.figure.bbox.intervalx
+ height, width = 50, xmax - xmin
+ tk.Frame.__init__(self, master=window,
+ width=int(width), height=int(height),
+ borderwidth=2)
+ self._label_font = tkinter.font.Font(size=10)
+ # This filler item ensures the toolbar is always at least two text
+ # lines high. Otherwise the canvas gets redrawn as the mouse hovers
+ # over images because those use two-line messages which resize the
+ # toolbar.
+ label = tk.Label(master=self, font=self._label_font,
+ text='\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE}')
+ label.pack(side=tk.RIGHT)
+ self._message = tk.StringVar(master=self)
+ self._message_label = tk.Label(master=self, font=self._label_font,
+ textvariable=self._message)
+ self._message_label.pack(side=tk.RIGHT)
+ self._toolitems = {}
+ self.pack(side=tk.TOP, fill=tk.X)
+ self._groups = {}
+
+ def _rescale(self):
+ return NavigationToolbar2Tk._rescale(self)
+
+ def add_toolitem(
+ self, name, group, position, image_file, description, toggle):
+ frame = self._get_groupframe(group)
+ buttons = frame.pack_slaves()
+ if position >= len(buttons) or position < 0:
+ before = None
+ else:
+ before = buttons[position]
+ button = NavigationToolbar2Tk._Button(frame, name, image_file, toggle,
+ lambda: self._button_click(name))
+ button.pack_configure(before=before)
+ if description is not None:
+ add_tooltip(button, description)
+ self._toolitems.setdefault(name, [])
+ self._toolitems[name].append(button)
+
+ def _get_groupframe(self, group):
+ if group not in self._groups:
+ if self._groups:
+ self._add_separator()
+ frame = tk.Frame(master=self, borderwidth=0)
+ frame.pack(side=tk.LEFT, fill=tk.Y)
+ frame._label_font = self._label_font
+ self._groups[group] = frame
+ return self._groups[group]
+
+ def _add_separator(self):
+ return NavigationToolbar2Tk._Spacer(self)
+
+ def _button_click(self, name):
+ self.trigger_tool(name)
+
+ def toggle_toolitem(self, name, toggled):
+ if name not in self._toolitems:
+ return
+ for toolitem in self._toolitems[name]:
+ if toggled:
+ toolitem.select()
+ else:
+ toolitem.deselect()
+
+ def remove_toolitem(self, name):
+ for toolitem in self._toolitems.pop(name, []):
+ toolitem.pack_forget()
+
+ def set_message(self, s):
+ self._message.set(s)
+
+
+@backend_tools._register_tool_class(FigureCanvasTk)
+class SaveFigureTk(backend_tools.SaveFigureBase):
+ def trigger(self, *args):
+ NavigationToolbar2Tk.save_figure(
+ self._make_classic_style_pseudo_toolbar())
+
+
+@backend_tools._register_tool_class(FigureCanvasTk)
+class ConfigureSubplotsTk(backend_tools.ConfigureSubplotsBase):
+ def trigger(self, *args):
+ NavigationToolbar2Tk.configure_subplots(self)
+
+
+@backend_tools._register_tool_class(FigureCanvasTk)
+class HelpTk(backend_tools.ToolHelpBase):
+ def trigger(self, *args):
+ dialog = SimpleDialog(
+ self.figure.canvas._tkcanvas, self._get_help_text(), ["OK"])
+ dialog.done = lambda num: dialog.frame.master.withdraw()
+
+
+Toolbar = ToolbarTk
+FigureManagerTk._toolbar2_class = NavigationToolbar2Tk
+FigureManagerTk._toolmanager_toolbar_class = ToolbarTk
+
+
+@_Backend.export
+class _BackendTk(_Backend):
+ backend_version = tk.TkVersion
+ FigureCanvas = FigureCanvasTk
+ FigureManager = FigureManagerTk
+ mainloop = FigureManagerTk.start_main_loop
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_macosx.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_macosx.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_tkagg.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_tkagg.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..5c3f1112ec7c594b0377a2a89e738770e0737400
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/_tkagg.pyi
@@ -0,0 +1,15 @@
+import numpy as np
+from numpy.typing import NDArray
+
+TK_PHOTO_COMPOSITE_OVERLAY: int
+TK_PHOTO_COMPOSITE_SET: int
+
+def blit(
+ interp: int,
+ photo_name: str,
+ data: NDArray[np.uint8],
+ comp_rule: int,
+ offset: tuple[int, int, int, int],
+ bbox: tuple[int, int, int, int],
+) -> None: ...
+def enable_dpi_awareness(frame_handle: int, interp: int) -> bool | None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py
new file mode 100644
index 0000000000000000000000000000000000000000..c3742736926771328d526e1550a0e9ffefb9183d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py
@@ -0,0 +1,528 @@
+"""
+An `Anti-Grain Geometry`_ (AGG) backend.
+
+Features that are implemented:
+
+* capstyles and join styles
+* dashes
+* linewidth
+* lines, rectangles, ellipses
+* clipping to a rectangle
+* output to RGBA and Pillow-supported image formats
+* alpha blending
+* DPI scaling properly - everything scales properly (dashes, linewidths, etc)
+* draw polygon
+* freetype2 w/ ft2font
+
+Still TODO:
+
+* integrate screen dpi w/ ppi and text
+
+.. _Anti-Grain Geometry: http://agg.sourceforge.net/antigrain.com
+"""
+
+from contextlib import nullcontext
+from math import radians, cos, sin
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cbook
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, RendererBase)
+from matplotlib.font_manager import fontManager as _fontManager, get_font
+from matplotlib.ft2font import LoadFlags
+from matplotlib.mathtext import MathTextParser
+from matplotlib.path import Path
+from matplotlib.transforms import Bbox, BboxBase
+from matplotlib.backends._backend_agg import RendererAgg as _RendererAgg
+
+
+def get_hinting_flag():
+ mapping = {
+ 'default': LoadFlags.DEFAULT,
+ 'no_autohint': LoadFlags.NO_AUTOHINT,
+ 'force_autohint': LoadFlags.FORCE_AUTOHINT,
+ 'no_hinting': LoadFlags.NO_HINTING,
+ True: LoadFlags.FORCE_AUTOHINT,
+ False: LoadFlags.NO_HINTING,
+ 'either': LoadFlags.DEFAULT,
+ 'native': LoadFlags.NO_AUTOHINT,
+ 'auto': LoadFlags.FORCE_AUTOHINT,
+ 'none': LoadFlags.NO_HINTING,
+ }
+ return mapping[mpl.rcParams['text.hinting']]
+
+
+class RendererAgg(RendererBase):
+ """
+ The renderer handles all the drawing primitives using a graphics
+ context instance that controls the colors/styles
+ """
+
+ def __init__(self, width, height, dpi):
+ super().__init__()
+
+ self.dpi = dpi
+ self.width = width
+ self.height = height
+ self._renderer = _RendererAgg(int(width), int(height), dpi)
+ self._filter_renderers = []
+
+ self._update_methods()
+ self.mathtext_parser = MathTextParser('agg')
+
+ self.bbox = Bbox.from_bounds(0, 0, self.width, self.height)
+
+ def __getstate__(self):
+ # We only want to preserve the init keywords of the Renderer.
+ # Anything else can be re-created.
+ return {'width': self.width, 'height': self.height, 'dpi': self.dpi}
+
+ def __setstate__(self, state):
+ self.__init__(state['width'], state['height'], state['dpi'])
+
+ def _update_methods(self):
+ self.draw_gouraud_triangles = self._renderer.draw_gouraud_triangles
+ self.draw_image = self._renderer.draw_image
+ self.draw_markers = self._renderer.draw_markers
+ self.draw_path_collection = self._renderer.draw_path_collection
+ self.draw_quad_mesh = self._renderer.draw_quad_mesh
+ self.copy_from_bbox = self._renderer.copy_from_bbox
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ # docstring inherited
+ nmax = mpl.rcParams['agg.path.chunksize'] # here at least for testing
+ npts = path.vertices.shape[0]
+
+ if (npts > nmax > 100 and path.should_simplify and
+ rgbFace is None and gc.get_hatch() is None):
+ nch = np.ceil(npts / nmax)
+ chsize = int(np.ceil(npts / nch))
+ i0 = np.arange(0, npts, chsize)
+ i1 = np.zeros_like(i0)
+ i1[:-1] = i0[1:] - 1
+ i1[-1] = npts
+ for ii0, ii1 in zip(i0, i1):
+ v = path.vertices[ii0:ii1, :]
+ c = path.codes
+ if c is not None:
+ c = c[ii0:ii1]
+ c[0] = Path.MOVETO # move to end of last chunk
+ p = Path(v, c)
+ p.simplify_threshold = path.simplify_threshold
+ try:
+ self._renderer.draw_path(gc, p, transform, rgbFace)
+ except OverflowError:
+ msg = (
+ "Exceeded cell block limit in Agg.\n\n"
+ "Please reduce the value of "
+ f"rcParams['agg.path.chunksize'] (currently {nmax}) "
+ "or increase the path simplification threshold"
+ "(rcParams['path.simplify_threshold'] = "
+ f"{mpl.rcParams['path.simplify_threshold']:.2f} by "
+ "default and path.simplify_threshold = "
+ f"{path.simplify_threshold:.2f} on the input)."
+ )
+ raise OverflowError(msg) from None
+ else:
+ try:
+ self._renderer.draw_path(gc, path, transform, rgbFace)
+ except OverflowError:
+ cant_chunk = ''
+ if rgbFace is not None:
+ cant_chunk += "- cannot split filled path\n"
+ if gc.get_hatch() is not None:
+ cant_chunk += "- cannot split hatched path\n"
+ if not path.should_simplify:
+ cant_chunk += "- path.should_simplify is False\n"
+ if len(cant_chunk):
+ msg = (
+ "Exceeded cell block limit in Agg, however for the "
+ "following reasons:\n\n"
+ f"{cant_chunk}\n"
+ "we cannot automatically split up this path to draw."
+ "\n\nPlease manually simplify your path."
+ )
+
+ else:
+ inc_threshold = (
+ "or increase the path simplification threshold"
+ "(rcParams['path.simplify_threshold'] = "
+ f"{mpl.rcParams['path.simplify_threshold']} "
+ "by default and path.simplify_threshold "
+ f"= {path.simplify_threshold} "
+ "on the input)."
+ )
+ if nmax > 100:
+ msg = (
+ "Exceeded cell block limit in Agg. Please reduce "
+ "the value of rcParams['agg.path.chunksize'] "
+ f"(currently {nmax}) {inc_threshold}"
+ )
+ else:
+ msg = (
+ "Exceeded cell block limit in Agg. Please set "
+ "the value of rcParams['agg.path.chunksize'], "
+ f"(currently {nmax}) to be greater than 100 "
+ + inc_threshold
+ )
+
+ raise OverflowError(msg) from None
+
+ def draw_mathtext(self, gc, x, y, s, prop, angle):
+ """Draw mathtext using :mod:`matplotlib.mathtext`."""
+ ox, oy, width, height, descent, font_image = \
+ self.mathtext_parser.parse(s, self.dpi, prop,
+ antialiased=gc.get_antialiased())
+
+ xd = descent * sin(radians(angle))
+ yd = descent * cos(radians(angle))
+ x = round(x + ox + xd)
+ y = round(y - oy + yd)
+ self._renderer.draw_text_image(font_image, x, y + 1, angle, gc)
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ # docstring inherited
+ if ismath:
+ return self.draw_mathtext(gc, x, y, s, prop, angle)
+ font = self._prepare_font(prop)
+ # We pass '0' for angle here, since it will be rotated (in raster
+ # space) in the following call to draw_text_image).
+ font.set_text(s, 0, flags=get_hinting_flag())
+ font.draw_glyphs_to_bitmap(
+ antialiased=gc.get_antialiased())
+ d = font.get_descent() / 64.0
+ # The descent needs to be adjusted for the angle.
+ xo, yo = font.get_bitmap_offset()
+ xo /= 64.0
+ yo /= 64.0
+ xd = d * sin(radians(angle))
+ yd = d * cos(radians(angle))
+ x = round(x + xo + xd)
+ y = round(y + yo + yd)
+ self._renderer.draw_text_image(font, x, y + 1, angle, gc)
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ # docstring inherited
+
+ _api.check_in_list(["TeX", True, False], ismath=ismath)
+ if ismath == "TeX":
+ return super().get_text_width_height_descent(s, prop, ismath)
+
+ if ismath:
+ ox, oy, width, height, descent, font_image = \
+ self.mathtext_parser.parse(s, self.dpi, prop)
+ return width, height, descent
+
+ font = self._prepare_font(prop)
+ font.set_text(s, 0.0, flags=get_hinting_flag())
+ w, h = font.get_width_height() # width and height of unrotated string
+ d = font.get_descent()
+ w /= 64.0 # convert from subpixels
+ h /= 64.0
+ d /= 64.0
+ return w, h, d
+
+ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
+ # docstring inherited
+ # todo, handle props, angle, origins
+ size = prop.get_size_in_points()
+
+ texmanager = self.get_texmanager()
+
+ Z = texmanager.get_grey(s, size, self.dpi)
+ Z = np.array(Z * 255.0, np.uint8)
+
+ w, h, d = self.get_text_width_height_descent(s, prop, ismath="TeX")
+ xd = d * sin(radians(angle))
+ yd = d * cos(radians(angle))
+ x = round(x + xd)
+ y = round(y + yd)
+ self._renderer.draw_text_image(Z, x, y, angle, gc)
+
+ def get_canvas_width_height(self):
+ # docstring inherited
+ return self.width, self.height
+
+ def _prepare_font(self, font_prop):
+ """
+ Get the `.FT2Font` for *font_prop*, clear its buffer, and set its size.
+ """
+ font = get_font(_fontManager._find_fonts_by_props(font_prop))
+ font.clear()
+ size = font_prop.get_size_in_points()
+ font.set_size(size, self.dpi)
+ return font
+
+ def points_to_pixels(self, points):
+ # docstring inherited
+ return points * self.dpi / 72
+
+ def buffer_rgba(self):
+ return memoryview(self._renderer)
+
+ def tostring_argb(self):
+ return np.asarray(self._renderer).take([3, 0, 1, 2], axis=2).tobytes()
+
+ def clear(self):
+ self._renderer.clear()
+
+ def option_image_nocomposite(self):
+ # docstring inherited
+
+ # It is generally faster to composite each image directly to
+ # the Figure, and there's no file size benefit to compositing
+ # with the Agg backend
+ return True
+
+ def option_scale_image(self):
+ # docstring inherited
+ return False
+
+ def restore_region(self, region, bbox=None, xy=None):
+ """
+ Restore the saved region. If bbox (instance of BboxBase, or
+ its extents) is given, only the region specified by the bbox
+ will be restored. *xy* (a pair of floats) optionally
+ specifies the new position (the LLC of the original region,
+ not the LLC of the bbox) where the region will be restored.
+
+ >>> region = renderer.copy_from_bbox()
+ >>> x1, y1, x2, y2 = region.get_extents()
+ >>> renderer.restore_region(region, bbox=(x1+dx, y1, x2, y2),
+ ... xy=(x1-dx, y1))
+
+ """
+ if bbox is not None or xy is not None:
+ if bbox is None:
+ x1, y1, x2, y2 = region.get_extents()
+ elif isinstance(bbox, BboxBase):
+ x1, y1, x2, y2 = bbox.extents
+ else:
+ x1, y1, x2, y2 = bbox
+
+ if xy is None:
+ ox, oy = x1, y1
+ else:
+ ox, oy = xy
+
+ # The incoming data is float, but the _renderer type-checking wants
+ # to see integers.
+ self._renderer.restore_region(region, int(x1), int(y1),
+ int(x2), int(y2), int(ox), int(oy))
+
+ else:
+ self._renderer.restore_region(region)
+
+ def start_filter(self):
+ """
+ Start filtering. It simply creates a new canvas (the old one is saved).
+ """
+ self._filter_renderers.append(self._renderer)
+ self._renderer = _RendererAgg(int(self.width), int(self.height),
+ self.dpi)
+ self._update_methods()
+
+ def stop_filter(self, post_processing):
+ """
+ Save the current canvas as an image and apply post processing.
+
+ The *post_processing* function::
+
+ def post_processing(image, dpi):
+ # ny, nx, depth = image.shape
+ # image (numpy array) has RGBA channels and has a depth of 4.
+ ...
+ # create a new_image (numpy array of 4 channels, size can be
+ # different). The resulting image may have offsets from
+ # lower-left corner of the original image
+ return new_image, offset_x, offset_y
+
+ The saved renderer is restored and the returned image from
+ post_processing is plotted (using draw_image) on it.
+ """
+ orig_img = np.asarray(self.buffer_rgba())
+ slice_y, slice_x = cbook._get_nonzero_slices(orig_img[..., 3])
+ cropped_img = orig_img[slice_y, slice_x]
+
+ self._renderer = self._filter_renderers.pop()
+ self._update_methods()
+
+ if cropped_img.size:
+ img, ox, oy = post_processing(cropped_img / 255, self.dpi)
+ gc = self.new_gc()
+ if img.dtype.kind == 'f':
+ img = np.asarray(img * 255., np.uint8)
+ self._renderer.draw_image(
+ gc, slice_x.start + ox, int(self.height) - slice_y.stop + oy,
+ img[::-1])
+
+
+class FigureCanvasAgg(FigureCanvasBase):
+ # docstring inherited
+
+ _lastKey = None # Overwritten per-instance on the first draw.
+
+ def copy_from_bbox(self, bbox):
+ renderer = self.get_renderer()
+ return renderer.copy_from_bbox(bbox)
+
+ def restore_region(self, region, bbox=None, xy=None):
+ renderer = self.get_renderer()
+ return renderer.restore_region(region, bbox, xy)
+
+ def draw(self):
+ # docstring inherited
+ self.renderer = self.get_renderer()
+ self.renderer.clear()
+ # Acquire a lock on the shared font cache.
+ with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
+ else nullcontext()):
+ self.figure.draw(self.renderer)
+ # A GUI class may be need to update a window using this draw, so
+ # don't forget to call the superclass.
+ super().draw()
+
+ def get_renderer(self):
+ w, h = self.figure.bbox.size
+ key = w, h, self.figure.dpi
+ reuse_renderer = (self._lastKey == key)
+ if not reuse_renderer:
+ self.renderer = RendererAgg(w, h, self.figure.dpi)
+ self._lastKey = key
+ return self.renderer
+
+ def tostring_argb(self):
+ """
+ Get the image as ARGB `bytes`.
+
+ `draw` must be called at least once before this function will work and
+ to update the renderer for any subsequent changes to the Figure.
+ """
+ return self.renderer.tostring_argb()
+
+ def buffer_rgba(self):
+ """
+ Get the image as a `memoryview` to the renderer's buffer.
+
+ `draw` must be called at least once before this function will work and
+ to update the renderer for any subsequent changes to the Figure.
+ """
+ return self.renderer.buffer_rgba()
+
+ def print_raw(self, filename_or_obj, *, metadata=None):
+ if metadata is not None:
+ raise ValueError("metadata not supported for raw/rgba")
+ FigureCanvasAgg.draw(self)
+ renderer = self.get_renderer()
+ with cbook.open_file_cm(filename_or_obj, "wb") as fh:
+ fh.write(renderer.buffer_rgba())
+
+ print_rgba = print_raw
+
+ def _print_pil(self, filename_or_obj, fmt, pil_kwargs, metadata=None):
+ """
+ Draw the canvas, then save it using `.image.imsave` (to which
+ *pil_kwargs* and *metadata* are forwarded).
+ """
+ FigureCanvasAgg.draw(self)
+ mpl.image.imsave(
+ filename_or_obj, self.buffer_rgba(), format=fmt, origin="upper",
+ dpi=self.figure.dpi, metadata=metadata, pil_kwargs=pil_kwargs)
+
+ def print_png(self, filename_or_obj, *, metadata=None, pil_kwargs=None):
+ """
+ Write the figure to a PNG file.
+
+ Parameters
+ ----------
+ filename_or_obj : str or path-like or file-like
+ The file to write to.
+
+ metadata : dict, optional
+ Metadata in the PNG file as key-value pairs of bytes or latin-1
+ encodable strings.
+ According to the PNG specification, keys must be shorter than 79
+ chars.
+
+ The `PNG specification`_ defines some common keywords that may be
+ used as appropriate:
+
+ - Title: Short (one line) title or caption for image.
+ - Author: Name of image's creator.
+ - Description: Description of image (possibly long).
+ - Copyright: Copyright notice.
+ - Creation Time: Time of original image creation
+ (usually RFC 1123 format).
+ - Software: Software used to create the image.
+ - Disclaimer: Legal disclaimer.
+ - Warning: Warning of nature of content.
+ - Source: Device used to create the image.
+ - Comment: Miscellaneous comment;
+ conversion from other image format.
+
+ Other keywords may be invented for other purposes.
+
+ If 'Software' is not given, an autogenerated value for Matplotlib
+ will be used. This can be removed by setting it to *None*.
+
+ For more details see the `PNG specification`_.
+
+ .. _PNG specification: \
+ https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords
+
+ pil_kwargs : dict, optional
+ Keyword arguments passed to `PIL.Image.Image.save`.
+
+ If the 'pnginfo' key is present, it completely overrides
+ *metadata*, including the default 'Software' key.
+ """
+ self._print_pil(filename_or_obj, "png", pil_kwargs, metadata)
+
+ def print_to_buffer(self):
+ FigureCanvasAgg.draw(self)
+ renderer = self.get_renderer()
+ return (bytes(renderer.buffer_rgba()),
+ (int(renderer.width), int(renderer.height)))
+
+ # Note that these methods should typically be called via savefig() and
+ # print_figure(), and the latter ensures that `self.figure.dpi` already
+ # matches the dpi kwarg (if any).
+
+ def print_jpg(self, filename_or_obj, *, metadata=None, pil_kwargs=None):
+ # savefig() has already applied savefig.facecolor; we now set it to
+ # white to make imsave() blend semi-transparent figures against an
+ # assumed white background.
+ with mpl.rc_context({"savefig.facecolor": "white"}):
+ self._print_pil(filename_or_obj, "jpeg", pil_kwargs, metadata)
+
+ print_jpeg = print_jpg
+
+ def print_tif(self, filename_or_obj, *, metadata=None, pil_kwargs=None):
+ self._print_pil(filename_or_obj, "tiff", pil_kwargs, metadata)
+
+ print_tiff = print_tif
+
+ def print_webp(self, filename_or_obj, *, metadata=None, pil_kwargs=None):
+ self._print_pil(filename_or_obj, "webp", pil_kwargs, metadata)
+
+ print_jpg.__doc__, print_tif.__doc__, print_webp.__doc__ = map(
+ """
+ Write the figure to a {} file.
+
+ Parameters
+ ----------
+ filename_or_obj : str or path-like or file-like
+ The file to write to.
+ pil_kwargs : dict, optional
+ Additional keyword arguments that are passed to
+ `PIL.Image.Image.save` when saving the figure.
+ """.format, ["JPEG", "TIFF", "WebP"])
+
+
+@_Backend.export
+class _BackendAgg(_Backend):
+ backend_version = 'v2.2'
+ FigureCanvas = FigureCanvasAgg
+ FigureManager = FigureManagerBase
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_cairo.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_cairo.py
new file mode 100644
index 0000000000000000000000000000000000000000..7409cd35b394344314ec14de768f77b80e512e8c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_cairo.py
@@ -0,0 +1,529 @@
+"""
+A Cairo backend for Matplotlib
+==============================
+:Author: Steve Chaplin and others
+
+This backend depends on cairocffi or pycairo.
+"""
+
+import functools
+import gzip
+import math
+
+import numpy as np
+
+try:
+ import cairo
+ if cairo.version_info < (1, 14, 0): # Introduced set_device_scale.
+ raise ImportError(f"Cairo backend requires cairo>=1.14.0, "
+ f"but only {cairo.version_info} is available")
+except ImportError:
+ try:
+ import cairocffi as cairo
+ except ImportError as err:
+ raise ImportError(
+ "cairo backend requires that pycairo>=1.14.0 or cairocffi "
+ "is installed") from err
+
+from .. import _api, cbook, font_manager
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, GraphicsContextBase,
+ RendererBase)
+from matplotlib.font_manager import ttfFontProperty
+from matplotlib.path import Path
+from matplotlib.transforms import Affine2D
+
+
+def _set_rgba(ctx, color, alpha, forced_alpha):
+ if len(color) == 3 or forced_alpha:
+ ctx.set_source_rgba(*color[:3], alpha)
+ else:
+ ctx.set_source_rgba(*color)
+
+
+def _append_path(ctx, path, transform, clip=None):
+ for points, code in path.iter_segments(
+ transform, remove_nans=True, clip=clip):
+ if code == Path.MOVETO:
+ ctx.move_to(*points)
+ elif code == Path.CLOSEPOLY:
+ ctx.close_path()
+ elif code == Path.LINETO:
+ ctx.line_to(*points)
+ elif code == Path.CURVE3:
+ cur = np.asarray(ctx.get_current_point())
+ a = points[:2]
+ b = points[-2:]
+ ctx.curve_to(*(cur / 3 + a * 2 / 3), *(a * 2 / 3 + b / 3), *b)
+ elif code == Path.CURVE4:
+ ctx.curve_to(*points)
+
+
+def _cairo_font_args_from_font_prop(prop):
+ """
+ Convert a `.FontProperties` or a `.FontEntry` to arguments that can be
+ passed to `.Context.select_font_face`.
+ """
+ def attr(field):
+ try:
+ return getattr(prop, f"get_{field}")()
+ except AttributeError:
+ return getattr(prop, field)
+
+ name = attr("name")
+ slant = getattr(cairo, f"FONT_SLANT_{attr('style').upper()}")
+ weight = attr("weight")
+ weight = (cairo.FONT_WEIGHT_NORMAL
+ if font_manager.weight_dict.get(weight, weight) < 550
+ else cairo.FONT_WEIGHT_BOLD)
+ return name, slant, weight
+
+
+class RendererCairo(RendererBase):
+ def __init__(self, dpi):
+ self.dpi = dpi
+ self.gc = GraphicsContextCairo(renderer=self)
+ self.width = None
+ self.height = None
+ self.text_ctx = cairo.Context(
+ cairo.ImageSurface(cairo.FORMAT_ARGB32, 1, 1))
+ super().__init__()
+
+ def set_context(self, ctx):
+ surface = ctx.get_target()
+ if hasattr(surface, "get_width") and hasattr(surface, "get_height"):
+ size = surface.get_width(), surface.get_height()
+ elif hasattr(surface, "get_extents"): # GTK4 RecordingSurface.
+ ext = surface.get_extents()
+ size = ext.width, ext.height
+ else: # vector surfaces.
+ ctx.save()
+ ctx.reset_clip()
+ rect, *rest = ctx.copy_clip_rectangle_list()
+ if rest:
+ raise TypeError("Cannot infer surface size")
+ _, _, *size = rect
+ ctx.restore()
+ self.gc.ctx = ctx
+ self.width, self.height = size
+
+ @staticmethod
+ def _fill_and_stroke(ctx, fill_c, alpha, alpha_overrides):
+ if fill_c is not None:
+ ctx.save()
+ _set_rgba(ctx, fill_c, alpha, alpha_overrides)
+ ctx.fill_preserve()
+ ctx.restore()
+ ctx.stroke()
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ # docstring inherited
+ ctx = gc.ctx
+ # Clip the path to the actual rendering extents if it isn't filled.
+ clip = (ctx.clip_extents()
+ if rgbFace is None and gc.get_hatch() is None
+ else None)
+ transform = (transform
+ + Affine2D().scale(1, -1).translate(0, self.height))
+ ctx.new_path()
+ _append_path(ctx, path, transform, clip)
+ if rgbFace is not None:
+ ctx.save()
+ _set_rgba(ctx, rgbFace, gc.get_alpha(), gc.get_forced_alpha())
+ ctx.fill_preserve()
+ ctx.restore()
+ hatch_path = gc.get_hatch_path()
+ if hatch_path:
+ dpi = int(self.dpi)
+ hatch_surface = ctx.get_target().create_similar(
+ cairo.Content.COLOR_ALPHA, dpi, dpi)
+ hatch_ctx = cairo.Context(hatch_surface)
+ _append_path(hatch_ctx, hatch_path,
+ Affine2D().scale(dpi, -dpi).translate(0, dpi),
+ None)
+ hatch_ctx.set_line_width(self.points_to_pixels(gc.get_hatch_linewidth()))
+ hatch_ctx.set_source_rgba(*gc.get_hatch_color())
+ hatch_ctx.fill_preserve()
+ hatch_ctx.stroke()
+ hatch_pattern = cairo.SurfacePattern(hatch_surface)
+ hatch_pattern.set_extend(cairo.Extend.REPEAT)
+ ctx.save()
+ ctx.set_source(hatch_pattern)
+ ctx.fill_preserve()
+ ctx.restore()
+ ctx.stroke()
+
+ def draw_markers(self, gc, marker_path, marker_trans, path, transform,
+ rgbFace=None):
+ # docstring inherited
+
+ ctx = gc.ctx
+ ctx.new_path()
+ # Create the path for the marker; it needs to be flipped here already!
+ _append_path(ctx, marker_path, marker_trans + Affine2D().scale(1, -1))
+ marker_path = ctx.copy_path_flat()
+
+ # Figure out whether the path has a fill
+ x1, y1, x2, y2 = ctx.fill_extents()
+ if x1 == 0 and y1 == 0 and x2 == 0 and y2 == 0:
+ filled = False
+ # No fill, just unset this (so we don't try to fill it later on)
+ rgbFace = None
+ else:
+ filled = True
+
+ transform = (transform
+ + Affine2D().scale(1, -1).translate(0, self.height))
+
+ ctx.new_path()
+ for i, (vertices, codes) in enumerate(
+ path.iter_segments(transform, simplify=False)):
+ if len(vertices):
+ x, y = vertices[-2:]
+ ctx.save()
+
+ # Translate and apply path
+ ctx.translate(x, y)
+ ctx.append_path(marker_path)
+
+ ctx.restore()
+
+ # Slower code path if there is a fill; we need to draw
+ # the fill and stroke for each marker at the same time.
+ # Also flush out the drawing every once in a while to
+ # prevent the paths from getting way too long.
+ if filled or i % 1000 == 0:
+ self._fill_and_stroke(
+ ctx, rgbFace, gc.get_alpha(), gc.get_forced_alpha())
+
+ # Fast path, if there is no fill, draw everything in one step
+ if not filled:
+ self._fill_and_stroke(
+ ctx, rgbFace, gc.get_alpha(), gc.get_forced_alpha())
+
+ def draw_image(self, gc, x, y, im):
+ im = cbook._unmultiplied_rgba8888_to_premultiplied_argb32(im[::-1])
+ surface = cairo.ImageSurface.create_for_data(
+ im.ravel().data, cairo.FORMAT_ARGB32,
+ im.shape[1], im.shape[0], im.shape[1] * 4)
+ ctx = gc.ctx
+ y = self.height - y - im.shape[0]
+
+ ctx.save()
+ ctx.set_source_surface(surface, float(x), float(y))
+ ctx.paint()
+ ctx.restore()
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ # docstring inherited
+
+ # Note: (x, y) are device/display coords, not user-coords, unlike other
+ # draw_* methods
+ if ismath:
+ self._draw_mathtext(gc, x, y, s, prop, angle)
+
+ else:
+ ctx = gc.ctx
+ ctx.new_path()
+ ctx.move_to(x, y)
+
+ ctx.save()
+ ctx.select_font_face(*_cairo_font_args_from_font_prop(prop))
+ ctx.set_font_size(self.points_to_pixels(prop.get_size_in_points()))
+ opts = cairo.FontOptions()
+ opts.set_antialias(gc.get_antialiased())
+ ctx.set_font_options(opts)
+ if angle:
+ ctx.rotate(np.deg2rad(-angle))
+ ctx.show_text(s)
+ ctx.restore()
+
+ def _draw_mathtext(self, gc, x, y, s, prop, angle):
+ ctx = gc.ctx
+ width, height, descent, glyphs, rects = \
+ self._text2path.mathtext_parser.parse(s, self.dpi, prop)
+
+ ctx.save()
+ ctx.translate(x, y)
+ if angle:
+ ctx.rotate(np.deg2rad(-angle))
+
+ for font, fontsize, idx, ox, oy in glyphs:
+ ctx.new_path()
+ ctx.move_to(ox, -oy)
+ ctx.select_font_face(
+ *_cairo_font_args_from_font_prop(ttfFontProperty(font)))
+ ctx.set_font_size(self.points_to_pixels(fontsize))
+ ctx.show_text(chr(idx))
+
+ for ox, oy, w, h in rects:
+ ctx.new_path()
+ ctx.rectangle(ox, -oy, w, -h)
+ ctx.set_source_rgb(0, 0, 0)
+ ctx.fill_preserve()
+
+ ctx.restore()
+
+ def get_canvas_width_height(self):
+ # docstring inherited
+ return self.width, self.height
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ # docstring inherited
+
+ if ismath == 'TeX':
+ return super().get_text_width_height_descent(s, prop, ismath)
+
+ if ismath:
+ width, height, descent, *_ = \
+ self._text2path.mathtext_parser.parse(s, self.dpi, prop)
+ return width, height, descent
+
+ ctx = self.text_ctx
+ # problem - scale remembers last setting and font can become
+ # enormous causing program to crash
+ # save/restore prevents the problem
+ ctx.save()
+ ctx.select_font_face(*_cairo_font_args_from_font_prop(prop))
+ ctx.set_font_size(self.points_to_pixels(prop.get_size_in_points()))
+
+ y_bearing, w, h = ctx.text_extents(s)[1:4]
+ ctx.restore()
+
+ return w, h, h + y_bearing
+
+ def new_gc(self):
+ # docstring inherited
+ self.gc.ctx.save()
+ # FIXME: The following doesn't properly implement a stack-like behavior
+ # and relies instead on the (non-guaranteed) fact that artists never
+ # rely on nesting gc states, so directly resetting the attributes (IOW
+ # a single-level stack) is enough.
+ self.gc._alpha = 1
+ self.gc._forced_alpha = False # if True, _alpha overrides A from RGBA
+ self.gc._hatch = None
+ return self.gc
+
+ def points_to_pixels(self, points):
+ # docstring inherited
+ return points / 72 * self.dpi
+
+
+class GraphicsContextCairo(GraphicsContextBase):
+ _joind = {
+ 'bevel': cairo.LINE_JOIN_BEVEL,
+ 'miter': cairo.LINE_JOIN_MITER,
+ 'round': cairo.LINE_JOIN_ROUND,
+ }
+
+ _capd = {
+ 'butt': cairo.LINE_CAP_BUTT,
+ 'projecting': cairo.LINE_CAP_SQUARE,
+ 'round': cairo.LINE_CAP_ROUND,
+ }
+
+ def __init__(self, renderer):
+ super().__init__()
+ self.renderer = renderer
+
+ def restore(self):
+ self.ctx.restore()
+
+ def set_alpha(self, alpha):
+ super().set_alpha(alpha)
+ _set_rgba(
+ self.ctx, self._rgb, self.get_alpha(), self.get_forced_alpha())
+
+ def set_antialiased(self, b):
+ self.ctx.set_antialias(
+ cairo.ANTIALIAS_DEFAULT if b else cairo.ANTIALIAS_NONE)
+
+ def get_antialiased(self):
+ return self.ctx.get_antialias()
+
+ def set_capstyle(self, cs):
+ self.ctx.set_line_cap(_api.check_getitem(self._capd, capstyle=cs))
+ self._capstyle = cs
+
+ def set_clip_rectangle(self, rectangle):
+ if not rectangle:
+ return
+ x, y, w, h = np.round(rectangle.bounds)
+ ctx = self.ctx
+ ctx.new_path()
+ ctx.rectangle(x, self.renderer.height - h - y, w, h)
+ ctx.clip()
+
+ def set_clip_path(self, path):
+ if not path:
+ return
+ tpath, affine = path.get_transformed_path_and_affine()
+ ctx = self.ctx
+ ctx.new_path()
+ affine = (affine
+ + Affine2D().scale(1, -1).translate(0, self.renderer.height))
+ _append_path(ctx, tpath, affine)
+ ctx.clip()
+
+ def set_dashes(self, offset, dashes):
+ self._dashes = offset, dashes
+ if dashes is None:
+ self.ctx.set_dash([], 0) # switch dashes off
+ else:
+ self.ctx.set_dash(
+ list(self.renderer.points_to_pixels(np.asarray(dashes))),
+ offset)
+
+ def set_foreground(self, fg, isRGBA=None):
+ super().set_foreground(fg, isRGBA)
+ if len(self._rgb) == 3:
+ self.ctx.set_source_rgb(*self._rgb)
+ else:
+ self.ctx.set_source_rgba(*self._rgb)
+
+ def get_rgb(self):
+ return self.ctx.get_source().get_rgba()[:3]
+
+ def set_joinstyle(self, js):
+ self.ctx.set_line_join(_api.check_getitem(self._joind, joinstyle=js))
+ self._joinstyle = js
+
+ def set_linewidth(self, w):
+ self._linewidth = float(w)
+ self.ctx.set_line_width(self.renderer.points_to_pixels(w))
+
+
+class _CairoRegion:
+ def __init__(self, slices, data):
+ self._slices = slices
+ self._data = data
+
+
+class FigureCanvasCairo(FigureCanvasBase):
+ @property
+ def _renderer(self):
+ # In theory, _renderer should be set in __init__, but GUI canvas
+ # subclasses (FigureCanvasFooCairo) don't always interact well with
+ # multiple inheritance (FigureCanvasFoo inits but doesn't super-init
+ # FigureCanvasCairo), so initialize it in the getter instead.
+ if not hasattr(self, "_cached_renderer"):
+ self._cached_renderer = RendererCairo(self.figure.dpi)
+ return self._cached_renderer
+
+ def get_renderer(self):
+ return self._renderer
+
+ def copy_from_bbox(self, bbox):
+ surface = self._renderer.gc.ctx.get_target()
+ if not isinstance(surface, cairo.ImageSurface):
+ raise RuntimeError(
+ "copy_from_bbox only works when rendering to an ImageSurface")
+ sw = surface.get_width()
+ sh = surface.get_height()
+ x0 = math.ceil(bbox.x0)
+ x1 = math.floor(bbox.x1)
+ y0 = math.ceil(sh - bbox.y1)
+ y1 = math.floor(sh - bbox.y0)
+ if not (0 <= x0 and x1 <= sw and bbox.x0 <= bbox.x1
+ and 0 <= y0 and y1 <= sh and bbox.y0 <= bbox.y1):
+ raise ValueError("Invalid bbox")
+ sls = slice(y0, y0 + max(y1 - y0, 0)), slice(x0, x0 + max(x1 - x0, 0))
+ data = (np.frombuffer(surface.get_data(), np.uint32)
+ .reshape((sh, sw))[sls].copy())
+ return _CairoRegion(sls, data)
+
+ def restore_region(self, region):
+ surface = self._renderer.gc.ctx.get_target()
+ if not isinstance(surface, cairo.ImageSurface):
+ raise RuntimeError(
+ "restore_region only works when rendering to an ImageSurface")
+ surface.flush()
+ sw = surface.get_width()
+ sh = surface.get_height()
+ sly, slx = region._slices
+ (np.frombuffer(surface.get_data(), np.uint32)
+ .reshape((sh, sw))[sly, slx]) = region._data
+ surface.mark_dirty_rectangle(
+ slx.start, sly.start, slx.stop - slx.start, sly.stop - sly.start)
+
+ def print_png(self, fobj):
+ self._get_printed_image_surface().write_to_png(fobj)
+
+ def print_rgba(self, fobj):
+ width, height = self.get_width_height()
+ buf = self._get_printed_image_surface().get_data()
+ fobj.write(cbook._premultiplied_argb32_to_unmultiplied_rgba8888(
+ np.asarray(buf).reshape((width, height, 4))))
+
+ print_raw = print_rgba
+
+ def _get_printed_image_surface(self):
+ self._renderer.dpi = self.figure.dpi
+ width, height = self.get_width_height()
+ surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
+ self._renderer.set_context(cairo.Context(surface))
+ self.figure.draw(self._renderer)
+ return surface
+
+ def _save(self, fmt, fobj, *, orientation='portrait'):
+ # save PDF/PS/SVG
+
+ dpi = 72
+ self.figure.dpi = dpi
+ w_in, h_in = self.figure.get_size_inches()
+ width_in_points, height_in_points = w_in * dpi, h_in * dpi
+
+ if orientation == 'landscape':
+ width_in_points, height_in_points = (
+ height_in_points, width_in_points)
+
+ if fmt == 'ps':
+ if not hasattr(cairo, 'PSSurface'):
+ raise RuntimeError('cairo has not been compiled with PS '
+ 'support enabled')
+ surface = cairo.PSSurface(fobj, width_in_points, height_in_points)
+ elif fmt == 'pdf':
+ if not hasattr(cairo, 'PDFSurface'):
+ raise RuntimeError('cairo has not been compiled with PDF '
+ 'support enabled')
+ surface = cairo.PDFSurface(fobj, width_in_points, height_in_points)
+ elif fmt in ('svg', 'svgz'):
+ if not hasattr(cairo, 'SVGSurface'):
+ raise RuntimeError('cairo has not been compiled with SVG '
+ 'support enabled')
+ if fmt == 'svgz':
+ if isinstance(fobj, str):
+ fobj = gzip.GzipFile(fobj, 'wb')
+ else:
+ fobj = gzip.GzipFile(None, 'wb', fileobj=fobj)
+ surface = cairo.SVGSurface(fobj, width_in_points, height_in_points)
+ else:
+ raise ValueError(f"Unknown format: {fmt!r}")
+
+ self._renderer.dpi = self.figure.dpi
+ self._renderer.set_context(cairo.Context(surface))
+ ctx = self._renderer.gc.ctx
+
+ if orientation == 'landscape':
+ ctx.rotate(np.pi / 2)
+ ctx.translate(0, -height_in_points)
+ # Perhaps add an '%%Orientation: Landscape' comment?
+
+ self.figure.draw(self._renderer)
+
+ ctx.show_page()
+ surface.finish()
+ if fmt == 'svgz':
+ fobj.close()
+
+ print_pdf = functools.partialmethod(_save, "pdf")
+ print_ps = functools.partialmethod(_save, "ps")
+ print_svg = functools.partialmethod(_save, "svg")
+ print_svgz = functools.partialmethod(_save, "svgz")
+
+
+@_Backend.export
+class _BackendCairo(_Backend):
+ backend_version = cairo.version
+ FigureCanvas = FigureCanvasCairo
+ FigureManager = FigureManagerBase
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3.py
new file mode 100644
index 0000000000000000000000000000000000000000..888f5a770f5d196d36a5a2446ef78a670aa230db
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3.py
@@ -0,0 +1,596 @@
+import functools
+import logging
+import os
+from pathlib import Path
+
+import matplotlib as mpl
+from matplotlib import _api, backend_tools, cbook
+from matplotlib.backend_bases import (
+ ToolContainerBase, MouseButton,
+ CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent)
+
+try:
+ import gi
+except ImportError as err:
+ raise ImportError("The GTK3 backends require PyGObject") from err
+
+try:
+ # :raises ValueError: If module/version is already loaded, already
+ # required, or unavailable.
+ gi.require_version("Gtk", "3.0")
+except ValueError as e:
+ # in this case we want to re-raise as ImportError so the
+ # auto-backend selection logic correctly skips.
+ raise ImportError(e) from e
+
+from gi.repository import Gio, GLib, GObject, Gtk, Gdk
+from . import _backend_gtk
+from ._backend_gtk import ( # noqa: F401 # pylint: disable=W0611
+ _BackendGTK, _FigureCanvasGTK, _FigureManagerGTK, _NavigationToolbar2GTK,
+ TimerGTK as TimerGTK3,
+)
+
+
+_log = logging.getLogger(__name__)
+
+
+@functools.cache
+def _mpl_to_gtk_cursor(mpl_cursor):
+ return Gdk.Cursor.new_from_name(
+ Gdk.Display.get_default(),
+ _backend_gtk.mpl_to_gtk_cursor_name(mpl_cursor))
+
+
+class FigureCanvasGTK3(_FigureCanvasGTK, Gtk.DrawingArea):
+ required_interactive_framework = "gtk3"
+ manager_class = _api.classproperty(lambda cls: FigureManagerGTK3)
+ # Setting this as a static constant prevents
+ # this resulting expression from leaking
+ event_mask = (Gdk.EventMask.BUTTON_PRESS_MASK
+ | Gdk.EventMask.BUTTON_RELEASE_MASK
+ | Gdk.EventMask.EXPOSURE_MASK
+ | Gdk.EventMask.KEY_PRESS_MASK
+ | Gdk.EventMask.KEY_RELEASE_MASK
+ | Gdk.EventMask.ENTER_NOTIFY_MASK
+ | Gdk.EventMask.LEAVE_NOTIFY_MASK
+ | Gdk.EventMask.POINTER_MOTION_MASK
+ | Gdk.EventMask.SCROLL_MASK)
+
+ def __init__(self, figure=None):
+ super().__init__(figure=figure)
+
+ self._idle_draw_id = 0
+ self._rubberband_rect = None
+
+ self.connect('scroll_event', self.scroll_event)
+ self.connect('button_press_event', self.button_press_event)
+ self.connect('button_release_event', self.button_release_event)
+ self.connect('configure_event', self.configure_event)
+ self.connect('screen-changed', self._update_device_pixel_ratio)
+ self.connect('notify::scale-factor', self._update_device_pixel_ratio)
+ self.connect('draw', self.on_draw_event)
+ self.connect('draw', self._post_draw)
+ self.connect('key_press_event', self.key_press_event)
+ self.connect('key_release_event', self.key_release_event)
+ self.connect('motion_notify_event', self.motion_notify_event)
+ self.connect('enter_notify_event', self.enter_notify_event)
+ self.connect('leave_notify_event', self.leave_notify_event)
+ self.connect('size_allocate', self.size_allocate)
+
+ self.set_events(self.__class__.event_mask)
+
+ self.set_can_focus(True)
+
+ css = Gtk.CssProvider()
+ css.load_from_data(b".matplotlib-canvas { background-color: white; }")
+ style_ctx = self.get_style_context()
+ style_ctx.add_provider(css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
+ style_ctx.add_class("matplotlib-canvas")
+
+ def destroy(self):
+ CloseEvent("close_event", self)._process()
+
+ def set_cursor(self, cursor):
+ # docstring inherited
+ window = self.get_property("window")
+ if window is not None:
+ window.set_cursor(_mpl_to_gtk_cursor(cursor))
+ context = GLib.MainContext.default()
+ context.iteration(True)
+
+ def _mpl_coords(self, event=None):
+ """
+ Convert the position of a GTK event, or of the current cursor position
+ if *event* is None, to Matplotlib coordinates.
+
+ GTK use logical pixels, but the figure is scaled to physical pixels for
+ rendering. Transform to physical pixels so that all of the down-stream
+ transforms work as expected.
+
+ Also, the origin is different and needs to be corrected.
+ """
+ if event is None:
+ window = self.get_window()
+ t, x, y, state = window.get_device_position(
+ window.get_display().get_device_manager().get_client_pointer())
+ else:
+ x, y = event.x, event.y
+ x = x * self.device_pixel_ratio
+ # flip y so y=0 is bottom of canvas
+ y = self.figure.bbox.height - y * self.device_pixel_ratio
+ return x, y
+
+ def scroll_event(self, widget, event):
+ step = 1 if event.direction == Gdk.ScrollDirection.UP else -1
+ MouseEvent("scroll_event", self,
+ *self._mpl_coords(event), step=step,
+ modifiers=self._mpl_modifiers(event.state),
+ guiEvent=event)._process()
+ return False # finish event propagation?
+
+ def button_press_event(self, widget, event):
+ MouseEvent("button_press_event", self,
+ *self._mpl_coords(event), event.button,
+ modifiers=self._mpl_modifiers(event.state),
+ guiEvent=event)._process()
+ return False # finish event propagation?
+
+ def button_release_event(self, widget, event):
+ MouseEvent("button_release_event", self,
+ *self._mpl_coords(event), event.button,
+ modifiers=self._mpl_modifiers(event.state),
+ guiEvent=event)._process()
+ return False # finish event propagation?
+
+ def key_press_event(self, widget, event):
+ KeyEvent("key_press_event", self,
+ self._get_key(event), *self._mpl_coords(),
+ guiEvent=event)._process()
+ return True # stop event propagation
+
+ def key_release_event(self, widget, event):
+ KeyEvent("key_release_event", self,
+ self._get_key(event), *self._mpl_coords(),
+ guiEvent=event)._process()
+ return True # stop event propagation
+
+ def motion_notify_event(self, widget, event):
+ MouseEvent("motion_notify_event", self, *self._mpl_coords(event),
+ buttons=self._mpl_buttons(event.state),
+ modifiers=self._mpl_modifiers(event.state),
+ guiEvent=event)._process()
+ return False # finish event propagation?
+
+ def enter_notify_event(self, widget, event):
+ gtk_mods = Gdk.Keymap.get_for_display(
+ self.get_display()).get_modifier_state()
+ LocationEvent("figure_enter_event", self, *self._mpl_coords(event),
+ modifiers=self._mpl_modifiers(gtk_mods),
+ guiEvent=event)._process()
+
+ def leave_notify_event(self, widget, event):
+ gtk_mods = Gdk.Keymap.get_for_display(
+ self.get_display()).get_modifier_state()
+ LocationEvent("figure_leave_event", self, *self._mpl_coords(event),
+ modifiers=self._mpl_modifiers(gtk_mods),
+ guiEvent=event)._process()
+
+ def size_allocate(self, widget, allocation):
+ dpival = self.figure.dpi
+ winch = allocation.width * self.device_pixel_ratio / dpival
+ hinch = allocation.height * self.device_pixel_ratio / dpival
+ self.figure.set_size_inches(winch, hinch, forward=False)
+ ResizeEvent("resize_event", self)._process()
+ self.draw_idle()
+
+ @staticmethod
+ def _mpl_buttons(event_state):
+ modifiers = [
+ (MouseButton.LEFT, Gdk.ModifierType.BUTTON1_MASK),
+ (MouseButton.MIDDLE, Gdk.ModifierType.BUTTON2_MASK),
+ (MouseButton.RIGHT, Gdk.ModifierType.BUTTON3_MASK),
+ (MouseButton.BACK, Gdk.ModifierType.BUTTON4_MASK),
+ (MouseButton.FORWARD, Gdk.ModifierType.BUTTON5_MASK),
+ ]
+ # State *before* press/release.
+ return [name for name, mask in modifiers if event_state & mask]
+
+ @staticmethod
+ def _mpl_modifiers(event_state, *, exclude=None):
+ modifiers = [
+ ("ctrl", Gdk.ModifierType.CONTROL_MASK, "control"),
+ ("alt", Gdk.ModifierType.MOD1_MASK, "alt"),
+ ("shift", Gdk.ModifierType.SHIFT_MASK, "shift"),
+ ("super", Gdk.ModifierType.MOD4_MASK, "super"),
+ ]
+ return [name for name, mask, key in modifiers
+ if exclude != key and event_state & mask]
+
+ def _get_key(self, event):
+ unikey = chr(Gdk.keyval_to_unicode(event.keyval))
+ key = cbook._unikey_or_keysym_to_mplkey(
+ unikey, Gdk.keyval_name(event.keyval))
+ mods = self._mpl_modifiers(event.state, exclude=key)
+ if "shift" in mods and unikey.isprintable():
+ mods.remove("shift")
+ return "+".join([*mods, key])
+
+ def _update_device_pixel_ratio(self, *args, **kwargs):
+ # We need to be careful in cases with mixed resolution displays if
+ # device_pixel_ratio changes.
+ if self._set_device_pixel_ratio(self.get_scale_factor()):
+ # The easiest way to resize the canvas is to emit a resize event
+ # since we implement all the logic for resizing the canvas for that
+ # event.
+ self.queue_resize()
+ self.queue_draw()
+
+ def configure_event(self, widget, event):
+ if widget.get_property("window") is None:
+ return
+ w = event.width * self.device_pixel_ratio
+ h = event.height * self.device_pixel_ratio
+ if w < 3 or h < 3:
+ return # empty fig
+ # resize the figure (in inches)
+ dpi = self.figure.dpi
+ self.figure.set_size_inches(w / dpi, h / dpi, forward=False)
+ return False # finish event propagation?
+
+ def _draw_rubberband(self, rect):
+ self._rubberband_rect = rect
+ # TODO: Only update the rubberband area.
+ self.queue_draw()
+
+ def _post_draw(self, widget, ctx):
+ if self._rubberband_rect is None:
+ return
+
+ x0, y0, w, h = (dim / self.device_pixel_ratio
+ for dim in self._rubberband_rect)
+ x1 = x0 + w
+ y1 = y0 + h
+
+ # Draw the lines from x0, y0 towards x1, y1 so that the
+ # dashes don't "jump" when moving the zoom box.
+ ctx.move_to(x0, y0)
+ ctx.line_to(x0, y1)
+ ctx.move_to(x0, y0)
+ ctx.line_to(x1, y0)
+ ctx.move_to(x0, y1)
+ ctx.line_to(x1, y1)
+ ctx.move_to(x1, y0)
+ ctx.line_to(x1, y1)
+
+ ctx.set_antialias(1)
+ ctx.set_line_width(1)
+ ctx.set_dash((3, 3), 0)
+ ctx.set_source_rgb(0, 0, 0)
+ ctx.stroke_preserve()
+
+ ctx.set_dash((3, 3), 3)
+ ctx.set_source_rgb(1, 1, 1)
+ ctx.stroke()
+
+ def on_draw_event(self, widget, ctx):
+ # to be overwritten by GTK3Agg or GTK3Cairo
+ pass
+
+ def draw(self):
+ # docstring inherited
+ if self.is_drawable():
+ self.queue_draw()
+
+ def draw_idle(self):
+ # docstring inherited
+ if self._idle_draw_id != 0:
+ return
+ def idle_draw(*args):
+ try:
+ self.draw()
+ finally:
+ self._idle_draw_id = 0
+ return False
+ self._idle_draw_id = GLib.idle_add(idle_draw)
+
+ def flush_events(self):
+ # docstring inherited
+ context = GLib.MainContext.default()
+ while context.pending():
+ context.iteration(True)
+
+
+class NavigationToolbar2GTK3(_NavigationToolbar2GTK, Gtk.Toolbar):
+ def __init__(self, canvas):
+ GObject.GObject.__init__(self)
+
+ self.set_style(Gtk.ToolbarStyle.ICONS)
+
+ self._gtk_ids = {}
+ for text, tooltip_text, image_file, callback in self.toolitems:
+ if text is None:
+ self.insert(Gtk.SeparatorToolItem(), -1)
+ continue
+ image = Gtk.Image.new_from_gicon(
+ Gio.Icon.new_for_string(
+ str(cbook._get_data_path('images',
+ f'{image_file}-symbolic.svg'))),
+ Gtk.IconSize.LARGE_TOOLBAR)
+ self._gtk_ids[text] = button = (
+ Gtk.ToggleToolButton() if callback in ['zoom', 'pan'] else
+ Gtk.ToolButton())
+ button.set_label(text)
+ button.set_icon_widget(image)
+ # Save the handler id, so that we can block it as needed.
+ button._signal_handler = button.connect(
+ 'clicked', getattr(self, callback))
+ button.set_tooltip_text(tooltip_text)
+ self.insert(button, -1)
+
+ # This filler item ensures the toolbar is always at least two text
+ # lines high. Otherwise the canvas gets redrawn as the mouse hovers
+ # over images because those use two-line messages which resize the
+ # toolbar.
+ toolitem = Gtk.ToolItem()
+ self.insert(toolitem, -1)
+ label = Gtk.Label()
+ label.set_markup(
+ '\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE} ')
+ toolitem.set_expand(True) # Push real message to the right.
+ toolitem.add(label)
+
+ toolitem = Gtk.ToolItem()
+ self.insert(toolitem, -1)
+ self.message = Gtk.Label()
+ self.message.set_justify(Gtk.Justification.RIGHT)
+ toolitem.add(self.message)
+
+ self.show_all()
+
+ _NavigationToolbar2GTK.__init__(self, canvas)
+
+ def save_figure(self, *args):
+ dialog = Gtk.FileChooserDialog(
+ title="Save the figure",
+ transient_for=self.canvas.get_toplevel(),
+ action=Gtk.FileChooserAction.SAVE,
+ buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
+ Gtk.STOCK_SAVE, Gtk.ResponseType.OK),
+ )
+ for name, fmts \
+ in self.canvas.get_supported_filetypes_grouped().items():
+ ff = Gtk.FileFilter()
+ ff.set_name(name)
+ for fmt in fmts:
+ ff.add_pattern(f'*.{fmt}')
+ dialog.add_filter(ff)
+ if self.canvas.get_default_filetype() in fmts:
+ dialog.set_filter(ff)
+
+ @functools.partial(dialog.connect, "notify::filter")
+ def on_notify_filter(*args):
+ name = dialog.get_filter().get_name()
+ fmt = self.canvas.get_supported_filetypes_grouped()[name][0]
+ dialog.set_current_name(
+ str(Path(dialog.get_current_name()).with_suffix(f'.{fmt}')))
+
+ dialog.set_current_folder(mpl.rcParams["savefig.directory"])
+ dialog.set_current_name(self.canvas.get_default_filename())
+ dialog.set_do_overwrite_confirmation(True)
+
+ response = dialog.run()
+ fname = dialog.get_filename()
+ ff = dialog.get_filter() # Doesn't autoadjust to filename :/
+ fmt = self.canvas.get_supported_filetypes_grouped()[ff.get_name()][0]
+ dialog.destroy()
+ if response != Gtk.ResponseType.OK:
+ return None
+ # Save dir for next time, unless empty str (which means use cwd).
+ if mpl.rcParams['savefig.directory']:
+ mpl.rcParams['savefig.directory'] = os.path.dirname(fname)
+ try:
+ self.canvas.figure.savefig(fname, format=fmt)
+ return fname
+ except Exception as e:
+ dialog = Gtk.MessageDialog(
+ transient_for=self.canvas.get_toplevel(), text=str(e),
+ message_type=Gtk.MessageType.ERROR, buttons=Gtk.ButtonsType.OK)
+ dialog.run()
+ dialog.destroy()
+
+
+class ToolbarGTK3(ToolContainerBase, Gtk.Box):
+ _icon_extension = '-symbolic.svg'
+
+ def __init__(self, toolmanager):
+ ToolContainerBase.__init__(self, toolmanager)
+ Gtk.Box.__init__(self)
+ self.set_property('orientation', Gtk.Orientation.HORIZONTAL)
+ self._message = Gtk.Label()
+ self._message.set_justify(Gtk.Justification.RIGHT)
+ self.pack_end(self._message, False, False, 0)
+ self.show_all()
+ self._groups = {}
+ self._toolitems = {}
+
+ def add_toolitem(self, name, group, position, image_file, description,
+ toggle):
+ if toggle:
+ button = Gtk.ToggleToolButton()
+ else:
+ button = Gtk.ToolButton()
+ button.set_label(name)
+
+ if image_file is not None:
+ image = Gtk.Image.new_from_gicon(
+ Gio.Icon.new_for_string(image_file),
+ Gtk.IconSize.LARGE_TOOLBAR)
+ button.set_icon_widget(image)
+
+ if position is None:
+ position = -1
+
+ self._add_button(button, group, position)
+ signal = button.connect('clicked', self._call_tool, name)
+ button.set_tooltip_text(description)
+ button.show_all()
+ self._toolitems.setdefault(name, [])
+ self._toolitems[name].append((button, signal))
+
+ def _add_button(self, button, group, position):
+ if group not in self._groups:
+ if self._groups:
+ self._add_separator()
+ toolbar = Gtk.Toolbar()
+ toolbar.set_style(Gtk.ToolbarStyle.ICONS)
+ self.pack_start(toolbar, False, False, 0)
+ toolbar.show_all()
+ self._groups[group] = toolbar
+ self._groups[group].insert(button, position)
+
+ def _call_tool(self, btn, name):
+ self.trigger_tool(name)
+
+ def toggle_toolitem(self, name, toggled):
+ if name not in self._toolitems:
+ return
+ for toolitem, signal in self._toolitems[name]:
+ toolitem.handler_block(signal)
+ toolitem.set_active(toggled)
+ toolitem.handler_unblock(signal)
+
+ def remove_toolitem(self, name):
+ for toolitem, _signal in self._toolitems.pop(name, []):
+ for group in self._groups:
+ if toolitem in self._groups[group]:
+ self._groups[group].remove(toolitem)
+
+ def _add_separator(self):
+ sep = Gtk.Separator()
+ sep.set_property("orientation", Gtk.Orientation.VERTICAL)
+ self.pack_start(sep, False, True, 0)
+ sep.show_all()
+
+ def set_message(self, s):
+ self._message.set_label(s)
+
+
+@backend_tools._register_tool_class(FigureCanvasGTK3)
+class SaveFigureGTK3(backend_tools.SaveFigureBase):
+ def trigger(self, *args, **kwargs):
+ NavigationToolbar2GTK3.save_figure(
+ self._make_classic_style_pseudo_toolbar())
+
+
+@backend_tools._register_tool_class(FigureCanvasGTK3)
+class HelpGTK3(backend_tools.ToolHelpBase):
+ def _normalize_shortcut(self, key):
+ """
+ Convert Matplotlib key presses to GTK+ accelerator identifiers.
+
+ Related to `FigureCanvasGTK3._get_key`.
+ """
+ special = {
+ 'backspace': 'BackSpace',
+ 'pagedown': 'Page_Down',
+ 'pageup': 'Page_Up',
+ 'scroll_lock': 'Scroll_Lock',
+ }
+
+ parts = key.split('+')
+ mods = ['<' + mod + '>' for mod in parts[:-1]]
+ key = parts[-1]
+
+ if key in special:
+ key = special[key]
+ elif len(key) > 1:
+ key = key.capitalize()
+ elif key.isupper():
+ mods += ['']
+
+ return ''.join(mods) + key
+
+ def _is_valid_shortcut(self, key):
+ """
+ Check for a valid shortcut to be displayed.
+
+ - GTK will never send 'cmd+' (see `FigureCanvasGTK3._get_key`).
+ - The shortcut window only shows keyboard shortcuts, not mouse buttons.
+ """
+ return 'cmd+' not in key and not key.startswith('MouseButton.')
+
+ def _show_shortcuts_window(self):
+ section = Gtk.ShortcutsSection()
+
+ for name, tool in sorted(self.toolmanager.tools.items()):
+ if not tool.description:
+ continue
+
+ # Putting everything in a separate group allows GTK to
+ # automatically split them into separate columns/pages, which is
+ # useful because we have lots of shortcuts, some with many keys
+ # that are very wide.
+ group = Gtk.ShortcutsGroup()
+ section.add(group)
+ # A hack to remove the title since we have no group naming.
+ group.forall(lambda widget, data: widget.set_visible(False), None)
+
+ shortcut = Gtk.ShortcutsShortcut(
+ accelerator=' '.join(
+ self._normalize_shortcut(key)
+ for key in self.toolmanager.get_tool_keymap(name)
+ if self._is_valid_shortcut(key)),
+ title=tool.name,
+ subtitle=tool.description)
+ group.add(shortcut)
+
+ window = Gtk.ShortcutsWindow(
+ title='Help',
+ modal=True,
+ transient_for=self._figure.canvas.get_toplevel())
+ section.show() # Must be done explicitly before add!
+ window.add(section)
+
+ window.show_all()
+
+ def _show_shortcuts_dialog(self):
+ dialog = Gtk.MessageDialog(
+ self._figure.canvas.get_toplevel(),
+ 0, Gtk.MessageType.INFO, Gtk.ButtonsType.OK, self._get_help_text(),
+ title="Help")
+ dialog.run()
+ dialog.destroy()
+
+ def trigger(self, *args):
+ if Gtk.check_version(3, 20, 0) is None:
+ self._show_shortcuts_window()
+ else:
+ self._show_shortcuts_dialog()
+
+
+@backend_tools._register_tool_class(FigureCanvasGTK3)
+class ToolCopyToClipboardGTK3(backend_tools.ToolCopyToClipboardBase):
+ def trigger(self, *args, **kwargs):
+ clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
+ window = self.canvas.get_window()
+ x, y, width, height = window.get_geometry()
+ pb = Gdk.pixbuf_get_from_window(window, x, y, width, height)
+ clipboard.set_image(pb)
+
+
+Toolbar = ToolbarGTK3
+backend_tools._register_tool_class(
+ FigureCanvasGTK3, _backend_gtk.ConfigureSubplotsGTK)
+backend_tools._register_tool_class(
+ FigureCanvasGTK3, _backend_gtk.RubberbandGTK)
+
+
+class FigureManagerGTK3(_FigureManagerGTK):
+ _toolbar2_class = NavigationToolbar2GTK3
+ _toolmanager_toolbar_class = ToolbarGTK3
+
+
+@_BackendGTK.export
+class _BackendGTK3(_BackendGTK):
+ FigureCanvas = FigureCanvasGTK3
+ FigureManager = FigureManagerGTK3
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3agg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3agg.py
new file mode 100644
index 0000000000000000000000000000000000000000..bb469b85783dc10c11395fa2761a1d1625f3d885
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3agg.py
@@ -0,0 +1,74 @@
+import numpy as np
+
+from .. import cbook, transforms
+from . import backend_agg, backend_gtk3
+from .backend_gtk3 import GLib, Gtk, _BackendGTK3
+
+import cairo # Presence of cairo is already checked by _backend_gtk.
+
+
+class FigureCanvasGTK3Agg(backend_agg.FigureCanvasAgg,
+ backend_gtk3.FigureCanvasGTK3):
+ def __init__(self, figure):
+ super().__init__(figure=figure)
+ self._bbox_queue = []
+
+ def on_draw_event(self, widget, ctx):
+ if self._idle_draw_id:
+ GLib.source_remove(self._idle_draw_id)
+ self._idle_draw_id = 0
+ self.draw()
+
+ scale = self.device_pixel_ratio
+ allocation = self.get_allocation()
+ w = allocation.width * scale
+ h = allocation.height * scale
+
+ if not len(self._bbox_queue):
+ Gtk.render_background(
+ self.get_style_context(), ctx,
+ allocation.x, allocation.y,
+ allocation.width, allocation.height)
+ bbox_queue = [transforms.Bbox([[0, 0], [w, h]])]
+ else:
+ bbox_queue = self._bbox_queue
+
+ for bbox in bbox_queue:
+ x = int(bbox.x0)
+ y = h - int(bbox.y1)
+ width = int(bbox.x1) - int(bbox.x0)
+ height = int(bbox.y1) - int(bbox.y0)
+
+ buf = cbook._unmultiplied_rgba8888_to_premultiplied_argb32(
+ np.asarray(self.copy_from_bbox(bbox)))
+ image = cairo.ImageSurface.create_for_data(
+ buf.ravel().data, cairo.FORMAT_ARGB32, width, height)
+ image.set_device_scale(scale, scale)
+ ctx.set_source_surface(image, x / scale, y / scale)
+ ctx.paint()
+
+ if len(self._bbox_queue):
+ self._bbox_queue = []
+
+ return False
+
+ def blit(self, bbox=None):
+ # If bbox is None, blit the entire canvas to gtk. Otherwise
+ # blit only the area defined by the bbox.
+ if bbox is None:
+ bbox = self.figure.bbox
+
+ scale = self.device_pixel_ratio
+ allocation = self.get_allocation()
+ x = int(bbox.x0 / scale)
+ y = allocation.height - int(bbox.y1 / scale)
+ width = (int(bbox.x1) - int(bbox.x0)) // scale
+ height = (int(bbox.y1) - int(bbox.y0)) // scale
+
+ self._bbox_queue.append(bbox)
+ self.queue_draw_area(x, y, width, height)
+
+
+@_BackendGTK3.export
+class _BackendGTK3Agg(_BackendGTK3):
+ FigureCanvas = FigureCanvasGTK3Agg
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3cairo.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3cairo.py
new file mode 100644
index 0000000000000000000000000000000000000000..371b8dc1b31fb96dd823eeed65592d1692d5b8f2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk3cairo.py
@@ -0,0 +1,35 @@
+from contextlib import nullcontext
+
+from .backend_cairo import FigureCanvasCairo
+from .backend_gtk3 import GLib, Gtk, FigureCanvasGTK3, _BackendGTK3
+
+
+class FigureCanvasGTK3Cairo(FigureCanvasCairo, FigureCanvasGTK3):
+ def on_draw_event(self, widget, ctx):
+ if self._idle_draw_id:
+ GLib.source_remove(self._idle_draw_id)
+ self._idle_draw_id = 0
+ self.draw()
+
+ with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
+ else nullcontext()):
+ allocation = self.get_allocation()
+ # Render the background before scaling, as the allocated size here is in
+ # logical pixels.
+ Gtk.render_background(
+ self.get_style_context(), ctx,
+ 0, 0, allocation.width, allocation.height)
+ scale = self.device_pixel_ratio
+ # Scale physical drawing to logical size.
+ ctx.scale(1 / scale, 1 / scale)
+ self._renderer.set_context(ctx)
+ # Set renderer to physical size so it renders in full resolution.
+ self._renderer.width = allocation.width * scale
+ self._renderer.height = allocation.height * scale
+ self._renderer.dpi = self.figure.dpi
+ self.figure.draw(self._renderer)
+
+
+@_BackendGTK3.export
+class _BackendGTK3Cairo(_BackendGTK3):
+ FigureCanvas = FigureCanvasGTK3Cairo
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4.py
new file mode 100644
index 0000000000000000000000000000000000000000..620c9e5b94b664a54ae5e36e78f7398c4a19017c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4.py
@@ -0,0 +1,627 @@
+import functools
+import io
+import os
+
+import matplotlib as mpl
+from matplotlib import _api, backend_tools, cbook
+from matplotlib.backend_bases import (
+ ToolContainerBase, MouseButton,
+ KeyEvent, LocationEvent, MouseEvent, ResizeEvent, CloseEvent)
+
+try:
+ import gi
+except ImportError as err:
+ raise ImportError("The GTK4 backends require PyGObject") from err
+
+try:
+ # :raises ValueError: If module/version is already loaded, already
+ # required, or unavailable.
+ gi.require_version("Gtk", "4.0")
+except ValueError as e:
+ # in this case we want to re-raise as ImportError so the
+ # auto-backend selection logic correctly skips.
+ raise ImportError(e) from e
+
+from gi.repository import Gio, GLib, Gtk, Gdk, GdkPixbuf
+from . import _backend_gtk
+from ._backend_gtk import ( # noqa: F401 # pylint: disable=W0611
+ _BackendGTK, _FigureCanvasGTK, _FigureManagerGTK, _NavigationToolbar2GTK,
+ TimerGTK as TimerGTK4,
+)
+
+_GOBJECT_GE_3_47 = gi.version_info >= (3, 47, 0)
+
+
+class FigureCanvasGTK4(_FigureCanvasGTK, Gtk.DrawingArea):
+ required_interactive_framework = "gtk4"
+ supports_blit = False
+ manager_class = _api.classproperty(lambda cls: FigureManagerGTK4)
+
+ def __init__(self, figure=None):
+ super().__init__(figure=figure)
+
+ self.set_hexpand(True)
+ self.set_vexpand(True)
+
+ self._idle_draw_id = 0
+ self._rubberband_rect = None
+
+ self.set_draw_func(self._draw_func)
+ self.connect('resize', self.resize_event)
+ self.connect('notify::scale-factor', self._update_device_pixel_ratio)
+
+ click = Gtk.GestureClick()
+ click.set_button(0) # All buttons.
+ click.connect('pressed', self.button_press_event)
+ click.connect('released', self.button_release_event)
+ self.add_controller(click)
+
+ key = Gtk.EventControllerKey()
+ key.connect('key-pressed', self.key_press_event)
+ key.connect('key-released', self.key_release_event)
+ self.add_controller(key)
+
+ motion = Gtk.EventControllerMotion()
+ motion.connect('motion', self.motion_notify_event)
+ motion.connect('enter', self.enter_notify_event)
+ motion.connect('leave', self.leave_notify_event)
+ self.add_controller(motion)
+
+ scroll = Gtk.EventControllerScroll.new(
+ Gtk.EventControllerScrollFlags.VERTICAL)
+ scroll.connect('scroll', self.scroll_event)
+ self.add_controller(scroll)
+
+ self.set_focusable(True)
+
+ css = Gtk.CssProvider()
+ style = '.matplotlib-canvas { background-color: white; }'
+ if Gtk.check_version(4, 9, 3) is None:
+ css.load_from_data(style, -1)
+ else:
+ css.load_from_data(style.encode('utf-8'))
+ style_ctx = self.get_style_context()
+ style_ctx.add_provider(css, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
+ style_ctx.add_class("matplotlib-canvas")
+
+ def destroy(self):
+ CloseEvent("close_event", self)._process()
+
+ def set_cursor(self, cursor):
+ # docstring inherited
+ self.set_cursor_from_name(_backend_gtk.mpl_to_gtk_cursor_name(cursor))
+
+ def _mpl_coords(self, xy=None):
+ """
+ Convert the *xy* position of a GTK event, or of the current cursor
+ position if *xy* is None, to Matplotlib coordinates.
+
+ GTK use logical pixels, but the figure is scaled to physical pixels for
+ rendering. Transform to physical pixels so that all of the down-stream
+ transforms work as expected.
+
+ Also, the origin is different and needs to be corrected.
+ """
+ if xy is None:
+ surface = self.get_native().get_surface()
+ is_over, x, y, mask = surface.get_device_position(
+ self.get_display().get_default_seat().get_pointer())
+ else:
+ x, y = xy
+ x = x * self.device_pixel_ratio
+ # flip y so y=0 is bottom of canvas
+ y = self.figure.bbox.height - y * self.device_pixel_ratio
+ return x, y
+
+ def scroll_event(self, controller, dx, dy):
+ MouseEvent(
+ "scroll_event", self, *self._mpl_coords(), step=dy,
+ modifiers=self._mpl_modifiers(controller),
+ guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None,
+ )._process()
+ return True
+
+ def button_press_event(self, controller, n_press, x, y):
+ MouseEvent(
+ "button_press_event", self, *self._mpl_coords((x, y)),
+ controller.get_current_button(),
+ modifiers=self._mpl_modifiers(controller),
+ guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None,
+ )._process()
+ self.grab_focus()
+
+ def button_release_event(self, controller, n_press, x, y):
+ MouseEvent(
+ "button_release_event", self, *self._mpl_coords((x, y)),
+ controller.get_current_button(),
+ modifiers=self._mpl_modifiers(controller),
+ guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None,
+ )._process()
+
+ def key_press_event(self, controller, keyval, keycode, state):
+ KeyEvent(
+ "key_press_event", self, self._get_key(keyval, keycode, state),
+ *self._mpl_coords(),
+ guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None,
+ )._process()
+ return True
+
+ def key_release_event(self, controller, keyval, keycode, state):
+ KeyEvent(
+ "key_release_event", self, self._get_key(keyval, keycode, state),
+ *self._mpl_coords(),
+ guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None,
+ )._process()
+ return True
+
+ def motion_notify_event(self, controller, x, y):
+ MouseEvent(
+ "motion_notify_event", self, *self._mpl_coords((x, y)),
+ buttons=self._mpl_buttons(controller),
+ modifiers=self._mpl_modifiers(controller),
+ guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None,
+ )._process()
+
+ def enter_notify_event(self, controller, x, y):
+ LocationEvent(
+ "figure_enter_event", self, *self._mpl_coords((x, y)),
+ modifiers=self._mpl_modifiers(),
+ guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None,
+ )._process()
+
+ def leave_notify_event(self, controller):
+ LocationEvent(
+ "figure_leave_event", self, *self._mpl_coords(),
+ modifiers=self._mpl_modifiers(),
+ guiEvent=controller.get_current_event() if _GOBJECT_GE_3_47 else None,
+ )._process()
+
+ def resize_event(self, area, width, height):
+ self._update_device_pixel_ratio()
+ dpi = self.figure.dpi
+ winch = width * self.device_pixel_ratio / dpi
+ hinch = height * self.device_pixel_ratio / dpi
+ self.figure.set_size_inches(winch, hinch, forward=False)
+ ResizeEvent("resize_event", self)._process()
+ self.draw_idle()
+
+ def _mpl_buttons(self, controller):
+ # NOTE: This spews "Broken accounting of active state" warnings on
+ # right click on macOS.
+ surface = self.get_native().get_surface()
+ is_over, x, y, event_state = surface.get_device_position(
+ self.get_display().get_default_seat().get_pointer())
+ # NOTE: alternatively we could use
+ # event_state = controller.get_current_event_state()
+ # but for button_press/button_release this would report the state
+ # *prior* to the event rather than after it; the above reports the
+ # state *after* it.
+ mod_table = [
+ (MouseButton.LEFT, Gdk.ModifierType.BUTTON1_MASK),
+ (MouseButton.MIDDLE, Gdk.ModifierType.BUTTON2_MASK),
+ (MouseButton.RIGHT, Gdk.ModifierType.BUTTON3_MASK),
+ (MouseButton.BACK, Gdk.ModifierType.BUTTON4_MASK),
+ (MouseButton.FORWARD, Gdk.ModifierType.BUTTON5_MASK),
+ ]
+ return {name for name, mask in mod_table if event_state & mask}
+
+ def _mpl_modifiers(self, controller=None):
+ if controller is None:
+ surface = self.get_native().get_surface()
+ is_over, x, y, event_state = surface.get_device_position(
+ self.get_display().get_default_seat().get_pointer())
+ else:
+ event_state = controller.get_current_event_state()
+ mod_table = [
+ ("ctrl", Gdk.ModifierType.CONTROL_MASK),
+ ("alt", Gdk.ModifierType.ALT_MASK),
+ ("shift", Gdk.ModifierType.SHIFT_MASK),
+ ("super", Gdk.ModifierType.SUPER_MASK),
+ ]
+ return [name for name, mask in mod_table if event_state & mask]
+
+ def _get_key(self, keyval, keycode, state):
+ unikey = chr(Gdk.keyval_to_unicode(keyval))
+ key = cbook._unikey_or_keysym_to_mplkey(
+ unikey,
+ Gdk.keyval_name(keyval))
+ modifiers = [
+ ("ctrl", Gdk.ModifierType.CONTROL_MASK, "control"),
+ ("alt", Gdk.ModifierType.ALT_MASK, "alt"),
+ ("shift", Gdk.ModifierType.SHIFT_MASK, "shift"),
+ ("super", Gdk.ModifierType.SUPER_MASK, "super"),
+ ]
+ mods = [
+ mod for mod, mask, mod_key in modifiers
+ if (mod_key != key and state & mask
+ and not (mod == "shift" and unikey.isprintable()))]
+ return "+".join([*mods, key])
+
+ def _update_device_pixel_ratio(self, *args, **kwargs):
+ # We need to be careful in cases with mixed resolution displays if
+ # device_pixel_ratio changes.
+ if self._set_device_pixel_ratio(self.get_scale_factor()):
+ self.draw()
+
+ def _draw_rubberband(self, rect):
+ self._rubberband_rect = rect
+ # TODO: Only update the rubberband area.
+ self.queue_draw()
+
+ def _draw_func(self, drawing_area, ctx, width, height):
+ self.on_draw_event(self, ctx)
+ self._post_draw(self, ctx)
+
+ def _post_draw(self, widget, ctx):
+ if self._rubberband_rect is None:
+ return
+
+ lw = 1
+ dash = 3
+ x0, y0, w, h = (dim / self.device_pixel_ratio
+ for dim in self._rubberband_rect)
+ x1 = x0 + w
+ y1 = y0 + h
+
+ # Draw the lines from x0, y0 towards x1, y1 so that the
+ # dashes don't "jump" when moving the zoom box.
+ ctx.move_to(x0, y0)
+ ctx.line_to(x0, y1)
+ ctx.move_to(x0, y0)
+ ctx.line_to(x1, y0)
+ ctx.move_to(x0, y1)
+ ctx.line_to(x1, y1)
+ ctx.move_to(x1, y0)
+ ctx.line_to(x1, y1)
+
+ ctx.set_antialias(1)
+ ctx.set_line_width(lw)
+ ctx.set_dash((dash, dash), 0)
+ ctx.set_source_rgb(0, 0, 0)
+ ctx.stroke_preserve()
+
+ ctx.set_dash((dash, dash), dash)
+ ctx.set_source_rgb(1, 1, 1)
+ ctx.stroke()
+
+ def on_draw_event(self, widget, ctx):
+ # to be overwritten by GTK4Agg or GTK4Cairo
+ pass
+
+ def draw(self):
+ # docstring inherited
+ if self.is_drawable():
+ self.queue_draw()
+
+ def draw_idle(self):
+ # docstring inherited
+ if self._idle_draw_id != 0:
+ return
+ def idle_draw(*args):
+ try:
+ self.draw()
+ finally:
+ self._idle_draw_id = 0
+ return False
+ self._idle_draw_id = GLib.idle_add(idle_draw)
+
+ def flush_events(self):
+ # docstring inherited
+ context = GLib.MainContext.default()
+ while context.pending():
+ context.iteration(True)
+
+
+class NavigationToolbar2GTK4(_NavigationToolbar2GTK, Gtk.Box):
+ def __init__(self, canvas):
+ Gtk.Box.__init__(self)
+
+ self.add_css_class('toolbar')
+
+ self._gtk_ids = {}
+ for text, tooltip_text, image_file, callback in self.toolitems:
+ if text is None:
+ self.append(Gtk.Separator())
+ continue
+ image = Gtk.Image.new_from_gicon(
+ Gio.Icon.new_for_string(
+ str(cbook._get_data_path('images',
+ f'{image_file}-symbolic.svg'))))
+ self._gtk_ids[text] = button = (
+ Gtk.ToggleButton() if callback in ['zoom', 'pan'] else
+ Gtk.Button())
+ button.set_child(image)
+ button.add_css_class('flat')
+ button.add_css_class('image-button')
+ # Save the handler id, so that we can block it as needed.
+ button._signal_handler = button.connect(
+ 'clicked', getattr(self, callback))
+ button.set_tooltip_text(tooltip_text)
+ self.append(button)
+
+ # This filler item ensures the toolbar is always at least two text
+ # lines high. Otherwise the canvas gets redrawn as the mouse hovers
+ # over images because those use two-line messages which resize the
+ # toolbar.
+ label = Gtk.Label()
+ label.set_markup(
+ '\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE} ')
+ label.set_hexpand(True) # Push real message to the right.
+ self.append(label)
+
+ self.message = Gtk.Label()
+ self.message.set_justify(Gtk.Justification.RIGHT)
+ self.append(self.message)
+
+ _NavigationToolbar2GTK.__init__(self, canvas)
+
+ def save_figure(self, *args):
+ dialog = Gtk.FileChooserNative(
+ title='Save the figure',
+ transient_for=self.canvas.get_root(),
+ action=Gtk.FileChooserAction.SAVE,
+ modal=True)
+ self._save_dialog = dialog # Must keep a reference.
+
+ ff = Gtk.FileFilter()
+ ff.set_name('All files')
+ ff.add_pattern('*')
+ dialog.add_filter(ff)
+ dialog.set_filter(ff)
+
+ formats = []
+ default_format = None
+ for i, (name, fmts) in enumerate(
+ self.canvas.get_supported_filetypes_grouped().items()):
+ ff = Gtk.FileFilter()
+ ff.set_name(name)
+ for fmt in fmts:
+ ff.add_pattern(f'*.{fmt}')
+ dialog.add_filter(ff)
+ formats.append(name)
+ if self.canvas.get_default_filetype() in fmts:
+ default_format = i
+ # Setting the choice doesn't always work, so make sure the default
+ # format is first.
+ formats = [formats[default_format], *formats[:default_format],
+ *formats[default_format+1:]]
+ dialog.add_choice('format', 'File format', formats, formats)
+ dialog.set_choice('format', formats[0])
+
+ dialog.set_current_folder(Gio.File.new_for_path(
+ os.path.expanduser(mpl.rcParams['savefig.directory'])))
+ dialog.set_current_name(self.canvas.get_default_filename())
+
+ @functools.partial(dialog.connect, 'response')
+ def on_response(dialog, response):
+ file = dialog.get_file()
+ fmt = dialog.get_choice('format')
+ fmt = self.canvas.get_supported_filetypes_grouped()[fmt][0]
+ dialog.destroy()
+ self._save_dialog = None
+ if response != Gtk.ResponseType.ACCEPT:
+ return
+ # Save dir for next time, unless empty str (which means use cwd).
+ if mpl.rcParams['savefig.directory']:
+ parent = file.get_parent()
+ mpl.rcParams['savefig.directory'] = parent.get_path()
+ try:
+ self.canvas.figure.savefig(file.get_path(), format=fmt)
+ except Exception as e:
+ msg = Gtk.MessageDialog(
+ transient_for=self.canvas.get_root(),
+ message_type=Gtk.MessageType.ERROR,
+ buttons=Gtk.ButtonsType.OK, modal=True,
+ text=str(e))
+ msg.show()
+
+ dialog.show()
+ return self.UNKNOWN_SAVED_STATUS
+
+
+class ToolbarGTK4(ToolContainerBase, Gtk.Box):
+ _icon_extension = '-symbolic.svg'
+
+ def __init__(self, toolmanager):
+ ToolContainerBase.__init__(self, toolmanager)
+ Gtk.Box.__init__(self)
+ self.set_property('orientation', Gtk.Orientation.HORIZONTAL)
+
+ # Tool items are created later, but must appear before the message.
+ self._tool_box = Gtk.Box()
+ self.append(self._tool_box)
+ self._groups = {}
+ self._toolitems = {}
+
+ # This filler item ensures the toolbar is always at least two text
+ # lines high. Otherwise the canvas gets redrawn as the mouse hovers
+ # over images because those use two-line messages which resize the
+ # toolbar.
+ label = Gtk.Label()
+ label.set_markup(
+ '\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE} ')
+ label.set_hexpand(True) # Push real message to the right.
+ self.append(label)
+
+ self._message = Gtk.Label()
+ self._message.set_justify(Gtk.Justification.RIGHT)
+ self.append(self._message)
+
+ def add_toolitem(self, name, group, position, image_file, description,
+ toggle):
+ if toggle:
+ button = Gtk.ToggleButton()
+ else:
+ button = Gtk.Button()
+ button.set_label(name)
+ button.add_css_class('flat')
+
+ if image_file is not None:
+ image = Gtk.Image.new_from_gicon(
+ Gio.Icon.new_for_string(image_file))
+ button.set_child(image)
+ button.add_css_class('image-button')
+
+ if position is None:
+ position = -1
+
+ self._add_button(button, group, position)
+ signal = button.connect('clicked', self._call_tool, name)
+ button.set_tooltip_text(description)
+ self._toolitems.setdefault(name, [])
+ self._toolitems[name].append((button, signal))
+
+ def _find_child_at_position(self, group, position):
+ children = [None]
+ child = self._groups[group].get_first_child()
+ while child is not None:
+ children.append(child)
+ child = child.get_next_sibling()
+ return children[position]
+
+ def _add_button(self, button, group, position):
+ if group not in self._groups:
+ if self._groups:
+ self._add_separator()
+ group_box = Gtk.Box()
+ self._tool_box.append(group_box)
+ self._groups[group] = group_box
+ self._groups[group].insert_child_after(
+ button, self._find_child_at_position(group, position))
+
+ def _call_tool(self, btn, name):
+ self.trigger_tool(name)
+
+ def toggle_toolitem(self, name, toggled):
+ if name not in self._toolitems:
+ return
+ for toolitem, signal in self._toolitems[name]:
+ toolitem.handler_block(signal)
+ toolitem.set_active(toggled)
+ toolitem.handler_unblock(signal)
+
+ def remove_toolitem(self, name):
+ for toolitem, _signal in self._toolitems.pop(name, []):
+ for group in self._groups:
+ if toolitem in self._groups[group]:
+ self._groups[group].remove(toolitem)
+
+ def _add_separator(self):
+ sep = Gtk.Separator()
+ sep.set_property("orientation", Gtk.Orientation.VERTICAL)
+ self._tool_box.append(sep)
+
+ def set_message(self, s):
+ self._message.set_label(s)
+
+
+@backend_tools._register_tool_class(FigureCanvasGTK4)
+class SaveFigureGTK4(backend_tools.SaveFigureBase):
+ def trigger(self, *args, **kwargs):
+ NavigationToolbar2GTK4.save_figure(
+ self._make_classic_style_pseudo_toolbar())
+
+
+@backend_tools._register_tool_class(FigureCanvasGTK4)
+class HelpGTK4(backend_tools.ToolHelpBase):
+ def _normalize_shortcut(self, key):
+ """
+ Convert Matplotlib key presses to GTK+ accelerator identifiers.
+
+ Related to `FigureCanvasGTK4._get_key`.
+ """
+ special = {
+ 'backspace': 'BackSpace',
+ 'pagedown': 'Page_Down',
+ 'pageup': 'Page_Up',
+ 'scroll_lock': 'Scroll_Lock',
+ }
+
+ parts = key.split('+')
+ mods = ['<' + mod + '>' for mod in parts[:-1]]
+ key = parts[-1]
+
+ if key in special:
+ key = special[key]
+ elif len(key) > 1:
+ key = key.capitalize()
+ elif key.isupper():
+ mods += ['']
+
+ return ''.join(mods) + key
+
+ def _is_valid_shortcut(self, key):
+ """
+ Check for a valid shortcut to be displayed.
+
+ - GTK will never send 'cmd+' (see `FigureCanvasGTK4._get_key`).
+ - The shortcut window only shows keyboard shortcuts, not mouse buttons.
+ """
+ return 'cmd+' not in key and not key.startswith('MouseButton.')
+
+ def trigger(self, *args):
+ section = Gtk.ShortcutsSection()
+
+ for name, tool in sorted(self.toolmanager.tools.items()):
+ if not tool.description:
+ continue
+
+ # Putting everything in a separate group allows GTK to
+ # automatically split them into separate columns/pages, which is
+ # useful because we have lots of shortcuts, some with many keys
+ # that are very wide.
+ group = Gtk.ShortcutsGroup()
+ section.append(group)
+ # A hack to remove the title since we have no group naming.
+ child = group.get_first_child()
+ while child is not None:
+ child.set_visible(False)
+ child = child.get_next_sibling()
+
+ shortcut = Gtk.ShortcutsShortcut(
+ accelerator=' '.join(
+ self._normalize_shortcut(key)
+ for key in self.toolmanager.get_tool_keymap(name)
+ if self._is_valid_shortcut(key)),
+ title=tool.name,
+ subtitle=tool.description)
+ group.append(shortcut)
+
+ window = Gtk.ShortcutsWindow(
+ title='Help',
+ modal=True,
+ transient_for=self._figure.canvas.get_root())
+ window.set_child(section)
+
+ window.show()
+
+
+@backend_tools._register_tool_class(FigureCanvasGTK4)
+class ToolCopyToClipboardGTK4(backend_tools.ToolCopyToClipboardBase):
+ def trigger(self, *args, **kwargs):
+ with io.BytesIO() as f:
+ self.canvas.print_rgba(f)
+ w, h = self.canvas.get_width_height()
+ pb = GdkPixbuf.Pixbuf.new_from_data(f.getbuffer(),
+ GdkPixbuf.Colorspace.RGB, True,
+ 8, w, h, w*4)
+ clipboard = self.canvas.get_clipboard()
+ clipboard.set(pb)
+
+
+backend_tools._register_tool_class(
+ FigureCanvasGTK4, _backend_gtk.ConfigureSubplotsGTK)
+backend_tools._register_tool_class(
+ FigureCanvasGTK4, _backend_gtk.RubberbandGTK)
+Toolbar = ToolbarGTK4
+
+
+class FigureManagerGTK4(_FigureManagerGTK):
+ _toolbar2_class = NavigationToolbar2GTK4
+ _toolmanager_toolbar_class = ToolbarGTK4
+
+
+@_BackendGTK.export
+class _BackendGTK4(_BackendGTK):
+ FigureCanvas = FigureCanvasGTK4
+ FigureManager = FigureManagerGTK4
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4agg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4agg.py
new file mode 100644
index 0000000000000000000000000000000000000000..0af07850a30aa1dac97fd24580e434e23b48bba5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4agg.py
@@ -0,0 +1,41 @@
+import numpy as np
+
+from .. import cbook
+from . import backend_agg, backend_gtk4
+from .backend_gtk4 import GLib, Gtk, _BackendGTK4
+
+import cairo # Presence of cairo is already checked by _backend_gtk.
+
+
+class FigureCanvasGTK4Agg(backend_agg.FigureCanvasAgg,
+ backend_gtk4.FigureCanvasGTK4):
+
+ def on_draw_event(self, widget, ctx):
+ if self._idle_draw_id:
+ GLib.source_remove(self._idle_draw_id)
+ self._idle_draw_id = 0
+ self.draw()
+
+ scale = self.device_pixel_ratio
+ allocation = self.get_allocation()
+
+ Gtk.render_background(
+ self.get_style_context(), ctx,
+ allocation.x, allocation.y,
+ allocation.width, allocation.height)
+
+ buf = cbook._unmultiplied_rgba8888_to_premultiplied_argb32(
+ np.asarray(self.get_renderer().buffer_rgba()))
+ height, width, _ = buf.shape
+ image = cairo.ImageSurface.create_for_data(
+ buf.ravel().data, cairo.FORMAT_ARGB32, width, height)
+ image.set_device_scale(scale, scale)
+ ctx.set_source_surface(image, 0, 0)
+ ctx.paint()
+
+ return False
+
+
+@_BackendGTK4.export
+class _BackendGTK4Agg(_BackendGTK4):
+ FigureCanvas = FigureCanvasGTK4Agg
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4cairo.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4cairo.py
new file mode 100644
index 0000000000000000000000000000000000000000..838ea03fcce6b4aec68de3baf876b876a1085803
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_gtk4cairo.py
@@ -0,0 +1,32 @@
+from contextlib import nullcontext
+
+from .backend_cairo import FigureCanvasCairo
+from .backend_gtk4 import GLib, Gtk, FigureCanvasGTK4, _BackendGTK4
+
+
+class FigureCanvasGTK4Cairo(FigureCanvasCairo, FigureCanvasGTK4):
+ def _set_device_pixel_ratio(self, ratio):
+ # Cairo in GTK4 always uses logical pixels, so we don't need to do anything for
+ # changes to the device pixel ratio.
+ return False
+
+ def on_draw_event(self, widget, ctx):
+ if self._idle_draw_id:
+ GLib.source_remove(self._idle_draw_id)
+ self._idle_draw_id = 0
+ self.draw()
+
+ with (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
+ else nullcontext()):
+ self._renderer.set_context(ctx)
+ allocation = self.get_allocation()
+ Gtk.render_background(
+ self.get_style_context(), ctx,
+ allocation.x, allocation.y,
+ allocation.width, allocation.height)
+ self.figure.draw(self._renderer)
+
+
+@_BackendGTK4.export
+class _BackendGTK4Cairo(_BackendGTK4):
+ FigureCanvas = FigureCanvasGTK4Cairo
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_macosx.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_macosx.py
new file mode 100644
index 0000000000000000000000000000000000000000..6ea437a90ca1af217820a0ae8f6571808f15b486
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_macosx.py
@@ -0,0 +1,196 @@
+import os
+
+import matplotlib as mpl
+from matplotlib import _api, cbook
+from matplotlib._pylab_helpers import Gcf
+from . import _macosx
+from .backend_agg import FigureCanvasAgg
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2,
+ ResizeEvent, TimerBase, _allow_interrupt)
+
+
+class TimerMac(_macosx.Timer, TimerBase):
+ """Subclass of `.TimerBase` using CFRunLoop timer events."""
+ # completely implemented at the C-level (in _macosx.Timer)
+
+
+def _allow_interrupt_macos():
+ """A context manager that allows terminating a plot by sending a SIGINT."""
+ return _allow_interrupt(
+ lambda rsock: _macosx.wake_on_fd_write(rsock.fileno()), _macosx.stop)
+
+
+class FigureCanvasMac(FigureCanvasAgg, _macosx.FigureCanvas, FigureCanvasBase):
+ # docstring inherited
+
+ # Ideally this class would be `class FCMacAgg(FCAgg, FCMac)`
+ # (FC=FigureCanvas) where FCMac would be an ObjC-implemented mac-specific
+ # class also inheriting from FCBase (this is the approach with other GUI
+ # toolkits). However, writing an extension type inheriting from a Python
+ # base class is slightly tricky (the extension type must be a heap type),
+ # and we can just as well lift the FCBase base up one level, keeping it *at
+ # the end* to have the right method resolution order.
+
+ # Events such as button presses, mouse movements, and key presses are
+ # handled in C and events (MouseEvent, etc.) are triggered from there.
+
+ required_interactive_framework = "macosx"
+ _timer_cls = TimerMac
+ manager_class = _api.classproperty(lambda cls: FigureManagerMac)
+
+ def __init__(self, figure):
+ super().__init__(figure=figure)
+ self._draw_pending = False
+ self._is_drawing = False
+ # Keep track of the timers that are alive
+ self._timers = set()
+
+ def draw(self):
+ """Render the figure and update the macosx canvas."""
+ # The renderer draw is done here; delaying causes problems with code
+ # that uses the result of the draw() to update plot elements.
+ if self._is_drawing:
+ return
+ with cbook._setattr_cm(self, _is_drawing=True):
+ super().draw()
+ self.update()
+
+ def draw_idle(self):
+ # docstring inherited
+ if not (getattr(self, '_draw_pending', False) or
+ getattr(self, '_is_drawing', False)):
+ self._draw_pending = True
+ # Add a singleshot timer to the eventloop that will call back
+ # into the Python method _draw_idle to take care of the draw
+ self._single_shot_timer(self._draw_idle)
+
+ def _single_shot_timer(self, callback):
+ """Add a single shot timer with the given callback"""
+ def callback_func(callback, timer):
+ callback()
+ self._timers.remove(timer)
+ timer = self.new_timer(interval=0)
+ timer.single_shot = True
+ timer.add_callback(callback_func, callback, timer)
+ self._timers.add(timer)
+ timer.start()
+
+ def _draw_idle(self):
+ """
+ Draw method for singleshot timer
+
+ This draw method can be added to a singleshot timer, which can
+ accumulate draws while the eventloop is spinning. This method will
+ then only draw the first time and short-circuit the others.
+ """
+ with self._idle_draw_cntx():
+ if not self._draw_pending:
+ # Short-circuit because our draw request has already been
+ # taken care of
+ return
+ self._draw_pending = False
+ self.draw()
+
+ def blit(self, bbox=None):
+ # docstring inherited
+ super().blit(bbox)
+ self.update()
+
+ def resize(self, width, height):
+ # Size from macOS is logical pixels, dpi is physical.
+ scale = self.figure.dpi / self.device_pixel_ratio
+ width /= scale
+ height /= scale
+ self.figure.set_size_inches(width, height, forward=False)
+ ResizeEvent("resize_event", self)._process()
+ self.draw_idle()
+
+ def start_event_loop(self, timeout=0):
+ # docstring inherited
+ # Set up a SIGINT handler to allow terminating a plot via CTRL-C.
+ with _allow_interrupt_macos():
+ self._start_event_loop(timeout=timeout) # Forward to ObjC implementation.
+
+
+class NavigationToolbar2Mac(_macosx.NavigationToolbar2, NavigationToolbar2):
+
+ def __init__(self, canvas):
+ data_path = cbook._get_data_path('images')
+ _, tooltips, image_names, _ = zip(*NavigationToolbar2.toolitems)
+ _macosx.NavigationToolbar2.__init__(
+ self, canvas,
+ tuple(str(data_path / image_name) + ".pdf"
+ for image_name in image_names if image_name is not None),
+ tuple(tooltip for tooltip in tooltips if tooltip is not None))
+ NavigationToolbar2.__init__(self, canvas)
+
+ def draw_rubberband(self, event, x0, y0, x1, y1):
+ self.canvas.set_rubberband(int(x0), int(y0), int(x1), int(y1))
+
+ def remove_rubberband(self):
+ self.canvas.remove_rubberband()
+
+ def save_figure(self, *args):
+ directory = os.path.expanduser(mpl.rcParams['savefig.directory'])
+ filename = _macosx.choose_save_file('Save the figure',
+ directory,
+ self.canvas.get_default_filename())
+ if filename is None: # Cancel
+ return
+ # Save dir for next time, unless empty str (which means use cwd).
+ if mpl.rcParams['savefig.directory']:
+ mpl.rcParams['savefig.directory'] = os.path.dirname(filename)
+ self.canvas.figure.savefig(filename)
+ return filename
+
+
+class FigureManagerMac(_macosx.FigureManager, FigureManagerBase):
+ _toolbar2_class = NavigationToolbar2Mac
+
+ def __init__(self, canvas, num):
+ self._shown = False
+ _macosx.FigureManager.__init__(self, canvas)
+ icon_path = str(cbook._get_data_path('images/matplotlib.pdf'))
+ _macosx.FigureManager.set_icon(icon_path)
+ FigureManagerBase.__init__(self, canvas, num)
+ self._set_window_mode(mpl.rcParams["macosx.window_mode"])
+ if self.toolbar is not None:
+ self.toolbar.update()
+ if mpl.is_interactive():
+ self.show()
+ self.canvas.draw_idle()
+
+ def _close_button_pressed(self):
+ Gcf.destroy(self)
+ self.canvas.flush_events()
+
+ def destroy(self):
+ # We need to clear any pending timers that never fired, otherwise
+ # we get a memory leak from the timer callbacks holding a reference
+ while self.canvas._timers:
+ timer = self.canvas._timers.pop()
+ timer.stop()
+ super().destroy()
+
+ @classmethod
+ def start_main_loop(cls):
+ # Set up a SIGINT handler to allow terminating a plot via CTRL-C.
+ with _allow_interrupt_macos():
+ _macosx.show()
+
+ def show(self):
+ if self.canvas.figure.stale:
+ self.canvas.draw_idle()
+ if not self._shown:
+ self._show()
+ self._shown = True
+ if mpl.rcParams["figure.raise_window"]:
+ self._raise()
+
+
+@_Backend.export
+class _BackendMac(_Backend):
+ FigureCanvas = FigureCanvasMac
+ FigureManager = FigureManagerMac
+ mainloop = FigureManagerMac.start_main_loop
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_mixed.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_mixed.py
new file mode 100644
index 0000000000000000000000000000000000000000..971d73cdb44882a70cf5d429cd2f02f445a62aeb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_mixed.py
@@ -0,0 +1,119 @@
+import numpy as np
+
+from matplotlib import cbook
+from .backend_agg import RendererAgg
+from matplotlib._tight_bbox import process_figure_for_rasterizing
+
+
+class MixedModeRenderer:
+ """
+ A helper class to implement a renderer that switches between
+ vector and raster drawing. An example may be a PDF writer, where
+ most things are drawn with PDF vector commands, but some very
+ complex objects, such as quad meshes, are rasterised and then
+ output as images.
+ """
+ def __init__(self, figure, width, height, dpi, vector_renderer,
+ raster_renderer_class=None,
+ bbox_inches_restore=None):
+ """
+ Parameters
+ ----------
+ figure : `~matplotlib.figure.Figure`
+ The figure instance.
+ width : float
+ The width of the canvas in logical units
+ height : float
+ The height of the canvas in logical units
+ dpi : float
+ The dpi of the canvas
+ vector_renderer : `~matplotlib.backend_bases.RendererBase`
+ An instance of a subclass of
+ `~matplotlib.backend_bases.RendererBase` that will be used for the
+ vector drawing.
+ raster_renderer_class : `~matplotlib.backend_bases.RendererBase`
+ The renderer class to use for the raster drawing. If not provided,
+ this will use the Agg backend (which is currently the only viable
+ option anyway.)
+
+ """
+ if raster_renderer_class is None:
+ raster_renderer_class = RendererAgg
+
+ self._raster_renderer_class = raster_renderer_class
+ self._width = width
+ self._height = height
+ self.dpi = dpi
+
+ self._vector_renderer = vector_renderer
+
+ self._raster_renderer = None
+
+ # A reference to the figure is needed as we need to change
+ # the figure dpi before and after the rasterization. Although
+ # this looks ugly, I couldn't find a better solution. -JJL
+ self.figure = figure
+ self._figdpi = figure.dpi
+
+ self._bbox_inches_restore = bbox_inches_restore
+
+ self._renderer = vector_renderer
+
+ def __getattr__(self, attr):
+ # Proxy everything that hasn't been overridden to the base
+ # renderer. Things that *are* overridden can call methods
+ # on self._renderer directly, but must not cache/store
+ # methods (because things like RendererAgg change their
+ # methods on the fly in order to optimise proxying down
+ # to the underlying C implementation).
+ return getattr(self._renderer, attr)
+
+ def start_rasterizing(self):
+ """
+ Enter "raster" mode. All subsequent drawing commands (until
+ `stop_rasterizing` is called) will be drawn with the raster backend.
+ """
+ # change the dpi of the figure temporarily.
+ self.figure.dpi = self.dpi
+ if self._bbox_inches_restore: # when tight bbox is used
+ r = process_figure_for_rasterizing(self.figure,
+ self._bbox_inches_restore)
+ self._bbox_inches_restore = r
+
+ self._raster_renderer = self._raster_renderer_class(
+ self._width*self.dpi, self._height*self.dpi, self.dpi)
+ self._renderer = self._raster_renderer
+
+ def stop_rasterizing(self):
+ """
+ Exit "raster" mode. All of the drawing that was done since
+ the last `start_rasterizing` call will be copied to the
+ vector backend by calling draw_image.
+ """
+
+ self._renderer = self._vector_renderer
+
+ height = self._height * self.dpi
+ img = np.asarray(self._raster_renderer.buffer_rgba())
+ slice_y, slice_x = cbook._get_nonzero_slices(img[..., 3])
+ cropped_img = img[slice_y, slice_x]
+ if cropped_img.size:
+ gc = self._renderer.new_gc()
+ # TODO: If the mixedmode resolution differs from the figure's
+ # dpi, the image must be scaled (dpi->_figdpi). Not all
+ # backends support this.
+ self._renderer.draw_image(
+ gc,
+ slice_x.start * self._figdpi / self.dpi,
+ (height - slice_y.stop) * self._figdpi / self.dpi,
+ cropped_img[::-1])
+ self._raster_renderer = None
+
+ # restore the figure dpi.
+ self.figure.dpi = self._figdpi
+
+ if self._bbox_inches_restore: # when tight bbox is used
+ r = process_figure_for_rasterizing(self.figure,
+ self._bbox_inches_restore,
+ self._figdpi)
+ self._bbox_inches_restore = r
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_nbagg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_nbagg.py
new file mode 100644
index 0000000000000000000000000000000000000000..4d18e1e9fb88bd89cf5146d2c3f48bf3a54c9bca
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_nbagg.py
@@ -0,0 +1,243 @@
+"""Interactive figures in the IPython notebook."""
+# Note: There is a notebook in
+# lib/matplotlib/backends/web_backend/nbagg_uat.ipynb to help verify
+# that changes made maintain expected behaviour.
+
+from base64 import b64encode
+import io
+import json
+import pathlib
+import uuid
+
+from ipykernel.comm import Comm
+from IPython.display import display, Javascript, HTML
+
+from matplotlib import is_interactive
+from matplotlib._pylab_helpers import Gcf
+from matplotlib.backend_bases import _Backend, CloseEvent, NavigationToolbar2
+from .backend_webagg_core import (
+ FigureCanvasWebAggCore, FigureManagerWebAgg, NavigationToolbar2WebAgg)
+from .backend_webagg_core import ( # noqa: F401 # pylint: disable=W0611
+ TimerTornado, TimerAsyncio)
+
+
+def connection_info():
+ """
+ Return a string showing the figure and connection status for the backend.
+
+ This is intended as a diagnostic tool, and not for general use.
+ """
+ result = [
+ '{fig} - {socket}'.format(
+ fig=(manager.canvas.figure.get_label()
+ or f"Figure {manager.num}"),
+ socket=manager.web_sockets)
+ for manager in Gcf.get_all_fig_managers()
+ ]
+ if not is_interactive():
+ result.append(f'Figures pending show: {len(Gcf.figs)}')
+ return '\n'.join(result)
+
+
+_FONT_AWESOME_CLASSES = { # font-awesome 4 names
+ 'home': 'fa fa-home',
+ 'back': 'fa fa-arrow-left',
+ 'forward': 'fa fa-arrow-right',
+ 'zoom_to_rect': 'fa fa-square-o',
+ 'move': 'fa fa-arrows',
+ 'download': 'fa fa-floppy-o',
+ None: None
+}
+
+
+class NavigationIPy(NavigationToolbar2WebAgg):
+
+ # Use the standard toolbar items + download button
+ toolitems = [(text, tooltip_text,
+ _FONT_AWESOME_CLASSES[image_file], name_of_method)
+ for text, tooltip_text, image_file, name_of_method
+ in (NavigationToolbar2.toolitems +
+ (('Download', 'Download plot', 'download', 'download'),))
+ if image_file in _FONT_AWESOME_CLASSES]
+
+
+class FigureManagerNbAgg(FigureManagerWebAgg):
+ _toolbar2_class = ToolbarCls = NavigationIPy
+
+ def __init__(self, canvas, num):
+ self._shown = False
+ super().__init__(canvas, num)
+
+ @classmethod
+ def create_with_canvas(cls, canvas_class, figure, num):
+ canvas = canvas_class(figure)
+ manager = cls(canvas, num)
+ if is_interactive():
+ manager.show()
+ canvas.draw_idle()
+
+ def destroy(event):
+ canvas.mpl_disconnect(cid)
+ Gcf.destroy(manager)
+
+ cid = canvas.mpl_connect('close_event', destroy)
+ return manager
+
+ def display_js(self):
+ # XXX How to do this just once? It has to deal with multiple
+ # browser instances using the same kernel (require.js - but the
+ # file isn't static?).
+ display(Javascript(FigureManagerNbAgg.get_javascript()))
+
+ def show(self):
+ if not self._shown:
+ self.display_js()
+ self._create_comm()
+ else:
+ self.canvas.draw_idle()
+ self._shown = True
+ # plt.figure adds an event which makes the figure in focus the active
+ # one. Disable this behaviour, as it results in figures being put as
+ # the active figure after they have been shown, even in non-interactive
+ # mode.
+ if hasattr(self, '_cidgcf'):
+ self.canvas.mpl_disconnect(self._cidgcf)
+ if not is_interactive():
+ from matplotlib._pylab_helpers import Gcf
+ Gcf.figs.pop(self.num, None)
+
+ def reshow(self):
+ """
+ A special method to re-show the figure in the notebook.
+
+ """
+ self._shown = False
+ self.show()
+
+ @property
+ def connected(self):
+ return bool(self.web_sockets)
+
+ @classmethod
+ def get_javascript(cls, stream=None):
+ if stream is None:
+ output = io.StringIO()
+ else:
+ output = stream
+ super().get_javascript(stream=output)
+ output.write((pathlib.Path(__file__).parent
+ / "web_backend/js/nbagg_mpl.js")
+ .read_text(encoding="utf-8"))
+ if stream is None:
+ return output.getvalue()
+
+ def _create_comm(self):
+ comm = CommSocket(self)
+ self.add_web_socket(comm)
+ return comm
+
+ def destroy(self):
+ self._send_event('close')
+ # need to copy comms as callbacks will modify this list
+ for comm in list(self.web_sockets):
+ comm.on_close()
+ self.clearup_closed()
+
+ def clearup_closed(self):
+ """Clear up any closed Comms."""
+ self.web_sockets = {socket for socket in self.web_sockets
+ if socket.is_open()}
+
+ if len(self.web_sockets) == 0:
+ CloseEvent("close_event", self.canvas)._process()
+
+ def remove_comm(self, comm_id):
+ self.web_sockets = {socket for socket in self.web_sockets
+ if socket.comm.comm_id != comm_id}
+
+
+class FigureCanvasNbAgg(FigureCanvasWebAggCore):
+ manager_class = FigureManagerNbAgg
+
+
+class CommSocket:
+ """
+ Manages the Comm connection between IPython and the browser (client).
+
+ Comms are 2 way, with the CommSocket being able to publish a message
+ via the send_json method, and handle a message with on_message. On the
+ JS side figure.send_message and figure.ws.onmessage do the sending and
+ receiving respectively.
+
+ """
+ def __init__(self, manager):
+ self.supports_binary = None
+ self.manager = manager
+ self.uuid = str(uuid.uuid4())
+ # Publish an output area with a unique ID. The javascript can then
+ # hook into this area.
+ display(HTML("
" % self.uuid))
+ try:
+ self.comm = Comm('matplotlib', data={'id': self.uuid})
+ except AttributeError as err:
+ raise RuntimeError('Unable to create an IPython notebook Comm '
+ 'instance. Are you in the IPython '
+ 'notebook?') from err
+ self.comm.on_msg(self.on_message)
+
+ manager = self.manager
+ self._ext_close = False
+
+ def _on_close(close_message):
+ self._ext_close = True
+ manager.remove_comm(close_message['content']['comm_id'])
+ manager.clearup_closed()
+
+ self.comm.on_close(_on_close)
+
+ def is_open(self):
+ return not (self._ext_close or self.comm._closed)
+
+ def on_close(self):
+ # When the socket is closed, deregister the websocket with
+ # the FigureManager.
+ if self.is_open():
+ try:
+ self.comm.close()
+ except KeyError:
+ # apparently already cleaned it up?
+ pass
+
+ def send_json(self, content):
+ self.comm.send({'data': json.dumps(content)})
+
+ def send_binary(self, blob):
+ if self.supports_binary:
+ self.comm.send({'blob': 'image/png'}, buffers=[blob])
+ else:
+ # The comm is ASCII, so we send the image in base64 encoded data
+ # URL form.
+ data = b64encode(blob).decode('ascii')
+ data_uri = f"data:image/png;base64,{data}"
+ self.comm.send({'data': data_uri})
+
+ def on_message(self, message):
+ # The 'supports_binary' message is relevant to the
+ # websocket itself. The other messages get passed along
+ # to matplotlib as-is.
+
+ # Every message has a "type" and a "figure_id".
+ message = json.loads(message['content']['data'])
+ if message['type'] == 'closing':
+ self.on_close()
+ self.manager.clearup_closed()
+ elif message['type'] == 'supports_binary':
+ self.supports_binary = message['value']
+ else:
+ self.manager.handle_json(message)
+
+
+@_Backend.export
+class _BackendNbAgg(_Backend):
+ FigureCanvas = FigureCanvasNbAgg
+ FigureManager = FigureManagerNbAgg
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_pdf.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_pdf.py
new file mode 100644
index 0000000000000000000000000000000000000000..c1c5eb8819bef049516f6228530419faf9ff5b4f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_pdf.py
@@ -0,0 +1,2806 @@
+"""
+A PDF Matplotlib backend.
+
+Author: Jouni K SeppƤnen and others.
+"""
+
+import codecs
+from datetime import timezone
+from datetime import datetime
+from enum import Enum
+from functools import total_ordering
+from io import BytesIO
+import itertools
+import logging
+import math
+import os
+import string
+import struct
+import sys
+import time
+import types
+import warnings
+import zlib
+
+import numpy as np
+from PIL import Image
+
+import matplotlib as mpl
+from matplotlib import _api, _text_helpers, _type1font, cbook, dviread
+from matplotlib._pylab_helpers import Gcf
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, GraphicsContextBase,
+ RendererBase)
+from matplotlib.backends.backend_mixed import MixedModeRenderer
+from matplotlib.figure import Figure
+from matplotlib.font_manager import get_font, fontManager as _fontManager
+from matplotlib._afm import AFM
+from matplotlib.ft2font import FT2Font, FaceFlags, Kerning, LoadFlags, StyleFlags
+from matplotlib.transforms import Affine2D, BboxBase
+from matplotlib.path import Path
+from matplotlib.dates import UTC
+from matplotlib import _path
+from . import _backend_pdf_ps
+
+_log = logging.getLogger(__name__)
+
+# Overview
+#
+# The low-level knowledge about pdf syntax lies mainly in the pdfRepr
+# function and the classes Reference, Name, Operator, and Stream. The
+# PdfFile class knows about the overall structure of pdf documents.
+# It provides a "write" method for writing arbitrary strings in the
+# file, and an "output" method that passes objects through the pdfRepr
+# function before writing them in the file. The output method is
+# called by the RendererPdf class, which contains the various draw_foo
+# methods. RendererPdf contains a GraphicsContextPdf instance, and
+# each draw_foo calls self.check_gc before outputting commands. This
+# method checks whether the pdf graphics state needs to be modified
+# and outputs the necessary commands. GraphicsContextPdf represents
+# the graphics state, and its "delta" method returns the commands that
+# modify the state.
+
+# Add "pdf.use14corefonts: True" in your configuration file to use only
+# the 14 PDF core fonts. These fonts do not need to be embedded; every
+# PDF viewing application is required to have them. This results in very
+# light PDF files you can use directly in LaTeX or ConTeXt documents
+# generated with pdfTeX, without any conversion.
+
+# These fonts are: Helvetica, Helvetica-Bold, Helvetica-Oblique,
+# Helvetica-BoldOblique, Courier, Courier-Bold, Courier-Oblique,
+# Courier-BoldOblique, Times-Roman, Times-Bold, Times-Italic,
+# Times-BoldItalic, Symbol, ZapfDingbats.
+#
+# Some tricky points:
+#
+# 1. The clip path can only be widened by popping from the state
+# stack. Thus the state must be pushed onto the stack before narrowing
+# the clip path. This is taken care of by GraphicsContextPdf.
+#
+# 2. Sometimes it is necessary to refer to something (e.g., font,
+# image, or extended graphics state, which contains the alpha value)
+# in the page stream by a name that needs to be defined outside the
+# stream. PdfFile provides the methods fontName, imageObject, and
+# alphaState for this purpose. The implementations of these methods
+# should perhaps be generalized.
+
+# TODOs:
+#
+# * encoding of fonts, including mathtext fonts and Unicode support
+# * TTF support has lots of small TODOs, e.g., how do you know if a font
+# is serif/sans-serif, or symbolic/non-symbolic?
+# * draw_quad_mesh
+
+
+def _fill(strings, linelen=75):
+ """
+ Make one string from sequence of strings, with whitespace in between.
+
+ The whitespace is chosen to form lines of at most *linelen* characters,
+ if possible.
+ """
+ currpos = 0
+ lasti = 0
+ result = []
+ for i, s in enumerate(strings):
+ length = len(s)
+ if currpos + length < linelen:
+ currpos += length + 1
+ else:
+ result.append(b' '.join(strings[lasti:i]))
+ lasti = i
+ currpos = length
+ result.append(b' '.join(strings[lasti:]))
+ return b'\n'.join(result)
+
+
+def _create_pdf_info_dict(backend, metadata):
+ """
+ Create a PDF infoDict based on user-supplied metadata.
+
+ A default ``Creator``, ``Producer``, and ``CreationDate`` are added, though
+ the user metadata may override it. The date may be the current time, or a
+ time set by the ``SOURCE_DATE_EPOCH`` environment variable.
+
+ Metadata is verified to have the correct keys and their expected types. Any
+ unknown keys/types will raise a warning.
+
+ Parameters
+ ----------
+ backend : str
+ The name of the backend to use in the Producer value.
+
+ metadata : dict[str, Union[str, datetime, Name]]
+ A dictionary of metadata supplied by the user with information
+ following the PDF specification, also defined in
+ `~.backend_pdf.PdfPages` below.
+
+ If any value is *None*, then the key will be removed. This can be used
+ to remove any pre-defined values.
+
+ Returns
+ -------
+ dict[str, Union[str, datetime, Name]]
+ A validated dictionary of metadata.
+ """
+
+ # get source date from SOURCE_DATE_EPOCH, if set
+ # See https://reproducible-builds.org/specs/source-date-epoch/
+ source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
+ if source_date_epoch:
+ source_date = datetime.fromtimestamp(int(source_date_epoch), timezone.utc)
+ source_date = source_date.replace(tzinfo=UTC)
+ else:
+ source_date = datetime.today()
+
+ info = {
+ 'Creator': f'Matplotlib v{mpl.__version__}, https://matplotlib.org',
+ 'Producer': f'Matplotlib {backend} backend v{mpl.__version__}',
+ 'CreationDate': source_date,
+ **metadata
+ }
+ info = {k: v for (k, v) in info.items() if v is not None}
+
+ def is_string_like(x):
+ return isinstance(x, str)
+ is_string_like.text_for_warning = "an instance of str"
+
+ def is_date(x):
+ return isinstance(x, datetime)
+ is_date.text_for_warning = "an instance of datetime.datetime"
+
+ def check_trapped(x):
+ if isinstance(x, Name):
+ return x.name in (b'True', b'False', b'Unknown')
+ else:
+ return x in ('True', 'False', 'Unknown')
+ check_trapped.text_for_warning = 'one of {"True", "False", "Unknown"}'
+
+ keywords = {
+ 'Title': is_string_like,
+ 'Author': is_string_like,
+ 'Subject': is_string_like,
+ 'Keywords': is_string_like,
+ 'Creator': is_string_like,
+ 'Producer': is_string_like,
+ 'CreationDate': is_date,
+ 'ModDate': is_date,
+ 'Trapped': check_trapped,
+ }
+ for k in info:
+ if k not in keywords:
+ _api.warn_external(f'Unknown infodict keyword: {k!r}. '
+ f'Must be one of {set(keywords)!r}.')
+ elif not keywords[k](info[k]):
+ _api.warn_external(f'Bad value for infodict keyword {k}. '
+ f'Got {info[k]!r} which is not '
+ f'{keywords[k].text_for_warning}.')
+ if 'Trapped' in info:
+ info['Trapped'] = Name(info['Trapped'])
+
+ return info
+
+
+def _datetime_to_pdf(d):
+ """
+ Convert a datetime to a PDF string representing it.
+
+ Used for PDF and PGF.
+ """
+ r = d.strftime('D:%Y%m%d%H%M%S')
+ z = d.utcoffset()
+ if z is not None:
+ z = z.seconds
+ else:
+ if time.daylight:
+ z = time.altzone
+ else:
+ z = time.timezone
+ if z == 0:
+ r += 'Z'
+ elif z < 0:
+ r += "+%02d'%02d'" % ((-z) // 3600, (-z) % 3600)
+ else:
+ r += "-%02d'%02d'" % (z // 3600, z % 3600)
+ return r
+
+
+def _calculate_quad_point_coordinates(x, y, width, height, angle=0):
+ """
+ Calculate the coordinates of rectangle when rotated by angle around x, y
+ """
+
+ angle = math.radians(-angle)
+ sin_angle = math.sin(angle)
+ cos_angle = math.cos(angle)
+ a = x + height * sin_angle
+ b = y + height * cos_angle
+ c = x + width * cos_angle + height * sin_angle
+ d = y - width * sin_angle + height * cos_angle
+ e = x + width * cos_angle
+ f = y - width * sin_angle
+ return ((x, y), (e, f), (c, d), (a, b))
+
+
+def _get_coordinates_of_block(x, y, width, height, angle=0):
+ """
+ Get the coordinates of rotated rectangle and rectangle that covers the
+ rotated rectangle.
+ """
+
+ vertices = _calculate_quad_point_coordinates(x, y, width,
+ height, angle)
+
+ # Find min and max values for rectangle
+ # adjust so that QuadPoints is inside Rect
+ # PDF docs says that QuadPoints should be ignored if any point lies
+ # outside Rect, but for Acrobat it is enough that QuadPoints is on the
+ # border of Rect.
+
+ pad = 0.00001 if angle % 90 else 0
+ min_x = min(v[0] for v in vertices) - pad
+ min_y = min(v[1] for v in vertices) - pad
+ max_x = max(v[0] for v in vertices) + pad
+ max_y = max(v[1] for v in vertices) + pad
+ return (tuple(itertools.chain.from_iterable(vertices)),
+ (min_x, min_y, max_x, max_y))
+
+
+def _get_link_annotation(gc, x, y, width, height, angle=0):
+ """
+ Create a link annotation object for embedding URLs.
+ """
+ quadpoints, rect = _get_coordinates_of_block(x, y, width, height, angle)
+ link_annotation = {
+ 'Type': Name('Annot'),
+ 'Subtype': Name('Link'),
+ 'Rect': rect,
+ 'Border': [0, 0, 0],
+ 'A': {
+ 'S': Name('URI'),
+ 'URI': gc.get_url(),
+ },
+ }
+ if angle % 90:
+ # Add QuadPoints
+ link_annotation['QuadPoints'] = quadpoints
+ return link_annotation
+
+
+# PDF strings are supposed to be able to include any eight-bit data, except
+# that unbalanced parens and backslashes must be escaped by a backslash.
+# However, sf bug #2708559 shows that the carriage return character may get
+# read as a newline; these characters correspond to \gamma and \Omega in TeX's
+# math font encoding. Escaping them fixes the bug.
+_str_escapes = str.maketrans({
+ '\\': '\\\\', '(': '\\(', ')': '\\)', '\n': '\\n', '\r': '\\r'})
+
+
+def pdfRepr(obj):
+ """Map Python objects to PDF syntax."""
+
+ # Some objects defined later have their own pdfRepr method.
+ if hasattr(obj, 'pdfRepr'):
+ return obj.pdfRepr()
+
+ # Floats. PDF does not have exponential notation (1.0e-10) so we
+ # need to use %f with some precision. Perhaps the precision
+ # should adapt to the magnitude of the number?
+ elif isinstance(obj, (float, np.floating)):
+ if not np.isfinite(obj):
+ raise ValueError("Can only output finite numbers in PDF")
+ r = b"%.10f" % obj
+ return r.rstrip(b'0').rstrip(b'.')
+
+ # Booleans. Needs to be tested before integers since
+ # isinstance(True, int) is true.
+ elif isinstance(obj, bool):
+ return [b'false', b'true'][obj]
+
+ # Integers are written as such.
+ elif isinstance(obj, (int, np.integer)):
+ return b"%d" % obj
+
+ # Non-ASCII Unicode strings are encoded in UTF-16BE with byte-order mark.
+ elif isinstance(obj, str):
+ return pdfRepr(obj.encode('ascii') if obj.isascii()
+ else codecs.BOM_UTF16_BE + obj.encode('UTF-16BE'))
+
+ # Strings are written in parentheses, with backslashes and parens
+ # escaped. Actually balanced parens are allowed, but it is
+ # simpler to escape them all. TODO: cut long strings into lines;
+ # I believe there is some maximum line length in PDF.
+ # Despite the extra decode/encode, translate is faster than regex.
+ elif isinstance(obj, bytes):
+ return (
+ b'(' +
+ obj.decode('latin-1').translate(_str_escapes).encode('latin-1')
+ + b')')
+
+ # Dictionaries. The keys must be PDF names, so if we find strings
+ # there, we make Name objects from them. The values may be
+ # anything, so the caller must ensure that PDF names are
+ # represented as Name objects.
+ elif isinstance(obj, dict):
+ return _fill([
+ b"<<",
+ *[Name(k).pdfRepr() + b" " + pdfRepr(v) for k, v in obj.items()],
+ b">>",
+ ])
+
+ # Lists.
+ elif isinstance(obj, (list, tuple)):
+ return _fill([b"[", *[pdfRepr(val) for val in obj], b"]"])
+
+ # The null keyword.
+ elif obj is None:
+ return b'null'
+
+ # A date.
+ elif isinstance(obj, datetime):
+ return pdfRepr(_datetime_to_pdf(obj))
+
+ # A bounding box
+ elif isinstance(obj, BboxBase):
+ return _fill([pdfRepr(val) for val in obj.bounds])
+
+ else:
+ raise TypeError(f"Don't know a PDF representation for {type(obj)} "
+ "objects")
+
+
+def _font_supports_glyph(fonttype, glyph):
+ """
+ Returns True if the font is able to provide codepoint *glyph* in a PDF.
+
+ For a Type 3 font, this method returns True only for single-byte
+ characters. For Type 42 fonts this method return True if the character is
+ from the Basic Multilingual Plane.
+ """
+ if fonttype == 3:
+ return glyph <= 255
+ if fonttype == 42:
+ return glyph <= 65535
+ raise NotImplementedError()
+
+
+class Reference:
+ """
+ PDF reference object.
+
+ Use PdfFile.reserveObject() to create References.
+ """
+
+ def __init__(self, id):
+ self.id = id
+
+ def __repr__(self):
+ return "" % self.id
+
+ def pdfRepr(self):
+ return b"%d 0 R" % self.id
+
+ def write(self, contents, file):
+ write = file.write
+ write(b"%d 0 obj\n" % self.id)
+ write(pdfRepr(contents))
+ write(b"\nendobj\n")
+
+
+@total_ordering
+class Name:
+ """PDF name object."""
+ __slots__ = ('name',)
+ _hexify = {c: '#%02x' % c
+ for c in {*range(256)} - {*range(ord('!'), ord('~') + 1)}}
+
+ def __init__(self, name):
+ if isinstance(name, Name):
+ self.name = name.name
+ else:
+ if isinstance(name, bytes):
+ name = name.decode('ascii')
+ self.name = name.translate(self._hexify).encode('ascii')
+
+ def __repr__(self):
+ return "" % self.name
+
+ def __str__(self):
+ return '/' + self.name.decode('ascii')
+
+ def __eq__(self, other):
+ return isinstance(other, Name) and self.name == other.name
+
+ def __lt__(self, other):
+ return isinstance(other, Name) and self.name < other.name
+
+ def __hash__(self):
+ return hash(self.name)
+
+ def pdfRepr(self):
+ return b'/' + self.name
+
+
+class Verbatim:
+ """Store verbatim PDF command content for later inclusion in the stream."""
+ def __init__(self, x):
+ self._x = x
+
+ def pdfRepr(self):
+ return self._x
+
+
+class Op(Enum):
+ """PDF operators (not an exhaustive list)."""
+
+ close_fill_stroke = b'b'
+ fill_stroke = b'B'
+ fill = b'f'
+ closepath = b'h'
+ close_stroke = b's'
+ stroke = b'S'
+ endpath = b'n'
+ begin_text = b'BT'
+ end_text = b'ET'
+ curveto = b'c'
+ rectangle = b're'
+ lineto = b'l'
+ moveto = b'm'
+ concat_matrix = b'cm'
+ use_xobject = b'Do'
+ setgray_stroke = b'G'
+ setgray_nonstroke = b'g'
+ setrgb_stroke = b'RG'
+ setrgb_nonstroke = b'rg'
+ setcolorspace_stroke = b'CS'
+ setcolorspace_nonstroke = b'cs'
+ setcolor_stroke = b'SCN'
+ setcolor_nonstroke = b'scn'
+ setdash = b'd'
+ setlinejoin = b'j'
+ setlinecap = b'J'
+ setgstate = b'gs'
+ gsave = b'q'
+ grestore = b'Q'
+ textpos = b'Td'
+ selectfont = b'Tf'
+ textmatrix = b'Tm'
+ show = b'Tj'
+ showkern = b'TJ'
+ setlinewidth = b'w'
+ clip = b'W'
+ shading = b'sh'
+
+ def pdfRepr(self):
+ return self.value
+
+ @classmethod
+ def paint_path(cls, fill, stroke):
+ """
+ Return the PDF operator to paint a path.
+
+ Parameters
+ ----------
+ fill : bool
+ Fill the path with the fill color.
+ stroke : bool
+ Stroke the outline of the path with the line color.
+ """
+ if stroke:
+ if fill:
+ return cls.fill_stroke
+ else:
+ return cls.stroke
+ else:
+ if fill:
+ return cls.fill
+ else:
+ return cls.endpath
+
+
+class Stream:
+ """
+ PDF stream object.
+
+ This has no pdfRepr method. Instead, call begin(), then output the
+ contents of the stream by calling write(), and finally call end().
+ """
+ __slots__ = ('id', 'len', 'pdfFile', 'file', 'compressobj', 'extra', 'pos')
+
+ def __init__(self, id, len, file, extra=None, png=None):
+ """
+ Parameters
+ ----------
+ id : int
+ Object id of the stream.
+ len : Reference or None
+ An unused Reference object for the length of the stream;
+ None means to use a memory buffer so the length can be inlined.
+ file : PdfFile
+ The underlying object to write the stream to.
+ extra : dict from Name to anything, or None
+ Extra key-value pairs to include in the stream header.
+ png : dict or None
+ If the data is already png encoded, the decode parameters.
+ """
+ self.id = id # object id
+ self.len = len # id of length object
+ self.pdfFile = file
+ self.file = file.fh # file to which the stream is written
+ self.compressobj = None # compression object
+ if extra is None:
+ self.extra = dict()
+ else:
+ self.extra = extra.copy()
+ if png is not None:
+ self.extra.update({'Filter': Name('FlateDecode'),
+ 'DecodeParms': png})
+
+ self.pdfFile.recordXref(self.id)
+ if mpl.rcParams['pdf.compression'] and not png:
+ self.compressobj = zlib.compressobj(
+ mpl.rcParams['pdf.compression'])
+ if self.len is None:
+ self.file = BytesIO()
+ else:
+ self._writeHeader()
+ self.pos = self.file.tell()
+
+ def _writeHeader(self):
+ write = self.file.write
+ write(b"%d 0 obj\n" % self.id)
+ dict = self.extra
+ dict['Length'] = self.len
+ if mpl.rcParams['pdf.compression']:
+ dict['Filter'] = Name('FlateDecode')
+
+ write(pdfRepr(dict))
+ write(b"\nstream\n")
+
+ def end(self):
+ """Finalize stream."""
+
+ self._flush()
+ if self.len is None:
+ contents = self.file.getvalue()
+ self.len = len(contents)
+ self.file = self.pdfFile.fh
+ self._writeHeader()
+ self.file.write(contents)
+ self.file.write(b"\nendstream\nendobj\n")
+ else:
+ length = self.file.tell() - self.pos
+ self.file.write(b"\nendstream\nendobj\n")
+ self.pdfFile.writeObject(self.len, length)
+
+ def write(self, data):
+ """Write some data on the stream."""
+
+ if self.compressobj is None:
+ self.file.write(data)
+ else:
+ compressed = self.compressobj.compress(data)
+ self.file.write(compressed)
+
+ def _flush(self):
+ """Flush the compression object."""
+
+ if self.compressobj is not None:
+ compressed = self.compressobj.flush()
+ self.file.write(compressed)
+ self.compressobj = None
+
+
+def _get_pdf_charprocs(font_path, glyph_ids):
+ font = get_font(font_path, hinting_factor=1)
+ conv = 1000 / font.units_per_EM # Conversion to PS units (1/1000's).
+ procs = {}
+ for glyph_id in glyph_ids:
+ g = font.load_glyph(glyph_id, LoadFlags.NO_SCALE)
+ # NOTE: We should be using round(), but instead use
+ # "(x+.5).astype(int)" to keep backcompat with the old ttconv code
+ # (this is different for negative x's).
+ d1 = (np.array([g.horiAdvance, 0, *g.bbox]) * conv + .5).astype(int)
+ v, c = font.get_path()
+ v = (v * 64).astype(int) # Back to TrueType's internal units (1/64's).
+ # Backcompat with old ttconv code: control points between two quads are
+ # omitted if they are exactly at the midpoint between the control of
+ # the quad before and the quad after, but ttconv used to interpolate
+ # *after* conversion to PS units, causing floating point errors. Here
+ # we reproduce ttconv's logic, detecting these "implicit" points and
+ # re-interpolating them. Note that occasionally (e.g. with DejaVu Sans
+ # glyph "0") a point detected as "implicit" is actually explicit, and
+ # will thus be shifted by 1.
+ quads, = np.nonzero(c == 3)
+ quads_on = quads[1::2]
+ quads_mid_on = np.array(
+ sorted({*quads_on} & {*(quads - 1)} & {*(quads + 1)}), int)
+ implicit = quads_mid_on[
+ (v[quads_mid_on] # As above, use astype(int), not // division
+ == ((v[quads_mid_on - 1] + v[quads_mid_on + 1]) / 2).astype(int))
+ .all(axis=1)]
+ if (font.postscript_name, glyph_id) in [
+ ("DejaVuSerif-Italic", 77), # j
+ ("DejaVuSerif-Italic", 135), # \AA
+ ]:
+ v[:, 0] -= 1 # Hard-coded backcompat (FreeType shifts glyph by 1).
+ v = (v * conv + .5).astype(int) # As above re: truncation vs rounding.
+ v[implicit] = (( # Fix implicit points; again, truncate.
+ (v[implicit - 1] + v[implicit + 1]) / 2).astype(int))
+ procs[font.get_glyph_name(glyph_id)] = (
+ " ".join(map(str, d1)).encode("ascii") + b" d1\n"
+ + _path.convert_to_string(
+ Path(v, c), None, None, False, None, -1,
+ # no code for quad Beziers triggers auto-conversion to cubics.
+ [b"m", b"l", b"", b"c", b"h"], True)
+ + b"f")
+ return procs
+
+
+class PdfFile:
+ """PDF file object."""
+
+ def __init__(self, filename, metadata=None):
+ """
+ Parameters
+ ----------
+ filename : str or path-like or file-like
+ Output target; if a string, a file will be opened for writing.
+
+ metadata : dict from strings to strings and dates
+ Information dictionary object (see PDF reference section 10.2.1
+ 'Document Information Dictionary'), e.g.:
+ ``{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}``.
+
+ The standard keys are 'Title', 'Author', 'Subject', 'Keywords',
+ 'Creator', 'Producer', 'CreationDate', 'ModDate', and
+ 'Trapped'. Values have been predefined for 'Creator', 'Producer'
+ and 'CreationDate'. They can be removed by setting them to `None`.
+ """
+ super().__init__()
+
+ self._object_seq = itertools.count(1) # consumed by reserveObject
+ self.xrefTable = [[0, 65535, 'the zero object']]
+ self.passed_in_file_object = False
+ self.original_file_like = None
+ self.tell_base = 0
+ fh, opened = cbook.to_filehandle(filename, "wb", return_opened=True)
+ if not opened:
+ try:
+ self.tell_base = filename.tell()
+ except OSError:
+ fh = BytesIO()
+ self.original_file_like = filename
+ else:
+ fh = filename
+ self.passed_in_file_object = True
+
+ self.fh = fh
+ self.currentstream = None # stream object to write to, if any
+ fh.write(b"%PDF-1.4\n") # 1.4 is the first version to have alpha
+ # Output some eight-bit chars as a comment so various utilities
+ # recognize the file as binary by looking at the first few
+ # lines (see note in section 3.4.1 of the PDF reference).
+ fh.write(b"%\254\334 \253\272\n")
+
+ self.rootObject = self.reserveObject('root')
+ self.pagesObject = self.reserveObject('pages')
+ self.pageList = []
+ self.fontObject = self.reserveObject('fonts')
+ self._extGStateObject = self.reserveObject('extended graphics states')
+ self.hatchObject = self.reserveObject('tiling patterns')
+ self.gouraudObject = self.reserveObject('Gouraud triangles')
+ self.XObjectObject = self.reserveObject('external objects')
+ self.resourceObject = self.reserveObject('resources')
+
+ root = {'Type': Name('Catalog'),
+ 'Pages': self.pagesObject}
+ self.writeObject(self.rootObject, root)
+
+ self.infoDict = _create_pdf_info_dict('pdf', metadata or {})
+
+ self.fontNames = {} # maps filenames to internal font names
+ self._internal_font_seq = (Name(f'F{i}') for i in itertools.count(1))
+ self.dviFontInfo = {} # maps dvi font names to embedding information
+ # differently encoded Type-1 fonts may share the same descriptor
+ self.type1Descriptors = {}
+ self._character_tracker = _backend_pdf_ps.CharacterTracker()
+
+ self.alphaStates = {} # maps alpha values to graphics state objects
+ self._alpha_state_seq = (Name(f'A{i}') for i in itertools.count(1))
+ self._soft_mask_states = {}
+ self._soft_mask_seq = (Name(f'SM{i}') for i in itertools.count(1))
+ self._soft_mask_groups = []
+ self._hatch_patterns = {}
+ self._hatch_pattern_seq = (Name(f'H{i}') for i in itertools.count(1))
+ self.gouraudTriangles = []
+
+ self._images = {}
+ self._image_seq = (Name(f'I{i}') for i in itertools.count(1))
+
+ self.markers = {}
+ self.multi_byte_charprocs = {}
+
+ self.paths = []
+
+ # A list of annotations for each page. Each entry is a tuple of the
+ # overall Annots object reference that's inserted into the page object,
+ # followed by a list of the actual annotations.
+ self._annotations = []
+ # For annotations added before a page is created; mostly for the
+ # purpose of newTextnote.
+ self.pageAnnotations = []
+
+ # The PDF spec recommends to include every procset
+ procsets = [Name(x) for x in "PDF Text ImageB ImageC ImageI".split()]
+
+ # Write resource dictionary.
+ # Possibly TODO: more general ExtGState (graphics state dictionaries)
+ # ColorSpace Pattern Shading Properties
+ resources = {'Font': self.fontObject,
+ 'XObject': self.XObjectObject,
+ 'ExtGState': self._extGStateObject,
+ 'Pattern': self.hatchObject,
+ 'Shading': self.gouraudObject,
+ 'ProcSet': procsets}
+ self.writeObject(self.resourceObject, resources)
+
+ def newPage(self, width, height):
+ self.endStream()
+
+ self.width, self.height = width, height
+ contentObject = self.reserveObject('page contents')
+ annotsObject = self.reserveObject('annotations')
+ thePage = {'Type': Name('Page'),
+ 'Parent': self.pagesObject,
+ 'Resources': self.resourceObject,
+ 'MediaBox': [0, 0, 72 * width, 72 * height],
+ 'Contents': contentObject,
+ 'Annots': annotsObject,
+ }
+ pageObject = self.reserveObject('page')
+ self.writeObject(pageObject, thePage)
+ self.pageList.append(pageObject)
+ self._annotations.append((annotsObject, self.pageAnnotations))
+
+ self.beginStream(contentObject.id,
+ self.reserveObject('length of content stream'))
+ # Initialize the pdf graphics state to match the default Matplotlib
+ # graphics context (colorspace and joinstyle).
+ self.output(Name('DeviceRGB'), Op.setcolorspace_stroke)
+ self.output(Name('DeviceRGB'), Op.setcolorspace_nonstroke)
+ self.output(GraphicsContextPdf.joinstyles['round'], Op.setlinejoin)
+
+ # Clear the list of annotations for the next page
+ self.pageAnnotations = []
+
+ def newTextnote(self, text, positionRect=[-100, -100, 0, 0]):
+ # Create a new annotation of type text
+ theNote = {'Type': Name('Annot'),
+ 'Subtype': Name('Text'),
+ 'Contents': text,
+ 'Rect': positionRect,
+ }
+ self.pageAnnotations.append(theNote)
+
+ def _get_subsetted_psname(self, ps_name, charmap):
+ def toStr(n, base):
+ if n < base:
+ return string.ascii_uppercase[n]
+ else:
+ return (
+ toStr(n // base, base) + string.ascii_uppercase[n % base]
+ )
+
+ # encode to string using base 26
+ hashed = hash(frozenset(charmap.keys())) % ((sys.maxsize + 1) * 2)
+ prefix = toStr(hashed, 26)
+
+ # get first 6 characters from prefix
+ return prefix[:6] + "+" + ps_name
+
+ def finalize(self):
+ """Write out the various deferred objects and the pdf end matter."""
+
+ self.endStream()
+ self._write_annotations()
+ self.writeFonts()
+ self.writeExtGSTates()
+ self._write_soft_mask_groups()
+ self.writeHatches()
+ self.writeGouraudTriangles()
+ xobjects = {
+ name: ob for image, name, ob in self._images.values()}
+ for tup in self.markers.values():
+ xobjects[tup[0]] = tup[1]
+ for name, value in self.multi_byte_charprocs.items():
+ xobjects[name] = value
+ for name, path, trans, ob, join, cap, padding, filled, stroked \
+ in self.paths:
+ xobjects[name] = ob
+ self.writeObject(self.XObjectObject, xobjects)
+ self.writeImages()
+ self.writeMarkers()
+ self.writePathCollectionTemplates()
+ self.writeObject(self.pagesObject,
+ {'Type': Name('Pages'),
+ 'Kids': self.pageList,
+ 'Count': len(self.pageList)})
+ self.writeInfoDict()
+
+ # Finalize the file
+ self.writeXref()
+ self.writeTrailer()
+
+ def close(self):
+ """Flush all buffers and free all resources."""
+
+ self.endStream()
+ if self.passed_in_file_object:
+ self.fh.flush()
+ else:
+ if self.original_file_like is not None:
+ self.original_file_like.write(self.fh.getvalue())
+ self.fh.close()
+
+ def write(self, data):
+ if self.currentstream is None:
+ self.fh.write(data)
+ else:
+ self.currentstream.write(data)
+
+ def output(self, *data):
+ self.write(_fill([pdfRepr(x) for x in data]))
+ self.write(b'\n')
+
+ def beginStream(self, id, len, extra=None, png=None):
+ assert self.currentstream is None
+ self.currentstream = Stream(id, len, self, extra, png)
+
+ def endStream(self):
+ if self.currentstream is not None:
+ self.currentstream.end()
+ self.currentstream = None
+
+ def outputStream(self, ref, data, *, extra=None):
+ self.beginStream(ref.id, None, extra)
+ self.currentstream.write(data)
+ self.endStream()
+
+ def _write_annotations(self):
+ for annotsObject, annotations in self._annotations:
+ self.writeObject(annotsObject, annotations)
+
+ def fontName(self, fontprop):
+ """
+ Select a font based on fontprop and return a name suitable for
+ Op.selectfont. If fontprop is a string, it will be interpreted
+ as the filename of the font.
+ """
+
+ if isinstance(fontprop, str):
+ filenames = [fontprop]
+ elif mpl.rcParams['pdf.use14corefonts']:
+ filenames = _fontManager._find_fonts_by_props(
+ fontprop, fontext='afm', directory=RendererPdf._afm_font_dir
+ )
+ else:
+ filenames = _fontManager._find_fonts_by_props(fontprop)
+ first_Fx = None
+ for fname in filenames:
+ Fx = self.fontNames.get(fname)
+ if not first_Fx:
+ first_Fx = Fx
+ if Fx is None:
+ Fx = next(self._internal_font_seq)
+ self.fontNames[fname] = Fx
+ _log.debug('Assigning font %s = %r', Fx, fname)
+ if not first_Fx:
+ first_Fx = Fx
+
+ # find_fontsprop's first value always adheres to
+ # findfont's value, so technically no behaviour change
+ return first_Fx
+
+ def dviFontName(self, dvifont):
+ """
+ Given a dvi font object, return a name suitable for Op.selectfont.
+ This registers the font information in ``self.dviFontInfo`` if not yet
+ registered.
+ """
+
+ dvi_info = self.dviFontInfo.get(dvifont.texname)
+ if dvi_info is not None:
+ return dvi_info.pdfname
+
+ tex_font_map = dviread.PsfontsMap(dviread.find_tex_file('pdftex.map'))
+ psfont = tex_font_map[dvifont.texname]
+ if psfont.filename is None:
+ raise ValueError(
+ "No usable font file found for {} (TeX: {}); "
+ "the font may lack a Type-1 version"
+ .format(psfont.psname, dvifont.texname))
+
+ pdfname = next(self._internal_font_seq)
+ _log.debug('Assigning font %s = %s (dvi)', pdfname, dvifont.texname)
+ self.dviFontInfo[dvifont.texname] = types.SimpleNamespace(
+ dvifont=dvifont,
+ pdfname=pdfname,
+ fontfile=psfont.filename,
+ basefont=psfont.psname,
+ encodingfile=psfont.encoding,
+ effects=psfont.effects)
+ return pdfname
+
+ def writeFonts(self):
+ fonts = {}
+ for dviname, info in sorted(self.dviFontInfo.items()):
+ Fx = info.pdfname
+ _log.debug('Embedding Type-1 font %s from dvi.', dviname)
+ fonts[Fx] = self._embedTeXFont(info)
+ for filename in sorted(self.fontNames):
+ Fx = self.fontNames[filename]
+ _log.debug('Embedding font %s.', filename)
+ if filename.endswith('.afm'):
+ # from pdf.use14corefonts
+ _log.debug('Writing AFM font.')
+ fonts[Fx] = self._write_afm_font(filename)
+ else:
+ # a normal TrueType font
+ _log.debug('Writing TrueType font.')
+ chars = self._character_tracker.used.get(filename)
+ if chars:
+ fonts[Fx] = self.embedTTF(filename, chars)
+ self.writeObject(self.fontObject, fonts)
+
+ def _write_afm_font(self, filename):
+ with open(filename, 'rb') as fh:
+ font = AFM(fh)
+ fontname = font.get_fontname()
+ fontdict = {'Type': Name('Font'),
+ 'Subtype': Name('Type1'),
+ 'BaseFont': Name(fontname),
+ 'Encoding': Name('WinAnsiEncoding')}
+ fontdictObject = self.reserveObject('font dictionary')
+ self.writeObject(fontdictObject, fontdict)
+ return fontdictObject
+
+ def _embedTeXFont(self, fontinfo):
+ _log.debug('Embedding TeX font %s - fontinfo=%s',
+ fontinfo.dvifont.texname, fontinfo.__dict__)
+
+ # Widths
+ widthsObject = self.reserveObject('font widths')
+ self.writeObject(widthsObject, fontinfo.dvifont.widths)
+
+ # Font dictionary
+ fontdictObject = self.reserveObject('font dictionary')
+ fontdict = {
+ 'Type': Name('Font'),
+ 'Subtype': Name('Type1'),
+ 'FirstChar': 0,
+ 'LastChar': len(fontinfo.dvifont.widths) - 1,
+ 'Widths': widthsObject,
+ }
+
+ # Encoding (if needed)
+ if fontinfo.encodingfile is not None:
+ fontdict['Encoding'] = {
+ 'Type': Name('Encoding'),
+ 'Differences': [
+ 0, *map(Name, dviread._parse_enc(fontinfo.encodingfile))],
+ }
+
+ # If no file is specified, stop short
+ if fontinfo.fontfile is None:
+ _log.warning(
+ "Because of TeX configuration (pdftex.map, see updmap option "
+ "pdftexDownloadBase14) the font %s is not embedded. This is "
+ "deprecated as of PDF 1.5 and it may cause the consumer "
+ "application to show something that was not intended.",
+ fontinfo.basefont)
+ fontdict['BaseFont'] = Name(fontinfo.basefont)
+ self.writeObject(fontdictObject, fontdict)
+ return fontdictObject
+
+ # We have a font file to embed - read it in and apply any effects
+ t1font = _type1font.Type1Font(fontinfo.fontfile)
+ if fontinfo.effects:
+ t1font = t1font.transform(fontinfo.effects)
+ fontdict['BaseFont'] = Name(t1font.prop['FontName'])
+
+ # Font descriptors may be shared between differently encoded
+ # Type-1 fonts, so only create a new descriptor if there is no
+ # existing descriptor for this font.
+ effects = (fontinfo.effects.get('slant', 0.0),
+ fontinfo.effects.get('extend', 1.0))
+ fontdesc = self.type1Descriptors.get((fontinfo.fontfile, effects))
+ if fontdesc is None:
+ fontdesc = self.createType1Descriptor(t1font, fontinfo.fontfile)
+ self.type1Descriptors[(fontinfo.fontfile, effects)] = fontdesc
+ fontdict['FontDescriptor'] = fontdesc
+
+ self.writeObject(fontdictObject, fontdict)
+ return fontdictObject
+
+ def createType1Descriptor(self, t1font, fontfile):
+ # Create and write the font descriptor and the font file
+ # of a Type-1 font
+ fontdescObject = self.reserveObject('font descriptor')
+ fontfileObject = self.reserveObject('font file')
+
+ italic_angle = t1font.prop['ItalicAngle']
+ fixed_pitch = t1font.prop['isFixedPitch']
+
+ flags = 0
+ # fixed width
+ if fixed_pitch:
+ flags |= 1 << 0
+ # TODO: serif
+ if 0:
+ flags |= 1 << 1
+ # TODO: symbolic (most TeX fonts are)
+ if 1:
+ flags |= 1 << 2
+ # non-symbolic
+ else:
+ flags |= 1 << 5
+ # italic
+ if italic_angle:
+ flags |= 1 << 6
+ # TODO: all caps
+ if 0:
+ flags |= 1 << 16
+ # TODO: small caps
+ if 0:
+ flags |= 1 << 17
+ # TODO: force bold
+ if 0:
+ flags |= 1 << 18
+
+ ft2font = get_font(fontfile)
+
+ descriptor = {
+ 'Type': Name('FontDescriptor'),
+ 'FontName': Name(t1font.prop['FontName']),
+ 'Flags': flags,
+ 'FontBBox': ft2font.bbox,
+ 'ItalicAngle': italic_angle,
+ 'Ascent': ft2font.ascender,
+ 'Descent': ft2font.descender,
+ 'CapHeight': 1000, # TODO: find this out
+ 'XHeight': 500, # TODO: this one too
+ 'FontFile': fontfileObject,
+ 'FontFamily': t1font.prop['FamilyName'],
+ 'StemV': 50, # TODO
+ # (see also revision 3874; but not all TeX distros have AFM files!)
+ # 'FontWeight': a number where 400 = Regular, 700 = Bold
+ }
+
+ self.writeObject(fontdescObject, descriptor)
+
+ self.outputStream(fontfileObject, b"".join(t1font.parts[:2]),
+ extra={'Length1': len(t1font.parts[0]),
+ 'Length2': len(t1font.parts[1]),
+ 'Length3': 0})
+
+ return fontdescObject
+
+ def _get_xobject_glyph_name(self, filename, glyph_name):
+ Fx = self.fontName(filename)
+ return "-".join([
+ Fx.name.decode(),
+ os.path.splitext(os.path.basename(filename))[0],
+ glyph_name])
+
+ _identityToUnicodeCMap = b"""/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (Adobe)
+ /Ordering (UCS)
+ /Supplement 0
+>> def
+/CMapName /Adobe-Identity-UCS def
+/CMapType 2 def
+1 begincodespacerange
+<0000>
+endcodespacerange
+%d beginbfrange
+%s
+endbfrange
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end"""
+
+ def embedTTF(self, filename, characters):
+ """Embed the TTF font from the named file into the document."""
+
+ font = get_font(filename)
+ fonttype = mpl.rcParams['pdf.fonttype']
+
+ def cvt(length, upe=font.units_per_EM, nearest=True):
+ """Convert font coordinates to PDF glyph coordinates."""
+ value = length / upe * 1000
+ if nearest:
+ return round(value)
+ # Best(?) to round away from zero for bounding boxes and the like.
+ if value < 0:
+ return math.floor(value)
+ else:
+ return math.ceil(value)
+
+ def embedTTFType3(font, characters, descriptor):
+ """The Type 3-specific part of embedding a Truetype font"""
+ widthsObject = self.reserveObject('font widths')
+ fontdescObject = self.reserveObject('font descriptor')
+ fontdictObject = self.reserveObject('font dictionary')
+ charprocsObject = self.reserveObject('character procs')
+ differencesArray = []
+ firstchar, lastchar = 0, 255
+ bbox = [cvt(x, nearest=False) for x in font.bbox]
+
+ fontdict = {
+ 'Type': Name('Font'),
+ 'BaseFont': ps_name,
+ 'FirstChar': firstchar,
+ 'LastChar': lastchar,
+ 'FontDescriptor': fontdescObject,
+ 'Subtype': Name('Type3'),
+ 'Name': descriptor['FontName'],
+ 'FontBBox': bbox,
+ 'FontMatrix': [.001, 0, 0, .001, 0, 0],
+ 'CharProcs': charprocsObject,
+ 'Encoding': {
+ 'Type': Name('Encoding'),
+ 'Differences': differencesArray},
+ 'Widths': widthsObject
+ }
+
+ from encodings import cp1252
+
+ # Make the "Widths" array
+ def get_char_width(charcode):
+ s = ord(cp1252.decoding_table[charcode])
+ width = font.load_char(
+ s, flags=LoadFlags.NO_SCALE | LoadFlags.NO_HINTING).horiAdvance
+ return cvt(width)
+ with warnings.catch_warnings():
+ # Ignore 'Required glyph missing from current font' warning
+ # from ft2font: here we're just building the widths table, but
+ # the missing glyphs may not even be used in the actual string.
+ warnings.filterwarnings("ignore")
+ widths = [get_char_width(charcode)
+ for charcode in range(firstchar, lastchar+1)]
+ descriptor['MaxWidth'] = max(widths)
+
+ # Make the "Differences" array, sort the ccodes < 255 from
+ # the multi-byte ccodes, and build the whole set of glyph ids
+ # that we need from this font.
+ glyph_ids = []
+ differences = []
+ multi_byte_chars = set()
+ for c in characters:
+ ccode = c
+ gind = font.get_char_index(ccode)
+ glyph_ids.append(gind)
+ glyph_name = font.get_glyph_name(gind)
+ if ccode <= 255:
+ differences.append((ccode, glyph_name))
+ else:
+ multi_byte_chars.add(glyph_name)
+ differences.sort()
+
+ last_c = -2
+ for c, name in differences:
+ if c != last_c + 1:
+ differencesArray.append(c)
+ differencesArray.append(Name(name))
+ last_c = c
+
+ # Make the charprocs array.
+ rawcharprocs = _get_pdf_charprocs(filename, glyph_ids)
+ charprocs = {}
+ for charname in sorted(rawcharprocs):
+ stream = rawcharprocs[charname]
+ charprocDict = {}
+ # The 2-byte characters are used as XObjects, so they
+ # need extra info in their dictionary
+ if charname in multi_byte_chars:
+ charprocDict = {'Type': Name('XObject'),
+ 'Subtype': Name('Form'),
+ 'BBox': bbox}
+ # Each glyph includes bounding box information,
+ # but xpdf and ghostscript can't handle it in a
+ # Form XObject (they segfault!!!), so we remove it
+ # from the stream here. It's not needed anyway,
+ # since the Form XObject includes it in its BBox
+ # value.
+ stream = stream[stream.find(b"d1") + 2:]
+ charprocObject = self.reserveObject('charProc')
+ self.outputStream(charprocObject, stream, extra=charprocDict)
+
+ # Send the glyphs with ccode > 255 to the XObject dictionary,
+ # and the others to the font itself
+ if charname in multi_byte_chars:
+ name = self._get_xobject_glyph_name(filename, charname)
+ self.multi_byte_charprocs[name] = charprocObject
+ else:
+ charprocs[charname] = charprocObject
+
+ # Write everything out
+ self.writeObject(fontdictObject, fontdict)
+ self.writeObject(fontdescObject, descriptor)
+ self.writeObject(widthsObject, widths)
+ self.writeObject(charprocsObject, charprocs)
+
+ return fontdictObject
+
+ def embedTTFType42(font, characters, descriptor):
+ """The Type 42-specific part of embedding a Truetype font"""
+ fontdescObject = self.reserveObject('font descriptor')
+ cidFontDictObject = self.reserveObject('CID font dictionary')
+ type0FontDictObject = self.reserveObject('Type 0 font dictionary')
+ cidToGidMapObject = self.reserveObject('CIDToGIDMap stream')
+ fontfileObject = self.reserveObject('font file stream')
+ wObject = self.reserveObject('Type 0 widths')
+ toUnicodeMapObject = self.reserveObject('ToUnicode map')
+
+ subset_str = "".join(chr(c) for c in characters)
+ _log.debug("SUBSET %s characters: %s", filename, subset_str)
+ with _backend_pdf_ps.get_glyphs_subset(filename, subset_str) as subset:
+ fontdata = _backend_pdf_ps.font_as_file(subset)
+ _log.debug(
+ "SUBSET %s %d -> %d", filename,
+ os.stat(filename).st_size, fontdata.getbuffer().nbytes
+ )
+
+ # We need this ref for XObjects
+ full_font = font
+
+ # reload the font object from the subset
+ # (all the necessary data could probably be obtained directly
+ # using fontLib.ttLib)
+ font = FT2Font(fontdata)
+
+ cidFontDict = {
+ 'Type': Name('Font'),
+ 'Subtype': Name('CIDFontType2'),
+ 'BaseFont': ps_name,
+ 'CIDSystemInfo': {
+ 'Registry': 'Adobe',
+ 'Ordering': 'Identity',
+ 'Supplement': 0},
+ 'FontDescriptor': fontdescObject,
+ 'W': wObject,
+ 'CIDToGIDMap': cidToGidMapObject
+ }
+
+ type0FontDict = {
+ 'Type': Name('Font'),
+ 'Subtype': Name('Type0'),
+ 'BaseFont': ps_name,
+ 'Encoding': Name('Identity-H'),
+ 'DescendantFonts': [cidFontDictObject],
+ 'ToUnicode': toUnicodeMapObject
+ }
+
+ # Make fontfile stream
+ descriptor['FontFile2'] = fontfileObject
+ self.outputStream(
+ fontfileObject, fontdata.getvalue(),
+ extra={'Length1': fontdata.getbuffer().nbytes})
+
+ # Make the 'W' (Widths) array, CidToGidMap and ToUnicode CMap
+ # at the same time
+ cid_to_gid_map = ['\0'] * 65536
+ widths = []
+ max_ccode = 0
+ for c in characters:
+ ccode = c
+ gind = font.get_char_index(ccode)
+ glyph = font.load_char(ccode,
+ flags=LoadFlags.NO_SCALE | LoadFlags.NO_HINTING)
+ widths.append((ccode, cvt(glyph.horiAdvance)))
+ if ccode < 65536:
+ cid_to_gid_map[ccode] = chr(gind)
+ max_ccode = max(ccode, max_ccode)
+ widths.sort()
+ cid_to_gid_map = cid_to_gid_map[:max_ccode + 1]
+
+ last_ccode = -2
+ w = []
+ max_width = 0
+ unicode_groups = []
+ for ccode, width in widths:
+ if ccode != last_ccode + 1:
+ w.append(ccode)
+ w.append([width])
+ unicode_groups.append([ccode, ccode])
+ else:
+ w[-1].append(width)
+ unicode_groups[-1][1] = ccode
+ max_width = max(max_width, width)
+ last_ccode = ccode
+
+ unicode_bfrange = []
+ for start, end in unicode_groups:
+ # Ensure the CID map contains only chars from BMP
+ if start > 65535:
+ continue
+ end = min(65535, end)
+
+ unicode_bfrange.append(
+ b"<%04x> <%04x> [%s]" %
+ (start, end,
+ b" ".join(b"<%04x>" % x for x in range(start, end+1))))
+ unicode_cmap = (self._identityToUnicodeCMap %
+ (len(unicode_groups), b"\n".join(unicode_bfrange)))
+
+ # Add XObjects for unsupported chars
+ glyph_ids = []
+ for ccode in characters:
+ if not _font_supports_glyph(fonttype, ccode):
+ gind = full_font.get_char_index(ccode)
+ glyph_ids.append(gind)
+
+ bbox = [cvt(x, nearest=False) for x in full_font.bbox]
+ rawcharprocs = _get_pdf_charprocs(filename, glyph_ids)
+ for charname in sorted(rawcharprocs):
+ stream = rawcharprocs[charname]
+ charprocDict = {'Type': Name('XObject'),
+ 'Subtype': Name('Form'),
+ 'BBox': bbox}
+ # Each glyph includes bounding box information,
+ # but xpdf and ghostscript can't handle it in a
+ # Form XObject (they segfault!!!), so we remove it
+ # from the stream here. It's not needed anyway,
+ # since the Form XObject includes it in its BBox
+ # value.
+ stream = stream[stream.find(b"d1") + 2:]
+ charprocObject = self.reserveObject('charProc')
+ self.outputStream(charprocObject, stream, extra=charprocDict)
+
+ name = self._get_xobject_glyph_name(filename, charname)
+ self.multi_byte_charprocs[name] = charprocObject
+
+ # CIDToGIDMap stream
+ cid_to_gid_map = "".join(cid_to_gid_map).encode("utf-16be")
+ self.outputStream(cidToGidMapObject, cid_to_gid_map)
+
+ # ToUnicode CMap
+ self.outputStream(toUnicodeMapObject, unicode_cmap)
+
+ descriptor['MaxWidth'] = max_width
+
+ # Write everything out
+ self.writeObject(cidFontDictObject, cidFontDict)
+ self.writeObject(type0FontDictObject, type0FontDict)
+ self.writeObject(fontdescObject, descriptor)
+ self.writeObject(wObject, w)
+
+ return type0FontDictObject
+
+ # Beginning of main embedTTF function...
+
+ ps_name = self._get_subsetted_psname(
+ font.postscript_name,
+ font.get_charmap()
+ )
+ ps_name = ps_name.encode('ascii', 'replace')
+ ps_name = Name(ps_name)
+ pclt = font.get_sfnt_table('pclt') or {'capHeight': 0, 'xHeight': 0}
+ post = font.get_sfnt_table('post') or {'italicAngle': (0, 0)}
+ ff = font.face_flags
+ sf = font.style_flags
+
+ flags = 0
+ symbolic = False # ps_name.name in ('Cmsy10', 'Cmmi10', 'Cmex10')
+ if FaceFlags.FIXED_WIDTH in ff:
+ flags |= 1 << 0
+ if 0: # TODO: serif
+ flags |= 1 << 1
+ if symbolic:
+ flags |= 1 << 2
+ else:
+ flags |= 1 << 5
+ if StyleFlags.ITALIC in sf:
+ flags |= 1 << 6
+ if 0: # TODO: all caps
+ flags |= 1 << 16
+ if 0: # TODO: small caps
+ flags |= 1 << 17
+ if 0: # TODO: force bold
+ flags |= 1 << 18
+
+ descriptor = {
+ 'Type': Name('FontDescriptor'),
+ 'FontName': ps_name,
+ 'Flags': flags,
+ 'FontBBox': [cvt(x, nearest=False) for x in font.bbox],
+ 'Ascent': cvt(font.ascender, nearest=False),
+ 'Descent': cvt(font.descender, nearest=False),
+ 'CapHeight': cvt(pclt['capHeight'], nearest=False),
+ 'XHeight': cvt(pclt['xHeight']),
+ 'ItalicAngle': post['italicAngle'][1], # ???
+ 'StemV': 0 # ???
+ }
+
+ if fonttype == 3:
+ return embedTTFType3(font, characters, descriptor)
+ elif fonttype == 42:
+ return embedTTFType42(font, characters, descriptor)
+
+ def alphaState(self, alpha):
+ """Return name of an ExtGState that sets alpha to the given value."""
+
+ state = self.alphaStates.get(alpha, None)
+ if state is not None:
+ return state[0]
+
+ name = next(self._alpha_state_seq)
+ self.alphaStates[alpha] = \
+ (name, {'Type': Name('ExtGState'),
+ 'CA': alpha[0], 'ca': alpha[1]})
+ return name
+
+ def _soft_mask_state(self, smask):
+ """
+ Return an ExtGState that sets the soft mask to the given shading.
+
+ Parameters
+ ----------
+ smask : Reference
+ Reference to a shading in DeviceGray color space, whose luminosity
+ is to be used as the alpha channel.
+
+ Returns
+ -------
+ Name
+ """
+
+ state = self._soft_mask_states.get(smask, None)
+ if state is not None:
+ return state[0]
+
+ name = next(self._soft_mask_seq)
+ groupOb = self.reserveObject('transparency group for soft mask')
+ self._soft_mask_states[smask] = (
+ name,
+ {
+ 'Type': Name('ExtGState'),
+ 'AIS': False,
+ 'SMask': {
+ 'Type': Name('Mask'),
+ 'S': Name('Luminosity'),
+ 'BC': [1],
+ 'G': groupOb
+ }
+ }
+ )
+ self._soft_mask_groups.append((
+ groupOb,
+ {
+ 'Type': Name('XObject'),
+ 'Subtype': Name('Form'),
+ 'FormType': 1,
+ 'Group': {
+ 'S': Name('Transparency'),
+ 'CS': Name('DeviceGray')
+ },
+ 'Matrix': [1, 0, 0, 1, 0, 0],
+ 'Resources': {'Shading': {'S': smask}},
+ 'BBox': [0, 0, 1, 1]
+ },
+ [Name('S'), Op.shading]
+ ))
+ return name
+
+ def writeExtGSTates(self):
+ self.writeObject(
+ self._extGStateObject,
+ dict([
+ *self.alphaStates.values(),
+ *self._soft_mask_states.values()
+ ])
+ )
+
+ def _write_soft_mask_groups(self):
+ for ob, attributes, content in self._soft_mask_groups:
+ self.beginStream(ob.id, None, attributes)
+ self.output(*content)
+ self.endStream()
+
+ def hatchPattern(self, hatch_style):
+ # The colors may come in as numpy arrays, which aren't hashable
+ edge, face, hatch, lw = hatch_style
+ if edge is not None:
+ edge = tuple(edge)
+ if face is not None:
+ face = tuple(face)
+ hatch_style = (edge, face, hatch, lw)
+
+ pattern = self._hatch_patterns.get(hatch_style, None)
+ if pattern is not None:
+ return pattern
+
+ name = next(self._hatch_pattern_seq)
+ self._hatch_patterns[hatch_style] = name
+ return name
+
+ hatchPatterns = _api.deprecated("3.10")(property(lambda self: {
+ k: (e, f, h) for k, (e, f, h, l) in self._hatch_patterns.items()
+ }))
+
+ def writeHatches(self):
+ hatchDict = dict()
+ sidelen = 72.0
+ for hatch_style, name in self._hatch_patterns.items():
+ ob = self.reserveObject('hatch pattern')
+ hatchDict[name] = ob
+ res = {'Procsets':
+ [Name(x) for x in "PDF Text ImageB ImageC ImageI".split()]}
+ self.beginStream(
+ ob.id, None,
+ {'Type': Name('Pattern'),
+ 'PatternType': 1, 'PaintType': 1, 'TilingType': 1,
+ 'BBox': [0, 0, sidelen, sidelen],
+ 'XStep': sidelen, 'YStep': sidelen,
+ 'Resources': res,
+ # Change origin to match Agg at top-left.
+ 'Matrix': [1, 0, 0, 1, 0, self.height * 72]})
+
+ stroke_rgb, fill_rgb, hatch, lw = hatch_style
+ self.output(stroke_rgb[0], stroke_rgb[1], stroke_rgb[2],
+ Op.setrgb_stroke)
+ if fill_rgb is not None:
+ self.output(fill_rgb[0], fill_rgb[1], fill_rgb[2],
+ Op.setrgb_nonstroke,
+ 0, 0, sidelen, sidelen, Op.rectangle,
+ Op.fill)
+
+ self.output(lw, Op.setlinewidth)
+
+ self.output(*self.pathOperations(
+ Path.hatch(hatch),
+ Affine2D().scale(sidelen),
+ simplify=False))
+ self.output(Op.fill_stroke)
+
+ self.endStream()
+ self.writeObject(self.hatchObject, hatchDict)
+
+ def addGouraudTriangles(self, points, colors):
+ """
+ Add a Gouraud triangle shading.
+
+ Parameters
+ ----------
+ points : np.ndarray
+ Triangle vertices, shape (n, 3, 2)
+ where n = number of triangles, 3 = vertices, 2 = x, y.
+ colors : np.ndarray
+ Vertex colors, shape (n, 3, 1) or (n, 3, 4)
+ as with points, but last dimension is either (gray,)
+ or (r, g, b, alpha).
+
+ Returns
+ -------
+ Name, Reference
+ """
+ name = Name('GT%d' % len(self.gouraudTriangles))
+ ob = self.reserveObject(f'Gouraud triangle {name}')
+ self.gouraudTriangles.append((name, ob, points, colors))
+ return name, ob
+
+ def writeGouraudTriangles(self):
+ gouraudDict = dict()
+ for name, ob, points, colors in self.gouraudTriangles:
+ gouraudDict[name] = ob
+ shape = points.shape
+ flat_points = points.reshape((shape[0] * shape[1], 2))
+ colordim = colors.shape[2]
+ assert colordim in (1, 4)
+ flat_colors = colors.reshape((shape[0] * shape[1], colordim))
+ if colordim == 4:
+ # strip the alpha channel
+ colordim = 3
+ points_min = np.min(flat_points, axis=0) - (1 << 8)
+ points_max = np.max(flat_points, axis=0) + (1 << 8)
+ factor = 0xffffffff / (points_max - points_min)
+
+ self.beginStream(
+ ob.id, None,
+ {'ShadingType': 4,
+ 'BitsPerCoordinate': 32,
+ 'BitsPerComponent': 8,
+ 'BitsPerFlag': 8,
+ 'ColorSpace': Name(
+ 'DeviceRGB' if colordim == 3 else 'DeviceGray'
+ ),
+ 'AntiAlias': False,
+ 'Decode': ([points_min[0], points_max[0],
+ points_min[1], points_max[1]]
+ + [0, 1] * colordim),
+ })
+
+ streamarr = np.empty(
+ (shape[0] * shape[1],),
+ dtype=[('flags', 'u1'),
+ ('points', '>u4', (2,)),
+ ('colors', 'u1', (colordim,))])
+ streamarr['flags'] = 0
+ streamarr['points'] = (flat_points - points_min) * factor
+ streamarr['colors'] = flat_colors[:, :colordim] * 255.0
+
+ self.write(streamarr.tobytes())
+ self.endStream()
+ self.writeObject(self.gouraudObject, gouraudDict)
+
+ def imageObject(self, image):
+ """Return name of an image XObject representing the given image."""
+
+ entry = self._images.get(id(image), None)
+ if entry is not None:
+ return entry[1]
+
+ name = next(self._image_seq)
+ ob = self.reserveObject(f'image {name}')
+ self._images[id(image)] = (image, name, ob)
+ return name
+
+ def _unpack(self, im):
+ """
+ Unpack image array *im* into ``(data, alpha)``, which have shape
+ ``(height, width, 3)`` (RGB) or ``(height, width, 1)`` (grayscale or
+ alpha), except that alpha is None if the image is fully opaque.
+ """
+ im = im[::-1]
+ if im.ndim == 2:
+ return im, None
+ else:
+ rgb = im[:, :, :3]
+ rgb = np.array(rgb, order='C')
+ # PDF needs a separate alpha image
+ if im.shape[2] == 4:
+ alpha = im[:, :, 3][..., None]
+ if np.all(alpha == 255):
+ alpha = None
+ else:
+ alpha = np.array(alpha, order='C')
+ else:
+ alpha = None
+ return rgb, alpha
+
+ def _writePng(self, img):
+ """
+ Write the image *img* into the pdf file using png
+ predictors with Flate compression.
+ """
+ buffer = BytesIO()
+ img.save(buffer, format="png")
+ buffer.seek(8)
+ png_data = b''
+ bit_depth = palette = None
+ while True:
+ length, type = struct.unpack(b'!L4s', buffer.read(8))
+ if type in [b'IHDR', b'PLTE', b'IDAT']:
+ data = buffer.read(length)
+ if len(data) != length:
+ raise RuntimeError("truncated data")
+ if type == b'IHDR':
+ bit_depth = int(data[8])
+ elif type == b'PLTE':
+ palette = data
+ elif type == b'IDAT':
+ png_data += data
+ elif type == b'IEND':
+ break
+ else:
+ buffer.seek(length, 1)
+ buffer.seek(4, 1) # skip CRC
+ return png_data, bit_depth, palette
+
+ def _writeImg(self, data, id, smask=None):
+ """
+ Write the image *data*, of shape ``(height, width, 1)`` (grayscale) or
+ ``(height, width, 3)`` (RGB), as pdf object *id* and with the soft mask
+ (alpha channel) *smask*, which should be either None or a ``(height,
+ width, 1)`` array.
+ """
+ height, width, color_channels = data.shape
+ obj = {'Type': Name('XObject'),
+ 'Subtype': Name('Image'),
+ 'Width': width,
+ 'Height': height,
+ 'ColorSpace': Name({1: 'DeviceGray', 3: 'DeviceRGB'}[color_channels]),
+ 'BitsPerComponent': 8}
+ if smask:
+ obj['SMask'] = smask
+ if mpl.rcParams['pdf.compression']:
+ if data.shape[-1] == 1:
+ data = data.squeeze(axis=-1)
+ png = {'Predictor': 10, 'Colors': color_channels, 'Columns': width}
+ img = Image.fromarray(data)
+ img_colors = img.getcolors(maxcolors=256)
+ if color_channels == 3 and img_colors is not None:
+ # Convert to indexed color if there are 256 colors or fewer. This can
+ # significantly reduce the file size.
+ num_colors = len(img_colors)
+ palette = np.array([comp for _, color in img_colors for comp in color],
+ dtype=np.uint8)
+ palette24 = ((palette[0::3].astype(np.uint32) << 16) |
+ (palette[1::3].astype(np.uint32) << 8) |
+ palette[2::3])
+ rgb24 = ((data[:, :, 0].astype(np.uint32) << 16) |
+ (data[:, :, 1].astype(np.uint32) << 8) |
+ data[:, :, 2])
+ indices = np.argsort(palette24).astype(np.uint8)
+ rgb8 = indices[np.searchsorted(palette24, rgb24, sorter=indices)]
+ img = Image.fromarray(rgb8, mode='P')
+ img.putpalette(palette)
+ png_data, bit_depth, palette = self._writePng(img)
+ if bit_depth is None or palette is None:
+ raise RuntimeError("invalid PNG header")
+ palette = palette[:num_colors * 3] # Trim padding; remove for Pillow>=9
+ obj['ColorSpace'] = [Name('Indexed'), Name('DeviceRGB'),
+ num_colors - 1, palette]
+ obj['BitsPerComponent'] = bit_depth
+ png['Colors'] = 1
+ png['BitsPerComponent'] = bit_depth
+ else:
+ png_data, _, _ = self._writePng(img)
+ else:
+ png = None
+ self.beginStream(
+ id,
+ self.reserveObject('length of image stream'),
+ obj,
+ png=png
+ )
+ if png:
+ self.currentstream.write(png_data)
+ else:
+ self.currentstream.write(data.tobytes())
+ self.endStream()
+
+ def writeImages(self):
+ for img, name, ob in self._images.values():
+ data, adata = self._unpack(img)
+ if adata is not None:
+ smaskObject = self.reserveObject("smask")
+ self._writeImg(adata, smaskObject.id)
+ else:
+ smaskObject = None
+ self._writeImg(data, ob.id, smaskObject)
+
+ def markerObject(self, path, trans, fill, stroke, lw, joinstyle,
+ capstyle):
+ """Return name of a marker XObject representing the given path."""
+ # self.markers used by markerObject, writeMarkers, close:
+ # mapping from (path operations, fill?, stroke?) to
+ # [name, object reference, bounding box, linewidth]
+ # This enables different draw_markers calls to share the XObject
+ # if the gc is sufficiently similar: colors etc can vary, but
+ # the choices of whether to fill and whether to stroke cannot.
+ # We need a bounding box enclosing all of the XObject path,
+ # but since line width may vary, we store the maximum of all
+ # occurring line widths in self.markers.
+ # close() is somewhat tightly coupled in that it expects the
+ # first two components of each value in self.markers to be the
+ # name and object reference.
+ pathops = self.pathOperations(path, trans, simplify=False)
+ key = (tuple(pathops), bool(fill), bool(stroke), joinstyle, capstyle)
+ result = self.markers.get(key)
+ if result is None:
+ name = Name('M%d' % len(self.markers))
+ ob = self.reserveObject('marker %d' % len(self.markers))
+ bbox = path.get_extents(trans)
+ self.markers[key] = [name, ob, bbox, lw]
+ else:
+ if result[-1] < lw:
+ result[-1] = lw
+ name = result[0]
+ return name
+
+ def writeMarkers(self):
+ for ((pathops, fill, stroke, joinstyle, capstyle),
+ (name, ob, bbox, lw)) in self.markers.items():
+ # bbox wraps the exact limits of the control points, so half a line
+ # will appear outside it. If the join style is miter and the line
+ # is not parallel to the edge, then the line will extend even
+ # further. From the PDF specification, Section 8.4.3.5, the miter
+ # limit is miterLength / lineWidth and from Table 52, the default
+ # is 10. With half the miter length outside, that works out to the
+ # following padding:
+ bbox = bbox.padded(lw * 5)
+ self.beginStream(
+ ob.id, None,
+ {'Type': Name('XObject'), 'Subtype': Name('Form'),
+ 'BBox': list(bbox.extents)})
+ self.output(GraphicsContextPdf.joinstyles[joinstyle],
+ Op.setlinejoin)
+ self.output(GraphicsContextPdf.capstyles[capstyle], Op.setlinecap)
+ self.output(*pathops)
+ self.output(Op.paint_path(fill, stroke))
+ self.endStream()
+
+ def pathCollectionObject(self, gc, path, trans, padding, filled, stroked):
+ name = Name('P%d' % len(self.paths))
+ ob = self.reserveObject('path %d' % len(self.paths))
+ self.paths.append(
+ (name, path, trans, ob, gc.get_joinstyle(), gc.get_capstyle(),
+ padding, filled, stroked))
+ return name
+
+ def writePathCollectionTemplates(self):
+ for (name, path, trans, ob, joinstyle, capstyle, padding, filled,
+ stroked) in self.paths:
+ pathops = self.pathOperations(path, trans, simplify=False)
+ bbox = path.get_extents(trans)
+ if not np.all(np.isfinite(bbox.extents)):
+ extents = [0, 0, 0, 0]
+ else:
+ bbox = bbox.padded(padding)
+ extents = list(bbox.extents)
+ self.beginStream(
+ ob.id, None,
+ {'Type': Name('XObject'), 'Subtype': Name('Form'),
+ 'BBox': extents})
+ self.output(GraphicsContextPdf.joinstyles[joinstyle],
+ Op.setlinejoin)
+ self.output(GraphicsContextPdf.capstyles[capstyle], Op.setlinecap)
+ self.output(*pathops)
+ self.output(Op.paint_path(filled, stroked))
+ self.endStream()
+
+ @staticmethod
+ def pathOperations(path, transform, clip=None, simplify=None, sketch=None):
+ return [Verbatim(_path.convert_to_string(
+ path, transform, clip, simplify, sketch,
+ 6,
+ [Op.moveto.value, Op.lineto.value, b'', Op.curveto.value,
+ Op.closepath.value],
+ True))]
+
+ def writePath(self, path, transform, clip=False, sketch=None):
+ if clip:
+ clip = (0.0, 0.0, self.width * 72, self.height * 72)
+ simplify = path.should_simplify
+ else:
+ clip = None
+ simplify = False
+ cmds = self.pathOperations(path, transform, clip, simplify=simplify,
+ sketch=sketch)
+ self.output(*cmds)
+
+ def reserveObject(self, name=''):
+ """
+ Reserve an ID for an indirect object.
+
+ The name is used for debugging in case we forget to print out
+ the object with writeObject.
+ """
+ id = next(self._object_seq)
+ self.xrefTable.append([None, 0, name])
+ return Reference(id)
+
+ def recordXref(self, id):
+ self.xrefTable[id][0] = self.fh.tell() - self.tell_base
+
+ def writeObject(self, object, contents):
+ self.recordXref(object.id)
+ object.write(contents, self)
+
+ def writeXref(self):
+ """Write out the xref table."""
+ self.startxref = self.fh.tell() - self.tell_base
+ self.write(b"xref\n0 %d\n" % len(self.xrefTable))
+ for i, (offset, generation, name) in enumerate(self.xrefTable):
+ if offset is None:
+ raise AssertionError(
+ 'No offset for object %d (%s)' % (i, name))
+ else:
+ key = b"f" if name == 'the zero object' else b"n"
+ text = b"%010d %05d %b \n" % (offset, generation, key)
+ self.write(text)
+
+ def writeInfoDict(self):
+ """Write out the info dictionary, checking it for good form"""
+
+ self.infoObject = self.reserveObject('info')
+ self.writeObject(self.infoObject, self.infoDict)
+
+ def writeTrailer(self):
+ """Write out the PDF trailer."""
+
+ self.write(b"trailer\n")
+ self.write(pdfRepr(
+ {'Size': len(self.xrefTable),
+ 'Root': self.rootObject,
+ 'Info': self.infoObject}))
+ # Could add 'ID'
+ self.write(b"\nstartxref\n%d\n%%%%EOF\n" % self.startxref)
+
+
+class RendererPdf(_backend_pdf_ps.RendererPDFPSBase):
+
+ _afm_font_dir = cbook._get_data_path("fonts/pdfcorefonts")
+ _use_afm_rc_name = "pdf.use14corefonts"
+
+ def __init__(self, file, image_dpi, height, width):
+ super().__init__(width, height)
+ self.file = file
+ self.gc = self.new_gc()
+ self.image_dpi = image_dpi
+
+ def finalize(self):
+ self.file.output(*self.gc.finalize())
+
+ def check_gc(self, gc, fillcolor=None):
+ orig_fill = getattr(gc, '_fillcolor', (0., 0., 0.))
+ gc._fillcolor = fillcolor
+
+ orig_alphas = getattr(gc, '_effective_alphas', (1.0, 1.0))
+
+ if gc.get_rgb() is None:
+ # It should not matter what color here since linewidth should be
+ # 0 unless affected by global settings in rcParams, hence setting
+ # zero alpha just in case.
+ gc.set_foreground((0, 0, 0, 0), isRGBA=True)
+
+ if gc._forced_alpha:
+ gc._effective_alphas = (gc._alpha, gc._alpha)
+ elif fillcolor is None or len(fillcolor) < 4:
+ gc._effective_alphas = (gc._rgb[3], 1.0)
+ else:
+ gc._effective_alphas = (gc._rgb[3], fillcolor[3])
+
+ delta = self.gc.delta(gc)
+ if delta:
+ self.file.output(*delta)
+
+ # Restore gc to avoid unwanted side effects
+ gc._fillcolor = orig_fill
+ gc._effective_alphas = orig_alphas
+
+ def get_image_magnification(self):
+ return self.image_dpi/72.0
+
+ def draw_image(self, gc, x, y, im, transform=None):
+ # docstring inherited
+
+ h, w = im.shape[:2]
+ if w == 0 or h == 0:
+ return
+
+ if transform is None:
+ # If there's no transform, alpha has already been applied
+ gc.set_alpha(1.0)
+
+ self.check_gc(gc)
+
+ w = 72.0 * w / self.image_dpi
+ h = 72.0 * h / self.image_dpi
+
+ imob = self.file.imageObject(im)
+
+ if transform is None:
+ self.file.output(Op.gsave,
+ w, 0, 0, h, x, y, Op.concat_matrix,
+ imob, Op.use_xobject, Op.grestore)
+ else:
+ tr1, tr2, tr3, tr4, tr5, tr6 = transform.frozen().to_values()
+
+ self.file.output(Op.gsave,
+ 1, 0, 0, 1, x, y, Op.concat_matrix,
+ tr1, tr2, tr3, tr4, tr5, tr6, Op.concat_matrix,
+ imob, Op.use_xobject, Op.grestore)
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ # docstring inherited
+ self.check_gc(gc, rgbFace)
+ self.file.writePath(
+ path, transform,
+ rgbFace is None and gc.get_hatch_path() is None,
+ gc.get_sketch_params())
+ self.file.output(self.gc.paint())
+
+ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
+ offsets, offset_trans, facecolors, edgecolors,
+ linewidths, linestyles, antialiaseds, urls,
+ offset_position):
+ # We can only reuse the objects if the presence of fill and
+ # stroke (and the amount of alpha for each) is the same for
+ # all of them
+ can_do_optimization = True
+ facecolors = np.asarray(facecolors)
+ edgecolors = np.asarray(edgecolors)
+
+ if not len(facecolors):
+ filled = False
+ can_do_optimization = not gc.get_hatch()
+ else:
+ if np.all(facecolors[:, 3] == facecolors[0, 3]):
+ filled = facecolors[0, 3] != 0.0
+ else:
+ can_do_optimization = False
+
+ if not len(edgecolors):
+ stroked = False
+ else:
+ if np.all(np.asarray(linewidths) == 0.0):
+ stroked = False
+ elif np.all(edgecolors[:, 3] == edgecolors[0, 3]):
+ stroked = edgecolors[0, 3] != 0.0
+ else:
+ can_do_optimization = False
+
+ # Is the optimization worth it? Rough calculation:
+ # cost of emitting a path in-line is len_path * uses_per_path
+ # cost of XObject is len_path + 5 for the definition,
+ # uses_per_path for the uses
+ len_path = len(paths[0].vertices) if len(paths) > 0 else 0
+ uses_per_path = self._iter_collection_uses_per_path(
+ paths, all_transforms, offsets, facecolors, edgecolors)
+ should_do_optimization = \
+ len_path + uses_per_path + 5 < len_path * uses_per_path
+
+ if (not can_do_optimization) or (not should_do_optimization):
+ return RendererBase.draw_path_collection(
+ self, gc, master_transform, paths, all_transforms,
+ offsets, offset_trans, facecolors, edgecolors,
+ linewidths, linestyles, antialiaseds, urls,
+ offset_position)
+
+ padding = np.max(linewidths)
+ path_codes = []
+ for i, (path, transform) in enumerate(self._iter_collection_raw_paths(
+ master_transform, paths, all_transforms)):
+ name = self.file.pathCollectionObject(
+ gc, path, transform, padding, filled, stroked)
+ path_codes.append(name)
+
+ output = self.file.output
+ output(*self.gc.push())
+ lastx, lasty = 0, 0
+ for xo, yo, path_id, gc0, rgbFace in self._iter_collection(
+ gc, path_codes, offsets, offset_trans,
+ facecolors, edgecolors, linewidths, linestyles,
+ antialiaseds, urls, offset_position):
+
+ self.check_gc(gc0, rgbFace)
+ dx, dy = xo - lastx, yo - lasty
+ output(1, 0, 0, 1, dx, dy, Op.concat_matrix, path_id,
+ Op.use_xobject)
+ lastx, lasty = xo, yo
+ output(*self.gc.pop())
+
+ def draw_markers(self, gc, marker_path, marker_trans, path, trans,
+ rgbFace=None):
+ # docstring inherited
+
+ # Same logic as in draw_path_collection
+ len_marker_path = len(marker_path)
+ uses = len(path)
+ if len_marker_path * uses < len_marker_path + uses + 5:
+ RendererBase.draw_markers(self, gc, marker_path, marker_trans,
+ path, trans, rgbFace)
+ return
+
+ self.check_gc(gc, rgbFace)
+ fill = gc.fill(rgbFace)
+ stroke = gc.stroke()
+
+ output = self.file.output
+ marker = self.file.markerObject(
+ marker_path, marker_trans, fill, stroke, self.gc._linewidth,
+ gc.get_joinstyle(), gc.get_capstyle())
+
+ output(Op.gsave)
+ lastx, lasty = 0, 0
+ for vertices, code in path.iter_segments(
+ trans,
+ clip=(0, 0, self.file.width*72, self.file.height*72),
+ simplify=False):
+ if len(vertices):
+ x, y = vertices[-2:]
+ if not (0 <= x <= self.file.width * 72
+ and 0 <= y <= self.file.height * 72):
+ continue
+ dx, dy = x - lastx, y - lasty
+ output(1, 0, 0, 1, dx, dy, Op.concat_matrix,
+ marker, Op.use_xobject)
+ lastx, lasty = x, y
+ output(Op.grestore)
+
+ def draw_gouraud_triangles(self, gc, points, colors, trans):
+ assert len(points) == len(colors)
+ if len(points) == 0:
+ return
+ assert points.ndim == 3
+ assert points.shape[1] == 3
+ assert points.shape[2] == 2
+ assert colors.ndim == 3
+ assert colors.shape[1] == 3
+ assert colors.shape[2] in (1, 4)
+
+ shape = points.shape
+ points = points.reshape((shape[0] * shape[1], 2))
+ tpoints = trans.transform(points)
+ tpoints = tpoints.reshape(shape)
+ name, _ = self.file.addGouraudTriangles(tpoints, colors)
+ output = self.file.output
+
+ if colors.shape[2] == 1:
+ # grayscale
+ gc.set_alpha(1.0)
+ self.check_gc(gc)
+ output(name, Op.shading)
+ return
+
+ alpha = colors[0, 0, 3]
+ if np.allclose(alpha, colors[:, :, 3]):
+ # single alpha value
+ gc.set_alpha(alpha)
+ self.check_gc(gc)
+ output(name, Op.shading)
+ else:
+ # varying alpha: use a soft mask
+ alpha = colors[:, :, 3][:, :, None]
+ _, smask_ob = self.file.addGouraudTriangles(tpoints, alpha)
+ gstate = self.file._soft_mask_state(smask_ob)
+ output(Op.gsave, gstate, Op.setgstate,
+ name, Op.shading,
+ Op.grestore)
+
+ def _setup_textpos(self, x, y, angle, oldx=0, oldy=0, oldangle=0):
+ if angle == oldangle == 0:
+ self.file.output(x - oldx, y - oldy, Op.textpos)
+ else:
+ angle = math.radians(angle)
+ self.file.output(math.cos(angle), math.sin(angle),
+ -math.sin(angle), math.cos(angle),
+ x, y, Op.textmatrix)
+ self.file.output(0, 0, Op.textpos)
+
+ def draw_mathtext(self, gc, x, y, s, prop, angle):
+ # TODO: fix positioning and encoding
+ width, height, descent, glyphs, rects = \
+ self._text2path.mathtext_parser.parse(s, 72, prop)
+
+ if gc.get_url() is not None:
+ self.file._annotations[-1][1].append(_get_link_annotation(
+ gc, x, y, width, height, angle))
+
+ fonttype = mpl.rcParams['pdf.fonttype']
+
+ # Set up a global transformation matrix for the whole math expression
+ a = math.radians(angle)
+ self.file.output(Op.gsave)
+ self.file.output(math.cos(a), math.sin(a),
+ -math.sin(a), math.cos(a),
+ x, y, Op.concat_matrix)
+
+ self.check_gc(gc, gc._rgb)
+ prev_font = None, None
+ oldx, oldy = 0, 0
+ unsupported_chars = []
+
+ self.file.output(Op.begin_text)
+ for font, fontsize, num, ox, oy in glyphs:
+ self.file._character_tracker.track_glyph(font, num)
+ fontname = font.fname
+ if not _font_supports_glyph(fonttype, num):
+ # Unsupported chars (i.e. multibyte in Type 3 or beyond BMP in
+ # Type 42) must be emitted separately (below).
+ unsupported_chars.append((font, fontsize, ox, oy, num))
+ else:
+ self._setup_textpos(ox, oy, 0, oldx, oldy)
+ oldx, oldy = ox, oy
+ if (fontname, fontsize) != prev_font:
+ self.file.output(self.file.fontName(fontname), fontsize,
+ Op.selectfont)
+ prev_font = fontname, fontsize
+ self.file.output(self.encode_string(chr(num), fonttype),
+ Op.show)
+ self.file.output(Op.end_text)
+
+ for font, fontsize, ox, oy, num in unsupported_chars:
+ self._draw_xobject_glyph(
+ font, fontsize, font.get_char_index(num), ox, oy)
+
+ # Draw any horizontal lines in the math layout
+ for ox, oy, width, height in rects:
+ self.file.output(Op.gsave, ox, oy, width, height,
+ Op.rectangle, Op.fill, Op.grestore)
+
+ # Pop off the global transformation
+ self.file.output(Op.grestore)
+
+ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
+ # docstring inherited
+ texmanager = self.get_texmanager()
+ fontsize = prop.get_size_in_points()
+ dvifile = texmanager.make_dvi(s, fontsize)
+ with dviread.Dvi(dvifile, 72) as dvi:
+ page, = dvi
+
+ if gc.get_url() is not None:
+ self.file._annotations[-1][1].append(_get_link_annotation(
+ gc, x, y, page.width, page.height, angle))
+
+ # Gather font information and do some setup for combining
+ # characters into strings. The variable seq will contain a
+ # sequence of font and text entries. A font entry is a list
+ # ['font', name, size] where name is a Name object for the
+ # font. A text entry is ['text', x, y, glyphs, x+w] where x
+ # and y are the starting coordinates, w is the width, and
+ # glyphs is a list; in this phase it will always contain just
+ # one single-character string, but later it may have longer
+ # strings interspersed with kern amounts.
+ oldfont, seq = None, []
+ for x1, y1, dvifont, glyph, width in page.text:
+ if dvifont != oldfont:
+ pdfname = self.file.dviFontName(dvifont)
+ seq += [['font', pdfname, dvifont.size]]
+ oldfont = dvifont
+ seq += [['text', x1, y1, [bytes([glyph])], x1+width]]
+
+ # Find consecutive text strings with constant y coordinate and
+ # combine into a sequence of strings and kerns, or just one
+ # string (if any kerns would be less than 0.1 points).
+ i, curx, fontsize = 0, 0, None
+ while i < len(seq)-1:
+ elt, nxt = seq[i:i+2]
+ if elt[0] == 'font':
+ fontsize = elt[2]
+ elif elt[0] == nxt[0] == 'text' and elt[2] == nxt[2]:
+ offset = elt[4] - nxt[1]
+ if abs(offset) < 0.1:
+ elt[3][-1] += nxt[3][0]
+ elt[4] += nxt[4]-nxt[1]
+ else:
+ elt[3] += [offset*1000.0/fontsize, nxt[3][0]]
+ elt[4] = nxt[4]
+ del seq[i+1]
+ continue
+ i += 1
+
+ # Create a transform to map the dvi contents to the canvas.
+ mytrans = Affine2D().rotate_deg(angle).translate(x, y)
+
+ # Output the text.
+ self.check_gc(gc, gc._rgb)
+ self.file.output(Op.begin_text)
+ curx, cury, oldx, oldy = 0, 0, 0, 0
+ for elt in seq:
+ if elt[0] == 'font':
+ self.file.output(elt[1], elt[2], Op.selectfont)
+ elif elt[0] == 'text':
+ curx, cury = mytrans.transform((elt[1], elt[2]))
+ self._setup_textpos(curx, cury, angle, oldx, oldy)
+ oldx, oldy = curx, cury
+ if len(elt[3]) == 1:
+ self.file.output(elt[3][0], Op.show)
+ else:
+ self.file.output(elt[3], Op.showkern)
+ else:
+ assert False
+ self.file.output(Op.end_text)
+
+ # Then output the boxes (e.g., variable-length lines of square
+ # roots).
+ boxgc = self.new_gc()
+ boxgc.copy_properties(gc)
+ boxgc.set_linewidth(0)
+ pathops = [Path.MOVETO, Path.LINETO, Path.LINETO, Path.LINETO,
+ Path.CLOSEPOLY]
+ for x1, y1, h, w in page.boxes:
+ path = Path([[x1, y1], [x1+w, y1], [x1+w, y1+h], [x1, y1+h],
+ [0, 0]], pathops)
+ self.draw_path(boxgc, path, mytrans, gc._rgb)
+
+ def encode_string(self, s, fonttype):
+ if fonttype in (1, 3):
+ return s.encode('cp1252', 'replace')
+ return s.encode('utf-16be', 'replace')
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ # docstring inherited
+
+ # TODO: combine consecutive texts into one BT/ET delimited section
+
+ self.check_gc(gc, gc._rgb)
+ if ismath:
+ return self.draw_mathtext(gc, x, y, s, prop, angle)
+
+ fontsize = prop.get_size_in_points()
+
+ if mpl.rcParams['pdf.use14corefonts']:
+ font = self._get_font_afm(prop)
+ fonttype = 1
+ else:
+ font = self._get_font_ttf(prop)
+ self.file._character_tracker.track(font, s)
+ fonttype = mpl.rcParams['pdf.fonttype']
+
+ if gc.get_url() is not None:
+ font.set_text(s)
+ width, height = font.get_width_height()
+ self.file._annotations[-1][1].append(_get_link_annotation(
+ gc, x, y, width / 64, height / 64, angle))
+
+ # If fonttype is neither 3 nor 42, emit the whole string at once
+ # without manual kerning.
+ if fonttype not in [3, 42]:
+ self.file.output(Op.begin_text,
+ self.file.fontName(prop), fontsize, Op.selectfont)
+ self._setup_textpos(x, y, angle)
+ self.file.output(self.encode_string(s, fonttype),
+ Op.show, Op.end_text)
+
+ # A sequence of characters is broken into multiple chunks. The chunking
+ # serves two purposes:
+ # - For Type 3 fonts, there is no way to access multibyte characters,
+ # as they cannot have a CIDMap. Therefore, in this case we break
+ # the string into chunks, where each chunk contains either a string
+ # of consecutive 1-byte characters or a single multibyte character.
+ # - A sequence of 1-byte characters is split into chunks to allow for
+ # kerning adjustments between consecutive chunks.
+ #
+ # Each chunk is emitted with a separate command: 1-byte characters use
+ # the regular text show command (TJ) with appropriate kerning between
+ # chunks, whereas multibyte characters use the XObject command (Do).
+ else:
+ # List of (ft_object, start_x, [prev_kern, char, char, ...]),
+ # w/o zero kerns.
+ singlebyte_chunks = []
+ # List of (ft_object, start_x, glyph_index).
+ multibyte_glyphs = []
+ prev_was_multibyte = True
+ prev_font = font
+ for item in _text_helpers.layout(s, font, kern_mode=Kerning.UNFITTED):
+ if _font_supports_glyph(fonttype, ord(item.char)):
+ if prev_was_multibyte or item.ft_object != prev_font:
+ singlebyte_chunks.append((item.ft_object, item.x, []))
+ prev_font = item.ft_object
+ if item.prev_kern:
+ singlebyte_chunks[-1][2].append(item.prev_kern)
+ singlebyte_chunks[-1][2].append(item.char)
+ prev_was_multibyte = False
+ else:
+ multibyte_glyphs.append((item.ft_object, item.x, item.glyph_idx))
+ prev_was_multibyte = True
+ # Do the rotation and global translation as a single matrix
+ # concatenation up front
+ self.file.output(Op.gsave)
+ a = math.radians(angle)
+ self.file.output(math.cos(a), math.sin(a),
+ -math.sin(a), math.cos(a),
+ x, y, Op.concat_matrix)
+ # Emit all the 1-byte characters in a BT/ET group.
+
+ self.file.output(Op.begin_text)
+ prev_start_x = 0
+ for ft_object, start_x, kerns_or_chars in singlebyte_chunks:
+ ft_name = self.file.fontName(ft_object.fname)
+ self.file.output(ft_name, fontsize, Op.selectfont)
+ self._setup_textpos(start_x, 0, 0, prev_start_x, 0, 0)
+ self.file.output(
+ # See pdf spec "Text space details" for the 1000/fontsize
+ # (aka. 1000/T_fs) factor.
+ [-1000 * next(group) / fontsize if tp == float # a kern
+ else self.encode_string("".join(group), fonttype)
+ for tp, group in itertools.groupby(kerns_or_chars, type)],
+ Op.showkern)
+ prev_start_x = start_x
+ self.file.output(Op.end_text)
+ # Then emit all the multibyte characters, one at a time.
+ for ft_object, start_x, glyph_idx in multibyte_glyphs:
+ self._draw_xobject_glyph(
+ ft_object, fontsize, glyph_idx, start_x, 0
+ )
+ self.file.output(Op.grestore)
+
+ def _draw_xobject_glyph(self, font, fontsize, glyph_idx, x, y):
+ """Draw a multibyte character from a Type 3 font as an XObject."""
+ glyph_name = font.get_glyph_name(glyph_idx)
+ name = self.file._get_xobject_glyph_name(font.fname, glyph_name)
+ self.file.output(
+ Op.gsave,
+ 0.001 * fontsize, 0, 0, 0.001 * fontsize, x, y, Op.concat_matrix,
+ Name(name), Op.use_xobject,
+ Op.grestore,
+ )
+
+ def new_gc(self):
+ # docstring inherited
+ return GraphicsContextPdf(self.file)
+
+
+class GraphicsContextPdf(GraphicsContextBase):
+
+ def __init__(self, file):
+ super().__init__()
+ self._fillcolor = (0.0, 0.0, 0.0)
+ self._effective_alphas = (1.0, 1.0)
+ self.file = file
+ self.parent = None
+
+ def __repr__(self):
+ d = dict(self.__dict__)
+ del d['file']
+ del d['parent']
+ return repr(d)
+
+ def stroke(self):
+ """
+ Predicate: does the path need to be stroked (its outline drawn)?
+ This tests for the various conditions that disable stroking
+ the path, in which case it would presumably be filled.
+ """
+ # _linewidth > 0: in pdf a line of width 0 is drawn at minimum
+ # possible device width, but e.g., agg doesn't draw at all
+ return (self._linewidth > 0 and self._alpha > 0 and
+ (len(self._rgb) <= 3 or self._rgb[3] != 0.0))
+
+ def fill(self, *args):
+ """
+ Predicate: does the path need to be filled?
+
+ An optional argument can be used to specify an alternative
+ _fillcolor, as needed by RendererPdf.draw_markers.
+ """
+ if len(args):
+ _fillcolor = args[0]
+ else:
+ _fillcolor = self._fillcolor
+ return (self._hatch or
+ (_fillcolor is not None and
+ (len(_fillcolor) <= 3 or _fillcolor[3] != 0.0)))
+
+ def paint(self):
+ """
+ Return the appropriate pdf operator to cause the path to be
+ stroked, filled, or both.
+ """
+ return Op.paint_path(self.fill(), self.stroke())
+
+ capstyles = {'butt': 0, 'round': 1, 'projecting': 2}
+ joinstyles = {'miter': 0, 'round': 1, 'bevel': 2}
+
+ def capstyle_cmd(self, style):
+ return [self.capstyles[style], Op.setlinecap]
+
+ def joinstyle_cmd(self, style):
+ return [self.joinstyles[style], Op.setlinejoin]
+
+ def linewidth_cmd(self, width):
+ return [width, Op.setlinewidth]
+
+ def dash_cmd(self, dashes):
+ offset, dash = dashes
+ if dash is None:
+ dash = []
+ offset = 0
+ return [list(dash), offset, Op.setdash]
+
+ def alpha_cmd(self, alpha, forced, effective_alphas):
+ name = self.file.alphaState(effective_alphas)
+ return [name, Op.setgstate]
+
+ def hatch_cmd(self, hatch, hatch_color, hatch_linewidth):
+ if not hatch:
+ if self._fillcolor is not None:
+ return self.fillcolor_cmd(self._fillcolor)
+ else:
+ return [Name('DeviceRGB'), Op.setcolorspace_nonstroke]
+ else:
+ hatch_style = (hatch_color, self._fillcolor, hatch, hatch_linewidth)
+ name = self.file.hatchPattern(hatch_style)
+ return [Name('Pattern'), Op.setcolorspace_nonstroke,
+ name, Op.setcolor_nonstroke]
+
+ def rgb_cmd(self, rgb):
+ if mpl.rcParams['pdf.inheritcolor']:
+ return []
+ if rgb[0] == rgb[1] == rgb[2]:
+ return [rgb[0], Op.setgray_stroke]
+ else:
+ return [*rgb[:3], Op.setrgb_stroke]
+
+ def fillcolor_cmd(self, rgb):
+ if rgb is None or mpl.rcParams['pdf.inheritcolor']:
+ return []
+ elif rgb[0] == rgb[1] == rgb[2]:
+ return [rgb[0], Op.setgray_nonstroke]
+ else:
+ return [*rgb[:3], Op.setrgb_nonstroke]
+
+ def push(self):
+ parent = GraphicsContextPdf(self.file)
+ parent.copy_properties(self)
+ parent.parent = self.parent
+ self.parent = parent
+ return [Op.gsave]
+
+ def pop(self):
+ assert self.parent is not None
+ self.copy_properties(self.parent)
+ self.parent = self.parent.parent
+ return [Op.grestore]
+
+ def clip_cmd(self, cliprect, clippath):
+ """Set clip rectangle. Calls `.pop()` and `.push()`."""
+ cmds = []
+ # Pop graphics state until we hit the right one or the stack is empty
+ while ((self._cliprect, self._clippath) != (cliprect, clippath)
+ and self.parent is not None):
+ cmds.extend(self.pop())
+ # Unless we hit the right one, set the clip polygon
+ if ((self._cliprect, self._clippath) != (cliprect, clippath) or
+ self.parent is None):
+ cmds.extend(self.push())
+ if self._cliprect != cliprect:
+ cmds.extend([cliprect, Op.rectangle, Op.clip, Op.endpath])
+ if self._clippath != clippath:
+ path, affine = clippath.get_transformed_path_and_affine()
+ cmds.extend(
+ PdfFile.pathOperations(path, affine, simplify=False) +
+ [Op.clip, Op.endpath])
+ return cmds
+
+ commands = (
+ # must come first since may pop
+ (('_cliprect', '_clippath'), clip_cmd),
+ (('_alpha', '_forced_alpha', '_effective_alphas'), alpha_cmd),
+ (('_capstyle',), capstyle_cmd),
+ (('_fillcolor',), fillcolor_cmd),
+ (('_joinstyle',), joinstyle_cmd),
+ (('_linewidth',), linewidth_cmd),
+ (('_dashes',), dash_cmd),
+ (('_rgb',), rgb_cmd),
+ # must come after fillcolor and rgb
+ (('_hatch', '_hatch_color', '_hatch_linewidth'), hatch_cmd),
+ )
+
+ def delta(self, other):
+ """
+ Copy properties of other into self and return PDF commands
+ needed to transform *self* into *other*.
+ """
+ cmds = []
+ fill_performed = False
+ for params, cmd in self.commands:
+ different = False
+ for p in params:
+ ours = getattr(self, p)
+ theirs = getattr(other, p)
+ try:
+ if ours is None or theirs is None:
+ different = ours is not theirs
+ else:
+ different = bool(ours != theirs)
+ except ValueError:
+ ours = np.asarray(ours)
+ theirs = np.asarray(theirs)
+ different = (ours.shape != theirs.shape or
+ np.any(ours != theirs))
+ if different:
+ break
+
+ # Need to update hatching if we also updated fillcolor
+ if cmd.__name__ == 'hatch_cmd' and fill_performed:
+ different = True
+
+ if different:
+ if cmd.__name__ == 'fillcolor_cmd':
+ fill_performed = True
+ theirs = [getattr(other, p) for p in params]
+ cmds.extend(cmd(self, *theirs))
+ for p in params:
+ setattr(self, p, getattr(other, p))
+ return cmds
+
+ def copy_properties(self, other):
+ """
+ Copy properties of other into self.
+ """
+ super().copy_properties(other)
+ fillcolor = getattr(other, '_fillcolor', self._fillcolor)
+ effective_alphas = getattr(other, '_effective_alphas',
+ self._effective_alphas)
+ self._fillcolor = fillcolor
+ self._effective_alphas = effective_alphas
+
+ def finalize(self):
+ """
+ Make sure every pushed graphics state is popped.
+ """
+ cmds = []
+ while self.parent is not None:
+ cmds.extend(self.pop())
+ return cmds
+
+
+class PdfPages:
+ """
+ A multi-page PDF file.
+
+ Examples
+ --------
+ >>> import matplotlib.pyplot as plt
+ >>> # Initialize:
+ >>> with PdfPages('foo.pdf') as pdf:
+ ... # As many times as you like, create a figure fig and save it:
+ ... fig = plt.figure()
+ ... pdf.savefig(fig)
+ ... # When no figure is specified the current figure is saved
+ ... pdf.savefig()
+
+ Notes
+ -----
+ In reality `PdfPages` is a thin wrapper around `PdfFile`, in order to avoid
+ confusion when using `~.pyplot.savefig` and forgetting the format argument.
+ """
+
+ @_api.delete_parameter("3.10", "keep_empty",
+ addendum="This parameter does nothing.")
+ def __init__(self, filename, keep_empty=None, metadata=None):
+ """
+ Create a new PdfPages object.
+
+ Parameters
+ ----------
+ filename : str or path-like or file-like
+ Plots using `PdfPages.savefig` will be written to a file at this location.
+ The file is opened when a figure is saved for the first time (overwriting
+ any older file with the same name).
+
+ metadata : dict, optional
+ Information dictionary object (see PDF reference section 10.2.1
+ 'Document Information Dictionary'), e.g.:
+ ``{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}``.
+
+ The standard keys are 'Title', 'Author', 'Subject', 'Keywords',
+ 'Creator', 'Producer', 'CreationDate', 'ModDate', and
+ 'Trapped'. Values have been predefined for 'Creator', 'Producer'
+ and 'CreationDate'. They can be removed by setting them to `None`.
+ """
+ self._filename = filename
+ self._metadata = metadata
+ self._file = None
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.close()
+
+ def _ensure_file(self):
+ if self._file is None:
+ self._file = PdfFile(self._filename, metadata=self._metadata) # init.
+ return self._file
+
+ def close(self):
+ """
+ Finalize this object, making the underlying file a complete
+ PDF file.
+ """
+ if self._file is not None:
+ self._file.finalize()
+ self._file.close()
+ self._file = None
+
+ def infodict(self):
+ """
+ Return a modifiable information dictionary object
+ (see PDF reference section 10.2.1 'Document Information
+ Dictionary').
+ """
+ return self._ensure_file().infoDict
+
+ def savefig(self, figure=None, **kwargs):
+ """
+ Save a `.Figure` to this file as a new page.
+
+ Any other keyword arguments are passed to `~.Figure.savefig`.
+
+ Parameters
+ ----------
+ figure : `.Figure` or int, default: the active figure
+ The figure, or index of the figure, that is saved to the file.
+ """
+ if not isinstance(figure, Figure):
+ if figure is None:
+ manager = Gcf.get_active()
+ else:
+ manager = Gcf.get_fig_manager(figure)
+ if manager is None:
+ raise ValueError(f"No figure {figure}")
+ figure = manager.canvas.figure
+ # Force use of pdf backend, as PdfPages is tightly coupled with it.
+ figure.savefig(self, format="pdf", backend="pdf", **kwargs)
+
+ def get_pagecount(self):
+ """Return the current number of pages in the multipage pdf file."""
+ return len(self._ensure_file().pageList)
+
+ def attach_note(self, text, positionRect=[-100, -100, 0, 0]):
+ """
+ Add a new text note to the page to be saved next. The optional
+ positionRect specifies the position of the new note on the
+ page. It is outside the page per default to make sure it is
+ invisible on printouts.
+ """
+ self._ensure_file().newTextnote(text, positionRect)
+
+
+class FigureCanvasPdf(FigureCanvasBase):
+ # docstring inherited
+
+ fixed_dpi = 72
+ filetypes = {'pdf': 'Portable Document Format'}
+
+ def get_default_filetype(self):
+ return 'pdf'
+
+ def print_pdf(self, filename, *,
+ bbox_inches_restore=None, metadata=None):
+
+ dpi = self.figure.dpi
+ self.figure.dpi = 72 # there are 72 pdf points to an inch
+ width, height = self.figure.get_size_inches()
+ if isinstance(filename, PdfPages):
+ file = filename._ensure_file()
+ else:
+ file = PdfFile(filename, metadata=metadata)
+ try:
+ file.newPage(width, height)
+ renderer = MixedModeRenderer(
+ self.figure, width, height, dpi,
+ RendererPdf(file, dpi, height, width),
+ bbox_inches_restore=bbox_inches_restore)
+ self.figure.draw(renderer)
+ renderer.finalize()
+ if not isinstance(filename, PdfPages):
+ file.finalize()
+ finally:
+ if isinstance(filename, PdfPages): # finish off this page
+ file.endStream()
+ else: # we opened the file above; now finish it off
+ file.close()
+
+ def draw(self):
+ self.figure.draw_without_rendering()
+ return super().draw()
+
+
+FigureManagerPdf = FigureManagerBase
+
+
+@_Backend.export
+class _BackendPdf(_Backend):
+ FigureCanvas = FigureCanvasPdf
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_pgf.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_pgf.py
new file mode 100644
index 0000000000000000000000000000000000000000..48b6e8ac152c7a7d832dad2691534e1ecc0b2fae
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_pgf.py
@@ -0,0 +1,1010 @@
+import codecs
+import datetime
+import functools
+from io import BytesIO
+import logging
+import math
+import os
+import pathlib
+import shutil
+import subprocess
+from tempfile import TemporaryDirectory
+import weakref
+
+from PIL import Image
+
+import matplotlib as mpl
+from matplotlib import cbook, font_manager as fm
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, RendererBase
+)
+from matplotlib.backends.backend_mixed import MixedModeRenderer
+from matplotlib.backends.backend_pdf import (
+ _create_pdf_info_dict, _datetime_to_pdf)
+from matplotlib.path import Path
+from matplotlib.figure import Figure
+from matplotlib.font_manager import FontProperties
+from matplotlib._pylab_helpers import Gcf
+
+_log = logging.getLogger(__name__)
+
+
+_DOCUMENTCLASS = r"\documentclass{article}"
+
+
+# Note: When formatting floating point values, it is important to use the
+# %f/{:f} format rather than %s/{} to avoid triggering scientific notation,
+# which is not recognized by TeX.
+
+def _get_preamble():
+ """Prepare a LaTeX preamble based on the rcParams configuration."""
+ font_size_pt = FontProperties(
+ size=mpl.rcParams["font.size"]
+ ).get_size_in_points()
+ return "\n".join([
+ # Remove Matplotlib's custom command \mathdefault. (Not using
+ # \mathnormal instead since this looks odd with Computer Modern.)
+ r"\def\mathdefault#1{#1}",
+ # Use displaystyle for all math.
+ r"\everymath=\expandafter{\the\everymath\displaystyle}",
+ # Set up font sizes to match font.size setting.
+ # If present, use the KOMA package scrextend to adjust the standard
+ # LaTeX font commands (\tiny, ..., \normalsize, ..., \Huge) accordingly.
+ # Otherwise, only set \normalsize, manually.
+ r"\IfFileExists{scrextend.sty}{",
+ r" \usepackage[fontsize=%fpt]{scrextend}" % font_size_pt,
+ r"}{",
+ r" \renewcommand{\normalsize}{\fontsize{%f}{%f}\selectfont}"
+ % (font_size_pt, 1.2 * font_size_pt),
+ r" \normalsize",
+ r"}",
+ # Allow pgf.preamble to override the above definitions.
+ mpl.rcParams["pgf.preamble"],
+ *([
+ r"\ifdefined\pdftexversion\else % non-pdftex case.",
+ r" \usepackage{fontspec}",
+ ] + [
+ r" \%s{%s}[Path=\detokenize{%s/}]"
+ % (command, path.name, path.parent.as_posix())
+ for command, path in zip(
+ ["setmainfont", "setsansfont", "setmonofont"],
+ [pathlib.Path(fm.findfont(family))
+ for family in ["serif", "sans\\-serif", "monospace"]]
+ )
+ ] + [r"\fi"] if mpl.rcParams["pgf.rcfonts"] else []),
+ # Documented as "must come last".
+ mpl.texmanager._usepackage_if_not_loaded("underscore", option="strings"),
+ ])
+
+
+# It's better to use only one unit for all coordinates, since the
+# arithmetic in latex seems to produce inaccurate conversions.
+latex_pt_to_in = 1. / 72.27
+latex_in_to_pt = 1. / latex_pt_to_in
+mpl_pt_to_in = 1. / 72.
+mpl_in_to_pt = 1. / mpl_pt_to_in
+
+
+def _tex_escape(text):
+ r"""
+ Do some necessary and/or useful substitutions for texts to be included in
+ LaTeX documents.
+ """
+ return text.replace("\N{MINUS SIGN}", r"\ensuremath{-}")
+
+
+def _writeln(fh, line):
+ # Ending lines with a % prevents TeX from inserting spurious spaces
+ # (https://tex.stackexchange.com/questions/7453).
+ fh.write(line)
+ fh.write("%\n")
+
+
+def _escape_and_apply_props(s, prop):
+ """
+ Generate a TeX string that renders string *s* with font properties *prop*,
+ also applying any required escapes to *s*.
+ """
+ commands = []
+
+ families = {"serif": r"\rmfamily", "sans": r"\sffamily",
+ "sans-serif": r"\sffamily", "monospace": r"\ttfamily"}
+ family = prop.get_family()[0]
+ if family in families:
+ commands.append(families[family])
+ elif not mpl.rcParams["pgf.rcfonts"]:
+ commands.append(r"\fontfamily{\familydefault}")
+ elif any(font.name == family for font in fm.fontManager.ttflist):
+ commands.append(
+ r"\ifdefined\pdftexversion\else\setmainfont{%s}\rmfamily\fi" % family)
+ else:
+ _log.warning("Ignoring unknown font: %s", family)
+
+ size = prop.get_size_in_points()
+ commands.append(r"\fontsize{%f}{%f}" % (size, size * 1.2))
+
+ styles = {"normal": r"", "italic": r"\itshape", "oblique": r"\slshape"}
+ commands.append(styles[prop.get_style()])
+
+ boldstyles = ["semibold", "demibold", "demi", "bold", "heavy",
+ "extra bold", "black"]
+ if prop.get_weight() in boldstyles:
+ commands.append(r"\bfseries")
+
+ commands.append(r"\selectfont")
+ return (
+ "{"
+ + "".join(commands)
+ + r"\catcode`\^=\active\def^{\ifmmode\sp\else\^{}\fi}"
+ # It should normally be enough to set the catcode of % to 12 ("normal
+ # character"); this works on TeXLive 2021 but not on 2018, so we just
+ # make it active too.
+ + r"\catcode`\%=\active\def%{\%}"
+ + _tex_escape(s)
+ + "}"
+ )
+
+
+def _metadata_to_str(key, value):
+ """Convert metadata key/value to a form that hyperref accepts."""
+ if isinstance(value, datetime.datetime):
+ value = _datetime_to_pdf(value)
+ elif key == 'Trapped':
+ value = value.name.decode('ascii')
+ else:
+ value = str(value)
+ return f'{key}={{{value}}}'
+
+
+def make_pdf_to_png_converter():
+ """Return a function that converts a pdf file to a png file."""
+ try:
+ mpl._get_executable_info("pdftocairo")
+ except mpl.ExecutableNotFoundError:
+ pass
+ else:
+ return lambda pdffile, pngfile, dpi: subprocess.check_output(
+ ["pdftocairo", "-singlefile", "-transp", "-png", "-r", "%d" % dpi,
+ pdffile, os.path.splitext(pngfile)[0]],
+ stderr=subprocess.STDOUT)
+ try:
+ gs_info = mpl._get_executable_info("gs")
+ except mpl.ExecutableNotFoundError:
+ pass
+ else:
+ return lambda pdffile, pngfile, dpi: subprocess.check_output(
+ [gs_info.executable,
+ '-dQUIET', '-dSAFER', '-dBATCH', '-dNOPAUSE', '-dNOPROMPT',
+ '-dUseCIEColor', '-dTextAlphaBits=4',
+ '-dGraphicsAlphaBits=4', '-dDOINTERPOLATE',
+ '-sDEVICE=pngalpha', '-sOutputFile=%s' % pngfile,
+ '-r%d' % dpi, pdffile],
+ stderr=subprocess.STDOUT)
+ raise RuntimeError("No suitable pdf to png renderer found.")
+
+
+class LatexError(Exception):
+ def __init__(self, message, latex_output=""):
+ super().__init__(message)
+ self.latex_output = latex_output
+
+ def __str__(self):
+ s, = self.args
+ if self.latex_output:
+ s += "\n" + self.latex_output
+ return s
+
+
+class LatexManager:
+ """
+ The LatexManager opens an instance of the LaTeX application for
+ determining the metrics of text elements. The LaTeX environment can be
+ modified by setting fonts and/or a custom preamble in `.rcParams`.
+ """
+
+ @staticmethod
+ def _build_latex_header():
+ latex_header = [
+ _DOCUMENTCLASS,
+ # Include TeX program name as a comment for cache invalidation.
+ # TeX does not allow this to be the first line.
+ rf"% !TeX program = {mpl.rcParams['pgf.texsystem']}",
+ # Test whether \includegraphics supports interpolate option.
+ r"\usepackage{graphicx}",
+ _get_preamble(),
+ r"\begin{document}",
+ r"\typeout{pgf_backend_query_start}",
+ ]
+ return "\n".join(latex_header)
+
+ @classmethod
+ def _get_cached_or_new(cls):
+ """
+ Return the previous LatexManager if the header and tex system did not
+ change, or a new instance otherwise.
+ """
+ return cls._get_cached_or_new_impl(cls._build_latex_header())
+
+ @classmethod
+ @functools.lru_cache(1)
+ def _get_cached_or_new_impl(cls, header): # Helper for _get_cached_or_new.
+ return cls()
+
+ def _stdin_writeln(self, s):
+ if self.latex is None:
+ self._setup_latex_process()
+ self.latex.stdin.write(s)
+ self.latex.stdin.write("\n")
+ self.latex.stdin.flush()
+
+ def _expect(self, s):
+ s = list(s)
+ chars = []
+ while True:
+ c = self.latex.stdout.read(1)
+ chars.append(c)
+ if chars[-len(s):] == s:
+ break
+ if not c:
+ self.latex.kill()
+ self.latex = None
+ raise LatexError("LaTeX process halted", "".join(chars))
+ return "".join(chars)
+
+ def _expect_prompt(self):
+ return self._expect("\n*")
+
+ def __init__(self):
+ # create a tmp directory for running latex, register it for deletion
+ self._tmpdir = TemporaryDirectory()
+ self.tmpdir = self._tmpdir.name
+ self._finalize_tmpdir = weakref.finalize(self, self._tmpdir.cleanup)
+
+ # test the LaTeX setup to ensure a clean startup of the subprocess
+ self._setup_latex_process(expect_reply=False)
+ stdout, stderr = self.latex.communicate("\n\\makeatletter\\@@end\n")
+ if self.latex.returncode != 0:
+ raise LatexError(
+ f"LaTeX errored (probably missing font or error in preamble) "
+ f"while processing the following input:\n"
+ f"{self._build_latex_header()}",
+ stdout)
+ self.latex = None # Will be set up on first use.
+ # Per-instance cache.
+ self._get_box_metrics = functools.lru_cache(self._get_box_metrics)
+
+ def _setup_latex_process(self, *, expect_reply=True):
+ # Open LaTeX process for real work; register it for deletion. On
+ # Windows, we must ensure that the subprocess has quit before being
+ # able to delete the tmpdir in which it runs; in order to do so, we
+ # must first `kill()` it, and then `communicate()` with or `wait()` on
+ # it.
+ try:
+ self.latex = subprocess.Popen(
+ [mpl.rcParams["pgf.texsystem"], "-halt-on-error"],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ encoding="utf-8", cwd=self.tmpdir)
+ except FileNotFoundError as err:
+ raise RuntimeError(
+ f"{mpl.rcParams['pgf.texsystem']!r} not found; install it or change "
+ f"rcParams['pgf.texsystem'] to an available TeX implementation"
+ ) from err
+ except OSError as err:
+ raise RuntimeError(
+ f"Error starting {mpl.rcParams['pgf.texsystem']!r}") from err
+
+ def finalize_latex(latex):
+ latex.kill()
+ try:
+ latex.communicate()
+ except RuntimeError:
+ latex.wait()
+
+ self._finalize_latex = weakref.finalize(
+ self, finalize_latex, self.latex)
+ # write header with 'pgf_backend_query_start' token
+ self._stdin_writeln(self._build_latex_header())
+ if expect_reply: # read until 'pgf_backend_query_start' token appears
+ self._expect("*pgf_backend_query_start")
+ self._expect_prompt()
+
+ def get_width_height_descent(self, text, prop):
+ """
+ Get the width, total height, and descent (in TeX points) for a text
+ typeset by the current LaTeX environment.
+ """
+ return self._get_box_metrics(_escape_and_apply_props(text, prop))
+
+ def _get_box_metrics(self, tex):
+ """
+ Get the width, total height and descent (in TeX points) for a TeX
+ command's output in the current LaTeX environment.
+ """
+ # This method gets wrapped in __init__ for per-instance caching.
+ self._stdin_writeln( # Send textbox to TeX & request metrics typeout.
+ # \sbox doesn't handle catcode assignments inside its argument,
+ # so repeat the assignment of the catcode of "^" and "%" outside.
+ r"{\catcode`\^=\active\catcode`\%%=\active\sbox0{%s}"
+ r"\typeout{\the\wd0,\the\ht0,\the\dp0}}"
+ % tex)
+ try:
+ answer = self._expect_prompt()
+ except LatexError as err:
+ # Here and below, use '{}' instead of {!r} to avoid doubling all
+ # backslashes.
+ raise ValueError("Error measuring {}\nLaTeX Output:\n{}"
+ .format(tex, err.latex_output)) from err
+ try:
+ # Parse metrics from the answer string. Last line is prompt, and
+ # next-to-last-line is blank line from \typeout.
+ width, height, offset = answer.splitlines()[-3].split(",")
+ except Exception as err:
+ raise ValueError("Error measuring {}\nLaTeX Output:\n{}"
+ .format(tex, answer)) from err
+ w, h, o = float(width[:-2]), float(height[:-2]), float(offset[:-2])
+ # The height returned from LaTeX goes from base to top;
+ # the height Matplotlib expects goes from bottom to top.
+ return w, h + o, o
+
+
+@functools.lru_cache(1)
+def _get_image_inclusion_command():
+ man = LatexManager._get_cached_or_new()
+ man._stdin_writeln(
+ r"\includegraphics[interpolate=true]{%s}"
+ # Don't mess with backslashes on Windows.
+ % cbook._get_data_path("images/matplotlib.png").as_posix())
+ try:
+ man._expect_prompt()
+ return r"\includegraphics"
+ except LatexError:
+ # Discard the broken manager.
+ LatexManager._get_cached_or_new_impl.cache_clear()
+ return r"\pgfimage"
+
+
+class RendererPgf(RendererBase):
+
+ def __init__(self, figure, fh):
+ """
+ Create a new PGF renderer that translates any drawing instruction
+ into text commands to be interpreted in a latex pgfpicture environment.
+
+ Attributes
+ ----------
+ figure : `~matplotlib.figure.Figure`
+ Matplotlib figure to initialize height, width and dpi from.
+ fh : file-like
+ File handle for the output of the drawing commands.
+ """
+
+ super().__init__()
+ self.dpi = figure.dpi
+ self.fh = fh
+ self.figure = figure
+ self.image_counter = 0
+
+ def draw_markers(self, gc, marker_path, marker_trans, path, trans,
+ rgbFace=None):
+ # docstring inherited
+
+ _writeln(self.fh, r"\begin{pgfscope}")
+
+ # convert from display units to in
+ f = 1. / self.dpi
+
+ # set style and clip
+ self._print_pgf_clip(gc)
+ self._print_pgf_path_styles(gc, rgbFace)
+
+ # build marker definition
+ bl, tr = marker_path.get_extents(marker_trans).get_points()
+ coords = bl[0] * f, bl[1] * f, tr[0] * f, tr[1] * f
+ _writeln(self.fh,
+ r"\pgfsys@defobject{currentmarker}"
+ r"{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}{" % coords)
+ self._print_pgf_path(None, marker_path, marker_trans)
+ self._pgf_path_draw(stroke=gc.get_linewidth() != 0.0,
+ fill=rgbFace is not None)
+ _writeln(self.fh, r"}")
+
+ maxcoord = 16383 / 72.27 * self.dpi # Max dimensions in LaTeX.
+ clip = (-maxcoord, -maxcoord, maxcoord, maxcoord)
+
+ # draw marker for each vertex
+ for point, code in path.iter_segments(trans, simplify=False,
+ clip=clip):
+ x, y = point[0] * f, point[1] * f
+ _writeln(self.fh, r"\begin{pgfscope}")
+ _writeln(self.fh, r"\pgfsys@transformshift{%fin}{%fin}" % (x, y))
+ _writeln(self.fh, r"\pgfsys@useobject{currentmarker}{}")
+ _writeln(self.fh, r"\end{pgfscope}")
+
+ _writeln(self.fh, r"\end{pgfscope}")
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ # docstring inherited
+ _writeln(self.fh, r"\begin{pgfscope}")
+ # draw the path
+ self._print_pgf_clip(gc)
+ self._print_pgf_path_styles(gc, rgbFace)
+ self._print_pgf_path(gc, path, transform, rgbFace)
+ self._pgf_path_draw(stroke=gc.get_linewidth() != 0.0,
+ fill=rgbFace is not None)
+ _writeln(self.fh, r"\end{pgfscope}")
+
+ # if present, draw pattern on top
+ if gc.get_hatch():
+ _writeln(self.fh, r"\begin{pgfscope}")
+ self._print_pgf_path_styles(gc, rgbFace)
+
+ # combine clip and path for clipping
+ self._print_pgf_clip(gc)
+ self._print_pgf_path(gc, path, transform, rgbFace)
+ _writeln(self.fh, r"\pgfusepath{clip}")
+
+ # build pattern definition
+ _writeln(self.fh,
+ r"\pgfsys@defobject{currentpattern}"
+ r"{\pgfqpoint{0in}{0in}}{\pgfqpoint{1in}{1in}}{")
+ _writeln(self.fh, r"\begin{pgfscope}")
+ _writeln(self.fh,
+ r"\pgfpathrectangle"
+ r"{\pgfqpoint{0in}{0in}}{\pgfqpoint{1in}{1in}}")
+ _writeln(self.fh, r"\pgfusepath{clip}")
+ scale = mpl.transforms.Affine2D().scale(self.dpi)
+ self._print_pgf_path(None, gc.get_hatch_path(), scale)
+ self._pgf_path_draw(stroke=True)
+ _writeln(self.fh, r"\end{pgfscope}")
+ _writeln(self.fh, r"}")
+ # repeat pattern, filling the bounding rect of the path
+ f = 1. / self.dpi
+ (xmin, ymin), (xmax, ymax) = \
+ path.get_extents(transform).get_points()
+ xmin, xmax = f * xmin, f * xmax
+ ymin, ymax = f * ymin, f * ymax
+ repx, repy = math.ceil(xmax - xmin), math.ceil(ymax - ymin)
+ _writeln(self.fh,
+ r"\pgfsys@transformshift{%fin}{%fin}" % (xmin, ymin))
+ for iy in range(repy):
+ for ix in range(repx):
+ _writeln(self.fh, r"\pgfsys@useobject{currentpattern}{}")
+ _writeln(self.fh, r"\pgfsys@transformshift{1in}{0in}")
+ _writeln(self.fh, r"\pgfsys@transformshift{-%din}{0in}" % repx)
+ _writeln(self.fh, r"\pgfsys@transformshift{0in}{1in}")
+
+ _writeln(self.fh, r"\end{pgfscope}")
+
+ def _print_pgf_clip(self, gc):
+ f = 1. / self.dpi
+ # check for clip box
+ bbox = gc.get_clip_rectangle()
+ if bbox:
+ p1, p2 = bbox.get_points()
+ w, h = p2 - p1
+ coords = p1[0] * f, p1[1] * f, w * f, h * f
+ _writeln(self.fh,
+ r"\pgfpathrectangle"
+ r"{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}"
+ % coords)
+ _writeln(self.fh, r"\pgfusepath{clip}")
+
+ # check for clip path
+ clippath, clippath_trans = gc.get_clip_path()
+ if clippath is not None:
+ self._print_pgf_path(gc, clippath, clippath_trans)
+ _writeln(self.fh, r"\pgfusepath{clip}")
+
+ def _print_pgf_path_styles(self, gc, rgbFace):
+ # cap style
+ capstyles = {"butt": r"\pgfsetbuttcap",
+ "round": r"\pgfsetroundcap",
+ "projecting": r"\pgfsetrectcap"}
+ _writeln(self.fh, capstyles[gc.get_capstyle()])
+
+ # join style
+ joinstyles = {"miter": r"\pgfsetmiterjoin",
+ "round": r"\pgfsetroundjoin",
+ "bevel": r"\pgfsetbeveljoin"}
+ _writeln(self.fh, joinstyles[gc.get_joinstyle()])
+
+ # filling
+ has_fill = rgbFace is not None
+
+ if gc.get_forced_alpha():
+ fillopacity = strokeopacity = gc.get_alpha()
+ else:
+ strokeopacity = gc.get_rgb()[3]
+ fillopacity = rgbFace[3] if has_fill and len(rgbFace) > 3 else 1.0
+
+ if has_fill:
+ _writeln(self.fh,
+ r"\definecolor{currentfill}{rgb}{%f,%f,%f}"
+ % tuple(rgbFace[:3]))
+ _writeln(self.fh, r"\pgfsetfillcolor{currentfill}")
+ if has_fill and fillopacity != 1.0:
+ _writeln(self.fh, r"\pgfsetfillopacity{%f}" % fillopacity)
+
+ # linewidth and color
+ lw = gc.get_linewidth() * mpl_pt_to_in * latex_in_to_pt
+ stroke_rgba = gc.get_rgb()
+ _writeln(self.fh, r"\pgfsetlinewidth{%fpt}" % lw)
+ _writeln(self.fh,
+ r"\definecolor{currentstroke}{rgb}{%f,%f,%f}"
+ % stroke_rgba[:3])
+ _writeln(self.fh, r"\pgfsetstrokecolor{currentstroke}")
+ if strokeopacity != 1.0:
+ _writeln(self.fh, r"\pgfsetstrokeopacity{%f}" % strokeopacity)
+
+ # line style
+ dash_offset, dash_list = gc.get_dashes()
+ if dash_list is None:
+ _writeln(self.fh, r"\pgfsetdash{}{0pt}")
+ else:
+ _writeln(self.fh,
+ r"\pgfsetdash{%s}{%fpt}"
+ % ("".join(r"{%fpt}" % dash for dash in dash_list),
+ dash_offset))
+
+ def _print_pgf_path(self, gc, path, transform, rgbFace=None):
+ f = 1. / self.dpi
+ # check for clip box / ignore clip for filled paths
+ bbox = gc.get_clip_rectangle() if gc else None
+ maxcoord = 16383 / 72.27 * self.dpi # Max dimensions in LaTeX.
+ if bbox and (rgbFace is None):
+ p1, p2 = bbox.get_points()
+ clip = (max(p1[0], -maxcoord), max(p1[1], -maxcoord),
+ min(p2[0], maxcoord), min(p2[1], maxcoord))
+ else:
+ clip = (-maxcoord, -maxcoord, maxcoord, maxcoord)
+ # build path
+ for points, code in path.iter_segments(transform, clip=clip):
+ if code == Path.MOVETO:
+ x, y = tuple(points)
+ _writeln(self.fh,
+ r"\pgfpathmoveto{\pgfqpoint{%fin}{%fin}}" %
+ (f * x, f * y))
+ elif code == Path.CLOSEPOLY:
+ _writeln(self.fh, r"\pgfpathclose")
+ elif code == Path.LINETO:
+ x, y = tuple(points)
+ _writeln(self.fh,
+ r"\pgfpathlineto{\pgfqpoint{%fin}{%fin}}" %
+ (f * x, f * y))
+ elif code == Path.CURVE3:
+ cx, cy, px, py = tuple(points)
+ coords = cx * f, cy * f, px * f, py * f
+ _writeln(self.fh,
+ r"\pgfpathquadraticcurveto"
+ r"{\pgfqpoint{%fin}{%fin}}{\pgfqpoint{%fin}{%fin}}"
+ % coords)
+ elif code == Path.CURVE4:
+ c1x, c1y, c2x, c2y, px, py = tuple(points)
+ coords = c1x * f, c1y * f, c2x * f, c2y * f, px * f, py * f
+ _writeln(self.fh,
+ r"\pgfpathcurveto"
+ r"{\pgfqpoint{%fin}{%fin}}"
+ r"{\pgfqpoint{%fin}{%fin}}"
+ r"{\pgfqpoint{%fin}{%fin}}"
+ % coords)
+
+ # apply pgf decorators
+ sketch_params = gc.get_sketch_params() if gc else None
+ if sketch_params is not None:
+ # Only "length" directly maps to "segment length" in PGF's API.
+ # PGF uses "amplitude" to pass the combined deviation in both x-
+ # and y-direction, while matplotlib only varies the length of the
+ # wiggle along the line ("randomness" and "length" parameters)
+ # and has a separate "scale" argument for the amplitude.
+ # -> Use "randomness" as PRNG seed to allow the user to force the
+ # same shape on multiple sketched lines
+ scale, length, randomness = sketch_params
+ if scale is not None:
+ # make matplotlib and PGF rendering visually similar
+ length *= 0.5
+ scale *= 2
+ # PGF guarantees that repeated loading is a no-op
+ _writeln(self.fh, r"\usepgfmodule{decorations}")
+ _writeln(self.fh, r"\usepgflibrary{decorations.pathmorphing}")
+ _writeln(self.fh, r"\pgfkeys{/pgf/decoration/.cd, "
+ f"segment length = {(length * f):f}in, "
+ f"amplitude = {(scale * f):f}in}}")
+ _writeln(self.fh, f"\\pgfmathsetseed{{{int(randomness)}}}")
+ _writeln(self.fh, r"\pgfdecoratecurrentpath{random steps}")
+
+ def _pgf_path_draw(self, stroke=True, fill=False):
+ actions = []
+ if stroke:
+ actions.append("stroke")
+ if fill:
+ actions.append("fill")
+ _writeln(self.fh, r"\pgfusepath{%s}" % ",".join(actions))
+
+ def option_scale_image(self):
+ # docstring inherited
+ return True
+
+ def option_image_nocomposite(self):
+ # docstring inherited
+ return not mpl.rcParams['image.composite_image']
+
+ def draw_image(self, gc, x, y, im, transform=None):
+ # docstring inherited
+
+ h, w = im.shape[:2]
+ if w == 0 or h == 0:
+ return
+
+ if not os.path.exists(getattr(self.fh, "name", "")):
+ raise ValueError(
+ "streamed pgf-code does not support raster graphics, consider "
+ "using the pgf-to-pdf option")
+
+ # save the images to png files
+ path = pathlib.Path(self.fh.name)
+ fname_img = "%s-img%d.png" % (path.stem, self.image_counter)
+ Image.fromarray(im[::-1]).save(path.parent / fname_img)
+ self.image_counter += 1
+
+ # reference the image in the pgf picture
+ _writeln(self.fh, r"\begin{pgfscope}")
+ self._print_pgf_clip(gc)
+ f = 1. / self.dpi # from display coords to inch
+ if transform is None:
+ _writeln(self.fh,
+ r"\pgfsys@transformshift{%fin}{%fin}" % (x * f, y * f))
+ w, h = w * f, h * f
+ else:
+ tr1, tr2, tr3, tr4, tr5, tr6 = transform.frozen().to_values()
+ _writeln(self.fh,
+ r"\pgfsys@transformcm{%f}{%f}{%f}{%f}{%fin}{%fin}" %
+ (tr1 * f, tr2 * f, tr3 * f, tr4 * f,
+ (tr5 + x) * f, (tr6 + y) * f))
+ w = h = 1 # scale is already included in the transform
+ interp = str(transform is None).lower() # interpolation in PDF reader
+ _writeln(self.fh,
+ r"\pgftext[left,bottom]"
+ r"{%s[interpolate=%s,width=%fin,height=%fin]{%s}}" %
+ (_get_image_inclusion_command(),
+ interp, w, h, fname_img))
+ _writeln(self.fh, r"\end{pgfscope}")
+
+ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
+ # docstring inherited
+ self.draw_text(gc, x, y, s, prop, angle, ismath="TeX", mtext=mtext)
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ # docstring inherited
+
+ # prepare string for tex
+ s = _escape_and_apply_props(s, prop)
+
+ _writeln(self.fh, r"\begin{pgfscope}")
+ self._print_pgf_clip(gc)
+
+ alpha = gc.get_alpha()
+ if alpha != 1.0:
+ _writeln(self.fh, r"\pgfsetfillopacity{%f}" % alpha)
+ _writeln(self.fh, r"\pgfsetstrokeopacity{%f}" % alpha)
+ rgb = tuple(gc.get_rgb())[:3]
+ _writeln(self.fh, r"\definecolor{textcolor}{rgb}{%f,%f,%f}" % rgb)
+ _writeln(self.fh, r"\pgfsetstrokecolor{textcolor}")
+ _writeln(self.fh, r"\pgfsetfillcolor{textcolor}")
+ s = r"\color{textcolor}" + s
+
+ dpi = self.figure.dpi
+ text_args = []
+ if mtext and (
+ (angle == 0 or
+ mtext.get_rotation_mode() == "anchor") and
+ mtext.get_verticalalignment() != "center_baseline"):
+ # if text anchoring can be supported, get the original coordinates
+ # and add alignment information
+ pos = mtext.get_unitless_position()
+ x, y = mtext.get_transform().transform(pos)
+ halign = {"left": "left", "right": "right", "center": ""}
+ valign = {"top": "top", "bottom": "bottom",
+ "baseline": "base", "center": ""}
+ text_args.extend([
+ f"x={x/dpi:f}in",
+ f"y={y/dpi:f}in",
+ halign[mtext.get_horizontalalignment()],
+ valign[mtext.get_verticalalignment()],
+ ])
+ else:
+ # if not, use the text layout provided by Matplotlib.
+ text_args.append(f"x={x/dpi:f}in, y={y/dpi:f}in, left, base")
+
+ if angle != 0:
+ text_args.append("rotate=%f" % angle)
+
+ _writeln(self.fh, r"\pgftext[%s]{%s}" % (",".join(text_args), s))
+ _writeln(self.fh, r"\end{pgfscope}")
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ # docstring inherited
+ # get text metrics in units of latex pt, convert to display units
+ w, h, d = (LatexManager._get_cached_or_new()
+ .get_width_height_descent(s, prop))
+ # TODO: this should be latex_pt_to_in instead of mpl_pt_to_in
+ # but having a little bit more space around the text looks better,
+ # plus the bounding box reported by LaTeX is VERY narrow
+ f = mpl_pt_to_in * self.dpi
+ return w * f, h * f, d * f
+
+ def flipy(self):
+ # docstring inherited
+ return False
+
+ def get_canvas_width_height(self):
+ # docstring inherited
+ return (self.figure.get_figwidth() * self.dpi,
+ self.figure.get_figheight() * self.dpi)
+
+ def points_to_pixels(self, points):
+ # docstring inherited
+ return points * mpl_pt_to_in * self.dpi
+
+
+class FigureCanvasPgf(FigureCanvasBase):
+ filetypes = {"pgf": "LaTeX PGF picture",
+ "pdf": "LaTeX compiled PGF picture",
+ "png": "Portable Network Graphics", }
+
+ def get_default_filetype(self):
+ return 'pdf'
+
+ def _print_pgf_to_fh(self, fh, *, bbox_inches_restore=None):
+
+ header_text = """%% Creator: Matplotlib, PGF backend
+%%
+%% To include the figure in your LaTeX document, write
+%% \\input{.pgf}
+%%
+%% Make sure the required packages are loaded in your preamble
+%% \\usepackage{pgf}
+%%
+%% Also ensure that all the required font packages are loaded; for instance,
+%% the lmodern package is sometimes necessary when using math font.
+%% \\usepackage{lmodern}
+%%
+%% Figures using additional raster images can only be included by \\input if
+%% they are in the same directory as the main LaTeX file. For loading figures
+%% from other directories you can use the `import` package
+%% \\usepackage{import}
+%%
+%% and then include the figures with
+%% \\import{}{.pgf}
+%%
+"""
+
+ # append the preamble used by the backend as a comment for debugging
+ header_info_preamble = ["%% Matplotlib used the following preamble"]
+ for line in _get_preamble().splitlines():
+ header_info_preamble.append("%% " + line)
+ header_info_preamble.append("%%")
+ header_info_preamble = "\n".join(header_info_preamble)
+
+ # get figure size in inch
+ w, h = self.figure.get_figwidth(), self.figure.get_figheight()
+ dpi = self.figure.dpi
+
+ # create pgfpicture environment and write the pgf code
+ fh.write(header_text)
+ fh.write(header_info_preamble)
+ fh.write("\n")
+ _writeln(fh, r"\begingroup")
+ _writeln(fh, r"\makeatletter")
+ _writeln(fh, r"\begin{pgfpicture}")
+ _writeln(fh,
+ r"\pgfpathrectangle{\pgfpointorigin}{\pgfqpoint{%fin}{%fin}}"
+ % (w, h))
+ _writeln(fh, r"\pgfusepath{use as bounding box, clip}")
+ renderer = MixedModeRenderer(self.figure, w, h, dpi,
+ RendererPgf(self.figure, fh),
+ bbox_inches_restore=bbox_inches_restore)
+ self.figure.draw(renderer)
+
+ # end the pgfpicture environment
+ _writeln(fh, r"\end{pgfpicture}")
+ _writeln(fh, r"\makeatother")
+ _writeln(fh, r"\endgroup")
+
+ def print_pgf(self, fname_or_fh, **kwargs):
+ """
+ Output pgf macros for drawing the figure so it can be included and
+ rendered in latex documents.
+ """
+ with cbook.open_file_cm(fname_or_fh, "w", encoding="utf-8") as file:
+ if not cbook.file_requires_unicode(file):
+ file = codecs.getwriter("utf-8")(file)
+ self._print_pgf_to_fh(file, **kwargs)
+
+ def print_pdf(self, fname_or_fh, *, metadata=None, **kwargs):
+ """Use LaTeX to compile a pgf generated figure to pdf."""
+ w, h = self.figure.get_size_inches()
+
+ info_dict = _create_pdf_info_dict('pgf', metadata or {})
+ pdfinfo = ','.join(
+ _metadata_to_str(k, v) for k, v in info_dict.items())
+
+ # print figure to pgf and compile it with latex
+ with TemporaryDirectory() as tmpdir:
+ tmppath = pathlib.Path(tmpdir)
+ self.print_pgf(tmppath / "figure.pgf", **kwargs)
+ (tmppath / "figure.tex").write_text(
+ "\n".join([
+ _DOCUMENTCLASS,
+ r"\usepackage[pdfinfo={%s}]{hyperref}" % pdfinfo,
+ r"\usepackage[papersize={%fin,%fin}, margin=0in]{geometry}"
+ % (w, h),
+ r"\usepackage{pgf}",
+ _get_preamble(),
+ r"\begin{document}",
+ r"\centering",
+ r"\input{figure.pgf}",
+ r"\end{document}",
+ ]), encoding="utf-8")
+ texcommand = mpl.rcParams["pgf.texsystem"]
+ cbook._check_and_log_subprocess(
+ [texcommand, "-interaction=nonstopmode", "-halt-on-error",
+ "figure.tex"], _log, cwd=tmpdir)
+ with ((tmppath / "figure.pdf").open("rb") as orig,
+ cbook.open_file_cm(fname_or_fh, "wb") as dest):
+ shutil.copyfileobj(orig, dest) # copy file contents to target
+
+ def print_png(self, fname_or_fh, **kwargs):
+ """Use LaTeX to compile a pgf figure to pdf and convert it to png."""
+ converter = make_pdf_to_png_converter()
+ with TemporaryDirectory() as tmpdir:
+ tmppath = pathlib.Path(tmpdir)
+ pdf_path = tmppath / "figure.pdf"
+ png_path = tmppath / "figure.png"
+ self.print_pdf(pdf_path, **kwargs)
+ converter(pdf_path, png_path, dpi=self.figure.dpi)
+ with (png_path.open("rb") as orig,
+ cbook.open_file_cm(fname_or_fh, "wb") as dest):
+ shutil.copyfileobj(orig, dest) # copy file contents to target
+
+ def get_renderer(self):
+ return RendererPgf(self.figure, None)
+
+ def draw(self):
+ self.figure.draw_without_rendering()
+ return super().draw()
+
+
+FigureManagerPgf = FigureManagerBase
+
+
+@_Backend.export
+class _BackendPgf(_Backend):
+ FigureCanvas = FigureCanvasPgf
+
+
+class PdfPages:
+ """
+ A multi-page PDF file using the pgf backend
+
+ Examples
+ --------
+ >>> import matplotlib.pyplot as plt
+ >>> # Initialize:
+ >>> with PdfPages('foo.pdf') as pdf:
+ ... # As many times as you like, create a figure fig and save it:
+ ... fig = plt.figure()
+ ... pdf.savefig(fig)
+ ... # When no figure is specified the current figure is saved
+ ... pdf.savefig()
+ """
+
+ def __init__(self, filename, *, metadata=None):
+ """
+ Create a new PdfPages object.
+
+ Parameters
+ ----------
+ filename : str or path-like
+ Plots using `PdfPages.savefig` will be written to a file at this
+ location. Any older file with the same name is overwritten.
+
+ metadata : dict, optional
+ Information dictionary object (see PDF reference section 10.2.1
+ 'Document Information Dictionary'), e.g.:
+ ``{'Creator': 'My software', 'Author': 'Me', 'Title': 'Awesome'}``.
+
+ The standard keys are 'Title', 'Author', 'Subject', 'Keywords',
+ 'Creator', 'Producer', 'CreationDate', 'ModDate', and
+ 'Trapped'. Values have been predefined for 'Creator', 'Producer'
+ and 'CreationDate'. They can be removed by setting them to `None`.
+
+ Note that some versions of LaTeX engines may ignore the 'Producer'
+ key and set it to themselves.
+ """
+ self._output_name = filename
+ self._n_figures = 0
+ self._metadata = (metadata or {}).copy()
+ self._info_dict = _create_pdf_info_dict('pgf', self._metadata)
+ self._file = BytesIO()
+
+ def _write_header(self, width_inches, height_inches):
+ pdfinfo = ','.join(
+ _metadata_to_str(k, v) for k, v in self._info_dict.items())
+ latex_header = "\n".join([
+ _DOCUMENTCLASS,
+ r"\usepackage[pdfinfo={%s}]{hyperref}" % pdfinfo,
+ r"\usepackage[papersize={%fin,%fin}, margin=0in]{geometry}"
+ % (width_inches, height_inches),
+ r"\usepackage{pgf}",
+ _get_preamble(),
+ r"\setlength{\parindent}{0pt}",
+ r"\begin{document}%",
+ ])
+ self._file.write(latex_header.encode('utf-8'))
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.close()
+
+ def close(self):
+ """
+ Finalize this object, running LaTeX in a temporary directory
+ and moving the final pdf file to *filename*.
+ """
+ self._file.write(rb'\end{document}\n')
+ if self._n_figures > 0:
+ self._run_latex()
+ self._file.close()
+
+ def _run_latex(self):
+ texcommand = mpl.rcParams["pgf.texsystem"]
+ with TemporaryDirectory() as tmpdir:
+ tex_source = pathlib.Path(tmpdir, "pdf_pages.tex")
+ tex_source.write_bytes(self._file.getvalue())
+ cbook._check_and_log_subprocess(
+ [texcommand, "-interaction=nonstopmode", "-halt-on-error",
+ tex_source],
+ _log, cwd=tmpdir)
+ shutil.move(tex_source.with_suffix(".pdf"), self._output_name)
+
+ def savefig(self, figure=None, **kwargs):
+ """
+ Save a `.Figure` to this file as a new page.
+
+ Any other keyword arguments are passed to `~.Figure.savefig`.
+
+ Parameters
+ ----------
+ figure : `.Figure` or int, default: the active figure
+ The figure, or index of the figure, that is saved to the file.
+ """
+ if not isinstance(figure, Figure):
+ if figure is None:
+ manager = Gcf.get_active()
+ else:
+ manager = Gcf.get_fig_manager(figure)
+ if manager is None:
+ raise ValueError(f"No figure {figure}")
+ figure = manager.canvas.figure
+
+ width, height = figure.get_size_inches()
+ if self._n_figures == 0:
+ self._write_header(width, height)
+ else:
+ # \pdfpagewidth and \pdfpageheight exist on pdftex, xetex, and
+ # luatex<0.85; they were renamed to \pagewidth and \pageheight
+ # on luatex>=0.85.
+ self._file.write(
+ rb'\newpage'
+ rb'\ifdefined\pdfpagewidth\pdfpagewidth\else\pagewidth\fi=%fin'
+ rb'\ifdefined\pdfpageheight\pdfpageheight\else\pageheight\fi=%fin'
+ b'%%\n' % (width, height)
+ )
+ figure.savefig(self._file, format="pgf", backend="pgf", **kwargs)
+ self._n_figures += 1
+
+ def get_pagecount(self):
+ """Return the current number of pages in the multipage pdf file."""
+ return self._n_figures
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_ps.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_ps.py
new file mode 100644
index 0000000000000000000000000000000000000000..f1f914ae54205b9b77ae1db910885770cc9bfdec
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_ps.py
@@ -0,0 +1,1481 @@
+"""
+A PostScript backend, which can produce both PostScript .ps and .eps.
+"""
+
+import bisect
+import codecs
+import datetime
+from enum import Enum
+import functools
+from io import StringIO
+import itertools
+import logging
+import math
+import os
+import pathlib
+import shutil
+import struct
+from tempfile import TemporaryDirectory
+import textwrap
+import time
+
+import fontTools
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cbook, _path, _text_helpers
+from matplotlib._afm import AFM
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, RendererBase)
+from matplotlib.cbook import is_writable_file_like, file_requires_unicode
+from matplotlib.font_manager import get_font
+from matplotlib.ft2font import LoadFlags
+from matplotlib._mathtext_data import uni2type1
+from matplotlib.path import Path
+from matplotlib.texmanager import TexManager
+from matplotlib.transforms import Affine2D
+from matplotlib.backends.backend_mixed import MixedModeRenderer
+from . import _backend_pdf_ps
+
+
+_log = logging.getLogger(__name__)
+debugPS = False
+
+
+papersize = {'letter': (8.5, 11),
+ 'legal': (8.5, 14),
+ 'ledger': (11, 17),
+ 'a0': (33.11, 46.81),
+ 'a1': (23.39, 33.11),
+ 'a2': (16.54, 23.39),
+ 'a3': (11.69, 16.54),
+ 'a4': (8.27, 11.69),
+ 'a5': (5.83, 8.27),
+ 'a6': (4.13, 5.83),
+ 'a7': (2.91, 4.13),
+ 'a8': (2.05, 2.91),
+ 'a9': (1.46, 2.05),
+ 'a10': (1.02, 1.46),
+ 'b0': (40.55, 57.32),
+ 'b1': (28.66, 40.55),
+ 'b2': (20.27, 28.66),
+ 'b3': (14.33, 20.27),
+ 'b4': (10.11, 14.33),
+ 'b5': (7.16, 10.11),
+ 'b6': (5.04, 7.16),
+ 'b7': (3.58, 5.04),
+ 'b8': (2.51, 3.58),
+ 'b9': (1.76, 2.51),
+ 'b10': (1.26, 1.76)}
+
+
+def _nums_to_str(*args, sep=" "):
+ return sep.join(f"{arg:1.3f}".rstrip("0").rstrip(".") for arg in args)
+
+
+def _move_path_to_path_or_stream(src, dst):
+ """
+ Move the contents of file at *src* to path-or-filelike *dst*.
+
+ If *dst* is a path, the metadata of *src* are *not* copied.
+ """
+ if is_writable_file_like(dst):
+ fh = (open(src, encoding='latin-1')
+ if file_requires_unicode(dst)
+ else open(src, 'rb'))
+ with fh:
+ shutil.copyfileobj(fh, dst)
+ else:
+ shutil.move(src, dst, copy_function=shutil.copyfile)
+
+
+def _font_to_ps_type3(font_path, chars):
+ """
+ Subset *chars* from the font at *font_path* into a Type 3 font.
+
+ Parameters
+ ----------
+ font_path : path-like
+ Path to the font to be subsetted.
+ chars : str
+ The characters to include in the subsetted font.
+
+ Returns
+ -------
+ str
+ The string representation of a Type 3 font, which can be included
+ verbatim into a PostScript file.
+ """
+ font = get_font(font_path, hinting_factor=1)
+ glyph_ids = [font.get_char_index(c) for c in chars]
+
+ preamble = """\
+%!PS-Adobe-3.0 Resource-Font
+%%Creator: Converted from TrueType to Type 3 by Matplotlib.
+10 dict begin
+/FontName /{font_name} def
+/PaintType 0 def
+/FontMatrix [{inv_units_per_em} 0 0 {inv_units_per_em} 0 0] def
+/FontBBox [{bbox}] def
+/FontType 3 def
+/Encoding [{encoding}] def
+/CharStrings {num_glyphs} dict dup begin
+/.notdef 0 def
+""".format(font_name=font.postscript_name,
+ inv_units_per_em=1 / font.units_per_EM,
+ bbox=" ".join(map(str, font.bbox)),
+ encoding=" ".join(f"/{font.get_glyph_name(glyph_id)}"
+ for glyph_id in glyph_ids),
+ num_glyphs=len(glyph_ids) + 1)
+ postamble = """
+end readonly def
+
+/BuildGlyph {
+ exch begin
+ CharStrings exch
+ 2 copy known not {pop /.notdef} if
+ true 3 1 roll get exec
+ end
+} _d
+
+/BuildChar {
+ 1 index /Encoding get exch get
+ 1 index /BuildGlyph get exec
+} _d
+
+FontName currentdict end definefont pop
+"""
+
+ entries = []
+ for glyph_id in glyph_ids:
+ g = font.load_glyph(glyph_id, LoadFlags.NO_SCALE)
+ v, c = font.get_path()
+ entries.append(
+ "/%(name)s{%(bbox)s sc\n" % {
+ "name": font.get_glyph_name(glyph_id),
+ "bbox": " ".join(map(str, [g.horiAdvance, 0, *g.bbox])),
+ }
+ + _path.convert_to_string(
+ # Convert back to TrueType's internal units (1/64's).
+ # (Other dimensions are already in these units.)
+ Path(v * 64, c), None, None, False, None, 0,
+ # No code for quad Beziers triggers auto-conversion to cubics.
+ # Drop intermediate closepolys (relying on the outline
+ # decomposer always explicitly moving to the closing point
+ # first).
+ [b"m", b"l", b"", b"c", b""], True).decode("ascii")
+ + "ce} _d"
+ )
+
+ return preamble + "\n".join(entries) + postamble
+
+
+def _font_to_ps_type42(font_path, chars, fh):
+ """
+ Subset *chars* from the font at *font_path* into a Type 42 font at *fh*.
+
+ Parameters
+ ----------
+ font_path : path-like
+ Path to the font to be subsetted.
+ chars : str
+ The characters to include in the subsetted font.
+ fh : file-like
+ Where to write the font.
+ """
+ subset_str = ''.join(chr(c) for c in chars)
+ _log.debug("SUBSET %s characters: %s", font_path, subset_str)
+ try:
+ kw = {}
+ # fix this once we support loading more fonts from a collection
+ # https://github.com/matplotlib/matplotlib/issues/3135#issuecomment-571085541
+ if font_path.endswith('.ttc'):
+ kw['fontNumber'] = 0
+ with (fontTools.ttLib.TTFont(font_path, **kw) as font,
+ _backend_pdf_ps.get_glyphs_subset(font_path, subset_str) as subset):
+ fontdata = _backend_pdf_ps.font_as_file(subset).getvalue()
+ _log.debug(
+ "SUBSET %s %d -> %d", font_path, os.stat(font_path).st_size,
+ len(fontdata)
+ )
+ fh.write(_serialize_type42(font, subset, fontdata))
+ except RuntimeError:
+ _log.warning(
+ "The PostScript backend does not currently support the selected font (%s).",
+ font_path)
+ raise
+
+
+def _serialize_type42(font, subset, fontdata):
+ """
+ Output a PostScript Type-42 format representation of font
+
+ Parameters
+ ----------
+ font : fontTools.ttLib.ttFont.TTFont
+ The original font object
+ subset : fontTools.ttLib.ttFont.TTFont
+ The subset font object
+ fontdata : bytes
+ The raw font data in TTF format
+
+ Returns
+ -------
+ str
+ The Type-42 formatted font
+ """
+ version, breakpoints = _version_and_breakpoints(font.get('loca'), fontdata)
+ post = font['post']
+ name = font['name']
+ chars = _generate_charstrings(subset)
+ sfnts = _generate_sfnts(fontdata, subset, breakpoints)
+ return textwrap.dedent(f"""
+ %%!PS-TrueTypeFont-{version[0]}.{version[1]}-{font['head'].fontRevision:.7f}
+ 10 dict begin
+ /FontType 42 def
+ /FontMatrix [1 0 0 1 0 0] def
+ /FontName /{name.getDebugName(6)} def
+ /FontInfo 7 dict dup begin
+ /FullName ({name.getDebugName(4)}) def
+ /FamilyName ({name.getDebugName(1)}) def
+ /Version ({name.getDebugName(5)}) def
+ /ItalicAngle {post.italicAngle} def
+ /isFixedPitch {'true' if post.isFixedPitch else 'false'} def
+ /UnderlinePosition {post.underlinePosition} def
+ /UnderlineThickness {post.underlineThickness} def
+ end readonly def
+ /Encoding StandardEncoding def
+ /FontBBox [{_nums_to_str(*_bounds(font))}] def
+ /PaintType 0 def
+ /CIDMap 0 def
+ {chars}
+ {sfnts}
+ FontName currentdict end definefont pop
+ """)
+
+
+def _version_and_breakpoints(loca, fontdata):
+ """
+ Read the version number of the font and determine sfnts breakpoints.
+
+ When a TrueType font file is written as a Type 42 font, it has to be
+ broken into substrings of at most 65535 bytes. These substrings must
+ begin at font table boundaries or glyph boundaries in the glyf table.
+ This function determines all possible breakpoints and it is the caller's
+ responsibility to do the splitting.
+
+ Helper function for _font_to_ps_type42.
+
+ Parameters
+ ----------
+ loca : fontTools.ttLib._l_o_c_a.table__l_o_c_a or None
+ The loca table of the font if available
+ fontdata : bytes
+ The raw data of the font
+
+ Returns
+ -------
+ version : tuple[int, int]
+ A 2-tuple of the major version number and minor version number.
+ breakpoints : list[int]
+ The breakpoints is a sorted list of offsets into fontdata; if loca is not
+ available, just the table boundaries.
+ """
+ v1, v2, numTables = struct.unpack('>3h', fontdata[:6])
+ version = (v1, v2)
+
+ tables = {}
+ for i in range(numTables):
+ tag, _, offset, _ = struct.unpack('>4sIII', fontdata[12 + i*16:12 + (i+1)*16])
+ tables[tag.decode('ascii')] = offset
+ if loca is not None:
+ glyf_breakpoints = {tables['glyf'] + offset for offset in loca.locations[:-1]}
+ else:
+ glyf_breakpoints = set()
+ breakpoints = sorted({*tables.values(), *glyf_breakpoints, len(fontdata)})
+
+ return version, breakpoints
+
+
+def _bounds(font):
+ """
+ Compute the font bounding box, as if all glyphs were written
+ at the same start position.
+
+ Helper function for _font_to_ps_type42.
+
+ Parameters
+ ----------
+ font : fontTools.ttLib.ttFont.TTFont
+ The font
+
+ Returns
+ -------
+ tuple
+ (xMin, yMin, xMax, yMax) of the combined bounding box
+ of all the glyphs in the font
+ """
+ gs = font.getGlyphSet(False)
+ pen = fontTools.pens.boundsPen.BoundsPen(gs)
+ for name in gs.keys():
+ gs[name].draw(pen)
+ return pen.bounds or (0, 0, 0, 0)
+
+
+def _generate_charstrings(font):
+ """
+ Transform font glyphs into CharStrings
+
+ Helper function for _font_to_ps_type42.
+
+ Parameters
+ ----------
+ font : fontTools.ttLib.ttFont.TTFont
+ The font
+
+ Returns
+ -------
+ str
+ A definition of the CharStrings dictionary in PostScript
+ """
+ go = font.getGlyphOrder()
+ s = f'/CharStrings {len(go)} dict dup begin\n'
+ for i, name in enumerate(go):
+ s += f'/{name} {i} def\n'
+ s += 'end readonly def'
+ return s
+
+
+def _generate_sfnts(fontdata, font, breakpoints):
+ """
+ Transform font data into PostScript sfnts format.
+
+ Helper function for _font_to_ps_type42.
+
+ Parameters
+ ----------
+ fontdata : bytes
+ The raw data of the font
+ font : fontTools.ttLib.ttFont.TTFont
+ The fontTools font object
+ breakpoints : list
+ Sorted offsets of possible breakpoints
+
+ Returns
+ -------
+ str
+ The sfnts array for the font definition, consisting
+ of hex-encoded strings in PostScript format
+ """
+ s = '/sfnts['
+ pos = 0
+ while pos < len(fontdata):
+ i = bisect.bisect_left(breakpoints, pos + 65534)
+ newpos = breakpoints[i-1]
+ if newpos <= pos:
+ # have to accept a larger string
+ newpos = breakpoints[-1]
+ s += f'<{fontdata[pos:newpos].hex()}00>' # Always NUL terminate.
+ pos = newpos
+ s += ']def'
+ return '\n'.join(s[i:i+100] for i in range(0, len(s), 100))
+
+
+def _log_if_debug_on(meth):
+ """
+ Wrap `RendererPS` method *meth* to emit a PS comment with the method name,
+ if the global flag `debugPS` is set.
+ """
+ @functools.wraps(meth)
+ def wrapper(self, *args, **kwargs):
+ if debugPS:
+ self._pswriter.write(f"% {meth.__name__}\n")
+ return meth(self, *args, **kwargs)
+
+ return wrapper
+
+
+class RendererPS(_backend_pdf_ps.RendererPDFPSBase):
+ """
+ The renderer handles all the drawing primitives using a graphics
+ context instance that controls the colors/styles.
+ """
+
+ _afm_font_dir = cbook._get_data_path("fonts/afm")
+ _use_afm_rc_name = "ps.useafm"
+
+ def __init__(self, width, height, pswriter, imagedpi=72):
+ # Although postscript itself is dpi independent, we need to inform the
+ # image code about a requested dpi to generate high resolution images
+ # and them scale them before embedding them.
+ super().__init__(width, height)
+ self._pswriter = pswriter
+ if mpl.rcParams['text.usetex']:
+ self.textcnt = 0
+ self.psfrag = []
+ self.imagedpi = imagedpi
+
+ # current renderer state (None=uninitialised)
+ self.color = None
+ self.linewidth = None
+ self.linejoin = None
+ self.linecap = None
+ self.linedash = None
+ self.fontname = None
+ self.fontsize = None
+ self._hatches = {}
+ self.image_magnification = imagedpi / 72
+ self._clip_paths = {}
+ self._path_collection_id = 0
+
+ self._character_tracker = _backend_pdf_ps.CharacterTracker()
+ self._logwarn_once = functools.cache(_log.warning)
+
+ def _is_transparent(self, rgb_or_rgba):
+ if rgb_or_rgba is None:
+ return True # Consistent with rgbFace semantics.
+ elif len(rgb_or_rgba) == 4:
+ if rgb_or_rgba[3] == 0:
+ return True
+ if rgb_or_rgba[3] != 1:
+ self._logwarn_once(
+ "The PostScript backend does not support transparency; "
+ "partially transparent artists will be rendered opaque.")
+ return False
+ else: # len() == 3.
+ return False
+
+ def set_color(self, r, g, b, store=True):
+ if (r, g, b) != self.color:
+ self._pswriter.write(f"{_nums_to_str(r)} setgray\n"
+ if r == g == b else
+ f"{_nums_to_str(r, g, b)} setrgbcolor\n")
+ if store:
+ self.color = (r, g, b)
+
+ def set_linewidth(self, linewidth, store=True):
+ linewidth = float(linewidth)
+ if linewidth != self.linewidth:
+ self._pswriter.write(f"{_nums_to_str(linewidth)} setlinewidth\n")
+ if store:
+ self.linewidth = linewidth
+
+ @staticmethod
+ def _linejoin_cmd(linejoin):
+ # Support for directly passing integer values is for backcompat.
+ linejoin = {'miter': 0, 'round': 1, 'bevel': 2, 0: 0, 1: 1, 2: 2}[
+ linejoin]
+ return f"{linejoin:d} setlinejoin\n"
+
+ def set_linejoin(self, linejoin, store=True):
+ if linejoin != self.linejoin:
+ self._pswriter.write(self._linejoin_cmd(linejoin))
+ if store:
+ self.linejoin = linejoin
+
+ @staticmethod
+ def _linecap_cmd(linecap):
+ # Support for directly passing integer values is for backcompat.
+ linecap = {'butt': 0, 'round': 1, 'projecting': 2, 0: 0, 1: 1, 2: 2}[
+ linecap]
+ return f"{linecap:d} setlinecap\n"
+
+ def set_linecap(self, linecap, store=True):
+ if linecap != self.linecap:
+ self._pswriter.write(self._linecap_cmd(linecap))
+ if store:
+ self.linecap = linecap
+
+ def set_linedash(self, offset, seq, store=True):
+ if self.linedash is not None:
+ oldo, oldseq = self.linedash
+ if np.array_equal(seq, oldseq) and oldo == offset:
+ return
+
+ self._pswriter.write(f"[{_nums_to_str(*seq)}] {_nums_to_str(offset)} setdash\n"
+ if seq is not None and len(seq) else
+ "[] 0 setdash\n")
+ if store:
+ self.linedash = (offset, seq)
+
+ def set_font(self, fontname, fontsize, store=True):
+ if (fontname, fontsize) != (self.fontname, self.fontsize):
+ self._pswriter.write(f"/{fontname} {fontsize:1.3f} selectfont\n")
+ if store:
+ self.fontname = fontname
+ self.fontsize = fontsize
+
+ def create_hatch(self, hatch, linewidth):
+ sidelen = 72
+ if hatch in self._hatches:
+ return self._hatches[hatch]
+ name = 'H%d' % len(self._hatches)
+ pageheight = self.height * 72
+ self._pswriter.write(f"""\
+ << /PatternType 1
+ /PaintType 2
+ /TilingType 2
+ /BBox[0 0 {sidelen:d} {sidelen:d}]
+ /XStep {sidelen:d}
+ /YStep {sidelen:d}
+
+ /PaintProc {{
+ pop
+ {linewidth:g} setlinewidth
+{self._convert_path(Path.hatch(hatch), Affine2D().scale(sidelen), simplify=False)}
+ gsave
+ fill
+ grestore
+ stroke
+ }} bind
+ >>
+ matrix
+ 0 {pageheight:g} translate
+ makepattern
+ /{name} exch def
+""")
+ self._hatches[hatch] = name
+ return name
+
+ def get_image_magnification(self):
+ """
+ Get the factor by which to magnify images passed to draw_image.
+ Allows a backend to have images at a different resolution to other
+ artists.
+ """
+ return self.image_magnification
+
+ def _convert_path(self, path, transform, clip=False, simplify=None):
+ if clip:
+ clip = (0.0, 0.0, self.width * 72.0, self.height * 72.0)
+ else:
+ clip = None
+ return _path.convert_to_string(
+ path, transform, clip, simplify, None,
+ 6, [b"m", b"l", b"", b"c", b"cl"], True).decode("ascii")
+
+ def _get_clip_cmd(self, gc):
+ clip = []
+ rect = gc.get_clip_rectangle()
+ if rect is not None:
+ clip.append(f"{_nums_to_str(*rect.p0, *rect.size)} rectclip\n")
+ path, trf = gc.get_clip_path()
+ if path is not None:
+ key = (path, id(trf))
+ custom_clip_cmd = self._clip_paths.get(key)
+ if custom_clip_cmd is None:
+ custom_clip_cmd = "c%d" % len(self._clip_paths)
+ self._pswriter.write(f"""\
+/{custom_clip_cmd} {{
+{self._convert_path(path, trf, simplify=False)}
+clip
+newpath
+}} bind def
+""")
+ self._clip_paths[key] = custom_clip_cmd
+ clip.append(f"{custom_clip_cmd}\n")
+ return "".join(clip)
+
+ @_log_if_debug_on
+ def draw_image(self, gc, x, y, im, transform=None):
+ # docstring inherited
+
+ h, w = im.shape[:2]
+ imagecmd = "false 3 colorimage"
+ data = im[::-1, :, :3] # Vertically flipped rgb values.
+ hexdata = data.tobytes().hex("\n", -64) # Linewrap to 128 chars.
+
+ if transform is None:
+ matrix = "1 0 0 1 0 0"
+ xscale = w / self.image_magnification
+ yscale = h / self.image_magnification
+ else:
+ matrix = " ".join(map(str, transform.frozen().to_values()))
+ xscale = 1.0
+ yscale = 1.0
+
+ self._pswriter.write(f"""\
+gsave
+{self._get_clip_cmd(gc)}
+{x:g} {y:g} translate
+[{matrix}] concat
+{xscale:g} {yscale:g} scale
+/DataString {w:d} string def
+{w:d} {h:d} 8 [ {w:d} 0 0 -{h:d} 0 {h:d} ]
+{{
+currentfile DataString readhexstring pop
+}} bind {imagecmd}
+{hexdata}
+grestore
+""")
+
+ @_log_if_debug_on
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ # docstring inherited
+ clip = rgbFace is None and gc.get_hatch_path() is None
+ simplify = path.should_simplify and clip
+ ps = self._convert_path(path, transform, clip=clip, simplify=simplify)
+ self._draw_ps(ps, gc, rgbFace)
+
+ @_log_if_debug_on
+ def draw_markers(
+ self, gc, marker_path, marker_trans, path, trans, rgbFace=None):
+ # docstring inherited
+
+ ps_color = (
+ None
+ if self._is_transparent(rgbFace)
+ else f'{_nums_to_str(rgbFace[0])} setgray'
+ if rgbFace[0] == rgbFace[1] == rgbFace[2]
+ else f'{_nums_to_str(*rgbFace[:3])} setrgbcolor')
+
+ # construct the generic marker command:
+
+ # don't want the translate to be global
+ ps_cmd = ['/o {', 'gsave', 'newpath', 'translate']
+
+ lw = gc.get_linewidth()
+ alpha = (gc.get_alpha()
+ if gc.get_forced_alpha() or len(gc.get_rgb()) == 3
+ else gc.get_rgb()[3])
+ stroke = lw > 0 and alpha > 0
+ if stroke:
+ ps_cmd.append('%.1f setlinewidth' % lw)
+ ps_cmd.append(self._linejoin_cmd(gc.get_joinstyle()))
+ ps_cmd.append(self._linecap_cmd(gc.get_capstyle()))
+
+ ps_cmd.append(self._convert_path(marker_path, marker_trans,
+ simplify=False))
+
+ if rgbFace:
+ if stroke:
+ ps_cmd.append('gsave')
+ if ps_color:
+ ps_cmd.extend([ps_color, 'fill'])
+ if stroke:
+ ps_cmd.append('grestore')
+
+ if stroke:
+ ps_cmd.append('stroke')
+ ps_cmd.extend(['grestore', '} bind def'])
+
+ for vertices, code in path.iter_segments(
+ trans,
+ clip=(0, 0, self.width*72, self.height*72),
+ simplify=False):
+ if len(vertices):
+ x, y = vertices[-2:]
+ ps_cmd.append(f"{x:g} {y:g} o")
+
+ ps = '\n'.join(ps_cmd)
+ self._draw_ps(ps, gc, rgbFace, fill=False, stroke=False)
+
+ @_log_if_debug_on
+ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
+ offsets, offset_trans, facecolors, edgecolors,
+ linewidths, linestyles, antialiaseds, urls,
+ offset_position):
+ # Is the optimization worth it? Rough calculation:
+ # cost of emitting a path in-line is
+ # (len_path + 2) * uses_per_path
+ # cost of definition+use is
+ # (len_path + 3) + 3 * uses_per_path
+ len_path = len(paths[0].vertices) if len(paths) > 0 else 0
+ uses_per_path = self._iter_collection_uses_per_path(
+ paths, all_transforms, offsets, facecolors, edgecolors)
+ should_do_optimization = \
+ len_path + 3 * uses_per_path + 3 < (len_path + 2) * uses_per_path
+ if not should_do_optimization:
+ return RendererBase.draw_path_collection(
+ self, gc, master_transform, paths, all_transforms,
+ offsets, offset_trans, facecolors, edgecolors,
+ linewidths, linestyles, antialiaseds, urls,
+ offset_position)
+
+ path_codes = []
+ for i, (path, transform) in enumerate(self._iter_collection_raw_paths(
+ master_transform, paths, all_transforms)):
+ name = 'p%d_%d' % (self._path_collection_id, i)
+ path_bytes = self._convert_path(path, transform, simplify=False)
+ self._pswriter.write(f"""\
+/{name} {{
+newpath
+translate
+{path_bytes}
+}} bind def
+""")
+ path_codes.append(name)
+
+ for xo, yo, path_id, gc0, rgbFace in self._iter_collection(
+ gc, path_codes, offsets, offset_trans,
+ facecolors, edgecolors, linewidths, linestyles,
+ antialiaseds, urls, offset_position):
+ ps = f"{xo:g} {yo:g} {path_id}"
+ self._draw_ps(ps, gc0, rgbFace)
+
+ self._path_collection_id += 1
+
+ @_log_if_debug_on
+ def draw_tex(self, gc, x, y, s, prop, angle, *, mtext=None):
+ # docstring inherited
+ if self._is_transparent(gc.get_rgb()):
+ return # Special handling for fully transparent.
+
+ if not hasattr(self, "psfrag"):
+ self._logwarn_once(
+ "The PS backend determines usetex status solely based on "
+ "rcParams['text.usetex'] and does not support having "
+ "usetex=True only for some elements; this element will thus "
+ "be rendered as if usetex=False.")
+ self.draw_text(gc, x, y, s, prop, angle, False, mtext)
+ return
+
+ w, h, bl = self.get_text_width_height_descent(s, prop, ismath="TeX")
+ fontsize = prop.get_size_in_points()
+ thetext = 'psmarker%d' % self.textcnt
+ color = _nums_to_str(*gc.get_rgb()[:3], sep=',')
+ fontcmd = {'sans-serif': r'{\sffamily %s}',
+ 'monospace': r'{\ttfamily %s}'}.get(
+ mpl.rcParams['font.family'][0], r'{\rmfamily %s}')
+ s = fontcmd % s
+ tex = r'\color[rgb]{%s} %s' % (color, s)
+
+ # Stick to bottom-left alignment, so subtract descent from the text-normal
+ # direction since text is normally positioned by its baseline.
+ rangle = np.radians(angle + 90)
+ pos = _nums_to_str(x - bl * np.cos(rangle), y - bl * np.sin(rangle))
+ self.psfrag.append(
+ r'\psfrag{%s}[bl][bl][1][%f]{\fontsize{%f}{%f}%s}' % (
+ thetext, angle, fontsize, fontsize*1.25, tex))
+
+ self._pswriter.write(f"""\
+gsave
+{pos} moveto
+({thetext})
+show
+grestore
+""")
+ self.textcnt += 1
+
+ @_log_if_debug_on
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ # docstring inherited
+
+ if self._is_transparent(gc.get_rgb()):
+ return # Special handling for fully transparent.
+
+ if ismath == 'TeX':
+ return self.draw_tex(gc, x, y, s, prop, angle)
+
+ if ismath:
+ return self.draw_mathtext(gc, x, y, s, prop, angle)
+
+ stream = [] # list of (ps_name, x, char_name)
+
+ if mpl.rcParams['ps.useafm']:
+ font = self._get_font_afm(prop)
+ ps_name = (font.postscript_name.encode("ascii", "replace")
+ .decode("ascii"))
+ scale = 0.001 * prop.get_size_in_points()
+ thisx = 0
+ last_name = None # kerns returns 0 for None.
+ for c in s:
+ name = uni2type1.get(ord(c), f"uni{ord(c):04X}")
+ try:
+ width = font.get_width_from_char_name(name)
+ except KeyError:
+ name = 'question'
+ width = font.get_width_char('?')
+ kern = font.get_kern_dist_from_name(last_name, name)
+ last_name = name
+ thisx += kern * scale
+ stream.append((ps_name, thisx, name))
+ thisx += width * scale
+
+ else:
+ font = self._get_font_ttf(prop)
+ self._character_tracker.track(font, s)
+ for item in _text_helpers.layout(s, font):
+ ps_name = (item.ft_object.postscript_name
+ .encode("ascii", "replace").decode("ascii"))
+ glyph_name = item.ft_object.get_glyph_name(item.glyph_idx)
+ stream.append((ps_name, item.x, glyph_name))
+ self.set_color(*gc.get_rgb())
+
+ for ps_name, group in itertools. \
+ groupby(stream, lambda entry: entry[0]):
+ self.set_font(ps_name, prop.get_size_in_points(), False)
+ thetext = "\n".join(f"{x:g} 0 m /{name:s} glyphshow"
+ for _, x, name in group)
+ self._pswriter.write(f"""\
+gsave
+{self._get_clip_cmd(gc)}
+{x:g} {y:g} translate
+{angle:g} rotate
+{thetext}
+grestore
+""")
+
+ @_log_if_debug_on
+ def draw_mathtext(self, gc, x, y, s, prop, angle):
+ """Draw the math text using matplotlib.mathtext."""
+ width, height, descent, glyphs, rects = \
+ self._text2path.mathtext_parser.parse(s, 72, prop)
+ self.set_color(*gc.get_rgb())
+ self._pswriter.write(
+ f"gsave\n"
+ f"{x:g} {y:g} translate\n"
+ f"{angle:g} rotate\n")
+ lastfont = None
+ for font, fontsize, num, ox, oy in glyphs:
+ self._character_tracker.track_glyph(font, num)
+ if (font.postscript_name, fontsize) != lastfont:
+ lastfont = font.postscript_name, fontsize
+ self._pswriter.write(
+ f"/{font.postscript_name} {fontsize} selectfont\n")
+ glyph_name = (
+ font.get_name_char(chr(num)) if isinstance(font, AFM) else
+ font.get_glyph_name(font.get_char_index(num)))
+ self._pswriter.write(
+ f"{ox:g} {oy:g} moveto\n"
+ f"/{glyph_name} glyphshow\n")
+ for ox, oy, w, h in rects:
+ self._pswriter.write(f"{ox} {oy} {w} {h} rectfill\n")
+ self._pswriter.write("grestore\n")
+
+ @_log_if_debug_on
+ def draw_gouraud_triangles(self, gc, points, colors, trans):
+ assert len(points) == len(colors)
+ if len(points) == 0:
+ return
+ assert points.ndim == 3
+ assert points.shape[1] == 3
+ assert points.shape[2] == 2
+ assert colors.ndim == 3
+ assert colors.shape[1] == 3
+ assert colors.shape[2] == 4
+
+ shape = points.shape
+ flat_points = points.reshape((shape[0] * shape[1], 2))
+ flat_points = trans.transform(flat_points)
+ flat_colors = colors.reshape((shape[0] * shape[1], 4))
+ points_min = np.min(flat_points, axis=0) - (1 << 12)
+ points_max = np.max(flat_points, axis=0) + (1 << 12)
+ factor = np.ceil((2 ** 32 - 1) / (points_max - points_min))
+
+ xmin, ymin = points_min
+ xmax, ymax = points_max
+
+ data = np.empty(
+ shape[0] * shape[1],
+ dtype=[('flags', 'u1'), ('points', '2>u4'), ('colors', '3u1')])
+ data['flags'] = 0
+ data['points'] = (flat_points - points_min) * factor
+ data['colors'] = flat_colors[:, :3] * 255.0
+ hexdata = data.tobytes().hex("\n", -64) # Linewrap to 128 chars.
+
+ self._pswriter.write(f"""\
+gsave
+<< /ShadingType 4
+ /ColorSpace [/DeviceRGB]
+ /BitsPerCoordinate 32
+ /BitsPerComponent 8
+ /BitsPerFlag 8
+ /AntiAlias true
+ /Decode [ {xmin:g} {xmax:g} {ymin:g} {ymax:g} 0 1 0 1 0 1 ]
+ /DataSource <
+{hexdata}
+>
+>>
+shfill
+grestore
+""")
+
+ def _draw_ps(self, ps, gc, rgbFace, *, fill=True, stroke=True):
+ """
+ Emit the PostScript snippet *ps* with all the attributes from *gc*
+ applied. *ps* must consist of PostScript commands to construct a path.
+
+ The *fill* and/or *stroke* kwargs can be set to False if the *ps*
+ string already includes filling and/or stroking, in which case
+ `_draw_ps` is just supplying properties and clipping.
+ """
+ write = self._pswriter.write
+ mightstroke = (gc.get_linewidth() > 0
+ and not self._is_transparent(gc.get_rgb()))
+ if not mightstroke:
+ stroke = False
+ if self._is_transparent(rgbFace):
+ fill = False
+ hatch = gc.get_hatch()
+
+ if mightstroke:
+ self.set_linewidth(gc.get_linewidth())
+ self.set_linejoin(gc.get_joinstyle())
+ self.set_linecap(gc.get_capstyle())
+ self.set_linedash(*gc.get_dashes())
+ if mightstroke or hatch:
+ self.set_color(*gc.get_rgb()[:3])
+ write('gsave\n')
+
+ write(self._get_clip_cmd(gc))
+
+ write(ps.strip())
+ write("\n")
+
+ if fill:
+ if stroke or hatch:
+ write("gsave\n")
+ self.set_color(*rgbFace[:3], store=False)
+ write("fill\n")
+ if stroke or hatch:
+ write("grestore\n")
+
+ if hatch:
+ hatch_name = self.create_hatch(hatch, gc.get_hatch_linewidth())
+ write("gsave\n")
+ write(_nums_to_str(*gc.get_hatch_color()[:3]))
+ write(f" {hatch_name} setpattern fill grestore\n")
+
+ if stroke:
+ write("stroke\n")
+
+ write("grestore\n")
+
+
+class _Orientation(Enum):
+ portrait, landscape = range(2)
+
+ def swap_if_landscape(self, shape):
+ return shape[::-1] if self.name == "landscape" else shape
+
+
+class FigureCanvasPS(FigureCanvasBase):
+ fixed_dpi = 72
+ filetypes = {'ps': 'Postscript',
+ 'eps': 'Encapsulated Postscript'}
+
+ def get_default_filetype(self):
+ return 'ps'
+
+ def _print_ps(
+ self, fmt, outfile, *,
+ metadata=None, papertype=None, orientation='portrait',
+ bbox_inches_restore=None, **kwargs):
+
+ dpi = self.figure.dpi
+ self.figure.dpi = 72 # Override the dpi kwarg
+
+ dsc_comments = {}
+ if isinstance(outfile, (str, os.PathLike)):
+ filename = pathlib.Path(outfile).name
+ dsc_comments["Title"] = \
+ filename.encode("ascii", "replace").decode("ascii")
+ dsc_comments["Creator"] = (metadata or {}).get(
+ "Creator",
+ f"Matplotlib v{mpl.__version__}, https://matplotlib.org/")
+ # See https://reproducible-builds.org/specs/source-date-epoch/
+ source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
+ dsc_comments["CreationDate"] = (
+ datetime.datetime.fromtimestamp(
+ int(source_date_epoch),
+ datetime.timezone.utc).strftime("%a %b %d %H:%M:%S %Y")
+ if source_date_epoch
+ else time.ctime())
+ dsc_comments = "\n".join(
+ f"%%{k}: {v}" for k, v in dsc_comments.items())
+
+ if papertype is None:
+ papertype = mpl.rcParams['ps.papersize']
+ papertype = papertype.lower()
+ _api.check_in_list(['figure', *papersize], papertype=papertype)
+
+ orientation = _api.check_getitem(
+ _Orientation, orientation=orientation.lower())
+
+ printer = (self._print_figure_tex
+ if mpl.rcParams['text.usetex'] else
+ self._print_figure)
+ printer(fmt, outfile, dpi=dpi, dsc_comments=dsc_comments,
+ orientation=orientation, papertype=papertype,
+ bbox_inches_restore=bbox_inches_restore, **kwargs)
+
+ def _print_figure(
+ self, fmt, outfile, *,
+ dpi, dsc_comments, orientation, papertype,
+ bbox_inches_restore=None):
+ """
+ Render the figure to a filesystem path or a file-like object.
+
+ Parameters are as for `.print_figure`, except that *dsc_comments* is a
+ string containing Document Structuring Convention comments,
+ generated from the *metadata* parameter to `.print_figure`.
+ """
+ is_eps = fmt == 'eps'
+ if not (isinstance(outfile, (str, os.PathLike))
+ or is_writable_file_like(outfile)):
+ raise ValueError("outfile must be a path or a file-like object")
+
+ # find the appropriate papertype
+ width, height = self.figure.get_size_inches()
+ if is_eps or papertype == 'figure':
+ paper_width, paper_height = width, height
+ else:
+ paper_width, paper_height = orientation.swap_if_landscape(
+ papersize[papertype])
+
+ # center the figure on the paper
+ xo = 72 * 0.5 * (paper_width - width)
+ yo = 72 * 0.5 * (paper_height - height)
+
+ llx = xo
+ lly = yo
+ urx = llx + self.figure.bbox.width
+ ury = lly + self.figure.bbox.height
+ rotation = 0
+ if orientation is _Orientation.landscape:
+ llx, lly, urx, ury = lly, llx, ury, urx
+ xo, yo = 72 * paper_height - yo, xo
+ rotation = 90
+ bbox = (llx, lly, urx, ury)
+
+ self._pswriter = StringIO()
+
+ # mixed mode rendering
+ ps_renderer = RendererPS(width, height, self._pswriter, imagedpi=dpi)
+ renderer = MixedModeRenderer(
+ self.figure, width, height, dpi, ps_renderer,
+ bbox_inches_restore=bbox_inches_restore)
+
+ self.figure.draw(renderer)
+
+ def print_figure_impl(fh):
+ # write the PostScript headers
+ if is_eps:
+ print("%!PS-Adobe-3.0 EPSF-3.0", file=fh)
+ else:
+ print("%!PS-Adobe-3.0", file=fh)
+ if papertype != 'figure':
+ print(f"%%DocumentPaperSizes: {papertype}", file=fh)
+ print("%%Pages: 1", file=fh)
+ print(f"%%LanguageLevel: 3\n"
+ f"{dsc_comments}\n"
+ f"%%Orientation: {orientation.name}\n"
+ f"{_get_bbox_header(bbox)}\n"
+ f"%%EndComments\n",
+ end="", file=fh)
+
+ Ndict = len(_psDefs)
+ print("%%BeginProlog", file=fh)
+ if not mpl.rcParams['ps.useafm']:
+ Ndict += len(ps_renderer._character_tracker.used)
+ print("/mpldict %d dict def" % Ndict, file=fh)
+ print("mpldict begin", file=fh)
+ print("\n".join(_psDefs), file=fh)
+ if not mpl.rcParams['ps.useafm']:
+ for font_path, chars \
+ in ps_renderer._character_tracker.used.items():
+ if not chars:
+ continue
+ fonttype = mpl.rcParams['ps.fonttype']
+ # Can't use more than 255 chars from a single Type 3 font.
+ if len(chars) > 255:
+ fonttype = 42
+ fh.flush()
+ if fonttype == 3:
+ fh.write(_font_to_ps_type3(font_path, chars))
+ else: # Type 42 only.
+ _font_to_ps_type42(font_path, chars, fh)
+ print("end", file=fh)
+ print("%%EndProlog", file=fh)
+
+ if not is_eps:
+ print("%%Page: 1 1", file=fh)
+ print("mpldict begin", file=fh)
+
+ print("%s translate" % _nums_to_str(xo, yo), file=fh)
+ if rotation:
+ print("%d rotate" % rotation, file=fh)
+ print(f"0 0 {_nums_to_str(width*72, height*72)} rectclip", file=fh)
+
+ # write the figure
+ print(self._pswriter.getvalue(), file=fh)
+
+ # write the trailer
+ print("end", file=fh)
+ print("showpage", file=fh)
+ if not is_eps:
+ print("%%EOF", file=fh)
+ fh.flush()
+
+ if mpl.rcParams['ps.usedistiller']:
+ # We are going to use an external program to process the output.
+ # Write to a temporary file.
+ with TemporaryDirectory() as tmpdir:
+ tmpfile = os.path.join(tmpdir, "tmp.ps")
+ with open(tmpfile, 'w', encoding='latin-1') as fh:
+ print_figure_impl(fh)
+ if mpl.rcParams['ps.usedistiller'] == 'ghostscript':
+ _try_distill(gs_distill,
+ tmpfile, is_eps, ptype=papertype, bbox=bbox)
+ elif mpl.rcParams['ps.usedistiller'] == 'xpdf':
+ _try_distill(xpdf_distill,
+ tmpfile, is_eps, ptype=papertype, bbox=bbox)
+ _move_path_to_path_or_stream(tmpfile, outfile)
+
+ else: # Write directly to outfile.
+ with cbook.open_file_cm(outfile, "w", encoding="latin-1") as file:
+ if not file_requires_unicode(file):
+ file = codecs.getwriter("latin-1")(file)
+ print_figure_impl(file)
+
+ def _print_figure_tex(
+ self, fmt, outfile, *,
+ dpi, dsc_comments, orientation, papertype,
+ bbox_inches_restore=None):
+ """
+ If :rc:`text.usetex` is True, a temporary pair of tex/eps files
+ are created to allow tex to manage the text layout via the PSFrags
+ package. These files are processed to yield the final ps or eps file.
+
+ The rest of the behavior is as for `._print_figure`.
+ """
+ is_eps = fmt == 'eps'
+
+ width, height = self.figure.get_size_inches()
+ xo = 0
+ yo = 0
+
+ llx = xo
+ lly = yo
+ urx = llx + self.figure.bbox.width
+ ury = lly + self.figure.bbox.height
+ bbox = (llx, lly, urx, ury)
+
+ self._pswriter = StringIO()
+
+ # mixed mode rendering
+ ps_renderer = RendererPS(width, height, self._pswriter, imagedpi=dpi)
+ renderer = MixedModeRenderer(self.figure,
+ width, height, dpi, ps_renderer,
+ bbox_inches_restore=bbox_inches_restore)
+
+ self.figure.draw(renderer)
+
+ # write to a temp file, we'll move it to outfile when done
+ with TemporaryDirectory() as tmpdir:
+ tmppath = pathlib.Path(tmpdir, "tmp.ps")
+ tmppath.write_text(
+ f"""\
+%!PS-Adobe-3.0 EPSF-3.0
+%%LanguageLevel: 3
+{dsc_comments}
+{_get_bbox_header(bbox)}
+%%EndComments
+%%BeginProlog
+/mpldict {len(_psDefs)} dict def
+mpldict begin
+{"".join(_psDefs)}
+end
+%%EndProlog
+mpldict begin
+{_nums_to_str(xo, yo)} translate
+0 0 {_nums_to_str(width*72, height*72)} rectclip
+{self._pswriter.getvalue()}
+end
+showpage
+""",
+ encoding="latin-1")
+
+ if orientation is _Orientation.landscape: # now, ready to rotate
+ width, height = height, width
+ bbox = (lly, llx, ury, urx)
+
+ # set the paper size to the figure size if is_eps. The
+ # resulting ps file has the given size with correct bounding
+ # box so that there is no need to call 'pstoeps'
+ if is_eps or papertype == 'figure':
+ paper_width, paper_height = orientation.swap_if_landscape(
+ self.figure.get_size_inches())
+ else:
+ paper_width, paper_height = papersize[papertype]
+
+ psfrag_rotated = _convert_psfrags(
+ tmppath, ps_renderer.psfrag, paper_width, paper_height,
+ orientation.name)
+
+ if (mpl.rcParams['ps.usedistiller'] == 'ghostscript'
+ or mpl.rcParams['text.usetex']):
+ _try_distill(gs_distill,
+ tmppath, is_eps, ptype=papertype, bbox=bbox,
+ rotated=psfrag_rotated)
+ elif mpl.rcParams['ps.usedistiller'] == 'xpdf':
+ _try_distill(xpdf_distill,
+ tmppath, is_eps, ptype=papertype, bbox=bbox,
+ rotated=psfrag_rotated)
+
+ _move_path_to_path_or_stream(tmppath, outfile)
+
+ print_ps = functools.partialmethod(_print_ps, "ps")
+ print_eps = functools.partialmethod(_print_ps, "eps")
+
+ def draw(self):
+ self.figure.draw_without_rendering()
+ return super().draw()
+
+
+def _convert_psfrags(tmppath, psfrags, paper_width, paper_height, orientation):
+ """
+ When we want to use the LaTeX backend with postscript, we write PSFrag tags
+ to a temporary postscript file, each one marking a position for LaTeX to
+ render some text. convert_psfrags generates a LaTeX document containing the
+ commands to convert those tags to text. LaTeX/dvips produces the postscript
+ file that includes the actual text.
+ """
+ with mpl.rc_context({
+ "text.latex.preamble":
+ mpl.rcParams["text.latex.preamble"] +
+ mpl.texmanager._usepackage_if_not_loaded("color") +
+ mpl.texmanager._usepackage_if_not_loaded("graphicx") +
+ mpl.texmanager._usepackage_if_not_loaded("psfrag") +
+ r"\geometry{papersize={%(width)sin,%(height)sin},margin=0in}"
+ % {"width": paper_width, "height": paper_height}
+ }):
+ dvifile = TexManager().make_dvi(
+ "\n"
+ r"\begin{figure}""\n"
+ r" \centering\leavevmode""\n"
+ r" %(psfrags)s""\n"
+ r" \includegraphics*[angle=%(angle)s]{%(epsfile)s}""\n"
+ r"\end{figure}"
+ % {
+ "psfrags": "\n".join(psfrags),
+ "angle": 90 if orientation == 'landscape' else 0,
+ "epsfile": tmppath.resolve().as_posix(),
+ },
+ fontsize=10) # tex's default fontsize.
+
+ with TemporaryDirectory() as tmpdir:
+ psfile = os.path.join(tmpdir, "tmp.ps")
+ cbook._check_and_log_subprocess(
+ ['dvips', '-q', '-R0', '-o', psfile, dvifile], _log)
+ shutil.move(psfile, tmppath)
+
+ # check if the dvips created a ps in landscape paper. Somehow,
+ # above latex+dvips results in a ps file in a landscape mode for a
+ # certain figure sizes (e.g., 8.3in, 5.8in which is a5). And the
+ # bounding box of the final output got messed up. We check see if
+ # the generated ps file is in landscape and return this
+ # information. The return value is used in pstoeps step to recover
+ # the correct bounding box. 2010-06-05 JJL
+ with open(tmppath) as fh:
+ psfrag_rotated = "Landscape" in fh.read(1000)
+ return psfrag_rotated
+
+
+def _try_distill(func, tmppath, *args, **kwargs):
+ try:
+ func(str(tmppath), *args, **kwargs)
+ except mpl.ExecutableNotFoundError as exc:
+ _log.warning("%s. Distillation step skipped.", exc)
+
+
+def gs_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
+ """
+ Use ghostscript's pswrite or epswrite device to distill a file.
+ This yields smaller files without illegal encapsulated postscript
+ operators. The output is low-level, converting text to outlines.
+ """
+
+ if eps:
+ paper_option = ["-dEPSCrop"]
+ elif ptype == "figure":
+ # The bbox will have its lower-left corner at (0, 0), so upper-right
+ # corner corresponds with paper size.
+ paper_option = [f"-dDEVICEWIDTHPOINTS={bbox[2]}",
+ f"-dDEVICEHEIGHTPOINTS={bbox[3]}"]
+ else:
+ paper_option = [f"-sPAPERSIZE={ptype}"]
+
+ psfile = tmpfile + '.ps'
+ dpi = mpl.rcParams['ps.distiller.res']
+
+ cbook._check_and_log_subprocess(
+ [mpl._get_executable_info("gs").executable,
+ "-dBATCH", "-dNOPAUSE", "-r%d" % dpi, "-sDEVICE=ps2write",
+ *paper_option, f"-sOutputFile={psfile}", tmpfile],
+ _log)
+
+ os.remove(tmpfile)
+ shutil.move(psfile, tmpfile)
+
+ # While it is best if above steps preserve the original bounding
+ # box, there seem to be cases when it is not. For those cases,
+ # the original bbox can be restored during the pstoeps step.
+
+ if eps:
+ # For some versions of gs, above steps result in a ps file where the
+ # original bbox is no more correct. Do not adjust bbox for now.
+ pstoeps(tmpfile, bbox, rotated=rotated)
+
+
+def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None, rotated=False):
+ """
+ Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
+ This yields smaller files without illegal encapsulated postscript
+ operators. This distiller is preferred, generating high-level postscript
+ output that treats text as text.
+ """
+ mpl._get_executable_info("gs") # Effectively checks for ps2pdf.
+ mpl._get_executable_info("pdftops")
+
+ if eps:
+ paper_option = ["-dEPSCrop"]
+ elif ptype == "figure":
+ # The bbox will have its lower-left corner at (0, 0), so upper-right
+ # corner corresponds with paper size.
+ paper_option = [f"-dDEVICEWIDTHPOINTS#{bbox[2]}",
+ f"-dDEVICEHEIGHTPOINTS#{bbox[3]}"]
+ else:
+ paper_option = [f"-sPAPERSIZE#{ptype}"]
+
+ with TemporaryDirectory() as tmpdir:
+ tmppdf = pathlib.Path(tmpdir, "tmp.pdf")
+ tmpps = pathlib.Path(tmpdir, "tmp.ps")
+ # Pass options as `-foo#bar` instead of `-foo=bar` to keep Windows
+ # happy (https://ghostscript.com/doc/9.56.1/Use.htm#MS_Windows).
+ cbook._check_and_log_subprocess(
+ ["ps2pdf",
+ "-dAutoFilterColorImages#false",
+ "-dAutoFilterGrayImages#false",
+ "-sAutoRotatePages#None",
+ "-sGrayImageFilter#FlateEncode",
+ "-sColorImageFilter#FlateEncode",
+ *paper_option,
+ tmpfile, tmppdf], _log)
+ cbook._check_and_log_subprocess(
+ ["pdftops", "-paper", "match", "-level3", tmppdf, tmpps], _log)
+ shutil.move(tmpps, tmpfile)
+ if eps:
+ pstoeps(tmpfile)
+
+
+@_api.deprecated("3.9")
+def get_bbox_header(lbrt, rotated=False):
+ """
+ Return a postscript header string for the given bbox lbrt=(l, b, r, t).
+ Optionally, return rotate command.
+ """
+ return _get_bbox_header(lbrt), (_get_rotate_command(lbrt) if rotated else "")
+
+
+def _get_bbox_header(lbrt):
+ """Return a PostScript header string for bounding box *lbrt*=(l, b, r, t)."""
+ l, b, r, t = lbrt
+ return (f"%%BoundingBox: {int(l)} {int(b)} {math.ceil(r)} {math.ceil(t)}\n"
+ f"%%HiResBoundingBox: {l:.6f} {b:.6f} {r:.6f} {t:.6f}")
+
+
+def _get_rotate_command(lbrt):
+ """Return a PostScript 90° rotation command for bounding box *lbrt*=(l, b, r, t)."""
+ l, b, r, t = lbrt
+ return f"{l+r:.2f} {0:.2f} translate\n90 rotate"
+
+
+def pstoeps(tmpfile, bbox=None, rotated=False):
+ """
+ Convert the postscript to encapsulated postscript. The bbox of
+ the eps file will be replaced with the given *bbox* argument. If
+ None, original bbox will be used.
+ """
+
+ epsfile = tmpfile + '.eps'
+ with open(epsfile, 'wb') as epsh, open(tmpfile, 'rb') as tmph:
+ write = epsh.write
+ # Modify the header:
+ for line in tmph:
+ if line.startswith(b'%!PS'):
+ write(b"%!PS-Adobe-3.0 EPSF-3.0\n")
+ if bbox:
+ write(_get_bbox_header(bbox).encode('ascii') + b'\n')
+ elif line.startswith(b'%%EndComments'):
+ write(line)
+ write(b'%%BeginProlog\n'
+ b'save\n'
+ b'countdictstack\n'
+ b'mark\n'
+ b'newpath\n'
+ b'/showpage {} def\n'
+ b'/setpagedevice {pop} def\n'
+ b'%%EndProlog\n'
+ b'%%Page 1 1\n')
+ if rotated: # The output eps file need to be rotated.
+ write(_get_rotate_command(bbox).encode('ascii') + b'\n')
+ break
+ elif bbox and line.startswith((b'%%Bound', b'%%HiResBound',
+ b'%%DocumentMedia', b'%%Pages')):
+ pass
+ else:
+ write(line)
+ # Now rewrite the rest of the file, and modify the trailer.
+ # This is done in a second loop such that the header of the embedded
+ # eps file is not modified.
+ for line in tmph:
+ if line.startswith(b'%%EOF'):
+ write(b'cleartomark\n'
+ b'countdictstack\n'
+ b'exch sub { end } repeat\n'
+ b'restore\n'
+ b'showpage\n'
+ b'%%EOF\n')
+ elif line.startswith(b'%%PageBoundingBox'):
+ pass
+ else:
+ write(line)
+
+ os.remove(tmpfile)
+ shutil.move(epsfile, tmpfile)
+
+
+FigureManagerPS = FigureManagerBase
+
+
+# The following Python dictionary psDefs contains the entries for the
+# PostScript dictionary mpldict. This dictionary implements most of
+# the matplotlib primitives and some abbreviations.
+#
+# References:
+# https://www.adobe.com/content/dam/acom/en/devnet/actionscript/articles/PLRM.pdf
+# http://preserve.mactech.com/articles/mactech/Vol.09/09.04/PostscriptTutorial
+# http://www.math.ubc.ca/people/faculty/cass/graphics/text/www/
+#
+
+# The usage comments use the notation of the operator summary
+# in the PostScript Language reference manual.
+_psDefs = [
+ # name proc *_d* -
+ # Note that this cannot be bound to /d, because when embedding a Type3 font
+ # we may want to define a "d" glyph using "/d{...} d" which would locally
+ # overwrite the definition.
+ "/_d { bind def } bind def",
+ # x y *m* -
+ "/m { moveto } _d",
+ # x y *l* -
+ "/l { lineto } _d",
+ # x y *r* -
+ "/r { rlineto } _d",
+ # x1 y1 x2 y2 x y *c* -
+ "/c { curveto } _d",
+ # *cl* -
+ "/cl { closepath } _d",
+ # *ce* -
+ "/ce { closepath eofill } _d",
+ # wx wy llx lly urx ury *setcachedevice* -
+ "/sc { setcachedevice } _d",
+]
+
+
+@_Backend.export
+class _BackendPS(_Backend):
+ backend_version = 'Level II'
+ FigureCanvas = FigureCanvasPS
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt.py
new file mode 100644
index 0000000000000000000000000000000000000000..5cde4866cad7e7e3f6555f04cbab1bbffb61960d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt.py
@@ -0,0 +1,1074 @@
+import functools
+import os
+import sys
+import traceback
+
+import matplotlib as mpl
+from matplotlib import _api, backend_tools, cbook
+from matplotlib._pylab_helpers import Gcf
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2,
+ TimerBase, cursors, ToolContainerBase, MouseButton,
+ CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent,
+ _allow_interrupt)
+import matplotlib.backends.qt_editor.figureoptions as figureoptions
+from . import qt_compat
+from .qt_compat import (
+ QtCore, QtGui, QtWidgets, __version__, QT_API, _to_int, _isdeleted)
+
+
+# SPECIAL_KEYS are Qt::Key that do *not* return their Unicode name
+# instead they have manually specified names.
+SPECIAL_KEYS = {
+ _to_int(getattr(QtCore.Qt.Key, k)): v for k, v in [
+ ("Key_Escape", "escape"),
+ ("Key_Tab", "tab"),
+ ("Key_Backspace", "backspace"),
+ ("Key_Return", "enter"),
+ ("Key_Enter", "enter"),
+ ("Key_Insert", "insert"),
+ ("Key_Delete", "delete"),
+ ("Key_Pause", "pause"),
+ ("Key_SysReq", "sysreq"),
+ ("Key_Clear", "clear"),
+ ("Key_Home", "home"),
+ ("Key_End", "end"),
+ ("Key_Left", "left"),
+ ("Key_Up", "up"),
+ ("Key_Right", "right"),
+ ("Key_Down", "down"),
+ ("Key_PageUp", "pageup"),
+ ("Key_PageDown", "pagedown"),
+ ("Key_Shift", "shift"),
+ # In macOS, the control and super (aka cmd/apple) keys are switched.
+ ("Key_Control", "control" if sys.platform != "darwin" else "cmd"),
+ ("Key_Meta", "meta" if sys.platform != "darwin" else "control"),
+ ("Key_Alt", "alt"),
+ ("Key_CapsLock", "caps_lock"),
+ ("Key_F1", "f1"),
+ ("Key_F2", "f2"),
+ ("Key_F3", "f3"),
+ ("Key_F4", "f4"),
+ ("Key_F5", "f5"),
+ ("Key_F6", "f6"),
+ ("Key_F7", "f7"),
+ ("Key_F8", "f8"),
+ ("Key_F9", "f9"),
+ ("Key_F10", "f10"),
+ ("Key_F10", "f11"),
+ ("Key_F12", "f12"),
+ ("Key_Super_L", "super"),
+ ("Key_Super_R", "super"),
+ ]
+}
+# Define which modifier keys are collected on keyboard events.
+# Elements are (Qt::KeyboardModifiers, Qt::Key) tuples.
+# Order determines the modifier order (ctrl+alt+...) reported by Matplotlib.
+_MODIFIER_KEYS = [
+ (_to_int(getattr(QtCore.Qt.KeyboardModifier, mod)),
+ _to_int(getattr(QtCore.Qt.Key, key)))
+ for mod, key in [
+ ("ControlModifier", "Key_Control"),
+ ("AltModifier", "Key_Alt"),
+ ("ShiftModifier", "Key_Shift"),
+ ("MetaModifier", "Key_Meta"),
+ ]
+]
+cursord = {
+ k: getattr(QtCore.Qt.CursorShape, v) for k, v in [
+ (cursors.MOVE, "SizeAllCursor"),
+ (cursors.HAND, "PointingHandCursor"),
+ (cursors.POINTER, "ArrowCursor"),
+ (cursors.SELECT_REGION, "CrossCursor"),
+ (cursors.WAIT, "WaitCursor"),
+ (cursors.RESIZE_HORIZONTAL, "SizeHorCursor"),
+ (cursors.RESIZE_VERTICAL, "SizeVerCursor"),
+ ]
+}
+
+
+# lru_cache keeps a reference to the QApplication instance, keeping it from
+# being GC'd.
+@functools.lru_cache(1)
+def _create_qApp():
+ app = QtWidgets.QApplication.instance()
+
+ # Create a new QApplication and configure it if none exists yet, as only
+ # one QApplication can exist at a time.
+ if app is None:
+ # display_is_valid returns False only if on Linux and neither X11
+ # nor Wayland display can be opened.
+ if not mpl._c_internal_utils.display_is_valid():
+ raise RuntimeError('Invalid DISPLAY variable')
+
+ # Check to make sure a QApplication from a different major version
+ # of Qt is not instantiated in the process
+ if QT_API in {'PyQt6', 'PySide6'}:
+ other_bindings = ('PyQt5', 'PySide2')
+ qt_version = 6
+ elif QT_API in {'PyQt5', 'PySide2'}:
+ other_bindings = ('PyQt6', 'PySide6')
+ qt_version = 5
+ else:
+ raise RuntimeError("Should never be here")
+
+ for binding in other_bindings:
+ mod = sys.modules.get(f'{binding}.QtWidgets')
+ if mod is not None and mod.QApplication.instance() is not None:
+ other_core = sys.modules.get(f'{binding}.QtCore')
+ _api.warn_external(
+ f'Matplotlib is using {QT_API} which wraps '
+ f'{QtCore.qVersion()} however an instantiated '
+ f'QApplication from {binding} which wraps '
+ f'{other_core.qVersion()} exists. Mixing Qt major '
+ 'versions may not work as expected.'
+ )
+ break
+ if qt_version == 5:
+ try:
+ QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)
+ except AttributeError: # Only for Qt>=5.6, <6.
+ pass
+ try:
+ QtWidgets.QApplication.setHighDpiScaleFactorRoundingPolicy(
+ QtCore.Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)
+ except AttributeError: # Only for Qt>=5.14.
+ pass
+ app = QtWidgets.QApplication(["matplotlib"])
+ if sys.platform == "darwin":
+ image = str(cbook._get_data_path('images/matplotlib.svg'))
+ icon = QtGui.QIcon(image)
+ app.setWindowIcon(icon)
+ app.setQuitOnLastWindowClosed(True)
+ cbook._setup_new_guiapp()
+ if qt_version == 5:
+ app.setAttribute(QtCore.Qt.AA_UseHighDpiPixmaps)
+
+ return app
+
+
+def _allow_interrupt_qt(qapp_or_eventloop):
+ """A context manager that allows terminating a plot by sending a SIGINT."""
+
+ # Use QSocketNotifier to read the socketpair while the Qt event loop runs.
+
+ def prepare_notifier(rsock):
+ sn = QtCore.QSocketNotifier(rsock.fileno(), QtCore.QSocketNotifier.Type.Read)
+
+ @sn.activated.connect
+ def _may_clear_sock():
+ # Running a Python function on socket activation gives the interpreter a
+ # chance to handle the signal in Python land. We also need to drain the
+ # socket with recv() to re-arm it, because it will be written to as part of
+ # the wakeup. (We need this in case set_wakeup_fd catches a signal other
+ # than SIGINT and we shall continue waiting.)
+ try:
+ rsock.recv(1)
+ except BlockingIOError:
+ # This may occasionally fire too soon or more than once on Windows, so
+ # be forgiving about reading an empty socket.
+ pass
+
+ return sn # Actually keep the notifier alive.
+
+ def handle_sigint():
+ if hasattr(qapp_or_eventloop, 'closeAllWindows'):
+ qapp_or_eventloop.closeAllWindows()
+ qapp_or_eventloop.quit()
+
+ return _allow_interrupt(prepare_notifier, handle_sigint)
+
+
+class TimerQT(TimerBase):
+ """Subclass of `.TimerBase` using QTimer events."""
+
+ def __init__(self, *args, **kwargs):
+ # Create a new timer and connect the timeout() signal to the
+ # _on_timer method.
+ self._timer = QtCore.QTimer()
+ self._timer.timeout.connect(self._on_timer)
+ super().__init__(*args, **kwargs)
+
+ def __del__(self):
+ # The check for deletedness is needed to avoid an error at animation
+ # shutdown with PySide2.
+ if not _isdeleted(self._timer):
+ self._timer_stop()
+
+ def _timer_set_single_shot(self):
+ self._timer.setSingleShot(self._single)
+
+ def _timer_set_interval(self):
+ self._timer.setInterval(self._interval)
+
+ def _timer_start(self):
+ self._timer.start()
+
+ def _timer_stop(self):
+ self._timer.stop()
+
+
+class FigureCanvasQT(FigureCanvasBase, QtWidgets.QWidget):
+ required_interactive_framework = "qt"
+ _timer_cls = TimerQT
+ manager_class = _api.classproperty(lambda cls: FigureManagerQT)
+
+ buttond = {
+ getattr(QtCore.Qt.MouseButton, k): v for k, v in [
+ ("LeftButton", MouseButton.LEFT),
+ ("RightButton", MouseButton.RIGHT),
+ ("MiddleButton", MouseButton.MIDDLE),
+ ("XButton1", MouseButton.BACK),
+ ("XButton2", MouseButton.FORWARD),
+ ]
+ }
+
+ def __init__(self, figure=None):
+ _create_qApp()
+ super().__init__(figure=figure)
+
+ self._draw_pending = False
+ self._is_drawing = False
+ self._draw_rect_callback = lambda painter: None
+ self._in_resize_event = False
+
+ self.setAttribute(QtCore.Qt.WidgetAttribute.WA_OpaquePaintEvent)
+ self.setMouseTracking(True)
+ self.resize(*self.get_width_height())
+
+ palette = QtGui.QPalette(QtGui.QColor("white"))
+ self.setPalette(palette)
+
+ @QtCore.Slot()
+ def _update_pixel_ratio(self):
+ if self._set_device_pixel_ratio(
+ self.devicePixelRatioF() or 1): # rarely, devicePixelRatioF=0
+ # The easiest way to resize the canvas is to emit a resizeEvent
+ # since we implement all the logic for resizing the canvas for
+ # that event.
+ event = QtGui.QResizeEvent(self.size(), self.size())
+ self.resizeEvent(event)
+
+ @QtCore.Slot(QtGui.QScreen)
+ def _update_screen(self, screen):
+ # Handler for changes to a window's attached screen.
+ self._update_pixel_ratio()
+ if screen is not None:
+ screen.physicalDotsPerInchChanged.connect(self._update_pixel_ratio)
+ screen.logicalDotsPerInchChanged.connect(self._update_pixel_ratio)
+
+ def showEvent(self, event):
+ # Set up correct pixel ratio, and connect to any signal changes for it,
+ # once the window is shown (and thus has these attributes).
+ window = self.window().windowHandle()
+ window.screenChanged.connect(self._update_screen)
+ self._update_screen(window.screen())
+
+ def set_cursor(self, cursor):
+ # docstring inherited
+ self.setCursor(_api.check_getitem(cursord, cursor=cursor))
+
+ def mouseEventCoords(self, pos=None):
+ """
+ Calculate mouse coordinates in physical pixels.
+
+ Qt uses logical pixels, but the figure is scaled to physical
+ pixels for rendering. Transform to physical pixels so that
+ all of the down-stream transforms work as expected.
+
+ Also, the origin is different and needs to be corrected.
+ """
+ if pos is None:
+ pos = self.mapFromGlobal(QtGui.QCursor.pos())
+ elif hasattr(pos, "position"): # qt6 QtGui.QEvent
+ pos = pos.position()
+ elif hasattr(pos, "pos"): # qt5 QtCore.QEvent
+ pos = pos.pos()
+ # (otherwise, it's already a QPoint)
+ x = pos.x()
+ # flip y so y=0 is bottom of canvas
+ y = self.figure.bbox.height / self.device_pixel_ratio - pos.y()
+ return x * self.device_pixel_ratio, y * self.device_pixel_ratio
+
+ def enterEvent(self, event):
+ # Force querying of the modifiers, as the cached modifier state can
+ # have been invalidated while the window was out of focus.
+ mods = QtWidgets.QApplication.instance().queryKeyboardModifiers()
+ if self.figure is None:
+ return
+ LocationEvent("figure_enter_event", self,
+ *self.mouseEventCoords(event),
+ modifiers=self._mpl_modifiers(mods),
+ guiEvent=event)._process()
+
+ def leaveEvent(self, event):
+ QtWidgets.QApplication.restoreOverrideCursor()
+ if self.figure is None:
+ return
+ LocationEvent("figure_leave_event", self,
+ *self.mouseEventCoords(),
+ modifiers=self._mpl_modifiers(),
+ guiEvent=event)._process()
+
+ def mousePressEvent(self, event):
+ button = self.buttond.get(event.button())
+ if button is not None and self.figure is not None:
+ MouseEvent("button_press_event", self,
+ *self.mouseEventCoords(event), button,
+ modifiers=self._mpl_modifiers(),
+ guiEvent=event)._process()
+
+ def mouseDoubleClickEvent(self, event):
+ button = self.buttond.get(event.button())
+ if button is not None and self.figure is not None:
+ MouseEvent("button_press_event", self,
+ *self.mouseEventCoords(event), button, dblclick=True,
+ modifiers=self._mpl_modifiers(),
+ guiEvent=event)._process()
+
+ def mouseMoveEvent(self, event):
+ if self.figure is None:
+ return
+ MouseEvent("motion_notify_event", self,
+ *self.mouseEventCoords(event),
+ buttons=self._mpl_buttons(event.buttons()),
+ modifiers=self._mpl_modifiers(),
+ guiEvent=event)._process()
+
+ def mouseReleaseEvent(self, event):
+ button = self.buttond.get(event.button())
+ if button is not None and self.figure is not None:
+ MouseEvent("button_release_event", self,
+ *self.mouseEventCoords(event), button,
+ modifiers=self._mpl_modifiers(),
+ guiEvent=event)._process()
+
+ def wheelEvent(self, event):
+ # from QWheelEvent::pixelDelta doc: pixelDelta is sometimes not
+ # provided (`isNull()`) and is unreliable on X11 ("xcb").
+ if (event.pixelDelta().isNull()
+ or QtWidgets.QApplication.instance().platformName() == "xcb"):
+ steps = event.angleDelta().y() / 120
+ else:
+ steps = event.pixelDelta().y()
+ if steps and self.figure is not None:
+ MouseEvent("scroll_event", self,
+ *self.mouseEventCoords(event), step=steps,
+ modifiers=self._mpl_modifiers(),
+ guiEvent=event)._process()
+
+ def keyPressEvent(self, event):
+ key = self._get_key(event)
+ if key is not None and self.figure is not None:
+ KeyEvent("key_press_event", self,
+ key, *self.mouseEventCoords(),
+ guiEvent=event)._process()
+
+ def keyReleaseEvent(self, event):
+ key = self._get_key(event)
+ if key is not None and self.figure is not None:
+ KeyEvent("key_release_event", self,
+ key, *self.mouseEventCoords(),
+ guiEvent=event)._process()
+
+ def resizeEvent(self, event):
+ if self._in_resize_event: # Prevent PyQt6 recursion
+ return
+ if self.figure is None:
+ return
+ self._in_resize_event = True
+ try:
+ w = event.size().width() * self.device_pixel_ratio
+ h = event.size().height() * self.device_pixel_ratio
+ dpival = self.figure.dpi
+ winch = w / dpival
+ hinch = h / dpival
+ self.figure.set_size_inches(winch, hinch, forward=False)
+ # pass back into Qt to let it finish
+ QtWidgets.QWidget.resizeEvent(self, event)
+ # emit our resize events
+ ResizeEvent("resize_event", self)._process()
+ self.draw_idle()
+ finally:
+ self._in_resize_event = False
+
+ def sizeHint(self):
+ w, h = self.get_width_height()
+ return QtCore.QSize(w, h)
+
+ def minimumSizeHint(self):
+ return QtCore.QSize(10, 10)
+
+ @staticmethod
+ def _mpl_buttons(buttons):
+ buttons = _to_int(buttons)
+ # State *after* press/release.
+ return {button for mask, button in FigureCanvasQT.buttond.items()
+ if _to_int(mask) & buttons}
+
+ @staticmethod
+ def _mpl_modifiers(modifiers=None, *, exclude=None):
+ if modifiers is None:
+ modifiers = QtWidgets.QApplication.instance().keyboardModifiers()
+ modifiers = _to_int(modifiers)
+ # get names of the pressed modifier keys
+ # 'control' is named 'control' when a standalone key, but 'ctrl' when a
+ # modifier
+ # bit twiddling to pick out modifier keys from modifiers bitmask,
+ # if exclude is a MODIFIER, it should not be duplicated in mods
+ return [SPECIAL_KEYS[key].replace('control', 'ctrl')
+ for mask, key in _MODIFIER_KEYS
+ if exclude != key and modifiers & mask]
+
+ def _get_key(self, event):
+ event_key = event.key()
+ mods = self._mpl_modifiers(exclude=event_key)
+ try:
+ # for certain keys (enter, left, backspace, etc) use a word for the
+ # key, rather than Unicode
+ key = SPECIAL_KEYS[event_key]
+ except KeyError:
+ # Unicode defines code points up to 0x10ffff (sys.maxunicode)
+ # QT will use Key_Codes larger than that for keyboard keys that are
+ # not Unicode characters (like multimedia keys)
+ # skip these
+ # if you really want them, you should add them to SPECIAL_KEYS
+ if event_key > sys.maxunicode:
+ return None
+
+ key = chr(event_key)
+ # qt delivers capitalized letters. fix capitalization
+ # note that capslock is ignored
+ if 'shift' in mods:
+ mods.remove('shift')
+ else:
+ key = key.lower()
+
+ return '+'.join(mods + [key])
+
+ def flush_events(self):
+ # docstring inherited
+ QtWidgets.QApplication.instance().processEvents()
+
+ def start_event_loop(self, timeout=0):
+ # docstring inherited
+ if hasattr(self, "_event_loop") and self._event_loop.isRunning():
+ raise RuntimeError("Event loop already running")
+ self._event_loop = event_loop = QtCore.QEventLoop()
+ if timeout > 0:
+ _ = QtCore.QTimer.singleShot(int(timeout * 1000), event_loop.quit)
+
+ with _allow_interrupt_qt(event_loop):
+ qt_compat._exec(event_loop)
+
+ def stop_event_loop(self, event=None):
+ # docstring inherited
+ if hasattr(self, "_event_loop"):
+ self._event_loop.quit()
+
+ def draw(self):
+ """Render the figure, and queue a request for a Qt draw."""
+ # The renderer draw is done here; delaying causes problems with code
+ # that uses the result of the draw() to update plot elements.
+ if self._is_drawing:
+ return
+ with cbook._setattr_cm(self, _is_drawing=True):
+ super().draw()
+ self.update()
+
+ def draw_idle(self):
+ """Queue redraw of the Agg buffer and request Qt paintEvent."""
+ # The Agg draw needs to be handled by the same thread Matplotlib
+ # modifies the scene graph from. Post Agg draw request to the
+ # current event loop in order to ensure thread affinity and to
+ # accumulate multiple draw requests from event handling.
+ # TODO: queued signal connection might be safer than singleShot
+ if not (getattr(self, '_draw_pending', False) or
+ getattr(self, '_is_drawing', False)):
+ self._draw_pending = True
+ QtCore.QTimer.singleShot(0, self._draw_idle)
+
+ def blit(self, bbox=None):
+ # docstring inherited
+ if bbox is None and self.figure:
+ bbox = self.figure.bbox # Blit the entire canvas if bbox is None.
+ # repaint uses logical pixels, not physical pixels like the renderer.
+ l, b, w, h = (int(pt / self.device_pixel_ratio) for pt in bbox.bounds)
+ t = b + h
+ self.repaint(l, self.rect().height() - t, w, h)
+
+ def _draw_idle(self):
+ with self._idle_draw_cntx():
+ if not self._draw_pending:
+ return
+ self._draw_pending = False
+ if self.height() <= 0 or self.width() <= 0:
+ return
+ try:
+ self.draw()
+ except Exception:
+ # Uncaught exceptions are fatal for PyQt5, so catch them.
+ traceback.print_exc()
+
+ def drawRectangle(self, rect):
+ # Draw the zoom rectangle to the QPainter. _draw_rect_callback needs
+ # to be called at the end of paintEvent.
+ if rect is not None:
+ x0, y0, w, h = (int(pt / self.device_pixel_ratio) for pt in rect)
+ x1 = x0 + w
+ y1 = y0 + h
+ def _draw_rect_callback(painter):
+ pen = QtGui.QPen(
+ QtGui.QColor("black"),
+ 1 / self.device_pixel_ratio
+ )
+
+ pen.setDashPattern([3, 3])
+ for color, offset in [
+ (QtGui.QColor("black"), 0),
+ (QtGui.QColor("white"), 3),
+ ]:
+ pen.setDashOffset(offset)
+ pen.setColor(color)
+ painter.setPen(pen)
+ # Draw the lines from x0, y0 towards x1, y1 so that the
+ # dashes don't "jump" when moving the zoom box.
+ painter.drawLine(x0, y0, x0, y1)
+ painter.drawLine(x0, y0, x1, y0)
+ painter.drawLine(x0, y1, x1, y1)
+ painter.drawLine(x1, y0, x1, y1)
+ else:
+ def _draw_rect_callback(painter):
+ return
+ self._draw_rect_callback = _draw_rect_callback
+ self.update()
+
+
+class MainWindow(QtWidgets.QMainWindow):
+ closing = QtCore.Signal()
+
+ def closeEvent(self, event):
+ self.closing.emit()
+ super().closeEvent(event)
+
+
+class FigureManagerQT(FigureManagerBase):
+ """
+ Attributes
+ ----------
+ canvas : `FigureCanvas`
+ The FigureCanvas instance
+ num : int or str
+ The Figure number
+ toolbar : qt.QToolBar
+ The qt.QToolBar
+ window : qt.QMainWindow
+ The qt.QMainWindow
+ """
+
+ def __init__(self, canvas, num):
+ self.window = MainWindow()
+ super().__init__(canvas, num)
+ self.window.closing.connect(self._widgetclosed)
+
+ if sys.platform != "darwin":
+ image = str(cbook._get_data_path('images/matplotlib.svg'))
+ icon = QtGui.QIcon(image)
+ self.window.setWindowIcon(icon)
+
+ self.window._destroying = False
+
+ if self.toolbar:
+ self.window.addToolBar(self.toolbar)
+ tbs_height = self.toolbar.sizeHint().height()
+ else:
+ tbs_height = 0
+
+ # resize the main window so it will display the canvas with the
+ # requested size:
+ cs = canvas.sizeHint()
+ cs_height = cs.height()
+ height = cs_height + tbs_height
+ self.window.resize(cs.width(), height)
+
+ self.window.setCentralWidget(self.canvas)
+
+ if mpl.is_interactive():
+ self.window.show()
+ self.canvas.draw_idle()
+
+ # Give the keyboard focus to the figure instead of the manager:
+ # StrongFocus accepts both tab and click to focus and will enable the
+ # canvas to process event without clicking.
+ # https://doc.qt.io/qt-5/qt.html#FocusPolicy-enum
+ self.canvas.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus)
+ self.canvas.setFocus()
+
+ self.window.raise_()
+
+ def full_screen_toggle(self):
+ if self.window.isFullScreen():
+ self.window.showNormal()
+ else:
+ self.window.showFullScreen()
+
+ def _widgetclosed(self):
+ CloseEvent("close_event", self.canvas)._process()
+ if self.window._destroying:
+ return
+ self.window._destroying = True
+ try:
+ Gcf.destroy(self)
+ except AttributeError:
+ pass
+ # It seems that when the python session is killed,
+ # Gcf can get destroyed before the Gcf.destroy
+ # line is run, leading to a useless AttributeError.
+
+ def resize(self, width, height):
+ # The Qt methods return sizes in 'virtual' pixels so we do need to
+ # rescale from physical to logical pixels.
+ width = int(width / self.canvas.device_pixel_ratio)
+ height = int(height / self.canvas.device_pixel_ratio)
+ extra_width = self.window.width() - self.canvas.width()
+ extra_height = self.window.height() - self.canvas.height()
+ self.canvas.resize(width, height)
+ self.window.resize(width + extra_width, height + extra_height)
+
+ @classmethod
+ def start_main_loop(cls):
+ qapp = QtWidgets.QApplication.instance()
+ if qapp:
+ with _allow_interrupt_qt(qapp):
+ qt_compat._exec(qapp)
+
+ def show(self):
+ self.window._destroying = False
+ self.window.show()
+ if mpl.rcParams['figure.raise_window']:
+ self.window.activateWindow()
+ self.window.raise_()
+
+ def destroy(self, *args):
+ # check for qApp first, as PySide deletes it in its atexit handler
+ if QtWidgets.QApplication.instance() is None:
+ return
+ if self.window._destroying:
+ return
+ self.window._destroying = True
+ if self.toolbar:
+ self.toolbar.destroy()
+ self.window.close()
+
+ def get_window_title(self):
+ return self.window.windowTitle()
+
+ def set_window_title(self, title):
+ self.window.setWindowTitle(title)
+
+
+class NavigationToolbar2QT(NavigationToolbar2, QtWidgets.QToolBar):
+ toolitems = [*NavigationToolbar2.toolitems]
+ toolitems.insert(
+ # Add 'customize' action after 'subplots'
+ [name for name, *_ in toolitems].index("Subplots") + 1,
+ ("Customize", "Edit axis, curve and image parameters",
+ "qt4_editor_options", "edit_parameters"))
+
+ def __init__(self, canvas, parent=None, coordinates=True):
+ """coordinates: should we show the coordinates on the right?"""
+ QtWidgets.QToolBar.__init__(self, parent)
+ self.setAllowedAreas(QtCore.Qt.ToolBarArea(
+ _to_int(QtCore.Qt.ToolBarArea.TopToolBarArea) |
+ _to_int(QtCore.Qt.ToolBarArea.BottomToolBarArea)))
+ self.coordinates = coordinates
+ self._actions = {} # mapping of toolitem method names to QActions.
+ self._subplot_dialog = None
+
+ for text, tooltip_text, image_file, callback in self.toolitems:
+ if text is None:
+ self.addSeparator()
+ else:
+ slot = getattr(self, callback)
+ # https://bugreports.qt.io/browse/PYSIDE-2512
+ slot = functools.wraps(slot)(functools.partial(slot))
+ slot = QtCore.Slot()(slot)
+
+ a = self.addAction(self._icon(image_file + '.png'),
+ text, slot)
+ self._actions[callback] = a
+ if callback in ['zoom', 'pan']:
+ a.setCheckable(True)
+ if tooltip_text is not None:
+ a.setToolTip(tooltip_text)
+
+ # Add the (x, y) location widget at the right side of the toolbar
+ # The stretch factor is 1 which means any resizing of the toolbar
+ # will resize this label instead of the buttons.
+ if self.coordinates:
+ self.locLabel = QtWidgets.QLabel("", self)
+ self.locLabel.setAlignment(QtCore.Qt.AlignmentFlag(
+ _to_int(QtCore.Qt.AlignmentFlag.AlignRight) |
+ _to_int(QtCore.Qt.AlignmentFlag.AlignVCenter)))
+
+ self.locLabel.setSizePolicy(QtWidgets.QSizePolicy(
+ QtWidgets.QSizePolicy.Policy.Expanding,
+ QtWidgets.QSizePolicy.Policy.Ignored,
+ ))
+ labelAction = self.addWidget(self.locLabel)
+ labelAction.setVisible(True)
+
+ NavigationToolbar2.__init__(self, canvas)
+
+ def _icon(self, name):
+ """
+ Construct a `.QIcon` from an image file *name*, including the extension
+ and relative to Matplotlib's "images" data directory.
+ """
+ # use a high-resolution icon with suffix '_large' if available
+ # note: user-provided icons may not have '_large' versions
+ path_regular = cbook._get_data_path('images', name)
+ path_large = path_regular.with_name(
+ path_regular.name.replace('.png', '_large.png'))
+ filename = str(path_large if path_large.exists() else path_regular)
+
+ pm = QtGui.QPixmap(filename)
+ pm.setDevicePixelRatio(
+ self.devicePixelRatioF() or 1) # rarely, devicePixelRatioF=0
+ if self.palette().color(self.backgroundRole()).value() < 128:
+ icon_color = self.palette().color(self.foregroundRole())
+ mask = pm.createMaskFromColor(
+ QtGui.QColor('black'),
+ QtCore.Qt.MaskMode.MaskOutColor)
+ pm.fill(icon_color)
+ pm.setMask(mask)
+ return QtGui.QIcon(pm)
+
+ def edit_parameters(self):
+ axes = self.canvas.figure.get_axes()
+ if not axes:
+ QtWidgets.QMessageBox.warning(
+ self.canvas.parent(), "Error", "There are no Axes to edit.")
+ return
+ elif len(axes) == 1:
+ ax, = axes
+ else:
+ titles = [
+ ax.get_label() or
+ ax.get_title() or
+ ax.get_title("left") or
+ ax.get_title("right") or
+ " - ".join(filter(None, [ax.get_xlabel(), ax.get_ylabel()])) or
+ f""
+ for ax in axes]
+ duplicate_titles = [
+ title for title in titles if titles.count(title) > 1]
+ for i, ax in enumerate(axes):
+ if titles[i] in duplicate_titles:
+ titles[i] += f" (id: {id(ax):#x})" # Deduplicate titles.
+ item, ok = QtWidgets.QInputDialog.getItem(
+ self.canvas.parent(),
+ 'Customize', 'Select Axes:', titles, 0, False)
+ if not ok:
+ return
+ ax = axes[titles.index(item)]
+ figureoptions.figure_edit(ax, self)
+
+ def _update_buttons_checked(self):
+ # sync button checkstates to match active mode
+ if 'pan' in self._actions:
+ self._actions['pan'].setChecked(self.mode.name == 'PAN')
+ if 'zoom' in self._actions:
+ self._actions['zoom'].setChecked(self.mode.name == 'ZOOM')
+
+ def pan(self, *args):
+ super().pan(*args)
+ self._update_buttons_checked()
+
+ def zoom(self, *args):
+ super().zoom(*args)
+ self._update_buttons_checked()
+
+ def set_message(self, s):
+ if self.coordinates:
+ self.locLabel.setText(s)
+
+ def draw_rubberband(self, event, x0, y0, x1, y1):
+ height = self.canvas.figure.bbox.height
+ y1 = height - y1
+ y0 = height - y0
+ rect = [int(val) for val in (x0, y0, x1 - x0, y1 - y0)]
+ self.canvas.drawRectangle(rect)
+
+ def remove_rubberband(self):
+ self.canvas.drawRectangle(None)
+
+ def configure_subplots(self):
+ if self._subplot_dialog is None:
+ self._subplot_dialog = SubplotToolQt(
+ self.canvas.figure, self.canvas.parent())
+ self.canvas.mpl_connect(
+ "close_event", lambda e: self._subplot_dialog.reject())
+ self._subplot_dialog.update_from_current_subplotpars()
+ self._subplot_dialog.setModal(True)
+ self._subplot_dialog.show()
+ return self._subplot_dialog
+
+ def save_figure(self, *args):
+ filetypes = self.canvas.get_supported_filetypes_grouped()
+ sorted_filetypes = sorted(filetypes.items())
+ default_filetype = self.canvas.get_default_filetype()
+
+ startpath = os.path.expanduser(mpl.rcParams['savefig.directory'])
+ start = os.path.join(startpath, self.canvas.get_default_filename())
+ filters = []
+ selectedFilter = None
+ for name, exts in sorted_filetypes:
+ exts_list = " ".join(['*.%s' % ext for ext in exts])
+ filter = f'{name} ({exts_list})'
+ if default_filetype in exts:
+ selectedFilter = filter
+ filters.append(filter)
+ filters = ';;'.join(filters)
+
+ fname, filter = QtWidgets.QFileDialog.getSaveFileName(
+ self.canvas.parent(), "Choose a filename to save to", start,
+ filters, selectedFilter)
+ if fname:
+ # Save dir for next time, unless empty str (i.e., use cwd).
+ if startpath != "":
+ mpl.rcParams['savefig.directory'] = os.path.dirname(fname)
+ try:
+ self.canvas.figure.savefig(fname)
+ except Exception as e:
+ QtWidgets.QMessageBox.critical(
+ self, "Error saving file", str(e),
+ QtWidgets.QMessageBox.StandardButton.Ok,
+ QtWidgets.QMessageBox.StandardButton.NoButton)
+ return fname
+
+ def set_history_buttons(self):
+ can_backward = self._nav_stack._pos > 0
+ can_forward = self._nav_stack._pos < len(self._nav_stack) - 1
+ if 'back' in self._actions:
+ self._actions['back'].setEnabled(can_backward)
+ if 'forward' in self._actions:
+ self._actions['forward'].setEnabled(can_forward)
+
+
+class SubplotToolQt(QtWidgets.QDialog):
+ def __init__(self, targetfig, parent):
+ super().__init__(parent)
+ self.setWindowIcon(QtGui.QIcon(
+ str(cbook._get_data_path("images/matplotlib.png"))))
+ self.setObjectName("SubplotTool")
+ self._spinboxes = {}
+ main_layout = QtWidgets.QHBoxLayout()
+ self.setLayout(main_layout)
+ for group, spinboxes, buttons in [
+ ("Borders",
+ ["top", "bottom", "left", "right"],
+ [("Export values", self._export_values)]),
+ ("Spacings",
+ ["hspace", "wspace"],
+ [("Tight layout", self._tight_layout),
+ ("Reset", self._reset),
+ ("Close", self.close)])]:
+ layout = QtWidgets.QVBoxLayout()
+ main_layout.addLayout(layout)
+ box = QtWidgets.QGroupBox(group)
+ layout.addWidget(box)
+ inner = QtWidgets.QFormLayout(box)
+ for name in spinboxes:
+ self._spinboxes[name] = spinbox = QtWidgets.QDoubleSpinBox()
+ spinbox.setRange(0, 1)
+ spinbox.setDecimals(3)
+ spinbox.setSingleStep(0.005)
+ spinbox.setKeyboardTracking(False)
+ spinbox.valueChanged.connect(self._on_value_changed)
+ inner.addRow(name, spinbox)
+ layout.addStretch(1)
+ for name, method in buttons:
+ button = QtWidgets.QPushButton(name)
+ # Don't trigger on , which is used to input values.
+ button.setAutoDefault(False)
+ button.clicked.connect(method)
+ layout.addWidget(button)
+ if name == "Close":
+ button.setFocus()
+ self._figure = targetfig
+ self._defaults = {}
+ self._export_values_dialog = None
+ self.update_from_current_subplotpars()
+
+ def update_from_current_subplotpars(self):
+ self._defaults = {spinbox: getattr(self._figure.subplotpars, name)
+ for name, spinbox in self._spinboxes.items()}
+ self._reset() # Set spinbox current values without triggering signals.
+
+ def _export_values(self):
+ # Explicitly round to 3 decimals (which is also the spinbox precision)
+ # to avoid numbers of the form 0.100...001.
+ self._export_values_dialog = QtWidgets.QDialog()
+ layout = QtWidgets.QVBoxLayout()
+ self._export_values_dialog.setLayout(layout)
+ text = QtWidgets.QPlainTextEdit()
+ text.setReadOnly(True)
+ layout.addWidget(text)
+ text.setPlainText(
+ ",\n".join(f"{attr}={spinbox.value():.3}"
+ for attr, spinbox in self._spinboxes.items()))
+ # Adjust the height of the text widget to fit the whole text, plus
+ # some padding.
+ size = text.maximumSize()
+ size.setHeight(
+ QtGui.QFontMetrics(text.document().defaultFont())
+ .size(0, text.toPlainText()).height() + 20)
+ text.setMaximumSize(size)
+ self._export_values_dialog.show()
+
+ def _on_value_changed(self):
+ spinboxes = self._spinboxes
+ # Set all mins and maxes, so that this can also be used in _reset().
+ for lower, higher in [("bottom", "top"), ("left", "right")]:
+ spinboxes[higher].setMinimum(spinboxes[lower].value() + .001)
+ spinboxes[lower].setMaximum(spinboxes[higher].value() - .001)
+ self._figure.subplots_adjust(
+ **{attr: spinbox.value() for attr, spinbox in spinboxes.items()})
+ self._figure.canvas.draw_idle()
+
+ def _tight_layout(self):
+ self._figure.tight_layout()
+ for attr, spinbox in self._spinboxes.items():
+ spinbox.blockSignals(True)
+ spinbox.setValue(getattr(self._figure.subplotpars, attr))
+ spinbox.blockSignals(False)
+ self._figure.canvas.draw_idle()
+
+ def _reset(self):
+ for spinbox, value in self._defaults.items():
+ spinbox.setRange(0, 1)
+ spinbox.blockSignals(True)
+ spinbox.setValue(value)
+ spinbox.blockSignals(False)
+ self._on_value_changed()
+
+
+class ToolbarQt(ToolContainerBase, QtWidgets.QToolBar):
+ def __init__(self, toolmanager, parent=None):
+ ToolContainerBase.__init__(self, toolmanager)
+ QtWidgets.QToolBar.__init__(self, parent)
+ self.setAllowedAreas(QtCore.Qt.ToolBarArea(
+ _to_int(QtCore.Qt.ToolBarArea.TopToolBarArea) |
+ _to_int(QtCore.Qt.ToolBarArea.BottomToolBarArea)))
+ message_label = QtWidgets.QLabel("")
+ message_label.setAlignment(QtCore.Qt.AlignmentFlag(
+ _to_int(QtCore.Qt.AlignmentFlag.AlignRight) |
+ _to_int(QtCore.Qt.AlignmentFlag.AlignVCenter)))
+ message_label.setSizePolicy(QtWidgets.QSizePolicy(
+ QtWidgets.QSizePolicy.Policy.Expanding,
+ QtWidgets.QSizePolicy.Policy.Ignored,
+ ))
+ self._message_action = self.addWidget(message_label)
+ self._toolitems = {}
+ self._groups = {}
+
+ def add_toolitem(
+ self, name, group, position, image_file, description, toggle):
+
+ button = QtWidgets.QToolButton(self)
+ if image_file:
+ button.setIcon(NavigationToolbar2QT._icon(self, image_file))
+ button.setText(name)
+ if description:
+ button.setToolTip(description)
+
+ def handler():
+ self.trigger_tool(name)
+ if toggle:
+ button.setCheckable(True)
+ button.toggled.connect(handler)
+ else:
+ button.clicked.connect(handler)
+
+ self._toolitems.setdefault(name, [])
+ self._add_to_group(group, name, button, position)
+ self._toolitems[name].append((button, handler))
+
+ def _add_to_group(self, group, name, button, position):
+ gr = self._groups.get(group, [])
+ if not gr:
+ sep = self.insertSeparator(self._message_action)
+ gr.append(sep)
+ before = gr[position]
+ widget = self.insertWidget(before, button)
+ gr.insert(position, widget)
+ self._groups[group] = gr
+
+ def toggle_toolitem(self, name, toggled):
+ if name not in self._toolitems:
+ return
+ for button, handler in self._toolitems[name]:
+ button.toggled.disconnect(handler)
+ button.setChecked(toggled)
+ button.toggled.connect(handler)
+
+ def remove_toolitem(self, name):
+ for button, handler in self._toolitems.pop(name, []):
+ button.setParent(None)
+
+ def set_message(self, s):
+ self.widgetForAction(self._message_action).setText(s)
+
+
+@backend_tools._register_tool_class(FigureCanvasQT)
+class ConfigureSubplotsQt(backend_tools.ConfigureSubplotsBase):
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._subplot_dialog = None
+
+ def trigger(self, *args):
+ NavigationToolbar2QT.configure_subplots(self)
+
+
+@backend_tools._register_tool_class(FigureCanvasQT)
+class SaveFigureQt(backend_tools.SaveFigureBase):
+ def trigger(self, *args):
+ NavigationToolbar2QT.save_figure(
+ self._make_classic_style_pseudo_toolbar())
+
+
+@backend_tools._register_tool_class(FigureCanvasQT)
+class RubberbandQt(backend_tools.RubberbandBase):
+ def draw_rubberband(self, x0, y0, x1, y1):
+ NavigationToolbar2QT.draw_rubberband(
+ self._make_classic_style_pseudo_toolbar(), None, x0, y0, x1, y1)
+
+ def remove_rubberband(self):
+ NavigationToolbar2QT.remove_rubberband(
+ self._make_classic_style_pseudo_toolbar())
+
+
+@backend_tools._register_tool_class(FigureCanvasQT)
+class HelpQt(backend_tools.ToolHelpBase):
+ def trigger(self, *args):
+ QtWidgets.QMessageBox.information(None, "Help", self._get_help_html())
+
+
+@backend_tools._register_tool_class(FigureCanvasQT)
+class ToolCopyToClipboardQT(backend_tools.ToolCopyToClipboardBase):
+ def trigger(self, *args, **kwargs):
+ pixmap = self.canvas.grab()
+ QtWidgets.QApplication.instance().clipboard().setPixmap(pixmap)
+
+
+FigureManagerQT._toolbar2_class = NavigationToolbar2QT
+FigureManagerQT._toolmanager_toolbar_class = ToolbarQt
+
+
+@_Backend.export
+class _BackendQT(_Backend):
+ backend_version = __version__
+ FigureCanvas = FigureCanvasQT
+ FigureManager = FigureManagerQT
+ mainloop = FigureManagerQT.start_main_loop
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5.py
new file mode 100644
index 0000000000000000000000000000000000000000..d94062b723f49aa1ff2fb0621748232684feef72
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5.py
@@ -0,0 +1,28 @@
+from .. import backends
+
+backends._QT_FORCE_QT5_BINDING = True
+
+
+from .backend_qt import ( # noqa
+ SPECIAL_KEYS,
+ # Public API
+ cursord, _create_qApp, _BackendQT, TimerQT, MainWindow, FigureCanvasQT,
+ FigureManagerQT, ToolbarQt, NavigationToolbar2QT, SubplotToolQt,
+ SaveFigureQt, ConfigureSubplotsQt, RubberbandQt,
+ HelpQt, ToolCopyToClipboardQT,
+ # internal re-exports
+ FigureCanvasBase, FigureManagerBase, MouseButton, NavigationToolbar2,
+ TimerBase, ToolContainerBase, figureoptions, Gcf
+)
+from . import backend_qt as _backend_qt # noqa
+
+
+@_BackendQT.export
+class _BackendQT5(_BackendQT):
+ pass
+
+
+def __getattr__(name):
+ if name == 'qApp':
+ return _backend_qt.qApp
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5agg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5agg.py
new file mode 100644
index 0000000000000000000000000000000000000000..8a92fd5135d5a3f4b05b3a71d1089e15d031fd59
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5agg.py
@@ -0,0 +1,14 @@
+"""
+Render to qt from agg
+"""
+from .. import backends
+
+backends._QT_FORCE_QT5_BINDING = True
+from .backend_qtagg import ( # noqa: F401, E402 # pylint: disable=W0611
+ _BackendQTAgg, FigureCanvasQTAgg, FigureManagerQT, NavigationToolbar2QT,
+ FigureCanvasAgg, FigureCanvasQT)
+
+
+@_BackendQTAgg.export
+class _BackendQT5Agg(_BackendQTAgg):
+ pass
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5cairo.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5cairo.py
new file mode 100644
index 0000000000000000000000000000000000000000..a4263f5971191a26d849a741a24cf40f7ea8b9ac
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qt5cairo.py
@@ -0,0 +1,11 @@
+from .. import backends
+
+backends._QT_FORCE_QT5_BINDING = True
+from .backend_qtcairo import ( # noqa: F401, E402 # pylint: disable=W0611
+ _BackendQTCairo, FigureCanvasQTCairo, FigureCanvasCairo, FigureCanvasQT
+)
+
+
+@_BackendQTCairo.export
+class _BackendQT5Cairo(_BackendQTCairo):
+ pass
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qtagg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qtagg.py
new file mode 100644
index 0000000000000000000000000000000000000000..256e50a3d1c3305be1b5fd5e9da9cb9807f4ec1f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qtagg.py
@@ -0,0 +1,86 @@
+"""
+Render to qt from agg.
+"""
+
+import ctypes
+
+from matplotlib.transforms import Bbox
+
+from .qt_compat import QT_API, QtCore, QtGui
+from .backend_agg import FigureCanvasAgg
+from .backend_qt import _BackendQT, FigureCanvasQT
+from .backend_qt import ( # noqa: F401 # pylint: disable=W0611
+ FigureManagerQT, NavigationToolbar2QT)
+
+
+class FigureCanvasQTAgg(FigureCanvasAgg, FigureCanvasQT):
+
+ def paintEvent(self, event):
+ """
+ Copy the image from the Agg canvas to the qt.drawable.
+
+ In Qt, all drawing should be done inside of here when a widget is
+ shown onscreen.
+ """
+ self._draw_idle() # Only does something if a draw is pending.
+
+ # If the canvas does not have a renderer, then give up and wait for
+ # FigureCanvasAgg.draw(self) to be called.
+ if not hasattr(self, 'renderer'):
+ return
+
+ painter = QtGui.QPainter(self)
+ try:
+ # See documentation of QRect: bottom() and right() are off
+ # by 1, so use left() + width() and top() + height().
+ rect = event.rect()
+ # scale rect dimensions using the screen dpi ratio to get
+ # correct values for the Figure coordinates (rather than
+ # QT5's coords)
+ width = rect.width() * self.device_pixel_ratio
+ height = rect.height() * self.device_pixel_ratio
+ left, top = self.mouseEventCoords(rect.topLeft())
+ # shift the "top" by the height of the image to get the
+ # correct corner for our coordinate system
+ bottom = top - height
+ # same with the right side of the image
+ right = left + width
+ # create a buffer using the image bounding box
+ bbox = Bbox([[left, bottom], [right, top]])
+ buf = memoryview(self.copy_from_bbox(bbox))
+
+ if QT_API == "PyQt6":
+ from PyQt6 import sip
+ ptr = int(sip.voidptr(buf))
+ else:
+ ptr = buf
+
+ painter.eraseRect(rect) # clear the widget canvas
+ qimage = QtGui.QImage(ptr, buf.shape[1], buf.shape[0],
+ QtGui.QImage.Format.Format_RGBA8888)
+ qimage.setDevicePixelRatio(self.device_pixel_ratio)
+ # set origin using original QT coordinates
+ origin = QtCore.QPoint(rect.left(), rect.top())
+ painter.drawImage(origin, qimage)
+ # Adjust the buf reference count to work around a memory
+ # leak bug in QImage under PySide.
+ if QT_API == "PySide2" and QtCore.__version_info__ < (5, 12):
+ ctypes.c_long.from_address(id(buf)).value = 1
+
+ self._draw_rect_callback(painter)
+ finally:
+ painter.end()
+
+ def print_figure(self, *args, **kwargs):
+ super().print_figure(*args, **kwargs)
+ # In some cases, Qt will itself trigger a paint event after closing the file
+ # save dialog. When that happens, we need to be sure that the internal canvas is
+ # re-drawn. However, if the user is using an automatically-chosen Qt backend but
+ # saving with a different backend (such as pgf), we do not want to trigger a
+ # full draw in Qt, so just set the flag for next time.
+ self._draw_pending = True
+
+
+@_BackendQT.export
+class _BackendQTAgg(_BackendQT):
+ FigureCanvas = FigureCanvasQTAgg
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qtcairo.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qtcairo.py
new file mode 100644
index 0000000000000000000000000000000000000000..72eb2dc70b906680b65e312a750386f6ed44ec6e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_qtcairo.py
@@ -0,0 +1,46 @@
+import ctypes
+
+from .backend_cairo import cairo, FigureCanvasCairo
+from .backend_qt import _BackendQT, FigureCanvasQT
+from .qt_compat import QT_API, QtCore, QtGui
+
+
+class FigureCanvasQTCairo(FigureCanvasCairo, FigureCanvasQT):
+ def draw(self):
+ if hasattr(self._renderer.gc, "ctx"):
+ self._renderer.dpi = self.figure.dpi
+ self.figure.draw(self._renderer)
+ super().draw()
+
+ def paintEvent(self, event):
+ width = int(self.device_pixel_ratio * self.width())
+ height = int(self.device_pixel_ratio * self.height())
+ if (width, height) != self._renderer.get_canvas_width_height():
+ surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
+ self._renderer.set_context(cairo.Context(surface))
+ self._renderer.dpi = self.figure.dpi
+ self.figure.draw(self._renderer)
+ buf = self._renderer.gc.ctx.get_target().get_data()
+ if QT_API == "PyQt6":
+ from PyQt6 import sip
+ ptr = int(sip.voidptr(buf))
+ else:
+ ptr = buf
+ qimage = QtGui.QImage(
+ ptr, width, height,
+ QtGui.QImage.Format.Format_ARGB32_Premultiplied)
+ # Adjust the buf reference count to work around a memory leak bug in
+ # QImage under PySide.
+ if QT_API == "PySide2" and QtCore.__version_info__ < (5, 12):
+ ctypes.c_long.from_address(id(buf)).value = 1
+ qimage.setDevicePixelRatio(self.device_pixel_ratio)
+ painter = QtGui.QPainter(self)
+ painter.eraseRect(event.rect())
+ painter.drawImage(0, 0, qimage)
+ self._draw_rect_callback(painter)
+ painter.end()
+
+
+@_BackendQT.export
+class _BackendQTCairo(_BackendQT):
+ FigureCanvas = FigureCanvasQTCairo
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_svg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_svg.py
new file mode 100644
index 0000000000000000000000000000000000000000..2193dc6b6cdcfd29f6b1e1c9d441afcb638c0cef
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_svg.py
@@ -0,0 +1,1380 @@
+import base64
+import codecs
+import datetime
+import gzip
+import hashlib
+from io import BytesIO
+import itertools
+import logging
+import os
+import re
+import uuid
+
+import numpy as np
+from PIL import Image
+
+import matplotlib as mpl
+from matplotlib import cbook, font_manager as fm
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase, RendererBase)
+from matplotlib.backends.backend_mixed import MixedModeRenderer
+from matplotlib.colors import rgb2hex
+from matplotlib.dates import UTC
+from matplotlib.path import Path
+from matplotlib import _path
+from matplotlib.transforms import Affine2D, Affine2DBase
+
+
+_log = logging.getLogger(__name__)
+
+
+# ----------------------------------------------------------------------
+# SimpleXMLWriter class
+#
+# Based on an original by Fredrik Lundh, but modified here to:
+# 1. Support modern Python idioms
+# 2. Remove encoding support (it's handled by the file writer instead)
+# 3. Support proper indentation
+# 4. Minify things a little bit
+
+# --------------------------------------------------------------------
+# The SimpleXMLWriter module is
+#
+# Copyright (c) 2001-2004 by Fredrik Lundh
+#
+# By obtaining, using, and/or copying this software and/or its
+# associated documentation, you agree that you have read, understood,
+# and will comply with the following terms and conditions:
+#
+# Permission to use, copy, modify, and distribute this software and
+# its associated documentation for any purpose and without fee is
+# hereby granted, provided that the above copyright notice appears in
+# all copies, and that both that copyright notice and this permission
+# notice appear in supporting documentation, and that the name of
+# Secret Labs AB or the author not be used in advertising or publicity
+# pertaining to distribution of the software without specific, written
+# prior permission.
+#
+# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
+# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
+# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
+# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+# --------------------------------------------------------------------
+
+
+def _escape_cdata(s):
+ s = s.replace("&", "&")
+ s = s.replace("<", "<")
+ s = s.replace(">", ">")
+ return s
+
+
+_escape_xml_comment = re.compile(r'-(?=-)')
+
+
+def _escape_comment(s):
+ s = _escape_cdata(s)
+ return _escape_xml_comment.sub('- ', s)
+
+
+def _escape_attrib(s):
+ s = s.replace("&", "&")
+ s = s.replace("'", "'")
+ s = s.replace('"', """)
+ s = s.replace("<", "<")
+ s = s.replace(">", ">")
+ return s
+
+
+def _quote_escape_attrib(s):
+ return ('"' + _escape_cdata(s) + '"' if '"' not in s else
+ "'" + _escape_cdata(s) + "'" if "'" not in s else
+ '"' + _escape_attrib(s) + '"')
+
+
+def _short_float_fmt(x):
+ """
+ Create a short string representation of a float, which is %f
+ formatting with trailing zeros and the decimal point removed.
+ """
+ return f'{x:f}'.rstrip('0').rstrip('.')
+
+
+class XMLWriter:
+ """
+ Parameters
+ ----------
+ file : writable text file-like object
+ """
+
+ def __init__(self, file):
+ self.__write = file.write
+ if hasattr(file, "flush"):
+ self.flush = file.flush
+ self.__open = 0 # true if start tag is open
+ self.__tags = []
+ self.__data = []
+ self.__indentation = " " * 64
+
+ def __flush(self, indent=True):
+ # flush internal buffers
+ if self.__open:
+ if indent:
+ self.__write(">\n")
+ else:
+ self.__write(">")
+ self.__open = 0
+ if self.__data:
+ data = ''.join(self.__data)
+ self.__write(_escape_cdata(data))
+ self.__data = []
+
+ def start(self, tag, attrib={}, **extra):
+ """
+ Open a new element. Attributes can be given as keyword
+ arguments, or as a string/string dictionary. The method returns
+ an opaque identifier that can be passed to the :meth:`close`
+ method, to close all open elements up to and including this one.
+
+ Parameters
+ ----------
+ tag
+ Element tag.
+ attrib
+ Attribute dictionary. Alternatively, attributes can be given as
+ keyword arguments.
+
+ Returns
+ -------
+ An element identifier.
+ """
+ self.__flush()
+ tag = _escape_cdata(tag)
+ self.__data = []
+ self.__tags.append(tag)
+ self.__write(self.__indentation[:len(self.__tags) - 1])
+ self.__write(f"<{tag}")
+ for k, v in {**attrib, **extra}.items():
+ if v:
+ k = _escape_cdata(k)
+ v = _quote_escape_attrib(v)
+ self.__write(f' {k}={v}')
+ self.__open = 1
+ return len(self.__tags) - 1
+
+ def comment(self, comment):
+ """
+ Add a comment to the output stream.
+
+ Parameters
+ ----------
+ comment : str
+ Comment text.
+ """
+ self.__flush()
+ self.__write(self.__indentation[:len(self.__tags)])
+ self.__write(f"\n")
+
+ def data(self, text):
+ """
+ Add character data to the output stream.
+
+ Parameters
+ ----------
+ text : str
+ Character data.
+ """
+ self.__data.append(text)
+
+ def end(self, tag=None, indent=True):
+ """
+ Close the current element (opened by the most recent call to
+ :meth:`start`).
+
+ Parameters
+ ----------
+ tag
+ Element tag. If given, the tag must match the start tag. If
+ omitted, the current element is closed.
+ indent : bool, default: True
+ """
+ if tag:
+ assert self.__tags, f"unbalanced end({tag})"
+ assert _escape_cdata(tag) == self.__tags[-1], \
+ f"expected end({self.__tags[-1]}), got {tag}"
+ else:
+ assert self.__tags, "unbalanced end()"
+ tag = self.__tags.pop()
+ if self.__data:
+ self.__flush(indent)
+ elif self.__open:
+ self.__open = 0
+ self.__write("/>\n")
+ return
+ if indent:
+ self.__write(self.__indentation[:len(self.__tags)])
+ self.__write(f"{tag}>\n")
+
+ def close(self, id):
+ """
+ Close open elements, up to (and including) the element identified
+ by the given identifier.
+
+ Parameters
+ ----------
+ id
+ Element identifier, as returned by the :meth:`start` method.
+ """
+ while len(self.__tags) > id:
+ self.end()
+
+ def element(self, tag, text=None, attrib={}, **extra):
+ """
+ Add an entire element. This is the same as calling :meth:`start`,
+ :meth:`data`, and :meth:`end` in sequence. The *text* argument can be
+ omitted.
+ """
+ self.start(tag, attrib, **extra)
+ if text:
+ self.data(text)
+ self.end(indent=False)
+
+ def flush(self):
+ """Flush the output stream."""
+ pass # replaced by the constructor
+
+
+def _generate_transform(transform_list):
+ parts = []
+ for type, value in transform_list:
+ if (type == 'scale' and (value == (1,) or value == (1, 1))
+ or type == 'translate' and value == (0, 0)
+ or type == 'rotate' and value == (0,)):
+ continue
+ if type == 'matrix' and isinstance(value, Affine2DBase):
+ value = value.to_values()
+ parts.append('{}({})'.format(
+ type, ' '.join(_short_float_fmt(x) for x in value)))
+ return ' '.join(parts)
+
+
+def _generate_css(attrib):
+ return "; ".join(f"{k}: {v}" for k, v in attrib.items())
+
+
+_capstyle_d = {'projecting': 'square', 'butt': 'butt', 'round': 'round'}
+
+
+def _check_is_str(info, key):
+ if not isinstance(info, str):
+ raise TypeError(f'Invalid type for {key} metadata. Expected str, not '
+ f'{type(info)}.')
+
+
+def _check_is_iterable_of_str(infos, key):
+ if np.iterable(infos):
+ for info in infos:
+ if not isinstance(info, str):
+ raise TypeError(f'Invalid type for {key} metadata. Expected '
+ f'iterable of str, not {type(info)}.')
+ else:
+ raise TypeError(f'Invalid type for {key} metadata. Expected str or '
+ f'iterable of str, not {type(infos)}.')
+
+
+class RendererSVG(RendererBase):
+ def __init__(self, width, height, svgwriter, basename=None, image_dpi=72,
+ *, metadata=None):
+ self.width = width
+ self.height = height
+ self.writer = XMLWriter(svgwriter)
+ self.image_dpi = image_dpi # actual dpi at which we rasterize stuff
+
+ if basename is None:
+ basename = getattr(svgwriter, "name", "")
+ if not isinstance(basename, str):
+ basename = ""
+ self.basename = basename
+
+ self._groupd = {}
+ self._image_counter = itertools.count()
+ self._clip_path_ids = {}
+ self._clipd = {}
+ self._markers = {}
+ self._path_collection_id = 0
+ self._hatchd = {}
+ self._has_gouraud = False
+ self._n_gradients = 0
+
+ super().__init__()
+ self._glyph_map = dict()
+ str_height = _short_float_fmt(height)
+ str_width = _short_float_fmt(width)
+ svgwriter.write(svgProlog)
+ self._start_id = self.writer.start(
+ 'svg',
+ width=f'{str_width}pt',
+ height=f'{str_height}pt',
+ viewBox=f'0 0 {str_width} {str_height}',
+ xmlns="http://www.w3.org/2000/svg",
+ version="1.1",
+ id=mpl.rcParams['svg.id'],
+ attrib={'xmlns:xlink': "http://www.w3.org/1999/xlink"})
+ self._write_metadata(metadata)
+ self._write_default_style()
+
+ def _get_clippath_id(self, clippath):
+ """
+ Returns a stable and unique identifier for the *clippath* argument
+ object within the current rendering context.
+
+ This allows plots that include custom clip paths to produce identical
+ SVG output on each render, provided that the :rc:`svg.hashsalt` config
+ setting and the ``SOURCE_DATE_EPOCH`` build-time environment variable
+ are set to fixed values.
+ """
+ if clippath not in self._clip_path_ids:
+ self._clip_path_ids[clippath] = len(self._clip_path_ids)
+ return self._clip_path_ids[clippath]
+
+ def finalize(self):
+ self._write_clips()
+ self._write_hatches()
+ self.writer.close(self._start_id)
+ self.writer.flush()
+
+ def _write_metadata(self, metadata):
+ # Add metadata following the Dublin Core Metadata Initiative, and the
+ # Creative Commons Rights Expression Language. This is mainly for
+ # compatibility with Inkscape.
+ if metadata is None:
+ metadata = {}
+ metadata = {
+ 'Format': 'image/svg+xml',
+ 'Type': 'http://purl.org/dc/dcmitype/StillImage',
+ 'Creator':
+ f'Matplotlib v{mpl.__version__}, https://matplotlib.org/',
+ **metadata
+ }
+ writer = self.writer
+
+ if 'Title' in metadata:
+ title = metadata['Title']
+ _check_is_str(title, 'Title')
+ writer.element('title', text=title)
+
+ # Special handling.
+ date = metadata.get('Date', None)
+ if date is not None:
+ if isinstance(date, str):
+ dates = [date]
+ elif isinstance(date, (datetime.datetime, datetime.date)):
+ dates = [date.isoformat()]
+ elif np.iterable(date):
+ dates = []
+ for d in date:
+ if isinstance(d, str):
+ dates.append(d)
+ elif isinstance(d, (datetime.datetime, datetime.date)):
+ dates.append(d.isoformat())
+ else:
+ raise TypeError(
+ f'Invalid type for Date metadata. '
+ f'Expected iterable of str, date, or datetime, '
+ f'not {type(d)}.')
+ else:
+ raise TypeError(f'Invalid type for Date metadata. '
+ f'Expected str, date, datetime, or iterable '
+ f'of the same, not {type(date)}.')
+ metadata['Date'] = '/'.join(dates)
+ elif 'Date' not in metadata:
+ # Do not add `Date` if the user explicitly set `Date` to `None`
+ # Get source date from SOURCE_DATE_EPOCH, if set.
+ # See https://reproducible-builds.org/specs/source-date-epoch/
+ date = os.getenv("SOURCE_DATE_EPOCH")
+ if date:
+ date = datetime.datetime.fromtimestamp(int(date), datetime.timezone.utc)
+ metadata['Date'] = date.replace(tzinfo=UTC).isoformat()
+ else:
+ metadata['Date'] = datetime.datetime.today().isoformat()
+
+ mid = None
+ def ensure_metadata(mid):
+ if mid is not None:
+ return mid
+ mid = writer.start('metadata')
+ writer.start('rdf:RDF', attrib={
+ 'xmlns:dc': "http://purl.org/dc/elements/1.1/",
+ 'xmlns:cc': "http://creativecommons.org/ns#",
+ 'xmlns:rdf': "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
+ })
+ writer.start('cc:Work')
+ return mid
+
+ uri = metadata.pop('Type', None)
+ if uri is not None:
+ mid = ensure_metadata(mid)
+ writer.element('dc:type', attrib={'rdf:resource': uri})
+
+ # Single value only.
+ for key in ['Title', 'Coverage', 'Date', 'Description', 'Format',
+ 'Identifier', 'Language', 'Relation', 'Source']:
+ info = metadata.pop(key, None)
+ if info is not None:
+ mid = ensure_metadata(mid)
+ _check_is_str(info, key)
+ writer.element(f'dc:{key.lower()}', text=info)
+
+ # Multiple Agent values.
+ for key in ['Creator', 'Contributor', 'Publisher', 'Rights']:
+ agents = metadata.pop(key, None)
+ if agents is None:
+ continue
+
+ if isinstance(agents, str):
+ agents = [agents]
+
+ _check_is_iterable_of_str(agents, key)
+ # Now we know that we have an iterable of str
+ mid = ensure_metadata(mid)
+ writer.start(f'dc:{key.lower()}')
+ for agent in agents:
+ writer.start('cc:Agent')
+ writer.element('dc:title', text=agent)
+ writer.end('cc:Agent')
+ writer.end(f'dc:{key.lower()}')
+
+ # Multiple values.
+ keywords = metadata.pop('Keywords', None)
+ if keywords is not None:
+ if isinstance(keywords, str):
+ keywords = [keywords]
+ _check_is_iterable_of_str(keywords, 'Keywords')
+ # Now we know that we have an iterable of str
+ mid = ensure_metadata(mid)
+ writer.start('dc:subject')
+ writer.start('rdf:Bag')
+ for keyword in keywords:
+ writer.element('rdf:li', text=keyword)
+ writer.end('rdf:Bag')
+ writer.end('dc:subject')
+
+ if mid is not None:
+ writer.close(mid)
+
+ if metadata:
+ raise ValueError('Unknown metadata key(s) passed to SVG writer: ' +
+ ','.join(metadata))
+
+ def _write_default_style(self):
+ writer = self.writer
+ default_style = _generate_css({
+ 'stroke-linejoin': 'round',
+ 'stroke-linecap': 'butt'})
+ writer.start('defs')
+ writer.element('style', type='text/css', text='*{%s}' % default_style)
+ writer.end('defs')
+
+ def _make_id(self, type, content):
+ salt = mpl.rcParams['svg.hashsalt']
+ if salt is None:
+ salt = str(uuid.uuid4())
+ m = hashlib.sha256()
+ m.update(salt.encode('utf8'))
+ m.update(str(content).encode('utf8'))
+ return f'{type}{m.hexdigest()[:10]}'
+
+ def _make_flip_transform(self, transform):
+ return transform + Affine2D().scale(1, -1).translate(0, self.height)
+
+ def _get_hatch(self, gc, rgbFace):
+ """
+ Create a new hatch pattern
+ """
+ if rgbFace is not None:
+ rgbFace = tuple(rgbFace)
+ edge = gc.get_hatch_color()
+ if edge is not None:
+ edge = tuple(edge)
+ lw = gc.get_hatch_linewidth()
+ dictkey = (gc.get_hatch(), rgbFace, edge, lw)
+ oid = self._hatchd.get(dictkey)
+ if oid is None:
+ oid = self._make_id('h', dictkey)
+ self._hatchd[dictkey] = ((gc.get_hatch_path(), rgbFace, edge, lw), oid)
+ else:
+ _, oid = oid
+ return oid
+
+ def _write_hatches(self):
+ if not len(self._hatchd):
+ return
+ HATCH_SIZE = 72
+ writer = self.writer
+ writer.start('defs')
+ for (path, face, stroke, lw), oid in self._hatchd.values():
+ writer.start(
+ 'pattern',
+ id=oid,
+ patternUnits="userSpaceOnUse",
+ x="0", y="0", width=str(HATCH_SIZE),
+ height=str(HATCH_SIZE))
+ path_data = self._convert_path(
+ path,
+ Affine2D()
+ .scale(HATCH_SIZE).scale(1.0, -1.0).translate(0, HATCH_SIZE),
+ simplify=False)
+ if face is None:
+ fill = 'none'
+ else:
+ fill = rgb2hex(face)
+ writer.element(
+ 'rect',
+ x="0", y="0", width=str(HATCH_SIZE+1),
+ height=str(HATCH_SIZE+1),
+ fill=fill)
+ hatch_style = {
+ 'fill': rgb2hex(stroke),
+ 'stroke': rgb2hex(stroke),
+ 'stroke-width': str(lw),
+ 'stroke-linecap': 'butt',
+ 'stroke-linejoin': 'miter'
+ }
+ if stroke[3] < 1:
+ hatch_style['stroke-opacity'] = str(stroke[3])
+ writer.element(
+ 'path',
+ d=path_data,
+ style=_generate_css(hatch_style)
+ )
+ writer.end('pattern')
+ writer.end('defs')
+
+ def _get_style_dict(self, gc, rgbFace):
+ """Generate a style string from the GraphicsContext and rgbFace."""
+ attrib = {}
+
+ forced_alpha = gc.get_forced_alpha()
+
+ if gc.get_hatch() is not None:
+ attrib['fill'] = f"url(#{self._get_hatch(gc, rgbFace)})"
+ if (rgbFace is not None and len(rgbFace) == 4 and rgbFace[3] != 1.0
+ and not forced_alpha):
+ attrib['fill-opacity'] = _short_float_fmt(rgbFace[3])
+ else:
+ if rgbFace is None:
+ attrib['fill'] = 'none'
+ else:
+ if tuple(rgbFace[:3]) != (0, 0, 0):
+ attrib['fill'] = rgb2hex(rgbFace)
+ if (len(rgbFace) == 4 and rgbFace[3] != 1.0
+ and not forced_alpha):
+ attrib['fill-opacity'] = _short_float_fmt(rgbFace[3])
+
+ if forced_alpha and gc.get_alpha() != 1.0:
+ attrib['opacity'] = _short_float_fmt(gc.get_alpha())
+
+ offset, seq = gc.get_dashes()
+ if seq is not None:
+ attrib['stroke-dasharray'] = ','.join(
+ _short_float_fmt(val) for val in seq)
+ attrib['stroke-dashoffset'] = _short_float_fmt(float(offset))
+
+ linewidth = gc.get_linewidth()
+ if linewidth:
+ rgb = gc.get_rgb()
+ attrib['stroke'] = rgb2hex(rgb)
+ if not forced_alpha and rgb[3] != 1.0:
+ attrib['stroke-opacity'] = _short_float_fmt(rgb[3])
+ if linewidth != 1.0:
+ attrib['stroke-width'] = _short_float_fmt(linewidth)
+ if gc.get_joinstyle() != 'round':
+ attrib['stroke-linejoin'] = gc.get_joinstyle()
+ if gc.get_capstyle() != 'butt':
+ attrib['stroke-linecap'] = _capstyle_d[gc.get_capstyle()]
+
+ return attrib
+
+ def _get_style(self, gc, rgbFace):
+ return _generate_css(self._get_style_dict(gc, rgbFace))
+
+ def _get_clip_attrs(self, gc):
+ cliprect = gc.get_clip_rectangle()
+ clippath, clippath_trans = gc.get_clip_path()
+ if clippath is not None:
+ clippath_trans = self._make_flip_transform(clippath_trans)
+ dictkey = (self._get_clippath_id(clippath), str(clippath_trans))
+ elif cliprect is not None:
+ x, y, w, h = cliprect.bounds
+ y = self.height-(y+h)
+ dictkey = (x, y, w, h)
+ else:
+ return {}
+ clip = self._clipd.get(dictkey)
+ if clip is None:
+ oid = self._make_id('p', dictkey)
+ if clippath is not None:
+ self._clipd[dictkey] = ((clippath, clippath_trans), oid)
+ else:
+ self._clipd[dictkey] = (dictkey, oid)
+ else:
+ _, oid = clip
+ return {'clip-path': f'url(#{oid})'}
+
+ def _write_clips(self):
+ if not len(self._clipd):
+ return
+ writer = self.writer
+ writer.start('defs')
+ for clip, oid in self._clipd.values():
+ writer.start('clipPath', id=oid)
+ if len(clip) == 2:
+ clippath, clippath_trans = clip
+ path_data = self._convert_path(
+ clippath, clippath_trans, simplify=False)
+ writer.element('path', d=path_data)
+ else:
+ x, y, w, h = clip
+ writer.element(
+ 'rect',
+ x=_short_float_fmt(x),
+ y=_short_float_fmt(y),
+ width=_short_float_fmt(w),
+ height=_short_float_fmt(h))
+ writer.end('clipPath')
+ writer.end('defs')
+
+ def open_group(self, s, gid=None):
+ # docstring inherited
+ if gid:
+ self.writer.start('g', id=gid)
+ else:
+ self._groupd[s] = self._groupd.get(s, 0) + 1
+ self.writer.start('g', id=f"{s}_{self._groupd[s]:d}")
+
+ def close_group(self, s):
+ # docstring inherited
+ self.writer.end('g')
+
+ def option_image_nocomposite(self):
+ # docstring inherited
+ return not mpl.rcParams['image.composite_image']
+
+ def _convert_path(self, path, transform=None, clip=None, simplify=None,
+ sketch=None):
+ if clip:
+ clip = (0.0, 0.0, self.width, self.height)
+ else:
+ clip = None
+ return _path.convert_to_string(
+ path, transform, clip, simplify, sketch, 6,
+ [b'M', b'L', b'Q', b'C', b'z'], False).decode('ascii')
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ # docstring inherited
+ trans_and_flip = self._make_flip_transform(transform)
+ clip = (rgbFace is None and gc.get_hatch_path() is None)
+ simplify = path.should_simplify and clip
+ path_data = self._convert_path(
+ path, trans_and_flip, clip=clip, simplify=simplify,
+ sketch=gc.get_sketch_params())
+
+ if gc.get_url() is not None:
+ self.writer.start('a', {'xlink:href': gc.get_url()})
+ self.writer.element('path', d=path_data, **self._get_clip_attrs(gc),
+ style=self._get_style(gc, rgbFace))
+ if gc.get_url() is not None:
+ self.writer.end('a')
+
+ def draw_markers(
+ self, gc, marker_path, marker_trans, path, trans, rgbFace=None):
+ # docstring inherited
+
+ if not len(path.vertices):
+ return
+
+ writer = self.writer
+ path_data = self._convert_path(
+ marker_path,
+ marker_trans + Affine2D().scale(1.0, -1.0),
+ simplify=False)
+ style = self._get_style_dict(gc, rgbFace)
+ dictkey = (path_data, _generate_css(style))
+ oid = self._markers.get(dictkey)
+ style = _generate_css({k: v for k, v in style.items()
+ if k.startswith('stroke')})
+
+ if oid is None:
+ oid = self._make_id('m', dictkey)
+ writer.start('defs')
+ writer.element('path', id=oid, d=path_data, style=style)
+ writer.end('defs')
+ self._markers[dictkey] = oid
+
+ writer.start('g', **self._get_clip_attrs(gc))
+ if gc.get_url() is not None:
+ self.writer.start('a', {'xlink:href': gc.get_url()})
+ trans_and_flip = self._make_flip_transform(trans)
+ attrib = {'xlink:href': f'#{oid}'}
+ clip = (0, 0, self.width*72, self.height*72)
+ for vertices, code in path.iter_segments(
+ trans_and_flip, clip=clip, simplify=False):
+ if len(vertices):
+ x, y = vertices[-2:]
+ attrib['x'] = _short_float_fmt(x)
+ attrib['y'] = _short_float_fmt(y)
+ attrib['style'] = self._get_style(gc, rgbFace)
+ writer.element('use', attrib=attrib)
+ if gc.get_url() is not None:
+ self.writer.end('a')
+ writer.end('g')
+
+ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
+ offsets, offset_trans, facecolors, edgecolors,
+ linewidths, linestyles, antialiaseds, urls,
+ offset_position):
+ # Is the optimization worth it? Rough calculation:
+ # cost of emitting a path in-line is
+ # (len_path + 5) * uses_per_path
+ # cost of definition+use is
+ # (len_path + 3) + 9 * uses_per_path
+ len_path = len(paths[0].vertices) if len(paths) > 0 else 0
+ uses_per_path = self._iter_collection_uses_per_path(
+ paths, all_transforms, offsets, facecolors, edgecolors)
+ should_do_optimization = \
+ len_path + 9 * uses_per_path + 3 < (len_path + 5) * uses_per_path
+ if not should_do_optimization:
+ return super().draw_path_collection(
+ gc, master_transform, paths, all_transforms,
+ offsets, offset_trans, facecolors, edgecolors,
+ linewidths, linestyles, antialiaseds, urls,
+ offset_position)
+
+ writer = self.writer
+ path_codes = []
+ writer.start('defs')
+ for i, (path, transform) in enumerate(self._iter_collection_raw_paths(
+ master_transform, paths, all_transforms)):
+ transform = Affine2D(transform.get_matrix()).scale(1.0, -1.0)
+ d = self._convert_path(path, transform, simplify=False)
+ oid = 'C{:x}_{:x}_{}'.format(
+ self._path_collection_id, i, self._make_id('', d))
+ writer.element('path', id=oid, d=d)
+ path_codes.append(oid)
+ writer.end('defs')
+
+ for xo, yo, path_id, gc0, rgbFace in self._iter_collection(
+ gc, path_codes, offsets, offset_trans,
+ facecolors, edgecolors, linewidths, linestyles,
+ antialiaseds, urls, offset_position):
+ url = gc0.get_url()
+ if url is not None:
+ writer.start('a', attrib={'xlink:href': url})
+ clip_attrs = self._get_clip_attrs(gc0)
+ if clip_attrs:
+ writer.start('g', **clip_attrs)
+ attrib = {
+ 'xlink:href': f'#{path_id}',
+ 'x': _short_float_fmt(xo),
+ 'y': _short_float_fmt(self.height - yo),
+ 'style': self._get_style(gc0, rgbFace)
+ }
+ writer.element('use', attrib=attrib)
+ if clip_attrs:
+ writer.end('g')
+ if url is not None:
+ writer.end('a')
+
+ self._path_collection_id += 1
+
+ def _draw_gouraud_triangle(self, transformed_points, colors):
+ # This uses a method described here:
+ #
+ # http://www.svgopen.org/2005/papers/Converting3DFaceToSVG/index.html
+ #
+ # that uses three overlapping linear gradients to simulate a
+ # Gouraud triangle. Each gradient goes from fully opaque in
+ # one corner to fully transparent along the opposite edge.
+ # The line between the stop points is perpendicular to the
+ # opposite edge. Underlying these three gradients is a solid
+ # triangle whose color is the average of all three points.
+
+ avg_color = np.average(colors, axis=0)
+ if avg_color[-1] == 0:
+ # Skip fully-transparent triangles
+ return
+
+ writer = self.writer
+ writer.start('defs')
+ for i in range(3):
+ x1, y1 = transformed_points[i]
+ x2, y2 = transformed_points[(i + 1) % 3]
+ x3, y3 = transformed_points[(i + 2) % 3]
+ rgba_color = colors[i]
+
+ if x2 == x3:
+ xb = x2
+ yb = y1
+ elif y2 == y3:
+ xb = x1
+ yb = y2
+ else:
+ m1 = (y2 - y3) / (x2 - x3)
+ b1 = y2 - (m1 * x2)
+ m2 = -(1.0 / m1)
+ b2 = y1 - (m2 * x1)
+ xb = (-b1 + b2) / (m1 - m2)
+ yb = m2 * xb + b2
+
+ writer.start(
+ 'linearGradient',
+ id=f"GR{self._n_gradients:x}_{i:d}",
+ gradientUnits="userSpaceOnUse",
+ x1=_short_float_fmt(x1), y1=_short_float_fmt(y1),
+ x2=_short_float_fmt(xb), y2=_short_float_fmt(yb))
+ writer.element(
+ 'stop',
+ offset='1',
+ style=_generate_css({
+ 'stop-color': rgb2hex(avg_color),
+ 'stop-opacity': _short_float_fmt(rgba_color[-1])}))
+ writer.element(
+ 'stop',
+ offset='0',
+ style=_generate_css({'stop-color': rgb2hex(rgba_color),
+ 'stop-opacity': "0"}))
+
+ writer.end('linearGradient')
+
+ writer.end('defs')
+
+ # triangle formation using "path"
+ dpath = (f"M {_short_float_fmt(x1)},{_short_float_fmt(y1)}"
+ f" L {_short_float_fmt(x2)},{_short_float_fmt(y2)}"
+ f" {_short_float_fmt(x3)},{_short_float_fmt(y3)} Z")
+
+ writer.element(
+ 'path',
+ attrib={'d': dpath,
+ 'fill': rgb2hex(avg_color),
+ 'fill-opacity': '1',
+ 'shape-rendering': "crispEdges"})
+
+ writer.start(
+ 'g',
+ attrib={'stroke': "none",
+ 'stroke-width': "0",
+ 'shape-rendering': "crispEdges",
+ 'filter': "url(#colorMat)"})
+
+ writer.element(
+ 'path',
+ attrib={'d': dpath,
+ 'fill': f'url(#GR{self._n_gradients:x}_0)',
+ 'shape-rendering': "crispEdges"})
+
+ writer.element(
+ 'path',
+ attrib={'d': dpath,
+ 'fill': f'url(#GR{self._n_gradients:x}_1)',
+ 'filter': 'url(#colorAdd)',
+ 'shape-rendering': "crispEdges"})
+
+ writer.element(
+ 'path',
+ attrib={'d': dpath,
+ 'fill': f'url(#GR{self._n_gradients:x}_2)',
+ 'filter': 'url(#colorAdd)',
+ 'shape-rendering': "crispEdges"})
+
+ writer.end('g')
+
+ self._n_gradients += 1
+
+ def draw_gouraud_triangles(self, gc, triangles_array, colors_array,
+ transform):
+ writer = self.writer
+ writer.start('g', **self._get_clip_attrs(gc))
+ transform = transform.frozen()
+ trans_and_flip = self._make_flip_transform(transform)
+
+ if not self._has_gouraud:
+ self._has_gouraud = True
+ writer.start(
+ 'filter',
+ id='colorAdd')
+ writer.element(
+ 'feComposite',
+ attrib={'in': 'SourceGraphic'},
+ in2='BackgroundImage',
+ operator='arithmetic',
+ k2="1", k3="1")
+ writer.end('filter')
+ # feColorMatrix filter to correct opacity
+ writer.start(
+ 'filter',
+ id='colorMat')
+ writer.element(
+ 'feColorMatrix',
+ attrib={'type': 'matrix'},
+ values='1 0 0 0 0 \n0 1 0 0 0 \n0 0 1 0 0 \n1 1 1 1 0 \n0 0 0 0 1 ')
+ writer.end('filter')
+
+ for points, colors in zip(triangles_array, colors_array):
+ self._draw_gouraud_triangle(trans_and_flip.transform(points), colors)
+ writer.end('g')
+
+ def option_scale_image(self):
+ # docstring inherited
+ return True
+
+ def get_image_magnification(self):
+ return self.image_dpi / 72.0
+
+ def draw_image(self, gc, x, y, im, transform=None):
+ # docstring inherited
+
+ h, w = im.shape[:2]
+
+ if w == 0 or h == 0:
+ return
+
+ clip_attrs = self._get_clip_attrs(gc)
+ if clip_attrs:
+ # Can't apply clip-path directly to the image because the image has
+ # a transformation, which would also be applied to the clip-path.
+ self.writer.start('g', **clip_attrs)
+
+ url = gc.get_url()
+ if url is not None:
+ self.writer.start('a', attrib={'xlink:href': url})
+
+ attrib = {}
+ oid = gc.get_gid()
+ if mpl.rcParams['svg.image_inline']:
+ buf = BytesIO()
+ Image.fromarray(im).save(buf, format="png")
+ oid = oid or self._make_id('image', buf.getvalue())
+ attrib['xlink:href'] = (
+ "data:image/png;base64,\n" +
+ base64.b64encode(buf.getvalue()).decode('ascii'))
+ else:
+ if self.basename is None:
+ raise ValueError("Cannot save image data to filesystem when "
+ "writing SVG to an in-memory buffer")
+ filename = f'{self.basename}.image{next(self._image_counter)}.png'
+ _log.info('Writing image file for inclusion: %s', filename)
+ Image.fromarray(im).save(filename)
+ oid = oid or 'Im_' + self._make_id('image', filename)
+ attrib['xlink:href'] = filename
+ attrib['id'] = oid
+
+ if transform is None:
+ w = 72.0 * w / self.image_dpi
+ h = 72.0 * h / self.image_dpi
+
+ self.writer.element(
+ 'image',
+ transform=_generate_transform([
+ ('scale', (1, -1)), ('translate', (0, -h))]),
+ x=_short_float_fmt(x),
+ y=_short_float_fmt(-(self.height - y - h)),
+ width=_short_float_fmt(w), height=_short_float_fmt(h),
+ attrib=attrib)
+ else:
+ alpha = gc.get_alpha()
+ if alpha != 1.0:
+ attrib['opacity'] = _short_float_fmt(alpha)
+
+ flipped = (
+ Affine2D().scale(1.0 / w, 1.0 / h) +
+ transform +
+ Affine2D()
+ .translate(x, y)
+ .scale(1.0, -1.0)
+ .translate(0.0, self.height))
+
+ attrib['transform'] = _generate_transform(
+ [('matrix', flipped.frozen())])
+ attrib['style'] = (
+ 'image-rendering:crisp-edges;'
+ 'image-rendering:pixelated')
+ self.writer.element(
+ 'image',
+ width=_short_float_fmt(w), height=_short_float_fmt(h),
+ attrib=attrib)
+
+ if url is not None:
+ self.writer.end('a')
+ if clip_attrs:
+ self.writer.end('g')
+
+ def _update_glyph_map_defs(self, glyph_map_new):
+ """
+ Emit definitions for not-yet-defined glyphs, and record them as having
+ been defined.
+ """
+ writer = self.writer
+ if glyph_map_new:
+ writer.start('defs')
+ for char_id, (vertices, codes) in glyph_map_new.items():
+ char_id = self._adjust_char_id(char_id)
+ # x64 to go back to FreeType's internal (integral) units.
+ path_data = self._convert_path(
+ Path(vertices * 64, codes), simplify=False)
+ writer.element(
+ 'path', id=char_id, d=path_data,
+ transform=_generate_transform([('scale', (1 / 64,))]))
+ writer.end('defs')
+ self._glyph_map.update(glyph_map_new)
+
+ def _adjust_char_id(self, char_id):
+ return char_id.replace("%20", "_")
+
+ def _draw_text_as_path(self, gc, x, y, s, prop, angle, ismath, mtext=None):
+ # docstring inherited
+ writer = self.writer
+
+ writer.comment(s)
+
+ glyph_map = self._glyph_map
+
+ text2path = self._text2path
+ color = rgb2hex(gc.get_rgb())
+ fontsize = prop.get_size_in_points()
+
+ style = {}
+ if color != '#000000':
+ style['fill'] = color
+ alpha = gc.get_alpha() if gc.get_forced_alpha() else gc.get_rgb()[3]
+ if alpha != 1:
+ style['opacity'] = _short_float_fmt(alpha)
+ font_scale = fontsize / text2path.FONT_SCALE
+ attrib = {
+ 'style': _generate_css(style),
+ 'transform': _generate_transform([
+ ('translate', (x, y)),
+ ('rotate', (-angle,)),
+ ('scale', (font_scale, -font_scale))]),
+ }
+ writer.start('g', attrib=attrib)
+
+ if not ismath:
+ font = text2path._get_font(prop)
+ _glyphs = text2path.get_glyphs_with_font(
+ font, s, glyph_map=glyph_map, return_new_glyphs_only=True)
+ glyph_info, glyph_map_new, rects = _glyphs
+ self._update_glyph_map_defs(glyph_map_new)
+
+ for glyph_id, xposition, yposition, scale in glyph_info:
+ writer.element(
+ 'use',
+ transform=_generate_transform([
+ ('translate', (xposition, yposition)),
+ ('scale', (scale,)),
+ ]),
+ attrib={'xlink:href': f'#{glyph_id}'})
+
+ else:
+ if ismath == "TeX":
+ _glyphs = text2path.get_glyphs_tex(
+ prop, s, glyph_map=glyph_map, return_new_glyphs_only=True)
+ else:
+ _glyphs = text2path.get_glyphs_mathtext(
+ prop, s, glyph_map=glyph_map, return_new_glyphs_only=True)
+ glyph_info, glyph_map_new, rects = _glyphs
+ self._update_glyph_map_defs(glyph_map_new)
+
+ for char_id, xposition, yposition, scale in glyph_info:
+ char_id = self._adjust_char_id(char_id)
+ writer.element(
+ 'use',
+ transform=_generate_transform([
+ ('translate', (xposition, yposition)),
+ ('scale', (scale,)),
+ ]),
+ attrib={'xlink:href': f'#{char_id}'})
+
+ for verts, codes in rects:
+ path = Path(verts, codes)
+ path_data = self._convert_path(path, simplify=False)
+ writer.element('path', d=path_data)
+
+ writer.end('g')
+
+ def _draw_text_as_text(self, gc, x, y, s, prop, angle, ismath, mtext=None):
+ # NOTE: If you change the font styling CSS, then be sure the check for
+ # svg.fonttype = none in `lib/matplotlib/testing/compare.py::convert` remains in
+ # sync. Also be sure to re-generate any SVG using this mode, or else such tests
+ # will fail to use the right converter for the expected images, and they will
+ # fail strangely.
+ writer = self.writer
+
+ color = rgb2hex(gc.get_rgb())
+ font_style = {}
+ color_style = {}
+ if color != '#000000':
+ color_style['fill'] = color
+
+ alpha = gc.get_alpha() if gc.get_forced_alpha() else gc.get_rgb()[3]
+ if alpha != 1:
+ color_style['opacity'] = _short_float_fmt(alpha)
+
+ if not ismath:
+ attrib = {}
+
+ # Separate font style in their separate attributes
+ if prop.get_style() != 'normal':
+ font_style['font-style'] = prop.get_style()
+ if prop.get_variant() != 'normal':
+ font_style['font-variant'] = prop.get_variant()
+ weight = fm.weight_dict[prop.get_weight()]
+ if weight != 400:
+ font_style['font-weight'] = f'{weight}'
+
+ def _normalize_sans(name):
+ return 'sans-serif' if name in ['sans', 'sans serif'] else name
+
+ def _expand_family_entry(fn):
+ fn = _normalize_sans(fn)
+ # prepend generic font families with all configured font names
+ if fn in fm.font_family_aliases:
+ # get all of the font names and fix spelling of sans-serif
+ # (we accept 3 ways CSS only supports 1)
+ for name in fm.FontManager._expand_aliases(fn):
+ yield _normalize_sans(name)
+ # whether a generic name or a family name, it must appear at
+ # least once
+ yield fn
+
+ def _get_all_quoted_names(prop):
+ # only quote specific names, not generic names
+ return [name if name in fm.font_family_aliases else repr(name)
+ for entry in prop.get_family()
+ for name in _expand_family_entry(entry)]
+
+ font_style['font-size'] = f'{_short_float_fmt(prop.get_size())}px'
+ # ensure expansion, quoting, and dedupe of font names
+ font_style['font-family'] = ", ".join(
+ dict.fromkeys(_get_all_quoted_names(prop))
+ )
+
+ if prop.get_stretch() != 'normal':
+ font_style['font-stretch'] = prop.get_stretch()
+ attrib['style'] = _generate_css({**font_style, **color_style})
+
+ if mtext and (angle == 0 or mtext.get_rotation_mode() == "anchor"):
+ # If text anchoring can be supported, get the original
+ # coordinates and add alignment information.
+
+ # Get anchor coordinates.
+ transform = mtext.get_transform()
+ ax, ay = transform.transform(mtext.get_unitless_position())
+ ay = self.height - ay
+
+ # Don't do vertical anchor alignment. Most applications do not
+ # support 'alignment-baseline' yet. Apply the vertical layout
+ # to the anchor point manually for now.
+ angle_rad = np.deg2rad(angle)
+ dir_vert = np.array([np.sin(angle_rad), np.cos(angle_rad)])
+ v_offset = np.dot(dir_vert, [(x - ax), (y - ay)])
+ ax = ax + v_offset * dir_vert[0]
+ ay = ay + v_offset * dir_vert[1]
+
+ ha_mpl_to_svg = {'left': 'start', 'right': 'end',
+ 'center': 'middle'}
+ font_style['text-anchor'] = ha_mpl_to_svg[mtext.get_ha()]
+
+ attrib['x'] = _short_float_fmt(ax)
+ attrib['y'] = _short_float_fmt(ay)
+ attrib['style'] = _generate_css({**font_style, **color_style})
+ attrib['transform'] = _generate_transform([
+ ("rotate", (-angle, ax, ay))])
+
+ else:
+ attrib['transform'] = _generate_transform([
+ ('translate', (x, y)),
+ ('rotate', (-angle,))])
+
+ writer.element('text', s, attrib=attrib)
+
+ else:
+ writer.comment(s)
+
+ width, height, descent, glyphs, rects = \
+ self._text2path.mathtext_parser.parse(s, 72, prop)
+
+ # Apply attributes to 'g', not 'text', because we likely have some
+ # rectangles as well with the same style and transformation.
+ writer.start('g',
+ style=_generate_css({**font_style, **color_style}),
+ transform=_generate_transform([
+ ('translate', (x, y)),
+ ('rotate', (-angle,))]),
+ )
+
+ writer.start('text')
+
+ # Sort the characters by font, and output one tspan for each.
+ spans = {}
+ for font, fontsize, thetext, new_x, new_y in glyphs:
+ entry = fm.ttfFontProperty(font)
+ font_style = {}
+ # Separate font style in its separate attributes
+ if entry.style != 'normal':
+ font_style['font-style'] = entry.style
+ if entry.variant != 'normal':
+ font_style['font-variant'] = entry.variant
+ if entry.weight != 400:
+ font_style['font-weight'] = f'{entry.weight}'
+ font_style['font-size'] = f'{_short_float_fmt(fontsize)}px'
+ font_style['font-family'] = f'{entry.name!r}' # ensure quoting
+ if entry.stretch != 'normal':
+ font_style['font-stretch'] = entry.stretch
+ style = _generate_css({**font_style, **color_style})
+ if thetext == 32:
+ thetext = 0xa0 # non-breaking space
+ spans.setdefault(style, []).append((new_x, -new_y, thetext))
+
+ for style, chars in spans.items():
+ chars.sort() # Sort by increasing x position
+ for x, y, t in chars: # Output one tspan for each character
+ writer.element(
+ 'tspan',
+ chr(t),
+ x=_short_float_fmt(x),
+ y=_short_float_fmt(y),
+ style=style)
+
+ writer.end('text')
+
+ for x, y, width, height in rects:
+ writer.element(
+ 'rect',
+ x=_short_float_fmt(x),
+ y=_short_float_fmt(-y-1),
+ width=_short_float_fmt(width),
+ height=_short_float_fmt(height)
+ )
+
+ writer.end('g')
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ # docstring inherited
+
+ clip_attrs = self._get_clip_attrs(gc)
+ if clip_attrs:
+ # Cannot apply clip-path directly to the text, because
+ # it has a transformation
+ self.writer.start('g', **clip_attrs)
+
+ if gc.get_url() is not None:
+ self.writer.start('a', {'xlink:href': gc.get_url()})
+
+ if mpl.rcParams['svg.fonttype'] == 'path':
+ self._draw_text_as_path(gc, x, y, s, prop, angle, ismath, mtext)
+ else:
+ self._draw_text_as_text(gc, x, y, s, prop, angle, ismath, mtext)
+
+ if gc.get_url() is not None:
+ self.writer.end('a')
+
+ if clip_attrs:
+ self.writer.end('g')
+
+ def flipy(self):
+ # docstring inherited
+ return True
+
+ def get_canvas_width_height(self):
+ # docstring inherited
+ return self.width, self.height
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ # docstring inherited
+ return self._text2path.get_text_width_height_descent(s, prop, ismath)
+
+
+class FigureCanvasSVG(FigureCanvasBase):
+ filetypes = {'svg': 'Scalable Vector Graphics',
+ 'svgz': 'Scalable Vector Graphics'}
+
+ fixed_dpi = 72
+
+ def print_svg(self, filename, *, bbox_inches_restore=None, metadata=None):
+ """
+ Parameters
+ ----------
+ filename : str or path-like or file-like
+ Output target; if a string, a file will be opened for writing.
+
+ metadata : dict[str, Any], optional
+ Metadata in the SVG file defined as key-value pairs of strings,
+ datetimes, or lists of strings, e.g., ``{'Creator': 'My software',
+ 'Contributor': ['Me', 'My Friend'], 'Title': 'Awesome'}``.
+
+ The standard keys and their value types are:
+
+ * *str*: ``'Coverage'``, ``'Description'``, ``'Format'``,
+ ``'Identifier'``, ``'Language'``, ``'Relation'``, ``'Source'``,
+ ``'Title'``, and ``'Type'``.
+ * *str* or *list of str*: ``'Contributor'``, ``'Creator'``,
+ ``'Keywords'``, ``'Publisher'``, and ``'Rights'``.
+ * *str*, *date*, *datetime*, or *tuple* of same: ``'Date'``. If a
+ non-*str*, then it will be formatted as ISO 8601.
+
+ Values have been predefined for ``'Creator'``, ``'Date'``,
+ ``'Format'``, and ``'Type'``. They can be removed by setting them
+ to `None`.
+
+ Information is encoded as `Dublin Core Metadata`__.
+
+ .. _DC: https://www.dublincore.org/specifications/dublin-core/
+
+ __ DC_
+ """
+ with cbook.open_file_cm(filename, "w", encoding="utf-8") as fh:
+ if not cbook.file_requires_unicode(fh):
+ fh = codecs.getwriter('utf-8')(fh)
+ dpi = self.figure.dpi
+ self.figure.dpi = 72
+ width, height = self.figure.get_size_inches()
+ w, h = width * 72, height * 72
+ renderer = MixedModeRenderer(
+ self.figure, width, height, dpi,
+ RendererSVG(w, h, fh, image_dpi=dpi, metadata=metadata),
+ bbox_inches_restore=bbox_inches_restore)
+ self.figure.draw(renderer)
+ renderer.finalize()
+
+ def print_svgz(self, filename, **kwargs):
+ with (cbook.open_file_cm(filename, "wb") as fh,
+ gzip.GzipFile(mode='w', fileobj=fh) as gzipwriter):
+ return self.print_svg(gzipwriter, **kwargs)
+
+ def get_default_filetype(self):
+ return 'svg'
+
+ def draw(self):
+ self.figure.draw_without_rendering()
+ return super().draw()
+
+
+FigureManagerSVG = FigureManagerBase
+
+
+svgProlog = """\
+
+
+"""
+
+
+@_Backend.export
+class _BackendSVG(_Backend):
+ backend_version = mpl.__version__
+ FigureCanvas = FigureCanvasSVG
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_template.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_template.py
new file mode 100644
index 0000000000000000000000000000000000000000..83aa6bb567c1c2519974253b6d50c52e84c4dfaf
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_template.py
@@ -0,0 +1,213 @@
+"""
+A fully functional, do-nothing backend intended as a template for backend
+writers. It is fully functional in that you can select it as a backend e.g.
+with ::
+
+ import matplotlib
+ matplotlib.use("template")
+
+and your program will (should!) run without error, though no output is
+produced. This provides a starting point for backend writers; you can
+selectively implement drawing methods (`~.RendererTemplate.draw_path`,
+`~.RendererTemplate.draw_image`, etc.) and slowly see your figure come to life
+instead having to have a full-blown implementation before getting any results.
+
+Copy this file to a directory outside the Matplotlib source tree, somewhere
+where Python can import it (by adding the directory to your ``sys.path`` or by
+packaging it as a normal Python package); if the backend is importable as
+``import my.backend`` you can then select it using ::
+
+ import matplotlib
+ matplotlib.use("module://my.backend")
+
+If your backend implements support for saving figures (i.e. has a ``print_xyz`` method),
+you can register it as the default handler for a given file type::
+
+ from matplotlib.backend_bases import register_backend
+ register_backend('xyz', 'my_backend', 'XYZ File Format')
+ ...
+ plt.savefig("figure.xyz")
+"""
+
+from matplotlib import _api
+from matplotlib._pylab_helpers import Gcf
+from matplotlib.backend_bases import (
+ FigureCanvasBase, FigureManagerBase, GraphicsContextBase, RendererBase)
+from matplotlib.figure import Figure
+
+
+class RendererTemplate(RendererBase):
+ """
+ The renderer handles drawing/rendering operations.
+
+ This is a minimal do-nothing class that can be used to get started when
+ writing a new backend. Refer to `.backend_bases.RendererBase` for
+ documentation of the methods.
+ """
+
+ def __init__(self, dpi):
+ super().__init__()
+ self.dpi = dpi
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ pass
+
+ # draw_markers is optional, and we get more correct relative
+ # timings by leaving it out. backend implementers concerned with
+ # performance will probably want to implement it
+# def draw_markers(self, gc, marker_path, marker_trans, path, trans,
+# rgbFace=None):
+# pass
+
+ # draw_path_collection is optional, and we get more correct
+ # relative timings by leaving it out. backend implementers concerned with
+ # performance will probably want to implement it
+# def draw_path_collection(self, gc, master_transform, paths,
+# all_transforms, offsets, offset_trans,
+# facecolors, edgecolors, linewidths, linestyles,
+# antialiaseds):
+# pass
+
+ # draw_quad_mesh is optional, and we get more correct
+ # relative timings by leaving it out. backend implementers concerned with
+ # performance will probably want to implement it
+# def draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight,
+# coordinates, offsets, offsetTrans, facecolors,
+# antialiased, edgecolors):
+# pass
+
+ def draw_image(self, gc, x, y, im):
+ pass
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ pass
+
+ def flipy(self):
+ # docstring inherited
+ return True
+
+ def get_canvas_width_height(self):
+ # docstring inherited
+ return 100, 100
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ return 1, 1, 1
+
+ def new_gc(self):
+ # docstring inherited
+ return GraphicsContextTemplate()
+
+ def points_to_pixels(self, points):
+ # if backend doesn't have dpi, e.g., postscript or svg
+ return points
+ # elif backend assumes a value for pixels_per_inch
+ # return points/72.0 * self.dpi.get() * pixels_per_inch/72.0
+ # else
+ # return points/72.0 * self.dpi.get()
+
+
+class GraphicsContextTemplate(GraphicsContextBase):
+ """
+ The graphics context provides the color, line styles, etc. See the cairo
+ and postscript backends for examples of mapping the graphics context
+ attributes (cap styles, join styles, line widths, colors) to a particular
+ backend. In cairo this is done by wrapping a cairo.Context object and
+ forwarding the appropriate calls to it using a dictionary mapping styles
+ to gdk constants. In Postscript, all the work is done by the renderer,
+ mapping line styles to postscript calls.
+
+ If it's more appropriate to do the mapping at the renderer level (as in
+ the postscript backend), you don't need to override any of the GC methods.
+ If it's more appropriate to wrap an instance (as in the cairo backend) and
+ do the mapping here, you'll need to override several of the setter
+ methods.
+
+ The base GraphicsContext stores colors as an RGB tuple on the unit
+ interval, e.g., (0.5, 0.0, 1.0). You may need to map this to colors
+ appropriate for your backend.
+ """
+
+
+########################################################################
+#
+# The following functions and classes are for pyplot and implement
+# window/figure managers, etc.
+#
+########################################################################
+
+
+class FigureManagerTemplate(FigureManagerBase):
+ """
+ Helper class for pyplot mode, wraps everything up into a neat bundle.
+
+ For non-interactive backends, the base class is sufficient. For
+ interactive backends, see the documentation of the `.FigureManagerBase`
+ class for the list of methods that can/should be overridden.
+ """
+
+
+class FigureCanvasTemplate(FigureCanvasBase):
+ """
+ The canvas the figure renders into. Calls the draw and print fig
+ methods, creates the renderers, etc.
+
+ Note: GUI templates will want to connect events for button presses,
+ mouse movements and key presses to functions that call the base
+ class methods button_press_event, button_release_event,
+ motion_notify_event, key_press_event, and key_release_event. See the
+ implementations of the interactive backends for examples.
+
+ Attributes
+ ----------
+ figure : `~matplotlib.figure.Figure`
+ A high-level Figure instance
+ """
+
+ # The instantiated manager class. For further customization,
+ # ``FigureManager.create_with_canvas`` can also be overridden; see the
+ # wx-based backends for an example.
+ manager_class = FigureManagerTemplate
+
+ def draw(self):
+ """
+ Draw the figure using the renderer.
+
+ It is important that this method actually walk the artist tree
+ even if not output is produced because this will trigger
+ deferred work (like computing limits auto-limits and tick
+ values) that users may want access to before saving to disk.
+ """
+ renderer = RendererTemplate(self.figure.dpi)
+ self.figure.draw(renderer)
+
+ # You should provide a print_xxx function for every file format
+ # you can write.
+
+ # If the file type is not in the base set of filetypes,
+ # you should add it to the class-scope filetypes dictionary as follows:
+ filetypes = {**FigureCanvasBase.filetypes, 'foo': 'My magic Foo format'}
+
+ def print_foo(self, filename, **kwargs):
+ """
+ Write out format foo.
+
+ This method is normally called via `.Figure.savefig` and
+ `.FigureCanvasBase.print_figure`, which take care of setting the figure
+ facecolor, edgecolor, and dpi to the desired output values, and will
+ restore them to the original values. Therefore, `print_foo` does not
+ need to handle these settings.
+ """
+ self.draw()
+
+ def get_default_filetype(self):
+ return 'foo'
+
+
+########################################################################
+#
+# Now just provide the standard names that backend.__init__ is expecting
+#
+########################################################################
+
+FigureCanvas = FigureCanvasTemplate
+FigureManager = FigureManagerTemplate
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_tkagg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_tkagg.py
new file mode 100644
index 0000000000000000000000000000000000000000..f95b6011eadffe72dfc1dc092f3d20b44fba24a9
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_tkagg.py
@@ -0,0 +1,20 @@
+from . import _backend_tk
+from .backend_agg import FigureCanvasAgg
+from ._backend_tk import _BackendTk, FigureCanvasTk
+from ._backend_tk import ( # noqa: F401 # pylint: disable=W0611
+ FigureManagerTk, NavigationToolbar2Tk)
+
+
+class FigureCanvasTkAgg(FigureCanvasAgg, FigureCanvasTk):
+ def draw(self):
+ super().draw()
+ self.blit()
+
+ def blit(self, bbox=None):
+ _backend_tk.blit(self._tkphoto, self.renderer.buffer_rgba(),
+ (0, 1, 2, 3), bbox=bbox)
+
+
+@_BackendTk.export
+class _BackendTkAgg(_BackendTk):
+ FigureCanvas = FigureCanvasTkAgg
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_tkcairo.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_tkcairo.py
new file mode 100644
index 0000000000000000000000000000000000000000..a6951c03c65a328bc9c46a369aed65ad7df259bb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_tkcairo.py
@@ -0,0 +1,26 @@
+import sys
+
+import numpy as np
+
+from . import _backend_tk
+from .backend_cairo import cairo, FigureCanvasCairo
+from ._backend_tk import _BackendTk, FigureCanvasTk
+
+
+class FigureCanvasTkCairo(FigureCanvasCairo, FigureCanvasTk):
+ def draw(self):
+ width = int(self.figure.bbox.width)
+ height = int(self.figure.bbox.height)
+ surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
+ self._renderer.set_context(cairo.Context(surface))
+ self._renderer.dpi = self.figure.dpi
+ self.figure.draw(self._renderer)
+ buf = np.reshape(surface.get_data(), (height, width, 4))
+ _backend_tk.blit(
+ self._tkphoto, buf,
+ (2, 1, 0, 3) if sys.byteorder == "little" else (1, 2, 3, 0))
+
+
+@_BackendTk.export
+class _BackendTkCairo(_BackendTk):
+ FigureCanvas = FigureCanvasTkCairo
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_webagg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_webagg.py
new file mode 100644
index 0000000000000000000000000000000000000000..dfc5747ef77cb4123d1a8d35657f22952d378df2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_webagg.py
@@ -0,0 +1,328 @@
+"""Displays Agg images in the browser, with interactivity."""
+
+# The WebAgg backend is divided into two modules:
+#
+# - `backend_webagg_core.py` contains code necessary to embed a WebAgg
+# plot inside of a web application, and communicate in an abstract
+# way over a web socket.
+#
+# - `backend_webagg.py` contains a concrete implementation of a basic
+# application, implemented with tornado.
+
+from contextlib import contextmanager
+import errno
+from io import BytesIO
+import json
+import mimetypes
+from pathlib import Path
+import random
+import sys
+import signal
+import threading
+
+try:
+ import tornado
+except ImportError as err:
+ raise RuntimeError("The WebAgg backend requires Tornado.") from err
+
+import tornado.web
+import tornado.ioloop
+import tornado.websocket
+
+import matplotlib as mpl
+from matplotlib.backend_bases import _Backend
+from matplotlib._pylab_helpers import Gcf
+from . import backend_webagg_core as core
+from .backend_webagg_core import ( # noqa: F401 # pylint: disable=W0611
+ TimerAsyncio, TimerTornado)
+
+
+webagg_server_thread = threading.Thread(
+ target=lambda: tornado.ioloop.IOLoop.instance().start())
+
+
+class FigureManagerWebAgg(core.FigureManagerWebAgg):
+ _toolbar2_class = core.NavigationToolbar2WebAgg
+
+ @classmethod
+ def pyplot_show(cls, *, block=None):
+ WebAggApplication.initialize()
+
+ url = "http://{address}:{port}{prefix}".format(
+ address=WebAggApplication.address,
+ port=WebAggApplication.port,
+ prefix=WebAggApplication.url_prefix)
+
+ if mpl.rcParams['webagg.open_in_browser']:
+ import webbrowser
+ if not webbrowser.open(url):
+ print(f"To view figure, visit {url}")
+ else:
+ print(f"To view figure, visit {url}")
+
+ WebAggApplication.start()
+
+
+class FigureCanvasWebAgg(core.FigureCanvasWebAggCore):
+ manager_class = FigureManagerWebAgg
+
+
+class WebAggApplication(tornado.web.Application):
+ initialized = False
+ started = False
+
+ class FavIcon(tornado.web.RequestHandler):
+ def get(self):
+ self.set_header('Content-Type', 'image/png')
+ self.write(Path(mpl.get_data_path(),
+ 'images/matplotlib.png').read_bytes())
+
+ class SingleFigurePage(tornado.web.RequestHandler):
+ def __init__(self, application, request, *, url_prefix='', **kwargs):
+ self.url_prefix = url_prefix
+ super().__init__(application, request, **kwargs)
+
+ def get(self, fignum):
+ fignum = int(fignum)
+ manager = Gcf.get_fig_manager(fignum)
+
+ ws_uri = f'ws://{self.request.host}{self.url_prefix}/'
+ self.render(
+ "single_figure.html",
+ prefix=self.url_prefix,
+ ws_uri=ws_uri,
+ fig_id=fignum,
+ toolitems=core.NavigationToolbar2WebAgg.toolitems,
+ canvas=manager.canvas)
+
+ class AllFiguresPage(tornado.web.RequestHandler):
+ def __init__(self, application, request, *, url_prefix='', **kwargs):
+ self.url_prefix = url_prefix
+ super().__init__(application, request, **kwargs)
+
+ def get(self):
+ ws_uri = f'ws://{self.request.host}{self.url_prefix}/'
+ self.render(
+ "all_figures.html",
+ prefix=self.url_prefix,
+ ws_uri=ws_uri,
+ figures=sorted(Gcf.figs.items()),
+ toolitems=core.NavigationToolbar2WebAgg.toolitems)
+
+ class MplJs(tornado.web.RequestHandler):
+ def get(self):
+ self.set_header('Content-Type', 'application/javascript')
+
+ js_content = core.FigureManagerWebAgg.get_javascript()
+
+ self.write(js_content)
+
+ class Download(tornado.web.RequestHandler):
+ def get(self, fignum, fmt):
+ fignum = int(fignum)
+ manager = Gcf.get_fig_manager(fignum)
+ self.set_header(
+ 'Content-Type', mimetypes.types_map.get(fmt, 'binary'))
+ buff = BytesIO()
+ manager.canvas.figure.savefig(buff, format=fmt)
+ self.write(buff.getvalue())
+
+ class WebSocket(tornado.websocket.WebSocketHandler):
+ supports_binary = True
+
+ def open(self, fignum):
+ self.fignum = int(fignum)
+ self.manager = Gcf.get_fig_manager(self.fignum)
+ self.manager.add_web_socket(self)
+ if hasattr(self, 'set_nodelay'):
+ self.set_nodelay(True)
+
+ def on_close(self):
+ self.manager.remove_web_socket(self)
+
+ def on_message(self, message):
+ message = json.loads(message)
+ # The 'supports_binary' message is on a client-by-client
+ # basis. The others affect the (shared) canvas as a
+ # whole.
+ if message['type'] == 'supports_binary':
+ self.supports_binary = message['value']
+ else:
+ manager = Gcf.get_fig_manager(self.fignum)
+ # It is possible for a figure to be closed,
+ # but a stale figure UI is still sending messages
+ # from the browser.
+ if manager is not None:
+ manager.handle_json(message)
+
+ def send_json(self, content):
+ self.write_message(json.dumps(content))
+
+ def send_binary(self, blob):
+ if self.supports_binary:
+ self.write_message(blob, binary=True)
+ else:
+ data_uri = "data:image/png;base64,{}".format(
+ blob.encode('base64').replace('\n', ''))
+ self.write_message(data_uri)
+
+ def __init__(self, url_prefix=''):
+ if url_prefix:
+ assert url_prefix[0] == '/' and url_prefix[-1] != '/', \
+ 'url_prefix must start with a "/" and not end with one.'
+
+ super().__init__(
+ [
+ # Static files for the CSS and JS
+ (url_prefix + r'/_static/(.*)',
+ tornado.web.StaticFileHandler,
+ {'path': core.FigureManagerWebAgg.get_static_file_path()}),
+
+ # Static images for the toolbar
+ (url_prefix + r'/_images/(.*)',
+ tornado.web.StaticFileHandler,
+ {'path': Path(mpl.get_data_path(), 'images')}),
+
+ # A Matplotlib favicon
+ (url_prefix + r'/favicon.ico', self.FavIcon),
+
+ # The page that contains all of the pieces
+ (url_prefix + r'/([0-9]+)', self.SingleFigurePage,
+ {'url_prefix': url_prefix}),
+
+ # The page that contains all of the figures
+ (url_prefix + r'/?', self.AllFiguresPage,
+ {'url_prefix': url_prefix}),
+
+ (url_prefix + r'/js/mpl.js', self.MplJs),
+
+ # Sends images and events to the browser, and receives
+ # events from the browser
+ (url_prefix + r'/([0-9]+)/ws', self.WebSocket),
+
+ # Handles the downloading (i.e., saving) of static images
+ (url_prefix + r'/([0-9]+)/download.([a-z0-9.]+)',
+ self.Download),
+ ],
+ template_path=core.FigureManagerWebAgg.get_static_file_path())
+
+ @classmethod
+ def initialize(cls, url_prefix='', port=None, address=None):
+ if cls.initialized:
+ return
+
+ # Create the class instance
+ app = cls(url_prefix=url_prefix)
+
+ cls.url_prefix = url_prefix
+
+ # This port selection algorithm is borrowed, more or less
+ # verbatim, from IPython.
+ def random_ports(port, n):
+ """
+ Generate a list of n random ports near the given port.
+
+ The first 5 ports will be sequential, and the remaining n-5 will be
+ randomly selected in the range [port-2*n, port+2*n].
+ """
+ for i in range(min(5, n)):
+ yield port + i
+ for i in range(n - 5):
+ yield port + random.randint(-2 * n, 2 * n)
+
+ if address is None:
+ cls.address = mpl.rcParams['webagg.address']
+ else:
+ cls.address = address
+ cls.port = mpl.rcParams['webagg.port']
+ for port in random_ports(cls.port,
+ mpl.rcParams['webagg.port_retries']):
+ try:
+ app.listen(port, cls.address)
+ except OSError as e:
+ if e.errno != errno.EADDRINUSE:
+ raise
+ else:
+ cls.port = port
+ break
+ else:
+ raise SystemExit(
+ "The webagg server could not be started because an available "
+ "port could not be found")
+
+ cls.initialized = True
+
+ @classmethod
+ def start(cls):
+ import asyncio
+ try:
+ asyncio.get_running_loop()
+ except RuntimeError:
+ pass
+ else:
+ cls.started = True
+
+ if cls.started:
+ return
+
+ """
+ IOLoop.running() was removed as of Tornado 2.4; see for example
+ https://groups.google.com/forum/#!topic/python-tornado/QLMzkpQBGOY
+ Thus there is no correct way to check if the loop has already been
+ launched. We may end up with two concurrently running loops in that
+ unlucky case with all the expected consequences.
+ """
+ ioloop = tornado.ioloop.IOLoop.instance()
+
+ def shutdown():
+ ioloop.stop()
+ print("Server is stopped")
+ sys.stdout.flush()
+ cls.started = False
+
+ @contextmanager
+ def catch_sigint():
+ old_handler = signal.signal(
+ signal.SIGINT,
+ lambda sig, frame: ioloop.add_callback_from_signal(shutdown))
+ try:
+ yield
+ finally:
+ signal.signal(signal.SIGINT, old_handler)
+
+ # Set the flag to True *before* blocking on ioloop.start()
+ cls.started = True
+
+ print("Press Ctrl+C to stop WebAgg server")
+ sys.stdout.flush()
+ with catch_sigint():
+ ioloop.start()
+
+
+def ipython_inline_display(figure):
+ import tornado.template
+
+ WebAggApplication.initialize()
+ import asyncio
+ try:
+ asyncio.get_running_loop()
+ except RuntimeError:
+ if not webagg_server_thread.is_alive():
+ webagg_server_thread.start()
+
+ fignum = figure.number
+ tpl = Path(core.FigureManagerWebAgg.get_static_file_path(),
+ "ipython_inline_figure.html").read_text()
+ t = tornado.template.Template(tpl)
+ return t.generate(
+ prefix=WebAggApplication.url_prefix,
+ fig_id=fignum,
+ toolitems=core.NavigationToolbar2WebAgg.toolitems,
+ canvas=figure.canvas,
+ port=WebAggApplication.port).decode('utf-8')
+
+
+@_Backend.export
+class _BackendWebAgg(_Backend):
+ FigureCanvas = FigureCanvasWebAgg
+ FigureManager = FigureManagerWebAgg
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_webagg_core.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_webagg_core.py
new file mode 100644
index 0000000000000000000000000000000000000000..12906827a4663deb6c927e25dfc9127878bf1897
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_webagg_core.py
@@ -0,0 +1,527 @@
+"""Displays Agg images in the browser, with interactivity."""
+# The WebAgg backend is divided into two modules:
+#
+# - `backend_webagg_core.py` contains code necessary to embed a WebAgg
+# plot inside of a web application, and communicate in an abstract
+# way over a web socket.
+#
+# - `backend_webagg.py` contains a concrete implementation of a basic
+# application, implemented with asyncio.
+
+import asyncio
+import datetime
+from io import BytesIO, StringIO
+import json
+import logging
+import os
+from pathlib import Path
+
+import numpy as np
+from PIL import Image
+
+from matplotlib import _api, backend_bases, backend_tools
+from matplotlib.backends import backend_agg
+from matplotlib.backend_bases import (
+ _Backend, MouseButton, KeyEvent, LocationEvent, MouseEvent, ResizeEvent)
+
+_log = logging.getLogger(__name__)
+
+_SPECIAL_KEYS_LUT = {'Alt': 'alt',
+ 'AltGraph': 'alt',
+ 'CapsLock': 'caps_lock',
+ 'Control': 'control',
+ 'Meta': 'meta',
+ 'NumLock': 'num_lock',
+ 'ScrollLock': 'scroll_lock',
+ 'Shift': 'shift',
+ 'Super': 'super',
+ 'Enter': 'enter',
+ 'Tab': 'tab',
+ 'ArrowDown': 'down',
+ 'ArrowLeft': 'left',
+ 'ArrowRight': 'right',
+ 'ArrowUp': 'up',
+ 'End': 'end',
+ 'Home': 'home',
+ 'PageDown': 'pagedown',
+ 'PageUp': 'pageup',
+ 'Backspace': 'backspace',
+ 'Delete': 'delete',
+ 'Insert': 'insert',
+ 'Escape': 'escape',
+ 'Pause': 'pause',
+ 'Select': 'select',
+ 'Dead': 'dead',
+ 'F1': 'f1',
+ 'F2': 'f2',
+ 'F3': 'f3',
+ 'F4': 'f4',
+ 'F5': 'f5',
+ 'F6': 'f6',
+ 'F7': 'f7',
+ 'F8': 'f8',
+ 'F9': 'f9',
+ 'F10': 'f10',
+ 'F11': 'f11',
+ 'F12': 'f12'}
+
+
+def _handle_key(key):
+ """Handle key values"""
+ value = key[key.index('k') + 1:]
+ if 'shift+' in key:
+ if len(value) == 1:
+ key = key.replace('shift+', '')
+ if value in _SPECIAL_KEYS_LUT:
+ value = _SPECIAL_KEYS_LUT[value]
+ key = key[:key.index('k')] + value
+ return key
+
+
+class TimerTornado(backend_bases.TimerBase):
+ def __init__(self, *args, **kwargs):
+ self._timer = None
+ super().__init__(*args, **kwargs)
+
+ def _timer_start(self):
+ import tornado
+
+ self._timer_stop()
+ if self._single:
+ ioloop = tornado.ioloop.IOLoop.instance()
+ self._timer = ioloop.add_timeout(
+ datetime.timedelta(milliseconds=self.interval),
+ self._on_timer)
+ else:
+ self._timer = tornado.ioloop.PeriodicCallback(
+ self._on_timer,
+ max(self.interval, 1e-6))
+ self._timer.start()
+
+ def _timer_stop(self):
+ import tornado
+
+ if self._timer is None:
+ return
+ elif self._single:
+ ioloop = tornado.ioloop.IOLoop.instance()
+ ioloop.remove_timeout(self._timer)
+ else:
+ self._timer.stop()
+ self._timer = None
+
+ def _timer_set_interval(self):
+ # Only stop and restart it if the timer has already been started
+ if self._timer is not None:
+ self._timer_stop()
+ self._timer_start()
+
+
+class TimerAsyncio(backend_bases.TimerBase):
+ def __init__(self, *args, **kwargs):
+ self._task = None
+ super().__init__(*args, **kwargs)
+
+ async def _timer_task(self, interval):
+ while True:
+ try:
+ await asyncio.sleep(interval)
+ self._on_timer()
+
+ if self._single:
+ break
+ except asyncio.CancelledError:
+ break
+
+ def _timer_start(self):
+ self._timer_stop()
+
+ self._task = asyncio.ensure_future(
+ self._timer_task(max(self.interval / 1_000., 1e-6))
+ )
+
+ def _timer_stop(self):
+ if self._task is not None:
+ self._task.cancel()
+ self._task = None
+
+ def _timer_set_interval(self):
+ # Only stop and restart it if the timer has already been started
+ if self._task is not None:
+ self._timer_stop()
+ self._timer_start()
+
+
+class FigureCanvasWebAggCore(backend_agg.FigureCanvasAgg):
+ manager_class = _api.classproperty(lambda cls: FigureManagerWebAgg)
+ _timer_cls = TimerAsyncio
+ # Webagg and friends having the right methods, but still
+ # having bugs in practice. Do not advertise that it works until
+ # we can debug this.
+ supports_blit = False
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ # Set to True when the renderer contains data that is newer
+ # than the PNG buffer.
+ self._png_is_old = True
+ # Set to True by the `refresh` message so that the next frame
+ # sent to the clients will be a full frame.
+ self._force_full = True
+ # The last buffer, for diff mode.
+ self._last_buff = np.empty((0, 0))
+ # Store the current image mode so that at any point, clients can
+ # request the information. This should be changed by calling
+ # self.set_image_mode(mode) so that the notification can be given
+ # to the connected clients.
+ self._current_image_mode = 'full'
+ # Track mouse events to fill in the x, y position of key events.
+ self._last_mouse_xy = (None, None)
+
+ def show(self):
+ # show the figure window
+ from matplotlib.pyplot import show
+ show()
+
+ def draw(self):
+ self._png_is_old = True
+ try:
+ super().draw()
+ finally:
+ self.manager.refresh_all() # Swap the frames.
+
+ def blit(self, bbox=None):
+ self._png_is_old = True
+ self.manager.refresh_all()
+
+ def draw_idle(self):
+ self.send_event("draw")
+
+ def set_cursor(self, cursor):
+ # docstring inherited
+ cursor = _api.check_getitem({
+ backend_tools.Cursors.HAND: 'pointer',
+ backend_tools.Cursors.POINTER: 'default',
+ backend_tools.Cursors.SELECT_REGION: 'crosshair',
+ backend_tools.Cursors.MOVE: 'move',
+ backend_tools.Cursors.WAIT: 'wait',
+ backend_tools.Cursors.RESIZE_HORIZONTAL: 'ew-resize',
+ backend_tools.Cursors.RESIZE_VERTICAL: 'ns-resize',
+ }, cursor=cursor)
+ self.send_event('cursor', cursor=cursor)
+
+ def set_image_mode(self, mode):
+ """
+ Set the image mode for any subsequent images which will be sent
+ to the clients. The modes may currently be either 'full' or 'diff'.
+
+ Note: diff images may not contain transparency, therefore upon
+ draw this mode may be changed if the resulting image has any
+ transparent component.
+ """
+ _api.check_in_list(['full', 'diff'], mode=mode)
+ if self._current_image_mode != mode:
+ self._current_image_mode = mode
+ self.handle_send_image_mode(None)
+
+ def get_diff_image(self):
+ if self._png_is_old:
+ renderer = self.get_renderer()
+
+ pixels = np.asarray(renderer.buffer_rgba())
+ # The buffer is created as type uint32 so that entire
+ # pixels can be compared in one numpy call, rather than
+ # needing to compare each plane separately.
+ buff = pixels.view(np.uint32).squeeze(2)
+
+ if (self._force_full
+ # If the buffer has changed size we need to do a full draw.
+ or buff.shape != self._last_buff.shape
+ # If any pixels have transparency, we need to force a full
+ # draw as we cannot overlay new on top of old.
+ or (pixels[:, :, 3] != 255).any()):
+ self.set_image_mode('full')
+ output = buff
+ else:
+ self.set_image_mode('diff')
+ diff = buff != self._last_buff
+ output = np.where(diff, buff, 0)
+
+ # Store the current buffer so we can compute the next diff.
+ self._last_buff = buff.copy()
+ self._force_full = False
+ self._png_is_old = False
+
+ data = output.view(dtype=np.uint8).reshape((*output.shape, 4))
+ with BytesIO() as png:
+ Image.fromarray(data).save(png, format="png")
+ return png.getvalue()
+
+ def handle_event(self, event):
+ e_type = event['type']
+ handler = getattr(self, f'handle_{e_type}',
+ self.handle_unknown_event)
+ return handler(event)
+
+ def handle_unknown_event(self, event):
+ _log.warning('Unhandled message type %s. %s', event["type"], event)
+
+ def handle_ack(self, event):
+ # Network latency tends to decrease if traffic is flowing
+ # in both directions. Therefore, the browser sends back
+ # an "ack" message after each image frame is received.
+ # This could also be used as a simple sanity check in the
+ # future, but for now the performance increase is enough
+ # to justify it, even if the server does nothing with it.
+ pass
+
+ def handle_draw(self, event):
+ self.draw()
+
+ def _handle_mouse(self, event):
+ x = event['x']
+ y = event['y']
+ y = self.get_renderer().height - y
+ self._last_mouse_xy = x, y
+ e_type = event['type']
+ button = event['button'] + 1 # JS numbers off by 1 compared to mpl.
+ buttons = { # JS ordering different compared to mpl.
+ button for button, mask in [
+ (MouseButton.LEFT, 1),
+ (MouseButton.RIGHT, 2),
+ (MouseButton.MIDDLE, 4),
+ (MouseButton.BACK, 8),
+ (MouseButton.FORWARD, 16),
+ ] if event['buttons'] & mask # State *after* press/release.
+ }
+ modifiers = event['modifiers']
+ guiEvent = event.get('guiEvent')
+ if e_type in ['button_press', 'button_release']:
+ MouseEvent(e_type + '_event', self, x, y, button,
+ modifiers=modifiers, guiEvent=guiEvent)._process()
+ elif e_type == 'dblclick':
+ MouseEvent('button_press_event', self, x, y, button, dblclick=True,
+ modifiers=modifiers, guiEvent=guiEvent)._process()
+ elif e_type == 'scroll':
+ MouseEvent('scroll_event', self, x, y, step=event['step'],
+ modifiers=modifiers, guiEvent=guiEvent)._process()
+ elif e_type == 'motion_notify':
+ MouseEvent(e_type + '_event', self, x, y,
+ buttons=buttons, modifiers=modifiers, guiEvent=guiEvent,
+ )._process()
+ elif e_type in ['figure_enter', 'figure_leave']:
+ LocationEvent(e_type + '_event', self, x, y,
+ modifiers=modifiers, guiEvent=guiEvent)._process()
+
+ handle_button_press = handle_button_release = handle_dblclick = \
+ handle_figure_enter = handle_figure_leave = handle_motion_notify = \
+ handle_scroll = _handle_mouse
+
+ def _handle_key(self, event):
+ KeyEvent(event['type'] + '_event', self,
+ _handle_key(event['key']), *self._last_mouse_xy,
+ guiEvent=event.get('guiEvent'))._process()
+ handle_key_press = handle_key_release = _handle_key
+
+ def handle_toolbar_button(self, event):
+ # TODO: Be more suspicious of the input
+ getattr(self.toolbar, event['name'])()
+
+ def handle_refresh(self, event):
+ figure_label = self.figure.get_label()
+ if not figure_label:
+ figure_label = f"Figure {self.manager.num}"
+ self.send_event('figure_label', label=figure_label)
+ self._force_full = True
+ if self.toolbar:
+ # Normal toolbar init would refresh this, but it happens before the
+ # browser canvas is set up.
+ self.toolbar.set_history_buttons()
+ self.draw_idle()
+
+ def handle_resize(self, event):
+ x = int(event.get('width', 800)) * self.device_pixel_ratio
+ y = int(event.get('height', 800)) * self.device_pixel_ratio
+ fig = self.figure
+ # An attempt at approximating the figure size in pixels.
+ fig.set_size_inches(x / fig.dpi, y / fig.dpi, forward=False)
+ # Acknowledge the resize, and force the viewer to update the
+ # canvas size to the figure's new size (which is hopefully
+ # identical or within a pixel or so).
+ self._png_is_old = True
+ self.manager.resize(*fig.bbox.size, forward=False)
+ ResizeEvent('resize_event', self)._process()
+ self.draw_idle()
+
+ def handle_send_image_mode(self, event):
+ # The client requests notification of what the current image mode is.
+ self.send_event('image_mode', mode=self._current_image_mode)
+
+ def handle_set_device_pixel_ratio(self, event):
+ self._handle_set_device_pixel_ratio(event.get('device_pixel_ratio', 1))
+
+ def handle_set_dpi_ratio(self, event):
+ # This handler is for backwards-compatibility with older ipympl.
+ self._handle_set_device_pixel_ratio(event.get('dpi_ratio', 1))
+
+ def _handle_set_device_pixel_ratio(self, device_pixel_ratio):
+ if self._set_device_pixel_ratio(device_pixel_ratio):
+ self._force_full = True
+ self.draw_idle()
+
+ def send_event(self, event_type, **kwargs):
+ if self.manager:
+ self.manager._send_event(event_type, **kwargs)
+
+
+_ALLOWED_TOOL_ITEMS = {
+ 'home',
+ 'back',
+ 'forward',
+ 'pan',
+ 'zoom',
+ 'download',
+ None,
+}
+
+
+class NavigationToolbar2WebAgg(backend_bases.NavigationToolbar2):
+
+ # Use the standard toolbar items + download button
+ toolitems = [
+ (text, tooltip_text, image_file, name_of_method)
+ for text, tooltip_text, image_file, name_of_method
+ in (*backend_bases.NavigationToolbar2.toolitems,
+ ('Download', 'Download plot', 'filesave', 'download'))
+ if name_of_method in _ALLOWED_TOOL_ITEMS
+ ]
+
+ def __init__(self, canvas):
+ self.message = ''
+ super().__init__(canvas)
+
+ def set_message(self, message):
+ if message != self.message:
+ self.canvas.send_event("message", message=message)
+ self.message = message
+
+ def draw_rubberband(self, event, x0, y0, x1, y1):
+ self.canvas.send_event("rubberband", x0=x0, y0=y0, x1=x1, y1=y1)
+
+ def remove_rubberband(self):
+ self.canvas.send_event("rubberband", x0=-1, y0=-1, x1=-1, y1=-1)
+
+ def save_figure(self, *args):
+ """Save the current figure."""
+ self.canvas.send_event('save')
+ return self.UNKNOWN_SAVED_STATUS
+
+ def pan(self):
+ super().pan()
+ self.canvas.send_event('navigate_mode', mode=self.mode.name)
+
+ def zoom(self):
+ super().zoom()
+ self.canvas.send_event('navigate_mode', mode=self.mode.name)
+
+ def set_history_buttons(self):
+ can_backward = self._nav_stack._pos > 0
+ can_forward = self._nav_stack._pos < len(self._nav_stack) - 1
+ self.canvas.send_event('history_buttons',
+ Back=can_backward, Forward=can_forward)
+
+
+class FigureManagerWebAgg(backend_bases.FigureManagerBase):
+ # This must be None to not break ipympl
+ _toolbar2_class = None
+ ToolbarCls = NavigationToolbar2WebAgg
+ _window_title = "Matplotlib"
+
+ def __init__(self, canvas, num):
+ self.web_sockets = set()
+ super().__init__(canvas, num)
+
+ def show(self):
+ pass
+
+ def resize(self, w, h, forward=True):
+ self._send_event(
+ 'resize',
+ size=(w / self.canvas.device_pixel_ratio,
+ h / self.canvas.device_pixel_ratio),
+ forward=forward)
+
+ def set_window_title(self, title):
+ self._send_event('figure_label', label=title)
+ self._window_title = title
+
+ def get_window_title(self):
+ return self._window_title
+
+ # The following methods are specific to FigureManagerWebAgg
+
+ def add_web_socket(self, web_socket):
+ assert hasattr(web_socket, 'send_binary')
+ assert hasattr(web_socket, 'send_json')
+ self.web_sockets.add(web_socket)
+ self.resize(*self.canvas.figure.bbox.size)
+ self._send_event('refresh')
+
+ def remove_web_socket(self, web_socket):
+ self.web_sockets.remove(web_socket)
+
+ def handle_json(self, content):
+ self.canvas.handle_event(content)
+
+ def refresh_all(self):
+ if self.web_sockets:
+ diff = self.canvas.get_diff_image()
+ if diff is not None:
+ for s in self.web_sockets:
+ s.send_binary(diff)
+
+ @classmethod
+ def get_javascript(cls, stream=None):
+ if stream is None:
+ output = StringIO()
+ else:
+ output = stream
+
+ output.write((Path(__file__).parent / "web_backend/js/mpl.js")
+ .read_text(encoding="utf-8"))
+
+ toolitems = []
+ for name, tooltip, image, method in cls.ToolbarCls.toolitems:
+ if name is None:
+ toolitems.append(['', '', '', ''])
+ else:
+ toolitems.append([name, tooltip, image, method])
+ output.write(f"mpl.toolbar_items = {json.dumps(toolitems)};\n\n")
+
+ extensions = []
+ for filetype, ext in sorted(FigureCanvasWebAggCore.
+ get_supported_filetypes_grouped().
+ items()):
+ extensions.append(ext[0])
+ output.write(f"mpl.extensions = {json.dumps(extensions)};\n\n")
+
+ output.write("mpl.default_extension = {};".format(
+ json.dumps(FigureCanvasWebAggCore.get_default_filetype())))
+
+ if stream is None:
+ return output.getvalue()
+
+ @classmethod
+ def get_static_file_path(cls):
+ return os.path.join(os.path.dirname(__file__), 'web_backend')
+
+ def _send_event(self, event_type, **kwargs):
+ payload = {'type': event_type, **kwargs}
+ for s in self.web_sockets:
+ s.send_json(payload)
+
+
+@_Backend.export
+class _BackendWebAggCoreAgg(_Backend):
+ FigureCanvas = FigureCanvasWebAggCore
+ FigureManager = FigureManagerWebAgg
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wx.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wx.py
new file mode 100644
index 0000000000000000000000000000000000000000..f83a69d8361e74e7cc05853535155661ec71878a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wx.py
@@ -0,0 +1,1381 @@
+"""
+A wxPython backend for matplotlib.
+
+Originally contributed by Jeremy O'Donoghue (jeremy@o-donoghue.com) and John
+Hunter (jdhunter@ace.bsd.uchicago.edu).
+
+Copyright (C) Jeremy O'Donoghue & John Hunter, 2003-4.
+"""
+
+import functools
+import logging
+import math
+import pathlib
+import sys
+import weakref
+
+import numpy as np
+import PIL.Image
+
+import matplotlib as mpl
+from matplotlib.backend_bases import (
+ _Backend, FigureCanvasBase, FigureManagerBase,
+ GraphicsContextBase, MouseButton, NavigationToolbar2, RendererBase,
+ TimerBase, ToolContainerBase, cursors,
+ CloseEvent, KeyEvent, LocationEvent, MouseEvent, ResizeEvent)
+
+from matplotlib import _api, cbook, backend_tools, _c_internal_utils
+from matplotlib._pylab_helpers import Gcf
+from matplotlib.path import Path
+from matplotlib.transforms import Affine2D
+
+import wx
+import wx.svg
+
+_log = logging.getLogger(__name__)
+
+# the True dots per inch on the screen; should be display dependent; see
+# http://groups.google.com/d/msg/comp.lang.postscript/-/omHAc9FEuAsJ?hl=en
+# for some info about screen dpi
+PIXELS_PER_INCH = 75
+
+
+# lru_cache holds a reference to the App and prevents it from being gc'ed.
+@functools.lru_cache(1)
+def _create_wxapp():
+ wxapp = wx.App(False)
+ wxapp.SetExitOnFrameDelete(True)
+ cbook._setup_new_guiapp()
+ # Set per-process DPI awareness. This is a NoOp except in MSW
+ _c_internal_utils.Win32_SetProcessDpiAwareness_max()
+ return wxapp
+
+
+class TimerWx(TimerBase):
+ """Subclass of `.TimerBase` using wx.Timer events."""
+
+ def __init__(self, *args, **kwargs):
+ self._timer = wx.Timer()
+ self._timer.Notify = self._on_timer
+ super().__init__(*args, **kwargs)
+
+ def _timer_start(self):
+ self._timer.Start(self._interval, self._single)
+
+ def _timer_stop(self):
+ self._timer.Stop()
+
+ def _timer_set_interval(self):
+ if self._timer.IsRunning():
+ self._timer_start() # Restart with new interval.
+
+
+@_api.deprecated(
+ "2.0", name="wx", obj_type="backend", removal="the future",
+ alternative="wxagg",
+ addendum="See the Matplotlib usage FAQ for more info on backends.")
+class RendererWx(RendererBase):
+ """
+ The renderer handles all the drawing primitives using a graphics
+ context instance that controls the colors/styles. It acts as the
+ 'renderer' instance used by many classes in the hierarchy.
+ """
+ # In wxPython, drawing is performed on a wxDC instance, which will
+ # generally be mapped to the client area of the window displaying
+ # the plot. Under wxPython, the wxDC instance has a wx.Pen which
+ # describes the colour and weight of any lines drawn, and a wxBrush
+ # which describes the fill colour of any closed polygon.
+
+ # Font styles, families and weight.
+ fontweights = {
+ 100: wx.FONTWEIGHT_LIGHT,
+ 200: wx.FONTWEIGHT_LIGHT,
+ 300: wx.FONTWEIGHT_LIGHT,
+ 400: wx.FONTWEIGHT_NORMAL,
+ 500: wx.FONTWEIGHT_NORMAL,
+ 600: wx.FONTWEIGHT_NORMAL,
+ 700: wx.FONTWEIGHT_BOLD,
+ 800: wx.FONTWEIGHT_BOLD,
+ 900: wx.FONTWEIGHT_BOLD,
+ 'ultralight': wx.FONTWEIGHT_LIGHT,
+ 'light': wx.FONTWEIGHT_LIGHT,
+ 'normal': wx.FONTWEIGHT_NORMAL,
+ 'medium': wx.FONTWEIGHT_NORMAL,
+ 'semibold': wx.FONTWEIGHT_NORMAL,
+ 'bold': wx.FONTWEIGHT_BOLD,
+ 'heavy': wx.FONTWEIGHT_BOLD,
+ 'ultrabold': wx.FONTWEIGHT_BOLD,
+ 'black': wx.FONTWEIGHT_BOLD,
+ }
+ fontangles = {
+ 'italic': wx.FONTSTYLE_ITALIC,
+ 'normal': wx.FONTSTYLE_NORMAL,
+ 'oblique': wx.FONTSTYLE_SLANT,
+ }
+
+ # wxPython allows for portable font styles, choosing them appropriately for
+ # the target platform. Map some standard font names to the portable styles.
+ # QUESTION: Is it wise to agree to standard fontnames across all backends?
+ fontnames = {
+ 'Sans': wx.FONTFAMILY_SWISS,
+ 'Roman': wx.FONTFAMILY_ROMAN,
+ 'Script': wx.FONTFAMILY_SCRIPT,
+ 'Decorative': wx.FONTFAMILY_DECORATIVE,
+ 'Modern': wx.FONTFAMILY_MODERN,
+ 'Courier': wx.FONTFAMILY_MODERN,
+ 'courier': wx.FONTFAMILY_MODERN,
+ }
+
+ def __init__(self, bitmap, dpi):
+ """Initialise a wxWindows renderer instance."""
+ super().__init__()
+ _log.debug("%s - __init__()", type(self))
+ self.width = bitmap.GetWidth()
+ self.height = bitmap.GetHeight()
+ self.bitmap = bitmap
+ self.fontd = {}
+ self.dpi = dpi
+ self.gc = None
+
+ def flipy(self):
+ # docstring inherited
+ return True
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ # docstring inherited
+
+ if ismath:
+ s = cbook.strip_math(s)
+
+ if self.gc is None:
+ gc = self.new_gc()
+ else:
+ gc = self.gc
+ gfx_ctx = gc.gfx_ctx
+ font = self.get_wx_font(s, prop)
+ gfx_ctx.SetFont(font, wx.BLACK)
+ w, h, descent, leading = gfx_ctx.GetFullTextExtent(s)
+
+ return w, h, descent
+
+ def get_canvas_width_height(self):
+ # docstring inherited
+ return self.width, self.height
+
+ def handle_clip_rectangle(self, gc):
+ new_bounds = gc.get_clip_rectangle()
+ if new_bounds is not None:
+ new_bounds = new_bounds.bounds
+ gfx_ctx = gc.gfx_ctx
+ if gfx_ctx._lastcliprect != new_bounds:
+ gfx_ctx._lastcliprect = new_bounds
+ if new_bounds is None:
+ gfx_ctx.ResetClip()
+ else:
+ gfx_ctx.Clip(new_bounds[0],
+ self.height - new_bounds[1] - new_bounds[3],
+ new_bounds[2], new_bounds[3])
+
+ @staticmethod
+ def convert_path(gfx_ctx, path, transform):
+ wxpath = gfx_ctx.CreatePath()
+ for points, code in path.iter_segments(transform):
+ if code == Path.MOVETO:
+ wxpath.MoveToPoint(*points)
+ elif code == Path.LINETO:
+ wxpath.AddLineToPoint(*points)
+ elif code == Path.CURVE3:
+ wxpath.AddQuadCurveToPoint(*points)
+ elif code == Path.CURVE4:
+ wxpath.AddCurveToPoint(*points)
+ elif code == Path.CLOSEPOLY:
+ wxpath.CloseSubpath()
+ return wxpath
+
+ def draw_path(self, gc, path, transform, rgbFace=None):
+ # docstring inherited
+ gc.select()
+ self.handle_clip_rectangle(gc)
+ gfx_ctx = gc.gfx_ctx
+ transform = transform + \
+ Affine2D().scale(1.0, -1.0).translate(0.0, self.height)
+ wxpath = self.convert_path(gfx_ctx, path, transform)
+ if rgbFace is not None:
+ gfx_ctx.SetBrush(wx.Brush(gc.get_wxcolour(rgbFace)))
+ gfx_ctx.DrawPath(wxpath)
+ else:
+ gfx_ctx.StrokePath(wxpath)
+ gc.unselect()
+
+ def draw_image(self, gc, x, y, im):
+ bbox = gc.get_clip_rectangle()
+ if bbox is not None:
+ l, b, w, h = bbox.bounds
+ else:
+ l = 0
+ b = 0
+ w = self.width
+ h = self.height
+ rows, cols = im.shape[:2]
+ bitmap = wx.Bitmap.FromBufferRGBA(cols, rows, im.tobytes())
+ gc.select()
+ gc.gfx_ctx.DrawBitmap(bitmap, int(l), int(self.height - b),
+ int(w), int(-h))
+ gc.unselect()
+
+ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
+ # docstring inherited
+
+ if ismath:
+ s = cbook.strip_math(s)
+ _log.debug("%s - draw_text()", type(self))
+ gc.select()
+ self.handle_clip_rectangle(gc)
+ gfx_ctx = gc.gfx_ctx
+
+ font = self.get_wx_font(s, prop)
+ color = gc.get_wxcolour(gc.get_rgb())
+ gfx_ctx.SetFont(font, color)
+
+ w, h, d = self.get_text_width_height_descent(s, prop, ismath)
+ x = int(x)
+ y = int(y - h)
+
+ if angle == 0.0:
+ gfx_ctx.DrawText(s, x, y)
+ else:
+ rads = math.radians(angle)
+ xo = h * math.sin(rads)
+ yo = h * math.cos(rads)
+ gfx_ctx.DrawRotatedText(s, x - xo, y - yo, rads)
+
+ gc.unselect()
+
+ def new_gc(self):
+ # docstring inherited
+ _log.debug("%s - new_gc()", type(self))
+ self.gc = GraphicsContextWx(self.bitmap, self)
+ self.gc.select()
+ self.gc.unselect()
+ return self.gc
+
+ def get_wx_font(self, s, prop):
+ """Return a wx font. Cache font instances for efficiency."""
+ _log.debug("%s - get_wx_font()", type(self))
+ key = hash(prop)
+ font = self.fontd.get(key)
+ if font is not None:
+ return font
+ size = self.points_to_pixels(prop.get_size_in_points())
+ # Font colour is determined by the active wx.Pen
+ # TODO: It may be wise to cache font information
+ self.fontd[key] = font = wx.Font( # Cache the font and gc.
+ pointSize=round(size),
+ family=self.fontnames.get(prop.get_name(), wx.ROMAN),
+ style=self.fontangles[prop.get_style()],
+ weight=self.fontweights[prop.get_weight()])
+ return font
+
+ def points_to_pixels(self, points):
+ # docstring inherited
+ return points * (PIXELS_PER_INCH / 72.0 * self.dpi / 72.0)
+
+
+class GraphicsContextWx(GraphicsContextBase):
+ """
+ The graphics context provides the color, line styles, etc.
+
+ This class stores a reference to a wxMemoryDC, and a
+ wxGraphicsContext that draws to it. Creating a wxGraphicsContext
+ seems to be fairly heavy, so these objects are cached based on the
+ bitmap object that is passed in.
+
+ The base GraphicsContext stores colors as an RGB tuple on the unit
+ interval, e.g., (0.5, 0.0, 1.0). wxPython uses an int interval, but
+ since wxPython colour management is rather simple, I have not chosen
+ to implement a separate colour manager class.
+ """
+ _capd = {'butt': wx.CAP_BUTT,
+ 'projecting': wx.CAP_PROJECTING,
+ 'round': wx.CAP_ROUND}
+
+ _joind = {'bevel': wx.JOIN_BEVEL,
+ 'miter': wx.JOIN_MITER,
+ 'round': wx.JOIN_ROUND}
+
+ _cache = weakref.WeakKeyDictionary()
+
+ def __init__(self, bitmap, renderer):
+ super().__init__()
+ # assert self.Ok(), "wxMemoryDC not OK to use"
+ _log.debug("%s - __init__(): %s", type(self), bitmap)
+
+ dc, gfx_ctx = self._cache.get(bitmap, (None, None))
+ if dc is None:
+ dc = wx.MemoryDC(bitmap)
+ gfx_ctx = wx.GraphicsContext.Create(dc)
+ gfx_ctx._lastcliprect = None
+ self._cache[bitmap] = dc, gfx_ctx
+
+ self.bitmap = bitmap
+ self.dc = dc
+ self.gfx_ctx = gfx_ctx
+ self._pen = wx.Pen('BLACK', 1, wx.SOLID)
+ gfx_ctx.SetPen(self._pen)
+ self.renderer = renderer
+
+ def select(self):
+ """Select the current bitmap into this wxDC instance."""
+ if sys.platform == 'win32':
+ self.dc.SelectObject(self.bitmap)
+ self.IsSelected = True
+
+ def unselect(self):
+ """Select a Null bitmap into this wxDC instance."""
+ if sys.platform == 'win32':
+ self.dc.SelectObject(wx.NullBitmap)
+ self.IsSelected = False
+
+ def set_foreground(self, fg, isRGBA=None):
+ # docstring inherited
+ # Implementation note: wxPython has a separate concept of pen and
+ # brush - the brush fills any outline trace left by the pen.
+ # Here we set both to the same colour - if a figure is not to be
+ # filled, the renderer will set the brush to be transparent
+ # Same goes for text foreground...
+ _log.debug("%s - set_foreground()", type(self))
+ self.select()
+ super().set_foreground(fg, isRGBA)
+
+ self._pen.SetColour(self.get_wxcolour(self.get_rgb()))
+ self.gfx_ctx.SetPen(self._pen)
+ self.unselect()
+
+ def set_linewidth(self, w):
+ # docstring inherited
+ w = float(w)
+ _log.debug("%s - set_linewidth()", type(self))
+ self.select()
+ if 0 < w < 1:
+ w = 1
+ super().set_linewidth(w)
+ lw = int(self.renderer.points_to_pixels(self._linewidth))
+ if lw == 0:
+ lw = 1
+ self._pen.SetWidth(lw)
+ self.gfx_ctx.SetPen(self._pen)
+ self.unselect()
+
+ def set_capstyle(self, cs):
+ # docstring inherited
+ _log.debug("%s - set_capstyle()", type(self))
+ self.select()
+ super().set_capstyle(cs)
+ self._pen.SetCap(GraphicsContextWx._capd[self._capstyle])
+ self.gfx_ctx.SetPen(self._pen)
+ self.unselect()
+
+ def set_joinstyle(self, js):
+ # docstring inherited
+ _log.debug("%s - set_joinstyle()", type(self))
+ self.select()
+ super().set_joinstyle(js)
+ self._pen.SetJoin(GraphicsContextWx._joind[self._joinstyle])
+ self.gfx_ctx.SetPen(self._pen)
+ self.unselect()
+
+ def get_wxcolour(self, color):
+ """Convert an RGB(A) color to a wx.Colour."""
+ _log.debug("%s - get_wx_color()", type(self))
+ return wx.Colour(*[int(255 * x) for x in color])
+
+
+class _FigureCanvasWxBase(FigureCanvasBase, wx.Panel):
+ """
+ The FigureCanvas contains the figure and does event handling.
+
+ In the wxPython backend, it is derived from wxPanel, and (usually) lives
+ inside a frame instantiated by a FigureManagerWx. The parent window
+ probably implements a wx.Sizer to control the displayed control size - but
+ we give a hint as to our preferred minimum size.
+ """
+
+ required_interactive_framework = "wx"
+ _timer_cls = TimerWx
+ manager_class = _api.classproperty(lambda cls: FigureManagerWx)
+
+ keyvald = {
+ wx.WXK_CONTROL: 'control',
+ wx.WXK_SHIFT: 'shift',
+ wx.WXK_ALT: 'alt',
+ wx.WXK_CAPITAL: 'caps_lock',
+ wx.WXK_LEFT: 'left',
+ wx.WXK_UP: 'up',
+ wx.WXK_RIGHT: 'right',
+ wx.WXK_DOWN: 'down',
+ wx.WXK_ESCAPE: 'escape',
+ wx.WXK_F1: 'f1',
+ wx.WXK_F2: 'f2',
+ wx.WXK_F3: 'f3',
+ wx.WXK_F4: 'f4',
+ wx.WXK_F5: 'f5',
+ wx.WXK_F6: 'f6',
+ wx.WXK_F7: 'f7',
+ wx.WXK_F8: 'f8',
+ wx.WXK_F9: 'f9',
+ wx.WXK_F10: 'f10',
+ wx.WXK_F11: 'f11',
+ wx.WXK_F12: 'f12',
+ wx.WXK_SCROLL: 'scroll_lock',
+ wx.WXK_PAUSE: 'break',
+ wx.WXK_BACK: 'backspace',
+ wx.WXK_RETURN: 'enter',
+ wx.WXK_INSERT: 'insert',
+ wx.WXK_DELETE: 'delete',
+ wx.WXK_HOME: 'home',
+ wx.WXK_END: 'end',
+ wx.WXK_PAGEUP: 'pageup',
+ wx.WXK_PAGEDOWN: 'pagedown',
+ wx.WXK_NUMPAD0: '0',
+ wx.WXK_NUMPAD1: '1',
+ wx.WXK_NUMPAD2: '2',
+ wx.WXK_NUMPAD3: '3',
+ wx.WXK_NUMPAD4: '4',
+ wx.WXK_NUMPAD5: '5',
+ wx.WXK_NUMPAD6: '6',
+ wx.WXK_NUMPAD7: '7',
+ wx.WXK_NUMPAD8: '8',
+ wx.WXK_NUMPAD9: '9',
+ wx.WXK_NUMPAD_ADD: '+',
+ wx.WXK_NUMPAD_SUBTRACT: '-',
+ wx.WXK_NUMPAD_MULTIPLY: '*',
+ wx.WXK_NUMPAD_DIVIDE: '/',
+ wx.WXK_NUMPAD_DECIMAL: 'dec',
+ wx.WXK_NUMPAD_ENTER: 'enter',
+ wx.WXK_NUMPAD_UP: 'up',
+ wx.WXK_NUMPAD_RIGHT: 'right',
+ wx.WXK_NUMPAD_DOWN: 'down',
+ wx.WXK_NUMPAD_LEFT: 'left',
+ wx.WXK_NUMPAD_PAGEUP: 'pageup',
+ wx.WXK_NUMPAD_PAGEDOWN: 'pagedown',
+ wx.WXK_NUMPAD_HOME: 'home',
+ wx.WXK_NUMPAD_END: 'end',
+ wx.WXK_NUMPAD_INSERT: 'insert',
+ wx.WXK_NUMPAD_DELETE: 'delete',
+ }
+
+ def __init__(self, parent, id, figure=None):
+ """
+ Initialize a FigureWx instance.
+
+ - Initialize the FigureCanvasBase and wxPanel parents.
+ - Set event handlers for resize, paint, and keyboard and mouse
+ interaction.
+ """
+
+ FigureCanvasBase.__init__(self, figure)
+ size = wx.Size(*map(math.ceil, self.figure.bbox.size))
+ if wx.Platform != '__WXMSW__':
+ size = parent.FromDIP(size)
+ # Set preferred window size hint - helps the sizer, if one is connected
+ wx.Panel.__init__(self, parent, id, size=size)
+ self.bitmap = None
+ self._isDrawn = False
+ self._rubberband_rect = None
+ self._rubberband_pen_black = wx.Pen('BLACK', 1, wx.PENSTYLE_SHORT_DASH)
+ self._rubberband_pen_white = wx.Pen('WHITE', 1, wx.PENSTYLE_SOLID)
+
+ self.Bind(wx.EVT_SIZE, self._on_size)
+ self.Bind(wx.EVT_PAINT, self._on_paint)
+ self.Bind(wx.EVT_CHAR_HOOK, self._on_key_down)
+ self.Bind(wx.EVT_KEY_UP, self._on_key_up)
+ self.Bind(wx.EVT_LEFT_DOWN, self._on_mouse_button)
+ self.Bind(wx.EVT_LEFT_DCLICK, self._on_mouse_button)
+ self.Bind(wx.EVT_LEFT_UP, self._on_mouse_button)
+ self.Bind(wx.EVT_MIDDLE_DOWN, self._on_mouse_button)
+ self.Bind(wx.EVT_MIDDLE_DCLICK, self._on_mouse_button)
+ self.Bind(wx.EVT_MIDDLE_UP, self._on_mouse_button)
+ self.Bind(wx.EVT_RIGHT_DOWN, self._on_mouse_button)
+ self.Bind(wx.EVT_RIGHT_DCLICK, self._on_mouse_button)
+ self.Bind(wx.EVT_RIGHT_UP, self._on_mouse_button)
+ self.Bind(wx.EVT_MOUSE_AUX1_DOWN, self._on_mouse_button)
+ self.Bind(wx.EVT_MOUSE_AUX1_UP, self._on_mouse_button)
+ self.Bind(wx.EVT_MOUSE_AUX2_DOWN, self._on_mouse_button)
+ self.Bind(wx.EVT_MOUSE_AUX2_UP, self._on_mouse_button)
+ self.Bind(wx.EVT_MOUSE_AUX1_DCLICK, self._on_mouse_button)
+ self.Bind(wx.EVT_MOUSE_AUX2_DCLICK, self._on_mouse_button)
+ self.Bind(wx.EVT_MOUSEWHEEL, self._on_mouse_wheel)
+ self.Bind(wx.EVT_MOTION, self._on_motion)
+ self.Bind(wx.EVT_ENTER_WINDOW, self._on_enter)
+ self.Bind(wx.EVT_LEAVE_WINDOW, self._on_leave)
+
+ self.Bind(wx.EVT_MOUSE_CAPTURE_CHANGED, self._on_capture_lost)
+ self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self._on_capture_lost)
+
+ self.SetBackgroundStyle(wx.BG_STYLE_PAINT) # Reduce flicker.
+ self.SetBackgroundColour(wx.WHITE)
+
+ if wx.Platform == '__WXMAC__':
+ # Initial scaling. Other platforms handle this automatically
+ dpiScale = self.GetDPIScaleFactor()
+ self.SetInitialSize(self.GetSize()*(1/dpiScale))
+ self._set_device_pixel_ratio(dpiScale)
+
+ def Copy_to_Clipboard(self, event=None):
+ """Copy bitmap of canvas to system clipboard."""
+ bmp_obj = wx.BitmapDataObject()
+ bmp_obj.SetBitmap(self.bitmap)
+
+ if not wx.TheClipboard.IsOpened():
+ open_success = wx.TheClipboard.Open()
+ if open_success:
+ wx.TheClipboard.SetData(bmp_obj)
+ wx.TheClipboard.Flush()
+ wx.TheClipboard.Close()
+
+ def _update_device_pixel_ratio(self, *args, **kwargs):
+ # We need to be careful in cases with mixed resolution displays if
+ # device_pixel_ratio changes.
+ if self._set_device_pixel_ratio(self.GetDPIScaleFactor()):
+ self.draw()
+
+ def draw_idle(self):
+ # docstring inherited
+ _log.debug("%s - draw_idle()", type(self))
+ self._isDrawn = False # Force redraw
+ # Triggering a paint event is all that is needed to defer drawing
+ # until later. The platform will send the event when it thinks it is
+ # a good time (usually as soon as there are no other events pending).
+ self.Refresh(eraseBackground=False)
+
+ def flush_events(self):
+ # docstring inherited
+ wx.Yield()
+
+ def start_event_loop(self, timeout=0):
+ # docstring inherited
+ if hasattr(self, '_event_loop'):
+ raise RuntimeError("Event loop already running")
+ timer = wx.Timer(self, id=wx.ID_ANY)
+ if timeout > 0:
+ timer.Start(int(timeout * 1000), oneShot=True)
+ self.Bind(wx.EVT_TIMER, self.stop_event_loop, id=timer.GetId())
+ # Event loop handler for start/stop event loop
+ self._event_loop = wx.GUIEventLoop()
+ self._event_loop.Run()
+ timer.Stop()
+
+ def stop_event_loop(self, event=None):
+ # docstring inherited
+ if hasattr(self, '_event_loop'):
+ if self._event_loop.IsRunning():
+ self._event_loop.Exit()
+ del self._event_loop
+
+ def _get_imagesave_wildcards(self):
+ """Return the wildcard string for the filesave dialog."""
+ default_filetype = self.get_default_filetype()
+ filetypes = self.get_supported_filetypes_grouped()
+ sorted_filetypes = sorted(filetypes.items())
+ wildcards = []
+ extensions = []
+ filter_index = 0
+ for i, (name, exts) in enumerate(sorted_filetypes):
+ ext_list = ';'.join(['*.%s' % ext for ext in exts])
+ extensions.append(exts[0])
+ wildcard = f'{name} ({ext_list})|{ext_list}'
+ if default_filetype in exts:
+ filter_index = i
+ wildcards.append(wildcard)
+ wildcards = '|'.join(wildcards)
+ return wildcards, extensions, filter_index
+
+ def gui_repaint(self, drawDC=None):
+ """
+ Update the displayed image on the GUI canvas, using the supplied
+ wx.PaintDC device context.
+ """
+ _log.debug("%s - gui_repaint()", type(self))
+ # The "if self" check avoids a "wrapped C/C++ object has been deleted"
+ # RuntimeError if doing things after window is closed.
+ if not (self and self.IsShownOnScreen()):
+ return
+ if not drawDC: # not called from OnPaint use a ClientDC
+ drawDC = wx.ClientDC(self)
+ # For 'WX' backend on Windows, the bitmap cannot be in use by another
+ # DC (see GraphicsContextWx._cache).
+ bmp = (self.bitmap.ConvertToImage().ConvertToBitmap()
+ if wx.Platform == '__WXMSW__'
+ and isinstance(self.figure.canvas.get_renderer(), RendererWx)
+ else self.bitmap)
+ drawDC.DrawBitmap(bmp, 0, 0)
+ if self._rubberband_rect is not None:
+ # Some versions of wx+python don't support numpy.float64 here.
+ x0, y0, x1, y1 = map(round, self._rubberband_rect)
+ rect = [(x0, y0, x1, y0), (x1, y0, x1, y1),
+ (x0, y0, x0, y1), (x0, y1, x1, y1)]
+ drawDC.DrawLineList(rect, self._rubberband_pen_white)
+ drawDC.DrawLineList(rect, self._rubberband_pen_black)
+
+ filetypes = {
+ **FigureCanvasBase.filetypes,
+ 'bmp': 'Windows bitmap',
+ 'jpeg': 'JPEG',
+ 'jpg': 'JPEG',
+ 'pcx': 'PCX',
+ 'png': 'Portable Network Graphics',
+ 'tif': 'Tagged Image Format File',
+ 'tiff': 'Tagged Image Format File',
+ 'xpm': 'X pixmap',
+ }
+
+ def _on_paint(self, event):
+ """Called when wxPaintEvt is generated."""
+ _log.debug("%s - _on_paint()", type(self))
+ drawDC = wx.PaintDC(self)
+ if not self._isDrawn:
+ self.draw(drawDC=drawDC)
+ else:
+ self.gui_repaint(drawDC=drawDC)
+ drawDC.Destroy()
+
+ def _on_size(self, event):
+ """
+ Called when wxEventSize is generated.
+
+ In this application we attempt to resize to fit the window, so it
+ is better to take the performance hit and redraw the whole window.
+ """
+ self._update_device_pixel_ratio()
+ _log.debug("%s - _on_size()", type(self))
+ sz = self.GetParent().GetSizer()
+ if sz:
+ si = sz.GetItem(self)
+ if sz and si and not si.Proportion and not si.Flag & wx.EXPAND:
+ # managed by a sizer, but with a fixed size
+ size = self.GetMinSize()
+ else:
+ # variable size
+ size = self.GetClientSize()
+ # Do not allow size to become smaller than MinSize
+ size.IncTo(self.GetMinSize())
+ if getattr(self, "_width", None):
+ if size == (self._width, self._height):
+ # no change in size
+ return
+ self._width, self._height = size
+ self._isDrawn = False
+
+ if self._width <= 1 or self._height <= 1:
+ return # Empty figure
+
+ # Create a new, correctly sized bitmap
+ dpival = self.figure.dpi
+ if not wx.Platform == '__WXMSW__':
+ scale = self.GetDPIScaleFactor()
+ dpival /= scale
+ winch = self._width / dpival
+ hinch = self._height / dpival
+ self.figure.set_size_inches(winch, hinch, forward=False)
+
+ # Rendering will happen on the associated paint event
+ # so no need to do anything here except to make sure
+ # the whole background is repainted.
+ self.Refresh(eraseBackground=False)
+ ResizeEvent("resize_event", self)._process()
+ self.draw_idle()
+
+ @staticmethod
+ def _mpl_buttons():
+ state = wx.GetMouseState()
+ # NOTE: Alternatively, we could use event.LeftIsDown() / etc. but this
+ # fails to report multiclick drags on macOS (other OSes have not been
+ # verified).
+ mod_table = [
+ (MouseButton.LEFT, state.LeftIsDown()),
+ (MouseButton.RIGHT, state.RightIsDown()),
+ (MouseButton.MIDDLE, state.MiddleIsDown()),
+ (MouseButton.BACK, state.Aux1IsDown()),
+ (MouseButton.FORWARD, state.Aux2IsDown()),
+ ]
+ # State *after* press/release.
+ return {button for button, flag in mod_table if flag}
+
+ @staticmethod
+ def _mpl_modifiers(event=None, *, exclude=None):
+ mod_table = [
+ ("ctrl", wx.MOD_CONTROL, wx.WXK_CONTROL),
+ ("alt", wx.MOD_ALT, wx.WXK_ALT),
+ ("shift", wx.MOD_SHIFT, wx.WXK_SHIFT),
+ ]
+ if event is not None:
+ modifiers = event.GetModifiers()
+ return [name for name, mod, key in mod_table
+ if modifiers & mod and exclude != key]
+ else:
+ return [name for name, mod, key in mod_table
+ if wx.GetKeyState(key)]
+
+ def _get_key(self, event):
+ keyval = event.KeyCode
+ if keyval in self.keyvald:
+ key = self.keyvald[keyval]
+ elif keyval < 256:
+ key = chr(keyval)
+ # wx always returns an uppercase, so make it lowercase if the shift
+ # key is not depressed (NOTE: this will not handle Caps Lock)
+ if not event.ShiftDown():
+ key = key.lower()
+ else:
+ return None
+ mods = self._mpl_modifiers(event, exclude=keyval)
+ if "shift" in mods and key.isupper():
+ mods.remove("shift")
+ return "+".join([*mods, key])
+
+ def _mpl_coords(self, pos=None):
+ """
+ Convert a wx position, defaulting to the current cursor position, to
+ Matplotlib coordinates.
+ """
+ if pos is None:
+ pos = wx.GetMouseState()
+ x, y = self.ScreenToClient(pos.X, pos.Y)
+ else:
+ x, y = pos.X, pos.Y
+ # flip y so y=0 is bottom of canvas
+ if not wx.Platform == '__WXMSW__':
+ scale = self.GetDPIScaleFactor()
+ return x*scale, self.figure.bbox.height - y*scale
+ else:
+ return x, self.figure.bbox.height - y
+
+ def _on_key_down(self, event):
+ """Capture key press."""
+ KeyEvent("key_press_event", self,
+ self._get_key(event), *self._mpl_coords(),
+ guiEvent=event)._process()
+ if self:
+ event.Skip()
+
+ def _on_key_up(self, event):
+ """Release key."""
+ KeyEvent("key_release_event", self,
+ self._get_key(event), *self._mpl_coords(),
+ guiEvent=event)._process()
+ if self:
+ event.Skip()
+
+ def set_cursor(self, cursor):
+ # docstring inherited
+ cursor = wx.Cursor(_api.check_getitem({
+ cursors.MOVE: wx.CURSOR_HAND,
+ cursors.HAND: wx.CURSOR_HAND,
+ cursors.POINTER: wx.CURSOR_ARROW,
+ cursors.SELECT_REGION: wx.CURSOR_CROSS,
+ cursors.WAIT: wx.CURSOR_WAIT,
+ cursors.RESIZE_HORIZONTAL: wx.CURSOR_SIZEWE,
+ cursors.RESIZE_VERTICAL: wx.CURSOR_SIZENS,
+ }, cursor=cursor))
+ self.SetCursor(cursor)
+ self.Refresh()
+
+ def _set_capture(self, capture=True):
+ """Control wx mouse capture."""
+ if self.HasCapture():
+ self.ReleaseMouse()
+ if capture:
+ self.CaptureMouse()
+
+ def _on_capture_lost(self, event):
+ """Capture changed or lost"""
+ self._set_capture(False)
+
+ def _on_mouse_button(self, event):
+ """Start measuring on an axis."""
+ event.Skip()
+ self._set_capture(event.ButtonDown() or event.ButtonDClick())
+ x, y = self._mpl_coords(event)
+ button_map = {
+ wx.MOUSE_BTN_LEFT: MouseButton.LEFT,
+ wx.MOUSE_BTN_MIDDLE: MouseButton.MIDDLE,
+ wx.MOUSE_BTN_RIGHT: MouseButton.RIGHT,
+ wx.MOUSE_BTN_AUX1: MouseButton.BACK,
+ wx.MOUSE_BTN_AUX2: MouseButton.FORWARD,
+ }
+ button = event.GetButton()
+ button = button_map.get(button, button)
+ modifiers = self._mpl_modifiers(event)
+ if event.ButtonDown():
+ MouseEvent("button_press_event", self, x, y, button,
+ modifiers=modifiers, guiEvent=event)._process()
+ elif event.ButtonDClick():
+ MouseEvent("button_press_event", self, x, y, button, dblclick=True,
+ modifiers=modifiers, guiEvent=event)._process()
+ elif event.ButtonUp():
+ MouseEvent("button_release_event", self, x, y, button,
+ modifiers=modifiers, guiEvent=event)._process()
+
+ def _on_mouse_wheel(self, event):
+ """Translate mouse wheel events into matplotlib events"""
+ x, y = self._mpl_coords(event)
+ # Convert delta/rotation/rate into a floating point step size
+ step = event.LinesPerAction * event.WheelRotation / event.WheelDelta
+ # Done handling event
+ event.Skip()
+ # Mac gives two events for every wheel event; skip every second one.
+ if wx.Platform == '__WXMAC__':
+ if not hasattr(self, '_skipwheelevent'):
+ self._skipwheelevent = True
+ elif self._skipwheelevent:
+ self._skipwheelevent = False
+ return # Return without processing event
+ else:
+ self._skipwheelevent = True
+ MouseEvent("scroll_event", self, x, y, step=step,
+ modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ def _on_motion(self, event):
+ """Start measuring on an axis."""
+ event.Skip()
+ MouseEvent("motion_notify_event", self,
+ *self._mpl_coords(event),
+ buttons=self._mpl_buttons(),
+ modifiers=self._mpl_modifiers(event),
+ guiEvent=event)._process()
+
+ def _on_enter(self, event):
+ """Mouse has entered the window."""
+ event.Skip()
+ LocationEvent("figure_enter_event", self,
+ *self._mpl_coords(event),
+ modifiers=self._mpl_modifiers(),
+ guiEvent=event)._process()
+
+ def _on_leave(self, event):
+ """Mouse has left the window."""
+ event.Skip()
+ LocationEvent("figure_leave_event", self,
+ *self._mpl_coords(event),
+ modifiers=self._mpl_modifiers(),
+ guiEvent=event)._process()
+
+
+class FigureCanvasWx(_FigureCanvasWxBase):
+ # Rendering to a Wx canvas using the deprecated Wx renderer.
+
+ def draw(self, drawDC=None):
+ """
+ Render the figure using RendererWx instance renderer, or using a
+ previously defined renderer if none is specified.
+ """
+ _log.debug("%s - draw()", type(self))
+ self.renderer = RendererWx(self.bitmap, self.figure.dpi)
+ self.figure.draw(self.renderer)
+ self._isDrawn = True
+ self.gui_repaint(drawDC=drawDC)
+
+ def _print_image(self, filetype, filename):
+ bitmap = wx.Bitmap(math.ceil(self.figure.bbox.width),
+ math.ceil(self.figure.bbox.height))
+ self.figure.draw(RendererWx(bitmap, self.figure.dpi))
+ saved_obj = (bitmap.ConvertToImage()
+ if cbook.is_writable_file_like(filename)
+ else bitmap)
+ if not saved_obj.SaveFile(filename, filetype):
+ raise RuntimeError(f'Could not save figure to {filename}')
+ # draw() is required here since bits of state about the last renderer
+ # are strewn about the artist draw methods. Do not remove the draw
+ # without first verifying that these have been cleaned up. The artist
+ # contains() methods will fail otherwise.
+ if self._isDrawn:
+ self.draw()
+ # The "if self" check avoids a "wrapped C/C++ object has been deleted"
+ # RuntimeError if doing things after window is closed.
+ if self:
+ self.Refresh()
+
+ print_bmp = functools.partialmethod(
+ _print_image, wx.BITMAP_TYPE_BMP)
+ print_jpeg = print_jpg = functools.partialmethod(
+ _print_image, wx.BITMAP_TYPE_JPEG)
+ print_pcx = functools.partialmethod(
+ _print_image, wx.BITMAP_TYPE_PCX)
+ print_png = functools.partialmethod(
+ _print_image, wx.BITMAP_TYPE_PNG)
+ print_tiff = print_tif = functools.partialmethod(
+ _print_image, wx.BITMAP_TYPE_TIF)
+ print_xpm = functools.partialmethod(
+ _print_image, wx.BITMAP_TYPE_XPM)
+
+
+class FigureFrameWx(wx.Frame):
+ def __init__(self, num, fig, *, canvas_class):
+ # On non-Windows platform, explicitly set the position - fix
+ # positioning bug on some Linux platforms
+ if wx.Platform == '__WXMSW__':
+ pos = wx.DefaultPosition
+ else:
+ pos = wx.Point(20, 20)
+ super().__init__(parent=None, id=-1, pos=pos)
+ # Frame will be sized later by the Fit method
+ _log.debug("%s - __init__()", type(self))
+ _set_frame_icon(self)
+
+ self.canvas = canvas_class(self, -1, fig)
+ # Auto-attaches itself to self.canvas.manager
+ manager = FigureManagerWx(self.canvas, num, self)
+
+ toolbar = self.canvas.manager.toolbar
+ if toolbar is not None:
+ self.SetToolBar(toolbar)
+
+ # On Windows, canvas sizing must occur after toolbar addition;
+ # otherwise the toolbar further resizes the canvas.
+ w, h = map(math.ceil, fig.bbox.size)
+ self.canvas.SetInitialSize(self.FromDIP(wx.Size(w, h)))
+ self.canvas.SetMinSize(self.FromDIP(wx.Size(2, 2)))
+ self.canvas.SetFocus()
+
+ self.Fit()
+
+ self.Bind(wx.EVT_CLOSE, self._on_close)
+
+ def _on_close(self, event):
+ _log.debug("%s - on_close()", type(self))
+ CloseEvent("close_event", self.canvas)._process()
+ self.canvas.stop_event_loop()
+ # set FigureManagerWx.frame to None to prevent repeated attempts to
+ # close this frame from FigureManagerWx.destroy()
+ self.canvas.manager.frame = None
+ # remove figure manager from Gcf.figs
+ Gcf.destroy(self.canvas.manager)
+ try: # See issue 2941338.
+ self.canvas.mpl_disconnect(self.canvas.toolbar._id_drag)
+ except AttributeError: # If there's no toolbar.
+ pass
+ # Carry on with close event propagation, frame & children destruction
+ event.Skip()
+
+
+class FigureManagerWx(FigureManagerBase):
+ """
+ Container/controller for the FigureCanvas and GUI frame.
+
+ It is instantiated by Gcf whenever a new figure is created. Gcf is
+ responsible for managing multiple instances of FigureManagerWx.
+
+ Attributes
+ ----------
+ canvas : `FigureCanvas`
+ a FigureCanvasWx(wx.Panel) instance
+ window : wxFrame
+ a wxFrame instance - wxpython.org/Phoenix/docs/html/Frame.html
+ """
+
+ def __init__(self, canvas, num, frame):
+ _log.debug("%s - __init__()", type(self))
+ self.frame = self.window = frame
+ super().__init__(canvas, num)
+
+ @classmethod
+ def create_with_canvas(cls, canvas_class, figure, num):
+ # docstring inherited
+ wxapp = wx.GetApp() or _create_wxapp()
+ frame = FigureFrameWx(num, figure, canvas_class=canvas_class)
+ manager = figure.canvas.manager
+ if mpl.is_interactive():
+ manager.frame.Show()
+ figure.canvas.draw_idle()
+ return manager
+
+ @classmethod
+ def start_main_loop(cls):
+ if not wx.App.IsMainLoopRunning():
+ wxapp = wx.GetApp()
+ if wxapp is not None:
+ wxapp.MainLoop()
+
+ def show(self):
+ # docstring inherited
+ self.frame.Show()
+ self.canvas.draw()
+ if mpl.rcParams['figure.raise_window']:
+ self.frame.Raise()
+
+ def destroy(self, *args):
+ # docstring inherited
+ _log.debug("%s - destroy()", type(self))
+ frame = self.frame
+ if frame: # Else, may have been already deleted, e.g. when closing.
+ # As this can be called from non-GUI thread from plt.close use
+ # wx.CallAfter to ensure thread safety.
+ wx.CallAfter(frame.Close)
+
+ def full_screen_toggle(self):
+ # docstring inherited
+ self.frame.ShowFullScreen(not self.frame.IsFullScreen())
+
+ def get_window_title(self):
+ # docstring inherited
+ return self.window.GetTitle()
+
+ def set_window_title(self, title):
+ # docstring inherited
+ self.window.SetTitle(title)
+
+ def resize(self, width, height):
+ # docstring inherited
+ # Directly using SetClientSize doesn't handle the toolbar on Windows.
+ self.window.SetSize(self.window.ClientToWindowSize(wx.Size(
+ math.ceil(width), math.ceil(height))))
+
+
+def _load_bitmap(filename):
+ """
+ Load a wx.Bitmap from a file in the "images" directory of the Matplotlib
+ data.
+ """
+ return wx.Bitmap(str(cbook._get_data_path('images', filename)))
+
+
+def _set_frame_icon(frame):
+ bundle = wx.IconBundle()
+ for image in ('matplotlib.png', 'matplotlib_large.png'):
+ icon = wx.Icon(_load_bitmap(image))
+ if not icon.IsOk():
+ return
+ bundle.AddIcon(icon)
+ frame.SetIcons(bundle)
+
+
+class NavigationToolbar2Wx(NavigationToolbar2, wx.ToolBar):
+ def __init__(self, canvas, coordinates=True, *, style=wx.TB_BOTTOM):
+ wx.ToolBar.__init__(self, canvas.GetParent(), -1, style=style)
+ if wx.Platform == '__WXMAC__':
+ self.SetToolBitmapSize(self.GetToolBitmapSize()*self.GetDPIScaleFactor())
+
+ self.wx_ids = {}
+ for text, tooltip_text, image_file, callback in self.toolitems:
+ if text is None:
+ self.AddSeparator()
+ continue
+ self.wx_ids[text] = (
+ self.AddTool(
+ -1,
+ bitmap=self._icon(f"{image_file}.svg"),
+ bmpDisabled=wx.NullBitmap,
+ label=text, shortHelp=tooltip_text,
+ kind=(wx.ITEM_CHECK if text in ["Pan", "Zoom"]
+ else wx.ITEM_NORMAL))
+ .Id)
+ self.Bind(wx.EVT_TOOL, getattr(self, callback),
+ id=self.wx_ids[text])
+
+ self._coordinates = coordinates
+ if self._coordinates:
+ self.AddStretchableSpace()
+ self._label_text = wx.StaticText(self, style=wx.ALIGN_RIGHT)
+ self.AddControl(self._label_text)
+
+ self.Realize()
+
+ NavigationToolbar2.__init__(self, canvas)
+
+ @staticmethod
+ def _icon(name):
+ """
+ Construct a `wx.Bitmap` suitable for use as icon from an image file
+ *name*, including the extension and relative to Matplotlib's "images"
+ data directory.
+ """
+ try:
+ dark = wx.SystemSettings.GetAppearance().IsDark()
+ except AttributeError: # wxpython < 4.1
+ # copied from wx's IsUsingDarkBackground / GetLuminance.
+ bg = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOW)
+ fg = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ # See wx.Colour.GetLuminance.
+ bg_lum = (.299 * bg.red + .587 * bg.green + .114 * bg.blue) / 255
+ fg_lum = (.299 * fg.red + .587 * fg.green + .114 * fg.blue) / 255
+ dark = fg_lum - bg_lum > .2
+
+ path = cbook._get_data_path('images', name)
+ if path.suffix == '.svg':
+ svg = path.read_bytes()
+ if dark:
+ svg = svg.replace(b'fill:black;', b'fill:white;')
+ toolbarIconSize = wx.ArtProvider().GetDIPSizeHint(wx.ART_TOOLBAR)
+ return wx.BitmapBundle.FromSVG(svg, toolbarIconSize)
+ else:
+ pilimg = PIL.Image.open(path)
+ # ensure RGBA as wx BitMap expects RGBA format
+ image = np.array(pilimg.convert("RGBA"))
+ if dark:
+ fg = wx.SystemSettings.GetColour(wx.SYS_COLOUR_WINDOWTEXT)
+ black_mask = (image[..., :3] == 0).all(axis=-1)
+ image[black_mask, :3] = (fg.Red(), fg.Green(), fg.Blue())
+ return wx.Bitmap.FromBufferRGBA(
+ image.shape[1], image.shape[0], image.tobytes())
+
+ def _update_buttons_checked(self):
+ if "Pan" in self.wx_ids:
+ self.ToggleTool(self.wx_ids["Pan"], self.mode.name == "PAN")
+ if "Zoom" in self.wx_ids:
+ self.ToggleTool(self.wx_ids["Zoom"], self.mode.name == "ZOOM")
+
+ def zoom(self, *args):
+ super().zoom(*args)
+ self._update_buttons_checked()
+
+ def pan(self, *args):
+ super().pan(*args)
+ self._update_buttons_checked()
+
+ def save_figure(self, *args):
+ # Fetch the required filename and file type.
+ filetypes, exts, filter_index = self.canvas._get_imagesave_wildcards()
+ default_file = self.canvas.get_default_filename()
+ dialog = wx.FileDialog(
+ self.canvas.GetParent(), "Save to file",
+ mpl.rcParams["savefig.directory"], default_file, filetypes,
+ wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT)
+ dialog.SetFilterIndex(filter_index)
+ if dialog.ShowModal() == wx.ID_OK:
+ path = pathlib.Path(dialog.GetPath())
+ _log.debug('%s - Save file path: %s', type(self), path)
+ fmt = exts[dialog.GetFilterIndex()]
+ ext = path.suffix[1:]
+ if ext in self.canvas.get_supported_filetypes() and fmt != ext:
+ # looks like they forgot to set the image type drop
+ # down, going with the extension.
+ _log.warning('extension %s did not match the selected '
+ 'image type %s; going with %s',
+ ext, fmt, ext)
+ fmt = ext
+ # Save dir for next time, unless empty str (which means use cwd).
+ if mpl.rcParams["savefig.directory"]:
+ mpl.rcParams["savefig.directory"] = str(path.parent)
+ try:
+ self.canvas.figure.savefig(path, format=fmt)
+ return path
+ except Exception as e:
+ dialog = wx.MessageDialog(
+ parent=self.canvas.GetParent(), message=str(e),
+ caption='Matplotlib error')
+ dialog.ShowModal()
+ dialog.Destroy()
+
+ def draw_rubberband(self, event, x0, y0, x1, y1):
+ height = self.canvas.figure.bbox.height
+ sf = 1 if wx.Platform == '__WXMSW__' else self.canvas.GetDPIScaleFactor()
+ self.canvas._rubberband_rect = (x0/sf, (height - y0)/sf,
+ x1/sf, (height - y1)/sf)
+ self.canvas.Refresh()
+
+ def remove_rubberband(self):
+ self.canvas._rubberband_rect = None
+ self.canvas.Refresh()
+
+ def set_message(self, s):
+ if self._coordinates:
+ self._label_text.SetLabel(s)
+
+ def set_history_buttons(self):
+ can_backward = self._nav_stack._pos > 0
+ can_forward = self._nav_stack._pos < len(self._nav_stack) - 1
+ if 'Back' in self.wx_ids:
+ self.EnableTool(self.wx_ids['Back'], can_backward)
+ if 'Forward' in self.wx_ids:
+ self.EnableTool(self.wx_ids['Forward'], can_forward)
+
+
+# tools for matplotlib.backend_managers.ToolManager:
+
+class ToolbarWx(ToolContainerBase, wx.ToolBar):
+ _icon_extension = '.svg'
+
+ def __init__(self, toolmanager, parent=None, style=wx.TB_BOTTOM):
+ if parent is None:
+ parent = toolmanager.canvas.GetParent()
+ ToolContainerBase.__init__(self, toolmanager)
+ wx.ToolBar.__init__(self, parent, -1, style=style)
+ self._space = self.AddStretchableSpace()
+ self._label_text = wx.StaticText(self, style=wx.ALIGN_RIGHT)
+ self.AddControl(self._label_text)
+ self._toolitems = {}
+ self._groups = {} # Mapping of groups to the separator after them.
+
+ def _get_tool_pos(self, tool):
+ """
+ Find the position (index) of a wx.ToolBarToolBase in a ToolBar.
+
+ ``ToolBar.GetToolPos`` is not useful because wx assigns the same Id to
+ all Separators and StretchableSpaces.
+ """
+ pos, = (pos for pos in range(self.ToolsCount)
+ if self.GetToolByPos(pos) == tool)
+ return pos
+
+ def add_toolitem(self, name, group, position, image_file, description,
+ toggle):
+ # Find or create the separator that follows this group.
+ if group not in self._groups:
+ self._groups[group] = self.InsertSeparator(
+ self._get_tool_pos(self._space))
+ sep = self._groups[group]
+ # List all separators.
+ seps = [t for t in map(self.GetToolByPos, range(self.ToolsCount))
+ if t.IsSeparator() and not t.IsStretchableSpace()]
+ # Find where to insert the tool.
+ if position >= 0:
+ # Find the start of the group by looking for the separator
+ # preceding this one; then move forward from it.
+ start = (0 if sep == seps[0]
+ else self._get_tool_pos(seps[seps.index(sep) - 1]) + 1)
+ else:
+ # Move backwards from this separator.
+ start = self._get_tool_pos(sep) + 1
+ idx = start + position
+ if image_file:
+ bmp = NavigationToolbar2Wx._icon(image_file)
+ kind = wx.ITEM_NORMAL if not toggle else wx.ITEM_CHECK
+ tool = self.InsertTool(idx, -1, name, bmp, wx.NullBitmap, kind,
+ description or "")
+ else:
+ size = (self.GetTextExtent(name)[0] + 10, -1)
+ if toggle:
+ control = wx.ToggleButton(self, -1, name, size=size)
+ else:
+ control = wx.Button(self, -1, name, size=size)
+ tool = self.InsertControl(idx, control, label=name)
+ self.Realize()
+
+ def handler(event):
+ self.trigger_tool(name)
+
+ if image_file:
+ self.Bind(wx.EVT_TOOL, handler, tool)
+ else:
+ control.Bind(wx.EVT_LEFT_DOWN, handler)
+
+ self._toolitems.setdefault(name, [])
+ self._toolitems[name].append((tool, handler))
+
+ def toggle_toolitem(self, name, toggled):
+ if name not in self._toolitems:
+ return
+ for tool, handler in self._toolitems[name]:
+ if not tool.IsControl():
+ self.ToggleTool(tool.Id, toggled)
+ else:
+ tool.GetControl().SetValue(toggled)
+ self.Refresh()
+
+ def remove_toolitem(self, name):
+ for tool, handler in self._toolitems.pop(name, []):
+ self.DeleteTool(tool.Id)
+
+ def set_message(self, s):
+ self._label_text.SetLabel(s)
+
+
+@backend_tools._register_tool_class(_FigureCanvasWxBase)
+class ConfigureSubplotsWx(backend_tools.ConfigureSubplotsBase):
+ def trigger(self, *args):
+ NavigationToolbar2Wx.configure_subplots(self)
+
+
+@backend_tools._register_tool_class(_FigureCanvasWxBase)
+class SaveFigureWx(backend_tools.SaveFigureBase):
+ def trigger(self, *args):
+ NavigationToolbar2Wx.save_figure(
+ self._make_classic_style_pseudo_toolbar())
+
+
+@backend_tools._register_tool_class(_FigureCanvasWxBase)
+class RubberbandWx(backend_tools.RubberbandBase):
+ def draw_rubberband(self, x0, y0, x1, y1):
+ NavigationToolbar2Wx.draw_rubberband(
+ self._make_classic_style_pseudo_toolbar(), None, x0, y0, x1, y1)
+
+ def remove_rubberband(self):
+ NavigationToolbar2Wx.remove_rubberband(
+ self._make_classic_style_pseudo_toolbar())
+
+
+class _HelpDialog(wx.Dialog):
+ _instance = None # a reference to an open dialog singleton
+ headers = [("Action", "Shortcuts", "Description")]
+ widths = [100, 140, 300]
+
+ def __init__(self, parent, help_entries):
+ super().__init__(parent, title="Help",
+ style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
+
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
+ # create and add the entries
+ bold = self.GetFont().MakeBold()
+ for r, row in enumerate(self.headers + help_entries):
+ for (col, width) in zip(row, self.widths):
+ label = wx.StaticText(self, label=col)
+ if r == 0:
+ label.SetFont(bold)
+ label.Wrap(width)
+ grid_sizer.Add(label, 0, 0, 0)
+ # finalize layout, create button
+ sizer.Add(grid_sizer, 0, wx.ALL, 6)
+ ok = wx.Button(self, wx.ID_OK)
+ sizer.Add(ok, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
+ self.SetSizer(sizer)
+ sizer.Fit(self)
+ self.Layout()
+ self.Bind(wx.EVT_CLOSE, self._on_close)
+ ok.Bind(wx.EVT_BUTTON, self._on_close)
+
+ def _on_close(self, event):
+ _HelpDialog._instance = None # remove global reference
+ self.DestroyLater()
+ event.Skip()
+
+ @classmethod
+ def show(cls, parent, help_entries):
+ # if no dialog is shown, create one; otherwise just re-raise it
+ if cls._instance:
+ cls._instance.Raise()
+ return
+ cls._instance = cls(parent, help_entries)
+ cls._instance.Show()
+
+
+@backend_tools._register_tool_class(_FigureCanvasWxBase)
+class HelpWx(backend_tools.ToolHelpBase):
+ def trigger(self, *args):
+ _HelpDialog.show(self.figure.canvas.GetTopLevelParent(),
+ self._get_help_entries())
+
+
+@backend_tools._register_tool_class(_FigureCanvasWxBase)
+class ToolCopyToClipboardWx(backend_tools.ToolCopyToClipboardBase):
+ def trigger(self, *args, **kwargs):
+ if not self.canvas._isDrawn:
+ self.canvas.draw()
+ if not self.canvas.bitmap.IsOk() or not wx.TheClipboard.Open():
+ return
+ try:
+ wx.TheClipboard.SetData(wx.BitmapDataObject(self.canvas.bitmap))
+ finally:
+ wx.TheClipboard.Close()
+
+
+FigureManagerWx._toolbar2_class = NavigationToolbar2Wx
+FigureManagerWx._toolmanager_toolbar_class = ToolbarWx
+
+
+@_Backend.export
+class _BackendWx(_Backend):
+ FigureCanvas = FigureCanvasWx
+ FigureManager = FigureManagerWx
+ mainloop = FigureManagerWx.start_main_loop
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wxagg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wxagg.py
new file mode 100644
index 0000000000000000000000000000000000000000..ab7703ffa02b8e85b845321f52a9ecdc09b2dfa8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wxagg.py
@@ -0,0 +1,45 @@
+import wx
+
+from .backend_agg import FigureCanvasAgg
+from .backend_wx import _BackendWx, _FigureCanvasWxBase
+from .backend_wx import ( # noqa: F401 # pylint: disable=W0611
+ NavigationToolbar2Wx as NavigationToolbar2WxAgg)
+
+
+class FigureCanvasWxAgg(FigureCanvasAgg, _FigureCanvasWxBase):
+ def draw(self, drawDC=None):
+ """
+ Render the figure using agg.
+ """
+ FigureCanvasAgg.draw(self)
+ self.bitmap = self._create_bitmap()
+ self._isDrawn = True
+ self.gui_repaint(drawDC=drawDC)
+
+ def blit(self, bbox=None):
+ # docstring inherited
+ bitmap = self._create_bitmap()
+ if bbox is None:
+ self.bitmap = bitmap
+ else:
+ srcDC = wx.MemoryDC(bitmap)
+ destDC = wx.MemoryDC(self.bitmap)
+ x = int(bbox.x0)
+ y = int(self.bitmap.GetHeight() - bbox.y1)
+ destDC.Blit(x, y, int(bbox.width), int(bbox.height), srcDC, x, y)
+ destDC.SelectObject(wx.NullBitmap)
+ srcDC.SelectObject(wx.NullBitmap)
+ self.gui_repaint()
+
+ def _create_bitmap(self):
+ """Create a wx.Bitmap from the renderer RGBA buffer"""
+ rgba = self.get_renderer().buffer_rgba()
+ h, w, _ = rgba.shape
+ bitmap = wx.Bitmap.FromBufferRGBA(w, h, rgba)
+ bitmap.SetScaleFactor(self.GetDPIScaleFactor())
+ return bitmap
+
+
+@_BackendWx.export
+class _BackendWxAgg(_BackendWx):
+ FigureCanvas = FigureCanvasWxAgg
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wxcairo.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wxcairo.py
new file mode 100644
index 0000000000000000000000000000000000000000..c53e6af4b87390455d02fab1bd3060648cac7fe8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/backend_wxcairo.py
@@ -0,0 +1,23 @@
+import wx.lib.wxcairo as wxcairo
+
+from .backend_cairo import cairo, FigureCanvasCairo
+from .backend_wx import _BackendWx, _FigureCanvasWxBase
+from .backend_wx import ( # noqa: F401 # pylint: disable=W0611
+ NavigationToolbar2Wx as NavigationToolbar2WxCairo)
+
+
+class FigureCanvasWxCairo(FigureCanvasCairo, _FigureCanvasWxBase):
+ def draw(self, drawDC=None):
+ size = self.figure.bbox.size.astype(int)
+ surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, *size)
+ self._renderer.set_context(cairo.Context(surface))
+ self._renderer.dpi = self.figure.dpi
+ self.figure.draw(self._renderer)
+ self.bitmap = wxcairo.BitmapFromImageSurface(surface)
+ self._isDrawn = True
+ self.gui_repaint(drawDC=drawDC)
+
+
+@_BackendWx.export
+class _BackendWxCairo(_BackendWx):
+ FigureCanvas = FigureCanvasWxCairo
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_compat.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_compat.py
new file mode 100644
index 0000000000000000000000000000000000000000..b57a98b1138aa60bf4ae55d4fe5e5da44f068306
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_compat.py
@@ -0,0 +1,159 @@
+"""
+Qt binding and backend selector.
+
+The selection logic is as follows:
+- if any of PyQt6, PySide6, PyQt5, or PySide2 have already been
+ imported (checked in that order), use it;
+- otherwise, if the QT_API environment variable (used by Enthought) is set, use
+ it to determine which binding to use;
+- otherwise, use whatever the rcParams indicate.
+"""
+
+import operator
+import os
+import platform
+import sys
+
+from packaging.version import parse as parse_version
+
+import matplotlib as mpl
+
+from . import _QT_FORCE_QT5_BINDING
+
+QT_API_PYQT6 = "PyQt6"
+QT_API_PYSIDE6 = "PySide6"
+QT_API_PYQT5 = "PyQt5"
+QT_API_PYSIDE2 = "PySide2"
+QT_API_ENV = os.environ.get("QT_API")
+if QT_API_ENV is not None:
+ QT_API_ENV = QT_API_ENV.lower()
+_ETS = { # Mapping of QT_API_ENV to requested binding.
+ "pyqt6": QT_API_PYQT6, "pyside6": QT_API_PYSIDE6,
+ "pyqt5": QT_API_PYQT5, "pyside2": QT_API_PYSIDE2,
+}
+# First, check if anything is already imported.
+if sys.modules.get("PyQt6.QtCore"):
+ QT_API = QT_API_PYQT6
+elif sys.modules.get("PySide6.QtCore"):
+ QT_API = QT_API_PYSIDE6
+elif sys.modules.get("PyQt5.QtCore"):
+ QT_API = QT_API_PYQT5
+elif sys.modules.get("PySide2.QtCore"):
+ QT_API = QT_API_PYSIDE2
+# Otherwise, check the QT_API environment variable (from Enthought). This can
+# only override the binding, not the backend (in other words, we check that the
+# requested backend actually matches). Use _get_backend_or_none to avoid
+# triggering backend resolution (which can result in a partially but
+# incompletely imported backend_qt5).
+elif (mpl.rcParams._get_backend_or_none() or "").lower().startswith("qt5"):
+ if QT_API_ENV in ["pyqt5", "pyside2"]:
+ QT_API = _ETS[QT_API_ENV]
+ else:
+ _QT_FORCE_QT5_BINDING = True # noqa: F811
+ QT_API = None
+# A non-Qt backend was selected but we still got there (possible, e.g., when
+# fully manually embedding Matplotlib in a Qt app without using pyplot).
+elif QT_API_ENV is None:
+ QT_API = None
+elif QT_API_ENV in _ETS:
+ QT_API = _ETS[QT_API_ENV]
+else:
+ raise RuntimeError(
+ "The environment variable QT_API has the unrecognized value {!r}; "
+ "valid values are {}".format(QT_API_ENV, ", ".join(_ETS)))
+
+
+def _setup_pyqt5plus():
+ global QtCore, QtGui, QtWidgets, __version__
+ global _isdeleted, _to_int
+
+ if QT_API == QT_API_PYQT6:
+ from PyQt6 import QtCore, QtGui, QtWidgets, sip
+ __version__ = QtCore.PYQT_VERSION_STR
+ QtCore.Signal = QtCore.pyqtSignal
+ QtCore.Slot = QtCore.pyqtSlot
+ QtCore.Property = QtCore.pyqtProperty
+ _isdeleted = sip.isdeleted
+ _to_int = operator.attrgetter('value')
+ elif QT_API == QT_API_PYSIDE6:
+ from PySide6 import QtCore, QtGui, QtWidgets, __version__
+ import shiboken6
+ def _isdeleted(obj): return not shiboken6.isValid(obj)
+ if parse_version(__version__) >= parse_version('6.4'):
+ _to_int = operator.attrgetter('value')
+ else:
+ _to_int = int
+ elif QT_API == QT_API_PYQT5:
+ from PyQt5 import QtCore, QtGui, QtWidgets
+ import sip
+ __version__ = QtCore.PYQT_VERSION_STR
+ QtCore.Signal = QtCore.pyqtSignal
+ QtCore.Slot = QtCore.pyqtSlot
+ QtCore.Property = QtCore.pyqtProperty
+ _isdeleted = sip.isdeleted
+ _to_int = int
+ elif QT_API == QT_API_PYSIDE2:
+ from PySide2 import QtCore, QtGui, QtWidgets, __version__
+ try:
+ from PySide2 import shiboken2
+ except ImportError:
+ import shiboken2
+ def _isdeleted(obj):
+ return not shiboken2.isValid(obj)
+ _to_int = int
+ else:
+ raise AssertionError(f"Unexpected QT_API: {QT_API}")
+
+
+if QT_API in [QT_API_PYQT6, QT_API_PYQT5, QT_API_PYSIDE6, QT_API_PYSIDE2]:
+ _setup_pyqt5plus()
+elif QT_API is None: # See above re: dict.__getitem__.
+ if _QT_FORCE_QT5_BINDING:
+ _candidates = [
+ (_setup_pyqt5plus, QT_API_PYQT5),
+ (_setup_pyqt5plus, QT_API_PYSIDE2),
+ ]
+ else:
+ _candidates = [
+ (_setup_pyqt5plus, QT_API_PYQT6),
+ (_setup_pyqt5plus, QT_API_PYSIDE6),
+ (_setup_pyqt5plus, QT_API_PYQT5),
+ (_setup_pyqt5plus, QT_API_PYSIDE2),
+ ]
+ for _setup, QT_API in _candidates:
+ try:
+ _setup()
+ except ImportError:
+ continue
+ break
+ else:
+ raise ImportError(
+ "Failed to import any of the following Qt binding modules: {}"
+ .format(", ".join([QT_API for _, QT_API in _candidates]))
+ )
+else: # We should not get there.
+ raise AssertionError(f"Unexpected QT_API: {QT_API}")
+_version_info = tuple(QtCore.QLibraryInfo.version().segments())
+
+
+if _version_info < (5, 12):
+ raise ImportError(
+ f"The Qt version imported is "
+ f"{QtCore.QLibraryInfo.version().toString()} but Matplotlib requires "
+ f"Qt>=5.12")
+
+
+# Fixes issues with Big Sur
+# https://bugreports.qt.io/browse/QTBUG-87014, fixed in qt 5.15.2
+if (sys.platform == 'darwin' and
+ parse_version(platform.mac_ver()[0]) >= parse_version("10.16") and
+ _version_info < (5, 15, 2)):
+ os.environ.setdefault("QT_MAC_WANTS_LAYER", "1")
+
+
+# Backports.
+
+
+def _exec(obj):
+ # exec on PyQt6, exec_ elsewhere.
+ obj.exec() if hasattr(obj, "exec") else obj.exec_()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_editor/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_editor/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_editor/_formlayout.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_editor/_formlayout.py
new file mode 100644
index 0000000000000000000000000000000000000000..fcf73cefbac8bc41c2f02f7895706423d3676e96
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_editor/_formlayout.py
@@ -0,0 +1,592 @@
+"""
+formlayout
+==========
+
+Module creating Qt form dialogs/layouts to edit various type of parameters
+
+
+formlayout License Agreement (MIT License)
+------------------------------------------
+
+Copyright (c) 2009 Pierre Raybaut
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+"""
+
+# History:
+# 1.0.10: added float validator
+# (disable "Ok" and "Apply" button when not valid)
+# 1.0.7: added support for "Apply" button
+# 1.0.6: code cleaning
+
+__version__ = '1.0.10'
+__license__ = __doc__
+
+from ast import literal_eval
+
+import copy
+import datetime
+import logging
+from numbers import Integral, Real
+
+from matplotlib import _api, colors as mcolors
+from matplotlib.backends.qt_compat import _to_int, QtGui, QtWidgets, QtCore
+
+_log = logging.getLogger(__name__)
+
+BLACKLIST = {"title", "label"}
+
+
+class ColorButton(QtWidgets.QPushButton):
+ """
+ Color choosing push button
+ """
+ colorChanged = QtCore.Signal(QtGui.QColor)
+
+ def __init__(self, parent=None):
+ super().__init__(parent)
+ self.setFixedSize(20, 20)
+ self.setIconSize(QtCore.QSize(12, 12))
+ self.clicked.connect(self.choose_color)
+ self._color = QtGui.QColor()
+
+ def choose_color(self):
+ color = QtWidgets.QColorDialog.getColor(
+ self._color, self.parentWidget(), "",
+ QtWidgets.QColorDialog.ColorDialogOption.ShowAlphaChannel)
+ if color.isValid():
+ self.set_color(color)
+
+ def get_color(self):
+ return self._color
+
+ @QtCore.Slot(QtGui.QColor)
+ def set_color(self, color):
+ if color != self._color:
+ self._color = color
+ self.colorChanged.emit(self._color)
+ pixmap = QtGui.QPixmap(self.iconSize())
+ pixmap.fill(color)
+ self.setIcon(QtGui.QIcon(pixmap))
+
+ color = QtCore.Property(QtGui.QColor, get_color, set_color)
+
+
+def to_qcolor(color):
+ """Create a QColor from a matplotlib color"""
+ qcolor = QtGui.QColor()
+ try:
+ rgba = mcolors.to_rgba(color)
+ except ValueError:
+ _api.warn_external(f'Ignoring invalid color {color!r}')
+ return qcolor # return invalid QColor
+ qcolor.setRgbF(*rgba)
+ return qcolor
+
+
+class ColorLayout(QtWidgets.QHBoxLayout):
+ """Color-specialized QLineEdit layout"""
+ def __init__(self, color, parent=None):
+ super().__init__()
+ assert isinstance(color, QtGui.QColor)
+ self.lineedit = QtWidgets.QLineEdit(
+ mcolors.to_hex(color.getRgbF(), keep_alpha=True), parent)
+ self.lineedit.editingFinished.connect(self.update_color)
+ self.addWidget(self.lineedit)
+ self.colorbtn = ColorButton(parent)
+ self.colorbtn.color = color
+ self.colorbtn.colorChanged.connect(self.update_text)
+ self.addWidget(self.colorbtn)
+
+ def update_color(self):
+ color = self.text()
+ qcolor = to_qcolor(color) # defaults to black if not qcolor.isValid()
+ self.colorbtn.color = qcolor
+
+ def update_text(self, color):
+ self.lineedit.setText(mcolors.to_hex(color.getRgbF(), keep_alpha=True))
+
+ def text(self):
+ return self.lineedit.text()
+
+
+def font_is_installed(font):
+ """Check if font is installed"""
+ return [fam for fam in QtGui.QFontDatabase().families()
+ if str(fam) == font]
+
+
+def tuple_to_qfont(tup):
+ """
+ Create a QFont from tuple:
+ (family [string], size [int], italic [bool], bold [bool])
+ """
+ if not (isinstance(tup, tuple) and len(tup) == 4
+ and font_is_installed(tup[0])
+ and isinstance(tup[1], Integral)
+ and isinstance(tup[2], bool)
+ and isinstance(tup[3], bool)):
+ return None
+ font = QtGui.QFont()
+ family, size, italic, bold = tup
+ font.setFamily(family)
+ font.setPointSize(size)
+ font.setItalic(italic)
+ font.setBold(bold)
+ return font
+
+
+def qfont_to_tuple(font):
+ return (str(font.family()), int(font.pointSize()),
+ font.italic(), font.bold())
+
+
+class FontLayout(QtWidgets.QGridLayout):
+ """Font selection"""
+ def __init__(self, value, parent=None):
+ super().__init__()
+ font = tuple_to_qfont(value)
+ assert font is not None
+
+ # Font family
+ self.family = QtWidgets.QFontComboBox(parent)
+ self.family.setCurrentFont(font)
+ self.addWidget(self.family, 0, 0, 1, -1)
+
+ # Font size
+ self.size = QtWidgets.QComboBox(parent)
+ self.size.setEditable(True)
+ sizelist = [*range(6, 12), *range(12, 30, 2), 36, 48, 72]
+ size = font.pointSize()
+ if size not in sizelist:
+ sizelist.append(size)
+ sizelist.sort()
+ self.size.addItems([str(s) for s in sizelist])
+ self.size.setCurrentIndex(sizelist.index(size))
+ self.addWidget(self.size, 1, 0)
+
+ # Italic or not
+ self.italic = QtWidgets.QCheckBox(self.tr("Italic"), parent)
+ self.italic.setChecked(font.italic())
+ self.addWidget(self.italic, 1, 1)
+
+ # Bold or not
+ self.bold = QtWidgets.QCheckBox(self.tr("Bold"), parent)
+ self.bold.setChecked(font.bold())
+ self.addWidget(self.bold, 1, 2)
+
+ def get_font(self):
+ font = self.family.currentFont()
+ font.setItalic(self.italic.isChecked())
+ font.setBold(self.bold.isChecked())
+ font.setPointSize(int(self.size.currentText()))
+ return qfont_to_tuple(font)
+
+
+def is_edit_valid(edit):
+ text = edit.text()
+ state = edit.validator().validate(text, 0)[0]
+ return state == QtGui.QDoubleValidator.State.Acceptable
+
+
+class FormWidget(QtWidgets.QWidget):
+ update_buttons = QtCore.Signal()
+
+ def __init__(self, data, comment="", with_margin=False, parent=None):
+ """
+ Parameters
+ ----------
+ data : list of (label, value) pairs
+ The data to be edited in the form.
+ comment : str, optional
+ with_margin : bool, default: False
+ If False, the form elements reach to the border of the widget.
+ This is the desired behavior if the FormWidget is used as a widget
+ alongside with other widgets such as a QComboBox, which also do
+ not have a margin around them.
+ However, a margin can be desired if the FormWidget is the only
+ widget within a container, e.g. a tab in a QTabWidget.
+ parent : QWidget or None
+ The parent widget.
+ """
+ super().__init__(parent)
+ self.data = copy.deepcopy(data)
+ self.widgets = []
+ self.formlayout = QtWidgets.QFormLayout(self)
+ if not with_margin:
+ self.formlayout.setContentsMargins(0, 0, 0, 0)
+ if comment:
+ self.formlayout.addRow(QtWidgets.QLabel(comment))
+ self.formlayout.addRow(QtWidgets.QLabel(" "))
+
+ def get_dialog(self):
+ """Return FormDialog instance"""
+ dialog = self.parent()
+ while not isinstance(dialog, QtWidgets.QDialog):
+ dialog = dialog.parent()
+ return dialog
+
+ def setup(self):
+ for label, value in self.data:
+ if label is None and value is None:
+ # Separator: (None, None)
+ self.formlayout.addRow(QtWidgets.QLabel(" "),
+ QtWidgets.QLabel(" "))
+ self.widgets.append(None)
+ continue
+ elif label is None:
+ # Comment
+ self.formlayout.addRow(QtWidgets.QLabel(value))
+ self.widgets.append(None)
+ continue
+ elif tuple_to_qfont(value) is not None:
+ field = FontLayout(value, self)
+ elif (label.lower() not in BLACKLIST
+ and mcolors.is_color_like(value)):
+ field = ColorLayout(to_qcolor(value), self)
+ elif isinstance(value, str):
+ field = QtWidgets.QLineEdit(value, self)
+ elif isinstance(value, (list, tuple)):
+ if isinstance(value, tuple):
+ value = list(value)
+ # Note: get() below checks the type of value[0] in self.data so
+ # it is essential that value gets modified in-place.
+ # This means that the code is actually broken in the case where
+ # value is a tuple, but fortunately we always pass a list...
+ selindex = value.pop(0)
+ field = QtWidgets.QComboBox(self)
+ if isinstance(value[0], (list, tuple)):
+ keys = [key for key, _val in value]
+ value = [val for _key, val in value]
+ else:
+ keys = value
+ field.addItems(value)
+ if selindex in value:
+ selindex = value.index(selindex)
+ elif selindex in keys:
+ selindex = keys.index(selindex)
+ elif not isinstance(selindex, Integral):
+ _log.warning(
+ "index '%s' is invalid (label: %s, value: %s)",
+ selindex, label, value)
+ selindex = 0
+ field.setCurrentIndex(selindex)
+ elif isinstance(value, bool):
+ field = QtWidgets.QCheckBox(self)
+ field.setChecked(value)
+ elif isinstance(value, Integral):
+ field = QtWidgets.QSpinBox(self)
+ field.setRange(-10**9, 10**9)
+ field.setValue(value)
+ elif isinstance(value, Real):
+ field = QtWidgets.QLineEdit(repr(value), self)
+ field.setCursorPosition(0)
+ field.setValidator(QtGui.QDoubleValidator(field))
+ field.validator().setLocale(QtCore.QLocale("C"))
+ dialog = self.get_dialog()
+ dialog.register_float_field(field)
+ field.textChanged.connect(lambda text: dialog.update_buttons())
+ elif isinstance(value, datetime.datetime):
+ field = QtWidgets.QDateTimeEdit(self)
+ field.setDateTime(value)
+ elif isinstance(value, datetime.date):
+ field = QtWidgets.QDateEdit(self)
+ field.setDate(value)
+ else:
+ field = QtWidgets.QLineEdit(repr(value), self)
+ self.formlayout.addRow(label, field)
+ self.widgets.append(field)
+
+ def get(self):
+ valuelist = []
+ for index, (label, value) in enumerate(self.data):
+ field = self.widgets[index]
+ if label is None:
+ # Separator / Comment
+ continue
+ elif tuple_to_qfont(value) is not None:
+ value = field.get_font()
+ elif isinstance(value, str) or mcolors.is_color_like(value):
+ value = str(field.text())
+ elif isinstance(value, (list, tuple)):
+ index = int(field.currentIndex())
+ if isinstance(value[0], (list, tuple)):
+ value = value[index][0]
+ else:
+ value = value[index]
+ elif isinstance(value, bool):
+ value = field.isChecked()
+ elif isinstance(value, Integral):
+ value = int(field.value())
+ elif isinstance(value, Real):
+ value = float(str(field.text()))
+ elif isinstance(value, datetime.datetime):
+ datetime_ = field.dateTime()
+ if hasattr(datetime_, "toPyDateTime"):
+ value = datetime_.toPyDateTime()
+ else:
+ value = datetime_.toPython()
+ elif isinstance(value, datetime.date):
+ date_ = field.date()
+ if hasattr(date_, "toPyDate"):
+ value = date_.toPyDate()
+ else:
+ value = date_.toPython()
+ else:
+ value = literal_eval(str(field.text()))
+ valuelist.append(value)
+ return valuelist
+
+
+class FormComboWidget(QtWidgets.QWidget):
+ update_buttons = QtCore.Signal()
+
+ def __init__(self, datalist, comment="", parent=None):
+ super().__init__(parent)
+ layout = QtWidgets.QVBoxLayout()
+ self.setLayout(layout)
+ self.combobox = QtWidgets.QComboBox()
+ layout.addWidget(self.combobox)
+
+ self.stackwidget = QtWidgets.QStackedWidget(self)
+ layout.addWidget(self.stackwidget)
+ self.combobox.currentIndexChanged.connect(
+ self.stackwidget.setCurrentIndex)
+
+ self.widgetlist = []
+ for data, title, comment in datalist:
+ self.combobox.addItem(title)
+ widget = FormWidget(data, comment=comment, parent=self)
+ self.stackwidget.addWidget(widget)
+ self.widgetlist.append(widget)
+
+ def setup(self):
+ for widget in self.widgetlist:
+ widget.setup()
+
+ def get(self):
+ return [widget.get() for widget in self.widgetlist]
+
+
+class FormTabWidget(QtWidgets.QWidget):
+ update_buttons = QtCore.Signal()
+
+ def __init__(self, datalist, comment="", parent=None):
+ super().__init__(parent)
+ layout = QtWidgets.QVBoxLayout()
+ self.tabwidget = QtWidgets.QTabWidget()
+ layout.addWidget(self.tabwidget)
+ layout.setContentsMargins(0, 0, 0, 0)
+ self.setLayout(layout)
+ self.widgetlist = []
+ for data, title, comment in datalist:
+ if len(data[0]) == 3:
+ widget = FormComboWidget(data, comment=comment, parent=self)
+ else:
+ widget = FormWidget(data, with_margin=True, comment=comment,
+ parent=self)
+ index = self.tabwidget.addTab(widget, title)
+ self.tabwidget.setTabToolTip(index, comment)
+ self.widgetlist.append(widget)
+
+ def setup(self):
+ for widget in self.widgetlist:
+ widget.setup()
+
+ def get(self):
+ return [widget.get() for widget in self.widgetlist]
+
+
+class FormDialog(QtWidgets.QDialog):
+ """Form Dialog"""
+ def __init__(self, data, title="", comment="",
+ icon=None, parent=None, apply=None):
+ super().__init__(parent)
+
+ self.apply_callback = apply
+
+ # Form
+ if isinstance(data[0][0], (list, tuple)):
+ self.formwidget = FormTabWidget(data, comment=comment,
+ parent=self)
+ elif len(data[0]) == 3:
+ self.formwidget = FormComboWidget(data, comment=comment,
+ parent=self)
+ else:
+ self.formwidget = FormWidget(data, comment=comment,
+ parent=self)
+ layout = QtWidgets.QVBoxLayout()
+ layout.addWidget(self.formwidget)
+
+ self.float_fields = []
+ self.formwidget.setup()
+
+ # Button box
+ self.bbox = bbox = QtWidgets.QDialogButtonBox(
+ QtWidgets.QDialogButtonBox.StandardButton(
+ _to_int(QtWidgets.QDialogButtonBox.StandardButton.Ok) |
+ _to_int(QtWidgets.QDialogButtonBox.StandardButton.Cancel)
+ ))
+ self.formwidget.update_buttons.connect(self.update_buttons)
+ if self.apply_callback is not None:
+ apply_btn = bbox.addButton(
+ QtWidgets.QDialogButtonBox.StandardButton.Apply)
+ apply_btn.clicked.connect(self.apply)
+
+ bbox.accepted.connect(self.accept)
+ bbox.rejected.connect(self.reject)
+ layout.addWidget(bbox)
+
+ self.setLayout(layout)
+
+ self.setWindowTitle(title)
+ if not isinstance(icon, QtGui.QIcon):
+ icon = QtWidgets.QWidget().style().standardIcon(
+ QtWidgets.QStyle.SP_MessageBoxQuestion)
+ self.setWindowIcon(icon)
+
+ def register_float_field(self, field):
+ self.float_fields.append(field)
+
+ def update_buttons(self):
+ valid = True
+ for field in self.float_fields:
+ if not is_edit_valid(field):
+ valid = False
+ for btn_type in ["Ok", "Apply"]:
+ btn = self.bbox.button(
+ getattr(QtWidgets.QDialogButtonBox.StandardButton,
+ btn_type))
+ if btn is not None:
+ btn.setEnabled(valid)
+
+ def accept(self):
+ self.data = self.formwidget.get()
+ self.apply_callback(self.data)
+ super().accept()
+
+ def reject(self):
+ self.data = None
+ super().reject()
+
+ def apply(self):
+ self.apply_callback(self.formwidget.get())
+
+ def get(self):
+ """Return form result"""
+ return self.data
+
+
+def fedit(data, title="", comment="", icon=None, parent=None, apply=None):
+ """
+ Create form dialog
+
+ data: datalist, datagroup
+ title: str
+ comment: str
+ icon: QIcon instance
+ parent: parent QWidget
+ apply: apply callback (function)
+
+ datalist: list/tuple of (field_name, field_value)
+ datagroup: list/tuple of (datalist *or* datagroup, title, comment)
+
+ -> one field for each member of a datalist
+ -> one tab for each member of a top-level datagroup
+ -> one page (of a multipage widget, each page can be selected with a combo
+ box) for each member of a datagroup inside a datagroup
+
+ Supported types for field_value:
+ - int, float, str, bool
+ - colors: in Qt-compatible text form, i.e. in hex format or name
+ (red, ...) (automatically detected from a string)
+ - list/tuple:
+ * the first element will be the selected index (or value)
+ * the other elements can be couples (key, value) or only values
+ """
+
+ # Create a QApplication instance if no instance currently exists
+ # (e.g., if the module is used directly from the interpreter)
+ if QtWidgets.QApplication.startingUp():
+ _app = QtWidgets.QApplication([])
+ dialog = FormDialog(data, title, comment, icon, parent, apply)
+
+ if parent is not None:
+ if hasattr(parent, "_fedit_dialog"):
+ parent._fedit_dialog.close()
+ parent._fedit_dialog = dialog
+
+ dialog.show()
+
+
+if __name__ == "__main__":
+
+ _app = QtWidgets.QApplication([])
+
+ def create_datalist_example():
+ return [('str', 'this is a string'),
+ ('list', [0, '1', '3', '4']),
+ ('list2', ['--', ('none', 'None'), ('--', 'Dashed'),
+ ('-.', 'DashDot'), ('-', 'Solid'),
+ ('steps', 'Steps'), (':', 'Dotted')]),
+ ('float', 1.2),
+ (None, 'Other:'),
+ ('int', 12),
+ ('font', ('Arial', 10, False, True)),
+ ('color', '#123409'),
+ ('bool', True),
+ ('date', datetime.date(2010, 10, 10)),
+ ('datetime', datetime.datetime(2010, 10, 10)),
+ ]
+
+ def create_datagroup_example():
+ datalist = create_datalist_example()
+ return ((datalist, "Category 1", "Category 1 comment"),
+ (datalist, "Category 2", "Category 2 comment"),
+ (datalist, "Category 3", "Category 3 comment"))
+
+ # --------- datalist example
+ datalist = create_datalist_example()
+
+ def apply_test(data):
+ print("data:", data)
+ fedit(datalist, title="Example",
+ comment="This is just an example .",
+ apply=apply_test)
+
+ _app.exec()
+
+ # --------- datagroup example
+ datagroup = create_datagroup_example()
+ fedit(datagroup, "Global title",
+ apply=apply_test)
+ _app.exec()
+
+ # --------- datagroup inside a datagroup example
+ datalist = create_datalist_example()
+ datagroup = create_datagroup_example()
+ fedit(((datagroup, "Title 1", "Tab 1 comment"),
+ (datalist, "Title 2", "Tab 2 comment"),
+ (datalist, "Title 3", "Tab 3 comment")),
+ "Global title",
+ apply=apply_test)
+ _app.exec()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_editor/figureoptions.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_editor/figureoptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..9d31fa9ced2ca24961597eddcc5e3e0f36f8fad8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/qt_editor/figureoptions.py
@@ -0,0 +1,271 @@
+# Copyright Ā© 2009 Pierre Raybaut
+# Licensed under the terms of the MIT License
+# see the Matplotlib licenses directory for a copy of the license
+
+
+"""Module that provides a GUI-based editor for Matplotlib's figure options."""
+
+from itertools import chain
+from matplotlib import cbook, cm, colors as mcolors, markers, image as mimage
+from matplotlib.backends.qt_compat import QtGui
+from matplotlib.backends.qt_editor import _formlayout
+from matplotlib.dates import DateConverter, num2date
+
+LINESTYLES = {'-': 'Solid',
+ '--': 'Dashed',
+ '-.': 'DashDot',
+ ':': 'Dotted',
+ 'None': 'None',
+ }
+
+DRAWSTYLES = {
+ 'default': 'Default',
+ 'steps-pre': 'Steps (Pre)', 'steps': 'Steps (Pre)',
+ 'steps-mid': 'Steps (Mid)',
+ 'steps-post': 'Steps (Post)'}
+
+MARKERS = markers.MarkerStyle.markers
+
+
+def figure_edit(axes, parent=None):
+ """Edit matplotlib figure options"""
+ sep = (None, None) # separator
+
+ # Get / General
+ def convert_limits(lim, converter):
+ """Convert axis limits for correct input editors."""
+ if isinstance(converter, DateConverter):
+ return map(num2date, lim)
+ # Cast to builtin floats as they have nicer reprs.
+ return map(float, lim)
+
+ axis_map = axes._axis_map
+ axis_limits = {
+ name: tuple(convert_limits(
+ getattr(axes, f'get_{name}lim')(), axis.get_converter()
+ ))
+ for name, axis in axis_map.items()
+ }
+ general = [
+ ('Title', axes.get_title()),
+ sep,
+ *chain.from_iterable([
+ (
+ (None, f"{name.title()}-Axis "),
+ ('Min', axis_limits[name][0]),
+ ('Max', axis_limits[name][1]),
+ ('Label', axis.label.get_text()),
+ ('Scale', [axis.get_scale(),
+ 'linear', 'log', 'symlog', 'logit']),
+ sep,
+ )
+ for name, axis in axis_map.items()
+ ]),
+ ('(Re-)Generate automatic legend', False),
+ ]
+
+ # Save the converter and unit data
+ axis_converter = {
+ name: axis.get_converter()
+ for name, axis in axis_map.items()
+ }
+ axis_units = {
+ name: axis.get_units()
+ for name, axis in axis_map.items()
+ }
+
+ # Get / Curves
+ labeled_lines = []
+ for line in axes.get_lines():
+ label = line.get_label()
+ if label == '_nolegend_':
+ continue
+ labeled_lines.append((label, line))
+ curves = []
+
+ def prepare_data(d, init):
+ """
+ Prepare entry for FormLayout.
+
+ *d* is a mapping of shorthands to style names (a single style may
+ have multiple shorthands, in particular the shorthands `None`,
+ `"None"`, `"none"` and `""` are synonyms); *init* is one shorthand
+ of the initial style.
+
+ This function returns an list suitable for initializing a
+ FormLayout combobox, namely `[initial_name, (shorthand,
+ style_name), (shorthand, style_name), ...]`.
+ """
+ if init not in d:
+ d = {**d, init: str(init)}
+ # Drop duplicate shorthands from dict (by overwriting them during
+ # the dict comprehension).
+ name2short = {name: short for short, name in d.items()}
+ # Convert back to {shorthand: name}.
+ short2name = {short: name for name, short in name2short.items()}
+ # Find the kept shorthand for the style specified by init.
+ canonical_init = name2short[d[init]]
+ # Sort by representation and prepend the initial value.
+ return ([canonical_init] +
+ sorted(short2name.items(),
+ key=lambda short_and_name: short_and_name[1]))
+
+ for label, line in labeled_lines:
+ color = mcolors.to_hex(
+ mcolors.to_rgba(line.get_color(), line.get_alpha()),
+ keep_alpha=True)
+ ec = mcolors.to_hex(
+ mcolors.to_rgba(line.get_markeredgecolor(), line.get_alpha()),
+ keep_alpha=True)
+ fc = mcolors.to_hex(
+ mcolors.to_rgba(line.get_markerfacecolor(), line.get_alpha()),
+ keep_alpha=True)
+ curvedata = [
+ ('Label', label),
+ sep,
+ (None, 'Line '),
+ ('Line style', prepare_data(LINESTYLES, line.get_linestyle())),
+ ('Draw style', prepare_data(DRAWSTYLES, line.get_drawstyle())),
+ ('Width', line.get_linewidth()),
+ ('Color (RGBA)', color),
+ sep,
+ (None, 'Marker '),
+ ('Style', prepare_data(MARKERS, line.get_marker())),
+ ('Size', line.get_markersize()),
+ ('Face color (RGBA)', fc),
+ ('Edge color (RGBA)', ec)]
+ curves.append([curvedata, label, ""])
+ # Is there a curve displayed?
+ has_curve = bool(curves)
+
+ # Get ScalarMappables.
+ labeled_mappables = []
+ for mappable in [*axes.images, *axes.collections]:
+ label = mappable.get_label()
+ if label == '_nolegend_' or mappable.get_array() is None:
+ continue
+ labeled_mappables.append((label, mappable))
+ mappables = []
+ cmaps = [(cmap, name) for name, cmap in sorted(cm._colormaps.items())]
+ for label, mappable in labeled_mappables:
+ cmap = mappable.get_cmap()
+ if cmap.name not in cm._colormaps:
+ cmaps = [(cmap, cmap.name), *cmaps]
+ low, high = mappable.get_clim()
+ mappabledata = [
+ ('Label', label),
+ ('Colormap', [cmap.name] + cmaps),
+ ('Min. value', low),
+ ('Max. value', high),
+ ]
+ if hasattr(mappable, "get_interpolation"): # Images.
+ interpolations = [
+ (name, name) for name in sorted(mimage.interpolations_names)]
+ mappabledata.append((
+ 'Interpolation',
+ [mappable.get_interpolation(), *interpolations]))
+
+ interpolation_stages = ['data', 'rgba', 'auto']
+ mappabledata.append((
+ 'Interpolation stage',
+ [mappable.get_interpolation_stage(), *interpolation_stages]))
+
+ mappables.append([mappabledata, label, ""])
+ # Is there a scalarmappable displayed?
+ has_sm = bool(mappables)
+
+ datalist = [(general, "Axes", "")]
+ if curves:
+ datalist.append((curves, "Curves", ""))
+ if mappables:
+ datalist.append((mappables, "Images, etc.", ""))
+
+ def apply_callback(data):
+ """A callback to apply changes."""
+ orig_limits = {
+ name: getattr(axes, f"get_{name}lim")()
+ for name in axis_map
+ }
+
+ general = data.pop(0)
+ curves = data.pop(0) if has_curve else []
+ mappables = data.pop(0) if has_sm else []
+ if data:
+ raise ValueError("Unexpected field")
+
+ title = general.pop(0)
+ axes.set_title(title)
+ generate_legend = general.pop()
+
+ for i, (name, axis) in enumerate(axis_map.items()):
+ axis_min = general[4*i]
+ axis_max = general[4*i + 1]
+ axis_label = general[4*i + 2]
+ axis_scale = general[4*i + 3]
+ if axis.get_scale() != axis_scale:
+ getattr(axes, f"set_{name}scale")(axis_scale)
+
+ axis._set_lim(axis_min, axis_max, auto=False)
+ axis.set_label_text(axis_label)
+
+ # Restore the unit data
+ axis._set_converter(axis_converter[name])
+ axis.set_units(axis_units[name])
+
+ # Set / Curves
+ for index, curve in enumerate(curves):
+ line = labeled_lines[index][1]
+ (label, linestyle, drawstyle, linewidth, color, marker, markersize,
+ markerfacecolor, markeredgecolor) = curve
+ line.set_label(label)
+ line.set_linestyle(linestyle)
+ line.set_drawstyle(drawstyle)
+ line.set_linewidth(linewidth)
+ rgba = mcolors.to_rgba(color)
+ line.set_alpha(None)
+ line.set_color(rgba)
+ if marker != 'none':
+ line.set_marker(marker)
+ line.set_markersize(markersize)
+ line.set_markerfacecolor(markerfacecolor)
+ line.set_markeredgecolor(markeredgecolor)
+
+ # Set ScalarMappables.
+ for index, mappable_settings in enumerate(mappables):
+ mappable = labeled_mappables[index][1]
+ if len(mappable_settings) == 6:
+ label, cmap, low, high, interpolation, interpolation_stage = \
+ mappable_settings
+ mappable.set_interpolation(interpolation)
+ mappable.set_interpolation_stage(interpolation_stage)
+ elif len(mappable_settings) == 4:
+ label, cmap, low, high = mappable_settings
+ mappable.set_label(label)
+ mappable.set_cmap(cmap)
+ mappable.set_clim(*sorted([low, high]))
+
+ # re-generate legend, if checkbox is checked
+ if generate_legend:
+ draggable = None
+ ncols = 1
+ if axes.legend_ is not None:
+ old_legend = axes.get_legend()
+ draggable = old_legend._draggable is not None
+ ncols = old_legend._ncols
+ new_legend = axes.legend(ncols=ncols)
+ if new_legend:
+ new_legend.set_draggable(draggable)
+
+ # Redraw
+ figure = axes.get_figure()
+ figure.canvas.draw()
+ for name in axis_map:
+ if getattr(axes, f"get_{name}lim")() != orig_limits[name]:
+ figure.canvas.toolbar.push_current()
+ break
+
+ _formlayout.fedit(
+ datalist, title="Figure options", parent=parent,
+ icon=QtGui.QIcon(
+ str(cbook._get_data_path('images', 'qt4_editor_options.svg'))),
+ apply=apply_callback)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/registry.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/registry.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f5a53f917a4c349a8bd12c0b38455e11b4dc638
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/registry.py
@@ -0,0 +1,414 @@
+from enum import Enum
+import importlib
+
+
+class BackendFilter(Enum):
+ """
+ Filter used with :meth:`~matplotlib.backends.registry.BackendRegistry.list_builtin`
+
+ .. versionadded:: 3.9
+ """
+ INTERACTIVE = 0
+ NON_INTERACTIVE = 1
+
+
+class BackendRegistry:
+ """
+ Registry of backends available within Matplotlib.
+
+ This is the single source of truth for available backends.
+
+ All use of ``BackendRegistry`` should be via the singleton instance
+ ``backend_registry`` which can be imported from ``matplotlib.backends``.
+
+ Each backend has a name, a module name containing the backend code, and an
+ optional GUI framework that must be running if the backend is interactive.
+ There are three sources of backends: built-in (source code is within the
+ Matplotlib repository), explicit ``module://some.backend`` syntax (backend is
+ obtained by loading the module), or via an entry point (self-registering
+ backend in an external package).
+
+ .. versionadded:: 3.9
+ """
+ # Mapping of built-in backend name to GUI framework, or "headless" for no
+ # GUI framework. Built-in backends are those which are included in the
+ # Matplotlib repo. A backend with name 'name' is located in the module
+ # f"matplotlib.backends.backend_{name.lower()}"
+ _BUILTIN_BACKEND_TO_GUI_FRAMEWORK = {
+ "gtk3agg": "gtk3",
+ "gtk3cairo": "gtk3",
+ "gtk4agg": "gtk4",
+ "gtk4cairo": "gtk4",
+ "macosx": "macosx",
+ "nbagg": "nbagg",
+ "notebook": "nbagg",
+ "qtagg": "qt",
+ "qtcairo": "qt",
+ "qt5agg": "qt5",
+ "qt5cairo": "qt5",
+ "tkagg": "tk",
+ "tkcairo": "tk",
+ "webagg": "webagg",
+ "wx": "wx",
+ "wxagg": "wx",
+ "wxcairo": "wx",
+ "agg": "headless",
+ "cairo": "headless",
+ "pdf": "headless",
+ "pgf": "headless",
+ "ps": "headless",
+ "svg": "headless",
+ "template": "headless",
+ }
+
+ # Reverse mapping of gui framework to preferred built-in backend.
+ _GUI_FRAMEWORK_TO_BACKEND = {
+ "gtk3": "gtk3agg",
+ "gtk4": "gtk4agg",
+ "headless": "agg",
+ "macosx": "macosx",
+ "qt": "qtagg",
+ "qt5": "qt5agg",
+ "qt6": "qtagg",
+ "tk": "tkagg",
+ "wx": "wxagg",
+ }
+
+ def __init__(self):
+ # Only load entry points when first needed.
+ self._loaded_entry_points = False
+
+ # Mapping of non-built-in backend to GUI framework, added dynamically from
+ # entry points and from matplotlib.use("module://some.backend") format.
+ # New entries have an "unknown" GUI framework that is determined when first
+ # needed by calling _get_gui_framework_by_loading.
+ self._backend_to_gui_framework = {}
+
+ # Mapping of backend name to module name, where different from
+ # f"matplotlib.backends.backend_{backend_name.lower()}". These are either
+ # hardcoded for backward compatibility, or loaded from entry points or
+ # "module://some.backend" syntax.
+ self._name_to_module = {
+ "notebook": "nbagg",
+ }
+
+ def _backend_module_name(self, backend):
+ if backend.startswith("module://"):
+ return backend[9:]
+
+ # Return name of module containing the specified backend.
+ # Does not check if the backend is valid, use is_valid_backend for that.
+ backend = backend.lower()
+
+ # Check if have specific name to module mapping.
+ backend = self._name_to_module.get(backend, backend)
+
+ return (backend[9:] if backend.startswith("module://")
+ else f"matplotlib.backends.backend_{backend}")
+
+ def _clear(self):
+ # Clear all dynamically-added data, used for testing only.
+ self.__init__()
+
+ def _ensure_entry_points_loaded(self):
+ # Load entry points, if they have not already been loaded.
+ if not self._loaded_entry_points:
+ entries = self._read_entry_points()
+ self._validate_and_store_entry_points(entries)
+ self._loaded_entry_points = True
+
+ def _get_gui_framework_by_loading(self, backend):
+ # Determine GUI framework for a backend by loading its module and reading the
+ # FigureCanvas.required_interactive_framework attribute.
+ # Returns "headless" if there is no GUI framework.
+ module = self.load_backend_module(backend)
+ canvas_class = module.FigureCanvas
+ return canvas_class.required_interactive_framework or "headless"
+
+ def _read_entry_points(self):
+ # Read entry points of modules that self-advertise as Matplotlib backends.
+ # Expects entry points like this one from matplotlib-inline (in pyproject.toml
+ # format):
+ # [project.entry-points."matplotlib.backend"]
+ # inline = "matplotlib_inline.backend_inline"
+ import importlib.metadata as im
+
+ entry_points = im.entry_points(group="matplotlib.backend")
+ entries = [(entry.name, entry.value) for entry in entry_points]
+
+ # For backward compatibility, if matplotlib-inline and/or ipympl are installed
+ # but too old to include entry points, create them. Do not import ipympl
+ # directly as this calls matplotlib.use() whilst in this function.
+ def backward_compatible_entry_points(
+ entries, module_name, threshold_version, names, target):
+ from matplotlib import _parse_to_version_info
+ try:
+ module_version = im.version(module_name)
+ if _parse_to_version_info(module_version) < threshold_version:
+ for name in names:
+ entries.append((name, target))
+ except im.PackageNotFoundError:
+ pass
+
+ names = [entry[0] for entry in entries]
+ if "inline" not in names:
+ backward_compatible_entry_points(
+ entries, "matplotlib_inline", (0, 1, 7), ["inline"],
+ "matplotlib_inline.backend_inline")
+ if "ipympl" not in names:
+ backward_compatible_entry_points(
+ entries, "ipympl", (0, 9, 4), ["ipympl", "widget"],
+ "ipympl.backend_nbagg")
+
+ return entries
+
+ def _validate_and_store_entry_points(self, entries):
+ # Validate and store entry points so that they can be used via matplotlib.use()
+ # in the normal manner. Entry point names cannot be of module:// format, cannot
+ # shadow a built-in backend name, and there cannot be multiple entry points
+ # with the same name but different modules. Multiple entry points with the same
+ # name and value are permitted (it can sometimes happen outside of our control,
+ # see https://github.com/matplotlib/matplotlib/issues/28367).
+ for name, module in set(entries):
+ name = name.lower()
+ if name.startswith("module://"):
+ raise RuntimeError(
+ f"Entry point name '{name}' cannot start with 'module://'")
+ if name in self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK:
+ raise RuntimeError(f"Entry point name '{name}' is a built-in backend")
+ if name in self._backend_to_gui_framework:
+ raise RuntimeError(f"Entry point name '{name}' duplicated")
+
+ self._name_to_module[name] = "module://" + module
+ # Do not yet know backend GUI framework, determine it only when necessary.
+ self._backend_to_gui_framework[name] = "unknown"
+
+ def backend_for_gui_framework(self, framework):
+ """
+ Return the name of the backend corresponding to the specified GUI framework.
+
+ Parameters
+ ----------
+ framework : str
+ GUI framework such as "qt".
+
+ Returns
+ -------
+ str or None
+ Backend name or None if GUI framework not recognised.
+ """
+ return self._GUI_FRAMEWORK_TO_BACKEND.get(framework.lower())
+
+ def is_valid_backend(self, backend):
+ """
+ Return True if the backend name is valid, False otherwise.
+
+ A backend name is valid if it is one of the built-in backends or has been
+ dynamically added via an entry point. Those beginning with ``module://`` are
+ always considered valid and are added to the current list of all backends
+ within this function.
+
+ Even if a name is valid, it may not be importable or usable. This can only be
+ determined by loading and using the backend module.
+
+ Parameters
+ ----------
+ backend : str
+ Name of backend.
+
+ Returns
+ -------
+ bool
+ True if backend is valid, False otherwise.
+ """
+ if not backend.startswith("module://"):
+ backend = backend.lower()
+
+ # For backward compatibility, convert ipympl and matplotlib-inline long
+ # module:// names to their shortened forms.
+ backwards_compat = {
+ "module://ipympl.backend_nbagg": "widget",
+ "module://matplotlib_inline.backend_inline": "inline",
+ }
+ backend = backwards_compat.get(backend, backend)
+
+ if (backend in self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK or
+ backend in self._backend_to_gui_framework):
+ return True
+
+ if backend.startswith("module://"):
+ self._backend_to_gui_framework[backend] = "unknown"
+ return True
+
+ # Only load entry points if really need to and not already done so.
+ self._ensure_entry_points_loaded()
+ if backend in self._backend_to_gui_framework:
+ return True
+
+ return False
+
+ def list_all(self):
+ """
+ Return list of all known backends.
+
+ These include built-in backends and those obtained at runtime either from entry
+ points or explicit ``module://some.backend`` syntax.
+
+ Entry points will be loaded if they haven't been already.
+
+ Returns
+ -------
+ list of str
+ Backend names.
+ """
+ self._ensure_entry_points_loaded()
+ return [*self.list_builtin(), *self._backend_to_gui_framework]
+
+ def list_builtin(self, filter_=None):
+ """
+ Return list of backends that are built into Matplotlib.
+
+ Parameters
+ ----------
+ filter_ : `~.BackendFilter`, optional
+ Filter to apply to returned backends. For example, to return only
+ non-interactive backends use `.BackendFilter.NON_INTERACTIVE`.
+
+ Returns
+ -------
+ list of str
+ Backend names.
+ """
+ if filter_ == BackendFilter.INTERACTIVE:
+ return [k for k, v in self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK.items()
+ if v != "headless"]
+ elif filter_ == BackendFilter.NON_INTERACTIVE:
+ return [k for k, v in self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK.items()
+ if v == "headless"]
+
+ return [*self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK]
+
+ def list_gui_frameworks(self):
+ """
+ Return list of GUI frameworks used by Matplotlib backends.
+
+ Returns
+ -------
+ list of str
+ GUI framework names.
+ """
+ return [k for k in self._GUI_FRAMEWORK_TO_BACKEND if k != "headless"]
+
+ def load_backend_module(self, backend):
+ """
+ Load and return the module containing the specified backend.
+
+ Parameters
+ ----------
+ backend : str
+ Name of backend to load.
+
+ Returns
+ -------
+ Module
+ Module containing backend.
+ """
+ module_name = self._backend_module_name(backend)
+ return importlib.import_module(module_name)
+
+ def resolve_backend(self, backend):
+ """
+ Return the backend and GUI framework for the specified backend name.
+
+ If the GUI framework is not yet known then it will be determined by loading the
+ backend module and checking the ``FigureCanvas.required_interactive_framework``
+ attribute.
+
+ This function only loads entry points if they have not already been loaded and
+ the backend is not built-in and not of ``module://some.backend`` format.
+
+ Parameters
+ ----------
+ backend : str or None
+ Name of backend, or None to use the default backend.
+
+ Returns
+ -------
+ backend : str
+ The backend name.
+ framework : str or None
+ The GUI framework, which will be None for a backend that is non-interactive.
+ """
+ if isinstance(backend, str):
+ if not backend.startswith("module://"):
+ backend = backend.lower()
+ else: # Might be _auto_backend_sentinel or None
+ # Use whatever is already running...
+ from matplotlib import get_backend
+ backend = get_backend()
+
+ # Is backend already known (built-in or dynamically loaded)?
+ gui = (self._BUILTIN_BACKEND_TO_GUI_FRAMEWORK.get(backend) or
+ self._backend_to_gui_framework.get(backend))
+
+ # Is backend "module://something"?
+ if gui is None and isinstance(backend, str) and backend.startswith("module://"):
+ gui = "unknown"
+
+ # Is backend a possible entry point?
+ if gui is None and not self._loaded_entry_points:
+ self._ensure_entry_points_loaded()
+ gui = self._backend_to_gui_framework.get(backend)
+
+ # Backend known but not its gui framework.
+ if gui == "unknown":
+ gui = self._get_gui_framework_by_loading(backend)
+ self._backend_to_gui_framework[backend] = gui
+
+ if gui is None:
+ raise RuntimeError(f"'{backend}' is not a recognised backend name")
+
+ return backend, gui if gui != "headless" else None
+
+ def resolve_gui_or_backend(self, gui_or_backend):
+ """
+ Return the backend and GUI framework for the specified string that may be
+ either a GUI framework or a backend name, tested in that order.
+
+ This is for use with the IPython %matplotlib magic command which may be a GUI
+ framework such as ``%matplotlib qt`` or a backend name such as
+ ``%matplotlib qtagg``.
+
+ This function only loads entry points if they have not already been loaded and
+ the backend is not built-in and not of ``module://some.backend`` format.
+
+ Parameters
+ ----------
+ gui_or_backend : str or None
+ Name of GUI framework or backend, or None to use the default backend.
+
+ Returns
+ -------
+ backend : str
+ The backend name.
+ framework : str or None
+ The GUI framework, which will be None for a backend that is non-interactive.
+ """
+ if not gui_or_backend.startswith("module://"):
+ gui_or_backend = gui_or_backend.lower()
+
+ # First check if it is a gui loop name.
+ backend = self.backend_for_gui_framework(gui_or_backend)
+ if backend is not None:
+ return backend, gui_or_backend if gui_or_backend != "headless" else None
+
+ # Then check if it is a backend name.
+ try:
+ return self.resolve_backend(gui_or_backend)
+ except Exception: # KeyError ?
+ raise RuntimeError(
+ f"'{gui_or_backend}' is not a recognised GUI loop or backend name")
+
+
+# Singleton
+backend_registry = BackendRegistry()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/all_figures.html b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/all_figures.html
new file mode 100644
index 0000000000000000000000000000000000000000..62f04b65c9bf6b72e7b5de2c25e46a1b88109c89
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/all_figures.html
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ MPL | WebAgg current figures
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/boilerplate.css b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/boilerplate.css
new file mode 100644
index 0000000000000000000000000000000000000000..2b1535f4495e6f2242a09f6c822a01e34389bd98
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/boilerplate.css
@@ -0,0 +1,77 @@
+/**
+ * HTML5 ā° Boilerplate
+ *
+ * style.css contains a reset, font normalization and some base styles.
+ *
+ * Credit is left where credit is due.
+ * Much inspiration was taken from these projects:
+ * - yui.yahooapis.com/2.8.1/build/base/base.css
+ * - camendesign.com/design/
+ * - praegnanz.de/weblog/htmlcssjs-kickstart
+ */
+
+
+/**
+ * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
+ * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark
+ * html5doctor.com/html-5-reset-stylesheet/
+ */
+
+html, body, div, span, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
+small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font-size: 100%;
+ font: inherit;
+ vertical-align: baseline;
+}
+
+sup { vertical-align: super; }
+sub { vertical-align: sub; }
+
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+
+blockquote, q { quotes: none; }
+
+blockquote:before, blockquote:after,
+q:before, q:after { content: ""; content: none; }
+
+ins { background-color: #ff9; color: #000; text-decoration: none; }
+
+mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
+
+del { text-decoration: line-through; }
+
+abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
+
+table { border-collapse: collapse; border-spacing: 0; }
+
+hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
+
+input, select { vertical-align: middle; }
+
+
+/**
+ * Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/
+ */
+
+body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */
+select, input, textarea, button { font:99% sans-serif; }
+
+/* Normalize monospace sizing:
+ en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome */
+pre, code, kbd, samp { font-family: monospace, sans-serif; }
+
+em,i { font-style: italic; }
+b,strong { font-weight: bold; }
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/fbm.css b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/fbm.css
new file mode 100644
index 0000000000000000000000000000000000000000..ce35d99a5e64c2e42a368aa61cd41ddb563d9ddd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/fbm.css
@@ -0,0 +1,97 @@
+
+/* Flexible box model classes */
+/* Taken from Alex Russell https://infrequently.org/2009/08/css-3-progress/ */
+
+.hbox {
+ display: -webkit-box;
+ -webkit-box-orient: horizontal;
+ -webkit-box-align: stretch;
+
+ display: -moz-box;
+ -moz-box-orient: horizontal;
+ -moz-box-align: stretch;
+
+ display: box;
+ box-orient: horizontal;
+ box-align: stretch;
+}
+
+.hbox > * {
+ -webkit-box-flex: 0;
+ -moz-box-flex: 0;
+ box-flex: 0;
+}
+
+.vbox {
+ display: -webkit-box;
+ -webkit-box-orient: vertical;
+ -webkit-box-align: stretch;
+
+ display: -moz-box;
+ -moz-box-orient: vertical;
+ -moz-box-align: stretch;
+
+ display: box;
+ box-orient: vertical;
+ box-align: stretch;
+}
+
+.vbox > * {
+ -webkit-box-flex: 0;
+ -moz-box-flex: 0;
+ box-flex: 0;
+}
+
+.reverse {
+ -webkit-box-direction: reverse;
+ -moz-box-direction: reverse;
+ box-direction: reverse;
+}
+
+.box-flex0 {
+ -webkit-box-flex: 0;
+ -moz-box-flex: 0;
+ box-flex: 0;
+}
+
+.box-flex1, .box-flex {
+ -webkit-box-flex: 1;
+ -moz-box-flex: 1;
+ box-flex: 1;
+}
+
+.box-flex2 {
+ -webkit-box-flex: 2;
+ -moz-box-flex: 2;
+ box-flex: 2;
+}
+
+.box-group1 {
+ -webkit-box-flex-group: 1;
+ -moz-box-flex-group: 1;
+ box-flex-group: 1;
+}
+
+.box-group2 {
+ -webkit-box-flex-group: 2;
+ -moz-box-flex-group: 2;
+ box-flex-group: 2;
+}
+
+.start {
+ -webkit-box-pack: start;
+ -moz-box-pack: start;
+ box-pack: start;
+}
+
+.end {
+ -webkit-box-pack: end;
+ -moz-box-pack: end;
+ box-pack: end;
+}
+
+.center {
+ -webkit-box-pack: center;
+ -moz-box-pack: center;
+ box-pack: center;
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/mpl.css b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/mpl.css
new file mode 100644
index 0000000000000000000000000000000000000000..e55733d25ecfc6237aa8052c1fc2b7e3f356da23
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/mpl.css
@@ -0,0 +1,84 @@
+/* General styling */
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+ content: "";
+ display: table;
+ border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+ clear: both;
+}
+
+/* Header */
+.ui-widget-header {
+ border: 1px solid #dddddd;
+ border-top-left-radius: 6px;
+ border-top-right-radius: 6px;
+ background: #e9e9e9;
+ color: #333333;
+ font-weight: bold;
+}
+
+/* Toolbar and items */
+.mpl-toolbar {
+ width: 100%;
+}
+
+.mpl-toolbar div.mpl-button-group {
+ display: inline-block;
+}
+
+.mpl-button-group + .mpl-button-group {
+ margin-left: 0.5em;
+}
+
+.mpl-widget {
+ background-color: #fff;
+ border: 1px solid #ccc;
+ display: inline-block;
+ cursor: pointer;
+ color: #333;
+ padding: 6px;
+ vertical-align: middle;
+}
+
+.mpl-widget:disabled,
+.mpl-widget[disabled] {
+ background-color: #ddd;
+ border-color: #ddd !important;
+ cursor: not-allowed;
+}
+
+.mpl-widget:disabled img,
+.mpl-widget[disabled] img {
+ /* Convert black to grey */
+ filter: contrast(0%);
+}
+
+.mpl-widget.active img {
+ /* Convert black to tab:blue, approximately */
+ filter: invert(34%) sepia(97%) saturate(468%) hue-rotate(162deg) brightness(96%) contrast(91%);
+}
+
+button.mpl-widget:focus,
+button.mpl-widget:hover {
+ background-color: #ddd;
+ border-color: #aaa;
+}
+
+.mpl-button-group button.mpl-widget {
+ margin-left: -1px;
+}
+.mpl-button-group button.mpl-widget:first-child {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px;
+ margin-left: 0px;
+}
+.mpl-button-group button.mpl-widget:last-child {
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px;
+}
+
+select.mpl-widget {
+ cursor: default;
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/page.css b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/page.css
new file mode 100644
index 0000000000000000000000000000000000000000..ded0d92203790eaaab21feea83930611acec51f0
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/css/page.css
@@ -0,0 +1,82 @@
+/**
+ * Primary styles
+ *
+ * Author: IPython Development Team
+ */
+
+
+body {
+ background-color: white;
+ /* This makes sure that the body covers the entire window and needs to
+ be in a different element than the display: box in wrapper below */
+ position: absolute;
+ left: 0px;
+ right: 0px;
+ top: 0px;
+ bottom: 0px;
+ overflow: visible;
+}
+
+
+div#header {
+ /* Initially hidden to prevent FLOUC */
+ display: none;
+ position: relative;
+ height: 40px;
+ padding: 5px;
+ margin: 0px;
+ width: 100%;
+}
+
+span#ipython_notebook {
+ position: absolute;
+ padding: 2px 2px 2px 5px;
+}
+
+span#ipython_notebook img {
+ font-family: Verdana, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
+ height: 24px;
+ text-decoration:none;
+ display: inline;
+ color: black;
+}
+
+#site {
+ width: 100%;
+ display: none;
+}
+
+/* We set the fonts by hand here to override the values in the theme */
+.ui-widget {
+ font-family: "Lucinda Grande", "Lucinda Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
+}
+
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button {
+ font-family: "Lucinda Grande", "Lucinda Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
+}
+
+/* Smaller buttons */
+.ui-button .ui-button-text {
+ padding: 0.2em 0.8em;
+ font-size: 77%;
+}
+
+input.ui-button {
+ padding: 0.3em 0.9em;
+}
+
+span#login_widget {
+ float: right;
+}
+
+.border-box-sizing {
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+}
+
+#figure-div {
+ display: inline-block;
+ margin: 10px;
+ vertical-align: top;
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/ipython_inline_figure.html b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/ipython_inline_figure.html
new file mode 100644
index 0000000000000000000000000000000000000000..b941d352a7d6ca1351b7fb9879386c2d391e9be7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/ipython_inline_figure.html
@@ -0,0 +1,34 @@
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/mpl.js b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/mpl.js
new file mode 100644
index 0000000000000000000000000000000000000000..2d1f383e9839508df2ec05201b8d7cf8dae767ba
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/mpl.js
@@ -0,0 +1,705 @@
+/* Put everything inside the global mpl namespace */
+/* global mpl */
+window.mpl = {};
+
+mpl.get_websocket_type = function () {
+ if (typeof WebSocket !== 'undefined') {
+ return WebSocket;
+ } else if (typeof MozWebSocket !== 'undefined') {
+ return MozWebSocket;
+ } else {
+ alert(
+ 'Your browser does not have WebSocket support. ' +
+ 'Please try Chrome, Safari or Firefox ā„ 6. ' +
+ 'Firefox 4 and 5 are also supported but you ' +
+ 'have to enable WebSockets in about:config.'
+ );
+ }
+};
+
+mpl.figure = function (figure_id, websocket, ondownload, parent_element) {
+ this.id = figure_id;
+
+ this.ws = websocket;
+
+ this.supports_binary = this.ws.binaryType !== undefined;
+
+ if (!this.supports_binary) {
+ var warnings = document.getElementById('mpl-warnings');
+ if (warnings) {
+ warnings.style.display = 'block';
+ warnings.textContent =
+ 'This browser does not support binary websocket messages. ' +
+ 'Performance may be slow.';
+ }
+ }
+
+ this.imageObj = new Image();
+
+ this.context = undefined;
+ this.message = undefined;
+ this.canvas = undefined;
+ this.rubberband_canvas = undefined;
+ this.rubberband_context = undefined;
+ this.format_dropdown = undefined;
+
+ this.image_mode = 'full';
+
+ this.root = document.createElement('div');
+ this.root.setAttribute('style', 'display: inline-block');
+ this._root_extra_style(this.root);
+
+ parent_element.appendChild(this.root);
+
+ this._init_header(this);
+ this._init_canvas(this);
+ this._init_toolbar(this);
+
+ var fig = this;
+
+ this.waiting = false;
+
+ this.ws.onopen = function () {
+ fig.send_message('supports_binary', { value: fig.supports_binary });
+ fig.send_message('send_image_mode', {});
+ if (fig.ratio !== 1) {
+ fig.send_message('set_device_pixel_ratio', {
+ device_pixel_ratio: fig.ratio,
+ });
+ }
+ fig.send_message('refresh', {});
+ };
+
+ this.imageObj.onload = function () {
+ if (fig.image_mode === 'full') {
+ // Full images could contain transparency (where diff images
+ // almost always do), so we need to clear the canvas so that
+ // there is no ghosting.
+ fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);
+ }
+ fig.context.drawImage(fig.imageObj, 0, 0);
+ };
+
+ this.imageObj.onunload = function () {
+ fig.ws.close();
+ };
+
+ this.ws.onmessage = this._make_on_message_function(this);
+
+ this.ondownload = ondownload;
+};
+
+mpl.figure.prototype._init_header = function () {
+ var titlebar = document.createElement('div');
+ titlebar.classList =
+ 'ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix';
+ var titletext = document.createElement('div');
+ titletext.classList = 'ui-dialog-title';
+ titletext.setAttribute(
+ 'style',
+ 'width: 100%; text-align: center; padding: 3px;'
+ );
+ titlebar.appendChild(titletext);
+ this.root.appendChild(titlebar);
+ this.header = titletext;
+};
+
+mpl.figure.prototype._canvas_extra_style = function (_canvas_div) {};
+
+mpl.figure.prototype._root_extra_style = function (_canvas_div) {};
+
+mpl.figure.prototype._init_canvas = function () {
+ var fig = this;
+
+ var canvas_div = (this.canvas_div = document.createElement('div'));
+ canvas_div.setAttribute('tabindex', '0');
+ canvas_div.setAttribute(
+ 'style',
+ 'border: 1px solid #ddd;' +
+ 'box-sizing: content-box;' +
+ 'clear: both;' +
+ 'min-height: 1px;' +
+ 'min-width: 1px;' +
+ 'outline: 0;' +
+ 'overflow: hidden;' +
+ 'position: relative;' +
+ 'resize: both;' +
+ 'z-index: 2;'
+ );
+
+ function on_keyboard_event_closure(name) {
+ return function (event) {
+ return fig.key_event(event, name);
+ };
+ }
+
+ canvas_div.addEventListener(
+ 'keydown',
+ on_keyboard_event_closure('key_press')
+ );
+ canvas_div.addEventListener(
+ 'keyup',
+ on_keyboard_event_closure('key_release')
+ );
+
+ this._canvas_extra_style(canvas_div);
+ this.root.appendChild(canvas_div);
+
+ var canvas = (this.canvas = document.createElement('canvas'));
+ canvas.classList.add('mpl-canvas');
+ canvas.setAttribute(
+ 'style',
+ 'box-sizing: content-box;' +
+ 'pointer-events: none;' +
+ 'position: relative;' +
+ 'z-index: 0;'
+ );
+
+ this.context = canvas.getContext('2d');
+
+ var backingStore =
+ this.context.backingStorePixelRatio ||
+ this.context.webkitBackingStorePixelRatio ||
+ this.context.mozBackingStorePixelRatio ||
+ this.context.msBackingStorePixelRatio ||
+ this.context.oBackingStorePixelRatio ||
+ this.context.backingStorePixelRatio ||
+ 1;
+
+ this.ratio = (window.devicePixelRatio || 1) / backingStore;
+
+ var rubberband_canvas = (this.rubberband_canvas = document.createElement(
+ 'canvas'
+ ));
+ rubberband_canvas.setAttribute(
+ 'style',
+ 'box-sizing: content-box;' +
+ 'left: 0;' +
+ 'pointer-events: none;' +
+ 'position: absolute;' +
+ 'top: 0;' +
+ 'z-index: 1;'
+ );
+
+ // Apply a ponyfill if ResizeObserver is not implemented by browser.
+ if (this.ResizeObserver === undefined) {
+ if (window.ResizeObserver !== undefined) {
+ this.ResizeObserver = window.ResizeObserver;
+ } else {
+ var obs = _JSXTOOLS_RESIZE_OBSERVER({});
+ this.ResizeObserver = obs.ResizeObserver;
+ }
+ }
+
+ this.resizeObserverInstance = new this.ResizeObserver(function (entries) {
+ // There's no need to resize if the WebSocket is not connected:
+ // - If it is still connecting, then we will get an initial resize from
+ // Python once it connects.
+ // - If it has disconnected, then resizing will clear the canvas and
+ // never get anything back to refill it, so better to not resize and
+ // keep something visible.
+ if (fig.ws.readyState != 1) {
+ return;
+ }
+ var nentries = entries.length;
+ for (var i = 0; i < nentries; i++) {
+ var entry = entries[i];
+ var width, height;
+ if (entry.contentBoxSize) {
+ if (entry.contentBoxSize instanceof Array) {
+ // Chrome 84 implements new version of spec.
+ width = entry.contentBoxSize[0].inlineSize;
+ height = entry.contentBoxSize[0].blockSize;
+ } else {
+ // Firefox implements old version of spec.
+ width = entry.contentBoxSize.inlineSize;
+ height = entry.contentBoxSize.blockSize;
+ }
+ } else {
+ // Chrome <84 implements even older version of spec.
+ width = entry.contentRect.width;
+ height = entry.contentRect.height;
+ }
+
+ // Keep the size of the canvas and rubber band canvas in sync with
+ // the canvas container.
+ if (entry.devicePixelContentBoxSize) {
+ // Chrome 84 implements new version of spec.
+ canvas.setAttribute(
+ 'width',
+ entry.devicePixelContentBoxSize[0].inlineSize
+ );
+ canvas.setAttribute(
+ 'height',
+ entry.devicePixelContentBoxSize[0].blockSize
+ );
+ } else {
+ canvas.setAttribute('width', width * fig.ratio);
+ canvas.setAttribute('height', height * fig.ratio);
+ }
+ /* This rescales the canvas back to display pixels, so that it
+ * appears correct on HiDPI screens. */
+ canvas.style.width = width + 'px';
+ canvas.style.height = height + 'px';
+
+ rubberband_canvas.setAttribute('width', width);
+ rubberband_canvas.setAttribute('height', height);
+
+ // And update the size in Python. We ignore the initial 0/0 size
+ // that occurs as the element is placed into the DOM, which should
+ // otherwise not happen due to the minimum size styling.
+ if (width != 0 && height != 0) {
+ fig.request_resize(width, height);
+ }
+ }
+ });
+ this.resizeObserverInstance.observe(canvas_div);
+
+ function on_mouse_event_closure(name) {
+ /* User Agent sniffing is bad, but WebKit is busted:
+ * https://bugs.webkit.org/show_bug.cgi?id=144526
+ * https://bugs.webkit.org/show_bug.cgi?id=181818
+ * The worst that happens here is that they get an extra browser
+ * selection when dragging, if this check fails to catch them.
+ */
+ var UA = navigator.userAgent;
+ var isWebKit = /AppleWebKit/.test(UA) && !/Chrome/.test(UA);
+ if(isWebKit) {
+ return function (event) {
+ /* This prevents the web browser from automatically changing to
+ * the text insertion cursor when the button is pressed. We
+ * want to control all of the cursor setting manually through
+ * the 'cursor' event from matplotlib */
+ event.preventDefault()
+ return fig.mouse_event(event, name);
+ };
+ } else {
+ return function (event) {
+ return fig.mouse_event(event, name);
+ };
+ }
+ }
+
+ canvas_div.addEventListener(
+ 'mousedown',
+ on_mouse_event_closure('button_press')
+ );
+ canvas_div.addEventListener(
+ 'mouseup',
+ on_mouse_event_closure('button_release')
+ );
+ canvas_div.addEventListener(
+ 'dblclick',
+ on_mouse_event_closure('dblclick')
+ );
+ // Throttle sequential mouse events to 1 every 20ms.
+ canvas_div.addEventListener(
+ 'mousemove',
+ on_mouse_event_closure('motion_notify')
+ );
+
+ canvas_div.addEventListener(
+ 'mouseenter',
+ on_mouse_event_closure('figure_enter')
+ );
+ canvas_div.addEventListener(
+ 'mouseleave',
+ on_mouse_event_closure('figure_leave')
+ );
+
+ canvas_div.addEventListener('wheel', function (event) {
+ if (event.deltaY < 0) {
+ event.step = 1;
+ } else {
+ event.step = -1;
+ }
+ on_mouse_event_closure('scroll')(event);
+ });
+
+ canvas_div.appendChild(canvas);
+ canvas_div.appendChild(rubberband_canvas);
+
+ this.rubberband_context = rubberband_canvas.getContext('2d');
+ this.rubberband_context.strokeStyle = '#000000';
+
+ this._resize_canvas = function (width, height, forward) {
+ if (forward) {
+ canvas_div.style.width = width + 'px';
+ canvas_div.style.height = height + 'px';
+ }
+ };
+
+ // Disable right mouse context menu.
+ canvas_div.addEventListener('contextmenu', function (_e) {
+ event.preventDefault();
+ return false;
+ });
+
+ function set_focus() {
+ canvas.focus();
+ canvas_div.focus();
+ }
+
+ window.setTimeout(set_focus, 100);
+};
+
+mpl.figure.prototype._init_toolbar = function () {
+ var fig = this;
+
+ var toolbar = document.createElement('div');
+ toolbar.classList = 'mpl-toolbar';
+ this.root.appendChild(toolbar);
+
+ function on_click_closure(name) {
+ return function (_event) {
+ return fig.toolbar_button_onclick(name);
+ };
+ }
+
+ function on_mouseover_closure(tooltip) {
+ return function (event) {
+ if (!event.currentTarget.disabled) {
+ return fig.toolbar_button_onmouseover(tooltip);
+ }
+ };
+ }
+
+ fig.buttons = {};
+ var buttonGroup = document.createElement('div');
+ buttonGroup.classList = 'mpl-button-group';
+ for (var toolbar_ind in mpl.toolbar_items) {
+ var name = mpl.toolbar_items[toolbar_ind][0];
+ var tooltip = mpl.toolbar_items[toolbar_ind][1];
+ var image = mpl.toolbar_items[toolbar_ind][2];
+ var method_name = mpl.toolbar_items[toolbar_ind][3];
+
+ if (!name) {
+ /* Instead of a spacer, we start a new button group. */
+ if (buttonGroup.hasChildNodes()) {
+ toolbar.appendChild(buttonGroup);
+ }
+ buttonGroup = document.createElement('div');
+ buttonGroup.classList = 'mpl-button-group';
+ continue;
+ }
+
+ var button = (fig.buttons[name] = document.createElement('button'));
+ button.classList = 'mpl-widget';
+ button.setAttribute('role', 'button');
+ button.setAttribute('aria-disabled', 'false');
+ button.addEventListener('click', on_click_closure(method_name));
+ button.addEventListener('mouseover', on_mouseover_closure(tooltip));
+
+ var icon_img = document.createElement('img');
+ icon_img.src = '_images/' + image + '.png';
+ icon_img.srcset = '_images/' + image + '_large.png 2x';
+ icon_img.alt = tooltip;
+ button.appendChild(icon_img);
+
+ buttonGroup.appendChild(button);
+ }
+
+ if (buttonGroup.hasChildNodes()) {
+ toolbar.appendChild(buttonGroup);
+ }
+
+ var fmt_picker = document.createElement('select');
+ fmt_picker.classList = 'mpl-widget';
+ toolbar.appendChild(fmt_picker);
+ this.format_dropdown = fmt_picker;
+
+ for (var ind in mpl.extensions) {
+ var fmt = mpl.extensions[ind];
+ var option = document.createElement('option');
+ option.selected = fmt === mpl.default_extension;
+ option.innerHTML = fmt;
+ fmt_picker.appendChild(option);
+ }
+
+ var status_bar = document.createElement('span');
+ status_bar.classList = 'mpl-message';
+ toolbar.appendChild(status_bar);
+ this.message = status_bar;
+};
+
+mpl.figure.prototype.request_resize = function (x_pixels, y_pixels) {
+ // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,
+ // which will in turn request a refresh of the image.
+ this.send_message('resize', { width: x_pixels, height: y_pixels });
+};
+
+mpl.figure.prototype.send_message = function (type, properties) {
+ properties['type'] = type;
+ properties['figure_id'] = this.id;
+ this.ws.send(JSON.stringify(properties));
+};
+
+mpl.figure.prototype.send_draw_message = function () {
+ if (!this.waiting) {
+ this.waiting = true;
+ this.ws.send(JSON.stringify({ type: 'draw', figure_id: this.id }));
+ }
+};
+
+mpl.figure.prototype.handle_save = function (fig, _msg) {
+ var format_dropdown = fig.format_dropdown;
+ var format = format_dropdown.options[format_dropdown.selectedIndex].value;
+ fig.ondownload(fig, format);
+};
+
+mpl.figure.prototype.handle_resize = function (fig, msg) {
+ var size = msg['size'];
+ if (size[0] !== fig.canvas.width || size[1] !== fig.canvas.height) {
+ fig._resize_canvas(size[0], size[1], msg['forward']);
+ fig.send_message('refresh', {});
+ }
+};
+
+mpl.figure.prototype.handle_rubberband = function (fig, msg) {
+ var x0 = msg['x0'] / fig.ratio;
+ var y0 = (fig.canvas.height - msg['y0']) / fig.ratio;
+ var x1 = msg['x1'] / fig.ratio;
+ var y1 = (fig.canvas.height - msg['y1']) / fig.ratio;
+ x0 = Math.floor(x0) + 0.5;
+ y0 = Math.floor(y0) + 0.5;
+ x1 = Math.floor(x1) + 0.5;
+ y1 = Math.floor(y1) + 0.5;
+ var min_x = Math.min(x0, x1);
+ var min_y = Math.min(y0, y1);
+ var width = Math.abs(x1 - x0);
+ var height = Math.abs(y1 - y0);
+
+ fig.rubberband_context.clearRect(
+ 0,
+ 0,
+ fig.canvas.width / fig.ratio,
+ fig.canvas.height / fig.ratio
+ );
+
+ fig.rubberband_context.strokeRect(min_x, min_y, width, height);
+};
+
+mpl.figure.prototype.handle_figure_label = function (fig, msg) {
+ // Updates the figure title.
+ fig.header.textContent = msg['label'];
+};
+
+mpl.figure.prototype.handle_cursor = function (fig, msg) {
+ fig.canvas_div.style.cursor = msg['cursor'];
+};
+
+mpl.figure.prototype.handle_message = function (fig, msg) {
+ fig.message.textContent = msg['message'];
+};
+
+mpl.figure.prototype.handle_draw = function (fig, _msg) {
+ // Request the server to send over a new figure.
+ fig.send_draw_message();
+};
+
+mpl.figure.prototype.handle_image_mode = function (fig, msg) {
+ fig.image_mode = msg['mode'];
+};
+
+mpl.figure.prototype.handle_history_buttons = function (fig, msg) {
+ for (var key in msg) {
+ if (!(key in fig.buttons)) {
+ continue;
+ }
+ fig.buttons[key].disabled = !msg[key];
+ fig.buttons[key].setAttribute('aria-disabled', !msg[key]);
+ }
+};
+
+mpl.figure.prototype.handle_navigate_mode = function (fig, msg) {
+ if (msg['mode'] === 'PAN') {
+ fig.buttons['Pan'].classList.add('active');
+ fig.buttons['Zoom'].classList.remove('active');
+ } else if (msg['mode'] === 'ZOOM') {
+ fig.buttons['Pan'].classList.remove('active');
+ fig.buttons['Zoom'].classList.add('active');
+ } else {
+ fig.buttons['Pan'].classList.remove('active');
+ fig.buttons['Zoom'].classList.remove('active');
+ }
+};
+
+mpl.figure.prototype.updated_canvas_event = function () {
+ // Called whenever the canvas gets updated.
+ this.send_message('ack', {});
+};
+
+// A function to construct a web socket function for onmessage handling.
+// Called in the figure constructor.
+mpl.figure.prototype._make_on_message_function = function (fig) {
+ return function socket_on_message(evt) {
+ if (evt.data instanceof Blob) {
+ var img = evt.data;
+ if (img.type !== 'image/png') {
+ /* FIXME: We get "Resource interpreted as Image but
+ * transferred with MIME type text/plain:" errors on
+ * Chrome. But how to set the MIME type? It doesn't seem
+ * to be part of the websocket stream */
+ img.type = 'image/png';
+ }
+
+ /* Free the memory for the previous frames */
+ if (fig.imageObj.src) {
+ (window.URL || window.webkitURL).revokeObjectURL(
+ fig.imageObj.src
+ );
+ }
+
+ fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(
+ img
+ );
+ fig.updated_canvas_event();
+ fig.waiting = false;
+ return;
+ } else if (
+ typeof evt.data === 'string' &&
+ evt.data.slice(0, 21) === 'data:image/png;base64'
+ ) {
+ fig.imageObj.src = evt.data;
+ fig.updated_canvas_event();
+ fig.waiting = false;
+ return;
+ }
+
+ var msg = JSON.parse(evt.data);
+ var msg_type = msg['type'];
+
+ // Call the "handle_{type}" callback, which takes
+ // the figure and JSON message as its only arguments.
+ try {
+ var callback = fig['handle_' + msg_type];
+ } catch (e) {
+ console.log(
+ "No handler for the '" + msg_type + "' message type: ",
+ msg
+ );
+ return;
+ }
+
+ if (callback) {
+ try {
+ // console.log("Handling '" + msg_type + "' message: ", msg);
+ callback(fig, msg);
+ } catch (e) {
+ console.log(
+ "Exception inside the 'handler_" + msg_type + "' callback:",
+ e,
+ e.stack,
+ msg
+ );
+ }
+ }
+ };
+};
+
+function getModifiers(event) {
+ var mods = [];
+ if (event.ctrlKey) {
+ mods.push('ctrl');
+ }
+ if (event.altKey) {
+ mods.push('alt');
+ }
+ if (event.shiftKey) {
+ mods.push('shift');
+ }
+ if (event.metaKey) {
+ mods.push('meta');
+ }
+ return mods;
+}
+
+/*
+ * return a copy of an object with only non-object keys
+ * we need this to avoid circular references
+ * https://stackoverflow.com/a/24161582/3208463
+ */
+function simpleKeys(original) {
+ return Object.keys(original).reduce(function (obj, key) {
+ if (typeof original[key] !== 'object') {
+ obj[key] = original[key];
+ }
+ return obj;
+ }, {});
+}
+
+mpl.figure.prototype.mouse_event = function (event, name) {
+ if (name === 'button_press') {
+ this.canvas.focus();
+ this.canvas_div.focus();
+ }
+
+ // from https://stackoverflow.com/q/1114465
+ var boundingRect = this.canvas.getBoundingClientRect();
+ var x = (event.clientX - boundingRect.left) * this.ratio;
+ var y = (event.clientY - boundingRect.top) * this.ratio;
+
+ this.send_message(name, {
+ x: x,
+ y: y,
+ button: event.button,
+ step: event.step,
+ buttons: event.buttons,
+ modifiers: getModifiers(event),
+ guiEvent: simpleKeys(event),
+ });
+
+ return false;
+};
+
+mpl.figure.prototype._key_event_extra = function (_event, _name) {
+ // Handle any extra behaviour associated with a key event
+};
+
+mpl.figure.prototype.key_event = function (event, name) {
+ // Prevent repeat events
+ if (name === 'key_press') {
+ if (event.key === this._key) {
+ return;
+ } else {
+ this._key = event.key;
+ }
+ }
+ if (name === 'key_release') {
+ this._key = null;
+ }
+
+ var value = '';
+ if (event.ctrlKey && event.key !== 'Control') {
+ value += 'ctrl+';
+ }
+ else if (event.altKey && event.key !== 'Alt') {
+ value += 'alt+';
+ }
+ else if (event.shiftKey && event.key !== 'Shift') {
+ value += 'shift+';
+ }
+
+ value += 'k' + event.key;
+
+ this._key_event_extra(event, name);
+
+ this.send_message(name, { key: value, guiEvent: simpleKeys(event) });
+ return false;
+};
+
+mpl.figure.prototype.toolbar_button_onclick = function (name) {
+ if (name === 'download') {
+ this.handle_save(this, null);
+ } else {
+ this.send_message('toolbar_button', { name: name });
+ }
+};
+
+mpl.figure.prototype.toolbar_button_onmouseover = function (tooltip) {
+ this.message.textContent = tooltip;
+};
+
+///////////////// REMAINING CONTENT GENERATED BY embed_js.py /////////////////
+// prettier-ignore
+var _JSXTOOLS_RESIZE_OBSERVER=function(A){var t,i=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,o=new Set;function s(e){if(!(this instanceof s))throw new TypeError("Constructor requires 'new' operator");i.set(this,e)}function h(){throw new TypeError("Function is not a constructor")}function c(e,t,i,n){e=0 in arguments?Number(arguments[0]):0,t=1 in arguments?Number(arguments[1]):0,i=2 in arguments?Number(arguments[2]):0,n=3 in arguments?Number(arguments[3]):0,this.right=(this.x=this.left=e)+(this.width=i),this.bottom=(this.y=this.top=t)+(this.height=n),Object.freeze(this)}function d(){t=requestAnimationFrame(d);var s=new WeakMap,p=new Set;o.forEach((function(t){r.get(t).forEach((function(i){var r=t instanceof window.SVGElement,o=a.get(t),d=r?0:parseFloat(o.paddingTop),f=r?0:parseFloat(o.paddingRight),l=r?0:parseFloat(o.paddingBottom),u=r?0:parseFloat(o.paddingLeft),g=r?0:parseFloat(o.borderTopWidth),m=r?0:parseFloat(o.borderRightWidth),w=r?0:parseFloat(o.borderBottomWidth),b=u+f,F=d+l,v=(r?0:parseFloat(o.borderLeftWidth))+m,W=g+w,y=r?0:t.offsetHeight-W-t.clientHeight,E=r?0:t.offsetWidth-v-t.clientWidth,R=b+v,z=F+W,M=r?t.width:parseFloat(o.width)-R-E,O=r?t.height:parseFloat(o.height)-z-y;if(n.has(t)){var k=n.get(t);if(k[0]===M&&k[1]===O)return}n.set(t,[M,O]);var S=Object.create(h.prototype);S.target=t,S.contentRect=new c(u,d,M,O),s.has(i)||(s.set(i,[]),p.add(i)),s.get(i).push(S)}))})),p.forEach((function(e){i.get(e).call(e,s.get(e),e)}))}return s.prototype.observe=function(i){if(i instanceof window.Element){r.has(i)||(r.set(i,new Set),o.add(i),a.set(i,window.getComputedStyle(i)));var n=r.get(i);n.has(this)||n.add(this),cancelAnimationFrame(t),t=requestAnimationFrame(d)}},s.prototype.unobserve=function(i){if(i instanceof window.Element&&r.has(i)){var n=r.get(i);n.has(this)&&(n.delete(this),n.size||(r.delete(i),o.delete(i))),n.size||r.delete(i),o.size||cancelAnimationFrame(t)}},A.DOMRectReadOnly=c,A.ResizeObserver=s,A.ResizeObserverEntry=h,A}; // eslint-disable-line
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/mpl_tornado.js b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/mpl_tornado.js
new file mode 100644
index 0000000000000000000000000000000000000000..b3cab8b7b906d95fcfe221bf3aaf04722004f7a6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/mpl_tornado.js
@@ -0,0 +1,8 @@
+/* This .js file contains functions for matplotlib's built-in
+ tornado-based server, that are not relevant when embedding WebAgg
+ in another web application. */
+
+/* exported mpl_ondownload */
+function mpl_ondownload(figure, format) {
+ window.open(figure.id + '/download.' + format, '_blank');
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/nbagg_mpl.js b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/nbagg_mpl.js
new file mode 100644
index 0000000000000000000000000000000000000000..26d79ff4e1da11d3c362f748e75b22026cc8438a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/js/nbagg_mpl.js
@@ -0,0 +1,275 @@
+/* global mpl */
+
+var comm_websocket_adapter = function (comm) {
+ // Create a "websocket"-like object which calls the given IPython comm
+ // object with the appropriate methods. Currently this is a non binary
+ // socket, so there is still some room for performance tuning.
+ var ws = {};
+
+ ws.binaryType = comm.kernel.ws.binaryType;
+ ws.readyState = comm.kernel.ws.readyState;
+ function updateReadyState(_event) {
+ if (comm.kernel.ws) {
+ ws.readyState = comm.kernel.ws.readyState;
+ } else {
+ ws.readyState = 3; // Closed state.
+ }
+ }
+ comm.kernel.ws.addEventListener('open', updateReadyState);
+ comm.kernel.ws.addEventListener('close', updateReadyState);
+ comm.kernel.ws.addEventListener('error', updateReadyState);
+
+ ws.close = function () {
+ comm.close();
+ };
+ ws.send = function (m) {
+ //console.log('sending', m);
+ comm.send(m);
+ };
+ // Register the callback with on_msg.
+ comm.on_msg(function (msg) {
+ //console.log('receiving', msg['content']['data'], msg);
+ var data = msg['content']['data'];
+ if (data['blob'] !== undefined) {
+ data = {
+ data: new Blob(msg['buffers'], { type: data['blob'] }),
+ };
+ }
+ // Pass the mpl event to the overridden (by mpl) onmessage function.
+ ws.onmessage(data);
+ });
+ return ws;
+};
+
+mpl.mpl_figure_comm = function (comm, msg) {
+ // This is the function which gets called when the mpl process
+ // starts-up an IPython Comm through the "matplotlib" channel.
+
+ var id = msg.content.data.id;
+ // Get hold of the div created by the display call when the Comm
+ // socket was opened in Python.
+ var element = document.getElementById(id);
+ var ws_proxy = comm_websocket_adapter(comm);
+
+ function ondownload(figure, _format) {
+ window.open(figure.canvas.toDataURL());
+ }
+
+ var fig = new mpl.figure(id, ws_proxy, ondownload, element);
+
+ // Call onopen now - mpl needs it, as it is assuming we've passed it a real
+ // web socket which is closed, not our websocket->open comm proxy.
+ ws_proxy.onopen();
+
+ fig.parent_element = element;
+ fig.cell_info = mpl.find_output_cell("
");
+ if (!fig.cell_info) {
+ console.error('Failed to find cell for figure', id, fig);
+ return;
+ }
+ fig.cell_info[0].output_area.element.on(
+ 'cleared',
+ { fig: fig },
+ fig._remove_fig_handler
+ );
+};
+
+mpl.figure.prototype.handle_close = function (fig, msg) {
+ var width = fig.canvas.width / fig.ratio;
+ fig.cell_info[0].output_area.element.off(
+ 'cleared',
+ fig._remove_fig_handler
+ );
+ fig.resizeObserverInstance.unobserve(fig.canvas_div);
+
+ // Update the output cell to use the data from the current canvas.
+ fig.push_to_output();
+ var dataURL = fig.canvas.toDataURL();
+ // Re-enable the keyboard manager in IPython - without this line, in FF,
+ // the notebook keyboard shortcuts fail.
+ IPython.keyboard_manager.enable();
+ fig.parent_element.innerHTML =
+ ' ';
+ fig.close_ws(fig, msg);
+};
+
+mpl.figure.prototype.close_ws = function (fig, msg) {
+ fig.send_message('closing', msg);
+ // fig.ws.close()
+};
+
+mpl.figure.prototype.push_to_output = function (_remove_interactive) {
+ // Turn the data on the canvas into data in the output cell.
+ var width = this.canvas.width / this.ratio;
+ var dataURL = this.canvas.toDataURL();
+ this.cell_info[1]['text/html'] =
+ ' ';
+};
+
+mpl.figure.prototype.updated_canvas_event = function () {
+ // Tell IPython that the notebook contents must change.
+ IPython.notebook.set_dirty(true);
+ this.send_message('ack', {});
+ var fig = this;
+ // Wait a second, then push the new image to the DOM so
+ // that it is saved nicely (might be nice to debounce this).
+ setTimeout(function () {
+ fig.push_to_output();
+ }, 1000);
+};
+
+mpl.figure.prototype._init_toolbar = function () {
+ var fig = this;
+
+ var toolbar = document.createElement('div');
+ toolbar.classList = 'btn-toolbar';
+ this.root.appendChild(toolbar);
+
+ function on_click_closure(name) {
+ return function (_event) {
+ return fig.toolbar_button_onclick(name);
+ };
+ }
+
+ function on_mouseover_closure(tooltip) {
+ return function (event) {
+ if (!event.currentTarget.disabled) {
+ return fig.toolbar_button_onmouseover(tooltip);
+ }
+ };
+ }
+
+ fig.buttons = {};
+ var buttonGroup = document.createElement('div');
+ buttonGroup.classList = 'btn-group';
+ var button;
+ for (var toolbar_ind in mpl.toolbar_items) {
+ var name = mpl.toolbar_items[toolbar_ind][0];
+ var tooltip = mpl.toolbar_items[toolbar_ind][1];
+ var image = mpl.toolbar_items[toolbar_ind][2];
+ var method_name = mpl.toolbar_items[toolbar_ind][3];
+
+ if (!name) {
+ /* Instead of a spacer, we start a new button group. */
+ if (buttonGroup.hasChildNodes()) {
+ toolbar.appendChild(buttonGroup);
+ }
+ buttonGroup = document.createElement('div');
+ buttonGroup.classList = 'btn-group';
+ continue;
+ }
+
+ button = fig.buttons[name] = document.createElement('button');
+ button.classList = 'btn btn-default';
+ button.href = '#';
+ button.title = name;
+ button.innerHTML = ' ';
+ button.addEventListener('click', on_click_closure(method_name));
+ button.addEventListener('mouseover', on_mouseover_closure(tooltip));
+ buttonGroup.appendChild(button);
+ }
+
+ if (buttonGroup.hasChildNodes()) {
+ toolbar.appendChild(buttonGroup);
+ }
+
+ // Add the status bar.
+ var status_bar = document.createElement('span');
+ status_bar.classList = 'mpl-message pull-right';
+ toolbar.appendChild(status_bar);
+ this.message = status_bar;
+
+ // Add the close button to the window.
+ var buttongrp = document.createElement('div');
+ buttongrp.classList = 'btn-group inline pull-right';
+ button = document.createElement('button');
+ button.classList = 'btn btn-mini btn-primary';
+ button.href = '#';
+ button.title = 'Stop Interaction';
+ button.innerHTML = ' ';
+ button.addEventListener('click', function (_evt) {
+ fig.handle_close(fig, {});
+ });
+ button.addEventListener(
+ 'mouseover',
+ on_mouseover_closure('Stop Interaction')
+ );
+ buttongrp.appendChild(button);
+ var titlebar = this.root.querySelector('.ui-dialog-titlebar');
+ titlebar.insertBefore(buttongrp, titlebar.firstChild);
+};
+
+mpl.figure.prototype._remove_fig_handler = function (event) {
+ var fig = event.data.fig;
+ if (event.target !== this) {
+ // Ignore bubbled events from children.
+ return;
+ }
+ fig.close_ws(fig, {});
+};
+
+mpl.figure.prototype._root_extra_style = function (el) {
+ el.style.boxSizing = 'content-box'; // override notebook setting of border-box.
+};
+
+mpl.figure.prototype._canvas_extra_style = function (el) {
+ // this is important to make the div 'focusable
+ el.setAttribute('tabindex', 0);
+ // reach out to IPython and tell the keyboard manager to turn it's self
+ // off when our div gets focus
+
+ // location in version 3
+ if (IPython.notebook.keyboard_manager) {
+ IPython.notebook.keyboard_manager.register_events(el);
+ } else {
+ // location in version 2
+ IPython.keyboard_manager.register_events(el);
+ }
+};
+
+mpl.figure.prototype._key_event_extra = function (event, _name) {
+ // Check for shift+enter
+ if (event.shiftKey && event.which === 13) {
+ this.canvas_div.blur();
+ // select the cell after this one
+ var index = IPython.notebook.find_cell_index(this.cell_info[0]);
+ IPython.notebook.select(index + 1);
+ }
+};
+
+mpl.figure.prototype.handle_save = function (fig, _msg) {
+ fig.ondownload(fig, null);
+};
+
+mpl.find_output_cell = function (html_output) {
+ // Return the cell and output element which can be found *uniquely* in the notebook.
+ // Note - this is a bit hacky, but it is done because the "notebook_saving.Notebook"
+ // IPython event is triggered only after the cells have been serialised, which for
+ // our purposes (turning an active figure into a static one), is too late.
+ var cells = IPython.notebook.get_cells();
+ var ncells = cells.length;
+ for (var i = 0; i < ncells; i++) {
+ var cell = cells[i];
+ if (cell.cell_type === 'code') {
+ for (var j = 0; j < cell.output_area.outputs.length; j++) {
+ var data = cell.output_area.outputs[j];
+ if (data.data) {
+ // IPython >= 3 moved mimebundle to data attribute of output
+ data = data.data;
+ }
+ if (data['text/html'] === html_output) {
+ return [cell, data, j];
+ }
+ }
+ }
+ }
+};
+
+// Register the function which deals with the matplotlib target/channel.
+// The kernel may be null if the page has been refreshed.
+if (IPython.notebook.kernel !== null) {
+ IPython.notebook.kernel.comm_manager.register_target(
+ 'matplotlib',
+ mpl.mpl_figure_comm
+ );
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/single_figure.html b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/single_figure.html
new file mode 100644
index 0000000000000000000000000000000000000000..ceaaab00669ff62e0724eff610dcb74adcff1674
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/backends/web_backend/single_figure.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+ matplotlib
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/bezier.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/bezier.py
new file mode 100644
index 0000000000000000000000000000000000000000..42a6b478d729f3b2837e11e6767b84ac5972654d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/bezier.py
@@ -0,0 +1,602 @@
+"""
+A module providing some utility functions regarding BƩzier path manipulation.
+"""
+
+from functools import lru_cache
+import math
+import warnings
+
+import numpy as np
+
+from matplotlib import _api
+
+
+# same algorithm as 3.8's math.comb
+@np.vectorize
+@lru_cache(maxsize=128)
+def _comb(n, k):
+ if k > n:
+ return 0
+ k = min(k, n - k)
+ i = np.arange(1, k + 1)
+ return np.prod((n + 1 - i)/i).astype(int)
+
+
+class NonIntersectingPathException(ValueError):
+ pass
+
+
+# some functions
+
+
+def get_intersection(cx1, cy1, cos_t1, sin_t1,
+ cx2, cy2, cos_t2, sin_t2):
+ """
+ Return the intersection between the line through (*cx1*, *cy1*) at angle
+ *t1* and the line through (*cx2*, *cy2*) at angle *t2*.
+ """
+
+ # line1 => sin_t1 * (x - cx1) - cos_t1 * (y - cy1) = 0.
+ # line1 => sin_t1 * x + cos_t1 * y = sin_t1*cx1 - cos_t1*cy1
+
+ line1_rhs = sin_t1 * cx1 - cos_t1 * cy1
+ line2_rhs = sin_t2 * cx2 - cos_t2 * cy2
+
+ # rhs matrix
+ a, b = sin_t1, -cos_t1
+ c, d = sin_t2, -cos_t2
+
+ ad_bc = a * d - b * c
+ if abs(ad_bc) < 1e-12:
+ raise ValueError("Given lines do not intersect. Please verify that "
+ "the angles are not equal or differ by 180 degrees.")
+
+ # rhs_inverse
+ a_, b_ = d, -b
+ c_, d_ = -c, a
+ a_, b_, c_, d_ = (k / ad_bc for k in [a_, b_, c_, d_])
+
+ x = a_ * line1_rhs + b_ * line2_rhs
+ y = c_ * line1_rhs + d_ * line2_rhs
+
+ return x, y
+
+
+def get_normal_points(cx, cy, cos_t, sin_t, length):
+ """
+ For a line passing through (*cx*, *cy*) and having an angle *t*, return
+ locations of the two points located along its perpendicular line at the
+ distance of *length*.
+ """
+
+ if length == 0.:
+ return cx, cy, cx, cy
+
+ cos_t1, sin_t1 = sin_t, -cos_t
+ cos_t2, sin_t2 = -sin_t, cos_t
+
+ x1, y1 = length * cos_t1 + cx, length * sin_t1 + cy
+ x2, y2 = length * cos_t2 + cx, length * sin_t2 + cy
+
+ return x1, y1, x2, y2
+
+
+# BEZIER routines
+
+# subdividing bezier curve
+# http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/Bezier/bezier-sub.html
+
+
+def _de_casteljau1(beta, t):
+ next_beta = beta[:-1] * (1 - t) + beta[1:] * t
+ return next_beta
+
+
+def split_de_casteljau(beta, t):
+ """
+ Split a BƩzier segment defined by its control points *beta* into two
+ separate segments divided at *t* and return their control points.
+ """
+ beta = np.asarray(beta)
+ beta_list = [beta]
+ while True:
+ beta = _de_casteljau1(beta, t)
+ beta_list.append(beta)
+ if len(beta) == 1:
+ break
+ left_beta = [beta[0] for beta in beta_list]
+ right_beta = [beta[-1] for beta in reversed(beta_list)]
+
+ return left_beta, right_beta
+
+
+def find_bezier_t_intersecting_with_closedpath(
+ bezier_point_at_t, inside_closedpath, t0=0., t1=1., tolerance=0.01):
+ """
+ Find the intersection of the BƩzier curve with a closed path.
+
+ The intersection point *t* is approximated by two parameters *t0*, *t1*
+ such that *t0* <= *t* <= *t1*.
+
+ Search starts from *t0* and *t1* and uses a simple bisecting algorithm
+ therefore one of the end points must be inside the path while the other
+ doesn't. The search stops when the distance of the points parametrized by
+ *t0* and *t1* gets smaller than the given *tolerance*.
+
+ Parameters
+ ----------
+ bezier_point_at_t : callable
+ A function returning x, y coordinates of the BƩzier at parameter *t*.
+ It must have the signature::
+
+ bezier_point_at_t(t: float) -> tuple[float, float]
+
+ inside_closedpath : callable
+ A function returning True if a given point (x, y) is inside the
+ closed path. It must have the signature::
+
+ inside_closedpath(point: tuple[float, float]) -> bool
+
+ t0, t1 : float
+ Start parameters for the search.
+
+ tolerance : float
+ Maximal allowed distance between the final points.
+
+ Returns
+ -------
+ t0, t1 : float
+ The BƩzier path parameters.
+ """
+ start = bezier_point_at_t(t0)
+ end = bezier_point_at_t(t1)
+
+ start_inside = inside_closedpath(start)
+ end_inside = inside_closedpath(end)
+
+ if start_inside == end_inside and start != end:
+ raise NonIntersectingPathException(
+ "Both points are on the same side of the closed path")
+
+ while True:
+
+ # return if the distance is smaller than the tolerance
+ if np.hypot(start[0] - end[0], start[1] - end[1]) < tolerance:
+ return t0, t1
+
+ # calculate the middle point
+ middle_t = 0.5 * (t0 + t1)
+ middle = bezier_point_at_t(middle_t)
+ middle_inside = inside_closedpath(middle)
+
+ if start_inside ^ middle_inside:
+ t1 = middle_t
+ if end == middle:
+ # Edge case where infinite loop is possible
+ # Caused by large numbers relative to tolerance
+ return t0, t1
+ end = middle
+ else:
+ t0 = middle_t
+ if start == middle:
+ # Edge case where infinite loop is possible
+ # Caused by large numbers relative to tolerance
+ return t0, t1
+ start = middle
+ start_inside = middle_inside
+
+
+class BezierSegment:
+ """
+ A d-dimensional BƩzier segment.
+
+ Parameters
+ ----------
+ control_points : (N, d) array
+ Location of the *N* control points.
+ """
+
+ def __init__(self, control_points):
+ self._cpoints = np.asarray(control_points)
+ self._N, self._d = self._cpoints.shape
+ self._orders = np.arange(self._N)
+ coeff = [math.factorial(self._N - 1)
+ // (math.factorial(i) * math.factorial(self._N - 1 - i))
+ for i in range(self._N)]
+ self._px = (self._cpoints.T * coeff).T
+
+ def __call__(self, t):
+ """
+ Evaluate the BƩzier curve at point(s) *t* in [0, 1].
+
+ Parameters
+ ----------
+ t : (k,) array-like
+ Points at which to evaluate the curve.
+
+ Returns
+ -------
+ (k, d) array
+ Value of the curve for each point in *t*.
+ """
+ t = np.asarray(t)
+ return (np.power.outer(1 - t, self._orders[::-1])
+ * np.power.outer(t, self._orders)) @ self._px
+
+ def point_at_t(self, t):
+ """
+ Evaluate the curve at a single point, returning a tuple of *d* floats.
+ """
+ return tuple(self(t))
+
+ @property
+ def control_points(self):
+ """The control points of the curve."""
+ return self._cpoints
+
+ @property
+ def dimension(self):
+ """The dimension of the curve."""
+ return self._d
+
+ @property
+ def degree(self):
+ """Degree of the polynomial. One less the number of control points."""
+ return self._N - 1
+
+ @property
+ def polynomial_coefficients(self):
+ r"""
+ The polynomial coefficients of the BƩzier curve.
+
+ .. warning:: Follows opposite convention from `numpy.polyval`.
+
+ Returns
+ -------
+ (n+1, d) array
+ Coefficients after expanding in polynomial basis, where :math:`n`
+ is the degree of the BƩzier curve and :math:`d` its dimension.
+ These are the numbers (:math:`C_j`) such that the curve can be
+ written :math:`\sum_{j=0}^n C_j t^j`.
+
+ Notes
+ -----
+ The coefficients are calculated as
+
+ .. math::
+
+ {n \choose j} \sum_{i=0}^j (-1)^{i+j} {j \choose i} P_i
+
+ where :math:`P_i` are the control points of the curve.
+ """
+ n = self.degree
+ # matplotlib uses n <= 4. overflow plausible starting around n = 15.
+ if n > 10:
+ warnings.warn("Polynomial coefficients formula unstable for high "
+ "order Bezier curves!", RuntimeWarning)
+ P = self.control_points
+ j = np.arange(n+1)[:, None]
+ i = np.arange(n+1)[None, :] # _comb is non-zero for i <= j
+ prefactor = (-1)**(i + j) * _comb(j, i) # j on axis 0, i on axis 1
+ return _comb(n, j) * prefactor @ P # j on axis 0, self.dimension on 1
+
+ def axis_aligned_extrema(self):
+ """
+ Return the dimension and location of the curve's interior extrema.
+
+ The extrema are the points along the curve where one of its partial
+ derivatives is zero.
+
+ Returns
+ -------
+ dims : array of int
+ Index :math:`i` of the partial derivative which is zero at each
+ interior extrema.
+ dzeros : array of float
+ Of same size as dims. The :math:`t` such that :math:`d/dx_i B(t) =
+ 0`
+ """
+ n = self.degree
+ if n <= 1:
+ return np.array([]), np.array([])
+ Cj = self.polynomial_coefficients
+ dCj = np.arange(1, n+1)[:, None] * Cj[1:]
+ dims = []
+ roots = []
+ for i, pi in enumerate(dCj.T):
+ r = np.roots(pi[::-1])
+ roots.append(r)
+ dims.append(np.full_like(r, i))
+ roots = np.concatenate(roots)
+ dims = np.concatenate(dims)
+ in_range = np.isreal(roots) & (roots >= 0) & (roots <= 1)
+ return dims[in_range], np.real(roots)[in_range]
+
+
+def split_bezier_intersecting_with_closedpath(
+ bezier, inside_closedpath, tolerance=0.01):
+ """
+ Split a BƩzier curve into two at the intersection with a closed path.
+
+ Parameters
+ ----------
+ bezier : (N, 2) array-like
+ Control points of the BƩzier segment. See `.BezierSegment`.
+ inside_closedpath : callable
+ A function returning True if a given point (x, y) is inside the
+ closed path. See also `.find_bezier_t_intersecting_with_closedpath`.
+ tolerance : float
+ The tolerance for the intersection. See also
+ `.find_bezier_t_intersecting_with_closedpath`.
+
+ Returns
+ -------
+ left, right
+ Lists of control points for the two BƩzier segments.
+ """
+
+ bz = BezierSegment(bezier)
+ bezier_point_at_t = bz.point_at_t
+
+ t0, t1 = find_bezier_t_intersecting_with_closedpath(
+ bezier_point_at_t, inside_closedpath, tolerance=tolerance)
+
+ _left, _right = split_de_casteljau(bezier, (t0 + t1) / 2.)
+ return _left, _right
+
+
+# matplotlib specific
+
+
+def split_path_inout(path, inside, tolerance=0.01, reorder_inout=False):
+ """
+ Divide a path into two segments at the point where ``inside(x, y)`` becomes
+ False.
+ """
+ from .path import Path
+ path_iter = path.iter_segments()
+
+ ctl_points, command = next(path_iter)
+ begin_inside = inside(ctl_points[-2:]) # true if begin point is inside
+
+ ctl_points_old = ctl_points
+
+ iold = 0
+ i = 1
+
+ for ctl_points, command in path_iter:
+ iold = i
+ i += len(ctl_points) // 2
+ if inside(ctl_points[-2:]) != begin_inside:
+ bezier_path = np.concatenate([ctl_points_old[-2:], ctl_points])
+ break
+ ctl_points_old = ctl_points
+ else:
+ raise ValueError("The path does not intersect with the patch")
+
+ bp = bezier_path.reshape((-1, 2))
+ left, right = split_bezier_intersecting_with_closedpath(
+ bp, inside, tolerance)
+ if len(left) == 2:
+ codes_left = [Path.LINETO]
+ codes_right = [Path.MOVETO, Path.LINETO]
+ elif len(left) == 3:
+ codes_left = [Path.CURVE3, Path.CURVE3]
+ codes_right = [Path.MOVETO, Path.CURVE3, Path.CURVE3]
+ elif len(left) == 4:
+ codes_left = [Path.CURVE4, Path.CURVE4, Path.CURVE4]
+ codes_right = [Path.MOVETO, Path.CURVE4, Path.CURVE4, Path.CURVE4]
+ else:
+ raise AssertionError("This should never be reached")
+
+ verts_left = left[1:]
+ verts_right = right[:]
+
+ if path.codes is None:
+ path_in = Path(np.concatenate([path.vertices[:i], verts_left]))
+ path_out = Path(np.concatenate([verts_right, path.vertices[i:]]))
+
+ else:
+ path_in = Path(np.concatenate([path.vertices[:iold], verts_left]),
+ np.concatenate([path.codes[:iold], codes_left]))
+
+ path_out = Path(np.concatenate([verts_right, path.vertices[i:]]),
+ np.concatenate([codes_right, path.codes[i:]]))
+
+ if reorder_inout and not begin_inside:
+ path_in, path_out = path_out, path_in
+
+ return path_in, path_out
+
+
+def inside_circle(cx, cy, r):
+ """
+ Return a function that checks whether a point is in a circle with center
+ (*cx*, *cy*) and radius *r*.
+
+ The returned function has the signature::
+
+ f(xy: tuple[float, float]) -> bool
+ """
+ r2 = r ** 2
+
+ def _f(xy):
+ x, y = xy
+ return (x - cx) ** 2 + (y - cy) ** 2 < r2
+ return _f
+
+
+# quadratic Bezier lines
+
+def get_cos_sin(x0, y0, x1, y1):
+ dx, dy = x1 - x0, y1 - y0
+ d = (dx * dx + dy * dy) ** .5
+ # Account for divide by zero
+ if d == 0:
+ return 0.0, 0.0
+ return dx / d, dy / d
+
+
+def check_if_parallel(dx1, dy1, dx2, dy2, tolerance=1.e-5):
+ """
+ Check if two lines are parallel.
+
+ Parameters
+ ----------
+ dx1, dy1, dx2, dy2 : float
+ The gradients *dy*/*dx* of the two lines.
+ tolerance : float
+ The angular tolerance in radians up to which the lines are considered
+ parallel.
+
+ Returns
+ -------
+ is_parallel
+ - 1 if two lines are parallel in same direction.
+ - -1 if two lines are parallel in opposite direction.
+ - False otherwise.
+ """
+ theta1 = np.arctan2(dx1, dy1)
+ theta2 = np.arctan2(dx2, dy2)
+ dtheta = abs(theta1 - theta2)
+ if dtheta < tolerance:
+ return 1
+ elif abs(dtheta - np.pi) < tolerance:
+ return -1
+ else:
+ return False
+
+
+def get_parallels(bezier2, width):
+ """
+ Given the quadratic BƩzier control points *bezier2*, returns
+ control points of quadratic BƩzier lines roughly parallel to given
+ one separated by *width*.
+ """
+
+ # The parallel Bezier lines are constructed by following ways.
+ # c1 and c2 are control points representing the start and end of the
+ # Bezier line.
+ # cm is the middle point
+
+ c1x, c1y = bezier2[0]
+ cmx, cmy = bezier2[1]
+ c2x, c2y = bezier2[2]
+
+ parallel_test = check_if_parallel(c1x - cmx, c1y - cmy,
+ cmx - c2x, cmy - c2y)
+
+ if parallel_test == -1:
+ _api.warn_external(
+ "Lines do not intersect. A straight line is used instead.")
+ cos_t1, sin_t1 = get_cos_sin(c1x, c1y, c2x, c2y)
+ cos_t2, sin_t2 = cos_t1, sin_t1
+ else:
+ # t1 and t2 is the angle between c1 and cm, cm, c2. They are
+ # also an angle of the tangential line of the path at c1 and c2
+ cos_t1, sin_t1 = get_cos_sin(c1x, c1y, cmx, cmy)
+ cos_t2, sin_t2 = get_cos_sin(cmx, cmy, c2x, c2y)
+
+ # find c1_left, c1_right which are located along the lines
+ # through c1 and perpendicular to the tangential lines of the
+ # Bezier path at a distance of width. Same thing for c2_left and
+ # c2_right with respect to c2.
+ c1x_left, c1y_left, c1x_right, c1y_right = (
+ get_normal_points(c1x, c1y, cos_t1, sin_t1, width)
+ )
+ c2x_left, c2y_left, c2x_right, c2y_right = (
+ get_normal_points(c2x, c2y, cos_t2, sin_t2, width)
+ )
+
+ # find cm_left which is the intersecting point of a line through
+ # c1_left with angle t1 and a line through c2_left with angle
+ # t2. Same with cm_right.
+ try:
+ cmx_left, cmy_left = get_intersection(c1x_left, c1y_left, cos_t1,
+ sin_t1, c2x_left, c2y_left,
+ cos_t2, sin_t2)
+ cmx_right, cmy_right = get_intersection(c1x_right, c1y_right, cos_t1,
+ sin_t1, c2x_right, c2y_right,
+ cos_t2, sin_t2)
+ except ValueError:
+ # Special case straight lines, i.e., angle between two lines is
+ # less than the threshold used by get_intersection (we don't use
+ # check_if_parallel as the threshold is not the same).
+ cmx_left, cmy_left = (
+ 0.5 * (c1x_left + c2x_left), 0.5 * (c1y_left + c2y_left)
+ )
+ cmx_right, cmy_right = (
+ 0.5 * (c1x_right + c2x_right), 0.5 * (c1y_right + c2y_right)
+ )
+
+ # the parallel Bezier lines are created with control points of
+ # [c1_left, cm_left, c2_left] and [c1_right, cm_right, c2_right]
+ path_left = [(c1x_left, c1y_left),
+ (cmx_left, cmy_left),
+ (c2x_left, c2y_left)]
+ path_right = [(c1x_right, c1y_right),
+ (cmx_right, cmy_right),
+ (c2x_right, c2y_right)]
+
+ return path_left, path_right
+
+
+def find_control_points(c1x, c1y, mmx, mmy, c2x, c2y):
+ """
+ Find control points of the BƩzier curve passing through (*c1x*, *c1y*),
+ (*mmx*, *mmy*), and (*c2x*, *c2y*), at parametric values 0, 0.5, and 1.
+ """
+ cmx = .5 * (4 * mmx - (c1x + c2x))
+ cmy = .5 * (4 * mmy - (c1y + c2y))
+ return [(c1x, c1y), (cmx, cmy), (c2x, c2y)]
+
+
+def make_wedged_bezier2(bezier2, width, w1=1., wm=0.5, w2=0.):
+ """
+ Being similar to `get_parallels`, returns control points of two quadratic
+ BƩzier lines having a width roughly parallel to given one separated by
+ *width*.
+ """
+
+ # c1, cm, c2
+ c1x, c1y = bezier2[0]
+ cmx, cmy = bezier2[1]
+ c3x, c3y = bezier2[2]
+
+ # t1 and t2 is the angle between c1 and cm, cm, c3.
+ # They are also an angle of the tangential line of the path at c1 and c3
+ cos_t1, sin_t1 = get_cos_sin(c1x, c1y, cmx, cmy)
+ cos_t2, sin_t2 = get_cos_sin(cmx, cmy, c3x, c3y)
+
+ # find c1_left, c1_right which are located along the lines
+ # through c1 and perpendicular to the tangential lines of the
+ # Bezier path at a distance of width. Same thing for c3_left and
+ # c3_right with respect to c3.
+ c1x_left, c1y_left, c1x_right, c1y_right = (
+ get_normal_points(c1x, c1y, cos_t1, sin_t1, width * w1)
+ )
+ c3x_left, c3y_left, c3x_right, c3y_right = (
+ get_normal_points(c3x, c3y, cos_t2, sin_t2, width * w2)
+ )
+
+ # find c12, c23 and c123 which are middle points of c1-cm, cm-c3 and
+ # c12-c23
+ c12x, c12y = (c1x + cmx) * .5, (c1y + cmy) * .5
+ c23x, c23y = (cmx + c3x) * .5, (cmy + c3y) * .5
+ c123x, c123y = (c12x + c23x) * .5, (c12y + c23y) * .5
+
+ # tangential angle of c123 (angle between c12 and c23)
+ cos_t123, sin_t123 = get_cos_sin(c12x, c12y, c23x, c23y)
+
+ c123x_left, c123y_left, c123x_right, c123y_right = (
+ get_normal_points(c123x, c123y, cos_t123, sin_t123, width * wm)
+ )
+
+ path_left = find_control_points(c1x_left, c1y_left,
+ c123x_left, c123y_left,
+ c3x_left, c3y_left)
+ path_right = find_control_points(c1x_right, c1y_right,
+ c123x_right, c123y_right,
+ c3x_right, c3y_right)
+
+ return path_left, path_right
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/bezier.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/bezier.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..ad82b873affd3902290347be2fae3a3b754f35da
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/bezier.pyi
@@ -0,0 +1,74 @@
+from collections.abc import Callable
+from typing import Literal
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+from .path import Path
+
+class NonIntersectingPathException(ValueError): ...
+
+def get_intersection(
+ cx1: float,
+ cy1: float,
+ cos_t1: float,
+ sin_t1: float,
+ cx2: float,
+ cy2: float,
+ cos_t2: float,
+ sin_t2: float,
+) -> tuple[float, float]: ...
+def get_normal_points(
+ cx: float, cy: float, cos_t: float, sin_t: float, length: float
+) -> tuple[float, float, float, float]: ...
+def split_de_casteljau(beta: ArrayLike, t: float) -> tuple[np.ndarray, np.ndarray]: ...
+def find_bezier_t_intersecting_with_closedpath(
+ bezier_point_at_t: Callable[[float], tuple[float, float]],
+ inside_closedpath: Callable[[tuple[float, float]], bool],
+ t0: float = ...,
+ t1: float = ...,
+ tolerance: float = ...,
+) -> tuple[float, float]: ...
+
+# TODO make generic over d, the dimension? ndarraydim
+class BezierSegment:
+ def __init__(self, control_points: ArrayLike) -> None: ...
+ def __call__(self, t: ArrayLike) -> np.ndarray: ...
+ def point_at_t(self, t: float) -> tuple[float, ...]: ...
+ @property
+ def control_points(self) -> np.ndarray: ...
+ @property
+ def dimension(self) -> int: ...
+ @property
+ def degree(self) -> int: ...
+ @property
+ def polynomial_coefficients(self) -> np.ndarray: ...
+ def axis_aligned_extrema(self) -> tuple[np.ndarray, np.ndarray]: ...
+
+def split_bezier_intersecting_with_closedpath(
+ bezier: ArrayLike,
+ inside_closedpath: Callable[[tuple[float, float]], bool],
+ tolerance: float = ...,
+) -> tuple[np.ndarray, np.ndarray]: ...
+def split_path_inout(
+ path: Path,
+ inside: Callable[[tuple[float, float]], bool],
+ tolerance: float = ...,
+ reorder_inout: bool = ...,
+) -> tuple[Path, Path]: ...
+def inside_circle(
+ cx: float, cy: float, r: float
+) -> Callable[[tuple[float, float]], bool]: ...
+def get_cos_sin(x0: float, y0: float, x1: float, y1: float) -> tuple[float, float]: ...
+def check_if_parallel(
+ dx1: float, dy1: float, dx2: float, dy2: float, tolerance: float = ...
+) -> Literal[-1, False, 1]: ...
+def get_parallels(
+ bezier2: ArrayLike, width: float
+) -> tuple[list[tuple[float, float]], list[tuple[float, float]]]: ...
+def find_control_points(
+ c1x: float, c1y: float, mmx: float, mmy: float, c2x: float, c2y: float
+) -> list[tuple[float, float]]: ...
+def make_wedged_bezier2(
+ bezier2: ArrayLike, width: float, w1: float = ..., wm: float = ..., w2: float = ...
+) -> tuple[list[tuple[float, float]], list[tuple[float, float]]]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/category.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/category.py
new file mode 100644
index 0000000000000000000000000000000000000000..225c837006f726aa97b990c82a3265ec06e55df3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/category.py
@@ -0,0 +1,235 @@
+"""
+Plotting of string "category" data: ``plot(['d', 'f', 'a'], [1, 2, 3])`` will
+plot three points with x-axis values of 'd', 'f', 'a'.
+
+See :doc:`/gallery/lines_bars_and_markers/categorical_variables` for an
+example.
+
+The module uses Matplotlib's `matplotlib.units` mechanism to convert from
+strings to integers and provides a tick locator, a tick formatter, and the
+`.UnitData` class that creates and stores the string-to-integer mapping.
+"""
+
+from collections import OrderedDict
+import dateutil.parser
+import itertools
+import logging
+
+import numpy as np
+
+from matplotlib import _api, cbook, ticker, units
+
+
+_log = logging.getLogger(__name__)
+
+
+class StrCategoryConverter(units.ConversionInterface):
+ @staticmethod
+ def convert(value, unit, axis):
+ """
+ Convert strings in *value* to floats using mapping information stored
+ in the *unit* object.
+
+ Parameters
+ ----------
+ value : str or iterable
+ Value or list of values to be converted.
+ unit : `.UnitData`
+ An object mapping strings to integers.
+ axis : `~matplotlib.axis.Axis`
+ The axis on which the converted value is plotted.
+
+ .. note:: *axis* is unused.
+
+ Returns
+ -------
+ float or `~numpy.ndarray` of float
+ """
+ if unit is None:
+ raise ValueError(
+ 'Missing category information for StrCategoryConverter; '
+ 'this might be caused by unintendedly mixing categorical and '
+ 'numeric data')
+ StrCategoryConverter._validate_unit(unit)
+ # dtype = object preserves numerical pass throughs
+ values = np.atleast_1d(np.array(value, dtype=object))
+ # force an update so it also does type checking
+ unit.update(values)
+ s = np.vectorize(unit._mapping.__getitem__, otypes=[float])(values)
+ return s if not cbook.is_scalar_or_string(value) else s[0]
+
+ @staticmethod
+ def axisinfo(unit, axis):
+ """
+ Set the default axis ticks and labels.
+
+ Parameters
+ ----------
+ unit : `.UnitData`
+ object string unit information for value
+ axis : `~matplotlib.axis.Axis`
+ axis for which information is being set
+
+ .. note:: *axis* is not used
+
+ Returns
+ -------
+ `~matplotlib.units.AxisInfo`
+ Information to support default tick labeling
+
+ """
+ StrCategoryConverter._validate_unit(unit)
+ # locator and formatter take mapping dict because
+ # args need to be pass by reference for updates
+ majloc = StrCategoryLocator(unit._mapping)
+ majfmt = StrCategoryFormatter(unit._mapping)
+ return units.AxisInfo(majloc=majloc, majfmt=majfmt)
+
+ @staticmethod
+ def default_units(data, axis):
+ """
+ Set and update the `~matplotlib.axis.Axis` units.
+
+ Parameters
+ ----------
+ data : str or iterable of str
+ axis : `~matplotlib.axis.Axis`
+ axis on which the data is plotted
+
+ Returns
+ -------
+ `.UnitData`
+ object storing string to integer mapping
+ """
+ # the conversion call stack is default_units -> axis_info -> convert
+ if axis.units is None:
+ axis.set_units(UnitData(data))
+ else:
+ axis.units.update(data)
+ return axis.units
+
+ @staticmethod
+ def _validate_unit(unit):
+ if not hasattr(unit, '_mapping'):
+ raise ValueError(
+ f'Provided unit "{unit}" is not valid for a categorical '
+ 'converter, as it does not have a _mapping attribute.')
+
+
+class StrCategoryLocator(ticker.Locator):
+ """Tick at every integer mapping of the string data."""
+ def __init__(self, units_mapping):
+ """
+ Parameters
+ ----------
+ units_mapping : dict
+ Mapping of category names (str) to indices (int).
+ """
+ self._units = units_mapping
+
+ def __call__(self):
+ # docstring inherited
+ return list(self._units.values())
+
+ def tick_values(self, vmin, vmax):
+ # docstring inherited
+ return self()
+
+
+class StrCategoryFormatter(ticker.Formatter):
+ """String representation of the data at every tick."""
+ def __init__(self, units_mapping):
+ """
+ Parameters
+ ----------
+ units_mapping : dict
+ Mapping of category names (str) to indices (int).
+ """
+ self._units = units_mapping
+
+ def __call__(self, x, pos=None):
+ # docstring inherited
+ return self.format_ticks([x])[0]
+
+ def format_ticks(self, values):
+ # docstring inherited
+ r_mapping = {v: self._text(k) for k, v in self._units.items()}
+ return [r_mapping.get(round(val), '') for val in values]
+
+ @staticmethod
+ def _text(value):
+ """Convert text values into utf-8 or ascii strings."""
+ if isinstance(value, bytes):
+ value = value.decode(encoding='utf-8')
+ elif not isinstance(value, str):
+ value = str(value)
+ return value
+
+
+class UnitData:
+ def __init__(self, data=None):
+ """
+ Create mapping between unique categorical values and integer ids.
+
+ Parameters
+ ----------
+ data : iterable
+ sequence of string values
+ """
+ self._mapping = OrderedDict()
+ self._counter = itertools.count()
+ if data is not None:
+ self.update(data)
+
+ @staticmethod
+ def _str_is_convertible(val):
+ """
+ Helper method to check whether a string can be parsed as float or date.
+ """
+ try:
+ float(val)
+ except ValueError:
+ try:
+ dateutil.parser.parse(val)
+ except (ValueError, TypeError):
+ # TypeError if dateutil >= 2.8.1 else ValueError
+ return False
+ return True
+
+ def update(self, data):
+ """
+ Map new values to integer identifiers.
+
+ Parameters
+ ----------
+ data : iterable of str or bytes
+
+ Raises
+ ------
+ TypeError
+ If elements in *data* are neither str nor bytes.
+ """
+ data = np.atleast_1d(np.array(data, dtype=object))
+ # check if convertible to number:
+ convertible = True
+ for val in OrderedDict.fromkeys(data):
+ # OrderedDict just iterates over unique values in data.
+ _api.check_isinstance((str, bytes), value=val)
+ if convertible:
+ # this will only be called so long as convertible is True.
+ convertible = self._str_is_convertible(val)
+ if val not in self._mapping:
+ self._mapping[val] = next(self._counter)
+ if data.size and convertible:
+ _log.info('Using categorical units to plot a list of strings '
+ 'that are all parsable as floats or dates. If these '
+ 'strings should be plotted as numbers, cast to the '
+ 'appropriate data type before plotting.')
+
+
+# Register the converter with Matplotlib's unit framework
+# Intentionally set to a single instance
+units.registry[str] = \
+ units.registry[np.str_] = \
+ units.registry[bytes] = \
+ units.registry[np.bytes_] = StrCategoryConverter()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cbook.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cbook.py
new file mode 100644
index 0000000000000000000000000000000000000000..b40f6549c9457d20f0263e0cf7c0ce1b7241dbec
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cbook.py
@@ -0,0 +1,2415 @@
+"""
+A collection of utility functions and classes. Originally, many
+(but not all) were from the Python Cookbook -- hence the name cbook.
+"""
+
+import collections
+import collections.abc
+import contextlib
+import functools
+import gzip
+import itertools
+import math
+import operator
+import os
+from pathlib import Path
+import shlex
+import subprocess
+import sys
+import time
+import traceback
+import types
+import weakref
+
+import numpy as np
+
+try:
+ from numpy.exceptions import VisibleDeprecationWarning # numpy >= 1.25
+except ImportError:
+ from numpy import VisibleDeprecationWarning
+
+import matplotlib
+from matplotlib import _api, _c_internal_utils
+
+
+class _ExceptionInfo:
+ """
+ A class to carry exception information around.
+
+ This is used to store and later raise exceptions. It's an alternative to
+ directly storing Exception instances that circumvents traceback-related
+ issues: caching tracebacks can keep user's objects in local namespaces
+ alive indefinitely, which can lead to very surprising memory issues for
+ users and result in incorrect tracebacks.
+ """
+
+ def __init__(self, cls, *args):
+ self._cls = cls
+ self._args = args
+
+ @classmethod
+ def from_exception(cls, exc):
+ return cls(type(exc), *exc.args)
+
+ def to_exception(self):
+ return self._cls(*self._args)
+
+
+def _get_running_interactive_framework():
+ """
+ Return the interactive framework whose event loop is currently running, if
+ any, or "headless" if no event loop can be started, or None.
+
+ Returns
+ -------
+ Optional[str]
+ One of the following values: "qt", "gtk3", "gtk4", "wx", "tk",
+ "macosx", "headless", ``None``.
+ """
+ # Use ``sys.modules.get(name)`` rather than ``name in sys.modules`` as
+ # entries can also have been explicitly set to None.
+ QtWidgets = (
+ sys.modules.get("PyQt6.QtWidgets")
+ or sys.modules.get("PySide6.QtWidgets")
+ or sys.modules.get("PyQt5.QtWidgets")
+ or sys.modules.get("PySide2.QtWidgets")
+ )
+ if QtWidgets and QtWidgets.QApplication.instance():
+ return "qt"
+ Gtk = sys.modules.get("gi.repository.Gtk")
+ if Gtk:
+ if Gtk.MAJOR_VERSION == 4:
+ from gi.repository import GLib
+ if GLib.main_depth():
+ return "gtk4"
+ if Gtk.MAJOR_VERSION == 3 and Gtk.main_level():
+ return "gtk3"
+ wx = sys.modules.get("wx")
+ if wx and wx.GetApp():
+ return "wx"
+ tkinter = sys.modules.get("tkinter")
+ if tkinter:
+ codes = {tkinter.mainloop.__code__, tkinter.Misc.mainloop.__code__}
+ for frame in sys._current_frames().values():
+ while frame:
+ if frame.f_code in codes:
+ return "tk"
+ frame = frame.f_back
+ # Preemptively break reference cycle between locals and the frame.
+ del frame
+ macosx = sys.modules.get("matplotlib.backends._macosx")
+ if macosx and macosx.event_loop_is_running():
+ return "macosx"
+ if not _c_internal_utils.display_is_valid():
+ return "headless"
+ return None
+
+
+def _exception_printer(exc):
+ if _get_running_interactive_framework() in ["headless", None]:
+ raise exc
+ else:
+ traceback.print_exc()
+
+
+class _StrongRef:
+ """
+ Wrapper similar to a weakref, but keeping a strong reference to the object.
+ """
+
+ def __init__(self, obj):
+ self._obj = obj
+
+ def __call__(self):
+ return self._obj
+
+ def __eq__(self, other):
+ return isinstance(other, _StrongRef) and self._obj == other._obj
+
+ def __hash__(self):
+ return hash(self._obj)
+
+
+def _weak_or_strong_ref(func, callback):
+ """
+ Return a `WeakMethod` wrapping *func* if possible, else a `_StrongRef`.
+ """
+ try:
+ return weakref.WeakMethod(func, callback)
+ except TypeError:
+ return _StrongRef(func)
+
+
+class _UnhashDict:
+ """
+ A minimal dict-like class that also supports unhashable keys, storing them
+ in a list of key-value pairs.
+
+ This class only implements the interface needed for `CallbackRegistry`, and
+ tries to minimize the overhead for the hashable case.
+ """
+
+ def __init__(self, pairs):
+ self._dict = {}
+ self._pairs = []
+ for k, v in pairs:
+ self[k] = v
+
+ def __setitem__(self, key, value):
+ try:
+ self._dict[key] = value
+ except TypeError:
+ for i, (k, v) in enumerate(self._pairs):
+ if k == key:
+ self._pairs[i] = (key, value)
+ break
+ else:
+ self._pairs.append((key, value))
+
+ def __getitem__(self, key):
+ try:
+ return self._dict[key]
+ except TypeError:
+ pass
+ for k, v in self._pairs:
+ if k == key:
+ return v
+ raise KeyError(key)
+
+ def pop(self, key, *args):
+ try:
+ if key in self._dict:
+ return self._dict.pop(key)
+ except TypeError:
+ for i, (k, v) in enumerate(self._pairs):
+ if k == key:
+ del self._pairs[i]
+ return v
+ if args:
+ return args[0]
+ raise KeyError(key)
+
+ def __iter__(self):
+ yield from self._dict
+ for k, v in self._pairs:
+ yield k
+
+
+class CallbackRegistry:
+ """
+ Handle registering, processing, blocking, and disconnecting
+ for a set of signals and callbacks:
+
+ >>> def oneat(x):
+ ... print('eat', x)
+ >>> def ondrink(x):
+ ... print('drink', x)
+
+ >>> from matplotlib.cbook import CallbackRegistry
+ >>> callbacks = CallbackRegistry()
+
+ >>> id_eat = callbacks.connect('eat', oneat)
+ >>> id_drink = callbacks.connect('drink', ondrink)
+
+ >>> callbacks.process('drink', 123)
+ drink 123
+ >>> callbacks.process('eat', 456)
+ eat 456
+ >>> callbacks.process('be merry', 456) # nothing will be called
+
+ >>> callbacks.disconnect(id_eat)
+ >>> callbacks.process('eat', 456) # nothing will be called
+
+ >>> with callbacks.blocked(signal='drink'):
+ ... callbacks.process('drink', 123) # nothing will be called
+ >>> callbacks.process('drink', 123)
+ drink 123
+
+ In practice, one should always disconnect all callbacks when they are
+ no longer needed to avoid dangling references (and thus memory leaks).
+ However, real code in Matplotlib rarely does so, and due to its design,
+ it is rather difficult to place this kind of code. To get around this,
+ and prevent this class of memory leaks, we instead store weak references
+ to bound methods only, so when the destination object needs to die, the
+ CallbackRegistry won't keep it alive.
+
+ Parameters
+ ----------
+ exception_handler : callable, optional
+ If not None, *exception_handler* must be a function that takes an
+ `Exception` as single parameter. It gets called with any `Exception`
+ raised by the callbacks during `CallbackRegistry.process`, and may
+ either re-raise the exception or handle it in another manner.
+
+ The default handler prints the exception (with `traceback.print_exc`) if
+ an interactive event loop is running; it re-raises the exception if no
+ interactive event loop is running.
+
+ signals : list, optional
+ If not None, *signals* is a list of signals that this registry handles:
+ attempting to `process` or to `connect` to a signal not in the list
+ throws a `ValueError`. The default, None, does not restrict the
+ handled signals.
+ """
+
+ # We maintain two mappings:
+ # callbacks: signal -> {cid -> weakref-to-callback}
+ # _func_cid_map: {(signal, weakref-to-callback) -> cid}
+
+ def __init__(self, exception_handler=_exception_printer, *, signals=None):
+ self._signals = None if signals is None else list(signals) # Copy it.
+ self.exception_handler = exception_handler
+ self.callbacks = {}
+ self._cid_gen = itertools.count()
+ self._func_cid_map = _UnhashDict([])
+ # A hidden variable that marks cids that need to be pickled.
+ self._pickled_cids = set()
+
+ def __getstate__(self):
+ return {
+ **vars(self),
+ # In general, callbacks may not be pickled, so we just drop them,
+ # unless directed otherwise by self._pickled_cids.
+ "callbacks": {s: {cid: proxy() for cid, proxy in d.items()
+ if cid in self._pickled_cids}
+ for s, d in self.callbacks.items()},
+ # It is simpler to reconstruct this from callbacks in __setstate__.
+ "_func_cid_map": None,
+ "_cid_gen": next(self._cid_gen)
+ }
+
+ def __setstate__(self, state):
+ cid_count = state.pop('_cid_gen')
+ vars(self).update(state)
+ self.callbacks = {
+ s: {cid: _weak_or_strong_ref(func, functools.partial(self._remove_proxy, s))
+ for cid, func in d.items()}
+ for s, d in self.callbacks.items()}
+ self._func_cid_map = _UnhashDict(
+ ((s, proxy), cid)
+ for s, d in self.callbacks.items() for cid, proxy in d.items())
+ self._cid_gen = itertools.count(cid_count)
+
+ def connect(self, signal, func):
+ """Register *func* to be called when signal *signal* is generated."""
+ if self._signals is not None:
+ _api.check_in_list(self._signals, signal=signal)
+ proxy = _weak_or_strong_ref(func, functools.partial(self._remove_proxy, signal))
+ try:
+ return self._func_cid_map[signal, proxy]
+ except KeyError:
+ cid = self._func_cid_map[signal, proxy] = next(self._cid_gen)
+ self.callbacks.setdefault(signal, {})[cid] = proxy
+ return cid
+
+ def _connect_picklable(self, signal, func):
+ """
+ Like `.connect`, but the callback is kept when pickling/unpickling.
+
+ Currently internal-use only.
+ """
+ cid = self.connect(signal, func)
+ self._pickled_cids.add(cid)
+ return cid
+
+ # Keep a reference to sys.is_finalizing, as sys may have been cleared out
+ # at that point.
+ def _remove_proxy(self, signal, proxy, *, _is_finalizing=sys.is_finalizing):
+ if _is_finalizing():
+ # Weakrefs can't be properly torn down at that point anymore.
+ return
+ cid = self._func_cid_map.pop((signal, proxy), None)
+ if cid is not None:
+ del self.callbacks[signal][cid]
+ self._pickled_cids.discard(cid)
+ else: # Not found
+ return
+ if len(self.callbacks[signal]) == 0: # Clean up empty dicts
+ del self.callbacks[signal]
+
+ def disconnect(self, cid):
+ """
+ Disconnect the callback registered with callback id *cid*.
+
+ No error is raised if such a callback does not exist.
+ """
+ self._pickled_cids.discard(cid)
+ for signal, proxy in self._func_cid_map:
+ if self._func_cid_map[signal, proxy] == cid:
+ break
+ else: # Not found
+ return
+ assert self.callbacks[signal][cid] == proxy
+ del self.callbacks[signal][cid]
+ self._func_cid_map.pop((signal, proxy))
+ if len(self.callbacks[signal]) == 0: # Clean up empty dicts
+ del self.callbacks[signal]
+
+ def process(self, s, *args, **kwargs):
+ """
+ Process signal *s*.
+
+ All of the functions registered to receive callbacks on *s* will be
+ called with ``*args`` and ``**kwargs``.
+ """
+ if self._signals is not None:
+ _api.check_in_list(self._signals, signal=s)
+ for ref in list(self.callbacks.get(s, {}).values()):
+ func = ref()
+ if func is not None:
+ try:
+ func(*args, **kwargs)
+ # this does not capture KeyboardInterrupt, SystemExit,
+ # and GeneratorExit
+ except Exception as exc:
+ if self.exception_handler is not None:
+ self.exception_handler(exc)
+ else:
+ raise
+
+ @contextlib.contextmanager
+ def blocked(self, *, signal=None):
+ """
+ Block callback signals from being processed.
+
+ A context manager to temporarily block/disable callback signals
+ from being processed by the registered listeners.
+
+ Parameters
+ ----------
+ signal : str, optional
+ The callback signal to block. The default is to block all signals.
+ """
+ orig = self.callbacks
+ try:
+ if signal is None:
+ # Empty out the callbacks
+ self.callbacks = {}
+ else:
+ # Only remove the specific signal
+ self.callbacks = {k: orig[k] for k in orig if k != signal}
+ yield
+ finally:
+ self.callbacks = orig
+
+
+class silent_list(list):
+ """
+ A list with a short ``repr()``.
+
+ This is meant to be used for a homogeneous list of artists, so that they
+ don't cause long, meaningless output.
+
+ Instead of ::
+
+ [,
+ ,
+ ]
+
+ one will get ::
+
+
+
+ If ``self.type`` is None, the type name is obtained from the first item in
+ the list (if any).
+ """
+
+ def __init__(self, type, seq=None):
+ self.type = type
+ if seq is not None:
+ self.extend(seq)
+
+ def __repr__(self):
+ if self.type is not None or len(self) != 0:
+ tp = self.type if self.type is not None else type(self[0]).__name__
+ return f" "
+ else:
+ return ""
+
+
+def _local_over_kwdict(
+ local_var, kwargs, *keys,
+ warning_cls=_api.MatplotlibDeprecationWarning):
+ out = local_var
+ for key in keys:
+ kwarg_val = kwargs.pop(key, None)
+ if kwarg_val is not None:
+ if out is None:
+ out = kwarg_val
+ else:
+ _api.warn_external(f'"{key}" keyword argument will be ignored',
+ warning_cls)
+ return out
+
+
+def strip_math(s):
+ """
+ Remove latex formatting from mathtext.
+
+ Only handles fully math and fully non-math strings.
+ """
+ if len(s) >= 2 and s[0] == s[-1] == "$":
+ s = s[1:-1]
+ for tex, plain in [
+ (r"\times", "x"), # Specifically for Formatter support.
+ (r"\mathdefault", ""),
+ (r"\rm", ""),
+ (r"\cal", ""),
+ (r"\tt", ""),
+ (r"\it", ""),
+ ("\\", ""),
+ ("{", ""),
+ ("}", ""),
+ ]:
+ s = s.replace(tex, plain)
+ return s
+
+
+def _strip_comment(s):
+ """Strip everything from the first unquoted #."""
+ pos = 0
+ while True:
+ quote_pos = s.find('"', pos)
+ hash_pos = s.find('#', pos)
+ if quote_pos < 0:
+ without_comment = s if hash_pos < 0 else s[:hash_pos]
+ return without_comment.strip()
+ elif 0 <= hash_pos < quote_pos:
+ return s[:hash_pos].strip()
+ else:
+ closing_quote_pos = s.find('"', quote_pos + 1)
+ if closing_quote_pos < 0:
+ raise ValueError(
+ f"Missing closing quote in: {s!r}. If you need a double-"
+ 'quote inside a string, use escaping: e.g. "the \" char"')
+ pos = closing_quote_pos + 1 # behind closing quote
+
+
+def is_writable_file_like(obj):
+ """Return whether *obj* looks like a file object with a *write* method."""
+ return callable(getattr(obj, 'write', None))
+
+
+def file_requires_unicode(x):
+ """
+ Return whether the given writable file-like object requires Unicode to be
+ written to it.
+ """
+ try:
+ x.write(b'')
+ except TypeError:
+ return True
+ else:
+ return False
+
+
+def to_filehandle(fname, flag='r', return_opened=False, encoding=None):
+ """
+ Convert a path to an open file handle or pass-through a file-like object.
+
+ Consider using `open_file_cm` instead, as it allows one to properly close
+ newly created file objects more easily.
+
+ Parameters
+ ----------
+ fname : str or path-like or file-like
+ If `str` or `os.PathLike`, the file is opened using the flags specified
+ by *flag* and *encoding*. If a file-like object, it is passed through.
+ flag : str, default: 'r'
+ Passed as the *mode* argument to `open` when *fname* is `str` or
+ `os.PathLike`; ignored if *fname* is file-like.
+ return_opened : bool, default: False
+ If True, return both the file object and a boolean indicating whether
+ this was a new file (that the caller needs to close). If False, return
+ only the new file.
+ encoding : str or None, default: None
+ Passed as the *mode* argument to `open` when *fname* is `str` or
+ `os.PathLike`; ignored if *fname* is file-like.
+
+ Returns
+ -------
+ fh : file-like
+ opened : bool
+ *opened* is only returned if *return_opened* is True.
+ """
+ if isinstance(fname, os.PathLike):
+ fname = os.fspath(fname)
+ if isinstance(fname, str):
+ if fname.endswith('.gz'):
+ fh = gzip.open(fname, flag)
+ elif fname.endswith('.bz2'):
+ # python may not be compiled with bz2 support,
+ # bury import until we need it
+ import bz2
+ fh = bz2.BZ2File(fname, flag)
+ else:
+ fh = open(fname, flag, encoding=encoding)
+ opened = True
+ elif hasattr(fname, 'seek'):
+ fh = fname
+ opened = False
+ else:
+ raise ValueError('fname must be a PathLike or file handle')
+ if return_opened:
+ return fh, opened
+ return fh
+
+
+def open_file_cm(path_or_file, mode="r", encoding=None):
+ r"""Pass through file objects and context-manage path-likes."""
+ fh, opened = to_filehandle(path_or_file, mode, True, encoding)
+ return fh if opened else contextlib.nullcontext(fh)
+
+
+def is_scalar_or_string(val):
+ """Return whether the given object is a scalar or string like."""
+ return isinstance(val, str) or not np.iterable(val)
+
+
+def get_sample_data(fname, asfileobj=True):
+ """
+ Return a sample data file. *fname* is a path relative to the
+ :file:`mpl-data/sample_data` directory. If *asfileobj* is `True`
+ return a file object, otherwise just a file path.
+
+ Sample data files are stored in the 'mpl-data/sample_data' directory within
+ the Matplotlib package.
+
+ If the filename ends in .gz, the file is implicitly ungzipped. If the
+ filename ends with .npy or .npz, and *asfileobj* is `True`, the file is
+ loaded with `numpy.load`.
+ """
+ path = _get_data_path('sample_data', fname)
+ if asfileobj:
+ suffix = path.suffix.lower()
+ if suffix == '.gz':
+ return gzip.open(path)
+ elif suffix in ['.npy', '.npz']:
+ return np.load(path)
+ elif suffix in ['.csv', '.xrc', '.txt']:
+ return path.open('r')
+ else:
+ return path.open('rb')
+ else:
+ return str(path)
+
+
+def _get_data_path(*args):
+ """
+ Return the `pathlib.Path` to a resource file provided by Matplotlib.
+
+ ``*args`` specify a path relative to the base data path.
+ """
+ return Path(matplotlib.get_data_path(), *args)
+
+
+def flatten(seq, scalarp=is_scalar_or_string):
+ """
+ Return a generator of flattened nested containers.
+
+ For example:
+
+ >>> from matplotlib.cbook import flatten
+ >>> l = (('John', ['Hunter']), (1, 23), [[([42, (5, 23)], )]])
+ >>> print(list(flatten(l)))
+ ['John', 'Hunter', 1, 23, 42, 5, 23]
+
+ By: Composite of Holger Krekel and Luther Blissett
+ From: https://code.activestate.com/recipes/121294-simple-generator-for-flattening-nested-containers/
+ and Recipe 1.12 in cookbook
+ """ # noqa: E501
+ for item in seq:
+ if scalarp(item) or item is None:
+ yield item
+ else:
+ yield from flatten(item, scalarp)
+
+
+class _Stack:
+ """
+ Stack of elements with a movable cursor.
+
+ Mimics home/back/forward in a web browser.
+ """
+
+ def __init__(self):
+ self._pos = -1
+ self._elements = []
+
+ def clear(self):
+ """Empty the stack."""
+ self._pos = -1
+ self._elements = []
+
+ def __call__(self):
+ """Return the current element, or None."""
+ return self._elements[self._pos] if self._elements else None
+
+ def __len__(self):
+ return len(self._elements)
+
+ def __getitem__(self, ind):
+ return self._elements[ind]
+
+ def forward(self):
+ """Move the position forward and return the current element."""
+ self._pos = min(self._pos + 1, len(self._elements) - 1)
+ return self()
+
+ def back(self):
+ """Move the position back and return the current element."""
+ self._pos = max(self._pos - 1, 0)
+ return self()
+
+ def push(self, o):
+ """
+ Push *o* to the stack after the current position, and return *o*.
+
+ Discard all later elements.
+ """
+ self._elements[self._pos + 1:] = [o]
+ self._pos = len(self._elements) - 1
+ return o
+
+ def home(self):
+ """
+ Push the first element onto the top of the stack.
+
+ The first element is returned.
+ """
+ return self.push(self._elements[0]) if self._elements else None
+
+
+def safe_masked_invalid(x, copy=False):
+ x = np.array(x, subok=True, copy=copy)
+ if not x.dtype.isnative:
+ # If we have already made a copy, do the byteswap in place, else make a
+ # copy with the byte order swapped.
+ # Swap to native order.
+ x = x.byteswap(inplace=copy).view(x.dtype.newbyteorder('N'))
+ try:
+ xm = np.ma.masked_where(~(np.isfinite(x)), x, copy=False)
+ except TypeError:
+ return x
+ return xm
+
+
+def print_cycles(objects, outstream=sys.stdout, show_progress=False):
+ """
+ Print loops of cyclic references in the given *objects*.
+
+ It is often useful to pass in ``gc.garbage`` to find the cycles that are
+ preventing some objects from being garbage collected.
+
+ Parameters
+ ----------
+ objects
+ A list of objects to find cycles in.
+ outstream
+ The stream for output.
+ show_progress : bool
+ If True, print the number of objects reached as they are found.
+ """
+ import gc
+
+ def print_path(path):
+ for i, step in enumerate(path):
+ # next "wraps around"
+ next = path[(i + 1) % len(path)]
+
+ outstream.write(" %s -- " % type(step))
+ if isinstance(step, dict):
+ for key, val in step.items():
+ if val is next:
+ outstream.write(f"[{key!r}]")
+ break
+ if key is next:
+ outstream.write(f"[key] = {val!r}")
+ break
+ elif isinstance(step, list):
+ outstream.write("[%d]" % step.index(next))
+ elif isinstance(step, tuple):
+ outstream.write("( tuple )")
+ else:
+ outstream.write(repr(step))
+ outstream.write(" ->\n")
+ outstream.write("\n")
+
+ def recurse(obj, start, all, current_path):
+ if show_progress:
+ outstream.write("%d\r" % len(all))
+
+ all[id(obj)] = None
+
+ referents = gc.get_referents(obj)
+ for referent in referents:
+ # If we've found our way back to the start, this is
+ # a cycle, so print it out
+ if referent is start:
+ print_path(current_path)
+
+ # Don't go back through the original list of objects, or
+ # through temporary references to the object, since those
+ # are just an artifact of the cycle detector itself.
+ elif referent is objects or isinstance(referent, types.FrameType):
+ continue
+
+ # We haven't seen this object before, so recurse
+ elif id(referent) not in all:
+ recurse(referent, start, all, current_path + [obj])
+
+ for obj in objects:
+ outstream.write(f"Examining: {obj!r}\n")
+ recurse(obj, obj, {}, [])
+
+
+class Grouper:
+ """
+ A disjoint-set data structure.
+
+ Objects can be joined using :meth:`join`, tested for connectedness
+ using :meth:`joined`, and all disjoint sets can be retrieved by
+ using the object as an iterator.
+
+ The objects being joined must be hashable and weak-referenceable.
+
+ Examples
+ --------
+ >>> from matplotlib.cbook import Grouper
+ >>> class Foo:
+ ... def __init__(self, s):
+ ... self.s = s
+ ... def __repr__(self):
+ ... return self.s
+ ...
+ >>> a, b, c, d, e, f = [Foo(x) for x in 'abcdef']
+ >>> grp = Grouper()
+ >>> grp.join(a, b)
+ >>> grp.join(b, c)
+ >>> grp.join(d, e)
+ >>> list(grp)
+ [[a, b, c], [d, e]]
+ >>> grp.joined(a, b)
+ True
+ >>> grp.joined(a, c)
+ True
+ >>> grp.joined(a, d)
+ False
+ """
+
+ def __init__(self, init=()):
+ self._mapping = weakref.WeakKeyDictionary(
+ {x: weakref.WeakSet([x]) for x in init})
+ self._ordering = weakref.WeakKeyDictionary()
+ for x in init:
+ if x not in self._ordering:
+ self._ordering[x] = len(self._ordering)
+ self._next_order = len(self._ordering) # Plain int to simplify pickling.
+
+ def __getstate__(self):
+ return {
+ **vars(self),
+ # Convert weak refs to strong ones.
+ "_mapping": {k: set(v) for k, v in self._mapping.items()},
+ "_ordering": {**self._ordering},
+ }
+
+ def __setstate__(self, state):
+ vars(self).update(state)
+ # Convert strong refs to weak ones.
+ self._mapping = weakref.WeakKeyDictionary(
+ {k: weakref.WeakSet(v) for k, v in self._mapping.items()})
+ self._ordering = weakref.WeakKeyDictionary(self._ordering)
+
+ def __contains__(self, item):
+ return item in self._mapping
+
+ def join(self, a, *args):
+ """
+ Join given arguments into the same set. Accepts one or more arguments.
+ """
+ mapping = self._mapping
+ try:
+ set_a = mapping[a]
+ except KeyError:
+ set_a = mapping[a] = weakref.WeakSet([a])
+ self._ordering[a] = self._next_order
+ self._next_order += 1
+ for arg in args:
+ try:
+ set_b = mapping[arg]
+ except KeyError:
+ set_b = mapping[arg] = weakref.WeakSet([arg])
+ self._ordering[arg] = self._next_order
+ self._next_order += 1
+ if set_b is not set_a:
+ if len(set_b) > len(set_a):
+ set_a, set_b = set_b, set_a
+ set_a.update(set_b)
+ for elem in set_b:
+ mapping[elem] = set_a
+
+ def joined(self, a, b):
+ """Return whether *a* and *b* are members of the same set."""
+ return (self._mapping.get(a, object()) is self._mapping.get(b))
+
+ def remove(self, a):
+ """Remove *a* from the grouper, doing nothing if it is not there."""
+ self._mapping.pop(a, {a}).remove(a)
+ self._ordering.pop(a, None)
+
+ def __iter__(self):
+ """
+ Iterate over each of the disjoint sets as a list.
+
+ The iterator is invalid if interleaved with calls to join().
+ """
+ unique_groups = {id(group): group for group in self._mapping.values()}
+ for group in unique_groups.values():
+ yield sorted(group, key=self._ordering.__getitem__)
+
+ def get_siblings(self, a):
+ """Return all of the items joined with *a*, including itself."""
+ siblings = self._mapping.get(a, [a])
+ return sorted(siblings, key=self._ordering.get)
+
+
+class GrouperView:
+ """Immutable view over a `.Grouper`."""
+
+ def __init__(self, grouper): self._grouper = grouper
+ def __contains__(self, item): return item in self._grouper
+ def __iter__(self): return iter(self._grouper)
+
+ def joined(self, a, b):
+ """
+ Return whether *a* and *b* are members of the same set.
+ """
+ return self._grouper.joined(a, b)
+
+ def get_siblings(self, a):
+ """
+ Return all of the items joined with *a*, including itself.
+ """
+ return self._grouper.get_siblings(a)
+
+
+def simple_linear_interpolation(a, steps):
+ """
+ Resample an array with ``steps - 1`` points between original point pairs.
+
+ Along each column of *a*, ``(steps - 1)`` points are introduced between
+ each original values; the values are linearly interpolated.
+
+ Parameters
+ ----------
+ a : array, shape (n, ...)
+ steps : int
+
+ Returns
+ -------
+ array
+ shape ``((n - 1) * steps + 1, ...)``
+ """
+ fps = a.reshape((len(a), -1))
+ xp = np.arange(len(a)) * steps
+ x = np.arange((len(a) - 1) * steps + 1)
+ return (np.column_stack([np.interp(x, xp, fp) for fp in fps.T])
+ .reshape((len(x),) + a.shape[1:]))
+
+
+def delete_masked_points(*args):
+ """
+ Find all masked and/or non-finite points in a set of arguments,
+ and return the arguments with only the unmasked points remaining.
+
+ Arguments can be in any of 5 categories:
+
+ 1) 1-D masked arrays
+ 2) 1-D ndarrays
+ 3) ndarrays with more than one dimension
+ 4) other non-string iterables
+ 5) anything else
+
+ The first argument must be in one of the first four categories;
+ any argument with a length differing from that of the first
+ argument (and hence anything in category 5) then will be
+ passed through unchanged.
+
+ Masks are obtained from all arguments of the correct length
+ in categories 1, 2, and 4; a point is bad if masked in a masked
+ array or if it is a nan or inf. No attempt is made to
+ extract a mask from categories 2, 3, and 4 if `numpy.isfinite`
+ does not yield a Boolean array.
+
+ All input arguments that are not passed unchanged are returned
+ as ndarrays after removing the points or rows corresponding to
+ masks in any of the arguments.
+
+ A vastly simpler version of this function was originally
+ written as a helper for Axes.scatter().
+
+ """
+ if not len(args):
+ return ()
+ if is_scalar_or_string(args[0]):
+ raise ValueError("First argument must be a sequence")
+ nrecs = len(args[0])
+ margs = []
+ seqlist = [False] * len(args)
+ for i, x in enumerate(args):
+ if not isinstance(x, str) and np.iterable(x) and len(x) == nrecs:
+ seqlist[i] = True
+ if isinstance(x, np.ma.MaskedArray):
+ if x.ndim > 1:
+ raise ValueError("Masked arrays must be 1-D")
+ else:
+ x = np.asarray(x)
+ margs.append(x)
+ masks = [] # List of masks that are True where good.
+ for i, x in enumerate(margs):
+ if seqlist[i]:
+ if x.ndim > 1:
+ continue # Don't try to get nan locations unless 1-D.
+ if isinstance(x, np.ma.MaskedArray):
+ masks.append(~np.ma.getmaskarray(x)) # invert the mask
+ xd = x.data
+ else:
+ xd = x
+ try:
+ mask = np.isfinite(xd)
+ if isinstance(mask, np.ndarray):
+ masks.append(mask)
+ except Exception: # Fixme: put in tuple of possible exceptions?
+ pass
+ if len(masks):
+ mask = np.logical_and.reduce(masks)
+ igood = mask.nonzero()[0]
+ if len(igood) < nrecs:
+ for i, x in enumerate(margs):
+ if seqlist[i]:
+ margs[i] = x[igood]
+ for i, x in enumerate(margs):
+ if seqlist[i] and isinstance(x, np.ma.MaskedArray):
+ margs[i] = x.filled()
+ return margs
+
+
+def _combine_masks(*args):
+ """
+ Find all masked and/or non-finite points in a set of arguments,
+ and return the arguments as masked arrays with a common mask.
+
+ Arguments can be in any of 5 categories:
+
+ 1) 1-D masked arrays
+ 2) 1-D ndarrays
+ 3) ndarrays with more than one dimension
+ 4) other non-string iterables
+ 5) anything else
+
+ The first argument must be in one of the first four categories;
+ any argument with a length differing from that of the first
+ argument (and hence anything in category 5) then will be
+ passed through unchanged.
+
+ Masks are obtained from all arguments of the correct length
+ in categories 1, 2, and 4; a point is bad if masked in a masked
+ array or if it is a nan or inf. No attempt is made to
+ extract a mask from categories 2 and 4 if `numpy.isfinite`
+ does not yield a Boolean array. Category 3 is included to
+ support RGB or RGBA ndarrays, which are assumed to have only
+ valid values and which are passed through unchanged.
+
+ All input arguments that are not passed unchanged are returned
+ as masked arrays if any masked points are found, otherwise as
+ ndarrays.
+
+ """
+ if not len(args):
+ return ()
+ if is_scalar_or_string(args[0]):
+ raise ValueError("First argument must be a sequence")
+ nrecs = len(args[0])
+ margs = [] # Output args; some may be modified.
+ seqlist = [False] * len(args) # Flags: True if output will be masked.
+ masks = [] # List of masks.
+ for i, x in enumerate(args):
+ if is_scalar_or_string(x) or len(x) != nrecs:
+ margs.append(x) # Leave it unmodified.
+ else:
+ if isinstance(x, np.ma.MaskedArray) and x.ndim > 1:
+ raise ValueError("Masked arrays must be 1-D")
+ try:
+ x = np.asanyarray(x)
+ except (VisibleDeprecationWarning, ValueError):
+ # NumPy 1.19 raises a warning about ragged arrays, but we want
+ # to accept basically anything here.
+ x = np.asanyarray(x, dtype=object)
+ if x.ndim == 1:
+ x = safe_masked_invalid(x)
+ seqlist[i] = True
+ if np.ma.is_masked(x):
+ masks.append(np.ma.getmaskarray(x))
+ margs.append(x) # Possibly modified.
+ if len(masks):
+ mask = np.logical_or.reduce(masks)
+ for i, x in enumerate(margs):
+ if seqlist[i]:
+ margs[i] = np.ma.array(x, mask=mask)
+ return margs
+
+
+def _broadcast_with_masks(*args, compress=False):
+ """
+ Broadcast inputs, combining all masked arrays.
+
+ Parameters
+ ----------
+ *args : array-like
+ The inputs to broadcast.
+ compress : bool, default: False
+ Whether to compress the masked arrays. If False, the masked values
+ are replaced by NaNs.
+
+ Returns
+ -------
+ list of array-like
+ The broadcasted and masked inputs.
+ """
+ # extract the masks, if any
+ masks = [k.mask for k in args if isinstance(k, np.ma.MaskedArray)]
+ # broadcast to match the shape
+ bcast = np.broadcast_arrays(*args, *masks)
+ inputs = bcast[:len(args)]
+ masks = bcast[len(args):]
+ if masks:
+ # combine the masks into one
+ mask = np.logical_or.reduce(masks)
+ # put mask on and compress
+ if compress:
+ inputs = [np.ma.array(k, mask=mask).compressed()
+ for k in inputs]
+ else:
+ inputs = [np.ma.array(k, mask=mask, dtype=float).filled(np.nan).ravel()
+ for k in inputs]
+ else:
+ inputs = [np.ravel(k) for k in inputs]
+ return inputs
+
+
+def boxplot_stats(X, whis=1.5, bootstrap=None, labels=None, autorange=False):
+ r"""
+ Return a list of dictionaries of statistics used to draw a series of box
+ and whisker plots using `~.Axes.bxp`.
+
+ Parameters
+ ----------
+ X : array-like
+ Data that will be represented in the boxplots. Should have 2 or
+ fewer dimensions.
+
+ whis : float or (float, float), default: 1.5
+ The position of the whiskers.
+
+ If a float, the lower whisker is at the lowest datum above
+ ``Q1 - whis*(Q3-Q1)``, and the upper whisker at the highest datum below
+ ``Q3 + whis*(Q3-Q1)``, where Q1 and Q3 are the first and third
+ quartiles. The default value of ``whis = 1.5`` corresponds to Tukey's
+ original definition of boxplots.
+
+ If a pair of floats, they indicate the percentiles at which to draw the
+ whiskers (e.g., (5, 95)). In particular, setting this to (0, 100)
+ results in whiskers covering the whole range of the data.
+
+ In the edge case where ``Q1 == Q3``, *whis* is automatically set to
+ (0, 100) (cover the whole range of the data) if *autorange* is True.
+
+ Beyond the whiskers, data are considered outliers and are plotted as
+ individual points.
+
+ bootstrap : int, optional
+ Number of times the confidence intervals around the median
+ should be bootstrapped (percentile method).
+
+ labels : list of str, optional
+ Labels for each dataset. Length must be compatible with
+ dimensions of *X*.
+
+ autorange : bool, optional (False)
+ When `True` and the data are distributed such that the 25th and 75th
+ percentiles are equal, ``whis`` is set to (0, 100) such that the
+ whisker ends are at the minimum and maximum of the data.
+
+ Returns
+ -------
+ list of dict
+ A list of dictionaries containing the results for each column
+ of data. Keys of each dictionary are the following:
+
+ ======== ===================================
+ Key Value Description
+ ======== ===================================
+ label tick label for the boxplot
+ mean arithmetic mean value
+ med 50th percentile
+ q1 first quartile (25th percentile)
+ q3 third quartile (75th percentile)
+ iqr interquartile range
+ cilo lower notch around the median
+ cihi upper notch around the median
+ whislo end of the lower whisker
+ whishi end of the upper whisker
+ fliers outliers
+ ======== ===================================
+
+ Notes
+ -----
+ Non-bootstrapping approach to confidence interval uses Gaussian-based
+ asymptotic approximation:
+
+ .. math::
+
+ \mathrm{med} \pm 1.57 \times \frac{\mathrm{iqr}}{\sqrt{N}}
+
+ General approach from:
+ McGill, R., Tukey, J.W., and Larsen, W.A. (1978) "Variations of
+ Boxplots", The American Statistician, 32:12-16.
+ """
+
+ def _bootstrap_median(data, N=5000):
+ # determine 95% confidence intervals of the median
+ M = len(data)
+ percentiles = [2.5, 97.5]
+
+ bs_index = np.random.randint(M, size=(N, M))
+ bsData = data[bs_index]
+ estimate = np.median(bsData, axis=1, overwrite_input=True)
+
+ CI = np.percentile(estimate, percentiles)
+ return CI
+
+ def _compute_conf_interval(data, med, iqr, bootstrap):
+ if bootstrap is not None:
+ # Do a bootstrap estimate of notch locations.
+ # get conf. intervals around median
+ CI = _bootstrap_median(data, N=bootstrap)
+ notch_min = CI[0]
+ notch_max = CI[1]
+ else:
+
+ N = len(data)
+ notch_min = med - 1.57 * iqr / np.sqrt(N)
+ notch_max = med + 1.57 * iqr / np.sqrt(N)
+
+ return notch_min, notch_max
+
+ # output is a list of dicts
+ bxpstats = []
+
+ # convert X to a list of lists
+ X = _reshape_2D(X, "X")
+
+ ncols = len(X)
+ if labels is None:
+ labels = itertools.repeat(None)
+ elif len(labels) != ncols:
+ raise ValueError("Dimensions of labels and X must be compatible")
+
+ input_whis = whis
+ for ii, (x, label) in enumerate(zip(X, labels)):
+
+ # empty dict
+ stats = {}
+ if label is not None:
+ stats['label'] = label
+
+ # restore whis to the input values in case it got changed in the loop
+ whis = input_whis
+
+ # note tricksiness, append up here and then mutate below
+ bxpstats.append(stats)
+
+ # if empty, bail
+ if len(x) == 0:
+ stats['fliers'] = np.array([])
+ stats['mean'] = np.nan
+ stats['med'] = np.nan
+ stats['q1'] = np.nan
+ stats['q3'] = np.nan
+ stats['iqr'] = np.nan
+ stats['cilo'] = np.nan
+ stats['cihi'] = np.nan
+ stats['whislo'] = np.nan
+ stats['whishi'] = np.nan
+ continue
+
+ # up-convert to an array, just to be safe
+ x = np.ma.asarray(x)
+ x = x.data[~x.mask].ravel()
+
+ # arithmetic mean
+ stats['mean'] = np.mean(x)
+
+ # medians and quartiles
+ q1, med, q3 = np.percentile(x, [25, 50, 75])
+
+ # interquartile range
+ stats['iqr'] = q3 - q1
+ if stats['iqr'] == 0 and autorange:
+ whis = (0, 100)
+
+ # conf. interval around median
+ stats['cilo'], stats['cihi'] = _compute_conf_interval(
+ x, med, stats['iqr'], bootstrap
+ )
+
+ # lowest/highest non-outliers
+ if np.iterable(whis) and not isinstance(whis, str):
+ loval, hival = np.percentile(x, whis)
+ elif np.isreal(whis):
+ loval = q1 - whis * stats['iqr']
+ hival = q3 + whis * stats['iqr']
+ else:
+ raise ValueError('whis must be a float or list of percentiles')
+
+ # get high extreme
+ wiskhi = x[x <= hival]
+ if len(wiskhi) == 0 or np.max(wiskhi) < q3:
+ stats['whishi'] = q3
+ else:
+ stats['whishi'] = np.max(wiskhi)
+
+ # get low extreme
+ wisklo = x[x >= loval]
+ if len(wisklo) == 0 or np.min(wisklo) > q1:
+ stats['whislo'] = q1
+ else:
+ stats['whislo'] = np.min(wisklo)
+
+ # compute a single array of outliers
+ stats['fliers'] = np.concatenate([
+ x[x < stats['whislo']],
+ x[x > stats['whishi']],
+ ])
+
+ # add in the remaining stats
+ stats['q1'], stats['med'], stats['q3'] = q1, med, q3
+
+ return bxpstats
+
+
+#: Maps short codes for line style to their full name used by backends.
+ls_mapper = {'-': 'solid', '--': 'dashed', '-.': 'dashdot', ':': 'dotted'}
+#: Maps full names for line styles used by backends to their short codes.
+ls_mapper_r = {v: k for k, v in ls_mapper.items()}
+
+
+def contiguous_regions(mask):
+ """
+ Return a list of (ind0, ind1) such that ``mask[ind0:ind1].all()`` is
+ True and we cover all such regions.
+ """
+ mask = np.asarray(mask, dtype=bool)
+
+ if not mask.size:
+ return []
+
+ # Find the indices of region changes, and correct offset
+ idx, = np.nonzero(mask[:-1] != mask[1:])
+ idx += 1
+
+ # List operations are faster for moderately sized arrays
+ idx = idx.tolist()
+
+ # Add first and/or last index if needed
+ if mask[0]:
+ idx = [0] + idx
+ if mask[-1]:
+ idx.append(len(mask))
+
+ return list(zip(idx[::2], idx[1::2]))
+
+
+def is_math_text(s):
+ """
+ Return whether the string *s* contains math expressions.
+
+ This is done by checking whether *s* contains an even number of
+ non-escaped dollar signs.
+ """
+ s = str(s)
+ dollar_count = s.count(r'$') - s.count(r'\$')
+ even_dollars = (dollar_count > 0 and dollar_count % 2 == 0)
+ return even_dollars
+
+
+def _to_unmasked_float_array(x):
+ """
+ Convert a sequence to a float array; if input was a masked array, masked
+ values are converted to nans.
+ """
+ if hasattr(x, 'mask'):
+ return np.ma.asarray(x, float).filled(np.nan)
+ else:
+ return np.asarray(x, float)
+
+
+def _check_1d(x):
+ """Convert scalars to 1D arrays; pass-through arrays as is."""
+ # Unpack in case of e.g. Pandas or xarray object
+ x = _unpack_to_numpy(x)
+ # plot requires `shape` and `ndim`. If passed an
+ # object that doesn't provide them, then force to numpy array.
+ # Note this will strip unit information.
+ if (not hasattr(x, 'shape') or
+ not hasattr(x, 'ndim') or
+ len(x.shape) < 1):
+ return np.atleast_1d(x)
+ else:
+ return x
+
+
+def _reshape_2D(X, name):
+ """
+ Use Fortran ordering to convert ndarrays and lists of iterables to lists of
+ 1D arrays.
+
+ Lists of iterables are converted by applying `numpy.asanyarray` to each of
+ their elements. 1D ndarrays are returned in a singleton list containing
+ them. 2D ndarrays are converted to the list of their *columns*.
+
+ *name* is used to generate the error message for invalid inputs.
+ """
+
+ # Unpack in case of e.g. Pandas or xarray object
+ X = _unpack_to_numpy(X)
+
+ # Iterate over columns for ndarrays.
+ if isinstance(X, np.ndarray):
+ X = X.transpose()
+
+ if len(X) == 0:
+ return [[]]
+ elif X.ndim == 1 and np.ndim(X[0]) == 0:
+ # 1D array of scalars: directly return it.
+ return [X]
+ elif X.ndim in [1, 2]:
+ # 2D array, or 1D array of iterables: flatten them first.
+ return [np.reshape(x, -1) for x in X]
+ else:
+ raise ValueError(f'{name} must have 2 or fewer dimensions')
+
+ # Iterate over list of iterables.
+ if len(X) == 0:
+ return [[]]
+
+ result = []
+ is_1d = True
+ for xi in X:
+ # check if this is iterable, except for strings which we
+ # treat as singletons.
+ if not isinstance(xi, str):
+ try:
+ iter(xi)
+ except TypeError:
+ pass
+ else:
+ is_1d = False
+ xi = np.asanyarray(xi)
+ nd = np.ndim(xi)
+ if nd > 1:
+ raise ValueError(f'{name} must have 2 or fewer dimensions')
+ result.append(xi.reshape(-1))
+
+ if is_1d:
+ # 1D array of scalars: directly return it.
+ return [np.reshape(result, -1)]
+ else:
+ # 2D array, or 1D array of iterables: use flattened version.
+ return result
+
+
+def violin_stats(X, method, points=100, quantiles=None):
+ """
+ Return a list of dictionaries of data which can be used to draw a series
+ of violin plots.
+
+ See the ``Returns`` section below to view the required keys of the
+ dictionary.
+
+ Users can skip this function and pass a user-defined set of dictionaries
+ with the same keys to `~.axes.Axes.violinplot` instead of using Matplotlib
+ to do the calculations. See the *Returns* section below for the keys
+ that must be present in the dictionaries.
+
+ Parameters
+ ----------
+ X : array-like
+ Sample data that will be used to produce the gaussian kernel density
+ estimates. Must have 2 or fewer dimensions.
+
+ method : callable
+ The method used to calculate the kernel density estimate for each
+ column of data. When called via ``method(v, coords)``, it should
+ return a vector of the values of the KDE evaluated at the values
+ specified in coords.
+
+ points : int, default: 100
+ Defines the number of points to evaluate each of the gaussian kernel
+ density estimates at.
+
+ quantiles : array-like, default: None
+ Defines (if not None) a list of floats in interval [0, 1] for each
+ column of data, which represents the quantiles that will be rendered
+ for that column of data. Must have 2 or fewer dimensions. 1D array will
+ be treated as a singleton list containing them.
+
+ Returns
+ -------
+ list of dict
+ A list of dictionaries containing the results for each column of data.
+ The dictionaries contain at least the following:
+
+ - coords: A list of scalars containing the coordinates this particular
+ kernel density estimate was evaluated at.
+ - vals: A list of scalars containing the values of the kernel density
+ estimate at each of the coordinates given in *coords*.
+ - mean: The mean value for this column of data.
+ - median: The median value for this column of data.
+ - min: The minimum value for this column of data.
+ - max: The maximum value for this column of data.
+ - quantiles: The quantile values for this column of data.
+ """
+
+ # List of dictionaries describing each of the violins.
+ vpstats = []
+
+ # Want X to be a list of data sequences
+ X = _reshape_2D(X, "X")
+
+ # Want quantiles to be as the same shape as data sequences
+ if quantiles is not None and len(quantiles) != 0:
+ quantiles = _reshape_2D(quantiles, "quantiles")
+ # Else, mock quantiles if it's none or empty
+ else:
+ quantiles = [[]] * len(X)
+
+ # quantiles should have the same size as dataset
+ if len(X) != len(quantiles):
+ raise ValueError("List of violinplot statistics and quantiles values"
+ " must have the same length")
+
+ # Zip x and quantiles
+ for (x, q) in zip(X, quantiles):
+ # Dictionary of results for this distribution
+ stats = {}
+
+ # Calculate basic stats for the distribution
+ min_val = np.min(x)
+ max_val = np.max(x)
+ quantile_val = np.percentile(x, 100 * q)
+
+ # Evaluate the kernel density estimate
+ coords = np.linspace(min_val, max_val, points)
+ stats['vals'] = method(x, coords)
+ stats['coords'] = coords
+
+ # Store additional statistics for this distribution
+ stats['mean'] = np.mean(x)
+ stats['median'] = np.median(x)
+ stats['min'] = min_val
+ stats['max'] = max_val
+ stats['quantiles'] = np.atleast_1d(quantile_val)
+
+ # Append to output
+ vpstats.append(stats)
+
+ return vpstats
+
+
+def pts_to_prestep(x, *args):
+ """
+ Convert continuous line to pre-steps.
+
+ Given a set of ``N`` points, convert to ``2N - 1`` points, which when
+ connected linearly give a step function which changes values at the
+ beginning of the intervals.
+
+ Parameters
+ ----------
+ x : array
+ The x location of the steps. May be empty.
+
+ y1, ..., yp : array
+ y arrays to be turned into steps; all must be the same length as ``x``.
+
+ Returns
+ -------
+ array
+ The x and y values converted to steps in the same order as the input;
+ can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is
+ length ``N``, each of these arrays will be length ``2N + 1``. For
+ ``N=0``, the length will be 0.
+
+ Examples
+ --------
+ >>> x_s, y1_s, y2_s = pts_to_prestep(x, y1, y2)
+ """
+ steps = np.zeros((1 + len(args), max(2 * len(x) - 1, 0)))
+ # In all `pts_to_*step` functions, only assign once using *x* and *args*,
+ # as converting to an array may be expensive.
+ steps[0, 0::2] = x
+ steps[0, 1::2] = steps[0, 0:-2:2]
+ steps[1:, 0::2] = args
+ steps[1:, 1::2] = steps[1:, 2::2]
+ return steps
+
+
+def pts_to_poststep(x, *args):
+ """
+ Convert continuous line to post-steps.
+
+ Given a set of ``N`` points convert to ``2N + 1`` points, which when
+ connected linearly give a step function which changes values at the end of
+ the intervals.
+
+ Parameters
+ ----------
+ x : array
+ The x location of the steps. May be empty.
+
+ y1, ..., yp : array
+ y arrays to be turned into steps; all must be the same length as ``x``.
+
+ Returns
+ -------
+ array
+ The x and y values converted to steps in the same order as the input;
+ can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is
+ length ``N``, each of these arrays will be length ``2N + 1``. For
+ ``N=0``, the length will be 0.
+
+ Examples
+ --------
+ >>> x_s, y1_s, y2_s = pts_to_poststep(x, y1, y2)
+ """
+ steps = np.zeros((1 + len(args), max(2 * len(x) - 1, 0)))
+ steps[0, 0::2] = x
+ steps[0, 1::2] = steps[0, 2::2]
+ steps[1:, 0::2] = args
+ steps[1:, 1::2] = steps[1:, 0:-2:2]
+ return steps
+
+
+def pts_to_midstep(x, *args):
+ """
+ Convert continuous line to mid-steps.
+
+ Given a set of ``N`` points convert to ``2N`` points which when connected
+ linearly give a step function which changes values at the middle of the
+ intervals.
+
+ Parameters
+ ----------
+ x : array
+ The x location of the steps. May be empty.
+
+ y1, ..., yp : array
+ y arrays to be turned into steps; all must be the same length as
+ ``x``.
+
+ Returns
+ -------
+ array
+ The x and y values converted to steps in the same order as the input;
+ can be unpacked as ``x_out, y1_out, ..., yp_out``. If the input is
+ length ``N``, each of these arrays will be length ``2N``.
+
+ Examples
+ --------
+ >>> x_s, y1_s, y2_s = pts_to_midstep(x, y1, y2)
+ """
+ steps = np.zeros((1 + len(args), 2 * len(x)))
+ x = np.asanyarray(x)
+ steps[0, 1:-1:2] = steps[0, 2::2] = (x[:-1] + x[1:]) / 2
+ steps[0, :1] = x[:1] # Also works for zero-sized input.
+ steps[0, -1:] = x[-1:]
+ steps[1:, 0::2] = args
+ steps[1:, 1::2] = steps[1:, 0::2]
+ return steps
+
+
+STEP_LOOKUP_MAP = {'default': lambda x, y: (x, y),
+ 'steps': pts_to_prestep,
+ 'steps-pre': pts_to_prestep,
+ 'steps-post': pts_to_poststep,
+ 'steps-mid': pts_to_midstep}
+
+
+def index_of(y):
+ """
+ A helper function to create reasonable x values for the given *y*.
+
+ This is used for plotting (x, y) if x values are not explicitly given.
+
+ First try ``y.index`` (assuming *y* is a `pandas.Series`), if that
+ fails, use ``range(len(y))``.
+
+ This will be extended in the future to deal with more types of
+ labeled data.
+
+ Parameters
+ ----------
+ y : float or array-like
+
+ Returns
+ -------
+ x, y : ndarray
+ The x and y values to plot.
+ """
+ try:
+ return y.index.to_numpy(), y.to_numpy()
+ except AttributeError:
+ pass
+ try:
+ y = _check_1d(y)
+ except (VisibleDeprecationWarning, ValueError):
+ # NumPy 1.19 will warn on ragged input, and we can't actually use it.
+ pass
+ else:
+ return np.arange(y.shape[0], dtype=float), y
+ raise ValueError('Input could not be cast to an at-least-1D NumPy array')
+
+
+def safe_first_element(obj):
+ """
+ Return the first element in *obj*.
+
+ This is a type-independent way of obtaining the first element,
+ supporting both index access and the iterator protocol.
+ """
+ if isinstance(obj, collections.abc.Iterator):
+ # needed to accept `array.flat` as input.
+ # np.flatiter reports as an instance of collections.Iterator but can still be
+ # indexed via []. This has the side effect of re-setting the iterator, but
+ # that is acceptable.
+ try:
+ return obj[0]
+ except TypeError:
+ pass
+ raise RuntimeError("matplotlib does not support generators as input")
+ return next(iter(obj))
+
+
+def _safe_first_finite(obj):
+ """
+ Return the first finite element in *obj* if one is available and skip_nonfinite is
+ True. Otherwise, return the first element.
+
+ This is a method for internal use.
+
+ This is a type-independent way of obtaining the first finite element, supporting
+ both index access and the iterator protocol.
+ """
+ def safe_isfinite(val):
+ if val is None:
+ return False
+ try:
+ return math.isfinite(val)
+ except (TypeError, ValueError):
+ # if the outer object is 2d, then val is a 1d array, and
+ # - math.isfinite(numpy.zeros(3)) raises TypeError
+ # - math.isfinite(torch.zeros(3)) raises ValueError
+ pass
+ try:
+ return np.isfinite(val) if np.isscalar(val) else True
+ except TypeError:
+ # This is something that NumPy cannot make heads or tails of,
+ # assume "finite"
+ return True
+
+ if isinstance(obj, np.flatiter):
+ # TODO do the finite filtering on this
+ return obj[0]
+ elif isinstance(obj, collections.abc.Iterator):
+ raise RuntimeError("matplotlib does not support generators as input")
+ else:
+ for val in obj:
+ if safe_isfinite(val):
+ return val
+ return safe_first_element(obj)
+
+
+def sanitize_sequence(data):
+ """
+ Convert dictview objects to list. Other inputs are returned unchanged.
+ """
+ return (list(data) if isinstance(data, collections.abc.MappingView)
+ else data)
+
+
+def normalize_kwargs(kw, alias_mapping=None):
+ """
+ Helper function to normalize kwarg inputs.
+
+ Parameters
+ ----------
+ kw : dict or None
+ A dict of keyword arguments. None is explicitly supported and treated
+ as an empty dict, to support functions with an optional parameter of
+ the form ``props=None``.
+
+ alias_mapping : dict or Artist subclass or Artist instance, optional
+ A mapping between a canonical name to a list of aliases, in order of
+ precedence from lowest to highest.
+
+ If the canonical value is not in the list it is assumed to have the
+ highest priority.
+
+ If an Artist subclass or instance is passed, use its properties alias
+ mapping.
+
+ Raises
+ ------
+ TypeError
+ To match what Python raises if invalid arguments/keyword arguments are
+ passed to a callable.
+ """
+ from matplotlib.artist import Artist
+
+ if kw is None:
+ return {}
+
+ # deal with default value of alias_mapping
+ if alias_mapping is None:
+ alias_mapping = {}
+ elif (isinstance(alias_mapping, type) and issubclass(alias_mapping, Artist)
+ or isinstance(alias_mapping, Artist)):
+ alias_mapping = getattr(alias_mapping, "_alias_map", {})
+
+ to_canonical = {alias: canonical
+ for canonical, alias_list in alias_mapping.items()
+ for alias in alias_list}
+ canonical_to_seen = {}
+ ret = {} # output dictionary
+
+ for k, v in kw.items():
+ canonical = to_canonical.get(k, k)
+ if canonical in canonical_to_seen:
+ raise TypeError(f"Got both {canonical_to_seen[canonical]!r} and "
+ f"{k!r}, which are aliases of one another")
+ canonical_to_seen[canonical] = k
+ ret[canonical] = v
+
+ return ret
+
+
+@contextlib.contextmanager
+def _lock_path(path):
+ """
+ Context manager for locking a path.
+
+ Usage::
+
+ with _lock_path(path):
+ ...
+
+ Another thread or process that attempts to lock the same path will wait
+ until this context manager is exited.
+
+ The lock is implemented by creating a temporary file in the parent
+ directory, so that directory must exist and be writable.
+ """
+ path = Path(path)
+ lock_path = path.with_name(path.name + ".matplotlib-lock")
+ retries = 50
+ sleeptime = 0.1
+ for _ in range(retries):
+ try:
+ with lock_path.open("xb"):
+ break
+ except FileExistsError:
+ time.sleep(sleeptime)
+ else:
+ raise TimeoutError("""\
+Lock error: Matplotlib failed to acquire the following lock file:
+ {}
+This maybe due to another process holding this lock file. If you are sure no
+other Matplotlib process is running, remove this file and try again.""".format(
+ lock_path))
+ try:
+ yield
+ finally:
+ lock_path.unlink()
+
+
+def _topmost_artist(
+ artists,
+ _cached_max=functools.partial(max, key=operator.attrgetter("zorder"))):
+ """
+ Get the topmost artist of a list.
+
+ In case of a tie, return the *last* of the tied artists, as it will be
+ drawn on top of the others. `max` returns the first maximum in case of
+ ties, so we need to iterate over the list in reverse order.
+ """
+ return _cached_max(reversed(artists))
+
+
+def _str_equal(obj, s):
+ """
+ Return whether *obj* is a string equal to string *s*.
+
+ This helper solely exists to handle the case where *obj* is a numpy array,
+ because in such cases, a naive ``obj == s`` would yield an array, which
+ cannot be used in a boolean context.
+ """
+ return isinstance(obj, str) and obj == s
+
+
+def _str_lower_equal(obj, s):
+ """
+ Return whether *obj* is a string equal, when lowercased, to string *s*.
+
+ This helper solely exists to handle the case where *obj* is a numpy array,
+ because in such cases, a naive ``obj == s`` would yield an array, which
+ cannot be used in a boolean context.
+ """
+ return isinstance(obj, str) and obj.lower() == s
+
+
+def _array_perimeter(arr):
+ """
+ Get the elements on the perimeter of *arr*.
+
+ Parameters
+ ----------
+ arr : ndarray, shape (M, N)
+ The input array.
+
+ Returns
+ -------
+ ndarray, shape (2*(M - 1) + 2*(N - 1),)
+ The elements on the perimeter of the array::
+
+ [arr[0, 0], ..., arr[0, -1], ..., arr[-1, -1], ..., arr[-1, 0], ...]
+
+ Examples
+ --------
+ >>> i, j = np.ogrid[:3, :4]
+ >>> a = i*10 + j
+ >>> a
+ array([[ 0, 1, 2, 3],
+ [10, 11, 12, 13],
+ [20, 21, 22, 23]])
+ >>> _array_perimeter(a)
+ array([ 0, 1, 2, 3, 13, 23, 22, 21, 20, 10])
+ """
+ # note we use Python's half-open ranges to avoid repeating
+ # the corners
+ forward = np.s_[0:-1] # [0 ... -1)
+ backward = np.s_[-1:0:-1] # [-1 ... 0)
+ return np.concatenate((
+ arr[0, forward],
+ arr[forward, -1],
+ arr[-1, backward],
+ arr[backward, 0],
+ ))
+
+
+def _unfold(arr, axis, size, step):
+ """
+ Append an extra dimension containing sliding windows along *axis*.
+
+ All windows are of size *size* and begin with every *step* elements.
+
+ Parameters
+ ----------
+ arr : ndarray, shape (N_1, ..., N_k)
+ The input array
+ axis : int
+ Axis along which the windows are extracted
+ size : int
+ Size of the windows
+ step : int
+ Stride between first elements of subsequent windows.
+
+ Returns
+ -------
+ ndarray, shape (N_1, ..., 1 + (N_axis-size)/step, ..., N_k, size)
+
+ Examples
+ --------
+ >>> i, j = np.ogrid[:3, :7]
+ >>> a = i*10 + j
+ >>> a
+ array([[ 0, 1, 2, 3, 4, 5, 6],
+ [10, 11, 12, 13, 14, 15, 16],
+ [20, 21, 22, 23, 24, 25, 26]])
+ >>> _unfold(a, axis=1, size=3, step=2)
+ array([[[ 0, 1, 2],
+ [ 2, 3, 4],
+ [ 4, 5, 6]],
+ [[10, 11, 12],
+ [12, 13, 14],
+ [14, 15, 16]],
+ [[20, 21, 22],
+ [22, 23, 24],
+ [24, 25, 26]]])
+ """
+ new_shape = [*arr.shape, size]
+ new_strides = [*arr.strides, arr.strides[axis]]
+ new_shape[axis] = (new_shape[axis] - size) // step + 1
+ new_strides[axis] = new_strides[axis] * step
+ return np.lib.stride_tricks.as_strided(arr,
+ shape=new_shape,
+ strides=new_strides,
+ writeable=False)
+
+
+def _array_patch_perimeters(x, rstride, cstride):
+ """
+ Extract perimeters of patches from *arr*.
+
+ Extracted patches are of size (*rstride* + 1) x (*cstride* + 1) and
+ share perimeters with their neighbors. The ordering of the vertices matches
+ that returned by ``_array_perimeter``.
+
+ Parameters
+ ----------
+ x : ndarray, shape (N, M)
+ Input array
+ rstride : int
+ Vertical (row) stride between corresponding elements of each patch
+ cstride : int
+ Horizontal (column) stride between corresponding elements of each patch
+
+ Returns
+ -------
+ ndarray, shape (N/rstride * M/cstride, 2 * (rstride + cstride))
+ """
+ assert rstride > 0 and cstride > 0
+ assert (x.shape[0] - 1) % rstride == 0
+ assert (x.shape[1] - 1) % cstride == 0
+ # We build up each perimeter from four half-open intervals. Here is an
+ # illustrated explanation for rstride == cstride == 3
+ #
+ # T T T R
+ # L R
+ # L R
+ # L B B B
+ #
+ # where T means that this element will be in the top array, R for right,
+ # B for bottom and L for left. Each of the arrays below has a shape of:
+ #
+ # (number of perimeters that can be extracted vertically,
+ # number of perimeters that can be extracted horizontally,
+ # cstride for top and bottom and rstride for left and right)
+ #
+ # Note that _unfold doesn't incur any memory copies, so the only costly
+ # operation here is the np.concatenate.
+ top = _unfold(x[:-1:rstride, :-1], 1, cstride, cstride)
+ bottom = _unfold(x[rstride::rstride, 1:], 1, cstride, cstride)[..., ::-1]
+ right = _unfold(x[:-1, cstride::cstride], 0, rstride, rstride)
+ left = _unfold(x[1:, :-1:cstride], 0, rstride, rstride)[..., ::-1]
+ return (np.concatenate((top, right, bottom, left), axis=2)
+ .reshape(-1, 2 * (rstride + cstride)))
+
+
+@contextlib.contextmanager
+def _setattr_cm(obj, **kwargs):
+ """
+ Temporarily set some attributes; restore original state at context exit.
+ """
+ sentinel = object()
+ origs = {}
+ for attr in kwargs:
+ orig = getattr(obj, attr, sentinel)
+ if attr in obj.__dict__ or orig is sentinel:
+ # if we are pulling from the instance dict or the object
+ # does not have this attribute we can trust the above
+ origs[attr] = orig
+ else:
+ # if the attribute is not in the instance dict it must be
+ # from the class level
+ cls_orig = getattr(type(obj), attr)
+ # if we are dealing with a property (but not a general descriptor)
+ # we want to set the original value back.
+ if isinstance(cls_orig, property):
+ origs[attr] = orig
+ # otherwise this is _something_ we are going to shadow at
+ # the instance dict level from higher up in the MRO. We
+ # are going to assume we can delattr(obj, attr) to clean
+ # up after ourselves. It is possible that this code will
+ # fail if used with a non-property custom descriptor which
+ # implements __set__ (and __delete__ does not act like a
+ # stack). However, this is an internal tool and we do not
+ # currently have any custom descriptors.
+ else:
+ origs[attr] = sentinel
+
+ try:
+ for attr, val in kwargs.items():
+ setattr(obj, attr, val)
+ yield
+ finally:
+ for attr, orig in origs.items():
+ if orig is sentinel:
+ delattr(obj, attr)
+ else:
+ setattr(obj, attr, orig)
+
+
+class _OrderedSet(collections.abc.MutableSet):
+ def __init__(self):
+ self._od = collections.OrderedDict()
+
+ def __contains__(self, key):
+ return key in self._od
+
+ def __iter__(self):
+ return iter(self._od)
+
+ def __len__(self):
+ return len(self._od)
+
+ def add(self, key):
+ self._od.pop(key, None)
+ self._od[key] = None
+
+ def discard(self, key):
+ self._od.pop(key, None)
+
+
+# Agg's buffers are unmultiplied RGBA8888, which neither PyQt<=5.1 nor cairo
+# support; however, both do support premultiplied ARGB32.
+
+
+def _premultiplied_argb32_to_unmultiplied_rgba8888(buf):
+ """
+ Convert a premultiplied ARGB32 buffer to an unmultiplied RGBA8888 buffer.
+ """
+ rgba = np.take( # .take() ensures C-contiguity of the result.
+ buf,
+ [2, 1, 0, 3] if sys.byteorder == "little" else [1, 2, 3, 0], axis=2)
+ rgb = rgba[..., :-1]
+ alpha = rgba[..., -1]
+ # Un-premultiply alpha. The formula is the same as in cairo-png.c.
+ mask = alpha != 0
+ for channel in np.rollaxis(rgb, -1):
+ channel[mask] = (
+ (channel[mask].astype(int) * 255 + alpha[mask] // 2)
+ // alpha[mask])
+ return rgba
+
+
+def _unmultiplied_rgba8888_to_premultiplied_argb32(rgba8888):
+ """
+ Convert an unmultiplied RGBA8888 buffer to a premultiplied ARGB32 buffer.
+ """
+ if sys.byteorder == "little":
+ argb32 = np.take(rgba8888, [2, 1, 0, 3], axis=2)
+ rgb24 = argb32[..., :-1]
+ alpha8 = argb32[..., -1:]
+ else:
+ argb32 = np.take(rgba8888, [3, 0, 1, 2], axis=2)
+ alpha8 = argb32[..., :1]
+ rgb24 = argb32[..., 1:]
+ # Only bother premultiplying when the alpha channel is not fully opaque,
+ # as the cost is not negligible. The unsafe cast is needed to do the
+ # multiplication in-place in an integer buffer.
+ if alpha8.min() != 0xff:
+ np.multiply(rgb24, alpha8 / 0xff, out=rgb24, casting="unsafe")
+ return argb32
+
+
+def _get_nonzero_slices(buf):
+ """
+ Return the bounds of the nonzero region of a 2D array as a pair of slices.
+
+ ``buf[_get_nonzero_slices(buf)]`` is the smallest sub-rectangle in *buf*
+ that encloses all non-zero entries in *buf*. If *buf* is fully zero, then
+ ``(slice(0, 0), slice(0, 0))`` is returned.
+ """
+ x_nz, = buf.any(axis=0).nonzero()
+ y_nz, = buf.any(axis=1).nonzero()
+ if len(x_nz) and len(y_nz):
+ l, r = x_nz[[0, -1]]
+ b, t = y_nz[[0, -1]]
+ return slice(b, t + 1), slice(l, r + 1)
+ else:
+ return slice(0, 0), slice(0, 0)
+
+
+def _pformat_subprocess(command):
+ """Pretty-format a subprocess command for printing/logging purposes."""
+ return (command if isinstance(command, str)
+ else " ".join(shlex.quote(os.fspath(arg)) for arg in command))
+
+
+def _check_and_log_subprocess(command, logger, **kwargs):
+ """
+ Run *command*, returning its stdout output if it succeeds.
+
+ If it fails (exits with nonzero return code), raise an exception whose text
+ includes the failed command and captured stdout and stderr output.
+
+ Regardless of the return code, the command is logged at DEBUG level on
+ *logger*. In case of success, the output is likewise logged.
+ """
+ logger.debug('%s', _pformat_subprocess(command))
+ proc = subprocess.run(command, capture_output=True, **kwargs)
+ if proc.returncode:
+ stdout = proc.stdout
+ if isinstance(stdout, bytes):
+ stdout = stdout.decode()
+ stderr = proc.stderr
+ if isinstance(stderr, bytes):
+ stderr = stderr.decode()
+ raise RuntimeError(
+ f"The command\n"
+ f" {_pformat_subprocess(command)}\n"
+ f"failed and generated the following output:\n"
+ f"{stdout}\n"
+ f"and the following error:\n"
+ f"{stderr}")
+ if proc.stdout:
+ logger.debug("stdout:\n%s", proc.stdout)
+ if proc.stderr:
+ logger.debug("stderr:\n%s", proc.stderr)
+ return proc.stdout
+
+
+def _setup_new_guiapp():
+ """
+ Perform OS-dependent setup when Matplotlib creates a new GUI application.
+ """
+ # Windows: If not explicit app user model id has been set yet (so we're not
+ # already embedded), then set it to "matplotlib", so that taskbar icons are
+ # correct.
+ try:
+ _c_internal_utils.Win32_GetCurrentProcessExplicitAppUserModelID()
+ except OSError:
+ _c_internal_utils.Win32_SetCurrentProcessExplicitAppUserModelID(
+ "matplotlib")
+
+
+def _format_approx(number, precision):
+ """
+ Format the number with at most the number of decimals given as precision.
+ Remove trailing zeros and possibly the decimal point.
+ """
+ return f'{number:.{precision}f}'.rstrip('0').rstrip('.') or '0'
+
+
+def _g_sig_digits(value, delta):
+ """
+ Return the number of significant digits to %g-format *value*, assuming that
+ it is known with an error of *delta*.
+ """
+ if delta == 0:
+ if value == 0:
+ # if both value and delta are 0, np.spacing below returns 5e-324
+ # which results in rather silly results
+ return 3
+ # delta = 0 may occur when trying to format values over a tiny range;
+ # in that case, replace it by the distance to the closest float.
+ delta = abs(np.spacing(value))
+ # If e.g. value = 45.67 and delta = 0.02, then we want to round to 2 digits
+ # after the decimal point (floor(log10(0.02)) = -2); 45.67 contributes 2
+ # digits before the decimal point (floor(log10(45.67)) + 1 = 2): the total
+ # is 4 significant digits. A value of 0 contributes 1 "digit" before the
+ # decimal point.
+ # For inf or nan, the precision doesn't matter.
+ return max(
+ 0,
+ (math.floor(math.log10(abs(value))) + 1 if value else 1)
+ - math.floor(math.log10(delta))) if math.isfinite(value) else 0
+
+
+def _unikey_or_keysym_to_mplkey(unikey, keysym):
+ """
+ Convert a Unicode key or X keysym to a Matplotlib key name.
+
+ The Unicode key is checked first; this avoids having to list most printable
+ keysyms such as ``EuroSign``.
+ """
+ # For non-printable characters, gtk3 passes "\0" whereas tk passes an "".
+ if unikey and unikey.isprintable():
+ return unikey
+ key = keysym.lower()
+ if key.startswith("kp_"): # keypad_x (including kp_enter).
+ key = key[3:]
+ if key.startswith("page_"): # page_{up,down}
+ key = key.replace("page_", "page")
+ if key.endswith(("_l", "_r")): # alt_l, ctrl_l, shift_l.
+ key = key[:-2]
+ if sys.platform == "darwin" and key == "meta":
+ # meta should be reported as command on mac
+ key = "cmd"
+ key = {
+ "return": "enter",
+ "prior": "pageup", # Used by tk.
+ "next": "pagedown", # Used by tk.
+ }.get(key, key)
+ return key
+
+
+@functools.cache
+def _make_class_factory(mixin_class, fmt, attr_name=None):
+ """
+ Return a function that creates picklable classes inheriting from a mixin.
+
+ After ::
+
+ factory = _make_class_factory(FooMixin, fmt, attr_name)
+ FooAxes = factory(Axes)
+
+ ``Foo`` is a class that inherits from ``FooMixin`` and ``Axes`` and **is
+ picklable** (picklability is what differentiates this from a plain call to
+ `type`). Its ``__name__`` is set to ``fmt.format(Axes.__name__)`` and the
+ base class is stored in the ``attr_name`` attribute, if not None.
+
+ Moreover, the return value of ``factory`` is memoized: calls with the same
+ ``Axes`` class always return the same subclass.
+ """
+
+ @functools.cache
+ def class_factory(axes_class):
+ # if we have already wrapped this class, declare victory!
+ if issubclass(axes_class, mixin_class):
+ return axes_class
+
+ # The parameter is named "axes_class" for backcompat but is really just
+ # a base class; no axes semantics are used.
+ base_class = axes_class
+
+ class subcls(mixin_class, base_class):
+ # Better approximation than __module__ = "matplotlib.cbook".
+ __module__ = mixin_class.__module__
+
+ def __reduce__(self):
+ return (_picklable_class_constructor,
+ (mixin_class, fmt, attr_name, base_class),
+ self.__getstate__())
+
+ subcls.__name__ = subcls.__qualname__ = fmt.format(base_class.__name__)
+ if attr_name is not None:
+ setattr(subcls, attr_name, base_class)
+ return subcls
+
+ class_factory.__module__ = mixin_class.__module__
+ return class_factory
+
+
+def _picklable_class_constructor(mixin_class, fmt, attr_name, base_class):
+ """Internal helper for _make_class_factory."""
+ factory = _make_class_factory(mixin_class, fmt, attr_name)
+ cls = factory(base_class)
+ return cls.__new__(cls)
+
+
+def _is_torch_array(x):
+ """Check if 'x' is a PyTorch Tensor."""
+ try:
+ # we're intentionally not attempting to import torch. If somebody
+ # has created a torch array, torch should already be in sys.modules
+ return isinstance(x, sys.modules['torch'].Tensor)
+ except Exception: # TypeError, KeyError, AttributeError, maybe others?
+ # we're attempting to access attributes on imported modules which
+ # may have arbitrary user code, so we deliberately catch all exceptions
+ return False
+
+
+def _is_jax_array(x):
+ """Check if 'x' is a JAX Array."""
+ try:
+ # we're intentionally not attempting to import jax. If somebody
+ # has created a jax array, jax should already be in sys.modules
+ return isinstance(x, sys.modules['jax'].Array)
+ except Exception: # TypeError, KeyError, AttributeError, maybe others?
+ # we're attempting to access attributes on imported modules which
+ # may have arbitrary user code, so we deliberately catch all exceptions
+ return False
+
+
+def _is_tensorflow_array(x):
+ """Check if 'x' is a TensorFlow Tensor or Variable."""
+ try:
+ # we're intentionally not attempting to import TensorFlow. If somebody
+ # has created a TensorFlow array, TensorFlow should already be in sys.modules
+ # we use `is_tensor` to not depend on the class structure of TensorFlow
+ # arrays, as `tf.Variables` are not instances of `tf.Tensor`
+ # (they both convert the same way)
+ return isinstance(x, sys.modules['tensorflow'].is_tensor(x))
+ except Exception: # TypeError, KeyError, AttributeError, maybe others?
+ # we're attempting to access attributes on imported modules which
+ # may have arbitrary user code, so we deliberately catch all exceptions
+ return False
+
+
+def _unpack_to_numpy(x):
+ """Internal helper to extract data from e.g. pandas and xarray objects."""
+ if isinstance(x, np.ndarray):
+ # If numpy, return directly
+ return x
+ if hasattr(x, 'to_numpy'):
+ # Assume that any to_numpy() method actually returns a numpy array
+ return x.to_numpy()
+ if hasattr(x, 'values'):
+ xtmp = x.values
+ # For example a dict has a 'values' attribute, but it is not a property
+ # so in this case we do not want to return a function
+ if isinstance(xtmp, np.ndarray):
+ return xtmp
+ if _is_torch_array(x) or _is_jax_array(x) or _is_tensorflow_array(x):
+ # using np.asarray() instead of explicitly __array__(), as the latter is
+ # only _one_ of many methods, and it's the last resort, see also
+ # https://numpy.org/devdocs/user/basics.interoperability.html#using-arbitrary-objects-in-numpy
+ # therefore, let arrays do better if they can
+ xtmp = np.asarray(x)
+
+ # In case np.asarray method does not return a numpy array in future
+ if isinstance(xtmp, np.ndarray):
+ return xtmp
+ return x
+
+
+def _auto_format_str(fmt, value):
+ """
+ Apply *value* to the format string *fmt*.
+
+ This works both with unnamed %-style formatting and
+ unnamed {}-style formatting. %-style formatting has priority.
+ If *fmt* is %-style formattable that will be used. Otherwise,
+ {}-formatting is applied. Strings without formatting placeholders
+ are passed through as is.
+
+ Examples
+ --------
+ >>> _auto_format_str('%.2f m', 0.2)
+ '0.20 m'
+ >>> _auto_format_str('{} m', 0.2)
+ '0.2 m'
+ >>> _auto_format_str('const', 0.2)
+ 'const'
+ >>> _auto_format_str('%d or {}', 0.2)
+ '0 or {}'
+ """
+ try:
+ return fmt % (value,)
+ except (TypeError, ValueError):
+ return fmt.format(value)
+
+
+def _is_pandas_dataframe(x):
+ """Check if 'x' is a Pandas DataFrame."""
+ try:
+ # we're intentionally not attempting to import Pandas. If somebody
+ # has created a Pandas DataFrame, Pandas should already be in sys.modules
+ return isinstance(x, sys.modules['pandas'].DataFrame)
+ except Exception: # TypeError, KeyError, AttributeError, maybe others?
+ # we're attempting to access attributes on imported modules which
+ # may have arbitrary user code, so we deliberately catch all exceptions
+ return False
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cbook.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cbook.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..cc6b4e8f4e1963922a75a140ff127d9bb5ead58c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cbook.pyi
@@ -0,0 +1,173 @@
+import collections.abc
+from collections.abc import Callable, Collection, Generator, Iterable, Iterator
+import contextlib
+import os
+from pathlib import Path
+
+from matplotlib.artist import Artist
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+from typing import (
+ Any,
+ Generic,
+ IO,
+ Literal,
+ TypeVar,
+ overload,
+)
+
+_T = TypeVar("_T")
+
+def _get_running_interactive_framework() -> str | None: ...
+
+class CallbackRegistry:
+ exception_handler: Callable[[Exception], Any]
+ callbacks: dict[Any, dict[int, Any]]
+ def __init__(
+ self,
+ exception_handler: Callable[[Exception], Any] | None = ...,
+ *,
+ signals: Iterable[Any] | None = ...,
+ ) -> None: ...
+ def connect(self, signal: Any, func: Callable) -> int: ...
+ def disconnect(self, cid: int) -> None: ...
+ def process(self, s: Any, *args, **kwargs) -> None: ...
+ def blocked(
+ self, *, signal: Any | None = ...
+ ) -> contextlib.AbstractContextManager[None]: ...
+
+class silent_list(list[_T]):
+ type: str | None
+ def __init__(self, type: str | None, seq: Iterable[_T] | None = ...) -> None: ...
+
+def strip_math(s: str) -> str: ...
+def is_writable_file_like(obj: Any) -> bool: ...
+def file_requires_unicode(x: Any) -> bool: ...
+@overload
+def to_filehandle(
+ fname: str | os.PathLike | IO,
+ flag: str = ...,
+ return_opened: Literal[False] = ...,
+ encoding: str | None = ...,
+) -> IO: ...
+@overload
+def to_filehandle(
+ fname: str | os.PathLike | IO,
+ flag: str,
+ return_opened: Literal[True],
+ encoding: str | None = ...,
+) -> tuple[IO, bool]: ...
+@overload
+def to_filehandle(
+ fname: str | os.PathLike | IO,
+ *, # if flag given, will match previous sig
+ return_opened: Literal[True],
+ encoding: str | None = ...,
+) -> tuple[IO, bool]: ...
+def open_file_cm(
+ path_or_file: str | os.PathLike | IO,
+ mode: str = ...,
+ encoding: str | None = ...,
+) -> contextlib.AbstractContextManager[IO]: ...
+def is_scalar_or_string(val: Any) -> bool: ...
+@overload
+def get_sample_data(
+ fname: str | os.PathLike, asfileobj: Literal[True] = ...
+) -> np.ndarray | IO: ...
+@overload
+def get_sample_data(fname: str | os.PathLike, asfileobj: Literal[False]) -> str: ...
+def _get_data_path(*args: Path | str) -> Path: ...
+def flatten(
+ seq: Iterable[Any], scalarp: Callable[[Any], bool] = ...
+) -> Generator[Any, None, None]: ...
+
+class _Stack(Generic[_T]):
+ def __init__(self) -> None: ...
+ def clear(self) -> None: ...
+ def __call__(self) -> _T: ...
+ def __len__(self) -> int: ...
+ def __getitem__(self, ind: int) -> _T: ...
+ def forward(self) -> _T: ...
+ def back(self) -> _T: ...
+ def push(self, o: _T) -> _T: ...
+ def home(self) -> _T: ...
+
+def safe_masked_invalid(x: ArrayLike, copy: bool = ...) -> np.ndarray: ...
+def print_cycles(
+ objects: Iterable[Any], outstream: IO = ..., show_progress: bool = ...
+) -> None: ...
+
+class Grouper(Generic[_T]):
+ def __init__(self, init: Iterable[_T] = ...) -> None: ...
+ def __contains__(self, item: _T) -> bool: ...
+ def join(self, a: _T, *args: _T) -> None: ...
+ def joined(self, a: _T, b: _T) -> bool: ...
+ def remove(self, a: _T) -> None: ...
+ def __iter__(self) -> Iterator[list[_T]]: ...
+ def get_siblings(self, a: _T) -> list[_T]: ...
+
+class GrouperView(Generic[_T]):
+ def __init__(self, grouper: Grouper[_T]) -> None: ...
+ def __contains__(self, item: _T) -> bool: ...
+ def __iter__(self) -> Iterator[list[_T]]: ...
+ def joined(self, a: _T, b: _T) -> bool: ...
+ def get_siblings(self, a: _T) -> list[_T]: ...
+
+def simple_linear_interpolation(a: ArrayLike, steps: int) -> np.ndarray: ...
+def delete_masked_points(*args): ...
+def _broadcast_with_masks(*args: ArrayLike, compress: bool = ...) -> list[ArrayLike]: ...
+def boxplot_stats(
+ X: ArrayLike,
+ whis: float | tuple[float, float] = ...,
+ bootstrap: int | None = ...,
+ labels: ArrayLike | None = ...,
+ autorange: bool = ...,
+) -> list[dict[str, Any]]: ...
+
+ls_mapper: dict[str, str]
+ls_mapper_r: dict[str, str]
+
+def contiguous_regions(mask: ArrayLike) -> list[np.ndarray]: ...
+def is_math_text(s: str) -> bool: ...
+def violin_stats(
+ X: ArrayLike, method: Callable, points: int = ..., quantiles: ArrayLike | None = ...
+) -> list[dict[str, Any]]: ...
+def pts_to_prestep(x: ArrayLike, *args: ArrayLike) -> np.ndarray: ...
+def pts_to_poststep(x: ArrayLike, *args: ArrayLike) -> np.ndarray: ...
+def pts_to_midstep(x: np.ndarray, *args: np.ndarray) -> np.ndarray: ...
+
+STEP_LOOKUP_MAP: dict[str, Callable]
+
+def index_of(y: float | ArrayLike) -> tuple[np.ndarray, np.ndarray]: ...
+def safe_first_element(obj: Collection[_T]) -> _T: ...
+def sanitize_sequence(data): ...
+def normalize_kwargs(
+ kw: dict[str, Any],
+ alias_mapping: dict[str, list[str]] | type[Artist] | Artist | None = ...,
+) -> dict[str, Any]: ...
+def _lock_path(path: str | os.PathLike) -> contextlib.AbstractContextManager[None]: ...
+def _str_equal(obj: Any, s: str) -> bool: ...
+def _str_lower_equal(obj: Any, s: str) -> bool: ...
+def _array_perimeter(arr: np.ndarray) -> np.ndarray: ...
+def _unfold(arr: np.ndarray, axis: int, size: int, step: int) -> np.ndarray: ...
+def _array_patch_perimeters(x: np.ndarray, rstride: int, cstride: int) -> np.ndarray: ...
+def _setattr_cm(obj: Any, **kwargs) -> contextlib.AbstractContextManager[None]: ...
+
+class _OrderedSet(collections.abc.MutableSet):
+ def __init__(self) -> None: ...
+ def __contains__(self, key) -> bool: ...
+ def __iter__(self): ...
+ def __len__(self) -> int: ...
+ def add(self, key) -> None: ...
+ def discard(self, key) -> None: ...
+
+def _setup_new_guiapp() -> None: ...
+def _format_approx(number: float, precision: int) -> str: ...
+def _g_sig_digits(value: float, delta: float) -> int: ...
+def _unikey_or_keysym_to_mplkey(unikey: str, keysym: str) -> str: ...
+def _is_torch_array(x: Any) -> bool: ...
+def _is_jax_array(x: Any) -> bool: ...
+def _unpack_to_numpy(x: Any) -> Any: ...
+def _auto_format_str(fmt: str, value: Any) -> str: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cm.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cm.py
new file mode 100644
index 0000000000000000000000000000000000000000..0c11527bc2b925d57cdd7198a10c13118cfe9d16
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cm.py
@@ -0,0 +1,310 @@
+"""
+Builtin colormaps, colormap handling utilities, and the `ScalarMappable` mixin.
+
+.. seealso::
+
+ :doc:`/gallery/color/colormap_reference` for a list of builtin colormaps.
+
+ :ref:`colormap-manipulation` for examples of how to make
+ colormaps.
+
+ :ref:`colormaps` an in-depth discussion of choosing
+ colormaps.
+
+ :ref:`colormapnorms` for more details about data normalization.
+"""
+
+from collections.abc import Mapping
+
+import matplotlib as mpl
+from matplotlib import _api, colors
+# TODO make this warn on access
+from matplotlib.colorizer import _ScalarMappable as ScalarMappable # noqa
+from matplotlib._cm import datad
+from matplotlib._cm_listed import cmaps as cmaps_listed
+from matplotlib._cm_multivar import cmap_families as multivar_cmaps
+from matplotlib._cm_bivar import cmaps as bivar_cmaps
+
+
+_LUTSIZE = mpl.rcParams['image.lut']
+
+
+def _gen_cmap_registry():
+ """
+ Generate a dict mapping standard colormap names to standard colormaps, as
+ well as the reversed colormaps.
+ """
+ cmap_d = {**cmaps_listed}
+ for name, spec in datad.items():
+ cmap_d[name] = ( # Precache the cmaps at a fixed lutsize..
+ colors.LinearSegmentedColormap(name, spec, _LUTSIZE)
+ if 'red' in spec else
+ colors.ListedColormap(spec['listed'], name)
+ if 'listed' in spec else
+ colors.LinearSegmentedColormap.from_list(name, spec, _LUTSIZE))
+
+ # Register colormap aliases for gray and grey.
+ aliases = {
+ # alias -> original name
+ 'grey': 'gray',
+ 'gist_grey': 'gist_gray',
+ 'gist_yerg': 'gist_yarg',
+ 'Grays': 'Greys',
+ }
+ for alias, original_name in aliases.items():
+ cmap = cmap_d[original_name].copy()
+ cmap.name = alias
+ cmap_d[alias] = cmap
+
+ # Generate reversed cmaps.
+ for cmap in list(cmap_d.values()):
+ rmap = cmap.reversed()
+ cmap_d[rmap.name] = rmap
+ return cmap_d
+
+
+class ColormapRegistry(Mapping):
+ r"""
+ Container for colormaps that are known to Matplotlib by name.
+
+ The universal registry instance is `matplotlib.colormaps`. There should be
+ no need for users to instantiate `.ColormapRegistry` themselves.
+
+ Read access uses a dict-like interface mapping names to `.Colormap`\s::
+
+ import matplotlib as mpl
+ cmap = mpl.colormaps['viridis']
+
+ Returned `.Colormap`\s are copies, so that their modification does not
+ change the global definition of the colormap.
+
+ Additional colormaps can be added via `.ColormapRegistry.register`::
+
+ mpl.colormaps.register(my_colormap)
+
+ To get a list of all registered colormaps, you can do::
+
+ from matplotlib import colormaps
+ list(colormaps)
+ """
+ def __init__(self, cmaps):
+ self._cmaps = cmaps
+ self._builtin_cmaps = tuple(cmaps)
+
+ def __getitem__(self, item):
+ try:
+ return self._cmaps[item].copy()
+ except KeyError:
+ raise KeyError(f"{item!r} is not a known colormap name") from None
+
+ def __iter__(self):
+ return iter(self._cmaps)
+
+ def __len__(self):
+ return len(self._cmaps)
+
+ def __str__(self):
+ return ('ColormapRegistry; available colormaps:\n' +
+ ', '.join(f"'{name}'" for name in self))
+
+ def __call__(self):
+ """
+ Return a list of the registered colormap names.
+
+ This exists only for backward-compatibility in `.pyplot` which had a
+ ``plt.colormaps()`` method. The recommended way to get this list is
+ now ``list(colormaps)``.
+ """
+ return list(self)
+
+ def register(self, cmap, *, name=None, force=False):
+ """
+ Register a new colormap.
+
+ The colormap name can then be used as a string argument to any ``cmap``
+ parameter in Matplotlib. It is also available in ``pyplot.get_cmap``.
+
+ The colormap registry stores a copy of the given colormap, so that
+ future changes to the original colormap instance do not affect the
+ registered colormap. Think of this as the registry taking a snapshot
+ of the colormap at registration.
+
+ Parameters
+ ----------
+ cmap : matplotlib.colors.Colormap
+ The colormap to register.
+
+ name : str, optional
+ The name for the colormap. If not given, ``cmap.name`` is used.
+
+ force : bool, default: False
+ If False, a ValueError is raised if trying to overwrite an already
+ registered name. True supports overwriting registered colormaps
+ other than the builtin colormaps.
+ """
+ _api.check_isinstance(colors.Colormap, cmap=cmap)
+
+ name = name or cmap.name
+ if name in self:
+ if not force:
+ # don't allow registering an already existing cmap
+ # unless explicitly asked to
+ raise ValueError(
+ f'A colormap named "{name}" is already registered.')
+ elif name in self._builtin_cmaps:
+ # We don't allow overriding a builtin.
+ raise ValueError("Re-registering the builtin cmap "
+ f"{name!r} is not allowed.")
+
+ # Warn that we are updating an already existing colormap
+ _api.warn_external(f"Overwriting the cmap {name!r} "
+ "that was already in the registry.")
+
+ self._cmaps[name] = cmap.copy()
+ # Someone may set the extremes of a builtin colormap and want to register it
+ # with a different name for future lookups. The object would still have the
+ # builtin name, so we should update it to the registered name
+ if self._cmaps[name].name != name:
+ self._cmaps[name].name = name
+
+ def unregister(self, name):
+ """
+ Remove a colormap from the registry.
+
+ You cannot remove built-in colormaps.
+
+ If the named colormap is not registered, returns with no error, raises
+ if you try to de-register a default colormap.
+
+ .. warning::
+
+ Colormap names are currently a shared namespace that may be used
+ by multiple packages. Use `unregister` only if you know you
+ have registered that name before. In particular, do not
+ unregister just in case to clean the name before registering a
+ new colormap.
+
+ Parameters
+ ----------
+ name : str
+ The name of the colormap to be removed.
+
+ Raises
+ ------
+ ValueError
+ If you try to remove a default built-in colormap.
+ """
+ if name in self._builtin_cmaps:
+ raise ValueError(f"cannot unregister {name!r} which is a builtin "
+ "colormap.")
+ self._cmaps.pop(name, None)
+
+ def get_cmap(self, cmap):
+ """
+ Return a color map specified through *cmap*.
+
+ Parameters
+ ----------
+ cmap : str or `~matplotlib.colors.Colormap` or None
+
+ - if a `.Colormap`, return it
+ - if a string, look it up in ``mpl.colormaps``
+ - if None, return the Colormap defined in :rc:`image.cmap`
+
+ Returns
+ -------
+ Colormap
+ """
+ # get the default color map
+ if cmap is None:
+ return self[mpl.rcParams["image.cmap"]]
+
+ # if the user passed in a Colormap, simply return it
+ if isinstance(cmap, colors.Colormap):
+ return cmap
+ if isinstance(cmap, str):
+ _api.check_in_list(sorted(_colormaps), cmap=cmap)
+ # otherwise, it must be a string so look it up
+ return self[cmap]
+ raise TypeError(
+ 'get_cmap expects None or an instance of a str or Colormap . ' +
+ f'you passed {cmap!r} of type {type(cmap)}'
+ )
+
+
+# public access to the colormaps should be via `matplotlib.colormaps`. For now,
+# we still create the registry here, but that should stay an implementation
+# detail.
+_colormaps = ColormapRegistry(_gen_cmap_registry())
+globals().update(_colormaps)
+
+_multivar_colormaps = ColormapRegistry(multivar_cmaps)
+
+_bivar_colormaps = ColormapRegistry(bivar_cmaps)
+
+
+# This is an exact copy of pyplot.get_cmap(). It was removed in 3.9, but apparently
+# caused more user trouble than expected. Re-added for 3.9.1 and extended the
+# deprecation period for two additional minor releases.
+@_api.deprecated(
+ '3.7',
+ removal='3.11',
+ alternative="``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap()``"
+ " or ``pyplot.get_cmap()``"
+ )
+def get_cmap(name=None, lut=None):
+ """
+ Get a colormap instance, defaulting to rc values if *name* is None.
+
+ Parameters
+ ----------
+ name : `~matplotlib.colors.Colormap` or str or None, default: None
+ If a `.Colormap` instance, it will be returned. Otherwise, the name of
+ a colormap known to Matplotlib, which will be resampled by *lut*. The
+ default, None, means :rc:`image.cmap`.
+ lut : int or None, default: None
+ If *name* is not already a Colormap instance and *lut* is not None, the
+ colormap will be resampled to have *lut* entries in the lookup table.
+
+ Returns
+ -------
+ Colormap
+ """
+ if name is None:
+ name = mpl.rcParams['image.cmap']
+ if isinstance(name, colors.Colormap):
+ return name
+ _api.check_in_list(sorted(_colormaps), name=name)
+ if lut is None:
+ return _colormaps[name]
+ else:
+ return _colormaps[name].resampled(lut)
+
+
+def _ensure_cmap(cmap):
+ """
+ Ensure that we have a `.Colormap` object.
+
+ For internal use to preserve type stability of errors.
+
+ Parameters
+ ----------
+ cmap : None, str, Colormap
+
+ - if a `Colormap`, return it
+ - if a string, look it up in mpl.colormaps
+ - if None, look up the default color map in mpl.colormaps
+
+ Returns
+ -------
+ Colormap
+
+ """
+ if isinstance(cmap, colors.Colormap):
+ return cmap
+ cmap_name = cmap if cmap is not None else mpl.rcParams["image.cmap"]
+ # use check_in_list to ensure type stability of the exception raised by
+ # the internal usage of this (ValueError vs KeyError)
+ if cmap_name not in _colormaps:
+ _api.check_in_list(sorted(_colormaps), cmap=cmap_name)
+ return mpl.colormaps[cmap_name]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cm.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cm.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..c3c62095684aaa7b7a59490412889096b3cded61
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/cm.pyi
@@ -0,0 +1,24 @@
+from collections.abc import Iterator, Mapping
+from matplotlib import colors
+from matplotlib.colorizer import _ScalarMappable
+
+
+class ColormapRegistry(Mapping[str, colors.Colormap]):
+ def __init__(self, cmaps: Mapping[str, colors.Colormap]) -> None: ...
+ def __getitem__(self, item: str) -> colors.Colormap: ...
+ def __iter__(self) -> Iterator[str]: ...
+ def __len__(self) -> int: ...
+ def __call__(self) -> list[str]: ...
+ def register(
+ self, cmap: colors.Colormap, *, name: str | None = ..., force: bool = ...
+ ) -> None: ...
+ def unregister(self, name: str) -> None: ...
+ def get_cmap(self, cmap: str | colors.Colormap) -> colors.Colormap: ...
+
+_colormaps: ColormapRegistry = ...
+_multivar_colormaps: ColormapRegistry = ...
+_bivar_colormaps: ColormapRegistry = ...
+
+def get_cmap(name: str | colors.Colormap | None = ..., lut: int | None = ...) -> colors.Colormap: ...
+
+ScalarMappable = _ScalarMappable
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/collections.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/collections.py
new file mode 100644
index 0000000000000000000000000000000000000000..9bc25913ee0e18c77be987d5c6b2afc602155557
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/collections.py
@@ -0,0 +1,2573 @@
+"""
+Classes for the efficient drawing of large collections of objects that
+share most properties, e.g., a large number of line segments or
+polygons.
+
+The classes are not meant to be as flexible as their single element
+counterparts (e.g., you may not be able to select all line styles) but
+they are meant to be fast for common use cases (e.g., a large set of solid
+line segments).
+"""
+
+import itertools
+import functools
+import math
+from numbers import Number, Real
+import warnings
+
+import numpy as np
+
+import matplotlib as mpl
+from . import (_api, _path, artist, cbook, colorizer as mcolorizer, colors as mcolors,
+ _docstring, hatch as mhatch, lines as mlines, path as mpath, transforms)
+from ._enums import JoinStyle, CapStyle
+
+
+# "color" is excluded; it is a compound setter, and its docstring differs
+# in LineCollection.
+@_api.define_aliases({
+ "antialiased": ["antialiaseds", "aa"],
+ "edgecolor": ["edgecolors", "ec"],
+ "facecolor": ["facecolors", "fc"],
+ "linestyle": ["linestyles", "dashes", "ls"],
+ "linewidth": ["linewidths", "lw"],
+ "offset_transform": ["transOffset"],
+})
+class Collection(mcolorizer.ColorizingArtist):
+ r"""
+ Base class for Collections. Must be subclassed to be usable.
+
+ A Collection represents a sequence of `.Patch`\es that can be drawn
+ more efficiently together than individually. For example, when a single
+ path is being drawn repeatedly at different offsets, the renderer can
+ typically execute a ``draw_marker()`` call much more efficiently than a
+ series of repeated calls to ``draw_path()`` with the offsets put in
+ one-by-one.
+
+ Most properties of a collection can be configured per-element. Therefore,
+ Collections have "plural" versions of many of the properties of a `.Patch`
+ (e.g. `.Collection.get_paths` instead of `.Patch.get_path`). Exceptions are
+ the *zorder*, *hatch*, *pickradius*, *capstyle* and *joinstyle* properties,
+ which can only be set globally for the whole collection.
+
+ Besides these exceptions, all properties can be specified as single values
+ (applying to all elements) or sequences of values. The property of the
+ ``i``\th element of the collection is::
+
+ prop[i % len(prop)]
+
+ Each Collection can optionally be used as its own `.ScalarMappable` by
+ passing the *norm* and *cmap* parameters to its constructor. If the
+ Collection's `.ScalarMappable` matrix ``_A`` has been set (via a call
+ to `.Collection.set_array`), then at draw time this internal scalar
+ mappable will be used to set the ``facecolors`` and ``edgecolors``,
+ ignoring those that were manually passed in.
+ """
+ #: Either a list of 3x3 arrays or an Nx3x3 array (representing N
+ #: transforms), suitable for the `all_transforms` argument to
+ #: `~matplotlib.backend_bases.RendererBase.draw_path_collection`;
+ #: each 3x3 array is used to initialize an
+ #: `~matplotlib.transforms.Affine2D` object.
+ #: Each kind of collection defines this based on its arguments.
+ _transforms = np.empty((0, 3, 3))
+
+ # Whether to draw an edge by default. Set on a
+ # subclass-by-subclass basis.
+ _edge_default = False
+
+ @_docstring.interpd
+ def __init__(self, *,
+ edgecolors=None,
+ facecolors=None,
+ linewidths=None,
+ linestyles='solid',
+ capstyle=None,
+ joinstyle=None,
+ antialiaseds=None,
+ offsets=None,
+ offset_transform=None,
+ norm=None, # optional for ScalarMappable
+ cmap=None, # ditto
+ colorizer=None,
+ pickradius=5.0,
+ hatch=None,
+ urls=None,
+ zorder=1,
+ **kwargs
+ ):
+ """
+ Parameters
+ ----------
+ edgecolors : :mpltype:`color` or list of colors, default: :rc:`patch.edgecolor`
+ Edge color for each patch making up the collection. The special
+ value 'face' can be passed to make the edgecolor match the
+ facecolor.
+ facecolors : :mpltype:`color` or list of colors, default: :rc:`patch.facecolor`
+ Face color for each patch making up the collection.
+ linewidths : float or list of floats, default: :rc:`patch.linewidth`
+ Line width for each patch making up the collection.
+ linestyles : str or tuple or list thereof, default: 'solid'
+ Valid strings are ['solid', 'dashed', 'dashdot', 'dotted', '-',
+ '--', '-.', ':']. Dash tuples should be of the form::
+
+ (offset, onoffseq),
+
+ where *onoffseq* is an even length tuple of on and off ink lengths
+ in points. For examples, see
+ :doc:`/gallery/lines_bars_and_markers/linestyles`.
+ capstyle : `.CapStyle`-like, default: 'butt'
+ Style to use for capping lines for all paths in the collection.
+ Allowed values are %(CapStyle)s.
+ joinstyle : `.JoinStyle`-like, default: 'round'
+ Style to use for joining lines for all paths in the collection.
+ Allowed values are %(JoinStyle)s.
+ antialiaseds : bool or list of bool, default: :rc:`patch.antialiased`
+ Whether each patch in the collection should be drawn with
+ antialiasing.
+ offsets : (float, float) or list thereof, default: (0, 0)
+ A vector by which to translate each patch after rendering (default
+ is no translation). The translation is performed in screen (pixel)
+ coordinates (i.e. after the Artist's transform is applied).
+ offset_transform : `~.Transform`, default: `.IdentityTransform`
+ A single transform which will be applied to each *offsets* vector
+ before it is used.
+ cmap, norm
+ Data normalization and colormapping parameters. See
+ `.ScalarMappable` for a detailed description.
+ hatch : str, optional
+ Hatching pattern to use in filled paths, if any. Valid strings are
+ ['/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*']. See
+ :doc:`/gallery/shapes_and_collections/hatch_style_reference` for
+ the meaning of each hatch type.
+ pickradius : float, default: 5.0
+ If ``pickradius <= 0``, then `.Collection.contains` will return
+ ``True`` whenever the test point is inside of one of the polygons
+ formed by the control points of a Path in the Collection. On the
+ other hand, if it is greater than 0, then we instead check if the
+ test point is contained in a stroke of width ``2*pickradius``
+ following any of the Paths in the Collection.
+ urls : list of str, default: None
+ A URL for each patch to link to once drawn. Currently only works
+ for the SVG backend. See :doc:`/gallery/misc/hyperlinks_sgskip` for
+ examples.
+ zorder : float, default: 1
+ The drawing order, shared by all Patches in the Collection. See
+ :doc:`/gallery/misc/zorder_demo` for all defaults and examples.
+ **kwargs
+ Remaining keyword arguments will be used to set properties as
+ ``Collection.set_{key}(val)`` for each key-value pair in *kwargs*.
+ """
+
+ super().__init__(self._get_colorizer(cmap, norm, colorizer))
+ # list of un-scaled dash patterns
+ # this is needed scaling the dash pattern by linewidth
+ self._us_linestyles = [(0, None)]
+ # list of dash patterns
+ self._linestyles = [(0, None)]
+ # list of unbroadcast/scaled linewidths
+ self._us_lw = [0]
+ self._linewidths = [0]
+
+ self._gapcolor = None # Currently only used by LineCollection.
+
+ # Flags set by _set_mappable_flags: are colors from mapping an array?
+ self._face_is_mapped = None
+ self._edge_is_mapped = None
+ self._mapped_colors = None # calculated in update_scalarmappable
+ self._hatch_color = mcolors.to_rgba(mpl.rcParams['hatch.color'])
+ self._hatch_linewidth = mpl.rcParams['hatch.linewidth']
+ self.set_facecolor(facecolors)
+ self.set_edgecolor(edgecolors)
+ self.set_linewidth(linewidths)
+ self.set_linestyle(linestyles)
+ self.set_antialiased(antialiaseds)
+ self.set_pickradius(pickradius)
+ self.set_urls(urls)
+ self.set_hatch(hatch)
+ self.set_zorder(zorder)
+
+ if capstyle:
+ self.set_capstyle(capstyle)
+ else:
+ self._capstyle = None
+
+ if joinstyle:
+ self.set_joinstyle(joinstyle)
+ else:
+ self._joinstyle = None
+
+ if offsets is not None:
+ offsets = np.asanyarray(offsets, float)
+ # Broadcast (2,) -> (1, 2) but nothing else.
+ if offsets.shape == (2,):
+ offsets = offsets[None, :]
+
+ self._offsets = offsets
+ self._offset_transform = offset_transform
+
+ self._path_effects = None
+ self._internal_update(kwargs)
+ self._paths = None
+
+ def get_paths(self):
+ return self._paths
+
+ def set_paths(self, paths):
+ self._paths = paths
+ self.stale = True
+
+ def get_transforms(self):
+ return self._transforms
+
+ def get_offset_transform(self):
+ """Return the `.Transform` instance used by this artist offset."""
+ if self._offset_transform is None:
+ self._offset_transform = transforms.IdentityTransform()
+ elif (not isinstance(self._offset_transform, transforms.Transform)
+ and hasattr(self._offset_transform, '_as_mpl_transform')):
+ self._offset_transform = \
+ self._offset_transform._as_mpl_transform(self.axes)
+ return self._offset_transform
+
+ def set_offset_transform(self, offset_transform):
+ """
+ Set the artist offset transform.
+
+ Parameters
+ ----------
+ offset_transform : `.Transform`
+ """
+ self._offset_transform = offset_transform
+
+ def get_datalim(self, transData):
+ # Calculate the data limits and return them as a `.Bbox`.
+ #
+ # This operation depends on the transforms for the data in the
+ # collection and whether the collection has offsets:
+ #
+ # 1. offsets = None, transform child of transData: use the paths for
+ # the automatic limits (i.e. for LineCollection in streamline).
+ # 2. offsets != None: offset_transform is child of transData:
+ #
+ # a. transform is child of transData: use the path + offset for
+ # limits (i.e for bar).
+ # b. transform is not a child of transData: just use the offsets
+ # for the limits (i.e. for scatter)
+ #
+ # 3. otherwise return a null Bbox.
+
+ transform = self.get_transform()
+ offset_trf = self.get_offset_transform()
+ if not (isinstance(offset_trf, transforms.IdentityTransform)
+ or offset_trf.contains_branch(transData)):
+ # if the offsets are in some coords other than data,
+ # then don't use them for autoscaling.
+ return transforms.Bbox.null()
+
+ paths = self.get_paths()
+ if not len(paths):
+ # No paths to transform
+ return transforms.Bbox.null()
+
+ if not transform.is_affine:
+ paths = [transform.transform_path_non_affine(p) for p in paths]
+ # Don't convert transform to transform.get_affine() here because
+ # we may have transform.contains_branch(transData) but not
+ # transforms.get_affine().contains_branch(transData). But later,
+ # be careful to only apply the affine part that remains.
+
+ offsets = self.get_offsets()
+
+ if any(transform.contains_branch_seperately(transData)):
+ # collections that are just in data units (like quiver)
+ # can properly have the axes limits set by their shape +
+ # offset. LineCollections that have no offsets can
+ # also use this algorithm (like streamplot).
+ if isinstance(offsets, np.ma.MaskedArray):
+ offsets = offsets.filled(np.nan)
+ # get_path_collection_extents handles nan but not masked arrays
+ return mpath.get_path_collection_extents(
+ transform.get_affine() - transData, paths,
+ self.get_transforms(),
+ offset_trf.transform_non_affine(offsets),
+ offset_trf.get_affine().frozen())
+
+ # NOTE: None is the default case where no offsets were passed in
+ if self._offsets is not None:
+ # this is for collections that have their paths (shapes)
+ # in physical, axes-relative, or figure-relative units
+ # (i.e. like scatter). We can't uniquely set limits based on
+ # those shapes, so we just set the limits based on their
+ # location.
+ offsets = (offset_trf - transData).transform(offsets)
+ # note A-B means A B^{-1}
+ offsets = np.ma.masked_invalid(offsets)
+ if not offsets.mask.all():
+ bbox = transforms.Bbox.null()
+ bbox.update_from_data_xy(offsets)
+ return bbox
+ return transforms.Bbox.null()
+
+ def get_window_extent(self, renderer=None):
+ # TODO: check to ensure that this does not fail for
+ # cases other than scatter plot legend
+ return self.get_datalim(transforms.IdentityTransform())
+
+ def _prepare_points(self):
+ # Helper for drawing and hit testing.
+
+ transform = self.get_transform()
+ offset_trf = self.get_offset_transform()
+ offsets = self.get_offsets()
+ paths = self.get_paths()
+
+ if self.have_units():
+ paths = []
+ for path in self.get_paths():
+ vertices = path.vertices
+ xs, ys = vertices[:, 0], vertices[:, 1]
+ xs = self.convert_xunits(xs)
+ ys = self.convert_yunits(ys)
+ paths.append(mpath.Path(np.column_stack([xs, ys]), path.codes))
+ xs = self.convert_xunits(offsets[:, 0])
+ ys = self.convert_yunits(offsets[:, 1])
+ offsets = np.ma.column_stack([xs, ys])
+
+ if not transform.is_affine:
+ paths = [transform.transform_path_non_affine(path)
+ for path in paths]
+ transform = transform.get_affine()
+ if not offset_trf.is_affine:
+ offsets = offset_trf.transform_non_affine(offsets)
+ # This might have changed an ndarray into a masked array.
+ offset_trf = offset_trf.get_affine()
+
+ if isinstance(offsets, np.ma.MaskedArray):
+ offsets = offsets.filled(np.nan)
+ # Changing from a masked array to nan-filled ndarray
+ # is probably most efficient at this point.
+
+ return transform, offset_trf, offsets, paths
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ if not self.get_visible():
+ return
+ renderer.open_group(self.__class__.__name__, self.get_gid())
+
+ self.update_scalarmappable()
+
+ transform, offset_trf, offsets, paths = self._prepare_points()
+
+ gc = renderer.new_gc()
+ self._set_gc_clip(gc)
+ gc.set_snap(self.get_snap())
+
+ if self._hatch:
+ gc.set_hatch(self._hatch)
+ gc.set_hatch_color(self._hatch_color)
+ gc.set_hatch_linewidth(self._hatch_linewidth)
+
+ if self.get_sketch_params() is not None:
+ gc.set_sketch_params(*self.get_sketch_params())
+
+ if self.get_path_effects():
+ from matplotlib.patheffects import PathEffectRenderer
+ renderer = PathEffectRenderer(self.get_path_effects(), renderer)
+
+ # If the collection is made up of a single shape/color/stroke,
+ # it can be rendered once and blitted multiple times, using
+ # `draw_markers` rather than `draw_path_collection`. This is
+ # *much* faster for Agg, and results in smaller file sizes in
+ # PDF/SVG/PS.
+
+ trans = self.get_transforms()
+ facecolors = self.get_facecolor()
+ edgecolors = self.get_edgecolor()
+ do_single_path_optimization = False
+ if (len(paths) == 1 and len(trans) <= 1 and
+ len(facecolors) == 1 and len(edgecolors) == 1 and
+ len(self._linewidths) == 1 and
+ all(ls[1] is None for ls in self._linestyles) and
+ len(self._antialiaseds) == 1 and len(self._urls) == 1 and
+ self.get_hatch() is None):
+ if len(trans):
+ combined_transform = transforms.Affine2D(trans[0]) + transform
+ else:
+ combined_transform = transform
+ extents = paths[0].get_extents(combined_transform)
+ if (extents.width < self.get_figure(root=True).bbox.width
+ and extents.height < self.get_figure(root=True).bbox.height):
+ do_single_path_optimization = True
+
+ if self._joinstyle:
+ gc.set_joinstyle(self._joinstyle)
+
+ if self._capstyle:
+ gc.set_capstyle(self._capstyle)
+
+ if do_single_path_optimization:
+ gc.set_foreground(tuple(edgecolors[0]))
+ gc.set_linewidth(self._linewidths[0])
+ gc.set_dashes(*self._linestyles[0])
+ gc.set_antialiased(self._antialiaseds[0])
+ gc.set_url(self._urls[0])
+ renderer.draw_markers(
+ gc, paths[0], combined_transform.frozen(),
+ mpath.Path(offsets), offset_trf, tuple(facecolors[0]))
+ else:
+ if self._gapcolor is not None:
+ # First draw paths within the gaps.
+ ipaths, ilinestyles = self._get_inverse_paths_linestyles()
+ renderer.draw_path_collection(
+ gc, transform.frozen(), ipaths,
+ self.get_transforms(), offsets, offset_trf,
+ [mcolors.to_rgba("none")], self._gapcolor,
+ self._linewidths, ilinestyles,
+ self._antialiaseds, self._urls,
+ "screen")
+
+ renderer.draw_path_collection(
+ gc, transform.frozen(), paths,
+ self.get_transforms(), offsets, offset_trf,
+ self.get_facecolor(), self.get_edgecolor(),
+ self._linewidths, self._linestyles,
+ self._antialiaseds, self._urls,
+ "screen") # offset_position, kept for backcompat.
+
+ gc.restore()
+ renderer.close_group(self.__class__.__name__)
+ self.stale = False
+
+ def set_pickradius(self, pickradius):
+ """
+ Set the pick radius used for containment tests.
+
+ Parameters
+ ----------
+ pickradius : float
+ Pick radius, in points.
+ """
+ if not isinstance(pickradius, Real):
+ raise ValueError(
+ f"pickradius must be a real-valued number, not {pickradius!r}")
+ self._pickradius = pickradius
+
+ def get_pickradius(self):
+ return self._pickradius
+
+ def contains(self, mouseevent):
+ """
+ Test whether the mouse event occurred in the collection.
+
+ Returns ``bool, dict(ind=itemlist)``, where every item in itemlist
+ contains the event.
+ """
+ if self._different_canvas(mouseevent) or not self.get_visible():
+ return False, {}
+ pickradius = (
+ float(self._picker)
+ if isinstance(self._picker, Number) and
+ self._picker is not True # the bool, not just nonzero or 1
+ else self._pickradius)
+ if self.axes:
+ self.axes._unstale_viewLim()
+ transform, offset_trf, offsets, paths = self._prepare_points()
+ # Tests if the point is contained on one of the polygons formed
+ # by the control points of each of the paths. A point is considered
+ # "on" a path if it would lie within a stroke of width 2*pickradius
+ # following the path. If pickradius <= 0, then we instead simply check
+ # if the point is *inside* of the path instead.
+ ind = _path.point_in_path_collection(
+ mouseevent.x, mouseevent.y, pickradius,
+ transform.frozen(), paths, self.get_transforms(),
+ offsets, offset_trf, pickradius <= 0)
+ return len(ind) > 0, dict(ind=ind)
+
+ def set_urls(self, urls):
+ """
+ Parameters
+ ----------
+ urls : list of str or None
+
+ Notes
+ -----
+ URLs are currently only implemented by the SVG backend. They are
+ ignored by all other backends.
+ """
+ self._urls = urls if urls is not None else [None]
+ self.stale = True
+
+ def get_urls(self):
+ """
+ Return a list of URLs, one for each element of the collection.
+
+ The list contains *None* for elements without a URL. See
+ :doc:`/gallery/misc/hyperlinks_sgskip` for an example.
+ """
+ return self._urls
+
+ def set_hatch(self, hatch):
+ r"""
+ Set the hatching pattern
+
+ *hatch* can be one of::
+
+ / - diagonal hatching
+ \ - back diagonal
+ | - vertical
+ - - horizontal
+ + - crossed
+ x - crossed diagonal
+ o - small circle
+ O - large circle
+ . - dots
+ * - stars
+
+ Letters can be combined, in which case all the specified
+ hatchings are done. If same letter repeats, it increases the
+ density of hatching of that pattern.
+
+ Unlike other properties such as linewidth and colors, hatching
+ can only be specified for the collection as a whole, not separately
+ for each member.
+
+ Parameters
+ ----------
+ hatch : {'/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
+ """
+ # Use validate_hatch(list) after deprecation.
+ mhatch._validate_hatch_pattern(hatch)
+ self._hatch = hatch
+ self.stale = True
+
+ def get_hatch(self):
+ """Return the current hatching pattern."""
+ return self._hatch
+
+ def set_hatch_linewidth(self, lw):
+ """Set the hatch linewidth."""
+ self._hatch_linewidth = lw
+
+ def get_hatch_linewidth(self):
+ """Return the hatch linewidth."""
+ return self._hatch_linewidth
+
+ def set_offsets(self, offsets):
+ """
+ Set the offsets for the collection.
+
+ Parameters
+ ----------
+ offsets : (N, 2) or (2,) array-like
+ """
+ offsets = np.asanyarray(offsets)
+ if offsets.shape == (2,): # Broadcast (2,) -> (1, 2) but nothing else.
+ offsets = offsets[None, :]
+ cstack = (np.ma.column_stack if isinstance(offsets, np.ma.MaskedArray)
+ else np.column_stack)
+ self._offsets = cstack(
+ (np.asanyarray(self.convert_xunits(offsets[:, 0]), float),
+ np.asanyarray(self.convert_yunits(offsets[:, 1]), float)))
+ self.stale = True
+
+ def get_offsets(self):
+ """Return the offsets for the collection."""
+ # Default to zeros in the no-offset (None) case
+ return np.zeros((1, 2)) if self._offsets is None else self._offsets
+
+ def _get_default_linewidth(self):
+ # This may be overridden in a subclass.
+ return mpl.rcParams['patch.linewidth'] # validated as float
+
+ def set_linewidth(self, lw):
+ """
+ Set the linewidth(s) for the collection. *lw* can be a scalar
+ or a sequence; if it is a sequence the patches will cycle
+ through the sequence
+
+ Parameters
+ ----------
+ lw : float or list of floats
+ """
+ if lw is None:
+ lw = self._get_default_linewidth()
+ # get the un-scaled/broadcast lw
+ self._us_lw = np.atleast_1d(lw)
+
+ # scale all of the dash patterns.
+ self._linewidths, self._linestyles = self._bcast_lwls(
+ self._us_lw, self._us_linestyles)
+ self.stale = True
+
+ def set_linestyle(self, ls):
+ """
+ Set the linestyle(s) for the collection.
+
+ =========================== =================
+ linestyle description
+ =========================== =================
+ ``'-'`` or ``'solid'`` solid line
+ ``'--'`` or ``'dashed'`` dashed line
+ ``'-.'`` or ``'dashdot'`` dash-dotted line
+ ``':'`` or ``'dotted'`` dotted line
+ =========================== =================
+
+ Alternatively a dash tuple of the following form can be provided::
+
+ (offset, onoffseq),
+
+ where ``onoffseq`` is an even length tuple of on and off ink in points.
+
+ Parameters
+ ----------
+ ls : str or tuple or list thereof
+ Valid values for individual linestyles include {'-', '--', '-.',
+ ':', '', (offset, on-off-seq)}. See `.Line2D.set_linestyle` for a
+ complete description.
+ """
+ # get the list of raw 'unscaled' dash patterns
+ self._us_linestyles = mlines._get_dash_patterns(ls)
+
+ # broadcast and scale the lw and dash patterns
+ self._linewidths, self._linestyles = self._bcast_lwls(
+ self._us_lw, self._us_linestyles)
+
+ @_docstring.interpd
+ def set_capstyle(self, cs):
+ """
+ Set the `.CapStyle` for the collection (for all its elements).
+
+ Parameters
+ ----------
+ cs : `.CapStyle` or %(CapStyle)s
+ """
+ self._capstyle = CapStyle(cs)
+
+ @_docstring.interpd
+ def get_capstyle(self):
+ """
+ Return the cap style for the collection (for all its elements).
+
+ Returns
+ -------
+ %(CapStyle)s or None
+ """
+ return self._capstyle.name if self._capstyle else None
+
+ @_docstring.interpd
+ def set_joinstyle(self, js):
+ """
+ Set the `.JoinStyle` for the collection (for all its elements).
+
+ Parameters
+ ----------
+ js : `.JoinStyle` or %(JoinStyle)s
+ """
+ self._joinstyle = JoinStyle(js)
+
+ @_docstring.interpd
+ def get_joinstyle(self):
+ """
+ Return the join style for the collection (for all its elements).
+
+ Returns
+ -------
+ %(JoinStyle)s or None
+ """
+ return self._joinstyle.name if self._joinstyle else None
+
+ @staticmethod
+ def _bcast_lwls(linewidths, dashes):
+ """
+ Internal helper function to broadcast + scale ls/lw
+
+ In the collection drawing code, the linewidth and linestyle are cycled
+ through as circular buffers (via ``v[i % len(v)]``). Thus, if we are
+ going to scale the dash pattern at set time (not draw time) we need to
+ do the broadcasting now and expand both lists to be the same length.
+
+ Parameters
+ ----------
+ linewidths : list
+ line widths of collection
+ dashes : list
+ dash specification (offset, (dash pattern tuple))
+
+ Returns
+ -------
+ linewidths, dashes : list
+ Will be the same length, dashes are scaled by paired linewidth
+ """
+ if mpl.rcParams['_internal.classic_mode']:
+ return linewidths, dashes
+ # make sure they are the same length so we can zip them
+ if len(dashes) != len(linewidths):
+ l_dashes = len(dashes)
+ l_lw = len(linewidths)
+ gcd = math.gcd(l_dashes, l_lw)
+ dashes = list(dashes) * (l_lw // gcd)
+ linewidths = list(linewidths) * (l_dashes // gcd)
+
+ # scale the dash patterns
+ dashes = [mlines._scale_dashes(o, d, lw)
+ for (o, d), lw in zip(dashes, linewidths)]
+
+ return linewidths, dashes
+
+ def get_antialiased(self):
+ """
+ Get the antialiasing state for rendering.
+
+ Returns
+ -------
+ array of bools
+ """
+ return self._antialiaseds
+
+ def set_antialiased(self, aa):
+ """
+ Set the antialiasing state for rendering.
+
+ Parameters
+ ----------
+ aa : bool or list of bools
+ """
+ if aa is None:
+ aa = self._get_default_antialiased()
+ self._antialiaseds = np.atleast_1d(np.asarray(aa, bool))
+ self.stale = True
+
+ def _get_default_antialiased(self):
+ # This may be overridden in a subclass.
+ return mpl.rcParams['patch.antialiased']
+
+ def set_color(self, c):
+ """
+ Set both the edgecolor and the facecolor.
+
+ Parameters
+ ----------
+ c : :mpltype:`color` or list of RGBA tuples
+
+ See Also
+ --------
+ Collection.set_facecolor, Collection.set_edgecolor
+ For setting the edge or face color individually.
+ """
+ self.set_facecolor(c)
+ self.set_edgecolor(c)
+
+ def _get_default_facecolor(self):
+ # This may be overridden in a subclass.
+ return mpl.rcParams['patch.facecolor']
+
+ def _set_facecolor(self, c):
+ if c is None:
+ c = self._get_default_facecolor()
+
+ self._facecolors = mcolors.to_rgba_array(c, self._alpha)
+ self.stale = True
+
+ def set_facecolor(self, c):
+ """
+ Set the facecolor(s) of the collection. *c* can be a color (all patches
+ have same color), or a sequence of colors; if it is a sequence the
+ patches will cycle through the sequence.
+
+ If *c* is 'none', the patch will not be filled.
+
+ Parameters
+ ----------
+ c : :mpltype:`color` or list of :mpltype:`color`
+ """
+ if isinstance(c, str) and c.lower() in ("none", "face"):
+ c = c.lower()
+ self._original_facecolor = c
+ self._set_facecolor(c)
+
+ def get_facecolor(self):
+ return self._facecolors
+
+ def get_edgecolor(self):
+ if cbook._str_equal(self._edgecolors, 'face'):
+ return self.get_facecolor()
+ else:
+ return self._edgecolors
+
+ def _get_default_edgecolor(self):
+ # This may be overridden in a subclass.
+ return mpl.rcParams['patch.edgecolor']
+
+ def _set_edgecolor(self, c):
+ set_hatch_color = True
+ if c is None:
+ if (mpl.rcParams['patch.force_edgecolor']
+ or self._edge_default
+ or cbook._str_equal(self._original_facecolor, 'none')):
+ c = self._get_default_edgecolor()
+ else:
+ c = 'none'
+ set_hatch_color = False
+ if cbook._str_lower_equal(c, 'face'):
+ self._edgecolors = 'face'
+ self.stale = True
+ return
+ self._edgecolors = mcolors.to_rgba_array(c, self._alpha)
+ if set_hatch_color and len(self._edgecolors):
+ self._hatch_color = tuple(self._edgecolors[0])
+ self.stale = True
+
+ def set_edgecolor(self, c):
+ """
+ Set the edgecolor(s) of the collection.
+
+ Parameters
+ ----------
+ c : :mpltype:`color` or list of :mpltype:`color` or 'face'
+ The collection edgecolor(s). If a sequence, the patches cycle
+ through it. If 'face', match the facecolor.
+ """
+ # We pass through a default value for use in LineCollection.
+ # This allows us to maintain None as the default indicator in
+ # _original_edgecolor.
+ if isinstance(c, str) and c.lower() in ("none", "face"):
+ c = c.lower()
+ self._original_edgecolor = c
+ self._set_edgecolor(c)
+
+ def set_alpha(self, alpha):
+ """
+ Set the transparency of the collection.
+
+ Parameters
+ ----------
+ alpha : float or array of float or None
+ If not None, *alpha* values must be between 0 and 1, inclusive.
+ If an array is provided, its length must match the number of
+ elements in the collection. Masked values and nans are not
+ supported.
+ """
+ artist.Artist._set_alpha_for_array(self, alpha)
+ self._set_facecolor(self._original_facecolor)
+ self._set_edgecolor(self._original_edgecolor)
+
+ set_alpha.__doc__ = artist.Artist._set_alpha_for_array.__doc__
+
+ def get_linewidth(self):
+ return self._linewidths
+
+ def get_linestyle(self):
+ return self._linestyles
+
+ def _set_mappable_flags(self):
+ """
+ Determine whether edges and/or faces are color-mapped.
+
+ This is a helper for update_scalarmappable.
+ It sets Boolean flags '_edge_is_mapped' and '_face_is_mapped'.
+
+ Returns
+ -------
+ mapping_change : bool
+ True if either flag is True, or if a flag has changed.
+ """
+ # The flags are initialized to None to ensure this returns True
+ # the first time it is called.
+ edge0 = self._edge_is_mapped
+ face0 = self._face_is_mapped
+ # After returning, the flags must be Booleans, not None.
+ self._edge_is_mapped = False
+ self._face_is_mapped = False
+ if self._A is not None:
+ if not cbook._str_equal(self._original_facecolor, 'none'):
+ self._face_is_mapped = True
+ if cbook._str_equal(self._original_edgecolor, 'face'):
+ self._edge_is_mapped = True
+ else:
+ if self._original_edgecolor is None:
+ self._edge_is_mapped = True
+
+ mapped = self._face_is_mapped or self._edge_is_mapped
+ changed = (edge0 is None or face0 is None
+ or self._edge_is_mapped != edge0
+ or self._face_is_mapped != face0)
+ return mapped or changed
+
+ def update_scalarmappable(self):
+ """
+ Update colors from the scalar mappable array, if any.
+
+ Assign colors to edges and faces based on the array and/or
+ colors that were directly set, as appropriate.
+ """
+ if not self._set_mappable_flags():
+ return
+ # Allow possibility to call 'self.set_array(None)'.
+ if self._A is not None:
+ # QuadMesh can map 2d arrays (but pcolormesh supplies 1d array)
+ if self._A.ndim > 1 and not isinstance(self, _MeshData):
+ raise ValueError('Collections can only map rank 1 arrays')
+ if np.iterable(self._alpha):
+ if self._alpha.size != self._A.size:
+ raise ValueError(
+ f'Data array shape, {self._A.shape} '
+ 'is incompatible with alpha array shape, '
+ f'{self._alpha.shape}. '
+ 'This can occur with the deprecated '
+ 'behavior of the "flat" shading option, '
+ 'in which a row and/or column of the data '
+ 'array is dropped.')
+ # pcolormesh, scatter, maybe others flatten their _A
+ self._alpha = self._alpha.reshape(self._A.shape)
+ self._mapped_colors = self.to_rgba(self._A, self._alpha)
+
+ if self._face_is_mapped:
+ self._facecolors = self._mapped_colors
+ else:
+ self._set_facecolor(self._original_facecolor)
+ if self._edge_is_mapped:
+ self._edgecolors = self._mapped_colors
+ else:
+ self._set_edgecolor(self._original_edgecolor)
+ self.stale = True
+
+ def get_fill(self):
+ """Return whether face is colored."""
+ return not cbook._str_lower_equal(self._original_facecolor, "none")
+
+ def update_from(self, other):
+ """Copy properties from other to self."""
+
+ artist.Artist.update_from(self, other)
+ self._antialiaseds = other._antialiaseds
+ self._mapped_colors = other._mapped_colors
+ self._edge_is_mapped = other._edge_is_mapped
+ self._original_edgecolor = other._original_edgecolor
+ self._edgecolors = other._edgecolors
+ self._face_is_mapped = other._face_is_mapped
+ self._original_facecolor = other._original_facecolor
+ self._facecolors = other._facecolors
+ self._linewidths = other._linewidths
+ self._linestyles = other._linestyles
+ self._us_linestyles = other._us_linestyles
+ self._pickradius = other._pickradius
+ self._hatch = other._hatch
+
+ # update_from for scalarmappable
+ self._A = other._A
+ self.norm = other.norm
+ self.cmap = other.cmap
+ self.stale = True
+
+
+class _CollectionWithSizes(Collection):
+ """
+ Base class for collections that have an array of sizes.
+ """
+ _factor = 1.0
+
+ def get_sizes(self):
+ """
+ Return the sizes ('areas') of the elements in the collection.
+
+ Returns
+ -------
+ array
+ The 'area' of each element.
+ """
+ return self._sizes
+
+ def set_sizes(self, sizes, dpi=72.0):
+ """
+ Set the sizes of each member of the collection.
+
+ Parameters
+ ----------
+ sizes : `numpy.ndarray` or None
+ The size to set for each element of the collection. The
+ value is the 'area' of the element.
+ dpi : float, default: 72
+ The dpi of the canvas.
+ """
+ if sizes is None:
+ self._sizes = np.array([])
+ self._transforms = np.empty((0, 3, 3))
+ else:
+ self._sizes = np.asarray(sizes)
+ self._transforms = np.zeros((len(self._sizes), 3, 3))
+ scale = np.sqrt(self._sizes) * dpi / 72.0 * self._factor
+ self._transforms[:, 0, 0] = scale
+ self._transforms[:, 1, 1] = scale
+ self._transforms[:, 2, 2] = 1.0
+ self.stale = True
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ self.set_sizes(self._sizes, self.get_figure(root=True).dpi)
+ super().draw(renderer)
+
+
+class PathCollection(_CollectionWithSizes):
+ r"""
+ A collection of `~.path.Path`\s, as created by e.g. `~.Axes.scatter`.
+ """
+
+ def __init__(self, paths, sizes=None, **kwargs):
+ """
+ Parameters
+ ----------
+ paths : list of `.path.Path`
+ The paths that will make up the `.Collection`.
+ sizes : array-like
+ The factor by which to scale each drawn `~.path.Path`. One unit
+ squared in the Path's data space is scaled to be ``sizes**2``
+ points when rendered.
+ **kwargs
+ Forwarded to `.Collection`.
+ """
+
+ super().__init__(**kwargs)
+ self.set_paths(paths)
+ self.set_sizes(sizes)
+ self.stale = True
+
+ def get_paths(self):
+ return self._paths
+
+ def legend_elements(self, prop="colors", num="auto",
+ fmt=None, func=lambda x: x, **kwargs):
+ """
+ Create legend handles and labels for a PathCollection.
+
+ Each legend handle is a `.Line2D` representing the Path that was drawn,
+ and each label is a string that represents the Path.
+
+ This is useful for obtaining a legend for a `~.Axes.scatter` plot;
+ e.g.::
+
+ scatter = plt.scatter([1, 2, 3], [4, 5, 6], c=[7, 2, 3], num=None)
+ plt.legend(*scatter.legend_elements())
+
+ creates three legend elements, one for each color with the numerical
+ values passed to *c* as the labels.
+
+ Also see the :ref:`automatedlegendcreation` example.
+
+ Parameters
+ ----------
+ prop : {"colors", "sizes"}, default: "colors"
+ If "colors", the legend handles will show the different colors of
+ the collection. If "sizes", the legend will show the different
+ sizes. To set both, use *kwargs* to directly edit the `.Line2D`
+ properties.
+ num : int, None, "auto" (default), array-like, or `~.ticker.Locator`
+ Target number of elements to create.
+ If None, use all unique elements of the mappable array. If an
+ integer, target to use *num* elements in the normed range.
+ If *"auto"*, try to determine which option better suits the nature
+ of the data.
+ The number of created elements may slightly deviate from *num* due
+ to a `~.ticker.Locator` being used to find useful locations.
+ If a list or array, use exactly those elements for the legend.
+ Finally, a `~.ticker.Locator` can be provided.
+ fmt : str, `~matplotlib.ticker.Formatter`, or None (default)
+ The format or formatter to use for the labels. If a string must be
+ a valid input for a `.StrMethodFormatter`. If None (the default),
+ use a `.ScalarFormatter`.
+ func : function, default: ``lambda x: x``
+ Function to calculate the labels. Often the size (or color)
+ argument to `~.Axes.scatter` will have been pre-processed by the
+ user using a function ``s = f(x)`` to make the markers visible;
+ e.g. ``size = np.log10(x)``. Providing the inverse of this
+ function here allows that pre-processing to be inverted, so that
+ the legend labels have the correct values; e.g. ``func = lambda
+ x: 10**x``.
+ **kwargs
+ Allowed keyword arguments are *color* and *size*. E.g. it may be
+ useful to set the color of the markers if *prop="sizes"* is used;
+ similarly to set the size of the markers if *prop="colors"* is
+ used. Any further parameters are passed onto the `.Line2D`
+ instance. This may be useful to e.g. specify a different
+ *markeredgecolor* or *alpha* for the legend handles.
+
+ Returns
+ -------
+ handles : list of `.Line2D`
+ Visual representation of each element of the legend.
+ labels : list of str
+ The string labels for elements of the legend.
+ """
+ handles = []
+ labels = []
+ hasarray = self.get_array() is not None
+ if fmt is None:
+ fmt = mpl.ticker.ScalarFormatter(useOffset=False, useMathText=True)
+ elif isinstance(fmt, str):
+ fmt = mpl.ticker.StrMethodFormatter(fmt)
+ fmt.create_dummy_axis()
+
+ if prop == "colors":
+ if not hasarray:
+ warnings.warn("Collection without array used. Make sure to "
+ "specify the values to be colormapped via the "
+ "`c` argument.")
+ return handles, labels
+ u = np.unique(self.get_array())
+ size = kwargs.pop("size", mpl.rcParams["lines.markersize"])
+ elif prop == "sizes":
+ u = np.unique(self.get_sizes())
+ color = kwargs.pop("color", "k")
+ else:
+ raise ValueError("Valid values for `prop` are 'colors' or "
+ f"'sizes'. You supplied '{prop}' instead.")
+
+ fu = func(u)
+ fmt.axis.set_view_interval(fu.min(), fu.max())
+ fmt.axis.set_data_interval(fu.min(), fu.max())
+ if num == "auto":
+ num = 9
+ if len(u) <= num:
+ num = None
+ if num is None:
+ values = u
+ label_values = func(values)
+ else:
+ if prop == "colors":
+ arr = self.get_array()
+ elif prop == "sizes":
+ arr = self.get_sizes()
+ if isinstance(num, mpl.ticker.Locator):
+ loc = num
+ elif np.iterable(num):
+ loc = mpl.ticker.FixedLocator(num)
+ else:
+ num = int(num)
+ loc = mpl.ticker.MaxNLocator(nbins=num, min_n_ticks=num-1,
+ steps=[1, 2, 2.5, 3, 5, 6, 8, 10])
+ label_values = loc.tick_values(func(arr).min(), func(arr).max())
+ cond = ((label_values >= func(arr).min()) &
+ (label_values <= func(arr).max()))
+ label_values = label_values[cond]
+ yarr = np.linspace(arr.min(), arr.max(), 256)
+ xarr = func(yarr)
+ ix = np.argsort(xarr)
+ values = np.interp(label_values, xarr[ix], yarr[ix])
+
+ kw = {"markeredgewidth": self.get_linewidths()[0],
+ "alpha": self.get_alpha(),
+ **kwargs}
+
+ for val, lab in zip(values, label_values):
+ if prop == "colors":
+ color = self.cmap(self.norm(val))
+ elif prop == "sizes":
+ size = np.sqrt(val)
+ if np.isclose(size, 0.0):
+ continue
+ h = mlines.Line2D([0], [0], ls="", color=color, ms=size,
+ marker=self.get_paths()[0], **kw)
+ handles.append(h)
+ if hasattr(fmt, "set_locs"):
+ fmt.set_locs(label_values)
+ l = fmt(lab)
+ labels.append(l)
+
+ return handles, labels
+
+
+class PolyCollection(_CollectionWithSizes):
+
+ def __init__(self, verts, sizes=None, *, closed=True, **kwargs):
+ """
+ Parameters
+ ----------
+ verts : list of array-like
+ The sequence of polygons [*verts0*, *verts1*, ...] where each
+ element *verts_i* defines the vertices of polygon *i* as a 2D
+ array-like of shape (M, 2).
+ sizes : array-like, default: None
+ Squared scaling factors for the polygons. The coordinates of each
+ polygon *verts_i* are multiplied by the square-root of the
+ corresponding entry in *sizes* (i.e., *sizes* specify the scaling
+ of areas). The scaling is applied before the Artist master
+ transform.
+ closed : bool, default: True
+ Whether the polygon should be closed by adding a CLOSEPOLY
+ connection at the end.
+ **kwargs
+ Forwarded to `.Collection`.
+ """
+ super().__init__(**kwargs)
+ self.set_sizes(sizes)
+ self.set_verts(verts, closed)
+ self.stale = True
+
+ def set_verts(self, verts, closed=True):
+ """
+ Set the vertices of the polygons.
+
+ Parameters
+ ----------
+ verts : list of array-like
+ The sequence of polygons [*verts0*, *verts1*, ...] where each
+ element *verts_i* defines the vertices of polygon *i* as a 2D
+ array-like of shape (M, 2).
+ closed : bool, default: True
+ Whether the polygon should be closed by adding a CLOSEPOLY
+ connection at the end.
+ """
+ self.stale = True
+ if isinstance(verts, np.ma.MaskedArray):
+ verts = verts.astype(float).filled(np.nan)
+
+ # No need to do anything fancy if the path isn't closed.
+ if not closed:
+ self._paths = [mpath.Path(xy) for xy in verts]
+ return
+
+ # Fast path for arrays
+ if isinstance(verts, np.ndarray) and len(verts.shape) == 3:
+ verts_pad = np.concatenate((verts, verts[:, :1]), axis=1)
+ # Creating the codes once is much faster than having Path do it
+ # separately each time by passing closed=True.
+ codes = np.empty(verts_pad.shape[1], dtype=mpath.Path.code_type)
+ codes[:] = mpath.Path.LINETO
+ codes[0] = mpath.Path.MOVETO
+ codes[-1] = mpath.Path.CLOSEPOLY
+ self._paths = [mpath.Path(xy, codes) for xy in verts_pad]
+ return
+
+ self._paths = []
+ for xy in verts:
+ if len(xy):
+ self._paths.append(mpath.Path._create_closed(xy))
+ else:
+ self._paths.append(mpath.Path(xy))
+
+ set_paths = set_verts
+
+ def set_verts_and_codes(self, verts, codes):
+ """Initialize vertices with path codes."""
+ if len(verts) != len(codes):
+ raise ValueError("'codes' must be a 1D list or array "
+ "with the same length of 'verts'")
+ self._paths = [mpath.Path(xy, cds) if len(xy) else mpath.Path(xy)
+ for xy, cds in zip(verts, codes)]
+ self.stale = True
+
+
+class FillBetweenPolyCollection(PolyCollection):
+ """
+ `.PolyCollection` that fills the area between two x- or y-curves.
+ """
+ def __init__(
+ self, t_direction, t, f1, f2, *,
+ where=None, interpolate=False, step=None, **kwargs):
+ """
+ Parameters
+ ----------
+ t_direction : {{'x', 'y'}}
+ The axes on which the variable lies.
+
+ - 'x': the curves are ``(t, f1)`` and ``(t, f2)``.
+ - 'y': the curves are ``(f1, t)`` and ``(f2, t)``.
+
+ t : array-like
+ The ``t_direction`` coordinates of the nodes defining the curves.
+
+ f1 : array-like or float
+ The other coordinates of the nodes defining the first curve.
+
+ f2 : array-like or float
+ The other coordinates of the nodes defining the second curve.
+
+ where : array-like of bool, optional
+ Define *where* to exclude some {dir} regions from being filled.
+ The filled regions are defined by the coordinates ``t[where]``.
+ More precisely, fill between ``t[i]`` and ``t[i+1]`` if
+ ``where[i] and where[i+1]``. Note that this definition implies
+ that an isolated *True* value between two *False* values in *where*
+ will not result in filling. Both sides of the *True* position
+ remain unfilled due to the adjacent *False* values.
+
+ interpolate : bool, default: False
+ This option is only relevant if *where* is used and the two curves
+ are crossing each other.
+
+ Semantically, *where* is often used for *f1* > *f2* or
+ similar. By default, the nodes of the polygon defining the filled
+ region will only be placed at the positions in the *t* array.
+ Such a polygon cannot describe the above semantics close to the
+ intersection. The t-sections containing the intersection are
+ simply clipped.
+
+ Setting *interpolate* to *True* will calculate the actual
+ intersection point and extend the filled region up to this point.
+
+ step : {{'pre', 'post', 'mid'}}, optional
+ Define *step* if the filling should be a step function,
+ i.e. constant in between *t*. The value determines where the
+ step will occur:
+
+ - 'pre': The f value is continued constantly to the left from
+ every *t* position, i.e. the interval ``(t[i-1], t[i]]`` has the
+ value ``f[i]``.
+ - 'post': The y value is continued constantly to the right from
+ every *x* position, i.e. the interval ``[t[i], t[i+1])`` has the
+ value ``f[i]``.
+ - 'mid': Steps occur half-way between the *t* positions.
+
+ **kwargs
+ Forwarded to `.PolyCollection`.
+
+ See Also
+ --------
+ .Axes.fill_between, .Axes.fill_betweenx
+ """
+ self.t_direction = t_direction
+ self._interpolate = interpolate
+ self._step = step
+ verts = self._make_verts(t, f1, f2, where)
+ super().__init__(verts, **kwargs)
+
+ @staticmethod
+ def _f_dir_from_t(t_direction):
+ """The direction that is other than `t_direction`."""
+ if t_direction == "x":
+ return "y"
+ elif t_direction == "y":
+ return "x"
+ else:
+ msg = f"t_direction must be 'x' or 'y', got {t_direction!r}"
+ raise ValueError(msg)
+
+ @property
+ def _f_direction(self):
+ """The direction that is other than `self.t_direction`."""
+ return self._f_dir_from_t(self.t_direction)
+
+ def set_data(self, t, f1, f2, *, where=None):
+ """
+ Set new values for the two bounding curves.
+
+ Parameters
+ ----------
+ t : array-like
+ The ``self.t_direction`` coordinates of the nodes defining the curves.
+
+ f1 : array-like or float
+ The other coordinates of the nodes defining the first curve.
+
+ f2 : array-like or float
+ The other coordinates of the nodes defining the second curve.
+
+ where : array-like of bool, optional
+ Define *where* to exclude some {dir} regions from being filled.
+ The filled regions are defined by the coordinates ``t[where]``.
+ More precisely, fill between ``t[i]`` and ``t[i+1]`` if
+ ``where[i] and where[i+1]``. Note that this definition implies
+ that an isolated *True* value between two *False* values in *where*
+ will not result in filling. Both sides of the *True* position
+ remain unfilled due to the adjacent *False* values.
+
+ See Also
+ --------
+ .PolyCollection.set_verts, .Line2D.set_data
+ """
+ t, f1, f2 = self.axes._fill_between_process_units(
+ self.t_direction, self._f_direction, t, f1, f2)
+
+ verts = self._make_verts(t, f1, f2, where)
+ self.set_verts(verts)
+
+ def get_datalim(self, transData):
+ """Calculate the data limits and return them as a `.Bbox`."""
+ datalim = transforms.Bbox.null()
+ datalim.update_from_data_xy((self.get_transform() - transData).transform(
+ np.concatenate([self._bbox, [self._bbox.minpos]])))
+ return datalim
+
+ def _make_verts(self, t, f1, f2, where):
+ """
+ Make verts that can be forwarded to `.PolyCollection`.
+ """
+ self._validate_shapes(self.t_direction, self._f_direction, t, f1, f2)
+
+ where = self._get_data_mask(t, f1, f2, where)
+ t, f1, f2 = np.broadcast_arrays(np.atleast_1d(t), f1, f2, subok=True)
+
+ self._bbox = transforms.Bbox.null()
+ self._bbox.update_from_data_xy(self._fix_pts_xy_order(np.concatenate([
+ np.stack((t[where], f[where]), axis=-1) for f in (f1, f2)])))
+
+ return [
+ self._make_verts_for_region(t, f1, f2, idx0, idx1)
+ for idx0, idx1 in cbook.contiguous_regions(where)
+ ]
+
+ def _get_data_mask(self, t, f1, f2, where):
+ """
+ Return a bool array, with True at all points that should eventually be rendered.
+
+ The array is True at a point if none of the data inputs
+ *t*, *f1*, *f2* is masked and if the input *where* is true at that point.
+ """
+ if where is None:
+ where = True
+ else:
+ where = np.asarray(where, dtype=bool)
+ if where.size != t.size:
+ msg = "where size ({}) does not match {!r} size ({})".format(
+ where.size, self.t_direction, t.size)
+ raise ValueError(msg)
+ return where & ~functools.reduce(
+ np.logical_or, map(np.ma.getmaskarray, [t, f1, f2]))
+
+ @staticmethod
+ def _validate_shapes(t_dir, f_dir, t, f1, f2):
+ """Validate that t, f1 and f2 are 1-dimensional and have the same length."""
+ names = (d + s for d, s in zip((t_dir, f_dir, f_dir), ("", "1", "2")))
+ for name, array in zip(names, [t, f1, f2]):
+ if array.ndim > 1:
+ raise ValueError(f"{name!r} is not 1-dimensional")
+ if t.size > 1 and array.size > 1 and t.size != array.size:
+ msg = "{!r} has size {}, but {!r} has an unequal size of {}".format(
+ t_dir, t.size, name, array.size)
+ raise ValueError(msg)
+
+ def _make_verts_for_region(self, t, f1, f2, idx0, idx1):
+ """
+ Make ``verts`` for a contiguous region between ``idx0`` and ``idx1``, taking
+ into account ``step`` and ``interpolate``.
+ """
+ t_slice = t[idx0:idx1]
+ f1_slice = f1[idx0:idx1]
+ f2_slice = f2[idx0:idx1]
+ if self._step is not None:
+ step_func = cbook.STEP_LOOKUP_MAP["steps-" + self._step]
+ t_slice, f1_slice, f2_slice = step_func(t_slice, f1_slice, f2_slice)
+
+ if self._interpolate:
+ start = self._get_interpolating_points(t, f1, f2, idx0)
+ end = self._get_interpolating_points(t, f1, f2, idx1)
+ else:
+ # Handle scalar f2 (e.g. 0): the fill should go all
+ # the way down to 0 even if none of the dep1 sample points do.
+ start = t_slice[0], f2_slice[0]
+ end = t_slice[-1], f2_slice[-1]
+
+ pts = np.concatenate((
+ np.asarray([start]),
+ np.stack((t_slice, f1_slice), axis=-1),
+ np.asarray([end]),
+ np.stack((t_slice, f2_slice), axis=-1)[::-1]))
+
+ return self._fix_pts_xy_order(pts)
+
+ @classmethod
+ def _get_interpolating_points(cls, t, f1, f2, idx):
+ """Calculate interpolating points."""
+ im1 = max(idx - 1, 0)
+ t_values = t[im1:idx+1]
+ diff_values = f1[im1:idx+1] - f2[im1:idx+1]
+ f1_values = f1[im1:idx+1]
+
+ if len(diff_values) == 2:
+ if np.ma.is_masked(diff_values[1]):
+ return t[im1], f1[im1]
+ elif np.ma.is_masked(diff_values[0]):
+ return t[idx], f1[idx]
+
+ diff_root_t = cls._get_diff_root(0, diff_values, t_values)
+ diff_root_f = cls._get_diff_root(diff_root_t, t_values, f1_values)
+ return diff_root_t, diff_root_f
+
+ @staticmethod
+ def _get_diff_root(x, xp, fp):
+ """Calculate diff root."""
+ order = xp.argsort()
+ return np.interp(x, xp[order], fp[order])
+
+ def _fix_pts_xy_order(self, pts):
+ """
+ Fix pts calculation results with `self.t_direction`.
+
+ In the workflow, it is assumed that `self.t_direction` is 'x'. If this
+ is not true, we need to exchange the coordinates.
+ """
+ return pts[:, ::-1] if self.t_direction == "y" else pts
+
+
+class RegularPolyCollection(_CollectionWithSizes):
+ """A collection of n-sided regular polygons."""
+
+ _path_generator = mpath.Path.unit_regular_polygon
+ _factor = np.pi ** (-1/2)
+
+ def __init__(self,
+ numsides,
+ *,
+ rotation=0,
+ sizes=(1,),
+ **kwargs):
+ """
+ Parameters
+ ----------
+ numsides : int
+ The number of sides of the polygon.
+ rotation : float
+ The rotation of the polygon in radians.
+ sizes : tuple of float
+ The area of the circle circumscribing the polygon in points^2.
+ **kwargs
+ Forwarded to `.Collection`.
+
+ Examples
+ --------
+ See :doc:`/gallery/event_handling/lasso_demo` for a complete example::
+
+ offsets = np.random.rand(20, 2)
+ facecolors = [cm.jet(x) for x in np.random.rand(20)]
+
+ collection = RegularPolyCollection(
+ numsides=5, # a pentagon
+ rotation=0, sizes=(50,),
+ facecolors=facecolors,
+ edgecolors=("black",),
+ linewidths=(1,),
+ offsets=offsets,
+ offset_transform=ax.transData,
+ )
+ """
+ super().__init__(**kwargs)
+ self.set_sizes(sizes)
+ self._numsides = numsides
+ self._paths = [self._path_generator(numsides)]
+ self._rotation = rotation
+ self.set_transform(transforms.IdentityTransform())
+
+ def get_numsides(self):
+ return self._numsides
+
+ def get_rotation(self):
+ return self._rotation
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ self.set_sizes(self._sizes, self.get_figure(root=True).dpi)
+ self._transforms = [
+ transforms.Affine2D(x).rotate(-self._rotation).get_matrix()
+ for x in self._transforms
+ ]
+ # Explicitly not super().draw, because set_sizes must be called before
+ # updating self._transforms.
+ Collection.draw(self, renderer)
+
+
+class StarPolygonCollection(RegularPolyCollection):
+ """Draw a collection of regular stars with *numsides* points."""
+ _path_generator = mpath.Path.unit_regular_star
+
+
+class AsteriskPolygonCollection(RegularPolyCollection):
+ """Draw a collection of regular asterisks with *numsides* points."""
+ _path_generator = mpath.Path.unit_regular_asterisk
+
+
+class LineCollection(Collection):
+ r"""
+ Represents a sequence of `.Line2D`\s that should be drawn together.
+
+ This class extends `.Collection` to represent a sequence of
+ `.Line2D`\s instead of just a sequence of `.Patch`\s.
+ Just as in `.Collection`, each property of a *LineCollection* may be either
+ a single value or a list of values. This list is then used cyclically for
+ each element of the LineCollection, so the property of the ``i``\th element
+ of the collection is::
+
+ prop[i % len(prop)]
+
+ The properties of each member of a *LineCollection* default to their values
+ in :rc:`lines.*` instead of :rc:`patch.*`, and the property *colors* is
+ added in place of *edgecolors*.
+ """
+
+ _edge_default = True
+
+ def __init__(self, segments, # Can be None.
+ *,
+ zorder=2, # Collection.zorder is 1
+ **kwargs
+ ):
+ """
+ Parameters
+ ----------
+ segments : list of (N, 2) array-like
+ A sequence ``[line0, line1, ...]`` where each line is a (N, 2)-shape
+ array-like containing points::
+
+ line0 = [(x0, y0), (x1, y1), ...]
+
+ Each line can contain a different number of points.
+ linewidths : float or list of float, default: :rc:`lines.linewidth`
+ The width of each line in points.
+ colors : :mpltype:`color` or list of color, default: :rc:`lines.color`
+ A sequence of RGBA tuples (e.g., arbitrary color strings, etc, not
+ allowed).
+ antialiaseds : bool or list of bool, default: :rc:`lines.antialiased`
+ Whether to use antialiasing for each line.
+ zorder : float, default: 2
+ zorder of the lines once drawn.
+
+ facecolors : :mpltype:`color` or list of :mpltype:`color`, default: 'none'
+ When setting *facecolors*, each line is interpreted as a boundary
+ for an area, implicitly closing the path from the last point to the
+ first point. The enclosed area is filled with *facecolor*.
+ In order to manually specify what should count as the "interior" of
+ each line, please use `.PathCollection` instead, where the
+ "interior" can be specified by appropriate usage of
+ `~.path.Path.CLOSEPOLY`.
+
+ **kwargs
+ Forwarded to `.Collection`.
+ """
+ # Unfortunately, mplot3d needs this explicit setting of 'facecolors'.
+ kwargs.setdefault('facecolors', 'none')
+ super().__init__(
+ zorder=zorder,
+ **kwargs)
+ self.set_segments(segments)
+
+ def set_segments(self, segments):
+ if segments is None:
+ return
+
+ self._paths = [mpath.Path(seg) if isinstance(seg, np.ma.MaskedArray)
+ else mpath.Path(np.asarray(seg, float))
+ for seg in segments]
+ self.stale = True
+
+ set_verts = set_segments # for compatibility with PolyCollection
+ set_paths = set_segments
+
+ def get_segments(self):
+ """
+ Returns
+ -------
+ list
+ List of segments in the LineCollection. Each list item contains an
+ array of vertices.
+ """
+ segments = []
+
+ for path in self._paths:
+ vertices = [
+ vertex
+ for vertex, _
+ # Never simplify here, we want to get the data-space values
+ # back and there in no way to know the "right" simplification
+ # threshold so never try.
+ in path.iter_segments(simplify=False)
+ ]
+ vertices = np.asarray(vertices)
+ segments.append(vertices)
+
+ return segments
+
+ def _get_default_linewidth(self):
+ return mpl.rcParams['lines.linewidth']
+
+ def _get_default_antialiased(self):
+ return mpl.rcParams['lines.antialiased']
+
+ def _get_default_edgecolor(self):
+ return mpl.rcParams['lines.color']
+
+ def _get_default_facecolor(self):
+ return 'none'
+
+ def set_alpha(self, alpha):
+ # docstring inherited
+ super().set_alpha(alpha)
+ if self._gapcolor is not None:
+ self.set_gapcolor(self._original_gapcolor)
+
+ def set_color(self, c):
+ """
+ Set the edgecolor(s) of the LineCollection.
+
+ Parameters
+ ----------
+ c : :mpltype:`color` or list of :mpltype:`color`
+ Single color (all lines have same color), or a
+ sequence of RGBA tuples; if it is a sequence the lines will
+ cycle through the sequence.
+ """
+ self.set_edgecolor(c)
+
+ set_colors = set_color
+
+ def get_color(self):
+ return self._edgecolors
+
+ get_colors = get_color # for compatibility with old versions
+
+ def set_gapcolor(self, gapcolor):
+ """
+ Set a color to fill the gaps in the dashed line style.
+
+ .. note::
+
+ Striped lines are created by drawing two interleaved dashed lines.
+ There can be overlaps between those two, which may result in
+ artifacts when using transparency.
+
+ This functionality is experimental and may change.
+
+ Parameters
+ ----------
+ gapcolor : :mpltype:`color` or list of :mpltype:`color` or None
+ The color with which to fill the gaps. If None, the gaps are
+ unfilled.
+ """
+ self._original_gapcolor = gapcolor
+ self._set_gapcolor(gapcolor)
+
+ def _set_gapcolor(self, gapcolor):
+ if gapcolor is not None:
+ gapcolor = mcolors.to_rgba_array(gapcolor, self._alpha)
+ self._gapcolor = gapcolor
+ self.stale = True
+
+ def get_gapcolor(self):
+ return self._gapcolor
+
+ def _get_inverse_paths_linestyles(self):
+ """
+ Returns the path and pattern for the gaps in the non-solid lines.
+
+ This path and pattern is the inverse of the path and pattern used to
+ construct the non-solid lines. For solid lines, we set the inverse path
+ to nans to prevent drawing an inverse line.
+ """
+ path_patterns = [
+ (mpath.Path(np.full((1, 2), np.nan)), ls)
+ if ls == (0, None) else
+ (path, mlines._get_inverse_dash_pattern(*ls))
+ for (path, ls) in
+ zip(self._paths, itertools.cycle(self._linestyles))]
+
+ return zip(*path_patterns)
+
+
+class EventCollection(LineCollection):
+ """
+ A collection of locations along a single axis at which an "event" occurred.
+
+ The events are given by a 1-dimensional array. They do not have an
+ amplitude and are displayed as parallel lines.
+ """
+
+ _edge_default = True
+
+ def __init__(self,
+ positions, # Cannot be None.
+ orientation='horizontal',
+ *,
+ lineoffset=0,
+ linelength=1,
+ linewidth=None,
+ color=None,
+ linestyle='solid',
+ antialiased=None,
+ **kwargs
+ ):
+ """
+ Parameters
+ ----------
+ positions : 1D array-like
+ Each value is an event.
+ orientation : {'horizontal', 'vertical'}, default: 'horizontal'
+ The sequence of events is plotted along this direction.
+ The marker lines of the single events are along the orthogonal
+ direction.
+ lineoffset : float, default: 0
+ The offset of the center of the markers from the origin, in the
+ direction orthogonal to *orientation*.
+ linelength : float, default: 1
+ The total height of the marker (i.e. the marker stretches from
+ ``lineoffset - linelength/2`` to ``lineoffset + linelength/2``).
+ linewidth : float or list thereof, default: :rc:`lines.linewidth`
+ The line width of the event lines, in points.
+ color : :mpltype:`color` or list of :mpltype:`color`, default: :rc:`lines.color`
+ The color of the event lines.
+ linestyle : str or tuple or list thereof, default: 'solid'
+ Valid strings are ['solid', 'dashed', 'dashdot', 'dotted',
+ '-', '--', '-.', ':']. Dash tuples should be of the form::
+
+ (offset, onoffseq),
+
+ where *onoffseq* is an even length tuple of on and off ink
+ in points.
+ antialiased : bool or list thereof, default: :rc:`lines.antialiased`
+ Whether to use antialiasing for drawing the lines.
+ **kwargs
+ Forwarded to `.LineCollection`.
+
+ Examples
+ --------
+ .. plot:: gallery/lines_bars_and_markers/eventcollection_demo.py
+ """
+ super().__init__([],
+ linewidths=linewidth, linestyles=linestyle,
+ colors=color, antialiaseds=antialiased,
+ **kwargs)
+ self._is_horizontal = True # Initial value, may be switched below.
+ self._linelength = linelength
+ self._lineoffset = lineoffset
+ self.set_orientation(orientation)
+ self.set_positions(positions)
+
+ def get_positions(self):
+ """
+ Return an array containing the floating-point values of the positions.
+ """
+ pos = 0 if self.is_horizontal() else 1
+ return [segment[0, pos] for segment in self.get_segments()]
+
+ def set_positions(self, positions):
+ """Set the positions of the events."""
+ if positions is None:
+ positions = []
+ if np.ndim(positions) != 1:
+ raise ValueError('positions must be one-dimensional')
+ lineoffset = self.get_lineoffset()
+ linelength = self.get_linelength()
+ pos_idx = 0 if self.is_horizontal() else 1
+ segments = np.empty((len(positions), 2, 2))
+ segments[:, :, pos_idx] = np.sort(positions)[:, None]
+ segments[:, 0, 1 - pos_idx] = lineoffset + linelength / 2
+ segments[:, 1, 1 - pos_idx] = lineoffset - linelength / 2
+ self.set_segments(segments)
+
+ def add_positions(self, position):
+ """Add one or more events at the specified positions."""
+ if position is None or (hasattr(position, 'len') and
+ len(position) == 0):
+ return
+ positions = self.get_positions()
+ positions = np.hstack([positions, np.asanyarray(position)])
+ self.set_positions(positions)
+ extend_positions = append_positions = add_positions
+
+ def is_horizontal(self):
+ """True if the eventcollection is horizontal, False if vertical."""
+ return self._is_horizontal
+
+ def get_orientation(self):
+ """
+ Return the orientation of the event line ('horizontal' or 'vertical').
+ """
+ return 'horizontal' if self.is_horizontal() else 'vertical'
+
+ def switch_orientation(self):
+ """
+ Switch the orientation of the event line, either from vertical to
+ horizontal or vice versus.
+ """
+ segments = self.get_segments()
+ for i, segment in enumerate(segments):
+ segments[i] = np.fliplr(segment)
+ self.set_segments(segments)
+ self._is_horizontal = not self.is_horizontal()
+ self.stale = True
+
+ def set_orientation(self, orientation):
+ """
+ Set the orientation of the event line.
+
+ Parameters
+ ----------
+ orientation : {'horizontal', 'vertical'}
+ """
+ is_horizontal = _api.check_getitem(
+ {"horizontal": True, "vertical": False},
+ orientation=orientation)
+ if is_horizontal == self.is_horizontal():
+ return
+ self.switch_orientation()
+
+ def get_linelength(self):
+ """Return the length of the lines used to mark each event."""
+ return self._linelength
+
+ def set_linelength(self, linelength):
+ """Set the length of the lines used to mark each event."""
+ if linelength == self.get_linelength():
+ return
+ lineoffset = self.get_lineoffset()
+ segments = self.get_segments()
+ pos = 1 if self.is_horizontal() else 0
+ for segment in segments:
+ segment[0, pos] = lineoffset + linelength / 2.
+ segment[1, pos] = lineoffset - linelength / 2.
+ self.set_segments(segments)
+ self._linelength = linelength
+
+ def get_lineoffset(self):
+ """Return the offset of the lines used to mark each event."""
+ return self._lineoffset
+
+ def set_lineoffset(self, lineoffset):
+ """Set the offset of the lines used to mark each event."""
+ if lineoffset == self.get_lineoffset():
+ return
+ linelength = self.get_linelength()
+ segments = self.get_segments()
+ pos = 1 if self.is_horizontal() else 0
+ for segment in segments:
+ segment[0, pos] = lineoffset + linelength / 2.
+ segment[1, pos] = lineoffset - linelength / 2.
+ self.set_segments(segments)
+ self._lineoffset = lineoffset
+
+ def get_linewidth(self):
+ """Get the width of the lines used to mark each event."""
+ return super().get_linewidth()[0]
+
+ def get_linewidths(self):
+ return super().get_linewidth()
+
+ def get_color(self):
+ """Return the color of the lines used to mark each event."""
+ return self.get_colors()[0]
+
+
+class CircleCollection(_CollectionWithSizes):
+ """A collection of circles, drawn using splines."""
+
+ _factor = np.pi ** (-1/2)
+
+ def __init__(self, sizes, **kwargs):
+ """
+ Parameters
+ ----------
+ sizes : float or array-like
+ The area of each circle in points^2.
+ **kwargs
+ Forwarded to `.Collection`.
+ """
+ super().__init__(**kwargs)
+ self.set_sizes(sizes)
+ self.set_transform(transforms.IdentityTransform())
+ self._paths = [mpath.Path.unit_circle()]
+
+
+class EllipseCollection(Collection):
+ """A collection of ellipses, drawn using splines."""
+
+ def __init__(self, widths, heights, angles, *, units='points', **kwargs):
+ """
+ Parameters
+ ----------
+ widths : array-like
+ The lengths of the first axes (e.g., major axis lengths).
+ heights : array-like
+ The lengths of second axes.
+ angles : array-like
+ The angles of the first axes, degrees CCW from the x-axis.
+ units : {'points', 'inches', 'dots', 'width', 'height', 'x', 'y', 'xy'}
+ The units in which majors and minors are given; 'width' and
+ 'height' refer to the dimensions of the axes, while 'x' and 'y'
+ refer to the *offsets* data units. 'xy' differs from all others in
+ that the angle as plotted varies with the aspect ratio, and equals
+ the specified angle only when the aspect ratio is unity. Hence
+ it behaves the same as the `~.patches.Ellipse` with
+ ``axes.transData`` as its transform.
+ **kwargs
+ Forwarded to `Collection`.
+ """
+ super().__init__(**kwargs)
+ self.set_widths(widths)
+ self.set_heights(heights)
+ self.set_angles(angles)
+ self._units = units
+ self.set_transform(transforms.IdentityTransform())
+ self._transforms = np.empty((0, 3, 3))
+ self._paths = [mpath.Path.unit_circle()]
+
+ def _set_transforms(self):
+ """Calculate transforms immediately before drawing."""
+
+ ax = self.axes
+ fig = self.get_figure(root=False)
+
+ if self._units == 'xy':
+ sc = 1
+ elif self._units == 'x':
+ sc = ax.bbox.width / ax.viewLim.width
+ elif self._units == 'y':
+ sc = ax.bbox.height / ax.viewLim.height
+ elif self._units == 'inches':
+ sc = fig.dpi
+ elif self._units == 'points':
+ sc = fig.dpi / 72.0
+ elif self._units == 'width':
+ sc = ax.bbox.width
+ elif self._units == 'height':
+ sc = ax.bbox.height
+ elif self._units == 'dots':
+ sc = 1.0
+ else:
+ raise ValueError(f'Unrecognized units: {self._units!r}')
+
+ self._transforms = np.zeros((len(self._widths), 3, 3))
+ widths = self._widths * sc
+ heights = self._heights * sc
+ sin_angle = np.sin(self._angles)
+ cos_angle = np.cos(self._angles)
+ self._transforms[:, 0, 0] = widths * cos_angle
+ self._transforms[:, 0, 1] = heights * -sin_angle
+ self._transforms[:, 1, 0] = widths * sin_angle
+ self._transforms[:, 1, 1] = heights * cos_angle
+ self._transforms[:, 2, 2] = 1.0
+
+ _affine = transforms.Affine2D
+ if self._units == 'xy':
+ m = ax.transData.get_affine().get_matrix().copy()
+ m[:2, 2:] = 0
+ self.set_transform(_affine(m))
+
+ def set_widths(self, widths):
+ """Set the lengths of the first axes (e.g., major axis)."""
+ self._widths = 0.5 * np.asarray(widths).ravel()
+ self.stale = True
+
+ def set_heights(self, heights):
+ """Set the lengths of second axes (e.g., minor axes)."""
+ self._heights = 0.5 * np.asarray(heights).ravel()
+ self.stale = True
+
+ def set_angles(self, angles):
+ """Set the angles of the first axes, degrees CCW from the x-axis."""
+ self._angles = np.deg2rad(angles).ravel()
+ self.stale = True
+
+ def get_widths(self):
+ """Get the lengths of the first axes (e.g., major axis)."""
+ return self._widths * 2
+
+ def get_heights(self):
+ """Set the lengths of second axes (e.g., minor axes)."""
+ return self._heights * 2
+
+ def get_angles(self):
+ """Get the angles of the first axes, degrees CCW from the x-axis."""
+ return np.rad2deg(self._angles)
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ self._set_transforms()
+ super().draw(renderer)
+
+
+class PatchCollection(Collection):
+ """
+ A generic collection of patches.
+
+ PatchCollection draws faster than a large number of equivalent individual
+ Patches. It also makes it easier to assign a colormap to a heterogeneous
+ collection of patches.
+ """
+
+ def __init__(self, patches, *, match_original=False, **kwargs):
+ """
+ Parameters
+ ----------
+ patches : list of `.Patch`
+ A sequence of Patch objects. This list may include
+ a heterogeneous assortment of different patch types.
+
+ match_original : bool, default: False
+ If True, use the colors and linewidths of the original
+ patches. If False, new colors may be assigned by
+ providing the standard collection arguments, facecolor,
+ edgecolor, linewidths, norm or cmap.
+
+ **kwargs
+ All other parameters are forwarded to `.Collection`.
+
+ If any of *edgecolors*, *facecolors*, *linewidths*, *antialiaseds*
+ are None, they default to their `.rcParams` patch setting, in
+ sequence form.
+
+ Notes
+ -----
+ The use of `~matplotlib.cm.ScalarMappable` functionality is optional.
+ If the `~matplotlib.cm.ScalarMappable` matrix ``_A`` has been set (via
+ a call to `~.ScalarMappable.set_array`), at draw time a call to scalar
+ mappable will be made to set the face colors.
+ """
+
+ if match_original:
+ def determine_facecolor(patch):
+ if patch.get_fill():
+ return patch.get_facecolor()
+ return [0, 0, 0, 0]
+
+ kwargs['facecolors'] = [determine_facecolor(p) for p in patches]
+ kwargs['edgecolors'] = [p.get_edgecolor() for p in patches]
+ kwargs['linewidths'] = [p.get_linewidth() for p in patches]
+ kwargs['linestyles'] = [p.get_linestyle() for p in patches]
+ kwargs['antialiaseds'] = [p.get_antialiased() for p in patches]
+
+ super().__init__(**kwargs)
+
+ self.set_paths(patches)
+
+ def set_paths(self, patches):
+ paths = [p.get_transform().transform_path(p.get_path())
+ for p in patches]
+ self._paths = paths
+
+
+class TriMesh(Collection):
+ """
+ Class for the efficient drawing of a triangular mesh using Gouraud shading.
+
+ A triangular mesh is a `~matplotlib.tri.Triangulation` object.
+ """
+ def __init__(self, triangulation, **kwargs):
+ super().__init__(**kwargs)
+ self._triangulation = triangulation
+ self._shading = 'gouraud'
+
+ self._bbox = transforms.Bbox.unit()
+
+ # Unfortunately this requires a copy, unless Triangulation
+ # was rewritten.
+ xy = np.hstack((triangulation.x.reshape(-1, 1),
+ triangulation.y.reshape(-1, 1)))
+ self._bbox.update_from_data_xy(xy)
+
+ def get_paths(self):
+ if self._paths is None:
+ self.set_paths()
+ return self._paths
+
+ def set_paths(self):
+ self._paths = self.convert_mesh_to_paths(self._triangulation)
+
+ @staticmethod
+ def convert_mesh_to_paths(tri):
+ """
+ Convert a given mesh into a sequence of `.Path` objects.
+
+ This function is primarily of use to implementers of backends that do
+ not directly support meshes.
+ """
+ triangles = tri.get_masked_triangles()
+ verts = np.stack((tri.x[triangles], tri.y[triangles]), axis=-1)
+ return [mpath.Path(x) for x in verts]
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ if not self.get_visible():
+ return
+ renderer.open_group(self.__class__.__name__, gid=self.get_gid())
+ transform = self.get_transform()
+
+ # Get a list of triangles and the color at each vertex.
+ tri = self._triangulation
+ triangles = tri.get_masked_triangles()
+
+ verts = np.stack((tri.x[triangles], tri.y[triangles]), axis=-1)
+
+ self.update_scalarmappable()
+ colors = self._facecolors[triangles]
+
+ gc = renderer.new_gc()
+ self._set_gc_clip(gc)
+ gc.set_linewidth(self.get_linewidth()[0])
+ renderer.draw_gouraud_triangles(gc, verts, colors, transform.frozen())
+ gc.restore()
+ renderer.close_group(self.__class__.__name__)
+
+
+class _MeshData:
+ r"""
+ Class for managing the two dimensional coordinates of Quadrilateral meshes
+ and the associated data with them. This class is a mixin and is intended to
+ be used with another collection that will implement the draw separately.
+
+ A quadrilateral mesh is a grid of M by N adjacent quadrilaterals that are
+ defined via a (M+1, N+1) grid of vertices. The quadrilateral (m, n) is
+ defined by the vertices ::
+
+ (m+1, n) ----------- (m+1, n+1)
+ / /
+ / /
+ / /
+ (m, n) -------- (m, n+1)
+
+ The mesh need not be regular and the polygons need not be convex.
+
+ Parameters
+ ----------
+ coordinates : (M+1, N+1, 2) array-like
+ The vertices. ``coordinates[m, n]`` specifies the (x, y) coordinates
+ of vertex (m, n).
+
+ shading : {'flat', 'gouraud'}, default: 'flat'
+ """
+ def __init__(self, coordinates, *, shading='flat'):
+ _api.check_shape((None, None, 2), coordinates=coordinates)
+ self._coordinates = coordinates
+ self._shading = shading
+
+ def set_array(self, A):
+ """
+ Set the data values.
+
+ Parameters
+ ----------
+ A : array-like
+ The mesh data. Supported array shapes are:
+
+ - (M, N) or (M*N,): a mesh with scalar data. The values are mapped
+ to colors using normalization and a colormap. See parameters
+ *norm*, *cmap*, *vmin*, *vmax*.
+ - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
+ - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
+ i.e. including transparency.
+
+ If the values are provided as a 2D grid, the shape must match the
+ coordinates grid. If the values are 1D, they are reshaped to 2D.
+ M, N follow from the coordinates grid, where the coordinates grid
+ shape is (M, N) for 'gouraud' *shading* and (M+1, N+1) for 'flat'
+ shading.
+ """
+ height, width = self._coordinates.shape[0:-1]
+ if self._shading == 'flat':
+ h, w = height - 1, width - 1
+ else:
+ h, w = height, width
+ ok_shapes = [(h, w, 3), (h, w, 4), (h, w), (h * w,)]
+ if A is not None:
+ shape = np.shape(A)
+ if shape not in ok_shapes:
+ raise ValueError(
+ f"For X ({width}) and Y ({height}) with {self._shading} "
+ f"shading, A should have shape "
+ f"{' or '.join(map(str, ok_shapes))}, not {A.shape}")
+ return super().set_array(A)
+
+ def get_coordinates(self):
+ """
+ Return the vertices of the mesh as an (M+1, N+1, 2) array.
+
+ M, N are the number of quadrilaterals in the rows / columns of the
+ mesh, corresponding to (M+1, N+1) vertices.
+ The last dimension specifies the components (x, y).
+ """
+ return self._coordinates
+
+ def get_edgecolor(self):
+ # docstring inherited
+ # Note that we want to return an array of shape (N*M, 4)
+ # a flattened RGBA collection
+ return super().get_edgecolor().reshape(-1, 4)
+
+ def get_facecolor(self):
+ # docstring inherited
+ # Note that we want to return an array of shape (N*M, 4)
+ # a flattened RGBA collection
+ return super().get_facecolor().reshape(-1, 4)
+
+ @staticmethod
+ def _convert_mesh_to_paths(coordinates):
+ """
+ Convert a given mesh into a sequence of `.Path` objects.
+
+ This function is primarily of use to implementers of backends that do
+ not directly support quadmeshes.
+ """
+ if isinstance(coordinates, np.ma.MaskedArray):
+ c = coordinates.data
+ else:
+ c = coordinates
+ points = np.concatenate([
+ c[:-1, :-1],
+ c[:-1, 1:],
+ c[1:, 1:],
+ c[1:, :-1],
+ c[:-1, :-1]
+ ], axis=2).reshape((-1, 5, 2))
+ return [mpath.Path(x) for x in points]
+
+ def _convert_mesh_to_triangles(self, coordinates):
+ """
+ Convert a given mesh into a sequence of triangles, each point
+ with its own color. The result can be used to construct a call to
+ `~.RendererBase.draw_gouraud_triangles`.
+ """
+ if isinstance(coordinates, np.ma.MaskedArray):
+ p = coordinates.data
+ else:
+ p = coordinates
+
+ p_a = p[:-1, :-1]
+ p_b = p[:-1, 1:]
+ p_c = p[1:, 1:]
+ p_d = p[1:, :-1]
+ p_center = (p_a + p_b + p_c + p_d) / 4.0
+ triangles = np.concatenate([
+ p_a, p_b, p_center,
+ p_b, p_c, p_center,
+ p_c, p_d, p_center,
+ p_d, p_a, p_center,
+ ], axis=2).reshape((-1, 3, 2))
+
+ c = self.get_facecolor().reshape((*coordinates.shape[:2], 4))
+ z = self.get_array()
+ mask = z.mask if np.ma.is_masked(z) else None
+ if mask is not None:
+ c[mask, 3] = np.nan
+ c_a = c[:-1, :-1]
+ c_b = c[:-1, 1:]
+ c_c = c[1:, 1:]
+ c_d = c[1:, :-1]
+ c_center = (c_a + c_b + c_c + c_d) / 4.0
+ colors = np.concatenate([
+ c_a, c_b, c_center,
+ c_b, c_c, c_center,
+ c_c, c_d, c_center,
+ c_d, c_a, c_center,
+ ], axis=2).reshape((-1, 3, 4))
+ tmask = np.isnan(colors[..., 2, 3])
+ return triangles[~tmask], colors[~tmask]
+
+
+class QuadMesh(_MeshData, Collection):
+ r"""
+ Class for the efficient drawing of a quadrilateral mesh.
+
+ A quadrilateral mesh is a grid of M by N adjacent quadrilaterals that are
+ defined via a (M+1, N+1) grid of vertices. The quadrilateral (m, n) is
+ defined by the vertices ::
+
+ (m+1, n) ----------- (m+1, n+1)
+ / /
+ / /
+ / /
+ (m, n) -------- (m, n+1)
+
+ The mesh need not be regular and the polygons need not be convex.
+
+ Parameters
+ ----------
+ coordinates : (M+1, N+1, 2) array-like
+ The vertices. ``coordinates[m, n]`` specifies the (x, y) coordinates
+ of vertex (m, n).
+
+ antialiased : bool, default: True
+
+ shading : {'flat', 'gouraud'}, default: 'flat'
+
+ Notes
+ -----
+ Unlike other `.Collection`\s, the default *pickradius* of `.QuadMesh` is 0,
+ i.e. `~.Artist.contains` checks whether the test point is within any of the
+ mesh quadrilaterals.
+
+ """
+
+ def __init__(self, coordinates, *, antialiased=True, shading='flat',
+ **kwargs):
+ kwargs.setdefault("pickradius", 0)
+ super().__init__(coordinates=coordinates, shading=shading)
+ Collection.__init__(self, **kwargs)
+
+ self._antialiased = antialiased
+ self._bbox = transforms.Bbox.unit()
+ self._bbox.update_from_data_xy(self._coordinates.reshape(-1, 2))
+ self.set_mouseover(False)
+
+ def get_paths(self):
+ if self._paths is None:
+ self.set_paths()
+ return self._paths
+
+ def set_paths(self):
+ self._paths = self._convert_mesh_to_paths(self._coordinates)
+ self.stale = True
+
+ def get_datalim(self, transData):
+ return (self.get_transform() - transData).transform_bbox(self._bbox)
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ if not self.get_visible():
+ return
+ renderer.open_group(self.__class__.__name__, self.get_gid())
+ transform = self.get_transform()
+ offset_trf = self.get_offset_transform()
+ offsets = self.get_offsets()
+
+ if self.have_units():
+ xs = self.convert_xunits(offsets[:, 0])
+ ys = self.convert_yunits(offsets[:, 1])
+ offsets = np.column_stack([xs, ys])
+
+ self.update_scalarmappable()
+
+ if not transform.is_affine:
+ coordinates = self._coordinates.reshape((-1, 2))
+ coordinates = transform.transform(coordinates)
+ coordinates = coordinates.reshape(self._coordinates.shape)
+ transform = transforms.IdentityTransform()
+ else:
+ coordinates = self._coordinates
+
+ if not offset_trf.is_affine:
+ offsets = offset_trf.transform_non_affine(offsets)
+ offset_trf = offset_trf.get_affine()
+
+ gc = renderer.new_gc()
+ gc.set_snap(self.get_snap())
+ self._set_gc_clip(gc)
+ gc.set_linewidth(self.get_linewidth()[0])
+
+ if self._shading == 'gouraud':
+ triangles, colors = self._convert_mesh_to_triangles(coordinates)
+ renderer.draw_gouraud_triangles(
+ gc, triangles, colors, transform.frozen())
+ else:
+ renderer.draw_quad_mesh(
+ gc, transform.frozen(),
+ coordinates.shape[1] - 1, coordinates.shape[0] - 1,
+ coordinates, offsets, offset_trf,
+ # Backends expect flattened rgba arrays (n*m, 4) for fc and ec
+ self.get_facecolor().reshape((-1, 4)),
+ self._antialiased, self.get_edgecolors().reshape((-1, 4)))
+ gc.restore()
+ renderer.close_group(self.__class__.__name__)
+ self.stale = False
+
+ def get_cursor_data(self, event):
+ contained, info = self.contains(event)
+ if contained and self.get_array() is not None:
+ return self.get_array().ravel()[info["ind"]]
+ return None
+
+
+class PolyQuadMesh(_MeshData, PolyCollection):
+ """
+ Class for drawing a quadrilateral mesh as individual Polygons.
+
+ A quadrilateral mesh is a grid of M by N adjacent quadrilaterals that are
+ defined via a (M+1, N+1) grid of vertices. The quadrilateral (m, n) is
+ defined by the vertices ::
+
+ (m+1, n) ----------- (m+1, n+1)
+ / /
+ / /
+ / /
+ (m, n) -------- (m, n+1)
+
+ The mesh need not be regular and the polygons need not be convex.
+
+ Parameters
+ ----------
+ coordinates : (M+1, N+1, 2) array-like
+ The vertices. ``coordinates[m, n]`` specifies the (x, y) coordinates
+ of vertex (m, n).
+
+ Notes
+ -----
+ Unlike `.QuadMesh`, this class will draw each cell as an individual Polygon.
+ This is significantly slower, but allows for more flexibility when wanting
+ to add additional properties to the cells, such as hatching.
+
+ Another difference from `.QuadMesh` is that if any of the vertices or data
+ of a cell are masked, that Polygon will **not** be drawn and it won't be in
+ the list of paths returned.
+ """
+
+ def __init__(self, coordinates, **kwargs):
+ super().__init__(coordinates=coordinates)
+ PolyCollection.__init__(self, verts=[], **kwargs)
+ # Setting the verts updates the paths of the PolyCollection
+ # This is called after the initializers to make sure the kwargs
+ # have all been processed and available for the masking calculations
+ self._set_unmasked_verts()
+
+ def _get_unmasked_polys(self):
+ """Get the unmasked regions using the coordinates and array"""
+ # mask(X) | mask(Y)
+ mask = np.any(np.ma.getmaskarray(self._coordinates), axis=-1)
+
+ # We want the shape of the polygon, which is the corner of each X/Y array
+ mask = (mask[0:-1, 0:-1] | mask[1:, 1:] | mask[0:-1, 1:] | mask[1:, 0:-1])
+ arr = self.get_array()
+ if arr is not None:
+ arr = np.ma.getmaskarray(arr)
+ if arr.ndim == 3:
+ # RGB(A) case
+ mask |= np.any(arr, axis=-1)
+ elif arr.ndim == 2:
+ mask |= arr
+ else:
+ mask |= arr.reshape(self._coordinates[:-1, :-1, :].shape[:2])
+ return ~mask
+
+ def _set_unmasked_verts(self):
+ X = self._coordinates[..., 0]
+ Y = self._coordinates[..., 1]
+
+ unmask = self._get_unmasked_polys()
+ X1 = np.ma.filled(X[:-1, :-1])[unmask]
+ Y1 = np.ma.filled(Y[:-1, :-1])[unmask]
+ X2 = np.ma.filled(X[1:, :-1])[unmask]
+ Y2 = np.ma.filled(Y[1:, :-1])[unmask]
+ X3 = np.ma.filled(X[1:, 1:])[unmask]
+ Y3 = np.ma.filled(Y[1:, 1:])[unmask]
+ X4 = np.ma.filled(X[:-1, 1:])[unmask]
+ Y4 = np.ma.filled(Y[:-1, 1:])[unmask]
+ npoly = len(X1)
+
+ xy = np.ma.stack([X1, Y1, X2, Y2, X3, Y3, X4, Y4, X1, Y1], axis=-1)
+ verts = xy.reshape((npoly, 5, 2))
+ self.set_verts(verts)
+
+ def get_edgecolor(self):
+ # docstring inherited
+ # We only want to return the facecolors of the polygons
+ # that were drawn.
+ ec = super().get_edgecolor()
+ unmasked_polys = self._get_unmasked_polys().ravel()
+ if len(ec) != len(unmasked_polys):
+ # Mapping is off
+ return ec
+ return ec[unmasked_polys, :]
+
+ def get_facecolor(self):
+ # docstring inherited
+ # We only want to return the facecolors of the polygons
+ # that were drawn.
+ fc = super().get_facecolor()
+ unmasked_polys = self._get_unmasked_polys().ravel()
+ if len(fc) != len(unmasked_polys):
+ # Mapping is off
+ return fc
+ return fc[unmasked_polys, :]
+
+ def set_array(self, A):
+ # docstring inherited
+ prev_unmask = self._get_unmasked_polys()
+ super().set_array(A)
+ # If the mask has changed at all we need to update
+ # the set of Polys that we are drawing
+ if not np.array_equal(prev_unmask, self._get_unmasked_polys()):
+ self._set_unmasked_verts()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/collections.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/collections.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..0805adef42935aad06d51d3f3ed093923c02c16b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/collections.pyi
@@ -0,0 +1,262 @@
+from collections.abc import Callable, Iterable, Sequence
+from typing import Literal
+
+import numpy as np
+from numpy.typing import ArrayLike, NDArray
+
+from . import colorizer, transforms
+from .backend_bases import MouseEvent
+from .artist import Artist
+from .colors import Normalize, Colormap
+from .lines import Line2D
+from .path import Path
+from .patches import Patch
+from .ticker import Locator, Formatter
+from .tri import Triangulation
+from .typing import ColorType, LineStyleType, CapStyleType, JoinStyleType
+
+class Collection(colorizer.ColorizingArtist):
+ def __init__(
+ self,
+ *,
+ edgecolors: ColorType | Sequence[ColorType] | None = ...,
+ facecolors: ColorType | Sequence[ColorType] | None = ...,
+ linewidths: float | Sequence[float] | None = ...,
+ linestyles: LineStyleType | Sequence[LineStyleType] = ...,
+ capstyle: CapStyleType | None = ...,
+ joinstyle: JoinStyleType | None = ...,
+ antialiaseds: bool | Sequence[bool] | None = ...,
+ offsets: tuple[float, float] | Sequence[tuple[float, float]] | None = ...,
+ offset_transform: transforms.Transform | None = ...,
+ norm: Normalize | None = ...,
+ cmap: Colormap | None = ...,
+ colorizer: colorizer.Colorizer | None = ...,
+ pickradius: float = ...,
+ hatch: str | None = ...,
+ urls: Sequence[str] | None = ...,
+ zorder: float = ...,
+ **kwargs
+ ) -> None: ...
+ def get_paths(self) -> Sequence[Path]: ...
+ def set_paths(self, paths: Sequence[Path]) -> None: ...
+ def get_transforms(self) -> Sequence[transforms.Transform]: ...
+ def get_offset_transform(self) -> transforms.Transform: ...
+ def set_offset_transform(self, offset_transform: transforms.Transform) -> None: ...
+ def get_datalim(self, transData: transforms.Transform) -> transforms.Bbox: ...
+ def set_pickradius(self, pickradius: float) -> None: ...
+ def get_pickradius(self) -> float: ...
+ def set_urls(self, urls: Sequence[str | None]) -> None: ...
+ def get_urls(self) -> Sequence[str | None]: ...
+ def set_hatch(self, hatch: str) -> None: ...
+ def get_hatch(self) -> str: ...
+ def set_hatch_linewidth(self, lw: float) -> None: ...
+ def get_hatch_linewidth(self) -> float: ...
+ def set_offsets(self, offsets: ArrayLike) -> None: ...
+ def get_offsets(self) -> ArrayLike: ...
+ def set_linewidth(self, lw: float | Sequence[float]) -> None: ...
+ def set_linestyle(self, ls: LineStyleType | Sequence[LineStyleType]) -> None: ...
+ def set_capstyle(self, cs: CapStyleType) -> None: ...
+ def get_capstyle(self) -> Literal["butt", "projecting", "round"] | None: ...
+ def set_joinstyle(self, js: JoinStyleType) -> None: ...
+ def get_joinstyle(self) -> Literal["miter", "round", "bevel"] | None: ...
+ def set_antialiased(self, aa: bool | Sequence[bool]) -> None: ...
+ def get_antialiased(self) -> NDArray[np.bool_]: ...
+ def set_color(self, c: ColorType | Sequence[ColorType]) -> None: ...
+ def set_facecolor(self, c: ColorType | Sequence[ColorType]) -> None: ...
+ def get_facecolor(self) -> ColorType | Sequence[ColorType]: ...
+ def get_edgecolor(self) -> ColorType | Sequence[ColorType]: ...
+ def set_edgecolor(self, c: ColorType | Sequence[ColorType]) -> None: ...
+ def set_alpha(self, alpha: float | Sequence[float] | None) -> None: ...
+ def get_linewidth(self) -> float | Sequence[float]: ...
+ def get_linestyle(self) -> LineStyleType | Sequence[LineStyleType]: ...
+ def update_scalarmappable(self) -> None: ...
+ def get_fill(self) -> bool: ...
+ def update_from(self, other: Artist) -> None: ...
+
+class _CollectionWithSizes(Collection):
+ def get_sizes(self) -> np.ndarray: ...
+ def set_sizes(self, sizes: ArrayLike | None, dpi: float = ...) -> None: ...
+
+class PathCollection(_CollectionWithSizes):
+ def __init__(
+ self, paths: Sequence[Path], sizes: ArrayLike | None = ..., **kwargs
+ ) -> None: ...
+ def set_paths(self, paths: Sequence[Path]) -> None: ...
+ def get_paths(self) -> Sequence[Path]: ...
+ def legend_elements(
+ self,
+ prop: Literal["colors", "sizes"] = ...,
+ num: int | Literal["auto"] | ArrayLike | Locator = ...,
+ fmt: str | Formatter | None = ...,
+ func: Callable[[ArrayLike], ArrayLike] = ...,
+ **kwargs,
+ ) -> tuple[list[Line2D], list[str]]: ...
+
+class PolyCollection(_CollectionWithSizes):
+ def __init__(
+ self,
+ verts: Sequence[ArrayLike],
+ sizes: ArrayLike | None = ...,
+ *,
+ closed: bool = ...,
+ **kwargs
+ ) -> None: ...
+ def set_verts(
+ self, verts: Sequence[ArrayLike | Path], closed: bool = ...
+ ) -> None: ...
+ def set_paths(self, verts: Sequence[Path], closed: bool = ...) -> None: ...
+ def set_verts_and_codes(
+ self, verts: Sequence[ArrayLike | Path], codes: Sequence[int]
+ ) -> None: ...
+
+class FillBetweenPolyCollection(PolyCollection):
+ def __init__(
+ self,
+ t_direction: Literal["x", "y"],
+ t: ArrayLike,
+ f1: ArrayLike,
+ f2: ArrayLike,
+ *,
+ where: Sequence[bool] | None = ...,
+ interpolate: bool = ...,
+ step: Literal["pre", "post", "mid"] | None = ...,
+ **kwargs,
+ ) -> None: ...
+ def set_data(
+ self,
+ t: ArrayLike,
+ f1: ArrayLike,
+ f2: ArrayLike,
+ *,
+ where: Sequence[bool] | None = ...,
+ ) -> None: ...
+ def get_datalim(self, transData: transforms.Transform) -> transforms.Bbox: ...
+
+class RegularPolyCollection(_CollectionWithSizes):
+ def __init__(
+ self, numsides: int, *, rotation: float = ..., sizes: ArrayLike = ..., **kwargs
+ ) -> None: ...
+ def get_numsides(self) -> int: ...
+ def get_rotation(self) -> float: ...
+
+class StarPolygonCollection(RegularPolyCollection): ...
+class AsteriskPolygonCollection(RegularPolyCollection): ...
+
+class LineCollection(Collection):
+ def __init__(
+ self, segments: Sequence[ArrayLike], *, zorder: float = ..., **kwargs
+ ) -> None: ...
+ def set_segments(self, segments: Sequence[ArrayLike] | None) -> None: ...
+ def set_verts(self, segments: Sequence[ArrayLike] | None) -> None: ...
+ def set_paths(self, segments: Sequence[ArrayLike] | None) -> None: ... # type: ignore[override]
+ def get_segments(self) -> list[np.ndarray]: ...
+ def set_color(self, c: ColorType | Sequence[ColorType]) -> None: ...
+ def set_colors(self, c: ColorType | Sequence[ColorType]) -> None: ...
+ def set_gapcolor(self, gapcolor: ColorType | Sequence[ColorType] | None) -> None: ...
+ def get_color(self) -> ColorType | Sequence[ColorType]: ...
+ def get_colors(self) -> ColorType | Sequence[ColorType]: ...
+ def get_gapcolor(self) -> ColorType | Sequence[ColorType] | None: ...
+
+
+class EventCollection(LineCollection):
+ def __init__(
+ self,
+ positions: ArrayLike,
+ orientation: Literal["horizontal", "vertical"] = ...,
+ *,
+ lineoffset: float = ...,
+ linelength: float = ...,
+ linewidth: float | Sequence[float] | None = ...,
+ color: ColorType | Sequence[ColorType] | None = ...,
+ linestyle: LineStyleType | Sequence[LineStyleType] = ...,
+ antialiased: bool | Sequence[bool] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_positions(self) -> list[float]: ...
+ def set_positions(self, positions: Sequence[float] | None) -> None: ...
+ def add_positions(self, position: Sequence[float] | None) -> None: ...
+ def extend_positions(self, position: Sequence[float] | None) -> None: ...
+ def append_positions(self, position: Sequence[float] | None) -> None: ...
+ def is_horizontal(self) -> bool: ...
+ def get_orientation(self) -> Literal["horizontal", "vertical"]: ...
+ def switch_orientation(self) -> None: ...
+ def set_orientation(
+ self, orientation: Literal["horizontal", "vertical"]
+ ) -> None: ...
+ def get_linelength(self) -> float | Sequence[float]: ...
+ def set_linelength(self, linelength: float | Sequence[float]) -> None: ...
+ def get_lineoffset(self) -> float: ...
+ def set_lineoffset(self, lineoffset: float) -> None: ...
+ def get_linewidth(self) -> float: ...
+ def get_linewidths(self) -> Sequence[float]: ...
+ def get_color(self) -> ColorType: ...
+
+class CircleCollection(_CollectionWithSizes):
+ def __init__(self, sizes: float | ArrayLike, **kwargs) -> None: ...
+
+class EllipseCollection(Collection):
+ def __init__(
+ self,
+ widths: ArrayLike,
+ heights: ArrayLike,
+ angles: ArrayLike,
+ *,
+ units: Literal[
+ "points", "inches", "dots", "width", "height", "x", "y", "xy"
+ ] = ...,
+ **kwargs
+ ) -> None: ...
+ def set_widths(self, widths: ArrayLike) -> None: ...
+ def set_heights(self, heights: ArrayLike) -> None: ...
+ def set_angles(self, angles: ArrayLike) -> None: ...
+ def get_widths(self) -> ArrayLike: ...
+ def get_heights(self) -> ArrayLike: ...
+ def get_angles(self) -> ArrayLike: ...
+
+class PatchCollection(Collection):
+ def __init__(
+ self, patches: Iterable[Patch], *, match_original: bool = ..., **kwargs
+ ) -> None: ...
+ def set_paths(self, patches: Iterable[Patch]) -> None: ... # type: ignore[override]
+
+class TriMesh(Collection):
+ def __init__(self, triangulation: Triangulation, **kwargs) -> None: ...
+ def get_paths(self) -> list[Path]: ...
+ # Parent class has an argument, perhaps add a noop arg?
+ def set_paths(self) -> None: ... # type: ignore[override]
+ @staticmethod
+ def convert_mesh_to_paths(tri: Triangulation) -> list[Path]: ...
+
+class _MeshData:
+ def __init__(
+ self,
+ coordinates: ArrayLike,
+ *,
+ shading: Literal["flat", "gouraud"] = ...,
+ ) -> None: ...
+ def set_array(self, A: ArrayLike | None) -> None: ...
+ def get_coordinates(self) -> ArrayLike: ...
+ def get_facecolor(self) -> ColorType | Sequence[ColorType]: ...
+ def get_edgecolor(self) -> ColorType | Sequence[ColorType]: ...
+
+class QuadMesh(_MeshData, Collection):
+ def __init__(
+ self,
+ coordinates: ArrayLike,
+ *,
+ antialiased: bool = ...,
+ shading: Literal["flat", "gouraud"] = ...,
+ **kwargs
+ ) -> None: ...
+ def get_paths(self) -> list[Path]: ...
+ # Parent class has an argument, perhaps add a noop arg?
+ def set_paths(self) -> None: ... # type: ignore[override]
+ def get_datalim(self, transData: transforms.Transform) -> transforms.Bbox: ...
+ def get_cursor_data(self, event: MouseEvent) -> float: ...
+
+class PolyQuadMesh(_MeshData, PolyCollection):
+ def __init__(
+ self,
+ coordinates: ArrayLike,
+ **kwargs
+ ) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorbar.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorbar.py
new file mode 100644
index 0000000000000000000000000000000000000000..624e2250303ca3a269f7efd8fa56c9f0b547dd38
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorbar.py
@@ -0,0 +1,1563 @@
+"""
+Colorbars are a visualization of the mapping from scalar values to colors.
+In Matplotlib they are drawn into a dedicated `~.axes.Axes`.
+
+.. note::
+ Colorbars are typically created through `.Figure.colorbar` or its pyplot
+ wrapper `.pyplot.colorbar`, which internally use `.Colorbar` together with
+ `.make_axes_gridspec` (for `.GridSpec`-positioned Axes) or `.make_axes` (for
+ non-`.GridSpec`-positioned Axes).
+
+ End-users most likely won't need to directly use this module's API.
+"""
+
+import logging
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cbook, collections, cm, colors, contour, ticker
+import matplotlib.artist as martist
+import matplotlib.patches as mpatches
+import matplotlib.path as mpath
+import matplotlib.spines as mspines
+import matplotlib.transforms as mtransforms
+from matplotlib import _docstring
+
+_log = logging.getLogger(__name__)
+
+_docstring.interpd.register(
+ _make_axes_kw_doc="""
+location : None or {'left', 'right', 'top', 'bottom'}
+ The location, relative to the parent Axes, where the colorbar Axes
+ is created. It also determines the *orientation* of the colorbar
+ (colorbars on the left and right are vertical, colorbars at the top
+ and bottom are horizontal). If None, the location will come from the
+ *orientation* if it is set (vertical colorbars on the right, horizontal
+ ones at the bottom), or default to 'right' if *orientation* is unset.
+
+orientation : None or {'vertical', 'horizontal'}
+ The orientation of the colorbar. It is preferable to set the *location*
+ of the colorbar, as that also determines the *orientation*; passing
+ incompatible values for *location* and *orientation* raises an exception.
+
+fraction : float, default: 0.15
+ Fraction of original Axes to use for colorbar.
+
+shrink : float, default: 1.0
+ Fraction by which to multiply the size of the colorbar.
+
+aspect : float, default: 20
+ Ratio of long to short dimensions.
+
+pad : float, default: 0.05 if vertical, 0.15 if horizontal
+ Fraction of original Axes between colorbar and new image Axes.
+
+anchor : (float, float), optional
+ The anchor point of the colorbar Axes.
+ Defaults to (0.0, 0.5) if vertical; (0.5, 1.0) if horizontal.
+
+panchor : (float, float), or *False*, optional
+ The anchor point of the colorbar parent Axes. If *False*, the parent
+ axes' anchor will be unchanged.
+ Defaults to (1.0, 0.5) if vertical; (0.5, 0.0) if horizontal.""",
+ _colormap_kw_doc="""
+extend : {'neither', 'both', 'min', 'max'}
+ Make pointed end(s) for out-of-range values (unless 'neither'). These are
+ set for a given colormap using the colormap set_under and set_over methods.
+
+extendfrac : {*None*, 'auto', length, lengths}
+ If set to *None*, both the minimum and maximum triangular colorbar
+ extensions will have a length of 5% of the interior colorbar length (this
+ is the default setting).
+
+ If set to 'auto', makes the triangular colorbar extensions the same lengths
+ as the interior boxes (when *spacing* is set to 'uniform') or the same
+ lengths as the respective adjacent interior boxes (when *spacing* is set to
+ 'proportional').
+
+ If a scalar, indicates the length of both the minimum and maximum
+ triangular colorbar extensions as a fraction of the interior colorbar
+ length. A two-element sequence of fractions may also be given, indicating
+ the lengths of the minimum and maximum colorbar extensions respectively as
+ a fraction of the interior colorbar length.
+
+extendrect : bool
+ If *False* the minimum and maximum colorbar extensions will be triangular
+ (the default). If *True* the extensions will be rectangular.
+
+ticks : None or list of ticks or Locator
+ If None, ticks are determined automatically from the input.
+
+format : None or str or Formatter
+ If None, `~.ticker.ScalarFormatter` is used.
+ Format strings, e.g., ``"%4.2e"`` or ``"{x:.2e}"``, are supported.
+ An alternative `~.ticker.Formatter` may be given instead.
+
+drawedges : bool
+ Whether to draw lines at color boundaries.
+
+label : str
+ The label on the colorbar's long axis.
+
+boundaries, values : None or a sequence
+ If unset, the colormap will be displayed on a 0-1 scale.
+ If sequences, *values* must have a length 1 less than *boundaries*. For
+ each region delimited by adjacent entries in *boundaries*, the color mapped
+ to the corresponding value in *values* will be used. The size of each
+ region is determined by the *spacing* parameter.
+ Normally only useful for indexed colors (i.e. ``norm=NoNorm()``) or other
+ unusual circumstances.
+
+spacing : {'uniform', 'proportional'}
+ For discrete colorbars (`.BoundaryNorm` or contours), 'uniform' gives each
+ color the same space; 'proportional' makes the space proportional to the
+ data interval.""")
+
+
+def _set_ticks_on_axis_warn(*args, **kwargs):
+ # a top level function which gets put in at the axes'
+ # set_xticks and set_yticks by Colorbar.__init__.
+ _api.warn_external("Use the colorbar set_ticks() method instead.")
+
+
+class _ColorbarSpine(mspines.Spine):
+ def __init__(self, axes):
+ self._ax = axes
+ super().__init__(axes, 'colorbar', mpath.Path(np.empty((0, 2))))
+ mpatches.Patch.set_transform(self, axes.transAxes)
+
+ def get_window_extent(self, renderer=None):
+ # This Spine has no Axis associated with it, and doesn't need to adjust
+ # its location, so we can directly get the window extent from the
+ # super-super-class.
+ return mpatches.Patch.get_window_extent(self, renderer=renderer)
+
+ def set_xy(self, xy):
+ self._path = mpath.Path(xy, closed=True)
+ self._xy = xy
+ self.stale = True
+
+ def draw(self, renderer):
+ ret = mpatches.Patch.draw(self, renderer)
+ self.stale = False
+ return ret
+
+
+class _ColorbarAxesLocator:
+ """
+ Shrink the Axes if there are triangular or rectangular extends.
+ """
+ def __init__(self, cbar):
+ self._cbar = cbar
+ self._orig_locator = cbar.ax._axes_locator
+
+ def __call__(self, ax, renderer):
+ if self._orig_locator is not None:
+ pos = self._orig_locator(ax, renderer)
+ else:
+ pos = ax.get_position(original=True)
+ if self._cbar.extend == 'neither':
+ return pos
+
+ y, extendlen = self._cbar._proportional_y()
+ if not self._cbar._extend_lower():
+ extendlen[0] = 0
+ if not self._cbar._extend_upper():
+ extendlen[1] = 0
+ len = sum(extendlen) + 1
+ shrink = 1 / len
+ offset = extendlen[0] / len
+ # we need to reset the aspect ratio of the axes to account
+ # of the extends...
+ if hasattr(ax, '_colorbar_info'):
+ aspect = ax._colorbar_info['aspect']
+ else:
+ aspect = False
+ # now shrink and/or offset to take into account the
+ # extend tri/rectangles.
+ if self._cbar.orientation == 'vertical':
+ if aspect:
+ self._cbar.ax.set_box_aspect(aspect*shrink)
+ pos = pos.shrunk(1, shrink).translated(0, offset * pos.height)
+ else:
+ if aspect:
+ self._cbar.ax.set_box_aspect(1/(aspect * shrink))
+ pos = pos.shrunk(shrink, 1).translated(offset * pos.width, 0)
+ return pos
+
+ def get_subplotspec(self):
+ # make tight_layout happy..
+ return (
+ self._cbar.ax.get_subplotspec()
+ or getattr(self._orig_locator, "get_subplotspec", lambda: None)())
+
+
+@_docstring.interpd
+class Colorbar:
+ r"""
+ Draw a colorbar in an existing Axes.
+
+ Typically, colorbars are created using `.Figure.colorbar` or
+ `.pyplot.colorbar` and associated with `.ScalarMappable`\s (such as an
+ `.AxesImage` generated via `~.axes.Axes.imshow`).
+
+ In order to draw a colorbar not associated with other elements in the
+ figure, e.g. when showing a colormap by itself, one can create an empty
+ `.ScalarMappable`, or directly pass *cmap* and *norm* instead of *mappable*
+ to `Colorbar`.
+
+ Useful public methods are :meth:`set_label` and :meth:`add_lines`.
+
+ Attributes
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` instance in which the colorbar is drawn.
+ lines : list
+ A list of `.LineCollection` (empty if no lines were drawn).
+ dividers : `.LineCollection`
+ A LineCollection (empty if *drawedges* is ``False``).
+ """
+
+ n_rasterize = 50 # rasterize solids if number of colors >= n_rasterize
+
+ def __init__(
+ self, ax, mappable=None, *,
+ alpha=None,
+ location=None,
+ extend=None,
+ extendfrac=None,
+ extendrect=False,
+ ticks=None,
+ format=None,
+ values=None,
+ boundaries=None,
+ spacing='uniform',
+ drawedges=False,
+ label='',
+ cmap=None, norm=None, # redundant with *mappable*
+ orientation=None, ticklocation='auto', # redundant with *location*
+ ):
+ """
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` instance in which the colorbar is drawn.
+
+ mappable : `.ScalarMappable`
+ The mappable whose colormap and norm will be used.
+
+ To show the colors versus index instead of on a 0-1 scale, set the
+ mappable's norm to ``colors.NoNorm()``.
+
+ alpha : float
+ The colorbar transparency between 0 (transparent) and 1 (opaque).
+
+ location : None or {'left', 'right', 'top', 'bottom'}
+ Set the colorbar's *orientation* and *ticklocation*. Colorbars on
+ the left and right are vertical, colorbars at the top and bottom
+ are horizontal. The *ticklocation* is the same as *location*, so if
+ *location* is 'top', the ticks are on the top. *orientation* and/or
+ *ticklocation* can be provided as well and overrides the value set by
+ *location*, but there will be an error for incompatible combinations.
+
+ .. versionadded:: 3.7
+
+ %(_colormap_kw_doc)s
+
+ Other Parameters
+ ----------------
+ cmap : `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
+ The colormap to use. This parameter is ignored, unless *mappable* is
+ None.
+
+ norm : `~matplotlib.colors.Normalize`
+ The normalization to use. This parameter is ignored, unless *mappable*
+ is None.
+
+ orientation : None or {'vertical', 'horizontal'}
+ If None, use the value determined by *location*. If both
+ *orientation* and *location* are None then defaults to 'vertical'.
+
+ ticklocation : {'auto', 'left', 'right', 'top', 'bottom'}
+ The location of the colorbar ticks. The *ticklocation* must match
+ *orientation*. For example, a horizontal colorbar can only have ticks
+ at the top or the bottom. If 'auto', the ticks will be the same as
+ *location*, so a colorbar to the left will have ticks to the left. If
+ *location* is None, the ticks will be at the bottom for a horizontal
+ colorbar and at the right for a vertical.
+ """
+ if mappable is None:
+ mappable = cm.ScalarMappable(norm=norm, cmap=cmap)
+
+ self.mappable = mappable
+ cmap = mappable.cmap
+ norm = mappable.norm
+
+ filled = True
+ if isinstance(mappable, contour.ContourSet):
+ cs = mappable
+ alpha = cs.get_alpha()
+ boundaries = cs._levels
+ values = cs.cvalues
+ extend = cs.extend
+ filled = cs.filled
+ if ticks is None:
+ ticks = ticker.FixedLocator(cs.levels, nbins=10)
+ elif isinstance(mappable, martist.Artist):
+ alpha = mappable.get_alpha()
+
+ mappable.colorbar = self
+ mappable.colorbar_cid = mappable.callbacks.connect(
+ 'changed', self.update_normal)
+
+ location_orientation = _get_orientation_from_location(location)
+
+ _api.check_in_list(
+ [None, 'vertical', 'horizontal'], orientation=orientation)
+ _api.check_in_list(
+ ['auto', 'left', 'right', 'top', 'bottom'],
+ ticklocation=ticklocation)
+ _api.check_in_list(
+ ['uniform', 'proportional'], spacing=spacing)
+
+ if location_orientation is not None and orientation is not None:
+ if location_orientation != orientation:
+ raise TypeError(
+ "location and orientation are mutually exclusive")
+ else:
+ orientation = orientation or location_orientation or "vertical"
+
+ self.ax = ax
+ self.ax._axes_locator = _ColorbarAxesLocator(self)
+
+ if extend is None:
+ if (not isinstance(mappable, contour.ContourSet)
+ and getattr(cmap, 'colorbar_extend', False) is not False):
+ extend = cmap.colorbar_extend
+ elif hasattr(norm, 'extend'):
+ extend = norm.extend
+ else:
+ extend = 'neither'
+ self.alpha = None
+ # Call set_alpha to handle array-like alphas properly
+ self.set_alpha(alpha)
+ self.cmap = cmap
+ self.norm = norm
+ self.values = values
+ self.boundaries = boundaries
+ self.extend = extend
+ self._inside = _api.check_getitem(
+ {'neither': slice(0, None), 'both': slice(1, -1),
+ 'min': slice(1, None), 'max': slice(0, -1)},
+ extend=extend)
+ self.spacing = spacing
+ self.orientation = orientation
+ self.drawedges = drawedges
+ self._filled = filled
+ self.extendfrac = extendfrac
+ self.extendrect = extendrect
+ self._extend_patches = []
+ self.solids = None
+ self.solids_patches = []
+ self.lines = []
+
+ for spine in self.ax.spines.values():
+ spine.set_visible(False)
+ self.outline = self.ax.spines['outline'] = _ColorbarSpine(self.ax)
+
+ self.dividers = collections.LineCollection(
+ [],
+ colors=[mpl.rcParams['axes.edgecolor']],
+ linewidths=[0.5 * mpl.rcParams['axes.linewidth']],
+ clip_on=False)
+ self.ax.add_collection(self.dividers)
+
+ self._locator = None
+ self._minorlocator = None
+ self._formatter = None
+ self._minorformatter = None
+
+ if ticklocation == 'auto':
+ ticklocation = _get_ticklocation_from_orientation(
+ orientation) if location is None else location
+ self.ticklocation = ticklocation
+
+ self.set_label(label)
+ self._reset_locator_formatter_scale()
+
+ if np.iterable(ticks):
+ self._locator = ticker.FixedLocator(ticks, nbins=len(ticks))
+ else:
+ self._locator = ticks
+
+ if isinstance(format, str):
+ # Check format between FormatStrFormatter and StrMethodFormatter
+ try:
+ self._formatter = ticker.FormatStrFormatter(format)
+ _ = self._formatter(0)
+ except (TypeError, ValueError):
+ self._formatter = ticker.StrMethodFormatter(format)
+ else:
+ self._formatter = format # Assume it is a Formatter or None
+ self._draw_all()
+
+ if isinstance(mappable, contour.ContourSet) and not mappable.filled:
+ self.add_lines(mappable)
+
+ # Link the Axes and Colorbar for interactive use
+ self.ax._colorbar = self
+ # Don't navigate on any of these types of mappables
+ if (isinstance(self.norm, (colors.BoundaryNorm, colors.NoNorm)) or
+ isinstance(self.mappable, contour.ContourSet)):
+ self.ax.set_navigate(False)
+
+ # These are the functions that set up interactivity on this colorbar
+ self._interactive_funcs = ["_get_view", "_set_view",
+ "_set_view_from_bbox", "drag_pan"]
+ for x in self._interactive_funcs:
+ setattr(self.ax, x, getattr(self, x))
+ # Set the cla function to the cbar's method to override it
+ self.ax.cla = self._cbar_cla
+ # Callbacks for the extend calculations to handle inverting the axis
+ self._extend_cid1 = self.ax.callbacks.connect(
+ "xlim_changed", self._do_extends)
+ self._extend_cid2 = self.ax.callbacks.connect(
+ "ylim_changed", self._do_extends)
+
+ @property
+ def long_axis(self):
+ """Axis that has decorations (ticks, etc) on it."""
+ if self.orientation == 'vertical':
+ return self.ax.yaxis
+ return self.ax.xaxis
+
+ @property
+ def locator(self):
+ """Major tick `.Locator` for the colorbar."""
+ return self.long_axis.get_major_locator()
+
+ @locator.setter
+ def locator(self, loc):
+ self.long_axis.set_major_locator(loc)
+ self._locator = loc
+
+ @property
+ def minorlocator(self):
+ """Minor tick `.Locator` for the colorbar."""
+ return self.long_axis.get_minor_locator()
+
+ @minorlocator.setter
+ def minorlocator(self, loc):
+ self.long_axis.set_minor_locator(loc)
+ self._minorlocator = loc
+
+ @property
+ def formatter(self):
+ """Major tick label `.Formatter` for the colorbar."""
+ return self.long_axis.get_major_formatter()
+
+ @formatter.setter
+ def formatter(self, fmt):
+ self.long_axis.set_major_formatter(fmt)
+ self._formatter = fmt
+
+ @property
+ def minorformatter(self):
+ """Minor tick `.Formatter` for the colorbar."""
+ return self.long_axis.get_minor_formatter()
+
+ @minorformatter.setter
+ def minorformatter(self, fmt):
+ self.long_axis.set_minor_formatter(fmt)
+ self._minorformatter = fmt
+
+ def _cbar_cla(self):
+ """Function to clear the interactive colorbar state."""
+ for x in self._interactive_funcs:
+ delattr(self.ax, x)
+ # We now restore the old cla() back and can call it directly
+ del self.ax.cla
+ self.ax.cla()
+
+ def update_normal(self, mappable=None):
+ """
+ Update solid patches, lines, etc.
+
+ This is meant to be called when the norm of the image or contour plot
+ to which this colorbar belongs changes.
+
+ If the norm on the mappable is different than before, this resets the
+ locator and formatter for the axis, so if these have been customized,
+ they will need to be customized again. However, if the norm only
+ changes values of *vmin*, *vmax* or *cmap* then the old formatter
+ and locator will be preserved.
+ """
+ if mappable:
+ # The mappable keyword argument exists because
+ # ScalarMappable.changed() emits self.callbacks.process('changed', self)
+ # in contrast, ColorizingArtist (and Colorizer) does not use this keyword.
+ # [ColorizingArtist.changed() emits self.callbacks.process('changed')]
+ # Also, there is no test where self.mappable == mappable is not True
+ # and possibly no use case.
+ # Therefore, the mappable keyword can be deprecated if cm.ScalarMappable
+ # is removed.
+ self.mappable = mappable
+ _log.debug('colorbar update normal %r %r', self.mappable.norm, self.norm)
+ self.set_alpha(self.mappable.get_alpha())
+ self.cmap = self.mappable.cmap
+ if self.mappable.norm != self.norm:
+ self.norm = self.mappable.norm
+ self._reset_locator_formatter_scale()
+
+ self._draw_all()
+ if isinstance(self.mappable, contour.ContourSet):
+ CS = self.mappable
+ if not CS.filled:
+ self.add_lines(CS)
+ self.stale = True
+
+ def _draw_all(self):
+ """
+ Calculate any free parameters based on the current cmap and norm,
+ and do all the drawing.
+ """
+ if self.orientation == 'vertical':
+ if mpl.rcParams['ytick.minor.visible']:
+ self.minorticks_on()
+ else:
+ if mpl.rcParams['xtick.minor.visible']:
+ self.minorticks_on()
+ self.long_axis.set(label_position=self.ticklocation,
+ ticks_position=self.ticklocation)
+ self._short_axis().set_ticks([])
+ self._short_axis().set_ticks([], minor=True)
+
+ # Set self._boundaries and self._values, including extensions.
+ # self._boundaries are the edges of each square of color, and
+ # self._values are the value to map into the norm to get the
+ # color:
+ self._process_values()
+ # Set self.vmin and self.vmax to first and last boundary, excluding
+ # extensions:
+ self.vmin, self.vmax = self._boundaries[self._inside][[0, -1]]
+ # Compute the X/Y mesh.
+ X, Y = self._mesh()
+ # draw the extend triangles, and shrink the inner Axes to accommodate.
+ # also adds the outline path to self.outline spine:
+ self._do_extends()
+ lower, upper = self.vmin, self.vmax
+ if self.long_axis.get_inverted():
+ # If the axis is inverted, we need to swap the vmin/vmax
+ lower, upper = upper, lower
+ if self.orientation == 'vertical':
+ self.ax.set_xlim(0, 1)
+ self.ax.set_ylim(lower, upper)
+ else:
+ self.ax.set_ylim(0, 1)
+ self.ax.set_xlim(lower, upper)
+
+ # set up the tick locators and formatters. A bit complicated because
+ # boundary norms + uniform spacing requires a manual locator.
+ self.update_ticks()
+
+ if self._filled:
+ ind = np.arange(len(self._values))
+ if self._extend_lower():
+ ind = ind[1:]
+ if self._extend_upper():
+ ind = ind[:-1]
+ self._add_solids(X, Y, self._values[ind, np.newaxis])
+
+ def _add_solids(self, X, Y, C):
+ """Draw the colors; optionally add separators."""
+ # Cleanup previously set artists.
+ if self.solids is not None:
+ self.solids.remove()
+ for solid in self.solids_patches:
+ solid.remove()
+ # Add new artist(s), based on mappable type. Use individual patches if
+ # hatching is needed, pcolormesh otherwise.
+ mappable = getattr(self, 'mappable', None)
+ if (isinstance(mappable, contour.ContourSet)
+ and any(hatch is not None for hatch in mappable.hatches)):
+ self._add_solids_patches(X, Y, C, mappable)
+ else:
+ self.solids = self.ax.pcolormesh(
+ X, Y, C, cmap=self.cmap, norm=self.norm, alpha=self.alpha,
+ edgecolors='none', shading='flat')
+ if not self.drawedges:
+ if len(self._y) >= self.n_rasterize:
+ self.solids.set_rasterized(True)
+ self._update_dividers()
+
+ def _update_dividers(self):
+ if not self.drawedges:
+ self.dividers.set_segments([])
+ return
+ # Place all *internal* dividers.
+ if self.orientation == 'vertical':
+ lims = self.ax.get_ylim()
+ bounds = (lims[0] < self._y) & (self._y < lims[1])
+ else:
+ lims = self.ax.get_xlim()
+ bounds = (lims[0] < self._y) & (self._y < lims[1])
+ y = self._y[bounds]
+ # And then add outer dividers if extensions are on.
+ if self._extend_lower():
+ y = np.insert(y, 0, lims[0])
+ if self._extend_upper():
+ y = np.append(y, lims[1])
+ X, Y = np.meshgrid([0, 1], y)
+ if self.orientation == 'vertical':
+ segments = np.dstack([X, Y])
+ else:
+ segments = np.dstack([Y, X])
+ self.dividers.set_segments(segments)
+
+ def _add_solids_patches(self, X, Y, C, mappable):
+ hatches = mappable.hatches * (len(C) + 1) # Have enough hatches.
+ if self._extend_lower():
+ # remove first hatch that goes into the extend patch
+ hatches = hatches[1:]
+ patches = []
+ for i in range(len(X) - 1):
+ xy = np.array([[X[i, 0], Y[i, 1]],
+ [X[i, 1], Y[i, 0]],
+ [X[i + 1, 1], Y[i + 1, 0]],
+ [X[i + 1, 0], Y[i + 1, 1]]])
+ patch = mpatches.PathPatch(mpath.Path(xy),
+ facecolor=self.cmap(self.norm(C[i][0])),
+ hatch=hatches[i], linewidth=0,
+ antialiased=False, alpha=self.alpha)
+ self.ax.add_patch(patch)
+ patches.append(patch)
+ self.solids_patches = patches
+
+ def _do_extends(self, ax=None):
+ """
+ Add the extend tri/rectangles on the outside of the Axes.
+
+ ax is unused, but required due to the callbacks on xlim/ylim changed
+ """
+ # Clean up any previous extend patches
+ for patch in self._extend_patches:
+ patch.remove()
+ self._extend_patches = []
+ # extend lengths are fraction of the *inner* part of colorbar,
+ # not the total colorbar:
+ _, extendlen = self._proportional_y()
+ bot = 0 - (extendlen[0] if self._extend_lower() else 0)
+ top = 1 + (extendlen[1] if self._extend_upper() else 0)
+
+ # xyout is the outline of the colorbar including the extend patches:
+ if not self.extendrect:
+ # triangle:
+ xyout = np.array([[0, 0], [0.5, bot], [1, 0],
+ [1, 1], [0.5, top], [0, 1], [0, 0]])
+ else:
+ # rectangle:
+ xyout = np.array([[0, 0], [0, bot], [1, bot], [1, 0],
+ [1, 1], [1, top], [0, top], [0, 1],
+ [0, 0]])
+
+ if self.orientation == 'horizontal':
+ xyout = xyout[:, ::-1]
+
+ # xyout is the path for the spine:
+ self.outline.set_xy(xyout)
+ if not self._filled:
+ return
+
+ # Make extend triangles or rectangles filled patches. These are
+ # defined in the outer parent axes' coordinates:
+ mappable = getattr(self, 'mappable', None)
+ if (isinstance(mappable, contour.ContourSet)
+ and any(hatch is not None for hatch in mappable.hatches)):
+ hatches = mappable.hatches * (len(self._y) + 1)
+ else:
+ hatches = [None] * (len(self._y) + 1)
+
+ if self._extend_lower():
+ if not self.extendrect:
+ # triangle
+ xy = np.array([[0, 0], [0.5, bot], [1, 0]])
+ else:
+ # rectangle
+ xy = np.array([[0, 0], [0, bot], [1., bot], [1, 0]])
+ if self.orientation == 'horizontal':
+ xy = xy[:, ::-1]
+ # add the patch
+ val = -1 if self.long_axis.get_inverted() else 0
+ color = self.cmap(self.norm(self._values[val]))
+ patch = mpatches.PathPatch(
+ mpath.Path(xy), facecolor=color, alpha=self.alpha,
+ linewidth=0, antialiased=False,
+ transform=self.ax.transAxes,
+ hatch=hatches[0], clip_on=False,
+ # Place it right behind the standard patches, which is
+ # needed if we updated the extends
+ zorder=np.nextafter(self.ax.patch.zorder, -np.inf))
+ self.ax.add_patch(patch)
+ self._extend_patches.append(patch)
+ # remove first hatch that goes into the extend patch
+ hatches = hatches[1:]
+ if self._extend_upper():
+ if not self.extendrect:
+ # triangle
+ xy = np.array([[0, 1], [0.5, top], [1, 1]])
+ else:
+ # rectangle
+ xy = np.array([[0, 1], [0, top], [1, top], [1, 1]])
+ if self.orientation == 'horizontal':
+ xy = xy[:, ::-1]
+ # add the patch
+ val = 0 if self.long_axis.get_inverted() else -1
+ color = self.cmap(self.norm(self._values[val]))
+ hatch_idx = len(self._y) - 1
+ patch = mpatches.PathPatch(
+ mpath.Path(xy), facecolor=color, alpha=self.alpha,
+ linewidth=0, antialiased=False,
+ transform=self.ax.transAxes, hatch=hatches[hatch_idx],
+ clip_on=False,
+ # Place it right behind the standard patches, which is
+ # needed if we updated the extends
+ zorder=np.nextafter(self.ax.patch.zorder, -np.inf))
+ self.ax.add_patch(patch)
+ self._extend_patches.append(patch)
+
+ self._update_dividers()
+
+ def add_lines(self, *args, **kwargs):
+ """
+ Draw lines on the colorbar.
+
+ The lines are appended to the list :attr:`lines`.
+
+ Parameters
+ ----------
+ levels : array-like
+ The positions of the lines.
+ colors : :mpltype:`color` or list of :mpltype:`color`
+ Either a single color applying to all lines or one color value for
+ each line.
+ linewidths : float or array-like
+ Either a single linewidth applying to all lines or one linewidth
+ for each line.
+ erase : bool, default: True
+ Whether to remove any previously added lines.
+
+ Notes
+ -----
+ Alternatively, this method can also be called with the signature
+ ``colorbar.add_lines(contour_set, erase=True)``, in which case
+ *levels*, *colors*, and *linewidths* are taken from *contour_set*.
+ """
+ params = _api.select_matching_signature(
+ [lambda self, CS, erase=True: locals(),
+ lambda self, levels, colors, linewidths, erase=True: locals()],
+ self, *args, **kwargs)
+ if "CS" in params:
+ self, cs, erase = params.values()
+ if not isinstance(cs, contour.ContourSet) or cs.filled:
+ raise ValueError("If a single artist is passed to add_lines, "
+ "it must be a ContourSet of lines")
+ # TODO: Make colorbar lines auto-follow changes in contour lines.
+ return self.add_lines(
+ cs.levels,
+ cs.to_rgba(cs.cvalues, cs.alpha),
+ cs.get_linewidths(),
+ erase=erase)
+ else:
+ self, levels, colors, linewidths, erase = params.values()
+
+ y = self._locate(levels)
+ rtol = (self._y[-1] - self._y[0]) * 1e-10
+ igood = (y < self._y[-1] + rtol) & (y > self._y[0] - rtol)
+ y = y[igood]
+ if np.iterable(colors):
+ colors = np.asarray(colors)[igood]
+ if np.iterable(linewidths):
+ linewidths = np.asarray(linewidths)[igood]
+ X, Y = np.meshgrid([0, 1], y)
+ if self.orientation == 'vertical':
+ xy = np.stack([X, Y], axis=-1)
+ else:
+ xy = np.stack([Y, X], axis=-1)
+ col = collections.LineCollection(xy, linewidths=linewidths,
+ colors=colors)
+
+ if erase and self.lines:
+ for lc in self.lines:
+ lc.remove()
+ self.lines = []
+ self.lines.append(col)
+
+ # make a clip path that is just a linewidth bigger than the Axes...
+ fac = np.max(linewidths) / 72
+ xy = np.array([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]])
+ inches = self.ax.get_figure().dpi_scale_trans
+ # do in inches:
+ xy = inches.inverted().transform(self.ax.transAxes.transform(xy))
+ xy[[0, 1, 4], 1] -= fac
+ xy[[2, 3], 1] += fac
+ # back to axes units...
+ xy = self.ax.transAxes.inverted().transform(inches.transform(xy))
+ col.set_clip_path(mpath.Path(xy, closed=True),
+ self.ax.transAxes)
+ self.ax.add_collection(col)
+ self.stale = True
+
+ def update_ticks(self):
+ """
+ Set up the ticks and ticklabels. This should not be needed by users.
+ """
+ # Get the locator and formatter; defaults to self._locator if not None.
+ self._get_ticker_locator_formatter()
+ self.long_axis.set_major_locator(self._locator)
+ self.long_axis.set_minor_locator(self._minorlocator)
+ self.long_axis.set_major_formatter(self._formatter)
+
+ def _get_ticker_locator_formatter(self):
+ """
+ Return the ``locator`` and ``formatter`` of the colorbar.
+
+ If they have not been defined (i.e. are *None*), the formatter and
+ locator are retrieved from the axis, or from the value of the
+ boundaries for a boundary norm.
+
+ Called by update_ticks...
+ """
+ locator = self._locator
+ formatter = self._formatter
+ minorlocator = self._minorlocator
+ if isinstance(self.norm, colors.BoundaryNorm):
+ b = self.norm.boundaries
+ if locator is None:
+ locator = ticker.FixedLocator(b, nbins=10)
+ if minorlocator is None:
+ minorlocator = ticker.FixedLocator(b)
+ elif isinstance(self.norm, colors.NoNorm):
+ if locator is None:
+ # put ticks on integers between the boundaries of NoNorm
+ nv = len(self._values)
+ base = 1 + int(nv / 10)
+ locator = ticker.IndexLocator(base=base, offset=.5)
+ elif self.boundaries is not None:
+ b = self._boundaries[self._inside]
+ if locator is None:
+ locator = ticker.FixedLocator(b, nbins=10)
+ else: # most cases:
+ if locator is None:
+ # we haven't set the locator explicitly, so use the default
+ # for this axis:
+ locator = self.long_axis.get_major_locator()
+ if minorlocator is None:
+ minorlocator = self.long_axis.get_minor_locator()
+
+ if minorlocator is None:
+ minorlocator = ticker.NullLocator()
+
+ if formatter is None:
+ formatter = self.long_axis.get_major_formatter()
+
+ self._locator = locator
+ self._formatter = formatter
+ self._minorlocator = minorlocator
+ _log.debug('locator: %r', locator)
+
+ def set_ticks(self, ticks, *, labels=None, minor=False, **kwargs):
+ """
+ Set tick locations.
+
+ Parameters
+ ----------
+ ticks : 1D array-like
+ List of tick locations.
+ labels : list of str, optional
+ List of tick labels. If not set, the labels show the data value.
+ minor : bool, default: False
+ If ``False``, set the major ticks; if ``True``, the minor ticks.
+ **kwargs
+ `.Text` properties for the labels. These take effect only if you
+ pass *labels*. In other cases, please use `~.Axes.tick_params`.
+ """
+ if np.iterable(ticks):
+ self.long_axis.set_ticks(ticks, labels=labels, minor=minor,
+ **kwargs)
+ self._locator = self.long_axis.get_major_locator()
+ else:
+ self._locator = ticks
+ self.long_axis.set_major_locator(self._locator)
+ self.stale = True
+
+ def get_ticks(self, minor=False):
+ """
+ Return the ticks as a list of locations.
+
+ Parameters
+ ----------
+ minor : boolean, default: False
+ if True return the minor ticks.
+ """
+ if minor:
+ return self.long_axis.get_minorticklocs()
+ else:
+ return self.long_axis.get_majorticklocs()
+
+ def set_ticklabels(self, ticklabels, *, minor=False, **kwargs):
+ """
+ [*Discouraged*] Set tick labels.
+
+ .. admonition:: Discouraged
+
+ The use of this method is discouraged, because of the dependency
+ on tick positions. In most cases, you'll want to use
+ ``set_ticks(positions, labels=labels)`` instead.
+
+ If you are using this method, you should always fix the tick
+ positions before, e.g. by using `.Colorbar.set_ticks` or by
+ explicitly setting a `~.ticker.FixedLocator` on the long axis
+ of the colorbar. Otherwise, ticks are free to move and the
+ labels may end up in unexpected positions.
+
+ Parameters
+ ----------
+ ticklabels : sequence of str or of `.Text`
+ Texts for labeling each tick location in the sequence set by
+ `.Colorbar.set_ticks`; the number of labels must match the number
+ of locations.
+
+ update_ticks : bool, default: True
+ This keyword argument is ignored and will be removed.
+ Deprecated
+
+ minor : bool
+ If True, set minor ticks instead of major ticks.
+
+ **kwargs
+ `.Text` properties for the labels.
+ """
+ self.long_axis.set_ticklabels(ticklabels, minor=minor, **kwargs)
+
+ def minorticks_on(self):
+ """
+ Turn on colorbar minor ticks.
+ """
+ self.ax.minorticks_on()
+ self._short_axis().set_minor_locator(ticker.NullLocator())
+
+ def minorticks_off(self):
+ """Turn the minor ticks of the colorbar off."""
+ self._minorlocator = ticker.NullLocator()
+ self.long_axis.set_minor_locator(self._minorlocator)
+
+ def set_label(self, label, *, loc=None, **kwargs):
+ """
+ Add a label to the long axis of the colorbar.
+
+ Parameters
+ ----------
+ label : str
+ The label text.
+ loc : str, optional
+ The location of the label.
+
+ - For horizontal orientation one of {'left', 'center', 'right'}
+ - For vertical orientation one of {'bottom', 'center', 'top'}
+
+ Defaults to :rc:`xaxis.labellocation` or :rc:`yaxis.labellocation`
+ depending on the orientation.
+ **kwargs
+ Keyword arguments are passed to `~.Axes.set_xlabel` /
+ `~.Axes.set_ylabel`.
+ Supported keywords are *labelpad* and `.Text` properties.
+ """
+ if self.orientation == "vertical":
+ self.ax.set_ylabel(label, loc=loc, **kwargs)
+ else:
+ self.ax.set_xlabel(label, loc=loc, **kwargs)
+ self.stale = True
+
+ def set_alpha(self, alpha):
+ """
+ Set the transparency between 0 (transparent) and 1 (opaque).
+
+ If an array is provided, *alpha* will be set to None to use the
+ transparency values associated with the colormap.
+ """
+ self.alpha = None if isinstance(alpha, np.ndarray) else alpha
+
+ def _set_scale(self, scale, **kwargs):
+ """
+ Set the colorbar long axis scale.
+
+ Parameters
+ ----------
+ scale : {"linear", "log", "symlog", "logit", ...} or `.ScaleBase`
+ The axis scale type to apply.
+
+ **kwargs
+ Different keyword arguments are accepted, depending on the scale.
+ See the respective class keyword arguments:
+
+ - `matplotlib.scale.LinearScale`
+ - `matplotlib.scale.LogScale`
+ - `matplotlib.scale.SymmetricalLogScale`
+ - `matplotlib.scale.LogitScale`
+ - `matplotlib.scale.FuncScale`
+ - `matplotlib.scale.AsinhScale`
+
+ Notes
+ -----
+ By default, Matplotlib supports the above-mentioned scales.
+ Additionally, custom scales may be registered using
+ `matplotlib.scale.register_scale`. These scales can then also
+ be used here.
+ """
+ self.long_axis._set_axes_scale(scale, **kwargs)
+
+ def remove(self):
+ """
+ Remove this colorbar from the figure.
+
+ If the colorbar was created with ``use_gridspec=True`` the previous
+ gridspec is restored.
+ """
+ if hasattr(self.ax, '_colorbar_info'):
+ parents = self.ax._colorbar_info['parents']
+ for a in parents:
+ if self.ax in a._colorbars:
+ a._colorbars.remove(self.ax)
+
+ self.ax.remove()
+
+ self.mappable.callbacks.disconnect(self.mappable.colorbar_cid)
+ self.mappable.colorbar = None
+ self.mappable.colorbar_cid = None
+ # Remove the extension callbacks
+ self.ax.callbacks.disconnect(self._extend_cid1)
+ self.ax.callbacks.disconnect(self._extend_cid2)
+
+ try:
+ ax = self.mappable.axes
+ except AttributeError:
+ return
+ try:
+ subplotspec = self.ax.get_subplotspec().get_gridspec()._subplot_spec
+ except AttributeError: # use_gridspec was False
+ pos = ax.get_position(original=True)
+ ax._set_position(pos)
+ else: # use_gridspec was True
+ ax.set_subplotspec(subplotspec)
+
+ def _process_values(self):
+ """
+ Set `_boundaries` and `_values` based on the self.boundaries and
+ self.values if not None, or based on the size of the colormap and
+ the vmin/vmax of the norm.
+ """
+ if self.values is not None:
+ # set self._boundaries from the values...
+ self._values = np.array(self.values)
+ if self.boundaries is None:
+ # bracket values by 1/2 dv:
+ b = np.zeros(len(self.values) + 1)
+ b[1:-1] = 0.5 * (self._values[:-1] + self._values[1:])
+ b[0] = 2.0 * b[1] - b[2]
+ b[-1] = 2.0 * b[-2] - b[-3]
+ self._boundaries = b
+ return
+ self._boundaries = np.array(self.boundaries)
+ return
+
+ # otherwise values are set from the boundaries
+ if isinstance(self.norm, colors.BoundaryNorm):
+ b = self.norm.boundaries
+ elif isinstance(self.norm, colors.NoNorm):
+ # NoNorm has N blocks, so N+1 boundaries, centered on integers:
+ b = np.arange(self.cmap.N + 1) - .5
+ elif self.boundaries is not None:
+ b = self.boundaries
+ else:
+ # otherwise make the boundaries from the size of the cmap:
+ N = self.cmap.N + 1
+ b, _ = self._uniform_y(N)
+ # add extra boundaries if needed:
+ if self._extend_lower():
+ b = np.hstack((b[0] - 1, b))
+ if self._extend_upper():
+ b = np.hstack((b, b[-1] + 1))
+
+ # transform from 0-1 to vmin-vmax:
+ if self.mappable.get_array() is not None:
+ self.mappable.autoscale_None()
+ if not self.norm.scaled():
+ # If we still aren't scaled after autoscaling, use 0, 1 as default
+ self.norm.vmin = 0
+ self.norm.vmax = 1
+ self.norm.vmin, self.norm.vmax = mtransforms.nonsingular(
+ self.norm.vmin, self.norm.vmax, expander=0.1)
+ if (not isinstance(self.norm, colors.BoundaryNorm) and
+ (self.boundaries is None)):
+ b = self.norm.inverse(b)
+
+ self._boundaries = np.asarray(b, dtype=float)
+ self._values = 0.5 * (self._boundaries[:-1] + self._boundaries[1:])
+ if isinstance(self.norm, colors.NoNorm):
+ self._values = (self._values + 0.00001).astype(np.int16)
+
+ def _mesh(self):
+ """
+ Return the coordinate arrays for the colorbar pcolormesh/patches.
+
+ These are scaled between vmin and vmax, and already handle colorbar
+ orientation.
+ """
+ y, _ = self._proportional_y()
+ # Use the vmin and vmax of the colorbar, which may not be the same
+ # as the norm. There are situations where the colormap has a
+ # narrower range than the colorbar and we want to accommodate the
+ # extra contours.
+ if (isinstance(self.norm, (colors.BoundaryNorm, colors.NoNorm))
+ or self.boundaries is not None):
+ # not using a norm.
+ y = y * (self.vmax - self.vmin) + self.vmin
+ else:
+ # Update the norm values in a context manager as it is only
+ # a temporary change and we don't want to propagate any signals
+ # attached to the norm (callbacks.blocked).
+ with (self.norm.callbacks.blocked(),
+ cbook._setattr_cm(self.norm, vmin=self.vmin, vmax=self.vmax)):
+ y = self.norm.inverse(y)
+ self._y = y
+ X, Y = np.meshgrid([0., 1.], y)
+ if self.orientation == 'vertical':
+ return (X, Y)
+ else:
+ return (Y, X)
+
+ def _forward_boundaries(self, x):
+ # map boundaries equally between 0 and 1...
+ b = self._boundaries
+ y = np.interp(x, b, np.linspace(0, 1, len(b)))
+ # the following avoids ticks in the extends:
+ eps = (b[-1] - b[0]) * 1e-6
+ # map these _well_ out of bounds to keep any ticks out
+ # of the extends region...
+ y[x < b[0]-eps] = -1
+ y[x > b[-1]+eps] = 2
+ return y
+
+ def _inverse_boundaries(self, x):
+ # invert the above...
+ b = self._boundaries
+ return np.interp(x, np.linspace(0, 1, len(b)), b)
+
+ def _reset_locator_formatter_scale(self):
+ """
+ Reset the locator et al to defaults. Any user-hardcoded changes
+ need to be re-entered if this gets called (either at init, or when
+ the mappable normal gets changed: Colorbar.update_normal)
+ """
+ self._process_values()
+ self._locator = None
+ self._minorlocator = None
+ self._formatter = None
+ self._minorformatter = None
+ if (isinstance(self.mappable, contour.ContourSet) and
+ isinstance(self.norm, colors.LogNorm)):
+ # if contours have lognorm, give them a log scale...
+ self._set_scale('log')
+ elif (self.boundaries is not None or
+ isinstance(self.norm, colors.BoundaryNorm)):
+ if self.spacing == 'uniform':
+ funcs = (self._forward_boundaries, self._inverse_boundaries)
+ self._set_scale('function', functions=funcs)
+ elif self.spacing == 'proportional':
+ self._set_scale('linear')
+ elif getattr(self.norm, '_scale', None):
+ # use the norm's scale (if it exists and is not None):
+ self._set_scale(self.norm._scale)
+ elif type(self.norm) is colors.Normalize:
+ # plain Normalize:
+ self._set_scale('linear')
+ else:
+ # norm._scale is None or not an attr: derive the scale from
+ # the Norm:
+ funcs = (self.norm, self.norm.inverse)
+ self._set_scale('function', functions=funcs)
+
+ def _locate(self, x):
+ """
+ Given a set of color data values, return their
+ corresponding colorbar data coordinates.
+ """
+ if isinstance(self.norm, (colors.NoNorm, colors.BoundaryNorm)):
+ b = self._boundaries
+ xn = x
+ else:
+ # Do calculations using normalized coordinates so
+ # as to make the interpolation more accurate.
+ b = self.norm(self._boundaries, clip=False).filled()
+ xn = self.norm(x, clip=False).filled()
+
+ bunique = b[self._inside]
+ yunique = self._y
+
+ z = np.interp(xn, bunique, yunique)
+ return z
+
+ # trivial helpers
+
+ def _uniform_y(self, N):
+ """
+ Return colorbar data coordinates for *N* uniformly
+ spaced boundaries, plus extension lengths if required.
+ """
+ automin = automax = 1. / (N - 1.)
+ extendlength = self._get_extension_lengths(self.extendfrac,
+ automin, automax,
+ default=0.05)
+ y = np.linspace(0, 1, N)
+ return y, extendlength
+
+ def _proportional_y(self):
+ """
+ Return colorbar data coordinates for the boundaries of
+ a proportional colorbar, plus extension lengths if required:
+ """
+ if (isinstance(self.norm, colors.BoundaryNorm) or
+ self.boundaries is not None):
+ y = (self._boundaries - self._boundaries[self._inside][0])
+ y = y / (self._boundaries[self._inside][-1] -
+ self._boundaries[self._inside][0])
+ # need yscaled the same as the axes scale to get
+ # the extend lengths.
+ if self.spacing == 'uniform':
+ yscaled = self._forward_boundaries(self._boundaries)
+ else:
+ yscaled = y
+ else:
+ y = self.norm(self._boundaries.copy())
+ y = np.ma.filled(y, np.nan)
+ # the norm and the scale should be the same...
+ yscaled = y
+ y = y[self._inside]
+ yscaled = yscaled[self._inside]
+ # normalize from 0..1:
+ norm = colors.Normalize(y[0], y[-1])
+ y = np.ma.filled(norm(y), np.nan)
+ norm = colors.Normalize(yscaled[0], yscaled[-1])
+ yscaled = np.ma.filled(norm(yscaled), np.nan)
+ # make the lower and upper extend lengths proportional to the lengths
+ # of the first and last boundary spacing (if extendfrac='auto'):
+ automin = yscaled[1] - yscaled[0]
+ automax = yscaled[-1] - yscaled[-2]
+ extendlength = [0, 0]
+ if self._extend_lower() or self._extend_upper():
+ extendlength = self._get_extension_lengths(
+ self.extendfrac, automin, automax, default=0.05)
+ return y, extendlength
+
+ def _get_extension_lengths(self, frac, automin, automax, default=0.05):
+ """
+ Return the lengths of colorbar extensions.
+
+ This is a helper method for _uniform_y and _proportional_y.
+ """
+ # Set the default value.
+ extendlength = np.array([default, default])
+ if isinstance(frac, str):
+ _api.check_in_list(['auto'], extendfrac=frac.lower())
+ # Use the provided values when 'auto' is required.
+ extendlength[:] = [automin, automax]
+ elif frac is not None:
+ try:
+ # Try to set min and max extension fractions directly.
+ extendlength[:] = frac
+ # If frac is a sequence containing None then NaN may
+ # be encountered. This is an error.
+ if np.isnan(extendlength).any():
+ raise ValueError()
+ except (TypeError, ValueError) as err:
+ # Raise an error on encountering an invalid value for frac.
+ raise ValueError('invalid value for extendfrac') from err
+ return extendlength
+
+ def _extend_lower(self):
+ """Return whether the lower limit is open ended."""
+ minmax = "max" if self.long_axis.get_inverted() else "min"
+ return self.extend in ('both', minmax)
+
+ def _extend_upper(self):
+ """Return whether the upper limit is open ended."""
+ minmax = "min" if self.long_axis.get_inverted() else "max"
+ return self.extend in ('both', minmax)
+
+ def _short_axis(self):
+ """Return the short axis"""
+ if self.orientation == 'vertical':
+ return self.ax.xaxis
+ return self.ax.yaxis
+
+ def _get_view(self):
+ # docstring inherited
+ # An interactive view for a colorbar is the norm's vmin/vmax
+ return self.norm.vmin, self.norm.vmax
+
+ def _set_view(self, view):
+ # docstring inherited
+ # An interactive view for a colorbar is the norm's vmin/vmax
+ self.norm.vmin, self.norm.vmax = view
+
+ def _set_view_from_bbox(self, bbox, direction='in',
+ mode=None, twinx=False, twiny=False):
+ # docstring inherited
+ # For colorbars, we use the zoom bbox to scale the norm's vmin/vmax
+ new_xbound, new_ybound = self.ax._prepare_view_from_bbox(
+ bbox, direction=direction, mode=mode, twinx=twinx, twiny=twiny)
+ if self.orientation == 'horizontal':
+ self.norm.vmin, self.norm.vmax = new_xbound
+ elif self.orientation == 'vertical':
+ self.norm.vmin, self.norm.vmax = new_ybound
+
+ def drag_pan(self, button, key, x, y):
+ # docstring inherited
+ points = self.ax._get_pan_points(button, key, x, y)
+ if points is not None:
+ if self.orientation == 'horizontal':
+ self.norm.vmin, self.norm.vmax = points[:, 0]
+ elif self.orientation == 'vertical':
+ self.norm.vmin, self.norm.vmax = points[:, 1]
+
+
+ColorbarBase = Colorbar # Backcompat API
+
+
+def _normalize_location_orientation(location, orientation):
+ if location is None:
+ location = _get_ticklocation_from_orientation(orientation)
+ loc_settings = _api.check_getitem({
+ "left": {"location": "left", "anchor": (1.0, 0.5),
+ "panchor": (0.0, 0.5), "pad": 0.10},
+ "right": {"location": "right", "anchor": (0.0, 0.5),
+ "panchor": (1.0, 0.5), "pad": 0.05},
+ "top": {"location": "top", "anchor": (0.5, 0.0),
+ "panchor": (0.5, 1.0), "pad": 0.05},
+ "bottom": {"location": "bottom", "anchor": (0.5, 1.0),
+ "panchor": (0.5, 0.0), "pad": 0.15},
+ }, location=location)
+ loc_settings["orientation"] = _get_orientation_from_location(location)
+ if orientation is not None and orientation != loc_settings["orientation"]:
+ # Allow the user to pass both if they are consistent.
+ raise TypeError("location and orientation are mutually exclusive")
+ return loc_settings
+
+
+def _get_orientation_from_location(location):
+ return _api.check_getitem(
+ {None: None, "left": "vertical", "right": "vertical",
+ "top": "horizontal", "bottom": "horizontal"}, location=location)
+
+
+def _get_ticklocation_from_orientation(orientation):
+ return _api.check_getitem(
+ {None: "right", "vertical": "right", "horizontal": "bottom"},
+ orientation=orientation)
+
+
+@_docstring.interpd
+def make_axes(parents, location=None, orientation=None, fraction=0.15,
+ shrink=1.0, aspect=20, **kwargs):
+ """
+ Create an `~.axes.Axes` suitable for a colorbar.
+
+ The Axes is placed in the figure of the *parents* Axes, by resizing and
+ repositioning *parents*.
+
+ Parameters
+ ----------
+ parents : `~matplotlib.axes.Axes` or iterable or `numpy.ndarray` of `~.axes.Axes`
+ The Axes to use as parents for placing the colorbar.
+ %(_make_axes_kw_doc)s
+
+ Returns
+ -------
+ cax : `~matplotlib.axes.Axes`
+ The child Axes.
+ kwargs : dict
+ The reduced keyword dictionary to be passed when creating the colorbar
+ instance.
+ """
+ loc_settings = _normalize_location_orientation(location, orientation)
+ # put appropriate values into the kwargs dict for passing back to
+ # the Colorbar class
+ kwargs['orientation'] = loc_settings['orientation']
+ location = kwargs['ticklocation'] = loc_settings['location']
+
+ anchor = kwargs.pop('anchor', loc_settings['anchor'])
+ panchor = kwargs.pop('panchor', loc_settings['panchor'])
+ aspect0 = aspect
+ # turn parents into a list if it is not already. Note we cannot
+ # use .flatten or .ravel as these copy the references rather than
+ # reuse them, leading to a memory leak
+ if isinstance(parents, np.ndarray):
+ parents = list(parents.flat)
+ elif np.iterable(parents):
+ parents = list(parents)
+ else:
+ parents = [parents]
+
+ fig = parents[0].get_figure()
+
+ pad0 = 0.05 if fig.get_constrained_layout() else loc_settings['pad']
+ pad = kwargs.pop('pad', pad0)
+
+ if not all(fig is ax.get_figure() for ax in parents):
+ raise ValueError('Unable to create a colorbar Axes as not all '
+ 'parents share the same figure.')
+
+ # take a bounding box around all of the given Axes
+ parents_bbox = mtransforms.Bbox.union(
+ [ax.get_position(original=True).frozen() for ax in parents])
+
+ pb = parents_bbox
+ if location in ('left', 'right'):
+ if location == 'left':
+ pbcb, _, pb1 = pb.splitx(fraction, fraction + pad)
+ else:
+ pb1, _, pbcb = pb.splitx(1 - fraction - pad, 1 - fraction)
+ pbcb = pbcb.shrunk(1.0, shrink).anchored(anchor, pbcb)
+ else:
+ if location == 'bottom':
+ pbcb, _, pb1 = pb.splity(fraction, fraction + pad)
+ else:
+ pb1, _, pbcb = pb.splity(1 - fraction - pad, 1 - fraction)
+ pbcb = pbcb.shrunk(shrink, 1.0).anchored(anchor, pbcb)
+
+ # define the aspect ratio in terms of y's per x rather than x's per y
+ aspect = 1.0 / aspect
+
+ # define a transform which takes us from old axes coordinates to
+ # new axes coordinates
+ shrinking_trans = mtransforms.BboxTransform(parents_bbox, pb1)
+
+ # transform each of the Axes in parents using the new transform
+ for ax in parents:
+ new_posn = shrinking_trans.transform(ax.get_position(original=True))
+ new_posn = mtransforms.Bbox(new_posn)
+ ax._set_position(new_posn)
+ if panchor is not False:
+ ax.set_anchor(panchor)
+
+ cax = fig.add_axes(pbcb, label="")
+ for a in parents:
+ # tell the parent it has a colorbar
+ a._colorbars += [cax]
+ cax._colorbar_info = dict(
+ parents=parents,
+ location=location,
+ shrink=shrink,
+ anchor=anchor,
+ panchor=panchor,
+ fraction=fraction,
+ aspect=aspect0,
+ pad=pad)
+ # and we need to set the aspect ratio by hand...
+ cax.set_anchor(anchor)
+ cax.set_box_aspect(aspect)
+ cax.set_aspect('auto')
+
+ return cax, kwargs
+
+
+@_docstring.interpd
+def make_axes_gridspec(parent, *, location=None, orientation=None,
+ fraction=0.15, shrink=1.0, aspect=20, **kwargs):
+ """
+ Create an `~.axes.Axes` suitable for a colorbar.
+
+ The Axes is placed in the figure of the *parent* Axes, by resizing and
+ repositioning *parent*.
+
+ This function is similar to `.make_axes` and mostly compatible with it.
+ Primary differences are
+
+ - `.make_axes_gridspec` requires the *parent* to have a subplotspec.
+ - `.make_axes` positions the Axes in figure coordinates;
+ `.make_axes_gridspec` positions it using a subplotspec.
+ - `.make_axes` updates the position of the parent. `.make_axes_gridspec`
+ replaces the parent gridspec with a new one.
+
+ Parameters
+ ----------
+ parent : `~matplotlib.axes.Axes`
+ The Axes to use as parent for placing the colorbar.
+ %(_make_axes_kw_doc)s
+
+ Returns
+ -------
+ cax : `~matplotlib.axes.Axes`
+ The child Axes.
+ kwargs : dict
+ The reduced keyword dictionary to be passed when creating the colorbar
+ instance.
+ """
+
+ loc_settings = _normalize_location_orientation(location, orientation)
+ kwargs['orientation'] = loc_settings['orientation']
+ location = kwargs['ticklocation'] = loc_settings['location']
+
+ aspect0 = aspect
+ anchor = kwargs.pop('anchor', loc_settings['anchor'])
+ panchor = kwargs.pop('panchor', loc_settings['panchor'])
+ pad = kwargs.pop('pad', loc_settings["pad"])
+ wh_space = 2 * pad / (1 - pad)
+
+ if location in ('left', 'right'):
+ gs = parent.get_subplotspec().subgridspec(
+ 3, 2, wspace=wh_space, hspace=0,
+ height_ratios=[(1-anchor[1])*(1-shrink), shrink, anchor[1]*(1-shrink)])
+ if location == 'left':
+ gs.set_width_ratios([fraction, 1 - fraction - pad])
+ ss_main = gs[:, 1]
+ ss_cb = gs[1, 0]
+ else:
+ gs.set_width_ratios([1 - fraction - pad, fraction])
+ ss_main = gs[:, 0]
+ ss_cb = gs[1, 1]
+ else:
+ gs = parent.get_subplotspec().subgridspec(
+ 2, 3, hspace=wh_space, wspace=0,
+ width_ratios=[anchor[0]*(1-shrink), shrink, (1-anchor[0])*(1-shrink)])
+ if location == 'top':
+ gs.set_height_ratios([fraction, 1 - fraction - pad])
+ ss_main = gs[1, :]
+ ss_cb = gs[0, 1]
+ else:
+ gs.set_height_ratios([1 - fraction - pad, fraction])
+ ss_main = gs[0, :]
+ ss_cb = gs[1, 1]
+ aspect = 1 / aspect
+
+ parent.set_subplotspec(ss_main)
+ if panchor is not False:
+ parent.set_anchor(panchor)
+
+ fig = parent.get_figure()
+ cax = fig.add_subplot(ss_cb, label="")
+ cax.set_anchor(anchor)
+ cax.set_box_aspect(aspect)
+ cax.set_aspect('auto')
+ cax._colorbar_info = dict(
+ location=location,
+ parents=[parent],
+ shrink=shrink,
+ anchor=anchor,
+ panchor=panchor,
+ fraction=fraction,
+ aspect=aspect0,
+ pad=pad)
+
+ return cax, kwargs
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorbar.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorbar.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..07467ca74f3d5a528f8c1c0859fc25a2eb285664
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorbar.pyi
@@ -0,0 +1,139 @@
+import matplotlib.spines as mspines
+from matplotlib import cm, collections, colors, contour, colorizer
+from matplotlib.axes import Axes
+from matplotlib.axis import Axis
+from matplotlib.backend_bases import RendererBase
+from matplotlib.patches import Patch
+from matplotlib.ticker import Locator, Formatter
+from matplotlib.transforms import Bbox
+
+import numpy as np
+from numpy.typing import ArrayLike
+from collections.abc import Sequence
+from typing import Any, Literal, overload
+from .typing import ColorType
+
+class _ColorbarSpine(mspines.Spines):
+ def __init__(self, axes: Axes): ...
+ def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox:...
+ def set_xy(self, xy: ArrayLike) -> None: ...
+ def draw(self, renderer: RendererBase | None) -> None:...
+
+
+class Colorbar:
+ n_rasterize: int
+ mappable: cm.ScalarMappable | colorizer.ColorizingArtist
+ ax: Axes
+ alpha: float | None
+ cmap: colors.Colormap
+ norm: colors.Normalize
+ values: Sequence[float] | None
+ boundaries: Sequence[float] | None
+ extend: Literal["neither", "both", "min", "max"]
+ spacing: Literal["uniform", "proportional"]
+ orientation: Literal["vertical", "horizontal"]
+ drawedges: bool
+ extendfrac: Literal["auto"] | float | Sequence[float] | None
+ extendrect: bool
+ solids: None | collections.QuadMesh
+ solids_patches: list[Patch]
+ lines: list[collections.LineCollection]
+ outline: _ColorbarSpine
+ dividers: collections.LineCollection
+ ticklocation: Literal["left", "right", "top", "bottom"]
+ def __init__(
+ self,
+ ax: Axes,
+ mappable: cm.ScalarMappable | colorizer.ColorizingArtist | None = ...,
+ *,
+ cmap: str | colors.Colormap | None = ...,
+ norm: colors.Normalize | None = ...,
+ alpha: float | None = ...,
+ values: Sequence[float] | None = ...,
+ boundaries: Sequence[float] | None = ...,
+ orientation: Literal["vertical", "horizontal"] | None = ...,
+ ticklocation: Literal["auto", "left", "right", "top", "bottom"] = ...,
+ extend: Literal["neither", "both", "min", "max"] | None = ...,
+ spacing: Literal["uniform", "proportional"] = ...,
+ ticks: Sequence[float] | Locator | None = ...,
+ format: str | Formatter | None = ...,
+ drawedges: bool = ...,
+ extendfrac: Literal["auto"] | float | Sequence[float] | None = ...,
+ extendrect: bool = ...,
+ label: str = ...,
+ location: Literal["left", "right", "top", "bottom"] | None = ...
+ ) -> None: ...
+ @property
+ def long_axis(self) -> Axis: ...
+ @property
+ def locator(self) -> Locator: ...
+ @locator.setter
+ def locator(self, loc: Locator) -> None: ...
+ @property
+ def minorlocator(self) -> Locator: ...
+ @minorlocator.setter
+ def minorlocator(self, loc: Locator) -> None: ...
+ @property
+ def formatter(self) -> Formatter: ...
+ @formatter.setter
+ def formatter(self, fmt: Formatter) -> None: ...
+ @property
+ def minorformatter(self) -> Formatter: ...
+ @minorformatter.setter
+ def minorformatter(self, fmt: Formatter) -> None: ...
+ def update_normal(self, mappable: cm.ScalarMappable | None = ...) -> None: ...
+ @overload
+ def add_lines(self, CS: contour.ContourSet, erase: bool = ...) -> None: ...
+ @overload
+ def add_lines(
+ self,
+ levels: ArrayLike,
+ colors: ColorType | Sequence[ColorType],
+ linewidths: float | ArrayLike,
+ erase: bool = ...,
+ ) -> None: ...
+ def update_ticks(self) -> None: ...
+ def set_ticks(
+ self,
+ ticks: Sequence[float] | Locator,
+ *,
+ labels: Sequence[str] | None = ...,
+ minor: bool = ...,
+ **kwargs
+ ) -> None: ...
+ def get_ticks(self, minor: bool = ...) -> np.ndarray: ...
+ def set_ticklabels(
+ self,
+ ticklabels: Sequence[str],
+ *,
+ minor: bool = ...,
+ **kwargs
+ ) -> None: ...
+ def minorticks_on(self) -> None: ...
+ def minorticks_off(self) -> None: ...
+ def set_label(self, label: str, *, loc: str | None = ..., **kwargs) -> None: ...
+ def set_alpha(self, alpha: float | np.ndarray) -> None: ...
+ def remove(self) -> None: ...
+ def drag_pan(self, button: Any, key: Any, x: float, y: float) -> None: ...
+
+ColorbarBase = Colorbar
+
+def make_axes(
+ parents: Axes | list[Axes] | np.ndarray,
+ location: Literal["left", "right", "top", "bottom"] | None = ...,
+ orientation: Literal["vertical", "horizontal"] | None = ...,
+ fraction: float = ...,
+ shrink: float = ...,
+ aspect: float = ...,
+ **kwargs
+) -> tuple[Axes, dict[str, Any]]: ...
+def make_axes_gridspec(
+ parent: Axes,
+ *,
+ location: Literal["left", "right", "top", "bottom"] | None = ...,
+ orientation: Literal["vertical", "horizontal"] | None = ...,
+ fraction: float = ...,
+ shrink: float = ...,
+ aspect: float = ...,
+ **kwargs
+) -> tuple[Axes, dict[str, Any]]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorizer.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorizer.py
new file mode 100644
index 0000000000000000000000000000000000000000..b4223f38980410c1929d598265cd3dab1c3cfcad
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorizer.py
@@ -0,0 +1,703 @@
+"""
+The Colorizer class which handles the data to color pipeline via a
+normalization and a colormap.
+
+.. admonition:: Provisional status of colorizer
+
+ The ``colorizer`` module and classes in this file are considered
+ provisional and may change at any time without a deprecation period.
+
+.. seealso::
+
+ :doc:`/gallery/color/colormap_reference` for a list of builtin colormaps.
+
+ :ref:`colormap-manipulation` for examples of how to make colormaps.
+
+ :ref:`colormaps` for an in-depth discussion of choosing colormaps.
+
+ :ref:`colormapnorms` for more details about data normalization.
+
+"""
+
+import functools
+
+import numpy as np
+from numpy import ma
+
+from matplotlib import _api, colors, cbook, scale, artist
+import matplotlib as mpl
+
+mpl._docstring.interpd.register(
+ colorizer_doc="""\
+colorizer : `~matplotlib.colorizer.Colorizer` or None, default: None
+ The Colorizer object used to map color to data. If None, a Colorizer
+ object is created from a *norm* and *cmap*.""",
+ )
+
+
+class Colorizer:
+ """
+ Data to color pipeline.
+
+ This pipeline is accessible via `.Colorizer.to_rgba` and executed via
+ the `.Colorizer.norm` and `.Colorizer.cmap` attributes.
+
+ Parameters
+ ----------
+ cmap: colorbar.Colorbar or str or None, default: None
+ The colormap used to color data.
+
+ norm: colors.Normalize or str or None, default: None
+ The normalization used to normalize the data
+ """
+ def __init__(self, cmap=None, norm=None):
+
+ self._cmap = None
+ self._set_cmap(cmap)
+
+ self._id_norm = None
+ self._norm = None
+ self.norm = norm
+
+ self.callbacks = cbook.CallbackRegistry(signals=["changed"])
+ self.colorbar = None
+
+ def _scale_norm(self, norm, vmin, vmax, A):
+ """
+ Helper for initial scaling.
+
+ Used by public functions that create a ScalarMappable and support
+ parameters *vmin*, *vmax* and *norm*. This makes sure that a *norm*
+ will take precedence over *vmin*, *vmax*.
+
+ Note that this method does not set the norm.
+ """
+ if vmin is not None or vmax is not None:
+ self.set_clim(vmin, vmax)
+ if isinstance(norm, colors.Normalize):
+ raise ValueError(
+ "Passing a Normalize instance simultaneously with "
+ "vmin/vmax is not supported. Please pass vmin/vmax "
+ "directly to the norm when creating it.")
+
+ # always resolve the autoscaling so we have concrete limits
+ # rather than deferring to draw time.
+ self.autoscale_None(A)
+
+ @property
+ def norm(self):
+ return self._norm
+
+ @norm.setter
+ def norm(self, norm):
+ _api.check_isinstance((colors.Normalize, str, None), norm=norm)
+ if norm is None:
+ norm = colors.Normalize()
+ elif isinstance(norm, str):
+ try:
+ scale_cls = scale._scale_mapping[norm]
+ except KeyError:
+ raise ValueError(
+ "Invalid norm str name; the following values are "
+ f"supported: {', '.join(scale._scale_mapping)}"
+ ) from None
+ norm = _auto_norm_from_scale(scale_cls)()
+
+ if norm is self.norm:
+ # We aren't updating anything
+ return
+
+ in_init = self.norm is None
+ # Remove the current callback and connect to the new one
+ if not in_init:
+ self.norm.callbacks.disconnect(self._id_norm)
+ self._norm = norm
+ self._id_norm = self.norm.callbacks.connect('changed',
+ self.changed)
+ if not in_init:
+ self.changed()
+
+ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
+ """
+ Return a normalized RGBA array corresponding to *x*.
+
+ In the normal case, *x* is a 1D or 2D sequence of scalars, and
+ the corresponding `~numpy.ndarray` of RGBA values will be returned,
+ based on the norm and colormap set for this Colorizer.
+
+ There is one special case, for handling images that are already
+ RGB or RGBA, such as might have been read from an image file.
+ If *x* is an `~numpy.ndarray` with 3 dimensions,
+ and the last dimension is either 3 or 4, then it will be
+ treated as an RGB or RGBA array, and no mapping will be done.
+ The array can be `~numpy.uint8`, or it can be floats with
+ values in the 0-1 range; otherwise a ValueError will be raised.
+ Any NaNs or masked elements will be set to 0 alpha.
+ If the last dimension is 3, the *alpha* kwarg (defaulting to 1)
+ will be used to fill in the transparency. If the last dimension
+ is 4, the *alpha* kwarg is ignored; it does not
+ replace the preexisting alpha. A ValueError will be raised
+ if the third dimension is other than 3 or 4.
+
+ In either case, if *bytes* is *False* (default), the RGBA
+ array will be floats in the 0-1 range; if it is *True*,
+ the returned RGBA array will be `~numpy.uint8` in the 0 to 255 range.
+
+ If norm is False, no normalization of the input data is
+ performed, and it is assumed to be in the range (0-1).
+
+ """
+ # First check for special case, image input:
+ if isinstance(x, np.ndarray) and x.ndim == 3:
+ return self._pass_image_data(x, alpha, bytes, norm)
+
+ # Otherwise run norm -> colormap pipeline
+ x = ma.asarray(x)
+ if norm:
+ x = self.norm(x)
+ rgba = self.cmap(x, alpha=alpha, bytes=bytes)
+ return rgba
+
+ @staticmethod
+ def _pass_image_data(x, alpha=None, bytes=False, norm=True):
+ """
+ Helper function to pass ndarray of shape (...,3) or (..., 4)
+ through `to_rgba()`, see `to_rgba()` for docstring.
+ """
+ if x.shape[2] == 3:
+ if alpha is None:
+ alpha = 1
+ if x.dtype == np.uint8:
+ alpha = np.uint8(alpha * 255)
+ m, n = x.shape[:2]
+ xx = np.empty(shape=(m, n, 4), dtype=x.dtype)
+ xx[:, :, :3] = x
+ xx[:, :, 3] = alpha
+ elif x.shape[2] == 4:
+ xx = x
+ else:
+ raise ValueError("Third dimension must be 3 or 4")
+ if xx.dtype.kind == 'f':
+ # If any of R, G, B, or A is nan, set to 0
+ if np.any(nans := np.isnan(x)):
+ if x.shape[2] == 4:
+ xx = xx.copy()
+ xx[np.any(nans, axis=2), :] = 0
+
+ if norm and (xx.max() > 1 or xx.min() < 0):
+ raise ValueError("Floating point image RGB values "
+ "must be in the 0..1 range.")
+ if bytes:
+ xx = (xx * 255).astype(np.uint8)
+ elif xx.dtype == np.uint8:
+ if not bytes:
+ xx = xx.astype(np.float32) / 255
+ else:
+ raise ValueError("Image RGB array must be uint8 or "
+ "floating point; found %s" % xx.dtype)
+ # Account for any masked entries in the original array
+ # If any of R, G, B, or A are masked for an entry, we set alpha to 0
+ if np.ma.is_masked(x):
+ xx[np.any(np.ma.getmaskarray(x), axis=2), 3] = 0
+ return xx
+
+ def autoscale(self, A):
+ """
+ Autoscale the scalar limits on the norm instance using the
+ current array
+ """
+ if A is None:
+ raise TypeError('You must first set_array for mappable')
+ # If the norm's limits are updated self.changed() will be called
+ # through the callbacks attached to the norm
+ self.norm.autoscale(A)
+
+ def autoscale_None(self, A):
+ """
+ Autoscale the scalar limits on the norm instance using the
+ current array, changing only limits that are None
+ """
+ if A is None:
+ raise TypeError('You must first set_array for mappable')
+ # If the norm's limits are updated self.changed() will be called
+ # through the callbacks attached to the norm
+ self.norm.autoscale_None(A)
+
+ def _set_cmap(self, cmap):
+ """
+ Set the colormap for luminance data.
+
+ Parameters
+ ----------
+ cmap : `.Colormap` or str or None
+ """
+ # bury import to avoid circular imports
+ from matplotlib import cm
+ in_init = self._cmap is None
+ self._cmap = cm._ensure_cmap(cmap)
+ if not in_init:
+ self.changed() # Things are not set up properly yet.
+
+ @property
+ def cmap(self):
+ return self._cmap
+
+ @cmap.setter
+ def cmap(self, cmap):
+ self._set_cmap(cmap)
+
+ def set_clim(self, vmin=None, vmax=None):
+ """
+ Set the norm limits for image scaling.
+
+ Parameters
+ ----------
+ vmin, vmax : float
+ The limits.
+
+ The limits may also be passed as a tuple (*vmin*, *vmax*) as a
+ single positional argument.
+
+ .. ACCEPTS: (vmin: float, vmax: float)
+ """
+ # If the norm's limits are updated self.changed() will be called
+ # through the callbacks attached to the norm, this causes an inconsistent
+ # state, to prevent this blocked context manager is used
+ if vmax is None:
+ try:
+ vmin, vmax = vmin
+ except (TypeError, ValueError):
+ pass
+
+ orig_vmin_vmax = self.norm.vmin, self.norm.vmax
+
+ # Blocked context manager prevents callbacks from being triggered
+ # until both vmin and vmax are updated
+ with self.norm.callbacks.blocked(signal='changed'):
+ if vmin is not None:
+ self.norm.vmin = colors._sanitize_extrema(vmin)
+ if vmax is not None:
+ self.norm.vmax = colors._sanitize_extrema(vmax)
+
+ # emit a update signal if the limits are changed
+ if orig_vmin_vmax != (self.norm.vmin, self.norm.vmax):
+ self.norm.callbacks.process('changed')
+
+ def get_clim(self):
+ """
+ Return the values (min, max) that are mapped to the colormap limits.
+ """
+ return self.norm.vmin, self.norm.vmax
+
+ def changed(self):
+ """
+ Call this whenever the mappable is changed to notify all the
+ callbackSM listeners to the 'changed' signal.
+ """
+ self.callbacks.process('changed')
+ self.stale = True
+
+ @property
+ def vmin(self):
+ return self.get_clim()[0]
+
+ @vmin.setter
+ def vmin(self, vmin):
+ self.set_clim(vmin=vmin)
+
+ @property
+ def vmax(self):
+ return self.get_clim()[1]
+
+ @vmax.setter
+ def vmax(self, vmax):
+ self.set_clim(vmax=vmax)
+
+ @property
+ def clip(self):
+ return self.norm.clip
+
+ @clip.setter
+ def clip(self, clip):
+ self.norm.clip = clip
+
+
+class _ColorizerInterface:
+ """
+ Base class that contains the interface to `Colorizer` objects from
+ a `ColorizingArtist` or `.cm.ScalarMappable`.
+
+ Note: This class only contain functions that interface the .colorizer
+ attribute. Other functions that as shared between `.ColorizingArtist`
+ and `.cm.ScalarMappable` are not included.
+ """
+ def _scale_norm(self, norm, vmin, vmax):
+ self._colorizer._scale_norm(norm, vmin, vmax, self._A)
+
+ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
+ """
+ Return a normalized RGBA array corresponding to *x*.
+
+ In the normal case, *x* is a 1D or 2D sequence of scalars, and
+ the corresponding `~numpy.ndarray` of RGBA values will be returned,
+ based on the norm and colormap set for this Colorizer.
+
+ There is one special case, for handling images that are already
+ RGB or RGBA, such as might have been read from an image file.
+ If *x* is an `~numpy.ndarray` with 3 dimensions,
+ and the last dimension is either 3 or 4, then it will be
+ treated as an RGB or RGBA array, and no mapping will be done.
+ The array can be `~numpy.uint8`, or it can be floats with
+ values in the 0-1 range; otherwise a ValueError will be raised.
+ Any NaNs or masked elements will be set to 0 alpha.
+ If the last dimension is 3, the *alpha* kwarg (defaulting to 1)
+ will be used to fill in the transparency. If the last dimension
+ is 4, the *alpha* kwarg is ignored; it does not
+ replace the preexisting alpha. A ValueError will be raised
+ if the third dimension is other than 3 or 4.
+
+ In either case, if *bytes* is *False* (default), the RGBA
+ array will be floats in the 0-1 range; if it is *True*,
+ the returned RGBA array will be `~numpy.uint8` in the 0 to 255 range.
+
+ If norm is False, no normalization of the input data is
+ performed, and it is assumed to be in the range (0-1).
+
+ """
+ return self._colorizer.to_rgba(x, alpha=alpha, bytes=bytes, norm=norm)
+
+ def get_clim(self):
+ """
+ Return the values (min, max) that are mapped to the colormap limits.
+ """
+ return self._colorizer.get_clim()
+
+ def set_clim(self, vmin=None, vmax=None):
+ """
+ Set the norm limits for image scaling.
+
+ Parameters
+ ----------
+ vmin, vmax : float
+ The limits.
+
+ For scalar data, the limits may also be passed as a
+ tuple (*vmin*, *vmax*) as a single positional argument.
+
+ .. ACCEPTS: (vmin: float, vmax: float)
+ """
+ # If the norm's limits are updated self.changed() will be called
+ # through the callbacks attached to the norm
+ self._colorizer.set_clim(vmin, vmax)
+
+ def get_alpha(self):
+ try:
+ return super().get_alpha()
+ except AttributeError:
+ return 1
+
+ @property
+ def cmap(self):
+ return self._colorizer.cmap
+
+ @cmap.setter
+ def cmap(self, cmap):
+ self._colorizer.cmap = cmap
+
+ def get_cmap(self):
+ """Return the `.Colormap` instance."""
+ return self._colorizer.cmap
+
+ def set_cmap(self, cmap):
+ """
+ Set the colormap for luminance data.
+
+ Parameters
+ ----------
+ cmap : `.Colormap` or str or None
+ """
+ self.cmap = cmap
+
+ @property
+ def norm(self):
+ return self._colorizer.norm
+
+ @norm.setter
+ def norm(self, norm):
+ self._colorizer.norm = norm
+
+ def set_norm(self, norm):
+ """
+ Set the normalization instance.
+
+ Parameters
+ ----------
+ norm : `.Normalize` or str or None
+
+ Notes
+ -----
+ If there are any colorbars using the mappable for this norm, setting
+ the norm of the mappable will reset the norm, locator, and formatters
+ on the colorbar to default.
+ """
+ self.norm = norm
+
+ def autoscale(self):
+ """
+ Autoscale the scalar limits on the norm instance using the
+ current array
+ """
+ self._colorizer.autoscale(self._A)
+
+ def autoscale_None(self):
+ """
+ Autoscale the scalar limits on the norm instance using the
+ current array, changing only limits that are None
+ """
+ self._colorizer.autoscale_None(self._A)
+
+ @property
+ def colorbar(self):
+ """
+ The last colorbar associated with this object. May be None
+ """
+ return self._colorizer.colorbar
+
+ @colorbar.setter
+ def colorbar(self, colorbar):
+ self._colorizer.colorbar = colorbar
+
+ def _format_cursor_data_override(self, data):
+ # This function overwrites Artist.format_cursor_data(). We cannot
+ # implement cm.ScalarMappable.format_cursor_data() directly, because
+ # most cm.ScalarMappable subclasses inherit from Artist first and from
+ # cm.ScalarMappable second, so Artist.format_cursor_data would always
+ # have precedence over cm.ScalarMappable.format_cursor_data.
+
+ # Note if cm.ScalarMappable is depreciated, this functionality should be
+ # implemented as format_cursor_data() on ColorizingArtist.
+ n = self.cmap.N
+ if np.ma.getmask(data):
+ return "[]"
+ normed = self.norm(data)
+ if np.isfinite(normed):
+ if isinstance(self.norm, colors.BoundaryNorm):
+ # not an invertible normalization mapping
+ cur_idx = np.argmin(np.abs(self.norm.boundaries - data))
+ neigh_idx = max(0, cur_idx - 1)
+ # use max diff to prevent delta == 0
+ delta = np.diff(
+ self.norm.boundaries[neigh_idx:cur_idx + 2]
+ ).max()
+ elif self.norm.vmin == self.norm.vmax:
+ # singular norms, use delta of 10% of only value
+ delta = np.abs(self.norm.vmin * .1)
+ else:
+ # Midpoints of neighboring color intervals.
+ neighbors = self.norm.inverse(
+ (int(normed * n) + np.array([0, 1])) / n)
+ delta = abs(neighbors - data).max()
+ g_sig_digits = cbook._g_sig_digits(data, delta)
+ else:
+ g_sig_digits = 3 # Consistent with default below.
+ return f"[{data:-#.{g_sig_digits}g}]"
+
+
+class _ScalarMappable(_ColorizerInterface):
+ """
+ A mixin class to map one or multiple sets of scalar data to RGBA.
+
+ The ScalarMappable applies data normalization before returning RGBA colors from
+ the given `~matplotlib.colors.Colormap`.
+ """
+
+ # _ScalarMappable exists for compatibility with
+ # code written before the introduction of the Colorizer
+ # and ColorizingArtist classes.
+
+ # _ScalarMappable can be depreciated so that ColorizingArtist
+ # inherits directly from _ColorizerInterface.
+ # in this case, the following changes should occur:
+ # __init__() has its functionality moved to ColorizingArtist.
+ # set_array(), get_array(), _get_colorizer() and
+ # _check_exclusionary_keywords() are moved to ColorizingArtist.
+ # changed() can be removed so long as colorbar.Colorbar
+ # is changed to connect to the colorizer instead of the
+ # ScalarMappable/ColorizingArtist,
+ # otherwise changed() can be moved to ColorizingArtist.
+ def __init__(self, norm=None, cmap=None, *, colorizer=None, **kwargs):
+ """
+ Parameters
+ ----------
+ norm : `.Normalize` (or subclass thereof) or str or None
+ The normalizing object which scales data, typically into the
+ interval ``[0, 1]``.
+ If a `str`, a `.Normalize` subclass is dynamically generated based
+ on the scale with the corresponding name.
+ If *None*, *norm* defaults to a *colors.Normalize* object which
+ initializes its scaling based on the first data processed.
+ cmap : str or `~matplotlib.colors.Colormap`
+ The colormap used to map normalized data values to RGBA colors.
+ """
+ super().__init__(**kwargs)
+ self._A = None
+ self._colorizer = self._get_colorizer(colorizer=colorizer, norm=norm, cmap=cmap)
+
+ self.colorbar = None
+ self._id_colorizer = self._colorizer.callbacks.connect('changed', self.changed)
+ self.callbacks = cbook.CallbackRegistry(signals=["changed"])
+
+ def set_array(self, A):
+ """
+ Set the value array from array-like *A*.
+
+ Parameters
+ ----------
+ A : array-like or None
+ The values that are mapped to colors.
+
+ The base class `.ScalarMappable` does not make any assumptions on
+ the dimensionality and shape of the value array *A*.
+ """
+ if A is None:
+ self._A = None
+ return
+
+ A = cbook.safe_masked_invalid(A, copy=True)
+ if not np.can_cast(A.dtype, float, "same_kind"):
+ raise TypeError(f"Image data of dtype {A.dtype} cannot be "
+ "converted to float")
+
+ self._A = A
+ if not self.norm.scaled():
+ self._colorizer.autoscale_None(A)
+
+ def get_array(self):
+ """
+ Return the array of values, that are mapped to colors.
+
+ The base class `.ScalarMappable` does not make any assumptions on
+ the dimensionality and shape of the array.
+ """
+ return self._A
+
+ def changed(self):
+ """
+ Call this whenever the mappable is changed to notify all the
+ callbackSM listeners to the 'changed' signal.
+ """
+ self.callbacks.process('changed', self)
+ self.stale = True
+
+ @staticmethod
+ def _check_exclusionary_keywords(colorizer, **kwargs):
+ """
+ Raises a ValueError if any kwarg is not None while colorizer is not None
+ """
+ if colorizer is not None:
+ if any([val is not None for val in kwargs.values()]):
+ raise ValueError("The `colorizer` keyword cannot be used simultaneously"
+ " with any of the following keywords: "
+ + ", ".join(f'`{key}`' for key in kwargs.keys()))
+
+ @staticmethod
+ def _get_colorizer(cmap, norm, colorizer):
+ if isinstance(colorizer, Colorizer):
+ _ScalarMappable._check_exclusionary_keywords(
+ Colorizer, cmap=cmap, norm=norm
+ )
+ return colorizer
+ return Colorizer(cmap, norm)
+
+# The docstrings here must be generic enough to apply to all relevant methods.
+mpl._docstring.interpd.register(
+ cmap_doc="""\
+cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
+ The Colormap instance or registered colormap name used to map scalar data
+ to colors.""",
+ norm_doc="""\
+norm : str or `~matplotlib.colors.Normalize`, optional
+ The normalization method used to scale scalar data to the [0, 1] range
+ before mapping to colors using *cmap*. By default, a linear scaling is
+ used, mapping the lowest value to 0 and the highest to 1.
+
+ If given, this can be one of the following:
+
+ - An instance of `.Normalize` or one of its subclasses
+ (see :ref:`colormapnorms`).
+ - A scale name, i.e. one of "linear", "log", "symlog", "logit", etc. For a
+ list of available scales, call `matplotlib.scale.get_scale_names()`.
+ In that case, a suitable `.Normalize` subclass is dynamically generated
+ and instantiated.""",
+ vmin_vmax_doc="""\
+vmin, vmax : float, optional
+ When using scalar data and no explicit *norm*, *vmin* and *vmax* define
+ the data range that the colormap covers. By default, the colormap covers
+ the complete value range of the supplied data. It is an error to use
+ *vmin*/*vmax* when a *norm* instance is given (but using a `str` *norm*
+ name together with *vmin*/*vmax* is acceptable).""",
+)
+
+
+class ColorizingArtist(_ScalarMappable, artist.Artist):
+ """
+ Base class for artists that make map data to color using a `.colorizer.Colorizer`.
+
+ The `.colorizer.Colorizer` applies data normalization before
+ returning RGBA colors from a `~matplotlib.colors.Colormap`.
+
+ """
+ def __init__(self, colorizer, **kwargs):
+ """
+ Parameters
+ ----------
+ colorizer : `.colorizer.Colorizer`
+ """
+ _api.check_isinstance(Colorizer, colorizer=colorizer)
+ super().__init__(colorizer=colorizer, **kwargs)
+
+ @property
+ def colorizer(self):
+ return self._colorizer
+
+ @colorizer.setter
+ def colorizer(self, cl):
+ _api.check_isinstance(Colorizer, colorizer=cl)
+ self._colorizer.callbacks.disconnect(self._id_colorizer)
+ self._colorizer = cl
+ self._id_colorizer = cl.callbacks.connect('changed', self.changed)
+
+ def _set_colorizer_check_keywords(self, colorizer, **kwargs):
+ """
+ Raises a ValueError if any kwarg is not None while colorizer is not None.
+ """
+ self._check_exclusionary_keywords(colorizer, **kwargs)
+ self.colorizer = colorizer
+
+
+def _auto_norm_from_scale(scale_cls):
+ """
+ Automatically generate a norm class from *scale_cls*.
+
+ This differs from `.colors.make_norm_from_scale` in the following points:
+
+ - This function is not a class decorator, but directly returns a norm class
+ (as if decorating `.Normalize`).
+ - The scale is automatically constructed with ``nonpositive="mask"``, if it
+ supports such a parameter, to work around the difference in defaults
+ between standard scales (which use "clip") and norms (which use "mask").
+
+ Note that ``make_norm_from_scale`` caches the generated norm classes
+ (not the instances) and reuses them for later calls. For example,
+ ``type(_auto_norm_from_scale("log")) == LogNorm``.
+ """
+ # Actually try to construct an instance, to verify whether
+ # ``nonpositive="mask"`` is supported.
+ try:
+ norm = colors.make_norm_from_scale(
+ functools.partial(scale_cls, nonpositive="mask"))(
+ colors.Normalize)()
+ except TypeError:
+ norm = colors.make_norm_from_scale(scale_cls)(
+ colors.Normalize)()
+ return type(norm)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorizer.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorizer.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..8fcce3e5d63ba727efc2cdd18d8a8565b974bac2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colorizer.pyi
@@ -0,0 +1,102 @@
+from matplotlib import cbook, colorbar, colors, artist
+
+from typing import overload
+import numpy as np
+from numpy.typing import ArrayLike
+
+
+class Colorizer:
+ colorbar: colorbar.Colorbar | None
+ callbacks: cbook.CallbackRegistry
+ def __init__(
+ self,
+ cmap: str | colors.Colormap | None = ...,
+ norm: str | colors.Normalize | None = ...,
+ ) -> None: ...
+ @property
+ def norm(self) -> colors.Normalize: ...
+ @norm.setter
+ def norm(self, norm: colors.Normalize | str | None) -> None: ...
+ def to_rgba(
+ self,
+ x: np.ndarray,
+ alpha: float | ArrayLike | None = ...,
+ bytes: bool = ...,
+ norm: bool = ...,
+ ) -> np.ndarray: ...
+ def autoscale(self, A: ArrayLike) -> None: ...
+ def autoscale_None(self, A: ArrayLike) -> None: ...
+ @property
+ def cmap(self) -> colors.Colormap: ...
+ @cmap.setter
+ def cmap(self, cmap: colors.Colormap | str | None) -> None: ...
+ def get_clim(self) -> tuple[float, float]: ...
+ def set_clim(self, vmin: float | tuple[float, float] | None = ..., vmax: float | None = ...) -> None: ...
+ def changed(self) -> None: ...
+ @property
+ def vmin(self) -> float | None: ...
+ @vmin.setter
+ def vmin(self, value: float | None) -> None: ...
+ @property
+ def vmax(self) -> float | None: ...
+ @vmax.setter
+ def vmax(self, value: float | None) -> None: ...
+ @property
+ def clip(self) -> bool: ...
+ @clip.setter
+ def clip(self, value: bool) -> None: ...
+
+
+class _ColorizerInterface:
+ cmap: colors.Colormap
+ colorbar: colorbar.Colorbar | None
+ callbacks: cbook.CallbackRegistry
+ def to_rgba(
+ self,
+ x: np.ndarray,
+ alpha: float | ArrayLike | None = ...,
+ bytes: bool = ...,
+ norm: bool = ...,
+ ) -> np.ndarray: ...
+ def get_clim(self) -> tuple[float, float]: ...
+ def set_clim(self, vmin: float | tuple[float, float] | None = ..., vmax: float | None = ...) -> None: ...
+ def get_alpha(self) -> float | None: ...
+ def get_cmap(self) -> colors.Colormap: ...
+ def set_cmap(self, cmap: str | colors.Colormap) -> None: ...
+ @property
+ def norm(self) -> colors.Normalize: ...
+ @norm.setter
+ def norm(self, norm: colors.Normalize | str | None) -> None: ...
+ def set_norm(self, norm: colors.Normalize | str | None) -> None: ...
+ def autoscale(self) -> None: ...
+ def autoscale_None(self) -> None: ...
+
+
+class _ScalarMappable(_ColorizerInterface):
+ def __init__(
+ self,
+ norm: colors.Normalize | None = ...,
+ cmap: str | colors.Colormap | None = ...,
+ *,
+ colorizer: Colorizer | None = ...,
+ **kwargs
+ ) -> None: ...
+ def set_array(self, A: ArrayLike | None) -> None: ...
+ def get_array(self) -> np.ndarray | None: ...
+ def changed(self) -> None: ...
+
+
+class ColorizingArtist(_ScalarMappable, artist.Artist):
+ callbacks: cbook.CallbackRegistry
+ def __init__(
+ self,
+ colorizer: Colorizer,
+ **kwargs
+ ) -> None: ...
+ def set_array(self, A: ArrayLike | None) -> None: ...
+ def get_array(self) -> np.ndarray | None: ...
+ def changed(self) -> None: ...
+ @property
+ def colorizer(self) -> Colorizer: ...
+ @colorizer.setter
+ def colorizer(self, cl: Colorizer) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colors.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colors.py
new file mode 100644
index 0000000000000000000000000000000000000000..aa53b575b7379bafb524388fad125c8c453f0781
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colors.py
@@ -0,0 +1,3715 @@
+"""
+A module for converting numbers or color arguments to *RGB* or *RGBA*.
+
+*RGB* and *RGBA* are sequences of, respectively, 3 or 4 floats in the
+range 0-1.
+
+This module includes functions and classes for color specification conversions,
+and for mapping numbers to colors in a 1-D array of colors called a colormap.
+
+Mapping data onto colors using a colormap typically involves two steps: a data
+array is first mapped onto the range 0-1 using a subclass of `Normalize`,
+then this number is mapped to a color using a subclass of `Colormap`. Two
+subclasses of `Colormap` provided here: `LinearSegmentedColormap`, which uses
+piecewise-linear interpolation to define colormaps, and `ListedColormap`, which
+makes a colormap from a list of colors.
+
+.. seealso::
+
+ :ref:`colormap-manipulation` for examples of how to
+ make colormaps and
+
+ :ref:`colormaps` for a list of built-in colormaps.
+
+ :ref:`colormapnorms` for more details about data
+ normalization
+
+ More colormaps are available at palettable_.
+
+The module also provides functions for checking whether an object can be
+interpreted as a color (`is_color_like`), for converting such an object
+to an RGBA tuple (`to_rgba`) or to an HTML-like hex string in the
+"#rrggbb" format (`to_hex`), and a sequence of colors to an (n, 4)
+RGBA array (`to_rgba_array`). Caching is used for efficiency.
+
+Colors that Matplotlib recognizes are listed at
+:ref:`colors_def`.
+
+.. _palettable: https://jiffyclub.github.io/palettable/
+.. _xkcd color survey: https://xkcd.com/color/rgb/
+"""
+
+import base64
+from collections.abc import Sized, Sequence, Mapping
+import functools
+import importlib
+import inspect
+import io
+import itertools
+from numbers import Real
+import re
+
+from PIL import Image
+from PIL.PngImagePlugin import PngInfo
+
+import matplotlib as mpl
+import numpy as np
+from matplotlib import _api, _cm, cbook, scale, _image
+from ._color_data import BASE_COLORS, TABLEAU_COLORS, CSS4_COLORS, XKCD_COLORS
+
+
+class _ColorMapping(dict):
+ def __init__(self, mapping):
+ super().__init__(mapping)
+ self.cache = {}
+
+ def __setitem__(self, key, value):
+ super().__setitem__(key, value)
+ self.cache.clear()
+
+ def __delitem__(self, key):
+ super().__delitem__(key)
+ self.cache.clear()
+
+
+_colors_full_map = {}
+# Set by reverse priority order.
+_colors_full_map.update(XKCD_COLORS)
+_colors_full_map.update({k.replace('grey', 'gray'): v
+ for k, v in XKCD_COLORS.items()
+ if 'grey' in k})
+_colors_full_map.update(CSS4_COLORS)
+_colors_full_map.update(TABLEAU_COLORS)
+_colors_full_map.update({k.replace('gray', 'grey'): v
+ for k, v in TABLEAU_COLORS.items()
+ if 'gray' in k})
+_colors_full_map.update(BASE_COLORS)
+_colors_full_map = _ColorMapping(_colors_full_map)
+
+_REPR_PNG_SIZE = (512, 64)
+_BIVAR_REPR_PNG_SIZE = 256
+
+
+def get_named_colors_mapping():
+ """Return the global mapping of names to named colors."""
+ return _colors_full_map
+
+
+class ColorSequenceRegistry(Mapping):
+ r"""
+ Container for sequences of colors that are known to Matplotlib by name.
+
+ The universal registry instance is `matplotlib.color_sequences`. There
+ should be no need for users to instantiate `.ColorSequenceRegistry`
+ themselves.
+
+ Read access uses a dict-like interface mapping names to lists of colors::
+
+ import matplotlib as mpl
+ colors = mpl.color_sequences['tab10']
+
+ For a list of built in color sequences, see :doc:`/gallery/color/color_sequences`.
+ The returned lists are copies, so that their modification does not change
+ the global definition of the color sequence.
+
+ Additional color sequences can be added via
+ `.ColorSequenceRegistry.register`::
+
+ mpl.color_sequences.register('rgb', ['r', 'g', 'b'])
+ """
+
+ _BUILTIN_COLOR_SEQUENCES = {
+ 'tab10': _cm._tab10_data,
+ 'tab20': _cm._tab20_data,
+ 'tab20b': _cm._tab20b_data,
+ 'tab20c': _cm._tab20c_data,
+ 'Pastel1': _cm._Pastel1_data,
+ 'Pastel2': _cm._Pastel2_data,
+ 'Paired': _cm._Paired_data,
+ 'Accent': _cm._Accent_data,
+ 'Dark2': _cm._Dark2_data,
+ 'Set1': _cm._Set1_data,
+ 'Set2': _cm._Set2_data,
+ 'Set3': _cm._Set3_data,
+ 'petroff10': _cm._petroff10_data,
+ }
+
+ def __init__(self):
+ self._color_sequences = {**self._BUILTIN_COLOR_SEQUENCES}
+
+ def __getitem__(self, item):
+ try:
+ return list(self._color_sequences[item])
+ except KeyError:
+ raise KeyError(f"{item!r} is not a known color sequence name")
+
+ def __iter__(self):
+ return iter(self._color_sequences)
+
+ def __len__(self):
+ return len(self._color_sequences)
+
+ def __str__(self):
+ return ('ColorSequenceRegistry; available colormaps:\n' +
+ ', '.join(f"'{name}'" for name in self))
+
+ def register(self, name, color_list):
+ """
+ Register a new color sequence.
+
+ The color sequence registry stores a copy of the given *color_list*, so
+ that future changes to the original list do not affect the registered
+ color sequence. Think of this as the registry taking a snapshot
+ of *color_list* at registration.
+
+ Parameters
+ ----------
+ name : str
+ The name for the color sequence.
+
+ color_list : list of :mpltype:`color`
+ An iterable returning valid Matplotlib colors when iterating over.
+ Note however that the returned color sequence will always be a
+ list regardless of the input type.
+
+ """
+ if name in self._BUILTIN_COLOR_SEQUENCES:
+ raise ValueError(f"{name!r} is a reserved name for a builtin "
+ "color sequence")
+
+ color_list = list(color_list) # force copy and coerce type to list
+ for color in color_list:
+ try:
+ to_rgba(color)
+ except ValueError:
+ raise ValueError(
+ f"{color!r} is not a valid color specification")
+
+ self._color_sequences[name] = color_list
+
+ def unregister(self, name):
+ """
+ Remove a sequence from the registry.
+
+ You cannot remove built-in color sequences.
+
+ If the name is not registered, returns with no error.
+ """
+ if name in self._BUILTIN_COLOR_SEQUENCES:
+ raise ValueError(
+ f"Cannot unregister builtin color sequence {name!r}")
+ self._color_sequences.pop(name, None)
+
+
+_color_sequences = ColorSequenceRegistry()
+
+
+def _sanitize_extrema(ex):
+ if ex is None:
+ return ex
+ try:
+ ret = ex.item()
+ except AttributeError:
+ ret = float(ex)
+ return ret
+
+_nth_color_re = re.compile(r"\AC[0-9]+\Z")
+
+
+def _is_nth_color(c):
+ """Return whether *c* can be interpreted as an item in the color cycle."""
+ return isinstance(c, str) and _nth_color_re.match(c)
+
+
+def is_color_like(c):
+ """Return whether *c* can be interpreted as an RGB(A) color."""
+ # Special-case nth color syntax because it cannot be parsed during setup.
+ if _is_nth_color(c):
+ return True
+ try:
+ to_rgba(c)
+ except (TypeError, ValueError):
+ return False
+ else:
+ return True
+
+
+def _has_alpha_channel(c):
+ """Return whether *c* is a color with an alpha channel."""
+ # 4-element sequences are interpreted as r, g, b, a
+ return not isinstance(c, str) and len(c) == 4
+
+
+def _check_color_like(**kwargs):
+ """
+ For each *key, value* pair in *kwargs*, check that *value* is color-like.
+ """
+ for k, v in kwargs.items():
+ if not is_color_like(v):
+ raise ValueError(
+ f"{v!r} is not a valid value for {k}: supported inputs are "
+ f"(r, g, b) and (r, g, b, a) 0-1 float tuples; "
+ f"'#rrggbb', '#rrggbbaa', '#rgb', '#rgba' strings; "
+ f"named color strings; "
+ f"string reprs of 0-1 floats for grayscale values; "
+ f"'C0', 'C1', ... strings for colors of the color cycle; "
+ f"and pairs combining one of the above with an alpha value")
+
+
+def same_color(c1, c2):
+ """
+ Return whether the colors *c1* and *c2* are the same.
+
+ *c1*, *c2* can be single colors or lists/arrays of colors.
+ """
+ c1 = to_rgba_array(c1)
+ c2 = to_rgba_array(c2)
+ n1 = max(c1.shape[0], 1) # 'none' results in shape (0, 4), but is 1-elem
+ n2 = max(c2.shape[0], 1) # 'none' results in shape (0, 4), but is 1-elem
+
+ if n1 != n2:
+ raise ValueError('Different number of elements passed.')
+ # The following shape test is needed to correctly handle comparisons with
+ # 'none', which results in a shape (0, 4) array and thus cannot be tested
+ # via value comparison.
+ return c1.shape == c2.shape and (c1 == c2).all()
+
+
+def to_rgba(c, alpha=None):
+ """
+ Convert *c* to an RGBA color.
+
+ Parameters
+ ----------
+ c : Matplotlib color or ``np.ma.masked``
+
+ alpha : float, optional
+ If *alpha* is given, force the alpha value of the returned RGBA tuple
+ to *alpha*.
+
+ If None, the alpha value from *c* is used. If *c* does not have an
+ alpha channel, then alpha defaults to 1.
+
+ *alpha* is ignored for the color value ``"none"`` (case-insensitive),
+ which always maps to ``(0, 0, 0, 0)``.
+
+ Returns
+ -------
+ tuple
+ Tuple of floats ``(r, g, b, a)``, where each channel (red, green, blue,
+ alpha) can assume values between 0 and 1.
+ """
+ if isinstance(c, tuple) and len(c) == 2:
+ if alpha is None:
+ c, alpha = c
+ else:
+ c = c[0]
+ # Special-case nth color syntax because it should not be cached.
+ if _is_nth_color(c):
+ prop_cycler = mpl.rcParams['axes.prop_cycle']
+ colors = prop_cycler.by_key().get('color', ['k'])
+ c = colors[int(c[1:]) % len(colors)]
+ try:
+ rgba = _colors_full_map.cache[c, alpha]
+ except (KeyError, TypeError): # Not in cache, or unhashable.
+ rgba = None
+ if rgba is None: # Suppress exception chaining of cache lookup failure.
+ rgba = _to_rgba_no_colorcycle(c, alpha)
+ try:
+ _colors_full_map.cache[c, alpha] = rgba
+ except TypeError:
+ pass
+ return rgba
+
+
+def _to_rgba_no_colorcycle(c, alpha=None):
+ """
+ Convert *c* to an RGBA color, with no support for color-cycle syntax.
+
+ If *alpha* is given, force the alpha value of the returned RGBA tuple
+ to *alpha*. Otherwise, the alpha value from *c* is used, if it has alpha
+ information, or defaults to 1.
+
+ *alpha* is ignored for the color value ``"none"`` (case-insensitive),
+ which always maps to ``(0, 0, 0, 0)``.
+ """
+ if alpha is not None and not 0 <= alpha <= 1:
+ raise ValueError("'alpha' must be between 0 and 1, inclusive")
+ orig_c = c
+ if c is np.ma.masked:
+ return (0., 0., 0., 0.)
+ if isinstance(c, str):
+ if c.lower() == "none":
+ return (0., 0., 0., 0.)
+ # Named color.
+ try:
+ # This may turn c into a non-string, so we check again below.
+ c = _colors_full_map[c]
+ except KeyError:
+ if len(orig_c) != 1:
+ try:
+ c = _colors_full_map[c.lower()]
+ except KeyError:
+ pass
+ if isinstance(c, str):
+ # hex color in #rrggbb format.
+ match = re.match(r"\A#[a-fA-F0-9]{6}\Z", c)
+ if match:
+ return (tuple(int(n, 16) / 255
+ for n in [c[1:3], c[3:5], c[5:7]])
+ + (alpha if alpha is not None else 1.,))
+ # hex color in #rgb format, shorthand for #rrggbb.
+ match = re.match(r"\A#[a-fA-F0-9]{3}\Z", c)
+ if match:
+ return (tuple(int(n, 16) / 255
+ for n in [c[1]*2, c[2]*2, c[3]*2])
+ + (alpha if alpha is not None else 1.,))
+ # hex color with alpha in #rrggbbaa format.
+ match = re.match(r"\A#[a-fA-F0-9]{8}\Z", c)
+ if match:
+ color = [int(n, 16) / 255
+ for n in [c[1:3], c[3:5], c[5:7], c[7:9]]]
+ if alpha is not None:
+ color[-1] = alpha
+ return tuple(color)
+ # hex color with alpha in #rgba format, shorthand for #rrggbbaa.
+ match = re.match(r"\A#[a-fA-F0-9]{4}\Z", c)
+ if match:
+ color = [int(n, 16) / 255
+ for n in [c[1]*2, c[2]*2, c[3]*2, c[4]*2]]
+ if alpha is not None:
+ color[-1] = alpha
+ return tuple(color)
+ # string gray.
+ try:
+ c = float(c)
+ except ValueError:
+ pass
+ else:
+ if not (0 <= c <= 1):
+ raise ValueError(
+ f"Invalid string grayscale value {orig_c!r}. "
+ f"Value must be within 0-1 range")
+ return c, c, c, alpha if alpha is not None else 1.
+ raise ValueError(f"Invalid RGBA argument: {orig_c!r}")
+ # turn 2-D array into 1-D array
+ if isinstance(c, np.ndarray):
+ if c.ndim == 2 and c.shape[0] == 1:
+ c = c.reshape(-1)
+ # tuple color.
+ if not np.iterable(c):
+ raise ValueError(f"Invalid RGBA argument: {orig_c!r}")
+ if len(c) not in [3, 4]:
+ raise ValueError("RGBA sequence should have length 3 or 4")
+ if not all(isinstance(x, Real) for x in c):
+ # Checks that don't work: `map(float, ...)`, `np.array(..., float)` and
+ # `np.array(...).astype(float)` would all convert "0.5" to 0.5.
+ raise ValueError(f"Invalid RGBA argument: {orig_c!r}")
+ # Return a tuple to prevent the cached value from being modified.
+ c = tuple(map(float, c))
+ if len(c) == 3 and alpha is None:
+ alpha = 1
+ if alpha is not None:
+ c = c[:3] + (alpha,)
+ if any(elem < 0 or elem > 1 for elem in c):
+ raise ValueError("RGBA values should be within 0-1 range")
+ return c
+
+
+def to_rgba_array(c, alpha=None):
+ """
+ Convert *c* to a (n, 4) array of RGBA colors.
+
+ Parameters
+ ----------
+ c : Matplotlib color or array of colors
+ If *c* is a masked array, an `~numpy.ndarray` is returned with a
+ (0, 0, 0, 0) row for each masked value or row in *c*.
+
+ alpha : float or sequence of floats, optional
+ If *alpha* is given, force the alpha value of the returned RGBA tuple
+ to *alpha*.
+
+ If None, the alpha value from *c* is used. If *c* does not have an
+ alpha channel, then alpha defaults to 1.
+
+ *alpha* is ignored for the color value ``"none"`` (case-insensitive),
+ which always maps to ``(0, 0, 0, 0)``.
+
+ If *alpha* is a sequence and *c* is a single color, *c* will be
+ repeated to match the length of *alpha*.
+
+ Returns
+ -------
+ array
+ (n, 4) array of RGBA colors, where each channel (red, green, blue,
+ alpha) can assume values between 0 and 1.
+ """
+ if isinstance(c, tuple) and len(c) == 2 and isinstance(c[1], Real):
+ if alpha is None:
+ c, alpha = c
+ else:
+ c = c[0]
+ # Special-case inputs that are already arrays, for performance. (If the
+ # array has the wrong kind or shape, raise the error during one-at-a-time
+ # conversion.)
+ if np.iterable(alpha):
+ alpha = np.asarray(alpha).ravel()
+ if (isinstance(c, np.ndarray) and c.dtype.kind in "if"
+ and c.ndim == 2 and c.shape[1] in [3, 4]):
+ mask = c.mask.any(axis=1) if np.ma.is_masked(c) else None
+ c = np.ma.getdata(c)
+ if np.iterable(alpha):
+ if c.shape[0] == 1 and alpha.shape[0] > 1:
+ c = np.tile(c, (alpha.shape[0], 1))
+ elif c.shape[0] != alpha.shape[0]:
+ raise ValueError("The number of colors must match the number"
+ " of alpha values if there are more than one"
+ " of each.")
+ if c.shape[1] == 3:
+ result = np.column_stack([c, np.zeros(len(c))])
+ result[:, -1] = alpha if alpha is not None else 1.
+ elif c.shape[1] == 4:
+ result = c.copy()
+ if alpha is not None:
+ result[:, -1] = alpha
+ if mask is not None:
+ result[mask] = 0
+ if np.any((result < 0) | (result > 1)):
+ raise ValueError("RGBA values should be within 0-1 range")
+ return result
+ # Handle single values.
+ # Note that this occurs *after* handling inputs that are already arrays, as
+ # `to_rgba(c, alpha)` (below) is expensive for such inputs, due to the need
+ # to format the array in the ValueError message(!).
+ if cbook._str_lower_equal(c, "none"):
+ return np.zeros((0, 4), float)
+ try:
+ if np.iterable(alpha):
+ return np.array([to_rgba(c, a) for a in alpha], float)
+ else:
+ return np.array([to_rgba(c, alpha)], float)
+ except TypeError:
+ pass
+ except ValueError as e:
+ if e.args == ("'alpha' must be between 0 and 1, inclusive", ):
+ # ValueError is from _to_rgba_no_colorcycle().
+ raise e
+ if isinstance(c, str):
+ raise ValueError(f"{c!r} is not a valid color value.")
+
+ if len(c) == 0:
+ return np.zeros((0, 4), float)
+
+ # Quick path if the whole sequence can be directly converted to a numpy
+ # array in one shot.
+ if isinstance(c, Sequence):
+ lens = {len(cc) if isinstance(cc, (list, tuple)) else -1 for cc in c}
+ if lens == {3}:
+ rgba = np.column_stack([c, np.ones(len(c))])
+ elif lens == {4}:
+ rgba = np.array(c)
+ else:
+ rgba = np.array([to_rgba(cc) for cc in c])
+ else:
+ rgba = np.array([to_rgba(cc) for cc in c])
+
+ if alpha is not None:
+ rgba[:, 3] = alpha
+ if isinstance(c, Sequence):
+ # ensure that an explicit alpha does not overwrite full transparency
+ # for "none"
+ none_mask = [cbook._str_equal(cc, "none") for cc in c]
+ rgba[:, 3][none_mask] = 0
+ return rgba
+
+
+def to_rgb(c):
+ """Convert *c* to an RGB color, silently dropping the alpha channel."""
+ return to_rgba(c)[:3]
+
+
+def to_hex(c, keep_alpha=False):
+ """
+ Convert *c* to a hex color.
+
+ Parameters
+ ----------
+ c : :ref:`color ` or `numpy.ma.masked`
+
+ keep_alpha : bool, default: False
+ If False, use the ``#rrggbb`` format, otherwise use ``#rrggbbaa``.
+
+ Returns
+ -------
+ str
+ ``#rrggbb`` or ``#rrggbbaa`` hex color string
+ """
+ c = to_rgba(c)
+ if not keep_alpha:
+ c = c[:3]
+ return "#" + "".join(format(round(val * 255), "02x") for val in c)
+
+
+### Backwards-compatible color-conversion API
+
+
+cnames = CSS4_COLORS
+hexColorPattern = re.compile(r"\A#[a-fA-F0-9]{6}\Z")
+rgb2hex = to_hex
+hex2color = to_rgb
+
+
+class ColorConverter:
+ """
+ A class only kept for backwards compatibility.
+
+ Its functionality is entirely provided by module-level functions.
+ """
+ colors = _colors_full_map
+ cache = _colors_full_map.cache
+ to_rgb = staticmethod(to_rgb)
+ to_rgba = staticmethod(to_rgba)
+ to_rgba_array = staticmethod(to_rgba_array)
+
+
+colorConverter = ColorConverter()
+
+
+### End of backwards-compatible color-conversion API
+
+
+def _create_lookup_table(N, data, gamma=1.0):
+ r"""
+ Create an *N* -element 1D lookup table.
+
+ This assumes a mapping :math:`f : [0, 1] \rightarrow [0, 1]`. The returned
+ data is an array of N values :math:`y = f(x)` where x is sampled from
+ [0, 1].
+
+ By default (*gamma* = 1) x is equidistantly sampled from [0, 1]. The
+ *gamma* correction factor :math:`\gamma` distorts this equidistant
+ sampling by :math:`x \rightarrow x^\gamma`.
+
+ Parameters
+ ----------
+ N : int
+ The number of elements of the created lookup table; at least 1.
+
+ data : (M, 3) array-like or callable
+ Defines the mapping :math:`f`.
+
+ If a (M, 3) array-like, the rows define values (x, y0, y1). The x
+ values must start with x=0, end with x=1, and all x values be in
+ increasing order.
+
+ A value between :math:`x_i` and :math:`x_{i+1}` is mapped to the range
+ :math:`y^1_{i-1} \ldots y^0_i` by linear interpolation.
+
+ For the simple case of a y-continuous mapping, y0 and y1 are identical.
+
+ The two values of y are to allow for discontinuous mapping functions.
+ E.g. a sawtooth with a period of 0.2 and an amplitude of 1 would be::
+
+ [(0, 1, 0), (0.2, 1, 0), (0.4, 1, 0), ..., [(1, 1, 0)]
+
+ In the special case of ``N == 1``, by convention the returned value
+ is y0 for x == 1.
+
+ If *data* is a callable, it must accept and return numpy arrays::
+
+ data(x : ndarray) -> ndarray
+
+ and map values between 0 - 1 to 0 - 1.
+
+ gamma : float
+ Gamma correction factor for input distribution x of the mapping.
+
+ See also https://en.wikipedia.org/wiki/Gamma_correction.
+
+ Returns
+ -------
+ array
+ The lookup table where ``lut[x * (N-1)]`` gives the closest value
+ for values of x between 0 and 1.
+
+ Notes
+ -----
+ This function is internally used for `.LinearSegmentedColormap`.
+ """
+
+ if callable(data):
+ xind = np.linspace(0, 1, N) ** gamma
+ lut = np.clip(np.array(data(xind), dtype=float), 0, 1)
+ return lut
+
+ try:
+ adata = np.array(data)
+ except Exception as err:
+ raise TypeError("data must be convertible to an array") from err
+ _api.check_shape((None, 3), data=adata)
+
+ x = adata[:, 0]
+ y0 = adata[:, 1]
+ y1 = adata[:, 2]
+
+ if x[0] != 0. or x[-1] != 1.0:
+ raise ValueError(
+ "data mapping points must start with x=0 and end with x=1")
+ if (np.diff(x) < 0).any():
+ raise ValueError("data mapping points must have x in increasing order")
+ # begin generation of lookup table
+ if N == 1:
+ # convention: use the y = f(x=1) value for a 1-element lookup table
+ lut = np.array(y0[-1])
+ else:
+ x = x * (N - 1)
+ xind = (N - 1) * np.linspace(0, 1, N) ** gamma
+ ind = np.searchsorted(x, xind)[1:-1]
+
+ distance = (xind[1:-1] - x[ind - 1]) / (x[ind] - x[ind - 1])
+ lut = np.concatenate([
+ [y1[0]],
+ distance * (y0[ind] - y1[ind - 1]) + y1[ind - 1],
+ [y0[-1]],
+ ])
+ # ensure that the lut is confined to values between 0 and 1 by clipping it
+ return np.clip(lut, 0.0, 1.0)
+
+
+class Colormap:
+ """
+ Baseclass for all scalar to RGBA mappings.
+
+ Typically, Colormap instances are used to convert data values (floats)
+ from the interval ``[0, 1]`` to the RGBA color that the respective
+ Colormap represents. For scaling of data into the ``[0, 1]`` interval see
+ `matplotlib.colors.Normalize`. Subclasses of `matplotlib.cm.ScalarMappable`
+ make heavy use of this ``data -> normalize -> map-to-color`` processing
+ chain.
+ """
+
+ def __init__(self, name, N=256):
+ """
+ Parameters
+ ----------
+ name : str
+ The name of the colormap.
+ N : int
+ The number of RGB quantization levels.
+ """
+ self.name = name
+ self.N = int(N) # ensure that N is always int
+ self._rgba_bad = (0.0, 0.0, 0.0, 0.0) # If bad, don't paint anything.
+ self._rgba_under = None
+ self._rgba_over = None
+ self._i_under = self.N
+ self._i_over = self.N + 1
+ self._i_bad = self.N + 2
+ self._isinit = False
+ self.n_variates = 1
+ #: When this colormap exists on a scalar mappable and colorbar_extend
+ #: is not False, colorbar creation will pick up ``colorbar_extend`` as
+ #: the default value for the ``extend`` keyword in the
+ #: `matplotlib.colorbar.Colorbar` constructor.
+ self.colorbar_extend = False
+
+ def __call__(self, X, alpha=None, bytes=False):
+ r"""
+ Parameters
+ ----------
+ X : float or int or array-like
+ The data value(s) to convert to RGBA.
+ For floats, *X* should be in the interval ``[0.0, 1.0]`` to
+ return the RGBA values ``X*100`` percent along the Colormap line.
+ For integers, *X* should be in the interval ``[0, Colormap.N)`` to
+ return RGBA values *indexed* from the Colormap with index ``X``.
+ alpha : float or array-like or None
+ Alpha must be a scalar between 0 and 1, a sequence of such
+ floats with shape matching X, or None.
+ bytes : bool, default: False
+ If False (default), the returned RGBA values will be floats in the
+ interval ``[0, 1]`` otherwise they will be `numpy.uint8`\s in the
+ interval ``[0, 255]``.
+
+ Returns
+ -------
+ Tuple of RGBA values if X is scalar, otherwise an array of
+ RGBA values with a shape of ``X.shape + (4, )``.
+ """
+ rgba, mask = self._get_rgba_and_mask(X, alpha=alpha, bytes=bytes)
+ if not np.iterable(X):
+ rgba = tuple(rgba)
+ return rgba
+
+ def _get_rgba_and_mask(self, X, alpha=None, bytes=False):
+ r"""
+ Parameters
+ ----------
+ X : float or int or array-like
+ The data value(s) to convert to RGBA.
+ For floats, *X* should be in the interval ``[0.0, 1.0]`` to
+ return the RGBA values ``X*100`` percent along the Colormap line.
+ For integers, *X* should be in the interval ``[0, Colormap.N)`` to
+ return RGBA values *indexed* from the Colormap with index ``X``.
+ alpha : float or array-like or None
+ Alpha must be a scalar between 0 and 1, a sequence of such
+ floats with shape matching X, or None.
+ bytes : bool, default: False
+ If False (default), the returned RGBA values will be floats in the
+ interval ``[0, 1]`` otherwise they will be `numpy.uint8`\s in the
+ interval ``[0, 255]``.
+
+ Returns
+ -------
+ colors : np.ndarray
+ Array of RGBA values with a shape of ``X.shape + (4, )``.
+ mask : np.ndarray
+ Boolean array with True where the input is ``np.nan`` or masked.
+ """
+ if not self._isinit:
+ self._init()
+
+ xa = np.array(X, copy=True)
+ if not xa.dtype.isnative:
+ # Native byteorder is faster.
+ xa = xa.byteswap().view(xa.dtype.newbyteorder())
+ if xa.dtype.kind == "f":
+ xa *= self.N
+ # xa == 1 (== N after multiplication) is not out of range.
+ xa[xa == self.N] = self.N - 1
+ # Pre-compute the masks before casting to int (which can truncate
+ # negative values to zero or wrap large floats to negative ints).
+ mask_under = xa < 0
+ mask_over = xa >= self.N
+ # If input was masked, get the bad mask from it; else mask out nans.
+ mask_bad = X.mask if np.ma.is_masked(X) else np.isnan(xa)
+ with np.errstate(invalid="ignore"):
+ # We need this cast for unsigned ints as well as floats
+ xa = xa.astype(int)
+ xa[mask_under] = self._i_under
+ xa[mask_over] = self._i_over
+ xa[mask_bad] = self._i_bad
+
+ lut = self._lut
+ if bytes:
+ lut = (lut * 255).astype(np.uint8)
+
+ rgba = lut.take(xa, axis=0, mode='clip')
+
+ if alpha is not None:
+ alpha = np.clip(alpha, 0, 1)
+ if bytes:
+ alpha *= 255 # Will be cast to uint8 upon assignment.
+ if alpha.shape not in [(), xa.shape]:
+ raise ValueError(
+ f"alpha is array-like but its shape {alpha.shape} does "
+ f"not match that of X {xa.shape}")
+ rgba[..., -1] = alpha
+ # If the "bad" color is all zeros, then ignore alpha input.
+ if (lut[-1] == 0).all():
+ rgba[mask_bad] = (0, 0, 0, 0)
+
+ return rgba, mask_bad
+
+ def __copy__(self):
+ cls = self.__class__
+ cmapobject = cls.__new__(cls)
+ cmapobject.__dict__.update(self.__dict__)
+ if self._isinit:
+ cmapobject._lut = np.copy(self._lut)
+ return cmapobject
+
+ def __eq__(self, other):
+ if (not isinstance(other, Colormap) or
+ self.colorbar_extend != other.colorbar_extend):
+ return False
+ # To compare lookup tables the Colormaps have to be initialized
+ if not self._isinit:
+ self._init()
+ if not other._isinit:
+ other._init()
+ return np.array_equal(self._lut, other._lut)
+
+ def get_bad(self):
+ """Get the color for masked values."""
+ if not self._isinit:
+ self._init()
+ return np.array(self._lut[self._i_bad])
+
+ def set_bad(self, color='k', alpha=None):
+ """Set the color for masked values."""
+ self._rgba_bad = to_rgba(color, alpha)
+ if self._isinit:
+ self._set_extremes()
+
+ def get_under(self):
+ """Get the color for low out-of-range values."""
+ if not self._isinit:
+ self._init()
+ return np.array(self._lut[self._i_under])
+
+ def set_under(self, color='k', alpha=None):
+ """Set the color for low out-of-range values."""
+ self._rgba_under = to_rgba(color, alpha)
+ if self._isinit:
+ self._set_extremes()
+
+ def get_over(self):
+ """Get the color for high out-of-range values."""
+ if not self._isinit:
+ self._init()
+ return np.array(self._lut[self._i_over])
+
+ def set_over(self, color='k', alpha=None):
+ """Set the color for high out-of-range values."""
+ self._rgba_over = to_rgba(color, alpha)
+ if self._isinit:
+ self._set_extremes()
+
+ def set_extremes(self, *, bad=None, under=None, over=None):
+ """
+ Set the colors for masked (*bad*) values and, when ``norm.clip =
+ False``, low (*under*) and high (*over*) out-of-range values.
+ """
+ if bad is not None:
+ self.set_bad(bad)
+ if under is not None:
+ self.set_under(under)
+ if over is not None:
+ self.set_over(over)
+
+ def with_extremes(self, *, bad=None, under=None, over=None):
+ """
+ Return a copy of the colormap, for which the colors for masked (*bad*)
+ values and, when ``norm.clip = False``, low (*under*) and high (*over*)
+ out-of-range values, have been set accordingly.
+ """
+ new_cm = self.copy()
+ new_cm.set_extremes(bad=bad, under=under, over=over)
+ return new_cm
+
+ def _set_extremes(self):
+ if self._rgba_under:
+ self._lut[self._i_under] = self._rgba_under
+ else:
+ self._lut[self._i_under] = self._lut[0]
+ if self._rgba_over:
+ self._lut[self._i_over] = self._rgba_over
+ else:
+ self._lut[self._i_over] = self._lut[self.N - 1]
+ self._lut[self._i_bad] = self._rgba_bad
+
+ def _init(self):
+ """Generate the lookup table, ``self._lut``."""
+ raise NotImplementedError("Abstract class only")
+
+ def is_gray(self):
+ """Return whether the colormap is grayscale."""
+ if not self._isinit:
+ self._init()
+ return (np.all(self._lut[:, 0] == self._lut[:, 1]) and
+ np.all(self._lut[:, 0] == self._lut[:, 2]))
+
+ def resampled(self, lutsize):
+ """Return a new colormap with *lutsize* entries."""
+ if hasattr(self, '_resample'):
+ _api.warn_external(
+ "The ability to resample a color map is now public API "
+ f"However the class {type(self)} still only implements "
+ "the previous private _resample method. Please update "
+ "your class."
+ )
+ return self._resample(lutsize)
+
+ raise NotImplementedError()
+
+ def reversed(self, name=None):
+ """
+ Return a reversed instance of the Colormap.
+
+ .. note:: This function is not implemented for the base class.
+
+ Parameters
+ ----------
+ name : str, optional
+ The name for the reversed colormap. If None, the
+ name is set to ``self.name + "_r"``.
+
+ See Also
+ --------
+ LinearSegmentedColormap.reversed
+ ListedColormap.reversed
+ """
+ raise NotImplementedError()
+
+ def _repr_png_(self):
+ """Generate a PNG representation of the Colormap."""
+ X = np.tile(np.linspace(0, 1, _REPR_PNG_SIZE[0]),
+ (_REPR_PNG_SIZE[1], 1))
+ pixels = self(X, bytes=True)
+ png_bytes = io.BytesIO()
+ title = self.name + ' colormap'
+ author = f'Matplotlib v{mpl.__version__}, https://matplotlib.org'
+ pnginfo = PngInfo()
+ pnginfo.add_text('Title', title)
+ pnginfo.add_text('Description', title)
+ pnginfo.add_text('Author', author)
+ pnginfo.add_text('Software', author)
+ Image.fromarray(pixels).save(png_bytes, format='png', pnginfo=pnginfo)
+ return png_bytes.getvalue()
+
+ def _repr_html_(self):
+ """Generate an HTML representation of the Colormap."""
+ png_bytes = self._repr_png_()
+ png_base64 = base64.b64encode(png_bytes).decode('ascii')
+ def color_block(color):
+ hex_color = to_hex(color, keep_alpha=True)
+ return (f'
')
+
+ return (''
+ f'{self.name} '
+ '
'
+ ''
+ ''
+ '
'
+ f'{color_block(self.get_under())} under'
+ '
'
+ '
'
+ f'bad {color_block(self.get_bad())}'
+ '
'
+ '
'
+ f'over {color_block(self.get_over())}'
+ '
'
+ '
')
+
+ def copy(self):
+ """Return a copy of the colormap."""
+ return self.__copy__()
+
+
+class LinearSegmentedColormap(Colormap):
+ """
+ Colormap objects based on lookup tables using linear segments.
+
+ The lookup table is generated using linear interpolation for each
+ primary color, with the 0-1 domain divided into any number of
+ segments.
+ """
+
+ def __init__(self, name, segmentdata, N=256, gamma=1.0):
+ """
+ Create colormap from linear mapping segments
+
+ segmentdata argument is a dictionary with a red, green and blue
+ entries. Each entry should be a list of *x*, *y0*, *y1* tuples,
+ forming rows in a table. Entries for alpha are optional.
+
+ Example: suppose you want red to increase from 0 to 1 over
+ the bottom half, green to do the same over the middle half,
+ and blue over the top half. Then you would use::
+
+ cdict = {'red': [(0.0, 0.0, 0.0),
+ (0.5, 1.0, 1.0),
+ (1.0, 1.0, 1.0)],
+
+ 'green': [(0.0, 0.0, 0.0),
+ (0.25, 0.0, 0.0),
+ (0.75, 1.0, 1.0),
+ (1.0, 1.0, 1.0)],
+
+ 'blue': [(0.0, 0.0, 0.0),
+ (0.5, 0.0, 0.0),
+ (1.0, 1.0, 1.0)]}
+
+ Each row in the table for a given color is a sequence of
+ *x*, *y0*, *y1* tuples. In each sequence, *x* must increase
+ monotonically from 0 to 1. For any input value *z* falling
+ between *x[i]* and *x[i+1]*, the output value of a given color
+ will be linearly interpolated between *y1[i]* and *y0[i+1]*::
+
+ row i: x y0 y1
+ /
+ /
+ row i+1: x y0 y1
+
+ Hence y0 in the first row and y1 in the last row are never used.
+
+ See Also
+ --------
+ LinearSegmentedColormap.from_list
+ Static method; factory function for generating a smoothly-varying
+ LinearSegmentedColormap.
+ """
+ # True only if all colors in map are identical; needed for contouring.
+ self.monochrome = False
+ super().__init__(name, N)
+ self._segmentdata = segmentdata
+ self._gamma = gamma
+
+ def _init(self):
+ self._lut = np.ones((self.N + 3, 4), float)
+ self._lut[:-3, 0] = _create_lookup_table(
+ self.N, self._segmentdata['red'], self._gamma)
+ self._lut[:-3, 1] = _create_lookup_table(
+ self.N, self._segmentdata['green'], self._gamma)
+ self._lut[:-3, 2] = _create_lookup_table(
+ self.N, self._segmentdata['blue'], self._gamma)
+ if 'alpha' in self._segmentdata:
+ self._lut[:-3, 3] = _create_lookup_table(
+ self.N, self._segmentdata['alpha'], 1)
+ self._isinit = True
+ self._set_extremes()
+
+ def set_gamma(self, gamma):
+ """Set a new gamma value and regenerate colormap."""
+ self._gamma = gamma
+ self._init()
+
+ @staticmethod
+ def from_list(name, colors, N=256, gamma=1.0):
+ """
+ Create a `LinearSegmentedColormap` from a list of colors.
+
+ Parameters
+ ----------
+ name : str
+ The name of the colormap.
+ colors : list of :mpltype:`color` or list of (value, color)
+ If only colors are given, they are equidistantly mapped from the
+ range :math:`[0, 1]`; i.e. 0 maps to ``colors[0]`` and 1 maps to
+ ``colors[-1]``.
+ If (value, color) pairs are given, the mapping is from *value*
+ to *color*. This can be used to divide the range unevenly.
+ N : int
+ The number of RGB quantization levels.
+ gamma : float
+ """
+ if not np.iterable(colors):
+ raise ValueError('colors must be iterable')
+
+ if (isinstance(colors[0], Sized) and len(colors[0]) == 2
+ and not isinstance(colors[0], str)):
+ # List of value, color pairs
+ vals, colors = zip(*colors)
+ else:
+ vals = np.linspace(0, 1, len(colors))
+
+ r, g, b, a = to_rgba_array(colors).T
+ cdict = {
+ "red": np.column_stack([vals, r, r]),
+ "green": np.column_stack([vals, g, g]),
+ "blue": np.column_stack([vals, b, b]),
+ "alpha": np.column_stack([vals, a, a]),
+ }
+
+ return LinearSegmentedColormap(name, cdict, N, gamma)
+
+ def resampled(self, lutsize):
+ """Return a new colormap with *lutsize* entries."""
+ new_cmap = LinearSegmentedColormap(self.name, self._segmentdata,
+ lutsize)
+ new_cmap._rgba_over = self._rgba_over
+ new_cmap._rgba_under = self._rgba_under
+ new_cmap._rgba_bad = self._rgba_bad
+ return new_cmap
+
+ # Helper ensuring picklability of the reversed cmap.
+ @staticmethod
+ def _reverser(func, x):
+ return func(1 - x)
+
+ def reversed(self, name=None):
+ """
+ Return a reversed instance of the Colormap.
+
+ Parameters
+ ----------
+ name : str, optional
+ The name for the reversed colormap. If None, the
+ name is set to ``self.name + "_r"``.
+
+ Returns
+ -------
+ LinearSegmentedColormap
+ The reversed colormap.
+ """
+ if name is None:
+ name = self.name + "_r"
+
+ # Using a partial object keeps the cmap picklable.
+ data_r = {key: (functools.partial(self._reverser, data)
+ if callable(data) else
+ [(1.0 - x, y1, y0) for x, y0, y1 in reversed(data)])
+ for key, data in self._segmentdata.items()}
+
+ new_cmap = LinearSegmentedColormap(name, data_r, self.N, self._gamma)
+ # Reverse the over/under values too
+ new_cmap._rgba_over = self._rgba_under
+ new_cmap._rgba_under = self._rgba_over
+ new_cmap._rgba_bad = self._rgba_bad
+ return new_cmap
+
+
+class ListedColormap(Colormap):
+ """
+ Colormap object generated from a list of colors.
+
+ This may be most useful when indexing directly into a colormap,
+ but it can also be used to generate special colormaps for ordinary
+ mapping.
+
+ Parameters
+ ----------
+ colors : list, array
+ Sequence of Matplotlib color specifications (color names or RGB(A)
+ values).
+ name : str, optional
+ String to identify the colormap.
+ N : int, optional
+ Number of entries in the map. The default is *None*, in which case
+ there is one colormap entry for each element in the list of colors.
+ If ::
+
+ N < len(colors)
+
+ the list will be truncated at *N*. If ::
+
+ N > len(colors)
+
+ the list will be extended by repetition.
+ """
+ def __init__(self, colors, name='from_list', N=None):
+ self.monochrome = False # Are all colors identical? (for contour.py)
+ if N is None:
+ self.colors = colors
+ N = len(colors)
+ else:
+ if isinstance(colors, str):
+ self.colors = [colors] * N
+ self.monochrome = True
+ elif np.iterable(colors):
+ if len(colors) == 1:
+ self.monochrome = True
+ self.colors = list(
+ itertools.islice(itertools.cycle(colors), N))
+ else:
+ try:
+ gray = float(colors)
+ except TypeError:
+ pass
+ else:
+ self.colors = [gray] * N
+ self.monochrome = True
+ super().__init__(name, N)
+
+ def _init(self):
+ self._lut = np.zeros((self.N + 3, 4), float)
+ self._lut[:-3] = to_rgba_array(self.colors)
+ self._isinit = True
+ self._set_extremes()
+
+ def resampled(self, lutsize):
+ """Return a new colormap with *lutsize* entries."""
+ colors = self(np.linspace(0, 1, lutsize))
+ new_cmap = ListedColormap(colors, name=self.name)
+ # Keep the over/under values too
+ new_cmap._rgba_over = self._rgba_over
+ new_cmap._rgba_under = self._rgba_under
+ new_cmap._rgba_bad = self._rgba_bad
+ return new_cmap
+
+ def reversed(self, name=None):
+ """
+ Return a reversed instance of the Colormap.
+
+ Parameters
+ ----------
+ name : str, optional
+ The name for the reversed colormap. If None, the
+ name is set to ``self.name + "_r"``.
+
+ Returns
+ -------
+ ListedColormap
+ A reversed instance of the colormap.
+ """
+ if name is None:
+ name = self.name + "_r"
+
+ colors_r = list(reversed(self.colors))
+ new_cmap = ListedColormap(colors_r, name=name, N=self.N)
+ # Reverse the over/under values too
+ new_cmap._rgba_over = self._rgba_under
+ new_cmap._rgba_under = self._rgba_over
+ new_cmap._rgba_bad = self._rgba_bad
+ return new_cmap
+
+
+class MultivarColormap:
+ """
+ Class for holding multiple `~matplotlib.colors.Colormap` for use in a
+ `~matplotlib.cm.ScalarMappable` object
+ """
+ def __init__(self, colormaps, combination_mode, name='multivariate colormap'):
+ """
+ Parameters
+ ----------
+ colormaps: list or tuple of `~matplotlib.colors.Colormap` objects
+ The individual colormaps that are combined
+ combination_mode: str, 'sRGB_add' or 'sRGB_sub'
+ Describe how colormaps are combined in sRGB space
+
+ - If 'sRGB_add' -> Mixing produces brighter colors
+ `sRGB = sum(colors)`
+ - If 'sRGB_sub' -> Mixing produces darker colors
+ `sRGB = 1 - sum(1 - colors)`
+ name : str, optional
+ The name of the colormap family.
+ """
+ self.name = name
+
+ if not np.iterable(colormaps) \
+ or len(colormaps) == 1 \
+ or isinstance(colormaps, str):
+ raise ValueError("A MultivarColormap must have more than one colormap.")
+ colormaps = list(colormaps) # ensure cmaps is a list, i.e. not a tuple
+ for i, cmap in enumerate(colormaps):
+ if isinstance(cmap, str):
+ colormaps[i] = mpl.colormaps[cmap]
+ elif not isinstance(cmap, Colormap):
+ raise ValueError("colormaps must be a list of objects that subclass"
+ " Colormap or a name found in the colormap registry.")
+
+ self._colormaps = colormaps
+ _api.check_in_list(['sRGB_add', 'sRGB_sub'], combination_mode=combination_mode)
+ self._combination_mode = combination_mode
+ self.n_variates = len(colormaps)
+ self._rgba_bad = (0.0, 0.0, 0.0, 0.0) # If bad, don't paint anything.
+
+ def __call__(self, X, alpha=None, bytes=False, clip=True):
+ r"""
+ Parameters
+ ----------
+ X : tuple (X0, X1, ...) of length equal to the number of colormaps
+ X0, X1 ...:
+ float or int, `~numpy.ndarray` or scalar
+ The data value(s) to convert to RGBA.
+ For floats, *Xi...* should be in the interval ``[0.0, 1.0]`` to
+ return the RGBA values ``X*100`` percent along the Colormap line.
+ For integers, *Xi...* should be in the interval ``[0, self[i].N)`` to
+ return RGBA values *indexed* from colormap [i] with index ``Xi``, where
+ self[i] is colormap i.
+ alpha : float or array-like or None
+ Alpha must be a scalar between 0 and 1, a sequence of such
+ floats with shape matching *Xi*, or None.
+ bytes : bool, default: False
+ If False (default), the returned RGBA values will be floats in the
+ interval ``[0, 1]`` otherwise they will be `numpy.uint8`\s in the
+ interval ``[0, 255]``.
+ clip : bool, default: True
+ If True, clip output to 0 to 1
+
+ Returns
+ -------
+ Tuple of RGBA values if X[0] is scalar, otherwise an array of
+ RGBA values with a shape of ``X.shape + (4, )``.
+ """
+
+ if len(X) != len(self):
+ raise ValueError(
+ f'For the selected colormap the data must have a first dimension '
+ f'{len(self)}, not {len(X)}')
+ rgba, mask_bad = self[0]._get_rgba_and_mask(X[0], bytes=False)
+ for c, xx in zip(self[1:], X[1:]):
+ sub_rgba, sub_mask_bad = c._get_rgba_and_mask(xx, bytes=False)
+ rgba[..., :3] += sub_rgba[..., :3] # add colors
+ rgba[..., 3] *= sub_rgba[..., 3] # multiply alpha
+ mask_bad |= sub_mask_bad
+
+ if self.combination_mode == 'sRGB_sub':
+ rgba[..., :3] -= len(self) - 1
+
+ rgba[mask_bad] = self.get_bad()
+
+ if clip:
+ rgba = np.clip(rgba, 0, 1)
+
+ if alpha is not None:
+ if clip:
+ alpha = np.clip(alpha, 0, 1)
+ if np.shape(alpha) not in [(), np.shape(X[0])]:
+ raise ValueError(
+ f"alpha is array-like but its shape {np.shape(alpha)} does "
+ f"not match that of X[0] {np.shape(X[0])}")
+ rgba[..., -1] *= alpha
+
+ if bytes:
+ if not clip:
+ raise ValueError(
+ "clip cannot be false while bytes is true"
+ " as uint8 does not support values below 0"
+ " or above 255.")
+ rgba = (rgba * 255).astype('uint8')
+
+ if not np.iterable(X[0]):
+ rgba = tuple(rgba)
+
+ return rgba
+
+ def copy(self):
+ """Return a copy of the multivarcolormap."""
+ return self.__copy__()
+
+ def __copy__(self):
+ cls = self.__class__
+ cmapobject = cls.__new__(cls)
+ cmapobject.__dict__.update(self.__dict__)
+ cmapobject._colormaps = [cm.copy() for cm in self._colormaps]
+ cmapobject._rgba_bad = np.copy(self._rgba_bad)
+ return cmapobject
+
+ def __eq__(self, other):
+ if not isinstance(other, MultivarColormap):
+ return False
+ if len(self) != len(other):
+ return False
+ for c0, c1 in zip(self, other):
+ if c0 != c1:
+ return False
+ if not all(self._rgba_bad == other._rgba_bad):
+ return False
+ if self.combination_mode != other.combination_mode:
+ return False
+ return True
+
+ def __getitem__(self, item):
+ return self._colormaps[item]
+
+ def __iter__(self):
+ for c in self._colormaps:
+ yield c
+
+ def __len__(self):
+ return len(self._colormaps)
+
+ def __str__(self):
+ return self.name
+
+ def get_bad(self):
+ """Get the color for masked values."""
+ return np.array(self._rgba_bad)
+
+ def resampled(self, lutshape):
+ """
+ Return a new colormap with *lutshape* entries.
+
+ Parameters
+ ----------
+ lutshape : tuple of (`int`, `None`)
+ The tuple must have a length matching the number of variates.
+ For each element in the tuple, if `int`, the corresponding colorbar
+ is resampled, if `None`, the corresponding colorbar is not resampled.
+
+ Returns
+ -------
+ MultivarColormap
+ """
+
+ if not np.iterable(lutshape) or len(lutshape) != len(self):
+ raise ValueError(f"lutshape must be of length {len(self)}")
+ new_cmap = self.copy()
+ for i, s in enumerate(lutshape):
+ if s is not None:
+ new_cmap._colormaps[i] = self[i].resampled(s)
+ return new_cmap
+
+ def with_extremes(self, *, bad=None, under=None, over=None):
+ """
+ Return a copy of the `MultivarColormap` with modified out-of-range attributes.
+
+ The *bad* keyword modifies the copied `MultivarColormap` while *under* and
+ *over* modifies the attributes of the copied component colormaps.
+ Note that *under* and *over* colors are subject to the mixing rules determined
+ by the *combination_mode*.
+
+ Parameters
+ ----------
+ bad: :mpltype:`color`, default: None
+ If Matplotlib color, the bad value is set accordingly in the copy
+
+ under tuple of :mpltype:`color`, default: None
+ If tuple, the `under` value of each component is set with the values
+ from the tuple.
+
+ over tuple of :mpltype:`color`, default: None
+ If tuple, the `over` value of each component is set with the values
+ from the tuple.
+
+ Returns
+ -------
+ MultivarColormap
+ copy of self with attributes set
+
+ """
+ new_cm = self.copy()
+ if bad is not None:
+ new_cm._rgba_bad = to_rgba(bad)
+ if under is not None:
+ if not np.iterable(under) or len(under) != len(new_cm):
+ raise ValueError("*under* must contain a color for each scalar colormap"
+ f" i.e. be of length {len(new_cm)}.")
+ else:
+ for c, b in zip(new_cm, under):
+ c.set_under(b)
+ if over is not None:
+ if not np.iterable(over) or len(over) != len(new_cm):
+ raise ValueError("*over* must contain a color for each scalar colormap"
+ f" i.e. be of length {len(new_cm)}.")
+ else:
+ for c, b in zip(new_cm, over):
+ c.set_over(b)
+ return new_cm
+
+ @property
+ def combination_mode(self):
+ return self._combination_mode
+
+ def _repr_png_(self):
+ """Generate a PNG representation of the Colormap."""
+ X = np.tile(np.linspace(0, 1, _REPR_PNG_SIZE[0]),
+ (_REPR_PNG_SIZE[1], 1))
+ pixels = np.zeros((_REPR_PNG_SIZE[1]*len(self), _REPR_PNG_SIZE[0], 4),
+ dtype=np.uint8)
+ for i, c in enumerate(self):
+ pixels[i*_REPR_PNG_SIZE[1]:(i+1)*_REPR_PNG_SIZE[1], :] = c(X, bytes=True)
+ png_bytes = io.BytesIO()
+ title = self.name + ' multivariate colormap'
+ author = f'Matplotlib v{mpl.__version__}, https://matplotlib.org'
+ pnginfo = PngInfo()
+ pnginfo.add_text('Title', title)
+ pnginfo.add_text('Description', title)
+ pnginfo.add_text('Author', author)
+ pnginfo.add_text('Software', author)
+ Image.fromarray(pixels).save(png_bytes, format='png', pnginfo=pnginfo)
+ return png_bytes.getvalue()
+
+ def _repr_html_(self):
+ """Generate an HTML representation of the MultivarColormap."""
+ return ''.join([c._repr_html_() for c in self._colormaps])
+
+
+class BivarColormap:
+ """
+ Base class for all bivariate to RGBA mappings.
+
+ Designed as a drop-in replacement for Colormap when using a 2D
+ lookup table. To be used with `~matplotlib.cm.ScalarMappable`.
+ """
+
+ def __init__(self, N=256, M=256, shape='square', origin=(0, 0),
+ name='bivariate colormap'):
+ """
+ Parameters
+ ----------
+ N : int, default: 256
+ The number of RGB quantization levels along the first axis.
+ M : int, default: 256
+ The number of RGB quantization levels along the second axis.
+ shape : {'square', 'circle', 'ignore', 'circleignore'}
+
+ - 'square' each variate is clipped to [0,1] independently
+ - 'circle' the variates are clipped radially to the center
+ of the colormap, and a circular mask is applied when the colormap
+ is displayed
+ - 'ignore' the variates are not clipped, but instead assigned the
+ 'outside' color
+ - 'circleignore' a circular mask is applied, but the data is not
+ clipped and instead assigned the 'outside' color
+
+ origin : (float, float), default: (0,0)
+ The relative origin of the colormap. Typically (0, 0), for colormaps
+ that are linear on both axis, and (.5, .5) for circular colormaps.
+ Used when getting 1D colormaps from 2D colormaps.
+ name : str, optional
+ The name of the colormap.
+ """
+
+ self.name = name
+ self.N = int(N) # ensure that N is always int
+ self.M = int(M)
+ _api.check_in_list(['square', 'circle', 'ignore', 'circleignore'], shape=shape)
+ self._shape = shape
+ self._rgba_bad = (0.0, 0.0, 0.0, 0.0) # If bad, don't paint anything.
+ self._rgba_outside = (1.0, 0.0, 1.0, 1.0)
+ self._isinit = False
+ self.n_variates = 2
+ self._origin = (float(origin[0]), float(origin[1]))
+ '''#: When this colormap exists on a scalar mappable and colorbar_extend
+ #: is not False, colorbar creation will pick up ``colorbar_extend`` as
+ #: the default value for the ``extend`` keyword in the
+ #: `matplotlib.colorbar.Colorbar` constructor.
+ self.colorbar_extend = False'''
+
+ def __call__(self, X, alpha=None, bytes=False):
+ r"""
+ Parameters
+ ----------
+ X : tuple (X0, X1), X0 and X1: float or int or array-like
+ The data value(s) to convert to RGBA.
+
+ - For floats, *X* should be in the interval ``[0.0, 1.0]`` to
+ return the RGBA values ``X*100`` percent along the Colormap.
+ - For integers, *X* should be in the interval ``[0, Colormap.N)`` to
+ return RGBA values *indexed* from the Colormap with index ``X``.
+
+ alpha : float or array-like or None, default: None
+ Alpha must be a scalar between 0 and 1, a sequence of such
+ floats with shape matching X0, or None.
+ bytes : bool, default: False
+ If False (default), the returned RGBA values will be floats in the
+ interval ``[0, 1]`` otherwise they will be `numpy.uint8`\s in the
+ interval ``[0, 255]``.
+
+ Returns
+ -------
+ Tuple of RGBA values if X is scalar, otherwise an array of
+ RGBA values with a shape of ``X.shape + (4, )``.
+ """
+
+ if len(X) != 2:
+ raise ValueError(
+ f'For a `BivarColormap` the data must have a first dimension '
+ f'2, not {len(X)}')
+
+ if not self._isinit:
+ self._init()
+
+ X0 = np.ma.array(X[0], copy=True)
+ X1 = np.ma.array(X[1], copy=True)
+ # clip to shape of colormap, circle square, etc.
+ self._clip((X0, X1))
+
+ # Native byteorder is faster.
+ if not X0.dtype.isnative:
+ X0 = X0.byteswap().view(X0.dtype.newbyteorder())
+ if not X1.dtype.isnative:
+ X1 = X1.byteswap().view(X1.dtype.newbyteorder())
+
+ if X0.dtype.kind == "f":
+ X0 *= self.N
+ # xa == 1 (== N after multiplication) is not out of range.
+ X0[X0 == self.N] = self.N - 1
+
+ if X1.dtype.kind == "f":
+ X1 *= self.M
+ # xa == 1 (== N after multiplication) is not out of range.
+ X1[X1 == self.M] = self.M - 1
+
+ # Pre-compute the masks before casting to int (which can truncate)
+ mask_outside = (X0 < 0) | (X1 < 0) | (X0 >= self.N) | (X1 >= self.M)
+ # If input was masked, get the bad mask from it; else mask out nans.
+ mask_bad_0 = X0.mask if np.ma.is_masked(X0) else np.isnan(X0)
+ mask_bad_1 = X1.mask if np.ma.is_masked(X1) else np.isnan(X1)
+ mask_bad = mask_bad_0 | mask_bad_1
+
+ with np.errstate(invalid="ignore"):
+ # We need this cast for unsigned ints as well as floats
+ X0 = X0.astype(int)
+ X1 = X1.astype(int)
+
+ # Set masked values to zero
+ # The corresponding rgb values will be replaced later
+ for X_part in [X0, X1]:
+ X_part[mask_outside] = 0
+ X_part[mask_bad] = 0
+
+ rgba = self._lut[X0, X1]
+ if np.isscalar(X[0]):
+ rgba = np.copy(rgba)
+ rgba[mask_outside] = self._rgba_outside
+ rgba[mask_bad] = self._rgba_bad
+ if bytes:
+ rgba = (rgba * 255).astype(np.uint8)
+ if alpha is not None:
+ alpha = np.clip(alpha, 0, 1)
+ if bytes:
+ alpha *= 255 # Will be cast to uint8 upon assignment.
+ if np.shape(alpha) not in [(), np.shape(X0)]:
+ raise ValueError(
+ f"alpha is array-like but its shape {np.shape(alpha)} does "
+ f"not match that of X[0] {np.shape(X0)}")
+ rgba[..., -1] = alpha
+ # If the "bad" color is all zeros, then ignore alpha input.
+ if (np.array(self._rgba_bad) == 0).all():
+ rgba[mask_bad] = (0, 0, 0, 0)
+
+ if not np.iterable(X[0]):
+ rgba = tuple(rgba)
+ return rgba
+
+ @property
+ def lut(self):
+ """
+ For external access to the lut, i.e. for displaying the cmap.
+ For circular colormaps this returns a lut with a circular mask.
+
+ Internal functions (such as to_rgb()) should use _lut
+ which stores the lut without a circular mask
+ A lut without the circular mask is needed in to_rgb() because the
+ conversion from floats to ints results in some some pixel-requests
+ just outside of the circular mask
+
+ """
+ if not self._isinit:
+ self._init()
+ lut = np.copy(self._lut)
+ if self.shape == 'circle' or self.shape == 'circleignore':
+ n = np.linspace(-1, 1, self.N)
+ m = np.linspace(-1, 1, self.M)
+ radii_sqr = (n**2)[:, np.newaxis] + (m**2)[np.newaxis, :]
+ mask_outside = radii_sqr > 1
+ lut[mask_outside, 3] = 0
+ return lut
+
+ def __copy__(self):
+ cls = self.__class__
+ cmapobject = cls.__new__(cls)
+ cmapobject.__dict__.update(self.__dict__)
+
+ cmapobject._rgba_outside = np.copy(self._rgba_outside)
+ cmapobject._rgba_bad = np.copy(self._rgba_bad)
+ cmapobject._shape = self.shape
+ if self._isinit:
+ cmapobject._lut = np.copy(self._lut)
+ return cmapobject
+
+ def __eq__(self, other):
+ if not isinstance(other, BivarColormap):
+ return False
+ # To compare lookup tables the Colormaps have to be initialized
+ if not self._isinit:
+ self._init()
+ if not other._isinit:
+ other._init()
+ if not np.array_equal(self._lut, other._lut):
+ return False
+ if not np.array_equal(self._rgba_bad, other._rgba_bad):
+ return False
+ if not np.array_equal(self._rgba_outside, other._rgba_outside):
+ return False
+ if self.shape != other.shape:
+ return False
+ return True
+
+ def get_bad(self):
+ """Get the color for masked values."""
+ return self._rgba_bad
+
+ def get_outside(self):
+ """Get the color for out-of-range values."""
+ return self._rgba_outside
+
+ def resampled(self, lutshape, transposed=False):
+ """
+ Return a new colormap with *lutshape* entries.
+
+ Note that this function does not move the origin.
+
+ Parameters
+ ----------
+ lutshape : tuple of ints or None
+ The tuple must be of length 2, and each entry is either an int or None.
+
+ - If an int, the corresponding axis is resampled.
+ - If negative the corresponding axis is resampled in reverse
+ - If -1, the axis is inverted
+ - If 1 or None, the corresponding axis is not resampled.
+
+ transposed : bool, default: False
+ if True, the axes are swapped after resampling
+
+ Returns
+ -------
+ BivarColormap
+ """
+
+ if not np.iterable(lutshape) or len(lutshape) != 2:
+ raise ValueError("lutshape must be of length 2")
+ lutshape = [lutshape[0], lutshape[1]]
+ if lutshape[0] is None or lutshape[0] == 1:
+ lutshape[0] = self.N
+ if lutshape[1] is None or lutshape[1] == 1:
+ lutshape[1] = self.M
+
+ inverted = [False, False]
+ if lutshape[0] < 0:
+ inverted[0] = True
+ lutshape[0] = -lutshape[0]
+ if lutshape[0] == 1:
+ lutshape[0] = self.N
+ if lutshape[1] < 0:
+ inverted[1] = True
+ lutshape[1] = -lutshape[1]
+ if lutshape[1] == 1:
+ lutshape[1] = self.M
+ x_0, x_1 = np.mgrid[0:1:(lutshape[0] * 1j), 0:1:(lutshape[1] * 1j)]
+ if inverted[0]:
+ x_0 = x_0[::-1, :]
+ if inverted[1]:
+ x_1 = x_1[:, ::-1]
+
+ # we need to use shape = 'square' while resampling the colormap.
+ # if the colormap has shape = 'circle' we would otherwise get *outside* in the
+ # resampled colormap
+ shape_memory = self._shape
+ self._shape = 'square'
+ if transposed:
+ new_lut = self((x_1, x_0))
+ new_cmap = BivarColormapFromImage(new_lut, name=self.name,
+ shape=shape_memory,
+ origin=self.origin[::-1])
+ else:
+ new_lut = self((x_0, x_1))
+ new_cmap = BivarColormapFromImage(new_lut, name=self.name,
+ shape=shape_memory,
+ origin=self.origin)
+ self._shape = shape_memory
+
+ new_cmap._rgba_bad = self._rgba_bad
+ new_cmap._rgba_outside = self._rgba_outside
+ return new_cmap
+
+ def reversed(self, axis_0=True, axis_1=True):
+ """
+ Reverses both or one of the axis.
+ """
+ r_0 = -1 if axis_0 else 1
+ r_1 = -1 if axis_1 else 1
+ return self.resampled((r_0, r_1))
+
+ def transposed(self):
+ """
+ Transposes the colormap by swapping the order of the axis
+ """
+ return self.resampled((None, None), transposed=True)
+
+ def with_extremes(self, *, bad=None, outside=None, shape=None, origin=None):
+ """
+ Return a copy of the `BivarColormap` with modified attributes.
+
+ Note that the *outside* color is only relevant if `shape` = 'ignore'
+ or 'circleignore'.
+
+ Parameters
+ ----------
+ bad : None or :mpltype:`color`
+ If Matplotlib color, the *bad* value is set accordingly in the copy
+
+ outside : None or :mpltype:`color`
+ If Matplotlib color and shape is 'ignore' or 'circleignore', values
+ *outside* the colormap are colored accordingly in the copy
+
+ shape : {'square', 'circle', 'ignore', 'circleignore'}
+
+ - If 'square' each variate is clipped to [0,1] independently
+ - If 'circle' the variates are clipped radially to the center
+ of the colormap, and a circular mask is applied when the colormap
+ is displayed
+ - If 'ignore' the variates are not clipped, but instead assigned the
+ *outside* color
+ - If 'circleignore' a circular mask is applied, but the data is not
+ clipped and instead assigned the *outside* color
+
+ origin : (float, float)
+ The relative origin of the colormap. Typically (0, 0), for colormaps
+ that are linear on both axis, and (.5, .5) for circular colormaps.
+ Used when getting 1D colormaps from 2D colormaps.
+
+ Returns
+ -------
+ BivarColormap
+ copy of self with attributes set
+ """
+ new_cm = self.copy()
+ if bad is not None:
+ new_cm._rgba_bad = to_rgba(bad)
+ if outside is not None:
+ new_cm._rgba_outside = to_rgba(outside)
+ if shape is not None:
+ _api.check_in_list(['square', 'circle', 'ignore', 'circleignore'],
+ shape=shape)
+ new_cm._shape = shape
+ if origin is not None:
+ new_cm._origin = (float(origin[0]), float(origin[1]))
+
+ return new_cm
+
+ def _init(self):
+ """Generate the lookup table, ``self._lut``."""
+ raise NotImplementedError("Abstract class only")
+
+ @property
+ def shape(self):
+ return self._shape
+
+ @property
+ def origin(self):
+ return self._origin
+
+ def _clip(self, X):
+ """
+ For internal use when applying a BivarColormap to data.
+ i.e. cm.ScalarMappable().to_rgba()
+ Clips X[0] and X[1] according to 'self.shape'.
+ X is modified in-place.
+
+ Parameters
+ ----------
+ X: np.array
+ array of floats or ints to be clipped
+ shape : {'square', 'circle', 'ignore', 'circleignore'}
+
+ - If 'square' each variate is clipped to [0,1] independently
+ - If 'circle' the variates are clipped radially to the center
+ of the colormap.
+ It is assumed that a circular mask is applied when the colormap
+ is displayed
+ - If 'ignore' the variates are not clipped, but instead assigned the
+ 'outside' color
+ - If 'circleignore' a circular mask is applied, but the data is not clipped
+ and instead assigned the 'outside' color
+
+ """
+ if self.shape == 'square':
+ for X_part, mx in zip(X, (self.N, self.M)):
+ X_part[X_part < 0] = 0
+ if X_part.dtype.kind == "f":
+ X_part[X_part > 1] = 1
+ else:
+ X_part[X_part >= mx] = mx - 1
+
+ elif self.shape == 'ignore':
+ for X_part, mx in zip(X, (self.N, self.M)):
+ X_part[X_part < 0] = -1
+ if X_part.dtype.kind == "f":
+ X_part[X_part > 1] = -1
+ else:
+ X_part[X_part >= mx] = -1
+
+ elif self.shape == 'circle' or self.shape == 'circleignore':
+ for X_part in X:
+ if X_part.dtype.kind != "f":
+ raise NotImplementedError(
+ "Circular bivariate colormaps are only"
+ " implemented for use with with floats")
+ radii_sqr = (X[0] - 0.5)**2 + (X[1] - 0.5)**2
+ mask_outside = radii_sqr > 0.25
+ if self.shape == 'circle':
+ overextend = 2 * np.sqrt(radii_sqr[mask_outside])
+ X[0][mask_outside] = (X[0][mask_outside] - 0.5) / overextend + 0.5
+ X[1][mask_outside] = (X[1][mask_outside] - 0.5) / overextend + 0.5
+ else:
+ X[0][mask_outside] = -1
+ X[1][mask_outside] = -1
+
+ def __getitem__(self, item):
+ """Creates and returns a colorbar along the selected axis"""
+ if not self._isinit:
+ self._init()
+ if item == 0:
+ origin_1_as_int = int(self._origin[1]*self.M)
+ if origin_1_as_int > self.M-1:
+ origin_1_as_int = self.M-1
+ one_d_lut = self._lut[:, origin_1_as_int]
+ new_cmap = ListedColormap(one_d_lut, name=f'{self.name}_0', N=self.N)
+
+ elif item == 1:
+ origin_0_as_int = int(self._origin[0]*self.N)
+ if origin_0_as_int > self.N-1:
+ origin_0_as_int = self.N-1
+ one_d_lut = self._lut[origin_0_as_int, :]
+ new_cmap = ListedColormap(one_d_lut, name=f'{self.name}_1', N=self.M)
+ else:
+ raise KeyError(f"only 0 or 1 are"
+ f" valid keys for BivarColormap, not {item!r}")
+ new_cmap._rgba_bad = self._rgba_bad
+ if self.shape in ['ignore', 'circleignore']:
+ new_cmap.set_over(self._rgba_outside)
+ new_cmap.set_under(self._rgba_outside)
+ return new_cmap
+
+ def _repr_png_(self):
+ """Generate a PNG representation of the BivarColormap."""
+ if not self._isinit:
+ self._init()
+ pixels = self.lut
+ if pixels.shape[0] < _BIVAR_REPR_PNG_SIZE:
+ pixels = np.repeat(pixels,
+ repeats=_BIVAR_REPR_PNG_SIZE//pixels.shape[0],
+ axis=0)[:256, :]
+ if pixels.shape[1] < _BIVAR_REPR_PNG_SIZE:
+ pixels = np.repeat(pixels,
+ repeats=_BIVAR_REPR_PNG_SIZE//pixels.shape[1],
+ axis=1)[:, :256]
+ pixels = (pixels[::-1, :, :] * 255).astype(np.uint8)
+ png_bytes = io.BytesIO()
+ title = self.name + ' BivarColormap'
+ author = f'Matplotlib v{mpl.__version__}, https://matplotlib.org'
+ pnginfo = PngInfo()
+ pnginfo.add_text('Title', title)
+ pnginfo.add_text('Description', title)
+ pnginfo.add_text('Author', author)
+ pnginfo.add_text('Software', author)
+ Image.fromarray(pixels).save(png_bytes, format='png', pnginfo=pnginfo)
+ return png_bytes.getvalue()
+
+ def _repr_html_(self):
+ """Generate an HTML representation of the Colormap."""
+ png_bytes = self._repr_png_()
+ png_base64 = base64.b64encode(png_bytes).decode('ascii')
+ def color_block(color):
+ hex_color = to_hex(color, keep_alpha=True)
+ return (f'
')
+
+ return (''
+ f'{self.name} '
+ '
'
+ ''
+ ''
+ '
'
+ f'{color_block(self.get_outside())} outside'
+ '
'
+ '
'
+ f'bad {color_block(self.get_bad())}'
+ '
')
+
+ def copy(self):
+ """Return a copy of the colormap."""
+ return self.__copy__()
+
+
+class SegmentedBivarColormap(BivarColormap):
+ """
+ BivarColormap object generated by supersampling a regular grid.
+
+ Parameters
+ ----------
+ patch : np.array
+ Patch is required to have a shape (k, l, 3), and will get supersampled
+ to a lut of shape (N, N, 4).
+ N : int
+ The number of RGB quantization levels along each axis.
+ shape : {'square', 'circle', 'ignore', 'circleignore'}
+
+ - If 'square' each variate is clipped to [0,1] independently
+ - If 'circle' the variates are clipped radially to the center
+ of the colormap, and a circular mask is applied when the colormap
+ is displayed
+ - If 'ignore' the variates are not clipped, but instead assigned the
+ 'outside' color
+ - If 'circleignore' a circular mask is applied, but the data is not clipped
+
+ origin : (float, float)
+ The relative origin of the colormap. Typically (0, 0), for colormaps
+ that are linear on both axis, and (.5, .5) for circular colormaps.
+ Used when getting 1D colormaps from 2D colormaps.
+
+ name : str, optional
+ The name of the colormap.
+ """
+
+ def __init__(self, patch, N=256, shape='square', origin=(0, 0),
+ name='segmented bivariate colormap'):
+ _api.check_shape((None, None, 3), patch=patch)
+ self.patch = patch
+ super().__init__(N, N, shape, origin, name=name)
+
+ def _init(self):
+ s = self.patch.shape
+ _patch = np.empty((s[0], s[1], 4))
+ _patch[:, :, :3] = self.patch
+ _patch[:, :, 3] = 1
+ transform = mpl.transforms.Affine2D().translate(-0.5, -0.5)\
+ .scale(self.N / (s[1] - 1), self.N / (s[0] - 1))
+ self._lut = np.empty((self.N, self.N, 4))
+
+ _image.resample(_patch, self._lut, transform, _image.BILINEAR,
+ resample=False, alpha=1)
+ self._isinit = True
+
+
+class BivarColormapFromImage(BivarColormap):
+ """
+ BivarColormap object generated by supersampling a regular grid.
+
+ Parameters
+ ----------
+ lut : nparray of shape (N, M, 3) or (N, M, 4)
+ The look-up-table
+ shape: {'square', 'circle', 'ignore', 'circleignore'}
+
+ - If 'square' each variate is clipped to [0,1] independently
+ - If 'circle' the variates are clipped radially to the center
+ of the colormap, and a circular mask is applied when the colormap
+ is displayed
+ - If 'ignore' the variates are not clipped, but instead assigned the
+ 'outside' color
+ - If 'circleignore' a circular mask is applied, but the data is not clipped
+
+ origin: (float, float)
+ The relative origin of the colormap. Typically (0, 0), for colormaps
+ that are linear on both axis, and (.5, .5) for circular colormaps.
+ Used when getting 1D colormaps from 2D colormaps.
+ name : str, optional
+ The name of the colormap.
+
+ """
+
+ def __init__(self, lut, shape='square', origin=(0, 0), name='from image'):
+ # We can allow for a PIL.Image as input in the following way, but importing
+ # matplotlib.image.pil_to_array() results in a circular import
+ # For now, this function only accepts numpy arrays.
+ # i.e.:
+ # if isinstance(Image, lut):
+ # lut = image.pil_to_array(lut)
+ lut = np.array(lut, copy=True)
+ if lut.ndim != 3 or lut.shape[2] not in (3, 4):
+ raise ValueError("The lut must be an array of shape (n, m, 3) or (n, m, 4)",
+ " or a PIL.image encoded as RGB or RGBA")
+
+ if lut.dtype == np.uint8:
+ lut = lut.astype(np.float32)/255
+ if lut.shape[2] == 3:
+ new_lut = np.empty((lut.shape[0], lut.shape[1], 4), dtype=lut.dtype)
+ new_lut[:, :, :3] = lut
+ new_lut[:, :, 3] = 1.
+ lut = new_lut
+ self._lut = lut
+ super().__init__(lut.shape[0], lut.shape[1], shape, origin, name=name)
+
+ def _init(self):
+ self._isinit = True
+
+
+class Normalize:
+ """
+ A class which, when called, maps values within the interval
+ ``[vmin, vmax]`` linearly to the interval ``[0.0, 1.0]``. The mapping of
+ values outside ``[vmin, vmax]`` depends on *clip*.
+
+ Examples
+ --------
+ ::
+
+ x = [-2, -1, 0, 1, 2]
+
+ norm = mpl.colors.Normalize(vmin=-1, vmax=1, clip=False)
+ norm(x) # [-0.5, 0., 0.5, 1., 1.5]
+ norm = mpl.colors.Normalize(vmin=-1, vmax=1, clip=True)
+ norm(x) # [0., 0., 0.5, 1., 1.]
+
+ See Also
+ --------
+ :ref:`colormapnorms`
+ """
+
+ def __init__(self, vmin=None, vmax=None, clip=False):
+ """
+ Parameters
+ ----------
+ vmin, vmax : float or None
+ Values within the range ``[vmin, vmax]`` from the input data will be
+ linearly mapped to ``[0, 1]``. If either *vmin* or *vmax* is not
+ provided, they default to the minimum and maximum values of the input,
+ respectively.
+
+ clip : bool, default: False
+ Determines the behavior for mapping values outside the range
+ ``[vmin, vmax]``.
+
+ If clipping is off, values outside the range ``[vmin, vmax]`` are
+ also transformed, resulting in values outside ``[0, 1]``. This
+ behavior is usually desirable, as colormaps can mark these *under*
+ and *over* values with specific colors.
+
+ If clipping is on, values below *vmin* are mapped to 0 and values
+ above *vmax* are mapped to 1. Such values become indistinguishable
+ from regular boundary values, which may cause misinterpretation of
+ the data.
+
+ Notes
+ -----
+ If ``vmin == vmax``, input data will be mapped to 0.
+ """
+ self._vmin = _sanitize_extrema(vmin)
+ self._vmax = _sanitize_extrema(vmax)
+ self._clip = clip
+ self._scale = None
+ self.callbacks = cbook.CallbackRegistry(signals=["changed"])
+
+ @property
+ def vmin(self):
+ return self._vmin
+
+ @vmin.setter
+ def vmin(self, value):
+ value = _sanitize_extrema(value)
+ if value != self._vmin:
+ self._vmin = value
+ self._changed()
+
+ @property
+ def vmax(self):
+ return self._vmax
+
+ @vmax.setter
+ def vmax(self, value):
+ value = _sanitize_extrema(value)
+ if value != self._vmax:
+ self._vmax = value
+ self._changed()
+
+ @property
+ def clip(self):
+ return self._clip
+
+ @clip.setter
+ def clip(self, value):
+ if value != self._clip:
+ self._clip = value
+ self._changed()
+
+ def _changed(self):
+ """
+ Call this whenever the norm is changed to notify all the
+ callback listeners to the 'changed' signal.
+ """
+ self.callbacks.process('changed')
+
+ @staticmethod
+ def process_value(value):
+ """
+ Homogenize the input *value* for easy and efficient normalization.
+
+ *value* can be a scalar or sequence.
+
+ Parameters
+ ----------
+ value
+ Data to normalize.
+
+ Returns
+ -------
+ result : masked array
+ Masked array with the same shape as *value*.
+ is_scalar : bool
+ Whether *value* is a scalar.
+
+ Notes
+ -----
+ Float dtypes are preserved; integer types with two bytes or smaller are
+ converted to np.float32, and larger types are converted to np.float64.
+ Preserving float32 when possible, and using in-place operations,
+ greatly improves speed for large arrays.
+ """
+ is_scalar = not np.iterable(value)
+ if is_scalar:
+ value = [value]
+ dtype = np.min_scalar_type(value)
+ if np.issubdtype(dtype, np.integer) or dtype.type is np.bool_:
+ # bool_/int8/int16 -> float32; int32/int64 -> float64
+ dtype = np.promote_types(dtype, np.float32)
+ # ensure data passed in as an ndarray subclass are interpreted as
+ # an ndarray. See issue #6622.
+ mask = np.ma.getmask(value)
+ data = np.asarray(value)
+ result = np.ma.array(data, mask=mask, dtype=dtype, copy=True)
+ return result, is_scalar
+
+ def __call__(self, value, clip=None):
+ """
+ Normalize the data and return the normalized data.
+
+ Parameters
+ ----------
+ value
+ Data to normalize.
+ clip : bool, optional
+ See the description of the parameter *clip* in `.Normalize`.
+
+ If ``None``, defaults to ``self.clip`` (which defaults to
+ ``False``).
+
+ Notes
+ -----
+ If not already initialized, ``self.vmin`` and ``self.vmax`` are
+ initialized using ``self.autoscale_None(value)``.
+ """
+ if clip is None:
+ clip = self.clip
+
+ result, is_scalar = self.process_value(value)
+
+ if self.vmin is None or self.vmax is None:
+ self.autoscale_None(result)
+ # Convert at least to float, without losing precision.
+ (vmin,), _ = self.process_value(self.vmin)
+ (vmax,), _ = self.process_value(self.vmax)
+ if vmin == vmax:
+ result.fill(0) # Or should it be all masked? Or 0.5?
+ elif vmin > vmax:
+ raise ValueError("minvalue must be less than or equal to maxvalue")
+ else:
+ if clip:
+ mask = np.ma.getmask(result)
+ result = np.ma.array(np.clip(result.filled(vmax), vmin, vmax),
+ mask=mask)
+ # ma division is very slow; we can take a shortcut
+ resdat = result.data
+ resdat -= vmin
+ resdat /= (vmax - vmin)
+ result = np.ma.array(resdat, mask=result.mask, copy=False)
+ if is_scalar:
+ result = result[0]
+ return result
+
+ def inverse(self, value):
+ """
+ Maps the normalized value (i.e., index in the colormap) back to image
+ data value.
+
+ Parameters
+ ----------
+ value
+ Normalized value.
+ """
+ if not self.scaled():
+ raise ValueError("Not invertible until both vmin and vmax are set")
+ (vmin,), _ = self.process_value(self.vmin)
+ (vmax,), _ = self.process_value(self.vmax)
+
+ if np.iterable(value):
+ val = np.ma.asarray(value)
+ return vmin + val * (vmax - vmin)
+ else:
+ return vmin + value * (vmax - vmin)
+
+ def autoscale(self, A):
+ """Set *vmin*, *vmax* to min, max of *A*."""
+ with self.callbacks.blocked():
+ # Pause callbacks while we are updating so we only get
+ # a single update signal at the end
+ self.vmin = self.vmax = None
+ self.autoscale_None(A)
+ self._changed()
+
+ def autoscale_None(self, A):
+ """If *vmin* or *vmax* are not set, use the min/max of *A* to set them."""
+ A = np.asanyarray(A)
+
+ if isinstance(A, np.ma.MaskedArray):
+ # we need to make the distinction between an array, False, np.bool_(False)
+ if A.mask is False or not A.mask.shape:
+ A = A.data
+
+ if self.vmin is None and A.size:
+ self.vmin = A.min()
+ if self.vmax is None and A.size:
+ self.vmax = A.max()
+
+ def scaled(self):
+ """Return whether *vmin* and *vmax* are both set."""
+ return self.vmin is not None and self.vmax is not None
+
+
+class TwoSlopeNorm(Normalize):
+ def __init__(self, vcenter, vmin=None, vmax=None):
+ """
+ Normalize data with a set center.
+
+ Useful when mapping data with an unequal rates of change around a
+ conceptual center, e.g., data that range from -2 to 4, with 0 as
+ the midpoint.
+
+ Parameters
+ ----------
+ vcenter : float
+ The data value that defines ``0.5`` in the normalization.
+ vmin : float, optional
+ The data value that defines ``0.0`` in the normalization.
+ Defaults to the min value of the dataset.
+ vmax : float, optional
+ The data value that defines ``1.0`` in the normalization.
+ Defaults to the max value of the dataset.
+
+ Examples
+ --------
+ This maps data value -4000 to 0., 0 to 0.5, and +10000 to 1.0; data
+ between is linearly interpolated::
+
+ >>> import matplotlib.colors as mcolors
+ >>> offset = mcolors.TwoSlopeNorm(vmin=-4000.,
+ ... vcenter=0., vmax=10000)
+ >>> data = [-4000., -2000., 0., 2500., 5000., 7500., 10000.]
+ >>> offset(data)
+ array([0., 0.25, 0.5, 0.625, 0.75, 0.875, 1.0])
+ """
+
+ super().__init__(vmin=vmin, vmax=vmax)
+ self._vcenter = vcenter
+ if vcenter is not None and vmax is not None and vcenter >= vmax:
+ raise ValueError('vmin, vcenter, and vmax must be in '
+ 'ascending order')
+ if vcenter is not None and vmin is not None and vcenter <= vmin:
+ raise ValueError('vmin, vcenter, and vmax must be in '
+ 'ascending order')
+
+ @property
+ def vcenter(self):
+ return self._vcenter
+
+ @vcenter.setter
+ def vcenter(self, value):
+ if value != self._vcenter:
+ self._vcenter = value
+ self._changed()
+
+ def autoscale_None(self, A):
+ """
+ Get vmin and vmax.
+
+ If vcenter isn't in the range [vmin, vmax], either vmin or vmax
+ is expanded so that vcenter lies in the middle of the modified range
+ [vmin, vmax].
+ """
+ super().autoscale_None(A)
+ if self.vmin >= self.vcenter:
+ self.vmin = self.vcenter - (self.vmax - self.vcenter)
+ if self.vmax <= self.vcenter:
+ self.vmax = self.vcenter + (self.vcenter - self.vmin)
+
+ def __call__(self, value, clip=None):
+ """
+ Map value to the interval [0, 1]. The *clip* argument is unused.
+ """
+ result, is_scalar = self.process_value(value)
+ self.autoscale_None(result) # sets self.vmin, self.vmax if None
+
+ if not self.vmin <= self.vcenter <= self.vmax:
+ raise ValueError("vmin, vcenter, vmax must increase monotonically")
+ # note that we must extrapolate for tick locators:
+ result = np.ma.masked_array(
+ np.interp(result, [self.vmin, self.vcenter, self.vmax],
+ [0, 0.5, 1], left=-np.inf, right=np.inf),
+ mask=np.ma.getmask(result))
+ if is_scalar:
+ result = np.atleast_1d(result)[0]
+ return result
+
+ def inverse(self, value):
+ if not self.scaled():
+ raise ValueError("Not invertible until both vmin and vmax are set")
+ (vmin,), _ = self.process_value(self.vmin)
+ (vmax,), _ = self.process_value(self.vmax)
+ (vcenter,), _ = self.process_value(self.vcenter)
+ result = np.interp(value, [0, 0.5, 1], [vmin, vcenter, vmax],
+ left=-np.inf, right=np.inf)
+ return result
+
+
+class CenteredNorm(Normalize):
+ def __init__(self, vcenter=0, halfrange=None, clip=False):
+ """
+ Normalize symmetrical data around a center (0 by default).
+
+ Unlike `TwoSlopeNorm`, `CenteredNorm` applies an equal rate of change
+ around the center.
+
+ Useful when mapping symmetrical data around a conceptual center
+ e.g., data that range from -2 to 4, with 0 as the midpoint, and
+ with equal rates of change around that midpoint.
+
+ Parameters
+ ----------
+ vcenter : float, default: 0
+ The data value that defines ``0.5`` in the normalization.
+ halfrange : float, optional
+ The range of data values that defines a range of ``0.5`` in the
+ normalization, so that *vcenter* - *halfrange* is ``0.0`` and
+ *vcenter* + *halfrange* is ``1.0`` in the normalization.
+ Defaults to the largest absolute difference to *vcenter* for
+ the values in the dataset.
+ clip : bool, default: False
+ Determines the behavior for mapping values outside the range
+ ``[vmin, vmax]``.
+
+ If clipping is off, values outside the range ``[vmin, vmax]`` are
+ also transformed, resulting in values outside ``[0, 1]``. This
+ behavior is usually desirable, as colormaps can mark these *under*
+ and *over* values with specific colors.
+
+ If clipping is on, values below *vmin* are mapped to 0 and values
+ above *vmax* are mapped to 1. Such values become indistinguishable
+ from regular boundary values, which may cause misinterpretation of
+ the data.
+
+ Examples
+ --------
+ This maps data values -2 to 0.25, 0 to 0.5, and 4 to 1.0
+ (assuming equal rates of change above and below 0.0):
+
+ >>> import matplotlib.colors as mcolors
+ >>> norm = mcolors.CenteredNorm(halfrange=4.0)
+ >>> data = [-2., 0., 4.]
+ >>> norm(data)
+ array([0.25, 0.5 , 1. ])
+ """
+ super().__init__(vmin=None, vmax=None, clip=clip)
+ self._vcenter = vcenter
+ # calling the halfrange setter to set vmin and vmax
+ self.halfrange = halfrange
+
+ def autoscale(self, A):
+ """
+ Set *halfrange* to ``max(abs(A-vcenter))``, then set *vmin* and *vmax*.
+ """
+ A = np.asanyarray(A)
+ self.halfrange = max(self._vcenter-A.min(),
+ A.max()-self._vcenter)
+
+ def autoscale_None(self, A):
+ """Set *vmin* and *vmax*."""
+ A = np.asanyarray(A)
+ if self.halfrange is None and A.size:
+ self.autoscale(A)
+
+ @property
+ def vmin(self):
+ return self._vmin
+
+ @vmin.setter
+ def vmin(self, value):
+ value = _sanitize_extrema(value)
+ if value != self._vmin:
+ self._vmin = value
+ self._vmax = 2*self.vcenter - value
+ self._changed()
+
+ @property
+ def vmax(self):
+ return self._vmax
+
+ @vmax.setter
+ def vmax(self, value):
+ value = _sanitize_extrema(value)
+ if value != self._vmax:
+ self._vmax = value
+ self._vmin = 2*self.vcenter - value
+ self._changed()
+
+ @property
+ def vcenter(self):
+ return self._vcenter
+
+ @vcenter.setter
+ def vcenter(self, vcenter):
+ if vcenter != self._vcenter:
+ self._vcenter = vcenter
+ # Trigger an update of the vmin/vmax values through the setter
+ self.halfrange = self.halfrange
+ self._changed()
+
+ @property
+ def halfrange(self):
+ if self.vmin is None or self.vmax is None:
+ return None
+ return (self.vmax - self.vmin) / 2
+
+ @halfrange.setter
+ def halfrange(self, halfrange):
+ if halfrange is None:
+ self.vmin = None
+ self.vmax = None
+ else:
+ self.vmin = self.vcenter - abs(halfrange)
+ self.vmax = self.vcenter + abs(halfrange)
+
+
+def make_norm_from_scale(scale_cls, base_norm_cls=None, *, init=None):
+ """
+ Decorator for building a `.Normalize` subclass from a `~.scale.ScaleBase`
+ subclass.
+
+ After ::
+
+ @make_norm_from_scale(scale_cls)
+ class norm_cls(Normalize):
+ ...
+
+ *norm_cls* is filled with methods so that normalization computations are
+ forwarded to *scale_cls* (i.e., *scale_cls* is the scale that would be used
+ for the colorbar of a mappable normalized with *norm_cls*).
+
+ If *init* is not passed, then the constructor signature of *norm_cls*
+ will be ``norm_cls(vmin=None, vmax=None, clip=False)``; these three
+ parameters will be forwarded to the base class (``Normalize.__init__``),
+ and a *scale_cls* object will be initialized with no arguments (other than
+ a dummy axis).
+
+ If the *scale_cls* constructor takes additional parameters, then *init*
+ should be passed to `make_norm_from_scale`. It is a callable which is
+ *only* used for its signature. First, this signature will become the
+ signature of *norm_cls*. Second, the *norm_cls* constructor will bind the
+ parameters passed to it using this signature, extract the bound *vmin*,
+ *vmax*, and *clip* values, pass those to ``Normalize.__init__``, and
+ forward the remaining bound values (including any defaults defined by the
+ signature) to the *scale_cls* constructor.
+ """
+
+ if base_norm_cls is None:
+ return functools.partial(make_norm_from_scale, scale_cls, init=init)
+
+ if isinstance(scale_cls, functools.partial):
+ scale_args = scale_cls.args
+ scale_kwargs_items = tuple(scale_cls.keywords.items())
+ scale_cls = scale_cls.func
+ else:
+ scale_args = scale_kwargs_items = ()
+
+ if init is None:
+ def init(vmin=None, vmax=None, clip=False): pass
+
+ return _make_norm_from_scale(
+ scale_cls, scale_args, scale_kwargs_items,
+ base_norm_cls, inspect.signature(init))
+
+
+@functools.cache
+def _make_norm_from_scale(
+ scale_cls, scale_args, scale_kwargs_items,
+ base_norm_cls, bound_init_signature,
+):
+ """
+ Helper for `make_norm_from_scale`.
+
+ This function is split out to enable caching (in particular so that
+ different unpickles reuse the same class). In order to do so,
+
+ - ``functools.partial`` *scale_cls* is expanded into ``func, args, kwargs``
+ to allow memoizing returned norms (partial instances always compare
+ unequal, but we can check identity based on ``func, args, kwargs``;
+ - *init* is replaced by *init_signature*, as signatures are picklable,
+ unlike to arbitrary lambdas.
+ """
+
+ class Norm(base_norm_cls):
+ def __reduce__(self):
+ cls = type(self)
+ # If the class is toplevel-accessible, it is possible to directly
+ # pickle it "by name". This is required to support norm classes
+ # defined at a module's toplevel, as the inner base_norm_cls is
+ # otherwise unpicklable (as it gets shadowed by the generated norm
+ # class). If either import or attribute access fails, fall back to
+ # the general path.
+ try:
+ if cls is getattr(importlib.import_module(cls.__module__),
+ cls.__qualname__):
+ return (_create_empty_object_of_class, (cls,), vars(self))
+ except (ImportError, AttributeError):
+ pass
+ return (_picklable_norm_constructor,
+ (scale_cls, scale_args, scale_kwargs_items,
+ base_norm_cls, bound_init_signature),
+ vars(self))
+
+ def __init__(self, *args, **kwargs):
+ ba = bound_init_signature.bind(*args, **kwargs)
+ ba.apply_defaults()
+ super().__init__(
+ **{k: ba.arguments.pop(k) for k in ["vmin", "vmax", "clip"]})
+ self._scale = functools.partial(
+ scale_cls, *scale_args, **dict(scale_kwargs_items))(
+ axis=None, **ba.arguments)
+ self._trf = self._scale.get_transform()
+
+ __init__.__signature__ = bound_init_signature.replace(parameters=[
+ inspect.Parameter("self", inspect.Parameter.POSITIONAL_OR_KEYWORD),
+ *bound_init_signature.parameters.values()])
+
+ def __call__(self, value, clip=None):
+ value, is_scalar = self.process_value(value)
+ if self.vmin is None or self.vmax is None:
+ self.autoscale_None(value)
+ if self.vmin > self.vmax:
+ raise ValueError("vmin must be less or equal to vmax")
+ if self.vmin == self.vmax:
+ return np.full_like(value, 0)
+ if clip is None:
+ clip = self.clip
+ if clip:
+ value = np.clip(value, self.vmin, self.vmax)
+ t_value = self._trf.transform(value).reshape(np.shape(value))
+ t_vmin, t_vmax = self._trf.transform([self.vmin, self.vmax])
+ if not np.isfinite([t_vmin, t_vmax]).all():
+ raise ValueError("Invalid vmin or vmax")
+ t_value -= t_vmin
+ t_value /= (t_vmax - t_vmin)
+ t_value = np.ma.masked_invalid(t_value, copy=False)
+ return t_value[0] if is_scalar else t_value
+
+ def inverse(self, value):
+ if not self.scaled():
+ raise ValueError("Not invertible until scaled")
+ if self.vmin > self.vmax:
+ raise ValueError("vmin must be less or equal to vmax")
+ t_vmin, t_vmax = self._trf.transform([self.vmin, self.vmax])
+ if not np.isfinite([t_vmin, t_vmax]).all():
+ raise ValueError("Invalid vmin or vmax")
+ value, is_scalar = self.process_value(value)
+ rescaled = value * (t_vmax - t_vmin)
+ rescaled += t_vmin
+ value = (self._trf
+ .inverted()
+ .transform(rescaled)
+ .reshape(np.shape(value)))
+ return value[0] if is_scalar else value
+
+ def autoscale_None(self, A):
+ # i.e. A[np.isfinite(...)], but also for non-array A's
+ in_trf_domain = np.extract(np.isfinite(self._trf.transform(A)), A)
+ if in_trf_domain.size == 0:
+ in_trf_domain = np.ma.masked
+ return super().autoscale_None(in_trf_domain)
+
+ if base_norm_cls is Normalize:
+ Norm.__name__ = f"{scale_cls.__name__}Norm"
+ Norm.__qualname__ = f"{scale_cls.__qualname__}Norm"
+ else:
+ Norm.__name__ = base_norm_cls.__name__
+ Norm.__qualname__ = base_norm_cls.__qualname__
+ Norm.__module__ = base_norm_cls.__module__
+ Norm.__doc__ = base_norm_cls.__doc__
+
+ return Norm
+
+
+def _create_empty_object_of_class(cls):
+ return cls.__new__(cls)
+
+
+def _picklable_norm_constructor(*args):
+ return _create_empty_object_of_class(_make_norm_from_scale(*args))
+
+
+@make_norm_from_scale(
+ scale.FuncScale,
+ init=lambda functions, vmin=None, vmax=None, clip=False: None)
+class FuncNorm(Normalize):
+ """
+ Arbitrary normalization using functions for the forward and inverse.
+
+ Parameters
+ ----------
+ functions : (callable, callable)
+ two-tuple of the forward and inverse functions for the normalization.
+ The forward function must be monotonic.
+
+ Both functions must have the signature ::
+
+ def forward(values: array-like) -> array-like
+
+ vmin, vmax : float or None
+ If *vmin* and/or *vmax* is not given, they are initialized from the
+ minimum and maximum value, respectively, of the first input
+ processed; i.e., ``__call__(A)`` calls ``autoscale_None(A)``.
+
+ clip : bool, default: False
+ Determines the behavior for mapping values outside the range
+ ``[vmin, vmax]``.
+
+ If clipping is off, values outside the range ``[vmin, vmax]`` are also
+ transformed by the function, resulting in values outside ``[0, 1]``.
+ This behavior is usually desirable, as colormaps can mark these *under*
+ and *over* values with specific colors.
+
+ If clipping is on, values below *vmin* are mapped to 0 and values above
+ *vmax* are mapped to 1. Such values become indistinguishable from
+ regular boundary values, which may cause misinterpretation of the data.
+ """
+
+
+LogNorm = make_norm_from_scale(
+ functools.partial(scale.LogScale, nonpositive="mask"))(Normalize)
+LogNorm.__name__ = LogNorm.__qualname__ = "LogNorm"
+LogNorm.__doc__ = "Normalize a given value to the 0-1 range on a log scale."
+
+
+@make_norm_from_scale(
+ scale.SymmetricalLogScale,
+ init=lambda linthresh, linscale=1., vmin=None, vmax=None, clip=False, *,
+ base=10: None)
+class SymLogNorm(Normalize):
+ """
+ The symmetrical logarithmic scale is logarithmic in both the
+ positive and negative directions from the origin.
+
+ Since the values close to zero tend toward infinity, there is a
+ need to have a range around zero that is linear. The parameter
+ *linthresh* allows the user to specify the size of this range
+ (-*linthresh*, *linthresh*).
+
+ Parameters
+ ----------
+ linthresh : float
+ The range within which the plot is linear (to avoid having the plot
+ go to infinity around zero).
+ linscale : float, default: 1
+ This allows the linear range (-*linthresh* to *linthresh*) to be
+ stretched relative to the logarithmic range. Its value is the
+ number of decades to use for each half of the linear range. For
+ example, when *linscale* == 1.0 (the default), the space used for
+ the positive and negative halves of the linear range will be equal
+ to one decade in the logarithmic range.
+ base : float, default: 10
+ """
+
+ @property
+ def linthresh(self):
+ return self._scale.linthresh
+
+ @linthresh.setter
+ def linthresh(self, value):
+ self._scale.linthresh = value
+
+
+@make_norm_from_scale(
+ scale.AsinhScale,
+ init=lambda linear_width=1, vmin=None, vmax=None, clip=False: None)
+class AsinhNorm(Normalize):
+ """
+ The inverse hyperbolic sine scale is approximately linear near
+ the origin, but becomes logarithmic for larger positive
+ or negative values. Unlike the `SymLogNorm`, the transition between
+ these linear and logarithmic regions is smooth, which may reduce
+ the risk of visual artifacts.
+
+ .. note::
+
+ This API is provisional and may be revised in the future
+ based on early user feedback.
+
+ Parameters
+ ----------
+ linear_width : float, default: 1
+ The effective width of the linear region, beyond which
+ the transformation becomes asymptotically logarithmic
+ """
+
+ @property
+ def linear_width(self):
+ return self._scale.linear_width
+
+ @linear_width.setter
+ def linear_width(self, value):
+ self._scale.linear_width = value
+
+
+class PowerNorm(Normalize):
+ r"""
+ Linearly map a given value to the 0-1 range and then apply
+ a power-law normalization over that range.
+
+ Parameters
+ ----------
+ gamma : float
+ Power law exponent.
+ vmin, vmax : float or None
+ If *vmin* and/or *vmax* is not given, they are initialized from the
+ minimum and maximum value, respectively, of the first input
+ processed; i.e., ``__call__(A)`` calls ``autoscale_None(A)``.
+ clip : bool, default: False
+ Determines the behavior for mapping values outside the range
+ ``[vmin, vmax]``.
+
+ If clipping is off, values above *vmax* are transformed by the power
+ function, resulting in values above 1, and values below *vmin* are linearly
+ transformed resulting in values below 0. This behavior is usually desirable, as
+ colormaps can mark these *under* and *over* values with specific colors.
+
+ If clipping is on, values below *vmin* are mapped to 0 and values above
+ *vmax* are mapped to 1. Such values become indistinguishable from
+ regular boundary values, which may cause misinterpretation of the data.
+
+ Notes
+ -----
+ The normalization formula is
+
+ .. math::
+
+ \left ( \frac{x - v_{min}}{v_{max} - v_{min}} \right )^{\gamma}
+
+ For input values below *vmin*, gamma is set to one.
+ """
+ def __init__(self, gamma, vmin=None, vmax=None, clip=False):
+ super().__init__(vmin, vmax, clip)
+ self.gamma = gamma
+
+ def __call__(self, value, clip=None):
+ if clip is None:
+ clip = self.clip
+
+ result, is_scalar = self.process_value(value)
+
+ self.autoscale_None(result)
+ gamma = self.gamma
+ vmin, vmax = self.vmin, self.vmax
+ if vmin > vmax:
+ raise ValueError("minvalue must be less than or equal to maxvalue")
+ elif vmin == vmax:
+ result.fill(0)
+ else:
+ if clip:
+ mask = np.ma.getmask(result)
+ result = np.ma.array(np.clip(result.filled(vmax), vmin, vmax),
+ mask=mask)
+ resdat = result.data
+ resdat -= vmin
+ resdat /= (vmax - vmin)
+ resdat[resdat > 0] = np.power(resdat[resdat > 0], gamma)
+
+ result = np.ma.array(resdat, mask=result.mask, copy=False)
+ if is_scalar:
+ result = result[0]
+ return result
+
+ def inverse(self, value):
+ if not self.scaled():
+ raise ValueError("Not invertible until scaled")
+
+ result, is_scalar = self.process_value(value)
+
+ gamma = self.gamma
+ vmin, vmax = self.vmin, self.vmax
+
+ resdat = result.data
+ resdat[resdat > 0] = np.power(resdat[resdat > 0], 1 / gamma)
+ resdat *= (vmax - vmin)
+ resdat += vmin
+
+ result = np.ma.array(resdat, mask=result.mask, copy=False)
+ if is_scalar:
+ result = result[0]
+ return result
+
+
+class BoundaryNorm(Normalize):
+ """
+ Generate a colormap index based on discrete intervals.
+
+ Unlike `Normalize` or `LogNorm`, `BoundaryNorm` maps values to integers
+ instead of to the interval 0-1.
+ """
+
+ # Mapping to the 0-1 interval could have been done via piece-wise linear
+ # interpolation, but using integers seems simpler, and reduces the number
+ # of conversions back and forth between int and float.
+
+ def __init__(self, boundaries, ncolors, clip=False, *, extend='neither'):
+ """
+ Parameters
+ ----------
+ boundaries : array-like
+ Monotonically increasing sequence of at least 2 bin edges: data
+ falling in the n-th bin will be mapped to the n-th color.
+
+ ncolors : int
+ Number of colors in the colormap to be used.
+
+ clip : bool, optional
+ If clip is ``True``, out of range values are mapped to 0 if they
+ are below ``boundaries[0]`` or mapped to ``ncolors - 1`` if they
+ are above ``boundaries[-1]``.
+
+ If clip is ``False``, out of range values are mapped to -1 if
+ they are below ``boundaries[0]`` or mapped to *ncolors* if they are
+ above ``boundaries[-1]``. These are then converted to valid indices
+ by `Colormap.__call__`.
+
+ extend : {'neither', 'both', 'min', 'max'}, default: 'neither'
+ Extend the number of bins to include one or both of the
+ regions beyond the boundaries. For example, if ``extend``
+ is 'min', then the color to which the region between the first
+ pair of boundaries is mapped will be distinct from the first
+ color in the colormap, and by default a
+ `~matplotlib.colorbar.Colorbar` will be drawn with
+ the triangle extension on the left or lower end.
+
+ Notes
+ -----
+ If there are fewer bins (including extensions) than colors, then the
+ color index is chosen by linearly interpolating the ``[0, nbins - 1]``
+ range onto the ``[0, ncolors - 1]`` range, effectively skipping some
+ colors in the middle of the colormap.
+ """
+ if clip and extend != 'neither':
+ raise ValueError("'clip=True' is not compatible with 'extend'")
+ super().__init__(vmin=boundaries[0], vmax=boundaries[-1], clip=clip)
+ self.boundaries = np.asarray(boundaries)
+ self.N = len(self.boundaries)
+ if self.N < 2:
+ raise ValueError("You must provide at least 2 boundaries "
+ f"(1 region) but you passed in {boundaries!r}")
+ self.Ncmap = ncolors
+ self.extend = extend
+
+ self._scale = None # don't use the default scale.
+
+ self._n_regions = self.N - 1 # number of colors needed
+ self._offset = 0
+ if extend in ('min', 'both'):
+ self._n_regions += 1
+ self._offset = 1
+ if extend in ('max', 'both'):
+ self._n_regions += 1
+ if self._n_regions > self.Ncmap:
+ raise ValueError(f"There are {self._n_regions} color bins "
+ "including extensions, but ncolors = "
+ f"{ncolors}; ncolors must equal or exceed the "
+ "number of bins")
+
+ def __call__(self, value, clip=None):
+ """
+ This method behaves similarly to `.Normalize.__call__`, except that it
+ returns integers or arrays of int16.
+ """
+ if clip is None:
+ clip = self.clip
+
+ xx, is_scalar = self.process_value(value)
+ mask = np.ma.getmaskarray(xx)
+ # Fill masked values a value above the upper boundary
+ xx = np.atleast_1d(xx.filled(self.vmax + 1))
+ if clip:
+ np.clip(xx, self.vmin, self.vmax, out=xx)
+ max_col = self.Ncmap - 1
+ else:
+ max_col = self.Ncmap
+ # this gives us the bins in the lookup table in the range
+ # [0, _n_regions - 1] (the offset is set in the init)
+ iret = np.digitize(xx, self.boundaries) - 1 + self._offset
+ # if we have more colors than regions, stretch the region
+ # index computed above to full range of the color bins. This
+ # will make use of the full range (but skip some of the colors
+ # in the middle) such that the first region is mapped to the
+ # first color and the last region is mapped to the last color.
+ if self.Ncmap > self._n_regions:
+ if self._n_regions == 1:
+ # special case the 1 region case, pick the middle color
+ iret[iret == 0] = (self.Ncmap - 1) // 2
+ else:
+ # otherwise linearly remap the values from the region index
+ # to the color index spaces
+ iret = (self.Ncmap - 1) / (self._n_regions - 1) * iret
+ # cast to 16bit integers in all cases
+ iret = iret.astype(np.int16)
+ iret[xx < self.vmin] = -1
+ iret[xx >= self.vmax] = max_col
+ ret = np.ma.array(iret, mask=mask)
+ if is_scalar:
+ ret = int(ret[0]) # assume python scalar
+ return ret
+
+ def inverse(self, value):
+ """
+ Raises
+ ------
+ ValueError
+ BoundaryNorm is not invertible, so calling this method will always
+ raise an error
+ """
+ raise ValueError("BoundaryNorm is not invertible")
+
+
+class NoNorm(Normalize):
+ """
+ Dummy replacement for `Normalize`, for the case where we want to use
+ indices directly in a `~matplotlib.cm.ScalarMappable`.
+ """
+ def __call__(self, value, clip=None):
+ if np.iterable(value):
+ return np.ma.array(value)
+ return value
+
+ def inverse(self, value):
+ if np.iterable(value):
+ return np.ma.array(value)
+ return value
+
+
+def rgb_to_hsv(arr):
+ """
+ Convert an array of float RGB values (in the range [0, 1]) to HSV values.
+
+ Parameters
+ ----------
+ arr : (..., 3) array-like
+ All values must be in the range [0, 1]
+
+ Returns
+ -------
+ (..., 3) `~numpy.ndarray`
+ Colors converted to HSV values in range [0, 1]
+ """
+ arr = np.asarray(arr)
+
+ # check length of the last dimension, should be _some_ sort of rgb
+ if arr.shape[-1] != 3:
+ raise ValueError("Last dimension of input array must be 3; "
+ f"shape {arr.shape} was found.")
+
+ in_shape = arr.shape
+ arr = np.array(
+ arr, copy=False,
+ dtype=np.promote_types(arr.dtype, np.float32), # Don't work on ints.
+ ndmin=2, # In case input was 1D.
+ )
+
+ out = np.zeros_like(arr)
+ arr_max = arr.max(-1)
+ # Check if input is in the expected range
+ if np.any(arr_max > 1):
+ raise ValueError(
+ "Input array must be in the range [0, 1]. "
+ f"Found a maximum value of {arr_max.max()}"
+ )
+
+ if arr.min() < 0:
+ raise ValueError(
+ "Input array must be in the range [0, 1]. "
+ f"Found a minimum value of {arr.min()}"
+ )
+
+ ipos = arr_max > 0
+ delta = np.ptp(arr, -1)
+ s = np.zeros_like(delta)
+ s[ipos] = delta[ipos] / arr_max[ipos]
+ ipos = delta > 0
+ # red is max
+ idx = (arr[..., 0] == arr_max) & ipos
+ out[idx, 0] = (arr[idx, 1] - arr[idx, 2]) / delta[idx]
+ # green is max
+ idx = (arr[..., 1] == arr_max) & ipos
+ out[idx, 0] = 2. + (arr[idx, 2] - arr[idx, 0]) / delta[idx]
+ # blue is max
+ idx = (arr[..., 2] == arr_max) & ipos
+ out[idx, 0] = 4. + (arr[idx, 0] - arr[idx, 1]) / delta[idx]
+
+ out[..., 0] = (out[..., 0] / 6.0) % 1.0
+ out[..., 1] = s
+ out[..., 2] = arr_max
+
+ return out.reshape(in_shape)
+
+
+def hsv_to_rgb(hsv):
+ """
+ Convert HSV values to RGB.
+
+ Parameters
+ ----------
+ hsv : (..., 3) array-like
+ All values assumed to be in range [0, 1]
+
+ Returns
+ -------
+ (..., 3) `~numpy.ndarray`
+ Colors converted to RGB values in range [0, 1]
+ """
+ hsv = np.asarray(hsv)
+
+ # check length of the last dimension, should be _some_ sort of rgb
+ if hsv.shape[-1] != 3:
+ raise ValueError("Last dimension of input array must be 3; "
+ f"shape {hsv.shape} was found.")
+
+ in_shape = hsv.shape
+ hsv = np.array(
+ hsv, copy=False,
+ dtype=np.promote_types(hsv.dtype, np.float32), # Don't work on ints.
+ ndmin=2, # In case input was 1D.
+ )
+
+ h = hsv[..., 0]
+ s = hsv[..., 1]
+ v = hsv[..., 2]
+
+ r = np.empty_like(h)
+ g = np.empty_like(h)
+ b = np.empty_like(h)
+
+ i = (h * 6.0).astype(int)
+ f = (h * 6.0) - i
+ p = v * (1.0 - s)
+ q = v * (1.0 - s * f)
+ t = v * (1.0 - s * (1.0 - f))
+
+ idx = i % 6 == 0
+ r[idx] = v[idx]
+ g[idx] = t[idx]
+ b[idx] = p[idx]
+
+ idx = i == 1
+ r[idx] = q[idx]
+ g[idx] = v[idx]
+ b[idx] = p[idx]
+
+ idx = i == 2
+ r[idx] = p[idx]
+ g[idx] = v[idx]
+ b[idx] = t[idx]
+
+ idx = i == 3
+ r[idx] = p[idx]
+ g[idx] = q[idx]
+ b[idx] = v[idx]
+
+ idx = i == 4
+ r[idx] = t[idx]
+ g[idx] = p[idx]
+ b[idx] = v[idx]
+
+ idx = i == 5
+ r[idx] = v[idx]
+ g[idx] = p[idx]
+ b[idx] = q[idx]
+
+ idx = s == 0
+ r[idx] = v[idx]
+ g[idx] = v[idx]
+ b[idx] = v[idx]
+
+ rgb = np.stack([r, g, b], axis=-1)
+
+ return rgb.reshape(in_shape)
+
+
+def _vector_magnitude(arr):
+ # things that don't work here:
+ # * np.linalg.norm: drops mask from ma.array
+ # * np.sum: drops mask from ma.array unless entire vector is masked
+ sum_sq = 0
+ for i in range(arr.shape[-1]):
+ sum_sq += arr[..., i, np.newaxis] ** 2
+ return np.sqrt(sum_sq)
+
+
+class LightSource:
+ """
+ Create a light source coming from the specified azimuth and elevation.
+ Angles are in degrees, with the azimuth measured
+ clockwise from north and elevation up from the zero plane of the surface.
+
+ `shade` is used to produce "shaded" RGB values for a data array.
+ `shade_rgb` can be used to combine an RGB image with an elevation map.
+ `hillshade` produces an illumination map of a surface.
+ """
+
+ def __init__(self, azdeg=315, altdeg=45, hsv_min_val=0, hsv_max_val=1,
+ hsv_min_sat=1, hsv_max_sat=0):
+ """
+ Specify the azimuth (measured clockwise from south) and altitude
+ (measured up from the plane of the surface) of the light source
+ in degrees.
+
+ Parameters
+ ----------
+ azdeg : float, default: 315 degrees (from the northwest)
+ The azimuth (0-360, degrees clockwise from North) of the light
+ source.
+ altdeg : float, default: 45 degrees
+ The altitude (0-90, degrees up from horizontal) of the light
+ source.
+ hsv_min_val : number, default: 0
+ The minimum value ("v" in "hsv") that the *intensity* map can shift the
+ output image to.
+ hsv_max_val : number, default: 1
+ The maximum value ("v" in "hsv") that the *intensity* map can shift the
+ output image to.
+ hsv_min_sat : number, default: 1
+ The minimum saturation value that the *intensity* map can shift the output
+ image to.
+ hsv_max_sat : number, default: 0
+ The maximum saturation value that the *intensity* map can shift the output
+ image to.
+
+ Notes
+ -----
+ For backwards compatibility, the parameters *hsv_min_val*,
+ *hsv_max_val*, *hsv_min_sat*, and *hsv_max_sat* may be supplied at
+ initialization as well. However, these parameters will only be used if
+ "blend_mode='hsv'" is passed into `shade` or `shade_rgb`.
+ See the documentation for `blend_hsv` for more details.
+ """
+ self.azdeg = azdeg
+ self.altdeg = altdeg
+ self.hsv_min_val = hsv_min_val
+ self.hsv_max_val = hsv_max_val
+ self.hsv_min_sat = hsv_min_sat
+ self.hsv_max_sat = hsv_max_sat
+
+ @property
+ def direction(self):
+ """The unit vector direction towards the light source."""
+ # Azimuth is in degrees clockwise from North. Convert to radians
+ # counterclockwise from East (mathematical notation).
+ az = np.radians(90 - self.azdeg)
+ alt = np.radians(self.altdeg)
+ return np.array([
+ np.cos(az) * np.cos(alt),
+ np.sin(az) * np.cos(alt),
+ np.sin(alt)
+ ])
+
+ def hillshade(self, elevation, vert_exag=1, dx=1, dy=1, fraction=1.):
+ """
+ Calculate the illumination intensity for a surface using the defined
+ azimuth and elevation for the light source.
+
+ This computes the normal vectors for the surface, and then passes them
+ on to `shade_normals`
+
+ Parameters
+ ----------
+ elevation : 2D array-like
+ The height values used to generate an illumination map
+ vert_exag : number, optional
+ The amount to exaggerate the elevation values by when calculating
+ illumination. This can be used either to correct for differences in
+ units between the x-y coordinate system and the elevation
+ coordinate system (e.g. decimal degrees vs. meters) or to
+ exaggerate or de-emphasize topographic effects.
+ dx : number, optional
+ The x-spacing (columns) of the input *elevation* grid.
+ dy : number, optional
+ The y-spacing (rows) of the input *elevation* grid.
+ fraction : number, optional
+ Increases or decreases the contrast of the hillshade. Values
+ greater than one will cause intermediate values to move closer to
+ full illumination or shadow (and clipping any values that move
+ beyond 0 or 1). Note that this is not visually or mathematically
+ the same as vertical exaggeration.
+
+ Returns
+ -------
+ `~numpy.ndarray`
+ A 2D array of illumination values between 0-1, where 0 is
+ completely in shadow and 1 is completely illuminated.
+ """
+
+ # Because most image and raster GIS data has the first row in the array
+ # as the "top" of the image, dy is implicitly negative. This is
+ # consistent to what `imshow` assumes, as well.
+ dy = -dy
+
+ # compute the normal vectors from the partial derivatives
+ e_dy, e_dx = np.gradient(vert_exag * elevation, dy, dx)
+
+ # .view is to keep subclasses
+ normal = np.empty(elevation.shape + (3,)).view(type(elevation))
+ normal[..., 0] = -e_dx
+ normal[..., 1] = -e_dy
+ normal[..., 2] = 1
+ normal /= _vector_magnitude(normal)
+
+ return self.shade_normals(normal, fraction)
+
+ def shade_normals(self, normals, fraction=1.):
+ """
+ Calculate the illumination intensity for the normal vectors of a
+ surface using the defined azimuth and elevation for the light source.
+
+ Imagine an artificial sun placed at infinity in some azimuth and
+ elevation position illuminating our surface. The parts of the surface
+ that slope toward the sun should brighten while those sides facing away
+ should become darker.
+
+ Parameters
+ ----------
+ fraction : number, optional
+ Increases or decreases the contrast of the hillshade. Values
+ greater than one will cause intermediate values to move closer to
+ full illumination or shadow (and clipping any values that move
+ beyond 0 or 1). Note that this is not visually or mathematically
+ the same as vertical exaggeration.
+
+ Returns
+ -------
+ `~numpy.ndarray`
+ A 2D array of illumination values between 0-1, where 0 is
+ completely in shadow and 1 is completely illuminated.
+ """
+
+ intensity = normals.dot(self.direction)
+
+ # Apply contrast stretch
+ imin, imax = intensity.min(), intensity.max()
+ intensity *= fraction
+
+ # Rescale to 0-1, keeping range before contrast stretch
+ # If constant slope, keep relative scaling (i.e. flat should be 0.5,
+ # fully occluded 0, etc.)
+ if (imax - imin) > 1e-6:
+ # Strictly speaking, this is incorrect. Negative values should be
+ # clipped to 0 because they're fully occluded. However, rescaling
+ # in this manner is consistent with the previous implementation and
+ # visually appears better than a "hard" clip.
+ intensity -= imin
+ intensity /= (imax - imin)
+ intensity = np.clip(intensity, 0, 1)
+
+ return intensity
+
+ def shade(self, data, cmap, norm=None, blend_mode='overlay', vmin=None,
+ vmax=None, vert_exag=1, dx=1, dy=1, fraction=1, **kwargs):
+ """
+ Combine colormapped data values with an illumination intensity map
+ (a.k.a. "hillshade") of the values.
+
+ Parameters
+ ----------
+ data : 2D array-like
+ The height values used to generate a shaded map.
+ cmap : `~matplotlib.colors.Colormap`
+ The colormap used to color the *data* array. Note that this must be
+ a `~matplotlib.colors.Colormap` instance. For example, rather than
+ passing in ``cmap='gist_earth'``, use
+ ``cmap=plt.get_cmap('gist_earth')`` instead.
+ norm : `~matplotlib.colors.Normalize` instance, optional
+ The normalization used to scale values before colormapping. If
+ None, the input will be linearly scaled between its min and max.
+ blend_mode : {'hsv', 'overlay', 'soft'} or callable, optional
+ The type of blending used to combine the colormapped data
+ values with the illumination intensity. Default is
+ "overlay". Note that for most topographic surfaces,
+ "overlay" or "soft" appear more visually realistic. If a
+ user-defined function is supplied, it is expected to
+ combine an (M, N, 3) RGB array of floats (ranging 0 to 1) with
+ an (M, N, 1) hillshade array (also 0 to 1). (Call signature
+ ``func(rgb, illum, **kwargs)``) Additional kwargs supplied
+ to this function will be passed on to the *blend_mode*
+ function.
+ vmin : float or None, optional
+ The minimum value used in colormapping *data*. If *None* the
+ minimum value in *data* is used. If *norm* is specified, then this
+ argument will be ignored.
+ vmax : float or None, optional
+ The maximum value used in colormapping *data*. If *None* the
+ maximum value in *data* is used. If *norm* is specified, then this
+ argument will be ignored.
+ vert_exag : number, optional
+ The amount to exaggerate the elevation values by when calculating
+ illumination. This can be used either to correct for differences in
+ units between the x-y coordinate system and the elevation
+ coordinate system (e.g. decimal degrees vs. meters) or to
+ exaggerate or de-emphasize topography.
+ dx : number, optional
+ The x-spacing (columns) of the input *elevation* grid.
+ dy : number, optional
+ The y-spacing (rows) of the input *elevation* grid.
+ fraction : number, optional
+ Increases or decreases the contrast of the hillshade. Values
+ greater than one will cause intermediate values to move closer to
+ full illumination or shadow (and clipping any values that move
+ beyond 0 or 1). Note that this is not visually or mathematically
+ the same as vertical exaggeration.
+ **kwargs
+ Additional kwargs are passed on to the *blend_mode* function.
+
+ Returns
+ -------
+ `~numpy.ndarray`
+ An (M, N, 4) array of floats ranging between 0-1.
+ """
+ if vmin is None:
+ vmin = data.min()
+ if vmax is None:
+ vmax = data.max()
+ if norm is None:
+ norm = Normalize(vmin=vmin, vmax=vmax)
+
+ rgb0 = cmap(norm(data))
+ rgb1 = self.shade_rgb(rgb0, elevation=data, blend_mode=blend_mode,
+ vert_exag=vert_exag, dx=dx, dy=dy,
+ fraction=fraction, **kwargs)
+ # Don't overwrite the alpha channel, if present.
+ rgb0[..., :3] = rgb1[..., :3]
+ return rgb0
+
+ def shade_rgb(self, rgb, elevation, fraction=1., blend_mode='hsv',
+ vert_exag=1, dx=1, dy=1, **kwargs):
+ """
+ Use this light source to adjust the colors of the *rgb* input array to
+ give the impression of a shaded relief map with the given *elevation*.
+
+ Parameters
+ ----------
+ rgb : array-like
+ An (M, N, 3) RGB array, assumed to be in the range of 0 to 1.
+ elevation : array-like
+ An (M, N) array of the height values used to generate a shaded map.
+ fraction : number
+ Increases or decreases the contrast of the hillshade. Values
+ greater than one will cause intermediate values to move closer to
+ full illumination or shadow (and clipping any values that move
+ beyond 0 or 1). Note that this is not visually or mathematically
+ the same as vertical exaggeration.
+ blend_mode : {'hsv', 'overlay', 'soft'} or callable, optional
+ The type of blending used to combine the colormapped data values
+ with the illumination intensity. For backwards compatibility, this
+ defaults to "hsv". Note that for most topographic surfaces,
+ "overlay" or "soft" appear more visually realistic. If a
+ user-defined function is supplied, it is expected to combine an
+ (M, N, 3) RGB array of floats (ranging 0 to 1) with an (M, N, 1)
+ hillshade array (also 0 to 1). (Call signature
+ ``func(rgb, illum, **kwargs)``)
+ Additional kwargs supplied to this function will be passed on to
+ the *blend_mode* function.
+ vert_exag : number, optional
+ The amount to exaggerate the elevation values by when calculating
+ illumination. This can be used either to correct for differences in
+ units between the x-y coordinate system and the elevation
+ coordinate system (e.g. decimal degrees vs. meters) or to
+ exaggerate or de-emphasize topography.
+ dx : number, optional
+ The x-spacing (columns) of the input *elevation* grid.
+ dy : number, optional
+ The y-spacing (rows) of the input *elevation* grid.
+ **kwargs
+ Additional kwargs are passed on to the *blend_mode* function.
+
+ Returns
+ -------
+ `~numpy.ndarray`
+ An (m, n, 3) array of floats ranging between 0-1.
+ """
+ # Calculate the "hillshade" intensity.
+ intensity = self.hillshade(elevation, vert_exag, dx, dy, fraction)
+ intensity = intensity[..., np.newaxis]
+
+ # Blend the hillshade and rgb data using the specified mode
+ lookup = {
+ 'hsv': self.blend_hsv,
+ 'soft': self.blend_soft_light,
+ 'overlay': self.blend_overlay,
+ }
+ if blend_mode in lookup:
+ blend = lookup[blend_mode](rgb, intensity, **kwargs)
+ else:
+ try:
+ blend = blend_mode(rgb, intensity, **kwargs)
+ except TypeError as err:
+ raise ValueError('"blend_mode" must be callable or one of '
+ f'{lookup.keys}') from err
+
+ # Only apply result where hillshade intensity isn't masked
+ if np.ma.is_masked(intensity):
+ mask = intensity.mask[..., 0]
+ for i in range(3):
+ blend[..., i][mask] = rgb[..., i][mask]
+
+ return blend
+
+ def blend_hsv(self, rgb, intensity, hsv_max_sat=None, hsv_max_val=None,
+ hsv_min_val=None, hsv_min_sat=None):
+ """
+ Take the input data array, convert to HSV values in the given colormap,
+ then adjust those color values to give the impression of a shaded
+ relief map with a specified light source. RGBA values are returned,
+ which can then be used to plot the shaded image with imshow.
+
+ The color of the resulting image will be darkened by moving the (s, v)
+ values (in HSV colorspace) toward (hsv_min_sat, hsv_min_val) in the
+ shaded regions, or lightened by sliding (s, v) toward (hsv_max_sat,
+ hsv_max_val) in regions that are illuminated. The default extremes are
+ chose so that completely shaded points are nearly black (s = 1, v = 0)
+ and completely illuminated points are nearly white (s = 0, v = 1).
+
+ Parameters
+ ----------
+ rgb : `~numpy.ndarray`
+ An (M, N, 3) RGB array of floats ranging from 0 to 1 (color image).
+ intensity : `~numpy.ndarray`
+ An (M, N, 1) array of floats ranging from 0 to 1 (grayscale image).
+ hsv_max_sat : number, optional
+ The maximum saturation value that the *intensity* map can shift the output
+ image to. If not provided, use the value provided upon initialization.
+ hsv_min_sat : number, optional
+ The minimum saturation value that the *intensity* map can shift the output
+ image to. If not provided, use the value provided upon initialization.
+ hsv_max_val : number, optional
+ The maximum value ("v" in "hsv") that the *intensity* map can shift the
+ output image to. If not provided, use the value provided upon
+ initialization.
+ hsv_min_val : number, optional
+ The minimum value ("v" in "hsv") that the *intensity* map can shift the
+ output image to. If not provided, use the value provided upon
+ initialization.
+
+ Returns
+ -------
+ `~numpy.ndarray`
+ An (M, N, 3) RGB array representing the combined images.
+ """
+ # Backward compatibility...
+ if hsv_max_sat is None:
+ hsv_max_sat = self.hsv_max_sat
+ if hsv_max_val is None:
+ hsv_max_val = self.hsv_max_val
+ if hsv_min_sat is None:
+ hsv_min_sat = self.hsv_min_sat
+ if hsv_min_val is None:
+ hsv_min_val = self.hsv_min_val
+
+ # Expects a 2D intensity array scaled between -1 to 1...
+ intensity = intensity[..., 0]
+ intensity = 2 * intensity - 1
+
+ # Convert to rgb, then rgb to hsv
+ hsv = rgb_to_hsv(rgb[:, :, 0:3])
+ hue, sat, val = np.moveaxis(hsv, -1, 0)
+
+ # Modify hsv values (in place) to simulate illumination.
+ # putmask(A, mask, B) <=> A[mask] = B[mask]
+ np.putmask(sat, (np.abs(sat) > 1.e-10) & (intensity > 0),
+ (1 - intensity) * sat + intensity * hsv_max_sat)
+ np.putmask(sat, (np.abs(sat) > 1.e-10) & (intensity < 0),
+ (1 + intensity) * sat - intensity * hsv_min_sat)
+ np.putmask(val, intensity > 0,
+ (1 - intensity) * val + intensity * hsv_max_val)
+ np.putmask(val, intensity < 0,
+ (1 + intensity) * val - intensity * hsv_min_val)
+ np.clip(hsv[:, :, 1:], 0, 1, out=hsv[:, :, 1:])
+
+ # Convert modified hsv back to rgb.
+ return hsv_to_rgb(hsv)
+
+ def blend_soft_light(self, rgb, intensity):
+ """
+ Combine an RGB image with an intensity map using "soft light" blending,
+ using the "pegtop" formula.
+
+ Parameters
+ ----------
+ rgb : `~numpy.ndarray`
+ An (M, N, 3) RGB array of floats ranging from 0 to 1 (color image).
+ intensity : `~numpy.ndarray`
+ An (M, N, 1) array of floats ranging from 0 to 1 (grayscale image).
+
+ Returns
+ -------
+ `~numpy.ndarray`
+ An (M, N, 3) RGB array representing the combined images.
+ """
+ return 2 * intensity * rgb + (1 - 2 * intensity) * rgb**2
+
+ def blend_overlay(self, rgb, intensity):
+ """
+ Combine an RGB image with an intensity map using "overlay" blending.
+
+ Parameters
+ ----------
+ rgb : `~numpy.ndarray`
+ An (M, N, 3) RGB array of floats ranging from 0 to 1 (color image).
+ intensity : `~numpy.ndarray`
+ An (M, N, 1) array of floats ranging from 0 to 1 (grayscale image).
+
+ Returns
+ -------
+ ndarray
+ An (M, N, 3) RGB array representing the combined images.
+ """
+ low = 2 * intensity * rgb
+ high = 1 - 2 * (1 - intensity) * (1 - rgb)
+ return np.where(rgb <= 0.5, low, high)
+
+
+def from_levels_and_colors(levels, colors, extend='neither'):
+ """
+ A helper routine to generate a cmap and a norm instance which
+ behave similar to contourf's levels and colors arguments.
+
+ Parameters
+ ----------
+ levels : sequence of numbers
+ The quantization levels used to construct the `BoundaryNorm`.
+ Value ``v`` is quantized to level ``i`` if ``lev[i] <= v < lev[i+1]``.
+ colors : sequence of colors
+ The fill color to use for each level. If *extend* is "neither" there
+ must be ``n_level - 1`` colors. For an *extend* of "min" or "max" add
+ one extra color, and for an *extend* of "both" add two colors.
+ extend : {'neither', 'min', 'max', 'both'}, optional
+ The behaviour when a value falls out of range of the given levels.
+ See `~.Axes.contourf` for details.
+
+ Returns
+ -------
+ cmap : `~matplotlib.colors.Colormap`
+ norm : `~matplotlib.colors.Normalize`
+ """
+ slice_map = {
+ 'both': slice(1, -1),
+ 'min': slice(1, None),
+ 'max': slice(0, -1),
+ 'neither': slice(0, None),
+ }
+ _api.check_in_list(slice_map, extend=extend)
+ color_slice = slice_map[extend]
+
+ n_data_colors = len(levels) - 1
+ n_expected = n_data_colors + color_slice.start - (color_slice.stop or 0)
+ if len(colors) != n_expected:
+ raise ValueError(
+ f'With extend == {extend!r} and {len(levels)} levels, '
+ f'expected {n_expected} colors, but got {len(colors)}')
+
+ cmap = ListedColormap(colors[color_slice], N=n_data_colors)
+
+ if extend in ['min', 'both']:
+ cmap.set_under(colors[0])
+ else:
+ cmap.set_under('none')
+
+ if extend in ['max', 'both']:
+ cmap.set_over(colors[-1])
+ else:
+ cmap.set_over('none')
+
+ cmap.colorbar_extend = extend
+
+ norm = BoundaryNorm(levels, ncolors=n_data_colors)
+ return cmap, norm
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colors.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colors.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..6941e3d5d176c39525c27e9a60d6926a18e31e8b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/colors.pyi
@@ -0,0 +1,449 @@
+from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
+from matplotlib import cbook, scale
+import re
+
+from typing import Any, Literal, overload
+from .typing import ColorType
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+# Explicitly export colors dictionaries which are imported in the impl
+BASE_COLORS: dict[str, ColorType]
+CSS4_COLORS: dict[str, ColorType]
+TABLEAU_COLORS: dict[str, ColorType]
+XKCD_COLORS: dict[str, ColorType]
+
+class _ColorMapping(dict[str, ColorType]):
+ cache: dict[tuple[ColorType, float | None], tuple[float, float, float, float]]
+ def __init__(self, mapping) -> None: ...
+ def __setitem__(self, key, value) -> None: ...
+ def __delitem__(self, key) -> None: ...
+
+def get_named_colors_mapping() -> _ColorMapping: ...
+
+class ColorSequenceRegistry(Mapping):
+ def __init__(self) -> None: ...
+ def __getitem__(self, item: str) -> list[ColorType]: ...
+ def __iter__(self) -> Iterator[str]: ...
+ def __len__(self) -> int: ...
+ def register(self, name: str, color_list: Iterable[ColorType]) -> None: ...
+ def unregister(self, name: str) -> None: ...
+
+_color_sequences: ColorSequenceRegistry = ...
+
+def is_color_like(c: Any) -> bool: ...
+def same_color(c1: ColorType, c2: ColorType) -> bool: ...
+def to_rgba(
+ c: ColorType, alpha: float | None = ...
+) -> tuple[float, float, float, float]: ...
+def to_rgba_array(
+ c: ColorType | ArrayLike, alpha: float | ArrayLike | None = ...
+) -> np.ndarray: ...
+def to_rgb(c: ColorType) -> tuple[float, float, float]: ...
+def to_hex(c: ColorType, keep_alpha: bool = ...) -> str: ...
+
+cnames: dict[str, ColorType]
+hexColorPattern: re.Pattern
+rgb2hex = to_hex
+hex2color = to_rgb
+
+class ColorConverter:
+ colors: _ColorMapping
+ cache: dict[tuple[ColorType, float | None], tuple[float, float, float, float]]
+ @staticmethod
+ def to_rgb(c: ColorType) -> tuple[float, float, float]: ...
+ @staticmethod
+ def to_rgba(
+ c: ColorType, alpha: float | None = ...
+ ) -> tuple[float, float, float, float]: ...
+ @staticmethod
+ def to_rgba_array(
+ c: ColorType | ArrayLike, alpha: float | ArrayLike | None = ...
+ ) -> np.ndarray: ...
+
+colorConverter: ColorConverter
+
+class Colormap:
+ name: str
+ N: int
+ colorbar_extend: bool
+ def __init__(self, name: str, N: int = ...) -> None: ...
+ @overload
+ def __call__(
+ self, X: Sequence[float] | np.ndarray, alpha: ArrayLike | None = ..., bytes: bool = ...
+ ) -> np.ndarray: ...
+ @overload
+ def __call__(
+ self, X: float, alpha: float | None = ..., bytes: bool = ...
+ ) -> tuple[float, float, float, float]: ...
+ @overload
+ def __call__(
+ self, X: ArrayLike, alpha: ArrayLike | None = ..., bytes: bool = ...
+ ) -> tuple[float, float, float, float] | np.ndarray: ...
+ def __copy__(self) -> Colormap: ...
+ def __eq__(self, other: object) -> bool: ...
+ def get_bad(self) -> np.ndarray: ...
+ def set_bad(self, color: ColorType = ..., alpha: float | None = ...) -> None: ...
+ def get_under(self) -> np.ndarray: ...
+ def set_under(self, color: ColorType = ..., alpha: float | None = ...) -> None: ...
+ def get_over(self) -> np.ndarray: ...
+ def set_over(self, color: ColorType = ..., alpha: float | None = ...) -> None: ...
+ def set_extremes(
+ self,
+ *,
+ bad: ColorType | None = ...,
+ under: ColorType | None = ...,
+ over: ColorType | None = ...
+ ) -> None: ...
+ def with_extremes(
+ self,
+ *,
+ bad: ColorType | None = ...,
+ under: ColorType | None = ...,
+ over: ColorType | None = ...
+ ) -> Colormap: ...
+ def is_gray(self) -> bool: ...
+ def resampled(self, lutsize: int) -> Colormap: ...
+ def reversed(self, name: str | None = ...) -> Colormap: ...
+ def _repr_html_(self) -> str: ...
+ def _repr_png_(self) -> bytes: ...
+ def copy(self) -> Colormap: ...
+
+class LinearSegmentedColormap(Colormap):
+ monochrome: bool
+ def __init__(
+ self,
+ name: str,
+ segmentdata: dict[
+ Literal["red", "green", "blue", "alpha"], Sequence[tuple[float, ...]]
+ ],
+ N: int = ...,
+ gamma: float = ...,
+ ) -> None: ...
+ def set_gamma(self, gamma: float) -> None: ...
+ @staticmethod
+ def from_list(
+ name: str, colors: ArrayLike | Sequence[tuple[float, ColorType]], N: int = ..., gamma: float = ...
+ ) -> LinearSegmentedColormap: ...
+ def resampled(self, lutsize: int) -> LinearSegmentedColormap: ...
+ def reversed(self, name: str | None = ...) -> LinearSegmentedColormap: ...
+
+class ListedColormap(Colormap):
+ monochrome: bool
+ colors: ArrayLike | ColorType
+ def __init__(
+ self, colors: ArrayLike | ColorType, name: str = ..., N: int | None = ...
+ ) -> None: ...
+ def resampled(self, lutsize: int) -> ListedColormap: ...
+ def reversed(self, name: str | None = ...) -> ListedColormap: ...
+
+class MultivarColormap:
+ name: str
+ n_variates: int
+ def __init__(self, colormaps: list[Colormap], combination_mode: Literal['sRGB_add', 'sRGB_sub'], name: str = ...) -> None: ...
+ @overload
+ def __call__(
+ self, X: Sequence[Sequence[float]] | np.ndarray, alpha: ArrayLike | None = ..., bytes: bool = ..., clip: bool = ...
+ ) -> np.ndarray: ...
+ @overload
+ def __call__(
+ self, X: Sequence[float], alpha: float | None = ..., bytes: bool = ..., clip: bool = ...
+ ) -> tuple[float, float, float, float]: ...
+ @overload
+ def __call__(
+ self, X: ArrayLike, alpha: ArrayLike | None = ..., bytes: bool = ..., clip: bool = ...
+ ) -> tuple[float, float, float, float] | np.ndarray: ...
+ def copy(self) -> MultivarColormap: ...
+ def __copy__(self) -> MultivarColormap: ...
+ def __eq__(self, other: Any) -> bool: ...
+ def __getitem__(self, item: int) -> Colormap: ...
+ def __iter__(self) -> Iterator[Colormap]: ...
+ def __len__(self) -> int: ...
+ def get_bad(self) -> np.ndarray: ...
+ def resampled(self, lutshape: Sequence[int | None]) -> MultivarColormap: ...
+ def with_extremes(
+ self,
+ *,
+ bad: ColorType | None = ...,
+ under: Sequence[ColorType] | None = ...,
+ over: Sequence[ColorType] | None = ...
+ ) -> MultivarColormap: ...
+ @property
+ def combination_mode(self) -> str: ...
+ def _repr_html_(self) -> str: ...
+ def _repr_png_(self) -> bytes: ...
+
+class BivarColormap:
+ name: str
+ N: int
+ M: int
+ n_variates: int
+ def __init__(
+ self, N: int = ..., M: int | None = ..., shape: Literal['square', 'circle', 'ignore', 'circleignore'] = ...,
+ origin: Sequence[float] = ..., name: str = ...
+ ) -> None: ...
+ @overload
+ def __call__(
+ self, X: Sequence[Sequence[float]] | np.ndarray, alpha: ArrayLike | None = ..., bytes: bool = ...
+ ) -> np.ndarray: ...
+ @overload
+ def __call__(
+ self, X: Sequence[float], alpha: float | None = ..., bytes: bool = ...
+ ) -> tuple[float, float, float, float]: ...
+ @overload
+ def __call__(
+ self, X: ArrayLike, alpha: ArrayLike | None = ..., bytes: bool = ...
+ ) -> tuple[float, float, float, float] | np.ndarray: ...
+ @property
+ def lut(self) -> np.ndarray: ...
+ @property
+ def shape(self) -> str: ...
+ @property
+ def origin(self) -> tuple[float, float]: ...
+ def copy(self) -> BivarColormap: ...
+ def __copy__(self) -> BivarColormap: ...
+ def __getitem__(self, item: int) -> Colormap: ...
+ def __eq__(self, other: Any) -> bool: ...
+ def get_bad(self) -> np.ndarray: ...
+ def get_outside(self) -> np.ndarray: ...
+ def resampled(self, lutshape: Sequence[int | None], transposed: bool = ...) -> BivarColormap: ...
+ def transposed(self) -> BivarColormap: ...
+ def reversed(self, axis_0: bool = ..., axis_1: bool = ...) -> BivarColormap: ...
+ def with_extremes(
+ self,
+ *,
+ bad: ColorType | None = ...,
+ outside: ColorType | None = ...,
+ shape: str | None = ...,
+ origin: None | Sequence[float] = ...,
+ ) -> MultivarColormap: ...
+ def _repr_html_(self) -> str: ...
+ def _repr_png_(self) -> bytes: ...
+
+class SegmentedBivarColormap(BivarColormap):
+ def __init__(
+ self, patch: np.ndarray, N: int = ..., shape: Literal['square', 'circle', 'ignore', 'circleignore'] = ...,
+ origin: Sequence[float] = ..., name: str = ...
+ ) -> None: ...
+
+class BivarColormapFromImage(BivarColormap):
+ def __init__(
+ self, lut: np.ndarray, shape: Literal['square', 'circle', 'ignore', 'circleignore'] = ...,
+ origin: Sequence[float] = ..., name: str = ...
+ ) -> None: ...
+
+class Normalize:
+ callbacks: cbook.CallbackRegistry
+ def __init__(
+ self, vmin: float | None = ..., vmax: float | None = ..., clip: bool = ...
+ ) -> None: ...
+ @property
+ def vmin(self) -> float | None: ...
+ @vmin.setter
+ def vmin(self, value: float | None) -> None: ...
+ @property
+ def vmax(self) -> float | None: ...
+ @vmax.setter
+ def vmax(self, value: float | None) -> None: ...
+ @property
+ def clip(self) -> bool: ...
+ @clip.setter
+ def clip(self, value: bool) -> None: ...
+ @staticmethod
+ def process_value(value: ArrayLike) -> tuple[np.ma.MaskedArray, bool]: ...
+ @overload
+ def __call__(self, value: float, clip: bool | None = ...) -> float: ...
+ @overload
+ def __call__(self, value: np.ndarray, clip: bool | None = ...) -> np.ma.MaskedArray: ...
+ @overload
+ def __call__(self, value: ArrayLike, clip: bool | None = ...) -> ArrayLike: ...
+ @overload
+ def inverse(self, value: float) -> float: ...
+ @overload
+ def inverse(self, value: np.ndarray) -> np.ma.MaskedArray: ...
+ @overload
+ def inverse(self, value: ArrayLike) -> ArrayLike: ...
+ def autoscale(self, A: ArrayLike) -> None: ...
+ def autoscale_None(self, A: ArrayLike) -> None: ...
+ def scaled(self) -> bool: ...
+
+class TwoSlopeNorm(Normalize):
+ def __init__(
+ self, vcenter: float, vmin: float | None = ..., vmax: float | None = ...
+ ) -> None: ...
+ @property
+ def vcenter(self) -> float: ...
+ @vcenter.setter
+ def vcenter(self, value: float) -> None: ...
+ def autoscale_None(self, A: ArrayLike) -> None: ...
+
+class CenteredNorm(Normalize):
+ def __init__(
+ self, vcenter: float = ..., halfrange: float | None = ..., clip: bool = ...
+ ) -> None: ...
+ @property
+ def vcenter(self) -> float: ...
+ @vcenter.setter
+ def vcenter(self, vcenter: float) -> None: ...
+ @property
+ def halfrange(self) -> float: ...
+ @halfrange.setter
+ def halfrange(self, halfrange: float) -> None: ...
+
+@overload
+def make_norm_from_scale(
+ scale_cls: type[scale.ScaleBase],
+ base_norm_cls: type[Normalize],
+ *,
+ init: Callable | None = ...
+) -> type[Normalize]: ...
+@overload
+def make_norm_from_scale(
+ scale_cls: type[scale.ScaleBase],
+ base_norm_cls: None = ...,
+ *,
+ init: Callable | None = ...
+) -> Callable[[type[Normalize]], type[Normalize]]: ...
+
+class FuncNorm(Normalize):
+ def __init__(
+ self,
+ functions: tuple[Callable, Callable],
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ clip: bool = ...,
+ ) -> None: ...
+class LogNorm(Normalize): ...
+
+class SymLogNorm(Normalize):
+ def __init__(
+ self,
+ linthresh: float,
+ linscale: float = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ clip: bool = ...,
+ *,
+ base: float = ...,
+ ) -> None: ...
+ @property
+ def linthresh(self) -> float: ...
+ @linthresh.setter
+ def linthresh(self, value: float) -> None: ...
+
+class AsinhNorm(Normalize):
+ def __init__(
+ self,
+ linear_width: float = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ clip: bool = ...,
+ ) -> None: ...
+ @property
+ def linear_width(self) -> float: ...
+ @linear_width.setter
+ def linear_width(self, value: float) -> None: ...
+
+class PowerNorm(Normalize):
+ gamma: float
+ def __init__(
+ self,
+ gamma: float,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ clip: bool = ...,
+ ) -> None: ...
+
+class BoundaryNorm(Normalize):
+ boundaries: np.ndarray
+ N: int
+ Ncmap: int
+ extend: Literal["neither", "both", "min", "max"]
+ def __init__(
+ self,
+ boundaries: ArrayLike,
+ ncolors: int,
+ clip: bool = ...,
+ *,
+ extend: Literal["neither", "both", "min", "max"] = ...
+ ) -> None: ...
+
+class NoNorm(Normalize): ...
+
+def rgb_to_hsv(arr: ArrayLike) -> np.ndarray: ...
+def hsv_to_rgb(hsv: ArrayLike) -> np.ndarray: ...
+
+class LightSource:
+ azdeg: float
+ altdeg: float
+ hsv_min_val: float
+ hsv_max_val: float
+ hsv_min_sat: float
+ hsv_max_sat: float
+ def __init__(
+ self,
+ azdeg: float = ...,
+ altdeg: float = ...,
+ hsv_min_val: float = ...,
+ hsv_max_val: float = ...,
+ hsv_min_sat: float = ...,
+ hsv_max_sat: float = ...,
+ ) -> None: ...
+ @property
+ def direction(self) -> np.ndarray: ...
+ def hillshade(
+ self,
+ elevation: ArrayLike,
+ vert_exag: float = ...,
+ dx: float = ...,
+ dy: float = ...,
+ fraction: float = ...,
+ ) -> np.ndarray: ...
+ def shade_normals(
+ self, normals: np.ndarray, fraction: float = ...
+ ) -> np.ndarray: ...
+ def shade(
+ self,
+ data: ArrayLike,
+ cmap: Colormap,
+ norm: Normalize | None = ...,
+ blend_mode: Literal["hsv", "overlay", "soft"] | Callable = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ vert_exag: float = ...,
+ dx: float = ...,
+ dy: float = ...,
+ fraction: float = ...,
+ **kwargs
+ ) -> np.ndarray: ...
+ def shade_rgb(
+ self,
+ rgb: ArrayLike,
+ elevation: ArrayLike,
+ fraction: float = ...,
+ blend_mode: Literal["hsv", "overlay", "soft"] | Callable = ...,
+ vert_exag: float = ...,
+ dx: float = ...,
+ dy: float = ...,
+ **kwargs
+ ) -> np.ndarray: ...
+ def blend_hsv(
+ self,
+ rgb: ArrayLike,
+ intensity: ArrayLike,
+ hsv_max_sat: float | None = ...,
+ hsv_max_val: float | None = ...,
+ hsv_min_val: float | None = ...,
+ hsv_min_sat: float | None = ...,
+ ) -> ArrayLike: ...
+ def blend_soft_light(
+ self, rgb: np.ndarray, intensity: np.ndarray
+ ) -> np.ndarray: ...
+ def blend_overlay(self, rgb: np.ndarray, intensity: np.ndarray) -> np.ndarray: ...
+
+def from_levels_and_colors(
+ levels: Sequence[float],
+ colors: Sequence[ColorType],
+ extend: Literal["neither", "min", "max", "both"] = ...,
+) -> tuple[ListedColormap, BoundaryNorm]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/container.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/container.py
new file mode 100644
index 0000000000000000000000000000000000000000..b6dd43724f34b219a7d8864542af4dbec81d89ff
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/container.py
@@ -0,0 +1,141 @@
+from matplotlib import cbook
+from matplotlib.artist import Artist
+
+
+class Container(tuple):
+ """
+ Base class for containers.
+
+ Containers are classes that collect semantically related Artists such as
+ the bars of a bar plot.
+ """
+
+ def __repr__(self):
+ return f"<{type(self).__name__} object of {len(self)} artists>"
+
+ def __new__(cls, *args, **kwargs):
+ return tuple.__new__(cls, args[0])
+
+ def __init__(self, kl, label=None):
+ self._callbacks = cbook.CallbackRegistry(signals=["pchanged"])
+ self._remove_method = None
+ self._label = str(label) if label is not None else None
+
+ def remove(self):
+ for c in cbook.flatten(
+ self, scalarp=lambda x: isinstance(x, Artist)):
+ if c is not None:
+ c.remove()
+ if self._remove_method:
+ self._remove_method(self)
+
+ def get_children(self):
+ return [child for child in cbook.flatten(self) if child is not None]
+
+ get_label = Artist.get_label
+ set_label = Artist.set_label
+ add_callback = Artist.add_callback
+ remove_callback = Artist.remove_callback
+ pchanged = Artist.pchanged
+
+
+class BarContainer(Container):
+ """
+ Container for the artists of bar plots (e.g. created by `.Axes.bar`).
+
+ The container can be treated as a tuple of the *patches* themselves.
+ Additionally, you can access these and further parameters by the
+ attributes.
+
+ Attributes
+ ----------
+ patches : list of :class:`~matplotlib.patches.Rectangle`
+ The artists of the bars.
+
+ errorbar : None or :class:`~matplotlib.container.ErrorbarContainer`
+ A container for the error bar artists if error bars are present.
+ *None* otherwise.
+
+ datavalues : None or array-like
+ The underlying data values corresponding to the bars.
+
+ orientation : {'vertical', 'horizontal'}, default: None
+ If 'vertical', the bars are assumed to be vertical.
+ If 'horizontal', the bars are assumed to be horizontal.
+
+ """
+
+ def __init__(self, patches, errorbar=None, *, datavalues=None,
+ orientation=None, **kwargs):
+ self.patches = patches
+ self.errorbar = errorbar
+ self.datavalues = datavalues
+ self.orientation = orientation
+ super().__init__(patches, **kwargs)
+
+
+class ErrorbarContainer(Container):
+ """
+ Container for the artists of error bars (e.g. created by `.Axes.errorbar`).
+
+ The container can be treated as the *lines* tuple itself.
+ Additionally, you can access these and further parameters by the
+ attributes.
+
+ Attributes
+ ----------
+ lines : tuple
+ Tuple of ``(data_line, caplines, barlinecols)``.
+
+ - data_line : A `~matplotlib.lines.Line2D` instance of x, y plot markers
+ and/or line.
+ - caplines : A tuple of `~matplotlib.lines.Line2D` instances of the error
+ bar caps.
+ - barlinecols : A tuple of `~matplotlib.collections.LineCollection` with the
+ horizontal and vertical error ranges.
+
+ has_xerr, has_yerr : bool
+ ``True`` if the errorbar has x/y errors.
+
+ """
+
+ def __init__(self, lines, has_xerr=False, has_yerr=False, **kwargs):
+ self.lines = lines
+ self.has_xerr = has_xerr
+ self.has_yerr = has_yerr
+ super().__init__(lines, **kwargs)
+
+
+class StemContainer(Container):
+ """
+ Container for the artists created in a :meth:`.Axes.stem` plot.
+
+ The container can be treated like a namedtuple ``(markerline, stemlines,
+ baseline)``.
+
+ Attributes
+ ----------
+ markerline : `~matplotlib.lines.Line2D`
+ The artist of the markers at the stem heads.
+
+ stemlines : `~matplotlib.collections.LineCollection`
+ The artists of the vertical lines for all stems.
+
+ baseline : `~matplotlib.lines.Line2D`
+ The artist of the horizontal baseline.
+ """
+ def __init__(self, markerline_stemlines_baseline, **kwargs):
+ """
+ Parameters
+ ----------
+ markerline_stemlines_baseline : tuple
+ Tuple of ``(markerline, stemlines, baseline)``.
+ ``markerline`` contains the `.Line2D` of the markers,
+ ``stemlines`` is a `.LineCollection` of the main lines,
+ ``baseline`` is the `.Line2D` of the baseline.
+ """
+ markerline, stemlines, baseline = markerline_stemlines_baseline
+ self.markerline = markerline
+ self.stemlines = stemlines
+ self.baseline = baseline
+ super().__init__(markerline_stemlines_baseline, **kwargs)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/container.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/container.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..c66e7ba4b4c32fc5e27fe06761efb6a3c7f86172
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/container.pyi
@@ -0,0 +1,56 @@
+from matplotlib.artist import Artist
+from matplotlib.lines import Line2D
+from matplotlib.collections import LineCollection
+from matplotlib.patches import Rectangle
+
+from collections.abc import Callable
+from typing import Any, Literal
+from numpy.typing import ArrayLike
+
+class Container(tuple):
+ def __new__(cls, *args, **kwargs): ...
+ def __init__(self, kl, label: Any | None = ...) -> None: ...
+ def remove(self) -> None: ...
+ def get_children(self) -> list[Artist]: ...
+ def get_label(self) -> str | None: ...
+ def set_label(self, s: Any) -> None: ...
+ def add_callback(self, func: Callable[[Artist], Any]) -> int: ...
+ def remove_callback(self, oid: int) -> None: ...
+ def pchanged(self) -> None: ...
+
+class BarContainer(Container):
+ patches: list[Rectangle]
+ errorbar: None | ErrorbarContainer
+ datavalues: None | ArrayLike
+ orientation: None | Literal["vertical", "horizontal"]
+ def __init__(
+ self,
+ patches: list[Rectangle],
+ errorbar: ErrorbarContainer | None = ...,
+ *,
+ datavalues: ArrayLike | None = ...,
+ orientation: Literal["vertical", "horizontal"] | None = ...,
+ **kwargs
+ ) -> None: ...
+
+class ErrorbarContainer(Container):
+ lines: tuple[Line2D, tuple[Line2D, ...], tuple[LineCollection, ...]]
+ has_xerr: bool
+ has_yerr: bool
+ def __init__(
+ self,
+ lines: tuple[Line2D, tuple[Line2D, ...], tuple[LineCollection, ...]],
+ has_xerr: bool = ...,
+ has_yerr: bool = ...,
+ **kwargs
+ ) -> None: ...
+
+class StemContainer(Container):
+ markerline: Line2D
+ stemlines: LineCollection
+ baseline: Line2D
+ def __init__(
+ self,
+ markerline_stemlines_baseline: tuple[Line2D, LineCollection, Line2D],
+ **kwargs
+ ) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/contour.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/contour.py
new file mode 100644
index 0000000000000000000000000000000000000000..f7318d57812161ab164e3d3e3a62ab13cf020c2c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/contour.py
@@ -0,0 +1,1702 @@
+"""
+Classes to support contour plotting and labelling for the Axes class.
+"""
+
+from contextlib import ExitStack
+import functools
+import math
+from numbers import Integral
+
+import numpy as np
+from numpy import ma
+
+import matplotlib as mpl
+from matplotlib import _api, _docstring
+from matplotlib.backend_bases import MouseButton
+from matplotlib.lines import Line2D
+from matplotlib.path import Path
+from matplotlib.text import Text
+import matplotlib.ticker as ticker
+import matplotlib.cm as cm
+import matplotlib.colors as mcolors
+import matplotlib.collections as mcoll
+import matplotlib.font_manager as font_manager
+import matplotlib.cbook as cbook
+import matplotlib.patches as mpatches
+import matplotlib.transforms as mtransforms
+
+
+def _contour_labeler_event_handler(cs, inline, inline_spacing, event):
+ canvas = cs.axes.get_figure(root=True).canvas
+ is_button = event.name == "button_press_event"
+ is_key = event.name == "key_press_event"
+ # Quit (even if not in infinite mode; this is consistent with
+ # MATLAB and sometimes quite useful, but will require the user to
+ # test how many points were actually returned before using data).
+ if (is_button and event.button == MouseButton.MIDDLE
+ or is_key and event.key in ["escape", "enter"]):
+ canvas.stop_event_loop()
+ # Pop last click.
+ elif (is_button and event.button == MouseButton.RIGHT
+ or is_key and event.key in ["backspace", "delete"]):
+ # Unfortunately, if one is doing inline labels, then there is currently
+ # no way to fix the broken contour - once humpty-dumpty is broken, he
+ # can't be put back together. In inline mode, this does nothing.
+ if not inline:
+ cs.pop_label()
+ canvas.draw()
+ # Add new click.
+ elif (is_button and event.button == MouseButton.LEFT
+ # On macOS/gtk, some keys return None.
+ or is_key and event.key is not None):
+ if cs.axes.contains(event)[0]:
+ cs.add_label_near(event.x, event.y, transform=False,
+ inline=inline, inline_spacing=inline_spacing)
+ canvas.draw()
+
+
+class ContourLabeler:
+ """Mixin to provide labelling capability to `.ContourSet`."""
+
+ def clabel(self, levels=None, *,
+ fontsize=None, inline=True, inline_spacing=5, fmt=None,
+ colors=None, use_clabeltext=False, manual=False,
+ rightside_up=True, zorder=None):
+ """
+ Label a contour plot.
+
+ Adds labels to line contours in this `.ContourSet` (which inherits from
+ this mixin class).
+
+ Parameters
+ ----------
+ levels : array-like, optional
+ A list of level values, that should be labeled. The list must be
+ a subset of ``cs.levels``. If not given, all levels are labeled.
+
+ fontsize : str or float, default: :rc:`font.size`
+ Size in points or relative size e.g., 'smaller', 'x-large'.
+ See `.Text.set_size` for accepted string values.
+
+ colors : :mpltype:`color` or colors or None, default: None
+ The label colors:
+
+ - If *None*, the color of each label matches the color of
+ the corresponding contour.
+
+ - If one string color, e.g., *colors* = 'r' or *colors* =
+ 'red', all labels will be plotted in this color.
+
+ - If a tuple of colors (string, float, RGB, etc), different labels
+ will be plotted in different colors in the order specified.
+
+ inline : bool, default: True
+ If ``True`` the underlying contour is removed where the label is
+ placed.
+
+ inline_spacing : float, default: 5
+ Space in pixels to leave on each side of label when placing inline.
+
+ This spacing will be exact for labels at locations where the
+ contour is straight, less so for labels on curved contours.
+
+ fmt : `.Formatter` or str or callable or dict, optional
+ How the levels are formatted:
+
+ - If a `.Formatter`, it is used to format all levels at once, using
+ its `.Formatter.format_ticks` method.
+ - If a str, it is interpreted as a %-style format string.
+ - If a callable, it is called with one level at a time and should
+ return the corresponding label.
+ - If a dict, it should directly map levels to labels.
+
+ The default is to use a standard `.ScalarFormatter`.
+
+ manual : bool or iterable, default: False
+ If ``True``, contour labels will be placed manually using
+ mouse clicks. Click the first button near a contour to
+ add a label, click the second button (or potentially both
+ mouse buttons at once) to finish adding labels. The third
+ button can be used to remove the last label added, but
+ only if labels are not inline. Alternatively, the keyboard
+ can be used to select label locations (enter to end label
+ placement, delete or backspace act like the third mouse button,
+ and any other key will select a label location).
+
+ *manual* can also be an iterable object of (x, y) tuples.
+ Contour labels will be created as if mouse is clicked at each
+ (x, y) position.
+
+ rightside_up : bool, default: True
+ If ``True``, label rotations will always be plus
+ or minus 90 degrees from level.
+
+ use_clabeltext : bool, default: False
+ If ``True``, use `.Text.set_transform_rotates_text` to ensure that
+ label rotation is updated whenever the Axes aspect changes.
+
+ zorder : float or None, default: ``(2 + contour.get_zorder())``
+ zorder of the contour labels.
+
+ Returns
+ -------
+ labels
+ A list of `.Text` instances for the labels.
+ """
+
+ # Based on the input arguments, clabel() adds a list of "label
+ # specific" attributes to the ContourSet object. These attributes are
+ # all of the form label* and names should be fairly self explanatory.
+ #
+ # Once these attributes are set, clabel passes control to the labels()
+ # method (for automatic label placement) or blocking_input_loop and
+ # _contour_labeler_event_handler (for manual label placement).
+
+ if fmt is None:
+ fmt = ticker.ScalarFormatter(useOffset=False)
+ fmt.create_dummy_axis()
+ self.labelFmt = fmt
+ self._use_clabeltext = use_clabeltext
+ self.labelManual = manual
+ self.rightside_up = rightside_up
+ self._clabel_zorder = 2 + self.get_zorder() if zorder is None else zorder
+
+ if levels is None:
+ levels = self.levels
+ indices = list(range(len(self.cvalues)))
+ else:
+ levlabs = list(levels)
+ indices, levels = [], []
+ for i, lev in enumerate(self.levels):
+ if lev in levlabs:
+ indices.append(i)
+ levels.append(lev)
+ if len(levels) < len(levlabs):
+ raise ValueError(f"Specified levels {levlabs} don't match "
+ f"available levels {self.levels}")
+ self.labelLevelList = levels
+ self.labelIndiceList = indices
+
+ self._label_font_props = font_manager.FontProperties(size=fontsize)
+
+ if colors is None:
+ self.labelMappable = self
+ self.labelCValueList = np.take(self.cvalues, self.labelIndiceList)
+ else:
+ cmap = mcolors.ListedColormap(colors, N=len(self.labelLevelList))
+ self.labelCValueList = list(range(len(self.labelLevelList)))
+ self.labelMappable = cm.ScalarMappable(cmap=cmap,
+ norm=mcolors.NoNorm())
+
+ self.labelXYs = []
+
+ if np.iterable(manual):
+ for x, y in manual:
+ self.add_label_near(x, y, inline, inline_spacing)
+ elif manual:
+ print('Select label locations manually using first mouse button.')
+ print('End manual selection with second mouse button.')
+ if not inline:
+ print('Remove last label by clicking third mouse button.')
+ mpl._blocking_input.blocking_input_loop(
+ self.axes.get_figure(root=True),
+ ["button_press_event", "key_press_event"],
+ timeout=-1, handler=functools.partial(
+ _contour_labeler_event_handler,
+ self, inline, inline_spacing))
+ else:
+ self.labels(inline, inline_spacing)
+
+ return cbook.silent_list('text.Text', self.labelTexts)
+
+ def print_label(self, linecontour, labelwidth):
+ """Return whether a contour is long enough to hold a label."""
+ return (len(linecontour) > 10 * labelwidth
+ or (len(linecontour)
+ and (np.ptp(linecontour, axis=0) > 1.2 * labelwidth).any()))
+
+ def too_close(self, x, y, lw):
+ """Return whether a label is already near this location."""
+ thresh = (1.2 * lw) ** 2
+ return any((x - loc[0]) ** 2 + (y - loc[1]) ** 2 < thresh
+ for loc in self.labelXYs)
+
+ def _get_nth_label_width(self, nth):
+ """Return the width of the *nth* label, in pixels."""
+ fig = self.axes.get_figure(root=False)
+ renderer = fig.get_figure(root=True)._get_renderer()
+ return (Text(0, 0,
+ self.get_text(self.labelLevelList[nth], self.labelFmt),
+ figure=fig, fontproperties=self._label_font_props)
+ .get_window_extent(renderer).width)
+
+ def get_text(self, lev, fmt):
+ """Get the text of the label."""
+ if isinstance(lev, str):
+ return lev
+ elif isinstance(fmt, dict):
+ return fmt.get(lev, '%1.3f')
+ elif callable(getattr(fmt, "format_ticks", None)):
+ return fmt.format_ticks([*self.labelLevelList, lev])[-1]
+ elif callable(fmt):
+ return fmt(lev)
+ else:
+ return fmt % lev
+
+ def locate_label(self, linecontour, labelwidth):
+ """
+ Find good place to draw a label (relatively flat part of the contour).
+ """
+ ctr_size = len(linecontour)
+ n_blocks = int(np.ceil(ctr_size / labelwidth)) if labelwidth > 1 else 1
+ block_size = ctr_size if n_blocks == 1 else int(labelwidth)
+ # Split contour into blocks of length ``block_size``, filling the last
+ # block by cycling the contour start (per `np.resize` semantics). (Due
+ # to cycling, the index returned is taken modulo ctr_size.)
+ xx = np.resize(linecontour[:, 0], (n_blocks, block_size))
+ yy = np.resize(linecontour[:, 1], (n_blocks, block_size))
+ yfirst = yy[:, :1]
+ ylast = yy[:, -1:]
+ xfirst = xx[:, :1]
+ xlast = xx[:, -1:]
+ s = (yfirst - yy) * (xlast - xfirst) - (xfirst - xx) * (ylast - yfirst)
+ l = np.hypot(xlast - xfirst, ylast - yfirst)
+ # Ignore warning that divide by zero throws, as this is a valid option
+ with np.errstate(divide='ignore', invalid='ignore'):
+ distances = (abs(s) / l).sum(axis=-1)
+ # Labels are drawn in the middle of the block (``hbsize``) where the
+ # contour is the closest (per ``distances``) to a straight line, but
+ # not `too_close()` to a preexisting label.
+ hbsize = block_size // 2
+ adist = np.argsort(distances)
+ # If all candidates are `too_close()`, go back to the straightest part
+ # (``adist[0]``).
+ for idx in np.append(adist, adist[0]):
+ x, y = xx[idx, hbsize], yy[idx, hbsize]
+ if not self.too_close(x, y, labelwidth):
+ break
+ return x, y, (idx * block_size + hbsize) % ctr_size
+
+ def _split_path_and_get_label_rotation(self, path, idx, screen_pos, lw, spacing=5):
+ """
+ Prepare for insertion of a label at index *idx* of *path*.
+
+ Parameters
+ ----------
+ path : Path
+ The path where the label will be inserted, in data space.
+ idx : int
+ The vertex index after which the label will be inserted.
+ screen_pos : (float, float)
+ The position where the label will be inserted, in screen space.
+ lw : float
+ The label width, in screen space.
+ spacing : float
+ Extra spacing around the label, in screen space.
+
+ Returns
+ -------
+ path : Path
+ The path, broken so that the label can be drawn over it.
+ angle : float
+ The rotation of the label.
+
+ Notes
+ -----
+ Both tasks are done together to avoid calculating path lengths multiple times,
+ which is relatively costly.
+
+ The method used here involves computing the path length along the contour in
+ pixel coordinates and then looking (label width / 2) away from central point to
+ determine rotation and then to break contour if desired. The extra spacing is
+ taken into account when breaking the path, but not when computing the angle.
+ """
+ xys = path.vertices
+ codes = path.codes
+
+ # Insert a vertex at idx/pos (converting back to data space), if there isn't yet
+ # a vertex there. With infinite precision one could also always insert the
+ # extra vertex (it will get masked out by the label below anyways), but floating
+ # point inaccuracies (the point can have undergone a data->screen->data
+ # transform loop) can slightly shift the point and e.g. shift the angle computed
+ # below from exactly zero to nonzero.
+ pos = self.get_transform().inverted().transform(screen_pos)
+ if not np.allclose(pos, xys[idx]):
+ xys = np.insert(xys, idx, pos, axis=0)
+ codes = np.insert(codes, idx, Path.LINETO)
+
+ # Find the connected component where the label will be inserted. Note that a
+ # path always starts with a MOVETO, and we consider there's an implicit
+ # MOVETO (closing the last path) at the end.
+ movetos = (codes == Path.MOVETO).nonzero()[0]
+ start = movetos[movetos <= idx][-1]
+ try:
+ stop = movetos[movetos > idx][0]
+ except IndexError:
+ stop = len(codes)
+
+ # Restrict ourselves to the connected component.
+ cc_xys = xys[start:stop]
+ idx -= start
+
+ # If the path is closed, rotate it s.t. it starts at the label.
+ is_closed_path = codes[stop - 1] == Path.CLOSEPOLY
+ if is_closed_path:
+ cc_xys = np.concatenate([cc_xys[idx:-1], cc_xys[:idx+1]])
+ idx = 0
+
+ # Like np.interp, but additionally vectorized over fp.
+ def interp_vec(x, xp, fp): return [np.interp(x, xp, col) for col in fp.T]
+
+ # Use cumulative path lengths ("cpl") as curvilinear coordinate along contour.
+ screen_xys = self.get_transform().transform(cc_xys)
+ path_cpls = np.insert(
+ np.cumsum(np.hypot(*np.diff(screen_xys, axis=0).T)), 0, 0)
+ path_cpls -= path_cpls[idx]
+
+ # Use linear interpolation to get end coordinates of label.
+ target_cpls = np.array([-lw/2, lw/2])
+ if is_closed_path: # For closed paths, target from the other end.
+ target_cpls[0] += (path_cpls[-1] - path_cpls[0])
+ (sx0, sx1), (sy0, sy1) = interp_vec(target_cpls, path_cpls, screen_xys)
+ angle = np.rad2deg(np.arctan2(sy1 - sy0, sx1 - sx0)) # Screen space.
+ if self.rightside_up: # Fix angle so text is never upside-down
+ angle = (angle + 90) % 180 - 90
+
+ target_cpls += [-spacing, +spacing] # Expand range by spacing.
+
+ # Get indices near points of interest; use -1 as out of bounds marker.
+ i0, i1 = np.interp(target_cpls, path_cpls, range(len(path_cpls)),
+ left=-1, right=-1)
+ i0 = math.floor(i0)
+ i1 = math.ceil(i1)
+ (x0, x1), (y0, y1) = interp_vec(target_cpls, path_cpls, cc_xys)
+
+ # Actually break contours (dropping zero-len parts).
+ new_xy_blocks = []
+ new_code_blocks = []
+ if is_closed_path:
+ if i0 != -1 and i1 != -1:
+ # This is probably wrong in the case that the entire contour would
+ # be discarded, but ensures that a valid path is returned and is
+ # consistent with behavior of mpl <3.8
+ points = cc_xys[i1:i0+1]
+ new_xy_blocks.extend([[(x1, y1)], points, [(x0, y0)]])
+ nlines = len(points) + 1
+ new_code_blocks.extend([[Path.MOVETO], [Path.LINETO] * nlines])
+ else:
+ if i0 != -1:
+ new_xy_blocks.extend([cc_xys[:i0 + 1], [(x0, y0)]])
+ new_code_blocks.extend([[Path.MOVETO], [Path.LINETO] * (i0 + 1)])
+ if i1 != -1:
+ new_xy_blocks.extend([[(x1, y1)], cc_xys[i1:]])
+ new_code_blocks.extend([
+ [Path.MOVETO], [Path.LINETO] * (len(cc_xys) - i1)])
+
+ # Back to the full path.
+ xys = np.concatenate([xys[:start], *new_xy_blocks, xys[stop:]])
+ codes = np.concatenate([codes[:start], *new_code_blocks, codes[stop:]])
+
+ return angle, Path(xys, codes)
+
+ def add_label(self, x, y, rotation, lev, cvalue):
+ """Add a contour label, respecting whether *use_clabeltext* was set."""
+ data_x, data_y = self.axes.transData.inverted().transform((x, y))
+ t = Text(
+ data_x, data_y,
+ text=self.get_text(lev, self.labelFmt),
+ rotation=rotation,
+ horizontalalignment='center', verticalalignment='center',
+ zorder=self._clabel_zorder,
+ color=self.labelMappable.to_rgba(cvalue, alpha=self.get_alpha()),
+ fontproperties=self._label_font_props,
+ clip_box=self.axes.bbox)
+ if self._use_clabeltext:
+ data_rotation, = self.axes.transData.inverted().transform_angles(
+ [rotation], [[x, y]])
+ t.set(rotation=data_rotation, transform_rotates_text=True)
+ self.labelTexts.append(t)
+ self.labelCValues.append(cvalue)
+ self.labelXYs.append((x, y))
+ # Add label to plot here - useful for manual mode label selection
+ self.axes.add_artist(t)
+
+ def add_label_near(self, x, y, inline=True, inline_spacing=5,
+ transform=None):
+ """
+ Add a label near the point ``(x, y)``.
+
+ Parameters
+ ----------
+ x, y : float
+ The approximate location of the label.
+ inline : bool, default: True
+ If *True* remove the segment of the contour beneath the label.
+ inline_spacing : int, default: 5
+ Space in pixels to leave on each side of label when placing
+ inline. This spacing will be exact for labels at locations where
+ the contour is straight, less so for labels on curved contours.
+ transform : `.Transform` or `False`, default: ``self.axes.transData``
+ A transform applied to ``(x, y)`` before labeling. The default
+ causes ``(x, y)`` to be interpreted as data coordinates. `False`
+ is a synonym for `.IdentityTransform`; i.e. ``(x, y)`` should be
+ interpreted as display coordinates.
+ """
+
+ if transform is None:
+ transform = self.axes.transData
+ if transform:
+ x, y = transform.transform((x, y))
+
+ idx_level_min, idx_vtx_min, proj = self._find_nearest_contour(
+ (x, y), self.labelIndiceList)
+ path = self._paths[idx_level_min]
+ level = self.labelIndiceList.index(idx_level_min)
+ label_width = self._get_nth_label_width(level)
+ rotation, path = self._split_path_and_get_label_rotation(
+ path, idx_vtx_min, proj, label_width, inline_spacing)
+ self.add_label(*proj, rotation, self.labelLevelList[idx_level_min],
+ self.labelCValueList[idx_level_min])
+
+ if inline:
+ self._paths[idx_level_min] = path
+
+ def pop_label(self, index=-1):
+ """Defaults to removing last label, but any index can be supplied"""
+ self.labelCValues.pop(index)
+ t = self.labelTexts.pop(index)
+ t.remove()
+
+ def labels(self, inline, inline_spacing):
+ for idx, (icon, lev, cvalue) in enumerate(zip(
+ self.labelIndiceList,
+ self.labelLevelList,
+ self.labelCValueList,
+ )):
+ trans = self.get_transform()
+ label_width = self._get_nth_label_width(idx)
+ additions = []
+ for subpath in self._paths[icon]._iter_connected_components():
+ screen_xys = trans.transform(subpath.vertices)
+ # Check if long enough for a label
+ if self.print_label(screen_xys, label_width):
+ x, y, idx = self.locate_label(screen_xys, label_width)
+ rotation, path = self._split_path_and_get_label_rotation(
+ subpath, idx, (x, y),
+ label_width, inline_spacing)
+ self.add_label(x, y, rotation, lev, cvalue) # Really add label.
+ if inline: # If inline, add new contours
+ additions.append(path)
+ else: # If not adding label, keep old path
+ additions.append(subpath)
+ # After looping over all segments on a contour, replace old path by new one
+ # if inlining.
+ if inline:
+ self._paths[icon] = Path.make_compound_path(*additions)
+
+ def remove(self):
+ super().remove()
+ for text in self.labelTexts:
+ text.remove()
+
+
+def _find_closest_point_on_path(xys, p):
+ """
+ Parameters
+ ----------
+ xys : (N, 2) array-like
+ Coordinates of vertices.
+ p : (float, float)
+ Coordinates of point.
+
+ Returns
+ -------
+ d2min : float
+ Minimum square distance of *p* to *xys*.
+ proj : (float, float)
+ Projection of *p* onto *xys*.
+ imin : (int, int)
+ Consecutive indices of vertices of segment in *xys* where *proj* is.
+ Segments are considered as including their end-points; i.e. if the
+ closest point on the path is a node in *xys* with index *i*, this
+ returns ``(i-1, i)``. For the special case where *xys* is a single
+ point, this returns ``(0, 0)``.
+ """
+ if len(xys) == 1:
+ return (((p - xys[0]) ** 2).sum(), xys[0], (0, 0))
+ dxys = xys[1:] - xys[:-1] # Individual segment vectors.
+ norms = (dxys ** 2).sum(axis=1)
+ norms[norms == 0] = 1 # For zero-length segment, replace 0/0 by 0/1.
+ rel_projs = np.clip( # Project onto each segment in relative 0-1 coords.
+ ((p - xys[:-1]) * dxys).sum(axis=1) / norms,
+ 0, 1)[:, None]
+ projs = xys[:-1] + rel_projs * dxys # Projs. onto each segment, in (x, y).
+ d2s = ((projs - p) ** 2).sum(axis=1) # Squared distances.
+ imin = np.argmin(d2s)
+ return (d2s[imin], projs[imin], (imin, imin+1))
+
+
+_docstring.interpd.register(contour_set_attributes=r"""
+Attributes
+----------
+levels : array
+ The values of the contour levels.
+
+layers : array
+ Same as levels for line contours; half-way between
+ levels for filled contours. See ``ContourSet._process_colors``.
+""")
+
+
+@_docstring.interpd
+class ContourSet(ContourLabeler, mcoll.Collection):
+ """
+ Store a set of contour lines or filled regions.
+
+ User-callable method: `~.Axes.clabel`
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+
+ levels : [level0, level1, ..., leveln]
+ A list of floating point numbers indicating the contour levels.
+
+ allsegs : [level0segs, level1segs, ...]
+ List of all the polygon segments for all the *levels*.
+ For contour lines ``len(allsegs) == len(levels)``, and for
+ filled contour regions ``len(allsegs) = len(levels)-1``. The lists
+ should look like ::
+
+ level0segs = [polygon0, polygon1, ...]
+ polygon0 = [[x0, y0], [x1, y1], ...]
+
+ allkinds : ``None`` or [level0kinds, level1kinds, ...]
+ Optional list of all the polygon vertex kinds (code types), as
+ described and used in Path. This is used to allow multiply-
+ connected paths such as holes within filled polygons.
+ If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
+ should look like ::
+
+ level0kinds = [polygon0kinds, ...]
+ polygon0kinds = [vertexcode0, vertexcode1, ...]
+
+ If *allkinds* is not ``None``, usually all polygons for a
+ particular contour level are grouped together so that
+ ``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``.
+
+ **kwargs
+ Keyword arguments are as described in the docstring of
+ `~.Axes.contour`.
+
+ %(contour_set_attributes)s
+ """
+
+ def __init__(self, ax, *args,
+ levels=None, filled=False, linewidths=None, linestyles=None,
+ hatches=(None,), alpha=None, origin=None, extent=None,
+ cmap=None, colors=None, norm=None, vmin=None, vmax=None,
+ colorizer=None, extend='neither', antialiased=None, nchunk=0,
+ locator=None, transform=None, negative_linestyles=None, clip_path=None,
+ **kwargs):
+ """
+ Draw contour lines or filled regions, depending on
+ whether keyword arg *filled* is ``False`` (default) or ``True``.
+
+ Call signature::
+
+ ContourSet(ax, levels, allsegs, [allkinds], **kwargs)
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` object to draw on.
+
+ levels : [level0, level1, ..., leveln]
+ A list of floating point numbers indicating the contour
+ levels.
+
+ allsegs : [level0segs, level1segs, ...]
+ List of all the polygon segments for all the *levels*.
+ For contour lines ``len(allsegs) == len(levels)``, and for
+ filled contour regions ``len(allsegs) = len(levels)-1``. The lists
+ should look like ::
+
+ level0segs = [polygon0, polygon1, ...]
+ polygon0 = [[x0, y0], [x1, y1], ...]
+
+ allkinds : [level0kinds, level1kinds, ...], optional
+ Optional list of all the polygon vertex kinds (code types), as
+ described and used in Path. This is used to allow multiply-
+ connected paths such as holes within filled polygons.
+ If not ``None``, ``len(allkinds) == len(allsegs)``. The lists
+ should look like ::
+
+ level0kinds = [polygon0kinds, ...]
+ polygon0kinds = [vertexcode0, vertexcode1, ...]
+
+ If *allkinds* is not ``None``, usually all polygons for a
+ particular contour level are grouped together so that
+ ``level0segs = [polygon0]`` and ``level0kinds = [polygon0kinds]``.
+
+ **kwargs
+ Keyword arguments are as described in the docstring of
+ `~.Axes.contour`.
+ """
+ if antialiased is None and filled:
+ # Eliminate artifacts; we are not stroking the boundaries.
+ antialiased = False
+ # The default for line contours will be taken from the
+ # LineCollection default, which uses :rc:`lines.antialiased`.
+ super().__init__(
+ antialiaseds=antialiased,
+ alpha=alpha,
+ clip_path=clip_path,
+ transform=transform,
+ colorizer=colorizer,
+ )
+ self.axes = ax
+ self.levels = levels
+ self.filled = filled
+ self.hatches = hatches
+ self.origin = origin
+ self.extent = extent
+ self.colors = colors
+ self.extend = extend
+
+ self.nchunk = nchunk
+ self.locator = locator
+
+ if colorizer:
+ self._set_colorizer_check_keywords(colorizer, cmap=cmap,
+ norm=norm, vmin=vmin,
+ vmax=vmax, colors=colors)
+ norm = colorizer.norm
+ cmap = colorizer.cmap
+ if (isinstance(norm, mcolors.LogNorm)
+ or isinstance(self.locator, ticker.LogLocator)):
+ self.logscale = True
+ if norm is None:
+ norm = mcolors.LogNorm()
+ else:
+ self.logscale = False
+
+ _api.check_in_list([None, 'lower', 'upper', 'image'], origin=origin)
+ if self.extent is not None and len(self.extent) != 4:
+ raise ValueError(
+ "If given, 'extent' must be None or (x0, x1, y0, y1)")
+ if self.colors is not None and cmap is not None:
+ raise ValueError('Either colors or cmap must be None')
+ if self.origin == 'image':
+ self.origin = mpl.rcParams['image.origin']
+
+ self._orig_linestyles = linestyles # Only kept for user access.
+ self.negative_linestyles = negative_linestyles
+ # If negative_linestyles was not defined as a keyword argument, define
+ # negative_linestyles with rcParams
+ if self.negative_linestyles is None:
+ self.negative_linestyles = \
+ mpl.rcParams['contour.negative_linestyle']
+
+ kwargs = self._process_args(*args, **kwargs)
+ self._process_levels()
+
+ self._extend_min = self.extend in ['min', 'both']
+ self._extend_max = self.extend in ['max', 'both']
+ if self.colors is not None:
+ if mcolors.is_color_like(self.colors):
+ color_sequence = [self.colors]
+ else:
+ color_sequence = self.colors
+
+ ncolors = len(self.levels)
+ if self.filled:
+ ncolors -= 1
+ i0 = 0
+
+ # Handle the case where colors are given for the extended
+ # parts of the contour.
+
+ use_set_under_over = False
+ # if we are extending the lower end, and we've been given enough
+ # colors then skip the first color in the resulting cmap. For the
+ # extend_max case we don't need to worry about passing more colors
+ # than ncolors as ListedColormap will clip.
+ total_levels = (ncolors +
+ int(self._extend_min) +
+ int(self._extend_max))
+ if (len(color_sequence) == total_levels and
+ (self._extend_min or self._extend_max)):
+ use_set_under_over = True
+ if self._extend_min:
+ i0 = 1
+
+ cmap = mcolors.ListedColormap(color_sequence[i0:None], N=ncolors)
+
+ if use_set_under_over:
+ if self._extend_min:
+ cmap.set_under(color_sequence[0])
+ if self._extend_max:
+ cmap.set_over(color_sequence[-1])
+
+ # label lists must be initialized here
+ self.labelTexts = []
+ self.labelCValues = []
+
+ self.set_cmap(cmap)
+ if norm is not None:
+ self.set_norm(norm)
+ with self.norm.callbacks.blocked(signal="changed"):
+ if vmin is not None:
+ self.norm.vmin = vmin
+ if vmax is not None:
+ self.norm.vmax = vmax
+ self.norm._changed()
+ self._process_colors()
+
+ if self._paths is None:
+ self._paths = self._make_paths_from_contour_generator()
+
+ if self.filled:
+ if linewidths is not None:
+ _api.warn_external('linewidths is ignored by contourf')
+ # Lower and upper contour levels.
+ lowers, uppers = self._get_lowers_and_uppers()
+ self.set(
+ edgecolor="none",
+ # Default zorder taken from Collection
+ zorder=kwargs.pop("zorder", 1),
+ )
+
+ else:
+ self.set(
+ facecolor="none",
+ linewidths=self._process_linewidths(linewidths),
+ linestyle=self._process_linestyles(linestyles),
+ # Default zorder taken from LineCollection, which is higher
+ # than for filled contours so that lines are displayed on top.
+ zorder=kwargs.pop("zorder", 2),
+ label="_nolegend_",
+ )
+
+ self.axes.add_collection(self, autolim=False)
+ self.sticky_edges.x[:] = [self._mins[0], self._maxs[0]]
+ self.sticky_edges.y[:] = [self._mins[1], self._maxs[1]]
+ self.axes.update_datalim([self._mins, self._maxs])
+ self.axes.autoscale_view(tight=True)
+
+ self.changed() # set the colors
+
+ if kwargs:
+ _api.warn_external(
+ 'The following kwargs were not used by contour: ' +
+ ", ".join(map(repr, kwargs))
+ )
+
+ allsegs = property(lambda self: [
+ [subp.vertices for subp in p._iter_connected_components()]
+ for p in self.get_paths()])
+ allkinds = property(lambda self: [
+ [subp.codes for subp in p._iter_connected_components()]
+ for p in self.get_paths()])
+ alpha = property(lambda self: self.get_alpha())
+ linestyles = property(lambda self: self._orig_linestyles)
+
+ def get_transform(self):
+ """Return the `.Transform` instance used by this ContourSet."""
+ if self._transform is None:
+ self._transform = self.axes.transData
+ elif (not isinstance(self._transform, mtransforms.Transform)
+ and hasattr(self._transform, '_as_mpl_transform')):
+ self._transform = self._transform._as_mpl_transform(self.axes)
+ return self._transform
+
+ def __getstate__(self):
+ state = self.__dict__.copy()
+ # the C object _contour_generator cannot currently be pickled. This
+ # isn't a big issue as it is not actually used once the contour has
+ # been calculated.
+ state['_contour_generator'] = None
+ return state
+
+ def legend_elements(self, variable_name='x', str_format=str):
+ """
+ Return a list of artists and labels suitable for passing through
+ to `~.Axes.legend` which represent this ContourSet.
+
+ The labels have the form "0 < x <= 1" stating the data ranges which
+ the artists represent.
+
+ Parameters
+ ----------
+ variable_name : str
+ The string used inside the inequality used on the labels.
+ str_format : function: float -> str
+ Function used to format the numbers in the labels.
+
+ Returns
+ -------
+ artists : list[`.Artist`]
+ A list of the artists.
+ labels : list[str]
+ A list of the labels.
+ """
+ artists = []
+ labels = []
+
+ if self.filled:
+ lowers, uppers = self._get_lowers_and_uppers()
+ n_levels = len(self._paths)
+ for idx in range(n_levels):
+ artists.append(mpatches.Rectangle(
+ (0, 0), 1, 1,
+ facecolor=self.get_facecolor()[idx],
+ hatch=self.hatches[idx % len(self.hatches)],
+ ))
+ lower = str_format(lowers[idx])
+ upper = str_format(uppers[idx])
+ if idx == 0 and self.extend in ('min', 'both'):
+ labels.append(fr'${variable_name} \leq {lower}s$')
+ elif idx == n_levels - 1 and self.extend in ('max', 'both'):
+ labels.append(fr'${variable_name} > {upper}s$')
+ else:
+ labels.append(fr'${lower} < {variable_name} \leq {upper}$')
+ else:
+ for idx, level in enumerate(self.levels):
+ artists.append(Line2D(
+ [], [],
+ color=self.get_edgecolor()[idx],
+ linewidth=self.get_linewidths()[idx],
+ linestyle=self.get_linestyles()[idx],
+ ))
+ labels.append(fr'${variable_name} = {str_format(level)}$')
+
+ return artists, labels
+
+ def _process_args(self, *args, **kwargs):
+ """
+ Process *args* and *kwargs*; override in derived classes.
+
+ Must set self.levels, self.zmin and self.zmax, and update Axes limits.
+ """
+ self.levels = args[0]
+ allsegs = args[1]
+ allkinds = args[2] if len(args) > 2 else None
+ self.zmax = np.max(self.levels)
+ self.zmin = np.min(self.levels)
+
+ if allkinds is None:
+ allkinds = [[None] * len(segs) for segs in allsegs]
+
+ # Check lengths of levels and allsegs.
+ if self.filled:
+ if len(allsegs) != len(self.levels) - 1:
+ raise ValueError('must be one less number of segments as '
+ 'levels')
+ else:
+ if len(allsegs) != len(self.levels):
+ raise ValueError('must be same number of segments as levels')
+
+ # Check length of allkinds.
+ if len(allkinds) != len(allsegs):
+ raise ValueError('allkinds has different length to allsegs')
+
+ # Determine x, y bounds and update axes data limits.
+ flatseglist = [s for seg in allsegs for s in seg]
+ points = np.concatenate(flatseglist, axis=0)
+ self._mins = points.min(axis=0)
+ self._maxs = points.max(axis=0)
+
+ # Each entry in (allsegs, allkinds) is a list of (segs, kinds): segs is a list
+ # of (N, 2) arrays of xy coordinates, kinds is a list of arrays of corresponding
+ # pathcodes. However, kinds can also be None; in which case all paths in that
+ # list are codeless (this case is normalized above). These lists are used to
+ # construct paths, which then get concatenated.
+ self._paths = [Path.make_compound_path(*map(Path, segs, kinds))
+ for segs, kinds in zip(allsegs, allkinds)]
+
+ return kwargs
+
+ def _make_paths_from_contour_generator(self):
+ """Compute ``paths`` using C extension."""
+ if self._paths is not None:
+ return self._paths
+ cg = self._contour_generator
+ empty_path = Path(np.empty((0, 2)))
+ vertices_and_codes = (
+ map(cg.create_filled_contour, *self._get_lowers_and_uppers())
+ if self.filled else
+ map(cg.create_contour, self.levels))
+ return [Path(np.concatenate(vs), np.concatenate(cs)) if len(vs) else empty_path
+ for vs, cs in vertices_and_codes]
+
+ def _get_lowers_and_uppers(self):
+ """
+ Return ``(lowers, uppers)`` for filled contours.
+ """
+ lowers = self._levels[:-1]
+ if self.zmin == lowers[0]:
+ # Include minimum values in lowest interval
+ lowers = lowers.copy() # so we don't change self._levels
+ if self.logscale:
+ lowers[0] = 0.99 * self.zmin
+ else:
+ lowers[0] -= 1
+ uppers = self._levels[1:]
+ return (lowers, uppers)
+
+ def changed(self):
+ if not hasattr(self, "cvalues"):
+ self._process_colors() # Sets cvalues.
+ # Force an autoscale immediately because self.to_rgba() calls
+ # autoscale_None() internally with the data passed to it,
+ # so if vmin/vmax are not set yet, this would override them with
+ # content from *cvalues* rather than levels like we want
+ self.norm.autoscale_None(self.levels)
+ self.set_array(self.cvalues)
+ self.update_scalarmappable()
+ alphas = np.broadcast_to(self.get_alpha(), len(self.cvalues))
+ for label, cv, alpha in zip(self.labelTexts, self.labelCValues, alphas):
+ label.set_alpha(alpha)
+ label.set_color(self.labelMappable.to_rgba(cv))
+ super().changed()
+
+ def _autolev(self, N):
+ """
+ Select contour levels to span the data.
+
+ The target number of levels, *N*, is used only when the
+ scale is not log and default locator is used.
+
+ We need two more levels for filled contours than for
+ line contours, because for the latter we need to specify
+ the lower and upper boundary of each range. For example,
+ a single contour boundary, say at z = 0, requires only
+ one contour line, but two filled regions, and therefore
+ three levels to provide boundaries for both regions.
+ """
+ if self.locator is None:
+ if self.logscale:
+ self.locator = ticker.LogLocator()
+ else:
+ self.locator = ticker.MaxNLocator(N + 1, min_n_ticks=1)
+
+ lev = self.locator.tick_values(self.zmin, self.zmax)
+
+ try:
+ if self.locator._symmetric:
+ return lev
+ except AttributeError:
+ pass
+
+ # Trim excess levels the locator may have supplied.
+ under = np.nonzero(lev < self.zmin)[0]
+ i0 = under[-1] if len(under) else 0
+ over = np.nonzero(lev > self.zmax)[0]
+ i1 = over[0] + 1 if len(over) else len(lev)
+ if self.extend in ('min', 'both'):
+ i0 += 1
+ if self.extend in ('max', 'both'):
+ i1 -= 1
+
+ if i1 - i0 < 3:
+ i0, i1 = 0, len(lev)
+
+ return lev[i0:i1]
+
+ def _process_contour_level_args(self, args, z_dtype):
+ """
+ Determine the contour levels and store in self.levels.
+ """
+ if self.levels is None:
+ if args:
+ levels_arg = args[0]
+ elif np.issubdtype(z_dtype, bool):
+ if self.filled:
+ levels_arg = [0, .5, 1]
+ else:
+ levels_arg = [.5]
+ else:
+ levels_arg = 7 # Default, hard-wired.
+ else:
+ levels_arg = self.levels
+ if isinstance(levels_arg, Integral):
+ self.levels = self._autolev(levels_arg)
+ else:
+ self.levels = np.asarray(levels_arg, np.float64)
+ if self.filled and len(self.levels) < 2:
+ raise ValueError("Filled contours require at least 2 levels.")
+ if len(self.levels) > 1 and np.min(np.diff(self.levels)) <= 0.0:
+ raise ValueError("Contour levels must be increasing")
+
+ def _process_levels(self):
+ """
+ Assign values to :attr:`layers` based on :attr:`levels`,
+ adding extended layers as needed if contours are filled.
+
+ For line contours, layers simply coincide with levels;
+ a line is a thin layer. No extended levels are needed
+ with line contours.
+ """
+ # Make a private _levels to include extended regions; we
+ # want to leave the original levels attribute unchanged.
+ # (Colorbar needs this even for line contours.)
+ self._levels = list(self.levels)
+
+ if self.logscale:
+ lower, upper = 1e-250, 1e250
+ else:
+ lower, upper = -1e250, 1e250
+
+ if self.extend in ('both', 'min'):
+ self._levels.insert(0, lower)
+ if self.extend in ('both', 'max'):
+ self._levels.append(upper)
+ self._levels = np.asarray(self._levels)
+
+ if not self.filled:
+ self.layers = self.levels
+ return
+
+ # Layer values are mid-way between levels in screen space.
+ if self.logscale:
+ # Avoid overflow by taking sqrt before multiplying.
+ self.layers = (np.sqrt(self._levels[:-1])
+ * np.sqrt(self._levels[1:]))
+ else:
+ self.layers = 0.5 * (self._levels[:-1] + self._levels[1:])
+
+ def _process_colors(self):
+ """
+ Color argument processing for contouring.
+
+ Note that we base the colormapping on the contour levels
+ and layers, not on the actual range of the Z values. This
+ means we don't have to worry about bad values in Z, and we
+ always have the full dynamic range available for the selected
+ levels.
+
+ The color is based on the midpoint of the layer, except for
+ extended end layers. By default, the norm vmin and vmax
+ are the extreme values of the non-extended levels. Hence,
+ the layer color extremes are not the extreme values of
+ the colormap itself, but approach those values as the number
+ of levels increases. An advantage of this scheme is that
+ line contours, when added to filled contours, take on
+ colors that are consistent with those of the filled regions;
+ for example, a contour line on the boundary between two
+ regions will have a color intermediate between those
+ of the regions.
+
+ """
+ self.monochrome = self.cmap.monochrome
+ if self.colors is not None:
+ # Generate integers for direct indexing.
+ i0, i1 = 0, len(self.levels)
+ if self.filled:
+ i1 -= 1
+ # Out of range indices for over and under:
+ if self.extend in ('both', 'min'):
+ i0 -= 1
+ if self.extend in ('both', 'max'):
+ i1 += 1
+ self.cvalues = list(range(i0, i1))
+ self.set_norm(mcolors.NoNorm())
+ else:
+ self.cvalues = self.layers
+ self.norm.autoscale_None(self.levels)
+ self.set_array(self.cvalues)
+ self.update_scalarmappable()
+ if self.extend in ('both', 'max', 'min'):
+ self.norm.clip = False
+
+ def _process_linewidths(self, linewidths):
+ Nlev = len(self.levels)
+ if linewidths is None:
+ default_linewidth = mpl.rcParams['contour.linewidth']
+ if default_linewidth is None:
+ default_linewidth = mpl.rcParams['lines.linewidth']
+ return [default_linewidth] * Nlev
+ elif not np.iterable(linewidths):
+ return [linewidths] * Nlev
+ else:
+ linewidths = list(linewidths)
+ return (linewidths * math.ceil(Nlev / len(linewidths)))[:Nlev]
+
+ def _process_linestyles(self, linestyles):
+ Nlev = len(self.levels)
+ if linestyles is None:
+ tlinestyles = ['solid'] * Nlev
+ if self.monochrome:
+ eps = - (self.zmax - self.zmin) * 1e-15
+ for i, lev in enumerate(self.levels):
+ if lev < eps:
+ tlinestyles[i] = self.negative_linestyles
+ else:
+ if isinstance(linestyles, str):
+ tlinestyles = [linestyles] * Nlev
+ elif np.iterable(linestyles):
+ tlinestyles = list(linestyles)
+ if len(tlinestyles) < Nlev:
+ nreps = int(np.ceil(Nlev / len(linestyles)))
+ tlinestyles = tlinestyles * nreps
+ if len(tlinestyles) > Nlev:
+ tlinestyles = tlinestyles[:Nlev]
+ else:
+ raise ValueError("Unrecognized type for linestyles kwarg")
+ return tlinestyles
+
+ def _find_nearest_contour(self, xy, indices=None):
+ """
+ Find the point in the unfilled contour plot that is closest (in screen
+ space) to point *xy*.
+
+ Parameters
+ ----------
+ xy : tuple[float, float]
+ The reference point (in screen space).
+ indices : list of int or None, default: None
+ Indices of contour levels to consider. If None (the default), all levels
+ are considered.
+
+ Returns
+ -------
+ idx_level_min : int
+ The index of the contour level closest to *xy*.
+ idx_vtx_min : int
+ The index of the `.Path` segment closest to *xy* (at that level).
+ proj : (float, float)
+ The point in the contour plot closest to *xy*.
+ """
+
+ # Convert each contour segment to pixel coordinates and then compare the given
+ # point to those coordinates for each contour. This is fast enough in normal
+ # cases, but speedups may be possible.
+
+ if self.filled:
+ raise ValueError("Method does not support filled contours")
+
+ if indices is None:
+ indices = range(len(self._paths))
+
+ d2min = np.inf
+ idx_level_min = idx_vtx_min = proj_min = None
+
+ for idx_level in indices:
+ path = self._paths[idx_level]
+ idx_vtx_start = 0
+ for subpath in path._iter_connected_components():
+ if not len(subpath.vertices):
+ continue
+ lc = self.get_transform().transform(subpath.vertices)
+ d2, proj, leg = _find_closest_point_on_path(lc, xy)
+ if d2 < d2min:
+ d2min = d2
+ idx_level_min = idx_level
+ idx_vtx_min = leg[1] + idx_vtx_start
+ proj_min = proj
+ idx_vtx_start += len(subpath)
+
+ return idx_level_min, idx_vtx_min, proj_min
+
+ def find_nearest_contour(self, x, y, indices=None, pixel=True):
+ """
+ Find the point in the contour plot that is closest to ``(x, y)``.
+
+ This method does not support filled contours.
+
+ Parameters
+ ----------
+ x, y : float
+ The reference point.
+ indices : list of int or None, default: None
+ Indices of contour levels to consider. If None (the default), all
+ levels are considered.
+ pixel : bool, default: True
+ If *True*, measure distance in pixel (screen) space, which is
+ useful for manual contour labeling; else, measure distance in axes
+ space.
+
+ Returns
+ -------
+ path : int
+ The index of the path that is closest to ``(x, y)``. Each path corresponds
+ to one contour level.
+ subpath : int
+ The index within that closest path of the subpath that is closest to
+ ``(x, y)``. Each subpath corresponds to one unbroken contour line.
+ index : int
+ The index of the vertices within that subpath that are closest to
+ ``(x, y)``.
+ xmin, ymin : float
+ The point in the contour plot that is closest to ``(x, y)``.
+ d2 : float
+ The squared distance from ``(xmin, ymin)`` to ``(x, y)``.
+ """
+ segment = index = d2 = None
+
+ with ExitStack() as stack:
+ if not pixel:
+ # _find_nearest_contour works in pixel space. We want axes space, so
+ # effectively disable the transformation here by setting to identity.
+ stack.enter_context(self._cm_set(
+ transform=mtransforms.IdentityTransform()))
+
+ i_level, i_vtx, (xmin, ymin) = self._find_nearest_contour((x, y), indices)
+
+ if i_level is not None:
+ cc_cumlens = np.cumsum(
+ [*map(len, self._paths[i_level]._iter_connected_components())])
+ segment = cc_cumlens.searchsorted(i_vtx, "right")
+ index = i_vtx if segment == 0 else i_vtx - cc_cumlens[segment - 1]
+ d2 = (xmin-x)**2 + (ymin-y)**2
+
+ return (i_level, segment, index, xmin, ymin, d2)
+
+ def draw(self, renderer):
+ paths = self._paths
+ n_paths = len(paths)
+ if not self.filled or all(hatch is None for hatch in self.hatches):
+ super().draw(renderer)
+ return
+ # In presence of hatching, draw contours one at a time.
+ edgecolors = self.get_edgecolors()
+ if edgecolors.size == 0:
+ edgecolors = ("none",)
+ for idx in range(n_paths):
+ with cbook._setattr_cm(self, _paths=[paths[idx]]), self._cm_set(
+ hatch=self.hatches[idx % len(self.hatches)],
+ array=[self.get_array()[idx]],
+ linewidths=[self.get_linewidths()[idx % len(self.get_linewidths())]],
+ linestyles=[self.get_linestyles()[idx % len(self.get_linestyles())]],
+ edgecolors=edgecolors[idx % len(edgecolors)],
+ ):
+ super().draw(renderer)
+
+
+@_docstring.interpd
+class QuadContourSet(ContourSet):
+ """
+ Create and store a set of contour lines or filled regions.
+
+ This class is typically not instantiated directly by the user but by
+ `~.Axes.contour` and `~.Axes.contourf`.
+
+ %(contour_set_attributes)s
+ """
+
+ def _process_args(self, *args, corner_mask=None, algorithm=None, **kwargs):
+ """
+ Process args and kwargs.
+ """
+ if args and isinstance(args[0], QuadContourSet):
+ if self.levels is None:
+ self.levels = args[0].levels
+ self.zmin = args[0].zmin
+ self.zmax = args[0].zmax
+ self._corner_mask = args[0]._corner_mask
+ contour_generator = args[0]._contour_generator
+ self._mins = args[0]._mins
+ self._maxs = args[0]._maxs
+ self._algorithm = args[0]._algorithm
+ else:
+ import contourpy
+
+ if algorithm is None:
+ algorithm = mpl.rcParams['contour.algorithm']
+ mpl.rcParams.validate["contour.algorithm"](algorithm)
+ self._algorithm = algorithm
+
+ if corner_mask is None:
+ if self._algorithm == "mpl2005":
+ # mpl2005 does not support corner_mask=True so if not
+ # specifically requested then disable it.
+ corner_mask = False
+ else:
+ corner_mask = mpl.rcParams['contour.corner_mask']
+ self._corner_mask = corner_mask
+
+ x, y, z = self._contour_args(args, kwargs)
+
+ contour_generator = contourpy.contour_generator(
+ x, y, z, name=self._algorithm, corner_mask=self._corner_mask,
+ line_type=contourpy.LineType.SeparateCode,
+ fill_type=contourpy.FillType.OuterCode,
+ chunk_size=self.nchunk)
+
+ t = self.get_transform()
+
+ # if the transform is not trans data, and some part of it
+ # contains transData, transform the xs and ys to data coordinates
+ if (t != self.axes.transData and
+ any(t.contains_branch_seperately(self.axes.transData))):
+ trans_to_data = t - self.axes.transData
+ pts = np.vstack([x.flat, y.flat]).T
+ transformed_pts = trans_to_data.transform(pts)
+ x = transformed_pts[..., 0]
+ y = transformed_pts[..., 1]
+
+ self._mins = [ma.min(x), ma.min(y)]
+ self._maxs = [ma.max(x), ma.max(y)]
+
+ self._contour_generator = contour_generator
+
+ return kwargs
+
+ def _contour_args(self, args, kwargs):
+ if self.filled:
+ fn = 'contourf'
+ else:
+ fn = 'contour'
+ nargs = len(args)
+
+ if 0 < nargs <= 2:
+ z, *args = args
+ z = ma.asarray(z)
+ x, y = self._initialize_x_y(z)
+ elif 2 < nargs <= 4:
+ x, y, z_orig, *args = args
+ x, y, z = self._check_xyz(x, y, z_orig, kwargs)
+
+ else:
+ raise _api.nargs_error(fn, takes="from 1 to 4", given=nargs)
+ z = ma.masked_invalid(z, copy=False)
+ self.zmax = z.max().astype(float)
+ self.zmin = z.min().astype(float)
+ if self.logscale and self.zmin <= 0:
+ z = ma.masked_where(z <= 0, z)
+ _api.warn_external('Log scale: values of z <= 0 have been masked')
+ self.zmin = z.min().astype(float)
+ self._process_contour_level_args(args, z.dtype)
+ return (x, y, z)
+
+ def _check_xyz(self, x, y, z, kwargs):
+ """
+ Check that the shapes of the input arrays match; if x and y are 1D,
+ convert them to 2D using meshgrid.
+ """
+ x, y = self.axes._process_unit_info([("x", x), ("y", y)], kwargs)
+
+ x = np.asarray(x, dtype=np.float64)
+ y = np.asarray(y, dtype=np.float64)
+ z = ma.asarray(z)
+
+ if z.ndim != 2:
+ raise TypeError(f"Input z must be 2D, not {z.ndim}D")
+ if z.shape[0] < 2 or z.shape[1] < 2:
+ raise TypeError(f"Input z must be at least a (2, 2) shaped array, "
+ f"but has shape {z.shape}")
+ Ny, Nx = z.shape
+
+ if x.ndim != y.ndim:
+ raise TypeError(f"Number of dimensions of x ({x.ndim}) and y "
+ f"({y.ndim}) do not match")
+ if x.ndim == 1:
+ nx, = x.shape
+ ny, = y.shape
+ if nx != Nx:
+ raise TypeError(f"Length of x ({nx}) must match number of "
+ f"columns in z ({Nx})")
+ if ny != Ny:
+ raise TypeError(f"Length of y ({ny}) must match number of "
+ f"rows in z ({Ny})")
+ x, y = np.meshgrid(x, y)
+ elif x.ndim == 2:
+ if x.shape != z.shape:
+ raise TypeError(
+ f"Shapes of x {x.shape} and z {z.shape} do not match")
+ if y.shape != z.shape:
+ raise TypeError(
+ f"Shapes of y {y.shape} and z {z.shape} do not match")
+ else:
+ raise TypeError(f"Inputs x and y must be 1D or 2D, not {x.ndim}D")
+
+ return x, y, z
+
+ def _initialize_x_y(self, z):
+ """
+ Return X, Y arrays such that contour(Z) will match imshow(Z)
+ if origin is not None.
+ The center of pixel Z[i, j] depends on origin:
+ if origin is None, x = j, y = i;
+ if origin is 'lower', x = j + 0.5, y = i + 0.5;
+ if origin is 'upper', x = j + 0.5, y = Nrows - i - 0.5
+ If extent is not None, x and y will be scaled to match,
+ as in imshow.
+ If origin is None and extent is not None, then extent
+ will give the minimum and maximum values of x and y.
+ """
+ if z.ndim != 2:
+ raise TypeError(f"Input z must be 2D, not {z.ndim}D")
+ elif z.shape[0] < 2 or z.shape[1] < 2:
+ raise TypeError(f"Input z must be at least a (2, 2) shaped array, "
+ f"but has shape {z.shape}")
+ else:
+ Ny, Nx = z.shape
+ if self.origin is None: # Not for image-matching.
+ if self.extent is None:
+ return np.meshgrid(np.arange(Nx), np.arange(Ny))
+ else:
+ x0, x1, y0, y1 = self.extent
+ x = np.linspace(x0, x1, Nx)
+ y = np.linspace(y0, y1, Ny)
+ return np.meshgrid(x, y)
+ # Match image behavior:
+ if self.extent is None:
+ x0, x1, y0, y1 = (0, Nx, 0, Ny)
+ else:
+ x0, x1, y0, y1 = self.extent
+ dx = (x1 - x0) / Nx
+ dy = (y1 - y0) / Ny
+ x = x0 + (np.arange(Nx) + 0.5) * dx
+ y = y0 + (np.arange(Ny) + 0.5) * dy
+ if self.origin == 'upper':
+ y = y[::-1]
+ return np.meshgrid(x, y)
+
+
+_docstring.interpd.register(contour_doc="""
+`.contour` and `.contourf` draw contour lines and filled contours,
+respectively. Except as noted, function signatures and return values
+are the same for both versions.
+
+Parameters
+----------
+X, Y : array-like, optional
+ The coordinates of the values in *Z*.
+
+ *X* and *Y* must both be 2D with the same shape as *Z* (e.g.
+ created via `numpy.meshgrid`), or they must both be 1-D such
+ that ``len(X) == N`` is the number of columns in *Z* and
+ ``len(Y) == M`` is the number of rows in *Z*.
+
+ *X* and *Y* must both be ordered monotonically.
+
+ If not given, they are assumed to be integer indices, i.e.
+ ``X = range(N)``, ``Y = range(M)``.
+
+Z : (M, N) array-like
+ The height values over which the contour is drawn. Color-mapping is
+ controlled by *cmap*, *norm*, *vmin*, and *vmax*.
+
+levels : int or array-like, optional
+ Determines the number and positions of the contour lines / regions.
+
+ If an int *n*, use `~matplotlib.ticker.MaxNLocator`, which tries
+ to automatically choose no more than *n+1* "nice" contour levels
+ between minimum and maximum numeric values of *Z*.
+
+ If array-like, draw contour lines at the specified levels.
+ The values must be in increasing order.
+
+Returns
+-------
+`~.contour.QuadContourSet`
+
+Other Parameters
+----------------
+corner_mask : bool, default: :rc:`contour.corner_mask`
+ Enable/disable corner masking, which only has an effect if *Z* is
+ a masked array. If ``False``, any quad touching a masked point is
+ masked out. If ``True``, only the triangular corners of quads
+ nearest those points are always masked out, other triangular
+ corners comprising three unmasked points are contoured as usual.
+
+colors : :mpltype:`color` or list of :mpltype:`color`, optional
+ The colors of the levels, i.e. the lines for `.contour` and the
+ areas for `.contourf`.
+
+ The sequence is cycled for the levels in ascending order. If the
+ sequence is shorter than the number of levels, it's repeated.
+
+ As a shortcut, a single color may be used in place of one-element lists, i.e.
+ ``'red'`` instead of ``['red']`` to color all levels with the same color.
+
+ .. versionchanged:: 3.10
+ Previously a single color had to be expressed as a string, but now any
+ valid color format may be passed.
+
+ By default (value *None*), the colormap specified by *cmap*
+ will be used.
+
+alpha : float, default: 1
+ The alpha blending value, between 0 (transparent) and 1 (opaque).
+
+%(cmap_doc)s
+
+ This parameter is ignored if *colors* is set.
+
+%(norm_doc)s
+
+ This parameter is ignored if *colors* is set.
+
+%(vmin_vmax_doc)s
+
+ If *vmin* or *vmax* are not given, the default color scaling is based on
+ *levels*.
+
+ This parameter is ignored if *colors* is set.
+
+%(colorizer_doc)s
+
+ This parameter is ignored if *colors* is set.
+
+origin : {*None*, 'upper', 'lower', 'image'}, default: None
+ Determines the orientation and exact position of *Z* by specifying
+ the position of ``Z[0, 0]``. This is only relevant, if *X*, *Y*
+ are not given.
+
+ - *None*: ``Z[0, 0]`` is at X=0, Y=0 in the lower left corner.
+ - 'lower': ``Z[0, 0]`` is at X=0.5, Y=0.5 in the lower left corner.
+ - 'upper': ``Z[0, 0]`` is at X=N+0.5, Y=0.5 in the upper left
+ corner.
+ - 'image': Use the value from :rc:`image.origin`.
+
+extent : (x0, x1, y0, y1), optional
+ If *origin* is not *None*, then *extent* is interpreted as in
+ `.imshow`: it gives the outer pixel boundaries. In this case, the
+ position of Z[0, 0] is the center of the pixel, not a corner. If
+ *origin* is *None*, then (*x0*, *y0*) is the position of Z[0, 0],
+ and (*x1*, *y1*) is the position of Z[-1, -1].
+
+ This argument is ignored if *X* and *Y* are specified in the call
+ to contour.
+
+locator : ticker.Locator subclass, optional
+ The locator is used to determine the contour levels if they
+ are not given explicitly via *levels*.
+ Defaults to `~.ticker.MaxNLocator`.
+
+extend : {'neither', 'both', 'min', 'max'}, default: 'neither'
+ Determines the ``contourf``-coloring of values that are outside the
+ *levels* range.
+
+ If 'neither', values outside the *levels* range are not colored.
+ If 'min', 'max' or 'both', color the values below, above or below
+ and above the *levels* range.
+
+ Values below ``min(levels)`` and above ``max(levels)`` are mapped
+ to the under/over values of the `.Colormap`. Note that most
+ colormaps do not have dedicated colors for these by default, so
+ that the over and under values are the edge values of the colormap.
+ You may want to set these values explicitly using
+ `.Colormap.set_under` and `.Colormap.set_over`.
+
+ .. note::
+
+ An existing `.QuadContourSet` does not get notified if
+ properties of its colormap are changed. Therefore, an explicit
+ call `~.ContourSet.changed()` is needed after modifying the
+ colormap. The explicit call can be left out, if a colorbar is
+ assigned to the `.QuadContourSet` because it internally calls
+ `~.ContourSet.changed()`.
+
+ Example::
+
+ x = np.arange(1, 10)
+ y = x.reshape(-1, 1)
+ h = x * y
+
+ cs = plt.contourf(h, levels=[10, 30, 50],
+ colors=['#808080', '#A0A0A0', '#C0C0C0'], extend='both')
+ cs.cmap.set_over('red')
+ cs.cmap.set_under('blue')
+ cs.changed()
+
+xunits, yunits : registered units, optional
+ Override axis units by specifying an instance of a
+ :class:`matplotlib.units.ConversionInterface`.
+
+antialiased : bool, optional
+ Enable antialiasing, overriding the defaults. For
+ filled contours, the default is *False*. For line contours,
+ it is taken from :rc:`lines.antialiased`.
+
+nchunk : int >= 0, optional
+ If 0, no subdivision of the domain. Specify a positive integer to
+ divide the domain into subdomains of *nchunk* by *nchunk* quads.
+ Chunking reduces the maximum length of polygons generated by the
+ contouring algorithm which reduces the rendering workload passed
+ on to the backend and also requires slightly less RAM. It can
+ however introduce rendering artifacts at chunk boundaries depending
+ on the backend, the *antialiased* flag and value of *alpha*.
+
+linewidths : float or array-like, default: :rc:`contour.linewidth`
+ *Only applies to* `.contour`.
+
+ The line width of the contour lines.
+
+ If a number, all levels will be plotted with this linewidth.
+
+ If a sequence, the levels in ascending order will be plotted with
+ the linewidths in the order specified.
+
+ If None, this falls back to :rc:`lines.linewidth`.
+
+linestyles : {*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
+ *Only applies to* `.contour`.
+
+ If *linestyles* is *None*, the default is 'solid' unless the lines are
+ monochrome. In that case, negative contours will instead take their
+ linestyle from the *negative_linestyles* argument.
+
+ *linestyles* can also be an iterable of the above strings specifying a set
+ of linestyles to be used. If this iterable is shorter than the number of
+ contour levels it will be repeated as necessary.
+
+negative_linestyles : {*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, \
+ optional
+ *Only applies to* `.contour`.
+
+ If *linestyles* is *None* and the lines are monochrome, this argument
+ specifies the line style for negative contours.
+
+ If *negative_linestyles* is *None*, the default is taken from
+ :rc:`contour.negative_linestyle`.
+
+ *negative_linestyles* can also be an iterable of the above strings
+ specifying a set of linestyles to be used. If this iterable is shorter than
+ the number of contour levels it will be repeated as necessary.
+
+hatches : list[str], optional
+ *Only applies to* `.contourf`.
+
+ A list of cross hatch patterns to use on the filled areas.
+ If None, no hatching will be added to the contour.
+
+algorithm : {'mpl2005', 'mpl2014', 'serial', 'threaded'}, optional
+ Which contouring algorithm to use to calculate the contour lines and
+ polygons. The algorithms are implemented in
+ `ContourPy `_, consult the
+ `ContourPy documentation `_ for
+ further information.
+
+ The default is taken from :rc:`contour.algorithm`.
+
+clip_path : `~matplotlib.patches.Patch` or `.Path` or `.TransformedPath`
+ Set the clip path. See `~matplotlib.artist.Artist.set_clip_path`.
+
+ .. versionadded:: 3.8
+
+data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+Notes
+-----
+1. `.contourf` differs from the MATLAB version in that it does not draw
+ the polygon edges. To draw edges, add line contours with calls to
+ `.contour`.
+
+2. `.contourf` fills intervals that are closed at the top; that is, for
+ boundaries *z1* and *z2*, the filled region is::
+
+ z1 < Z <= z2
+
+ except for the lowest interval, which is closed on both sides (i.e.
+ it includes the lowest value).
+
+3. `.contour` and `.contourf` use a `marching squares
+ `_ algorithm to
+ compute contour locations. More information can be found in
+ `ContourPy documentation `_.
+""" % _docstring.interpd.params)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/contour.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/contour.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..7400fac50993f4560c0fd76d12c530abdd286f26
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/contour.pyi
@@ -0,0 +1,140 @@
+import matplotlib.cm as cm
+from matplotlib.artist import Artist
+from matplotlib.axes import Axes
+from matplotlib.collections import Collection, PathCollection
+from matplotlib.colorizer import Colorizer, ColorizingArtist
+from matplotlib.colors import Colormap, Normalize
+from matplotlib.path import Path
+from matplotlib.patches import Patch
+from matplotlib.text import Text
+from matplotlib.transforms import Transform, TransformedPatchPath, TransformedPath
+from matplotlib.ticker import Locator, Formatter
+
+from numpy.typing import ArrayLike
+import numpy as np
+from collections.abc import Callable, Iterable, Sequence
+from typing import Literal
+from .typing import ColorType
+
+
+
+class ContourLabeler:
+ labelFmt: str | Formatter | Callable[[float], str] | dict[float, str]
+ labelManual: bool | Iterable[tuple[float, float]]
+ rightside_up: bool
+ labelLevelList: list[float]
+ labelIndiceList: list[int]
+ labelMappable: cm.ScalarMappable | ColorizingArtist
+ labelCValueList: list[ColorType]
+ labelXYs: list[tuple[float, float]]
+ def clabel(
+ self,
+ levels: ArrayLike | None = ...,
+ *,
+ fontsize: str | float | None = ...,
+ inline: bool = ...,
+ inline_spacing: float = ...,
+ fmt: str | Formatter | Callable[[float], str] | dict[float, str] | None = ...,
+ colors: ColorType | Sequence[ColorType] | None = ...,
+ use_clabeltext: bool = ...,
+ manual: bool | Iterable[tuple[float, float]] = ...,
+ rightside_up: bool = ...,
+ zorder: float | None = ...
+ ) -> list[Text]: ...
+ def print_label(self, linecontour: ArrayLike, labelwidth: float) -> bool: ...
+ def too_close(self, x: float, y: float, lw: float) -> bool: ...
+ def get_text(
+ self,
+ lev: float,
+ fmt: str | Formatter | Callable[[float], str] | dict[float, str],
+ ) -> str: ...
+ def locate_label(
+ self, linecontour: ArrayLike, labelwidth: float
+ ) -> tuple[float, float, float]: ...
+ def add_label(
+ self, x: float, y: float, rotation: float, lev: float, cvalue: ColorType
+ ) -> None: ...
+ def add_label_near(
+ self,
+ x: float,
+ y: float,
+ inline: bool = ...,
+ inline_spacing: int = ...,
+ transform: Transform | Literal[False] | None = ...,
+ ) -> None: ...
+ def pop_label(self, index: int = ...) -> None: ...
+ def labels(self, inline: bool, inline_spacing: int) -> None: ...
+ def remove(self) -> None: ...
+
+class ContourSet(ContourLabeler, Collection):
+ axes: Axes
+ levels: Iterable[float]
+ filled: bool
+ linewidths: float | ArrayLike | None
+ hatches: Iterable[str | None]
+ origin: Literal["upper", "lower", "image"] | None
+ extent: tuple[float, float, float, float] | None
+ colors: ColorType | Sequence[ColorType]
+ extend: Literal["neither", "both", "min", "max"]
+ nchunk: int
+ locator: Locator | None
+ logscale: bool
+ negative_linestyles: None | Literal[
+ "solid", "dashed", "dashdot", "dotted"
+ ] | Iterable[Literal["solid", "dashed", "dashdot", "dotted"]]
+ clip_path: Patch | Path | TransformedPath | TransformedPatchPath | None
+ labelTexts: list[Text]
+ labelCValues: list[ColorType]
+
+ @property
+ def allkinds(self) -> list[list[np.ndarray | None]]: ...
+ @property
+ def allsegs(self) -> list[list[np.ndarray]]: ...
+ @property
+ def alpha(self) -> float | None: ...
+ @property
+ def linestyles(self) -> (
+ None |
+ Literal["solid", "dashed", "dashdot", "dotted"] |
+ Iterable[Literal["solid", "dashed", "dashdot", "dotted"]]
+ ): ...
+
+ def __init__(
+ self,
+ ax: Axes,
+ *args,
+ levels: Iterable[float] | None = ...,
+ filled: bool = ...,
+ linewidths: float | ArrayLike | None = ...,
+ linestyles: Literal["solid", "dashed", "dashdot", "dotted"]
+ | Iterable[Literal["solid", "dashed", "dashdot", "dotted"]]
+ | None = ...,
+ hatches: Iterable[str | None] = ...,
+ alpha: float | None = ...,
+ origin: Literal["upper", "lower", "image"] | None = ...,
+ extent: tuple[float, float, float, float] | None = ...,
+ cmap: str | Colormap | None = ...,
+ colors: ColorType | Sequence[ColorType] | None = ...,
+ norm: str | Normalize | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ colorizer: Colorizer | None = ...,
+ extend: Literal["neither", "both", "min", "max"] = ...,
+ antialiased: bool | None = ...,
+ nchunk: int = ...,
+ locator: Locator | None = ...,
+ transform: Transform | None = ...,
+ negative_linestyles: Literal["solid", "dashed", "dashdot", "dotted"]
+ | Iterable[Literal["solid", "dashed", "dashdot", "dotted"]]
+ | None = ...,
+ clip_path: Patch | Path | TransformedPath | TransformedPatchPath | None = ...,
+ **kwargs
+ ) -> None: ...
+ def legend_elements(
+ self, variable_name: str = ..., str_format: Callable[[float], str] = ...
+ ) -> tuple[list[Artist], list[str]]: ...
+ def find_nearest_contour(
+ self, x: float, y: float, indices: Iterable[int] | None = ..., pixel: bool = ...
+ ) -> tuple[int, int, int, float, float, float]: ...
+
+class QuadContourSet(ContourSet): ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dates.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dates.py
new file mode 100644
index 0000000000000000000000000000000000000000..511e1c6df6ccbd8747c76f297e0a6c20947cda3a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dates.py
@@ -0,0 +1,1840 @@
+"""
+Matplotlib provides sophisticated date plotting capabilities, standing on the
+shoulders of python :mod:`datetime` and the add-on module dateutil_.
+
+By default, Matplotlib uses the units machinery described in
+`~matplotlib.units` to convert `datetime.datetime`, and `numpy.datetime64`
+objects when plotted on an x- or y-axis. The user does not
+need to do anything for dates to be formatted, but dates often have strict
+formatting needs, so this module provides many tick locators and formatters.
+A basic example using `numpy.datetime64` is::
+
+ import numpy as np
+
+ times = np.arange(np.datetime64('2001-01-02'),
+ np.datetime64('2002-02-03'), np.timedelta64(75, 'm'))
+ y = np.random.randn(len(times))
+
+ fig, ax = plt.subplots()
+ ax.plot(times, y)
+
+.. seealso::
+
+ - :doc:`/gallery/text_labels_and_annotations/date`
+ - :doc:`/gallery/ticks/date_concise_formatter`
+ - :doc:`/gallery/ticks/date_demo_convert`
+
+.. _date-format:
+
+Matplotlib date format
+----------------------
+
+Matplotlib represents dates using floating point numbers specifying the number
+of days since a default epoch of 1970-01-01 UTC; for example,
+1970-01-01, 06:00 is the floating point number 0.25. The formatters and
+locators require the use of `datetime.datetime` objects, so only dates between
+year 0001 and 9999 can be represented. Microsecond precision
+is achievable for (approximately) 70 years on either side of the epoch, and
+20 microseconds for the rest of the allowable range of dates (year 0001 to
+9999). The epoch can be changed at import time via `.dates.set_epoch` or
+:rc:`date.epoch` to other dates if necessary; see
+:doc:`/gallery/ticks/date_precision_and_epochs` for a discussion.
+
+.. note::
+
+ Before Matplotlib 3.3, the epoch was 0000-12-31 which lost modern
+ microsecond precision and also made the default axis limit of 0 an invalid
+ datetime. In 3.3 the epoch was changed as above. To convert old
+ ordinal floats to the new epoch, users can do::
+
+ new_ordinal = old_ordinal + mdates.date2num(np.datetime64('0000-12-31'))
+
+
+There are a number of helper functions to convert between :mod:`datetime`
+objects and Matplotlib dates:
+
+.. currentmodule:: matplotlib.dates
+
+.. autosummary::
+ :nosignatures:
+
+ datestr2num
+ date2num
+ num2date
+ num2timedelta
+ drange
+ set_epoch
+ get_epoch
+
+.. note::
+
+ Like Python's `datetime.datetime`, Matplotlib uses the Gregorian calendar
+ for all conversions between dates and floating point numbers. This practice
+ is not universal, and calendar differences can cause confusing
+ differences between what Python and Matplotlib give as the number of days
+ since 0001-01-01 and what other software and databases yield. For
+ example, the US Naval Observatory uses a calendar that switches
+ from Julian to Gregorian in October, 1582. Hence, using their
+ calculator, the number of days between 0001-01-01 and 2006-04-01 is
+ 732403, whereas using the Gregorian calendar via the datetime
+ module we find::
+
+ In [1]: date(2006, 4, 1).toordinal() - date(1, 1, 1).toordinal()
+ Out[1]: 732401
+
+All the Matplotlib date converters, locators and formatters are timezone aware.
+If no explicit timezone is provided, :rc:`timezone` is assumed, provided as a
+string. If you want to use a different timezone, pass the *tz* keyword
+argument of `num2date` to any date tick locators or formatters you create. This
+can be either a `datetime.tzinfo` instance or a string with the timezone name
+that can be parsed by `~dateutil.tz.gettz`.
+
+A wide range of specific and general purpose date tick locators and
+formatters are provided in this module. See
+:mod:`matplotlib.ticker` for general information on tick locators
+and formatters. These are described below.
+
+The dateutil_ module provides additional code to handle date ticking, making it
+easy to place ticks on any kinds of dates. See examples below.
+
+.. _dateutil: https://dateutil.readthedocs.io
+
+.. _date-locators:
+
+Date tick locators
+------------------
+
+Most of the date tick locators can locate single or multiple ticks. For example::
+
+ # import constants for the days of the week
+ from matplotlib.dates import MO, TU, WE, TH, FR, SA, SU
+
+ # tick on Mondays every week
+ loc = WeekdayLocator(byweekday=MO, tz=tz)
+
+ # tick on Mondays and Saturdays
+ loc = WeekdayLocator(byweekday=(MO, SA))
+
+In addition, most of the constructors take an interval argument::
+
+ # tick on Mondays every second week
+ loc = WeekdayLocator(byweekday=MO, interval=2)
+
+The rrule locator allows completely general date ticking::
+
+ # tick every 5th easter
+ rule = rrulewrapper(YEARLY, byeaster=1, interval=5)
+ loc = RRuleLocator(rule)
+
+The available date tick locators are:
+
+* `MicrosecondLocator`: Locate microseconds.
+
+* `SecondLocator`: Locate seconds.
+
+* `MinuteLocator`: Locate minutes.
+
+* `HourLocator`: Locate hours.
+
+* `DayLocator`: Locate specified days of the month.
+
+* `WeekdayLocator`: Locate days of the week, e.g., MO, TU.
+
+* `MonthLocator`: Locate months, e.g., 7 for July.
+
+* `YearLocator`: Locate years that are multiples of base.
+
+* `RRuleLocator`: Locate using a `rrulewrapper`.
+ `rrulewrapper` is a simple wrapper around dateutil_'s `dateutil.rrule`
+ which allow almost arbitrary date tick specifications.
+ See :doc:`rrule example `.
+
+* `AutoDateLocator`: On autoscale, this class picks the best `DateLocator`
+ (e.g., `RRuleLocator`) to set the view limits and the tick locations. If
+ called with ``interval_multiples=True`` it will make ticks line up with
+ sensible multiples of the tick intervals. For example, if the interval is
+ 4 hours, it will pick hours 0, 4, 8, etc. as ticks. This behaviour is not
+ guaranteed by default.
+
+.. _date-formatters:
+
+Date formatters
+---------------
+
+The available date formatters are:
+
+* `AutoDateFormatter`: attempts to figure out the best format to use. This is
+ most useful when used with the `AutoDateLocator`.
+
+* `ConciseDateFormatter`: also attempts to figure out the best format to use,
+ and to make the format as compact as possible while still having complete
+ date information. This is most useful when used with the `AutoDateLocator`.
+
+* `DateFormatter`: use `~datetime.datetime.strftime` format strings.
+"""
+
+import datetime
+import functools
+import logging
+import re
+
+from dateutil.rrule import (rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
+ MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY,
+ SECONDLY)
+from dateutil.relativedelta import relativedelta
+import dateutil.parser
+import dateutil.tz
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cbook, ticker, units
+
+__all__ = ('datestr2num', 'date2num', 'num2date', 'num2timedelta', 'drange',
+ 'set_epoch', 'get_epoch', 'DateFormatter', 'ConciseDateFormatter',
+ 'AutoDateFormatter', 'DateLocator', 'RRuleLocator',
+ 'AutoDateLocator', 'YearLocator', 'MonthLocator', 'WeekdayLocator',
+ 'DayLocator', 'HourLocator', 'MinuteLocator',
+ 'SecondLocator', 'MicrosecondLocator',
+ 'rrule', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU',
+ 'YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY',
+ 'HOURLY', 'MINUTELY', 'SECONDLY', 'MICROSECONDLY', 'relativedelta',
+ 'DateConverter', 'ConciseDateConverter', 'rrulewrapper')
+
+
+_log = logging.getLogger(__name__)
+UTC = datetime.timezone.utc
+
+
+def _get_tzinfo(tz=None):
+ """
+ Generate `~datetime.tzinfo` from a string or return `~datetime.tzinfo`.
+ If None, retrieve the preferred timezone from the rcParams dictionary.
+ """
+ tz = mpl._val_or_rc(tz, 'timezone')
+ if tz == 'UTC':
+ return UTC
+ if isinstance(tz, str):
+ tzinfo = dateutil.tz.gettz(tz)
+ if tzinfo is None:
+ raise ValueError(f"{tz} is not a valid timezone as parsed by"
+ " dateutil.tz.gettz.")
+ return tzinfo
+ if isinstance(tz, datetime.tzinfo):
+ return tz
+ raise TypeError(f"tz must be string or tzinfo subclass, not {tz!r}.")
+
+
+# Time-related constants.
+EPOCH_OFFSET = float(datetime.datetime(1970, 1, 1).toordinal())
+# EPOCH_OFFSET is not used by matplotlib
+MICROSECONDLY = SECONDLY + 1
+HOURS_PER_DAY = 24.
+MIN_PER_HOUR = 60.
+SEC_PER_MIN = 60.
+MONTHS_PER_YEAR = 12.
+
+DAYS_PER_WEEK = 7.
+DAYS_PER_MONTH = 30.
+DAYS_PER_YEAR = 365.0
+
+MINUTES_PER_DAY = MIN_PER_HOUR * HOURS_PER_DAY
+
+SEC_PER_HOUR = SEC_PER_MIN * MIN_PER_HOUR
+SEC_PER_DAY = SEC_PER_HOUR * HOURS_PER_DAY
+SEC_PER_WEEK = SEC_PER_DAY * DAYS_PER_WEEK
+
+MUSECONDS_PER_DAY = 1e6 * SEC_PER_DAY
+
+MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY = (
+ MO, TU, WE, TH, FR, SA, SU)
+WEEKDAYS = (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY)
+
+# default epoch: passed to np.datetime64...
+_epoch = None
+
+
+def _reset_epoch_test_example():
+ """
+ Reset the Matplotlib date epoch so it can be set again.
+
+ Only for use in tests and examples.
+ """
+ global _epoch
+ _epoch = None
+
+
+def set_epoch(epoch):
+ """
+ Set the epoch (origin for dates) for datetime calculations.
+
+ The default epoch is :rc:`date.epoch`.
+
+ If microsecond accuracy is desired, the date being plotted needs to be
+ within approximately 70 years of the epoch. Matplotlib internally
+ represents dates as days since the epoch, so floating point dynamic
+ range needs to be within a factor of 2^52.
+
+ `~.dates.set_epoch` must be called before any dates are converted
+ (i.e. near the import section) or a RuntimeError will be raised.
+
+ See also :doc:`/gallery/ticks/date_precision_and_epochs`.
+
+ Parameters
+ ----------
+ epoch : str
+ valid UTC date parsable by `numpy.datetime64` (do not include
+ timezone).
+
+ """
+ global _epoch
+ if _epoch is not None:
+ raise RuntimeError('set_epoch must be called before dates plotted.')
+ _epoch = epoch
+
+
+def get_epoch():
+ """
+ Get the epoch used by `.dates`.
+
+ Returns
+ -------
+ epoch : str
+ String for the epoch (parsable by `numpy.datetime64`).
+ """
+ global _epoch
+
+ _epoch = mpl._val_or_rc(_epoch, 'date.epoch')
+ return _epoch
+
+
+def _dt64_to_ordinalf(d):
+ """
+ Convert `numpy.datetime64` or an `numpy.ndarray` of those types to
+ Gregorian date as UTC float relative to the epoch (see `.get_epoch`).
+ Roundoff is float64 precision. Practically: microseconds for dates
+ between 290301 BC, 294241 AD, milliseconds for larger dates
+ (see `numpy.datetime64`).
+ """
+
+ # the "extra" ensures that we at least allow the dynamic range out to
+ # seconds. That should get out to +/-2e11 years.
+ dseconds = d.astype('datetime64[s]')
+ extra = (d - dseconds).astype('timedelta64[ns]')
+ t0 = np.datetime64(get_epoch(), 's')
+ dt = (dseconds - t0).astype(np.float64)
+ dt += extra.astype(np.float64) / 1.0e9
+ dt = dt / SEC_PER_DAY
+
+ NaT_int = np.datetime64('NaT').astype(np.int64)
+ d_int = d.astype(np.int64)
+ dt[d_int == NaT_int] = np.nan
+ return dt
+
+
+def _from_ordinalf(x, tz=None):
+ """
+ Convert Gregorian float of the date, preserving hours, minutes,
+ seconds and microseconds. Return value is a `.datetime`.
+
+ The input date *x* is a float in ordinal days at UTC, and the output will
+ be the specified `.datetime` object corresponding to that time in
+ timezone *tz*, or if *tz* is ``None``, in the timezone specified in
+ :rc:`timezone`.
+ """
+
+ tz = _get_tzinfo(tz)
+
+ dt = (np.datetime64(get_epoch()) +
+ np.timedelta64(int(np.round(x * MUSECONDS_PER_DAY)), 'us'))
+ if dt < np.datetime64('0001-01-01') or dt >= np.datetime64('10000-01-01'):
+ raise ValueError(f'Date ordinal {x} converts to {dt} (using '
+ f'epoch {get_epoch()}), but Matplotlib dates must be '
+ 'between year 0001 and 9999.')
+ # convert from datetime64 to datetime:
+ dt = dt.tolist()
+
+ # datetime64 is always UTC:
+ dt = dt.replace(tzinfo=dateutil.tz.gettz('UTC'))
+ # but maybe we are working in a different timezone so move.
+ dt = dt.astimezone(tz)
+ # fix round off errors
+ if np.abs(x) > 70 * 365:
+ # if x is big, round off to nearest twenty microseconds.
+ # This avoids floating point roundoff error
+ ms = round(dt.microsecond / 20) * 20
+ if ms == 1000000:
+ dt = dt.replace(microsecond=0) + datetime.timedelta(seconds=1)
+ else:
+ dt = dt.replace(microsecond=ms)
+
+ return dt
+
+
+# a version of _from_ordinalf that can operate on numpy arrays
+_from_ordinalf_np_vectorized = np.vectorize(_from_ordinalf, otypes="O")
+# a version of dateutil.parser.parse that can operate on numpy arrays
+_dateutil_parser_parse_np_vectorized = np.vectorize(dateutil.parser.parse)
+
+
+def datestr2num(d, default=None):
+ """
+ Convert a date string to a datenum using `dateutil.parser.parse`.
+
+ Parameters
+ ----------
+ d : str or sequence of str
+ The dates to convert.
+
+ default : datetime.datetime, optional
+ The default date to use when fields are missing in *d*.
+ """
+ if isinstance(d, str):
+ dt = dateutil.parser.parse(d, default=default)
+ return date2num(dt)
+ else:
+ if default is not None:
+ d = [date2num(dateutil.parser.parse(s, default=default))
+ for s in d]
+ return np.asarray(d)
+ d = np.asarray(d)
+ if not d.size:
+ return d
+ return date2num(_dateutil_parser_parse_np_vectorized(d))
+
+
+def date2num(d):
+ """
+ Convert datetime objects to Matplotlib dates.
+
+ Parameters
+ ----------
+ d : `datetime.datetime` or `numpy.datetime64` or sequences of these
+
+ Returns
+ -------
+ float or sequence of floats
+ Number of days since the epoch. See `.get_epoch` for the
+ epoch, which can be changed by :rc:`date.epoch` or `.set_epoch`. If
+ the epoch is "1970-01-01T00:00:00" (default) then noon Jan 1 1970
+ ("1970-01-01T12:00:00") returns 0.5.
+
+ Notes
+ -----
+ The Gregorian calendar is assumed; this is not universal practice.
+ For details see the module docstring.
+ """
+ # Unpack in case of e.g. Pandas or xarray object
+ d = cbook._unpack_to_numpy(d)
+
+ # make an iterable, but save state to unpack later:
+ iterable = np.iterable(d)
+ if not iterable:
+ d = [d]
+
+ masked = np.ma.is_masked(d)
+ mask = np.ma.getmask(d)
+ d = np.asarray(d)
+
+ # convert to datetime64 arrays, if not already:
+ if not np.issubdtype(d.dtype, np.datetime64):
+ # datetime arrays
+ if not d.size:
+ # deals with an empty array...
+ return d
+ tzi = getattr(d[0], 'tzinfo', None)
+ if tzi is not None:
+ # make datetime naive:
+ d = [dt.astimezone(UTC).replace(tzinfo=None) for dt in d]
+ d = np.asarray(d)
+ d = d.astype('datetime64[us]')
+
+ d = np.ma.masked_array(d, mask=mask) if masked else d
+ d = _dt64_to_ordinalf(d)
+
+ return d if iterable else d[0]
+
+
+def num2date(x, tz=None):
+ """
+ Convert Matplotlib dates to `~datetime.datetime` objects.
+
+ Parameters
+ ----------
+ x : float or sequence of floats
+ Number of days (fraction part represents hours, minutes, seconds)
+ since the epoch. See `.get_epoch` for the
+ epoch, which can be changed by :rc:`date.epoch` or `.set_epoch`.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Timezone of *x*. If a string, *tz* is passed to `dateutil.tz`.
+
+ Returns
+ -------
+ `~datetime.datetime` or sequence of `~datetime.datetime`
+ Dates are returned in timezone *tz*.
+
+ If *x* is a sequence, a sequence of `~datetime.datetime` objects will
+ be returned.
+
+ Notes
+ -----
+ The Gregorian calendar is assumed; this is not universal practice.
+ For details, see the module docstring.
+ """
+ tz = _get_tzinfo(tz)
+ return _from_ordinalf_np_vectorized(x, tz).tolist()
+
+
+_ordinalf_to_timedelta_np_vectorized = np.vectorize(
+ lambda x: datetime.timedelta(days=x), otypes="O")
+
+
+def num2timedelta(x):
+ """
+ Convert number of days to a `~datetime.timedelta` object.
+
+ If *x* is a sequence, a sequence of `~datetime.timedelta` objects will
+ be returned.
+
+ Parameters
+ ----------
+ x : float, sequence of floats
+ Number of days. The fraction part represents hours, minutes, seconds.
+
+ Returns
+ -------
+ `datetime.timedelta` or list[`datetime.timedelta`]
+ """
+ return _ordinalf_to_timedelta_np_vectorized(x).tolist()
+
+
+def drange(dstart, dend, delta):
+ """
+ Return a sequence of equally spaced Matplotlib dates.
+
+ The dates start at *dstart* and reach up to, but not including *dend*.
+ They are spaced by *delta*.
+
+ Parameters
+ ----------
+ dstart, dend : `~datetime.datetime`
+ The date limits.
+ delta : `datetime.timedelta`
+ Spacing of the dates.
+
+ Returns
+ -------
+ `numpy.array`
+ A list floats representing Matplotlib dates.
+
+ """
+ f1 = date2num(dstart)
+ f2 = date2num(dend)
+ step = delta.total_seconds() / SEC_PER_DAY
+
+ # calculate the difference between dend and dstart in times of delta
+ num = int(np.ceil((f2 - f1) / step))
+
+ # calculate end of the interval which will be generated
+ dinterval_end = dstart + num * delta
+
+ # ensure, that an half open interval will be generated [dstart, dend)
+ if dinterval_end >= dend:
+ # if the endpoint is greater than or equal to dend,
+ # just subtract one delta
+ dinterval_end -= delta
+ num -= 1
+
+ f2 = date2num(dinterval_end) # new float-endpoint
+ return np.linspace(f1, f2, num + 1)
+
+
+def _wrap_in_tex(text):
+ p = r'([a-zA-Z]+)'
+ ret_text = re.sub(p, r'}$\1$\\mathdefault{', text)
+
+ # Braces ensure symbols are not spaced like binary operators.
+ ret_text = ret_text.replace('-', '{-}').replace(':', '{:}')
+ # To not concatenate space between numbers.
+ ret_text = ret_text.replace(' ', r'\;')
+ ret_text = '$\\mathdefault{' + ret_text + '}$'
+ ret_text = ret_text.replace('$\\mathdefault{}$', '')
+ return ret_text
+
+
+## date tick locators and formatters ###
+
+
+class DateFormatter(ticker.Formatter):
+ """
+ Format a tick (in days since the epoch) with a
+ `~datetime.datetime.strftime` format string.
+ """
+
+ def __init__(self, fmt, tz=None, *, usetex=None):
+ """
+ Parameters
+ ----------
+ fmt : str
+ `~datetime.datetime.strftime` format string
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ usetex : bool, default: :rc:`text.usetex`
+ To enable/disable the use of TeX's math mode for rendering the
+ results of the formatter.
+ """
+ self.tz = _get_tzinfo(tz)
+ self.fmt = fmt
+ self._usetex = mpl._val_or_rc(usetex, 'text.usetex')
+
+ def __call__(self, x, pos=0):
+ result = num2date(x, self.tz).strftime(self.fmt)
+ return _wrap_in_tex(result) if self._usetex else result
+
+ def set_tzinfo(self, tz):
+ self.tz = _get_tzinfo(tz)
+
+
+class ConciseDateFormatter(ticker.Formatter):
+ """
+ A `.Formatter` which attempts to figure out the best format to use for the
+ date, and to make it as compact as possible, but still be complete. This is
+ most useful when used with the `AutoDateLocator`::
+
+ >>> locator = AutoDateLocator()
+ >>> formatter = ConciseDateFormatter(locator)
+
+ Parameters
+ ----------
+ locator : `.ticker.Locator`
+ Locator that this axis is using.
+
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone, passed to `.dates.num2date`.
+
+ formats : list of 6 strings, optional
+ Format strings for 6 levels of tick labelling: mostly years,
+ months, days, hours, minutes, and seconds. Strings use
+ the same format codes as `~datetime.datetime.strftime`. Default is
+ ``['%Y', '%b', '%d', '%H:%M', '%H:%M', '%S.%f']``
+
+ zero_formats : list of 6 strings, optional
+ Format strings for tick labels that are "zeros" for a given tick
+ level. For instance, if most ticks are months, ticks around 1 Jan 2005
+ will be labeled "Dec", "2005", "Feb". The default is
+ ``['', '%Y', '%b', '%b-%d', '%H:%M', '%H:%M']``
+
+ offset_formats : list of 6 strings, optional
+ Format strings for the 6 levels that is applied to the "offset"
+ string found on the right side of an x-axis, or top of a y-axis.
+ Combined with the tick labels this should completely specify the
+ date. The default is::
+
+ ['', '%Y', '%Y-%b', '%Y-%b-%d', '%Y-%b-%d', '%Y-%b-%d %H:%M']
+
+ show_offset : bool, default: True
+ Whether to show the offset or not.
+
+ usetex : bool, default: :rc:`text.usetex`
+ To enable/disable the use of TeX's math mode for rendering the results
+ of the formatter.
+
+ Examples
+ --------
+ See :doc:`/gallery/ticks/date_concise_formatter`
+
+ .. plot::
+
+ import datetime
+ import matplotlib.dates as mdates
+
+ base = datetime.datetime(2005, 2, 1)
+ dates = np.array([base + datetime.timedelta(hours=(2 * i))
+ for i in range(732)])
+ N = len(dates)
+ np.random.seed(19680801)
+ y = np.cumsum(np.random.randn(N))
+
+ fig, ax = plt.subplots(constrained_layout=True)
+ locator = mdates.AutoDateLocator()
+ formatter = mdates.ConciseDateFormatter(locator)
+ ax.xaxis.set_major_locator(locator)
+ ax.xaxis.set_major_formatter(formatter)
+
+ ax.plot(dates, y)
+ ax.set_title('Concise Date Formatter')
+
+ """
+
+ def __init__(self, locator, tz=None, formats=None, offset_formats=None,
+ zero_formats=None, show_offset=True, *, usetex=None):
+ """
+ Autoformat the date labels. The default format is used to form an
+ initial string, and then redundant elements are removed.
+ """
+ self._locator = locator
+ self._tz = tz
+ self.defaultfmt = '%Y'
+ # there are 6 levels with each level getting a specific format
+ # 0: mostly years, 1: months, 2: days,
+ # 3: hours, 4: minutes, 5: seconds
+ if formats:
+ if len(formats) != 6:
+ raise ValueError('formats argument must be a list of '
+ '6 format strings (or None)')
+ self.formats = formats
+ else:
+ self.formats = ['%Y', # ticks are mostly years
+ '%b', # ticks are mostly months
+ '%d', # ticks are mostly days
+ '%H:%M', # hrs
+ '%H:%M', # min
+ '%S.%f', # secs
+ ]
+ # fmt for zeros ticks at this level. These are
+ # ticks that should be labeled w/ info the level above.
+ # like 1 Jan can just be labelled "Jan". 02:02:00 can
+ # just be labeled 02:02.
+ if zero_formats:
+ if len(zero_formats) != 6:
+ raise ValueError('zero_formats argument must be a list of '
+ '6 format strings (or None)')
+ self.zero_formats = zero_formats
+ elif formats:
+ # use the users formats for the zero tick formats
+ self.zero_formats = [''] + self.formats[:-1]
+ else:
+ # make the defaults a bit nicer:
+ self.zero_formats = [''] + self.formats[:-1]
+ self.zero_formats[3] = '%b-%d'
+
+ if offset_formats:
+ if len(offset_formats) != 6:
+ raise ValueError('offset_formats argument must be a list of '
+ '6 format strings (or None)')
+ self.offset_formats = offset_formats
+ else:
+ self.offset_formats = ['',
+ '%Y',
+ '%Y-%b',
+ '%Y-%b-%d',
+ '%Y-%b-%d',
+ '%Y-%b-%d %H:%M']
+ self.offset_string = ''
+ self.show_offset = show_offset
+ self._usetex = mpl._val_or_rc(usetex, 'text.usetex')
+
+ def __call__(self, x, pos=None):
+ formatter = DateFormatter(self.defaultfmt, self._tz,
+ usetex=self._usetex)
+ return formatter(x, pos=pos)
+
+ def format_ticks(self, values):
+ tickdatetime = [num2date(value, tz=self._tz) for value in values]
+ tickdate = np.array([tdt.timetuple()[:6] for tdt in tickdatetime])
+
+ # basic algorithm:
+ # 1) only display a part of the date if it changes over the ticks.
+ # 2) don't display the smaller part of the date if:
+ # it is always the same or if it is the start of the
+ # year, month, day etc.
+ # fmt for most ticks at this level
+ fmts = self.formats
+ # format beginnings of days, months, years, etc.
+ zerofmts = self.zero_formats
+ # offset fmt are for the offset in the upper left of the
+ # or lower right of the axis.
+ offsetfmts = self.offset_formats
+ show_offset = self.show_offset
+
+ # determine the level we will label at:
+ # mostly 0: years, 1: months, 2: days,
+ # 3: hours, 4: minutes, 5: seconds, 6: microseconds
+ for level in range(5, -1, -1):
+ unique = np.unique(tickdate[:, level])
+ if len(unique) > 1:
+ # if 1 is included in unique, the year is shown in ticks
+ if level < 2 and np.any(unique == 1):
+ show_offset = False
+ break
+ elif level == 0:
+ # all tickdate are the same, so only micros might be different
+ # set to the most precise (6: microseconds doesn't exist...)
+ level = 5
+
+ # level is the basic level we will label at.
+ # now loop through and decide the actual ticklabels
+ zerovals = [0, 1, 1, 0, 0, 0, 0]
+ labels = [''] * len(tickdate)
+ for nn in range(len(tickdate)):
+ if level < 5:
+ if tickdate[nn][level] == zerovals[level]:
+ fmt = zerofmts[level]
+ else:
+ fmt = fmts[level]
+ else:
+ # special handling for seconds + microseconds
+ if (tickdatetime[nn].second == tickdatetime[nn].microsecond
+ == 0):
+ fmt = zerofmts[level]
+ else:
+ fmt = fmts[level]
+ labels[nn] = tickdatetime[nn].strftime(fmt)
+
+ # special handling of seconds and microseconds:
+ # strip extra zeros and decimal if possible.
+ # this is complicated by two factors. 1) we have some level-4 strings
+ # here (i.e. 03:00, '0.50000', '1.000') 2) we would like to have the
+ # same number of decimals for each string (i.e. 0.5 and 1.0).
+ if level >= 5:
+ trailing_zeros = min(
+ (len(s) - len(s.rstrip('0')) for s in labels if '.' in s),
+ default=None)
+ if trailing_zeros:
+ for nn in range(len(labels)):
+ if '.' in labels[nn]:
+ labels[nn] = labels[nn][:-trailing_zeros].rstrip('.')
+
+ if show_offset:
+ # set the offset string:
+ if (self._locator.axis and
+ self._locator.axis.__name__ in ('xaxis', 'yaxis')
+ and self._locator.axis.get_inverted()):
+ self.offset_string = tickdatetime[0].strftime(offsetfmts[level])
+ else:
+ self.offset_string = tickdatetime[-1].strftime(offsetfmts[level])
+ if self._usetex:
+ self.offset_string = _wrap_in_tex(self.offset_string)
+ else:
+ self.offset_string = ''
+
+ if self._usetex:
+ return [_wrap_in_tex(l) for l in labels]
+ else:
+ return labels
+
+ def get_offset(self):
+ return self.offset_string
+
+ def format_data_short(self, value):
+ return num2date(value, tz=self._tz).strftime('%Y-%m-%d %H:%M:%S')
+
+
+class AutoDateFormatter(ticker.Formatter):
+ """
+ A `.Formatter` which attempts to figure out the best format to use. This
+ is most useful when used with the `AutoDateLocator`.
+
+ `.AutoDateFormatter` has a ``.scale`` dictionary that maps tick scales (the
+ interval in days between one major tick) to format strings; this dictionary
+ defaults to ::
+
+ self.scaled = {
+ DAYS_PER_YEAR: rcParams['date.autoformatter.year'],
+ DAYS_PER_MONTH: rcParams['date.autoformatter.month'],
+ 1: rcParams['date.autoformatter.day'],
+ 1 / HOURS_PER_DAY: rcParams['date.autoformatter.hour'],
+ 1 / MINUTES_PER_DAY: rcParams['date.autoformatter.minute'],
+ 1 / SEC_PER_DAY: rcParams['date.autoformatter.second'],
+ 1 / MUSECONDS_PER_DAY: rcParams['date.autoformatter.microsecond'],
+ }
+
+ The formatter uses the format string corresponding to the lowest key in
+ the dictionary that is greater or equal to the current scale. Dictionary
+ entries can be customized::
+
+ locator = AutoDateLocator()
+ formatter = AutoDateFormatter(locator)
+ formatter.scaled[1/(24*60)] = '%M:%S' # only show min and sec
+
+ Custom callables can also be used instead of format strings. The following
+ example shows how to use a custom format function to strip trailing zeros
+ from decimal seconds and adds the date to the first ticklabel::
+
+ def my_format_function(x, pos=None):
+ x = matplotlib.dates.num2date(x)
+ if pos == 0:
+ fmt = '%D %H:%M:%S.%f'
+ else:
+ fmt = '%H:%M:%S.%f'
+ label = x.strftime(fmt)
+ label = label.rstrip("0")
+ label = label.rstrip(".")
+ return label
+
+ formatter.scaled[1/(24*60)] = my_format_function
+ """
+
+ # This can be improved by providing some user-level direction on
+ # how to choose the best format (precedence, etc.).
+
+ # Perhaps a 'struct' that has a field for each time-type where a
+ # zero would indicate "don't show" and a number would indicate
+ # "show" with some sort of priority. Same priorities could mean
+ # show all with the same priority.
+
+ # Or more simply, perhaps just a format string for each
+ # possibility...
+
+ def __init__(self, locator, tz=None, defaultfmt='%Y-%m-%d', *,
+ usetex=None):
+ """
+ Autoformat the date labels.
+
+ Parameters
+ ----------
+ locator : `.ticker.Locator`
+ Locator that this axis is using.
+
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+
+ defaultfmt : str
+ The default format to use if none of the values in ``self.scaled``
+ are greater than the unit returned by ``locator._get_unit()``.
+
+ usetex : bool, default: :rc:`text.usetex`
+ To enable/disable the use of TeX's math mode for rendering the
+ results of the formatter. If any entries in ``self.scaled`` are set
+ as functions, then it is up to the customized function to enable or
+ disable TeX's math mode itself.
+ """
+ self._locator = locator
+ self._tz = tz
+ self.defaultfmt = defaultfmt
+ self._formatter = DateFormatter(self.defaultfmt, tz)
+ rcParams = mpl.rcParams
+ self._usetex = mpl._val_or_rc(usetex, 'text.usetex')
+ self.scaled = {
+ DAYS_PER_YEAR: rcParams['date.autoformatter.year'],
+ DAYS_PER_MONTH: rcParams['date.autoformatter.month'],
+ 1: rcParams['date.autoformatter.day'],
+ 1 / HOURS_PER_DAY: rcParams['date.autoformatter.hour'],
+ 1 / MINUTES_PER_DAY: rcParams['date.autoformatter.minute'],
+ 1 / SEC_PER_DAY: rcParams['date.autoformatter.second'],
+ 1 / MUSECONDS_PER_DAY: rcParams['date.autoformatter.microsecond']
+ }
+
+ def _set_locator(self, locator):
+ self._locator = locator
+
+ def __call__(self, x, pos=None):
+ try:
+ locator_unit_scale = float(self._locator._get_unit())
+ except AttributeError:
+ locator_unit_scale = 1
+ # Pick the first scale which is greater than the locator unit.
+ fmt = next((fmt for scale, fmt in sorted(self.scaled.items())
+ if scale >= locator_unit_scale),
+ self.defaultfmt)
+
+ if isinstance(fmt, str):
+ self._formatter = DateFormatter(fmt, self._tz, usetex=self._usetex)
+ result = self._formatter(x, pos)
+ elif callable(fmt):
+ result = fmt(x, pos)
+ else:
+ raise TypeError(f'Unexpected type passed to {self!r}.')
+
+ return result
+
+
+class rrulewrapper:
+ """
+ A simple wrapper around a `dateutil.rrule` allowing flexible
+ date tick specifications.
+ """
+ def __init__(self, freq, tzinfo=None, **kwargs):
+ """
+ Parameters
+ ----------
+ freq : {YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY}
+ Tick frequency. These constants are defined in `dateutil.rrule`,
+ but they are accessible from `matplotlib.dates` as well.
+ tzinfo : `datetime.tzinfo`, optional
+ Time zone information. The default is None.
+ **kwargs
+ Additional keyword arguments are passed to the `dateutil.rrule`.
+ """
+ kwargs['freq'] = freq
+ self._base_tzinfo = tzinfo
+
+ self._update_rrule(**kwargs)
+
+ def set(self, **kwargs):
+ """Set parameters for an existing wrapper."""
+ self._construct.update(kwargs)
+
+ self._update_rrule(**self._construct)
+
+ def _update_rrule(self, **kwargs):
+ tzinfo = self._base_tzinfo
+
+ # rrule does not play nicely with timezones - especially pytz time
+ # zones, it's best to use naive zones and attach timezones once the
+ # datetimes are returned
+ if 'dtstart' in kwargs:
+ dtstart = kwargs['dtstart']
+ if dtstart.tzinfo is not None:
+ if tzinfo is None:
+ tzinfo = dtstart.tzinfo
+ else:
+ dtstart = dtstart.astimezone(tzinfo)
+
+ kwargs['dtstart'] = dtstart.replace(tzinfo=None)
+
+ if 'until' in kwargs:
+ until = kwargs['until']
+ if until.tzinfo is not None:
+ if tzinfo is not None:
+ until = until.astimezone(tzinfo)
+ else:
+ raise ValueError('until cannot be aware if dtstart '
+ 'is naive and tzinfo is None')
+
+ kwargs['until'] = until.replace(tzinfo=None)
+
+ self._construct = kwargs.copy()
+ self._tzinfo = tzinfo
+ self._rrule = rrule(**self._construct)
+
+ def _attach_tzinfo(self, dt, tzinfo):
+ # pytz zones are attached by "localizing" the datetime
+ if hasattr(tzinfo, 'localize'):
+ return tzinfo.localize(dt, is_dst=True)
+
+ return dt.replace(tzinfo=tzinfo)
+
+ def _aware_return_wrapper(self, f, returns_list=False):
+ """Decorator function that allows rrule methods to handle tzinfo."""
+ # This is only necessary if we're actually attaching a tzinfo
+ if self._tzinfo is None:
+ return f
+
+ # All datetime arguments must be naive. If they are not naive, they are
+ # converted to the _tzinfo zone before dropping the zone.
+ def normalize_arg(arg):
+ if isinstance(arg, datetime.datetime) and arg.tzinfo is not None:
+ if arg.tzinfo is not self._tzinfo:
+ arg = arg.astimezone(self._tzinfo)
+
+ return arg.replace(tzinfo=None)
+
+ return arg
+
+ def normalize_args(args, kwargs):
+ args = tuple(normalize_arg(arg) for arg in args)
+ kwargs = {kw: normalize_arg(arg) for kw, arg in kwargs.items()}
+
+ return args, kwargs
+
+ # There are two kinds of functions we care about - ones that return
+ # dates and ones that return lists of dates.
+ if not returns_list:
+ def inner_func(*args, **kwargs):
+ args, kwargs = normalize_args(args, kwargs)
+ dt = f(*args, **kwargs)
+ return self._attach_tzinfo(dt, self._tzinfo)
+ else:
+ def inner_func(*args, **kwargs):
+ args, kwargs = normalize_args(args, kwargs)
+ dts = f(*args, **kwargs)
+ return [self._attach_tzinfo(dt, self._tzinfo) for dt in dts]
+
+ return functools.wraps(f)(inner_func)
+
+ def __getattr__(self, name):
+ if name in self.__dict__:
+ return self.__dict__[name]
+
+ f = getattr(self._rrule, name)
+
+ if name in {'after', 'before'}:
+ return self._aware_return_wrapper(f)
+ elif name in {'xafter', 'xbefore', 'between'}:
+ return self._aware_return_wrapper(f, returns_list=True)
+ else:
+ return f
+
+ def __setstate__(self, state):
+ self.__dict__.update(state)
+
+
+class DateLocator(ticker.Locator):
+ """
+ Determines the tick locations when plotting dates.
+
+ This class is subclassed by other Locators and
+ is not meant to be used on its own.
+ """
+ hms0d = {'byhour': 0, 'byminute': 0, 'bysecond': 0}
+
+ def __init__(self, tz=None):
+ """
+ Parameters
+ ----------
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ self.tz = _get_tzinfo(tz)
+
+ def set_tzinfo(self, tz):
+ """
+ Set timezone info.
+
+ Parameters
+ ----------
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ self.tz = _get_tzinfo(tz)
+
+ def datalim_to_dt(self):
+ """Convert axis data interval to datetime objects."""
+ dmin, dmax = self.axis.get_data_interval()
+ if dmin > dmax:
+ dmin, dmax = dmax, dmin
+
+ return num2date(dmin, self.tz), num2date(dmax, self.tz)
+
+ def viewlim_to_dt(self):
+ """Convert the view interval to datetime objects."""
+ vmin, vmax = self.axis.get_view_interval()
+ if vmin > vmax:
+ vmin, vmax = vmax, vmin
+ return num2date(vmin, self.tz), num2date(vmax, self.tz)
+
+ def _get_unit(self):
+ """
+ Return how many days a unit of the locator is; used for
+ intelligent autoscaling.
+ """
+ return 1
+
+ def _get_interval(self):
+ """
+ Return the number of units for each tick.
+ """
+ return 1
+
+ def nonsingular(self, vmin, vmax):
+ """
+ Given the proposed upper and lower extent, adjust the range
+ if it is too close to being singular (i.e. a range of ~0).
+ """
+ if not np.isfinite(vmin) or not np.isfinite(vmax):
+ # Except if there is no data, then use 1970 as default.
+ return (date2num(datetime.date(1970, 1, 1)),
+ date2num(datetime.date(1970, 1, 2)))
+ if vmax < vmin:
+ vmin, vmax = vmax, vmin
+ unit = self._get_unit()
+ interval = self._get_interval()
+ if abs(vmax - vmin) < 1e-6:
+ vmin -= 2 * unit * interval
+ vmax += 2 * unit * interval
+ return vmin, vmax
+
+
+class RRuleLocator(DateLocator):
+ # use the dateutil rrule instance
+
+ def __init__(self, o, tz=None):
+ super().__init__(tz)
+ self.rule = o
+
+ def __call__(self):
+ # if no data have been set, this will tank with a ValueError
+ try:
+ dmin, dmax = self.viewlim_to_dt()
+ except ValueError:
+ return []
+
+ return self.tick_values(dmin, dmax)
+
+ def tick_values(self, vmin, vmax):
+ start, stop = self._create_rrule(vmin, vmax)
+ dates = self.rule.between(start, stop, True)
+ if len(dates) == 0:
+ return date2num([vmin, vmax])
+ return self.raise_if_exceeds(date2num(dates))
+
+ def _create_rrule(self, vmin, vmax):
+ # set appropriate rrule dtstart and until and return
+ # start and end
+ delta = relativedelta(vmax, vmin)
+
+ # We need to cap at the endpoints of valid datetime
+ try:
+ start = vmin - delta
+ except (ValueError, OverflowError):
+ # cap
+ start = datetime.datetime(1, 1, 1, 0, 0, 0,
+ tzinfo=datetime.timezone.utc)
+
+ try:
+ stop = vmax + delta
+ except (ValueError, OverflowError):
+ # cap
+ stop = datetime.datetime(9999, 12, 31, 23, 59, 59,
+ tzinfo=datetime.timezone.utc)
+
+ self.rule.set(dtstart=start, until=stop)
+
+ return vmin, vmax
+
+ def _get_unit(self):
+ # docstring inherited
+ freq = self.rule._rrule._freq
+ return self.get_unit_generic(freq)
+
+ @staticmethod
+ def get_unit_generic(freq):
+ if freq == YEARLY:
+ return DAYS_PER_YEAR
+ elif freq == MONTHLY:
+ return DAYS_PER_MONTH
+ elif freq == WEEKLY:
+ return DAYS_PER_WEEK
+ elif freq == DAILY:
+ return 1.0
+ elif freq == HOURLY:
+ return 1.0 / HOURS_PER_DAY
+ elif freq == MINUTELY:
+ return 1.0 / MINUTES_PER_DAY
+ elif freq == SECONDLY:
+ return 1.0 / SEC_PER_DAY
+ else:
+ # error
+ return -1 # or should this just return '1'?
+
+ def _get_interval(self):
+ return self.rule._rrule._interval
+
+
+class AutoDateLocator(DateLocator):
+ """
+ On autoscale, this class picks the best `DateLocator` to set the view
+ limits and the tick locations.
+
+ Attributes
+ ----------
+ intervald : dict
+
+ Mapping of tick frequencies to multiples allowed for that ticking.
+ The default is ::
+
+ self.intervald = {
+ YEARLY : [1, 2, 4, 5, 10, 20, 40, 50, 100, 200, 400, 500,
+ 1000, 2000, 4000, 5000, 10000],
+ MONTHLY : [1, 2, 3, 4, 6],
+ DAILY : [1, 2, 3, 7, 14, 21],
+ HOURLY : [1, 2, 3, 4, 6, 12],
+ MINUTELY: [1, 5, 10, 15, 30],
+ SECONDLY: [1, 5, 10, 15, 30],
+ MICROSECONDLY: [1, 2, 5, 10, 20, 50, 100, 200, 500,
+ 1000, 2000, 5000, 10000, 20000, 50000,
+ 100000, 200000, 500000, 1000000],
+ }
+
+ where the keys are defined in `dateutil.rrule`.
+
+ The interval is used to specify multiples that are appropriate for
+ the frequency of ticking. For instance, every 7 days is sensible
+ for daily ticks, but for minutes/seconds, 15 or 30 make sense.
+
+ When customizing, you should only modify the values for the existing
+ keys. You should not add or delete entries.
+
+ Example for forcing ticks every 3 hours::
+
+ locator = AutoDateLocator()
+ locator.intervald[HOURLY] = [3] # only show every 3 hours
+ """
+
+ def __init__(self, tz=None, minticks=5, maxticks=None,
+ interval_multiples=True):
+ """
+ Parameters
+ ----------
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ minticks : int
+ The minimum number of ticks desired; controls whether ticks occur
+ yearly, monthly, etc.
+ maxticks : int
+ The maximum number of ticks desired; controls the interval between
+ ticks (ticking every other, every 3, etc.). For fine-grained
+ control, this can be a dictionary mapping individual rrule
+ frequency constants (YEARLY, MONTHLY, etc.) to their own maximum
+ number of ticks. This can be used to keep the number of ticks
+ appropriate to the format chosen in `AutoDateFormatter`. Any
+ frequency not specified in this dictionary is given a default
+ value.
+ interval_multiples : bool, default: True
+ Whether ticks should be chosen to be multiple of the interval,
+ locking them to 'nicer' locations. For example, this will force
+ the ticks to be at hours 0, 6, 12, 18 when hourly ticking is done
+ at 6 hour intervals.
+ """
+ super().__init__(tz=tz)
+ self._freq = YEARLY
+ self._freqs = [YEARLY, MONTHLY, DAILY, HOURLY, MINUTELY,
+ SECONDLY, MICROSECONDLY]
+ self.minticks = minticks
+
+ self.maxticks = {YEARLY: 11, MONTHLY: 12, DAILY: 11, HOURLY: 12,
+ MINUTELY: 11, SECONDLY: 11, MICROSECONDLY: 8}
+ if maxticks is not None:
+ try:
+ self.maxticks.update(maxticks)
+ except TypeError:
+ # Assume we were given an integer. Use this as the maximum
+ # number of ticks for every frequency and create a
+ # dictionary for this
+ self.maxticks = dict.fromkeys(self._freqs, maxticks)
+ self.interval_multiples = interval_multiples
+ self.intervald = {
+ YEARLY: [1, 2, 4, 5, 10, 20, 40, 50, 100, 200, 400, 500,
+ 1000, 2000, 4000, 5000, 10000],
+ MONTHLY: [1, 2, 3, 4, 6],
+ DAILY: [1, 2, 3, 7, 14, 21],
+ HOURLY: [1, 2, 3, 4, 6, 12],
+ MINUTELY: [1, 5, 10, 15, 30],
+ SECONDLY: [1, 5, 10, 15, 30],
+ MICROSECONDLY: [1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000,
+ 5000, 10000, 20000, 50000, 100000, 200000, 500000,
+ 1000000],
+ }
+ if interval_multiples:
+ # Swap "3" for "4" in the DAILY list; If we use 3 we get bad
+ # tick loc for months w/ 31 days: 1, 4, ..., 28, 31, 1
+ # If we use 4 then we get: 1, 5, ... 25, 29, 1
+ self.intervald[DAILY] = [1, 2, 4, 7, 14]
+
+ self._byranges = [None, range(1, 13), range(1, 32),
+ range(0, 24), range(0, 60), range(0, 60), None]
+
+ def __call__(self):
+ # docstring inherited
+ dmin, dmax = self.viewlim_to_dt()
+ locator = self.get_locator(dmin, dmax)
+ return locator()
+
+ def tick_values(self, vmin, vmax):
+ return self.get_locator(vmin, vmax).tick_values(vmin, vmax)
+
+ def nonsingular(self, vmin, vmax):
+ # whatever is thrown at us, we can scale the unit.
+ # But default nonsingular date plots at an ~4 year period.
+ if not np.isfinite(vmin) or not np.isfinite(vmax):
+ # Except if there is no data, then use 1970 as default.
+ return (date2num(datetime.date(1970, 1, 1)),
+ date2num(datetime.date(1970, 1, 2)))
+ if vmax < vmin:
+ vmin, vmax = vmax, vmin
+ if vmin == vmax:
+ vmin = vmin - DAYS_PER_YEAR * 2
+ vmax = vmax + DAYS_PER_YEAR * 2
+ return vmin, vmax
+
+ def _get_unit(self):
+ if self._freq in [MICROSECONDLY]:
+ return 1. / MUSECONDS_PER_DAY
+ else:
+ return RRuleLocator.get_unit_generic(self._freq)
+
+ def get_locator(self, dmin, dmax):
+ """Pick the best locator based on a distance."""
+ delta = relativedelta(dmax, dmin)
+ tdelta = dmax - dmin
+
+ # take absolute difference
+ if dmin > dmax:
+ delta = -delta
+ tdelta = -tdelta
+ # The following uses a mix of calls to relativedelta and timedelta
+ # methods because there is incomplete overlap in the functionality of
+ # these similar functions, and it's best to avoid doing our own math
+ # whenever possible.
+ numYears = float(delta.years)
+ numMonths = numYears * MONTHS_PER_YEAR + delta.months
+ numDays = tdelta.days # Avoids estimates of days/month, days/year.
+ numHours = numDays * HOURS_PER_DAY + delta.hours
+ numMinutes = numHours * MIN_PER_HOUR + delta.minutes
+ numSeconds = np.floor(tdelta.total_seconds())
+ numMicroseconds = np.floor(tdelta.total_seconds() * 1e6)
+
+ nums = [numYears, numMonths, numDays, numHours, numMinutes,
+ numSeconds, numMicroseconds]
+
+ use_rrule_locator = [True] * 6 + [False]
+
+ # Default setting of bymonth, etc. to pass to rrule
+ # [unused (for year), bymonth, bymonthday, byhour, byminute,
+ # bysecond, unused (for microseconds)]
+ byranges = [None, 1, 1, 0, 0, 0, None]
+
+ # Loop over all the frequencies and try to find one that gives at
+ # least a minticks tick positions. Once this is found, look for
+ # an interval from a list specific to that frequency that gives no
+ # more than maxticks tick positions. Also, set up some ranges
+ # (bymonth, etc.) as appropriate to be passed to rrulewrapper.
+ for i, (freq, num) in enumerate(zip(self._freqs, nums)):
+ # If this particular frequency doesn't give enough ticks, continue
+ if num < self.minticks:
+ # Since we're not using this particular frequency, set
+ # the corresponding by_ to None so the rrule can act as
+ # appropriate
+ byranges[i] = None
+ continue
+
+ # Find the first available interval that doesn't give too many
+ # ticks
+ for interval in self.intervald[freq]:
+ if num <= interval * (self.maxticks[freq] - 1):
+ break
+ else:
+ if not (self.interval_multiples and freq == DAILY):
+ _api.warn_external(
+ f"AutoDateLocator was unable to pick an appropriate "
+ f"interval for this date range. It may be necessary "
+ f"to add an interval value to the AutoDateLocator's "
+ f"intervald dictionary. Defaulting to {interval}.")
+
+ # Set some parameters as appropriate
+ self._freq = freq
+
+ if self._byranges[i] and self.interval_multiples:
+ byranges[i] = self._byranges[i][::interval]
+ if i in (DAILY, WEEKLY):
+ if interval == 14:
+ # just make first and 15th. Avoids 30th.
+ byranges[i] = [1, 15]
+ elif interval == 7:
+ byranges[i] = [1, 8, 15, 22]
+
+ interval = 1
+ else:
+ byranges[i] = self._byranges[i]
+ break
+ else:
+ interval = 1
+
+ if (freq == YEARLY) and self.interval_multiples:
+ locator = YearLocator(interval, tz=self.tz)
+ elif use_rrule_locator[i]:
+ _, bymonth, bymonthday, byhour, byminute, bysecond, _ = byranges
+ rrule = rrulewrapper(self._freq, interval=interval,
+ dtstart=dmin, until=dmax,
+ bymonth=bymonth, bymonthday=bymonthday,
+ byhour=byhour, byminute=byminute,
+ bysecond=bysecond)
+
+ locator = RRuleLocator(rrule, tz=self.tz)
+ else:
+ locator = MicrosecondLocator(interval, tz=self.tz)
+ if date2num(dmin) > 70 * 365 and interval < 1000:
+ _api.warn_external(
+ 'Plotting microsecond time intervals for dates far from '
+ f'the epoch (time origin: {get_epoch()}) is not well-'
+ 'supported. See matplotlib.dates.set_epoch to change the '
+ 'epoch.')
+
+ locator.set_axis(self.axis)
+ return locator
+
+
+class YearLocator(RRuleLocator):
+ """
+ Make ticks on a given day of each year that is a multiple of base.
+
+ Examples::
+
+ # Tick every year on Jan 1st
+ locator = YearLocator()
+
+ # Tick every 5 years on July 4th
+ locator = YearLocator(5, month=7, day=4)
+ """
+ def __init__(self, base=1, month=1, day=1, tz=None):
+ """
+ Parameters
+ ----------
+ base : int, default: 1
+ Mark ticks every *base* years.
+ month : int, default: 1
+ The month on which to place the ticks, starting from 1. Default is
+ January.
+ day : int, default: 1
+ The day on which to place the ticks.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ rule = rrulewrapper(YEARLY, interval=base, bymonth=month,
+ bymonthday=day, **self.hms0d)
+ super().__init__(rule, tz=tz)
+ self.base = ticker._Edge_integer(base, 0)
+
+ def _create_rrule(self, vmin, vmax):
+ # 'start' needs to be a multiple of the interval to create ticks on
+ # interval multiples when the tick frequency is YEARLY
+ ymin = max(self.base.le(vmin.year) * self.base.step, 1)
+ ymax = min(self.base.ge(vmax.year) * self.base.step, 9999)
+
+ c = self.rule._construct
+ replace = {'year': ymin,
+ 'month': c.get('bymonth', 1),
+ 'day': c.get('bymonthday', 1),
+ 'hour': 0, 'minute': 0, 'second': 0}
+
+ start = vmin.replace(**replace)
+ stop = start.replace(year=ymax)
+ self.rule.set(dtstart=start, until=stop)
+
+ return start, stop
+
+
+class MonthLocator(RRuleLocator):
+ """
+ Make ticks on occurrences of each month, e.g., 1, 3, 12.
+ """
+ def __init__(self, bymonth=None, bymonthday=1, interval=1, tz=None):
+ """
+ Parameters
+ ----------
+ bymonth : int or list of int, default: all months
+ Ticks will be placed on every month in *bymonth*. Default is
+ ``range(1, 13)``, i.e. every month.
+ bymonthday : int, default: 1
+ The day on which to place the ticks.
+ interval : int, default: 1
+ The interval between each iteration. For example, if
+ ``interval=2``, mark every second occurrence.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ if bymonth is None:
+ bymonth = range(1, 13)
+
+ rule = rrulewrapper(MONTHLY, bymonth=bymonth, bymonthday=bymonthday,
+ interval=interval, **self.hms0d)
+ super().__init__(rule, tz=tz)
+
+
+class WeekdayLocator(RRuleLocator):
+ """
+ Make ticks on occurrences of each weekday.
+ """
+
+ def __init__(self, byweekday=1, interval=1, tz=None):
+ """
+ Parameters
+ ----------
+ byweekday : int or list of int, default: all days
+ Ticks will be placed on every weekday in *byweekday*. Default is
+ every day.
+
+ Elements of *byweekday* must be one of MO, TU, WE, TH, FR, SA,
+ SU, the constants from :mod:`dateutil.rrule`, which have been
+ imported into the :mod:`matplotlib.dates` namespace.
+ interval : int, default: 1
+ The interval between each iteration. For example, if
+ ``interval=2``, mark every second occurrence.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ rule = rrulewrapper(DAILY, byweekday=byweekday,
+ interval=interval, **self.hms0d)
+ super().__init__(rule, tz=tz)
+
+
+class DayLocator(RRuleLocator):
+ """
+ Make ticks on occurrences of each day of the month. For example,
+ 1, 15, 30.
+ """
+ def __init__(self, bymonthday=None, interval=1, tz=None):
+ """
+ Parameters
+ ----------
+ bymonthday : int or list of int, default: all days
+ Ticks will be placed on every day in *bymonthday*. Default is
+ ``bymonthday=range(1, 32)``, i.e., every day of the month.
+ interval : int, default: 1
+ The interval between each iteration. For example, if
+ ``interval=2``, mark every second occurrence.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ if interval != int(interval) or interval < 1:
+ raise ValueError("interval must be an integer greater than 0")
+ if bymonthday is None:
+ bymonthday = range(1, 32)
+
+ rule = rrulewrapper(DAILY, bymonthday=bymonthday,
+ interval=interval, **self.hms0d)
+ super().__init__(rule, tz=tz)
+
+
+class HourLocator(RRuleLocator):
+ """
+ Make ticks on occurrences of each hour.
+ """
+ def __init__(self, byhour=None, interval=1, tz=None):
+ """
+ Parameters
+ ----------
+ byhour : int or list of int, default: all hours
+ Ticks will be placed on every hour in *byhour*. Default is
+ ``byhour=range(24)``, i.e., every hour.
+ interval : int, default: 1
+ The interval between each iteration. For example, if
+ ``interval=2``, mark every second occurrence.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ if byhour is None:
+ byhour = range(24)
+
+ rule = rrulewrapper(HOURLY, byhour=byhour, interval=interval,
+ byminute=0, bysecond=0)
+ super().__init__(rule, tz=tz)
+
+
+class MinuteLocator(RRuleLocator):
+ """
+ Make ticks on occurrences of each minute.
+ """
+ def __init__(self, byminute=None, interval=1, tz=None):
+ """
+ Parameters
+ ----------
+ byminute : int or list of int, default: all minutes
+ Ticks will be placed on every minute in *byminute*. Default is
+ ``byminute=range(60)``, i.e., every minute.
+ interval : int, default: 1
+ The interval between each iteration. For example, if
+ ``interval=2``, mark every second occurrence.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ if byminute is None:
+ byminute = range(60)
+
+ rule = rrulewrapper(MINUTELY, byminute=byminute, interval=interval,
+ bysecond=0)
+ super().__init__(rule, tz=tz)
+
+
+class SecondLocator(RRuleLocator):
+ """
+ Make ticks on occurrences of each second.
+ """
+ def __init__(self, bysecond=None, interval=1, tz=None):
+ """
+ Parameters
+ ----------
+ bysecond : int or list of int, default: all seconds
+ Ticks will be placed on every second in *bysecond*. Default is
+ ``bysecond = range(60)``, i.e., every second.
+ interval : int, default: 1
+ The interval between each iteration. For example, if
+ ``interval=2``, mark every second occurrence.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ if bysecond is None:
+ bysecond = range(60)
+
+ rule = rrulewrapper(SECONDLY, bysecond=bysecond, interval=interval)
+ super().__init__(rule, tz=tz)
+
+
+class MicrosecondLocator(DateLocator):
+ """
+ Make ticks on regular intervals of one or more microsecond(s).
+
+ .. note::
+
+ By default, Matplotlib uses a floating point representation of time in
+ days since the epoch, so plotting data with
+ microsecond time resolution does not work well for
+ dates that are far (about 70 years) from the epoch (check with
+ `~.dates.get_epoch`).
+
+ If you want sub-microsecond resolution time plots, it is strongly
+ recommended to use floating point seconds, not datetime-like
+ time representation.
+
+ If you really must use datetime.datetime() or similar and still
+ need microsecond precision, change the time origin via
+ `.dates.set_epoch` to something closer to the dates being plotted.
+ See :doc:`/gallery/ticks/date_precision_and_epochs`.
+
+ """
+ def __init__(self, interval=1, tz=None):
+ """
+ Parameters
+ ----------
+ interval : int, default: 1
+ The interval between each iteration. For example, if
+ ``interval=2``, mark every second occurrence.
+ tz : str or `~datetime.tzinfo`, default: :rc:`timezone`
+ Ticks timezone. If a string, *tz* is passed to `dateutil.tz`.
+ """
+ super().__init__(tz=tz)
+ self._interval = interval
+ self._wrapped_locator = ticker.MultipleLocator(interval)
+
+ def set_axis(self, axis):
+ self._wrapped_locator.set_axis(axis)
+ return super().set_axis(axis)
+
+ def __call__(self):
+ # if no data have been set, this will tank with a ValueError
+ try:
+ dmin, dmax = self.viewlim_to_dt()
+ except ValueError:
+ return []
+
+ return self.tick_values(dmin, dmax)
+
+ def tick_values(self, vmin, vmax):
+ nmin, nmax = date2num((vmin, vmax))
+ t0 = np.floor(nmin)
+ nmax = nmax - t0
+ nmin = nmin - t0
+ nmin *= MUSECONDS_PER_DAY
+ nmax *= MUSECONDS_PER_DAY
+
+ ticks = self._wrapped_locator.tick_values(nmin, nmax)
+
+ ticks = ticks / MUSECONDS_PER_DAY + t0
+ return ticks
+
+ def _get_unit(self):
+ # docstring inherited
+ return 1. / MUSECONDS_PER_DAY
+
+ def _get_interval(self):
+ # docstring inherited
+ return self._interval
+
+
+class DateConverter(units.ConversionInterface):
+ """
+ Converter for `datetime.date` and `datetime.datetime` data, or for
+ date/time data represented as it would be converted by `date2num`.
+
+ The 'unit' tag for such data is None or a `~datetime.tzinfo` instance.
+ """
+
+ def __init__(self, *, interval_multiples=True):
+ self._interval_multiples = interval_multiples
+ super().__init__()
+
+ def axisinfo(self, unit, axis):
+ """
+ Return the `~matplotlib.units.AxisInfo` for *unit*.
+
+ *unit* is a `~datetime.tzinfo` instance or None.
+ The *axis* argument is required but not used.
+ """
+ tz = unit
+
+ majloc = AutoDateLocator(tz=tz,
+ interval_multiples=self._interval_multiples)
+ majfmt = AutoDateFormatter(majloc, tz=tz)
+ datemin = datetime.date(1970, 1, 1)
+ datemax = datetime.date(1970, 1, 2)
+
+ return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='',
+ default_limits=(datemin, datemax))
+
+ @staticmethod
+ def convert(value, unit, axis):
+ """
+ If *value* is not already a number or sequence of numbers, convert it
+ with `date2num`.
+
+ The *unit* and *axis* arguments are not used.
+ """
+ return date2num(value)
+
+ @staticmethod
+ def default_units(x, axis):
+ """
+ Return the `~datetime.tzinfo` instance of *x* or of its first element,
+ or None
+ """
+ if isinstance(x, np.ndarray):
+ x = x.ravel()
+
+ try:
+ x = cbook._safe_first_finite(x)
+ except (TypeError, StopIteration):
+ pass
+
+ try:
+ return x.tzinfo
+ except AttributeError:
+ pass
+ return None
+
+
+class ConciseDateConverter(DateConverter):
+ # docstring inherited
+
+ def __init__(self, formats=None, zero_formats=None, offset_formats=None,
+ show_offset=True, *, interval_multiples=True):
+ self._formats = formats
+ self._zero_formats = zero_formats
+ self._offset_formats = offset_formats
+ self._show_offset = show_offset
+ self._interval_multiples = interval_multiples
+ super().__init__()
+
+ def axisinfo(self, unit, axis):
+ # docstring inherited
+ tz = unit
+ majloc = AutoDateLocator(tz=tz,
+ interval_multiples=self._interval_multiples)
+ majfmt = ConciseDateFormatter(majloc, tz=tz, formats=self._formats,
+ zero_formats=self._zero_formats,
+ offset_formats=self._offset_formats,
+ show_offset=self._show_offset)
+ datemin = datetime.date(1970, 1, 1)
+ datemax = datetime.date(1970, 1, 2)
+ return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='',
+ default_limits=(datemin, datemax))
+
+
+class _SwitchableDateConverter:
+ """
+ Helper converter-like object that generates and dispatches to
+ temporary ConciseDateConverter or DateConverter instances based on
+ :rc:`date.converter` and :rc:`date.interval_multiples`.
+ """
+
+ @staticmethod
+ def _get_converter():
+ converter_cls = {
+ "concise": ConciseDateConverter, "auto": DateConverter}[
+ mpl.rcParams["date.converter"]]
+ interval_multiples = mpl.rcParams["date.interval_multiples"]
+ return converter_cls(interval_multiples=interval_multiples)
+
+ def axisinfo(self, *args, **kwargs):
+ return self._get_converter().axisinfo(*args, **kwargs)
+
+ def default_units(self, *args, **kwargs):
+ return self._get_converter().default_units(*args, **kwargs)
+
+ def convert(self, *args, **kwargs):
+ return self._get_converter().convert(*args, **kwargs)
+
+
+units.registry[np.datetime64] = \
+ units.registry[datetime.date] = \
+ units.registry[datetime.datetime] = \
+ _SwitchableDateConverter()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dviread.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dviread.py
new file mode 100644
index 0000000000000000000000000000000000000000..bd21367ce73dc39658ab3c671c2ec2ebba5341f3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dviread.py
@@ -0,0 +1,1139 @@
+"""
+A module for reading dvi files output by TeX. Several limitations make
+this not (currently) useful as a general-purpose dvi preprocessor, but
+it is currently used by the pdf backend for processing usetex text.
+
+Interface::
+
+ with Dvi(filename, 72) as dvi:
+ # iterate over pages:
+ for page in dvi:
+ w, h, d = page.width, page.height, page.descent
+ for x, y, font, glyph, width in page.text:
+ fontname = font.texname
+ pointsize = font.size
+ ...
+ for x, y, height, width in page.boxes:
+ ...
+"""
+
+from collections import namedtuple
+import enum
+from functools import lru_cache, partial, wraps
+import logging
+import os
+from pathlib import Path
+import re
+import struct
+import subprocess
+import sys
+
+import numpy as np
+
+from matplotlib import _api, cbook
+
+_log = logging.getLogger(__name__)
+
+# Many dvi related files are looked for by external processes, require
+# additional parsing, and are used many times per rendering, which is why they
+# are cached using lru_cache().
+
+# Dvi is a bytecode format documented in
+# https://ctan.org/pkg/dvitype
+# https://texdoc.org/serve/dvitype.pdf/0
+#
+# The file consists of a preamble, some number of pages, a postamble,
+# and a finale. Different opcodes are allowed in different contexts,
+# so the Dvi object has a parser state:
+#
+# pre: expecting the preamble
+# outer: between pages (followed by a page or the postamble,
+# also e.g. font definitions are allowed)
+# page: processing a page
+# post_post: state after the postamble (our current implementation
+# just stops reading)
+# finale: the finale (unimplemented in our current implementation)
+
+_dvistate = enum.Enum('DviState', 'pre outer inpage post_post finale')
+
+# The marks on a page consist of text and boxes. A page also has dimensions.
+Page = namedtuple('Page', 'text boxes height width descent')
+Box = namedtuple('Box', 'x y height width')
+
+
+# Also a namedtuple, for backcompat.
+class Text(namedtuple('Text', 'x y font glyph width')):
+ """
+ A glyph in the dvi file.
+
+ The *x* and *y* attributes directly position the glyph. The *font*,
+ *glyph*, and *width* attributes are kept public for back-compatibility,
+ but users wanting to draw the glyph themselves are encouraged to instead
+ load the font specified by `font_path` at `font_size`, warp it with the
+ effects specified by `font_effects`, and load the glyph specified by
+ `glyph_name_or_index`.
+ """
+
+ def _get_pdftexmap_entry(self):
+ return PsfontsMap(find_tex_file("pdftex.map"))[self.font.texname]
+
+ @property
+ def font_path(self):
+ """The `~pathlib.Path` to the font for this glyph."""
+ psfont = self._get_pdftexmap_entry()
+ if psfont.filename is None:
+ raise ValueError("No usable font file found for {} ({}); "
+ "the font may lack a Type-1 version"
+ .format(psfont.psname.decode("ascii"),
+ psfont.texname.decode("ascii")))
+ return Path(psfont.filename)
+
+ @property
+ def font_size(self):
+ """The font size."""
+ return self.font.size
+
+ @property
+ def font_effects(self):
+ """
+ The "font effects" dict for this glyph.
+
+ This dict contains the values for this glyph of SlantFont and
+ ExtendFont (if any), read off :file:`pdftex.map`.
+ """
+ return self._get_pdftexmap_entry().effects
+
+ @property
+ def glyph_name_or_index(self):
+ """
+ Either the glyph name or the native charmap glyph index.
+
+ If :file:`pdftex.map` specifies an encoding for this glyph's font, that
+ is a mapping of glyph indices to Adobe glyph names; use it to convert
+ dvi indices to glyph names. Callers can then convert glyph names to
+ glyph indices (with FT_Get_Name_Index/get_name_index), and load the
+ glyph using FT_Load_Glyph/load_glyph.
+
+ If :file:`pdftex.map` specifies no encoding, the indices directly map
+ to the font's "native" charmap; glyphs should directly load using
+ FT_Load_Char/load_char after selecting the native charmap.
+ """
+ entry = self._get_pdftexmap_entry()
+ return (_parse_enc(entry.encoding)[self.glyph]
+ if entry.encoding is not None else self.glyph)
+
+
+# Opcode argument parsing
+#
+# Each of the following functions takes a Dvi object and delta, which is the
+# difference between the opcode and the minimum opcode with the same meaning.
+# Dvi opcodes often encode the number of argument bytes in this delta.
+_arg_mapping = dict(
+ # raw: Return delta as is.
+ raw=lambda dvi, delta: delta,
+ # u1: Read 1 byte as an unsigned number.
+ u1=lambda dvi, delta: dvi._read_arg(1, signed=False),
+ # u4: Read 4 bytes as an unsigned number.
+ u4=lambda dvi, delta: dvi._read_arg(4, signed=False),
+ # s4: Read 4 bytes as a signed number.
+ s4=lambda dvi, delta: dvi._read_arg(4, signed=True),
+ # slen: Read delta bytes as a signed number, or None if delta is None.
+ slen=lambda dvi, delta: dvi._read_arg(delta, signed=True) if delta else None,
+ # slen1: Read (delta + 1) bytes as a signed number.
+ slen1=lambda dvi, delta: dvi._read_arg(delta + 1, signed=True),
+ # ulen1: Read (delta + 1) bytes as an unsigned number.
+ ulen1=lambda dvi, delta: dvi._read_arg(delta + 1, signed=False),
+ # olen1: Read (delta + 1) bytes as an unsigned number if less than 4 bytes,
+ # as a signed number if 4 bytes.
+ olen1=lambda dvi, delta: dvi._read_arg(delta + 1, signed=(delta == 3)),
+)
+
+
+def _dispatch(table, min, max=None, state=None, args=('raw',)):
+ """
+ Decorator for dispatch by opcode. Sets the values in *table*
+ from *min* to *max* to this method, adds a check that the Dvi state
+ matches *state* if not None, reads arguments from the file according
+ to *args*.
+
+ Parameters
+ ----------
+ table : dict[int, callable]
+ The dispatch table to be filled in.
+
+ min, max : int
+ Range of opcodes that calls the registered function; *max* defaults to
+ *min*.
+
+ state : _dvistate, optional
+ State of the Dvi object in which these opcodes are allowed.
+
+ args : list[str], default: ['raw']
+ Sequence of argument specifications:
+
+ - 'raw': opcode minus minimum
+ - 'u1': read one unsigned byte
+ - 'u4': read four bytes, treat as an unsigned number
+ - 's4': read four bytes, treat as a signed number
+ - 'slen': read (opcode - minimum) bytes, treat as signed
+ - 'slen1': read (opcode - minimum + 1) bytes, treat as signed
+ - 'ulen1': read (opcode - minimum + 1) bytes, treat as unsigned
+ - 'olen1': read (opcode - minimum + 1) bytes, treat as unsigned
+ if under four bytes, signed if four bytes
+ """
+ def decorate(method):
+ get_args = [_arg_mapping[x] for x in args]
+
+ @wraps(method)
+ def wrapper(self, byte):
+ if state is not None and self.state != state:
+ raise ValueError("state precondition failed")
+ return method(self, *[f(self, byte-min) for f in get_args])
+ if max is None:
+ table[min] = wrapper
+ else:
+ for i in range(min, max+1):
+ assert table[i] is None
+ table[i] = wrapper
+ return wrapper
+ return decorate
+
+
+class Dvi:
+ """
+ A reader for a dvi ("device-independent") file, as produced by TeX.
+
+ The current implementation can only iterate through pages in order,
+ and does not even attempt to verify the postamble.
+
+ This class can be used as a context manager to close the underlying
+ file upon exit. Pages can be read via iteration. Here is an overly
+ simple way to extract text without trying to detect whitespace::
+
+ >>> with matplotlib.dviread.Dvi('input.dvi', 72) as dvi:
+ ... for page in dvi:
+ ... print(''.join(chr(t.glyph) for t in page.text))
+ """
+ # dispatch table
+ _dtable = [None] * 256
+ _dispatch = partial(_dispatch, _dtable)
+
+ def __init__(self, filename, dpi):
+ """
+ Read the data from the file named *filename* and convert
+ TeX's internal units to units of *dpi* per inch.
+ *dpi* only sets the units and does not limit the resolution.
+ Use None to return TeX's internal units.
+ """
+ _log.debug('Dvi: %s', filename)
+ self.file = open(filename, 'rb')
+ self.dpi = dpi
+ self.fonts = {}
+ self.state = _dvistate.pre
+ self._missing_font = None
+
+ def __enter__(self):
+ """Context manager enter method, does nothing."""
+ return self
+
+ def __exit__(self, etype, evalue, etrace):
+ """
+ Context manager exit method, closes the underlying file if it is open.
+ """
+ self.close()
+
+ def __iter__(self):
+ """
+ Iterate through the pages of the file.
+
+ Yields
+ ------
+ Page
+ Details of all the text and box objects on the page.
+ The Page tuple contains lists of Text and Box tuples and
+ the page dimensions, and the Text and Box tuples contain
+ coordinates transformed into a standard Cartesian
+ coordinate system at the dpi value given when initializing.
+ The coordinates are floating point numbers, but otherwise
+ precision is not lost and coordinate values are not clipped to
+ integers.
+ """
+ while self._read():
+ yield self._output()
+
+ def close(self):
+ """Close the underlying file if it is open."""
+ if not self.file.closed:
+ self.file.close()
+
+ def _output(self):
+ """
+ Output the text and boxes belonging to the most recent page.
+ page = dvi._output()
+ """
+ minx = miny = np.inf
+ maxx = maxy = -np.inf
+ maxy_pure = -np.inf
+ for elt in self.text + self.boxes:
+ if isinstance(elt, Box):
+ x, y, h, w = elt
+ e = 0 # zero depth
+ else: # glyph
+ x, y, font, g, w = elt
+ h, e = font._height_depth_of(g)
+ minx = min(minx, x)
+ miny = min(miny, y - h)
+ maxx = max(maxx, x + w)
+ maxy = max(maxy, y + e)
+ maxy_pure = max(maxy_pure, y)
+ if self._baseline_v is not None:
+ maxy_pure = self._baseline_v # This should normally be the case.
+ self._baseline_v = None
+
+ if not self.text and not self.boxes: # Avoid infs/nans from inf+/-inf.
+ return Page(text=[], boxes=[], width=0, height=0, descent=0)
+
+ if self.dpi is None:
+ # special case for ease of debugging: output raw dvi coordinates
+ return Page(text=self.text, boxes=self.boxes,
+ width=maxx-minx, height=maxy_pure-miny,
+ descent=maxy-maxy_pure)
+
+ # convert from TeX's "scaled points" to dpi units
+ d = self.dpi / (72.27 * 2**16)
+ descent = (maxy - maxy_pure) * d
+
+ text = [Text((x-minx)*d, (maxy-y)*d - descent, f, g, w*d)
+ for (x, y, f, g, w) in self.text]
+ boxes = [Box((x-minx)*d, (maxy-y)*d - descent, h*d, w*d)
+ for (x, y, h, w) in self.boxes]
+
+ return Page(text=text, boxes=boxes, width=(maxx-minx)*d,
+ height=(maxy_pure-miny)*d, descent=descent)
+
+ def _read(self):
+ """
+ Read one page from the file. Return True if successful,
+ False if there were no more pages.
+ """
+ # Pages appear to start with the sequence
+ # bop (begin of page)
+ # xxx comment
+ # # if using chemformula
+ # down
+ # push
+ # down
+ # # if using xcolor
+ # down
+ # push
+ # down (possibly multiple)
+ # push <= here, v is the baseline position.
+ # etc.
+ # (dviasm is useful to explore this structure.)
+ # Thus, we use the vertical position at the first time the stack depth
+ # reaches 3, while at least three "downs" have been executed (excluding
+ # those popped out (corresponding to the chemformula preamble)), as the
+ # baseline (the "down" count is necessary to handle xcolor).
+ down_stack = [0]
+ self._baseline_v = None
+ while True:
+ byte = self.file.read(1)[0]
+ self._dtable[byte](self, byte)
+ if self._missing_font:
+ raise self._missing_font.to_exception()
+ name = self._dtable[byte].__name__
+ if name == "_push":
+ down_stack.append(down_stack[-1])
+ elif name == "_pop":
+ down_stack.pop()
+ elif name == "_down":
+ down_stack[-1] += 1
+ if (self._baseline_v is None
+ and len(getattr(self, "stack", [])) == 3
+ and down_stack[-1] >= 4):
+ self._baseline_v = self.v
+ if byte == 140: # end of page
+ return True
+ if self.state is _dvistate.post_post: # end of file
+ self.close()
+ return False
+
+ def _read_arg(self, nbytes, signed=False):
+ """
+ Read and return a big-endian integer *nbytes* long.
+ Signedness is determined by the *signed* keyword.
+ """
+ return int.from_bytes(self.file.read(nbytes), "big", signed=signed)
+
+ @_dispatch(min=0, max=127, state=_dvistate.inpage)
+ def _set_char_immediate(self, char):
+ self._put_char_real(char)
+ if isinstance(self.fonts[self.f], cbook._ExceptionInfo):
+ return
+ self.h += self.fonts[self.f]._width_of(char)
+
+ @_dispatch(min=128, max=131, state=_dvistate.inpage, args=('olen1',))
+ def _set_char(self, char):
+ self._put_char_real(char)
+ if isinstance(self.fonts[self.f], cbook._ExceptionInfo):
+ return
+ self.h += self.fonts[self.f]._width_of(char)
+
+ @_dispatch(132, state=_dvistate.inpage, args=('s4', 's4'))
+ def _set_rule(self, a, b):
+ self._put_rule_real(a, b)
+ self.h += b
+
+ @_dispatch(min=133, max=136, state=_dvistate.inpage, args=('olen1',))
+ def _put_char(self, char):
+ self._put_char_real(char)
+
+ def _put_char_real(self, char):
+ font = self.fonts[self.f]
+ if isinstance(font, cbook._ExceptionInfo):
+ self._missing_font = font
+ elif font._vf is None:
+ self.text.append(Text(self.h, self.v, font, char,
+ font._width_of(char)))
+ else:
+ scale = font._scale
+ for x, y, f, g, w in font._vf[char].text:
+ newf = DviFont(scale=_mul2012(scale, f._scale),
+ tfm=f._tfm, texname=f.texname, vf=f._vf)
+ self.text.append(Text(self.h + _mul2012(x, scale),
+ self.v + _mul2012(y, scale),
+ newf, g, newf._width_of(g)))
+ self.boxes.extend([Box(self.h + _mul2012(x, scale),
+ self.v + _mul2012(y, scale),
+ _mul2012(a, scale), _mul2012(b, scale))
+ for x, y, a, b in font._vf[char].boxes])
+
+ @_dispatch(137, state=_dvistate.inpage, args=('s4', 's4'))
+ def _put_rule(self, a, b):
+ self._put_rule_real(a, b)
+
+ def _put_rule_real(self, a, b):
+ if a > 0 and b > 0:
+ self.boxes.append(Box(self.h, self.v, a, b))
+
+ @_dispatch(138)
+ def _nop(self, _):
+ pass
+
+ @_dispatch(139, state=_dvistate.outer, args=('s4',)*11)
+ def _bop(self, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, p):
+ self.state = _dvistate.inpage
+ self.h = self.v = self.w = self.x = self.y = self.z = 0
+ self.stack = []
+ self.text = [] # list of Text objects
+ self.boxes = [] # list of Box objects
+
+ @_dispatch(140, state=_dvistate.inpage)
+ def _eop(self, _):
+ self.state = _dvistate.outer
+ del self.h, self.v, self.w, self.x, self.y, self.z, self.stack
+
+ @_dispatch(141, state=_dvistate.inpage)
+ def _push(self, _):
+ self.stack.append((self.h, self.v, self.w, self.x, self.y, self.z))
+
+ @_dispatch(142, state=_dvistate.inpage)
+ def _pop(self, _):
+ self.h, self.v, self.w, self.x, self.y, self.z = self.stack.pop()
+
+ @_dispatch(min=143, max=146, state=_dvistate.inpage, args=('slen1',))
+ def _right(self, b):
+ self.h += b
+
+ @_dispatch(min=147, max=151, state=_dvistate.inpage, args=('slen',))
+ def _right_w(self, new_w):
+ if new_w is not None:
+ self.w = new_w
+ self.h += self.w
+
+ @_dispatch(min=152, max=156, state=_dvistate.inpage, args=('slen',))
+ def _right_x(self, new_x):
+ if new_x is not None:
+ self.x = new_x
+ self.h += self.x
+
+ @_dispatch(min=157, max=160, state=_dvistate.inpage, args=('slen1',))
+ def _down(self, a):
+ self.v += a
+
+ @_dispatch(min=161, max=165, state=_dvistate.inpage, args=('slen',))
+ def _down_y(self, new_y):
+ if new_y is not None:
+ self.y = new_y
+ self.v += self.y
+
+ @_dispatch(min=166, max=170, state=_dvistate.inpage, args=('slen',))
+ def _down_z(self, new_z):
+ if new_z is not None:
+ self.z = new_z
+ self.v += self.z
+
+ @_dispatch(min=171, max=234, state=_dvistate.inpage)
+ def _fnt_num_immediate(self, k):
+ self.f = k
+
+ @_dispatch(min=235, max=238, state=_dvistate.inpage, args=('olen1',))
+ def _fnt_num(self, new_f):
+ self.f = new_f
+
+ @_dispatch(min=239, max=242, args=('ulen1',))
+ def _xxx(self, datalen):
+ special = self.file.read(datalen)
+ _log.debug(
+ 'Dvi._xxx: encountered special: %s',
+ ''.join([chr(ch) if 32 <= ch < 127 else '<%02x>' % ch
+ for ch in special]))
+
+ @_dispatch(min=243, max=246, args=('olen1', 'u4', 'u4', 'u4', 'u1', 'u1'))
+ def _fnt_def(self, k, c, s, d, a, l):
+ self._fnt_def_real(k, c, s, d, a, l)
+
+ def _fnt_def_real(self, k, c, s, d, a, l):
+ n = self.file.read(a + l)
+ fontname = n[-l:].decode('ascii')
+ try:
+ tfm = _tfmfile(fontname)
+ except FileNotFoundError as exc:
+ # Explicitly allow defining missing fonts for Vf support; we only
+ # register an error when trying to load a glyph from a missing font
+ # and throw that error in Dvi._read. For Vf, _finalize_packet
+ # checks whether a missing glyph has been used, and in that case
+ # skips the glyph definition.
+ self.fonts[k] = cbook._ExceptionInfo.from_exception(exc)
+ return
+ if c != 0 and tfm.checksum != 0 and c != tfm.checksum:
+ raise ValueError(f'tfm checksum mismatch: {n}')
+ try:
+ vf = _vffile(fontname)
+ except FileNotFoundError:
+ vf = None
+ self.fonts[k] = DviFont(scale=s, tfm=tfm, texname=n, vf=vf)
+
+ @_dispatch(247, state=_dvistate.pre, args=('u1', 'u4', 'u4', 'u4', 'u1'))
+ def _pre(self, i, num, den, mag, k):
+ self.file.read(k) # comment in the dvi file
+ if i != 2:
+ raise ValueError(f"Unknown dvi format {i}")
+ if num != 25400000 or den != 7227 * 2**16:
+ raise ValueError("Nonstandard units in dvi file")
+ # meaning: TeX always uses those exact values, so it
+ # should be enough for us to support those
+ # (There are 72.27 pt to an inch so 7227 pt =
+ # 7227 * 2**16 sp to 100 in. The numerator is multiplied
+ # by 10^5 to get units of 10**-7 meters.)
+ if mag != 1000:
+ raise ValueError("Nonstandard magnification in dvi file")
+ # meaning: LaTeX seems to frown on setting \mag, so
+ # I think we can assume this is constant
+ self.state = _dvistate.outer
+
+ @_dispatch(248, state=_dvistate.outer)
+ def _post(self, _):
+ self.state = _dvistate.post_post
+ # TODO: actually read the postamble and finale?
+ # currently post_post just triggers closing the file
+
+ @_dispatch(249)
+ def _post_post(self, _):
+ raise NotImplementedError
+
+ @_dispatch(min=250, max=255)
+ def _malformed(self, offset):
+ raise ValueError(f"unknown command: byte {250 + offset}")
+
+
+class DviFont:
+ """
+ Encapsulation of a font that a DVI file can refer to.
+
+ This class holds a font's texname and size, supports comparison,
+ and knows the widths of glyphs in the same units as the AFM file.
+ There are also internal attributes (for use by dviread.py) that
+ are *not* used for comparison.
+
+ The size is in Adobe points (converted from TeX points).
+
+ Parameters
+ ----------
+ scale : float
+ Factor by which the font is scaled from its natural size.
+ tfm : Tfm
+ TeX font metrics for this font
+ texname : bytes
+ Name of the font as used internally by TeX and friends, as an ASCII
+ bytestring. This is usually very different from any external font
+ names; `PsfontsMap` can be used to find the external name of the font.
+ vf : Vf
+ A TeX "virtual font" file, or None if this font is not virtual.
+
+ Attributes
+ ----------
+ texname : bytes
+ size : float
+ Size of the font in Adobe points, converted from the slightly
+ smaller TeX points.
+ widths : list
+ Widths of glyphs in glyph-space units, typically 1/1000ths of
+ the point size.
+
+ """
+ __slots__ = ('texname', 'size', 'widths', '_scale', '_vf', '_tfm')
+
+ def __init__(self, scale, tfm, texname, vf):
+ _api.check_isinstance(bytes, texname=texname)
+ self._scale = scale
+ self._tfm = tfm
+ self.texname = texname
+ self._vf = vf
+ self.size = scale * (72.0 / (72.27 * 2**16))
+ try:
+ nchars = max(tfm.width) + 1
+ except ValueError:
+ nchars = 0
+ self.widths = [(1000*tfm.width.get(char, 0)) >> 20
+ for char in range(nchars)]
+
+ def __eq__(self, other):
+ return (type(self) is type(other)
+ and self.texname == other.texname and self.size == other.size)
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+ def __repr__(self):
+ return f"<{type(self).__name__}: {self.texname}>"
+
+ def _width_of(self, char):
+ """Width of char in dvi units."""
+ width = self._tfm.width.get(char, None)
+ if width is not None:
+ return _mul2012(width, self._scale)
+ _log.debug('No width for char %d in font %s.', char, self.texname)
+ return 0
+
+ def _height_depth_of(self, char):
+ """Height and depth of char in dvi units."""
+ result = []
+ for metric, name in ((self._tfm.height, "height"),
+ (self._tfm.depth, "depth")):
+ value = metric.get(char, None)
+ if value is None:
+ _log.debug('No %s for char %d in font %s',
+ name, char, self.texname)
+ result.append(0)
+ else:
+ result.append(_mul2012(value, self._scale))
+ # cmsyXX (symbols font) glyph 0 ("minus") has a nonzero descent
+ # so that TeX aligns equations properly
+ # (https://tex.stackexchange.com/q/526103/)
+ # but we actually care about the rasterization depth to align
+ # the dvipng-generated images.
+ if re.match(br'^cmsy\d+$', self.texname) and char == 0:
+ result[-1] = 0
+ return result
+
+
+class Vf(Dvi):
+ r"""
+ A virtual font (\*.vf file) containing subroutines for dvi files.
+
+ Parameters
+ ----------
+ filename : str or path-like
+
+ Notes
+ -----
+ The virtual font format is a derivative of dvi:
+ http://mirrors.ctan.org/info/knuth/virtual-fonts
+ This class reuses some of the machinery of `Dvi`
+ but replaces the `_read` loop and dispatch mechanism.
+
+ Examples
+ --------
+ ::
+
+ vf = Vf(filename)
+ glyph = vf[code]
+ glyph.text, glyph.boxes, glyph.width
+ """
+
+ def __init__(self, filename):
+ super().__init__(filename, 0)
+ try:
+ self._first_font = None
+ self._chars = {}
+ self._read()
+ finally:
+ self.close()
+
+ def __getitem__(self, code):
+ return self._chars[code]
+
+ def _read(self):
+ """
+ Read one page from the file. Return True if successful,
+ False if there were no more pages.
+ """
+ packet_char = packet_ends = None
+ packet_len = packet_width = None
+ while True:
+ byte = self.file.read(1)[0]
+ # If we are in a packet, execute the dvi instructions
+ if self.state is _dvistate.inpage:
+ byte_at = self.file.tell()-1
+ if byte_at == packet_ends:
+ self._finalize_packet(packet_char, packet_width)
+ packet_len = packet_char = packet_width = None
+ # fall through to out-of-packet code
+ elif byte_at > packet_ends:
+ raise ValueError("Packet length mismatch in vf file")
+ else:
+ if byte in (139, 140) or byte >= 243:
+ raise ValueError(f"Inappropriate opcode {byte} in vf file")
+ Dvi._dtable[byte](self, byte)
+ continue
+
+ # We are outside a packet
+ if byte < 242: # a short packet (length given by byte)
+ packet_len = byte
+ packet_char = self._read_arg(1)
+ packet_width = self._read_arg(3)
+ packet_ends = self._init_packet(byte)
+ self.state = _dvistate.inpage
+ elif byte == 242: # a long packet
+ packet_len = self._read_arg(4)
+ packet_char = self._read_arg(4)
+ packet_width = self._read_arg(4)
+ self._init_packet(packet_len)
+ elif 243 <= byte <= 246:
+ k = self._read_arg(byte - 242, byte == 246)
+ c = self._read_arg(4)
+ s = self._read_arg(4)
+ d = self._read_arg(4)
+ a = self._read_arg(1)
+ l = self._read_arg(1)
+ self._fnt_def_real(k, c, s, d, a, l)
+ if self._first_font is None:
+ self._first_font = k
+ elif byte == 247: # preamble
+ i = self._read_arg(1)
+ k = self._read_arg(1)
+ x = self.file.read(k)
+ cs = self._read_arg(4)
+ ds = self._read_arg(4)
+ self._pre(i, x, cs, ds)
+ elif byte == 248: # postamble (just some number of 248s)
+ break
+ else:
+ raise ValueError(f"Unknown vf opcode {byte}")
+
+ def _init_packet(self, pl):
+ if self.state != _dvistate.outer:
+ raise ValueError("Misplaced packet in vf file")
+ self.h = self.v = self.w = self.x = self.y = self.z = 0
+ self.stack = []
+ self.text = []
+ self.boxes = []
+ self.f = self._first_font
+ self._missing_font = None
+ return self.file.tell() + pl
+
+ def _finalize_packet(self, packet_char, packet_width):
+ if not self._missing_font: # Otherwise we don't have full glyph definition.
+ self._chars[packet_char] = Page(
+ text=self.text, boxes=self.boxes, width=packet_width,
+ height=None, descent=None)
+ self.state = _dvistate.outer
+
+ def _pre(self, i, x, cs, ds):
+ if self.state is not _dvistate.pre:
+ raise ValueError("pre command in middle of vf file")
+ if i != 202:
+ raise ValueError(f"Unknown vf format {i}")
+ if len(x):
+ _log.debug('vf file comment: %s', x)
+ self.state = _dvistate.outer
+ # cs = checksum, ds = design size
+
+
+def _mul2012(num1, num2):
+ """Multiply two numbers in 20.12 fixed point format."""
+ # Separated into a function because >> has surprising precedence
+ return (num1*num2) >> 20
+
+
+class Tfm:
+ """
+ A TeX Font Metric file.
+
+ This implementation covers only the bare minimum needed by the Dvi class.
+
+ Parameters
+ ----------
+ filename : str or path-like
+
+ Attributes
+ ----------
+ checksum : int
+ Used for verifying against the dvi file.
+ design_size : int
+ Design size of the font (unknown units)
+ width, height, depth : dict
+ Dimensions of each character, need to be scaled by the factor
+ specified in the dvi file. These are dicts because indexing may
+ not start from 0.
+ """
+ __slots__ = ('checksum', 'design_size', 'width', 'height', 'depth')
+
+ def __init__(self, filename):
+ _log.debug('opening tfm file %s', filename)
+ with open(filename, 'rb') as file:
+ header1 = file.read(24)
+ lh, bc, ec, nw, nh, nd = struct.unpack('!6H', header1[2:14])
+ _log.debug('lh=%d, bc=%d, ec=%d, nw=%d, nh=%d, nd=%d',
+ lh, bc, ec, nw, nh, nd)
+ header2 = file.read(4*lh)
+ self.checksum, self.design_size = struct.unpack('!2I', header2[:8])
+ # there is also encoding information etc.
+ char_info = file.read(4*(ec-bc+1))
+ widths = struct.unpack(f'!{nw}i', file.read(4*nw))
+ heights = struct.unpack(f'!{nh}i', file.read(4*nh))
+ depths = struct.unpack(f'!{nd}i', file.read(4*nd))
+ self.width = {}
+ self.height = {}
+ self.depth = {}
+ for idx, char in enumerate(range(bc, ec+1)):
+ byte0 = char_info[4*idx]
+ byte1 = char_info[4*idx+1]
+ self.width[char] = widths[byte0]
+ self.height[char] = heights[byte1 >> 4]
+ self.depth[char] = depths[byte1 & 0xf]
+
+
+PsFont = namedtuple('PsFont', 'texname psname effects encoding filename')
+
+
+class PsfontsMap:
+ """
+ A psfonts.map formatted file, mapping TeX fonts to PS fonts.
+
+ Parameters
+ ----------
+ filename : str or path-like
+
+ Notes
+ -----
+ For historical reasons, TeX knows many Type-1 fonts by different
+ names than the outside world. (For one thing, the names have to
+ fit in eight characters.) Also, TeX's native fonts are not Type-1
+ but Metafont, which is nontrivial to convert to PostScript except
+ as a bitmap. While high-quality conversions to Type-1 format exist
+ and are shipped with modern TeX distributions, we need to know
+ which Type-1 fonts are the counterparts of which native fonts. For
+ these reasons a mapping is needed from internal font names to font
+ file names.
+
+ A texmf tree typically includes mapping files called e.g.
+ :file:`psfonts.map`, :file:`pdftex.map`, or :file:`dvipdfm.map`.
+ The file :file:`psfonts.map` is used by :program:`dvips`,
+ :file:`pdftex.map` by :program:`pdfTeX`, and :file:`dvipdfm.map`
+ by :program:`dvipdfm`. :file:`psfonts.map` might avoid embedding
+ the 35 PostScript fonts (i.e., have no filename for them, as in
+ the Times-Bold example above), while the pdf-related files perhaps
+ only avoid the "Base 14" pdf fonts. But the user may have
+ configured these files differently.
+
+ Examples
+ --------
+ >>> map = PsfontsMap(find_tex_file('pdftex.map'))
+ >>> entry = map[b'ptmbo8r']
+ >>> entry.texname
+ b'ptmbo8r'
+ >>> entry.psname
+ b'Times-Bold'
+ >>> entry.encoding
+ '/usr/local/texlive/2008/texmf-dist/fonts/enc/dvips/base/8r.enc'
+ >>> entry.effects
+ {'slant': 0.16700000000000001}
+ >>> entry.filename
+ """
+ __slots__ = ('_filename', '_unparsed', '_parsed')
+
+ # Create a filename -> PsfontsMap cache, so that calling
+ # `PsfontsMap(filename)` with the same filename a second time immediately
+ # returns the same object.
+ @lru_cache
+ def __new__(cls, filename):
+ self = object.__new__(cls)
+ self._filename = os.fsdecode(filename)
+ # Some TeX distributions have enormous pdftex.map files which would
+ # take hundreds of milliseconds to parse, but it is easy enough to just
+ # store the unparsed lines (keyed by the first word, which is the
+ # texname) and parse them on-demand.
+ with open(filename, 'rb') as file:
+ self._unparsed = {}
+ for line in file:
+ tfmname = line.split(b' ', 1)[0]
+ self._unparsed.setdefault(tfmname, []).append(line)
+ self._parsed = {}
+ return self
+
+ def __getitem__(self, texname):
+ assert isinstance(texname, bytes)
+ if texname in self._unparsed:
+ for line in self._unparsed.pop(texname):
+ if self._parse_and_cache_line(line):
+ break
+ try:
+ return self._parsed[texname]
+ except KeyError:
+ raise LookupError(
+ f"An associated PostScript font (required by Matplotlib) "
+ f"could not be found for TeX font {texname.decode('ascii')!r} "
+ f"in {self._filename!r}; this problem can often be solved by "
+ f"installing a suitable PostScript font package in your TeX "
+ f"package manager") from None
+
+ def _parse_and_cache_line(self, line):
+ """
+ Parse a line in the font mapping file.
+
+ The format is (partially) documented at
+ http://mirrors.ctan.org/systems/doc/pdftex/manual/pdftex-a.pdf
+ https://tug.org/texinfohtml/dvips.html#psfonts_002emap
+ Each line can have the following fields:
+
+ - tfmname (first, only required field),
+ - psname (defaults to tfmname, must come immediately after tfmname if
+ present),
+ - fontflags (integer, must come immediately after psname if present,
+ ignored by us),
+ - special (SlantFont and ExtendFont, only field that is double-quoted),
+ - fontfile, encodingfile (optional, prefixed by <, <<, or <[; << always
+ precedes a font, <[ always precedes an encoding, < can precede either
+ but then an encoding file must have extension .enc; < and << also
+ request different font subsetting behaviors but we ignore that; < can
+ be separated from the filename by whitespace).
+
+ special, fontfile, and encodingfile can appear in any order.
+ """
+ # If the map file specifies multiple encodings for a font, we
+ # follow pdfTeX in choosing the last one specified. Such
+ # entries are probably mistakes but they have occurred.
+ # https://tex.stackexchange.com/q/10826/
+
+ if not line or line.startswith((b" ", b"%", b"*", b";", b"#")):
+ return
+ tfmname = basename = special = encodingfile = fontfile = None
+ is_subsetted = is_t1 = is_truetype = False
+ matches = re.finditer(br'"([^"]*)(?:"|$)|(\S+)', line)
+ for match in matches:
+ quoted, unquoted = match.groups()
+ if unquoted:
+ if unquoted.startswith(b"<<"): # font
+ fontfile = unquoted[2:]
+ elif unquoted.startswith(b"<["): # encoding
+ encodingfile = unquoted[2:]
+ elif unquoted.startswith(b"<"): # font or encoding
+ word = (
+ # foo
+ unquoted[1:]
+ # < by itself => read the next word
+ or next(filter(None, next(matches).groups())))
+ if word.endswith(b".enc"):
+ encodingfile = word
+ else:
+ fontfile = word
+ is_subsetted = True
+ elif tfmname is None:
+ tfmname = unquoted
+ elif basename is None:
+ basename = unquoted
+ elif quoted:
+ special = quoted
+ effects = {}
+ if special:
+ words = reversed(special.split())
+ for word in words:
+ if word == b"SlantFont":
+ effects["slant"] = float(next(words))
+ elif word == b"ExtendFont":
+ effects["extend"] = float(next(words))
+
+ # Verify some properties of the line that would cause it to be ignored
+ # otherwise.
+ if fontfile is not None:
+ if fontfile.endswith((b".ttf", b".ttc")):
+ is_truetype = True
+ elif not fontfile.endswith(b".otf"):
+ is_t1 = True
+ elif basename is not None:
+ is_t1 = True
+ if is_truetype and is_subsetted and encodingfile is None:
+ return
+ if not is_t1 and ("slant" in effects or "extend" in effects):
+ return
+ if abs(effects.get("slant", 0)) > 1:
+ return
+ if abs(effects.get("extend", 0)) > 2:
+ return
+
+ if basename is None:
+ basename = tfmname
+ if encodingfile is not None:
+ encodingfile = find_tex_file(encodingfile)
+ if fontfile is not None:
+ fontfile = find_tex_file(fontfile)
+ self._parsed[tfmname] = PsFont(
+ texname=tfmname, psname=basename, effects=effects,
+ encoding=encodingfile, filename=fontfile)
+ return True
+
+
+def _parse_enc(path):
+ r"""
+ Parse a \*.enc file referenced from a psfonts.map style file.
+
+ The format supported by this function is a tiny subset of PostScript.
+
+ Parameters
+ ----------
+ path : `os.PathLike`
+
+ Returns
+ -------
+ list
+ The nth entry of the list is the PostScript glyph name of the nth
+ glyph.
+ """
+ no_comments = re.sub("%.*", "", Path(path).read_text(encoding="ascii"))
+ array = re.search(r"(?s)\[(.*)\]", no_comments).group(1)
+ lines = [line for line in array.split() if line]
+ if all(line.startswith("/") for line in lines):
+ return [line[1:] for line in lines]
+ else:
+ raise ValueError(f"Failed to parse {path} as Postscript encoding")
+
+
+class _LuatexKpsewhich:
+ @lru_cache # A singleton.
+ def __new__(cls):
+ self = object.__new__(cls)
+ self._proc = self._new_proc()
+ return self
+
+ def _new_proc(self):
+ return subprocess.Popen(
+ ["luatex", "--luaonly",
+ str(cbook._get_data_path("kpsewhich.lua"))],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+
+ def search(self, filename):
+ if self._proc.poll() is not None: # Dead, restart it.
+ self._proc = self._new_proc()
+ self._proc.stdin.write(os.fsencode(filename) + b"\n")
+ self._proc.stdin.flush()
+ out = self._proc.stdout.readline().rstrip()
+ return None if out == b"nil" else os.fsdecode(out)
+
+
+@lru_cache
+def find_tex_file(filename):
+ """
+ Find a file in the texmf tree using kpathsea_.
+
+ The kpathsea library, provided by most existing TeX distributions, both
+ on Unix-like systems and on Windows (MikTeX), is invoked via a long-lived
+ luatex process if luatex is installed, or via kpsewhich otherwise.
+
+ .. _kpathsea: https://www.tug.org/kpathsea/
+
+ Parameters
+ ----------
+ filename : str or path-like
+
+ Raises
+ ------
+ FileNotFoundError
+ If the file is not found.
+ """
+
+ # we expect these to always be ascii encoded, but use utf-8
+ # out of caution
+ if isinstance(filename, bytes):
+ filename = filename.decode('utf-8', errors='replace')
+
+ try:
+ lk = _LuatexKpsewhich()
+ except FileNotFoundError:
+ lk = None # Fallback to directly calling kpsewhich, as below.
+
+ if lk:
+ path = lk.search(filename)
+ else:
+ if sys.platform == 'win32':
+ # On Windows only, kpathsea can use utf-8 for cmd args and output.
+ # The `command_line_encoding` environment variable is set to force
+ # it to always use utf-8 encoding. See Matplotlib issue #11848.
+ kwargs = {'env': {**os.environ, 'command_line_encoding': 'utf-8'},
+ 'encoding': 'utf-8'}
+ else: # On POSIX, run through the equivalent of os.fsdecode().
+ kwargs = {'encoding': sys.getfilesystemencoding(),
+ 'errors': 'surrogateescape'}
+
+ try:
+ path = (cbook._check_and_log_subprocess(['kpsewhich', filename],
+ _log, **kwargs)
+ .rstrip('\n'))
+ except (FileNotFoundError, RuntimeError):
+ path = None
+
+ if path:
+ return path
+ else:
+ raise FileNotFoundError(
+ f"Matplotlib's TeX implementation searched for a file named "
+ f"{filename!r} in your texmf tree, but could not find it")
+
+
+@lru_cache
+def _fontfile(cls, suffix, texname):
+ return cls(find_tex_file(texname + suffix))
+
+
+_tfmfile = partial(_fontfile, Tfm, ".tfm")
+_vffile = partial(_fontfile, Vf, ".vf")
+
+
+if __name__ == '__main__':
+ from argparse import ArgumentParser
+ import itertools
+
+ parser = ArgumentParser()
+ parser.add_argument("filename")
+ parser.add_argument("dpi", nargs="?", type=float, default=None)
+ args = parser.parse_args()
+ with Dvi(args.filename, args.dpi) as dvi:
+ fontmap = PsfontsMap(find_tex_file('pdftex.map'))
+ for page in dvi:
+ print(f"=== new page === "
+ f"(w: {page.width}, h: {page.height}, d: {page.descent})")
+ for font, group in itertools.groupby(
+ page.text, lambda text: text.font):
+ print(f"font: {font.texname.decode('latin-1')!r}\t"
+ f"scale: {font._scale / 2 ** 20}")
+ print("x", "y", "glyph", "chr", "w", "(glyphs)", sep="\t")
+ for text in group:
+ print(text.x, text.y, text.glyph,
+ chr(text.glyph) if chr(text.glyph).isprintable()
+ else ".",
+ text.width, sep="\t")
+ if page.boxes:
+ print("x", "y", "h", "w", "", "(boxes)", sep="\t")
+ for box in page.boxes:
+ print(box.x, box.y, box.height, box.width, sep="\t")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dviread.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dviread.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..8073ee9fbff852bc3583cb79ade6be5aab7e58d5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/dviread.pyi
@@ -0,0 +1,89 @@
+from pathlib import Path
+import io
+import os
+from enum import Enum
+from collections.abc import Generator
+
+from typing import NamedTuple
+from typing_extensions import Self # < Py 3.11
+
+class _dvistate(Enum):
+ pre = ...
+ outer = ...
+ inpage = ...
+ post_post = ...
+ finale = ...
+
+class Page(NamedTuple):
+ text: list[Text]
+ boxes: list[Box]
+ height: int
+ width: int
+ descent: int
+
+class Box(NamedTuple):
+ x: int
+ y: int
+ height: int
+ width: int
+
+class Text(NamedTuple):
+ x: int
+ y: int
+ font: DviFont
+ glyph: int
+ width: int
+ @property
+ def font_path(self) -> Path: ...
+ @property
+ def font_size(self) -> float: ...
+ @property
+ def font_effects(self) -> dict[str, float]: ...
+ @property
+ def glyph_name_or_index(self) -> int | str: ...
+
+class Dvi:
+ file: io.BufferedReader
+ dpi: float | None
+ fonts: dict[int, DviFont]
+ state: _dvistate
+ def __init__(self, filename: str | os.PathLike, dpi: float | None) -> None: ...
+ def __enter__(self) -> Self: ...
+ def __exit__(self, etype, evalue, etrace) -> None: ...
+ def __iter__(self) -> Generator[Page, None, None]: ...
+ def close(self) -> None: ...
+
+class DviFont:
+ texname: bytes
+ size: float
+ widths: list[int]
+ def __init__(
+ self, scale: float, tfm: Tfm, texname: bytes, vf: Vf | None
+ ) -> None: ...
+ def __eq__(self, other: object) -> bool: ...
+ def __ne__(self, other: object) -> bool: ...
+
+class Vf(Dvi):
+ def __init__(self, filename: str | os.PathLike) -> None: ...
+ def __getitem__(self, code: int) -> Page: ...
+
+class Tfm:
+ checksum: int
+ design_size: int
+ width: dict[int, int]
+ height: dict[int, int]
+ depth: dict[int, int]
+ def __init__(self, filename: str | os.PathLike) -> None: ...
+
+class PsFont(NamedTuple):
+ texname: bytes
+ psname: bytes
+ effects: dict[str, float]
+ encoding: None | bytes
+ filename: str
+
+class PsfontsMap:
+ def __new__(cls, filename: str | os.PathLike) -> Self: ...
+ def __getitem__(self, texname: bytes) -> PsFont: ...
+
+def find_tex_file(filename: str | os.PathLike) -> str: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/figure.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/figure.py
new file mode 100644
index 0000000000000000000000000000000000000000..08914172718989e02025312dc5ba86bad5559989
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/figure.py
@@ -0,0 +1,3726 @@
+"""
+`matplotlib.figure` implements the following classes:
+
+`Figure`
+ Top level `~matplotlib.artist.Artist`, which holds all plot elements.
+ Many methods are implemented in `FigureBase`.
+
+`SubFigure`
+ A logical figure inside a figure, usually added to a figure (or parent `SubFigure`)
+ with `Figure.add_subfigure` or `Figure.subfigures` methods.
+
+Figures are typically created using pyplot methods `~.pyplot.figure`,
+`~.pyplot.subplots`, and `~.pyplot.subplot_mosaic`.
+
+.. plot::
+ :include-source:
+
+ fig, ax = plt.subplots(figsize=(2, 2), facecolor='lightskyblue',
+ layout='constrained')
+ fig.suptitle('Figure')
+ ax.set_title('Axes', loc='left', fontstyle='oblique', fontsize='medium')
+
+Some situations call for directly instantiating a `~.figure.Figure` class,
+usually inside an application of some sort (see :ref:`user_interfaces` for a
+list of examples) . More information about Figures can be found at
+:ref:`figure-intro`.
+"""
+
+from contextlib import ExitStack
+import inspect
+import itertools
+import functools
+import logging
+from numbers import Integral
+import threading
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _blocking_input, backend_bases, _docstring, projections
+from matplotlib.artist import (
+ Artist, allow_rasterization, _finalize_rasterization)
+from matplotlib.backend_bases import (
+ DrawEvent, FigureCanvasBase, NonGuiException, MouseButton, _get_renderer)
+import matplotlib._api as _api
+import matplotlib.cbook as cbook
+import matplotlib.colorbar as cbar
+import matplotlib.image as mimage
+
+from matplotlib.axes import Axes
+from matplotlib.gridspec import GridSpec, SubplotParams
+from matplotlib.layout_engine import (
+ ConstrainedLayoutEngine, TightLayoutEngine, LayoutEngine,
+ PlaceHolderLayoutEngine
+)
+import matplotlib.legend as mlegend
+from matplotlib.patches import Rectangle
+from matplotlib.text import Text
+from matplotlib.transforms import (Affine2D, Bbox, BboxTransformTo,
+ TransformedBbox)
+
+_log = logging.getLogger(__name__)
+
+
+def _stale_figure_callback(self, val):
+ if (fig := self.get_figure(root=False)) is not None:
+ fig.stale = val
+
+
+class _AxesStack:
+ """
+ Helper class to track Axes in a figure.
+
+ Axes are tracked both in the order in which they have been added
+ (``self._axes`` insertion/iteration order) and in the separate "gca" stack
+ (which is the index to which they map in the ``self._axes`` dict).
+ """
+
+ def __init__(self):
+ self._axes = {} # Mapping of Axes to "gca" order.
+ self._counter = itertools.count()
+
+ def as_list(self):
+ """List the Axes that have been added to the figure."""
+ return [*self._axes] # This relies on dict preserving order.
+
+ def remove(self, a):
+ """Remove the Axes from the stack."""
+ self._axes.pop(a)
+
+ def bubble(self, a):
+ """Move an Axes, which must already exist in the stack, to the top."""
+ if a not in self._axes:
+ raise ValueError("Axes has not been added yet")
+ self._axes[a] = next(self._counter)
+
+ def add(self, a):
+ """Add an Axes to the stack, ignoring it if already present."""
+ if a not in self._axes:
+ self._axes[a] = next(self._counter)
+
+ def current(self):
+ """Return the active Axes, or None if the stack is empty."""
+ return max(self._axes, key=self._axes.__getitem__, default=None)
+
+ def __getstate__(self):
+ return {
+ **vars(self),
+ "_counter": max(self._axes.values(), default=0)
+ }
+
+ def __setstate__(self, state):
+ next_counter = state.pop('_counter')
+ vars(self).update(state)
+ self._counter = itertools.count(next_counter)
+
+
+class FigureBase(Artist):
+ """
+ Base class for `.Figure` and `.SubFigure` containing the methods that add
+ artists to the figure or subfigure, create Axes, etc.
+ """
+ def __init__(self, **kwargs):
+ super().__init__()
+ # remove the non-figure artist _axes property
+ # as it makes no sense for a figure to be _in_ an Axes
+ # this is used by the property methods in the artist base class
+ # which are over-ridden in this class
+ del self._axes
+
+ self._suptitle = None
+ self._supxlabel = None
+ self._supylabel = None
+
+ # groupers to keep track of x, y labels and title we want to align.
+ # see self.align_xlabels, self.align_ylabels,
+ # self.align_titles, and axis._get_tick_boxes_siblings
+ self._align_label_groups = {
+ "x": cbook.Grouper(),
+ "y": cbook.Grouper(),
+ "title": cbook.Grouper()
+ }
+
+ self._localaxes = [] # track all Axes
+ self.artists = []
+ self.lines = []
+ self.patches = []
+ self.texts = []
+ self.images = []
+ self.legends = []
+ self.subfigs = []
+ self.stale = True
+ self.suppressComposite = None
+ self.set(**kwargs)
+
+ def _get_draw_artists(self, renderer):
+ """Also runs apply_aspect"""
+ artists = self.get_children()
+
+ artists.remove(self.patch)
+ artists = sorted(
+ (artist for artist in artists if not artist.get_animated()),
+ key=lambda artist: artist.get_zorder())
+ for ax in self._localaxes:
+ locator = ax.get_axes_locator()
+ ax.apply_aspect(locator(ax, renderer) if locator else None)
+
+ for child in ax.get_children():
+ if hasattr(child, 'apply_aspect'):
+ locator = child.get_axes_locator()
+ child.apply_aspect(
+ locator(child, renderer) if locator else None)
+ return artists
+
+ def autofmt_xdate(
+ self, bottom=0.2, rotation=30, ha='right', which='major'):
+ """
+ Date ticklabels often overlap, so it is useful to rotate them
+ and right align them. Also, a common use case is a number of
+ subplots with shared x-axis where the x-axis is date data. The
+ ticklabels are often long, and it helps to rotate them on the
+ bottom subplot and turn them off on other subplots, as well as
+ turn off xlabels.
+
+ Parameters
+ ----------
+ bottom : float, default: 0.2
+ The bottom of the subplots for `subplots_adjust`.
+ rotation : float, default: 30 degrees
+ The rotation angle of the xtick labels in degrees.
+ ha : {'left', 'center', 'right'}, default: 'right'
+ The horizontal alignment of the xticklabels.
+ which : {'major', 'minor', 'both'}, default: 'major'
+ Selects which ticklabels to rotate.
+ """
+ _api.check_in_list(['major', 'minor', 'both'], which=which)
+ axes = [ax for ax in self.axes if ax._label != '']
+ allsubplots = all(ax.get_subplotspec() for ax in axes)
+ if len(axes) == 1:
+ for label in self.axes[0].get_xticklabels(which=which):
+ label.set_ha(ha)
+ label.set_rotation(rotation)
+ else:
+ if allsubplots:
+ for ax in axes:
+ if ax.get_subplotspec().is_last_row():
+ for label in ax.get_xticklabels(which=which):
+ label.set_ha(ha)
+ label.set_rotation(rotation)
+ else:
+ for label in ax.get_xticklabels(which=which):
+ label.set_visible(False)
+ ax.set_xlabel('')
+
+ engine = self.get_layout_engine()
+ if allsubplots and (engine is None or engine.adjust_compatible):
+ self.subplots_adjust(bottom=bottom)
+ self.stale = True
+
+ def get_children(self):
+ """Get a list of artists contained in the figure."""
+ return [self.patch,
+ *self.artists,
+ *self._localaxes,
+ *self.lines,
+ *self.patches,
+ *self.texts,
+ *self.images,
+ *self.legends,
+ *self.subfigs]
+
+ def get_figure(self, root=None):
+ """
+ Return the `.Figure` or `.SubFigure` instance the (Sub)Figure belongs to.
+
+ Parameters
+ ----------
+ root : bool, default=True
+ If False, return the (Sub)Figure this artist is on. If True,
+ return the root Figure for a nested tree of SubFigures.
+
+ .. deprecated:: 3.10
+
+ From version 3.12 *root* will default to False.
+ """
+ if self._root_figure is self:
+ # Top level Figure
+ return self
+
+ if self._parent is self._root_figure:
+ # Return early to prevent the deprecation warning when *root* does not
+ # matter
+ return self._parent
+
+ if root is None:
+ # When deprecation expires, consider removing the docstring and just
+ # inheriting the one from Artist.
+ message = ('From Matplotlib 3.12 SubFigure.get_figure will by default '
+ 'return the direct parent figure, which may be a SubFigure. '
+ 'To suppress this warning, pass the root parameter. Pass '
+ '`True` to maintain the old behavior and `False` to opt-in to '
+ 'the future behavior.')
+ _api.warn_deprecated('3.10', message=message)
+ root = True
+
+ if root:
+ return self._root_figure
+
+ return self._parent
+
+ def set_figure(self, fig):
+ """
+ .. deprecated:: 3.10
+ Currently this method will raise an exception if *fig* is anything other
+ than the root `.Figure` this (Sub)Figure is on. In future it will always
+ raise an exception.
+ """
+ no_switch = ("The parent and root figures of a (Sub)Figure are set at "
+ "instantiation and cannot be changed.")
+ if fig is self._root_figure:
+ _api.warn_deprecated(
+ "3.10",
+ message=(f"{no_switch} From Matplotlib 3.12 this operation will raise "
+ "an exception."))
+ return
+
+ raise ValueError(no_switch)
+
+ figure = property(functools.partial(get_figure, root=True), set_figure,
+ doc=("The root `Figure`. To get the parent of a `SubFigure`, "
+ "use the `get_figure` method."))
+
+ def contains(self, mouseevent):
+ """
+ Test whether the mouse event occurred on the figure.
+
+ Returns
+ -------
+ bool, {}
+ """
+ if self._different_canvas(mouseevent):
+ return False, {}
+ inside = self.bbox.contains(mouseevent.x, mouseevent.y)
+ return inside, {}
+
+ def get_window_extent(self, renderer=None):
+ # docstring inherited
+ return self.bbox
+
+ def _suplabels(self, t, info, **kwargs):
+ """
+ Add a centered %(name)s to the figure.
+
+ Parameters
+ ----------
+ t : str
+ The %(name)s text.
+ x : float, default: %(x0)s
+ The x location of the text in figure coordinates.
+ y : float, default: %(y0)s
+ The y location of the text in figure coordinates.
+ horizontalalignment, ha : {'center', 'left', 'right'}, default: %(ha)s
+ The horizontal alignment of the text relative to (*x*, *y*).
+ verticalalignment, va : {'top', 'center', 'bottom', 'baseline'}, \
+default: %(va)s
+ The vertical alignment of the text relative to (*x*, *y*).
+ fontsize, size : default: :rc:`figure.%(rc)ssize`
+ The font size of the text. See `.Text.set_size` for possible
+ values.
+ fontweight, weight : default: :rc:`figure.%(rc)sweight`
+ The font weight of the text. See `.Text.set_weight` for possible
+ values.
+
+ Returns
+ -------
+ text
+ The `.Text` instance of the %(name)s.
+
+ Other Parameters
+ ----------------
+ fontproperties : None or dict, optional
+ A dict of font properties. If *fontproperties* is given the
+ default values for font size and weight are taken from the
+ `.FontProperties` defaults. :rc:`figure.%(rc)ssize` and
+ :rc:`figure.%(rc)sweight` are ignored in this case.
+
+ **kwargs
+ Additional kwargs are `matplotlib.text.Text` properties.
+ """
+
+ x = kwargs.pop('x', None)
+ y = kwargs.pop('y', None)
+ if info['name'] in ['_supxlabel', '_suptitle']:
+ autopos = y is None
+ elif info['name'] == '_supylabel':
+ autopos = x is None
+ if x is None:
+ x = info['x0']
+ if y is None:
+ y = info['y0']
+
+ kwargs = cbook.normalize_kwargs(kwargs, Text)
+ kwargs.setdefault('horizontalalignment', info['ha'])
+ kwargs.setdefault('verticalalignment', info['va'])
+ kwargs.setdefault('rotation', info['rotation'])
+
+ if 'fontproperties' not in kwargs:
+ kwargs.setdefault('fontsize', mpl.rcParams[info['size']])
+ kwargs.setdefault('fontweight', mpl.rcParams[info['weight']])
+
+ suplab = getattr(self, info['name'])
+ if suplab is not None:
+ suplab.set_text(t)
+ suplab.set_position((x, y))
+ suplab.set(**kwargs)
+ else:
+ suplab = self.text(x, y, t, **kwargs)
+ setattr(self, info['name'], suplab)
+ suplab._autopos = autopos
+ self.stale = True
+ return suplab
+
+ @_docstring.Substitution(x0=0.5, y0=0.98, name='super title', ha='center',
+ va='top', rc='title')
+ @_docstring.copy(_suplabels)
+ def suptitle(self, t, **kwargs):
+ # docstring from _suplabels...
+ info = {'name': '_suptitle', 'x0': 0.5, 'y0': 0.98,
+ 'ha': 'center', 'va': 'top', 'rotation': 0,
+ 'size': 'figure.titlesize', 'weight': 'figure.titleweight'}
+ return self._suplabels(t, info, **kwargs)
+
+ def get_suptitle(self):
+ """Return the suptitle as string or an empty string if not set."""
+ text_obj = self._suptitle
+ return "" if text_obj is None else text_obj.get_text()
+
+ @_docstring.Substitution(x0=0.5, y0=0.01, name='super xlabel', ha='center',
+ va='bottom', rc='label')
+ @_docstring.copy(_suplabels)
+ def supxlabel(self, t, **kwargs):
+ # docstring from _suplabels...
+ info = {'name': '_supxlabel', 'x0': 0.5, 'y0': 0.01,
+ 'ha': 'center', 'va': 'bottom', 'rotation': 0,
+ 'size': 'figure.labelsize', 'weight': 'figure.labelweight'}
+ return self._suplabels(t, info, **kwargs)
+
+ def get_supxlabel(self):
+ """Return the supxlabel as string or an empty string if not set."""
+ text_obj = self._supxlabel
+ return "" if text_obj is None else text_obj.get_text()
+
+ @_docstring.Substitution(x0=0.02, y0=0.5, name='super ylabel', ha='left',
+ va='center', rc='label')
+ @_docstring.copy(_suplabels)
+ def supylabel(self, t, **kwargs):
+ # docstring from _suplabels...
+ info = {'name': '_supylabel', 'x0': 0.02, 'y0': 0.5,
+ 'ha': 'left', 'va': 'center', 'rotation': 'vertical',
+ 'rotation_mode': 'anchor', 'size': 'figure.labelsize',
+ 'weight': 'figure.labelweight'}
+ return self._suplabels(t, info, **kwargs)
+
+ def get_supylabel(self):
+ """Return the supylabel as string or an empty string if not set."""
+ text_obj = self._supylabel
+ return "" if text_obj is None else text_obj.get_text()
+
+ def get_edgecolor(self):
+ """Get the edge color of the Figure rectangle."""
+ return self.patch.get_edgecolor()
+
+ def get_facecolor(self):
+ """Get the face color of the Figure rectangle."""
+ return self.patch.get_facecolor()
+
+ def get_frameon(self):
+ """
+ Return the figure's background patch visibility, i.e.
+ whether the figure background will be drawn. Equivalent to
+ ``Figure.patch.get_visible()``.
+ """
+ return self.patch.get_visible()
+
+ def set_linewidth(self, linewidth):
+ """
+ Set the line width of the Figure rectangle.
+
+ Parameters
+ ----------
+ linewidth : number
+ """
+ self.patch.set_linewidth(linewidth)
+
+ def get_linewidth(self):
+ """
+ Get the line width of the Figure rectangle.
+ """
+ return self.patch.get_linewidth()
+
+ def set_edgecolor(self, color):
+ """
+ Set the edge color of the Figure rectangle.
+
+ Parameters
+ ----------
+ color : :mpltype:`color`
+ """
+ self.patch.set_edgecolor(color)
+
+ def set_facecolor(self, color):
+ """
+ Set the face color of the Figure rectangle.
+
+ Parameters
+ ----------
+ color : :mpltype:`color`
+ """
+ self.patch.set_facecolor(color)
+
+ def set_frameon(self, b):
+ """
+ Set the figure's background patch visibility, i.e.
+ whether the figure background will be drawn. Equivalent to
+ ``Figure.patch.set_visible()``.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ self.patch.set_visible(b)
+ self.stale = True
+
+ frameon = property(get_frameon, set_frameon)
+
+ def add_artist(self, artist, clip=False):
+ """
+ Add an `.Artist` to the figure.
+
+ Usually artists are added to `~.axes.Axes` objects using
+ `.Axes.add_artist`; this method can be used in the rare cases where
+ one needs to add artists directly to the figure instead.
+
+ Parameters
+ ----------
+ artist : `~matplotlib.artist.Artist`
+ The artist to add to the figure. If the added artist has no
+ transform previously set, its transform will be set to
+ ``figure.transSubfigure``.
+ clip : bool, default: False
+ Whether the added artist should be clipped by the figure patch.
+
+ Returns
+ -------
+ `~matplotlib.artist.Artist`
+ The added artist.
+ """
+ artist.set_figure(self)
+ self.artists.append(artist)
+ artist._remove_method = self.artists.remove
+
+ if not artist.is_transform_set():
+ artist.set_transform(self.transSubfigure)
+
+ if clip and artist.get_clip_path() is None:
+ artist.set_clip_path(self.patch)
+
+ self.stale = True
+ return artist
+
+ @_docstring.interpd
+ def add_axes(self, *args, **kwargs):
+ """
+ Add an `~.axes.Axes` to the figure.
+
+ Call signatures::
+
+ add_axes(rect, projection=None, polar=False, **kwargs)
+ add_axes(ax)
+
+ Parameters
+ ----------
+ rect : tuple (left, bottom, width, height)
+ The dimensions (left, bottom, width, height) of the new
+ `~.axes.Axes`. All quantities are in fractions of figure width and
+ height.
+
+ projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \
+'polar', 'rectilinear', str}, optional
+ The projection type of the `~.axes.Axes`. *str* is the name of
+ a custom projection, see `~matplotlib.projections`. The default
+ None results in a 'rectilinear' projection.
+
+ polar : bool, default: False
+ If True, equivalent to projection='polar'.
+
+ axes_class : subclass type of `~.axes.Axes`, optional
+ The `.axes.Axes` subclass that is instantiated. This parameter
+ is incompatible with *projection* and *polar*. See
+ :ref:`axisartist_users-guide-index` for examples.
+
+ sharex, sharey : `~matplotlib.axes.Axes`, optional
+ Share the x or y `~matplotlib.axis` with sharex and/or sharey.
+ The axis will have the same limits, ticks, and scale as the axis
+ of the shared Axes.
+
+ label : str
+ A label for the returned Axes.
+
+ Returns
+ -------
+ `~.axes.Axes`, or a subclass of `~.axes.Axes`
+ The returned Axes class depends on the projection used. It is
+ `~.axes.Axes` if rectilinear projection is used and
+ `.projections.polar.PolarAxes` if polar projection is used.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ This method also takes the keyword arguments for
+ the returned Axes class. The keyword arguments for the
+ rectilinear Axes class `~.axes.Axes` can be found in
+ the following table but there might also be other keyword
+ arguments if another projection is used, see the actual Axes
+ class.
+
+ %(Axes:kwdoc)s
+
+ Notes
+ -----
+ In rare circumstances, `.add_axes` may be called with a single
+ argument, an Axes instance already created in the present figure but
+ not in the figure's list of Axes.
+
+ See Also
+ --------
+ .Figure.add_subplot
+ .pyplot.subplot
+ .pyplot.axes
+ .Figure.subplots
+ .pyplot.subplots
+
+ Examples
+ --------
+ Some simple examples::
+
+ rect = l, b, w, h
+ fig = plt.figure()
+ fig.add_axes(rect)
+ fig.add_axes(rect, frameon=False, facecolor='g')
+ fig.add_axes(rect, polar=True)
+ ax = fig.add_axes(rect, projection='polar')
+ fig.delaxes(ax)
+ fig.add_axes(ax)
+ """
+
+ if not len(args) and 'rect' not in kwargs:
+ raise TypeError("add_axes() missing 1 required positional argument: 'rect'")
+ elif 'rect' in kwargs:
+ if len(args):
+ raise TypeError("add_axes() got multiple values for argument 'rect'")
+ args = (kwargs.pop('rect'), )
+ if len(args) != 1:
+ raise _api.nargs_error("add_axes", 1, len(args))
+
+ if isinstance(args[0], Axes):
+ a, = args
+ key = a._projection_init
+ if a.get_figure(root=False) is not self:
+ raise ValueError(
+ "The Axes must have been created in the present figure")
+ else:
+ rect, = args
+ if not np.isfinite(rect).all():
+ raise ValueError(f'all entries in rect must be finite not {rect}')
+ projection_class, pkw = self._process_projection_requirements(**kwargs)
+
+ # create the new Axes using the Axes class given
+ a = projection_class(self, rect, **pkw)
+ key = (projection_class, pkw)
+
+ return self._add_axes_internal(a, key)
+
+ @_docstring.interpd
+ def add_subplot(self, *args, **kwargs):
+ """
+ Add an `~.axes.Axes` to the figure as part of a subplot arrangement.
+
+ Call signatures::
+
+ add_subplot(nrows, ncols, index, **kwargs)
+ add_subplot(pos, **kwargs)
+ add_subplot(ax)
+ add_subplot()
+
+ Parameters
+ ----------
+ *args : int, (int, int, *index*), or `.SubplotSpec`, default: (1, 1, 1)
+ The position of the subplot described by one of
+
+ - Three integers (*nrows*, *ncols*, *index*). The subplot will
+ take the *index* position on a grid with *nrows* rows and
+ *ncols* columns. *index* starts at 1 in the upper left corner
+ and increases to the right. *index* can also be a two-tuple
+ specifying the (*first*, *last*) indices (1-based, and including
+ *last*) of the subplot, e.g., ``fig.add_subplot(3, 1, (1, 2))``
+ makes a subplot that spans the upper 2/3 of the figure.
+ - A 3-digit integer. The digits are interpreted as if given
+ separately as three single-digit integers, i.e.
+ ``fig.add_subplot(235)`` is the same as
+ ``fig.add_subplot(2, 3, 5)``. Note that this can only be used
+ if there are no more than 9 subplots.
+ - A `.SubplotSpec`.
+
+ In rare circumstances, `.add_subplot` may be called with a single
+ argument, a subplot Axes instance already created in the
+ present figure but not in the figure's list of Axes.
+
+ projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \
+'polar', 'rectilinear', str}, optional
+ The projection type of the subplot (`~.axes.Axes`). *str* is the
+ name of a custom projection, see `~matplotlib.projections`. The
+ default None results in a 'rectilinear' projection.
+
+ polar : bool, default: False
+ If True, equivalent to projection='polar'.
+
+ axes_class : subclass type of `~.axes.Axes`, optional
+ The `.axes.Axes` subclass that is instantiated. This parameter
+ is incompatible with *projection* and *polar*. See
+ :ref:`axisartist_users-guide-index` for examples.
+
+ sharex, sharey : `~matplotlib.axes.Axes`, optional
+ Share the x or y `~matplotlib.axis` with sharex and/or sharey.
+ The axis will have the same limits, ticks, and scale as the axis
+ of the shared Axes.
+
+ label : str
+ A label for the returned Axes.
+
+ Returns
+ -------
+ `~.axes.Axes`
+
+ The Axes of the subplot. The returned Axes can actually be an
+ instance of a subclass, such as `.projections.polar.PolarAxes` for
+ polar projections.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ This method also takes the keyword arguments for the returned Axes
+ base class; except for the *figure* argument. The keyword arguments
+ for the rectilinear base class `~.axes.Axes` can be found in
+ the following table but there might also be other keyword
+ arguments if another projection is used.
+
+ %(Axes:kwdoc)s
+
+ See Also
+ --------
+ .Figure.add_axes
+ .pyplot.subplot
+ .pyplot.axes
+ .Figure.subplots
+ .pyplot.subplots
+
+ Examples
+ --------
+ ::
+
+ fig = plt.figure()
+
+ fig.add_subplot(231)
+ ax1 = fig.add_subplot(2, 3, 1) # equivalent but more general
+
+ fig.add_subplot(232, frameon=False) # subplot with no frame
+ fig.add_subplot(233, projection='polar') # polar subplot
+ fig.add_subplot(234, sharex=ax1) # subplot sharing x-axis with ax1
+ fig.add_subplot(235, facecolor="red") # red subplot
+
+ ax1.remove() # delete ax1 from the figure
+ fig.add_subplot(ax1) # add ax1 back to the figure
+ """
+ if 'figure' in kwargs:
+ # Axes itself allows for a 'figure' kwarg, but since we want to
+ # bind the created Axes to self, it is not allowed here.
+ raise _api.kwarg_error("add_subplot", "figure")
+
+ if (len(args) == 1
+ and isinstance(args[0], mpl.axes._base._AxesBase)
+ and args[0].get_subplotspec()):
+ ax = args[0]
+ key = ax._projection_init
+ if ax.get_figure(root=False) is not self:
+ raise ValueError("The Axes must have been created in "
+ "the present figure")
+ else:
+ if not args:
+ args = (1, 1, 1)
+ # Normalize correct ijk values to (i, j, k) here so that
+ # add_subplot(211) == add_subplot(2, 1, 1). Invalid values will
+ # trigger errors later (via SubplotSpec._from_subplot_args).
+ if (len(args) == 1 and isinstance(args[0], Integral)
+ and 100 <= args[0] <= 999):
+ args = tuple(map(int, str(args[0])))
+ projection_class, pkw = self._process_projection_requirements(**kwargs)
+ ax = projection_class(self, *args, **pkw)
+ key = (projection_class, pkw)
+ return self._add_axes_internal(ax, key)
+
+ def _add_axes_internal(self, ax, key):
+ """Private helper for `add_axes` and `add_subplot`."""
+ self._axstack.add(ax)
+ if ax not in self._localaxes:
+ self._localaxes.append(ax)
+ self.sca(ax)
+ ax._remove_method = self.delaxes
+ # this is to support plt.subplot's re-selection logic
+ ax._projection_init = key
+ self.stale = True
+ ax.stale_callback = _stale_figure_callback
+ return ax
+
+ def subplots(self, nrows=1, ncols=1, *, sharex=False, sharey=False,
+ squeeze=True, width_ratios=None, height_ratios=None,
+ subplot_kw=None, gridspec_kw=None):
+ """
+ Add a set of subplots to this figure.
+
+ This utility wrapper makes it convenient to create common layouts of
+ subplots in a single call.
+
+ Parameters
+ ----------
+ nrows, ncols : int, default: 1
+ Number of rows/columns of the subplot grid.
+
+ sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
+ Controls sharing of x-axis (*sharex*) or y-axis (*sharey*):
+
+ - True or 'all': x- or y-axis will be shared among all subplots.
+ - False or 'none': each subplot x- or y-axis will be independent.
+ - 'row': each subplot row will share an x- or y-axis.
+ - 'col': each subplot column will share an x- or y-axis.
+
+ When subplots have a shared x-axis along a column, only the x tick
+ labels of the bottom subplot are created. Similarly, when subplots
+ have a shared y-axis along a row, only the y tick labels of the
+ first column subplot are created. To later turn other subplots'
+ ticklabels on, use `~matplotlib.axes.Axes.tick_params`.
+
+ When subplots have a shared axis that has units, calling
+ `.Axis.set_units` will update each axis with the new units.
+
+ Note that it is not possible to unshare axes.
+
+ squeeze : bool, default: True
+ - If True, extra dimensions are squeezed out from the returned
+ array of Axes:
+
+ - if only one subplot is constructed (nrows=ncols=1), the
+ resulting single Axes object is returned as a scalar.
+ - for Nx1 or 1xM subplots, the returned object is a 1D numpy
+ object array of Axes objects.
+ - for NxM, subplots with N>1 and M>1 are returned as a 2D array.
+
+ - If False, no squeezing at all is done: the returned Axes object
+ is always a 2D array containing Axes instances, even if it ends
+ up being 1x1.
+
+ width_ratios : array-like of length *ncols*, optional
+ Defines the relative widths of the columns. Each column gets a
+ relative width of ``width_ratios[i] / sum(width_ratios)``.
+ If not given, all columns will have the same width. Equivalent
+ to ``gridspec_kw={'width_ratios': [...]}``.
+
+ height_ratios : array-like of length *nrows*, optional
+ Defines the relative heights of the rows. Each row gets a
+ relative height of ``height_ratios[i] / sum(height_ratios)``.
+ If not given, all rows will have the same height. Equivalent
+ to ``gridspec_kw={'height_ratios': [...]}``.
+
+ subplot_kw : dict, optional
+ Dict with keywords passed to the `.Figure.add_subplot` call used to
+ create each subplot.
+
+ gridspec_kw : dict, optional
+ Dict with keywords passed to the
+ `~matplotlib.gridspec.GridSpec` constructor used to create
+ the grid the subplots are placed on.
+
+ Returns
+ -------
+ `~.axes.Axes` or array of Axes
+ Either a single `~matplotlib.axes.Axes` object or an array of Axes
+ objects if more than one subplot was created. The dimensions of the
+ resulting array can be controlled with the *squeeze* keyword, see
+ above.
+
+ See Also
+ --------
+ .pyplot.subplots
+ .Figure.add_subplot
+ .pyplot.subplot
+
+ Examples
+ --------
+ ::
+
+ # First create some toy data:
+ x = np.linspace(0, 2*np.pi, 400)
+ y = np.sin(x**2)
+
+ # Create a figure
+ fig = plt.figure()
+
+ # Create a subplot
+ ax = fig.subplots()
+ ax.plot(x, y)
+ ax.set_title('Simple plot')
+
+ # Create two subplots and unpack the output array immediately
+ ax1, ax2 = fig.subplots(1, 2, sharey=True)
+ ax1.plot(x, y)
+ ax1.set_title('Sharing Y axis')
+ ax2.scatter(x, y)
+
+ # Create four polar Axes and access them through the returned array
+ axes = fig.subplots(2, 2, subplot_kw=dict(projection='polar'))
+ axes[0, 0].plot(x, y)
+ axes[1, 1].scatter(x, y)
+
+ # Share an X-axis with each column of subplots
+ fig.subplots(2, 2, sharex='col')
+
+ # Share a Y-axis with each row of subplots
+ fig.subplots(2, 2, sharey='row')
+
+ # Share both X- and Y-axes with all subplots
+ fig.subplots(2, 2, sharex='all', sharey='all')
+
+ # Note that this is the same as
+ fig.subplots(2, 2, sharex=True, sharey=True)
+ """
+ gridspec_kw = dict(gridspec_kw or {})
+ if height_ratios is not None:
+ if 'height_ratios' in gridspec_kw:
+ raise ValueError("'height_ratios' must not be defined both as "
+ "parameter and as key in 'gridspec_kw'")
+ gridspec_kw['height_ratios'] = height_ratios
+ if width_ratios is not None:
+ if 'width_ratios' in gridspec_kw:
+ raise ValueError("'width_ratios' must not be defined both as "
+ "parameter and as key in 'gridspec_kw'")
+ gridspec_kw['width_ratios'] = width_ratios
+
+ gs = self.add_gridspec(nrows, ncols, figure=self, **gridspec_kw)
+ axs = gs.subplots(sharex=sharex, sharey=sharey, squeeze=squeeze,
+ subplot_kw=subplot_kw)
+ return axs
+
+ def delaxes(self, ax):
+ """
+ Remove the `~.axes.Axes` *ax* from the figure; update the current Axes.
+ """
+ self._remove_axes(ax, owners=[self._axstack, self._localaxes])
+
+ def _remove_axes(self, ax, owners):
+ """
+ Common helper for removal of standard Axes (via delaxes) and of child Axes.
+
+ Parameters
+ ----------
+ ax : `~.AxesBase`
+ The Axes to remove.
+ owners
+ List of objects (list or _AxesStack) "owning" the Axes, from which the Axes
+ will be remove()d.
+ """
+ for owner in owners:
+ owner.remove(ax)
+
+ self._axobservers.process("_axes_change_event", self)
+ self.stale = True
+ self._root_figure.canvas.release_mouse(ax)
+
+ for name in ax._axis_names: # Break link between any shared Axes
+ grouper = ax._shared_axes[name]
+ siblings = [other for other in grouper.get_siblings(ax) if other is not ax]
+ if not siblings: # Axes was not shared along this axis; we're done.
+ continue
+ grouper.remove(ax)
+ # Formatters and locators may previously have been associated with the now
+ # removed axis. Update them to point to an axis still there (we can pick
+ # any of them, and use the first sibling).
+ remaining_axis = siblings[0]._axis_map[name]
+ remaining_axis.get_major_formatter().set_axis(remaining_axis)
+ remaining_axis.get_major_locator().set_axis(remaining_axis)
+ remaining_axis.get_minor_formatter().set_axis(remaining_axis)
+ remaining_axis.get_minor_locator().set_axis(remaining_axis)
+
+ ax._twinned_axes.remove(ax) # Break link between any twinned Axes.
+
+ def clear(self, keep_observers=False):
+ """
+ Clear the figure.
+
+ Parameters
+ ----------
+ keep_observers : bool, default: False
+ Set *keep_observers* to True if, for example,
+ a gui widget is tracking the Axes in the figure.
+ """
+ self.suppressComposite = None
+
+ # first clear the Axes in any subfigures
+ for subfig in self.subfigs:
+ subfig.clear(keep_observers=keep_observers)
+ self.subfigs = []
+
+ for ax in tuple(self.axes): # Iterate over the copy.
+ ax.clear()
+ self.delaxes(ax) # Remove ax from self._axstack.
+
+ self.artists = []
+ self.lines = []
+ self.patches = []
+ self.texts = []
+ self.images = []
+ self.legends = []
+ if not keep_observers:
+ self._axobservers = cbook.CallbackRegistry()
+ self._suptitle = None
+ self._supxlabel = None
+ self._supylabel = None
+
+ self.stale = True
+
+ # synonym for `clear`.
+ def clf(self, keep_observers=False):
+ """
+ [*Discouraged*] Alias for the `clear()` method.
+
+ .. admonition:: Discouraged
+
+ The use of ``clf()`` is discouraged. Use ``clear()`` instead.
+
+ Parameters
+ ----------
+ keep_observers : bool, default: False
+ Set *keep_observers* to True if, for example,
+ a gui widget is tracking the Axes in the figure.
+ """
+ return self.clear(keep_observers=keep_observers)
+
+ # Note: the docstring below is modified with replace for the pyplot
+ # version of this function because the method name differs (plt.figlegend)
+ # the replacements are:
+ # " legend(" -> " figlegend(" for the signatures
+ # "fig.legend(" -> "plt.figlegend" for the code examples
+ # "ax.plot" -> "plt.plot" for consistency in using pyplot when able
+ @_docstring.interpd
+ def legend(self, *args, **kwargs):
+ """
+ Place a legend on the figure.
+
+ Call signatures::
+
+ legend()
+ legend(handles, labels)
+ legend(handles=handles)
+ legend(labels)
+
+ The call signatures correspond to the following different ways to use
+ this method:
+
+ **1. Automatic detection of elements to be shown in the legend**
+
+ The elements to be added to the legend are automatically determined,
+ when you do not pass in any extra arguments.
+
+ In this case, the labels are taken from the artist. You can specify
+ them either at artist creation or by calling the
+ :meth:`~.Artist.set_label` method on the artist::
+
+ ax.plot([1, 2, 3], label='Inline label')
+ fig.legend()
+
+ or::
+
+ line, = ax.plot([1, 2, 3])
+ line.set_label('Label via method')
+ fig.legend()
+
+ Specific lines can be excluded from the automatic legend element
+ selection by defining a label starting with an underscore.
+ This is default for all artists, so calling `.Figure.legend` without
+ any arguments and without setting the labels manually will result in
+ no legend being drawn.
+
+
+ **2. Explicitly listing the artists and labels in the legend**
+
+ For full control of which artists have a legend entry, it is possible
+ to pass an iterable of legend artists followed by an iterable of
+ legend labels respectively::
+
+ fig.legend([line1, line2, line3], ['label1', 'label2', 'label3'])
+
+
+ **3. Explicitly listing the artists in the legend**
+
+ This is similar to 2, but the labels are taken from the artists'
+ label properties. Example::
+
+ line1, = ax1.plot([1, 2, 3], label='label1')
+ line2, = ax2.plot([1, 2, 3], label='label2')
+ fig.legend(handles=[line1, line2])
+
+
+ **4. Labeling existing plot elements**
+
+ .. admonition:: Discouraged
+
+ This call signature is discouraged, because the relation between
+ plot elements and labels is only implicit by their order and can
+ easily be mixed up.
+
+ To make a legend for all artists on all Axes, call this function with
+ an iterable of strings, one for each legend item. For example::
+
+ fig, (ax1, ax2) = plt.subplots(1, 2)
+ ax1.plot([1, 3, 5], color='blue')
+ ax2.plot([2, 4, 6], color='red')
+ fig.legend(['the blues', 'the reds'])
+
+
+ Parameters
+ ----------
+ handles : list of `.Artist`, optional
+ A list of Artists (lines, patches) to be added to the legend.
+ Use this together with *labels*, if you need full control on what
+ is shown in the legend and the automatic mechanism described above
+ is not sufficient.
+
+ The length of handles and labels should be the same in this
+ case. If they are not, they are truncated to the smaller length.
+
+ labels : list of str, optional
+ A list of labels to show next to the artists.
+ Use this together with *handles*, if you need full control on what
+ is shown in the legend and the automatic mechanism described above
+ is not sufficient.
+
+ Returns
+ -------
+ `~matplotlib.legend.Legend`
+
+ Other Parameters
+ ----------------
+ %(_legend_kw_figure)s
+
+ See Also
+ --------
+ .Axes.legend
+
+ Notes
+ -----
+ Some artists are not supported by this function. See
+ :ref:`legend_guide` for details.
+ """
+
+ handles, labels, kwargs = mlegend._parse_legend_args(self.axes, *args, **kwargs)
+ # explicitly set the bbox transform if the user hasn't.
+ kwargs.setdefault("bbox_transform", self.transSubfigure)
+ l = mlegend.Legend(self, handles, labels, **kwargs)
+ self.legends.append(l)
+ l._remove_method = self.legends.remove
+ self.stale = True
+ return l
+
+ @_docstring.interpd
+ def text(self, x, y, s, fontdict=None, **kwargs):
+ """
+ Add text to figure.
+
+ Parameters
+ ----------
+ x, y : float
+ The position to place the text. By default, this is in figure
+ coordinates, floats in [0, 1]. The coordinate system can be changed
+ using the *transform* keyword.
+
+ s : str
+ The text string.
+
+ fontdict : dict, optional
+ A dictionary to override the default text properties. If not given,
+ the defaults are determined by :rc:`font.*`. Properties passed as
+ *kwargs* override the corresponding ones given in *fontdict*.
+
+ Returns
+ -------
+ `~.text.Text`
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.text.Text` properties
+ Other miscellaneous text parameters.
+
+ %(Text:kwdoc)s
+
+ See Also
+ --------
+ .Axes.text
+ .pyplot.text
+ """
+ effective_kwargs = {
+ 'transform': self.transSubfigure,
+ **(fontdict if fontdict is not None else {}),
+ **kwargs,
+ }
+ text = Text(x=x, y=y, text=s, **effective_kwargs)
+ text.set_figure(self)
+ text.stale_callback = _stale_figure_callback
+
+ self.texts.append(text)
+ text._remove_method = self.texts.remove
+ self.stale = True
+ return text
+
+ @_docstring.interpd
+ def colorbar(
+ self, mappable, cax=None, ax=None, use_gridspec=True, **kwargs):
+ """
+ Add a colorbar to a plot.
+
+ Parameters
+ ----------
+ mappable
+ The `matplotlib.cm.ScalarMappable` (i.e., `.AxesImage`,
+ `.ContourSet`, etc.) described by this colorbar. This argument is
+ mandatory for the `.Figure.colorbar` method but optional for the
+ `.pyplot.colorbar` function, which sets the default to the current
+ image.
+
+ Note that one can create a `.ScalarMappable` "on-the-fly" to
+ generate colorbars not attached to a previously drawn artist, e.g.
+ ::
+
+ fig.colorbar(cm.ScalarMappable(norm=norm, cmap=cmap), ax=ax)
+
+ cax : `~matplotlib.axes.Axes`, optional
+ Axes into which the colorbar will be drawn. If `None`, then a new
+ Axes is created and the space for it will be stolen from the Axes(s)
+ specified in *ax*.
+
+ ax : `~matplotlib.axes.Axes` or iterable or `numpy.ndarray` of Axes, optional
+ The one or more parent Axes from which space for a new colorbar Axes
+ will be stolen. This parameter is only used if *cax* is not set.
+
+ Defaults to the Axes that contains the mappable used to create the
+ colorbar.
+
+ use_gridspec : bool, optional
+ If *cax* is ``None``, a new *cax* is created as an instance of
+ Axes. If *ax* is positioned with a subplotspec and *use_gridspec*
+ is ``True``, then *cax* is also positioned with a subplotspec.
+
+ Returns
+ -------
+ colorbar : `~matplotlib.colorbar.Colorbar`
+
+ Other Parameters
+ ----------------
+ %(_make_axes_kw_doc)s
+ %(_colormap_kw_doc)s
+
+ Notes
+ -----
+ If *mappable* is a `~.contour.ContourSet`, its *extend* kwarg is
+ included automatically.
+
+ The *shrink* kwarg provides a simple way to scale the colorbar with
+ respect to the Axes. Note that if *cax* is specified, it determines the
+ size of the colorbar, and *shrink* and *aspect* are ignored.
+
+ For more precise control, you can manually specify the positions of the
+ axes objects in which the mappable and the colorbar are drawn. In this
+ case, do not use any of the Axes properties kwargs.
+
+ It is known that some vector graphics viewers (svg and pdf) render
+ white gaps between segments of the colorbar. This is due to bugs in
+ the viewers, not Matplotlib. As a workaround, the colorbar can be
+ rendered with overlapping segments::
+
+ cbar = colorbar()
+ cbar.solids.set_edgecolor("face")
+ draw()
+
+ However, this has negative consequences in other circumstances, e.g.
+ with semi-transparent images (alpha < 1) and colorbar extensions;
+ therefore, this workaround is not used by default (see issue #1188).
+
+ """
+
+ if ax is None:
+ ax = getattr(mappable, "axes", None)
+
+ if cax is None:
+ if ax is None:
+ raise ValueError(
+ 'Unable to determine Axes to steal space for Colorbar. '
+ 'Either provide the *cax* argument to use as the Axes for '
+ 'the Colorbar, provide the *ax* argument to steal space '
+ 'from it, or add *mappable* to an Axes.')
+ fig = ( # Figure of first Axes; logic copied from make_axes.
+ [*ax.flat] if isinstance(ax, np.ndarray)
+ else [*ax] if np.iterable(ax)
+ else [ax])[0].get_figure(root=False)
+ current_ax = fig.gca()
+ if (fig.get_layout_engine() is not None and
+ not fig.get_layout_engine().colorbar_gridspec):
+ use_gridspec = False
+ if (use_gridspec
+ and isinstance(ax, mpl.axes._base._AxesBase)
+ and ax.get_subplotspec()):
+ cax, kwargs = cbar.make_axes_gridspec(ax, **kwargs)
+ else:
+ cax, kwargs = cbar.make_axes(ax, **kwargs)
+ # make_axes calls add_{axes,subplot} which changes gca; undo that.
+ fig.sca(current_ax)
+ cax.grid(visible=False, which='both', axis='both')
+
+ if (hasattr(mappable, "get_figure") and
+ (mappable_host_fig := mappable.get_figure(root=True)) is not None):
+ # Warn in case of mismatch
+ if mappable_host_fig is not self._root_figure:
+ _api.warn_external(
+ f'Adding colorbar to a different Figure '
+ f'{repr(mappable_host_fig)} than '
+ f'{repr(self._root_figure)} which '
+ f'fig.colorbar is called on.')
+
+ NON_COLORBAR_KEYS = [ # remove kws that cannot be passed to Colorbar
+ 'fraction', 'pad', 'shrink', 'aspect', 'anchor', 'panchor']
+ cb = cbar.Colorbar(cax, mappable, **{
+ k: v for k, v in kwargs.items() if k not in NON_COLORBAR_KEYS})
+ cax.get_figure(root=False).stale = True
+ return cb
+
+ def subplots_adjust(self, left=None, bottom=None, right=None, top=None,
+ wspace=None, hspace=None):
+ """
+ Adjust the subplot layout parameters.
+
+ Unset parameters are left unmodified; initial values are given by
+ :rc:`figure.subplot.[name]`.
+
+ .. plot:: _embedded_plots/figure_subplots_adjust.py
+
+ Parameters
+ ----------
+ left : float, optional
+ The position of the left edge of the subplots,
+ as a fraction of the figure width.
+ right : float, optional
+ The position of the right edge of the subplots,
+ as a fraction of the figure width.
+ bottom : float, optional
+ The position of the bottom edge of the subplots,
+ as a fraction of the figure height.
+ top : float, optional
+ The position of the top edge of the subplots,
+ as a fraction of the figure height.
+ wspace : float, optional
+ The width of the padding between subplots,
+ as a fraction of the average Axes width.
+ hspace : float, optional
+ The height of the padding between subplots,
+ as a fraction of the average Axes height.
+ """
+ if (self.get_layout_engine() is not None and
+ not self.get_layout_engine().adjust_compatible):
+ _api.warn_external(
+ "This figure was using a layout engine that is "
+ "incompatible with subplots_adjust and/or tight_layout; "
+ "not calling subplots_adjust.")
+ return
+ self.subplotpars.update(left, bottom, right, top, wspace, hspace)
+ for ax in self.axes:
+ if ax.get_subplotspec() is not None:
+ ax._set_position(ax.get_subplotspec().get_position(self))
+ self.stale = True
+
+ def align_xlabels(self, axs=None):
+ """
+ Align the xlabels of subplots in the same subplot row if label
+ alignment is being done automatically (i.e. the label position is
+ not manually set).
+
+ Alignment persists for draw events after this is called.
+
+ If a label is on the bottom, it is aligned with labels on Axes that
+ also have their label on the bottom and that have the same
+ bottom-most subplot row. If the label is on the top,
+ it is aligned with labels on Axes with the same top-most row.
+
+ Parameters
+ ----------
+ axs : list of `~matplotlib.axes.Axes`
+ Optional list of (or `~numpy.ndarray`) `~matplotlib.axes.Axes`
+ to align the xlabels.
+ Default is to align all Axes on the figure.
+
+ See Also
+ --------
+ matplotlib.figure.Figure.align_ylabels
+ matplotlib.figure.Figure.align_titles
+ matplotlib.figure.Figure.align_labels
+
+ Notes
+ -----
+ This assumes that all Axes in ``axs`` are from the same `.GridSpec`,
+ so that their `.SubplotSpec` positions correspond to figure positions.
+
+ Examples
+ --------
+ Example with rotated xtick labels::
+
+ fig, axs = plt.subplots(1, 2)
+ for tick in axs[0].get_xticklabels():
+ tick.set_rotation(55)
+ axs[0].set_xlabel('XLabel 0')
+ axs[1].set_xlabel('XLabel 1')
+ fig.align_xlabels()
+ """
+ if axs is None:
+ axs = self.axes
+ axs = [ax for ax in np.ravel(axs) if ax.get_subplotspec() is not None]
+ for ax in axs:
+ _log.debug(' Working on: %s', ax.get_xlabel())
+ rowspan = ax.get_subplotspec().rowspan
+ pos = ax.xaxis.get_label_position() # top or bottom
+ # Search through other Axes for label positions that are same as
+ # this one and that share the appropriate row number.
+ # Add to a grouper associated with each Axes of siblings.
+ # This list is inspected in `axis.draw` by
+ # `axis._update_label_position`.
+ for axc in axs:
+ if axc.xaxis.get_label_position() == pos:
+ rowspanc = axc.get_subplotspec().rowspan
+ if (pos == 'top' and rowspan.start == rowspanc.start or
+ pos == 'bottom' and rowspan.stop == rowspanc.stop):
+ # grouper for groups of xlabels to align
+ self._align_label_groups['x'].join(ax, axc)
+
+ def align_ylabels(self, axs=None):
+ """
+ Align the ylabels of subplots in the same subplot column if label
+ alignment is being done automatically (i.e. the label position is
+ not manually set).
+
+ Alignment persists for draw events after this is called.
+
+ If a label is on the left, it is aligned with labels on Axes that
+ also have their label on the left and that have the same
+ left-most subplot column. If the label is on the right,
+ it is aligned with labels on Axes with the same right-most column.
+
+ Parameters
+ ----------
+ axs : list of `~matplotlib.axes.Axes`
+ Optional list (or `~numpy.ndarray`) of `~matplotlib.axes.Axes`
+ to align the ylabels.
+ Default is to align all Axes on the figure.
+
+ See Also
+ --------
+ matplotlib.figure.Figure.align_xlabels
+ matplotlib.figure.Figure.align_titles
+ matplotlib.figure.Figure.align_labels
+
+ Notes
+ -----
+ This assumes that all Axes in ``axs`` are from the same `.GridSpec`,
+ so that their `.SubplotSpec` positions correspond to figure positions.
+
+ Examples
+ --------
+ Example with large yticks labels::
+
+ fig, axs = plt.subplots(2, 1)
+ axs[0].plot(np.arange(0, 1000, 50))
+ axs[0].set_ylabel('YLabel 0')
+ axs[1].set_ylabel('YLabel 1')
+ fig.align_ylabels()
+ """
+ if axs is None:
+ axs = self.axes
+ axs = [ax for ax in np.ravel(axs) if ax.get_subplotspec() is not None]
+ for ax in axs:
+ _log.debug(' Working on: %s', ax.get_ylabel())
+ colspan = ax.get_subplotspec().colspan
+ pos = ax.yaxis.get_label_position() # left or right
+ # Search through other Axes for label positions that are same as
+ # this one and that share the appropriate column number.
+ # Add to a list associated with each Axes of siblings.
+ # This list is inspected in `axis.draw` by
+ # `axis._update_label_position`.
+ for axc in axs:
+ if axc.yaxis.get_label_position() == pos:
+ colspanc = axc.get_subplotspec().colspan
+ if (pos == 'left' and colspan.start == colspanc.start or
+ pos == 'right' and colspan.stop == colspanc.stop):
+ # grouper for groups of ylabels to align
+ self._align_label_groups['y'].join(ax, axc)
+
+ def align_titles(self, axs=None):
+ """
+ Align the titles of subplots in the same subplot row if title
+ alignment is being done automatically (i.e. the title position is
+ not manually set).
+
+ Alignment persists for draw events after this is called.
+
+ Parameters
+ ----------
+ axs : list of `~matplotlib.axes.Axes`
+ Optional list of (or ndarray) `~matplotlib.axes.Axes`
+ to align the titles.
+ Default is to align all Axes on the figure.
+
+ See Also
+ --------
+ matplotlib.figure.Figure.align_xlabels
+ matplotlib.figure.Figure.align_ylabels
+ matplotlib.figure.Figure.align_labels
+
+ Notes
+ -----
+ This assumes that all Axes in ``axs`` are from the same `.GridSpec`,
+ so that their `.SubplotSpec` positions correspond to figure positions.
+
+ Examples
+ --------
+ Example with titles::
+
+ fig, axs = plt.subplots(1, 2)
+ axs[0].set_aspect('equal')
+ axs[0].set_title('Title 0')
+ axs[1].set_title('Title 1')
+ fig.align_titles()
+ """
+ if axs is None:
+ axs = self.axes
+ axs = [ax for ax in np.ravel(axs) if ax.get_subplotspec() is not None]
+ for ax in axs:
+ _log.debug(' Working on: %s', ax.get_title())
+ rowspan = ax.get_subplotspec().rowspan
+ for axc in axs:
+ rowspanc = axc.get_subplotspec().rowspan
+ if (rowspan.start == rowspanc.start):
+ self._align_label_groups['title'].join(ax, axc)
+
+ def align_labels(self, axs=None):
+ """
+ Align the xlabels and ylabels of subplots with the same subplots
+ row or column (respectively) if label alignment is being
+ done automatically (i.e. the label position is not manually set).
+
+ Alignment persists for draw events after this is called.
+
+ Parameters
+ ----------
+ axs : list of `~matplotlib.axes.Axes`
+ Optional list (or `~numpy.ndarray`) of `~matplotlib.axes.Axes`
+ to align the labels.
+ Default is to align all Axes on the figure.
+
+ See Also
+ --------
+ matplotlib.figure.Figure.align_xlabels
+ matplotlib.figure.Figure.align_ylabels
+ matplotlib.figure.Figure.align_titles
+
+ Notes
+ -----
+ This assumes that all Axes in ``axs`` are from the same `.GridSpec`,
+ so that their `.SubplotSpec` positions correspond to figure positions.
+ """
+ self.align_xlabels(axs=axs)
+ self.align_ylabels(axs=axs)
+
+ def add_gridspec(self, nrows=1, ncols=1, **kwargs):
+ """
+ Low-level API for creating a `.GridSpec` that has this figure as a parent.
+
+ This is a low-level API, allowing you to create a gridspec and
+ subsequently add subplots based on the gridspec. Most users do
+ not need that freedom and should use the higher-level methods
+ `~.Figure.subplots` or `~.Figure.subplot_mosaic`.
+
+ Parameters
+ ----------
+ nrows : int, default: 1
+ Number of rows in grid.
+
+ ncols : int, default: 1
+ Number of columns in grid.
+
+ Returns
+ -------
+ `.GridSpec`
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Keyword arguments are passed to `.GridSpec`.
+
+ See Also
+ --------
+ matplotlib.pyplot.subplots
+
+ Examples
+ --------
+ Adding a subplot that spans two rows::
+
+ fig = plt.figure()
+ gs = fig.add_gridspec(2, 2)
+ ax1 = fig.add_subplot(gs[0, 0])
+ ax2 = fig.add_subplot(gs[1, 0])
+ # spans two rows:
+ ax3 = fig.add_subplot(gs[:, 1])
+
+ """
+
+ _ = kwargs.pop('figure', None) # pop in case user has added this...
+ gs = GridSpec(nrows=nrows, ncols=ncols, figure=self, **kwargs)
+ return gs
+
+ def subfigures(self, nrows=1, ncols=1, squeeze=True,
+ wspace=None, hspace=None,
+ width_ratios=None, height_ratios=None,
+ **kwargs):
+ """
+ Add a set of subfigures to this figure or subfigure.
+
+ A subfigure has the same artist methods as a figure, and is logically
+ the same as a figure, but cannot print itself.
+ See :doc:`/gallery/subplots_axes_and_figures/subfigures`.
+
+ .. versionchanged:: 3.10
+ subfigures are now added in row-major order.
+
+ Parameters
+ ----------
+ nrows, ncols : int, default: 1
+ Number of rows/columns of the subfigure grid.
+
+ squeeze : bool, default: True
+ If True, extra dimensions are squeezed out from the returned
+ array of subfigures.
+
+ wspace, hspace : float, default: None
+ The amount of width/height reserved for space between subfigures,
+ expressed as a fraction of the average subfigure width/height.
+ If not given, the values will be inferred from rcParams if using
+ constrained layout (see `~.ConstrainedLayoutEngine`), or zero if
+ not using a layout engine.
+
+ width_ratios : array-like of length *ncols*, optional
+ Defines the relative widths of the columns. Each column gets a
+ relative width of ``width_ratios[i] / sum(width_ratios)``.
+ If not given, all columns will have the same width.
+
+ height_ratios : array-like of length *nrows*, optional
+ Defines the relative heights of the rows. Each row gets a
+ relative height of ``height_ratios[i] / sum(height_ratios)``.
+ If not given, all rows will have the same height.
+ """
+ gs = GridSpec(nrows=nrows, ncols=ncols, figure=self,
+ wspace=wspace, hspace=hspace,
+ width_ratios=width_ratios,
+ height_ratios=height_ratios,
+ left=0, right=1, bottom=0, top=1)
+
+ sfarr = np.empty((nrows, ncols), dtype=object)
+ for i in range(nrows):
+ for j in range(ncols):
+ sfarr[i, j] = self.add_subfigure(gs[i, j], **kwargs)
+
+ if self.get_layout_engine() is None and (wspace is not None or
+ hspace is not None):
+ # Gridspec wspace and hspace is ignored on subfigure instantiation,
+ # and no space is left. So need to account for it here if required.
+ bottoms, tops, lefts, rights = gs.get_grid_positions(self)
+ for sfrow, bottom, top in zip(sfarr, bottoms, tops):
+ for sf, left, right in zip(sfrow, lefts, rights):
+ bbox = Bbox.from_extents(left, bottom, right, top)
+ sf._redo_transform_rel_fig(bbox=bbox)
+
+ if squeeze:
+ # Discarding unneeded dimensions that equal 1. If we only have one
+ # subfigure, just return it instead of a 1-element array.
+ return sfarr.item() if sfarr.size == 1 else sfarr.squeeze()
+ else:
+ # Returned axis array will be always 2-d, even if nrows=ncols=1.
+ return sfarr
+
+ def add_subfigure(self, subplotspec, **kwargs):
+ """
+ Add a `.SubFigure` to the figure as part of a subplot arrangement.
+
+ Parameters
+ ----------
+ subplotspec : `.gridspec.SubplotSpec`
+ Defines the region in a parent gridspec where the subfigure will
+ be placed.
+
+ Returns
+ -------
+ `.SubFigure`
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Are passed to the `.SubFigure` object.
+
+ See Also
+ --------
+ .Figure.subfigures
+ """
+ sf = SubFigure(self, subplotspec, **kwargs)
+ self.subfigs += [sf]
+ sf._remove_method = self.subfigs.remove
+ sf.stale_callback = _stale_figure_callback
+ self.stale = True
+ return sf
+
+ def sca(self, a):
+ """Set the current Axes to be *a* and return *a*."""
+ self._axstack.bubble(a)
+ self._axobservers.process("_axes_change_event", self)
+ return a
+
+ def gca(self):
+ """
+ Get the current Axes.
+
+ If there is currently no Axes on this Figure, a new one is created
+ using `.Figure.add_subplot`. (To test whether there is currently an
+ Axes on a Figure, check whether ``figure.axes`` is empty. To test
+ whether there is currently a Figure on the pyplot figure stack, check
+ whether `.pyplot.get_fignums()` is empty.)
+ """
+ ax = self._axstack.current()
+ return ax if ax is not None else self.add_subplot()
+
+ def _gci(self):
+ # Helper for `~matplotlib.pyplot.gci`. Do not use elsewhere.
+ """
+ Get the current colorable artist.
+
+ Specifically, returns the current `.ScalarMappable` instance (`.Image`
+ created by `imshow` or `figimage`, `.Collection` created by `pcolor` or
+ `scatter`, etc.), or *None* if no such instance has been defined.
+
+ The current image is an attribute of the current Axes, or the nearest
+ earlier Axes in the current figure that contains an image.
+
+ Notes
+ -----
+ Historically, the only colorable artists were images; hence the name
+ ``gci`` (get current image).
+ """
+ # Look first for an image in the current Axes.
+ ax = self._axstack.current()
+ if ax is None:
+ return None
+ im = ax._gci()
+ if im is not None:
+ return im
+ # If there is no image in the current Axes, search for
+ # one in a previously created Axes. Whether this makes
+ # sense is debatable, but it is the documented behavior.
+ for ax in reversed(self.axes):
+ im = ax._gci()
+ if im is not None:
+ return im
+ return None
+
+ def _process_projection_requirements(self, *, axes_class=None, polar=False,
+ projection=None, **kwargs):
+ """
+ Handle the args/kwargs to add_axes/add_subplot/gca, returning::
+
+ (axes_proj_class, proj_class_kwargs)
+
+ which can be used for new Axes initialization/identification.
+ """
+ if axes_class is not None:
+ if polar or projection is not None:
+ raise ValueError(
+ "Cannot combine 'axes_class' and 'projection' or 'polar'")
+ projection_class = axes_class
+ else:
+
+ if polar:
+ if projection is not None and projection != 'polar':
+ raise ValueError(
+ f"polar={polar}, yet projection={projection!r}. "
+ "Only one of these arguments should be supplied."
+ )
+ projection = 'polar'
+
+ if isinstance(projection, str) or projection is None:
+ projection_class = projections.get_projection_class(projection)
+ elif hasattr(projection, '_as_mpl_axes'):
+ projection_class, extra_kwargs = projection._as_mpl_axes()
+ kwargs.update(**extra_kwargs)
+ else:
+ raise TypeError(
+ f"projection must be a string, None or implement a "
+ f"_as_mpl_axes method, not {projection!r}")
+ return projection_class, kwargs
+
+ def get_default_bbox_extra_artists(self):
+ """
+ Return a list of Artists typically used in `.Figure.get_tightbbox`.
+ """
+ bbox_artists = [artist for artist in self.get_children()
+ if (artist.get_visible() and artist.get_in_layout())]
+ for ax in self.axes:
+ if ax.get_visible():
+ bbox_artists.extend(ax.get_default_bbox_extra_artists())
+ return bbox_artists
+
+ def get_tightbbox(self, renderer=None, *, bbox_extra_artists=None):
+ """
+ Return a (tight) bounding box of the figure *in inches*.
+
+ Note that `.FigureBase` differs from all other artists, which return
+ their `.Bbox` in pixels.
+
+ Artists that have ``artist.set_in_layout(False)`` are not included
+ in the bbox.
+
+ Parameters
+ ----------
+ renderer : `.RendererBase` subclass
+ Renderer that will be used to draw the figures (i.e.
+ ``fig.canvas.get_renderer()``)
+
+ bbox_extra_artists : list of `.Artist` or ``None``
+ List of artists to include in the tight bounding box. If
+ ``None`` (default), then all artist children of each Axes are
+ included in the tight bounding box.
+
+ Returns
+ -------
+ `.BboxBase`
+ containing the bounding box (in figure inches).
+ """
+
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+
+ bb = []
+ if bbox_extra_artists is None:
+ artists = [artist for artist in self.get_children()
+ if (artist not in self.axes and artist.get_visible()
+ and artist.get_in_layout())]
+ else:
+ artists = bbox_extra_artists
+
+ for a in artists:
+ bbox = a.get_tightbbox(renderer)
+ if bbox is not None:
+ bb.append(bbox)
+
+ for ax in self.axes:
+ if ax.get_visible():
+ # some Axes don't take the bbox_extra_artists kwarg so we
+ # need this conditional....
+ try:
+ bbox = ax.get_tightbbox(
+ renderer, bbox_extra_artists=bbox_extra_artists)
+ except TypeError:
+ bbox = ax.get_tightbbox(renderer)
+ bb.append(bbox)
+ bb = [b for b in bb
+ if (np.isfinite(b.width) and np.isfinite(b.height)
+ and (b.width != 0 or b.height != 0))]
+
+ isfigure = hasattr(self, 'bbox_inches')
+ if len(bb) == 0:
+ if isfigure:
+ return self.bbox_inches
+ else:
+ # subfigures do not have bbox_inches, but do have a bbox
+ bb = [self.bbox]
+
+ _bbox = Bbox.union(bb)
+
+ if isfigure:
+ # transform from pixels to inches...
+ _bbox = TransformedBbox(_bbox, self.dpi_scale_trans.inverted())
+
+ return _bbox
+
+ @staticmethod
+ def _norm_per_subplot_kw(per_subplot_kw):
+ expanded = {}
+ for k, v in per_subplot_kw.items():
+ if isinstance(k, tuple):
+ for sub_key in k:
+ if sub_key in expanded:
+ raise ValueError(f'The key {sub_key!r} appears multiple times.')
+ expanded[sub_key] = v
+ else:
+ if k in expanded:
+ raise ValueError(f'The key {k!r} appears multiple times.')
+ expanded[k] = v
+ return expanded
+
+ @staticmethod
+ def _normalize_grid_string(layout):
+ if '\n' not in layout:
+ # single-line string
+ return [list(ln) for ln in layout.split(';')]
+ else:
+ # multi-line string
+ layout = inspect.cleandoc(layout)
+ return [list(ln) for ln in layout.strip('\n').split('\n')]
+
+ def subplot_mosaic(self, mosaic, *, sharex=False, sharey=False,
+ width_ratios=None, height_ratios=None,
+ empty_sentinel='.',
+ subplot_kw=None, per_subplot_kw=None, gridspec_kw=None):
+ """
+ Build a layout of Axes based on ASCII art or nested lists.
+
+ This is a helper function to build complex GridSpec layouts visually.
+
+ See :ref:`mosaic`
+ for an example and full API documentation
+
+ Parameters
+ ----------
+ mosaic : list of list of {hashable or nested} or str
+
+ A visual layout of how you want your Axes to be arranged
+ labeled as strings. For example ::
+
+ x = [['A panel', 'A panel', 'edge'],
+ ['C panel', '.', 'edge']]
+
+ produces 4 Axes:
+
+ - 'A panel' which is 1 row high and spans the first two columns
+ - 'edge' which is 2 rows high and is on the right edge
+ - 'C panel' which in 1 row and 1 column wide in the bottom left
+ - a blank space 1 row and 1 column wide in the bottom center
+
+ Any of the entries in the layout can be a list of lists
+ of the same form to create nested layouts.
+
+ If input is a str, then it can either be a multi-line string of
+ the form ::
+
+ '''
+ AAE
+ C.E
+ '''
+
+ where each character is a column and each line is a row. Or it
+ can be a single-line string where rows are separated by ``;``::
+
+ 'AB;CC'
+
+ The string notation allows only single character Axes labels and
+ does not support nesting but is very terse.
+
+ The Axes identifiers may be `str` or a non-iterable hashable
+ object (e.g. `tuple` s may not be used).
+
+ sharex, sharey : bool, default: False
+ If True, the x-axis (*sharex*) or y-axis (*sharey*) will be shared
+ among all subplots. In that case, tick label visibility and axis
+ units behave as for `subplots`. If False, each subplot's x- or
+ y-axis will be independent.
+
+ width_ratios : array-like of length *ncols*, optional
+ Defines the relative widths of the columns. Each column gets a
+ relative width of ``width_ratios[i] / sum(width_ratios)``.
+ If not given, all columns will have the same width. Equivalent
+ to ``gridspec_kw={'width_ratios': [...]}``. In the case of nested
+ layouts, this argument applies only to the outer layout.
+
+ height_ratios : array-like of length *nrows*, optional
+ Defines the relative heights of the rows. Each row gets a
+ relative height of ``height_ratios[i] / sum(height_ratios)``.
+ If not given, all rows will have the same height. Equivalent
+ to ``gridspec_kw={'height_ratios': [...]}``. In the case of nested
+ layouts, this argument applies only to the outer layout.
+
+ subplot_kw : dict, optional
+ Dictionary with keywords passed to the `.Figure.add_subplot` call
+ used to create each subplot. These values may be overridden by
+ values in *per_subplot_kw*.
+
+ per_subplot_kw : dict, optional
+ A dictionary mapping the Axes identifiers or tuples of identifiers
+ to a dictionary of keyword arguments to be passed to the
+ `.Figure.add_subplot` call used to create each subplot. The values
+ in these dictionaries have precedence over the values in
+ *subplot_kw*.
+
+ If *mosaic* is a string, and thus all keys are single characters,
+ it is possible to use a single string instead of a tuple as keys;
+ i.e. ``"AB"`` is equivalent to ``("A", "B")``.
+
+ .. versionadded:: 3.7
+
+ gridspec_kw : dict, optional
+ Dictionary with keywords passed to the `.GridSpec` constructor used
+ to create the grid the subplots are placed on. In the case of
+ nested layouts, this argument applies only to the outer layout.
+ For more complex layouts, users should use `.Figure.subfigures`
+ to create the nesting.
+
+ empty_sentinel : object, optional
+ Entry in the layout to mean "leave this space empty". Defaults
+ to ``'.'``. Note, if *layout* is a string, it is processed via
+ `inspect.cleandoc` to remove leading white space, which may
+ interfere with using white-space as the empty sentinel.
+
+ Returns
+ -------
+ dict[label, Axes]
+ A dictionary mapping the labels to the Axes objects. The order of
+ the Axes is left-to-right and top-to-bottom of their position in the
+ total layout.
+
+ """
+ subplot_kw = subplot_kw or {}
+ gridspec_kw = dict(gridspec_kw or {})
+ per_subplot_kw = per_subplot_kw or {}
+
+ if height_ratios is not None:
+ if 'height_ratios' in gridspec_kw:
+ raise ValueError("'height_ratios' must not be defined both as "
+ "parameter and as key in 'gridspec_kw'")
+ gridspec_kw['height_ratios'] = height_ratios
+ if width_ratios is not None:
+ if 'width_ratios' in gridspec_kw:
+ raise ValueError("'width_ratios' must not be defined both as "
+ "parameter and as key in 'gridspec_kw'")
+ gridspec_kw['width_ratios'] = width_ratios
+
+ # special-case string input
+ if isinstance(mosaic, str):
+ mosaic = self._normalize_grid_string(mosaic)
+ per_subplot_kw = {
+ tuple(k): v for k, v in per_subplot_kw.items()
+ }
+
+ per_subplot_kw = self._norm_per_subplot_kw(per_subplot_kw)
+
+ # Only accept strict bools to allow a possible future API expansion.
+ _api.check_isinstance(bool, sharex=sharex, sharey=sharey)
+
+ def _make_array(inp):
+ """
+ Convert input into 2D array
+
+ We need to have this internal function rather than
+ ``np.asarray(..., dtype=object)`` so that a list of lists
+ of lists does not get converted to an array of dimension > 2.
+
+ Returns
+ -------
+ 2D object array
+ """
+ r0, *rest = inp
+ if isinstance(r0, str):
+ raise ValueError('List mosaic specification must be 2D')
+ for j, r in enumerate(rest, start=1):
+ if isinstance(r, str):
+ raise ValueError('List mosaic specification must be 2D')
+ if len(r0) != len(r):
+ raise ValueError(
+ "All of the rows must be the same length, however "
+ f"the first row ({r0!r}) has length {len(r0)} "
+ f"and row {j} ({r!r}) has length {len(r)}."
+ )
+ out = np.zeros((len(inp), len(r0)), dtype=object)
+ for j, r in enumerate(inp):
+ for k, v in enumerate(r):
+ out[j, k] = v
+ return out
+
+ def _identify_keys_and_nested(mosaic):
+ """
+ Given a 2D object array, identify unique IDs and nested mosaics
+
+ Parameters
+ ----------
+ mosaic : 2D object array
+
+ Returns
+ -------
+ unique_ids : tuple
+ The unique non-sub mosaic entries in this mosaic
+ nested : dict[tuple[int, int], 2D object array]
+ """
+ # make sure we preserve the user supplied order
+ unique_ids = cbook._OrderedSet()
+ nested = {}
+ for j, row in enumerate(mosaic):
+ for k, v in enumerate(row):
+ if v == empty_sentinel:
+ continue
+ elif not cbook.is_scalar_or_string(v):
+ nested[(j, k)] = _make_array(v)
+ else:
+ unique_ids.add(v)
+
+ return tuple(unique_ids), nested
+
+ def _do_layout(gs, mosaic, unique_ids, nested):
+ """
+ Recursively do the mosaic.
+
+ Parameters
+ ----------
+ gs : GridSpec
+ mosaic : 2D object array
+ The input converted to a 2D array for this level.
+ unique_ids : tuple
+ The identified scalar labels at this level of nesting.
+ nested : dict[tuple[int, int]], 2D object array
+ The identified nested mosaics, if any.
+
+ Returns
+ -------
+ dict[label, Axes]
+ A flat dict of all of the Axes created.
+ """
+ output = dict()
+
+ # we need to merge together the Axes at this level and the Axes
+ # in the (recursively) nested sub-mosaics so that we can add
+ # them to the figure in the "natural" order if you were to
+ # ravel in c-order all of the Axes that will be created
+ #
+ # This will stash the upper left index of each object (axes or
+ # nested mosaic) at this level
+ this_level = dict()
+
+ # go through the unique keys,
+ for name in unique_ids:
+ # sort out where each axes starts/ends
+ indx = np.argwhere(mosaic == name)
+ start_row, start_col = np.min(indx, axis=0)
+ end_row, end_col = np.max(indx, axis=0) + 1
+ # and construct the slice object
+ slc = (slice(start_row, end_row), slice(start_col, end_col))
+ # some light error checking
+ if (mosaic[slc] != name).any():
+ raise ValueError(
+ f"While trying to layout\n{mosaic!r}\n"
+ f"we found that the label {name!r} specifies a "
+ "non-rectangular or non-contiguous area.")
+ # and stash this slice for later
+ this_level[(start_row, start_col)] = (name, slc, 'axes')
+
+ # do the same thing for the nested mosaics (simpler because these
+ # cannot be spans yet!)
+ for (j, k), nested_mosaic in nested.items():
+ this_level[(j, k)] = (None, nested_mosaic, 'nested')
+
+ # now go through the things in this level and add them
+ # in order left-to-right top-to-bottom
+ for key in sorted(this_level):
+ name, arg, method = this_level[key]
+ # we are doing some hokey function dispatch here based
+ # on the 'method' string stashed above to sort out if this
+ # element is an Axes or a nested mosaic.
+ if method == 'axes':
+ slc = arg
+ # add a single Axes
+ if name in output:
+ raise ValueError(f"There are duplicate keys {name} "
+ f"in the layout\n{mosaic!r}")
+ ax = self.add_subplot(
+ gs[slc], **{
+ 'label': str(name),
+ **subplot_kw,
+ **per_subplot_kw.get(name, {})
+ }
+ )
+ output[name] = ax
+ elif method == 'nested':
+ nested_mosaic = arg
+ j, k = key
+ # recursively add the nested mosaic
+ rows, cols = nested_mosaic.shape
+ nested_output = _do_layout(
+ gs[j, k].subgridspec(rows, cols),
+ nested_mosaic,
+ *_identify_keys_and_nested(nested_mosaic)
+ )
+ overlap = set(output) & set(nested_output)
+ if overlap:
+ raise ValueError(
+ f"There are duplicate keys {overlap} "
+ f"between the outer layout\n{mosaic!r}\n"
+ f"and the nested layout\n{nested_mosaic}"
+ )
+ output.update(nested_output)
+ else:
+ raise RuntimeError("This should never happen")
+ return output
+
+ mosaic = _make_array(mosaic)
+ rows, cols = mosaic.shape
+ gs = self.add_gridspec(rows, cols, **gridspec_kw)
+ ret = _do_layout(gs, mosaic, *_identify_keys_and_nested(mosaic))
+ ax0 = next(iter(ret.values()))
+ for ax in ret.values():
+ if sharex:
+ ax.sharex(ax0)
+ ax._label_outer_xaxis(skip_non_rectangular_axes=True)
+ if sharey:
+ ax.sharey(ax0)
+ ax._label_outer_yaxis(skip_non_rectangular_axes=True)
+ if extra := set(per_subplot_kw) - set(ret):
+ raise ValueError(
+ f"The keys {extra} are in *per_subplot_kw* "
+ "but not in the mosaic."
+ )
+ return ret
+
+ def _set_artist_props(self, a):
+ if a != self:
+ a.set_figure(self)
+ a.stale_callback = _stale_figure_callback
+ a.set_transform(self.transSubfigure)
+
+
+@_docstring.interpd
+class SubFigure(FigureBase):
+ """
+ Logical figure that can be placed inside a figure.
+
+ See :ref:`figure-api-subfigure` for an index of methods on this class.
+ Typically instantiated using `.Figure.add_subfigure` or
+ `.SubFigure.add_subfigure`, or `.SubFigure.subfigures`. A subfigure has
+ the same methods as a figure except for those particularly tied to the size
+ or dpi of the figure, and is confined to a prescribed region of the figure.
+ For example the following puts two subfigures side-by-side::
+
+ fig = plt.figure()
+ sfigs = fig.subfigures(1, 2)
+ axsL = sfigs[0].subplots(1, 2)
+ axsR = sfigs[1].subplots(2, 1)
+
+ See :doc:`/gallery/subplots_axes_and_figures/subfigures`
+ """
+
+ def __init__(self, parent, subplotspec, *,
+ facecolor=None,
+ edgecolor=None,
+ linewidth=0.0,
+ frameon=None,
+ **kwargs):
+ """
+ Parameters
+ ----------
+ parent : `.Figure` or `.SubFigure`
+ Figure or subfigure that contains the SubFigure. SubFigures
+ can be nested.
+
+ subplotspec : `.gridspec.SubplotSpec`
+ Defines the region in a parent gridspec where the subfigure will
+ be placed.
+
+ facecolor : default: ``"none"``
+ The figure patch face color; transparent by default.
+
+ edgecolor : default: :rc:`figure.edgecolor`
+ The figure patch edge color.
+
+ linewidth : float
+ The linewidth of the frame (i.e. the edge linewidth of the figure
+ patch).
+
+ frameon : bool, default: :rc:`figure.frameon`
+ If ``False``, suppress drawing the figure background patch.
+
+ Other Parameters
+ ----------------
+ **kwargs : `.SubFigure` properties, optional
+
+ %(SubFigure:kwdoc)s
+ """
+ super().__init__(**kwargs)
+ if facecolor is None:
+ facecolor = "none"
+ if edgecolor is None:
+ edgecolor = mpl.rcParams['figure.edgecolor']
+ if frameon is None:
+ frameon = mpl.rcParams['figure.frameon']
+
+ self._subplotspec = subplotspec
+ self._parent = parent
+ self._root_figure = parent._root_figure
+
+ # subfigures use the parent axstack
+ self._axstack = parent._axstack
+ self.subplotpars = parent.subplotpars
+ self.dpi_scale_trans = parent.dpi_scale_trans
+ self._axobservers = parent._axobservers
+ self.transFigure = parent.transFigure
+ self.bbox_relative = Bbox.null()
+ self._redo_transform_rel_fig()
+ self.figbbox = self._parent.figbbox
+ self.bbox = TransformedBbox(self.bbox_relative,
+ self._parent.transSubfigure)
+ self.transSubfigure = BboxTransformTo(self.bbox)
+
+ self.patch = Rectangle(
+ xy=(0, 0), width=1, height=1, visible=frameon,
+ facecolor=facecolor, edgecolor=edgecolor, linewidth=linewidth,
+ # Don't let the figure patch influence bbox calculation.
+ in_layout=False, transform=self.transSubfigure)
+ self._set_artist_props(self.patch)
+ self.patch.set_antialiased(False)
+
+ @property
+ def canvas(self):
+ return self._parent.canvas
+
+ @property
+ def dpi(self):
+ return self._parent.dpi
+
+ @dpi.setter
+ def dpi(self, value):
+ self._parent.dpi = value
+
+ def get_dpi(self):
+ """
+ Return the resolution of the parent figure in dots-per-inch as a float.
+ """
+ return self._parent.dpi
+
+ def set_dpi(self, val):
+ """
+ Set the resolution of parent figure in dots-per-inch.
+
+ Parameters
+ ----------
+ val : float
+ """
+ self._parent.dpi = val
+ self.stale = True
+
+ def _get_renderer(self):
+ return self._parent._get_renderer()
+
+ def _redo_transform_rel_fig(self, bbox=None):
+ """
+ Make the transSubfigure bbox relative to Figure transform.
+
+ Parameters
+ ----------
+ bbox : bbox or None
+ If not None, then the bbox is used for relative bounding box.
+ Otherwise, it is calculated from the subplotspec.
+ """
+ if bbox is not None:
+ self.bbox_relative.p0 = bbox.p0
+ self.bbox_relative.p1 = bbox.p1
+ return
+ # need to figure out *where* this subplotspec is.
+ gs = self._subplotspec.get_gridspec()
+ wr = np.asarray(gs.get_width_ratios())
+ hr = np.asarray(gs.get_height_ratios())
+ dx = wr[self._subplotspec.colspan].sum() / wr.sum()
+ dy = hr[self._subplotspec.rowspan].sum() / hr.sum()
+ x0 = wr[:self._subplotspec.colspan.start].sum() / wr.sum()
+ y0 = 1 - hr[:self._subplotspec.rowspan.stop].sum() / hr.sum()
+ self.bbox_relative.p0 = (x0, y0)
+ self.bbox_relative.p1 = (x0 + dx, y0 + dy)
+
+ def get_constrained_layout(self):
+ """
+ Return whether constrained layout is being used.
+
+ See :ref:`constrainedlayout_guide`.
+ """
+ return self._parent.get_constrained_layout()
+
+ def get_constrained_layout_pads(self, relative=False):
+ """
+ Get padding for ``constrained_layout``.
+
+ Returns a list of ``w_pad, h_pad`` in inches and
+ ``wspace`` and ``hspace`` as fractions of the subplot.
+
+ See :ref:`constrainedlayout_guide`.
+
+ Parameters
+ ----------
+ relative : bool
+ If `True`, then convert from inches to figure relative.
+ """
+ return self._parent.get_constrained_layout_pads(relative=relative)
+
+ def get_layout_engine(self):
+ return self._parent.get_layout_engine()
+
+ @property
+ def axes(self):
+ """
+ List of Axes in the SubFigure. You can access and modify the Axes
+ in the SubFigure through this list.
+
+ Modifying this list has no effect. Instead, use `~.SubFigure.add_axes`,
+ `~.SubFigure.add_subplot` or `~.SubFigure.delaxes` to add or remove an
+ Axes.
+
+ Note: The `.SubFigure.axes` property and `~.SubFigure.get_axes` method
+ are equivalent.
+ """
+ return self._localaxes[:]
+
+ get_axes = axes.fget
+
+ def draw(self, renderer):
+ # docstring inherited
+
+ # draw the figure bounding box, perhaps none for white figure
+ if not self.get_visible():
+ return
+
+ artists = self._get_draw_artists(renderer)
+
+ try:
+ renderer.open_group('subfigure', gid=self.get_gid())
+ self.patch.draw(renderer)
+ mimage._draw_list_compositing_images(
+ renderer, self, artists, self.get_figure(root=True).suppressComposite)
+ renderer.close_group('subfigure')
+
+ finally:
+ self.stale = False
+
+
+@_docstring.interpd
+class Figure(FigureBase):
+ """
+ The top level container for all the plot elements.
+
+ See `matplotlib.figure` for an index of class methods.
+
+ Attributes
+ ----------
+ patch
+ The `.Rectangle` instance representing the figure background patch.
+
+ suppressComposite
+ For multiple images, the figure will make composite images
+ depending on the renderer option_image_nocomposite function. If
+ *suppressComposite* is a boolean, this will override the renderer.
+ """
+
+ # we want to cache the fonts and mathtext at a global level so that when
+ # multiple figures are created we can reuse them. This helps with a bug on
+ # windows where the creation of too many figures leads to too many open
+ # file handles and improves the performance of parsing mathtext. However,
+ # these global caches are not thread safe. The solution here is to let the
+ # Figure acquire a shared lock at the start of the draw, and release it when it
+ # is done. This allows multiple renderers to share the cached fonts and
+ # parsed text, but only one figure can draw at a time and so the font cache
+ # and mathtext cache are used by only one renderer at a time.
+
+ _render_lock = threading.RLock()
+
+ def __str__(self):
+ return "Figure(%gx%g)" % tuple(self.bbox.size)
+
+ def __repr__(self):
+ return "<{clsname} size {h:g}x{w:g} with {naxes} Axes>".format(
+ clsname=self.__class__.__name__,
+ h=self.bbox.size[0], w=self.bbox.size[1],
+ naxes=len(self.axes),
+ )
+
+ def __init__(self,
+ figsize=None,
+ dpi=None,
+ *,
+ facecolor=None,
+ edgecolor=None,
+ linewidth=0.0,
+ frameon=None,
+ subplotpars=None, # rc figure.subplot.*
+ tight_layout=None, # rc figure.autolayout
+ constrained_layout=None, # rc figure.constrained_layout.use
+ layout=None,
+ **kwargs
+ ):
+ """
+ Parameters
+ ----------
+ figsize : 2-tuple of floats, default: :rc:`figure.figsize`
+ Figure dimension ``(width, height)`` in inches.
+
+ dpi : float, default: :rc:`figure.dpi`
+ Dots per inch.
+
+ facecolor : default: :rc:`figure.facecolor`
+ The figure patch facecolor.
+
+ edgecolor : default: :rc:`figure.edgecolor`
+ The figure patch edge color.
+
+ linewidth : float
+ The linewidth of the frame (i.e. the edge linewidth of the figure
+ patch).
+
+ frameon : bool, default: :rc:`figure.frameon`
+ If ``False``, suppress drawing the figure background patch.
+
+ subplotpars : `~matplotlib.gridspec.SubplotParams`
+ Subplot parameters. If not given, the default subplot
+ parameters :rc:`figure.subplot.*` are used.
+
+ tight_layout : bool or dict, default: :rc:`figure.autolayout`
+ Whether to use the tight layout mechanism. See `.set_tight_layout`.
+
+ .. admonition:: Discouraged
+
+ The use of this parameter is discouraged. Please use
+ ``layout='tight'`` instead for the common case of
+ ``tight_layout=True`` and use `.set_tight_layout` otherwise.
+
+ constrained_layout : bool, default: :rc:`figure.constrained_layout.use`
+ This is equal to ``layout='constrained'``.
+
+ .. admonition:: Discouraged
+
+ The use of this parameter is discouraged. Please use
+ ``layout='constrained'`` instead.
+
+ layout : {'constrained', 'compressed', 'tight', 'none', `.LayoutEngine`, \
+None}, default: None
+ The layout mechanism for positioning of plot elements to avoid
+ overlapping Axes decorations (labels, ticks, etc). Note that
+ layout managers can have significant performance penalties.
+
+ - 'constrained': The constrained layout solver adjusts Axes sizes
+ to avoid overlapping Axes decorations. Can handle complex plot
+ layouts and colorbars, and is thus recommended.
+
+ See :ref:`constrainedlayout_guide` for examples.
+
+ - 'compressed': uses the same algorithm as 'constrained', but
+ removes extra space between fixed-aspect-ratio Axes. Best for
+ simple grids of Axes.
+
+ - 'tight': Use the tight layout mechanism. This is a relatively
+ simple algorithm that adjusts the subplot parameters so that
+ decorations do not overlap.
+
+ See :ref:`tight_layout_guide` for examples.
+
+ - 'none': Do not use a layout engine.
+
+ - A `.LayoutEngine` instance. Builtin layout classes are
+ `.ConstrainedLayoutEngine` and `.TightLayoutEngine`, more easily
+ accessible by 'constrained' and 'tight'. Passing an instance
+ allows third parties to provide their own layout engine.
+
+ If not given, fall back to using the parameters *tight_layout* and
+ *constrained_layout*, including their config defaults
+ :rc:`figure.autolayout` and :rc:`figure.constrained_layout.use`.
+
+ Other Parameters
+ ----------------
+ **kwargs : `.Figure` properties, optional
+
+ %(Figure:kwdoc)s
+ """
+ super().__init__(**kwargs)
+ self._root_figure = self
+ self._layout_engine = None
+
+ if layout is not None:
+ if (tight_layout is not None):
+ _api.warn_external(
+ "The Figure parameters 'layout' and 'tight_layout' cannot "
+ "be used together. Please use 'layout' only.")
+ if (constrained_layout is not None):
+ _api.warn_external(
+ "The Figure parameters 'layout' and 'constrained_layout' "
+ "cannot be used together. Please use 'layout' only.")
+ self.set_layout_engine(layout=layout)
+ elif tight_layout is not None:
+ if constrained_layout is not None:
+ _api.warn_external(
+ "The Figure parameters 'tight_layout' and "
+ "'constrained_layout' cannot be used together. Please use "
+ "'layout' parameter")
+ self.set_layout_engine(layout='tight')
+ if isinstance(tight_layout, dict):
+ self.get_layout_engine().set(**tight_layout)
+ elif constrained_layout is not None:
+ if isinstance(constrained_layout, dict):
+ self.set_layout_engine(layout='constrained')
+ self.get_layout_engine().set(**constrained_layout)
+ elif constrained_layout:
+ self.set_layout_engine(layout='constrained')
+
+ else:
+ # everything is None, so use default:
+ self.set_layout_engine(layout=layout)
+
+ # Callbacks traditionally associated with the canvas (and exposed with
+ # a proxy property), but that actually need to be on the figure for
+ # pickling.
+ self._canvas_callbacks = cbook.CallbackRegistry(
+ signals=FigureCanvasBase.events)
+ connect = self._canvas_callbacks._connect_picklable
+ self._mouse_key_ids = [
+ connect('key_press_event', backend_bases._key_handler),
+ connect('key_release_event', backend_bases._key_handler),
+ connect('key_release_event', backend_bases._key_handler),
+ connect('button_press_event', backend_bases._mouse_handler),
+ connect('button_release_event', backend_bases._mouse_handler),
+ connect('scroll_event', backend_bases._mouse_handler),
+ connect('motion_notify_event', backend_bases._mouse_handler),
+ ]
+ self._button_pick_id = connect('button_press_event', self.pick)
+ self._scroll_pick_id = connect('scroll_event', self.pick)
+
+ if figsize is None:
+ figsize = mpl.rcParams['figure.figsize']
+ if dpi is None:
+ dpi = mpl.rcParams['figure.dpi']
+ if facecolor is None:
+ facecolor = mpl.rcParams['figure.facecolor']
+ if edgecolor is None:
+ edgecolor = mpl.rcParams['figure.edgecolor']
+ if frameon is None:
+ frameon = mpl.rcParams['figure.frameon']
+
+ if not np.isfinite(figsize).all() or (np.array(figsize) < 0).any():
+ raise ValueError('figure size must be positive finite not '
+ f'{figsize}')
+ self.bbox_inches = Bbox.from_bounds(0, 0, *figsize)
+
+ self.dpi_scale_trans = Affine2D().scale(dpi)
+ # do not use property as it will trigger
+ self._dpi = dpi
+ self.bbox = TransformedBbox(self.bbox_inches, self.dpi_scale_trans)
+ self.figbbox = self.bbox
+ self.transFigure = BboxTransformTo(self.bbox)
+ self.transSubfigure = self.transFigure
+
+ self.patch = Rectangle(
+ xy=(0, 0), width=1, height=1, visible=frameon,
+ facecolor=facecolor, edgecolor=edgecolor, linewidth=linewidth,
+ # Don't let the figure patch influence bbox calculation.
+ in_layout=False)
+ self._set_artist_props(self.patch)
+ self.patch.set_antialiased(False)
+
+ FigureCanvasBase(self) # Set self.canvas.
+
+ if subplotpars is None:
+ subplotpars = SubplotParams()
+
+ self.subplotpars = subplotpars
+
+ self._axstack = _AxesStack() # track all figure Axes and current Axes
+ self.clear()
+
+ def pick(self, mouseevent):
+ if not self.canvas.widgetlock.locked():
+ super().pick(mouseevent)
+
+ def _check_layout_engines_compat(self, old, new):
+ """
+ Helper for set_layout engine
+
+ If the figure has used the old engine and added a colorbar then the
+ value of colorbar_gridspec must be the same on the new engine.
+ """
+ if old is None or new is None:
+ return True
+ if old.colorbar_gridspec == new.colorbar_gridspec:
+ return True
+ # colorbar layout different, so check if any colorbars are on the
+ # figure...
+ for ax in self.axes:
+ if hasattr(ax, '_colorbar'):
+ # colorbars list themselves as a colorbar.
+ return False
+ return True
+
+ def set_layout_engine(self, layout=None, **kwargs):
+ """
+ Set the layout engine for this figure.
+
+ Parameters
+ ----------
+ layout : {'constrained', 'compressed', 'tight', 'none', `.LayoutEngine`, None}
+
+ - 'constrained' will use `~.ConstrainedLayoutEngine`
+ - 'compressed' will also use `~.ConstrainedLayoutEngine`, but with
+ a correction that attempts to make a good layout for fixed-aspect
+ ratio Axes.
+ - 'tight' uses `~.TightLayoutEngine`
+ - 'none' removes layout engine.
+
+ If a `.LayoutEngine` instance, that instance will be used.
+
+ If `None`, the behavior is controlled by :rc:`figure.autolayout`
+ (which if `True` behaves as if 'tight' was passed) and
+ :rc:`figure.constrained_layout.use` (which if `True` behaves as if
+ 'constrained' was passed). If both are `True`,
+ :rc:`figure.autolayout` takes priority.
+
+ Users and libraries can define their own layout engines and pass
+ the instance directly as well.
+
+ **kwargs
+ The keyword arguments are passed to the layout engine to set things
+ like padding and margin sizes. Only used if *layout* is a string.
+
+ """
+ if layout is None:
+ if mpl.rcParams['figure.autolayout']:
+ layout = 'tight'
+ elif mpl.rcParams['figure.constrained_layout.use']:
+ layout = 'constrained'
+ else:
+ self._layout_engine = None
+ return
+ if layout == 'tight':
+ new_layout_engine = TightLayoutEngine(**kwargs)
+ elif layout == 'constrained':
+ new_layout_engine = ConstrainedLayoutEngine(**kwargs)
+ elif layout == 'compressed':
+ new_layout_engine = ConstrainedLayoutEngine(compress=True,
+ **kwargs)
+ elif layout == 'none':
+ if self._layout_engine is not None:
+ new_layout_engine = PlaceHolderLayoutEngine(
+ self._layout_engine.adjust_compatible,
+ self._layout_engine.colorbar_gridspec
+ )
+ else:
+ new_layout_engine = None
+ elif isinstance(layout, LayoutEngine):
+ new_layout_engine = layout
+ else:
+ raise ValueError(f"Invalid value for 'layout': {layout!r}")
+
+ if self._check_layout_engines_compat(self._layout_engine,
+ new_layout_engine):
+ self._layout_engine = new_layout_engine
+ else:
+ raise RuntimeError('Colorbar layout of new layout engine not '
+ 'compatible with old engine, and a colorbar '
+ 'has been created. Engine not changed.')
+
+ def get_layout_engine(self):
+ return self._layout_engine
+
+ # TODO: I'd like to dynamically add the _repr_html_ method
+ # to the figure in the right context, but then IPython doesn't
+ # use it, for some reason.
+
+ def _repr_html_(self):
+ # We can't use "isinstance" here, because then we'd end up importing
+ # webagg unconditionally.
+ if 'WebAgg' in type(self.canvas).__name__:
+ from matplotlib.backends import backend_webagg
+ return backend_webagg.ipython_inline_display(self)
+
+ def show(self, warn=True):
+ """
+ If using a GUI backend with pyplot, display the figure window.
+
+ If the figure was not created using `~.pyplot.figure`, it will lack
+ a `~.backend_bases.FigureManagerBase`, and this method will raise an
+ AttributeError.
+
+ .. warning::
+
+ This does not manage an GUI event loop. Consequently, the figure
+ may only be shown briefly or not shown at all if you or your
+ environment are not managing an event loop.
+
+ Use cases for `.Figure.show` include running this from a GUI
+ application (where there is persistently an event loop running) or
+ from a shell, like IPython, that install an input hook to allow the
+ interactive shell to accept input while the figure is also being
+ shown and interactive. Some, but not all, GUI toolkits will
+ register an input hook on import. See :ref:`cp_integration` for
+ more details.
+
+ If you're in a shell without input hook integration or executing a
+ python script, you should use `matplotlib.pyplot.show` with
+ ``block=True`` instead, which takes care of starting and running
+ the event loop for you.
+
+ Parameters
+ ----------
+ warn : bool, default: True
+ If ``True`` and we are not running headless (i.e. on Linux with an
+ unset DISPLAY), issue warning when called on a non-GUI backend.
+
+ """
+ if self.canvas.manager is None:
+ raise AttributeError(
+ "Figure.show works only for figures managed by pyplot, "
+ "normally created by pyplot.figure()")
+ try:
+ self.canvas.manager.show()
+ except NonGuiException as exc:
+ if warn:
+ _api.warn_external(str(exc))
+
+ @property
+ def axes(self):
+ """
+ List of Axes in the Figure. You can access and modify the Axes in the
+ Figure through this list.
+
+ Do not modify the list itself. Instead, use `~Figure.add_axes`,
+ `~.Figure.add_subplot` or `~.Figure.delaxes` to add or remove an Axes.
+
+ Note: The `.Figure.axes` property and `~.Figure.get_axes` method are
+ equivalent.
+ """
+ return self._axstack.as_list()
+
+ get_axes = axes.fget
+
+ @property
+ def number(self):
+ """The figure id, used to identify figures in `.pyplot`."""
+ # Historically, pyplot dynamically added a number attribute to figure.
+ # However, this number must stay in sync with the figure manager.
+ # AFAICS overwriting the number attribute does not have the desired
+ # effect for pyplot. But there are some repos in GitHub that do change
+ # number. So let's take it slow and properly migrate away from writing.
+ #
+ # Making the dynamic attribute private and wrapping it in a property
+ # allows to maintain current behavior and deprecate write-access.
+ #
+ # When the deprecation expires, there's no need for duplicate state
+ # anymore and the private _number attribute can be replaced by
+ # `self.canvas.manager.num` if that exists and None otherwise.
+ if hasattr(self, '_number'):
+ return self._number
+ else:
+ raise AttributeError(
+ "'Figure' object has no attribute 'number'. In the future this"
+ "will change to returning 'None' instead.")
+
+ @number.setter
+ def number(self, num):
+ _api.warn_deprecated(
+ "3.10",
+ message="Changing 'Figure.number' is deprecated since %(since)s and "
+ "will raise an error starting %(removal)s")
+ self._number = num
+
+ def _get_renderer(self):
+ if hasattr(self.canvas, 'get_renderer'):
+ return self.canvas.get_renderer()
+ else:
+ return _get_renderer(self)
+
+ def _get_dpi(self):
+ return self._dpi
+
+ def _set_dpi(self, dpi, forward=True):
+ """
+ Parameters
+ ----------
+ dpi : float
+
+ forward : bool
+ Passed on to `~.Figure.set_size_inches`
+ """
+ if dpi == self._dpi:
+ # We don't want to cause undue events in backends.
+ return
+ self._dpi = dpi
+ self.dpi_scale_trans.clear().scale(dpi)
+ w, h = self.get_size_inches()
+ self.set_size_inches(w, h, forward=forward)
+
+ dpi = property(_get_dpi, _set_dpi, doc="The resolution in dots per inch.")
+
+ def get_tight_layout(self):
+ """Return whether `.Figure.tight_layout` is called when drawing."""
+ return isinstance(self.get_layout_engine(), TightLayoutEngine)
+
+ @_api.deprecated("3.6", alternative="set_layout_engine",
+ pending=True)
+ def set_tight_layout(self, tight):
+ """
+ Set whether and how `.Figure.tight_layout` is called when drawing.
+
+ Parameters
+ ----------
+ tight : bool or dict with keys "pad", "w_pad", "h_pad", "rect" or None
+ If a bool, sets whether to call `.Figure.tight_layout` upon drawing.
+ If ``None``, use :rc:`figure.autolayout` instead.
+ If a dict, pass it as kwargs to `.Figure.tight_layout`, overriding the
+ default paddings.
+ """
+ if tight is None:
+ tight = mpl.rcParams['figure.autolayout']
+ _tight = 'tight' if bool(tight) else 'none'
+ _tight_parameters = tight if isinstance(tight, dict) else {}
+ self.set_layout_engine(_tight, **_tight_parameters)
+ self.stale = True
+
+ def get_constrained_layout(self):
+ """
+ Return whether constrained layout is being used.
+
+ See :ref:`constrainedlayout_guide`.
+ """
+ return isinstance(self.get_layout_engine(), ConstrainedLayoutEngine)
+
+ @_api.deprecated("3.6", alternative="set_layout_engine('constrained')",
+ pending=True)
+ def set_constrained_layout(self, constrained):
+ """
+ Set whether ``constrained_layout`` is used upon drawing.
+
+ If None, :rc:`figure.constrained_layout.use` value will be used.
+
+ When providing a dict containing the keys ``w_pad``, ``h_pad``
+ the default ``constrained_layout`` paddings will be
+ overridden. These pads are in inches and default to 3.0/72.0.
+ ``w_pad`` is the width padding and ``h_pad`` is the height padding.
+
+ Parameters
+ ----------
+ constrained : bool or dict or None
+ """
+ if constrained is None:
+ constrained = mpl.rcParams['figure.constrained_layout.use']
+ _constrained = 'constrained' if bool(constrained) else 'none'
+ _parameters = constrained if isinstance(constrained, dict) else {}
+ self.set_layout_engine(_constrained, **_parameters)
+ self.stale = True
+
+ @_api.deprecated(
+ "3.6", alternative="figure.get_layout_engine().set()",
+ pending=True)
+ def set_constrained_layout_pads(self, **kwargs):
+ """
+ Set padding for ``constrained_layout``.
+
+ Tip: The parameters can be passed from a dictionary by using
+ ``fig.set_constrained_layout(**pad_dict)``.
+
+ See :ref:`constrainedlayout_guide`.
+
+ Parameters
+ ----------
+ w_pad : float, default: :rc:`figure.constrained_layout.w_pad`
+ Width padding in inches. This is the pad around Axes
+ and is meant to make sure there is enough room for fonts to
+ look good. Defaults to 3 pts = 0.04167 inches
+
+ h_pad : float, default: :rc:`figure.constrained_layout.h_pad`
+ Height padding in inches. Defaults to 3 pts.
+
+ wspace : float, default: :rc:`figure.constrained_layout.wspace`
+ Width padding between subplots, expressed as a fraction of the
+ subplot width. The total padding ends up being w_pad + wspace.
+
+ hspace : float, default: :rc:`figure.constrained_layout.hspace`
+ Height padding between subplots, expressed as a fraction of the
+ subplot width. The total padding ends up being h_pad + hspace.
+
+ """
+ if isinstance(self.get_layout_engine(), ConstrainedLayoutEngine):
+ self.get_layout_engine().set(**kwargs)
+
+ @_api.deprecated("3.6", alternative="fig.get_layout_engine().get()",
+ pending=True)
+ def get_constrained_layout_pads(self, relative=False):
+ """
+ Get padding for ``constrained_layout``.
+
+ Returns a list of ``w_pad, h_pad`` in inches and
+ ``wspace`` and ``hspace`` as fractions of the subplot.
+ All values are None if ``constrained_layout`` is not used.
+
+ See :ref:`constrainedlayout_guide`.
+
+ Parameters
+ ----------
+ relative : bool
+ If `True`, then convert from inches to figure relative.
+ """
+ if not isinstance(self.get_layout_engine(), ConstrainedLayoutEngine):
+ return None, None, None, None
+ info = self.get_layout_engine().get()
+ w_pad = info['w_pad']
+ h_pad = info['h_pad']
+ wspace = info['wspace']
+ hspace = info['hspace']
+
+ if relative and (w_pad is not None or h_pad is not None):
+ renderer = self._get_renderer()
+ dpi = renderer.dpi
+ w_pad = w_pad * dpi / renderer.width
+ h_pad = h_pad * dpi / renderer.height
+
+ return w_pad, h_pad, wspace, hspace
+
+ def set_canvas(self, canvas):
+ """
+ Set the canvas that contains the figure
+
+ Parameters
+ ----------
+ canvas : FigureCanvas
+ """
+ self.canvas = canvas
+
+ @_docstring.interpd
+ def figimage(self, X, xo=0, yo=0, alpha=None, norm=None, cmap=None,
+ vmin=None, vmax=None, origin=None, resize=False, *,
+ colorizer=None, **kwargs):
+ """
+ Add a non-resampled image to the figure.
+
+ The image is attached to the lower or upper left corner depending on
+ *origin*.
+
+ Parameters
+ ----------
+ X
+ The image data. This is an array of one of the following shapes:
+
+ - (M, N): an image with scalar data. Color-mapping is controlled
+ by *cmap*, *norm*, *vmin*, and *vmax*.
+ - (M, N, 3): an image with RGB values (0-1 float or 0-255 int).
+ - (M, N, 4): an image with RGBA values (0-1 float or 0-255 int),
+ i.e. including transparency.
+
+ xo, yo : int
+ The *x*/*y* image offset in pixels.
+
+ alpha : None or float
+ The alpha blending value.
+
+ %(cmap_doc)s
+
+ This parameter is ignored if *X* is RGB(A).
+
+ %(norm_doc)s
+
+ This parameter is ignored if *X* is RGB(A).
+
+ %(vmin_vmax_doc)s
+
+ This parameter is ignored if *X* is RGB(A).
+
+ origin : {'upper', 'lower'}, default: :rc:`image.origin`
+ Indicates where the [0, 0] index of the array is in the upper left
+ or lower left corner of the Axes.
+
+ resize : bool
+ If *True*, resize the figure to match the given image size.
+
+ %(colorizer_doc)s
+
+ This parameter is ignored if *X* is RGB(A).
+
+ Returns
+ -------
+ `matplotlib.image.FigureImage`
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Additional kwargs are `.Artist` kwargs passed on to `.FigureImage`.
+
+ Notes
+ -----
+ figimage complements the Axes image (`~matplotlib.axes.Axes.imshow`)
+ which will be resampled to fit the current Axes. If you want
+ a resampled image to fill the entire figure, you can define an
+ `~matplotlib.axes.Axes` with extent [0, 0, 1, 1].
+
+ Examples
+ --------
+ ::
+
+ f = plt.figure()
+ nx = int(f.get_figwidth() * f.dpi)
+ ny = int(f.get_figheight() * f.dpi)
+ data = np.random.random((ny, nx))
+ f.figimage(data)
+ plt.show()
+ """
+ if resize:
+ dpi = self.get_dpi()
+ figsize = [x / dpi for x in (X.shape[1], X.shape[0])]
+ self.set_size_inches(figsize, forward=True)
+
+ im = mimage.FigureImage(self, cmap=cmap, norm=norm,
+ colorizer=colorizer,
+ offsetx=xo, offsety=yo,
+ origin=origin, **kwargs)
+ im.stale_callback = _stale_figure_callback
+
+ im.set_array(X)
+ im.set_alpha(alpha)
+ if norm is None:
+ im._check_exclusionary_keywords(colorizer, vmin=vmin, vmax=vmax)
+ im.set_clim(vmin, vmax)
+ self.images.append(im)
+ im._remove_method = self.images.remove
+ self.stale = True
+ return im
+
+ def set_size_inches(self, w, h=None, forward=True):
+ """
+ Set the figure size in inches.
+
+ Call signatures::
+
+ fig.set_size_inches(w, h) # OR
+ fig.set_size_inches((w, h))
+
+ Parameters
+ ----------
+ w : (float, float) or float
+ Width and height in inches (if height not specified as a separate
+ argument) or width.
+ h : float
+ Height in inches.
+ forward : bool, default: True
+ If ``True``, the canvas size is automatically updated, e.g.,
+ you can resize the figure window from the shell.
+
+ See Also
+ --------
+ matplotlib.figure.Figure.get_size_inches
+ matplotlib.figure.Figure.set_figwidth
+ matplotlib.figure.Figure.set_figheight
+
+ Notes
+ -----
+ To transform from pixels to inches divide by `Figure.dpi`.
+ """
+ if h is None: # Got called with a single pair as argument.
+ w, h = w
+ size = np.array([w, h])
+ if not np.isfinite(size).all() or (size < 0).any():
+ raise ValueError(f'figure size must be positive finite not {size}')
+ self.bbox_inches.p1 = size
+ if forward:
+ manager = self.canvas.manager
+ if manager is not None:
+ manager.resize(*(size * self.dpi).astype(int))
+ self.stale = True
+
+ def get_size_inches(self):
+ """
+ Return the current size of the figure in inches.
+
+ Returns
+ -------
+ ndarray
+ The size (width, height) of the figure in inches.
+
+ See Also
+ --------
+ matplotlib.figure.Figure.set_size_inches
+ matplotlib.figure.Figure.get_figwidth
+ matplotlib.figure.Figure.get_figheight
+
+ Notes
+ -----
+ The size in pixels can be obtained by multiplying with `Figure.dpi`.
+ """
+ return np.array(self.bbox_inches.p1)
+
+ def get_figwidth(self):
+ """Return the figure width in inches."""
+ return self.bbox_inches.width
+
+ def get_figheight(self):
+ """Return the figure height in inches."""
+ return self.bbox_inches.height
+
+ def get_dpi(self):
+ """Return the resolution in dots per inch as a float."""
+ return self.dpi
+
+ def set_dpi(self, val):
+ """
+ Set the resolution of the figure in dots-per-inch.
+
+ Parameters
+ ----------
+ val : float
+ """
+ self.dpi = val
+ self.stale = True
+
+ def set_figwidth(self, val, forward=True):
+ """
+ Set the width of the figure in inches.
+
+ Parameters
+ ----------
+ val : float
+ forward : bool
+ See `set_size_inches`.
+
+ See Also
+ --------
+ matplotlib.figure.Figure.set_figheight
+ matplotlib.figure.Figure.set_size_inches
+ """
+ self.set_size_inches(val, self.get_figheight(), forward=forward)
+
+ def set_figheight(self, val, forward=True):
+ """
+ Set the height of the figure in inches.
+
+ Parameters
+ ----------
+ val : float
+ forward : bool
+ See `set_size_inches`.
+
+ See Also
+ --------
+ matplotlib.figure.Figure.set_figwidth
+ matplotlib.figure.Figure.set_size_inches
+ """
+ self.set_size_inches(self.get_figwidth(), val, forward=forward)
+
+ def clear(self, keep_observers=False):
+ # docstring inherited
+ super().clear(keep_observers=keep_observers)
+ # FigureBase.clear does not clear toolbars, as
+ # only Figure can have toolbars
+ toolbar = self.canvas.toolbar
+ if toolbar is not None:
+ toolbar.update()
+
+ @_finalize_rasterization
+ @allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+ if not self.get_visible():
+ return
+
+ with self._render_lock:
+
+ artists = self._get_draw_artists(renderer)
+ try:
+ renderer.open_group('figure', gid=self.get_gid())
+ if self.axes and self.get_layout_engine() is not None:
+ try:
+ self.get_layout_engine().execute(self)
+ except ValueError:
+ pass
+ # ValueError can occur when resizing a window.
+
+ self.patch.draw(renderer)
+ mimage._draw_list_compositing_images(
+ renderer, self, artists, self.suppressComposite)
+
+ renderer.close_group('figure')
+ finally:
+ self.stale = False
+
+ DrawEvent("draw_event", self.canvas, renderer)._process()
+
+ def draw_without_rendering(self):
+ """
+ Draw the figure with no output. Useful to get the final size of
+ artists that require a draw before their size is known (e.g. text).
+ """
+ renderer = _get_renderer(self)
+ with renderer._draw_disabled():
+ self.draw(renderer)
+
+ def draw_artist(self, a):
+ """
+ Draw `.Artist` *a* only.
+ """
+ a.draw(self.canvas.get_renderer())
+
+ def __getstate__(self):
+ state = super().__getstate__()
+
+ # The canvas cannot currently be pickled, but this has the benefit
+ # of meaning that a figure can be detached from one canvas, and
+ # re-attached to another.
+ state.pop("canvas")
+
+ # discard any changes to the dpi due to pixel ratio changes
+ state["_dpi"] = state.get('_original_dpi', state['_dpi'])
+
+ # add version information to the state
+ state['__mpl_version__'] = mpl.__version__
+
+ # check whether the figure manager (if any) is registered with pyplot
+ from matplotlib import _pylab_helpers
+ if self.canvas.manager in _pylab_helpers.Gcf.figs.values():
+ state['_restore_to_pylab'] = True
+ return state
+
+ def __setstate__(self, state):
+ version = state.pop('__mpl_version__')
+ restore_to_pylab = state.pop('_restore_to_pylab', False)
+
+ if version != mpl.__version__:
+ _api.warn_external(
+ f"This figure was saved with matplotlib version {version} and "
+ f"loaded with {mpl.__version__} so may not function correctly."
+ )
+ self.__dict__ = state
+
+ # re-initialise some of the unstored state information
+ FigureCanvasBase(self) # Set self.canvas.
+
+ if restore_to_pylab:
+ # lazy import to avoid circularity
+ import matplotlib.pyplot as plt
+ import matplotlib._pylab_helpers as pylab_helpers
+ allnums = plt.get_fignums()
+ num = max(allnums) + 1 if allnums else 1
+ backend = plt._get_backend_mod()
+ mgr = backend.new_figure_manager_given_figure(num, self)
+ pylab_helpers.Gcf._set_new_active_manager(mgr)
+ plt.draw_if_interactive()
+
+ self.stale = True
+
+ def add_axobserver(self, func):
+ """Whenever the Axes state change, ``func(self)`` will be called."""
+ # Connect a wrapper lambda and not func itself, to avoid it being
+ # weakref-collected.
+ self._axobservers.connect("_axes_change_event", lambda arg: func(arg))
+
+ def savefig(self, fname, *, transparent=None, **kwargs):
+ """
+ Save the current figure as an image or vector graphic to a file.
+
+ Call signature::
+
+ savefig(fname, *, transparent=None, dpi='figure', format=None,
+ metadata=None, bbox_inches=None, pad_inches=0.1,
+ facecolor='auto', edgecolor='auto', backend=None,
+ **kwargs
+ )
+
+ The available output formats depend on the backend being used.
+
+ Parameters
+ ----------
+ fname : str or path-like or binary file-like
+ A path, or a Python file-like object, or
+ possibly some backend-dependent object such as
+ `matplotlib.backends.backend_pdf.PdfPages`.
+
+ If *format* is set, it determines the output format, and the file
+ is saved as *fname*. Note that *fname* is used verbatim, and there
+ is no attempt to make the extension, if any, of *fname* match
+ *format*, and no extension is appended.
+
+ If *format* is not set, then the format is inferred from the
+ extension of *fname*, if there is one. If *format* is not
+ set and *fname* has no extension, then the file is saved with
+ :rc:`savefig.format` and the appropriate extension is appended to
+ *fname*.
+
+ Other Parameters
+ ----------------
+ transparent : bool, default: :rc:`savefig.transparent`
+ If *True*, the Axes patches will all be transparent; the
+ Figure patch will also be transparent unless *facecolor*
+ and/or *edgecolor* are specified via kwargs.
+
+ If *False* has no effect and the color of the Axes and
+ Figure patches are unchanged (unless the Figure patch
+ is specified via the *facecolor* and/or *edgecolor* keyword
+ arguments in which case those colors are used).
+
+ The transparency of these patches will be restored to their
+ original values upon exit of this function.
+
+ This is useful, for example, for displaying
+ a plot on top of a colored background on a web page.
+
+ dpi : float or 'figure', default: :rc:`savefig.dpi`
+ The resolution in dots per inch. If 'figure', use the figure's
+ dpi value.
+
+ format : str
+ The file format, e.g. 'png', 'pdf', 'svg', ... The behavior when
+ this is unset is documented under *fname*.
+
+ metadata : dict, optional
+ Key/value pairs to store in the image metadata. The supported keys
+ and defaults depend on the image format and backend:
+
+ - 'png' with Agg backend: See the parameter ``metadata`` of
+ `~.FigureCanvasAgg.print_png`.
+ - 'pdf' with pdf backend: See the parameter ``metadata`` of
+ `~.backend_pdf.PdfPages`.
+ - 'svg' with svg backend: See the parameter ``metadata`` of
+ `~.FigureCanvasSVG.print_svg`.
+ - 'eps' and 'ps' with PS backend: Only 'Creator' is supported.
+
+ Not supported for 'pgf', 'raw', and 'rgba' as those formats do not support
+ embedding metadata.
+ Does not currently support 'jpg', 'tiff', or 'webp', but may include
+ embedding EXIF metadata in the future.
+
+ bbox_inches : str or `.Bbox`, default: :rc:`savefig.bbox`
+ Bounding box in inches: only the given portion of the figure is
+ saved. If 'tight', try to figure out the tight bbox of the figure.
+
+ pad_inches : float or 'layout', default: :rc:`savefig.pad_inches`
+ Amount of padding in inches around the figure when bbox_inches is
+ 'tight'. If 'layout' use the padding from the constrained or
+ compressed layout engine; ignored if one of those engines is not in
+ use.
+
+ facecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.facecolor`
+ The facecolor of the figure. If 'auto', use the current figure
+ facecolor.
+
+ edgecolor : :mpltype:`color` or 'auto', default: :rc:`savefig.edgecolor`
+ The edgecolor of the figure. If 'auto', use the current figure
+ edgecolor.
+
+ backend : str, optional
+ Use a non-default backend to render the file, e.g. to render a
+ png file with the "cairo" backend rather than the default "agg",
+ or a pdf file with the "pgf" backend rather than the default
+ "pdf". Note that the default backend is normally sufficient. See
+ :ref:`the-builtin-backends` for a list of valid backends for each
+ file format. Custom backends can be referenced as "module://...".
+
+ orientation : {'landscape', 'portrait'}
+ Currently only supported by the postscript backend.
+
+ papertype : str
+ One of 'letter', 'legal', 'executive', 'ledger', 'a0' through
+ 'a10', 'b0' through 'b10'. Only supported for postscript
+ output.
+
+ bbox_extra_artists : list of `~matplotlib.artist.Artist`, optional
+ A list of extra artists that will be considered when the
+ tight bbox is calculated.
+
+ pil_kwargs : dict, optional
+ Additional keyword arguments that are passed to
+ `PIL.Image.Image.save` when saving the figure.
+
+ """
+
+ kwargs.setdefault('dpi', mpl.rcParams['savefig.dpi'])
+ if transparent is None:
+ transparent = mpl.rcParams['savefig.transparent']
+
+ with ExitStack() as stack:
+ if transparent:
+ def _recursively_make_subfig_transparent(exit_stack, subfig):
+ exit_stack.enter_context(
+ subfig.patch._cm_set(
+ facecolor="none", edgecolor="none"))
+ for ax in subfig.axes:
+ exit_stack.enter_context(
+ ax.patch._cm_set(
+ facecolor="none", edgecolor="none"))
+ for sub_subfig in subfig.subfigs:
+ _recursively_make_subfig_transparent(
+ exit_stack, sub_subfig)
+
+ def _recursively_make_axes_transparent(exit_stack, ax):
+ exit_stack.enter_context(
+ ax.patch._cm_set(facecolor="none", edgecolor="none"))
+ for child_ax in ax.child_axes:
+ exit_stack.enter_context(
+ child_ax.patch._cm_set(
+ facecolor="none", edgecolor="none"))
+ for child_childax in ax.child_axes:
+ _recursively_make_axes_transparent(
+ exit_stack, child_childax)
+
+ kwargs.setdefault('facecolor', 'none')
+ kwargs.setdefault('edgecolor', 'none')
+ # set subfigure to appear transparent in printed image
+ for subfig in self.subfigs:
+ _recursively_make_subfig_transparent(stack, subfig)
+ # set Axes to be transparent
+ for ax in self.axes:
+ _recursively_make_axes_transparent(stack, ax)
+ self.canvas.print_figure(fname, **kwargs)
+
+ def ginput(self, n=1, timeout=30, show_clicks=True,
+ mouse_add=MouseButton.LEFT,
+ mouse_pop=MouseButton.RIGHT,
+ mouse_stop=MouseButton.MIDDLE):
+ """
+ Blocking call to interact with a figure.
+
+ Wait until the user clicks *n* times on the figure, and return the
+ coordinates of each click in a list.
+
+ There are three possible interactions:
+
+ - Add a point.
+ - Remove the most recently added point.
+ - Stop the interaction and return the points added so far.
+
+ The actions are assigned to mouse buttons via the arguments
+ *mouse_add*, *mouse_pop* and *mouse_stop*.
+
+ Parameters
+ ----------
+ n : int, default: 1
+ Number of mouse clicks to accumulate. If negative, accumulate
+ clicks until the input is terminated manually.
+ timeout : float, default: 30 seconds
+ Number of seconds to wait before timing out. If zero or negative
+ will never time out.
+ show_clicks : bool, default: True
+ If True, show a red cross at the location of each click.
+ mouse_add : `.MouseButton` or None, default: `.MouseButton.LEFT`
+ Mouse button used to add points.
+ mouse_pop : `.MouseButton` or None, default: `.MouseButton.RIGHT`
+ Mouse button used to remove the most recently added point.
+ mouse_stop : `.MouseButton` or None, default: `.MouseButton.MIDDLE`
+ Mouse button used to stop input.
+
+ Returns
+ -------
+ list of tuples
+ A list of the clicked (x, y) coordinates.
+
+ Notes
+ -----
+ The keyboard can also be used to select points in case your mouse
+ does not have one or more of the buttons. The delete and backspace
+ keys act like right-clicking (i.e., remove last point), the enter key
+ terminates input and any other key (not already used by the window
+ manager) selects a point.
+ """
+ clicks = []
+ marks = []
+
+ def handler(event):
+ is_button = event.name == "button_press_event"
+ is_key = event.name == "key_press_event"
+ # Quit (even if not in infinite mode; this is consistent with
+ # MATLAB and sometimes quite useful, but will require the user to
+ # test how many points were actually returned before using data).
+ if (is_button and event.button == mouse_stop
+ or is_key and event.key in ["escape", "enter"]):
+ self.canvas.stop_event_loop()
+ # Pop last click.
+ elif (is_button and event.button == mouse_pop
+ or is_key and event.key in ["backspace", "delete"]):
+ if clicks:
+ clicks.pop()
+ if show_clicks:
+ marks.pop().remove()
+ self.canvas.draw()
+ # Add new click.
+ elif (is_button and event.button == mouse_add
+ # On macOS/gtk, some keys return None.
+ or is_key and event.key is not None):
+ if event.inaxes:
+ clicks.append((event.xdata, event.ydata))
+ _log.info("input %i: %f, %f",
+ len(clicks), event.xdata, event.ydata)
+ if show_clicks:
+ line = mpl.lines.Line2D([event.xdata], [event.ydata],
+ marker="+", color="r")
+ event.inaxes.add_line(line)
+ marks.append(line)
+ self.canvas.draw()
+ if len(clicks) == n and n > 0:
+ self.canvas.stop_event_loop()
+
+ _blocking_input.blocking_input_loop(
+ self, ["button_press_event", "key_press_event"], timeout, handler)
+
+ # Cleanup.
+ for mark in marks:
+ mark.remove()
+ self.canvas.draw()
+
+ return clicks
+
+ def waitforbuttonpress(self, timeout=-1):
+ """
+ Blocking call to interact with the figure.
+
+ Wait for user input and return True if a key was pressed, False if a
+ mouse button was pressed and None if no input was given within
+ *timeout* seconds. Negative values deactivate *timeout*.
+ """
+ event = None
+
+ def handler(ev):
+ nonlocal event
+ event = ev
+ self.canvas.stop_event_loop()
+
+ _blocking_input.blocking_input_loop(
+ self, ["button_press_event", "key_press_event"], timeout, handler)
+
+ return None if event is None else event.name == "key_press_event"
+
+ def tight_layout(self, *, pad=1.08, h_pad=None, w_pad=None, rect=None):
+ """
+ Adjust the padding between and around subplots.
+
+ To exclude an artist on the Axes from the bounding box calculation
+ that determines the subplot parameters (i.e. legend, or annotation),
+ set ``a.set_in_layout(False)`` for that artist.
+
+ Parameters
+ ----------
+ pad : float, default: 1.08
+ Padding between the figure edge and the edges of subplots,
+ as a fraction of the font size.
+ h_pad, w_pad : float, default: *pad*
+ Padding (height/width) between edges of adjacent subplots,
+ as a fraction of the font size.
+ rect : tuple (left, bottom, right, top), default: (0, 0, 1, 1)
+ A rectangle in normalized figure coordinates into which the whole
+ subplots area (including labels) will fit.
+
+ See Also
+ --------
+ .Figure.set_layout_engine
+ .pyplot.tight_layout
+ """
+ # note that here we do not permanently set the figures engine to
+ # tight_layout but rather just perform the layout in place and remove
+ # any previous engines.
+ engine = TightLayoutEngine(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
+ try:
+ previous_engine = self.get_layout_engine()
+ self.set_layout_engine(engine)
+ engine.execute(self)
+ if previous_engine is not None and not isinstance(
+ previous_engine, (TightLayoutEngine, PlaceHolderLayoutEngine)
+ ):
+ _api.warn_external('The figure layout has changed to tight')
+ finally:
+ self.set_layout_engine('none')
+
+
+def figaspect(arg):
+ """
+ Calculate the width and height for a figure with a specified aspect ratio.
+
+ While the height is taken from :rc:`figure.figsize`, the width is
+ adjusted to match the desired aspect ratio. Additionally, it is ensured
+ that the width is in the range [4., 16.] and the height is in the range
+ [2., 16.]. If necessary, the default height is adjusted to ensure this.
+
+ Parameters
+ ----------
+ arg : float or 2D array
+ If a float, this defines the aspect ratio (i.e. the ratio height /
+ width).
+ In case of an array the aspect ratio is number of rows / number of
+ columns, so that the array could be fitted in the figure undistorted.
+
+ Returns
+ -------
+ size : (2,) array
+ The width and height of the figure in inches.
+
+ Notes
+ -----
+ If you want to create an Axes within the figure, that still preserves the
+ aspect ratio, be sure to create it with equal width and height. See
+ examples below.
+
+ Thanks to Fernando Perez for this function.
+
+ Examples
+ --------
+ Make a figure twice as tall as it is wide::
+
+ w, h = figaspect(2.)
+ fig = Figure(figsize=(w, h))
+ ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
+ ax.imshow(A, **kwargs)
+
+ Make a figure with the proper aspect for an array::
+
+ A = rand(5, 3)
+ w, h = figaspect(A)
+ fig = Figure(figsize=(w, h))
+ ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
+ ax.imshow(A, **kwargs)
+ """
+
+ isarray = hasattr(arg, 'shape') and not np.isscalar(arg)
+
+ # min/max sizes to respect when autoscaling. If John likes the idea, they
+ # could become rc parameters, for now they're hardwired.
+ figsize_min = np.array((4.0, 2.0)) # min length for width/height
+ figsize_max = np.array((16.0, 16.0)) # max length for width/height
+
+ # Extract the aspect ratio of the array
+ if isarray:
+ nr, nc = arg.shape[:2]
+ arr_ratio = nr / nc
+ else:
+ arr_ratio = arg
+
+ # Height of user figure defaults
+ fig_height = mpl.rcParams['figure.figsize'][1]
+
+ # New size for the figure, keeping the aspect ratio of the caller
+ newsize = np.array((fig_height / arr_ratio, fig_height))
+
+ # Sanity checks, don't drop either dimension below figsize_min
+ newsize /= min(1.0, *(newsize / figsize_min))
+
+ # Avoid humongous windows as well
+ newsize /= max(1.0, *(newsize / figsize_max))
+
+ # Finally, if we have a really funky aspect ratio, break it but respect
+ # the min/max dimensions (we don't want figures 10 feet tall!)
+ newsize = np.clip(newsize, figsize_min, figsize_max)
+ return newsize
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/figure.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/figure.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..064503c91384a6f5af15cccd736c817283ce77e0
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/figure.pyi
@@ -0,0 +1,423 @@
+from collections.abc import Callable, Hashable, Iterable, Sequence
+import os
+from typing import Any, IO, Literal, TypeVar, overload
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+from matplotlib.artist import Artist
+from matplotlib.axes import Axes
+from matplotlib.backend_bases import (
+ FigureCanvasBase,
+ MouseButton,
+ MouseEvent,
+ RendererBase,
+)
+from matplotlib.colors import Colormap, Normalize
+from matplotlib.colorbar import Colorbar
+from matplotlib.colorizer import ColorizingArtist, Colorizer
+from matplotlib.cm import ScalarMappable
+from matplotlib.gridspec import GridSpec, SubplotSpec, SubplotParams as SubplotParams
+from matplotlib.image import _ImageBase, FigureImage
+from matplotlib.layout_engine import LayoutEngine
+from matplotlib.legend import Legend
+from matplotlib.lines import Line2D
+from matplotlib.patches import Rectangle, Patch
+from matplotlib.text import Text
+from matplotlib.transforms import Affine2D, Bbox, BboxBase, Transform
+from .typing import ColorType, HashableList
+
+_T = TypeVar("_T")
+
+class FigureBase(Artist):
+ artists: list[Artist]
+ lines: list[Line2D]
+ patches: list[Patch]
+ texts: list[Text]
+ images: list[_ImageBase]
+ legends: list[Legend]
+ subfigs: list[SubFigure]
+ stale: bool
+ suppressComposite: bool | None
+ def __init__(self, **kwargs) -> None: ...
+ def autofmt_xdate(
+ self,
+ bottom: float = ...,
+ rotation: int = ...,
+ ha: Literal["left", "center", "right"] = ...,
+ which: Literal["major", "minor", "both"] = ...,
+ ) -> None: ...
+ def get_children(self) -> list[Artist]: ...
+ def contains(self, mouseevent: MouseEvent) -> tuple[bool, dict[Any, Any]]: ...
+ def suptitle(self, t: str, **kwargs) -> Text: ...
+ def get_suptitle(self) -> str: ...
+ def supxlabel(self, t: str, **kwargs) -> Text: ...
+ def get_supxlabel(self) -> str: ...
+ def supylabel(self, t: str, **kwargs) -> Text: ...
+ def get_supylabel(self) -> str: ...
+ def get_edgecolor(self) -> ColorType: ...
+ def get_facecolor(self) -> ColorType: ...
+ def get_frameon(self) -> bool: ...
+ def set_linewidth(self, linewidth: float) -> None: ...
+ def get_linewidth(self) -> float: ...
+ def set_edgecolor(self, color: ColorType) -> None: ...
+ def set_facecolor(self, color: ColorType) -> None: ...
+ @overload
+ def get_figure(self, root: Literal[True]) -> Figure: ...
+ @overload
+ def get_figure(self, root: Literal[False]) -> Figure | SubFigure: ...
+ @overload
+ def get_figure(self, root: bool = ...) -> Figure | SubFigure: ...
+ def set_frameon(self, b: bool) -> None: ...
+ @property
+ def frameon(self) -> bool: ...
+ @frameon.setter
+ def frameon(self, b: bool) -> None: ...
+ def add_artist(self, artist: Artist, clip: bool = ...) -> Artist: ...
+ @overload
+ def add_axes(self, ax: Axes) -> Axes: ...
+ @overload
+ def add_axes(
+ self,
+ rect: tuple[float, float, float, float],
+ projection: None | str = ...,
+ polar: bool = ...,
+ **kwargs
+ ) -> Axes: ...
+
+ # TODO: docstring indicates SubplotSpec a valid arg, but none of the listed signatures appear to be that
+ @overload
+ def add_subplot(
+ self, nrows: int, ncols: int, index: int | tuple[int, int], **kwargs
+ ) -> Axes: ...
+ @overload
+ def add_subplot(self, pos: int, **kwargs) -> Axes: ...
+ @overload
+ def add_subplot(self, ax: Axes, **kwargs) -> Axes: ...
+ @overload
+ def add_subplot(self, ax: SubplotSpec, **kwargs) -> Axes: ...
+ @overload
+ def add_subplot(self, **kwargs) -> Axes: ...
+ @overload
+ def subplots(
+ self,
+ nrows: Literal[1] = ...,
+ ncols: Literal[1] = ...,
+ *,
+ sharex: bool | Literal["none", "all", "row", "col"] = ...,
+ sharey: bool | Literal["none", "all", "row", "col"] = ...,
+ squeeze: Literal[True] = ...,
+ width_ratios: Sequence[float] | None = ...,
+ height_ratios: Sequence[float] | None = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ ) -> Axes: ...
+ @overload
+ def subplots(
+ self,
+ nrows: int = ...,
+ ncols: int = ...,
+ *,
+ sharex: bool | Literal["none", "all", "row", "col"] = ...,
+ sharey: bool | Literal["none", "all", "row", "col"] = ...,
+ squeeze: Literal[False],
+ width_ratios: Sequence[float] | None = ...,
+ height_ratios: Sequence[float] | None = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ ) -> np.ndarray: ... # TODO numpy/numpy#24738
+ @overload
+ def subplots(
+ self,
+ nrows: int = ...,
+ ncols: int = ...,
+ *,
+ sharex: bool | Literal["none", "all", "row", "col"] = ...,
+ sharey: bool | Literal["none", "all", "row", "col"] = ...,
+ squeeze: bool = ...,
+ width_ratios: Sequence[float] | None = ...,
+ height_ratios: Sequence[float] | None = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ ) -> Any: ...
+ def delaxes(self, ax: Axes) -> None: ...
+ def clear(self, keep_observers: bool = ...) -> None: ...
+ def clf(self, keep_observers: bool = ...) -> None: ...
+
+ @overload
+ def legend(self) -> Legend: ...
+ @overload
+ def legend(self, handles: Iterable[Artist], labels: Iterable[str], **kwargs) -> Legend: ...
+ @overload
+ def legend(self, *, handles: Iterable[Artist], **kwargs) -> Legend: ...
+ @overload
+ def legend(self, labels: Iterable[str], **kwargs) -> Legend: ...
+ @overload
+ def legend(self, **kwargs) -> Legend: ...
+
+ def text(
+ self,
+ x: float,
+ y: float,
+ s: str,
+ fontdict: dict[str, Any] | None = ...,
+ **kwargs
+ ) -> Text: ...
+ def colorbar(
+ self,
+ mappable: ScalarMappable | ColorizingArtist,
+ cax: Axes | None = ...,
+ ax: Axes | Iterable[Axes] | None = ...,
+ use_gridspec: bool = ...,
+ **kwargs
+ ) -> Colorbar: ...
+ def subplots_adjust(
+ self,
+ left: float | None = ...,
+ bottom: float | None = ...,
+ right: float | None = ...,
+ top: float | None = ...,
+ wspace: float | None = ...,
+ hspace: float | None = ...,
+ ) -> None: ...
+ def align_xlabels(self, axs: Iterable[Axes] | None = ...) -> None: ...
+ def align_ylabels(self, axs: Iterable[Axes] | None = ...) -> None: ...
+ def align_titles(self, axs: Iterable[Axes] | None = ...) -> None: ...
+ def align_labels(self, axs: Iterable[Axes] | None = ...) -> None: ...
+ def add_gridspec(self, nrows: int = ..., ncols: int = ..., **kwargs) -> GridSpec: ...
+ @overload
+ def subfigures(
+ self,
+ nrows: int = ...,
+ ncols: int = ...,
+ squeeze: Literal[False] = ...,
+ wspace: float | None = ...,
+ hspace: float | None = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ **kwargs
+ ) -> np.ndarray: ...
+ @overload
+ def subfigures(
+ self,
+ nrows: int = ...,
+ ncols: int = ...,
+ squeeze: Literal[True] = ...,
+ wspace: float | None = ...,
+ hspace: float | None = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ **kwargs
+ ) -> np.ndarray | SubFigure: ...
+ def add_subfigure(self, subplotspec: SubplotSpec, **kwargs) -> SubFigure: ...
+ def sca(self, a: Axes) -> Axes: ...
+ def gca(self) -> Axes: ...
+ def _gci(self) -> ColorizingArtist | None: ...
+ def _process_projection_requirements(
+ self, *, axes_class=None, polar=False, projection=None, **kwargs
+ ) -> tuple[type[Axes], dict[str, Any]]: ...
+ def get_default_bbox_extra_artists(self) -> list[Artist]: ...
+ def get_tightbbox(
+ self,
+ renderer: RendererBase | None = ...,
+ *,
+ bbox_extra_artists: Iterable[Artist] | None = ...,
+ ) -> Bbox: ...
+ @overload
+ def subplot_mosaic(
+ self,
+ mosaic: str,
+ *,
+ sharex: bool = ...,
+ sharey: bool = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ empty_sentinel: str = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ per_subplot_kw: dict[str | tuple[str, ...], dict[str, Any]] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ ) -> dict[str, Axes]: ...
+ @overload
+ def subplot_mosaic(
+ self,
+ mosaic: list[HashableList[_T]],
+ *,
+ sharex: bool = ...,
+ sharey: bool = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ empty_sentinel: _T = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ per_subplot_kw: dict[_T | tuple[_T, ...], dict[str, Any]] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ ) -> dict[_T, Axes]: ...
+ @overload
+ def subplot_mosaic(
+ self,
+ mosaic: list[HashableList[Hashable]],
+ *,
+ sharex: bool = ...,
+ sharey: bool = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ empty_sentinel: Any = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ per_subplot_kw: dict[Hashable | tuple[Hashable, ...], dict[str, Any]] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ ) -> dict[Hashable, Axes]: ...
+
+class SubFigure(FigureBase):
+ @property
+ def figure(self) -> Figure: ...
+ subplotpars: SubplotParams
+ dpi_scale_trans: Affine2D
+ transFigure: Transform
+ bbox_relative: Bbox
+ figbbox: BboxBase
+ bbox: BboxBase
+ transSubfigure: Transform
+ patch: Rectangle
+ def __init__(
+ self,
+ parent: Figure | SubFigure,
+ subplotspec: SubplotSpec,
+ *,
+ facecolor: ColorType | None = ...,
+ edgecolor: ColorType | None = ...,
+ linewidth: float = ...,
+ frameon: bool | None = ...,
+ **kwargs
+ ) -> None: ...
+ @property
+ def canvas(self) -> FigureCanvasBase: ...
+ @property
+ def dpi(self) -> float: ...
+ @dpi.setter
+ def dpi(self, value: float) -> None: ...
+ def get_dpi(self) -> float: ...
+ def set_dpi(self, val) -> None: ...
+ def get_constrained_layout(self) -> bool: ...
+ def get_constrained_layout_pads(
+ self, relative: bool = ...
+ ) -> tuple[float, float, float, float]: ...
+ def get_layout_engine(self) -> LayoutEngine: ...
+ @property # type: ignore[misc]
+ def axes(self) -> list[Axes]: ... # type: ignore[override]
+ def get_axes(self) -> list[Axes]: ...
+
+class Figure(FigureBase):
+ @property
+ def figure(self) -> Figure: ...
+ bbox_inches: Bbox
+ dpi_scale_trans: Affine2D
+ bbox: BboxBase
+ figbbox: BboxBase
+ transFigure: Transform
+ transSubfigure: Transform
+ patch: Rectangle
+ subplotpars: SubplotParams
+ def __init__(
+ self,
+ figsize: tuple[float, float] | None = ...,
+ dpi: float | None = ...,
+ *,
+ facecolor: ColorType | None = ...,
+ edgecolor: ColorType | None = ...,
+ linewidth: float = ...,
+ frameon: bool | None = ...,
+ subplotpars: SubplotParams | None = ...,
+ tight_layout: bool | dict[str, Any] | None = ...,
+ constrained_layout: bool | dict[str, Any] | None = ...,
+ layout: Literal["constrained", "compressed", "tight"]
+ | LayoutEngine
+ | None = ...,
+ **kwargs
+ ) -> None: ...
+ def pick(self, mouseevent: MouseEvent) -> None: ...
+ def set_layout_engine(
+ self,
+ layout: Literal["constrained", "compressed", "tight", "none"]
+ | LayoutEngine
+ | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_layout_engine(self) -> LayoutEngine | None: ...
+ def _repr_html_(self) -> str | None: ...
+ def show(self, warn: bool = ...) -> None: ...
+ @property
+ def number(self) -> int | str: ...
+ @number.setter
+ def number(self, num: int | str) -> None: ...
+ @property # type: ignore[misc]
+ def axes(self) -> list[Axes]: ... # type: ignore[override]
+ def get_axes(self) -> list[Axes]: ...
+ @property
+ def dpi(self) -> float: ...
+ @dpi.setter
+ def dpi(self, dpi: float) -> None: ...
+ def get_tight_layout(self) -> bool: ...
+ def get_constrained_layout_pads(
+ self, relative: bool = ...
+ ) -> tuple[float, float, float, float]: ...
+ def get_constrained_layout(self) -> bool: ...
+ canvas: FigureCanvasBase
+ def set_canvas(self, canvas: FigureCanvasBase) -> None: ...
+ def figimage(
+ self,
+ X: ArrayLike,
+ xo: int = ...,
+ yo: int = ...,
+ alpha: float | None = ...,
+ norm: str | Normalize | None = ...,
+ cmap: str | Colormap | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ origin: Literal["upper", "lower"] | None = ...,
+ resize: bool = ...,
+ *,
+ colorizer: Colorizer | None = ...,
+ **kwargs
+ ) -> FigureImage: ...
+ def set_size_inches(
+ self, w: float | tuple[float, float], h: float | None = ..., forward: bool = ...
+ ) -> None: ...
+ def get_size_inches(self) -> np.ndarray: ...
+ def get_figwidth(self) -> float: ...
+ def get_figheight(self) -> float: ...
+ def get_dpi(self) -> float: ...
+ def set_dpi(self, val: float) -> None: ...
+ def set_figwidth(self, val: float, forward: bool = ...) -> None: ...
+ def set_figheight(self, val: float, forward: bool = ...) -> None: ...
+ def clear(self, keep_observers: bool = ...) -> None: ...
+ def draw_without_rendering(self) -> None: ...
+ def draw_artist(self, a: Artist) -> None: ...
+ def add_axobserver(self, func: Callable[[Figure], Any]) -> None: ...
+ def savefig(
+ self,
+ fname: str | os.PathLike | IO,
+ *,
+ transparent: bool | None = ...,
+ **kwargs
+ ) -> None: ...
+ def ginput(
+ self,
+ n: int = ...,
+ timeout: float = ...,
+ show_clicks: bool = ...,
+ mouse_add: MouseButton = ...,
+ mouse_pop: MouseButton = ...,
+ mouse_stop: MouseButton = ...,
+ ) -> list[tuple[int, int]]: ...
+ def waitforbuttonpress(self, timeout: float = ...) -> None | bool: ...
+ def tight_layout(
+ self,
+ *,
+ pad: float = ...,
+ h_pad: float | None = ...,
+ w_pad: float | None = ...,
+ rect: tuple[float, float, float, float] | None = ...
+ ) -> None: ...
+
+def figaspect(
+ arg: float | ArrayLike,
+) -> np.ndarray[tuple[Literal[2]], np.dtype[np.float64]]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/font_manager.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/font_manager.py
new file mode 100644
index 0000000000000000000000000000000000000000..9aa8dccde444b8998f34ded5cd9cfe07e7b46f6a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/font_manager.py
@@ -0,0 +1,1645 @@
+"""
+A module for finding, managing, and using fonts across platforms.
+
+This module provides a single `FontManager` instance, ``fontManager``, that can
+be shared across backends and platforms. The `findfont`
+function returns the best TrueType (TTF) font file in the local or
+system font path that matches the specified `FontProperties`
+instance. The `FontManager` also handles Adobe Font Metrics
+(AFM) font files for use by the PostScript backend.
+The `FontManager.addfont` function adds a custom font from a file without
+installing it into your operating system.
+
+The design is based on the `W3C Cascading Style Sheet, Level 1 (CSS1)
+font specification `_.
+Future versions may implement the Level 2 or 2.1 specifications.
+"""
+
+# KNOWN ISSUES
+#
+# - documentation
+# - font variant is untested
+# - font stretch is incomplete
+# - font size is incomplete
+# - default font algorithm needs improvement and testing
+# - setWeights function needs improvement
+# - 'light' is an invalid weight value, remove it.
+
+from __future__ import annotations
+
+from base64 import b64encode
+import copy
+import dataclasses
+from functools import lru_cache
+import functools
+from io import BytesIO
+import json
+import logging
+from numbers import Number
+import os
+from pathlib import Path
+import plistlib
+import re
+import subprocess
+import sys
+import threading
+
+import matplotlib as mpl
+from matplotlib import _api, _afm, cbook, ft2font
+from matplotlib._fontconfig_pattern import (
+ parse_fontconfig_pattern, generate_fontconfig_pattern)
+from matplotlib.rcsetup import _validators
+
+_log = logging.getLogger(__name__)
+
+font_scalings = {
+ 'xx-small': 0.579,
+ 'x-small': 0.694,
+ 'small': 0.833,
+ 'medium': 1.0,
+ 'large': 1.200,
+ 'x-large': 1.440,
+ 'xx-large': 1.728,
+ 'larger': 1.2,
+ 'smaller': 0.833,
+ None: 1.0,
+}
+stretch_dict = {
+ 'ultra-condensed': 100,
+ 'extra-condensed': 200,
+ 'condensed': 300,
+ 'semi-condensed': 400,
+ 'normal': 500,
+ 'semi-expanded': 600,
+ 'semi-extended': 600,
+ 'expanded': 700,
+ 'extended': 700,
+ 'extra-expanded': 800,
+ 'extra-extended': 800,
+ 'ultra-expanded': 900,
+ 'ultra-extended': 900,
+}
+weight_dict = {
+ 'ultralight': 100,
+ 'light': 200,
+ 'normal': 400,
+ 'regular': 400,
+ 'book': 400,
+ 'medium': 500,
+ 'roman': 500,
+ 'semibold': 600,
+ 'demibold': 600,
+ 'demi': 600,
+ 'bold': 700,
+ 'heavy': 800,
+ 'extra bold': 800,
+ 'black': 900,
+}
+_weight_regexes = [
+ # From fontconfig's FcFreeTypeQueryFaceInternal; not the same as
+ # weight_dict!
+ ("thin", 100),
+ ("extralight", 200),
+ ("ultralight", 200),
+ ("demilight", 350),
+ ("semilight", 350),
+ ("light", 300), # Needs to come *after* demi/semilight!
+ ("book", 380),
+ ("regular", 400),
+ ("normal", 400),
+ ("medium", 500),
+ ("demibold", 600),
+ ("demi", 600),
+ ("semibold", 600),
+ ("extrabold", 800),
+ ("superbold", 800),
+ ("ultrabold", 800),
+ ("bold", 700), # Needs to come *after* extra/super/ultrabold!
+ ("ultrablack", 1000),
+ ("superblack", 1000),
+ ("extrablack", 1000),
+ (r"\bultra", 1000),
+ ("black", 900), # Needs to come *after* ultra/super/extrablack!
+ ("heavy", 900),
+]
+font_family_aliases = {
+ 'serif',
+ 'sans-serif',
+ 'sans serif',
+ 'cursive',
+ 'fantasy',
+ 'monospace',
+ 'sans',
+}
+
+# OS Font paths
+try:
+ _HOME = Path.home()
+except Exception: # Exceptions thrown by home() are not specified...
+ _HOME = Path(os.devnull) # Just an arbitrary path with no children.
+MSFolders = \
+ r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'
+MSFontDirectories = [
+ r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts',
+ r'SOFTWARE\Microsoft\Windows\CurrentVersion\Fonts']
+MSUserFontDirectories = [
+ str(_HOME / 'AppData/Local/Microsoft/Windows/Fonts'),
+ str(_HOME / 'AppData/Roaming/Microsoft/Windows/Fonts'),
+]
+X11FontDirectories = [
+ # an old standard installation point
+ "/usr/X11R6/lib/X11/fonts/TTF/",
+ "/usr/X11/lib/X11/fonts",
+ # here is the new standard location for fonts
+ "/usr/share/fonts/",
+ # documented as a good place to install new fonts
+ "/usr/local/share/fonts/",
+ # common application, not really useful
+ "/usr/lib/openoffice/share/fonts/truetype/",
+ # user fonts
+ str((Path(os.environ.get('XDG_DATA_HOME') or _HOME / ".local/share"))
+ / "fonts"),
+ str(_HOME / ".fonts"),
+]
+OSXFontDirectories = [
+ "/Library/Fonts/",
+ "/Network/Library/Fonts/",
+ "/System/Library/Fonts/",
+ # fonts installed via MacPorts
+ "/opt/local/share/fonts",
+ # user fonts
+ str(_HOME / "Library/Fonts"),
+]
+
+
+def get_fontext_synonyms(fontext):
+ """
+ Return a list of file extensions that are synonyms for
+ the given file extension *fileext*.
+ """
+ return {
+ 'afm': ['afm'],
+ 'otf': ['otf', 'ttc', 'ttf'],
+ 'ttc': ['otf', 'ttc', 'ttf'],
+ 'ttf': ['otf', 'ttc', 'ttf'],
+ }[fontext]
+
+
+def list_fonts(directory, extensions):
+ """
+ Return a list of all fonts matching any of the extensions, found
+ recursively under the directory.
+ """
+ extensions = ["." + ext for ext in extensions]
+ return [os.path.join(dirpath, filename)
+ # os.walk ignores access errors, unlike Path.glob.
+ for dirpath, _, filenames in os.walk(directory)
+ for filename in filenames
+ if Path(filename).suffix.lower() in extensions]
+
+
+def win32FontDirectory():
+ r"""
+ Return the user-specified font directory for Win32. This is
+ looked up from the registry key ::
+
+ \\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Fonts
+
+ If the key is not found, ``%WINDIR%\Fonts`` will be returned.
+ """ # noqa: E501
+ import winreg
+ try:
+ with winreg.OpenKey(winreg.HKEY_CURRENT_USER, MSFolders) as user:
+ return winreg.QueryValueEx(user, 'Fonts')[0]
+ except OSError:
+ return os.path.join(os.environ['WINDIR'], 'Fonts')
+
+
+def _get_win32_installed_fonts():
+ """List the font paths known to the Windows registry."""
+ import winreg
+ items = set()
+ # Search and resolve fonts listed in the registry.
+ for domain, base_dirs in [
+ (winreg.HKEY_LOCAL_MACHINE, [win32FontDirectory()]), # System.
+ (winreg.HKEY_CURRENT_USER, MSUserFontDirectories), # User.
+ ]:
+ for base_dir in base_dirs:
+ for reg_path in MSFontDirectories:
+ try:
+ with winreg.OpenKey(domain, reg_path) as local:
+ for j in range(winreg.QueryInfoKey(local)[1]):
+ # value may contain the filename of the font or its
+ # absolute path.
+ key, value, tp = winreg.EnumValue(local, j)
+ if not isinstance(value, str):
+ continue
+ try:
+ # If value contains already an absolute path,
+ # then it is not changed further.
+ path = Path(base_dir, value).resolve()
+ except RuntimeError:
+ # Don't fail with invalid entries.
+ continue
+ items.add(path)
+ except (OSError, MemoryError):
+ continue
+ return items
+
+
+@lru_cache
+def _get_fontconfig_fonts():
+ """Cache and list the font paths known to ``fc-list``."""
+ try:
+ if b'--format' not in subprocess.check_output(['fc-list', '--help']):
+ _log.warning( # fontconfig 2.7 implemented --format.
+ 'Matplotlib needs fontconfig>=2.7 to query system fonts.')
+ return []
+ out = subprocess.check_output(['fc-list', '--format=%{file}\\n'])
+ except (OSError, subprocess.CalledProcessError):
+ return []
+ return [Path(os.fsdecode(fname)) for fname in out.split(b'\n')]
+
+
+@lru_cache
+def _get_macos_fonts():
+ """Cache and list the font paths known to ``system_profiler SPFontsDataType``."""
+ try:
+ d, = plistlib.loads(
+ subprocess.check_output(["system_profiler", "-xml", "SPFontsDataType"]))
+ except (OSError, subprocess.CalledProcessError, plistlib.InvalidFileException):
+ return []
+ return [Path(entry["path"]) for entry in d["_items"]]
+
+
+def findSystemFonts(fontpaths=None, fontext='ttf'):
+ """
+ Search for fonts in the specified font paths. If no paths are
+ given, will use a standard set of system paths, as well as the
+ list of fonts tracked by fontconfig if fontconfig is installed and
+ available. A list of TrueType fonts are returned by default with
+ AFM fonts as an option.
+ """
+ fontfiles = set()
+ fontexts = get_fontext_synonyms(fontext)
+
+ if fontpaths is None:
+ if sys.platform == 'win32':
+ installed_fonts = _get_win32_installed_fonts()
+ fontpaths = []
+ else:
+ installed_fonts = _get_fontconfig_fonts()
+ if sys.platform == 'darwin':
+ installed_fonts += _get_macos_fonts()
+ fontpaths = [*X11FontDirectories, *OSXFontDirectories]
+ else:
+ fontpaths = X11FontDirectories
+ fontfiles.update(str(path) for path in installed_fonts
+ if path.suffix.lower()[1:] in fontexts)
+
+ elif isinstance(fontpaths, str):
+ fontpaths = [fontpaths]
+
+ for path in fontpaths:
+ fontfiles.update(map(os.path.abspath, list_fonts(path, fontexts)))
+
+ return [fname for fname in fontfiles if os.path.exists(fname)]
+
+
+@dataclasses.dataclass(frozen=True)
+class FontEntry:
+ """
+ A class for storing Font properties.
+
+ It is used when populating the font lookup dictionary.
+ """
+
+ fname: str = ''
+ name: str = ''
+ style: str = 'normal'
+ variant: str = 'normal'
+ weight: str | int = 'normal'
+ stretch: str = 'normal'
+ size: str = 'medium'
+
+ def _repr_html_(self) -> str:
+ png_stream = self._repr_png_()
+ png_b64 = b64encode(png_stream).decode()
+ return f" "
+
+ def _repr_png_(self) -> bytes:
+ from matplotlib.figure import Figure # Circular import.
+ fig = Figure()
+ font_path = Path(self.fname) if self.fname != '' else None
+ fig.text(0, 0, self.name, font=font_path)
+ with BytesIO() as buf:
+ fig.savefig(buf, bbox_inches='tight', transparent=True)
+ return buf.getvalue()
+
+
+def ttfFontProperty(font):
+ """
+ Extract information from a TrueType font file.
+
+ Parameters
+ ----------
+ font : `.FT2Font`
+ The TrueType font file from which information will be extracted.
+
+ Returns
+ -------
+ `FontEntry`
+ The extracted font properties.
+
+ """
+ name = font.family_name
+
+ # Styles are: italic, oblique, and normal (default)
+
+ sfnt = font.get_sfnt()
+ mac_key = (1, # platform: macintosh
+ 0, # id: roman
+ 0) # langid: english
+ ms_key = (3, # platform: microsoft
+ 1, # id: unicode_cs
+ 0x0409) # langid: english_united_states
+
+ # These tables are actually mac_roman-encoded, but mac_roman support may be
+ # missing in some alternative Python implementations and we are only going
+ # to look for ASCII substrings, where any ASCII-compatible encoding works
+ # - or big-endian UTF-16, since important Microsoft fonts use that.
+ sfnt2 = (sfnt.get((*mac_key, 2), b'').decode('latin-1').lower() or
+ sfnt.get((*ms_key, 2), b'').decode('utf_16_be').lower())
+ sfnt4 = (sfnt.get((*mac_key, 4), b'').decode('latin-1').lower() or
+ sfnt.get((*ms_key, 4), b'').decode('utf_16_be').lower())
+
+ if sfnt4.find('oblique') >= 0:
+ style = 'oblique'
+ elif sfnt4.find('italic') >= 0:
+ style = 'italic'
+ elif sfnt2.find('regular') >= 0:
+ style = 'normal'
+ elif ft2font.StyleFlags.ITALIC in font.style_flags:
+ style = 'italic'
+ else:
+ style = 'normal'
+
+ # Variants are: small-caps and normal (default)
+
+ # !!!! Untested
+ if name.lower() in ['capitals', 'small-caps']:
+ variant = 'small-caps'
+ else:
+ variant = 'normal'
+
+ # The weight-guessing algorithm is directly translated from fontconfig
+ # 2.13.1's FcFreeTypeQueryFaceInternal (fcfreetype.c).
+ wws_subfamily = 22
+ typographic_subfamily = 16
+ font_subfamily = 2
+ styles = [
+ sfnt.get((*mac_key, wws_subfamily), b'').decode('latin-1'),
+ sfnt.get((*mac_key, typographic_subfamily), b'').decode('latin-1'),
+ sfnt.get((*mac_key, font_subfamily), b'').decode('latin-1'),
+ sfnt.get((*ms_key, wws_subfamily), b'').decode('utf-16-be'),
+ sfnt.get((*ms_key, typographic_subfamily), b'').decode('utf-16-be'),
+ sfnt.get((*ms_key, font_subfamily), b'').decode('utf-16-be'),
+ ]
+ styles = [*filter(None, styles)] or [font.style_name]
+
+ def get_weight(): # From fontconfig's FcFreeTypeQueryFaceInternal.
+ # OS/2 table weight.
+ os2 = font.get_sfnt_table("OS/2")
+ if os2 and os2["version"] != 0xffff:
+ return os2["usWeightClass"]
+ # PostScript font info weight.
+ try:
+ ps_font_info_weight = (
+ font.get_ps_font_info()["weight"].replace(" ", "") or "")
+ except ValueError:
+ pass
+ else:
+ for regex, weight in _weight_regexes:
+ if re.fullmatch(regex, ps_font_info_weight, re.I):
+ return weight
+ # Style name weight.
+ for style in styles:
+ style = style.replace(" ", "")
+ for regex, weight in _weight_regexes:
+ if re.search(regex, style, re.I):
+ return weight
+ if ft2font.StyleFlags.BOLD in font.style_flags:
+ return 700 # "bold"
+ return 500 # "medium", not "regular"!
+
+ weight = int(get_weight())
+
+ # Stretch can be absolute and relative
+ # Absolute stretches are: ultra-condensed, extra-condensed, condensed,
+ # semi-condensed, normal, semi-expanded, expanded, extra-expanded,
+ # and ultra-expanded.
+ # Relative stretches are: wider, narrower
+ # Child value is: inherit
+
+ if any(word in sfnt4 for word in ['narrow', 'condensed', 'cond']):
+ stretch = 'condensed'
+ elif 'demi cond' in sfnt4:
+ stretch = 'semi-condensed'
+ elif any(word in sfnt4 for word in ['wide', 'expanded', 'extended']):
+ stretch = 'expanded'
+ else:
+ stretch = 'normal'
+
+ # Sizes can be absolute and relative.
+ # Absolute sizes are: xx-small, x-small, small, medium, large, x-large,
+ # and xx-large.
+ # Relative sizes are: larger, smaller
+ # Length value is an absolute font size, e.g., 12pt
+ # Percentage values are in 'em's. Most robust specification.
+
+ if not font.scalable:
+ raise NotImplementedError("Non-scalable fonts are not supported")
+ size = 'scalable'
+
+ return FontEntry(font.fname, name, style, variant, weight, stretch, size)
+
+
+def afmFontProperty(fontpath, font):
+ """
+ Extract information from an AFM font file.
+
+ Parameters
+ ----------
+ fontpath : str
+ The filename corresponding to *font*.
+ font : AFM
+ The AFM font file from which information will be extracted.
+
+ Returns
+ -------
+ `FontEntry`
+ The extracted font properties.
+ """
+
+ name = font.get_familyname()
+ fontname = font.get_fontname().lower()
+
+ # Styles are: italic, oblique, and normal (default)
+
+ if font.get_angle() != 0 or 'italic' in name.lower():
+ style = 'italic'
+ elif 'oblique' in name.lower():
+ style = 'oblique'
+ else:
+ style = 'normal'
+
+ # Variants are: small-caps and normal (default)
+
+ # !!!! Untested
+ if name.lower() in ['capitals', 'small-caps']:
+ variant = 'small-caps'
+ else:
+ variant = 'normal'
+
+ weight = font.get_weight().lower()
+ if weight not in weight_dict:
+ weight = 'normal'
+
+ # Stretch can be absolute and relative
+ # Absolute stretches are: ultra-condensed, extra-condensed, condensed,
+ # semi-condensed, normal, semi-expanded, expanded, extra-expanded,
+ # and ultra-expanded.
+ # Relative stretches are: wider, narrower
+ # Child value is: inherit
+ if 'demi cond' in fontname:
+ stretch = 'semi-condensed'
+ elif any(word in fontname for word in ['narrow', 'cond']):
+ stretch = 'condensed'
+ elif any(word in fontname for word in ['wide', 'expanded', 'extended']):
+ stretch = 'expanded'
+ else:
+ stretch = 'normal'
+
+ # Sizes can be absolute and relative.
+ # Absolute sizes are: xx-small, x-small, small, medium, large, x-large,
+ # and xx-large.
+ # Relative sizes are: larger, smaller
+ # Length value is an absolute font size, e.g., 12pt
+ # Percentage values are in 'em's. Most robust specification.
+
+ # All AFM fonts are apparently scalable.
+
+ size = 'scalable'
+
+ return FontEntry(fontpath, name, style, variant, weight, stretch, size)
+
+
+def _cleanup_fontproperties_init(init_method):
+ """
+ A decorator to limit the call signature to single a positional argument
+ or alternatively only keyword arguments.
+
+ We still accept but deprecate all other call signatures.
+
+ When the deprecation expires we can switch the signature to::
+
+ __init__(self, pattern=None, /, *, family=None, style=None, ...)
+
+ plus a runtime check that pattern is not used alongside with the
+ keyword arguments. This results eventually in the two possible
+ call signatures::
+
+ FontProperties(pattern)
+ FontProperties(family=..., size=..., ...)
+
+ """
+ @functools.wraps(init_method)
+ def wrapper(self, *args, **kwargs):
+ # multiple args with at least some positional ones
+ if len(args) > 1 or len(args) == 1 and kwargs:
+ # Note: Both cases were previously handled as individual properties.
+ # Therefore, we do not mention the case of font properties here.
+ _api.warn_deprecated(
+ "3.10",
+ message="Passing individual properties to FontProperties() "
+ "positionally was deprecated in Matplotlib %(since)s and "
+ "will be removed in %(removal)s. Please pass all properties "
+ "via keyword arguments."
+ )
+ # single non-string arg -> clearly a family not a pattern
+ if len(args) == 1 and not kwargs and not cbook.is_scalar_or_string(args[0]):
+ # Case font-family list passed as single argument
+ _api.warn_deprecated(
+ "3.10",
+ message="Passing family as positional argument to FontProperties() "
+ "was deprecated in Matplotlib %(since)s and will be removed "
+ "in %(removal)s. Please pass family names as keyword"
+ "argument."
+ )
+ # Note on single string arg:
+ # This has been interpreted as pattern so far. We are already raising if a
+ # non-pattern compatible family string was given. Therefore, we do not need
+ # to warn for this case.
+ return init_method(self, *args, **kwargs)
+
+ return wrapper
+
+
+class FontProperties:
+ """
+ A class for storing and manipulating font properties.
+
+ The font properties are the six properties described in the
+ `W3C Cascading Style Sheet, Level 1
+ `_ font
+ specification and *math_fontfamily* for math fonts:
+
+ - family: A list of font names in decreasing order of priority.
+ The items may include a generic font family name, either 'sans-serif',
+ 'serif', 'cursive', 'fantasy', or 'monospace'. In that case, the actual
+ font to be used will be looked up from the associated rcParam during the
+ search process in `.findfont`. Default: :rc:`font.family`
+
+ - style: Either 'normal', 'italic' or 'oblique'.
+ Default: :rc:`font.style`
+
+ - variant: Either 'normal' or 'small-caps'.
+ Default: :rc:`font.variant`
+
+ - stretch: A numeric value in the range 0-1000 or one of
+ 'ultra-condensed', 'extra-condensed', 'condensed',
+ 'semi-condensed', 'normal', 'semi-expanded', 'expanded',
+ 'extra-expanded' or 'ultra-expanded'. Default: :rc:`font.stretch`
+
+ - weight: A numeric value in the range 0-1000 or one of
+ 'ultralight', 'light', 'normal', 'regular', 'book', 'medium',
+ 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy',
+ 'extra bold', 'black'. Default: :rc:`font.weight`
+
+ - size: Either a relative value of 'xx-small', 'x-small',
+ 'small', 'medium', 'large', 'x-large', 'xx-large' or an
+ absolute font size, e.g., 10. Default: :rc:`font.size`
+
+ - math_fontfamily: The family of fonts used to render math text.
+ Supported values are: 'dejavusans', 'dejavuserif', 'cm',
+ 'stix', 'stixsans' and 'custom'. Default: :rc:`mathtext.fontset`
+
+ Alternatively, a font may be specified using the absolute path to a font
+ file, by using the *fname* kwarg. However, in this case, it is typically
+ simpler to just pass the path (as a `pathlib.Path`, not a `str`) to the
+ *font* kwarg of the `.Text` object.
+
+ The preferred usage of font sizes is to use the relative values,
+ e.g., 'large', instead of absolute font sizes, e.g., 12. This
+ approach allows all text sizes to be made larger or smaller based
+ on the font manager's default font size.
+
+ This class accepts a single positional string as fontconfig_ pattern_,
+ or alternatively individual properties as keyword arguments::
+
+ FontProperties(pattern)
+ FontProperties(*, family=None, style=None, variant=None, ...)
+
+ This support does not depend on fontconfig; we are merely borrowing its
+ pattern syntax for use here.
+
+ .. _fontconfig: https://www.freedesktop.org/wiki/Software/fontconfig/
+ .. _pattern:
+ https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
+
+ Note that Matplotlib's internal font manager and fontconfig use a
+ different algorithm to lookup fonts, so the results of the same pattern
+ may be different in Matplotlib than in other applications that use
+ fontconfig.
+ """
+
+ @_cleanup_fontproperties_init
+ def __init__(self, family=None, style=None, variant=None, weight=None,
+ stretch=None, size=None,
+ fname=None, # if set, it's a hardcoded filename to use
+ math_fontfamily=None):
+ self.set_family(family)
+ self.set_style(style)
+ self.set_variant(variant)
+ self.set_weight(weight)
+ self.set_stretch(stretch)
+ self.set_file(fname)
+ self.set_size(size)
+ self.set_math_fontfamily(math_fontfamily)
+ # Treat family as a fontconfig pattern if it is the only parameter
+ # provided. Even in that case, call the other setters first to set
+ # attributes not specified by the pattern to the rcParams defaults.
+ if (isinstance(family, str)
+ and style is None and variant is None and weight is None
+ and stretch is None and size is None and fname is None):
+ self.set_fontconfig_pattern(family)
+
+ @classmethod
+ def _from_any(cls, arg):
+ """
+ Generic constructor which can build a `.FontProperties` from any of the
+ following:
+
+ - a `.FontProperties`: it is passed through as is;
+ - `None`: a `.FontProperties` using rc values is used;
+ - an `os.PathLike`: it is used as path to the font file;
+ - a `str`: it is parsed as a fontconfig pattern;
+ - a `dict`: it is passed as ``**kwargs`` to `.FontProperties`.
+ """
+ if arg is None:
+ return cls()
+ elif isinstance(arg, cls):
+ return arg
+ elif isinstance(arg, os.PathLike):
+ return cls(fname=arg)
+ elif isinstance(arg, str):
+ return cls(arg)
+ else:
+ return cls(**arg)
+
+ def __hash__(self):
+ l = (tuple(self.get_family()),
+ self.get_slant(),
+ self.get_variant(),
+ self.get_weight(),
+ self.get_stretch(),
+ self.get_size(),
+ self.get_file(),
+ self.get_math_fontfamily())
+ return hash(l)
+
+ def __eq__(self, other):
+ return hash(self) == hash(other)
+
+ def __str__(self):
+ return self.get_fontconfig_pattern()
+
+ def get_family(self):
+ """
+ Return a list of individual font family names or generic family names.
+
+ The font families or generic font families (which will be resolved
+ from their respective rcParams when searching for a matching font) in
+ the order of preference.
+ """
+ return self._family
+
+ def get_name(self):
+ """
+ Return the name of the font that best matches the font properties.
+ """
+ return get_font(findfont(self)).family_name
+
+ def get_style(self):
+ """
+ Return the font style. Values are: 'normal', 'italic' or 'oblique'.
+ """
+ return self._slant
+
+ def get_variant(self):
+ """
+ Return the font variant. Values are: 'normal' or 'small-caps'.
+ """
+ return self._variant
+
+ def get_weight(self):
+ """
+ Set the font weight. Options are: A numeric value in the
+ range 0-1000 or one of 'light', 'normal', 'regular', 'book',
+ 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold',
+ 'heavy', 'extra bold', 'black'
+ """
+ return self._weight
+
+ def get_stretch(self):
+ """
+ Return the font stretch or width. Options are: 'ultra-condensed',
+ 'extra-condensed', 'condensed', 'semi-condensed', 'normal',
+ 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'.
+ """
+ return self._stretch
+
+ def get_size(self):
+ """
+ Return the font size.
+ """
+ return self._size
+
+ def get_file(self):
+ """
+ Return the filename of the associated font.
+ """
+ return self._file
+
+ def get_fontconfig_pattern(self):
+ """
+ Get a fontconfig_ pattern_ suitable for looking up the font as
+ specified with fontconfig's ``fc-match`` utility.
+
+ This support does not depend on fontconfig; we are merely borrowing its
+ pattern syntax for use here.
+ """
+ return generate_fontconfig_pattern(self)
+
+ def set_family(self, family):
+ """
+ Change the font family. Can be either an alias (generic name
+ is CSS parlance), such as: 'serif', 'sans-serif', 'cursive',
+ 'fantasy', or 'monospace', a real font name or a list of real
+ font names. Real font names are not supported when
+ :rc:`text.usetex` is `True`. Default: :rc:`font.family`
+ """
+ if family is None:
+ family = mpl.rcParams['font.family']
+ if isinstance(family, str):
+ family = [family]
+ self._family = family
+
+ def set_style(self, style):
+ """
+ Set the font style.
+
+ Parameters
+ ----------
+ style : {'normal', 'italic', 'oblique'}, default: :rc:`font.style`
+ """
+ if style is None:
+ style = mpl.rcParams['font.style']
+ _api.check_in_list(['normal', 'italic', 'oblique'], style=style)
+ self._slant = style
+
+ def set_variant(self, variant):
+ """
+ Set the font variant.
+
+ Parameters
+ ----------
+ variant : {'normal', 'small-caps'}, default: :rc:`font.variant`
+ """
+ if variant is None:
+ variant = mpl.rcParams['font.variant']
+ _api.check_in_list(['normal', 'small-caps'], variant=variant)
+ self._variant = variant
+
+ def set_weight(self, weight):
+ """
+ Set the font weight.
+
+ Parameters
+ ----------
+ weight : int or {'ultralight', 'light', 'normal', 'regular', 'book', \
+'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', \
+'extra bold', 'black'}, default: :rc:`font.weight`
+ If int, must be in the range 0-1000.
+ """
+ if weight is None:
+ weight = mpl.rcParams['font.weight']
+ if weight in weight_dict:
+ self._weight = weight
+ return
+ try:
+ weight = int(weight)
+ except ValueError:
+ pass
+ else:
+ if 0 <= weight <= 1000:
+ self._weight = weight
+ return
+ raise ValueError(f"{weight=} is invalid")
+
+ def set_stretch(self, stretch):
+ """
+ Set the font stretch or width.
+
+ Parameters
+ ----------
+ stretch : int or {'ultra-condensed', 'extra-condensed', 'condensed', \
+'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', \
+'ultra-expanded'}, default: :rc:`font.stretch`
+ If int, must be in the range 0-1000.
+ """
+ if stretch is None:
+ stretch = mpl.rcParams['font.stretch']
+ if stretch in stretch_dict:
+ self._stretch = stretch
+ return
+ try:
+ stretch = int(stretch)
+ except ValueError:
+ pass
+ else:
+ if 0 <= stretch <= 1000:
+ self._stretch = stretch
+ return
+ raise ValueError(f"{stretch=} is invalid")
+
+ def set_size(self, size):
+ """
+ Set the font size.
+
+ Parameters
+ ----------
+ size : float or {'xx-small', 'x-small', 'small', 'medium', \
+'large', 'x-large', 'xx-large'}, default: :rc:`font.size`
+ If a float, the font size in points. The string values denote
+ sizes relative to the default font size.
+ """
+ if size is None:
+ size = mpl.rcParams['font.size']
+ try:
+ size = float(size)
+ except ValueError:
+ try:
+ scale = font_scalings[size]
+ except KeyError as err:
+ raise ValueError(
+ "Size is invalid. Valid font size are "
+ + ", ".join(map(str, font_scalings))) from err
+ else:
+ size = scale * FontManager.get_default_size()
+ if size < 1.0:
+ _log.info('Fontsize %1.2f < 1.0 pt not allowed by FreeType. '
+ 'Setting fontsize = 1 pt', size)
+ size = 1.0
+ self._size = size
+
+ def set_file(self, file):
+ """
+ Set the filename of the fontfile to use. In this case, all
+ other properties will be ignored.
+ """
+ self._file = os.fspath(file) if file is not None else None
+
+ def set_fontconfig_pattern(self, pattern):
+ """
+ Set the properties by parsing a fontconfig_ *pattern*.
+
+ This support does not depend on fontconfig; we are merely borrowing its
+ pattern syntax for use here.
+ """
+ for key, val in parse_fontconfig_pattern(pattern).items():
+ if type(val) is list:
+ getattr(self, "set_" + key)(val[0])
+ else:
+ getattr(self, "set_" + key)(val)
+
+ def get_math_fontfamily(self):
+ """
+ Return the name of the font family used for math text.
+
+ The default font is :rc:`mathtext.fontset`.
+ """
+ return self._math_fontfamily
+
+ def set_math_fontfamily(self, fontfamily):
+ """
+ Set the font family for text in math mode.
+
+ If not set explicitly, :rc:`mathtext.fontset` will be used.
+
+ Parameters
+ ----------
+ fontfamily : str
+ The name of the font family.
+
+ Available font families are defined in the
+ :ref:`default matplotlibrc file `.
+
+ See Also
+ --------
+ .text.Text.get_math_fontfamily
+ """
+ if fontfamily is None:
+ fontfamily = mpl.rcParams['mathtext.fontset']
+ else:
+ valid_fonts = _validators['mathtext.fontset'].valid.values()
+ # _check_in_list() Validates the parameter math_fontfamily as
+ # if it were passed to rcParams['mathtext.fontset']
+ _api.check_in_list(valid_fonts, math_fontfamily=fontfamily)
+ self._math_fontfamily = fontfamily
+
+ def copy(self):
+ """Return a copy of self."""
+ return copy.copy(self)
+
+ # Aliases
+ set_name = set_family
+ get_slant = get_style
+ set_slant = set_style
+ get_size_in_points = get_size
+
+
+class _JSONEncoder(json.JSONEncoder):
+ def default(self, o):
+ if isinstance(o, FontManager):
+ return dict(o.__dict__, __class__='FontManager')
+ elif isinstance(o, FontEntry):
+ d = dict(o.__dict__, __class__='FontEntry')
+ try:
+ # Cache paths of fonts shipped with Matplotlib relative to the
+ # Matplotlib data path, which helps in the presence of venvs.
+ d["fname"] = str(Path(d["fname"]).relative_to(mpl.get_data_path()))
+ except ValueError:
+ pass
+ return d
+ else:
+ return super().default(o)
+
+
+def _json_decode(o):
+ cls = o.pop('__class__', None)
+ if cls is None:
+ return o
+ elif cls == 'FontManager':
+ r = FontManager.__new__(FontManager)
+ r.__dict__.update(o)
+ return r
+ elif cls == 'FontEntry':
+ if not os.path.isabs(o['fname']):
+ o['fname'] = os.path.join(mpl.get_data_path(), o['fname'])
+ r = FontEntry(**o)
+ return r
+ else:
+ raise ValueError("Don't know how to deserialize __class__=%s" % cls)
+
+
+def json_dump(data, filename):
+ """
+ Dump `FontManager` *data* as JSON to the file named *filename*.
+
+ See Also
+ --------
+ json_load
+
+ Notes
+ -----
+ File paths that are children of the Matplotlib data path (typically, fonts
+ shipped with Matplotlib) are stored relative to that data path (to remain
+ valid across virtualenvs).
+
+ This function temporarily locks the output file to prevent multiple
+ processes from overwriting one another's output.
+ """
+ try:
+ with cbook._lock_path(filename), open(filename, 'w') as fh:
+ json.dump(data, fh, cls=_JSONEncoder, indent=2)
+ except OSError as e:
+ _log.warning('Could not save font_manager cache %s', e)
+
+
+def json_load(filename):
+ """
+ Load a `FontManager` from the JSON file named *filename*.
+
+ See Also
+ --------
+ json_dump
+ """
+ with open(filename) as fh:
+ return json.load(fh, object_hook=_json_decode)
+
+
+class FontManager:
+ """
+ On import, the `FontManager` singleton instance creates a list of ttf and
+ afm fonts and caches their `FontProperties`. The `FontManager.findfont`
+ method does a nearest neighbor search to find the font that most closely
+ matches the specification. If no good enough match is found, the default
+ font is returned.
+
+ Fonts added with the `FontManager.addfont` method will not persist in the
+ cache; therefore, `addfont` will need to be called every time Matplotlib is
+ imported. This method should only be used if and when a font cannot be
+ installed on your operating system by other means.
+
+ Notes
+ -----
+ The `FontManager.addfont` method must be called on the global `FontManager`
+ instance.
+
+ Example usage::
+
+ import matplotlib.pyplot as plt
+ from matplotlib import font_manager
+
+ font_dirs = ["/resources/fonts"] # The path to the custom font file.
+ font_files = font_manager.findSystemFonts(fontpaths=font_dirs)
+
+ for font_file in font_files:
+ font_manager.fontManager.addfont(font_file)
+ """
+ # Increment this version number whenever the font cache data
+ # format or behavior has changed and requires an existing font
+ # cache files to be rebuilt.
+ __version__ = 390
+
+ def __init__(self, size=None, weight='normal'):
+ self._version = self.__version__
+
+ self.__default_weight = weight
+ self.default_size = size
+
+ # Create list of font paths.
+ paths = [cbook._get_data_path('fonts', subdir)
+ for subdir in ['ttf', 'afm', 'pdfcorefonts']]
+ _log.debug('font search path %s', paths)
+
+ self.defaultFamily = {
+ 'ttf': 'DejaVu Sans',
+ 'afm': 'Helvetica'}
+
+ self.afmlist = []
+ self.ttflist = []
+
+ # Delay the warning by 5s.
+ timer = threading.Timer(5, lambda: _log.warning(
+ 'Matplotlib is building the font cache; this may take a moment.'))
+ timer.start()
+ try:
+ for fontext in ["afm", "ttf"]:
+ for path in [*findSystemFonts(paths, fontext=fontext),
+ *findSystemFonts(fontext=fontext)]:
+ try:
+ self.addfont(path)
+ except OSError as exc:
+ _log.info("Failed to open font file %s: %s", path, exc)
+ except Exception as exc:
+ _log.info("Failed to extract font properties from %s: "
+ "%s", path, exc)
+ finally:
+ timer.cancel()
+
+ def addfont(self, path):
+ """
+ Cache the properties of the font at *path* to make it available to the
+ `FontManager`. The type of font is inferred from the path suffix.
+
+ Parameters
+ ----------
+ path : str or path-like
+
+ Notes
+ -----
+ This method is useful for adding a custom font without installing it in
+ your operating system. See the `FontManager` singleton instance for
+ usage and caveats about this function.
+ """
+ # Convert to string in case of a path as
+ # afmFontProperty and FT2Font expect this
+ path = os.fsdecode(path)
+ if Path(path).suffix.lower() == ".afm":
+ with open(path, "rb") as fh:
+ font = _afm.AFM(fh)
+ prop = afmFontProperty(path, font)
+ self.afmlist.append(prop)
+ else:
+ font = ft2font.FT2Font(path)
+ prop = ttfFontProperty(font)
+ self.ttflist.append(prop)
+ self._findfont_cached.cache_clear()
+
+ @property
+ def defaultFont(self):
+ # Lazily evaluated (findfont then caches the result) to avoid including
+ # the venv path in the json serialization.
+ return {ext: self.findfont(family, fontext=ext)
+ for ext, family in self.defaultFamily.items()}
+
+ def get_default_weight(self):
+ """
+ Return the default font weight.
+ """
+ return self.__default_weight
+
+ @staticmethod
+ def get_default_size():
+ """
+ Return the default font size.
+ """
+ return mpl.rcParams['font.size']
+
+ def set_default_weight(self, weight):
+ """
+ Set the default font weight. The initial value is 'normal'.
+ """
+ self.__default_weight = weight
+
+ @staticmethod
+ def _expand_aliases(family):
+ if family in ('sans', 'sans serif'):
+ family = 'sans-serif'
+ return mpl.rcParams['font.' + family]
+
+ # Each of the scoring functions below should return a value between
+ # 0.0 (perfect match) and 1.0 (terrible match)
+ def score_family(self, families, family2):
+ """
+ Return a match score between the list of font families in
+ *families* and the font family name *family2*.
+
+ An exact match at the head of the list returns 0.0.
+
+ A match further down the list will return between 0 and 1.
+
+ No match will return 1.0.
+ """
+ if not isinstance(families, (list, tuple)):
+ families = [families]
+ elif len(families) == 0:
+ return 1.0
+ family2 = family2.lower()
+ step = 1 / len(families)
+ for i, family1 in enumerate(families):
+ family1 = family1.lower()
+ if family1 in font_family_aliases:
+ options = [*map(str.lower, self._expand_aliases(family1))]
+ if family2 in options:
+ idx = options.index(family2)
+ return (i + (idx / len(options))) * step
+ elif family1 == family2:
+ # The score should be weighted by where in the
+ # list the font was found.
+ return i * step
+ return 1.0
+
+ def score_style(self, style1, style2):
+ """
+ Return a match score between *style1* and *style2*.
+
+ An exact match returns 0.0.
+
+ A match between 'italic' and 'oblique' returns 0.1.
+
+ No match returns 1.0.
+ """
+ if style1 == style2:
+ return 0.0
+ elif (style1 in ('italic', 'oblique')
+ and style2 in ('italic', 'oblique')):
+ return 0.1
+ return 1.0
+
+ def score_variant(self, variant1, variant2):
+ """
+ Return a match score between *variant1* and *variant2*.
+
+ An exact match returns 0.0, otherwise 1.0.
+ """
+ if variant1 == variant2:
+ return 0.0
+ else:
+ return 1.0
+
+ def score_stretch(self, stretch1, stretch2):
+ """
+ Return a match score between *stretch1* and *stretch2*.
+
+ The result is the absolute value of the difference between the
+ CSS numeric values of *stretch1* and *stretch2*, normalized
+ between 0.0 and 1.0.
+ """
+ try:
+ stretchval1 = int(stretch1)
+ except ValueError:
+ stretchval1 = stretch_dict.get(stretch1, 500)
+ try:
+ stretchval2 = int(stretch2)
+ except ValueError:
+ stretchval2 = stretch_dict.get(stretch2, 500)
+ return abs(stretchval1 - stretchval2) / 1000.0
+
+ def score_weight(self, weight1, weight2):
+ """
+ Return a match score between *weight1* and *weight2*.
+
+ The result is 0.0 if both weight1 and weight 2 are given as strings
+ and have the same value.
+
+ Otherwise, the result is the absolute value of the difference between
+ the CSS numeric values of *weight1* and *weight2*, normalized between
+ 0.05 and 1.0.
+ """
+ # exact match of the weight names, e.g. weight1 == weight2 == "regular"
+ if cbook._str_equal(weight1, weight2):
+ return 0.0
+ w1 = weight1 if isinstance(weight1, Number) else weight_dict[weight1]
+ w2 = weight2 if isinstance(weight2, Number) else weight_dict[weight2]
+ return 0.95 * (abs(w1 - w2) / 1000) + 0.05
+
+ def score_size(self, size1, size2):
+ """
+ Return a match score between *size1* and *size2*.
+
+ If *size2* (the size specified in the font file) is 'scalable', this
+ function always returns 0.0, since any font size can be generated.
+
+ Otherwise, the result is the absolute distance between *size1* and
+ *size2*, normalized so that the usual range of font sizes (6pt -
+ 72pt) will lie between 0.0 and 1.0.
+ """
+ if size2 == 'scalable':
+ return 0.0
+ # Size value should have already been
+ try:
+ sizeval1 = float(size1)
+ except ValueError:
+ sizeval1 = self.default_size * font_scalings[size1]
+ try:
+ sizeval2 = float(size2)
+ except ValueError:
+ return 1.0
+ return abs(sizeval1 - sizeval2) / 72
+
+ def findfont(self, prop, fontext='ttf', directory=None,
+ fallback_to_default=True, rebuild_if_missing=True):
+ """
+ Find the path to the font file most closely matching the given font properties.
+
+ Parameters
+ ----------
+ prop : str or `~matplotlib.font_manager.FontProperties`
+ The font properties to search for. This can be either a
+ `.FontProperties` object or a string defining a
+ `fontconfig patterns`_.
+
+ fontext : {'ttf', 'afm'}, default: 'ttf'
+ The extension of the font file:
+
+ - 'ttf': TrueType and OpenType fonts (.ttf, .ttc, .otf)
+ - 'afm': Adobe Font Metrics (.afm)
+
+ directory : str, optional
+ If given, only search this directory and its subdirectories.
+
+ fallback_to_default : bool
+ If True, will fall back to the default font family (usually
+ "DejaVu Sans" or "Helvetica") if the first lookup hard-fails.
+
+ rebuild_if_missing : bool
+ Whether to rebuild the font cache and search again if the first
+ match appears to point to a nonexisting font (i.e., the font cache
+ contains outdated entries).
+
+ Returns
+ -------
+ str
+ The filename of the best matching font.
+
+ Notes
+ -----
+ This performs a nearest neighbor search. Each font is given a
+ similarity score to the target font properties. The first font with
+ the highest score is returned. If no matches below a certain
+ threshold are found, the default font (usually DejaVu Sans) is
+ returned.
+
+ The result is cached, so subsequent lookups don't have to
+ perform the O(n) nearest neighbor search.
+
+ See the `W3C Cascading Style Sheet, Level 1
+ `_ documentation
+ for a description of the font finding algorithm.
+
+ .. _fontconfig patterns:
+ https://www.freedesktop.org/software/fontconfig/fontconfig-user.html
+ """
+ # Pass the relevant rcParams (and the font manager, as `self`) to
+ # _findfont_cached so to prevent using a stale cache entry after an
+ # rcParam was changed.
+ rc_params = tuple(tuple(mpl.rcParams[key]) for key in [
+ "font.serif", "font.sans-serif", "font.cursive", "font.fantasy",
+ "font.monospace"])
+ ret = self._findfont_cached(
+ prop, fontext, directory, fallback_to_default, rebuild_if_missing,
+ rc_params)
+ if isinstance(ret, cbook._ExceptionInfo):
+ raise ret.to_exception()
+ return ret
+
+ def get_font_names(self):
+ """Return the list of available fonts."""
+ return list({font.name for font in self.ttflist})
+
+ def _find_fonts_by_props(self, prop, fontext='ttf', directory=None,
+ fallback_to_default=True, rebuild_if_missing=True):
+ """
+ Find the paths to the font files most closely matching the given properties.
+
+ Parameters
+ ----------
+ prop : str or `~matplotlib.font_manager.FontProperties`
+ The font properties to search for. This can be either a
+ `.FontProperties` object or a string defining a
+ `fontconfig patterns`_.
+
+ fontext : {'ttf', 'afm'}, default: 'ttf'
+ The extension of the font file:
+
+ - 'ttf': TrueType and OpenType fonts (.ttf, .ttc, .otf)
+ - 'afm': Adobe Font Metrics (.afm)
+
+ directory : str, optional
+ If given, only search this directory and its subdirectories.
+
+ fallback_to_default : bool
+ If True, will fall back to the default font family (usually
+ "DejaVu Sans" or "Helvetica") if none of the families were found.
+
+ rebuild_if_missing : bool
+ Whether to rebuild the font cache and search again if the first
+ match appears to point to a nonexisting font (i.e., the font cache
+ contains outdated entries).
+
+ Returns
+ -------
+ list[str]
+ The paths of the fonts found.
+
+ Notes
+ -----
+ This is an extension/wrapper of the original findfont API, which only
+ returns a single font for given font properties. Instead, this API
+ returns a list of filepaths of multiple fonts which closely match the
+ given font properties. Since this internally uses the original API,
+ there's no change to the logic of performing the nearest neighbor
+ search. See `findfont` for more details.
+ """
+
+ prop = FontProperties._from_any(prop)
+
+ fpaths = []
+ for family in prop.get_family():
+ cprop = prop.copy()
+ cprop.set_family(family) # set current prop's family
+
+ try:
+ fpaths.append(
+ self.findfont(
+ cprop, fontext, directory,
+ fallback_to_default=False, # don't fallback to default
+ rebuild_if_missing=rebuild_if_missing,
+ )
+ )
+ except ValueError:
+ if family in font_family_aliases:
+ _log.warning(
+ "findfont: Generic family %r not found because "
+ "none of the following families were found: %s",
+ family, ", ".join(self._expand_aliases(family))
+ )
+ else:
+ _log.warning("findfont: Font family %r not found.", family)
+
+ # only add default family if no other font was found and
+ # fallback_to_default is enabled
+ if not fpaths:
+ if fallback_to_default:
+ dfamily = self.defaultFamily[fontext]
+ cprop = prop.copy()
+ cprop.set_family(dfamily)
+ fpaths.append(
+ self.findfont(
+ cprop, fontext, directory,
+ fallback_to_default=True,
+ rebuild_if_missing=rebuild_if_missing,
+ )
+ )
+ else:
+ raise ValueError("Failed to find any font, and fallback "
+ "to the default font was disabled")
+
+ return fpaths
+
+ @lru_cache(1024)
+ def _findfont_cached(self, prop, fontext, directory, fallback_to_default,
+ rebuild_if_missing, rc_params):
+
+ prop = FontProperties._from_any(prop)
+
+ fname = prop.get_file()
+ if fname is not None:
+ return fname
+
+ if fontext == 'afm':
+ fontlist = self.afmlist
+ else:
+ fontlist = self.ttflist
+
+ best_score = 1e64
+ best_font = None
+
+ _log.debug('findfont: Matching %s.', prop)
+ for font in fontlist:
+ if (directory is not None and
+ Path(directory) not in Path(font.fname).parents):
+ continue
+ # Matching family should have top priority, so multiply it by 10.
+ score = (self.score_family(prop.get_family(), font.name) * 10
+ + self.score_style(prop.get_style(), font.style)
+ + self.score_variant(prop.get_variant(), font.variant)
+ + self.score_weight(prop.get_weight(), font.weight)
+ + self.score_stretch(prop.get_stretch(), font.stretch)
+ + self.score_size(prop.get_size(), font.size))
+ _log.debug('findfont: score(%s) = %s', font, score)
+ if score < best_score:
+ best_score = score
+ best_font = font
+ if score == 0:
+ break
+
+ if best_font is None or best_score >= 10.0:
+ if fallback_to_default:
+ _log.warning(
+ 'findfont: Font family %s not found. Falling back to %s.',
+ prop.get_family(), self.defaultFamily[fontext])
+ for family in map(str.lower, prop.get_family()):
+ if family in font_family_aliases:
+ _log.warning(
+ "findfont: Generic family %r not found because "
+ "none of the following families were found: %s",
+ family, ", ".join(self._expand_aliases(family)))
+ default_prop = prop.copy()
+ default_prop.set_family(self.defaultFamily[fontext])
+ return self.findfont(default_prop, fontext, directory,
+ fallback_to_default=False)
+ else:
+ # This return instead of raise is intentional, as we wish to
+ # cache that it was not found, which will not occur if it was
+ # actually raised.
+ return cbook._ExceptionInfo(
+ ValueError,
+ f"Failed to find font {prop}, and fallback to the default font was "
+ f"disabled"
+ )
+ else:
+ _log.debug('findfont: Matching %s to %s (%r) with score of %f.',
+ prop, best_font.name, best_font.fname, best_score)
+ result = best_font.fname
+
+ if not os.path.isfile(result):
+ if rebuild_if_missing:
+ _log.info(
+ 'findfont: Found a missing font file. Rebuilding cache.')
+ new_fm = _load_fontmanager(try_read_cache=False)
+ # Replace self by the new fontmanager, because users may have
+ # a reference to this specific instance.
+ # TODO: _load_fontmanager should really be (used by) a method
+ # modifying the instance in place.
+ vars(self).update(vars(new_fm))
+ return self.findfont(
+ prop, fontext, directory, rebuild_if_missing=False)
+ else:
+ # This return instead of raise is intentional, as we wish to
+ # cache that it was not found, which will not occur if it was
+ # actually raised.
+ return cbook._ExceptionInfo(ValueError, "No valid font could be found")
+
+ return _cached_realpath(result)
+
+
+@lru_cache
+def is_opentype_cff_font(filename):
+ """
+ Return whether the given font is a Postscript Compact Font Format Font
+ embedded in an OpenType wrapper. Used by the PostScript and PDF backends
+ that cannot subset these fonts.
+ """
+ if os.path.splitext(filename)[1].lower() == '.otf':
+ with open(filename, 'rb') as fd:
+ return fd.read(4) == b"OTTO"
+ else:
+ return False
+
+
+@lru_cache(64)
+def _get_font(font_filepaths, hinting_factor, *, _kerning_factor, thread_id):
+ first_fontpath, *rest = font_filepaths
+ return ft2font.FT2Font(
+ first_fontpath, hinting_factor,
+ _fallback_list=[
+ ft2font.FT2Font(
+ fpath, hinting_factor,
+ _kerning_factor=_kerning_factor
+ )
+ for fpath in rest
+ ],
+ _kerning_factor=_kerning_factor
+ )
+
+
+# FT2Font objects cannot be used across fork()s because they reference the same
+# FT_Library object. While invalidating *all* existing FT2Fonts after a fork
+# would be too complicated to be worth it, the main way FT2Fonts get reused is
+# via the cache of _get_font, which we can empty upon forking (not on Windows,
+# which has no fork() or register_at_fork()).
+if hasattr(os, "register_at_fork"):
+ os.register_at_fork(after_in_child=_get_font.cache_clear)
+
+
+@lru_cache(64)
+def _cached_realpath(path):
+ # Resolving the path avoids embedding the font twice in pdf/ps output if a
+ # single font is selected using two different relative paths.
+ return os.path.realpath(path)
+
+
+def get_font(font_filepaths, hinting_factor=None):
+ """
+ Get an `.ft2font.FT2Font` object given a list of file paths.
+
+ Parameters
+ ----------
+ font_filepaths : Iterable[str, Path, bytes], str, Path, bytes
+ Relative or absolute paths to the font files to be used.
+
+ If a single string, bytes, or `pathlib.Path`, then it will be treated
+ as a list with that entry only.
+
+ If more than one filepath is passed, then the returned FT2Font object
+ will fall back through the fonts, in the order given, to find a needed
+ glyph.
+
+ Returns
+ -------
+ `.ft2font.FT2Font`
+
+ """
+ if isinstance(font_filepaths, (str, Path, bytes)):
+ paths = (_cached_realpath(font_filepaths),)
+ else:
+ paths = tuple(_cached_realpath(fname) for fname in font_filepaths)
+
+ if hinting_factor is None:
+ hinting_factor = mpl.rcParams['text.hinting_factor']
+
+ return _get_font(
+ # must be a tuple to be cached
+ paths,
+ hinting_factor,
+ _kerning_factor=mpl.rcParams['text.kerning_factor'],
+ # also key on the thread ID to prevent segfaults with multi-threading
+ thread_id=threading.get_ident()
+ )
+
+
+def _load_fontmanager(*, try_read_cache=True):
+ fm_path = Path(
+ mpl.get_cachedir(), f"fontlist-v{FontManager.__version__}.json")
+ if try_read_cache:
+ try:
+ fm = json_load(fm_path)
+ except Exception:
+ pass
+ else:
+ if getattr(fm, "_version", object()) == FontManager.__version__:
+ _log.debug("Using fontManager instance from %s", fm_path)
+ return fm
+ fm = FontManager()
+ json_dump(fm, fm_path)
+ _log.info("generated new fontManager")
+ return fm
+
+
+fontManager = _load_fontmanager()
+findfont = fontManager.findfont
+get_font_names = fontManager.get_font_names
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/font_manager.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/font_manager.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..48d0e362d5994923e4b6e9e963e96177c8bc7fcb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/font_manager.pyi
@@ -0,0 +1,136 @@
+from dataclasses import dataclass
+import os
+
+from matplotlib._afm import AFM
+from matplotlib import ft2font
+
+from pathlib import Path
+
+from collections.abc import Iterable
+from typing import Any, Literal
+
+font_scalings: dict[str | None, float]
+stretch_dict: dict[str, int]
+weight_dict: dict[str, int]
+font_family_aliases: set[str]
+MSFolders: str
+MSFontDirectories: list[str]
+MSUserFontDirectories: list[str]
+X11FontDirectories: list[str]
+OSXFontDirectories: list[str]
+
+def get_fontext_synonyms(fontext: str) -> list[str]: ...
+def list_fonts(directory: str, extensions: Iterable[str]) -> list[str]: ...
+def win32FontDirectory() -> str: ...
+def _get_fontconfig_fonts() -> list[Path]: ...
+def findSystemFonts(
+ fontpaths: Iterable[str | os.PathLike | Path] | None = ..., fontext: str = ...
+) -> list[str]: ...
+@dataclass
+class FontEntry:
+ fname: str = ...
+ name: str = ...
+ style: str = ...
+ variant: str = ...
+ weight: str | int = ...
+ stretch: str = ...
+ size: str = ...
+ def _repr_html_(self) -> str: ...
+ def _repr_png_(self) -> bytes: ...
+
+def ttfFontProperty(font: ft2font.FT2Font) -> FontEntry: ...
+def afmFontProperty(fontpath: str, font: AFM) -> FontEntry: ...
+
+class FontProperties:
+ def __init__(
+ self,
+ family: str | Iterable[str] | None = ...,
+ style: Literal["normal", "italic", "oblique"] | None = ...,
+ variant: Literal["normal", "small-caps"] | None = ...,
+ weight: int | str | None = ...,
+ stretch: int | str | None = ...,
+ size: float | str | None = ...,
+ fname: str | os.PathLike | Path | None = ...,
+ math_fontfamily: str | None = ...,
+ ) -> None: ...
+ def __hash__(self) -> int: ...
+ def __eq__(self, other: object) -> bool: ...
+ def get_family(self) -> list[str]: ...
+ def get_name(self) -> str: ...
+ def get_style(self) -> Literal["normal", "italic", "oblique"]: ...
+ def get_variant(self) -> Literal["normal", "small-caps"]: ...
+ def get_weight(self) -> int | str: ...
+ def get_stretch(self) -> int | str: ...
+ def get_size(self) -> float: ...
+ def get_file(self) -> str | bytes | None: ...
+ def get_fontconfig_pattern(self) -> dict[str, list[Any]]: ...
+ def set_family(self, family: str | Iterable[str] | None) -> None: ...
+ def set_style(
+ self, style: Literal["normal", "italic", "oblique"] | None
+ ) -> None: ...
+ def set_variant(self, variant: Literal["normal", "small-caps"] | None) -> None: ...
+ def set_weight(self, weight: int | str | None) -> None: ...
+ def set_stretch(self, stretch: int | str | None) -> None: ...
+ def set_size(self, size: float | str | None) -> None: ...
+ def set_file(self, file: str | os.PathLike | Path | None) -> None: ...
+ def set_fontconfig_pattern(self, pattern: str) -> None: ...
+ def get_math_fontfamily(self) -> str: ...
+ def set_math_fontfamily(self, fontfamily: str | None) -> None: ...
+ def copy(self) -> FontProperties: ...
+ # Aliases
+ set_name = set_family
+ get_slant = get_style
+ set_slant = set_style
+ get_size_in_points = get_size
+
+def json_dump(data: FontManager, filename: str | Path | os.PathLike) -> None: ...
+def json_load(filename: str | Path | os.PathLike) -> FontManager: ...
+
+class FontManager:
+ __version__: int
+ default_size: float | None
+ defaultFamily: dict[str, str]
+ afmlist: list[FontEntry]
+ ttflist: list[FontEntry]
+ def __init__(self, size: float | None = ..., weight: str = ...) -> None: ...
+ def addfont(self, path: str | Path | os.PathLike) -> None: ...
+ @property
+ def defaultFont(self) -> dict[str, str]: ...
+ def get_default_weight(self) -> str: ...
+ @staticmethod
+ def get_default_size() -> float: ...
+ def set_default_weight(self, weight: str) -> None: ...
+ def score_family(
+ self, families: str | list[str] | tuple[str], family2: str
+ ) -> float: ...
+ def score_style(self, style1: str, style2: str) -> float: ...
+ def score_variant(self, variant1: str, variant2: str) -> float: ...
+ def score_stretch(self, stretch1: str | int, stretch2: str | int) -> float: ...
+ def score_weight(self, weight1: str | float, weight2: str | float) -> float: ...
+ def score_size(self, size1: str | float, size2: str | float) -> float: ...
+ def findfont(
+ self,
+ prop: str | FontProperties,
+ fontext: Literal["ttf", "afm"] = ...,
+ directory: str | None = ...,
+ fallback_to_default: bool = ...,
+ rebuild_if_missing: bool = ...,
+ ) -> str: ...
+ def get_font_names(self) -> list[str]: ...
+
+def is_opentype_cff_font(filename: str) -> bool: ...
+def get_font(
+ font_filepaths: Iterable[str | Path | bytes] | str | Path | bytes,
+ hinting_factor: int | None = ...,
+) -> ft2font.FT2Font: ...
+
+fontManager: FontManager
+
+def findfont(
+ prop: str | FontProperties,
+ fontext: Literal["ttf", "afm"] = ...,
+ directory: str | None = ...,
+ fallback_to_default: bool = ...,
+ rebuild_if_missing: bool = ...,
+) -> str: ...
+def get_font_names() -> list[str]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ft2font.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ft2font.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..37281afeaafa751790af911a422aedebece7133e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ft2font.pyi
@@ -0,0 +1,312 @@
+from enum import Enum, Flag
+import sys
+from typing import BinaryIO, Literal, TypedDict, final, overload, cast
+from typing_extensions import Buffer # < Py 3.12
+
+import numpy as np
+from numpy.typing import NDArray
+
+__freetype_build_type__: str
+__freetype_version__: str
+
+class FaceFlags(Flag):
+ SCALABLE = cast(int, ...)
+ FIXED_SIZES = cast(int, ...)
+ FIXED_WIDTH = cast(int, ...)
+ SFNT = cast(int, ...)
+ HORIZONTAL = cast(int, ...)
+ VERTICAL = cast(int, ...)
+ KERNING = cast(int, ...)
+ FAST_GLYPHS = cast(int, ...)
+ MULTIPLE_MASTERS = cast(int, ...)
+ GLYPH_NAMES = cast(int, ...)
+ EXTERNAL_STREAM = cast(int, ...)
+ HINTER = cast(int, ...)
+ CID_KEYED = cast(int, ...)
+ TRICKY = cast(int, ...)
+ COLOR = cast(int, ...)
+ # VARIATION = cast(int, ...) # FT 2.9
+ # SVG = cast(int, ...) # FT 2.12
+ # SBIX = cast(int, ...) # FT 2.12
+ # SBIX_OVERLAY = cast(int, ...) # FT 2.12
+
+class Kerning(Enum):
+ DEFAULT = cast(int, ...)
+ UNFITTED = cast(int, ...)
+ UNSCALED = cast(int, ...)
+
+class LoadFlags(Flag):
+ DEFAULT = cast(int, ...)
+ NO_SCALE = cast(int, ...)
+ NO_HINTING = cast(int, ...)
+ RENDER = cast(int, ...)
+ NO_BITMAP = cast(int, ...)
+ VERTICAL_LAYOUT = cast(int, ...)
+ FORCE_AUTOHINT = cast(int, ...)
+ CROP_BITMAP = cast(int, ...)
+ PEDANTIC = cast(int, ...)
+ IGNORE_GLOBAL_ADVANCE_WIDTH = cast(int, ...)
+ NO_RECURSE = cast(int, ...)
+ IGNORE_TRANSFORM = cast(int, ...)
+ MONOCHROME = cast(int, ...)
+ LINEAR_DESIGN = cast(int, ...)
+ NO_AUTOHINT = cast(int, ...)
+ COLOR = cast(int, ...)
+ COMPUTE_METRICS = cast(int, ...) # FT 2.6.1
+ # BITMAP_METRICS_ONLY = cast(int, ...) # FT 2.7.1
+ # NO_SVG = cast(int, ...) # FT 2.13.1
+ # The following should be unique, but the above can be OR'd together.
+ TARGET_NORMAL = cast(int, ...)
+ TARGET_LIGHT = cast(int, ...)
+ TARGET_MONO = cast(int, ...)
+ TARGET_LCD = cast(int, ...)
+ TARGET_LCD_V = cast(int, ...)
+
+class StyleFlags(Flag):
+ NORMAL = cast(int, ...)
+ ITALIC = cast(int, ...)
+ BOLD = cast(int, ...)
+
+class _SfntHeadDict(TypedDict):
+ version: tuple[int, int]
+ fontRevision: tuple[int, int]
+ checkSumAdjustment: int
+ magicNumber: int
+ flags: int
+ unitsPerEm: int
+ created: tuple[int, int]
+ modified: tuple[int, int]
+ xMin: int
+ yMin: int
+ xMax: int
+ yMax: int
+ macStyle: int
+ lowestRecPPEM: int
+ fontDirectionHint: int
+ indexToLocFormat: int
+ glyphDataFormat: int
+
+class _SfntMaxpDict(TypedDict):
+ version: tuple[int, int]
+ numGlyphs: int
+ maxPoints: int
+ maxContours: int
+ maxComponentPoints: int
+ maxComponentContours: int
+ maxZones: int
+ maxTwilightPoints: int
+ maxStorage: int
+ maxFunctionDefs: int
+ maxInstructionDefs: int
+ maxStackElements: int
+ maxSizeOfInstructions: int
+ maxComponentElements: int
+ maxComponentDepth: int
+
+class _SfntOs2Dict(TypedDict):
+ version: int
+ xAvgCharWidth: int
+ usWeightClass: int
+ usWidthClass: int
+ fsType: int
+ ySubscriptXSize: int
+ ySubscriptYSize: int
+ ySubscriptXOffset: int
+ ySubscriptYOffset: int
+ ySuperscriptXSize: int
+ ySuperscriptYSize: int
+ ySuperscriptXOffset: int
+ ySuperscriptYOffset: int
+ yStrikeoutSize: int
+ yStrikeoutPosition: int
+ sFamilyClass: int
+ panose: bytes
+ ulCharRange: tuple[int, int, int, int]
+ achVendID: bytes
+ fsSelection: int
+ fsFirstCharIndex: int
+ fsLastCharIndex: int
+
+class _SfntHheaDict(TypedDict):
+ version: tuple[int, int]
+ ascent: int
+ descent: int
+ lineGap: int
+ advanceWidthMax: int
+ minLeftBearing: int
+ minRightBearing: int
+ xMaxExtent: int
+ caretSlopeRise: int
+ caretSlopeRun: int
+ caretOffset: int
+ metricDataFormat: int
+ numOfLongHorMetrics: int
+
+class _SfntVheaDict(TypedDict):
+ version: tuple[int, int]
+ vertTypoAscender: int
+ vertTypoDescender: int
+ vertTypoLineGap: int
+ advanceHeightMax: int
+ minTopSideBearing: int
+ minBottomSizeBearing: int
+ yMaxExtent: int
+ caretSlopeRise: int
+ caretSlopeRun: int
+ caretOffset: int
+ metricDataFormat: int
+ numOfLongVerMetrics: int
+
+class _SfntPostDict(TypedDict):
+ format: tuple[int, int]
+ italicAngle: tuple[int, int]
+ underlinePosition: int
+ underlineThickness: int
+ isFixedPitch: int
+ minMemType42: int
+ maxMemType42: int
+ minMemType1: int
+ maxMemType1: int
+
+class _SfntPcltDict(TypedDict):
+ version: tuple[int, int]
+ fontNumber: int
+ pitch: int
+ xHeight: int
+ style: int
+ typeFamily: int
+ capHeight: int
+ symbolSet: int
+ typeFace: bytes
+ characterComplement: bytes
+ strokeWeight: int
+ widthType: int
+ serifStyle: int
+
+@final
+class FT2Font(Buffer):
+ def __init__(
+ self,
+ filename: str | BinaryIO,
+ hinting_factor: int = ...,
+ *,
+ _fallback_list: list[FT2Font] | None = ...,
+ _kerning_factor: int = ...
+ ) -> None: ...
+ if sys.version_info[:2] >= (3, 12):
+ def __buffer__(self, flags: int) -> memoryview: ...
+ def _get_fontmap(self, string: str) -> dict[str, FT2Font]: ...
+ def clear(self) -> None: ...
+ def draw_glyph_to_bitmap(
+ self, image: FT2Image, x: int, y: int, glyph: Glyph, antialiased: bool = ...
+ ) -> None: ...
+ def draw_glyphs_to_bitmap(self, antialiased: bool = ...) -> None: ...
+ def get_bitmap_offset(self) -> tuple[int, int]: ...
+ def get_char_index(self, codepoint: int) -> int: ...
+ def get_charmap(self) -> dict[int, int]: ...
+ def get_descent(self) -> int: ...
+ def get_glyph_name(self, index: int) -> str: ...
+ def get_image(self) -> NDArray[np.uint8]: ...
+ def get_kerning(self, left: int, right: int, mode: Kerning) -> int: ...
+ def get_name_index(self, name: str) -> int: ...
+ def get_num_glyphs(self) -> int: ...
+ def get_path(self) -> tuple[NDArray[np.float64], NDArray[np.int8]]: ...
+ def get_ps_font_info(
+ self,
+ ) -> tuple[str, str, str, str, str, int, int, int, int]: ...
+ def get_sfnt(self) -> dict[tuple[int, int, int, int], bytes]: ...
+ @overload
+ def get_sfnt_table(self, name: Literal["head"]) -> _SfntHeadDict | None: ...
+ @overload
+ def get_sfnt_table(self, name: Literal["maxp"]) -> _SfntMaxpDict | None: ...
+ @overload
+ def get_sfnt_table(self, name: Literal["OS/2"]) -> _SfntOs2Dict | None: ...
+ @overload
+ def get_sfnt_table(self, name: Literal["hhea"]) -> _SfntHheaDict | None: ...
+ @overload
+ def get_sfnt_table(self, name: Literal["vhea"]) -> _SfntVheaDict | None: ...
+ @overload
+ def get_sfnt_table(self, name: Literal["post"]) -> _SfntPostDict | None: ...
+ @overload
+ def get_sfnt_table(self, name: Literal["pclt"]) -> _SfntPcltDict | None: ...
+ def get_width_height(self) -> tuple[int, int]: ...
+ def load_char(self, charcode: int, flags: LoadFlags = ...) -> Glyph: ...
+ def load_glyph(self, glyphindex: int, flags: LoadFlags = ...) -> Glyph: ...
+ def select_charmap(self, i: int) -> None: ...
+ def set_charmap(self, i: int) -> None: ...
+ def set_size(self, ptsize: float, dpi: float) -> None: ...
+ def set_text(
+ self, string: str, angle: float = ..., flags: LoadFlags = ...
+ ) -> NDArray[np.float64]: ...
+ @property
+ def ascender(self) -> int: ...
+ @property
+ def bbox(self) -> tuple[int, int, int, int]: ...
+ @property
+ def descender(self) -> int: ...
+ @property
+ def face_flags(self) -> FaceFlags: ...
+ @property
+ def family_name(self) -> str: ...
+ @property
+ def fname(self) -> str: ...
+ @property
+ def height(self) -> int: ...
+ @property
+ def max_advance_height(self) -> int: ...
+ @property
+ def max_advance_width(self) -> int: ...
+ @property
+ def num_charmaps(self) -> int: ...
+ @property
+ def num_faces(self) -> int: ...
+ @property
+ def num_fixed_sizes(self) -> int: ...
+ @property
+ def num_glyphs(self) -> int: ...
+ @property
+ def num_named_instances(self) -> int: ...
+ @property
+ def postscript_name(self) -> str: ...
+ @property
+ def scalable(self) -> bool: ...
+ @property
+ def style_flags(self) -> StyleFlags: ...
+ @property
+ def style_name(self) -> str: ...
+ @property
+ def underline_position(self) -> int: ...
+ @property
+ def underline_thickness(self) -> int: ...
+ @property
+ def units_per_EM(self) -> int: ...
+
+@final
+class FT2Image(Buffer):
+ def __init__(self, width: int, height: int) -> None: ...
+ def draw_rect_filled(self, x0: int, y0: int, x1: int, y1: int) -> None: ...
+ if sys.version_info[:2] >= (3, 12):
+ def __buffer__(self, flags: int) -> memoryview: ...
+
+@final
+class Glyph:
+ @property
+ def width(self) -> int: ...
+ @property
+ def height(self) -> int: ...
+ @property
+ def horiBearingX(self) -> int: ...
+ @property
+ def horiBearingY(self) -> int: ...
+ @property
+ def horiAdvance(self) -> int: ...
+ @property
+ def linearHoriAdvance(self) -> int: ...
+ @property
+ def vertBearingX(self) -> int: ...
+ @property
+ def vertBearingY(self) -> int: ...
+ @property
+ def vertAdvance(self) -> int: ...
+ @property
+ def bbox(self) -> tuple[int, int, int, int]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/gridspec.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/gridspec.py
new file mode 100644
index 0000000000000000000000000000000000000000..06f0b2f7f781d291ca6159fd7ad8333d75dc6abb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/gridspec.py
@@ -0,0 +1,788 @@
+r"""
+:mod:`~matplotlib.gridspec` contains classes that help to layout multiple
+`~.axes.Axes` in a grid-like pattern within a figure.
+
+The `GridSpec` specifies the overall grid structure. Individual cells within
+the grid are referenced by `SubplotSpec`\s.
+
+Often, users need not access this module directly, and can use higher-level
+methods like `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` and
+`~.Figure.subfigures`. See the tutorial :ref:`arranging_axes` for a guide.
+"""
+
+import copy
+import logging
+from numbers import Integral
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, _pylab_helpers, _tight_layout
+from matplotlib.transforms import Bbox
+
+_log = logging.getLogger(__name__)
+
+
+class GridSpecBase:
+ """
+ A base class of GridSpec that specifies the geometry of the grid
+ that a subplot will be placed.
+ """
+
+ def __init__(self, nrows, ncols, height_ratios=None, width_ratios=None):
+ """
+ Parameters
+ ----------
+ nrows, ncols : int
+ The number of rows and columns of the grid.
+ width_ratios : array-like of length *ncols*, optional
+ Defines the relative widths of the columns. Each column gets a
+ relative width of ``width_ratios[i] / sum(width_ratios)``.
+ If not given, all columns will have the same width.
+ height_ratios : array-like of length *nrows*, optional
+ Defines the relative heights of the rows. Each row gets a
+ relative height of ``height_ratios[i] / sum(height_ratios)``.
+ If not given, all rows will have the same height.
+ """
+ if not isinstance(nrows, Integral) or nrows <= 0:
+ raise ValueError(
+ f"Number of rows must be a positive integer, not {nrows!r}")
+ if not isinstance(ncols, Integral) or ncols <= 0:
+ raise ValueError(
+ f"Number of columns must be a positive integer, not {ncols!r}")
+ self._nrows, self._ncols = nrows, ncols
+ self.set_height_ratios(height_ratios)
+ self.set_width_ratios(width_ratios)
+
+ def __repr__(self):
+ height_arg = (f', height_ratios={self._row_height_ratios!r}'
+ if len(set(self._row_height_ratios)) != 1 else '')
+ width_arg = (f', width_ratios={self._col_width_ratios!r}'
+ if len(set(self._col_width_ratios)) != 1 else '')
+ return '{clsname}({nrows}, {ncols}{optionals})'.format(
+ clsname=self.__class__.__name__,
+ nrows=self._nrows,
+ ncols=self._ncols,
+ optionals=height_arg + width_arg,
+ )
+
+ nrows = property(lambda self: self._nrows,
+ doc="The number of rows in the grid.")
+ ncols = property(lambda self: self._ncols,
+ doc="The number of columns in the grid.")
+
+ def get_geometry(self):
+ """
+ Return a tuple containing the number of rows and columns in the grid.
+ """
+ return self._nrows, self._ncols
+
+ def get_subplot_params(self, figure=None):
+ # Must be implemented in subclasses
+ pass
+
+ def new_subplotspec(self, loc, rowspan=1, colspan=1):
+ """
+ Create and return a `.SubplotSpec` instance.
+
+ Parameters
+ ----------
+ loc : (int, int)
+ The position of the subplot in the grid as
+ ``(row_index, column_index)``.
+ rowspan, colspan : int, default: 1
+ The number of rows and columns the subplot should span in the grid.
+ """
+ loc1, loc2 = loc
+ subplotspec = self[loc1:loc1+rowspan, loc2:loc2+colspan]
+ return subplotspec
+
+ def set_width_ratios(self, width_ratios):
+ """
+ Set the relative widths of the columns.
+
+ *width_ratios* must be of length *ncols*. Each column gets a relative
+ width of ``width_ratios[i] / sum(width_ratios)``.
+ """
+ if width_ratios is None:
+ width_ratios = [1] * self._ncols
+ elif len(width_ratios) != self._ncols:
+ raise ValueError('Expected the given number of width ratios to '
+ 'match the number of columns of the grid')
+ self._col_width_ratios = width_ratios
+
+ def get_width_ratios(self):
+ """
+ Return the width ratios.
+
+ This is *None* if no width ratios have been set explicitly.
+ """
+ return self._col_width_ratios
+
+ def set_height_ratios(self, height_ratios):
+ """
+ Set the relative heights of the rows.
+
+ *height_ratios* must be of length *nrows*. Each row gets a relative
+ height of ``height_ratios[i] / sum(height_ratios)``.
+ """
+ if height_ratios is None:
+ height_ratios = [1] * self._nrows
+ elif len(height_ratios) != self._nrows:
+ raise ValueError('Expected the given number of height ratios to '
+ 'match the number of rows of the grid')
+ self._row_height_ratios = height_ratios
+
+ def get_height_ratios(self):
+ """
+ Return the height ratios.
+
+ This is *None* if no height ratios have been set explicitly.
+ """
+ return self._row_height_ratios
+
+ def get_grid_positions(self, fig):
+ """
+ Return the positions of the grid cells in figure coordinates.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ The figure the grid should be applied to. The subplot parameters
+ (margins and spacing between subplots) are taken from *fig*.
+
+ Returns
+ -------
+ bottoms, tops, lefts, rights : array
+ The bottom, top, left, right positions of the grid cells in
+ figure coordinates.
+ """
+ nrows, ncols = self.get_geometry()
+ subplot_params = self.get_subplot_params(fig)
+ left = subplot_params.left
+ right = subplot_params.right
+ bottom = subplot_params.bottom
+ top = subplot_params.top
+ wspace = subplot_params.wspace
+ hspace = subplot_params.hspace
+ tot_width = right - left
+ tot_height = top - bottom
+
+ # calculate accumulated heights of columns
+ cell_h = tot_height / (nrows + hspace*(nrows-1))
+ sep_h = hspace * cell_h
+ norm = cell_h * nrows / sum(self._row_height_ratios)
+ cell_heights = [r * norm for r in self._row_height_ratios]
+ sep_heights = [0] + ([sep_h] * (nrows-1))
+ cell_hs = np.cumsum(np.column_stack([sep_heights, cell_heights]).flat)
+
+ # calculate accumulated widths of rows
+ cell_w = tot_width / (ncols + wspace*(ncols-1))
+ sep_w = wspace * cell_w
+ norm = cell_w * ncols / sum(self._col_width_ratios)
+ cell_widths = [r * norm for r in self._col_width_ratios]
+ sep_widths = [0] + ([sep_w] * (ncols-1))
+ cell_ws = np.cumsum(np.column_stack([sep_widths, cell_widths]).flat)
+
+ fig_tops, fig_bottoms = (top - cell_hs).reshape((-1, 2)).T
+ fig_lefts, fig_rights = (left + cell_ws).reshape((-1, 2)).T
+ return fig_bottoms, fig_tops, fig_lefts, fig_rights
+
+ @staticmethod
+ def _check_gridspec_exists(figure, nrows, ncols):
+ """
+ Check if the figure already has a gridspec with these dimensions,
+ or create a new one
+ """
+ for ax in figure.get_axes():
+ gs = ax.get_gridspec()
+ if gs is not None:
+ if hasattr(gs, 'get_topmost_subplotspec'):
+ # This is needed for colorbar gridspec layouts.
+ # This is probably OK because this whole logic tree
+ # is for when the user is doing simple things with the
+ # add_subplot command. For complicated layouts
+ # like subgridspecs the proper gridspec is passed in...
+ gs = gs.get_topmost_subplotspec().get_gridspec()
+ if gs.get_geometry() == (nrows, ncols):
+ return gs
+ # else gridspec not found:
+ return GridSpec(nrows, ncols, figure=figure)
+
+ def __getitem__(self, key):
+ """Create and return a `.SubplotSpec` instance."""
+ nrows, ncols = self.get_geometry()
+
+ def _normalize(key, size, axis): # Includes last index.
+ orig_key = key
+ if isinstance(key, slice):
+ start, stop, _ = key.indices(size)
+ if stop > start:
+ return start, stop - 1
+ raise IndexError("GridSpec slice would result in no space "
+ "allocated for subplot")
+ else:
+ if key < 0:
+ key = key + size
+ if 0 <= key < size:
+ return key, key
+ elif axis is not None:
+ raise IndexError(f"index {orig_key} is out of bounds for "
+ f"axis {axis} with size {size}")
+ else: # flat index
+ raise IndexError(f"index {orig_key} is out of bounds for "
+ f"GridSpec with size {size}")
+
+ if isinstance(key, tuple):
+ try:
+ k1, k2 = key
+ except ValueError as err:
+ raise ValueError("Unrecognized subplot spec") from err
+ num1, num2 = np.ravel_multi_index(
+ [_normalize(k1, nrows, 0), _normalize(k2, ncols, 1)],
+ (nrows, ncols))
+ else: # Single key
+ num1, num2 = _normalize(key, nrows * ncols, None)
+
+ return SubplotSpec(self, num1, num2)
+
+ def subplots(self, *, sharex=False, sharey=False, squeeze=True,
+ subplot_kw=None):
+ """
+ Add all subplots specified by this `GridSpec` to its parent figure.
+
+ See `.Figure.subplots` for detailed documentation.
+ """
+
+ figure = self.figure
+
+ if figure is None:
+ raise ValueError("GridSpec.subplots() only works for GridSpecs "
+ "created with a parent figure")
+
+ if not isinstance(sharex, str):
+ sharex = "all" if sharex else "none"
+ if not isinstance(sharey, str):
+ sharey = "all" if sharey else "none"
+
+ _api.check_in_list(["all", "row", "col", "none", False, True],
+ sharex=sharex, sharey=sharey)
+ if subplot_kw is None:
+ subplot_kw = {}
+ # don't mutate kwargs passed by user...
+ subplot_kw = subplot_kw.copy()
+
+ # Create array to hold all Axes.
+ axarr = np.empty((self._nrows, self._ncols), dtype=object)
+ for row in range(self._nrows):
+ for col in range(self._ncols):
+ shared_with = {"none": None, "all": axarr[0, 0],
+ "row": axarr[row, 0], "col": axarr[0, col]}
+ subplot_kw["sharex"] = shared_with[sharex]
+ subplot_kw["sharey"] = shared_with[sharey]
+ axarr[row, col] = figure.add_subplot(
+ self[row, col], **subplot_kw)
+
+ # turn off redundant tick labeling
+ if sharex in ["col", "all"]:
+ for ax in axarr.flat:
+ ax._label_outer_xaxis(skip_non_rectangular_axes=True)
+ if sharey in ["row", "all"]:
+ for ax in axarr.flat:
+ ax._label_outer_yaxis(skip_non_rectangular_axes=True)
+
+ if squeeze:
+ # Discarding unneeded dimensions that equal 1. If we only have one
+ # subplot, just return it instead of a 1-element array.
+ return axarr.item() if axarr.size == 1 else axarr.squeeze()
+ else:
+ # Returned axis array will be always 2-d, even if nrows=ncols=1.
+ return axarr
+
+
+class GridSpec(GridSpecBase):
+ """
+ A grid layout to place subplots within a figure.
+
+ The location of the grid cells is determined in a similar way to
+ `.SubplotParams` using *left*, *right*, *top*, *bottom*, *wspace*
+ and *hspace*.
+
+ Indexing a GridSpec instance returns a `.SubplotSpec`.
+ """
+ def __init__(self, nrows, ncols, figure=None,
+ left=None, bottom=None, right=None, top=None,
+ wspace=None, hspace=None,
+ width_ratios=None, height_ratios=None):
+ """
+ Parameters
+ ----------
+ nrows, ncols : int
+ The number of rows and columns of the grid.
+
+ figure : `.Figure`, optional
+ Only used for constrained layout to create a proper layoutgrid.
+
+ left, right, top, bottom : float, optional
+ Extent of the subplots as a fraction of figure width or height.
+ Left cannot be larger than right, and bottom cannot be larger than
+ top. If not given, the values will be inferred from a figure or
+ rcParams at draw time. See also `GridSpec.get_subplot_params`.
+
+ wspace : float, optional
+ The amount of width reserved for space between subplots,
+ expressed as a fraction of the average axis width.
+ If not given, the values will be inferred from a figure or
+ rcParams when necessary. See also `GridSpec.get_subplot_params`.
+
+ hspace : float, optional
+ The amount of height reserved for space between subplots,
+ expressed as a fraction of the average axis height.
+ If not given, the values will be inferred from a figure or
+ rcParams when necessary. See also `GridSpec.get_subplot_params`.
+
+ width_ratios : array-like of length *ncols*, optional
+ Defines the relative widths of the columns. Each column gets a
+ relative width of ``width_ratios[i] / sum(width_ratios)``.
+ If not given, all columns will have the same width.
+
+ height_ratios : array-like of length *nrows*, optional
+ Defines the relative heights of the rows. Each row gets a
+ relative height of ``height_ratios[i] / sum(height_ratios)``.
+ If not given, all rows will have the same height.
+
+ """
+ self.left = left
+ self.bottom = bottom
+ self.right = right
+ self.top = top
+ self.wspace = wspace
+ self.hspace = hspace
+ self.figure = figure
+
+ super().__init__(nrows, ncols,
+ width_ratios=width_ratios,
+ height_ratios=height_ratios)
+
+ _AllowedKeys = ["left", "bottom", "right", "top", "wspace", "hspace"]
+
+ def update(self, **kwargs):
+ """
+ Update the subplot parameters of the grid.
+
+ Parameters that are not explicitly given are not changed. Setting a
+ parameter to *None* resets it to :rc:`figure.subplot.*`.
+
+ Parameters
+ ----------
+ left, right, top, bottom : float or None, optional
+ Extent of the subplots as a fraction of figure width or height.
+ wspace, hspace : float, optional
+ Spacing between the subplots as a fraction of the average subplot
+ width / height.
+ """
+ for k, v in kwargs.items():
+ if k in self._AllowedKeys:
+ setattr(self, k, v)
+ else:
+ raise AttributeError(f"{k} is an unknown keyword")
+ for figmanager in _pylab_helpers.Gcf.figs.values():
+ for ax in figmanager.canvas.figure.axes:
+ if ax.get_subplotspec() is not None:
+ ss = ax.get_subplotspec().get_topmost_subplotspec()
+ if ss.get_gridspec() == self:
+ fig = ax.get_figure(root=False)
+ ax._set_position(ax.get_subplotspec().get_position(fig))
+
+ def get_subplot_params(self, figure=None):
+ """
+ Return the `.SubplotParams` for the GridSpec.
+
+ In order of precedence the values are taken from
+
+ - non-*None* attributes of the GridSpec
+ - the provided *figure*
+ - :rc:`figure.subplot.*`
+
+ Note that the ``figure`` attribute of the GridSpec is always ignored.
+ """
+ if figure is None:
+ kw = {k: mpl.rcParams["figure.subplot."+k]
+ for k in self._AllowedKeys}
+ subplotpars = SubplotParams(**kw)
+ else:
+ subplotpars = copy.copy(figure.subplotpars)
+
+ subplotpars.update(**{k: getattr(self, k) for k in self._AllowedKeys})
+
+ return subplotpars
+
+ def locally_modified_subplot_params(self):
+ """
+ Return a list of the names of the subplot parameters explicitly set
+ in the GridSpec.
+
+ This is a subset of the attributes of `.SubplotParams`.
+ """
+ return [k for k in self._AllowedKeys if getattr(self, k)]
+
+ def tight_layout(self, figure, renderer=None,
+ pad=1.08, h_pad=None, w_pad=None, rect=None):
+ """
+ Adjust subplot parameters to give specified padding.
+
+ Parameters
+ ----------
+ figure : `.Figure`
+ The figure.
+ renderer : `.RendererBase` subclass, optional
+ The renderer to be used.
+ pad : float
+ Padding between the figure edge and the edges of subplots, as a
+ fraction of the font-size.
+ h_pad, w_pad : float, optional
+ Padding (height/width) between edges of adjacent subplots.
+ Defaults to *pad*.
+ rect : tuple (left, bottom, right, top), default: None
+ (left, bottom, right, top) rectangle in normalized figure
+ coordinates that the whole subplots area (including labels) will
+ fit into. Default (None) is the whole figure.
+ """
+ if renderer is None:
+ renderer = figure._get_renderer()
+ kwargs = _tight_layout.get_tight_layout_figure(
+ figure, figure.axes,
+ _tight_layout.get_subplotspec_list(figure.axes, grid_spec=self),
+ renderer, pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
+ if kwargs:
+ self.update(**kwargs)
+
+
+class GridSpecFromSubplotSpec(GridSpecBase):
+ """
+ GridSpec whose subplot layout parameters are inherited from the
+ location specified by a given SubplotSpec.
+ """
+ def __init__(self, nrows, ncols,
+ subplot_spec,
+ wspace=None, hspace=None,
+ height_ratios=None, width_ratios=None):
+ """
+ Parameters
+ ----------
+ nrows, ncols : int
+ Number of rows and number of columns of the grid.
+ subplot_spec : SubplotSpec
+ Spec from which the layout parameters are inherited.
+ wspace, hspace : float, optional
+ See `GridSpec` for more details. If not specified default values
+ (from the figure or rcParams) are used.
+ height_ratios : array-like of length *nrows*, optional
+ See `GridSpecBase` for details.
+ width_ratios : array-like of length *ncols*, optional
+ See `GridSpecBase` for details.
+ """
+ self._wspace = wspace
+ self._hspace = hspace
+ if isinstance(subplot_spec, SubplotSpec):
+ self._subplot_spec = subplot_spec
+ else:
+ raise TypeError(
+ "subplot_spec must be type SubplotSpec, "
+ "usually from GridSpec, or axes.get_subplotspec.")
+ self.figure = self._subplot_spec.get_gridspec().figure
+ super().__init__(nrows, ncols,
+ width_ratios=width_ratios,
+ height_ratios=height_ratios)
+
+ def get_subplot_params(self, figure=None):
+ """Return a dictionary of subplot layout parameters."""
+ hspace = (self._hspace if self._hspace is not None
+ else figure.subplotpars.hspace if figure is not None
+ else mpl.rcParams["figure.subplot.hspace"])
+ wspace = (self._wspace if self._wspace is not None
+ else figure.subplotpars.wspace if figure is not None
+ else mpl.rcParams["figure.subplot.wspace"])
+
+ figbox = self._subplot_spec.get_position(figure)
+ left, bottom, right, top = figbox.extents
+
+ return SubplotParams(left=left, right=right,
+ bottom=bottom, top=top,
+ wspace=wspace, hspace=hspace)
+
+ def get_topmost_subplotspec(self):
+ """
+ Return the topmost `.SubplotSpec` instance associated with the subplot.
+ """
+ return self._subplot_spec.get_topmost_subplotspec()
+
+
+class SubplotSpec:
+ """
+ The location of a subplot in a `GridSpec`.
+
+ .. note::
+
+ Likely, you will never instantiate a `SubplotSpec` yourself. Instead,
+ you will typically obtain one from a `GridSpec` using item-access.
+
+ Parameters
+ ----------
+ gridspec : `~matplotlib.gridspec.GridSpec`
+ The GridSpec, which the subplot is referencing.
+ num1, num2 : int
+ The subplot will occupy the *num1*-th cell of the given
+ *gridspec*. If *num2* is provided, the subplot will span between
+ *num1*-th cell and *num2*-th cell **inclusive**.
+
+ The index starts from 0.
+ """
+ def __init__(self, gridspec, num1, num2=None):
+ self._gridspec = gridspec
+ self.num1 = num1
+ self.num2 = num2
+
+ def __repr__(self):
+ return (f"{self.get_gridspec()}["
+ f"{self.rowspan.start}:{self.rowspan.stop}, "
+ f"{self.colspan.start}:{self.colspan.stop}]")
+
+ @staticmethod
+ def _from_subplot_args(figure, args):
+ """
+ Construct a `.SubplotSpec` from a parent `.Figure` and either
+
+ - a `.SubplotSpec` -- returned as is;
+ - one or three numbers -- a MATLAB-style subplot specifier.
+ """
+ if len(args) == 1:
+ arg, = args
+ if isinstance(arg, SubplotSpec):
+ return arg
+ elif not isinstance(arg, Integral):
+ raise ValueError(
+ f"Single argument to subplot must be a three-digit "
+ f"integer, not {arg!r}")
+ try:
+ rows, cols, num = map(int, str(arg))
+ except ValueError:
+ raise ValueError(
+ f"Single argument to subplot must be a three-digit "
+ f"integer, not {arg!r}") from None
+ elif len(args) == 3:
+ rows, cols, num = args
+ else:
+ raise _api.nargs_error("subplot", takes="1 or 3", given=len(args))
+
+ gs = GridSpec._check_gridspec_exists(figure, rows, cols)
+ if gs is None:
+ gs = GridSpec(rows, cols, figure=figure)
+ if isinstance(num, tuple) and len(num) == 2:
+ if not all(isinstance(n, Integral) for n in num):
+ raise ValueError(
+ f"Subplot specifier tuple must contain integers, not {num}"
+ )
+ i, j = num
+ else:
+ if not isinstance(num, Integral) or num < 1 or num > rows*cols:
+ raise ValueError(
+ f"num must be an integer with 1 <= num <= {rows*cols}, "
+ f"not {num!r}"
+ )
+ i = j = num
+ return gs[i-1:j]
+
+ # num2 is a property only to handle the case where it is None and someone
+ # mutates num1.
+
+ @property
+ def num2(self):
+ return self.num1 if self._num2 is None else self._num2
+
+ @num2.setter
+ def num2(self, value):
+ self._num2 = value
+
+ def get_gridspec(self):
+ return self._gridspec
+
+ def get_geometry(self):
+ """
+ Return the subplot geometry as tuple ``(n_rows, n_cols, start, stop)``.
+
+ The indices *start* and *stop* define the range of the subplot within
+ the `GridSpec`. *stop* is inclusive (i.e. for a single cell
+ ``start == stop``).
+ """
+ rows, cols = self.get_gridspec().get_geometry()
+ return rows, cols, self.num1, self.num2
+
+ @property
+ def rowspan(self):
+ """The rows spanned by this subplot, as a `range` object."""
+ ncols = self.get_gridspec().ncols
+ return range(self.num1 // ncols, self.num2 // ncols + 1)
+
+ @property
+ def colspan(self):
+ """The columns spanned by this subplot, as a `range` object."""
+ ncols = self.get_gridspec().ncols
+ # We explicitly support num2 referring to a column on num1's *left*, so
+ # we must sort the column indices here so that the range makes sense.
+ c1, c2 = sorted([self.num1 % ncols, self.num2 % ncols])
+ return range(c1, c2 + 1)
+
+ def is_first_row(self):
+ return self.rowspan.start == 0
+
+ def is_last_row(self):
+ return self.rowspan.stop == self.get_gridspec().nrows
+
+ def is_first_col(self):
+ return self.colspan.start == 0
+
+ def is_last_col(self):
+ return self.colspan.stop == self.get_gridspec().ncols
+
+ def get_position(self, figure):
+ """
+ Update the subplot position from ``figure.subplotpars``.
+ """
+ gridspec = self.get_gridspec()
+ nrows, ncols = gridspec.get_geometry()
+ rows, cols = np.unravel_index([self.num1, self.num2], (nrows, ncols))
+ fig_bottoms, fig_tops, fig_lefts, fig_rights = \
+ gridspec.get_grid_positions(figure)
+
+ fig_bottom = fig_bottoms[rows].min()
+ fig_top = fig_tops[rows].max()
+ fig_left = fig_lefts[cols].min()
+ fig_right = fig_rights[cols].max()
+ return Bbox.from_extents(fig_left, fig_bottom, fig_right, fig_top)
+
+ def get_topmost_subplotspec(self):
+ """
+ Return the topmost `SubplotSpec` instance associated with the subplot.
+ """
+ gridspec = self.get_gridspec()
+ if hasattr(gridspec, "get_topmost_subplotspec"):
+ return gridspec.get_topmost_subplotspec()
+ else:
+ return self
+
+ def __eq__(self, other):
+ """
+ Two SubplotSpecs are considered equal if they refer to the same
+ position(s) in the same `GridSpec`.
+ """
+ # other may not even have the attributes we are checking.
+ return ((self._gridspec, self.num1, self.num2)
+ == (getattr(other, "_gridspec", object()),
+ getattr(other, "num1", object()),
+ getattr(other, "num2", object())))
+
+ def __hash__(self):
+ return hash((self._gridspec, self.num1, self.num2))
+
+ def subgridspec(self, nrows, ncols, **kwargs):
+ """
+ Create a GridSpec within this subplot.
+
+ The created `.GridSpecFromSubplotSpec` will have this `SubplotSpec` as
+ a parent.
+
+ Parameters
+ ----------
+ nrows : int
+ Number of rows in grid.
+
+ ncols : int
+ Number of columns in grid.
+
+ Returns
+ -------
+ `.GridSpecFromSubplotSpec`
+
+ Other Parameters
+ ----------------
+ **kwargs
+ All other parameters are passed to `.GridSpecFromSubplotSpec`.
+
+ See Also
+ --------
+ matplotlib.pyplot.subplots
+
+ Examples
+ --------
+ Adding three subplots in the space occupied by a single subplot::
+
+ fig = plt.figure()
+ gs0 = fig.add_gridspec(3, 1)
+ ax1 = fig.add_subplot(gs0[0])
+ ax2 = fig.add_subplot(gs0[1])
+ gssub = gs0[2].subgridspec(1, 3)
+ for i in range(3):
+ fig.add_subplot(gssub[0, i])
+ """
+ return GridSpecFromSubplotSpec(nrows, ncols, self, **kwargs)
+
+
+class SubplotParams:
+ """
+ Parameters defining the positioning of a subplots grid in a figure.
+ """
+
+ def __init__(self, left=None, bottom=None, right=None, top=None,
+ wspace=None, hspace=None):
+ """
+ Defaults are given by :rc:`figure.subplot.[name]`.
+
+ Parameters
+ ----------
+ left : float
+ The position of the left edge of the subplots,
+ as a fraction of the figure width.
+ right : float
+ The position of the right edge of the subplots,
+ as a fraction of the figure width.
+ bottom : float
+ The position of the bottom edge of the subplots,
+ as a fraction of the figure height.
+ top : float
+ The position of the top edge of the subplots,
+ as a fraction of the figure height.
+ wspace : float
+ The width of the padding between subplots,
+ as a fraction of the average Axes width.
+ hspace : float
+ The height of the padding between subplots,
+ as a fraction of the average Axes height.
+ """
+ for key in ["left", "bottom", "right", "top", "wspace", "hspace"]:
+ setattr(self, key, mpl.rcParams[f"figure.subplot.{key}"])
+ self.update(left, bottom, right, top, wspace, hspace)
+
+ def update(self, left=None, bottom=None, right=None, top=None,
+ wspace=None, hspace=None):
+ """
+ Update the dimensions of the passed parameters. *None* means unchanged.
+ """
+ if ((left if left is not None else self.left)
+ >= (right if right is not None else self.right)):
+ raise ValueError('left cannot be >= right')
+ if ((bottom if bottom is not None else self.bottom)
+ >= (top if top is not None else self.top)):
+ raise ValueError('bottom cannot be >= top')
+ if left is not None:
+ self.left = left
+ if right is not None:
+ self.right = right
+ if bottom is not None:
+ self.bottom = bottom
+ if top is not None:
+ self.top = top
+ if wspace is not None:
+ self.wspace = wspace
+ if hspace is not None:
+ self.hspace = hspace
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/gridspec.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/gridspec.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..3bf13ee17c4eb3bdb7d6a00a171e7db233260d7e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/gridspec.pyi
@@ -0,0 +1,160 @@
+from typing import Any, Literal, overload
+
+from numpy.typing import ArrayLike
+import numpy as np
+
+from matplotlib.axes import Axes
+from matplotlib.backend_bases import RendererBase
+from matplotlib.figure import Figure
+from matplotlib.transforms import Bbox
+
+class GridSpecBase:
+ def __init__(
+ self,
+ nrows: int,
+ ncols: int,
+ height_ratios: ArrayLike | None = ...,
+ width_ratios: ArrayLike | None = ...,
+ ) -> None: ...
+ @property
+ def nrows(self) -> int: ...
+ @property
+ def ncols(self) -> int: ...
+ def get_geometry(self) -> tuple[int, int]: ...
+ def get_subplot_params(self, figure: Figure | None = ...) -> SubplotParams: ...
+ def new_subplotspec(
+ self, loc: tuple[int, int], rowspan: int = ..., colspan: int = ...
+ ) -> SubplotSpec: ...
+ def set_width_ratios(self, width_ratios: ArrayLike | None) -> None: ...
+ def get_width_ratios(self) -> ArrayLike: ...
+ def set_height_ratios(self, height_ratios: ArrayLike | None) -> None: ...
+ def get_height_ratios(self) -> ArrayLike: ...
+ def get_grid_positions(
+ self, fig: Figure
+ ) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: ...
+ @staticmethod
+ def _check_gridspec_exists(figure: Figure, nrows: int, ncols: int) -> GridSpec: ...
+ def __getitem__(
+ self, key: tuple[int | slice, int | slice] | slice | int
+ ) -> SubplotSpec: ...
+ @overload
+ def subplots(
+ self,
+ *,
+ sharex: bool | Literal["all", "row", "col", "none"] = ...,
+ sharey: bool | Literal["all", "row", "col", "none"] = ...,
+ squeeze: Literal[False],
+ subplot_kw: dict[str, Any] | None = ...
+ ) -> np.ndarray: ...
+ @overload
+ def subplots(
+ self,
+ *,
+ sharex: bool | Literal["all", "row", "col", "none"] = ...,
+ sharey: bool | Literal["all", "row", "col", "none"] = ...,
+ squeeze: Literal[True] = ...,
+ subplot_kw: dict[str, Any] | None = ...
+ ) -> np.ndarray | Axes: ...
+
+class GridSpec(GridSpecBase):
+ left: float | None
+ bottom: float | None
+ right: float | None
+ top: float | None
+ wspace: float | None
+ hspace: float | None
+ figure: Figure | None
+ def __init__(
+ self,
+ nrows: int,
+ ncols: int,
+ figure: Figure | None = ...,
+ left: float | None = ...,
+ bottom: float | None = ...,
+ right: float | None = ...,
+ top: float | None = ...,
+ wspace: float | None = ...,
+ hspace: float | None = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ ) -> None: ...
+ def update(self, **kwargs: float | None) -> None: ...
+ def locally_modified_subplot_params(self) -> list[str]: ...
+ def tight_layout(
+ self,
+ figure: Figure,
+ renderer: RendererBase | None = ...,
+ pad: float = ...,
+ h_pad: float | None = ...,
+ w_pad: float | None = ...,
+ rect: tuple[float, float, float, float] | None = ...,
+ ) -> None: ...
+
+class GridSpecFromSubplotSpec(GridSpecBase):
+ figure: Figure | None
+ def __init__(
+ self,
+ nrows: int,
+ ncols: int,
+ subplot_spec: SubplotSpec,
+ wspace: float | None = ...,
+ hspace: float | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ width_ratios: ArrayLike | None = ...,
+ ) -> None: ...
+ def get_topmost_subplotspec(self) -> SubplotSpec: ...
+
+class SubplotSpec:
+ num1: int
+ def __init__(
+ self, gridspec: GridSpecBase, num1: int, num2: int | None = ...
+ ) -> None: ...
+ @staticmethod
+ def _from_subplot_args(figure, args): ...
+ @property
+ def num2(self) -> int: ...
+ @num2.setter
+ def num2(self, value: int) -> None: ...
+ def get_gridspec(self) -> GridSpecBase: ...
+ def get_geometry(self) -> tuple[int, int, int, int]: ...
+ @property
+ def rowspan(self) -> range: ...
+ @property
+ def colspan(self) -> range: ...
+ def is_first_row(self) -> bool: ...
+ def is_last_row(self) -> bool: ...
+ def is_first_col(self) -> bool: ...
+ def is_last_col(self) -> bool: ...
+ def get_position(self, figure: Figure) -> Bbox: ...
+ def get_topmost_subplotspec(self) -> SubplotSpec: ...
+ def __eq__(self, other: object) -> bool: ...
+ def __hash__(self) -> int: ...
+ def subgridspec(
+ self, nrows: int, ncols: int, **kwargs
+ ) -> GridSpecFromSubplotSpec: ...
+
+class SubplotParams:
+ def __init__(
+ self,
+ left: float | None = ...,
+ bottom: float | None = ...,
+ right: float | None = ...,
+ top: float | None = ...,
+ wspace: float | None = ...,
+ hspace: float | None = ...,
+ ) -> None: ...
+ left: float
+ right: float
+ bottom: float
+ top: float
+ wspace: float
+ hspace: float
+ def update(
+ self,
+ left: float | None = ...,
+ bottom: float | None = ...,
+ right: float | None = ...,
+ top: float | None = ...,
+ wspace: float | None = ...,
+ hspace: float | None = ...,
+ ) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/hatch.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/hatch.py
new file mode 100644
index 0000000000000000000000000000000000000000..0cbd042e1628bdfa2172ca1f64eb146d8f8e54fb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/hatch.py
@@ -0,0 +1,225 @@
+"""Contains classes for generating hatch patterns."""
+
+import numpy as np
+
+from matplotlib import _api
+from matplotlib.path import Path
+
+
+class HatchPatternBase:
+ """The base class for a hatch pattern."""
+ pass
+
+
+class HorizontalHatch(HatchPatternBase):
+ def __init__(self, hatch, density):
+ self.num_lines = int((hatch.count('-') + hatch.count('+')) * density)
+ self.num_vertices = self.num_lines * 2
+
+ def set_vertices_and_codes(self, vertices, codes):
+ steps, stepsize = np.linspace(0.0, 1.0, self.num_lines, False,
+ retstep=True)
+ steps += stepsize / 2.
+ vertices[0::2, 0] = 0.0
+ vertices[0::2, 1] = steps
+ vertices[1::2, 0] = 1.0
+ vertices[1::2, 1] = steps
+ codes[0::2] = Path.MOVETO
+ codes[1::2] = Path.LINETO
+
+
+class VerticalHatch(HatchPatternBase):
+ def __init__(self, hatch, density):
+ self.num_lines = int((hatch.count('|') + hatch.count('+')) * density)
+ self.num_vertices = self.num_lines * 2
+
+ def set_vertices_and_codes(self, vertices, codes):
+ steps, stepsize = np.linspace(0.0, 1.0, self.num_lines, False,
+ retstep=True)
+ steps += stepsize / 2.
+ vertices[0::2, 0] = steps
+ vertices[0::2, 1] = 0.0
+ vertices[1::2, 0] = steps
+ vertices[1::2, 1] = 1.0
+ codes[0::2] = Path.MOVETO
+ codes[1::2] = Path.LINETO
+
+
+class NorthEastHatch(HatchPatternBase):
+ def __init__(self, hatch, density):
+ self.num_lines = int(
+ (hatch.count('/') + hatch.count('x') + hatch.count('X')) * density)
+ if self.num_lines:
+ self.num_vertices = (self.num_lines + 1) * 2
+ else:
+ self.num_vertices = 0
+
+ def set_vertices_and_codes(self, vertices, codes):
+ steps = np.linspace(-0.5, 0.5, self.num_lines + 1)
+ vertices[0::2, 0] = 0.0 + steps
+ vertices[0::2, 1] = 0.0 - steps
+ vertices[1::2, 0] = 1.0 + steps
+ vertices[1::2, 1] = 1.0 - steps
+ codes[0::2] = Path.MOVETO
+ codes[1::2] = Path.LINETO
+
+
+class SouthEastHatch(HatchPatternBase):
+ def __init__(self, hatch, density):
+ self.num_lines = int(
+ (hatch.count('\\') + hatch.count('x') + hatch.count('X'))
+ * density)
+ if self.num_lines:
+ self.num_vertices = (self.num_lines + 1) * 2
+ else:
+ self.num_vertices = 0
+
+ def set_vertices_and_codes(self, vertices, codes):
+ steps = np.linspace(-0.5, 0.5, self.num_lines + 1)
+ vertices[0::2, 0] = 0.0 + steps
+ vertices[0::2, 1] = 1.0 + steps
+ vertices[1::2, 0] = 1.0 + steps
+ vertices[1::2, 1] = 0.0 + steps
+ codes[0::2] = Path.MOVETO
+ codes[1::2] = Path.LINETO
+
+
+class Shapes(HatchPatternBase):
+ filled = False
+
+ def __init__(self, hatch, density):
+ if self.num_rows == 0:
+ self.num_shapes = 0
+ self.num_vertices = 0
+ else:
+ self.num_shapes = ((self.num_rows // 2 + 1) * (self.num_rows + 1) +
+ (self.num_rows // 2) * self.num_rows)
+ self.num_vertices = (self.num_shapes *
+ len(self.shape_vertices) *
+ (1 if self.filled else 2))
+
+ def set_vertices_and_codes(self, vertices, codes):
+ offset = 1.0 / self.num_rows
+ shape_vertices = self.shape_vertices * offset * self.size
+ shape_codes = self.shape_codes
+ if not self.filled:
+ shape_vertices = np.concatenate( # Forward, then backward.
+ [shape_vertices, shape_vertices[::-1] * 0.9])
+ shape_codes = np.concatenate([shape_codes, shape_codes])
+ vertices_parts = []
+ codes_parts = []
+ for row in range(self.num_rows + 1):
+ if row % 2 == 0:
+ cols = np.linspace(0, 1, self.num_rows + 1)
+ else:
+ cols = np.linspace(offset / 2, 1 - offset / 2, self.num_rows)
+ row_pos = row * offset
+ for col_pos in cols:
+ vertices_parts.append(shape_vertices + [col_pos, row_pos])
+ codes_parts.append(shape_codes)
+ np.concatenate(vertices_parts, out=vertices)
+ np.concatenate(codes_parts, out=codes)
+
+
+class Circles(Shapes):
+ def __init__(self, hatch, density):
+ path = Path.unit_circle()
+ self.shape_vertices = path.vertices
+ self.shape_codes = path.codes
+ super().__init__(hatch, density)
+
+
+class SmallCircles(Circles):
+ size = 0.2
+
+ def __init__(self, hatch, density):
+ self.num_rows = (hatch.count('o')) * density
+ super().__init__(hatch, density)
+
+
+class LargeCircles(Circles):
+ size = 0.35
+
+ def __init__(self, hatch, density):
+ self.num_rows = (hatch.count('O')) * density
+ super().__init__(hatch, density)
+
+
+class SmallFilledCircles(Circles):
+ size = 0.1
+ filled = True
+
+ def __init__(self, hatch, density):
+ self.num_rows = (hatch.count('.')) * density
+ super().__init__(hatch, density)
+
+
+class Stars(Shapes):
+ size = 1.0 / 3.0
+ filled = True
+
+ def __init__(self, hatch, density):
+ self.num_rows = (hatch.count('*')) * density
+ path = Path.unit_regular_star(5)
+ self.shape_vertices = path.vertices
+ self.shape_codes = np.full(len(self.shape_vertices), Path.LINETO,
+ dtype=Path.code_type)
+ self.shape_codes[0] = Path.MOVETO
+ super().__init__(hatch, density)
+
+_hatch_types = [
+ HorizontalHatch,
+ VerticalHatch,
+ NorthEastHatch,
+ SouthEastHatch,
+ SmallCircles,
+ LargeCircles,
+ SmallFilledCircles,
+ Stars
+ ]
+
+
+def _validate_hatch_pattern(hatch):
+ valid_hatch_patterns = set(r'-+|/\xXoO.*')
+ if hatch is not None:
+ invalids = set(hatch).difference(valid_hatch_patterns)
+ if invalids:
+ valid = ''.join(sorted(valid_hatch_patterns))
+ invalids = ''.join(sorted(invalids))
+ _api.warn_deprecated(
+ '3.4',
+ removal='3.11', # one release after custom hatches (#20690)
+ message=f'hatch must consist of a string of "{valid}" or '
+ 'None, but found the following invalid values '
+ f'"{invalids}". Passing invalid values is deprecated '
+ 'since %(since)s and will become an error in %(removal)s.'
+ )
+
+
+def get_path(hatchpattern, density=6):
+ """
+ Given a hatch specifier, *hatchpattern*, generates Path to render
+ the hatch in a unit square. *density* is the number of lines per
+ unit square.
+ """
+ density = int(density)
+
+ patterns = [hatch_type(hatchpattern, density)
+ for hatch_type in _hatch_types]
+ num_vertices = sum([pattern.num_vertices for pattern in patterns])
+
+ if num_vertices == 0:
+ return Path(np.empty((0, 2)))
+
+ vertices = np.empty((num_vertices, 2))
+ codes = np.empty(num_vertices, Path.code_type)
+
+ cursor = 0
+ for pattern in patterns:
+ if pattern.num_vertices != 0:
+ vertices_chunk = vertices[cursor:cursor + pattern.num_vertices]
+ codes_chunk = codes[cursor:cursor + pattern.num_vertices]
+ pattern.set_vertices_and_codes(vertices_chunk, codes_chunk)
+ cursor += pattern.num_vertices
+
+ return Path(vertices, codes)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/hatch.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/hatch.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..348cf5214984bd0ba23b3953b2e79300d0e04e3f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/hatch.pyi
@@ -0,0 +1,68 @@
+from matplotlib.path import Path
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+class HatchPatternBase: ...
+
+class HorizontalHatch(HatchPatternBase):
+ num_lines: int
+ num_vertices: int
+ def __init__(self, hatch: str, density: int) -> None: ...
+ def set_vertices_and_codes(self, vertices: ArrayLike, codes: ArrayLike) -> None: ...
+
+class VerticalHatch(HatchPatternBase):
+ num_lines: int
+ num_vertices: int
+ def __init__(self, hatch: str, density: int) -> None: ...
+ def set_vertices_and_codes(self, vertices: ArrayLike, codes: ArrayLike) -> None: ...
+
+class NorthEastHatch(HatchPatternBase):
+ num_lines: int
+ num_vertices: int
+ def __init__(self, hatch: str, density: int) -> None: ...
+ def set_vertices_and_codes(self, vertices: ArrayLike, codes: ArrayLike) -> None: ...
+
+class SouthEastHatch(HatchPatternBase):
+ num_lines: int
+ num_vertices: int
+ def __init__(self, hatch: str, density: int) -> None: ...
+ def set_vertices_and_codes(self, vertices: ArrayLike, codes: ArrayLike) -> None: ...
+
+class Shapes(HatchPatternBase):
+ filled: bool
+ num_shapes: int
+ num_vertices: int
+ def __init__(self, hatch: str, density: int) -> None: ...
+ def set_vertices_and_codes(self, vertices: ArrayLike, codes: ArrayLike) -> None: ...
+
+class Circles(Shapes):
+ shape_vertices: np.ndarray
+ shape_codes: np.ndarray
+ def __init__(self, hatch: str, density: int) -> None: ...
+
+class SmallCircles(Circles):
+ size: float
+ num_rows: int
+ def __init__(self, hatch: str, density: int) -> None: ...
+
+class LargeCircles(Circles):
+ size: float
+ num_rows: int
+ def __init__(self, hatch: str, density: int) -> None: ...
+
+class SmallFilledCircles(Circles):
+ size: float
+ filled: bool
+ num_rows: int
+ def __init__(self, hatch: str, density: int) -> None: ...
+
+class Stars(Shapes):
+ size: float
+ filled: bool
+ num_rows: int
+ shape_vertices: np.ndarray
+ shape_codes: np.ndarray
+ def __init__(self, hatch: str, density: int) -> None: ...
+
+def get_path(hatchpattern: str, density: int = ...) -> Path: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/image.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/image.py
new file mode 100644
index 0000000000000000000000000000000000000000..bf92ec985ae25ace261ae286c65935fa769f3dca
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/image.py
@@ -0,0 +1,1786 @@
+"""
+The image module supports basic image loading, rescaling and display
+operations.
+"""
+
+import math
+import os
+import logging
+from pathlib import Path
+import warnings
+
+import numpy as np
+import PIL.Image
+import PIL.PngImagePlugin
+
+import matplotlib as mpl
+from matplotlib import _api, cbook
+# For clarity, names from _image are given explicitly in this module
+from matplotlib import _image
+# For user convenience, the names from _image are also imported into
+# the image namespace
+from matplotlib._image import * # noqa: F401, F403
+import matplotlib.artist as martist
+import matplotlib.colorizer as mcolorizer
+from matplotlib.backend_bases import FigureCanvasBase
+import matplotlib.colors as mcolors
+from matplotlib.transforms import (
+ Affine2D, BboxBase, Bbox, BboxTransform, BboxTransformTo,
+ IdentityTransform, TransformedBbox)
+
+_log = logging.getLogger(__name__)
+
+# map interpolation strings to module constants
+_interpd_ = {
+ 'auto': _image.NEAREST, # this will use nearest or Hanning...
+ 'none': _image.NEAREST, # fall back to nearest when not supported
+ 'nearest': _image.NEAREST,
+ 'bilinear': _image.BILINEAR,
+ 'bicubic': _image.BICUBIC,
+ 'spline16': _image.SPLINE16,
+ 'spline36': _image.SPLINE36,
+ 'hanning': _image.HANNING,
+ 'hamming': _image.HAMMING,
+ 'hermite': _image.HERMITE,
+ 'kaiser': _image.KAISER,
+ 'quadric': _image.QUADRIC,
+ 'catrom': _image.CATROM,
+ 'gaussian': _image.GAUSSIAN,
+ 'bessel': _image.BESSEL,
+ 'mitchell': _image.MITCHELL,
+ 'sinc': _image.SINC,
+ 'lanczos': _image.LANCZOS,
+ 'blackman': _image.BLACKMAN,
+ 'antialiased': _image.NEAREST, # this will use nearest or Hanning...
+}
+
+interpolations_names = set(_interpd_)
+
+
+def composite_images(images, renderer, magnification=1.0):
+ """
+ Composite a number of RGBA images into one. The images are
+ composited in the order in which they appear in the *images* list.
+
+ Parameters
+ ----------
+ images : list of Images
+ Each must have a `make_image` method. For each image,
+ `can_composite` should return `True`, though this is not
+ enforced by this function. Each image must have a purely
+ affine transformation with no shear.
+
+ renderer : `.RendererBase`
+
+ magnification : float, default: 1
+ The additional magnification to apply for the renderer in use.
+
+ Returns
+ -------
+ image : (M, N, 4) `numpy.uint8` array
+ The composited RGBA image.
+ offset_x, offset_y : float
+ The (left, bottom) offset where the composited image should be placed
+ in the output figure.
+ """
+ if len(images) == 0:
+ return np.empty((0, 0, 4), dtype=np.uint8), 0, 0
+
+ parts = []
+ bboxes = []
+ for image in images:
+ data, x, y, trans = image.make_image(renderer, magnification)
+ if data is not None:
+ x *= magnification
+ y *= magnification
+ parts.append((data, x, y, image._get_scalar_alpha()))
+ bboxes.append(
+ Bbox([[x, y], [x + data.shape[1], y + data.shape[0]]]))
+
+ if len(parts) == 0:
+ return np.empty((0, 0, 4), dtype=np.uint8), 0, 0
+
+ bbox = Bbox.union(bboxes)
+
+ output = np.zeros(
+ (int(bbox.height), int(bbox.width), 4), dtype=np.uint8)
+
+ for data, x, y, alpha in parts:
+ trans = Affine2D().translate(x - bbox.x0, y - bbox.y0)
+ _image.resample(data, output, trans, _image.NEAREST,
+ resample=False, alpha=alpha)
+
+ return output, bbox.x0 / magnification, bbox.y0 / magnification
+
+
+def _draw_list_compositing_images(
+ renderer, parent, artists, suppress_composite=None):
+ """
+ Draw a sorted list of artists, compositing images into a single
+ image where possible.
+
+ For internal Matplotlib use only: It is here to reduce duplication
+ between `Figure.draw` and `Axes.draw`, but otherwise should not be
+ generally useful.
+ """
+ has_images = any(isinstance(x, _ImageBase) for x in artists)
+
+ # override the renderer default if suppressComposite is not None
+ not_composite = (suppress_composite if suppress_composite is not None
+ else renderer.option_image_nocomposite())
+
+ if not_composite or not has_images:
+ for a in artists:
+ a.draw(renderer)
+ else:
+ # Composite any adjacent images together
+ image_group = []
+ mag = renderer.get_image_magnification()
+
+ def flush_images():
+ if len(image_group) == 1:
+ image_group[0].draw(renderer)
+ elif len(image_group) > 1:
+ data, l, b = composite_images(image_group, renderer, mag)
+ if data.size != 0:
+ gc = renderer.new_gc()
+ gc.set_clip_rectangle(parent.bbox)
+ gc.set_clip_path(parent.get_clip_path())
+ renderer.draw_image(gc, round(l), round(b), data)
+ gc.restore()
+ del image_group[:]
+
+ for a in artists:
+ if (isinstance(a, _ImageBase) and a.can_composite() and
+ a.get_clip_on() and not a.get_clip_path()):
+ image_group.append(a)
+ else:
+ flush_images()
+ a.draw(renderer)
+ flush_images()
+
+
+def _resample(
+ image_obj, data, out_shape, transform, *, resample=None, alpha=1):
+ """
+ Convenience wrapper around `._image.resample` to resample *data* to
+ *out_shape* (with a third dimension if *data* is RGBA) that takes care of
+ allocating the output array and fetching the relevant properties from the
+ Image object *image_obj*.
+ """
+ # AGG can only handle coordinates smaller than 24-bit signed integers,
+ # so raise errors if the input data is larger than _image.resample can
+ # handle.
+ msg = ('Data with more than {n} cannot be accurately displayed. '
+ 'Downsampling to less than {n} before displaying. '
+ 'To remove this warning, manually downsample your data.')
+ if data.shape[1] > 2**23:
+ warnings.warn(msg.format(n='2**23 columns'))
+ step = int(np.ceil(data.shape[1] / 2**23))
+ data = data[:, ::step]
+ transform = Affine2D().scale(step, 1) + transform
+ if data.shape[0] > 2**24:
+ warnings.warn(msg.format(n='2**24 rows'))
+ step = int(np.ceil(data.shape[0] / 2**24))
+ data = data[::step, :]
+ transform = Affine2D().scale(1, step) + transform
+ # decide if we need to apply anti-aliasing if the data is upsampled:
+ # compare the number of displayed pixels to the number of
+ # the data pixels.
+ interpolation = image_obj.get_interpolation()
+ if interpolation in ['antialiased', 'auto']:
+ # don't antialias if upsampling by an integer number or
+ # if zooming in more than a factor of 3
+ pos = np.array([[0, 0], [data.shape[1], data.shape[0]]])
+ disp = transform.transform(pos)
+ dispx = np.abs(np.diff(disp[:, 0]))
+ dispy = np.abs(np.diff(disp[:, 1]))
+ if ((dispx > 3 * data.shape[1] or
+ dispx == data.shape[1] or
+ dispx == 2 * data.shape[1]) and
+ (dispy > 3 * data.shape[0] or
+ dispy == data.shape[0] or
+ dispy == 2 * data.shape[0])):
+ interpolation = 'nearest'
+ else:
+ interpolation = 'hanning'
+ out = np.zeros(out_shape + data.shape[2:], data.dtype) # 2D->2D, 3D->3D.
+ if resample is None:
+ resample = image_obj.get_resample()
+ _image.resample(data, out, transform,
+ _interpd_[interpolation],
+ resample,
+ alpha,
+ image_obj.get_filternorm(),
+ image_obj.get_filterrad())
+ return out
+
+
+def _rgb_to_rgba(A):
+ """
+ Convert an RGB image to RGBA, as required by the image resample C++
+ extension.
+ """
+ rgba = np.zeros((A.shape[0], A.shape[1], 4), dtype=A.dtype)
+ rgba[:, :, :3] = A
+ if rgba.dtype == np.uint8:
+ rgba[:, :, 3] = 255
+ else:
+ rgba[:, :, 3] = 1.0
+ return rgba
+
+
+class _ImageBase(mcolorizer.ColorizingArtist):
+ """
+ Base class for images.
+
+ interpolation and cmap default to their rc settings
+
+ cmap is a colors.Colormap instance
+ norm is a colors.Normalize instance to map luminance to 0-1
+
+ extent is data axes (left, right, bottom, top) for making image plots
+ registered with data plots. Default is to label the pixel
+ centers with the zero-based row and column indices.
+
+ Additional kwargs are matplotlib.artist properties
+ """
+ zorder = 0
+
+ def __init__(self, ax,
+ cmap=None,
+ norm=None,
+ colorizer=None,
+ interpolation=None,
+ origin=None,
+ filternorm=True,
+ filterrad=4.0,
+ resample=False,
+ *,
+ interpolation_stage=None,
+ **kwargs
+ ):
+ super().__init__(self._get_colorizer(cmap, norm, colorizer))
+ if origin is None:
+ origin = mpl.rcParams['image.origin']
+ _api.check_in_list(["upper", "lower"], origin=origin)
+ self.origin = origin
+ self.set_filternorm(filternorm)
+ self.set_filterrad(filterrad)
+ self.set_interpolation(interpolation)
+ self.set_interpolation_stage(interpolation_stage)
+ self.set_resample(resample)
+ self.axes = ax
+
+ self._imcache = None
+
+ self._internal_update(kwargs)
+
+ def __str__(self):
+ try:
+ shape = self.get_shape()
+ return f"{type(self).__name__}(shape={shape!r})"
+ except RuntimeError:
+ return type(self).__name__
+
+ def __getstate__(self):
+ # Save some space on the pickle by not saving the cache.
+ return {**super().__getstate__(), "_imcache": None}
+
+ def get_size(self):
+ """Return the size of the image as tuple (numrows, numcols)."""
+ return self.get_shape()[:2]
+
+ def get_shape(self):
+ """
+ Return the shape of the image as tuple (numrows, numcols, channels).
+ """
+ if self._A is None:
+ raise RuntimeError('You must first set the image array')
+
+ return self._A.shape
+
+ def set_alpha(self, alpha):
+ """
+ Set the alpha value used for blending - not supported on all backends.
+
+ Parameters
+ ----------
+ alpha : float or 2D array-like or None
+ """
+ martist.Artist._set_alpha_for_array(self, alpha)
+ if np.ndim(alpha) not in (0, 2):
+ raise TypeError('alpha must be a float, two-dimensional '
+ 'array, or None')
+ self._imcache = None
+
+ def _get_scalar_alpha(self):
+ """
+ Get a scalar alpha value to be applied to the artist as a whole.
+
+ If the alpha value is a matrix, the method returns 1.0 because pixels
+ have individual alpha values (see `~._ImageBase._make_image` for
+ details). If the alpha value is a scalar, the method returns said value
+ to be applied to the artist as a whole because pixels do not have
+ individual alpha values.
+ """
+ return 1.0 if self._alpha is None or np.ndim(self._alpha) > 0 \
+ else self._alpha
+
+ def changed(self):
+ """
+ Call this whenever the mappable is changed so observers can update.
+ """
+ self._imcache = None
+ super().changed()
+
+ def _make_image(self, A, in_bbox, out_bbox, clip_bbox, magnification=1.0,
+ unsampled=False, round_to_pixel_border=True):
+ """
+ Normalize, rescale, and colormap the image *A* from the given *in_bbox*
+ (in data space), to the given *out_bbox* (in pixel space) clipped to
+ the given *clip_bbox* (also in pixel space), and magnified by the
+ *magnification* factor.
+
+ Parameters
+ ----------
+ A : ndarray
+
+ - a (M, N) array interpreted as scalar (greyscale) image,
+ with one of the dtypes `~numpy.float32`, `~numpy.float64`,
+ `~numpy.float128`, `~numpy.uint16` or `~numpy.uint8`.
+ - (M, N, 4) RGBA image with a dtype of `~numpy.float32`,
+ `~numpy.float64`, `~numpy.float128`, or `~numpy.uint8`.
+
+ in_bbox : `~matplotlib.transforms.Bbox`
+
+ out_bbox : `~matplotlib.transforms.Bbox`
+
+ clip_bbox : `~matplotlib.transforms.Bbox`
+
+ magnification : float, default: 1
+
+ unsampled : bool, default: False
+ If True, the image will not be scaled, but an appropriate
+ affine transformation will be returned instead.
+
+ round_to_pixel_border : bool, default: True
+ If True, the output image size will be rounded to the nearest pixel
+ boundary. This makes the images align correctly with the Axes.
+ It should not be used if exact scaling is needed, such as for
+ `.FigureImage`.
+
+ Returns
+ -------
+ image : (M, N, 4) `numpy.uint8` array
+ The RGBA image, resampled unless *unsampled* is True.
+ x, y : float
+ The upper left corner where the image should be drawn, in pixel
+ space.
+ trans : `~matplotlib.transforms.Affine2D`
+ The affine transformation from image to pixel space.
+ """
+ if A is None:
+ raise RuntimeError('You must first set the image '
+ 'array or the image attribute')
+ if A.size == 0:
+ raise RuntimeError("_make_image must get a non-empty image. "
+ "Your Artist's draw method must filter before "
+ "this method is called.")
+
+ clipped_bbox = Bbox.intersection(out_bbox, clip_bbox)
+
+ if clipped_bbox is None:
+ return None, 0, 0, None
+
+ out_width_base = clipped_bbox.width * magnification
+ out_height_base = clipped_bbox.height * magnification
+
+ if out_width_base == 0 or out_height_base == 0:
+ return None, 0, 0, None
+
+ if self.origin == 'upper':
+ # Flip the input image using a transform. This avoids the
+ # problem with flipping the array, which results in a copy
+ # when it is converted to contiguous in the C wrapper
+ t0 = Affine2D().translate(0, -A.shape[0]).scale(1, -1)
+ else:
+ t0 = IdentityTransform()
+
+ t0 += (
+ Affine2D()
+ .scale(
+ in_bbox.width / A.shape[1],
+ in_bbox.height / A.shape[0])
+ .translate(in_bbox.x0, in_bbox.y0)
+ + self.get_transform())
+
+ t = (t0
+ + (Affine2D()
+ .translate(-clipped_bbox.x0, -clipped_bbox.y0)
+ .scale(magnification)))
+
+ # So that the image is aligned with the edge of the Axes, we want to
+ # round up the output width to the next integer. This also means
+ # scaling the transform slightly to account for the extra subpixel.
+ if ((not unsampled) and t.is_affine and round_to_pixel_border and
+ (out_width_base % 1.0 != 0.0 or out_height_base % 1.0 != 0.0)):
+ out_width = math.ceil(out_width_base)
+ out_height = math.ceil(out_height_base)
+ extra_width = (out_width - out_width_base) / out_width_base
+ extra_height = (out_height - out_height_base) / out_height_base
+ t += Affine2D().scale(1.0 + extra_width, 1.0 + extra_height)
+ else:
+ out_width = int(out_width_base)
+ out_height = int(out_height_base)
+ out_shape = (out_height, out_width)
+
+ if not unsampled:
+ if not (A.ndim == 2 or A.ndim == 3 and A.shape[-1] in (3, 4)):
+ raise ValueError(f"Invalid shape {A.shape} for image data")
+
+ # if antialiased, this needs to change as window sizes
+ # change:
+ interpolation_stage = self._interpolation_stage
+ if interpolation_stage in ['antialiased', 'auto']:
+ pos = np.array([[0, 0], [A.shape[1], A.shape[0]]])
+ disp = t.transform(pos)
+ dispx = np.abs(np.diff(disp[:, 0])) / A.shape[1]
+ dispy = np.abs(np.diff(disp[:, 1])) / A.shape[0]
+ if (dispx < 3) or (dispy < 3):
+ interpolation_stage = 'rgba'
+ else:
+ interpolation_stage = 'data'
+
+ if A.ndim == 2 and interpolation_stage == 'data':
+ # if we are a 2D array, then we are running through the
+ # norm + colormap transformation. However, in general the
+ # input data is not going to match the size on the screen so we
+ # have to resample to the correct number of pixels
+
+ if A.dtype.kind == 'f': # Float dtype: scale to same dtype.
+ scaled_dtype = np.dtype("f8" if A.dtype.itemsize > 4 else "f4")
+ if scaled_dtype.itemsize < A.dtype.itemsize:
+ _api.warn_external(f"Casting input data from {A.dtype}"
+ f" to {scaled_dtype} for imshow.")
+ else: # Int dtype, likely.
+ # TODO slice input array first
+ # Scale to appropriately sized float: use float32 if the
+ # dynamic range is small, to limit the memory footprint.
+ da = A.max().astype("f8") - A.min().astype("f8")
+ scaled_dtype = "f8" if da > 1e8 else "f4"
+
+ # resample the input data to the correct resolution and shape
+ A_resampled = _resample(self, A.astype(scaled_dtype), out_shape, t)
+
+ # if using NoNorm, cast back to the original datatype
+ if isinstance(self.norm, mcolors.NoNorm):
+ A_resampled = A_resampled.astype(A.dtype)
+
+ # Compute out_mask (what screen pixels include "bad" data
+ # pixels) and out_alpha (to what extent screen pixels are
+ # covered by data pixels: 0 outside the data extent, 1 inside
+ # (even for bad data), and intermediate values at the edges).
+ mask = (np.where(A.mask, np.float32(np.nan), np.float32(1))
+ if A.mask.shape == A.shape # nontrivial mask
+ else np.ones_like(A, np.float32))
+ # we always have to interpolate the mask to account for
+ # non-affine transformations
+ out_alpha = _resample(self, mask, out_shape, t, resample=True)
+ del mask # Make sure we don't use mask anymore!
+ out_mask = np.isnan(out_alpha)
+ out_alpha[out_mask] = 1
+ # Apply the pixel-by-pixel alpha values if present
+ alpha = self.get_alpha()
+ if alpha is not None and np.ndim(alpha) > 0:
+ out_alpha *= _resample(self, alpha, out_shape, t, resample=True)
+ # mask and run through the norm
+ resampled_masked = np.ma.masked_array(A_resampled, out_mask)
+ output = self.norm(resampled_masked)
+ else:
+ if A.ndim == 2: # interpolation_stage = 'rgba'
+ self.norm.autoscale_None(A)
+ A = self.to_rgba(A)
+ alpha = self.get_alpha()
+ if alpha is None: # alpha parameter not specified
+ if A.shape[2] == 3: # image has no alpha channel
+ output_alpha = 255 if A.dtype == np.uint8 else 1.0
+ else:
+ output_alpha = _resample( # resample alpha channel
+ self, A[..., 3], out_shape, t)
+ output = _resample( # resample rgb channels
+ self, _rgb_to_rgba(A[..., :3]), out_shape, t)
+ elif np.ndim(alpha) > 0: # Array alpha
+ # user-specified array alpha overrides the existing alpha channel
+ output_alpha = _resample(self, alpha, out_shape, t)
+ output = _resample(
+ self, _rgb_to_rgba(A[..., :3]), out_shape, t)
+ else: # Scalar alpha
+ if A.shape[2] == 3: # broadcast scalar alpha
+ output_alpha = (255 * alpha) if A.dtype == np.uint8 else alpha
+ else: # or apply scalar alpha to existing alpha channel
+ output_alpha = _resample(self, A[..., 3], out_shape, t) * alpha
+ output = _resample(
+ self, _rgb_to_rgba(A[..., :3]), out_shape, t)
+ output[..., 3] = output_alpha # recombine rgb and alpha
+
+ # output is now either a 2D array of normed (int or float) data
+ # or an RGBA array of re-sampled input
+ output = self.to_rgba(output, bytes=True, norm=False)
+ # output is now a correctly sized RGBA array of uint8
+
+ # Apply alpha *after* if the input was greyscale without a mask
+ if A.ndim == 2:
+ alpha = self._get_scalar_alpha()
+ alpha_channel = output[:, :, 3]
+ alpha_channel[:] = ( # Assignment will cast to uint8.
+ alpha_channel.astype(np.float32) * out_alpha * alpha)
+
+ else:
+ if self._imcache is None:
+ self._imcache = self.to_rgba(A, bytes=True, norm=(A.ndim == 2))
+ output = self._imcache
+
+ # Subset the input image to only the part that will be displayed.
+ subset = TransformedBbox(clip_bbox, t0.inverted()).frozen()
+ output = output[
+ int(max(subset.ymin, 0)):
+ int(min(subset.ymax + 1, output.shape[0])),
+ int(max(subset.xmin, 0)):
+ int(min(subset.xmax + 1, output.shape[1]))]
+
+ t = Affine2D().translate(
+ int(max(subset.xmin, 0)), int(max(subset.ymin, 0))) + t
+
+ return output, clipped_bbox.x0, clipped_bbox.y0, t
+
+ def make_image(self, renderer, magnification=1.0, unsampled=False):
+ """
+ Normalize, rescale, and colormap this image's data for rendering using
+ *renderer*, with the given *magnification*.
+
+ If *unsampled* is True, the image will not be scaled, but an
+ appropriate affine transformation will be returned instead.
+
+ Returns
+ -------
+ image : (M, N, 4) `numpy.uint8` array
+ The RGBA image, resampled unless *unsampled* is True.
+ x, y : float
+ The upper left corner where the image should be drawn, in pixel
+ space.
+ trans : `~matplotlib.transforms.Affine2D`
+ The affine transformation from image to pixel space.
+ """
+ raise NotImplementedError('The make_image method must be overridden')
+
+ def _check_unsampled_image(self):
+ """
+ Return whether the image is better to be drawn unsampled.
+
+ The derived class needs to override it.
+ """
+ return False
+
+ @martist.allow_rasterization
+ def draw(self, renderer):
+ # if not visible, declare victory and return
+ if not self.get_visible():
+ self.stale = False
+ return
+ # for empty images, there is nothing to draw!
+ if self.get_array().size == 0:
+ self.stale = False
+ return
+ # actually render the image.
+ gc = renderer.new_gc()
+ self._set_gc_clip(gc)
+ gc.set_alpha(self._get_scalar_alpha())
+ gc.set_url(self.get_url())
+ gc.set_gid(self.get_gid())
+ if (renderer.option_scale_image() # Renderer supports transform kwarg.
+ and self._check_unsampled_image()
+ and self.get_transform().is_affine):
+ im, l, b, trans = self.make_image(renderer, unsampled=True)
+ if im is not None:
+ trans = Affine2D().scale(im.shape[1], im.shape[0]) + trans
+ renderer.draw_image(gc, l, b, im, trans)
+ else:
+ im, l, b, trans = self.make_image(
+ renderer, renderer.get_image_magnification())
+ if im is not None:
+ renderer.draw_image(gc, l, b, im)
+ gc.restore()
+ self.stale = False
+
+ def contains(self, mouseevent):
+ """Test whether the mouse event occurred within the image."""
+ if (self._different_canvas(mouseevent)
+ # This doesn't work for figimage.
+ or not self.axes.contains(mouseevent)[0]):
+ return False, {}
+ # TODO: make sure this is consistent with patch and patch
+ # collection on nonlinear transformed coordinates.
+ # TODO: consider returning image coordinates (shouldn't
+ # be too difficult given that the image is rectilinear
+ trans = self.get_transform().inverted()
+ x, y = trans.transform([mouseevent.x, mouseevent.y])
+ xmin, xmax, ymin, ymax = self.get_extent()
+ # This checks xmin <= x <= xmax *or* xmax <= x <= xmin.
+ inside = (x is not None and (x - xmin) * (x - xmax) <= 0
+ and y is not None and (y - ymin) * (y - ymax) <= 0)
+ return inside, {}
+
+ def write_png(self, fname):
+ """Write the image to png file *fname*."""
+ im = self.to_rgba(self._A[::-1] if self.origin == 'lower' else self._A,
+ bytes=True, norm=True)
+ PIL.Image.fromarray(im).save(fname, format="png")
+
+ @staticmethod
+ def _normalize_image_array(A):
+ """
+ Check validity of image-like input *A* and normalize it to a format suitable for
+ Image subclasses.
+ """
+ A = cbook.safe_masked_invalid(A, copy=True)
+ if A.dtype != np.uint8 and not np.can_cast(A.dtype, float, "same_kind"):
+ raise TypeError(f"Image data of dtype {A.dtype} cannot be "
+ f"converted to float")
+ if A.ndim == 3 and A.shape[-1] == 1:
+ A = A.squeeze(-1) # If just (M, N, 1), assume scalar and apply colormap.
+ if not (A.ndim == 2 or A.ndim == 3 and A.shape[-1] in [3, 4]):
+ raise TypeError(f"Invalid shape {A.shape} for image data")
+ if A.ndim == 3:
+ # If the input data has values outside the valid range (after
+ # normalisation), we issue a warning and then clip X to the bounds
+ # - otherwise casting wraps extreme values, hiding outliers and
+ # making reliable interpretation impossible.
+ high = 255 if np.issubdtype(A.dtype, np.integer) else 1
+ if A.min() < 0 or high < A.max():
+ _log.warning(
+ 'Clipping input data to the valid range for imshow with '
+ 'RGB data ([0..1] for floats or [0..255] for integers). '
+ 'Got range [%s..%s].',
+ A.min(), A.max()
+ )
+ A = np.clip(A, 0, high)
+ # Cast unsupported integer types to uint8
+ if A.dtype != np.uint8 and np.issubdtype(A.dtype, np.integer):
+ A = A.astype(np.uint8)
+ return A
+
+ def set_data(self, A):
+ """
+ Set the image array.
+
+ Note that this function does *not* update the normalization used.
+
+ Parameters
+ ----------
+ A : array-like or `PIL.Image.Image`
+ """
+ if isinstance(A, PIL.Image.Image):
+ A = pil_to_array(A) # Needed e.g. to apply png palette.
+ self._A = self._normalize_image_array(A)
+ self._imcache = None
+ self.stale = True
+
+ def set_array(self, A):
+ """
+ Retained for backwards compatibility - use set_data instead.
+
+ Parameters
+ ----------
+ A : array-like
+ """
+ # This also needs to be here to override the inherited
+ # cm.ScalarMappable.set_array method so it is not invoked by mistake.
+ self.set_data(A)
+
+ def get_interpolation(self):
+ """
+ Return the interpolation method the image uses when resizing.
+
+ One of 'auto', 'antialiased', 'nearest', 'bilinear', 'bicubic',
+ 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 'kaiser',
+ 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos',
+ or 'none'.
+ """
+ return self._interpolation
+
+ def set_interpolation(self, s):
+ """
+ Set the interpolation method the image uses when resizing.
+
+ If None, use :rc:`image.interpolation`. If 'none', the image is
+ shown as is without interpolating. 'none' is only supported in
+ agg, ps and pdf backends and will fall back to 'nearest' mode
+ for other backends.
+
+ Parameters
+ ----------
+ s : {'auto', 'nearest', 'bilinear', 'bicubic', 'spline16', \
+'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric', 'catrom', \
+'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos', 'none'} or None
+ """
+ s = mpl._val_or_rc(s, 'image.interpolation').lower()
+ _api.check_in_list(interpolations_names, interpolation=s)
+ self._interpolation = s
+ self.stale = True
+
+ def get_interpolation_stage(self):
+ """
+ Return when interpolation happens during the transform to RGBA.
+
+ One of 'data', 'rgba', 'auto'.
+ """
+ return self._interpolation_stage
+
+ def set_interpolation_stage(self, s):
+ """
+ Set when interpolation happens during the transform to RGBA.
+
+ Parameters
+ ----------
+ s : {'data', 'rgba', 'auto'} or None
+ Whether to apply up/downsampling interpolation in data or RGBA
+ space. If None, use :rc:`image.interpolation_stage`.
+ If 'auto' we will check upsampling rate and if less
+ than 3 then use 'rgba', otherwise use 'data'.
+ """
+ s = mpl._val_or_rc(s, 'image.interpolation_stage')
+ _api.check_in_list(['data', 'rgba', 'auto'], s=s)
+ self._interpolation_stage = s
+ self.stale = True
+
+ def can_composite(self):
+ """Return whether the image can be composited with its neighbors."""
+ trans = self.get_transform()
+ return (
+ self._interpolation != 'none' and
+ trans.is_affine and
+ trans.is_separable)
+
+ def set_resample(self, v):
+ """
+ Set whether image resampling is used.
+
+ Parameters
+ ----------
+ v : bool or None
+ If None, use :rc:`image.resample`.
+ """
+ v = mpl._val_or_rc(v, 'image.resample')
+ self._resample = v
+ self.stale = True
+
+ def get_resample(self):
+ """Return whether image resampling is used."""
+ return self._resample
+
+ def set_filternorm(self, filternorm):
+ """
+ Set whether the resize filter normalizes the weights.
+
+ See help for `~.Axes.imshow`.
+
+ Parameters
+ ----------
+ filternorm : bool
+ """
+ self._filternorm = bool(filternorm)
+ self.stale = True
+
+ def get_filternorm(self):
+ """Return whether the resize filter normalizes the weights."""
+ return self._filternorm
+
+ def set_filterrad(self, filterrad):
+ """
+ Set the resize filter radius only applicable to some
+ interpolation schemes -- see help for imshow
+
+ Parameters
+ ----------
+ filterrad : positive float
+ """
+ r = float(filterrad)
+ if r <= 0:
+ raise ValueError("The filter radius must be a positive number")
+ self._filterrad = r
+ self.stale = True
+
+ def get_filterrad(self):
+ """Return the filterrad setting."""
+ return self._filterrad
+
+
+class AxesImage(_ImageBase):
+ """
+ An image with pixels on a regular grid, attached to an Axes.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The Axes the image will belong to.
+ cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
+ The Colormap instance or registered colormap name used to map scalar
+ data to colors.
+ norm : str or `~matplotlib.colors.Normalize`
+ Maps luminance to 0-1.
+ interpolation : str, default: :rc:`image.interpolation`
+ Supported values are 'none', 'auto', 'nearest', 'bilinear',
+ 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite',
+ 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell',
+ 'sinc', 'lanczos', 'blackman'.
+ interpolation_stage : {'data', 'rgba'}, default: 'data'
+ If 'data', interpolation
+ is carried out on the data provided by the user. If 'rgba', the
+ interpolation is carried out after the colormapping has been
+ applied (visual interpolation).
+ origin : {'upper', 'lower'}, default: :rc:`image.origin`
+ Place the [0, 0] index of the array in the upper left or lower left
+ corner of the Axes. The convention 'upper' is typically used for
+ matrices and images.
+ extent : tuple, optional
+ The data axes (left, right, bottom, top) for making image plots
+ registered with data plots. Default is to label the pixel
+ centers with the zero-based row and column indices.
+ filternorm : bool, default: True
+ A parameter for the antigrain image resize filter
+ (see the antigrain documentation).
+ If filternorm is set, the filter normalizes integer values and corrects
+ the rounding errors. It doesn't do anything with the source floating
+ point values, it corrects only integers according to the rule of 1.0
+ which means that any sum of pixel weights must be equal to 1.0. So,
+ the filter function must produce a graph of the proper shape.
+ filterrad : float > 0, default: 4
+ The filter radius for filters that have a radius parameter, i.e. when
+ interpolation is one of: 'sinc', 'lanczos' or 'blackman'.
+ resample : bool, default: False
+ When True, use a full resampling method. When False, only resample when
+ the output image is larger than the input image.
+ **kwargs : `~matplotlib.artist.Artist` properties
+ """
+
+ def __init__(self, ax,
+ *,
+ cmap=None,
+ norm=None,
+ colorizer=None,
+ interpolation=None,
+ origin=None,
+ extent=None,
+ filternorm=True,
+ filterrad=4.0,
+ resample=False,
+ interpolation_stage=None,
+ **kwargs
+ ):
+
+ self._extent = extent
+
+ super().__init__(
+ ax,
+ cmap=cmap,
+ norm=norm,
+ colorizer=colorizer,
+ interpolation=interpolation,
+ origin=origin,
+ filternorm=filternorm,
+ filterrad=filterrad,
+ resample=resample,
+ interpolation_stage=interpolation_stage,
+ **kwargs
+ )
+
+ def get_window_extent(self, renderer=None):
+ x0, x1, y0, y1 = self._extent
+ bbox = Bbox.from_extents([x0, y0, x1, y1])
+ return bbox.transformed(self.get_transform())
+
+ def make_image(self, renderer, magnification=1.0, unsampled=False):
+ # docstring inherited
+ trans = self.get_transform()
+ # image is created in the canvas coordinate.
+ x1, x2, y1, y2 = self.get_extent()
+ bbox = Bbox(np.array([[x1, y1], [x2, y2]]))
+ transformed_bbox = TransformedBbox(bbox, trans)
+ clip = ((self.get_clip_box() or self.axes.bbox) if self.get_clip_on()
+ else self.get_figure(root=True).bbox)
+ return self._make_image(self._A, bbox, transformed_bbox, clip,
+ magnification, unsampled=unsampled)
+
+ def _check_unsampled_image(self):
+ """Return whether the image would be better drawn unsampled."""
+ return self.get_interpolation() == "none"
+
+ def set_extent(self, extent, **kwargs):
+ """
+ Set the image extent.
+
+ Parameters
+ ----------
+ extent : 4-tuple of float
+ The position and size of the image as tuple
+ ``(left, right, bottom, top)`` in data coordinates.
+ **kwargs
+ Other parameters from which unit info (i.e., the *xunits*,
+ *yunits*, *zunits* (for 3D Axes), *runits* and *thetaunits* (for
+ polar Axes) entries are applied, if present.
+
+ Notes
+ -----
+ This updates `.Axes.dataLim`, and, if autoscaling, sets `.Axes.viewLim`
+ to tightly fit the image, regardless of `~.Axes.dataLim`. Autoscaling
+ state is not changed, so a subsequent call to `.Axes.autoscale_view`
+ will redo the autoscaling in accord with `~.Axes.dataLim`.
+ """
+ (xmin, xmax), (ymin, ymax) = self.axes._process_unit_info(
+ [("x", [extent[0], extent[1]]),
+ ("y", [extent[2], extent[3]])],
+ kwargs)
+ if kwargs:
+ raise _api.kwarg_error("set_extent", kwargs)
+ xmin = self.axes._validate_converted_limits(
+ xmin, self.convert_xunits)
+ xmax = self.axes._validate_converted_limits(
+ xmax, self.convert_xunits)
+ ymin = self.axes._validate_converted_limits(
+ ymin, self.convert_yunits)
+ ymax = self.axes._validate_converted_limits(
+ ymax, self.convert_yunits)
+ extent = [xmin, xmax, ymin, ymax]
+
+ self._extent = extent
+ corners = (xmin, ymin), (xmax, ymax)
+ self.axes.update_datalim(corners)
+ self.sticky_edges.x[:] = [xmin, xmax]
+ self.sticky_edges.y[:] = [ymin, ymax]
+ if self.axes.get_autoscalex_on():
+ self.axes.set_xlim((xmin, xmax), auto=None)
+ if self.axes.get_autoscaley_on():
+ self.axes.set_ylim((ymin, ymax), auto=None)
+ self.stale = True
+
+ def get_extent(self):
+ """Return the image extent as tuple (left, right, bottom, top)."""
+ if self._extent is not None:
+ return self._extent
+ else:
+ sz = self.get_size()
+ numrows, numcols = sz
+ if self.origin == 'upper':
+ return (-0.5, numcols-0.5, numrows-0.5, -0.5)
+ else:
+ return (-0.5, numcols-0.5, -0.5, numrows-0.5)
+
+ def get_cursor_data(self, event):
+ """
+ Return the image value at the event position or *None* if the event is
+ outside the image.
+
+ See Also
+ --------
+ matplotlib.artist.Artist.get_cursor_data
+ """
+ xmin, xmax, ymin, ymax = self.get_extent()
+ if self.origin == 'upper':
+ ymin, ymax = ymax, ymin
+ arr = self.get_array()
+ data_extent = Bbox([[xmin, ymin], [xmax, ymax]])
+ array_extent = Bbox([[0, 0], [arr.shape[1], arr.shape[0]]])
+ trans = self.get_transform().inverted()
+ trans += BboxTransform(boxin=data_extent, boxout=array_extent)
+ point = trans.transform([event.x, event.y])
+ if any(np.isnan(point)):
+ return None
+ j, i = point.astype(int)
+ # Clip the coordinates at array bounds
+ if not (0 <= i < arr.shape[0]) or not (0 <= j < arr.shape[1]):
+ return None
+ else:
+ return arr[i, j]
+
+
+class NonUniformImage(AxesImage):
+ """
+ An image with pixels on a rectilinear grid.
+
+ In contrast to `.AxesImage`, where pixels are on a regular grid,
+ NonUniformImage allows rows and columns with individual heights / widths.
+
+ See also :doc:`/gallery/images_contours_and_fields/image_nonuniform`.
+ """
+
+ def __init__(self, ax, *, interpolation='nearest', **kwargs):
+ """
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The Axes the image will belong to.
+ interpolation : {'nearest', 'bilinear'}, default: 'nearest'
+ The interpolation scheme used in the resampling.
+ **kwargs
+ All other keyword arguments are identical to those of `.AxesImage`.
+ """
+ super().__init__(ax, **kwargs)
+ self.set_interpolation(interpolation)
+
+ def _check_unsampled_image(self):
+ """Return False. Do not use unsampled image."""
+ return False
+
+ def make_image(self, renderer, magnification=1.0, unsampled=False):
+ # docstring inherited
+ if self._A is None:
+ raise RuntimeError('You must first set the image array')
+ if unsampled:
+ raise ValueError('unsampled not supported on NonUniformImage')
+ A = self._A
+ if A.ndim == 2:
+ if A.dtype != np.uint8:
+ A = self.to_rgba(A, bytes=True)
+ else:
+ A = np.repeat(A[:, :, np.newaxis], 4, 2)
+ A[:, :, 3] = 255
+ else:
+ if A.dtype != np.uint8:
+ A = (255*A).astype(np.uint8)
+ if A.shape[2] == 3:
+ B = np.zeros(tuple([*A.shape[0:2], 4]), np.uint8)
+ B[:, :, 0:3] = A
+ B[:, :, 3] = 255
+ A = B
+ l, b, r, t = self.axes.bbox.extents
+ width = int(((round(r) + 0.5) - (round(l) - 0.5)) * magnification)
+ height = int(((round(t) + 0.5) - (round(b) - 0.5)) * magnification)
+
+ invertedTransform = self.axes.transData.inverted()
+ x_pix = invertedTransform.transform(
+ [(x, b) for x in np.linspace(l, r, width)])[:, 0]
+ y_pix = invertedTransform.transform(
+ [(l, y) for y in np.linspace(b, t, height)])[:, 1]
+
+ if self._interpolation == "nearest":
+ x_mid = (self._Ax[:-1] + self._Ax[1:]) / 2
+ y_mid = (self._Ay[:-1] + self._Ay[1:]) / 2
+ x_int = x_mid.searchsorted(x_pix)
+ y_int = y_mid.searchsorted(y_pix)
+ # The following is equal to `A[y_int[:, None], x_int[None, :]]`,
+ # but many times faster. Both casting to uint32 (to have an
+ # effectively 1D array) and manual index flattening matter.
+ im = (
+ np.ascontiguousarray(A).view(np.uint32).ravel()[
+ np.add.outer(y_int * A.shape[1], x_int)]
+ .view(np.uint8).reshape((height, width, 4)))
+ else: # self._interpolation == "bilinear"
+ # Use np.interp to compute x_int/x_float has similar speed.
+ x_int = np.clip(
+ self._Ax.searchsorted(x_pix) - 1, 0, len(self._Ax) - 2)
+ y_int = np.clip(
+ self._Ay.searchsorted(y_pix) - 1, 0, len(self._Ay) - 2)
+ idx_int = np.add.outer(y_int * A.shape[1], x_int)
+ x_frac = np.clip(
+ np.divide(x_pix - self._Ax[x_int], np.diff(self._Ax)[x_int],
+ dtype=np.float32), # Downcasting helps with speed.
+ 0, 1)
+ y_frac = np.clip(
+ np.divide(y_pix - self._Ay[y_int], np.diff(self._Ay)[y_int],
+ dtype=np.float32),
+ 0, 1)
+ f00 = np.outer(1 - y_frac, 1 - x_frac)
+ f10 = np.outer(y_frac, 1 - x_frac)
+ f01 = np.outer(1 - y_frac, x_frac)
+ f11 = np.outer(y_frac, x_frac)
+ im = np.empty((height, width, 4), np.uint8)
+ for chan in range(4):
+ ac = A[:, :, chan].reshape(-1) # reshape(-1) avoids a copy.
+ # Shifting the buffer start (`ac[offset:]`) avoids an array
+ # addition (`ac[idx_int + offset]`).
+ buf = f00 * ac[idx_int]
+ buf += f10 * ac[A.shape[1]:][idx_int]
+ buf += f01 * ac[1:][idx_int]
+ buf += f11 * ac[A.shape[1] + 1:][idx_int]
+ im[:, :, chan] = buf # Implicitly casts to uint8.
+ return im, l, b, IdentityTransform()
+
+ def set_data(self, x, y, A):
+ """
+ Set the grid for the pixel centers, and the pixel values.
+
+ Parameters
+ ----------
+ x, y : 1D array-like
+ Monotonic arrays of shapes (N,) and (M,), respectively, specifying
+ pixel centers.
+ A : array-like
+ (M, N) `~numpy.ndarray` or masked array of values to be
+ colormapped, or (M, N, 3) RGB array, or (M, N, 4) RGBA array.
+ """
+ A = self._normalize_image_array(A)
+ x = np.array(x, np.float32)
+ y = np.array(y, np.float32)
+ if not (x.ndim == y.ndim == 1 and A.shape[:2] == y.shape + x.shape):
+ raise TypeError("Axes don't match array shape")
+ self._A = A
+ self._Ax = x
+ self._Ay = y
+ self._imcache = None
+ self.stale = True
+
+ def set_array(self, *args):
+ raise NotImplementedError('Method not supported')
+
+ def set_interpolation(self, s):
+ """
+ Parameters
+ ----------
+ s : {'nearest', 'bilinear'} or None
+ If None, use :rc:`image.interpolation`.
+ """
+ if s is not None and s not in ('nearest', 'bilinear'):
+ raise NotImplementedError('Only nearest neighbor and '
+ 'bilinear interpolations are supported')
+ super().set_interpolation(s)
+
+ def get_extent(self):
+ if self._A is None:
+ raise RuntimeError('Must set data first')
+ return self._Ax[0], self._Ax[-1], self._Ay[0], self._Ay[-1]
+
+ def set_filternorm(self, filternorm):
+ pass
+
+ def set_filterrad(self, filterrad):
+ pass
+
+ def set_norm(self, norm):
+ if self._A is not None:
+ raise RuntimeError('Cannot change colors after loading data')
+ super().set_norm(norm)
+
+ def set_cmap(self, cmap):
+ if self._A is not None:
+ raise RuntimeError('Cannot change colors after loading data')
+ super().set_cmap(cmap)
+
+ def get_cursor_data(self, event):
+ # docstring inherited
+ x, y = event.xdata, event.ydata
+ if (x < self._Ax[0] or x > self._Ax[-1] or
+ y < self._Ay[0] or y > self._Ay[-1]):
+ return None
+ j = np.searchsorted(self._Ax, x) - 1
+ i = np.searchsorted(self._Ay, y) - 1
+ return self._A[i, j]
+
+
+class PcolorImage(AxesImage):
+ """
+ Make a pcolor-style plot with an irregular rectangular grid.
+
+ This uses a variation of the original irregular image code,
+ and it is used by pcolorfast for the corresponding grid type.
+ """
+
+ def __init__(self, ax,
+ x=None,
+ y=None,
+ A=None,
+ *,
+ cmap=None,
+ norm=None,
+ colorizer=None,
+ **kwargs
+ ):
+ """
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The Axes the image will belong to.
+ x, y : 1D array-like, optional
+ Monotonic arrays of length N+1 and M+1, respectively, specifying
+ rectangle boundaries. If not given, will default to
+ ``range(N + 1)`` and ``range(M + 1)``, respectively.
+ A : array-like
+ The data to be color-coded. The interpretation depends on the
+ shape:
+
+ - (M, N) `~numpy.ndarray` or masked array: values to be colormapped
+ - (M, N, 3): RGB array
+ - (M, N, 4): RGBA array
+
+ cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
+ The Colormap instance or registered colormap name used to map
+ scalar data to colors.
+ norm : str or `~matplotlib.colors.Normalize`
+ Maps luminance to 0-1.
+ **kwargs : `~matplotlib.artist.Artist` properties
+ """
+ super().__init__(ax, norm=norm, cmap=cmap, colorizer=colorizer)
+ self._internal_update(kwargs)
+ if A is not None:
+ self.set_data(x, y, A)
+
+ def make_image(self, renderer, magnification=1.0, unsampled=False):
+ # docstring inherited
+ if self._A is None:
+ raise RuntimeError('You must first set the image array')
+ if unsampled:
+ raise ValueError('unsampled not supported on PColorImage')
+
+ if self._imcache is None:
+ A = self.to_rgba(self._A, bytes=True)
+ self._imcache = np.pad(A, [(1, 1), (1, 1), (0, 0)], "constant")
+ padded_A = self._imcache
+ bg = mcolors.to_rgba(self.axes.patch.get_facecolor(), 0)
+ bg = (np.array(bg) * 255).astype(np.uint8)
+ if (padded_A[0, 0] != bg).all():
+ padded_A[[0, -1], :] = padded_A[:, [0, -1]] = bg
+
+ l, b, r, t = self.axes.bbox.extents
+ width = (round(r) + 0.5) - (round(l) - 0.5)
+ height = (round(t) + 0.5) - (round(b) - 0.5)
+ width = round(width * magnification)
+ height = round(height * magnification)
+ vl = self.axes.viewLim
+
+ x_pix = np.linspace(vl.x0, vl.x1, width)
+ y_pix = np.linspace(vl.y0, vl.y1, height)
+ x_int = self._Ax.searchsorted(x_pix)
+ y_int = self._Ay.searchsorted(y_pix)
+ im = ( # See comment in NonUniformImage.make_image re: performance.
+ padded_A.view(np.uint32).ravel()[
+ np.add.outer(y_int * padded_A.shape[1], x_int)]
+ .view(np.uint8).reshape((height, width, 4)))
+ return im, l, b, IdentityTransform()
+
+ def _check_unsampled_image(self):
+ return False
+
+ def set_data(self, x, y, A):
+ """
+ Set the grid for the rectangle boundaries, and the data values.
+
+ Parameters
+ ----------
+ x, y : 1D array-like, optional
+ Monotonic arrays of length N+1 and M+1, respectively, specifying
+ rectangle boundaries. If not given, will default to
+ ``range(N + 1)`` and ``range(M + 1)``, respectively.
+ A : array-like
+ The data to be color-coded. The interpretation depends on the
+ shape:
+
+ - (M, N) `~numpy.ndarray` or masked array: values to be colormapped
+ - (M, N, 3): RGB array
+ - (M, N, 4): RGBA array
+ """
+ A = self._normalize_image_array(A)
+ x = np.arange(0., A.shape[1] + 1) if x is None else np.array(x, float).ravel()
+ y = np.arange(0., A.shape[0] + 1) if y is None else np.array(y, float).ravel()
+ if A.shape[:2] != (y.size - 1, x.size - 1):
+ raise ValueError(
+ "Axes don't match array shape. Got %s, expected %s." %
+ (A.shape[:2], (y.size - 1, x.size - 1)))
+ # For efficient cursor readout, ensure x and y are increasing.
+ if x[-1] < x[0]:
+ x = x[::-1]
+ A = A[:, ::-1]
+ if y[-1] < y[0]:
+ y = y[::-1]
+ A = A[::-1]
+ self._A = A
+ self._Ax = x
+ self._Ay = y
+ self._imcache = None
+ self.stale = True
+
+ def set_array(self, *args):
+ raise NotImplementedError('Method not supported')
+
+ def get_cursor_data(self, event):
+ # docstring inherited
+ x, y = event.xdata, event.ydata
+ if (x < self._Ax[0] or x > self._Ax[-1] or
+ y < self._Ay[0] or y > self._Ay[-1]):
+ return None
+ j = np.searchsorted(self._Ax, x) - 1
+ i = np.searchsorted(self._Ay, y) - 1
+ return self._A[i, j]
+
+
+class FigureImage(_ImageBase):
+ """An image attached to a figure."""
+
+ zorder = 0
+
+ _interpolation = 'nearest'
+
+ def __init__(self, fig,
+ *,
+ cmap=None,
+ norm=None,
+ colorizer=None,
+ offsetx=0,
+ offsety=0,
+ origin=None,
+ **kwargs
+ ):
+ """
+ cmap is a colors.Colormap instance
+ norm is a colors.Normalize instance to map luminance to 0-1
+
+ kwargs are an optional list of Artist keyword args
+ """
+ super().__init__(
+ None,
+ norm=norm,
+ cmap=cmap,
+ colorizer=colorizer,
+ origin=origin
+ )
+ self.set_figure(fig)
+ self.ox = offsetx
+ self.oy = offsety
+ self._internal_update(kwargs)
+ self.magnification = 1.0
+
+ def get_extent(self):
+ """Return the image extent as tuple (left, right, bottom, top)."""
+ numrows, numcols = self.get_size()
+ return (-0.5 + self.ox, numcols-0.5 + self.ox,
+ -0.5 + self.oy, numrows-0.5 + self.oy)
+
+ def make_image(self, renderer, magnification=1.0, unsampled=False):
+ # docstring inherited
+ fig = self.get_figure(root=True)
+ fac = renderer.dpi/fig.dpi
+ # fac here is to account for pdf, eps, svg backends where
+ # figure.dpi is set to 72. This means we need to scale the
+ # image (using magnification) and offset it appropriately.
+ bbox = Bbox([[self.ox/fac, self.oy/fac],
+ [(self.ox/fac + self._A.shape[1]),
+ (self.oy/fac + self._A.shape[0])]])
+ width, height = fig.get_size_inches()
+ width *= renderer.dpi
+ height *= renderer.dpi
+ clip = Bbox([[0, 0], [width, height]])
+ return self._make_image(
+ self._A, bbox, bbox, clip, magnification=magnification / fac,
+ unsampled=unsampled, round_to_pixel_border=False)
+
+ def set_data(self, A):
+ """Set the image array."""
+ super().set_data(A)
+ self.stale = True
+
+
+class BboxImage(_ImageBase):
+ """The Image class whose size is determined by the given bbox."""
+
+ def __init__(self, bbox,
+ *,
+ cmap=None,
+ norm=None,
+ colorizer=None,
+ interpolation=None,
+ origin=None,
+ filternorm=True,
+ filterrad=4.0,
+ resample=False,
+ **kwargs
+ ):
+ """
+ cmap is a colors.Colormap instance
+ norm is a colors.Normalize instance to map luminance to 0-1
+
+ kwargs are an optional list of Artist keyword args
+ """
+ super().__init__(
+ None,
+ cmap=cmap,
+ norm=norm,
+ colorizer=colorizer,
+ interpolation=interpolation,
+ origin=origin,
+ filternorm=filternorm,
+ filterrad=filterrad,
+ resample=resample,
+ **kwargs
+ )
+ self.bbox = bbox
+
+ def get_window_extent(self, renderer=None):
+ if renderer is None:
+ renderer = self.get_figure()._get_renderer()
+
+ if isinstance(self.bbox, BboxBase):
+ return self.bbox
+ elif callable(self.bbox):
+ return self.bbox(renderer)
+ else:
+ raise ValueError("Unknown type of bbox")
+
+ def contains(self, mouseevent):
+ """Test whether the mouse event occurred within the image."""
+ if self._different_canvas(mouseevent) or not self.get_visible():
+ return False, {}
+ x, y = mouseevent.x, mouseevent.y
+ inside = self.get_window_extent().contains(x, y)
+ return inside, {}
+
+ def make_image(self, renderer, magnification=1.0, unsampled=False):
+ # docstring inherited
+ width, height = renderer.get_canvas_width_height()
+ bbox_in = self.get_window_extent(renderer).frozen()
+ bbox_in._points /= [width, height]
+ bbox_out = self.get_window_extent(renderer)
+ clip = Bbox([[0, 0], [width, height]])
+ self._transform = BboxTransformTo(clip)
+ return self._make_image(
+ self._A,
+ bbox_in, bbox_out, clip, magnification, unsampled=unsampled)
+
+
+def imread(fname, format=None):
+ """
+ Read an image from a file into an array.
+
+ .. note::
+
+ This function exists for historical reasons. It is recommended to
+ use `PIL.Image.open` instead for loading images.
+
+ Parameters
+ ----------
+ fname : str or file-like
+ The image file to read: a filename, a URL or a file-like object opened
+ in read-binary mode.
+
+ Passing a URL is deprecated. Please open the URL
+ for reading and pass the result to Pillow, e.g. with
+ ``np.array(PIL.Image.open(urllib.request.urlopen(url)))``.
+ format : str, optional
+ The image file format assumed for reading the data. The image is
+ loaded as a PNG file if *format* is set to "png", if *fname* is a path
+ or opened file with a ".png" extension, or if it is a URL. In all
+ other cases, *format* is ignored and the format is auto-detected by
+ `PIL.Image.open`.
+
+ Returns
+ -------
+ `numpy.array`
+ The image data. The returned array has shape
+
+ - (M, N) for grayscale images.
+ - (M, N, 3) for RGB images.
+ - (M, N, 4) for RGBA images.
+
+ PNG images are returned as float arrays (0-1). All other formats are
+ returned as int arrays, with a bit depth determined by the file's
+ contents.
+ """
+ # hide imports to speed initial import on systems with slow linkers
+ from urllib import parse
+
+ if format is None:
+ if isinstance(fname, str):
+ parsed = parse.urlparse(fname)
+ # If the string is a URL (Windows paths appear as if they have a
+ # length-1 scheme), assume png.
+ if len(parsed.scheme) > 1:
+ ext = 'png'
+ else:
+ ext = Path(fname).suffix.lower()[1:]
+ elif hasattr(fname, 'geturl'): # Returned by urlopen().
+ # We could try to parse the url's path and use the extension, but
+ # returning png is consistent with the block above. Note that this
+ # if clause has to come before checking for fname.name as
+ # urlopen("file:///...") also has a name attribute (with the fixed
+ # value "").
+ ext = 'png'
+ elif hasattr(fname, 'name'):
+ ext = Path(fname.name).suffix.lower()[1:]
+ else:
+ ext = 'png'
+ else:
+ ext = format
+ img_open = (
+ PIL.PngImagePlugin.PngImageFile if ext == 'png' else PIL.Image.open)
+ if isinstance(fname, str) and len(parse.urlparse(fname).scheme) > 1:
+ # Pillow doesn't handle URLs directly.
+ raise ValueError(
+ "Please open the URL for reading and pass the "
+ "result to Pillow, e.g. with "
+ "``np.array(PIL.Image.open(urllib.request.urlopen(url)))``."
+ )
+ with img_open(fname) as image:
+ return (_pil_png_to_float_array(image)
+ if isinstance(image, PIL.PngImagePlugin.PngImageFile) else
+ pil_to_array(image))
+
+
+def imsave(fname, arr, vmin=None, vmax=None, cmap=None, format=None,
+ origin=None, dpi=100, *, metadata=None, pil_kwargs=None):
+ """
+ Colormap and save an array as an image file.
+
+ RGB(A) images are passed through. Single channel images will be
+ colormapped according to *cmap* and *norm*.
+
+ .. note::
+
+ If you want to save a single channel image as gray scale please use an
+ image I/O library (such as pillow, tifffile, or imageio) directly.
+
+ Parameters
+ ----------
+ fname : str or path-like or file-like
+ A path or a file-like object to store the image in.
+ If *format* is not set, then the output format is inferred from the
+ extension of *fname*, if any, and from :rc:`savefig.format` otherwise.
+ If *format* is set, it determines the output format.
+ arr : array-like
+ The image data. Accepts NumPy arrays or sequences
+ (e.g., lists or tuples). The shape can be one of
+ MxN (luminance), MxNx3 (RGB) or MxNx4 (RGBA).
+ vmin, vmax : float, optional
+ *vmin* and *vmax* set the color scaling for the image by fixing the
+ values that map to the colormap color limits. If either *vmin*
+ or *vmax* is None, that limit is determined from the *arr*
+ min/max value.
+ cmap : str or `~matplotlib.colors.Colormap`, default: :rc:`image.cmap`
+ A Colormap instance or registered colormap name. The colormap
+ maps scalar data to colors. It is ignored for RGB(A) data.
+ format : str, optional
+ The file format, e.g. 'png', 'pdf', 'svg', ... The behavior when this
+ is unset is documented under *fname*.
+ origin : {'upper', 'lower'}, default: :rc:`image.origin`
+ Indicates whether the ``(0, 0)`` index of the array is in the upper
+ left or lower left corner of the Axes.
+ dpi : float
+ The DPI to store in the metadata of the file. This does not affect the
+ resolution of the output image. Depending on file format, this may be
+ rounded to the nearest integer.
+ metadata : dict, optional
+ Metadata in the image file. The supported keys depend on the output
+ format, see the documentation of the respective backends for more
+ information.
+ Currently only supported for "png", "pdf", "ps", "eps", and "svg".
+ pil_kwargs : dict, optional
+ Keyword arguments passed to `PIL.Image.Image.save`. If the 'pnginfo'
+ key is present, it completely overrides *metadata*, including the
+ default 'Software' key.
+ """
+ from matplotlib.figure import Figure
+
+ # Normalizing input (e.g., list or tuples) to NumPy array if needed
+ arr = np.asanyarray(arr)
+
+ if isinstance(fname, os.PathLike):
+ fname = os.fspath(fname)
+ if format is None:
+ format = (Path(fname).suffix[1:] if isinstance(fname, str)
+ else mpl.rcParams["savefig.format"]).lower()
+ if format in ["pdf", "ps", "eps", "svg"]:
+ # Vector formats that are not handled by PIL.
+ if pil_kwargs is not None:
+ raise ValueError(
+ f"Cannot use 'pil_kwargs' when saving to {format}")
+ fig = Figure(dpi=dpi, frameon=False)
+ fig.figimage(arr, cmap=cmap, vmin=vmin, vmax=vmax, origin=origin,
+ resize=True)
+ fig.savefig(fname, dpi=dpi, format=format, transparent=True,
+ metadata=metadata)
+ else:
+ # Don't bother creating an image; this avoids rounding errors on the
+ # size when dividing and then multiplying by dpi.
+ if origin is None:
+ origin = mpl.rcParams["image.origin"]
+ else:
+ _api.check_in_list(('upper', 'lower'), origin=origin)
+ if origin == "lower":
+ arr = arr[::-1]
+ if (isinstance(arr, memoryview) and arr.format == "B"
+ and arr.ndim == 3 and arr.shape[-1] == 4):
+ # Such an ``arr`` would also be handled fine by sm.to_rgba below
+ # (after casting with asarray), but it is useful to special-case it
+ # because that's what backend_agg passes, and can be in fact used
+ # as is, saving a few operations.
+ rgba = arr
+ else:
+ sm = mcolorizer.Colorizer(cmap=cmap)
+ sm.set_clim(vmin, vmax)
+ rgba = sm.to_rgba(arr, bytes=True)
+ if pil_kwargs is None:
+ pil_kwargs = {}
+ else:
+ # we modify this below, so make a copy (don't modify caller's dict)
+ pil_kwargs = pil_kwargs.copy()
+ pil_shape = (rgba.shape[1], rgba.shape[0])
+ rgba = np.require(rgba, requirements='C')
+ image = PIL.Image.frombuffer(
+ "RGBA", pil_shape, rgba, "raw", "RGBA", 0, 1)
+ if format == "png":
+ # Only use the metadata kwarg if pnginfo is not set, because the
+ # semantics of duplicate keys in pnginfo is unclear.
+ if "pnginfo" in pil_kwargs:
+ if metadata:
+ _api.warn_external("'metadata' is overridden by the "
+ "'pnginfo' entry in 'pil_kwargs'.")
+ else:
+ metadata = {
+ "Software": (f"Matplotlib version{mpl.__version__}, "
+ f"https://matplotlib.org/"),
+ **(metadata if metadata is not None else {}),
+ }
+ pil_kwargs["pnginfo"] = pnginfo = PIL.PngImagePlugin.PngInfo()
+ for k, v in metadata.items():
+ if v is not None:
+ pnginfo.add_text(k, v)
+ elif metadata is not None:
+ raise ValueError(f"metadata not supported for format {format!r}")
+ if format in ["jpg", "jpeg"]:
+ format = "jpeg" # Pillow doesn't recognize "jpg".
+ facecolor = mpl.rcParams["savefig.facecolor"]
+ if cbook._str_equal(facecolor, "auto"):
+ facecolor = mpl.rcParams["figure.facecolor"]
+ color = tuple(int(x * 255) for x in mcolors.to_rgb(facecolor))
+ background = PIL.Image.new("RGB", pil_shape, color)
+ background.paste(image, image)
+ image = background
+ pil_kwargs.setdefault("format", format)
+ pil_kwargs.setdefault("dpi", (dpi, dpi))
+ image.save(fname, **pil_kwargs)
+
+
+def pil_to_array(pilImage):
+ """
+ Load a `PIL image`_ and return it as a numpy int array.
+
+ .. _PIL image: https://pillow.readthedocs.io/en/latest/reference/Image.html
+
+ Returns
+ -------
+ numpy.array
+
+ The array shape depends on the image type:
+
+ - (M, N) for grayscale images.
+ - (M, N, 3) for RGB images.
+ - (M, N, 4) for RGBA images.
+ """
+ if pilImage.mode in ['RGBA', 'RGBX', 'RGB', 'L']:
+ # return MxNx4 RGBA, MxNx3 RBA, or MxN luminance array
+ return np.asarray(pilImage)
+ elif pilImage.mode.startswith('I;16'):
+ # return MxN luminance array of uint16
+ raw = pilImage.tobytes('raw', pilImage.mode)
+ if pilImage.mode.endswith('B'):
+ x = np.frombuffer(raw, '>u2')
+ else:
+ x = np.frombuffer(raw, ' None: ...
+
+#
+# END names re-exported from matplotlib._image.
+#
+
+interpolations_names: set[str]
+
+def composite_images(
+ images: Sequence[_ImageBase], renderer: RendererBase, magnification: float = ...
+) -> tuple[np.ndarray, float, float]: ...
+
+class _ImageBase(colorizer.ColorizingArtist):
+ zorder: float
+ origin: Literal["upper", "lower"]
+ axes: Axes
+ def __init__(
+ self,
+ ax: Axes,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ colorizer: Colorizer | None = ...,
+ interpolation: str | None = ...,
+ origin: Literal["upper", "lower"] | None = ...,
+ filternorm: bool = ...,
+ filterrad: float = ...,
+ resample: bool | None = ...,
+ *,
+ interpolation_stage: Literal["data", "rgba", "auto"] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_size(self) -> tuple[int, int]: ...
+ def set_alpha(self, alpha: float | ArrayLike | None) -> None: ...
+ def changed(self) -> None: ...
+ def make_image(
+ self, renderer: RendererBase, magnification: float = ..., unsampled: bool = ...
+ ) -> tuple[np.ndarray, float, float, Affine2D]: ...
+ def draw(self, renderer: RendererBase) -> None: ...
+ def write_png(self, fname: str | pathlib.Path | BinaryIO) -> None: ...
+ def set_data(self, A: ArrayLike | None) -> None: ...
+ def set_array(self, A: ArrayLike | None) -> None: ...
+ def get_shape(self) -> tuple[int, int, int]: ...
+ def get_interpolation(self) -> str: ...
+ def set_interpolation(self, s: str | None) -> None: ...
+ def get_interpolation_stage(self) -> Literal["data", "rgba", "auto"]: ...
+ def set_interpolation_stage(self, s: Literal["data", "rgba", "auto"]) -> None: ...
+ def can_composite(self) -> bool: ...
+ def set_resample(self, v: bool | None) -> None: ...
+ def get_resample(self) -> bool: ...
+ def set_filternorm(self, filternorm: bool) -> None: ...
+ def get_filternorm(self) -> bool: ...
+ def set_filterrad(self, filterrad: float) -> None: ...
+ def get_filterrad(self) -> float: ...
+
+class AxesImage(_ImageBase):
+ def __init__(
+ self,
+ ax: Axes,
+ *,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ colorizer: Colorizer | None = ...,
+ interpolation: str | None = ...,
+ origin: Literal["upper", "lower"] | None = ...,
+ extent: tuple[float, float, float, float] | None = ...,
+ filternorm: bool = ...,
+ filterrad: float = ...,
+ resample: bool = ...,
+ interpolation_stage: Literal["data", "rgba", "auto"] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ...
+ def make_image(
+ self, renderer: RendererBase, magnification: float = ..., unsampled: bool = ...
+ ) -> tuple[np.ndarray, float, float, Affine2D]: ...
+ def set_extent(
+ self, extent: tuple[float, float, float, float], **kwargs
+ ) -> None: ...
+ def get_extent(self) -> tuple[float, float, float, float]: ...
+ def get_cursor_data(self, event: MouseEvent) -> None | float: ...
+
+class NonUniformImage(AxesImage):
+ mouseover: bool
+ def __init__(
+ self, ax: Axes, *, interpolation: Literal["nearest", "bilinear"] = ..., **kwargs
+ ) -> None: ...
+ def set_data(self, x: ArrayLike, y: ArrayLike, A: ArrayLike) -> None: ... # type: ignore[override]
+ # more limited interpolation available here than base class
+ def set_interpolation(self, s: Literal["nearest", "bilinear"]) -> None: ... # type: ignore[override]
+
+class PcolorImage(AxesImage):
+ def __init__(
+ self,
+ ax: Axes,
+ x: ArrayLike | None = ...,
+ y: ArrayLike | None = ...,
+ A: ArrayLike | None = ...,
+ *,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ colorizer: Colorizer | None = ...,
+ **kwargs
+ ) -> None: ...
+ def set_data(self, x: ArrayLike, y: ArrayLike, A: ArrayLike) -> None: ... # type: ignore[override]
+
+class FigureImage(_ImageBase):
+ zorder: float
+ figure: Figure
+ ox: float
+ oy: float
+ magnification: float
+ def __init__(
+ self,
+ fig: Figure,
+ *,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ colorizer: Colorizer | None = ...,
+ offsetx: int = ...,
+ offsety: int = ...,
+ origin: Literal["upper", "lower"] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_extent(self) -> tuple[float, float, float, float]: ...
+
+class BboxImage(_ImageBase):
+ bbox: BboxBase
+ def __init__(
+ self,
+ bbox: BboxBase | Callable[[RendererBase | None], Bbox],
+ *,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ colorizer: Colorizer | None = ...,
+ interpolation: str | None = ...,
+ origin: Literal["upper", "lower"] | None = ...,
+ filternorm: bool = ...,
+ filterrad: float = ...,
+ resample: bool = ...,
+ **kwargs
+ ) -> None: ...
+ def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ...
+
+def imread(
+ fname: str | pathlib.Path | BinaryIO, format: str | None = ...
+) -> np.ndarray: ...
+def imsave(
+ fname: str | os.PathLike | BinaryIO,
+ arr: ArrayLike,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ cmap: str | Colormap | None = ...,
+ format: str | None = ...,
+ origin: Literal["upper", "lower"] | None = ...,
+ dpi: float = ...,
+ *,
+ metadata: dict[str, str] | None = ...,
+ pil_kwargs: dict[str, Any] | None = ...
+) -> None: ...
+def pil_to_array(pilImage: PIL.Image.Image) -> np.ndarray: ...
+def thumbnail(
+ infile: str | BinaryIO,
+ thumbfile: str | BinaryIO,
+ scale: float = ...,
+ interpolation: str = ...,
+ preview: bool = ...,
+) -> Figure: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/inset.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/inset.py
new file mode 100644
index 0000000000000000000000000000000000000000..bab69491303e698ff6ec05a7d95ae88d1d213ac3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/inset.py
@@ -0,0 +1,269 @@
+"""
+The inset module defines the InsetIndicator class, which draws the rectangle and
+connectors required for `.Axes.indicate_inset` and `.Axes.indicate_inset_zoom`.
+"""
+
+from . import _api, artist, transforms
+from matplotlib.patches import ConnectionPatch, PathPatch, Rectangle
+from matplotlib.path import Path
+
+
+_shared_properties = ('alpha', 'edgecolor', 'linestyle', 'linewidth')
+
+
+class InsetIndicator(artist.Artist):
+ """
+ An artist to highlight an area of interest.
+
+ An inset indicator is a rectangle on the plot at the position indicated by
+ *bounds* that optionally has lines that connect the rectangle to an inset
+ Axes (`.Axes.inset_axes`).
+
+ .. versionadded:: 3.10
+ """
+ zorder = 4.99
+
+ def __init__(self, bounds=None, inset_ax=None, zorder=None, **kwargs):
+ """
+ Parameters
+ ----------
+ bounds : [x0, y0, width, height], optional
+ Lower-left corner of rectangle to be marked, and its width
+ and height. If not set, the bounds will be calculated from the
+ data limits of inset_ax, which must be supplied.
+
+ inset_ax : `~.axes.Axes`, optional
+ An optional inset Axes to draw connecting lines to. Two lines are
+ drawn connecting the indicator box to the inset Axes on corners
+ chosen so as to not overlap with the indicator box.
+
+ zorder : float, default: 4.99
+ Drawing order of the rectangle and connector lines. The default,
+ 4.99, is just below the default level of inset Axes.
+
+ **kwargs
+ Other keyword arguments are passed on to the `.Rectangle` patch.
+ """
+ if bounds is None and inset_ax is None:
+ raise ValueError("At least one of bounds or inset_ax must be supplied")
+
+ self._inset_ax = inset_ax
+
+ if bounds is None:
+ # Work out bounds from inset_ax
+ self._auto_update_bounds = True
+ bounds = self._bounds_from_inset_ax()
+ else:
+ self._auto_update_bounds = False
+
+ x, y, width, height = bounds
+
+ self._rectangle = Rectangle((x, y), width, height, clip_on=False, **kwargs)
+
+ # Connector positions cannot be calculated till the artist has been added
+ # to an axes, so just make an empty list for now.
+ self._connectors = []
+
+ super().__init__()
+ self.set_zorder(zorder)
+
+ # Initial style properties for the artist should match the rectangle.
+ for prop in _shared_properties:
+ setattr(self, f'_{prop}', artist.getp(self._rectangle, prop))
+
+ def _shared_setter(self, prop, val):
+ """
+ Helper function to set the same style property on the artist and its children.
+ """
+ setattr(self, f'_{prop}', val)
+
+ artist.setp([self._rectangle, *self._connectors], prop, val)
+
+ def set_alpha(self, alpha):
+ # docstring inherited
+ self._shared_setter('alpha', alpha)
+
+ def set_edgecolor(self, color):
+ """
+ Set the edge color of the rectangle and the connectors.
+
+ Parameters
+ ----------
+ color : :mpltype:`color` or None
+ """
+ self._shared_setter('edgecolor', color)
+
+ def set_color(self, c):
+ """
+ Set the edgecolor of the rectangle and the connectors, and the
+ facecolor for the rectangle.
+
+ Parameters
+ ----------
+ c : :mpltype:`color`
+ """
+ self._shared_setter('edgecolor', c)
+ self._shared_setter('facecolor', c)
+
+ def set_linewidth(self, w):
+ """
+ Set the linewidth in points of the rectangle and the connectors.
+
+ Parameters
+ ----------
+ w : float or None
+ """
+ self._shared_setter('linewidth', w)
+
+ def set_linestyle(self, ls):
+ """
+ Set the linestyle of the rectangle and the connectors.
+
+ ========================================== =================
+ linestyle description
+ ========================================== =================
+ ``'-'`` or ``'solid'`` solid line
+ ``'--'`` or ``'dashed'`` dashed line
+ ``'-.'`` or ``'dashdot'`` dash-dotted line
+ ``':'`` or ``'dotted'`` dotted line
+ ``'none'``, ``'None'``, ``' '``, or ``''`` draw nothing
+ ========================================== =================
+
+ Alternatively a dash tuple of the following form can be provided::
+
+ (offset, onoffseq)
+
+ where ``onoffseq`` is an even length tuple of on and off ink in points.
+
+ Parameters
+ ----------
+ ls : {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
+ The line style.
+ """
+ self._shared_setter('linestyle', ls)
+
+ def _bounds_from_inset_ax(self):
+ xlim = self._inset_ax.get_xlim()
+ ylim = self._inset_ax.get_ylim()
+ return (xlim[0], ylim[0], xlim[1] - xlim[0], ylim[1] - ylim[0])
+
+ def _update_connectors(self):
+ (x, y) = self._rectangle.get_xy()
+ width = self._rectangle.get_width()
+ height = self._rectangle.get_height()
+
+ existing_connectors = self._connectors or [None] * 4
+
+ # connect the inset_axes to the rectangle
+ for xy_inset_ax, existing in zip([(0, 0), (0, 1), (1, 0), (1, 1)],
+ existing_connectors):
+ # inset_ax positions are in axes coordinates
+ # The 0, 1 values define the four edges if the inset_ax
+ # lower_left, upper_left, lower_right upper_right.
+ ex, ey = xy_inset_ax
+ if self.axes.xaxis.get_inverted():
+ ex = 1 - ex
+ if self.axes.yaxis.get_inverted():
+ ey = 1 - ey
+ xy_data = x + ex * width, y + ey * height
+ if existing is None:
+ # Create new connection patch with styles inherited from the
+ # parent artist.
+ p = ConnectionPatch(
+ xyA=xy_inset_ax, coordsA=self._inset_ax.transAxes,
+ xyB=xy_data, coordsB=self.axes.transData,
+ arrowstyle="-",
+ edgecolor=self._edgecolor, alpha=self.get_alpha(),
+ linestyle=self._linestyle, linewidth=self._linewidth)
+ self._connectors.append(p)
+ else:
+ # Only update positioning of existing connection patch. We
+ # do not want to override any style settings made by the user.
+ existing.xy1 = xy_inset_ax
+ existing.xy2 = xy_data
+ existing.coords1 = self._inset_ax.transAxes
+ existing.coords2 = self.axes.transData
+
+ if existing is None:
+ # decide which two of the lines to keep visible....
+ pos = self._inset_ax.get_position()
+ bboxins = pos.transformed(self.get_figure(root=False).transSubfigure)
+ rectbbox = transforms.Bbox.from_bounds(x, y, width, height).transformed(
+ self._rectangle.get_transform())
+ x0 = rectbbox.x0 < bboxins.x0
+ x1 = rectbbox.x1 < bboxins.x1
+ y0 = rectbbox.y0 < bboxins.y0
+ y1 = rectbbox.y1 < bboxins.y1
+ self._connectors[0].set_visible(x0 ^ y0)
+ self._connectors[1].set_visible(x0 == y1)
+ self._connectors[2].set_visible(x1 == y0)
+ self._connectors[3].set_visible(x1 ^ y1)
+
+ @property
+ def rectangle(self):
+ """`.Rectangle`: the indicator frame."""
+ return self._rectangle
+
+ @property
+ def connectors(self):
+ """
+ 4-tuple of `.patches.ConnectionPatch` or None
+ The four connector lines connecting to (lower_left, upper_left,
+ lower_right upper_right) corners of *inset_ax*. Two lines are
+ set with visibility to *False*, but the user can set the
+ visibility to True if the automatic choice is not deemed correct.
+ """
+ if self._inset_ax is None:
+ return
+
+ if self._auto_update_bounds:
+ self._rectangle.set_bounds(self._bounds_from_inset_ax())
+ self._update_connectors()
+ return tuple(self._connectors)
+
+ def draw(self, renderer):
+ # docstring inherited
+ conn_same_style = []
+
+ # Figure out which connectors have the same style as the box, so should
+ # be drawn as a single path.
+ for conn in self.connectors or []:
+ if conn.get_visible():
+ drawn = False
+ for s in _shared_properties:
+ if artist.getp(self._rectangle, s) != artist.getp(conn, s):
+ # Draw this connector by itself
+ conn.draw(renderer)
+ drawn = True
+ break
+
+ if not drawn:
+ # Connector has same style as box.
+ conn_same_style.append(conn)
+
+ if conn_same_style:
+ # Since at least one connector has the same style as the rectangle, draw
+ # them as a compound path.
+ artists = [self._rectangle] + conn_same_style
+ paths = [a.get_transform().transform_path(a.get_path()) for a in artists]
+ path = Path.make_compound_path(*paths)
+
+ # Create a temporary patch to draw the path.
+ p = PathPatch(path)
+ p.update_from(self._rectangle)
+ p.set_transform(transforms.IdentityTransform())
+ p.draw(renderer)
+
+ return
+
+ # Just draw the rectangle
+ self._rectangle.draw(renderer)
+
+ @_api.deprecated(
+ '3.10',
+ message=('Since Matplotlib 3.10 indicate_inset_[zoom] returns a single '
+ 'InsetIndicator artist with a rectangle property and a connectors '
+ 'property. From 3.12 it will no longer be possible to unpack the '
+ 'return value into two elements.'))
+ def __getitem__(self, key):
+ return [self._rectangle, self.connectors][key]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/inset.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/inset.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..e895fd7be27c40ad07167aeca73fc7380b4d0d23
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/inset.pyi
@@ -0,0 +1,25 @@
+from . import artist
+from .axes import Axes
+from .backend_bases import RendererBase
+from .patches import ConnectionPatch, Rectangle
+
+from .typing import ColorType, LineStyleType
+
+class InsetIndicator(artist.Artist):
+ def __init__(
+ self,
+ bounds: tuple[float, float, float, float] | None = ...,
+ inset_ax: Axes | None = ...,
+ zorder: float | None = ...,
+ **kwargs
+ ) -> None: ...
+ def set_alpha(self, alpha: float | None) -> None: ...
+ def set_edgecolor(self, color: ColorType | None) -> None: ...
+ def set_color(self, c: ColorType | None) -> None: ...
+ def set_linewidth(self, w: float | None) -> None: ...
+ def set_linestyle(self, ls: LineStyleType | None) -> None: ...
+ @property
+ def rectangle(self) -> Rectangle: ...
+ @property
+ def connectors(self) -> tuple[ConnectionPatch, ConnectionPatch, ConnectionPatch, ConnectionPatch] | None: ...
+ def draw(self, renderer: RendererBase) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/layout_engine.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/layout_engine.py
new file mode 100644
index 0000000000000000000000000000000000000000..8a3276b53371b5a99a3226399e281e4f184258a6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/layout_engine.py
@@ -0,0 +1,309 @@
+"""
+Classes to layout elements in a `.Figure`.
+
+Figures have a ``layout_engine`` property that holds a subclass of
+`~.LayoutEngine` defined here (or *None* for no layout). At draw time
+``figure.get_layout_engine().execute()`` is called, the goal of which is
+usually to rearrange Axes on the figure to produce a pleasing layout. This is
+like a ``draw`` callback but with two differences. First, when printing we
+disable the layout engine for the final draw. Second, it is useful to know the
+layout engine while the figure is being created. In particular, colorbars are
+made differently with different layout engines (for historical reasons).
+
+Matplotlib has two built-in layout engines:
+
+- `.TightLayoutEngine` was the first layout engine added to Matplotlib.
+ See also :ref:`tight_layout_guide`.
+- `.ConstrainedLayoutEngine` is more modern and generally gives better results.
+ See also :ref:`constrainedlayout_guide`.
+
+Third parties can create their own layout engine by subclassing `.LayoutEngine`.
+"""
+
+from contextlib import nullcontext
+
+import matplotlib as mpl
+
+from matplotlib._constrained_layout import do_constrained_layout
+from matplotlib._tight_layout import (get_subplotspec_list,
+ get_tight_layout_figure)
+
+
+class LayoutEngine:
+ """
+ Base class for Matplotlib layout engines.
+
+ A layout engine can be passed to a figure at instantiation or at any time
+ with `~.figure.Figure.set_layout_engine`. Once attached to a figure, the
+ layout engine ``execute`` function is called at draw time by
+ `~.figure.Figure.draw`, providing a special draw-time hook.
+
+ .. note::
+
+ However, note that layout engines affect the creation of colorbars, so
+ `~.figure.Figure.set_layout_engine` should be called before any
+ colorbars are created.
+
+ Currently, there are two properties of `LayoutEngine` classes that are
+ consulted while manipulating the figure:
+
+ - ``engine.colorbar_gridspec`` tells `.Figure.colorbar` whether to make the
+ axes using the gridspec method (see `.colorbar.make_axes_gridspec`) or
+ not (see `.colorbar.make_axes`);
+ - ``engine.adjust_compatible`` stops `.Figure.subplots_adjust` from being
+ run if it is not compatible with the layout engine.
+
+ To implement a custom `LayoutEngine`:
+
+ 1. override ``_adjust_compatible`` and ``_colorbar_gridspec``
+ 2. override `LayoutEngine.set` to update *self._params*
+ 3. override `LayoutEngine.execute` with your implementation
+
+ """
+ # override these in subclass
+ _adjust_compatible = None
+ _colorbar_gridspec = None
+
+ def __init__(self, **kwargs):
+ super().__init__(**kwargs)
+ self._params = {}
+
+ def set(self, **kwargs):
+ """
+ Set the parameters for the layout engine.
+ """
+ raise NotImplementedError
+
+ @property
+ def colorbar_gridspec(self):
+ """
+ Return a boolean if the layout engine creates colorbars using a
+ gridspec.
+ """
+ if self._colorbar_gridspec is None:
+ raise NotImplementedError
+ return self._colorbar_gridspec
+
+ @property
+ def adjust_compatible(self):
+ """
+ Return a boolean if the layout engine is compatible with
+ `~.Figure.subplots_adjust`.
+ """
+ if self._adjust_compatible is None:
+ raise NotImplementedError
+ return self._adjust_compatible
+
+ def get(self):
+ """
+ Return copy of the parameters for the layout engine.
+ """
+ return dict(self._params)
+
+ def execute(self, fig):
+ """
+ Execute the layout on the figure given by *fig*.
+ """
+ # subclasses must implement this.
+ raise NotImplementedError
+
+
+class PlaceHolderLayoutEngine(LayoutEngine):
+ """
+ This layout engine does not adjust the figure layout at all.
+
+ The purpose of this `.LayoutEngine` is to act as a placeholder when the user removes
+ a layout engine to ensure an incompatible `.LayoutEngine` cannot be set later.
+
+ Parameters
+ ----------
+ adjust_compatible, colorbar_gridspec : bool
+ Allow the PlaceHolderLayoutEngine to mirror the behavior of whatever
+ layout engine it is replacing.
+
+ """
+ def __init__(self, adjust_compatible, colorbar_gridspec, **kwargs):
+ self._adjust_compatible = adjust_compatible
+ self._colorbar_gridspec = colorbar_gridspec
+ super().__init__(**kwargs)
+
+ def execute(self, fig):
+ """
+ Do nothing.
+ """
+ return
+
+
+class TightLayoutEngine(LayoutEngine):
+ """
+ Implements the ``tight_layout`` geometry management. See
+ :ref:`tight_layout_guide` for details.
+ """
+ _adjust_compatible = True
+ _colorbar_gridspec = True
+
+ def __init__(self, *, pad=1.08, h_pad=None, w_pad=None,
+ rect=(0, 0, 1, 1), **kwargs):
+ """
+ Initialize tight_layout engine.
+
+ Parameters
+ ----------
+ pad : float, default: 1.08
+ Padding between the figure edge and the edges of subplots, as a
+ fraction of the font size.
+ h_pad, w_pad : float
+ Padding (height/width) between edges of adjacent subplots.
+ Defaults to *pad*.
+ rect : tuple (left, bottom, right, top), default: (0, 0, 1, 1).
+ rectangle in normalized figure coordinates that the subplots
+ (including labels) will fit into.
+ """
+ super().__init__(**kwargs)
+ for td in ['pad', 'h_pad', 'w_pad', 'rect']:
+ # initialize these in case None is passed in above:
+ self._params[td] = None
+ self.set(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
+
+ def execute(self, fig):
+ """
+ Execute tight_layout.
+
+ This decides the subplot parameters given the padding that
+ will allow the Axes labels to not be covered by other labels
+ and Axes.
+
+ Parameters
+ ----------
+ fig : `.Figure` to perform layout on.
+
+ See Also
+ --------
+ .figure.Figure.tight_layout
+ .pyplot.tight_layout
+ """
+ info = self._params
+ renderer = fig._get_renderer()
+ with getattr(renderer, "_draw_disabled", nullcontext)():
+ kwargs = get_tight_layout_figure(
+ fig, fig.axes, get_subplotspec_list(fig.axes), renderer,
+ pad=info['pad'], h_pad=info['h_pad'], w_pad=info['w_pad'],
+ rect=info['rect'])
+ if kwargs:
+ fig.subplots_adjust(**kwargs)
+
+ def set(self, *, pad=None, w_pad=None, h_pad=None, rect=None):
+ """
+ Set the pads for tight_layout.
+
+ Parameters
+ ----------
+ pad : float
+ Padding between the figure edge and the edges of subplots, as a
+ fraction of the font size.
+ w_pad, h_pad : float
+ Padding (width/height) between edges of adjacent subplots.
+ Defaults to *pad*.
+ rect : tuple (left, bottom, right, top)
+ rectangle in normalized figure coordinates that the subplots
+ (including labels) will fit into.
+ """
+ for td in self.set.__kwdefaults__:
+ if locals()[td] is not None:
+ self._params[td] = locals()[td]
+
+
+class ConstrainedLayoutEngine(LayoutEngine):
+ """
+ Implements the ``constrained_layout`` geometry management. See
+ :ref:`constrainedlayout_guide` for details.
+ """
+
+ _adjust_compatible = False
+ _colorbar_gridspec = False
+
+ def __init__(self, *, h_pad=None, w_pad=None,
+ hspace=None, wspace=None, rect=(0, 0, 1, 1),
+ compress=False, **kwargs):
+ """
+ Initialize ``constrained_layout`` settings.
+
+ Parameters
+ ----------
+ h_pad, w_pad : float
+ Padding around the Axes elements in inches.
+ Default to :rc:`figure.constrained_layout.h_pad` and
+ :rc:`figure.constrained_layout.w_pad`.
+ hspace, wspace : float
+ Fraction of the figure to dedicate to space between the
+ axes. These are evenly spread between the gaps between the Axes.
+ A value of 0.2 for a three-column layout would have a space
+ of 0.1 of the figure width between each column.
+ If h/wspace < h/w_pad, then the pads are used instead.
+ Default to :rc:`figure.constrained_layout.hspace` and
+ :rc:`figure.constrained_layout.wspace`.
+ rect : tuple of 4 floats
+ Rectangle in figure coordinates to perform constrained layout in
+ (left, bottom, width, height), each from 0-1.
+ compress : bool
+ Whether to shift Axes so that white space in between them is
+ removed. This is useful for simple grids of fixed-aspect Axes (e.g.
+ a grid of images). See :ref:`compressed_layout`.
+ """
+ super().__init__(**kwargs)
+ # set the defaults:
+ self.set(w_pad=mpl.rcParams['figure.constrained_layout.w_pad'],
+ h_pad=mpl.rcParams['figure.constrained_layout.h_pad'],
+ wspace=mpl.rcParams['figure.constrained_layout.wspace'],
+ hspace=mpl.rcParams['figure.constrained_layout.hspace'],
+ rect=(0, 0, 1, 1))
+ # set anything that was passed in (None will be ignored):
+ self.set(w_pad=w_pad, h_pad=h_pad, wspace=wspace, hspace=hspace,
+ rect=rect)
+ self._compress = compress
+
+ def execute(self, fig):
+ """
+ Perform constrained_layout and move and resize Axes accordingly.
+
+ Parameters
+ ----------
+ fig : `.Figure` to perform layout on.
+ """
+ width, height = fig.get_size_inches()
+ # pads are relative to the current state of the figure...
+ w_pad = self._params['w_pad'] / width
+ h_pad = self._params['h_pad'] / height
+
+ return do_constrained_layout(fig, w_pad=w_pad, h_pad=h_pad,
+ wspace=self._params['wspace'],
+ hspace=self._params['hspace'],
+ rect=self._params['rect'],
+ compress=self._compress)
+
+ def set(self, *, h_pad=None, w_pad=None,
+ hspace=None, wspace=None, rect=None):
+ """
+ Set the pads for constrained_layout.
+
+ Parameters
+ ----------
+ h_pad, w_pad : float
+ Padding around the Axes elements in inches.
+ Default to :rc:`figure.constrained_layout.h_pad` and
+ :rc:`figure.constrained_layout.w_pad`.
+ hspace, wspace : float
+ Fraction of the figure to dedicate to space between the
+ axes. These are evenly spread between the gaps between the Axes.
+ A value of 0.2 for a three-column layout would have a space
+ of 0.1 of the figure width between each column.
+ If h/wspace < h/w_pad, then the pads are used instead.
+ Default to :rc:`figure.constrained_layout.hspace` and
+ :rc:`figure.constrained_layout.wspace`.
+ rect : tuple of 4 floats
+ Rectangle in figure coordinates to perform constrained layout in
+ (left, bottom, width, height), each from 0-1.
+ """
+ for td in self.set.__kwdefaults__:
+ if locals()[td] is not None:
+ self._params[td] = locals()[td]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/layout_engine.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/layout_engine.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..5b8c812ff47f53913ff2812b58fcaf3652985a86
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/layout_engine.pyi
@@ -0,0 +1,62 @@
+from matplotlib.figure import Figure
+
+from typing import Any
+
+class LayoutEngine:
+ def __init__(self, **kwargs: Any) -> None: ...
+ def set(self) -> None: ...
+ @property
+ def colorbar_gridspec(self) -> bool: ...
+ @property
+ def adjust_compatible(self) -> bool: ...
+ def get(self) -> dict[str, Any]: ...
+ def execute(self, fig: Figure) -> None: ...
+
+class PlaceHolderLayoutEngine(LayoutEngine):
+ def __init__(
+ self, adjust_compatible: bool, colorbar_gridspec: bool, **kwargs: Any
+ ) -> None: ...
+ def execute(self, fig: Figure) -> None: ...
+
+class TightLayoutEngine(LayoutEngine):
+ def __init__(
+ self,
+ *,
+ pad: float = ...,
+ h_pad: float | None = ...,
+ w_pad: float | None = ...,
+ rect: tuple[float, float, float, float] = ...,
+ **kwargs: Any
+ ) -> None: ...
+ def execute(self, fig: Figure) -> None: ...
+ def set(
+ self,
+ *,
+ pad: float | None = ...,
+ w_pad: float | None = ...,
+ h_pad: float | None = ...,
+ rect: tuple[float, float, float, float] | None = ...
+ ) -> None: ...
+
+class ConstrainedLayoutEngine(LayoutEngine):
+ def __init__(
+ self,
+ *,
+ h_pad: float | None = ...,
+ w_pad: float | None = ...,
+ hspace: float | None = ...,
+ wspace: float | None = ...,
+ rect: tuple[float, float, float, float] = ...,
+ compress: bool = ...,
+ **kwargs: Any
+ ) -> None: ...
+ def execute(self, fig: Figure) -> Any: ...
+ def set(
+ self,
+ *,
+ h_pad: float | None = ...,
+ w_pad: float | None = ...,
+ hspace: float | None = ...,
+ wspace: float | None = ...,
+ rect: tuple[float, float, float, float] | None = ...
+ ) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend.py
new file mode 100644
index 0000000000000000000000000000000000000000..0c2dfc19705ca03fa7887413f3c1c9d643e3b1a0
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend.py
@@ -0,0 +1,1370 @@
+"""
+The legend module defines the Legend class, which is responsible for
+drawing legends associated with Axes and/or figures.
+
+.. important::
+
+ It is unlikely that you would ever create a Legend instance manually.
+ Most users would normally create a legend via the `~.Axes.legend`
+ function. For more details on legends there is also a :ref:`legend guide
+ `.
+
+The `Legend` class is a container of legend handles and legend texts.
+
+The legend handler map specifies how to create legend handles from artists
+(lines, patches, etc.) in the Axes or figures. Default legend handlers are
+defined in the :mod:`~matplotlib.legend_handler` module. While not all artist
+types are covered by the default legend handlers, custom legend handlers can be
+defined to support arbitrary objects.
+
+See the :ref`` for more
+information.
+"""
+
+import itertools
+import logging
+import numbers
+import time
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, _docstring, cbook, colors, offsetbox
+from matplotlib.artist import Artist, allow_rasterization
+from matplotlib.cbook import silent_list
+from matplotlib.font_manager import FontProperties
+from matplotlib.lines import Line2D
+from matplotlib.patches import (Patch, Rectangle, Shadow, FancyBboxPatch,
+ StepPatch)
+from matplotlib.collections import (
+ Collection, CircleCollection, LineCollection, PathCollection,
+ PolyCollection, RegularPolyCollection)
+from matplotlib.text import Text
+from matplotlib.transforms import Bbox, BboxBase, TransformedBbox
+from matplotlib.transforms import BboxTransformTo, BboxTransformFrom
+from matplotlib.offsetbox import (
+ AnchoredOffsetbox, DraggableOffsetBox,
+ HPacker, VPacker,
+ DrawingArea, TextArea,
+)
+from matplotlib.container import ErrorbarContainer, BarContainer, StemContainer
+from . import legend_handler
+
+
+class DraggableLegend(DraggableOffsetBox):
+ def __init__(self, legend, use_blit=False, update="loc"):
+ """
+ Wrapper around a `.Legend` to support mouse dragging.
+
+ Parameters
+ ----------
+ legend : `.Legend`
+ The `.Legend` instance to wrap.
+ use_blit : bool, optional
+ Use blitting for faster image composition. For details see
+ :ref:`func-animation`.
+ update : {'loc', 'bbox'}, optional
+ If "loc", update the *loc* parameter of the legend upon finalizing.
+ If "bbox", update the *bbox_to_anchor* parameter.
+ """
+ self.legend = legend
+
+ _api.check_in_list(["loc", "bbox"], update=update)
+ self._update = update
+
+ super().__init__(legend, legend._legend_box, use_blit=use_blit)
+
+ def finalize_offset(self):
+ if self._update == "loc":
+ self._update_loc(self.get_loc_in_canvas())
+ elif self._update == "bbox":
+ self._update_bbox_to_anchor(self.get_loc_in_canvas())
+
+ def _update_loc(self, loc_in_canvas):
+ bbox = self.legend.get_bbox_to_anchor()
+ # if bbox has zero width or height, the transformation is
+ # ill-defined. Fall back to the default bbox_to_anchor.
+ if bbox.width == 0 or bbox.height == 0:
+ self.legend.set_bbox_to_anchor(None)
+ bbox = self.legend.get_bbox_to_anchor()
+ _bbox_transform = BboxTransformFrom(bbox)
+ self.legend._loc = tuple(_bbox_transform.transform(loc_in_canvas))
+
+ def _update_bbox_to_anchor(self, loc_in_canvas):
+ loc_in_bbox = self.legend.axes.transAxes.transform(loc_in_canvas)
+ self.legend.set_bbox_to_anchor(loc_in_bbox)
+
+
+_legend_kw_doc_base = """
+bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats
+ Box that is used to position the legend in conjunction with *loc*.
+ Defaults to ``axes.bbox`` (if called as a method to `.Axes.legend`) or
+ ``figure.bbox`` (if ``figure.legend``). This argument allows arbitrary
+ placement of the legend.
+
+ Bbox coordinates are interpreted in the coordinate system given by
+ *bbox_transform*, with the default transform
+ Axes or Figure coordinates, depending on which ``legend`` is called.
+
+ If a 4-tuple or `.BboxBase` is given, then it specifies the bbox
+ ``(x, y, width, height)`` that the legend is placed in.
+ To put the legend in the best location in the bottom right
+ quadrant of the Axes (or figure)::
+
+ loc='best', bbox_to_anchor=(0.5, 0., 0.5, 0.5)
+
+ A 2-tuple ``(x, y)`` places the corner of the legend specified by *loc* at
+ x, y. For example, to put the legend's upper right-hand corner in the
+ center of the Axes (or figure) the following keywords can be used::
+
+ loc='upper right', bbox_to_anchor=(0.5, 0.5)
+
+ncols : int, default: 1
+ The number of columns that the legend has.
+
+ For backward compatibility, the spelling *ncol* is also supported
+ but it is discouraged. If both are given, *ncols* takes precedence.
+
+prop : None or `~matplotlib.font_manager.FontProperties` or dict
+ The font properties of the legend. If None (default), the current
+ :data:`matplotlib.rcParams` will be used.
+
+fontsize : int or {'xx-small', 'x-small', 'small', 'medium', 'large', \
+'x-large', 'xx-large'}
+ The font size of the legend. If the value is numeric the size will be the
+ absolute font size in points. String values are relative to the current
+ default font size. This argument is only used if *prop* is not specified.
+
+labelcolor : str or list, default: :rc:`legend.labelcolor`
+ The color of the text in the legend. Either a valid color string
+ (for example, 'red'), or a list of color strings. The labelcolor can
+ also be made to match the color of the line or marker using 'linecolor',
+ 'markerfacecolor' (or 'mfc'), or 'markeredgecolor' (or 'mec').
+
+ Labelcolor can be set globally using :rc:`legend.labelcolor`. If None,
+ use :rc:`text.color`.
+
+numpoints : int, default: :rc:`legend.numpoints`
+ The number of marker points in the legend when creating a legend
+ entry for a `.Line2D` (line).
+
+scatterpoints : int, default: :rc:`legend.scatterpoints`
+ The number of marker points in the legend when creating
+ a legend entry for a `.PathCollection` (scatter plot).
+
+scatteryoffsets : iterable of floats, default: ``[0.375, 0.5, 0.3125]``
+ The vertical offset (relative to the font size) for the markers
+ created for a scatter plot legend entry. 0.0 is at the base the
+ legend text, and 1.0 is at the top. To draw all markers at the
+ same height, set to ``[0.5]``.
+
+markerscale : float, default: :rc:`legend.markerscale`
+ The relative size of legend markers compared to the originally drawn ones.
+
+markerfirst : bool, default: True
+ If *True*, legend marker is placed to the left of the legend label.
+ If *False*, legend marker is placed to the right of the legend label.
+
+reverse : bool, default: False
+ If *True*, the legend labels are displayed in reverse order from the input.
+ If *False*, the legend labels are displayed in the same order as the input.
+
+ .. versionadded:: 3.7
+
+frameon : bool, default: :rc:`legend.frameon`
+ Whether the legend should be drawn on a patch (frame).
+
+fancybox : bool, default: :rc:`legend.fancybox`
+ Whether round edges should be enabled around the `.FancyBboxPatch` which
+ makes up the legend's background.
+
+shadow : None, bool or dict, default: :rc:`legend.shadow`
+ Whether to draw a shadow behind the legend.
+ The shadow can be configured using `.Patch` keywords.
+ Customization via :rc:`legend.shadow` is currently not supported.
+
+framealpha : float, default: :rc:`legend.framealpha`
+ The alpha transparency of the legend's background.
+ If *shadow* is activated and *framealpha* is ``None``, the default value is
+ ignored.
+
+facecolor : "inherit" or color, default: :rc:`legend.facecolor`
+ The legend's background color.
+ If ``"inherit"``, use :rc:`axes.facecolor`.
+
+edgecolor : "inherit" or color, default: :rc:`legend.edgecolor`
+ The legend's background patch edge color.
+ If ``"inherit"``, use :rc:`axes.edgecolor`.
+
+mode : {"expand", None}
+ If *mode* is set to ``"expand"`` the legend will be horizontally
+ expanded to fill the Axes area (or *bbox_to_anchor* if defines
+ the legend's size).
+
+bbox_transform : None or `~matplotlib.transforms.Transform`
+ The transform for the bounding box (*bbox_to_anchor*). For a value
+ of ``None`` (default) the Axes'
+ :data:`~matplotlib.axes.Axes.transAxes` transform will be used.
+
+title : str or None
+ The legend's title. Default is no title (``None``).
+
+title_fontproperties : None or `~matplotlib.font_manager.FontProperties` or dict
+ The font properties of the legend's title. If None (default), the
+ *title_fontsize* argument will be used if present; if *title_fontsize* is
+ also None, the current :rc:`legend.title_fontsize` will be used.
+
+title_fontsize : int or {'xx-small', 'x-small', 'small', 'medium', 'large', \
+'x-large', 'xx-large'}, default: :rc:`legend.title_fontsize`
+ The font size of the legend's title.
+ Note: This cannot be combined with *title_fontproperties*. If you want
+ to set the fontsize alongside other font properties, use the *size*
+ parameter in *title_fontproperties*.
+
+alignment : {'center', 'left', 'right'}, default: 'center'
+ The alignment of the legend title and the box of entries. The entries
+ are aligned as a single block, so that markers always lined up.
+
+borderpad : float, default: :rc:`legend.borderpad`
+ The fractional whitespace inside the legend border, in font-size units.
+
+labelspacing : float, default: :rc:`legend.labelspacing`
+ The vertical space between the legend entries, in font-size units.
+
+handlelength : float, default: :rc:`legend.handlelength`
+ The length of the legend handles, in font-size units.
+
+handleheight : float, default: :rc:`legend.handleheight`
+ The height of the legend handles, in font-size units.
+
+handletextpad : float, default: :rc:`legend.handletextpad`
+ The pad between the legend handle and text, in font-size units.
+
+borderaxespad : float, default: :rc:`legend.borderaxespad`
+ The pad between the Axes and legend border, in font-size units.
+
+columnspacing : float, default: :rc:`legend.columnspacing`
+ The spacing between columns, in font-size units.
+
+handler_map : dict or None
+ The custom dictionary mapping instances or types to a legend
+ handler. This *handler_map* updates the default handler map
+ found at `matplotlib.legend.Legend.get_legend_handler_map`.
+
+draggable : bool, default: False
+ Whether the legend can be dragged with the mouse.
+"""
+
+_loc_doc_base = """
+loc : str or pair of floats, default: {default}
+ The location of the legend.
+
+ The strings ``'upper left'``, ``'upper right'``, ``'lower left'``,
+ ``'lower right'`` place the legend at the corresponding corner of the
+ {parent}.
+
+ The strings ``'upper center'``, ``'lower center'``, ``'center left'``,
+ ``'center right'`` place the legend at the center of the corresponding edge
+ of the {parent}.
+
+ The string ``'center'`` places the legend at the center of the {parent}.
+{best}
+ The location can also be a 2-tuple giving the coordinates of the lower-left
+ corner of the legend in {parent} coordinates (in which case *bbox_to_anchor*
+ will be ignored).
+
+ For back-compatibility, ``'center right'`` (but no other location) can also
+ be spelled ``'right'``, and each "string" location can also be given as a
+ numeric value:
+
+ ================== =============
+ Location String Location Code
+ ================== =============
+ 'best' (Axes only) 0
+ 'upper right' 1
+ 'upper left' 2
+ 'lower left' 3
+ 'lower right' 4
+ 'right' 5
+ 'center left' 6
+ 'center right' 7
+ 'lower center' 8
+ 'upper center' 9
+ 'center' 10
+ ================== =============
+ {outside}"""
+
+_loc_doc_best = """
+ The string ``'best'`` places the legend at the location, among the nine
+ locations defined so far, with the minimum overlap with other drawn
+ artists. This option can be quite slow for plots with large amounts of
+ data; your plotting speed may benefit from providing a specific location.
+"""
+
+_legend_kw_axes_st = (
+ _loc_doc_base.format(parent='axes', default=':rc:`legend.loc`',
+ best=_loc_doc_best, outside='') +
+ _legend_kw_doc_base)
+_docstring.interpd.register(_legend_kw_axes=_legend_kw_axes_st)
+
+_outside_doc = """
+ If a figure is using the constrained layout manager, the string codes
+ of the *loc* keyword argument can get better layout behaviour using the
+ prefix 'outside'. There is ambiguity at the corners, so 'outside
+ upper right' will make space for the legend above the rest of the
+ axes in the layout, and 'outside right upper' will make space on the
+ right side of the layout. In addition to the values of *loc*
+ listed above, we have 'outside right upper', 'outside right lower',
+ 'outside left upper', and 'outside left lower'. See
+ :ref:`legend_guide` for more details.
+"""
+
+_legend_kw_figure_st = (
+ _loc_doc_base.format(parent='figure', default="'upper right'",
+ best='', outside=_outside_doc) +
+ _legend_kw_doc_base)
+_docstring.interpd.register(_legend_kw_figure=_legend_kw_figure_st)
+
+_legend_kw_both_st = (
+ _loc_doc_base.format(parent='axes/figure',
+ default=":rc:`legend.loc` for Axes, 'upper right' for Figure",
+ best=_loc_doc_best, outside=_outside_doc) +
+ _legend_kw_doc_base)
+_docstring.interpd.register(_legend_kw_doc=_legend_kw_both_st)
+
+_legend_kw_set_loc_st = (
+ _loc_doc_base.format(parent='axes/figure',
+ default=":rc:`legend.loc` for Axes, 'upper right' for Figure",
+ best=_loc_doc_best, outside=_outside_doc))
+_docstring.interpd.register(_legend_kw_set_loc_doc=_legend_kw_set_loc_st)
+
+
+class Legend(Artist):
+ """
+ Place a legend on the figure/axes.
+ """
+
+ # 'best' is only implemented for Axes legends
+ codes = {'best': 0, **AnchoredOffsetbox.codes}
+ zorder = 5
+
+ def __str__(self):
+ return "Legend"
+
+ @_docstring.interpd
+ def __init__(
+ self, parent, handles, labels,
+ *,
+ loc=None,
+ numpoints=None, # number of points in the legend line
+ markerscale=None, # relative size of legend markers vs. original
+ markerfirst=True, # left/right ordering of legend marker and label
+ reverse=False, # reverse ordering of legend marker and label
+ scatterpoints=None, # number of scatter points
+ scatteryoffsets=None,
+ prop=None, # properties for the legend texts
+ fontsize=None, # keyword to set font size directly
+ labelcolor=None, # keyword to set the text color
+
+ # spacing & pad defined as a fraction of the font-size
+ borderpad=None, # whitespace inside the legend border
+ labelspacing=None, # vertical space between the legend entries
+ handlelength=None, # length of the legend handles
+ handleheight=None, # height of the legend handles
+ handletextpad=None, # pad between the legend handle and text
+ borderaxespad=None, # pad between the Axes and legend border
+ columnspacing=None, # spacing between columns
+
+ ncols=1, # number of columns
+ mode=None, # horizontal distribution of columns: None or "expand"
+
+ fancybox=None, # True: fancy box, False: rounded box, None: rcParam
+ shadow=None,
+ title=None, # legend title
+ title_fontsize=None, # legend title font size
+ framealpha=None, # set frame alpha
+ edgecolor=None, # frame patch edgecolor
+ facecolor=None, # frame patch facecolor
+
+ bbox_to_anchor=None, # bbox to which the legend will be anchored
+ bbox_transform=None, # transform for the bbox
+ frameon=None, # draw frame
+ handler_map=None,
+ title_fontproperties=None, # properties for the legend title
+ alignment="center", # control the alignment within the legend box
+ ncol=1, # synonym for ncols (backward compatibility)
+ draggable=False # whether the legend can be dragged with the mouse
+ ):
+ """
+ Parameters
+ ----------
+ parent : `~matplotlib.axes.Axes` or `.Figure`
+ The artist that contains the legend.
+
+ handles : list of (`.Artist` or tuple of `.Artist`)
+ A list of Artists (lines, patches) to be added to the legend.
+
+ labels : list of str
+ A list of labels to show next to the artists. The length of handles
+ and labels should be the same. If they are not, they are truncated
+ to the length of the shorter list.
+
+ Other Parameters
+ ----------------
+ %(_legend_kw_doc)s
+
+ Attributes
+ ----------
+ legend_handles
+ List of `.Artist` objects added as legend entries.
+
+ .. versionadded:: 3.7
+ """
+ # local import only to avoid circularity
+ from matplotlib.axes import Axes
+ from matplotlib.figure import FigureBase
+
+ super().__init__()
+
+ if prop is None:
+ self.prop = FontProperties(size=mpl._val_or_rc(fontsize, "legend.fontsize"))
+ else:
+ self.prop = FontProperties._from_any(prop)
+ if isinstance(prop, dict) and "size" not in prop:
+ self.prop.set_size(mpl.rcParams["legend.fontsize"])
+
+ self._fontsize = self.prop.get_size_in_points()
+
+ self.texts = []
+ self.legend_handles = []
+ self._legend_title_box = None
+
+ #: A dictionary with the extra handler mappings for this Legend
+ #: instance.
+ self._custom_handler_map = handler_map
+
+ self.numpoints = mpl._val_or_rc(numpoints, 'legend.numpoints')
+ self.markerscale = mpl._val_or_rc(markerscale, 'legend.markerscale')
+ self.scatterpoints = mpl._val_or_rc(scatterpoints, 'legend.scatterpoints')
+ self.borderpad = mpl._val_or_rc(borderpad, 'legend.borderpad')
+ self.labelspacing = mpl._val_or_rc(labelspacing, 'legend.labelspacing')
+ self.handlelength = mpl._val_or_rc(handlelength, 'legend.handlelength')
+ self.handleheight = mpl._val_or_rc(handleheight, 'legend.handleheight')
+ self.handletextpad = mpl._val_or_rc(handletextpad, 'legend.handletextpad')
+ self.borderaxespad = mpl._val_or_rc(borderaxespad, 'legend.borderaxespad')
+ self.columnspacing = mpl._val_or_rc(columnspacing, 'legend.columnspacing')
+ self.shadow = mpl._val_or_rc(shadow, 'legend.shadow')
+
+ if reverse:
+ labels = [*reversed(labels)]
+ handles = [*reversed(handles)]
+
+ if len(handles) < 2:
+ ncols = 1
+ self._ncols = ncols if ncols != 1 else ncol
+
+ if self.numpoints <= 0:
+ raise ValueError("numpoints must be > 0; it was %d" % numpoints)
+
+ # introduce y-offset for handles of the scatter plot
+ if scatteryoffsets is None:
+ self._scatteryoffsets = np.array([3. / 8., 4. / 8., 2.5 / 8.])
+ else:
+ self._scatteryoffsets = np.asarray(scatteryoffsets)
+ reps = self.scatterpoints // len(self._scatteryoffsets) + 1
+ self._scatteryoffsets = np.tile(self._scatteryoffsets,
+ reps)[:self.scatterpoints]
+
+ # _legend_box is a VPacker instance that contains all
+ # legend items and will be initialized from _init_legend_box()
+ # method.
+ self._legend_box = None
+
+ if isinstance(parent, Axes):
+ self.isaxes = True
+ self.axes = parent
+ self.set_figure(parent.get_figure(root=False))
+ elif isinstance(parent, FigureBase):
+ self.isaxes = False
+ self.set_figure(parent)
+ else:
+ raise TypeError(
+ "Legend needs either Axes or FigureBase as parent"
+ )
+ self.parent = parent
+
+ self._mode = mode
+ self.set_bbox_to_anchor(bbox_to_anchor, bbox_transform)
+
+ # Figure out if self.shadow is valid
+ # If shadow was None, rcParams loads False
+ # So it shouldn't be None here
+
+ self._shadow_props = {'ox': 2, 'oy': -2} # default location offsets
+ if isinstance(self.shadow, dict):
+ self._shadow_props.update(self.shadow)
+ self.shadow = True
+ elif self.shadow in (0, 1, True, False):
+ self.shadow = bool(self.shadow)
+ else:
+ raise ValueError(
+ 'Legend shadow must be a dict or bool, not '
+ f'{self.shadow!r} of type {type(self.shadow)}.'
+ )
+
+ # We use FancyBboxPatch to draw a legend frame. The location
+ # and size of the box will be updated during the drawing time.
+
+ facecolor = mpl._val_or_rc(facecolor, "legend.facecolor")
+ if facecolor == 'inherit':
+ facecolor = mpl.rcParams["axes.facecolor"]
+
+ edgecolor = mpl._val_or_rc(edgecolor, "legend.edgecolor")
+ if edgecolor == 'inherit':
+ edgecolor = mpl.rcParams["axes.edgecolor"]
+
+ fancybox = mpl._val_or_rc(fancybox, "legend.fancybox")
+
+ self.legendPatch = FancyBboxPatch(
+ xy=(0, 0), width=1, height=1,
+ facecolor=facecolor, edgecolor=edgecolor,
+ # If shadow is used, default to alpha=1 (#8943).
+ alpha=(framealpha if framealpha is not None
+ else 1 if shadow
+ else mpl.rcParams["legend.framealpha"]),
+ # The width and height of the legendPatch will be set (in draw())
+ # to the length that includes the padding. Thus we set pad=0 here.
+ boxstyle=("round,pad=0,rounding_size=0.2" if fancybox
+ else "square,pad=0"),
+ mutation_scale=self._fontsize,
+ snap=True,
+ visible=mpl._val_or_rc(frameon, "legend.frameon")
+ )
+ self._set_artist_props(self.legendPatch)
+
+ _api.check_in_list(["center", "left", "right"], alignment=alignment)
+ self._alignment = alignment
+
+ # init with null renderer
+ self._init_legend_box(handles, labels, markerfirst)
+
+ # Set legend location
+ self.set_loc(loc)
+
+ # figure out title font properties:
+ if title_fontsize is not None and title_fontproperties is not None:
+ raise ValueError(
+ "title_fontsize and title_fontproperties can't be specified "
+ "at the same time. Only use one of them. ")
+ title_prop_fp = FontProperties._from_any(title_fontproperties)
+ if isinstance(title_fontproperties, dict):
+ if "size" not in title_fontproperties:
+ title_fontsize = mpl.rcParams["legend.title_fontsize"]
+ title_prop_fp.set_size(title_fontsize)
+ elif title_fontsize is not None:
+ title_prop_fp.set_size(title_fontsize)
+ elif not isinstance(title_fontproperties, FontProperties):
+ title_fontsize = mpl.rcParams["legend.title_fontsize"]
+ title_prop_fp.set_size(title_fontsize)
+
+ self.set_title(title, prop=title_prop_fp)
+
+ self._draggable = None
+ self.set_draggable(state=draggable)
+
+ # set the text color
+
+ color_getters = { # getter function depends on line or patch
+ 'linecolor': ['get_color', 'get_facecolor'],
+ 'markerfacecolor': ['get_markerfacecolor', 'get_facecolor'],
+ 'mfc': ['get_markerfacecolor', 'get_facecolor'],
+ 'markeredgecolor': ['get_markeredgecolor', 'get_edgecolor'],
+ 'mec': ['get_markeredgecolor', 'get_edgecolor'],
+ }
+ labelcolor = mpl._val_or_rc(labelcolor, 'legend.labelcolor')
+ if labelcolor is None:
+ labelcolor = mpl.rcParams['text.color']
+ if isinstance(labelcolor, str) and labelcolor in color_getters:
+ getter_names = color_getters[labelcolor]
+ for handle, text in zip(self.legend_handles, self.texts):
+ try:
+ if handle.get_array() is not None:
+ continue
+ except AttributeError:
+ pass
+ for getter_name in getter_names:
+ try:
+ color = getattr(handle, getter_name)()
+ if isinstance(color, np.ndarray):
+ if (
+ color.shape[0] == 1
+ or np.isclose(color, color[0]).all()
+ ):
+ text.set_color(color[0])
+ else:
+ pass
+ else:
+ text.set_color(color)
+ break
+ except AttributeError:
+ pass
+ elif cbook._str_equal(labelcolor, 'none'):
+ for text in self.texts:
+ text.set_color(labelcolor)
+ elif np.iterable(labelcolor):
+ for text, color in zip(self.texts,
+ itertools.cycle(
+ colors.to_rgba_array(labelcolor))):
+ text.set_color(color)
+ else:
+ raise ValueError(f"Invalid labelcolor: {labelcolor!r}")
+
+ def _set_artist_props(self, a):
+ """
+ Set the boilerplate props for artists added to Axes.
+ """
+ a.set_figure(self.get_figure(root=False))
+ if self.isaxes:
+ a.axes = self.axes
+
+ a.set_transform(self.get_transform())
+
+ @_docstring.interpd
+ def set_loc(self, loc=None):
+ """
+ Set the location of the legend.
+
+ .. versionadded:: 3.8
+
+ Parameters
+ ----------
+ %(_legend_kw_set_loc_doc)s
+ """
+ loc0 = loc
+ self._loc_used_default = loc is None
+ if loc is None:
+ loc = mpl.rcParams["legend.loc"]
+ if not self.isaxes and loc in [0, 'best']:
+ loc = 'upper right'
+
+ type_err_message = ("loc must be string, coordinate tuple, or"
+ f" an integer 0-10, not {loc!r}")
+
+ # handle outside legends:
+ self._outside_loc = None
+ if isinstance(loc, str):
+ if loc.split()[0] == 'outside':
+ # strip outside:
+ loc = loc.split('outside ')[1]
+ # strip "center" at the beginning
+ self._outside_loc = loc.replace('center ', '')
+ # strip first
+ self._outside_loc = self._outside_loc.split()[0]
+ locs = loc.split()
+ if len(locs) > 1 and locs[0] in ('right', 'left'):
+ # locs doesn't accept "left upper", etc, so swap
+ if locs[0] != 'center':
+ locs = locs[::-1]
+ loc = locs[0] + ' ' + locs[1]
+ # check that loc is in acceptable strings
+ loc = _api.check_getitem(self.codes, loc=loc)
+ elif np.iterable(loc):
+ # coerce iterable into tuple
+ loc = tuple(loc)
+ # validate the tuple represents Real coordinates
+ if len(loc) != 2 or not all(isinstance(e, numbers.Real) for e in loc):
+ raise ValueError(type_err_message)
+ elif isinstance(loc, int):
+ # validate the integer represents a string numeric value
+ if loc < 0 or loc > 10:
+ raise ValueError(type_err_message)
+ else:
+ # all other cases are invalid values of loc
+ raise ValueError(type_err_message)
+
+ if self.isaxes and self._outside_loc:
+ raise ValueError(
+ f"'outside' option for loc='{loc0}' keyword argument only "
+ "works for figure legends")
+
+ if not self.isaxes and loc == 0:
+ raise ValueError(
+ "Automatic legend placement (loc='best') not implemented for "
+ "figure legend")
+
+ tmp = self._loc_used_default
+ self._set_loc(loc)
+ self._loc_used_default = tmp # ignore changes done by _set_loc
+
+ def _set_loc(self, loc):
+ # find_offset function will be provided to _legend_box and
+ # _legend_box will draw itself at the location of the return
+ # value of the find_offset.
+ self._loc_used_default = False
+ self._loc_real = loc
+ self.stale = True
+ self._legend_box.set_offset(self._findoffset)
+
+ def set_ncols(self, ncols):
+ """Set the number of columns."""
+ self._ncols = ncols
+
+ def _get_loc(self):
+ return self._loc_real
+
+ _loc = property(_get_loc, _set_loc)
+
+ def _findoffset(self, width, height, xdescent, ydescent, renderer):
+ """Helper function to locate the legend."""
+
+ if self._loc == 0: # "best".
+ x, y = self._find_best_position(width, height, renderer)
+ elif self._loc in Legend.codes.values(): # Fixed location.
+ bbox = Bbox.from_bounds(0, 0, width, height)
+ x, y = self._get_anchored_bbox(self._loc, bbox,
+ self.get_bbox_to_anchor(),
+ renderer)
+ else: # Axes or figure coordinates.
+ fx, fy = self._loc
+ bbox = self.get_bbox_to_anchor()
+ x, y = bbox.x0 + bbox.width * fx, bbox.y0 + bbox.height * fy
+
+ return x + xdescent, y + ydescent
+
+ @allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+ if not self.get_visible():
+ return
+
+ renderer.open_group('legend', gid=self.get_gid())
+
+ fontsize = renderer.points_to_pixels(self._fontsize)
+
+ # if mode == fill, set the width of the legend_box to the
+ # width of the parent (minus pads)
+ if self._mode in ["expand"]:
+ pad = 2 * (self.borderaxespad + self.borderpad) * fontsize
+ self._legend_box.set_width(self.get_bbox_to_anchor().width - pad)
+
+ # update the location and size of the legend. This needs to
+ # be done in any case to clip the figure right.
+ bbox = self._legend_box.get_window_extent(renderer)
+ self.legendPatch.set_bounds(bbox.bounds)
+ self.legendPatch.set_mutation_scale(fontsize)
+
+ # self.shadow is validated in __init__
+ # So by here it is a bool and self._shadow_props contains any configs
+
+ if self.shadow:
+ Shadow(self.legendPatch, **self._shadow_props).draw(renderer)
+
+ self.legendPatch.draw(renderer)
+ self._legend_box.draw(renderer)
+
+ renderer.close_group('legend')
+ self.stale = False
+
+ # _default_handler_map defines the default mapping between plot
+ # elements and the legend handlers.
+
+ _default_handler_map = {
+ StemContainer: legend_handler.HandlerStem(),
+ ErrorbarContainer: legend_handler.HandlerErrorbar(),
+ Line2D: legend_handler.HandlerLine2D(),
+ Patch: legend_handler.HandlerPatch(),
+ StepPatch: legend_handler.HandlerStepPatch(),
+ LineCollection: legend_handler.HandlerLineCollection(),
+ RegularPolyCollection: legend_handler.HandlerRegularPolyCollection(),
+ CircleCollection: legend_handler.HandlerCircleCollection(),
+ BarContainer: legend_handler.HandlerPatch(
+ update_func=legend_handler.update_from_first_child),
+ tuple: legend_handler.HandlerTuple(),
+ PathCollection: legend_handler.HandlerPathCollection(),
+ PolyCollection: legend_handler.HandlerPolyCollection()
+ }
+
+ # (get|set|update)_default_handler_maps are public interfaces to
+ # modify the default handler map.
+
+ @classmethod
+ def get_default_handler_map(cls):
+ """Return the global default handler map, shared by all legends."""
+ return cls._default_handler_map
+
+ @classmethod
+ def set_default_handler_map(cls, handler_map):
+ """Set the global default handler map, shared by all legends."""
+ cls._default_handler_map = handler_map
+
+ @classmethod
+ def update_default_handler_map(cls, handler_map):
+ """Update the global default handler map, shared by all legends."""
+ cls._default_handler_map.update(handler_map)
+
+ def get_legend_handler_map(self):
+ """Return this legend instance's handler map."""
+ default_handler_map = self.get_default_handler_map()
+ return ({**default_handler_map, **self._custom_handler_map}
+ if self._custom_handler_map else default_handler_map)
+
+ @staticmethod
+ def get_legend_handler(legend_handler_map, orig_handle):
+ """
+ Return a legend handler from *legend_handler_map* that
+ corresponds to *orig_handler*.
+
+ *legend_handler_map* should be a dictionary object (that is
+ returned by the get_legend_handler_map method).
+
+ It first checks if the *orig_handle* itself is a key in the
+ *legend_handler_map* and return the associated value.
+ Otherwise, it checks for each of the classes in its
+ method-resolution-order. If no matching key is found, it
+ returns ``None``.
+ """
+ try:
+ return legend_handler_map[orig_handle]
+ except (TypeError, KeyError): # TypeError if unhashable.
+ pass
+ for handle_type in type(orig_handle).mro():
+ try:
+ return legend_handler_map[handle_type]
+ except KeyError:
+ pass
+ return None
+
+ def _init_legend_box(self, handles, labels, markerfirst=True):
+ """
+ Initialize the legend_box. The legend_box is an instance of
+ the OffsetBox, which is packed with legend handles and
+ texts. Once packed, their location is calculated during the
+ drawing time.
+ """
+
+ fontsize = self._fontsize
+
+ # legend_box is a HPacker, horizontally packed with columns.
+ # Each column is a VPacker, vertically packed with legend items.
+ # Each legend item is a HPacker packed with:
+ # - handlebox: a DrawingArea which contains the legend handle.
+ # - labelbox: a TextArea which contains the legend text.
+
+ text_list = [] # the list of text instances
+ handle_list = [] # the list of handle instances
+ handles_and_labels = []
+
+ # The approximate height and descent of text. These values are
+ # only used for plotting the legend handle.
+ descent = 0.35 * fontsize * (self.handleheight - 0.7) # heuristic.
+ height = fontsize * self.handleheight - descent
+ # each handle needs to be drawn inside a box of (x, y, w, h) =
+ # (0, -descent, width, height). And their coordinates should
+ # be given in the display coordinates.
+
+ # The transformation of each handle will be automatically set
+ # to self.get_transform(). If the artist does not use its
+ # default transform (e.g., Collections), you need to
+ # manually set their transform to the self.get_transform().
+ legend_handler_map = self.get_legend_handler_map()
+
+ for orig_handle, label in zip(handles, labels):
+ handler = self.get_legend_handler(legend_handler_map, orig_handle)
+ if handler is None:
+ _api.warn_external(
+ "Legend does not support handles for "
+ f"{type(orig_handle).__name__} "
+ "instances.\nA proxy artist may be used "
+ "instead.\nSee: https://matplotlib.org/"
+ "stable/users/explain/axes/legend_guide.html"
+ "#controlling-the-legend-entries")
+ # No handle for this artist, so we just defer to None.
+ handle_list.append(None)
+ else:
+ textbox = TextArea(label, multilinebaseline=True,
+ textprops=dict(
+ verticalalignment='baseline',
+ horizontalalignment='left',
+ fontproperties=self.prop))
+ handlebox = DrawingArea(width=self.handlelength * fontsize,
+ height=height,
+ xdescent=0., ydescent=descent)
+
+ text_list.append(textbox._text)
+ # Create the artist for the legend which represents the
+ # original artist/handle.
+ handle_list.append(handler.legend_artist(self, orig_handle,
+ fontsize, handlebox))
+ handles_and_labels.append((handlebox, textbox))
+
+ columnbox = []
+ # array_split splits n handles_and_labels into ncols columns, with the
+ # first n%ncols columns having an extra entry. filter(len, ...)
+ # handles the case where n < ncols: the last ncols-n columns are empty
+ # and get filtered out.
+ for handles_and_labels_column in filter(
+ len, np.array_split(handles_and_labels, self._ncols)):
+ # pack handlebox and labelbox into itembox
+ itemboxes = [HPacker(pad=0,
+ sep=self.handletextpad * fontsize,
+ children=[h, t] if markerfirst else [t, h],
+ align="baseline")
+ for h, t in handles_and_labels_column]
+ # pack columnbox
+ alignment = "baseline" if markerfirst else "right"
+ columnbox.append(VPacker(pad=0,
+ sep=self.labelspacing * fontsize,
+ align=alignment,
+ children=itemboxes))
+
+ mode = "expand" if self._mode == "expand" else "fixed"
+ sep = self.columnspacing * fontsize
+ self._legend_handle_box = HPacker(pad=0,
+ sep=sep, align="baseline",
+ mode=mode,
+ children=columnbox)
+ self._legend_title_box = TextArea("")
+ self._legend_box = VPacker(pad=self.borderpad * fontsize,
+ sep=self.labelspacing * fontsize,
+ align=self._alignment,
+ children=[self._legend_title_box,
+ self._legend_handle_box])
+ self._legend_box.set_figure(self.get_figure(root=False))
+ self._legend_box.axes = self.axes
+ self.texts = text_list
+ self.legend_handles = handle_list
+
+ def _auto_legend_data(self, renderer):
+ """
+ Return display coordinates for hit testing for "best" positioning.
+
+ Returns
+ -------
+ bboxes
+ List of bounding boxes of all patches.
+ lines
+ List of `.Path` corresponding to each line.
+ offsets
+ List of (x, y) offsets of all collection.
+ """
+ assert self.isaxes # always holds, as this is only called internally
+ bboxes = []
+ lines = []
+ offsets = []
+ for artist in self.parent._children:
+ if isinstance(artist, Line2D):
+ lines.append(
+ artist.get_transform().transform_path(artist.get_path()))
+ elif isinstance(artist, Rectangle):
+ bboxes.append(
+ artist.get_bbox().transformed(artist.get_data_transform()))
+ elif isinstance(artist, Patch):
+ lines.append(
+ artist.get_transform().transform_path(artist.get_path()))
+ elif isinstance(artist, PolyCollection):
+ lines.extend(artist.get_transform().transform_path(path)
+ for path in artist.get_paths())
+ elif isinstance(artist, Collection):
+ transform, transOffset, hoffsets, _ = artist._prepare_points()
+ if len(hoffsets):
+ offsets.extend(transOffset.transform(hoffsets))
+ elif isinstance(artist, Text):
+ bboxes.append(artist.get_window_extent(renderer))
+
+ return bboxes, lines, offsets
+
+ def get_children(self):
+ # docstring inherited
+ return [self._legend_box, self.get_frame()]
+
+ def get_frame(self):
+ """Return the `~.patches.Rectangle` used to frame the legend."""
+ return self.legendPatch
+
+ def get_lines(self):
+ r"""Return the list of `~.lines.Line2D`\s in the legend."""
+ return [h for h in self.legend_handles if isinstance(h, Line2D)]
+
+ def get_patches(self):
+ r"""Return the list of `~.patches.Patch`\s in the legend."""
+ return silent_list('Patch',
+ [h for h in self.legend_handles
+ if isinstance(h, Patch)])
+
+ def get_texts(self):
+ r"""Return the list of `~.text.Text`\s in the legend."""
+ return silent_list('Text', self.texts)
+
+ def set_alignment(self, alignment):
+ """
+ Set the alignment of the legend title and the box of entries.
+
+ The entries are aligned as a single block, so that markers always
+ lined up.
+
+ Parameters
+ ----------
+ alignment : {'center', 'left', 'right'}.
+
+ """
+ _api.check_in_list(["center", "left", "right"], alignment=alignment)
+ self._alignment = alignment
+ self._legend_box.align = alignment
+
+ def get_alignment(self):
+ """Get the alignment value of the legend box"""
+ return self._legend_box.align
+
+ def set_title(self, title, prop=None):
+ """
+ Set legend title and title style.
+
+ Parameters
+ ----------
+ title : str
+ The legend title.
+
+ prop : `.font_manager.FontProperties` or `str` or `pathlib.Path`
+ The font properties of the legend title.
+ If a `str`, it is interpreted as a fontconfig pattern parsed by
+ `.FontProperties`. If a `pathlib.Path`, it is interpreted as the
+ absolute path to a font file.
+
+ """
+ self._legend_title_box._text.set_text(title)
+ if title:
+ self._legend_title_box._text.set_visible(True)
+ self._legend_title_box.set_visible(True)
+ else:
+ self._legend_title_box._text.set_visible(False)
+ self._legend_title_box.set_visible(False)
+
+ if prop is not None:
+ self._legend_title_box._text.set_fontproperties(prop)
+
+ self.stale = True
+
+ def get_title(self):
+ """Return the `.Text` instance for the legend title."""
+ return self._legend_title_box._text
+
+ def get_window_extent(self, renderer=None):
+ # docstring inherited
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ return self._legend_box.get_window_extent(renderer=renderer)
+
+ def get_tightbbox(self, renderer=None):
+ # docstring inherited
+ return self._legend_box.get_window_extent(renderer)
+
+ def get_frame_on(self):
+ """Get whether the legend box patch is drawn."""
+ return self.legendPatch.get_visible()
+
+ def set_frame_on(self, b):
+ """
+ Set whether the legend box patch is drawn.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ self.legendPatch.set_visible(b)
+ self.stale = True
+
+ draw_frame = set_frame_on # Backcompat alias.
+
+ def get_bbox_to_anchor(self):
+ """Return the bbox that the legend will be anchored to."""
+ if self._bbox_to_anchor is None:
+ return self.parent.bbox
+ else:
+ return self._bbox_to_anchor
+
+ def set_bbox_to_anchor(self, bbox, transform=None):
+ """
+ Set the bbox that the legend will be anchored to.
+
+ Parameters
+ ----------
+ bbox : `~matplotlib.transforms.BboxBase` or tuple
+ The bounding box can be specified in the following ways:
+
+ - A `.BboxBase` instance
+ - A tuple of ``(left, bottom, width, height)`` in the given
+ transform (normalized axes coordinate if None)
+ - A tuple of ``(left, bottom)`` where the width and height will be
+ assumed to be zero.
+ - *None*, to remove the bbox anchoring, and use the parent bbox.
+
+ transform : `~matplotlib.transforms.Transform`, optional
+ A transform to apply to the bounding box. If not specified, this
+ will use a transform to the bounding box of the parent.
+ """
+ if bbox is None:
+ self._bbox_to_anchor = None
+ return
+ elif isinstance(bbox, BboxBase):
+ self._bbox_to_anchor = bbox
+ else:
+ try:
+ l = len(bbox)
+ except TypeError as err:
+ raise ValueError(f"Invalid bbox: {bbox}") from err
+
+ if l == 2:
+ bbox = [bbox[0], bbox[1], 0, 0]
+
+ self._bbox_to_anchor = Bbox.from_bounds(*bbox)
+
+ if transform is None:
+ transform = BboxTransformTo(self.parent.bbox)
+
+ self._bbox_to_anchor = TransformedBbox(self._bbox_to_anchor,
+ transform)
+ self.stale = True
+
+ def _get_anchored_bbox(self, loc, bbox, parentbbox, renderer):
+ """
+ Place the *bbox* inside the *parentbbox* according to a given
+ location code. Return the (x, y) coordinate of the bbox.
+
+ Parameters
+ ----------
+ loc : int
+ A location code in range(1, 11). This corresponds to the possible
+ values for ``self._loc``, excluding "best".
+ bbox : `~matplotlib.transforms.Bbox`
+ bbox to be placed, in display coordinates.
+ parentbbox : `~matplotlib.transforms.Bbox`
+ A parent box which will contain the bbox, in display coordinates.
+ """
+ return offsetbox._get_anchored_bbox(
+ loc, bbox, parentbbox,
+ self.borderaxespad * renderer.points_to_pixels(self._fontsize))
+
+ def _find_best_position(self, width, height, renderer):
+ """Determine the best location to place the legend."""
+ assert self.isaxes # always holds, as this is only called internally
+
+ start_time = time.perf_counter()
+
+ bboxes, lines, offsets = self._auto_legend_data(renderer)
+
+ bbox = Bbox.from_bounds(0, 0, width, height)
+
+ candidates = []
+ for idx in range(1, len(self.codes)):
+ l, b = self._get_anchored_bbox(idx, bbox,
+ self.get_bbox_to_anchor(),
+ renderer)
+ legendBox = Bbox.from_bounds(l, b, width, height)
+ # XXX TODO: If markers are present, it would be good to take them
+ # into account when checking vertex overlaps in the next line.
+ badness = (sum(legendBox.count_contains(line.vertices)
+ for line in lines)
+ + legendBox.count_contains(offsets)
+ + legendBox.count_overlaps(bboxes)
+ + sum(line.intersects_bbox(legendBox, filled=False)
+ for line in lines))
+ # Include the index to favor lower codes in case of a tie.
+ candidates.append((badness, idx, (l, b)))
+ if badness == 0:
+ break
+
+ _, _, (l, b) = min(candidates)
+
+ if self._loc_used_default and time.perf_counter() - start_time > 1:
+ _api.warn_external(
+ 'Creating legend with loc="best" can be slow with large '
+ 'amounts of data.')
+
+ return l, b
+
+ def contains(self, mouseevent):
+ return self.legendPatch.contains(mouseevent)
+
+ def set_draggable(self, state, use_blit=False, update='loc'):
+ """
+ Enable or disable mouse dragging support of the legend.
+
+ Parameters
+ ----------
+ state : bool
+ Whether mouse dragging is enabled.
+ use_blit : bool, optional
+ Use blitting for faster image composition. For details see
+ :ref:`func-animation`.
+ update : {'loc', 'bbox'}, optional
+ The legend parameter to be changed when dragged:
+
+ - 'loc': update the *loc* parameter of the legend
+ - 'bbox': update the *bbox_to_anchor* parameter of the legend
+
+ Returns
+ -------
+ `.DraggableLegend` or *None*
+ If *state* is ``True`` this returns the `.DraggableLegend` helper
+ instance. Otherwise this returns *None*.
+ """
+ if state:
+ if self._draggable is None:
+ self._draggable = DraggableLegend(self,
+ use_blit,
+ update=update)
+ else:
+ if self._draggable is not None:
+ self._draggable.disconnect()
+ self._draggable = None
+ return self._draggable
+
+ def get_draggable(self):
+ """Return ``True`` if the legend is draggable, ``False`` otherwise."""
+ return self._draggable is not None
+
+
+# Helper functions to parse legend arguments for both `figure.legend` and
+# `axes.legend`:
+def _get_legend_handles(axs, legend_handler_map=None):
+ """Yield artists that can be used as handles in a legend."""
+ handles_original = []
+ for ax in axs:
+ handles_original += [
+ *(a for a in ax._children
+ if isinstance(a, (Line2D, Patch, Collection, Text))),
+ *ax.containers]
+ # support parasite Axes:
+ if hasattr(ax, 'parasites'):
+ for axx in ax.parasites:
+ handles_original += [
+ *(a for a in axx._children
+ if isinstance(a, (Line2D, Patch, Collection, Text))),
+ *axx.containers]
+
+ handler_map = {**Legend.get_default_handler_map(),
+ **(legend_handler_map or {})}
+ has_handler = Legend.get_legend_handler
+ for handle in handles_original:
+ label = handle.get_label()
+ if label != '_nolegend_' and has_handler(handler_map, handle):
+ yield handle
+ elif (label and not label.startswith('_') and
+ not has_handler(handler_map, handle)):
+ _api.warn_external(
+ "Legend does not support handles for "
+ f"{type(handle).__name__} "
+ "instances.\nSee: https://matplotlib.org/stable/"
+ "tutorials/intermediate/legend_guide.html"
+ "#implementing-a-custom-legend-handler")
+ continue
+
+
+def _get_legend_handles_labels(axs, legend_handler_map=None):
+ """Return handles and labels for legend."""
+ handles = []
+ labels = []
+ for handle in _get_legend_handles(axs, legend_handler_map):
+ label = handle.get_label()
+ if label and not label.startswith('_'):
+ handles.append(handle)
+ labels.append(label)
+ return handles, labels
+
+
+def _parse_legend_args(axs, *args, handles=None, labels=None, **kwargs):
+ """
+ Get the handles and labels from the calls to either ``figure.legend``
+ or ``axes.legend``.
+
+ The parser is a bit involved because we support::
+
+ legend()
+ legend(labels)
+ legend(handles, labels)
+ legend(labels=labels)
+ legend(handles=handles)
+ legend(handles=handles, labels=labels)
+
+ The behavior for a mixture of positional and keyword handles and labels
+ is undefined and issues a warning; it will be an error in the future.
+
+ Parameters
+ ----------
+ axs : list of `.Axes`
+ If handles are not given explicitly, the artists in these Axes are
+ used as handles.
+ *args : tuple
+ Positional parameters passed to ``legend()``.
+ handles
+ The value of the keyword argument ``legend(handles=...)``, or *None*
+ if that keyword argument was not used.
+ labels
+ The value of the keyword argument ``legend(labels=...)``, or *None*
+ if that keyword argument was not used.
+ **kwargs
+ All other keyword arguments passed to ``legend()``.
+
+ Returns
+ -------
+ handles : list of (`.Artist` or tuple of `.Artist`)
+ The legend handles.
+ labels : list of str
+ The legend labels.
+ kwargs : dict
+ *kwargs* with keywords handles and labels removed.
+
+ """
+ log = logging.getLogger(__name__)
+
+ handlers = kwargs.get('handler_map')
+
+ if (handles is not None or labels is not None) and args:
+ _api.warn_deprecated("3.9", message=(
+ "You have mixed positional and keyword arguments, some input may "
+ "be discarded. This is deprecated since %(since)s and will "
+ "become an error in %(removal)s."))
+
+ if (hasattr(handles, "__len__") and
+ hasattr(labels, "__len__") and
+ len(handles) != len(labels)):
+ _api.warn_external(f"Mismatched number of handles and labels: "
+ f"len(handles) = {len(handles)} "
+ f"len(labels) = {len(labels)}")
+ # if got both handles and labels as kwargs, make same length
+ if handles and labels:
+ handles, labels = zip(*zip(handles, labels))
+
+ elif handles is not None and labels is None:
+ labels = [handle.get_label() for handle in handles]
+
+ elif labels is not None and handles is None:
+ # Get as many handles as there are labels.
+ handles = [handle for handle, label
+ in zip(_get_legend_handles(axs, handlers), labels)]
+
+ elif len(args) == 0: # 0 args: automatically detect labels and handles.
+ handles, labels = _get_legend_handles_labels(axs, handlers)
+ if not handles:
+ _api.warn_external(
+ "No artists with labels found to put in legend. Note that "
+ "artists whose label start with an underscore are ignored "
+ "when legend() is called with no argument.")
+
+ elif len(args) == 1: # 1 arg: user defined labels, automatic handle detection.
+ labels, = args
+ if any(isinstance(l, Artist) for l in labels):
+ raise TypeError("A single argument passed to legend() must be a "
+ "list of labels, but found an Artist in there.")
+
+ # Get as many handles as there are labels.
+ handles = [handle for handle, label
+ in zip(_get_legend_handles(axs, handlers), labels)]
+
+ elif len(args) == 2: # 2 args: user defined handles and labels.
+ handles, labels = args[:2]
+
+ else:
+ raise _api.nargs_error('legend', '0-2', len(args))
+
+ return handles, labels, kwargs
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..dde5882da69d0c866586ad199ed4c3012adc1f01
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend.pyi
@@ -0,0 +1,152 @@
+from matplotlib.axes import Axes
+from matplotlib.artist import Artist
+from matplotlib.backend_bases import MouseEvent
+from matplotlib.figure import Figure
+from matplotlib.font_manager import FontProperties
+from matplotlib.legend_handler import HandlerBase
+from matplotlib.lines import Line2D
+from matplotlib.offsetbox import (
+ DraggableOffsetBox,
+)
+from matplotlib.patches import FancyBboxPatch, Patch, Rectangle
+from matplotlib.text import Text
+from matplotlib.transforms import (
+ BboxBase,
+ Transform,
+)
+
+
+import pathlib
+from collections.abc import Iterable
+from typing import Any, Literal, overload
+from .typing import ColorType
+
+class DraggableLegend(DraggableOffsetBox):
+ legend: Legend
+ def __init__(
+ self, legend: Legend, use_blit: bool = ..., update: Literal["loc", "bbox"] = ...
+ ) -> None: ...
+ def finalize_offset(self) -> None: ...
+
+class Legend(Artist):
+ codes: dict[str, int]
+ zorder: float
+ prop: FontProperties
+ texts: list[Text]
+ legend_handles: list[Artist | None]
+ numpoints: int
+ markerscale: float
+ scatterpoints: int
+ borderpad: float
+ labelspacing: float
+ handlelength: float
+ handleheight: float
+ handletextpad: float
+ borderaxespad: float
+ columnspacing: float
+ shadow: bool
+ isaxes: bool
+ axes: Axes
+ parent: Axes | Figure
+ legendPatch: FancyBboxPatch
+ def __init__(
+ self,
+ parent: Axes | Figure,
+ handles: Iterable[Artist | tuple[Artist, ...]],
+ labels: Iterable[str],
+ *,
+ loc: str | tuple[float, float] | int | None = ...,
+ numpoints: int | None = ...,
+ markerscale: float | None = ...,
+ markerfirst: bool = ...,
+ reverse: bool = ...,
+ scatterpoints: int | None = ...,
+ scatteryoffsets: Iterable[float] | None = ...,
+ prop: FontProperties | dict[str, Any] | None = ...,
+ fontsize: float | str | None = ...,
+ labelcolor: ColorType
+ | Iterable[ColorType]
+ | Literal["linecolor", "markerfacecolor", "mfc", "markeredgecolor", "mec"]
+ | None = ...,
+ borderpad: float | None = ...,
+ labelspacing: float | None = ...,
+ handlelength: float | None = ...,
+ handleheight: float | None = ...,
+ handletextpad: float | None = ...,
+ borderaxespad: float | None = ...,
+ columnspacing: float | None = ...,
+ ncols: int = ...,
+ mode: Literal["expand"] | None = ...,
+ fancybox: bool | None = ...,
+ shadow: bool | dict[str, Any] | None = ...,
+ title: str | None = ...,
+ title_fontsize: float | None = ...,
+ framealpha: float | None = ...,
+ edgecolor: Literal["inherit"] | ColorType | None = ...,
+ facecolor: Literal["inherit"] | ColorType | None = ...,
+ bbox_to_anchor: BboxBase
+ | tuple[float, float]
+ | tuple[float, float, float, float]
+ | None = ...,
+ bbox_transform: Transform | None = ...,
+ frameon: bool | None = ...,
+ handler_map: dict[Artist | type, HandlerBase] | None = ...,
+ title_fontproperties: FontProperties | dict[str, Any] | None = ...,
+ alignment: Literal["center", "left", "right"] = ...,
+ ncol: int = ...,
+ draggable: bool = ...
+ ) -> None: ...
+ def contains(self, mouseevent: MouseEvent) -> tuple[bool, dict[Any, Any]]: ...
+ def set_ncols(self, ncols: int) -> None: ...
+ @classmethod
+ def get_default_handler_map(cls) -> dict[type, HandlerBase]: ...
+ @classmethod
+ def set_default_handler_map(cls, handler_map: dict[type, HandlerBase]) -> None: ...
+ @classmethod
+ def update_default_handler_map(
+ cls, handler_map: dict[type, HandlerBase]
+ ) -> None: ...
+ def get_legend_handler_map(self) -> dict[type, HandlerBase]: ...
+ @staticmethod
+ def get_legend_handler(
+ legend_handler_map: dict[type, HandlerBase], orig_handle: Any
+ ) -> HandlerBase | None: ...
+ def get_children(self) -> list[Artist]: ...
+ def get_frame(self) -> Rectangle: ...
+ def get_lines(self) -> list[Line2D]: ...
+ def get_patches(self) -> list[Patch]: ...
+ def get_texts(self) -> list[Text]: ...
+ def set_alignment(self, alignment: Literal["center", "left", "right"]) -> None: ...
+ def get_alignment(self) -> Literal["center", "left", "right"]: ...
+ def set_loc(self, loc: str | tuple[float, float] | int | None = ...) -> None: ...
+ def set_title(
+ self, title: str, prop: FontProperties | str | pathlib.Path | None = ...
+ ) -> None: ...
+ def get_title(self) -> Text: ...
+ def get_frame_on(self) -> bool: ...
+ def set_frame_on(self, b: bool) -> None: ...
+ draw_frame = set_frame_on
+ def get_bbox_to_anchor(self) -> BboxBase: ...
+ def set_bbox_to_anchor(
+ self,
+ bbox: BboxBase
+ | tuple[float, float]
+ | tuple[float, float, float, float]
+ | None,
+ transform: Transform | None = ...
+ ) -> None: ...
+ @overload
+ def set_draggable(
+ self,
+ state: Literal[True],
+ use_blit: bool = ...,
+ update: Literal["loc", "bbox"] = ...,
+ ) -> DraggableLegend: ...
+ @overload
+ def set_draggable(
+ self,
+ state: Literal[False],
+ use_blit: bool = ...,
+ update: Literal["loc", "bbox"] = ...,
+ ) -> None: ...
+ def get_draggable(self) -> bool: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend_handler.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend_handler.py
new file mode 100644
index 0000000000000000000000000000000000000000..97076ad09cb83ec6d0cde1bdb0e2a9644a223381
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend_handler.py
@@ -0,0 +1,813 @@
+"""
+Default legend handlers.
+
+.. important::
+
+ This is a low-level legend API, which most end users do not need.
+
+ We recommend that you are familiar with the :ref:`legend guide
+ ` before reading this documentation.
+
+Legend handlers are expected to be a callable object with a following
+signature::
+
+ legend_handler(legend, orig_handle, fontsize, handlebox)
+
+Where *legend* is the legend itself, *orig_handle* is the original
+plot, *fontsize* is the fontsize in pixels, and *handlebox* is an
+`.OffsetBox` instance. Within the call, you should create relevant
+artists (using relevant properties from the *legend* and/or
+*orig_handle*) and add them into the *handlebox*. The artists need to
+be scaled according to the *fontsize* (note that the size is in pixels,
+i.e., this is dpi-scaled value).
+
+This module includes definition of several legend handler classes
+derived from the base class (HandlerBase) with the following method::
+
+ def legend_artist(self, legend, orig_handle, fontsize, handlebox)
+"""
+
+from itertools import cycle
+
+import numpy as np
+
+from matplotlib import cbook
+from matplotlib.lines import Line2D
+from matplotlib.patches import Rectangle
+import matplotlib.collections as mcoll
+
+
+def update_from_first_child(tgt, src):
+ first_child = next(iter(src.get_children()), None)
+ if first_child is not None:
+ tgt.update_from(first_child)
+
+
+class HandlerBase:
+ """
+ A base class for default legend handlers.
+
+ The derived classes are meant to override *create_artists* method, which
+ has the following signature::
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ trans):
+
+ The overridden method needs to create artists of the given
+ transform that fits in the given dimension (xdescent, ydescent,
+ width, height) that are scaled by fontsize if necessary.
+
+ """
+ def __init__(self, xpad=0., ypad=0., update_func=None):
+ """
+ Parameters
+ ----------
+ xpad : float, optional
+ Padding in x-direction.
+ ypad : float, optional
+ Padding in y-direction.
+ update_func : callable, optional
+ Function for updating the legend handler properties from another
+ legend handler, used by `~HandlerBase.update_prop`.
+ """
+ self._xpad, self._ypad = xpad, ypad
+ self._update_prop_func = update_func
+
+ def _update_prop(self, legend_handle, orig_handle):
+ if self._update_prop_func is None:
+ self._default_update_prop(legend_handle, orig_handle)
+ else:
+ self._update_prop_func(legend_handle, orig_handle)
+
+ def _default_update_prop(self, legend_handle, orig_handle):
+ legend_handle.update_from(orig_handle)
+
+ def update_prop(self, legend_handle, orig_handle, legend):
+
+ self._update_prop(legend_handle, orig_handle)
+
+ legend._set_artist_props(legend_handle)
+ legend_handle.set_clip_box(None)
+ legend_handle.set_clip_path(None)
+
+ def adjust_drawing_area(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ ):
+ xdescent = xdescent - self._xpad * fontsize
+ ydescent = ydescent - self._ypad * fontsize
+ width = width - self._xpad * fontsize
+ height = height - self._ypad * fontsize
+ return xdescent, ydescent, width, height
+
+ def legend_artist(self, legend, orig_handle,
+ fontsize, handlebox):
+ """
+ Return the artist that this HandlerBase generates for the given
+ original artist/handle.
+
+ Parameters
+ ----------
+ legend : `~matplotlib.legend.Legend`
+ The legend for which these legend artists are being created.
+ orig_handle : :class:`matplotlib.artist.Artist` or similar
+ The object for which these legend artists are being created.
+ fontsize : int
+ The fontsize in pixels. The artists being created should
+ be scaled according to the given fontsize.
+ handlebox : `~matplotlib.offsetbox.OffsetBox`
+ The box which has been created to hold this legend entry's
+ artists. Artists created in the `legend_artist` method must
+ be added to this handlebox inside this method.
+
+ """
+ xdescent, ydescent, width, height = self.adjust_drawing_area(
+ legend, orig_handle,
+ handlebox.xdescent, handlebox.ydescent,
+ handlebox.width, handlebox.height,
+ fontsize)
+ artists = self.create_artists(legend, orig_handle,
+ xdescent, ydescent, width, height,
+ fontsize, handlebox.get_transform())
+
+ # create_artists will return a list of artists.
+ for a in artists:
+ handlebox.add_artist(a)
+
+ # we only return the first artist
+ return artists[0]
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ trans):
+ """
+ Return the legend artists generated.
+
+ Parameters
+ ----------
+ legend : `~matplotlib.legend.Legend`
+ The legend for which these legend artists are being created.
+ orig_handle : `~matplotlib.artist.Artist` or similar
+ The object for which these legend artists are being created.
+ xdescent, ydescent, width, height : int
+ The rectangle (*xdescent*, *ydescent*, *width*, *height*) that the
+ legend artists being created should fit within.
+ fontsize : int
+ The fontsize in pixels. The legend artists being created should
+ be scaled according to the given fontsize.
+ trans : `~matplotlib.transforms.Transform`
+ The transform that is applied to the legend artists being created.
+ Typically from unit coordinates in the handler box to screen
+ coordinates.
+ """
+ raise NotImplementedError('Derived must override')
+
+
+class HandlerNpoints(HandlerBase):
+ """
+ A legend handler that shows *numpoints* points in the legend entry.
+ """
+
+ def __init__(self, marker_pad=0.3, numpoints=None, **kwargs):
+ """
+ Parameters
+ ----------
+ marker_pad : float
+ Padding between points in legend entry.
+ numpoints : int
+ Number of points to show in legend entry.
+ **kwargs
+ Keyword arguments forwarded to `.HandlerBase`.
+ """
+ super().__init__(**kwargs)
+
+ self._numpoints = numpoints
+ self._marker_pad = marker_pad
+
+ def get_numpoints(self, legend):
+ if self._numpoints is None:
+ return legend.numpoints
+ else:
+ return self._numpoints
+
+ def get_xdata(self, legend, xdescent, ydescent, width, height, fontsize):
+ numpoints = self.get_numpoints(legend)
+ if numpoints > 1:
+ # we put some pad here to compensate the size of the marker
+ pad = self._marker_pad * fontsize
+ xdata = np.linspace(-xdescent + pad,
+ -xdescent + width - pad,
+ numpoints)
+ xdata_marker = xdata
+ else:
+ xdata = [-xdescent, -xdescent + width]
+ xdata_marker = [-xdescent + 0.5 * width]
+ return xdata, xdata_marker
+
+
+class HandlerNpointsYoffsets(HandlerNpoints):
+ """
+ A legend handler that shows *numpoints* in the legend, and allows them to
+ be individually offset in the y-direction.
+ """
+
+ def __init__(self, numpoints=None, yoffsets=None, **kwargs):
+ """
+ Parameters
+ ----------
+ numpoints : int
+ Number of points to show in legend entry.
+ yoffsets : array of floats
+ Length *numpoints* list of y offsets for each point in
+ legend entry.
+ **kwargs
+ Keyword arguments forwarded to `.HandlerNpoints`.
+ """
+ super().__init__(numpoints=numpoints, **kwargs)
+ self._yoffsets = yoffsets
+
+ def get_ydata(self, legend, xdescent, ydescent, width, height, fontsize):
+ if self._yoffsets is None:
+ ydata = height * legend._scatteryoffsets
+ else:
+ ydata = height * np.asarray(self._yoffsets)
+
+ return ydata
+
+
+class HandlerLine2DCompound(HandlerNpoints):
+ """
+ Original handler for `.Line2D` instances, that relies on combining
+ a line-only with a marker-only artist. May be deprecated in the future.
+ """
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ trans):
+ # docstring inherited
+ xdata, xdata_marker = self.get_xdata(legend, xdescent, ydescent,
+ width, height, fontsize)
+
+ ydata = np.full_like(xdata, ((height - ydescent) / 2))
+ legline = Line2D(xdata, ydata)
+
+ self.update_prop(legline, orig_handle, legend)
+ legline.set_drawstyle('default')
+ legline.set_marker("")
+
+ legline_marker = Line2D(xdata_marker, ydata[:len(xdata_marker)])
+ self.update_prop(legline_marker, orig_handle, legend)
+ legline_marker.set_linestyle('None')
+ if legend.markerscale != 1:
+ newsz = legline_marker.get_markersize() * legend.markerscale
+ legline_marker.set_markersize(newsz)
+ # we don't want to add this to the return list because
+ # the texts and handles are assumed to be in one-to-one
+ # correspondence.
+ legline._legmarker = legline_marker
+
+ legline.set_transform(trans)
+ legline_marker.set_transform(trans)
+
+ return [legline, legline_marker]
+
+
+class HandlerLine2D(HandlerNpoints):
+ """
+ Handler for `.Line2D` instances.
+
+ See Also
+ --------
+ HandlerLine2DCompound : An earlier handler implementation, which used one
+ artist for the line and another for the marker(s).
+ """
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ trans):
+ # docstring inherited
+ xdata, xdata_marker = self.get_xdata(legend, xdescent, ydescent,
+ width, height, fontsize)
+
+ markevery = None
+ if self.get_numpoints(legend) == 1:
+ # Special case: one wants a single marker in the center
+ # and a line that extends on both sides. One will use a
+ # 3 points line, but only mark the #1 (i.e. middle) point.
+ xdata = np.linspace(xdata[0], xdata[-1], 3)
+ markevery = [1]
+
+ ydata = np.full_like(xdata, (height - ydescent) / 2)
+ legline = Line2D(xdata, ydata, markevery=markevery)
+
+ self.update_prop(legline, orig_handle, legend)
+
+ if legend.markerscale != 1:
+ newsz = legline.get_markersize() * legend.markerscale
+ legline.set_markersize(newsz)
+
+ legline.set_transform(trans)
+
+ return [legline]
+
+
+class HandlerPatch(HandlerBase):
+ """
+ Handler for `.Patch` instances.
+ """
+
+ def __init__(self, patch_func=None, **kwargs):
+ """
+ Parameters
+ ----------
+ patch_func : callable, optional
+ The function that creates the legend key artist.
+ *patch_func* should have the signature::
+
+ def patch_func(legend=legend, orig_handle=orig_handle,
+ xdescent=xdescent, ydescent=ydescent,
+ width=width, height=height, fontsize=fontsize)
+
+ Subsequently, the created artist will have its ``update_prop``
+ method called and the appropriate transform will be applied.
+
+ **kwargs
+ Keyword arguments forwarded to `.HandlerBase`.
+ """
+ super().__init__(**kwargs)
+ self._patch_func = patch_func
+
+ def _create_patch(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize):
+ if self._patch_func is None:
+ p = Rectangle(xy=(-xdescent, -ydescent),
+ width=width, height=height)
+ else:
+ p = self._patch_func(legend=legend, orig_handle=orig_handle,
+ xdescent=xdescent, ydescent=ydescent,
+ width=width, height=height, fontsize=fontsize)
+ return p
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize, trans):
+ # docstring inherited
+ p = self._create_patch(legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize)
+ self.update_prop(p, orig_handle, legend)
+ p.set_transform(trans)
+ return [p]
+
+
+class HandlerStepPatch(HandlerBase):
+ """
+ Handler for `~.matplotlib.patches.StepPatch` instances.
+ """
+
+ @staticmethod
+ def _create_patch(orig_handle, xdescent, ydescent, width, height):
+ return Rectangle(xy=(-xdescent, -ydescent), width=width,
+ height=height, color=orig_handle.get_facecolor())
+
+ @staticmethod
+ def _create_line(orig_handle, width, height):
+ # Unfilled StepPatch should show as a line
+ legline = Line2D([0, width], [height/2, height/2],
+ color=orig_handle.get_edgecolor(),
+ linestyle=orig_handle.get_linestyle(),
+ linewidth=orig_handle.get_linewidth(),
+ )
+
+ # Overwrite manually because patch and line properties don't mix
+ legline.set_drawstyle('default')
+ legline.set_marker("")
+ return legline
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize, trans):
+ # docstring inherited
+ if orig_handle.get_fill() or (orig_handle.get_hatch() is not None):
+ p = self._create_patch(orig_handle, xdescent, ydescent, width,
+ height)
+ self.update_prop(p, orig_handle, legend)
+ else:
+ p = self._create_line(orig_handle, width, height)
+ p.set_transform(trans)
+ return [p]
+
+
+class HandlerLineCollection(HandlerLine2D):
+ """
+ Handler for `.LineCollection` instances.
+ """
+ def get_numpoints(self, legend):
+ if self._numpoints is None:
+ return legend.scatterpoints
+ else:
+ return self._numpoints
+
+ def _default_update_prop(self, legend_handle, orig_handle):
+ lw = orig_handle.get_linewidths()[0]
+ dashes = orig_handle._us_linestyles[0]
+ color = orig_handle.get_colors()[0]
+ legend_handle.set_color(color)
+ legend_handle.set_linestyle(dashes)
+ legend_handle.set_linewidth(lw)
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize, trans):
+ # docstring inherited
+ xdata, xdata_marker = self.get_xdata(legend, xdescent, ydescent,
+ width, height, fontsize)
+ ydata = np.full_like(xdata, (height - ydescent) / 2)
+ legline = Line2D(xdata, ydata)
+
+ self.update_prop(legline, orig_handle, legend)
+ legline.set_transform(trans)
+
+ return [legline]
+
+
+class HandlerRegularPolyCollection(HandlerNpointsYoffsets):
+ r"""Handler for `.RegularPolyCollection`\s."""
+
+ def __init__(self, yoffsets=None, sizes=None, **kwargs):
+ super().__init__(yoffsets=yoffsets, **kwargs)
+
+ self._sizes = sizes
+
+ def get_numpoints(self, legend):
+ if self._numpoints is None:
+ return legend.scatterpoints
+ else:
+ return self._numpoints
+
+ def get_sizes(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize):
+ if self._sizes is None:
+ handle_sizes = orig_handle.get_sizes()
+ if not len(handle_sizes):
+ handle_sizes = [1]
+ size_max = max(handle_sizes) * legend.markerscale ** 2
+ size_min = min(handle_sizes) * legend.markerscale ** 2
+
+ numpoints = self.get_numpoints(legend)
+ if numpoints < 4:
+ sizes = [.5 * (size_max + size_min), size_max,
+ size_min][:numpoints]
+ else:
+ rng = (size_max - size_min)
+ sizes = rng * np.linspace(0, 1, numpoints) + size_min
+ else:
+ sizes = self._sizes
+
+ return sizes
+
+ def update_prop(self, legend_handle, orig_handle, legend):
+
+ self._update_prop(legend_handle, orig_handle)
+
+ legend_handle.set_figure(legend.get_figure(root=False))
+ # legend._set_artist_props(legend_handle)
+ legend_handle.set_clip_box(None)
+ legend_handle.set_clip_path(None)
+
+ def create_collection(self, orig_handle, sizes, offsets, offset_transform):
+ return type(orig_handle)(
+ orig_handle.get_numsides(),
+ rotation=orig_handle.get_rotation(), sizes=sizes,
+ offsets=offsets, offset_transform=offset_transform,
+ )
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ trans):
+ # docstring inherited
+ xdata, xdata_marker = self.get_xdata(legend, xdescent, ydescent,
+ width, height, fontsize)
+
+ ydata = self.get_ydata(legend, xdescent, ydescent,
+ width, height, fontsize)
+
+ sizes = self.get_sizes(legend, orig_handle, xdescent, ydescent,
+ width, height, fontsize)
+
+ p = self.create_collection(
+ orig_handle, sizes,
+ offsets=list(zip(xdata_marker, ydata)), offset_transform=trans)
+
+ self.update_prop(p, orig_handle, legend)
+ p.set_offset_transform(trans)
+ return [p]
+
+
+class HandlerPathCollection(HandlerRegularPolyCollection):
+ r"""Handler for `.PathCollection`\s, which are used by `~.Axes.scatter`."""
+
+ def create_collection(self, orig_handle, sizes, offsets, offset_transform):
+ return type(orig_handle)(
+ [orig_handle.get_paths()[0]], sizes=sizes,
+ offsets=offsets, offset_transform=offset_transform,
+ )
+
+
+class HandlerCircleCollection(HandlerRegularPolyCollection):
+ r"""Handler for `.CircleCollection`\s."""
+
+ def create_collection(self, orig_handle, sizes, offsets, offset_transform):
+ return type(orig_handle)(
+ sizes, offsets=offsets, offset_transform=offset_transform)
+
+
+class HandlerErrorbar(HandlerLine2D):
+ """Handler for Errorbars."""
+
+ def __init__(self, xerr_size=0.5, yerr_size=None,
+ marker_pad=0.3, numpoints=None, **kwargs):
+
+ self._xerr_size = xerr_size
+ self._yerr_size = yerr_size
+
+ super().__init__(marker_pad=marker_pad, numpoints=numpoints, **kwargs)
+
+ def get_err_size(self, legend, xdescent, ydescent,
+ width, height, fontsize):
+ xerr_size = self._xerr_size * fontsize
+
+ if self._yerr_size is None:
+ yerr_size = xerr_size
+ else:
+ yerr_size = self._yerr_size * fontsize
+
+ return xerr_size, yerr_size
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ trans):
+ # docstring inherited
+ plotlines, caplines, barlinecols = orig_handle
+
+ xdata, xdata_marker = self.get_xdata(legend, xdescent, ydescent,
+ width, height, fontsize)
+
+ ydata = np.full_like(xdata, (height - ydescent) / 2)
+ legline = Line2D(xdata, ydata)
+
+ xdata_marker = np.asarray(xdata_marker)
+ ydata_marker = np.asarray(ydata[:len(xdata_marker)])
+
+ xerr_size, yerr_size = self.get_err_size(legend, xdescent, ydescent,
+ width, height, fontsize)
+
+ legline_marker = Line2D(xdata_marker, ydata_marker)
+
+ # when plotlines are None (only errorbars are drawn), we just
+ # make legline invisible.
+ if plotlines is None:
+ legline.set_visible(False)
+ legline_marker.set_visible(False)
+ else:
+ self.update_prop(legline, plotlines, legend)
+
+ legline.set_drawstyle('default')
+ legline.set_marker('none')
+
+ self.update_prop(legline_marker, plotlines, legend)
+ legline_marker.set_linestyle('None')
+
+ if legend.markerscale != 1:
+ newsz = legline_marker.get_markersize() * legend.markerscale
+ legline_marker.set_markersize(newsz)
+
+ handle_barlinecols = []
+ handle_caplines = []
+
+ if orig_handle.has_xerr:
+ verts = [((x - xerr_size, y), (x + xerr_size, y))
+ for x, y in zip(xdata_marker, ydata_marker)]
+ coll = mcoll.LineCollection(verts)
+ self.update_prop(coll, barlinecols[0], legend)
+ handle_barlinecols.append(coll)
+
+ if caplines:
+ capline_left = Line2D(xdata_marker - xerr_size, ydata_marker)
+ capline_right = Line2D(xdata_marker + xerr_size, ydata_marker)
+ self.update_prop(capline_left, caplines[0], legend)
+ self.update_prop(capline_right, caplines[0], legend)
+ capline_left.set_marker("|")
+ capline_right.set_marker("|")
+
+ handle_caplines.append(capline_left)
+ handle_caplines.append(capline_right)
+
+ if orig_handle.has_yerr:
+ verts = [((x, y - yerr_size), (x, y + yerr_size))
+ for x, y in zip(xdata_marker, ydata_marker)]
+ coll = mcoll.LineCollection(verts)
+ self.update_prop(coll, barlinecols[0], legend)
+ handle_barlinecols.append(coll)
+
+ if caplines:
+ capline_left = Line2D(xdata_marker, ydata_marker - yerr_size)
+ capline_right = Line2D(xdata_marker, ydata_marker + yerr_size)
+ self.update_prop(capline_left, caplines[0], legend)
+ self.update_prop(capline_right, caplines[0], legend)
+ capline_left.set_marker("_")
+ capline_right.set_marker("_")
+
+ handle_caplines.append(capline_left)
+ handle_caplines.append(capline_right)
+
+ artists = [
+ *handle_barlinecols, *handle_caplines, legline, legline_marker,
+ ]
+ for artist in artists:
+ artist.set_transform(trans)
+ return artists
+
+
+class HandlerStem(HandlerNpointsYoffsets):
+ """
+ Handler for plots produced by `~.Axes.stem`.
+ """
+
+ def __init__(self, marker_pad=0.3, numpoints=None,
+ bottom=None, yoffsets=None, **kwargs):
+ """
+ Parameters
+ ----------
+ marker_pad : float, default: 0.3
+ Padding between points in legend entry.
+ numpoints : int, optional
+ Number of points to show in legend entry.
+ bottom : float, optional
+
+ yoffsets : array of floats, optional
+ Length *numpoints* list of y offsets for each point in
+ legend entry.
+ **kwargs
+ Keyword arguments forwarded to `.HandlerNpointsYoffsets`.
+ """
+ super().__init__(marker_pad=marker_pad, numpoints=numpoints,
+ yoffsets=yoffsets, **kwargs)
+ self._bottom = bottom
+
+ def get_ydata(self, legend, xdescent, ydescent, width, height, fontsize):
+ if self._yoffsets is None:
+ ydata = height * (0.5 * legend._scatteryoffsets + 0.5)
+ else:
+ ydata = height * np.asarray(self._yoffsets)
+
+ return ydata
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ trans):
+ # docstring inherited
+ markerline, stemlines, baseline = orig_handle
+ # Check to see if the stemcontainer is storing lines as a list or a
+ # LineCollection. Eventually using a list will be removed, and this
+ # logic can also be removed.
+ using_linecoll = isinstance(stemlines, mcoll.LineCollection)
+
+ xdata, xdata_marker = self.get_xdata(legend, xdescent, ydescent,
+ width, height, fontsize)
+
+ ydata = self.get_ydata(legend, xdescent, ydescent,
+ width, height, fontsize)
+
+ if self._bottom is None:
+ bottom = 0.
+ else:
+ bottom = self._bottom
+
+ leg_markerline = Line2D(xdata_marker, ydata[:len(xdata_marker)])
+ self.update_prop(leg_markerline, markerline, legend)
+
+ leg_stemlines = [Line2D([x, x], [bottom, y])
+ for x, y in zip(xdata_marker, ydata)]
+
+ if using_linecoll:
+ # change the function used by update_prop() from the default
+ # to one that handles LineCollection
+ with cbook._setattr_cm(
+ self, _update_prop_func=self._copy_collection_props):
+ for line in leg_stemlines:
+ self.update_prop(line, stemlines, legend)
+
+ else:
+ for lm, m in zip(leg_stemlines, stemlines):
+ self.update_prop(lm, m, legend)
+
+ leg_baseline = Line2D([np.min(xdata), np.max(xdata)],
+ [bottom, bottom])
+ self.update_prop(leg_baseline, baseline, legend)
+
+ artists = [*leg_stemlines, leg_baseline, leg_markerline]
+ for artist in artists:
+ artist.set_transform(trans)
+ return artists
+
+ def _copy_collection_props(self, legend_handle, orig_handle):
+ """
+ Copy properties from the `.LineCollection` *orig_handle* to the
+ `.Line2D` *legend_handle*.
+ """
+ legend_handle.set_color(orig_handle.get_color()[0])
+ legend_handle.set_linestyle(orig_handle.get_linestyle()[0])
+
+
+class HandlerTuple(HandlerBase):
+ """
+ Handler for Tuple.
+ """
+
+ def __init__(self, ndivide=1, pad=None, **kwargs):
+ """
+ Parameters
+ ----------
+ ndivide : int or None, default: 1
+ The number of sections to divide the legend area into. If None,
+ use the length of the input tuple.
+ pad : float, default: :rc:`legend.borderpad`
+ Padding in units of fraction of font size.
+ **kwargs
+ Keyword arguments forwarded to `.HandlerBase`.
+ """
+ self._ndivide = ndivide
+ self._pad = pad
+ super().__init__(**kwargs)
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize,
+ trans):
+ # docstring inherited
+ handler_map = legend.get_legend_handler_map()
+
+ if self._ndivide is None:
+ ndivide = len(orig_handle)
+ else:
+ ndivide = self._ndivide
+
+ if self._pad is None:
+ pad = legend.borderpad * fontsize
+ else:
+ pad = self._pad * fontsize
+
+ if ndivide > 1:
+ width = (width - pad * (ndivide - 1)) / ndivide
+
+ xds_cycle = cycle(xdescent - (width + pad) * np.arange(ndivide))
+
+ a_list = []
+ for handle1 in orig_handle:
+ handler = legend.get_legend_handler(handler_map, handle1)
+ _a_list = handler.create_artists(
+ legend, handle1,
+ next(xds_cycle), ydescent, width, height, fontsize, trans)
+ a_list.extend(_a_list)
+
+ return a_list
+
+
+class HandlerPolyCollection(HandlerBase):
+ """
+ Handler for `.PolyCollection` used in `~.Axes.fill_between` and
+ `~.Axes.stackplot`.
+ """
+ def _update_prop(self, legend_handle, orig_handle):
+ def first_color(colors):
+ if colors.size == 0:
+ return (0, 0, 0, 0)
+ return tuple(colors[0])
+
+ def get_first(prop_array):
+ if len(prop_array):
+ return prop_array[0]
+ else:
+ return None
+
+ # orig_handle is a PolyCollection and legend_handle is a Patch.
+ # Directly set Patch color attributes (must be RGBA tuples).
+ legend_handle._facecolor = first_color(orig_handle.get_facecolor())
+ legend_handle._edgecolor = first_color(orig_handle.get_edgecolor())
+ legend_handle._original_facecolor = orig_handle._original_facecolor
+ legend_handle._original_edgecolor = orig_handle._original_edgecolor
+ legend_handle._fill = orig_handle.get_fill()
+ legend_handle._hatch = orig_handle.get_hatch()
+ # Hatch color is anomalous in having no getters and setters.
+ legend_handle._hatch_color = orig_handle._hatch_color
+ # Setters are fine for the remaining attributes.
+ legend_handle.set_linewidth(get_first(orig_handle.get_linewidths()))
+ legend_handle.set_linestyle(get_first(orig_handle.get_linestyles()))
+ legend_handle.set_transform(get_first(orig_handle.get_transforms()))
+ legend_handle.set_figure(orig_handle.get_figure())
+ # Alpha is already taken into account by the color attributes.
+
+ def create_artists(self, legend, orig_handle,
+ xdescent, ydescent, width, height, fontsize, trans):
+ # docstring inherited
+ p = Rectangle(xy=(-xdescent, -ydescent),
+ width=width, height=height)
+ self.update_prop(p, orig_handle, legend)
+ p.set_transform(trans)
+ return [p]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend_handler.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend_handler.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..db028a136a48ed5fe58f80b56854288564316851
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/legend_handler.pyi
@@ -0,0 +1,294 @@
+from collections.abc import Callable, Sequence
+from matplotlib.artist import Artist
+from matplotlib.legend import Legend
+from matplotlib.offsetbox import OffsetBox
+from matplotlib.transforms import Transform
+
+from typing import TypeVar
+
+from numpy.typing import ArrayLike
+
+def update_from_first_child(tgt: Artist, src: Artist) -> None: ...
+
+class HandlerBase:
+ def __init__(
+ self,
+ xpad: float = ...,
+ ypad: float = ...,
+ update_func: Callable[[Artist, Artist], None] | None = ...,
+ ) -> None: ...
+ def update_prop(
+ self, legend_handle: Artist, orig_handle: Artist, legend: Legend
+ ) -> None: ...
+ def adjust_drawing_area(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ ) -> tuple[float, float, float, float]: ...
+ def legend_artist(
+ self, legend: Legend, orig_handle: Artist, fontsize: float, handlebox: OffsetBox
+ ) -> Artist: ...
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerNpoints(HandlerBase):
+ def __init__(
+ self, marker_pad: float = ..., numpoints: int | None = ..., **kwargs
+ ) -> None: ...
+ def get_numpoints(self, legend: Legend) -> int | None: ...
+ def get_xdata(
+ self,
+ legend: Legend,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ ) -> tuple[ArrayLike, ArrayLike]: ...
+
+class HandlerNpointsYoffsets(HandlerNpoints):
+ def __init__(
+ self,
+ numpoints: int | None = ...,
+ yoffsets: Sequence[float] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_ydata(
+ self,
+ legend: Legend,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ ) -> ArrayLike: ...
+
+class HandlerLine2DCompound(HandlerNpoints):
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerLine2D(HandlerNpoints):
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerPatch(HandlerBase):
+ def __init__(self, patch_func: Callable | None = ..., **kwargs) -> None: ...
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerStepPatch(HandlerBase):
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerLineCollection(HandlerLine2D):
+ def get_numpoints(self, legend: Legend) -> int: ...
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+_T = TypeVar("_T", bound=Artist)
+
+class HandlerRegularPolyCollection(HandlerNpointsYoffsets):
+ def __init__(
+ self,
+ yoffsets: Sequence[float] | None = ...,
+ sizes: Sequence[float] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_numpoints(self, legend: Legend) -> int: ...
+ def get_sizes(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ ) -> Sequence[float]: ...
+ def update_prop(
+ self, legend_handle, orig_handle: Artist, legend: Legend
+ ) -> None: ...
+ def create_collection(
+ self,
+ orig_handle: _T,
+ sizes: Sequence[float] | None,
+ offsets: Sequence[float] | None,
+ offset_transform: Transform,
+ ) -> _T: ...
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerPathCollection(HandlerRegularPolyCollection):
+ def create_collection(
+ self,
+ orig_handle: _T,
+ sizes: Sequence[float] | None,
+ offsets: Sequence[float] | None,
+ offset_transform: Transform,
+ ) -> _T: ...
+
+class HandlerCircleCollection(HandlerRegularPolyCollection):
+ def create_collection(
+ self,
+ orig_handle: _T,
+ sizes: Sequence[float] | None,
+ offsets: Sequence[float] | None,
+ offset_transform: Transform,
+ ) -> _T: ...
+
+class HandlerErrorbar(HandlerLine2D):
+ def __init__(
+ self,
+ xerr_size: float = ...,
+ yerr_size: float | None = ...,
+ marker_pad: float = ...,
+ numpoints: int | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_err_size(
+ self,
+ legend: Legend,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ ) -> tuple[float, float]: ...
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerStem(HandlerNpointsYoffsets):
+ def __init__(
+ self,
+ marker_pad: float = ...,
+ numpoints: int | None = ...,
+ bottom: float | None = ...,
+ yoffsets: Sequence[float] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def get_ydata(
+ self,
+ legend: Legend,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ ) -> ArrayLike: ...
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerTuple(HandlerBase):
+ def __init__(
+ self, ndivide: int | None = ..., pad: float | None = ..., **kwargs
+ ) -> None: ...
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
+
+class HandlerPolyCollection(HandlerBase):
+ def create_artists(
+ self,
+ legend: Legend,
+ orig_handle: Artist,
+ xdescent: float,
+ ydescent: float,
+ width: float,
+ height: float,
+ fontsize: float,
+ trans: Transform,
+ ) -> Sequence[Artist]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/lines.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/lines.py
new file mode 100644
index 0000000000000000000000000000000000000000..21dd91b89f49348c0165ef351e6f1494fed549e3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/lines.py
@@ -0,0 +1,1720 @@
+"""
+2D lines with support for a variety of line styles, markers, colors, etc.
+"""
+
+import copy
+
+from numbers import Integral, Number, Real
+import logging
+
+import numpy as np
+
+import matplotlib as mpl
+from . import _api, cbook, colors as mcolors, _docstring
+from .artist import Artist, allow_rasterization
+from .cbook import (
+ _to_unmasked_float_array, ls_mapper, ls_mapper_r, STEP_LOOKUP_MAP)
+from .markers import MarkerStyle
+from .path import Path
+from .transforms import Bbox, BboxTransformTo, TransformedPath
+from ._enums import JoinStyle, CapStyle
+
+# Imported here for backward compatibility, even though they don't
+# really belong.
+from . import _path
+from .markers import ( # noqa
+ CARETLEFT, CARETRIGHT, CARETUP, CARETDOWN,
+ CARETLEFTBASE, CARETRIGHTBASE, CARETUPBASE, CARETDOWNBASE,
+ TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN)
+
+_log = logging.getLogger(__name__)
+
+
+def _get_dash_pattern(style):
+ """Convert linestyle to dash pattern."""
+ # go from short hand -> full strings
+ if isinstance(style, str):
+ style = ls_mapper.get(style, style)
+ # un-dashed styles
+ if style in ['solid', 'None']:
+ offset = 0
+ dashes = None
+ # dashed styles
+ elif style in ['dashed', 'dashdot', 'dotted']:
+ offset = 0
+ dashes = tuple(mpl.rcParams[f'lines.{style}_pattern'])
+ #
+ elif isinstance(style, tuple):
+ offset, dashes = style
+ if offset is None:
+ raise ValueError(f'Unrecognized linestyle: {style!r}')
+ else:
+ raise ValueError(f'Unrecognized linestyle: {style!r}')
+
+ # normalize offset to be positive and shorter than the dash cycle
+ if dashes is not None:
+ dsum = sum(dashes)
+ if dsum:
+ offset %= dsum
+
+ return offset, dashes
+
+
+def _get_dash_patterns(styles):
+ """Convert linestyle or sequence of linestyles to list of dash patterns."""
+ try:
+ patterns = [_get_dash_pattern(styles)]
+ except ValueError:
+ try:
+ patterns = [_get_dash_pattern(x) for x in styles]
+ except ValueError as err:
+ emsg = f'Do not know how to convert {styles!r} to dashes'
+ raise ValueError(emsg) from err
+
+ return patterns
+
+
+def _get_inverse_dash_pattern(offset, dashes):
+ """Return the inverse of the given dash pattern, for filling the gaps."""
+ # Define the inverse pattern by moving the last gap to the start of the
+ # sequence.
+ gaps = dashes[-1:] + dashes[:-1]
+ # Set the offset so that this new first segment is skipped
+ # (see backend_bases.GraphicsContextBase.set_dashes for offset definition).
+ offset_gaps = offset + dashes[-1]
+
+ return offset_gaps, gaps
+
+
+def _scale_dashes(offset, dashes, lw):
+ if not mpl.rcParams['lines.scale_dashes']:
+ return offset, dashes
+ scaled_offset = offset * lw
+ scaled_dashes = ([x * lw if x is not None else None for x in dashes]
+ if dashes is not None else None)
+ return scaled_offset, scaled_dashes
+
+
+def segment_hits(cx, cy, x, y, radius):
+ """
+ Return the indices of the segments in the polyline with coordinates (*cx*,
+ *cy*) that are within a distance *radius* of the point (*x*, *y*).
+ """
+ # Process single points specially
+ if len(x) <= 1:
+ res, = np.nonzero((cx - x) ** 2 + (cy - y) ** 2 <= radius ** 2)
+ return res
+
+ # We need to lop the last element off a lot.
+ xr, yr = x[:-1], y[:-1]
+
+ # Only look at line segments whose nearest point to C on the line
+ # lies within the segment.
+ dx, dy = x[1:] - xr, y[1:] - yr
+ Lnorm_sq = dx ** 2 + dy ** 2 # Possibly want to eliminate Lnorm==0
+ u = ((cx - xr) * dx + (cy - yr) * dy) / Lnorm_sq
+ candidates = (u >= 0) & (u <= 1)
+
+ # Note that there is a little area near one side of each point
+ # which will be near neither segment, and another which will
+ # be near both, depending on the angle of the lines. The
+ # following radius test eliminates these ambiguities.
+ point_hits = (cx - x) ** 2 + (cy - y) ** 2 <= radius ** 2
+ candidates = candidates & ~(point_hits[:-1] | point_hits[1:])
+
+ # For those candidates which remain, determine how far they lie away
+ # from the line.
+ px, py = xr + u * dx, yr + u * dy
+ line_hits = (cx - px) ** 2 + (cy - py) ** 2 <= radius ** 2
+ line_hits = line_hits & candidates
+ points, = point_hits.ravel().nonzero()
+ lines, = line_hits.ravel().nonzero()
+ return np.concatenate((points, lines))
+
+
+def _mark_every_path(markevery, tpath, affine, ax):
+ """
+ Helper function that sorts out how to deal the input
+ `markevery` and returns the points where markers should be drawn.
+
+ Takes in the `markevery` value and the line path and returns the
+ sub-sampled path.
+ """
+ # pull out the two bits of data we want from the path
+ codes, verts = tpath.codes, tpath.vertices
+
+ def _slice_or_none(in_v, slc):
+ """Helper function to cope with `codes` being an ndarray or `None`."""
+ if in_v is None:
+ return None
+ return in_v[slc]
+
+ # if just an int, assume starting at 0 and make a tuple
+ if isinstance(markevery, Integral):
+ markevery = (0, markevery)
+ # if just a float, assume starting at 0.0 and make a tuple
+ elif isinstance(markevery, Real):
+ markevery = (0.0, markevery)
+
+ if isinstance(markevery, tuple):
+ if len(markevery) != 2:
+ raise ValueError('`markevery` is a tuple but its len is not 2; '
+ f'markevery={markevery}')
+ start, step = markevery
+ # if step is an int, old behavior
+ if isinstance(step, Integral):
+ # tuple of 2 int is for backwards compatibility,
+ if not isinstance(start, Integral):
+ raise ValueError(
+ '`markevery` is a tuple with len 2 and second element is '
+ 'an int, but the first element is not an int; '
+ f'markevery={markevery}')
+ # just return, we are done here
+
+ return Path(verts[slice(start, None, step)],
+ _slice_or_none(codes, slice(start, None, step)))
+
+ elif isinstance(step, Real):
+ if not isinstance(start, Real):
+ raise ValueError(
+ '`markevery` is a tuple with len 2 and second element is '
+ 'a float, but the first element is not a float or an int; '
+ f'markevery={markevery}')
+ if ax is None:
+ raise ValueError(
+ "markevery is specified relative to the Axes size, but "
+ "the line does not have a Axes as parent")
+
+ # calc cumulative distance along path (in display coords):
+ fin = np.isfinite(verts).all(axis=1)
+ fverts = verts[fin]
+ disp_coords = affine.transform(fverts)
+
+ delta = np.empty((len(disp_coords), 2))
+ delta[0, :] = 0
+ delta[1:, :] = disp_coords[1:, :] - disp_coords[:-1, :]
+ delta = np.hypot(*delta.T).cumsum()
+ # calc distance between markers along path based on the Axes
+ # bounding box diagonal being a distance of unity:
+ (x0, y0), (x1, y1) = ax.transAxes.transform([[0, 0], [1, 1]])
+ scale = np.hypot(x1 - x0, y1 - y0)
+ marker_delta = np.arange(start * scale, delta[-1], step * scale)
+ # find closest actual data point that is closest to
+ # the theoretical distance along the path:
+ inds = np.abs(delta[np.newaxis, :] - marker_delta[:, np.newaxis])
+ inds = inds.argmin(axis=1)
+ inds = np.unique(inds)
+ # return, we are done here
+ return Path(fverts[inds], _slice_or_none(codes, inds))
+ else:
+ raise ValueError(
+ f"markevery={markevery!r} is a tuple with len 2, but its "
+ f"second element is not an int or a float")
+
+ elif isinstance(markevery, slice):
+ # mazol tov, it's already a slice, just return
+ return Path(verts[markevery], _slice_or_none(codes, markevery))
+
+ elif np.iterable(markevery):
+ # fancy indexing
+ try:
+ return Path(verts[markevery], _slice_or_none(codes, markevery))
+ except (ValueError, IndexError) as err:
+ raise ValueError(
+ f"markevery={markevery!r} is iterable but not a valid numpy "
+ f"fancy index") from err
+ else:
+ raise ValueError(f"markevery={markevery!r} is not a recognized value")
+
+
+@_docstring.interpd
+@_api.define_aliases({
+ "antialiased": ["aa"],
+ "color": ["c"],
+ "drawstyle": ["ds"],
+ "linestyle": ["ls"],
+ "linewidth": ["lw"],
+ "markeredgecolor": ["mec"],
+ "markeredgewidth": ["mew"],
+ "markerfacecolor": ["mfc"],
+ "markerfacecoloralt": ["mfcalt"],
+ "markersize": ["ms"],
+})
+class Line2D(Artist):
+ """
+ A line - the line can have both a solid linestyle connecting all
+ the vertices, and a marker at each vertex. Additionally, the
+ drawing of the solid line is influenced by the drawstyle, e.g., one
+ can create "stepped" lines in various styles.
+ """
+
+ lineStyles = _lineStyles = { # hidden names deprecated
+ '-': '_draw_solid',
+ '--': '_draw_dashed',
+ '-.': '_draw_dash_dot',
+ ':': '_draw_dotted',
+ 'None': '_draw_nothing',
+ ' ': '_draw_nothing',
+ '': '_draw_nothing',
+ }
+
+ _drawStyles_l = {
+ 'default': '_draw_lines',
+ 'steps-mid': '_draw_steps_mid',
+ 'steps-pre': '_draw_steps_pre',
+ 'steps-post': '_draw_steps_post',
+ }
+
+ _drawStyles_s = {
+ 'steps': '_draw_steps_pre',
+ }
+
+ # drawStyles should now be deprecated.
+ drawStyles = {**_drawStyles_l, **_drawStyles_s}
+ # Need a list ordered with long names first:
+ drawStyleKeys = [*_drawStyles_l, *_drawStyles_s]
+
+ # Referenced here to maintain API. These are defined in
+ # MarkerStyle
+ markers = MarkerStyle.markers
+ filled_markers = MarkerStyle.filled_markers
+ fillStyles = MarkerStyle.fillstyles
+
+ zorder = 2
+
+ _subslice_optim_min_size = 1000
+
+ def __str__(self):
+ if self._label != "":
+ return f"Line2D({self._label})"
+ elif self._x is None:
+ return "Line2D()"
+ elif len(self._x) > 3:
+ return "Line2D(({:g},{:g}),({:g},{:g}),...,({:g},{:g}))".format(
+ self._x[0], self._y[0],
+ self._x[1], self._y[1],
+ self._x[-1], self._y[-1])
+ else:
+ return "Line2D(%s)" % ",".join(
+ map("({:g},{:g})".format, self._x, self._y))
+
+ def __init__(self, xdata, ydata, *,
+ linewidth=None, # all Nones default to rc
+ linestyle=None,
+ color=None,
+ gapcolor=None,
+ marker=None,
+ markersize=None,
+ markeredgewidth=None,
+ markeredgecolor=None,
+ markerfacecolor=None,
+ markerfacecoloralt='none',
+ fillstyle=None,
+ antialiased=None,
+ dash_capstyle=None,
+ solid_capstyle=None,
+ dash_joinstyle=None,
+ solid_joinstyle=None,
+ pickradius=5,
+ drawstyle=None,
+ markevery=None,
+ **kwargs
+ ):
+ """
+ Create a `.Line2D` instance with *x* and *y* data in sequences of
+ *xdata*, *ydata*.
+
+ Additional keyword arguments are `.Line2D` properties:
+
+ %(Line2D:kwdoc)s
+
+ See :meth:`set_linestyle` for a description of the line styles,
+ :meth:`set_marker` for a description of the markers, and
+ :meth:`set_drawstyle` for a description of the draw styles.
+
+ """
+ super().__init__()
+
+ # Convert sequences to NumPy arrays.
+ if not np.iterable(xdata):
+ raise RuntimeError('xdata must be a sequence')
+ if not np.iterable(ydata):
+ raise RuntimeError('ydata must be a sequence')
+
+ if linewidth is None:
+ linewidth = mpl.rcParams['lines.linewidth']
+
+ if linestyle is None:
+ linestyle = mpl.rcParams['lines.linestyle']
+ if marker is None:
+ marker = mpl.rcParams['lines.marker']
+ if color is None:
+ color = mpl.rcParams['lines.color']
+
+ if markersize is None:
+ markersize = mpl.rcParams['lines.markersize']
+ if antialiased is None:
+ antialiased = mpl.rcParams['lines.antialiased']
+ if dash_capstyle is None:
+ dash_capstyle = mpl.rcParams['lines.dash_capstyle']
+ if dash_joinstyle is None:
+ dash_joinstyle = mpl.rcParams['lines.dash_joinstyle']
+ if solid_capstyle is None:
+ solid_capstyle = mpl.rcParams['lines.solid_capstyle']
+ if solid_joinstyle is None:
+ solid_joinstyle = mpl.rcParams['lines.solid_joinstyle']
+
+ if drawstyle is None:
+ drawstyle = 'default'
+
+ self._dashcapstyle = None
+ self._dashjoinstyle = None
+ self._solidjoinstyle = None
+ self._solidcapstyle = None
+ self.set_dash_capstyle(dash_capstyle)
+ self.set_dash_joinstyle(dash_joinstyle)
+ self.set_solid_capstyle(solid_capstyle)
+ self.set_solid_joinstyle(solid_joinstyle)
+
+ self._linestyles = None
+ self._drawstyle = None
+ self._linewidth = linewidth
+ self._unscaled_dash_pattern = (0, None) # offset, dash
+ self._dash_pattern = (0, None) # offset, dash (scaled by linewidth)
+
+ self.set_linewidth(linewidth)
+ self.set_linestyle(linestyle)
+ self.set_drawstyle(drawstyle)
+
+ self._color = None
+ self.set_color(color)
+ if marker is None:
+ marker = 'none' # Default.
+ if not isinstance(marker, MarkerStyle):
+ self._marker = MarkerStyle(marker, fillstyle)
+ else:
+ self._marker = marker
+
+ self._gapcolor = None
+ self.set_gapcolor(gapcolor)
+
+ self._markevery = None
+ self._markersize = None
+ self._antialiased = None
+
+ self.set_markevery(markevery)
+ self.set_antialiased(antialiased)
+ self.set_markersize(markersize)
+
+ self._markeredgecolor = None
+ self._markeredgewidth = None
+ self._markerfacecolor = None
+ self._markerfacecoloralt = None
+
+ self.set_markerfacecolor(markerfacecolor) # Normalizes None to rc.
+ self.set_markerfacecoloralt(markerfacecoloralt)
+ self.set_markeredgecolor(markeredgecolor) # Normalizes None to rc.
+ self.set_markeredgewidth(markeredgewidth)
+
+ # update kwargs before updating data to give the caller a
+ # chance to init axes (and hence unit support)
+ self._internal_update(kwargs)
+ self.pickradius = pickradius
+ self.ind_offset = 0
+ if (isinstance(self._picker, Number) and
+ not isinstance(self._picker, bool)):
+ self._pickradius = self._picker
+
+ self._xorig = np.asarray([])
+ self._yorig = np.asarray([])
+ self._invalidx = True
+ self._invalidy = True
+ self._x = None
+ self._y = None
+ self._xy = None
+ self._path = None
+ self._transformed_path = None
+ self._subslice = False
+ self._x_filled = None # used in subslicing; only x is needed
+
+ self.set_data(xdata, ydata)
+
+ def contains(self, mouseevent):
+ """
+ Test whether *mouseevent* occurred on the line.
+
+ An event is deemed to have occurred "on" the line if it is less
+ than ``self.pickradius`` (default: 5 points) away from it. Use
+ `~.Line2D.get_pickradius` or `~.Line2D.set_pickradius` to get or set
+ the pick radius.
+
+ Parameters
+ ----------
+ mouseevent : `~matplotlib.backend_bases.MouseEvent`
+
+ Returns
+ -------
+ contains : bool
+ Whether any values are within the radius.
+ details : dict
+ A dictionary ``{'ind': pointlist}``, where *pointlist* is a
+ list of points of the line that are within the pickradius around
+ the event position.
+
+ TODO: sort returned indices by distance
+ """
+ if self._different_canvas(mouseevent):
+ return False, {}
+
+ # Make sure we have data to plot
+ if self._invalidy or self._invalidx:
+ self.recache()
+ if len(self._xy) == 0:
+ return False, {}
+
+ # Convert points to pixels
+ transformed_path = self._get_transformed_path()
+ path, affine = transformed_path.get_transformed_path_and_affine()
+ path = affine.transform_path(path)
+ xy = path.vertices
+ xt = xy[:, 0]
+ yt = xy[:, 1]
+
+ # Convert pick radius from points to pixels
+ fig = self.get_figure(root=True)
+ if fig is None:
+ _log.warning('no figure set when check if mouse is on line')
+ pixels = self._pickradius
+ else:
+ pixels = fig.dpi / 72. * self._pickradius
+
+ # The math involved in checking for containment (here and inside of
+ # segment_hits) assumes that it is OK to overflow, so temporarily set
+ # the error flags accordingly.
+ with np.errstate(all='ignore'):
+ # Check for collision
+ if self._linestyle in ['None', None]:
+ # If no line, return the nearby point(s)
+ ind, = np.nonzero(
+ (xt - mouseevent.x) ** 2 + (yt - mouseevent.y) ** 2
+ <= pixels ** 2)
+ else:
+ # If line, return the nearby segment(s)
+ ind = segment_hits(mouseevent.x, mouseevent.y, xt, yt, pixels)
+ if self._drawstyle.startswith("steps"):
+ ind //= 2
+
+ ind += self.ind_offset
+
+ # Return the point(s) within radius
+ return len(ind) > 0, dict(ind=ind)
+
+ def get_pickradius(self):
+ """
+ Return the pick radius used for containment tests.
+
+ See `.contains` for more details.
+ """
+ return self._pickradius
+
+ def set_pickradius(self, pickradius):
+ """
+ Set the pick radius used for containment tests.
+
+ See `.contains` for more details.
+
+ Parameters
+ ----------
+ pickradius : float
+ Pick radius, in points.
+ """
+ if not isinstance(pickradius, Real) or pickradius < 0:
+ raise ValueError("pick radius should be a distance")
+ self._pickradius = pickradius
+
+ pickradius = property(get_pickradius, set_pickradius)
+
+ def get_fillstyle(self):
+ """
+ Return the marker fill style.
+
+ See also `~.Line2D.set_fillstyle`.
+ """
+ return self._marker.get_fillstyle()
+
+ def set_fillstyle(self, fs):
+ """
+ Set the marker fill style.
+
+ Parameters
+ ----------
+ fs : {'full', 'left', 'right', 'bottom', 'top', 'none'}
+ Possible values:
+
+ - 'full': Fill the whole marker with the *markerfacecolor*.
+ - 'left', 'right', 'bottom', 'top': Fill the marker half at
+ the given side with the *markerfacecolor*. The other
+ half of the marker is filled with *markerfacecoloralt*.
+ - 'none': No filling.
+
+ For examples see :ref:`marker_fill_styles`.
+ """
+ self.set_marker(MarkerStyle(self._marker.get_marker(), fs))
+ self.stale = True
+
+ def set_markevery(self, every):
+ """
+ Set the markevery property to subsample the plot when using markers.
+
+ e.g., if ``every=5``, every 5-th marker will be plotted.
+
+ Parameters
+ ----------
+ every : None or int or (int, int) or slice or list[int] or float or \
+(float, float) or list[bool]
+ Which markers to plot.
+
+ - ``every=None``: every point will be plotted.
+ - ``every=N``: every N-th marker will be plotted starting with
+ marker 0.
+ - ``every=(start, N)``: every N-th marker, starting at index
+ *start*, will be plotted.
+ - ``every=slice(start, end, N)``: every N-th marker, starting at
+ index *start*, up to but not including index *end*, will be
+ plotted.
+ - ``every=[i, j, m, ...]``: only markers at the given indices
+ will be plotted.
+ - ``every=[True, False, True, ...]``: only positions that are True
+ will be plotted. The list must have the same length as the data
+ points.
+ - ``every=0.1``, (i.e. a float): markers will be spaced at
+ approximately equal visual distances along the line; the distance
+ along the line between markers is determined by multiplying the
+ display-coordinate distance of the Axes bounding-box diagonal
+ by the value of *every*.
+ - ``every=(0.5, 0.1)`` (i.e. a length-2 tuple of float): similar
+ to ``every=0.1`` but the first marker will be offset along the
+ line by 0.5 multiplied by the
+ display-coordinate-diagonal-distance along the line.
+
+ For examples see
+ :doc:`/gallery/lines_bars_and_markers/markevery_demo`.
+
+ Notes
+ -----
+ Setting *markevery* will still only draw markers at actual data points.
+ While the float argument form aims for uniform visual spacing, it has
+ to coerce from the ideal spacing to the nearest available data point.
+ Depending on the number and distribution of data points, the result
+ may still not look evenly spaced.
+
+ When using a start offset to specify the first marker, the offset will
+ be from the first data point which may be different from the first
+ the visible data point if the plot is zoomed in.
+
+ If zooming in on a plot when using float arguments then the actual
+ data points that have markers will change because the distance between
+ markers is always determined from the display-coordinates
+ axes-bounding-box-diagonal regardless of the actual axes data limits.
+
+ """
+ self._markevery = every
+ self.stale = True
+
+ def get_markevery(self):
+ """
+ Return the markevery setting for marker subsampling.
+
+ See also `~.Line2D.set_markevery`.
+ """
+ return self._markevery
+
+ def set_picker(self, p):
+ """
+ Set the event picker details for the line.
+
+ Parameters
+ ----------
+ p : float or callable[[Artist, Event], tuple[bool, dict]]
+ If a float, it is used as the pick radius in points.
+ """
+ if not callable(p):
+ self.set_pickradius(p)
+ self._picker = p
+
+ def get_bbox(self):
+ """Get the bounding box of this line."""
+ bbox = Bbox([[0, 0], [0, 0]])
+ bbox.update_from_data_xy(self.get_xydata())
+ return bbox
+
+ def get_window_extent(self, renderer=None):
+ bbox = Bbox([[0, 0], [0, 0]])
+ trans_data_to_xy = self.get_transform().transform
+ bbox.update_from_data_xy(trans_data_to_xy(self.get_xydata()),
+ ignore=True)
+ # correct for marker size, if any
+ if self._marker:
+ ms = (self._markersize / 72.0 * self.get_figure(root=True).dpi) * 0.5
+ bbox = bbox.padded(ms)
+ return bbox
+
+ def set_data(self, *args):
+ """
+ Set the x and y data.
+
+ Parameters
+ ----------
+ *args : (2, N) array or two 1D arrays
+
+ See Also
+ --------
+ set_xdata
+ set_ydata
+ """
+ if len(args) == 1:
+ (x, y), = args
+ else:
+ x, y = args
+
+ self.set_xdata(x)
+ self.set_ydata(y)
+
+ def recache_always(self):
+ self.recache(always=True)
+
+ def recache(self, always=False):
+ if always or self._invalidx:
+ xconv = self.convert_xunits(self._xorig)
+ x = _to_unmasked_float_array(xconv).ravel()
+ else:
+ x = self._x
+ if always or self._invalidy:
+ yconv = self.convert_yunits(self._yorig)
+ y = _to_unmasked_float_array(yconv).ravel()
+ else:
+ y = self._y
+
+ self._xy = np.column_stack(np.broadcast_arrays(x, y)).astype(float)
+ self._x, self._y = self._xy.T # views
+
+ self._subslice = False
+ if (self.axes
+ and len(x) > self._subslice_optim_min_size
+ and _path.is_sorted_and_has_non_nan(x)
+ and self.axes.name == 'rectilinear'
+ and self.axes.get_xscale() == 'linear'
+ and self._markevery is None
+ and self.get_clip_on()
+ and self.get_transform() == self.axes.transData):
+ self._subslice = True
+ nanmask = np.isnan(x)
+ if nanmask.any():
+ self._x_filled = self._x.copy()
+ indices = np.arange(len(x))
+ self._x_filled[nanmask] = np.interp(
+ indices[nanmask], indices[~nanmask], self._x[~nanmask])
+ else:
+ self._x_filled = self._x
+
+ if self._path is not None:
+ interpolation_steps = self._path._interpolation_steps
+ else:
+ interpolation_steps = 1
+ xy = STEP_LOOKUP_MAP[self._drawstyle](*self._xy.T)
+ self._path = Path(np.asarray(xy).T,
+ _interpolation_steps=interpolation_steps)
+ self._transformed_path = None
+ self._invalidx = False
+ self._invalidy = False
+
+ def _transform_path(self, subslice=None):
+ """
+ Put a TransformedPath instance at self._transformed_path;
+ all invalidation of the transform is then handled by the
+ TransformedPath instance.
+ """
+ # Masked arrays are now handled by the Path class itself
+ if subslice is not None:
+ xy = STEP_LOOKUP_MAP[self._drawstyle](*self._xy[subslice, :].T)
+ _path = Path(np.asarray(xy).T,
+ _interpolation_steps=self._path._interpolation_steps)
+ else:
+ _path = self._path
+ self._transformed_path = TransformedPath(_path, self.get_transform())
+
+ def _get_transformed_path(self):
+ """Return this line's `~matplotlib.transforms.TransformedPath`."""
+ if self._transformed_path is None:
+ self._transform_path()
+ return self._transformed_path
+
+ def set_transform(self, t):
+ # docstring inherited
+ self._invalidx = True
+ self._invalidy = True
+ super().set_transform(t)
+
+ @allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+
+ if not self.get_visible():
+ return
+
+ if self._invalidy or self._invalidx:
+ self.recache()
+ self.ind_offset = 0 # Needed for contains() method.
+ if self._subslice and self.axes:
+ x0, x1 = self.axes.get_xbound()
+ i0 = self._x_filled.searchsorted(x0, 'left')
+ i1 = self._x_filled.searchsorted(x1, 'right')
+ subslice = slice(max(i0 - 1, 0), i1 + 1)
+ self.ind_offset = subslice.start
+ self._transform_path(subslice)
+ else:
+ subslice = None
+
+ if self.get_path_effects():
+ from matplotlib.patheffects import PathEffectRenderer
+ renderer = PathEffectRenderer(self.get_path_effects(), renderer)
+
+ renderer.open_group('line2d', self.get_gid())
+ if self._lineStyles[self._linestyle] != '_draw_nothing':
+ tpath, affine = (self._get_transformed_path()
+ .get_transformed_path_and_affine())
+ if len(tpath.vertices):
+ gc = renderer.new_gc()
+ self._set_gc_clip(gc)
+ gc.set_url(self.get_url())
+
+ gc.set_antialiased(self._antialiased)
+ gc.set_linewidth(self._linewidth)
+
+ if self.is_dashed():
+ cap = self._dashcapstyle
+ join = self._dashjoinstyle
+ else:
+ cap = self._solidcapstyle
+ join = self._solidjoinstyle
+ gc.set_joinstyle(join)
+ gc.set_capstyle(cap)
+ gc.set_snap(self.get_snap())
+ if self.get_sketch_params() is not None:
+ gc.set_sketch_params(*self.get_sketch_params())
+
+ # We first draw a path within the gaps if needed.
+ if self.is_dashed() and self._gapcolor is not None:
+ lc_rgba = mcolors.to_rgba(self._gapcolor, self._alpha)
+ gc.set_foreground(lc_rgba, isRGBA=True)
+
+ offset_gaps, gaps = _get_inverse_dash_pattern(
+ *self._dash_pattern)
+
+ gc.set_dashes(offset_gaps, gaps)
+ renderer.draw_path(gc, tpath, affine.frozen())
+
+ lc_rgba = mcolors.to_rgba(self._color, self._alpha)
+ gc.set_foreground(lc_rgba, isRGBA=True)
+
+ gc.set_dashes(*self._dash_pattern)
+ renderer.draw_path(gc, tpath, affine.frozen())
+ gc.restore()
+
+ if self._marker and self._markersize > 0:
+ gc = renderer.new_gc()
+ self._set_gc_clip(gc)
+ gc.set_url(self.get_url())
+ gc.set_linewidth(self._markeredgewidth)
+ gc.set_antialiased(self._antialiased)
+
+ ec_rgba = mcolors.to_rgba(
+ self.get_markeredgecolor(), self._alpha)
+ fc_rgba = mcolors.to_rgba(
+ self._get_markerfacecolor(), self._alpha)
+ fcalt_rgba = mcolors.to_rgba(
+ self._get_markerfacecolor(alt=True), self._alpha)
+ # If the edgecolor is "auto", it is set according to the *line*
+ # color but inherits the alpha value of the *face* color, if any.
+ if (cbook._str_equal(self._markeredgecolor, "auto")
+ and not cbook._str_lower_equal(
+ self.get_markerfacecolor(), "none")):
+ ec_rgba = ec_rgba[:3] + (fc_rgba[3],)
+ gc.set_foreground(ec_rgba, isRGBA=True)
+ if self.get_sketch_params() is not None:
+ scale, length, randomness = self.get_sketch_params()
+ gc.set_sketch_params(scale/2, length/2, 2*randomness)
+
+ marker = self._marker
+
+ # Markers *must* be drawn ignoring the drawstyle (but don't pay the
+ # recaching if drawstyle is already "default").
+ if self.get_drawstyle() != "default":
+ with cbook._setattr_cm(
+ self, _drawstyle="default", _transformed_path=None):
+ self.recache()
+ self._transform_path(subslice)
+ tpath, affine = (self._get_transformed_path()
+ .get_transformed_points_and_affine())
+ else:
+ tpath, affine = (self._get_transformed_path()
+ .get_transformed_points_and_affine())
+
+ if len(tpath.vertices):
+ # subsample the markers if markevery is not None
+ markevery = self.get_markevery()
+ if markevery is not None:
+ subsampled = _mark_every_path(
+ markevery, tpath, affine, self.axes)
+ else:
+ subsampled = tpath
+
+ snap = marker.get_snap_threshold()
+ if isinstance(snap, Real):
+ snap = renderer.points_to_pixels(self._markersize) >= snap
+ gc.set_snap(snap)
+ gc.set_joinstyle(marker.get_joinstyle())
+ gc.set_capstyle(marker.get_capstyle())
+ marker_path = marker.get_path()
+ marker_trans = marker.get_transform()
+ w = renderer.points_to_pixels(self._markersize)
+
+ if cbook._str_equal(marker.get_marker(), ","):
+ gc.set_linewidth(0)
+ else:
+ # Don't scale for pixels, and don't stroke them
+ marker_trans = marker_trans.scale(w)
+ renderer.draw_markers(gc, marker_path, marker_trans,
+ subsampled, affine.frozen(),
+ fc_rgba)
+
+ alt_marker_path = marker.get_alt_path()
+ if alt_marker_path:
+ alt_marker_trans = marker.get_alt_transform()
+ alt_marker_trans = alt_marker_trans.scale(w)
+ renderer.draw_markers(
+ gc, alt_marker_path, alt_marker_trans, subsampled,
+ affine.frozen(), fcalt_rgba)
+
+ gc.restore()
+
+ renderer.close_group('line2d')
+ self.stale = False
+
+ def get_antialiased(self):
+ """Return whether antialiased rendering is used."""
+ return self._antialiased
+
+ def get_color(self):
+ """
+ Return the line color.
+
+ See also `~.Line2D.set_color`.
+ """
+ return self._color
+
+ def get_drawstyle(self):
+ """
+ Return the drawstyle.
+
+ See also `~.Line2D.set_drawstyle`.
+ """
+ return self._drawstyle
+
+ def get_gapcolor(self):
+ """
+ Return the line gapcolor.
+
+ See also `~.Line2D.set_gapcolor`.
+ """
+ return self._gapcolor
+
+ def get_linestyle(self):
+ """
+ Return the linestyle.
+
+ See also `~.Line2D.set_linestyle`.
+ """
+ return self._linestyle
+
+ def get_linewidth(self):
+ """
+ Return the linewidth in points.
+
+ See also `~.Line2D.set_linewidth`.
+ """
+ return self._linewidth
+
+ def get_marker(self):
+ """
+ Return the line marker.
+
+ See also `~.Line2D.set_marker`.
+ """
+ return self._marker.get_marker()
+
+ def get_markeredgecolor(self):
+ """
+ Return the marker edge color.
+
+ See also `~.Line2D.set_markeredgecolor`.
+ """
+ mec = self._markeredgecolor
+ if cbook._str_equal(mec, 'auto'):
+ if mpl.rcParams['_internal.classic_mode']:
+ if self._marker.get_marker() in ('.', ','):
+ return self._color
+ if (self._marker.is_filled()
+ and self._marker.get_fillstyle() != 'none'):
+ return 'k' # Bad hard-wired default...
+ return self._color
+ else:
+ return mec
+
+ def get_markeredgewidth(self):
+ """
+ Return the marker edge width in points.
+
+ See also `~.Line2D.set_markeredgewidth`.
+ """
+ return self._markeredgewidth
+
+ def _get_markerfacecolor(self, alt=False):
+ if self._marker.get_fillstyle() == 'none':
+ return 'none'
+ fc = self._markerfacecoloralt if alt else self._markerfacecolor
+ if cbook._str_lower_equal(fc, 'auto'):
+ return self._color
+ else:
+ return fc
+
+ def get_markerfacecolor(self):
+ """
+ Return the marker face color.
+
+ See also `~.Line2D.set_markerfacecolor`.
+ """
+ return self._get_markerfacecolor(alt=False)
+
+ def get_markerfacecoloralt(self):
+ """
+ Return the alternate marker face color.
+
+ See also `~.Line2D.set_markerfacecoloralt`.
+ """
+ return self._get_markerfacecolor(alt=True)
+
+ def get_markersize(self):
+ """
+ Return the marker size in points.
+
+ See also `~.Line2D.set_markersize`.
+ """
+ return self._markersize
+
+ def get_data(self, orig=True):
+ """
+ Return the line data as an ``(xdata, ydata)`` pair.
+
+ If *orig* is *True*, return the original data.
+ """
+ return self.get_xdata(orig=orig), self.get_ydata(orig=orig)
+
+ def get_xdata(self, orig=True):
+ """
+ Return the xdata.
+
+ If *orig* is *True*, return the original data, else the
+ processed data.
+ """
+ if orig:
+ return self._xorig
+ if self._invalidx:
+ self.recache()
+ return self._x
+
+ def get_ydata(self, orig=True):
+ """
+ Return the ydata.
+
+ If *orig* is *True*, return the original data, else the
+ processed data.
+ """
+ if orig:
+ return self._yorig
+ if self._invalidy:
+ self.recache()
+ return self._y
+
+ def get_path(self):
+ """Return the `~matplotlib.path.Path` associated with this line."""
+ if self._invalidy or self._invalidx:
+ self.recache()
+ return self._path
+
+ def get_xydata(self):
+ """Return the *xy* data as a (N, 2) array."""
+ if self._invalidy or self._invalidx:
+ self.recache()
+ return self._xy
+
+ def set_antialiased(self, b):
+ """
+ Set whether to use antialiased rendering.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ if self._antialiased != b:
+ self.stale = True
+ self._antialiased = b
+
+ def set_color(self, color):
+ """
+ Set the color of the line.
+
+ Parameters
+ ----------
+ color : :mpltype:`color`
+ """
+ mcolors._check_color_like(color=color)
+ self._color = color
+ self.stale = True
+
+ def set_drawstyle(self, drawstyle):
+ """
+ Set the drawstyle of the plot.
+
+ The drawstyle determines how the points are connected.
+
+ Parameters
+ ----------
+ drawstyle : {'default', 'steps', 'steps-pre', 'steps-mid', \
+'steps-post'}, default: 'default'
+ For 'default', the points are connected with straight lines.
+
+ The steps variants connect the points with step-like lines,
+ i.e. horizontal lines with vertical steps. They differ in the
+ location of the step:
+
+ - 'steps-pre': The step is at the beginning of the line segment,
+ i.e. the line will be at the y-value of point to the right.
+ - 'steps-mid': The step is halfway between the points.
+ - 'steps-post: The step is at the end of the line segment,
+ i.e. the line will be at the y-value of the point to the left.
+ - 'steps' is equal to 'steps-pre' and is maintained for
+ backward-compatibility.
+
+ For examples see :doc:`/gallery/lines_bars_and_markers/step_demo`.
+ """
+ if drawstyle is None:
+ drawstyle = 'default'
+ _api.check_in_list(self.drawStyles, drawstyle=drawstyle)
+ if self._drawstyle != drawstyle:
+ self.stale = True
+ # invalidate to trigger a recache of the path
+ self._invalidx = True
+ self._drawstyle = drawstyle
+
+ def set_gapcolor(self, gapcolor):
+ """
+ Set a color to fill the gaps in the dashed line style.
+
+ .. note::
+
+ Striped lines are created by drawing two interleaved dashed lines.
+ There can be overlaps between those two, which may result in
+ artifacts when using transparency.
+
+ This functionality is experimental and may change.
+
+ Parameters
+ ----------
+ gapcolor : :mpltype:`color` or None
+ The color with which to fill the gaps. If None, the gaps are
+ unfilled.
+ """
+ if gapcolor is not None:
+ mcolors._check_color_like(color=gapcolor)
+ self._gapcolor = gapcolor
+ self.stale = True
+
+ def set_linewidth(self, w):
+ """
+ Set the line width in points.
+
+ Parameters
+ ----------
+ w : float
+ Line width, in points.
+ """
+ w = float(w)
+ if self._linewidth != w:
+ self.stale = True
+ self._linewidth = w
+ self._dash_pattern = _scale_dashes(*self._unscaled_dash_pattern, w)
+
+ def set_linestyle(self, ls):
+ """
+ Set the linestyle of the line.
+
+ Parameters
+ ----------
+ ls : {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
+ Possible values:
+
+ - A string:
+
+ ========================================== =================
+ linestyle description
+ ========================================== =================
+ ``'-'`` or ``'solid'`` solid line
+ ``'--'`` or ``'dashed'`` dashed line
+ ``'-.'`` or ``'dashdot'`` dash-dotted line
+ ``':'`` or ``'dotted'`` dotted line
+ ``'none'``, ``'None'``, ``' '``, or ``''`` draw nothing
+ ========================================== =================
+
+ - Alternatively a dash tuple of the following form can be
+ provided::
+
+ (offset, onoffseq)
+
+ where ``onoffseq`` is an even length tuple of on and off ink
+ in points. See also :meth:`set_dashes`.
+
+ For examples see :doc:`/gallery/lines_bars_and_markers/linestyles`.
+ """
+ if isinstance(ls, str):
+ if ls in [' ', '', 'none']:
+ ls = 'None'
+ _api.check_in_list([*self._lineStyles, *ls_mapper_r], ls=ls)
+ if ls not in self._lineStyles:
+ ls = ls_mapper_r[ls]
+ self._linestyle = ls
+ else:
+ self._linestyle = '--'
+ self._unscaled_dash_pattern = _get_dash_pattern(ls)
+ self._dash_pattern = _scale_dashes(
+ *self._unscaled_dash_pattern, self._linewidth)
+ self.stale = True
+
+ @_docstring.interpd
+ def set_marker(self, marker):
+ """
+ Set the line marker.
+
+ Parameters
+ ----------
+ marker : marker style string, `~.path.Path` or `~.markers.MarkerStyle`
+ See `~matplotlib.markers` for full description of possible
+ arguments.
+ """
+ self._marker = MarkerStyle(marker, self._marker.get_fillstyle())
+ self.stale = True
+
+ def _set_markercolor(self, name, has_rcdefault, val):
+ if val is None:
+ val = mpl.rcParams[f"lines.{name}"] if has_rcdefault else "auto"
+ attr = f"_{name}"
+ current = getattr(self, attr)
+ if current is None:
+ self.stale = True
+ else:
+ neq = current != val
+ # Much faster than `np.any(current != val)` if no arrays are used.
+ if neq.any() if isinstance(neq, np.ndarray) else neq:
+ self.stale = True
+ setattr(self, attr, val)
+
+ def set_markeredgecolor(self, ec):
+ """
+ Set the marker edge color.
+
+ Parameters
+ ----------
+ ec : :mpltype:`color`
+ """
+ self._set_markercolor("markeredgecolor", True, ec)
+
+ def set_markerfacecolor(self, fc):
+ """
+ Set the marker face color.
+
+ Parameters
+ ----------
+ fc : :mpltype:`color`
+ """
+ self._set_markercolor("markerfacecolor", True, fc)
+
+ def set_markerfacecoloralt(self, fc):
+ """
+ Set the alternate marker face color.
+
+ Parameters
+ ----------
+ fc : :mpltype:`color`
+ """
+ self._set_markercolor("markerfacecoloralt", False, fc)
+
+ def set_markeredgewidth(self, ew):
+ """
+ Set the marker edge width in points.
+
+ Parameters
+ ----------
+ ew : float
+ Marker edge width, in points.
+ """
+ if ew is None:
+ ew = mpl.rcParams['lines.markeredgewidth']
+ if self._markeredgewidth != ew:
+ self.stale = True
+ self._markeredgewidth = ew
+
+ def set_markersize(self, sz):
+ """
+ Set the marker size in points.
+
+ Parameters
+ ----------
+ sz : float
+ Marker size, in points.
+ """
+ sz = float(sz)
+ if self._markersize != sz:
+ self.stale = True
+ self._markersize = sz
+
+ def set_xdata(self, x):
+ """
+ Set the data array for x.
+
+ Parameters
+ ----------
+ x : 1D array
+
+ See Also
+ --------
+ set_data
+ set_ydata
+ """
+ if not np.iterable(x):
+ raise RuntimeError('x must be a sequence')
+ self._xorig = copy.copy(x)
+ self._invalidx = True
+ self.stale = True
+
+ def set_ydata(self, y):
+ """
+ Set the data array for y.
+
+ Parameters
+ ----------
+ y : 1D array
+
+ See Also
+ --------
+ set_data
+ set_xdata
+ """
+ if not np.iterable(y):
+ raise RuntimeError('y must be a sequence')
+ self._yorig = copy.copy(y)
+ self._invalidy = True
+ self.stale = True
+
+ def set_dashes(self, seq):
+ """
+ Set the dash sequence.
+
+ The dash sequence is a sequence of floats of even length describing
+ the length of dashes and spaces in points.
+
+ For example, (5, 2, 1, 2) describes a sequence of 5 point and 1 point
+ dashes separated by 2 point spaces.
+
+ See also `~.Line2D.set_gapcolor`, which allows those spaces to be
+ filled with a color.
+
+ Parameters
+ ----------
+ seq : sequence of floats (on/off ink in points) or (None, None)
+ If *seq* is empty or ``(None, None)``, the linestyle will be set
+ to solid.
+ """
+ if seq == (None, None) or len(seq) == 0:
+ self.set_linestyle('-')
+ else:
+ self.set_linestyle((0, seq))
+
+ def update_from(self, other):
+ """Copy properties from *other* to self."""
+ super().update_from(other)
+ self._linestyle = other._linestyle
+ self._linewidth = other._linewidth
+ self._color = other._color
+ self._gapcolor = other._gapcolor
+ self._markersize = other._markersize
+ self._markerfacecolor = other._markerfacecolor
+ self._markerfacecoloralt = other._markerfacecoloralt
+ self._markeredgecolor = other._markeredgecolor
+ self._markeredgewidth = other._markeredgewidth
+ self._unscaled_dash_pattern = other._unscaled_dash_pattern
+ self._dash_pattern = other._dash_pattern
+ self._dashcapstyle = other._dashcapstyle
+ self._dashjoinstyle = other._dashjoinstyle
+ self._solidcapstyle = other._solidcapstyle
+ self._solidjoinstyle = other._solidjoinstyle
+
+ self._linestyle = other._linestyle
+ self._marker = MarkerStyle(marker=other._marker)
+ self._drawstyle = other._drawstyle
+
+ @_docstring.interpd
+ def set_dash_joinstyle(self, s):
+ """
+ How to join segments of the line if it `~Line2D.is_dashed`.
+
+ The default joinstyle is :rc:`lines.dash_joinstyle`.
+
+ Parameters
+ ----------
+ s : `.JoinStyle` or %(JoinStyle)s
+ """
+ js = JoinStyle(s)
+ if self._dashjoinstyle != js:
+ self.stale = True
+ self._dashjoinstyle = js
+
+ @_docstring.interpd
+ def set_solid_joinstyle(self, s):
+ """
+ How to join segments if the line is solid (not `~Line2D.is_dashed`).
+
+ The default joinstyle is :rc:`lines.solid_joinstyle`.
+
+ Parameters
+ ----------
+ s : `.JoinStyle` or %(JoinStyle)s
+ """
+ js = JoinStyle(s)
+ if self._solidjoinstyle != js:
+ self.stale = True
+ self._solidjoinstyle = js
+
+ def get_dash_joinstyle(self):
+ """
+ Return the `.JoinStyle` for dashed lines.
+
+ See also `~.Line2D.set_dash_joinstyle`.
+ """
+ return self._dashjoinstyle.name
+
+ def get_solid_joinstyle(self):
+ """
+ Return the `.JoinStyle` for solid lines.
+
+ See also `~.Line2D.set_solid_joinstyle`.
+ """
+ return self._solidjoinstyle.name
+
+ @_docstring.interpd
+ def set_dash_capstyle(self, s):
+ """
+ How to draw the end caps if the line is `~Line2D.is_dashed`.
+
+ The default capstyle is :rc:`lines.dash_capstyle`.
+
+ Parameters
+ ----------
+ s : `.CapStyle` or %(CapStyle)s
+ """
+ cs = CapStyle(s)
+ if self._dashcapstyle != cs:
+ self.stale = True
+ self._dashcapstyle = cs
+
+ @_docstring.interpd
+ def set_solid_capstyle(self, s):
+ """
+ How to draw the end caps if the line is solid (not `~Line2D.is_dashed`)
+
+ The default capstyle is :rc:`lines.solid_capstyle`.
+
+ Parameters
+ ----------
+ s : `.CapStyle` or %(CapStyle)s
+ """
+ cs = CapStyle(s)
+ if self._solidcapstyle != cs:
+ self.stale = True
+ self._solidcapstyle = cs
+
+ def get_dash_capstyle(self):
+ """
+ Return the `.CapStyle` for dashed lines.
+
+ See also `~.Line2D.set_dash_capstyle`.
+ """
+ return self._dashcapstyle.name
+
+ def get_solid_capstyle(self):
+ """
+ Return the `.CapStyle` for solid lines.
+
+ See also `~.Line2D.set_solid_capstyle`.
+ """
+ return self._solidcapstyle.name
+
+ def is_dashed(self):
+ """
+ Return whether line has a dashed linestyle.
+
+ A custom linestyle is assumed to be dashed, we do not inspect the
+ ``onoffseq`` directly.
+
+ See also `~.Line2D.set_linestyle`.
+ """
+ return self._linestyle in ('--', '-.', ':')
+
+
+class AxLine(Line2D):
+ """
+ A helper class that implements `~.Axes.axline`, by recomputing the artist
+ transform at draw time.
+ """
+
+ def __init__(self, xy1, xy2, slope, **kwargs):
+ """
+ Parameters
+ ----------
+ xy1 : (float, float)
+ The first set of (x, y) coordinates for the line to pass through.
+ xy2 : (float, float) or None
+ The second set of (x, y) coordinates for the line to pass through.
+ Both *xy2* and *slope* must be passed, but one of them must be None.
+ slope : float or None
+ The slope of the line. Both *xy2* and *slope* must be passed, but one of
+ them must be None.
+ """
+ super().__init__([0, 1], [0, 1], **kwargs)
+
+ if (xy2 is None and slope is None or
+ xy2 is not None and slope is not None):
+ raise TypeError(
+ "Exactly one of 'xy2' and 'slope' must be given")
+
+ self._slope = slope
+ self._xy1 = xy1
+ self._xy2 = xy2
+
+ def get_transform(self):
+ ax = self.axes
+ points_transform = self._transform - ax.transData + ax.transScale
+
+ if self._xy2 is not None:
+ # two points were given
+ (x1, y1), (x2, y2) = \
+ points_transform.transform([self._xy1, self._xy2])
+ dx = x2 - x1
+ dy = y2 - y1
+ if dx == 0:
+ if dy == 0:
+ raise ValueError(
+ f"Cannot draw a line through two identical points "
+ f"(x={(x1, x2)}, y={(y1, y2)})")
+ slope = np.inf
+ else:
+ slope = dy / dx
+ else:
+ # one point and a slope were given
+ x1, y1 = points_transform.transform(self._xy1)
+ slope = self._slope
+ (vxlo, vylo), (vxhi, vyhi) = ax.transScale.transform(ax.viewLim)
+ # General case: find intersections with view limits in either
+ # direction, and draw between the middle two points.
+ if slope == 0:
+ start = vxlo, y1
+ stop = vxhi, y1
+ elif np.isinf(slope):
+ start = x1, vylo
+ stop = x1, vyhi
+ else:
+ _, start, stop, _ = sorted([
+ (vxlo, y1 + (vxlo - x1) * slope),
+ (vxhi, y1 + (vxhi - x1) * slope),
+ (x1 + (vylo - y1) / slope, vylo),
+ (x1 + (vyhi - y1) / slope, vyhi),
+ ])
+ return (BboxTransformTo(Bbox([start, stop]))
+ + ax.transLimits + ax.transAxes)
+
+ def draw(self, renderer):
+ self._transformed_path = None # Force regen.
+ super().draw(renderer)
+
+ def get_xy1(self):
+ """Return the *xy1* value of the line."""
+ return self._xy1
+
+ def get_xy2(self):
+ """Return the *xy2* value of the line."""
+ return self._xy2
+
+ def get_slope(self):
+ """Return the *slope* value of the line."""
+ return self._slope
+
+ def set_xy1(self, *args, **kwargs):
+ """
+ Set the *xy1* value of the line.
+
+ Parameters
+ ----------
+ xy1 : tuple[float, float]
+ Points for the line to pass through.
+ """
+ params = _api.select_matching_signature([
+ lambda self, x, y: locals(), lambda self, xy1: locals(),
+ ], self, *args, **kwargs)
+ if "x" in params:
+ _api.warn_deprecated("3.10", message=(
+ "Passing x and y separately to AxLine.set_xy1 is deprecated since "
+ "%(since)s; pass them as a single tuple instead."))
+ xy1 = params["x"], params["y"]
+ else:
+ xy1 = params["xy1"]
+ self._xy1 = xy1
+
+ def set_xy2(self, *args, **kwargs):
+ """
+ Set the *xy2* value of the line.
+
+ .. note::
+
+ You can only set *xy2* if the line was created using the *xy2*
+ parameter. If the line was created using *slope*, please use
+ `~.AxLine.set_slope`.
+
+ Parameters
+ ----------
+ xy2 : tuple[float, float]
+ Points for the line to pass through.
+ """
+ if self._slope is None:
+ params = _api.select_matching_signature([
+ lambda self, x, y: locals(), lambda self, xy2: locals(),
+ ], self, *args, **kwargs)
+ if "x" in params:
+ _api.warn_deprecated("3.10", message=(
+ "Passing x and y separately to AxLine.set_xy2 is deprecated since "
+ "%(since)s; pass them as a single tuple instead."))
+ xy2 = params["x"], params["y"]
+ else:
+ xy2 = params["xy2"]
+ self._xy2 = xy2
+ else:
+ raise ValueError("Cannot set an 'xy2' value while 'slope' is set;"
+ " they differ but their functionalities overlap")
+
+ def set_slope(self, slope):
+ """
+ Set the *slope* value of the line.
+
+ .. note::
+
+ You can only set *slope* if the line was created using the *slope*
+ parameter. If the line was created using *xy2*, please use
+ `~.AxLine.set_xy2`.
+
+ Parameters
+ ----------
+ slope : float
+ The slope of the line.
+ """
+ if self._xy2 is None:
+ self._slope = slope
+ else:
+ raise ValueError("Cannot set a 'slope' value while 'xy2' is set;"
+ " they differ but their functionalities overlap")
+
+
+class VertexSelector:
+ """
+ Manage the callbacks to maintain a list of selected vertices for `.Line2D`.
+ Derived classes should override the `process_selected` method to do
+ something with the picks.
+
+ Here is an example which highlights the selected verts with red circles::
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+ import matplotlib.lines as lines
+
+ class HighlightSelected(lines.VertexSelector):
+ def __init__(self, line, fmt='ro', **kwargs):
+ super().__init__(line)
+ self.markers, = self.axes.plot([], [], fmt, **kwargs)
+
+ def process_selected(self, ind, xs, ys):
+ self.markers.set_data(xs, ys)
+ self.canvas.draw()
+
+ fig, ax = plt.subplots()
+ x, y = np.random.rand(2, 30)
+ line, = ax.plot(x, y, 'bs-', picker=5)
+
+ selector = HighlightSelected(line)
+ plt.show()
+ """
+
+ def __init__(self, line):
+ """
+ Parameters
+ ----------
+ line : `~matplotlib.lines.Line2D`
+ The line must already have been added to an `~.axes.Axes` and must
+ have its picker property set.
+ """
+ if line.axes is None:
+ raise RuntimeError('You must first add the line to the Axes')
+ if line.get_picker() is None:
+ raise RuntimeError('You must first set the picker property '
+ 'of the line')
+ self.axes = line.axes
+ self.line = line
+ self.cid = self.canvas.callbacks._connect_picklable(
+ 'pick_event', self.onpick)
+ self.ind = set()
+
+ canvas = property(lambda self: self.axes.get_figure(root=True).canvas)
+
+ def process_selected(self, ind, xs, ys):
+ """
+ Default "do nothing" implementation of the `process_selected` method.
+
+ Parameters
+ ----------
+ ind : list of int
+ The indices of the selected vertices.
+ xs, ys : array-like
+ The coordinates of the selected vertices.
+ """
+ pass
+
+ def onpick(self, event):
+ """When the line is picked, update the set of selected indices."""
+ if event.artist is not self.line:
+ return
+ self.ind ^= set(event.ind)
+ ind = sorted(self.ind)
+ xdata, ydata = self.line.get_data()
+ self.process_selected(ind, xdata[ind], ydata[ind])
+
+
+lineStyles = Line2D._lineStyles
+lineMarkers = MarkerStyle.markers
+drawStyles = Line2D.drawStyles
+fillStyles = MarkerStyle.fillstyles
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/lines.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/lines.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..7989a03dae3a0680f63511a0d5347517753a2d1e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/lines.pyi
@@ -0,0 +1,153 @@
+from .artist import Artist
+from .axes import Axes
+from .backend_bases import MouseEvent, FigureCanvasBase
+from .path import Path
+from .transforms import Bbox
+
+from collections.abc import Callable, Sequence
+from typing import Any, Literal, overload
+from .typing import (
+ ColorType,
+ DrawStyleType,
+ FillStyleType,
+ LineStyleType,
+ CapStyleType,
+ JoinStyleType,
+ MarkEveryType,
+ MarkerType,
+)
+from numpy.typing import ArrayLike
+
+def segment_hits(
+ cx: ArrayLike, cy: ArrayLike, x: ArrayLike, y: ArrayLike, radius: ArrayLike
+) -> ArrayLike: ...
+
+class Line2D(Artist):
+ lineStyles: dict[str, str]
+ drawStyles: dict[str, str]
+ drawStyleKeys: list[str]
+ markers: dict[str | int, str]
+ filled_markers: tuple[str, ...]
+ fillStyles: tuple[str, ...]
+ zorder: float
+ ind_offset: float
+ def __init__(
+ self,
+ xdata: ArrayLike,
+ ydata: ArrayLike,
+ *,
+ linewidth: float | None = ...,
+ linestyle: LineStyleType | None = ...,
+ color: ColorType | None = ...,
+ gapcolor: ColorType | None = ...,
+ marker: MarkerType | None = ...,
+ markersize: float | None = ...,
+ markeredgewidth: float | None = ...,
+ markeredgecolor: ColorType | None = ...,
+ markerfacecolor: ColorType | None = ...,
+ markerfacecoloralt: ColorType = ...,
+ fillstyle: FillStyleType | None = ...,
+ antialiased: bool | None = ...,
+ dash_capstyle: CapStyleType | None = ...,
+ solid_capstyle: CapStyleType | None = ...,
+ dash_joinstyle: JoinStyleType | None = ...,
+ solid_joinstyle: JoinStyleType | None = ...,
+ pickradius: float = ...,
+ drawstyle: DrawStyleType | None = ...,
+ markevery: MarkEveryType | None = ...,
+ **kwargs
+ ) -> None: ...
+ def contains(self, mouseevent: MouseEvent) -> tuple[bool, dict]: ...
+ def get_pickradius(self) -> float: ...
+ def set_pickradius(self, pickradius: float) -> None: ...
+ pickradius: float
+ def get_fillstyle(self) -> FillStyleType: ...
+ stale: bool
+ def set_fillstyle(self, fs: FillStyleType) -> None: ...
+ def set_markevery(self, every: MarkEveryType) -> None: ...
+ def get_markevery(self) -> MarkEveryType: ...
+ def set_picker(
+ self, p: None | bool | float | Callable[[Artist, MouseEvent], tuple[bool, dict]]
+ ) -> None: ...
+ def get_bbox(self) -> Bbox: ...
+ @overload
+ def set_data(self, args: ArrayLike) -> None: ...
+ @overload
+ def set_data(self, x: ArrayLike, y: ArrayLike) -> None: ...
+ def recache_always(self) -> None: ...
+ def recache(self, always: bool = ...) -> None: ...
+ def get_antialiased(self) -> bool: ...
+ def get_color(self) -> ColorType: ...
+ def get_drawstyle(self) -> DrawStyleType: ...
+ def get_gapcolor(self) -> ColorType: ...
+ def get_linestyle(self) -> LineStyleType: ...
+ def get_linewidth(self) -> float: ...
+ def get_marker(self) -> MarkerType: ...
+ def get_markeredgecolor(self) -> ColorType: ...
+ def get_markeredgewidth(self) -> float: ...
+ def get_markerfacecolor(self) -> ColorType: ...
+ def get_markerfacecoloralt(self) -> ColorType: ...
+ def get_markersize(self) -> float: ...
+ def get_data(self, orig: bool = ...) -> tuple[ArrayLike, ArrayLike]: ...
+ def get_xdata(self, orig: bool = ...) -> ArrayLike: ...
+ def get_ydata(self, orig: bool = ...) -> ArrayLike: ...
+ def get_path(self) -> Path: ...
+ def get_xydata(self) -> ArrayLike: ...
+ def set_antialiased(self, b: bool) -> None: ...
+ def set_color(self, color: ColorType) -> None: ...
+ def set_drawstyle(self, drawstyle: DrawStyleType | None) -> None: ...
+ def set_gapcolor(self, gapcolor: ColorType | None) -> None: ...
+ def set_linewidth(self, w: float) -> None: ...
+ def set_linestyle(self, ls: LineStyleType) -> None: ...
+ def set_marker(self, marker: MarkerType) -> None: ...
+ def set_markeredgecolor(self, ec: ColorType | None) -> None: ...
+ def set_markerfacecolor(self, fc: ColorType | None) -> None: ...
+ def set_markerfacecoloralt(self, fc: ColorType | None) -> None: ...
+ def set_markeredgewidth(self, ew: float | None) -> None: ...
+ def set_markersize(self, sz: float) -> None: ...
+ def set_xdata(self, x: ArrayLike) -> None: ...
+ def set_ydata(self, y: ArrayLike) -> None: ...
+ def set_dashes(self, seq: Sequence[float] | tuple[None, None]) -> None: ...
+ def update_from(self, other: Artist) -> None: ...
+ def set_dash_joinstyle(self, s: JoinStyleType) -> None: ...
+ def set_solid_joinstyle(self, s: JoinStyleType) -> None: ...
+ def get_dash_joinstyle(self) -> Literal["miter", "round", "bevel"]: ...
+ def get_solid_joinstyle(self) -> Literal["miter", "round", "bevel"]: ...
+ def set_dash_capstyle(self, s: CapStyleType) -> None: ...
+ def set_solid_capstyle(self, s: CapStyleType) -> None: ...
+ def get_dash_capstyle(self) -> Literal["butt", "projecting", "round"]: ...
+ def get_solid_capstyle(self) -> Literal["butt", "projecting", "round"]: ...
+ def is_dashed(self) -> bool: ...
+
+class AxLine(Line2D):
+ def __init__(
+ self,
+ xy1: tuple[float, float],
+ xy2: tuple[float, float] | None,
+ slope: float | None,
+ **kwargs
+ ) -> None: ...
+ def get_xy1(self) -> tuple[float, float] | None: ...
+ def get_xy2(self) -> tuple[float, float] | None: ...
+ def get_slope(self) -> float: ...
+ def set_xy1(self, xy1: tuple[float, float]) -> None: ...
+ def set_xy2(self, xy2: tuple[float, float]) -> None: ...
+ def set_slope(self, slope: float) -> None: ...
+
+class VertexSelector:
+ axes: Axes
+ line: Line2D
+ cid: int
+ ind: set[int]
+ def __init__(self, line: Line2D) -> None: ...
+ @property
+ def canvas(self) -> FigureCanvasBase: ...
+ def process_selected(
+ self, ind: Sequence[int], xs: ArrayLike, ys: ArrayLike
+ ) -> None: ...
+ def onpick(self, event: Any) -> None: ...
+
+lineStyles: dict[str, str]
+lineMarkers: dict[str | int, str]
+drawStyles: dict[str, str]
+fillStyles: tuple[FillStyleType, ...]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/markers.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/markers.py
new file mode 100644
index 0000000000000000000000000000000000000000..fa5e66e73ade4926c518905c0575e6bf99dfcb24
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/markers.py
@@ -0,0 +1,908 @@
+r"""
+Functions to handle markers; used by the marker functionality of
+`~matplotlib.axes.Axes.plot`, `~matplotlib.axes.Axes.scatter`, and
+`~matplotlib.axes.Axes.errorbar`.
+
+All possible markers are defined here:
+
+============================== ====== =========================================
+marker symbol description
+============================== ====== =========================================
+``"."`` |m00| point
+``","`` |m01| pixel
+``"o"`` |m02| circle
+``"v"`` |m03| triangle_down
+``"^"`` |m04| triangle_up
+``"<"`` |m05| triangle_left
+``">"`` |m06| triangle_right
+``"1"`` |m07| tri_down
+``"2"`` |m08| tri_up
+``"3"`` |m09| tri_left
+``"4"`` |m10| tri_right
+``"8"`` |m11| octagon
+``"s"`` |m12| square
+``"p"`` |m13| pentagon
+``"P"`` |m23| plus (filled)
+``"*"`` |m14| star
+``"h"`` |m15| hexagon1
+``"H"`` |m16| hexagon2
+``"+"`` |m17| plus
+``"x"`` |m18| x
+``"X"`` |m24| x (filled)
+``"D"`` |m19| diamond
+``"d"`` |m20| thin_diamond
+``"|"`` |m21| vline
+``"_"`` |m22| hline
+``0`` (``TICKLEFT``) |m25| tickleft
+``1`` (``TICKRIGHT``) |m26| tickright
+``2`` (``TICKUP``) |m27| tickup
+``3`` (``TICKDOWN``) |m28| tickdown
+``4`` (``CARETLEFT``) |m29| caretleft
+``5`` (``CARETRIGHT``) |m30| caretright
+``6`` (``CARETUP``) |m31| caretup
+``7`` (``CARETDOWN``) |m32| caretdown
+``8`` (``CARETLEFTBASE``) |m33| caretleft (centered at base)
+``9`` (``CARETRIGHTBASE``) |m34| caretright (centered at base)
+``10`` (``CARETUPBASE``) |m35| caretup (centered at base)
+``11`` (``CARETDOWNBASE``) |m36| caretdown (centered at base)
+``"none"`` or ``"None"`` nothing
+``" "`` or ``""`` nothing
+``"$...$"`` |m37| Render the string using mathtext.
+ E.g ``"$f$"`` for marker showing the
+ letter ``f``.
+``verts`` A list of (x, y) pairs used for Path
+ vertices. The center of the marker is
+ located at (0, 0) and the size is
+ normalized, such that the created path
+ is encapsulated inside the unit cell.
+``path`` A `~matplotlib.path.Path` instance.
+``(numsides, 0, angle)`` A regular polygon with ``numsides``
+ sides, rotated by ``angle``.
+``(numsides, 1, angle)`` A star-like symbol with ``numsides``
+ sides, rotated by ``angle``.
+``(numsides, 2, angle)`` An asterisk with ``numsides`` sides,
+ rotated by ``angle``.
+============================== ====== =========================================
+
+Note that special symbols can be defined via the
+:ref:`STIX math font `,
+e.g. ``"$\u266B$"``. For an overview over the STIX font symbols refer to the
+`STIX font table `_.
+Also see the :doc:`/gallery/text_labels_and_annotations/stix_fonts_demo`.
+
+Integer numbers from ``0`` to ``11`` create lines and triangles. Those are
+equally accessible via capitalized variables, like ``CARETDOWNBASE``.
+Hence the following are equivalent::
+
+ plt.plot([1, 2, 3], marker=11)
+ plt.plot([1, 2, 3], marker=matplotlib.markers.CARETDOWNBASE)
+
+Markers join and cap styles can be customized by creating a new instance of
+MarkerStyle.
+A MarkerStyle can also have a custom `~matplotlib.transforms.Transform`
+allowing it to be arbitrarily rotated or offset.
+
+Examples showing the use of markers:
+
+* :doc:`/gallery/lines_bars_and_markers/marker_reference`
+* :doc:`/gallery/lines_bars_and_markers/scatter_star_poly`
+* :doc:`/gallery/lines_bars_and_markers/multivariate_marker_plot`
+
+.. |m00| image:: /_static/markers/m00.png
+.. |m01| image:: /_static/markers/m01.png
+.. |m02| image:: /_static/markers/m02.png
+.. |m03| image:: /_static/markers/m03.png
+.. |m04| image:: /_static/markers/m04.png
+.. |m05| image:: /_static/markers/m05.png
+.. |m06| image:: /_static/markers/m06.png
+.. |m07| image:: /_static/markers/m07.png
+.. |m08| image:: /_static/markers/m08.png
+.. |m09| image:: /_static/markers/m09.png
+.. |m10| image:: /_static/markers/m10.png
+.. |m11| image:: /_static/markers/m11.png
+.. |m12| image:: /_static/markers/m12.png
+.. |m13| image:: /_static/markers/m13.png
+.. |m14| image:: /_static/markers/m14.png
+.. |m15| image:: /_static/markers/m15.png
+.. |m16| image:: /_static/markers/m16.png
+.. |m17| image:: /_static/markers/m17.png
+.. |m18| image:: /_static/markers/m18.png
+.. |m19| image:: /_static/markers/m19.png
+.. |m20| image:: /_static/markers/m20.png
+.. |m21| image:: /_static/markers/m21.png
+.. |m22| image:: /_static/markers/m22.png
+.. |m23| image:: /_static/markers/m23.png
+.. |m24| image:: /_static/markers/m24.png
+.. |m25| image:: /_static/markers/m25.png
+.. |m26| image:: /_static/markers/m26.png
+.. |m27| image:: /_static/markers/m27.png
+.. |m28| image:: /_static/markers/m28.png
+.. |m29| image:: /_static/markers/m29.png
+.. |m30| image:: /_static/markers/m30.png
+.. |m31| image:: /_static/markers/m31.png
+.. |m32| image:: /_static/markers/m32.png
+.. |m33| image:: /_static/markers/m33.png
+.. |m34| image:: /_static/markers/m34.png
+.. |m35| image:: /_static/markers/m35.png
+.. |m36| image:: /_static/markers/m36.png
+.. |m37| image:: /_static/markers/m37.png
+"""
+import copy
+
+from collections.abc import Sized
+
+import numpy as np
+
+import matplotlib as mpl
+from . import _api, cbook
+from .path import Path
+from .transforms import IdentityTransform, Affine2D
+from ._enums import JoinStyle, CapStyle
+
+# special-purpose marker identifiers:
+(TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN,
+ CARETLEFT, CARETRIGHT, CARETUP, CARETDOWN,
+ CARETLEFTBASE, CARETRIGHTBASE, CARETUPBASE, CARETDOWNBASE) = range(12)
+
+_empty_path = Path(np.empty((0, 2)))
+
+
+class MarkerStyle:
+ """
+ A class representing marker types.
+
+ Instances are immutable. If you need to change anything, create a new
+ instance.
+
+ Attributes
+ ----------
+ markers : dict
+ All known markers.
+ filled_markers : tuple
+ All known filled markers. This is a subset of *markers*.
+ fillstyles : tuple
+ The supported fillstyles.
+ """
+
+ markers = {
+ '.': 'point',
+ ',': 'pixel',
+ 'o': 'circle',
+ 'v': 'triangle_down',
+ '^': 'triangle_up',
+ '<': 'triangle_left',
+ '>': 'triangle_right',
+ '1': 'tri_down',
+ '2': 'tri_up',
+ '3': 'tri_left',
+ '4': 'tri_right',
+ '8': 'octagon',
+ 's': 'square',
+ 'p': 'pentagon',
+ '*': 'star',
+ 'h': 'hexagon1',
+ 'H': 'hexagon2',
+ '+': 'plus',
+ 'x': 'x',
+ 'D': 'diamond',
+ 'd': 'thin_diamond',
+ '|': 'vline',
+ '_': 'hline',
+ 'P': 'plus_filled',
+ 'X': 'x_filled',
+ TICKLEFT: 'tickleft',
+ TICKRIGHT: 'tickright',
+ TICKUP: 'tickup',
+ TICKDOWN: 'tickdown',
+ CARETLEFT: 'caretleft',
+ CARETRIGHT: 'caretright',
+ CARETUP: 'caretup',
+ CARETDOWN: 'caretdown',
+ CARETLEFTBASE: 'caretleftbase',
+ CARETRIGHTBASE: 'caretrightbase',
+ CARETUPBASE: 'caretupbase',
+ CARETDOWNBASE: 'caretdownbase',
+ "None": 'nothing',
+ "none": 'nothing',
+ ' ': 'nothing',
+ '': 'nothing'
+ }
+
+ # Just used for informational purposes. is_filled()
+ # is calculated in the _set_* functions.
+ filled_markers = (
+ '.', 'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd',
+ 'P', 'X')
+
+ fillstyles = ('full', 'left', 'right', 'bottom', 'top', 'none')
+ _half_fillstyles = ('left', 'right', 'bottom', 'top')
+
+ def __init__(self, marker,
+ fillstyle=None, transform=None, capstyle=None, joinstyle=None):
+ """
+ Parameters
+ ----------
+ marker : str, array-like, Path, MarkerStyle
+ - Another instance of `MarkerStyle` copies the details of that *marker*.
+ - For other possible marker values, see the module docstring
+ `matplotlib.markers`.
+
+ fillstyle : str, default: :rc:`markers.fillstyle`
+ One of 'full', 'left', 'right', 'bottom', 'top', 'none'.
+
+ transform : `~matplotlib.transforms.Transform`, optional
+ Transform that will be combined with the native transform of the
+ marker.
+
+ capstyle : `.CapStyle` or %(CapStyle)s, optional
+ Cap style that will override the default cap style of the marker.
+
+ joinstyle : `.JoinStyle` or %(JoinStyle)s, optional
+ Join style that will override the default join style of the marker.
+ """
+ self._marker_function = None
+ self._user_transform = transform
+ self._user_capstyle = CapStyle(capstyle) if capstyle is not None else None
+ self._user_joinstyle = JoinStyle(joinstyle) if joinstyle is not None else None
+ self._set_fillstyle(fillstyle)
+ self._set_marker(marker)
+
+ def _recache(self):
+ if self._marker_function is None:
+ return
+ self._path = _empty_path
+ self._transform = IdentityTransform()
+ self._alt_path = None
+ self._alt_transform = None
+ self._snap_threshold = None
+ self._joinstyle = JoinStyle.round
+ self._capstyle = self._user_capstyle or CapStyle.butt
+ # Initial guess: Assume the marker is filled unless the fillstyle is
+ # set to 'none'. The marker function will override this for unfilled
+ # markers.
+ self._filled = self._fillstyle != 'none'
+ self._marker_function()
+
+ def __bool__(self):
+ return bool(len(self._path.vertices))
+
+ def is_filled(self):
+ return self._filled
+
+ def get_fillstyle(self):
+ return self._fillstyle
+
+ def _set_fillstyle(self, fillstyle):
+ """
+ Set the fillstyle.
+
+ Parameters
+ ----------
+ fillstyle : {'full', 'left', 'right', 'bottom', 'top', 'none'}
+ The part of the marker surface that is colored with
+ markerfacecolor.
+ """
+ if fillstyle is None:
+ fillstyle = mpl.rcParams['markers.fillstyle']
+ _api.check_in_list(self.fillstyles, fillstyle=fillstyle)
+ self._fillstyle = fillstyle
+
+ def get_joinstyle(self):
+ return self._joinstyle.name
+
+ def get_capstyle(self):
+ return self._capstyle.name
+
+ def get_marker(self):
+ return self._marker
+
+ def _set_marker(self, marker):
+ """
+ Set the marker.
+
+ Parameters
+ ----------
+ marker : str, array-like, Path, MarkerStyle
+ - Another instance of `MarkerStyle` copies the details of that *marker*.
+ - For other possible marker values see the module docstring
+ `matplotlib.markers`.
+ """
+ if isinstance(marker, str) and cbook.is_math_text(marker):
+ self._marker_function = self._set_mathtext_path
+ elif isinstance(marker, (int, str)) and marker in self.markers:
+ self._marker_function = getattr(self, '_set_' + self.markers[marker])
+ elif (isinstance(marker, np.ndarray) and marker.ndim == 2 and
+ marker.shape[1] == 2):
+ self._marker_function = self._set_vertices
+ elif isinstance(marker, Path):
+ self._marker_function = self._set_path_marker
+ elif (isinstance(marker, Sized) and len(marker) in (2, 3) and
+ marker[1] in (0, 1, 2)):
+ self._marker_function = self._set_tuple_marker
+ elif isinstance(marker, MarkerStyle):
+ self.__dict__ = copy.deepcopy(marker.__dict__)
+ else:
+ try:
+ Path(marker)
+ self._marker_function = self._set_vertices
+ except ValueError as err:
+ raise ValueError(
+ f'Unrecognized marker style {marker!r}') from err
+
+ if not isinstance(marker, MarkerStyle):
+ self._marker = marker
+ self._recache()
+
+ def get_path(self):
+ """
+ Return a `.Path` for the primary part of the marker.
+
+ For unfilled markers this is the whole marker, for filled markers,
+ this is the area to be drawn with *markerfacecolor*.
+ """
+ return self._path
+
+ def get_transform(self):
+ """
+ Return the transform to be applied to the `.Path` from
+ `MarkerStyle.get_path()`.
+ """
+ if self._user_transform is None:
+ return self._transform.frozen()
+ else:
+ return (self._transform + self._user_transform).frozen()
+
+ def get_alt_path(self):
+ """
+ Return a `.Path` for the alternate part of the marker.
+
+ For unfilled markers, this is *None*; for filled markers, this is the
+ area to be drawn with *markerfacecoloralt*.
+ """
+ return self._alt_path
+
+ def get_alt_transform(self):
+ """
+ Return the transform to be applied to the `.Path` from
+ `MarkerStyle.get_alt_path()`.
+ """
+ if self._user_transform is None:
+ return self._alt_transform.frozen()
+ else:
+ return (self._alt_transform + self._user_transform).frozen()
+
+ def get_snap_threshold(self):
+ return self._snap_threshold
+
+ def get_user_transform(self):
+ """Return user supplied part of marker transform."""
+ if self._user_transform is not None:
+ return self._user_transform.frozen()
+
+ def transformed(self, transform):
+ """
+ Return a new version of this marker with the transform applied.
+
+ Parameters
+ ----------
+ transform : `~matplotlib.transforms.Affine2D`
+ Transform will be combined with current user supplied transform.
+ """
+ new_marker = MarkerStyle(self)
+ if new_marker._user_transform is not None:
+ new_marker._user_transform += transform
+ else:
+ new_marker._user_transform = transform
+ return new_marker
+
+ def rotated(self, *, deg=None, rad=None):
+ """
+ Return a new version of this marker rotated by specified angle.
+
+ Parameters
+ ----------
+ deg : float, optional
+ Rotation angle in degrees.
+
+ rad : float, optional
+ Rotation angle in radians.
+
+ .. note:: You must specify exactly one of deg or rad.
+ """
+ if deg is None and rad is None:
+ raise ValueError('One of deg or rad is required')
+ if deg is not None and rad is not None:
+ raise ValueError('Only one of deg and rad can be supplied')
+ new_marker = MarkerStyle(self)
+ if new_marker._user_transform is None:
+ new_marker._user_transform = Affine2D()
+
+ if deg is not None:
+ new_marker._user_transform.rotate_deg(deg)
+ if rad is not None:
+ new_marker._user_transform.rotate(rad)
+
+ return new_marker
+
+ def scaled(self, sx, sy=None):
+ """
+ Return new marker scaled by specified scale factors.
+
+ If *sy* is not given, the same scale is applied in both the *x*- and
+ *y*-directions.
+
+ Parameters
+ ----------
+ sx : float
+ *X*-direction scaling factor.
+ sy : float, optional
+ *Y*-direction scaling factor.
+ """
+ if sy is None:
+ sy = sx
+
+ new_marker = MarkerStyle(self)
+ _transform = new_marker._user_transform or Affine2D()
+ new_marker._user_transform = _transform.scale(sx, sy)
+ return new_marker
+
+ def _set_nothing(self):
+ self._filled = False
+
+ def _set_custom_marker(self, path):
+ rescale = np.max(np.abs(path.vertices)) # max of x's and y's.
+ self._transform = Affine2D().scale(0.5 / rescale)
+ self._path = path
+
+ def _set_path_marker(self):
+ self._set_custom_marker(self._marker)
+
+ def _set_vertices(self):
+ self._set_custom_marker(Path(self._marker))
+
+ def _set_tuple_marker(self):
+ marker = self._marker
+ if len(marker) == 2:
+ numsides, rotation = marker[0], 0.0
+ elif len(marker) == 3:
+ numsides, rotation = marker[0], marker[2]
+ symstyle = marker[1]
+ if symstyle == 0:
+ self._path = Path.unit_regular_polygon(numsides)
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+ elif symstyle == 1:
+ self._path = Path.unit_regular_star(numsides)
+ self._joinstyle = self._user_joinstyle or JoinStyle.bevel
+ elif symstyle == 2:
+ self._path = Path.unit_regular_asterisk(numsides)
+ self._filled = False
+ self._joinstyle = self._user_joinstyle or JoinStyle.bevel
+ else:
+ raise ValueError(f"Unexpected tuple marker: {marker}")
+ self._transform = Affine2D().scale(0.5).rotate_deg(rotation)
+
+ def _set_mathtext_path(self):
+ """
+ Draw mathtext markers '$...$' using `.TextPath` object.
+
+ Submitted by tcb
+ """
+ from matplotlib.text import TextPath
+
+ # again, the properties could be initialised just once outside
+ # this function
+ text = TextPath(xy=(0, 0), s=self.get_marker(),
+ usetex=mpl.rcParams['text.usetex'])
+ if len(text.vertices) == 0:
+ return
+
+ bbox = text.get_extents()
+ max_dim = max(bbox.width, bbox.height)
+ self._transform = (
+ Affine2D()
+ .translate(-bbox.xmin + 0.5 * -bbox.width, -bbox.ymin + 0.5 * -bbox.height)
+ .scale(1.0 / max_dim))
+ self._path = text
+ self._snap = False
+
+ def _half_fill(self):
+ return self.get_fillstyle() in self._half_fillstyles
+
+ def _set_circle(self, size=1.0):
+ self._transform = Affine2D().scale(0.5 * size)
+ self._snap_threshold = np.inf
+ if not self._half_fill():
+ self._path = Path.unit_circle()
+ else:
+ self._path = self._alt_path = Path.unit_circle_righthalf()
+ fs = self.get_fillstyle()
+ self._transform.rotate_deg(
+ {'right': 0, 'top': 90, 'left': 180, 'bottom': 270}[fs])
+ self._alt_transform = self._transform.frozen().rotate_deg(180.)
+
+ def _set_point(self):
+ self._set_circle(size=0.5)
+
+ def _set_pixel(self):
+ self._path = Path.unit_rectangle()
+ # Ideally, you'd want -0.5, -0.5 here, but then the snapping
+ # algorithm in the Agg backend will round this to a 2x2
+ # rectangle from (-1, -1) to (1, 1). By offsetting it
+ # slightly, we can force it to be (0, 0) to (1, 1), which both
+ # makes it only be a single pixel and places it correctly
+ # aligned to 1-width stroking (i.e. the ticks). This hack is
+ # the best of a number of bad alternatives, mainly because the
+ # backends are not aware of what marker is actually being used
+ # beyond just its path data.
+ self._transform = Affine2D().translate(-0.49999, -0.49999)
+ self._snap_threshold = None
+
+ _triangle_path = Path._create_closed([[0, 1], [-1, -1], [1, -1]])
+ # Going down halfway looks to small. Golden ratio is too far.
+ _triangle_path_u = Path._create_closed([[0, 1], [-3/5, -1/5], [3/5, -1/5]])
+ _triangle_path_d = Path._create_closed(
+ [[-3/5, -1/5], [3/5, -1/5], [1, -1], [-1, -1]])
+ _triangle_path_l = Path._create_closed([[0, 1], [0, -1], [-1, -1]])
+ _triangle_path_r = Path._create_closed([[0, 1], [0, -1], [1, -1]])
+
+ def _set_triangle(self, rot, skip):
+ self._transform = Affine2D().scale(0.5).rotate_deg(rot)
+ self._snap_threshold = 5.0
+
+ if not self._half_fill():
+ self._path = self._triangle_path
+ else:
+ mpaths = [self._triangle_path_u,
+ self._triangle_path_l,
+ self._triangle_path_d,
+ self._triangle_path_r]
+
+ fs = self.get_fillstyle()
+ if fs == 'top':
+ self._path = mpaths[(0 + skip) % 4]
+ self._alt_path = mpaths[(2 + skip) % 4]
+ elif fs == 'bottom':
+ self._path = mpaths[(2 + skip) % 4]
+ self._alt_path = mpaths[(0 + skip) % 4]
+ elif fs == 'left':
+ self._path = mpaths[(1 + skip) % 4]
+ self._alt_path = mpaths[(3 + skip) % 4]
+ else:
+ self._path = mpaths[(3 + skip) % 4]
+ self._alt_path = mpaths[(1 + skip) % 4]
+
+ self._alt_transform = self._transform
+
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+
+ def _set_triangle_up(self):
+ return self._set_triangle(0.0, 0)
+
+ def _set_triangle_down(self):
+ return self._set_triangle(180.0, 2)
+
+ def _set_triangle_left(self):
+ return self._set_triangle(90.0, 3)
+
+ def _set_triangle_right(self):
+ return self._set_triangle(270.0, 1)
+
+ def _set_square(self):
+ self._transform = Affine2D().translate(-0.5, -0.5)
+ self._snap_threshold = 2.0
+ if not self._half_fill():
+ self._path = Path.unit_rectangle()
+ else:
+ # Build a bottom filled square out of two rectangles, one filled.
+ self._path = Path([[0.0, 0.0], [1.0, 0.0], [1.0, 0.5],
+ [0.0, 0.5], [0.0, 0.0]])
+ self._alt_path = Path([[0.0, 0.5], [1.0, 0.5], [1.0, 1.0],
+ [0.0, 1.0], [0.0, 0.5]])
+ fs = self.get_fillstyle()
+ rotate = {'bottom': 0, 'right': 90, 'top': 180, 'left': 270}[fs]
+ self._transform.rotate_deg(rotate)
+ self._alt_transform = self._transform
+
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+
+ def _set_diamond(self):
+ self._transform = Affine2D().translate(-0.5, -0.5).rotate_deg(45)
+ self._snap_threshold = 5.0
+ if not self._half_fill():
+ self._path = Path.unit_rectangle()
+ else:
+ self._path = Path([[0, 0], [1, 0], [1, 1], [0, 0]])
+ self._alt_path = Path([[0, 0], [0, 1], [1, 1], [0, 0]])
+ fs = self.get_fillstyle()
+ rotate = {'right': 0, 'top': 90, 'left': 180, 'bottom': 270}[fs]
+ self._transform.rotate_deg(rotate)
+ self._alt_transform = self._transform
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+
+ def _set_thin_diamond(self):
+ self._set_diamond()
+ self._transform.scale(0.6, 1.0)
+
+ def _set_pentagon(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = 5.0
+
+ polypath = Path.unit_regular_polygon(5)
+
+ if not self._half_fill():
+ self._path = polypath
+ else:
+ verts = polypath.vertices
+ y = (1 + np.sqrt(5)) / 4.
+ top = Path(verts[[0, 1, 4, 0]])
+ bottom = Path(verts[[1, 2, 3, 4, 1]])
+ left = Path([verts[0], verts[1], verts[2], [0, -y], verts[0]])
+ right = Path([verts[0], verts[4], verts[3], [0, -y], verts[0]])
+ self._path, self._alt_path = {
+ 'top': (top, bottom), 'bottom': (bottom, top),
+ 'left': (left, right), 'right': (right, left),
+ }[self.get_fillstyle()]
+ self._alt_transform = self._transform
+
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+
+ def _set_star(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = 5.0
+
+ polypath = Path.unit_regular_star(5, innerCircle=0.381966)
+
+ if not self._half_fill():
+ self._path = polypath
+ else:
+ verts = polypath.vertices
+ top = Path(np.concatenate([verts[0:4], verts[7:10], verts[0:1]]))
+ bottom = Path(np.concatenate([verts[3:8], verts[3:4]]))
+ left = Path(np.concatenate([verts[0:6], verts[0:1]]))
+ right = Path(np.concatenate([verts[0:1], verts[5:10], verts[0:1]]))
+ self._path, self._alt_path = {
+ 'top': (top, bottom), 'bottom': (bottom, top),
+ 'left': (left, right), 'right': (right, left),
+ }[self.get_fillstyle()]
+ self._alt_transform = self._transform
+
+ self._joinstyle = self._user_joinstyle or JoinStyle.bevel
+
+ def _set_hexagon1(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = None
+
+ polypath = Path.unit_regular_polygon(6)
+
+ if not self._half_fill():
+ self._path = polypath
+ else:
+ verts = polypath.vertices
+ # not drawing inside lines
+ x = np.abs(np.cos(5 * np.pi / 6.))
+ top = Path(np.concatenate([[(-x, 0)], verts[[1, 0, 5]], [(x, 0)]]))
+ bottom = Path(np.concatenate([[(-x, 0)], verts[2:5], [(x, 0)]]))
+ left = Path(verts[0:4])
+ right = Path(verts[[0, 5, 4, 3]])
+ self._path, self._alt_path = {
+ 'top': (top, bottom), 'bottom': (bottom, top),
+ 'left': (left, right), 'right': (right, left),
+ }[self.get_fillstyle()]
+ self._alt_transform = self._transform
+
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+
+ def _set_hexagon2(self):
+ self._transform = Affine2D().scale(0.5).rotate_deg(30)
+ self._snap_threshold = None
+
+ polypath = Path.unit_regular_polygon(6)
+
+ if not self._half_fill():
+ self._path = polypath
+ else:
+ verts = polypath.vertices
+ # not drawing inside lines
+ x, y = np.sqrt(3) / 4, 3 / 4.
+ top = Path(verts[[1, 0, 5, 4, 1]])
+ bottom = Path(verts[1:5])
+ left = Path(np.concatenate([
+ [(x, y)], verts[:3], [(-x, -y), (x, y)]]))
+ right = Path(np.concatenate([
+ [(x, y)], verts[5:2:-1], [(-x, -y)]]))
+ self._path, self._alt_path = {
+ 'top': (top, bottom), 'bottom': (bottom, top),
+ 'left': (left, right), 'right': (right, left),
+ }[self.get_fillstyle()]
+ self._alt_transform = self._transform
+
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+
+ def _set_octagon(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = 5.0
+
+ polypath = Path.unit_regular_polygon(8)
+
+ if not self._half_fill():
+ self._transform.rotate_deg(22.5)
+ self._path = polypath
+ else:
+ x = np.sqrt(2.) / 4.
+ self._path = self._alt_path = Path(
+ [[0, -1], [0, 1], [-x, 1], [-1, x],
+ [-1, -x], [-x, -1], [0, -1]])
+ fs = self.get_fillstyle()
+ self._transform.rotate_deg(
+ {'left': 0, 'bottom': 90, 'right': 180, 'top': 270}[fs])
+ self._alt_transform = self._transform.frozen().rotate_deg(180.0)
+
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+
+ _line_marker_path = Path([[0.0, -1.0], [0.0, 1.0]])
+
+ def _set_vline(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = 1.0
+ self._filled = False
+ self._path = self._line_marker_path
+
+ def _set_hline(self):
+ self._set_vline()
+ self._transform = self._transform.rotate_deg(90)
+
+ _tickhoriz_path = Path([[0.0, 0.0], [1.0, 0.0]])
+
+ def _set_tickleft(self):
+ self._transform = Affine2D().scale(-1.0, 1.0)
+ self._snap_threshold = 1.0
+ self._filled = False
+ self._path = self._tickhoriz_path
+
+ def _set_tickright(self):
+ self._transform = Affine2D().scale(1.0, 1.0)
+ self._snap_threshold = 1.0
+ self._filled = False
+ self._path = self._tickhoriz_path
+
+ _tickvert_path = Path([[-0.0, 0.0], [-0.0, 1.0]])
+
+ def _set_tickup(self):
+ self._transform = Affine2D().scale(1.0, 1.0)
+ self._snap_threshold = 1.0
+ self._filled = False
+ self._path = self._tickvert_path
+
+ def _set_tickdown(self):
+ self._transform = Affine2D().scale(1.0, -1.0)
+ self._snap_threshold = 1.0
+ self._filled = False
+ self._path = self._tickvert_path
+
+ _tri_path = Path([[0.0, 0.0], [0.0, -1.0],
+ [0.0, 0.0], [0.8, 0.5],
+ [0.0, 0.0], [-0.8, 0.5]],
+ [Path.MOVETO, Path.LINETO,
+ Path.MOVETO, Path.LINETO,
+ Path.MOVETO, Path.LINETO])
+
+ def _set_tri_down(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = 5.0
+ self._filled = False
+ self._path = self._tri_path
+
+ def _set_tri_up(self):
+ self._set_tri_down()
+ self._transform = self._transform.rotate_deg(180)
+
+ def _set_tri_left(self):
+ self._set_tri_down()
+ self._transform = self._transform.rotate_deg(270)
+
+ def _set_tri_right(self):
+ self._set_tri_down()
+ self._transform = self._transform.rotate_deg(90)
+
+ _caret_path = Path([[-1.0, 1.5], [0.0, 0.0], [1.0, 1.5]])
+
+ def _set_caretdown(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = 3.0
+ self._filled = False
+ self._path = self._caret_path
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+
+ def _set_caretup(self):
+ self._set_caretdown()
+ self._transform = self._transform.rotate_deg(180)
+
+ def _set_caretleft(self):
+ self._set_caretdown()
+ self._transform = self._transform.rotate_deg(270)
+
+ def _set_caretright(self):
+ self._set_caretdown()
+ self._transform = self._transform.rotate_deg(90)
+
+ _caret_path_base = Path([[-1.0, 0.0], [0.0, -1.5], [1.0, 0]])
+
+ def _set_caretdownbase(self):
+ self._set_caretdown()
+ self._path = self._caret_path_base
+
+ def _set_caretupbase(self):
+ self._set_caretdownbase()
+ self._transform = self._transform.rotate_deg(180)
+
+ def _set_caretleftbase(self):
+ self._set_caretdownbase()
+ self._transform = self._transform.rotate_deg(270)
+
+ def _set_caretrightbase(self):
+ self._set_caretdownbase()
+ self._transform = self._transform.rotate_deg(90)
+
+ _plus_path = Path([[-1.0, 0.0], [1.0, 0.0],
+ [0.0, -1.0], [0.0, 1.0]],
+ [Path.MOVETO, Path.LINETO,
+ Path.MOVETO, Path.LINETO])
+
+ def _set_plus(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = 1.0
+ self._filled = False
+ self._path = self._plus_path
+
+ _x_path = Path([[-1.0, -1.0], [1.0, 1.0],
+ [-1.0, 1.0], [1.0, -1.0]],
+ [Path.MOVETO, Path.LINETO,
+ Path.MOVETO, Path.LINETO])
+
+ def _set_x(self):
+ self._transform = Affine2D().scale(0.5)
+ self._snap_threshold = 3.0
+ self._filled = False
+ self._path = self._x_path
+
+ _plus_filled_path = Path._create_closed(np.array([
+ (-1, -3), (+1, -3), (+1, -1), (+3, -1), (+3, +1), (+1, +1),
+ (+1, +3), (-1, +3), (-1, +1), (-3, +1), (-3, -1), (-1, -1)]) / 6)
+ _plus_filled_path_t = Path._create_closed(np.array([
+ (+3, 0), (+3, +1), (+1, +1), (+1, +3),
+ (-1, +3), (-1, +1), (-3, +1), (-3, 0)]) / 6)
+
+ def _set_plus_filled(self):
+ self._transform = Affine2D()
+ self._snap_threshold = 5.0
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+ if not self._half_fill():
+ self._path = self._plus_filled_path
+ else:
+ # Rotate top half path to support all partitions
+ self._path = self._alt_path = self._plus_filled_path_t
+ fs = self.get_fillstyle()
+ self._transform.rotate_deg(
+ {'top': 0, 'left': 90, 'bottom': 180, 'right': 270}[fs])
+ self._alt_transform = self._transform.frozen().rotate_deg(180)
+
+ _x_filled_path = Path._create_closed(np.array([
+ (-1, -2), (0, -1), (+1, -2), (+2, -1), (+1, 0), (+2, +1),
+ (+1, +2), (0, +1), (-1, +2), (-2, +1), (-1, 0), (-2, -1)]) / 4)
+ _x_filled_path_t = Path._create_closed(np.array([
+ (+1, 0), (+2, +1), (+1, +2), (0, +1),
+ (-1, +2), (-2, +1), (-1, 0)]) / 4)
+
+ def _set_x_filled(self):
+ self._transform = Affine2D()
+ self._snap_threshold = 5.0
+ self._joinstyle = self._user_joinstyle or JoinStyle.miter
+ if not self._half_fill():
+ self._path = self._x_filled_path
+ else:
+ # Rotate top half path to support all partitions
+ self._path = self._alt_path = self._x_filled_path_t
+ fs = self.get_fillstyle()
+ self._transform.rotate_deg(
+ {'top': 0, 'left': 90, 'bottom': 180, 'right': 270}[fs])
+ self._alt_transform = self._transform.frozen().rotate_deg(180)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/markers.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/markers.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..bd2f7dbcaf0ce4a774d743551ce8b3d5e5e1621c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/markers.pyi
@@ -0,0 +1,51 @@
+from typing import Literal
+
+from .path import Path
+from .transforms import Affine2D, Transform
+
+from numpy.typing import ArrayLike
+from .typing import CapStyleType, FillStyleType, JoinStyleType
+
+TICKLEFT: int
+TICKRIGHT: int
+TICKUP: int
+TICKDOWN: int
+CARETLEFT: int
+CARETRIGHT: int
+CARETUP: int
+CARETDOWN: int
+CARETLEFTBASE: int
+CARETRIGHTBASE: int
+CARETUPBASE: int
+CARETDOWNBASE: int
+
+class MarkerStyle:
+ markers: dict[str | int, str]
+ filled_markers: tuple[str, ...]
+ fillstyles: tuple[FillStyleType, ...]
+
+ def __init__(
+ self,
+ marker: str | ArrayLike | Path | MarkerStyle,
+ fillstyle: FillStyleType | None = ...,
+ transform: Transform | None = ...,
+ capstyle: CapStyleType | None = ...,
+ joinstyle: JoinStyleType | None = ...,
+ ) -> None: ...
+ def __bool__(self) -> bool: ...
+ def is_filled(self) -> bool: ...
+ def get_fillstyle(self) -> FillStyleType: ...
+ def get_joinstyle(self) -> Literal["miter", "round", "bevel"]: ...
+ def get_capstyle(self) -> Literal["butt", "projecting", "round"]: ...
+ def get_marker(self) -> str | ArrayLike | Path | None: ...
+ def get_path(self) -> Path: ...
+ def get_transform(self) -> Transform: ...
+ def get_alt_path(self) -> Path | None: ...
+ def get_alt_transform(self) -> Transform: ...
+ def get_snap_threshold(self) -> float | None: ...
+ def get_user_transform(self) -> Transform | None: ...
+ def transformed(self, transform: Affine2D) -> MarkerStyle: ...
+ def rotated(
+ self, *, deg: float | None = ..., rad: float | None = ...
+ ) -> MarkerStyle: ...
+ def scaled(self, sx: float, sy: float | None = ...) -> MarkerStyle: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mathtext.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mathtext.py
new file mode 100644
index 0000000000000000000000000000000000000000..a88c35c15676b027c773eead1e9d0a8b13270768
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mathtext.py
@@ -0,0 +1,140 @@
+r"""
+A module for parsing a subset of the TeX math syntax and rendering it to a
+Matplotlib backend.
+
+For a tutorial of its usage, see :ref:`mathtext`. This
+document is primarily concerned with implementation details.
+
+The module uses pyparsing_ to parse the TeX expression.
+
+.. _pyparsing: https://pypi.org/project/pyparsing/
+
+The Bakoma distribution of the TeX Computer Modern fonts, and STIX
+fonts are supported. There is experimental support for using
+arbitrary fonts, but results may vary without proper tweaking and
+metrics for those fonts.
+"""
+
+import functools
+import logging
+
+import matplotlib as mpl
+from matplotlib import _api, _mathtext
+from matplotlib.ft2font import LoadFlags
+from matplotlib.font_manager import FontProperties
+from ._mathtext import ( # noqa: F401, reexported API
+ RasterParse, VectorParse, get_unicode_index)
+
+_log = logging.getLogger(__name__)
+
+
+get_unicode_index.__module__ = __name__
+
+##############################################################################
+# MAIN
+
+
+class MathTextParser:
+ _parser = None
+ _font_type_mapping = {
+ 'cm': _mathtext.BakomaFonts,
+ 'dejavuserif': _mathtext.DejaVuSerifFonts,
+ 'dejavusans': _mathtext.DejaVuSansFonts,
+ 'stix': _mathtext.StixFonts,
+ 'stixsans': _mathtext.StixSansFonts,
+ 'custom': _mathtext.UnicodeFonts,
+ }
+
+ def __init__(self, output):
+ """
+ Create a MathTextParser for the given backend *output*.
+
+ Parameters
+ ----------
+ output : {"path", "agg"}
+ Whether to return a `VectorParse` ("path") or a
+ `RasterParse` ("agg", or its synonym "macosx").
+ """
+ self._output_type = _api.check_getitem(
+ {"path": "vector", "agg": "raster", "macosx": "raster"},
+ output=output.lower())
+
+ def parse(self, s, dpi=72, prop=None, *, antialiased=None):
+ """
+ Parse the given math expression *s* at the given *dpi*. If *prop* is
+ provided, it is a `.FontProperties` object specifying the "default"
+ font to use in the math expression, used for all non-math text.
+
+ The results are cached, so multiple calls to `parse`
+ with the same expression should be fast.
+
+ Depending on the *output* type, this returns either a `VectorParse` or
+ a `RasterParse`.
+ """
+ # lru_cache can't decorate parse() directly because prop is
+ # mutable, so we key the cache using an internal copy (see
+ # Text._get_text_metrics_with_cache for a similar case); likewise,
+ # we need to check the mutable state of the text.antialiased and
+ # text.hinting rcParams.
+ prop = prop.copy() if prop is not None else None
+ antialiased = mpl._val_or_rc(antialiased, 'text.antialiased')
+ from matplotlib.backends import backend_agg
+ load_glyph_flags = {
+ "vector": LoadFlags.NO_HINTING,
+ "raster": backend_agg.get_hinting_flag(),
+ }[self._output_type]
+ return self._parse_cached(s, dpi, prop, antialiased, load_glyph_flags)
+
+ @functools.lru_cache(50)
+ def _parse_cached(self, s, dpi, prop, antialiased, load_glyph_flags):
+ if prop is None:
+ prop = FontProperties()
+ fontset_class = _api.check_getitem(
+ self._font_type_mapping, fontset=prop.get_math_fontfamily())
+ fontset = fontset_class(prop, load_glyph_flags)
+ fontsize = prop.get_size_in_points()
+
+ if self._parser is None: # Cache the parser globally.
+ self.__class__._parser = _mathtext.Parser()
+
+ box = self._parser.parse(s, fontset, fontsize, dpi)
+ output = _mathtext.ship(box)
+ if self._output_type == "vector":
+ return output.to_vector()
+ elif self._output_type == "raster":
+ return output.to_raster(antialiased=antialiased)
+
+
+def math_to_image(s, filename_or_obj, prop=None, dpi=None, format=None,
+ *, color=None):
+ """
+ Given a math expression, renders it in a closely-clipped bounding
+ box to an image file.
+
+ Parameters
+ ----------
+ s : str
+ A math expression. The math portion must be enclosed in dollar signs.
+ filename_or_obj : str or path-like or file-like
+ Where to write the image data.
+ prop : `.FontProperties`, optional
+ The size and style of the text.
+ dpi : float, optional
+ The output dpi. If not set, the dpi is determined as for
+ `.Figure.savefig`.
+ format : str, optional
+ The output format, e.g., 'svg', 'pdf', 'ps' or 'png'. If not set, the
+ format is determined as for `.Figure.savefig`.
+ color : str, optional
+ Foreground color, defaults to :rc:`text.color`.
+ """
+ from matplotlib import figure
+
+ parser = MathTextParser('path')
+ width, height, depth, _, _ = parser.parse(s, dpi=72, prop=prop)
+
+ fig = figure.Figure(figsize=(width / 72.0, height / 72.0))
+ fig.text(0, depth/height, s, fontproperties=prop, color=color)
+ fig.savefig(filename_or_obj, dpi=dpi, format=format)
+
+ return depth
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mathtext.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mathtext.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..607501a275c67941e2a67883dc9c99a887ac0581
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mathtext.pyi
@@ -0,0 +1,33 @@
+import os
+from typing import Generic, IO, Literal, TypeVar, overload
+
+from matplotlib.font_manager import FontProperties
+from matplotlib.typing import ColorType
+
+# Re-exported API from _mathtext.
+from ._mathtext import (
+ RasterParse as RasterParse,
+ VectorParse as VectorParse,
+ get_unicode_index as get_unicode_index,
+)
+
+_ParseType = TypeVar("_ParseType", RasterParse, VectorParse)
+
+class MathTextParser(Generic[_ParseType]):
+ @overload
+ def __init__(self: MathTextParser[VectorParse], output: Literal["path"]) -> None: ...
+ @overload
+ def __init__(self: MathTextParser[RasterParse], output: Literal["agg", "raster", "macosx"]) -> None: ...
+ def parse(
+ self, s: str, dpi: float = ..., prop: FontProperties | None = ..., *, antialiased: bool | None = ...
+ ) -> _ParseType: ...
+
+def math_to_image(
+ s: str,
+ filename_or_obj: str | os.PathLike | IO,
+ prop: FontProperties | None = ...,
+ dpi: float | None = ...,
+ format: str | None = ...,
+ *,
+ color: ColorType | None = ...
+) -> float: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mlab.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mlab.py
new file mode 100644
index 0000000000000000000000000000000000000000..8326ac186e31bbc29d9027e64ae65f999a6f73dd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mlab.py
@@ -0,0 +1,913 @@
+"""
+Numerical Python functions written for compatibility with MATLAB
+commands with the same names. Most numerical Python functions can be found in
+the `NumPy`_ and `SciPy`_ libraries. What remains here is code for performing
+spectral computations and kernel density estimations.
+
+.. _NumPy: https://numpy.org
+.. _SciPy: https://www.scipy.org
+
+Spectral functions
+------------------
+
+`cohere`
+ Coherence (normalized cross spectral density)
+
+`csd`
+ Cross spectral density using Welch's average periodogram
+
+`detrend`
+ Remove the mean or best fit line from an array
+
+`psd`
+ Power spectral density using Welch's average periodogram
+
+`specgram`
+ Spectrogram (spectrum over segments of time)
+
+`complex_spectrum`
+ Return the complex-valued frequency spectrum of a signal
+
+`magnitude_spectrum`
+ Return the magnitude of the frequency spectrum of a signal
+
+`angle_spectrum`
+ Return the angle (wrapped phase) of the frequency spectrum of a signal
+
+`phase_spectrum`
+ Return the phase (unwrapped angle) of the frequency spectrum of a signal
+
+`detrend_mean`
+ Remove the mean from a line.
+
+`detrend_linear`
+ Remove the best fit line from a line.
+
+`detrend_none`
+ Return the original line.
+"""
+
+import functools
+from numbers import Number
+
+import numpy as np
+
+from matplotlib import _api, _docstring, cbook
+
+
+def window_hanning(x):
+ """
+ Return *x* times the Hanning (or Hann) window of len(*x*).
+
+ See Also
+ --------
+ window_none : Another window algorithm.
+ """
+ return np.hanning(len(x))*x
+
+
+def window_none(x):
+ """
+ No window function; simply return *x*.
+
+ See Also
+ --------
+ window_hanning : Another window algorithm.
+ """
+ return x
+
+
+def detrend(x, key=None, axis=None):
+ """
+ Return *x* with its trend removed.
+
+ Parameters
+ ----------
+ x : array or sequence
+ Array or sequence containing the data.
+
+ key : {'default', 'constant', 'mean', 'linear', 'none'} or function
+ The detrending algorithm to use. 'default', 'mean', and 'constant' are
+ the same as `detrend_mean`. 'linear' is the same as `detrend_linear`.
+ 'none' is the same as `detrend_none`. The default is 'mean'. See the
+ corresponding functions for more details regarding the algorithms. Can
+ also be a function that carries out the detrend operation.
+
+ axis : int
+ The axis along which to do the detrending.
+
+ See Also
+ --------
+ detrend_mean : Implementation of the 'mean' algorithm.
+ detrend_linear : Implementation of the 'linear' algorithm.
+ detrend_none : Implementation of the 'none' algorithm.
+ """
+ if key is None or key in ['constant', 'mean', 'default']:
+ return detrend(x, key=detrend_mean, axis=axis)
+ elif key == 'linear':
+ return detrend(x, key=detrend_linear, axis=axis)
+ elif key == 'none':
+ return detrend(x, key=detrend_none, axis=axis)
+ elif callable(key):
+ x = np.asarray(x)
+ if axis is not None and axis + 1 > x.ndim:
+ raise ValueError(f'axis(={axis}) out of bounds')
+ if (axis is None and x.ndim == 0) or (not axis and x.ndim == 1):
+ return key(x)
+ # try to use the 'axis' argument if the function supports it,
+ # otherwise use apply_along_axis to do it
+ try:
+ return key(x, axis=axis)
+ except TypeError:
+ return np.apply_along_axis(key, axis=axis, arr=x)
+ else:
+ raise ValueError(
+ f"Unknown value for key: {key!r}, must be one of: 'default', "
+ f"'constant', 'mean', 'linear', or a function")
+
+
+def detrend_mean(x, axis=None):
+ """
+ Return *x* minus the mean(*x*).
+
+ Parameters
+ ----------
+ x : array or sequence
+ Array or sequence containing the data
+ Can have any dimensionality
+
+ axis : int
+ The axis along which to take the mean. See `numpy.mean` for a
+ description of this argument.
+
+ See Also
+ --------
+ detrend_linear : Another detrend algorithm.
+ detrend_none : Another detrend algorithm.
+ detrend : A wrapper around all the detrend algorithms.
+ """
+ x = np.asarray(x)
+
+ if axis is not None and axis+1 > x.ndim:
+ raise ValueError('axis(=%s) out of bounds' % axis)
+
+ return x - x.mean(axis, keepdims=True)
+
+
+def detrend_none(x, axis=None):
+ """
+ Return *x*: no detrending.
+
+ Parameters
+ ----------
+ x : any object
+ An object containing the data
+
+ axis : int
+ This parameter is ignored.
+ It is included for compatibility with detrend_mean
+
+ See Also
+ --------
+ detrend_mean : Another detrend algorithm.
+ detrend_linear : Another detrend algorithm.
+ detrend : A wrapper around all the detrend algorithms.
+ """
+ return x
+
+
+def detrend_linear(y):
+ """
+ Return *x* minus best fit line; 'linear' detrending.
+
+ Parameters
+ ----------
+ y : 0-D or 1-D array or sequence
+ Array or sequence containing the data
+
+ See Also
+ --------
+ detrend_mean : Another detrend algorithm.
+ detrend_none : Another detrend algorithm.
+ detrend : A wrapper around all the detrend algorithms.
+ """
+ # This is faster than an algorithm based on linalg.lstsq.
+ y = np.asarray(y)
+
+ if y.ndim > 1:
+ raise ValueError('y cannot have ndim > 1')
+
+ # short-circuit 0-D array.
+ if not y.ndim:
+ return np.array(0., dtype=y.dtype)
+
+ x = np.arange(y.size, dtype=float)
+
+ C = np.cov(x, y, bias=1)
+ b = C[0, 1]/C[0, 0]
+
+ a = y.mean() - b*x.mean()
+ return y - (b*x + a)
+
+
+def _spectral_helper(x, y=None, NFFT=None, Fs=None, detrend_func=None,
+ window=None, noverlap=None, pad_to=None,
+ sides=None, scale_by_freq=None, mode=None):
+ """
+ Private helper implementing the common parts between the psd, csd,
+ spectrogram and complex, magnitude, angle, and phase spectrums.
+ """
+ if y is None:
+ # if y is None use x for y
+ same_data = True
+ else:
+ # The checks for if y is x are so that we can use the same function to
+ # implement the core of psd(), csd(), and spectrogram() without doing
+ # extra calculations. We return the unaveraged Pxy, freqs, and t.
+ same_data = y is x
+
+ if Fs is None:
+ Fs = 2
+ if noverlap is None:
+ noverlap = 0
+ if detrend_func is None:
+ detrend_func = detrend_none
+ if window is None:
+ window = window_hanning
+
+ # if NFFT is set to None use the whole signal
+ if NFFT is None:
+ NFFT = 256
+
+ if noverlap >= NFFT:
+ raise ValueError('noverlap must be less than NFFT')
+
+ if mode is None or mode == 'default':
+ mode = 'psd'
+ _api.check_in_list(
+ ['default', 'psd', 'complex', 'magnitude', 'angle', 'phase'],
+ mode=mode)
+
+ if not same_data and mode != 'psd':
+ raise ValueError("x and y must be equal if mode is not 'psd'")
+
+ # Make sure we're dealing with a numpy array. If y and x were the same
+ # object to start with, keep them that way
+ x = np.asarray(x)
+ if not same_data:
+ y = np.asarray(y)
+
+ if sides is None or sides == 'default':
+ if np.iscomplexobj(x):
+ sides = 'twosided'
+ else:
+ sides = 'onesided'
+ _api.check_in_list(['default', 'onesided', 'twosided'], sides=sides)
+
+ # zero pad x and y up to NFFT if they are shorter than NFFT
+ if len(x) < NFFT:
+ n = len(x)
+ x = np.resize(x, NFFT)
+ x[n:] = 0
+
+ if not same_data and len(y) < NFFT:
+ n = len(y)
+ y = np.resize(y, NFFT)
+ y[n:] = 0
+
+ if pad_to is None:
+ pad_to = NFFT
+
+ if mode != 'psd':
+ scale_by_freq = False
+ elif scale_by_freq is None:
+ scale_by_freq = True
+
+ # For real x, ignore the negative frequencies unless told otherwise
+ if sides == 'twosided':
+ numFreqs = pad_to
+ if pad_to % 2:
+ freqcenter = (pad_to - 1)//2 + 1
+ else:
+ freqcenter = pad_to//2
+ scaling_factor = 1.
+ elif sides == 'onesided':
+ if pad_to % 2:
+ numFreqs = (pad_to + 1)//2
+ else:
+ numFreqs = pad_to//2 + 1
+ scaling_factor = 2.
+
+ if not np.iterable(window):
+ window = window(np.ones(NFFT, x.dtype))
+ if len(window) != NFFT:
+ raise ValueError(
+ "The window length must match the data's first dimension")
+
+ result = np.lib.stride_tricks.sliding_window_view(
+ x, NFFT, axis=0)[::NFFT - noverlap].T
+ result = detrend(result, detrend_func, axis=0)
+ result = result * window.reshape((-1, 1))
+ result = np.fft.fft(result, n=pad_to, axis=0)[:numFreqs, :]
+ freqs = np.fft.fftfreq(pad_to, 1/Fs)[:numFreqs]
+
+ if not same_data:
+ # if same_data is False, mode must be 'psd'
+ resultY = np.lib.stride_tricks.sliding_window_view(
+ y, NFFT, axis=0)[::NFFT - noverlap].T
+ resultY = detrend(resultY, detrend_func, axis=0)
+ resultY = resultY * window.reshape((-1, 1))
+ resultY = np.fft.fft(resultY, n=pad_to, axis=0)[:numFreqs, :]
+ result = np.conj(result) * resultY
+ elif mode == 'psd':
+ result = np.conj(result) * result
+ elif mode == 'magnitude':
+ result = np.abs(result) / window.sum()
+ elif mode == 'angle' or mode == 'phase':
+ # we unwrap the phase later to handle the onesided vs. twosided case
+ result = np.angle(result)
+ elif mode == 'complex':
+ result /= window.sum()
+
+ if mode == 'psd':
+
+ # Also include scaling factors for one-sided densities and dividing by
+ # the sampling frequency, if desired. Scale everything, except the DC
+ # component and the NFFT/2 component:
+
+ # if we have a even number of frequencies, don't scale NFFT/2
+ if not NFFT % 2:
+ slc = slice(1, -1, None)
+ # if we have an odd number, just don't scale DC
+ else:
+ slc = slice(1, None, None)
+
+ result[slc] *= scaling_factor
+
+ # MATLAB divides by the sampling frequency so that density function
+ # has units of dB/Hz and can be integrated by the plotted frequency
+ # values. Perform the same scaling here.
+ if scale_by_freq:
+ result /= Fs
+ # Scale the spectrum by the norm of the window to compensate for
+ # windowing loss; see Bendat & Piersol Sec 11.5.2.
+ result /= (window**2).sum()
+ else:
+ # In this case, preserve power in the segment, not amplitude
+ result /= window.sum()**2
+
+ t = np.arange(NFFT/2, len(x) - NFFT/2 + 1, NFFT - noverlap)/Fs
+
+ if sides == 'twosided':
+ # center the frequency range at zero
+ freqs = np.roll(freqs, -freqcenter, axis=0)
+ result = np.roll(result, -freqcenter, axis=0)
+ elif not pad_to % 2:
+ # get the last value correctly, it is negative otherwise
+ freqs[-1] *= -1
+
+ # we unwrap the phase here to handle the onesided vs. twosided case
+ if mode == 'phase':
+ result = np.unwrap(result, axis=0)
+
+ return result, freqs, t
+
+
+def _single_spectrum_helper(
+ mode, x, Fs=None, window=None, pad_to=None, sides=None):
+ """
+ Private helper implementing the commonality between the complex, magnitude,
+ angle, and phase spectrums.
+ """
+ _api.check_in_list(['complex', 'magnitude', 'angle', 'phase'], mode=mode)
+
+ if pad_to is None:
+ pad_to = len(x)
+
+ spec, freqs, _ = _spectral_helper(x=x, y=None, NFFT=len(x), Fs=Fs,
+ detrend_func=detrend_none, window=window,
+ noverlap=0, pad_to=pad_to,
+ sides=sides,
+ scale_by_freq=False,
+ mode=mode)
+ if mode != 'complex':
+ spec = spec.real
+
+ if spec.ndim == 2 and spec.shape[1] == 1:
+ spec = spec[:, 0]
+
+ return spec, freqs
+
+
+# Split out these keyword docs so that they can be used elsewhere
+_docstring.interpd.register(
+ Spectral="""\
+Fs : float, default: 2
+ The sampling frequency (samples per time unit). It is used to calculate
+ the Fourier frequencies, *freqs*, in cycles per time unit.
+
+window : callable or ndarray, default: `.window_hanning`
+ A function or a vector of length *NFFT*. To create window vectors see
+ `.window_hanning`, `.window_none`, `numpy.blackman`, `numpy.hamming`,
+ `numpy.bartlett`, `scipy.signal`, `scipy.signal.get_window`, etc. If a
+ function is passed as the argument, it must take a data segment as an
+ argument and return the windowed version of the segment.
+
+sides : {'default', 'onesided', 'twosided'}, optional
+ Which sides of the spectrum to return. 'default' is one-sided for real
+ data and two-sided for complex data. 'onesided' forces the return of a
+ one-sided spectrum, while 'twosided' forces two-sided.""",
+
+ Single_Spectrum="""\
+pad_to : int, optional
+ The number of points to which the data segment is padded when performing
+ the FFT. While not increasing the actual resolution of the spectrum (the
+ minimum distance between resolvable peaks), this can give more points in
+ the plot, allowing for more detail. This corresponds to the *n* parameter
+ in the call to `~numpy.fft.fft`. The default is None, which sets *pad_to*
+ equal to the length of the input signal (i.e. no padding).""",
+
+ PSD="""\
+pad_to : int, optional
+ The number of points to which the data segment is padded when performing
+ the FFT. This can be different from *NFFT*, which specifies the number
+ of data points used. While not increasing the actual resolution of the
+ spectrum (the minimum distance between resolvable peaks), this can give
+ more points in the plot, allowing for more detail. This corresponds to
+ the *n* parameter in the call to `~numpy.fft.fft`. The default is None,
+ which sets *pad_to* equal to *NFFT*
+
+NFFT : int, default: 256
+ The number of data points used in each block for the FFT. A power 2 is
+ most efficient. This should *NOT* be used to get zero padding, or the
+ scaling of the result will be incorrect; use *pad_to* for this instead.
+
+detrend : {'none', 'mean', 'linear'} or callable, default: 'none'
+ The function applied to each segment before fft-ing, designed to remove
+ the mean or linear trend. Unlike in MATLAB, where the *detrend* parameter
+ is a vector, in Matplotlib it is a function. The :mod:`~matplotlib.mlab`
+ module defines `.detrend_none`, `.detrend_mean`, and `.detrend_linear`,
+ but you can use a custom function as well. You can also use a string to
+ choose one of the functions: 'none' calls `.detrend_none`. 'mean' calls
+ `.detrend_mean`. 'linear' calls `.detrend_linear`.
+
+scale_by_freq : bool, default: True
+ Whether the resulting density values should be scaled by the scaling
+ frequency, which gives density in units of 1/Hz. This allows for
+ integration over the returned frequency values. The default is True for
+ MATLAB compatibility.""")
+
+
+@_docstring.interpd
+def psd(x, NFFT=None, Fs=None, detrend=None, window=None,
+ noverlap=None, pad_to=None, sides=None, scale_by_freq=None):
+ r"""
+ Compute the power spectral density.
+
+ The power spectral density :math:`P_{xx}` by Welch's average
+ periodogram method. The vector *x* is divided into *NFFT* length
+ segments. Each segment is detrended by function *detrend* and
+ windowed by function *window*. *noverlap* gives the length of
+ the overlap between segments. The :math:`|\mathrm{fft}(i)|^2`
+ of each segment :math:`i` are averaged to compute :math:`P_{xx}`.
+
+ If len(*x*) < *NFFT*, it will be zero padded to *NFFT*.
+
+ Parameters
+ ----------
+ x : 1-D array or sequence
+ Array or sequence containing the data
+
+ %(Spectral)s
+
+ %(PSD)s
+
+ noverlap : int, default: 0 (no overlap)
+ The number of points of overlap between segments.
+
+ Returns
+ -------
+ Pxx : 1-D array
+ The values for the power spectrum :math:`P_{xx}` (real valued)
+
+ freqs : 1-D array
+ The frequencies corresponding to the elements in *Pxx*
+
+ References
+ ----------
+ Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John
+ Wiley & Sons (1986)
+
+ See Also
+ --------
+ specgram
+ `specgram` differs in the default overlap; in not returning the mean of
+ the segment periodograms; and in returning the times of the segments.
+
+ magnitude_spectrum : returns the magnitude spectrum.
+
+ csd : returns the spectral density between two signals.
+ """
+ Pxx, freqs = csd(x=x, y=None, NFFT=NFFT, Fs=Fs, detrend=detrend,
+ window=window, noverlap=noverlap, pad_to=pad_to,
+ sides=sides, scale_by_freq=scale_by_freq)
+ return Pxx.real, freqs
+
+
+@_docstring.interpd
+def csd(x, y, NFFT=None, Fs=None, detrend=None, window=None,
+ noverlap=None, pad_to=None, sides=None, scale_by_freq=None):
+ """
+ Compute the cross-spectral density.
+
+ The cross spectral density :math:`P_{xy}` by Welch's average
+ periodogram method. The vectors *x* and *y* are divided into
+ *NFFT* length segments. Each segment is detrended by function
+ *detrend* and windowed by function *window*. *noverlap* gives
+ the length of the overlap between segments. The product of
+ the direct FFTs of *x* and *y* are averaged over each segment
+ to compute :math:`P_{xy}`, with a scaling to correct for power
+ loss due to windowing.
+
+ If len(*x*) < *NFFT* or len(*y*) < *NFFT*, they will be zero
+ padded to *NFFT*.
+
+ Parameters
+ ----------
+ x, y : 1-D arrays or sequences
+ Arrays or sequences containing the data
+
+ %(Spectral)s
+
+ %(PSD)s
+
+ noverlap : int, default: 0 (no overlap)
+ The number of points of overlap between segments.
+
+ Returns
+ -------
+ Pxy : 1-D array
+ The values for the cross spectrum :math:`P_{xy}` before scaling (real
+ valued)
+
+ freqs : 1-D array
+ The frequencies corresponding to the elements in *Pxy*
+
+ References
+ ----------
+ Bendat & Piersol -- Random Data: Analysis and Measurement Procedures, John
+ Wiley & Sons (1986)
+
+ See Also
+ --------
+ psd : equivalent to setting ``y = x``.
+ """
+ if NFFT is None:
+ NFFT = 256
+ Pxy, freqs, _ = _spectral_helper(x=x, y=y, NFFT=NFFT, Fs=Fs,
+ detrend_func=detrend, window=window,
+ noverlap=noverlap, pad_to=pad_to,
+ sides=sides, scale_by_freq=scale_by_freq,
+ mode='psd')
+
+ if Pxy.ndim == 2:
+ if Pxy.shape[1] > 1:
+ Pxy = Pxy.mean(axis=1)
+ else:
+ Pxy = Pxy[:, 0]
+ return Pxy, freqs
+
+
+_single_spectrum_docs = """\
+Compute the {quantity} of *x*.
+Data is padded to a length of *pad_to* and the windowing function *window* is
+applied to the signal.
+
+Parameters
+----------
+x : 1-D array or sequence
+ Array or sequence containing the data
+
+{Spectral}
+
+{Single_Spectrum}
+
+Returns
+-------
+spectrum : 1-D array
+ The {quantity}.
+freqs : 1-D array
+ The frequencies corresponding to the elements in *spectrum*.
+
+See Also
+--------
+psd
+ Returns the power spectral density.
+complex_spectrum
+ Returns the complex-valued frequency spectrum.
+magnitude_spectrum
+ Returns the absolute value of the `complex_spectrum`.
+angle_spectrum
+ Returns the angle of the `complex_spectrum`.
+phase_spectrum
+ Returns the phase (unwrapped angle) of the `complex_spectrum`.
+specgram
+ Can return the complex spectrum of segments within the signal.
+"""
+
+
+complex_spectrum = functools.partial(_single_spectrum_helper, "complex")
+complex_spectrum.__doc__ = _single_spectrum_docs.format(
+ quantity="complex-valued frequency spectrum",
+ **_docstring.interpd.params)
+magnitude_spectrum = functools.partial(_single_spectrum_helper, "magnitude")
+magnitude_spectrum.__doc__ = _single_spectrum_docs.format(
+ quantity="magnitude (absolute value) of the frequency spectrum",
+ **_docstring.interpd.params)
+angle_spectrum = functools.partial(_single_spectrum_helper, "angle")
+angle_spectrum.__doc__ = _single_spectrum_docs.format(
+ quantity="angle of the frequency spectrum (wrapped phase spectrum)",
+ **_docstring.interpd.params)
+phase_spectrum = functools.partial(_single_spectrum_helper, "phase")
+phase_spectrum.__doc__ = _single_spectrum_docs.format(
+ quantity="phase of the frequency spectrum (unwrapped phase spectrum)",
+ **_docstring.interpd.params)
+
+
+@_docstring.interpd
+def specgram(x, NFFT=None, Fs=None, detrend=None, window=None,
+ noverlap=None, pad_to=None, sides=None, scale_by_freq=None,
+ mode=None):
+ """
+ Compute a spectrogram.
+
+ Compute and plot a spectrogram of data in *x*. Data are split into
+ *NFFT* length segments and the spectrum of each section is
+ computed. The windowing function *window* is applied to each
+ segment, and the amount of overlap of each segment is
+ specified with *noverlap*.
+
+ Parameters
+ ----------
+ x : array-like
+ 1-D array or sequence.
+
+ %(Spectral)s
+
+ %(PSD)s
+
+ noverlap : int, default: 128
+ The number of points of overlap between blocks.
+ mode : str, default: 'psd'
+ What sort of spectrum to use:
+ 'psd'
+ Returns the power spectral density.
+ 'complex'
+ Returns the complex-valued frequency spectrum.
+ 'magnitude'
+ Returns the magnitude spectrum.
+ 'angle'
+ Returns the phase spectrum without unwrapping.
+ 'phase'
+ Returns the phase spectrum with unwrapping.
+
+ Returns
+ -------
+ spectrum : array-like
+ 2D array, columns are the periodograms of successive segments.
+
+ freqs : array-like
+ 1-D array, frequencies corresponding to the rows in *spectrum*.
+
+ t : array-like
+ 1-D array, the times corresponding to midpoints of segments
+ (i.e the columns in *spectrum*).
+
+ See Also
+ --------
+ psd : differs in the overlap and in the return values.
+ complex_spectrum : similar, but with complex valued frequencies.
+ magnitude_spectrum : similar single segment when *mode* is 'magnitude'.
+ angle_spectrum : similar to single segment when *mode* is 'angle'.
+ phase_spectrum : similar to single segment when *mode* is 'phase'.
+
+ Notes
+ -----
+ *detrend* and *scale_by_freq* only apply when *mode* is set to 'psd'.
+
+ """
+ if noverlap is None:
+ noverlap = 128 # default in _spectral_helper() is noverlap = 0
+ if NFFT is None:
+ NFFT = 256 # same default as in _spectral_helper()
+ if len(x) <= NFFT:
+ _api.warn_external("Only one segment is calculated since parameter "
+ f"NFFT (={NFFT}) >= signal length (={len(x)}).")
+
+ spec, freqs, t = _spectral_helper(x=x, y=None, NFFT=NFFT, Fs=Fs,
+ detrend_func=detrend, window=window,
+ noverlap=noverlap, pad_to=pad_to,
+ sides=sides,
+ scale_by_freq=scale_by_freq,
+ mode=mode)
+
+ if mode != 'complex':
+ spec = spec.real # Needed since helper implements generically
+
+ return spec, freqs, t
+
+
+@_docstring.interpd
+def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
+ noverlap=0, pad_to=None, sides='default', scale_by_freq=None):
+ r"""
+ The coherence between *x* and *y*. Coherence is the normalized
+ cross spectral density:
+
+ .. math::
+
+ C_{xy} = \frac{|P_{xy}|^2}{P_{xx}P_{yy}}
+
+ Parameters
+ ----------
+ x, y
+ Array or sequence containing the data
+
+ %(Spectral)s
+
+ %(PSD)s
+
+ noverlap : int, default: 0 (no overlap)
+ The number of points of overlap between segments.
+
+ Returns
+ -------
+ Cxy : 1-D array
+ The coherence vector.
+ freqs : 1-D array
+ The frequencies for the elements in *Cxy*.
+
+ See Also
+ --------
+ :func:`psd`, :func:`csd` :
+ For information about the methods used to compute :math:`P_{xy}`,
+ :math:`P_{xx}` and :math:`P_{yy}`.
+ """
+ if len(x) < 2 * NFFT:
+ raise ValueError(
+ "Coherence is calculated by averaging over *NFFT* length "
+ "segments. Your signal is too short for your choice of *NFFT*.")
+ Pxx, f = psd(x, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
+ Pyy, f = psd(y, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
+ Pxy, f = csd(x, y, NFFT, Fs, detrend, window, noverlap, pad_to, sides,
+ scale_by_freq)
+ Cxy = np.abs(Pxy) ** 2 / (Pxx * Pyy)
+ return Cxy, f
+
+
+class GaussianKDE:
+ """
+ Representation of a kernel-density estimate using Gaussian kernels.
+
+ Parameters
+ ----------
+ dataset : array-like
+ Datapoints to estimate from. In case of univariate data this is a 1-D
+ array, otherwise a 2D array with shape (# of dims, # of data).
+ bw_method : {'scott', 'silverman'} or float or callable, optional
+ The method used to calculate the estimator bandwidth. If a
+ float, this will be used directly as `kde.factor`. If a
+ callable, it should take a `GaussianKDE` instance as only
+ parameter and return a float. If None (default), 'scott' is used.
+
+ Attributes
+ ----------
+ dataset : ndarray
+ The dataset passed to the constructor.
+ dim : int
+ Number of dimensions.
+ num_dp : int
+ Number of datapoints.
+ factor : float
+ The bandwidth factor, obtained from `kde.covariance_factor`, with which
+ the covariance matrix is multiplied.
+ covariance : ndarray
+ The covariance matrix of *dataset*, scaled by the calculated bandwidth
+ (`kde.factor`).
+ inv_cov : ndarray
+ The inverse of *covariance*.
+
+ Methods
+ -------
+ kde.evaluate(points) : ndarray
+ Evaluate the estimated pdf on a provided set of points.
+ kde(points) : ndarray
+ Same as kde.evaluate(points)
+ """
+
+ # This implementation with minor modification was too good to pass up.
+ # from scipy: https://github.com/scipy/scipy/blob/master/scipy/stats/kde.py
+
+ def __init__(self, dataset, bw_method=None):
+ self.dataset = np.atleast_2d(dataset)
+ if not np.array(self.dataset).size > 1:
+ raise ValueError("`dataset` input should have multiple elements.")
+
+ self.dim, self.num_dp = np.array(self.dataset).shape
+
+ if bw_method is None:
+ pass
+ elif cbook._str_equal(bw_method, 'scott'):
+ self.covariance_factor = self.scotts_factor
+ elif cbook._str_equal(bw_method, 'silverman'):
+ self.covariance_factor = self.silverman_factor
+ elif isinstance(bw_method, Number):
+ self._bw_method = 'use constant'
+ self.covariance_factor = lambda: bw_method
+ elif callable(bw_method):
+ self._bw_method = bw_method
+ self.covariance_factor = lambda: self._bw_method(self)
+ else:
+ raise ValueError("`bw_method` should be 'scott', 'silverman', a "
+ "scalar or a callable")
+
+ # Computes the covariance matrix for each Gaussian kernel using
+ # covariance_factor().
+
+ self.factor = self.covariance_factor()
+ # Cache covariance and inverse covariance of the data
+ if not hasattr(self, '_data_inv_cov'):
+ self.data_covariance = np.atleast_2d(
+ np.cov(
+ self.dataset,
+ rowvar=1,
+ bias=False))
+ self.data_inv_cov = np.linalg.inv(self.data_covariance)
+
+ self.covariance = self.data_covariance * self.factor ** 2
+ self.inv_cov = self.data_inv_cov / self.factor ** 2
+ self.norm_factor = (np.sqrt(np.linalg.det(2 * np.pi * self.covariance))
+ * self.num_dp)
+
+ def scotts_factor(self):
+ return np.power(self.num_dp, -1. / (self.dim + 4))
+
+ def silverman_factor(self):
+ return np.power(
+ self.num_dp * (self.dim + 2.0) / 4.0, -1. / (self.dim + 4))
+
+ # Default method to calculate bandwidth, can be overwritten by subclass
+ covariance_factor = scotts_factor
+
+ def evaluate(self, points):
+ """
+ Evaluate the estimated pdf on a set of points.
+
+ Parameters
+ ----------
+ points : (# of dimensions, # of points)-array
+ Alternatively, a (# of dimensions,) vector can be passed in and
+ treated as a single point.
+
+ Returns
+ -------
+ (# of points,)-array
+ The values at each point.
+
+ Raises
+ ------
+ ValueError : if the dimensionality of the input points is different
+ than the dimensionality of the KDE.
+
+ """
+ points = np.atleast_2d(points)
+
+ dim, num_m = np.array(points).shape
+ if dim != self.dim:
+ raise ValueError(f"points have dimension {dim}, dataset has "
+ f"dimension {self.dim}")
+
+ result = np.zeros(num_m)
+
+ if num_m >= self.num_dp:
+ # there are more points than data, so loop over data
+ for i in range(self.num_dp):
+ diff = self.dataset[:, i, np.newaxis] - points
+ tdiff = np.dot(self.inv_cov, diff)
+ energy = np.sum(diff * tdiff, axis=0) / 2.0
+ result = result + np.exp(-energy)
+ else:
+ # loop over points
+ for i in range(num_m):
+ diff = self.dataset - points[:, i, np.newaxis]
+ tdiff = np.dot(self.inv_cov, diff)
+ energy = np.sum(diff * tdiff, axis=0) / 2.0
+ result[i] = np.sum(np.exp(-energy), axis=0)
+
+ result = result / self.norm_factor
+
+ return result
+
+ __call__ = evaluate
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mlab.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mlab.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..1f23288dd10b1d8c4be54c0117bc6e34352d33c7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mlab.pyi
@@ -0,0 +1,100 @@
+from collections.abc import Callable
+import functools
+from typing import Literal
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+def window_hanning(x: ArrayLike) -> ArrayLike: ...
+def window_none(x: ArrayLike) -> ArrayLike: ...
+def detrend(
+ x: ArrayLike,
+ key: Literal["default", "constant", "mean", "linear", "none"]
+ | Callable[[ArrayLike, int | None], ArrayLike]
+ | None = ...,
+ axis: int | None = ...,
+) -> ArrayLike: ...
+def detrend_mean(x: ArrayLike, axis: int | None = ...) -> ArrayLike: ...
+def detrend_none(x: ArrayLike, axis: int | None = ...) -> ArrayLike: ...
+def detrend_linear(y: ArrayLike) -> ArrayLike: ...
+def psd(
+ x: ArrayLike,
+ NFFT: int | None = ...,
+ Fs: float | None = ...,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike, int | None], ArrayLike]
+ | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ noverlap: int | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ scale_by_freq: bool | None = ...,
+) -> tuple[ArrayLike, ArrayLike]: ...
+def csd(
+ x: ArrayLike,
+ y: ArrayLike | None,
+ NFFT: int | None = ...,
+ Fs: float | None = ...,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike, int | None], ArrayLike]
+ | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ noverlap: int | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ scale_by_freq: bool | None = ...,
+) -> tuple[ArrayLike, ArrayLike]: ...
+
+complex_spectrum = functools.partial(tuple[ArrayLike, ArrayLike])
+magnitude_spectrum = functools.partial(tuple[ArrayLike, ArrayLike])
+angle_spectrum = functools.partial(tuple[ArrayLike, ArrayLike])
+phase_spectrum = functools.partial(tuple[ArrayLike, ArrayLike])
+
+def specgram(
+ x: ArrayLike,
+ NFFT: int | None = ...,
+ Fs: float | None = ...,
+ detrend: Literal["none", "mean", "linear"] | Callable[[ArrayLike, int | None], ArrayLike] | None = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = ...,
+ noverlap: int | None = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] | None = ...,
+ scale_by_freq: bool | None = ...,
+ mode: Literal["psd", "complex", "magnitude", "angle", "phase"] | None = ...,
+) -> tuple[ArrayLike, ArrayLike, ArrayLike]: ...
+def cohere(
+ x: ArrayLike,
+ y: ArrayLike,
+ NFFT: int = ...,
+ Fs: float = ...,
+ detrend: Literal["none", "mean", "linear"] | Callable[[ArrayLike, int | None], ArrayLike] = ...,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike = ...,
+ noverlap: int = ...,
+ pad_to: int | None = ...,
+ sides: Literal["default", "onesided", "twosided"] = ...,
+ scale_by_freq: bool | None = ...,
+) -> tuple[ArrayLike, ArrayLike]: ...
+
+class GaussianKDE:
+ dataset: ArrayLike
+ dim: int
+ num_dp: int
+ factor: float
+ data_covariance: ArrayLike
+ data_inv_cov: ArrayLike
+ covariance: ArrayLike
+ inv_cov: ArrayLike
+ norm_factor: float
+ def __init__(
+ self,
+ dataset: ArrayLike,
+ bw_method: Literal["scott", "silverman"]
+ | float
+ | Callable[[GaussianKDE], float]
+ | None = ...,
+ ) -> None: ...
+ def scotts_factor(self) -> float: ...
+ def silverman_factor(self) -> float: ...
+ def covariance_factor(self) -> float: ...
+ def evaluate(self, points: ArrayLike) -> np.ndarray: ...
+ def __call__(self, points: ArrayLike) -> np.ndarray: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmex10.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmex10.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b9e318ff7f15fe985750b79c63ff0c8d7cdf6e11
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmex10.afm
@@ -0,0 +1,220 @@
+StartFontMetrics 2.0
+Comment Creation Date: Thu Jun 21 22:23:20 1990
+Comment UniqueID 5000774
+FontName CMEX10
+EncodingScheme FontSpecific
+FullName CMEX10
+FamilyName Computer Modern
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+Version 1.00
+Notice Copyright (c) 1997 American Mathematical Society. All Rights Reserved.
+Comment Computer Modern fonts were designed by Donald E. Knuth
+FontBBox -24 -2960 1454 772
+XHeight 430.556
+Comment CapHeight 0
+Ascender 750
+Comment Descender -1760
+Descender -2960
+Comment FontID CMEX
+Comment DesignSize 10 (pts)
+Comment CharacterCodingScheme TeX math extension
+Comment Space 0 0 0
+Comment ExtraSpace 0
+Comment Quad 1000
+Comment DefaultRuleThickness 40
+Comment BigOpSpacing 111.111 166.667 200 600 100
+Comment Ascendible characters (74) % macro - PS charname
+Comment Ascending 0, 16, 18, 32, 48 % ( - parenleft
+Comment Ascending 1, 17, 19, 33, 49 % ) - parenright
+Comment Ascending 2, 104, 20, 34, 50 % [ - bracketleft
+Comment Ascending 3, 105, 21, 35, 51 % ] - bracketright
+Comment Ascending 4, 106, 22, 36, 52 % lfloor - floorleft
+Comment Ascending 5, 107, 23, 37, 53 % rfloor - floorright
+Comment Ascending 6, 108, 24, 38, 54 % lceil - ceilingleft
+Comment Ascending 7, 109, 25, 39, 55 % rceil - ceilingright
+Comment Ascending 8, 110, 26, 40, 56 % { - braceleft
+Comment Ascending 9, 111, 27, 41, 57 % } - braceright
+Comment Ascending 10, 68, 28, 42 % < - anglebracketleft
+Comment Ascending 11, 69, 29, 43 % > - anglebracketright
+Comment Ascending 14, 46, 30, 44 % / - slash
+Comment Ascending 15, 47, 31, 45 % \ - backslash
+Comment Ascending 70, 71 % bigsqcup - unionsq
+Comment Ascending 72, 73 % oint - contintegral
+Comment Ascending 74, 75 % bigodot - circledot
+Comment Ascending 76, 77 % bigoplus - circleplus
+Comment Ascending 78, 79 % bigotimes - circlemultiply
+Comment Ascending 80, 88 % sum - summation
+Comment Ascending 81, 89 % prod - product
+Comment Ascending 82, 90 % int - integral
+Comment Ascending 83, 91 % bigcup - union
+Comment Ascending 84, 92 % bigcap - intersection
+Comment Ascending 85, 93 % biguplus - unionmulti
+Comment Ascending 86, 94 % bigwedge - logicaland
+Comment Ascending 87, 95 % bigvee - logicalor
+Comment Ascending 96, 97 % coprod - coproduct
+Comment Ascending 98, 99, 100 % widehat - hatwide
+Comment Ascending 101, 102, 103 % widetilde - tildewide
+Comment Ascending 112, 113, 114, 115, 116 % radical - sqrt
+Comment Extensible characters (28)
+Comment Extensible 12 top 0 mid 0 bot 0 rep 12 % vert - thin bar
+Comment Extensible 13 top 0 mid 0 bot 0 rep 13 % Vert - thin double bar
+Comment Extensible 48 top 48 mid 0 bot 64 rep 66 % ( - parenleft
+Comment Extensible 49 top 49 mid 0 bot 65 rep 67 % ) - parenright
+Comment Extensible 50 top 50 mid 0 bot 52 rep 54 % [ - bracketleft
+Comment Extensible 51 top 51 mid 0 bot 53 rep 55 % ] - bracketright
+Comment Extensible 52 top 0 mid 0 bot 52 rep 54 % lfloor - floorleft
+Comment Extensible 53 top 0 mid 0 bot 53 rep 55 % rfloor - floorright
+Comment Extensible 54 top 50 mid 0 bot 0 rep 54 % lceil - ceilingleft
+Comment Extensible 55 top 51 mid 0 bot 0 rep 55 % rceil - ceilingright
+Comment Extensible 56 top 56 mid 60 bot 58 rep 62 % { - braceleft
+Comment Extensible 57 top 57 mid 61 bot 59 rep 62 % } - braceright
+Comment Extensible 58 top 56 mid 0 bot 58 rep 62 % lgroup
+Comment Extensible 59 top 57 mid 0 bot 59 rep 62 % rgroup
+Comment Extensible 60 top 0 mid 0 bot 0 rep 63 % arrowvert
+Comment Extensible 61 top 0 mid 0 bot 0 rep 119 % Arrowvert
+Comment Extensible 62 top 0 mid 0 bot 0 rep 62 % bracevert
+Comment Extensible 63 top 120 mid 0 bot 121 rep 63 % updownarrow
+Comment Extensible 64 top 56 mid 0 bot 59 rep 62 % lmoustache
+Comment Extensible 65 top 57 mid 0 bot 58 rep 62 % rmoustache
+Comment Extensible 66 top 0 mid 0 bot 0 rep 66 % parenleftexten
+Comment Extensible 67 top 0 mid 0 bot 0 rep 67 % parenrightexten
+Comment Extensible 116 top 118 mid 0 bot 116 rep 117 % radical
+Comment Extensible 119 top 126 mid 0 bot 127 rep 119 % Updownarrow
+Comment Extensible 120 top 120 mid 0 bot 0 rep 63 % uparrow
+Comment Extensible 121 top 0 mid 0 bot 121 rep 63 % downarrow
+Comment Extensible 126 top 126 mid 0 bot 0 rep 119 % Uparrow
+Comment Extensible 127 top 0 mid 0 bot 127 rep 119 % Downarrow
+StartCharMetrics 129
+C 0 ; WX 458.333 ; N parenleftbig ; B 152 -1159 413 40 ;
+C 1 ; WX 458.333 ; N parenrightbig ; B 44 -1159 305 40 ;
+C 2 ; WX 416.667 ; N bracketleftbig ; B 202 -1159 394 40 ;
+C 3 ; WX 416.667 ; N bracketrightbig ; B 22 -1159 214 40 ;
+C 4 ; WX 472.222 ; N floorleftbig ; B 202 -1159 449 40 ;
+C 5 ; WX 472.222 ; N floorrightbig ; B 22 -1159 269 40 ;
+C 6 ; WX 472.222 ; N ceilingleftbig ; B 202 -1159 449 40 ;
+C 7 ; WX 472.222 ; N ceilingrightbig ; B 22 -1159 269 40 ;
+C 8 ; WX 583.333 ; N braceleftbig ; B 113 -1159 469 40 ;
+C 9 ; WX 583.333 ; N bracerightbig ; B 113 -1159 469 40 ;
+C 10 ; WX 472.222 ; N angbracketleftbig ; B 98 -1160 393 40 ;
+C 11 ; WX 472.222 ; N angbracketrightbig ; B 78 -1160 373 40 ;
+C 12 ; WX 333.333 ; N vextendsingle ; B 145 -621 188 21 ;
+C 13 ; WX 555.556 ; N vextenddouble ; B 145 -621 410 21 ;
+C 14 ; WX 577.778 ; N slashbig ; B 56 -1159 521 40 ;
+C 15 ; WX 577.778 ; N backslashbig ; B 56 -1159 521 40 ;
+C 16 ; WX 597.222 ; N parenleftBig ; B 180 -1759 560 40 ;
+C 17 ; WX 597.222 ; N parenrightBig ; B 36 -1759 416 40 ;
+C 18 ; WX 736.111 ; N parenleftbigg ; B 208 -2359 700 40 ;
+C 19 ; WX 736.111 ; N parenrightbigg ; B 35 -2359 527 40 ;
+C 20 ; WX 527.778 ; N bracketleftbigg ; B 250 -2359 513 40 ;
+C 21 ; WX 527.778 ; N bracketrightbigg ; B 14 -2359 277 40 ;
+C 22 ; WX 583.333 ; N floorleftbigg ; B 250 -2359 568 40 ;
+C 23 ; WX 583.333 ; N floorrightbigg ; B 14 -2359 332 40 ;
+C 24 ; WX 583.333 ; N ceilingleftbigg ; B 250 -2359 568 40 ;
+C 25 ; WX 583.333 ; N ceilingrightbigg ; B 14 -2359 332 40 ;
+C 26 ; WX 750 ; N braceleftbigg ; B 131 -2359 618 40 ;
+C 27 ; WX 750 ; N bracerightbigg ; B 131 -2359 618 40 ;
+C 28 ; WX 750 ; N angbracketleftbigg ; B 125 -2359 652 40 ;
+C 29 ; WX 750 ; N angbracketrightbigg ; B 97 -2359 624 40 ;
+C 30 ; WX 1044.44 ; N slashbigg ; B 56 -2359 987 40 ;
+C 31 ; WX 1044.44 ; N backslashbigg ; B 56 -2359 987 40 ;
+C 32 ; WX 791.667 ; N parenleftBigg ; B 236 -2959 757 40 ;
+C 33 ; WX 791.667 ; N parenrightBigg ; B 34 -2959 555 40 ;
+C 34 ; WX 583.333 ; N bracketleftBigg ; B 275 -2959 571 40 ;
+C 35 ; WX 583.333 ; N bracketrightBigg ; B 11 -2959 307 40 ;
+C 36 ; WX 638.889 ; N floorleftBigg ; B 275 -2959 627 40 ;
+C 37 ; WX 638.889 ; N floorrightBigg ; B 11 -2959 363 40 ;
+C 38 ; WX 638.889 ; N ceilingleftBigg ; B 275 -2959 627 40 ;
+C 39 ; WX 638.889 ; N ceilingrightBigg ; B 11 -2959 363 40 ;
+C 40 ; WX 805.556 ; N braceleftBigg ; B 144 -2959 661 40 ;
+C 41 ; WX 805.556 ; N bracerightBigg ; B 144 -2959 661 40 ;
+C 42 ; WX 805.556 ; N angbracketleftBigg ; B 139 -2960 697 40 ;
+C 43 ; WX 805.556 ; N angbracketrightBigg ; B 108 -2960 666 40 ;
+C 44 ; WX 1277.78 ; N slashBigg ; B 56 -2959 1221 40 ;
+C 45 ; WX 1277.78 ; N backslashBigg ; B 56 -2959 1221 40 ;
+C 46 ; WX 811.111 ; N slashBig ; B 56 -1759 754 40 ;
+C 47 ; WX 811.111 ; N backslashBig ; B 56 -1759 754 40 ;
+C 48 ; WX 875 ; N parenlefttp ; B 291 -1770 842 39 ;
+C 49 ; WX 875 ; N parenrighttp ; B 32 -1770 583 39 ;
+C 50 ; WX 666.667 ; N bracketlefttp ; B 326 -1760 659 39 ;
+C 51 ; WX 666.667 ; N bracketrighttp ; B 7 -1760 340 39 ;
+C 52 ; WX 666.667 ; N bracketleftbt ; B 326 -1759 659 40 ;
+C 53 ; WX 666.667 ; N bracketrightbt ; B 7 -1759 340 40 ;
+C 54 ; WX 666.667 ; N bracketleftex ; B 326 -601 395 1 ;
+C 55 ; WX 666.667 ; N bracketrightex ; B 271 -601 340 1 ;
+C 56 ; WX 888.889 ; N bracelefttp ; B 384 -910 718 -1 ;
+C 57 ; WX 888.889 ; N bracerighttp ; B 170 -910 504 -1 ;
+C 58 ; WX 888.889 ; N braceleftbt ; B 384 -899 718 10 ;
+C 59 ; WX 888.889 ; N bracerightbt ; B 170 -899 504 10 ;
+C 60 ; WX 888.889 ; N braceleftmid ; B 170 -1810 504 10 ;
+C 61 ; WX 888.889 ; N bracerightmid ; B 384 -1810 718 10 ;
+C 62 ; WX 888.889 ; N braceex ; B 384 -310 504 10 ;
+C 63 ; WX 666.667 ; N arrowvertex ; B 312 -601 355 1 ;
+C 64 ; WX 875 ; N parenleftbt ; B 291 -1759 842 50 ;
+C 65 ; WX 875 ; N parenrightbt ; B 32 -1759 583 50 ;
+C 66 ; WX 875 ; N parenleftex ; B 291 -610 402 10 ;
+C 67 ; WX 875 ; N parenrightex ; B 472 -610 583 10 ;
+C 68 ; WX 611.111 ; N angbracketleftBig ; B 112 -1759 522 40 ;
+C 69 ; WX 611.111 ; N angbracketrightBig ; B 88 -1759 498 40 ;
+C 70 ; WX 833.333 ; N unionsqtext ; B 56 -1000 776 0 ;
+C 71 ; WX 1111.11 ; N unionsqdisplay ; B 56 -1400 1054 0 ;
+C 72 ; WX 472.222 ; N contintegraltext ; B 56 -1111 609 0 ;
+C 73 ; WX 555.556 ; N contintegraldisplay ; B 56 -2222 943 0 ;
+C 74 ; WX 1111.11 ; N circledottext ; B 56 -1000 1054 0 ;
+C 75 ; WX 1511.11 ; N circledotdisplay ; B 56 -1400 1454 0 ;
+C 76 ; WX 1111.11 ; N circleplustext ; B 56 -1000 1054 0 ;
+C 77 ; WX 1511.11 ; N circleplusdisplay ; B 56 -1400 1454 0 ;
+C 78 ; WX 1111.11 ; N circlemultiplytext ; B 56 -1000 1054 0 ;
+C 79 ; WX 1511.11 ; N circlemultiplydisplay ; B 56 -1400 1454 0 ;
+C 80 ; WX 1055.56 ; N summationtext ; B 56 -1000 999 0 ;
+C 81 ; WX 944.444 ; N producttext ; B 56 -1000 887 0 ;
+C 82 ; WX 472.222 ; N integraltext ; B 56 -1111 609 0 ;
+C 83 ; WX 833.333 ; N uniontext ; B 56 -1000 776 0 ;
+C 84 ; WX 833.333 ; N intersectiontext ; B 56 -1000 776 0 ;
+C 85 ; WX 833.333 ; N unionmultitext ; B 56 -1000 776 0 ;
+C 86 ; WX 833.333 ; N logicalandtext ; B 56 -1000 776 0 ;
+C 87 ; WX 833.333 ; N logicalortext ; B 56 -1000 776 0 ;
+C 88 ; WX 1444.44 ; N summationdisplay ; B 56 -1400 1387 0 ;
+C 89 ; WX 1277.78 ; N productdisplay ; B 56 -1400 1221 0 ;
+C 90 ; WX 555.556 ; N integraldisplay ; B 56 -2222 943 0 ;
+C 91 ; WX 1111.11 ; N uniondisplay ; B 56 -1400 1054 0 ;
+C 92 ; WX 1111.11 ; N intersectiondisplay ; B 56 -1400 1054 0 ;
+C 93 ; WX 1111.11 ; N unionmultidisplay ; B 56 -1400 1054 0 ;
+C 94 ; WX 1111.11 ; N logicalanddisplay ; B 56 -1400 1054 0 ;
+C 95 ; WX 1111.11 ; N logicalordisplay ; B 56 -1400 1054 0 ;
+C 96 ; WX 944.444 ; N coproducttext ; B 56 -1000 887 0 ;
+C 97 ; WX 1277.78 ; N coproductdisplay ; B 56 -1400 1221 0 ;
+C 98 ; WX 555.556 ; N hatwide ; B -5 562 561 744 ;
+C 99 ; WX 1000 ; N hatwider ; B -4 575 1003 772 ;
+C 100 ; WX 1444.44 ; N hatwidest ; B -3 575 1446 772 ;
+C 101 ; WX 555.556 ; N tildewide ; B 0 608 555 722 ;
+C 102 ; WX 1000 ; N tildewider ; B 0 624 999 750 ;
+C 103 ; WX 1444.44 ; N tildewidest ; B 0 623 1443 750 ;
+C 104 ; WX 472.222 ; N bracketleftBig ; B 226 -1759 453 40 ;
+C 105 ; WX 472.222 ; N bracketrightBig ; B 18 -1759 245 40 ;
+C 106 ; WX 527.778 ; N floorleftBig ; B 226 -1759 509 40 ;
+C 107 ; WX 527.778 ; N floorrightBig ; B 18 -1759 301 40 ;
+C 108 ; WX 527.778 ; N ceilingleftBig ; B 226 -1759 509 40 ;
+C 109 ; WX 527.778 ; N ceilingrightBig ; B 18 -1759 301 40 ;
+C 110 ; WX 666.667 ; N braceleftBig ; B 119 -1759 547 40 ;
+C 111 ; WX 666.667 ; N bracerightBig ; B 119 -1759 547 40 ;
+C 112 ; WX 1000 ; N radicalbig ; B 110 -1160 1020 40 ;
+C 113 ; WX 1000 ; N radicalBig ; B 110 -1760 1020 40 ;
+C 114 ; WX 1000 ; N radicalbigg ; B 111 -2360 1020 40 ;
+C 115 ; WX 1000 ; N radicalBigg ; B 111 -2960 1020 40 ;
+C 116 ; WX 1055.56 ; N radicalbt ; B 111 -1800 742 20 ;
+C 117 ; WX 1055.56 ; N radicalvertex ; B 702 -620 742 20 ;
+C 118 ; WX 1055.56 ; N radicaltp ; B 702 -580 1076 40 ;
+C 119 ; WX 777.778 ; N arrowvertexdbl ; B 257 -601 521 1 ;
+C 120 ; WX 666.667 ; N arrowtp ; B 111 -600 556 0 ;
+C 121 ; WX 666.667 ; N arrowbt ; B 111 -600 556 0 ;
+C 122 ; WX 450 ; N bracehtipdownleft ; B -24 -214 460 120 ;
+C 123 ; WX 450 ; N bracehtipdownright ; B -10 -214 474 120 ;
+C 124 ; WX 450 ; N bracehtipupleft ; B -24 0 460 334 ;
+C 125 ; WX 450 ; N bracehtipupright ; B -10 0 474 334 ;
+C 126 ; WX 777.778 ; N arrowdbltp ; B 56 -600 722 -1 ;
+C 127 ; WX 777.778 ; N arrowdblbt ; B 56 -599 722 0 ;
+C -1 ; WX 333.333 ; N space ; B 0 0 0 0 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmmi10.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmmi10.afm
new file mode 100644
index 0000000000000000000000000000000000000000..f47d6ba04d6c94d7bf378263056df54c6a838143
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmmi10.afm
@@ -0,0 +1,326 @@
+StartFontMetrics 2.0
+Comment Creation Date: Thu Jun 21 22:23:22 1990
+Comment UniqueID 5000785
+FontName CMMI10
+EncodingScheme FontSpecific
+FullName CMMI10
+FamilyName Computer Modern
+Weight Medium
+ItalicAngle -14.04
+IsFixedPitch false
+Version 1.00A
+Notice Copyright (c) 1997 American Mathematical Society. All Rights Reserved.
+Comment Computer Modern fonts were designed by Donald E. Knuth
+FontBBox -32 -250 1048 750
+CapHeight 683.333
+XHeight 430.556
+Ascender 694.444
+Descender -194.444
+Comment FontID CMMI
+Comment DesignSize 10 (pts)
+Comment CharacterCodingScheme TeX math italic
+Comment Space 0 0 0
+Comment Quad 1000
+StartCharMetrics 129
+C 0 ; WX 615.276 ; N Gamma ; B 39 0 723 680 ;
+C 1 ; WX 833.333 ; N Delta ; B 49 0 787 716 ;
+C 2 ; WX 762.774 ; N Theta ; B 50 -22 739 705 ;
+C 3 ; WX 694.444 ; N Lambda ; B 35 0 666 716 ;
+C 4 ; WX 742.361 ; N Xi ; B 53 0 777 677 ;
+C 5 ; WX 831.25 ; N Pi ; B 39 0 880 680 ;
+C 6 ; WX 779.861 ; N Sigma ; B 59 0 807 683 ;
+C 7 ; WX 583.333 ; N Upsilon ; B 29 0 700 705 ;
+C 8 ; WX 666.667 ; N Phi ; B 24 0 642 683 ;
+C 9 ; WX 612.221 ; N Psi ; B 28 0 692 683 ;
+C 10 ; WX 772.396 ; N Omega ; B 80 0 785 705 ;
+C 11 ; WX 639.7 ; N alpha ; B 41 -11 601 442 ;
+C 12 ; WX 565.625 ; N beta ; B 25 -194 590 705 ;
+C 13 ; WX 517.73 ; N gamma ; B 18 -215 542 442 ;
+C 14 ; WX 444.444 ; N delta ; B 41 -12 452 705 ;
+C 15 ; WX 405.902 ; N epsilon1 ; B 47 -11 376 431 ;
+C 16 ; WX 437.5 ; N zeta ; B 47 -205 474 697 ;
+C 17 ; WX 496.53 ; N eta ; B 29 -216 496 442 ;
+C 18 ; WX 469.442 ; N theta ; B 42 -11 455 705 ;
+C 19 ; WX 353.935 ; N iota ; B 56 -11 324 442 ;
+C 20 ; WX 576.159 ; N kappa ; B 55 -11 546 442 ;
+C 21 ; WX 583.333 ; N lambda ; B 53 -13 547 694 ;
+C 22 ; WX 602.548 ; N mu ; B 30 -216 572 442 ;
+C 23 ; WX 493.981 ; N nu ; B 53 0 524 442 ;
+C 24 ; WX 437.5 ; N xi ; B 24 -205 446 697 ;
+C 25 ; WX 570.025 ; N pi ; B 27 -11 567 431 ;
+C 26 ; WX 517.014 ; N rho ; B 30 -216 502 442 ;
+C 27 ; WX 571.429 ; N sigma ; B 38 -11 567 431 ;
+C 28 ; WX 437.153 ; N tau ; B 27 -12 511 431 ;
+C 29 ; WX 540.278 ; N upsilon ; B 29 -11 524 443 ;
+C 30 ; WX 595.833 ; N phi ; B 49 -205 573 694 ;
+C 31 ; WX 625.691 ; N chi ; B 32 -205 594 442 ;
+C 32 ; WX 651.39 ; N psi ; B 29 -205 635 694 ;
+C 33 ; WX 622.453 ; N omega ; B 13 -11 605 443 ;
+C 34 ; WX 466.316 ; N epsilon ; B 27 -22 428 453 ;
+C 35 ; WX 591.438 ; N theta1 ; B 29 -11 561 705 ;
+C 36 ; WX 828.125 ; N pi1 ; B 27 -11 817 431 ;
+C 37 ; WX 517.014 ; N rho1 ; B 74 -194 502 442 ;
+C 38 ; WX 362.846 ; N sigma1 ; B 32 -108 408 442 ;
+C 39 ; WX 654.165 ; N phi1 ; B 50 -218 619 442 ;
+C 40 ; WX 1000 ; N arrowlefttophalf ; B 56 230 943 428 ;
+C 41 ; WX 1000 ; N arrowleftbothalf ; B 56 72 943 270 ;
+C 42 ; WX 1000 ; N arrowrighttophalf ; B 56 230 943 428 ;
+C 43 ; WX 1000 ; N arrowrightbothalf ; B 56 72 943 270 ;
+C 44 ; WX 277.778 ; N arrowhookleft ; B 56 230 221 464 ;
+C 45 ; WX 277.778 ; N arrowhookright ; B 56 230 221 464 ;
+C 46 ; WX 500 ; N triangleright ; B 27 -4 472 504 ;
+C 47 ; WX 500 ; N triangleleft ; B 27 -4 472 504 ;
+C 48 ; WX 500 ; N zerooldstyle ; B 40 -22 459 453 ;
+C 49 ; WX 500 ; N oneoldstyle ; B 92 0 418 453 ;
+C 50 ; WX 500 ; N twooldstyle ; B 44 0 449 453 ;
+C 51 ; WX 500 ; N threeoldstyle ; B 42 -216 457 453 ;
+C 52 ; WX 500 ; N fouroldstyle ; B 28 -194 471 464 ;
+C 53 ; WX 500 ; N fiveoldstyle ; B 50 -216 449 453 ;
+C 54 ; WX 500 ; N sixoldstyle ; B 42 -22 457 666 ;
+C 55 ; WX 500 ; N sevenoldstyle ; B 56 -216 485 463 ;
+C 56 ; WX 500 ; N eightoldstyle ; B 42 -22 457 666 ;
+C 57 ; WX 500 ; N nineoldstyle ; B 42 -216 457 453 ;
+C 58 ; WX 277.778 ; N period ; B 86 0 192 106 ;
+C 59 ; WX 277.778 ; N comma ; B 86 -193 203 106 ;
+C 60 ; WX 777.778 ; N less ; B 83 -39 694 539 ;
+C 61 ; WX 500 ; N slash ; B 56 -250 443 750 ;
+C 62 ; WX 777.778 ; N greater ; B 83 -39 694 539 ;
+C 63 ; WX 500 ; N star ; B 4 16 496 486 ;
+C 64 ; WX 530.902 ; N partialdiff ; B 40 -22 566 716 ;
+C 65 ; WX 750 ; N A ; B 35 0 722 716 ;
+C 66 ; WX 758.508 ; N B ; B 42 0 756 683 ;
+C 67 ; WX 714.72 ; N C ; B 51 -22 759 705 ;
+C 68 ; WX 827.915 ; N D ; B 41 0 803 683 ;
+C 69 ; WX 738.193 ; N E ; B 39 0 765 680 ;
+C 70 ; WX 643.055 ; N F ; B 39 0 751 680 ;
+C 71 ; WX 786.247 ; N G ; B 51 -22 760 705 ;
+C 72 ; WX 831.25 ; N H ; B 39 0 881 683 ;
+C 73 ; WX 439.583 ; N I ; B 34 0 498 683 ;
+C 74 ; WX 554.512 ; N J ; B 73 -22 633 683 ;
+C 75 ; WX 849.305 ; N K ; B 39 0 889 683 ;
+C 76 ; WX 680.556 ; N L ; B 39 0 643 683 ;
+C 77 ; WX 970.138 ; N M ; B 43 0 1044 683 ;
+C 78 ; WX 803.471 ; N N ; B 39 0 881 683 ;
+C 79 ; WX 762.774 ; N O ; B 50 -22 739 705 ;
+C 80 ; WX 642.012 ; N P ; B 41 0 753 683 ;
+C 81 ; WX 790.553 ; N Q ; B 50 -194 739 705 ;
+C 82 ; WX 759.288 ; N R ; B 41 -22 755 683 ;
+C 83 ; WX 613.193 ; N S ; B 53 -22 645 705 ;
+C 84 ; WX 584.375 ; N T ; B 24 0 704 677 ;
+C 85 ; WX 682.776 ; N U ; B 68 -22 760 683 ;
+C 86 ; WX 583.333 ; N V ; B 56 -22 769 683 ;
+C 87 ; WX 944.444 ; N W ; B 55 -22 1048 683 ;
+C 88 ; WX 828.472 ; N X ; B 27 0 851 683 ;
+C 89 ; WX 580.556 ; N Y ; B 34 0 762 683 ;
+C 90 ; WX 682.638 ; N Z ; B 59 0 722 683 ;
+C 91 ; WX 388.889 ; N flat ; B 56 -22 332 750 ;
+C 92 ; WX 388.889 ; N natural ; B 79 -217 309 728 ;
+C 93 ; WX 388.889 ; N sharp ; B 56 -216 332 716 ;
+C 94 ; WX 1000 ; N slurbelow ; B 56 133 943 371 ;
+C 95 ; WX 1000 ; N slurabove ; B 56 130 943 381 ;
+C 96 ; WX 416.667 ; N lscript ; B 11 -12 398 705 ;
+C 97 ; WX 528.588 ; N a ; B 40 -11 498 442 ;
+C 98 ; WX 429.165 ; N b ; B 47 -11 415 694 ;
+C 99 ; WX 432.755 ; N c ; B 41 -11 430 442 ;
+C 100 ; WX 520.486 ; N d ; B 40 -11 517 694 ;
+C 101 ; WX 465.625 ; N e ; B 46 -11 430 442 ;
+C 102 ; WX 489.583 ; N f ; B 53 -205 552 705 ;
+C 103 ; WX 476.967 ; N g ; B 16 -205 474 442 ;
+C 104 ; WX 576.159 ; N h ; B 55 -11 546 694 ;
+C 105 ; WX 344.511 ; N i ; B 29 -11 293 661 ;
+C 106 ; WX 411.805 ; N j ; B -13 -205 397 661 ;
+C 107 ; WX 520.602 ; N k ; B 55 -11 508 694 ;
+C 108 ; WX 298.378 ; N l ; B 46 -11 260 694 ;
+C 109 ; WX 878.012 ; N m ; B 29 -11 848 442 ;
+C 110 ; WX 600.233 ; N n ; B 29 -11 571 442 ;
+C 111 ; WX 484.721 ; N o ; B 41 -11 469 442 ;
+C 112 ; WX 503.125 ; N p ; B -32 -194 490 442 ;
+C 113 ; WX 446.412 ; N q ; B 40 -194 453 442 ;
+C 114 ; WX 451.158 ; N r ; B 29 -11 436 442 ;
+C 115 ; WX 468.75 ; N s ; B 52 -11 419 442 ;
+C 116 ; WX 361.111 ; N t ; B 23 -11 330 626 ;
+C 117 ; WX 572.456 ; N u ; B 29 -11 543 442 ;
+C 118 ; WX 484.722 ; N v ; B 29 -11 468 443 ;
+C 119 ; WX 715.916 ; N w ; B 29 -11 691 443 ;
+C 120 ; WX 571.527 ; N x ; B 29 -11 527 442 ;
+C 121 ; WX 490.28 ; N y ; B 29 -205 490 442 ;
+C 122 ; WX 465.048 ; N z ; B 43 -11 467 442 ;
+C 123 ; WX 322.454 ; N dotlessi ; B 29 -11 293 442 ;
+C 124 ; WX 384.028 ; N dotlessj ; B -13 -205 360 442 ;
+C 125 ; WX 636.457 ; N weierstrass ; B 76 -216 618 453 ;
+C 126 ; WX 500 ; N vector ; B 182 516 625 714 ;
+C 127 ; WX 277.778 ; N tie ; B 264 538 651 665 ;
+C -1 ; WX 333.333 ; N space ; B 0 0 0 0 ;
+EndCharMetrics
+Comment The following are bogus kern pairs for TeX positioning of accents
+StartKernData
+StartKernPairs 166
+KPX Gamma slash -55.556
+KPX Gamma comma -111.111
+KPX Gamma period -111.111
+KPX Gamma tie 83.333
+KPX Delta tie 166.667
+KPX Theta tie 83.333
+KPX Lambda tie 166.667
+KPX Xi tie 83.333
+KPX Pi slash -55.556
+KPX Pi comma -55.556
+KPX Pi period -55.556
+KPX Pi tie 55.556
+KPX Sigma tie 83.333
+KPX Upsilon slash -55.556
+KPX Upsilon comma -111.111
+KPX Upsilon period -111.111
+KPX Upsilon tie 55.556
+KPX Phi tie 83.333
+KPX Psi slash -55.556
+KPX Psi comma -55.556
+KPX Psi period -55.556
+KPX Psi tie 55.556
+KPX Omega tie 83.333
+KPX alpha tie 27.778
+KPX beta tie 83.333
+KPX delta comma -55.556
+KPX delta period -55.556
+KPX delta tie 55.556
+KPX epsilon1 tie 55.556
+KPX zeta tie 83.333
+KPX eta tie 55.556
+KPX theta tie 83.333
+KPX iota tie 55.556
+KPX mu tie 27.778
+KPX nu comma -55.556
+KPX nu period -55.556
+KPX nu tie 27.778
+KPX xi tie 111.111
+KPX rho tie 83.333
+KPX sigma comma -55.556
+KPX sigma period -55.556
+KPX tau comma -55.556
+KPX tau period -55.556
+KPX tau tie 27.778
+KPX upsilon tie 27.778
+KPX phi tie 83.333
+KPX chi tie 55.556
+KPX psi tie 111.111
+KPX epsilon tie 83.333
+KPX theta1 tie 83.333
+KPX rho1 tie 83.333
+KPX sigma1 tie 83.333
+KPX phi1 tie 83.333
+KPX slash Delta -55.556
+KPX slash A -55.556
+KPX slash M -55.556
+KPX slash N -55.556
+KPX slash Y 55.556
+KPX slash Z -55.556
+KPX partialdiff tie 83.333
+KPX A tie 138.889
+KPX B tie 83.333
+KPX C slash -27.778
+KPX C comma -55.556
+KPX C period -55.556
+KPX C tie 83.333
+KPX D tie 55.556
+KPX E tie 83.333
+KPX F slash -55.556
+KPX F comma -111.111
+KPX F period -111.111
+KPX F tie 83.333
+KPX G tie 83.333
+KPX H slash -55.556
+KPX H comma -55.556
+KPX H period -55.556
+KPX H tie 55.556
+KPX I tie 111.111
+KPX J slash -55.556
+KPX J comma -111.111
+KPX J period -111.111
+KPX J tie 166.667
+KPX K slash -55.556
+KPX K comma -55.556
+KPX K period -55.556
+KPX K tie 55.556
+KPX L tie 27.778
+KPX M slash -55.556
+KPX M comma -55.556
+KPX M period -55.556
+KPX M tie 83.333
+KPX N slash -83.333
+KPX N slash -27.778
+KPX N comma -55.556
+KPX N period -55.556
+KPX N tie 83.333
+KPX O tie 83.333
+KPX P slash -55.556
+KPX P comma -111.111
+KPX P period -111.111
+KPX P tie 83.333
+KPX Q tie 83.333
+KPX R tie 83.333
+KPX S slash -55.556
+KPX S comma -55.556
+KPX S period -55.556
+KPX S tie 83.333
+KPX T slash -27.778
+KPX T comma -55.556
+KPX T period -55.556
+KPX T tie 83.333
+KPX U comma -111.111
+KPX U period -111.111
+KPX U slash -55.556
+KPX U tie 27.778
+KPX V comma -166.667
+KPX V period -166.667
+KPX V slash -111.111
+KPX W comma -166.667
+KPX W period -166.667
+KPX W slash -111.111
+KPX X slash -83.333
+KPX X slash -27.778
+KPX X comma -55.556
+KPX X period -55.556
+KPX X tie 83.333
+KPX Y comma -166.667
+KPX Y period -166.667
+KPX Y slash -111.111
+KPX Z slash -55.556
+KPX Z comma -55.556
+KPX Z period -55.556
+KPX Z tie 83.333
+KPX lscript tie 111.111
+KPX c tie 55.556
+KPX d Y 55.556
+KPX d Z -55.556
+KPX d j -111.111
+KPX d f -166.667
+KPX d tie 166.667
+KPX e tie 55.556
+KPX f comma -55.556
+KPX f period -55.556
+KPX f tie 166.667
+KPX g tie 27.778
+KPX h tie -27.778
+KPX j comma -55.556
+KPX j period -55.556
+KPX l tie 83.333
+KPX o tie 55.556
+KPX p tie 83.333
+KPX q tie 83.333
+KPX r comma -55.556
+KPX r period -55.556
+KPX r tie 55.556
+KPX s tie 55.556
+KPX t tie 83.333
+KPX u tie 27.778
+KPX v tie 27.778
+KPX w tie 83.333
+KPX x tie 27.778
+KPX y tie 55.556
+KPX z tie 55.556
+KPX dotlessi tie 27.778
+KPX dotlessj tie 83.333
+KPX weierstrass tie 111.111
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmr10.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmr10.afm
new file mode 100644
index 0000000000000000000000000000000000000000..4d586fe6ff39e83c73fa0358b31737ce4ac9fb98
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmr10.afm
@@ -0,0 +1,343 @@
+StartFontMetrics 2.0
+Comment Creation Date: Thu Jun 21 22:23:28 1990
+Comment UniqueID 5000793
+FontName CMR10
+EncodingScheme FontSpecific
+FullName CMR10
+FamilyName Computer Modern
+Weight Medium
+ItalicAngle 0.0
+IsFixedPitch false
+Version 1.00B
+Notice Copyright (c) 1997 American Mathematical Society. All Rights Reserved.
+Comment Computer Modern fonts were designed by Donald E. Knuth
+FontBBox -40 -250 1009 969
+CapHeight 683.333
+XHeight 430.556
+Ascender 694.444
+Descender -194.444
+Comment FontID CMR
+Comment DesignSize 10 (pts)
+Comment CharacterCodingScheme TeX text
+Comment Space 333.333 166.667 111.111
+Comment ExtraSpace 111.111
+Comment Quad 1000
+StartCharMetrics 129
+C 0 ; WX 625 ; N Gamma ; B 33 0 582 680 ;
+C 1 ; WX 833.333 ; N Delta ; B 47 0 785 716 ;
+C 2 ; WX 777.778 ; N Theta ; B 56 -22 721 705 ;
+C 3 ; WX 694.444 ; N Lambda ; B 32 0 661 716 ;
+C 4 ; WX 666.667 ; N Xi ; B 42 0 624 677 ;
+C 5 ; WX 750 ; N Pi ; B 33 0 716 680 ;
+C 6 ; WX 722.222 ; N Sigma ; B 56 0 665 683 ;
+C 7 ; WX 777.778 ; N Upsilon ; B 56 0 721 705 ;
+C 8 ; WX 722.222 ; N Phi ; B 56 0 665 683 ;
+C 9 ; WX 777.778 ; N Psi ; B 57 0 720 683 ;
+C 10 ; WX 722.222 ; N Omega ; B 44 0 677 705 ;
+C 11 ; WX 583.333 ; N ff ; B 27 0 628 705 ; L i ffi ; L l ffl ;
+C 12 ; WX 555.556 ; N fi ; B 27 0 527 705 ;
+C 13 ; WX 555.556 ; N fl ; B 27 0 527 705 ;
+C 14 ; WX 833.333 ; N ffi ; B 27 0 804 705 ;
+C 15 ; WX 833.333 ; N ffl ; B 27 0 804 705 ;
+C 16 ; WX 277.778 ; N dotlessi ; B 33 0 247 442 ;
+C 17 ; WX 305.556 ; N dotlessj ; B -40 -205 210 442 ;
+C 18 ; WX 500 ; N grave ; B 107 510 293 698 ;
+C 19 ; WX 500 ; N acute ; B 206 510 392 698 ;
+C 20 ; WX 500 ; N caron ; B 118 516 381 638 ;
+C 21 ; WX 500 ; N breve ; B 100 522 399 694 ;
+C 22 ; WX 500 ; N macron ; B 69 559 430 590 ;
+C 23 ; WX 750 ; N ring ; B 279 541 470 716 ;
+C 24 ; WX 444.444 ; N cedilla ; B 131 -203 367 -22 ;
+C 25 ; WX 500 ; N germandbls ; B 28 -11 471 705 ;
+C 26 ; WX 722.222 ; N ae ; B 45 -11 693 448 ;
+C 27 ; WX 777.778 ; N oe ; B 28 -11 749 448 ;
+C 28 ; WX 500 ; N oslash ; B 35 -102 464 534 ;
+C 29 ; WX 902.778 ; N AE ; B 32 0 874 683 ;
+C 30 ; WX 1013.89 ; N OE ; B 70 -22 985 705 ;
+C 31 ; WX 777.778 ; N Oslash ; B 56 -56 721 739 ;
+C 32 ; WX 277.778 ; N suppress ; B 27 280 262 392 ;
+C 33 ; WX 277.778 ; N exclam ; B 86 0 192 716 ; L quoteleft exclamdown ;
+C 34 ; WX 500 ; N quotedblright ; B 33 395 347 694 ;
+C 35 ; WX 833.333 ; N numbersign ; B 56 -194 776 694 ;
+C 36 ; WX 500 ; N dollar ; B 56 -56 443 750 ;
+C 37 ; WX 833.333 ; N percent ; B 56 -56 776 750 ;
+C 38 ; WX 777.778 ; N ampersand ; B 42 -22 727 716 ;
+C 39 ; WX 277.778 ; N quoteright ; B 86 395 206 694 ; L quoteright quotedblright ;
+C 40 ; WX 388.889 ; N parenleft ; B 99 -250 331 750 ;
+C 41 ; WX 388.889 ; N parenright ; B 57 -250 289 750 ;
+C 42 ; WX 500 ; N asterisk ; B 65 319 434 750 ;
+C 43 ; WX 777.778 ; N plus ; B 56 -83 721 583 ;
+C 44 ; WX 277.778 ; N comma ; B 86 -193 203 106 ;
+C 45 ; WX 333.333 ; N hyphen ; B 11 187 276 245 ; L hyphen endash ;
+C 46 ; WX 277.778 ; N period ; B 86 0 192 106 ;
+C 47 ; WX 500 ; N slash ; B 56 -250 443 750 ;
+C 48 ; WX 500 ; N zero ; B 39 -22 460 666 ;
+C 49 ; WX 500 ; N one ; B 89 0 419 666 ;
+C 50 ; WX 500 ; N two ; B 50 0 449 666 ;
+C 51 ; WX 500 ; N three ; B 42 -22 457 666 ;
+C 52 ; WX 500 ; N four ; B 28 0 471 677 ;
+C 53 ; WX 500 ; N five ; B 50 -22 449 666 ;
+C 54 ; WX 500 ; N six ; B 42 -22 457 666 ;
+C 55 ; WX 500 ; N seven ; B 56 -22 485 676 ;
+C 56 ; WX 500 ; N eight ; B 42 -22 457 666 ;
+C 57 ; WX 500 ; N nine ; B 42 -22 457 666 ;
+C 58 ; WX 277.778 ; N colon ; B 86 0 192 431 ;
+C 59 ; WX 277.778 ; N semicolon ; B 86 -193 195 431 ;
+C 60 ; WX 277.778 ; N exclamdown ; B 86 -216 192 500 ;
+C 61 ; WX 777.778 ; N equal ; B 56 133 721 367 ;
+C 62 ; WX 472.222 ; N questiondown ; B 56 -205 415 500 ;
+C 63 ; WX 472.222 ; N question ; B 56 0 415 705 ; L quoteleft questiondown ;
+C 64 ; WX 777.778 ; N at ; B 56 -11 721 705 ;
+C 65 ; WX 750 ; N A ; B 32 0 717 716 ;
+C 66 ; WX 708.333 ; N B ; B 36 0 651 683 ;
+C 67 ; WX 722.222 ; N C ; B 56 -22 665 705 ;
+C 68 ; WX 763.889 ; N D ; B 35 0 707 683 ;
+C 69 ; WX 680.556 ; N E ; B 33 0 652 680 ;
+C 70 ; WX 652.778 ; N F ; B 33 0 610 680 ;
+C 71 ; WX 784.722 ; N G ; B 56 -22 735 705 ;
+C 72 ; WX 750 ; N H ; B 33 0 716 683 ;
+C 73 ; WX 361.111 ; N I ; B 28 0 333 683 ;
+C 74 ; WX 513.889 ; N J ; B 41 -22 465 683 ;
+C 75 ; WX 777.778 ; N K ; B 33 0 736 683 ;
+C 76 ; WX 625 ; N L ; B 33 0 582 683 ;
+C 77 ; WX 916.667 ; N M ; B 37 0 879 683 ;
+C 78 ; WX 750 ; N N ; B 33 0 716 683 ;
+C 79 ; WX 777.778 ; N O ; B 56 -22 721 705 ;
+C 80 ; WX 680.556 ; N P ; B 35 0 624 683 ;
+C 81 ; WX 777.778 ; N Q ; B 56 -194 727 705 ;
+C 82 ; WX 736.111 ; N R ; B 35 -22 732 683 ;
+C 83 ; WX 555.556 ; N S ; B 56 -22 499 705 ;
+C 84 ; WX 722.222 ; N T ; B 36 0 685 677 ;
+C 85 ; WX 750 ; N U ; B 33 -22 716 683 ;
+C 86 ; WX 750 ; N V ; B 19 -22 730 683 ;
+C 87 ; WX 1027.78 ; N W ; B 18 -22 1009 683 ;
+C 88 ; WX 750 ; N X ; B 24 0 726 683 ;
+C 89 ; WX 750 ; N Y ; B 11 0 738 683 ;
+C 90 ; WX 611.111 ; N Z ; B 56 0 560 683 ;
+C 91 ; WX 277.778 ; N bracketleft ; B 118 -250 255 750 ;
+C 92 ; WX 500 ; N quotedblleft ; B 152 394 466 693 ;
+C 93 ; WX 277.778 ; N bracketright ; B 22 -250 159 750 ;
+C 94 ; WX 500 ; N circumflex ; B 116 540 383 694 ;
+C 95 ; WX 277.778 ; N dotaccent ; B 85 563 192 669 ;
+C 96 ; WX 277.778 ; N quoteleft ; B 72 394 192 693 ; L quoteleft quotedblleft ;
+C 97 ; WX 500 ; N a ; B 42 -11 493 448 ;
+C 98 ; WX 555.556 ; N b ; B 28 -11 521 694 ;
+C 99 ; WX 444.444 ; N c ; B 34 -11 415 448 ;
+C 100 ; WX 555.556 ; N d ; B 34 -11 527 694 ;
+C 101 ; WX 444.444 ; N e ; B 28 -11 415 448 ;
+C 102 ; WX 305.556 ; N f ; B 33 0 357 705 ; L i fi ; L f ff ; L l fl ;
+C 103 ; WX 500 ; N g ; B 28 -206 485 453 ;
+C 104 ; WX 555.556 ; N h ; B 32 0 535 694 ;
+C 105 ; WX 277.778 ; N i ; B 33 0 247 669 ;
+C 106 ; WX 305.556 ; N j ; B -40 -205 210 669 ;
+C 107 ; WX 527.778 ; N k ; B 28 0 511 694 ;
+C 108 ; WX 277.778 ; N l ; B 33 0 255 694 ;
+C 109 ; WX 833.333 ; N m ; B 32 0 813 442 ;
+C 110 ; WX 555.556 ; N n ; B 32 0 535 442 ;
+C 111 ; WX 500 ; N o ; B 28 -11 471 448 ;
+C 112 ; WX 555.556 ; N p ; B 28 -194 521 442 ;
+C 113 ; WX 527.778 ; N q ; B 34 -194 527 442 ;
+C 114 ; WX 391.667 ; N r ; B 28 0 364 442 ;
+C 115 ; WX 394.444 ; N s ; B 33 -11 360 448 ;
+C 116 ; WX 388.889 ; N t ; B 19 -11 332 615 ;
+C 117 ; WX 555.556 ; N u ; B 32 -11 535 442 ;
+C 118 ; WX 527.778 ; N v ; B 19 -11 508 431 ;
+C 119 ; WX 722.222 ; N w ; B 18 -11 703 431 ;
+C 120 ; WX 527.778 ; N x ; B 12 0 516 431 ;
+C 121 ; WX 527.778 ; N y ; B 19 -205 508 431 ;
+C 122 ; WX 444.444 ; N z ; B 28 0 401 431 ;
+C 123 ; WX 500 ; N endash ; B 0 255 499 277 ; L hyphen emdash ;
+C 124 ; WX 1000 ; N emdash ; B 0 255 999 277 ;
+C 125 ; WX 500 ; N hungarumlaut ; B 128 513 420 699 ;
+C 126 ; WX 500 ; N tilde ; B 83 575 416 668 ;
+C 127 ; WX 500 ; N dieresis ; B 103 569 396 669 ;
+C -1 ; WX 333.333 ; N space ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 183
+KPX ff quoteright 77.778
+KPX ff question 77.778
+KPX ff exclam 77.778
+KPX ff parenright 77.778
+KPX ff bracketright 77.778
+KPX suppress l -277.778
+KPX suppress L -319.444
+KPX quoteright question 111.111
+KPX quoteright exclam 111.111
+KPX A t -27.778
+KPX A C -27.778
+KPX A O -27.778
+KPX A G -27.778
+KPX A U -27.778
+KPX A Q -27.778
+KPX A T -83.333
+KPX A Y -83.333
+KPX A V -111.111
+KPX A W -111.111
+KPX D X -27.778
+KPX D W -27.778
+KPX D A -27.778
+KPX D V -27.778
+KPX D Y -27.778
+KPX F o -83.333
+KPX F e -83.333
+KPX F u -83.333
+KPX F r -83.333
+KPX F a -83.333
+KPX F A -111.111
+KPX F O -27.778
+KPX F C -27.778
+KPX F G -27.778
+KPX F Q -27.778
+KPX I I 27.778
+KPX K O -27.778
+KPX K C -27.778
+KPX K G -27.778
+KPX K Q -27.778
+KPX L T -83.333
+KPX L Y -83.333
+KPX L V -111.111
+KPX L W -111.111
+KPX O X -27.778
+KPX O W -27.778
+KPX O A -27.778
+KPX O V -27.778
+KPX O Y -27.778
+KPX P A -83.333
+KPX P o -27.778
+KPX P e -27.778
+KPX P a -27.778
+KPX P period -83.333
+KPX P comma -83.333
+KPX R t -27.778
+KPX R C -27.778
+KPX R O -27.778
+KPX R G -27.778
+KPX R U -27.778
+KPX R Q -27.778
+KPX R T -83.333
+KPX R Y -83.333
+KPX R V -111.111
+KPX R W -111.111
+KPX T y -27.778
+KPX T e -83.333
+KPX T o -83.333
+KPX T r -83.333
+KPX T a -83.333
+KPX T A -83.333
+KPX T u -83.333
+KPX V o -83.333
+KPX V e -83.333
+KPX V u -83.333
+KPX V r -83.333
+KPX V a -83.333
+KPX V A -111.111
+KPX V O -27.778
+KPX V C -27.778
+KPX V G -27.778
+KPX V Q -27.778
+KPX W o -83.333
+KPX W e -83.333
+KPX W u -83.333
+KPX W r -83.333
+KPX W a -83.333
+KPX W A -111.111
+KPX W O -27.778
+KPX W C -27.778
+KPX W G -27.778
+KPX W Q -27.778
+KPX X O -27.778
+KPX X C -27.778
+KPX X G -27.778
+KPX X Q -27.778
+KPX Y e -83.333
+KPX Y o -83.333
+KPX Y r -83.333
+KPX Y a -83.333
+KPX Y A -83.333
+KPX Y u -83.333
+KPX a v -27.778
+KPX a j 55.556
+KPX a y -27.778
+KPX a w -27.778
+KPX b e 27.778
+KPX b o 27.778
+KPX b x -27.778
+KPX b d 27.778
+KPX b c 27.778
+KPX b q 27.778
+KPX b v -27.778
+KPX b j 55.556
+KPX b y -27.778
+KPX b w -27.778
+KPX c h -27.778
+KPX c k -27.778
+KPX f quoteright 77.778
+KPX f question 77.778
+KPX f exclam 77.778
+KPX f parenright 77.778
+KPX f bracketright 77.778
+KPX g j 27.778
+KPX h t -27.778
+KPX h u -27.778
+KPX h b -27.778
+KPX h y -27.778
+KPX h v -27.778
+KPX h w -27.778
+KPX k a -55.556
+KPX k e -27.778
+KPX k a -27.778
+KPX k o -27.778
+KPX k c -27.778
+KPX m t -27.778
+KPX m u -27.778
+KPX m b -27.778
+KPX m y -27.778
+KPX m v -27.778
+KPX m w -27.778
+KPX n t -27.778
+KPX n u -27.778
+KPX n b -27.778
+KPX n y -27.778
+KPX n v -27.778
+KPX n w -27.778
+KPX o e 27.778
+KPX o o 27.778
+KPX o x -27.778
+KPX o d 27.778
+KPX o c 27.778
+KPX o q 27.778
+KPX o v -27.778
+KPX o j 55.556
+KPX o y -27.778
+KPX o w -27.778
+KPX p e 27.778
+KPX p o 27.778
+KPX p x -27.778
+KPX p d 27.778
+KPX p c 27.778
+KPX p q 27.778
+KPX p v -27.778
+KPX p j 55.556
+KPX p y -27.778
+KPX p w -27.778
+KPX t y -27.778
+KPX t w -27.778
+KPX u w -27.778
+KPX v a -55.556
+KPX v e -27.778
+KPX v a -27.778
+KPX v o -27.778
+KPX v c -27.778
+KPX w e -27.778
+KPX w a -27.778
+KPX w o -27.778
+KPX w c -27.778
+KPX y o -27.778
+KPX y e -27.778
+KPX y a -27.778
+KPX y period -83.333
+KPX y comma -83.333
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmsy10.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmsy10.afm
new file mode 100644
index 0000000000000000000000000000000000000000..09e9487d14dfa274356f1d1fb923ccff9685d05b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmsy10.afm
@@ -0,0 +1,195 @@
+StartFontMetrics 2.0
+Comment Creation Date: Thu Jun 21 22:23:44 1990
+Comment UniqueID 5000820
+FontName CMSY10
+EncodingScheme FontSpecific
+FullName CMSY10
+FamilyName Computer Modern
+Weight Medium
+ItalicAngle -14.035
+IsFixedPitch false
+Version 1.00
+Notice Copyright (c) 1997 American Mathematical Society. All Rights Reserved.
+Comment Computer Modern fonts were designed by Donald E. Knuth
+FontBBox -29 -960 1116 775
+CapHeight 683.333
+XHeight 430.556
+Ascender 694.444
+Descender -960
+Comment FontID CMSY
+Comment DesignSize 10 (pts)
+Comment CharacterCodingScheme TeX math symbols
+Comment Space 0 0 0
+Comment ExtraSpace 0
+Comment Quad 1000
+Comment Num 676.508 393.732 443.731
+Comment Denom 685.951 344.841
+Comment Sup 412.892 362.892 288.889
+Comment Sub 150 247.217
+Comment Supdrop 386.108
+Comment Subdrop 50
+Comment Delim 2390 1010
+Comment Axisheight 250
+StartCharMetrics 129
+C 0 ; WX 777.778 ; N minus ; B 83 230 694 270 ;
+C 1 ; WX 277.778 ; N periodcentered ; B 86 197 192 303 ;
+C 2 ; WX 777.778 ; N multiply ; B 147 9 630 491 ;
+C 3 ; WX 500 ; N asteriskmath ; B 65 34 434 465 ;
+C 4 ; WX 777.778 ; N divide ; B 56 -30 722 530 ;
+C 5 ; WX 500 ; N diamondmath ; B 11 11 489 489 ;
+C 6 ; WX 777.778 ; N plusminus ; B 56 0 721 666 ;
+C 7 ; WX 777.778 ; N minusplus ; B 56 -166 721 500 ;
+C 8 ; WX 777.778 ; N circleplus ; B 56 -83 721 583 ;
+C 9 ; WX 777.778 ; N circleminus ; B 56 -83 721 583 ;
+C 10 ; WX 777.778 ; N circlemultiply ; B 56 -83 721 583 ;
+C 11 ; WX 777.778 ; N circledivide ; B 56 -83 721 583 ;
+C 12 ; WX 777.778 ; N circledot ; B 56 -83 721 583 ;
+C 13 ; WX 1000 ; N circlecopyrt ; B 56 -216 943 716 ;
+C 14 ; WX 500 ; N openbullet ; B 56 56 443 444 ;
+C 15 ; WX 500 ; N bullet ; B 56 56 443 444 ;
+C 16 ; WX 777.778 ; N equivasymptotic ; B 56 16 721 484 ;
+C 17 ; WX 777.778 ; N equivalence ; B 56 36 721 464 ;
+C 18 ; WX 777.778 ; N reflexsubset ; B 83 -137 694 636 ;
+C 19 ; WX 777.778 ; N reflexsuperset ; B 83 -137 694 636 ;
+C 20 ; WX 777.778 ; N lessequal ; B 83 -137 694 636 ;
+C 21 ; WX 777.778 ; N greaterequal ; B 83 -137 694 636 ;
+C 22 ; WX 777.778 ; N precedesequal ; B 83 -137 694 636 ;
+C 23 ; WX 777.778 ; N followsequal ; B 83 -137 694 636 ;
+C 24 ; WX 777.778 ; N similar ; B 56 133 721 367 ;
+C 25 ; WX 777.778 ; N approxequal ; B 56 56 721 483 ;
+C 26 ; WX 777.778 ; N propersubset ; B 83 -40 694 540 ;
+C 27 ; WX 777.778 ; N propersuperset ; B 83 -40 694 540 ;
+C 28 ; WX 1000 ; N lessmuch ; B 56 -66 943 566 ;
+C 29 ; WX 1000 ; N greatermuch ; B 56 -66 943 566 ;
+C 30 ; WX 777.778 ; N precedes ; B 83 -40 694 539 ;
+C 31 ; WX 777.778 ; N follows ; B 83 -40 694 539 ;
+C 32 ; WX 1000 ; N arrowleft ; B 57 72 943 428 ;
+C 33 ; WX 1000 ; N arrowright ; B 56 72 942 428 ;
+C 34 ; WX 500 ; N arrowup ; B 72 -194 428 693 ;
+C 35 ; WX 500 ; N arrowdown ; B 72 -193 428 694 ;
+C 36 ; WX 1000 ; N arrowboth ; B 57 72 942 428 ;
+C 37 ; WX 1000 ; N arrownortheast ; B 56 -193 946 697 ;
+C 38 ; WX 1000 ; N arrowsoutheast ; B 56 -197 946 693 ;
+C 39 ; WX 777.778 ; N similarequal ; B 56 36 721 464 ;
+C 40 ; WX 1000 ; N arrowdblleft ; B 57 -25 943 525 ;
+C 41 ; WX 1000 ; N arrowdblright ; B 56 -25 942 525 ;
+C 42 ; WX 611.111 ; N arrowdblup ; B 30 -194 580 694 ;
+C 43 ; WX 611.111 ; N arrowdbldown ; B 30 -194 580 694 ;
+C 44 ; WX 1000 ; N arrowdblboth ; B 35 -25 964 525 ;
+C 45 ; WX 1000 ; N arrownorthwest ; B 53 -193 943 697 ;
+C 46 ; WX 1000 ; N arrowsouthwest ; B 53 -197 943 693 ;
+C 47 ; WX 777.778 ; N proportional ; B 56 -11 722 442 ;
+C 48 ; WX 275 ; N prime ; B 29 45 262 559 ;
+C 49 ; WX 1000 ; N infinity ; B 56 -11 943 442 ;
+C 50 ; WX 666.667 ; N element ; B 83 -40 583 540 ;
+C 51 ; WX 666.667 ; N owner ; B 83 -40 583 540 ;
+C 52 ; WX 888.889 ; N triangle ; B 59 0 829 716 ;
+C 53 ; WX 888.889 ; N triangleinv ; B 59 -216 829 500 ;
+C 54 ; WX 0 ; N negationslash ; B 139 -216 638 716 ;
+C 55 ; WX 0 ; N mapsto ; B 56 64 124 436 ;
+C 56 ; WX 555.556 ; N universal ; B 0 -22 556 694 ;
+C 57 ; WX 555.556 ; N existential ; B 56 0 499 694 ;
+C 58 ; WX 666.667 ; N logicalnot ; B 56 89 610 356 ;
+C 59 ; WX 500 ; N emptyset ; B 47 -78 452 772 ;
+C 60 ; WX 722.222 ; N Rfractur ; B 46 -22 714 716 ;
+C 61 ; WX 722.222 ; N Ifractur ; B 56 -11 693 705 ;
+C 62 ; WX 777.778 ; N latticetop ; B 56 0 722 666 ;
+C 63 ; WX 777.778 ; N perpendicular ; B 56 0 722 666 ;
+C 64 ; WX 611.111 ; N aleph ; B 56 0 554 693 ;
+C 65 ; WX 798.469 ; N A ; B 27 -50 798 722 ;
+C 66 ; WX 656.808 ; N B ; B 30 -22 665 706 ;
+C 67 ; WX 526.527 ; N C ; B 12 -24 534 705 ;
+C 68 ; WX 771.391 ; N D ; B 20 0 766 683 ;
+C 69 ; WX 527.778 ; N E ; B 28 -22 565 705 ;
+C 70 ; WX 718.75 ; N F ; B 17 -33 829 683 ;
+C 71 ; WX 594.864 ; N G ; B 44 -119 601 705 ;
+C 72 ; WX 844.516 ; N H ; B 20 -47 818 683 ;
+C 73 ; WX 544.513 ; N I ; B -24 0 635 683 ;
+C 74 ; WX 677.778 ; N J ; B 47 -119 840 683 ;
+C 75 ; WX 761.949 ; N K ; B 30 -22 733 705 ;
+C 76 ; WX 689.723 ; N L ; B 31 -22 656 705 ;
+C 77 ; WX 1200.9 ; N M ; B 27 -50 1116 705 ;
+C 78 ; WX 820.489 ; N N ; B -29 -50 978 775 ;
+C 79 ; WX 796.112 ; N O ; B 57 -22 777 705 ;
+C 80 ; WX 695.558 ; N P ; B 20 -50 733 683 ;
+C 81 ; WX 816.667 ; N Q ; B 113 -124 788 705 ;
+C 82 ; WX 847.502 ; N R ; B 20 -22 837 683 ;
+C 83 ; WX 605.556 ; N S ; B 18 -22 642 705 ;
+C 84 ; WX 544.643 ; N T ; B 29 0 798 717 ;
+C 85 ; WX 625.83 ; N U ; B -17 -28 688 683 ;
+C 86 ; WX 612.781 ; N V ; B 35 -45 660 683 ;
+C 87 ; WX 987.782 ; N W ; B 35 -45 1036 683 ;
+C 88 ; WX 713.295 ; N X ; B 50 0 808 683 ;
+C 89 ; WX 668.335 ; N Y ; B 31 -135 717 683 ;
+C 90 ; WX 724.724 ; N Z ; B 37 0 767 683 ;
+C 91 ; WX 666.667 ; N union ; B 56 -22 610 598 ;
+C 92 ; WX 666.667 ; N intersection ; B 56 -22 610 598 ;
+C 93 ; WX 666.667 ; N unionmulti ; B 56 -22 610 598 ;
+C 94 ; WX 666.667 ; N logicaland ; B 56 -22 610 598 ;
+C 95 ; WX 666.667 ; N logicalor ; B 56 -22 610 598 ;
+C 96 ; WX 611.111 ; N turnstileleft ; B 56 0 554 694 ;
+C 97 ; WX 611.111 ; N turnstileright ; B 56 0 554 694 ;
+C 98 ; WX 444.444 ; N floorleft ; B 174 -250 422 750 ;
+C 99 ; WX 444.444 ; N floorright ; B 21 -250 269 750 ;
+C 100 ; WX 444.444 ; N ceilingleft ; B 174 -250 422 750 ;
+C 101 ; WX 444.444 ; N ceilingright ; B 21 -250 269 750 ;
+C 102 ; WX 500 ; N braceleft ; B 72 -250 427 750 ;
+C 103 ; WX 500 ; N braceright ; B 72 -250 427 750 ;
+C 104 ; WX 388.889 ; N angbracketleft ; B 110 -250 332 750 ;
+C 105 ; WX 388.889 ; N angbracketright ; B 56 -250 278 750 ;
+C 106 ; WX 277.778 ; N bar ; B 119 -250 159 750 ;
+C 107 ; WX 500 ; N bardbl ; B 132 -250 367 750 ;
+C 108 ; WX 500 ; N arrowbothv ; B 72 -272 428 772 ;
+C 109 ; WX 611.111 ; N arrowdblbothv ; B 30 -272 580 772 ;
+C 110 ; WX 500 ; N backslash ; B 56 -250 443 750 ;
+C 111 ; WX 277.778 ; N wreathproduct ; B 56 -83 221 583 ;
+C 112 ; WX 833.333 ; N radical ; B 73 -960 853 40 ;
+C 113 ; WX 750 ; N coproduct ; B 36 0 713 683 ;
+C 114 ; WX 833.333 ; N nabla ; B 47 -33 785 683 ;
+C 115 ; WX 416.667 ; N integral ; B 56 -216 471 716 ;
+C 116 ; WX 666.667 ; N unionsq ; B 61 0 605 598 ;
+C 117 ; WX 666.667 ; N intersectionsq ; B 61 0 605 598 ;
+C 118 ; WX 777.778 ; N subsetsqequal ; B 83 -137 714 636 ;
+C 119 ; WX 777.778 ; N supersetsqequal ; B 63 -137 694 636 ;
+C 120 ; WX 444.444 ; N section ; B 69 -205 374 705 ;
+C 121 ; WX 444.444 ; N dagger ; B 56 -216 387 705 ;
+C 122 ; WX 444.444 ; N daggerdbl ; B 56 -205 387 705 ;
+C 123 ; WX 611.111 ; N paragraph ; B 56 -194 582 694 ;
+C 124 ; WX 777.778 ; N club ; B 28 -130 750 727 ;
+C 125 ; WX 777.778 ; N diamond ; B 56 -163 722 727 ;
+C 126 ; WX 777.778 ; N heart ; B 56 -33 722 716 ;
+C 127 ; WX 777.778 ; N spade ; B 56 -130 722 727 ;
+C -1 ; WX 333.333 ; N space ; B 0 0 0 0 ;
+EndCharMetrics
+Comment The following are bogus kern pairs for TeX positioning of accents
+StartKernData
+StartKernPairs 26
+KPX A prime 194.444
+KPX B prime 138.889
+KPX C prime 138.889
+KPX D prime 83.333
+KPX E prime 111.111
+KPX F prime 111.111
+KPX G prime 111.111
+KPX H prime 111.111
+KPX I prime 27.778
+KPX J prime 166.667
+KPX K prime 55.556
+KPX L prime 138.889
+KPX M prime 138.889
+KPX N prime 83.333
+KPX O prime 111.111
+KPX P prime 83.333
+KPX Q prime 111.111
+KPX R prime 83.333
+KPX S prime 138.889
+KPX T prime 27.778
+KPX U prime 83.333
+KPX V prime 27.778
+KPX W prime 83.333
+KPX X prime 138.889
+KPX Y prime 83.333
+KPX Z prime 138.889
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmtt10.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmtt10.afm
new file mode 100644
index 0000000000000000000000000000000000000000..d6ec19b090843b46a1810ff09aa0749c51cb2f8a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/cmtt10.afm
@@ -0,0 +1,156 @@
+StartFontMetrics 2.0
+Comment Creation Date: Thu Jun 21 22:23:51 1990
+Comment UniqueID 5000832
+FontName CMTT10
+EncodingScheme FontSpecific
+FullName CMTT10
+FamilyName Computer Modern
+Weight Medium
+ItalicAngle 0.0
+IsFixedPitch true
+Version 1.00B
+Notice Copyright (c) 1997 American Mathematical Society. All Rights Reserved.
+Comment Computer Modern fonts were designed by Donald E. Knuth
+FontBBox -4 -235 731 800
+CapHeight 611.111
+XHeight 430.556
+Ascender 611.111
+Descender -222.222
+Comment FontID CMTT
+Comment DesignSize 10 (pts)
+Comment CharacterCodingScheme TeX typewriter text
+Comment Space 525 0 0
+Comment ExtraSpace 525
+Comment Quad 1050
+StartCharMetrics 129
+C 0 ; WX 525 ; N Gamma ; B 32 0 488 611 ;
+C 1 ; WX 525 ; N Delta ; B 34 0 490 623 ;
+C 2 ; WX 525 ; N Theta ; B 56 -11 468 622 ;
+C 3 ; WX 525 ; N Lambda ; B 29 0 495 623 ;
+C 4 ; WX 525 ; N Xi ; B 33 0 491 611 ;
+C 5 ; WX 525 ; N Pi ; B 22 0 502 611 ;
+C 6 ; WX 525 ; N Sigma ; B 40 0 484 611 ;
+C 7 ; WX 525 ; N Upsilon ; B 38 0 486 622 ;
+C 8 ; WX 525 ; N Phi ; B 40 0 484 611 ;
+C 9 ; WX 525 ; N Psi ; B 38 0 486 611 ;
+C 10 ; WX 525 ; N Omega ; B 32 0 492 622 ;
+C 11 ; WX 525 ; N arrowup ; B 59 0 465 611 ;
+C 12 ; WX 525 ; N arrowdown ; B 59 0 465 611 ;
+C 13 ; WX 525 ; N quotesingle ; B 217 328 309 622 ;
+C 14 ; WX 525 ; N exclamdown ; B 212 -233 312 389 ;
+C 15 ; WX 525 ; N questiondown ; B 62 -228 462 389 ;
+C 16 ; WX 525 ; N dotlessi ; B 78 0 455 431 ;
+C 17 ; WX 525 ; N dotlessj ; B 48 -228 368 431 ;
+C 18 ; WX 525 ; N grave ; B 117 477 329 611 ;
+C 19 ; WX 525 ; N acute ; B 195 477 407 611 ;
+C 20 ; WX 525 ; N caron ; B 101 454 423 572 ;
+C 21 ; WX 525 ; N breve ; B 86 498 438 611 ;
+C 22 ; WX 525 ; N macron ; B 73 514 451 577 ;
+C 23 ; WX 525 ; N ring ; B 181 499 343 619 ;
+C 24 ; WX 525 ; N cedilla ; B 162 -208 428 45 ;
+C 25 ; WX 525 ; N germandbls ; B 17 -6 495 617 ;
+C 26 ; WX 525 ; N ae ; B 33 -6 504 440 ;
+C 27 ; WX 525 ; N oe ; B 19 -6 505 440 ;
+C 28 ; WX 525 ; N oslash ; B 43 -140 481 571 ;
+C 29 ; WX 525 ; N AE ; B 23 0 499 611 ;
+C 30 ; WX 525 ; N OE ; B 29 -11 502 622 ;
+C 31 ; WX 525 ; N Oslash ; B 56 -85 468 696 ;
+C 32 ; WX 525 ; N visiblespace ; B 44 -132 480 240 ;
+C 33 ; WX 525 ; N exclam ; B 212 0 312 622 ; L quoteleft exclamdown ;
+C 34 ; WX 525 ; N quotedbl ; B 126 328 398 622 ;
+C 35 ; WX 525 ; N numbersign ; B 35 0 489 611 ;
+C 36 ; WX 525 ; N dollar ; B 58 -83 466 694 ;
+C 37 ; WX 525 ; N percent ; B 35 -83 489 694 ;
+C 38 ; WX 525 ; N ampersand ; B 28 -11 490 622 ;
+C 39 ; WX 525 ; N quoteright ; B 180 302 341 611 ;
+C 40 ; WX 525 ; N parenleft ; B 173 -82 437 694 ;
+C 41 ; WX 525 ; N parenright ; B 88 -82 352 694 ;
+C 42 ; WX 525 ; N asterisk ; B 68 90 456 521 ;
+C 43 ; WX 525 ; N plus ; B 38 81 486 531 ;
+C 44 ; WX 525 ; N comma ; B 180 -139 346 125 ;
+C 45 ; WX 525 ; N hyphen ; B 56 271 468 341 ;
+C 46 ; WX 525 ; N period ; B 200 0 325 125 ;
+C 47 ; WX 525 ; N slash ; B 58 -83 466 694 ;
+C 48 ; WX 525 ; N zero ; B 50 -11 474 622 ;
+C 49 ; WX 525 ; N one ; B 105 0 442 622 ;
+C 50 ; WX 525 ; N two ; B 52 0 472 622 ;
+C 51 ; WX 525 ; N three ; B 44 -11 480 622 ;
+C 52 ; WX 525 ; N four ; B 29 0 495 623 ;
+C 53 ; WX 525 ; N five ; B 52 -11 472 611 ;
+C 54 ; WX 525 ; N six ; B 53 -11 471 622 ;
+C 55 ; WX 525 ; N seven ; B 44 -11 480 627 ;
+C 56 ; WX 525 ; N eight ; B 44 -11 480 622 ;
+C 57 ; WX 525 ; N nine ; B 53 -11 471 622 ;
+C 58 ; WX 525 ; N colon ; B 200 0 325 431 ;
+C 59 ; WX 525 ; N semicolon ; B 180 -139 330 431 ;
+C 60 ; WX 525 ; N less ; B 56 56 468 556 ;
+C 61 ; WX 525 ; N equal ; B 38 195 486 417 ;
+C 62 ; WX 525 ; N greater ; B 56 56 468 556 ;
+C 63 ; WX 525 ; N question ; B 62 0 462 617 ; L quoteleft questiondown ;
+C 64 ; WX 525 ; N at ; B 44 -6 480 617 ;
+C 65 ; WX 525 ; N A ; B 27 0 497 623 ;
+C 66 ; WX 525 ; N B ; B 23 0 482 611 ;
+C 67 ; WX 525 ; N C ; B 40 -11 484 622 ;
+C 68 ; WX 525 ; N D ; B 19 0 485 611 ;
+C 69 ; WX 525 ; N E ; B 26 0 502 611 ;
+C 70 ; WX 525 ; N F ; B 28 0 490 611 ;
+C 71 ; WX 525 ; N G ; B 38 -11 496 622 ;
+C 72 ; WX 525 ; N H ; B 22 0 502 611 ;
+C 73 ; WX 525 ; N I ; B 79 0 446 611 ;
+C 74 ; WX 525 ; N J ; B 71 -11 478 611 ;
+C 75 ; WX 525 ; N K ; B 26 0 495 611 ;
+C 76 ; WX 525 ; N L ; B 32 0 488 611 ;
+C 77 ; WX 525 ; N M ; B 17 0 507 611 ;
+C 78 ; WX 525 ; N N ; B 28 0 496 611 ;
+C 79 ; WX 525 ; N O ; B 56 -11 468 622 ;
+C 80 ; WX 525 ; N P ; B 26 0 480 611 ;
+C 81 ; WX 525 ; N Q ; B 56 -139 468 622 ;
+C 82 ; WX 525 ; N R ; B 22 -11 522 611 ;
+C 83 ; WX 525 ; N S ; B 52 -11 472 622 ;
+C 84 ; WX 525 ; N T ; B 26 0 498 611 ;
+C 85 ; WX 525 ; N U ; B 4 -11 520 611 ;
+C 86 ; WX 525 ; N V ; B 18 -8 506 611 ;
+C 87 ; WX 525 ; N W ; B 11 -8 513 611 ;
+C 88 ; WX 525 ; N X ; B 27 0 496 611 ;
+C 89 ; WX 525 ; N Y ; B 19 0 505 611 ;
+C 90 ; WX 525 ; N Z ; B 48 0 481 611 ;
+C 91 ; WX 525 ; N bracketleft ; B 222 -83 483 694 ;
+C 92 ; WX 525 ; N backslash ; B 58 -83 466 694 ;
+C 93 ; WX 525 ; N bracketright ; B 41 -83 302 694 ;
+C 94 ; WX 525 ; N asciicircum ; B 100 471 424 611 ;
+C 95 ; WX 525 ; N underscore ; B 56 -95 468 -25 ;
+C 96 ; WX 525 ; N quoteleft ; B 183 372 344 681 ;
+C 97 ; WX 525 ; N a ; B 55 -6 524 440 ;
+C 98 ; WX 525 ; N b ; B 12 -6 488 611 ;
+C 99 ; WX 525 ; N c ; B 73 -6 466 440 ;
+C 100 ; WX 525 ; N d ; B 36 -6 512 611 ;
+C 101 ; WX 525 ; N e ; B 55 -6 464 440 ;
+C 102 ; WX 525 ; N f ; B 42 0 437 617 ;
+C 103 ; WX 525 ; N g ; B 29 -229 509 442 ;
+C 104 ; WX 525 ; N h ; B 12 0 512 611 ;
+C 105 ; WX 525 ; N i ; B 78 0 455 612 ;
+C 106 ; WX 525 ; N j ; B 48 -228 368 612 ;
+C 107 ; WX 525 ; N k ; B 21 0 508 611 ;
+C 108 ; WX 525 ; N l ; B 58 0 467 611 ;
+C 109 ; WX 525 ; N m ; B -4 0 516 437 ;
+C 110 ; WX 525 ; N n ; B 12 0 512 437 ;
+C 111 ; WX 525 ; N o ; B 57 -6 467 440 ;
+C 112 ; WX 525 ; N p ; B 12 -222 488 437 ;
+C 113 ; WX 525 ; N q ; B 40 -222 537 437 ;
+C 114 ; WX 525 ; N r ; B 32 0 487 437 ;
+C 115 ; WX 525 ; N s ; B 72 -6 459 440 ;
+C 116 ; WX 525 ; N t ; B 25 -6 449 554 ;
+C 117 ; WX 525 ; N u ; B 12 -6 512 431 ;
+C 118 ; WX 525 ; N v ; B 24 -4 500 431 ;
+C 119 ; WX 525 ; N w ; B 16 -4 508 431 ;
+C 120 ; WX 525 ; N x ; B 27 0 496 431 ;
+C 121 ; WX 525 ; N y ; B 26 -228 500 431 ;
+C 122 ; WX 525 ; N z ; B 33 0 475 431 ;
+C 123 ; WX 525 ; N braceleft ; B 57 -83 467 694 ;
+C 124 ; WX 525 ; N bar ; B 227 -83 297 694 ;
+C 125 ; WX 525 ; N braceright ; B 57 -83 467 694 ;
+C 126 ; WX 525 ; N asciitilde ; B 87 491 437 611 ;
+C 127 ; WX 525 ; N dieresis ; B 110 512 414 612 ;
+C -1 ; WX 525 ; N space ; B 0 0 0 0 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagd8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagd8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..69eebba18ee05121f10e4b682eb6443ded4a72e1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagd8a.afm
@@ -0,0 +1,576 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Mar 4 13:46:34 1991
+Comment UniqueID 34370
+Comment VMusage 24954 31846
+FontName AvantGarde-Demi
+FullName ITC Avant Garde Gothic Demi
+FamilyName ITC Avant Garde Gothic
+Weight Demi
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -123 -251 1222 1021
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 740
+XHeight 555
+Ascender 740
+Descender -185
+StartCharMetrics 228
+C 32 ; WX 280 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 280 ; N exclam ; B 73 0 206 740 ;
+C 34 ; WX 360 ; N quotedbl ; B 19 444 341 740 ;
+C 35 ; WX 560 ; N numbersign ; B 29 0 525 700 ;
+C 36 ; WX 560 ; N dollar ; B 58 -86 501 857 ;
+C 37 ; WX 860 ; N percent ; B 36 -15 822 755 ;
+C 38 ; WX 680 ; N ampersand ; B 34 -15 665 755 ;
+C 39 ; WX 280 ; N quoteright ; B 72 466 205 740 ;
+C 40 ; WX 380 ; N parenleft ; B 74 -157 350 754 ;
+C 41 ; WX 380 ; N parenright ; B 37 -157 313 754 ;
+C 42 ; WX 440 ; N asterisk ; B 67 457 374 755 ;
+C 43 ; WX 600 ; N plus ; B 48 0 552 506 ;
+C 44 ; WX 280 ; N comma ; B 73 -141 206 133 ;
+C 45 ; WX 420 ; N hyphen ; B 71 230 349 348 ;
+C 46 ; WX 280 ; N period ; B 73 0 206 133 ;
+C 47 ; WX 460 ; N slash ; B 6 -100 454 740 ;
+C 48 ; WX 560 ; N zero ; B 32 -15 529 755 ;
+C 49 ; WX 560 ; N one ; B 137 0 363 740 ;
+C 50 ; WX 560 ; N two ; B 36 0 523 755 ;
+C 51 ; WX 560 ; N three ; B 28 -15 532 755 ;
+C 52 ; WX 560 ; N four ; B 15 0 545 740 ;
+C 53 ; WX 560 ; N five ; B 25 -15 535 740 ;
+C 54 ; WX 560 ; N six ; B 23 -15 536 739 ;
+C 55 ; WX 560 ; N seven ; B 62 0 498 740 ;
+C 56 ; WX 560 ; N eight ; B 33 -15 527 755 ;
+C 57 ; WX 560 ; N nine ; B 24 0 537 754 ;
+C 58 ; WX 280 ; N colon ; B 73 0 206 555 ;
+C 59 ; WX 280 ; N semicolon ; B 73 -141 206 555 ;
+C 60 ; WX 600 ; N less ; B 46 -8 554 514 ;
+C 61 ; WX 600 ; N equal ; B 48 81 552 425 ;
+C 62 ; WX 600 ; N greater ; B 46 -8 554 514 ;
+C 63 ; WX 560 ; N question ; B 38 0 491 755 ;
+C 64 ; WX 740 ; N at ; B 50 -12 750 712 ;
+C 65 ; WX 740 ; N A ; B 7 0 732 740 ;
+C 66 ; WX 580 ; N B ; B 70 0 551 740 ;
+C 67 ; WX 780 ; N C ; B 34 -15 766 755 ;
+C 68 ; WX 700 ; N D ; B 63 0 657 740 ;
+C 69 ; WX 520 ; N E ; B 61 0 459 740 ;
+C 70 ; WX 480 ; N F ; B 61 0 438 740 ;
+C 71 ; WX 840 ; N G ; B 27 -15 817 755 ;
+C 72 ; WX 680 ; N H ; B 71 0 610 740 ;
+C 73 ; WX 280 ; N I ; B 72 0 209 740 ;
+C 74 ; WX 480 ; N J ; B 2 -15 409 740 ;
+C 75 ; WX 620 ; N K ; B 89 0 620 740 ;
+C 76 ; WX 440 ; N L ; B 72 0 435 740 ;
+C 77 ; WX 900 ; N M ; B 63 0 837 740 ;
+C 78 ; WX 740 ; N N ; B 70 0 671 740 ;
+C 79 ; WX 840 ; N O ; B 33 -15 807 755 ;
+C 80 ; WX 560 ; N P ; B 72 0 545 740 ;
+C 81 ; WX 840 ; N Q ; B 32 -15 824 755 ;
+C 82 ; WX 580 ; N R ; B 64 0 565 740 ;
+C 83 ; WX 520 ; N S ; B 12 -15 493 755 ;
+C 84 ; WX 420 ; N T ; B 6 0 418 740 ;
+C 85 ; WX 640 ; N U ; B 55 -15 585 740 ;
+C 86 ; WX 700 ; N V ; B 8 0 695 740 ;
+C 87 ; WX 900 ; N W ; B 7 0 899 740 ;
+C 88 ; WX 680 ; N X ; B 4 0 676 740 ;
+C 89 ; WX 620 ; N Y ; B -2 0 622 740 ;
+C 90 ; WX 500 ; N Z ; B 19 0 481 740 ;
+C 91 ; WX 320 ; N bracketleft ; B 66 -157 284 754 ;
+C 92 ; WX 640 ; N backslash ; B 96 -100 544 740 ;
+C 93 ; WX 320 ; N bracketright ; B 36 -157 254 754 ;
+C 94 ; WX 600 ; N asciicircum ; B 73 375 527 740 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 280 ; N quoteleft ; B 72 466 205 740 ;
+C 97 ; WX 660 ; N a ; B 27 -18 613 574 ;
+C 98 ; WX 660 ; N b ; B 47 -18 632 740 ;
+C 99 ; WX 640 ; N c ; B 37 -18 610 574 ;
+C 100 ; WX 660 ; N d ; B 34 -18 618 740 ;
+C 101 ; WX 640 ; N e ; B 31 -18 610 577 ;
+C 102 ; WX 280 ; N f ; B 15 0 280 755 ; L i fi ; L l fl ;
+C 103 ; WX 660 ; N g ; B 32 -226 623 574 ;
+C 104 ; WX 600 ; N h ; B 54 0 546 740 ;
+C 105 ; WX 240 ; N i ; B 53 0 186 740 ;
+C 106 ; WX 260 ; N j ; B 16 -185 205 740 ;
+C 107 ; WX 580 ; N k ; B 80 0 571 740 ;
+C 108 ; WX 240 ; N l ; B 54 0 187 740 ;
+C 109 ; WX 940 ; N m ; B 54 0 887 574 ;
+C 110 ; WX 600 ; N n ; B 54 0 547 574 ;
+C 111 ; WX 640 ; N o ; B 25 -18 615 574 ;
+C 112 ; WX 660 ; N p ; B 47 -185 629 574 ;
+C 113 ; WX 660 ; N q ; B 31 -185 613 574 ;
+C 114 ; WX 320 ; N r ; B 63 0 317 574 ;
+C 115 ; WX 440 ; N s ; B 19 -18 421 574 ;
+C 116 ; WX 300 ; N t ; B 21 0 299 740 ;
+C 117 ; WX 600 ; N u ; B 50 -18 544 555 ;
+C 118 ; WX 560 ; N v ; B 3 0 556 555 ;
+C 119 ; WX 800 ; N w ; B 11 0 789 555 ;
+C 120 ; WX 560 ; N x ; B 3 0 556 555 ;
+C 121 ; WX 580 ; N y ; B 8 -185 571 555 ;
+C 122 ; WX 460 ; N z ; B 20 0 442 555 ;
+C 123 ; WX 340 ; N braceleft ; B -3 -191 317 747 ;
+C 124 ; WX 600 ; N bar ; B 233 -100 366 740 ;
+C 125 ; WX 340 ; N braceright ; B 23 -191 343 747 ;
+C 126 ; WX 600 ; N asciitilde ; B 67 160 533 347 ;
+C 161 ; WX 280 ; N exclamdown ; B 74 -185 207 555 ;
+C 162 ; WX 560 ; N cent ; B 43 39 517 715 ;
+C 163 ; WX 560 ; N sterling ; B -2 0 562 755 ;
+C 164 ; WX 160 ; N fraction ; B -123 0 282 740 ;
+C 165 ; WX 560 ; N yen ; B -10 0 570 740 ;
+C 166 ; WX 560 ; N florin ; B 0 -151 512 824 ;
+C 167 ; WX 560 ; N section ; B 28 -158 530 755 ;
+C 168 ; WX 560 ; N currency ; B 27 69 534 577 ;
+C 169 ; WX 220 ; N quotesingle ; B 44 444 177 740 ;
+C 170 ; WX 480 ; N quotedblleft ; B 70 466 410 740 ;
+C 171 ; WX 460 ; N guillemotleft ; B 61 108 400 469 ;
+C 172 ; WX 240 ; N guilsinglleft ; B 50 108 190 469 ;
+C 173 ; WX 240 ; N guilsinglright ; B 50 108 190 469 ;
+C 174 ; WX 520 ; N fi ; B 25 0 461 755 ;
+C 175 ; WX 520 ; N fl ; B 25 0 461 755 ;
+C 177 ; WX 500 ; N endash ; B 35 230 465 348 ;
+C 178 ; WX 560 ; N dagger ; B 51 -142 509 740 ;
+C 179 ; WX 560 ; N daggerdbl ; B 51 -142 509 740 ;
+C 180 ; WX 280 ; N periodcentered ; B 73 187 206 320 ;
+C 182 ; WX 600 ; N paragraph ; B -7 -103 607 740 ;
+C 183 ; WX 600 ; N bullet ; B 148 222 453 532 ;
+C 184 ; WX 280 ; N quotesinglbase ; B 72 -141 205 133 ;
+C 185 ; WX 480 ; N quotedblbase ; B 70 -141 410 133 ;
+C 186 ; WX 480 ; N quotedblright ; B 70 466 410 740 ;
+C 187 ; WX 460 ; N guillemotright ; B 61 108 400 469 ;
+C 188 ; WX 1000 ; N ellipsis ; B 100 0 899 133 ;
+C 189 ; WX 1280 ; N perthousand ; B 36 -15 1222 755 ;
+C 191 ; WX 560 ; N questiondown ; B 68 -200 521 555 ;
+C 193 ; WX 420 ; N grave ; B 50 624 329 851 ;
+C 194 ; WX 420 ; N acute ; B 91 624 370 849 ;
+C 195 ; WX 540 ; N circumflex ; B 71 636 470 774 ;
+C 196 ; WX 480 ; N tilde ; B 44 636 437 767 ;
+C 197 ; WX 420 ; N macron ; B 72 648 349 759 ;
+C 198 ; WX 480 ; N breve ; B 42 633 439 770 ;
+C 199 ; WX 280 ; N dotaccent ; B 74 636 207 769 ;
+C 200 ; WX 500 ; N dieresis ; B 78 636 422 769 ;
+C 202 ; WX 360 ; N ring ; B 73 619 288 834 ;
+C 203 ; WX 340 ; N cedilla ; B 98 -251 298 6 ;
+C 205 ; WX 700 ; N hungarumlaut ; B 132 610 609 862 ;
+C 206 ; WX 340 ; N ogonek ; B 79 -195 262 9 ;
+C 207 ; WX 540 ; N caron ; B 71 636 470 774 ;
+C 208 ; WX 1000 ; N emdash ; B 35 230 965 348 ;
+C 225 ; WX 900 ; N AE ; B -5 0 824 740 ;
+C 227 ; WX 360 ; N ordfeminine ; B 19 438 334 755 ;
+C 232 ; WX 480 ; N Lslash ; B 26 0 460 740 ;
+C 233 ; WX 840 ; N Oslash ; B 33 -71 807 814 ;
+C 234 ; WX 1060 ; N OE ; B 37 -15 1007 755 ;
+C 235 ; WX 360 ; N ordmasculine ; B 23 438 338 755 ;
+C 241 ; WX 1080 ; N ae ; B 29 -18 1048 574 ;
+C 245 ; WX 240 ; N dotlessi ; B 53 0 186 555 ;
+C 248 ; WX 320 ; N lslash ; B 34 0 305 740 ;
+C 249 ; WX 660 ; N oslash ; B 35 -50 625 608 ;
+C 250 ; WX 1080 ; N oe ; B 30 -18 1050 574 ;
+C 251 ; WX 600 ; N germandbls ; B 51 -18 585 755 ;
+C -1 ; WX 640 ; N ecircumflex ; B 31 -18 610 774 ;
+C -1 ; WX 640 ; N edieresis ; B 31 -18 610 769 ;
+C -1 ; WX 660 ; N aacute ; B 27 -18 613 849 ;
+C -1 ; WX 740 ; N registered ; B -12 -12 752 752 ;
+C -1 ; WX 240 ; N icircumflex ; B -79 0 320 774 ;
+C -1 ; WX 600 ; N udieresis ; B 50 -18 544 769 ;
+C -1 ; WX 640 ; N ograve ; B 25 -18 615 851 ;
+C -1 ; WX 600 ; N uacute ; B 50 -18 544 849 ;
+C -1 ; WX 600 ; N ucircumflex ; B 50 -18 544 774 ;
+C -1 ; WX 740 ; N Aacute ; B 7 0 732 1019 ;
+C -1 ; WX 240 ; N igrave ; B -65 0 214 851 ;
+C -1 ; WX 280 ; N Icircumflex ; B -59 0 340 944 ;
+C -1 ; WX 640 ; N ccedilla ; B 37 -251 610 574 ;
+C -1 ; WX 660 ; N adieresis ; B 27 -18 613 769 ;
+C -1 ; WX 520 ; N Ecircumflex ; B 61 0 460 944 ;
+C -1 ; WX 440 ; N scaron ; B 19 -18 421 774 ;
+C -1 ; WX 660 ; N thorn ; B 47 -185 629 740 ;
+C -1 ; WX 1000 ; N trademark ; B 9 296 821 740 ;
+C -1 ; WX 640 ; N egrave ; B 31 -18 610 851 ;
+C -1 ; WX 336 ; N threesuperior ; B 8 287 328 749 ;
+C -1 ; WX 460 ; N zcaron ; B 20 0 455 774 ;
+C -1 ; WX 660 ; N atilde ; B 27 -18 613 767 ;
+C -1 ; WX 660 ; N aring ; B 27 -18 613 834 ;
+C -1 ; WX 640 ; N ocircumflex ; B 25 -18 615 774 ;
+C -1 ; WX 520 ; N Edieresis ; B 61 0 459 939 ;
+C -1 ; WX 840 ; N threequarters ; B 18 0 803 749 ;
+C -1 ; WX 580 ; N ydieresis ; B 8 -185 571 769 ;
+C -1 ; WX 580 ; N yacute ; B 8 -185 571 849 ;
+C -1 ; WX 240 ; N iacute ; B 26 0 305 849 ;
+C -1 ; WX 740 ; N Acircumflex ; B 7 0 732 944 ;
+C -1 ; WX 640 ; N Uacute ; B 55 -15 585 1019 ;
+C -1 ; WX 640 ; N eacute ; B 31 -18 610 849 ;
+C -1 ; WX 840 ; N Ograve ; B 33 -15 807 1021 ;
+C -1 ; WX 660 ; N agrave ; B 27 -18 613 851 ;
+C -1 ; WX 640 ; N Udieresis ; B 55 -15 585 939 ;
+C -1 ; WX 660 ; N acircumflex ; B 27 -18 613 774 ;
+C -1 ; WX 280 ; N Igrave ; B -45 0 234 1021 ;
+C -1 ; WX 336 ; N twosuperior ; B 13 296 322 749 ;
+C -1 ; WX 640 ; N Ugrave ; B 55 -15 585 1021 ;
+C -1 ; WX 840 ; N onequarter ; B 92 0 746 740 ;
+C -1 ; WX 640 ; N Ucircumflex ; B 55 -15 585 944 ;
+C -1 ; WX 520 ; N Scaron ; B 12 -15 493 944 ;
+C -1 ; WX 280 ; N Idieresis ; B -32 0 312 939 ;
+C -1 ; WX 240 ; N idieresis ; B -52 0 292 769 ;
+C -1 ; WX 520 ; N Egrave ; B 61 0 459 1021 ;
+C -1 ; WX 840 ; N Oacute ; B 33 -15 807 1019 ;
+C -1 ; WX 600 ; N divide ; B 48 -20 552 526 ;
+C -1 ; WX 740 ; N Atilde ; B 7 0 732 937 ;
+C -1 ; WX 740 ; N Aring ; B 7 0 732 969 ;
+C -1 ; WX 840 ; N Odieresis ; B 33 -15 807 939 ;
+C -1 ; WX 740 ; N Adieresis ; B 7 0 732 939 ;
+C -1 ; WX 740 ; N Ntilde ; B 70 0 671 937 ;
+C -1 ; WX 500 ; N Zcaron ; B 19 0 481 944 ;
+C -1 ; WX 560 ; N Thorn ; B 72 0 545 740 ;
+C -1 ; WX 280 ; N Iacute ; B 46 0 325 1019 ;
+C -1 ; WX 600 ; N plusminus ; B 48 -62 552 556 ;
+C -1 ; WX 600 ; N multiply ; B 59 12 541 494 ;
+C -1 ; WX 520 ; N Eacute ; B 61 0 459 1019 ;
+C -1 ; WX 620 ; N Ydieresis ; B -2 0 622 939 ;
+C -1 ; WX 336 ; N onesuperior ; B 72 296 223 740 ;
+C -1 ; WX 600 ; N ugrave ; B 50 -18 544 851 ;
+C -1 ; WX 600 ; N logicalnot ; B 48 108 552 425 ;
+C -1 ; WX 600 ; N ntilde ; B 54 0 547 767 ;
+C -1 ; WX 840 ; N Otilde ; B 33 -15 807 937 ;
+C -1 ; WX 640 ; N otilde ; B 25 -18 615 767 ;
+C -1 ; WX 780 ; N Ccedilla ; B 34 -251 766 755 ;
+C -1 ; WX 740 ; N Agrave ; B 7 0 732 1021 ;
+C -1 ; WX 840 ; N onehalf ; B 62 0 771 740 ;
+C -1 ; WX 742 ; N Eth ; B 25 0 691 740 ;
+C -1 ; WX 400 ; N degree ; B 57 426 343 712 ;
+C -1 ; WX 620 ; N Yacute ; B -2 0 622 1019 ;
+C -1 ; WX 840 ; N Ocircumflex ; B 33 -15 807 944 ;
+C -1 ; WX 640 ; N oacute ; B 25 -18 615 849 ;
+C -1 ; WX 576 ; N mu ; B 38 -187 539 555 ;
+C -1 ; WX 600 ; N minus ; B 48 193 552 313 ;
+C -1 ; WX 640 ; N eth ; B 27 -18 616 754 ;
+C -1 ; WX 640 ; N odieresis ; B 25 -18 615 769 ;
+C -1 ; WX 740 ; N copyright ; B -12 -12 752 752 ;
+C -1 ; WX 600 ; N brokenbar ; B 233 -100 366 740 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 218
+
+KPX A y -50
+KPX A w -65
+KPX A v -70
+KPX A u -20
+KPX A quoteright -90
+KPX A Y -80
+KPX A W -60
+KPX A V -102
+KPX A U -40
+KPX A T -25
+KPX A Q -50
+KPX A O -50
+KPX A G -40
+KPX A C -40
+
+KPX B A -10
+
+KPX C A -40
+
+KPX D period -20
+KPX D comma -20
+KPX D Y -45
+KPX D W -25
+KPX D V -50
+KPX D A -50
+
+KPX F period -129
+KPX F e -20
+KPX F comma -162
+KPX F a -20
+KPX F A -75
+
+KPX G period -20
+KPX G comma -20
+KPX G Y -15
+
+KPX J period -15
+KPX J a -20
+KPX J A -30
+
+KPX K y -20
+KPX K u -15
+KPX K o -45
+KPX K e -40
+KPX K O -30
+
+KPX L y -23
+KPX L quoteright -30
+KPX L quotedblright -30
+KPX L Y -80
+KPX L W -55
+KPX L V -85
+KPX L T -46
+
+KPX O period -30
+KPX O comma -30
+KPX O Y -30
+KPX O X -30
+KPX O W -20
+KPX O V -45
+KPX O T -15
+KPX O A -60
+
+KPX P period -200
+KPX P o -20
+KPX P e -20
+KPX P comma -220
+KPX P a -20
+KPX P A -100
+
+KPX Q comma 20
+
+KPX R W 25
+KPX R V -10
+KPX R U 25
+KPX R T 40
+KPX R O 25
+
+KPX S comma 20
+
+KPX T y -10
+KPX T w -55
+KPX T u -46
+KPX T semicolon -29
+KPX T r -30
+KPX T period -91
+KPX T o -49
+KPX T hyphen -75
+KPX T e -49
+KPX T comma -82
+KPX T colon -15
+KPX T a -70
+KPX T O -15
+KPX T A -25
+
+KPX U period -20
+KPX U comma -20
+KPX U A -40
+
+KPX V u -55
+KPX V semicolon -33
+KPX V period -145
+KPX V o -101
+KPX V i -15
+KPX V hyphen -75
+KPX V e -101
+KPX V comma -145
+KPX V colon -18
+KPX V a -95
+KPX V O -45
+KPX V G -20
+KPX V A -102
+
+KPX W y -15
+KPX W u -30
+KPX W semicolon -33
+KPX W period -106
+KPX W o -46
+KPX W i -10
+KPX W hyphen -35
+KPX W e -47
+KPX W comma -106
+KPX W colon -15
+KPX W a -50
+KPX W O -20
+KPX W A -58
+
+KPX Y u -52
+KPX Y semicolon -23
+KPX Y period -145
+KPX Y o -89
+KPX Y hyphen -100
+KPX Y e -89
+KPX Y comma -145
+KPX Y colon -10
+KPX Y a -93
+KPX Y O -30
+KPX Y A -80
+
+KPX a t 5
+KPX a p 20
+KPX a b 5
+
+KPX b y -20
+KPX b v -20
+
+KPX c y -20
+KPX c l -15
+KPX c k -15
+
+KPX comma space -50
+KPX comma quoteright -70
+KPX comma quotedblright -70
+
+KPX e y -20
+KPX e x -20
+KPX e w -20
+KPX e v -20
+
+KPX f period -40
+KPX f o -20
+KPX f l -15
+KPX f i -15
+KPX f f -20
+KPX f dotlessi -15
+KPX f comma -40
+KPX f a -15
+
+KPX g i 25
+KPX g a 15
+
+KPX h y -30
+
+KPX k y -5
+KPX k o -30
+KPX k e -40
+
+KPX m y -20
+KPX m u -20
+
+KPX n y -15
+KPX n v -30
+
+KPX o y -20
+KPX o x -30
+KPX o w -20
+KPX o v -30
+
+KPX p y -20
+
+KPX period space -50
+KPX period quoteright -70
+KPX period quotedblright -70
+
+KPX quotedblleft A -50
+
+KPX quotedblright space -50
+
+KPX quoteleft quoteleft -80
+KPX quoteleft A -50
+
+KPX quoteright v -10
+KPX quoteright t 10
+KPX quoteright space -50
+KPX quoteright s -15
+KPX quoteright r -20
+KPX quoteright quoteright -80
+KPX quoteright d -50
+
+KPX r y 40
+KPX r v 40
+KPX r u 20
+KPX r t 20
+KPX r s 20
+KPX r q -8
+KPX r period -73
+KPX r p 20
+KPX r o -15
+KPX r n 21
+KPX r m 15
+KPX r l 20
+KPX r k 5
+KPX r i 20
+KPX r hyphen -60
+KPX r g 1
+KPX r e -4
+KPX r d -6
+KPX r comma -75
+KPX r c -7
+
+KPX s period 20
+KPX s comma 20
+
+KPX space quoteleft -50
+KPX space quotedblleft -50
+KPX space Y -60
+KPX space W -25
+KPX space V -80
+KPX space T -25
+KPX space A -20
+
+KPX v period -90
+KPX v o -20
+KPX v e -20
+KPX v comma -90
+KPX v a -30
+
+KPX w period -90
+KPX w o -30
+KPX w e -20
+KPX w comma -90
+KPX w a -30
+
+KPX x e -20
+
+KPX y period -100
+KPX y o -30
+KPX y e -20
+KPX y comma -100
+KPX y c -35
+KPX y a -30
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 170 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 100 170 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 120 170 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 160 170 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 190 135 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 130 170 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 50 170 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex -10 170 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 10 170 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 50 170 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -45 170 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -130 170 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -110 170 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -95 170 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 130 170 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 210 170 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 150 170 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 170 170 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 210 170 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 180 170 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron -10 170 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 145 170 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 50 170 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 70 170 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 75 170 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 135 170 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 60 170 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 5 170 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 120 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 60 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 120 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 150 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 90 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 110 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 50 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 70 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 110 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -65 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -150 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -130 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -115 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 60 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 110 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 50 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 70 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 80 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron -50 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 125 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 30 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 50 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 55 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 115 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 40 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron -15 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagdo8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagdo8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..c348b117779eec742c6fea344f7b097d0a64329e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagdo8a.afm
@@ -0,0 +1,576 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Mar 4 13:49:44 1991
+Comment UniqueID 34373
+Comment VMusage 6550 39938
+FontName AvantGarde-DemiOblique
+FullName ITC Avant Garde Gothic Demi Oblique
+FamilyName ITC Avant Garde Gothic
+Weight Demi
+ItalicAngle -10.5
+IsFixedPitch false
+FontBBox -123 -251 1256 1021
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 740
+XHeight 555
+Ascender 740
+Descender -185
+StartCharMetrics 228
+C 32 ; WX 280 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 280 ; N exclam ; B 73 0 343 740 ;
+C 34 ; WX 360 ; N quotedbl ; B 127 444 478 740 ;
+C 35 ; WX 560 ; N numbersign ; B 66 0 618 700 ;
+C 36 ; WX 560 ; N dollar ; B 99 -86 582 857 ;
+C 37 ; WX 860 ; N percent ; B 139 -15 856 755 ;
+C 38 ; WX 680 ; N ampersand ; B 71 -15 742 755 ;
+C 39 ; WX 280 ; N quoteright ; B 159 466 342 740 ;
+C 40 ; WX 380 ; N parenleft ; B 120 -157 490 754 ;
+C 41 ; WX 380 ; N parenright ; B 8 -157 378 754 ;
+C 42 ; WX 440 ; N asterisk ; B 174 457 492 755 ;
+C 43 ; WX 600 ; N plus ; B 84 0 610 506 ;
+C 44 ; WX 280 ; N comma ; B 48 -141 231 133 ;
+C 45 ; WX 420 ; N hyphen ; B 114 230 413 348 ;
+C 46 ; WX 280 ; N period ; B 73 0 231 133 ;
+C 47 ; WX 460 ; N slash ; B -13 -100 591 740 ;
+C 48 ; WX 560 ; N zero ; B 70 -15 628 755 ;
+C 49 ; WX 560 ; N one ; B 230 0 500 740 ;
+C 50 ; WX 560 ; N two ; B 44 0 622 755 ;
+C 51 ; WX 560 ; N three ; B 67 -15 585 755 ;
+C 52 ; WX 560 ; N four ; B 36 0 604 740 ;
+C 53 ; WX 560 ; N five ; B 64 -15 600 740 ;
+C 54 ; WX 560 ; N six ; B 64 -15 587 739 ;
+C 55 ; WX 560 ; N seven ; B 83 0 635 740 ;
+C 56 ; WX 560 ; N eight ; B 71 -15 590 755 ;
+C 57 ; WX 560 ; N nine ; B 110 0 633 754 ;
+C 58 ; WX 280 ; N colon ; B 73 0 309 555 ;
+C 59 ; WX 280 ; N semicolon ; B 48 -141 309 555 ;
+C 60 ; WX 600 ; N less ; B 84 -8 649 514 ;
+C 61 ; WX 600 ; N equal ; B 63 81 631 425 ;
+C 62 ; WX 600 ; N greater ; B 45 -8 610 514 ;
+C 63 ; WX 560 ; N question ; B 135 0 593 755 ;
+C 64 ; WX 740 ; N at ; B 109 -12 832 712 ;
+C 65 ; WX 740 ; N A ; B 7 0 732 740 ;
+C 66 ; WX 580 ; N B ; B 70 0 610 740 ;
+C 67 ; WX 780 ; N C ; B 97 -15 864 755 ;
+C 68 ; WX 700 ; N D ; B 63 0 732 740 ;
+C 69 ; WX 520 ; N E ; B 61 0 596 740 ;
+C 70 ; WX 480 ; N F ; B 61 0 575 740 ;
+C 71 ; WX 840 ; N G ; B 89 -15 887 755 ;
+C 72 ; WX 680 ; N H ; B 71 0 747 740 ;
+C 73 ; WX 280 ; N I ; B 72 0 346 740 ;
+C 74 ; WX 480 ; N J ; B 34 -15 546 740 ;
+C 75 ; WX 620 ; N K ; B 89 0 757 740 ;
+C 76 ; WX 440 ; N L ; B 72 0 459 740 ;
+C 77 ; WX 900 ; N M ; B 63 0 974 740 ;
+C 78 ; WX 740 ; N N ; B 70 0 808 740 ;
+C 79 ; WX 840 ; N O ; B 95 -15 882 755 ;
+C 80 ; WX 560 ; N P ; B 72 0 645 740 ;
+C 81 ; WX 840 ; N Q ; B 94 -15 882 755 ;
+C 82 ; WX 580 ; N R ; B 64 0 656 740 ;
+C 83 ; WX 520 ; N S ; B 49 -15 578 755 ;
+C 84 ; WX 420 ; N T ; B 119 0 555 740 ;
+C 85 ; WX 640 ; N U ; B 97 -15 722 740 ;
+C 86 ; WX 700 ; N V ; B 145 0 832 740 ;
+C 87 ; WX 900 ; N W ; B 144 0 1036 740 ;
+C 88 ; WX 680 ; N X ; B 4 0 813 740 ;
+C 89 ; WX 620 ; N Y ; B 135 0 759 740 ;
+C 90 ; WX 500 ; N Z ; B 19 0 599 740 ;
+C 91 ; WX 320 ; N bracketleft ; B 89 -157 424 754 ;
+C 92 ; WX 640 ; N backslash ; B 233 -100 525 740 ;
+C 93 ; WX 320 ; N bracketright ; B 7 -157 342 754 ;
+C 94 ; WX 600 ; N asciicircum ; B 142 375 596 740 ;
+C 95 ; WX 500 ; N underscore ; B -23 -125 486 -75 ;
+C 96 ; WX 280 ; N quoteleft ; B 158 466 341 740 ;
+C 97 ; WX 660 ; N a ; B 73 -18 716 574 ;
+C 98 ; WX 660 ; N b ; B 47 -18 689 740 ;
+C 99 ; WX 640 ; N c ; B 84 -18 679 574 ;
+C 100 ; WX 660 ; N d ; B 80 -18 755 740 ;
+C 101 ; WX 640 ; N e ; B 77 -18 667 577 ;
+C 102 ; WX 280 ; N f ; B 62 0 420 755 ; L i fi ; L l fl ;
+C 103 ; WX 660 ; N g ; B 33 -226 726 574 ;
+C 104 ; WX 600 ; N h ; B 54 0 614 740 ;
+C 105 ; WX 240 ; N i ; B 53 0 323 740 ;
+C 106 ; WX 260 ; N j ; B -18 -185 342 740 ;
+C 107 ; WX 580 ; N k ; B 80 0 648 740 ;
+C 108 ; WX 240 ; N l ; B 54 0 324 740 ;
+C 109 ; WX 940 ; N m ; B 54 0 954 574 ;
+C 110 ; WX 600 ; N n ; B 54 0 613 574 ;
+C 111 ; WX 640 ; N o ; B 71 -18 672 574 ;
+C 112 ; WX 660 ; N p ; B 13 -185 686 574 ;
+C 113 ; WX 660 ; N q ; B 78 -185 716 574 ;
+C 114 ; WX 320 ; N r ; B 63 0 423 574 ;
+C 115 ; WX 440 ; N s ; B 49 -18 483 574 ;
+C 116 ; WX 300 ; N t ; B 86 0 402 740 ;
+C 117 ; WX 600 ; N u ; B 87 -18 647 555 ;
+C 118 ; WX 560 ; N v ; B 106 0 659 555 ;
+C 119 ; WX 800 ; N w ; B 114 0 892 555 ;
+C 120 ; WX 560 ; N x ; B 3 0 632 555 ;
+C 121 ; WX 580 ; N y ; B 75 -185 674 555 ;
+C 122 ; WX 460 ; N z ; B 20 0 528 555 ;
+C 123 ; WX 340 ; N braceleft ; B 40 -191 455 747 ;
+C 124 ; WX 600 ; N bar ; B 214 -100 503 740 ;
+C 125 ; WX 340 ; N braceright ; B -12 -191 405 747 ;
+C 126 ; WX 600 ; N asciitilde ; B 114 160 579 347 ;
+C 161 ; WX 280 ; N exclamdown ; B 40 -185 310 555 ;
+C 162 ; WX 560 ; N cent ; B 110 39 599 715 ;
+C 163 ; WX 560 ; N sterling ; B 38 0 615 755 ;
+C 164 ; WX 160 ; N fraction ; B -123 0 419 740 ;
+C 165 ; WX 560 ; N yen ; B 83 0 707 740 ;
+C 166 ; WX 560 ; N florin ; B -27 -151 664 824 ;
+C 167 ; WX 560 ; N section ; B 65 -158 602 755 ;
+C 168 ; WX 560 ; N currency ; B 53 69 628 577 ;
+C 169 ; WX 220 ; N quotesingle ; B 152 444 314 740 ;
+C 170 ; WX 480 ; N quotedblleft ; B 156 466 546 740 ;
+C 171 ; WX 460 ; N guillemotleft ; B 105 108 487 469 ;
+C 172 ; WX 240 ; N guilsinglleft ; B 94 108 277 469 ;
+C 173 ; WX 240 ; N guilsinglright ; B 70 108 253 469 ;
+C 174 ; WX 520 ; N fi ; B 72 0 598 755 ;
+C 175 ; WX 520 ; N fl ; B 72 0 598 755 ;
+C 177 ; WX 500 ; N endash ; B 78 230 529 348 ;
+C 178 ; WX 560 ; N dagger ; B 133 -142 612 740 ;
+C 179 ; WX 560 ; N daggerdbl ; B 63 -142 618 740 ;
+C 180 ; WX 280 ; N periodcentered ; B 108 187 265 320 ;
+C 182 ; WX 600 ; N paragraph ; B 90 -103 744 740 ;
+C 183 ; WX 600 ; N bullet ; B 215 222 526 532 ;
+C 184 ; WX 280 ; N quotesinglbase ; B 47 -141 230 133 ;
+C 185 ; WX 480 ; N quotedblbase ; B 45 -141 435 133 ;
+C 186 ; WX 480 ; N quotedblright ; B 157 466 547 740 ;
+C 187 ; WX 460 ; N guillemotright ; B 81 108 463 469 ;
+C 188 ; WX 1000 ; N ellipsis ; B 100 0 924 133 ;
+C 189 ; WX 1280 ; N perthousand ; B 139 -15 1256 755 ;
+C 191 ; WX 560 ; N questiondown ; B 69 -200 527 555 ;
+C 193 ; WX 420 ; N grave ; B 189 624 462 851 ;
+C 194 ; WX 420 ; N acute ; B 224 624 508 849 ;
+C 195 ; WX 540 ; N circumflex ; B 189 636 588 774 ;
+C 196 ; WX 480 ; N tilde ; B 178 636 564 767 ;
+C 197 ; WX 420 ; N macron ; B 192 648 490 759 ;
+C 198 ; WX 480 ; N breve ; B 185 633 582 770 ;
+C 199 ; WX 280 ; N dotaccent ; B 192 636 350 769 ;
+C 200 ; WX 500 ; N dieresis ; B 196 636 565 769 ;
+C 202 ; WX 360 ; N ring ; B 206 619 424 834 ;
+C 203 ; WX 340 ; N cedilla ; B 67 -251 272 6 ;
+C 205 ; WX 700 ; N hungarumlaut ; B 258 610 754 862 ;
+C 206 ; WX 340 ; N ogonek ; B 59 -195 243 9 ;
+C 207 ; WX 540 ; N caron ; B 214 636 613 774 ;
+C 208 ; WX 1000 ; N emdash ; B 78 230 1029 348 ;
+C 225 ; WX 900 ; N AE ; B -5 0 961 740 ;
+C 227 ; WX 360 ; N ordfeminine ; B 127 438 472 755 ;
+C 232 ; WX 480 ; N Lslash ; B 68 0 484 740 ;
+C 233 ; WX 840 ; N Oslash ; B 94 -71 891 814 ;
+C 234 ; WX 1060 ; N OE ; B 98 -15 1144 755 ;
+C 235 ; WX 360 ; N ordmasculine ; B 131 438 451 755 ;
+C 241 ; WX 1080 ; N ae ; B 75 -18 1105 574 ;
+C 245 ; WX 240 ; N dotlessi ; B 53 0 289 555 ;
+C 248 ; WX 320 ; N lslash ; B 74 0 404 740 ;
+C 249 ; WX 660 ; N oslash ; B 81 -50 685 608 ;
+C 250 ; WX 1080 ; N oe ; B 76 -18 1108 574 ;
+C 251 ; WX 600 ; N germandbls ; B 51 -18 629 755 ;
+C -1 ; WX 640 ; N ecircumflex ; B 77 -18 667 774 ;
+C -1 ; WX 640 ; N edieresis ; B 77 -18 667 769 ;
+C -1 ; WX 660 ; N aacute ; B 73 -18 716 849 ;
+C -1 ; WX 740 ; N registered ; B 50 -12 827 752 ;
+C -1 ; WX 240 ; N icircumflex ; B 39 0 438 774 ;
+C -1 ; WX 600 ; N udieresis ; B 87 -18 647 769 ;
+C -1 ; WX 640 ; N ograve ; B 71 -18 672 851 ;
+C -1 ; WX 600 ; N uacute ; B 87 -18 647 849 ;
+C -1 ; WX 600 ; N ucircumflex ; B 87 -18 647 774 ;
+C -1 ; WX 740 ; N Aacute ; B 7 0 732 1019 ;
+C -1 ; WX 240 ; N igrave ; B 53 0 347 851 ;
+C -1 ; WX 280 ; N Icircumflex ; B 72 0 489 944 ;
+C -1 ; WX 640 ; N ccedilla ; B 83 -251 679 574 ;
+C -1 ; WX 660 ; N adieresis ; B 73 -18 716 769 ;
+C -1 ; WX 520 ; N Ecircumflex ; B 61 0 609 944 ;
+C -1 ; WX 440 ; N scaron ; B 49 -18 563 774 ;
+C -1 ; WX 660 ; N thorn ; B 13 -185 686 740 ;
+C -1 ; WX 1000 ; N trademark ; B 131 296 958 740 ;
+C -1 ; WX 640 ; N egrave ; B 77 -18 667 851 ;
+C -1 ; WX 336 ; N threesuperior ; B 87 287 413 749 ;
+C -1 ; WX 460 ; N zcaron ; B 20 0 598 774 ;
+C -1 ; WX 660 ; N atilde ; B 73 -18 716 767 ;
+C -1 ; WX 660 ; N aring ; B 73 -18 716 834 ;
+C -1 ; WX 640 ; N ocircumflex ; B 71 -18 672 774 ;
+C -1 ; WX 520 ; N Edieresis ; B 61 0 606 939 ;
+C -1 ; WX 840 ; N threequarters ; B 97 0 836 749 ;
+C -1 ; WX 580 ; N ydieresis ; B 75 -185 674 769 ;
+C -1 ; WX 580 ; N yacute ; B 75 -185 674 849 ;
+C -1 ; WX 240 ; N iacute ; B 53 0 443 849 ;
+C -1 ; WX 740 ; N Acircumflex ; B 7 0 732 944 ;
+C -1 ; WX 640 ; N Uacute ; B 97 -15 722 1019 ;
+C -1 ; WX 640 ; N eacute ; B 77 -18 667 849 ;
+C -1 ; WX 840 ; N Ograve ; B 95 -15 882 1021 ;
+C -1 ; WX 660 ; N agrave ; B 73 -18 716 851 ;
+C -1 ; WX 640 ; N Udieresis ; B 97 -15 722 939 ;
+C -1 ; WX 660 ; N acircumflex ; B 73 -18 716 774 ;
+C -1 ; WX 280 ; N Igrave ; B 72 0 398 1021 ;
+C -1 ; WX 336 ; N twosuperior ; B 73 296 436 749 ;
+C -1 ; WX 640 ; N Ugrave ; B 97 -15 722 1021 ;
+C -1 ; WX 840 ; N onequarter ; B 187 0 779 740 ;
+C -1 ; WX 640 ; N Ucircumflex ; B 97 -15 722 944 ;
+C -1 ; WX 520 ; N Scaron ; B 49 -15 635 944 ;
+C -1 ; WX 280 ; N Idieresis ; B 72 0 486 939 ;
+C -1 ; WX 240 ; N idieresis ; B 53 0 435 769 ;
+C -1 ; WX 520 ; N Egrave ; B 61 0 596 1021 ;
+C -1 ; WX 840 ; N Oacute ; B 95 -15 882 1019 ;
+C -1 ; WX 600 ; N divide ; B 84 -20 610 526 ;
+C -1 ; WX 740 ; N Atilde ; B 7 0 732 937 ;
+C -1 ; WX 740 ; N Aring ; B 7 0 732 969 ;
+C -1 ; WX 840 ; N Odieresis ; B 95 -15 882 939 ;
+C -1 ; WX 740 ; N Adieresis ; B 7 0 732 939 ;
+C -1 ; WX 740 ; N Ntilde ; B 70 0 808 937 ;
+C -1 ; WX 500 ; N Zcaron ; B 19 0 650 944 ;
+C -1 ; WX 560 ; N Thorn ; B 72 0 619 740 ;
+C -1 ; WX 280 ; N Iacute ; B 72 0 494 1019 ;
+C -1 ; WX 600 ; N plusminus ; B 37 -62 626 556 ;
+C -1 ; WX 600 ; N multiply ; B 76 12 617 494 ;
+C -1 ; WX 520 ; N Eacute ; B 61 0 596 1019 ;
+C -1 ; WX 620 ; N Ydieresis ; B 135 0 759 939 ;
+C -1 ; WX 336 ; N onesuperior ; B 182 296 360 740 ;
+C -1 ; WX 600 ; N ugrave ; B 87 -18 647 851 ;
+C -1 ; WX 600 ; N logicalnot ; B 105 108 631 425 ;
+C -1 ; WX 600 ; N ntilde ; B 54 0 624 767 ;
+C -1 ; WX 840 ; N Otilde ; B 95 -15 882 937 ;
+C -1 ; WX 640 ; N otilde ; B 71 -18 672 767 ;
+C -1 ; WX 780 ; N Ccedilla ; B 97 -251 864 755 ;
+C -1 ; WX 740 ; N Agrave ; B 7 0 732 1021 ;
+C -1 ; WX 840 ; N onehalf ; B 157 0 830 740 ;
+C -1 ; WX 742 ; N Eth ; B 83 0 766 740 ;
+C -1 ; WX 400 ; N degree ; B 160 426 451 712 ;
+C -1 ; WX 620 ; N Yacute ; B 135 0 759 1019 ;
+C -1 ; WX 840 ; N Ocircumflex ; B 95 -15 882 944 ;
+C -1 ; WX 640 ; N oacute ; B 71 -18 672 849 ;
+C -1 ; WX 576 ; N mu ; B 3 -187 642 555 ;
+C -1 ; WX 600 ; N minus ; B 84 193 610 313 ;
+C -1 ; WX 640 ; N eth ; B 73 -18 699 754 ;
+C -1 ; WX 640 ; N odieresis ; B 71 -18 672 769 ;
+C -1 ; WX 740 ; N copyright ; B 50 -12 827 752 ;
+C -1 ; WX 600 ; N brokenbar ; B 214 -100 503 740 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 218
+
+KPX A y -50
+KPX A w -65
+KPX A v -70
+KPX A u -20
+KPX A quoteright -90
+KPX A Y -80
+KPX A W -60
+KPX A V -102
+KPX A U -40
+KPX A T -25
+KPX A Q -50
+KPX A O -50
+KPX A G -40
+KPX A C -40
+
+KPX B A -10
+
+KPX C A -40
+
+KPX D period -20
+KPX D comma -20
+KPX D Y -45
+KPX D W -25
+KPX D V -50
+KPX D A -50
+
+KPX F period -129
+KPX F e -20
+KPX F comma -162
+KPX F a -20
+KPX F A -75
+
+KPX G period -20
+KPX G comma -20
+KPX G Y -15
+
+KPX J period -15
+KPX J a -20
+KPX J A -30
+
+KPX K y -20
+KPX K u -15
+KPX K o -45
+KPX K e -40
+KPX K O -30
+
+KPX L y -23
+KPX L quoteright -30
+KPX L quotedblright -30
+KPX L Y -80
+KPX L W -55
+KPX L V -85
+KPX L T -46
+
+KPX O period -30
+KPX O comma -30
+KPX O Y -30
+KPX O X -30
+KPX O W -20
+KPX O V -45
+KPX O T -15
+KPX O A -60
+
+KPX P period -200
+KPX P o -20
+KPX P e -20
+KPX P comma -220
+KPX P a -20
+KPX P A -100
+
+KPX Q comma 20
+
+KPX R W 25
+KPX R V -10
+KPX R U 25
+KPX R T 40
+KPX R O 25
+
+KPX S comma 20
+
+KPX T y -10
+KPX T w -55
+KPX T u -46
+KPX T semicolon -29
+KPX T r -30
+KPX T period -91
+KPX T o -49
+KPX T hyphen -75
+KPX T e -49
+KPX T comma -82
+KPX T colon -15
+KPX T a -70
+KPX T O -15
+KPX T A -25
+
+KPX U period -20
+KPX U comma -20
+KPX U A -40
+
+KPX V u -55
+KPX V semicolon -33
+KPX V period -145
+KPX V o -101
+KPX V i -15
+KPX V hyphen -75
+KPX V e -101
+KPX V comma -145
+KPX V colon -18
+KPX V a -95
+KPX V O -45
+KPX V G -20
+KPX V A -102
+
+KPX W y -15
+KPX W u -30
+KPX W semicolon -33
+KPX W period -106
+KPX W o -46
+KPX W i -10
+KPX W hyphen -35
+KPX W e -47
+KPX W comma -106
+KPX W colon -15
+KPX W a -50
+KPX W O -20
+KPX W A -58
+
+KPX Y u -52
+KPX Y semicolon -23
+KPX Y period -145
+KPX Y o -89
+KPX Y hyphen -100
+KPX Y e -89
+KPX Y comma -145
+KPX Y colon -10
+KPX Y a -93
+KPX Y O -30
+KPX Y A -80
+
+KPX a t 5
+KPX a p 20
+KPX a b 5
+
+KPX b y -20
+KPX b v -20
+
+KPX c y -20
+KPX c l -15
+KPX c k -15
+
+KPX comma space -50
+KPX comma quoteright -70
+KPX comma quotedblright -70
+
+KPX e y -20
+KPX e x -20
+KPX e w -20
+KPX e v -20
+
+KPX f period -40
+KPX f o -20
+KPX f l -15
+KPX f i -15
+KPX f f -20
+KPX f dotlessi -15
+KPX f comma -40
+KPX f a -15
+
+KPX g i 25
+KPX g a 15
+
+KPX h y -30
+
+KPX k y -5
+KPX k o -30
+KPX k e -40
+
+KPX m y -20
+KPX m u -20
+
+KPX n y -15
+KPX n v -30
+
+KPX o y -20
+KPX o x -30
+KPX o w -20
+KPX o v -30
+
+KPX p y -20
+
+KPX period space -50
+KPX period quoteright -70
+KPX period quotedblright -70
+
+KPX quotedblleft A -50
+
+KPX quotedblright space -50
+
+KPX quoteleft quoteleft -80
+KPX quoteleft A -50
+
+KPX quoteright v -10
+KPX quoteright t 10
+KPX quoteright space -50
+KPX quoteright s -15
+KPX quoteright r -20
+KPX quoteright quoteright -80
+KPX quoteright d -50
+
+KPX r y 40
+KPX r v 40
+KPX r u 20
+KPX r t 20
+KPX r s 20
+KPX r q -8
+KPX r period -73
+KPX r p 20
+KPX r o -15
+KPX r n 21
+KPX r m 15
+KPX r l 20
+KPX r k 5
+KPX r i 20
+KPX r hyphen -60
+KPX r g 1
+KPX r e -4
+KPX r d -6
+KPX r comma -75
+KPX r c -7
+
+KPX s period 20
+KPX s comma 20
+
+KPX space quoteleft -50
+KPX space quotedblleft -50
+KPX space Y -60
+KPX space W -25
+KPX space V -80
+KPX space T -25
+KPX space A -20
+
+KPX v period -90
+KPX v o -20
+KPX v e -20
+KPX v comma -90
+KPX v a -30
+
+KPX w period -90
+KPX w o -30
+KPX w e -20
+KPX w comma -90
+KPX w a -30
+
+KPX x e -20
+
+KPX y period -100
+KPX y o -30
+KPX y e -20
+KPX y comma -100
+KPX y c -35
+KPX y a -30
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 192 170 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 132 170 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 152 170 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 192 170 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 215 135 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 162 170 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 82 170 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 22 170 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 42 170 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 82 170 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -13 170 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -98 170 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -78 170 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -63 170 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 162 170 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 242 170 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 182 170 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 202 170 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 242 170 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 212 170 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 22 170 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 177 170 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 82 170 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 102 170 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 107 170 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 167 170 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 92 170 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 37 170 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 120 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 60 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 120 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 150 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 90 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 110 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 50 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 70 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 110 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -65 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -150 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -130 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -115 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 60 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 110 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 50 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 70 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 80 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron -50 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 125 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 30 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 50 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 55 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 115 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 40 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron -15 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagk8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagk8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..53b03bbb88f46f55090cd5fdd37da4ceb98be3ce
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagk8a.afm
@@ -0,0 +1,573 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Mar 4 13:37:31 1991
+Comment UniqueID 34364
+Comment VMusage 24225 31117
+FontName AvantGarde-Book
+FullName ITC Avant Garde Gothic Book
+FamilyName ITC Avant Garde Gothic
+Weight Book
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -113 -222 1148 955
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.006
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 740
+XHeight 547
+Ascender 740
+Descender -192
+StartCharMetrics 228
+C 32 ; WX 277 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 295 ; N exclam ; B 111 0 185 740 ;
+C 34 ; WX 309 ; N quotedbl ; B 36 444 273 740 ;
+C 35 ; WX 554 ; N numbersign ; B 33 0 521 740 ;
+C 36 ; WX 554 ; N dollar ; B 70 -70 485 811 ;
+C 37 ; WX 775 ; N percent ; B 21 -13 753 751 ;
+C 38 ; WX 757 ; N ampersand ; B 56 -12 736 753 ;
+C 39 ; WX 351 ; N quoteright ; B 94 546 256 740 ;
+C 40 ; WX 369 ; N parenleft ; B 47 -205 355 757 ;
+C 41 ; WX 369 ; N parenright ; B 14 -205 322 757 ;
+C 42 ; WX 425 ; N asterisk ; B 58 446 367 740 ;
+C 43 ; WX 606 ; N plus ; B 51 0 555 506 ;
+C 44 ; WX 277 ; N comma ; B 14 -67 176 126 ;
+C 45 ; WX 332 ; N hyphen ; B 30 248 302 315 ;
+C 46 ; WX 277 ; N period ; B 102 0 176 126 ;
+C 47 ; WX 437 ; N slash ; B 44 -100 403 740 ;
+C 48 ; WX 554 ; N zero ; B 29 -13 525 753 ;
+C 49 ; WX 554 ; N one ; B 135 0 336 740 ;
+C 50 ; WX 554 ; N two ; B 40 0 514 753 ;
+C 51 ; WX 554 ; N three ; B 34 -13 506 753 ;
+C 52 ; WX 554 ; N four ; B 14 0 528 740 ;
+C 53 ; WX 554 ; N five ; B 26 -13 530 740 ;
+C 54 ; WX 554 ; N six ; B 24 -13 530 739 ;
+C 55 ; WX 554 ; N seven ; B 63 0 491 740 ;
+C 56 ; WX 554 ; N eight ; B 41 -13 513 753 ;
+C 57 ; WX 554 ; N nine ; B 24 0 530 752 ;
+C 58 ; WX 277 ; N colon ; B 102 0 176 548 ;
+C 59 ; WX 277 ; N semicolon ; B 14 -67 176 548 ;
+C 60 ; WX 606 ; N less ; B 46 -8 554 514 ;
+C 61 ; WX 606 ; N equal ; B 51 118 555 388 ;
+C 62 ; WX 606 ; N greater ; B 52 -8 560 514 ;
+C 63 ; WX 591 ; N question ; B 64 0 526 752 ;
+C 64 ; WX 867 ; N at ; B 65 -13 803 753 ;
+C 65 ; WX 740 ; N A ; B 12 0 729 740 ;
+C 66 ; WX 574 ; N B ; B 74 0 544 740 ;
+C 67 ; WX 813 ; N C ; B 43 -13 771 752 ;
+C 68 ; WX 744 ; N D ; B 74 0 699 740 ;
+C 69 ; WX 536 ; N E ; B 70 0 475 740 ;
+C 70 ; WX 485 ; N F ; B 70 0 444 740 ;
+C 71 ; WX 872 ; N G ; B 40 -13 828 753 ;
+C 72 ; WX 683 ; N H ; B 76 0 607 740 ;
+C 73 ; WX 226 ; N I ; B 76 0 150 740 ;
+C 74 ; WX 482 ; N J ; B 6 -13 402 740 ;
+C 75 ; WX 591 ; N K ; B 81 0 591 740 ;
+C 76 ; WX 462 ; N L ; B 82 0 462 740 ;
+C 77 ; WX 919 ; N M ; B 76 0 843 740 ;
+C 78 ; WX 740 ; N N ; B 75 0 664 740 ;
+C 79 ; WX 869 ; N O ; B 43 -13 826 753 ;
+C 80 ; WX 592 ; N P ; B 75 0 564 740 ;
+C 81 ; WX 871 ; N Q ; B 40 -13 837 753 ;
+C 82 ; WX 607 ; N R ; B 70 0 572 740 ;
+C 83 ; WX 498 ; N S ; B 22 -13 473 753 ;
+C 84 ; WX 426 ; N T ; B 6 0 419 740 ;
+C 85 ; WX 655 ; N U ; B 75 -13 579 740 ;
+C 86 ; WX 702 ; N V ; B 8 0 693 740 ;
+C 87 ; WX 960 ; N W ; B 11 0 950 740 ;
+C 88 ; WX 609 ; N X ; B 8 0 602 740 ;
+C 89 ; WX 592 ; N Y ; B 1 0 592 740 ;
+C 90 ; WX 480 ; N Z ; B 12 0 470 740 ;
+C 91 ; WX 351 ; N bracketleft ; B 133 -179 337 753 ;
+C 92 ; WX 605 ; N backslash ; B 118 -100 477 740 ;
+C 93 ; WX 351 ; N bracketright ; B 14 -179 218 753 ;
+C 94 ; WX 606 ; N asciicircum ; B 53 307 553 740 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 351 ; N quoteleft ; B 95 546 257 740 ;
+C 97 ; WX 683 ; N a ; B 42 -13 621 561 ;
+C 98 ; WX 682 ; N b ; B 68 -13 647 740 ;
+C 99 ; WX 647 ; N c ; B 41 -13 607 561 ;
+C 100 ; WX 685 ; N d ; B 39 -13 618 740 ;
+C 101 ; WX 650 ; N e ; B 38 -13 608 561 ;
+C 102 ; WX 314 ; N f ; B 19 0 314 753 ; L i fi ; L l fl ;
+C 103 ; WX 673 ; N g ; B 37 -215 606 561 ;
+C 104 ; WX 610 ; N h ; B 62 0 543 740 ;
+C 105 ; WX 200 ; N i ; B 65 0 135 740 ;
+C 106 ; WX 203 ; N j ; B -44 -192 137 740 ;
+C 107 ; WX 502 ; N k ; B 70 0 498 740 ;
+C 108 ; WX 200 ; N l ; B 65 0 135 740 ;
+C 109 ; WX 938 ; N m ; B 66 0 872 561 ;
+C 110 ; WX 610 ; N n ; B 65 0 546 561 ;
+C 111 ; WX 655 ; N o ; B 42 -13 614 561 ;
+C 112 ; WX 682 ; N p ; B 64 -192 643 561 ;
+C 113 ; WX 682 ; N q ; B 37 -192 616 561 ;
+C 114 ; WX 301 ; N r ; B 65 0 291 561 ;
+C 115 ; WX 388 ; N s ; B 24 -13 364 561 ;
+C 116 ; WX 339 ; N t ; B 14 0 330 740 ;
+C 117 ; WX 608 ; N u ; B 62 -13 541 547 ;
+C 118 ; WX 554 ; N v ; B 7 0 546 547 ;
+C 119 ; WX 831 ; N w ; B 13 0 820 547 ;
+C 120 ; WX 480 ; N x ; B 12 0 468 547 ;
+C 121 ; WX 536 ; N y ; B 15 -192 523 547 ;
+C 122 ; WX 425 ; N z ; B 10 0 415 547 ;
+C 123 ; WX 351 ; N braceleft ; B 70 -189 331 740 ;
+C 124 ; WX 672 ; N bar ; B 299 -100 373 740 ;
+C 125 ; WX 351 ; N braceright ; B 20 -189 281 740 ;
+C 126 ; WX 606 ; N asciitilde ; B 72 179 534 319 ;
+C 161 ; WX 295 ; N exclamdown ; B 110 -192 184 548 ;
+C 162 ; WX 554 ; N cent ; B 48 62 510 707 ;
+C 163 ; WX 554 ; N sterling ; B 4 0 552 753 ;
+C 164 ; WX 166 ; N fraction ; B -113 0 280 740 ;
+C 165 ; WX 554 ; N yen ; B 4 0 550 740 ;
+C 166 ; WX 554 ; N florin ; B -12 -153 518 818 ;
+C 167 ; WX 615 ; N section ; B 85 -141 529 753 ;
+C 168 ; WX 554 ; N currency ; B 8 42 546 580 ;
+C 169 ; WX 198 ; N quotesingle ; B 59 444 140 740 ;
+C 170 ; WX 502 ; N quotedblleft ; B 97 546 406 740 ;
+C 171 ; WX 425 ; N guillemotleft ; B 40 81 386 481 ;
+C 172 ; WX 251 ; N guilsinglleft ; B 40 81 212 481 ;
+C 173 ; WX 251 ; N guilsinglright ; B 39 81 211 481 ;
+C 174 ; WX 487 ; N fi ; B 19 0 422 753 ;
+C 175 ; WX 485 ; N fl ; B 19 0 420 753 ;
+C 177 ; WX 500 ; N endash ; B 35 248 465 315 ;
+C 178 ; WX 553 ; N dagger ; B 59 -133 493 740 ;
+C 179 ; WX 553 ; N daggerdbl ; B 59 -133 493 740 ;
+C 180 ; WX 277 ; N periodcentered ; B 102 190 176 316 ;
+C 182 ; WX 564 ; N paragraph ; B 22 -110 551 740 ;
+C 183 ; WX 606 ; N bullet ; B 150 222 455 532 ;
+C 184 ; WX 354 ; N quotesinglbase ; B 89 -68 251 126 ;
+C 185 ; WX 502 ; N quotedblbase ; B 89 -68 399 126 ;
+C 186 ; WX 484 ; N quotedblright ; B 96 546 405 740 ;
+C 187 ; WX 425 ; N guillemotright ; B 39 81 385 481 ;
+C 188 ; WX 1000 ; N ellipsis ; B 130 0 870 126 ;
+C 189 ; WX 1174 ; N perthousand ; B 25 -13 1148 751 ;
+C 191 ; WX 591 ; N questiondown ; B 65 -205 527 548 ;
+C 193 ; WX 378 ; N grave ; B 69 619 300 786 ;
+C 194 ; WX 375 ; N acute ; B 78 619 309 786 ;
+C 195 ; WX 502 ; N circumflex ; B 74 639 428 764 ;
+C 196 ; WX 439 ; N tilde ; B 47 651 392 754 ;
+C 197 ; WX 485 ; N macron ; B 73 669 411 736 ;
+C 198 ; WX 453 ; N breve ; B 52 651 401 754 ;
+C 199 ; WX 222 ; N dotaccent ; B 74 639 148 765 ;
+C 200 ; WX 369 ; N dieresis ; B 73 639 295 765 ;
+C 202 ; WX 332 ; N ring ; B 62 600 269 807 ;
+C 203 ; WX 324 ; N cedilla ; B 80 -222 254 0 ;
+C 205 ; WX 552 ; N hungarumlaut ; B 119 605 453 800 ;
+C 206 ; WX 302 ; N ogonek ; B 73 -191 228 0 ;
+C 207 ; WX 502 ; N caron ; B 68 639 423 764 ;
+C 208 ; WX 1000 ; N emdash ; B 35 248 965 315 ;
+C 225 ; WX 992 ; N AE ; B -20 0 907 740 ;
+C 227 ; WX 369 ; N ordfeminine ; B -3 407 356 753 ;
+C 232 ; WX 517 ; N Lslash ; B 59 0 517 740 ;
+C 233 ; WX 868 ; N Oslash ; B 43 -83 826 819 ;
+C 234 ; WX 1194 ; N OE ; B 45 -13 1142 753 ;
+C 235 ; WX 369 ; N ordmasculine ; B 12 407 356 753 ;
+C 241 ; WX 1157 ; N ae ; B 34 -13 1113 561 ;
+C 245 ; WX 200 ; N dotlessi ; B 65 0 135 547 ;
+C 248 ; WX 300 ; N lslash ; B 43 0 259 740 ;
+C 249 ; WX 653 ; N oslash ; B 41 -64 613 614 ;
+C 250 ; WX 1137 ; N oe ; B 34 -13 1104 561 ;
+C 251 ; WX 554 ; N germandbls ; B 61 -13 525 753 ;
+C -1 ; WX 650 ; N ecircumflex ; B 38 -13 608 764 ;
+C -1 ; WX 650 ; N edieresis ; B 38 -13 608 765 ;
+C -1 ; WX 683 ; N aacute ; B 42 -13 621 786 ;
+C -1 ; WX 747 ; N registered ; B -9 -12 755 752 ;
+C -1 ; WX 200 ; N icircumflex ; B -77 0 277 764 ;
+C -1 ; WX 608 ; N udieresis ; B 62 -13 541 765 ;
+C -1 ; WX 655 ; N ograve ; B 42 -13 614 786 ;
+C -1 ; WX 608 ; N uacute ; B 62 -13 541 786 ;
+C -1 ; WX 608 ; N ucircumflex ; B 62 -13 541 764 ;
+C -1 ; WX 740 ; N Aacute ; B 12 0 729 949 ;
+C -1 ; WX 200 ; N igrave ; B -60 0 171 786 ;
+C -1 ; WX 226 ; N Icircumflex ; B -64 0 290 927 ;
+C -1 ; WX 647 ; N ccedilla ; B 41 -222 607 561 ;
+C -1 ; WX 683 ; N adieresis ; B 42 -13 621 765 ;
+C -1 ; WX 536 ; N Ecircumflex ; B 70 0 475 927 ;
+C -1 ; WX 388 ; N scaron ; B 11 -13 366 764 ;
+C -1 ; WX 682 ; N thorn ; B 64 -192 643 740 ;
+C -1 ; WX 1000 ; N trademark ; B 9 296 816 740 ;
+C -1 ; WX 650 ; N egrave ; B 38 -13 608 786 ;
+C -1 ; WX 332 ; N threesuperior ; B 18 289 318 747 ;
+C -1 ; WX 425 ; N zcaron ; B 10 0 415 764 ;
+C -1 ; WX 683 ; N atilde ; B 42 -13 621 754 ;
+C -1 ; WX 683 ; N aring ; B 42 -13 621 807 ;
+C -1 ; WX 655 ; N ocircumflex ; B 42 -13 614 764 ;
+C -1 ; WX 536 ; N Edieresis ; B 70 0 475 928 ;
+C -1 ; WX 831 ; N threequarters ; B 46 0 784 747 ;
+C -1 ; WX 536 ; N ydieresis ; B 15 -192 523 765 ;
+C -1 ; WX 536 ; N yacute ; B 15 -192 523 786 ;
+C -1 ; WX 200 ; N iacute ; B 31 0 262 786 ;
+C -1 ; WX 740 ; N Acircumflex ; B 12 0 729 927 ;
+C -1 ; WX 655 ; N Uacute ; B 75 -13 579 949 ;
+C -1 ; WX 650 ; N eacute ; B 38 -13 608 786 ;
+C -1 ; WX 869 ; N Ograve ; B 43 -13 826 949 ;
+C -1 ; WX 683 ; N agrave ; B 42 -13 621 786 ;
+C -1 ; WX 655 ; N Udieresis ; B 75 -13 579 928 ;
+C -1 ; WX 683 ; N acircumflex ; B 42 -13 621 764 ;
+C -1 ; WX 226 ; N Igrave ; B -47 0 184 949 ;
+C -1 ; WX 332 ; N twosuperior ; B 19 296 318 747 ;
+C -1 ; WX 655 ; N Ugrave ; B 75 -13 579 949 ;
+C -1 ; WX 831 ; N onequarter ; B 100 0 729 740 ;
+C -1 ; WX 655 ; N Ucircumflex ; B 75 -13 579 927 ;
+C -1 ; WX 498 ; N Scaron ; B 22 -13 473 927 ;
+C -1 ; WX 226 ; N Idieresis ; B 2 0 224 928 ;
+C -1 ; WX 200 ; N idieresis ; B -11 0 211 765 ;
+C -1 ; WX 536 ; N Egrave ; B 70 0 475 949 ;
+C -1 ; WX 869 ; N Oacute ; B 43 -13 826 949 ;
+C -1 ; WX 606 ; N divide ; B 51 -13 555 519 ;
+C -1 ; WX 740 ; N Atilde ; B 12 0 729 917 ;
+C -1 ; WX 740 ; N Aring ; B 12 0 729 955 ;
+C -1 ; WX 869 ; N Odieresis ; B 43 -13 826 928 ;
+C -1 ; WX 740 ; N Adieresis ; B 12 0 729 928 ;
+C -1 ; WX 740 ; N Ntilde ; B 75 0 664 917 ;
+C -1 ; WX 480 ; N Zcaron ; B 12 0 470 927 ;
+C -1 ; WX 592 ; N Thorn ; B 60 0 549 740 ;
+C -1 ; WX 226 ; N Iacute ; B 44 0 275 949 ;
+C -1 ; WX 606 ; N plusminus ; B 51 -24 555 518 ;
+C -1 ; WX 606 ; N multiply ; B 74 24 533 482 ;
+C -1 ; WX 536 ; N Eacute ; B 70 0 475 949 ;
+C -1 ; WX 592 ; N Ydieresis ; B 1 0 592 928 ;
+C -1 ; WX 332 ; N onesuperior ; B 63 296 198 740 ;
+C -1 ; WX 608 ; N ugrave ; B 62 -13 541 786 ;
+C -1 ; WX 606 ; N logicalnot ; B 51 109 555 388 ;
+C -1 ; WX 610 ; N ntilde ; B 65 0 546 754 ;
+C -1 ; WX 869 ; N Otilde ; B 43 -13 826 917 ;
+C -1 ; WX 655 ; N otilde ; B 42 -13 614 754 ;
+C -1 ; WX 813 ; N Ccedilla ; B 43 -222 771 752 ;
+C -1 ; WX 740 ; N Agrave ; B 12 0 729 949 ;
+C -1 ; WX 831 ; N onehalf ; B 81 0 750 740 ;
+C -1 ; WX 790 ; N Eth ; B 40 0 739 740 ;
+C -1 ; WX 400 ; N degree ; B 56 421 344 709 ;
+C -1 ; WX 592 ; N Yacute ; B 1 0 592 949 ;
+C -1 ; WX 869 ; N Ocircumflex ; B 43 -13 826 927 ;
+C -1 ; WX 655 ; N oacute ; B 42 -13 614 786 ;
+C -1 ; WX 608 ; N mu ; B 80 -184 527 547 ;
+C -1 ; WX 606 ; N minus ; B 51 219 555 287 ;
+C -1 ; WX 655 ; N eth ; B 42 -12 614 753 ;
+C -1 ; WX 655 ; N odieresis ; B 42 -13 614 765 ;
+C -1 ; WX 747 ; N copyright ; B -9 -12 755 752 ;
+C -1 ; WX 672 ; N brokenbar ; B 299 -100 373 740 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 216
+
+KPX A y -62
+KPX A w -65
+KPX A v -70
+KPX A u -20
+KPX A quoteright -100
+KPX A quotedblright -100
+KPX A Y -92
+KPX A W -60
+KPX A V -102
+KPX A U -40
+KPX A T -45
+KPX A Q -40
+KPX A O -50
+KPX A G -40
+KPX A C -40
+
+KPX B A -10
+
+KPX C A -40
+
+KPX D period -20
+KPX D comma -20
+KPX D Y -30
+KPX D W -10
+KPX D V -50
+KPX D A -50
+
+KPX F period -160
+KPX F e -20
+KPX F comma -180
+KPX F a -20
+KPX F A -75
+
+KPX G period -20
+KPX G comma -20
+KPX G Y -20
+
+KPX J period -15
+KPX J a -20
+KPX J A -30
+
+KPX K o -15
+KPX K e -20
+KPX K O -20
+
+KPX L y -23
+KPX L quoteright -130
+KPX L quotedblright -130
+KPX L Y -91
+KPX L W -67
+KPX L V -113
+KPX L T -46
+
+KPX O period -30
+KPX O comma -30
+KPX O Y -30
+KPX O X -30
+KPX O W -20
+KPX O V -60
+KPX O T -30
+KPX O A -60
+
+KPX P period -300
+KPX P o -60
+KPX P e -20
+KPX P comma -280
+KPX P a -20
+KPX P A -114
+
+KPX Q comma 20
+
+KPX R Y -10
+KPX R W 10
+KPX R V -10
+KPX R T 6
+
+KPX S comma 20
+
+KPX T y -50
+KPX T w -55
+KPX T u -46
+KPX T semicolon -29
+KPX T r -30
+KPX T period -91
+KPX T o -70
+KPX T i 10
+KPX T hyphen -75
+KPX T e -49
+KPX T comma -82
+KPX T colon -15
+KPX T a -90
+KPX T O -30
+KPX T A -45
+
+KPX U period -20
+KPX U comma -20
+KPX U A -40
+
+KPX V u -40
+KPX V semicolon -33
+KPX V period -165
+KPX V o -101
+KPX V i -5
+KPX V hyphen -75
+KPX V e -101
+KPX V comma -145
+KPX V colon -18
+KPX V a -104
+KPX V O -60
+KPX V G -20
+KPX V A -102
+
+KPX W y -2
+KPX W u -30
+KPX W semicolon -33
+KPX W period -106
+KPX W o -46
+KPX W i 6
+KPX W hyphen -35
+KPX W e -47
+KPX W comma -106
+KPX W colon -15
+KPX W a -50
+KPX W O -20
+KPX W A -58
+
+KPX Y u -52
+KPX Y semicolon -23
+KPX Y period -175
+KPX Y o -89
+KPX Y hyphen -85
+KPX Y e -89
+KPX Y comma -145
+KPX Y colon -10
+KPX Y a -93
+KPX Y O -30
+KPX Y A -92
+
+KPX a p 20
+KPX a b 20
+
+KPX b y -20
+KPX b v -20
+
+KPX c y -20
+KPX c k -15
+
+KPX comma space -110
+KPX comma quoteright -120
+KPX comma quotedblright -120
+
+KPX e y -20
+KPX e w -20
+KPX e v -20
+
+KPX f period -50
+KPX f o -40
+KPX f l -30
+KPX f i -34
+KPX f f -60
+KPX f e -20
+KPX f dotlessi -34
+KPX f comma -50
+KPX f a -40
+
+KPX g a -15
+
+KPX h y -30
+
+KPX k y -5
+KPX k e -15
+
+KPX m y -20
+KPX m u -20
+KPX m a -20
+
+KPX n y -15
+KPX n v -20
+
+KPX o y -20
+KPX o x -15
+KPX o w -20
+KPX o v -30
+
+KPX p y -20
+
+KPX period space -110
+KPX period quoteright -120
+KPX period quotedblright -120
+
+KPX quotedblleft quoteleft -35
+KPX quotedblleft A -100
+
+KPX quotedblright space -110
+
+KPX quoteleft quoteleft -203
+KPX quoteleft A -100
+
+KPX quoteright v -30
+KPX quoteright t 10
+KPX quoteright space -110
+KPX quoteright s -15
+KPX quoteright r -20
+KPX quoteright quoteright -203
+KPX quoteright quotedblright -35
+KPX quoteright d -110
+
+KPX r y 40
+KPX r v 40
+KPX r u 20
+KPX r t 20
+KPX r s 20
+KPX r q -8
+KPX r period -73
+KPX r p 20
+KPX r o -20
+KPX r n 21
+KPX r m 28
+KPX r l 20
+KPX r k 20
+KPX r i 20
+KPX r hyphen -60
+KPX r g -15
+KPX r e -4
+KPX r d -6
+KPX r comma -75
+KPX r c -20
+KPX r a -20
+
+KPX s period 20
+KPX s comma 20
+
+KPX space quoteleft -110
+KPX space quotedblleft -110
+KPX space Y -60
+KPX space W -25
+KPX space V -50
+KPX space T -25
+KPX space A -20
+
+KPX v period -130
+KPX v o -30
+KPX v e -20
+KPX v comma -100
+KPX v a -30
+
+KPX w period -100
+KPX w o -30
+KPX w h 15
+KPX w e -20
+KPX w comma -90
+KPX w a -30
+
+KPX y period -125
+KPX y o -30
+KPX y e -20
+KPX y comma -110
+KPX y a -30
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 183 163 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 119 163 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 186 163 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 181 163 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 204 148 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 151 163 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 81 163 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 17 163 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 84 163 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 79 163 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -34 163 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -138 163 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -71 163 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -116 163 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 151 163 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 247 163 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 184 163 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 250 163 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 246 163 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 215 163 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron -2 163 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 160 163 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 77 163 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 143 163 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 119 163 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 129 163 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 112 163 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron -11 163 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 154 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 91 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 157 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 153 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 176 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 122 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 138 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 74 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 141 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 136 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -47 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -151 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -84 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -129 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 86 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 140 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 77 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 143 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 108 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron -57 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 137 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 53 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 120 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 95 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 101 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron -38 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagko8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagko8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..e0e75f384e46861cd4989f2cf0bb1b26dbabc3a9
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pagko8a.afm
@@ -0,0 +1,573 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Mar 4 13:41:11 1991
+Comment UniqueID 34367
+Comment VMusage 6555 39267
+FontName AvantGarde-BookOblique
+FullName ITC Avant Garde Gothic Book Oblique
+FamilyName ITC Avant Garde Gothic
+Weight Book
+ItalicAngle -10.5
+IsFixedPitch false
+FontBBox -113 -222 1279 955
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.006
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1991 Adobe Systems Incorporated. All Rights Reserved.ITC Avant Garde Gothic is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 740
+XHeight 547
+Ascender 740
+Descender -192
+StartCharMetrics 228
+C 32 ; WX 277 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 295 ; N exclam ; B 111 0 322 740 ;
+C 34 ; WX 309 ; N quotedbl ; B 130 444 410 740 ;
+C 35 ; WX 554 ; N numbersign ; B 71 0 620 740 ;
+C 36 ; WX 554 ; N dollar ; B 107 -70 581 811 ;
+C 37 ; WX 775 ; N percent ; B 124 -13 787 751 ;
+C 38 ; WX 757 ; N ampersand ; B 92 -12 775 753 ;
+C 39 ; WX 351 ; N quoteright ; B 195 546 393 740 ;
+C 40 ; WX 369 ; N parenleft ; B 89 -205 495 757 ;
+C 41 ; WX 369 ; N parenright ; B -24 -205 382 757 ;
+C 42 ; WX 425 ; N asterisk ; B 170 446 479 740 ;
+C 43 ; WX 606 ; N plus ; B 92 0 608 506 ;
+C 44 ; WX 277 ; N comma ; B 2 -67 199 126 ;
+C 45 ; WX 332 ; N hyphen ; B 76 248 360 315 ;
+C 46 ; WX 277 ; N period ; B 102 0 199 126 ;
+C 47 ; WX 437 ; N slash ; B 25 -100 540 740 ;
+C 48 ; WX 554 ; N zero ; B 71 -13 622 753 ;
+C 49 ; WX 554 ; N one ; B 260 0 473 740 ;
+C 50 ; WX 554 ; N two ; B 40 0 615 753 ;
+C 51 ; WX 554 ; N three ; B 73 -13 565 753 ;
+C 52 ; WX 554 ; N four ; B 39 0 598 740 ;
+C 53 ; WX 554 ; N five ; B 69 -13 605 740 ;
+C 54 ; WX 554 ; N six ; B 65 -13 580 739 ;
+C 55 ; WX 554 ; N seven ; B 110 0 628 740 ;
+C 56 ; WX 554 ; N eight ; B 77 -13 580 753 ;
+C 57 ; WX 554 ; N nine ; B 111 0 626 752 ;
+C 58 ; WX 277 ; N colon ; B 102 0 278 548 ;
+C 59 ; WX 277 ; N semicolon ; B 2 -67 278 548 ;
+C 60 ; WX 606 ; N less ; B 87 -8 649 514 ;
+C 61 ; WX 606 ; N equal ; B 73 118 627 388 ;
+C 62 ; WX 606 ; N greater ; B 51 -8 613 514 ;
+C 63 ; WX 591 ; N question ; B 158 0 628 752 ;
+C 64 ; WX 867 ; N at ; B 126 -13 888 753 ;
+C 65 ; WX 740 ; N A ; B 12 0 729 740 ;
+C 66 ; WX 574 ; N B ; B 74 0 606 740 ;
+C 67 ; WX 813 ; N C ; B 105 -13 870 752 ;
+C 68 ; WX 744 ; N D ; B 74 0 773 740 ;
+C 69 ; WX 536 ; N E ; B 70 0 612 740 ;
+C 70 ; WX 485 ; N F ; B 70 0 581 740 ;
+C 71 ; WX 872 ; N G ; B 103 -13 891 753 ;
+C 72 ; WX 683 ; N H ; B 76 0 744 740 ;
+C 73 ; WX 226 ; N I ; B 76 0 287 740 ;
+C 74 ; WX 482 ; N J ; B 37 -13 539 740 ;
+C 75 ; WX 591 ; N K ; B 81 0 728 740 ;
+C 76 ; WX 462 ; N L ; B 82 0 474 740 ;
+C 77 ; WX 919 ; N M ; B 76 0 980 740 ;
+C 78 ; WX 740 ; N N ; B 75 0 801 740 ;
+C 79 ; WX 869 ; N O ; B 105 -13 901 753 ;
+C 80 ; WX 592 ; N P ; B 75 0 664 740 ;
+C 81 ; WX 871 ; N Q ; B 102 -13 912 753 ;
+C 82 ; WX 607 ; N R ; B 70 0 669 740 ;
+C 83 ; WX 498 ; N S ; B 57 -13 561 753 ;
+C 84 ; WX 426 ; N T ; B 131 0 556 740 ;
+C 85 ; WX 655 ; N U ; B 118 -13 716 740 ;
+C 86 ; WX 702 ; N V ; B 145 0 830 740 ;
+C 87 ; WX 960 ; N W ; B 148 0 1087 740 ;
+C 88 ; WX 609 ; N X ; B 8 0 724 740 ;
+C 89 ; WX 592 ; N Y ; B 138 0 729 740 ;
+C 90 ; WX 480 ; N Z ; B 12 0 596 740 ;
+C 91 ; WX 351 ; N bracketleft ; B 145 -179 477 753 ;
+C 92 ; WX 605 ; N backslash ; B 255 -100 458 740 ;
+C 93 ; WX 351 ; N bracketright ; B -19 -179 312 753 ;
+C 94 ; WX 606 ; N asciicircum ; B 110 307 610 740 ;
+C 95 ; WX 500 ; N underscore ; B -23 -125 486 -75 ;
+C 96 ; WX 351 ; N quoteleft ; B 232 546 358 740 ;
+C 97 ; WX 683 ; N a ; B 88 -13 722 561 ;
+C 98 ; WX 682 ; N b ; B 68 -13 703 740 ;
+C 99 ; WX 647 ; N c ; B 87 -13 678 561 ;
+C 100 ; WX 685 ; N d ; B 85 -13 755 740 ;
+C 101 ; WX 650 ; N e ; B 84 -13 664 561 ;
+C 102 ; WX 314 ; N f ; B 104 0 454 753 ; L i fi ; L l fl ;
+C 103 ; WX 673 ; N g ; B 56 -215 707 561 ;
+C 104 ; WX 610 ; N h ; B 62 0 606 740 ;
+C 105 ; WX 200 ; N i ; B 65 0 272 740 ;
+C 106 ; WX 203 ; N j ; B -80 -192 274 740 ;
+C 107 ; WX 502 ; N k ; B 70 0 588 740 ;
+C 108 ; WX 200 ; N l ; B 65 0 272 740 ;
+C 109 ; WX 938 ; N m ; B 66 0 938 561 ;
+C 110 ; WX 610 ; N n ; B 65 0 609 561 ;
+C 111 ; WX 655 ; N o ; B 88 -13 669 561 ;
+C 112 ; WX 682 ; N p ; B 28 -192 699 561 ;
+C 113 ; WX 682 ; N q ; B 83 -192 717 561 ;
+C 114 ; WX 301 ; N r ; B 65 0 395 561 ;
+C 115 ; WX 388 ; N s ; B 49 -13 424 561 ;
+C 116 ; WX 339 ; N t ; B 104 0 431 740 ;
+C 117 ; WX 608 ; N u ; B 100 -13 642 547 ;
+C 118 ; WX 554 ; N v ; B 108 0 647 547 ;
+C 119 ; WX 831 ; N w ; B 114 0 921 547 ;
+C 120 ; WX 480 ; N x ; B 12 0 569 547 ;
+C 121 ; WX 536 ; N y ; B 97 -192 624 547 ;
+C 122 ; WX 425 ; N z ; B 10 0 498 547 ;
+C 123 ; WX 351 ; N braceleft ; B 115 -189 468 740 ;
+C 124 ; WX 672 ; N bar ; B 280 -100 510 740 ;
+C 125 ; WX 351 ; N braceright ; B -15 -189 338 740 ;
+C 126 ; WX 606 ; N asciitilde ; B 114 179 584 319 ;
+C 161 ; WX 295 ; N exclamdown ; B 74 -192 286 548 ;
+C 162 ; WX 554 ; N cent ; B 115 62 596 707 ;
+C 163 ; WX 554 ; N sterling ; B 29 0 614 753 ;
+C 164 ; WX 166 ; N fraction ; B -113 0 417 740 ;
+C 165 ; WX 554 ; N yen ; B 75 0 687 740 ;
+C 166 ; WX 554 ; N florin ; B -39 -153 669 818 ;
+C 167 ; WX 615 ; N section ; B 118 -141 597 753 ;
+C 168 ; WX 554 ; N currency ; B 24 42 645 580 ;
+C 169 ; WX 198 ; N quotesingle ; B 153 444 277 740 ;
+C 170 ; WX 502 ; N quotedblleft ; B 234 546 507 740 ;
+C 171 ; WX 425 ; N guillemotleft ; B 92 81 469 481 ;
+C 172 ; WX 251 ; N guilsinglleft ; B 92 81 295 481 ;
+C 173 ; WX 251 ; N guilsinglright ; B 60 81 263 481 ;
+C 174 ; WX 487 ; N fi ; B 104 0 559 753 ;
+C 175 ; WX 485 ; N fl ; B 104 0 557 753 ;
+C 177 ; WX 500 ; N endash ; B 81 248 523 315 ;
+C 178 ; WX 553 ; N dagger ; B 146 -133 593 740 ;
+C 179 ; WX 553 ; N daggerdbl ; B 72 -133 593 740 ;
+C 180 ; WX 277 ; N periodcentered ; B 137 190 235 316 ;
+C 182 ; WX 564 ; N paragraph ; B 119 -110 688 740 ;
+C 183 ; WX 606 ; N bullet ; B 217 222 528 532 ;
+C 184 ; WX 354 ; N quotesinglbase ; B 76 -68 274 126 ;
+C 185 ; WX 502 ; N quotedblbase ; B 76 -68 422 126 ;
+C 186 ; WX 484 ; N quotedblright ; B 197 546 542 740 ;
+C 187 ; WX 425 ; N guillemotright ; B 60 81 437 481 ;
+C 188 ; WX 1000 ; N ellipsis ; B 130 0 893 126 ;
+C 189 ; WX 1174 ; N perthousand ; B 128 -13 1182 751 ;
+C 191 ; WX 591 ; N questiondown ; B 64 -205 534 548 ;
+C 193 ; WX 378 ; N grave ; B 204 619 425 786 ;
+C 194 ; WX 375 ; N acute ; B 203 619 444 786 ;
+C 195 ; WX 502 ; N circumflex ; B 192 639 546 764 ;
+C 196 ; WX 439 ; N tilde ; B 179 651 520 754 ;
+C 197 ; WX 485 ; N macron ; B 197 669 547 736 ;
+C 198 ; WX 453 ; N breve ; B 192 651 541 754 ;
+C 199 ; WX 222 ; N dotaccent ; B 192 639 290 765 ;
+C 200 ; WX 369 ; N dieresis ; B 191 639 437 765 ;
+C 202 ; WX 332 ; N ring ; B 191 600 401 807 ;
+C 203 ; WX 324 ; N cedilla ; B 52 -222 231 0 ;
+C 205 ; WX 552 ; N hungarumlaut ; B 239 605 594 800 ;
+C 206 ; WX 302 ; N ogonek ; B 53 -191 202 0 ;
+C 207 ; WX 502 ; N caron ; B 210 639 565 764 ;
+C 208 ; WX 1000 ; N emdash ; B 81 248 1023 315 ;
+C 225 ; WX 992 ; N AE ; B -20 0 1044 740 ;
+C 227 ; WX 369 ; N ordfeminine ; B 102 407 494 753 ;
+C 232 ; WX 517 ; N Lslash ; B 107 0 529 740 ;
+C 233 ; WX 868 ; N Oslash ; B 76 -83 929 819 ;
+C 234 ; WX 1194 ; N OE ; B 107 -13 1279 753 ;
+C 235 ; WX 369 ; N ordmasculine ; B 116 407 466 753 ;
+C 241 ; WX 1157 ; N ae ; B 80 -13 1169 561 ;
+C 245 ; WX 200 ; N dotlessi ; B 65 0 236 547 ;
+C 248 ; WX 300 ; N lslash ; B 95 0 354 740 ;
+C 249 ; WX 653 ; N oslash ; B 51 -64 703 614 ;
+C 250 ; WX 1137 ; N oe ; B 80 -13 1160 561 ;
+C 251 ; WX 554 ; N germandbls ; B 61 -13 578 753 ;
+C -1 ; WX 650 ; N ecircumflex ; B 84 -13 664 764 ;
+C -1 ; WX 650 ; N edieresis ; B 84 -13 664 765 ;
+C -1 ; WX 683 ; N aacute ; B 88 -13 722 786 ;
+C -1 ; WX 747 ; N registered ; B 53 -12 830 752 ;
+C -1 ; WX 200 ; N icircumflex ; B 41 0 395 764 ;
+C -1 ; WX 608 ; N udieresis ; B 100 -13 642 765 ;
+C -1 ; WX 655 ; N ograve ; B 88 -13 669 786 ;
+C -1 ; WX 608 ; N uacute ; B 100 -13 642 786 ;
+C -1 ; WX 608 ; N ucircumflex ; B 100 -13 642 764 ;
+C -1 ; WX 740 ; N Aacute ; B 12 0 729 949 ;
+C -1 ; WX 200 ; N igrave ; B 65 0 296 786 ;
+C -1 ; WX 226 ; N Icircumflex ; B 76 0 439 927 ;
+C -1 ; WX 647 ; N ccedilla ; B 87 -222 678 561 ;
+C -1 ; WX 683 ; N adieresis ; B 88 -13 722 765 ;
+C -1 ; WX 536 ; N Ecircumflex ; B 70 0 612 927 ;
+C -1 ; WX 388 ; N scaron ; B 49 -13 508 764 ;
+C -1 ; WX 682 ; N thorn ; B 28 -192 699 740 ;
+C -1 ; WX 1000 ; N trademark ; B 137 296 953 740 ;
+C -1 ; WX 650 ; N egrave ; B 84 -13 664 786 ;
+C -1 ; WX 332 ; N threesuperior ; B 98 289 408 747 ;
+C -1 ; WX 425 ; N zcaron ; B 10 0 527 764 ;
+C -1 ; WX 683 ; N atilde ; B 88 -13 722 754 ;
+C -1 ; WX 683 ; N aring ; B 88 -13 722 807 ;
+C -1 ; WX 655 ; N ocircumflex ; B 88 -13 669 764 ;
+C -1 ; WX 536 ; N Edieresis ; B 70 0 612 928 ;
+C -1 ; WX 831 ; N threequarters ; B 126 0 825 747 ;
+C -1 ; WX 536 ; N ydieresis ; B 97 -192 624 765 ;
+C -1 ; WX 536 ; N yacute ; B 97 -192 624 786 ;
+C -1 ; WX 200 ; N iacute ; B 65 0 397 786 ;
+C -1 ; WX 740 ; N Acircumflex ; B 12 0 729 927 ;
+C -1 ; WX 655 ; N Uacute ; B 118 -13 716 949 ;
+C -1 ; WX 650 ; N eacute ; B 84 -13 664 786 ;
+C -1 ; WX 869 ; N Ograve ; B 105 -13 901 949 ;
+C -1 ; WX 683 ; N agrave ; B 88 -13 722 786 ;
+C -1 ; WX 655 ; N Udieresis ; B 118 -13 716 928 ;
+C -1 ; WX 683 ; N acircumflex ; B 88 -13 722 764 ;
+C -1 ; WX 226 ; N Igrave ; B 76 0 340 949 ;
+C -1 ; WX 332 ; N twosuperior ; B 74 296 433 747 ;
+C -1 ; WX 655 ; N Ugrave ; B 118 -13 716 949 ;
+C -1 ; WX 831 ; N onequarter ; B 183 0 770 740 ;
+C -1 ; WX 655 ; N Ucircumflex ; B 118 -13 716 927 ;
+C -1 ; WX 498 ; N Scaron ; B 57 -13 593 927 ;
+C -1 ; WX 226 ; N Idieresis ; B 76 0 396 928 ;
+C -1 ; WX 200 ; N idieresis ; B 65 0 353 765 ;
+C -1 ; WX 536 ; N Egrave ; B 70 0 612 949 ;
+C -1 ; WX 869 ; N Oacute ; B 105 -13 901 949 ;
+C -1 ; WX 606 ; N divide ; B 92 -13 608 519 ;
+C -1 ; WX 740 ; N Atilde ; B 12 0 729 917 ;
+C -1 ; WX 740 ; N Aring ; B 12 0 729 955 ;
+C -1 ; WX 869 ; N Odieresis ; B 105 -13 901 928 ;
+C -1 ; WX 740 ; N Adieresis ; B 12 0 729 928 ;
+C -1 ; WX 740 ; N Ntilde ; B 75 0 801 917 ;
+C -1 ; WX 480 ; N Zcaron ; B 12 0 596 927 ;
+C -1 ; WX 592 ; N Thorn ; B 60 0 621 740 ;
+C -1 ; WX 226 ; N Iacute ; B 76 0 440 949 ;
+C -1 ; WX 606 ; N plusminus ; B 47 -24 618 518 ;
+C -1 ; WX 606 ; N multiply ; B 87 24 612 482 ;
+C -1 ; WX 536 ; N Eacute ; B 70 0 612 949 ;
+C -1 ; WX 592 ; N Ydieresis ; B 138 0 729 928 ;
+C -1 ; WX 332 ; N onesuperior ; B 190 296 335 740 ;
+C -1 ; WX 608 ; N ugrave ; B 100 -13 642 786 ;
+C -1 ; WX 606 ; N logicalnot ; B 110 109 627 388 ;
+C -1 ; WX 610 ; N ntilde ; B 65 0 609 754 ;
+C -1 ; WX 869 ; N Otilde ; B 105 -13 901 917 ;
+C -1 ; WX 655 ; N otilde ; B 88 -13 669 754 ;
+C -1 ; WX 813 ; N Ccedilla ; B 105 -222 870 752 ;
+C -1 ; WX 740 ; N Agrave ; B 12 0 729 949 ;
+C -1 ; WX 831 ; N onehalf ; B 164 0 810 740 ;
+C -1 ; WX 790 ; N Eth ; B 104 0 813 740 ;
+C -1 ; WX 400 ; N degree ; B 158 421 451 709 ;
+C -1 ; WX 592 ; N Yacute ; B 138 0 729 949 ;
+C -1 ; WX 869 ; N Ocircumflex ; B 105 -13 901 927 ;
+C -1 ; WX 655 ; N oacute ; B 88 -13 669 786 ;
+C -1 ; WX 608 ; N mu ; B 46 -184 628 547 ;
+C -1 ; WX 606 ; N minus ; B 92 219 608 287 ;
+C -1 ; WX 655 ; N eth ; B 88 -12 675 753 ;
+C -1 ; WX 655 ; N odieresis ; B 88 -13 669 765 ;
+C -1 ; WX 747 ; N copyright ; B 53 -12 830 752 ;
+C -1 ; WX 672 ; N brokenbar ; B 280 -100 510 740 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 216
+
+KPX A y -62
+KPX A w -65
+KPX A v -70
+KPX A u -20
+KPX A quoteright -100
+KPX A quotedblright -100
+KPX A Y -92
+KPX A W -60
+KPX A V -102
+KPX A U -40
+KPX A T -45
+KPX A Q -40
+KPX A O -50
+KPX A G -40
+KPX A C -40
+
+KPX B A -10
+
+KPX C A -40
+
+KPX D period -20
+KPX D comma -20
+KPX D Y -30
+KPX D W -10
+KPX D V -50
+KPX D A -50
+
+KPX F period -160
+KPX F e -20
+KPX F comma -180
+KPX F a -20
+KPX F A -75
+
+KPX G period -20
+KPX G comma -20
+KPX G Y -20
+
+KPX J period -15
+KPX J a -20
+KPX J A -30
+
+KPX K o -15
+KPX K e -20
+KPX K O -20
+
+KPX L y -23
+KPX L quoteright -130
+KPX L quotedblright -130
+KPX L Y -91
+KPX L W -67
+KPX L V -113
+KPX L T -46
+
+KPX O period -30
+KPX O comma -30
+KPX O Y -30
+KPX O X -30
+KPX O W -20
+KPX O V -60
+KPX O T -30
+KPX O A -60
+
+KPX P period -300
+KPX P o -60
+KPX P e -20
+KPX P comma -280
+KPX P a -20
+KPX P A -114
+
+KPX Q comma 20
+
+KPX R Y -10
+KPX R W 10
+KPX R V -10
+KPX R T 6
+
+KPX S comma 20
+
+KPX T y -50
+KPX T w -55
+KPX T u -46
+KPX T semicolon -29
+KPX T r -30
+KPX T period -91
+KPX T o -70
+KPX T i 10
+KPX T hyphen -75
+KPX T e -49
+KPX T comma -82
+KPX T colon -15
+KPX T a -90
+KPX T O -30
+KPX T A -45
+
+KPX U period -20
+KPX U comma -20
+KPX U A -40
+
+KPX V u -40
+KPX V semicolon -33
+KPX V period -165
+KPX V o -101
+KPX V i -5
+KPX V hyphen -75
+KPX V e -101
+KPX V comma -145
+KPX V colon -18
+KPX V a -104
+KPX V O -60
+KPX V G -20
+KPX V A -102
+
+KPX W y -2
+KPX W u -30
+KPX W semicolon -33
+KPX W period -106
+KPX W o -46
+KPX W i 6
+KPX W hyphen -35
+KPX W e -47
+KPX W comma -106
+KPX W colon -15
+KPX W a -50
+KPX W O -20
+KPX W A -58
+
+KPX Y u -52
+KPX Y semicolon -23
+KPX Y period -175
+KPX Y o -89
+KPX Y hyphen -85
+KPX Y e -89
+KPX Y comma -145
+KPX Y colon -10
+KPX Y a -93
+KPX Y O -30
+KPX Y A -92
+
+KPX a p 20
+KPX a b 20
+
+KPX b y -20
+KPX b v -20
+
+KPX c y -20
+KPX c k -15
+
+KPX comma space -110
+KPX comma quoteright -120
+KPX comma quotedblright -120
+
+KPX e y -20
+KPX e w -20
+KPX e v -20
+
+KPX f period -50
+KPX f o -40
+KPX f l -30
+KPX f i -34
+KPX f f -60
+KPX f e -20
+KPX f dotlessi -34
+KPX f comma -50
+KPX f a -40
+
+KPX g a -15
+
+KPX h y -30
+
+KPX k y -5
+KPX k e -15
+
+KPX m y -20
+KPX m u -20
+KPX m a -20
+
+KPX n y -15
+KPX n v -20
+
+KPX o y -20
+KPX o x -15
+KPX o w -20
+KPX o v -30
+
+KPX p y -20
+
+KPX period space -110
+KPX period quoteright -120
+KPX period quotedblright -120
+
+KPX quotedblleft quoteleft -35
+KPX quotedblleft A -100
+
+KPX quotedblright space -110
+
+KPX quoteleft quoteleft -203
+KPX quoteleft A -100
+
+KPX quoteright v -30
+KPX quoteright t 10
+KPX quoteright space -110
+KPX quoteright s -15
+KPX quoteright r -20
+KPX quoteright quoteright -203
+KPX quoteright quotedblright -35
+KPX quoteright d -110
+
+KPX r y 40
+KPX r v 40
+KPX r u 20
+KPX r t 20
+KPX r s 20
+KPX r q -8
+KPX r period -73
+KPX r p 20
+KPX r o -20
+KPX r n 21
+KPX r m 28
+KPX r l 20
+KPX r k 20
+KPX r i 20
+KPX r hyphen -60
+KPX r g -15
+KPX r e -4
+KPX r d -6
+KPX r comma -75
+KPX r c -20
+KPX r a -20
+
+KPX s period 20
+KPX s comma 20
+
+KPX space quoteleft -110
+KPX space quotedblleft -110
+KPX space Y -60
+KPX space W -25
+KPX space V -50
+KPX space T -25
+KPX space A -20
+
+KPX v period -130
+KPX v o -30
+KPX v e -20
+KPX v comma -100
+KPX v a -30
+
+KPX w period -100
+KPX w o -30
+KPX w h 15
+KPX w e -20
+KPX w comma -90
+KPX w a -30
+
+KPX y period -125
+KPX y o -30
+KPX y e -20
+KPX y comma -110
+KPX y a -30
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 213 163 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 149 163 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 216 163 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 211 163 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 231 148 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 181 163 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 111 163 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 47 163 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 114 163 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 109 163 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -4 163 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -108 163 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -41 163 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -86 163 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 181 163 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 277 163 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 214 163 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 280 163 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 276 163 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 245 163 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 28 163 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 190 163 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 107 163 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 173 163 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 149 163 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 159 163 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 142 163 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 19 163 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 154 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 91 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 157 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 153 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 176 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 122 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 138 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 74 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 141 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 136 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -47 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -151 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -84 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -129 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 86 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 140 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 77 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 143 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 108 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron -57 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 137 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 53 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 120 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 95 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 101 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron -38 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkd8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkd8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..036be6d8cd8f4f816740b278f6b23d01c7ede083
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkd8a.afm
@@ -0,0 +1,415 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue Jan 21 16:13:29 1992
+Comment UniqueID 37831
+Comment VMusage 31983 38875
+FontName Bookman-Demi
+FullName ITC Bookman Demi
+FamilyName ITC Bookman
+Weight Demi
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -194 -250 1346 934
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.004
+Notice Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.ITC Bookman is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 681
+XHeight 502
+Ascender 725
+Descender -212
+StartCharMetrics 228
+C 32 ; WX 340 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 360 ; N exclam ; B 82 -8 282 698 ;
+C 34 ; WX 420 ; N quotedbl ; B 11 379 369 698 ;
+C 35 ; WX 660 ; N numbersign ; B 84 0 576 681 ;
+C 36 ; WX 660 ; N dollar ; B 48 -119 620 805 ;
+C 37 ; WX 940 ; N percent ; B 12 -8 924 698 ;
+C 38 ; WX 800 ; N ampersand ; B 21 -17 772 698 ;
+C 39 ; WX 320 ; N quoteright ; B 82 440 242 698 ;
+C 40 ; WX 320 ; N parenleft ; B 48 -150 289 749 ;
+C 41 ; WX 320 ; N parenright ; B 20 -150 262 749 ;
+C 42 ; WX 460 ; N asterisk ; B 62 317 405 697 ;
+C 43 ; WX 600 ; N plus ; B 51 9 555 514 ;
+C 44 ; WX 340 ; N comma ; B 78 -124 257 162 ;
+C 45 ; WX 360 ; N hyphen ; B 20 210 340 318 ;
+C 46 ; WX 340 ; N period ; B 76 -8 258 172 ;
+C 47 ; WX 600 ; N slash ; B 50 -149 555 725 ;
+C 48 ; WX 660 ; N zero ; B 30 -17 639 698 ;
+C 49 ; WX 660 ; N one ; B 137 0 568 681 ;
+C 50 ; WX 660 ; N two ; B 41 0 628 698 ;
+C 51 ; WX 660 ; N three ; B 37 -17 631 698 ;
+C 52 ; WX 660 ; N four ; B 19 0 649 681 ;
+C 53 ; WX 660 ; N five ; B 44 -17 623 723 ;
+C 54 ; WX 660 ; N six ; B 34 -17 634 698 ;
+C 55 ; WX 660 ; N seven ; B 36 0 632 681 ;
+C 56 ; WX 660 ; N eight ; B 36 -17 633 698 ;
+C 57 ; WX 660 ; N nine ; B 33 -17 636 698 ;
+C 58 ; WX 340 ; N colon ; B 76 -8 258 515 ;
+C 59 ; WX 340 ; N semicolon ; B 75 -124 259 515 ;
+C 60 ; WX 600 ; N less ; B 49 -9 558 542 ;
+C 61 ; WX 600 ; N equal ; B 51 109 555 421 ;
+C 62 ; WX 600 ; N greater ; B 48 -9 557 542 ;
+C 63 ; WX 660 ; N question ; B 61 -8 608 698 ;
+C 64 ; WX 820 ; N at ; B 60 -17 758 698 ;
+C 65 ; WX 720 ; N A ; B -34 0 763 681 ;
+C 66 ; WX 720 ; N B ; B 20 0 693 681 ;
+C 67 ; WX 740 ; N C ; B 35 -17 724 698 ;
+C 68 ; WX 780 ; N D ; B 20 0 748 681 ;
+C 69 ; WX 720 ; N E ; B 20 0 724 681 ;
+C 70 ; WX 680 ; N F ; B 20 0 686 681 ;
+C 71 ; WX 780 ; N G ; B 35 -17 773 698 ;
+C 72 ; WX 820 ; N H ; B 20 0 800 681 ;
+C 73 ; WX 400 ; N I ; B 20 0 379 681 ;
+C 74 ; WX 640 ; N J ; B -12 -17 622 681 ;
+C 75 ; WX 800 ; N K ; B 20 0 796 681 ;
+C 76 ; WX 640 ; N L ; B 20 0 668 681 ;
+C 77 ; WX 940 ; N M ; B 20 0 924 681 ;
+C 78 ; WX 740 ; N N ; B 20 0 724 681 ;
+C 79 ; WX 800 ; N O ; B 35 -17 769 698 ;
+C 80 ; WX 660 ; N P ; B 20 0 658 681 ;
+C 81 ; WX 800 ; N Q ; B 35 -226 775 698 ;
+C 82 ; WX 780 ; N R ; B 20 0 783 681 ;
+C 83 ; WX 660 ; N S ; B 21 -17 639 698 ;
+C 84 ; WX 700 ; N T ; B -4 0 703 681 ;
+C 85 ; WX 740 ; N U ; B 15 -17 724 681 ;
+C 86 ; WX 720 ; N V ; B -20 0 730 681 ;
+C 87 ; WX 940 ; N W ; B -20 0 963 681 ;
+C 88 ; WX 780 ; N X ; B 1 0 770 681 ;
+C 89 ; WX 700 ; N Y ; B -20 0 718 681 ;
+C 90 ; WX 640 ; N Z ; B 6 0 635 681 ;
+C 91 ; WX 300 ; N bracketleft ; B 75 -138 285 725 ;
+C 92 ; WX 600 ; N backslash ; B 50 0 555 725 ;
+C 93 ; WX 300 ; N bracketright ; B 21 -138 231 725 ;
+C 94 ; WX 600 ; N asciicircum ; B 52 281 554 681 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 320 ; N quoteleft ; B 82 440 242 698 ;
+C 97 ; WX 580 ; N a ; B 28 -8 588 515 ;
+C 98 ; WX 600 ; N b ; B -20 -8 568 725 ;
+C 99 ; WX 580 ; N c ; B 31 -8 550 515 ;
+C 100 ; WX 640 ; N d ; B 31 -8 622 725 ;
+C 101 ; WX 580 ; N e ; B 31 -8 548 515 ;
+C 102 ; WX 380 ; N f ; B 22 0 461 741 ; L i fi ; L l fl ;
+C 103 ; WX 580 ; N g ; B 9 -243 583 595 ;
+C 104 ; WX 680 ; N h ; B 22 0 654 725 ;
+C 105 ; WX 360 ; N i ; B 22 0 335 729 ;
+C 106 ; WX 340 ; N j ; B -94 -221 278 729 ;
+C 107 ; WX 660 ; N k ; B 22 0 643 725 ;
+C 108 ; WX 340 ; N l ; B 9 0 322 725 ;
+C 109 ; WX 1000 ; N m ; B 22 0 980 515 ;
+C 110 ; WX 680 ; N n ; B 22 0 652 515 ;
+C 111 ; WX 620 ; N o ; B 31 -8 585 515 ;
+C 112 ; WX 640 ; N p ; B 22 -212 611 515 ;
+C 113 ; WX 620 ; N q ; B 31 -212 633 515 ;
+C 114 ; WX 460 ; N r ; B 22 0 462 502 ;
+C 115 ; WX 520 ; N s ; B 22 -8 492 515 ;
+C 116 ; WX 460 ; N t ; B 22 -8 445 660 ;
+C 117 ; WX 660 ; N u ; B 22 -8 653 502 ;
+C 118 ; WX 600 ; N v ; B -6 0 593 502 ;
+C 119 ; WX 800 ; N w ; B -6 0 810 502 ;
+C 120 ; WX 600 ; N x ; B 8 0 591 502 ;
+C 121 ; WX 620 ; N y ; B 6 -221 613 502 ;
+C 122 ; WX 560 ; N z ; B 22 0 547 502 ;
+C 123 ; WX 320 ; N braceleft ; B 14 -139 301 726 ;
+C 124 ; WX 600 ; N bar ; B 243 -250 362 750 ;
+C 125 ; WX 320 ; N braceright ; B 15 -140 302 725 ;
+C 126 ; WX 600 ; N asciitilde ; B 51 162 555 368 ;
+C 161 ; WX 360 ; N exclamdown ; B 84 -191 284 515 ;
+C 162 ; WX 660 ; N cent ; B 133 17 535 674 ;
+C 163 ; WX 660 ; N sterling ; B 10 -17 659 698 ;
+C 164 ; WX 120 ; N fraction ; B -194 0 312 681 ;
+C 165 ; WX 660 ; N yen ; B -28 0 696 681 ;
+C 166 ; WX 660 ; N florin ; B -46 -209 674 749 ;
+C 167 ; WX 600 ; N section ; B 36 -153 560 698 ;
+C 168 ; WX 660 ; N currency ; B 77 88 584 593 ;
+C 169 ; WX 240 ; N quotesingle ; B 42 379 178 698 ;
+C 170 ; WX 540 ; N quotedblleft ; B 82 439 449 698 ;
+C 171 ; WX 400 ; N guillemotleft ; B 34 101 360 457 ;
+C 172 ; WX 220 ; N guilsinglleft ; B 34 101 188 457 ;
+C 173 ; WX 220 ; N guilsinglright ; B 34 101 188 457 ;
+C 174 ; WX 740 ; N fi ; B 22 0 710 741 ;
+C 175 ; WX 740 ; N fl ; B 22 0 710 741 ;
+C 177 ; WX 500 ; N endash ; B -25 212 525 318 ;
+C 178 ; WX 440 ; N dagger ; B 33 -156 398 698 ;
+C 179 ; WX 380 ; N daggerdbl ; B 8 -156 380 698 ;
+C 180 ; WX 340 ; N periodcentered ; B 76 175 258 355 ;
+C 182 ; WX 800 ; N paragraph ; B 51 0 698 681 ;
+C 183 ; WX 460 ; N bullet ; B 60 170 404 511 ;
+C 184 ; WX 320 ; N quotesinglbase ; B 82 -114 242 144 ;
+C 185 ; WX 540 ; N quotedblbase ; B 82 -114 450 144 ;
+C 186 ; WX 540 ; N quotedblright ; B 82 440 449 698 ;
+C 187 ; WX 400 ; N guillemotright ; B 34 101 360 457 ;
+C 188 ; WX 1000 ; N ellipsis ; B 76 -8 924 172 ;
+C 189 ; WX 1360 ; N perthousand ; B 12 -8 1346 698 ;
+C 191 ; WX 660 ; N questiondown ; B 62 -191 609 515 ;
+C 193 ; WX 400 ; N grave ; B 68 547 327 730 ;
+C 194 ; WX 400 ; N acute ; B 68 547 327 731 ;
+C 195 ; WX 500 ; N circumflex ; B 68 555 430 731 ;
+C 196 ; WX 480 ; N tilde ; B 69 556 421 691 ;
+C 197 ; WX 460 ; N macron ; B 68 577 383 663 ;
+C 198 ; WX 500 ; N breve ; B 68 553 429 722 ;
+C 199 ; WX 320 ; N dotaccent ; B 68 536 259 730 ;
+C 200 ; WX 500 ; N dieresis ; B 68 560 441 698 ;
+C 202 ; WX 340 ; N ring ; B 68 552 275 755 ;
+C 203 ; WX 360 ; N cedilla ; B 68 -213 284 0 ;
+C 205 ; WX 440 ; N hungarumlaut ; B 68 554 365 741 ;
+C 206 ; WX 320 ; N ogonek ; B 68 -163 246 0 ;
+C 207 ; WX 500 ; N caron ; B 68 541 430 717 ;
+C 208 ; WX 1000 ; N emdash ; B -25 212 1025 318 ;
+C 225 ; WX 1140 ; N AE ; B -34 0 1149 681 ;
+C 227 ; WX 400 ; N ordfeminine ; B 27 383 396 698 ;
+C 232 ; WX 640 ; N Lslash ; B 20 0 668 681 ;
+C 233 ; WX 800 ; N Oslash ; B 35 -110 771 781 ;
+C 234 ; WX 1220 ; N OE ; B 35 -17 1219 698 ;
+C 235 ; WX 400 ; N ordmasculine ; B 17 383 383 698 ;
+C 241 ; WX 880 ; N ae ; B 28 -8 852 515 ;
+C 245 ; WX 360 ; N dotlessi ; B 22 0 335 502 ;
+C 248 ; WX 340 ; N lslash ; B 9 0 322 725 ;
+C 249 ; WX 620 ; N oslash ; B 31 -40 586 551 ;
+C 250 ; WX 940 ; N oe ; B 31 -8 908 515 ;
+C 251 ; WX 660 ; N germandbls ; B -61 -91 644 699 ;
+C -1 ; WX 580 ; N ecircumflex ; B 31 -8 548 731 ;
+C -1 ; WX 580 ; N edieresis ; B 31 -8 548 698 ;
+C -1 ; WX 580 ; N aacute ; B 28 -8 588 731 ;
+C -1 ; WX 740 ; N registered ; B 23 -17 723 698 ;
+C -1 ; WX 360 ; N icircumflex ; B -2 0 360 731 ;
+C -1 ; WX 660 ; N udieresis ; B 22 -8 653 698 ;
+C -1 ; WX 620 ; N ograve ; B 31 -8 585 730 ;
+C -1 ; WX 660 ; N uacute ; B 22 -8 653 731 ;
+C -1 ; WX 660 ; N ucircumflex ; B 22 -8 653 731 ;
+C -1 ; WX 720 ; N Aacute ; B -34 0 763 910 ;
+C -1 ; WX 360 ; N igrave ; B 22 0 335 730 ;
+C -1 ; WX 400 ; N Icircumflex ; B 18 0 380 910 ;
+C -1 ; WX 580 ; N ccedilla ; B 31 -213 550 515 ;
+C -1 ; WX 580 ; N adieresis ; B 28 -8 588 698 ;
+C -1 ; WX 720 ; N Ecircumflex ; B 20 0 724 910 ;
+C -1 ; WX 520 ; N scaron ; B 22 -8 492 717 ;
+C -1 ; WX 640 ; N thorn ; B 22 -212 611 725 ;
+C -1 ; WX 980 ; N trademark ; B 42 277 982 681 ;
+C -1 ; WX 580 ; N egrave ; B 31 -8 548 730 ;
+C -1 ; WX 396 ; N threesuperior ; B 5 269 391 698 ;
+C -1 ; WX 560 ; N zcaron ; B 22 0 547 717 ;
+C -1 ; WX 580 ; N atilde ; B 28 -8 588 691 ;
+C -1 ; WX 580 ; N aring ; B 28 -8 588 755 ;
+C -1 ; WX 620 ; N ocircumflex ; B 31 -8 585 731 ;
+C -1 ; WX 720 ; N Edieresis ; B 20 0 724 877 ;
+C -1 ; WX 990 ; N threequarters ; B 15 0 967 692 ;
+C -1 ; WX 620 ; N ydieresis ; B 6 -221 613 698 ;
+C -1 ; WX 620 ; N yacute ; B 6 -221 613 731 ;
+C -1 ; WX 360 ; N iacute ; B 22 0 335 731 ;
+C -1 ; WX 720 ; N Acircumflex ; B -34 0 763 910 ;
+C -1 ; WX 740 ; N Uacute ; B 15 -17 724 910 ;
+C -1 ; WX 580 ; N eacute ; B 31 -8 548 731 ;
+C -1 ; WX 800 ; N Ograve ; B 35 -17 769 909 ;
+C -1 ; WX 580 ; N agrave ; B 28 -8 588 730 ;
+C -1 ; WX 740 ; N Udieresis ; B 15 -17 724 877 ;
+C -1 ; WX 580 ; N acircumflex ; B 28 -8 588 731 ;
+C -1 ; WX 400 ; N Igrave ; B 20 0 379 909 ;
+C -1 ; WX 396 ; N twosuperior ; B 14 279 396 698 ;
+C -1 ; WX 740 ; N Ugrave ; B 15 -17 724 909 ;
+C -1 ; WX 990 ; N onequarter ; B 65 0 967 681 ;
+C -1 ; WX 740 ; N Ucircumflex ; B 15 -17 724 910 ;
+C -1 ; WX 660 ; N Scaron ; B 21 -17 639 896 ;
+C -1 ; WX 400 ; N Idieresis ; B 18 0 391 877 ;
+C -1 ; WX 360 ; N idieresis ; B -2 0 371 698 ;
+C -1 ; WX 720 ; N Egrave ; B 20 0 724 909 ;
+C -1 ; WX 800 ; N Oacute ; B 35 -17 769 910 ;
+C -1 ; WX 600 ; N divide ; B 51 9 555 521 ;
+C -1 ; WX 720 ; N Atilde ; B -34 0 763 870 ;
+C -1 ; WX 720 ; N Aring ; B -34 0 763 934 ;
+C -1 ; WX 800 ; N Odieresis ; B 35 -17 769 877 ;
+C -1 ; WX 720 ; N Adieresis ; B -34 0 763 877 ;
+C -1 ; WX 740 ; N Ntilde ; B 20 0 724 870 ;
+C -1 ; WX 640 ; N Zcaron ; B 6 0 635 896 ;
+C -1 ; WX 660 ; N Thorn ; B 20 0 658 681 ;
+C -1 ; WX 400 ; N Iacute ; B 20 0 379 910 ;
+C -1 ; WX 600 ; N plusminus ; B 51 0 555 514 ;
+C -1 ; WX 600 ; N multiply ; B 48 10 552 514 ;
+C -1 ; WX 720 ; N Eacute ; B 20 0 724 910 ;
+C -1 ; WX 700 ; N Ydieresis ; B -20 0 718 877 ;
+C -1 ; WX 396 ; N onesuperior ; B 65 279 345 687 ;
+C -1 ; WX 660 ; N ugrave ; B 22 -8 653 730 ;
+C -1 ; WX 600 ; N logicalnot ; B 51 129 555 421 ;
+C -1 ; WX 680 ; N ntilde ; B 22 0 652 691 ;
+C -1 ; WX 800 ; N Otilde ; B 35 -17 769 870 ;
+C -1 ; WX 620 ; N otilde ; B 31 -8 585 691 ;
+C -1 ; WX 740 ; N Ccedilla ; B 35 -213 724 698 ;
+C -1 ; WX 720 ; N Agrave ; B -34 0 763 909 ;
+C -1 ; WX 990 ; N onehalf ; B 65 0 980 681 ;
+C -1 ; WX 780 ; N Eth ; B 20 0 748 681 ;
+C -1 ; WX 400 ; N degree ; B 50 398 350 698 ;
+C -1 ; WX 700 ; N Yacute ; B -20 0 718 910 ;
+C -1 ; WX 800 ; N Ocircumflex ; B 35 -17 769 910 ;
+C -1 ; WX 620 ; N oacute ; B 31 -8 585 731 ;
+C -1 ; WX 660 ; N mu ; B 22 -221 653 502 ;
+C -1 ; WX 600 ; N minus ; B 51 207 555 323 ;
+C -1 ; WX 620 ; N eth ; B 31 -8 585 741 ;
+C -1 ; WX 620 ; N odieresis ; B 31 -8 585 698 ;
+C -1 ; WX 740 ; N copyright ; B 23 -17 723 698 ;
+C -1 ; WX 600 ; N brokenbar ; B 243 -175 362 675 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 90
+
+KPX A y -1
+KPX A w -9
+KPX A v -8
+KPX A Y -52
+KPX A W -20
+KPX A V -68
+KPX A T -40
+
+KPX F period -132
+KPX F comma -130
+KPX F A -59
+
+KPX L y 19
+KPX L Y -35
+KPX L W -41
+KPX L V -50
+KPX L T -4
+
+KPX P period -128
+KPX P comma -129
+KPX P A -46
+
+KPX R y -8
+KPX R Y -20
+KPX R W -24
+KPX R V -29
+KPX R T -4
+
+KPX T semicolon 5
+KPX T s -10
+KPX T r 27
+KPX T period -122
+KPX T o -28
+KPX T i 27
+KPX T hyphen -10
+KPX T e -29
+KPX T comma -122
+KPX T colon 7
+KPX T c -29
+KPX T a -24
+KPX T A -42
+
+KPX V y 12
+KPX V u -11
+KPX V semicolon -38
+KPX V r -15
+KPX V period -105
+KPX V o -79
+KPX V i 15
+KPX V hyphen -10
+KPX V e -80
+KPX V comma -103
+KPX V colon -37
+KPX V a -74
+KPX V A -88
+
+KPX W y 12
+KPX W u -11
+KPX W semicolon -38
+KPX W r -15
+KPX W period -105
+KPX W o -78
+KPX W i 15
+KPX W hyphen -10
+KPX W e -79
+KPX W comma -103
+KPX W colon -37
+KPX W a -73
+KPX W A -60
+
+KPX Y v 24
+KPX Y u -13
+KPX Y semicolon -34
+KPX Y q -66
+KPX Y period -105
+KPX Y p -23
+KPX Y o -66
+KPX Y i 2
+KPX Y hyphen -10
+KPX Y e -67
+KPX Y comma -103
+KPX Y colon -32
+KPX Y a -60
+KPX Y A -56
+
+KPX f f 21
+
+KPX r q -9
+KPX r period -102
+KPX r o -9
+KPX r n 20
+KPX r m 20
+KPX r hyphen -10
+KPX r h -23
+KPX r g -9
+KPX r f 20
+KPX r e -10
+KPX r d -10
+KPX r comma -101
+KPX r c -9
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 179 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 110 179 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 110 179 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 160 179 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 190 179 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 120 179 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 160 179 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 110 179 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 110 179 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 160 179 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 0 179 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -50 179 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -50 179 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 179 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 130 179 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 200 179 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 150 179 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 150 179 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 200 179 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 160 179 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 80 179 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 170 179 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 120 179 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 120 179 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 170 179 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 150 179 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 100 179 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 70 179 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 90 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 40 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 40 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 90 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 100 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 30 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 90 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 40 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 40 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 90 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -20 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -70 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -70 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -20 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 80 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 110 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 60 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 60 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 50 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 10 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 130 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 80 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 80 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 130 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 110 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 60 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 30 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkdi8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkdi8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..c2da47a2a4998aef6e2b9679b1be895855e74130
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkdi8a.afm
@@ -0,0 +1,417 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue Jan 21 16:12:43 1992
+Comment UniqueID 37832
+Comment VMusage 32139 39031
+FontName Bookman-DemiItalic
+FullName ITC Bookman Demi Italic
+FamilyName ITC Bookman
+Weight Demi
+ItalicAngle -10
+IsFixedPitch false
+FontBBox -231 -250 1333 941
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.004
+Notice Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.ITC Bookman is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 681
+XHeight 515
+Ascender 732
+Descender -213
+StartCharMetrics 228
+C 32 ; WX 340 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 320 ; N exclam ; B 86 -8 366 698 ;
+C 34 ; WX 380 ; N quotedbl ; B 140 371 507 697 ;
+C 35 ; WX 680 ; N numbersign ; B 157 0 649 681 ;
+C 36 ; WX 680 ; N dollar ; B 45 -164 697 790 ;
+C 37 ; WX 880 ; N percent ; B 106 -17 899 698 ;
+C 38 ; WX 980 ; N ampersand ; B 48 -17 1016 698 ;
+C 39 ; WX 320 ; N quoteright ; B 171 420 349 698 ;
+C 40 ; WX 260 ; N parenleft ; B 31 -134 388 741 ;
+C 41 ; WX 260 ; N parenright ; B -35 -134 322 741 ;
+C 42 ; WX 460 ; N asterisk ; B 126 346 508 698 ;
+C 43 ; WX 600 ; N plus ; B 91 9 595 514 ;
+C 44 ; WX 340 ; N comma ; B 100 -124 298 185 ;
+C 45 ; WX 280 ; N hyphen ; B 59 218 319 313 ;
+C 46 ; WX 340 ; N period ; B 106 -8 296 177 ;
+C 47 ; WX 360 ; N slash ; B 9 -106 502 742 ;
+C 48 ; WX 680 ; N zero ; B 87 -17 703 698 ;
+C 49 ; WX 680 ; N one ; B 123 0 565 681 ;
+C 50 ; WX 680 ; N two ; B 67 0 674 698 ;
+C 51 ; WX 680 ; N three ; B 72 -17 683 698 ;
+C 52 ; WX 680 ; N four ; B 63 0 708 681 ;
+C 53 ; WX 680 ; N five ; B 78 -17 669 681 ;
+C 54 ; WX 680 ; N six ; B 88 -17 704 698 ;
+C 55 ; WX 680 ; N seven ; B 123 0 739 681 ;
+C 56 ; WX 680 ; N eight ; B 68 -17 686 698 ;
+C 57 ; WX 680 ; N nine ; B 71 -17 712 698 ;
+C 58 ; WX 340 ; N colon ; B 106 -8 356 515 ;
+C 59 ; WX 340 ; N semicolon ; B 100 -124 352 515 ;
+C 60 ; WX 620 ; N less ; B 79 -9 588 540 ;
+C 61 ; WX 600 ; N equal ; B 91 109 595 421 ;
+C 62 ; WX 620 ; N greater ; B 89 -9 598 540 ;
+C 63 ; WX 620 ; N question ; B 145 -8 668 698 ;
+C 64 ; WX 780 ; N at ; B 80 -17 790 698 ;
+C 65 ; WX 720 ; N A ; B -27 0 769 681 ;
+C 66 ; WX 720 ; N B ; B 14 0 762 681 ;
+C 67 ; WX 700 ; N C ; B 78 -17 754 698 ;
+C 68 ; WX 760 ; N D ; B 14 0 805 681 ;
+C 69 ; WX 720 ; N E ; B 14 0 777 681 ;
+C 70 ; WX 660 ; N F ; B 14 0 763 681 ;
+C 71 ; WX 760 ; N G ; B 77 -17 828 698 ;
+C 72 ; WX 800 ; N H ; B 14 0 910 681 ;
+C 73 ; WX 380 ; N I ; B 14 0 485 681 ;
+C 74 ; WX 620 ; N J ; B 8 -17 721 681 ;
+C 75 ; WX 780 ; N K ; B 14 0 879 681 ;
+C 76 ; WX 640 ; N L ; B 14 0 725 681 ;
+C 77 ; WX 860 ; N M ; B 14 0 970 681 ;
+C 78 ; WX 740 ; N N ; B 14 0 845 681 ;
+C 79 ; WX 760 ; N O ; B 78 -17 806 698 ;
+C 80 ; WX 640 ; N P ; B -6 0 724 681 ;
+C 81 ; WX 760 ; N Q ; B 37 -213 805 698 ;
+C 82 ; WX 740 ; N R ; B 14 0 765 681 ;
+C 83 ; WX 700 ; N S ; B 59 -17 731 698 ;
+C 84 ; WX 700 ; N T ; B 70 0 802 681 ;
+C 85 ; WX 740 ; N U ; B 112 -17 855 681 ;
+C 86 ; WX 660 ; N V ; B 72 0 819 681 ;
+C 87 ; WX 1000 ; N W ; B 72 0 1090 681 ;
+C 88 ; WX 740 ; N X ; B -7 0 835 681 ;
+C 89 ; WX 660 ; N Y ; B 72 0 817 681 ;
+C 90 ; WX 680 ; N Z ; B 23 0 740 681 ;
+C 91 ; WX 260 ; N bracketleft ; B 9 -118 374 741 ;
+C 92 ; WX 580 ; N backslash ; B 73 0 575 741 ;
+C 93 ; WX 260 ; N bracketright ; B -18 -118 347 741 ;
+C 94 ; WX 620 ; N asciicircum ; B 92 281 594 681 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 320 ; N quoteleft ; B 155 420 333 698 ;
+C 97 ; WX 680 ; N a ; B 84 -8 735 515 ;
+C 98 ; WX 600 ; N b ; B 57 -8 633 732 ;
+C 99 ; WX 560 ; N c ; B 58 -8 597 515 ;
+C 100 ; WX 680 ; N d ; B 60 -8 714 732 ;
+C 101 ; WX 560 ; N e ; B 59 -8 596 515 ;
+C 102 ; WX 420 ; N f ; B -192 -213 641 741 ; L i fi ; L l fl ;
+C 103 ; WX 620 ; N g ; B 21 -213 669 515 ;
+C 104 ; WX 700 ; N h ; B 93 -8 736 732 ;
+C 105 ; WX 380 ; N i ; B 83 -8 420 755 ;
+C 106 ; WX 320 ; N j ; B -160 -213 392 755 ;
+C 107 ; WX 700 ; N k ; B 97 -8 732 732 ;
+C 108 ; WX 380 ; N l ; B 109 -8 410 732 ;
+C 109 ; WX 960 ; N m ; B 83 -8 996 515 ;
+C 110 ; WX 680 ; N n ; B 83 -8 715 515 ;
+C 111 ; WX 600 ; N o ; B 59 -8 627 515 ;
+C 112 ; WX 660 ; N p ; B -24 -213 682 515 ;
+C 113 ; WX 620 ; N q ; B 60 -213 640 515 ;
+C 114 ; WX 500 ; N r ; B 84 0 582 515 ;
+C 115 ; WX 540 ; N s ; B 32 -8 573 515 ;
+C 116 ; WX 440 ; N t ; B 106 -8 488 658 ;
+C 117 ; WX 680 ; N u ; B 83 -8 720 507 ;
+C 118 ; WX 540 ; N v ; B 56 -8 572 515 ;
+C 119 ; WX 860 ; N w ; B 56 -8 891 515 ;
+C 120 ; WX 620 ; N x ; B 10 -8 654 515 ;
+C 121 ; WX 600 ; N y ; B 25 -213 642 507 ;
+C 122 ; WX 560 ; N z ; B 36 -8 586 515 ;
+C 123 ; WX 300 ; N braceleft ; B 49 -123 413 742 ;
+C 124 ; WX 620 ; N bar ; B 303 -250 422 750 ;
+C 125 ; WX 300 ; N braceright ; B -8 -114 356 751 ;
+C 126 ; WX 620 ; N asciitilde ; B 101 162 605 368 ;
+C 161 ; WX 320 ; N exclamdown ; B 64 -191 344 515 ;
+C 162 ; WX 680 ; N cent ; B 161 25 616 718 ;
+C 163 ; WX 680 ; N sterling ; B 0 -17 787 698 ;
+C 164 ; WX 120 ; N fraction ; B -144 0 382 681 ;
+C 165 ; WX 680 ; N yen ; B 92 0 782 681 ;
+C 166 ; WX 680 ; N florin ; B -28 -199 743 741 ;
+C 167 ; WX 620 ; N section ; B 46 -137 638 698 ;
+C 168 ; WX 680 ; N currency ; B 148 85 637 571 ;
+C 169 ; WX 180 ; N quotesingle ; B 126 370 295 696 ;
+C 170 ; WX 520 ; N quotedblleft ; B 156 420 545 698 ;
+C 171 ; WX 380 ; N guillemotleft ; B 62 84 406 503 ;
+C 172 ; WX 220 ; N guilsinglleft ; B 62 84 249 503 ;
+C 173 ; WX 220 ; N guilsinglright ; B 62 84 249 503 ;
+C 174 ; WX 820 ; N fi ; B -191 -213 850 741 ;
+C 175 ; WX 820 ; N fl ; B -191 -213 850 741 ;
+C 177 ; WX 500 ; N endash ; B 40 219 573 311 ;
+C 178 ; WX 420 ; N dagger ; B 89 -137 466 698 ;
+C 179 ; WX 420 ; N daggerdbl ; B 79 -137 486 698 ;
+C 180 ; WX 340 ; N periodcentered ; B 126 173 316 358 ;
+C 182 ; WX 680 ; N paragraph ; B 137 0 715 681 ;
+C 183 ; WX 360 ; N bullet ; B 60 170 404 511 ;
+C 184 ; WX 300 ; N quotesinglbase ; B 106 -112 284 166 ;
+C 185 ; WX 520 ; N quotedblbase ; B 106 -112 495 166 ;
+C 186 ; WX 520 ; N quotedblright ; B 171 420 560 698 ;
+C 187 ; WX 380 ; N guillemotright ; B 62 84 406 503 ;
+C 188 ; WX 1000 ; N ellipsis ; B 86 -8 942 177 ;
+C 189 ; WX 1360 ; N perthousand ; B 106 -17 1333 698 ;
+C 191 ; WX 620 ; N questiondown ; B 83 -189 606 515 ;
+C 193 ; WX 380 ; N grave ; B 193 566 424 771 ;
+C 194 ; WX 340 ; N acute ; B 176 566 407 771 ;
+C 195 ; WX 480 ; N circumflex ; B 183 582 523 749 ;
+C 196 ; WX 480 ; N tilde ; B 178 587 533 709 ;
+C 197 ; WX 480 ; N macron ; B 177 603 531 691 ;
+C 198 ; WX 460 ; N breve ; B 177 577 516 707 ;
+C 199 ; WX 380 ; N dotaccent ; B 180 570 345 734 ;
+C 200 ; WX 520 ; N dieresis ; B 180 570 569 734 ;
+C 202 ; WX 360 ; N ring ; B 185 558 406 775 ;
+C 203 ; WX 360 ; N cedilla ; B 68 -220 289 -8 ;
+C 205 ; WX 560 ; N hungarumlaut ; B 181 560 616 775 ;
+C 206 ; WX 320 ; N ogonek ; B 68 -182 253 0 ;
+C 207 ; WX 480 ; N caron ; B 183 582 523 749 ;
+C 208 ; WX 1000 ; N emdash ; B 40 219 1073 311 ;
+C 225 ; WX 1140 ; N AE ; B -27 0 1207 681 ;
+C 227 ; WX 440 ; N ordfeminine ; B 118 400 495 685 ;
+C 232 ; WX 640 ; N Lslash ; B 14 0 724 681 ;
+C 233 ; WX 760 ; N Oslash ; B 21 -29 847 725 ;
+C 234 ; WX 1180 ; N OE ; B 94 -17 1245 698 ;
+C 235 ; WX 440 ; N ordmasculine ; B 127 400 455 685 ;
+C 241 ; WX 880 ; N ae ; B 39 -8 913 515 ;
+C 245 ; WX 380 ; N dotlessi ; B 83 -8 420 507 ;
+C 248 ; WX 380 ; N lslash ; B 63 -8 412 732 ;
+C 249 ; WX 600 ; N oslash ; B 17 -54 661 571 ;
+C 250 ; WX 920 ; N oe ; B 48 -8 961 515 ;
+C 251 ; WX 660 ; N germandbls ; B -231 -213 702 741 ;
+C -1 ; WX 560 ; N ecircumflex ; B 59 -8 596 749 ;
+C -1 ; WX 560 ; N edieresis ; B 59 -8 596 734 ;
+C -1 ; WX 680 ; N aacute ; B 84 -8 735 771 ;
+C -1 ; WX 780 ; N registered ; B 83 -17 783 698 ;
+C -1 ; WX 380 ; N icircumflex ; B 83 -8 433 749 ;
+C -1 ; WX 680 ; N udieresis ; B 83 -8 720 734 ;
+C -1 ; WX 600 ; N ograve ; B 59 -8 627 771 ;
+C -1 ; WX 680 ; N uacute ; B 83 -8 720 771 ;
+C -1 ; WX 680 ; N ucircumflex ; B 83 -8 720 749 ;
+C -1 ; WX 720 ; N Aacute ; B -27 0 769 937 ;
+C -1 ; WX 380 ; N igrave ; B 83 -8 424 771 ;
+C -1 ; WX 380 ; N Icircumflex ; B 14 0 493 915 ;
+C -1 ; WX 560 ; N ccedilla ; B 58 -220 597 515 ;
+C -1 ; WX 680 ; N adieresis ; B 84 -8 735 734 ;
+C -1 ; WX 720 ; N Ecircumflex ; B 14 0 777 915 ;
+C -1 ; WX 540 ; N scaron ; B 32 -8 573 749 ;
+C -1 ; WX 660 ; N thorn ; B -24 -213 682 732 ;
+C -1 ; WX 940 ; N trademark ; B 42 277 982 681 ;
+C -1 ; WX 560 ; N egrave ; B 59 -8 596 771 ;
+C -1 ; WX 408 ; N threesuperior ; B 86 269 483 698 ;
+C -1 ; WX 560 ; N zcaron ; B 36 -8 586 749 ;
+C -1 ; WX 680 ; N atilde ; B 84 -8 735 709 ;
+C -1 ; WX 680 ; N aring ; B 84 -8 735 775 ;
+C -1 ; WX 600 ; N ocircumflex ; B 59 -8 627 749 ;
+C -1 ; WX 720 ; N Edieresis ; B 14 0 777 900 ;
+C -1 ; WX 1020 ; N threequarters ; B 86 0 1054 691 ;
+C -1 ; WX 600 ; N ydieresis ; B 25 -213 642 734 ;
+C -1 ; WX 600 ; N yacute ; B 25 -213 642 771 ;
+C -1 ; WX 380 ; N iacute ; B 83 -8 420 771 ;
+C -1 ; WX 720 ; N Acircumflex ; B -27 0 769 915 ;
+C -1 ; WX 740 ; N Uacute ; B 112 -17 855 937 ;
+C -1 ; WX 560 ; N eacute ; B 59 -8 596 771 ;
+C -1 ; WX 760 ; N Ograve ; B 78 -17 806 937 ;
+C -1 ; WX 680 ; N agrave ; B 84 -8 735 771 ;
+C -1 ; WX 740 ; N Udieresis ; B 112 -17 855 900 ;
+C -1 ; WX 680 ; N acircumflex ; B 84 -8 735 749 ;
+C -1 ; WX 380 ; N Igrave ; B 14 0 485 937 ;
+C -1 ; WX 408 ; N twosuperior ; B 91 279 485 698 ;
+C -1 ; WX 740 ; N Ugrave ; B 112 -17 855 937 ;
+C -1 ; WX 1020 ; N onequarter ; B 118 0 1054 681 ;
+C -1 ; WX 740 ; N Ucircumflex ; B 112 -17 855 915 ;
+C -1 ; WX 700 ; N Scaron ; B 59 -17 731 915 ;
+C -1 ; WX 380 ; N Idieresis ; B 14 0 499 900 ;
+C -1 ; WX 380 ; N idieresis ; B 83 -8 479 734 ;
+C -1 ; WX 720 ; N Egrave ; B 14 0 777 937 ;
+C -1 ; WX 760 ; N Oacute ; B 78 -17 806 937 ;
+C -1 ; WX 600 ; N divide ; B 91 9 595 521 ;
+C -1 ; WX 720 ; N Atilde ; B -27 0 769 875 ;
+C -1 ; WX 720 ; N Aring ; B -27 0 769 941 ;
+C -1 ; WX 760 ; N Odieresis ; B 78 -17 806 900 ;
+C -1 ; WX 720 ; N Adieresis ; B -27 0 769 900 ;
+C -1 ; WX 740 ; N Ntilde ; B 14 0 845 875 ;
+C -1 ; WX 680 ; N Zcaron ; B 23 0 740 915 ;
+C -1 ; WX 640 ; N Thorn ; B -6 0 701 681 ;
+C -1 ; WX 380 ; N Iacute ; B 14 0 485 937 ;
+C -1 ; WX 600 ; N plusminus ; B 91 0 595 514 ;
+C -1 ; WX 600 ; N multiply ; B 91 10 595 514 ;
+C -1 ; WX 720 ; N Eacute ; B 14 0 777 937 ;
+C -1 ; WX 660 ; N Ydieresis ; B 72 0 817 900 ;
+C -1 ; WX 408 ; N onesuperior ; B 118 279 406 688 ;
+C -1 ; WX 680 ; N ugrave ; B 83 -8 720 771 ;
+C -1 ; WX 620 ; N logicalnot ; B 81 129 585 421 ;
+C -1 ; WX 680 ; N ntilde ; B 83 -8 715 709 ;
+C -1 ; WX 760 ; N Otilde ; B 78 -17 806 875 ;
+C -1 ; WX 600 ; N otilde ; B 59 -8 627 709 ;
+C -1 ; WX 700 ; N Ccedilla ; B 78 -220 754 698 ;
+C -1 ; WX 720 ; N Agrave ; B -27 0 769 937 ;
+C -1 ; WX 1020 ; N onehalf ; B 118 0 1036 681 ;
+C -1 ; WX 760 ; N Eth ; B 14 0 805 681 ;
+C -1 ; WX 400 ; N degree ; B 130 398 430 698 ;
+C -1 ; WX 660 ; N Yacute ; B 72 0 817 937 ;
+C -1 ; WX 760 ; N Ocircumflex ; B 78 -17 806 915 ;
+C -1 ; WX 600 ; N oacute ; B 59 -8 627 771 ;
+C -1 ; WX 680 ; N mu ; B 54 -213 720 507 ;
+C -1 ; WX 600 ; N minus ; B 91 207 595 323 ;
+C -1 ; WX 600 ; N eth ; B 59 -8 662 741 ;
+C -1 ; WX 600 ; N odieresis ; B 59 -8 627 734 ;
+C -1 ; WX 780 ; N copyright ; B 83 -17 783 698 ;
+C -1 ; WX 620 ; N brokenbar ; B 303 -175 422 675 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 92
+
+KPX A y 20
+KPX A w 20
+KPX A v 20
+KPX A Y -25
+KPX A W -35
+KPX A V -40
+KPX A T -17
+
+KPX F period -105
+KPX F comma -98
+KPX F A -35
+
+KPX L y 62
+KPX L Y -5
+KPX L W -15
+KPX L V -19
+KPX L T -26
+
+KPX P period -105
+KPX P comma -98
+KPX P A -31
+
+KPX R y 27
+KPX R Y 4
+KPX R W -4
+KPX R V -8
+KPX R T -3
+
+KPX T y 56
+KPX T w 69
+KPX T u 42
+KPX T semicolon 31
+KPX T s -1
+KPX T r 41
+KPX T period -107
+KPX T o -5
+KPX T i 42
+KPX T hyphen -20
+KPX T e -10
+KPX T comma -100
+KPX T colon 26
+KPX T c -8
+KPX T a -8
+KPX T A -42
+
+KPX V y 17
+KPX V u -1
+KPX V semicolon -22
+KPX V r 2
+KPX V period -115
+KPX V o -50
+KPX V i 32
+KPX V hyphen -20
+KPX V e -50
+KPX V comma -137
+KPX V colon -28
+KPX V a -50
+KPX V A -50
+
+KPX W y -51
+KPX W u -69
+KPX W semicolon -81
+KPX W r -66
+KPX W period -183
+KPX W o -100
+KPX W i -36
+KPX W hyphen -22
+KPX W e -100
+KPX W comma -201
+KPX W colon -86
+KPX W a -100
+KPX W A -77
+
+KPX Y v 26
+KPX Y u -1
+KPX Y semicolon -4
+KPX Y q -43
+KPX Y period -113
+KPX Y o -41
+KPX Y i 20
+KPX Y hyphen -20
+KPX Y e -46
+KPX Y comma -106
+KPX Y colon -9
+KPX Y a -45
+KPX Y A -30
+
+KPX f f 10
+
+KPX r q -3
+KPX r period -120
+KPX r o -1
+KPX r n 39
+KPX r m 39
+KPX r hyphen -20
+KPX r h -35
+KPX r g -23
+KPX r f 42
+KPX r e -6
+KPX r d -3
+KPX r comma -113
+KPX r c -5
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 190 166 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 120 166 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 100 166 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 170 166 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 200 166 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 120 166 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 190 166 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 120 166 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 100 166 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 170 166 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 20 166 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -30 166 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -70 166 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 166 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 130 166 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 210 166 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 140 166 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 140 166 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 190 166 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 140 166 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 110 166 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 200 166 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 130 166 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 130 166 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 180 166 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 160 166 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 70 166 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 100 166 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 170 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 100 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 150 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 160 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 100 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 110 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 60 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 20 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 90 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -90 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -90 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 60 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 130 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 60 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 40 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 60 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 30 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 170 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 100 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 80 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 150 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 130 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 40 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 40 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkl8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkl8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..8b79ea71060d631c9d18175924029b583c3fd9e1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkl8a.afm
@@ -0,0 +1,407 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue Jan 21 16:15:53 1992
+Comment UniqueID 37833
+Comment VMusage 32321 39213
+FontName Bookman-Light
+FullName ITC Bookman Light
+FamilyName ITC Bookman
+Weight Light
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -188 -251 1266 908
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.004
+Notice Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.ITC Bookman is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 681
+XHeight 484
+Ascender 717
+Descender -228
+StartCharMetrics 228
+C 32 ; WX 320 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 300 ; N exclam ; B 75 -8 219 698 ;
+C 34 ; WX 380 ; N quotedbl ; B 56 458 323 698 ;
+C 35 ; WX 620 ; N numbersign ; B 65 0 556 681 ;
+C 36 ; WX 620 ; N dollar ; B 34 -109 593 791 ;
+C 37 ; WX 900 ; N percent ; B 22 -8 873 698 ;
+C 38 ; WX 800 ; N ampersand ; B 45 -17 787 698 ;
+C 39 ; WX 220 ; N quoteright ; B 46 480 178 698 ;
+C 40 ; WX 300 ; N parenleft ; B 76 -145 278 727 ;
+C 41 ; WX 300 ; N parenright ; B 17 -146 219 727 ;
+C 42 ; WX 440 ; N asterisk ; B 54 325 391 698 ;
+C 43 ; WX 600 ; N plus ; B 51 8 555 513 ;
+C 44 ; WX 320 ; N comma ; B 90 -114 223 114 ;
+C 45 ; WX 400 ; N hyphen ; B 50 232 350 292 ;
+C 46 ; WX 320 ; N period ; B 92 -8 220 123 ;
+C 47 ; WX 600 ; N slash ; B 74 -149 532 717 ;
+C 48 ; WX 620 ; N zero ; B 40 -17 586 698 ;
+C 49 ; WX 620 ; N one ; B 160 0 501 681 ;
+C 50 ; WX 620 ; N two ; B 42 0 576 698 ;
+C 51 ; WX 620 ; N three ; B 40 -17 576 698 ;
+C 52 ; WX 620 ; N four ; B 25 0 600 681 ;
+C 53 ; WX 620 ; N five ; B 60 -17 584 717 ;
+C 54 ; WX 620 ; N six ; B 45 -17 590 698 ;
+C 55 ; WX 620 ; N seven ; B 60 0 586 681 ;
+C 56 ; WX 620 ; N eight ; B 44 -17 583 698 ;
+C 57 ; WX 620 ; N nine ; B 37 -17 576 698 ;
+C 58 ; WX 320 ; N colon ; B 92 -8 220 494 ;
+C 59 ; WX 320 ; N semicolon ; B 90 -114 223 494 ;
+C 60 ; WX 600 ; N less ; B 49 -2 558 526 ;
+C 61 ; WX 600 ; N equal ; B 51 126 555 398 ;
+C 62 ; WX 600 ; N greater ; B 48 -2 557 526 ;
+C 63 ; WX 540 ; N question ; B 27 -8 514 698 ;
+C 64 ; WX 820 ; N at ; B 55 -17 755 698 ;
+C 65 ; WX 680 ; N A ; B -37 0 714 681 ;
+C 66 ; WX 740 ; N B ; B 31 0 702 681 ;
+C 67 ; WX 740 ; N C ; B 44 -17 702 698 ;
+C 68 ; WX 800 ; N D ; B 31 0 752 681 ;
+C 69 ; WX 720 ; N E ; B 31 0 705 681 ;
+C 70 ; WX 640 ; N F ; B 31 0 654 681 ;
+C 71 ; WX 800 ; N G ; B 44 -17 778 698 ;
+C 72 ; WX 800 ; N H ; B 31 0 769 681 ;
+C 73 ; WX 340 ; N I ; B 31 0 301 681 ;
+C 74 ; WX 600 ; N J ; B -23 -17 567 681 ;
+C 75 ; WX 720 ; N K ; B 31 0 750 681 ;
+C 76 ; WX 600 ; N L ; B 31 0 629 681 ;
+C 77 ; WX 920 ; N M ; B 26 0 894 681 ;
+C 78 ; WX 740 ; N N ; B 26 0 722 681 ;
+C 79 ; WX 800 ; N O ; B 44 -17 758 698 ;
+C 80 ; WX 620 ; N P ; B 31 0 613 681 ;
+C 81 ; WX 820 ; N Q ; B 44 -189 769 698 ;
+C 82 ; WX 720 ; N R ; B 31 0 757 681 ;
+C 83 ; WX 660 ; N S ; B 28 -17 634 698 ;
+C 84 ; WX 620 ; N T ; B -37 0 656 681 ;
+C 85 ; WX 780 ; N U ; B 25 -17 754 681 ;
+C 86 ; WX 700 ; N V ; B -30 0 725 681 ;
+C 87 ; WX 960 ; N W ; B -30 0 984 681 ;
+C 88 ; WX 720 ; N X ; B -30 0 755 681 ;
+C 89 ; WX 640 ; N Y ; B -30 0 666 681 ;
+C 90 ; WX 640 ; N Z ; B 10 0 656 681 ;
+C 91 ; WX 300 ; N bracketleft ; B 92 -136 258 717 ;
+C 92 ; WX 600 ; N backslash ; B 74 0 532 717 ;
+C 93 ; WX 300 ; N bracketright ; B 41 -136 207 717 ;
+C 94 ; WX 600 ; N asciicircum ; B 52 276 554 681 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 220 ; N quoteleft ; B 46 479 178 698 ;
+C 97 ; WX 580 ; N a ; B 35 -8 587 494 ;
+C 98 ; WX 620 ; N b ; B -2 -8 582 717 ;
+C 99 ; WX 520 ; N c ; B 37 -8 498 494 ;
+C 100 ; WX 620 ; N d ; B 37 -8 591 717 ;
+C 101 ; WX 520 ; N e ; B 37 -8 491 494 ;
+C 102 ; WX 320 ; N f ; B 20 0 414 734 ; L i fi ; L l fl ;
+C 103 ; WX 540 ; N g ; B 17 -243 542 567 ;
+C 104 ; WX 660 ; N h ; B 20 0 643 717 ;
+C 105 ; WX 300 ; N i ; B 20 0 288 654 ;
+C 106 ; WX 300 ; N j ; B -109 -251 214 654 ;
+C 107 ; WX 620 ; N k ; B 20 0 628 717 ;
+C 108 ; WX 300 ; N l ; B 20 0 286 717 ;
+C 109 ; WX 940 ; N m ; B 17 0 928 494 ;
+C 110 ; WX 660 ; N n ; B 20 0 649 494 ;
+C 111 ; WX 560 ; N o ; B 37 -8 526 494 ;
+C 112 ; WX 620 ; N p ; B 20 -228 583 494 ;
+C 113 ; WX 580 ; N q ; B 37 -228 589 494 ;
+C 114 ; WX 440 ; N r ; B 20 0 447 494 ;
+C 115 ; WX 520 ; N s ; B 40 -8 487 494 ;
+C 116 ; WX 380 ; N t ; B 20 -8 388 667 ;
+C 117 ; WX 680 ; N u ; B 20 -8 653 484 ;
+C 118 ; WX 520 ; N v ; B -23 0 534 484 ;
+C 119 ; WX 780 ; N w ; B -19 0 804 484 ;
+C 120 ; WX 560 ; N x ; B -16 0 576 484 ;
+C 121 ; WX 540 ; N y ; B -23 -236 549 484 ;
+C 122 ; WX 480 ; N z ; B 7 0 476 484 ;
+C 123 ; WX 280 ; N braceleft ; B 21 -136 260 717 ;
+C 124 ; WX 600 ; N bar ; B 264 -250 342 750 ;
+C 125 ; WX 280 ; N braceright ; B 21 -136 260 717 ;
+C 126 ; WX 600 ; N asciitilde ; B 52 173 556 352 ;
+C 161 ; WX 300 ; N exclamdown ; B 75 -214 219 494 ;
+C 162 ; WX 620 ; N cent ; B 116 20 511 651 ;
+C 163 ; WX 620 ; N sterling ; B 8 -17 631 698 ;
+C 164 ; WX 140 ; N fraction ; B -188 0 335 681 ;
+C 165 ; WX 620 ; N yen ; B -22 0 647 681 ;
+C 166 ; WX 620 ; N florin ; B -29 -155 633 749 ;
+C 167 ; WX 520 ; N section ; B 33 -178 486 698 ;
+C 168 ; WX 620 ; N currency ; B 58 89 563 591 ;
+C 169 ; WX 220 ; N quotesingle ; B 67 458 153 698 ;
+C 170 ; WX 400 ; N quotedblleft ; B 46 479 348 698 ;
+C 171 ; WX 360 ; N guillemotleft ; B 51 89 312 437 ;
+C 172 ; WX 240 ; N guilsinglleft ; B 51 89 189 437 ;
+C 173 ; WX 240 ; N guilsinglright ; B 51 89 189 437 ;
+C 174 ; WX 620 ; N fi ; B 20 0 608 734 ;
+C 175 ; WX 620 ; N fl ; B 20 0 606 734 ;
+C 177 ; WX 500 ; N endash ; B -15 232 515 292 ;
+C 178 ; WX 540 ; N dagger ; B 79 -156 455 698 ;
+C 179 ; WX 540 ; N daggerdbl ; B 79 -156 455 698 ;
+C 180 ; WX 320 ; N periodcentered ; B 92 196 220 327 ;
+C 182 ; WX 600 ; N paragraph ; B 14 0 577 681 ;
+C 183 ; WX 460 ; N bullet ; B 60 170 404 511 ;
+C 184 ; WX 220 ; N quotesinglbase ; B 46 -108 178 110 ;
+C 185 ; WX 400 ; N quotedblbase ; B 46 -108 348 110 ;
+C 186 ; WX 400 ; N quotedblright ; B 46 480 348 698 ;
+C 187 ; WX 360 ; N guillemotright ; B 51 89 312 437 ;
+C 188 ; WX 1000 ; N ellipsis ; B 101 -8 898 123 ;
+C 189 ; WX 1280 ; N perthousand ; B 22 -8 1266 698 ;
+C 191 ; WX 540 ; N questiondown ; B 23 -217 510 494 ;
+C 193 ; WX 340 ; N grave ; B 68 571 274 689 ;
+C 194 ; WX 340 ; N acute ; B 68 571 274 689 ;
+C 195 ; WX 420 ; N circumflex ; B 68 567 352 685 ;
+C 196 ; WX 440 ; N tilde ; B 68 572 375 661 ;
+C 197 ; WX 440 ; N macron ; B 68 587 364 635 ;
+C 198 ; WX 460 ; N breve ; B 68 568 396 687 ;
+C 199 ; WX 260 ; N dotaccent ; B 68 552 186 672 ;
+C 200 ; WX 420 ; N dieresis ; B 68 552 349 674 ;
+C 202 ; WX 320 ; N ring ; B 68 546 252 731 ;
+C 203 ; WX 320 ; N cedilla ; B 68 -200 257 0 ;
+C 205 ; WX 380 ; N hungarumlaut ; B 68 538 311 698 ;
+C 206 ; WX 320 ; N ogonek ; B 68 -145 245 0 ;
+C 207 ; WX 420 ; N caron ; B 68 554 352 672 ;
+C 208 ; WX 1000 ; N emdash ; B -15 232 1015 292 ;
+C 225 ; WX 1260 ; N AE ; B -36 0 1250 681 ;
+C 227 ; WX 420 ; N ordfeminine ; B 49 395 393 698 ;
+C 232 ; WX 600 ; N Lslash ; B 31 0 629 681 ;
+C 233 ; WX 800 ; N Oslash ; B 44 -53 758 733 ;
+C 234 ; WX 1240 ; N OE ; B 44 -17 1214 698 ;
+C 235 ; WX 420 ; N ordmasculine ; B 56 394 361 698 ;
+C 241 ; WX 860 ; N ae ; B 35 -8 832 494 ;
+C 245 ; WX 300 ; N dotlessi ; B 20 0 288 484 ;
+C 248 ; WX 320 ; N lslash ; B 20 0 291 717 ;
+C 249 ; WX 560 ; N oslash ; B 37 -40 526 534 ;
+C 250 ; WX 900 ; N oe ; B 37 -8 876 494 ;
+C 251 ; WX 660 ; N germandbls ; B -109 -110 614 698 ;
+C -1 ; WX 520 ; N ecircumflex ; B 37 -8 491 685 ;
+C -1 ; WX 520 ; N edieresis ; B 37 -8 491 674 ;
+C -1 ; WX 580 ; N aacute ; B 35 -8 587 689 ;
+C -1 ; WX 740 ; N registered ; B 23 -17 723 698 ;
+C -1 ; WX 300 ; N icircumflex ; B 8 0 292 685 ;
+C -1 ; WX 680 ; N udieresis ; B 20 -8 653 674 ;
+C -1 ; WX 560 ; N ograve ; B 37 -8 526 689 ;
+C -1 ; WX 680 ; N uacute ; B 20 -8 653 689 ;
+C -1 ; WX 680 ; N ucircumflex ; B 20 -8 653 685 ;
+C -1 ; WX 680 ; N Aacute ; B -37 0 714 866 ;
+C -1 ; WX 300 ; N igrave ; B 20 0 288 689 ;
+C -1 ; WX 340 ; N Icircumflex ; B 28 0 312 862 ;
+C -1 ; WX 520 ; N ccedilla ; B 37 -200 498 494 ;
+C -1 ; WX 580 ; N adieresis ; B 35 -8 587 674 ;
+C -1 ; WX 720 ; N Ecircumflex ; B 31 0 705 862 ;
+C -1 ; WX 520 ; N scaron ; B 40 -8 487 672 ;
+C -1 ; WX 620 ; N thorn ; B 20 -228 583 717 ;
+C -1 ; WX 980 ; N trademark ; B 34 277 930 681 ;
+C -1 ; WX 520 ; N egrave ; B 37 -8 491 689 ;
+C -1 ; WX 372 ; N threesuperior ; B 12 269 360 698 ;
+C -1 ; WX 480 ; N zcaron ; B 7 0 476 672 ;
+C -1 ; WX 580 ; N atilde ; B 35 -8 587 661 ;
+C -1 ; WX 580 ; N aring ; B 35 -8 587 731 ;
+C -1 ; WX 560 ; N ocircumflex ; B 37 -8 526 685 ;
+C -1 ; WX 720 ; N Edieresis ; B 31 0 705 851 ;
+C -1 ; WX 930 ; N threequarters ; B 52 0 889 691 ;
+C -1 ; WX 540 ; N ydieresis ; B -23 -236 549 674 ;
+C -1 ; WX 540 ; N yacute ; B -23 -236 549 689 ;
+C -1 ; WX 300 ; N iacute ; B 20 0 288 689 ;
+C -1 ; WX 680 ; N Acircumflex ; B -37 0 714 862 ;
+C -1 ; WX 780 ; N Uacute ; B 25 -17 754 866 ;
+C -1 ; WX 520 ; N eacute ; B 37 -8 491 689 ;
+C -1 ; WX 800 ; N Ograve ; B 44 -17 758 866 ;
+C -1 ; WX 580 ; N agrave ; B 35 -8 587 689 ;
+C -1 ; WX 780 ; N Udieresis ; B 25 -17 754 851 ;
+C -1 ; WX 580 ; N acircumflex ; B 35 -8 587 685 ;
+C -1 ; WX 340 ; N Igrave ; B 31 0 301 866 ;
+C -1 ; WX 372 ; N twosuperior ; B 20 279 367 698 ;
+C -1 ; WX 780 ; N Ugrave ; B 25 -17 754 866 ;
+C -1 ; WX 930 ; N onequarter ; B 80 0 869 681 ;
+C -1 ; WX 780 ; N Ucircumflex ; B 25 -17 754 862 ;
+C -1 ; WX 660 ; N Scaron ; B 28 -17 634 849 ;
+C -1 ; WX 340 ; N Idieresis ; B 28 0 309 851 ;
+C -1 ; WX 300 ; N idieresis ; B 8 0 289 674 ;
+C -1 ; WX 720 ; N Egrave ; B 31 0 705 866 ;
+C -1 ; WX 800 ; N Oacute ; B 44 -17 758 866 ;
+C -1 ; WX 600 ; N divide ; B 51 10 555 514 ;
+C -1 ; WX 680 ; N Atilde ; B -37 0 714 838 ;
+C -1 ; WX 680 ; N Aring ; B -37 0 714 908 ;
+C -1 ; WX 800 ; N Odieresis ; B 44 -17 758 851 ;
+C -1 ; WX 680 ; N Adieresis ; B -37 0 714 851 ;
+C -1 ; WX 740 ; N Ntilde ; B 26 0 722 838 ;
+C -1 ; WX 640 ; N Zcaron ; B 10 0 656 849 ;
+C -1 ; WX 620 ; N Thorn ; B 31 0 613 681 ;
+C -1 ; WX 340 ; N Iacute ; B 31 0 301 866 ;
+C -1 ; WX 600 ; N plusminus ; B 51 0 555 513 ;
+C -1 ; WX 600 ; N multiply ; B 51 9 555 513 ;
+C -1 ; WX 720 ; N Eacute ; B 31 0 705 866 ;
+C -1 ; WX 640 ; N Ydieresis ; B -30 0 666 851 ;
+C -1 ; WX 372 ; N onesuperior ; B 80 279 302 688 ;
+C -1 ; WX 680 ; N ugrave ; B 20 -8 653 689 ;
+C -1 ; WX 600 ; N logicalnot ; B 51 128 555 398 ;
+C -1 ; WX 660 ; N ntilde ; B 20 0 649 661 ;
+C -1 ; WX 800 ; N Otilde ; B 44 -17 758 838 ;
+C -1 ; WX 560 ; N otilde ; B 37 -8 526 661 ;
+C -1 ; WX 740 ; N Ccedilla ; B 44 -200 702 698 ;
+C -1 ; WX 680 ; N Agrave ; B -37 0 714 866 ;
+C -1 ; WX 930 ; N onehalf ; B 80 0 885 681 ;
+C -1 ; WX 800 ; N Eth ; B 31 0 752 681 ;
+C -1 ; WX 400 ; N degree ; B 50 398 350 698 ;
+C -1 ; WX 640 ; N Yacute ; B -30 0 666 866 ;
+C -1 ; WX 800 ; N Ocircumflex ; B 44 -17 758 862 ;
+C -1 ; WX 560 ; N oacute ; B 37 -8 526 689 ;
+C -1 ; WX 680 ; N mu ; B 20 -251 653 484 ;
+C -1 ; WX 600 ; N minus ; B 51 224 555 300 ;
+C -1 ; WX 560 ; N eth ; B 37 -8 526 734 ;
+C -1 ; WX 560 ; N odieresis ; B 37 -8 526 674 ;
+C -1 ; WX 740 ; N copyright ; B 24 -17 724 698 ;
+C -1 ; WX 600 ; N brokenbar ; B 264 -175 342 675 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 82
+
+KPX A y 32
+KPX A w 4
+KPX A v 7
+KPX A Y -35
+KPX A W -40
+KPX A V -56
+KPX A T 1
+
+KPX F period -46
+KPX F comma -41
+KPX F A -21
+
+KPX L y 79
+KPX L Y 13
+KPX L W 1
+KPX L V -4
+KPX L T 28
+
+KPX P period -60
+KPX P comma -55
+KPX P A -8
+
+KPX R y 59
+KPX R Y 26
+KPX R W 13
+KPX R V 8
+KPX R T 71
+
+KPX T s 16
+KPX T r 38
+KPX T period -33
+KPX T o 15
+KPX T i 42
+KPX T hyphen 90
+KPX T e 13
+KPX T comma -28
+KPX T c 14
+KPX T a 17
+KPX T A 1
+
+KPX V y 15
+KPX V u -38
+KPX V r -41
+KPX V period -40
+KPX V o -71
+KPX V i -20
+KPX V hyphen 11
+KPX V e -72
+KPX V comma -34
+KPX V a -69
+KPX V A -66
+
+KPX W y 15
+KPX W u -38
+KPX W r -41
+KPX W period -40
+KPX W o -68
+KPX W i -20
+KPX W hyphen 11
+KPX W e -69
+KPX W comma -34
+KPX W a -66
+KPX W A -64
+
+KPX Y v 15
+KPX Y u -38
+KPX Y q -55
+KPX Y period -40
+KPX Y p -31
+KPX Y o -57
+KPX Y i -37
+KPX Y hyphen 11
+KPX Y e -58
+KPX Y comma -34
+KPX Y a -54
+KPX Y A -53
+
+KPX f f 29
+
+KPX r q 9
+KPX r period -64
+KPX r o 8
+KPX r n 31
+KPX r m 31
+KPX r hyphen 70
+KPX r h -21
+KPX r g -4
+KPX r f 33
+KPX r e 7
+KPX r d 7
+KPX r comma -58
+KPX r c 7
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 200 177 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 130 177 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 130 177 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 140 177 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 180 177 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 120 177 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 220 177 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 150 177 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 150 177 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 160 177 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 20 177 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -40 177 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -40 177 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -20 177 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 150 177 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 260 177 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 190 177 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 190 177 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 200 177 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 180 177 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 120 177 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 250 177 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 180 177 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 180 177 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 190 177 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 150 177 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 110 177 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 110 177 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 120 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 80 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 120 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 130 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 70 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 90 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 50 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 50 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 90 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -20 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -60 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -60 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -20 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 110 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 110 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 70 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 70 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 110 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 60 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 50 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 170 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 130 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 130 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 170 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 100 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 60 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 30 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkli8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkli8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..419c319a2573a5e18827715df01719dd3f701f7d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pbkli8a.afm
@@ -0,0 +1,410 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue Jan 21 16:12:06 1992
+Comment UniqueID 37830
+Comment VMusage 33139 40031
+FontName Bookman-LightItalic
+FullName ITC Bookman Light Italic
+FamilyName ITC Bookman
+Weight Light
+ItalicAngle -10
+IsFixedPitch false
+FontBBox -228 -250 1269 883
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.004
+Notice Copyright (c) 1985, 1987, 1989, 1992 Adobe Systems Incorporated. All Rights Reserved.ITC Bookman is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 681
+XHeight 494
+Ascender 717
+Descender -212
+StartCharMetrics 228
+C 32 ; WX 300 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 320 ; N exclam ; B 103 -8 342 698 ;
+C 34 ; WX 360 ; N quotedbl ; B 107 468 402 698 ;
+C 35 ; WX 620 ; N numbersign ; B 107 0 598 681 ;
+C 36 ; WX 620 ; N dollar ; B 78 -85 619 762 ;
+C 37 ; WX 800 ; N percent ; B 56 -8 811 691 ;
+C 38 ; WX 820 ; N ampersand ; B 65 -18 848 698 ;
+C 39 ; WX 280 ; N quoteright ; B 148 470 288 698 ;
+C 40 ; WX 280 ; N parenleft ; B 96 -146 383 727 ;
+C 41 ; WX 280 ; N parenright ; B -8 -146 279 727 ;
+C 42 ; WX 440 ; N asterisk ; B 139 324 505 698 ;
+C 43 ; WX 600 ; N plus ; B 91 43 595 548 ;
+C 44 ; WX 300 ; N comma ; B 88 -115 227 112 ;
+C 45 ; WX 320 ; N hyphen ; B 78 269 336 325 ;
+C 46 ; WX 300 ; N period ; B 96 -8 231 127 ;
+C 47 ; WX 600 ; N slash ; B 104 -149 562 717 ;
+C 48 ; WX 620 ; N zero ; B 86 -17 646 698 ;
+C 49 ; WX 620 ; N one ; B 154 0 500 681 ;
+C 50 ; WX 620 ; N two ; B 66 0 636 698 ;
+C 51 ; WX 620 ; N three ; B 55 -17 622 698 ;
+C 52 ; WX 620 ; N four ; B 69 0 634 681 ;
+C 53 ; WX 620 ; N five ; B 70 -17 614 681 ;
+C 54 ; WX 620 ; N six ; B 89 -17 657 698 ;
+C 55 ; WX 620 ; N seven ; B 143 0 672 681 ;
+C 56 ; WX 620 ; N eight ; B 61 -17 655 698 ;
+C 57 ; WX 620 ; N nine ; B 77 -17 649 698 ;
+C 58 ; WX 300 ; N colon ; B 96 -8 292 494 ;
+C 59 ; WX 300 ; N semicolon ; B 88 -114 292 494 ;
+C 60 ; WX 600 ; N less ; B 79 33 588 561 ;
+C 61 ; WX 600 ; N equal ; B 91 161 595 433 ;
+C 62 ; WX 600 ; N greater ; B 93 33 602 561 ;
+C 63 ; WX 540 ; N question ; B 114 -8 604 698 ;
+C 64 ; WX 780 ; N at ; B 102 -17 802 698 ;
+C 65 ; WX 700 ; N A ; B -25 0 720 681 ;
+C 66 ; WX 720 ; N B ; B 21 0 746 681 ;
+C 67 ; WX 720 ; N C ; B 88 -17 746 698 ;
+C 68 ; WX 740 ; N D ; B 21 0 782 681 ;
+C 69 ; WX 680 ; N E ; B 21 0 736 681 ;
+C 70 ; WX 620 ; N F ; B 21 0 743 681 ;
+C 71 ; WX 760 ; N G ; B 88 -17 813 698 ;
+C 72 ; WX 800 ; N H ; B 21 0 888 681 ;
+C 73 ; WX 320 ; N I ; B 21 0 412 681 ;
+C 74 ; WX 560 ; N J ; B -2 -17 666 681 ;
+C 75 ; WX 720 ; N K ; B 21 0 804 681 ;
+C 76 ; WX 580 ; N L ; B 21 0 656 681 ;
+C 77 ; WX 860 ; N M ; B 18 0 956 681 ;
+C 78 ; WX 720 ; N N ; B 18 0 823 681 ;
+C 79 ; WX 760 ; N O ; B 88 -17 799 698 ;
+C 80 ; WX 600 ; N P ; B 21 0 681 681 ;
+C 81 ; WX 780 ; N Q ; B 61 -191 812 698 ;
+C 82 ; WX 700 ; N R ; B 21 0 736 681 ;
+C 83 ; WX 640 ; N S ; B 61 -17 668 698 ;
+C 84 ; WX 600 ; N T ; B 50 0 725 681 ;
+C 85 ; WX 720 ; N U ; B 118 -17 842 681 ;
+C 86 ; WX 680 ; N V ; B 87 0 815 681 ;
+C 87 ; WX 960 ; N W ; B 87 0 1095 681 ;
+C 88 ; WX 700 ; N X ; B -25 0 815 681 ;
+C 89 ; WX 660 ; N Y ; B 87 0 809 681 ;
+C 90 ; WX 580 ; N Z ; B 8 0 695 681 ;
+C 91 ; WX 260 ; N bracketleft ; B 56 -136 351 717 ;
+C 92 ; WX 600 ; N backslash ; B 84 0 542 717 ;
+C 93 ; WX 260 ; N bracketright ; B 15 -136 309 717 ;
+C 94 ; WX 600 ; N asciicircum ; B 97 276 599 681 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 280 ; N quoteleft ; B 191 470 330 698 ;
+C 97 ; WX 620 ; N a ; B 71 -8 686 494 ;
+C 98 ; WX 600 ; N b ; B 88 -8 621 717 ;
+C 99 ; WX 480 ; N c ; B 65 -8 522 494 ;
+C 100 ; WX 640 ; N d ; B 65 -8 695 717 ;
+C 101 ; WX 540 ; N e ; B 65 -8 575 494 ;
+C 102 ; WX 340 ; N f ; B -160 -218 557 725 ; L i fi ; L l fl ;
+C 103 ; WX 560 ; N g ; B 4 -221 581 494 ;
+C 104 ; WX 620 ; N h ; B 88 -8 689 717 ;
+C 105 ; WX 280 ; N i ; B 88 -8 351 663 ;
+C 106 ; WX 280 ; N j ; B -200 -221 308 663 ;
+C 107 ; WX 600 ; N k ; B 88 -8 657 717 ;
+C 108 ; WX 280 ; N l ; B 100 -8 342 717 ;
+C 109 ; WX 880 ; N m ; B 88 -8 952 494 ;
+C 110 ; WX 620 ; N n ; B 88 -8 673 494 ;
+C 111 ; WX 540 ; N o ; B 65 -8 572 494 ;
+C 112 ; WX 600 ; N p ; B -24 -212 620 494 ;
+C 113 ; WX 560 ; N q ; B 65 -212 584 494 ;
+C 114 ; WX 400 ; N r ; B 88 0 481 494 ;
+C 115 ; WX 540 ; N s ; B 65 -8 547 494 ;
+C 116 ; WX 340 ; N t ; B 88 -8 411 664 ;
+C 117 ; WX 620 ; N u ; B 88 -8 686 484 ;
+C 118 ; WX 540 ; N v ; B 88 -8 562 494 ;
+C 119 ; WX 880 ; N w ; B 88 -8 893 494 ;
+C 120 ; WX 540 ; N x ; B 9 -8 626 494 ;
+C 121 ; WX 600 ; N y ; B 60 -221 609 484 ;
+C 122 ; WX 520 ; N z ; B 38 -8 561 494 ;
+C 123 ; WX 360 ; N braceleft ; B 122 -191 442 717 ;
+C 124 ; WX 600 ; N bar ; B 294 -250 372 750 ;
+C 125 ; WX 380 ; N braceright ; B 13 -191 333 717 ;
+C 126 ; WX 600 ; N asciitilde ; B 91 207 595 386 ;
+C 161 ; WX 320 ; N exclamdown ; B 73 -213 301 494 ;
+C 162 ; WX 620 ; N cent ; B 148 -29 596 715 ;
+C 163 ; WX 620 ; N sterling ; B 4 -17 702 698 ;
+C 164 ; WX 20 ; N fraction ; B -228 0 323 681 ;
+C 165 ; WX 620 ; N yen ; B 71 0 735 681 ;
+C 166 ; WX 620 ; N florin ; B -26 -218 692 725 ;
+C 167 ; WX 620 ; N section ; B 38 -178 638 698 ;
+C 168 ; WX 620 ; N currency ; B 100 89 605 591 ;
+C 169 ; WX 200 ; N quotesingle ; B 99 473 247 698 ;
+C 170 ; WX 440 ; N quotedblleft ; B 191 470 493 698 ;
+C 171 ; WX 300 ; N guillemotleft ; B 70 129 313 434 ;
+C 172 ; WX 180 ; N guilsinglleft ; B 75 129 208 434 ;
+C 173 ; WX 180 ; N guilsinglright ; B 70 129 203 434 ;
+C 174 ; WX 640 ; N fi ; B -159 -222 709 725 ;
+C 175 ; WX 660 ; N fl ; B -159 -218 713 725 ;
+C 177 ; WX 500 ; N endash ; B 33 269 561 325 ;
+C 178 ; WX 620 ; N dagger ; B 192 -130 570 698 ;
+C 179 ; WX 620 ; N daggerdbl ; B 144 -122 566 698 ;
+C 180 ; WX 300 ; N periodcentered ; B 137 229 272 364 ;
+C 182 ; WX 620 ; N paragraph ; B 112 0 718 681 ;
+C 183 ; WX 460 ; N bullet ; B 100 170 444 511 ;
+C 184 ; WX 320 ; N quotesinglbase ; B 87 -114 226 113 ;
+C 185 ; WX 480 ; N quotedblbase ; B 87 -114 390 113 ;
+C 186 ; WX 440 ; N quotedblright ; B 148 470 451 698 ;
+C 187 ; WX 300 ; N guillemotright ; B 60 129 303 434 ;
+C 188 ; WX 1000 ; N ellipsis ; B 99 -8 900 127 ;
+C 189 ; WX 1180 ; N perthousand ; B 56 -8 1199 691 ;
+C 191 ; WX 540 ; N questiondown ; B 18 -212 508 494 ;
+C 193 ; WX 340 ; N grave ; B 182 551 377 706 ;
+C 194 ; WX 320 ; N acute ; B 178 551 373 706 ;
+C 195 ; WX 440 ; N circumflex ; B 176 571 479 685 ;
+C 196 ; WX 440 ; N tilde ; B 180 586 488 671 ;
+C 197 ; WX 440 ; N macron ; B 178 599 484 658 ;
+C 198 ; WX 440 ; N breve ; B 191 577 500 680 ;
+C 199 ; WX 260 ; N dotaccent ; B 169 543 290 664 ;
+C 200 ; WX 420 ; N dieresis ; B 185 569 467 688 ;
+C 202 ; WX 300 ; N ring ; B 178 551 334 706 ;
+C 203 ; WX 320 ; N cedilla ; B 45 -178 240 0 ;
+C 205 ; WX 340 ; N hungarumlaut ; B 167 547 402 738 ;
+C 206 ; WX 260 ; N ogonek ; B 51 -173 184 0 ;
+C 207 ; WX 440 ; N caron ; B 178 571 481 684 ;
+C 208 ; WX 1000 ; N emdash ; B 33 269 1061 325 ;
+C 225 ; WX 1220 ; N AE ; B -45 0 1269 681 ;
+C 227 ; WX 440 ; N ordfeminine ; B 130 396 513 698 ;
+C 232 ; WX 580 ; N Lslash ; B 21 0 656 681 ;
+C 233 ; WX 760 ; N Oslash ; B 88 -95 799 777 ;
+C 234 ; WX 1180 ; N OE ; B 88 -17 1237 698 ;
+C 235 ; WX 400 ; N ordmasculine ; B 139 396 455 698 ;
+C 241 ; WX 880 ; N ae ; B 71 -8 918 494 ;
+C 245 ; WX 280 ; N dotlessi ; B 88 -8 351 484 ;
+C 248 ; WX 340 ; N lslash ; B 50 -8 398 717 ;
+C 249 ; WX 540 ; N oslash ; B 65 -49 571 532 ;
+C 250 ; WX 900 ; N oe ; B 65 -8 948 494 ;
+C 251 ; WX 620 ; N germandbls ; B -121 -111 653 698 ;
+C -1 ; WX 540 ; N ecircumflex ; B 65 -8 575 685 ;
+C -1 ; WX 540 ; N edieresis ; B 65 -8 575 688 ;
+C -1 ; WX 620 ; N aacute ; B 71 -8 686 706 ;
+C -1 ; WX 740 ; N registered ; B 84 -17 784 698 ;
+C -1 ; WX 280 ; N icircumflex ; B 76 -8 379 685 ;
+C -1 ; WX 620 ; N udieresis ; B 88 -8 686 688 ;
+C -1 ; WX 540 ; N ograve ; B 65 -8 572 706 ;
+C -1 ; WX 620 ; N uacute ; B 88 -8 686 706 ;
+C -1 ; WX 620 ; N ucircumflex ; B 88 -8 686 685 ;
+C -1 ; WX 700 ; N Aacute ; B -25 0 720 883 ;
+C -1 ; WX 280 ; N igrave ; B 88 -8 351 706 ;
+C -1 ; WX 320 ; N Icircumflex ; B 21 0 449 862 ;
+C -1 ; WX 480 ; N ccedilla ; B 65 -178 522 494 ;
+C -1 ; WX 620 ; N adieresis ; B 71 -8 686 688 ;
+C -1 ; WX 680 ; N Ecircumflex ; B 21 0 736 862 ;
+C -1 ; WX 540 ; N scaron ; B 65 -8 547 684 ;
+C -1 ; WX 600 ; N thorn ; B -24 -212 620 717 ;
+C -1 ; WX 980 ; N trademark ; B 69 277 965 681 ;
+C -1 ; WX 540 ; N egrave ; B 65 -8 575 706 ;
+C -1 ; WX 372 ; N threesuperior ; B 70 269 439 698 ;
+C -1 ; WX 520 ; N zcaron ; B 38 -8 561 684 ;
+C -1 ; WX 620 ; N atilde ; B 71 -8 686 671 ;
+C -1 ; WX 620 ; N aring ; B 71 -8 686 706 ;
+C -1 ; WX 540 ; N ocircumflex ; B 65 -8 572 685 ;
+C -1 ; WX 680 ; N Edieresis ; B 21 0 736 865 ;
+C -1 ; WX 930 ; N threequarters ; B 99 0 913 691 ;
+C -1 ; WX 600 ; N ydieresis ; B 60 -221 609 688 ;
+C -1 ; WX 600 ; N yacute ; B 60 -221 609 706 ;
+C -1 ; WX 280 ; N iacute ; B 88 -8 351 706 ;
+C -1 ; WX 700 ; N Acircumflex ; B -25 0 720 862 ;
+C -1 ; WX 720 ; N Uacute ; B 118 -17 842 883 ;
+C -1 ; WX 540 ; N eacute ; B 65 -8 575 706 ;
+C -1 ; WX 760 ; N Ograve ; B 88 -17 799 883 ;
+C -1 ; WX 620 ; N agrave ; B 71 -8 686 706 ;
+C -1 ; WX 720 ; N Udieresis ; B 118 -17 842 865 ;
+C -1 ; WX 620 ; N acircumflex ; B 71 -8 686 685 ;
+C -1 ; WX 320 ; N Igrave ; B 21 0 412 883 ;
+C -1 ; WX 372 ; N twosuperior ; B 68 279 439 698 ;
+C -1 ; WX 720 ; N Ugrave ; B 118 -17 842 883 ;
+C -1 ; WX 930 ; N onequarter ; B 91 0 913 681 ;
+C -1 ; WX 720 ; N Ucircumflex ; B 118 -17 842 862 ;
+C -1 ; WX 640 ; N Scaron ; B 61 -17 668 861 ;
+C -1 ; WX 320 ; N Idieresis ; B 21 0 447 865 ;
+C -1 ; WX 280 ; N idieresis ; B 88 -8 377 688 ;
+C -1 ; WX 680 ; N Egrave ; B 21 0 736 883 ;
+C -1 ; WX 760 ; N Oacute ; B 88 -17 799 883 ;
+C -1 ; WX 600 ; N divide ; B 91 46 595 548 ;
+C -1 ; WX 700 ; N Atilde ; B -25 0 720 848 ;
+C -1 ; WX 700 ; N Aring ; B -25 0 720 883 ;
+C -1 ; WX 760 ; N Odieresis ; B 88 -17 799 865 ;
+C -1 ; WX 700 ; N Adieresis ; B -25 0 720 865 ;
+C -1 ; WX 720 ; N Ntilde ; B 18 0 823 848 ;
+C -1 ; WX 580 ; N Zcaron ; B 8 0 695 861 ;
+C -1 ; WX 600 ; N Thorn ; B 21 0 656 681 ;
+C -1 ; WX 320 ; N Iacute ; B 21 0 412 883 ;
+C -1 ; WX 600 ; N plusminus ; B 91 0 595 548 ;
+C -1 ; WX 600 ; N multiply ; B 91 44 595 548 ;
+C -1 ; WX 680 ; N Eacute ; B 21 0 736 883 ;
+C -1 ; WX 660 ; N Ydieresis ; B 87 0 809 865 ;
+C -1 ; WX 372 ; N onesuperior ; B 114 279 339 688 ;
+C -1 ; WX 620 ; N ugrave ; B 88 -8 686 706 ;
+C -1 ; WX 600 ; N logicalnot ; B 91 163 595 433 ;
+C -1 ; WX 620 ; N ntilde ; B 88 -8 673 671 ;
+C -1 ; WX 760 ; N Otilde ; B 88 -17 799 848 ;
+C -1 ; WX 540 ; N otilde ; B 65 -8 572 671 ;
+C -1 ; WX 720 ; N Ccedilla ; B 88 -178 746 698 ;
+C -1 ; WX 700 ; N Agrave ; B -25 0 720 883 ;
+C -1 ; WX 930 ; N onehalf ; B 91 0 925 681 ;
+C -1 ; WX 740 ; N Eth ; B 21 0 782 681 ;
+C -1 ; WX 400 ; N degree ; B 120 398 420 698 ;
+C -1 ; WX 660 ; N Yacute ; B 87 0 809 883 ;
+C -1 ; WX 760 ; N Ocircumflex ; B 88 -17 799 862 ;
+C -1 ; WX 540 ; N oacute ; B 65 -8 572 706 ;
+C -1 ; WX 620 ; N mu ; B 53 -221 686 484 ;
+C -1 ; WX 600 ; N minus ; B 91 259 595 335 ;
+C -1 ; WX 540 ; N eth ; B 65 -8 642 725 ;
+C -1 ; WX 540 ; N odieresis ; B 65 -8 572 688 ;
+C -1 ; WX 740 ; N copyright ; B 84 -17 784 698 ;
+C -1 ; WX 600 ; N brokenbar ; B 294 -175 372 675 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 85
+
+KPX A Y -62
+KPX A W -73
+KPX A V -78
+KPX A T -5
+
+KPX F period -97
+KPX F comma -98
+KPX F A -16
+
+KPX L y 20
+KPX L Y 7
+KPX L W 9
+KPX L V 4
+
+KPX P period -105
+KPX P comma -106
+KPX P A -30
+
+KPX R Y 11
+KPX R W 2
+KPX R V 2
+KPX R T 65
+
+KPX T semicolon 48
+KPX T s -7
+KPX T r 67
+KPX T period -78
+KPX T o 14
+KPX T i 71
+KPX T hyphen 20
+KPX T e 10
+KPX T comma -79
+KPX T colon 48
+KPX T c 16
+KPX T a 9
+KPX T A -14
+
+KPX V y -14
+KPX V u -10
+KPX V semicolon -44
+KPX V r -20
+KPX V period -100
+KPX V o -70
+KPX V i 3
+KPX V hyphen 20
+KPX V e -70
+KPX V comma -109
+KPX V colon -35
+KPX V a -70
+KPX V A -70
+
+KPX W y -14
+KPX W u -20
+KPX W semicolon -42
+KPX W r -30
+KPX W period -100
+KPX W o -60
+KPX W i 3
+KPX W hyphen 20
+KPX W e -60
+KPX W comma -109
+KPX W colon -35
+KPX W a -60
+KPX W A -60
+
+KPX Y v -19
+KPX Y u -31
+KPX Y semicolon -40
+KPX Y q -72
+KPX Y period -100
+KPX Y p -37
+KPX Y o -75
+KPX Y i -11
+KPX Y hyphen 20
+KPX Y e -78
+KPX Y comma -109
+KPX Y colon -35
+KPX Y a -79
+KPX Y A -82
+
+KPX f f -19
+
+KPX r q -14
+KPX r period -134
+KPX r o -10
+KPX r n 38
+KPX r m 37
+KPX r hyphen 20
+KPX r h -20
+KPX r g -3
+KPX r f -9
+KPX r e -15
+KPX r d -9
+KPX r comma -143
+KPX r c -8
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 200 177 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 130 177 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 140 177 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 160 177 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 220 177 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 130 177 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 210 177 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 140 177 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 150 177 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 150 177 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 30 177 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -30 177 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -20 177 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -30 177 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 130 177 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 250 177 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 190 177 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 200 177 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 210 177 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 190 177 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 100 177 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 230 177 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 170 177 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 180 177 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 170 177 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 200 177 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 140 177 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 70 177 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 120 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 70 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 80 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 110 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 140 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 60 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 90 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 30 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 40 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 80 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -40 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -100 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -90 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -60 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 60 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 80 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 20 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 40 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 80 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 30 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 30 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 120 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 60 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 70 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 110 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 140 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 70 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 20 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrb8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrb8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..baf3a5151223b4d04a260c7045f063dd6520fa95
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrb8a.afm
@@ -0,0 +1,344 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Tue Sep 17 14:02:41 1991
+Comment UniqueID 36384
+Comment VMusage 31992 40360
+FontName Courier-Bold
+FullName Courier Bold
+FamilyName Courier
+Weight Bold
+ItalicAngle 0
+IsFixedPitch true
+FontBBox -113 -250 749 801
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.004
+Notice Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated. All rights reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 562
+XHeight 439
+Ascender 626
+Descender -142
+StartCharMetrics 260
+C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 600 ; N exclam ; B 202 -15 398 572 ;
+C 34 ; WX 600 ; N quotedbl ; B 135 277 465 562 ;
+C 35 ; WX 600 ; N numbersign ; B 56 -45 544 651 ;
+C 36 ; WX 600 ; N dollar ; B 82 -126 519 666 ;
+C 37 ; WX 600 ; N percent ; B 5 -15 595 616 ;
+C 38 ; WX 600 ; N ampersand ; B 36 -15 546 543 ;
+C 39 ; WX 600 ; N quoteright ; B 171 277 423 562 ;
+C 40 ; WX 600 ; N parenleft ; B 219 -102 461 616 ;
+C 41 ; WX 600 ; N parenright ; B 139 -102 381 616 ;
+C 42 ; WX 600 ; N asterisk ; B 91 219 509 601 ;
+C 43 ; WX 600 ; N plus ; B 71 39 529 478 ;
+C 44 ; WX 600 ; N comma ; B 123 -111 393 174 ;
+C 45 ; WX 600 ; N hyphen ; B 100 203 500 313 ;
+C 46 ; WX 600 ; N period ; B 192 -15 408 171 ;
+C 47 ; WX 600 ; N slash ; B 98 -77 502 626 ;
+C 48 ; WX 600 ; N zero ; B 87 -15 513 616 ;
+C 49 ; WX 600 ; N one ; B 81 0 539 616 ;
+C 50 ; WX 600 ; N two ; B 61 0 499 616 ;
+C 51 ; WX 600 ; N three ; B 63 -15 501 616 ;
+C 52 ; WX 600 ; N four ; B 53 0 507 616 ;
+C 53 ; WX 600 ; N five ; B 70 -15 521 601 ;
+C 54 ; WX 600 ; N six ; B 90 -15 521 616 ;
+C 55 ; WX 600 ; N seven ; B 55 0 494 601 ;
+C 56 ; WX 600 ; N eight ; B 83 -15 517 616 ;
+C 57 ; WX 600 ; N nine ; B 79 -15 510 616 ;
+C 58 ; WX 600 ; N colon ; B 191 -15 407 425 ;
+C 59 ; WX 600 ; N semicolon ; B 123 -111 408 425 ;
+C 60 ; WX 600 ; N less ; B 66 15 523 501 ;
+C 61 ; WX 600 ; N equal ; B 71 118 529 398 ;
+C 62 ; WX 600 ; N greater ; B 77 15 534 501 ;
+C 63 ; WX 600 ; N question ; B 98 -14 501 580 ;
+C 64 ; WX 600 ; N at ; B 16 -15 584 616 ;
+C 65 ; WX 600 ; N A ; B -9 0 609 562 ;
+C 66 ; WX 600 ; N B ; B 30 0 573 562 ;
+C 67 ; WX 600 ; N C ; B 22 -18 560 580 ;
+C 68 ; WX 600 ; N D ; B 30 0 594 562 ;
+C 69 ; WX 600 ; N E ; B 25 0 560 562 ;
+C 70 ; WX 600 ; N F ; B 39 0 570 562 ;
+C 71 ; WX 600 ; N G ; B 22 -18 594 580 ;
+C 72 ; WX 600 ; N H ; B 20 0 580 562 ;
+C 73 ; WX 600 ; N I ; B 77 0 523 562 ;
+C 74 ; WX 600 ; N J ; B 37 -18 601 562 ;
+C 75 ; WX 600 ; N K ; B 21 0 599 562 ;
+C 76 ; WX 600 ; N L ; B 39 0 578 562 ;
+C 77 ; WX 600 ; N M ; B -2 0 602 562 ;
+C 78 ; WX 600 ; N N ; B 8 -12 610 562 ;
+C 79 ; WX 600 ; N O ; B 22 -18 578 580 ;
+C 80 ; WX 600 ; N P ; B 48 0 559 562 ;
+C 81 ; WX 600 ; N Q ; B 32 -138 578 580 ;
+C 82 ; WX 600 ; N R ; B 24 0 599 562 ;
+C 83 ; WX 600 ; N S ; B 47 -22 553 582 ;
+C 84 ; WX 600 ; N T ; B 21 0 579 562 ;
+C 85 ; WX 600 ; N U ; B 4 -18 596 562 ;
+C 86 ; WX 600 ; N V ; B -13 0 613 562 ;
+C 87 ; WX 600 ; N W ; B -18 0 618 562 ;
+C 88 ; WX 600 ; N X ; B 12 0 588 562 ;
+C 89 ; WX 600 ; N Y ; B 12 0 589 562 ;
+C 90 ; WX 600 ; N Z ; B 62 0 539 562 ;
+C 91 ; WX 600 ; N bracketleft ; B 245 -102 475 616 ;
+C 92 ; WX 600 ; N backslash ; B 99 -77 503 626 ;
+C 93 ; WX 600 ; N bracketright ; B 125 -102 355 616 ;
+C 94 ; WX 600 ; N asciicircum ; B 108 250 492 616 ;
+C 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 178 277 428 562 ;
+C 97 ; WX 600 ; N a ; B 35 -15 570 454 ;
+C 98 ; WX 600 ; N b ; B 0 -15 584 626 ;
+C 99 ; WX 600 ; N c ; B 40 -15 545 459 ;
+C 100 ; WX 600 ; N d ; B 20 -15 591 626 ;
+C 101 ; WX 600 ; N e ; B 40 -15 563 454 ;
+C 102 ; WX 600 ; N f ; B 83 0 547 626 ; L i fi ; L l fl ;
+C 103 ; WX 600 ; N g ; B 30 -146 580 454 ;
+C 104 ; WX 600 ; N h ; B 5 0 592 626 ;
+C 105 ; WX 600 ; N i ; B 77 0 523 658 ;
+C 106 ; WX 600 ; N j ; B 63 -146 440 658 ;
+C 107 ; WX 600 ; N k ; B 20 0 585 626 ;
+C 108 ; WX 600 ; N l ; B 77 0 523 626 ;
+C 109 ; WX 600 ; N m ; B -22 0 626 454 ;
+C 110 ; WX 600 ; N n ; B 18 0 592 454 ;
+C 111 ; WX 600 ; N o ; B 30 -15 570 454 ;
+C 112 ; WX 600 ; N p ; B -1 -142 570 454 ;
+C 113 ; WX 600 ; N q ; B 20 -142 591 454 ;
+C 114 ; WX 600 ; N r ; B 47 0 580 454 ;
+C 115 ; WX 600 ; N s ; B 68 -17 535 459 ;
+C 116 ; WX 600 ; N t ; B 47 -15 532 562 ;
+C 117 ; WX 600 ; N u ; B -1 -15 569 439 ;
+C 118 ; WX 600 ; N v ; B -1 0 601 439 ;
+C 119 ; WX 600 ; N w ; B -18 0 618 439 ;
+C 120 ; WX 600 ; N x ; B 6 0 594 439 ;
+C 121 ; WX 600 ; N y ; B -4 -142 601 439 ;
+C 122 ; WX 600 ; N z ; B 81 0 520 439 ;
+C 123 ; WX 600 ; N braceleft ; B 160 -102 464 616 ;
+C 124 ; WX 600 ; N bar ; B 255 -250 345 750 ;
+C 125 ; WX 600 ; N braceright ; B 136 -102 440 616 ;
+C 126 ; WX 600 ; N asciitilde ; B 71 153 530 356 ;
+C 161 ; WX 600 ; N exclamdown ; B 202 -146 398 449 ;
+C 162 ; WX 600 ; N cent ; B 66 -49 518 614 ;
+C 163 ; WX 600 ; N sterling ; B 72 -28 558 611 ;
+C 164 ; WX 600 ; N fraction ; B 25 -60 576 661 ;
+C 165 ; WX 600 ; N yen ; B 10 0 590 562 ;
+C 166 ; WX 600 ; N florin ; B -30 -131 572 616 ;
+C 167 ; WX 600 ; N section ; B 83 -70 517 580 ;
+C 168 ; WX 600 ; N currency ; B 54 49 546 517 ;
+C 169 ; WX 600 ; N quotesingle ; B 227 277 373 562 ;
+C 170 ; WX 600 ; N quotedblleft ; B 71 277 535 562 ;
+C 171 ; WX 600 ; N guillemotleft ; B 8 70 553 446 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 141 70 459 446 ;
+C 173 ; WX 600 ; N guilsinglright ; B 141 70 459 446 ;
+C 174 ; WX 600 ; N fi ; B 12 0 593 626 ;
+C 175 ; WX 600 ; N fl ; B 12 0 593 626 ;
+C 177 ; WX 600 ; N endash ; B 65 203 535 313 ;
+C 178 ; WX 600 ; N dagger ; B 106 -70 494 580 ;
+C 179 ; WX 600 ; N daggerdbl ; B 106 -70 494 580 ;
+C 180 ; WX 600 ; N periodcentered ; B 196 165 404 351 ;
+C 182 ; WX 600 ; N paragraph ; B 6 -70 576 580 ;
+C 183 ; WX 600 ; N bullet ; B 140 132 460 430 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 175 -142 427 143 ;
+C 185 ; WX 600 ; N quotedblbase ; B 65 -142 529 143 ;
+C 186 ; WX 600 ; N quotedblright ; B 61 277 525 562 ;
+C 187 ; WX 600 ; N guillemotright ; B 47 70 592 446 ;
+C 188 ; WX 600 ; N ellipsis ; B 26 -15 574 116 ;
+C 189 ; WX 600 ; N perthousand ; B -113 -15 713 616 ;
+C 191 ; WX 600 ; N questiondown ; B 99 -146 502 449 ;
+C 193 ; WX 600 ; N grave ; B 132 508 395 661 ;
+C 194 ; WX 600 ; N acute ; B 205 508 468 661 ;
+C 195 ; WX 600 ; N circumflex ; B 103 483 497 657 ;
+C 196 ; WX 600 ; N tilde ; B 89 493 512 636 ;
+C 197 ; WX 600 ; N macron ; B 88 505 512 585 ;
+C 198 ; WX 600 ; N breve ; B 83 468 517 631 ;
+C 199 ; WX 600 ; N dotaccent ; B 230 485 370 625 ;
+C 200 ; WX 600 ; N dieresis ; B 128 485 472 625 ;
+C 202 ; WX 600 ; N ring ; B 198 481 402 678 ;
+C 203 ; WX 600 ; N cedilla ; B 205 -206 387 0 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 68 488 588 661 ;
+C 206 ; WX 600 ; N ogonek ; B 169 -199 367 0 ;
+C 207 ; WX 600 ; N caron ; B 103 493 497 667 ;
+C 208 ; WX 600 ; N emdash ; B -10 203 610 313 ;
+C 225 ; WX 600 ; N AE ; B -29 0 602 562 ;
+C 227 ; WX 600 ; N ordfeminine ; B 147 196 453 580 ;
+C 232 ; WX 600 ; N Lslash ; B 39 0 578 562 ;
+C 233 ; WX 600 ; N Oslash ; B 22 -22 578 584 ;
+C 234 ; WX 600 ; N OE ; B -25 0 595 562 ;
+C 235 ; WX 600 ; N ordmasculine ; B 147 196 453 580 ;
+C 241 ; WX 600 ; N ae ; B -4 -15 601 454 ;
+C 245 ; WX 600 ; N dotlessi ; B 77 0 523 439 ;
+C 248 ; WX 600 ; N lslash ; B 77 0 523 626 ;
+C 249 ; WX 600 ; N oslash ; B 30 -24 570 463 ;
+C 250 ; WX 600 ; N oe ; B -18 -15 611 454 ;
+C 251 ; WX 600 ; N germandbls ; B 22 -15 596 626 ;
+C -1 ; WX 600 ; N Odieresis ; B 22 -18 578 748 ;
+C -1 ; WX 600 ; N logicalnot ; B 71 103 529 413 ;
+C -1 ; WX 600 ; N minus ; B 71 203 529 313 ;
+C -1 ; WX 600 ; N merge ; B 137 -15 464 487 ;
+C -1 ; WX 600 ; N degree ; B 86 243 474 616 ;
+C -1 ; WX 600 ; N dectab ; B 8 0 592 320 ;
+C -1 ; WX 600 ; N ll ; B -12 0 600 626 ;
+C -1 ; WX 600 ; N IJ ; B -8 -18 622 562 ;
+C -1 ; WX 600 ; N Eacute ; B 25 0 560 784 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 22 -18 578 780 ;
+C -1 ; WX 600 ; N ucircumflex ; B -1 -15 569 657 ;
+C -1 ; WX 600 ; N left ; B 65 44 535 371 ;
+C -1 ; WX 600 ; N threesuperior ; B 138 222 433 616 ;
+C -1 ; WX 600 ; N up ; B 136 0 463 447 ;
+C -1 ; WX 600 ; N multiply ; B 81 39 520 478 ;
+C -1 ; WX 600 ; N Scaron ; B 47 -22 553 790 ;
+C -1 ; WX 600 ; N tab ; B 19 0 581 562 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 4 -18 596 780 ;
+C -1 ; WX 600 ; N divide ; B 71 16 529 500 ;
+C -1 ; WX 600 ; N Acircumflex ; B -9 0 609 780 ;
+C -1 ; WX 600 ; N eacute ; B 40 -15 563 661 ;
+C -1 ; WX 600 ; N uacute ; B -1 -15 569 661 ;
+C -1 ; WX 600 ; N Aacute ; B -9 0 609 784 ;
+C -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;
+C -1 ; WX 600 ; N twosuperior ; B 143 230 436 616 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 25 0 560 780 ;
+C -1 ; WX 600 ; N ntilde ; B 18 0 592 636 ;
+C -1 ; WX 600 ; N down ; B 137 -15 464 439 ;
+C -1 ; WX 600 ; N center ; B 40 14 560 580 ;
+C -1 ; WX 600 ; N onesuperior ; B 153 230 447 616 ;
+C -1 ; WX 600 ; N ij ; B 6 -146 574 658 ;
+C -1 ; WX 600 ; N edieresis ; B 40 -15 563 625 ;
+C -1 ; WX 600 ; N graybox ; B 76 0 525 599 ;
+C -1 ; WX 600 ; N odieresis ; B 30 -15 570 625 ;
+C -1 ; WX 600 ; N Ograve ; B 22 -18 578 784 ;
+C -1 ; WX 600 ; N threequarters ; B -47 -60 648 661 ;
+C -1 ; WX 600 ; N plusminus ; B 71 24 529 515 ;
+C -1 ; WX 600 ; N prescription ; B 24 -15 599 562 ;
+C -1 ; WX 600 ; N eth ; B 58 -27 543 626 ;
+C -1 ; WX 600 ; N largebullet ; B 248 229 352 333 ;
+C -1 ; WX 600 ; N egrave ; B 40 -15 563 661 ;
+C -1 ; WX 600 ; N ccedilla ; B 40 -206 545 459 ;
+C -1 ; WX 600 ; N notegraphic ; B 77 -15 523 572 ;
+C -1 ; WX 600 ; N Udieresis ; B 4 -18 596 748 ;
+C -1 ; WX 600 ; N Gcaron ; B 22 -18 594 790 ;
+C -1 ; WX 600 ; N arrowdown ; B 144 -15 456 608 ;
+C -1 ; WX 600 ; N format ; B 5 -146 115 601 ;
+C -1 ; WX 600 ; N Otilde ; B 22 -18 578 759 ;
+C -1 ; WX 600 ; N Idieresis ; B 77 0 523 748 ;
+C -1 ; WX 600 ; N adieresis ; B 35 -15 570 625 ;
+C -1 ; WX 600 ; N ecircumflex ; B 40 -15 563 657 ;
+C -1 ; WX 600 ; N Eth ; B 30 0 594 562 ;
+C -1 ; WX 600 ; N onequarter ; B -56 -60 656 661 ;
+C -1 ; WX 600 ; N LL ; B -45 0 645 562 ;
+C -1 ; WX 600 ; N agrave ; B 35 -15 570 661 ;
+C -1 ; WX 600 ; N Zcaron ; B 62 0 539 790 ;
+C -1 ; WX 600 ; N Scedilla ; B 47 -206 553 582 ;
+C -1 ; WX 600 ; N Idot ; B 77 0 523 748 ;
+C -1 ; WX 600 ; N Iacute ; B 77 0 523 784 ;
+C -1 ; WX 600 ; N indent ; B 65 45 535 372 ;
+C -1 ; WX 600 ; N Ugrave ; B 4 -18 596 784 ;
+C -1 ; WX 600 ; N scaron ; B 68 -17 535 667 ;
+C -1 ; WX 600 ; N overscore ; B 0 579 600 629 ;
+C -1 ; WX 600 ; N Aring ; B -9 0 609 801 ;
+C -1 ; WX 600 ; N Ccedilla ; B 22 -206 560 580 ;
+C -1 ; WX 600 ; N Igrave ; B 77 0 523 784 ;
+C -1 ; WX 600 ; N brokenbar ; B 255 -175 345 675 ;
+C -1 ; WX 600 ; N Oacute ; B 22 -18 578 784 ;
+C -1 ; WX 600 ; N otilde ; B 30 -15 570 636 ;
+C -1 ; WX 600 ; N Yacute ; B 12 0 589 784 ;
+C -1 ; WX 600 ; N lira ; B 72 -28 558 611 ;
+C -1 ; WX 600 ; N Icircumflex ; B 77 0 523 780 ;
+C -1 ; WX 600 ; N Atilde ; B -9 0 609 759 ;
+C -1 ; WX 600 ; N Uacute ; B 4 -18 596 784 ;
+C -1 ; WX 600 ; N Ydieresis ; B 12 0 589 748 ;
+C -1 ; WX 600 ; N ydieresis ; B -4 -142 601 625 ;
+C -1 ; WX 600 ; N idieresis ; B 77 0 523 625 ;
+C -1 ; WX 600 ; N Adieresis ; B -9 0 609 748 ;
+C -1 ; WX 600 ; N mu ; B -1 -142 569 439 ;
+C -1 ; WX 600 ; N trademark ; B -9 230 749 562 ;
+C -1 ; WX 600 ; N oacute ; B 30 -15 570 661 ;
+C -1 ; WX 600 ; N acircumflex ; B 35 -15 570 657 ;
+C -1 ; WX 600 ; N Agrave ; B -9 0 609 784 ;
+C -1 ; WX 600 ; N return ; B 19 0 581 562 ;
+C -1 ; WX 600 ; N atilde ; B 35 -15 570 636 ;
+C -1 ; WX 600 ; N square ; B 19 0 581 562 ;
+C -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;
+C -1 ; WX 600 ; N stop ; B 19 0 581 562 ;
+C -1 ; WX 600 ; N udieresis ; B -1 -15 569 625 ;
+C -1 ; WX 600 ; N arrowup ; B 144 3 456 626 ;
+C -1 ; WX 600 ; N igrave ; B 77 0 523 661 ;
+C -1 ; WX 600 ; N Edieresis ; B 25 0 560 748 ;
+C -1 ; WX 600 ; N zcaron ; B 81 0 520 667 ;
+C -1 ; WX 600 ; N arrowboth ; B -24 143 624 455 ;
+C -1 ; WX 600 ; N gcaron ; B 30 -146 580 667 ;
+C -1 ; WX 600 ; N arrowleft ; B -24 143 634 455 ;
+C -1 ; WX 600 ; N aacute ; B 35 -15 570 661 ;
+C -1 ; WX 600 ; N ocircumflex ; B 30 -15 570 657 ;
+C -1 ; WX 600 ; N scedilla ; B 68 -206 535 459 ;
+C -1 ; WX 600 ; N ograve ; B 30 -15 570 661 ;
+C -1 ; WX 600 ; N onehalf ; B -47 -60 648 661 ;
+C -1 ; WX 600 ; N ugrave ; B -1 -15 569 661 ;
+C -1 ; WX 600 ; N Ntilde ; B 8 -12 610 759 ;
+C -1 ; WX 600 ; N iacute ; B 77 0 523 661 ;
+C -1 ; WX 600 ; N arrowright ; B -34 143 624 455 ;
+C -1 ; WX 600 ; N Thorn ; B 48 0 557 562 ;
+C -1 ; WX 600 ; N Egrave ; B 25 0 560 784 ;
+C -1 ; WX 600 ; N thorn ; B -14 -142 570 626 ;
+C -1 ; WX 600 ; N aring ; B 35 -15 570 678 ;
+C -1 ; WX 600 ; N yacute ; B -4 -142 601 661 ;
+C -1 ; WX 600 ; N icircumflex ; B 63 0 523 657 ;
+EndCharMetrics
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 30 123 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex -30 123 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis -20 123 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave -50 123 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring -10 123 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde -30 123 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 30 123 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 0 123 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 0 123 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 0 123 ;
+CC Gcaron 2 ; PCC G 0 0 ; PCC caron 10 123 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 0 123 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 0 123 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 0 123 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 123 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 0 123 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 0 123 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 0 123 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 0 123 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 0 123 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 0 123 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 0 123 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 30 123 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 0 123 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 0 123 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave -30 123 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 30 123 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 0 123 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 0 123 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 0 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex -20 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis -10 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave -30 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 0 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 0 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 0 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 0 0 ;
+CC gcaron 2 ; PCC g 0 0 ; PCC caron -40 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -40 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -40 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 0 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 0 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 0 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 0 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 0 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 0 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 0 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 0 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex -20 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis -20 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave -30 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 30 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 10 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 0 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrbo8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrbo8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..6e2c74225117543fa560feaac96827de161f027f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrbo8a.afm
@@ -0,0 +1,344 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Tue Sep 17 14:13:24 1991
+Comment UniqueID 36389
+Comment VMusage 10055 54684
+FontName Courier-BoldOblique
+FullName Courier Bold Oblique
+FamilyName Courier
+Weight Bold
+ItalicAngle -12
+IsFixedPitch true
+FontBBox -56 -250 868 801
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.004
+Notice Copyright (c) 1989, 1990, 1991, Adobe Systems Incorporated. All rights reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 562
+XHeight 439
+Ascender 626
+Descender -142
+StartCharMetrics 260
+C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 600 ; N exclam ; B 216 -15 495 572 ;
+C 34 ; WX 600 ; N quotedbl ; B 212 277 584 562 ;
+C 35 ; WX 600 ; N numbersign ; B 88 -45 640 651 ;
+C 36 ; WX 600 ; N dollar ; B 87 -126 629 666 ;
+C 37 ; WX 600 ; N percent ; B 102 -15 624 616 ;
+C 38 ; WX 600 ; N ampersand ; B 62 -15 594 543 ;
+C 39 ; WX 600 ; N quoteright ; B 230 277 542 562 ;
+C 40 ; WX 600 ; N parenleft ; B 266 -102 592 616 ;
+C 41 ; WX 600 ; N parenright ; B 117 -102 444 616 ;
+C 42 ; WX 600 ; N asterisk ; B 179 219 597 601 ;
+C 43 ; WX 600 ; N plus ; B 114 39 596 478 ;
+C 44 ; WX 600 ; N comma ; B 99 -111 430 174 ;
+C 45 ; WX 600 ; N hyphen ; B 143 203 567 313 ;
+C 46 ; WX 600 ; N period ; B 207 -15 426 171 ;
+C 47 ; WX 600 ; N slash ; B 91 -77 626 626 ;
+C 48 ; WX 600 ; N zero ; B 136 -15 592 616 ;
+C 49 ; WX 600 ; N one ; B 93 0 561 616 ;
+C 50 ; WX 600 ; N two ; B 61 0 593 616 ;
+C 51 ; WX 600 ; N three ; B 72 -15 571 616 ;
+C 52 ; WX 600 ; N four ; B 82 0 558 616 ;
+C 53 ; WX 600 ; N five ; B 77 -15 621 601 ;
+C 54 ; WX 600 ; N six ; B 136 -15 652 616 ;
+C 55 ; WX 600 ; N seven ; B 147 0 622 601 ;
+C 56 ; WX 600 ; N eight ; B 115 -15 604 616 ;
+C 57 ; WX 600 ; N nine ; B 76 -15 592 616 ;
+C 58 ; WX 600 ; N colon ; B 206 -15 479 425 ;
+C 59 ; WX 600 ; N semicolon ; B 99 -111 480 425 ;
+C 60 ; WX 600 ; N less ; B 121 15 612 501 ;
+C 61 ; WX 600 ; N equal ; B 96 118 614 398 ;
+C 62 ; WX 600 ; N greater ; B 97 15 589 501 ;
+C 63 ; WX 600 ; N question ; B 183 -14 591 580 ;
+C 64 ; WX 600 ; N at ; B 66 -15 641 616 ;
+C 65 ; WX 600 ; N A ; B -9 0 631 562 ;
+C 66 ; WX 600 ; N B ; B 30 0 629 562 ;
+C 67 ; WX 600 ; N C ; B 75 -18 674 580 ;
+C 68 ; WX 600 ; N D ; B 30 0 664 562 ;
+C 69 ; WX 600 ; N E ; B 25 0 669 562 ;
+C 70 ; WX 600 ; N F ; B 39 0 683 562 ;
+C 71 ; WX 600 ; N G ; B 75 -18 674 580 ;
+C 72 ; WX 600 ; N H ; B 20 0 699 562 ;
+C 73 ; WX 600 ; N I ; B 77 0 642 562 ;
+C 74 ; WX 600 ; N J ; B 59 -18 720 562 ;
+C 75 ; WX 600 ; N K ; B 21 0 691 562 ;
+C 76 ; WX 600 ; N L ; B 39 0 635 562 ;
+C 77 ; WX 600 ; N M ; B -2 0 721 562 ;
+C 78 ; WX 600 ; N N ; B 8 -12 729 562 ;
+C 79 ; WX 600 ; N O ; B 74 -18 645 580 ;
+C 80 ; WX 600 ; N P ; B 48 0 642 562 ;
+C 81 ; WX 600 ; N Q ; B 84 -138 636 580 ;
+C 82 ; WX 600 ; N R ; B 24 0 617 562 ;
+C 83 ; WX 600 ; N S ; B 54 -22 672 582 ;
+C 84 ; WX 600 ; N T ; B 86 0 678 562 ;
+C 85 ; WX 600 ; N U ; B 101 -18 715 562 ;
+C 86 ; WX 600 ; N V ; B 84 0 732 562 ;
+C 87 ; WX 600 ; N W ; B 84 0 737 562 ;
+C 88 ; WX 600 ; N X ; B 12 0 689 562 ;
+C 89 ; WX 600 ; N Y ; B 109 0 708 562 ;
+C 90 ; WX 600 ; N Z ; B 62 0 636 562 ;
+C 91 ; WX 600 ; N bracketleft ; B 223 -102 606 616 ;
+C 92 ; WX 600 ; N backslash ; B 223 -77 496 626 ;
+C 93 ; WX 600 ; N bracketright ; B 103 -102 486 616 ;
+C 94 ; WX 600 ; N asciicircum ; B 171 250 555 616 ;
+C 95 ; WX 600 ; N underscore ; B -27 -125 584 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 297 277 487 562 ;
+C 97 ; WX 600 ; N a ; B 62 -15 592 454 ;
+C 98 ; WX 600 ; N b ; B 13 -15 636 626 ;
+C 99 ; WX 600 ; N c ; B 81 -15 631 459 ;
+C 100 ; WX 600 ; N d ; B 61 -15 644 626 ;
+C 101 ; WX 600 ; N e ; B 81 -15 604 454 ;
+C 102 ; WX 600 ; N f ; B 83 0 677 626 ; L i fi ; L l fl ;
+C 103 ; WX 600 ; N g ; B 41 -146 673 454 ;
+C 104 ; WX 600 ; N h ; B 18 0 614 626 ;
+C 105 ; WX 600 ; N i ; B 77 0 545 658 ;
+C 106 ; WX 600 ; N j ; B 37 -146 580 658 ;
+C 107 ; WX 600 ; N k ; B 33 0 642 626 ;
+C 108 ; WX 600 ; N l ; B 77 0 545 626 ;
+C 109 ; WX 600 ; N m ; B -22 0 648 454 ;
+C 110 ; WX 600 ; N n ; B 18 0 614 454 ;
+C 111 ; WX 600 ; N o ; B 71 -15 622 454 ;
+C 112 ; WX 600 ; N p ; B -31 -142 622 454 ;
+C 113 ; WX 600 ; N q ; B 61 -142 684 454 ;
+C 114 ; WX 600 ; N r ; B 47 0 654 454 ;
+C 115 ; WX 600 ; N s ; B 67 -17 607 459 ;
+C 116 ; WX 600 ; N t ; B 118 -15 566 562 ;
+C 117 ; WX 600 ; N u ; B 70 -15 591 439 ;
+C 118 ; WX 600 ; N v ; B 70 0 694 439 ;
+C 119 ; WX 600 ; N w ; B 53 0 711 439 ;
+C 120 ; WX 600 ; N x ; B 6 0 670 439 ;
+C 121 ; WX 600 ; N y ; B -20 -142 694 439 ;
+C 122 ; WX 600 ; N z ; B 81 0 613 439 ;
+C 123 ; WX 600 ; N braceleft ; B 204 -102 595 616 ;
+C 124 ; WX 600 ; N bar ; B 202 -250 504 750 ;
+C 125 ; WX 600 ; N braceright ; B 114 -102 506 616 ;
+C 126 ; WX 600 ; N asciitilde ; B 120 153 589 356 ;
+C 161 ; WX 600 ; N exclamdown ; B 197 -146 477 449 ;
+C 162 ; WX 600 ; N cent ; B 121 -49 604 614 ;
+C 163 ; WX 600 ; N sterling ; B 107 -28 650 611 ;
+C 164 ; WX 600 ; N fraction ; B 22 -60 707 661 ;
+C 165 ; WX 600 ; N yen ; B 98 0 709 562 ;
+C 166 ; WX 600 ; N florin ; B -56 -131 701 616 ;
+C 167 ; WX 600 ; N section ; B 74 -70 619 580 ;
+C 168 ; WX 600 ; N currency ; B 77 49 643 517 ;
+C 169 ; WX 600 ; N quotesingle ; B 304 277 492 562 ;
+C 170 ; WX 600 ; N quotedblleft ; B 190 277 594 562 ;
+C 171 ; WX 600 ; N guillemotleft ; B 63 70 638 446 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 196 70 544 446 ;
+C 173 ; WX 600 ; N guilsinglright ; B 166 70 514 446 ;
+C 174 ; WX 600 ; N fi ; B 12 0 643 626 ;
+C 175 ; WX 600 ; N fl ; B 12 0 643 626 ;
+C 177 ; WX 600 ; N endash ; B 108 203 602 313 ;
+C 178 ; WX 600 ; N dagger ; B 176 -70 586 580 ;
+C 179 ; WX 600 ; N daggerdbl ; B 122 -70 586 580 ;
+C 180 ; WX 600 ; N periodcentered ; B 249 165 461 351 ;
+C 182 ; WX 600 ; N paragraph ; B 61 -70 699 580 ;
+C 183 ; WX 600 ; N bullet ; B 197 132 523 430 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 145 -142 457 143 ;
+C 185 ; WX 600 ; N quotedblbase ; B 35 -142 559 143 ;
+C 186 ; WX 600 ; N quotedblright ; B 120 277 644 562 ;
+C 187 ; WX 600 ; N guillemotright ; B 72 70 647 446 ;
+C 188 ; WX 600 ; N ellipsis ; B 35 -15 586 116 ;
+C 189 ; WX 600 ; N perthousand ; B -44 -15 742 616 ;
+C 191 ; WX 600 ; N questiondown ; B 101 -146 509 449 ;
+C 193 ; WX 600 ; N grave ; B 272 508 503 661 ;
+C 194 ; WX 600 ; N acute ; B 313 508 608 661 ;
+C 195 ; WX 600 ; N circumflex ; B 212 483 606 657 ;
+C 196 ; WX 600 ; N tilde ; B 200 493 642 636 ;
+C 197 ; WX 600 ; N macron ; B 195 505 636 585 ;
+C 198 ; WX 600 ; N breve ; B 217 468 651 631 ;
+C 199 ; WX 600 ; N dotaccent ; B 346 485 490 625 ;
+C 200 ; WX 600 ; N dieresis ; B 244 485 592 625 ;
+C 202 ; WX 600 ; N ring ; B 319 481 528 678 ;
+C 203 ; WX 600 ; N cedilla ; B 169 -206 367 0 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 172 488 728 661 ;
+C 206 ; WX 600 ; N ogonek ; B 144 -199 350 0 ;
+C 207 ; WX 600 ; N caron ; B 238 493 632 667 ;
+C 208 ; WX 600 ; N emdash ; B 33 203 677 313 ;
+C 225 ; WX 600 ; N AE ; B -29 0 707 562 ;
+C 227 ; WX 600 ; N ordfeminine ; B 189 196 526 580 ;
+C 232 ; WX 600 ; N Lslash ; B 39 0 635 562 ;
+C 233 ; WX 600 ; N Oslash ; B 48 -22 672 584 ;
+C 234 ; WX 600 ; N OE ; B 26 0 700 562 ;
+C 235 ; WX 600 ; N ordmasculine ; B 189 196 542 580 ;
+C 241 ; WX 600 ; N ae ; B 21 -15 651 454 ;
+C 245 ; WX 600 ; N dotlessi ; B 77 0 545 439 ;
+C 248 ; WX 600 ; N lslash ; B 77 0 578 626 ;
+C 249 ; WX 600 ; N oslash ; B 55 -24 637 463 ;
+C 250 ; WX 600 ; N oe ; B 19 -15 661 454 ;
+C 251 ; WX 600 ; N germandbls ; B 22 -15 628 626 ;
+C -1 ; WX 600 ; N Odieresis ; B 74 -18 645 748 ;
+C -1 ; WX 600 ; N logicalnot ; B 135 103 617 413 ;
+C -1 ; WX 600 ; N minus ; B 114 203 596 313 ;
+C -1 ; WX 600 ; N merge ; B 168 -15 533 487 ;
+C -1 ; WX 600 ; N degree ; B 173 243 569 616 ;
+C -1 ; WX 600 ; N dectab ; B 8 0 615 320 ;
+C -1 ; WX 600 ; N ll ; B 1 0 653 626 ;
+C -1 ; WX 600 ; N IJ ; B -8 -18 741 562 ;
+C -1 ; WX 600 ; N Eacute ; B 25 0 669 784 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 74 -18 645 780 ;
+C -1 ; WX 600 ; N ucircumflex ; B 70 -15 591 657 ;
+C -1 ; WX 600 ; N left ; B 109 44 589 371 ;
+C -1 ; WX 600 ; N threesuperior ; B 193 222 525 616 ;
+C -1 ; WX 600 ; N up ; B 196 0 523 447 ;
+C -1 ; WX 600 ; N multiply ; B 105 39 606 478 ;
+C -1 ; WX 600 ; N Scaron ; B 54 -22 672 790 ;
+C -1 ; WX 600 ; N tab ; B 19 0 641 562 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 101 -18 715 780 ;
+C -1 ; WX 600 ; N divide ; B 114 16 596 500 ;
+C -1 ; WX 600 ; N Acircumflex ; B -9 0 631 780 ;
+C -1 ; WX 600 ; N eacute ; B 81 -15 608 661 ;
+C -1 ; WX 600 ; N uacute ; B 70 -15 608 661 ;
+C -1 ; WX 600 ; N Aacute ; B -9 0 665 784 ;
+C -1 ; WX 600 ; N copyright ; B 53 -18 667 580 ;
+C -1 ; WX 600 ; N twosuperior ; B 192 230 541 616 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 25 0 669 780 ;
+C -1 ; WX 600 ; N ntilde ; B 18 0 642 636 ;
+C -1 ; WX 600 ; N down ; B 168 -15 496 439 ;
+C -1 ; WX 600 ; N center ; B 103 14 623 580 ;
+C -1 ; WX 600 ; N onesuperior ; B 213 230 514 616 ;
+C -1 ; WX 600 ; N ij ; B 6 -146 714 658 ;
+C -1 ; WX 600 ; N edieresis ; B 81 -15 604 625 ;
+C -1 ; WX 600 ; N graybox ; B 76 0 652 599 ;
+C -1 ; WX 600 ; N odieresis ; B 71 -15 622 625 ;
+C -1 ; WX 600 ; N Ograve ; B 74 -18 645 784 ;
+C -1 ; WX 600 ; N threequarters ; B 8 -60 698 661 ;
+C -1 ; WX 600 ; N plusminus ; B 76 24 614 515 ;
+C -1 ; WX 600 ; N prescription ; B 24 -15 632 562 ;
+C -1 ; WX 600 ; N eth ; B 93 -27 661 626 ;
+C -1 ; WX 600 ; N largebullet ; B 307 229 413 333 ;
+C -1 ; WX 600 ; N egrave ; B 81 -15 604 661 ;
+C -1 ; WX 600 ; N ccedilla ; B 81 -206 631 459 ;
+C -1 ; WX 600 ; N notegraphic ; B 91 -15 619 572 ;
+C -1 ; WX 600 ; N Udieresis ; B 101 -18 715 748 ;
+C -1 ; WX 600 ; N Gcaron ; B 75 -18 674 790 ;
+C -1 ; WX 600 ; N arrowdown ; B 174 -15 486 608 ;
+C -1 ; WX 600 ; N format ; B -26 -146 243 601 ;
+C -1 ; WX 600 ; N Otilde ; B 74 -18 668 759 ;
+C -1 ; WX 600 ; N Idieresis ; B 77 0 642 748 ;
+C -1 ; WX 600 ; N adieresis ; B 62 -15 592 625 ;
+C -1 ; WX 600 ; N ecircumflex ; B 81 -15 606 657 ;
+C -1 ; WX 600 ; N Eth ; B 30 0 664 562 ;
+C -1 ; WX 600 ; N onequarter ; B 14 -60 706 661 ;
+C -1 ; WX 600 ; N LL ; B -45 0 694 562 ;
+C -1 ; WX 600 ; N agrave ; B 62 -15 592 661 ;
+C -1 ; WX 600 ; N Zcaron ; B 62 0 659 790 ;
+C -1 ; WX 600 ; N Scedilla ; B 54 -206 672 582 ;
+C -1 ; WX 600 ; N Idot ; B 77 0 642 748 ;
+C -1 ; WX 600 ; N Iacute ; B 77 0 642 784 ;
+C -1 ; WX 600 ; N indent ; B 99 45 579 372 ;
+C -1 ; WX 600 ; N Ugrave ; B 101 -18 715 784 ;
+C -1 ; WX 600 ; N scaron ; B 67 -17 632 667 ;
+C -1 ; WX 600 ; N overscore ; B 123 579 734 629 ;
+C -1 ; WX 600 ; N Aring ; B -9 0 631 801 ;
+C -1 ; WX 600 ; N Ccedilla ; B 74 -206 674 580 ;
+C -1 ; WX 600 ; N Igrave ; B 77 0 642 784 ;
+C -1 ; WX 600 ; N brokenbar ; B 218 -175 488 675 ;
+C -1 ; WX 600 ; N Oacute ; B 74 -18 645 784 ;
+C -1 ; WX 600 ; N otilde ; B 71 -15 642 636 ;
+C -1 ; WX 600 ; N Yacute ; B 109 0 708 784 ;
+C -1 ; WX 600 ; N lira ; B 107 -28 650 611 ;
+C -1 ; WX 600 ; N Icircumflex ; B 77 0 642 780 ;
+C -1 ; WX 600 ; N Atilde ; B -9 0 638 759 ;
+C -1 ; WX 600 ; N Uacute ; B 101 -18 715 784 ;
+C -1 ; WX 600 ; N Ydieresis ; B 109 0 708 748 ;
+C -1 ; WX 600 ; N ydieresis ; B -20 -142 694 625 ;
+C -1 ; WX 600 ; N idieresis ; B 77 0 552 625 ;
+C -1 ; WX 600 ; N Adieresis ; B -9 0 631 748 ;
+C -1 ; WX 600 ; N mu ; B 50 -142 591 439 ;
+C -1 ; WX 600 ; N trademark ; B 86 230 868 562 ;
+C -1 ; WX 600 ; N oacute ; B 71 -15 622 661 ;
+C -1 ; WX 600 ; N acircumflex ; B 62 -15 592 657 ;
+C -1 ; WX 600 ; N Agrave ; B -9 0 631 784 ;
+C -1 ; WX 600 ; N return ; B 79 0 700 562 ;
+C -1 ; WX 600 ; N atilde ; B 62 -15 642 636 ;
+C -1 ; WX 600 ; N square ; B 19 0 700 562 ;
+C -1 ; WX 600 ; N registered ; B 53 -18 667 580 ;
+C -1 ; WX 600 ; N stop ; B 19 0 700 562 ;
+C -1 ; WX 600 ; N udieresis ; B 70 -15 591 625 ;
+C -1 ; WX 600 ; N arrowup ; B 244 3 556 626 ;
+C -1 ; WX 600 ; N igrave ; B 77 0 545 661 ;
+C -1 ; WX 600 ; N Edieresis ; B 25 0 669 748 ;
+C -1 ; WX 600 ; N zcaron ; B 81 0 632 667 ;
+C -1 ; WX 600 ; N arrowboth ; B 40 143 688 455 ;
+C -1 ; WX 600 ; N gcaron ; B 41 -146 673 667 ;
+C -1 ; WX 600 ; N arrowleft ; B 40 143 708 455 ;
+C -1 ; WX 600 ; N aacute ; B 62 -15 608 661 ;
+C -1 ; WX 600 ; N ocircumflex ; B 71 -15 622 657 ;
+C -1 ; WX 600 ; N scedilla ; B 67 -206 607 459 ;
+C -1 ; WX 600 ; N ograve ; B 71 -15 622 661 ;
+C -1 ; WX 600 ; N onehalf ; B 23 -60 715 661 ;
+C -1 ; WX 600 ; N ugrave ; B 70 -15 591 661 ;
+C -1 ; WX 600 ; N Ntilde ; B 8 -12 729 759 ;
+C -1 ; WX 600 ; N iacute ; B 77 0 608 661 ;
+C -1 ; WX 600 ; N arrowright ; B 20 143 688 455 ;
+C -1 ; WX 600 ; N Thorn ; B 48 0 619 562 ;
+C -1 ; WX 600 ; N Egrave ; B 25 0 669 784 ;
+C -1 ; WX 600 ; N thorn ; B -31 -142 622 626 ;
+C -1 ; WX 600 ; N aring ; B 62 -15 592 678 ;
+C -1 ; WX 600 ; N yacute ; B -20 -142 694 661 ;
+C -1 ; WX 600 ; N icircumflex ; B 77 0 566 657 ;
+EndCharMetrics
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 56 123 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex -4 123 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 6 123 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave -24 123 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 16 123 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde -4 123 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 56 123 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 26 123 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 26 123 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 26 123 ;
+CC Gcaron 2 ; PCC G 0 0 ; PCC caron 36 123 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 26 123 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 26 123 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 26 123 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 26 123 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 26 123 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 26 123 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 26 123 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 26 123 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 26 123 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 26 123 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 26 123 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 56 123 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 26 123 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 26 123 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave -4 123 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 56 123 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 26 123 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 26 123 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 0 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex -20 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis -10 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave -30 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 0 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 0 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 0 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 0 0 ;
+CC gcaron 2 ; PCC g 0 0 ; PCC caron -40 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -40 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -40 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 0 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 0 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 0 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 0 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 0 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 0 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 0 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 0 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex -20 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis -20 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave -30 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 30 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 10 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 0 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrr8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrr8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..f60ec9433e3df13b2053db49dc70cb3ba20efdf2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrr8a.afm
@@ -0,0 +1,344 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Tue Sep 17 07:47:21 1991
+Comment UniqueID 36347
+Comment VMusage 31037 39405
+FontName Courier
+FullName Courier
+FamilyName Courier
+Weight Medium
+ItalicAngle 0
+IsFixedPitch true
+FontBBox -28 -250 628 805
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.004
+Notice Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated. All rights reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 562
+XHeight 426
+Ascender 629
+Descender -157
+StartCharMetrics 260
+C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 600 ; N exclam ; B 236 -15 364 572 ;
+C 34 ; WX 600 ; N quotedbl ; B 187 328 413 562 ;
+C 35 ; WX 600 ; N numbersign ; B 93 -32 507 639 ;
+C 36 ; WX 600 ; N dollar ; B 105 -126 496 662 ;
+C 37 ; WX 600 ; N percent ; B 81 -15 518 622 ;
+C 38 ; WX 600 ; N ampersand ; B 63 -15 538 543 ;
+C 39 ; WX 600 ; N quoteright ; B 213 328 376 562 ;
+C 40 ; WX 600 ; N parenleft ; B 269 -108 440 622 ;
+C 41 ; WX 600 ; N parenright ; B 160 -108 331 622 ;
+C 42 ; WX 600 ; N asterisk ; B 116 257 484 607 ;
+C 43 ; WX 600 ; N plus ; B 80 44 520 470 ;
+C 44 ; WX 600 ; N comma ; B 181 -112 344 122 ;
+C 45 ; WX 600 ; N hyphen ; B 103 231 497 285 ;
+C 46 ; WX 600 ; N period ; B 229 -15 371 109 ;
+C 47 ; WX 600 ; N slash ; B 125 -80 475 629 ;
+C 48 ; WX 600 ; N zero ; B 106 -15 494 622 ;
+C 49 ; WX 600 ; N one ; B 96 0 505 622 ;
+C 50 ; WX 600 ; N two ; B 70 0 471 622 ;
+C 51 ; WX 600 ; N three ; B 75 -15 466 622 ;
+C 52 ; WX 600 ; N four ; B 78 0 500 622 ;
+C 53 ; WX 600 ; N five ; B 92 -15 497 607 ;
+C 54 ; WX 600 ; N six ; B 111 -15 497 622 ;
+C 55 ; WX 600 ; N seven ; B 82 0 483 607 ;
+C 56 ; WX 600 ; N eight ; B 102 -15 498 622 ;
+C 57 ; WX 600 ; N nine ; B 96 -15 489 622 ;
+C 58 ; WX 600 ; N colon ; B 229 -15 371 385 ;
+C 59 ; WX 600 ; N semicolon ; B 181 -112 371 385 ;
+C 60 ; WX 600 ; N less ; B 41 42 519 472 ;
+C 61 ; WX 600 ; N equal ; B 80 138 520 376 ;
+C 62 ; WX 600 ; N greater ; B 66 42 544 472 ;
+C 63 ; WX 600 ; N question ; B 129 -15 492 572 ;
+C 64 ; WX 600 ; N at ; B 77 -15 533 622 ;
+C 65 ; WX 600 ; N A ; B 3 0 597 562 ;
+C 66 ; WX 600 ; N B ; B 43 0 559 562 ;
+C 67 ; WX 600 ; N C ; B 41 -18 540 580 ;
+C 68 ; WX 600 ; N D ; B 43 0 574 562 ;
+C 69 ; WX 600 ; N E ; B 53 0 550 562 ;
+C 70 ; WX 600 ; N F ; B 53 0 545 562 ;
+C 71 ; WX 600 ; N G ; B 31 -18 575 580 ;
+C 72 ; WX 600 ; N H ; B 32 0 568 562 ;
+C 73 ; WX 600 ; N I ; B 96 0 504 562 ;
+C 74 ; WX 600 ; N J ; B 34 -18 566 562 ;
+C 75 ; WX 600 ; N K ; B 38 0 582 562 ;
+C 76 ; WX 600 ; N L ; B 47 0 554 562 ;
+C 77 ; WX 600 ; N M ; B 4 0 596 562 ;
+C 78 ; WX 600 ; N N ; B 7 -13 593 562 ;
+C 79 ; WX 600 ; N O ; B 43 -18 557 580 ;
+C 80 ; WX 600 ; N P ; B 79 0 558 562 ;
+C 81 ; WX 600 ; N Q ; B 43 -138 557 580 ;
+C 82 ; WX 600 ; N R ; B 38 0 588 562 ;
+C 83 ; WX 600 ; N S ; B 72 -20 529 580 ;
+C 84 ; WX 600 ; N T ; B 38 0 563 562 ;
+C 85 ; WX 600 ; N U ; B 17 -18 583 562 ;
+C 86 ; WX 600 ; N V ; B -4 -13 604 562 ;
+C 87 ; WX 600 ; N W ; B -3 -13 603 562 ;
+C 88 ; WX 600 ; N X ; B 23 0 577 562 ;
+C 89 ; WX 600 ; N Y ; B 24 0 576 562 ;
+C 90 ; WX 600 ; N Z ; B 86 0 514 562 ;
+C 91 ; WX 600 ; N bracketleft ; B 269 -108 442 622 ;
+C 92 ; WX 600 ; N backslash ; B 118 -80 482 629 ;
+C 93 ; WX 600 ; N bracketright ; B 158 -108 331 622 ;
+C 94 ; WX 600 ; N asciicircum ; B 94 354 506 622 ;
+C 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 224 328 387 562 ;
+C 97 ; WX 600 ; N a ; B 53 -15 559 441 ;
+C 98 ; WX 600 ; N b ; B 14 -15 575 629 ;
+C 99 ; WX 600 ; N c ; B 66 -15 529 441 ;
+C 100 ; WX 600 ; N d ; B 45 -15 591 629 ;
+C 101 ; WX 600 ; N e ; B 66 -15 548 441 ;
+C 102 ; WX 600 ; N f ; B 114 0 531 629 ; L i fi ; L l fl ;
+C 103 ; WX 600 ; N g ; B 45 -157 566 441 ;
+C 104 ; WX 600 ; N h ; B 18 0 582 629 ;
+C 105 ; WX 600 ; N i ; B 95 0 505 657 ;
+C 106 ; WX 600 ; N j ; B 82 -157 410 657 ;
+C 107 ; WX 600 ; N k ; B 43 0 580 629 ;
+C 108 ; WX 600 ; N l ; B 95 0 505 629 ;
+C 109 ; WX 600 ; N m ; B -5 0 605 441 ;
+C 110 ; WX 600 ; N n ; B 26 0 575 441 ;
+C 111 ; WX 600 ; N o ; B 62 -15 538 441 ;
+C 112 ; WX 600 ; N p ; B 9 -157 555 441 ;
+C 113 ; WX 600 ; N q ; B 45 -157 591 441 ;
+C 114 ; WX 600 ; N r ; B 60 0 559 441 ;
+C 115 ; WX 600 ; N s ; B 80 -15 513 441 ;
+C 116 ; WX 600 ; N t ; B 87 -15 530 561 ;
+C 117 ; WX 600 ; N u ; B 21 -15 562 426 ;
+C 118 ; WX 600 ; N v ; B 10 -10 590 426 ;
+C 119 ; WX 600 ; N w ; B -4 -10 604 426 ;
+C 120 ; WX 600 ; N x ; B 20 0 580 426 ;
+C 121 ; WX 600 ; N y ; B 7 -157 592 426 ;
+C 122 ; WX 600 ; N z ; B 99 0 502 426 ;
+C 123 ; WX 600 ; N braceleft ; B 182 -108 437 622 ;
+C 124 ; WX 600 ; N bar ; B 275 -250 326 750 ;
+C 125 ; WX 600 ; N braceright ; B 163 -108 418 622 ;
+C 126 ; WX 600 ; N asciitilde ; B 63 197 540 320 ;
+C 161 ; WX 600 ; N exclamdown ; B 236 -157 364 430 ;
+C 162 ; WX 600 ; N cent ; B 96 -49 500 614 ;
+C 163 ; WX 600 ; N sterling ; B 84 -21 521 611 ;
+C 164 ; WX 600 ; N fraction ; B 92 -57 509 665 ;
+C 165 ; WX 600 ; N yen ; B 26 0 574 562 ;
+C 166 ; WX 600 ; N florin ; B 4 -143 539 622 ;
+C 167 ; WX 600 ; N section ; B 113 -78 488 580 ;
+C 168 ; WX 600 ; N currency ; B 73 58 527 506 ;
+C 169 ; WX 600 ; N quotesingle ; B 259 328 341 562 ;
+C 170 ; WX 600 ; N quotedblleft ; B 143 328 471 562 ;
+C 171 ; WX 600 ; N guillemotleft ; B 37 70 563 446 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 149 70 451 446 ;
+C 173 ; WX 600 ; N guilsinglright ; B 149 70 451 446 ;
+C 174 ; WX 600 ; N fi ; B 3 0 597 629 ;
+C 175 ; WX 600 ; N fl ; B 3 0 597 629 ;
+C 177 ; WX 600 ; N endash ; B 75 231 525 285 ;
+C 178 ; WX 600 ; N dagger ; B 141 -78 459 580 ;
+C 179 ; WX 600 ; N daggerdbl ; B 141 -78 459 580 ;
+C 180 ; WX 600 ; N periodcentered ; B 222 189 378 327 ;
+C 182 ; WX 600 ; N paragraph ; B 50 -78 511 562 ;
+C 183 ; WX 600 ; N bullet ; B 172 130 428 383 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 213 -134 376 100 ;
+C 185 ; WX 600 ; N quotedblbase ; B 143 -134 457 100 ;
+C 186 ; WX 600 ; N quotedblright ; B 143 328 457 562 ;
+C 187 ; WX 600 ; N guillemotright ; B 37 70 563 446 ;
+C 188 ; WX 600 ; N ellipsis ; B 37 -15 563 111 ;
+C 189 ; WX 600 ; N perthousand ; B 3 -15 600 622 ;
+C 191 ; WX 600 ; N questiondown ; B 108 -157 471 430 ;
+C 193 ; WX 600 ; N grave ; B 151 497 378 672 ;
+C 194 ; WX 600 ; N acute ; B 242 497 469 672 ;
+C 195 ; WX 600 ; N circumflex ; B 124 477 476 654 ;
+C 196 ; WX 600 ; N tilde ; B 105 489 503 606 ;
+C 197 ; WX 600 ; N macron ; B 120 525 480 565 ;
+C 198 ; WX 600 ; N breve ; B 153 501 447 609 ;
+C 199 ; WX 600 ; N dotaccent ; B 249 477 352 580 ;
+C 200 ; WX 600 ; N dieresis ; B 148 492 453 595 ;
+C 202 ; WX 600 ; N ring ; B 218 463 382 627 ;
+C 203 ; WX 600 ; N cedilla ; B 224 -151 362 10 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 133 497 540 672 ;
+C 206 ; WX 600 ; N ogonek ; B 227 -151 370 0 ;
+C 207 ; WX 600 ; N caron ; B 124 492 476 669 ;
+C 208 ; WX 600 ; N emdash ; B 0 231 600 285 ;
+C 225 ; WX 600 ; N AE ; B 3 0 550 562 ;
+C 227 ; WX 600 ; N ordfeminine ; B 156 249 442 580 ;
+C 232 ; WX 600 ; N Lslash ; B 47 0 554 562 ;
+C 233 ; WX 600 ; N Oslash ; B 43 -80 557 629 ;
+C 234 ; WX 600 ; N OE ; B 7 0 567 562 ;
+C 235 ; WX 600 ; N ordmasculine ; B 157 249 443 580 ;
+C 241 ; WX 600 ; N ae ; B 19 -15 570 441 ;
+C 245 ; WX 600 ; N dotlessi ; B 95 0 505 426 ;
+C 248 ; WX 600 ; N lslash ; B 95 0 505 629 ;
+C 249 ; WX 600 ; N oslash ; B 62 -80 538 506 ;
+C 250 ; WX 600 ; N oe ; B 19 -15 559 441 ;
+C 251 ; WX 600 ; N germandbls ; B 48 -15 588 629 ;
+C -1 ; WX 600 ; N Odieresis ; B 43 -18 557 731 ;
+C -1 ; WX 600 ; N logicalnot ; B 87 108 513 369 ;
+C -1 ; WX 600 ; N minus ; B 80 232 520 283 ;
+C -1 ; WX 600 ; N merge ; B 160 -15 440 436 ;
+C -1 ; WX 600 ; N degree ; B 123 269 477 622 ;
+C -1 ; WX 600 ; N dectab ; B 18 0 582 227 ;
+C -1 ; WX 600 ; N ll ; B 18 0 567 629 ;
+C -1 ; WX 600 ; N IJ ; B 32 -18 583 562 ;
+C -1 ; WX 600 ; N Eacute ; B 53 0 550 793 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 43 -18 557 775 ;
+C -1 ; WX 600 ; N ucircumflex ; B 21 -15 562 654 ;
+C -1 ; WX 600 ; N left ; B 70 68 530 348 ;
+C -1 ; WX 600 ; N threesuperior ; B 155 240 406 622 ;
+C -1 ; WX 600 ; N up ; B 160 0 440 437 ;
+C -1 ; WX 600 ; N multiply ; B 87 43 515 470 ;
+C -1 ; WX 600 ; N Scaron ; B 72 -20 529 805 ;
+C -1 ; WX 600 ; N tab ; B 19 0 581 562 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 17 -18 583 775 ;
+C -1 ; WX 600 ; N divide ; B 87 48 513 467 ;
+C -1 ; WX 600 ; N Acircumflex ; B 3 0 597 775 ;
+C -1 ; WX 600 ; N eacute ; B 66 -15 548 672 ;
+C -1 ; WX 600 ; N uacute ; B 21 -15 562 672 ;
+C -1 ; WX 600 ; N Aacute ; B 3 0 597 793 ;
+C -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;
+C -1 ; WX 600 ; N twosuperior ; B 177 249 424 622 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 53 0 550 775 ;
+C -1 ; WX 600 ; N ntilde ; B 26 0 575 606 ;
+C -1 ; WX 600 ; N down ; B 160 -15 440 426 ;
+C -1 ; WX 600 ; N center ; B 40 14 560 580 ;
+C -1 ; WX 600 ; N onesuperior ; B 172 249 428 622 ;
+C -1 ; WX 600 ; N ij ; B 37 -157 490 657 ;
+C -1 ; WX 600 ; N edieresis ; B 66 -15 548 595 ;
+C -1 ; WX 600 ; N graybox ; B 76 0 525 599 ;
+C -1 ; WX 600 ; N odieresis ; B 62 -15 538 595 ;
+C -1 ; WX 600 ; N Ograve ; B 43 -18 557 793 ;
+C -1 ; WX 600 ; N threequarters ; B 8 -56 593 666 ;
+C -1 ; WX 600 ; N plusminus ; B 87 44 513 558 ;
+C -1 ; WX 600 ; N prescription ; B 27 -15 577 562 ;
+C -1 ; WX 600 ; N eth ; B 62 -15 538 629 ;
+C -1 ; WX 600 ; N largebullet ; B 261 220 339 297 ;
+C -1 ; WX 600 ; N egrave ; B 66 -15 548 672 ;
+C -1 ; WX 600 ; N ccedilla ; B 66 -151 529 441 ;
+C -1 ; WX 600 ; N notegraphic ; B 136 -15 464 572 ;
+C -1 ; WX 600 ; N Udieresis ; B 17 -18 583 731 ;
+C -1 ; WX 600 ; N Gcaron ; B 31 -18 575 805 ;
+C -1 ; WX 600 ; N arrowdown ; B 116 -15 484 608 ;
+C -1 ; WX 600 ; N format ; B 5 -157 56 607 ;
+C -1 ; WX 600 ; N Otilde ; B 43 -18 557 732 ;
+C -1 ; WX 600 ; N Idieresis ; B 96 0 504 731 ;
+C -1 ; WX 600 ; N adieresis ; B 53 -15 559 595 ;
+C -1 ; WX 600 ; N ecircumflex ; B 66 -15 548 654 ;
+C -1 ; WX 600 ; N Eth ; B 30 0 574 562 ;
+C -1 ; WX 600 ; N onequarter ; B 0 -57 600 665 ;
+C -1 ; WX 600 ; N LL ; B 8 0 592 562 ;
+C -1 ; WX 600 ; N agrave ; B 53 -15 559 672 ;
+C -1 ; WX 600 ; N Zcaron ; B 86 0 514 805 ;
+C -1 ; WX 600 ; N Scedilla ; B 72 -151 529 580 ;
+C -1 ; WX 600 ; N Idot ; B 96 0 504 716 ;
+C -1 ; WX 600 ; N Iacute ; B 96 0 504 793 ;
+C -1 ; WX 600 ; N indent ; B 70 68 530 348 ;
+C -1 ; WX 600 ; N Ugrave ; B 17 -18 583 793 ;
+C -1 ; WX 600 ; N scaron ; B 80 -15 513 669 ;
+C -1 ; WX 600 ; N overscore ; B 0 579 600 629 ;
+C -1 ; WX 600 ; N Aring ; B 3 0 597 753 ;
+C -1 ; WX 600 ; N Ccedilla ; B 41 -151 540 580 ;
+C -1 ; WX 600 ; N Igrave ; B 96 0 504 793 ;
+C -1 ; WX 600 ; N brokenbar ; B 275 -175 326 675 ;
+C -1 ; WX 600 ; N Oacute ; B 43 -18 557 793 ;
+C -1 ; WX 600 ; N otilde ; B 62 -15 538 606 ;
+C -1 ; WX 600 ; N Yacute ; B 24 0 576 793 ;
+C -1 ; WX 600 ; N lira ; B 73 -21 521 611 ;
+C -1 ; WX 600 ; N Icircumflex ; B 96 0 504 775 ;
+C -1 ; WX 600 ; N Atilde ; B 3 0 597 732 ;
+C -1 ; WX 600 ; N Uacute ; B 17 -18 583 793 ;
+C -1 ; WX 600 ; N Ydieresis ; B 24 0 576 731 ;
+C -1 ; WX 600 ; N ydieresis ; B 7 -157 592 595 ;
+C -1 ; WX 600 ; N idieresis ; B 95 0 505 595 ;
+C -1 ; WX 600 ; N Adieresis ; B 3 0 597 731 ;
+C -1 ; WX 600 ; N mu ; B 21 -157 562 426 ;
+C -1 ; WX 600 ; N trademark ; B -23 263 623 562 ;
+C -1 ; WX 600 ; N oacute ; B 62 -15 538 672 ;
+C -1 ; WX 600 ; N acircumflex ; B 53 -15 559 654 ;
+C -1 ; WX 600 ; N Agrave ; B 3 0 597 793 ;
+C -1 ; WX 600 ; N return ; B 19 0 581 562 ;
+C -1 ; WX 600 ; N atilde ; B 53 -15 559 606 ;
+C -1 ; WX 600 ; N square ; B 19 0 581 562 ;
+C -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;
+C -1 ; WX 600 ; N stop ; B 19 0 581 562 ;
+C -1 ; WX 600 ; N udieresis ; B 21 -15 562 595 ;
+C -1 ; WX 600 ; N arrowup ; B 116 0 484 623 ;
+C -1 ; WX 600 ; N igrave ; B 95 0 505 672 ;
+C -1 ; WX 600 ; N Edieresis ; B 53 0 550 731 ;
+C -1 ; WX 600 ; N zcaron ; B 99 0 502 669 ;
+C -1 ; WX 600 ; N arrowboth ; B -28 115 628 483 ;
+C -1 ; WX 600 ; N gcaron ; B 45 -157 566 669 ;
+C -1 ; WX 600 ; N arrowleft ; B -24 115 624 483 ;
+C -1 ; WX 600 ; N aacute ; B 53 -15 559 672 ;
+C -1 ; WX 600 ; N ocircumflex ; B 62 -15 538 654 ;
+C -1 ; WX 600 ; N scedilla ; B 80 -151 513 441 ;
+C -1 ; WX 600 ; N ograve ; B 62 -15 538 672 ;
+C -1 ; WX 600 ; N onehalf ; B 0 -57 611 665 ;
+C -1 ; WX 600 ; N ugrave ; B 21 -15 562 672 ;
+C -1 ; WX 600 ; N Ntilde ; B 7 -13 593 732 ;
+C -1 ; WX 600 ; N iacute ; B 95 0 505 672 ;
+C -1 ; WX 600 ; N arrowright ; B -24 115 624 483 ;
+C -1 ; WX 600 ; N Thorn ; B 79 0 538 562 ;
+C -1 ; WX 600 ; N Egrave ; B 53 0 550 793 ;
+C -1 ; WX 600 ; N thorn ; B -6 -157 555 629 ;
+C -1 ; WX 600 ; N aring ; B 53 -15 559 627 ;
+C -1 ; WX 600 ; N yacute ; B 7 -157 592 672 ;
+C -1 ; WX 600 ; N icircumflex ; B 94 0 505 654 ;
+EndCharMetrics
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 20 121 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex -30 121 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis -30 136 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave -30 121 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring -15 126 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 0 126 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 30 121 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 0 121 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 0 136 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 0 121 ;
+CC Gcaron 2 ; PCC G 0 0 ; PCC caron 0 136 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 0 121 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 0 121 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 0 136 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 121 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 0 126 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 0 121 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 0 121 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 0 136 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 0 121 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 0 126 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 30 136 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 30 121 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 0 121 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 0 136 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave -30 121 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 30 121 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 0 136 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 0 136 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 0 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 0 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 0 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 0 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 0 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 0 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 0 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 0 0 ;
+CC gcaron 2 ; PCC g 0 0 ; PCC caron -30 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -30 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -30 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -30 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 0 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 0 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 0 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 0 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 0 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 0 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 0 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute -10 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex -10 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 0 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave -30 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute -20 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis -10 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 10 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrro8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrro8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b053a4ca2d68b6a96f7363418509622bc3cfc8dc
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pcrro8a.afm
@@ -0,0 +1,344 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Tue Sep 17 09:42:19 1991
+Comment UniqueID 36350
+Comment VMusage 9174 52297
+FontName Courier-Oblique
+FullName Courier Oblique
+FamilyName Courier
+Weight Medium
+ItalicAngle -12
+IsFixedPitch true
+FontBBox -28 -250 742 805
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.004
+Notice Copyright (c) 1989, 1990, 1991 Adobe Systems Incorporated. All rights reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 562
+XHeight 426
+Ascender 629
+Descender -157
+StartCharMetrics 260
+C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 600 ; N exclam ; B 243 -15 464 572 ;
+C 34 ; WX 600 ; N quotedbl ; B 273 328 532 562 ;
+C 35 ; WX 600 ; N numbersign ; B 133 -32 596 639 ;
+C 36 ; WX 600 ; N dollar ; B 108 -126 596 662 ;
+C 37 ; WX 600 ; N percent ; B 134 -15 599 622 ;
+C 38 ; WX 600 ; N ampersand ; B 87 -15 580 543 ;
+C 39 ; WX 600 ; N quoteright ; B 283 328 495 562 ;
+C 40 ; WX 600 ; N parenleft ; B 313 -108 572 622 ;
+C 41 ; WX 600 ; N parenright ; B 137 -108 396 622 ;
+C 42 ; WX 600 ; N asterisk ; B 212 257 580 607 ;
+C 43 ; WX 600 ; N plus ; B 129 44 580 470 ;
+C 44 ; WX 600 ; N comma ; B 157 -112 370 122 ;
+C 45 ; WX 600 ; N hyphen ; B 152 231 558 285 ;
+C 46 ; WX 600 ; N period ; B 238 -15 382 109 ;
+C 47 ; WX 600 ; N slash ; B 112 -80 604 629 ;
+C 48 ; WX 600 ; N zero ; B 154 -15 575 622 ;
+C 49 ; WX 600 ; N one ; B 98 0 515 622 ;
+C 50 ; WX 600 ; N two ; B 70 0 568 622 ;
+C 51 ; WX 600 ; N three ; B 82 -15 538 622 ;
+C 52 ; WX 600 ; N four ; B 108 0 541 622 ;
+C 53 ; WX 600 ; N five ; B 99 -15 589 607 ;
+C 54 ; WX 600 ; N six ; B 155 -15 629 622 ;
+C 55 ; WX 600 ; N seven ; B 182 0 612 607 ;
+C 56 ; WX 600 ; N eight ; B 132 -15 588 622 ;
+C 57 ; WX 600 ; N nine ; B 93 -15 574 622 ;
+C 58 ; WX 600 ; N colon ; B 238 -15 441 385 ;
+C 59 ; WX 600 ; N semicolon ; B 157 -112 441 385 ;
+C 60 ; WX 600 ; N less ; B 96 42 610 472 ;
+C 61 ; WX 600 ; N equal ; B 109 138 600 376 ;
+C 62 ; WX 600 ; N greater ; B 85 42 599 472 ;
+C 63 ; WX 600 ; N question ; B 222 -15 583 572 ;
+C 64 ; WX 600 ; N at ; B 127 -15 582 622 ;
+C 65 ; WX 600 ; N A ; B 3 0 607 562 ;
+C 66 ; WX 600 ; N B ; B 43 0 616 562 ;
+C 67 ; WX 600 ; N C ; B 93 -18 655 580 ;
+C 68 ; WX 600 ; N D ; B 43 0 645 562 ;
+C 69 ; WX 600 ; N E ; B 53 0 660 562 ;
+C 70 ; WX 600 ; N F ; B 53 0 660 562 ;
+C 71 ; WX 600 ; N G ; B 83 -18 645 580 ;
+C 72 ; WX 600 ; N H ; B 32 0 687 562 ;
+C 73 ; WX 600 ; N I ; B 96 0 623 562 ;
+C 74 ; WX 600 ; N J ; B 52 -18 685 562 ;
+C 75 ; WX 600 ; N K ; B 38 0 671 562 ;
+C 76 ; WX 600 ; N L ; B 47 0 607 562 ;
+C 77 ; WX 600 ; N M ; B 4 0 715 562 ;
+C 78 ; WX 600 ; N N ; B 7 -13 712 562 ;
+C 79 ; WX 600 ; N O ; B 94 -18 625 580 ;
+C 80 ; WX 600 ; N P ; B 79 0 644 562 ;
+C 81 ; WX 600 ; N Q ; B 95 -138 625 580 ;
+C 82 ; WX 600 ; N R ; B 38 0 598 562 ;
+C 83 ; WX 600 ; N S ; B 76 -20 650 580 ;
+C 84 ; WX 600 ; N T ; B 108 0 665 562 ;
+C 85 ; WX 600 ; N U ; B 125 -18 702 562 ;
+C 86 ; WX 600 ; N V ; B 105 -13 723 562 ;
+C 87 ; WX 600 ; N W ; B 106 -13 722 562 ;
+C 88 ; WX 600 ; N X ; B 23 0 675 562 ;
+C 89 ; WX 600 ; N Y ; B 133 0 695 562 ;
+C 90 ; WX 600 ; N Z ; B 86 0 610 562 ;
+C 91 ; WX 600 ; N bracketleft ; B 246 -108 574 622 ;
+C 92 ; WX 600 ; N backslash ; B 249 -80 468 629 ;
+C 93 ; WX 600 ; N bracketright ; B 135 -108 463 622 ;
+C 94 ; WX 600 ; N asciicircum ; B 175 354 587 622 ;
+C 95 ; WX 600 ; N underscore ; B -27 -125 584 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 343 328 457 562 ;
+C 97 ; WX 600 ; N a ; B 76 -15 569 441 ;
+C 98 ; WX 600 ; N b ; B 29 -15 625 629 ;
+C 99 ; WX 600 ; N c ; B 106 -15 608 441 ;
+C 100 ; WX 600 ; N d ; B 85 -15 640 629 ;
+C 101 ; WX 600 ; N e ; B 106 -15 598 441 ;
+C 102 ; WX 600 ; N f ; B 114 0 662 629 ; L i fi ; L l fl ;
+C 103 ; WX 600 ; N g ; B 61 -157 657 441 ;
+C 104 ; WX 600 ; N h ; B 33 0 592 629 ;
+C 105 ; WX 600 ; N i ; B 95 0 515 657 ;
+C 106 ; WX 600 ; N j ; B 52 -157 550 657 ;
+C 107 ; WX 600 ; N k ; B 58 0 633 629 ;
+C 108 ; WX 600 ; N l ; B 95 0 515 629 ;
+C 109 ; WX 600 ; N m ; B -5 0 615 441 ;
+C 110 ; WX 600 ; N n ; B 26 0 585 441 ;
+C 111 ; WX 600 ; N o ; B 102 -15 588 441 ;
+C 112 ; WX 600 ; N p ; B -24 -157 605 441 ;
+C 113 ; WX 600 ; N q ; B 85 -157 682 441 ;
+C 114 ; WX 600 ; N r ; B 60 0 636 441 ;
+C 115 ; WX 600 ; N s ; B 78 -15 584 441 ;
+C 116 ; WX 600 ; N t ; B 167 -15 561 561 ;
+C 117 ; WX 600 ; N u ; B 101 -15 572 426 ;
+C 118 ; WX 600 ; N v ; B 90 -10 681 426 ;
+C 119 ; WX 600 ; N w ; B 76 -10 695 426 ;
+C 120 ; WX 600 ; N x ; B 20 0 655 426 ;
+C 121 ; WX 600 ; N y ; B -4 -157 683 426 ;
+C 122 ; WX 600 ; N z ; B 99 0 593 426 ;
+C 123 ; WX 600 ; N braceleft ; B 233 -108 569 622 ;
+C 124 ; WX 600 ; N bar ; B 222 -250 485 750 ;
+C 125 ; WX 600 ; N braceright ; B 140 -108 477 622 ;
+C 126 ; WX 600 ; N asciitilde ; B 116 197 600 320 ;
+C 161 ; WX 600 ; N exclamdown ; B 225 -157 445 430 ;
+C 162 ; WX 600 ; N cent ; B 151 -49 588 614 ;
+C 163 ; WX 600 ; N sterling ; B 124 -21 621 611 ;
+C 164 ; WX 600 ; N fraction ; B 84 -57 646 665 ;
+C 165 ; WX 600 ; N yen ; B 120 0 693 562 ;
+C 166 ; WX 600 ; N florin ; B -26 -143 671 622 ;
+C 167 ; WX 600 ; N section ; B 104 -78 590 580 ;
+C 168 ; WX 600 ; N currency ; B 94 58 628 506 ;
+C 169 ; WX 600 ; N quotesingle ; B 345 328 460 562 ;
+C 170 ; WX 600 ; N quotedblleft ; B 262 328 541 562 ;
+C 171 ; WX 600 ; N guillemotleft ; B 92 70 652 446 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 204 70 540 446 ;
+C 173 ; WX 600 ; N guilsinglright ; B 170 70 506 446 ;
+C 174 ; WX 600 ; N fi ; B 3 0 619 629 ;
+C 175 ; WX 600 ; N fl ; B 3 0 619 629 ;
+C 177 ; WX 600 ; N endash ; B 124 231 586 285 ;
+C 178 ; WX 600 ; N dagger ; B 217 -78 546 580 ;
+C 179 ; WX 600 ; N daggerdbl ; B 163 -78 546 580 ;
+C 180 ; WX 600 ; N periodcentered ; B 275 189 434 327 ;
+C 182 ; WX 600 ; N paragraph ; B 100 -78 630 562 ;
+C 183 ; WX 600 ; N bullet ; B 224 130 485 383 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 185 -134 397 100 ;
+C 185 ; WX 600 ; N quotedblbase ; B 115 -134 478 100 ;
+C 186 ; WX 600 ; N quotedblright ; B 213 328 576 562 ;
+C 187 ; WX 600 ; N guillemotright ; B 58 70 618 446 ;
+C 188 ; WX 600 ; N ellipsis ; B 46 -15 575 111 ;
+C 189 ; WX 600 ; N perthousand ; B 59 -15 627 622 ;
+C 191 ; WX 600 ; N questiondown ; B 105 -157 466 430 ;
+C 193 ; WX 600 ; N grave ; B 294 497 484 672 ;
+C 194 ; WX 600 ; N acute ; B 348 497 612 672 ;
+C 195 ; WX 600 ; N circumflex ; B 229 477 581 654 ;
+C 196 ; WX 600 ; N tilde ; B 212 489 629 606 ;
+C 197 ; WX 600 ; N macron ; B 232 525 600 565 ;
+C 198 ; WX 600 ; N breve ; B 279 501 576 609 ;
+C 199 ; WX 600 ; N dotaccent ; B 360 477 466 580 ;
+C 200 ; WX 600 ; N dieresis ; B 262 492 570 595 ;
+C 202 ; WX 600 ; N ring ; B 332 463 500 627 ;
+C 203 ; WX 600 ; N cedilla ; B 197 -151 344 10 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 239 497 683 672 ;
+C 206 ; WX 600 ; N ogonek ; B 207 -151 348 0 ;
+C 207 ; WX 600 ; N caron ; B 262 492 614 669 ;
+C 208 ; WX 600 ; N emdash ; B 49 231 661 285 ;
+C 225 ; WX 600 ; N AE ; B 3 0 655 562 ;
+C 227 ; WX 600 ; N ordfeminine ; B 209 249 512 580 ;
+C 232 ; WX 600 ; N Lslash ; B 47 0 607 562 ;
+C 233 ; WX 600 ; N Oslash ; B 94 -80 625 629 ;
+C 234 ; WX 600 ; N OE ; B 59 0 672 562 ;
+C 235 ; WX 600 ; N ordmasculine ; B 210 249 535 580 ;
+C 241 ; WX 600 ; N ae ; B 41 -15 626 441 ;
+C 245 ; WX 600 ; N dotlessi ; B 95 0 515 426 ;
+C 248 ; WX 600 ; N lslash ; B 95 0 583 629 ;
+C 249 ; WX 600 ; N oslash ; B 102 -80 588 506 ;
+C 250 ; WX 600 ; N oe ; B 54 -15 615 441 ;
+C 251 ; WX 600 ; N germandbls ; B 48 -15 617 629 ;
+C -1 ; WX 600 ; N Odieresis ; B 94 -18 625 731 ;
+C -1 ; WX 600 ; N logicalnot ; B 155 108 591 369 ;
+C -1 ; WX 600 ; N minus ; B 129 232 580 283 ;
+C -1 ; WX 600 ; N merge ; B 187 -15 503 436 ;
+C -1 ; WX 600 ; N degree ; B 214 269 576 622 ;
+C -1 ; WX 600 ; N dectab ; B 18 0 593 227 ;
+C -1 ; WX 600 ; N ll ; B 33 0 616 629 ;
+C -1 ; WX 600 ; N IJ ; B 32 -18 702 562 ;
+C -1 ; WX 600 ; N Eacute ; B 53 0 668 793 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 94 -18 625 775 ;
+C -1 ; WX 600 ; N ucircumflex ; B 101 -15 572 654 ;
+C -1 ; WX 600 ; N left ; B 114 68 580 348 ;
+C -1 ; WX 600 ; N threesuperior ; B 213 240 501 622 ;
+C -1 ; WX 600 ; N up ; B 223 0 503 437 ;
+C -1 ; WX 600 ; N multiply ; B 103 43 607 470 ;
+C -1 ; WX 600 ; N Scaron ; B 76 -20 673 805 ;
+C -1 ; WX 600 ; N tab ; B 19 0 641 562 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 125 -18 702 775 ;
+C -1 ; WX 600 ; N divide ; B 136 48 573 467 ;
+C -1 ; WX 600 ; N Acircumflex ; B 3 0 607 775 ;
+C -1 ; WX 600 ; N eacute ; B 106 -15 612 672 ;
+C -1 ; WX 600 ; N uacute ; B 101 -15 602 672 ;
+C -1 ; WX 600 ; N Aacute ; B 3 0 658 793 ;
+C -1 ; WX 600 ; N copyright ; B 53 -18 667 580 ;
+C -1 ; WX 600 ; N twosuperior ; B 230 249 535 622 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 53 0 660 775 ;
+C -1 ; WX 600 ; N ntilde ; B 26 0 629 606 ;
+C -1 ; WX 600 ; N down ; B 187 -15 467 426 ;
+C -1 ; WX 600 ; N center ; B 103 14 623 580 ;
+C -1 ; WX 600 ; N onesuperior ; B 231 249 491 622 ;
+C -1 ; WX 600 ; N ij ; B 37 -157 630 657 ;
+C -1 ; WX 600 ; N edieresis ; B 106 -15 598 595 ;
+C -1 ; WX 600 ; N graybox ; B 76 0 652 599 ;
+C -1 ; WX 600 ; N odieresis ; B 102 -15 588 595 ;
+C -1 ; WX 600 ; N Ograve ; B 94 -18 625 793 ;
+C -1 ; WX 600 ; N threequarters ; B 73 -56 659 666 ;
+C -1 ; WX 600 ; N plusminus ; B 96 44 594 558 ;
+C -1 ; WX 600 ; N prescription ; B 27 -15 617 562 ;
+C -1 ; WX 600 ; N eth ; B 102 -15 639 629 ;
+C -1 ; WX 600 ; N largebullet ; B 315 220 395 297 ;
+C -1 ; WX 600 ; N egrave ; B 106 -15 598 672 ;
+C -1 ; WX 600 ; N ccedilla ; B 106 -151 614 441 ;
+C -1 ; WX 600 ; N notegraphic ; B 143 -15 564 572 ;
+C -1 ; WX 600 ; N Udieresis ; B 125 -18 702 731 ;
+C -1 ; WX 600 ; N Gcaron ; B 83 -18 645 805 ;
+C -1 ; WX 600 ; N arrowdown ; B 152 -15 520 608 ;
+C -1 ; WX 600 ; N format ; B -28 -157 185 607 ;
+C -1 ; WX 600 ; N Otilde ; B 94 -18 656 732 ;
+C -1 ; WX 600 ; N Idieresis ; B 96 0 623 731 ;
+C -1 ; WX 600 ; N adieresis ; B 76 -15 570 595 ;
+C -1 ; WX 600 ; N ecircumflex ; B 106 -15 598 654 ;
+C -1 ; WX 600 ; N Eth ; B 43 0 645 562 ;
+C -1 ; WX 600 ; N onequarter ; B 65 -57 674 665 ;
+C -1 ; WX 600 ; N LL ; B 8 0 647 562 ;
+C -1 ; WX 600 ; N agrave ; B 76 -15 569 672 ;
+C -1 ; WX 600 ; N Zcaron ; B 86 0 643 805 ;
+C -1 ; WX 600 ; N Scedilla ; B 76 -151 650 580 ;
+C -1 ; WX 600 ; N Idot ; B 96 0 623 716 ;
+C -1 ; WX 600 ; N Iacute ; B 96 0 638 793 ;
+C -1 ; WX 600 ; N indent ; B 108 68 574 348 ;
+C -1 ; WX 600 ; N Ugrave ; B 125 -18 702 793 ;
+C -1 ; WX 600 ; N scaron ; B 78 -15 614 669 ;
+C -1 ; WX 600 ; N overscore ; B 123 579 734 629 ;
+C -1 ; WX 600 ; N Aring ; B 3 0 607 753 ;
+C -1 ; WX 600 ; N Ccedilla ; B 93 -151 658 580 ;
+C -1 ; WX 600 ; N Igrave ; B 96 0 623 793 ;
+C -1 ; WX 600 ; N brokenbar ; B 238 -175 469 675 ;
+C -1 ; WX 600 ; N Oacute ; B 94 -18 638 793 ;
+C -1 ; WX 600 ; N otilde ; B 102 -15 629 606 ;
+C -1 ; WX 600 ; N Yacute ; B 133 0 695 793 ;
+C -1 ; WX 600 ; N lira ; B 118 -21 621 611 ;
+C -1 ; WX 600 ; N Icircumflex ; B 96 0 623 775 ;
+C -1 ; WX 600 ; N Atilde ; B 3 0 656 732 ;
+C -1 ; WX 600 ; N Uacute ; B 125 -18 702 793 ;
+C -1 ; WX 600 ; N Ydieresis ; B 133 0 695 731 ;
+C -1 ; WX 600 ; N ydieresis ; B -4 -157 683 595 ;
+C -1 ; WX 600 ; N idieresis ; B 95 0 540 595 ;
+C -1 ; WX 600 ; N Adieresis ; B 3 0 607 731 ;
+C -1 ; WX 600 ; N mu ; B 72 -157 572 426 ;
+C -1 ; WX 600 ; N trademark ; B 75 263 742 562 ;
+C -1 ; WX 600 ; N oacute ; B 102 -15 612 672 ;
+C -1 ; WX 600 ; N acircumflex ; B 76 -15 581 654 ;
+C -1 ; WX 600 ; N Agrave ; B 3 0 607 793 ;
+C -1 ; WX 600 ; N return ; B 79 0 700 562 ;
+C -1 ; WX 600 ; N atilde ; B 76 -15 629 606 ;
+C -1 ; WX 600 ; N square ; B 19 0 700 562 ;
+C -1 ; WX 600 ; N registered ; B 53 -18 667 580 ;
+C -1 ; WX 600 ; N stop ; B 19 0 700 562 ;
+C -1 ; WX 600 ; N udieresis ; B 101 -15 572 595 ;
+C -1 ; WX 600 ; N arrowup ; B 209 0 577 623 ;
+C -1 ; WX 600 ; N igrave ; B 95 0 515 672 ;
+C -1 ; WX 600 ; N Edieresis ; B 53 0 660 731 ;
+C -1 ; WX 600 ; N zcaron ; B 99 0 624 669 ;
+C -1 ; WX 600 ; N arrowboth ; B 36 115 692 483 ;
+C -1 ; WX 600 ; N gcaron ; B 61 -157 657 669 ;
+C -1 ; WX 600 ; N arrowleft ; B 40 115 693 483 ;
+C -1 ; WX 600 ; N aacute ; B 76 -15 612 672 ;
+C -1 ; WX 600 ; N ocircumflex ; B 102 -15 588 654 ;
+C -1 ; WX 600 ; N scedilla ; B 78 -151 584 441 ;
+C -1 ; WX 600 ; N ograve ; B 102 -15 588 672 ;
+C -1 ; WX 600 ; N onehalf ; B 65 -57 669 665 ;
+C -1 ; WX 600 ; N ugrave ; B 101 -15 572 672 ;
+C -1 ; WX 600 ; N Ntilde ; B 7 -13 712 732 ;
+C -1 ; WX 600 ; N iacute ; B 95 0 612 672 ;
+C -1 ; WX 600 ; N arrowright ; B 34 115 688 483 ;
+C -1 ; WX 600 ; N Thorn ; B 79 0 606 562 ;
+C -1 ; WX 600 ; N Egrave ; B 53 0 660 793 ;
+C -1 ; WX 600 ; N thorn ; B -24 -157 605 629 ;
+C -1 ; WX 600 ; N aring ; B 76 -15 569 627 ;
+C -1 ; WX 600 ; N yacute ; B -4 -157 683 672 ;
+C -1 ; WX 600 ; N icircumflex ; B 95 0 551 654 ;
+EndCharMetrics
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 46 121 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex -4 121 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis -1 136 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave -4 121 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 12 126 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 27 126 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 56 121 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 26 121 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 29 136 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 26 121 ;
+CC Gcaron 2 ; PCC G 0 0 ; PCC caron 29 136 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 26 121 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 26 121 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 29 136 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 26 121 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 27 126 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 26 121 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 26 121 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 29 136 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 26 121 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 27 126 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 59 136 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 56 121 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 26 121 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 29 136 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave -4 121 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 56 121 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 29 136 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 29 136 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 0 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 0 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 0 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 0 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 0 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 0 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 0 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 0 0 ;
+CC gcaron 2 ; PCC g 0 0 ; PCC caron -30 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -30 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -30 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -30 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 0 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 0 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 0 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 0 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 0 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 0 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 0 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute -10 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex -10 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 0 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave -30 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute -20 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis -10 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 10 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvb8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvb8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..a1e1b33c403a0bb0b7b9326d49237be7e0ad6d7d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvb8a.afm
@@ -0,0 +1,570 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu Mar 15 09:43:00 1990
+Comment UniqueID 28357
+Comment VMusage 26878 33770
+FontName Helvetica-Bold
+FullName Helvetica Bold
+FamilyName Helvetica
+Weight Bold
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -170 -228 1003 962
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 532
+Ascender 718
+Descender -207
+StartCharMetrics 228
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 90 0 244 718 ;
+C 34 ; WX 474 ; N quotedbl ; B 98 447 376 718 ;
+C 35 ; WX 556 ; N numbersign ; B 18 0 538 698 ;
+C 36 ; WX 556 ; N dollar ; B 30 -115 523 775 ;
+C 37 ; WX 889 ; N percent ; B 28 -19 861 710 ;
+C 38 ; WX 722 ; N ampersand ; B 54 -19 701 718 ;
+C 39 ; WX 278 ; N quoteright ; B 69 445 209 718 ;
+C 40 ; WX 333 ; N parenleft ; B 35 -208 314 734 ;
+C 41 ; WX 333 ; N parenright ; B 19 -208 298 734 ;
+C 42 ; WX 389 ; N asterisk ; B 27 387 362 718 ;
+C 43 ; WX 584 ; N plus ; B 40 0 544 506 ;
+C 44 ; WX 278 ; N comma ; B 64 -168 214 146 ;
+C 45 ; WX 333 ; N hyphen ; B 27 215 306 345 ;
+C 46 ; WX 278 ; N period ; B 64 0 214 146 ;
+C 47 ; WX 278 ; N slash ; B -33 -19 311 737 ;
+C 48 ; WX 556 ; N zero ; B 32 -19 524 710 ;
+C 49 ; WX 556 ; N one ; B 69 0 378 710 ;
+C 50 ; WX 556 ; N two ; B 26 0 511 710 ;
+C 51 ; WX 556 ; N three ; B 27 -19 516 710 ;
+C 52 ; WX 556 ; N four ; B 27 0 526 710 ;
+C 53 ; WX 556 ; N five ; B 27 -19 516 698 ;
+C 54 ; WX 556 ; N six ; B 31 -19 520 710 ;
+C 55 ; WX 556 ; N seven ; B 25 0 528 698 ;
+C 56 ; WX 556 ; N eight ; B 32 -19 524 710 ;
+C 57 ; WX 556 ; N nine ; B 30 -19 522 710 ;
+C 58 ; WX 333 ; N colon ; B 92 0 242 512 ;
+C 59 ; WX 333 ; N semicolon ; B 92 -168 242 512 ;
+C 60 ; WX 584 ; N less ; B 38 -8 546 514 ;
+C 61 ; WX 584 ; N equal ; B 40 87 544 419 ;
+C 62 ; WX 584 ; N greater ; B 38 -8 546 514 ;
+C 63 ; WX 611 ; N question ; B 60 0 556 727 ;
+C 64 ; WX 975 ; N at ; B 118 -19 856 737 ;
+C 65 ; WX 722 ; N A ; B 20 0 702 718 ;
+C 66 ; WX 722 ; N B ; B 76 0 669 718 ;
+C 67 ; WX 722 ; N C ; B 44 -19 684 737 ;
+C 68 ; WX 722 ; N D ; B 76 0 685 718 ;
+C 69 ; WX 667 ; N E ; B 76 0 621 718 ;
+C 70 ; WX 611 ; N F ; B 76 0 587 718 ;
+C 71 ; WX 778 ; N G ; B 44 -19 713 737 ;
+C 72 ; WX 722 ; N H ; B 71 0 651 718 ;
+C 73 ; WX 278 ; N I ; B 64 0 214 718 ;
+C 74 ; WX 556 ; N J ; B 22 -18 484 718 ;
+C 75 ; WX 722 ; N K ; B 87 0 722 718 ;
+C 76 ; WX 611 ; N L ; B 76 0 583 718 ;
+C 77 ; WX 833 ; N M ; B 69 0 765 718 ;
+C 78 ; WX 722 ; N N ; B 69 0 654 718 ;
+C 79 ; WX 778 ; N O ; B 44 -19 734 737 ;
+C 80 ; WX 667 ; N P ; B 76 0 627 718 ;
+C 81 ; WX 778 ; N Q ; B 44 -52 737 737 ;
+C 82 ; WX 722 ; N R ; B 76 0 677 718 ;
+C 83 ; WX 667 ; N S ; B 39 -19 629 737 ;
+C 84 ; WX 611 ; N T ; B 14 0 598 718 ;
+C 85 ; WX 722 ; N U ; B 72 -19 651 718 ;
+C 86 ; WX 667 ; N V ; B 19 0 648 718 ;
+C 87 ; WX 944 ; N W ; B 16 0 929 718 ;
+C 88 ; WX 667 ; N X ; B 14 0 653 718 ;
+C 89 ; WX 667 ; N Y ; B 15 0 653 718 ;
+C 90 ; WX 611 ; N Z ; B 25 0 586 718 ;
+C 91 ; WX 333 ; N bracketleft ; B 63 -196 309 722 ;
+C 92 ; WX 278 ; N backslash ; B -33 -19 311 737 ;
+C 93 ; WX 333 ; N bracketright ; B 24 -196 270 722 ;
+C 94 ; WX 584 ; N asciicircum ; B 62 323 522 698 ;
+C 95 ; WX 556 ; N underscore ; B 0 -125 556 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 69 454 209 727 ;
+C 97 ; WX 556 ; N a ; B 29 -14 527 546 ;
+C 98 ; WX 611 ; N b ; B 61 -14 578 718 ;
+C 99 ; WX 556 ; N c ; B 34 -14 524 546 ;
+C 100 ; WX 611 ; N d ; B 34 -14 551 718 ;
+C 101 ; WX 556 ; N e ; B 23 -14 528 546 ;
+C 102 ; WX 333 ; N f ; B 10 0 318 727 ; L i fi ; L l fl ;
+C 103 ; WX 611 ; N g ; B 40 -217 553 546 ;
+C 104 ; WX 611 ; N h ; B 65 0 546 718 ;
+C 105 ; WX 278 ; N i ; B 69 0 209 725 ;
+C 106 ; WX 278 ; N j ; B 3 -214 209 725 ;
+C 107 ; WX 556 ; N k ; B 69 0 562 718 ;
+C 108 ; WX 278 ; N l ; B 69 0 209 718 ;
+C 109 ; WX 889 ; N m ; B 64 0 826 546 ;
+C 110 ; WX 611 ; N n ; B 65 0 546 546 ;
+C 111 ; WX 611 ; N o ; B 34 -14 578 546 ;
+C 112 ; WX 611 ; N p ; B 62 -207 578 546 ;
+C 113 ; WX 611 ; N q ; B 34 -207 552 546 ;
+C 114 ; WX 389 ; N r ; B 64 0 373 546 ;
+C 115 ; WX 556 ; N s ; B 30 -14 519 546 ;
+C 116 ; WX 333 ; N t ; B 10 -6 309 676 ;
+C 117 ; WX 611 ; N u ; B 66 -14 545 532 ;
+C 118 ; WX 556 ; N v ; B 13 0 543 532 ;
+C 119 ; WX 778 ; N w ; B 10 0 769 532 ;
+C 120 ; WX 556 ; N x ; B 15 0 541 532 ;
+C 121 ; WX 556 ; N y ; B 10 -214 539 532 ;
+C 122 ; WX 500 ; N z ; B 20 0 480 532 ;
+C 123 ; WX 389 ; N braceleft ; B 48 -196 365 722 ;
+C 124 ; WX 280 ; N bar ; B 84 -19 196 737 ;
+C 125 ; WX 389 ; N braceright ; B 24 -196 341 722 ;
+C 126 ; WX 584 ; N asciitilde ; B 61 163 523 343 ;
+C 161 ; WX 333 ; N exclamdown ; B 90 -186 244 532 ;
+C 162 ; WX 556 ; N cent ; B 34 -118 524 628 ;
+C 163 ; WX 556 ; N sterling ; B 28 -16 541 718 ;
+C 164 ; WX 167 ; N fraction ; B -170 -19 336 710 ;
+C 165 ; WX 556 ; N yen ; B -9 0 565 698 ;
+C 166 ; WX 556 ; N florin ; B -10 -210 516 737 ;
+C 167 ; WX 556 ; N section ; B 34 -184 522 727 ;
+C 168 ; WX 556 ; N currency ; B -3 76 559 636 ;
+C 169 ; WX 238 ; N quotesingle ; B 70 447 168 718 ;
+C 170 ; WX 500 ; N quotedblleft ; B 64 454 436 727 ;
+C 171 ; WX 556 ; N guillemotleft ; B 88 76 468 484 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 83 76 250 484 ;
+C 173 ; WX 333 ; N guilsinglright ; B 83 76 250 484 ;
+C 174 ; WX 611 ; N fi ; B 10 0 542 727 ;
+C 175 ; WX 611 ; N fl ; B 10 0 542 727 ;
+C 177 ; WX 556 ; N endash ; B 0 227 556 333 ;
+C 178 ; WX 556 ; N dagger ; B 36 -171 520 718 ;
+C 179 ; WX 556 ; N daggerdbl ; B 36 -171 520 718 ;
+C 180 ; WX 278 ; N periodcentered ; B 58 172 220 334 ;
+C 182 ; WX 556 ; N paragraph ; B -8 -191 539 700 ;
+C 183 ; WX 350 ; N bullet ; B 10 194 340 524 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 69 -146 209 127 ;
+C 185 ; WX 500 ; N quotedblbase ; B 64 -146 436 127 ;
+C 186 ; WX 500 ; N quotedblright ; B 64 445 436 718 ;
+C 187 ; WX 556 ; N guillemotright ; B 88 76 468 484 ;
+C 188 ; WX 1000 ; N ellipsis ; B 92 0 908 146 ;
+C 189 ; WX 1000 ; N perthousand ; B -3 -19 1003 710 ;
+C 191 ; WX 611 ; N questiondown ; B 55 -195 551 532 ;
+C 193 ; WX 333 ; N grave ; B -23 604 225 750 ;
+C 194 ; WX 333 ; N acute ; B 108 604 356 750 ;
+C 195 ; WX 333 ; N circumflex ; B -10 604 343 750 ;
+C 196 ; WX 333 ; N tilde ; B -17 610 350 737 ;
+C 197 ; WX 333 ; N macron ; B -6 604 339 678 ;
+C 198 ; WX 333 ; N breve ; B -2 604 335 750 ;
+C 199 ; WX 333 ; N dotaccent ; B 104 614 230 729 ;
+C 200 ; WX 333 ; N dieresis ; B 6 614 327 729 ;
+C 202 ; WX 333 ; N ring ; B 59 568 275 776 ;
+C 203 ; WX 333 ; N cedilla ; B 6 -228 245 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 9 604 486 750 ;
+C 206 ; WX 333 ; N ogonek ; B 71 -228 304 0 ;
+C 207 ; WX 333 ; N caron ; B -10 604 343 750 ;
+C 208 ; WX 1000 ; N emdash ; B 0 227 1000 333 ;
+C 225 ; WX 1000 ; N AE ; B 5 0 954 718 ;
+C 227 ; WX 370 ; N ordfeminine ; B 22 276 347 737 ;
+C 232 ; WX 611 ; N Lslash ; B -20 0 583 718 ;
+C 233 ; WX 778 ; N Oslash ; B 33 -27 744 745 ;
+C 234 ; WX 1000 ; N OE ; B 37 -19 961 737 ;
+C 235 ; WX 365 ; N ordmasculine ; B 6 276 360 737 ;
+C 241 ; WX 889 ; N ae ; B 29 -14 858 546 ;
+C 245 ; WX 278 ; N dotlessi ; B 69 0 209 532 ;
+C 248 ; WX 278 ; N lslash ; B -18 0 296 718 ;
+C 249 ; WX 611 ; N oslash ; B 22 -29 589 560 ;
+C 250 ; WX 944 ; N oe ; B 34 -14 912 546 ;
+C 251 ; WX 611 ; N germandbls ; B 69 -14 579 731 ;
+C -1 ; WX 611 ; N Zcaron ; B 25 0 586 936 ;
+C -1 ; WX 556 ; N ccedilla ; B 34 -228 524 546 ;
+C -1 ; WX 556 ; N ydieresis ; B 10 -214 539 729 ;
+C -1 ; WX 556 ; N atilde ; B 29 -14 527 737 ;
+C -1 ; WX 278 ; N icircumflex ; B -37 0 316 750 ;
+C -1 ; WX 333 ; N threesuperior ; B 8 271 326 710 ;
+C -1 ; WX 556 ; N ecircumflex ; B 23 -14 528 750 ;
+C -1 ; WX 611 ; N thorn ; B 62 -208 578 718 ;
+C -1 ; WX 556 ; N egrave ; B 23 -14 528 750 ;
+C -1 ; WX 333 ; N twosuperior ; B 9 283 324 710 ;
+C -1 ; WX 556 ; N eacute ; B 23 -14 528 750 ;
+C -1 ; WX 611 ; N otilde ; B 34 -14 578 737 ;
+C -1 ; WX 722 ; N Aacute ; B 20 0 702 936 ;
+C -1 ; WX 611 ; N ocircumflex ; B 34 -14 578 750 ;
+C -1 ; WX 556 ; N yacute ; B 10 -214 539 750 ;
+C -1 ; WX 611 ; N udieresis ; B 66 -14 545 729 ;
+C -1 ; WX 834 ; N threequarters ; B 16 -19 799 710 ;
+C -1 ; WX 556 ; N acircumflex ; B 29 -14 527 750 ;
+C -1 ; WX 722 ; N Eth ; B -5 0 685 718 ;
+C -1 ; WX 556 ; N edieresis ; B 23 -14 528 729 ;
+C -1 ; WX 611 ; N ugrave ; B 66 -14 545 750 ;
+C -1 ; WX 1000 ; N trademark ; B 44 306 956 718 ;
+C -1 ; WX 611 ; N ograve ; B 34 -14 578 750 ;
+C -1 ; WX 556 ; N scaron ; B 30 -14 519 750 ;
+C -1 ; WX 278 ; N Idieresis ; B -21 0 300 915 ;
+C -1 ; WX 611 ; N uacute ; B 66 -14 545 750 ;
+C -1 ; WX 556 ; N agrave ; B 29 -14 527 750 ;
+C -1 ; WX 611 ; N ntilde ; B 65 0 546 737 ;
+C -1 ; WX 556 ; N aring ; B 29 -14 527 776 ;
+C -1 ; WX 500 ; N zcaron ; B 20 0 480 750 ;
+C -1 ; WX 278 ; N Icircumflex ; B -37 0 316 936 ;
+C -1 ; WX 722 ; N Ntilde ; B 69 0 654 923 ;
+C -1 ; WX 611 ; N ucircumflex ; B 66 -14 545 750 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 76 0 621 936 ;
+C -1 ; WX 278 ; N Iacute ; B 64 0 329 936 ;
+C -1 ; WX 722 ; N Ccedilla ; B 44 -228 684 737 ;
+C -1 ; WX 778 ; N Odieresis ; B 44 -19 734 915 ;
+C -1 ; WX 667 ; N Scaron ; B 39 -19 629 936 ;
+C -1 ; WX 667 ; N Edieresis ; B 76 0 621 915 ;
+C -1 ; WX 278 ; N Igrave ; B -50 0 214 936 ;
+C -1 ; WX 556 ; N adieresis ; B 29 -14 527 729 ;
+C -1 ; WX 778 ; N Ograve ; B 44 -19 734 936 ;
+C -1 ; WX 667 ; N Egrave ; B 76 0 621 936 ;
+C -1 ; WX 667 ; N Ydieresis ; B 15 0 653 915 ;
+C -1 ; WX 737 ; N registered ; B -11 -19 748 737 ;
+C -1 ; WX 778 ; N Otilde ; B 44 -19 734 923 ;
+C -1 ; WX 834 ; N onequarter ; B 26 -19 766 710 ;
+C -1 ; WX 722 ; N Ugrave ; B 72 -19 651 936 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 72 -19 651 936 ;
+C -1 ; WX 667 ; N Thorn ; B 76 0 627 718 ;
+C -1 ; WX 584 ; N divide ; B 40 -42 544 548 ;
+C -1 ; WX 722 ; N Atilde ; B 20 0 702 923 ;
+C -1 ; WX 722 ; N Uacute ; B 72 -19 651 936 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 44 -19 734 936 ;
+C -1 ; WX 584 ; N logicalnot ; B 40 108 544 419 ;
+C -1 ; WX 722 ; N Aring ; B 20 0 702 962 ;
+C -1 ; WX 278 ; N idieresis ; B -21 0 300 729 ;
+C -1 ; WX 278 ; N iacute ; B 69 0 329 750 ;
+C -1 ; WX 556 ; N aacute ; B 29 -14 527 750 ;
+C -1 ; WX 584 ; N plusminus ; B 40 0 544 506 ;
+C -1 ; WX 584 ; N multiply ; B 40 1 545 505 ;
+C -1 ; WX 722 ; N Udieresis ; B 72 -19 651 915 ;
+C -1 ; WX 584 ; N minus ; B 40 197 544 309 ;
+C -1 ; WX 333 ; N onesuperior ; B 26 283 237 710 ;
+C -1 ; WX 667 ; N Eacute ; B 76 0 621 936 ;
+C -1 ; WX 722 ; N Acircumflex ; B 20 0 702 936 ;
+C -1 ; WX 737 ; N copyright ; B -11 -19 749 737 ;
+C -1 ; WX 722 ; N Agrave ; B 20 0 702 936 ;
+C -1 ; WX 611 ; N odieresis ; B 34 -14 578 729 ;
+C -1 ; WX 611 ; N oacute ; B 34 -14 578 750 ;
+C -1 ; WX 400 ; N degree ; B 57 426 343 712 ;
+C -1 ; WX 278 ; N igrave ; B -50 0 209 750 ;
+C -1 ; WX 611 ; N mu ; B 66 -207 545 532 ;
+C -1 ; WX 778 ; N Oacute ; B 44 -19 734 936 ;
+C -1 ; WX 611 ; N eth ; B 34 -14 578 737 ;
+C -1 ; WX 722 ; N Adieresis ; B 20 0 702 915 ;
+C -1 ; WX 667 ; N Yacute ; B 15 0 653 936 ;
+C -1 ; WX 280 ; N brokenbar ; B 84 -19 196 737 ;
+C -1 ; WX 834 ; N onehalf ; B 26 -19 794 710 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 209
+
+KPX A y -30
+KPX A w -30
+KPX A v -40
+KPX A u -30
+KPX A Y -110
+KPX A W -60
+KPX A V -80
+KPX A U -50
+KPX A T -90
+KPX A Q -40
+KPX A O -40
+KPX A G -50
+KPX A C -40
+
+KPX B U -10
+KPX B A -30
+
+KPX D period -30
+KPX D comma -30
+KPX D Y -70
+KPX D W -40
+KPX D V -40
+KPX D A -40
+
+KPX F period -100
+KPX F comma -100
+KPX F a -20
+KPX F A -80
+
+KPX J u -20
+KPX J period -20
+KPX J comma -20
+KPX J A -20
+
+KPX K y -40
+KPX K u -30
+KPX K o -35
+KPX K e -15
+KPX K O -30
+
+KPX L y -30
+KPX L quoteright -140
+KPX L quotedblright -140
+KPX L Y -120
+KPX L W -80
+KPX L V -110
+KPX L T -90
+
+KPX O period -40
+KPX O comma -40
+KPX O Y -70
+KPX O X -50
+KPX O W -50
+KPX O V -50
+KPX O T -40
+KPX O A -50
+
+KPX P period -120
+KPX P o -40
+KPX P e -30
+KPX P comma -120
+KPX P a -30
+KPX P A -100
+
+KPX Q period 20
+KPX Q comma 20
+KPX Q U -10
+
+KPX R Y -50
+KPX R W -40
+KPX R V -50
+KPX R U -20
+KPX R T -20
+KPX R O -20
+
+KPX T y -60
+KPX T w -60
+KPX T u -90
+KPX T semicolon -40
+KPX T r -80
+KPX T period -80
+KPX T o -80
+KPX T hyphen -120
+KPX T e -60
+KPX T comma -80
+KPX T colon -40
+KPX T a -80
+KPX T O -40
+KPX T A -90
+
+KPX U period -30
+KPX U comma -30
+KPX U A -50
+
+KPX V u -60
+KPX V semicolon -40
+KPX V period -120
+KPX V o -90
+KPX V hyphen -80
+KPX V e -50
+KPX V comma -120
+KPX V colon -40
+KPX V a -60
+KPX V O -50
+KPX V G -50
+KPX V A -80
+
+KPX W y -20
+KPX W u -45
+KPX W semicolon -10
+KPX W period -80
+KPX W o -60
+KPX W hyphen -40
+KPX W e -35
+KPX W comma -80
+KPX W colon -10
+KPX W a -40
+KPX W O -20
+KPX W A -60
+
+KPX Y u -100
+KPX Y semicolon -50
+KPX Y period -100
+KPX Y o -100
+KPX Y e -80
+KPX Y comma -100
+KPX Y colon -50
+KPX Y a -90
+KPX Y O -70
+KPX Y A -110
+
+KPX a y -20
+KPX a w -15
+KPX a v -15
+KPX a g -10
+
+KPX b y -20
+KPX b v -20
+KPX b u -20
+KPX b l -10
+
+KPX c y -10
+KPX c l -20
+KPX c k -20
+KPX c h -10
+
+KPX colon space -40
+
+KPX comma space -40
+KPX comma quoteright -120
+KPX comma quotedblright -120
+
+KPX d y -15
+KPX d w -15
+KPX d v -15
+KPX d d -10
+
+KPX e y -15
+KPX e x -15
+KPX e w -15
+KPX e v -15
+KPX e period 20
+KPX e comma 10
+
+KPX f quoteright 30
+KPX f quotedblright 30
+KPX f period -10
+KPX f o -20
+KPX f e -10
+KPX f comma -10
+
+KPX g g -10
+KPX g e 10
+
+KPX h y -20
+
+KPX k o -15
+
+KPX l y -15
+KPX l w -15
+
+KPX m y -30
+KPX m u -20
+
+KPX n y -20
+KPX n v -40
+KPX n u -10
+
+KPX o y -20
+KPX o x -30
+KPX o w -15
+KPX o v -20
+
+KPX p y -15
+
+KPX period space -40
+KPX period quoteright -120
+KPX period quotedblright -120
+
+KPX quotedblright space -80
+
+KPX quoteleft quoteleft -46
+
+KPX quoteright v -20
+KPX quoteright space -80
+KPX quoteright s -60
+KPX quoteright r -40
+KPX quoteright quoteright -46
+KPX quoteright l -20
+KPX quoteright d -80
+
+KPX r y 10
+KPX r v 10
+KPX r t 20
+KPX r s -15
+KPX r q -20
+KPX r period -60
+KPX r o -20
+KPX r hyphen -20
+KPX r g -15
+KPX r d -20
+KPX r comma -60
+KPX r c -20
+
+KPX s w -15
+
+KPX semicolon space -40
+
+KPX space quoteleft -60
+KPX space quotedblleft -80
+KPX space Y -120
+KPX space W -80
+KPX space V -80
+KPX space T -100
+
+KPX v period -80
+KPX v o -30
+KPX v comma -80
+KPX v a -20
+
+KPX w period -40
+KPX w o -20
+KPX w comma -40
+
+KPX x e -10
+
+KPX y period -80
+KPX y o -25
+KPX y e -10
+KPX y comma -80
+KPX y a -30
+
+KPX z e 10
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 186 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 195 186 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 195 186 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 195 186 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 195 186 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 195 186 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 215 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 167 186 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 167 186 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 167 186 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 167 186 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -27 186 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -27 186 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -27 186 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -27 186 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 195 186 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 223 186 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 223 186 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 223 186 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 223 186 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 223 186 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 167 186 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 195 186 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 195 186 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 195 186 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 195 186 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 167 186 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 167 186 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 186 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 112 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 112 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 132 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 112 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 112 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 112 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 112 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 139 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 139 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 139 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 139 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 112 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 139 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 139 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 112 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 112 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvb8an.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvb8an.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b7c69698bb23e52391ab7f64fcb1cf4d440ffd16
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvb8an.afm
@@ -0,0 +1,570 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu Mar 15 11:47:27 1990
+Comment UniqueID 28398
+Comment VMusage 7614 43068
+FontName Helvetica-Narrow-Bold
+FullName Helvetica Narrow Bold
+FamilyName Helvetica
+Weight Bold
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -139 -228 822 962
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 532
+Ascender 718
+Descender -207
+StartCharMetrics 228
+C 32 ; WX 228 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 273 ; N exclam ; B 74 0 200 718 ;
+C 34 ; WX 389 ; N quotedbl ; B 80 447 308 718 ;
+C 35 ; WX 456 ; N numbersign ; B 15 0 441 698 ;
+C 36 ; WX 456 ; N dollar ; B 25 -115 429 775 ;
+C 37 ; WX 729 ; N percent ; B 23 -19 706 710 ;
+C 38 ; WX 592 ; N ampersand ; B 44 -19 575 718 ;
+C 39 ; WX 228 ; N quoteright ; B 57 445 171 718 ;
+C 40 ; WX 273 ; N parenleft ; B 29 -208 257 734 ;
+C 41 ; WX 273 ; N parenright ; B 16 -208 244 734 ;
+C 42 ; WX 319 ; N asterisk ; B 22 387 297 718 ;
+C 43 ; WX 479 ; N plus ; B 33 0 446 506 ;
+C 44 ; WX 228 ; N comma ; B 52 -168 175 146 ;
+C 45 ; WX 273 ; N hyphen ; B 22 215 251 345 ;
+C 46 ; WX 228 ; N period ; B 52 0 175 146 ;
+C 47 ; WX 228 ; N slash ; B -27 -19 255 737 ;
+C 48 ; WX 456 ; N zero ; B 26 -19 430 710 ;
+C 49 ; WX 456 ; N one ; B 57 0 310 710 ;
+C 50 ; WX 456 ; N two ; B 21 0 419 710 ;
+C 51 ; WX 456 ; N three ; B 22 -19 423 710 ;
+C 52 ; WX 456 ; N four ; B 22 0 431 710 ;
+C 53 ; WX 456 ; N five ; B 22 -19 423 698 ;
+C 54 ; WX 456 ; N six ; B 25 -19 426 710 ;
+C 55 ; WX 456 ; N seven ; B 20 0 433 698 ;
+C 56 ; WX 456 ; N eight ; B 26 -19 430 710 ;
+C 57 ; WX 456 ; N nine ; B 25 -19 428 710 ;
+C 58 ; WX 273 ; N colon ; B 75 0 198 512 ;
+C 59 ; WX 273 ; N semicolon ; B 75 -168 198 512 ;
+C 60 ; WX 479 ; N less ; B 31 -8 448 514 ;
+C 61 ; WX 479 ; N equal ; B 33 87 446 419 ;
+C 62 ; WX 479 ; N greater ; B 31 -8 448 514 ;
+C 63 ; WX 501 ; N question ; B 49 0 456 727 ;
+C 64 ; WX 800 ; N at ; B 97 -19 702 737 ;
+C 65 ; WX 592 ; N A ; B 16 0 576 718 ;
+C 66 ; WX 592 ; N B ; B 62 0 549 718 ;
+C 67 ; WX 592 ; N C ; B 36 -19 561 737 ;
+C 68 ; WX 592 ; N D ; B 62 0 562 718 ;
+C 69 ; WX 547 ; N E ; B 62 0 509 718 ;
+C 70 ; WX 501 ; N F ; B 62 0 481 718 ;
+C 71 ; WX 638 ; N G ; B 36 -19 585 737 ;
+C 72 ; WX 592 ; N H ; B 58 0 534 718 ;
+C 73 ; WX 228 ; N I ; B 52 0 175 718 ;
+C 74 ; WX 456 ; N J ; B 18 -18 397 718 ;
+C 75 ; WX 592 ; N K ; B 71 0 592 718 ;
+C 76 ; WX 501 ; N L ; B 62 0 478 718 ;
+C 77 ; WX 683 ; N M ; B 57 0 627 718 ;
+C 78 ; WX 592 ; N N ; B 57 0 536 718 ;
+C 79 ; WX 638 ; N O ; B 36 -19 602 737 ;
+C 80 ; WX 547 ; N P ; B 62 0 514 718 ;
+C 81 ; WX 638 ; N Q ; B 36 -52 604 737 ;
+C 82 ; WX 592 ; N R ; B 62 0 555 718 ;
+C 83 ; WX 547 ; N S ; B 32 -19 516 737 ;
+C 84 ; WX 501 ; N T ; B 11 0 490 718 ;
+C 85 ; WX 592 ; N U ; B 59 -19 534 718 ;
+C 86 ; WX 547 ; N V ; B 16 0 531 718 ;
+C 87 ; WX 774 ; N W ; B 13 0 762 718 ;
+C 88 ; WX 547 ; N X ; B 11 0 535 718 ;
+C 89 ; WX 547 ; N Y ; B 12 0 535 718 ;
+C 90 ; WX 501 ; N Z ; B 20 0 481 718 ;
+C 91 ; WX 273 ; N bracketleft ; B 52 -196 253 722 ;
+C 92 ; WX 228 ; N backslash ; B -27 -19 255 737 ;
+C 93 ; WX 273 ; N bracketright ; B 20 -196 221 722 ;
+C 94 ; WX 479 ; N asciicircum ; B 51 323 428 698 ;
+C 95 ; WX 456 ; N underscore ; B 0 -125 456 -75 ;
+C 96 ; WX 228 ; N quoteleft ; B 57 454 171 727 ;
+C 97 ; WX 456 ; N a ; B 24 -14 432 546 ;
+C 98 ; WX 501 ; N b ; B 50 -14 474 718 ;
+C 99 ; WX 456 ; N c ; B 28 -14 430 546 ;
+C 100 ; WX 501 ; N d ; B 28 -14 452 718 ;
+C 101 ; WX 456 ; N e ; B 19 -14 433 546 ;
+C 102 ; WX 273 ; N f ; B 8 0 261 727 ; L i fi ; L l fl ;
+C 103 ; WX 501 ; N g ; B 33 -217 453 546 ;
+C 104 ; WX 501 ; N h ; B 53 0 448 718 ;
+C 105 ; WX 228 ; N i ; B 57 0 171 725 ;
+C 106 ; WX 228 ; N j ; B 2 -214 171 725 ;
+C 107 ; WX 456 ; N k ; B 57 0 461 718 ;
+C 108 ; WX 228 ; N l ; B 57 0 171 718 ;
+C 109 ; WX 729 ; N m ; B 52 0 677 546 ;
+C 110 ; WX 501 ; N n ; B 53 0 448 546 ;
+C 111 ; WX 501 ; N o ; B 28 -14 474 546 ;
+C 112 ; WX 501 ; N p ; B 51 -207 474 546 ;
+C 113 ; WX 501 ; N q ; B 28 -207 453 546 ;
+C 114 ; WX 319 ; N r ; B 52 0 306 546 ;
+C 115 ; WX 456 ; N s ; B 25 -14 426 546 ;
+C 116 ; WX 273 ; N t ; B 8 -6 253 676 ;
+C 117 ; WX 501 ; N u ; B 54 -14 447 532 ;
+C 118 ; WX 456 ; N v ; B 11 0 445 532 ;
+C 119 ; WX 638 ; N w ; B 8 0 631 532 ;
+C 120 ; WX 456 ; N x ; B 12 0 444 532 ;
+C 121 ; WX 456 ; N y ; B 8 -214 442 532 ;
+C 122 ; WX 410 ; N z ; B 16 0 394 532 ;
+C 123 ; WX 319 ; N braceleft ; B 39 -196 299 722 ;
+C 124 ; WX 230 ; N bar ; B 69 -19 161 737 ;
+C 125 ; WX 319 ; N braceright ; B 20 -196 280 722 ;
+C 126 ; WX 479 ; N asciitilde ; B 50 163 429 343 ;
+C 161 ; WX 273 ; N exclamdown ; B 74 -186 200 532 ;
+C 162 ; WX 456 ; N cent ; B 28 -118 430 628 ;
+C 163 ; WX 456 ; N sterling ; B 23 -16 444 718 ;
+C 164 ; WX 137 ; N fraction ; B -139 -19 276 710 ;
+C 165 ; WX 456 ; N yen ; B -7 0 463 698 ;
+C 166 ; WX 456 ; N florin ; B -8 -210 423 737 ;
+C 167 ; WX 456 ; N section ; B 28 -184 428 727 ;
+C 168 ; WX 456 ; N currency ; B -2 76 458 636 ;
+C 169 ; WX 195 ; N quotesingle ; B 57 447 138 718 ;
+C 170 ; WX 410 ; N quotedblleft ; B 52 454 358 727 ;
+C 171 ; WX 456 ; N guillemotleft ; B 72 76 384 484 ;
+C 172 ; WX 273 ; N guilsinglleft ; B 68 76 205 484 ;
+C 173 ; WX 273 ; N guilsinglright ; B 68 76 205 484 ;
+C 174 ; WX 501 ; N fi ; B 8 0 444 727 ;
+C 175 ; WX 501 ; N fl ; B 8 0 444 727 ;
+C 177 ; WX 456 ; N endash ; B 0 227 456 333 ;
+C 178 ; WX 456 ; N dagger ; B 30 -171 426 718 ;
+C 179 ; WX 456 ; N daggerdbl ; B 30 -171 426 718 ;
+C 180 ; WX 228 ; N periodcentered ; B 48 172 180 334 ;
+C 182 ; WX 456 ; N paragraph ; B -7 -191 442 700 ;
+C 183 ; WX 287 ; N bullet ; B 8 194 279 524 ;
+C 184 ; WX 228 ; N quotesinglbase ; B 57 -146 171 127 ;
+C 185 ; WX 410 ; N quotedblbase ; B 52 -146 358 127 ;
+C 186 ; WX 410 ; N quotedblright ; B 52 445 358 718 ;
+C 187 ; WX 456 ; N guillemotright ; B 72 76 384 484 ;
+C 188 ; WX 820 ; N ellipsis ; B 75 0 745 146 ;
+C 189 ; WX 820 ; N perthousand ; B -2 -19 822 710 ;
+C 191 ; WX 501 ; N questiondown ; B 45 -195 452 532 ;
+C 193 ; WX 273 ; N grave ; B -19 604 184 750 ;
+C 194 ; WX 273 ; N acute ; B 89 604 292 750 ;
+C 195 ; WX 273 ; N circumflex ; B -8 604 281 750 ;
+C 196 ; WX 273 ; N tilde ; B -14 610 287 737 ;
+C 197 ; WX 273 ; N macron ; B -5 604 278 678 ;
+C 198 ; WX 273 ; N breve ; B -2 604 275 750 ;
+C 199 ; WX 273 ; N dotaccent ; B 85 614 189 729 ;
+C 200 ; WX 273 ; N dieresis ; B 5 614 268 729 ;
+C 202 ; WX 273 ; N ring ; B 48 568 225 776 ;
+C 203 ; WX 273 ; N cedilla ; B 5 -228 201 0 ;
+C 205 ; WX 273 ; N hungarumlaut ; B 7 604 399 750 ;
+C 206 ; WX 273 ; N ogonek ; B 58 -228 249 0 ;
+C 207 ; WX 273 ; N caron ; B -8 604 281 750 ;
+C 208 ; WX 820 ; N emdash ; B 0 227 820 333 ;
+C 225 ; WX 820 ; N AE ; B 4 0 782 718 ;
+C 227 ; WX 303 ; N ordfeminine ; B 18 276 285 737 ;
+C 232 ; WX 501 ; N Lslash ; B -16 0 478 718 ;
+C 233 ; WX 638 ; N Oslash ; B 27 -27 610 745 ;
+C 234 ; WX 820 ; N OE ; B 30 -19 788 737 ;
+C 235 ; WX 299 ; N ordmasculine ; B 5 276 295 737 ;
+C 241 ; WX 729 ; N ae ; B 24 -14 704 546 ;
+C 245 ; WX 228 ; N dotlessi ; B 57 0 171 532 ;
+C 248 ; WX 228 ; N lslash ; B -15 0 243 718 ;
+C 249 ; WX 501 ; N oslash ; B 18 -29 483 560 ;
+C 250 ; WX 774 ; N oe ; B 28 -14 748 546 ;
+C 251 ; WX 501 ; N germandbls ; B 57 -14 475 731 ;
+C -1 ; WX 501 ; N Zcaron ; B 20 0 481 936 ;
+C -1 ; WX 456 ; N ccedilla ; B 28 -228 430 546 ;
+C -1 ; WX 456 ; N ydieresis ; B 8 -214 442 729 ;
+C -1 ; WX 456 ; N atilde ; B 24 -14 432 737 ;
+C -1 ; WX 228 ; N icircumflex ; B -30 0 259 750 ;
+C -1 ; WX 273 ; N threesuperior ; B 7 271 267 710 ;
+C -1 ; WX 456 ; N ecircumflex ; B 19 -14 433 750 ;
+C -1 ; WX 501 ; N thorn ; B 51 -208 474 718 ;
+C -1 ; WX 456 ; N egrave ; B 19 -14 433 750 ;
+C -1 ; WX 273 ; N twosuperior ; B 7 283 266 710 ;
+C -1 ; WX 456 ; N eacute ; B 19 -14 433 750 ;
+C -1 ; WX 501 ; N otilde ; B 28 -14 474 737 ;
+C -1 ; WX 592 ; N Aacute ; B 16 0 576 936 ;
+C -1 ; WX 501 ; N ocircumflex ; B 28 -14 474 750 ;
+C -1 ; WX 456 ; N yacute ; B 8 -214 442 750 ;
+C -1 ; WX 501 ; N udieresis ; B 54 -14 447 729 ;
+C -1 ; WX 684 ; N threequarters ; B 13 -19 655 710 ;
+C -1 ; WX 456 ; N acircumflex ; B 24 -14 432 750 ;
+C -1 ; WX 592 ; N Eth ; B -4 0 562 718 ;
+C -1 ; WX 456 ; N edieresis ; B 19 -14 433 729 ;
+C -1 ; WX 501 ; N ugrave ; B 54 -14 447 750 ;
+C -1 ; WX 820 ; N trademark ; B 36 306 784 718 ;
+C -1 ; WX 501 ; N ograve ; B 28 -14 474 750 ;
+C -1 ; WX 456 ; N scaron ; B 25 -14 426 750 ;
+C -1 ; WX 228 ; N Idieresis ; B -17 0 246 915 ;
+C -1 ; WX 501 ; N uacute ; B 54 -14 447 750 ;
+C -1 ; WX 456 ; N agrave ; B 24 -14 432 750 ;
+C -1 ; WX 501 ; N ntilde ; B 53 0 448 737 ;
+C -1 ; WX 456 ; N aring ; B 24 -14 432 776 ;
+C -1 ; WX 410 ; N zcaron ; B 16 0 394 750 ;
+C -1 ; WX 228 ; N Icircumflex ; B -30 0 259 936 ;
+C -1 ; WX 592 ; N Ntilde ; B 57 0 536 923 ;
+C -1 ; WX 501 ; N ucircumflex ; B 54 -14 447 750 ;
+C -1 ; WX 547 ; N Ecircumflex ; B 62 0 509 936 ;
+C -1 ; WX 228 ; N Iacute ; B 52 0 270 936 ;
+C -1 ; WX 592 ; N Ccedilla ; B 36 -228 561 737 ;
+C -1 ; WX 638 ; N Odieresis ; B 36 -19 602 915 ;
+C -1 ; WX 547 ; N Scaron ; B 32 -19 516 936 ;
+C -1 ; WX 547 ; N Edieresis ; B 62 0 509 915 ;
+C -1 ; WX 228 ; N Igrave ; B -41 0 175 936 ;
+C -1 ; WX 456 ; N adieresis ; B 24 -14 432 729 ;
+C -1 ; WX 638 ; N Ograve ; B 36 -19 602 936 ;
+C -1 ; WX 547 ; N Egrave ; B 62 0 509 936 ;
+C -1 ; WX 547 ; N Ydieresis ; B 12 0 535 915 ;
+C -1 ; WX 604 ; N registered ; B -9 -19 613 737 ;
+C -1 ; WX 638 ; N Otilde ; B 36 -19 602 923 ;
+C -1 ; WX 684 ; N onequarter ; B 21 -19 628 710 ;
+C -1 ; WX 592 ; N Ugrave ; B 59 -19 534 936 ;
+C -1 ; WX 592 ; N Ucircumflex ; B 59 -19 534 936 ;
+C -1 ; WX 547 ; N Thorn ; B 62 0 514 718 ;
+C -1 ; WX 479 ; N divide ; B 33 -42 446 548 ;
+C -1 ; WX 592 ; N Atilde ; B 16 0 576 923 ;
+C -1 ; WX 592 ; N Uacute ; B 59 -19 534 936 ;
+C -1 ; WX 638 ; N Ocircumflex ; B 36 -19 602 936 ;
+C -1 ; WX 479 ; N logicalnot ; B 33 108 446 419 ;
+C -1 ; WX 592 ; N Aring ; B 16 0 576 962 ;
+C -1 ; WX 228 ; N idieresis ; B -17 0 246 729 ;
+C -1 ; WX 228 ; N iacute ; B 57 0 270 750 ;
+C -1 ; WX 456 ; N aacute ; B 24 -14 432 750 ;
+C -1 ; WX 479 ; N plusminus ; B 33 0 446 506 ;
+C -1 ; WX 479 ; N multiply ; B 33 1 447 505 ;
+C -1 ; WX 592 ; N Udieresis ; B 59 -19 534 915 ;
+C -1 ; WX 479 ; N minus ; B 33 197 446 309 ;
+C -1 ; WX 273 ; N onesuperior ; B 21 283 194 710 ;
+C -1 ; WX 547 ; N Eacute ; B 62 0 509 936 ;
+C -1 ; WX 592 ; N Acircumflex ; B 16 0 576 936 ;
+C -1 ; WX 604 ; N copyright ; B -9 -19 614 737 ;
+C -1 ; WX 592 ; N Agrave ; B 16 0 576 936 ;
+C -1 ; WX 501 ; N odieresis ; B 28 -14 474 729 ;
+C -1 ; WX 501 ; N oacute ; B 28 -14 474 750 ;
+C -1 ; WX 328 ; N degree ; B 47 426 281 712 ;
+C -1 ; WX 228 ; N igrave ; B -41 0 171 750 ;
+C -1 ; WX 501 ; N mu ; B 54 -207 447 532 ;
+C -1 ; WX 638 ; N Oacute ; B 36 -19 602 936 ;
+C -1 ; WX 501 ; N eth ; B 28 -14 474 737 ;
+C -1 ; WX 592 ; N Adieresis ; B 16 0 576 915 ;
+C -1 ; WX 547 ; N Yacute ; B 12 0 535 936 ;
+C -1 ; WX 230 ; N brokenbar ; B 69 -19 161 737 ;
+C -1 ; WX 684 ; N onehalf ; B 21 -19 651 710 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 209
+
+KPX A y -24
+KPX A w -24
+KPX A v -32
+KPX A u -24
+KPX A Y -89
+KPX A W -48
+KPX A V -65
+KPX A U -40
+KPX A T -73
+KPX A Q -32
+KPX A O -32
+KPX A G -40
+KPX A C -32
+
+KPX B U -7
+KPX B A -24
+
+KPX D period -24
+KPX D comma -24
+KPX D Y -56
+KPX D W -32
+KPX D V -32
+KPX D A -32
+
+KPX F period -81
+KPX F comma -81
+KPX F a -15
+KPX F A -65
+
+KPX J u -15
+KPX J period -15
+KPX J comma -15
+KPX J A -15
+
+KPX K y -32
+KPX K u -24
+KPX K o -28
+KPX K e -11
+KPX K O -24
+
+KPX L y -24
+KPX L quoteright -114
+KPX L quotedblright -114
+KPX L Y -97
+KPX L W -65
+KPX L V -89
+KPX L T -73
+
+KPX O period -32
+KPX O comma -32
+KPX O Y -56
+KPX O X -40
+KPX O W -40
+KPX O V -40
+KPX O T -32
+KPX O A -40
+
+KPX P period -97
+KPX P o -32
+KPX P e -24
+KPX P comma -97
+KPX P a -24
+KPX P A -81
+
+KPX Q period 16
+KPX Q comma 16
+KPX Q U -7
+
+KPX R Y -40
+KPX R W -32
+KPX R V -40
+KPX R U -15
+KPX R T -15
+KPX R O -15
+
+KPX T y -48
+KPX T w -48
+KPX T u -73
+KPX T semicolon -32
+KPX T r -65
+KPX T period -65
+KPX T o -65
+KPX T hyphen -97
+KPX T e -48
+KPX T comma -65
+KPX T colon -32
+KPX T a -65
+KPX T O -32
+KPX T A -73
+
+KPX U period -24
+KPX U comma -24
+KPX U A -40
+
+KPX V u -48
+KPX V semicolon -32
+KPX V period -97
+KPX V o -73
+KPX V hyphen -65
+KPX V e -40
+KPX V comma -97
+KPX V colon -32
+KPX V a -48
+KPX V O -40
+KPX V G -40
+KPX V A -65
+
+KPX W y -15
+KPX W u -36
+KPX W semicolon -7
+KPX W period -65
+KPX W o -48
+KPX W hyphen -32
+KPX W e -28
+KPX W comma -65
+KPX W colon -7
+KPX W a -32
+KPX W O -15
+KPX W A -48
+
+KPX Y u -81
+KPX Y semicolon -40
+KPX Y period -81
+KPX Y o -81
+KPX Y e -65
+KPX Y comma -81
+KPX Y colon -40
+KPX Y a -73
+KPX Y O -56
+KPX Y A -89
+
+KPX a y -15
+KPX a w -11
+KPX a v -11
+KPX a g -7
+
+KPX b y -15
+KPX b v -15
+KPX b u -15
+KPX b l -7
+
+KPX c y -7
+KPX c l -15
+KPX c k -15
+KPX c h -7
+
+KPX colon space -32
+
+KPX comma space -32
+KPX comma quoteright -97
+KPX comma quotedblright -97
+
+KPX d y -11
+KPX d w -11
+KPX d v -11
+KPX d d -7
+
+KPX e y -11
+KPX e x -11
+KPX e w -11
+KPX e v -11
+KPX e period 16
+KPX e comma 8
+
+KPX f quoteright 25
+KPX f quotedblright 25
+KPX f period -7
+KPX f o -15
+KPX f e -7
+KPX f comma -7
+
+KPX g g -7
+KPX g e 8
+
+KPX h y -15
+
+KPX k o -11
+
+KPX l y -11
+KPX l w -11
+
+KPX m y -24
+KPX m u -15
+
+KPX n y -15
+KPX n v -32
+KPX n u -7
+
+KPX o y -15
+KPX o x -24
+KPX o w -11
+KPX o v -15
+
+KPX p y -11
+
+KPX period space -32
+KPX period quoteright -97
+KPX period quotedblright -97
+
+KPX quotedblright space -65
+
+KPX quoteleft quoteleft -37
+
+KPX quoteright v -15
+KPX quoteright space -65
+KPX quoteright s -48
+KPX quoteright r -32
+KPX quoteright quoteright -37
+KPX quoteright l -15
+KPX quoteright d -65
+
+KPX r y 8
+KPX r v 8
+KPX r t 16
+KPX r s -11
+KPX r q -15
+KPX r period -48
+KPX r o -15
+KPX r hyphen -15
+KPX r g -11
+KPX r d -15
+KPX r comma -48
+KPX r c -15
+
+KPX s w -11
+
+KPX semicolon space -32
+
+KPX space quoteleft -48
+KPX space quotedblleft -65
+KPX space Y -97
+KPX space W -65
+KPX space V -65
+KPX space T -81
+
+KPX v period -65
+KPX v o -24
+KPX v comma -65
+KPX v a -15
+
+KPX w period -32
+KPX w o -15
+KPX w comma -32
+
+KPX x e -7
+
+KPX y period -65
+KPX y o -20
+KPX y e -7
+KPX y comma -65
+KPX y a -24
+
+KPX z e 8
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 160 186 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 160 186 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 160 186 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 160 186 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 160 186 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 160 186 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 176 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 137 186 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 137 186 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 137 186 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 137 186 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -22 186 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -22 186 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -22 186 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -22 186 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 160 186 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 183 186 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 183 186 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 183 186 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 183 186 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 183 186 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 137 186 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 160 186 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 160 186 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 160 186 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 160 186 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 137 186 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 137 186 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 114 186 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 92 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 92 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 92 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 92 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 92 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 92 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 108 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 92 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 92 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 92 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -22 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -22 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -22 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -22 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 114 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 114 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 114 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 114 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 114 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 114 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 92 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 114 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 114 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 114 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 114 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 92 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 92 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 69 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvbo8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvbo8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b6cff415fd0cf51bded4747ecb5570f6054ac938
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvbo8a.afm
@@ -0,0 +1,570 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu Mar 15 10:44:33 1990
+Comment UniqueID 28371
+Comment VMusage 7614 43068
+FontName Helvetica-BoldOblique
+FullName Helvetica Bold Oblique
+FamilyName Helvetica
+Weight Bold
+ItalicAngle -12
+IsFixedPitch false
+FontBBox -174 -228 1114 962
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 532
+Ascender 718
+Descender -207
+StartCharMetrics 228
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 94 0 397 718 ;
+C 34 ; WX 474 ; N quotedbl ; B 193 447 529 718 ;
+C 35 ; WX 556 ; N numbersign ; B 60 0 644 698 ;
+C 36 ; WX 556 ; N dollar ; B 67 -115 622 775 ;
+C 37 ; WX 889 ; N percent ; B 136 -19 901 710 ;
+C 38 ; WX 722 ; N ampersand ; B 89 -19 732 718 ;
+C 39 ; WX 278 ; N quoteright ; B 167 445 362 718 ;
+C 40 ; WX 333 ; N parenleft ; B 76 -208 470 734 ;
+C 41 ; WX 333 ; N parenright ; B -25 -208 369 734 ;
+C 42 ; WX 389 ; N asterisk ; B 146 387 481 718 ;
+C 43 ; WX 584 ; N plus ; B 82 0 610 506 ;
+C 44 ; WX 278 ; N comma ; B 28 -168 245 146 ;
+C 45 ; WX 333 ; N hyphen ; B 73 215 379 345 ;
+C 46 ; WX 278 ; N period ; B 64 0 245 146 ;
+C 47 ; WX 278 ; N slash ; B -37 -19 468 737 ;
+C 48 ; WX 556 ; N zero ; B 86 -19 617 710 ;
+C 49 ; WX 556 ; N one ; B 173 0 529 710 ;
+C 50 ; WX 556 ; N two ; B 26 0 619 710 ;
+C 51 ; WX 556 ; N three ; B 65 -19 608 710 ;
+C 52 ; WX 556 ; N four ; B 60 0 598 710 ;
+C 53 ; WX 556 ; N five ; B 64 -19 636 698 ;
+C 54 ; WX 556 ; N six ; B 85 -19 619 710 ;
+C 55 ; WX 556 ; N seven ; B 125 0 676 698 ;
+C 56 ; WX 556 ; N eight ; B 69 -19 616 710 ;
+C 57 ; WX 556 ; N nine ; B 78 -19 615 710 ;
+C 58 ; WX 333 ; N colon ; B 92 0 351 512 ;
+C 59 ; WX 333 ; N semicolon ; B 56 -168 351 512 ;
+C 60 ; WX 584 ; N less ; B 82 -8 655 514 ;
+C 61 ; WX 584 ; N equal ; B 58 87 633 419 ;
+C 62 ; WX 584 ; N greater ; B 36 -8 609 514 ;
+C 63 ; WX 611 ; N question ; B 165 0 671 727 ;
+C 64 ; WX 975 ; N at ; B 186 -19 954 737 ;
+C 65 ; WX 722 ; N A ; B 20 0 702 718 ;
+C 66 ; WX 722 ; N B ; B 76 0 764 718 ;
+C 67 ; WX 722 ; N C ; B 107 -19 789 737 ;
+C 68 ; WX 722 ; N D ; B 76 0 777 718 ;
+C 69 ; WX 667 ; N E ; B 76 0 757 718 ;
+C 70 ; WX 611 ; N F ; B 76 0 740 718 ;
+C 71 ; WX 778 ; N G ; B 108 -19 817 737 ;
+C 72 ; WX 722 ; N H ; B 71 0 804 718 ;
+C 73 ; WX 278 ; N I ; B 64 0 367 718 ;
+C 74 ; WX 556 ; N J ; B 60 -18 637 718 ;
+C 75 ; WX 722 ; N K ; B 87 0 858 718 ;
+C 76 ; WX 611 ; N L ; B 76 0 611 718 ;
+C 77 ; WX 833 ; N M ; B 69 0 918 718 ;
+C 78 ; WX 722 ; N N ; B 69 0 807 718 ;
+C 79 ; WX 778 ; N O ; B 107 -19 823 737 ;
+C 80 ; WX 667 ; N P ; B 76 0 738 718 ;
+C 81 ; WX 778 ; N Q ; B 107 -52 823 737 ;
+C 82 ; WX 722 ; N R ; B 76 0 778 718 ;
+C 83 ; WX 667 ; N S ; B 81 -19 718 737 ;
+C 84 ; WX 611 ; N T ; B 140 0 751 718 ;
+C 85 ; WX 722 ; N U ; B 116 -19 804 718 ;
+C 86 ; WX 667 ; N V ; B 172 0 801 718 ;
+C 87 ; WX 944 ; N W ; B 169 0 1082 718 ;
+C 88 ; WX 667 ; N X ; B 14 0 791 718 ;
+C 89 ; WX 667 ; N Y ; B 168 0 806 718 ;
+C 90 ; WX 611 ; N Z ; B 25 0 737 718 ;
+C 91 ; WX 333 ; N bracketleft ; B 21 -196 462 722 ;
+C 92 ; WX 278 ; N backslash ; B 124 -19 307 737 ;
+C 93 ; WX 333 ; N bracketright ; B -18 -196 423 722 ;
+C 94 ; WX 584 ; N asciicircum ; B 131 323 591 698 ;
+C 95 ; WX 556 ; N underscore ; B -27 -125 540 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 165 454 361 727 ;
+C 97 ; WX 556 ; N a ; B 55 -14 583 546 ;
+C 98 ; WX 611 ; N b ; B 61 -14 645 718 ;
+C 99 ; WX 556 ; N c ; B 79 -14 599 546 ;
+C 100 ; WX 611 ; N d ; B 82 -14 704 718 ;
+C 101 ; WX 556 ; N e ; B 70 -14 593 546 ;
+C 102 ; WX 333 ; N f ; B 87 0 469 727 ; L i fi ; L l fl ;
+C 103 ; WX 611 ; N g ; B 38 -217 666 546 ;
+C 104 ; WX 611 ; N h ; B 65 0 629 718 ;
+C 105 ; WX 278 ; N i ; B 69 0 363 725 ;
+C 106 ; WX 278 ; N j ; B -42 -214 363 725 ;
+C 107 ; WX 556 ; N k ; B 69 0 670 718 ;
+C 108 ; WX 278 ; N l ; B 69 0 362 718 ;
+C 109 ; WX 889 ; N m ; B 64 0 909 546 ;
+C 110 ; WX 611 ; N n ; B 65 0 629 546 ;
+C 111 ; WX 611 ; N o ; B 82 -14 643 546 ;
+C 112 ; WX 611 ; N p ; B 18 -207 645 546 ;
+C 113 ; WX 611 ; N q ; B 80 -207 665 546 ;
+C 114 ; WX 389 ; N r ; B 64 0 489 546 ;
+C 115 ; WX 556 ; N s ; B 63 -14 584 546 ;
+C 116 ; WX 333 ; N t ; B 100 -6 422 676 ;
+C 117 ; WX 611 ; N u ; B 98 -14 658 532 ;
+C 118 ; WX 556 ; N v ; B 126 0 656 532 ;
+C 119 ; WX 778 ; N w ; B 123 0 882 532 ;
+C 120 ; WX 556 ; N x ; B 15 0 648 532 ;
+C 121 ; WX 556 ; N y ; B 42 -214 652 532 ;
+C 122 ; WX 500 ; N z ; B 20 0 583 532 ;
+C 123 ; WX 389 ; N braceleft ; B 94 -196 518 722 ;
+C 124 ; WX 280 ; N bar ; B 80 -19 353 737 ;
+C 125 ; WX 389 ; N braceright ; B -18 -196 407 722 ;
+C 126 ; WX 584 ; N asciitilde ; B 115 163 577 343 ;
+C 161 ; WX 333 ; N exclamdown ; B 50 -186 353 532 ;
+C 162 ; WX 556 ; N cent ; B 79 -118 599 628 ;
+C 163 ; WX 556 ; N sterling ; B 50 -16 635 718 ;
+C 164 ; WX 167 ; N fraction ; B -174 -19 487 710 ;
+C 165 ; WX 556 ; N yen ; B 60 0 713 698 ;
+C 166 ; WX 556 ; N florin ; B -50 -210 669 737 ;
+C 167 ; WX 556 ; N section ; B 61 -184 598 727 ;
+C 168 ; WX 556 ; N currency ; B 27 76 680 636 ;
+C 169 ; WX 238 ; N quotesingle ; B 165 447 321 718 ;
+C 170 ; WX 500 ; N quotedblleft ; B 160 454 588 727 ;
+C 171 ; WX 556 ; N guillemotleft ; B 135 76 571 484 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 130 76 353 484 ;
+C 173 ; WX 333 ; N guilsinglright ; B 99 76 322 484 ;
+C 174 ; WX 611 ; N fi ; B 87 0 696 727 ;
+C 175 ; WX 611 ; N fl ; B 87 0 695 727 ;
+C 177 ; WX 556 ; N endash ; B 48 227 627 333 ;
+C 178 ; WX 556 ; N dagger ; B 118 -171 626 718 ;
+C 179 ; WX 556 ; N daggerdbl ; B 46 -171 628 718 ;
+C 180 ; WX 278 ; N periodcentered ; B 110 172 276 334 ;
+C 182 ; WX 556 ; N paragraph ; B 98 -191 688 700 ;
+C 183 ; WX 350 ; N bullet ; B 83 194 420 524 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 41 -146 236 127 ;
+C 185 ; WX 500 ; N quotedblbase ; B 36 -146 463 127 ;
+C 186 ; WX 500 ; N quotedblright ; B 162 445 589 718 ;
+C 187 ; WX 556 ; N guillemotright ; B 104 76 540 484 ;
+C 188 ; WX 1000 ; N ellipsis ; B 92 0 939 146 ;
+C 189 ; WX 1000 ; N perthousand ; B 76 -19 1038 710 ;
+C 191 ; WX 611 ; N questiondown ; B 53 -195 559 532 ;
+C 193 ; WX 333 ; N grave ; B 136 604 353 750 ;
+C 194 ; WX 333 ; N acute ; B 236 604 515 750 ;
+C 195 ; WX 333 ; N circumflex ; B 118 604 471 750 ;
+C 196 ; WX 333 ; N tilde ; B 113 610 507 737 ;
+C 197 ; WX 333 ; N macron ; B 122 604 483 678 ;
+C 198 ; WX 333 ; N breve ; B 156 604 494 750 ;
+C 199 ; WX 333 ; N dotaccent ; B 235 614 385 729 ;
+C 200 ; WX 333 ; N dieresis ; B 137 614 482 729 ;
+C 202 ; WX 333 ; N ring ; B 200 568 420 776 ;
+C 203 ; WX 333 ; N cedilla ; B -37 -228 220 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 137 604 645 750 ;
+C 206 ; WX 333 ; N ogonek ; B 41 -228 264 0 ;
+C 207 ; WX 333 ; N caron ; B 149 604 502 750 ;
+C 208 ; WX 1000 ; N emdash ; B 48 227 1071 333 ;
+C 225 ; WX 1000 ; N AE ; B 5 0 1100 718 ;
+C 227 ; WX 370 ; N ordfeminine ; B 92 276 465 737 ;
+C 232 ; WX 611 ; N Lslash ; B 34 0 611 718 ;
+C 233 ; WX 778 ; N Oslash ; B 35 -27 894 745 ;
+C 234 ; WX 1000 ; N OE ; B 99 -19 1114 737 ;
+C 235 ; WX 365 ; N ordmasculine ; B 92 276 485 737 ;
+C 241 ; WX 889 ; N ae ; B 56 -14 923 546 ;
+C 245 ; WX 278 ; N dotlessi ; B 69 0 322 532 ;
+C 248 ; WX 278 ; N lslash ; B 40 0 407 718 ;
+C 249 ; WX 611 ; N oslash ; B 22 -29 701 560 ;
+C 250 ; WX 944 ; N oe ; B 82 -14 977 546 ;
+C 251 ; WX 611 ; N germandbls ; B 69 -14 657 731 ;
+C -1 ; WX 611 ; N Zcaron ; B 25 0 737 936 ;
+C -1 ; WX 556 ; N ccedilla ; B 79 -228 599 546 ;
+C -1 ; WX 556 ; N ydieresis ; B 42 -214 652 729 ;
+C -1 ; WX 556 ; N atilde ; B 55 -14 619 737 ;
+C -1 ; WX 278 ; N icircumflex ; B 69 0 444 750 ;
+C -1 ; WX 333 ; N threesuperior ; B 91 271 441 710 ;
+C -1 ; WX 556 ; N ecircumflex ; B 70 -14 593 750 ;
+C -1 ; WX 611 ; N thorn ; B 18 -208 645 718 ;
+C -1 ; WX 556 ; N egrave ; B 70 -14 593 750 ;
+C -1 ; WX 333 ; N twosuperior ; B 69 283 449 710 ;
+C -1 ; WX 556 ; N eacute ; B 70 -14 627 750 ;
+C -1 ; WX 611 ; N otilde ; B 82 -14 646 737 ;
+C -1 ; WX 722 ; N Aacute ; B 20 0 750 936 ;
+C -1 ; WX 611 ; N ocircumflex ; B 82 -14 643 750 ;
+C -1 ; WX 556 ; N yacute ; B 42 -214 652 750 ;
+C -1 ; WX 611 ; N udieresis ; B 98 -14 658 729 ;
+C -1 ; WX 834 ; N threequarters ; B 99 -19 839 710 ;
+C -1 ; WX 556 ; N acircumflex ; B 55 -14 583 750 ;
+C -1 ; WX 722 ; N Eth ; B 62 0 777 718 ;
+C -1 ; WX 556 ; N edieresis ; B 70 -14 594 729 ;
+C -1 ; WX 611 ; N ugrave ; B 98 -14 658 750 ;
+C -1 ; WX 1000 ; N trademark ; B 179 306 1109 718 ;
+C -1 ; WX 611 ; N ograve ; B 82 -14 643 750 ;
+C -1 ; WX 556 ; N scaron ; B 63 -14 614 750 ;
+C -1 ; WX 278 ; N Idieresis ; B 64 0 494 915 ;
+C -1 ; WX 611 ; N uacute ; B 98 -14 658 750 ;
+C -1 ; WX 556 ; N agrave ; B 55 -14 583 750 ;
+C -1 ; WX 611 ; N ntilde ; B 65 0 646 737 ;
+C -1 ; WX 556 ; N aring ; B 55 -14 583 776 ;
+C -1 ; WX 500 ; N zcaron ; B 20 0 586 750 ;
+C -1 ; WX 278 ; N Icircumflex ; B 64 0 484 936 ;
+C -1 ; WX 722 ; N Ntilde ; B 69 0 807 923 ;
+C -1 ; WX 611 ; N ucircumflex ; B 98 -14 658 750 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 76 0 757 936 ;
+C -1 ; WX 278 ; N Iacute ; B 64 0 528 936 ;
+C -1 ; WX 722 ; N Ccedilla ; B 107 -228 789 737 ;
+C -1 ; WX 778 ; N Odieresis ; B 107 -19 823 915 ;
+C -1 ; WX 667 ; N Scaron ; B 81 -19 718 936 ;
+C -1 ; WX 667 ; N Edieresis ; B 76 0 757 915 ;
+C -1 ; WX 278 ; N Igrave ; B 64 0 367 936 ;
+C -1 ; WX 556 ; N adieresis ; B 55 -14 594 729 ;
+C -1 ; WX 778 ; N Ograve ; B 107 -19 823 936 ;
+C -1 ; WX 667 ; N Egrave ; B 76 0 757 936 ;
+C -1 ; WX 667 ; N Ydieresis ; B 168 0 806 915 ;
+C -1 ; WX 737 ; N registered ; B 55 -19 834 737 ;
+C -1 ; WX 778 ; N Otilde ; B 107 -19 823 923 ;
+C -1 ; WX 834 ; N onequarter ; B 132 -19 806 710 ;
+C -1 ; WX 722 ; N Ugrave ; B 116 -19 804 936 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 116 -19 804 936 ;
+C -1 ; WX 667 ; N Thorn ; B 76 0 716 718 ;
+C -1 ; WX 584 ; N divide ; B 82 -42 610 548 ;
+C -1 ; WX 722 ; N Atilde ; B 20 0 741 923 ;
+C -1 ; WX 722 ; N Uacute ; B 116 -19 804 936 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 107 -19 823 936 ;
+C -1 ; WX 584 ; N logicalnot ; B 105 108 633 419 ;
+C -1 ; WX 722 ; N Aring ; B 20 0 702 962 ;
+C -1 ; WX 278 ; N idieresis ; B 69 0 455 729 ;
+C -1 ; WX 278 ; N iacute ; B 69 0 488 750 ;
+C -1 ; WX 556 ; N aacute ; B 55 -14 627 750 ;
+C -1 ; WX 584 ; N plusminus ; B 40 0 625 506 ;
+C -1 ; WX 584 ; N multiply ; B 57 1 635 505 ;
+C -1 ; WX 722 ; N Udieresis ; B 116 -19 804 915 ;
+C -1 ; WX 584 ; N minus ; B 82 197 610 309 ;
+C -1 ; WX 333 ; N onesuperior ; B 148 283 388 710 ;
+C -1 ; WX 667 ; N Eacute ; B 76 0 757 936 ;
+C -1 ; WX 722 ; N Acircumflex ; B 20 0 706 936 ;
+C -1 ; WX 737 ; N copyright ; B 56 -19 835 737 ;
+C -1 ; WX 722 ; N Agrave ; B 20 0 702 936 ;
+C -1 ; WX 611 ; N odieresis ; B 82 -14 643 729 ;
+C -1 ; WX 611 ; N oacute ; B 82 -14 654 750 ;
+C -1 ; WX 400 ; N degree ; B 175 426 467 712 ;
+C -1 ; WX 278 ; N igrave ; B 69 0 326 750 ;
+C -1 ; WX 611 ; N mu ; B 22 -207 658 532 ;
+C -1 ; WX 778 ; N Oacute ; B 107 -19 823 936 ;
+C -1 ; WX 611 ; N eth ; B 82 -14 670 737 ;
+C -1 ; WX 722 ; N Adieresis ; B 20 0 716 915 ;
+C -1 ; WX 667 ; N Yacute ; B 168 0 806 936 ;
+C -1 ; WX 280 ; N brokenbar ; B 80 -19 353 737 ;
+C -1 ; WX 834 ; N onehalf ; B 132 -19 858 710 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 209
+
+KPX A y -30
+KPX A w -30
+KPX A v -40
+KPX A u -30
+KPX A Y -110
+KPX A W -60
+KPX A V -80
+KPX A U -50
+KPX A T -90
+KPX A Q -40
+KPX A O -40
+KPX A G -50
+KPX A C -40
+
+KPX B U -10
+KPX B A -30
+
+KPX D period -30
+KPX D comma -30
+KPX D Y -70
+KPX D W -40
+KPX D V -40
+KPX D A -40
+
+KPX F period -100
+KPX F comma -100
+KPX F a -20
+KPX F A -80
+
+KPX J u -20
+KPX J period -20
+KPX J comma -20
+KPX J A -20
+
+KPX K y -40
+KPX K u -30
+KPX K o -35
+KPX K e -15
+KPX K O -30
+
+KPX L y -30
+KPX L quoteright -140
+KPX L quotedblright -140
+KPX L Y -120
+KPX L W -80
+KPX L V -110
+KPX L T -90
+
+KPX O period -40
+KPX O comma -40
+KPX O Y -70
+KPX O X -50
+KPX O W -50
+KPX O V -50
+KPX O T -40
+KPX O A -50
+
+KPX P period -120
+KPX P o -40
+KPX P e -30
+KPX P comma -120
+KPX P a -30
+KPX P A -100
+
+KPX Q period 20
+KPX Q comma 20
+KPX Q U -10
+
+KPX R Y -50
+KPX R W -40
+KPX R V -50
+KPX R U -20
+KPX R T -20
+KPX R O -20
+
+KPX T y -60
+KPX T w -60
+KPX T u -90
+KPX T semicolon -40
+KPX T r -80
+KPX T period -80
+KPX T o -80
+KPX T hyphen -120
+KPX T e -60
+KPX T comma -80
+KPX T colon -40
+KPX T a -80
+KPX T O -40
+KPX T A -90
+
+KPX U period -30
+KPX U comma -30
+KPX U A -50
+
+KPX V u -60
+KPX V semicolon -40
+KPX V period -120
+KPX V o -90
+KPX V hyphen -80
+KPX V e -50
+KPX V comma -120
+KPX V colon -40
+KPX V a -60
+KPX V O -50
+KPX V G -50
+KPX V A -80
+
+KPX W y -20
+KPX W u -45
+KPX W semicolon -10
+KPX W period -80
+KPX W o -60
+KPX W hyphen -40
+KPX W e -35
+KPX W comma -80
+KPX W colon -10
+KPX W a -40
+KPX W O -20
+KPX W A -60
+
+KPX Y u -100
+KPX Y semicolon -50
+KPX Y period -100
+KPX Y o -100
+KPX Y e -80
+KPX Y comma -100
+KPX Y colon -50
+KPX Y a -90
+KPX Y O -70
+KPX Y A -110
+
+KPX a y -20
+KPX a w -15
+KPX a v -15
+KPX a g -10
+
+KPX b y -20
+KPX b v -20
+KPX b u -20
+KPX b l -10
+
+KPX c y -10
+KPX c l -20
+KPX c k -20
+KPX c h -10
+
+KPX colon space -40
+
+KPX comma space -40
+KPX comma quoteright -120
+KPX comma quotedblright -120
+
+KPX d y -15
+KPX d w -15
+KPX d v -15
+KPX d d -10
+
+KPX e y -15
+KPX e x -15
+KPX e w -15
+KPX e v -15
+KPX e period 20
+KPX e comma 10
+
+KPX f quoteright 30
+KPX f quotedblright 30
+KPX f period -10
+KPX f o -20
+KPX f e -10
+KPX f comma -10
+
+KPX g g -10
+KPX g e 10
+
+KPX h y -20
+
+KPX k o -15
+
+KPX l y -15
+KPX l w -15
+
+KPX m y -30
+KPX m u -20
+
+KPX n y -20
+KPX n v -40
+KPX n u -10
+
+KPX o y -20
+KPX o x -30
+KPX o w -15
+KPX o v -20
+
+KPX p y -15
+
+KPX period space -40
+KPX period quoteright -120
+KPX period quotedblright -120
+
+KPX quotedblright space -80
+
+KPX quoteleft quoteleft -46
+
+KPX quoteright v -20
+KPX quoteright space -80
+KPX quoteright s -60
+KPX quoteright r -40
+KPX quoteright quoteright -46
+KPX quoteright l -20
+KPX quoteright d -80
+
+KPX r y 10
+KPX r v 10
+KPX r t 20
+KPX r s -15
+KPX r q -20
+KPX r period -60
+KPX r o -20
+KPX r hyphen -20
+KPX r g -15
+KPX r d -20
+KPX r comma -60
+KPX r c -20
+
+KPX s w -15
+
+KPX semicolon space -40
+
+KPX space quoteleft -60
+KPX space quotedblleft -80
+KPX space Y -120
+KPX space W -80
+KPX space V -80
+KPX space T -100
+
+KPX v period -80
+KPX v o -30
+KPX v comma -80
+KPX v a -20
+
+KPX w period -40
+KPX w o -20
+KPX w comma -40
+
+KPX x e -10
+
+KPX y period -80
+KPX y o -25
+KPX y e -10
+KPX y comma -80
+KPX y a -30
+
+KPX z e 10
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 235 186 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 235 186 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 235 186 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 235 186 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 235 186 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 235 186 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 215 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 207 186 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 207 186 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 207 186 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 207 186 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 13 186 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 13 186 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 13 186 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 13 186 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 235 186 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 263 186 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 263 186 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 263 186 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 263 186 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 263 186 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 207 186 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 235 186 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 235 186 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 235 186 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 235 186 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 207 186 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 207 186 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 179 186 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 112 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 112 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 132 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 112 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 112 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 112 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 112 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 139 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 139 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 139 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 139 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 112 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 139 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 139 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 112 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 112 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvbo8an.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvbo8an.afm
new file mode 100644
index 0000000000000000000000000000000000000000..1a3800194d518afce782a07dca6fe0e900cf1799
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvbo8an.afm
@@ -0,0 +1,570 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu Mar 15 12:08:57 1990
+Comment UniqueID 28407
+Comment VMusage 7614 43068
+FontName Helvetica-Narrow-BoldOblique
+FullName Helvetica Narrow Bold Oblique
+FamilyName Helvetica
+Weight Bold
+ItalicAngle -12
+IsFixedPitch false
+FontBBox -143 -228 913 962
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 532
+Ascender 718
+Descender -207
+StartCharMetrics 228
+C 32 ; WX 228 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 273 ; N exclam ; B 77 0 325 718 ;
+C 34 ; WX 389 ; N quotedbl ; B 158 447 433 718 ;
+C 35 ; WX 456 ; N numbersign ; B 49 0 528 698 ;
+C 36 ; WX 456 ; N dollar ; B 55 -115 510 775 ;
+C 37 ; WX 729 ; N percent ; B 112 -19 739 710 ;
+C 38 ; WX 592 ; N ampersand ; B 73 -19 600 718 ;
+C 39 ; WX 228 ; N quoteright ; B 137 445 297 718 ;
+C 40 ; WX 273 ; N parenleft ; B 62 -208 385 734 ;
+C 41 ; WX 273 ; N parenright ; B -21 -208 302 734 ;
+C 42 ; WX 319 ; N asterisk ; B 120 387 394 718 ;
+C 43 ; WX 479 ; N plus ; B 67 0 500 506 ;
+C 44 ; WX 228 ; N comma ; B 23 -168 201 146 ;
+C 45 ; WX 273 ; N hyphen ; B 60 215 311 345 ;
+C 46 ; WX 228 ; N period ; B 52 0 201 146 ;
+C 47 ; WX 228 ; N slash ; B -30 -19 383 737 ;
+C 48 ; WX 456 ; N zero ; B 71 -19 506 710 ;
+C 49 ; WX 456 ; N one ; B 142 0 434 710 ;
+C 50 ; WX 456 ; N two ; B 21 0 508 710 ;
+C 51 ; WX 456 ; N three ; B 54 -19 499 710 ;
+C 52 ; WX 456 ; N four ; B 50 0 490 710 ;
+C 53 ; WX 456 ; N five ; B 53 -19 522 698 ;
+C 54 ; WX 456 ; N six ; B 70 -19 507 710 ;
+C 55 ; WX 456 ; N seven ; B 102 0 555 698 ;
+C 56 ; WX 456 ; N eight ; B 57 -19 505 710 ;
+C 57 ; WX 456 ; N nine ; B 64 -19 504 710 ;
+C 58 ; WX 273 ; N colon ; B 75 0 288 512 ;
+C 59 ; WX 273 ; N semicolon ; B 46 -168 288 512 ;
+C 60 ; WX 479 ; N less ; B 67 -8 537 514 ;
+C 61 ; WX 479 ; N equal ; B 48 87 519 419 ;
+C 62 ; WX 479 ; N greater ; B 30 -8 500 514 ;
+C 63 ; WX 501 ; N question ; B 135 0 550 727 ;
+C 64 ; WX 800 ; N at ; B 152 -19 782 737 ;
+C 65 ; WX 592 ; N A ; B 16 0 576 718 ;
+C 66 ; WX 592 ; N B ; B 62 0 626 718 ;
+C 67 ; WX 592 ; N C ; B 88 -19 647 737 ;
+C 68 ; WX 592 ; N D ; B 62 0 637 718 ;
+C 69 ; WX 547 ; N E ; B 62 0 620 718 ;
+C 70 ; WX 501 ; N F ; B 62 0 606 718 ;
+C 71 ; WX 638 ; N G ; B 89 -19 670 737 ;
+C 72 ; WX 592 ; N H ; B 58 0 659 718 ;
+C 73 ; WX 228 ; N I ; B 52 0 301 718 ;
+C 74 ; WX 456 ; N J ; B 49 -18 522 718 ;
+C 75 ; WX 592 ; N K ; B 71 0 703 718 ;
+C 76 ; WX 501 ; N L ; B 62 0 501 718 ;
+C 77 ; WX 683 ; N M ; B 57 0 752 718 ;
+C 78 ; WX 592 ; N N ; B 57 0 661 718 ;
+C 79 ; WX 638 ; N O ; B 88 -19 675 737 ;
+C 80 ; WX 547 ; N P ; B 62 0 605 718 ;
+C 81 ; WX 638 ; N Q ; B 88 -52 675 737 ;
+C 82 ; WX 592 ; N R ; B 62 0 638 718 ;
+C 83 ; WX 547 ; N S ; B 66 -19 588 737 ;
+C 84 ; WX 501 ; N T ; B 114 0 615 718 ;
+C 85 ; WX 592 ; N U ; B 96 -19 659 718 ;
+C 86 ; WX 547 ; N V ; B 141 0 656 718 ;
+C 87 ; WX 774 ; N W ; B 138 0 887 718 ;
+C 88 ; WX 547 ; N X ; B 11 0 648 718 ;
+C 89 ; WX 547 ; N Y ; B 137 0 661 718 ;
+C 90 ; WX 501 ; N Z ; B 20 0 604 718 ;
+C 91 ; WX 273 ; N bracketleft ; B 17 -196 379 722 ;
+C 92 ; WX 228 ; N backslash ; B 101 -19 252 737 ;
+C 93 ; WX 273 ; N bracketright ; B -14 -196 347 722 ;
+C 94 ; WX 479 ; N asciicircum ; B 107 323 484 698 ;
+C 95 ; WX 456 ; N underscore ; B -22 -125 443 -75 ;
+C 96 ; WX 228 ; N quoteleft ; B 136 454 296 727 ;
+C 97 ; WX 456 ; N a ; B 45 -14 478 546 ;
+C 98 ; WX 501 ; N b ; B 50 -14 529 718 ;
+C 99 ; WX 456 ; N c ; B 65 -14 491 546 ;
+C 100 ; WX 501 ; N d ; B 67 -14 577 718 ;
+C 101 ; WX 456 ; N e ; B 58 -14 486 546 ;
+C 102 ; WX 273 ; N f ; B 71 0 385 727 ; L i fi ; L l fl ;
+C 103 ; WX 501 ; N g ; B 31 -217 546 546 ;
+C 104 ; WX 501 ; N h ; B 53 0 516 718 ;
+C 105 ; WX 228 ; N i ; B 57 0 298 725 ;
+C 106 ; WX 228 ; N j ; B -35 -214 298 725 ;
+C 107 ; WX 456 ; N k ; B 57 0 549 718 ;
+C 108 ; WX 228 ; N l ; B 57 0 297 718 ;
+C 109 ; WX 729 ; N m ; B 52 0 746 546 ;
+C 110 ; WX 501 ; N n ; B 53 0 516 546 ;
+C 111 ; WX 501 ; N o ; B 67 -14 527 546 ;
+C 112 ; WX 501 ; N p ; B 15 -207 529 546 ;
+C 113 ; WX 501 ; N q ; B 66 -207 545 546 ;
+C 114 ; WX 319 ; N r ; B 52 0 401 546 ;
+C 115 ; WX 456 ; N s ; B 52 -14 479 546 ;
+C 116 ; WX 273 ; N t ; B 82 -6 346 676 ;
+C 117 ; WX 501 ; N u ; B 80 -14 540 532 ;
+C 118 ; WX 456 ; N v ; B 103 0 538 532 ;
+C 119 ; WX 638 ; N w ; B 101 0 723 532 ;
+C 120 ; WX 456 ; N x ; B 12 0 531 532 ;
+C 121 ; WX 456 ; N y ; B 34 -214 535 532 ;
+C 122 ; WX 410 ; N z ; B 16 0 478 532 ;
+C 123 ; WX 319 ; N braceleft ; B 77 -196 425 722 ;
+C 124 ; WX 230 ; N bar ; B 66 -19 289 737 ;
+C 125 ; WX 319 ; N braceright ; B -14 -196 333 722 ;
+C 126 ; WX 479 ; N asciitilde ; B 94 163 473 343 ;
+C 161 ; WX 273 ; N exclamdown ; B 41 -186 290 532 ;
+C 162 ; WX 456 ; N cent ; B 65 -118 491 628 ;
+C 163 ; WX 456 ; N sterling ; B 41 -16 520 718 ;
+C 164 ; WX 137 ; N fraction ; B -143 -19 399 710 ;
+C 165 ; WX 456 ; N yen ; B 49 0 585 698 ;
+C 166 ; WX 456 ; N florin ; B -41 -210 548 737 ;
+C 167 ; WX 456 ; N section ; B 50 -184 491 727 ;
+C 168 ; WX 456 ; N currency ; B 22 76 558 636 ;
+C 169 ; WX 195 ; N quotesingle ; B 135 447 263 718 ;
+C 170 ; WX 410 ; N quotedblleft ; B 132 454 482 727 ;
+C 171 ; WX 456 ; N guillemotleft ; B 111 76 468 484 ;
+C 172 ; WX 273 ; N guilsinglleft ; B 106 76 289 484 ;
+C 173 ; WX 273 ; N guilsinglright ; B 81 76 264 484 ;
+C 174 ; WX 501 ; N fi ; B 71 0 571 727 ;
+C 175 ; WX 501 ; N fl ; B 71 0 570 727 ;
+C 177 ; WX 456 ; N endash ; B 40 227 514 333 ;
+C 178 ; WX 456 ; N dagger ; B 97 -171 513 718 ;
+C 179 ; WX 456 ; N daggerdbl ; B 38 -171 515 718 ;
+C 180 ; WX 228 ; N periodcentered ; B 90 172 226 334 ;
+C 182 ; WX 456 ; N paragraph ; B 80 -191 564 700 ;
+C 183 ; WX 287 ; N bullet ; B 68 194 345 524 ;
+C 184 ; WX 228 ; N quotesinglbase ; B 34 -146 194 127 ;
+C 185 ; WX 410 ; N quotedblbase ; B 29 -146 380 127 ;
+C 186 ; WX 410 ; N quotedblright ; B 132 445 483 718 ;
+C 187 ; WX 456 ; N guillemotright ; B 85 76 443 484 ;
+C 188 ; WX 820 ; N ellipsis ; B 75 0 770 146 ;
+C 189 ; WX 820 ; N perthousand ; B 62 -19 851 710 ;
+C 191 ; WX 501 ; N questiondown ; B 44 -195 459 532 ;
+C 193 ; WX 273 ; N grave ; B 112 604 290 750 ;
+C 194 ; WX 273 ; N acute ; B 194 604 423 750 ;
+C 195 ; WX 273 ; N circumflex ; B 97 604 387 750 ;
+C 196 ; WX 273 ; N tilde ; B 92 610 415 737 ;
+C 197 ; WX 273 ; N macron ; B 100 604 396 678 ;
+C 198 ; WX 273 ; N breve ; B 128 604 405 750 ;
+C 199 ; WX 273 ; N dotaccent ; B 192 614 316 729 ;
+C 200 ; WX 273 ; N dieresis ; B 112 614 395 729 ;
+C 202 ; WX 273 ; N ring ; B 164 568 344 776 ;
+C 203 ; WX 273 ; N cedilla ; B -30 -228 180 0 ;
+C 205 ; WX 273 ; N hungarumlaut ; B 113 604 529 750 ;
+C 206 ; WX 273 ; N ogonek ; B 33 -228 216 0 ;
+C 207 ; WX 273 ; N caron ; B 123 604 412 750 ;
+C 208 ; WX 820 ; N emdash ; B 40 227 878 333 ;
+C 225 ; WX 820 ; N AE ; B 4 0 902 718 ;
+C 227 ; WX 303 ; N ordfeminine ; B 75 276 381 737 ;
+C 232 ; WX 501 ; N Lslash ; B 28 0 501 718 ;
+C 233 ; WX 638 ; N Oslash ; B 29 -27 733 745 ;
+C 234 ; WX 820 ; N OE ; B 81 -19 913 737 ;
+C 235 ; WX 299 ; N ordmasculine ; B 75 276 398 737 ;
+C 241 ; WX 729 ; N ae ; B 46 -14 757 546 ;
+C 245 ; WX 228 ; N dotlessi ; B 57 0 264 532 ;
+C 248 ; WX 228 ; N lslash ; B 33 0 334 718 ;
+C 249 ; WX 501 ; N oslash ; B 18 -29 575 560 ;
+C 250 ; WX 774 ; N oe ; B 67 -14 801 546 ;
+C 251 ; WX 501 ; N germandbls ; B 57 -14 539 731 ;
+C -1 ; WX 501 ; N Zcaron ; B 20 0 604 936 ;
+C -1 ; WX 456 ; N ccedilla ; B 65 -228 491 546 ;
+C -1 ; WX 456 ; N ydieresis ; B 34 -214 535 729 ;
+C -1 ; WX 456 ; N atilde ; B 45 -14 507 737 ;
+C -1 ; WX 228 ; N icircumflex ; B 57 0 364 750 ;
+C -1 ; WX 273 ; N threesuperior ; B 75 271 361 710 ;
+C -1 ; WX 456 ; N ecircumflex ; B 58 -14 486 750 ;
+C -1 ; WX 501 ; N thorn ; B 15 -208 529 718 ;
+C -1 ; WX 456 ; N egrave ; B 58 -14 486 750 ;
+C -1 ; WX 273 ; N twosuperior ; B 57 283 368 710 ;
+C -1 ; WX 456 ; N eacute ; B 58 -14 514 750 ;
+C -1 ; WX 501 ; N otilde ; B 67 -14 529 737 ;
+C -1 ; WX 592 ; N Aacute ; B 16 0 615 936 ;
+C -1 ; WX 501 ; N ocircumflex ; B 67 -14 527 750 ;
+C -1 ; WX 456 ; N yacute ; B 34 -214 535 750 ;
+C -1 ; WX 501 ; N udieresis ; B 80 -14 540 729 ;
+C -1 ; WX 684 ; N threequarters ; B 82 -19 688 710 ;
+C -1 ; WX 456 ; N acircumflex ; B 45 -14 478 750 ;
+C -1 ; WX 592 ; N Eth ; B 51 0 637 718 ;
+C -1 ; WX 456 ; N edieresis ; B 58 -14 487 729 ;
+C -1 ; WX 501 ; N ugrave ; B 80 -14 540 750 ;
+C -1 ; WX 820 ; N trademark ; B 146 306 909 718 ;
+C -1 ; WX 501 ; N ograve ; B 67 -14 527 750 ;
+C -1 ; WX 456 ; N scaron ; B 52 -14 504 750 ;
+C -1 ; WX 228 ; N Idieresis ; B 52 0 405 915 ;
+C -1 ; WX 501 ; N uacute ; B 80 -14 540 750 ;
+C -1 ; WX 456 ; N agrave ; B 45 -14 478 750 ;
+C -1 ; WX 501 ; N ntilde ; B 53 0 529 737 ;
+C -1 ; WX 456 ; N aring ; B 45 -14 478 776 ;
+C -1 ; WX 410 ; N zcaron ; B 16 0 481 750 ;
+C -1 ; WX 228 ; N Icircumflex ; B 52 0 397 936 ;
+C -1 ; WX 592 ; N Ntilde ; B 57 0 661 923 ;
+C -1 ; WX 501 ; N ucircumflex ; B 80 -14 540 750 ;
+C -1 ; WX 547 ; N Ecircumflex ; B 62 0 620 936 ;
+C -1 ; WX 228 ; N Iacute ; B 52 0 433 936 ;
+C -1 ; WX 592 ; N Ccedilla ; B 88 -228 647 737 ;
+C -1 ; WX 638 ; N Odieresis ; B 88 -19 675 915 ;
+C -1 ; WX 547 ; N Scaron ; B 66 -19 588 936 ;
+C -1 ; WX 547 ; N Edieresis ; B 62 0 620 915 ;
+C -1 ; WX 228 ; N Igrave ; B 52 0 301 936 ;
+C -1 ; WX 456 ; N adieresis ; B 45 -14 487 729 ;
+C -1 ; WX 638 ; N Ograve ; B 88 -19 675 936 ;
+C -1 ; WX 547 ; N Egrave ; B 62 0 620 936 ;
+C -1 ; WX 547 ; N Ydieresis ; B 137 0 661 915 ;
+C -1 ; WX 604 ; N registered ; B 45 -19 684 737 ;
+C -1 ; WX 638 ; N Otilde ; B 88 -19 675 923 ;
+C -1 ; WX 684 ; N onequarter ; B 108 -19 661 710 ;
+C -1 ; WX 592 ; N Ugrave ; B 96 -19 659 936 ;
+C -1 ; WX 592 ; N Ucircumflex ; B 96 -19 659 936 ;
+C -1 ; WX 547 ; N Thorn ; B 62 0 588 718 ;
+C -1 ; WX 479 ; N divide ; B 67 -42 500 548 ;
+C -1 ; WX 592 ; N Atilde ; B 16 0 608 923 ;
+C -1 ; WX 592 ; N Uacute ; B 96 -19 659 936 ;
+C -1 ; WX 638 ; N Ocircumflex ; B 88 -19 675 936 ;
+C -1 ; WX 479 ; N logicalnot ; B 86 108 519 419 ;
+C -1 ; WX 592 ; N Aring ; B 16 0 576 962 ;
+C -1 ; WX 228 ; N idieresis ; B 57 0 373 729 ;
+C -1 ; WX 228 ; N iacute ; B 57 0 400 750 ;
+C -1 ; WX 456 ; N aacute ; B 45 -14 514 750 ;
+C -1 ; WX 479 ; N plusminus ; B 33 0 512 506 ;
+C -1 ; WX 479 ; N multiply ; B 47 1 520 505 ;
+C -1 ; WX 592 ; N Udieresis ; B 96 -19 659 915 ;
+C -1 ; WX 479 ; N minus ; B 67 197 500 309 ;
+C -1 ; WX 273 ; N onesuperior ; B 121 283 318 710 ;
+C -1 ; WX 547 ; N Eacute ; B 62 0 620 936 ;
+C -1 ; WX 592 ; N Acircumflex ; B 16 0 579 936 ;
+C -1 ; WX 604 ; N copyright ; B 46 -19 685 737 ;
+C -1 ; WX 592 ; N Agrave ; B 16 0 576 936 ;
+C -1 ; WX 501 ; N odieresis ; B 67 -14 527 729 ;
+C -1 ; WX 501 ; N oacute ; B 67 -14 537 750 ;
+C -1 ; WX 328 ; N degree ; B 143 426 383 712 ;
+C -1 ; WX 228 ; N igrave ; B 57 0 268 750 ;
+C -1 ; WX 501 ; N mu ; B 18 -207 540 532 ;
+C -1 ; WX 638 ; N Oacute ; B 88 -19 675 936 ;
+C -1 ; WX 501 ; N eth ; B 67 -14 549 737 ;
+C -1 ; WX 592 ; N Adieresis ; B 16 0 588 915 ;
+C -1 ; WX 547 ; N Yacute ; B 137 0 661 936 ;
+C -1 ; WX 230 ; N brokenbar ; B 66 -19 289 737 ;
+C -1 ; WX 684 ; N onehalf ; B 108 -19 704 710 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 209
+
+KPX A y -30
+KPX A w -30
+KPX A v -40
+KPX A u -30
+KPX A Y -110
+KPX A W -60
+KPX A V -80
+KPX A U -50
+KPX A T -90
+KPX A Q -40
+KPX A O -40
+KPX A G -50
+KPX A C -40
+
+KPX B U -10
+KPX B A -30
+
+KPX D period -30
+KPX D comma -30
+KPX D Y -70
+KPX D W -40
+KPX D V -40
+KPX D A -40
+
+KPX F period -100
+KPX F comma -100
+KPX F a -20
+KPX F A -80
+
+KPX J u -20
+KPX J period -20
+KPX J comma -20
+KPX J A -20
+
+KPX K y -40
+KPX K u -30
+KPX K o -35
+KPX K e -15
+KPX K O -30
+
+KPX L y -30
+KPX L quoteright -140
+KPX L quotedblright -140
+KPX L Y -120
+KPX L W -80
+KPX L V -110
+KPX L T -90
+
+KPX O period -40
+KPX O comma -40
+KPX O Y -70
+KPX O X -50
+KPX O W -50
+KPX O V -50
+KPX O T -40
+KPX O A -50
+
+KPX P period -120
+KPX P o -40
+KPX P e -30
+KPX P comma -120
+KPX P a -30
+KPX P A -100
+
+KPX Q period 20
+KPX Q comma 20
+KPX Q U -10
+
+KPX R Y -50
+KPX R W -40
+KPX R V -50
+KPX R U -20
+KPX R T -20
+KPX R O -20
+
+KPX T y -60
+KPX T w -60
+KPX T u -90
+KPX T semicolon -40
+KPX T r -80
+KPX T period -80
+KPX T o -80
+KPX T hyphen -120
+KPX T e -60
+KPX T comma -80
+KPX T colon -40
+KPX T a -80
+KPX T O -40
+KPX T A -90
+
+KPX U period -30
+KPX U comma -30
+KPX U A -50
+
+KPX V u -60
+KPX V semicolon -40
+KPX V period -120
+KPX V o -90
+KPX V hyphen -80
+KPX V e -50
+KPX V comma -120
+KPX V colon -40
+KPX V a -60
+KPX V O -50
+KPX V G -50
+KPX V A -80
+
+KPX W y -20
+KPX W u -45
+KPX W semicolon -10
+KPX W period -80
+KPX W o -60
+KPX W hyphen -40
+KPX W e -35
+KPX W comma -80
+KPX W colon -10
+KPX W a -40
+KPX W O -20
+KPX W A -60
+
+KPX Y u -100
+KPX Y semicolon -50
+KPX Y period -100
+KPX Y o -100
+KPX Y e -80
+KPX Y comma -100
+KPX Y colon -50
+KPX Y a -90
+KPX Y O -70
+KPX Y A -110
+
+KPX a y -20
+KPX a w -15
+KPX a v -15
+KPX a g -10
+
+KPX b y -20
+KPX b v -20
+KPX b u -20
+KPX b l -10
+
+KPX c y -10
+KPX c l -20
+KPX c k -20
+KPX c h -10
+
+KPX colon space -40
+
+KPX comma space -40
+KPX comma quoteright -120
+KPX comma quotedblright -120
+
+KPX d y -15
+KPX d w -15
+KPX d v -15
+KPX d d -10
+
+KPX e y -15
+KPX e x -15
+KPX e w -15
+KPX e v -15
+KPX e period 20
+KPX e comma 10
+
+KPX f quoteright 30
+KPX f quotedblright 30
+KPX f period -10
+KPX f o -20
+KPX f e -10
+KPX f comma -10
+
+KPX g g -10
+KPX g e 10
+
+KPX h y -20
+
+KPX k o -15
+
+KPX l y -15
+KPX l w -15
+
+KPX m y -30
+KPX m u -20
+
+KPX n y -20
+KPX n v -40
+KPX n u -10
+
+KPX o y -20
+KPX o x -30
+KPX o w -15
+KPX o v -20
+
+KPX p y -15
+
+KPX period space -40
+KPX period quoteright -120
+KPX period quotedblright -120
+
+KPX quotedblright space -80
+
+KPX quoteleft quoteleft -46
+
+KPX quoteright v -20
+KPX quoteright space -80
+KPX quoteright s -60
+KPX quoteright r -40
+KPX quoteright quoteright -46
+KPX quoteright l -20
+KPX quoteright d -80
+
+KPX r y 10
+KPX r v 10
+KPX r t 20
+KPX r s -15
+KPX r q -20
+KPX r period -60
+KPX r o -20
+KPX r hyphen -20
+KPX r g -15
+KPX r d -20
+KPX r comma -60
+KPX r c -20
+
+KPX s w -15
+
+KPX semicolon space -40
+
+KPX space quoteleft -60
+KPX space quotedblleft -80
+KPX space Y -120
+KPX space W -80
+KPX space V -80
+KPX space T -100
+
+KPX v period -80
+KPX v o -30
+KPX v comma -80
+KPX v a -20
+
+KPX w period -40
+KPX w o -20
+KPX w comma -40
+
+KPX x e -10
+
+KPX y period -80
+KPX y o -25
+KPX y e -10
+KPX y comma -80
+KPX y a -30
+
+KPX z e 10
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 192 186 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 192 186 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 192 186 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 192 186 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 192 186 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 192 186 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 176 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 169 186 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 169 186 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 169 186 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 169 186 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 10 186 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 10 186 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 10 186 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 10 186 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 192 186 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 215 186 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 215 186 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 215 186 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 215 186 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 215 186 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 169 186 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 192 186 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 192 186 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 192 186 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 192 186 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 169 186 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 169 186 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 146 186 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 92 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 92 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 92 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 92 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 92 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 92 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 108 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 92 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 92 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 92 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -22 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -22 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -22 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -22 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 114 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 114 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 114 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 114 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 114 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 114 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 92 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 114 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 114 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 114 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 114 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 92 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 92 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 69 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvl8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvl8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b02ffacbf9d9162eb450cc69b1ad5e11dd70a393
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvl8a.afm
@@ -0,0 +1,445 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1988 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date:Mon Jan 11 16:46:06 PST 1988
+FontName Helvetica-Light
+EncodingScheme AdobeStandardEncoding
+FullName Helvetica Light
+FamilyName Helvetica
+Weight Light
+ItalicAngle 0.0
+IsFixedPitch false
+UnderlinePosition -90
+UnderlineThickness 58
+Version 001.002
+Notice Copyright (c) 1985, 1987, 1988 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype Company.
+FontBBox -164 -212 1000 979
+CapHeight 720
+XHeight 518
+Descender -204
+Ascender 720
+StartCharMetrics 228
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 130 0 203 720 ;
+C 34 ; WX 278 ; N quotedbl ; B 57 494 220 720 ;
+C 35 ; WX 556 ; N numbersign ; B 27 0 530 698 ;
+C 36 ; WX 556 ; N dollar ; B 37 -95 518 766 ;
+C 37 ; WX 889 ; N percent ; B 67 -14 821 705 ;
+C 38 ; WX 667 ; N ampersand ; B 41 -19 644 720 ;
+C 39 ; WX 222 ; N quoteright ; B 80 495 153 720 ;
+C 40 ; WX 333 ; N parenleft ; B 55 -191 277 739 ;
+C 41 ; WX 333 ; N parenright ; B 56 -191 278 739 ;
+C 42 ; WX 389 ; N asterisk ; B 44 434 344 720 ;
+C 43 ; WX 660 ; N plus ; B 80 0 580 500 ;
+C 44 ; WX 278 ; N comma ; B 102 -137 175 88 ;
+C 45 ; WX 333 ; N hyphen ; B 40 229 293 291 ;
+C 46 ; WX 278 ; N period ; B 102 0 175 88 ;
+C 47 ; WX 278 ; N slash ; B -3 -90 288 739 ;
+C 48 ; WX 556 ; N zero ; B 39 -14 516 705 ;
+C 49 ; WX 556 ; N one ; B 120 0 366 705 ;
+C 50 ; WX 556 ; N two ; B 48 0 515 705 ;
+C 51 ; WX 556 ; N three ; B 34 -14 512 705 ;
+C 52 ; WX 556 ; N four ; B 36 0 520 698 ;
+C 53 ; WX 556 ; N five ; B 35 -14 506 698 ;
+C 54 ; WX 556 ; N six ; B 41 -14 514 705 ;
+C 55 ; WX 556 ; N seven ; B 59 0 508 698 ;
+C 56 ; WX 556 ; N eight ; B 44 -14 512 705 ;
+C 57 ; WX 556 ; N nine ; B 41 -14 515 705 ;
+C 58 ; WX 278 ; N colon ; B 102 0 175 492 ;
+C 59 ; WX 278 ; N semicolon ; B 102 -137 175 492 ;
+C 60 ; WX 660 ; N less ; B 80 -6 580 505 ;
+C 61 ; WX 660 ; N equal ; B 80 124 580 378 ;
+C 62 ; WX 660 ; N greater ; B 80 -6 580 505 ;
+C 63 ; WX 500 ; N question ; B 37 0 472 739 ;
+C 64 ; WX 800 ; N at ; B 40 -19 760 739 ;
+C 65 ; WX 667 ; N A ; B 15 0 651 720 ;
+C 66 ; WX 667 ; N B ; B 81 0 610 720 ;
+C 67 ; WX 722 ; N C ; B 48 -19 670 739 ;
+C 68 ; WX 722 ; N D ; B 81 0 669 720 ;
+C 69 ; WX 611 ; N E ; B 81 0 570 720 ;
+C 70 ; WX 556 ; N F ; B 74 0 538 720 ;
+C 71 ; WX 778 ; N G ; B 53 -19 695 739 ;
+C 72 ; WX 722 ; N H ; B 80 0 642 720 ;
+C 73 ; WX 278 ; N I ; B 105 0 173 720 ;
+C 74 ; WX 500 ; N J ; B 22 -19 415 720 ;
+C 75 ; WX 667 ; N K ; B 85 0 649 720 ;
+C 76 ; WX 556 ; N L ; B 81 0 535 720 ;
+C 77 ; WX 833 ; N M ; B 78 0 755 720 ;
+C 78 ; WX 722 ; N N ; B 79 0 642 720 ;
+C 79 ; WX 778 ; N O ; B 53 -19 724 739 ;
+C 80 ; WX 611 ; N P ; B 78 0 576 720 ;
+C 81 ; WX 778 ; N Q ; B 48 -52 719 739 ;
+C 82 ; WX 667 ; N R ; B 80 0 612 720 ;
+C 83 ; WX 611 ; N S ; B 43 -19 567 739 ;
+C 84 ; WX 556 ; N T ; B 16 0 540 720 ;
+C 85 ; WX 722 ; N U ; B 82 -19 640 720 ;
+C 86 ; WX 611 ; N V ; B 18 0 593 720 ;
+C 87 ; WX 889 ; N W ; B 14 0 875 720 ;
+C 88 ; WX 611 ; N X ; B 18 0 592 720 ;
+C 89 ; WX 611 ; N Y ; B 12 0 598 720 ;
+C 90 ; WX 611 ; N Z ; B 31 0 579 720 ;
+C 91 ; WX 333 ; N bracketleft ; B 91 -191 282 739 ;
+C 92 ; WX 278 ; N backslash ; B -46 0 324 739 ;
+C 93 ; WX 333 ; N bracketright ; B 51 -191 242 739 ;
+C 94 ; WX 660 ; N asciicircum ; B 73 245 586 698 ;
+C 95 ; WX 500 ; N underscore ; B 0 -119 500 -61 ;
+C 96 ; WX 222 ; N quoteleft ; B 69 495 142 720 ;
+C 97 ; WX 556 ; N a ; B 46 -14 534 532 ;
+C 98 ; WX 611 ; N b ; B 79 -14 555 720 ;
+C 99 ; WX 556 ; N c ; B 47 -14 508 532 ;
+C 100 ; WX 611 ; N d ; B 56 -14 532 720 ;
+C 101 ; WX 556 ; N e ; B 45 -14 511 532 ;
+C 102 ; WX 278 ; N f ; B 20 0 257 734 ; L i fi ; L l fl ;
+C 103 ; WX 611 ; N g ; B 56 -212 532 532 ;
+C 104 ; WX 556 ; N h ; B 72 0 483 720 ;
+C 105 ; WX 222 ; N i ; B 78 0 144 720 ;
+C 106 ; WX 222 ; N j ; B 5 -204 151 720 ;
+C 107 ; WX 500 ; N k ; B 68 0 487 720 ;
+C 108 ; WX 222 ; N l ; B 81 0 141 720 ;
+C 109 ; WX 833 ; N m ; B 64 0 768 532 ;
+C 110 ; WX 556 ; N n ; B 72 0 483 532 ;
+C 111 ; WX 556 ; N o ; B 38 -14 518 532 ;
+C 112 ; WX 611 ; N p ; B 79 -204 555 532 ;
+C 113 ; WX 611 ; N q ; B 56 -204 532 532 ;
+C 114 ; WX 333 ; N r ; B 75 0 306 532 ;
+C 115 ; WX 500 ; N s ; B 46 -14 454 532 ;
+C 116 ; WX 278 ; N t ; B 20 -14 254 662 ;
+C 117 ; WX 556 ; N u ; B 72 -14 483 518 ;
+C 118 ; WX 500 ; N v ; B 17 0 483 518 ;
+C 119 ; WX 722 ; N w ; B 15 0 707 518 ;
+C 120 ; WX 500 ; N x ; B 18 0 481 518 ;
+C 121 ; WX 500 ; N y ; B 18 -204 482 518 ;
+C 122 ; WX 500 ; N z ; B 33 0 467 518 ;
+C 123 ; WX 333 ; N braceleft ; B 45 -191 279 739 ;
+C 124 ; WX 222 ; N bar ; B 81 0 141 739 ;
+C 125 ; WX 333 ; N braceright ; B 51 -187 285 743 ;
+C 126 ; WX 660 ; N asciitilde ; B 80 174 580 339 ;
+C 161 ; WX 333 ; N exclamdown ; B 130 -187 203 532 ;
+C 162 ; WX 556 ; N cent ; B 45 -141 506 647 ;
+C 163 ; WX 556 ; N sterling ; B 25 -14 530 705 ;
+C 164 ; WX 167 ; N fraction ; B -164 -14 331 705 ;
+C 165 ; WX 556 ; N yen ; B 4 0 552 720 ;
+C 166 ; WX 556 ; N florin ; B 13 -196 539 734 ;
+C 167 ; WX 556 ; N section ; B 48 -181 508 739 ;
+C 168 ; WX 556 ; N currency ; B 27 50 529 553 ;
+C 169 ; WX 222 ; N quotesingle ; B 85 494 137 720 ;
+C 170 ; WX 389 ; N quotedblleft ; B 86 495 310 720 ;
+C 171 ; WX 556 ; N guillemotleft ; B 113 117 443 404 ;
+C 172 ; WX 389 ; N guilsinglleft ; B 121 117 267 404 ;
+C 173 ; WX 389 ; N guilsinglright ; B 122 117 268 404 ;
+C 174 ; WX 500 ; N fi ; B 13 0 435 734 ;
+C 175 ; WX 500 ; N fl ; B 13 0 432 734 ;
+C 177 ; WX 500 ; N endash ; B 0 238 500 282 ;
+C 178 ; WX 556 ; N dagger ; B 37 -166 519 720 ;
+C 179 ; WX 556 ; N daggerdbl ; B 37 -166 519 720 ;
+C 180 ; WX 278 ; N periodcentered ; B 90 301 187 398 ;
+C 182 ; WX 650 ; N paragraph ; B 66 -146 506 720 ;
+C 183 ; WX 500 ; N bullet ; B 70 180 430 540 ;
+C 184 ; WX 222 ; N quotesinglbase ; B 80 -137 153 88 ;
+C 185 ; WX 389 ; N quotedblbase ; B 79 -137 303 88 ;
+C 186 ; WX 389 ; N quotedblright ; B 79 495 303 720 ;
+C 187 ; WX 556 ; N guillemotright ; B 113 117 443 404 ;
+C 188 ; WX 1000 ; N ellipsis ; B 131 0 870 88 ;
+C 189 ; WX 1000 ; N perthousand ; B 14 -14 985 705 ;
+C 191 ; WX 500 ; N questiondown ; B 28 -207 463 532 ;
+C 193 ; WX 333 ; N grave ; B 45 574 234 713 ;
+C 194 ; WX 333 ; N acute ; B 109 574 297 713 ;
+C 195 ; WX 333 ; N circumflex ; B 24 574 318 713 ;
+C 196 ; WX 333 ; N tilde ; B 16 586 329 688 ;
+C 197 ; WX 333 ; N macron ; B 23 612 319 657 ;
+C 198 ; WX 333 ; N breve ; B 28 580 316 706 ;
+C 199 ; WX 333 ; N dotaccent ; B 134 584 199 686 ;
+C 200 ; WX 333 ; N dieresis ; B 60 584 284 686 ;
+C 202 ; WX 333 ; N ring ; B 67 578 266 777 ;
+C 203 ; WX 333 ; N cedilla ; B 54 -207 257 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 109 574 459 713 ;
+C 206 ; WX 333 ; N ogonek ; B 74 -190 228 0 ;
+C 207 ; WX 333 ; N caron ; B 24 574 318 713 ;
+C 208 ; WX 1000 ; N emdash ; B 0 238 1000 282 ;
+C 225 ; WX 1000 ; N AE ; B 5 0 960 720 ;
+C 227 ; WX 334 ; N ordfeminine ; B 8 307 325 739 ;
+C 232 ; WX 556 ; N Lslash ; B 0 0 535 720 ;
+C 233 ; WX 778 ; N Oslash ; B 42 -37 736 747 ;
+C 234 ; WX 1000 ; N OE ; B 41 -19 967 739 ;
+C 235 ; WX 334 ; N ordmasculine ; B 11 307 323 739 ;
+C 241 ; WX 889 ; N ae ; B 39 -14 847 532 ;
+C 245 ; WX 222 ; N dotlessi ; B 78 0 138 518 ;
+C 248 ; WX 222 ; N lslash ; B 10 0 212 720 ;
+C 249 ; WX 556 ; N oslash ; B 35 -23 521 541 ;
+C 250 ; WX 944 ; N oe ; B 36 -14 904 532 ;
+C 251 ; WX 500 ; N germandbls ; B 52 -14 459 734 ;
+C -1 ; WX 667 ; N Aacute ; B 15 0 651 915 ;
+C -1 ; WX 667 ; N Acircumflex ; B 15 0 651 915 ;
+C -1 ; WX 667 ; N Adieresis ; B 15 0 651 888 ;
+C -1 ; WX 667 ; N Agrave ; B 15 0 651 915 ;
+C -1 ; WX 667 ; N Aring ; B 15 0 651 979 ;
+C -1 ; WX 667 ; N Atilde ; B 15 0 651 890 ;
+C -1 ; WX 722 ; N Ccedilla ; B 48 -207 670 739 ;
+C -1 ; WX 611 ; N Eacute ; B 81 0 570 915 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 81 0 570 915 ;
+C -1 ; WX 611 ; N Edieresis ; B 81 0 570 888 ;
+C -1 ; WX 611 ; N Egrave ; B 81 0 570 915 ;
+C -1 ; WX 722 ; N Eth ; B 10 0 669 720 ;
+C -1 ; WX 278 ; N Iacute ; B 62 0 250 915 ;
+C -1 ; WX 278 ; N Icircumflex ; B -23 0 271 915 ;
+C -1 ; WX 278 ; N Idieresis ; B 13 0 237 888 ;
+C -1 ; WX 278 ; N Igrave ; B 18 0 207 915 ;
+C -1 ; WX 722 ; N Ntilde ; B 79 0 642 890 ;
+C -1 ; WX 778 ; N Oacute ; B 53 -19 724 915 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 53 -19 724 915 ;
+C -1 ; WX 778 ; N Odieresis ; B 53 -19 724 888 ;
+C -1 ; WX 778 ; N Ograve ; B 53 -19 724 915 ;
+C -1 ; WX 778 ; N Otilde ; B 53 -19 724 890 ;
+C -1 ; WX 611 ; N Scaron ; B 43 -19 567 915 ;
+C -1 ; WX 611 ; N Thorn ; B 78 0 576 720 ;
+C -1 ; WX 722 ; N Uacute ; B 82 -19 640 915 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 82 -19 640 915 ;
+C -1 ; WX 722 ; N Udieresis ; B 82 -19 640 888 ;
+C -1 ; WX 722 ; N Ugrave ; B 82 -19 640 915 ;
+C -1 ; WX 611 ; N Yacute ; B 12 0 598 915 ;
+C -1 ; WX 611 ; N Ydieresis ; B 12 0 598 888 ;
+C -1 ; WX 611 ; N Zcaron ; B 31 0 579 915 ;
+C -1 ; WX 556 ; N aacute ; B 46 -14 534 713 ;
+C -1 ; WX 556 ; N acircumflex ; B 46 -14 534 713 ;
+C -1 ; WX 556 ; N adieresis ; B 46 -14 534 686 ;
+C -1 ; WX 556 ; N agrave ; B 46 -14 534 713 ;
+C -1 ; WX 556 ; N aring ; B 46 -14 534 777 ;
+C -1 ; WX 556 ; N atilde ; B 46 -14 534 688 ;
+C -1 ; WX 222 ; N brokenbar ; B 81 0 141 739 ;
+C -1 ; WX 556 ; N ccedilla ; B 47 -207 508 532 ;
+C -1 ; WX 800 ; N copyright ; B 21 -19 779 739 ;
+C -1 ; WX 400 ; N degree ; B 50 405 350 705 ;
+C -1 ; WX 660 ; N divide ; B 80 0 580 500 ;
+C -1 ; WX 556 ; N eacute ; B 45 -14 511 713 ;
+C -1 ; WX 556 ; N ecircumflex ; B 45 -14 511 713 ;
+C -1 ; WX 556 ; N edieresis ; B 45 -14 511 686 ;
+C -1 ; WX 556 ; N egrave ; B 45 -14 511 713 ;
+C -1 ; WX 556 ; N eth ; B 38 -14 518 739 ;
+C -1 ; WX 222 ; N iacute ; B 34 0 222 713 ;
+C -1 ; WX 222 ; N icircumflex ; B -51 0 243 713 ;
+C -1 ; WX 222 ; N idieresis ; B -15 0 209 686 ;
+C -1 ; WX 222 ; N igrave ; B -10 0 179 713 ;
+C -1 ; WX 660 ; N logicalnot ; B 80 112 580 378 ;
+C -1 ; WX 660 ; N minus ; B 80 220 580 280 ;
+C -1 ; WX 556 ; N mu ; B 72 -204 483 518 ;
+C -1 ; WX 660 ; N multiply ; B 83 6 578 500 ;
+C -1 ; WX 556 ; N ntilde ; B 72 0 483 688 ;
+C -1 ; WX 556 ; N oacute ; B 38 -14 518 713 ;
+C -1 ; WX 556 ; N ocircumflex ; B 38 -14 518 713 ;
+C -1 ; WX 556 ; N odieresis ; B 38 -14 518 686 ;
+C -1 ; WX 556 ; N ograve ; B 38 -14 518 713 ;
+C -1 ; WX 834 ; N onehalf ; B 40 -14 794 739 ;
+C -1 ; WX 834 ; N onequarter ; B 40 -14 794 739 ;
+C -1 ; WX 333 ; N onesuperior ; B 87 316 247 739 ;
+C -1 ; WX 556 ; N otilde ; B 38 -14 518 688 ;
+C -1 ; WX 660 ; N plusminus ; B 80 0 580 500 ;
+C -1 ; WX 800 ; N registered ; B 21 -19 779 739 ;
+C -1 ; WX 500 ; N scaron ; B 46 -14 454 713 ;
+C -1 ; WX 611 ; N thorn ; B 79 -204 555 720 ;
+C -1 ; WX 834 ; N threequarters ; B 40 -14 794 739 ;
+C -1 ; WX 333 ; N threesuperior ; B 11 308 322 739 ;
+C -1 ; WX 940 ; N trademark ; B 29 299 859 720 ;
+C -1 ; WX 333 ; N twosuperior ; B 15 316 318 739 ;
+C -1 ; WX 556 ; N uacute ; B 72 -14 483 713 ;
+C -1 ; WX 556 ; N ucircumflex ; B 72 -14 483 713 ;
+C -1 ; WX 556 ; N udieresis ; B 72 -14 483 686 ;
+C -1 ; WX 556 ; N ugrave ; B 72 -14 483 713 ;
+C -1 ; WX 500 ; N yacute ; B 18 -204 482 713 ;
+C -1 ; WX 500 ; N ydieresis ; B 18 -204 482 686 ;
+C -1 ; WX 500 ; N zcaron ; B 33 0 467 713 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 115
+
+KPX A y -18
+KPX A w -18
+KPX A v -18
+KPX A quoteright -74
+KPX A Y -74
+KPX A W -37
+KPX A V -74
+KPX A T -92
+
+KPX F period -129
+KPX F comma -129
+KPX F A -55
+
+KPX L y -37
+KPX L quoteright -74
+KPX L Y -111
+KPX L W -55
+KPX L V -92
+KPX L T -92
+
+KPX P period -129
+KPX P comma -129
+KPX P A -74
+
+KPX R y 0
+KPX R Y -37
+KPX R W -18
+KPX R V -18
+KPX R T -18
+
+KPX T y -84
+KPX T w -84
+KPX T u -92
+KPX T semicolon -111
+KPX T s -111
+KPX T r -92
+KPX T period -111
+KPX T o -111
+KPX T i 0
+KPX T hyphen -129
+KPX T e -111
+KPX T comma -111
+KPX T colon -111
+KPX T c -111
+KPX T a -111
+KPX T A -92
+
+KPX V y -18
+KPX V u -37
+KPX V semicolon -74
+KPX V r -37
+KPX V period -129
+KPX V o -55
+KPX V i -18
+KPX V hyphen -55
+KPX V e -55
+KPX V comma -129
+KPX V colon -74
+KPX V a -55
+KPX V A -74
+
+KPX W y 0
+KPX W u -18
+KPX W semicolon -18
+KPX W r -18
+KPX W period -74
+KPX W o -18
+KPX W i 0
+KPX W hyphen 0
+KPX W e -18
+KPX W comma -74
+KPX W colon -18
+KPX W a -37
+KPX W A -37
+
+KPX Y v -40
+KPX Y u -37
+KPX Y semicolon -92
+KPX Y q -92
+KPX Y period -111
+KPX Y p -37
+KPX Y o -92
+KPX Y i -20
+KPX Y hyphen -111
+KPX Y e -92
+KPX Y comma -111
+KPX Y colon -92
+KPX Y a -92
+KPX Y A -74
+
+KPX f quoteright 18
+KPX f f -18
+
+KPX quoteleft quoteleft -18
+
+KPX quoteright t -18
+KPX quoteright s -74
+KPX quoteright quoteright -18
+
+KPX r z 0
+KPX r y 18
+KPX r x 0
+KPX r w 0
+KPX r v 0
+KPX r u 0
+KPX r t 18
+KPX r r 0
+KPX r quoteright 0
+KPX r q -18
+KPX r period -92
+KPX r o -18
+KPX r n 18
+KPX r m 18
+KPX r hyphen -55
+KPX r h 0
+KPX r g 0
+KPX r f 18
+KPX r e -18
+KPX r d -18
+KPX r comma -92
+KPX r c -18
+
+KPX v period -74
+KPX v comma -74
+
+KPX w period -55
+KPX w comma -55
+
+KPX y period -92
+KPX y comma -92
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 202 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 83 0 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 139 202 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 83 0 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 194 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 111 0 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 139 202 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 83 0 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 139 202 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 83 0 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 194 202 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 194 202 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 194 202 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 194 202 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 111 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 111 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 111 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 111 0 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -47 202 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -47 202 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -47 202 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -27 202 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -75 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -75 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -75 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -55 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 202 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 202 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 202 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 202 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 111 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 111 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 111 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 111 0 ;
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 167 202 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 167 202 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 167 202 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 167 202 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 111 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 111 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 111 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 111 0 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 222 202 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 222 202 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 222 202 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 222 202 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 111 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 111 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 111 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 111 0 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 167 202 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 111 0 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 194 202 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 111 0 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 222 202 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 111 0 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 187 202 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 111 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvlo8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvlo8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..96612d12ff51d4663e7b27395963cf1a2a4178e7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvlo8a.afm
@@ -0,0 +1,445 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1988 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date:Mon Jan 11 17:38:44 PST 1988
+FontName Helvetica-LightOblique
+EncodingScheme AdobeStandardEncoding
+FullName Helvetica Light Oblique
+FamilyName Helvetica
+Weight Light
+ItalicAngle -12.0
+IsFixedPitch false
+UnderlinePosition -90
+UnderlineThickness 58
+Version 001.002
+Notice Copyright (c) 1985, 1987, 1988 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype Company.
+FontBBox -167 -212 1110 979
+CapHeight 720
+XHeight 518
+Descender -204
+Ascender 720
+StartCharMetrics 228
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 130 0 356 720 ;
+C 34 ; WX 278 ; N quotedbl ; B 162 494 373 720 ;
+C 35 ; WX 556 ; N numbersign ; B 75 0 633 698 ;
+C 36 ; WX 556 ; N dollar ; B 75 -95 613 766 ;
+C 37 ; WX 889 ; N percent ; B 176 -14 860 705 ;
+C 38 ; WX 667 ; N ampersand ; B 77 -19 646 720 ;
+C 39 ; WX 222 ; N quoteright ; B 185 495 306 720 ;
+C 40 ; WX 333 ; N parenleft ; B 97 -191 434 739 ;
+C 41 ; WX 333 ; N parenright ; B 15 -191 353 739 ;
+C 42 ; WX 389 ; N asterisk ; B 172 434 472 720 ;
+C 43 ; WX 660 ; N plus ; B 127 0 640 500 ;
+C 44 ; WX 278 ; N comma ; B 73 -137 194 88 ;
+C 45 ; WX 333 ; N hyphen ; B 89 229 355 291 ;
+C 46 ; WX 278 ; N period ; B 102 0 194 88 ;
+C 47 ; WX 278 ; N slash ; B -22 -90 445 739 ;
+C 48 ; WX 556 ; N zero ; B 93 -14 609 705 ;
+C 49 ; WX 556 ; N one ; B 231 0 516 705 ;
+C 50 ; WX 556 ; N two ; B 48 0 628 705 ;
+C 51 ; WX 556 ; N three ; B 74 -14 605 705 ;
+C 52 ; WX 556 ; N four ; B 73 0 570 698 ;
+C 53 ; WX 556 ; N five ; B 71 -14 616 698 ;
+C 54 ; WX 556 ; N six ; B 94 -14 617 705 ;
+C 55 ; WX 556 ; N seven ; B 152 0 656 698 ;
+C 56 ; WX 556 ; N eight ; B 80 -14 601 705 ;
+C 57 ; WX 556 ; N nine ; B 84 -14 607 705 ;
+C 58 ; WX 278 ; N colon ; B 102 0 280 492 ;
+C 59 ; WX 278 ; N semicolon ; B 73 -137 280 492 ;
+C 60 ; WX 660 ; N less ; B 129 -6 687 505 ;
+C 61 ; WX 660 ; N equal ; B 106 124 660 378 ;
+C 62 ; WX 660 ; N greater ; B 79 -6 640 505 ;
+C 63 ; WX 500 ; N question ; B 148 0 594 739 ;
+C 64 ; WX 800 ; N at ; B 108 -19 857 739 ;
+C 65 ; WX 667 ; N A ; B 15 0 651 720 ;
+C 66 ; WX 667 ; N B ; B 81 0 697 720 ;
+C 67 ; WX 722 ; N C ; B 111 -19 771 739 ;
+C 68 ; WX 722 ; N D ; B 81 0 758 720 ;
+C 69 ; WX 611 ; N E ; B 81 0 713 720 ;
+C 70 ; WX 556 ; N F ; B 74 0 691 720 ;
+C 71 ; WX 778 ; N G ; B 116 -19 796 739 ;
+C 72 ; WX 722 ; N H ; B 80 0 795 720 ;
+C 73 ; WX 278 ; N I ; B 105 0 326 720 ;
+C 74 ; WX 500 ; N J ; B 58 -19 568 720 ;
+C 75 ; WX 667 ; N K ; B 85 0 752 720 ;
+C 76 ; WX 556 ; N L ; B 81 0 547 720 ;
+C 77 ; WX 833 ; N M ; B 78 0 908 720 ;
+C 78 ; WX 722 ; N N ; B 79 0 795 720 ;
+C 79 ; WX 778 ; N O ; B 117 -19 812 739 ;
+C 80 ; WX 611 ; N P ; B 78 0 693 720 ;
+C 81 ; WX 778 ; N Q ; B 112 -52 808 739 ;
+C 82 ; WX 667 ; N R ; B 80 0 726 720 ;
+C 83 ; WX 611 ; N S ; B 82 -19 663 739 ;
+C 84 ; WX 556 ; N T ; B 157 0 693 720 ;
+C 85 ; WX 722 ; N U ; B 129 -19 793 720 ;
+C 86 ; WX 611 ; N V ; B 171 0 746 720 ;
+C 87 ; WX 889 ; N W ; B 167 0 1028 720 ;
+C 88 ; WX 611 ; N X ; B 18 0 734 720 ;
+C 89 ; WX 611 ; N Y ; B 165 0 751 720 ;
+C 90 ; WX 611 ; N Z ; B 31 0 729 720 ;
+C 91 ; WX 333 ; N bracketleft ; B 50 -191 439 739 ;
+C 92 ; WX 278 ; N backslash ; B 111 0 324 739 ;
+C 93 ; WX 333 ; N bracketright ; B 10 -191 399 739 ;
+C 94 ; WX 660 ; N asciicircum ; B 125 245 638 698 ;
+C 95 ; WX 500 ; N underscore ; B -25 -119 487 -61 ;
+C 96 ; WX 222 ; N quoteleft ; B 174 495 295 720 ;
+C 97 ; WX 556 ; N a ; B 71 -14 555 532 ;
+C 98 ; WX 611 ; N b ; B 79 -14 619 720 ;
+C 99 ; WX 556 ; N c ; B 92 -14 576 532 ;
+C 100 ; WX 611 ; N d ; B 101 -14 685 720 ;
+C 101 ; WX 556 ; N e ; B 90 -14 575 532 ;
+C 102 ; WX 278 ; N f ; B 97 0 412 734 ; L i fi ; L l fl ;
+C 103 ; WX 611 ; N g ; B 56 -212 642 532 ;
+C 104 ; WX 556 ; N h ; B 72 0 565 720 ;
+C 105 ; WX 222 ; N i ; B 81 0 297 720 ;
+C 106 ; WX 222 ; N j ; B -38 -204 304 720 ;
+C 107 ; WX 500 ; N k ; B 68 0 574 720 ;
+C 108 ; WX 222 ; N l ; B 81 0 294 720 ;
+C 109 ; WX 833 ; N m ; B 64 0 848 532 ;
+C 110 ; WX 556 ; N n ; B 72 0 565 532 ;
+C 111 ; WX 556 ; N o ; B 84 -14 582 532 ;
+C 112 ; WX 611 ; N p ; B 36 -204 620 532 ;
+C 113 ; WX 611 ; N q ; B 102 -204 642 532 ;
+C 114 ; WX 333 ; N r ; B 75 0 419 532 ;
+C 115 ; WX 500 ; N s ; B 78 -14 519 532 ;
+C 116 ; WX 278 ; N t ; B 108 -14 360 662 ;
+C 117 ; WX 556 ; N u ; B 103 -14 593 518 ;
+C 118 ; WX 500 ; N v ; B 127 0 593 518 ;
+C 119 ; WX 722 ; N w ; B 125 0 817 518 ;
+C 120 ; WX 500 ; N x ; B 18 0 584 518 ;
+C 121 ; WX 500 ; N y ; B 26 -204 592 518 ;
+C 122 ; WX 500 ; N z ; B 33 0 564 518 ;
+C 123 ; WX 333 ; N braceleft ; B 103 -191 436 739 ;
+C 124 ; WX 222 ; N bar ; B 81 0 298 739 ;
+C 125 ; WX 333 ; N braceright ; B 12 -187 344 743 ;
+C 126 ; WX 660 ; N asciitilde ; B 127 174 645 339 ;
+C 161 ; WX 333 ; N exclamdown ; B 90 -187 316 532 ;
+C 162 ; WX 556 ; N cent ; B 90 -141 574 647 ;
+C 163 ; WX 556 ; N sterling ; B 51 -14 613 705 ;
+C 164 ; WX 167 ; N fraction ; B -167 -14 481 705 ;
+C 165 ; WX 556 ; N yen ; B 110 0 705 720 ;
+C 166 ; WX 556 ; N florin ; B -26 -196 691 734 ;
+C 167 ; WX 556 ; N section ; B 91 -181 581 739 ;
+C 168 ; WX 556 ; N currency ; B 55 50 629 553 ;
+C 169 ; WX 222 ; N quotesingle ; B 190 494 290 720 ;
+C 170 ; WX 389 ; N quotedblleft ; B 191 495 463 720 ;
+C 171 ; WX 556 ; N guillemotleft ; B 161 117 529 404 ;
+C 172 ; WX 389 ; N guilsinglleft ; B 169 117 353 404 ;
+C 173 ; WX 389 ; N guilsinglright ; B 147 117 330 404 ;
+C 174 ; WX 500 ; N fi ; B 92 0 588 734 ;
+C 175 ; WX 500 ; N fl ; B 92 0 585 734 ;
+C 177 ; WX 500 ; N endash ; B 51 238 560 282 ;
+C 178 ; WX 556 ; N dagger ; B 130 -166 623 720 ;
+C 179 ; WX 556 ; N daggerdbl ; B 49 -166 625 720 ;
+C 180 ; WX 278 ; N periodcentered ; B 163 301 262 398 ;
+C 182 ; WX 650 ; N paragraph ; B 174 -146 659 720 ;
+C 183 ; WX 500 ; N bullet ; B 142 180 510 540 ;
+C 184 ; WX 222 ; N quotesinglbase ; B 51 -137 172 88 ;
+C 185 ; WX 389 ; N quotedblbase ; B 50 -137 322 88 ;
+C 186 ; WX 389 ; N quotedblright ; B 184 495 456 720 ;
+C 187 ; WX 556 ; N guillemotright ; B 138 117 505 404 ;
+C 188 ; WX 1000 ; N ellipsis ; B 131 0 889 88 ;
+C 189 ; WX 1000 ; N perthousand ; B 83 -14 1020 705 ;
+C 191 ; WX 500 ; N questiondown ; B 19 -207 465 532 ;
+C 193 ; WX 333 ; N grave ; B 197 574 356 713 ;
+C 194 ; WX 333 ; N acute ; B 231 574 449 713 ;
+C 195 ; WX 333 ; N circumflex ; B 146 574 440 713 ;
+C 196 ; WX 333 ; N tilde ; B 141 586 475 688 ;
+C 197 ; WX 333 ; N macron ; B 153 612 459 657 ;
+C 198 ; WX 333 ; N breve ; B 177 580 466 706 ;
+C 199 ; WX 333 ; N dotaccent ; B 258 584 345 686 ;
+C 200 ; WX 333 ; N dieresis ; B 184 584 430 686 ;
+C 202 ; WX 333 ; N ring ; B 209 578 412 777 ;
+C 203 ; WX 333 ; N cedilla ; B 14 -207 233 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 231 574 611 713 ;
+C 206 ; WX 333 ; N ogonek ; B 50 -190 199 0 ;
+C 207 ; WX 333 ; N caron ; B 176 574 470 713 ;
+C 208 ; WX 1000 ; N emdash ; B 51 238 1060 282 ;
+C 225 ; WX 1000 ; N AE ; B 5 0 1101 720 ;
+C 227 ; WX 334 ; N ordfeminine ; B 73 307 423 739 ;
+C 232 ; WX 556 ; N Lslash ; B 68 0 547 720 ;
+C 233 ; WX 778 ; N Oslash ; B 41 -37 887 747 ;
+C 234 ; WX 1000 ; N OE ; B 104 -19 1110 739 ;
+C 235 ; WX 334 ; N ordmasculine ; B 76 307 450 739 ;
+C 241 ; WX 889 ; N ae ; B 63 -14 913 532 ;
+C 245 ; WX 222 ; N dotlessi ; B 78 0 248 518 ;
+C 248 ; WX 222 ; N lslash ; B 74 0 316 720 ;
+C 249 ; WX 556 ; N oslash ; B 36 -23 629 541 ;
+C 250 ; WX 944 ; N oe ; B 82 -14 970 532 ;
+C 251 ; WX 500 ; N germandbls ; B 52 -14 554 734 ;
+C -1 ; WX 667 ; N Aacute ; B 15 0 659 915 ;
+C -1 ; WX 667 ; N Acircumflex ; B 15 0 651 915 ;
+C -1 ; WX 667 ; N Adieresis ; B 15 0 651 888 ;
+C -1 ; WX 667 ; N Agrave ; B 15 0 651 915 ;
+C -1 ; WX 667 ; N Aring ; B 15 0 651 979 ;
+C -1 ; WX 667 ; N Atilde ; B 15 0 685 890 ;
+C -1 ; WX 722 ; N Ccedilla ; B 111 -207 771 739 ;
+C -1 ; WX 611 ; N Eacute ; B 81 0 713 915 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 81 0 713 915 ;
+C -1 ; WX 611 ; N Edieresis ; B 81 0 713 888 ;
+C -1 ; WX 611 ; N Egrave ; B 81 0 713 915 ;
+C -1 ; WX 722 ; N Eth ; B 81 0 758 720 ;
+C -1 ; WX 278 ; N Iacute ; B 105 0 445 915 ;
+C -1 ; WX 278 ; N Icircumflex ; B 105 0 436 915 ;
+C -1 ; WX 278 ; N Idieresis ; B 105 0 426 888 ;
+C -1 ; WX 278 ; N Igrave ; B 105 0 372 915 ;
+C -1 ; WX 722 ; N Ntilde ; B 79 0 795 890 ;
+C -1 ; WX 778 ; N Oacute ; B 117 -19 812 915 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 117 -19 812 915 ;
+C -1 ; WX 778 ; N Odieresis ; B 117 -19 812 888 ;
+C -1 ; WX 778 ; N Ograve ; B 117 -19 812 915 ;
+C -1 ; WX 778 ; N Otilde ; B 117 -19 812 890 ;
+C -1 ; WX 611 ; N Scaron ; B 82 -19 663 915 ;
+C -1 ; WX 611 ; N Thorn ; B 78 0 661 720 ;
+C -1 ; WX 722 ; N Uacute ; B 129 -19 793 915 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 129 -19 793 915 ;
+C -1 ; WX 722 ; N Udieresis ; B 129 -19 793 888 ;
+C -1 ; WX 722 ; N Ugrave ; B 129 -19 793 915 ;
+C -1 ; WX 611 ; N Yacute ; B 165 0 751 915 ;
+C -1 ; WX 611 ; N Ydieresis ; B 165 0 751 888 ;
+C -1 ; WX 611 ; N Zcaron ; B 31 0 729 915 ;
+C -1 ; WX 556 ; N aacute ; B 71 -14 561 713 ;
+C -1 ; WX 556 ; N acircumflex ; B 71 -14 555 713 ;
+C -1 ; WX 556 ; N adieresis ; B 71 -14 555 686 ;
+C -1 ; WX 556 ; N agrave ; B 71 -14 555 713 ;
+C -1 ; WX 556 ; N aring ; B 71 -14 555 777 ;
+C -1 ; WX 556 ; N atilde ; B 71 -14 587 688 ;
+C -1 ; WX 222 ; N brokenbar ; B 81 0 298 739 ;
+C -1 ; WX 556 ; N ccedilla ; B 92 -207 576 532 ;
+C -1 ; WX 800 ; N copyright ; B 89 -19 864 739 ;
+C -1 ; WX 400 ; N degree ; B 165 405 471 705 ;
+C -1 ; WX 660 ; N divide ; B 127 0 640 500 ;
+C -1 ; WX 556 ; N eacute ; B 90 -14 575 713 ;
+C -1 ; WX 556 ; N ecircumflex ; B 90 -14 575 713 ;
+C -1 ; WX 556 ; N edieresis ; B 90 -14 575 686 ;
+C -1 ; WX 556 ; N egrave ; B 90 -14 575 713 ;
+C -1 ; WX 556 ; N eth ; B 84 -14 582 739 ;
+C -1 ; WX 222 ; N iacute ; B 78 0 374 713 ;
+C -1 ; WX 222 ; N icircumflex ; B 71 0 365 713 ;
+C -1 ; WX 222 ; N idieresis ; B 78 0 355 686 ;
+C -1 ; WX 222 ; N igrave ; B 78 0 301 713 ;
+C -1 ; WX 660 ; N logicalnot ; B 148 112 660 378 ;
+C -1 ; WX 660 ; N minus ; B 127 220 640 280 ;
+C -1 ; WX 556 ; N mu ; B 29 -204 593 518 ;
+C -1 ; WX 660 ; N multiply ; B 92 6 677 500 ;
+C -1 ; WX 556 ; N ntilde ; B 72 0 587 688 ;
+C -1 ; WX 556 ; N oacute ; B 84 -14 582 713 ;
+C -1 ; WX 556 ; N ocircumflex ; B 84 -14 582 713 ;
+C -1 ; WX 556 ; N odieresis ; B 84 -14 582 686 ;
+C -1 ; WX 556 ; N ograve ; B 84 -14 582 713 ;
+C -1 ; WX 834 ; N onehalf ; B 125 -14 862 739 ;
+C -1 ; WX 834 ; N onequarter ; B 165 -14 823 739 ;
+C -1 ; WX 333 ; N onesuperior ; B 221 316 404 739 ;
+C -1 ; WX 556 ; N otilde ; B 84 -14 587 688 ;
+C -1 ; WX 660 ; N plusminus ; B 80 0 650 500 ;
+C -1 ; WX 800 ; N registered ; B 89 -19 864 739 ;
+C -1 ; WX 500 ; N scaron ; B 78 -14 554 713 ;
+C -1 ; WX 611 ; N thorn ; B 36 -204 620 720 ;
+C -1 ; WX 834 ; N threequarters ; B 131 -14 853 739 ;
+C -1 ; WX 333 ; N threesuperior ; B 102 308 444 739 ;
+C -1 ; WX 940 ; N trademark ; B 174 299 1012 720 ;
+C -1 ; WX 333 ; N twosuperior ; B 82 316 453 739 ;
+C -1 ; WX 556 ; N uacute ; B 103 -14 593 713 ;
+C -1 ; WX 556 ; N ucircumflex ; B 103 -14 593 713 ;
+C -1 ; WX 556 ; N udieresis ; B 103 -14 593 686 ;
+C -1 ; WX 556 ; N ugrave ; B 103 -14 593 713 ;
+C -1 ; WX 500 ; N yacute ; B 26 -204 592 713 ;
+C -1 ; WX 500 ; N ydieresis ; B 26 -204 592 686 ;
+C -1 ; WX 500 ; N zcaron ; B 33 0 564 713 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 115
+
+KPX A y -18
+KPX A w -18
+KPX A v -18
+KPX A quoteright -74
+KPX A Y -74
+KPX A W -37
+KPX A V -74
+KPX A T -92
+
+KPX F period -129
+KPX F comma -129
+KPX F A -55
+
+KPX L y -37
+KPX L quoteright -74
+KPX L Y -111
+KPX L W -55
+KPX L V -92
+KPX L T -92
+
+KPX P period -129
+KPX P comma -129
+KPX P A -74
+
+KPX R y 0
+KPX R Y -37
+KPX R W -18
+KPX R V -18
+KPX R T -18
+
+KPX T y -84
+KPX T w -84
+KPX T u -92
+KPX T semicolon -111
+KPX T s -111
+KPX T r -92
+KPX T period -111
+KPX T o -111
+KPX T i 0
+KPX T hyphen -129
+KPX T e -111
+KPX T comma -111
+KPX T colon -111
+KPX T c -111
+KPX T a -111
+KPX T A -92
+
+KPX V y -18
+KPX V u -37
+KPX V semicolon -74
+KPX V r -37
+KPX V period -129
+KPX V o -55
+KPX V i -18
+KPX V hyphen -55
+KPX V e -55
+KPX V comma -129
+KPX V colon -74
+KPX V a -55
+KPX V A -74
+
+KPX W y 0
+KPX W u -18
+KPX W semicolon -18
+KPX W r -18
+KPX W period -74
+KPX W o -18
+KPX W i 0
+KPX W hyphen 0
+KPX W e -18
+KPX W comma -74
+KPX W colon -18
+KPX W a -37
+KPX W A -37
+
+KPX Y v -40
+KPX Y u -37
+KPX Y semicolon -92
+KPX Y q -92
+KPX Y period -111
+KPX Y p -37
+KPX Y o -92
+KPX Y i -20
+KPX Y hyphen -111
+KPX Y e -92
+KPX Y comma -111
+KPX Y colon -92
+KPX Y a -92
+KPX Y A -74
+
+KPX f quoteright 18
+KPX f f -18
+
+KPX quoteleft quoteleft -18
+
+KPX quoteright t -18
+KPX quoteright s -74
+KPX quoteright quoteright -18
+
+KPX r z 0
+KPX r y 18
+KPX r x 0
+KPX r w 0
+KPX r v 0
+KPX r u 0
+KPX r t 18
+KPX r r 0
+KPX r quoteright 0
+KPX r q -18
+KPX r period -92
+KPX r o -18
+KPX r n 18
+KPX r m 18
+KPX r hyphen -55
+KPX r h 0
+KPX r g 0
+KPX r f 18
+KPX r e -18
+KPX r d -18
+KPX r comma -92
+KPX r c -18
+
+KPX v period -74
+KPX v comma -74
+
+KPX w period -55
+KPX w comma -55
+
+KPX y period -92
+KPX y comma -92
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 202 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 83 0 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 139 202 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 83 0 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 194 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 111 0 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 139 202 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 83 0 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 139 202 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 83 0 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 194 202 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 194 202 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 194 202 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 194 202 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 111 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 111 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 111 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 111 0 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -47 202 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -47 202 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -47 202 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -27 202 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -75 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -75 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -75 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -55 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 202 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 202 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 202 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 202 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 111 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 111 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 111 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 111 0 ;
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 167 202 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 167 202 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 167 202 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 167 202 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 111 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 111 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 111 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 111 0 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 222 202 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 222 202 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 222 202 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 222 202 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 111 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 111 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 111 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 111 0 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 167 202 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 111 0 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 194 202 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 111 0 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 222 202 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 111 0 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 187 202 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 111 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvr8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvr8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..1eb3b448569c9790fdcf37ebef8560611c946228
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvr8a.afm
@@ -0,0 +1,612 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Thu Mar 15 08:58:00 1990
+Comment UniqueID 28352
+Comment VMusage 26389 33281
+FontName Helvetica
+FullName Helvetica
+FamilyName Helvetica
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -166 -225 1000 931
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.006
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 523
+Ascender 718
+Descender -207
+StartCharMetrics 228
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 278 ; N exclam ; B 90 0 187 718 ;
+C 34 ; WX 355 ; N quotedbl ; B 70 463 285 718 ;
+C 35 ; WX 556 ; N numbersign ; B 28 0 529 688 ;
+C 36 ; WX 556 ; N dollar ; B 32 -115 520 775 ;
+C 37 ; WX 889 ; N percent ; B 39 -19 850 703 ;
+C 38 ; WX 667 ; N ampersand ; B 44 -15 645 718 ;
+C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ;
+C 40 ; WX 333 ; N parenleft ; B 68 -207 299 733 ;
+C 41 ; WX 333 ; N parenright ; B 34 -207 265 733 ;
+C 42 ; WX 389 ; N asterisk ; B 39 431 349 718 ;
+C 43 ; WX 584 ; N plus ; B 39 0 545 505 ;
+C 44 ; WX 278 ; N comma ; B 87 -147 191 106 ;
+C 45 ; WX 333 ; N hyphen ; B 44 232 289 322 ;
+C 46 ; WX 278 ; N period ; B 87 0 191 106 ;
+C 47 ; WX 278 ; N slash ; B -17 -19 295 737 ;
+C 48 ; WX 556 ; N zero ; B 37 -19 519 703 ;
+C 49 ; WX 556 ; N one ; B 101 0 359 703 ;
+C 50 ; WX 556 ; N two ; B 26 0 507 703 ;
+C 51 ; WX 556 ; N three ; B 34 -19 522 703 ;
+C 52 ; WX 556 ; N four ; B 25 0 523 703 ;
+C 53 ; WX 556 ; N five ; B 32 -19 514 688 ;
+C 54 ; WX 556 ; N six ; B 38 -19 518 703 ;
+C 55 ; WX 556 ; N seven ; B 37 0 523 688 ;
+C 56 ; WX 556 ; N eight ; B 38 -19 517 703 ;
+C 57 ; WX 556 ; N nine ; B 42 -19 514 703 ;
+C 58 ; WX 278 ; N colon ; B 87 0 191 516 ;
+C 59 ; WX 278 ; N semicolon ; B 87 -147 191 516 ;
+C 60 ; WX 584 ; N less ; B 48 11 536 495 ;
+C 61 ; WX 584 ; N equal ; B 39 115 545 390 ;
+C 62 ; WX 584 ; N greater ; B 48 11 536 495 ;
+C 63 ; WX 556 ; N question ; B 56 0 492 727 ;
+C 64 ; WX 1015 ; N at ; B 147 -19 868 737 ;
+C 65 ; WX 667 ; N A ; B 14 0 654 718 ;
+C 66 ; WX 667 ; N B ; B 74 0 627 718 ;
+C 67 ; WX 722 ; N C ; B 44 -19 681 737 ;
+C 68 ; WX 722 ; N D ; B 81 0 674 718 ;
+C 69 ; WX 667 ; N E ; B 86 0 616 718 ;
+C 70 ; WX 611 ; N F ; B 86 0 583 718 ;
+C 71 ; WX 778 ; N G ; B 48 -19 704 737 ;
+C 72 ; WX 722 ; N H ; B 77 0 646 718 ;
+C 73 ; WX 278 ; N I ; B 91 0 188 718 ;
+C 74 ; WX 500 ; N J ; B 17 -19 428 718 ;
+C 75 ; WX 667 ; N K ; B 76 0 663 718 ;
+C 76 ; WX 556 ; N L ; B 76 0 537 718 ;
+C 77 ; WX 833 ; N M ; B 73 0 761 718 ;
+C 78 ; WX 722 ; N N ; B 76 0 646 718 ;
+C 79 ; WX 778 ; N O ; B 39 -19 739 737 ;
+C 80 ; WX 667 ; N P ; B 86 0 622 718 ;
+C 81 ; WX 778 ; N Q ; B 39 -56 739 737 ;
+C 82 ; WX 722 ; N R ; B 88 0 684 718 ;
+C 83 ; WX 667 ; N S ; B 49 -19 620 737 ;
+C 84 ; WX 611 ; N T ; B 14 0 597 718 ;
+C 85 ; WX 722 ; N U ; B 79 -19 644 718 ;
+C 86 ; WX 667 ; N V ; B 20 0 647 718 ;
+C 87 ; WX 944 ; N W ; B 16 0 928 718 ;
+C 88 ; WX 667 ; N X ; B 19 0 648 718 ;
+C 89 ; WX 667 ; N Y ; B 14 0 653 718 ;
+C 90 ; WX 611 ; N Z ; B 23 0 588 718 ;
+C 91 ; WX 278 ; N bracketleft ; B 63 -196 250 722 ;
+C 92 ; WX 278 ; N backslash ; B -17 -19 295 737 ;
+C 93 ; WX 278 ; N bracketright ; B 28 -196 215 722 ;
+C 94 ; WX 469 ; N asciicircum ; B -14 264 483 688 ;
+C 95 ; WX 556 ; N underscore ; B 0 -125 556 -75 ;
+C 96 ; WX 222 ; N quoteleft ; B 65 470 169 725 ;
+C 97 ; WX 556 ; N a ; B 36 -15 530 538 ;
+C 98 ; WX 556 ; N b ; B 58 -15 517 718 ;
+C 99 ; WX 500 ; N c ; B 30 -15 477 538 ;
+C 100 ; WX 556 ; N d ; B 35 -15 499 718 ;
+C 101 ; WX 556 ; N e ; B 40 -15 516 538 ;
+C 102 ; WX 278 ; N f ; B 14 0 262 728 ; L i fi ; L l fl ;
+C 103 ; WX 556 ; N g ; B 40 -220 499 538 ;
+C 104 ; WX 556 ; N h ; B 65 0 491 718 ;
+C 105 ; WX 222 ; N i ; B 67 0 155 718 ;
+C 106 ; WX 222 ; N j ; B -16 -210 155 718 ;
+C 107 ; WX 500 ; N k ; B 67 0 501 718 ;
+C 108 ; WX 222 ; N l ; B 67 0 155 718 ;
+C 109 ; WX 833 ; N m ; B 65 0 769 538 ;
+C 110 ; WX 556 ; N n ; B 65 0 491 538 ;
+C 111 ; WX 556 ; N o ; B 35 -14 521 538 ;
+C 112 ; WX 556 ; N p ; B 58 -207 517 538 ;
+C 113 ; WX 556 ; N q ; B 35 -207 494 538 ;
+C 114 ; WX 333 ; N r ; B 77 0 332 538 ;
+C 115 ; WX 500 ; N s ; B 32 -15 464 538 ;
+C 116 ; WX 278 ; N t ; B 14 -7 257 669 ;
+C 117 ; WX 556 ; N u ; B 68 -15 489 523 ;
+C 118 ; WX 500 ; N v ; B 8 0 492 523 ;
+C 119 ; WX 722 ; N w ; B 14 0 709 523 ;
+C 120 ; WX 500 ; N x ; B 11 0 490 523 ;
+C 121 ; WX 500 ; N y ; B 11 -214 489 523 ;
+C 122 ; WX 500 ; N z ; B 31 0 469 523 ;
+C 123 ; WX 334 ; N braceleft ; B 42 -196 292 722 ;
+C 124 ; WX 260 ; N bar ; B 94 -19 167 737 ;
+C 125 ; WX 334 ; N braceright ; B 42 -196 292 722 ;
+C 126 ; WX 584 ; N asciitilde ; B 61 180 523 326 ;
+C 161 ; WX 333 ; N exclamdown ; B 118 -195 215 523 ;
+C 162 ; WX 556 ; N cent ; B 51 -115 513 623 ;
+C 163 ; WX 556 ; N sterling ; B 33 -16 539 718 ;
+C 164 ; WX 167 ; N fraction ; B -166 -19 333 703 ;
+C 165 ; WX 556 ; N yen ; B 3 0 553 688 ;
+C 166 ; WX 556 ; N florin ; B -11 -207 501 737 ;
+C 167 ; WX 556 ; N section ; B 43 -191 512 737 ;
+C 168 ; WX 556 ; N currency ; B 28 99 528 603 ;
+C 169 ; WX 191 ; N quotesingle ; B 59 463 132 718 ;
+C 170 ; WX 333 ; N quotedblleft ; B 38 470 307 725 ;
+C 171 ; WX 556 ; N guillemotleft ; B 97 108 459 446 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 88 108 245 446 ;
+C 173 ; WX 333 ; N guilsinglright ; B 88 108 245 446 ;
+C 174 ; WX 500 ; N fi ; B 14 0 434 728 ;
+C 175 ; WX 500 ; N fl ; B 14 0 432 728 ;
+C 177 ; WX 556 ; N endash ; B 0 240 556 313 ;
+C 178 ; WX 556 ; N dagger ; B 43 -159 514 718 ;
+C 179 ; WX 556 ; N daggerdbl ; B 43 -159 514 718 ;
+C 180 ; WX 278 ; N periodcentered ; B 77 190 202 315 ;
+C 182 ; WX 537 ; N paragraph ; B 18 -173 497 718 ;
+C 183 ; WX 350 ; N bullet ; B 18 202 333 517 ;
+C 184 ; WX 222 ; N quotesinglbase ; B 53 -149 157 106 ;
+C 185 ; WX 333 ; N quotedblbase ; B 26 -149 295 106 ;
+C 186 ; WX 333 ; N quotedblright ; B 26 463 295 718 ;
+C 187 ; WX 556 ; N guillemotright ; B 97 108 459 446 ;
+C 188 ; WX 1000 ; N ellipsis ; B 115 0 885 106 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -19 994 703 ;
+C 191 ; WX 611 ; N questiondown ; B 91 -201 527 525 ;
+C 193 ; WX 333 ; N grave ; B 14 593 211 734 ;
+C 194 ; WX 333 ; N acute ; B 122 593 319 734 ;
+C 195 ; WX 333 ; N circumflex ; B 21 593 312 734 ;
+C 196 ; WX 333 ; N tilde ; B -4 606 337 722 ;
+C 197 ; WX 333 ; N macron ; B 10 627 323 684 ;
+C 198 ; WX 333 ; N breve ; B 13 595 321 731 ;
+C 199 ; WX 333 ; N dotaccent ; B 121 604 212 706 ;
+C 200 ; WX 333 ; N dieresis ; B 40 604 293 706 ;
+C 202 ; WX 333 ; N ring ; B 75 572 259 756 ;
+C 203 ; WX 333 ; N cedilla ; B 45 -225 259 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 31 593 409 734 ;
+C 206 ; WX 333 ; N ogonek ; B 73 -225 287 0 ;
+C 207 ; WX 333 ; N caron ; B 21 593 312 734 ;
+C 208 ; WX 1000 ; N emdash ; B 0 240 1000 313 ;
+C 225 ; WX 1000 ; N AE ; B 8 0 951 718 ;
+C 227 ; WX 370 ; N ordfeminine ; B 24 304 346 737 ;
+C 232 ; WX 556 ; N Lslash ; B -20 0 537 718 ;
+C 233 ; WX 778 ; N Oslash ; B 39 -19 740 737 ;
+C 234 ; WX 1000 ; N OE ; B 36 -19 965 737 ;
+C 235 ; WX 365 ; N ordmasculine ; B 25 304 341 737 ;
+C 241 ; WX 889 ; N ae ; B 36 -15 847 538 ;
+C 245 ; WX 278 ; N dotlessi ; B 95 0 183 523 ;
+C 248 ; WX 222 ; N lslash ; B -20 0 242 718 ;
+C 249 ; WX 611 ; N oslash ; B 28 -22 537 545 ;
+C 250 ; WX 944 ; N oe ; B 35 -15 902 538 ;
+C 251 ; WX 611 ; N germandbls ; B 67 -15 571 728 ;
+C -1 ; WX 611 ; N Zcaron ; B 23 0 588 929 ;
+C -1 ; WX 500 ; N ccedilla ; B 30 -225 477 538 ;
+C -1 ; WX 500 ; N ydieresis ; B 11 -214 489 706 ;
+C -1 ; WX 556 ; N atilde ; B 36 -15 530 722 ;
+C -1 ; WX 278 ; N icircumflex ; B -6 0 285 734 ;
+C -1 ; WX 333 ; N threesuperior ; B 5 270 325 703 ;
+C -1 ; WX 556 ; N ecircumflex ; B 40 -15 516 734 ;
+C -1 ; WX 556 ; N thorn ; B 58 -207 517 718 ;
+C -1 ; WX 556 ; N egrave ; B 40 -15 516 734 ;
+C -1 ; WX 333 ; N twosuperior ; B 4 281 323 703 ;
+C -1 ; WX 556 ; N eacute ; B 40 -15 516 734 ;
+C -1 ; WX 556 ; N otilde ; B 35 -14 521 722 ;
+C -1 ; WX 667 ; N Aacute ; B 14 0 654 929 ;
+C -1 ; WX 556 ; N ocircumflex ; B 35 -14 521 734 ;
+C -1 ; WX 500 ; N yacute ; B 11 -214 489 734 ;
+C -1 ; WX 556 ; N udieresis ; B 68 -15 489 706 ;
+C -1 ; WX 834 ; N threequarters ; B 45 -19 810 703 ;
+C -1 ; WX 556 ; N acircumflex ; B 36 -15 530 734 ;
+C -1 ; WX 722 ; N Eth ; B 0 0 674 718 ;
+C -1 ; WX 556 ; N edieresis ; B 40 -15 516 706 ;
+C -1 ; WX 556 ; N ugrave ; B 68 -15 489 734 ;
+C -1 ; WX 1000 ; N trademark ; B 46 306 903 718 ;
+C -1 ; WX 556 ; N ograve ; B 35 -14 521 734 ;
+C -1 ; WX 500 ; N scaron ; B 32 -15 464 734 ;
+C -1 ; WX 278 ; N Idieresis ; B 13 0 266 901 ;
+C -1 ; WX 556 ; N uacute ; B 68 -15 489 734 ;
+C -1 ; WX 556 ; N agrave ; B 36 -15 530 734 ;
+C -1 ; WX 556 ; N ntilde ; B 65 0 491 722 ;
+C -1 ; WX 556 ; N aring ; B 36 -15 530 756 ;
+C -1 ; WX 500 ; N zcaron ; B 31 0 469 734 ;
+C -1 ; WX 278 ; N Icircumflex ; B -6 0 285 929 ;
+C -1 ; WX 722 ; N Ntilde ; B 76 0 646 917 ;
+C -1 ; WX 556 ; N ucircumflex ; B 68 -15 489 734 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 86 0 616 929 ;
+C -1 ; WX 278 ; N Iacute ; B 91 0 292 929 ;
+C -1 ; WX 722 ; N Ccedilla ; B 44 -225 681 737 ;
+C -1 ; WX 778 ; N Odieresis ; B 39 -19 739 901 ;
+C -1 ; WX 667 ; N Scaron ; B 49 -19 620 929 ;
+C -1 ; WX 667 ; N Edieresis ; B 86 0 616 901 ;
+C -1 ; WX 278 ; N Igrave ; B -13 0 188 929 ;
+C -1 ; WX 556 ; N adieresis ; B 36 -15 530 706 ;
+C -1 ; WX 778 ; N Ograve ; B 39 -19 739 929 ;
+C -1 ; WX 667 ; N Egrave ; B 86 0 616 929 ;
+C -1 ; WX 667 ; N Ydieresis ; B 14 0 653 901 ;
+C -1 ; WX 737 ; N registered ; B -14 -19 752 737 ;
+C -1 ; WX 778 ; N Otilde ; B 39 -19 739 917 ;
+C -1 ; WX 834 ; N onequarter ; B 73 -19 756 703 ;
+C -1 ; WX 722 ; N Ugrave ; B 79 -19 644 929 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 79 -19 644 929 ;
+C -1 ; WX 667 ; N Thorn ; B 86 0 622 718 ;
+C -1 ; WX 584 ; N divide ; B 39 -19 545 524 ;
+C -1 ; WX 667 ; N Atilde ; B 14 0 654 917 ;
+C -1 ; WX 722 ; N Uacute ; B 79 -19 644 929 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 39 -19 739 929 ;
+C -1 ; WX 584 ; N logicalnot ; B 39 108 545 390 ;
+C -1 ; WX 667 ; N Aring ; B 14 0 654 931 ;
+C -1 ; WX 278 ; N idieresis ; B 13 0 266 706 ;
+C -1 ; WX 278 ; N iacute ; B 95 0 292 734 ;
+C -1 ; WX 556 ; N aacute ; B 36 -15 530 734 ;
+C -1 ; WX 584 ; N plusminus ; B 39 0 545 506 ;
+C -1 ; WX 584 ; N multiply ; B 39 0 545 506 ;
+C -1 ; WX 722 ; N Udieresis ; B 79 -19 644 901 ;
+C -1 ; WX 584 ; N minus ; B 39 216 545 289 ;
+C -1 ; WX 333 ; N onesuperior ; B 43 281 222 703 ;
+C -1 ; WX 667 ; N Eacute ; B 86 0 616 929 ;
+C -1 ; WX 667 ; N Acircumflex ; B 14 0 654 929 ;
+C -1 ; WX 737 ; N copyright ; B -14 -19 752 737 ;
+C -1 ; WX 667 ; N Agrave ; B 14 0 654 929 ;
+C -1 ; WX 556 ; N odieresis ; B 35 -14 521 706 ;
+C -1 ; WX 556 ; N oacute ; B 35 -14 521 734 ;
+C -1 ; WX 400 ; N degree ; B 54 411 346 703 ;
+C -1 ; WX 278 ; N igrave ; B -13 0 184 734 ;
+C -1 ; WX 556 ; N mu ; B 68 -207 489 523 ;
+C -1 ; WX 778 ; N Oacute ; B 39 -19 739 929 ;
+C -1 ; WX 556 ; N eth ; B 35 -15 522 737 ;
+C -1 ; WX 667 ; N Adieresis ; B 14 0 654 901 ;
+C -1 ; WX 667 ; N Yacute ; B 14 0 653 929 ;
+C -1 ; WX 260 ; N brokenbar ; B 94 -19 167 737 ;
+C -1 ; WX 834 ; N onehalf ; B 43 -19 773 703 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 250
+
+KPX A y -40
+KPX A w -40
+KPX A v -40
+KPX A u -30
+KPX A Y -100
+KPX A W -50
+KPX A V -70
+KPX A U -50
+KPX A T -120
+KPX A Q -30
+KPX A O -30
+KPX A G -30
+KPX A C -30
+
+KPX B period -20
+KPX B comma -20
+KPX B U -10
+
+KPX C period -30
+KPX C comma -30
+
+KPX D period -70
+KPX D comma -70
+KPX D Y -90
+KPX D W -40
+KPX D V -70
+KPX D A -40
+
+KPX F r -45
+KPX F period -150
+KPX F o -30
+KPX F e -30
+KPX F comma -150
+KPX F a -50
+KPX F A -80
+
+KPX J u -20
+KPX J period -30
+KPX J comma -30
+KPX J a -20
+KPX J A -20
+
+KPX K y -50
+KPX K u -30
+KPX K o -40
+KPX K e -40
+KPX K O -50
+
+KPX L y -30
+KPX L quoteright -160
+KPX L quotedblright -140
+KPX L Y -140
+KPX L W -70
+KPX L V -110
+KPX L T -110
+
+KPX O period -40
+KPX O comma -40
+KPX O Y -70
+KPX O X -60
+KPX O W -30
+KPX O V -50
+KPX O T -40
+KPX O A -20
+
+KPX P period -180
+KPX P o -50
+KPX P e -50
+KPX P comma -180
+KPX P a -40
+KPX P A -120
+
+KPX Q U -10
+
+KPX R Y -50
+KPX R W -30
+KPX R V -50
+KPX R U -40
+KPX R T -30
+KPX R O -20
+
+KPX S period -20
+KPX S comma -20
+
+KPX T y -120
+KPX T w -120
+KPX T u -120
+KPX T semicolon -20
+KPX T r -120
+KPX T period -120
+KPX T o -120
+KPX T hyphen -140
+KPX T e -120
+KPX T comma -120
+KPX T colon -20
+KPX T a -120
+KPX T O -40
+KPX T A -120
+
+KPX U period -40
+KPX U comma -40
+KPX U A -40
+
+KPX V u -70
+KPX V semicolon -40
+KPX V period -125
+KPX V o -80
+KPX V hyphen -80
+KPX V e -80
+KPX V comma -125
+KPX V colon -40
+KPX V a -70
+KPX V O -40
+KPX V G -40
+KPX V A -80
+
+KPX W y -20
+KPX W u -30
+KPX W period -80
+KPX W o -30
+KPX W hyphen -40
+KPX W e -30
+KPX W comma -80
+KPX W a -40
+KPX W O -20
+KPX W A -50
+
+KPX Y u -110
+KPX Y semicolon -60
+KPX Y period -140
+KPX Y o -140
+KPX Y i -20
+KPX Y hyphen -140
+KPX Y e -140
+KPX Y comma -140
+KPX Y colon -60
+KPX Y a -140
+KPX Y O -85
+KPX Y A -110
+
+KPX a y -30
+KPX a w -20
+KPX a v -20
+
+KPX b y -20
+KPX b v -20
+KPX b u -20
+KPX b period -40
+KPX b l -20
+KPX b comma -40
+KPX b b -10
+
+KPX c k -20
+KPX c comma -15
+
+KPX colon space -50
+
+KPX comma quoteright -100
+KPX comma quotedblright -100
+
+KPX e y -20
+KPX e x -30
+KPX e w -20
+KPX e v -30
+KPX e period -15
+KPX e comma -15
+
+KPX f quoteright 50
+KPX f quotedblright 60
+KPX f period -30
+KPX f o -30
+KPX f e -30
+KPX f dotlessi -28
+KPX f comma -30
+KPX f a -30
+
+KPX g r -10
+
+KPX h y -30
+
+KPX k o -20
+KPX k e -20
+
+KPX m y -15
+KPX m u -10
+
+KPX n y -15
+KPX n v -20
+KPX n u -10
+
+KPX o y -30
+KPX o x -30
+KPX o w -15
+KPX o v -15
+KPX o period -40
+KPX o comma -40
+
+KPX oslash z -55
+KPX oslash y -70
+KPX oslash x -85
+KPX oslash w -70
+KPX oslash v -70
+KPX oslash u -55
+KPX oslash t -55
+KPX oslash s -55
+KPX oslash r -55
+KPX oslash q -55
+KPX oslash period -95
+KPX oslash p -55
+KPX oslash o -55
+KPX oslash n -55
+KPX oslash m -55
+KPX oslash l -55
+KPX oslash k -55
+KPX oslash j -55
+KPX oslash i -55
+KPX oslash h -55
+KPX oslash g -55
+KPX oslash f -55
+KPX oslash e -55
+KPX oslash d -55
+KPX oslash comma -95
+KPX oslash c -55
+KPX oslash b -55
+KPX oslash a -55
+
+KPX p y -30
+KPX p period -35
+KPX p comma -35
+
+KPX period space -60
+KPX period quoteright -100
+KPX period quotedblright -100
+
+KPX quotedblright space -40
+
+KPX quoteleft quoteleft -57
+
+KPX quoteright space -70
+KPX quoteright s -50
+KPX quoteright r -50
+KPX quoteright quoteright -57
+KPX quoteright d -50
+
+KPX r y 30
+KPX r v 30
+KPX r u 15
+KPX r t 40
+KPX r semicolon 30
+KPX r period -50
+KPX r p 30
+KPX r n 25
+KPX r m 25
+KPX r l 15
+KPX r k 15
+KPX r i 15
+KPX r comma -50
+KPX r colon 30
+KPX r a -10
+
+KPX s w -30
+KPX s period -15
+KPX s comma -15
+
+KPX semicolon space -50
+
+KPX space quoteleft -60
+KPX space quotedblleft -30
+KPX space Y -90
+KPX space W -40
+KPX space V -50
+KPX space T -50
+
+KPX v period -80
+KPX v o -25
+KPX v e -25
+KPX v comma -80
+KPX v a -25
+
+KPX w period -60
+KPX w o -10
+KPX w e -10
+KPX w comma -60
+KPX w a -15
+
+KPX x e -30
+
+KPX y period -100
+KPX y o -20
+KPX y e -20
+KPX y comma -100
+KPX y a -20
+
+KPX z o -15
+KPX z e -15
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 167 195 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 167 195 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 167 195 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 167 195 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 167 175 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 167 195 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 195 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 167 195 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 167 195 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 167 195 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 167 195 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -27 195 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -27 195 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -27 195 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -27 195 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 205 195 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 223 195 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 223 195 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 223 195 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 223 195 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 223 195 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 167 195 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 195 195 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 195 195 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 195 195 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 195 195 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 167 195 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 167 195 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 195 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 112 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 102 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 84 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 112 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 112 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 112 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 112 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 102 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 112 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 112 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 112 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 112 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 112 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 84 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 112 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 112 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 112 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 112 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvr8an.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvr8an.afm
new file mode 100644
index 0000000000000000000000000000000000000000..5a08aa8c99a0ad2cd9a2088d0e34c420d629e28e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvr8an.afm
@@ -0,0 +1,612 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Thu Mar 15 11:04:57 1990
+Comment UniqueID 28380
+Comment VMusage 7572 42473
+FontName Helvetica-Narrow
+FullName Helvetica Narrow
+FamilyName Helvetica
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -136 -225 820 931
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.006
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 523
+Ascender 718
+Descender -207
+StartCharMetrics 228
+C 32 ; WX 228 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 228 ; N exclam ; B 74 0 153 718 ;
+C 34 ; WX 291 ; N quotedbl ; B 57 463 234 718 ;
+C 35 ; WX 456 ; N numbersign ; B 23 0 434 688 ;
+C 36 ; WX 456 ; N dollar ; B 26 -115 426 775 ;
+C 37 ; WX 729 ; N percent ; B 32 -19 697 703 ;
+C 38 ; WX 547 ; N ampersand ; B 36 -15 529 718 ;
+C 39 ; WX 182 ; N quoteright ; B 43 463 129 718 ;
+C 40 ; WX 273 ; N parenleft ; B 56 -207 245 733 ;
+C 41 ; WX 273 ; N parenright ; B 28 -207 217 733 ;
+C 42 ; WX 319 ; N asterisk ; B 32 431 286 718 ;
+C 43 ; WX 479 ; N plus ; B 32 0 447 505 ;
+C 44 ; WX 228 ; N comma ; B 71 -147 157 106 ;
+C 45 ; WX 273 ; N hyphen ; B 36 232 237 322 ;
+C 46 ; WX 228 ; N period ; B 71 0 157 106 ;
+C 47 ; WX 228 ; N slash ; B -14 -19 242 737 ;
+C 48 ; WX 456 ; N zero ; B 30 -19 426 703 ;
+C 49 ; WX 456 ; N one ; B 83 0 294 703 ;
+C 50 ; WX 456 ; N two ; B 21 0 416 703 ;
+C 51 ; WX 456 ; N three ; B 28 -19 428 703 ;
+C 52 ; WX 456 ; N four ; B 20 0 429 703 ;
+C 53 ; WX 456 ; N five ; B 26 -19 421 688 ;
+C 54 ; WX 456 ; N six ; B 31 -19 425 703 ;
+C 55 ; WX 456 ; N seven ; B 30 0 429 688 ;
+C 56 ; WX 456 ; N eight ; B 31 -19 424 703 ;
+C 57 ; WX 456 ; N nine ; B 34 -19 421 703 ;
+C 58 ; WX 228 ; N colon ; B 71 0 157 516 ;
+C 59 ; WX 228 ; N semicolon ; B 71 -147 157 516 ;
+C 60 ; WX 479 ; N less ; B 39 11 440 495 ;
+C 61 ; WX 479 ; N equal ; B 32 115 447 390 ;
+C 62 ; WX 479 ; N greater ; B 39 11 440 495 ;
+C 63 ; WX 456 ; N question ; B 46 0 403 727 ;
+C 64 ; WX 832 ; N at ; B 121 -19 712 737 ;
+C 65 ; WX 547 ; N A ; B 11 0 536 718 ;
+C 66 ; WX 547 ; N B ; B 61 0 514 718 ;
+C 67 ; WX 592 ; N C ; B 36 -19 558 737 ;
+C 68 ; WX 592 ; N D ; B 66 0 553 718 ;
+C 69 ; WX 547 ; N E ; B 71 0 505 718 ;
+C 70 ; WX 501 ; N F ; B 71 0 478 718 ;
+C 71 ; WX 638 ; N G ; B 39 -19 577 737 ;
+C 72 ; WX 592 ; N H ; B 63 0 530 718 ;
+C 73 ; WX 228 ; N I ; B 75 0 154 718 ;
+C 74 ; WX 410 ; N J ; B 14 -19 351 718 ;
+C 75 ; WX 547 ; N K ; B 62 0 544 718 ;
+C 76 ; WX 456 ; N L ; B 62 0 440 718 ;
+C 77 ; WX 683 ; N M ; B 60 0 624 718 ;
+C 78 ; WX 592 ; N N ; B 62 0 530 718 ;
+C 79 ; WX 638 ; N O ; B 32 -19 606 737 ;
+C 80 ; WX 547 ; N P ; B 71 0 510 718 ;
+C 81 ; WX 638 ; N Q ; B 32 -56 606 737 ;
+C 82 ; WX 592 ; N R ; B 72 0 561 718 ;
+C 83 ; WX 547 ; N S ; B 40 -19 508 737 ;
+C 84 ; WX 501 ; N T ; B 11 0 490 718 ;
+C 85 ; WX 592 ; N U ; B 65 -19 528 718 ;
+C 86 ; WX 547 ; N V ; B 16 0 531 718 ;
+C 87 ; WX 774 ; N W ; B 13 0 761 718 ;
+C 88 ; WX 547 ; N X ; B 16 0 531 718 ;
+C 89 ; WX 547 ; N Y ; B 11 0 535 718 ;
+C 90 ; WX 501 ; N Z ; B 19 0 482 718 ;
+C 91 ; WX 228 ; N bracketleft ; B 52 -196 205 722 ;
+C 92 ; WX 228 ; N backslash ; B -14 -19 242 737 ;
+C 93 ; WX 228 ; N bracketright ; B 23 -196 176 722 ;
+C 94 ; WX 385 ; N asciicircum ; B -11 264 396 688 ;
+C 95 ; WX 456 ; N underscore ; B 0 -125 456 -75 ;
+C 96 ; WX 182 ; N quoteleft ; B 53 470 139 725 ;
+C 97 ; WX 456 ; N a ; B 30 -15 435 538 ;
+C 98 ; WX 456 ; N b ; B 48 -15 424 718 ;
+C 99 ; WX 410 ; N c ; B 25 -15 391 538 ;
+C 100 ; WX 456 ; N d ; B 29 -15 409 718 ;
+C 101 ; WX 456 ; N e ; B 33 -15 423 538 ;
+C 102 ; WX 228 ; N f ; B 11 0 215 728 ; L i fi ; L l fl ;
+C 103 ; WX 456 ; N g ; B 33 -220 409 538 ;
+C 104 ; WX 456 ; N h ; B 53 0 403 718 ;
+C 105 ; WX 182 ; N i ; B 55 0 127 718 ;
+C 106 ; WX 182 ; N j ; B -13 -210 127 718 ;
+C 107 ; WX 410 ; N k ; B 55 0 411 718 ;
+C 108 ; WX 182 ; N l ; B 55 0 127 718 ;
+C 109 ; WX 683 ; N m ; B 53 0 631 538 ;
+C 110 ; WX 456 ; N n ; B 53 0 403 538 ;
+C 111 ; WX 456 ; N o ; B 29 -14 427 538 ;
+C 112 ; WX 456 ; N p ; B 48 -207 424 538 ;
+C 113 ; WX 456 ; N q ; B 29 -207 405 538 ;
+C 114 ; WX 273 ; N r ; B 63 0 272 538 ;
+C 115 ; WX 410 ; N s ; B 26 -15 380 538 ;
+C 116 ; WX 228 ; N t ; B 11 -7 211 669 ;
+C 117 ; WX 456 ; N u ; B 56 -15 401 523 ;
+C 118 ; WX 410 ; N v ; B 7 0 403 523 ;
+C 119 ; WX 592 ; N w ; B 11 0 581 523 ;
+C 120 ; WX 410 ; N x ; B 9 0 402 523 ;
+C 121 ; WX 410 ; N y ; B 9 -214 401 523 ;
+C 122 ; WX 410 ; N z ; B 25 0 385 523 ;
+C 123 ; WX 274 ; N braceleft ; B 34 -196 239 722 ;
+C 124 ; WX 213 ; N bar ; B 77 -19 137 737 ;
+C 125 ; WX 274 ; N braceright ; B 34 -196 239 722 ;
+C 126 ; WX 479 ; N asciitilde ; B 50 180 429 326 ;
+C 161 ; WX 273 ; N exclamdown ; B 97 -195 176 523 ;
+C 162 ; WX 456 ; N cent ; B 42 -115 421 623 ;
+C 163 ; WX 456 ; N sterling ; B 27 -16 442 718 ;
+C 164 ; WX 137 ; N fraction ; B -136 -19 273 703 ;
+C 165 ; WX 456 ; N yen ; B 2 0 453 688 ;
+C 166 ; WX 456 ; N florin ; B -9 -207 411 737 ;
+C 167 ; WX 456 ; N section ; B 35 -191 420 737 ;
+C 168 ; WX 456 ; N currency ; B 23 99 433 603 ;
+C 169 ; WX 157 ; N quotesingle ; B 48 463 108 718 ;
+C 170 ; WX 273 ; N quotedblleft ; B 31 470 252 725 ;
+C 171 ; WX 456 ; N guillemotleft ; B 80 108 376 446 ;
+C 172 ; WX 273 ; N guilsinglleft ; B 72 108 201 446 ;
+C 173 ; WX 273 ; N guilsinglright ; B 72 108 201 446 ;
+C 174 ; WX 410 ; N fi ; B 11 0 356 728 ;
+C 175 ; WX 410 ; N fl ; B 11 0 354 728 ;
+C 177 ; WX 456 ; N endash ; B 0 240 456 313 ;
+C 178 ; WX 456 ; N dagger ; B 35 -159 421 718 ;
+C 179 ; WX 456 ; N daggerdbl ; B 35 -159 421 718 ;
+C 180 ; WX 228 ; N periodcentered ; B 63 190 166 315 ;
+C 182 ; WX 440 ; N paragraph ; B 15 -173 408 718 ;
+C 183 ; WX 287 ; N bullet ; B 15 202 273 517 ;
+C 184 ; WX 182 ; N quotesinglbase ; B 43 -149 129 106 ;
+C 185 ; WX 273 ; N quotedblbase ; B 21 -149 242 106 ;
+C 186 ; WX 273 ; N quotedblright ; B 21 463 242 718 ;
+C 187 ; WX 456 ; N guillemotright ; B 80 108 376 446 ;
+C 188 ; WX 820 ; N ellipsis ; B 94 0 726 106 ;
+C 189 ; WX 820 ; N perthousand ; B 6 -19 815 703 ;
+C 191 ; WX 501 ; N questiondown ; B 75 -201 432 525 ;
+C 193 ; WX 273 ; N grave ; B 11 593 173 734 ;
+C 194 ; WX 273 ; N acute ; B 100 593 262 734 ;
+C 195 ; WX 273 ; N circumflex ; B 17 593 256 734 ;
+C 196 ; WX 273 ; N tilde ; B -3 606 276 722 ;
+C 197 ; WX 273 ; N macron ; B 8 627 265 684 ;
+C 198 ; WX 273 ; N breve ; B 11 595 263 731 ;
+C 199 ; WX 273 ; N dotaccent ; B 99 604 174 706 ;
+C 200 ; WX 273 ; N dieresis ; B 33 604 240 706 ;
+C 202 ; WX 273 ; N ring ; B 61 572 212 756 ;
+C 203 ; WX 273 ; N cedilla ; B 37 -225 212 0 ;
+C 205 ; WX 273 ; N hungarumlaut ; B 25 593 335 734 ;
+C 206 ; WX 273 ; N ogonek ; B 60 -225 235 0 ;
+C 207 ; WX 273 ; N caron ; B 17 593 256 734 ;
+C 208 ; WX 820 ; N emdash ; B 0 240 820 313 ;
+C 225 ; WX 820 ; N AE ; B 7 0 780 718 ;
+C 227 ; WX 303 ; N ordfeminine ; B 20 304 284 737 ;
+C 232 ; WX 456 ; N Lslash ; B -16 0 440 718 ;
+C 233 ; WX 638 ; N Oslash ; B 32 -19 607 737 ;
+C 234 ; WX 820 ; N OE ; B 30 -19 791 737 ;
+C 235 ; WX 299 ; N ordmasculine ; B 20 304 280 737 ;
+C 241 ; WX 729 ; N ae ; B 30 -15 695 538 ;
+C 245 ; WX 228 ; N dotlessi ; B 78 0 150 523 ;
+C 248 ; WX 182 ; N lslash ; B -16 0 198 718 ;
+C 249 ; WX 501 ; N oslash ; B 23 -22 440 545 ;
+C 250 ; WX 774 ; N oe ; B 29 -15 740 538 ;
+C 251 ; WX 501 ; N germandbls ; B 55 -15 468 728 ;
+C -1 ; WX 501 ; N Zcaron ; B 19 0 482 929 ;
+C -1 ; WX 410 ; N ccedilla ; B 25 -225 391 538 ;
+C -1 ; WX 410 ; N ydieresis ; B 9 -214 401 706 ;
+C -1 ; WX 456 ; N atilde ; B 30 -15 435 722 ;
+C -1 ; WX 228 ; N icircumflex ; B -5 0 234 734 ;
+C -1 ; WX 273 ; N threesuperior ; B 4 270 266 703 ;
+C -1 ; WX 456 ; N ecircumflex ; B 33 -15 423 734 ;
+C -1 ; WX 456 ; N thorn ; B 48 -207 424 718 ;
+C -1 ; WX 456 ; N egrave ; B 33 -15 423 734 ;
+C -1 ; WX 273 ; N twosuperior ; B 3 281 265 703 ;
+C -1 ; WX 456 ; N eacute ; B 33 -15 423 734 ;
+C -1 ; WX 456 ; N otilde ; B 29 -14 427 722 ;
+C -1 ; WX 547 ; N Aacute ; B 11 0 536 929 ;
+C -1 ; WX 456 ; N ocircumflex ; B 29 -14 427 734 ;
+C -1 ; WX 410 ; N yacute ; B 9 -214 401 734 ;
+C -1 ; WX 456 ; N udieresis ; B 56 -15 401 706 ;
+C -1 ; WX 684 ; N threequarters ; B 37 -19 664 703 ;
+C -1 ; WX 456 ; N acircumflex ; B 30 -15 435 734 ;
+C -1 ; WX 592 ; N Eth ; B 0 0 553 718 ;
+C -1 ; WX 456 ; N edieresis ; B 33 -15 423 706 ;
+C -1 ; WX 456 ; N ugrave ; B 56 -15 401 734 ;
+C -1 ; WX 820 ; N trademark ; B 38 306 740 718 ;
+C -1 ; WX 456 ; N ograve ; B 29 -14 427 734 ;
+C -1 ; WX 410 ; N scaron ; B 26 -15 380 734 ;
+C -1 ; WX 228 ; N Idieresis ; B 11 0 218 901 ;
+C -1 ; WX 456 ; N uacute ; B 56 -15 401 734 ;
+C -1 ; WX 456 ; N agrave ; B 30 -15 435 734 ;
+C -1 ; WX 456 ; N ntilde ; B 53 0 403 722 ;
+C -1 ; WX 456 ; N aring ; B 30 -15 435 756 ;
+C -1 ; WX 410 ; N zcaron ; B 25 0 385 734 ;
+C -1 ; WX 228 ; N Icircumflex ; B -5 0 234 929 ;
+C -1 ; WX 592 ; N Ntilde ; B 62 0 530 917 ;
+C -1 ; WX 456 ; N ucircumflex ; B 56 -15 401 734 ;
+C -1 ; WX 547 ; N Ecircumflex ; B 71 0 505 929 ;
+C -1 ; WX 228 ; N Iacute ; B 75 0 239 929 ;
+C -1 ; WX 592 ; N Ccedilla ; B 36 -225 558 737 ;
+C -1 ; WX 638 ; N Odieresis ; B 32 -19 606 901 ;
+C -1 ; WX 547 ; N Scaron ; B 40 -19 508 929 ;
+C -1 ; WX 547 ; N Edieresis ; B 71 0 505 901 ;
+C -1 ; WX 228 ; N Igrave ; B -11 0 154 929 ;
+C -1 ; WX 456 ; N adieresis ; B 30 -15 435 706 ;
+C -1 ; WX 638 ; N Ograve ; B 32 -19 606 929 ;
+C -1 ; WX 547 ; N Egrave ; B 71 0 505 929 ;
+C -1 ; WX 547 ; N Ydieresis ; B 11 0 535 901 ;
+C -1 ; WX 604 ; N registered ; B -11 -19 617 737 ;
+C -1 ; WX 638 ; N Otilde ; B 32 -19 606 917 ;
+C -1 ; WX 684 ; N onequarter ; B 60 -19 620 703 ;
+C -1 ; WX 592 ; N Ugrave ; B 65 -19 528 929 ;
+C -1 ; WX 592 ; N Ucircumflex ; B 65 -19 528 929 ;
+C -1 ; WX 547 ; N Thorn ; B 71 0 510 718 ;
+C -1 ; WX 479 ; N divide ; B 32 -19 447 524 ;
+C -1 ; WX 547 ; N Atilde ; B 11 0 536 917 ;
+C -1 ; WX 592 ; N Uacute ; B 65 -19 528 929 ;
+C -1 ; WX 638 ; N Ocircumflex ; B 32 -19 606 929 ;
+C -1 ; WX 479 ; N logicalnot ; B 32 108 447 390 ;
+C -1 ; WX 547 ; N Aring ; B 11 0 536 931 ;
+C -1 ; WX 228 ; N idieresis ; B 11 0 218 706 ;
+C -1 ; WX 228 ; N iacute ; B 78 0 239 734 ;
+C -1 ; WX 456 ; N aacute ; B 30 -15 435 734 ;
+C -1 ; WX 479 ; N plusminus ; B 32 0 447 506 ;
+C -1 ; WX 479 ; N multiply ; B 32 0 447 506 ;
+C -1 ; WX 592 ; N Udieresis ; B 65 -19 528 901 ;
+C -1 ; WX 479 ; N minus ; B 32 216 447 289 ;
+C -1 ; WX 273 ; N onesuperior ; B 35 281 182 703 ;
+C -1 ; WX 547 ; N Eacute ; B 71 0 505 929 ;
+C -1 ; WX 547 ; N Acircumflex ; B 11 0 536 929 ;
+C -1 ; WX 604 ; N copyright ; B -11 -19 617 737 ;
+C -1 ; WX 547 ; N Agrave ; B 11 0 536 929 ;
+C -1 ; WX 456 ; N odieresis ; B 29 -14 427 706 ;
+C -1 ; WX 456 ; N oacute ; B 29 -14 427 734 ;
+C -1 ; WX 328 ; N degree ; B 44 411 284 703 ;
+C -1 ; WX 228 ; N igrave ; B -11 0 151 734 ;
+C -1 ; WX 456 ; N mu ; B 56 -207 401 523 ;
+C -1 ; WX 638 ; N Oacute ; B 32 -19 606 929 ;
+C -1 ; WX 456 ; N eth ; B 29 -15 428 737 ;
+C -1 ; WX 547 ; N Adieresis ; B 11 0 536 901 ;
+C -1 ; WX 547 ; N Yacute ; B 11 0 535 929 ;
+C -1 ; WX 213 ; N brokenbar ; B 77 -19 137 737 ;
+C -1 ; WX 684 ; N onehalf ; B 35 -19 634 703 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 250
+
+KPX A y -32
+KPX A w -32
+KPX A v -32
+KPX A u -24
+KPX A Y -81
+KPX A W -40
+KPX A V -56
+KPX A U -40
+KPX A T -97
+KPX A Q -24
+KPX A O -24
+KPX A G -24
+KPX A C -24
+
+KPX B period -15
+KPX B comma -15
+KPX B U -7
+
+KPX C period -24
+KPX C comma -24
+
+KPX D period -56
+KPX D comma -56
+KPX D Y -73
+KPX D W -32
+KPX D V -56
+KPX D A -32
+
+KPX F r -36
+KPX F period -122
+KPX F o -24
+KPX F e -24
+KPX F comma -122
+KPX F a -40
+KPX F A -65
+
+KPX J u -15
+KPX J period -24
+KPX J comma -24
+KPX J a -15
+KPX J A -15
+
+KPX K y -40
+KPX K u -24
+KPX K o -32
+KPX K e -32
+KPX K O -40
+
+KPX L y -24
+KPX L quoteright -130
+KPX L quotedblright -114
+KPX L Y -114
+KPX L W -56
+KPX L V -89
+KPX L T -89
+
+KPX O period -32
+KPX O comma -32
+KPX O Y -56
+KPX O X -48
+KPX O W -24
+KPX O V -40
+KPX O T -32
+KPX O A -15
+
+KPX P period -147
+KPX P o -40
+KPX P e -40
+KPX P comma -147
+KPX P a -32
+KPX P A -97
+
+KPX Q U -7
+
+KPX R Y -40
+KPX R W -24
+KPX R V -40
+KPX R U -32
+KPX R T -24
+KPX R O -15
+
+KPX S period -15
+KPX S comma -15
+
+KPX T y -97
+KPX T w -97
+KPX T u -97
+KPX T semicolon -15
+KPX T r -97
+KPX T period -97
+KPX T o -97
+KPX T hyphen -114
+KPX T e -97
+KPX T comma -97
+KPX T colon -15
+KPX T a -97
+KPX T O -32
+KPX T A -97
+
+KPX U period -32
+KPX U comma -32
+KPX U A -32
+
+KPX V u -56
+KPX V semicolon -32
+KPX V period -102
+KPX V o -65
+KPX V hyphen -65
+KPX V e -65
+KPX V comma -102
+KPX V colon -32
+KPX V a -56
+KPX V O -32
+KPX V G -32
+KPX V A -65
+
+KPX W y -15
+KPX W u -24
+KPX W period -65
+KPX W o -24
+KPX W hyphen -32
+KPX W e -24
+KPX W comma -65
+KPX W a -32
+KPX W O -15
+KPX W A -40
+
+KPX Y u -89
+KPX Y semicolon -48
+KPX Y period -114
+KPX Y o -114
+KPX Y i -15
+KPX Y hyphen -114
+KPX Y e -114
+KPX Y comma -114
+KPX Y colon -48
+KPX Y a -114
+KPX Y O -69
+KPX Y A -89
+
+KPX a y -24
+KPX a w -15
+KPX a v -15
+
+KPX b y -15
+KPX b v -15
+KPX b u -15
+KPX b period -32
+KPX b l -15
+KPX b comma -32
+KPX b b -7
+
+KPX c k -15
+KPX c comma -11
+
+KPX colon space -40
+
+KPX comma quoteright -81
+KPX comma quotedblright -81
+
+KPX e y -15
+KPX e x -24
+KPX e w -15
+KPX e v -24
+KPX e period -11
+KPX e comma -11
+
+KPX f quoteright 41
+KPX f quotedblright 49
+KPX f period -24
+KPX f o -24
+KPX f e -24
+KPX f dotlessi -22
+KPX f comma -24
+KPX f a -24
+
+KPX g r -7
+
+KPX h y -24
+
+KPX k o -15
+KPX k e -15
+
+KPX m y -11
+KPX m u -7
+
+KPX n y -11
+KPX n v -15
+KPX n u -7
+
+KPX o y -24
+KPX o x -24
+KPX o w -11
+KPX o v -11
+KPX o period -32
+KPX o comma -32
+
+KPX oslash z -44
+KPX oslash y -56
+KPX oslash x -69
+KPX oslash w -56
+KPX oslash v -56
+KPX oslash u -44
+KPX oslash t -44
+KPX oslash s -44
+KPX oslash r -44
+KPX oslash q -44
+KPX oslash period -77
+KPX oslash p -44
+KPX oslash o -44
+KPX oslash n -44
+KPX oslash m -44
+KPX oslash l -44
+KPX oslash k -44
+KPX oslash j -44
+KPX oslash i -44
+KPX oslash h -44
+KPX oslash g -44
+KPX oslash f -44
+KPX oslash e -44
+KPX oslash d -44
+KPX oslash comma -77
+KPX oslash c -44
+KPX oslash b -44
+KPX oslash a -44
+
+KPX p y -24
+KPX p period -28
+KPX p comma -28
+
+KPX period space -48
+KPX period quoteright -81
+KPX period quotedblright -81
+
+KPX quotedblright space -32
+
+KPX quoteleft quoteleft -46
+
+KPX quoteright space -56
+KPX quoteright s -40
+KPX quoteright r -40
+KPX quoteright quoteright -46
+KPX quoteright d -40
+
+KPX r y 25
+KPX r v 25
+KPX r u 12
+KPX r t 33
+KPX r semicolon 25
+KPX r period -40
+KPX r p 25
+KPX r n 21
+KPX r m 21
+KPX r l 12
+KPX r k 12
+KPX r i 12
+KPX r comma -40
+KPX r colon 25
+KPX r a -7
+
+KPX s w -24
+KPX s period -11
+KPX s comma -11
+
+KPX semicolon space -40
+
+KPX space quoteleft -48
+KPX space quotedblleft -24
+KPX space Y -73
+KPX space W -32
+KPX space V -40
+KPX space T -40
+
+KPX v period -65
+KPX v o -20
+KPX v e -20
+KPX v comma -65
+KPX v a -20
+
+KPX w period -48
+KPX w o -7
+KPX w e -7
+KPX w comma -48
+KPX w a -11
+
+KPX x e -24
+
+KPX y period -81
+KPX y o -15
+KPX y e -15
+KPX y comma -81
+KPX y a -15
+
+KPX z o -11
+KPX z e -11
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 137 195 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 137 195 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 137 195 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 137 195 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 137 175 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 137 195 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 160 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 137 195 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 137 195 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 137 195 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 137 195 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute -22 195 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex -22 195 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis -22 195 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave -22 195 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 168 195 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 183 195 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 183 195 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 183 195 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 183 195 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 183 195 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 137 195 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 160 195 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 160 195 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 160 195 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 160 195 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 137 195 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 137 195 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 114 195 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 92 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 92 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 92 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 92 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 92 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 69 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 92 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 92 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 92 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -22 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -22 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -22 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -22 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 92 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 92 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 92 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 92 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 92 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 69 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 92 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 92 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 92 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 92 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 69 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 69 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 69 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvro8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvro8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..3d69eb7c8e03fa4ceb2e8d6e89dc6f0ecd24ab0e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvro8a.afm
@@ -0,0 +1,612 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Thu Mar 15 10:24:18 1990
+Comment UniqueID 28362
+Comment VMusage 7572 42473
+FontName Helvetica-Oblique
+FullName Helvetica Oblique
+FamilyName Helvetica
+Weight Medium
+ItalicAngle -12
+IsFixedPitch false
+FontBBox -170 -225 1116 931
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.006
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 523
+Ascender 718
+Descender -207
+StartCharMetrics 228
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 278 ; N exclam ; B 90 0 340 718 ;
+C 34 ; WX 355 ; N quotedbl ; B 168 463 438 718 ;
+C 35 ; WX 556 ; N numbersign ; B 73 0 631 688 ;
+C 36 ; WX 556 ; N dollar ; B 69 -115 617 775 ;
+C 37 ; WX 889 ; N percent ; B 147 -19 889 703 ;
+C 38 ; WX 667 ; N ampersand ; B 77 -15 647 718 ;
+C 39 ; WX 222 ; N quoteright ; B 151 463 310 718 ;
+C 40 ; WX 333 ; N parenleft ; B 108 -207 454 733 ;
+C 41 ; WX 333 ; N parenright ; B -9 -207 337 733 ;
+C 42 ; WX 389 ; N asterisk ; B 165 431 475 718 ;
+C 43 ; WX 584 ; N plus ; B 85 0 606 505 ;
+C 44 ; WX 278 ; N comma ; B 56 -147 214 106 ;
+C 45 ; WX 333 ; N hyphen ; B 93 232 357 322 ;
+C 46 ; WX 278 ; N period ; B 87 0 214 106 ;
+C 47 ; WX 278 ; N slash ; B -21 -19 452 737 ;
+C 48 ; WX 556 ; N zero ; B 93 -19 608 703 ;
+C 49 ; WX 556 ; N one ; B 207 0 508 703 ;
+C 50 ; WX 556 ; N two ; B 26 0 617 703 ;
+C 51 ; WX 556 ; N three ; B 75 -19 610 703 ;
+C 52 ; WX 556 ; N four ; B 61 0 576 703 ;
+C 53 ; WX 556 ; N five ; B 68 -19 621 688 ;
+C 54 ; WX 556 ; N six ; B 91 -19 615 703 ;
+C 55 ; WX 556 ; N seven ; B 137 0 669 688 ;
+C 56 ; WX 556 ; N eight ; B 74 -19 607 703 ;
+C 57 ; WX 556 ; N nine ; B 82 -19 609 703 ;
+C 58 ; WX 278 ; N colon ; B 87 0 301 516 ;
+C 59 ; WX 278 ; N semicolon ; B 56 -147 301 516 ;
+C 60 ; WX 584 ; N less ; B 94 11 641 495 ;
+C 61 ; WX 584 ; N equal ; B 63 115 628 390 ;
+C 62 ; WX 584 ; N greater ; B 50 11 597 495 ;
+C 63 ; WX 556 ; N question ; B 161 0 610 727 ;
+C 64 ; WX 1015 ; N at ; B 215 -19 965 737 ;
+C 65 ; WX 667 ; N A ; B 14 0 654 718 ;
+C 66 ; WX 667 ; N B ; B 74 0 712 718 ;
+C 67 ; WX 722 ; N C ; B 108 -19 782 737 ;
+C 68 ; WX 722 ; N D ; B 81 0 764 718 ;
+C 69 ; WX 667 ; N E ; B 86 0 762 718 ;
+C 70 ; WX 611 ; N F ; B 86 0 736 718 ;
+C 71 ; WX 778 ; N G ; B 111 -19 799 737 ;
+C 72 ; WX 722 ; N H ; B 77 0 799 718 ;
+C 73 ; WX 278 ; N I ; B 91 0 341 718 ;
+C 74 ; WX 500 ; N J ; B 47 -19 581 718 ;
+C 75 ; WX 667 ; N K ; B 76 0 808 718 ;
+C 76 ; WX 556 ; N L ; B 76 0 555 718 ;
+C 77 ; WX 833 ; N M ; B 73 0 914 718 ;
+C 78 ; WX 722 ; N N ; B 76 0 799 718 ;
+C 79 ; WX 778 ; N O ; B 105 -19 826 737 ;
+C 80 ; WX 667 ; N P ; B 86 0 737 718 ;
+C 81 ; WX 778 ; N Q ; B 105 -56 826 737 ;
+C 82 ; WX 722 ; N R ; B 88 0 773 718 ;
+C 83 ; WX 667 ; N S ; B 90 -19 713 737 ;
+C 84 ; WX 611 ; N T ; B 148 0 750 718 ;
+C 85 ; WX 722 ; N U ; B 123 -19 797 718 ;
+C 86 ; WX 667 ; N V ; B 173 0 800 718 ;
+C 87 ; WX 944 ; N W ; B 169 0 1081 718 ;
+C 88 ; WX 667 ; N X ; B 19 0 790 718 ;
+C 89 ; WX 667 ; N Y ; B 167 0 806 718 ;
+C 90 ; WX 611 ; N Z ; B 23 0 741 718 ;
+C 91 ; WX 278 ; N bracketleft ; B 21 -196 403 722 ;
+C 92 ; WX 278 ; N backslash ; B 140 -19 291 737 ;
+C 93 ; WX 278 ; N bracketright ; B -14 -196 368 722 ;
+C 94 ; WX 469 ; N asciicircum ; B 42 264 539 688 ;
+C 95 ; WX 556 ; N underscore ; B -27 -125 540 -75 ;
+C 96 ; WX 222 ; N quoteleft ; B 165 470 323 725 ;
+C 97 ; WX 556 ; N a ; B 61 -15 559 538 ;
+C 98 ; WX 556 ; N b ; B 58 -15 584 718 ;
+C 99 ; WX 500 ; N c ; B 74 -15 553 538 ;
+C 100 ; WX 556 ; N d ; B 84 -15 652 718 ;
+C 101 ; WX 556 ; N e ; B 84 -15 578 538 ;
+C 102 ; WX 278 ; N f ; B 86 0 416 728 ; L i fi ; L l fl ;
+C 103 ; WX 556 ; N g ; B 42 -220 610 538 ;
+C 104 ; WX 556 ; N h ; B 65 0 573 718 ;
+C 105 ; WX 222 ; N i ; B 67 0 308 718 ;
+C 106 ; WX 222 ; N j ; B -60 -210 308 718 ;
+C 107 ; WX 500 ; N k ; B 67 0 600 718 ;
+C 108 ; WX 222 ; N l ; B 67 0 308 718 ;
+C 109 ; WX 833 ; N m ; B 65 0 852 538 ;
+C 110 ; WX 556 ; N n ; B 65 0 573 538 ;
+C 111 ; WX 556 ; N o ; B 83 -14 585 538 ;
+C 112 ; WX 556 ; N p ; B 14 -207 584 538 ;
+C 113 ; WX 556 ; N q ; B 84 -207 605 538 ;
+C 114 ; WX 333 ; N r ; B 77 0 446 538 ;
+C 115 ; WX 500 ; N s ; B 63 -15 529 538 ;
+C 116 ; WX 278 ; N t ; B 102 -7 368 669 ;
+C 117 ; WX 556 ; N u ; B 94 -15 600 523 ;
+C 118 ; WX 500 ; N v ; B 119 0 603 523 ;
+C 119 ; WX 722 ; N w ; B 125 0 820 523 ;
+C 120 ; WX 500 ; N x ; B 11 0 594 523 ;
+C 121 ; WX 500 ; N y ; B 15 -214 600 523 ;
+C 122 ; WX 500 ; N z ; B 31 0 571 523 ;
+C 123 ; WX 334 ; N braceleft ; B 92 -196 445 722 ;
+C 124 ; WX 260 ; N bar ; B 90 -19 324 737 ;
+C 125 ; WX 334 ; N braceright ; B 0 -196 354 722 ;
+C 126 ; WX 584 ; N asciitilde ; B 111 180 580 326 ;
+C 161 ; WX 333 ; N exclamdown ; B 77 -195 326 523 ;
+C 162 ; WX 556 ; N cent ; B 95 -115 584 623 ;
+C 163 ; WX 556 ; N sterling ; B 49 -16 634 718 ;
+C 164 ; WX 167 ; N fraction ; B -170 -19 482 703 ;
+C 165 ; WX 556 ; N yen ; B 81 0 699 688 ;
+C 166 ; WX 556 ; N florin ; B -52 -207 654 737 ;
+C 167 ; WX 556 ; N section ; B 76 -191 584 737 ;
+C 168 ; WX 556 ; N currency ; B 60 99 646 603 ;
+C 169 ; WX 191 ; N quotesingle ; B 157 463 285 718 ;
+C 170 ; WX 333 ; N quotedblleft ; B 138 470 461 725 ;
+C 171 ; WX 556 ; N guillemotleft ; B 146 108 554 446 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 137 108 340 446 ;
+C 173 ; WX 333 ; N guilsinglright ; B 111 108 314 446 ;
+C 174 ; WX 500 ; N fi ; B 86 0 587 728 ;
+C 175 ; WX 500 ; N fl ; B 86 0 585 728 ;
+C 177 ; WX 556 ; N endash ; B 51 240 623 313 ;
+C 178 ; WX 556 ; N dagger ; B 135 -159 622 718 ;
+C 179 ; WX 556 ; N daggerdbl ; B 52 -159 623 718 ;
+C 180 ; WX 278 ; N periodcentered ; B 129 190 257 315 ;
+C 182 ; WX 537 ; N paragraph ; B 126 -173 650 718 ;
+C 183 ; WX 350 ; N bullet ; B 91 202 413 517 ;
+C 184 ; WX 222 ; N quotesinglbase ; B 21 -149 180 106 ;
+C 185 ; WX 333 ; N quotedblbase ; B -6 -149 318 106 ;
+C 186 ; WX 333 ; N quotedblright ; B 124 463 448 718 ;
+C 187 ; WX 556 ; N guillemotright ; B 120 108 528 446 ;
+C 188 ; WX 1000 ; N ellipsis ; B 115 0 908 106 ;
+C 189 ; WX 1000 ; N perthousand ; B 88 -19 1029 703 ;
+C 191 ; WX 611 ; N questiondown ; B 85 -201 534 525 ;
+C 193 ; WX 333 ; N grave ; B 170 593 337 734 ;
+C 194 ; WX 333 ; N acute ; B 248 593 475 734 ;
+C 195 ; WX 333 ; N circumflex ; B 147 593 438 734 ;
+C 196 ; WX 333 ; N tilde ; B 125 606 490 722 ;
+C 197 ; WX 333 ; N macron ; B 143 627 468 684 ;
+C 198 ; WX 333 ; N breve ; B 167 595 476 731 ;
+C 199 ; WX 333 ; N dotaccent ; B 249 604 362 706 ;
+C 200 ; WX 333 ; N dieresis ; B 168 604 443 706 ;
+C 202 ; WX 333 ; N ring ; B 214 572 402 756 ;
+C 203 ; WX 333 ; N cedilla ; B 2 -225 232 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 157 593 565 734 ;
+C 206 ; WX 333 ; N ogonek ; B 43 -225 249 0 ;
+C 207 ; WX 333 ; N caron ; B 177 593 468 734 ;
+C 208 ; WX 1000 ; N emdash ; B 51 240 1067 313 ;
+C 225 ; WX 1000 ; N AE ; B 8 0 1097 718 ;
+C 227 ; WX 370 ; N ordfeminine ; B 100 304 449 737 ;
+C 232 ; WX 556 ; N Lslash ; B 41 0 555 718 ;
+C 233 ; WX 778 ; N Oslash ; B 43 -19 890 737 ;
+C 234 ; WX 1000 ; N OE ; B 98 -19 1116 737 ;
+C 235 ; WX 365 ; N ordmasculine ; B 100 304 468 737 ;
+C 241 ; WX 889 ; N ae ; B 61 -15 909 538 ;
+C 245 ; WX 278 ; N dotlessi ; B 95 0 294 523 ;
+C 248 ; WX 222 ; N lslash ; B 41 0 347 718 ;
+C 249 ; WX 611 ; N oslash ; B 29 -22 647 545 ;
+C 250 ; WX 944 ; N oe ; B 83 -15 964 538 ;
+C 251 ; WX 611 ; N germandbls ; B 67 -15 658 728 ;
+C -1 ; WX 611 ; N Zcaron ; B 23 0 741 929 ;
+C -1 ; WX 500 ; N ccedilla ; B 74 -225 553 538 ;
+C -1 ; WX 500 ; N ydieresis ; B 15 -214 600 706 ;
+C -1 ; WX 556 ; N atilde ; B 61 -15 592 722 ;
+C -1 ; WX 278 ; N icircumflex ; B 95 0 411 734 ;
+C -1 ; WX 333 ; N threesuperior ; B 90 270 436 703 ;
+C -1 ; WX 556 ; N ecircumflex ; B 84 -15 578 734 ;
+C -1 ; WX 556 ; N thorn ; B 14 -207 584 718 ;
+C -1 ; WX 556 ; N egrave ; B 84 -15 578 734 ;
+C -1 ; WX 333 ; N twosuperior ; B 64 281 449 703 ;
+C -1 ; WX 556 ; N eacute ; B 84 -15 587 734 ;
+C -1 ; WX 556 ; N otilde ; B 83 -14 602 722 ;
+C -1 ; WX 667 ; N Aacute ; B 14 0 683 929 ;
+C -1 ; WX 556 ; N ocircumflex ; B 83 -14 585 734 ;
+C -1 ; WX 500 ; N yacute ; B 15 -214 600 734 ;
+C -1 ; WX 556 ; N udieresis ; B 94 -15 600 706 ;
+C -1 ; WX 834 ; N threequarters ; B 130 -19 861 703 ;
+C -1 ; WX 556 ; N acircumflex ; B 61 -15 559 734 ;
+C -1 ; WX 722 ; N Eth ; B 69 0 764 718 ;
+C -1 ; WX 556 ; N edieresis ; B 84 -15 578 706 ;
+C -1 ; WX 556 ; N ugrave ; B 94 -15 600 734 ;
+C -1 ; WX 1000 ; N trademark ; B 186 306 1056 718 ;
+C -1 ; WX 556 ; N ograve ; B 83 -14 585 734 ;
+C -1 ; WX 500 ; N scaron ; B 63 -15 552 734 ;
+C -1 ; WX 278 ; N Idieresis ; B 91 0 458 901 ;
+C -1 ; WX 556 ; N uacute ; B 94 -15 600 734 ;
+C -1 ; WX 556 ; N agrave ; B 61 -15 559 734 ;
+C -1 ; WX 556 ; N ntilde ; B 65 0 592 722 ;
+C -1 ; WX 556 ; N aring ; B 61 -15 559 756 ;
+C -1 ; WX 500 ; N zcaron ; B 31 0 571 734 ;
+C -1 ; WX 278 ; N Icircumflex ; B 91 0 452 929 ;
+C -1 ; WX 722 ; N Ntilde ; B 76 0 799 917 ;
+C -1 ; WX 556 ; N ucircumflex ; B 94 -15 600 734 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 86 0 762 929 ;
+C -1 ; WX 278 ; N Iacute ; B 91 0 489 929 ;
+C -1 ; WX 722 ; N Ccedilla ; B 108 -225 782 737 ;
+C -1 ; WX 778 ; N Odieresis ; B 105 -19 826 901 ;
+C -1 ; WX 667 ; N Scaron ; B 90 -19 713 929 ;
+C -1 ; WX 667 ; N Edieresis ; B 86 0 762 901 ;
+C -1 ; WX 278 ; N Igrave ; B 91 0 351 929 ;
+C -1 ; WX 556 ; N adieresis ; B 61 -15 559 706 ;
+C -1 ; WX 778 ; N Ograve ; B 105 -19 826 929 ;
+C -1 ; WX 667 ; N Egrave ; B 86 0 762 929 ;
+C -1 ; WX 667 ; N Ydieresis ; B 167 0 806 901 ;
+C -1 ; WX 737 ; N registered ; B 54 -19 837 737 ;
+C -1 ; WX 778 ; N Otilde ; B 105 -19 826 917 ;
+C -1 ; WX 834 ; N onequarter ; B 150 -19 802 703 ;
+C -1 ; WX 722 ; N Ugrave ; B 123 -19 797 929 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 123 -19 797 929 ;
+C -1 ; WX 667 ; N Thorn ; B 86 0 712 718 ;
+C -1 ; WX 584 ; N divide ; B 85 -19 606 524 ;
+C -1 ; WX 667 ; N Atilde ; B 14 0 699 917 ;
+C -1 ; WX 722 ; N Uacute ; B 123 -19 797 929 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 105 -19 826 929 ;
+C -1 ; WX 584 ; N logicalnot ; B 106 108 628 390 ;
+C -1 ; WX 667 ; N Aring ; B 14 0 654 931 ;
+C -1 ; WX 278 ; N idieresis ; B 95 0 416 706 ;
+C -1 ; WX 278 ; N iacute ; B 95 0 448 734 ;
+C -1 ; WX 556 ; N aacute ; B 61 -15 587 734 ;
+C -1 ; WX 584 ; N plusminus ; B 39 0 618 506 ;
+C -1 ; WX 584 ; N multiply ; B 50 0 642 506 ;
+C -1 ; WX 722 ; N Udieresis ; B 123 -19 797 901 ;
+C -1 ; WX 584 ; N minus ; B 85 216 606 289 ;
+C -1 ; WX 333 ; N onesuperior ; B 166 281 371 703 ;
+C -1 ; WX 667 ; N Eacute ; B 86 0 762 929 ;
+C -1 ; WX 667 ; N Acircumflex ; B 14 0 654 929 ;
+C -1 ; WX 737 ; N copyright ; B 54 -19 837 737 ;
+C -1 ; WX 667 ; N Agrave ; B 14 0 654 929 ;
+C -1 ; WX 556 ; N odieresis ; B 83 -14 585 706 ;
+C -1 ; WX 556 ; N oacute ; B 83 -14 587 734 ;
+C -1 ; WX 400 ; N degree ; B 169 411 468 703 ;
+C -1 ; WX 278 ; N igrave ; B 95 0 310 734 ;
+C -1 ; WX 556 ; N mu ; B 24 -207 600 523 ;
+C -1 ; WX 778 ; N Oacute ; B 105 -19 826 929 ;
+C -1 ; WX 556 ; N eth ; B 81 -15 617 737 ;
+C -1 ; WX 667 ; N Adieresis ; B 14 0 654 901 ;
+C -1 ; WX 667 ; N Yacute ; B 167 0 806 929 ;
+C -1 ; WX 260 ; N brokenbar ; B 90 -19 324 737 ;
+C -1 ; WX 834 ; N onehalf ; B 114 -19 839 703 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 250
+
+KPX A y -40
+KPX A w -40
+KPX A v -40
+KPX A u -30
+KPX A Y -100
+KPX A W -50
+KPX A V -70
+KPX A U -50
+KPX A T -120
+KPX A Q -30
+KPX A O -30
+KPX A G -30
+KPX A C -30
+
+KPX B period -20
+KPX B comma -20
+KPX B U -10
+
+KPX C period -30
+KPX C comma -30
+
+KPX D period -70
+KPX D comma -70
+KPX D Y -90
+KPX D W -40
+KPX D V -70
+KPX D A -40
+
+KPX F r -45
+KPX F period -150
+KPX F o -30
+KPX F e -30
+KPX F comma -150
+KPX F a -50
+KPX F A -80
+
+KPX J u -20
+KPX J period -30
+KPX J comma -30
+KPX J a -20
+KPX J A -20
+
+KPX K y -50
+KPX K u -30
+KPX K o -40
+KPX K e -40
+KPX K O -50
+
+KPX L y -30
+KPX L quoteright -160
+KPX L quotedblright -140
+KPX L Y -140
+KPX L W -70
+KPX L V -110
+KPX L T -110
+
+KPX O period -40
+KPX O comma -40
+KPX O Y -70
+KPX O X -60
+KPX O W -30
+KPX O V -50
+KPX O T -40
+KPX O A -20
+
+KPX P period -180
+KPX P o -50
+KPX P e -50
+KPX P comma -180
+KPX P a -40
+KPX P A -120
+
+KPX Q U -10
+
+KPX R Y -50
+KPX R W -30
+KPX R V -50
+KPX R U -40
+KPX R T -30
+KPX R O -20
+
+KPX S period -20
+KPX S comma -20
+
+KPX T y -120
+KPX T w -120
+KPX T u -120
+KPX T semicolon -20
+KPX T r -120
+KPX T period -120
+KPX T o -120
+KPX T hyphen -140
+KPX T e -120
+KPX T comma -120
+KPX T colon -20
+KPX T a -120
+KPX T O -40
+KPX T A -120
+
+KPX U period -40
+KPX U comma -40
+KPX U A -40
+
+KPX V u -70
+KPX V semicolon -40
+KPX V period -125
+KPX V o -80
+KPX V hyphen -80
+KPX V e -80
+KPX V comma -125
+KPX V colon -40
+KPX V a -70
+KPX V O -40
+KPX V G -40
+KPX V A -80
+
+KPX W y -20
+KPX W u -30
+KPX W period -80
+KPX W o -30
+KPX W hyphen -40
+KPX W e -30
+KPX W comma -80
+KPX W a -40
+KPX W O -20
+KPX W A -50
+
+KPX Y u -110
+KPX Y semicolon -60
+KPX Y period -140
+KPX Y o -140
+KPX Y i -20
+KPX Y hyphen -140
+KPX Y e -140
+KPX Y comma -140
+KPX Y colon -60
+KPX Y a -140
+KPX Y O -85
+KPX Y A -110
+
+KPX a y -30
+KPX a w -20
+KPX a v -20
+
+KPX b y -20
+KPX b v -20
+KPX b u -20
+KPX b period -40
+KPX b l -20
+KPX b comma -40
+KPX b b -10
+
+KPX c k -20
+KPX c comma -15
+
+KPX colon space -50
+
+KPX comma quoteright -100
+KPX comma quotedblright -100
+
+KPX e y -20
+KPX e x -30
+KPX e w -20
+KPX e v -30
+KPX e period -15
+KPX e comma -15
+
+KPX f quoteright 50
+KPX f quotedblright 60
+KPX f period -30
+KPX f o -30
+KPX f e -30
+KPX f dotlessi -28
+KPX f comma -30
+KPX f a -30
+
+KPX g r -10
+
+KPX h y -30
+
+KPX k o -20
+KPX k e -20
+
+KPX m y -15
+KPX m u -10
+
+KPX n y -15
+KPX n v -20
+KPX n u -10
+
+KPX o y -30
+KPX o x -30
+KPX o w -15
+KPX o v -15
+KPX o period -40
+KPX o comma -40
+
+KPX oslash z -55
+KPX oslash y -70
+KPX oslash x -85
+KPX oslash w -70
+KPX oslash v -70
+KPX oslash u -55
+KPX oslash t -55
+KPX oslash s -55
+KPX oslash r -55
+KPX oslash q -55
+KPX oslash period -95
+KPX oslash p -55
+KPX oslash o -55
+KPX oslash n -55
+KPX oslash m -55
+KPX oslash l -55
+KPX oslash k -55
+KPX oslash j -55
+KPX oslash i -55
+KPX oslash h -55
+KPX oslash g -55
+KPX oslash f -55
+KPX oslash e -55
+KPX oslash d -55
+KPX oslash comma -95
+KPX oslash c -55
+KPX oslash b -55
+KPX oslash a -55
+
+KPX p y -30
+KPX p period -35
+KPX p comma -35
+
+KPX period space -60
+KPX period quoteright -100
+KPX period quotedblright -100
+
+KPX quotedblright space -40
+
+KPX quoteleft quoteleft -57
+
+KPX quoteright space -70
+KPX quoteright s -50
+KPX quoteright r -50
+KPX quoteright quoteright -57
+KPX quoteright d -50
+
+KPX r y 30
+KPX r v 30
+KPX r u 15
+KPX r t 40
+KPX r semicolon 30
+KPX r period -50
+KPX r p 30
+KPX r n 25
+KPX r m 25
+KPX r l 15
+KPX r k 15
+KPX r i 15
+KPX r comma -50
+KPX r colon 30
+KPX r a -10
+
+KPX s w -30
+KPX s period -15
+KPX s comma -15
+
+KPX semicolon space -50
+
+KPX space quoteleft -60
+KPX space quotedblleft -30
+KPX space Y -90
+KPX space W -40
+KPX space V -50
+KPX space T -50
+
+KPX v period -80
+KPX v o -25
+KPX v e -25
+KPX v comma -80
+KPX v a -25
+
+KPX w period -60
+KPX w o -10
+KPX w e -10
+KPX w comma -60
+KPX w a -15
+
+KPX x e -30
+
+KPX y period -100
+KPX y o -20
+KPX y e -20
+KPX y comma -100
+KPX y a -20
+
+KPX z o -15
+KPX z e -15
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 208 195 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 208 195 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 208 195 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 208 195 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 204 175 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 208 195 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 195 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 208 195 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 208 195 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 208 195 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 208 195 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 14 195 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 14 195 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 14 195 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 14 195 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 246 195 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 264 195 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 264 195 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 264 195 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 264 195 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 264 195 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 208 195 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 236 195 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 236 195 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 236 195 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 236 195 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 208 195 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 208 195 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 180 195 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 112 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 102 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 84 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 112 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 112 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 112 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 112 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 102 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 112 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 112 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 112 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 112 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 112 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 84 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 112 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 112 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 112 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 112 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvro8an.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvro8an.afm
new file mode 100644
index 0000000000000000000000000000000000000000..f757319a4c3dbf9e6d4f67cbf339b477aef6c1f3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/phvro8an.afm
@@ -0,0 +1,612 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Thu Mar 15 11:25:48 1990
+Comment UniqueID 28389
+Comment VMusage 7572 42473
+FontName Helvetica-Narrow-Oblique
+FullName Helvetica Narrow Oblique
+FamilyName Helvetica
+Weight Medium
+ItalicAngle -12
+IsFixedPitch false
+FontBBox -139 -225 915 931
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.006
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.Helvetica is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 523
+Ascender 718
+Descender -207
+StartCharMetrics 228
+C 32 ; WX 228 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 228 ; N exclam ; B 74 0 278 718 ;
+C 34 ; WX 291 ; N quotedbl ; B 138 463 359 718 ;
+C 35 ; WX 456 ; N numbersign ; B 60 0 517 688 ;
+C 36 ; WX 456 ; N dollar ; B 57 -115 506 775 ;
+C 37 ; WX 729 ; N percent ; B 120 -19 729 703 ;
+C 38 ; WX 547 ; N ampersand ; B 63 -15 530 718 ;
+C 39 ; WX 182 ; N quoteright ; B 124 463 254 718 ;
+C 40 ; WX 273 ; N parenleft ; B 89 -207 372 733 ;
+C 41 ; WX 273 ; N parenright ; B -7 -207 276 733 ;
+C 42 ; WX 319 ; N asterisk ; B 135 431 389 718 ;
+C 43 ; WX 479 ; N plus ; B 70 0 497 505 ;
+C 44 ; WX 228 ; N comma ; B 46 -147 175 106 ;
+C 45 ; WX 273 ; N hyphen ; B 77 232 293 322 ;
+C 46 ; WX 228 ; N period ; B 71 0 175 106 ;
+C 47 ; WX 228 ; N slash ; B -17 -19 370 737 ;
+C 48 ; WX 456 ; N zero ; B 77 -19 499 703 ;
+C 49 ; WX 456 ; N one ; B 170 0 417 703 ;
+C 50 ; WX 456 ; N two ; B 21 0 506 703 ;
+C 51 ; WX 456 ; N three ; B 61 -19 500 703 ;
+C 52 ; WX 456 ; N four ; B 50 0 472 703 ;
+C 53 ; WX 456 ; N five ; B 55 -19 509 688 ;
+C 54 ; WX 456 ; N six ; B 74 -19 504 703 ;
+C 55 ; WX 456 ; N seven ; B 112 0 549 688 ;
+C 56 ; WX 456 ; N eight ; B 60 -19 497 703 ;
+C 57 ; WX 456 ; N nine ; B 67 -19 499 703 ;
+C 58 ; WX 228 ; N colon ; B 71 0 247 516 ;
+C 59 ; WX 228 ; N semicolon ; B 46 -147 247 516 ;
+C 60 ; WX 479 ; N less ; B 77 11 526 495 ;
+C 61 ; WX 479 ; N equal ; B 52 115 515 390 ;
+C 62 ; WX 479 ; N greater ; B 41 11 490 495 ;
+C 63 ; WX 456 ; N question ; B 132 0 500 727 ;
+C 64 ; WX 832 ; N at ; B 176 -19 791 737 ;
+C 65 ; WX 547 ; N A ; B 11 0 536 718 ;
+C 66 ; WX 547 ; N B ; B 61 0 583 718 ;
+C 67 ; WX 592 ; N C ; B 88 -19 640 737 ;
+C 68 ; WX 592 ; N D ; B 66 0 626 718 ;
+C 69 ; WX 547 ; N E ; B 71 0 625 718 ;
+C 70 ; WX 501 ; N F ; B 71 0 603 718 ;
+C 71 ; WX 638 ; N G ; B 91 -19 655 737 ;
+C 72 ; WX 592 ; N H ; B 63 0 655 718 ;
+C 73 ; WX 228 ; N I ; B 75 0 279 718 ;
+C 74 ; WX 410 ; N J ; B 39 -19 476 718 ;
+C 75 ; WX 547 ; N K ; B 62 0 662 718 ;
+C 76 ; WX 456 ; N L ; B 62 0 455 718 ;
+C 77 ; WX 683 ; N M ; B 60 0 749 718 ;
+C 78 ; WX 592 ; N N ; B 62 0 655 718 ;
+C 79 ; WX 638 ; N O ; B 86 -19 677 737 ;
+C 80 ; WX 547 ; N P ; B 71 0 604 718 ;
+C 81 ; WX 638 ; N Q ; B 86 -56 677 737 ;
+C 82 ; WX 592 ; N R ; B 72 0 634 718 ;
+C 83 ; WX 547 ; N S ; B 74 -19 584 737 ;
+C 84 ; WX 501 ; N T ; B 122 0 615 718 ;
+C 85 ; WX 592 ; N U ; B 101 -19 653 718 ;
+C 86 ; WX 547 ; N V ; B 142 0 656 718 ;
+C 87 ; WX 774 ; N W ; B 138 0 886 718 ;
+C 88 ; WX 547 ; N X ; B 16 0 647 718 ;
+C 89 ; WX 547 ; N Y ; B 137 0 661 718 ;
+C 90 ; WX 501 ; N Z ; B 19 0 607 718 ;
+C 91 ; WX 228 ; N bracketleft ; B 17 -196 331 722 ;
+C 92 ; WX 228 ; N backslash ; B 115 -19 239 737 ;
+C 93 ; WX 228 ; N bracketright ; B -11 -196 302 722 ;
+C 94 ; WX 385 ; N asciicircum ; B 35 264 442 688 ;
+C 95 ; WX 456 ; N underscore ; B -22 -125 443 -75 ;
+C 96 ; WX 182 ; N quoteleft ; B 135 470 265 725 ;
+C 97 ; WX 456 ; N a ; B 50 -15 458 538 ;
+C 98 ; WX 456 ; N b ; B 48 -15 479 718 ;
+C 99 ; WX 410 ; N c ; B 61 -15 454 538 ;
+C 100 ; WX 456 ; N d ; B 69 -15 534 718 ;
+C 101 ; WX 456 ; N e ; B 69 -15 474 538 ;
+C 102 ; WX 228 ; N f ; B 71 0 341 728 ; L i fi ; L l fl ;
+C 103 ; WX 456 ; N g ; B 34 -220 500 538 ;
+C 104 ; WX 456 ; N h ; B 53 0 470 718 ;
+C 105 ; WX 182 ; N i ; B 55 0 252 718 ;
+C 106 ; WX 182 ; N j ; B -49 -210 252 718 ;
+C 107 ; WX 410 ; N k ; B 55 0 492 718 ;
+C 108 ; WX 182 ; N l ; B 55 0 252 718 ;
+C 109 ; WX 683 ; N m ; B 53 0 699 538 ;
+C 110 ; WX 456 ; N n ; B 53 0 470 538 ;
+C 111 ; WX 456 ; N o ; B 68 -14 479 538 ;
+C 112 ; WX 456 ; N p ; B 11 -207 479 538 ;
+C 113 ; WX 456 ; N q ; B 69 -207 496 538 ;
+C 114 ; WX 273 ; N r ; B 63 0 365 538 ;
+C 115 ; WX 410 ; N s ; B 52 -15 434 538 ;
+C 116 ; WX 228 ; N t ; B 84 -7 302 669 ;
+C 117 ; WX 456 ; N u ; B 77 -15 492 523 ;
+C 118 ; WX 410 ; N v ; B 98 0 495 523 ;
+C 119 ; WX 592 ; N w ; B 103 0 673 523 ;
+C 120 ; WX 410 ; N x ; B 9 0 487 523 ;
+C 121 ; WX 410 ; N y ; B 12 -214 492 523 ;
+C 122 ; WX 410 ; N z ; B 25 0 468 523 ;
+C 123 ; WX 274 ; N braceleft ; B 75 -196 365 722 ;
+C 124 ; WX 213 ; N bar ; B 74 -19 265 737 ;
+C 125 ; WX 274 ; N braceright ; B 0 -196 291 722 ;
+C 126 ; WX 479 ; N asciitilde ; B 91 180 476 326 ;
+C 161 ; WX 273 ; N exclamdown ; B 63 -195 267 523 ;
+C 162 ; WX 456 ; N cent ; B 78 -115 479 623 ;
+C 163 ; WX 456 ; N sterling ; B 40 -16 520 718 ;
+C 164 ; WX 137 ; N fraction ; B -139 -19 396 703 ;
+C 165 ; WX 456 ; N yen ; B 67 0 573 688 ;
+C 166 ; WX 456 ; N florin ; B -43 -207 537 737 ;
+C 167 ; WX 456 ; N section ; B 63 -191 479 737 ;
+C 168 ; WX 456 ; N currency ; B 49 99 530 603 ;
+C 169 ; WX 157 ; N quotesingle ; B 129 463 233 718 ;
+C 170 ; WX 273 ; N quotedblleft ; B 113 470 378 725 ;
+C 171 ; WX 456 ; N guillemotleft ; B 120 108 454 446 ;
+C 172 ; WX 273 ; N guilsinglleft ; B 112 108 279 446 ;
+C 173 ; WX 273 ; N guilsinglright ; B 91 108 257 446 ;
+C 174 ; WX 410 ; N fi ; B 71 0 481 728 ;
+C 175 ; WX 410 ; N fl ; B 71 0 479 728 ;
+C 177 ; WX 456 ; N endash ; B 42 240 510 313 ;
+C 178 ; WX 456 ; N dagger ; B 110 -159 510 718 ;
+C 179 ; WX 456 ; N daggerdbl ; B 43 -159 511 718 ;
+C 180 ; WX 228 ; N periodcentered ; B 106 190 211 315 ;
+C 182 ; WX 440 ; N paragraph ; B 103 -173 533 718 ;
+C 183 ; WX 287 ; N bullet ; B 74 202 339 517 ;
+C 184 ; WX 182 ; N quotesinglbase ; B 17 -149 147 106 ;
+C 185 ; WX 273 ; N quotedblbase ; B -5 -149 260 106 ;
+C 186 ; WX 273 ; N quotedblright ; B 102 463 367 718 ;
+C 187 ; WX 456 ; N guillemotright ; B 98 108 433 446 ;
+C 188 ; WX 820 ; N ellipsis ; B 94 0 744 106 ;
+C 189 ; WX 820 ; N perthousand ; B 72 -19 844 703 ;
+C 191 ; WX 501 ; N questiondown ; B 70 -201 438 525 ;
+C 193 ; WX 273 ; N grave ; B 139 593 276 734 ;
+C 194 ; WX 273 ; N acute ; B 203 593 390 734 ;
+C 195 ; WX 273 ; N circumflex ; B 121 593 359 734 ;
+C 196 ; WX 273 ; N tilde ; B 102 606 402 722 ;
+C 197 ; WX 273 ; N macron ; B 117 627 384 684 ;
+C 198 ; WX 273 ; N breve ; B 137 595 391 731 ;
+C 199 ; WX 273 ; N dotaccent ; B 204 604 297 706 ;
+C 200 ; WX 273 ; N dieresis ; B 138 604 363 706 ;
+C 202 ; WX 273 ; N ring ; B 175 572 330 756 ;
+C 203 ; WX 273 ; N cedilla ; B 2 -225 191 0 ;
+C 205 ; WX 273 ; N hungarumlaut ; B 129 593 463 734 ;
+C 206 ; WX 273 ; N ogonek ; B 35 -225 204 0 ;
+C 207 ; WX 273 ; N caron ; B 145 593 384 734 ;
+C 208 ; WX 820 ; N emdash ; B 42 240 875 313 ;
+C 225 ; WX 820 ; N AE ; B 7 0 899 718 ;
+C 227 ; WX 303 ; N ordfeminine ; B 82 304 368 737 ;
+C 232 ; WX 456 ; N Lslash ; B 34 0 455 718 ;
+C 233 ; WX 638 ; N Oslash ; B 35 -19 730 737 ;
+C 234 ; WX 820 ; N OE ; B 80 -19 915 737 ;
+C 235 ; WX 299 ; N ordmasculine ; B 82 304 384 737 ;
+C 241 ; WX 729 ; N ae ; B 50 -15 746 538 ;
+C 245 ; WX 228 ; N dotlessi ; B 78 0 241 523 ;
+C 248 ; WX 182 ; N lslash ; B 34 0 284 718 ;
+C 249 ; WX 501 ; N oslash ; B 24 -22 531 545 ;
+C 250 ; WX 774 ; N oe ; B 68 -15 791 538 ;
+C 251 ; WX 501 ; N germandbls ; B 55 -15 539 728 ;
+C -1 ; WX 501 ; N Zcaron ; B 19 0 607 929 ;
+C -1 ; WX 410 ; N ccedilla ; B 61 -225 454 538 ;
+C -1 ; WX 410 ; N ydieresis ; B 12 -214 492 706 ;
+C -1 ; WX 456 ; N atilde ; B 50 -15 486 722 ;
+C -1 ; WX 228 ; N icircumflex ; B 78 0 337 734 ;
+C -1 ; WX 273 ; N threesuperior ; B 74 270 358 703 ;
+C -1 ; WX 456 ; N ecircumflex ; B 69 -15 474 734 ;
+C -1 ; WX 456 ; N thorn ; B 11 -207 479 718 ;
+C -1 ; WX 456 ; N egrave ; B 69 -15 474 734 ;
+C -1 ; WX 273 ; N twosuperior ; B 52 281 368 703 ;
+C -1 ; WX 456 ; N eacute ; B 69 -15 481 734 ;
+C -1 ; WX 456 ; N otilde ; B 68 -14 494 722 ;
+C -1 ; WX 547 ; N Aacute ; B 11 0 560 929 ;
+C -1 ; WX 456 ; N ocircumflex ; B 68 -14 479 734 ;
+C -1 ; WX 410 ; N yacute ; B 12 -214 492 734 ;
+C -1 ; WX 456 ; N udieresis ; B 77 -15 492 706 ;
+C -1 ; WX 684 ; N threequarters ; B 106 -19 706 703 ;
+C -1 ; WX 456 ; N acircumflex ; B 50 -15 458 734 ;
+C -1 ; WX 592 ; N Eth ; B 57 0 626 718 ;
+C -1 ; WX 456 ; N edieresis ; B 69 -15 474 706 ;
+C -1 ; WX 456 ; N ugrave ; B 77 -15 492 734 ;
+C -1 ; WX 820 ; N trademark ; B 152 306 866 718 ;
+C -1 ; WX 456 ; N ograve ; B 68 -14 479 734 ;
+C -1 ; WX 410 ; N scaron ; B 52 -15 453 734 ;
+C -1 ; WX 228 ; N Idieresis ; B 75 0 375 901 ;
+C -1 ; WX 456 ; N uacute ; B 77 -15 492 734 ;
+C -1 ; WX 456 ; N agrave ; B 50 -15 458 734 ;
+C -1 ; WX 456 ; N ntilde ; B 53 0 486 722 ;
+C -1 ; WX 456 ; N aring ; B 50 -15 458 756 ;
+C -1 ; WX 410 ; N zcaron ; B 25 0 468 734 ;
+C -1 ; WX 228 ; N Icircumflex ; B 75 0 371 929 ;
+C -1 ; WX 592 ; N Ntilde ; B 62 0 655 917 ;
+C -1 ; WX 456 ; N ucircumflex ; B 77 -15 492 734 ;
+C -1 ; WX 547 ; N Ecircumflex ; B 71 0 625 929 ;
+C -1 ; WX 228 ; N Iacute ; B 75 0 401 929 ;
+C -1 ; WX 592 ; N Ccedilla ; B 88 -225 640 737 ;
+C -1 ; WX 638 ; N Odieresis ; B 86 -19 677 901 ;
+C -1 ; WX 547 ; N Scaron ; B 74 -19 584 929 ;
+C -1 ; WX 547 ; N Edieresis ; B 71 0 625 901 ;
+C -1 ; WX 228 ; N Igrave ; B 75 0 288 929 ;
+C -1 ; WX 456 ; N adieresis ; B 50 -15 458 706 ;
+C -1 ; WX 638 ; N Ograve ; B 86 -19 677 929 ;
+C -1 ; WX 547 ; N Egrave ; B 71 0 625 929 ;
+C -1 ; WX 547 ; N Ydieresis ; B 137 0 661 901 ;
+C -1 ; WX 604 ; N registered ; B 44 -19 687 737 ;
+C -1 ; WX 638 ; N Otilde ; B 86 -19 677 917 ;
+C -1 ; WX 684 ; N onequarter ; B 123 -19 658 703 ;
+C -1 ; WX 592 ; N Ugrave ; B 101 -19 653 929 ;
+C -1 ; WX 592 ; N Ucircumflex ; B 101 -19 653 929 ;
+C -1 ; WX 547 ; N Thorn ; B 71 0 584 718 ;
+C -1 ; WX 479 ; N divide ; B 70 -19 497 524 ;
+C -1 ; WX 547 ; N Atilde ; B 11 0 573 917 ;
+C -1 ; WX 592 ; N Uacute ; B 101 -19 653 929 ;
+C -1 ; WX 638 ; N Ocircumflex ; B 86 -19 677 929 ;
+C -1 ; WX 479 ; N logicalnot ; B 87 108 515 390 ;
+C -1 ; WX 547 ; N Aring ; B 11 0 536 931 ;
+C -1 ; WX 228 ; N idieresis ; B 78 0 341 706 ;
+C -1 ; WX 228 ; N iacute ; B 78 0 367 734 ;
+C -1 ; WX 456 ; N aacute ; B 50 -15 481 734 ;
+C -1 ; WX 479 ; N plusminus ; B 32 0 507 506 ;
+C -1 ; WX 479 ; N multiply ; B 41 0 526 506 ;
+C -1 ; WX 592 ; N Udieresis ; B 101 -19 653 901 ;
+C -1 ; WX 479 ; N minus ; B 70 216 497 289 ;
+C -1 ; WX 273 ; N onesuperior ; B 136 281 305 703 ;
+C -1 ; WX 547 ; N Eacute ; B 71 0 625 929 ;
+C -1 ; WX 547 ; N Acircumflex ; B 11 0 536 929 ;
+C -1 ; WX 604 ; N copyright ; B 44 -19 687 737 ;
+C -1 ; WX 547 ; N Agrave ; B 11 0 536 929 ;
+C -1 ; WX 456 ; N odieresis ; B 68 -14 479 706 ;
+C -1 ; WX 456 ; N oacute ; B 68 -14 481 734 ;
+C -1 ; WX 328 ; N degree ; B 138 411 384 703 ;
+C -1 ; WX 228 ; N igrave ; B 78 0 254 734 ;
+C -1 ; WX 456 ; N mu ; B 20 -207 492 523 ;
+C -1 ; WX 638 ; N Oacute ; B 86 -19 677 929 ;
+C -1 ; WX 456 ; N eth ; B 67 -15 506 737 ;
+C -1 ; WX 547 ; N Adieresis ; B 11 0 536 901 ;
+C -1 ; WX 547 ; N Yacute ; B 137 0 661 929 ;
+C -1 ; WX 213 ; N brokenbar ; B 74 -19 265 737 ;
+C -1 ; WX 684 ; N onehalf ; B 93 -19 688 703 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 250
+
+KPX A y -40
+KPX A w -40
+KPX A v -40
+KPX A u -30
+KPX A Y -100
+KPX A W -50
+KPX A V -70
+KPX A U -50
+KPX A T -120
+KPX A Q -30
+KPX A O -30
+KPX A G -30
+KPX A C -30
+
+KPX B period -20
+KPX B comma -20
+KPX B U -10
+
+KPX C period -30
+KPX C comma -30
+
+KPX D period -70
+KPX D comma -70
+KPX D Y -90
+KPX D W -40
+KPX D V -70
+KPX D A -40
+
+KPX F r -45
+KPX F period -150
+KPX F o -30
+KPX F e -30
+KPX F comma -150
+KPX F a -50
+KPX F A -80
+
+KPX J u -20
+KPX J period -30
+KPX J comma -30
+KPX J a -20
+KPX J A -20
+
+KPX K y -50
+KPX K u -30
+KPX K o -40
+KPX K e -40
+KPX K O -50
+
+KPX L y -30
+KPX L quoteright -160
+KPX L quotedblright -140
+KPX L Y -140
+KPX L W -70
+KPX L V -110
+KPX L T -110
+
+KPX O period -40
+KPX O comma -40
+KPX O Y -70
+KPX O X -60
+KPX O W -30
+KPX O V -50
+KPX O T -40
+KPX O A -20
+
+KPX P period -180
+KPX P o -50
+KPX P e -50
+KPX P comma -180
+KPX P a -40
+KPX P A -120
+
+KPX Q U -10
+
+KPX R Y -50
+KPX R W -30
+KPX R V -50
+KPX R U -40
+KPX R T -30
+KPX R O -20
+
+KPX S period -20
+KPX S comma -20
+
+KPX T y -120
+KPX T w -120
+KPX T u -120
+KPX T semicolon -20
+KPX T r -120
+KPX T period -120
+KPX T o -120
+KPX T hyphen -140
+KPX T e -120
+KPX T comma -120
+KPX T colon -20
+KPX T a -120
+KPX T O -40
+KPX T A -120
+
+KPX U period -40
+KPX U comma -40
+KPX U A -40
+
+KPX V u -70
+KPX V semicolon -40
+KPX V period -125
+KPX V o -80
+KPX V hyphen -80
+KPX V e -80
+KPX V comma -125
+KPX V colon -40
+KPX V a -70
+KPX V O -40
+KPX V G -40
+KPX V A -80
+
+KPX W y -20
+KPX W u -30
+KPX W period -80
+KPX W o -30
+KPX W hyphen -40
+KPX W e -30
+KPX W comma -80
+KPX W a -40
+KPX W O -20
+KPX W A -50
+
+KPX Y u -110
+KPX Y semicolon -60
+KPX Y period -140
+KPX Y o -140
+KPX Y i -20
+KPX Y hyphen -140
+KPX Y e -140
+KPX Y comma -140
+KPX Y colon -60
+KPX Y a -140
+KPX Y O -85
+KPX Y A -110
+
+KPX a y -30
+KPX a w -20
+KPX a v -20
+
+KPX b y -20
+KPX b v -20
+KPX b u -20
+KPX b period -40
+KPX b l -20
+KPX b comma -40
+KPX b b -10
+
+KPX c k -20
+KPX c comma -15
+
+KPX colon space -50
+
+KPX comma quoteright -100
+KPX comma quotedblright -100
+
+KPX e y -20
+KPX e x -30
+KPX e w -20
+KPX e v -30
+KPX e period -15
+KPX e comma -15
+
+KPX f quoteright 50
+KPX f quotedblright 60
+KPX f period -30
+KPX f o -30
+KPX f e -30
+KPX f dotlessi -28
+KPX f comma -30
+KPX f a -30
+
+KPX g r -10
+
+KPX h y -30
+
+KPX k o -20
+KPX k e -20
+
+KPX m y -15
+KPX m u -10
+
+KPX n y -15
+KPX n v -20
+KPX n u -10
+
+KPX o y -30
+KPX o x -30
+KPX o w -15
+KPX o v -15
+KPX o period -40
+KPX o comma -40
+
+KPX oslash z -55
+KPX oslash y -70
+KPX oslash x -85
+KPX oslash w -70
+KPX oslash v -70
+KPX oslash u -55
+KPX oslash t -55
+KPX oslash s -55
+KPX oslash r -55
+KPX oslash q -55
+KPX oslash period -95
+KPX oslash p -55
+KPX oslash o -55
+KPX oslash n -55
+KPX oslash m -55
+KPX oslash l -55
+KPX oslash k -55
+KPX oslash j -55
+KPX oslash i -55
+KPX oslash h -55
+KPX oslash g -55
+KPX oslash f -55
+KPX oslash e -55
+KPX oslash d -55
+KPX oslash comma -95
+KPX oslash c -55
+KPX oslash b -55
+KPX oslash a -55
+
+KPX p y -30
+KPX p period -35
+KPX p comma -35
+
+KPX period space -60
+KPX period quoteright -100
+KPX period quotedblright -100
+
+KPX quotedblright space -40
+
+KPX quoteleft quoteleft -57
+
+KPX quoteright space -70
+KPX quoteright s -50
+KPX quoteright r -50
+KPX quoteright quoteright -57
+KPX quoteright d -50
+
+KPX r y 30
+KPX r v 30
+KPX r u 15
+KPX r t 40
+KPX r semicolon 30
+KPX r period -50
+KPX r p 30
+KPX r n 25
+KPX r m 25
+KPX r l 15
+KPX r k 15
+KPX r i 15
+KPX r comma -50
+KPX r colon 30
+KPX r a -10
+
+KPX s w -30
+KPX s period -15
+KPX s comma -15
+
+KPX semicolon space -50
+
+KPX space quoteleft -60
+KPX space quotedblleft -30
+KPX space Y -90
+KPX space W -40
+KPX space V -50
+KPX space T -50
+
+KPX v period -80
+KPX v o -25
+KPX v e -25
+KPX v comma -80
+KPX v a -25
+
+KPX w period -60
+KPX w o -10
+KPX w e -10
+KPX w comma -60
+KPX w a -15
+
+KPX x e -30
+
+KPX y period -100
+KPX y o -20
+KPX y e -20
+KPX y comma -100
+KPX y a -20
+
+KPX z o -15
+KPX z e -15
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 171 195 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 171 195 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 171 195 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 171 195 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 167 175 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 171 195 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 160 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 171 195 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 171 195 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 171 195 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 171 195 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 12 195 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 12 195 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 12 195 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 12 195 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 202 195 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 217 195 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 217 195 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 217 195 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 217 195 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 217 195 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 171 195 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 194 195 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 194 195 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 194 195 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 194 195 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 171 195 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 171 195 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 148 195 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 92 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 92 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 92 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 92 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 92 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 69 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 92 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 92 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 92 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -22 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -22 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -22 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -22 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 92 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 92 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 92 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 92 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 92 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 69 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 92 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 92 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 92 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 92 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 69 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 69 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 69 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncb8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncb8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..ba1fed6d9a3bc1ae584d0d2916a9fdef65ae15f6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncb8a.afm
@@ -0,0 +1,472 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1988, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue May 28 16:48:12 1991
+Comment UniqueID 35031
+Comment VMusage 30773 37665
+FontName NewCenturySchlbk-Bold
+FullName New Century Schoolbook Bold
+FamilyName New Century Schoolbook
+Weight Bold
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -165 -250 1000 988
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.009
+Notice Copyright (c) 1985, 1987, 1988, 1991 Adobe Systems Incorporated. All Rights Reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 722
+XHeight 475
+Ascender 737
+Descender -205
+StartCharMetrics 228
+C 32 ; WX 287 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 296 ; N exclam ; B 53 -15 243 737 ;
+C 34 ; WX 333 ; N quotedbl ; B 0 378 333 737 ;
+C 35 ; WX 574 ; N numbersign ; B 36 0 538 690 ;
+C 36 ; WX 574 ; N dollar ; B 25 -141 549 810 ;
+C 37 ; WX 833 ; N percent ; B 14 -15 819 705 ;
+C 38 ; WX 852 ; N ampersand ; B 34 -15 818 737 ;
+C 39 ; WX 241 ; N quoteright ; B 22 378 220 737 ;
+C 40 ; WX 389 ; N parenleft ; B 77 -117 345 745 ;
+C 41 ; WX 389 ; N parenright ; B 44 -117 312 745 ;
+C 42 ; WX 500 ; N asterisk ; B 54 302 446 737 ;
+C 43 ; WX 606 ; N plus ; B 50 0 556 506 ;
+C 44 ; WX 278 ; N comma ; B 40 -184 238 175 ;
+C 45 ; WX 333 ; N hyphen ; B 42 174 291 302 ;
+C 46 ; WX 278 ; N period ; B 44 -15 234 175 ;
+C 47 ; WX 278 ; N slash ; B -42 -15 320 737 ;
+C 48 ; WX 574 ; N zero ; B 27 -15 547 705 ;
+C 49 ; WX 574 ; N one ; B 83 0 491 705 ;
+C 50 ; WX 574 ; N two ; B 19 0 531 705 ;
+C 51 ; WX 574 ; N three ; B 23 -15 531 705 ;
+C 52 ; WX 574 ; N four ; B 19 0 547 705 ;
+C 53 ; WX 574 ; N five ; B 32 -15 534 705 ;
+C 54 ; WX 574 ; N six ; B 27 -15 547 705 ;
+C 55 ; WX 574 ; N seven ; B 45 -15 547 705 ;
+C 56 ; WX 574 ; N eight ; B 27 -15 548 705 ;
+C 57 ; WX 574 ; N nine ; B 27 -15 547 705 ;
+C 58 ; WX 278 ; N colon ; B 44 -15 234 485 ;
+C 59 ; WX 278 ; N semicolon ; B 40 -184 238 485 ;
+C 60 ; WX 606 ; N less ; B 50 -9 556 515 ;
+C 61 ; WX 606 ; N equal ; B 50 103 556 403 ;
+C 62 ; WX 606 ; N greater ; B 50 -9 556 515 ;
+C 63 ; WX 500 ; N question ; B 23 -15 477 737 ;
+C 64 ; WX 747 ; N at ; B -2 -15 750 737 ;
+C 65 ; WX 759 ; N A ; B -19 0 778 737 ;
+C 66 ; WX 778 ; N B ; B 19 0 739 722 ;
+C 67 ; WX 778 ; N C ; B 39 -15 723 737 ;
+C 68 ; WX 833 ; N D ; B 19 0 794 722 ;
+C 69 ; WX 759 ; N E ; B 19 0 708 722 ;
+C 70 ; WX 722 ; N F ; B 19 0 697 722 ;
+C 71 ; WX 833 ; N G ; B 39 -15 818 737 ;
+C 72 ; WX 870 ; N H ; B 19 0 851 722 ;
+C 73 ; WX 444 ; N I ; B 29 0 415 722 ;
+C 74 ; WX 648 ; N J ; B 6 -15 642 722 ;
+C 75 ; WX 815 ; N K ; B 19 0 822 722 ;
+C 76 ; WX 722 ; N L ; B 19 0 703 722 ;
+C 77 ; WX 981 ; N M ; B 10 0 971 722 ;
+C 78 ; WX 833 ; N N ; B 5 -10 828 722 ;
+C 79 ; WX 833 ; N O ; B 39 -15 794 737 ;
+C 80 ; WX 759 ; N P ; B 24 0 735 722 ;
+C 81 ; WX 833 ; N Q ; B 39 -189 808 737 ;
+C 82 ; WX 815 ; N R ; B 19 -15 815 722 ;
+C 83 ; WX 667 ; N S ; B 51 -15 634 737 ;
+C 84 ; WX 722 ; N T ; B 16 0 706 722 ;
+C 85 ; WX 833 ; N U ; B 14 -15 825 722 ;
+C 86 ; WX 759 ; N V ; B -19 -10 778 722 ;
+C 87 ; WX 981 ; N W ; B 7 -10 974 722 ;
+C 88 ; WX 722 ; N X ; B -12 0 734 722 ;
+C 89 ; WX 722 ; N Y ; B -12 0 734 722 ;
+C 90 ; WX 667 ; N Z ; B 28 0 639 722 ;
+C 91 ; WX 389 ; N bracketleft ; B 84 -109 339 737 ;
+C 92 ; WX 606 ; N backslash ; B 122 -15 484 737 ;
+C 93 ; WX 389 ; N bracketright ; B 50 -109 305 737 ;
+C 94 ; WX 606 ; N asciicircum ; B 66 325 540 690 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 241 ; N quoteleft ; B 22 378 220 737 ;
+C 97 ; WX 611 ; N a ; B 40 -15 601 485 ;
+C 98 ; WX 648 ; N b ; B 4 -15 616 737 ;
+C 99 ; WX 556 ; N c ; B 32 -15 524 485 ;
+C 100 ; WX 667 ; N d ; B 32 -15 644 737 ;
+C 101 ; WX 574 ; N e ; B 32 -15 542 485 ;
+C 102 ; WX 389 ; N f ; B 11 0 461 737 ; L i fi ; L l fl ;
+C 103 ; WX 611 ; N g ; B 30 -205 623 535 ;
+C 104 ; WX 685 ; N h ; B 17 0 662 737 ;
+C 105 ; WX 370 ; N i ; B 26 0 338 737 ;
+C 106 ; WX 352 ; N j ; B -86 -205 271 737 ;
+C 107 ; WX 667 ; N k ; B 17 0 662 737 ;
+C 108 ; WX 352 ; N l ; B 17 0 329 737 ;
+C 109 ; WX 963 ; N m ; B 17 0 940 485 ;
+C 110 ; WX 685 ; N n ; B 17 0 662 485 ;
+C 111 ; WX 611 ; N o ; B 32 -15 579 485 ;
+C 112 ; WX 667 ; N p ; B 17 -205 629 485 ;
+C 113 ; WX 648 ; N q ; B 32 -205 638 485 ;
+C 114 ; WX 519 ; N r ; B 17 0 516 485 ;
+C 115 ; WX 500 ; N s ; B 48 -15 476 485 ;
+C 116 ; WX 426 ; N t ; B 21 -15 405 675 ;
+C 117 ; WX 685 ; N u ; B 17 -15 668 475 ;
+C 118 ; WX 611 ; N v ; B 12 -10 599 475 ;
+C 119 ; WX 889 ; N w ; B 16 -10 873 475 ;
+C 120 ; WX 611 ; N x ; B 12 0 599 475 ;
+C 121 ; WX 611 ; N y ; B 12 -205 599 475 ;
+C 122 ; WX 537 ; N z ; B 38 0 499 475 ;
+C 123 ; WX 389 ; N braceleft ; B 36 -109 313 737 ;
+C 124 ; WX 606 ; N bar ; B 249 -250 357 750 ;
+C 125 ; WX 389 ; N braceright ; B 76 -109 353 737 ;
+C 126 ; WX 606 ; N asciitilde ; B 72 160 534 346 ;
+C 161 ; WX 296 ; N exclamdown ; B 53 -205 243 547 ;
+C 162 ; WX 574 ; N cent ; B 32 -102 528 572 ;
+C 163 ; WX 574 ; N sterling ; B 16 -15 558 705 ;
+C 164 ; WX 167 ; N fraction ; B -165 -15 332 705 ;
+C 165 ; WX 574 ; N yen ; B -10 0 584 690 ;
+C 166 ; WX 574 ; N florin ; B 14 -205 548 737 ;
+C 167 ; WX 500 ; N section ; B 62 -86 438 737 ;
+C 168 ; WX 574 ; N currency ; B 27 84 547 605 ;
+C 169 ; WX 241 ; N quotesingle ; B 53 378 189 737 ;
+C 170 ; WX 481 ; N quotedblleft ; B 22 378 459 737 ;
+C 171 ; WX 500 ; N guillemotleft ; B 46 79 454 397 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 62 79 271 397 ;
+C 173 ; WX 333 ; N guilsinglright ; B 62 79 271 397 ;
+C 174 ; WX 685 ; N fi ; B 11 0 666 737 ;
+C 175 ; WX 685 ; N fl ; B 11 0 666 737 ;
+C 177 ; WX 500 ; N endash ; B 0 184 500 292 ;
+C 178 ; WX 500 ; N dagger ; B 39 -101 461 737 ;
+C 179 ; WX 500 ; N daggerdbl ; B 39 -89 461 737 ;
+C 180 ; WX 278 ; N periodcentered ; B 53 200 225 372 ;
+C 182 ; WX 747 ; N paragraph ; B 96 -71 631 722 ;
+C 183 ; WX 606 ; N bullet ; B 122 180 484 542 ;
+C 184 ; WX 241 ; N quotesinglbase ; B 22 -184 220 175 ;
+C 185 ; WX 481 ; N quotedblbase ; B 22 -184 459 175 ;
+C 186 ; WX 481 ; N quotedblright ; B 22 378 459 737 ;
+C 187 ; WX 500 ; N guillemotright ; B 46 79 454 397 ;
+C 188 ; WX 1000 ; N ellipsis ; B 72 -15 928 175 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -15 993 705 ;
+C 191 ; WX 500 ; N questiondown ; B 23 -205 477 547 ;
+C 193 ; WX 333 ; N grave ; B 2 547 249 737 ;
+C 194 ; WX 333 ; N acute ; B 84 547 331 737 ;
+C 195 ; WX 333 ; N circumflex ; B -10 547 344 725 ;
+C 196 ; WX 333 ; N tilde ; B -24 563 357 705 ;
+C 197 ; WX 333 ; N macron ; B -6 582 339 664 ;
+C 198 ; WX 333 ; N breve ; B 9 547 324 714 ;
+C 199 ; WX 333 ; N dotaccent ; B 95 552 237 694 ;
+C 200 ; WX 333 ; N dieresis ; B -12 552 345 694 ;
+C 202 ; WX 333 ; N ring ; B 58 545 274 761 ;
+C 203 ; WX 333 ; N cedilla ; B 17 -224 248 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -16 547 431 737 ;
+C 206 ; WX 333 ; N ogonek ; B 168 -163 346 3 ;
+C 207 ; WX 333 ; N caron ; B -10 547 344 725 ;
+C 208 ; WX 1000 ; N emdash ; B 0 184 1000 292 ;
+C 225 ; WX 981 ; N AE ; B -29 0 963 722 ;
+C 227 ; WX 367 ; N ordfeminine ; B 1 407 393 705 ;
+C 232 ; WX 722 ; N Lslash ; B 19 0 703 722 ;
+C 233 ; WX 833 ; N Oslash ; B 39 -53 794 775 ;
+C 234 ; WX 1000 ; N OE ; B 0 0 982 722 ;
+C 235 ; WX 367 ; N ordmasculine ; B 1 407 366 705 ;
+C 241 ; WX 870 ; N ae ; B 32 -15 838 485 ;
+C 245 ; WX 370 ; N dotlessi ; B 26 0 338 475 ;
+C 248 ; WX 352 ; N lslash ; B 17 0 329 737 ;
+C 249 ; WX 611 ; N oslash ; B 32 -103 579 573 ;
+C 250 ; WX 907 ; N oe ; B 32 -15 875 485 ;
+C 251 ; WX 611 ; N germandbls ; B -2 -15 580 737 ;
+C -1 ; WX 574 ; N ecircumflex ; B 32 -15 542 725 ;
+C -1 ; WX 574 ; N edieresis ; B 32 -15 542 694 ;
+C -1 ; WX 611 ; N aacute ; B 40 -15 601 737 ;
+C -1 ; WX 747 ; N registered ; B -2 -15 750 737 ;
+C -1 ; WX 370 ; N icircumflex ; B 9 0 363 725 ;
+C -1 ; WX 685 ; N udieresis ; B 17 -15 668 694 ;
+C -1 ; WX 611 ; N ograve ; B 32 -15 579 737 ;
+C -1 ; WX 685 ; N uacute ; B 17 -15 668 737 ;
+C -1 ; WX 685 ; N ucircumflex ; B 17 -15 668 725 ;
+C -1 ; WX 759 ; N Aacute ; B -19 0 778 964 ;
+C -1 ; WX 370 ; N igrave ; B 21 0 338 737 ;
+C -1 ; WX 444 ; N Icircumflex ; B 29 0 415 952 ;
+C -1 ; WX 556 ; N ccedilla ; B 32 -224 524 485 ;
+C -1 ; WX 611 ; N adieresis ; B 40 -15 601 694 ;
+C -1 ; WX 759 ; N Ecircumflex ; B 19 0 708 952 ;
+C -1 ; WX 500 ; N scaron ; B 48 -15 476 725 ;
+C -1 ; WX 667 ; N thorn ; B 17 -205 629 737 ;
+C -1 ; WX 1000 ; N trademark ; B 6 317 982 722 ;
+C -1 ; WX 574 ; N egrave ; B 32 -15 542 737 ;
+C -1 ; WX 344 ; N threesuperior ; B -3 273 355 705 ;
+C -1 ; WX 537 ; N zcaron ; B 38 0 499 725 ;
+C -1 ; WX 611 ; N atilde ; B 40 -15 601 705 ;
+C -1 ; WX 611 ; N aring ; B 40 -15 601 761 ;
+C -1 ; WX 611 ; N ocircumflex ; B 32 -15 579 725 ;
+C -1 ; WX 759 ; N Edieresis ; B 19 0 708 921 ;
+C -1 ; WX 861 ; N threequarters ; B 15 -15 838 705 ;
+C -1 ; WX 611 ; N ydieresis ; B 12 -205 599 694 ;
+C -1 ; WX 611 ; N yacute ; B 12 -205 599 737 ;
+C -1 ; WX 370 ; N iacute ; B 26 0 350 737 ;
+C -1 ; WX 759 ; N Acircumflex ; B -19 0 778 952 ;
+C -1 ; WX 833 ; N Uacute ; B 14 -15 825 964 ;
+C -1 ; WX 574 ; N eacute ; B 32 -15 542 737 ;
+C -1 ; WX 833 ; N Ograve ; B 39 -15 794 964 ;
+C -1 ; WX 611 ; N agrave ; B 40 -15 601 737 ;
+C -1 ; WX 833 ; N Udieresis ; B 14 -15 825 921 ;
+C -1 ; WX 611 ; N acircumflex ; B 40 -15 601 725 ;
+C -1 ; WX 444 ; N Igrave ; B 29 0 415 964 ;
+C -1 ; WX 344 ; N twosuperior ; B -3 282 350 705 ;
+C -1 ; WX 833 ; N Ugrave ; B 14 -15 825 964 ;
+C -1 ; WX 861 ; N onequarter ; B 31 -15 838 705 ;
+C -1 ; WX 833 ; N Ucircumflex ; B 14 -15 825 952 ;
+C -1 ; WX 667 ; N Scaron ; B 51 -15 634 952 ;
+C -1 ; WX 444 ; N Idieresis ; B 29 0 415 921 ;
+C -1 ; WX 370 ; N idieresis ; B 7 0 364 694 ;
+C -1 ; WX 759 ; N Egrave ; B 19 0 708 964 ;
+C -1 ; WX 833 ; N Oacute ; B 39 -15 794 964 ;
+C -1 ; WX 606 ; N divide ; B 50 -40 556 546 ;
+C -1 ; WX 759 ; N Atilde ; B -19 0 778 932 ;
+C -1 ; WX 759 ; N Aring ; B -19 0 778 988 ;
+C -1 ; WX 833 ; N Odieresis ; B 39 -15 794 921 ;
+C -1 ; WX 759 ; N Adieresis ; B -19 0 778 921 ;
+C -1 ; WX 833 ; N Ntilde ; B 5 -10 828 932 ;
+C -1 ; WX 667 ; N Zcaron ; B 28 0 639 952 ;
+C -1 ; WX 759 ; N Thorn ; B 24 0 735 722 ;
+C -1 ; WX 444 ; N Iacute ; B 29 0 415 964 ;
+C -1 ; WX 606 ; N plusminus ; B 50 0 556 506 ;
+C -1 ; WX 606 ; N multiply ; B 65 15 541 491 ;
+C -1 ; WX 759 ; N Eacute ; B 19 0 708 964 ;
+C -1 ; WX 722 ; N Ydieresis ; B -12 0 734 921 ;
+C -1 ; WX 344 ; N onesuperior ; B 31 282 309 705 ;
+C -1 ; WX 685 ; N ugrave ; B 17 -15 668 737 ;
+C -1 ; WX 606 ; N logicalnot ; B 50 103 556 403 ;
+C -1 ; WX 685 ; N ntilde ; B 17 0 662 705 ;
+C -1 ; WX 833 ; N Otilde ; B 39 -15 794 932 ;
+C -1 ; WX 611 ; N otilde ; B 32 -15 579 705 ;
+C -1 ; WX 778 ; N Ccedilla ; B 39 -224 723 737 ;
+C -1 ; WX 759 ; N Agrave ; B -19 0 778 964 ;
+C -1 ; WX 861 ; N onehalf ; B 31 -15 838 705 ;
+C -1 ; WX 833 ; N Eth ; B 19 0 794 722 ;
+C -1 ; WX 400 ; N degree ; B 57 419 343 705 ;
+C -1 ; WX 722 ; N Yacute ; B -12 0 734 964 ;
+C -1 ; WX 833 ; N Ocircumflex ; B 39 -15 794 952 ;
+C -1 ; WX 611 ; N oacute ; B 32 -15 579 737 ;
+C -1 ; WX 685 ; N mu ; B 17 -205 668 475 ;
+C -1 ; WX 606 ; N minus ; B 50 199 556 307 ;
+C -1 ; WX 611 ; N eth ; B 32 -15 579 737 ;
+C -1 ; WX 611 ; N odieresis ; B 32 -15 579 694 ;
+C -1 ; WX 747 ; N copyright ; B -2 -15 750 737 ;
+C -1 ; WX 606 ; N brokenbar ; B 249 -175 357 675 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 128
+
+KPX A y -18
+KPX A w -18
+KPX A v -18
+KPX A quoteright -74
+KPX A quotedblright -74
+KPX A Y -91
+KPX A W -74
+KPX A V -74
+KPX A U -18
+KPX A T -55
+
+KPX C period -18
+KPX C comma -18
+
+KPX D period -25
+KPX D comma -25
+
+KPX F r -18
+KPX F period -125
+KPX F o -55
+KPX F i -18
+KPX F e -55
+KPX F comma -125
+KPX F a -74
+
+KPX J u -18
+KPX J period -55
+KPX J o -18
+KPX J e -18
+KPX J comma -55
+KPX J a -18
+KPX J A -18
+
+KPX K y -25
+KPX K u -18
+
+KPX L y -25
+KPX L quoteright -100
+KPX L quotedblright -100
+KPX L Y -74
+KPX L W -74
+KPX L V -100
+KPX L T -100
+
+KPX N period -18
+KPX N comma -18
+
+KPX O period -25
+KPX O comma -25
+KPX O T 10
+
+KPX P period -150
+KPX P o -55
+KPX P e -55
+KPX P comma -150
+KPX P a -55
+KPX P A -74
+
+KPX S period -18
+KPX S comma -18
+
+KPX T u -18
+KPX T r -18
+KPX T period -100
+KPX T o -74
+KPX T i -18
+KPX T hyphen -125
+KPX T e -74
+KPX T comma -100
+KPX T a -74
+KPX T O 10
+KPX T A -55
+
+KPX U period -25
+KPX U comma -25
+KPX U A -18
+
+KPX V u -55
+KPX V semicolon -37
+KPX V period -125
+KPX V o -74
+KPX V i -18
+KPX V hyphen -100
+KPX V e -74
+KPX V comma -125
+KPX V colon -37
+KPX V a -74
+KPX V A -74
+
+KPX W y -25
+KPX W u -37
+KPX W semicolon -55
+KPX W period -100
+KPX W o -74
+KPX W i -18
+KPX W hyphen -100
+KPX W e -74
+KPX W comma -100
+KPX W colon -55
+KPX W a -74
+KPX W A -74
+
+KPX Y u -55
+KPX Y semicolon -25
+KPX Y period -100
+KPX Y o -100
+KPX Y i -18
+KPX Y hyphen -125
+KPX Y e -100
+KPX Y comma -100
+KPX Y colon -25
+KPX Y a -100
+KPX Y A -91
+
+KPX colon space -18
+
+KPX comma space -18
+KPX comma quoteright -18
+KPX comma quotedblright -18
+
+KPX f quoteright 75
+KPX f quotedblright 75
+
+KPX period space -18
+KPX period quoteright -18
+KPX period quotedblright -18
+
+KPX quotedblleft A -74
+
+KPX quotedblright space -18
+
+KPX quoteleft A -74
+
+KPX quoteright s -25
+KPX quoteright d -25
+
+KPX r period -74
+KPX r comma -74
+
+KPX semicolon space -18
+
+KPX space quoteleft -18
+KPX space quotedblleft -18
+KPX space Y -18
+KPX space W -18
+KPX space V -18
+KPX space T -18
+KPX space A -18
+
+KPX v period -100
+KPX v comma -100
+
+KPX w period -100
+KPX w comma -100
+
+KPX y period -100
+KPX y comma -100
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 213 227 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 213 227 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 213 227 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 213 227 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 213 227 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 213 227 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 213 227 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 213 227 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 213 227 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 213 227 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 56 227 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 56 227 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 56 227 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 56 227 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 250 227 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 250 227 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 250 227 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 250 227 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 250 227 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 250 227 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 167 227 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 250 227 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 250 227 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 250 227 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 250 227 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 195 227 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 195 227 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 167 227 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 139 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 139 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 139 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 139 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 139 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 139 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 121 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 121 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 121 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 121 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 19 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex 19 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis 19 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 19 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 176 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 139 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 139 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 139 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 139 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 139 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 84 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 176 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 176 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 176 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 176 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 139 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 139 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 102 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncbi8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncbi8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..7871147e0f7bc53cf4e0bc8516807b7b10cd78cd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncbi8a.afm
@@ -0,0 +1,602 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue May 28 16:56:07 1991
+Comment UniqueID 35034
+Comment VMusage 31030 37922
+FontName NewCenturySchlbk-BoldItalic
+FullName New Century Schoolbook Bold Italic
+FamilyName New Century Schoolbook
+Weight Bold
+ItalicAngle -16
+IsFixedPitch false
+FontBBox -205 -250 1147 991
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 722
+XHeight 477
+Ascender 737
+Descender -205
+StartCharMetrics 228
+C 32 ; WX 287 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 0 -15 333 737 ;
+C 34 ; WX 400 ; N quotedbl ; B 66 388 428 737 ;
+C 35 ; WX 574 ; N numbersign ; B 30 0 544 690 ;
+C 36 ; WX 574 ; N dollar ; B 9 -120 565 810 ;
+C 37 ; WX 889 ; N percent ; B 54 -28 835 727 ;
+C 38 ; WX 889 ; N ampersand ; B 32 -15 823 737 ;
+C 39 ; WX 259 ; N quoteright ; B 48 388 275 737 ;
+C 40 ; WX 407 ; N parenleft ; B 72 -117 454 745 ;
+C 41 ; WX 407 ; N parenright ; B -70 -117 310 745 ;
+C 42 ; WX 500 ; N asterisk ; B 58 301 498 737 ;
+C 43 ; WX 606 ; N plus ; B 50 0 556 506 ;
+C 44 ; WX 287 ; N comma ; B -57 -192 170 157 ;
+C 45 ; WX 333 ; N hyphen ; B 2 177 263 299 ;
+C 46 ; WX 287 ; N period ; B -20 -15 152 157 ;
+C 47 ; WX 278 ; N slash ; B -41 -15 320 737 ;
+C 48 ; WX 574 ; N zero ; B 21 -15 553 705 ;
+C 49 ; WX 574 ; N one ; B 25 0 489 705 ;
+C 50 ; WX 574 ; N two ; B -38 -3 538 705 ;
+C 51 ; WX 574 ; N three ; B -7 -15 536 705 ;
+C 52 ; WX 574 ; N four ; B -13 0 544 705 ;
+C 53 ; WX 574 ; N five ; B 0 -15 574 705 ;
+C 54 ; WX 574 ; N six ; B 31 -15 574 705 ;
+C 55 ; WX 574 ; N seven ; B 64 -15 593 705 ;
+C 56 ; WX 574 ; N eight ; B 0 -15 552 705 ;
+C 57 ; WX 574 ; N nine ; B 0 -15 543 705 ;
+C 58 ; WX 287 ; N colon ; B -20 -15 237 477 ;
+C 59 ; WX 287 ; N semicolon ; B -57 -192 237 477 ;
+C 60 ; WX 606 ; N less ; B 50 -9 556 515 ;
+C 61 ; WX 606 ; N equal ; B 50 103 556 403 ;
+C 62 ; WX 606 ; N greater ; B 50 -8 556 514 ;
+C 63 ; WX 481 ; N question ; B 79 -15 451 737 ;
+C 64 ; WX 747 ; N at ; B -4 -15 751 737 ;
+C 65 ; WX 741 ; N A ; B -75 0 716 737 ;
+C 66 ; WX 759 ; N B ; B -50 0 721 722 ;
+C 67 ; WX 759 ; N C ; B 37 -15 759 737 ;
+C 68 ; WX 833 ; N D ; B -47 0 796 722 ;
+C 69 ; WX 741 ; N E ; B -41 0 730 722 ;
+C 70 ; WX 704 ; N F ; B -41 0 730 722 ;
+C 71 ; WX 815 ; N G ; B 37 -15 805 737 ;
+C 72 ; WX 870 ; N H ; B -41 0 911 722 ;
+C 73 ; WX 444 ; N I ; B -41 0 485 722 ;
+C 74 ; WX 667 ; N J ; B -20 -15 708 722 ;
+C 75 ; WX 778 ; N K ; B -41 0 832 722 ;
+C 76 ; WX 704 ; N L ; B -41 0 670 722 ;
+C 77 ; WX 944 ; N M ; B -44 0 988 722 ;
+C 78 ; WX 852 ; N N ; B -61 -10 913 722 ;
+C 79 ; WX 833 ; N O ; B 37 -15 796 737 ;
+C 80 ; WX 741 ; N P ; B -41 0 730 722 ;
+C 81 ; WX 833 ; N Q ; B 37 -189 796 737 ;
+C 82 ; WX 796 ; N R ; B -41 -15 749 722 ;
+C 83 ; WX 685 ; N S ; B 1 -15 666 737 ;
+C 84 ; WX 722 ; N T ; B 41 0 759 722 ;
+C 85 ; WX 833 ; N U ; B 88 -15 900 722 ;
+C 86 ; WX 741 ; N V ; B 32 -10 802 722 ;
+C 87 ; WX 944 ; N W ; B 40 -10 1000 722 ;
+C 88 ; WX 741 ; N X ; B -82 0 801 722 ;
+C 89 ; WX 704 ; N Y ; B 13 0 775 722 ;
+C 90 ; WX 704 ; N Z ; B -33 0 711 722 ;
+C 91 ; WX 407 ; N bracketleft ; B 1 -109 464 737 ;
+C 92 ; WX 606 ; N backslash ; B 161 -15 445 737 ;
+C 93 ; WX 407 ; N bracketright ; B -101 -109 362 737 ;
+C 94 ; WX 606 ; N asciicircum ; B 66 325 540 690 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 259 ; N quoteleft ; B 47 388 274 737 ;
+C 97 ; WX 667 ; N a ; B 6 -15 636 477 ;
+C 98 ; WX 611 ; N b ; B 29 -15 557 737 ;
+C 99 ; WX 537 ; N c ; B 0 -15 482 477 ;
+C 100 ; WX 667 ; N d ; B 0 -15 660 737 ;
+C 101 ; WX 519 ; N e ; B 0 -15 479 477 ;
+C 102 ; WX 389 ; N f ; B -48 -205 550 737 ; L i fi ; L l fl ;
+C 103 ; WX 611 ; N g ; B -63 -205 604 528 ;
+C 104 ; WX 685 ; N h ; B 0 -15 639 737 ;
+C 105 ; WX 389 ; N i ; B 32 -15 345 737 ;
+C 106 ; WX 370 ; N j ; B -205 -205 347 737 ;
+C 107 ; WX 648 ; N k ; B -11 -15 578 737 ;
+C 108 ; WX 389 ; N l ; B 32 -15 375 737 ;
+C 109 ; WX 944 ; N m ; B 0 -15 909 477 ;
+C 110 ; WX 685 ; N n ; B 0 -15 639 477 ;
+C 111 ; WX 574 ; N o ; B 0 -15 530 477 ;
+C 112 ; WX 648 ; N p ; B -119 -205 590 477 ;
+C 113 ; WX 630 ; N q ; B 0 -205 587 477 ;
+C 114 ; WX 519 ; N r ; B 0 0 527 486 ;
+C 115 ; WX 481 ; N s ; B 0 -15 435 477 ;
+C 116 ; WX 407 ; N t ; B 24 -15 403 650 ;
+C 117 ; WX 685 ; N u ; B 30 -15 635 477 ;
+C 118 ; WX 556 ; N v ; B 30 -15 496 477 ;
+C 119 ; WX 833 ; N w ; B 30 -15 773 477 ;
+C 120 ; WX 574 ; N x ; B -46 -15 574 477 ;
+C 121 ; WX 519 ; N y ; B -66 -205 493 477 ;
+C 122 ; WX 519 ; N z ; B -19 -15 473 477 ;
+C 123 ; WX 407 ; N braceleft ; B 52 -109 408 737 ;
+C 124 ; WX 606 ; N bar ; B 249 -250 357 750 ;
+C 125 ; WX 407 ; N braceright ; B -25 -109 331 737 ;
+C 126 ; WX 606 ; N asciitilde ; B 72 160 534 346 ;
+C 161 ; WX 333 ; N exclamdown ; B -44 -205 289 547 ;
+C 162 ; WX 574 ; N cent ; B 30 -144 512 578 ;
+C 163 ; WX 574 ; N sterling ; B -18 -15 566 705 ;
+C 164 ; WX 167 ; N fraction ; B -166 -15 333 705 ;
+C 165 ; WX 574 ; N yen ; B 17 0 629 690 ;
+C 166 ; WX 574 ; N florin ; B -43 -205 575 737 ;
+C 167 ; WX 500 ; N section ; B -30 -146 515 737 ;
+C 168 ; WX 574 ; N currency ; B 27 84 547 605 ;
+C 169 ; WX 287 ; N quotesingle ; B 112 388 250 737 ;
+C 170 ; WX 481 ; N quotedblleft ; B 54 388 521 737 ;
+C 171 ; WX 481 ; N guillemotleft ; B -35 69 449 407 ;
+C 172 ; WX 278 ; N guilsinglleft ; B -25 69 244 407 ;
+C 173 ; WX 278 ; N guilsinglright ; B -26 69 243 407 ;
+C 174 ; WX 685 ; N fi ; B -70 -205 641 737 ;
+C 175 ; WX 685 ; N fl ; B -70 -205 671 737 ;
+C 177 ; WX 500 ; N endash ; B -47 189 479 287 ;
+C 178 ; WX 500 ; N dagger ; B 48 -146 508 737 ;
+C 179 ; WX 500 ; N daggerdbl ; B -60 -150 508 737 ;
+C 180 ; WX 287 ; N periodcentered ; B 57 200 229 372 ;
+C 182 ; WX 650 ; N paragraph ; B 25 -131 681 722 ;
+C 183 ; WX 606 ; N bullet ; B 122 180 484 542 ;
+C 184 ; WX 259 ; N quotesinglbase ; B -57 -192 170 157 ;
+C 185 ; WX 481 ; N quotedblbase ; B -57 -192 412 157 ;
+C 186 ; WX 481 ; N quotedblright ; B 43 388 510 737 ;
+C 187 ; WX 481 ; N guillemotright ; B -31 69 453 407 ;
+C 188 ; WX 1000 ; N ellipsis ; B 81 -15 919 157 ;
+C 189 ; WX 1167 ; N perthousand ; B 20 -28 1147 727 ;
+C 191 ; WX 481 ; N questiondown ; B 0 -205 372 547 ;
+C 193 ; WX 333 ; N grave ; B 74 538 294 722 ;
+C 194 ; WX 333 ; N acute ; B 123 538 372 722 ;
+C 195 ; WX 333 ; N circumflex ; B 23 533 365 705 ;
+C 196 ; WX 333 ; N tilde ; B 28 561 398 690 ;
+C 197 ; WX 333 ; N macron ; B 47 573 404 649 ;
+C 198 ; WX 333 ; N breve ; B 67 535 390 698 ;
+C 199 ; WX 333 ; N dotaccent ; B 145 546 289 690 ;
+C 200 ; WX 333 ; N dieresis ; B 33 546 393 690 ;
+C 202 ; WX 333 ; N ring ; B 111 522 335 746 ;
+C 203 ; WX 333 ; N cedilla ; B -21 -220 225 3 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 15 538 480 722 ;
+C 206 ; WX 333 ; N ogonek ; B 68 -155 246 -10 ;
+C 207 ; WX 333 ; N caron ; B 60 531 403 705 ;
+C 208 ; WX 1000 ; N emdash ; B -47 189 979 287 ;
+C 225 ; WX 889 ; N AE ; B -86 0 915 722 ;
+C 227 ; WX 412 ; N ordfeminine ; B 47 407 460 705 ;
+C 232 ; WX 704 ; N Lslash ; B -41 0 670 722 ;
+C 233 ; WX 833 ; N Oslash ; B 35 -68 798 790 ;
+C 234 ; WX 963 ; N OE ; B 29 0 989 722 ;
+C 235 ; WX 356 ; N ordmasculine ; B 42 407 394 705 ;
+C 241 ; WX 815 ; N ae ; B -18 -15 775 477 ;
+C 245 ; WX 389 ; N dotlessi ; B 32 -15 345 477 ;
+C 248 ; WX 389 ; N lslash ; B 5 -15 390 737 ;
+C 249 ; WX 574 ; N oslash ; B 0 -121 530 583 ;
+C 250 ; WX 852 ; N oe ; B -6 -15 812 477 ;
+C 251 ; WX 574 ; N germandbls ; B -91 -205 540 737 ;
+C -1 ; WX 519 ; N ecircumflex ; B 0 -15 479 705 ;
+C -1 ; WX 519 ; N edieresis ; B 0 -15 486 690 ;
+C -1 ; WX 667 ; N aacute ; B 6 -15 636 722 ;
+C -1 ; WX 747 ; N registered ; B -2 -15 750 737 ;
+C -1 ; WX 389 ; N icircumflex ; B 21 -15 363 698 ;
+C -1 ; WX 685 ; N udieresis ; B 30 -15 635 690 ;
+C -1 ; WX 574 ; N ograve ; B 0 -15 530 722 ;
+C -1 ; WX 685 ; N uacute ; B 30 -15 635 722 ;
+C -1 ; WX 685 ; N ucircumflex ; B 30 -15 635 705 ;
+C -1 ; WX 741 ; N Aacute ; B -75 0 716 947 ;
+C -1 ; WX 389 ; N igrave ; B 32 -15 345 715 ;
+C -1 ; WX 444 ; N Icircumflex ; B -41 0 485 930 ;
+C -1 ; WX 537 ; N ccedilla ; B 0 -220 482 477 ;
+C -1 ; WX 667 ; N adieresis ; B 6 -15 636 690 ;
+C -1 ; WX 741 ; N Ecircumflex ; B -41 0 730 930 ;
+C -1 ; WX 481 ; N scaron ; B 0 -15 477 705 ;
+C -1 ; WX 648 ; N thorn ; B -119 -205 590 737 ;
+C -1 ; WX 950 ; N trademark ; B 42 317 1017 722 ;
+C -1 ; WX 519 ; N egrave ; B 0 -15 479 722 ;
+C -1 ; WX 344 ; N threesuperior ; B 3 273 361 705 ;
+C -1 ; WX 519 ; N zcaron ; B -19 -15 473 695 ;
+C -1 ; WX 667 ; N atilde ; B 6 -15 636 690 ;
+C -1 ; WX 667 ; N aring ; B 6 -15 636 746 ;
+C -1 ; WX 574 ; N ocircumflex ; B 0 -15 530 705 ;
+C -1 ; WX 741 ; N Edieresis ; B -41 0 730 915 ;
+C -1 ; WX 861 ; N threequarters ; B 35 -15 789 705 ;
+C -1 ; WX 519 ; N ydieresis ; B -66 -205 493 690 ;
+C -1 ; WX 519 ; N yacute ; B -66 -205 493 722 ;
+C -1 ; WX 389 ; N iacute ; B 32 -15 370 715 ;
+C -1 ; WX 741 ; N Acircumflex ; B -75 0 716 930 ;
+C -1 ; WX 833 ; N Uacute ; B 88 -15 900 947 ;
+C -1 ; WX 519 ; N eacute ; B 0 -15 479 722 ;
+C -1 ; WX 833 ; N Ograve ; B 37 -15 796 947 ;
+C -1 ; WX 667 ; N agrave ; B 6 -15 636 722 ;
+C -1 ; WX 833 ; N Udieresis ; B 88 -15 900 915 ;
+C -1 ; WX 667 ; N acircumflex ; B 6 -15 636 705 ;
+C -1 ; WX 444 ; N Igrave ; B -41 0 485 947 ;
+C -1 ; WX 344 ; N twosuperior ; B -17 280 362 705 ;
+C -1 ; WX 833 ; N Ugrave ; B 88 -15 900 947 ;
+C -1 ; WX 861 ; N onequarter ; B 17 -15 789 705 ;
+C -1 ; WX 833 ; N Ucircumflex ; B 88 -15 900 930 ;
+C -1 ; WX 685 ; N Scaron ; B 1 -15 666 930 ;
+C -1 ; WX 444 ; N Idieresis ; B -41 0 509 915 ;
+C -1 ; WX 389 ; N idieresis ; B 31 -15 391 683 ;
+C -1 ; WX 741 ; N Egrave ; B -41 0 730 947 ;
+C -1 ; WX 833 ; N Oacute ; B 37 -15 796 947 ;
+C -1 ; WX 606 ; N divide ; B 50 -40 556 546 ;
+C -1 ; WX 741 ; N Atilde ; B -75 0 716 915 ;
+C -1 ; WX 741 ; N Aring ; B -75 0 716 991 ;
+C -1 ; WX 833 ; N Odieresis ; B 37 -15 796 915 ;
+C -1 ; WX 741 ; N Adieresis ; B -75 0 716 915 ;
+C -1 ; WX 852 ; N Ntilde ; B -61 -10 913 915 ;
+C -1 ; WX 704 ; N Zcaron ; B -33 0 711 930 ;
+C -1 ; WX 741 ; N Thorn ; B -41 0 690 722 ;
+C -1 ; WX 444 ; N Iacute ; B -41 0 488 947 ;
+C -1 ; WX 606 ; N plusminus ; B 50 0 556 506 ;
+C -1 ; WX 606 ; N multiply ; B 65 15 541 491 ;
+C -1 ; WX 741 ; N Eacute ; B -41 0 730 947 ;
+C -1 ; WX 704 ; N Ydieresis ; B 13 0 775 915 ;
+C -1 ; WX 344 ; N onesuperior ; B 19 282 326 705 ;
+C -1 ; WX 685 ; N ugrave ; B 30 -15 635 722 ;
+C -1 ; WX 606 ; N logicalnot ; B 50 103 556 403 ;
+C -1 ; WX 685 ; N ntilde ; B 0 -15 639 690 ;
+C -1 ; WX 833 ; N Otilde ; B 37 -15 796 915 ;
+C -1 ; WX 574 ; N otilde ; B 0 -15 530 690 ;
+C -1 ; WX 759 ; N Ccedilla ; B 37 -220 759 737 ;
+C -1 ; WX 741 ; N Agrave ; B -75 0 716 947 ;
+C -1 ; WX 861 ; N onehalf ; B 17 -15 798 705 ;
+C -1 ; WX 833 ; N Eth ; B -47 0 796 722 ;
+C -1 ; WX 400 ; N degree ; B 86 419 372 705 ;
+C -1 ; WX 704 ; N Yacute ; B 13 0 775 947 ;
+C -1 ; WX 833 ; N Ocircumflex ; B 37 -15 796 930 ;
+C -1 ; WX 574 ; N oacute ; B 0 -15 530 722 ;
+C -1 ; WX 685 ; N mu ; B -89 -205 635 477 ;
+C -1 ; WX 606 ; N minus ; B 50 199 556 307 ;
+C -1 ; WX 574 ; N eth ; B 0 -15 530 752 ;
+C -1 ; WX 574 ; N odieresis ; B 0 -15 530 690 ;
+C -1 ; WX 747 ; N copyright ; B -2 -15 750 737 ;
+C -1 ; WX 606 ; N brokenbar ; B 249 -175 357 675 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 239
+
+KPX A y -33
+KPX A w -25
+KPX A v -10
+KPX A u -15
+KPX A quoteright -95
+KPX A quotedblright -95
+KPX A Y -70
+KPX A W -84
+KPX A V -100
+KPX A U -32
+KPX A T 5
+KPX A Q 5
+KPX A O 5
+KPX A G 5
+KPX A C 5
+
+KPX B period 15
+KPX B comma 15
+KPX B U 15
+KPX B A -11
+
+KPX C A -5
+
+KPX D period -11
+KPX D comma -11
+KPX D Y 6
+KPX D W -11
+KPX D V -18
+
+KPX F r -27
+KPX F period -91
+KPX F o -47
+KPX F i -41
+KPX F e -41
+KPX F comma -91
+KPX F a -47
+KPX F A -79
+
+KPX J u -39
+KPX J period -74
+KPX J o -40
+KPX J e -33
+KPX J comma -74
+KPX J a -40
+KPX J A -30
+
+KPX K y -48
+KPX K u -4
+KPX K o -4
+KPX K e 18
+
+KPX L y -30
+KPX L quoteright -100
+KPX L quotedblright -100
+KPX L Y -55
+KPX L W -69
+KPX L V -97
+KPX L T -75
+
+KPX N period -49
+KPX N comma -49
+
+KPX O period -18
+KPX O comma -18
+KPX O X -18
+KPX O W -15
+KPX O V -24
+KPX O A -5
+
+KPX P period -100
+KPX P o -40
+KPX P e -33
+KPX P comma -100
+KPX P a -40
+KPX P A -80
+
+KPX R W -14
+KPX R V -24
+
+KPX S period -18
+KPX S comma -18
+
+KPX T y -30
+KPX T w -30
+KPX T u -22
+KPX T r -9
+KPX T period -55
+KPX T o -40
+KPX T i -22
+KPX T hyphen -75
+KPX T h -9
+KPX T e -33
+KPX T comma -55
+KPX T a -40
+KPX T O 11
+KPX T A -60
+
+KPX U period -25
+KPX U comma -25
+KPX U A -42
+
+KPX V u -70
+KPX V semicolon 6
+KPX V period -94
+KPX V o -71
+KPX V i -35
+KPX V hyphen -94
+KPX V e -66
+KPX V comma -94
+KPX V colon -49
+KPX V a -55
+KPX V O -19
+KPX V G -12
+KPX V A -100
+
+KPX W y -41
+KPX W u -25
+KPX W semicolon -22
+KPX W period -86
+KPX W o -33
+KPX W i -27
+KPX W hyphen -61
+KPX W h 5
+KPX W e -39
+KPX W comma -86
+KPX W colon -22
+KPX W a -33
+KPX W O -11
+KPX W A -66
+
+KPX Y u -58
+KPX Y semicolon -55
+KPX Y period -91
+KPX Y o -77
+KPX Y i -22
+KPX Y hyphen -91
+KPX Y e -71
+KPX Y comma -91
+KPX Y colon -55
+KPX Y a -77
+KPX Y A -79
+
+KPX a y -8
+KPX a w -8
+KPX a v 6
+
+KPX b y -6
+KPX b v 8
+KPX b period 6
+KPX b comma 6
+
+KPX c y -20
+KPX c period -8
+KPX c l -13
+KPX c k -8
+KPX c h -18
+KPX c comma -8
+
+KPX colon space -18
+
+KPX comma space -18
+KPX comma quoteright -18
+KPX comma quotedblright -18
+
+KPX d y -15
+KPX d w -15
+
+KPX e y -15
+KPX e x -5
+KPX e w -15
+KPX e p -11
+KPX e g -4
+KPX e b -8
+
+KPX f quoteright 105
+KPX f quotedblright 105
+KPX f period -28
+KPX f o 7
+KPX f l 7
+KPX f i 7
+KPX f e 14
+KPX f dotlessi 7
+KPX f comma -28
+KPX f a 8
+
+KPX g y -11
+KPX g r 11
+KPX g period -5
+KPX g comma -5
+
+KPX h y -20
+
+KPX i v 7
+
+KPX k y -15
+KPX k o -22
+KPX k e -16
+
+KPX l y -7
+KPX l w -7
+
+KPX m y -20
+KPX m u -11
+
+KPX n y -20
+KPX n v -7
+KPX n u -11
+
+KPX o y -11
+KPX o w -8
+KPX o v 6
+
+KPX p y -4
+KPX p period 8
+KPX p comma 8
+
+KPX period space -18
+KPX period quoteright -18
+KPX period quotedblright -18
+
+KPX quotedblleft quoteleft 20
+KPX quotedblleft A -60
+
+KPX quotedblright space -18
+
+KPX quoteleft A -80
+
+KPX quoteright v -16
+KPX quoteright t -22
+KPX quoteright s -46
+KPX quoteright r -9
+KPX quoteright l -22
+KPX quoteright d -41
+
+KPX r y -20
+KPX r v -7
+KPX r u -11
+KPX r t -11
+KPX r semicolon 9
+KPX r s -20
+KPX r quoteright 9
+KPX r period -90
+KPX r p -17
+KPX r o -11
+KPX r l -14
+KPX r k 9
+KPX r i -14
+KPX r hyphen -16
+KPX r g -11
+KPX r e -7
+KPX r d -7
+KPX r comma -90
+KPX r colon 9
+KPX r a -11
+
+KPX s period 11
+KPX s comma 11
+
+KPX semicolon space -18
+
+KPX space quotedblleft -18
+KPX space Y -18
+KPX space W -33
+KPX space V -24
+KPX space T -18
+KPX space A -22
+
+KPX v period -11
+KPX v o -6
+KPX v comma -11
+KPX v a -6
+
+KPX w period -17
+KPX w o -14
+KPX w e -8
+KPX w comma -17
+KPX w a -14
+
+KPX x e 5
+
+KPX y period -25
+KPX y o 8
+KPX y e 15
+KPX y comma -25
+KPX y a 8
+
+KPX z e 4
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 259 225 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 259 225 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 259 225 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 259 225 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 229 245 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 259 225 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 296 225 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 296 225 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 296 225 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 296 225 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 116 225 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 116 225 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 116 225 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 116 225 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 326 225 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 315 225 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 315 225 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 315 225 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 315 225 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 315 225 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 206 225 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 340 225 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 340 225 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 340 225 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 340 225 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 246 225 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 236 225 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 226 225 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 167 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 167 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 167 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 167 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 167 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 167 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 93 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 93 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 93 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 93 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -2 -7 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -2 -7 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -2 -7 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -2 -7 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 176 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 121 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 121 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 121 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 121 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 121 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 74 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 176 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 176 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 176 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 176 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 93 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 93 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 63 -10 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncr8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncr8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b9f616cb5a203d3afef2affa08befee80088a2b5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncr8a.afm
@@ -0,0 +1,524 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue May 28 16:31:51 1991
+Comment UniqueID 35025
+Comment VMusage 30420 37312
+FontName NewCenturySchlbk-Roman
+FullName New Century Schoolbook Roman
+FamilyName New Century Schoolbook
+Weight Roman
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -195 -250 1000 965
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 722
+XHeight 464
+Ascender 737
+Descender -205
+StartCharMetrics 228
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 296 ; N exclam ; B 86 -15 210 737 ;
+C 34 ; WX 389 ; N quotedbl ; B 61 443 328 737 ;
+C 35 ; WX 556 ; N numbersign ; B 28 0 528 690 ;
+C 36 ; WX 556 ; N dollar ; B 45 -138 511 813 ;
+C 37 ; WX 833 ; N percent ; B 43 -15 790 705 ;
+C 38 ; WX 815 ; N ampersand ; B 51 -15 775 737 ;
+C 39 ; WX 204 ; N quoteright ; B 25 443 179 737 ;
+C 40 ; WX 333 ; N parenleft ; B 40 -117 279 745 ;
+C 41 ; WX 333 ; N parenright ; B 54 -117 293 745 ;
+C 42 ; WX 500 ; N asterisk ; B 57 306 443 737 ;
+C 43 ; WX 606 ; N plus ; B 50 0 556 506 ;
+C 44 ; WX 278 ; N comma ; B 62 -185 216 109 ;
+C 45 ; WX 333 ; N hyphen ; B 42 199 291 277 ;
+C 46 ; WX 278 ; N period ; B 77 -15 201 109 ;
+C 47 ; WX 278 ; N slash ; B -32 -15 310 737 ;
+C 48 ; WX 556 ; N zero ; B 42 -15 514 705 ;
+C 49 ; WX 556 ; N one ; B 100 0 496 705 ;
+C 50 ; WX 556 ; N two ; B 35 0 505 705 ;
+C 51 ; WX 556 ; N three ; B 42 -15 498 705 ;
+C 52 ; WX 556 ; N four ; B 28 0 528 705 ;
+C 53 ; WX 556 ; N five ; B 46 -15 502 705 ;
+C 54 ; WX 556 ; N six ; B 41 -15 515 705 ;
+C 55 ; WX 556 ; N seven ; B 59 -15 508 705 ;
+C 56 ; WX 556 ; N eight ; B 42 -15 514 705 ;
+C 57 ; WX 556 ; N nine ; B 41 -15 515 705 ;
+C 58 ; WX 278 ; N colon ; B 77 -15 201 474 ;
+C 59 ; WX 278 ; N semicolon ; B 62 -185 216 474 ;
+C 60 ; WX 606 ; N less ; B 50 -8 556 514 ;
+C 61 ; WX 606 ; N equal ; B 50 117 556 389 ;
+C 62 ; WX 606 ; N greater ; B 50 -8 556 514 ;
+C 63 ; WX 444 ; N question ; B 29 -15 415 737 ;
+C 64 ; WX 737 ; N at ; B -8 -15 744 737 ;
+C 65 ; WX 722 ; N A ; B -8 0 730 737 ;
+C 66 ; WX 722 ; N B ; B 29 0 669 722 ;
+C 67 ; WX 722 ; N C ; B 45 -15 668 737 ;
+C 68 ; WX 778 ; N D ; B 29 0 733 722 ;
+C 69 ; WX 722 ; N E ; B 29 0 663 722 ;
+C 70 ; WX 667 ; N F ; B 29 0 638 722 ;
+C 71 ; WX 778 ; N G ; B 45 -15 775 737 ;
+C 72 ; WX 833 ; N H ; B 29 0 804 722 ;
+C 73 ; WX 407 ; N I ; B 38 0 369 722 ;
+C 74 ; WX 556 ; N J ; B 5 -15 540 722 ;
+C 75 ; WX 778 ; N K ; B 29 0 803 722 ;
+C 76 ; WX 667 ; N L ; B 29 0 644 722 ;
+C 77 ; WX 944 ; N M ; B 29 0 915 722 ;
+C 78 ; WX 815 ; N N ; B 24 -15 791 722 ;
+C 79 ; WX 778 ; N O ; B 45 -15 733 737 ;
+C 80 ; WX 667 ; N P ; B 29 0 650 722 ;
+C 81 ; WX 778 ; N Q ; B 45 -190 748 737 ;
+C 82 ; WX 722 ; N R ; B 29 -15 713 722 ;
+C 83 ; WX 630 ; N S ; B 47 -15 583 737 ;
+C 84 ; WX 667 ; N T ; B 19 0 648 722 ;
+C 85 ; WX 815 ; N U ; B 16 -15 799 722 ;
+C 86 ; WX 722 ; N V ; B -8 -10 730 722 ;
+C 87 ; WX 981 ; N W ; B 5 -10 976 722 ;
+C 88 ; WX 704 ; N X ; B -8 0 712 722 ;
+C 89 ; WX 704 ; N Y ; B -11 0 715 722 ;
+C 90 ; WX 611 ; N Z ; B 24 0 576 722 ;
+C 91 ; WX 333 ; N bracketleft ; B 126 -109 315 737 ;
+C 92 ; WX 606 ; N backslash ; B 132 -15 474 737 ;
+C 93 ; WX 333 ; N bracketright ; B 18 -109 207 737 ;
+C 94 ; WX 606 ; N asciicircum ; B 89 325 517 690 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 204 ; N quoteleft ; B 25 443 179 737 ;
+C 97 ; WX 556 ; N a ; B 44 -15 542 479 ;
+C 98 ; WX 556 ; N b ; B 10 -15 522 737 ;
+C 99 ; WX 444 ; N c ; B 34 -15 426 479 ;
+C 100 ; WX 574 ; N d ; B 34 -15 552 737 ;
+C 101 ; WX 500 ; N e ; B 34 -15 466 479 ;
+C 102 ; WX 333 ; N f ; B 18 0 437 737 ; L i fi ; L l fl ;
+C 103 ; WX 537 ; N g ; B 23 -205 542 494 ;
+C 104 ; WX 611 ; N h ; B 7 0 592 737 ;
+C 105 ; WX 315 ; N i ; B 18 0 286 722 ;
+C 106 ; WX 296 ; N j ; B -86 -205 216 722 ;
+C 107 ; WX 593 ; N k ; B 10 0 589 737 ;
+C 108 ; WX 315 ; N l ; B 18 0 286 737 ;
+C 109 ; WX 889 ; N m ; B 26 0 863 479 ;
+C 110 ; WX 611 ; N n ; B 22 0 589 479 ;
+C 111 ; WX 500 ; N o ; B 34 -15 466 479 ;
+C 112 ; WX 574 ; N p ; B 22 -205 540 479 ;
+C 113 ; WX 556 ; N q ; B 34 -205 552 479 ;
+C 114 ; WX 444 ; N r ; B 18 0 434 479 ;
+C 115 ; WX 463 ; N s ; B 46 -15 417 479 ;
+C 116 ; WX 389 ; N t ; B 18 -15 371 666 ;
+C 117 ; WX 611 ; N u ; B 22 -15 589 464 ;
+C 118 ; WX 537 ; N v ; B -6 -10 515 464 ;
+C 119 ; WX 778 ; N w ; B 1 -10 749 464 ;
+C 120 ; WX 537 ; N x ; B 8 0 529 464 ;
+C 121 ; WX 537 ; N y ; B 4 -205 533 464 ;
+C 122 ; WX 481 ; N z ; B 42 0 439 464 ;
+C 123 ; WX 333 ; N braceleft ; B 54 -109 279 737 ;
+C 124 ; WX 606 ; N bar ; B 267 -250 339 750 ;
+C 125 ; WX 333 ; N braceright ; B 54 -109 279 737 ;
+C 126 ; WX 606 ; N asciitilde ; B 72 184 534 322 ;
+C 161 ; WX 296 ; N exclamdown ; B 86 -205 210 547 ;
+C 162 ; WX 556 ; N cent ; B 74 -141 482 584 ;
+C 163 ; WX 556 ; N sterling ; B 18 -15 538 705 ;
+C 164 ; WX 167 ; N fraction ; B -195 -15 362 705 ;
+C 165 ; WX 556 ; N yen ; B -1 0 557 690 ;
+C 166 ; WX 556 ; N florin ; B 0 -205 538 737 ;
+C 167 ; WX 500 ; N section ; B 55 -147 445 737 ;
+C 168 ; WX 556 ; N currency ; B 26 93 530 597 ;
+C 169 ; WX 204 ; N quotesingle ; B 59 443 145 737 ;
+C 170 ; WX 389 ; N quotedblleft ; B 25 443 364 737 ;
+C 171 ; WX 426 ; N guillemotleft ; B 39 78 387 398 ;
+C 172 ; WX 259 ; N guilsinglleft ; B 39 78 220 398 ;
+C 173 ; WX 259 ; N guilsinglright ; B 39 78 220 398 ;
+C 174 ; WX 611 ; N fi ; B 18 0 582 737 ;
+C 175 ; WX 611 ; N fl ; B 18 0 582 737 ;
+C 177 ; WX 556 ; N endash ; B 0 208 556 268 ;
+C 178 ; WX 500 ; N dagger ; B 42 -147 458 737 ;
+C 179 ; WX 500 ; N daggerdbl ; B 42 -149 458 737 ;
+C 180 ; WX 278 ; N periodcentered ; B 71 238 207 374 ;
+C 182 ; WX 606 ; N paragraph ; B 60 -132 546 722 ;
+C 183 ; WX 606 ; N bullet ; B 122 180 484 542 ;
+C 184 ; WX 204 ; N quotesinglbase ; B 25 -185 179 109 ;
+C 185 ; WX 389 ; N quotedblbase ; B 25 -185 364 109 ;
+C 186 ; WX 389 ; N quotedblright ; B 25 443 364 737 ;
+C 187 ; WX 426 ; N guillemotright ; B 39 78 387 398 ;
+C 188 ; WX 1000 ; N ellipsis ; B 105 -15 895 109 ;
+C 189 ; WX 1000 ; N perthousand ; B 6 -15 994 705 ;
+C 191 ; WX 444 ; N questiondown ; B 29 -205 415 547 ;
+C 193 ; WX 333 ; N grave ; B 17 528 242 699 ;
+C 194 ; WX 333 ; N acute ; B 91 528 316 699 ;
+C 195 ; WX 333 ; N circumflex ; B 10 528 323 695 ;
+C 196 ; WX 333 ; N tilde ; B 1 553 332 655 ;
+C 197 ; WX 333 ; N macron ; B 10 568 323 623 ;
+C 198 ; WX 333 ; N breve ; B 25 528 308 685 ;
+C 199 ; WX 333 ; N dotaccent ; B 116 543 218 645 ;
+C 200 ; WX 333 ; N dieresis ; B 16 543 317 645 ;
+C 202 ; WX 333 ; N ring ; B 66 522 266 722 ;
+C 203 ; WX 333 ; N cedilla ; B 29 -215 237 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -9 528 416 699 ;
+C 206 ; WX 333 ; N ogonek ; B 68 -215 254 0 ;
+C 207 ; WX 333 ; N caron ; B 10 528 323 695 ;
+C 208 ; WX 1000 ; N emdash ; B 0 208 1000 268 ;
+C 225 ; WX 1000 ; N AE ; B 0 0 962 722 ;
+C 227 ; WX 334 ; N ordfeminine ; B -4 407 338 705 ;
+C 232 ; WX 667 ; N Lslash ; B 29 0 644 722 ;
+C 233 ; WX 778 ; N Oslash ; B 45 -56 733 778 ;
+C 234 ; WX 1000 ; N OE ; B 21 0 979 722 ;
+C 235 ; WX 300 ; N ordmasculine ; B 4 407 296 705 ;
+C 241 ; WX 796 ; N ae ; B 34 -15 762 479 ;
+C 245 ; WX 315 ; N dotlessi ; B 18 0 286 464 ;
+C 248 ; WX 315 ; N lslash ; B 18 0 286 737 ;
+C 249 ; WX 500 ; N oslash ; B 34 -97 466 561 ;
+C 250 ; WX 833 ; N oe ; B 34 -15 799 479 ;
+C 251 ; WX 574 ; N germandbls ; B 30 -15 537 737 ;
+C -1 ; WX 500 ; N ecircumflex ; B 34 -15 466 695 ;
+C -1 ; WX 500 ; N edieresis ; B 34 -15 466 645 ;
+C -1 ; WX 556 ; N aacute ; B 44 -15 542 699 ;
+C -1 ; WX 737 ; N registered ; B -8 -15 744 737 ;
+C -1 ; WX 315 ; N icircumflex ; B 1 0 314 695 ;
+C -1 ; WX 611 ; N udieresis ; B 22 -15 589 645 ;
+C -1 ; WX 500 ; N ograve ; B 34 -15 466 699 ;
+C -1 ; WX 611 ; N uacute ; B 22 -15 589 699 ;
+C -1 ; WX 611 ; N ucircumflex ; B 22 -15 589 695 ;
+C -1 ; WX 722 ; N Aacute ; B -8 0 730 937 ;
+C -1 ; WX 315 ; N igrave ; B 8 0 286 699 ;
+C -1 ; WX 407 ; N Icircumflex ; B 38 0 369 933 ;
+C -1 ; WX 444 ; N ccedilla ; B 34 -215 426 479 ;
+C -1 ; WX 556 ; N adieresis ; B 44 -15 542 645 ;
+C -1 ; WX 722 ; N Ecircumflex ; B 29 0 663 933 ;
+C -1 ; WX 463 ; N scaron ; B 46 -15 417 695 ;
+C -1 ; WX 574 ; N thorn ; B 22 -205 540 737 ;
+C -1 ; WX 1000 ; N trademark ; B 32 318 968 722 ;
+C -1 ; WX 500 ; N egrave ; B 34 -15 466 699 ;
+C -1 ; WX 333 ; N threesuperior ; B 18 273 315 705 ;
+C -1 ; WX 481 ; N zcaron ; B 42 0 439 695 ;
+C -1 ; WX 556 ; N atilde ; B 44 -15 542 655 ;
+C -1 ; WX 556 ; N aring ; B 44 -15 542 732 ;
+C -1 ; WX 500 ; N ocircumflex ; B 34 -15 466 695 ;
+C -1 ; WX 722 ; N Edieresis ; B 29 0 663 883 ;
+C -1 ; WX 834 ; N threequarters ; B 28 -15 795 705 ;
+C -1 ; WX 537 ; N ydieresis ; B 4 -205 533 645 ;
+C -1 ; WX 537 ; N yacute ; B 4 -205 533 699 ;
+C -1 ; WX 315 ; N iacute ; B 18 0 307 699 ;
+C -1 ; WX 722 ; N Acircumflex ; B -8 0 730 933 ;
+C -1 ; WX 815 ; N Uacute ; B 16 -15 799 937 ;
+C -1 ; WX 500 ; N eacute ; B 34 -15 466 699 ;
+C -1 ; WX 778 ; N Ograve ; B 45 -15 733 937 ;
+C -1 ; WX 556 ; N agrave ; B 44 -15 542 699 ;
+C -1 ; WX 815 ; N Udieresis ; B 16 -15 799 883 ;
+C -1 ; WX 556 ; N acircumflex ; B 44 -15 542 695 ;
+C -1 ; WX 407 ; N Igrave ; B 38 0 369 937 ;
+C -1 ; WX 333 ; N twosuperior ; B 14 282 319 705 ;
+C -1 ; WX 815 ; N Ugrave ; B 16 -15 799 937 ;
+C -1 ; WX 834 ; N onequarter ; B 39 -15 795 705 ;
+C -1 ; WX 815 ; N Ucircumflex ; B 16 -15 799 933 ;
+C -1 ; WX 630 ; N Scaron ; B 47 -15 583 933 ;
+C -1 ; WX 407 ; N Idieresis ; B 38 0 369 883 ;
+C -1 ; WX 315 ; N idieresis ; B 7 0 308 645 ;
+C -1 ; WX 722 ; N Egrave ; B 29 0 663 937 ;
+C -1 ; WX 778 ; N Oacute ; B 45 -15 733 937 ;
+C -1 ; WX 606 ; N divide ; B 50 -22 556 528 ;
+C -1 ; WX 722 ; N Atilde ; B -8 0 730 893 ;
+C -1 ; WX 722 ; N Aring ; B -8 0 730 965 ;
+C -1 ; WX 778 ; N Odieresis ; B 45 -15 733 883 ;
+C -1 ; WX 722 ; N Adieresis ; B -8 0 730 883 ;
+C -1 ; WX 815 ; N Ntilde ; B 24 -15 791 893 ;
+C -1 ; WX 611 ; N Zcaron ; B 24 0 576 933 ;
+C -1 ; WX 667 ; N Thorn ; B 29 0 650 722 ;
+C -1 ; WX 407 ; N Iacute ; B 38 0 369 937 ;
+C -1 ; WX 606 ; N plusminus ; B 50 0 556 506 ;
+C -1 ; WX 606 ; N multiply ; B 74 24 532 482 ;
+C -1 ; WX 722 ; N Eacute ; B 29 0 663 937 ;
+C -1 ; WX 704 ; N Ydieresis ; B -11 0 715 883 ;
+C -1 ; WX 333 ; N onesuperior ; B 39 282 294 705 ;
+C -1 ; WX 611 ; N ugrave ; B 22 -15 589 699 ;
+C -1 ; WX 606 ; N logicalnot ; B 50 108 556 389 ;
+C -1 ; WX 611 ; N ntilde ; B 22 0 589 655 ;
+C -1 ; WX 778 ; N Otilde ; B 45 -15 733 893 ;
+C -1 ; WX 500 ; N otilde ; B 34 -15 466 655 ;
+C -1 ; WX 722 ; N Ccedilla ; B 45 -215 668 737 ;
+C -1 ; WX 722 ; N Agrave ; B -8 0 730 937 ;
+C -1 ; WX 834 ; N onehalf ; B 39 -15 820 705 ;
+C -1 ; WX 778 ; N Eth ; B 29 0 733 722 ;
+C -1 ; WX 400 ; N degree ; B 57 419 343 705 ;
+C -1 ; WX 704 ; N Yacute ; B -11 0 715 937 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 45 -15 733 933 ;
+C -1 ; WX 500 ; N oacute ; B 34 -15 466 699 ;
+C -1 ; WX 611 ; N mu ; B 22 -205 589 464 ;
+C -1 ; WX 606 ; N minus ; B 50 217 556 289 ;
+C -1 ; WX 500 ; N eth ; B 34 -15 466 752 ;
+C -1 ; WX 500 ; N odieresis ; B 34 -15 466 645 ;
+C -1 ; WX 737 ; N copyright ; B -8 -15 744 737 ;
+C -1 ; WX 606 ; N brokenbar ; B 267 -175 339 675 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 169
+
+KPX A y -37
+KPX A w -25
+KPX A v -37
+KPX A quoteright -74
+KPX A quotedblright -74
+KPX A Y -75
+KPX A W -50
+KPX A V -75
+KPX A U -30
+KPX A T -18
+
+KPX B period -37
+KPX B comma -37
+KPX B A -18
+
+KPX C period -37
+KPX C comma -37
+KPX C A -18
+
+KPX D period -37
+KPX D comma -37
+KPX D Y -18
+KPX D V -18
+
+KPX F r -10
+KPX F period -125
+KPX F o -55
+KPX F i -10
+KPX F e -55
+KPX F comma -125
+KPX F a -65
+KPX F A -50
+
+KPX G period -37
+KPX G comma -37
+
+KPX J u -25
+KPX J period -74
+KPX J o -25
+KPX J e -25
+KPX J comma -74
+KPX J a -25
+KPX J A -18
+
+KPX K y -25
+KPX K o 10
+KPX K e 10
+
+KPX L y -25
+KPX L quoteright -100
+KPX L quotedblright -100
+KPX L Y -74
+KPX L W -74
+KPX L V -91
+KPX L T -75
+
+KPX N period -55
+KPX N comma -55
+
+KPX O period -37
+KPX O comma -37
+KPX O Y -18
+KPX O V -18
+KPX O T 10
+
+KPX P period -125
+KPX P o -37
+KPX P e -37
+KPX P comma -125
+KPX P a -37
+KPX P A -55
+
+KPX Q period -25
+KPX Q comma -25
+
+KPX S period -37
+KPX S comma -37
+
+KPX T semicolon -37
+KPX T period -125
+KPX T o -55
+KPX T hyphen -100
+KPX T e -55
+KPX T comma -125
+KPX T colon -37
+KPX T a -55
+KPX T O 10
+KPX T A -18
+
+KPX U period -100
+KPX U comma -100
+KPX U A -30
+
+KPX V u -75
+KPX V semicolon -75
+KPX V period -125
+KPX V o -75
+KPX V i -18
+KPX V hyphen -100
+KPX V e -75
+KPX V comma -125
+KPX V colon -75
+KPX V a -85
+KPX V O -18
+KPX V A -74
+
+KPX W y -55
+KPX W u -55
+KPX W semicolon -100
+KPX W period -125
+KPX W o -60
+KPX W i -18
+KPX W hyphen -100
+KPX W e -60
+KPX W comma -125
+KPX W colon -100
+KPX W a -75
+KPX W A -50
+
+KPX Y u -91
+KPX Y semicolon -75
+KPX Y period -100
+KPX Y o -100
+KPX Y i -18
+KPX Y hyphen -125
+KPX Y e -100
+KPX Y comma -100
+KPX Y colon -75
+KPX Y a -100
+KPX Y O -18
+KPX Y A -75
+
+KPX a y -10
+KPX a w -10
+KPX a v -10
+
+KPX b period -18
+KPX b comma -18
+
+KPX c period -18
+KPX c l -7
+KPX c k -7
+KPX c h -7
+KPX c comma -18
+
+KPX colon space -37
+
+KPX comma space -37
+KPX comma quoteright -37
+KPX comma quotedblright -37
+
+KPX e period -18
+KPX e comma -18
+
+KPX f quoteright 100
+KPX f quotedblright 100
+KPX f period -37
+KPX f comma -37
+
+KPX g period -25
+KPX g comma -25
+
+KPX o period -18
+KPX o comma -18
+
+KPX p period -18
+KPX p comma -18
+
+KPX period space -37
+KPX period quoteright -37
+KPX period quotedblright -37
+
+KPX quotedblleft A -74
+
+KPX quotedblright space -37
+
+KPX quoteleft quoteleft -25
+KPX quoteleft A -74
+
+KPX quoteright s -25
+KPX quoteright quoteright -25
+KPX quoteright d -37
+
+KPX r period -100
+KPX r hyphen -37
+KPX r comma -100
+
+KPX s period -25
+KPX s comma -25
+
+KPX semicolon space -37
+
+KPX space quoteleft -37
+KPX space quotedblleft -37
+KPX space Y -37
+KPX space W -37
+KPX space V -37
+KPX space T -37
+KPX space A -37
+
+KPX v period -125
+KPX v comma -125
+
+KPX w period -125
+KPX w comma -125
+KPX w a -18
+
+KPX y period -125
+KPX y comma -125
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 238 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 195 238 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 195 238 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 195 238 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 195 243 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 195 238 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 195 238 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 195 238 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 195 238 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 195 238 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 37 238 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 37 238 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 37 238 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 37 238 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 241 238 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 223 238 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 223 238 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 223 238 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 223 238 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 223 238 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 149 238 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 241 238 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 241 238 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 241 238 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 241 238 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 216 238 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 186 238 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 238 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 112 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 112 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 112 10 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 112 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 84 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 84 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 84 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 84 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -9 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -9 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -9 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -9 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 65 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 139 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 139 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 102 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 102 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 74 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncri8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncri8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..6dfd6a254d46823cca6baad550bb435a7467ec9d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pncri8a.afm
@@ -0,0 +1,536 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue May 28 16:40:04 1991
+Comment UniqueID 35028
+Comment VMusage 31423 38315
+FontName NewCenturySchlbk-Italic
+FullName New Century Schoolbook Italic
+FamilyName New Century Schoolbook
+Weight Medium
+ItalicAngle -16
+IsFixedPitch false
+FontBBox -166 -250 994 958
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.006
+Notice Copyright (c) 1985, 1987, 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 722
+XHeight 466
+Ascender 737
+Descender -205
+StartCharMetrics 228
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 17 -15 303 737 ;
+C 34 ; WX 400 ; N quotedbl ; B 127 463 363 737 ;
+C 35 ; WX 556 ; N numbersign ; B 28 0 528 690 ;
+C 36 ; WX 556 ; N dollar ; B 4 -142 536 808 ;
+C 37 ; WX 833 ; N percent ; B 43 -15 790 705 ;
+C 38 ; WX 852 ; N ampersand ; B 24 -15 773 737 ;
+C 39 ; WX 204 ; N quoteright ; B 39 463 229 737 ;
+C 40 ; WX 333 ; N parenleft ; B 53 -117 411 745 ;
+C 41 ; WX 333 ; N parenright ; B -93 -117 265 745 ;
+C 42 ; WX 500 ; N asterisk ; B 80 318 500 737 ;
+C 43 ; WX 606 ; N plus ; B 50 0 556 506 ;
+C 44 ; WX 278 ; N comma ; B -39 -165 151 109 ;
+C 45 ; WX 333 ; N hyphen ; B 32 202 259 274 ;
+C 46 ; WX 278 ; N period ; B 17 -15 141 109 ;
+C 47 ; WX 606 ; N slash ; B 132 -15 474 737 ;
+C 48 ; WX 556 ; N zero ; B 30 -15 526 705 ;
+C 49 ; WX 556 ; N one ; B 50 0 459 705 ;
+C 50 ; WX 556 ; N two ; B -37 0 506 705 ;
+C 51 ; WX 556 ; N three ; B -2 -15 506 705 ;
+C 52 ; WX 556 ; N four ; B -8 0 512 705 ;
+C 53 ; WX 556 ; N five ; B 4 -15 540 705 ;
+C 54 ; WX 556 ; N six ; B 36 -15 548 705 ;
+C 55 ; WX 556 ; N seven ; B 69 -15 561 705 ;
+C 56 ; WX 556 ; N eight ; B 6 -15 526 705 ;
+C 57 ; WX 556 ; N nine ; B 8 -15 520 705 ;
+C 58 ; WX 278 ; N colon ; B 17 -15 229 466 ;
+C 59 ; WX 278 ; N semicolon ; B -39 -165 229 466 ;
+C 60 ; WX 606 ; N less ; B 36 -8 542 514 ;
+C 61 ; WX 606 ; N equal ; B 50 117 556 389 ;
+C 62 ; WX 606 ; N greater ; B 64 -8 570 514 ;
+C 63 ; WX 444 ; N question ; B 102 -15 417 737 ;
+C 64 ; WX 747 ; N at ; B -2 -15 750 737 ;
+C 65 ; WX 704 ; N A ; B -87 0 668 737 ;
+C 66 ; WX 722 ; N B ; B -33 0 670 722 ;
+C 67 ; WX 722 ; N C ; B 40 -15 712 737 ;
+C 68 ; WX 778 ; N D ; B -33 0 738 722 ;
+C 69 ; WX 722 ; N E ; B -33 0 700 722 ;
+C 70 ; WX 667 ; N F ; B -33 0 700 722 ;
+C 71 ; WX 778 ; N G ; B 40 -15 763 737 ;
+C 72 ; WX 833 ; N H ; B -33 0 866 722 ;
+C 73 ; WX 407 ; N I ; B -33 0 435 722 ;
+C 74 ; WX 611 ; N J ; B -14 -15 651 722 ;
+C 75 ; WX 741 ; N K ; B -33 0 816 722 ;
+C 76 ; WX 667 ; N L ; B -33 0 627 722 ;
+C 77 ; WX 944 ; N M ; B -33 0 977 722 ;
+C 78 ; WX 815 ; N N ; B -51 -15 866 722 ;
+C 79 ; WX 778 ; N O ; B 40 -15 738 737 ;
+C 80 ; WX 667 ; N P ; B -33 0 667 722 ;
+C 81 ; WX 778 ; N Q ; B 40 -190 738 737 ;
+C 82 ; WX 741 ; N R ; B -45 -15 692 722 ;
+C 83 ; WX 667 ; N S ; B -6 -15 638 737 ;
+C 84 ; WX 685 ; N T ; B 40 0 725 722 ;
+C 85 ; WX 815 ; N U ; B 93 -15 867 722 ;
+C 86 ; WX 704 ; N V ; B 36 -10 779 722 ;
+C 87 ; WX 926 ; N W ; B 53 -10 978 722 ;
+C 88 ; WX 704 ; N X ; B -75 0 779 722 ;
+C 89 ; WX 685 ; N Y ; B 31 0 760 722 ;
+C 90 ; WX 667 ; N Z ; B -25 0 667 722 ;
+C 91 ; WX 333 ; N bracketleft ; B -55 -109 388 737 ;
+C 92 ; WX 606 ; N backslash ; B 132 -15 474 737 ;
+C 93 ; WX 333 ; N bracketright ; B -77 -109 366 737 ;
+C 94 ; WX 606 ; N asciicircum ; B 89 325 517 690 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 204 ; N quoteleft ; B 39 463 229 737 ;
+C 97 ; WX 574 ; N a ; B 2 -15 524 466 ;
+C 98 ; WX 556 ; N b ; B 32 -15 488 737 ;
+C 99 ; WX 444 ; N c ; B 2 -15 394 466 ;
+C 100 ; WX 611 ; N d ; B 2 -15 585 737 ;
+C 101 ; WX 444 ; N e ; B -6 -15 388 466 ;
+C 102 ; WX 333 ; N f ; B -68 -205 470 737 ; L i fi ; L l fl ;
+C 103 ; WX 537 ; N g ; B -79 -205 523 497 ;
+C 104 ; WX 611 ; N h ; B 14 -15 562 737 ;
+C 105 ; WX 333 ; N i ; B 29 -15 282 715 ;
+C 106 ; WX 315 ; N j ; B -166 -205 318 715 ;
+C 107 ; WX 556 ; N k ; B 0 -15 497 737 ;
+C 108 ; WX 333 ; N l ; B 14 -15 292 737 ;
+C 109 ; WX 889 ; N m ; B 14 -15 840 466 ;
+C 110 ; WX 611 ; N n ; B 14 -15 562 466 ;
+C 111 ; WX 500 ; N o ; B 2 -15 450 466 ;
+C 112 ; WX 574 ; N p ; B -101 -205 506 466 ;
+C 113 ; WX 556 ; N q ; B 2 -205 500 466 ;
+C 114 ; WX 444 ; N r ; B 10 0 434 466 ;
+C 115 ; WX 444 ; N s ; B 2 -15 394 466 ;
+C 116 ; WX 352 ; N t ; B 24 -15 328 619 ;
+C 117 ; WX 611 ; N u ; B 44 -15 556 466 ;
+C 118 ; WX 519 ; N v ; B 31 -15 447 466 ;
+C 119 ; WX 778 ; N w ; B 31 -15 706 466 ;
+C 120 ; WX 500 ; N x ; B -33 -15 471 466 ;
+C 121 ; WX 500 ; N y ; B -83 -205 450 466 ;
+C 122 ; WX 463 ; N z ; B -33 -15 416 466 ;
+C 123 ; WX 333 ; N braceleft ; B 38 -109 394 737 ;
+C 124 ; WX 606 ; N bar ; B 267 -250 339 750 ;
+C 125 ; WX 333 ; N braceright ; B -87 -109 269 737 ;
+C 126 ; WX 606 ; N asciitilde ; B 72 184 534 322 ;
+C 161 ; WX 333 ; N exclamdown ; B -22 -205 264 547 ;
+C 162 ; WX 556 ; N cent ; B 62 -144 486 580 ;
+C 163 ; WX 556 ; N sterling ; B -13 -15 544 705 ;
+C 164 ; WX 167 ; N fraction ; B -134 -15 301 705 ;
+C 165 ; WX 556 ; N yen ; B 40 0 624 690 ;
+C 166 ; WX 556 ; N florin ; B -58 -205 569 737 ;
+C 167 ; WX 500 ; N section ; B -10 -147 480 737 ;
+C 168 ; WX 556 ; N currency ; B 26 93 530 597 ;
+C 169 ; WX 278 ; N quotesingle ; B 151 463 237 737 ;
+C 170 ; WX 389 ; N quotedblleft ; B 39 463 406 737 ;
+C 171 ; WX 426 ; N guillemotleft ; B -15 74 402 402 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 40 74 259 402 ;
+C 173 ; WX 333 ; N guilsinglright ; B 40 74 259 402 ;
+C 174 ; WX 611 ; N fi ; B -68 -205 555 737 ;
+C 175 ; WX 611 ; N fl ; B -68 -205 587 737 ;
+C 177 ; WX 500 ; N endash ; B -27 208 487 268 ;
+C 178 ; WX 500 ; N dagger ; B 51 -147 506 737 ;
+C 179 ; WX 500 ; N daggerdbl ; B -54 -147 506 737 ;
+C 180 ; WX 278 ; N periodcentered ; B 71 238 207 374 ;
+C 182 ; WX 650 ; N paragraph ; B 48 -132 665 722 ;
+C 183 ; WX 606 ; N bullet ; B 122 180 484 542 ;
+C 184 ; WX 204 ; N quotesinglbase ; B -78 -165 112 109 ;
+C 185 ; WX 389 ; N quotedblbase ; B -78 -165 289 109 ;
+C 186 ; WX 389 ; N quotedblright ; B 39 463 406 737 ;
+C 187 ; WX 426 ; N guillemotright ; B -15 74 402 402 ;
+C 188 ; WX 1000 ; N ellipsis ; B 59 -15 849 109 ;
+C 189 ; WX 1000 ; N perthousand ; B 6 -15 994 705 ;
+C 191 ; WX 444 ; N questiondown ; B -3 -205 312 547 ;
+C 193 ; WX 333 ; N grave ; B 71 518 262 690 ;
+C 194 ; WX 333 ; N acute ; B 132 518 355 690 ;
+C 195 ; WX 333 ; N circumflex ; B 37 518 331 690 ;
+C 196 ; WX 333 ; N tilde ; B 52 547 383 649 ;
+C 197 ; WX 333 ; N macron ; B 52 560 363 610 ;
+C 198 ; WX 333 ; N breve ; B 69 518 370 677 ;
+C 199 ; WX 333 ; N dotaccent ; B 146 544 248 646 ;
+C 200 ; WX 333 ; N dieresis ; B 59 544 359 646 ;
+C 202 ; WX 333 ; N ring ; B 114 512 314 712 ;
+C 203 ; WX 333 ; N cedilla ; B 3 -215 215 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 32 518 455 690 ;
+C 206 ; WX 333 ; N ogonek ; B 68 -215 254 0 ;
+C 207 ; WX 333 ; N caron ; B 73 518 378 690 ;
+C 208 ; WX 1000 ; N emdash ; B -27 208 987 268 ;
+C 225 ; WX 870 ; N AE ; B -87 0 888 722 ;
+C 227 ; WX 422 ; N ordfeminine ; B 72 416 420 705 ;
+C 232 ; WX 667 ; N Lslash ; B -33 0 627 722 ;
+C 233 ; WX 778 ; N Oslash ; B 16 -68 748 780 ;
+C 234 ; WX 981 ; N OE ; B 40 0 975 722 ;
+C 235 ; WX 372 ; N ordmasculine ; B 66 416 370 705 ;
+C 241 ; WX 722 ; N ae ; B -18 -15 666 466 ;
+C 245 ; WX 333 ; N dotlessi ; B 29 -15 282 466 ;
+C 248 ; WX 333 ; N lslash ; B -25 -15 340 737 ;
+C 249 ; WX 500 ; N oslash ; B 2 -121 450 549 ;
+C 250 ; WX 778 ; N oe ; B 2 -15 722 466 ;
+C 251 ; WX 556 ; N germandbls ; B -76 -205 525 737 ;
+C -1 ; WX 444 ; N ecircumflex ; B -6 -15 388 690 ;
+C -1 ; WX 444 ; N edieresis ; B -6 -15 415 646 ;
+C -1 ; WX 574 ; N aacute ; B 2 -15 524 690 ;
+C -1 ; WX 747 ; N registered ; B -2 -15 750 737 ;
+C -1 ; WX 333 ; N icircumflex ; B 29 -15 331 690 ;
+C -1 ; WX 611 ; N udieresis ; B 44 -15 556 646 ;
+C -1 ; WX 500 ; N ograve ; B 2 -15 450 690 ;
+C -1 ; WX 611 ; N uacute ; B 44 -15 556 690 ;
+C -1 ; WX 611 ; N ucircumflex ; B 44 -15 556 690 ;
+C -1 ; WX 704 ; N Aacute ; B -87 0 668 946 ;
+C -1 ; WX 333 ; N igrave ; B 29 -15 282 690 ;
+C -1 ; WX 407 ; N Icircumflex ; B -33 0 435 946 ;
+C -1 ; WX 444 ; N ccedilla ; B 2 -215 394 466 ;
+C -1 ; WX 574 ; N adieresis ; B 2 -15 524 646 ;
+C -1 ; WX 722 ; N Ecircumflex ; B -33 0 700 946 ;
+C -1 ; WX 444 ; N scaron ; B 2 -15 434 690 ;
+C -1 ; WX 574 ; N thorn ; B -101 -205 506 737 ;
+C -1 ; WX 950 ; N trademark ; B 32 318 968 722 ;
+C -1 ; WX 444 ; N egrave ; B -6 -15 388 690 ;
+C -1 ; WX 333 ; N threesuperior ; B 22 273 359 705 ;
+C -1 ; WX 463 ; N zcaron ; B -33 -15 443 690 ;
+C -1 ; WX 574 ; N atilde ; B 2 -15 524 649 ;
+C -1 ; WX 574 ; N aring ; B 2 -15 524 712 ;
+C -1 ; WX 500 ; N ocircumflex ; B 2 -15 450 690 ;
+C -1 ; WX 722 ; N Edieresis ; B -33 0 700 902 ;
+C -1 ; WX 834 ; N threequarters ; B 22 -15 782 705 ;
+C -1 ; WX 500 ; N ydieresis ; B -83 -205 450 646 ;
+C -1 ; WX 500 ; N yacute ; B -83 -205 450 690 ;
+C -1 ; WX 333 ; N iacute ; B 29 -15 355 690 ;
+C -1 ; WX 704 ; N Acircumflex ; B -87 0 668 946 ;
+C -1 ; WX 815 ; N Uacute ; B 93 -15 867 946 ;
+C -1 ; WX 444 ; N eacute ; B -6 -15 411 690 ;
+C -1 ; WX 778 ; N Ograve ; B 40 -15 738 946 ;
+C -1 ; WX 574 ; N agrave ; B 2 -15 524 690 ;
+C -1 ; WX 815 ; N Udieresis ; B 93 -15 867 902 ;
+C -1 ; WX 574 ; N acircumflex ; B 2 -15 524 690 ;
+C -1 ; WX 407 ; N Igrave ; B -33 0 435 946 ;
+C -1 ; WX 333 ; N twosuperior ; B 0 282 359 705 ;
+C -1 ; WX 815 ; N Ugrave ; B 93 -15 867 946 ;
+C -1 ; WX 834 ; N onequarter ; B 34 -15 782 705 ;
+C -1 ; WX 815 ; N Ucircumflex ; B 93 -15 867 946 ;
+C -1 ; WX 667 ; N Scaron ; B -6 -15 638 946 ;
+C -1 ; WX 407 ; N Idieresis ; B -33 0 456 902 ;
+C -1 ; WX 333 ; N idieresis ; B 29 -15 359 646 ;
+C -1 ; WX 722 ; N Egrave ; B -33 0 700 946 ;
+C -1 ; WX 778 ; N Oacute ; B 40 -15 738 946 ;
+C -1 ; WX 606 ; N divide ; B 50 -22 556 528 ;
+C -1 ; WX 704 ; N Atilde ; B -87 0 668 905 ;
+C -1 ; WX 704 ; N Aring ; B -87 0 668 958 ;
+C -1 ; WX 778 ; N Odieresis ; B 40 -15 738 902 ;
+C -1 ; WX 704 ; N Adieresis ; B -87 0 668 902 ;
+C -1 ; WX 815 ; N Ntilde ; B -51 -15 866 905 ;
+C -1 ; WX 667 ; N Zcaron ; B -25 0 667 946 ;
+C -1 ; WX 667 ; N Thorn ; B -33 0 627 722 ;
+C -1 ; WX 407 ; N Iacute ; B -33 0 452 946 ;
+C -1 ; WX 606 ; N plusminus ; B 50 0 556 506 ;
+C -1 ; WX 606 ; N multiply ; B 74 24 532 482 ;
+C -1 ; WX 722 ; N Eacute ; B -33 0 700 946 ;
+C -1 ; WX 685 ; N Ydieresis ; B 31 0 760 902 ;
+C -1 ; WX 333 ; N onesuperior ; B 34 282 311 705 ;
+C -1 ; WX 611 ; N ugrave ; B 44 -15 556 690 ;
+C -1 ; WX 606 ; N logicalnot ; B 50 108 556 389 ;
+C -1 ; WX 611 ; N ntilde ; B 14 -15 562 649 ;
+C -1 ; WX 778 ; N Otilde ; B 40 -15 738 905 ;
+C -1 ; WX 500 ; N otilde ; B 2 -15 467 649 ;
+C -1 ; WX 722 ; N Ccedilla ; B 40 -215 712 737 ;
+C -1 ; WX 704 ; N Agrave ; B -87 0 668 946 ;
+C -1 ; WX 834 ; N onehalf ; B 34 -15 776 705 ;
+C -1 ; WX 778 ; N Eth ; B -33 0 738 722 ;
+C -1 ; WX 400 ; N degree ; B 86 419 372 705 ;
+C -1 ; WX 685 ; N Yacute ; B 31 0 760 946 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 40 -15 738 946 ;
+C -1 ; WX 500 ; N oacute ; B 2 -15 450 690 ;
+C -1 ; WX 611 ; N mu ; B -60 -205 556 466 ;
+C -1 ; WX 606 ; N minus ; B 50 217 556 289 ;
+C -1 ; WX 500 ; N eth ; B 2 -15 450 737 ;
+C -1 ; WX 500 ; N odieresis ; B 2 -15 450 646 ;
+C -1 ; WX 747 ; N copyright ; B -2 -15 750 737 ;
+C -1 ; WX 606 ; N brokenbar ; B 267 -175 339 675 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 181
+
+KPX A y -55
+KPX A w -18
+KPX A v -18
+KPX A u -18
+KPX A quoteright -125
+KPX A quotedblright -125
+KPX A Y -55
+KPX A W -74
+KPX A V -74
+KPX A U -37
+KPX A T -30
+KPX A Q -18
+KPX A O -18
+KPX A G -18
+KPX A C -18
+
+KPX B period -50
+KPX B comma -50
+
+KPX C period -50
+KPX C comma -50
+
+KPX D period -50
+KPX D comma -50
+KPX D Y -18
+KPX D W -18
+KPX D V -18
+
+KPX F r -55
+KPX F period -125
+KPX F o -55
+KPX F i -10
+KPX F e -55
+KPX F comma -125
+KPX F a -55
+KPX F A -35
+
+KPX G period -50
+KPX G comma -50
+
+KPX J u -18
+KPX J period -100
+KPX J o -37
+KPX J e -37
+KPX J comma -100
+KPX J a -37
+KPX J A -18
+
+KPX L y -50
+KPX L quoteright -125
+KPX L quotedblright -125
+KPX L Y -100
+KPX L W -100
+KPX L V -100
+KPX L T -100
+
+KPX N period -60
+KPX N comma -60
+
+KPX O period -50
+KPX O comma -50
+KPX O Y -18
+KPX O X -18
+KPX O V -18
+KPX O T 18
+
+KPX P period -125
+KPX P o -55
+KPX P e -55
+KPX P comma -125
+KPX P a -55
+KPX P A -50
+
+KPX Q period -20
+KPX Q comma -20
+
+KPX R Y -18
+KPX R W -18
+KPX R V -18
+KPX R U -18
+
+KPX S period -50
+KPX S comma -50
+
+KPX T y -50
+KPX T w -50
+KPX T u -50
+KPX T semicolon -50
+KPX T r -50
+KPX T period -100
+KPX T o -74
+KPX T i -18
+KPX T hyphen -100
+KPX T h -25
+KPX T e -74
+KPX T comma -100
+KPX T colon -50
+KPX T a -74
+KPX T O 18
+
+KPX U period -100
+KPX U comma -100
+KPX U A -18
+
+KPX V u -75
+KPX V semicolon -75
+KPX V period -100
+KPX V o -75
+KPX V i -50
+KPX V hyphen -100
+KPX V e -75
+KPX V comma -100
+KPX V colon -75
+KPX V a -75
+KPX V A -37
+
+KPX W y -55
+KPX W u -55
+KPX W semicolon -75
+KPX W period -100
+KPX W o -55
+KPX W i -20
+KPX W hyphen -75
+KPX W h -20
+KPX W e -55
+KPX W comma -100
+KPX W colon -75
+KPX W a -55
+KPX W A -55
+
+KPX Y u -100
+KPX Y semicolon -75
+KPX Y period -100
+KPX Y o -100
+KPX Y i -25
+KPX Y hyphen -100
+KPX Y e -100
+KPX Y comma -100
+KPX Y colon -75
+KPX Y a -100
+KPX Y A -55
+
+KPX b period -50
+KPX b comma -50
+KPX b b -10
+
+KPX c period -50
+KPX c k -18
+KPX c h -18
+KPX c comma -50
+
+KPX colon space -37
+
+KPX comma space -37
+KPX comma quoteright -37
+KPX comma quotedblright -37
+
+KPX e period -37
+KPX e comma -37
+
+KPX f quoteright 75
+KPX f quotedblright 75
+KPX f period -75
+KPX f o -10
+KPX f comma -75
+
+KPX g period -50
+KPX g comma -50
+
+KPX l y -10
+
+KPX o period -50
+KPX o comma -50
+
+KPX p period -50
+KPX p comma -50
+
+KPX period space -37
+KPX period quoteright -37
+KPX period quotedblright -37
+
+KPX quotedblleft A -75
+
+KPX quotedblright space -37
+
+KPX quoteleft quoteleft -37
+KPX quoteleft A -75
+
+KPX quoteright s -25
+KPX quoteright quoteright -37
+KPX quoteright d -37
+
+KPX r semicolon -25
+KPX r s -10
+KPX r period -125
+KPX r k -18
+KPX r hyphen -75
+KPX r comma -125
+KPX r colon -25
+
+KPX s period -50
+KPX s comma -50
+
+KPX semicolon space -37
+
+KPX space quoteleft -37
+KPX space quotedblleft -37
+KPX space Y -37
+KPX space W -37
+KPX space V -37
+KPX space T -37
+KPX space A -37
+
+KPX v period -75
+KPX v comma -75
+
+KPX w period -75
+KPX w comma -75
+
+KPX y period -75
+KPX y comma -75
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 246 256 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 246 256 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 231 256 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 246 256 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 216 246 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 231 256 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 255 256 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 255 256 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 255 256 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 255 256 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 97 256 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 97 256 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 97 256 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 97 256 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 301 256 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 283 256 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 283 256 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 283 256 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 283 256 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 283 256 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 227 256 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 301 256 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 301 256 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 301 256 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 301 256 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 256 256 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 236 256 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 227 256 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 121 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 121 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 121 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 121 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 121 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 121 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 56 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 56 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex 0 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis 0 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 56 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 139 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 139 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 65 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplb8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplb8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..de7698d29d18667ca1f9be02f58b23444bb3cc23
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplb8a.afm
@@ -0,0 +1,434 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Jul 2 22:26:30 1990
+Comment UniqueID 31793
+Comment VMusage 36031 46923
+FontName Palatino-Bold
+FullName Palatino Bold
+FamilyName Palatino
+Weight Bold
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -152 -266 1000 924
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.005
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 681
+XHeight 471
+Ascender 720
+Descender -258
+StartCharMetrics 228
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 278 ; N exclam ; B 63 -12 219 688 ;
+C 34 ; WX 402 ; N quotedbl ; B 22 376 380 695 ;
+C 35 ; WX 500 ; N numbersign ; B 4 0 496 673 ;
+C 36 ; WX 500 ; N dollar ; B 28 -114 472 721 ;
+C 37 ; WX 889 ; N percent ; B 61 -9 828 714 ;
+C 38 ; WX 833 ; N ampersand ; B 52 -17 813 684 ;
+C 39 ; WX 278 ; N quoteright ; B 29 405 249 695 ;
+C 40 ; WX 333 ; N parenleft ; B 65 -104 305 723 ;
+C 41 ; WX 333 ; N parenright ; B 28 -104 268 723 ;
+C 42 ; WX 444 ; N asterisk ; B 44 332 399 695 ;
+C 43 ; WX 606 ; N plus ; B 51 0 555 505 ;
+C 44 ; WX 250 ; N comma ; B -6 -166 227 141 ;
+C 45 ; WX 333 ; N hyphen ; B 16 195 317 305 ;
+C 46 ; WX 250 ; N period ; B 47 -12 203 144 ;
+C 47 ; WX 296 ; N slash ; B -9 -17 305 720 ;
+C 48 ; WX 500 ; N zero ; B 33 -17 468 660 ;
+C 49 ; WX 500 ; N one ; B 35 -3 455 670 ;
+C 50 ; WX 500 ; N two ; B 25 -3 472 660 ;
+C 51 ; WX 500 ; N three ; B 22 -17 458 660 ;
+C 52 ; WX 500 ; N four ; B 12 -3 473 672 ;
+C 53 ; WX 500 ; N five ; B 42 -17 472 656 ;
+C 54 ; WX 500 ; N six ; B 37 -17 469 660 ;
+C 55 ; WX 500 ; N seven ; B 46 -3 493 656 ;
+C 56 ; WX 500 ; N eight ; B 34 -17 467 660 ;
+C 57 ; WX 500 ; N nine ; B 31 -17 463 660 ;
+C 58 ; WX 250 ; N colon ; B 47 -12 203 454 ;
+C 59 ; WX 250 ; N semicolon ; B -6 -166 227 454 ;
+C 60 ; WX 606 ; N less ; B 49 -15 558 519 ;
+C 61 ; WX 606 ; N equal ; B 51 114 555 396 ;
+C 62 ; WX 606 ; N greater ; B 49 -15 558 519 ;
+C 63 ; WX 444 ; N question ; B 43 -12 411 687 ;
+C 64 ; WX 747 ; N at ; B 42 -12 704 681 ;
+C 65 ; WX 778 ; N A ; B 24 -3 757 686 ;
+C 66 ; WX 667 ; N B ; B 39 -3 611 681 ;
+C 67 ; WX 722 ; N C ; B 44 -17 695 695 ;
+C 68 ; WX 833 ; N D ; B 35 -3 786 681 ;
+C 69 ; WX 611 ; N E ; B 39 -4 577 681 ;
+C 70 ; WX 556 ; N F ; B 28 -3 539 681 ;
+C 71 ; WX 833 ; N G ; B 47 -17 776 695 ;
+C 72 ; WX 833 ; N H ; B 36 -3 796 681 ;
+C 73 ; WX 389 ; N I ; B 39 -3 350 681 ;
+C 74 ; WX 389 ; N J ; B -11 -213 350 681 ;
+C 75 ; WX 778 ; N K ; B 39 -3 763 681 ;
+C 76 ; WX 611 ; N L ; B 39 -4 577 681 ;
+C 77 ; WX 1000 ; N M ; B 32 -10 968 681 ;
+C 78 ; WX 833 ; N N ; B 35 -16 798 681 ;
+C 79 ; WX 833 ; N O ; B 47 -17 787 695 ;
+C 80 ; WX 611 ; N P ; B 39 -3 594 681 ;
+C 81 ; WX 833 ; N Q ; B 47 -184 787 695 ;
+C 82 ; WX 722 ; N R ; B 39 -3 708 681 ;
+C 83 ; WX 611 ; N S ; B 57 -17 559 695 ;
+C 84 ; WX 667 ; N T ; B 17 -3 650 681 ;
+C 85 ; WX 778 ; N U ; B 26 -17 760 681 ;
+C 86 ; WX 778 ; N V ; B 20 -3 763 681 ;
+C 87 ; WX 1000 ; N W ; B 17 -3 988 686 ;
+C 88 ; WX 667 ; N X ; B 17 -3 650 695 ;
+C 89 ; WX 667 ; N Y ; B 15 -3 660 695 ;
+C 90 ; WX 667 ; N Z ; B 24 -3 627 681 ;
+C 91 ; WX 333 ; N bracketleft ; B 73 -104 291 720 ;
+C 92 ; WX 606 ; N backslash ; B 72 0 534 720 ;
+C 93 ; WX 333 ; N bracketright ; B 42 -104 260 720 ;
+C 94 ; WX 606 ; N asciicircum ; B 52 275 554 678 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 29 405 249 695 ;
+C 97 ; WX 500 ; N a ; B 40 -17 478 471 ;
+C 98 ; WX 611 ; N b ; B 10 -17 556 720 ;
+C 99 ; WX 444 ; N c ; B 37 -17 414 471 ;
+C 100 ; WX 611 ; N d ; B 42 -17 577 720 ;
+C 101 ; WX 500 ; N e ; B 42 -17 461 471 ;
+C 102 ; WX 389 ; N f ; B 34 -3 381 720 ; L i fi ; L l fl ;
+C 103 ; WX 556 ; N g ; B 26 -266 535 471 ;
+C 104 ; WX 611 ; N h ; B 24 -3 587 720 ;
+C 105 ; WX 333 ; N i ; B 34 -3 298 706 ;
+C 106 ; WX 333 ; N j ; B 3 -266 241 706 ;
+C 107 ; WX 611 ; N k ; B 21 -3 597 720 ;
+C 108 ; WX 333 ; N l ; B 24 -3 296 720 ;
+C 109 ; WX 889 ; N m ; B 24 -3 864 471 ;
+C 110 ; WX 611 ; N n ; B 24 -3 587 471 ;
+C 111 ; WX 556 ; N o ; B 40 -17 517 471 ;
+C 112 ; WX 611 ; N p ; B 29 -258 567 471 ;
+C 113 ; WX 611 ; N q ; B 52 -258 589 471 ;
+C 114 ; WX 389 ; N r ; B 30 -3 389 471 ;
+C 115 ; WX 444 ; N s ; B 39 -17 405 471 ;
+C 116 ; WX 333 ; N t ; B 22 -17 324 632 ;
+C 117 ; WX 611 ; N u ; B 25 -17 583 471 ;
+C 118 ; WX 556 ; N v ; B 11 -3 545 459 ;
+C 119 ; WX 833 ; N w ; B 13 -3 820 471 ;
+C 120 ; WX 500 ; N x ; B 20 -3 483 471 ;
+C 121 ; WX 556 ; N y ; B 10 -266 546 459 ;
+C 122 ; WX 500 ; N z ; B 16 -3 464 459 ;
+C 123 ; WX 310 ; N braceleft ; B 5 -117 288 725 ;
+C 124 ; WX 606 ; N bar ; B 260 0 346 720 ;
+C 125 ; WX 310 ; N braceright ; B 22 -117 305 725 ;
+C 126 ; WX 606 ; N asciitilde ; B 51 155 555 342 ;
+C 161 ; WX 278 ; N exclamdown ; B 59 -227 215 471 ;
+C 162 ; WX 500 ; N cent ; B 73 -106 450 554 ;
+C 163 ; WX 500 ; N sterling ; B -2 -19 501 676 ;
+C 164 ; WX 167 ; N fraction ; B -152 0 320 660 ;
+C 165 ; WX 500 ; N yen ; B 17 -3 483 695 ;
+C 166 ; WX 500 ; N florin ; B 11 -242 490 703 ;
+C 167 ; WX 500 ; N section ; B 30 -217 471 695 ;
+C 168 ; WX 500 ; N currency ; B 32 96 468 533 ;
+C 169 ; WX 227 ; N quotesingle ; B 45 376 181 695 ;
+C 170 ; WX 500 ; N quotedblleft ; B 34 405 466 695 ;
+C 171 ; WX 500 ; N guillemotleft ; B 36 44 463 438 ;
+C 172 ; WX 389 ; N guilsinglleft ; B 82 44 307 438 ;
+C 173 ; WX 389 ; N guilsinglright ; B 82 44 307 438 ;
+C 174 ; WX 611 ; N fi ; B 10 -3 595 720 ;
+C 175 ; WX 611 ; N fl ; B 17 -3 593 720 ;
+C 177 ; WX 500 ; N endash ; B 0 208 500 291 ;
+C 178 ; WX 500 ; N dagger ; B 29 -6 472 682 ;
+C 179 ; WX 500 ; N daggerdbl ; B 32 -245 468 682 ;
+C 180 ; WX 250 ; N periodcentered ; B 47 179 203 335 ;
+C 182 ; WX 641 ; N paragraph ; B 19 -161 599 683 ;
+C 183 ; WX 606 ; N bullet ; B 131 172 475 516 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 56 -160 276 130 ;
+C 185 ; WX 500 ; N quotedblbase ; B 34 -160 466 130 ;
+C 186 ; WX 500 ; N quotedblright ; B 34 405 466 695 ;
+C 187 ; WX 500 ; N guillemotright ; B 37 44 464 438 ;
+C 188 ; WX 1000 ; N ellipsis ; B 89 -12 911 144 ;
+C 189 ; WX 1000 ; N perthousand ; B 33 -9 982 724 ;
+C 191 ; WX 444 ; N questiondown ; B 33 -231 401 471 ;
+C 193 ; WX 333 ; N grave ; B 18 506 256 691 ;
+C 194 ; WX 333 ; N acute ; B 78 506 316 691 ;
+C 195 ; WX 333 ; N circumflex ; B -2 506 335 681 ;
+C 196 ; WX 333 ; N tilde ; B -16 535 349 661 ;
+C 197 ; WX 333 ; N macron ; B 1 538 332 609 ;
+C 198 ; WX 333 ; N breve ; B 15 506 318 669 ;
+C 199 ; WX 333 ; N dotaccent ; B 100 537 234 671 ;
+C 200 ; WX 333 ; N dieresis ; B -8 537 341 671 ;
+C 202 ; WX 333 ; N ring ; B 67 500 267 700 ;
+C 203 ; WX 333 ; N cedilla ; B 73 -225 300 -7 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -56 506 390 691 ;
+C 206 ; WX 333 ; N ogonek ; B 60 -246 274 -17 ;
+C 207 ; WX 333 ; N caron ; B -2 510 335 685 ;
+C 208 ; WX 1000 ; N emdash ; B 0 208 1000 291 ;
+C 225 ; WX 1000 ; N AE ; B 12 -4 954 681 ;
+C 227 ; WX 438 ; N ordfeminine ; B 77 367 361 660 ;
+C 232 ; WX 611 ; N Lslash ; B 16 -4 577 681 ;
+C 233 ; WX 833 ; N Oslash ; B 32 -20 808 698 ;
+C 234 ; WX 1000 ; N OE ; B 43 -17 985 695 ;
+C 235 ; WX 488 ; N ordmasculine ; B 89 367 399 660 ;
+C 241 ; WX 778 ; N ae ; B 46 -17 731 471 ;
+C 245 ; WX 333 ; N dotlessi ; B 34 -3 298 471 ;
+C 248 ; WX 333 ; N lslash ; B -4 -3 334 720 ;
+C 249 ; WX 556 ; N oslash ; B 23 -18 534 471 ;
+C 250 ; WX 833 ; N oe ; B 48 -17 799 471 ;
+C 251 ; WX 611 ; N germandbls ; B 30 -17 565 720 ;
+C -1 ; WX 667 ; N Zcaron ; B 24 -3 627 909 ;
+C -1 ; WX 444 ; N ccedilla ; B 37 -225 414 471 ;
+C -1 ; WX 556 ; N ydieresis ; B 10 -266 546 691 ;
+C -1 ; WX 500 ; N atilde ; B 40 -17 478 673 ;
+C -1 ; WX 333 ; N icircumflex ; B -2 -3 335 701 ;
+C -1 ; WX 300 ; N threesuperior ; B 9 261 292 667 ;
+C -1 ; WX 500 ; N ecircumflex ; B 42 -17 461 701 ;
+C -1 ; WX 611 ; N thorn ; B 17 -258 563 720 ;
+C -1 ; WX 500 ; N egrave ; B 42 -17 461 711 ;
+C -1 ; WX 300 ; N twosuperior ; B 5 261 295 660 ;
+C -1 ; WX 500 ; N eacute ; B 42 -17 461 711 ;
+C -1 ; WX 556 ; N otilde ; B 40 -17 517 673 ;
+C -1 ; WX 778 ; N Aacute ; B 24 -3 757 915 ;
+C -1 ; WX 556 ; N ocircumflex ; B 40 -17 517 701 ;
+C -1 ; WX 556 ; N yacute ; B 10 -266 546 711 ;
+C -1 ; WX 611 ; N udieresis ; B 25 -17 583 691 ;
+C -1 ; WX 750 ; N threequarters ; B 15 -2 735 667 ;
+C -1 ; WX 500 ; N acircumflex ; B 40 -17 478 701 ;
+C -1 ; WX 833 ; N Eth ; B 10 -3 786 681 ;
+C -1 ; WX 500 ; N edieresis ; B 42 -17 461 691 ;
+C -1 ; WX 611 ; N ugrave ; B 25 -17 583 711 ;
+C -1 ; WX 998 ; N trademark ; B 38 274 961 678 ;
+C -1 ; WX 556 ; N ograve ; B 40 -17 517 711 ;
+C -1 ; WX 444 ; N scaron ; B 39 -17 405 693 ;
+C -1 ; WX 389 ; N Idieresis ; B 20 -3 369 895 ;
+C -1 ; WX 611 ; N uacute ; B 25 -17 583 711 ;
+C -1 ; WX 500 ; N agrave ; B 40 -17 478 711 ;
+C -1 ; WX 611 ; N ntilde ; B 24 -3 587 673 ;
+C -1 ; WX 500 ; N aring ; B 40 -17 478 700 ;
+C -1 ; WX 500 ; N zcaron ; B 16 -3 464 693 ;
+C -1 ; WX 389 ; N Icircumflex ; B 26 -3 363 905 ;
+C -1 ; WX 833 ; N Ntilde ; B 35 -16 798 885 ;
+C -1 ; WX 611 ; N ucircumflex ; B 25 -17 583 701 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 39 -4 577 905 ;
+C -1 ; WX 389 ; N Iacute ; B 39 -3 350 915 ;
+C -1 ; WX 722 ; N Ccedilla ; B 44 -225 695 695 ;
+C -1 ; WX 833 ; N Odieresis ; B 47 -17 787 895 ;
+C -1 ; WX 611 ; N Scaron ; B 57 -17 559 909 ;
+C -1 ; WX 611 ; N Edieresis ; B 39 -4 577 895 ;
+C -1 ; WX 389 ; N Igrave ; B 39 -3 350 915 ;
+C -1 ; WX 500 ; N adieresis ; B 40 -17 478 691 ;
+C -1 ; WX 833 ; N Ograve ; B 47 -17 787 915 ;
+C -1 ; WX 611 ; N Egrave ; B 39 -4 577 915 ;
+C -1 ; WX 667 ; N Ydieresis ; B 15 -3 660 895 ;
+C -1 ; WX 747 ; N registered ; B 26 -17 720 695 ;
+C -1 ; WX 833 ; N Otilde ; B 47 -17 787 885 ;
+C -1 ; WX 750 ; N onequarter ; B 19 -2 735 665 ;
+C -1 ; WX 778 ; N Ugrave ; B 26 -17 760 915 ;
+C -1 ; WX 778 ; N Ucircumflex ; B 26 -17 760 905 ;
+C -1 ; WX 611 ; N Thorn ; B 39 -3 574 681 ;
+C -1 ; WX 606 ; N divide ; B 51 0 555 510 ;
+C -1 ; WX 778 ; N Atilde ; B 24 -3 757 885 ;
+C -1 ; WX 778 ; N Uacute ; B 26 -17 760 915 ;
+C -1 ; WX 833 ; N Ocircumflex ; B 47 -17 787 905 ;
+C -1 ; WX 606 ; N logicalnot ; B 51 114 555 396 ;
+C -1 ; WX 778 ; N Aring ; B 24 -3 757 924 ;
+C -1 ; WX 333 ; N idieresis ; B -8 -3 341 691 ;
+C -1 ; WX 333 ; N iacute ; B 34 -3 316 711 ;
+C -1 ; WX 500 ; N aacute ; B 40 -17 478 711 ;
+C -1 ; WX 606 ; N plusminus ; B 51 0 555 505 ;
+C -1 ; WX 606 ; N multiply ; B 72 21 534 483 ;
+C -1 ; WX 778 ; N Udieresis ; B 26 -17 760 895 ;
+C -1 ; WX 606 ; N minus ; B 51 212 555 298 ;
+C -1 ; WX 300 ; N onesuperior ; B 14 261 287 665 ;
+C -1 ; WX 611 ; N Eacute ; B 39 -4 577 915 ;
+C -1 ; WX 778 ; N Acircumflex ; B 24 -3 757 905 ;
+C -1 ; WX 747 ; N copyright ; B 26 -17 720 695 ;
+C -1 ; WX 778 ; N Agrave ; B 24 -3 757 915 ;
+C -1 ; WX 556 ; N odieresis ; B 40 -17 517 691 ;
+C -1 ; WX 556 ; N oacute ; B 40 -17 517 711 ;
+C -1 ; WX 400 ; N degree ; B 50 360 350 660 ;
+C -1 ; WX 333 ; N igrave ; B 18 -3 298 711 ;
+C -1 ; WX 611 ; N mu ; B 25 -225 583 471 ;
+C -1 ; WX 833 ; N Oacute ; B 47 -17 787 915 ;
+C -1 ; WX 556 ; N eth ; B 40 -17 517 720 ;
+C -1 ; WX 778 ; N Adieresis ; B 24 -3 757 895 ;
+C -1 ; WX 667 ; N Yacute ; B 15 -3 660 915 ;
+C -1 ; WX 606 ; N brokenbar ; B 260 0 346 720 ;
+C -1 ; WX 750 ; N onehalf ; B 9 -2 745 665 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 101
+
+KPX A y -70
+KPX A w -70
+KPX A v -70
+KPX A space -18
+KPX A quoteright -92
+KPX A Y -111
+KPX A W -90
+KPX A V -129
+KPX A T -92
+
+KPX F period -111
+KPX F comma -111
+KPX F A -55
+
+KPX L y -74
+KPX L space -18
+KPX L quoteright -74
+KPX L Y -92
+KPX L W -92
+KPX L V -92
+KPX L T -74
+
+KPX P period -129
+KPX P comma -129
+KPX P A -74
+
+KPX R y -30
+KPX R Y -55
+KPX R W -37
+KPX R V -74
+KPX R T -55
+
+KPX T y -90
+KPX T w -90
+KPX T u -129
+KPX T semicolon -74
+KPX T s -111
+KPX T r -111
+KPX T period -92
+KPX T o -111
+KPX T i -55
+KPX T hyphen -92
+KPX T e -111
+KPX T comma -92
+KPX T colon -74
+KPX T c -129
+KPX T a -111
+KPX T A -92
+
+KPX V y -90
+KPX V u -92
+KPX V semicolon -74
+KPX V r -111
+KPX V period -129
+KPX V o -111
+KPX V i -55
+KPX V hyphen -92
+KPX V e -111
+KPX V comma -129
+KPX V colon -74
+KPX V a -111
+KPX V A -129
+
+KPX W y -74
+KPX W u -74
+KPX W semicolon -37
+KPX W r -74
+KPX W period -37
+KPX W o -74
+KPX W i -37
+KPX W hyphen -37
+KPX W e -74
+KPX W comma -92
+KPX W colon -37
+KPX W a -74
+KPX W A -90
+
+KPX Y v -74
+KPX Y u -74
+KPX Y semicolon -55
+KPX Y q -92
+KPX Y period -74
+KPX Y p -74
+KPX Y o -74
+KPX Y i -55
+KPX Y hyphen -74
+KPX Y e -74
+KPX Y comma -74
+KPX Y colon -55
+KPX Y a -74
+KPX Y A -55
+
+KPX f quoteright 37
+KPX f f -18
+
+KPX one one -37
+
+KPX quoteleft quoteleft -55
+
+KPX quoteright t -18
+KPX quoteright space -55
+KPX quoteright s -55
+KPX quoteright quoteright -55
+
+KPX r quoteright 55
+KPX r period -55
+KPX r hyphen -18
+KPX r comma -55
+
+KPX v period -111
+KPX v comma -111
+
+KPX w period -92
+KPX w comma -92
+
+KPX y period -92
+KPX y comma -92
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 223 224 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 211 224 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 223 224 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 215 224 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 223 224 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 223 224 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 195 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 224 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 224 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 224 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 224 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 28 224 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 28 224 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 28 224 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 28 224 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 250 224 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 250 224 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 250 224 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 250 224 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 250 224 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 250 224 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 139 224 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 235 224 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 235 224 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 235 224 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 223 224 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 211 224 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 199 224 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 167 224 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 84 20 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 84 20 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 84 20 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 84 20 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 84 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 12 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 84 20 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 96 20 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 92 20 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 84 20 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 20 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex 0 20 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis 0 20 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 20 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 139 12 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 112 20 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 112 20 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 112 20 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 112 20 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 112 12 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 56 8 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 151 20 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 139 20 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 139 20 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 131 20 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 144 20 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 124 20 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 8 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplbi8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplbi8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..e161d049090f6293283c265d07016a1872216bd1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplbi8a.afm
@@ -0,0 +1,441 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Jul 2 22:48:39 1990
+Comment UniqueID 31799
+Comment VMusage 37656 48548
+FontName Palatino-BoldItalic
+FullName Palatino Bold Italic
+FamilyName Palatino
+Weight Bold
+ItalicAngle -10
+IsFixedPitch false
+FontBBox -170 -271 1073 926
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.005
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 681
+XHeight 469
+Ascender 726
+Descender -271
+StartCharMetrics 228
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 58 -17 322 695 ;
+C 34 ; WX 500 ; N quotedbl ; B 137 467 493 720 ;
+C 35 ; WX 500 ; N numbersign ; B 4 0 496 673 ;
+C 36 ; WX 500 ; N dollar ; B 20 -108 477 737 ;
+C 37 ; WX 889 ; N percent ; B 56 -17 790 697 ;
+C 38 ; WX 833 ; N ampersand ; B 74 -17 811 695 ;
+C 39 ; WX 278 ; N quoteright ; B 76 431 302 720 ;
+C 40 ; WX 333 ; N parenleft ; B 58 -129 368 723 ;
+C 41 ; WX 333 ; N parenright ; B -12 -129 298 723 ;
+C 42 ; WX 444 ; N asterisk ; B 84 332 439 695 ;
+C 43 ; WX 606 ; N plus ; B 50 -5 556 501 ;
+C 44 ; WX 250 ; N comma ; B -33 -164 208 147 ;
+C 45 ; WX 389 ; N hyphen ; B 37 198 362 300 ;
+C 46 ; WX 250 ; N period ; B 48 -17 187 135 ;
+C 47 ; WX 315 ; N slash ; B 1 -17 315 720 ;
+C 48 ; WX 500 ; N zero ; B 42 -17 490 683 ;
+C 49 ; WX 500 ; N one ; B 41 -3 434 678 ;
+C 50 ; WX 500 ; N two ; B 1 -3 454 683 ;
+C 51 ; WX 500 ; N three ; B 8 -17 450 683 ;
+C 52 ; WX 500 ; N four ; B 3 -3 487 683 ;
+C 53 ; WX 500 ; N five ; B 14 -17 481 675 ;
+C 54 ; WX 500 ; N six ; B 39 -17 488 683 ;
+C 55 ; WX 500 ; N seven ; B 69 -3 544 674 ;
+C 56 ; WX 500 ; N eight ; B 26 -17 484 683 ;
+C 57 ; WX 500 ; N nine ; B 27 -17 491 683 ;
+C 58 ; WX 250 ; N colon ; B 38 -17 236 452 ;
+C 59 ; WX 250 ; N semicolon ; B -33 -164 247 452 ;
+C 60 ; WX 606 ; N less ; B 49 -21 558 517 ;
+C 61 ; WX 606 ; N equal ; B 51 106 555 390 ;
+C 62 ; WX 606 ; N greater ; B 48 -21 557 517 ;
+C 63 ; WX 444 ; N question ; B 91 -17 450 695 ;
+C 64 ; WX 833 ; N at ; B 82 -12 744 681 ;
+C 65 ; WX 722 ; N A ; B -35 -3 685 683 ;
+C 66 ; WX 667 ; N B ; B 8 -3 629 681 ;
+C 67 ; WX 685 ; N C ; B 69 -17 695 695 ;
+C 68 ; WX 778 ; N D ; B 0 -3 747 682 ;
+C 69 ; WX 611 ; N E ; B 11 -3 606 681 ;
+C 70 ; WX 556 ; N F ; B -6 -3 593 681 ;
+C 71 ; WX 778 ; N G ; B 72 -17 750 695 ;
+C 72 ; WX 778 ; N H ; B -12 -3 826 681 ;
+C 73 ; WX 389 ; N I ; B -1 -3 412 681 ;
+C 74 ; WX 389 ; N J ; B -29 -207 417 681 ;
+C 75 ; WX 722 ; N K ; B -10 -3 746 681 ;
+C 76 ; WX 611 ; N L ; B 26 -3 578 681 ;
+C 77 ; WX 944 ; N M ; B -23 -17 985 681 ;
+C 78 ; WX 778 ; N N ; B -2 -3 829 681 ;
+C 79 ; WX 833 ; N O ; B 76 -17 794 695 ;
+C 80 ; WX 667 ; N P ; B 11 -3 673 681 ;
+C 81 ; WX 833 ; N Q ; B 76 -222 794 695 ;
+C 82 ; WX 722 ; N R ; B 4 -3 697 681 ;
+C 83 ; WX 556 ; N S ; B 50 -17 517 695 ;
+C 84 ; WX 611 ; N T ; B 56 -3 674 681 ;
+C 85 ; WX 778 ; N U ; B 83 -17 825 681 ;
+C 86 ; WX 667 ; N V ; B 67 -3 745 681 ;
+C 87 ; WX 1000 ; N W ; B 67 -3 1073 689 ;
+C 88 ; WX 722 ; N X ; B -9 -3 772 681 ;
+C 89 ; WX 611 ; N Y ; B 54 -3 675 695 ;
+C 90 ; WX 667 ; N Z ; B 1 -3 676 681 ;
+C 91 ; WX 333 ; N bracketleft ; B 45 -102 381 723 ;
+C 92 ; WX 606 ; N backslash ; B 72 0 534 720 ;
+C 93 ; WX 333 ; N bracketright ; B -21 -102 315 723 ;
+C 94 ; WX 606 ; N asciicircum ; B 63 275 543 678 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 65 431 291 720 ;
+C 97 ; WX 556 ; N a ; B 44 -17 519 470 ;
+C 98 ; WX 537 ; N b ; B 44 -17 494 726 ;
+C 99 ; WX 444 ; N c ; B 32 -17 436 469 ;
+C 100 ; WX 556 ; N d ; B 38 -17 550 726 ;
+C 101 ; WX 444 ; N e ; B 28 -17 418 469 ;
+C 102 ; WX 333 ; N f ; B -130 -271 449 726 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B -50 -271 529 469 ;
+C 104 ; WX 556 ; N h ; B 22 -17 522 726 ;
+C 105 ; WX 333 ; N i ; B 26 -17 312 695 ;
+C 106 ; WX 333 ; N j ; B -64 -271 323 695 ;
+C 107 ; WX 556 ; N k ; B 34 -17 528 726 ;
+C 108 ; WX 333 ; N l ; B 64 -17 318 726 ;
+C 109 ; WX 833 ; N m ; B 19 -17 803 469 ;
+C 110 ; WX 556 ; N n ; B 17 -17 521 469 ;
+C 111 ; WX 556 ; N o ; B 48 -17 502 469 ;
+C 112 ; WX 556 ; N p ; B -21 -271 516 469 ;
+C 113 ; WX 537 ; N q ; B 32 -271 513 469 ;
+C 114 ; WX 389 ; N r ; B 20 -17 411 469 ;
+C 115 ; WX 444 ; N s ; B 25 -17 406 469 ;
+C 116 ; WX 389 ; N t ; B 42 -17 409 636 ;
+C 117 ; WX 556 ; N u ; B 22 -17 521 469 ;
+C 118 ; WX 556 ; N v ; B 19 -17 513 469 ;
+C 119 ; WX 833 ; N w ; B 27 -17 802 469 ;
+C 120 ; WX 500 ; N x ; B -8 -17 500 469 ;
+C 121 ; WX 556 ; N y ; B 13 -271 541 469 ;
+C 122 ; WX 500 ; N z ; B 31 -17 470 469 ;
+C 123 ; WX 333 ; N braceleft ; B 18 -105 334 720 ;
+C 124 ; WX 606 ; N bar ; B 259 0 347 720 ;
+C 125 ; WX 333 ; N braceright ; B -1 -105 315 720 ;
+C 126 ; WX 606 ; N asciitilde ; B 51 151 555 346 ;
+C 161 ; WX 333 ; N exclamdown ; B 2 -225 259 479 ;
+C 162 ; WX 500 ; N cent ; B 52 -105 456 547 ;
+C 163 ; WX 500 ; N sterling ; B 21 -5 501 683 ;
+C 164 ; WX 167 ; N fraction ; B -170 0 338 683 ;
+C 165 ; WX 500 ; N yen ; B 11 -3 538 695 ;
+C 166 ; WX 500 ; N florin ; B 8 -242 479 690 ;
+C 167 ; WX 556 ; N section ; B 47 -151 497 695 ;
+C 168 ; WX 500 ; N currency ; B 32 96 468 533 ;
+C 169 ; WX 250 ; N quotesingle ; B 127 467 293 720 ;
+C 170 ; WX 500 ; N quotedblleft ; B 65 431 511 720 ;
+C 171 ; WX 500 ; N guillemotleft ; B 35 43 458 446 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 60 43 292 446 ;
+C 173 ; WX 333 ; N guilsinglright ; B 35 40 267 443 ;
+C 174 ; WX 611 ; N fi ; B -130 -271 588 726 ;
+C 175 ; WX 611 ; N fl ; B -130 -271 631 726 ;
+C 177 ; WX 500 ; N endash ; B -12 214 512 282 ;
+C 178 ; WX 556 ; N dagger ; B 67 -3 499 685 ;
+C 179 ; WX 556 ; N daggerdbl ; B 33 -153 537 693 ;
+C 180 ; WX 250 ; N periodcentered ; B 67 172 206 324 ;
+C 182 ; WX 556 ; N paragraph ; B 14 -204 629 681 ;
+C 183 ; WX 606 ; N bullet ; B 131 172 475 516 ;
+C 184 ; WX 250 ; N quotesinglbase ; B -3 -144 220 145 ;
+C 185 ; WX 500 ; N quotedblbase ; B -18 -144 424 145 ;
+C 186 ; WX 500 ; N quotedblright ; B 73 431 519 720 ;
+C 187 ; WX 500 ; N guillemotright ; B 35 40 458 443 ;
+C 188 ; WX 1000 ; N ellipsis ; B 91 -17 896 135 ;
+C 189 ; WX 1000 ; N perthousand ; B 65 -17 912 691 ;
+C 191 ; WX 444 ; N questiondown ; B -12 -226 347 479 ;
+C 193 ; WX 333 ; N grave ; B 110 518 322 699 ;
+C 194 ; WX 333 ; N acute ; B 153 518 392 699 ;
+C 195 ; WX 333 ; N circumflex ; B 88 510 415 684 ;
+C 196 ; WX 333 ; N tilde ; B 82 535 441 654 ;
+C 197 ; WX 333 ; N macron ; B 76 538 418 608 ;
+C 198 ; WX 333 ; N breve ; B 96 518 412 680 ;
+C 199 ; WX 333 ; N dotaccent ; B 202 537 325 668 ;
+C 200 ; WX 333 ; N dieresis ; B 90 537 426 668 ;
+C 202 ; WX 556 ; N ring ; B 277 514 477 714 ;
+C 203 ; WX 333 ; N cedilla ; B 12 -218 248 5 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -28 518 409 699 ;
+C 206 ; WX 333 ; N ogonek ; B 32 -206 238 -17 ;
+C 207 ; WX 333 ; N caron ; B 113 510 445 684 ;
+C 208 ; WX 1000 ; N emdash ; B -12 214 1012 282 ;
+C 225 ; WX 944 ; N AE ; B -29 -3 927 681 ;
+C 227 ; WX 333 ; N ordfeminine ; B 47 391 355 684 ;
+C 232 ; WX 611 ; N Lslash ; B 6 -3 578 681 ;
+C 233 ; WX 833 ; N Oslash ; B 57 -54 797 730 ;
+C 234 ; WX 944 ; N OE ; B 39 -17 961 695 ;
+C 235 ; WX 333 ; N ordmasculine ; B 51 391 346 683 ;
+C 241 ; WX 738 ; N ae ; B 44 -17 711 469 ;
+C 245 ; WX 333 ; N dotlessi ; B 26 -17 293 469 ;
+C 248 ; WX 333 ; N lslash ; B 13 -17 365 726 ;
+C 249 ; WX 556 ; N oslash ; B 14 -50 522 506 ;
+C 250 ; WX 778 ; N oe ; B 48 -17 755 469 ;
+C 251 ; WX 556 ; N germandbls ; B -131 -271 549 726 ;
+C -1 ; WX 667 ; N Zcaron ; B 1 -3 676 896 ;
+C -1 ; WX 444 ; N ccedilla ; B 32 -218 436 469 ;
+C -1 ; WX 556 ; N ydieresis ; B 13 -271 541 688 ;
+C -1 ; WX 556 ; N atilde ; B 44 -17 553 666 ;
+C -1 ; WX 333 ; N icircumflex ; B 26 -17 403 704 ;
+C -1 ; WX 300 ; N threesuperior ; B 23 263 310 683 ;
+C -1 ; WX 444 ; N ecircumflex ; B 28 -17 471 704 ;
+C -1 ; WX 556 ; N thorn ; B -21 -271 516 726 ;
+C -1 ; WX 444 ; N egrave ; B 28 -17 418 719 ;
+C -1 ; WX 300 ; N twosuperior ; B 26 271 321 683 ;
+C -1 ; WX 444 ; N eacute ; B 28 -17 448 719 ;
+C -1 ; WX 556 ; N otilde ; B 48 -17 553 666 ;
+C -1 ; WX 722 ; N Aacute ; B -35 -3 685 911 ;
+C -1 ; WX 556 ; N ocircumflex ; B 48 -17 515 704 ;
+C -1 ; WX 556 ; N yacute ; B 13 -271 541 719 ;
+C -1 ; WX 556 ; N udieresis ; B 22 -17 538 688 ;
+C -1 ; WX 750 ; N threequarters ; B 18 -2 732 683 ;
+C -1 ; WX 556 ; N acircumflex ; B 44 -17 527 704 ;
+C -1 ; WX 778 ; N Eth ; B 0 -3 747 682 ;
+C -1 ; WX 444 ; N edieresis ; B 28 -17 482 688 ;
+C -1 ; WX 556 ; N ugrave ; B 22 -17 521 719 ;
+C -1 ; WX 1000 ; N trademark ; B 38 274 961 678 ;
+C -1 ; WX 556 ; N ograve ; B 48 -17 502 719 ;
+C -1 ; WX 444 ; N scaron ; B 25 -17 489 692 ;
+C -1 ; WX 389 ; N Idieresis ; B -1 -3 454 880 ;
+C -1 ; WX 556 ; N uacute ; B 22 -17 521 719 ;
+C -1 ; WX 556 ; N agrave ; B 44 -17 519 719 ;
+C -1 ; WX 556 ; N ntilde ; B 17 -17 553 666 ;
+C -1 ; WX 556 ; N aring ; B 44 -17 519 714 ;
+C -1 ; WX 500 ; N zcaron ; B 31 -17 517 692 ;
+C -1 ; WX 389 ; N Icircumflex ; B -1 -3 443 896 ;
+C -1 ; WX 778 ; N Ntilde ; B -2 -3 829 866 ;
+C -1 ; WX 556 ; N ucircumflex ; B 22 -17 521 704 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 11 -3 606 896 ;
+C -1 ; WX 389 ; N Iacute ; B -1 -3 420 911 ;
+C -1 ; WX 685 ; N Ccedilla ; B 69 -218 695 695 ;
+C -1 ; WX 833 ; N Odieresis ; B 76 -17 794 880 ;
+C -1 ; WX 556 ; N Scaron ; B 50 -17 557 896 ;
+C -1 ; WX 611 ; N Edieresis ; B 11 -3 606 880 ;
+C -1 ; WX 389 ; N Igrave ; B -1 -3 412 911 ;
+C -1 ; WX 556 ; N adieresis ; B 44 -17 538 688 ;
+C -1 ; WX 833 ; N Ograve ; B 76 -17 794 911 ;
+C -1 ; WX 611 ; N Egrave ; B 11 -3 606 911 ;
+C -1 ; WX 611 ; N Ydieresis ; B 54 -3 675 880 ;
+C -1 ; WX 747 ; N registered ; B 26 -17 720 695 ;
+C -1 ; WX 833 ; N Otilde ; B 76 -17 794 866 ;
+C -1 ; WX 750 ; N onequarter ; B 18 -2 732 683 ;
+C -1 ; WX 778 ; N Ugrave ; B 83 -17 825 911 ;
+C -1 ; WX 778 ; N Ucircumflex ; B 83 -17 825 896 ;
+C -1 ; WX 667 ; N Thorn ; B 11 -3 644 681 ;
+C -1 ; WX 606 ; N divide ; B 50 -5 556 501 ;
+C -1 ; WX 722 ; N Atilde ; B -35 -3 685 866 ;
+C -1 ; WX 778 ; N Uacute ; B 83 -17 825 911 ;
+C -1 ; WX 833 ; N Ocircumflex ; B 76 -17 794 896 ;
+C -1 ; WX 606 ; N logicalnot ; B 51 107 555 390 ;
+C -1 ; WX 722 ; N Aring ; B -35 -3 685 926 ;
+C -1 ; WX 333 ; N idieresis ; B 26 -17 426 688 ;
+C -1 ; WX 333 ; N iacute ; B 26 -17 392 719 ;
+C -1 ; WX 556 ; N aacute ; B 44 -17 519 719 ;
+C -1 ; WX 606 ; N plusminus ; B 50 0 556 501 ;
+C -1 ; WX 606 ; N multiply ; B 72 17 534 479 ;
+C -1 ; WX 778 ; N Udieresis ; B 83 -17 825 880 ;
+C -1 ; WX 606 ; N minus ; B 51 204 555 292 ;
+C -1 ; WX 300 ; N onesuperior ; B 41 271 298 680 ;
+C -1 ; WX 611 ; N Eacute ; B 11 -3 606 911 ;
+C -1 ; WX 722 ; N Acircumflex ; B -35 -3 685 896 ;
+C -1 ; WX 747 ; N copyright ; B 26 -17 720 695 ;
+C -1 ; WX 722 ; N Agrave ; B -35 -3 685 911 ;
+C -1 ; WX 556 ; N odieresis ; B 48 -17 538 688 ;
+C -1 ; WX 556 ; N oacute ; B 48 -17 504 719 ;
+C -1 ; WX 400 ; N degree ; B 50 383 350 683 ;
+C -1 ; WX 333 ; N igrave ; B 26 -17 322 719 ;
+C -1 ; WX 556 ; N mu ; B -15 -232 521 469 ;
+C -1 ; WX 833 ; N Oacute ; B 76 -17 794 911 ;
+C -1 ; WX 556 ; N eth ; B 48 -17 546 726 ;
+C -1 ; WX 722 ; N Adieresis ; B -35 -3 685 880 ;
+C -1 ; WX 611 ; N Yacute ; B 54 -3 675 911 ;
+C -1 ; WX 606 ; N brokenbar ; B 259 0 347 720 ;
+C -1 ; WX 750 ; N onehalf ; B 14 -2 736 683 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 108
+
+KPX A y -55
+KPX A w -37
+KPX A v -55
+KPX A space -55
+KPX A quoteright -55
+KPX A Y -74
+KPX A W -74
+KPX A V -74
+KPX A T -55
+
+KPX F space -18
+KPX F period -111
+KPX F comma -111
+KPX F A -74
+
+KPX L y -37
+KPX L space -18
+KPX L quoteright -55
+KPX L Y -74
+KPX L W -74
+KPX L V -74
+KPX L T -74
+
+KPX P space -55
+KPX P period -129
+KPX P comma -129
+KPX P A -92
+
+KPX R y -20
+KPX R Y -37
+KPX R W -55
+KPX R V -55
+KPX R T -37
+
+KPX T y -80
+KPX T w -50
+KPX T u -92
+KPX T semicolon -55
+KPX T s -92
+KPX T r -92
+KPX T period -55
+KPX T o -111
+KPX T i -74
+KPX T hyphen -92
+KPX T e -111
+KPX T comma -55
+KPX T colon -55
+KPX T c -92
+KPX T a -111
+KPX T O -18
+KPX T A -55
+
+KPX V y -50
+KPX V u -50
+KPX V semicolon -37
+KPX V r -74
+KPX V period -111
+KPX V o -74
+KPX V i -50
+KPX V hyphen -37
+KPX V e -74
+KPX V comma -111
+KPX V colon -37
+KPX V a -92
+KPX V A -74
+
+KPX W y -30
+KPX W u -30
+KPX W semicolon -18
+KPX W r -30
+KPX W period -55
+KPX W o -55
+KPX W i -30
+KPX W e -55
+KPX W comma -55
+KPX W colon -28
+KPX W a -74
+KPX W A -74
+
+KPX Y v -30
+KPX Y u -50
+KPX Y semicolon -55
+KPX Y q -92
+KPX Y period -55
+KPX Y p -74
+KPX Y o -111
+KPX Y i -54
+KPX Y hyphen -55
+KPX Y e -92
+KPX Y comma -55
+KPX Y colon -55
+KPX Y a -111
+KPX Y A -55
+
+KPX f quoteright 37
+KPX f f -37
+
+KPX one one -55
+
+KPX quoteleft quoteleft -55
+
+KPX quoteright t -18
+KPX quoteright space -37
+KPX quoteright s -37
+KPX quoteright quoteright -55
+
+KPX r quoteright 55
+KPX r q -18
+KPX r period -55
+KPX r o -18
+KPX r h -18
+KPX r g -18
+KPX r e -18
+KPX r comma -55
+KPX r c -18
+
+KPX v period -55
+KPX v comma -55
+
+KPX w period -55
+KPX w comma -55
+
+KPX y period -37
+KPX y comma -37
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 212 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 195 212 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 195 212 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 195 212 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 83 212 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 195 212 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 176 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 212 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 212 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 212 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 212 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 28 212 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 28 212 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 28 212 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 28 212 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 223 212 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 250 212 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 250 212 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 250 212 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 250 212 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 250 212 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 212 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 223 212 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 223 212 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 223 212 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 211 212 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 151 212 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 139 212 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 167 212 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 112 20 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 112 20 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 112 20 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 112 20 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 0 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 112 12 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 56 20 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 20 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 56 20 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 56 20 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute 0 20 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -12 20 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis 0 20 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave 0 20 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 112 12 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 112 20 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 100 20 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 112 20 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 112 20 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 112 12 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 44 8 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 112 20 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 100 20 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 112 20 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 112 20 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 112 20 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 112 20 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 72 8 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplr8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplr8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..6566b16ed78c2bfec7e0abbd7698e6bf98e3e738
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplr8a.afm
@@ -0,0 +1,445 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Jul 2 22:14:17 1990
+Comment UniqueID 31790
+Comment VMusage 36445 47337
+FontName Palatino-Roman
+FullName Palatino Roman
+FamilyName Palatino
+Weight Roman
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -166 -283 1021 927
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.005
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 692
+XHeight 469
+Ascender 726
+Descender -281
+StartCharMetrics 228
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 278 ; N exclam ; B 81 -5 197 694 ;
+C 34 ; WX 371 ; N quotedbl ; B 52 469 319 709 ;
+C 35 ; WX 500 ; N numbersign ; B 4 0 495 684 ;
+C 36 ; WX 500 ; N dollar ; B 30 -116 471 731 ;
+C 37 ; WX 840 ; N percent ; B 39 -20 802 709 ;
+C 38 ; WX 778 ; N ampersand ; B 43 -20 753 689 ;
+C 39 ; WX 278 ; N quoteright ; B 45 446 233 709 ;
+C 40 ; WX 333 ; N parenleft ; B 60 -215 301 726 ;
+C 41 ; WX 333 ; N parenright ; B 32 -215 273 726 ;
+C 42 ; WX 389 ; N asterisk ; B 32 342 359 689 ;
+C 43 ; WX 606 ; N plus ; B 51 7 555 512 ;
+C 44 ; WX 250 ; N comma ; B 16 -155 218 123 ;
+C 45 ; WX 333 ; N hyphen ; B 17 215 312 287 ;
+C 46 ; WX 250 ; N period ; B 67 -5 183 111 ;
+C 47 ; WX 606 ; N slash ; B 87 -119 519 726 ;
+C 48 ; WX 500 ; N zero ; B 29 -20 465 689 ;
+C 49 ; WX 500 ; N one ; B 60 -3 418 694 ;
+C 50 ; WX 500 ; N two ; B 16 -3 468 689 ;
+C 51 ; WX 500 ; N three ; B 15 -20 462 689 ;
+C 52 ; WX 500 ; N four ; B 2 -3 472 694 ;
+C 53 ; WX 500 ; N five ; B 13 -20 459 689 ;
+C 54 ; WX 500 ; N six ; B 32 -20 468 689 ;
+C 55 ; WX 500 ; N seven ; B 44 -3 497 689 ;
+C 56 ; WX 500 ; N eight ; B 30 -20 464 689 ;
+C 57 ; WX 500 ; N nine ; B 20 -20 457 689 ;
+C 58 ; WX 250 ; N colon ; B 66 -5 182 456 ;
+C 59 ; WX 250 ; N semicolon ; B 16 -153 218 456 ;
+C 60 ; WX 606 ; N less ; B 57 0 558 522 ;
+C 61 ; WX 606 ; N equal ; B 51 136 555 386 ;
+C 62 ; WX 606 ; N greater ; B 48 0 549 522 ;
+C 63 ; WX 444 ; N question ; B 43 -5 395 694 ;
+C 64 ; WX 747 ; N at ; B 24 -20 724 694 ;
+C 65 ; WX 778 ; N A ; B 15 -3 756 700 ;
+C 66 ; WX 611 ; N B ; B 26 -3 576 692 ;
+C 67 ; WX 709 ; N C ; B 22 -20 670 709 ;
+C 68 ; WX 774 ; N D ; B 22 -3 751 692 ;
+C 69 ; WX 611 ; N E ; B 22 -3 572 692 ;
+C 70 ; WX 556 ; N F ; B 22 -3 536 692 ;
+C 71 ; WX 763 ; N G ; B 22 -20 728 709 ;
+C 72 ; WX 832 ; N H ; B 22 -3 810 692 ;
+C 73 ; WX 337 ; N I ; B 22 -3 315 692 ;
+C 74 ; WX 333 ; N J ; B -15 -194 311 692 ;
+C 75 ; WX 726 ; N K ; B 22 -3 719 692 ;
+C 76 ; WX 611 ; N L ; B 22 -3 586 692 ;
+C 77 ; WX 946 ; N M ; B 16 -13 926 692 ;
+C 78 ; WX 831 ; N N ; B 17 -20 813 692 ;
+C 79 ; WX 786 ; N O ; B 22 -20 764 709 ;
+C 80 ; WX 604 ; N P ; B 22 -3 580 692 ;
+C 81 ; WX 786 ; N Q ; B 22 -176 764 709 ;
+C 82 ; WX 668 ; N R ; B 22 -3 669 692 ;
+C 83 ; WX 525 ; N S ; B 24 -20 503 709 ;
+C 84 ; WX 613 ; N T ; B 18 -3 595 692 ;
+C 85 ; WX 778 ; N U ; B 12 -20 759 692 ;
+C 86 ; WX 722 ; N V ; B 8 -9 706 692 ;
+C 87 ; WX 1000 ; N W ; B 8 -9 984 700 ;
+C 88 ; WX 667 ; N X ; B 14 -3 648 700 ;
+C 89 ; WX 667 ; N Y ; B 9 -3 654 704 ;
+C 90 ; WX 667 ; N Z ; B 15 -3 638 692 ;
+C 91 ; WX 333 ; N bracketleft ; B 79 -184 288 726 ;
+C 92 ; WX 606 ; N backslash ; B 81 0 512 726 ;
+C 93 ; WX 333 ; N bracketright ; B 45 -184 254 726 ;
+C 94 ; WX 606 ; N asciicircum ; B 51 283 554 689 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 45 446 233 709 ;
+C 97 ; WX 500 ; N a ; B 32 -12 471 469 ;
+C 98 ; WX 553 ; N b ; B -15 -12 508 726 ;
+C 99 ; WX 444 ; N c ; B 26 -20 413 469 ;
+C 100 ; WX 611 ; N d ; B 35 -12 579 726 ;
+C 101 ; WX 479 ; N e ; B 26 -20 448 469 ;
+C 102 ; WX 333 ; N f ; B 23 -3 341 728 ; L i fi ; L l fl ;
+C 103 ; WX 556 ; N g ; B 32 -283 544 469 ;
+C 104 ; WX 582 ; N h ; B 6 -3 572 726 ;
+C 105 ; WX 291 ; N i ; B 21 -3 271 687 ;
+C 106 ; WX 234 ; N j ; B -40 -283 167 688 ;
+C 107 ; WX 556 ; N k ; B 21 -12 549 726 ;
+C 108 ; WX 291 ; N l ; B 21 -3 271 726 ;
+C 109 ; WX 883 ; N m ; B 16 -3 869 469 ;
+C 110 ; WX 582 ; N n ; B 6 -3 572 469 ;
+C 111 ; WX 546 ; N o ; B 32 -20 514 469 ;
+C 112 ; WX 601 ; N p ; B 8 -281 554 469 ;
+C 113 ; WX 560 ; N q ; B 35 -281 560 469 ;
+C 114 ; WX 395 ; N r ; B 21 -3 374 469 ;
+C 115 ; WX 424 ; N s ; B 30 -20 391 469 ;
+C 116 ; WX 326 ; N t ; B 22 -12 319 621 ;
+C 117 ; WX 603 ; N u ; B 18 -12 581 469 ;
+C 118 ; WX 565 ; N v ; B 6 -7 539 459 ;
+C 119 ; WX 834 ; N w ; B 6 -7 808 469 ;
+C 120 ; WX 516 ; N x ; B 20 -3 496 469 ;
+C 121 ; WX 556 ; N y ; B 12 -283 544 459 ;
+C 122 ; WX 500 ; N z ; B 16 -3 466 462 ;
+C 123 ; WX 333 ; N braceleft ; B 58 -175 289 726 ;
+C 124 ; WX 606 ; N bar ; B 275 0 331 726 ;
+C 125 ; WX 333 ; N braceright ; B 44 -175 275 726 ;
+C 126 ; WX 606 ; N asciitilde ; B 51 176 555 347 ;
+C 161 ; WX 278 ; N exclamdown ; B 81 -225 197 469 ;
+C 162 ; WX 500 ; N cent ; B 61 -101 448 562 ;
+C 163 ; WX 500 ; N sterling ; B 12 -13 478 694 ;
+C 164 ; WX 167 ; N fraction ; B -166 0 337 689 ;
+C 165 ; WX 500 ; N yen ; B 5 -3 496 701 ;
+C 166 ; WX 500 ; N florin ; B 0 -262 473 706 ;
+C 167 ; WX 500 ; N section ; B 26 -219 465 709 ;
+C 168 ; WX 500 ; N currency ; B 30 96 470 531 ;
+C 169 ; WX 208 ; N quotesingle ; B 61 469 147 709 ;
+C 170 ; WX 500 ; N quotedblleft ; B 51 446 449 709 ;
+C 171 ; WX 500 ; N guillemotleft ; B 50 71 450 428 ;
+C 172 ; WX 331 ; N guilsinglleft ; B 66 71 265 428 ;
+C 173 ; WX 331 ; N guilsinglright ; B 66 71 265 428 ;
+C 174 ; WX 605 ; N fi ; B 23 -3 587 728 ;
+C 175 ; WX 608 ; N fl ; B 23 -3 590 728 ;
+C 177 ; WX 500 ; N endash ; B 0 219 500 277 ;
+C 178 ; WX 500 ; N dagger ; B 34 -5 466 694 ;
+C 179 ; WX 500 ; N daggerdbl ; B 34 -249 466 694 ;
+C 180 ; WX 250 ; N periodcentered ; B 67 203 183 319 ;
+C 182 ; WX 628 ; N paragraph ; B 39 -150 589 694 ;
+C 183 ; WX 606 ; N bullet ; B 131 172 475 516 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 22 -153 210 110 ;
+C 185 ; WX 500 ; N quotedblbase ; B 51 -153 449 110 ;
+C 186 ; WX 500 ; N quotedblright ; B 51 446 449 709 ;
+C 187 ; WX 500 ; N guillemotright ; B 50 71 450 428 ;
+C 188 ; WX 1000 ; N ellipsis ; B 109 -5 891 111 ;
+C 189 ; WX 1144 ; N perthousand ; B 123 -20 1021 709 ;
+C 191 ; WX 444 ; N questiondown ; B 43 -231 395 469 ;
+C 193 ; WX 333 ; N grave ; B 31 506 255 677 ;
+C 194 ; WX 333 ; N acute ; B 78 506 302 677 ;
+C 195 ; WX 333 ; N circumflex ; B 11 510 323 677 ;
+C 196 ; WX 333 ; N tilde ; B 2 535 332 640 ;
+C 197 ; WX 333 ; N macron ; B 11 538 323 591 ;
+C 198 ; WX 333 ; N breve ; B 26 506 308 664 ;
+C 199 ; WX 250 ; N dotaccent ; B 75 537 175 637 ;
+C 200 ; WX 333 ; N dieresis ; B 17 537 316 637 ;
+C 202 ; WX 333 ; N ring ; B 67 496 267 696 ;
+C 203 ; WX 333 ; N cedilla ; B 96 -225 304 -10 ;
+C 205 ; WX 380 ; N hungarumlaut ; B 3 506 377 687 ;
+C 206 ; WX 313 ; N ogonek ; B 68 -165 245 -20 ;
+C 207 ; WX 333 ; N caron ; B 11 510 323 677 ;
+C 208 ; WX 1000 ; N emdash ; B 0 219 1000 277 ;
+C 225 ; WX 944 ; N AE ; B -10 -3 908 692 ;
+C 227 ; WX 333 ; N ordfeminine ; B 24 422 310 709 ;
+C 232 ; WX 611 ; N Lslash ; B 6 -3 586 692 ;
+C 233 ; WX 833 ; N Oslash ; B 30 -20 797 709 ;
+C 234 ; WX 998 ; N OE ; B 22 -20 962 709 ;
+C 235 ; WX 333 ; N ordmasculine ; B 10 416 323 709 ;
+C 241 ; WX 758 ; N ae ; B 30 -20 732 469 ;
+C 245 ; WX 287 ; N dotlessi ; B 21 -3 271 469 ;
+C 248 ; WX 291 ; N lslash ; B -14 -3 306 726 ;
+C 249 ; WX 556 ; N oslash ; B 16 -23 530 474 ;
+C 250 ; WX 827 ; N oe ; B 32 -20 800 469 ;
+C 251 ; WX 556 ; N germandbls ; B 23 -9 519 731 ;
+C -1 ; WX 667 ; N Zcaron ; B 15 -3 638 908 ;
+C -1 ; WX 444 ; N ccedilla ; B 26 -225 413 469 ;
+C -1 ; WX 556 ; N ydieresis ; B 12 -283 544 657 ;
+C -1 ; WX 500 ; N atilde ; B 32 -12 471 652 ;
+C -1 ; WX 287 ; N icircumflex ; B -12 -3 300 697 ;
+C -1 ; WX 300 ; N threesuperior ; B 1 266 299 689 ;
+C -1 ; WX 479 ; N ecircumflex ; B 26 -20 448 697 ;
+C -1 ; WX 601 ; N thorn ; B -2 -281 544 726 ;
+C -1 ; WX 479 ; N egrave ; B 26 -20 448 697 ;
+C -1 ; WX 300 ; N twosuperior ; B 0 273 301 689 ;
+C -1 ; WX 479 ; N eacute ; B 26 -20 448 697 ;
+C -1 ; WX 546 ; N otilde ; B 32 -20 514 652 ;
+C -1 ; WX 778 ; N Aacute ; B 15 -3 756 908 ;
+C -1 ; WX 546 ; N ocircumflex ; B 32 -20 514 697 ;
+C -1 ; WX 556 ; N yacute ; B 12 -283 544 697 ;
+C -1 ; WX 603 ; N udieresis ; B 18 -12 581 657 ;
+C -1 ; WX 750 ; N threequarters ; B 15 -3 735 689 ;
+C -1 ; WX 500 ; N acircumflex ; B 32 -12 471 697 ;
+C -1 ; WX 774 ; N Eth ; B 14 -3 751 692 ;
+C -1 ; WX 479 ; N edieresis ; B 26 -20 448 657 ;
+C -1 ; WX 603 ; N ugrave ; B 18 -12 581 697 ;
+C -1 ; WX 979 ; N trademark ; B 40 285 939 689 ;
+C -1 ; WX 546 ; N ograve ; B 32 -20 514 697 ;
+C -1 ; WX 424 ; N scaron ; B 30 -20 391 685 ;
+C -1 ; WX 337 ; N Idieresis ; B 19 -3 318 868 ;
+C -1 ; WX 603 ; N uacute ; B 18 -12 581 697 ;
+C -1 ; WX 500 ; N agrave ; B 32 -12 471 697 ;
+C -1 ; WX 582 ; N ntilde ; B 6 -3 572 652 ;
+C -1 ; WX 500 ; N aring ; B 32 -12 471 716 ;
+C -1 ; WX 500 ; N zcaron ; B 16 -3 466 685 ;
+C -1 ; WX 337 ; N Icircumflex ; B 13 -3 325 908 ;
+C -1 ; WX 831 ; N Ntilde ; B 17 -20 813 871 ;
+C -1 ; WX 603 ; N ucircumflex ; B 18 -12 581 697 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 22 -3 572 908 ;
+C -1 ; WX 337 ; N Iacute ; B 22 -3 315 908 ;
+C -1 ; WX 709 ; N Ccedilla ; B 22 -225 670 709 ;
+C -1 ; WX 786 ; N Odieresis ; B 22 -20 764 868 ;
+C -1 ; WX 525 ; N Scaron ; B 24 -20 503 908 ;
+C -1 ; WX 611 ; N Edieresis ; B 22 -3 572 868 ;
+C -1 ; WX 337 ; N Igrave ; B 22 -3 315 908 ;
+C -1 ; WX 500 ; N adieresis ; B 32 -12 471 657 ;
+C -1 ; WX 786 ; N Ograve ; B 22 -20 764 908 ;
+C -1 ; WX 611 ; N Egrave ; B 22 -3 572 908 ;
+C -1 ; WX 667 ; N Ydieresis ; B 9 -3 654 868 ;
+C -1 ; WX 747 ; N registered ; B 11 -18 736 706 ;
+C -1 ; WX 786 ; N Otilde ; B 22 -20 764 883 ;
+C -1 ; WX 750 ; N onequarter ; B 30 -3 727 692 ;
+C -1 ; WX 778 ; N Ugrave ; B 12 -20 759 908 ;
+C -1 ; WX 778 ; N Ucircumflex ; B 12 -20 759 908 ;
+C -1 ; WX 604 ; N Thorn ; B 32 -3 574 692 ;
+C -1 ; WX 606 ; N divide ; B 51 10 555 512 ;
+C -1 ; WX 778 ; N Atilde ; B 15 -3 756 871 ;
+C -1 ; WX 778 ; N Uacute ; B 12 -20 759 908 ;
+C -1 ; WX 786 ; N Ocircumflex ; B 22 -20 764 908 ;
+C -1 ; WX 606 ; N logicalnot ; B 51 120 551 386 ;
+C -1 ; WX 778 ; N Aring ; B 15 -3 756 927 ;
+C -1 ; WX 287 ; N idieresis ; B -6 -3 293 657 ;
+C -1 ; WX 287 ; N iacute ; B 21 -3 279 697 ;
+C -1 ; WX 500 ; N aacute ; B 32 -12 471 697 ;
+C -1 ; WX 606 ; N plusminus ; B 51 0 555 512 ;
+C -1 ; WX 606 ; N multiply ; B 83 36 523 474 ;
+C -1 ; WX 778 ; N Udieresis ; B 12 -20 759 868 ;
+C -1 ; WX 606 ; N minus ; B 51 233 555 289 ;
+C -1 ; WX 300 ; N onesuperior ; B 31 273 269 692 ;
+C -1 ; WX 611 ; N Eacute ; B 22 -3 572 908 ;
+C -1 ; WX 778 ; N Acircumflex ; B 15 -3 756 908 ;
+C -1 ; WX 747 ; N copyright ; B 11 -18 736 706 ;
+C -1 ; WX 778 ; N Agrave ; B 15 -3 756 908 ;
+C -1 ; WX 546 ; N odieresis ; B 32 -20 514 657 ;
+C -1 ; WX 546 ; N oacute ; B 32 -20 514 697 ;
+C -1 ; WX 400 ; N degree ; B 50 389 350 689 ;
+C -1 ; WX 287 ; N igrave ; B 8 -3 271 697 ;
+C -1 ; WX 603 ; N mu ; B 18 -236 581 469 ;
+C -1 ; WX 786 ; N Oacute ; B 22 -20 764 908 ;
+C -1 ; WX 546 ; N eth ; B 32 -20 504 728 ;
+C -1 ; WX 778 ; N Adieresis ; B 15 -3 756 868 ;
+C -1 ; WX 667 ; N Yacute ; B 9 -3 654 908 ;
+C -1 ; WX 606 ; N brokenbar ; B 275 0 331 726 ;
+C -1 ; WX 750 ; N onehalf ; B 15 -3 735 692 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 111
+
+KPX A y -74
+KPX A w -74
+KPX A v -92
+KPX A space -55
+KPX A quoteright -74
+KPX A Y -111
+KPX A W -74
+KPX A V -111
+KPX A T -74
+
+KPX F period -92
+KPX F comma -92
+KPX F A -74
+
+KPX L y -55
+KPX L space -37
+KPX L quoteright -74
+KPX L Y -92
+KPX L W -74
+KPX L V -92
+KPX L T -74
+
+KPX P space -18
+KPX P period -129
+KPX P comma -129
+KPX P A -92
+
+KPX R y -37
+KPX R Y -37
+KPX R W -37
+KPX R V -55
+KPX R T -37
+
+KPX T y -90
+KPX T w -90
+KPX T u -90
+KPX T semicolon -55
+KPX T s -90
+KPX T r -90
+KPX T period -74
+KPX T o -92
+KPX T i -55
+KPX T hyphen -55
+KPX T e -92
+KPX T comma -74
+KPX T colon -55
+KPX T c -111
+KPX T a -92
+KPX T O -18
+KPX T A -74
+
+KPX V y -92
+KPX V u -92
+KPX V semicolon -55
+KPX V r -92
+KPX V period -129
+KPX V o -111
+KPX V i -55
+KPX V hyphen -74
+KPX V e -111
+KPX V comma -129
+KPX V colon -55
+KPX V a -92
+KPX V A -111
+
+KPX W y -50
+KPX W u -50
+KPX W semicolon -18
+KPX W r -74
+KPX W period -92
+KPX W o -92
+KPX W i -55
+KPX W hyphen -55
+KPX W e -92
+KPX W comma -92
+KPX W colon -18
+KPX W a -92
+KPX W A -92
+
+KPX Y v -90
+KPX Y u -90
+KPX Y space -18
+KPX Y semicolon -74
+KPX Y q -90
+KPX Y period -111
+KPX Y p -111
+KPX Y o -92
+KPX Y i -55
+KPX Y hyphen -92
+KPX Y e -92
+KPX Y comma -111
+KPX Y colon -74
+KPX Y a -92
+KPX Y A -92
+
+KPX f quoteright 55
+KPX f f -18
+
+KPX one one -55
+
+KPX quoteleft quoteleft -37
+
+KPX quoteright quoteright -37
+
+KPX r u -8
+KPX r quoteright 74
+KPX r q -18
+KPX r period -74
+KPX r o -18
+KPX r hyphen -18
+KPX r h -18
+KPX r g -18
+KPX r e -18
+KPX r d -18
+KPX r comma -74
+KPX r c -18
+
+KPX space Y -18
+KPX space A -37
+
+KPX v period -111
+KPX v comma -111
+
+KPX w period -92
+KPX w comma -92
+
+KPX y period -111
+KPX y comma -111
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 229 231 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 223 231 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 223 231 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 215 231 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 223 231 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 223 231 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 188 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 231 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 231 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 231 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 231 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 2 231 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 2 231 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 2 231 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 2 231 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 249 231 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 227 231 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 227 231 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 227 231 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 227 231 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 227 243 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 96 231 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 255 231 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 247 231 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 223 231 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 223 231 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 203 231 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 191 231 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 179 231 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 84 20 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 72 20 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 72 20 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 60 20 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 72 20 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 72 12 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 97 20 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 85 20 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 73 20 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 73 20 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -23 20 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -23 20 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -23 20 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -23 20 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 113 12 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 107 20 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 107 20 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 107 20 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 95 20 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 107 12 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 46 8 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 159 20 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 135 20 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 135 20 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 111 20 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 144 20 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 112 20 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 84 8 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplri8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplri8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..01bdcf0568e36ff987c3f3b4b40bf5a732a8559d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pplri8a.afm
@@ -0,0 +1,439 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Jul 2 22:37:33 1990
+Comment UniqueID 31796
+Comment VMusage 37415 48307
+FontName Palatino-Italic
+FullName Palatino Italic
+FamilyName Palatino
+Weight Medium
+ItalicAngle -10
+IsFixedPitch false
+FontBBox -170 -276 1010 918
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.005
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Palatino is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 692
+XHeight 482
+Ascender 733
+Descender -276
+StartCharMetrics 228
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 76 -8 292 733 ;
+C 34 ; WX 500 ; N quotedbl ; B 140 508 455 733 ;
+C 35 ; WX 500 ; N numbersign ; B 4 0 495 692 ;
+C 36 ; WX 500 ; N dollar ; B 15 -113 452 733 ;
+C 37 ; WX 889 ; N percent ; B 74 -7 809 710 ;
+C 38 ; WX 778 ; N ampersand ; B 47 -18 766 692 ;
+C 39 ; WX 278 ; N quoteright ; B 78 488 258 733 ;
+C 40 ; WX 333 ; N parenleft ; B 54 -106 331 733 ;
+C 41 ; WX 333 ; N parenright ; B 2 -106 279 733 ;
+C 42 ; WX 389 ; N asterisk ; B 76 368 400 706 ;
+C 43 ; WX 606 ; N plus ; B 51 0 555 504 ;
+C 44 ; WX 250 ; N comma ; B 8 -143 203 123 ;
+C 45 ; WX 333 ; N hyphen ; B 19 223 304 281 ;
+C 46 ; WX 250 ; N period ; B 53 -5 158 112 ;
+C 47 ; WX 296 ; N slash ; B -40 -119 392 733 ;
+C 48 ; WX 500 ; N zero ; B 36 -11 480 699 ;
+C 49 ; WX 500 ; N one ; B 54 -3 398 699 ;
+C 50 ; WX 500 ; N two ; B 12 -3 437 699 ;
+C 51 ; WX 500 ; N three ; B 22 -11 447 699 ;
+C 52 ; WX 500 ; N four ; B 15 -3 478 699 ;
+C 53 ; WX 500 ; N five ; B 14 -11 491 693 ;
+C 54 ; WX 500 ; N six ; B 49 -11 469 699 ;
+C 55 ; WX 500 ; N seven ; B 53 -3 502 692 ;
+C 56 ; WX 500 ; N eight ; B 36 -11 469 699 ;
+C 57 ; WX 500 ; N nine ; B 32 -11 468 699 ;
+C 58 ; WX 250 ; N colon ; B 44 -5 207 458 ;
+C 59 ; WX 250 ; N semicolon ; B -9 -146 219 456 ;
+C 60 ; WX 606 ; N less ; B 53 -6 554 516 ;
+C 61 ; WX 606 ; N equal ; B 51 126 555 378 ;
+C 62 ; WX 606 ; N greater ; B 53 -6 554 516 ;
+C 63 ; WX 500 ; N question ; B 114 -8 427 706 ;
+C 64 ; WX 747 ; N at ; B 27 -18 718 706 ;
+C 65 ; WX 722 ; N A ; B -19 -3 677 705 ;
+C 66 ; WX 611 ; N B ; B 26 -6 559 692 ;
+C 67 ; WX 667 ; N C ; B 45 -18 651 706 ;
+C 68 ; WX 778 ; N D ; B 28 -3 741 692 ;
+C 69 ; WX 611 ; N E ; B 30 -3 570 692 ;
+C 70 ; WX 556 ; N F ; B 0 -3 548 692 ;
+C 71 ; WX 722 ; N G ; B 50 -18 694 706 ;
+C 72 ; WX 778 ; N H ; B -3 -3 800 692 ;
+C 73 ; WX 333 ; N I ; B 7 -3 354 692 ;
+C 74 ; WX 333 ; N J ; B -35 -206 358 692 ;
+C 75 ; WX 667 ; N K ; B 13 -3 683 692 ;
+C 76 ; WX 556 ; N L ; B 16 -3 523 692 ;
+C 77 ; WX 944 ; N M ; B -19 -18 940 692 ;
+C 78 ; WX 778 ; N N ; B 2 -11 804 692 ;
+C 79 ; WX 778 ; N O ; B 53 -18 748 706 ;
+C 80 ; WX 611 ; N P ; B 9 -3 594 692 ;
+C 81 ; WX 778 ; N Q ; B 53 -201 748 706 ;
+C 82 ; WX 667 ; N R ; B 9 -3 639 692 ;
+C 83 ; WX 556 ; N S ; B 42 -18 506 706 ;
+C 84 ; WX 611 ; N T ; B 53 -3 635 692 ;
+C 85 ; WX 778 ; N U ; B 88 -18 798 692 ;
+C 86 ; WX 722 ; N V ; B 75 -8 754 692 ;
+C 87 ; WX 944 ; N W ; B 71 -8 980 700 ;
+C 88 ; WX 722 ; N X ; B 20 -3 734 692 ;
+C 89 ; WX 667 ; N Y ; B 52 -3 675 705 ;
+C 90 ; WX 667 ; N Z ; B 20 -3 637 692 ;
+C 91 ; WX 333 ; N bracketleft ; B 18 -100 326 733 ;
+C 92 ; WX 606 ; N backslash ; B 81 0 513 733 ;
+C 93 ; WX 333 ; N bracketright ; B 7 -100 315 733 ;
+C 94 ; WX 606 ; N asciicircum ; B 51 283 554 689 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 78 488 258 733 ;
+C 97 ; WX 444 ; N a ; B 4 -11 406 482 ;
+C 98 ; WX 463 ; N b ; B 37 -11 433 733 ;
+C 99 ; WX 407 ; N c ; B 25 -11 389 482 ;
+C 100 ; WX 500 ; N d ; B 17 -11 483 733 ;
+C 101 ; WX 389 ; N e ; B 15 -11 374 482 ;
+C 102 ; WX 278 ; N f ; B -162 -276 413 733 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B -37 -276 498 482 ;
+C 104 ; WX 500 ; N h ; B 10 -9 471 733 ;
+C 105 ; WX 278 ; N i ; B 34 -9 264 712 ;
+C 106 ; WX 278 ; N j ; B -70 -276 265 712 ;
+C 107 ; WX 444 ; N k ; B 8 -9 449 733 ;
+C 108 ; WX 278 ; N l ; B 36 -9 251 733 ;
+C 109 ; WX 778 ; N m ; B 24 -9 740 482 ;
+C 110 ; WX 556 ; N n ; B 24 -9 514 482 ;
+C 111 ; WX 444 ; N o ; B 17 -11 411 482 ;
+C 112 ; WX 500 ; N p ; B -7 -276 465 482 ;
+C 113 ; WX 463 ; N q ; B 24 -276 432 482 ;
+C 114 ; WX 389 ; N r ; B 26 -9 384 482 ;
+C 115 ; WX 389 ; N s ; B 9 -11 345 482 ;
+C 116 ; WX 333 ; N t ; B 41 -9 310 646 ;
+C 117 ; WX 556 ; N u ; B 32 -11 512 482 ;
+C 118 ; WX 500 ; N v ; B 21 -11 477 482 ;
+C 119 ; WX 722 ; N w ; B 21 -11 699 482 ;
+C 120 ; WX 500 ; N x ; B 9 -11 484 482 ;
+C 121 ; WX 500 ; N y ; B -8 -276 490 482 ;
+C 122 ; WX 444 ; N z ; B -1 -11 416 482 ;
+C 123 ; WX 333 ; N braceleft ; B 15 -100 319 733 ;
+C 124 ; WX 606 ; N bar ; B 275 0 331 733 ;
+C 125 ; WX 333 ; N braceright ; B 14 -100 318 733 ;
+C 126 ; WX 606 ; N asciitilde ; B 51 168 555 339 ;
+C 161 ; WX 333 ; N exclamdown ; B 15 -276 233 467 ;
+C 162 ; WX 500 ; N cent ; B 56 -96 418 551 ;
+C 163 ; WX 500 ; N sterling ; B 2 -18 479 708 ;
+C 164 ; WX 167 ; N fraction ; B -170 0 337 699 ;
+C 165 ; WX 500 ; N yen ; B 35 -3 512 699 ;
+C 166 ; WX 500 ; N florin ; B 5 -276 470 708 ;
+C 167 ; WX 500 ; N section ; B 14 -220 463 706 ;
+C 168 ; WX 500 ; N currency ; B 14 115 486 577 ;
+C 169 ; WX 333 ; N quotesingle ; B 140 508 288 733 ;
+C 170 ; WX 500 ; N quotedblleft ; B 98 488 475 733 ;
+C 171 ; WX 500 ; N guillemotleft ; B 57 70 437 440 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 57 70 270 440 ;
+C 173 ; WX 333 ; N guilsinglright ; B 63 70 276 440 ;
+C 174 ; WX 528 ; N fi ; B -162 -276 502 733 ;
+C 175 ; WX 545 ; N fl ; B -162 -276 520 733 ;
+C 177 ; WX 500 ; N endash ; B -10 228 510 278 ;
+C 178 ; WX 500 ; N dagger ; B 48 0 469 692 ;
+C 179 ; WX 500 ; N daggerdbl ; B 10 -162 494 692 ;
+C 180 ; WX 250 ; N periodcentered ; B 53 195 158 312 ;
+C 182 ; WX 500 ; N paragraph ; B 33 -224 611 692 ;
+C 183 ; WX 500 ; N bullet ; B 86 182 430 526 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 27 -122 211 120 ;
+C 185 ; WX 500 ; N quotedblbase ; B 43 -122 424 120 ;
+C 186 ; WX 500 ; N quotedblright ; B 98 488 475 733 ;
+C 187 ; WX 500 ; N guillemotright ; B 63 70 443 440 ;
+C 188 ; WX 1000 ; N ellipsis ; B 102 -5 873 112 ;
+C 189 ; WX 1000 ; N perthousand ; B 72 -6 929 717 ;
+C 191 ; WX 500 ; N questiondown ; B 57 -246 370 467 ;
+C 193 ; WX 333 ; N grave ; B 86 518 310 687 ;
+C 194 ; WX 333 ; N acute ; B 122 518 346 687 ;
+C 195 ; WX 333 ; N circumflex ; B 56 510 350 679 ;
+C 196 ; WX 333 ; N tilde ; B 63 535 390 638 ;
+C 197 ; WX 333 ; N macron ; B 74 538 386 589 ;
+C 198 ; WX 333 ; N breve ; B 92 518 393 677 ;
+C 199 ; WX 333 ; N dotaccent ; B 175 537 283 645 ;
+C 200 ; WX 333 ; N dieresis ; B 78 537 378 637 ;
+C 202 ; WX 333 ; N ring ; B 159 508 359 708 ;
+C 203 ; WX 333 ; N cedilla ; B -9 -216 202 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 46 518 385 730 ;
+C 206 ; WX 333 ; N ogonek ; B 38 -207 196 -18 ;
+C 207 ; WX 333 ; N caron ; B 104 510 409 679 ;
+C 208 ; WX 1000 ; N emdash ; B -10 228 1010 278 ;
+C 225 ; WX 941 ; N AE ; B -4 -3 902 692 ;
+C 227 ; WX 333 ; N ordfeminine ; B 60 404 321 699 ;
+C 232 ; WX 556 ; N Lslash ; B -16 -3 523 692 ;
+C 233 ; WX 778 ; N Oslash ; B 32 -39 762 721 ;
+C 234 ; WX 1028 ; N OE ; B 56 -18 989 706 ;
+C 235 ; WX 333 ; N ordmasculine ; B 66 404 322 699 ;
+C 241 ; WX 638 ; N ae ; B 1 -11 623 482 ;
+C 245 ; WX 278 ; N dotlessi ; B 34 -9 241 482 ;
+C 248 ; WX 278 ; N lslash ; B -10 -9 302 733 ;
+C 249 ; WX 444 ; N oslash ; B -18 -24 460 510 ;
+C 250 ; WX 669 ; N oe ; B 17 -11 654 482 ;
+C 251 ; WX 500 ; N germandbls ; B -160 -276 488 733 ;
+C -1 ; WX 667 ; N Zcaron ; B 20 -3 637 907 ;
+C -1 ; WX 407 ; N ccedilla ; B 25 -216 389 482 ;
+C -1 ; WX 500 ; N ydieresis ; B -8 -276 490 657 ;
+C -1 ; WX 444 ; N atilde ; B 4 -11 446 650 ;
+C -1 ; WX 278 ; N icircumflex ; B 29 -9 323 699 ;
+C -1 ; WX 300 ; N threesuperior ; B 28 273 304 699 ;
+C -1 ; WX 389 ; N ecircumflex ; B 15 -11 398 699 ;
+C -1 ; WX 500 ; N thorn ; B -39 -276 433 733 ;
+C -1 ; WX 389 ; N egrave ; B 15 -11 374 707 ;
+C -1 ; WX 300 ; N twosuperior ; B 13 278 290 699 ;
+C -1 ; WX 389 ; N eacute ; B 15 -11 394 707 ;
+C -1 ; WX 444 ; N otilde ; B 17 -11 446 650 ;
+C -1 ; WX 722 ; N Aacute ; B -19 -3 677 897 ;
+C -1 ; WX 444 ; N ocircumflex ; B 17 -11 411 699 ;
+C -1 ; WX 500 ; N yacute ; B -8 -276 490 707 ;
+C -1 ; WX 556 ; N udieresis ; B 32 -11 512 657 ;
+C -1 ; WX 750 ; N threequarters ; B 35 -2 715 699 ;
+C -1 ; WX 444 ; N acircumflex ; B 4 -11 406 699 ;
+C -1 ; WX 778 ; N Eth ; B 19 -3 741 692 ;
+C -1 ; WX 389 ; N edieresis ; B 15 -11 406 657 ;
+C -1 ; WX 556 ; N ugrave ; B 32 -11 512 707 ;
+C -1 ; WX 1000 ; N trademark ; B 52 285 951 689 ;
+C -1 ; WX 444 ; N ograve ; B 17 -11 411 707 ;
+C -1 ; WX 389 ; N scaron ; B 9 -11 419 687 ;
+C -1 ; WX 333 ; N Idieresis ; B 7 -3 418 847 ;
+C -1 ; WX 556 ; N uacute ; B 32 -11 512 707 ;
+C -1 ; WX 444 ; N agrave ; B 4 -11 406 707 ;
+C -1 ; WX 556 ; N ntilde ; B 24 -9 514 650 ;
+C -1 ; WX 444 ; N aring ; B 4 -11 406 728 ;
+C -1 ; WX 444 ; N zcaron ; B -1 -11 447 687 ;
+C -1 ; WX 333 ; N Icircumflex ; B 7 -3 390 889 ;
+C -1 ; WX 778 ; N Ntilde ; B 2 -11 804 866 ;
+C -1 ; WX 556 ; N ucircumflex ; B 32 -11 512 699 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 30 -3 570 889 ;
+C -1 ; WX 333 ; N Iacute ; B 7 -3 406 897 ;
+C -1 ; WX 667 ; N Ccedilla ; B 45 -216 651 706 ;
+C -1 ; WX 778 ; N Odieresis ; B 53 -18 748 847 ;
+C -1 ; WX 556 ; N Scaron ; B 42 -18 539 907 ;
+C -1 ; WX 611 ; N Edieresis ; B 30 -3 570 847 ;
+C -1 ; WX 333 ; N Igrave ; B 7 -3 354 897 ;
+C -1 ; WX 444 ; N adieresis ; B 4 -11 434 657 ;
+C -1 ; WX 778 ; N Ograve ; B 53 -18 748 897 ;
+C -1 ; WX 611 ; N Egrave ; B 30 -3 570 897 ;
+C -1 ; WX 667 ; N Ydieresis ; B 52 -3 675 847 ;
+C -1 ; WX 747 ; N registered ; B 11 -18 736 706 ;
+C -1 ; WX 778 ; N Otilde ; B 53 -18 748 866 ;
+C -1 ; WX 750 ; N onequarter ; B 31 -2 715 699 ;
+C -1 ; WX 778 ; N Ugrave ; B 88 -18 798 897 ;
+C -1 ; WX 778 ; N Ucircumflex ; B 88 -18 798 889 ;
+C -1 ; WX 611 ; N Thorn ; B 9 -3 570 692 ;
+C -1 ; WX 606 ; N divide ; B 51 0 555 504 ;
+C -1 ; WX 722 ; N Atilde ; B -19 -3 677 866 ;
+C -1 ; WX 778 ; N Uacute ; B 88 -18 798 897 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 53 -18 748 889 ;
+C -1 ; WX 606 ; N logicalnot ; B 51 118 555 378 ;
+C -1 ; WX 722 ; N Aring ; B -19 -3 677 918 ;
+C -1 ; WX 278 ; N idieresis ; B 34 -9 351 657 ;
+C -1 ; WX 278 ; N iacute ; B 34 -9 331 707 ;
+C -1 ; WX 444 ; N aacute ; B 4 -11 414 707 ;
+C -1 ; WX 606 ; N plusminus ; B 51 0 555 504 ;
+C -1 ; WX 606 ; N multiply ; B 83 36 523 474 ;
+C -1 ; WX 778 ; N Udieresis ; B 88 -18 798 847 ;
+C -1 ; WX 606 ; N minus ; B 51 224 555 280 ;
+C -1 ; WX 300 ; N onesuperior ; B 61 278 285 699 ;
+C -1 ; WX 611 ; N Eacute ; B 30 -3 570 897 ;
+C -1 ; WX 722 ; N Acircumflex ; B -19 -3 677 889 ;
+C -1 ; WX 747 ; N copyright ; B 11 -18 736 706 ;
+C -1 ; WX 722 ; N Agrave ; B -19 -3 677 897 ;
+C -1 ; WX 444 ; N odieresis ; B 17 -11 434 657 ;
+C -1 ; WX 444 ; N oacute ; B 17 -11 414 707 ;
+C -1 ; WX 400 ; N degree ; B 90 389 390 689 ;
+C -1 ; WX 278 ; N igrave ; B 34 -9 271 707 ;
+C -1 ; WX 556 ; N mu ; B 15 -226 512 482 ;
+C -1 ; WX 778 ; N Oacute ; B 53 -18 748 897 ;
+C -1 ; WX 444 ; N eth ; B 17 -11 478 733 ;
+C -1 ; WX 722 ; N Adieresis ; B -19 -3 677 847 ;
+C -1 ; WX 667 ; N Yacute ; B 52 -3 675 897 ;
+C -1 ; WX 606 ; N brokenbar ; B 275 0 331 733 ;
+C -1 ; WX 750 ; N onehalf ; B 31 -2 721 699 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 106
+
+KPX A y -55
+KPX A w -37
+KPX A v -37
+KPX A space -37
+KPX A quoteright -55
+KPX A Y -55
+KPX A W -55
+KPX A V -74
+KPX A T -55
+
+KPX F period -111
+KPX F comma -111
+KPX F A -111
+
+KPX L y -37
+KPX L space -18
+KPX L quoteright -37
+KPX L Y -74
+KPX L W -74
+KPX L V -74
+KPX L T -74
+
+KPX P period -129
+KPX P comma -129
+KPX P A -129
+
+KPX R y -37
+KPX R Y -55
+KPX R W -55
+KPX R V -74
+KPX R T -55
+
+KPX T y -92
+KPX T w -92
+KPX T u -111
+KPX T semicolon -74
+KPX T s -111
+KPX T r -111
+KPX T period -74
+KPX T o -111
+KPX T i -55
+KPX T hyphen -55
+KPX T e -111
+KPX T comma -74
+KPX T colon -74
+KPX T c -111
+KPX T a -111
+KPX T O -18
+KPX T A -92
+
+KPX V y -74
+KPX V u -74
+KPX V semicolon -37
+KPX V r -92
+KPX V period -129
+KPX V o -74
+KPX V i -74
+KPX V hyphen -55
+KPX V e -92
+KPX V comma -129
+KPX V colon -37
+KPX V a -74
+KPX V A -210
+
+KPX W y -20
+KPX W u -20
+KPX W semicolon -18
+KPX W r -20
+KPX W period -55
+KPX W o -20
+KPX W i -20
+KPX W hyphen -18
+KPX W e -20
+KPX W comma -55
+KPX W colon -18
+KPX W a -20
+KPX W A -92
+
+KPX Y v -74
+KPX Y u -92
+KPX Y semicolon -74
+KPX Y q -92
+KPX Y period -92
+KPX Y p -74
+KPX Y o -111
+KPX Y i -55
+KPX Y hyphen -74
+KPX Y e -111
+KPX Y comma -92
+KPX Y colon -74
+KPX Y a -92
+KPX Y A -92
+
+KPX f quoteright 55
+
+KPX one one -55
+
+KPX quoteleft quoteleft -74
+
+KPX quoteright t -37
+KPX quoteright space -55
+KPX quoteright s -55
+KPX quoteright quoteright -74
+
+KPX r quoteright 37
+KPX r q -18
+KPX r period -74
+KPX r o -18
+KPX r h -18
+KPX r g -18
+KPX r e -18
+KPX r comma -74
+KPX r c -18
+
+KPX v period -55
+KPX v comma -55
+
+KPX w period -55
+KPX w comma -55
+
+KPX y period -37
+KPX y comma -37
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 271 210 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 261 210 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 255 210 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 235 210 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 235 210 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 255 228 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 207 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 199 210 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 179 210 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 179 210 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 167 210 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 60 210 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 40 210 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 40 210 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 28 210 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 263 228 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 283 210 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 263 210 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 255 210 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 251 210 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 263 228 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 130 228 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 277 210 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 255 210 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 235 210 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 235 210 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 227 210 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 187 210 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 179 228 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 68 20 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 56 20 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 56 20 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 44 20 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 36 20 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 56 12 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 37 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 48 20 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 48 20 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 28 20 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 16 20 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -15 20 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 20 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 20 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -39 20 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 112 12 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 68 20 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 56 20 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 56 20 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 36 20 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 56 12 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 10 8 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 124 20 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 112 20 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 112 20 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 100 20 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 96 20 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 20 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 38 8 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/psyr.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/psyr.afm
new file mode 100644
index 0000000000000000000000000000000000000000..1cdbdae695f0a8f6b66226514b4ff039910ee69f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/psyr.afm
@@ -0,0 +1,209 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Wed Jan 17 21:48:26 1990
+Comment UniqueID 27004
+Comment VMusage 28489 37622
+FontName Symbol
+FullName Symbol
+FamilyName Symbol
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -180 -293 1090 1010
+UnderlinePosition -98
+UnderlineThickness 54
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All rights reserved.
+EncodingScheme FontSpecific
+StartCharMetrics 189
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 128 -17 240 672 ;
+C 34 ; WX 713 ; N universal ; B 31 0 681 705 ;
+C 35 ; WX 500 ; N numbersign ; B 20 -16 481 673 ;
+C 36 ; WX 549 ; N existential ; B 25 0 478 707 ;
+C 37 ; WX 833 ; N percent ; B 63 -36 771 655 ;
+C 38 ; WX 778 ; N ampersand ; B 41 -18 750 661 ;
+C 39 ; WX 439 ; N suchthat ; B 48 -17 414 500 ;
+C 40 ; WX 333 ; N parenleft ; B 53 -191 300 673 ;
+C 41 ; WX 333 ; N parenright ; B 30 -191 277 673 ;
+C 42 ; WX 500 ; N asteriskmath ; B 65 134 427 551 ;
+C 43 ; WX 549 ; N plus ; B 10 0 539 533 ;
+C 44 ; WX 250 ; N comma ; B 56 -152 194 104 ;
+C 45 ; WX 549 ; N minus ; B 11 233 535 288 ;
+C 46 ; WX 250 ; N period ; B 69 -17 181 95 ;
+C 47 ; WX 278 ; N slash ; B 0 -18 254 646 ;
+C 48 ; WX 500 ; N zero ; B 23 -17 471 685 ;
+C 49 ; WX 500 ; N one ; B 117 0 390 673 ;
+C 50 ; WX 500 ; N two ; B 25 0 475 686 ;
+C 51 ; WX 500 ; N three ; B 39 -17 435 685 ;
+C 52 ; WX 500 ; N four ; B 16 0 469 685 ;
+C 53 ; WX 500 ; N five ; B 29 -17 443 685 ;
+C 54 ; WX 500 ; N six ; B 36 -17 467 685 ;
+C 55 ; WX 500 ; N seven ; B 24 -16 448 673 ;
+C 56 ; WX 500 ; N eight ; B 54 -18 440 685 ;
+C 57 ; WX 500 ; N nine ; B 31 -18 460 685 ;
+C 58 ; WX 278 ; N colon ; B 81 -17 193 460 ;
+C 59 ; WX 278 ; N semicolon ; B 83 -152 221 460 ;
+C 60 ; WX 549 ; N less ; B 26 0 523 522 ;
+C 61 ; WX 549 ; N equal ; B 11 141 537 390 ;
+C 62 ; WX 549 ; N greater ; B 26 0 523 522 ;
+C 63 ; WX 444 ; N question ; B 70 -17 412 686 ;
+C 64 ; WX 549 ; N congruent ; B 11 0 537 475 ;
+C 65 ; WX 722 ; N Alpha ; B 4 0 684 673 ;
+C 66 ; WX 667 ; N Beta ; B 29 0 592 673 ;
+C 67 ; WX 722 ; N Chi ; B -9 0 704 673 ;
+C 68 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C 69 ; WX 611 ; N Epsilon ; B 32 0 617 673 ;
+C 70 ; WX 763 ; N Phi ; B 26 0 741 673 ;
+C 71 ; WX 603 ; N Gamma ; B 24 0 609 673 ;
+C 72 ; WX 722 ; N Eta ; B 39 0 729 673 ;
+C 73 ; WX 333 ; N Iota ; B 32 0 316 673 ;
+C 74 ; WX 631 ; N theta1 ; B 18 -18 623 689 ;
+C 75 ; WX 722 ; N Kappa ; B 35 0 722 673 ;
+C 76 ; WX 686 ; N Lambda ; B 6 0 680 688 ;
+C 77 ; WX 889 ; N Mu ; B 28 0 887 673 ;
+C 78 ; WX 722 ; N Nu ; B 29 -8 720 673 ;
+C 79 ; WX 722 ; N Omicron ; B 41 -17 715 685 ;
+C 80 ; WX 768 ; N Pi ; B 25 0 745 673 ;
+C 81 ; WX 741 ; N Theta ; B 41 -17 715 685 ;
+C 82 ; WX 556 ; N Rho ; B 28 0 563 673 ;
+C 83 ; WX 592 ; N Sigma ; B 5 0 589 673 ;
+C 84 ; WX 611 ; N Tau ; B 33 0 607 673 ;
+C 85 ; WX 690 ; N Upsilon ; B -8 0 694 673 ;
+C 86 ; WX 439 ; N sigma1 ; B 40 -233 436 500 ;
+C 87 ; WX 768 ; N Omega ; B 34 0 736 688 ;
+C 88 ; WX 645 ; N Xi ; B 40 0 599 673 ;
+C 89 ; WX 795 ; N Psi ; B 15 0 781 684 ;
+C 90 ; WX 611 ; N Zeta ; B 44 0 636 673 ;
+C 91 ; WX 333 ; N bracketleft ; B 86 -155 299 674 ;
+C 92 ; WX 863 ; N therefore ; B 163 0 701 478 ;
+C 93 ; WX 333 ; N bracketright ; B 33 -155 246 674 ;
+C 94 ; WX 658 ; N perpendicular ; B 15 0 652 674 ;
+C 95 ; WX 500 ; N underscore ; B -2 -252 502 -206 ;
+C 96 ; WX 500 ; N radicalex ; B 480 881 1090 917 ;
+C 97 ; WX 631 ; N alpha ; B 41 -18 622 500 ;
+C 98 ; WX 549 ; N beta ; B 61 -223 515 741 ;
+C 99 ; WX 549 ; N chi ; B 12 -231 522 499 ;
+C 100 ; WX 494 ; N delta ; B 40 -19 481 740 ;
+C 101 ; WX 439 ; N epsilon ; B 22 -19 427 502 ;
+C 102 ; WX 521 ; N phi ; B 27 -224 490 671 ;
+C 103 ; WX 411 ; N gamma ; B 5 -225 484 499 ;
+C 104 ; WX 603 ; N eta ; B 0 -202 527 514 ;
+C 105 ; WX 329 ; N iota ; B 0 -17 301 503 ;
+C 106 ; WX 603 ; N phi1 ; B 36 -224 587 499 ;
+C 107 ; WX 549 ; N kappa ; B 33 0 558 501 ;
+C 108 ; WX 549 ; N lambda ; B 24 -17 548 739 ;
+C 109 ; WX 576 ; N mu ; B 33 -223 567 500 ;
+C 110 ; WX 521 ; N nu ; B -9 -16 475 507 ;
+C 111 ; WX 549 ; N omicron ; B 35 -19 501 499 ;
+C 112 ; WX 549 ; N pi ; B 10 -19 530 487 ;
+C 113 ; WX 521 ; N theta ; B 43 -17 485 690 ;
+C 114 ; WX 549 ; N rho ; B 50 -230 490 499 ;
+C 115 ; WX 603 ; N sigma ; B 30 -21 588 500 ;
+C 116 ; WX 439 ; N tau ; B 10 -19 418 500 ;
+C 117 ; WX 576 ; N upsilon ; B 7 -18 535 507 ;
+C 118 ; WX 713 ; N omega1 ; B 12 -18 671 583 ;
+C 119 ; WX 686 ; N omega ; B 42 -17 684 500 ;
+C 120 ; WX 493 ; N xi ; B 27 -224 469 766 ;
+C 121 ; WX 686 ; N psi ; B 12 -228 701 500 ;
+C 122 ; WX 494 ; N zeta ; B 60 -225 467 756 ;
+C 123 ; WX 480 ; N braceleft ; B 58 -183 397 673 ;
+C 124 ; WX 200 ; N bar ; B 65 -177 135 673 ;
+C 125 ; WX 480 ; N braceright ; B 79 -183 418 673 ;
+C 126 ; WX 549 ; N similar ; B 17 203 529 307 ;
+C 161 ; WX 620 ; N Upsilon1 ; B -2 0 610 685 ;
+C 162 ; WX 247 ; N minute ; B 27 459 228 735 ;
+C 163 ; WX 549 ; N lessequal ; B 29 0 526 639 ;
+C 164 ; WX 167 ; N fraction ; B -180 -12 340 677 ;
+C 165 ; WX 713 ; N infinity ; B 26 124 688 404 ;
+C 166 ; WX 500 ; N florin ; B 2 -193 494 686 ;
+C 167 ; WX 753 ; N club ; B 86 -26 660 533 ;
+C 168 ; WX 753 ; N diamond ; B 142 -36 600 550 ;
+C 169 ; WX 753 ; N heart ; B 117 -33 631 532 ;
+C 170 ; WX 753 ; N spade ; B 113 -36 629 548 ;
+C 171 ; WX 1042 ; N arrowboth ; B 24 -15 1024 511 ;
+C 172 ; WX 987 ; N arrowleft ; B 32 -15 942 511 ;
+C 173 ; WX 603 ; N arrowup ; B 45 0 571 910 ;
+C 174 ; WX 987 ; N arrowright ; B 49 -15 959 511 ;
+C 175 ; WX 603 ; N arrowdown ; B 45 -22 571 888 ;
+C 176 ; WX 400 ; N degree ; B 50 385 350 685 ;
+C 177 ; WX 549 ; N plusminus ; B 10 0 539 645 ;
+C 178 ; WX 411 ; N second ; B 20 459 413 737 ;
+C 179 ; WX 549 ; N greaterequal ; B 29 0 526 639 ;
+C 180 ; WX 549 ; N multiply ; B 17 8 533 524 ;
+C 181 ; WX 713 ; N proportional ; B 27 123 639 404 ;
+C 182 ; WX 494 ; N partialdiff ; B 26 -20 462 746 ;
+C 183 ; WX 460 ; N bullet ; B 50 113 410 473 ;
+C 184 ; WX 549 ; N divide ; B 10 71 536 456 ;
+C 185 ; WX 549 ; N notequal ; B 15 -25 540 549 ;
+C 186 ; WX 549 ; N equivalence ; B 14 82 538 443 ;
+C 187 ; WX 549 ; N approxequal ; B 14 135 527 394 ;
+C 188 ; WX 1000 ; N ellipsis ; B 111 -17 889 95 ;
+C 189 ; WX 603 ; N arrowvertex ; B 280 -120 336 1010 ;
+C 190 ; WX 1000 ; N arrowhorizex ; B -60 220 1050 276 ;
+C 191 ; WX 658 ; N carriagereturn ; B 15 -16 602 629 ;
+C 192 ; WX 823 ; N aleph ; B 175 -18 661 658 ;
+C 193 ; WX 686 ; N Ifraktur ; B 10 -53 578 740 ;
+C 194 ; WX 795 ; N Rfraktur ; B 26 -15 759 734 ;
+C 195 ; WX 987 ; N weierstrass ; B 159 -211 870 573 ;
+C 196 ; WX 768 ; N circlemultiply ; B 43 -17 733 673 ;
+C 197 ; WX 768 ; N circleplus ; B 43 -15 733 675 ;
+C 198 ; WX 823 ; N emptyset ; B 39 -24 781 719 ;
+C 199 ; WX 768 ; N intersection ; B 40 0 732 509 ;
+C 200 ; WX 768 ; N union ; B 40 -17 732 492 ;
+C 201 ; WX 713 ; N propersuperset ; B 20 0 673 470 ;
+C 202 ; WX 713 ; N reflexsuperset ; B 20 -125 673 470 ;
+C 203 ; WX 713 ; N notsubset ; B 36 -70 690 540 ;
+C 204 ; WX 713 ; N propersubset ; B 37 0 690 470 ;
+C 205 ; WX 713 ; N reflexsubset ; B 37 -125 690 470 ;
+C 206 ; WX 713 ; N element ; B 45 0 505 468 ;
+C 207 ; WX 713 ; N notelement ; B 45 -58 505 555 ;
+C 208 ; WX 768 ; N angle ; B 26 0 738 673 ;
+C 209 ; WX 713 ; N gradient ; B 36 -19 681 718 ;
+C 210 ; WX 790 ; N registerserif ; B 50 -17 740 673 ;
+C 211 ; WX 790 ; N copyrightserif ; B 51 -15 741 675 ;
+C 212 ; WX 890 ; N trademarkserif ; B 18 293 855 673 ;
+C 213 ; WX 823 ; N product ; B 25 -101 803 751 ;
+C 214 ; WX 549 ; N radical ; B 10 -38 515 917 ;
+C 215 ; WX 250 ; N dotmath ; B 69 210 169 310 ;
+C 216 ; WX 713 ; N logicalnot ; B 15 0 680 288 ;
+C 217 ; WX 603 ; N logicaland ; B 23 0 583 454 ;
+C 218 ; WX 603 ; N logicalor ; B 30 0 578 477 ;
+C 219 ; WX 1042 ; N arrowdblboth ; B 27 -20 1023 510 ;
+C 220 ; WX 987 ; N arrowdblleft ; B 30 -15 939 513 ;
+C 221 ; WX 603 ; N arrowdblup ; B 39 2 567 911 ;
+C 222 ; WX 987 ; N arrowdblright ; B 45 -20 954 508 ;
+C 223 ; WX 603 ; N arrowdbldown ; B 44 -19 572 890 ;
+C 224 ; WX 494 ; N lozenge ; B 18 0 466 745 ;
+C 225 ; WX 329 ; N angleleft ; B 25 -198 306 746 ;
+C 226 ; WX 790 ; N registersans ; B 50 -20 740 670 ;
+C 227 ; WX 790 ; N copyrightsans ; B 49 -15 739 675 ;
+C 228 ; WX 786 ; N trademarksans ; B 5 293 725 673 ;
+C 229 ; WX 713 ; N summation ; B 14 -108 695 752 ;
+C 230 ; WX 384 ; N parenlefttp ; B 40 -293 436 926 ;
+C 231 ; WX 384 ; N parenleftex ; B 40 -85 92 925 ;
+C 232 ; WX 384 ; N parenleftbt ; B 40 -293 436 926 ;
+C 233 ; WX 384 ; N bracketlefttp ; B 0 -80 341 926 ;
+C 234 ; WX 384 ; N bracketleftex ; B 0 -79 55 925 ;
+C 235 ; WX 384 ; N bracketleftbt ; B 0 -80 340 926 ;
+C 236 ; WX 494 ; N bracelefttp ; B 201 -75 439 926 ;
+C 237 ; WX 494 ; N braceleftmid ; B 14 -85 255 935 ;
+C 238 ; WX 494 ; N braceleftbt ; B 201 -70 439 926 ;
+C 239 ; WX 494 ; N braceex ; B 201 -80 255 935 ;
+C 241 ; WX 329 ; N angleright ; B 21 -198 302 746 ;
+C 242 ; WX 274 ; N integral ; B 2 -107 291 916 ;
+C 243 ; WX 686 ; N integraltp ; B 332 -83 715 921 ;
+C 244 ; WX 686 ; N integralex ; B 332 -88 415 975 ;
+C 245 ; WX 686 ; N integralbt ; B 39 -81 415 921 ;
+C 246 ; WX 384 ; N parenrighttp ; B 54 -293 450 926 ;
+C 247 ; WX 384 ; N parenrightex ; B 398 -85 450 925 ;
+C 248 ; WX 384 ; N parenrightbt ; B 54 -293 450 926 ;
+C 249 ; WX 384 ; N bracketrighttp ; B 22 -80 360 926 ;
+C 250 ; WX 384 ; N bracketrightex ; B 305 -79 360 925 ;
+C 251 ; WX 384 ; N bracketrightbt ; B 20 -80 360 926 ;
+C 252 ; WX 494 ; N bracerighttp ; B 17 -75 255 926 ;
+C 253 ; WX 494 ; N bracerightmid ; B 201 -85 442 935 ;
+C 254 ; WX 494 ; N bracerightbt ; B 17 -70 255 926 ;
+C -1 ; WX 790 ; N apple ; B 56 -3 733 808 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmb8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmb8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..55207f94d1e10c1aa6925cd1a59517b908d5c486
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmb8a.afm
@@ -0,0 +1,648 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue Mar 20 12:17:14 1990
+Comment UniqueID 28417
+Comment VMusage 30458 37350
+FontName Times-Bold
+FullName Times Bold
+FamilyName Times
+Weight Bold
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -168 -218 1000 935
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 676
+XHeight 461
+Ascender 676
+Descender -205
+StartCharMetrics 228
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 81 -13 251 691 ;
+C 34 ; WX 555 ; N quotedbl ; B 83 404 472 691 ;
+C 35 ; WX 500 ; N numbersign ; B 4 0 496 700 ;
+C 36 ; WX 500 ; N dollar ; B 29 -99 472 750 ;
+C 37 ; WX 1000 ; N percent ; B 124 -14 877 692 ;
+C 38 ; WX 833 ; N ampersand ; B 62 -16 787 691 ;
+C 39 ; WX 333 ; N quoteright ; B 79 356 263 691 ;
+C 40 ; WX 333 ; N parenleft ; B 46 -168 306 694 ;
+C 41 ; WX 333 ; N parenright ; B 27 -168 287 694 ;
+C 42 ; WX 500 ; N asterisk ; B 56 255 447 691 ;
+C 43 ; WX 570 ; N plus ; B 33 0 537 506 ;
+C 44 ; WX 250 ; N comma ; B 39 -180 223 155 ;
+C 45 ; WX 333 ; N hyphen ; B 44 171 287 287 ;
+C 46 ; WX 250 ; N period ; B 41 -13 210 156 ;
+C 47 ; WX 278 ; N slash ; B -24 -19 302 691 ;
+C 48 ; WX 500 ; N zero ; B 24 -13 476 688 ;
+C 49 ; WX 500 ; N one ; B 65 0 442 688 ;
+C 50 ; WX 500 ; N two ; B 17 0 478 688 ;
+C 51 ; WX 500 ; N three ; B 16 -14 468 688 ;
+C 52 ; WX 500 ; N four ; B 19 0 475 688 ;
+C 53 ; WX 500 ; N five ; B 22 -8 470 676 ;
+C 54 ; WX 500 ; N six ; B 28 -13 475 688 ;
+C 55 ; WX 500 ; N seven ; B 17 0 477 676 ;
+C 56 ; WX 500 ; N eight ; B 28 -13 472 688 ;
+C 57 ; WX 500 ; N nine ; B 26 -13 473 688 ;
+C 58 ; WX 333 ; N colon ; B 82 -13 251 472 ;
+C 59 ; WX 333 ; N semicolon ; B 82 -180 266 472 ;
+C 60 ; WX 570 ; N less ; B 31 -8 539 514 ;
+C 61 ; WX 570 ; N equal ; B 33 107 537 399 ;
+C 62 ; WX 570 ; N greater ; B 31 -8 539 514 ;
+C 63 ; WX 500 ; N question ; B 57 -13 445 689 ;
+C 64 ; WX 930 ; N at ; B 108 -19 822 691 ;
+C 65 ; WX 722 ; N A ; B 9 0 689 690 ;
+C 66 ; WX 667 ; N B ; B 16 0 619 676 ;
+C 67 ; WX 722 ; N C ; B 49 -19 687 691 ;
+C 68 ; WX 722 ; N D ; B 14 0 690 676 ;
+C 69 ; WX 667 ; N E ; B 16 0 641 676 ;
+C 70 ; WX 611 ; N F ; B 16 0 583 676 ;
+C 71 ; WX 778 ; N G ; B 37 -19 755 691 ;
+C 72 ; WX 778 ; N H ; B 21 0 759 676 ;
+C 73 ; WX 389 ; N I ; B 20 0 370 676 ;
+C 74 ; WX 500 ; N J ; B 3 -96 479 676 ;
+C 75 ; WX 778 ; N K ; B 30 0 769 676 ;
+C 76 ; WX 667 ; N L ; B 19 0 638 676 ;
+C 77 ; WX 944 ; N M ; B 14 0 921 676 ;
+C 78 ; WX 722 ; N N ; B 16 -18 701 676 ;
+C 79 ; WX 778 ; N O ; B 35 -19 743 691 ;
+C 80 ; WX 611 ; N P ; B 16 0 600 676 ;
+C 81 ; WX 778 ; N Q ; B 35 -176 743 691 ;
+C 82 ; WX 722 ; N R ; B 26 0 715 676 ;
+C 83 ; WX 556 ; N S ; B 35 -19 513 692 ;
+C 84 ; WX 667 ; N T ; B 31 0 636 676 ;
+C 85 ; WX 722 ; N U ; B 16 -19 701 676 ;
+C 86 ; WX 722 ; N V ; B 16 -18 701 676 ;
+C 87 ; WX 1000 ; N W ; B 19 -15 981 676 ;
+C 88 ; WX 722 ; N X ; B 16 0 699 676 ;
+C 89 ; WX 722 ; N Y ; B 15 0 699 676 ;
+C 90 ; WX 667 ; N Z ; B 28 0 634 676 ;
+C 91 ; WX 333 ; N bracketleft ; B 67 -149 301 678 ;
+C 92 ; WX 278 ; N backslash ; B -25 -19 303 691 ;
+C 93 ; WX 333 ; N bracketright ; B 32 -149 266 678 ;
+C 94 ; WX 581 ; N asciicircum ; B 73 311 509 676 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 70 356 254 691 ;
+C 97 ; WX 500 ; N a ; B 25 -14 488 473 ;
+C 98 ; WX 556 ; N b ; B 17 -14 521 676 ;
+C 99 ; WX 444 ; N c ; B 25 -14 430 473 ;
+C 100 ; WX 556 ; N d ; B 25 -14 534 676 ;
+C 101 ; WX 444 ; N e ; B 25 -14 426 473 ;
+C 102 ; WX 333 ; N f ; B 14 0 389 691 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B 28 -206 483 473 ;
+C 104 ; WX 556 ; N h ; B 16 0 534 676 ;
+C 105 ; WX 278 ; N i ; B 16 0 255 691 ;
+C 106 ; WX 333 ; N j ; B -57 -203 263 691 ;
+C 107 ; WX 556 ; N k ; B 22 0 543 676 ;
+C 108 ; WX 278 ; N l ; B 16 0 255 676 ;
+C 109 ; WX 833 ; N m ; B 16 0 814 473 ;
+C 110 ; WX 556 ; N n ; B 21 0 539 473 ;
+C 111 ; WX 500 ; N o ; B 25 -14 476 473 ;
+C 112 ; WX 556 ; N p ; B 19 -205 524 473 ;
+C 113 ; WX 556 ; N q ; B 34 -205 536 473 ;
+C 114 ; WX 444 ; N r ; B 29 0 434 473 ;
+C 115 ; WX 389 ; N s ; B 25 -14 361 473 ;
+C 116 ; WX 333 ; N t ; B 20 -12 332 630 ;
+C 117 ; WX 556 ; N u ; B 16 -14 537 461 ;
+C 118 ; WX 500 ; N v ; B 21 -14 485 461 ;
+C 119 ; WX 722 ; N w ; B 23 -14 707 461 ;
+C 120 ; WX 500 ; N x ; B 12 0 484 461 ;
+C 121 ; WX 500 ; N y ; B 16 -205 480 461 ;
+C 122 ; WX 444 ; N z ; B 21 0 420 461 ;
+C 123 ; WX 394 ; N braceleft ; B 22 -175 340 698 ;
+C 124 ; WX 220 ; N bar ; B 66 -19 154 691 ;
+C 125 ; WX 394 ; N braceright ; B 54 -175 372 698 ;
+C 126 ; WX 520 ; N asciitilde ; B 29 173 491 333 ;
+C 161 ; WX 333 ; N exclamdown ; B 82 -203 252 501 ;
+C 162 ; WX 500 ; N cent ; B 53 -140 458 588 ;
+C 163 ; WX 500 ; N sterling ; B 21 -14 477 684 ;
+C 164 ; WX 167 ; N fraction ; B -168 -12 329 688 ;
+C 165 ; WX 500 ; N yen ; B -64 0 547 676 ;
+C 166 ; WX 500 ; N florin ; B 0 -155 498 706 ;
+C 167 ; WX 500 ; N section ; B 57 -132 443 691 ;
+C 168 ; WX 500 ; N currency ; B -26 61 526 613 ;
+C 169 ; WX 278 ; N quotesingle ; B 75 404 204 691 ;
+C 170 ; WX 500 ; N quotedblleft ; B 32 356 486 691 ;
+C 171 ; WX 500 ; N guillemotleft ; B 23 36 473 415 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 51 36 305 415 ;
+C 173 ; WX 333 ; N guilsinglright ; B 28 36 282 415 ;
+C 174 ; WX 556 ; N fi ; B 14 0 536 691 ;
+C 175 ; WX 556 ; N fl ; B 14 0 536 691 ;
+C 177 ; WX 500 ; N endash ; B 0 181 500 271 ;
+C 178 ; WX 500 ; N dagger ; B 47 -134 453 691 ;
+C 179 ; WX 500 ; N daggerdbl ; B 45 -132 456 691 ;
+C 180 ; WX 250 ; N periodcentered ; B 41 248 210 417 ;
+C 182 ; WX 540 ; N paragraph ; B 0 -186 519 676 ;
+C 183 ; WX 350 ; N bullet ; B 35 198 315 478 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 79 -180 263 155 ;
+C 185 ; WX 500 ; N quotedblbase ; B 14 -180 468 155 ;
+C 186 ; WX 500 ; N quotedblright ; B 14 356 468 691 ;
+C 187 ; WX 500 ; N guillemotright ; B 27 36 477 415 ;
+C 188 ; WX 1000 ; N ellipsis ; B 82 -13 917 156 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -29 995 706 ;
+C 191 ; WX 500 ; N questiondown ; B 55 -201 443 501 ;
+C 193 ; WX 333 ; N grave ; B 8 528 246 713 ;
+C 194 ; WX 333 ; N acute ; B 86 528 324 713 ;
+C 195 ; WX 333 ; N circumflex ; B -2 528 335 704 ;
+C 196 ; WX 333 ; N tilde ; B -16 547 349 674 ;
+C 197 ; WX 333 ; N macron ; B 1 565 331 637 ;
+C 198 ; WX 333 ; N breve ; B 15 528 318 691 ;
+C 199 ; WX 333 ; N dotaccent ; B 103 537 230 667 ;
+C 200 ; WX 333 ; N dieresis ; B -2 537 335 667 ;
+C 202 ; WX 333 ; N ring ; B 60 527 273 740 ;
+C 203 ; WX 333 ; N cedilla ; B 68 -218 294 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -13 528 425 713 ;
+C 206 ; WX 333 ; N ogonek ; B 90 -173 319 44 ;
+C 207 ; WX 333 ; N caron ; B -2 528 335 704 ;
+C 208 ; WX 1000 ; N emdash ; B 0 181 1000 271 ;
+C 225 ; WX 1000 ; N AE ; B 4 0 951 676 ;
+C 227 ; WX 300 ; N ordfeminine ; B -1 397 301 688 ;
+C 232 ; WX 667 ; N Lslash ; B 19 0 638 676 ;
+C 233 ; WX 778 ; N Oslash ; B 35 -74 743 737 ;
+C 234 ; WX 1000 ; N OE ; B 22 -5 981 684 ;
+C 235 ; WX 330 ; N ordmasculine ; B 18 397 312 688 ;
+C 241 ; WX 722 ; N ae ; B 33 -14 693 473 ;
+C 245 ; WX 278 ; N dotlessi ; B 16 0 255 461 ;
+C 248 ; WX 278 ; N lslash ; B -22 0 303 676 ;
+C 249 ; WX 500 ; N oslash ; B 25 -92 476 549 ;
+C 250 ; WX 722 ; N oe ; B 22 -14 696 473 ;
+C 251 ; WX 556 ; N germandbls ; B 19 -12 517 691 ;
+C -1 ; WX 667 ; N Zcaron ; B 28 0 634 914 ;
+C -1 ; WX 444 ; N ccedilla ; B 25 -218 430 473 ;
+C -1 ; WX 500 ; N ydieresis ; B 16 -205 480 667 ;
+C -1 ; WX 500 ; N atilde ; B 25 -14 488 674 ;
+C -1 ; WX 278 ; N icircumflex ; B -36 0 301 704 ;
+C -1 ; WX 300 ; N threesuperior ; B 3 268 297 688 ;
+C -1 ; WX 444 ; N ecircumflex ; B 25 -14 426 704 ;
+C -1 ; WX 556 ; N thorn ; B 19 -205 524 676 ;
+C -1 ; WX 444 ; N egrave ; B 25 -14 426 713 ;
+C -1 ; WX 300 ; N twosuperior ; B 0 275 300 688 ;
+C -1 ; WX 444 ; N eacute ; B 25 -14 426 713 ;
+C -1 ; WX 500 ; N otilde ; B 25 -14 476 674 ;
+C -1 ; WX 722 ; N Aacute ; B 9 0 689 923 ;
+C -1 ; WX 500 ; N ocircumflex ; B 25 -14 476 704 ;
+C -1 ; WX 500 ; N yacute ; B 16 -205 480 713 ;
+C -1 ; WX 556 ; N udieresis ; B 16 -14 537 667 ;
+C -1 ; WX 750 ; N threequarters ; B 23 -12 733 688 ;
+C -1 ; WX 500 ; N acircumflex ; B 25 -14 488 704 ;
+C -1 ; WX 722 ; N Eth ; B 6 0 690 676 ;
+C -1 ; WX 444 ; N edieresis ; B 25 -14 426 667 ;
+C -1 ; WX 556 ; N ugrave ; B 16 -14 537 713 ;
+C -1 ; WX 1000 ; N trademark ; B 24 271 977 676 ;
+C -1 ; WX 500 ; N ograve ; B 25 -14 476 713 ;
+C -1 ; WX 389 ; N scaron ; B 25 -14 363 704 ;
+C -1 ; WX 389 ; N Idieresis ; B 20 0 370 877 ;
+C -1 ; WX 556 ; N uacute ; B 16 -14 537 713 ;
+C -1 ; WX 500 ; N agrave ; B 25 -14 488 713 ;
+C -1 ; WX 556 ; N ntilde ; B 21 0 539 674 ;
+C -1 ; WX 500 ; N aring ; B 25 -14 488 740 ;
+C -1 ; WX 444 ; N zcaron ; B 21 0 420 704 ;
+C -1 ; WX 389 ; N Icircumflex ; B 20 0 370 914 ;
+C -1 ; WX 722 ; N Ntilde ; B 16 -18 701 884 ;
+C -1 ; WX 556 ; N ucircumflex ; B 16 -14 537 704 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 16 0 641 914 ;
+C -1 ; WX 389 ; N Iacute ; B 20 0 370 923 ;
+C -1 ; WX 722 ; N Ccedilla ; B 49 -218 687 691 ;
+C -1 ; WX 778 ; N Odieresis ; B 35 -19 743 877 ;
+C -1 ; WX 556 ; N Scaron ; B 35 -19 513 914 ;
+C -1 ; WX 667 ; N Edieresis ; B 16 0 641 877 ;
+C -1 ; WX 389 ; N Igrave ; B 20 0 370 923 ;
+C -1 ; WX 500 ; N adieresis ; B 25 -14 488 667 ;
+C -1 ; WX 778 ; N Ograve ; B 35 -19 743 923 ;
+C -1 ; WX 667 ; N Egrave ; B 16 0 641 923 ;
+C -1 ; WX 722 ; N Ydieresis ; B 15 0 699 877 ;
+C -1 ; WX 747 ; N registered ; B 26 -19 721 691 ;
+C -1 ; WX 778 ; N Otilde ; B 35 -19 743 884 ;
+C -1 ; WX 750 ; N onequarter ; B 28 -12 743 688 ;
+C -1 ; WX 722 ; N Ugrave ; B 16 -19 701 923 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 16 -19 701 914 ;
+C -1 ; WX 611 ; N Thorn ; B 16 0 600 676 ;
+C -1 ; WX 570 ; N divide ; B 33 -31 537 537 ;
+C -1 ; WX 722 ; N Atilde ; B 9 0 689 884 ;
+C -1 ; WX 722 ; N Uacute ; B 16 -19 701 923 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 35 -19 743 914 ;
+C -1 ; WX 570 ; N logicalnot ; B 33 108 537 399 ;
+C -1 ; WX 722 ; N Aring ; B 9 0 689 935 ;
+C -1 ; WX 278 ; N idieresis ; B -36 0 301 667 ;
+C -1 ; WX 278 ; N iacute ; B 16 0 290 713 ;
+C -1 ; WX 500 ; N aacute ; B 25 -14 488 713 ;
+C -1 ; WX 570 ; N plusminus ; B 33 0 537 506 ;
+C -1 ; WX 570 ; N multiply ; B 48 16 522 490 ;
+C -1 ; WX 722 ; N Udieresis ; B 16 -19 701 877 ;
+C -1 ; WX 570 ; N minus ; B 33 209 537 297 ;
+C -1 ; WX 300 ; N onesuperior ; B 28 275 273 688 ;
+C -1 ; WX 667 ; N Eacute ; B 16 0 641 923 ;
+C -1 ; WX 722 ; N Acircumflex ; B 9 0 689 914 ;
+C -1 ; WX 747 ; N copyright ; B 26 -19 721 691 ;
+C -1 ; WX 722 ; N Agrave ; B 9 0 689 923 ;
+C -1 ; WX 500 ; N odieresis ; B 25 -14 476 667 ;
+C -1 ; WX 500 ; N oacute ; B 25 -14 476 713 ;
+C -1 ; WX 400 ; N degree ; B 57 402 343 688 ;
+C -1 ; WX 278 ; N igrave ; B -26 0 255 713 ;
+C -1 ; WX 556 ; N mu ; B 33 -206 536 461 ;
+C -1 ; WX 778 ; N Oacute ; B 35 -19 743 923 ;
+C -1 ; WX 500 ; N eth ; B 25 -14 476 691 ;
+C -1 ; WX 722 ; N Adieresis ; B 9 0 689 877 ;
+C -1 ; WX 722 ; N Yacute ; B 15 0 699 928 ;
+C -1 ; WX 220 ; N brokenbar ; B 66 -19 154 691 ;
+C -1 ; WX 750 ; N onehalf ; B -7 -12 775 688 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 283
+
+KPX A y -74
+KPX A w -90
+KPX A v -100
+KPX A u -50
+KPX A quoteright -74
+KPX A quotedblright 0
+KPX A p -25
+KPX A Y -100
+KPX A W -130
+KPX A V -145
+KPX A U -50
+KPX A T -95
+KPX A Q -45
+KPX A O -45
+KPX A G -55
+KPX A C -55
+
+KPX B period 0
+KPX B comma 0
+KPX B U -10
+KPX B A -30
+
+KPX D period -20
+KPX D comma 0
+KPX D Y -40
+KPX D W -40
+KPX D V -40
+KPX D A -35
+
+KPX F r 0
+KPX F period -110
+KPX F o -25
+KPX F i 0
+KPX F e -25
+KPX F comma -92
+KPX F a -25
+KPX F A -90
+
+KPX G period 0
+KPX G comma 0
+
+KPX J u -15
+KPX J period -20
+KPX J o -15
+KPX J e -15
+KPX J comma 0
+KPX J a -15
+KPX J A -30
+
+KPX K y -45
+KPX K u -15
+KPX K o -25
+KPX K e -25
+KPX K O -30
+
+KPX L y -55
+KPX L quoteright -110
+KPX L quotedblright -20
+KPX L Y -92
+KPX L W -92
+KPX L V -92
+KPX L T -92
+
+KPX N period 0
+KPX N comma 0
+KPX N A -20
+
+KPX O period 0
+KPX O comma 0
+KPX O Y -50
+KPX O X -40
+KPX O W -50
+KPX O V -50
+KPX O T -40
+KPX O A -40
+
+KPX P period -110
+KPX P o -20
+KPX P e -20
+KPX P comma -92
+KPX P a -10
+KPX P A -74
+
+KPX Q period -20
+KPX Q comma 0
+KPX Q U -10
+
+KPX R Y -35
+KPX R W -35
+KPX R V -55
+KPX R U -30
+KPX R T -40
+KPX R O -30
+
+KPX S period 0
+KPX S comma 0
+
+KPX T y -74
+KPX T w -74
+KPX T u -92
+KPX T semicolon -74
+KPX T r -74
+KPX T period -90
+KPX T o -92
+KPX T i -18
+KPX T hyphen -92
+KPX T h 0
+KPX T e -92
+KPX T comma -74
+KPX T colon -74
+KPX T a -92
+KPX T O -18
+KPX T A -90
+
+KPX U period -50
+KPX U comma -50
+KPX U A -60
+
+KPX V u -92
+KPX V semicolon -92
+KPX V period -145
+KPX V o -100
+KPX V i -37
+KPX V hyphen -74
+KPX V e -100
+KPX V comma -129
+KPX V colon -92
+KPX V a -92
+KPX V O -45
+KPX V G -30
+KPX V A -135
+
+KPX W y -60
+KPX W u -50
+KPX W semicolon -55
+KPX W period -92
+KPX W o -75
+KPX W i -18
+KPX W hyphen -37
+KPX W h 0
+KPX W e -65
+KPX W comma -92
+KPX W colon -55
+KPX W a -65
+KPX W O -10
+KPX W A -120
+
+KPX Y u -92
+KPX Y semicolon -92
+KPX Y period -92
+KPX Y o -111
+KPX Y i -37
+KPX Y hyphen -92
+KPX Y e -111
+KPX Y comma -92
+KPX Y colon -92
+KPX Y a -85
+KPX Y O -35
+KPX Y A -110
+
+KPX a y 0
+KPX a w 0
+KPX a v -25
+KPX a t 0
+KPX a p 0
+KPX a g 0
+KPX a b 0
+
+KPX b y 0
+KPX b v -15
+KPX b u -20
+KPX b period -40
+KPX b l 0
+KPX b comma 0
+KPX b b -10
+
+KPX c y 0
+KPX c period 0
+KPX c l 0
+KPX c k 0
+KPX c h 0
+KPX c comma 0
+
+KPX colon space 0
+
+KPX comma space 0
+KPX comma quoteright -55
+KPX comma quotedblright -45
+
+KPX d y 0
+KPX d w -15
+KPX d v 0
+KPX d period 0
+KPX d d 0
+KPX d comma 0
+
+KPX e y 0
+KPX e x 0
+KPX e w 0
+KPX e v -15
+KPX e period 0
+KPX e p 0
+KPX e g 0
+KPX e comma 0
+KPX e b 0
+
+KPX f quoteright 55
+KPX f quotedblright 50
+KPX f period -15
+KPX f o -25
+KPX f l 0
+KPX f i -25
+KPX f f 0
+KPX f e 0
+KPX f dotlessi -35
+KPX f comma -15
+KPX f a 0
+
+KPX g y 0
+KPX g r 0
+KPX g period -15
+KPX g o 0
+KPX g i 0
+KPX g g 0
+KPX g e 0
+KPX g comma 0
+KPX g a 0
+
+KPX h y -15
+
+KPX i v -10
+
+KPX k y -15
+KPX k o -15
+KPX k e -10
+
+KPX l y 0
+KPX l w 0
+
+KPX m y 0
+KPX m u 0
+
+KPX n y 0
+KPX n v -40
+KPX n u 0
+
+KPX o y 0
+KPX o x 0
+KPX o w -10
+KPX o v -10
+KPX o g 0
+
+KPX p y 0
+
+KPX period quoteright -55
+KPX period quotedblright -55
+
+KPX quotedblleft quoteleft 0
+KPX quotedblleft A -10
+
+KPX quotedblright space 0
+
+KPX quoteleft quoteleft -63
+KPX quoteleft A -10
+
+KPX quoteright v -20
+KPX quoteright t 0
+KPX quoteright space -74
+KPX quoteright s -37
+KPX quoteright r -20
+KPX quoteright quoteright -63
+KPX quoteright quotedblright 0
+KPX quoteright l 0
+KPX quoteright d -20
+
+KPX r y 0
+KPX r v -10
+KPX r u 0
+KPX r t 0
+KPX r s 0
+KPX r r 0
+KPX r q -18
+KPX r period -100
+KPX r p -10
+KPX r o -18
+KPX r n -15
+KPX r m 0
+KPX r l 0
+KPX r k 0
+KPX r i 0
+KPX r hyphen -37
+KPX r g -10
+KPX r e -18
+KPX r d 0
+KPX r comma -92
+KPX r c -18
+KPX r a 0
+
+KPX s w 0
+
+KPX space quoteleft 0
+KPX space quotedblleft 0
+KPX space Y -55
+KPX space W -30
+KPX space V -45
+KPX space T -30
+KPX space A -55
+
+KPX v period -70
+KPX v o -10
+KPX v e -10
+KPX v comma -55
+KPX v a -10
+
+KPX w period -70
+KPX w o -10
+KPX w h 0
+KPX w e 0
+KPX w comma -55
+KPX w a 0
+
+KPX x e 0
+
+KPX y period -70
+KPX y o -25
+KPX y e -10
+KPX y comma -55
+KPX y a 0
+
+KPX z o 0
+KPX z e 0
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 188 210 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 188 210 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 188 210 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 188 210 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 180 195 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 188 210 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 208 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 174 210 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 174 210 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 174 210 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 174 210 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 28 210 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 28 210 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 28 210 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 28 210 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 195 210 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 223 210 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 223 210 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 223 210 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 223 210 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 223 210 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 210 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 222 210 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 222 210 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 222 210 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 222 210 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 210 215 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 215 210 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 167 210 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 77 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 77 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 77 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 77 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 77 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 77 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 69 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 62 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 62 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 62 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 62 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -34 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -34 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -34 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -34 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 112 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 105 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 105 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 105 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 105 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 56 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmbi8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmbi8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..25ab54ea816bbcd481ebb7c085cb8aceb0ed71f2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmbi8a.afm
@@ -0,0 +1,648 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue Mar 20 13:14:55 1990
+Comment UniqueID 28425
+Comment VMusage 32721 39613
+FontName Times-BoldItalic
+FullName Times Bold Italic
+FamilyName Times
+Weight Bold
+ItalicAngle -15
+IsFixedPitch false
+FontBBox -200 -218 996 921
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.009
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 669
+XHeight 462
+Ascender 699
+Descender -205
+StartCharMetrics 228
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 389 ; N exclam ; B 67 -13 370 684 ;
+C 34 ; WX 555 ; N quotedbl ; B 136 398 536 685 ;
+C 35 ; WX 500 ; N numbersign ; B -33 0 533 700 ;
+C 36 ; WX 500 ; N dollar ; B -20 -100 497 733 ;
+C 37 ; WX 833 ; N percent ; B 39 -10 793 692 ;
+C 38 ; WX 778 ; N ampersand ; B 5 -19 699 682 ;
+C 39 ; WX 333 ; N quoteright ; B 98 369 302 685 ;
+C 40 ; WX 333 ; N parenleft ; B 28 -179 344 685 ;
+C 41 ; WX 333 ; N parenright ; B -44 -179 271 685 ;
+C 42 ; WX 500 ; N asterisk ; B 65 249 456 685 ;
+C 43 ; WX 570 ; N plus ; B 33 0 537 506 ;
+C 44 ; WX 250 ; N comma ; B -60 -182 144 134 ;
+C 45 ; WX 333 ; N hyphen ; B 2 166 271 282 ;
+C 46 ; WX 250 ; N period ; B -9 -13 139 135 ;
+C 47 ; WX 278 ; N slash ; B -64 -18 342 685 ;
+C 48 ; WX 500 ; N zero ; B 17 -14 477 683 ;
+C 49 ; WX 500 ; N one ; B 5 0 419 683 ;
+C 50 ; WX 500 ; N two ; B -27 0 446 683 ;
+C 51 ; WX 500 ; N three ; B -15 -13 450 683 ;
+C 52 ; WX 500 ; N four ; B -15 0 503 683 ;
+C 53 ; WX 500 ; N five ; B -11 -13 487 669 ;
+C 54 ; WX 500 ; N six ; B 23 -15 509 679 ;
+C 55 ; WX 500 ; N seven ; B 52 0 525 669 ;
+C 56 ; WX 500 ; N eight ; B 3 -13 476 683 ;
+C 57 ; WX 500 ; N nine ; B -12 -10 475 683 ;
+C 58 ; WX 333 ; N colon ; B 23 -13 264 459 ;
+C 59 ; WX 333 ; N semicolon ; B -25 -183 264 459 ;
+C 60 ; WX 570 ; N less ; B 31 -8 539 514 ;
+C 61 ; WX 570 ; N equal ; B 33 107 537 399 ;
+C 62 ; WX 570 ; N greater ; B 31 -8 539 514 ;
+C 63 ; WX 500 ; N question ; B 79 -13 470 684 ;
+C 64 ; WX 832 ; N at ; B 63 -18 770 685 ;
+C 65 ; WX 667 ; N A ; B -67 0 593 683 ;
+C 66 ; WX 667 ; N B ; B -24 0 624 669 ;
+C 67 ; WX 667 ; N C ; B 32 -18 677 685 ;
+C 68 ; WX 722 ; N D ; B -46 0 685 669 ;
+C 69 ; WX 667 ; N E ; B -27 0 653 669 ;
+C 70 ; WX 667 ; N F ; B -13 0 660 669 ;
+C 71 ; WX 722 ; N G ; B 21 -18 706 685 ;
+C 72 ; WX 778 ; N H ; B -24 0 799 669 ;
+C 73 ; WX 389 ; N I ; B -32 0 406 669 ;
+C 74 ; WX 500 ; N J ; B -46 -99 524 669 ;
+C 75 ; WX 667 ; N K ; B -21 0 702 669 ;
+C 76 ; WX 611 ; N L ; B -22 0 590 669 ;
+C 77 ; WX 889 ; N M ; B -29 -12 917 669 ;
+C 78 ; WX 722 ; N N ; B -27 -15 748 669 ;
+C 79 ; WX 722 ; N O ; B 27 -18 691 685 ;
+C 80 ; WX 611 ; N P ; B -27 0 613 669 ;
+C 81 ; WX 722 ; N Q ; B 27 -208 691 685 ;
+C 82 ; WX 667 ; N R ; B -29 0 623 669 ;
+C 83 ; WX 556 ; N S ; B 2 -18 526 685 ;
+C 84 ; WX 611 ; N T ; B 50 0 650 669 ;
+C 85 ; WX 722 ; N U ; B 67 -18 744 669 ;
+C 86 ; WX 667 ; N V ; B 65 -18 715 669 ;
+C 87 ; WX 889 ; N W ; B 65 -18 940 669 ;
+C 88 ; WX 667 ; N X ; B -24 0 694 669 ;
+C 89 ; WX 611 ; N Y ; B 73 0 659 669 ;
+C 90 ; WX 611 ; N Z ; B -11 0 590 669 ;
+C 91 ; WX 333 ; N bracketleft ; B -37 -159 362 674 ;
+C 92 ; WX 278 ; N backslash ; B -1 -18 279 685 ;
+C 93 ; WX 333 ; N bracketright ; B -56 -157 343 674 ;
+C 94 ; WX 570 ; N asciicircum ; B 67 304 503 669 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 128 369 332 685 ;
+C 97 ; WX 500 ; N a ; B -21 -14 455 462 ;
+C 98 ; WX 500 ; N b ; B -14 -13 444 699 ;
+C 99 ; WX 444 ; N c ; B -5 -13 392 462 ;
+C 100 ; WX 500 ; N d ; B -21 -13 517 699 ;
+C 101 ; WX 444 ; N e ; B 5 -13 398 462 ;
+C 102 ; WX 333 ; N f ; B -169 -205 446 698 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B -52 -203 478 462 ;
+C 104 ; WX 556 ; N h ; B -13 -9 498 699 ;
+C 105 ; WX 278 ; N i ; B 2 -9 263 684 ;
+C 106 ; WX 278 ; N j ; B -189 -207 279 684 ;
+C 107 ; WX 500 ; N k ; B -23 -8 483 699 ;
+C 108 ; WX 278 ; N l ; B 2 -9 290 699 ;
+C 109 ; WX 778 ; N m ; B -14 -9 722 462 ;
+C 110 ; WX 556 ; N n ; B -6 -9 493 462 ;
+C 111 ; WX 500 ; N o ; B -3 -13 441 462 ;
+C 112 ; WX 500 ; N p ; B -120 -205 446 462 ;
+C 113 ; WX 500 ; N q ; B 1 -205 471 462 ;
+C 114 ; WX 389 ; N r ; B -21 0 389 462 ;
+C 115 ; WX 389 ; N s ; B -19 -13 333 462 ;
+C 116 ; WX 278 ; N t ; B -11 -9 281 594 ;
+C 117 ; WX 556 ; N u ; B 15 -9 492 462 ;
+C 118 ; WX 444 ; N v ; B 16 -13 401 462 ;
+C 119 ; WX 667 ; N w ; B 16 -13 614 462 ;
+C 120 ; WX 500 ; N x ; B -46 -13 469 462 ;
+C 121 ; WX 444 ; N y ; B -94 -205 392 462 ;
+C 122 ; WX 389 ; N z ; B -43 -78 368 449 ;
+C 123 ; WX 348 ; N braceleft ; B 5 -187 436 686 ;
+C 124 ; WX 220 ; N bar ; B 66 -18 154 685 ;
+C 125 ; WX 348 ; N braceright ; B -129 -187 302 686 ;
+C 126 ; WX 570 ; N asciitilde ; B 54 173 516 333 ;
+C 161 ; WX 389 ; N exclamdown ; B 19 -205 322 492 ;
+C 162 ; WX 500 ; N cent ; B 42 -143 439 576 ;
+C 163 ; WX 500 ; N sterling ; B -32 -12 510 683 ;
+C 164 ; WX 167 ; N fraction ; B -169 -14 324 683 ;
+C 165 ; WX 500 ; N yen ; B 33 0 628 669 ;
+C 166 ; WX 500 ; N florin ; B -87 -156 537 707 ;
+C 167 ; WX 500 ; N section ; B 36 -143 459 685 ;
+C 168 ; WX 500 ; N currency ; B -26 34 526 586 ;
+C 169 ; WX 278 ; N quotesingle ; B 128 398 268 685 ;
+C 170 ; WX 500 ; N quotedblleft ; B 53 369 513 685 ;
+C 171 ; WX 500 ; N guillemotleft ; B 12 32 468 415 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 32 32 303 415 ;
+C 173 ; WX 333 ; N guilsinglright ; B 10 32 281 415 ;
+C 174 ; WX 556 ; N fi ; B -188 -205 514 703 ;
+C 175 ; WX 556 ; N fl ; B -186 -205 553 704 ;
+C 177 ; WX 500 ; N endash ; B -40 178 477 269 ;
+C 178 ; WX 500 ; N dagger ; B 91 -145 494 685 ;
+C 179 ; WX 500 ; N daggerdbl ; B 10 -139 493 685 ;
+C 180 ; WX 250 ; N periodcentered ; B 51 257 199 405 ;
+C 182 ; WX 500 ; N paragraph ; B -57 -193 562 669 ;
+C 183 ; WX 350 ; N bullet ; B 0 175 350 525 ;
+C 184 ; WX 333 ; N quotesinglbase ; B -5 -182 199 134 ;
+C 185 ; WX 500 ; N quotedblbase ; B -57 -182 403 134 ;
+C 186 ; WX 500 ; N quotedblright ; B 53 369 513 685 ;
+C 187 ; WX 500 ; N guillemotright ; B 12 32 468 415 ;
+C 188 ; WX 1000 ; N ellipsis ; B 40 -13 852 135 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -29 996 706 ;
+C 191 ; WX 500 ; N questiondown ; B 30 -205 421 492 ;
+C 193 ; WX 333 ; N grave ; B 85 516 297 697 ;
+C 194 ; WX 333 ; N acute ; B 139 516 379 697 ;
+C 195 ; WX 333 ; N circumflex ; B 40 516 367 690 ;
+C 196 ; WX 333 ; N tilde ; B 48 536 407 655 ;
+C 197 ; WX 333 ; N macron ; B 51 553 393 623 ;
+C 198 ; WX 333 ; N breve ; B 71 516 387 678 ;
+C 199 ; WX 333 ; N dotaccent ; B 163 525 293 655 ;
+C 200 ; WX 333 ; N dieresis ; B 55 525 397 655 ;
+C 202 ; WX 333 ; N ring ; B 127 516 340 729 ;
+C 203 ; WX 333 ; N cedilla ; B -80 -218 156 5 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 69 516 498 697 ;
+C 206 ; WX 333 ; N ogonek ; B -40 -173 189 44 ;
+C 207 ; WX 333 ; N caron ; B 79 516 411 690 ;
+C 208 ; WX 1000 ; N emdash ; B -40 178 977 269 ;
+C 225 ; WX 944 ; N AE ; B -64 0 918 669 ;
+C 227 ; WX 266 ; N ordfeminine ; B 16 399 330 685 ;
+C 232 ; WX 611 ; N Lslash ; B -22 0 590 669 ;
+C 233 ; WX 722 ; N Oslash ; B 27 -125 691 764 ;
+C 234 ; WX 944 ; N OE ; B 23 -8 946 677 ;
+C 235 ; WX 300 ; N ordmasculine ; B 56 400 347 685 ;
+C 241 ; WX 722 ; N ae ; B -5 -13 673 462 ;
+C 245 ; WX 278 ; N dotlessi ; B 2 -9 238 462 ;
+C 248 ; WX 278 ; N lslash ; B -13 -9 301 699 ;
+C 249 ; WX 500 ; N oslash ; B -3 -119 441 560 ;
+C 250 ; WX 722 ; N oe ; B 6 -13 674 462 ;
+C 251 ; WX 500 ; N germandbls ; B -200 -200 473 705 ;
+C -1 ; WX 611 ; N Zcaron ; B -11 0 590 897 ;
+C -1 ; WX 444 ; N ccedilla ; B -24 -218 392 462 ;
+C -1 ; WX 444 ; N ydieresis ; B -94 -205 438 655 ;
+C -1 ; WX 500 ; N atilde ; B -21 -14 491 655 ;
+C -1 ; WX 278 ; N icircumflex ; B -2 -9 325 690 ;
+C -1 ; WX 300 ; N threesuperior ; B 17 265 321 683 ;
+C -1 ; WX 444 ; N ecircumflex ; B 5 -13 423 690 ;
+C -1 ; WX 500 ; N thorn ; B -120 -205 446 699 ;
+C -1 ; WX 444 ; N egrave ; B 5 -13 398 697 ;
+C -1 ; WX 300 ; N twosuperior ; B 2 274 313 683 ;
+C -1 ; WX 444 ; N eacute ; B 5 -13 435 697 ;
+C -1 ; WX 500 ; N otilde ; B -3 -13 491 655 ;
+C -1 ; WX 667 ; N Aacute ; B -67 0 593 904 ;
+C -1 ; WX 500 ; N ocircumflex ; B -3 -13 451 690 ;
+C -1 ; WX 444 ; N yacute ; B -94 -205 435 697 ;
+C -1 ; WX 556 ; N udieresis ; B 15 -9 494 655 ;
+C -1 ; WX 750 ; N threequarters ; B 7 -14 726 683 ;
+C -1 ; WX 500 ; N acircumflex ; B -21 -14 455 690 ;
+C -1 ; WX 722 ; N Eth ; B -31 0 700 669 ;
+C -1 ; WX 444 ; N edieresis ; B 5 -13 443 655 ;
+C -1 ; WX 556 ; N ugrave ; B 15 -9 492 697 ;
+C -1 ; WX 1000 ; N trademark ; B 32 263 968 669 ;
+C -1 ; WX 500 ; N ograve ; B -3 -13 441 697 ;
+C -1 ; WX 389 ; N scaron ; B -19 -13 439 690 ;
+C -1 ; WX 389 ; N Idieresis ; B -32 0 445 862 ;
+C -1 ; WX 556 ; N uacute ; B 15 -9 492 697 ;
+C -1 ; WX 500 ; N agrave ; B -21 -14 455 697 ;
+C -1 ; WX 556 ; N ntilde ; B -6 -9 504 655 ;
+C -1 ; WX 500 ; N aring ; B -21 -14 455 729 ;
+C -1 ; WX 389 ; N zcaron ; B -43 -78 424 690 ;
+C -1 ; WX 389 ; N Icircumflex ; B -32 0 420 897 ;
+C -1 ; WX 722 ; N Ntilde ; B -27 -15 748 862 ;
+C -1 ; WX 556 ; N ucircumflex ; B 15 -9 492 690 ;
+C -1 ; WX 667 ; N Ecircumflex ; B -27 0 653 897 ;
+C -1 ; WX 389 ; N Iacute ; B -32 0 412 904 ;
+C -1 ; WX 667 ; N Ccedilla ; B 32 -218 677 685 ;
+C -1 ; WX 722 ; N Odieresis ; B 27 -18 691 862 ;
+C -1 ; WX 556 ; N Scaron ; B 2 -18 526 897 ;
+C -1 ; WX 667 ; N Edieresis ; B -27 0 653 862 ;
+C -1 ; WX 389 ; N Igrave ; B -32 0 406 904 ;
+C -1 ; WX 500 ; N adieresis ; B -21 -14 471 655 ;
+C -1 ; WX 722 ; N Ograve ; B 27 -18 691 904 ;
+C -1 ; WX 667 ; N Egrave ; B -27 0 653 904 ;
+C -1 ; WX 611 ; N Ydieresis ; B 73 0 659 862 ;
+C -1 ; WX 747 ; N registered ; B 30 -18 718 685 ;
+C -1 ; WX 722 ; N Otilde ; B 27 -18 691 862 ;
+C -1 ; WX 750 ; N onequarter ; B 7 -14 721 683 ;
+C -1 ; WX 722 ; N Ugrave ; B 67 -18 744 904 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 67 -18 744 897 ;
+C -1 ; WX 611 ; N Thorn ; B -27 0 573 669 ;
+C -1 ; WX 570 ; N divide ; B 33 -29 537 535 ;
+C -1 ; WX 667 ; N Atilde ; B -67 0 593 862 ;
+C -1 ; WX 722 ; N Uacute ; B 67 -18 744 904 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 27 -18 691 897 ;
+C -1 ; WX 606 ; N logicalnot ; B 51 108 555 399 ;
+C -1 ; WX 667 ; N Aring ; B -67 0 593 921 ;
+C -1 ; WX 278 ; N idieresis ; B 2 -9 360 655 ;
+C -1 ; WX 278 ; N iacute ; B 2 -9 352 697 ;
+C -1 ; WX 500 ; N aacute ; B -21 -14 463 697 ;
+C -1 ; WX 570 ; N plusminus ; B 33 0 537 506 ;
+C -1 ; WX 570 ; N multiply ; B 48 16 522 490 ;
+C -1 ; WX 722 ; N Udieresis ; B 67 -18 744 862 ;
+C -1 ; WX 606 ; N minus ; B 51 209 555 297 ;
+C -1 ; WX 300 ; N onesuperior ; B 30 274 301 683 ;
+C -1 ; WX 667 ; N Eacute ; B -27 0 653 904 ;
+C -1 ; WX 667 ; N Acircumflex ; B -67 0 593 897 ;
+C -1 ; WX 747 ; N copyright ; B 30 -18 718 685 ;
+C -1 ; WX 667 ; N Agrave ; B -67 0 593 904 ;
+C -1 ; WX 500 ; N odieresis ; B -3 -13 466 655 ;
+C -1 ; WX 500 ; N oacute ; B -3 -13 463 697 ;
+C -1 ; WX 400 ; N degree ; B 83 397 369 683 ;
+C -1 ; WX 278 ; N igrave ; B 2 -9 260 697 ;
+C -1 ; WX 576 ; N mu ; B -60 -207 516 449 ;
+C -1 ; WX 722 ; N Oacute ; B 27 -18 691 904 ;
+C -1 ; WX 500 ; N eth ; B -3 -13 454 699 ;
+C -1 ; WX 667 ; N Adieresis ; B -67 0 593 862 ;
+C -1 ; WX 611 ; N Yacute ; B 73 0 659 904 ;
+C -1 ; WX 220 ; N brokenbar ; B 66 -18 154 685 ;
+C -1 ; WX 750 ; N onehalf ; B -9 -14 723 683 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 283
+
+KPX A y -74
+KPX A w -74
+KPX A v -74
+KPX A u -30
+KPX A quoteright -74
+KPX A quotedblright 0
+KPX A p 0
+KPX A Y -70
+KPX A W -100
+KPX A V -95
+KPX A U -50
+KPX A T -55
+KPX A Q -55
+KPX A O -50
+KPX A G -60
+KPX A C -65
+
+KPX B period 0
+KPX B comma 0
+KPX B U -10
+KPX B A -25
+
+KPX D period 0
+KPX D comma 0
+KPX D Y -50
+KPX D W -40
+KPX D V -50
+KPX D A -25
+
+KPX F r -50
+KPX F period -129
+KPX F o -70
+KPX F i -40
+KPX F e -100
+KPX F comma -129
+KPX F a -95
+KPX F A -100
+
+KPX G period 0
+KPX G comma 0
+
+KPX J u -40
+KPX J period -10
+KPX J o -40
+KPX J e -40
+KPX J comma -10
+KPX J a -40
+KPX J A -25
+
+KPX K y -20
+KPX K u -20
+KPX K o -25
+KPX K e -25
+KPX K O -30
+
+KPX L y -37
+KPX L quoteright -55
+KPX L quotedblright 0
+KPX L Y -37
+KPX L W -37
+KPX L V -37
+KPX L T -18
+
+KPX N period 0
+KPX N comma 0
+KPX N A -30
+
+KPX O period 0
+KPX O comma 0
+KPX O Y -50
+KPX O X -40
+KPX O W -50
+KPX O V -50
+KPX O T -40
+KPX O A -40
+
+KPX P period -129
+KPX P o -55
+KPX P e -50
+KPX P comma -129
+KPX P a -40
+KPX P A -85
+
+KPX Q period 0
+KPX Q comma 0
+KPX Q U -10
+
+KPX R Y -18
+KPX R W -18
+KPX R V -18
+KPX R U -40
+KPX R T -30
+KPX R O -40
+
+KPX S period 0
+KPX S comma 0
+
+KPX T y -37
+KPX T w -37
+KPX T u -37
+KPX T semicolon -74
+KPX T r -37
+KPX T period -92
+KPX T o -95
+KPX T i -37
+KPX T hyphen -92
+KPX T h 0
+KPX T e -92
+KPX T comma -92
+KPX T colon -74
+KPX T a -92
+KPX T O -18
+KPX T A -55
+
+KPX U period 0
+KPX U comma 0
+KPX U A -45
+
+KPX V u -55
+KPX V semicolon -74
+KPX V period -129
+KPX V o -111
+KPX V i -55
+KPX V hyphen -70
+KPX V e -111
+KPX V comma -129
+KPX V colon -74
+KPX V a -111
+KPX V O -30
+KPX V G -10
+KPX V A -85
+
+KPX W y -55
+KPX W u -55
+KPX W semicolon -55
+KPX W period -74
+KPX W o -80
+KPX W i -37
+KPX W hyphen -50
+KPX W h 0
+KPX W e -90
+KPX W comma -74
+KPX W colon -55
+KPX W a -85
+KPX W O -15
+KPX W A -74
+
+KPX Y u -92
+KPX Y semicolon -92
+KPX Y period -74
+KPX Y o -111
+KPX Y i -55
+KPX Y hyphen -92
+KPX Y e -111
+KPX Y comma -92
+KPX Y colon -92
+KPX Y a -92
+KPX Y O -25
+KPX Y A -74
+
+KPX a y 0
+KPX a w 0
+KPX a v 0
+KPX a t 0
+KPX a p 0
+KPX a g 0
+KPX a b 0
+
+KPX b y 0
+KPX b v 0
+KPX b u -20
+KPX b period -40
+KPX b l 0
+KPX b comma 0
+KPX b b -10
+
+KPX c y 0
+KPX c period 0
+KPX c l 0
+KPX c k -10
+KPX c h -10
+KPX c comma 0
+
+KPX colon space 0
+
+KPX comma space 0
+KPX comma quoteright -95
+KPX comma quotedblright -95
+
+KPX d y 0
+KPX d w 0
+KPX d v 0
+KPX d period 0
+KPX d d 0
+KPX d comma 0
+
+KPX e y 0
+KPX e x 0
+KPX e w 0
+KPX e v 0
+KPX e period 0
+KPX e p 0
+KPX e g 0
+KPX e comma 0
+KPX e b -10
+
+KPX f quoteright 55
+KPX f quotedblright 0
+KPX f period -10
+KPX f o -10
+KPX f l 0
+KPX f i 0
+KPX f f -18
+KPX f e -10
+KPX f dotlessi -30
+KPX f comma -10
+KPX f a 0
+
+KPX g y 0
+KPX g r 0
+KPX g period 0
+KPX g o 0
+KPX g i 0
+KPX g g 0
+KPX g e 0
+KPX g comma 0
+KPX g a 0
+
+KPX h y 0
+
+KPX i v 0
+
+KPX k y 0
+KPX k o -10
+KPX k e -30
+
+KPX l y 0
+KPX l w 0
+
+KPX m y 0
+KPX m u 0
+
+KPX n y 0
+KPX n v -40
+KPX n u 0
+
+KPX o y -10
+KPX o x -10
+KPX o w -25
+KPX o v -15
+KPX o g 0
+
+KPX p y 0
+
+KPX period quoteright -95
+KPX period quotedblright -95
+
+KPX quotedblleft quoteleft 0
+KPX quotedblleft A 0
+
+KPX quotedblright space 0
+
+KPX quoteleft quoteleft -74
+KPX quoteleft A 0
+
+KPX quoteright v -15
+KPX quoteright t -37
+KPX quoteright space -74
+KPX quoteright s -74
+KPX quoteright r -15
+KPX quoteright quoteright -74
+KPX quoteright quotedblright 0
+KPX quoteright l 0
+KPX quoteright d -15
+
+KPX r y 0
+KPX r v 0
+KPX r u 0
+KPX r t 0
+KPX r s 0
+KPX r r 0
+KPX r q 0
+KPX r period -65
+KPX r p 0
+KPX r o 0
+KPX r n 0
+KPX r m 0
+KPX r l 0
+KPX r k 0
+KPX r i 0
+KPX r hyphen 0
+KPX r g 0
+KPX r e 0
+KPX r d 0
+KPX r comma -65
+KPX r c 0
+KPX r a 0
+
+KPX s w 0
+
+KPX space quoteleft 0
+KPX space quotedblleft 0
+KPX space Y -70
+KPX space W -70
+KPX space V -70
+KPX space T 0
+KPX space A -37
+
+KPX v period -37
+KPX v o -15
+KPX v e -15
+KPX v comma -37
+KPX v a 0
+
+KPX w period -37
+KPX w o -15
+KPX w h 0
+KPX w e -10
+KPX w comma -37
+KPX w a -10
+
+KPX x e -10
+
+KPX y period -37
+KPX y o 0
+KPX y e 0
+KPX y comma -37
+KPX y a 0
+
+KPX z o 0
+KPX z e 0
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 172 207 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 187 207 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 167 207 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 172 207 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 157 192 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 167 207 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 167 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 172 207 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 187 207 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 187 207 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 172 207 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 33 207 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 53 207 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 48 207 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 33 207 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 210 207 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 200 207 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 230 207 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 215 207 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 200 207 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 215 207 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 207 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 210 207 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 230 207 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 230 207 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 200 207 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 154 207 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 169 207 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 207 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 84 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 84 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 74 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 74 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 84 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 46 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 46 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -42 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -37 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -37 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 97 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 69 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 74 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 112 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 112 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 97 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 102 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 56 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 41 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 13 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmr8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmr8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..e5092b5c850763ffba89dfa3c83d826c6e254a14
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmr8a.afm
@@ -0,0 +1,648 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue Mar 20 12:15:44 1990
+Comment UniqueID 28416
+Comment VMusage 30487 37379
+FontName Times-Roman
+FullName Times Roman
+FamilyName Times
+Weight Roman
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -168 -218 1000 898
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 662
+XHeight 450
+Ascender 683
+Descender -217
+StartCharMetrics 228
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 130 -9 238 676 ;
+C 34 ; WX 408 ; N quotedbl ; B 77 431 331 676 ;
+C 35 ; WX 500 ; N numbersign ; B 5 0 496 662 ;
+C 36 ; WX 500 ; N dollar ; B 44 -87 457 727 ;
+C 37 ; WX 833 ; N percent ; B 61 -13 772 676 ;
+C 38 ; WX 778 ; N ampersand ; B 42 -13 750 676 ;
+C 39 ; WX 333 ; N quoteright ; B 79 433 218 676 ;
+C 40 ; WX 333 ; N parenleft ; B 48 -177 304 676 ;
+C 41 ; WX 333 ; N parenright ; B 29 -177 285 676 ;
+C 42 ; WX 500 ; N asterisk ; B 69 265 432 676 ;
+C 43 ; WX 564 ; N plus ; B 30 0 534 506 ;
+C 44 ; WX 250 ; N comma ; B 56 -141 195 102 ;
+C 45 ; WX 333 ; N hyphen ; B 39 194 285 257 ;
+C 46 ; WX 250 ; N period ; B 70 -11 181 100 ;
+C 47 ; WX 278 ; N slash ; B -9 -14 287 676 ;
+C 48 ; WX 500 ; N zero ; B 24 -14 476 676 ;
+C 49 ; WX 500 ; N one ; B 111 0 394 676 ;
+C 50 ; WX 500 ; N two ; B 30 0 475 676 ;
+C 51 ; WX 500 ; N three ; B 43 -14 431 676 ;
+C 52 ; WX 500 ; N four ; B 12 0 472 676 ;
+C 53 ; WX 500 ; N five ; B 32 -14 438 688 ;
+C 54 ; WX 500 ; N six ; B 34 -14 468 684 ;
+C 55 ; WX 500 ; N seven ; B 20 -8 449 662 ;
+C 56 ; WX 500 ; N eight ; B 56 -14 445 676 ;
+C 57 ; WX 500 ; N nine ; B 30 -22 459 676 ;
+C 58 ; WX 278 ; N colon ; B 81 -11 192 459 ;
+C 59 ; WX 278 ; N semicolon ; B 80 -141 219 459 ;
+C 60 ; WX 564 ; N less ; B 28 -8 536 514 ;
+C 61 ; WX 564 ; N equal ; B 30 120 534 386 ;
+C 62 ; WX 564 ; N greater ; B 28 -8 536 514 ;
+C 63 ; WX 444 ; N question ; B 68 -8 414 676 ;
+C 64 ; WX 921 ; N at ; B 116 -14 809 676 ;
+C 65 ; WX 722 ; N A ; B 15 0 706 674 ;
+C 66 ; WX 667 ; N B ; B 17 0 593 662 ;
+C 67 ; WX 667 ; N C ; B 28 -14 633 676 ;
+C 68 ; WX 722 ; N D ; B 16 0 685 662 ;
+C 69 ; WX 611 ; N E ; B 12 0 597 662 ;
+C 70 ; WX 556 ; N F ; B 12 0 546 662 ;
+C 71 ; WX 722 ; N G ; B 32 -14 709 676 ;
+C 72 ; WX 722 ; N H ; B 19 0 702 662 ;
+C 73 ; WX 333 ; N I ; B 18 0 315 662 ;
+C 74 ; WX 389 ; N J ; B 10 -14 370 662 ;
+C 75 ; WX 722 ; N K ; B 34 0 723 662 ;
+C 76 ; WX 611 ; N L ; B 12 0 598 662 ;
+C 77 ; WX 889 ; N M ; B 12 0 863 662 ;
+C 78 ; WX 722 ; N N ; B 12 -11 707 662 ;
+C 79 ; WX 722 ; N O ; B 34 -14 688 676 ;
+C 80 ; WX 556 ; N P ; B 16 0 542 662 ;
+C 81 ; WX 722 ; N Q ; B 34 -178 701 676 ;
+C 82 ; WX 667 ; N R ; B 17 0 659 662 ;
+C 83 ; WX 556 ; N S ; B 42 -14 491 676 ;
+C 84 ; WX 611 ; N T ; B 17 0 593 662 ;
+C 85 ; WX 722 ; N U ; B 14 -14 705 662 ;
+C 86 ; WX 722 ; N V ; B 16 -11 697 662 ;
+C 87 ; WX 944 ; N W ; B 5 -11 932 662 ;
+C 88 ; WX 722 ; N X ; B 10 0 704 662 ;
+C 89 ; WX 722 ; N Y ; B 22 0 703 662 ;
+C 90 ; WX 611 ; N Z ; B 9 0 597 662 ;
+C 91 ; WX 333 ; N bracketleft ; B 88 -156 299 662 ;
+C 92 ; WX 278 ; N backslash ; B -9 -14 287 676 ;
+C 93 ; WX 333 ; N bracketright ; B 34 -156 245 662 ;
+C 94 ; WX 469 ; N asciicircum ; B 24 297 446 662 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 115 433 254 676 ;
+C 97 ; WX 444 ; N a ; B 37 -10 442 460 ;
+C 98 ; WX 500 ; N b ; B 3 -10 468 683 ;
+C 99 ; WX 444 ; N c ; B 25 -10 412 460 ;
+C 100 ; WX 500 ; N d ; B 27 -10 491 683 ;
+C 101 ; WX 444 ; N e ; B 25 -10 424 460 ;
+C 102 ; WX 333 ; N f ; B 20 0 383 683 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B 28 -218 470 460 ;
+C 104 ; WX 500 ; N h ; B 9 0 487 683 ;
+C 105 ; WX 278 ; N i ; B 16 0 253 683 ;
+C 106 ; WX 278 ; N j ; B -70 -218 194 683 ;
+C 107 ; WX 500 ; N k ; B 7 0 505 683 ;
+C 108 ; WX 278 ; N l ; B 19 0 257 683 ;
+C 109 ; WX 778 ; N m ; B 16 0 775 460 ;
+C 110 ; WX 500 ; N n ; B 16 0 485 460 ;
+C 111 ; WX 500 ; N o ; B 29 -10 470 460 ;
+C 112 ; WX 500 ; N p ; B 5 -217 470 460 ;
+C 113 ; WX 500 ; N q ; B 24 -217 488 460 ;
+C 114 ; WX 333 ; N r ; B 5 0 335 460 ;
+C 115 ; WX 389 ; N s ; B 51 -10 348 460 ;
+C 116 ; WX 278 ; N t ; B 13 -10 279 579 ;
+C 117 ; WX 500 ; N u ; B 9 -10 479 450 ;
+C 118 ; WX 500 ; N v ; B 19 -14 477 450 ;
+C 119 ; WX 722 ; N w ; B 21 -14 694 450 ;
+C 120 ; WX 500 ; N x ; B 17 0 479 450 ;
+C 121 ; WX 500 ; N y ; B 14 -218 475 450 ;
+C 122 ; WX 444 ; N z ; B 27 0 418 450 ;
+C 123 ; WX 480 ; N braceleft ; B 100 -181 350 680 ;
+C 124 ; WX 200 ; N bar ; B 67 -14 133 676 ;
+C 125 ; WX 480 ; N braceright ; B 130 -181 380 680 ;
+C 126 ; WX 541 ; N asciitilde ; B 40 183 502 323 ;
+C 161 ; WX 333 ; N exclamdown ; B 97 -218 205 467 ;
+C 162 ; WX 500 ; N cent ; B 53 -138 448 579 ;
+C 163 ; WX 500 ; N sterling ; B 12 -8 490 676 ;
+C 164 ; WX 167 ; N fraction ; B -168 -14 331 676 ;
+C 165 ; WX 500 ; N yen ; B -53 0 512 662 ;
+C 166 ; WX 500 ; N florin ; B 7 -189 490 676 ;
+C 167 ; WX 500 ; N section ; B 70 -148 426 676 ;
+C 168 ; WX 500 ; N currency ; B -22 58 522 602 ;
+C 169 ; WX 180 ; N quotesingle ; B 48 431 133 676 ;
+C 170 ; WX 444 ; N quotedblleft ; B 43 433 414 676 ;
+C 171 ; WX 500 ; N guillemotleft ; B 42 33 456 416 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 63 33 285 416 ;
+C 173 ; WX 333 ; N guilsinglright ; B 48 33 270 416 ;
+C 174 ; WX 556 ; N fi ; B 31 0 521 683 ;
+C 175 ; WX 556 ; N fl ; B 32 0 521 683 ;
+C 177 ; WX 500 ; N endash ; B 0 201 500 250 ;
+C 178 ; WX 500 ; N dagger ; B 59 -149 442 676 ;
+C 179 ; WX 500 ; N daggerdbl ; B 58 -153 442 676 ;
+C 180 ; WX 250 ; N periodcentered ; B 70 199 181 310 ;
+C 182 ; WX 453 ; N paragraph ; B -22 -154 450 662 ;
+C 183 ; WX 350 ; N bullet ; B 40 196 310 466 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 79 -141 218 102 ;
+C 185 ; WX 444 ; N quotedblbase ; B 45 -141 416 102 ;
+C 186 ; WX 444 ; N quotedblright ; B 30 433 401 676 ;
+C 187 ; WX 500 ; N guillemotright ; B 44 33 458 416 ;
+C 188 ; WX 1000 ; N ellipsis ; B 111 -11 888 100 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -19 994 706 ;
+C 191 ; WX 444 ; N questiondown ; B 30 -218 376 466 ;
+C 193 ; WX 333 ; N grave ; B 19 507 242 678 ;
+C 194 ; WX 333 ; N acute ; B 93 507 317 678 ;
+C 195 ; WX 333 ; N circumflex ; B 11 507 322 674 ;
+C 196 ; WX 333 ; N tilde ; B 1 532 331 638 ;
+C 197 ; WX 333 ; N macron ; B 11 547 322 601 ;
+C 198 ; WX 333 ; N breve ; B 26 507 307 664 ;
+C 199 ; WX 333 ; N dotaccent ; B 118 523 216 623 ;
+C 200 ; WX 333 ; N dieresis ; B 18 523 315 623 ;
+C 202 ; WX 333 ; N ring ; B 67 512 266 711 ;
+C 203 ; WX 333 ; N cedilla ; B 52 -215 261 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -3 507 377 678 ;
+C 206 ; WX 333 ; N ogonek ; B 64 -165 249 0 ;
+C 207 ; WX 333 ; N caron ; B 11 507 322 674 ;
+C 208 ; WX 1000 ; N emdash ; B 0 201 1000 250 ;
+C 225 ; WX 889 ; N AE ; B 0 0 863 662 ;
+C 227 ; WX 276 ; N ordfeminine ; B 4 394 270 676 ;
+C 232 ; WX 611 ; N Lslash ; B 12 0 598 662 ;
+C 233 ; WX 722 ; N Oslash ; B 34 -80 688 734 ;
+C 234 ; WX 889 ; N OE ; B 30 -6 885 668 ;
+C 235 ; WX 310 ; N ordmasculine ; B 6 394 304 676 ;
+C 241 ; WX 667 ; N ae ; B 38 -10 632 460 ;
+C 245 ; WX 278 ; N dotlessi ; B 16 0 253 460 ;
+C 248 ; WX 278 ; N lslash ; B 19 0 259 683 ;
+C 249 ; WX 500 ; N oslash ; B 29 -112 470 551 ;
+C 250 ; WX 722 ; N oe ; B 30 -10 690 460 ;
+C 251 ; WX 500 ; N germandbls ; B 12 -9 468 683 ;
+C -1 ; WX 611 ; N Zcaron ; B 9 0 597 886 ;
+C -1 ; WX 444 ; N ccedilla ; B 25 -215 412 460 ;
+C -1 ; WX 500 ; N ydieresis ; B 14 -218 475 623 ;
+C -1 ; WX 444 ; N atilde ; B 37 -10 442 638 ;
+C -1 ; WX 278 ; N icircumflex ; B -16 0 295 674 ;
+C -1 ; WX 300 ; N threesuperior ; B 15 262 291 676 ;
+C -1 ; WX 444 ; N ecircumflex ; B 25 -10 424 674 ;
+C -1 ; WX 500 ; N thorn ; B 5 -217 470 683 ;
+C -1 ; WX 444 ; N egrave ; B 25 -10 424 678 ;
+C -1 ; WX 300 ; N twosuperior ; B 1 270 296 676 ;
+C -1 ; WX 444 ; N eacute ; B 25 -10 424 678 ;
+C -1 ; WX 500 ; N otilde ; B 29 -10 470 638 ;
+C -1 ; WX 722 ; N Aacute ; B 15 0 706 890 ;
+C -1 ; WX 500 ; N ocircumflex ; B 29 -10 470 674 ;
+C -1 ; WX 500 ; N yacute ; B 14 -218 475 678 ;
+C -1 ; WX 500 ; N udieresis ; B 9 -10 479 623 ;
+C -1 ; WX 750 ; N threequarters ; B 15 -14 718 676 ;
+C -1 ; WX 444 ; N acircumflex ; B 37 -10 442 674 ;
+C -1 ; WX 722 ; N Eth ; B 16 0 685 662 ;
+C -1 ; WX 444 ; N edieresis ; B 25 -10 424 623 ;
+C -1 ; WX 500 ; N ugrave ; B 9 -10 479 678 ;
+C -1 ; WX 980 ; N trademark ; B 30 256 957 662 ;
+C -1 ; WX 500 ; N ograve ; B 29 -10 470 678 ;
+C -1 ; WX 389 ; N scaron ; B 39 -10 350 674 ;
+C -1 ; WX 333 ; N Idieresis ; B 18 0 315 835 ;
+C -1 ; WX 500 ; N uacute ; B 9 -10 479 678 ;
+C -1 ; WX 444 ; N agrave ; B 37 -10 442 678 ;
+C -1 ; WX 500 ; N ntilde ; B 16 0 485 638 ;
+C -1 ; WX 444 ; N aring ; B 37 -10 442 711 ;
+C -1 ; WX 444 ; N zcaron ; B 27 0 418 674 ;
+C -1 ; WX 333 ; N Icircumflex ; B 11 0 322 886 ;
+C -1 ; WX 722 ; N Ntilde ; B 12 -11 707 850 ;
+C -1 ; WX 500 ; N ucircumflex ; B 9 -10 479 674 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 12 0 597 886 ;
+C -1 ; WX 333 ; N Iacute ; B 18 0 317 890 ;
+C -1 ; WX 667 ; N Ccedilla ; B 28 -215 633 676 ;
+C -1 ; WX 722 ; N Odieresis ; B 34 -14 688 835 ;
+C -1 ; WX 556 ; N Scaron ; B 42 -14 491 886 ;
+C -1 ; WX 611 ; N Edieresis ; B 12 0 597 835 ;
+C -1 ; WX 333 ; N Igrave ; B 18 0 315 890 ;
+C -1 ; WX 444 ; N adieresis ; B 37 -10 442 623 ;
+C -1 ; WX 722 ; N Ograve ; B 34 -14 688 890 ;
+C -1 ; WX 611 ; N Egrave ; B 12 0 597 890 ;
+C -1 ; WX 722 ; N Ydieresis ; B 22 0 703 835 ;
+C -1 ; WX 760 ; N registered ; B 38 -14 722 676 ;
+C -1 ; WX 722 ; N Otilde ; B 34 -14 688 850 ;
+C -1 ; WX 750 ; N onequarter ; B 37 -14 718 676 ;
+C -1 ; WX 722 ; N Ugrave ; B 14 -14 705 890 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 14 -14 705 886 ;
+C -1 ; WX 556 ; N Thorn ; B 16 0 542 662 ;
+C -1 ; WX 564 ; N divide ; B 30 -10 534 516 ;
+C -1 ; WX 722 ; N Atilde ; B 15 0 706 850 ;
+C -1 ; WX 722 ; N Uacute ; B 14 -14 705 890 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 34 -14 688 886 ;
+C -1 ; WX 564 ; N logicalnot ; B 30 108 534 386 ;
+C -1 ; WX 722 ; N Aring ; B 15 0 706 898 ;
+C -1 ; WX 278 ; N idieresis ; B -9 0 288 623 ;
+C -1 ; WX 278 ; N iacute ; B 16 0 290 678 ;
+C -1 ; WX 444 ; N aacute ; B 37 -10 442 678 ;
+C -1 ; WX 564 ; N plusminus ; B 30 0 534 506 ;
+C -1 ; WX 564 ; N multiply ; B 38 8 527 497 ;
+C -1 ; WX 722 ; N Udieresis ; B 14 -14 705 835 ;
+C -1 ; WX 564 ; N minus ; B 30 220 534 286 ;
+C -1 ; WX 300 ; N onesuperior ; B 57 270 248 676 ;
+C -1 ; WX 611 ; N Eacute ; B 12 0 597 890 ;
+C -1 ; WX 722 ; N Acircumflex ; B 15 0 706 886 ;
+C -1 ; WX 760 ; N copyright ; B 38 -14 722 676 ;
+C -1 ; WX 722 ; N Agrave ; B 15 0 706 890 ;
+C -1 ; WX 500 ; N odieresis ; B 29 -10 470 623 ;
+C -1 ; WX 500 ; N oacute ; B 29 -10 470 678 ;
+C -1 ; WX 400 ; N degree ; B 57 390 343 676 ;
+C -1 ; WX 278 ; N igrave ; B -8 0 253 678 ;
+C -1 ; WX 500 ; N mu ; B 36 -218 512 450 ;
+C -1 ; WX 722 ; N Oacute ; B 34 -14 688 890 ;
+C -1 ; WX 500 ; N eth ; B 29 -10 471 686 ;
+C -1 ; WX 722 ; N Adieresis ; B 15 0 706 835 ;
+C -1 ; WX 722 ; N Yacute ; B 22 0 703 890 ;
+C -1 ; WX 200 ; N brokenbar ; B 67 -14 133 676 ;
+C -1 ; WX 750 ; N onehalf ; B 31 -14 746 676 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 283
+
+KPX A y -92
+KPX A w -92
+KPX A v -74
+KPX A u 0
+KPX A quoteright -111
+KPX A quotedblright 0
+KPX A p 0
+KPX A Y -105
+KPX A W -90
+KPX A V -135
+KPX A U -55
+KPX A T -111
+KPX A Q -55
+KPX A O -55
+KPX A G -40
+KPX A C -40
+
+KPX B period 0
+KPX B comma 0
+KPX B U -10
+KPX B A -35
+
+KPX D period 0
+KPX D comma 0
+KPX D Y -55
+KPX D W -30
+KPX D V -40
+KPX D A -40
+
+KPX F r 0
+KPX F period -80
+KPX F o -15
+KPX F i 0
+KPX F e 0
+KPX F comma -80
+KPX F a -15
+KPX F A -74
+
+KPX G period 0
+KPX G comma 0
+
+KPX J u 0
+KPX J period 0
+KPX J o 0
+KPX J e 0
+KPX J comma 0
+KPX J a 0
+KPX J A -60
+
+KPX K y -25
+KPX K u -15
+KPX K o -35
+KPX K e -25
+KPX K O -30
+
+KPX L y -55
+KPX L quoteright -92
+KPX L quotedblright 0
+KPX L Y -100
+KPX L W -74
+KPX L V -100
+KPX L T -92
+
+KPX N period 0
+KPX N comma 0
+KPX N A -35
+
+KPX O period 0
+KPX O comma 0
+KPX O Y -50
+KPX O X -40
+KPX O W -35
+KPX O V -50
+KPX O T -40
+KPX O A -35
+
+KPX P period -111
+KPX P o 0
+KPX P e 0
+KPX P comma -111
+KPX P a -15
+KPX P A -92
+
+KPX Q period 0
+KPX Q comma 0
+KPX Q U -10
+
+KPX R Y -65
+KPX R W -55
+KPX R V -80
+KPX R U -40
+KPX R T -60
+KPX R O -40
+
+KPX S period 0
+KPX S comma 0
+
+KPX T y -80
+KPX T w -80
+KPX T u -45
+KPX T semicolon -55
+KPX T r -35
+KPX T period -74
+KPX T o -80
+KPX T i -35
+KPX T hyphen -92
+KPX T h 0
+KPX T e -70
+KPX T comma -74
+KPX T colon -50
+KPX T a -80
+KPX T O -18
+KPX T A -93
+
+KPX U period 0
+KPX U comma 0
+KPX U A -40
+
+KPX V u -75
+KPX V semicolon -74
+KPX V period -129
+KPX V o -129
+KPX V i -60
+KPX V hyphen -100
+KPX V e -111
+KPX V comma -129
+KPX V colon -74
+KPX V a -111
+KPX V O -40
+KPX V G -15
+KPX V A -135
+
+KPX W y -73
+KPX W u -50
+KPX W semicolon -37
+KPX W period -92
+KPX W o -80
+KPX W i -40
+KPX W hyphen -65
+KPX W h 0
+KPX W e -80
+KPX W comma -92
+KPX W colon -37
+KPX W a -80
+KPX W O -10
+KPX W A -120
+
+KPX Y u -111
+KPX Y semicolon -92
+KPX Y period -129
+KPX Y o -110
+KPX Y i -55
+KPX Y hyphen -111
+KPX Y e -100
+KPX Y comma -129
+KPX Y colon -92
+KPX Y a -100
+KPX Y O -30
+KPX Y A -120
+
+KPX a y 0
+KPX a w -15
+KPX a v -20
+KPX a t 0
+KPX a p 0
+KPX a g 0
+KPX a b 0
+
+KPX b y 0
+KPX b v -15
+KPX b u -20
+KPX b period -40
+KPX b l 0
+KPX b comma 0
+KPX b b 0
+
+KPX c y -15
+KPX c period 0
+KPX c l 0
+KPX c k 0
+KPX c h 0
+KPX c comma 0
+
+KPX colon space 0
+
+KPX comma space 0
+KPX comma quoteright -70
+KPX comma quotedblright -70
+
+KPX d y 0
+KPX d w 0
+KPX d v 0
+KPX d period 0
+KPX d d 0
+KPX d comma 0
+
+KPX e y -15
+KPX e x -15
+KPX e w -25
+KPX e v -25
+KPX e period 0
+KPX e p 0
+KPX e g -15
+KPX e comma 0
+KPX e b 0
+
+KPX f quoteright 55
+KPX f quotedblright 0
+KPX f period 0
+KPX f o 0
+KPX f l 0
+KPX f i -20
+KPX f f -25
+KPX f e 0
+KPX f dotlessi -50
+KPX f comma 0
+KPX f a -10
+
+KPX g y 0
+KPX g r 0
+KPX g period 0
+KPX g o 0
+KPX g i 0
+KPX g g 0
+KPX g e 0
+KPX g comma 0
+KPX g a -5
+
+KPX h y -5
+
+KPX i v -25
+
+KPX k y -15
+KPX k o -10
+KPX k e -10
+
+KPX l y 0
+KPX l w -10
+
+KPX m y 0
+KPX m u 0
+
+KPX n y -15
+KPX n v -40
+KPX n u 0
+
+KPX o y -10
+KPX o x 0
+KPX o w -25
+KPX o v -15
+KPX o g 0
+
+KPX p y -10
+
+KPX period quoteright -70
+KPX period quotedblright -70
+
+KPX quotedblleft quoteleft 0
+KPX quotedblleft A -80
+
+KPX quotedblright space 0
+
+KPX quoteleft quoteleft -74
+KPX quoteleft A -80
+
+KPX quoteright v -50
+KPX quoteright t -18
+KPX quoteright space -74
+KPX quoteright s -55
+KPX quoteright r -50
+KPX quoteright quoteright -74
+KPX quoteright quotedblright 0
+KPX quoteright l -10
+KPX quoteright d -50
+
+KPX r y 0
+KPX r v 0
+KPX r u 0
+KPX r t 0
+KPX r s 0
+KPX r r 0
+KPX r q 0
+KPX r period -55
+KPX r p 0
+KPX r o 0
+KPX r n 0
+KPX r m 0
+KPX r l 0
+KPX r k 0
+KPX r i 0
+KPX r hyphen -20
+KPX r g -18
+KPX r e 0
+KPX r d 0
+KPX r comma -40
+KPX r c 0
+KPX r a 0
+
+KPX s w 0
+
+KPX space quoteleft 0
+KPX space quotedblleft 0
+KPX space Y -90
+KPX space W -30
+KPX space V -50
+KPX space T -18
+KPX space A -55
+
+KPX v period -65
+KPX v o -20
+KPX v e -15
+KPX v comma -65
+KPX v a -25
+
+KPX w period -65
+KPX w o -10
+KPX w h 0
+KPX w e 0
+KPX w comma -65
+KPX w a -10
+
+KPX x e -15
+
+KPX y period -65
+KPX y o 0
+KPX y e 0
+KPX y comma -65
+KPX y a 0
+
+KPX z o 0
+KPX z e 0
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 195 212 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 195 212 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 195 212 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 195 212 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 185 187 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 195 212 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 167 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 139 212 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 139 212 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 139 212 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 139 212 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 0 212 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 0 212 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 0 212 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 0 212 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 195 212 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 195 212 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 195 212 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 195 212 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 195 212 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 195 212 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 112 212 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 195 212 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 195 212 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 195 212 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 195 212 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 195 212 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 195 212 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 212 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 56 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 56 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 56 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 56 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 56 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 56 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 56 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 56 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 84 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 84 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 84 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 84 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 84 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 84 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 84 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 84 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 84 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 56 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmri8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmri8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..6d7a003ba83426f6d006a893b5236c088aa7eab5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/ptmri8a.afm
@@ -0,0 +1,648 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Tue Mar 20 13:14:56 1990
+Comment UniqueID 28427
+Comment VMusage 32912 39804
+FontName Times-Italic
+FullName Times Italic
+FamilyName Times
+Weight Medium
+ItalicAngle -15.5
+IsFixedPitch false
+FontBBox -169 -217 1010 883
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 653
+XHeight 441
+Ascender 683
+Descender -205
+StartCharMetrics 228
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 39 -11 302 667 ;
+C 34 ; WX 420 ; N quotedbl ; B 144 421 432 666 ;
+C 35 ; WX 500 ; N numbersign ; B 2 0 540 676 ;
+C 36 ; WX 500 ; N dollar ; B 31 -89 497 731 ;
+C 37 ; WX 833 ; N percent ; B 79 -13 790 676 ;
+C 38 ; WX 778 ; N ampersand ; B 76 -18 723 666 ;
+C 39 ; WX 333 ; N quoteright ; B 151 436 290 666 ;
+C 40 ; WX 333 ; N parenleft ; B 42 -181 315 669 ;
+C 41 ; WX 333 ; N parenright ; B 16 -180 289 669 ;
+C 42 ; WX 500 ; N asterisk ; B 128 255 492 666 ;
+C 43 ; WX 675 ; N plus ; B 86 0 590 506 ;
+C 44 ; WX 250 ; N comma ; B -4 -129 135 101 ;
+C 45 ; WX 333 ; N hyphen ; B 49 192 282 255 ;
+C 46 ; WX 250 ; N period ; B 27 -11 138 100 ;
+C 47 ; WX 278 ; N slash ; B -65 -18 386 666 ;
+C 48 ; WX 500 ; N zero ; B 32 -7 497 676 ;
+C 49 ; WX 500 ; N one ; B 49 0 409 676 ;
+C 50 ; WX 500 ; N two ; B 12 0 452 676 ;
+C 51 ; WX 500 ; N three ; B 15 -7 465 676 ;
+C 52 ; WX 500 ; N four ; B 1 0 479 676 ;
+C 53 ; WX 500 ; N five ; B 15 -7 491 666 ;
+C 54 ; WX 500 ; N six ; B 30 -7 521 686 ;
+C 55 ; WX 500 ; N seven ; B 75 -8 537 666 ;
+C 56 ; WX 500 ; N eight ; B 30 -7 493 676 ;
+C 57 ; WX 500 ; N nine ; B 23 -17 492 676 ;
+C 58 ; WX 333 ; N colon ; B 50 -11 261 441 ;
+C 59 ; WX 333 ; N semicolon ; B 27 -129 261 441 ;
+C 60 ; WX 675 ; N less ; B 84 -8 592 514 ;
+C 61 ; WX 675 ; N equal ; B 86 120 590 386 ;
+C 62 ; WX 675 ; N greater ; B 84 -8 592 514 ;
+C 63 ; WX 500 ; N question ; B 132 -12 472 664 ;
+C 64 ; WX 920 ; N at ; B 118 -18 806 666 ;
+C 65 ; WX 611 ; N A ; B -51 0 564 668 ;
+C 66 ; WX 611 ; N B ; B -8 0 588 653 ;
+C 67 ; WX 667 ; N C ; B 66 -18 689 666 ;
+C 68 ; WX 722 ; N D ; B -8 0 700 653 ;
+C 69 ; WX 611 ; N E ; B -1 0 634 653 ;
+C 70 ; WX 611 ; N F ; B 8 0 645 653 ;
+C 71 ; WX 722 ; N G ; B 52 -18 722 666 ;
+C 72 ; WX 722 ; N H ; B -8 0 767 653 ;
+C 73 ; WX 333 ; N I ; B -8 0 384 653 ;
+C 74 ; WX 444 ; N J ; B -6 -18 491 653 ;
+C 75 ; WX 667 ; N K ; B 7 0 722 653 ;
+C 76 ; WX 556 ; N L ; B -8 0 559 653 ;
+C 77 ; WX 833 ; N M ; B -18 0 873 653 ;
+C 78 ; WX 667 ; N N ; B -20 -15 727 653 ;
+C 79 ; WX 722 ; N O ; B 60 -18 699 666 ;
+C 80 ; WX 611 ; N P ; B 0 0 605 653 ;
+C 81 ; WX 722 ; N Q ; B 59 -182 699 666 ;
+C 82 ; WX 611 ; N R ; B -13 0 588 653 ;
+C 83 ; WX 500 ; N S ; B 17 -18 508 667 ;
+C 84 ; WX 556 ; N T ; B 59 0 633 653 ;
+C 85 ; WX 722 ; N U ; B 102 -18 765 653 ;
+C 86 ; WX 611 ; N V ; B 76 -18 688 653 ;
+C 87 ; WX 833 ; N W ; B 71 -18 906 653 ;
+C 88 ; WX 611 ; N X ; B -29 0 655 653 ;
+C 89 ; WX 556 ; N Y ; B 78 0 633 653 ;
+C 90 ; WX 556 ; N Z ; B -6 0 606 653 ;
+C 91 ; WX 389 ; N bracketleft ; B 21 -153 391 663 ;
+C 92 ; WX 278 ; N backslash ; B -41 -18 319 666 ;
+C 93 ; WX 389 ; N bracketright ; B 12 -153 382 663 ;
+C 94 ; WX 422 ; N asciicircum ; B 0 301 422 666 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 171 436 310 666 ;
+C 97 ; WX 500 ; N a ; B 17 -11 476 441 ;
+C 98 ; WX 500 ; N b ; B 23 -11 473 683 ;
+C 99 ; WX 444 ; N c ; B 30 -11 425 441 ;
+C 100 ; WX 500 ; N d ; B 15 -13 527 683 ;
+C 101 ; WX 444 ; N e ; B 31 -11 412 441 ;
+C 102 ; WX 278 ; N f ; B -147 -207 424 678 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B 8 -206 472 441 ;
+C 104 ; WX 500 ; N h ; B 19 -9 478 683 ;
+C 105 ; WX 278 ; N i ; B 49 -11 264 654 ;
+C 106 ; WX 278 ; N j ; B -124 -207 276 654 ;
+C 107 ; WX 444 ; N k ; B 14 -11 461 683 ;
+C 108 ; WX 278 ; N l ; B 41 -11 279 683 ;
+C 109 ; WX 722 ; N m ; B 12 -9 704 441 ;
+C 110 ; WX 500 ; N n ; B 14 -9 474 441 ;
+C 111 ; WX 500 ; N o ; B 27 -11 468 441 ;
+C 112 ; WX 500 ; N p ; B -75 -205 469 441 ;
+C 113 ; WX 500 ; N q ; B 25 -209 483 441 ;
+C 114 ; WX 389 ; N r ; B 45 0 412 441 ;
+C 115 ; WX 389 ; N s ; B 16 -13 366 442 ;
+C 116 ; WX 278 ; N t ; B 37 -11 296 546 ;
+C 117 ; WX 500 ; N u ; B 42 -11 475 441 ;
+C 118 ; WX 444 ; N v ; B 21 -18 426 441 ;
+C 119 ; WX 667 ; N w ; B 16 -18 648 441 ;
+C 120 ; WX 444 ; N x ; B -27 -11 447 441 ;
+C 121 ; WX 444 ; N y ; B -24 -206 426 441 ;
+C 122 ; WX 389 ; N z ; B -2 -81 380 428 ;
+C 123 ; WX 400 ; N braceleft ; B 51 -177 407 687 ;
+C 124 ; WX 275 ; N bar ; B 105 -18 171 666 ;
+C 125 ; WX 400 ; N braceright ; B -7 -177 349 687 ;
+C 126 ; WX 541 ; N asciitilde ; B 40 183 502 323 ;
+C 161 ; WX 389 ; N exclamdown ; B 59 -205 322 473 ;
+C 162 ; WX 500 ; N cent ; B 77 -143 472 560 ;
+C 163 ; WX 500 ; N sterling ; B 10 -6 517 670 ;
+C 164 ; WX 167 ; N fraction ; B -169 -10 337 676 ;
+C 165 ; WX 500 ; N yen ; B 27 0 603 653 ;
+C 166 ; WX 500 ; N florin ; B 25 -182 507 682 ;
+C 167 ; WX 500 ; N section ; B 53 -162 461 666 ;
+C 168 ; WX 500 ; N currency ; B -22 53 522 597 ;
+C 169 ; WX 214 ; N quotesingle ; B 132 421 241 666 ;
+C 170 ; WX 556 ; N quotedblleft ; B 166 436 514 666 ;
+C 171 ; WX 500 ; N guillemotleft ; B 53 37 445 403 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 51 37 281 403 ;
+C 173 ; WX 333 ; N guilsinglright ; B 52 37 282 403 ;
+C 174 ; WX 500 ; N fi ; B -141 -207 481 681 ;
+C 175 ; WX 500 ; N fl ; B -141 -204 518 682 ;
+C 177 ; WX 500 ; N endash ; B -6 197 505 243 ;
+C 178 ; WX 500 ; N dagger ; B 101 -159 488 666 ;
+C 179 ; WX 500 ; N daggerdbl ; B 22 -143 491 666 ;
+C 180 ; WX 250 ; N periodcentered ; B 70 199 181 310 ;
+C 182 ; WX 523 ; N paragraph ; B 55 -123 616 653 ;
+C 183 ; WX 350 ; N bullet ; B 40 191 310 461 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 44 -129 183 101 ;
+C 185 ; WX 556 ; N quotedblbase ; B 57 -129 405 101 ;
+C 186 ; WX 556 ; N quotedblright ; B 151 436 499 666 ;
+C 187 ; WX 500 ; N guillemotright ; B 55 37 447 403 ;
+C 188 ; WX 889 ; N ellipsis ; B 57 -11 762 100 ;
+C 189 ; WX 1000 ; N perthousand ; B 25 -19 1010 706 ;
+C 191 ; WX 500 ; N questiondown ; B 28 -205 368 471 ;
+C 193 ; WX 333 ; N grave ; B 121 492 311 664 ;
+C 194 ; WX 333 ; N acute ; B 180 494 403 664 ;
+C 195 ; WX 333 ; N circumflex ; B 91 492 385 661 ;
+C 196 ; WX 333 ; N tilde ; B 100 517 427 624 ;
+C 197 ; WX 333 ; N macron ; B 99 532 411 583 ;
+C 198 ; WX 333 ; N breve ; B 117 492 418 650 ;
+C 199 ; WX 333 ; N dotaccent ; B 207 508 305 606 ;
+C 200 ; WX 333 ; N dieresis ; B 107 508 405 606 ;
+C 202 ; WX 333 ; N ring ; B 155 492 355 691 ;
+C 203 ; WX 333 ; N cedilla ; B -30 -217 182 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 93 494 486 664 ;
+C 206 ; WX 333 ; N ogonek ; B -20 -169 200 40 ;
+C 207 ; WX 333 ; N caron ; B 121 492 426 661 ;
+C 208 ; WX 889 ; N emdash ; B -6 197 894 243 ;
+C 225 ; WX 889 ; N AE ; B -27 0 911 653 ;
+C 227 ; WX 276 ; N ordfeminine ; B 42 406 352 676 ;
+C 232 ; WX 556 ; N Lslash ; B -8 0 559 653 ;
+C 233 ; WX 722 ; N Oslash ; B 60 -105 699 722 ;
+C 234 ; WX 944 ; N OE ; B 49 -8 964 666 ;
+C 235 ; WX 310 ; N ordmasculine ; B 67 406 362 676 ;
+C 241 ; WX 667 ; N ae ; B 23 -11 640 441 ;
+C 245 ; WX 278 ; N dotlessi ; B 49 -11 235 441 ;
+C 248 ; WX 278 ; N lslash ; B 37 -11 307 683 ;
+C 249 ; WX 500 ; N oslash ; B 28 -135 469 554 ;
+C 250 ; WX 667 ; N oe ; B 20 -12 646 441 ;
+C 251 ; WX 500 ; N germandbls ; B -168 -207 493 679 ;
+C -1 ; WX 556 ; N Zcaron ; B -6 0 606 873 ;
+C -1 ; WX 444 ; N ccedilla ; B 26 -217 425 441 ;
+C -1 ; WX 444 ; N ydieresis ; B -24 -206 441 606 ;
+C -1 ; WX 500 ; N atilde ; B 17 -11 511 624 ;
+C -1 ; WX 278 ; N icircumflex ; B 34 -11 328 661 ;
+C -1 ; WX 300 ; N threesuperior ; B 43 268 339 676 ;
+C -1 ; WX 444 ; N ecircumflex ; B 31 -11 441 661 ;
+C -1 ; WX 500 ; N thorn ; B -75 -205 469 683 ;
+C -1 ; WX 444 ; N egrave ; B 31 -11 412 664 ;
+C -1 ; WX 300 ; N twosuperior ; B 33 271 324 676 ;
+C -1 ; WX 444 ; N eacute ; B 31 -11 459 664 ;
+C -1 ; WX 500 ; N otilde ; B 27 -11 496 624 ;
+C -1 ; WX 611 ; N Aacute ; B -51 0 564 876 ;
+C -1 ; WX 500 ; N ocircumflex ; B 27 -11 468 661 ;
+C -1 ; WX 444 ; N yacute ; B -24 -206 459 664 ;
+C -1 ; WX 500 ; N udieresis ; B 42 -11 479 606 ;
+C -1 ; WX 750 ; N threequarters ; B 23 -10 736 676 ;
+C -1 ; WX 500 ; N acircumflex ; B 17 -11 476 661 ;
+C -1 ; WX 722 ; N Eth ; B -8 0 700 653 ;
+C -1 ; WX 444 ; N edieresis ; B 31 -11 451 606 ;
+C -1 ; WX 500 ; N ugrave ; B 42 -11 475 664 ;
+C -1 ; WX 980 ; N trademark ; B 30 247 957 653 ;
+C -1 ; WX 500 ; N ograve ; B 27 -11 468 664 ;
+C -1 ; WX 389 ; N scaron ; B 16 -13 454 661 ;
+C -1 ; WX 333 ; N Idieresis ; B -8 0 435 818 ;
+C -1 ; WX 500 ; N uacute ; B 42 -11 477 664 ;
+C -1 ; WX 500 ; N agrave ; B 17 -11 476 664 ;
+C -1 ; WX 500 ; N ntilde ; B 14 -9 476 624 ;
+C -1 ; WX 500 ; N aring ; B 17 -11 476 691 ;
+C -1 ; WX 389 ; N zcaron ; B -2 -81 434 661 ;
+C -1 ; WX 333 ; N Icircumflex ; B -8 0 425 873 ;
+C -1 ; WX 667 ; N Ntilde ; B -20 -15 727 836 ;
+C -1 ; WX 500 ; N ucircumflex ; B 42 -11 475 661 ;
+C -1 ; WX 611 ; N Ecircumflex ; B -1 0 634 873 ;
+C -1 ; WX 333 ; N Iacute ; B -8 0 413 876 ;
+C -1 ; WX 667 ; N Ccedilla ; B 66 -217 689 666 ;
+C -1 ; WX 722 ; N Odieresis ; B 60 -18 699 818 ;
+C -1 ; WX 500 ; N Scaron ; B 17 -18 520 873 ;
+C -1 ; WX 611 ; N Edieresis ; B -1 0 634 818 ;
+C -1 ; WX 333 ; N Igrave ; B -8 0 384 876 ;
+C -1 ; WX 500 ; N adieresis ; B 17 -11 489 606 ;
+C -1 ; WX 722 ; N Ograve ; B 60 -18 699 876 ;
+C -1 ; WX 611 ; N Egrave ; B -1 0 634 876 ;
+C -1 ; WX 556 ; N Ydieresis ; B 78 0 633 818 ;
+C -1 ; WX 760 ; N registered ; B 41 -18 719 666 ;
+C -1 ; WX 722 ; N Otilde ; B 60 -18 699 836 ;
+C -1 ; WX 750 ; N onequarter ; B 33 -10 736 676 ;
+C -1 ; WX 722 ; N Ugrave ; B 102 -18 765 876 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 102 -18 765 873 ;
+C -1 ; WX 611 ; N Thorn ; B 0 0 569 653 ;
+C -1 ; WX 675 ; N divide ; B 86 -11 590 517 ;
+C -1 ; WX 611 ; N Atilde ; B -51 0 566 836 ;
+C -1 ; WX 722 ; N Uacute ; B 102 -18 765 876 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 60 -18 699 873 ;
+C -1 ; WX 675 ; N logicalnot ; B 86 108 590 386 ;
+C -1 ; WX 611 ; N Aring ; B -51 0 564 883 ;
+C -1 ; WX 278 ; N idieresis ; B 49 -11 353 606 ;
+C -1 ; WX 278 ; N iacute ; B 49 -11 356 664 ;
+C -1 ; WX 500 ; N aacute ; B 17 -11 487 664 ;
+C -1 ; WX 675 ; N plusminus ; B 86 0 590 506 ;
+C -1 ; WX 675 ; N multiply ; B 93 8 582 497 ;
+C -1 ; WX 722 ; N Udieresis ; B 102 -18 765 818 ;
+C -1 ; WX 675 ; N minus ; B 86 220 590 286 ;
+C -1 ; WX 300 ; N onesuperior ; B 43 271 284 676 ;
+C -1 ; WX 611 ; N Eacute ; B -1 0 634 876 ;
+C -1 ; WX 611 ; N Acircumflex ; B -51 0 564 873 ;
+C -1 ; WX 760 ; N copyright ; B 41 -18 719 666 ;
+C -1 ; WX 611 ; N Agrave ; B -51 0 564 876 ;
+C -1 ; WX 500 ; N odieresis ; B 27 -11 489 606 ;
+C -1 ; WX 500 ; N oacute ; B 27 -11 487 664 ;
+C -1 ; WX 400 ; N degree ; B 101 390 387 676 ;
+C -1 ; WX 278 ; N igrave ; B 49 -11 284 664 ;
+C -1 ; WX 500 ; N mu ; B -30 -209 497 428 ;
+C -1 ; WX 722 ; N Oacute ; B 60 -18 699 876 ;
+C -1 ; WX 500 ; N eth ; B 27 -11 482 683 ;
+C -1 ; WX 611 ; N Adieresis ; B -51 0 564 818 ;
+C -1 ; WX 556 ; N Yacute ; B 78 0 633 876 ;
+C -1 ; WX 275 ; N brokenbar ; B 105 -18 171 666 ;
+C -1 ; WX 750 ; N onehalf ; B 34 -10 749 676 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 283
+
+KPX A y -55
+KPX A w -55
+KPX A v -55
+KPX A u -20
+KPX A quoteright -37
+KPX A quotedblright 0
+KPX A p 0
+KPX A Y -55
+KPX A W -95
+KPX A V -105
+KPX A U -50
+KPX A T -37
+KPX A Q -40
+KPX A O -40
+KPX A G -35
+KPX A C -30
+
+KPX B period 0
+KPX B comma 0
+KPX B U -10
+KPX B A -25
+
+KPX D period 0
+KPX D comma 0
+KPX D Y -40
+KPX D W -40
+KPX D V -40
+KPX D A -35
+
+KPX F r -55
+KPX F period -135
+KPX F o -105
+KPX F i -45
+KPX F e -75
+KPX F comma -135
+KPX F a -75
+KPX F A -115
+
+KPX G period 0
+KPX G comma 0
+
+KPX J u -35
+KPX J period -25
+KPX J o -25
+KPX J e -25
+KPX J comma -25
+KPX J a -35
+KPX J A -40
+
+KPX K y -40
+KPX K u -40
+KPX K o -40
+KPX K e -35
+KPX K O -50
+
+KPX L y -30
+KPX L quoteright -37
+KPX L quotedblright 0
+KPX L Y -20
+KPX L W -55
+KPX L V -55
+KPX L T -20
+
+KPX N period 0
+KPX N comma 0
+KPX N A -27
+
+KPX O period 0
+KPX O comma 0
+KPX O Y -50
+KPX O X -40
+KPX O W -50
+KPX O V -50
+KPX O T -40
+KPX O A -55
+
+KPX P period -135
+KPX P o -80
+KPX P e -80
+KPX P comma -135
+KPX P a -80
+KPX P A -90
+
+KPX Q period 0
+KPX Q comma 0
+KPX Q U -10
+
+KPX R Y -18
+KPX R W -18
+KPX R V -18
+KPX R U -40
+KPX R T 0
+KPX R O -40
+
+KPX S period 0
+KPX S comma 0
+
+KPX T y -74
+KPX T w -74
+KPX T u -55
+KPX T semicolon -65
+KPX T r -55
+KPX T period -74
+KPX T o -92
+KPX T i -55
+KPX T hyphen -74
+KPX T h 0
+KPX T e -92
+KPX T comma -74
+KPX T colon -55
+KPX T a -92
+KPX T O -18
+KPX T A -50
+
+KPX U period -25
+KPX U comma -25
+KPX U A -40
+
+KPX V u -74
+KPX V semicolon -74
+KPX V period -129
+KPX V o -111
+KPX V i -74
+KPX V hyphen -55
+KPX V e -111
+KPX V comma -129
+KPX V colon -65
+KPX V a -111
+KPX V O -30
+KPX V G 0
+KPX V A -60
+
+KPX W y -70
+KPX W u -55
+KPX W semicolon -65
+KPX W period -92
+KPX W o -92
+KPX W i -55
+KPX W hyphen -37
+KPX W h 0
+KPX W e -92
+KPX W comma -92
+KPX W colon -65
+KPX W a -92
+KPX W O -25
+KPX W A -60
+
+KPX Y u -92
+KPX Y semicolon -65
+KPX Y period -92
+KPX Y o -92
+KPX Y i -74
+KPX Y hyphen -74
+KPX Y e -92
+KPX Y comma -92
+KPX Y colon -65
+KPX Y a -92
+KPX Y O -15
+KPX Y A -50
+
+KPX a y 0
+KPX a w 0
+KPX a v 0
+KPX a t 0
+KPX a p 0
+KPX a g -10
+KPX a b 0
+
+KPX b y 0
+KPX b v 0
+KPX b u -20
+KPX b period -40
+KPX b l 0
+KPX b comma 0
+KPX b b 0
+
+KPX c y 0
+KPX c period 0
+KPX c l 0
+KPX c k -20
+KPX c h -15
+KPX c comma 0
+
+KPX colon space 0
+
+KPX comma space 0
+KPX comma quoteright -140
+KPX comma quotedblright -140
+
+KPX d y 0
+KPX d w 0
+KPX d v 0
+KPX d period 0
+KPX d d 0
+KPX d comma 0
+
+KPX e y -30
+KPX e x -20
+KPX e w -15
+KPX e v -15
+KPX e period -15
+KPX e p 0
+KPX e g -40
+KPX e comma -10
+KPX e b 0
+
+KPX f quoteright 92
+KPX f quotedblright 0
+KPX f period -15
+KPX f o 0
+KPX f l 0
+KPX f i -20
+KPX f f -18
+KPX f e 0
+KPX f dotlessi -60
+KPX f comma -10
+KPX f a 0
+
+KPX g y 0
+KPX g r 0
+KPX g period -15
+KPX g o 0
+KPX g i 0
+KPX g g -10
+KPX g e -10
+KPX g comma -10
+KPX g a 0
+
+KPX h y 0
+
+KPX i v 0
+
+KPX k y -10
+KPX k o -10
+KPX k e -10
+
+KPX l y 0
+KPX l w 0
+
+KPX m y 0
+KPX m u 0
+
+KPX n y 0
+KPX n v -40
+KPX n u 0
+
+KPX o y 0
+KPX o x 0
+KPX o w 0
+KPX o v -10
+KPX o g -10
+
+KPX p y 0
+
+KPX period quoteright -140
+KPX period quotedblright -140
+
+KPX quotedblleft quoteleft 0
+KPX quotedblleft A 0
+
+KPX quotedblright space 0
+
+KPX quoteleft quoteleft -111
+KPX quoteleft A 0
+
+KPX quoteright v -10
+KPX quoteright t -30
+KPX quoteright space -111
+KPX quoteright s -40
+KPX quoteright r -25
+KPX quoteright quoteright -111
+KPX quoteright quotedblright 0
+KPX quoteright l 0
+KPX quoteright d -25
+
+KPX r y 0
+KPX r v 0
+KPX r u 0
+KPX r t 0
+KPX r s -10
+KPX r r 0
+KPX r q -37
+KPX r period -111
+KPX r p 0
+KPX r o -45
+KPX r n 0
+KPX r m 0
+KPX r l 0
+KPX r k 0
+KPX r i 0
+KPX r hyphen -20
+KPX r g -37
+KPX r e -37
+KPX r d -37
+KPX r comma -111
+KPX r c -37
+KPX r a -15
+
+KPX s w 0
+
+KPX space quoteleft 0
+KPX space quotedblleft 0
+KPX space Y -75
+KPX space W -40
+KPX space V -35
+KPX space T -18
+KPX space A -18
+
+KPX v period -74
+KPX v o 0
+KPX v e 0
+KPX v comma -74
+KPX v a 0
+
+KPX w period -74
+KPX w o 0
+KPX w h 0
+KPX w e 0
+KPX w comma -74
+KPX w a 0
+
+KPX x e 0
+
+KPX y period -55
+KPX y o 0
+KPX y e 0
+KPX y comma -55
+KPX y a 0
+
+KPX z o 0
+KPX z e 0
+EndKernPairs
+EndKernData
+StartComposites 58
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 139 212 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 144 212 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 139 212 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 149 212 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 129 192 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 139 212 ;
+CC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 167 0 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 149 212 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 169 212 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 159 212 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 149 212 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 10 212 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 40 212 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 30 212 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 10 212 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 177 212 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 195 212 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 230 212 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 230 212 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 205 212 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 215 212 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 94 212 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 195 212 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 215 212 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 225 212 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 215 212 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 132 212 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 142 212 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 112 212 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 84 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 84 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 84 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 84 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 84 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 84 0 ;
+CC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 56 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 56 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 56 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis 46 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 56 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -47 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -57 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -52 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 49 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 84 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 74 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 84 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 84 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde 69 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 74 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 74 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 74 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 84 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 56 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 36 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 8 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putb8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putb8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..2eaa540d6348c955f4edc7c48e50f3e9b1067c43
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putb8a.afm
@@ -0,0 +1,1005 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Fri Jan 17 15:08:52 1992
+Comment UniqueID 37705
+Comment VMusage 33078 39970
+FontName Utopia-Bold
+FullName Utopia Bold
+FamilyName Utopia
+Weight Bold
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -155 -250 1249 916
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.002
+Notice Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.Utopia is a registered trademark of Adobe Systems Incorporated.
+EncodingScheme AdobeStandardEncoding
+CapHeight 692
+XHeight 490
+Ascender 742
+Descender -230
+StartCharMetrics 228
+C 32 ; WX 210 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 278 ; N exclam ; B 47 -12 231 707 ;
+C 34 ; WX 473 ; N quotedbl ; B 71 407 402 707 ;
+C 35 ; WX 560 ; N numbersign ; B 14 0 547 668 ;
+C 36 ; WX 560 ; N dollar ; B 38 -104 524 748 ;
+C 37 ; WX 887 ; N percent ; B 40 -31 847 701 ;
+C 38 ; WX 748 ; N ampersand ; B 45 -12 734 680 ;
+C 39 ; WX 252 ; N quoteright ; B 40 387 212 707 ;
+C 40 ; WX 365 ; N parenleft ; B 99 -135 344 699 ;
+C 41 ; WX 365 ; N parenright ; B 21 -135 266 699 ;
+C 42 ; WX 442 ; N asterisk ; B 40 315 402 707 ;
+C 43 ; WX 600 ; N plus ; B 58 0 542 490 ;
+C 44 ; WX 280 ; N comma ; B 40 -167 226 180 ;
+C 45 ; WX 392 ; N hyphen ; B 65 203 328 298 ;
+C 46 ; WX 280 ; N period ; B 48 -12 232 174 ;
+C 47 ; WX 378 ; N slash ; B 34 -15 344 707 ;
+C 48 ; WX 560 ; N zero ; B 31 -12 530 680 ;
+C 49 ; WX 560 ; N one ; B 102 0 459 680 ;
+C 50 ; WX 560 ; N two ; B 30 0 539 680 ;
+C 51 ; WX 560 ; N three ; B 27 -12 519 680 ;
+C 52 ; WX 560 ; N four ; B 19 0 533 668 ;
+C 53 ; WX 560 ; N five ; B 43 -12 519 668 ;
+C 54 ; WX 560 ; N six ; B 30 -12 537 680 ;
+C 55 ; WX 560 ; N seven ; B 34 -12 530 668 ;
+C 56 ; WX 560 ; N eight ; B 27 -12 533 680 ;
+C 57 ; WX 560 ; N nine ; B 34 -12 523 680 ;
+C 58 ; WX 280 ; N colon ; B 48 -12 232 490 ;
+C 59 ; WX 280 ; N semicolon ; B 40 -167 232 490 ;
+C 60 ; WX 600 ; N less ; B 61 5 539 493 ;
+C 61 ; WX 600 ; N equal ; B 58 103 542 397 ;
+C 62 ; WX 600 ; N greater ; B 61 5 539 493 ;
+C 63 ; WX 456 ; N question ; B 20 -12 433 707 ;
+C 64 ; WX 833 ; N at ; B 45 -15 797 707 ;
+C 65 ; WX 644 ; N A ; B -28 0 663 692 ;
+C 66 ; WX 683 ; N B ; B 33 0 645 692 ;
+C 67 ; WX 689 ; N C ; B 42 -15 654 707 ;
+C 68 ; WX 777 ; N D ; B 33 0 735 692 ;
+C 69 ; WX 629 ; N E ; B 33 0 604 692 ;
+C 70 ; WX 593 ; N F ; B 37 0 568 692 ;
+C 71 ; WX 726 ; N G ; B 42 -15 709 707 ;
+C 72 ; WX 807 ; N H ; B 33 0 774 692 ;
+C 73 ; WX 384 ; N I ; B 33 0 351 692 ;
+C 74 ; WX 386 ; N J ; B 6 -114 361 692 ;
+C 75 ; WX 707 ; N K ; B 33 -6 719 692 ;
+C 76 ; WX 585 ; N L ; B 33 0 584 692 ;
+C 77 ; WX 918 ; N M ; B 23 0 885 692 ;
+C 78 ; WX 739 ; N N ; B 25 0 719 692 ;
+C 79 ; WX 768 ; N O ; B 42 -15 726 707 ;
+C 80 ; WX 650 ; N P ; B 33 0 623 692 ;
+C 81 ; WX 768 ; N Q ; B 42 -193 726 707 ;
+C 82 ; WX 684 ; N R ; B 33 0 686 692 ;
+C 83 ; WX 561 ; N S ; B 42 -15 533 707 ;
+C 84 ; WX 624 ; N T ; B 15 0 609 692 ;
+C 85 ; WX 786 ; N U ; B 29 -15 757 692 ;
+C 86 ; WX 645 ; N V ; B -16 0 679 692 ;
+C 87 ; WX 933 ; N W ; B -10 0 960 692 ;
+C 88 ; WX 634 ; N X ; B -19 0 671 692 ;
+C 89 ; WX 617 ; N Y ; B -12 0 655 692 ;
+C 90 ; WX 614 ; N Z ; B 0 0 606 692 ;
+C 91 ; WX 335 ; N bracketleft ; B 123 -128 308 692 ;
+C 92 ; WX 379 ; N backslash ; B 34 -15 345 707 ;
+C 93 ; WX 335 ; N bracketright ; B 27 -128 212 692 ;
+C 94 ; WX 600 ; N asciicircum ; B 56 215 544 668 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 252 ; N quoteleft ; B 40 399 212 719 ;
+C 97 ; WX 544 ; N a ; B 41 -12 561 502 ;
+C 98 ; WX 605 ; N b ; B 15 -12 571 742 ;
+C 99 ; WX 494 ; N c ; B 34 -12 484 502 ;
+C 100 ; WX 605 ; N d ; B 34 -12 596 742 ;
+C 101 ; WX 519 ; N e ; B 34 -12 505 502 ;
+C 102 ; WX 342 ; N f ; B 27 0 421 742 ; L i fi ; L l fl ;
+C 103 ; WX 533 ; N g ; B 25 -242 546 512 ;
+C 104 ; WX 631 ; N h ; B 19 0 622 742 ;
+C 105 ; WX 316 ; N i ; B 26 0 307 720 ;
+C 106 ; WX 316 ; N j ; B -12 -232 260 720 ;
+C 107 ; WX 582 ; N k ; B 19 0 595 742 ;
+C 108 ; WX 309 ; N l ; B 19 0 300 742 ;
+C 109 ; WX 948 ; N m ; B 26 0 939 502 ;
+C 110 ; WX 638 ; N n ; B 26 0 629 502 ;
+C 111 ; WX 585 ; N o ; B 34 -12 551 502 ;
+C 112 ; WX 615 ; N p ; B 19 -230 581 502 ;
+C 113 ; WX 597 ; N q ; B 34 -230 596 502 ;
+C 114 ; WX 440 ; N r ; B 26 0 442 502 ;
+C 115 ; WX 446 ; N s ; B 38 -12 425 502 ;
+C 116 ; WX 370 ; N t ; B 32 -12 373 616 ;
+C 117 ; WX 629 ; N u ; B 23 -12 620 502 ;
+C 118 ; WX 520 ; N v ; B -8 0 546 490 ;
+C 119 ; WX 774 ; N w ; B -10 0 802 490 ;
+C 120 ; WX 522 ; N x ; B -15 0 550 490 ;
+C 121 ; WX 524 ; N y ; B -12 -242 557 490 ;
+C 122 ; WX 483 ; N z ; B -1 0 480 490 ;
+C 123 ; WX 365 ; N braceleft ; B 74 -128 325 692 ;
+C 124 ; WX 284 ; N bar ; B 94 -250 190 750 ;
+C 125 ; WX 365 ; N braceright ; B 40 -128 291 692 ;
+C 126 ; WX 600 ; N asciitilde ; B 50 158 551 339 ;
+C 161 ; WX 278 ; N exclamdown ; B 47 -217 231 502 ;
+C 162 ; WX 560 ; N cent ; B 39 -15 546 678 ;
+C 163 ; WX 560 ; N sterling ; B 21 0 555 679 ;
+C 164 ; WX 100 ; N fraction ; B -155 -27 255 695 ;
+C 165 ; WX 560 ; N yen ; B 3 0 562 668 ;
+C 166 ; WX 560 ; N florin ; B -40 -135 562 691 ;
+C 167 ; WX 566 ; N section ; B 35 -115 531 707 ;
+C 168 ; WX 560 ; N currency ; B 21 73 539 596 ;
+C 169 ; WX 252 ; N quotesingle ; B 57 407 196 707 ;
+C 170 ; WX 473 ; N quotedblleft ; B 40 399 433 719 ;
+C 171 ; WX 487 ; N guillemotleft ; B 40 37 452 464 ;
+C 172 ; WX 287 ; N guilsinglleft ; B 40 37 252 464 ;
+C 173 ; WX 287 ; N guilsinglright ; B 35 37 247 464 ;
+C 174 ; WX 639 ; N fi ; B 27 0 630 742 ;
+C 175 ; WX 639 ; N fl ; B 27 0 630 742 ;
+C 177 ; WX 500 ; N endash ; B 0 209 500 292 ;
+C 178 ; WX 510 ; N dagger ; B 35 -125 475 707 ;
+C 179 ; WX 486 ; N daggerdbl ; B 35 -119 451 707 ;
+C 180 ; WX 280 ; N periodcentered ; B 48 156 232 342 ;
+C 182 ; WX 552 ; N paragraph ; B 35 -101 527 692 ;
+C 183 ; WX 455 ; N bullet ; B 50 174 405 529 ;
+C 184 ; WX 252 ; N quotesinglbase ; B 40 -153 212 167 ;
+C 185 ; WX 473 ; N quotedblbase ; B 40 -153 433 167 ;
+C 186 ; WX 473 ; N quotedblright ; B 40 387 433 707 ;
+C 187 ; WX 487 ; N guillemotright ; B 35 37 447 464 ;
+C 188 ; WX 1000 ; N ellipsis ; B 75 -12 925 174 ;
+C 189 ; WX 1289 ; N perthousand ; B 40 -31 1249 701 ;
+C 191 ; WX 456 ; N questiondown ; B 23 -217 436 502 ;
+C 193 ; WX 430 ; N grave ; B 40 511 312 740 ;
+C 194 ; WX 430 ; N acute ; B 119 511 391 740 ;
+C 195 ; WX 430 ; N circumflex ; B 28 520 402 747 ;
+C 196 ; WX 430 ; N tilde ; B 2 553 427 706 ;
+C 197 ; WX 430 ; N macron ; B 60 587 371 674 ;
+C 198 ; WX 430 ; N breve ; B 56 556 375 716 ;
+C 199 ; WX 430 ; N dotaccent ; B 136 561 294 710 ;
+C 200 ; WX 430 ; N dieresis ; B 16 561 414 710 ;
+C 202 ; WX 430 ; N ring ; B 96 540 334 762 ;
+C 203 ; WX 430 ; N cedilla ; B 136 -246 335 0 ;
+C 205 ; WX 430 ; N hungarumlaut ; B 64 521 446 751 ;
+C 206 ; WX 430 ; N ogonek ; B 105 -246 325 0 ;
+C 207 ; WX 430 ; N caron ; B 28 520 402 747 ;
+C 208 ; WX 1000 ; N emdash ; B 0 209 1000 292 ;
+C 225 ; WX 879 ; N AE ; B -77 0 854 692 ;
+C 227 ; WX 405 ; N ordfeminine ; B 28 265 395 590 ;
+C 232 ; WX 591 ; N Lslash ; B 30 0 590 692 ;
+C 233 ; WX 768 ; N Oslash ; B 42 -61 726 747 ;
+C 234 ; WX 1049 ; N OE ; B 42 0 1024 692 ;
+C 235 ; WX 427 ; N ordmasculine ; B 28 265 399 590 ;
+C 241 ; WX 806 ; N ae ; B 41 -12 792 502 ;
+C 245 ; WX 316 ; N dotlessi ; B 26 0 307 502 ;
+C 248 ; WX 321 ; N lslash ; B 16 0 332 742 ;
+C 249 ; WX 585 ; N oslash ; B 34 -51 551 535 ;
+C 250 ; WX 866 ; N oe ; B 34 -12 852 502 ;
+C 251 ; WX 662 ; N germandbls ; B 29 -12 647 742 ;
+C -1 ; WX 402 ; N onesuperior ; B 71 272 324 680 ;
+C -1 ; WX 600 ; N minus ; B 58 210 542 290 ;
+C -1 ; WX 396 ; N degree ; B 35 360 361 680 ;
+C -1 ; WX 585 ; N oacute ; B 34 -12 551 755 ;
+C -1 ; WX 768 ; N Odieresis ; B 42 -15 726 881 ;
+C -1 ; WX 585 ; N odieresis ; B 34 -12 551 710 ;
+C -1 ; WX 629 ; N Eacute ; B 33 0 604 904 ;
+C -1 ; WX 629 ; N ucircumflex ; B 23 -12 620 747 ;
+C -1 ; WX 900 ; N onequarter ; B 73 -27 814 695 ;
+C -1 ; WX 600 ; N logicalnot ; B 58 95 542 397 ;
+C -1 ; WX 629 ; N Ecircumflex ; B 33 0 604 905 ;
+C -1 ; WX 900 ; N onehalf ; B 53 -27 849 695 ;
+C -1 ; WX 768 ; N Otilde ; B 42 -15 726 876 ;
+C -1 ; WX 629 ; N uacute ; B 23 -12 620 740 ;
+C -1 ; WX 519 ; N eacute ; B 34 -12 505 755 ;
+C -1 ; WX 316 ; N iacute ; B 26 0 369 740 ;
+C -1 ; WX 629 ; N Egrave ; B 33 0 604 904 ;
+C -1 ; WX 316 ; N icircumflex ; B -28 0 346 747 ;
+C -1 ; WX 629 ; N mu ; B 23 -242 620 502 ;
+C -1 ; WX 284 ; N brokenbar ; B 94 -175 190 675 ;
+C -1 ; WX 609 ; N thorn ; B 13 -230 575 722 ;
+C -1 ; WX 644 ; N Aring ; B -28 0 663 872 ;
+C -1 ; WX 524 ; N yacute ; B -12 -242 557 740 ;
+C -1 ; WX 617 ; N Ydieresis ; B -12 0 655 881 ;
+C -1 ; WX 1090 ; N trademark ; B 38 277 1028 692 ;
+C -1 ; WX 800 ; N registered ; B 36 -15 764 707 ;
+C -1 ; WX 585 ; N ocircumflex ; B 34 -12 551 747 ;
+C -1 ; WX 644 ; N Agrave ; B -28 0 663 904 ;
+C -1 ; WX 561 ; N Scaron ; B 42 -15 533 916 ;
+C -1 ; WX 786 ; N Ugrave ; B 29 -15 757 904 ;
+C -1 ; WX 629 ; N Edieresis ; B 33 0 604 881 ;
+C -1 ; WX 786 ; N Uacute ; B 29 -15 757 904 ;
+C -1 ; WX 585 ; N otilde ; B 34 -12 551 706 ;
+C -1 ; WX 638 ; N ntilde ; B 26 0 629 706 ;
+C -1 ; WX 524 ; N ydieresis ; B -12 -242 557 710 ;
+C -1 ; WX 644 ; N Aacute ; B -28 0 663 904 ;
+C -1 ; WX 585 ; N eth ; B 34 -12 551 742 ;
+C -1 ; WX 544 ; N acircumflex ; B 41 -12 561 747 ;
+C -1 ; WX 544 ; N aring ; B 41 -12 561 762 ;
+C -1 ; WX 768 ; N Ograve ; B 42 -15 726 904 ;
+C -1 ; WX 494 ; N ccedilla ; B 34 -246 484 502 ;
+C -1 ; WX 600 ; N multiply ; B 75 20 525 476 ;
+C -1 ; WX 600 ; N divide ; B 58 6 542 494 ;
+C -1 ; WX 402 ; N twosuperior ; B 29 272 382 680 ;
+C -1 ; WX 739 ; N Ntilde ; B 25 0 719 876 ;
+C -1 ; WX 629 ; N ugrave ; B 23 -12 620 740 ;
+C -1 ; WX 786 ; N Ucircumflex ; B 29 -15 757 905 ;
+C -1 ; WX 644 ; N Atilde ; B -28 0 663 876 ;
+C -1 ; WX 483 ; N zcaron ; B -1 0 480 747 ;
+C -1 ; WX 316 ; N idieresis ; B -37 0 361 710 ;
+C -1 ; WX 644 ; N Acircumflex ; B -28 0 663 905 ;
+C -1 ; WX 384 ; N Icircumflex ; B 4 0 380 905 ;
+C -1 ; WX 617 ; N Yacute ; B -12 0 655 904 ;
+C -1 ; WX 768 ; N Oacute ; B 42 -15 726 904 ;
+C -1 ; WX 644 ; N Adieresis ; B -28 0 663 881 ;
+C -1 ; WX 614 ; N Zcaron ; B 0 0 606 916 ;
+C -1 ; WX 544 ; N agrave ; B 41 -12 561 755 ;
+C -1 ; WX 402 ; N threesuperior ; B 30 265 368 680 ;
+C -1 ; WX 585 ; N ograve ; B 34 -12 551 755 ;
+C -1 ; WX 900 ; N threequarters ; B 40 -27 842 695 ;
+C -1 ; WX 783 ; N Eth ; B 35 0 741 692 ;
+C -1 ; WX 600 ; N plusminus ; B 58 0 542 549 ;
+C -1 ; WX 629 ; N udieresis ; B 23 -12 620 710 ;
+C -1 ; WX 519 ; N edieresis ; B 34 -12 505 710 ;
+C -1 ; WX 544 ; N aacute ; B 41 -12 561 755 ;
+C -1 ; WX 316 ; N igrave ; B -47 0 307 740 ;
+C -1 ; WX 384 ; N Idieresis ; B -13 0 397 881 ;
+C -1 ; WX 544 ; N adieresis ; B 41 -12 561 710 ;
+C -1 ; WX 384 ; N Iacute ; B 33 0 423 904 ;
+C -1 ; WX 800 ; N copyright ; B 36 -15 764 707 ;
+C -1 ; WX 384 ; N Igrave ; B -31 0 351 904 ;
+C -1 ; WX 689 ; N Ccedilla ; B 42 -246 654 707 ;
+C -1 ; WX 446 ; N scaron ; B 38 -12 425 747 ;
+C -1 ; WX 519 ; N egrave ; B 34 -12 505 755 ;
+C -1 ; WX 768 ; N Ocircumflex ; B 42 -15 726 905 ;
+C -1 ; WX 640 ; N Thorn ; B 33 0 622 692 ;
+C -1 ; WX 544 ; N atilde ; B 41 -12 561 706 ;
+C -1 ; WX 786 ; N Udieresis ; B 29 -15 757 881 ;
+C -1 ; WX 519 ; N ecircumflex ; B 34 -12 505 747 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 685
+
+KPX A z 25
+KPX A y -40
+KPX A w -42
+KPX A v -48
+KPX A u -18
+KPX A t -12
+KPX A s 6
+KPX A quoteright -110
+KPX A quotedblright -80
+KPX A q -6
+KPX A p -18
+KPX A o -12
+KPX A e -6
+KPX A d -12
+KPX A c -12
+KPX A b -12
+KPX A a -6
+KPX A Y -64
+KPX A X -18
+KPX A W -54
+KPX A V -70
+KPX A U -40
+KPX A T -58
+KPX A Q -18
+KPX A O -18
+KPX A G -18
+KPX A C -18
+
+KPX B y -18
+KPX B u -12
+KPX B r -12
+KPX B o -6
+KPX B l -15
+KPX B k -15
+KPX B i -12
+KPX B h -15
+KPX B e -6
+KPX B b -10
+KPX B a -12
+KPX B W -20
+KPX B V -20
+KPX B U -25
+KPX B T -20
+
+KPX C z -5
+KPX C y -24
+KPX C u -18
+KPX C r -6
+KPX C o -12
+KPX C e -12
+KPX C a -16
+KPX C Q -6
+KPX C O -6
+KPX C G -6
+KPX C C -6
+
+KPX D u -12
+KPX D r -12
+KPX D period -40
+KPX D o -5
+KPX D i -12
+KPX D h -18
+KPX D e -5
+KPX D comma -40
+KPX D a -15
+KPX D Y -60
+KPX D W -40
+KPX D V -40
+
+KPX E y -30
+KPX E w -24
+KPX E v -24
+KPX E u -12
+KPX E t -18
+KPX E s -12
+KPX E r -4
+KPX E q -6
+KPX E period 10
+KPX E p -18
+KPX E o -6
+KPX E n -4
+KPX E m -4
+KPX E j -6
+KPX E i -6
+KPX E g -6
+KPX E e -6
+KPX E d -6
+KPX E comma 10
+KPX E c -6
+KPX E b -5
+KPX E a -4
+KPX E Y -6
+KPX E W -6
+KPX E V -6
+
+KPX F y -18
+KPX F u -12
+KPX F r -36
+KPX F quoteright 20
+KPX F quotedblright 20
+KPX F period -150
+KPX F o -36
+KPX F l -12
+KPX F i -22
+KPX F e -36
+KPX F comma -150
+KPX F a -48
+KPX F A -60
+
+KPX G y -12
+KPX G u -12
+KPX G r -18
+KPX G quotedblright -20
+KPX G n -18
+KPX G l -6
+KPX G i -12
+KPX G h -12
+KPX G a -12
+
+KPX H y -24
+KPX H u -26
+KPX H o -30
+KPX H i -18
+KPX H e -30
+KPX H a -25
+
+KPX I z -6
+KPX I y -6
+KPX I x -6
+KPX I w -18
+KPX I v -24
+KPX I u -26
+KPX I t -24
+KPX I s -18
+KPX I r -12
+KPX I p -26
+KPX I o -30
+KPX I n -18
+KPX I m -18
+KPX I l -6
+KPX I k -6
+KPX I h -6
+KPX I g -6
+KPX I f -6
+KPX I e -30
+KPX I d -30
+KPX I c -30
+KPX I b -6
+KPX I a -24
+
+KPX J y -20
+KPX J u -36
+KPX J o -35
+KPX J i -20
+KPX J e -35
+KPX J bracketright 15
+KPX J braceright 15
+KPX J a -36
+
+KPX K y -70
+KPX K w -60
+KPX K v -80
+KPX K u -42
+KPX K o -30
+KPX K l 10
+KPX K i 6
+KPX K h 10
+KPX K e -18
+KPX K a -6
+KPX K Q -36
+KPX K O -36
+KPX K G -36
+KPX K C -36
+KPX K A 20
+
+KPX L y -52
+KPX L w -58
+KPX L u -12
+KPX L quoteright -130
+KPX L quotedblright -130
+KPX L l 6
+KPX L j -6
+KPX L Y -70
+KPX L W -78
+KPX L V -95
+KPX L U -32
+KPX L T -80
+KPX L Q -12
+KPX L O -12
+KPX L G -12
+KPX L C -12
+KPX L A 30
+
+KPX M y -24
+KPX M u -36
+KPX M o -30
+KPX M n -6
+KPX M j -12
+KPX M i -12
+KPX M e -30
+KPX M d -30
+KPX M c -30
+KPX M a -25
+
+KPX N y -24
+KPX N u -30
+KPX N o -30
+KPX N i -24
+KPX N e -30
+KPX N a -30
+
+KPX O z -6
+KPX O u -6
+KPX O t -6
+KPX O s -6
+KPX O r -10
+KPX O q -6
+KPX O period -40
+KPX O p -10
+KPX O o -6
+KPX O n -10
+KPX O m -10
+KPX O l -15
+KPX O k -15
+KPX O i -6
+KPX O h -15
+KPX O g -6
+KPX O e -6
+KPX O d -6
+KPX O comma -40
+KPX O c -6
+KPX O b -15
+KPX O a -12
+KPX O Y -50
+KPX O X -40
+KPX O W -35
+KPX O V -35
+KPX O T -40
+KPX O A -30
+
+KPX P y 10
+KPX P u -18
+KPX P t -6
+KPX P s -30
+KPX P r -12
+KPX P quoteright 20
+KPX P quotedblright 20
+KPX P period -200
+KPX P o -36
+KPX P n -12
+KPX P l -15
+KPX P i -6
+KPX P hyphen -30
+KPX P h -15
+KPX P e -36
+KPX P comma -200
+KPX P a -36
+KPX P I -20
+KPX P H -20
+KPX P E -20
+KPX P A -85
+
+KPX Q u -6
+KPX Q a -18
+KPX Q Y -50
+KPX Q X -40
+KPX Q W -35
+KPX Q V -35
+KPX Q U -25
+KPX Q T -40
+KPX Q A -30
+
+KPX R y -20
+KPX R u -12
+KPX R t -25
+KPX R quoteright -10
+KPX R quotedblright -10
+KPX R o -12
+KPX R e -18
+KPX R a -6
+KPX R Y -32
+KPX R X 20
+KPX R W -18
+KPX R V -26
+KPX R U -30
+KPX R T -20
+KPX R Q -10
+KPX R O -10
+KPX R G -10
+KPX R C -10
+
+KPX S y -35
+KPX S w -30
+KPX S v -40
+KPX S u -24
+KPX S t -24
+KPX S r -10
+KPX S quoteright -15
+KPX S quotedblright -15
+KPX S p -24
+KPX S n -24
+KPX S m -24
+KPX S l -18
+KPX S k -24
+KPX S j -30
+KPX S i -12
+KPX S h -12
+KPX S a -18
+
+KPX T z -64
+KPX T y -74
+KPX T w -72
+KPX T u -74
+KPX T semicolon -50
+KPX T s -82
+KPX T r -74
+KPX T quoteright 24
+KPX T quotedblright 24
+KPX T period -95
+KPX T parenright 40
+KPX T o -90
+KPX T m -72
+KPX T i -28
+KPX T hyphen -110
+KPX T endash -40
+KPX T emdash -60
+KPX T e -80
+KPX T comma -95
+KPX T bracketright 40
+KPX T braceright 30
+KPX T a -90
+KPX T Y 12
+KPX T X 10
+KPX T W 15
+KPX T V 6
+KPX T T 30
+KPX T S -12
+KPX T Q -25
+KPX T O -25
+KPX T G -25
+KPX T C -25
+KPX T A -52
+
+KPX U z -35
+KPX U y -30
+KPX U x -30
+KPX U v -30
+KPX U t -36
+KPX U s -45
+KPX U r -50
+KPX U p -50
+KPX U n -50
+KPX U m -50
+KPX U l -12
+KPX U k -12
+KPX U i -22
+KPX U h -6
+KPX U g -40
+KPX U f -20
+KPX U d -40
+KPX U c -40
+KPX U b -12
+KPX U a -50
+KPX U A -50
+
+KPX V y -36
+KPX V u -50
+KPX V semicolon -45
+KPX V r -75
+KPX V quoteright 50
+KPX V quotedblright 36
+KPX V period -135
+KPX V parenright 80
+KPX V o -70
+KPX V i 20
+KPX V hyphen -90
+KPX V emdash -20
+KPX V e -70
+KPX V comma -135
+KPX V colon -45
+KPX V bracketright 80
+KPX V braceright 80
+KPX V a -70
+KPX V Q -20
+KPX V O -20
+KPX V G -20
+KPX V C -20
+KPX V A -60
+
+KPX W y -50
+KPX W u -46
+KPX W t -30
+KPX W semicolon -40
+KPX W r -50
+KPX W quoteright 40
+KPX W quotedblright 24
+KPX W period -100
+KPX W parenright 80
+KPX W o -60
+KPX W m -50
+KPX W i 5
+KPX W hyphen -70
+KPX W h 20
+KPX W e -60
+KPX W d -60
+KPX W comma -100
+KPX W colon -40
+KPX W bracketright 80
+KPX W braceright 70
+KPX W a -75
+KPX W T 30
+KPX W Q -20
+KPX W O -20
+KPX W G -20
+KPX W C -20
+KPX W A -58
+
+KPX X y -40
+KPX X u -24
+KPX X quoteright 15
+KPX X e -6
+KPX X a -6
+KPX X Q -24
+KPX X O -30
+KPX X G -30
+KPX X C -30
+KPX X A 20
+
+KPX Y v -50
+KPX Y u -65
+KPX Y t -46
+KPX Y semicolon -37
+KPX Y quoteright 50
+KPX Y quotedblright 36
+KPX Y q -100
+KPX Y period -90
+KPX Y parenright 60
+KPX Y o -90
+KPX Y l 25
+KPX Y i 15
+KPX Y hyphen -100
+KPX Y endash -30
+KPX Y emdash -50
+KPX Y e -90
+KPX Y d -90
+KPX Y comma -90
+KPX Y colon -60
+KPX Y bracketright 80
+KPX Y braceright 64
+KPX Y a -80
+KPX Y Y 12
+KPX Y X 12
+KPX Y W 12
+KPX Y V 12
+KPX Y T 30
+KPX Y Q -40
+KPX Y O -40
+KPX Y G -40
+KPX Y C -40
+KPX Y A -55
+
+KPX Z y -36
+KPX Z w -36
+KPX Z u -6
+KPX Z o -12
+KPX Z i -12
+KPX Z e -6
+KPX Z a -6
+KPX Z Q -18
+KPX Z O -18
+KPX Z G -18
+KPX Z C -18
+KPX Z A 25
+
+KPX a quoteright -45
+KPX a quotedblright -40
+
+KPX b y -15
+KPX b w -20
+KPX b v -20
+KPX b quoteright -45
+KPX b quotedblright -40
+KPX b period -10
+KPX b comma -10
+
+KPX braceleft Y 64
+KPX braceleft W 64
+KPX braceleft V 64
+KPX braceleft T 25
+KPX braceleft J 50
+
+KPX bracketleft Y 64
+KPX bracketleft W 64
+KPX bracketleft V 64
+KPX bracketleft T 35
+KPX bracketleft J 60
+
+KPX c quoteright -5
+
+KPX colon space -20
+
+KPX comma space -40
+KPX comma quoteright -100
+KPX comma quotedblright -100
+
+KPX d quoteright -24
+KPX d quotedblright -24
+
+KPX e z -4
+KPX e quoteright -25
+KPX e quotedblright -20
+
+KPX f quotesingle 70
+KPX f quoteright 68
+KPX f quotedblright 68
+KPX f period -10
+KPX f parenright 110
+KPX f comma -20
+KPX f bracketright 100
+KPX f braceright 80
+
+KPX g y 20
+KPX g p 20
+KPX g f 20
+KPX g comma 10
+
+KPX h quoteright -60
+KPX h quotedblright -60
+
+KPX i quoteright -20
+KPX i quotedblright -20
+
+KPX j quoteright -20
+KPX j quotedblright -20
+KPX j period -10
+KPX j comma -10
+
+KPX k quoteright -30
+KPX k quotedblright -30
+
+KPX l quoteright -24
+KPX l quotedblright -24
+
+KPX m quoteright -60
+KPX m quotedblright -60
+
+KPX n quoteright -60
+KPX n quotedblright -60
+
+KPX o z -12
+KPX o y -25
+KPX o x -18
+KPX o w -30
+KPX o v -30
+KPX o quoteright -45
+KPX o quotedblright -40
+KPX o period -10
+KPX o comma -10
+
+KPX p z -10
+KPX p y -15
+KPX p w -15
+KPX p quoteright -45
+KPX p quotedblright -60
+KPX p period -10
+KPX p comma -10
+
+KPX parenleft Y 64
+KPX parenleft W 64
+KPX parenleft V 64
+KPX parenleft T 50
+KPX parenleft J 50
+
+KPX period space -40
+KPX period quoteright -100
+KPX period quotedblright -100
+
+KPX q quoteright -50
+KPX q quotedblright -50
+KPX q period -10
+KPX q comma -10
+
+KPX quotedblleft z -26
+KPX quotedblleft w 10
+KPX quotedblleft u -40
+KPX quotedblleft t -40
+KPX quotedblleft s -32
+KPX quotedblleft r -40
+KPX quotedblleft q -70
+KPX quotedblleft p -40
+KPX quotedblleft o -70
+KPX quotedblleft n -40
+KPX quotedblleft m -40
+KPX quotedblleft g -50
+KPX quotedblleft f -30
+KPX quotedblleft e -70
+KPX quotedblleft d -70
+KPX quotedblleft c -70
+KPX quotedblleft a -60
+KPX quotedblleft Y 30
+KPX quotedblleft X 20
+KPX quotedblleft W 40
+KPX quotedblleft V 40
+KPX quotedblleft T 18
+KPX quotedblleft J -24
+KPX quotedblleft A -122
+
+KPX quotedblright space -40
+KPX quotedblright period -100
+KPX quotedblright comma -100
+
+KPX quoteleft z -26
+KPX quoteleft y -5
+KPX quoteleft x -5
+KPX quoteleft w 5
+KPX quoteleft v -5
+KPX quoteleft u -25
+KPX quoteleft t -25
+KPX quoteleft s -40
+KPX quoteleft r -40
+KPX quoteleft quoteleft -30
+KPX quoteleft q -70
+KPX quoteleft p -40
+KPX quoteleft o -70
+KPX quoteleft n -40
+KPX quoteleft m -40
+KPX quoteleft g -50
+KPX quoteleft f -10
+KPX quoteleft e -70
+KPX quoteleft d -70
+KPX quoteleft c -70
+KPX quoteleft a -60
+KPX quoteleft Y 35
+KPX quoteleft X 30
+KPX quoteleft W 35
+KPX quoteleft V 35
+KPX quoteleft T 35
+KPX quoteleft J -24
+KPX quoteleft A -122
+
+KPX quoteright v -20
+KPX quoteright t -50
+KPX quoteright space -40
+KPX quoteright s -70
+KPX quoteright r -42
+KPX quoteright quoteright -30
+KPX quoteright period -100
+KPX quoteright m -42
+KPX quoteright l -6
+KPX quoteright d -100
+KPX quoteright comma -100
+
+KPX r z 20
+KPX r y 18
+KPX r x 12
+KPX r w 30
+KPX r v 30
+KPX r u 8
+KPX r t 8
+KPX r semicolon 20
+KPX r quoteright -20
+KPX r quotedblright -10
+KPX r q -6
+KPX r period -60
+KPX r o -6
+KPX r n 8
+KPX r m 8
+KPX r l -10
+KPX r k -10
+KPX r i 8
+KPX r hyphen -60
+KPX r h -10
+KPX r g 5
+KPX r f 8
+KPX r emdash -20
+KPX r e -20
+KPX r d -20
+KPX r comma -80
+KPX r colon 20
+KPX r c -20
+
+KPX s quoteright -40
+KPX s quotedblright -40
+
+KPX semicolon space -20
+
+KPX space quotesinglbase -100
+KPX space quoteleft -40
+KPX space quotedblleft -40
+KPX space quotedblbase -100
+KPX space Y -60
+KPX space W -60
+KPX space V -60
+KPX space T -40
+
+KPX t period 15
+KPX t comma 10
+
+KPX u quoteright -60
+KPX u quotedblright -60
+
+KPX v semicolon 20
+KPX v quoteright 5
+KPX v quotedblright 10
+KPX v q -15
+KPX v period -75
+KPX v o -15
+KPX v e -15
+KPX v d -15
+KPX v comma -90
+KPX v colon 20
+KPX v c -15
+KPX v a -15
+
+KPX w semicolon 20
+KPX w quoteright 15
+KPX w quotedblright 20
+KPX w q -10
+KPX w period -60
+KPX w o -10
+KPX w e -10
+KPX w d -10
+KPX w comma -68
+KPX w colon 20
+KPX w c -10
+
+KPX x quoteright -25
+KPX x quotedblright -20
+KPX x q -6
+KPX x o -6
+KPX x e -12
+KPX x d -12
+KPX x c -12
+
+KPX y semicolon 20
+KPX y quoteright 5
+KPX y quotedblright 10
+KPX y period -72
+KPX y hyphen -20
+KPX y comma -72
+KPX y colon 20
+
+KPX z quoteright -20
+KPX z quotedblright -20
+KPX z o -6
+KPX z e -6
+KPX z d -6
+KPX z c -6
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putbi8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putbi8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..5e8384852c5a58dc0afe2c496c37649e3495e085
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putbi8a.afm
@@ -0,0 +1,1017 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Fri Jan 17 15:47:44 1992
+Comment UniqueID 37716
+Comment VMusage 34427 41319
+FontName Utopia-BoldItalic
+FullName Utopia Bold Italic
+FamilyName Utopia
+Weight Bold
+ItalicAngle -13
+IsFixedPitch false
+FontBBox -176 -250 1262 916
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.002
+Notice Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.Utopia is a registered trademark of Adobe Systems Incorporated.
+EncodingScheme AdobeStandardEncoding
+CapHeight 692
+XHeight 502
+Ascender 742
+Descender -242
+StartCharMetrics 228
+C 32 ; WX 210 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 285 ; N exclam ; B 35 -12 336 707 ;
+C 34 ; WX 455 ; N quotedbl ; B 142 407 496 707 ;
+C 35 ; WX 560 ; N numbersign ; B 37 0 606 668 ;
+C 36 ; WX 560 ; N dollar ; B 32 -104 588 748 ;
+C 37 ; WX 896 ; N percent ; B 106 -31 861 702 ;
+C 38 ; WX 752 ; N ampersand ; B 62 -12 736 680 ;
+C 39 ; WX 246 ; N quoteright ; B 95 387 294 707 ;
+C 40 ; WX 350 ; N parenleft ; B 87 -135 438 699 ;
+C 41 ; WX 350 ; N parenright ; B -32 -135 319 699 ;
+C 42 ; WX 500 ; N asterisk ; B 121 315 528 707 ;
+C 43 ; WX 600 ; N plus ; B 83 0 567 490 ;
+C 44 ; WX 280 ; N comma ; B -9 -167 207 180 ;
+C 45 ; WX 392 ; N hyphen ; B 71 203 354 298 ;
+C 46 ; WX 280 ; N period ; B 32 -12 212 166 ;
+C 47 ; WX 260 ; N slash ; B -16 -15 370 707 ;
+C 48 ; WX 560 ; N zero ; B 57 -12 583 680 ;
+C 49 ; WX 560 ; N one ; B 72 0 470 680 ;
+C 50 ; WX 560 ; N two ; B 4 0 578 680 ;
+C 51 ; WX 560 ; N three ; B 21 -12 567 680 ;
+C 52 ; WX 560 ; N four ; B 28 0 557 668 ;
+C 53 ; WX 560 ; N five ; B 23 -12 593 668 ;
+C 54 ; WX 560 ; N six ; B 56 -12 586 680 ;
+C 55 ; WX 560 ; N seven ; B 112 -12 632 668 ;
+C 56 ; WX 560 ; N eight ; B 37 -12 584 680 ;
+C 57 ; WX 560 ; N nine ; B 48 -12 570 680 ;
+C 58 ; WX 280 ; N colon ; B 32 -12 280 490 ;
+C 59 ; WX 280 ; N semicolon ; B -9 -167 280 490 ;
+C 60 ; WX 600 ; N less ; B 66 5 544 495 ;
+C 61 ; WX 600 ; N equal ; B 83 103 567 397 ;
+C 62 ; WX 600 ; N greater ; B 86 5 564 495 ;
+C 63 ; WX 454 ; N question ; B 115 -12 515 707 ;
+C 64 ; WX 828 ; N at ; B 90 -15 842 707 ;
+C 65 ; WX 634 ; N A ; B -59 0 639 692 ;
+C 66 ; WX 680 ; N B ; B 5 0 689 692 ;
+C 67 ; WX 672 ; N C ; B 76 -15 742 707 ;
+C 68 ; WX 774 ; N D ; B 5 0 784 692 ;
+C 69 ; WX 622 ; N E ; B 5 0 687 692 ;
+C 70 ; WX 585 ; N F ; B 5 0 683 692 ;
+C 71 ; WX 726 ; N G ; B 76 -15 756 707 ;
+C 72 ; WX 800 ; N H ; B 5 0 880 692 ;
+C 73 ; WX 386 ; N I ; B 5 0 466 692 ;
+C 74 ; WX 388 ; N J ; B -50 -114 477 692 ;
+C 75 ; WX 688 ; N K ; B 5 -6 823 692 ;
+C 76 ; WX 586 ; N L ; B 5 0 591 692 ;
+C 77 ; WX 921 ; N M ; B 0 0 998 692 ;
+C 78 ; WX 741 ; N N ; B -5 0 838 692 ;
+C 79 ; WX 761 ; N O ; B 78 -15 768 707 ;
+C 80 ; WX 660 ; N P ; B 5 0 694 692 ;
+C 81 ; WX 761 ; N Q ; B 78 -193 768 707 ;
+C 82 ; WX 681 ; N R ; B 5 0 696 692 ;
+C 83 ; WX 551 ; N S ; B 31 -15 570 707 ;
+C 84 ; WX 616 ; N T ; B 91 0 722 692 ;
+C 85 ; WX 776 ; N U ; B 115 -15 867 692 ;
+C 86 ; WX 630 ; N V ; B 92 0 783 692 ;
+C 87 ; WX 920 ; N W ; B 80 0 1062 692 ;
+C 88 ; WX 630 ; N X ; B -56 0 744 692 ;
+C 89 ; WX 622 ; N Y ; B 92 0 765 692 ;
+C 90 ; WX 618 ; N Z ; B -30 0 714 692 ;
+C 91 ; WX 350 ; N bracketleft ; B 56 -128 428 692 ;
+C 92 ; WX 460 ; N backslash ; B 114 -15 425 707 ;
+C 93 ; WX 350 ; N bracketright ; B -22 -128 350 692 ;
+C 94 ; WX 600 ; N asciicircum ; B 79 215 567 668 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 246 ; N quoteleft ; B 114 399 313 719 ;
+C 97 ; WX 596 ; N a ; B 26 -12 612 502 ;
+C 98 ; WX 586 ; N b ; B 34 -12 592 742 ;
+C 99 ; WX 456 ; N c ; B 38 -12 498 502 ;
+C 100 ; WX 609 ; N d ; B 29 -12 651 742 ;
+C 101 ; WX 476 ; N e ; B 38 -12 497 502 ;
+C 102 ; WX 348 ; N f ; B -129 -242 553 742 ; L i fi ; L l fl ;
+C 103 ; WX 522 ; N g ; B -14 -242 609 512 ;
+C 104 ; WX 629 ; N h ; B 44 -12 631 742 ;
+C 105 ; WX 339 ; N i ; B 66 -12 357 720 ;
+C 106 ; WX 333 ; N j ; B -120 -242 364 720 ;
+C 107 ; WX 570 ; N k ; B 39 -12 604 742 ;
+C 108 ; WX 327 ; N l ; B 62 -12 360 742 ;
+C 109 ; WX 914 ; N m ; B 46 -12 917 502 ;
+C 110 ; WX 635 ; N n ; B 45 -12 639 502 ;
+C 111 ; WX 562 ; N o ; B 42 -12 556 502 ;
+C 112 ; WX 606 ; N p ; B 0 -242 613 502 ;
+C 113 ; WX 584 ; N q ; B 29 -242 604 513 ;
+C 114 ; WX 440 ; N r ; B 51 -12 497 502 ;
+C 115 ; WX 417 ; N s ; B 10 -12 432 502 ;
+C 116 ; WX 359 ; N t ; B 68 -12 428 641 ;
+C 117 ; WX 634 ; N u ; B 71 -12 643 502 ;
+C 118 ; WX 518 ; N v ; B 68 -12 547 502 ;
+C 119 ; WX 795 ; N w ; B 70 -12 826 502 ;
+C 120 ; WX 516 ; N x ; B -26 -12 546 502 ;
+C 121 ; WX 489 ; N y ; B -49 -242 532 502 ;
+C 122 ; WX 466 ; N z ; B -17 -12 506 490 ;
+C 123 ; WX 340 ; N braceleft ; B 90 -128 439 692 ;
+C 124 ; WX 265 ; N bar ; B 117 -250 221 750 ;
+C 125 ; WX 340 ; N braceright ; B -42 -128 307 692 ;
+C 126 ; WX 600 ; N asciitilde ; B 70 157 571 338 ;
+C 161 ; WX 285 ; N exclamdown ; B -13 -217 288 502 ;
+C 162 ; WX 560 ; N cent ; B 80 -21 611 668 ;
+C 163 ; WX 560 ; N sterling ; B -4 0 583 679 ;
+C 164 ; WX 100 ; N fraction ; B -176 -27 370 695 ;
+C 165 ; WX 560 ; N yen ; B 65 0 676 668 ;
+C 166 ; WX 560 ; N florin ; B -16 -135 635 691 ;
+C 167 ; WX 568 ; N section ; B 64 -115 559 707 ;
+C 168 ; WX 560 ; N currency ; B 60 73 578 596 ;
+C 169 ; WX 246 ; N quotesingle ; B 134 376 285 707 ;
+C 170 ; WX 455 ; N quotedblleft ; B 114 399 522 719 ;
+C 171 ; WX 560 ; N guillemotleft ; B 90 37 533 464 ;
+C 172 ; WX 360 ; N guilsinglleft ; B 90 37 333 464 ;
+C 173 ; WX 360 ; N guilsinglright ; B 58 37 301 464 ;
+C 174 ; WX 651 ; N fi ; B -129 -242 655 742 ;
+C 175 ; WX 652 ; N fl ; B -129 -242 685 742 ;
+C 177 ; WX 500 ; N endash ; B 12 209 531 292 ;
+C 178 ; WX 514 ; N dagger ; B 101 -125 545 707 ;
+C 179 ; WX 490 ; N daggerdbl ; B 32 -119 528 707 ;
+C 180 ; WX 280 ; N periodcentered ; B 67 161 247 339 ;
+C 182 ; WX 580 ; N paragraph ; B 110 -101 653 692 ;
+C 183 ; WX 465 ; N bullet ; B 99 174 454 529 ;
+C 184 ; WX 246 ; N quotesinglbase ; B -17 -153 182 167 ;
+C 185 ; WX 455 ; N quotedblbase ; B -17 -153 391 167 ;
+C 186 ; WX 455 ; N quotedblright ; B 95 387 503 707 ;
+C 187 ; WX 560 ; N guillemotright ; B 58 37 502 464 ;
+C 188 ; WX 1000 ; N ellipsis ; B 85 -12 931 166 ;
+C 189 ; WX 1297 ; N perthousand ; B 106 -31 1262 702 ;
+C 191 ; WX 454 ; N questiondown ; B -10 -217 391 502 ;
+C 193 ; WX 400 ; N grave ; B 109 511 381 740 ;
+C 194 ; WX 400 ; N acute ; B 186 511 458 740 ;
+C 195 ; WX 400 ; N circumflex ; B 93 520 471 747 ;
+C 196 ; WX 400 ; N tilde ; B 94 549 502 697 ;
+C 197 ; WX 400 ; N macron ; B 133 592 459 664 ;
+C 198 ; WX 400 ; N breve ; B 146 556 469 714 ;
+C 199 ; WX 402 ; N dotaccent ; B 220 561 378 710 ;
+C 200 ; WX 400 ; N dieresis ; B 106 561 504 710 ;
+C 202 ; WX 400 ; N ring ; B 166 529 423 762 ;
+C 203 ; WX 400 ; N cedilla ; B 85 -246 292 0 ;
+C 205 ; WX 400 ; N hungarumlaut ; B 158 546 482 750 ;
+C 206 ; WX 350 ; N ogonek ; B 38 -246 253 0 ;
+C 207 ; WX 400 ; N caron ; B 130 520 508 747 ;
+C 208 ; WX 1000 ; N emdash ; B 12 209 1031 292 ;
+C 225 ; WX 890 ; N AE ; B -107 0 958 692 ;
+C 227 ; WX 444 ; N ordfeminine ; B 62 265 482 590 ;
+C 232 ; WX 592 ; N Lslash ; B 11 0 597 692 ;
+C 233 ; WX 761 ; N Oslash ; B 77 -51 769 734 ;
+C 234 ; WX 1016 ; N OE ; B 76 0 1084 692 ;
+C 235 ; WX 412 ; N ordmasculine ; B 86 265 446 590 ;
+C 241 ; WX 789 ; N ae ; B 26 -12 810 509 ;
+C 245 ; WX 339 ; N dotlessi ; B 66 -12 343 502 ;
+C 248 ; WX 339 ; N lslash ; B 18 -12 420 742 ;
+C 249 ; WX 562 ; N oslash ; B 42 -69 556 549 ;
+C 250 ; WX 811 ; N oe ; B 42 -12 832 502 ;
+C 251 ; WX 628 ; N germandbls ; B -129 -242 692 742 ;
+C -1 ; WX 402 ; N onesuperior ; B 84 272 361 680 ;
+C -1 ; WX 600 ; N minus ; B 83 210 567 290 ;
+C -1 ; WX 375 ; N degree ; B 93 360 425 680 ;
+C -1 ; WX 562 ; N oacute ; B 42 -12 572 755 ;
+C -1 ; WX 761 ; N Odieresis ; B 78 -15 768 881 ;
+C -1 ; WX 562 ; N odieresis ; B 42 -12 585 710 ;
+C -1 ; WX 622 ; N Eacute ; B 5 0 687 904 ;
+C -1 ; WX 634 ; N ucircumflex ; B 71 -12 643 747 ;
+C -1 ; WX 940 ; N onequarter ; B 104 -27 849 695 ;
+C -1 ; WX 600 ; N logicalnot ; B 83 95 567 397 ;
+C -1 ; WX 622 ; N Ecircumflex ; B 5 0 687 905 ;
+C -1 ; WX 940 ; N onehalf ; B 90 -27 898 695 ;
+C -1 ; WX 761 ; N Otilde ; B 78 -15 768 876 ;
+C -1 ; WX 634 ; N uacute ; B 71 -12 643 740 ;
+C -1 ; WX 476 ; N eacute ; B 38 -12 545 755 ;
+C -1 ; WX 339 ; N iacute ; B 66 -12 438 740 ;
+C -1 ; WX 622 ; N Egrave ; B 5 0 687 904 ;
+C -1 ; WX 339 ; N icircumflex ; B 38 -12 416 747 ;
+C -1 ; WX 634 ; N mu ; B -3 -230 643 502 ;
+C -1 ; WX 265 ; N brokenbar ; B 117 -175 221 675 ;
+C -1 ; WX 600 ; N thorn ; B -6 -242 607 700 ;
+C -1 ; WX 634 ; N Aring ; B -59 0 639 879 ;
+C -1 ; WX 489 ; N yacute ; B -49 -242 553 740 ;
+C -1 ; WX 622 ; N Ydieresis ; B 92 0 765 881 ;
+C -1 ; WX 1100 ; N trademark ; B 103 277 1093 692 ;
+C -1 ; WX 824 ; N registered ; B 91 -15 819 707 ;
+C -1 ; WX 562 ; N ocircumflex ; B 42 -12 556 747 ;
+C -1 ; WX 634 ; N Agrave ; B -59 0 639 904 ;
+C -1 ; WX 551 ; N Scaron ; B 31 -15 612 916 ;
+C -1 ; WX 776 ; N Ugrave ; B 115 -15 867 904 ;
+C -1 ; WX 622 ; N Edieresis ; B 5 0 687 881 ;
+C -1 ; WX 776 ; N Uacute ; B 115 -15 867 904 ;
+C -1 ; WX 562 ; N otilde ; B 42 -12 583 697 ;
+C -1 ; WX 635 ; N ntilde ; B 45 -12 639 697 ;
+C -1 ; WX 489 ; N ydieresis ; B -49 -242 532 710 ;
+C -1 ; WX 634 ; N Aacute ; B -59 0 678 904 ;
+C -1 ; WX 562 ; N eth ; B 42 -12 558 742 ;
+C -1 ; WX 596 ; N acircumflex ; B 26 -12 612 747 ;
+C -1 ; WX 596 ; N aring ; B 26 -12 612 762 ;
+C -1 ; WX 761 ; N Ograve ; B 78 -15 768 904 ;
+C -1 ; WX 456 ; N ccedilla ; B 38 -246 498 502 ;
+C -1 ; WX 600 ; N multiply ; B 110 22 560 478 ;
+C -1 ; WX 600 ; N divide ; B 63 7 547 493 ;
+C -1 ; WX 402 ; N twosuperior ; B 29 272 423 680 ;
+C -1 ; WX 741 ; N Ntilde ; B -5 0 838 876 ;
+C -1 ; WX 634 ; N ugrave ; B 71 -12 643 740 ;
+C -1 ; WX 776 ; N Ucircumflex ; B 115 -15 867 905 ;
+C -1 ; WX 634 ; N Atilde ; B -59 0 662 876 ;
+C -1 ; WX 466 ; N zcaron ; B -17 -12 526 747 ;
+C -1 ; WX 339 ; N idieresis ; B 46 -12 444 710 ;
+C -1 ; WX 634 ; N Acircumflex ; B -59 0 639 905 ;
+C -1 ; WX 386 ; N Icircumflex ; B 5 0 506 905 ;
+C -1 ; WX 622 ; N Yacute ; B 92 0 765 904 ;
+C -1 ; WX 761 ; N Oacute ; B 78 -15 768 904 ;
+C -1 ; WX 634 ; N Adieresis ; B -59 0 652 881 ;
+C -1 ; WX 618 ; N Zcaron ; B -30 0 714 916 ;
+C -1 ; WX 596 ; N agrave ; B 26 -12 612 755 ;
+C -1 ; WX 402 ; N threesuperior ; B 59 265 421 680 ;
+C -1 ; WX 562 ; N ograve ; B 42 -12 556 755 ;
+C -1 ; WX 940 ; N threequarters ; B 95 -27 876 695 ;
+C -1 ; WX 780 ; N Eth ; B 11 0 790 692 ;
+C -1 ; WX 600 ; N plusminus ; B 83 0 567 549 ;
+C -1 ; WX 634 ; N udieresis ; B 71 -12 643 710 ;
+C -1 ; WX 476 ; N edieresis ; B 38 -12 542 710 ;
+C -1 ; WX 596 ; N aacute ; B 26 -12 621 755 ;
+C -1 ; WX 339 ; N igrave ; B 39 -12 343 740 ;
+C -1 ; WX 386 ; N Idieresis ; B 5 0 533 881 ;
+C -1 ; WX 596 ; N adieresis ; B 26 -12 612 710 ;
+C -1 ; WX 386 ; N Iacute ; B 5 0 549 904 ;
+C -1 ; WX 824 ; N copyright ; B 91 -15 819 707 ;
+C -1 ; WX 386 ; N Igrave ; B 5 0 466 904 ;
+C -1 ; WX 672 ; N Ccedilla ; B 76 -246 742 707 ;
+C -1 ; WX 417 ; N scaron ; B 10 -12 522 747 ;
+C -1 ; WX 476 ; N egrave ; B 38 -12 497 755 ;
+C -1 ; WX 761 ; N Ocircumflex ; B 78 -15 768 905 ;
+C -1 ; WX 629 ; N Thorn ; B 5 0 660 692 ;
+C -1 ; WX 596 ; N atilde ; B 26 -12 612 697 ;
+C -1 ; WX 776 ; N Udieresis ; B 115 -15 867 881 ;
+C -1 ; WX 476 ; N ecircumflex ; B 38 -12 524 747 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 697
+
+KPX A z 18
+KPX A y -40
+KPX A x 16
+KPX A w -30
+KPX A v -30
+KPX A u -18
+KPX A t -6
+KPX A s 6
+KPX A r -6
+KPX A quoteright -92
+KPX A quotedblright -92
+KPX A p -6
+KPX A o -18
+KPX A n -12
+KPX A m -12
+KPX A l -18
+KPX A h -6
+KPX A d 4
+KPX A c -6
+KPX A b -6
+KPX A a 10
+KPX A Y -56
+KPX A X -8
+KPX A W -46
+KPX A V -75
+KPX A U -50
+KPX A T -60
+KPX A Q -30
+KPX A O -30
+KPX A G -30
+KPX A C -30
+
+KPX B y -6
+KPX B u -12
+KPX B r -6
+KPX B quoteright -20
+KPX B quotedblright -32
+KPX B o 6
+KPX B l -20
+KPX B k -10
+KPX B i -12
+KPX B h -15
+KPX B e 4
+KPX B a 10
+KPX B W -30
+KPX B V -45
+KPX B U -30
+KPX B T -20
+
+KPX C z -6
+KPX C y -18
+KPX C u -12
+KPX C r -12
+KPX C quoteright 12
+KPX C quotedblright 20
+KPX C i -6
+KPX C e -6
+KPX C a -6
+KPX C Q -12
+KPX C O -12
+KPX C G -12
+KPX C C -12
+
+KPX D y 18
+KPX D quoteright -20
+KPX D quotedblright -20
+KPX D period -20
+KPX D o 6
+KPX D h -15
+KPX D e 6
+KPX D comma -20
+KPX D a 6
+KPX D Y -80
+KPX D W -40
+KPX D V -65
+
+KPX E z -6
+KPX E y -24
+KPX E x 15
+KPX E w -30
+KPX E v -18
+KPX E u -24
+KPX E t -18
+KPX E s -6
+KPX E r -6
+KPX E quoteright 10
+KPX E q 10
+KPX E period 15
+KPX E p -12
+KPX E n -12
+KPX E m -12
+KPX E l -6
+KPX E j -6
+KPX E i -12
+KPX E g -12
+KPX E d 10
+KPX E comma 15
+KPX E a 10
+
+KPX F y -12
+KPX F u -24
+KPX F r -12
+KPX F quoteright 40
+KPX F quotedblright 35
+KPX F period -120
+KPX F o -24
+KPX F i -6
+KPX F e -24
+KPX F comma -110
+KPX F a -30
+KPX F A -45
+
+KPX G y -25
+KPX G u -22
+KPX G r -22
+KPX G quoteright -30
+KPX G quotedblright -30
+KPX G n -22
+KPX G l -24
+KPX G i -12
+KPX G h -18
+KPX G e 5
+
+KPX H y -18
+KPX H u -30
+KPX H o -25
+KPX H i -25
+KPX H e -25
+KPX H a -25
+
+KPX I z -20
+KPX I y -6
+KPX I x -6
+KPX I w -30
+KPX I v -30
+KPX I u -30
+KPX I t -18
+KPX I s -18
+KPX I r -12
+KPX I p -18
+KPX I o -25
+KPX I n -18
+KPX I m -18
+KPX I l -6
+KPX I k -6
+KPX I j -20
+KPX I i -10
+KPX I g -24
+KPX I f -6
+KPX I e -25
+KPX I d -15
+KPX I c -25
+KPX I b -6
+KPX I a -15
+
+KPX J y -12
+KPX J u -32
+KPX J quoteright 6
+KPX J quotedblright 6
+KPX J o -36
+KPX J i -30
+KPX J e -30
+KPX J braceright 15
+KPX J a -36
+
+KPX K y -70
+KPX K w -36
+KPX K v -30
+KPX K u -30
+KPX K r -24
+KPX K quoteright 36
+KPX K quotedblright 36
+KPX K o -30
+KPX K n -24
+KPX K l 10
+KPX K i -12
+KPX K h 15
+KPX K e -30
+KPX K a -12
+KPX K Q -50
+KPX K O -50
+KPX K G -50
+KPX K C -50
+KPX K A 15
+
+KPX L y -70
+KPX L w -30
+KPX L u -18
+KPX L quoteright -110
+KPX L quotedblright -110
+KPX L l -16
+KPX L j -18
+KPX L i -18
+KPX L Y -80
+KPX L W -78
+KPX L V -110
+KPX L U -42
+KPX L T -100
+KPX L Q -48
+KPX L O -48
+KPX L G -48
+KPX L C -48
+KPX L A 40
+
+KPX M y -18
+KPX M u -24
+KPX M quoteright 6
+KPX M quotedblright 6
+KPX M o -25
+KPX M n -20
+KPX M j -35
+KPX M i -20
+KPX M e -25
+KPX M d -20
+KPX M c -25
+KPX M a -20
+
+KPX N y -18
+KPX N u -24
+KPX N o -18
+KPX N i -12
+KPX N e -16
+KPX N a -22
+
+KPX O z -6
+KPX O y 12
+KPX O u -6
+KPX O t -6
+KPX O s -6
+KPX O r -6
+KPX O quoteright -20
+KPX O quotedblright -20
+KPX O q 6
+KPX O period -10
+KPX O p -6
+KPX O n -6
+KPX O m -6
+KPX O l -15
+KPX O k -10
+KPX O j -6
+KPX O h -10
+KPX O g -6
+KPX O e 6
+KPX O d 6
+KPX O comma -10
+KPX O a 6
+KPX O Y -70
+KPX O X -30
+KPX O W -35
+KPX O V -50
+KPX O T -42
+KPX O A -8
+
+KPX P y 6
+KPX P u -18
+KPX P t -6
+KPX P s -24
+KPX P r -6
+KPX P quoteright -12
+KPX P period -170
+KPX P o -24
+KPX P n -12
+KPX P l -20
+KPX P h -20
+KPX P e -24
+KPX P comma -170
+KPX P a -40
+KPX P I -45
+KPX P H -45
+KPX P E -45
+KPX P A -70
+
+KPX Q u -6
+KPX Q quoteright -20
+KPX Q quotedblright -38
+KPX Q a -6
+KPX Q Y -70
+KPX Q X -12
+KPX Q W -35
+KPX Q V -50
+KPX Q U -30
+KPX Q T -36
+KPX Q A -18
+
+KPX R y -6
+KPX R u -12
+KPX R quoteright -22
+KPX R quotedblright -22
+KPX R o -20
+KPX R e -12
+KPX R Y -45
+KPX R X 15
+KPX R W -25
+KPX R V -35
+KPX R U -40
+KPX R T -18
+KPX R Q -8
+KPX R O -8
+KPX R G -8
+KPX R C -8
+KPX R A 15
+
+KPX S y -30
+KPX S w -30
+KPX S v -20
+KPX S u -18
+KPX S t -18
+KPX S r -20
+KPX S quoteright -38
+KPX S quotedblright -50
+KPX S p -18
+KPX S n -24
+KPX S m -24
+KPX S l -20
+KPX S k -18
+KPX S j -25
+KPX S i -20
+KPX S h -12
+KPX S e -6
+
+KPX T z -48
+KPX T y -52
+KPX T w -54
+KPX T u -54
+KPX T semicolon -6
+KPX T s -60
+KPX T r -54
+KPX T quoteright 36
+KPX T quotedblright 36
+KPX T period -70
+KPX T parenright 25
+KPX T o -78
+KPX T m -54
+KPX T i -22
+KPX T hyphen -100
+KPX T h 6
+KPX T endash -40
+KPX T emdash -40
+KPX T e -78
+KPX T comma -90
+KPX T bracketright 20
+KPX T braceright 30
+KPX T a -78
+KPX T Y 12
+KPX T X 18
+KPX T W 30
+KPX T V 20
+KPX T T 40
+KPX T Q -6
+KPX T O -6
+KPX T G -6
+KPX T C -6
+KPX T A -40
+
+KPX U z -18
+KPX U x -30
+KPX U v -20
+KPX U t -24
+KPX U s -40
+KPX U r -30
+KPX U p -30
+KPX U n -30
+KPX U m -30
+KPX U l -12
+KPX U k -12
+KPX U i -24
+KPX U h -6
+KPX U g -30
+KPX U f -10
+KPX U d -30
+KPX U c -30
+KPX U b -6
+KPX U a -30
+KPX U A -40
+
+KPX V y -34
+KPX V u -42
+KPX V semicolon -45
+KPX V r -55
+KPX V quoteright 46
+KPX V quotedblright 60
+KPX V period -110
+KPX V parenright 64
+KPX V o -55
+KPX V i 15
+KPX V hyphen -60
+KPX V endash -20
+KPX V emdash -20
+KPX V e -55
+KPX V comma -110
+KPX V colon -18
+KPX V bracketright 64
+KPX V braceright 64
+KPX V a -80
+KPX V T 12
+KPX V A -70
+
+KPX W y -36
+KPX W u -30
+KPX W t -10
+KPX W semicolon -12
+KPX W r -30
+KPX W quoteright 42
+KPX W quotedblright 55
+KPX W period -80
+KPX W parenright 55
+KPX W o -55
+KPX W m -30
+KPX W i 5
+KPX W hyphen -40
+KPX W h 16
+KPX W e -55
+KPX W d -60
+KPX W comma -80
+KPX W colon -12
+KPX W bracketright 64
+KPX W braceright 64
+KPX W a -60
+KPX W T 30
+KPX W Q -5
+KPX W O -5
+KPX W G -5
+KPX W C -5
+KPX W A -45
+
+KPX X y -40
+KPX X u -30
+KPX X r -6
+KPX X quoteright 24
+KPX X quotedblright 40
+KPX X i -6
+KPX X e -18
+KPX X a -6
+KPX X Y -6
+KPX X W -6
+KPX X Q -45
+KPX X O -45
+KPX X G -45
+KPX X C -45
+
+KPX Y v -60
+KPX Y u -70
+KPX Y t -32
+KPX Y semicolon -20
+KPX Y quoteright 56
+KPX Y quotedblright 70
+KPX Y q -100
+KPX Y period -80
+KPX Y parenright 5
+KPX Y o -95
+KPX Y l 15
+KPX Y i 15
+KPX Y hyphen -110
+KPX Y endash -40
+KPX Y emdash -40
+KPX Y e -95
+KPX Y d -85
+KPX Y comma -80
+KPX Y colon -20
+KPX Y bracketright 64
+KPX Y braceright 64
+KPX Y a -85
+KPX Y Y 12
+KPX Y X 12
+KPX Y W 12
+KPX Y V 6
+KPX Y T 30
+KPX Y Q -25
+KPX Y O -25
+KPX Y G -25
+KPX Y C -25
+KPX Y A -40
+
+KPX Z y -36
+KPX Z w -36
+KPX Z u -12
+KPX Z quoteright 18
+KPX Z quotedblright 18
+KPX Z o -6
+KPX Z i -12
+KPX Z e -6
+KPX Z a -6
+KPX Z Q -20
+KPX Z O -20
+KPX Z G -20
+KPX Z C -20
+KPX Z A 30
+
+KPX a quoteright -54
+KPX a quotedblright -54
+
+KPX b y -6
+KPX b w -5
+KPX b v -5
+KPX b quoteright -30
+KPX b quotedblright -30
+KPX b period -15
+KPX b comma -15
+
+KPX braceleft Y 64
+KPX braceleft W 64
+KPX braceleft V 64
+KPX braceleft T 40
+KPX braceleft J 60
+
+KPX bracketleft Y 60
+KPX bracketleft W 64
+KPX bracketleft V 64
+KPX bracketleft T 35
+KPX bracketleft J 30
+
+KPX c quoteright 5
+KPX c quotedblright 5
+
+KPX colon space -30
+
+KPX comma space -40
+KPX comma quoteright -100
+KPX comma quotedblright -100
+
+KPX d quoteright -12
+KPX d quotedblright -12
+KPX d period 15
+KPX d comma 15
+
+KPX e y 6
+KPX e x -10
+KPX e w -10
+KPX e v -10
+KPX e quoteright -25
+KPX e quotedblright -25
+
+KPX f quoteright 120
+KPX f quotedblright 120
+KPX f period -30
+KPX f parenright 100
+KPX f comma -30
+KPX f bracketright 110
+KPX f braceright 110
+
+KPX g y 50
+KPX g quotedblright -20
+KPX g p 30
+KPX g f 42
+KPX g comma 20
+
+KPX h quoteright -78
+KPX h quotedblright -78
+
+KPX i quoteright -20
+KPX i quotedblright -20
+
+KPX j quoteright -20
+KPX j quotedblright -20
+KPX j period -20
+KPX j comma -20
+
+KPX k quoteright -38
+KPX k quotedblright -38
+
+KPX l quoteright -12
+KPX l quotedblright -12
+
+KPX m quoteright -78
+KPX m quotedblright -78
+
+KPX n quoteright -88
+KPX n quotedblright -88
+
+KPX o y -12
+KPX o x -20
+KPX o w -25
+KPX o v -25
+KPX o quoteright -50
+KPX o quotedblright -50
+KPX o period -10
+KPX o comma -10
+
+KPX p w -6
+KPX p quoteright -30
+KPX p quotedblright -52
+KPX p period -15
+KPX p comma -15
+
+KPX parenleft Y 64
+KPX parenleft W 64
+KPX parenleft V 64
+KPX parenleft T 30
+KPX parenleft J 50
+
+KPX period space -40
+KPX period quoteright -100
+KPX period quotedblright -100
+
+KPX q quoteright -40
+KPX q quotedblright -40
+KPX q period -10
+KPX q comma -5
+
+KPX quotedblleft z -30
+KPX quotedblleft x -60
+KPX quotedblleft w -12
+KPX quotedblleft v -12
+KPX quotedblleft u -12
+KPX quotedblleft t 5
+KPX quotedblleft s -30
+KPX quotedblleft r -12
+KPX quotedblleft q -50
+KPX quotedblleft p -12
+KPX quotedblleft o -30
+KPX quotedblleft n -12
+KPX quotedblleft m -12
+KPX quotedblleft l 10
+KPX quotedblleft k 10
+KPX quotedblleft h 10
+KPX quotedblleft g -30
+KPX quotedblleft e -30
+KPX quotedblleft d -50
+KPX quotedblleft c -30
+KPX quotedblleft b 24
+KPX quotedblleft a -50
+KPX quotedblleft Y 30
+KPX quotedblleft X 45
+KPX quotedblleft W 55
+KPX quotedblleft V 40
+KPX quotedblleft T 36
+KPX quotedblleft A -100
+
+KPX quotedblright space -50
+KPX quotedblright period -200
+KPX quotedblright comma -200
+
+KPX quoteleft z -30
+KPX quoteleft y 30
+KPX quoteleft x -10
+KPX quoteleft w -12
+KPX quoteleft u -12
+KPX quoteleft t -30
+KPX quoteleft s -30
+KPX quoteleft r -12
+KPX quoteleft q -30
+KPX quoteleft p -12
+KPX quoteleft o -30
+KPX quoteleft n -12
+KPX quoteleft m -12
+KPX quoteleft l 10
+KPX quoteleft k 10
+KPX quoteleft h 10
+KPX quoteleft g -30
+KPX quoteleft e -30
+KPX quoteleft d -30
+KPX quoteleft c -30
+KPX quoteleft b 24
+KPX quoteleft a -30
+KPX quoteleft Y 12
+KPX quoteleft X 46
+KPX quoteleft W 46
+KPX quoteleft V 28
+KPX quoteleft T 36
+KPX quoteleft A -100
+
+KPX quoteright v -20
+KPX quoteright space -50
+KPX quoteright s -45
+KPX quoteright r -12
+KPX quoteright period -140
+KPX quoteright m -12
+KPX quoteright l -12
+KPX quoteright d -65
+KPX quoteright comma -140
+
+KPX r z 20
+KPX r y 18
+KPX r x 12
+KPX r w 6
+KPX r v 6
+KPX r t 8
+KPX r semicolon 20
+KPX r quoteright -6
+KPX r quotedblright -6
+KPX r q -24
+KPX r period -100
+KPX r o -6
+KPX r l -12
+KPX r k -12
+KPX r hyphen -40
+KPX r h -10
+KPX r f 8
+KPX r endash -20
+KPX r e -26
+KPX r d -25
+KPX r comma -100
+KPX r colon 20
+KPX r c -12
+KPX r a -25
+
+KPX s quoteright -25
+KPX s quotedblright -30
+
+KPX semicolon space -30
+
+KPX space quotesinglbase -60
+KPX space quoteleft -60
+KPX space quotedblleft -60
+KPX space quotedblbase -60
+KPX space Y -70
+KPX space W -50
+KPX space V -70
+KPX space T -50
+KPX space A -50
+
+KPX t quoteright 15
+KPX t quotedblright 15
+KPX t period 15
+KPX t comma 15
+
+KPX u quoteright -65
+KPX u quotedblright -78
+KPX u period 20
+KPX u comma 20
+
+KPX v quoteright -10
+KPX v quotedblright -10
+KPX v q -6
+KPX v period -62
+KPX v o -6
+KPX v e -6
+KPX v d -6
+KPX v comma -62
+KPX v c -6
+KPX v a -6
+
+KPX w quoteright -10
+KPX w quotedblright -10
+KPX w period -40
+KPX w comma -50
+
+KPX x y 12
+KPX x w -6
+KPX x quoteright -30
+KPX x quotedblright -30
+KPX x q -6
+KPX x o -6
+KPX x e -6
+KPX x d -6
+KPX x c -6
+
+KPX y quoteright -10
+KPX y quotedblright -10
+KPX y q -10
+KPX y period -56
+KPX y d -10
+KPX y comma -56
+
+KPX z quoteright -40
+KPX z quotedblright -40
+KPX z o -6
+KPX z e -6
+KPX z d -6
+KPX z c -6
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putr8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putr8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..be1bb781ad14e1a0bbfed60d4d6d1aad1405b737
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putr8a.afm
@@ -0,0 +1,1029 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Fri Jan 17 13:38:17 1992
+Comment UniqueID 37674
+Comment VMusage 32991 39883
+FontName Utopia-Regular
+FullName Utopia Regular
+FamilyName Utopia
+Weight Regular
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -158 -250 1158 890
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.002
+Notice Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.Utopia is a registered trademark of Adobe Systems Incorporated.
+EncodingScheme AdobeStandardEncoding
+CapHeight 692
+XHeight 490
+Ascender 742
+Descender -230
+StartCharMetrics 228
+C 32 ; WX 225 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 242 ; N exclam ; B 58 -12 184 707 ;
+C 34 ; WX 458 ; N quotedbl ; B 101 464 358 742 ;
+C 35 ; WX 530 ; N numbersign ; B 11 0 519 668 ;
+C 36 ; WX 530 ; N dollar ; B 44 -102 487 743 ;
+C 37 ; WX 838 ; N percent ; B 50 -25 788 700 ;
+C 38 ; WX 706 ; N ampersand ; B 46 -12 692 680 ;
+C 39 ; WX 278 ; N quoteright ; B 72 472 207 742 ;
+C 40 ; WX 350 ; N parenleft ; B 105 -128 325 692 ;
+C 41 ; WX 350 ; N parenright ; B 25 -128 245 692 ;
+C 42 ; WX 412 ; N asterisk ; B 50 356 363 707 ;
+C 43 ; WX 570 ; N plus ; B 43 0 527 490 ;
+C 44 ; WX 265 ; N comma ; B 51 -141 193 141 ;
+C 45 ; WX 392 ; N hyphen ; B 74 216 319 286 ;
+C 46 ; WX 265 ; N period ; B 70 -12 196 116 ;
+C 47 ; WX 460 ; N slash ; B 92 -15 369 707 ;
+C 48 ; WX 530 ; N zero ; B 41 -12 489 680 ;
+C 49 ; WX 530 ; N one ; B 109 0 437 680 ;
+C 50 ; WX 530 ; N two ; B 27 0 485 680 ;
+C 51 ; WX 530 ; N three ; B 27 -12 473 680 ;
+C 52 ; WX 530 ; N four ; B 19 0 493 668 ;
+C 53 ; WX 530 ; N five ; B 40 -12 480 668 ;
+C 54 ; WX 530 ; N six ; B 44 -12 499 680 ;
+C 55 ; WX 530 ; N seven ; B 41 -12 497 668 ;
+C 56 ; WX 530 ; N eight ; B 42 -12 488 680 ;
+C 57 ; WX 530 ; N nine ; B 36 -12 477 680 ;
+C 58 ; WX 265 ; N colon ; B 70 -12 196 490 ;
+C 59 ; WX 265 ; N semicolon ; B 51 -141 196 490 ;
+C 60 ; WX 570 ; N less ; B 46 1 524 499 ;
+C 61 ; WX 570 ; N equal ; B 43 111 527 389 ;
+C 62 ; WX 570 ; N greater ; B 46 1 524 499 ;
+C 63 ; WX 389 ; N question ; B 29 -12 359 707 ;
+C 64 ; WX 793 ; N at ; B 46 -15 755 707 ;
+C 65 ; WX 635 ; N A ; B -29 0 650 692 ;
+C 66 ; WX 646 ; N B ; B 35 0 595 692 ;
+C 67 ; WX 684 ; N C ; B 48 -15 649 707 ;
+C 68 ; WX 779 ; N D ; B 35 0 731 692 ;
+C 69 ; WX 606 ; N E ; B 35 0 577 692 ;
+C 70 ; WX 580 ; N F ; B 35 0 543 692 ;
+C 71 ; WX 734 ; N G ; B 48 -15 725 707 ;
+C 72 ; WX 798 ; N H ; B 35 0 763 692 ;
+C 73 ; WX 349 ; N I ; B 35 0 314 692 ;
+C 74 ; WX 350 ; N J ; B 0 -114 323 692 ;
+C 75 ; WX 658 ; N K ; B 35 -5 671 692 ;
+C 76 ; WX 568 ; N L ; B 35 0 566 692 ;
+C 77 ; WX 944 ; N M ; B 33 0 909 692 ;
+C 78 ; WX 780 ; N N ; B 34 0 753 692 ;
+C 79 ; WX 762 ; N O ; B 48 -15 714 707 ;
+C 80 ; WX 600 ; N P ; B 35 0 574 692 ;
+C 81 ; WX 762 ; N Q ; B 48 -193 714 707 ;
+C 82 ; WX 644 ; N R ; B 35 0 638 692 ;
+C 83 ; WX 541 ; N S ; B 50 -15 504 707 ;
+C 84 ; WX 621 ; N T ; B 22 0 599 692 ;
+C 85 ; WX 791 ; N U ; B 29 -15 762 692 ;
+C 86 ; WX 634 ; N V ; B -18 0 678 692 ;
+C 87 ; WX 940 ; N W ; B -13 0 977 692 ;
+C 88 ; WX 624 ; N X ; B -19 0 657 692 ;
+C 89 ; WX 588 ; N Y ; B -12 0 632 692 ;
+C 90 ; WX 610 ; N Z ; B 9 0 594 692 ;
+C 91 ; WX 330 ; N bracketleft ; B 133 -128 292 692 ;
+C 92 ; WX 460 ; N backslash ; B 91 -15 369 707 ;
+C 93 ; WX 330 ; N bracketright ; B 38 -128 197 692 ;
+C 94 ; WX 570 ; N asciicircum ; B 56 228 514 668 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 72 478 207 748 ;
+C 97 ; WX 523 ; N a ; B 49 -12 525 502 ;
+C 98 ; WX 598 ; N b ; B 20 -12 549 742 ;
+C 99 ; WX 496 ; N c ; B 49 -12 473 502 ;
+C 100 ; WX 598 ; N d ; B 49 -12 583 742 ;
+C 101 ; WX 514 ; N e ; B 49 -12 481 502 ;
+C 102 ; WX 319 ; N f ; B 30 0 389 742 ; L i fi ; L l fl ;
+C 103 ; WX 520 ; N g ; B 42 -242 525 512 ;
+C 104 ; WX 607 ; N h ; B 21 0 592 742 ;
+C 105 ; WX 291 ; N i ; B 32 0 276 715 ;
+C 106 ; WX 280 ; N j ; B -33 -242 214 715 ;
+C 107 ; WX 524 ; N k ; B 20 -5 538 742 ;
+C 108 ; WX 279 ; N l ; B 20 0 264 742 ;
+C 109 ; WX 923 ; N m ; B 32 0 908 502 ;
+C 110 ; WX 619 ; N n ; B 32 0 604 502 ;
+C 111 ; WX 577 ; N o ; B 49 -12 528 502 ;
+C 112 ; WX 608 ; N p ; B 25 -230 559 502 ;
+C 113 ; WX 591 ; N q ; B 49 -230 583 502 ;
+C 114 ; WX 389 ; N r ; B 32 0 386 502 ;
+C 115 ; WX 436 ; N s ; B 47 -12 400 502 ;
+C 116 ; WX 344 ; N t ; B 31 -12 342 616 ;
+C 117 ; WX 606 ; N u ; B 26 -12 591 502 ;
+C 118 ; WX 504 ; N v ; B 1 0 529 490 ;
+C 119 ; WX 768 ; N w ; B -2 0 792 490 ;
+C 120 ; WX 486 ; N x ; B 1 0 509 490 ;
+C 121 ; WX 506 ; N y ; B -5 -242 528 490 ;
+C 122 ; WX 480 ; N z ; B 19 0 462 490 ;
+C 123 ; WX 340 ; N braceleft ; B 79 -128 298 692 ;
+C 124 ; WX 228 ; N bar ; B 80 -250 148 750 ;
+C 125 ; WX 340 ; N braceright ; B 42 -128 261 692 ;
+C 126 ; WX 570 ; N asciitilde ; B 73 175 497 317 ;
+C 161 ; WX 242 ; N exclamdown ; B 58 -217 184 502 ;
+C 162 ; WX 530 ; N cent ; B 37 -10 487 675 ;
+C 163 ; WX 530 ; N sterling ; B 27 0 510 680 ;
+C 164 ; WX 150 ; N fraction ; B -158 -27 308 695 ;
+C 165 ; WX 530 ; N yen ; B -2 0 525 668 ;
+C 166 ; WX 530 ; N florin ; B -2 -135 522 691 ;
+C 167 ; WX 554 ; N section ; B 46 -115 507 707 ;
+C 168 ; WX 530 ; N currency ; B 25 90 505 578 ;
+C 169 ; WX 278 ; N quotesingle ; B 93 464 185 742 ;
+C 170 ; WX 458 ; N quotedblleft ; B 72 478 387 748 ;
+C 171 ; WX 442 ; N guillemotleft ; B 41 41 401 435 ;
+C 172 ; WX 257 ; N guilsinglleft ; B 41 41 216 435 ;
+C 173 ; WX 257 ; N guilsinglright ; B 41 41 216 435 ;
+C 174 ; WX 610 ; N fi ; B 30 0 595 742 ;
+C 175 ; WX 610 ; N fl ; B 30 0 595 742 ;
+C 177 ; WX 500 ; N endash ; B 0 221 500 279 ;
+C 178 ; WX 504 ; N dagger ; B 45 -125 459 717 ;
+C 179 ; WX 488 ; N daggerdbl ; B 45 -119 443 717 ;
+C 180 ; WX 265 ; N periodcentered ; B 70 188 196 316 ;
+C 182 ; WX 555 ; N paragraph ; B 64 -101 529 692 ;
+C 183 ; WX 409 ; N bullet ; B 45 192 364 512 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 72 -125 207 145 ;
+C 185 ; WX 458 ; N quotedblbase ; B 72 -125 387 145 ;
+C 186 ; WX 458 ; N quotedblright ; B 72 472 387 742 ;
+C 187 ; WX 442 ; N guillemotright ; B 41 41 401 435 ;
+C 188 ; WX 1000 ; N ellipsis ; B 104 -12 896 116 ;
+C 189 ; WX 1208 ; N perthousand ; B 50 -25 1158 700 ;
+C 191 ; WX 389 ; N questiondown ; B 30 -217 360 502 ;
+C 193 ; WX 400 ; N grave ; B 49 542 271 723 ;
+C 194 ; WX 400 ; N acute ; B 129 542 351 723 ;
+C 195 ; WX 400 ; N circumflex ; B 47 541 353 720 ;
+C 196 ; WX 400 ; N tilde ; B 22 563 377 682 ;
+C 197 ; WX 400 ; N macron ; B 56 597 344 656 ;
+C 198 ; WX 400 ; N breve ; B 63 568 337 704 ;
+C 199 ; WX 400 ; N dotaccent ; B 140 570 260 683 ;
+C 200 ; WX 400 ; N dieresis ; B 36 570 364 683 ;
+C 202 ; WX 400 ; N ring ; B 92 550 308 752 ;
+C 203 ; WX 400 ; N cedilla ; B 163 -230 329 0 ;
+C 205 ; WX 400 ; N hungarumlaut ; B 101 546 380 750 ;
+C 206 ; WX 400 ; N ogonek ; B 103 -230 295 0 ;
+C 207 ; WX 400 ; N caron ; B 47 541 353 720 ;
+C 208 ; WX 1000 ; N emdash ; B 0 221 1000 279 ;
+C 225 ; WX 876 ; N AE ; B -63 0 847 692 ;
+C 227 ; WX 390 ; N ordfeminine ; B 40 265 364 590 ;
+C 232 ; WX 574 ; N Lslash ; B 36 0 572 692 ;
+C 233 ; WX 762 ; N Oslash ; B 48 -53 714 739 ;
+C 234 ; WX 1025 ; N OE ; B 48 0 996 692 ;
+C 235 ; WX 398 ; N ordmasculine ; B 35 265 363 590 ;
+C 241 ; WX 797 ; N ae ; B 49 -12 764 502 ;
+C 245 ; WX 291 ; N dotlessi ; B 32 0 276 502 ;
+C 248 ; WX 294 ; N lslash ; B 14 0 293 742 ;
+C 249 ; WX 577 ; N oslash ; B 49 -41 528 532 ;
+C 250 ; WX 882 ; N oe ; B 49 -12 849 502 ;
+C 251 ; WX 601 ; N germandbls ; B 22 -12 573 742 ;
+C -1 ; WX 380 ; N onesuperior ; B 81 272 307 680 ;
+C -1 ; WX 570 ; N minus ; B 43 221 527 279 ;
+C -1 ; WX 350 ; N degree ; B 37 404 313 680 ;
+C -1 ; WX 577 ; N oacute ; B 49 -12 528 723 ;
+C -1 ; WX 762 ; N Odieresis ; B 48 -15 714 841 ;
+C -1 ; WX 577 ; N odieresis ; B 49 -12 528 683 ;
+C -1 ; WX 606 ; N Eacute ; B 35 0 577 890 ;
+C -1 ; WX 606 ; N ucircumflex ; B 26 -12 591 720 ;
+C -1 ; WX 860 ; N onequarter ; B 65 -27 795 695 ;
+C -1 ; WX 570 ; N logicalnot ; B 43 102 527 389 ;
+C -1 ; WX 606 ; N Ecircumflex ; B 35 0 577 876 ;
+C -1 ; WX 860 ; N onehalf ; B 58 -27 807 695 ;
+C -1 ; WX 762 ; N Otilde ; B 48 -15 714 842 ;
+C -1 ; WX 606 ; N uacute ; B 26 -12 591 723 ;
+C -1 ; WX 514 ; N eacute ; B 49 -12 481 723 ;
+C -1 ; WX 291 ; N iacute ; B 32 0 317 723 ;
+C -1 ; WX 606 ; N Egrave ; B 35 0 577 890 ;
+C -1 ; WX 291 ; N icircumflex ; B -3 0 304 720 ;
+C -1 ; WX 606 ; N mu ; B 26 -246 591 502 ;
+C -1 ; WX 228 ; N brokenbar ; B 80 -175 148 675 ;
+C -1 ; WX 606 ; N thorn ; B 23 -230 557 722 ;
+C -1 ; WX 627 ; N Aring ; B -32 0 647 861 ;
+C -1 ; WX 506 ; N yacute ; B -5 -242 528 723 ;
+C -1 ; WX 588 ; N Ydieresis ; B -12 0 632 841 ;
+C -1 ; WX 1100 ; N trademark ; B 45 277 1048 692 ;
+C -1 ; WX 818 ; N registered ; B 45 -15 773 707 ;
+C -1 ; WX 577 ; N ocircumflex ; B 49 -12 528 720 ;
+C -1 ; WX 635 ; N Agrave ; B -29 0 650 890 ;
+C -1 ; WX 541 ; N Scaron ; B 50 -15 504 882 ;
+C -1 ; WX 791 ; N Ugrave ; B 29 -15 762 890 ;
+C -1 ; WX 606 ; N Edieresis ; B 35 0 577 841 ;
+C -1 ; WX 791 ; N Uacute ; B 29 -15 762 890 ;
+C -1 ; WX 577 ; N otilde ; B 49 -12 528 682 ;
+C -1 ; WX 619 ; N ntilde ; B 32 0 604 682 ;
+C -1 ; WX 506 ; N ydieresis ; B -5 -242 528 683 ;
+C -1 ; WX 635 ; N Aacute ; B -29 0 650 890 ;
+C -1 ; WX 577 ; N eth ; B 49 -12 528 742 ;
+C -1 ; WX 523 ; N acircumflex ; B 49 -12 525 720 ;
+C -1 ; WX 523 ; N aring ; B 49 -12 525 752 ;
+C -1 ; WX 762 ; N Ograve ; B 48 -15 714 890 ;
+C -1 ; WX 496 ; N ccedilla ; B 49 -230 473 502 ;
+C -1 ; WX 570 ; N multiply ; B 63 22 507 478 ;
+C -1 ; WX 570 ; N divide ; B 43 26 527 474 ;
+C -1 ; WX 380 ; N twosuperior ; B 32 272 348 680 ;
+C -1 ; WX 780 ; N Ntilde ; B 34 0 753 842 ;
+C -1 ; WX 606 ; N ugrave ; B 26 -12 591 723 ;
+C -1 ; WX 791 ; N Ucircumflex ; B 29 -15 762 876 ;
+C -1 ; WX 635 ; N Atilde ; B -29 0 650 842 ;
+C -1 ; WX 480 ; N zcaron ; B 19 0 462 720 ;
+C -1 ; WX 291 ; N idieresis ; B -19 0 310 683 ;
+C -1 ; WX 635 ; N Acircumflex ; B -29 0 650 876 ;
+C -1 ; WX 349 ; N Icircumflex ; B 22 0 328 876 ;
+C -1 ; WX 588 ; N Yacute ; B -12 0 632 890 ;
+C -1 ; WX 762 ; N Oacute ; B 48 -15 714 890 ;
+C -1 ; WX 635 ; N Adieresis ; B -29 0 650 841 ;
+C -1 ; WX 610 ; N Zcaron ; B 9 0 594 882 ;
+C -1 ; WX 523 ; N agrave ; B 49 -12 525 723 ;
+C -1 ; WX 380 ; N threesuperior ; B 36 265 339 680 ;
+C -1 ; WX 577 ; N ograve ; B 49 -12 528 723 ;
+C -1 ; WX 860 ; N threequarters ; B 50 -27 808 695 ;
+C -1 ; WX 785 ; N Eth ; B 20 0 737 692 ;
+C -1 ; WX 570 ; N plusminus ; B 43 0 527 556 ;
+C -1 ; WX 606 ; N udieresis ; B 26 -12 591 683 ;
+C -1 ; WX 514 ; N edieresis ; B 49 -12 481 683 ;
+C -1 ; WX 523 ; N aacute ; B 49 -12 525 723 ;
+C -1 ; WX 291 ; N igrave ; B -35 0 276 723 ;
+C -1 ; WX 349 ; N Idieresis ; B 13 0 337 841 ;
+C -1 ; WX 523 ; N adieresis ; B 49 -12 525 683 ;
+C -1 ; WX 349 ; N Iacute ; B 35 0 371 890 ;
+C -1 ; WX 818 ; N copyright ; B 45 -15 773 707 ;
+C -1 ; WX 349 ; N Igrave ; B -17 0 314 890 ;
+C -1 ; WX 680 ; N Ccedilla ; B 48 -230 649 707 ;
+C -1 ; WX 436 ; N scaron ; B 47 -12 400 720 ;
+C -1 ; WX 514 ; N egrave ; B 49 -12 481 723 ;
+C -1 ; WX 762 ; N Ocircumflex ; B 48 -15 714 876 ;
+C -1 ; WX 593 ; N Thorn ; B 35 0 556 692 ;
+C -1 ; WX 523 ; N atilde ; B 49 -12 525 682 ;
+C -1 ; WX 791 ; N Udieresis ; B 29 -15 762 841 ;
+C -1 ; WX 514 ; N ecircumflex ; B 49 -12 481 720 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 712
+
+KPX A z 6
+KPX A y -50
+KPX A w -45
+KPX A v -60
+KPX A u -25
+KPX A t -12
+KPX A quoteright -120
+KPX A quotedblright -120
+KPX A q -6
+KPX A p -18
+KPX A o -12
+KPX A e -6
+KPX A d -12
+KPX A c -12
+KPX A b -12
+KPX A Y -70
+KPX A X -6
+KPX A W -58
+KPX A V -72
+KPX A U -50
+KPX A T -70
+KPX A Q -24
+KPX A O -24
+KPX A G -24
+KPX A C -24
+
+KPX B y -18
+KPX B u -12
+KPX B r -12
+KPX B period -30
+KPX B o -6
+KPX B l -12
+KPX B i -12
+KPX B h -12
+KPX B e -6
+KPX B comma -20
+KPX B a -12
+KPX B W -25
+KPX B V -20
+KPX B U -20
+KPX B T -20
+
+KPX C z -18
+KPX C y -24
+KPX C u -18
+KPX C r -6
+KPX C o -12
+KPX C e -12
+KPX C a -12
+KPX C Q -6
+KPX C O -6
+KPX C G -6
+KPX C C -6
+
+KPX D y 6
+KPX D u -12
+KPX D r -12
+KPX D quoteright -20
+KPX D quotedblright -20
+KPX D period -60
+KPX D i -6
+KPX D h -12
+KPX D e -6
+KPX D comma -50
+KPX D a -6
+KPX D Y -45
+KPX D W -35
+KPX D V -35
+
+KPX E z -6
+KPX E y -30
+KPX E x -6
+KPX E w -24
+KPX E v -24
+KPX E u -12
+KPX E t -18
+KPX E r -4
+KPX E q -6
+KPX E p -18
+KPX E o -6
+KPX E n -4
+KPX E m -4
+KPX E l 5
+KPX E k 5
+KPX E j -6
+KPX E i -6
+KPX E g -6
+KPX E f -12
+KPX E e -6
+KPX E d -6
+KPX E c -6
+KPX E b -12
+KPX E Y -6
+KPX E W -6
+KPX E V -6
+
+KPX F y -18
+KPX F u -12
+KPX F r -20
+KPX F period -180
+KPX F o -36
+KPX F l -12
+KPX F i -10
+KPX F endash 20
+KPX F e -36
+KPX F comma -180
+KPX F a -48
+KPX F A -60
+
+KPX G y -18
+KPX G u -12
+KPX G r -5
+KPX G o 5
+KPX G n -5
+KPX G l -6
+KPX G i -12
+KPX G h -12
+KPX G e 5
+KPX G a -12
+
+KPX H y -24
+KPX H u -26
+KPX H o -30
+KPX H i -18
+KPX H e -30
+KPX H a -24
+
+KPX I z -6
+KPX I y -6
+KPX I x -6
+KPX I w -18
+KPX I v -24
+KPX I u -26
+KPX I t -24
+KPX I s -18
+KPX I r -12
+KPX I p -26
+KPX I o -30
+KPX I n -18
+KPX I m -18
+KPX I l -6
+KPX I k -6
+KPX I h -6
+KPX I g -10
+KPX I f -6
+KPX I e -30
+KPX I d -30
+KPX I c -30
+KPX I b -6
+KPX I a -24
+
+KPX J y -12
+KPX J u -36
+KPX J o -30
+KPX J i -20
+KPX J e -30
+KPX J bracketright 20
+KPX J braceright 20
+KPX J a -36
+
+KPX K y -60
+KPX K w -70
+KPX K v -70
+KPX K u -42
+KPX K o -30
+KPX K i 6
+KPX K e -24
+KPX K a -12
+KPX K Q -42
+KPX K O -42
+KPX K G -42
+KPX K C -42
+
+KPX L y -52
+KPX L w -58
+KPX L u -12
+KPX L quoteright -130
+KPX L quotedblright -50
+KPX L l 6
+KPX L j -6
+KPX L Y -70
+KPX L W -90
+KPX L V -100
+KPX L U -24
+KPX L T -100
+KPX L Q -18
+KPX L O -10
+KPX L G -18
+KPX L C -18
+KPX L A 12
+
+KPX M y -24
+KPX M u -36
+KPX M o -30
+KPX M n -6
+KPX M j -12
+KPX M i -12
+KPX M e -30
+KPX M d -30
+KPX M c -30
+KPX M a -12
+
+KPX N y -24
+KPX N u -30
+KPX N o -30
+KPX N i -24
+KPX N e -30
+KPX N a -30
+
+KPX O z -6
+KPX O u -6
+KPX O t -6
+KPX O s -6
+KPX O q -6
+KPX O period -60
+KPX O p -6
+KPX O o -6
+KPX O n -5
+KPX O m -5
+KPX O l -6
+KPX O k -6
+KPX O i -5
+KPX O h -12
+KPX O g -6
+KPX O e -6
+KPX O d -6
+KPX O comma -50
+KPX O c -6
+KPX O a -12
+KPX O Y -55
+KPX O X -24
+KPX O W -30
+KPX O V -18
+KPX O T -30
+KPX O A -18
+
+KPX P u -12
+KPX P t -6
+KPX P s -24
+KPX P r -12
+KPX P period -200
+KPX P o -30
+KPX P n -12
+KPX P l -6
+KPX P hyphen -40
+KPX P h -6
+KPX P e -30
+KPX P comma -200
+KPX P a -36
+KPX P I -6
+KPX P H -12
+KPX P E -6
+KPX P A -55
+
+KPX Q u -6
+KPX Q a -18
+KPX Q Y -30
+KPX Q X -24
+KPX Q W -24
+KPX Q V -18
+KPX Q U -30
+KPX Q T -24
+KPX Q A -18
+
+KPX R y -20
+KPX R u -12
+KPX R quoteright -20
+KPX R quotedblright -20
+KPX R o -20
+KPX R hyphen -30
+KPX R e -20
+KPX R d -20
+KPX R a -12
+KPX R Y -45
+KPX R W -24
+KPX R V -32
+KPX R U -30
+KPX R T -32
+KPX R Q -24
+KPX R O -24
+KPX R G -24
+KPX R C -24
+
+KPX S y -25
+KPX S w -30
+KPX S v -30
+KPX S u -24
+KPX S t -24
+KPX S r -20
+KPX S quoteright -10
+KPX S quotedblright -10
+KPX S q -5
+KPX S p -24
+KPX S o -12
+KPX S n -20
+KPX S m -20
+KPX S l -18
+KPX S k -24
+KPX S j -12
+KPX S i -20
+KPX S h -12
+KPX S e -12
+KPX S a -18
+
+KPX T z -64
+KPX T y -84
+KPX T w -100
+KPX T u -82
+KPX T semicolon -56
+KPX T s -82
+KPX T r -82
+KPX T quoteright 24
+KPX T period -110
+KPX T parenright 54
+KPX T o -100
+KPX T m -82
+KPX T i -34
+KPX T hyphen -100
+KPX T endash -50
+KPX T emdash -50
+KPX T e -100
+KPX T comma -110
+KPX T colon -50
+KPX T bracketright 54
+KPX T braceright 54
+KPX T a -100
+KPX T Y 12
+KPX T X 18
+KPX T W 6
+KPX T V 6
+KPX T T 12
+KPX T S -12
+KPX T Q -18
+KPX T O -18
+KPX T G -18
+KPX T C -18
+KPX T A -65
+
+KPX U z -30
+KPX U y -20
+KPX U x -30
+KPX U v -20
+KPX U t -36
+KPX U s -40
+KPX U r -40
+KPX U p -42
+KPX U n -40
+KPX U m -40
+KPX U l -12
+KPX U k -12
+KPX U i -28
+KPX U h -6
+KPX U g -50
+KPX U f -12
+KPX U d -45
+KPX U c -45
+KPX U b -12
+KPX U a -40
+KPX U A -40
+
+KPX V y -36
+KPX V u -40
+KPX V semicolon -45
+KPX V r -70
+KPX V quoteright 36
+KPX V quotedblright 20
+KPX V period -140
+KPX V parenright 85
+KPX V o -70
+KPX V i 6
+KPX V hyphen -60
+KPX V endash -20
+KPX V emdash -20
+KPX V e -70
+KPX V comma -140
+KPX V colon -45
+KPX V bracketright 64
+KPX V braceright 64
+KPX V a -60
+KPX V T 6
+KPX V Q -12
+KPX V O -12
+KPX V G -12
+KPX V C -12
+KPX V A -60
+
+KPX W y -50
+KPX W u -46
+KPX W semicolon -40
+KPX W r -45
+KPX W quoteright 36
+KPX W quotedblright 20
+KPX W period -110
+KPX W parenright 85
+KPX W o -65
+KPX W m -45
+KPX W i -10
+KPX W hyphen -40
+KPX W e -65
+KPX W d -65
+KPX W comma -100
+KPX W colon -40
+KPX W bracketright 64
+KPX W braceright 64
+KPX W a -60
+KPX W T 18
+KPX W Q -6
+KPX W O -6
+KPX W G -6
+KPX W C -6
+KPX W A -48
+
+KPX X y -18
+KPX X u -24
+KPX X quoteright 15
+KPX X e -6
+KPX X a -6
+KPX X Q -24
+KPX X O -30
+KPX X G -30
+KPX X C -30
+KPX X A 6
+
+KPX Y v -50
+KPX Y u -54
+KPX Y t -46
+KPX Y semicolon -37
+KPX Y quoteright 36
+KPX Y quotedblright 20
+KPX Y q -100
+KPX Y period -90
+KPX Y parenright 60
+KPX Y o -90
+KPX Y l 10
+KPX Y hyphen -50
+KPX Y emdash -20
+KPX Y e -90
+KPX Y d -90
+KPX Y comma -90
+KPX Y colon -50
+KPX Y bracketright 64
+KPX Y braceright 64
+KPX Y a -68
+KPX Y Y 12
+KPX Y X 12
+KPX Y W 12
+KPX Y V 12
+KPX Y T 12
+KPX Y Q -18
+KPX Y O -18
+KPX Y G -18
+KPX Y C -18
+KPX Y A -32
+
+KPX Z y -36
+KPX Z w -36
+KPX Z u -6
+KPX Z o -12
+KPX Z i -12
+KPX Z e -6
+KPX Z a -6
+KPX Z Q -20
+KPX Z O -20
+KPX Z G -30
+KPX Z C -20
+KPX Z A 20
+
+KPX a quoteright -70
+KPX a quotedblright -80
+
+KPX b y -25
+KPX b w -30
+KPX b v -35
+KPX b quoteright -70
+KPX b quotedblright -70
+KPX b period -40
+KPX b comma -40
+
+KPX braceleft Y 64
+KPX braceleft W 64
+KPX braceleft V 64
+KPX braceleft T 54
+KPX braceleft J 80
+
+KPX bracketleft Y 64
+KPX bracketleft W 64
+KPX bracketleft V 64
+KPX bracketleft T 54
+KPX bracketleft J 80
+
+KPX c quoteright -28
+KPX c quotedblright -28
+KPX c period -10
+
+KPX comma quoteright -50
+KPX comma quotedblright -50
+
+KPX d quoteright -24
+KPX d quotedblright -24
+
+KPX e z -4
+KPX e quoteright -60
+KPX e quotedblright -60
+KPX e period -20
+KPX e comma -20
+
+KPX f quotesingle 30
+KPX f quoteright 65
+KPX f quotedblright 56
+KPX f quotedbl 30
+KPX f parenright 100
+KPX f bracketright 100
+KPX f braceright 100
+
+KPX g quoteright -18
+KPX g quotedblright -10
+
+KPX h quoteright -80
+KPX h quotedblright -80
+
+KPX j quoteright -20
+KPX j quotedblright -20
+KPX j period -30
+KPX j comma -30
+
+KPX k quoteright -40
+KPX k quotedblright -40
+
+KPX l quoteright -10
+KPX l quotedblright -10
+
+KPX m quoteright -80
+KPX m quotedblright -80
+
+KPX n quoteright -80
+KPX n quotedblright -80
+
+KPX o z -12
+KPX o y -30
+KPX o x -18
+KPX o w -30
+KPX o v -30
+KPX o quoteright -70
+KPX o quotedblright -70
+KPX o period -40
+KPX o comma -40
+
+KPX p z -20
+KPX p y -25
+KPX p w -30
+KPX p quoteright -70
+KPX p quotedblright -70
+KPX p period -40
+KPX p comma -40
+
+KPX parenleft Y 64
+KPX parenleft W 64
+KPX parenleft V 64
+KPX parenleft T 64
+KPX parenleft J 80
+
+KPX period quoteright -50
+KPX period quotedblright -50
+
+KPX q quoteright -50
+KPX q quotedblright -50
+KPX q period -20
+KPX q comma -10
+
+KPX quotedblleft z -60
+KPX quotedblleft y -30
+KPX quotedblleft x -40
+KPX quotedblleft w -20
+KPX quotedblleft v -20
+KPX quotedblleft u -40
+KPX quotedblleft t -40
+KPX quotedblleft s -50
+KPX quotedblleft r -50
+KPX quotedblleft q -80
+KPX quotedblleft p -50
+KPX quotedblleft o -80
+KPX quotedblleft n -50
+KPX quotedblleft m -50
+KPX quotedblleft g -70
+KPX quotedblleft f -50
+KPX quotedblleft e -80
+KPX quotedblleft d -80
+KPX quotedblleft c -80
+KPX quotedblleft a -70
+KPX quotedblleft Z -20
+KPX quotedblleft Y 12
+KPX quotedblleft W 18
+KPX quotedblleft V 18
+KPX quotedblleft U -20
+KPX quotedblleft T 10
+KPX quotedblleft S -20
+KPX quotedblleft R -20
+KPX quotedblleft Q -20
+KPX quotedblleft P -20
+KPX quotedblleft O -30
+KPX quotedblleft N -20
+KPX quotedblleft M -20
+KPX quotedblleft L -20
+KPX quotedblleft K -20
+KPX quotedblleft J -40
+KPX quotedblleft I -20
+KPX quotedblleft H -20
+KPX quotedblleft G -30
+KPX quotedblleft F -20
+KPX quotedblleft E -20
+KPX quotedblleft D -20
+KPX quotedblleft C -30
+KPX quotedblleft B -20
+KPX quotedblleft A -130
+
+KPX quotedblright period -130
+KPX quotedblright comma -130
+
+KPX quoteleft z -40
+KPX quoteleft y -35
+KPX quoteleft x -30
+KPX quoteleft w -20
+KPX quoteleft v -20
+KPX quoteleft u -50
+KPX quoteleft t -40
+KPX quoteleft s -45
+KPX quoteleft r -50
+KPX quoteleft quoteleft -72
+KPX quoteleft q -70
+KPX quoteleft p -50
+KPX quoteleft o -70
+KPX quoteleft n -50
+KPX quoteleft m -50
+KPX quoteleft g -65
+KPX quoteleft f -40
+KPX quoteleft e -70
+KPX quoteleft d -70
+KPX quoteleft c -70
+KPX quoteleft a -60
+KPX quoteleft Z -20
+KPX quoteleft Y 18
+KPX quoteleft X 12
+KPX quoteleft W 18
+KPX quoteleft V 18
+KPX quoteleft U -20
+KPX quoteleft T 10
+KPX quoteleft R -20
+KPX quoteleft Q -20
+KPX quoteleft P -20
+KPX quoteleft O -30
+KPX quoteleft N -20
+KPX quoteleft M -20
+KPX quoteleft L -20
+KPX quoteleft K -20
+KPX quoteleft J -40
+KPX quoteleft I -20
+KPX quoteleft H -20
+KPX quoteleft G -40
+KPX quoteleft F -20
+KPX quoteleft E -20
+KPX quoteleft D -20
+KPX quoteleft C -30
+KPX quoteleft B -20
+KPX quoteleft A -130
+
+KPX quoteright v -40
+KPX quoteright t -75
+KPX quoteright s -110
+KPX quoteright r -70
+KPX quoteright quoteright -72
+KPX quoteright period -130
+KPX quoteright m -70
+KPX quoteright l -6
+KPX quoteright d -120
+KPX quoteright comma -130
+
+KPX r z 10
+KPX r y 18
+KPX r x 12
+KPX r w 18
+KPX r v 18
+KPX r u 8
+KPX r t 8
+KPX r semicolon 10
+KPX r quoteright -20
+KPX r quotedblright -20
+KPX r q -6
+KPX r period -60
+KPX r o -6
+KPX r n 8
+KPX r m 8
+KPX r k -6
+KPX r i 8
+KPX r hyphen -20
+KPX r h 6
+KPX r g -6
+KPX r f 8
+KPX r e -20
+KPX r d -20
+KPX r comma -60
+KPX r colon 10
+KPX r c -20
+KPX r a -10
+
+KPX s quoteright -40
+KPX s quotedblright -40
+KPX s period -20
+KPX s comma -10
+
+KPX space quotesinglbase -60
+KPX space quoteleft -40
+KPX space quotedblleft -40
+KPX space quotedblbase -60
+KPX space Y -60
+KPX space W -60
+KPX space V -60
+KPX space T -36
+
+KPX t quoteright -18
+KPX t quotedblright -18
+
+KPX u quoteright -30
+KPX u quotedblright -30
+
+KPX v semicolon 10
+KPX v quoteright 20
+KPX v quotedblright 20
+KPX v q -10
+KPX v period -90
+KPX v o -5
+KPX v e -5
+KPX v d -10
+KPX v comma -90
+KPX v colon 10
+KPX v c -6
+KPX v a -6
+
+KPX w semicolon 10
+KPX w quoteright 20
+KPX w quotedblright 20
+KPX w q -6
+KPX w period -80
+KPX w e -6
+KPX w d -6
+KPX w comma -75
+KPX w colon 10
+KPX w c -6
+
+KPX x quoteright -10
+KPX x quotedblright -20
+KPX x q -6
+KPX x o -6
+KPX x d -12
+KPX x c -12
+
+KPX y semicolon 10
+KPX y q -6
+KPX y period -95
+KPX y o -6
+KPX y hyphen -30
+KPX y e -6
+KPX y d -6
+KPX y comma -85
+KPX y colon 10
+KPX y c -6
+
+KPX z quoteright -20
+KPX z quotedblright -30
+KPX z o -6
+KPX z e -6
+KPX z d -6
+KPX z c -6
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putri8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putri8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b3dd45b553bb72a47ff31ebdc766ef0bfc5a4370
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putri8a.afm
@@ -0,0 +1,1008 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Fri Jan 17 13:15:45 1992
+Comment UniqueID 37666
+Comment VMusage 34143 41035
+FontName Utopia-Italic
+FullName Utopia Italic
+FamilyName Utopia
+Weight Regular
+ItalicAngle -13
+IsFixedPitch false
+FontBBox -201 -250 1170 890
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.002
+Notice Copyright (c) 1989, 1991 Adobe Systems Incorporated. All Rights Reserved.Utopia is a registered trademark of Adobe Systems Incorporated.
+EncodingScheme AdobeStandardEncoding
+CapHeight 692
+XHeight 502
+Ascender 742
+Descender -242
+StartCharMetrics 228
+C 32 ; WX 225 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 240 ; N exclam ; B 34 -12 290 707 ;
+C 34 ; WX 402 ; N quotedbl ; B 171 469 454 742 ;
+C 35 ; WX 530 ; N numbersign ; B 54 0 585 668 ;
+C 36 ; WX 530 ; N dollar ; B 31 -109 551 743 ;
+C 37 ; WX 826 ; N percent ; B 98 -25 795 702 ;
+C 38 ; WX 725 ; N ampersand ; B 60 -12 703 680 ;
+C 39 ; WX 216 ; N quoteright ; B 112 482 265 742 ;
+C 40 ; WX 350 ; N parenleft ; B 106 -128 458 692 ;
+C 41 ; WX 350 ; N parenright ; B -46 -128 306 692 ;
+C 42 ; WX 412 ; N asterisk ; B 106 356 458 707 ;
+C 43 ; WX 570 ; N plus ; B 58 0 542 490 ;
+C 44 ; WX 265 ; N comma ; B 11 -134 173 142 ;
+C 45 ; WX 392 ; N hyphen ; B 82 216 341 286 ;
+C 46 ; WX 265 ; N period ; B 47 -12 169 113 ;
+C 47 ; WX 270 ; N slash ; B 0 -15 341 707 ;
+C 48 ; WX 530 ; N zero ; B 60 -12 541 680 ;
+C 49 ; WX 530 ; N one ; B 74 0 429 680 ;
+C 50 ; WX 530 ; N two ; B -2 0 538 680 ;
+C 51 ; WX 530 ; N three ; B 19 -12 524 680 ;
+C 52 ; WX 530 ; N four ; B 32 0 509 668 ;
+C 53 ; WX 530 ; N five ; B 24 -12 550 668 ;
+C 54 ; WX 530 ; N six ; B 56 -12 551 680 ;
+C 55 ; WX 530 ; N seven ; B 130 -12 600 668 ;
+C 56 ; WX 530 ; N eight ; B 46 -12 535 680 ;
+C 57 ; WX 530 ; N nine ; B 51 -12 536 680 ;
+C 58 ; WX 265 ; N colon ; B 47 -12 248 490 ;
+C 59 ; WX 265 ; N semicolon ; B 11 -134 248 490 ;
+C 60 ; WX 570 ; N less ; B 51 1 529 497 ;
+C 61 ; WX 570 ; N equal ; B 58 111 542 389 ;
+C 62 ; WX 570 ; N greater ; B 51 1 529 497 ;
+C 63 ; WX 425 ; N question ; B 115 -12 456 707 ;
+C 64 ; WX 794 ; N at ; B 88 -15 797 707 ;
+C 65 ; WX 624 ; N A ; B -58 0 623 692 ;
+C 66 ; WX 632 ; N B ; B 3 0 636 692 ;
+C 67 ; WX 661 ; N C ; B 79 -15 723 707 ;
+C 68 ; WX 763 ; N D ; B 5 0 767 692 ;
+C 69 ; WX 596 ; N E ; B 3 0 657 692 ;
+C 70 ; WX 571 ; N F ; B 3 0 660 692 ;
+C 71 ; WX 709 ; N G ; B 79 -15 737 707 ;
+C 72 ; WX 775 ; N H ; B 5 0 857 692 ;
+C 73 ; WX 345 ; N I ; B 5 0 428 692 ;
+C 74 ; WX 352 ; N J ; B -78 -119 436 692 ;
+C 75 ; WX 650 ; N K ; B 5 -5 786 692 ;
+C 76 ; WX 565 ; N L ; B 5 0 568 692 ;
+C 77 ; WX 920 ; N M ; B -4 0 1002 692 ;
+C 78 ; WX 763 ; N N ; B -4 0 855 692 ;
+C 79 ; WX 753 ; N O ; B 79 -15 754 707 ;
+C 80 ; WX 614 ; N P ; B 5 0 646 692 ;
+C 81 ; WX 753 ; N Q ; B 79 -203 754 707 ;
+C 82 ; WX 640 ; N R ; B 5 0 642 692 ;
+C 83 ; WX 533 ; N S ; B 34 -15 542 707 ;
+C 84 ; WX 606 ; N T ; B 102 0 708 692 ;
+C 85 ; WX 794 ; N U ; B 131 -15 880 692 ;
+C 86 ; WX 637 ; N V ; B 96 0 786 692 ;
+C 87 ; WX 946 ; N W ; B 86 0 1075 692 ;
+C 88 ; WX 632 ; N X ; B -36 0 735 692 ;
+C 89 ; WX 591 ; N Y ; B 96 0 744 692 ;
+C 90 ; WX 622 ; N Z ; B -20 0 703 692 ;
+C 91 ; WX 330 ; N bracketleft ; B 69 -128 414 692 ;
+C 92 ; WX 390 ; N backslash ; B 89 -15 371 707 ;
+C 93 ; WX 330 ; N bracketright ; B -21 -128 324 692 ;
+C 94 ; WX 570 ; N asciicircum ; B 83 228 547 668 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 216 ; N quoteleft ; B 130 488 283 748 ;
+C 97 ; WX 561 ; N a ; B 31 -12 563 502 ;
+C 98 ; WX 559 ; N b ; B 47 -12 557 742 ;
+C 99 ; WX 441 ; N c ; B 46 -12 465 502 ;
+C 100 ; WX 587 ; N d ; B 37 -12 612 742 ;
+C 101 ; WX 453 ; N e ; B 45 -12 471 502 ;
+C 102 ; WX 315 ; N f ; B -107 -242 504 742 ; L i fi ; L l fl ;
+C 103 ; WX 499 ; N g ; B -5 -242 573 512 ;
+C 104 ; WX 607 ; N h ; B 57 -12 588 742 ;
+C 105 ; WX 317 ; N i ; B 79 -12 328 715 ;
+C 106 ; WX 309 ; N j ; B -95 -242 330 715 ;
+C 107 ; WX 545 ; N k ; B 57 -12 567 742 ;
+C 108 ; WX 306 ; N l ; B 76 -12 331 742 ;
+C 109 ; WX 912 ; N m ; B 63 -12 894 502 ;
+C 110 ; WX 618 ; N n ; B 63 -12 600 502 ;
+C 111 ; WX 537 ; N o ; B 49 -12 522 502 ;
+C 112 ; WX 590 ; N p ; B 22 -242 586 502 ;
+C 113 ; WX 559 ; N q ; B 38 -242 567 525 ;
+C 114 ; WX 402 ; N r ; B 69 -12 448 502 ;
+C 115 ; WX 389 ; N s ; B 19 -12 397 502 ;
+C 116 ; WX 341 ; N t ; B 84 -12 404 616 ;
+C 117 ; WX 618 ; N u ; B 89 -12 609 502 ;
+C 118 ; WX 510 ; N v ; B 84 -12 528 502 ;
+C 119 ; WX 785 ; N w ; B 87 -12 808 502 ;
+C 120 ; WX 516 ; N x ; B -4 -12 531 502 ;
+C 121 ; WX 468 ; N y ; B -40 -242 505 502 ;
+C 122 ; WX 468 ; N z ; B 4 -12 483 490 ;
+C 123 ; WX 340 ; N braceleft ; B 100 -128 423 692 ;
+C 124 ; WX 270 ; N bar ; B 130 -250 198 750 ;
+C 125 ; WX 340 ; N braceright ; B -20 -128 302 692 ;
+C 126 ; WX 570 ; N asciitilde ; B 98 176 522 318 ;
+C 161 ; WX 240 ; N exclamdown ; B -18 -217 238 502 ;
+C 162 ; WX 530 ; N cent ; B 94 -21 563 669 ;
+C 163 ; WX 530 ; N sterling ; B 9 0 549 680 ;
+C 164 ; WX 100 ; N fraction ; B -201 -24 369 698 ;
+C 165 ; WX 530 ; N yen ; B 72 0 645 668 ;
+C 166 ; WX 530 ; N florin ; B 4 -135 588 691 ;
+C 167 ; WX 530 ; N section ; B 55 -115 533 707 ;
+C 168 ; WX 530 ; N currency ; B 56 90 536 578 ;
+C 169 ; WX 216 ; N quotesingle ; B 161 469 274 742 ;
+C 170 ; WX 402 ; N quotedblleft ; B 134 488 473 748 ;
+C 171 ; WX 462 ; N guillemotleft ; B 79 41 470 435 ;
+C 172 ; WX 277 ; N guilsinglleft ; B 71 41 267 435 ;
+C 173 ; WX 277 ; N guilsinglright ; B 44 41 240 435 ;
+C 174 ; WX 607 ; N fi ; B -107 -242 589 742 ;
+C 175 ; WX 603 ; N fl ; B -107 -242 628 742 ;
+C 177 ; WX 500 ; N endash ; B 12 221 524 279 ;
+C 178 ; WX 500 ; N dagger ; B 101 -125 519 717 ;
+C 179 ; WX 490 ; N daggerdbl ; B 39 -119 509 717 ;
+C 180 ; WX 265 ; N periodcentered ; B 89 187 211 312 ;
+C 182 ; WX 560 ; N paragraph ; B 109 -101 637 692 ;
+C 183 ; WX 500 ; N bullet ; B 110 192 429 512 ;
+C 184 ; WX 216 ; N quotesinglbase ; B -7 -109 146 151 ;
+C 185 ; WX 402 ; N quotedblbase ; B -7 -109 332 151 ;
+C 186 ; WX 402 ; N quotedblright ; B 107 484 446 744 ;
+C 187 ; WX 462 ; N guillemotright ; B 29 41 420 435 ;
+C 188 ; WX 1000 ; N ellipsis ; B 85 -12 873 113 ;
+C 189 ; WX 1200 ; N perthousand ; B 98 -25 1170 702 ;
+C 191 ; WX 425 ; N questiondown ; B 3 -217 344 502 ;
+C 193 ; WX 400 ; N grave ; B 146 542 368 723 ;
+C 194 ; WX 400 ; N acute ; B 214 542 436 723 ;
+C 195 ; WX 400 ; N circumflex ; B 187 546 484 720 ;
+C 196 ; WX 400 ; N tilde ; B 137 563 492 682 ;
+C 197 ; WX 400 ; N macron ; B 193 597 489 656 ;
+C 198 ; WX 400 ; N breve ; B 227 568 501 698 ;
+C 199 ; WX 402 ; N dotaccent ; B 252 570 359 680 ;
+C 200 ; WX 400 ; N dieresis ; B 172 572 487 682 ;
+C 202 ; WX 400 ; N ring ; B 186 550 402 752 ;
+C 203 ; WX 400 ; N cedilla ; B 62 -230 241 0 ;
+C 205 ; WX 400 ; N hungarumlaut ; B 176 546 455 750 ;
+C 206 ; WX 350 ; N ogonek ; B 68 -219 248 0 ;
+C 207 ; WX 400 ; N caron ; B 213 557 510 731 ;
+C 208 ; WX 1000 ; N emdash ; B 12 221 1024 279 ;
+C 225 ; WX 880 ; N AE ; B -88 0 941 692 ;
+C 227 ; WX 425 ; N ordfeminine ; B 77 265 460 590 ;
+C 232 ; WX 571 ; N Lslash ; B 11 0 574 692 ;
+C 233 ; WX 753 ; N Oslash ; B 79 -45 754 736 ;
+C 234 ; WX 1020 ; N OE ; B 79 0 1081 692 ;
+C 235 ; WX 389 ; N ordmasculine ; B 86 265 420 590 ;
+C 241 ; WX 779 ; N ae ; B 34 -12 797 514 ;
+C 245 ; WX 317 ; N dotlessi ; B 79 -12 299 502 ;
+C 248 ; WX 318 ; N lslash ; B 45 -12 376 742 ;
+C 249 ; WX 537 ; N oslash ; B 49 -39 522 529 ;
+C 250 ; WX 806 ; N oe ; B 49 -12 824 502 ;
+C 251 ; WX 577 ; N germandbls ; B -107 -242 630 742 ;
+C -1 ; WX 370 ; N onesuperior ; B 90 272 326 680 ;
+C -1 ; WX 570 ; N minus ; B 58 221 542 279 ;
+C -1 ; WX 400 ; N degree ; B 152 404 428 680 ;
+C -1 ; WX 537 ; N oacute ; B 49 -12 530 723 ;
+C -1 ; WX 753 ; N Odieresis ; B 79 -15 754 848 ;
+C -1 ; WX 537 ; N odieresis ; B 49 -12 532 682 ;
+C -1 ; WX 596 ; N Eacute ; B 3 0 657 890 ;
+C -1 ; WX 618 ; N ucircumflex ; B 89 -12 609 720 ;
+C -1 ; WX 890 ; N onequarter ; B 97 -24 805 698 ;
+C -1 ; WX 570 ; N logicalnot ; B 58 102 542 389 ;
+C -1 ; WX 596 ; N Ecircumflex ; B 3 0 657 876 ;
+C -1 ; WX 890 ; N onehalf ; B 71 -24 812 698 ;
+C -1 ; WX 753 ; N Otilde ; B 79 -15 754 842 ;
+C -1 ; WX 618 ; N uacute ; B 89 -12 609 723 ;
+C -1 ; WX 453 ; N eacute ; B 45 -12 508 723 ;
+C -1 ; WX 317 ; N iacute ; B 79 -12 398 723 ;
+C -1 ; WX 596 ; N Egrave ; B 3 0 657 890 ;
+C -1 ; WX 317 ; N icircumflex ; B 79 -12 383 720 ;
+C -1 ; WX 618 ; N mu ; B 11 -232 609 502 ;
+C -1 ; WX 270 ; N brokenbar ; B 130 -175 198 675 ;
+C -1 ; WX 584 ; N thorn ; B 16 -242 580 700 ;
+C -1 ; WX 624 ; N Aring ; B -58 0 623 861 ;
+C -1 ; WX 468 ; N yacute ; B -40 -242 505 723 ;
+C -1 ; WX 591 ; N Ydieresis ; B 96 0 744 848 ;
+C -1 ; WX 1100 ; N trademark ; B 91 277 1094 692 ;
+C -1 ; WX 836 ; N registered ; B 91 -15 819 707 ;
+C -1 ; WX 537 ; N ocircumflex ; B 49 -12 522 720 ;
+C -1 ; WX 624 ; N Agrave ; B -58 0 623 890 ;
+C -1 ; WX 533 ; N Scaron ; B 34 -15 561 888 ;
+C -1 ; WX 794 ; N Ugrave ; B 131 -15 880 890 ;
+C -1 ; WX 596 ; N Edieresis ; B 3 0 657 848 ;
+C -1 ; WX 794 ; N Uacute ; B 131 -15 880 890 ;
+C -1 ; WX 537 ; N otilde ; B 49 -12 525 682 ;
+C -1 ; WX 618 ; N ntilde ; B 63 -12 600 682 ;
+C -1 ; WX 468 ; N ydieresis ; B -40 -242 513 682 ;
+C -1 ; WX 624 ; N Aacute ; B -58 0 642 890 ;
+C -1 ; WX 537 ; N eth ; B 47 -12 521 742 ;
+C -1 ; WX 561 ; N acircumflex ; B 31 -12 563 720 ;
+C -1 ; WX 561 ; N aring ; B 31 -12 563 752 ;
+C -1 ; WX 753 ; N Ograve ; B 79 -15 754 890 ;
+C -1 ; WX 441 ; N ccedilla ; B 46 -230 465 502 ;
+C -1 ; WX 570 ; N multiply ; B 88 22 532 478 ;
+C -1 ; WX 570 ; N divide ; B 58 25 542 475 ;
+C -1 ; WX 370 ; N twosuperior ; B 35 272 399 680 ;
+C -1 ; WX 763 ; N Ntilde ; B -4 0 855 842 ;
+C -1 ; WX 618 ; N ugrave ; B 89 -12 609 723 ;
+C -1 ; WX 794 ; N Ucircumflex ; B 131 -15 880 876 ;
+C -1 ; WX 624 ; N Atilde ; B -58 0 623 842 ;
+C -1 ; WX 468 ; N zcaron ; B 4 -12 484 731 ;
+C -1 ; WX 317 ; N idieresis ; B 79 -12 398 682 ;
+C -1 ; WX 624 ; N Acircumflex ; B -58 0 623 876 ;
+C -1 ; WX 345 ; N Icircumflex ; B 5 0 453 876 ;
+C -1 ; WX 591 ; N Yacute ; B 96 0 744 890 ;
+C -1 ; WX 753 ; N Oacute ; B 79 -15 754 890 ;
+C -1 ; WX 624 ; N Adieresis ; B -58 0 623 848 ;
+C -1 ; WX 622 ; N Zcaron ; B -20 0 703 888 ;
+C -1 ; WX 561 ; N agrave ; B 31 -12 563 723 ;
+C -1 ; WX 370 ; N threesuperior ; B 59 265 389 680 ;
+C -1 ; WX 537 ; N ograve ; B 49 -12 522 723 ;
+C -1 ; WX 890 ; N threequarters ; B 105 -24 816 698 ;
+C -1 ; WX 770 ; N Eth ; B 12 0 774 692 ;
+C -1 ; WX 570 ; N plusminus ; B 58 0 542 556 ;
+C -1 ; WX 618 ; N udieresis ; B 89 -12 609 682 ;
+C -1 ; WX 453 ; N edieresis ; B 45 -12 490 682 ;
+C -1 ; WX 561 ; N aacute ; B 31 -12 571 723 ;
+C -1 ; WX 317 ; N igrave ; B 55 -12 299 723 ;
+C -1 ; WX 345 ; N Idieresis ; B 5 0 461 848 ;
+C -1 ; WX 561 ; N adieresis ; B 31 -12 563 682 ;
+C -1 ; WX 345 ; N Iacute ; B 5 0 506 890 ;
+C -1 ; WX 836 ; N copyright ; B 91 -15 819 707 ;
+C -1 ; WX 345 ; N Igrave ; B 5 0 428 890 ;
+C -1 ; WX 661 ; N Ccedilla ; B 79 -230 723 707 ;
+C -1 ; WX 389 ; N scaron ; B 19 -12 457 731 ;
+C -1 ; WX 453 ; N egrave ; B 45 -12 471 723 ;
+C -1 ; WX 753 ; N Ocircumflex ; B 79 -15 754 876 ;
+C -1 ; WX 604 ; N Thorn ; B 5 0 616 692 ;
+C -1 ; WX 561 ; N atilde ; B 31 -12 563 682 ;
+C -1 ; WX 794 ; N Udieresis ; B 131 -15 880 848 ;
+C -1 ; WX 453 ; N ecircumflex ; B 45 -12 475 720 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 690
+
+KPX A y -20
+KPX A x 10
+KPX A w -30
+KPX A v -30
+KPX A u -10
+KPX A t -6
+KPX A s 15
+KPX A r -12
+KPX A quoteright -110
+KPX A quotedblright -110
+KPX A q 10
+KPX A p -12
+KPX A o -10
+KPX A n -18
+KPX A m -18
+KPX A l -18
+KPX A j 6
+KPX A h -6
+KPX A d 10
+KPX A c -6
+KPX A b -6
+KPX A a 12
+KPX A Y -76
+KPX A X -8
+KPX A W -80
+KPX A V -90
+KPX A U -60
+KPX A T -72
+KPX A Q -30
+KPX A O -30
+KPX A G -30
+KPX A C -30
+
+KPX B y -6
+KPX B u -20
+KPX B r -15
+KPX B quoteright -40
+KPX B quotedblright -30
+KPX B o 6
+KPX B l -20
+KPX B k -15
+KPX B i -12
+KPX B h -15
+KPX B e 6
+KPX B a 12
+KPX B W -20
+KPX B V -50
+KPX B U -50
+KPX B T -20
+
+KPX C z -6
+KPX C y -18
+KPX C u -18
+KPX C quotedblright 20
+KPX C i -5
+KPX C e -6
+KPX C a -6
+
+KPX D y 18
+KPX D u -10
+KPX D quoteright -40
+KPX D quotedblright -50
+KPX D period -30
+KPX D o 6
+KPX D i 6
+KPX D h -25
+KPX D e 6
+KPX D comma -20
+KPX D a 6
+KPX D Y -70
+KPX D W -50
+KPX D V -60
+
+KPX E z -6
+KPX E y -18
+KPX E x 5
+KPX E w -20
+KPX E v -18
+KPX E u -24
+KPX E t -18
+KPX E s 5
+KPX E r -6
+KPX E quoteright 10
+KPX E quotedblright 10
+KPX E q 10
+KPX E period 10
+KPX E p -12
+KPX E o -6
+KPX E n -12
+KPX E m -12
+KPX E l -12
+KPX E k -10
+KPX E j -6
+KPX E i -12
+KPX E g -12
+KPX E e 5
+KPX E d 10
+KPX E comma 10
+KPX E b -6
+
+KPX F y -12
+KPX F u -30
+KPX F r -18
+KPX F quoteright 15
+KPX F quotedblright 35
+KPX F period -180
+KPX F o -30
+KPX F l -6
+KPX F i -12
+KPX F e -30
+KPX F comma -170
+KPX F a -30
+KPX F A -45
+
+KPX G y -16
+KPX G u -22
+KPX G r -22
+KPX G quoteright -20
+KPX G quotedblright -20
+KPX G o 10
+KPX G n -22
+KPX G l -24
+KPX G i -12
+KPX G h -18
+KPX G e 10
+KPX G a 5
+
+KPX H y -18
+KPX H u -30
+KPX H quoteright 10
+KPX H quotedblright 10
+KPX H o -12
+KPX H i -12
+KPX H e -12
+KPX H a -12
+
+KPX I z -20
+KPX I y -6
+KPX I x -6
+KPX I w -30
+KPX I v -30
+KPX I u -30
+KPX I t -18
+KPX I s -18
+KPX I r -12
+KPX I quoteright 10
+KPX I quotedblright 10
+KPX I p -18
+KPX I o -12
+KPX I n -18
+KPX I m -18
+KPX I l -6
+KPX I k -6
+KPX I g -12
+KPX I f -6
+KPX I d -6
+KPX I c -12
+KPX I b -6
+KPX I a -6
+
+KPX J y -12
+KPX J u -36
+KPX J quoteright 6
+KPX J quotedblright 15
+KPX J o -36
+KPX J i -30
+KPX J e -36
+KPX J braceright 10
+KPX J a -36
+
+KPX K y -40
+KPX K w -30
+KPX K v -20
+KPX K u -24
+KPX K r -12
+KPX K quoteright 25
+KPX K quotedblright 40
+KPX K o -24
+KPX K n -18
+KPX K i -6
+KPX K h 6
+KPX K e -12
+KPX K a -6
+KPX K Q -24
+KPX K O -24
+KPX K G -24
+KPX K C -24
+
+KPX L y -55
+KPX L w -30
+KPX L u -18
+KPX L quoteright -110
+KPX L quotedblright -110
+KPX L l -16
+KPX L j -18
+KPX L i -18
+KPX L a 10
+KPX L Y -80
+KPX L W -90
+KPX L V -110
+KPX L U -42
+KPX L T -80
+KPX L Q -48
+KPX L O -48
+KPX L G -48
+KPX L C -48
+KPX L A 30
+
+KPX M y -18
+KPX M u -24
+KPX M quoteright 6
+KPX M quotedblright 15
+KPX M o -25
+KPX M n -12
+KPX M j -18
+KPX M i -12
+KPX M e -20
+KPX M d -10
+KPX M c -20
+KPX M a -6
+
+KPX N y -18
+KPX N u -24
+KPX N quoteright 10
+KPX N quotedblright 10
+KPX N o -25
+KPX N i -12
+KPX N e -20
+KPX N a -22
+
+KPX O z -6
+KPX O y 12
+KPX O w -10
+KPX O v -10
+KPX O u -6
+KPX O t -6
+KPX O s -6
+KPX O r -6
+KPX O quoteright -40
+KPX O quotedblright -40
+KPX O q 5
+KPX O period -20
+KPX O p -6
+KPX O n -6
+KPX O m -6
+KPX O l -20
+KPX O k -10
+KPX O j -6
+KPX O h -10
+KPX O g -6
+KPX O e 5
+KPX O d 6
+KPX O comma -10
+KPX O c 5
+KPX O b -6
+KPX O a 5
+KPX O Y -75
+KPX O X -30
+KPX O W -40
+KPX O V -60
+KPX O T -48
+KPX O A -18
+
+KPX P y 6
+KPX P u -18
+KPX P t -6
+KPX P s -24
+KPX P r -6
+KPX P period -220
+KPX P o -24
+KPX P n -12
+KPX P l -25
+KPX P h -15
+KPX P e -24
+KPX P comma -220
+KPX P a -24
+KPX P I -30
+KPX P H -30
+KPX P E -30
+KPX P A -75
+
+KPX Q u -6
+KPX Q quoteright -40
+KPX Q quotedblright -50
+KPX Q a -6
+KPX Q Y -70
+KPX Q X -12
+KPX Q W -35
+KPX Q V -60
+KPX Q U -35
+KPX Q T -36
+KPX Q A -18
+
+KPX R y -14
+KPX R u -12
+KPX R quoteright -30
+KPX R quotedblright -20
+KPX R o -12
+KPX R hyphen -20
+KPX R e -12
+KPX R Y -50
+KPX R W -30
+KPX R V -40
+KPX R U -40
+KPX R T -30
+KPX R Q -10
+KPX R O -10
+KPX R G -10
+KPX R C -10
+KPX R A -6
+
+KPX S y -30
+KPX S w -30
+KPX S v -30
+KPX S u -18
+KPX S t -30
+KPX S r -20
+KPX S quoteright -38
+KPX S quotedblright -30
+KPX S p -18
+KPX S n -24
+KPX S m -24
+KPX S l -30
+KPX S k -24
+KPX S j -25
+KPX S i -30
+KPX S h -30
+KPX S e -6
+
+KPX T z -70
+KPX T y -60
+KPX T w -64
+KPX T u -74
+KPX T semicolon -36
+KPX T s -72
+KPX T r -64
+KPX T quoteright 45
+KPX T quotedblright 50
+KPX T period -100
+KPX T parenright 54
+KPX T o -90
+KPX T m -64
+KPX T i -34
+KPX T hyphen -100
+KPX T endash -60
+KPX T emdash -60
+KPX T e -90
+KPX T comma -110
+KPX T colon -10
+KPX T bracketright 45
+KPX T braceright 54
+KPX T a -90
+KPX T Y 12
+KPX T X 18
+KPX T W 6
+KPX T T 18
+KPX T Q -12
+KPX T O -12
+KPX T G -12
+KPX T C -12
+KPX T A -56
+
+KPX U z -30
+KPX U x -40
+KPX U t -24
+KPX U s -30
+KPX U r -30
+KPX U quoteright 10
+KPX U quotedblright 10
+KPX U p -40
+KPX U n -45
+KPX U m -45
+KPX U l -12
+KPX U k -12
+KPX U i -24
+KPX U h -6
+KPX U g -30
+KPX U d -40
+KPX U c -35
+KPX U b -6
+KPX U a -40
+KPX U A -45
+
+KPX V y -46
+KPX V u -42
+KPX V semicolon -35
+KPX V r -50
+KPX V quoteright 75
+KPX V quotedblright 70
+KPX V period -130
+KPX V parenright 64
+KPX V o -62
+KPX V i -10
+KPX V hyphen -60
+KPX V endash -20
+KPX V emdash -20
+KPX V e -52
+KPX V comma -120
+KPX V colon -18
+KPX V bracketright 64
+KPX V braceright 64
+KPX V a -60
+KPX V T 6
+KPX V A -70
+
+KPX W y -42
+KPX W u -56
+KPX W t -20
+KPX W semicolon -28
+KPX W r -40
+KPX W quoteright 55
+KPX W quotedblright 60
+KPX W period -108
+KPX W parenright 64
+KPX W o -60
+KPX W m -35
+KPX W i -10
+KPX W hyphen -40
+KPX W endash -2
+KPX W emdash -10
+KPX W e -54
+KPX W d -50
+KPX W comma -108
+KPX W colon -28
+KPX W bracketright 55
+KPX W braceright 64
+KPX W a -60
+KPX W T 12
+KPX W Q -10
+KPX W O -10
+KPX W G -10
+KPX W C -10
+KPX W A -58
+
+KPX X y -35
+KPX X u -30
+KPX X r -6
+KPX X quoteright 35
+KPX X quotedblright 15
+KPX X i -6
+KPX X e -10
+KPX X a 5
+KPX X Y -6
+KPX X W -6
+KPX X Q -30
+KPX X O -30
+KPX X G -30
+KPX X C -30
+KPX X A -18
+
+KPX Y v -50
+KPX Y u -58
+KPX Y t -32
+KPX Y semicolon -36
+KPX Y quoteright 65
+KPX Y quotedblright 70
+KPX Y q -100
+KPX Y period -90
+KPX Y parenright 60
+KPX Y o -72
+KPX Y l 10
+KPX Y hyphen -95
+KPX Y endash -20
+KPX Y emdash -20
+KPX Y e -72
+KPX Y d -80
+KPX Y comma -80
+KPX Y colon -36
+KPX Y bracketright 64
+KPX Y braceright 75
+KPX Y a -82
+KPX Y Y 12
+KPX Y X 12
+KPX Y W 12
+KPX Y V 6
+KPX Y T 25
+KPX Y Q -5
+KPX Y O -5
+KPX Y G -5
+KPX Y C -5
+KPX Y A -36
+
+KPX Z y -36
+KPX Z w -36
+KPX Z u -12
+KPX Z quoteright 10
+KPX Z quotedblright 10
+KPX Z o -6
+KPX Z i -12
+KPX Z e -6
+KPX Z a -6
+KPX Z Q -30
+KPX Z O -30
+KPX Z G -30
+KPX Z C -30
+KPX Z A 12
+
+KPX a quoteright -40
+KPX a quotedblright -40
+
+KPX b y -6
+KPX b w -15
+KPX b v -15
+KPX b quoteright -50
+KPX b quotedblright -50
+KPX b period -40
+KPX b comma -30
+
+KPX braceleft Y 64
+KPX braceleft W 64
+KPX braceleft V 64
+KPX braceleft T 54
+KPX braceleft J 80
+
+KPX bracketleft Y 64
+KPX bracketleft W 64
+KPX bracketleft V 64
+KPX bracketleft T 54
+KPX bracketleft J 80
+
+KPX c quoteright -20
+KPX c quotedblright -20
+
+KPX colon space -30
+
+KPX comma space -40
+KPX comma quoteright -80
+KPX comma quotedblright -80
+
+KPX d quoteright -12
+KPX d quotedblright -12
+
+KPX e x -10
+KPX e w -10
+KPX e quoteright -30
+KPX e quotedblright -30
+
+KPX f quoteright 110
+KPX f quotedblright 110
+KPX f period -20
+KPX f parenright 100
+KPX f comma -20
+KPX f bracketright 90
+KPX f braceright 90
+
+KPX g y 30
+KPX g p 12
+KPX g f 42
+
+KPX h quoteright -80
+KPX h quotedblright -80
+
+KPX j quoteright -20
+KPX j quotedblright -20
+KPX j period -35
+KPX j comma -20
+
+KPX k quoteright -30
+KPX k quotedblright -50
+
+KPX m quoteright -80
+KPX m quotedblright -80
+
+KPX n quoteright -80
+KPX n quotedblright -80
+
+KPX o z -10
+KPX o y -20
+KPX o x -20
+KPX o w -30
+KPX o v -35
+KPX o quoteright -60
+KPX o quotedblright -50
+KPX o period -30
+KPX o comma -20
+
+KPX p z -10
+KPX p w -15
+KPX p quoteright -50
+KPX p quotedblright -70
+KPX p period -30
+KPX p comma -20
+
+KPX parenleft Y 75
+KPX parenleft W 75
+KPX parenleft V 75
+KPX parenleft T 64
+KPX parenleft J 80
+
+KPX period space -40
+KPX period quoteright -80
+KPX period quotedblright -80
+
+KPX q quoteright -20
+KPX q quotedblright -30
+KPX q period -20
+KPX q comma -10
+
+KPX quotedblleft z -30
+KPX quotedblleft x -40
+KPX quotedblleft w -12
+KPX quotedblleft v -12
+KPX quotedblleft u -12
+KPX quotedblleft t -12
+KPX quotedblleft s -30
+KPX quotedblleft r -12
+KPX quotedblleft q -40
+KPX quotedblleft p -12
+KPX quotedblleft o -30
+KPX quotedblleft n -12
+KPX quotedblleft m -12
+KPX quotedblleft l 10
+KPX quotedblleft k 10
+KPX quotedblleft h 10
+KPX quotedblleft g -30
+KPX quotedblleft e -40
+KPX quotedblleft d -40
+KPX quotedblleft c -40
+KPX quotedblleft b 24
+KPX quotedblleft a -60
+KPX quotedblleft Y 12
+KPX quotedblleft X 28
+KPX quotedblleft W 28
+KPX quotedblleft V 28
+KPX quotedblleft T 36
+KPX quotedblleft A -90
+
+KPX quotedblright space -40
+KPX quotedblright period -100
+KPX quotedblright comma -100
+
+KPX quoteleft z -30
+KPX quoteleft y -10
+KPX quoteleft x -40
+KPX quoteleft w -12
+KPX quoteleft v -12
+KPX quoteleft u -12
+KPX quoteleft t -12
+KPX quoteleft s -30
+KPX quoteleft r -12
+KPX quoteleft quoteleft -18
+KPX quoteleft q -30
+KPX quoteleft p -12
+KPX quoteleft o -30
+KPX quoteleft n -12
+KPX quoteleft m -12
+KPX quoteleft l 10
+KPX quoteleft k 10
+KPX quoteleft h 10
+KPX quoteleft g -30
+KPX quoteleft e -30
+KPX quoteleft d -30
+KPX quoteleft c -30
+KPX quoteleft b 24
+KPX quoteleft a -45
+KPX quoteleft Y 12
+KPX quoteleft X 28
+KPX quoteleft W 28
+KPX quoteleft V 28
+KPX quoteleft T 36
+KPX quoteleft A -90
+
+KPX quoteright v -35
+KPX quoteright t -35
+KPX quoteright space -40
+KPX quoteright s -55
+KPX quoteright r -25
+KPX quoteright quoteright -18
+KPX quoteright period -100
+KPX quoteright m -25
+KPX quoteright l -12
+KPX quoteright d -70
+KPX quoteright comma -100
+
+KPX r y 18
+KPX r w 6
+KPX r v 6
+KPX r t 8
+KPX r quotedblright -15
+KPX r q -24
+KPX r period -120
+KPX r o -6
+KPX r l -20
+KPX r k -20
+KPX r hyphen -30
+KPX r h -20
+KPX r f 8
+KPX r emdash -20
+KPX r e -26
+KPX r d -26
+KPX r comma -110
+KPX r c -12
+KPX r a -20
+
+KPX s quoteright -40
+KPX s quotedblright -45
+
+KPX semicolon space -30
+
+KPX space quotesinglbase -30
+KPX space quoteleft -40
+KPX space quotedblleft -40
+KPX space quotedblbase -30
+KPX space Y -70
+KPX space W -70
+KPX space V -70
+
+KPX t quoteright 10
+KPX t quotedblright -10
+
+KPX u quoteright -55
+KPX u quotedblright -50
+
+KPX v quoteright -20
+KPX v quotedblright -30
+KPX v q -6
+KPX v period -70
+KPX v o -6
+KPX v e -6
+KPX v d -6
+KPX v comma -70
+KPX v c -6
+KPX v a -6
+
+KPX w quoteright -20
+KPX w quotedblright -30
+KPX w period -62
+KPX w comma -62
+
+KPX x y 12
+KPX x w -6
+KPX x quoteright -40
+KPX x quotedblright -50
+KPX x q -6
+KPX x o -6
+KPX x e -6
+KPX x d -6
+KPX x c -6
+
+KPX y quoteright -10
+KPX y quotedblright -20
+KPX y period -70
+KPX y emdash 40
+KPX y comma -60
+
+KPX z quoteright -40
+KPX z quotedblright -50
+KPX z o -6
+KPX z e -6
+KPX z d -6
+KPX z c -6
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pzcmi8a.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pzcmi8a.afm
new file mode 100644
index 0000000000000000000000000000000000000000..6efb57ab586f61707cc01e74c37e09217d9c3cbd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pzcmi8a.afm
@@ -0,0 +1,480 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Fri Dec 28 16:35:46 1990
+Comment UniqueID 33936
+Comment VMusage 34559 41451
+FontName ZapfChancery-MediumItalic
+FullName ITC Zapf Chancery Medium Italic
+FamilyName ITC Zapf Chancery
+Weight Medium
+ItalicAngle -14
+IsFixedPitch false
+FontBBox -181 -314 1065 831
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.007
+Notice Copyright (c) 1985, 1987, 1989, 1990 Adobe Systems Incorporated. All Rights Reserved.ITC Zapf Chancery is a registered trademark of International Typeface Corporation.
+EncodingScheme AdobeStandardEncoding
+CapHeight 708
+XHeight 438
+Ascender 714
+Descender -314
+StartCharMetrics 228
+C 32 ; WX 220 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 280 ; N exclam ; B 119 -14 353 610 ;
+C 34 ; WX 220 ; N quotedbl ; B 120 343 333 610 ;
+C 35 ; WX 440 ; N numbersign ; B 83 0 521 594 ;
+C 36 ; WX 440 ; N dollar ; B 60 -144 508 709 ;
+C 37 ; WX 680 ; N percent ; B 132 -160 710 700 ;
+C 38 ; WX 780 ; N ampersand ; B 126 -16 915 610 ;
+C 39 ; WX 240 ; N quoteright ; B 168 343 338 610 ;
+C 40 ; WX 260 ; N parenleft ; B 96 -216 411 664 ;
+C 41 ; WX 220 ; N parenright ; B -13 -216 302 664 ;
+C 42 ; WX 420 ; N asterisk ; B 139 263 479 610 ;
+C 43 ; WX 520 ; N plus ; B 117 0 543 426 ;
+C 44 ; WX 220 ; N comma ; B 25 -140 213 148 ;
+C 45 ; WX 280 ; N hyphen ; B 69 190 334 248 ;
+C 46 ; WX 220 ; N period ; B 102 -14 228 128 ;
+C 47 ; WX 340 ; N slash ; B 74 -16 458 610 ;
+C 48 ; WX 440 ; N zero ; B 79 -16 538 610 ;
+C 49 ; WX 440 ; N one ; B 41 0 428 610 ;
+C 50 ; WX 440 ; N two ; B 17 -16 485 610 ;
+C 51 ; WX 440 ; N three ; B 1 -16 485 610 ;
+C 52 ; WX 440 ; N four ; B 77 -35 499 610 ;
+C 53 ; WX 440 ; N five ; B 60 -16 595 679 ;
+C 54 ; WX 440 ; N six ; B 90 -16 556 610 ;
+C 55 ; WX 440 ; N seven ; B 157 -33 561 645 ;
+C 56 ; WX 440 ; N eight ; B 65 -16 529 610 ;
+C 57 ; WX 440 ; N nine ; B 32 -16 517 610 ;
+C 58 ; WX 260 ; N colon ; B 98 -14 296 438 ;
+C 59 ; WX 240 ; N semicolon ; B 29 -140 299 438 ;
+C 60 ; WX 520 ; N less ; B 139 0 527 468 ;
+C 61 ; WX 520 ; N equal ; B 117 86 543 340 ;
+C 62 ; WX 520 ; N greater ; B 139 0 527 468 ;
+C 63 ; WX 380 ; N question ; B 150 -14 455 610 ;
+C 64 ; WX 700 ; N at ; B 127 -16 753 610 ;
+C 65 ; WX 620 ; N A ; B 13 -16 697 632 ;
+C 66 ; WX 600 ; N B ; B 85 -6 674 640 ;
+C 67 ; WX 520 ; N C ; B 93 -16 631 610 ;
+C 68 ; WX 700 ; N D ; B 86 -6 768 640 ;
+C 69 ; WX 620 ; N E ; B 91 -12 709 618 ;
+C 70 ; WX 580 ; N F ; B 120 -118 793 629 ;
+C 71 ; WX 620 ; N G ; B 148 -242 709 610 ;
+C 72 ; WX 680 ; N H ; B 18 -16 878 708 ;
+C 73 ; WX 380 ; N I ; B 99 0 504 594 ;
+C 74 ; WX 400 ; N J ; B -14 -147 538 594 ;
+C 75 ; WX 660 ; N K ; B 53 -153 844 610 ;
+C 76 ; WX 580 ; N L ; B 53 -16 657 610 ;
+C 77 ; WX 840 ; N M ; B 58 -16 1020 722 ;
+C 78 ; WX 700 ; N N ; B 85 -168 915 708 ;
+C 79 ; WX 600 ; N O ; B 94 -16 660 610 ;
+C 80 ; WX 540 ; N P ; B 42 0 658 628 ;
+C 81 ; WX 600 ; N Q ; B 84 -177 775 610 ;
+C 82 ; WX 600 ; N R ; B 58 -168 805 640 ;
+C 83 ; WX 460 ; N S ; B 45 -81 558 610 ;
+C 84 ; WX 500 ; N T ; B 63 0 744 667 ;
+C 85 ; WX 740 ; N U ; B 126 -16 792 617 ;
+C 86 ; WX 640 ; N V ; B 124 -16 810 714 ;
+C 87 ; WX 880 ; N W ; B 94 -16 1046 723 ;
+C 88 ; WX 560 ; N X ; B -30 -16 699 610 ;
+C 89 ; WX 560 ; N Y ; B 41 -168 774 647 ;
+C 90 ; WX 620 ; N Z ; B 42 -19 669 624 ;
+C 91 ; WX 240 ; N bracketleft ; B -13 -207 405 655 ;
+C 92 ; WX 480 ; N backslash ; B 140 -16 524 610 ;
+C 93 ; WX 320 ; N bracketright ; B -27 -207 391 655 ;
+C 94 ; WX 520 ; N asciicircum ; B 132 239 532 594 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 240 ; N quoteleft ; B 169 343 339 610 ;
+C 97 ; WX 420 ; N a ; B 92 -15 485 438 ;
+C 98 ; WX 420 ; N b ; B 82 -23 492 714 ;
+C 99 ; WX 340 ; N c ; B 87 -14 406 438 ;
+C 100 ; WX 440 ; N d ; B 102 -14 651 714 ;
+C 101 ; WX 340 ; N e ; B 87 -14 403 438 ;
+C 102 ; WX 320 ; N f ; B -119 -314 547 714 ; L i fi ; L l fl ;
+C 103 ; WX 400 ; N g ; B -108 -314 503 438 ;
+C 104 ; WX 440 ; N h ; B 55 -14 524 714 ;
+C 105 ; WX 240 ; N i ; B 100 -14 341 635 ;
+C 106 ; WX 220 ; N j ; B -112 -314 332 635 ;
+C 107 ; WX 440 ; N k ; B 87 -184 628 714 ;
+C 108 ; WX 240 ; N l ; B 102 -14 480 714 ;
+C 109 ; WX 620 ; N m ; B 86 -14 704 438 ;
+C 110 ; WX 460 ; N n ; B 101 -14 544 438 ;
+C 111 ; WX 400 ; N o ; B 87 -14 449 438 ;
+C 112 ; WX 440 ; N p ; B -23 -314 484 432 ;
+C 113 ; WX 400 ; N q ; B 87 -300 490 510 ;
+C 114 ; WX 300 ; N r ; B 101 -14 424 438 ;
+C 115 ; WX 320 ; N s ; B 46 -14 403 438 ;
+C 116 ; WX 320 ; N t ; B 106 -14 426 539 ;
+C 117 ; WX 460 ; N u ; B 102 -14 528 438 ;
+C 118 ; WX 440 ; N v ; B 87 -14 533 488 ;
+C 119 ; WX 680 ; N w ; B 87 -14 782 488 ;
+C 120 ; WX 420 ; N x ; B 70 -195 589 438 ;
+C 121 ; WX 400 ; N y ; B -24 -314 483 438 ;
+C 122 ; WX 440 ; N z ; B 26 -14 508 445 ;
+C 123 ; WX 240 ; N braceleft ; B 55 -207 383 655 ;
+C 124 ; WX 520 ; N bar ; B 320 -16 378 714 ;
+C 125 ; WX 240 ; N braceright ; B -10 -207 318 655 ;
+C 126 ; WX 520 ; N asciitilde ; B 123 186 539 320 ;
+C 161 ; WX 280 ; N exclamdown ; B 72 -186 306 438 ;
+C 162 ; WX 440 ; N cent ; B 122 -134 476 543 ;
+C 163 ; WX 440 ; N sterling ; B -16 -52 506 610 ;
+C 164 ; WX 60 ; N fraction ; B -181 -16 320 610 ;
+C 165 ; WX 440 ; N yen ; B -1 -168 613 647 ;
+C 166 ; WX 440 ; N florin ; B -64 -314 582 610 ;
+C 167 ; WX 420 ; N section ; B 53 -215 514 610 ;
+C 168 ; WX 440 ; N currency ; B 50 85 474 509 ;
+C 169 ; WX 160 ; N quotesingle ; B 145 343 215 610 ;
+C 170 ; WX 340 ; N quotedblleft ; B 169 343 464 610 ;
+C 171 ; WX 340 ; N guillemotleft ; B 98 24 356 414 ;
+C 172 ; WX 240 ; N guilsinglleft ; B 98 24 258 414 ;
+C 173 ; WX 260 ; N guilsinglright ; B 106 24 266 414 ;
+C 174 ; WX 520 ; N fi ; B -124 -314 605 714 ;
+C 175 ; WX 520 ; N fl ; B -124 -314 670 714 ;
+C 177 ; WX 500 ; N endash ; B 51 199 565 239 ;
+C 178 ; WX 460 ; N dagger ; B 138 -37 568 610 ;
+C 179 ; WX 480 ; N daggerdbl ; B 138 -59 533 610 ;
+C 180 ; WX 220 ; N periodcentered ; B 139 208 241 310 ;
+C 182 ; WX 500 ; N paragraph ; B 105 -199 638 594 ;
+C 183 ; WX 600 ; N bullet ; B 228 149 524 445 ;
+C 184 ; WX 180 ; N quotesinglbase ; B 21 -121 191 146 ;
+C 185 ; WX 280 ; N quotedblbase ; B -14 -121 281 146 ;
+C 186 ; WX 360 ; N quotedblright ; B 158 343 453 610 ;
+C 187 ; WX 380 ; N guillemotright ; B 117 24 375 414 ;
+C 188 ; WX 1000 ; N ellipsis ; B 124 -14 916 128 ;
+C 189 ; WX 960 ; N perthousand ; B 112 -160 1005 700 ;
+C 191 ; WX 400 ; N questiondown ; B 82 -186 387 438 ;
+C 193 ; WX 220 ; N grave ; B 193 492 339 659 ;
+C 194 ; WX 300 ; N acute ; B 265 492 422 659 ;
+C 195 ; WX 340 ; N circumflex ; B 223 482 443 649 ;
+C 196 ; WX 440 ; N tilde ; B 243 543 522 619 ;
+C 197 ; WX 440 ; N macron ; B 222 544 465 578 ;
+C 198 ; WX 440 ; N breve ; B 253 522 501 631 ;
+C 199 ; WX 220 ; N dotaccent ; B 236 522 328 610 ;
+C 200 ; WX 360 ; N dieresis ; B 243 522 469 610 ;
+C 202 ; WX 300 ; N ring ; B 240 483 416 659 ;
+C 203 ; WX 300 ; N cedilla ; B 12 -191 184 6 ;
+C 205 ; WX 400 ; N hungarumlaut ; B 208 492 495 659 ;
+C 206 ; WX 280 ; N ogonek ; B 38 -191 233 6 ;
+C 207 ; WX 340 ; N caron ; B 254 492 474 659 ;
+C 208 ; WX 1000 ; N emdash ; B 51 199 1065 239 ;
+C 225 ; WX 740 ; N AE ; B -21 -16 799 594 ;
+C 227 ; WX 260 ; N ordfeminine ; B 111 338 386 610 ;
+C 232 ; WX 580 ; N Lslash ; B 49 -16 657 610 ;
+C 233 ; WX 660 ; N Oslash ; B 83 -78 751 672 ;
+C 234 ; WX 820 ; N OE ; B 63 -16 909 610 ;
+C 235 ; WX 260 ; N ordmasculine ; B 128 339 373 610 ;
+C 241 ; WX 540 ; N ae ; B 67 -14 624 468 ;
+C 245 ; WX 240 ; N dotlessi ; B 100 -14 306 438 ;
+C 248 ; WX 300 ; N lslash ; B 121 -14 515 714 ;
+C 249 ; WX 440 ; N oslash ; B 46 -64 540 488 ;
+C 250 ; WX 560 ; N oe ; B 78 -14 628 438 ;
+C 251 ; WX 420 ; N germandbls ; B -127 -314 542 714 ;
+C -1 ; WX 340 ; N ecircumflex ; B 87 -14 433 649 ;
+C -1 ; WX 340 ; N edieresis ; B 87 -14 449 610 ;
+C -1 ; WX 420 ; N aacute ; B 92 -15 492 659 ;
+C -1 ; WX 740 ; N registered ; B 137 -16 763 610 ;
+C -1 ; WX 240 ; N icircumflex ; B 100 -14 363 649 ;
+C -1 ; WX 460 ; N udieresis ; B 102 -14 528 610 ;
+C -1 ; WX 400 ; N ograve ; B 87 -14 449 659 ;
+C -1 ; WX 460 ; N uacute ; B 102 -14 528 659 ;
+C -1 ; WX 460 ; N ucircumflex ; B 102 -14 528 649 ;
+C -1 ; WX 620 ; N Aacute ; B 13 -16 702 821 ;
+C -1 ; WX 240 ; N igrave ; B 100 -14 306 659 ;
+C -1 ; WX 380 ; N Icircumflex ; B 99 0 504 821 ;
+C -1 ; WX 340 ; N ccedilla ; B 62 -191 406 438 ;
+C -1 ; WX 420 ; N adieresis ; B 92 -15 485 610 ;
+C -1 ; WX 620 ; N Ecircumflex ; B 91 -12 709 821 ;
+C -1 ; WX 320 ; N scaron ; B 46 -14 464 659 ;
+C -1 ; WX 440 ; N thorn ; B -38 -314 505 714 ;
+C -1 ; WX 1000 ; N trademark ; B 127 187 1046 594 ;
+C -1 ; WX 340 ; N egrave ; B 87 -14 403 659 ;
+C -1 ; WX 264 ; N threesuperior ; B 59 234 348 610 ;
+C -1 ; WX 440 ; N zcaron ; B 26 -14 514 659 ;
+C -1 ; WX 420 ; N atilde ; B 92 -15 522 619 ;
+C -1 ; WX 420 ; N aring ; B 92 -15 485 659 ;
+C -1 ; WX 400 ; N ocircumflex ; B 87 -14 453 649 ;
+C -1 ; WX 620 ; N Edieresis ; B 91 -12 709 762 ;
+C -1 ; WX 660 ; N threequarters ; B 39 -16 706 610 ;
+C -1 ; WX 400 ; N ydieresis ; B -24 -314 483 610 ;
+C -1 ; WX 400 ; N yacute ; B -24 -314 483 659 ;
+C -1 ; WX 240 ; N iacute ; B 100 -14 392 659 ;
+C -1 ; WX 620 ; N Acircumflex ; B 13 -16 697 821 ;
+C -1 ; WX 740 ; N Uacute ; B 126 -16 792 821 ;
+C -1 ; WX 340 ; N eacute ; B 87 -14 462 659 ;
+C -1 ; WX 600 ; N Ograve ; B 94 -16 660 821 ;
+C -1 ; WX 420 ; N agrave ; B 92 -15 485 659 ;
+C -1 ; WX 740 ; N Udieresis ; B 126 -16 792 762 ;
+C -1 ; WX 420 ; N acircumflex ; B 92 -15 485 649 ;
+C -1 ; WX 380 ; N Igrave ; B 99 0 504 821 ;
+C -1 ; WX 264 ; N twosuperior ; B 72 234 354 610 ;
+C -1 ; WX 740 ; N Ugrave ; B 126 -16 792 821 ;
+C -1 ; WX 660 ; N onequarter ; B 56 -16 702 610 ;
+C -1 ; WX 740 ; N Ucircumflex ; B 126 -16 792 821 ;
+C -1 ; WX 460 ; N Scaron ; B 45 -81 594 831 ;
+C -1 ; WX 380 ; N Idieresis ; B 99 0 519 762 ;
+C -1 ; WX 240 ; N idieresis ; B 100 -14 369 610 ;
+C -1 ; WX 620 ; N Egrave ; B 91 -12 709 821 ;
+C -1 ; WX 600 ; N Oacute ; B 94 -16 660 821 ;
+C -1 ; WX 520 ; N divide ; B 117 -14 543 440 ;
+C -1 ; WX 620 ; N Atilde ; B 13 -16 702 771 ;
+C -1 ; WX 620 ; N Aring ; B 13 -16 697 831 ;
+C -1 ; WX 600 ; N Odieresis ; B 94 -16 660 762 ;
+C -1 ; WX 620 ; N Adieresis ; B 13 -16 709 762 ;
+C -1 ; WX 700 ; N Ntilde ; B 85 -168 915 761 ;
+C -1 ; WX 620 ; N Zcaron ; B 42 -19 669 831 ;
+C -1 ; WX 540 ; N Thorn ; B 52 0 647 623 ;
+C -1 ; WX 380 ; N Iacute ; B 99 0 532 821 ;
+C -1 ; WX 520 ; N plusminus ; B 117 0 543 436 ;
+C -1 ; WX 520 ; N multiply ; B 133 16 527 410 ;
+C -1 ; WX 620 ; N Eacute ; B 91 -12 709 821 ;
+C -1 ; WX 560 ; N Ydieresis ; B 41 -168 774 762 ;
+C -1 ; WX 264 ; N onesuperior ; B 83 244 311 610 ;
+C -1 ; WX 460 ; N ugrave ; B 102 -14 528 659 ;
+C -1 ; WX 520 ; N logicalnot ; B 117 86 543 340 ;
+C -1 ; WX 460 ; N ntilde ; B 101 -14 544 619 ;
+C -1 ; WX 600 ; N Otilde ; B 94 -16 660 761 ;
+C -1 ; WX 400 ; N otilde ; B 87 -14 502 619 ;
+C -1 ; WX 520 ; N Ccedilla ; B 93 -191 631 610 ;
+C -1 ; WX 620 ; N Agrave ; B 13 -16 697 821 ;
+C -1 ; WX 660 ; N onehalf ; B 56 -16 702 610 ;
+C -1 ; WX 700 ; N Eth ; B 86 -6 768 640 ;
+C -1 ; WX 400 ; N degree ; B 171 324 457 610 ;
+C -1 ; WX 560 ; N Yacute ; B 41 -168 774 821 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 94 -16 660 821 ;
+C -1 ; WX 400 ; N oacute ; B 87 -14 482 659 ;
+C -1 ; WX 460 ; N mu ; B 7 -314 523 438 ;
+C -1 ; WX 520 ; N minus ; B 117 184 543 242 ;
+C -1 ; WX 400 ; N eth ; B 87 -14 522 714 ;
+C -1 ; WX 400 ; N odieresis ; B 87 -14 479 610 ;
+C -1 ; WX 740 ; N copyright ; B 137 -16 763 610 ;
+C -1 ; WX 520 ; N brokenbar ; B 320 -16 378 714 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 131
+
+KPX A quoteright -40
+KPX A quotedblright -40
+KPX A U -10
+KPX A T 10
+KPX A Q 10
+KPX A O 10
+KPX A G -30
+KPX A C 20
+
+KPX D period -30
+KPX D comma -20
+KPX D Y 10
+KPX D A -10
+
+KPX F period -40
+KPX F i 10
+KPX F comma -30
+
+KPX G period -20
+KPX G comma -10
+
+KPX J period -20
+KPX J comma -10
+
+KPX K u -20
+KPX K o -20
+KPX K e -20
+
+KPX L y -10
+KPX L quoteright -25
+KPX L quotedblright -25
+KPX L W -10
+KPX L V -20
+
+KPX O period -20
+KPX O comma -10
+KPX O Y 10
+KPX O T 20
+KPX O A -20
+
+KPX P period -50
+KPX P o -10
+KPX P e -10
+KPX P comma -40
+KPX P a -20
+KPX P A -10
+
+KPX Q U -10
+
+KPX R Y 10
+KPX R W 10
+KPX R T 20
+
+KPX T o -20
+KPX T i 20
+KPX T hyphen -20
+KPX T h 20
+KPX T e -20
+KPX T a -20
+KPX T O 30
+KPX T A 10
+
+KPX V period -100
+KPX V o -20
+KPX V e -20
+KPX V comma -90
+KPX V a -20
+KPX V O 10
+KPX V G -20
+
+KPX W period -50
+KPX W o -20
+KPX W i 10
+KPX W h 10
+KPX W e -20
+KPX W comma -40
+KPX W a -20
+KPX W O 10
+
+KPX Y u -20
+KPX Y period -50
+KPX Y o -50
+KPX Y i 10
+KPX Y e -40
+KPX Y comma -40
+KPX Y a -60
+
+KPX b period -30
+KPX b l -20
+KPX b comma -20
+KPX b b -20
+
+KPX c k -10
+
+KPX comma quoteright -70
+KPX comma quotedblright -70
+
+KPX d w -20
+KPX d v -10
+KPX d d -40
+
+KPX e y 10
+
+KPX f quoteright 30
+KPX f quotedblright 30
+KPX f period -50
+KPX f f -50
+KPX f e -10
+KPX f comma -40
+KPX f a -20
+
+KPX g y 10
+KPX g period -30
+KPX g i 10
+KPX g e 10
+KPX g comma -20
+KPX g a 10
+
+KPX k y 10
+KPX k o -10
+KPX k e -20
+
+KPX m y 10
+KPX m u 10
+
+KPX n y 20
+
+KPX o period -30
+KPX o comma -20
+
+KPX p period -30
+KPX p p -10
+KPX p comma -20
+
+KPX period quoteright -80
+KPX period quotedblright -80
+
+KPX quotedblleft quoteleft 20
+KPX quotedblleft A 10
+
+KPX quoteleft quoteleft -115
+KPX quoteleft A 10
+
+KPX quoteright v 30
+KPX quoteright t 20
+KPX quoteright s -25
+KPX quoteright r 30
+KPX quoteright quoteright -115
+KPX quoteright quotedblright 20
+KPX quoteright l 20
+
+KPX r period -50
+KPX r i 10
+KPX r comma -40
+
+KPX s period -20
+KPX s comma -10
+
+KPX v period -30
+KPX v comma -20
+
+KPX w period -30
+KPX w o 10
+KPX w h 20
+KPX w comma -20
+EndKernPairs
+EndKernData
+StartComposites 56
+CC Aacute 2 ; PCC A 0 0 ; PCC acute 280 162 ;
+CC Acircumflex 2 ; PCC A 0 0 ; PCC circumflex 240 172 ;
+CC Adieresis 2 ; PCC A 0 0 ; PCC dieresis 240 152 ;
+CC Agrave 2 ; PCC A 0 0 ; PCC grave 250 162 ;
+CC Aring 2 ; PCC A 0 0 ; PCC ring 260 172 ;
+CC Atilde 2 ; PCC A 0 0 ; PCC tilde 180 152 ;
+CC Eacute 2 ; PCC E 0 0 ; PCC acute 230 162 ;
+CC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 180 172 ;
+CC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 170 152 ;
+CC Egrave 2 ; PCC E 0 0 ; PCC grave 220 162 ;
+CC Iacute 2 ; PCC I 0 0 ; PCC acute 110 162 ;
+CC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 60 172 ;
+CC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 50 152 ;
+CC Igrave 2 ; PCC I 0 0 ; PCC grave 100 162 ;
+CC Ntilde 2 ; PCC N 0 0 ; PCC tilde 210 142 ;
+CC Oacute 2 ; PCC O 0 0 ; PCC acute 160 162 ;
+CC Ocircumflex 2 ; PCC O 0 0 ; PCC circumflex 130 172 ;
+CC Odieresis 2 ; PCC O 0 0 ; PCC dieresis 120 152 ;
+CC Ograve 2 ; PCC O 0 0 ; PCC grave 150 162 ;
+CC Otilde 2 ; PCC O 0 0 ; PCC tilde 90 142 ;
+CC Scaron 2 ; PCC S 0 0 ; PCC caron 120 172 ;
+CC Uacute 2 ; PCC U 0 0 ; PCC acute 310 162 ;
+CC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 260 172 ;
+CC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 260 152 ;
+CC Ugrave 2 ; PCC U 0 0 ; PCC grave 270 162 ;
+CC Yacute 2 ; PCC Y 0 0 ; PCC acute 220 162 ;
+CC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 170 152 ;
+CC Zcaron 2 ; PCC Z 0 0 ; PCC caron 130 172 ;
+CC aacute 2 ; PCC a 0 0 ; PCC acute 70 0 ;
+CC acircumflex 2 ; PCC a 0 0 ; PCC circumflex 20 0 ;
+CC adieresis 2 ; PCC a 0 0 ; PCC dieresis 10 0 ;
+CC agrave 2 ; PCC a 0 0 ; PCC grave 80 0 ;
+CC aring 2 ; PCC a 0 0 ; PCC ring 60 0 ;
+CC atilde 2 ; PCC a 0 0 ; PCC tilde 0 0 ;
+CC eacute 2 ; PCC e 0 0 ; PCC acute 40 0 ;
+CC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex -10 0 ;
+CC edieresis 2 ; PCC e 0 0 ; PCC dieresis -20 0 ;
+CC egrave 2 ; PCC e 0 0 ; PCC grave 30 0 ;
+CC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -30 0 ;
+CC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -80 0 ;
+CC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -100 0 ;
+CC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -40 0 ;
+CC ntilde 2 ; PCC n 0 0 ; PCC tilde 10 0 ;
+CC oacute 2 ; PCC o 0 0 ; PCC acute 60 0 ;
+CC ocircumflex 2 ; PCC o 0 0 ; PCC circumflex 10 0 ;
+CC odieresis 2 ; PCC o 0 0 ; PCC dieresis 10 0 ;
+CC ograve 2 ; PCC o 0 0 ; PCC grave 60 0 ;
+CC otilde 2 ; PCC o 0 0 ; PCC tilde -20 0 ;
+CC scaron 2 ; PCC s 0 0 ; PCC caron -10 0 ;
+CC uacute 2 ; PCC u 0 0 ; PCC acute 70 0 ;
+CC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 30 0 ;
+CC udieresis 2 ; PCC u 0 0 ; PCC dieresis 20 0 ;
+CC ugrave 2 ; PCC u 0 0 ; PCC grave 50 0 ;
+CC yacute 2 ; PCC y 0 0 ; PCC acute 60 0 ;
+CC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 0 0 ;
+CC zcaron 2 ; PCC z 0 0 ; PCC caron 40 0 ;
+EndComposites
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pzdr.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pzdr.afm
new file mode 100644
index 0000000000000000000000000000000000000000..6b98e8d35f1e257f797d51f51b60fd4f11562e06
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/pzdr.afm
@@ -0,0 +1,222 @@
+StartFontMetrics 2.0
+Comment Copyright (c) 1985, 1987, 1988, 1989 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Fri Dec 1 12:57:42 1989
+Comment UniqueID 26200
+Comment VMusage 39281 49041
+FontName ZapfDingbats
+FullName ITC Zapf Dingbats
+FamilyName ITC Zapf Dingbats
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+FontBBox -1 -143 981 820
+UnderlinePosition -98
+UnderlineThickness 54
+Version 001.004
+Notice Copyright (c) 1985, 1987, 1988, 1989 Adobe Systems Incorporated. All rights reserved.ITC Zapf Dingbats is a registered trademark of International Typeface Corporation.
+EncodingScheme FontSpecific
+StartCharMetrics 202
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 974 ; N a1 ; B 35 72 939 621 ;
+C 34 ; WX 961 ; N a2 ; B 35 81 927 611 ;
+C 35 ; WX 974 ; N a202 ; B 35 72 939 621 ;
+C 36 ; WX 980 ; N a3 ; B 35 0 945 692 ;
+C 37 ; WX 719 ; N a4 ; B 34 139 685 566 ;
+C 38 ; WX 789 ; N a5 ; B 35 -14 755 705 ;
+C 39 ; WX 790 ; N a119 ; B 35 -14 755 705 ;
+C 40 ; WX 791 ; N a118 ; B 35 -13 761 705 ;
+C 41 ; WX 690 ; N a117 ; B 35 138 655 553 ;
+C 42 ; WX 960 ; N a11 ; B 35 123 925 568 ;
+C 43 ; WX 939 ; N a12 ; B 35 134 904 559 ;
+C 44 ; WX 549 ; N a13 ; B 29 -11 516 705 ;
+C 45 ; WX 855 ; N a14 ; B 34 59 820 632 ;
+C 46 ; WX 911 ; N a15 ; B 35 50 876 642 ;
+C 47 ; WX 933 ; N a16 ; B 35 139 899 550 ;
+C 48 ; WX 911 ; N a105 ; B 35 50 876 642 ;
+C 49 ; WX 945 ; N a17 ; B 35 139 909 553 ;
+C 50 ; WX 974 ; N a18 ; B 35 104 938 587 ;
+C 51 ; WX 755 ; N a19 ; B 34 -13 721 705 ;
+C 52 ; WX 846 ; N a20 ; B 36 -14 811 705 ;
+C 53 ; WX 762 ; N a21 ; B 35 0 727 692 ;
+C 54 ; WX 761 ; N a22 ; B 35 0 727 692 ;
+C 55 ; WX 571 ; N a23 ; B -1 -68 571 661 ;
+C 56 ; WX 677 ; N a24 ; B 36 -13 642 705 ;
+C 57 ; WX 763 ; N a25 ; B 35 0 728 692 ;
+C 58 ; WX 760 ; N a26 ; B 35 0 726 692 ;
+C 59 ; WX 759 ; N a27 ; B 35 0 725 692 ;
+C 60 ; WX 754 ; N a28 ; B 35 0 720 692 ;
+C 61 ; WX 494 ; N a6 ; B 35 0 460 692 ;
+C 62 ; WX 552 ; N a7 ; B 35 0 517 692 ;
+C 63 ; WX 537 ; N a8 ; B 35 0 503 692 ;
+C 64 ; WX 577 ; N a9 ; B 35 96 542 596 ;
+C 65 ; WX 692 ; N a10 ; B 35 -14 657 705 ;
+C 66 ; WX 786 ; N a29 ; B 35 -14 751 705 ;
+C 67 ; WX 788 ; N a30 ; B 35 -14 752 705 ;
+C 68 ; WX 788 ; N a31 ; B 35 -14 753 705 ;
+C 69 ; WX 790 ; N a32 ; B 35 -14 756 705 ;
+C 70 ; WX 793 ; N a33 ; B 35 -13 759 705 ;
+C 71 ; WX 794 ; N a34 ; B 35 -13 759 705 ;
+C 72 ; WX 816 ; N a35 ; B 35 -14 782 705 ;
+C 73 ; WX 823 ; N a36 ; B 35 -14 787 705 ;
+C 74 ; WX 789 ; N a37 ; B 35 -14 754 705 ;
+C 75 ; WX 841 ; N a38 ; B 35 -14 807 705 ;
+C 76 ; WX 823 ; N a39 ; B 35 -14 789 705 ;
+C 77 ; WX 833 ; N a40 ; B 35 -14 798 705 ;
+C 78 ; WX 816 ; N a41 ; B 35 -13 782 705 ;
+C 79 ; WX 831 ; N a42 ; B 35 -14 796 705 ;
+C 80 ; WX 923 ; N a43 ; B 35 -14 888 705 ;
+C 81 ; WX 744 ; N a44 ; B 35 0 710 692 ;
+C 82 ; WX 723 ; N a45 ; B 35 0 688 692 ;
+C 83 ; WX 749 ; N a46 ; B 35 0 714 692 ;
+C 84 ; WX 790 ; N a47 ; B 34 -14 756 705 ;
+C 85 ; WX 792 ; N a48 ; B 35 -14 758 705 ;
+C 86 ; WX 695 ; N a49 ; B 35 -14 661 706 ;
+C 87 ; WX 776 ; N a50 ; B 35 -6 741 699 ;
+C 88 ; WX 768 ; N a51 ; B 35 -7 734 699 ;
+C 89 ; WX 792 ; N a52 ; B 35 -14 757 705 ;
+C 90 ; WX 759 ; N a53 ; B 35 0 725 692 ;
+C 91 ; WX 707 ; N a54 ; B 35 -13 672 704 ;
+C 92 ; WX 708 ; N a55 ; B 35 -14 672 705 ;
+C 93 ; WX 682 ; N a56 ; B 35 -14 647 705 ;
+C 94 ; WX 701 ; N a57 ; B 35 -14 666 705 ;
+C 95 ; WX 826 ; N a58 ; B 35 -14 791 705 ;
+C 96 ; WX 815 ; N a59 ; B 35 -14 780 705 ;
+C 97 ; WX 789 ; N a60 ; B 35 -14 754 705 ;
+C 98 ; WX 789 ; N a61 ; B 35 -14 754 705 ;
+C 99 ; WX 707 ; N a62 ; B 34 -14 673 705 ;
+C 100 ; WX 687 ; N a63 ; B 36 0 651 692 ;
+C 101 ; WX 696 ; N a64 ; B 35 0 661 691 ;
+C 102 ; WX 689 ; N a65 ; B 35 0 655 692 ;
+C 103 ; WX 786 ; N a66 ; B 34 -14 751 705 ;
+C 104 ; WX 787 ; N a67 ; B 35 -14 752 705 ;
+C 105 ; WX 713 ; N a68 ; B 35 -14 678 705 ;
+C 106 ; WX 791 ; N a69 ; B 35 -14 756 705 ;
+C 107 ; WX 785 ; N a70 ; B 36 -14 751 705 ;
+C 108 ; WX 791 ; N a71 ; B 35 -14 757 705 ;
+C 109 ; WX 873 ; N a72 ; B 35 -14 838 705 ;
+C 110 ; WX 761 ; N a73 ; B 35 0 726 692 ;
+C 111 ; WX 762 ; N a74 ; B 35 0 727 692 ;
+C 112 ; WX 762 ; N a203 ; B 35 0 727 692 ;
+C 113 ; WX 759 ; N a75 ; B 35 0 725 692 ;
+C 114 ; WX 759 ; N a204 ; B 35 0 725 692 ;
+C 115 ; WX 892 ; N a76 ; B 35 0 858 705 ;
+C 116 ; WX 892 ; N a77 ; B 35 -14 858 692 ;
+C 117 ; WX 788 ; N a78 ; B 35 -14 754 705 ;
+C 118 ; WX 784 ; N a79 ; B 35 -14 749 705 ;
+C 119 ; WX 438 ; N a81 ; B 35 -14 403 705 ;
+C 120 ; WX 138 ; N a82 ; B 35 0 104 692 ;
+C 121 ; WX 277 ; N a83 ; B 35 0 242 692 ;
+C 122 ; WX 415 ; N a84 ; B 35 0 380 692 ;
+C 123 ; WX 392 ; N a97 ; B 35 263 357 705 ;
+C 124 ; WX 392 ; N a98 ; B 34 263 357 705 ;
+C 125 ; WX 668 ; N a99 ; B 35 263 633 705 ;
+C 126 ; WX 668 ; N a100 ; B 36 263 634 705 ;
+C 161 ; WX 732 ; N a101 ; B 35 -143 697 806 ;
+C 162 ; WX 544 ; N a102 ; B 56 -14 488 706 ;
+C 163 ; WX 544 ; N a103 ; B 34 -14 508 705 ;
+C 164 ; WX 910 ; N a104 ; B 35 40 875 651 ;
+C 165 ; WX 667 ; N a106 ; B 35 -14 633 705 ;
+C 166 ; WX 760 ; N a107 ; B 35 -14 726 705 ;
+C 167 ; WX 760 ; N a108 ; B 0 121 758 569 ;
+C 168 ; WX 776 ; N a112 ; B 35 0 741 705 ;
+C 169 ; WX 595 ; N a111 ; B 34 -14 560 705 ;
+C 170 ; WX 694 ; N a110 ; B 35 -14 659 705 ;
+C 171 ; WX 626 ; N a109 ; B 34 0 591 705 ;
+C 172 ; WX 788 ; N a120 ; B 35 -14 754 705 ;
+C 173 ; WX 788 ; N a121 ; B 35 -14 754 705 ;
+C 174 ; WX 788 ; N a122 ; B 35 -14 754 705 ;
+C 175 ; WX 788 ; N a123 ; B 35 -14 754 705 ;
+C 176 ; WX 788 ; N a124 ; B 35 -14 754 705 ;
+C 177 ; WX 788 ; N a125 ; B 35 -14 754 705 ;
+C 178 ; WX 788 ; N a126 ; B 35 -14 754 705 ;
+C 179 ; WX 788 ; N a127 ; B 35 -14 754 705 ;
+C 180 ; WX 788 ; N a128 ; B 35 -14 754 705 ;
+C 181 ; WX 788 ; N a129 ; B 35 -14 754 705 ;
+C 182 ; WX 788 ; N a130 ; B 35 -14 754 705 ;
+C 183 ; WX 788 ; N a131 ; B 35 -14 754 705 ;
+C 184 ; WX 788 ; N a132 ; B 35 -14 754 705 ;
+C 185 ; WX 788 ; N a133 ; B 35 -14 754 705 ;
+C 186 ; WX 788 ; N a134 ; B 35 -14 754 705 ;
+C 187 ; WX 788 ; N a135 ; B 35 -14 754 705 ;
+C 188 ; WX 788 ; N a136 ; B 35 -14 754 705 ;
+C 189 ; WX 788 ; N a137 ; B 35 -14 754 705 ;
+C 190 ; WX 788 ; N a138 ; B 35 -14 754 705 ;
+C 191 ; WX 788 ; N a139 ; B 35 -14 754 705 ;
+C 192 ; WX 788 ; N a140 ; B 35 -14 754 705 ;
+C 193 ; WX 788 ; N a141 ; B 35 -14 754 705 ;
+C 194 ; WX 788 ; N a142 ; B 35 -14 754 705 ;
+C 195 ; WX 788 ; N a143 ; B 35 -14 754 705 ;
+C 196 ; WX 788 ; N a144 ; B 35 -14 754 705 ;
+C 197 ; WX 788 ; N a145 ; B 35 -14 754 705 ;
+C 198 ; WX 788 ; N a146 ; B 35 -14 754 705 ;
+C 199 ; WX 788 ; N a147 ; B 35 -14 754 705 ;
+C 200 ; WX 788 ; N a148 ; B 35 -14 754 705 ;
+C 201 ; WX 788 ; N a149 ; B 35 -14 754 705 ;
+C 202 ; WX 788 ; N a150 ; B 35 -14 754 705 ;
+C 203 ; WX 788 ; N a151 ; B 35 -14 754 705 ;
+C 204 ; WX 788 ; N a152 ; B 35 -14 754 705 ;
+C 205 ; WX 788 ; N a153 ; B 35 -14 754 705 ;
+C 206 ; WX 788 ; N a154 ; B 35 -14 754 705 ;
+C 207 ; WX 788 ; N a155 ; B 35 -14 754 705 ;
+C 208 ; WX 788 ; N a156 ; B 35 -14 754 705 ;
+C 209 ; WX 788 ; N a157 ; B 35 -14 754 705 ;
+C 210 ; WX 788 ; N a158 ; B 35 -14 754 705 ;
+C 211 ; WX 788 ; N a159 ; B 35 -14 754 705 ;
+C 212 ; WX 894 ; N a160 ; B 35 58 860 634 ;
+C 213 ; WX 838 ; N a161 ; B 35 152 803 540 ;
+C 214 ; WX 1016 ; N a163 ; B 34 152 981 540 ;
+C 215 ; WX 458 ; N a164 ; B 35 -127 422 820 ;
+C 216 ; WX 748 ; N a196 ; B 35 94 698 597 ;
+C 217 ; WX 924 ; N a165 ; B 35 140 890 552 ;
+C 218 ; WX 748 ; N a192 ; B 35 94 698 597 ;
+C 219 ; WX 918 ; N a166 ; B 35 166 884 526 ;
+C 220 ; WX 927 ; N a167 ; B 35 32 892 660 ;
+C 221 ; WX 928 ; N a168 ; B 35 129 891 562 ;
+C 222 ; WX 928 ; N a169 ; B 35 128 893 563 ;
+C 223 ; WX 834 ; N a170 ; B 35 155 799 537 ;
+C 224 ; WX 873 ; N a171 ; B 35 93 838 599 ;
+C 225 ; WX 828 ; N a172 ; B 35 104 791 588 ;
+C 226 ; WX 924 ; N a173 ; B 35 98 889 594 ;
+C 227 ; WX 924 ; N a162 ; B 35 98 889 594 ;
+C 228 ; WX 917 ; N a174 ; B 35 0 882 692 ;
+C 229 ; WX 930 ; N a175 ; B 35 84 896 608 ;
+C 230 ; WX 931 ; N a176 ; B 35 84 896 608 ;
+C 231 ; WX 463 ; N a177 ; B 35 -99 429 791 ;
+C 232 ; WX 883 ; N a178 ; B 35 71 848 623 ;
+C 233 ; WX 836 ; N a179 ; B 35 44 802 648 ;
+C 234 ; WX 836 ; N a193 ; B 35 44 802 648 ;
+C 235 ; WX 867 ; N a180 ; B 35 101 832 591 ;
+C 236 ; WX 867 ; N a199 ; B 35 101 832 591 ;
+C 237 ; WX 696 ; N a181 ; B 35 44 661 648 ;
+C 238 ; WX 696 ; N a200 ; B 35 44 661 648 ;
+C 239 ; WX 874 ; N a182 ; B 35 77 840 619 ;
+C 241 ; WX 874 ; N a201 ; B 35 73 840 615 ;
+C 242 ; WX 760 ; N a183 ; B 35 0 725 692 ;
+C 243 ; WX 946 ; N a184 ; B 35 160 911 533 ;
+C 244 ; WX 771 ; N a197 ; B 34 37 736 655 ;
+C 245 ; WX 865 ; N a185 ; B 35 207 830 481 ;
+C 246 ; WX 771 ; N a194 ; B 34 37 736 655 ;
+C 247 ; WX 888 ; N a198 ; B 34 -19 853 712 ;
+C 248 ; WX 967 ; N a186 ; B 35 124 932 568 ;
+C 249 ; WX 888 ; N a195 ; B 34 -19 853 712 ;
+C 250 ; WX 831 ; N a187 ; B 35 113 796 579 ;
+C 251 ; WX 873 ; N a188 ; B 36 118 838 578 ;
+C 252 ; WX 927 ; N a189 ; B 35 150 891 542 ;
+C 253 ; WX 970 ; N a190 ; B 35 76 931 616 ;
+C 254 ; WX 918 ; N a191 ; B 34 99 884 593 ;
+C -1 ; WX 410 ; N a86 ; B 35 0 375 692 ;
+C -1 ; WX 509 ; N a85 ; B 35 0 475 692 ;
+C -1 ; WX 334 ; N a95 ; B 35 0 299 692 ;
+C -1 ; WX 509 ; N a205 ; B 35 0 475 692 ;
+C -1 ; WX 390 ; N a89 ; B 35 -14 356 705 ;
+C -1 ; WX 234 ; N a87 ; B 35 -14 199 705 ;
+C -1 ; WX 276 ; N a91 ; B 35 0 242 692 ;
+C -1 ; WX 390 ; N a90 ; B 35 -14 355 705 ;
+C -1 ; WX 410 ; N a206 ; B 35 0 375 692 ;
+C -1 ; WX 317 ; N a94 ; B 35 0 283 692 ;
+C -1 ; WX 317 ; N a93 ; B 35 0 283 692 ;
+C -1 ; WX 276 ; N a92 ; B 35 0 242 692 ;
+C -1 ; WX 334 ; N a96 ; B 35 0 299 692 ;
+C -1 ; WX 234 ; N a88 ; B 35 -14 199 705 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Bold.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Bold.afm
new file mode 100644
index 0000000000000000000000000000000000000000..eb80542b11fa911243728a2ee962fa430668c64b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Bold.afm
@@ -0,0 +1,342 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Jun 23 16:28:00 1997
+Comment UniqueID 43048
+Comment VMusage 41139 52164
+FontName Courier-Bold
+FullName Courier Bold
+FamilyName Courier
+Weight Bold
+ItalicAngle 0
+IsFixedPitch true
+CharacterSet ExtendedRoman
+FontBBox -113 -250 749 801
+UnderlinePosition -100
+UnderlineThickness 50
+Version 003.000
+Notice Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 562
+XHeight 439
+Ascender 629
+Descender -157
+StdHW 84
+StdVW 106
+StartCharMetrics 315
+C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 600 ; N exclam ; B 202 -15 398 572 ;
+C 34 ; WX 600 ; N quotedbl ; B 135 277 465 562 ;
+C 35 ; WX 600 ; N numbersign ; B 56 -45 544 651 ;
+C 36 ; WX 600 ; N dollar ; B 82 -126 519 666 ;
+C 37 ; WX 600 ; N percent ; B 5 -15 595 616 ;
+C 38 ; WX 600 ; N ampersand ; B 36 -15 546 543 ;
+C 39 ; WX 600 ; N quoteright ; B 171 277 423 562 ;
+C 40 ; WX 600 ; N parenleft ; B 219 -102 461 616 ;
+C 41 ; WX 600 ; N parenright ; B 139 -102 381 616 ;
+C 42 ; WX 600 ; N asterisk ; B 91 219 509 601 ;
+C 43 ; WX 600 ; N plus ; B 71 39 529 478 ;
+C 44 ; WX 600 ; N comma ; B 123 -111 393 174 ;
+C 45 ; WX 600 ; N hyphen ; B 100 203 500 313 ;
+C 46 ; WX 600 ; N period ; B 192 -15 408 171 ;
+C 47 ; WX 600 ; N slash ; B 98 -77 502 626 ;
+C 48 ; WX 600 ; N zero ; B 87 -15 513 616 ;
+C 49 ; WX 600 ; N one ; B 81 0 539 616 ;
+C 50 ; WX 600 ; N two ; B 61 0 499 616 ;
+C 51 ; WX 600 ; N three ; B 63 -15 501 616 ;
+C 52 ; WX 600 ; N four ; B 53 0 507 616 ;
+C 53 ; WX 600 ; N five ; B 70 -15 521 601 ;
+C 54 ; WX 600 ; N six ; B 90 -15 521 616 ;
+C 55 ; WX 600 ; N seven ; B 55 0 494 601 ;
+C 56 ; WX 600 ; N eight ; B 83 -15 517 616 ;
+C 57 ; WX 600 ; N nine ; B 79 -15 510 616 ;
+C 58 ; WX 600 ; N colon ; B 191 -15 407 425 ;
+C 59 ; WX 600 ; N semicolon ; B 123 -111 408 425 ;
+C 60 ; WX 600 ; N less ; B 66 15 523 501 ;
+C 61 ; WX 600 ; N equal ; B 71 118 529 398 ;
+C 62 ; WX 600 ; N greater ; B 77 15 534 501 ;
+C 63 ; WX 600 ; N question ; B 98 -14 501 580 ;
+C 64 ; WX 600 ; N at ; B 16 -15 584 616 ;
+C 65 ; WX 600 ; N A ; B -9 0 609 562 ;
+C 66 ; WX 600 ; N B ; B 30 0 573 562 ;
+C 67 ; WX 600 ; N C ; B 22 -18 560 580 ;
+C 68 ; WX 600 ; N D ; B 30 0 594 562 ;
+C 69 ; WX 600 ; N E ; B 25 0 560 562 ;
+C 70 ; WX 600 ; N F ; B 39 0 570 562 ;
+C 71 ; WX 600 ; N G ; B 22 -18 594 580 ;
+C 72 ; WX 600 ; N H ; B 20 0 580 562 ;
+C 73 ; WX 600 ; N I ; B 77 0 523 562 ;
+C 74 ; WX 600 ; N J ; B 37 -18 601 562 ;
+C 75 ; WX 600 ; N K ; B 21 0 599 562 ;
+C 76 ; WX 600 ; N L ; B 39 0 578 562 ;
+C 77 ; WX 600 ; N M ; B -2 0 602 562 ;
+C 78 ; WX 600 ; N N ; B 8 -12 610 562 ;
+C 79 ; WX 600 ; N O ; B 22 -18 578 580 ;
+C 80 ; WX 600 ; N P ; B 48 0 559 562 ;
+C 81 ; WX 600 ; N Q ; B 32 -138 578 580 ;
+C 82 ; WX 600 ; N R ; B 24 0 599 562 ;
+C 83 ; WX 600 ; N S ; B 47 -22 553 582 ;
+C 84 ; WX 600 ; N T ; B 21 0 579 562 ;
+C 85 ; WX 600 ; N U ; B 4 -18 596 562 ;
+C 86 ; WX 600 ; N V ; B -13 0 613 562 ;
+C 87 ; WX 600 ; N W ; B -18 0 618 562 ;
+C 88 ; WX 600 ; N X ; B 12 0 588 562 ;
+C 89 ; WX 600 ; N Y ; B 12 0 589 562 ;
+C 90 ; WX 600 ; N Z ; B 62 0 539 562 ;
+C 91 ; WX 600 ; N bracketleft ; B 245 -102 475 616 ;
+C 92 ; WX 600 ; N backslash ; B 99 -77 503 626 ;
+C 93 ; WX 600 ; N bracketright ; B 125 -102 355 616 ;
+C 94 ; WX 600 ; N asciicircum ; B 108 250 492 616 ;
+C 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 178 277 428 562 ;
+C 97 ; WX 600 ; N a ; B 35 -15 570 454 ;
+C 98 ; WX 600 ; N b ; B 0 -15 584 626 ;
+C 99 ; WX 600 ; N c ; B 40 -15 545 459 ;
+C 100 ; WX 600 ; N d ; B 20 -15 591 626 ;
+C 101 ; WX 600 ; N e ; B 40 -15 563 454 ;
+C 102 ; WX 600 ; N f ; B 83 0 547 626 ; L i fi ; L l fl ;
+C 103 ; WX 600 ; N g ; B 30 -146 580 454 ;
+C 104 ; WX 600 ; N h ; B 5 0 592 626 ;
+C 105 ; WX 600 ; N i ; B 77 0 523 658 ;
+C 106 ; WX 600 ; N j ; B 63 -146 440 658 ;
+C 107 ; WX 600 ; N k ; B 20 0 585 626 ;
+C 108 ; WX 600 ; N l ; B 77 0 523 626 ;
+C 109 ; WX 600 ; N m ; B -22 0 626 454 ;
+C 110 ; WX 600 ; N n ; B 18 0 592 454 ;
+C 111 ; WX 600 ; N o ; B 30 -15 570 454 ;
+C 112 ; WX 600 ; N p ; B -1 -142 570 454 ;
+C 113 ; WX 600 ; N q ; B 20 -142 591 454 ;
+C 114 ; WX 600 ; N r ; B 47 0 580 454 ;
+C 115 ; WX 600 ; N s ; B 68 -17 535 459 ;
+C 116 ; WX 600 ; N t ; B 47 -15 532 562 ;
+C 117 ; WX 600 ; N u ; B -1 -15 569 439 ;
+C 118 ; WX 600 ; N v ; B -1 0 601 439 ;
+C 119 ; WX 600 ; N w ; B -18 0 618 439 ;
+C 120 ; WX 600 ; N x ; B 6 0 594 439 ;
+C 121 ; WX 600 ; N y ; B -4 -142 601 439 ;
+C 122 ; WX 600 ; N z ; B 81 0 520 439 ;
+C 123 ; WX 600 ; N braceleft ; B 160 -102 464 616 ;
+C 124 ; WX 600 ; N bar ; B 255 -250 345 750 ;
+C 125 ; WX 600 ; N braceright ; B 136 -102 440 616 ;
+C 126 ; WX 600 ; N asciitilde ; B 71 153 530 356 ;
+C 161 ; WX 600 ; N exclamdown ; B 202 -146 398 449 ;
+C 162 ; WX 600 ; N cent ; B 66 -49 518 614 ;
+C 163 ; WX 600 ; N sterling ; B 72 -28 558 611 ;
+C 164 ; WX 600 ; N fraction ; B 25 -60 576 661 ;
+C 165 ; WX 600 ; N yen ; B 10 0 590 562 ;
+C 166 ; WX 600 ; N florin ; B -30 -131 572 616 ;
+C 167 ; WX 600 ; N section ; B 83 -70 517 580 ;
+C 168 ; WX 600 ; N currency ; B 54 49 546 517 ;
+C 169 ; WX 600 ; N quotesingle ; B 227 277 373 562 ;
+C 170 ; WX 600 ; N quotedblleft ; B 71 277 535 562 ;
+C 171 ; WX 600 ; N guillemotleft ; B 8 70 553 446 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 141 70 459 446 ;
+C 173 ; WX 600 ; N guilsinglright ; B 141 70 459 446 ;
+C 174 ; WX 600 ; N fi ; B 12 0 593 626 ;
+C 175 ; WX 600 ; N fl ; B 12 0 593 626 ;
+C 177 ; WX 600 ; N endash ; B 65 203 535 313 ;
+C 178 ; WX 600 ; N dagger ; B 106 -70 494 580 ;
+C 179 ; WX 600 ; N daggerdbl ; B 106 -70 494 580 ;
+C 180 ; WX 600 ; N periodcentered ; B 196 165 404 351 ;
+C 182 ; WX 600 ; N paragraph ; B 6 -70 576 580 ;
+C 183 ; WX 600 ; N bullet ; B 140 132 460 430 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 175 -142 427 143 ;
+C 185 ; WX 600 ; N quotedblbase ; B 65 -142 529 143 ;
+C 186 ; WX 600 ; N quotedblright ; B 61 277 525 562 ;
+C 187 ; WX 600 ; N guillemotright ; B 47 70 592 446 ;
+C 188 ; WX 600 ; N ellipsis ; B 26 -15 574 116 ;
+C 189 ; WX 600 ; N perthousand ; B -113 -15 713 616 ;
+C 191 ; WX 600 ; N questiondown ; B 99 -146 502 449 ;
+C 193 ; WX 600 ; N grave ; B 132 508 395 661 ;
+C 194 ; WX 600 ; N acute ; B 205 508 468 661 ;
+C 195 ; WX 600 ; N circumflex ; B 103 483 497 657 ;
+C 196 ; WX 600 ; N tilde ; B 89 493 512 636 ;
+C 197 ; WX 600 ; N macron ; B 88 505 512 585 ;
+C 198 ; WX 600 ; N breve ; B 83 468 517 631 ;
+C 199 ; WX 600 ; N dotaccent ; B 230 498 370 638 ;
+C 200 ; WX 600 ; N dieresis ; B 128 498 472 638 ;
+C 202 ; WX 600 ; N ring ; B 198 481 402 678 ;
+C 203 ; WX 600 ; N cedilla ; B 205 -206 387 0 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 68 488 588 661 ;
+C 206 ; WX 600 ; N ogonek ; B 169 -199 400 0 ;
+C 207 ; WX 600 ; N caron ; B 103 493 497 667 ;
+C 208 ; WX 600 ; N emdash ; B -10 203 610 313 ;
+C 225 ; WX 600 ; N AE ; B -29 0 602 562 ;
+C 227 ; WX 600 ; N ordfeminine ; B 147 196 453 580 ;
+C 232 ; WX 600 ; N Lslash ; B 39 0 578 562 ;
+C 233 ; WX 600 ; N Oslash ; B 22 -22 578 584 ;
+C 234 ; WX 600 ; N OE ; B -25 0 595 562 ;
+C 235 ; WX 600 ; N ordmasculine ; B 147 196 453 580 ;
+C 241 ; WX 600 ; N ae ; B -4 -15 601 454 ;
+C 245 ; WX 600 ; N dotlessi ; B 77 0 523 439 ;
+C 248 ; WX 600 ; N lslash ; B 77 0 523 626 ;
+C 249 ; WX 600 ; N oslash ; B 30 -24 570 463 ;
+C 250 ; WX 600 ; N oe ; B -18 -15 611 454 ;
+C 251 ; WX 600 ; N germandbls ; B 22 -15 596 626 ;
+C -1 ; WX 600 ; N Idieresis ; B 77 0 523 761 ;
+C -1 ; WX 600 ; N eacute ; B 40 -15 563 661 ;
+C -1 ; WX 600 ; N abreve ; B 35 -15 570 661 ;
+C -1 ; WX 600 ; N uhungarumlaut ; B -1 -15 628 661 ;
+C -1 ; WX 600 ; N ecaron ; B 40 -15 563 667 ;
+C -1 ; WX 600 ; N Ydieresis ; B 12 0 589 761 ;
+C -1 ; WX 600 ; N divide ; B 71 16 529 500 ;
+C -1 ; WX 600 ; N Yacute ; B 12 0 589 784 ;
+C -1 ; WX 600 ; N Acircumflex ; B -9 0 609 780 ;
+C -1 ; WX 600 ; N aacute ; B 35 -15 570 661 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 4 -18 596 780 ;
+C -1 ; WX 600 ; N yacute ; B -4 -142 601 661 ;
+C -1 ; WX 600 ; N scommaaccent ; B 68 -250 535 459 ;
+C -1 ; WX 600 ; N ecircumflex ; B 40 -15 563 657 ;
+C -1 ; WX 600 ; N Uring ; B 4 -18 596 801 ;
+C -1 ; WX 600 ; N Udieresis ; B 4 -18 596 761 ;
+C -1 ; WX 600 ; N aogonek ; B 35 -199 586 454 ;
+C -1 ; WX 600 ; N Uacute ; B 4 -18 596 784 ;
+C -1 ; WX 600 ; N uogonek ; B -1 -199 585 439 ;
+C -1 ; WX 600 ; N Edieresis ; B 25 0 560 761 ;
+C -1 ; WX 600 ; N Dcroat ; B 30 0 594 562 ;
+C -1 ; WX 600 ; N commaaccent ; B 205 -250 397 -57 ;
+C -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;
+C -1 ; WX 600 ; N Emacron ; B 25 0 560 708 ;
+C -1 ; WX 600 ; N ccaron ; B 40 -15 545 667 ;
+C -1 ; WX 600 ; N aring ; B 35 -15 570 678 ;
+C -1 ; WX 600 ; N Ncommaaccent ; B 8 -250 610 562 ;
+C -1 ; WX 600 ; N lacute ; B 77 0 523 801 ;
+C -1 ; WX 600 ; N agrave ; B 35 -15 570 661 ;
+C -1 ; WX 600 ; N Tcommaaccent ; B 21 -250 579 562 ;
+C -1 ; WX 600 ; N Cacute ; B 22 -18 560 784 ;
+C -1 ; WX 600 ; N atilde ; B 35 -15 570 636 ;
+C -1 ; WX 600 ; N Edotaccent ; B 25 0 560 761 ;
+C -1 ; WX 600 ; N scaron ; B 68 -17 535 667 ;
+C -1 ; WX 600 ; N scedilla ; B 68 -206 535 459 ;
+C -1 ; WX 600 ; N iacute ; B 77 0 523 661 ;
+C -1 ; WX 600 ; N lozenge ; B 66 0 534 740 ;
+C -1 ; WX 600 ; N Rcaron ; B 24 0 599 790 ;
+C -1 ; WX 600 ; N Gcommaaccent ; B 22 -250 594 580 ;
+C -1 ; WX 600 ; N ucircumflex ; B -1 -15 569 657 ;
+C -1 ; WX 600 ; N acircumflex ; B 35 -15 570 657 ;
+C -1 ; WX 600 ; N Amacron ; B -9 0 609 708 ;
+C -1 ; WX 600 ; N rcaron ; B 47 0 580 667 ;
+C -1 ; WX 600 ; N ccedilla ; B 40 -206 545 459 ;
+C -1 ; WX 600 ; N Zdotaccent ; B 62 0 539 761 ;
+C -1 ; WX 600 ; N Thorn ; B 48 0 557 562 ;
+C -1 ; WX 600 ; N Omacron ; B 22 -18 578 708 ;
+C -1 ; WX 600 ; N Racute ; B 24 0 599 784 ;
+C -1 ; WX 600 ; N Sacute ; B 47 -22 553 784 ;
+C -1 ; WX 600 ; N dcaron ; B 20 -15 727 626 ;
+C -1 ; WX 600 ; N Umacron ; B 4 -18 596 708 ;
+C -1 ; WX 600 ; N uring ; B -1 -15 569 678 ;
+C -1 ; WX 600 ; N threesuperior ; B 138 222 433 616 ;
+C -1 ; WX 600 ; N Ograve ; B 22 -18 578 784 ;
+C -1 ; WX 600 ; N Agrave ; B -9 0 609 784 ;
+C -1 ; WX 600 ; N Abreve ; B -9 0 609 784 ;
+C -1 ; WX 600 ; N multiply ; B 81 39 520 478 ;
+C -1 ; WX 600 ; N uacute ; B -1 -15 569 661 ;
+C -1 ; WX 600 ; N Tcaron ; B 21 0 579 790 ;
+C -1 ; WX 600 ; N partialdiff ; B 63 -38 537 728 ;
+C -1 ; WX 600 ; N ydieresis ; B -4 -142 601 638 ;
+C -1 ; WX 600 ; N Nacute ; B 8 -12 610 784 ;
+C -1 ; WX 600 ; N icircumflex ; B 73 0 523 657 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 25 0 560 780 ;
+C -1 ; WX 600 ; N adieresis ; B 35 -15 570 638 ;
+C -1 ; WX 600 ; N edieresis ; B 40 -15 563 638 ;
+C -1 ; WX 600 ; N cacute ; B 40 -15 545 661 ;
+C -1 ; WX 600 ; N nacute ; B 18 0 592 661 ;
+C -1 ; WX 600 ; N umacron ; B -1 -15 569 585 ;
+C -1 ; WX 600 ; N Ncaron ; B 8 -12 610 790 ;
+C -1 ; WX 600 ; N Iacute ; B 77 0 523 784 ;
+C -1 ; WX 600 ; N plusminus ; B 71 24 529 515 ;
+C -1 ; WX 600 ; N brokenbar ; B 255 -175 345 675 ;
+C -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;
+C -1 ; WX 600 ; N Gbreve ; B 22 -18 594 784 ;
+C -1 ; WX 600 ; N Idotaccent ; B 77 0 523 761 ;
+C -1 ; WX 600 ; N summation ; B 15 -10 586 706 ;
+C -1 ; WX 600 ; N Egrave ; B 25 0 560 784 ;
+C -1 ; WX 600 ; N racute ; B 47 0 580 661 ;
+C -1 ; WX 600 ; N omacron ; B 30 -15 570 585 ;
+C -1 ; WX 600 ; N Zacute ; B 62 0 539 784 ;
+C -1 ; WX 600 ; N Zcaron ; B 62 0 539 790 ;
+C -1 ; WX 600 ; N greaterequal ; B 26 0 523 696 ;
+C -1 ; WX 600 ; N Eth ; B 30 0 594 562 ;
+C -1 ; WX 600 ; N Ccedilla ; B 22 -206 560 580 ;
+C -1 ; WX 600 ; N lcommaaccent ; B 77 -250 523 626 ;
+C -1 ; WX 600 ; N tcaron ; B 47 -15 532 703 ;
+C -1 ; WX 600 ; N eogonek ; B 40 -199 563 454 ;
+C -1 ; WX 600 ; N Uogonek ; B 4 -199 596 562 ;
+C -1 ; WX 600 ; N Aacute ; B -9 0 609 784 ;
+C -1 ; WX 600 ; N Adieresis ; B -9 0 609 761 ;
+C -1 ; WX 600 ; N egrave ; B 40 -15 563 661 ;
+C -1 ; WX 600 ; N zacute ; B 81 0 520 661 ;
+C -1 ; WX 600 ; N iogonek ; B 77 -199 523 658 ;
+C -1 ; WX 600 ; N Oacute ; B 22 -18 578 784 ;
+C -1 ; WX 600 ; N oacute ; B 30 -15 570 661 ;
+C -1 ; WX 600 ; N amacron ; B 35 -15 570 585 ;
+C -1 ; WX 600 ; N sacute ; B 68 -17 535 661 ;
+C -1 ; WX 600 ; N idieresis ; B 77 0 523 618 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 22 -18 578 780 ;
+C -1 ; WX 600 ; N Ugrave ; B 4 -18 596 784 ;
+C -1 ; WX 600 ; N Delta ; B 6 0 594 688 ;
+C -1 ; WX 600 ; N thorn ; B -14 -142 570 626 ;
+C -1 ; WX 600 ; N twosuperior ; B 143 230 436 616 ;
+C -1 ; WX 600 ; N Odieresis ; B 22 -18 578 761 ;
+C -1 ; WX 600 ; N mu ; B -1 -142 569 439 ;
+C -1 ; WX 600 ; N igrave ; B 77 0 523 661 ;
+C -1 ; WX 600 ; N ohungarumlaut ; B 30 -15 668 661 ;
+C -1 ; WX 600 ; N Eogonek ; B 25 -199 576 562 ;
+C -1 ; WX 600 ; N dcroat ; B 20 -15 591 626 ;
+C -1 ; WX 600 ; N threequarters ; B -47 -60 648 661 ;
+C -1 ; WX 600 ; N Scedilla ; B 47 -206 553 582 ;
+C -1 ; WX 600 ; N lcaron ; B 77 0 597 626 ;
+C -1 ; WX 600 ; N Kcommaaccent ; B 21 -250 599 562 ;
+C -1 ; WX 600 ; N Lacute ; B 39 0 578 784 ;
+C -1 ; WX 600 ; N trademark ; B -9 230 749 562 ;
+C -1 ; WX 600 ; N edotaccent ; B 40 -15 563 638 ;
+C -1 ; WX 600 ; N Igrave ; B 77 0 523 784 ;
+C -1 ; WX 600 ; N Imacron ; B 77 0 523 708 ;
+C -1 ; WX 600 ; N Lcaron ; B 39 0 637 562 ;
+C -1 ; WX 600 ; N onehalf ; B -47 -60 648 661 ;
+C -1 ; WX 600 ; N lessequal ; B 26 0 523 696 ;
+C -1 ; WX 600 ; N ocircumflex ; B 30 -15 570 657 ;
+C -1 ; WX 600 ; N ntilde ; B 18 0 592 636 ;
+C -1 ; WX 600 ; N Uhungarumlaut ; B 4 -18 638 784 ;
+C -1 ; WX 600 ; N Eacute ; B 25 0 560 784 ;
+C -1 ; WX 600 ; N emacron ; B 40 -15 563 585 ;
+C -1 ; WX 600 ; N gbreve ; B 30 -146 580 661 ;
+C -1 ; WX 600 ; N onequarter ; B -56 -60 656 661 ;
+C -1 ; WX 600 ; N Scaron ; B 47 -22 553 790 ;
+C -1 ; WX 600 ; N Scommaaccent ; B 47 -250 553 582 ;
+C -1 ; WX 600 ; N Ohungarumlaut ; B 22 -18 628 784 ;
+C -1 ; WX 600 ; N degree ; B 86 243 474 616 ;
+C -1 ; WX 600 ; N ograve ; B 30 -15 570 661 ;
+C -1 ; WX 600 ; N Ccaron ; B 22 -18 560 790 ;
+C -1 ; WX 600 ; N ugrave ; B -1 -15 569 661 ;
+C -1 ; WX 600 ; N radical ; B -19 -104 473 778 ;
+C -1 ; WX 600 ; N Dcaron ; B 30 0 594 790 ;
+C -1 ; WX 600 ; N rcommaaccent ; B 47 -250 580 454 ;
+C -1 ; WX 600 ; N Ntilde ; B 8 -12 610 759 ;
+C -1 ; WX 600 ; N otilde ; B 30 -15 570 636 ;
+C -1 ; WX 600 ; N Rcommaaccent ; B 24 -250 599 562 ;
+C -1 ; WX 600 ; N Lcommaaccent ; B 39 -250 578 562 ;
+C -1 ; WX 600 ; N Atilde ; B -9 0 609 759 ;
+C -1 ; WX 600 ; N Aogonek ; B -9 -199 625 562 ;
+C -1 ; WX 600 ; N Aring ; B -9 0 609 801 ;
+C -1 ; WX 600 ; N Otilde ; B 22 -18 578 759 ;
+C -1 ; WX 600 ; N zdotaccent ; B 81 0 520 638 ;
+C -1 ; WX 600 ; N Ecaron ; B 25 0 560 790 ;
+C -1 ; WX 600 ; N Iogonek ; B 77 -199 523 562 ;
+C -1 ; WX 600 ; N kcommaaccent ; B 20 -250 585 626 ;
+C -1 ; WX 600 ; N minus ; B 71 203 529 313 ;
+C -1 ; WX 600 ; N Icircumflex ; B 77 0 523 780 ;
+C -1 ; WX 600 ; N ncaron ; B 18 0 592 667 ;
+C -1 ; WX 600 ; N tcommaaccent ; B 47 -250 532 562 ;
+C -1 ; WX 600 ; N logicalnot ; B 71 103 529 413 ;
+C -1 ; WX 600 ; N odieresis ; B 30 -15 570 638 ;
+C -1 ; WX 600 ; N udieresis ; B -1 -15 569 638 ;
+C -1 ; WX 600 ; N notequal ; B 12 -47 537 563 ;
+C -1 ; WX 600 ; N gcommaaccent ; B 30 -146 580 714 ;
+C -1 ; WX 600 ; N eth ; B 58 -27 543 626 ;
+C -1 ; WX 600 ; N zcaron ; B 81 0 520 667 ;
+C -1 ; WX 600 ; N ncommaaccent ; B 18 -250 592 454 ;
+C -1 ; WX 600 ; N onesuperior ; B 153 230 447 616 ;
+C -1 ; WX 600 ; N imacron ; B 77 0 523 585 ;
+C -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-BoldOblique.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-BoldOblique.afm
new file mode 100644
index 0000000000000000000000000000000000000000..29d3b8b10ec4807eca647057669f027e93943527
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-BoldOblique.afm
@@ -0,0 +1,342 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Mon Jun 23 16:28:46 1997
+Comment UniqueID 43049
+Comment VMusage 17529 79244
+FontName Courier-BoldOblique
+FullName Courier Bold Oblique
+FamilyName Courier
+Weight Bold
+ItalicAngle -12
+IsFixedPitch true
+CharacterSet ExtendedRoman
+FontBBox -57 -250 869 801
+UnderlinePosition -100
+UnderlineThickness 50
+Version 003.000
+Notice Copyright (c) 1989, 1990, 1991, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 562
+XHeight 439
+Ascender 629
+Descender -157
+StdHW 84
+StdVW 106
+StartCharMetrics 315
+C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 600 ; N exclam ; B 215 -15 495 572 ;
+C 34 ; WX 600 ; N quotedbl ; B 211 277 585 562 ;
+C 35 ; WX 600 ; N numbersign ; B 88 -45 641 651 ;
+C 36 ; WX 600 ; N dollar ; B 87 -126 630 666 ;
+C 37 ; WX 600 ; N percent ; B 101 -15 625 616 ;
+C 38 ; WX 600 ; N ampersand ; B 61 -15 595 543 ;
+C 39 ; WX 600 ; N quoteright ; B 229 277 543 562 ;
+C 40 ; WX 600 ; N parenleft ; B 265 -102 592 616 ;
+C 41 ; WX 600 ; N parenright ; B 117 -102 444 616 ;
+C 42 ; WX 600 ; N asterisk ; B 179 219 598 601 ;
+C 43 ; WX 600 ; N plus ; B 114 39 596 478 ;
+C 44 ; WX 600 ; N comma ; B 99 -111 430 174 ;
+C 45 ; WX 600 ; N hyphen ; B 143 203 567 313 ;
+C 46 ; WX 600 ; N period ; B 206 -15 427 171 ;
+C 47 ; WX 600 ; N slash ; B 90 -77 626 626 ;
+C 48 ; WX 600 ; N zero ; B 135 -15 593 616 ;
+C 49 ; WX 600 ; N one ; B 93 0 562 616 ;
+C 50 ; WX 600 ; N two ; B 61 0 594 616 ;
+C 51 ; WX 600 ; N three ; B 71 -15 571 616 ;
+C 52 ; WX 600 ; N four ; B 81 0 559 616 ;
+C 53 ; WX 600 ; N five ; B 77 -15 621 601 ;
+C 54 ; WX 600 ; N six ; B 135 -15 652 616 ;
+C 55 ; WX 600 ; N seven ; B 147 0 622 601 ;
+C 56 ; WX 600 ; N eight ; B 115 -15 604 616 ;
+C 57 ; WX 600 ; N nine ; B 75 -15 592 616 ;
+C 58 ; WX 600 ; N colon ; B 205 -15 480 425 ;
+C 59 ; WX 600 ; N semicolon ; B 99 -111 481 425 ;
+C 60 ; WX 600 ; N less ; B 120 15 613 501 ;
+C 61 ; WX 600 ; N equal ; B 96 118 614 398 ;
+C 62 ; WX 600 ; N greater ; B 97 15 589 501 ;
+C 63 ; WX 600 ; N question ; B 183 -14 592 580 ;
+C 64 ; WX 600 ; N at ; B 65 -15 642 616 ;
+C 65 ; WX 600 ; N A ; B -9 0 632 562 ;
+C 66 ; WX 600 ; N B ; B 30 0 630 562 ;
+C 67 ; WX 600 ; N C ; B 74 -18 675 580 ;
+C 68 ; WX 600 ; N D ; B 30 0 664 562 ;
+C 69 ; WX 600 ; N E ; B 25 0 670 562 ;
+C 70 ; WX 600 ; N F ; B 39 0 684 562 ;
+C 71 ; WX 600 ; N G ; B 74 -18 675 580 ;
+C 72 ; WX 600 ; N H ; B 20 0 700 562 ;
+C 73 ; WX 600 ; N I ; B 77 0 643 562 ;
+C 74 ; WX 600 ; N J ; B 58 -18 721 562 ;
+C 75 ; WX 600 ; N K ; B 21 0 692 562 ;
+C 76 ; WX 600 ; N L ; B 39 0 636 562 ;
+C 77 ; WX 600 ; N M ; B -2 0 722 562 ;
+C 78 ; WX 600 ; N N ; B 8 -12 730 562 ;
+C 79 ; WX 600 ; N O ; B 74 -18 645 580 ;
+C 80 ; WX 600 ; N P ; B 48 0 643 562 ;
+C 81 ; WX 600 ; N Q ; B 83 -138 636 580 ;
+C 82 ; WX 600 ; N R ; B 24 0 617 562 ;
+C 83 ; WX 600 ; N S ; B 54 -22 673 582 ;
+C 84 ; WX 600 ; N T ; B 86 0 679 562 ;
+C 85 ; WX 600 ; N U ; B 101 -18 716 562 ;
+C 86 ; WX 600 ; N V ; B 84 0 733 562 ;
+C 87 ; WX 600 ; N W ; B 79 0 738 562 ;
+C 88 ; WX 600 ; N X ; B 12 0 690 562 ;
+C 89 ; WX 600 ; N Y ; B 109 0 709 562 ;
+C 90 ; WX 600 ; N Z ; B 62 0 637 562 ;
+C 91 ; WX 600 ; N bracketleft ; B 223 -102 606 616 ;
+C 92 ; WX 600 ; N backslash ; B 222 -77 496 626 ;
+C 93 ; WX 600 ; N bracketright ; B 103 -102 486 616 ;
+C 94 ; WX 600 ; N asciicircum ; B 171 250 556 616 ;
+C 95 ; WX 600 ; N underscore ; B -27 -125 585 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 297 277 487 562 ;
+C 97 ; WX 600 ; N a ; B 61 -15 593 454 ;
+C 98 ; WX 600 ; N b ; B 13 -15 636 626 ;
+C 99 ; WX 600 ; N c ; B 81 -15 631 459 ;
+C 100 ; WX 600 ; N d ; B 60 -15 645 626 ;
+C 101 ; WX 600 ; N e ; B 81 -15 605 454 ;
+C 102 ; WX 600 ; N f ; B 83 0 677 626 ; L i fi ; L l fl ;
+C 103 ; WX 600 ; N g ; B 40 -146 674 454 ;
+C 104 ; WX 600 ; N h ; B 18 0 615 626 ;
+C 105 ; WX 600 ; N i ; B 77 0 546 658 ;
+C 106 ; WX 600 ; N j ; B 36 -146 580 658 ;
+C 107 ; WX 600 ; N k ; B 33 0 643 626 ;
+C 108 ; WX 600 ; N l ; B 77 0 546 626 ;
+C 109 ; WX 600 ; N m ; B -22 0 649 454 ;
+C 110 ; WX 600 ; N n ; B 18 0 615 454 ;
+C 111 ; WX 600 ; N o ; B 71 -15 622 454 ;
+C 112 ; WX 600 ; N p ; B -32 -142 622 454 ;
+C 113 ; WX 600 ; N q ; B 60 -142 685 454 ;
+C 114 ; WX 600 ; N r ; B 47 0 655 454 ;
+C 115 ; WX 600 ; N s ; B 66 -17 608 459 ;
+C 116 ; WX 600 ; N t ; B 118 -15 567 562 ;
+C 117 ; WX 600 ; N u ; B 70 -15 592 439 ;
+C 118 ; WX 600 ; N v ; B 70 0 695 439 ;
+C 119 ; WX 600 ; N w ; B 53 0 712 439 ;
+C 120 ; WX 600 ; N x ; B 6 0 671 439 ;
+C 121 ; WX 600 ; N y ; B -21 -142 695 439 ;
+C 122 ; WX 600 ; N z ; B 81 0 614 439 ;
+C 123 ; WX 600 ; N braceleft ; B 203 -102 595 616 ;
+C 124 ; WX 600 ; N bar ; B 201 -250 505 750 ;
+C 125 ; WX 600 ; N braceright ; B 114 -102 506 616 ;
+C 126 ; WX 600 ; N asciitilde ; B 120 153 590 356 ;
+C 161 ; WX 600 ; N exclamdown ; B 196 -146 477 449 ;
+C 162 ; WX 600 ; N cent ; B 121 -49 605 614 ;
+C 163 ; WX 600 ; N sterling ; B 106 -28 650 611 ;
+C 164 ; WX 600 ; N fraction ; B 22 -60 708 661 ;
+C 165 ; WX 600 ; N yen ; B 98 0 710 562 ;
+C 166 ; WX 600 ; N florin ; B -57 -131 702 616 ;
+C 167 ; WX 600 ; N section ; B 74 -70 620 580 ;
+C 168 ; WX 600 ; N currency ; B 77 49 644 517 ;
+C 169 ; WX 600 ; N quotesingle ; B 303 277 493 562 ;
+C 170 ; WX 600 ; N quotedblleft ; B 190 277 594 562 ;
+C 171 ; WX 600 ; N guillemotleft ; B 62 70 639 446 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 195 70 545 446 ;
+C 173 ; WX 600 ; N guilsinglright ; B 165 70 514 446 ;
+C 174 ; WX 600 ; N fi ; B 12 0 644 626 ;
+C 175 ; WX 600 ; N fl ; B 12 0 644 626 ;
+C 177 ; WX 600 ; N endash ; B 108 203 602 313 ;
+C 178 ; WX 600 ; N dagger ; B 175 -70 586 580 ;
+C 179 ; WX 600 ; N daggerdbl ; B 121 -70 587 580 ;
+C 180 ; WX 600 ; N periodcentered ; B 248 165 461 351 ;
+C 182 ; WX 600 ; N paragraph ; B 61 -70 700 580 ;
+C 183 ; WX 600 ; N bullet ; B 196 132 523 430 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 144 -142 458 143 ;
+C 185 ; WX 600 ; N quotedblbase ; B 34 -142 560 143 ;
+C 186 ; WX 600 ; N quotedblright ; B 119 277 645 562 ;
+C 187 ; WX 600 ; N guillemotright ; B 71 70 647 446 ;
+C 188 ; WX 600 ; N ellipsis ; B 35 -15 587 116 ;
+C 189 ; WX 600 ; N perthousand ; B -45 -15 743 616 ;
+C 191 ; WX 600 ; N questiondown ; B 100 -146 509 449 ;
+C 193 ; WX 600 ; N grave ; B 272 508 503 661 ;
+C 194 ; WX 600 ; N acute ; B 312 508 609 661 ;
+C 195 ; WX 600 ; N circumflex ; B 212 483 607 657 ;
+C 196 ; WX 600 ; N tilde ; B 199 493 643 636 ;
+C 197 ; WX 600 ; N macron ; B 195 505 637 585 ;
+C 198 ; WX 600 ; N breve ; B 217 468 652 631 ;
+C 199 ; WX 600 ; N dotaccent ; B 348 498 493 638 ;
+C 200 ; WX 600 ; N dieresis ; B 246 498 595 638 ;
+C 202 ; WX 600 ; N ring ; B 319 481 528 678 ;
+C 203 ; WX 600 ; N cedilla ; B 168 -206 368 0 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 171 488 729 661 ;
+C 206 ; WX 600 ; N ogonek ; B 143 -199 367 0 ;
+C 207 ; WX 600 ; N caron ; B 238 493 633 667 ;
+C 208 ; WX 600 ; N emdash ; B 33 203 677 313 ;
+C 225 ; WX 600 ; N AE ; B -29 0 708 562 ;
+C 227 ; WX 600 ; N ordfeminine ; B 188 196 526 580 ;
+C 232 ; WX 600 ; N Lslash ; B 39 0 636 562 ;
+C 233 ; WX 600 ; N Oslash ; B 48 -22 673 584 ;
+C 234 ; WX 600 ; N OE ; B 26 0 701 562 ;
+C 235 ; WX 600 ; N ordmasculine ; B 188 196 543 580 ;
+C 241 ; WX 600 ; N ae ; B 21 -15 652 454 ;
+C 245 ; WX 600 ; N dotlessi ; B 77 0 546 439 ;
+C 248 ; WX 600 ; N lslash ; B 77 0 587 626 ;
+C 249 ; WX 600 ; N oslash ; B 54 -24 638 463 ;
+C 250 ; WX 600 ; N oe ; B 18 -15 662 454 ;
+C 251 ; WX 600 ; N germandbls ; B 22 -15 629 626 ;
+C -1 ; WX 600 ; N Idieresis ; B 77 0 643 761 ;
+C -1 ; WX 600 ; N eacute ; B 81 -15 609 661 ;
+C -1 ; WX 600 ; N abreve ; B 61 -15 658 661 ;
+C -1 ; WX 600 ; N uhungarumlaut ; B 70 -15 769 661 ;
+C -1 ; WX 600 ; N ecaron ; B 81 -15 633 667 ;
+C -1 ; WX 600 ; N Ydieresis ; B 109 0 709 761 ;
+C -1 ; WX 600 ; N divide ; B 114 16 596 500 ;
+C -1 ; WX 600 ; N Yacute ; B 109 0 709 784 ;
+C -1 ; WX 600 ; N Acircumflex ; B -9 0 632 780 ;
+C -1 ; WX 600 ; N aacute ; B 61 -15 609 661 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 101 -18 716 780 ;
+C -1 ; WX 600 ; N yacute ; B -21 -142 695 661 ;
+C -1 ; WX 600 ; N scommaaccent ; B 66 -250 608 459 ;
+C -1 ; WX 600 ; N ecircumflex ; B 81 -15 607 657 ;
+C -1 ; WX 600 ; N Uring ; B 101 -18 716 801 ;
+C -1 ; WX 600 ; N Udieresis ; B 101 -18 716 761 ;
+C -1 ; WX 600 ; N aogonek ; B 61 -199 593 454 ;
+C -1 ; WX 600 ; N Uacute ; B 101 -18 716 784 ;
+C -1 ; WX 600 ; N uogonek ; B 70 -199 592 439 ;
+C -1 ; WX 600 ; N Edieresis ; B 25 0 670 761 ;
+C -1 ; WX 600 ; N Dcroat ; B 30 0 664 562 ;
+C -1 ; WX 600 ; N commaaccent ; B 151 -250 385 -57 ;
+C -1 ; WX 600 ; N copyright ; B 53 -18 667 580 ;
+C -1 ; WX 600 ; N Emacron ; B 25 0 670 708 ;
+C -1 ; WX 600 ; N ccaron ; B 81 -15 633 667 ;
+C -1 ; WX 600 ; N aring ; B 61 -15 593 678 ;
+C -1 ; WX 600 ; N Ncommaaccent ; B 8 -250 730 562 ;
+C -1 ; WX 600 ; N lacute ; B 77 0 639 801 ;
+C -1 ; WX 600 ; N agrave ; B 61 -15 593 661 ;
+C -1 ; WX 600 ; N Tcommaaccent ; B 86 -250 679 562 ;
+C -1 ; WX 600 ; N Cacute ; B 74 -18 675 784 ;
+C -1 ; WX 600 ; N atilde ; B 61 -15 643 636 ;
+C -1 ; WX 600 ; N Edotaccent ; B 25 0 670 761 ;
+C -1 ; WX 600 ; N scaron ; B 66 -17 633 667 ;
+C -1 ; WX 600 ; N scedilla ; B 66 -206 608 459 ;
+C -1 ; WX 600 ; N iacute ; B 77 0 609 661 ;
+C -1 ; WX 600 ; N lozenge ; B 145 0 614 740 ;
+C -1 ; WX 600 ; N Rcaron ; B 24 0 659 790 ;
+C -1 ; WX 600 ; N Gcommaaccent ; B 74 -250 675 580 ;
+C -1 ; WX 600 ; N ucircumflex ; B 70 -15 597 657 ;
+C -1 ; WX 600 ; N acircumflex ; B 61 -15 607 657 ;
+C -1 ; WX 600 ; N Amacron ; B -9 0 633 708 ;
+C -1 ; WX 600 ; N rcaron ; B 47 0 655 667 ;
+C -1 ; WX 600 ; N ccedilla ; B 81 -206 631 459 ;
+C -1 ; WX 600 ; N Zdotaccent ; B 62 0 637 761 ;
+C -1 ; WX 600 ; N Thorn ; B 48 0 620 562 ;
+C -1 ; WX 600 ; N Omacron ; B 74 -18 663 708 ;
+C -1 ; WX 600 ; N Racute ; B 24 0 665 784 ;
+C -1 ; WX 600 ; N Sacute ; B 54 -22 673 784 ;
+C -1 ; WX 600 ; N dcaron ; B 60 -15 861 626 ;
+C -1 ; WX 600 ; N Umacron ; B 101 -18 716 708 ;
+C -1 ; WX 600 ; N uring ; B 70 -15 592 678 ;
+C -1 ; WX 600 ; N threesuperior ; B 193 222 526 616 ;
+C -1 ; WX 600 ; N Ograve ; B 74 -18 645 784 ;
+C -1 ; WX 600 ; N Agrave ; B -9 0 632 784 ;
+C -1 ; WX 600 ; N Abreve ; B -9 0 684 784 ;
+C -1 ; WX 600 ; N multiply ; B 104 39 606 478 ;
+C -1 ; WX 600 ; N uacute ; B 70 -15 599 661 ;
+C -1 ; WX 600 ; N Tcaron ; B 86 0 679 790 ;
+C -1 ; WX 600 ; N partialdiff ; B 91 -38 627 728 ;
+C -1 ; WX 600 ; N ydieresis ; B -21 -142 695 638 ;
+C -1 ; WX 600 ; N Nacute ; B 8 -12 730 784 ;
+C -1 ; WX 600 ; N icircumflex ; B 77 0 577 657 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 25 0 670 780 ;
+C -1 ; WX 600 ; N adieresis ; B 61 -15 595 638 ;
+C -1 ; WX 600 ; N edieresis ; B 81 -15 605 638 ;
+C -1 ; WX 600 ; N cacute ; B 81 -15 649 661 ;
+C -1 ; WX 600 ; N nacute ; B 18 0 639 661 ;
+C -1 ; WX 600 ; N umacron ; B 70 -15 637 585 ;
+C -1 ; WX 600 ; N Ncaron ; B 8 -12 730 790 ;
+C -1 ; WX 600 ; N Iacute ; B 77 0 643 784 ;
+C -1 ; WX 600 ; N plusminus ; B 76 24 614 515 ;
+C -1 ; WX 600 ; N brokenbar ; B 217 -175 489 675 ;
+C -1 ; WX 600 ; N registered ; B 53 -18 667 580 ;
+C -1 ; WX 600 ; N Gbreve ; B 74 -18 684 784 ;
+C -1 ; WX 600 ; N Idotaccent ; B 77 0 643 761 ;
+C -1 ; WX 600 ; N summation ; B 15 -10 672 706 ;
+C -1 ; WX 600 ; N Egrave ; B 25 0 670 784 ;
+C -1 ; WX 600 ; N racute ; B 47 0 655 661 ;
+C -1 ; WX 600 ; N omacron ; B 71 -15 637 585 ;
+C -1 ; WX 600 ; N Zacute ; B 62 0 665 784 ;
+C -1 ; WX 600 ; N Zcaron ; B 62 0 659 790 ;
+C -1 ; WX 600 ; N greaterequal ; B 26 0 627 696 ;
+C -1 ; WX 600 ; N Eth ; B 30 0 664 562 ;
+C -1 ; WX 600 ; N Ccedilla ; B 74 -206 675 580 ;
+C -1 ; WX 600 ; N lcommaaccent ; B 77 -250 546 626 ;
+C -1 ; WX 600 ; N tcaron ; B 118 -15 627 703 ;
+C -1 ; WX 600 ; N eogonek ; B 81 -199 605 454 ;
+C -1 ; WX 600 ; N Uogonek ; B 101 -199 716 562 ;
+C -1 ; WX 600 ; N Aacute ; B -9 0 655 784 ;
+C -1 ; WX 600 ; N Adieresis ; B -9 0 632 761 ;
+C -1 ; WX 600 ; N egrave ; B 81 -15 605 661 ;
+C -1 ; WX 600 ; N zacute ; B 81 0 614 661 ;
+C -1 ; WX 600 ; N iogonek ; B 77 -199 546 658 ;
+C -1 ; WX 600 ; N Oacute ; B 74 -18 645 784 ;
+C -1 ; WX 600 ; N oacute ; B 71 -15 649 661 ;
+C -1 ; WX 600 ; N amacron ; B 61 -15 637 585 ;
+C -1 ; WX 600 ; N sacute ; B 66 -17 609 661 ;
+C -1 ; WX 600 ; N idieresis ; B 77 0 561 618 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 74 -18 645 780 ;
+C -1 ; WX 600 ; N Ugrave ; B 101 -18 716 784 ;
+C -1 ; WX 600 ; N Delta ; B 6 0 594 688 ;
+C -1 ; WX 600 ; N thorn ; B -32 -142 622 626 ;
+C -1 ; WX 600 ; N twosuperior ; B 191 230 542 616 ;
+C -1 ; WX 600 ; N Odieresis ; B 74 -18 645 761 ;
+C -1 ; WX 600 ; N mu ; B 49 -142 592 439 ;
+C -1 ; WX 600 ; N igrave ; B 77 0 546 661 ;
+C -1 ; WX 600 ; N ohungarumlaut ; B 71 -15 809 661 ;
+C -1 ; WX 600 ; N Eogonek ; B 25 -199 670 562 ;
+C -1 ; WX 600 ; N dcroat ; B 60 -15 712 626 ;
+C -1 ; WX 600 ; N threequarters ; B 8 -60 699 661 ;
+C -1 ; WX 600 ; N Scedilla ; B 54 -206 673 582 ;
+C -1 ; WX 600 ; N lcaron ; B 77 0 731 626 ;
+C -1 ; WX 600 ; N Kcommaaccent ; B 21 -250 692 562 ;
+C -1 ; WX 600 ; N Lacute ; B 39 0 636 784 ;
+C -1 ; WX 600 ; N trademark ; B 86 230 869 562 ;
+C -1 ; WX 600 ; N edotaccent ; B 81 -15 605 638 ;
+C -1 ; WX 600 ; N Igrave ; B 77 0 643 784 ;
+C -1 ; WX 600 ; N Imacron ; B 77 0 663 708 ;
+C -1 ; WX 600 ; N Lcaron ; B 39 0 757 562 ;
+C -1 ; WX 600 ; N onehalf ; B 22 -60 716 661 ;
+C -1 ; WX 600 ; N lessequal ; B 26 0 671 696 ;
+C -1 ; WX 600 ; N ocircumflex ; B 71 -15 622 657 ;
+C -1 ; WX 600 ; N ntilde ; B 18 0 643 636 ;
+C -1 ; WX 600 ; N Uhungarumlaut ; B 101 -18 805 784 ;
+C -1 ; WX 600 ; N Eacute ; B 25 0 670 784 ;
+C -1 ; WX 600 ; N emacron ; B 81 -15 637 585 ;
+C -1 ; WX 600 ; N gbreve ; B 40 -146 674 661 ;
+C -1 ; WX 600 ; N onequarter ; B 13 -60 707 661 ;
+C -1 ; WX 600 ; N Scaron ; B 54 -22 689 790 ;
+C -1 ; WX 600 ; N Scommaaccent ; B 54 -250 673 582 ;
+C -1 ; WX 600 ; N Ohungarumlaut ; B 74 -18 795 784 ;
+C -1 ; WX 600 ; N degree ; B 173 243 570 616 ;
+C -1 ; WX 600 ; N ograve ; B 71 -15 622 661 ;
+C -1 ; WX 600 ; N Ccaron ; B 74 -18 689 790 ;
+C -1 ; WX 600 ; N ugrave ; B 70 -15 592 661 ;
+C -1 ; WX 600 ; N radical ; B 67 -104 635 778 ;
+C -1 ; WX 600 ; N Dcaron ; B 30 0 664 790 ;
+C -1 ; WX 600 ; N rcommaaccent ; B 47 -250 655 454 ;
+C -1 ; WX 600 ; N Ntilde ; B 8 -12 730 759 ;
+C -1 ; WX 600 ; N otilde ; B 71 -15 643 636 ;
+C -1 ; WX 600 ; N Rcommaaccent ; B 24 -250 617 562 ;
+C -1 ; WX 600 ; N Lcommaaccent ; B 39 -250 636 562 ;
+C -1 ; WX 600 ; N Atilde ; B -9 0 669 759 ;
+C -1 ; WX 600 ; N Aogonek ; B -9 -199 632 562 ;
+C -1 ; WX 600 ; N Aring ; B -9 0 632 801 ;
+C -1 ; WX 600 ; N Otilde ; B 74 -18 669 759 ;
+C -1 ; WX 600 ; N zdotaccent ; B 81 0 614 638 ;
+C -1 ; WX 600 ; N Ecaron ; B 25 0 670 790 ;
+C -1 ; WX 600 ; N Iogonek ; B 77 -199 643 562 ;
+C -1 ; WX 600 ; N kcommaaccent ; B 33 -250 643 626 ;
+C -1 ; WX 600 ; N minus ; B 114 203 596 313 ;
+C -1 ; WX 600 ; N Icircumflex ; B 77 0 643 780 ;
+C -1 ; WX 600 ; N ncaron ; B 18 0 633 667 ;
+C -1 ; WX 600 ; N tcommaaccent ; B 118 -250 567 562 ;
+C -1 ; WX 600 ; N logicalnot ; B 135 103 617 413 ;
+C -1 ; WX 600 ; N odieresis ; B 71 -15 622 638 ;
+C -1 ; WX 600 ; N udieresis ; B 70 -15 595 638 ;
+C -1 ; WX 600 ; N notequal ; B 30 -47 626 563 ;
+C -1 ; WX 600 ; N gcommaaccent ; B 40 -146 674 714 ;
+C -1 ; WX 600 ; N eth ; B 93 -27 661 626 ;
+C -1 ; WX 600 ; N zcaron ; B 81 0 643 667 ;
+C -1 ; WX 600 ; N ncommaaccent ; B 18 -250 615 454 ;
+C -1 ; WX 600 ; N onesuperior ; B 212 230 514 616 ;
+C -1 ; WX 600 ; N imacron ; B 77 0 575 585 ;
+C -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Oblique.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Oblique.afm
new file mode 100644
index 0000000000000000000000000000000000000000..3dc163f771a7a5bfd4978f6cb09b3f9eb29c55c6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Oblique.afm
@@ -0,0 +1,342 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 17:37:52 1997
+Comment UniqueID 43051
+Comment VMusage 16248 75829
+FontName Courier-Oblique
+FullName Courier Oblique
+FamilyName Courier
+Weight Medium
+ItalicAngle -12
+IsFixedPitch true
+CharacterSet ExtendedRoman
+FontBBox -27 -250 849 805
+UnderlinePosition -100
+UnderlineThickness 50
+Version 003.000
+Notice Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 562
+XHeight 426
+Ascender 629
+Descender -157
+StdHW 51
+StdVW 51
+StartCharMetrics 315
+C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 600 ; N exclam ; B 243 -15 464 572 ;
+C 34 ; WX 600 ; N quotedbl ; B 273 328 532 562 ;
+C 35 ; WX 600 ; N numbersign ; B 133 -32 596 639 ;
+C 36 ; WX 600 ; N dollar ; B 108 -126 596 662 ;
+C 37 ; WX 600 ; N percent ; B 134 -15 599 622 ;
+C 38 ; WX 600 ; N ampersand ; B 87 -15 580 543 ;
+C 39 ; WX 600 ; N quoteright ; B 283 328 495 562 ;
+C 40 ; WX 600 ; N parenleft ; B 313 -108 572 622 ;
+C 41 ; WX 600 ; N parenright ; B 137 -108 396 622 ;
+C 42 ; WX 600 ; N asterisk ; B 212 257 580 607 ;
+C 43 ; WX 600 ; N plus ; B 129 44 580 470 ;
+C 44 ; WX 600 ; N comma ; B 157 -112 370 122 ;
+C 45 ; WX 600 ; N hyphen ; B 152 231 558 285 ;
+C 46 ; WX 600 ; N period ; B 238 -15 382 109 ;
+C 47 ; WX 600 ; N slash ; B 112 -80 604 629 ;
+C 48 ; WX 600 ; N zero ; B 154 -15 575 622 ;
+C 49 ; WX 600 ; N one ; B 98 0 515 622 ;
+C 50 ; WX 600 ; N two ; B 70 0 568 622 ;
+C 51 ; WX 600 ; N three ; B 82 -15 538 622 ;
+C 52 ; WX 600 ; N four ; B 108 0 541 622 ;
+C 53 ; WX 600 ; N five ; B 99 -15 589 607 ;
+C 54 ; WX 600 ; N six ; B 155 -15 629 622 ;
+C 55 ; WX 600 ; N seven ; B 182 0 612 607 ;
+C 56 ; WX 600 ; N eight ; B 132 -15 588 622 ;
+C 57 ; WX 600 ; N nine ; B 93 -15 574 622 ;
+C 58 ; WX 600 ; N colon ; B 238 -15 441 385 ;
+C 59 ; WX 600 ; N semicolon ; B 157 -112 441 385 ;
+C 60 ; WX 600 ; N less ; B 96 42 610 472 ;
+C 61 ; WX 600 ; N equal ; B 109 138 600 376 ;
+C 62 ; WX 600 ; N greater ; B 85 42 599 472 ;
+C 63 ; WX 600 ; N question ; B 222 -15 583 572 ;
+C 64 ; WX 600 ; N at ; B 127 -15 582 622 ;
+C 65 ; WX 600 ; N A ; B 3 0 607 562 ;
+C 66 ; WX 600 ; N B ; B 43 0 616 562 ;
+C 67 ; WX 600 ; N C ; B 93 -18 655 580 ;
+C 68 ; WX 600 ; N D ; B 43 0 645 562 ;
+C 69 ; WX 600 ; N E ; B 53 0 660 562 ;
+C 70 ; WX 600 ; N F ; B 53 0 660 562 ;
+C 71 ; WX 600 ; N G ; B 83 -18 645 580 ;
+C 72 ; WX 600 ; N H ; B 32 0 687 562 ;
+C 73 ; WX 600 ; N I ; B 96 0 623 562 ;
+C 74 ; WX 600 ; N J ; B 52 -18 685 562 ;
+C 75 ; WX 600 ; N K ; B 38 0 671 562 ;
+C 76 ; WX 600 ; N L ; B 47 0 607 562 ;
+C 77 ; WX 600 ; N M ; B 4 0 715 562 ;
+C 78 ; WX 600 ; N N ; B 7 -13 712 562 ;
+C 79 ; WX 600 ; N O ; B 94 -18 625 580 ;
+C 80 ; WX 600 ; N P ; B 79 0 644 562 ;
+C 81 ; WX 600 ; N Q ; B 95 -138 625 580 ;
+C 82 ; WX 600 ; N R ; B 38 0 598 562 ;
+C 83 ; WX 600 ; N S ; B 76 -20 650 580 ;
+C 84 ; WX 600 ; N T ; B 108 0 665 562 ;
+C 85 ; WX 600 ; N U ; B 125 -18 702 562 ;
+C 86 ; WX 600 ; N V ; B 105 -13 723 562 ;
+C 87 ; WX 600 ; N W ; B 106 -13 722 562 ;
+C 88 ; WX 600 ; N X ; B 23 0 675 562 ;
+C 89 ; WX 600 ; N Y ; B 133 0 695 562 ;
+C 90 ; WX 600 ; N Z ; B 86 0 610 562 ;
+C 91 ; WX 600 ; N bracketleft ; B 246 -108 574 622 ;
+C 92 ; WX 600 ; N backslash ; B 249 -80 468 629 ;
+C 93 ; WX 600 ; N bracketright ; B 135 -108 463 622 ;
+C 94 ; WX 600 ; N asciicircum ; B 175 354 587 622 ;
+C 95 ; WX 600 ; N underscore ; B -27 -125 584 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 343 328 457 562 ;
+C 97 ; WX 600 ; N a ; B 76 -15 569 441 ;
+C 98 ; WX 600 ; N b ; B 29 -15 625 629 ;
+C 99 ; WX 600 ; N c ; B 106 -15 608 441 ;
+C 100 ; WX 600 ; N d ; B 85 -15 640 629 ;
+C 101 ; WX 600 ; N e ; B 106 -15 598 441 ;
+C 102 ; WX 600 ; N f ; B 114 0 662 629 ; L i fi ; L l fl ;
+C 103 ; WX 600 ; N g ; B 61 -157 657 441 ;
+C 104 ; WX 600 ; N h ; B 33 0 592 629 ;
+C 105 ; WX 600 ; N i ; B 95 0 515 657 ;
+C 106 ; WX 600 ; N j ; B 52 -157 550 657 ;
+C 107 ; WX 600 ; N k ; B 58 0 633 629 ;
+C 108 ; WX 600 ; N l ; B 95 0 515 629 ;
+C 109 ; WX 600 ; N m ; B -5 0 615 441 ;
+C 110 ; WX 600 ; N n ; B 26 0 585 441 ;
+C 111 ; WX 600 ; N o ; B 102 -15 588 441 ;
+C 112 ; WX 600 ; N p ; B -24 -157 605 441 ;
+C 113 ; WX 600 ; N q ; B 85 -157 682 441 ;
+C 114 ; WX 600 ; N r ; B 60 0 636 441 ;
+C 115 ; WX 600 ; N s ; B 78 -15 584 441 ;
+C 116 ; WX 600 ; N t ; B 167 -15 561 561 ;
+C 117 ; WX 600 ; N u ; B 101 -15 572 426 ;
+C 118 ; WX 600 ; N v ; B 90 -10 681 426 ;
+C 119 ; WX 600 ; N w ; B 76 -10 695 426 ;
+C 120 ; WX 600 ; N x ; B 20 0 655 426 ;
+C 121 ; WX 600 ; N y ; B -4 -157 683 426 ;
+C 122 ; WX 600 ; N z ; B 99 0 593 426 ;
+C 123 ; WX 600 ; N braceleft ; B 233 -108 569 622 ;
+C 124 ; WX 600 ; N bar ; B 222 -250 485 750 ;
+C 125 ; WX 600 ; N braceright ; B 140 -108 477 622 ;
+C 126 ; WX 600 ; N asciitilde ; B 116 197 600 320 ;
+C 161 ; WX 600 ; N exclamdown ; B 225 -157 445 430 ;
+C 162 ; WX 600 ; N cent ; B 151 -49 588 614 ;
+C 163 ; WX 600 ; N sterling ; B 124 -21 621 611 ;
+C 164 ; WX 600 ; N fraction ; B 84 -57 646 665 ;
+C 165 ; WX 600 ; N yen ; B 120 0 693 562 ;
+C 166 ; WX 600 ; N florin ; B -26 -143 671 622 ;
+C 167 ; WX 600 ; N section ; B 104 -78 590 580 ;
+C 168 ; WX 600 ; N currency ; B 94 58 628 506 ;
+C 169 ; WX 600 ; N quotesingle ; B 345 328 460 562 ;
+C 170 ; WX 600 ; N quotedblleft ; B 262 328 541 562 ;
+C 171 ; WX 600 ; N guillemotleft ; B 92 70 652 446 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 204 70 540 446 ;
+C 173 ; WX 600 ; N guilsinglright ; B 170 70 506 446 ;
+C 174 ; WX 600 ; N fi ; B 3 0 619 629 ;
+C 175 ; WX 600 ; N fl ; B 3 0 619 629 ;
+C 177 ; WX 600 ; N endash ; B 124 231 586 285 ;
+C 178 ; WX 600 ; N dagger ; B 217 -78 546 580 ;
+C 179 ; WX 600 ; N daggerdbl ; B 163 -78 546 580 ;
+C 180 ; WX 600 ; N periodcentered ; B 275 189 434 327 ;
+C 182 ; WX 600 ; N paragraph ; B 100 -78 630 562 ;
+C 183 ; WX 600 ; N bullet ; B 224 130 485 383 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 185 -134 397 100 ;
+C 185 ; WX 600 ; N quotedblbase ; B 115 -134 478 100 ;
+C 186 ; WX 600 ; N quotedblright ; B 213 328 576 562 ;
+C 187 ; WX 600 ; N guillemotright ; B 58 70 618 446 ;
+C 188 ; WX 600 ; N ellipsis ; B 46 -15 575 111 ;
+C 189 ; WX 600 ; N perthousand ; B 59 -15 627 622 ;
+C 191 ; WX 600 ; N questiondown ; B 105 -157 466 430 ;
+C 193 ; WX 600 ; N grave ; B 294 497 484 672 ;
+C 194 ; WX 600 ; N acute ; B 348 497 612 672 ;
+C 195 ; WX 600 ; N circumflex ; B 229 477 581 654 ;
+C 196 ; WX 600 ; N tilde ; B 212 489 629 606 ;
+C 197 ; WX 600 ; N macron ; B 232 525 600 565 ;
+C 198 ; WX 600 ; N breve ; B 279 501 576 609 ;
+C 199 ; WX 600 ; N dotaccent ; B 373 537 478 640 ;
+C 200 ; WX 600 ; N dieresis ; B 272 537 579 640 ;
+C 202 ; WX 600 ; N ring ; B 332 463 500 627 ;
+C 203 ; WX 600 ; N cedilla ; B 197 -151 344 10 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 239 497 683 672 ;
+C 206 ; WX 600 ; N ogonek ; B 189 -172 377 4 ;
+C 207 ; WX 600 ; N caron ; B 262 492 614 669 ;
+C 208 ; WX 600 ; N emdash ; B 49 231 661 285 ;
+C 225 ; WX 600 ; N AE ; B 3 0 655 562 ;
+C 227 ; WX 600 ; N ordfeminine ; B 209 249 512 580 ;
+C 232 ; WX 600 ; N Lslash ; B 47 0 607 562 ;
+C 233 ; WX 600 ; N Oslash ; B 94 -80 625 629 ;
+C 234 ; WX 600 ; N OE ; B 59 0 672 562 ;
+C 235 ; WX 600 ; N ordmasculine ; B 210 249 535 580 ;
+C 241 ; WX 600 ; N ae ; B 41 -15 626 441 ;
+C 245 ; WX 600 ; N dotlessi ; B 95 0 515 426 ;
+C 248 ; WX 600 ; N lslash ; B 95 0 587 629 ;
+C 249 ; WX 600 ; N oslash ; B 102 -80 588 506 ;
+C 250 ; WX 600 ; N oe ; B 54 -15 615 441 ;
+C 251 ; WX 600 ; N germandbls ; B 48 -15 617 629 ;
+C -1 ; WX 600 ; N Idieresis ; B 96 0 623 753 ;
+C -1 ; WX 600 ; N eacute ; B 106 -15 612 672 ;
+C -1 ; WX 600 ; N abreve ; B 76 -15 576 609 ;
+C -1 ; WX 600 ; N uhungarumlaut ; B 101 -15 723 672 ;
+C -1 ; WX 600 ; N ecaron ; B 106 -15 614 669 ;
+C -1 ; WX 600 ; N Ydieresis ; B 133 0 695 753 ;
+C -1 ; WX 600 ; N divide ; B 136 48 573 467 ;
+C -1 ; WX 600 ; N Yacute ; B 133 0 695 805 ;
+C -1 ; WX 600 ; N Acircumflex ; B 3 0 607 787 ;
+C -1 ; WX 600 ; N aacute ; B 76 -15 612 672 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 125 -18 702 787 ;
+C -1 ; WX 600 ; N yacute ; B -4 -157 683 672 ;
+C -1 ; WX 600 ; N scommaaccent ; B 78 -250 584 441 ;
+C -1 ; WX 600 ; N ecircumflex ; B 106 -15 598 654 ;
+C -1 ; WX 600 ; N Uring ; B 125 -18 702 760 ;
+C -1 ; WX 600 ; N Udieresis ; B 125 -18 702 753 ;
+C -1 ; WX 600 ; N aogonek ; B 76 -172 569 441 ;
+C -1 ; WX 600 ; N Uacute ; B 125 -18 702 805 ;
+C -1 ; WX 600 ; N uogonek ; B 101 -172 572 426 ;
+C -1 ; WX 600 ; N Edieresis ; B 53 0 660 753 ;
+C -1 ; WX 600 ; N Dcroat ; B 43 0 645 562 ;
+C -1 ; WX 600 ; N commaaccent ; B 145 -250 323 -58 ;
+C -1 ; WX 600 ; N copyright ; B 53 -18 667 580 ;
+C -1 ; WX 600 ; N Emacron ; B 53 0 660 698 ;
+C -1 ; WX 600 ; N ccaron ; B 106 -15 614 669 ;
+C -1 ; WX 600 ; N aring ; B 76 -15 569 627 ;
+C -1 ; WX 600 ; N Ncommaaccent ; B 7 -250 712 562 ;
+C -1 ; WX 600 ; N lacute ; B 95 0 640 805 ;
+C -1 ; WX 600 ; N agrave ; B 76 -15 569 672 ;
+C -1 ; WX 600 ; N Tcommaaccent ; B 108 -250 665 562 ;
+C -1 ; WX 600 ; N Cacute ; B 93 -18 655 805 ;
+C -1 ; WX 600 ; N atilde ; B 76 -15 629 606 ;
+C -1 ; WX 600 ; N Edotaccent ; B 53 0 660 753 ;
+C -1 ; WX 600 ; N scaron ; B 78 -15 614 669 ;
+C -1 ; WX 600 ; N scedilla ; B 78 -151 584 441 ;
+C -1 ; WX 600 ; N iacute ; B 95 0 612 672 ;
+C -1 ; WX 600 ; N lozenge ; B 94 0 519 706 ;
+C -1 ; WX 600 ; N Rcaron ; B 38 0 642 802 ;
+C -1 ; WX 600 ; N Gcommaaccent ; B 83 -250 645 580 ;
+C -1 ; WX 600 ; N ucircumflex ; B 101 -15 572 654 ;
+C -1 ; WX 600 ; N acircumflex ; B 76 -15 581 654 ;
+C -1 ; WX 600 ; N Amacron ; B 3 0 607 698 ;
+C -1 ; WX 600 ; N rcaron ; B 60 0 636 669 ;
+C -1 ; WX 600 ; N ccedilla ; B 106 -151 614 441 ;
+C -1 ; WX 600 ; N Zdotaccent ; B 86 0 610 753 ;
+C -1 ; WX 600 ; N Thorn ; B 79 0 606 562 ;
+C -1 ; WX 600 ; N Omacron ; B 94 -18 628 698 ;
+C -1 ; WX 600 ; N Racute ; B 38 0 670 805 ;
+C -1 ; WX 600 ; N Sacute ; B 76 -20 650 805 ;
+C -1 ; WX 600 ; N dcaron ; B 85 -15 849 629 ;
+C -1 ; WX 600 ; N Umacron ; B 125 -18 702 698 ;
+C -1 ; WX 600 ; N uring ; B 101 -15 572 627 ;
+C -1 ; WX 600 ; N threesuperior ; B 213 240 501 622 ;
+C -1 ; WX 600 ; N Ograve ; B 94 -18 625 805 ;
+C -1 ; WX 600 ; N Agrave ; B 3 0 607 805 ;
+C -1 ; WX 600 ; N Abreve ; B 3 0 607 732 ;
+C -1 ; WX 600 ; N multiply ; B 103 43 607 470 ;
+C -1 ; WX 600 ; N uacute ; B 101 -15 602 672 ;
+C -1 ; WX 600 ; N Tcaron ; B 108 0 665 802 ;
+C -1 ; WX 600 ; N partialdiff ; B 45 -38 546 710 ;
+C -1 ; WX 600 ; N ydieresis ; B -4 -157 683 620 ;
+C -1 ; WX 600 ; N Nacute ; B 7 -13 712 805 ;
+C -1 ; WX 600 ; N icircumflex ; B 95 0 551 654 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 53 0 660 787 ;
+C -1 ; WX 600 ; N adieresis ; B 76 -15 575 620 ;
+C -1 ; WX 600 ; N edieresis ; B 106 -15 598 620 ;
+C -1 ; WX 600 ; N cacute ; B 106 -15 612 672 ;
+C -1 ; WX 600 ; N nacute ; B 26 0 602 672 ;
+C -1 ; WX 600 ; N umacron ; B 101 -15 600 565 ;
+C -1 ; WX 600 ; N Ncaron ; B 7 -13 712 802 ;
+C -1 ; WX 600 ; N Iacute ; B 96 0 640 805 ;
+C -1 ; WX 600 ; N plusminus ; B 96 44 594 558 ;
+C -1 ; WX 600 ; N brokenbar ; B 238 -175 469 675 ;
+C -1 ; WX 600 ; N registered ; B 53 -18 667 580 ;
+C -1 ; WX 600 ; N Gbreve ; B 83 -18 645 732 ;
+C -1 ; WX 600 ; N Idotaccent ; B 96 0 623 753 ;
+C -1 ; WX 600 ; N summation ; B 15 -10 670 706 ;
+C -1 ; WX 600 ; N Egrave ; B 53 0 660 805 ;
+C -1 ; WX 600 ; N racute ; B 60 0 636 672 ;
+C -1 ; WX 600 ; N omacron ; B 102 -15 600 565 ;
+C -1 ; WX 600 ; N Zacute ; B 86 0 670 805 ;
+C -1 ; WX 600 ; N Zcaron ; B 86 0 642 802 ;
+C -1 ; WX 600 ; N greaterequal ; B 98 0 594 710 ;
+C -1 ; WX 600 ; N Eth ; B 43 0 645 562 ;
+C -1 ; WX 600 ; N Ccedilla ; B 93 -151 658 580 ;
+C -1 ; WX 600 ; N lcommaaccent ; B 95 -250 515 629 ;
+C -1 ; WX 600 ; N tcaron ; B 167 -15 587 717 ;
+C -1 ; WX 600 ; N eogonek ; B 106 -172 598 441 ;
+C -1 ; WX 600 ; N Uogonek ; B 124 -172 702 562 ;
+C -1 ; WX 600 ; N Aacute ; B 3 0 660 805 ;
+C -1 ; WX 600 ; N Adieresis ; B 3 0 607 753 ;
+C -1 ; WX 600 ; N egrave ; B 106 -15 598 672 ;
+C -1 ; WX 600 ; N zacute ; B 99 0 612 672 ;
+C -1 ; WX 600 ; N iogonek ; B 95 -172 515 657 ;
+C -1 ; WX 600 ; N Oacute ; B 94 -18 640 805 ;
+C -1 ; WX 600 ; N oacute ; B 102 -15 612 672 ;
+C -1 ; WX 600 ; N amacron ; B 76 -15 600 565 ;
+C -1 ; WX 600 ; N sacute ; B 78 -15 612 672 ;
+C -1 ; WX 600 ; N idieresis ; B 95 0 545 620 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 94 -18 625 787 ;
+C -1 ; WX 600 ; N Ugrave ; B 125 -18 702 805 ;
+C -1 ; WX 600 ; N Delta ; B 6 0 598 688 ;
+C -1 ; WX 600 ; N thorn ; B -24 -157 605 629 ;
+C -1 ; WX 600 ; N twosuperior ; B 230 249 535 622 ;
+C -1 ; WX 600 ; N Odieresis ; B 94 -18 625 753 ;
+C -1 ; WX 600 ; N mu ; B 72 -157 572 426 ;
+C -1 ; WX 600 ; N igrave ; B 95 0 515 672 ;
+C -1 ; WX 600 ; N ohungarumlaut ; B 102 -15 723 672 ;
+C -1 ; WX 600 ; N Eogonek ; B 53 -172 660 562 ;
+C -1 ; WX 600 ; N dcroat ; B 85 -15 704 629 ;
+C -1 ; WX 600 ; N threequarters ; B 73 -56 659 666 ;
+C -1 ; WX 600 ; N Scedilla ; B 76 -151 650 580 ;
+C -1 ; WX 600 ; N lcaron ; B 95 0 667 629 ;
+C -1 ; WX 600 ; N Kcommaaccent ; B 38 -250 671 562 ;
+C -1 ; WX 600 ; N Lacute ; B 47 0 607 805 ;
+C -1 ; WX 600 ; N trademark ; B 75 263 742 562 ;
+C -1 ; WX 600 ; N edotaccent ; B 106 -15 598 620 ;
+C -1 ; WX 600 ; N Igrave ; B 96 0 623 805 ;
+C -1 ; WX 600 ; N Imacron ; B 96 0 628 698 ;
+C -1 ; WX 600 ; N Lcaron ; B 47 0 632 562 ;
+C -1 ; WX 600 ; N onehalf ; B 65 -57 669 665 ;
+C -1 ; WX 600 ; N lessequal ; B 98 0 645 710 ;
+C -1 ; WX 600 ; N ocircumflex ; B 102 -15 588 654 ;
+C -1 ; WX 600 ; N ntilde ; B 26 0 629 606 ;
+C -1 ; WX 600 ; N Uhungarumlaut ; B 125 -18 761 805 ;
+C -1 ; WX 600 ; N Eacute ; B 53 0 670 805 ;
+C -1 ; WX 600 ; N emacron ; B 106 -15 600 565 ;
+C -1 ; WX 600 ; N gbreve ; B 61 -157 657 609 ;
+C -1 ; WX 600 ; N onequarter ; B 65 -57 674 665 ;
+C -1 ; WX 600 ; N Scaron ; B 76 -20 672 802 ;
+C -1 ; WX 600 ; N Scommaaccent ; B 76 -250 650 580 ;
+C -1 ; WX 600 ; N Ohungarumlaut ; B 94 -18 751 805 ;
+C -1 ; WX 600 ; N degree ; B 214 269 576 622 ;
+C -1 ; WX 600 ; N ograve ; B 102 -15 588 672 ;
+C -1 ; WX 600 ; N Ccaron ; B 93 -18 672 802 ;
+C -1 ; WX 600 ; N ugrave ; B 101 -15 572 672 ;
+C -1 ; WX 600 ; N radical ; B 85 -15 765 792 ;
+C -1 ; WX 600 ; N Dcaron ; B 43 0 645 802 ;
+C -1 ; WX 600 ; N rcommaaccent ; B 60 -250 636 441 ;
+C -1 ; WX 600 ; N Ntilde ; B 7 -13 712 729 ;
+C -1 ; WX 600 ; N otilde ; B 102 -15 629 606 ;
+C -1 ; WX 600 ; N Rcommaaccent ; B 38 -250 598 562 ;
+C -1 ; WX 600 ; N Lcommaaccent ; B 47 -250 607 562 ;
+C -1 ; WX 600 ; N Atilde ; B 3 0 655 729 ;
+C -1 ; WX 600 ; N Aogonek ; B 3 -172 607 562 ;
+C -1 ; WX 600 ; N Aring ; B 3 0 607 750 ;
+C -1 ; WX 600 ; N Otilde ; B 94 -18 655 729 ;
+C -1 ; WX 600 ; N zdotaccent ; B 99 0 593 620 ;
+C -1 ; WX 600 ; N Ecaron ; B 53 0 660 802 ;
+C -1 ; WX 600 ; N Iogonek ; B 96 -172 623 562 ;
+C -1 ; WX 600 ; N kcommaaccent ; B 58 -250 633 629 ;
+C -1 ; WX 600 ; N minus ; B 129 232 580 283 ;
+C -1 ; WX 600 ; N Icircumflex ; B 96 0 623 787 ;
+C -1 ; WX 600 ; N ncaron ; B 26 0 614 669 ;
+C -1 ; WX 600 ; N tcommaaccent ; B 165 -250 561 561 ;
+C -1 ; WX 600 ; N logicalnot ; B 155 108 591 369 ;
+C -1 ; WX 600 ; N odieresis ; B 102 -15 588 620 ;
+C -1 ; WX 600 ; N udieresis ; B 101 -15 575 620 ;
+C -1 ; WX 600 ; N notequal ; B 43 -16 621 529 ;
+C -1 ; WX 600 ; N gcommaaccent ; B 61 -157 657 708 ;
+C -1 ; WX 600 ; N eth ; B 102 -15 639 629 ;
+C -1 ; WX 600 ; N zcaron ; B 99 0 624 669 ;
+C -1 ; WX 600 ; N ncommaaccent ; B 26 -250 585 441 ;
+C -1 ; WX 600 ; N onesuperior ; B 231 249 491 622 ;
+C -1 ; WX 600 ; N imacron ; B 95 0 543 565 ;
+C -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier.afm
new file mode 100644
index 0000000000000000000000000000000000000000..2f7be81d583f0f95cda1c73f5604d0ee5425019c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Courier.afm
@@ -0,0 +1,342 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 17:27:09 1997
+Comment UniqueID 43050
+Comment VMusage 39754 50779
+FontName Courier
+FullName Courier
+FamilyName Courier
+Weight Medium
+ItalicAngle 0
+IsFixedPitch true
+CharacterSet ExtendedRoman
+FontBBox -23 -250 715 805
+UnderlinePosition -100
+UnderlineThickness 50
+Version 003.000
+Notice Copyright (c) 1989, 1990, 1991, 1992, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+EncodingScheme AdobeStandardEncoding
+CapHeight 562
+XHeight 426
+Ascender 629
+Descender -157
+StdHW 51
+StdVW 51
+StartCharMetrics 315
+C 32 ; WX 600 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 600 ; N exclam ; B 236 -15 364 572 ;
+C 34 ; WX 600 ; N quotedbl ; B 187 328 413 562 ;
+C 35 ; WX 600 ; N numbersign ; B 93 -32 507 639 ;
+C 36 ; WX 600 ; N dollar ; B 105 -126 496 662 ;
+C 37 ; WX 600 ; N percent ; B 81 -15 518 622 ;
+C 38 ; WX 600 ; N ampersand ; B 63 -15 538 543 ;
+C 39 ; WX 600 ; N quoteright ; B 213 328 376 562 ;
+C 40 ; WX 600 ; N parenleft ; B 269 -108 440 622 ;
+C 41 ; WX 600 ; N parenright ; B 160 -108 331 622 ;
+C 42 ; WX 600 ; N asterisk ; B 116 257 484 607 ;
+C 43 ; WX 600 ; N plus ; B 80 44 520 470 ;
+C 44 ; WX 600 ; N comma ; B 181 -112 344 122 ;
+C 45 ; WX 600 ; N hyphen ; B 103 231 497 285 ;
+C 46 ; WX 600 ; N period ; B 229 -15 371 109 ;
+C 47 ; WX 600 ; N slash ; B 125 -80 475 629 ;
+C 48 ; WX 600 ; N zero ; B 106 -15 494 622 ;
+C 49 ; WX 600 ; N one ; B 96 0 505 622 ;
+C 50 ; WX 600 ; N two ; B 70 0 471 622 ;
+C 51 ; WX 600 ; N three ; B 75 -15 466 622 ;
+C 52 ; WX 600 ; N four ; B 78 0 500 622 ;
+C 53 ; WX 600 ; N five ; B 92 -15 497 607 ;
+C 54 ; WX 600 ; N six ; B 111 -15 497 622 ;
+C 55 ; WX 600 ; N seven ; B 82 0 483 607 ;
+C 56 ; WX 600 ; N eight ; B 102 -15 498 622 ;
+C 57 ; WX 600 ; N nine ; B 96 -15 489 622 ;
+C 58 ; WX 600 ; N colon ; B 229 -15 371 385 ;
+C 59 ; WX 600 ; N semicolon ; B 181 -112 371 385 ;
+C 60 ; WX 600 ; N less ; B 41 42 519 472 ;
+C 61 ; WX 600 ; N equal ; B 80 138 520 376 ;
+C 62 ; WX 600 ; N greater ; B 66 42 544 472 ;
+C 63 ; WX 600 ; N question ; B 129 -15 492 572 ;
+C 64 ; WX 600 ; N at ; B 77 -15 533 622 ;
+C 65 ; WX 600 ; N A ; B 3 0 597 562 ;
+C 66 ; WX 600 ; N B ; B 43 0 559 562 ;
+C 67 ; WX 600 ; N C ; B 41 -18 540 580 ;
+C 68 ; WX 600 ; N D ; B 43 0 574 562 ;
+C 69 ; WX 600 ; N E ; B 53 0 550 562 ;
+C 70 ; WX 600 ; N F ; B 53 0 545 562 ;
+C 71 ; WX 600 ; N G ; B 31 -18 575 580 ;
+C 72 ; WX 600 ; N H ; B 32 0 568 562 ;
+C 73 ; WX 600 ; N I ; B 96 0 504 562 ;
+C 74 ; WX 600 ; N J ; B 34 -18 566 562 ;
+C 75 ; WX 600 ; N K ; B 38 0 582 562 ;
+C 76 ; WX 600 ; N L ; B 47 0 554 562 ;
+C 77 ; WX 600 ; N M ; B 4 0 596 562 ;
+C 78 ; WX 600 ; N N ; B 7 -13 593 562 ;
+C 79 ; WX 600 ; N O ; B 43 -18 557 580 ;
+C 80 ; WX 600 ; N P ; B 79 0 558 562 ;
+C 81 ; WX 600 ; N Q ; B 43 -138 557 580 ;
+C 82 ; WX 600 ; N R ; B 38 0 588 562 ;
+C 83 ; WX 600 ; N S ; B 72 -20 529 580 ;
+C 84 ; WX 600 ; N T ; B 38 0 563 562 ;
+C 85 ; WX 600 ; N U ; B 17 -18 583 562 ;
+C 86 ; WX 600 ; N V ; B -4 -13 604 562 ;
+C 87 ; WX 600 ; N W ; B -3 -13 603 562 ;
+C 88 ; WX 600 ; N X ; B 23 0 577 562 ;
+C 89 ; WX 600 ; N Y ; B 24 0 576 562 ;
+C 90 ; WX 600 ; N Z ; B 86 0 514 562 ;
+C 91 ; WX 600 ; N bracketleft ; B 269 -108 442 622 ;
+C 92 ; WX 600 ; N backslash ; B 118 -80 482 629 ;
+C 93 ; WX 600 ; N bracketright ; B 158 -108 331 622 ;
+C 94 ; WX 600 ; N asciicircum ; B 94 354 506 622 ;
+C 95 ; WX 600 ; N underscore ; B 0 -125 600 -75 ;
+C 96 ; WX 600 ; N quoteleft ; B 224 328 387 562 ;
+C 97 ; WX 600 ; N a ; B 53 -15 559 441 ;
+C 98 ; WX 600 ; N b ; B 14 -15 575 629 ;
+C 99 ; WX 600 ; N c ; B 66 -15 529 441 ;
+C 100 ; WX 600 ; N d ; B 45 -15 591 629 ;
+C 101 ; WX 600 ; N e ; B 66 -15 548 441 ;
+C 102 ; WX 600 ; N f ; B 114 0 531 629 ; L i fi ; L l fl ;
+C 103 ; WX 600 ; N g ; B 45 -157 566 441 ;
+C 104 ; WX 600 ; N h ; B 18 0 582 629 ;
+C 105 ; WX 600 ; N i ; B 95 0 505 657 ;
+C 106 ; WX 600 ; N j ; B 82 -157 410 657 ;
+C 107 ; WX 600 ; N k ; B 43 0 580 629 ;
+C 108 ; WX 600 ; N l ; B 95 0 505 629 ;
+C 109 ; WX 600 ; N m ; B -5 0 605 441 ;
+C 110 ; WX 600 ; N n ; B 26 0 575 441 ;
+C 111 ; WX 600 ; N o ; B 62 -15 538 441 ;
+C 112 ; WX 600 ; N p ; B 9 -157 555 441 ;
+C 113 ; WX 600 ; N q ; B 45 -157 591 441 ;
+C 114 ; WX 600 ; N r ; B 60 0 559 441 ;
+C 115 ; WX 600 ; N s ; B 80 -15 513 441 ;
+C 116 ; WX 600 ; N t ; B 87 -15 530 561 ;
+C 117 ; WX 600 ; N u ; B 21 -15 562 426 ;
+C 118 ; WX 600 ; N v ; B 10 -10 590 426 ;
+C 119 ; WX 600 ; N w ; B -4 -10 604 426 ;
+C 120 ; WX 600 ; N x ; B 20 0 580 426 ;
+C 121 ; WX 600 ; N y ; B 7 -157 592 426 ;
+C 122 ; WX 600 ; N z ; B 99 0 502 426 ;
+C 123 ; WX 600 ; N braceleft ; B 182 -108 437 622 ;
+C 124 ; WX 600 ; N bar ; B 275 -250 326 750 ;
+C 125 ; WX 600 ; N braceright ; B 163 -108 418 622 ;
+C 126 ; WX 600 ; N asciitilde ; B 63 197 540 320 ;
+C 161 ; WX 600 ; N exclamdown ; B 236 -157 364 430 ;
+C 162 ; WX 600 ; N cent ; B 96 -49 500 614 ;
+C 163 ; WX 600 ; N sterling ; B 84 -21 521 611 ;
+C 164 ; WX 600 ; N fraction ; B 92 -57 509 665 ;
+C 165 ; WX 600 ; N yen ; B 26 0 574 562 ;
+C 166 ; WX 600 ; N florin ; B 4 -143 539 622 ;
+C 167 ; WX 600 ; N section ; B 113 -78 488 580 ;
+C 168 ; WX 600 ; N currency ; B 73 58 527 506 ;
+C 169 ; WX 600 ; N quotesingle ; B 259 328 341 562 ;
+C 170 ; WX 600 ; N quotedblleft ; B 143 328 471 562 ;
+C 171 ; WX 600 ; N guillemotleft ; B 37 70 563 446 ;
+C 172 ; WX 600 ; N guilsinglleft ; B 149 70 451 446 ;
+C 173 ; WX 600 ; N guilsinglright ; B 149 70 451 446 ;
+C 174 ; WX 600 ; N fi ; B 3 0 597 629 ;
+C 175 ; WX 600 ; N fl ; B 3 0 597 629 ;
+C 177 ; WX 600 ; N endash ; B 75 231 525 285 ;
+C 178 ; WX 600 ; N dagger ; B 141 -78 459 580 ;
+C 179 ; WX 600 ; N daggerdbl ; B 141 -78 459 580 ;
+C 180 ; WX 600 ; N periodcentered ; B 222 189 378 327 ;
+C 182 ; WX 600 ; N paragraph ; B 50 -78 511 562 ;
+C 183 ; WX 600 ; N bullet ; B 172 130 428 383 ;
+C 184 ; WX 600 ; N quotesinglbase ; B 213 -134 376 100 ;
+C 185 ; WX 600 ; N quotedblbase ; B 143 -134 457 100 ;
+C 186 ; WX 600 ; N quotedblright ; B 143 328 457 562 ;
+C 187 ; WX 600 ; N guillemotright ; B 37 70 563 446 ;
+C 188 ; WX 600 ; N ellipsis ; B 37 -15 563 111 ;
+C 189 ; WX 600 ; N perthousand ; B 3 -15 600 622 ;
+C 191 ; WX 600 ; N questiondown ; B 108 -157 471 430 ;
+C 193 ; WX 600 ; N grave ; B 151 497 378 672 ;
+C 194 ; WX 600 ; N acute ; B 242 497 469 672 ;
+C 195 ; WX 600 ; N circumflex ; B 124 477 476 654 ;
+C 196 ; WX 600 ; N tilde ; B 105 489 503 606 ;
+C 197 ; WX 600 ; N macron ; B 120 525 480 565 ;
+C 198 ; WX 600 ; N breve ; B 153 501 447 609 ;
+C 199 ; WX 600 ; N dotaccent ; B 249 537 352 640 ;
+C 200 ; WX 600 ; N dieresis ; B 148 537 453 640 ;
+C 202 ; WX 600 ; N ring ; B 218 463 382 627 ;
+C 203 ; WX 600 ; N cedilla ; B 224 -151 362 10 ;
+C 205 ; WX 600 ; N hungarumlaut ; B 133 497 540 672 ;
+C 206 ; WX 600 ; N ogonek ; B 211 -172 407 4 ;
+C 207 ; WX 600 ; N caron ; B 124 492 476 669 ;
+C 208 ; WX 600 ; N emdash ; B 0 231 600 285 ;
+C 225 ; WX 600 ; N AE ; B 3 0 550 562 ;
+C 227 ; WX 600 ; N ordfeminine ; B 156 249 442 580 ;
+C 232 ; WX 600 ; N Lslash ; B 47 0 554 562 ;
+C 233 ; WX 600 ; N Oslash ; B 43 -80 557 629 ;
+C 234 ; WX 600 ; N OE ; B 7 0 567 562 ;
+C 235 ; WX 600 ; N ordmasculine ; B 157 249 443 580 ;
+C 241 ; WX 600 ; N ae ; B 19 -15 570 441 ;
+C 245 ; WX 600 ; N dotlessi ; B 95 0 505 426 ;
+C 248 ; WX 600 ; N lslash ; B 95 0 505 629 ;
+C 249 ; WX 600 ; N oslash ; B 62 -80 538 506 ;
+C 250 ; WX 600 ; N oe ; B 19 -15 559 441 ;
+C 251 ; WX 600 ; N germandbls ; B 48 -15 588 629 ;
+C -1 ; WX 600 ; N Idieresis ; B 96 0 504 753 ;
+C -1 ; WX 600 ; N eacute ; B 66 -15 548 672 ;
+C -1 ; WX 600 ; N abreve ; B 53 -15 559 609 ;
+C -1 ; WX 600 ; N uhungarumlaut ; B 21 -15 580 672 ;
+C -1 ; WX 600 ; N ecaron ; B 66 -15 548 669 ;
+C -1 ; WX 600 ; N Ydieresis ; B 24 0 576 753 ;
+C -1 ; WX 600 ; N divide ; B 87 48 513 467 ;
+C -1 ; WX 600 ; N Yacute ; B 24 0 576 805 ;
+C -1 ; WX 600 ; N Acircumflex ; B 3 0 597 787 ;
+C -1 ; WX 600 ; N aacute ; B 53 -15 559 672 ;
+C -1 ; WX 600 ; N Ucircumflex ; B 17 -18 583 787 ;
+C -1 ; WX 600 ; N yacute ; B 7 -157 592 672 ;
+C -1 ; WX 600 ; N scommaaccent ; B 80 -250 513 441 ;
+C -1 ; WX 600 ; N ecircumflex ; B 66 -15 548 654 ;
+C -1 ; WX 600 ; N Uring ; B 17 -18 583 760 ;
+C -1 ; WX 600 ; N Udieresis ; B 17 -18 583 753 ;
+C -1 ; WX 600 ; N aogonek ; B 53 -172 587 441 ;
+C -1 ; WX 600 ; N Uacute ; B 17 -18 583 805 ;
+C -1 ; WX 600 ; N uogonek ; B 21 -172 590 426 ;
+C -1 ; WX 600 ; N Edieresis ; B 53 0 550 753 ;
+C -1 ; WX 600 ; N Dcroat ; B 30 0 574 562 ;
+C -1 ; WX 600 ; N commaaccent ; B 198 -250 335 -58 ;
+C -1 ; WX 600 ; N copyright ; B 0 -18 600 580 ;
+C -1 ; WX 600 ; N Emacron ; B 53 0 550 698 ;
+C -1 ; WX 600 ; N ccaron ; B 66 -15 529 669 ;
+C -1 ; WX 600 ; N aring ; B 53 -15 559 627 ;
+C -1 ; WX 600 ; N Ncommaaccent ; B 7 -250 593 562 ;
+C -1 ; WX 600 ; N lacute ; B 95 0 505 805 ;
+C -1 ; WX 600 ; N agrave ; B 53 -15 559 672 ;
+C -1 ; WX 600 ; N Tcommaaccent ; B 38 -250 563 562 ;
+C -1 ; WX 600 ; N Cacute ; B 41 -18 540 805 ;
+C -1 ; WX 600 ; N atilde ; B 53 -15 559 606 ;
+C -1 ; WX 600 ; N Edotaccent ; B 53 0 550 753 ;
+C -1 ; WX 600 ; N scaron ; B 80 -15 513 669 ;
+C -1 ; WX 600 ; N scedilla ; B 80 -151 513 441 ;
+C -1 ; WX 600 ; N iacute ; B 95 0 505 672 ;
+C -1 ; WX 600 ; N lozenge ; B 18 0 443 706 ;
+C -1 ; WX 600 ; N Rcaron ; B 38 0 588 802 ;
+C -1 ; WX 600 ; N Gcommaaccent ; B 31 -250 575 580 ;
+C -1 ; WX 600 ; N ucircumflex ; B 21 -15 562 654 ;
+C -1 ; WX 600 ; N acircumflex ; B 53 -15 559 654 ;
+C -1 ; WX 600 ; N Amacron ; B 3 0 597 698 ;
+C -1 ; WX 600 ; N rcaron ; B 60 0 559 669 ;
+C -1 ; WX 600 ; N ccedilla ; B 66 -151 529 441 ;
+C -1 ; WX 600 ; N Zdotaccent ; B 86 0 514 753 ;
+C -1 ; WX 600 ; N Thorn ; B 79 0 538 562 ;
+C -1 ; WX 600 ; N Omacron ; B 43 -18 557 698 ;
+C -1 ; WX 600 ; N Racute ; B 38 0 588 805 ;
+C -1 ; WX 600 ; N Sacute ; B 72 -20 529 805 ;
+C -1 ; WX 600 ; N dcaron ; B 45 -15 715 629 ;
+C -1 ; WX 600 ; N Umacron ; B 17 -18 583 698 ;
+C -1 ; WX 600 ; N uring ; B 21 -15 562 627 ;
+C -1 ; WX 600 ; N threesuperior ; B 155 240 406 622 ;
+C -1 ; WX 600 ; N Ograve ; B 43 -18 557 805 ;
+C -1 ; WX 600 ; N Agrave ; B 3 0 597 805 ;
+C -1 ; WX 600 ; N Abreve ; B 3 0 597 732 ;
+C -1 ; WX 600 ; N multiply ; B 87 43 515 470 ;
+C -1 ; WX 600 ; N uacute ; B 21 -15 562 672 ;
+C -1 ; WX 600 ; N Tcaron ; B 38 0 563 802 ;
+C -1 ; WX 600 ; N partialdiff ; B 17 -38 459 710 ;
+C -1 ; WX 600 ; N ydieresis ; B 7 -157 592 620 ;
+C -1 ; WX 600 ; N Nacute ; B 7 -13 593 805 ;
+C -1 ; WX 600 ; N icircumflex ; B 94 0 505 654 ;
+C -1 ; WX 600 ; N Ecircumflex ; B 53 0 550 787 ;
+C -1 ; WX 600 ; N adieresis ; B 53 -15 559 620 ;
+C -1 ; WX 600 ; N edieresis ; B 66 -15 548 620 ;
+C -1 ; WX 600 ; N cacute ; B 66 -15 529 672 ;
+C -1 ; WX 600 ; N nacute ; B 26 0 575 672 ;
+C -1 ; WX 600 ; N umacron ; B 21 -15 562 565 ;
+C -1 ; WX 600 ; N Ncaron ; B 7 -13 593 802 ;
+C -1 ; WX 600 ; N Iacute ; B 96 0 504 805 ;
+C -1 ; WX 600 ; N plusminus ; B 87 44 513 558 ;
+C -1 ; WX 600 ; N brokenbar ; B 275 -175 326 675 ;
+C -1 ; WX 600 ; N registered ; B 0 -18 600 580 ;
+C -1 ; WX 600 ; N Gbreve ; B 31 -18 575 732 ;
+C -1 ; WX 600 ; N Idotaccent ; B 96 0 504 753 ;
+C -1 ; WX 600 ; N summation ; B 15 -10 585 706 ;
+C -1 ; WX 600 ; N Egrave ; B 53 0 550 805 ;
+C -1 ; WX 600 ; N racute ; B 60 0 559 672 ;
+C -1 ; WX 600 ; N omacron ; B 62 -15 538 565 ;
+C -1 ; WX 600 ; N Zacute ; B 86 0 514 805 ;
+C -1 ; WX 600 ; N Zcaron ; B 86 0 514 802 ;
+C -1 ; WX 600 ; N greaterequal ; B 98 0 502 710 ;
+C -1 ; WX 600 ; N Eth ; B 30 0 574 562 ;
+C -1 ; WX 600 ; N Ccedilla ; B 41 -151 540 580 ;
+C -1 ; WX 600 ; N lcommaaccent ; B 95 -250 505 629 ;
+C -1 ; WX 600 ; N tcaron ; B 87 -15 530 717 ;
+C -1 ; WX 600 ; N eogonek ; B 66 -172 548 441 ;
+C -1 ; WX 600 ; N Uogonek ; B 17 -172 583 562 ;
+C -1 ; WX 600 ; N Aacute ; B 3 0 597 805 ;
+C -1 ; WX 600 ; N Adieresis ; B 3 0 597 753 ;
+C -1 ; WX 600 ; N egrave ; B 66 -15 548 672 ;
+C -1 ; WX 600 ; N zacute ; B 99 0 502 672 ;
+C -1 ; WX 600 ; N iogonek ; B 95 -172 505 657 ;
+C -1 ; WX 600 ; N Oacute ; B 43 -18 557 805 ;
+C -1 ; WX 600 ; N oacute ; B 62 -15 538 672 ;
+C -1 ; WX 600 ; N amacron ; B 53 -15 559 565 ;
+C -1 ; WX 600 ; N sacute ; B 80 -15 513 672 ;
+C -1 ; WX 600 ; N idieresis ; B 95 0 505 620 ;
+C -1 ; WX 600 ; N Ocircumflex ; B 43 -18 557 787 ;
+C -1 ; WX 600 ; N Ugrave ; B 17 -18 583 805 ;
+C -1 ; WX 600 ; N Delta ; B 6 0 598 688 ;
+C -1 ; WX 600 ; N thorn ; B -6 -157 555 629 ;
+C -1 ; WX 600 ; N twosuperior ; B 177 249 424 622 ;
+C -1 ; WX 600 ; N Odieresis ; B 43 -18 557 753 ;
+C -1 ; WX 600 ; N mu ; B 21 -157 562 426 ;
+C -1 ; WX 600 ; N igrave ; B 95 0 505 672 ;
+C -1 ; WX 600 ; N ohungarumlaut ; B 62 -15 580 672 ;
+C -1 ; WX 600 ; N Eogonek ; B 53 -172 561 562 ;
+C -1 ; WX 600 ; N dcroat ; B 45 -15 591 629 ;
+C -1 ; WX 600 ; N threequarters ; B 8 -56 593 666 ;
+C -1 ; WX 600 ; N Scedilla ; B 72 -151 529 580 ;
+C -1 ; WX 600 ; N lcaron ; B 95 0 533 629 ;
+C -1 ; WX 600 ; N Kcommaaccent ; B 38 -250 582 562 ;
+C -1 ; WX 600 ; N Lacute ; B 47 0 554 805 ;
+C -1 ; WX 600 ; N trademark ; B -23 263 623 562 ;
+C -1 ; WX 600 ; N edotaccent ; B 66 -15 548 620 ;
+C -1 ; WX 600 ; N Igrave ; B 96 0 504 805 ;
+C -1 ; WX 600 ; N Imacron ; B 96 0 504 698 ;
+C -1 ; WX 600 ; N Lcaron ; B 47 0 554 562 ;
+C -1 ; WX 600 ; N onehalf ; B 0 -57 611 665 ;
+C -1 ; WX 600 ; N lessequal ; B 98 0 502 710 ;
+C -1 ; WX 600 ; N ocircumflex ; B 62 -15 538 654 ;
+C -1 ; WX 600 ; N ntilde ; B 26 0 575 606 ;
+C -1 ; WX 600 ; N Uhungarumlaut ; B 17 -18 590 805 ;
+C -1 ; WX 600 ; N Eacute ; B 53 0 550 805 ;
+C -1 ; WX 600 ; N emacron ; B 66 -15 548 565 ;
+C -1 ; WX 600 ; N gbreve ; B 45 -157 566 609 ;
+C -1 ; WX 600 ; N onequarter ; B 0 -57 600 665 ;
+C -1 ; WX 600 ; N Scaron ; B 72 -20 529 802 ;
+C -1 ; WX 600 ; N Scommaaccent ; B 72 -250 529 580 ;
+C -1 ; WX 600 ; N Ohungarumlaut ; B 43 -18 580 805 ;
+C -1 ; WX 600 ; N degree ; B 123 269 477 622 ;
+C -1 ; WX 600 ; N ograve ; B 62 -15 538 672 ;
+C -1 ; WX 600 ; N Ccaron ; B 41 -18 540 802 ;
+C -1 ; WX 600 ; N ugrave ; B 21 -15 562 672 ;
+C -1 ; WX 600 ; N radical ; B 3 -15 597 792 ;
+C -1 ; WX 600 ; N Dcaron ; B 43 0 574 802 ;
+C -1 ; WX 600 ; N rcommaaccent ; B 60 -250 559 441 ;
+C -1 ; WX 600 ; N Ntilde ; B 7 -13 593 729 ;
+C -1 ; WX 600 ; N otilde ; B 62 -15 538 606 ;
+C -1 ; WX 600 ; N Rcommaaccent ; B 38 -250 588 562 ;
+C -1 ; WX 600 ; N Lcommaaccent ; B 47 -250 554 562 ;
+C -1 ; WX 600 ; N Atilde ; B 3 0 597 729 ;
+C -1 ; WX 600 ; N Aogonek ; B 3 -172 608 562 ;
+C -1 ; WX 600 ; N Aring ; B 3 0 597 750 ;
+C -1 ; WX 600 ; N Otilde ; B 43 -18 557 729 ;
+C -1 ; WX 600 ; N zdotaccent ; B 99 0 502 620 ;
+C -1 ; WX 600 ; N Ecaron ; B 53 0 550 802 ;
+C -1 ; WX 600 ; N Iogonek ; B 96 -172 504 562 ;
+C -1 ; WX 600 ; N kcommaaccent ; B 43 -250 580 629 ;
+C -1 ; WX 600 ; N minus ; B 80 232 520 283 ;
+C -1 ; WX 600 ; N Icircumflex ; B 96 0 504 787 ;
+C -1 ; WX 600 ; N ncaron ; B 26 0 575 669 ;
+C -1 ; WX 600 ; N tcommaaccent ; B 87 -250 530 561 ;
+C -1 ; WX 600 ; N logicalnot ; B 87 108 513 369 ;
+C -1 ; WX 600 ; N odieresis ; B 62 -15 538 620 ;
+C -1 ; WX 600 ; N udieresis ; B 21 -15 562 620 ;
+C -1 ; WX 600 ; N notequal ; B 15 -16 540 529 ;
+C -1 ; WX 600 ; N gcommaaccent ; B 45 -157 566 708 ;
+C -1 ; WX 600 ; N eth ; B 62 -15 538 629 ;
+C -1 ; WX 600 ; N zcaron ; B 99 0 502 669 ;
+C -1 ; WX 600 ; N ncommaaccent ; B 26 -250 575 441 ;
+C -1 ; WX 600 ; N onesuperior ; B 172 249 428 622 ;
+C -1 ; WX 600 ; N imacron ; B 95 0 505 565 ;
+C -1 ; WX 600 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Bold.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Bold.afm
new file mode 100644
index 0000000000000000000000000000000000000000..837c594e0e80214c2c9c520b2aa9ae1ce3f18b33
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Bold.afm
@@ -0,0 +1,2827 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 12:43:52 1997
+Comment UniqueID 43052
+Comment VMusage 37169 48194
+FontName Helvetica-Bold
+FullName Helvetica Bold
+FamilyName Helvetica
+Weight Bold
+ItalicAngle 0
+IsFixedPitch false
+CharacterSet ExtendedRoman
+FontBBox -170 -228 1003 962
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 532
+Ascender 718
+Descender -207
+StdHW 118
+StdVW 140
+StartCharMetrics 315
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 90 0 244 718 ;
+C 34 ; WX 474 ; N quotedbl ; B 98 447 376 718 ;
+C 35 ; WX 556 ; N numbersign ; B 18 0 538 698 ;
+C 36 ; WX 556 ; N dollar ; B 30 -115 523 775 ;
+C 37 ; WX 889 ; N percent ; B 28 -19 861 710 ;
+C 38 ; WX 722 ; N ampersand ; B 54 -19 701 718 ;
+C 39 ; WX 278 ; N quoteright ; B 69 445 209 718 ;
+C 40 ; WX 333 ; N parenleft ; B 35 -208 314 734 ;
+C 41 ; WX 333 ; N parenright ; B 19 -208 298 734 ;
+C 42 ; WX 389 ; N asterisk ; B 27 387 362 718 ;
+C 43 ; WX 584 ; N plus ; B 40 0 544 506 ;
+C 44 ; WX 278 ; N comma ; B 64 -168 214 146 ;
+C 45 ; WX 333 ; N hyphen ; B 27 215 306 345 ;
+C 46 ; WX 278 ; N period ; B 64 0 214 146 ;
+C 47 ; WX 278 ; N slash ; B -33 -19 311 737 ;
+C 48 ; WX 556 ; N zero ; B 32 -19 524 710 ;
+C 49 ; WX 556 ; N one ; B 69 0 378 710 ;
+C 50 ; WX 556 ; N two ; B 26 0 511 710 ;
+C 51 ; WX 556 ; N three ; B 27 -19 516 710 ;
+C 52 ; WX 556 ; N four ; B 27 0 526 710 ;
+C 53 ; WX 556 ; N five ; B 27 -19 516 698 ;
+C 54 ; WX 556 ; N six ; B 31 -19 520 710 ;
+C 55 ; WX 556 ; N seven ; B 25 0 528 698 ;
+C 56 ; WX 556 ; N eight ; B 32 -19 524 710 ;
+C 57 ; WX 556 ; N nine ; B 30 -19 522 710 ;
+C 58 ; WX 333 ; N colon ; B 92 0 242 512 ;
+C 59 ; WX 333 ; N semicolon ; B 92 -168 242 512 ;
+C 60 ; WX 584 ; N less ; B 38 -8 546 514 ;
+C 61 ; WX 584 ; N equal ; B 40 87 544 419 ;
+C 62 ; WX 584 ; N greater ; B 38 -8 546 514 ;
+C 63 ; WX 611 ; N question ; B 60 0 556 727 ;
+C 64 ; WX 975 ; N at ; B 118 -19 856 737 ;
+C 65 ; WX 722 ; N A ; B 20 0 702 718 ;
+C 66 ; WX 722 ; N B ; B 76 0 669 718 ;
+C 67 ; WX 722 ; N C ; B 44 -19 684 737 ;
+C 68 ; WX 722 ; N D ; B 76 0 685 718 ;
+C 69 ; WX 667 ; N E ; B 76 0 621 718 ;
+C 70 ; WX 611 ; N F ; B 76 0 587 718 ;
+C 71 ; WX 778 ; N G ; B 44 -19 713 737 ;
+C 72 ; WX 722 ; N H ; B 71 0 651 718 ;
+C 73 ; WX 278 ; N I ; B 64 0 214 718 ;
+C 74 ; WX 556 ; N J ; B 22 -18 484 718 ;
+C 75 ; WX 722 ; N K ; B 87 0 722 718 ;
+C 76 ; WX 611 ; N L ; B 76 0 583 718 ;
+C 77 ; WX 833 ; N M ; B 69 0 765 718 ;
+C 78 ; WX 722 ; N N ; B 69 0 654 718 ;
+C 79 ; WX 778 ; N O ; B 44 -19 734 737 ;
+C 80 ; WX 667 ; N P ; B 76 0 627 718 ;
+C 81 ; WX 778 ; N Q ; B 44 -52 737 737 ;
+C 82 ; WX 722 ; N R ; B 76 0 677 718 ;
+C 83 ; WX 667 ; N S ; B 39 -19 629 737 ;
+C 84 ; WX 611 ; N T ; B 14 0 598 718 ;
+C 85 ; WX 722 ; N U ; B 72 -19 651 718 ;
+C 86 ; WX 667 ; N V ; B 19 0 648 718 ;
+C 87 ; WX 944 ; N W ; B 16 0 929 718 ;
+C 88 ; WX 667 ; N X ; B 14 0 653 718 ;
+C 89 ; WX 667 ; N Y ; B 15 0 653 718 ;
+C 90 ; WX 611 ; N Z ; B 25 0 586 718 ;
+C 91 ; WX 333 ; N bracketleft ; B 63 -196 309 722 ;
+C 92 ; WX 278 ; N backslash ; B -33 -19 311 737 ;
+C 93 ; WX 333 ; N bracketright ; B 24 -196 270 722 ;
+C 94 ; WX 584 ; N asciicircum ; B 62 323 522 698 ;
+C 95 ; WX 556 ; N underscore ; B 0 -125 556 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 69 454 209 727 ;
+C 97 ; WX 556 ; N a ; B 29 -14 527 546 ;
+C 98 ; WX 611 ; N b ; B 61 -14 578 718 ;
+C 99 ; WX 556 ; N c ; B 34 -14 524 546 ;
+C 100 ; WX 611 ; N d ; B 34 -14 551 718 ;
+C 101 ; WX 556 ; N e ; B 23 -14 528 546 ;
+C 102 ; WX 333 ; N f ; B 10 0 318 727 ; L i fi ; L l fl ;
+C 103 ; WX 611 ; N g ; B 40 -217 553 546 ;
+C 104 ; WX 611 ; N h ; B 65 0 546 718 ;
+C 105 ; WX 278 ; N i ; B 69 0 209 725 ;
+C 106 ; WX 278 ; N j ; B 3 -214 209 725 ;
+C 107 ; WX 556 ; N k ; B 69 0 562 718 ;
+C 108 ; WX 278 ; N l ; B 69 0 209 718 ;
+C 109 ; WX 889 ; N m ; B 64 0 826 546 ;
+C 110 ; WX 611 ; N n ; B 65 0 546 546 ;
+C 111 ; WX 611 ; N o ; B 34 -14 578 546 ;
+C 112 ; WX 611 ; N p ; B 62 -207 578 546 ;
+C 113 ; WX 611 ; N q ; B 34 -207 552 546 ;
+C 114 ; WX 389 ; N r ; B 64 0 373 546 ;
+C 115 ; WX 556 ; N s ; B 30 -14 519 546 ;
+C 116 ; WX 333 ; N t ; B 10 -6 309 676 ;
+C 117 ; WX 611 ; N u ; B 66 -14 545 532 ;
+C 118 ; WX 556 ; N v ; B 13 0 543 532 ;
+C 119 ; WX 778 ; N w ; B 10 0 769 532 ;
+C 120 ; WX 556 ; N x ; B 15 0 541 532 ;
+C 121 ; WX 556 ; N y ; B 10 -214 539 532 ;
+C 122 ; WX 500 ; N z ; B 20 0 480 532 ;
+C 123 ; WX 389 ; N braceleft ; B 48 -196 365 722 ;
+C 124 ; WX 280 ; N bar ; B 84 -225 196 775 ;
+C 125 ; WX 389 ; N braceright ; B 24 -196 341 722 ;
+C 126 ; WX 584 ; N asciitilde ; B 61 163 523 343 ;
+C 161 ; WX 333 ; N exclamdown ; B 90 -186 244 532 ;
+C 162 ; WX 556 ; N cent ; B 34 -118 524 628 ;
+C 163 ; WX 556 ; N sterling ; B 28 -16 541 718 ;
+C 164 ; WX 167 ; N fraction ; B -170 -19 336 710 ;
+C 165 ; WX 556 ; N yen ; B -9 0 565 698 ;
+C 166 ; WX 556 ; N florin ; B -10 -210 516 737 ;
+C 167 ; WX 556 ; N section ; B 34 -184 522 727 ;
+C 168 ; WX 556 ; N currency ; B -3 76 559 636 ;
+C 169 ; WX 238 ; N quotesingle ; B 70 447 168 718 ;
+C 170 ; WX 500 ; N quotedblleft ; B 64 454 436 727 ;
+C 171 ; WX 556 ; N guillemotleft ; B 88 76 468 484 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 83 76 250 484 ;
+C 173 ; WX 333 ; N guilsinglright ; B 83 76 250 484 ;
+C 174 ; WX 611 ; N fi ; B 10 0 542 727 ;
+C 175 ; WX 611 ; N fl ; B 10 0 542 727 ;
+C 177 ; WX 556 ; N endash ; B 0 227 556 333 ;
+C 178 ; WX 556 ; N dagger ; B 36 -171 520 718 ;
+C 179 ; WX 556 ; N daggerdbl ; B 36 -171 520 718 ;
+C 180 ; WX 278 ; N periodcentered ; B 58 172 220 334 ;
+C 182 ; WX 556 ; N paragraph ; B -8 -191 539 700 ;
+C 183 ; WX 350 ; N bullet ; B 10 194 340 524 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 69 -146 209 127 ;
+C 185 ; WX 500 ; N quotedblbase ; B 64 -146 436 127 ;
+C 186 ; WX 500 ; N quotedblright ; B 64 445 436 718 ;
+C 187 ; WX 556 ; N guillemotright ; B 88 76 468 484 ;
+C 188 ; WX 1000 ; N ellipsis ; B 92 0 908 146 ;
+C 189 ; WX 1000 ; N perthousand ; B -3 -19 1003 710 ;
+C 191 ; WX 611 ; N questiondown ; B 55 -195 551 532 ;
+C 193 ; WX 333 ; N grave ; B -23 604 225 750 ;
+C 194 ; WX 333 ; N acute ; B 108 604 356 750 ;
+C 195 ; WX 333 ; N circumflex ; B -10 604 343 750 ;
+C 196 ; WX 333 ; N tilde ; B -17 610 350 737 ;
+C 197 ; WX 333 ; N macron ; B -6 604 339 678 ;
+C 198 ; WX 333 ; N breve ; B -2 604 335 750 ;
+C 199 ; WX 333 ; N dotaccent ; B 104 614 230 729 ;
+C 200 ; WX 333 ; N dieresis ; B 6 614 327 729 ;
+C 202 ; WX 333 ; N ring ; B 59 568 275 776 ;
+C 203 ; WX 333 ; N cedilla ; B 6 -228 245 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 9 604 486 750 ;
+C 206 ; WX 333 ; N ogonek ; B 71 -228 304 0 ;
+C 207 ; WX 333 ; N caron ; B -10 604 343 750 ;
+C 208 ; WX 1000 ; N emdash ; B 0 227 1000 333 ;
+C 225 ; WX 1000 ; N AE ; B 5 0 954 718 ;
+C 227 ; WX 370 ; N ordfeminine ; B 22 401 347 737 ;
+C 232 ; WX 611 ; N Lslash ; B -20 0 583 718 ;
+C 233 ; WX 778 ; N Oslash ; B 33 -27 744 745 ;
+C 234 ; WX 1000 ; N OE ; B 37 -19 961 737 ;
+C 235 ; WX 365 ; N ordmasculine ; B 6 401 360 737 ;
+C 241 ; WX 889 ; N ae ; B 29 -14 858 546 ;
+C 245 ; WX 278 ; N dotlessi ; B 69 0 209 532 ;
+C 248 ; WX 278 ; N lslash ; B -18 0 296 718 ;
+C 249 ; WX 611 ; N oslash ; B 22 -29 589 560 ;
+C 250 ; WX 944 ; N oe ; B 34 -14 912 546 ;
+C 251 ; WX 611 ; N germandbls ; B 69 -14 579 731 ;
+C -1 ; WX 278 ; N Idieresis ; B -21 0 300 915 ;
+C -1 ; WX 556 ; N eacute ; B 23 -14 528 750 ;
+C -1 ; WX 556 ; N abreve ; B 29 -14 527 750 ;
+C -1 ; WX 611 ; N uhungarumlaut ; B 66 -14 625 750 ;
+C -1 ; WX 556 ; N ecaron ; B 23 -14 528 750 ;
+C -1 ; WX 667 ; N Ydieresis ; B 15 0 653 915 ;
+C -1 ; WX 584 ; N divide ; B 40 -42 544 548 ;
+C -1 ; WX 667 ; N Yacute ; B 15 0 653 936 ;
+C -1 ; WX 722 ; N Acircumflex ; B 20 0 702 936 ;
+C -1 ; WX 556 ; N aacute ; B 29 -14 527 750 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 72 -19 651 936 ;
+C -1 ; WX 556 ; N yacute ; B 10 -214 539 750 ;
+C -1 ; WX 556 ; N scommaaccent ; B 30 -228 519 546 ;
+C -1 ; WX 556 ; N ecircumflex ; B 23 -14 528 750 ;
+C -1 ; WX 722 ; N Uring ; B 72 -19 651 962 ;
+C -1 ; WX 722 ; N Udieresis ; B 72 -19 651 915 ;
+C -1 ; WX 556 ; N aogonek ; B 29 -224 545 546 ;
+C -1 ; WX 722 ; N Uacute ; B 72 -19 651 936 ;
+C -1 ; WX 611 ; N uogonek ; B 66 -228 545 532 ;
+C -1 ; WX 667 ; N Edieresis ; B 76 0 621 915 ;
+C -1 ; WX 722 ; N Dcroat ; B -5 0 685 718 ;
+C -1 ; WX 250 ; N commaaccent ; B 64 -228 199 -50 ;
+C -1 ; WX 737 ; N copyright ; B -11 -19 749 737 ;
+C -1 ; WX 667 ; N Emacron ; B 76 0 621 864 ;
+C -1 ; WX 556 ; N ccaron ; B 34 -14 524 750 ;
+C -1 ; WX 556 ; N aring ; B 29 -14 527 776 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 69 -228 654 718 ;
+C -1 ; WX 278 ; N lacute ; B 69 0 329 936 ;
+C -1 ; WX 556 ; N agrave ; B 29 -14 527 750 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 14 -228 598 718 ;
+C -1 ; WX 722 ; N Cacute ; B 44 -19 684 936 ;
+C -1 ; WX 556 ; N atilde ; B 29 -14 527 737 ;
+C -1 ; WX 667 ; N Edotaccent ; B 76 0 621 915 ;
+C -1 ; WX 556 ; N scaron ; B 30 -14 519 750 ;
+C -1 ; WX 556 ; N scedilla ; B 30 -228 519 546 ;
+C -1 ; WX 278 ; N iacute ; B 69 0 329 750 ;
+C -1 ; WX 494 ; N lozenge ; B 10 0 484 745 ;
+C -1 ; WX 722 ; N Rcaron ; B 76 0 677 936 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 44 -228 713 737 ;
+C -1 ; WX 611 ; N ucircumflex ; B 66 -14 545 750 ;
+C -1 ; WX 556 ; N acircumflex ; B 29 -14 527 750 ;
+C -1 ; WX 722 ; N Amacron ; B 20 0 702 864 ;
+C -1 ; WX 389 ; N rcaron ; B 18 0 373 750 ;
+C -1 ; WX 556 ; N ccedilla ; B 34 -228 524 546 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 25 0 586 915 ;
+C -1 ; WX 667 ; N Thorn ; B 76 0 627 718 ;
+C -1 ; WX 778 ; N Omacron ; B 44 -19 734 864 ;
+C -1 ; WX 722 ; N Racute ; B 76 0 677 936 ;
+C -1 ; WX 667 ; N Sacute ; B 39 -19 629 936 ;
+C -1 ; WX 743 ; N dcaron ; B 34 -14 750 718 ;
+C -1 ; WX 722 ; N Umacron ; B 72 -19 651 864 ;
+C -1 ; WX 611 ; N uring ; B 66 -14 545 776 ;
+C -1 ; WX 333 ; N threesuperior ; B 8 271 326 710 ;
+C -1 ; WX 778 ; N Ograve ; B 44 -19 734 936 ;
+C -1 ; WX 722 ; N Agrave ; B 20 0 702 936 ;
+C -1 ; WX 722 ; N Abreve ; B 20 0 702 936 ;
+C -1 ; WX 584 ; N multiply ; B 40 1 545 505 ;
+C -1 ; WX 611 ; N uacute ; B 66 -14 545 750 ;
+C -1 ; WX 611 ; N Tcaron ; B 14 0 598 936 ;
+C -1 ; WX 494 ; N partialdiff ; B 11 -21 494 750 ;
+C -1 ; WX 556 ; N ydieresis ; B 10 -214 539 729 ;
+C -1 ; WX 722 ; N Nacute ; B 69 0 654 936 ;
+C -1 ; WX 278 ; N icircumflex ; B -37 0 316 750 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 76 0 621 936 ;
+C -1 ; WX 556 ; N adieresis ; B 29 -14 527 729 ;
+C -1 ; WX 556 ; N edieresis ; B 23 -14 528 729 ;
+C -1 ; WX 556 ; N cacute ; B 34 -14 524 750 ;
+C -1 ; WX 611 ; N nacute ; B 65 0 546 750 ;
+C -1 ; WX 611 ; N umacron ; B 66 -14 545 678 ;
+C -1 ; WX 722 ; N Ncaron ; B 69 0 654 936 ;
+C -1 ; WX 278 ; N Iacute ; B 64 0 329 936 ;
+C -1 ; WX 584 ; N plusminus ; B 40 0 544 506 ;
+C -1 ; WX 280 ; N brokenbar ; B 84 -150 196 700 ;
+C -1 ; WX 737 ; N registered ; B -11 -19 748 737 ;
+C -1 ; WX 778 ; N Gbreve ; B 44 -19 713 936 ;
+C -1 ; WX 278 ; N Idotaccent ; B 64 0 214 915 ;
+C -1 ; WX 600 ; N summation ; B 14 -10 585 706 ;
+C -1 ; WX 667 ; N Egrave ; B 76 0 621 936 ;
+C -1 ; WX 389 ; N racute ; B 64 0 384 750 ;
+C -1 ; WX 611 ; N omacron ; B 34 -14 578 678 ;
+C -1 ; WX 611 ; N Zacute ; B 25 0 586 936 ;
+C -1 ; WX 611 ; N Zcaron ; B 25 0 586 936 ;
+C -1 ; WX 549 ; N greaterequal ; B 26 0 523 704 ;
+C -1 ; WX 722 ; N Eth ; B -5 0 685 718 ;
+C -1 ; WX 722 ; N Ccedilla ; B 44 -228 684 737 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 69 -228 213 718 ;
+C -1 ; WX 389 ; N tcaron ; B 10 -6 421 878 ;
+C -1 ; WX 556 ; N eogonek ; B 23 -228 528 546 ;
+C -1 ; WX 722 ; N Uogonek ; B 72 -228 651 718 ;
+C -1 ; WX 722 ; N Aacute ; B 20 0 702 936 ;
+C -1 ; WX 722 ; N Adieresis ; B 20 0 702 915 ;
+C -1 ; WX 556 ; N egrave ; B 23 -14 528 750 ;
+C -1 ; WX 500 ; N zacute ; B 20 0 480 750 ;
+C -1 ; WX 278 ; N iogonek ; B 16 -224 249 725 ;
+C -1 ; WX 778 ; N Oacute ; B 44 -19 734 936 ;
+C -1 ; WX 611 ; N oacute ; B 34 -14 578 750 ;
+C -1 ; WX 556 ; N amacron ; B 29 -14 527 678 ;
+C -1 ; WX 556 ; N sacute ; B 30 -14 519 750 ;
+C -1 ; WX 278 ; N idieresis ; B -21 0 300 729 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 44 -19 734 936 ;
+C -1 ; WX 722 ; N Ugrave ; B 72 -19 651 936 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 611 ; N thorn ; B 62 -208 578 718 ;
+C -1 ; WX 333 ; N twosuperior ; B 9 283 324 710 ;
+C -1 ; WX 778 ; N Odieresis ; B 44 -19 734 915 ;
+C -1 ; WX 611 ; N mu ; B 66 -207 545 532 ;
+C -1 ; WX 278 ; N igrave ; B -50 0 209 750 ;
+C -1 ; WX 611 ; N ohungarumlaut ; B 34 -14 625 750 ;
+C -1 ; WX 667 ; N Eogonek ; B 76 -224 639 718 ;
+C -1 ; WX 611 ; N dcroat ; B 34 -14 650 718 ;
+C -1 ; WX 834 ; N threequarters ; B 16 -19 799 710 ;
+C -1 ; WX 667 ; N Scedilla ; B 39 -228 629 737 ;
+C -1 ; WX 400 ; N lcaron ; B 69 0 408 718 ;
+C -1 ; WX 722 ; N Kcommaaccent ; B 87 -228 722 718 ;
+C -1 ; WX 611 ; N Lacute ; B 76 0 583 936 ;
+C -1 ; WX 1000 ; N trademark ; B 44 306 956 718 ;
+C -1 ; WX 556 ; N edotaccent ; B 23 -14 528 729 ;
+C -1 ; WX 278 ; N Igrave ; B -50 0 214 936 ;
+C -1 ; WX 278 ; N Imacron ; B -33 0 312 864 ;
+C -1 ; WX 611 ; N Lcaron ; B 76 0 583 718 ;
+C -1 ; WX 834 ; N onehalf ; B 26 -19 794 710 ;
+C -1 ; WX 549 ; N lessequal ; B 29 0 526 704 ;
+C -1 ; WX 611 ; N ocircumflex ; B 34 -14 578 750 ;
+C -1 ; WX 611 ; N ntilde ; B 65 0 546 737 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 72 -19 681 936 ;
+C -1 ; WX 667 ; N Eacute ; B 76 0 621 936 ;
+C -1 ; WX 556 ; N emacron ; B 23 -14 528 678 ;
+C -1 ; WX 611 ; N gbreve ; B 40 -217 553 750 ;
+C -1 ; WX 834 ; N onequarter ; B 26 -19 766 710 ;
+C -1 ; WX 667 ; N Scaron ; B 39 -19 629 936 ;
+C -1 ; WX 667 ; N Scommaaccent ; B 39 -228 629 737 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 44 -19 734 936 ;
+C -1 ; WX 400 ; N degree ; B 57 426 343 712 ;
+C -1 ; WX 611 ; N ograve ; B 34 -14 578 750 ;
+C -1 ; WX 722 ; N Ccaron ; B 44 -19 684 936 ;
+C -1 ; WX 611 ; N ugrave ; B 66 -14 545 750 ;
+C -1 ; WX 549 ; N radical ; B 10 -46 512 850 ;
+C -1 ; WX 722 ; N Dcaron ; B 76 0 685 936 ;
+C -1 ; WX 389 ; N rcommaaccent ; B 64 -228 373 546 ;
+C -1 ; WX 722 ; N Ntilde ; B 69 0 654 923 ;
+C -1 ; WX 611 ; N otilde ; B 34 -14 578 737 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 76 -228 677 718 ;
+C -1 ; WX 611 ; N Lcommaaccent ; B 76 -228 583 718 ;
+C -1 ; WX 722 ; N Atilde ; B 20 0 702 923 ;
+C -1 ; WX 722 ; N Aogonek ; B 20 -224 742 718 ;
+C -1 ; WX 722 ; N Aring ; B 20 0 702 962 ;
+C -1 ; WX 778 ; N Otilde ; B 44 -19 734 923 ;
+C -1 ; WX 500 ; N zdotaccent ; B 20 0 480 729 ;
+C -1 ; WX 667 ; N Ecaron ; B 76 0 621 936 ;
+C -1 ; WX 278 ; N Iogonek ; B -11 -228 222 718 ;
+C -1 ; WX 556 ; N kcommaaccent ; B 69 -228 562 718 ;
+C -1 ; WX 584 ; N minus ; B 40 197 544 309 ;
+C -1 ; WX 278 ; N Icircumflex ; B -37 0 316 936 ;
+C -1 ; WX 611 ; N ncaron ; B 65 0 546 750 ;
+C -1 ; WX 333 ; N tcommaaccent ; B 10 -228 309 676 ;
+C -1 ; WX 584 ; N logicalnot ; B 40 108 544 419 ;
+C -1 ; WX 611 ; N odieresis ; B 34 -14 578 729 ;
+C -1 ; WX 611 ; N udieresis ; B 66 -14 545 729 ;
+C -1 ; WX 549 ; N notequal ; B 15 -49 540 570 ;
+C -1 ; WX 611 ; N gcommaaccent ; B 40 -217 553 850 ;
+C -1 ; WX 611 ; N eth ; B 34 -14 578 737 ;
+C -1 ; WX 500 ; N zcaron ; B 20 0 480 750 ;
+C -1 ; WX 611 ; N ncommaaccent ; B 65 -228 546 546 ;
+C -1 ; WX 333 ; N onesuperior ; B 26 283 237 710 ;
+C -1 ; WX 278 ; N imacron ; B -8 0 285 678 ;
+C -1 ; WX 556 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 2481
+KPX A C -40
+KPX A Cacute -40
+KPX A Ccaron -40
+KPX A Ccedilla -40
+KPX A G -50
+KPX A Gbreve -50
+KPX A Gcommaaccent -50
+KPX A O -40
+KPX A Oacute -40
+KPX A Ocircumflex -40
+KPX A Odieresis -40
+KPX A Ograve -40
+KPX A Ohungarumlaut -40
+KPX A Omacron -40
+KPX A Oslash -40
+KPX A Otilde -40
+KPX A Q -40
+KPX A T -90
+KPX A Tcaron -90
+KPX A Tcommaaccent -90
+KPX A U -50
+KPX A Uacute -50
+KPX A Ucircumflex -50
+KPX A Udieresis -50
+KPX A Ugrave -50
+KPX A Uhungarumlaut -50
+KPX A Umacron -50
+KPX A Uogonek -50
+KPX A Uring -50
+KPX A V -80
+KPX A W -60
+KPX A Y -110
+KPX A Yacute -110
+KPX A Ydieresis -110
+KPX A u -30
+KPX A uacute -30
+KPX A ucircumflex -30
+KPX A udieresis -30
+KPX A ugrave -30
+KPX A uhungarumlaut -30
+KPX A umacron -30
+KPX A uogonek -30
+KPX A uring -30
+KPX A v -40
+KPX A w -30
+KPX A y -30
+KPX A yacute -30
+KPX A ydieresis -30
+KPX Aacute C -40
+KPX Aacute Cacute -40
+KPX Aacute Ccaron -40
+KPX Aacute Ccedilla -40
+KPX Aacute G -50
+KPX Aacute Gbreve -50
+KPX Aacute Gcommaaccent -50
+KPX Aacute O -40
+KPX Aacute Oacute -40
+KPX Aacute Ocircumflex -40
+KPX Aacute Odieresis -40
+KPX Aacute Ograve -40
+KPX Aacute Ohungarumlaut -40
+KPX Aacute Omacron -40
+KPX Aacute Oslash -40
+KPX Aacute Otilde -40
+KPX Aacute Q -40
+KPX Aacute T -90
+KPX Aacute Tcaron -90
+KPX Aacute Tcommaaccent -90
+KPX Aacute U -50
+KPX Aacute Uacute -50
+KPX Aacute Ucircumflex -50
+KPX Aacute Udieresis -50
+KPX Aacute Ugrave -50
+KPX Aacute Uhungarumlaut -50
+KPX Aacute Umacron -50
+KPX Aacute Uogonek -50
+KPX Aacute Uring -50
+KPX Aacute V -80
+KPX Aacute W -60
+KPX Aacute Y -110
+KPX Aacute Yacute -110
+KPX Aacute Ydieresis -110
+KPX Aacute u -30
+KPX Aacute uacute -30
+KPX Aacute ucircumflex -30
+KPX Aacute udieresis -30
+KPX Aacute ugrave -30
+KPX Aacute uhungarumlaut -30
+KPX Aacute umacron -30
+KPX Aacute uogonek -30
+KPX Aacute uring -30
+KPX Aacute v -40
+KPX Aacute w -30
+KPX Aacute y -30
+KPX Aacute yacute -30
+KPX Aacute ydieresis -30
+KPX Abreve C -40
+KPX Abreve Cacute -40
+KPX Abreve Ccaron -40
+KPX Abreve Ccedilla -40
+KPX Abreve G -50
+KPX Abreve Gbreve -50
+KPX Abreve Gcommaaccent -50
+KPX Abreve O -40
+KPX Abreve Oacute -40
+KPX Abreve Ocircumflex -40
+KPX Abreve Odieresis -40
+KPX Abreve Ograve -40
+KPX Abreve Ohungarumlaut -40
+KPX Abreve Omacron -40
+KPX Abreve Oslash -40
+KPX Abreve Otilde -40
+KPX Abreve Q -40
+KPX Abreve T -90
+KPX Abreve Tcaron -90
+KPX Abreve Tcommaaccent -90
+KPX Abreve U -50
+KPX Abreve Uacute -50
+KPX Abreve Ucircumflex -50
+KPX Abreve Udieresis -50
+KPX Abreve Ugrave -50
+KPX Abreve Uhungarumlaut -50
+KPX Abreve Umacron -50
+KPX Abreve Uogonek -50
+KPX Abreve Uring -50
+KPX Abreve V -80
+KPX Abreve W -60
+KPX Abreve Y -110
+KPX Abreve Yacute -110
+KPX Abreve Ydieresis -110
+KPX Abreve u -30
+KPX Abreve uacute -30
+KPX Abreve ucircumflex -30
+KPX Abreve udieresis -30
+KPX Abreve ugrave -30
+KPX Abreve uhungarumlaut -30
+KPX Abreve umacron -30
+KPX Abreve uogonek -30
+KPX Abreve uring -30
+KPX Abreve v -40
+KPX Abreve w -30
+KPX Abreve y -30
+KPX Abreve yacute -30
+KPX Abreve ydieresis -30
+KPX Acircumflex C -40
+KPX Acircumflex Cacute -40
+KPX Acircumflex Ccaron -40
+KPX Acircumflex Ccedilla -40
+KPX Acircumflex G -50
+KPX Acircumflex Gbreve -50
+KPX Acircumflex Gcommaaccent -50
+KPX Acircumflex O -40
+KPX Acircumflex Oacute -40
+KPX Acircumflex Ocircumflex -40
+KPX Acircumflex Odieresis -40
+KPX Acircumflex Ograve -40
+KPX Acircumflex Ohungarumlaut -40
+KPX Acircumflex Omacron -40
+KPX Acircumflex Oslash -40
+KPX Acircumflex Otilde -40
+KPX Acircumflex Q -40
+KPX Acircumflex T -90
+KPX Acircumflex Tcaron -90
+KPX Acircumflex Tcommaaccent -90
+KPX Acircumflex U -50
+KPX Acircumflex Uacute -50
+KPX Acircumflex Ucircumflex -50
+KPX Acircumflex Udieresis -50
+KPX Acircumflex Ugrave -50
+KPX Acircumflex Uhungarumlaut -50
+KPX Acircumflex Umacron -50
+KPX Acircumflex Uogonek -50
+KPX Acircumflex Uring -50
+KPX Acircumflex V -80
+KPX Acircumflex W -60
+KPX Acircumflex Y -110
+KPX Acircumflex Yacute -110
+KPX Acircumflex Ydieresis -110
+KPX Acircumflex u -30
+KPX Acircumflex uacute -30
+KPX Acircumflex ucircumflex -30
+KPX Acircumflex udieresis -30
+KPX Acircumflex ugrave -30
+KPX Acircumflex uhungarumlaut -30
+KPX Acircumflex umacron -30
+KPX Acircumflex uogonek -30
+KPX Acircumflex uring -30
+KPX Acircumflex v -40
+KPX Acircumflex w -30
+KPX Acircumflex y -30
+KPX Acircumflex yacute -30
+KPX Acircumflex ydieresis -30
+KPX Adieresis C -40
+KPX Adieresis Cacute -40
+KPX Adieresis Ccaron -40
+KPX Adieresis Ccedilla -40
+KPX Adieresis G -50
+KPX Adieresis Gbreve -50
+KPX Adieresis Gcommaaccent -50
+KPX Adieresis O -40
+KPX Adieresis Oacute -40
+KPX Adieresis Ocircumflex -40
+KPX Adieresis Odieresis -40
+KPX Adieresis Ograve -40
+KPX Adieresis Ohungarumlaut -40
+KPX Adieresis Omacron -40
+KPX Adieresis Oslash -40
+KPX Adieresis Otilde -40
+KPX Adieresis Q -40
+KPX Adieresis T -90
+KPX Adieresis Tcaron -90
+KPX Adieresis Tcommaaccent -90
+KPX Adieresis U -50
+KPX Adieresis Uacute -50
+KPX Adieresis Ucircumflex -50
+KPX Adieresis Udieresis -50
+KPX Adieresis Ugrave -50
+KPX Adieresis Uhungarumlaut -50
+KPX Adieresis Umacron -50
+KPX Adieresis Uogonek -50
+KPX Adieresis Uring -50
+KPX Adieresis V -80
+KPX Adieresis W -60
+KPX Adieresis Y -110
+KPX Adieresis Yacute -110
+KPX Adieresis Ydieresis -110
+KPX Adieresis u -30
+KPX Adieresis uacute -30
+KPX Adieresis ucircumflex -30
+KPX Adieresis udieresis -30
+KPX Adieresis ugrave -30
+KPX Adieresis uhungarumlaut -30
+KPX Adieresis umacron -30
+KPX Adieresis uogonek -30
+KPX Adieresis uring -30
+KPX Adieresis v -40
+KPX Adieresis w -30
+KPX Adieresis y -30
+KPX Adieresis yacute -30
+KPX Adieresis ydieresis -30
+KPX Agrave C -40
+KPX Agrave Cacute -40
+KPX Agrave Ccaron -40
+KPX Agrave Ccedilla -40
+KPX Agrave G -50
+KPX Agrave Gbreve -50
+KPX Agrave Gcommaaccent -50
+KPX Agrave O -40
+KPX Agrave Oacute -40
+KPX Agrave Ocircumflex -40
+KPX Agrave Odieresis -40
+KPX Agrave Ograve -40
+KPX Agrave Ohungarumlaut -40
+KPX Agrave Omacron -40
+KPX Agrave Oslash -40
+KPX Agrave Otilde -40
+KPX Agrave Q -40
+KPX Agrave T -90
+KPX Agrave Tcaron -90
+KPX Agrave Tcommaaccent -90
+KPX Agrave U -50
+KPX Agrave Uacute -50
+KPX Agrave Ucircumflex -50
+KPX Agrave Udieresis -50
+KPX Agrave Ugrave -50
+KPX Agrave Uhungarumlaut -50
+KPX Agrave Umacron -50
+KPX Agrave Uogonek -50
+KPX Agrave Uring -50
+KPX Agrave V -80
+KPX Agrave W -60
+KPX Agrave Y -110
+KPX Agrave Yacute -110
+KPX Agrave Ydieresis -110
+KPX Agrave u -30
+KPX Agrave uacute -30
+KPX Agrave ucircumflex -30
+KPX Agrave udieresis -30
+KPX Agrave ugrave -30
+KPX Agrave uhungarumlaut -30
+KPX Agrave umacron -30
+KPX Agrave uogonek -30
+KPX Agrave uring -30
+KPX Agrave v -40
+KPX Agrave w -30
+KPX Agrave y -30
+KPX Agrave yacute -30
+KPX Agrave ydieresis -30
+KPX Amacron C -40
+KPX Amacron Cacute -40
+KPX Amacron Ccaron -40
+KPX Amacron Ccedilla -40
+KPX Amacron G -50
+KPX Amacron Gbreve -50
+KPX Amacron Gcommaaccent -50
+KPX Amacron O -40
+KPX Amacron Oacute -40
+KPX Amacron Ocircumflex -40
+KPX Amacron Odieresis -40
+KPX Amacron Ograve -40
+KPX Amacron Ohungarumlaut -40
+KPX Amacron Omacron -40
+KPX Amacron Oslash -40
+KPX Amacron Otilde -40
+KPX Amacron Q -40
+KPX Amacron T -90
+KPX Amacron Tcaron -90
+KPX Amacron Tcommaaccent -90
+KPX Amacron U -50
+KPX Amacron Uacute -50
+KPX Amacron Ucircumflex -50
+KPX Amacron Udieresis -50
+KPX Amacron Ugrave -50
+KPX Amacron Uhungarumlaut -50
+KPX Amacron Umacron -50
+KPX Amacron Uogonek -50
+KPX Amacron Uring -50
+KPX Amacron V -80
+KPX Amacron W -60
+KPX Amacron Y -110
+KPX Amacron Yacute -110
+KPX Amacron Ydieresis -110
+KPX Amacron u -30
+KPX Amacron uacute -30
+KPX Amacron ucircumflex -30
+KPX Amacron udieresis -30
+KPX Amacron ugrave -30
+KPX Amacron uhungarumlaut -30
+KPX Amacron umacron -30
+KPX Amacron uogonek -30
+KPX Amacron uring -30
+KPX Amacron v -40
+KPX Amacron w -30
+KPX Amacron y -30
+KPX Amacron yacute -30
+KPX Amacron ydieresis -30
+KPX Aogonek C -40
+KPX Aogonek Cacute -40
+KPX Aogonek Ccaron -40
+KPX Aogonek Ccedilla -40
+KPX Aogonek G -50
+KPX Aogonek Gbreve -50
+KPX Aogonek Gcommaaccent -50
+KPX Aogonek O -40
+KPX Aogonek Oacute -40
+KPX Aogonek Ocircumflex -40
+KPX Aogonek Odieresis -40
+KPX Aogonek Ograve -40
+KPX Aogonek Ohungarumlaut -40
+KPX Aogonek Omacron -40
+KPX Aogonek Oslash -40
+KPX Aogonek Otilde -40
+KPX Aogonek Q -40
+KPX Aogonek T -90
+KPX Aogonek Tcaron -90
+KPX Aogonek Tcommaaccent -90
+KPX Aogonek U -50
+KPX Aogonek Uacute -50
+KPX Aogonek Ucircumflex -50
+KPX Aogonek Udieresis -50
+KPX Aogonek Ugrave -50
+KPX Aogonek Uhungarumlaut -50
+KPX Aogonek Umacron -50
+KPX Aogonek Uogonek -50
+KPX Aogonek Uring -50
+KPX Aogonek V -80
+KPX Aogonek W -60
+KPX Aogonek Y -110
+KPX Aogonek Yacute -110
+KPX Aogonek Ydieresis -110
+KPX Aogonek u -30
+KPX Aogonek uacute -30
+KPX Aogonek ucircumflex -30
+KPX Aogonek udieresis -30
+KPX Aogonek ugrave -30
+KPX Aogonek uhungarumlaut -30
+KPX Aogonek umacron -30
+KPX Aogonek uogonek -30
+KPX Aogonek uring -30
+KPX Aogonek v -40
+KPX Aogonek w -30
+KPX Aogonek y -30
+KPX Aogonek yacute -30
+KPX Aogonek ydieresis -30
+KPX Aring C -40
+KPX Aring Cacute -40
+KPX Aring Ccaron -40
+KPX Aring Ccedilla -40
+KPX Aring G -50
+KPX Aring Gbreve -50
+KPX Aring Gcommaaccent -50
+KPX Aring O -40
+KPX Aring Oacute -40
+KPX Aring Ocircumflex -40
+KPX Aring Odieresis -40
+KPX Aring Ograve -40
+KPX Aring Ohungarumlaut -40
+KPX Aring Omacron -40
+KPX Aring Oslash -40
+KPX Aring Otilde -40
+KPX Aring Q -40
+KPX Aring T -90
+KPX Aring Tcaron -90
+KPX Aring Tcommaaccent -90
+KPX Aring U -50
+KPX Aring Uacute -50
+KPX Aring Ucircumflex -50
+KPX Aring Udieresis -50
+KPX Aring Ugrave -50
+KPX Aring Uhungarumlaut -50
+KPX Aring Umacron -50
+KPX Aring Uogonek -50
+KPX Aring Uring -50
+KPX Aring V -80
+KPX Aring W -60
+KPX Aring Y -110
+KPX Aring Yacute -110
+KPX Aring Ydieresis -110
+KPX Aring u -30
+KPX Aring uacute -30
+KPX Aring ucircumflex -30
+KPX Aring udieresis -30
+KPX Aring ugrave -30
+KPX Aring uhungarumlaut -30
+KPX Aring umacron -30
+KPX Aring uogonek -30
+KPX Aring uring -30
+KPX Aring v -40
+KPX Aring w -30
+KPX Aring y -30
+KPX Aring yacute -30
+KPX Aring ydieresis -30
+KPX Atilde C -40
+KPX Atilde Cacute -40
+KPX Atilde Ccaron -40
+KPX Atilde Ccedilla -40
+KPX Atilde G -50
+KPX Atilde Gbreve -50
+KPX Atilde Gcommaaccent -50
+KPX Atilde O -40
+KPX Atilde Oacute -40
+KPX Atilde Ocircumflex -40
+KPX Atilde Odieresis -40
+KPX Atilde Ograve -40
+KPX Atilde Ohungarumlaut -40
+KPX Atilde Omacron -40
+KPX Atilde Oslash -40
+KPX Atilde Otilde -40
+KPX Atilde Q -40
+KPX Atilde T -90
+KPX Atilde Tcaron -90
+KPX Atilde Tcommaaccent -90
+KPX Atilde U -50
+KPX Atilde Uacute -50
+KPX Atilde Ucircumflex -50
+KPX Atilde Udieresis -50
+KPX Atilde Ugrave -50
+KPX Atilde Uhungarumlaut -50
+KPX Atilde Umacron -50
+KPX Atilde Uogonek -50
+KPX Atilde Uring -50
+KPX Atilde V -80
+KPX Atilde W -60
+KPX Atilde Y -110
+KPX Atilde Yacute -110
+KPX Atilde Ydieresis -110
+KPX Atilde u -30
+KPX Atilde uacute -30
+KPX Atilde ucircumflex -30
+KPX Atilde udieresis -30
+KPX Atilde ugrave -30
+KPX Atilde uhungarumlaut -30
+KPX Atilde umacron -30
+KPX Atilde uogonek -30
+KPX Atilde uring -30
+KPX Atilde v -40
+KPX Atilde w -30
+KPX Atilde y -30
+KPX Atilde yacute -30
+KPX Atilde ydieresis -30
+KPX B A -30
+KPX B Aacute -30
+KPX B Abreve -30
+KPX B Acircumflex -30
+KPX B Adieresis -30
+KPX B Agrave -30
+KPX B Amacron -30
+KPX B Aogonek -30
+KPX B Aring -30
+KPX B Atilde -30
+KPX B U -10
+KPX B Uacute -10
+KPX B Ucircumflex -10
+KPX B Udieresis -10
+KPX B Ugrave -10
+KPX B Uhungarumlaut -10
+KPX B Umacron -10
+KPX B Uogonek -10
+KPX B Uring -10
+KPX D A -40
+KPX D Aacute -40
+KPX D Abreve -40
+KPX D Acircumflex -40
+KPX D Adieresis -40
+KPX D Agrave -40
+KPX D Amacron -40
+KPX D Aogonek -40
+KPX D Aring -40
+KPX D Atilde -40
+KPX D V -40
+KPX D W -40
+KPX D Y -70
+KPX D Yacute -70
+KPX D Ydieresis -70
+KPX D comma -30
+KPX D period -30
+KPX Dcaron A -40
+KPX Dcaron Aacute -40
+KPX Dcaron Abreve -40
+KPX Dcaron Acircumflex -40
+KPX Dcaron Adieresis -40
+KPX Dcaron Agrave -40
+KPX Dcaron Amacron -40
+KPX Dcaron Aogonek -40
+KPX Dcaron Aring -40
+KPX Dcaron Atilde -40
+KPX Dcaron V -40
+KPX Dcaron W -40
+KPX Dcaron Y -70
+KPX Dcaron Yacute -70
+KPX Dcaron Ydieresis -70
+KPX Dcaron comma -30
+KPX Dcaron period -30
+KPX Dcroat A -40
+KPX Dcroat Aacute -40
+KPX Dcroat Abreve -40
+KPX Dcroat Acircumflex -40
+KPX Dcroat Adieresis -40
+KPX Dcroat Agrave -40
+KPX Dcroat Amacron -40
+KPX Dcroat Aogonek -40
+KPX Dcroat Aring -40
+KPX Dcroat Atilde -40
+KPX Dcroat V -40
+KPX Dcroat W -40
+KPX Dcroat Y -70
+KPX Dcroat Yacute -70
+KPX Dcroat Ydieresis -70
+KPX Dcroat comma -30
+KPX Dcroat period -30
+KPX F A -80
+KPX F Aacute -80
+KPX F Abreve -80
+KPX F Acircumflex -80
+KPX F Adieresis -80
+KPX F Agrave -80
+KPX F Amacron -80
+KPX F Aogonek -80
+KPX F Aring -80
+KPX F Atilde -80
+KPX F a -20
+KPX F aacute -20
+KPX F abreve -20
+KPX F acircumflex -20
+KPX F adieresis -20
+KPX F agrave -20
+KPX F amacron -20
+KPX F aogonek -20
+KPX F aring -20
+KPX F atilde -20
+KPX F comma -100
+KPX F period -100
+KPX J A -20
+KPX J Aacute -20
+KPX J Abreve -20
+KPX J Acircumflex -20
+KPX J Adieresis -20
+KPX J Agrave -20
+KPX J Amacron -20
+KPX J Aogonek -20
+KPX J Aring -20
+KPX J Atilde -20
+KPX J comma -20
+KPX J period -20
+KPX J u -20
+KPX J uacute -20
+KPX J ucircumflex -20
+KPX J udieresis -20
+KPX J ugrave -20
+KPX J uhungarumlaut -20
+KPX J umacron -20
+KPX J uogonek -20
+KPX J uring -20
+KPX K O -30
+KPX K Oacute -30
+KPX K Ocircumflex -30
+KPX K Odieresis -30
+KPX K Ograve -30
+KPX K Ohungarumlaut -30
+KPX K Omacron -30
+KPX K Oslash -30
+KPX K Otilde -30
+KPX K e -15
+KPX K eacute -15
+KPX K ecaron -15
+KPX K ecircumflex -15
+KPX K edieresis -15
+KPX K edotaccent -15
+KPX K egrave -15
+KPX K emacron -15
+KPX K eogonek -15
+KPX K o -35
+KPX K oacute -35
+KPX K ocircumflex -35
+KPX K odieresis -35
+KPX K ograve -35
+KPX K ohungarumlaut -35
+KPX K omacron -35
+KPX K oslash -35
+KPX K otilde -35
+KPX K u -30
+KPX K uacute -30
+KPX K ucircumflex -30
+KPX K udieresis -30
+KPX K ugrave -30
+KPX K uhungarumlaut -30
+KPX K umacron -30
+KPX K uogonek -30
+KPX K uring -30
+KPX K y -40
+KPX K yacute -40
+KPX K ydieresis -40
+KPX Kcommaaccent O -30
+KPX Kcommaaccent Oacute -30
+KPX Kcommaaccent Ocircumflex -30
+KPX Kcommaaccent Odieresis -30
+KPX Kcommaaccent Ograve -30
+KPX Kcommaaccent Ohungarumlaut -30
+KPX Kcommaaccent Omacron -30
+KPX Kcommaaccent Oslash -30
+KPX Kcommaaccent Otilde -30
+KPX Kcommaaccent e -15
+KPX Kcommaaccent eacute -15
+KPX Kcommaaccent ecaron -15
+KPX Kcommaaccent ecircumflex -15
+KPX Kcommaaccent edieresis -15
+KPX Kcommaaccent edotaccent -15
+KPX Kcommaaccent egrave -15
+KPX Kcommaaccent emacron -15
+KPX Kcommaaccent eogonek -15
+KPX Kcommaaccent o -35
+KPX Kcommaaccent oacute -35
+KPX Kcommaaccent ocircumflex -35
+KPX Kcommaaccent odieresis -35
+KPX Kcommaaccent ograve -35
+KPX Kcommaaccent ohungarumlaut -35
+KPX Kcommaaccent omacron -35
+KPX Kcommaaccent oslash -35
+KPX Kcommaaccent otilde -35
+KPX Kcommaaccent u -30
+KPX Kcommaaccent uacute -30
+KPX Kcommaaccent ucircumflex -30
+KPX Kcommaaccent udieresis -30
+KPX Kcommaaccent ugrave -30
+KPX Kcommaaccent uhungarumlaut -30
+KPX Kcommaaccent umacron -30
+KPX Kcommaaccent uogonek -30
+KPX Kcommaaccent uring -30
+KPX Kcommaaccent y -40
+KPX Kcommaaccent yacute -40
+KPX Kcommaaccent ydieresis -40
+KPX L T -90
+KPX L Tcaron -90
+KPX L Tcommaaccent -90
+KPX L V -110
+KPX L W -80
+KPX L Y -120
+KPX L Yacute -120
+KPX L Ydieresis -120
+KPX L quotedblright -140
+KPX L quoteright -140
+KPX L y -30
+KPX L yacute -30
+KPX L ydieresis -30
+KPX Lacute T -90
+KPX Lacute Tcaron -90
+KPX Lacute Tcommaaccent -90
+KPX Lacute V -110
+KPX Lacute W -80
+KPX Lacute Y -120
+KPX Lacute Yacute -120
+KPX Lacute Ydieresis -120
+KPX Lacute quotedblright -140
+KPX Lacute quoteright -140
+KPX Lacute y -30
+KPX Lacute yacute -30
+KPX Lacute ydieresis -30
+KPX Lcommaaccent T -90
+KPX Lcommaaccent Tcaron -90
+KPX Lcommaaccent Tcommaaccent -90
+KPX Lcommaaccent V -110
+KPX Lcommaaccent W -80
+KPX Lcommaaccent Y -120
+KPX Lcommaaccent Yacute -120
+KPX Lcommaaccent Ydieresis -120
+KPX Lcommaaccent quotedblright -140
+KPX Lcommaaccent quoteright -140
+KPX Lcommaaccent y -30
+KPX Lcommaaccent yacute -30
+KPX Lcommaaccent ydieresis -30
+KPX Lslash T -90
+KPX Lslash Tcaron -90
+KPX Lslash Tcommaaccent -90
+KPX Lslash V -110
+KPX Lslash W -80
+KPX Lslash Y -120
+KPX Lslash Yacute -120
+KPX Lslash Ydieresis -120
+KPX Lslash quotedblright -140
+KPX Lslash quoteright -140
+KPX Lslash y -30
+KPX Lslash yacute -30
+KPX Lslash ydieresis -30
+KPX O A -50
+KPX O Aacute -50
+KPX O Abreve -50
+KPX O Acircumflex -50
+KPX O Adieresis -50
+KPX O Agrave -50
+KPX O Amacron -50
+KPX O Aogonek -50
+KPX O Aring -50
+KPX O Atilde -50
+KPX O T -40
+KPX O Tcaron -40
+KPX O Tcommaaccent -40
+KPX O V -50
+KPX O W -50
+KPX O X -50
+KPX O Y -70
+KPX O Yacute -70
+KPX O Ydieresis -70
+KPX O comma -40
+KPX O period -40
+KPX Oacute A -50
+KPX Oacute Aacute -50
+KPX Oacute Abreve -50
+KPX Oacute Acircumflex -50
+KPX Oacute Adieresis -50
+KPX Oacute Agrave -50
+KPX Oacute Amacron -50
+KPX Oacute Aogonek -50
+KPX Oacute Aring -50
+KPX Oacute Atilde -50
+KPX Oacute T -40
+KPX Oacute Tcaron -40
+KPX Oacute Tcommaaccent -40
+KPX Oacute V -50
+KPX Oacute W -50
+KPX Oacute X -50
+KPX Oacute Y -70
+KPX Oacute Yacute -70
+KPX Oacute Ydieresis -70
+KPX Oacute comma -40
+KPX Oacute period -40
+KPX Ocircumflex A -50
+KPX Ocircumflex Aacute -50
+KPX Ocircumflex Abreve -50
+KPX Ocircumflex Acircumflex -50
+KPX Ocircumflex Adieresis -50
+KPX Ocircumflex Agrave -50
+KPX Ocircumflex Amacron -50
+KPX Ocircumflex Aogonek -50
+KPX Ocircumflex Aring -50
+KPX Ocircumflex Atilde -50
+KPX Ocircumflex T -40
+KPX Ocircumflex Tcaron -40
+KPX Ocircumflex Tcommaaccent -40
+KPX Ocircumflex V -50
+KPX Ocircumflex W -50
+KPX Ocircumflex X -50
+KPX Ocircumflex Y -70
+KPX Ocircumflex Yacute -70
+KPX Ocircumflex Ydieresis -70
+KPX Ocircumflex comma -40
+KPX Ocircumflex period -40
+KPX Odieresis A -50
+KPX Odieresis Aacute -50
+KPX Odieresis Abreve -50
+KPX Odieresis Acircumflex -50
+KPX Odieresis Adieresis -50
+KPX Odieresis Agrave -50
+KPX Odieresis Amacron -50
+KPX Odieresis Aogonek -50
+KPX Odieresis Aring -50
+KPX Odieresis Atilde -50
+KPX Odieresis T -40
+KPX Odieresis Tcaron -40
+KPX Odieresis Tcommaaccent -40
+KPX Odieresis V -50
+KPX Odieresis W -50
+KPX Odieresis X -50
+KPX Odieresis Y -70
+KPX Odieresis Yacute -70
+KPX Odieresis Ydieresis -70
+KPX Odieresis comma -40
+KPX Odieresis period -40
+KPX Ograve A -50
+KPX Ograve Aacute -50
+KPX Ograve Abreve -50
+KPX Ograve Acircumflex -50
+KPX Ograve Adieresis -50
+KPX Ograve Agrave -50
+KPX Ograve Amacron -50
+KPX Ograve Aogonek -50
+KPX Ograve Aring -50
+KPX Ograve Atilde -50
+KPX Ograve T -40
+KPX Ograve Tcaron -40
+KPX Ograve Tcommaaccent -40
+KPX Ograve V -50
+KPX Ograve W -50
+KPX Ograve X -50
+KPX Ograve Y -70
+KPX Ograve Yacute -70
+KPX Ograve Ydieresis -70
+KPX Ograve comma -40
+KPX Ograve period -40
+KPX Ohungarumlaut A -50
+KPX Ohungarumlaut Aacute -50
+KPX Ohungarumlaut Abreve -50
+KPX Ohungarumlaut Acircumflex -50
+KPX Ohungarumlaut Adieresis -50
+KPX Ohungarumlaut Agrave -50
+KPX Ohungarumlaut Amacron -50
+KPX Ohungarumlaut Aogonek -50
+KPX Ohungarumlaut Aring -50
+KPX Ohungarumlaut Atilde -50
+KPX Ohungarumlaut T -40
+KPX Ohungarumlaut Tcaron -40
+KPX Ohungarumlaut Tcommaaccent -40
+KPX Ohungarumlaut V -50
+KPX Ohungarumlaut W -50
+KPX Ohungarumlaut X -50
+KPX Ohungarumlaut Y -70
+KPX Ohungarumlaut Yacute -70
+KPX Ohungarumlaut Ydieresis -70
+KPX Ohungarumlaut comma -40
+KPX Ohungarumlaut period -40
+KPX Omacron A -50
+KPX Omacron Aacute -50
+KPX Omacron Abreve -50
+KPX Omacron Acircumflex -50
+KPX Omacron Adieresis -50
+KPX Omacron Agrave -50
+KPX Omacron Amacron -50
+KPX Omacron Aogonek -50
+KPX Omacron Aring -50
+KPX Omacron Atilde -50
+KPX Omacron T -40
+KPX Omacron Tcaron -40
+KPX Omacron Tcommaaccent -40
+KPX Omacron V -50
+KPX Omacron W -50
+KPX Omacron X -50
+KPX Omacron Y -70
+KPX Omacron Yacute -70
+KPX Omacron Ydieresis -70
+KPX Omacron comma -40
+KPX Omacron period -40
+KPX Oslash A -50
+KPX Oslash Aacute -50
+KPX Oslash Abreve -50
+KPX Oslash Acircumflex -50
+KPX Oslash Adieresis -50
+KPX Oslash Agrave -50
+KPX Oslash Amacron -50
+KPX Oslash Aogonek -50
+KPX Oslash Aring -50
+KPX Oslash Atilde -50
+KPX Oslash T -40
+KPX Oslash Tcaron -40
+KPX Oslash Tcommaaccent -40
+KPX Oslash V -50
+KPX Oslash W -50
+KPX Oslash X -50
+KPX Oslash Y -70
+KPX Oslash Yacute -70
+KPX Oslash Ydieresis -70
+KPX Oslash comma -40
+KPX Oslash period -40
+KPX Otilde A -50
+KPX Otilde Aacute -50
+KPX Otilde Abreve -50
+KPX Otilde Acircumflex -50
+KPX Otilde Adieresis -50
+KPX Otilde Agrave -50
+KPX Otilde Amacron -50
+KPX Otilde Aogonek -50
+KPX Otilde Aring -50
+KPX Otilde Atilde -50
+KPX Otilde T -40
+KPX Otilde Tcaron -40
+KPX Otilde Tcommaaccent -40
+KPX Otilde V -50
+KPX Otilde W -50
+KPX Otilde X -50
+KPX Otilde Y -70
+KPX Otilde Yacute -70
+KPX Otilde Ydieresis -70
+KPX Otilde comma -40
+KPX Otilde period -40
+KPX P A -100
+KPX P Aacute -100
+KPX P Abreve -100
+KPX P Acircumflex -100
+KPX P Adieresis -100
+KPX P Agrave -100
+KPX P Amacron -100
+KPX P Aogonek -100
+KPX P Aring -100
+KPX P Atilde -100
+KPX P a -30
+KPX P aacute -30
+KPX P abreve -30
+KPX P acircumflex -30
+KPX P adieresis -30
+KPX P agrave -30
+KPX P amacron -30
+KPX P aogonek -30
+KPX P aring -30
+KPX P atilde -30
+KPX P comma -120
+KPX P e -30
+KPX P eacute -30
+KPX P ecaron -30
+KPX P ecircumflex -30
+KPX P edieresis -30
+KPX P edotaccent -30
+KPX P egrave -30
+KPX P emacron -30
+KPX P eogonek -30
+KPX P o -40
+KPX P oacute -40
+KPX P ocircumflex -40
+KPX P odieresis -40
+KPX P ograve -40
+KPX P ohungarumlaut -40
+KPX P omacron -40
+KPX P oslash -40
+KPX P otilde -40
+KPX P period -120
+KPX Q U -10
+KPX Q Uacute -10
+KPX Q Ucircumflex -10
+KPX Q Udieresis -10
+KPX Q Ugrave -10
+KPX Q Uhungarumlaut -10
+KPX Q Umacron -10
+KPX Q Uogonek -10
+KPX Q Uring -10
+KPX Q comma 20
+KPX Q period 20
+KPX R O -20
+KPX R Oacute -20
+KPX R Ocircumflex -20
+KPX R Odieresis -20
+KPX R Ograve -20
+KPX R Ohungarumlaut -20
+KPX R Omacron -20
+KPX R Oslash -20
+KPX R Otilde -20
+KPX R T -20
+KPX R Tcaron -20
+KPX R Tcommaaccent -20
+KPX R U -20
+KPX R Uacute -20
+KPX R Ucircumflex -20
+KPX R Udieresis -20
+KPX R Ugrave -20
+KPX R Uhungarumlaut -20
+KPX R Umacron -20
+KPX R Uogonek -20
+KPX R Uring -20
+KPX R V -50
+KPX R W -40
+KPX R Y -50
+KPX R Yacute -50
+KPX R Ydieresis -50
+KPX Racute O -20
+KPX Racute Oacute -20
+KPX Racute Ocircumflex -20
+KPX Racute Odieresis -20
+KPX Racute Ograve -20
+KPX Racute Ohungarumlaut -20
+KPX Racute Omacron -20
+KPX Racute Oslash -20
+KPX Racute Otilde -20
+KPX Racute T -20
+KPX Racute Tcaron -20
+KPX Racute Tcommaaccent -20
+KPX Racute U -20
+KPX Racute Uacute -20
+KPX Racute Ucircumflex -20
+KPX Racute Udieresis -20
+KPX Racute Ugrave -20
+KPX Racute Uhungarumlaut -20
+KPX Racute Umacron -20
+KPX Racute Uogonek -20
+KPX Racute Uring -20
+KPX Racute V -50
+KPX Racute W -40
+KPX Racute Y -50
+KPX Racute Yacute -50
+KPX Racute Ydieresis -50
+KPX Rcaron O -20
+KPX Rcaron Oacute -20
+KPX Rcaron Ocircumflex -20
+KPX Rcaron Odieresis -20
+KPX Rcaron Ograve -20
+KPX Rcaron Ohungarumlaut -20
+KPX Rcaron Omacron -20
+KPX Rcaron Oslash -20
+KPX Rcaron Otilde -20
+KPX Rcaron T -20
+KPX Rcaron Tcaron -20
+KPX Rcaron Tcommaaccent -20
+KPX Rcaron U -20
+KPX Rcaron Uacute -20
+KPX Rcaron Ucircumflex -20
+KPX Rcaron Udieresis -20
+KPX Rcaron Ugrave -20
+KPX Rcaron Uhungarumlaut -20
+KPX Rcaron Umacron -20
+KPX Rcaron Uogonek -20
+KPX Rcaron Uring -20
+KPX Rcaron V -50
+KPX Rcaron W -40
+KPX Rcaron Y -50
+KPX Rcaron Yacute -50
+KPX Rcaron Ydieresis -50
+KPX Rcommaaccent O -20
+KPX Rcommaaccent Oacute -20
+KPX Rcommaaccent Ocircumflex -20
+KPX Rcommaaccent Odieresis -20
+KPX Rcommaaccent Ograve -20
+KPX Rcommaaccent Ohungarumlaut -20
+KPX Rcommaaccent Omacron -20
+KPX Rcommaaccent Oslash -20
+KPX Rcommaaccent Otilde -20
+KPX Rcommaaccent T -20
+KPX Rcommaaccent Tcaron -20
+KPX Rcommaaccent Tcommaaccent -20
+KPX Rcommaaccent U -20
+KPX Rcommaaccent Uacute -20
+KPX Rcommaaccent Ucircumflex -20
+KPX Rcommaaccent Udieresis -20
+KPX Rcommaaccent Ugrave -20
+KPX Rcommaaccent Uhungarumlaut -20
+KPX Rcommaaccent Umacron -20
+KPX Rcommaaccent Uogonek -20
+KPX Rcommaaccent Uring -20
+KPX Rcommaaccent V -50
+KPX Rcommaaccent W -40
+KPX Rcommaaccent Y -50
+KPX Rcommaaccent Yacute -50
+KPX Rcommaaccent Ydieresis -50
+KPX T A -90
+KPX T Aacute -90
+KPX T Abreve -90
+KPX T Acircumflex -90
+KPX T Adieresis -90
+KPX T Agrave -90
+KPX T Amacron -90
+KPX T Aogonek -90
+KPX T Aring -90
+KPX T Atilde -90
+KPX T O -40
+KPX T Oacute -40
+KPX T Ocircumflex -40
+KPX T Odieresis -40
+KPX T Ograve -40
+KPX T Ohungarumlaut -40
+KPX T Omacron -40
+KPX T Oslash -40
+KPX T Otilde -40
+KPX T a -80
+KPX T aacute -80
+KPX T abreve -80
+KPX T acircumflex -80
+KPX T adieresis -80
+KPX T agrave -80
+KPX T amacron -80
+KPX T aogonek -80
+KPX T aring -80
+KPX T atilde -80
+KPX T colon -40
+KPX T comma -80
+KPX T e -60
+KPX T eacute -60
+KPX T ecaron -60
+KPX T ecircumflex -60
+KPX T edieresis -60
+KPX T edotaccent -60
+KPX T egrave -60
+KPX T emacron -60
+KPX T eogonek -60
+KPX T hyphen -120
+KPX T o -80
+KPX T oacute -80
+KPX T ocircumflex -80
+KPX T odieresis -80
+KPX T ograve -80
+KPX T ohungarumlaut -80
+KPX T omacron -80
+KPX T oslash -80
+KPX T otilde -80
+KPX T period -80
+KPX T r -80
+KPX T racute -80
+KPX T rcommaaccent -80
+KPX T semicolon -40
+KPX T u -90
+KPX T uacute -90
+KPX T ucircumflex -90
+KPX T udieresis -90
+KPX T ugrave -90
+KPX T uhungarumlaut -90
+KPX T umacron -90
+KPX T uogonek -90
+KPX T uring -90
+KPX T w -60
+KPX T y -60
+KPX T yacute -60
+KPX T ydieresis -60
+KPX Tcaron A -90
+KPX Tcaron Aacute -90
+KPX Tcaron Abreve -90
+KPX Tcaron Acircumflex -90
+KPX Tcaron Adieresis -90
+KPX Tcaron Agrave -90
+KPX Tcaron Amacron -90
+KPX Tcaron Aogonek -90
+KPX Tcaron Aring -90
+KPX Tcaron Atilde -90
+KPX Tcaron O -40
+KPX Tcaron Oacute -40
+KPX Tcaron Ocircumflex -40
+KPX Tcaron Odieresis -40
+KPX Tcaron Ograve -40
+KPX Tcaron Ohungarumlaut -40
+KPX Tcaron Omacron -40
+KPX Tcaron Oslash -40
+KPX Tcaron Otilde -40
+KPX Tcaron a -80
+KPX Tcaron aacute -80
+KPX Tcaron abreve -80
+KPX Tcaron acircumflex -80
+KPX Tcaron adieresis -80
+KPX Tcaron agrave -80
+KPX Tcaron amacron -80
+KPX Tcaron aogonek -80
+KPX Tcaron aring -80
+KPX Tcaron atilde -80
+KPX Tcaron colon -40
+KPX Tcaron comma -80
+KPX Tcaron e -60
+KPX Tcaron eacute -60
+KPX Tcaron ecaron -60
+KPX Tcaron ecircumflex -60
+KPX Tcaron edieresis -60
+KPX Tcaron edotaccent -60
+KPX Tcaron egrave -60
+KPX Tcaron emacron -60
+KPX Tcaron eogonek -60
+KPX Tcaron hyphen -120
+KPX Tcaron o -80
+KPX Tcaron oacute -80
+KPX Tcaron ocircumflex -80
+KPX Tcaron odieresis -80
+KPX Tcaron ograve -80
+KPX Tcaron ohungarumlaut -80
+KPX Tcaron omacron -80
+KPX Tcaron oslash -80
+KPX Tcaron otilde -80
+KPX Tcaron period -80
+KPX Tcaron r -80
+KPX Tcaron racute -80
+KPX Tcaron rcommaaccent -80
+KPX Tcaron semicolon -40
+KPX Tcaron u -90
+KPX Tcaron uacute -90
+KPX Tcaron ucircumflex -90
+KPX Tcaron udieresis -90
+KPX Tcaron ugrave -90
+KPX Tcaron uhungarumlaut -90
+KPX Tcaron umacron -90
+KPX Tcaron uogonek -90
+KPX Tcaron uring -90
+KPX Tcaron w -60
+KPX Tcaron y -60
+KPX Tcaron yacute -60
+KPX Tcaron ydieresis -60
+KPX Tcommaaccent A -90
+KPX Tcommaaccent Aacute -90
+KPX Tcommaaccent Abreve -90
+KPX Tcommaaccent Acircumflex -90
+KPX Tcommaaccent Adieresis -90
+KPX Tcommaaccent Agrave -90
+KPX Tcommaaccent Amacron -90
+KPX Tcommaaccent Aogonek -90
+KPX Tcommaaccent Aring -90
+KPX Tcommaaccent Atilde -90
+KPX Tcommaaccent O -40
+KPX Tcommaaccent Oacute -40
+KPX Tcommaaccent Ocircumflex -40
+KPX Tcommaaccent Odieresis -40
+KPX Tcommaaccent Ograve -40
+KPX Tcommaaccent Ohungarumlaut -40
+KPX Tcommaaccent Omacron -40
+KPX Tcommaaccent Oslash -40
+KPX Tcommaaccent Otilde -40
+KPX Tcommaaccent a -80
+KPX Tcommaaccent aacute -80
+KPX Tcommaaccent abreve -80
+KPX Tcommaaccent acircumflex -80
+KPX Tcommaaccent adieresis -80
+KPX Tcommaaccent agrave -80
+KPX Tcommaaccent amacron -80
+KPX Tcommaaccent aogonek -80
+KPX Tcommaaccent aring -80
+KPX Tcommaaccent atilde -80
+KPX Tcommaaccent colon -40
+KPX Tcommaaccent comma -80
+KPX Tcommaaccent e -60
+KPX Tcommaaccent eacute -60
+KPX Tcommaaccent ecaron -60
+KPX Tcommaaccent ecircumflex -60
+KPX Tcommaaccent edieresis -60
+KPX Tcommaaccent edotaccent -60
+KPX Tcommaaccent egrave -60
+KPX Tcommaaccent emacron -60
+KPX Tcommaaccent eogonek -60
+KPX Tcommaaccent hyphen -120
+KPX Tcommaaccent o -80
+KPX Tcommaaccent oacute -80
+KPX Tcommaaccent ocircumflex -80
+KPX Tcommaaccent odieresis -80
+KPX Tcommaaccent ograve -80
+KPX Tcommaaccent ohungarumlaut -80
+KPX Tcommaaccent omacron -80
+KPX Tcommaaccent oslash -80
+KPX Tcommaaccent otilde -80
+KPX Tcommaaccent period -80
+KPX Tcommaaccent r -80
+KPX Tcommaaccent racute -80
+KPX Tcommaaccent rcommaaccent -80
+KPX Tcommaaccent semicolon -40
+KPX Tcommaaccent u -90
+KPX Tcommaaccent uacute -90
+KPX Tcommaaccent ucircumflex -90
+KPX Tcommaaccent udieresis -90
+KPX Tcommaaccent ugrave -90
+KPX Tcommaaccent uhungarumlaut -90
+KPX Tcommaaccent umacron -90
+KPX Tcommaaccent uogonek -90
+KPX Tcommaaccent uring -90
+KPX Tcommaaccent w -60
+KPX Tcommaaccent y -60
+KPX Tcommaaccent yacute -60
+KPX Tcommaaccent ydieresis -60
+KPX U A -50
+KPX U Aacute -50
+KPX U Abreve -50
+KPX U Acircumflex -50
+KPX U Adieresis -50
+KPX U Agrave -50
+KPX U Amacron -50
+KPX U Aogonek -50
+KPX U Aring -50
+KPX U Atilde -50
+KPX U comma -30
+KPX U period -30
+KPX Uacute A -50
+KPX Uacute Aacute -50
+KPX Uacute Abreve -50
+KPX Uacute Acircumflex -50
+KPX Uacute Adieresis -50
+KPX Uacute Agrave -50
+KPX Uacute Amacron -50
+KPX Uacute Aogonek -50
+KPX Uacute Aring -50
+KPX Uacute Atilde -50
+KPX Uacute comma -30
+KPX Uacute period -30
+KPX Ucircumflex A -50
+KPX Ucircumflex Aacute -50
+KPX Ucircumflex Abreve -50
+KPX Ucircumflex Acircumflex -50
+KPX Ucircumflex Adieresis -50
+KPX Ucircumflex Agrave -50
+KPX Ucircumflex Amacron -50
+KPX Ucircumflex Aogonek -50
+KPX Ucircumflex Aring -50
+KPX Ucircumflex Atilde -50
+KPX Ucircumflex comma -30
+KPX Ucircumflex period -30
+KPX Udieresis A -50
+KPX Udieresis Aacute -50
+KPX Udieresis Abreve -50
+KPX Udieresis Acircumflex -50
+KPX Udieresis Adieresis -50
+KPX Udieresis Agrave -50
+KPX Udieresis Amacron -50
+KPX Udieresis Aogonek -50
+KPX Udieresis Aring -50
+KPX Udieresis Atilde -50
+KPX Udieresis comma -30
+KPX Udieresis period -30
+KPX Ugrave A -50
+KPX Ugrave Aacute -50
+KPX Ugrave Abreve -50
+KPX Ugrave Acircumflex -50
+KPX Ugrave Adieresis -50
+KPX Ugrave Agrave -50
+KPX Ugrave Amacron -50
+KPX Ugrave Aogonek -50
+KPX Ugrave Aring -50
+KPX Ugrave Atilde -50
+KPX Ugrave comma -30
+KPX Ugrave period -30
+KPX Uhungarumlaut A -50
+KPX Uhungarumlaut Aacute -50
+KPX Uhungarumlaut Abreve -50
+KPX Uhungarumlaut Acircumflex -50
+KPX Uhungarumlaut Adieresis -50
+KPX Uhungarumlaut Agrave -50
+KPX Uhungarumlaut Amacron -50
+KPX Uhungarumlaut Aogonek -50
+KPX Uhungarumlaut Aring -50
+KPX Uhungarumlaut Atilde -50
+KPX Uhungarumlaut comma -30
+KPX Uhungarumlaut period -30
+KPX Umacron A -50
+KPX Umacron Aacute -50
+KPX Umacron Abreve -50
+KPX Umacron Acircumflex -50
+KPX Umacron Adieresis -50
+KPX Umacron Agrave -50
+KPX Umacron Amacron -50
+KPX Umacron Aogonek -50
+KPX Umacron Aring -50
+KPX Umacron Atilde -50
+KPX Umacron comma -30
+KPX Umacron period -30
+KPX Uogonek A -50
+KPX Uogonek Aacute -50
+KPX Uogonek Abreve -50
+KPX Uogonek Acircumflex -50
+KPX Uogonek Adieresis -50
+KPX Uogonek Agrave -50
+KPX Uogonek Amacron -50
+KPX Uogonek Aogonek -50
+KPX Uogonek Aring -50
+KPX Uogonek Atilde -50
+KPX Uogonek comma -30
+KPX Uogonek period -30
+KPX Uring A -50
+KPX Uring Aacute -50
+KPX Uring Abreve -50
+KPX Uring Acircumflex -50
+KPX Uring Adieresis -50
+KPX Uring Agrave -50
+KPX Uring Amacron -50
+KPX Uring Aogonek -50
+KPX Uring Aring -50
+KPX Uring Atilde -50
+KPX Uring comma -30
+KPX Uring period -30
+KPX V A -80
+KPX V Aacute -80
+KPX V Abreve -80
+KPX V Acircumflex -80
+KPX V Adieresis -80
+KPX V Agrave -80
+KPX V Amacron -80
+KPX V Aogonek -80
+KPX V Aring -80
+KPX V Atilde -80
+KPX V G -50
+KPX V Gbreve -50
+KPX V Gcommaaccent -50
+KPX V O -50
+KPX V Oacute -50
+KPX V Ocircumflex -50
+KPX V Odieresis -50
+KPX V Ograve -50
+KPX V Ohungarumlaut -50
+KPX V Omacron -50
+KPX V Oslash -50
+KPX V Otilde -50
+KPX V a -60
+KPX V aacute -60
+KPX V abreve -60
+KPX V acircumflex -60
+KPX V adieresis -60
+KPX V agrave -60
+KPX V amacron -60
+KPX V aogonek -60
+KPX V aring -60
+KPX V atilde -60
+KPX V colon -40
+KPX V comma -120
+KPX V e -50
+KPX V eacute -50
+KPX V ecaron -50
+KPX V ecircumflex -50
+KPX V edieresis -50
+KPX V edotaccent -50
+KPX V egrave -50
+KPX V emacron -50
+KPX V eogonek -50
+KPX V hyphen -80
+KPX V o -90
+KPX V oacute -90
+KPX V ocircumflex -90
+KPX V odieresis -90
+KPX V ograve -90
+KPX V ohungarumlaut -90
+KPX V omacron -90
+KPX V oslash -90
+KPX V otilde -90
+KPX V period -120
+KPX V semicolon -40
+KPX V u -60
+KPX V uacute -60
+KPX V ucircumflex -60
+KPX V udieresis -60
+KPX V ugrave -60
+KPX V uhungarumlaut -60
+KPX V umacron -60
+KPX V uogonek -60
+KPX V uring -60
+KPX W A -60
+KPX W Aacute -60
+KPX W Abreve -60
+KPX W Acircumflex -60
+KPX W Adieresis -60
+KPX W Agrave -60
+KPX W Amacron -60
+KPX W Aogonek -60
+KPX W Aring -60
+KPX W Atilde -60
+KPX W O -20
+KPX W Oacute -20
+KPX W Ocircumflex -20
+KPX W Odieresis -20
+KPX W Ograve -20
+KPX W Ohungarumlaut -20
+KPX W Omacron -20
+KPX W Oslash -20
+KPX W Otilde -20
+KPX W a -40
+KPX W aacute -40
+KPX W abreve -40
+KPX W acircumflex -40
+KPX W adieresis -40
+KPX W agrave -40
+KPX W amacron -40
+KPX W aogonek -40
+KPX W aring -40
+KPX W atilde -40
+KPX W colon -10
+KPX W comma -80
+KPX W e -35
+KPX W eacute -35
+KPX W ecaron -35
+KPX W ecircumflex -35
+KPX W edieresis -35
+KPX W edotaccent -35
+KPX W egrave -35
+KPX W emacron -35
+KPX W eogonek -35
+KPX W hyphen -40
+KPX W o -60
+KPX W oacute -60
+KPX W ocircumflex -60
+KPX W odieresis -60
+KPX W ograve -60
+KPX W ohungarumlaut -60
+KPX W omacron -60
+KPX W oslash -60
+KPX W otilde -60
+KPX W period -80
+KPX W semicolon -10
+KPX W u -45
+KPX W uacute -45
+KPX W ucircumflex -45
+KPX W udieresis -45
+KPX W ugrave -45
+KPX W uhungarumlaut -45
+KPX W umacron -45
+KPX W uogonek -45
+KPX W uring -45
+KPX W y -20
+KPX W yacute -20
+KPX W ydieresis -20
+KPX Y A -110
+KPX Y Aacute -110
+KPX Y Abreve -110
+KPX Y Acircumflex -110
+KPX Y Adieresis -110
+KPX Y Agrave -110
+KPX Y Amacron -110
+KPX Y Aogonek -110
+KPX Y Aring -110
+KPX Y Atilde -110
+KPX Y O -70
+KPX Y Oacute -70
+KPX Y Ocircumflex -70
+KPX Y Odieresis -70
+KPX Y Ograve -70
+KPX Y Ohungarumlaut -70
+KPX Y Omacron -70
+KPX Y Oslash -70
+KPX Y Otilde -70
+KPX Y a -90
+KPX Y aacute -90
+KPX Y abreve -90
+KPX Y acircumflex -90
+KPX Y adieresis -90
+KPX Y agrave -90
+KPX Y amacron -90
+KPX Y aogonek -90
+KPX Y aring -90
+KPX Y atilde -90
+KPX Y colon -50
+KPX Y comma -100
+KPX Y e -80
+KPX Y eacute -80
+KPX Y ecaron -80
+KPX Y ecircumflex -80
+KPX Y edieresis -80
+KPX Y edotaccent -80
+KPX Y egrave -80
+KPX Y emacron -80
+KPX Y eogonek -80
+KPX Y o -100
+KPX Y oacute -100
+KPX Y ocircumflex -100
+KPX Y odieresis -100
+KPX Y ograve -100
+KPX Y ohungarumlaut -100
+KPX Y omacron -100
+KPX Y oslash -100
+KPX Y otilde -100
+KPX Y period -100
+KPX Y semicolon -50
+KPX Y u -100
+KPX Y uacute -100
+KPX Y ucircumflex -100
+KPX Y udieresis -100
+KPX Y ugrave -100
+KPX Y uhungarumlaut -100
+KPX Y umacron -100
+KPX Y uogonek -100
+KPX Y uring -100
+KPX Yacute A -110
+KPX Yacute Aacute -110
+KPX Yacute Abreve -110
+KPX Yacute Acircumflex -110
+KPX Yacute Adieresis -110
+KPX Yacute Agrave -110
+KPX Yacute Amacron -110
+KPX Yacute Aogonek -110
+KPX Yacute Aring -110
+KPX Yacute Atilde -110
+KPX Yacute O -70
+KPX Yacute Oacute -70
+KPX Yacute Ocircumflex -70
+KPX Yacute Odieresis -70
+KPX Yacute Ograve -70
+KPX Yacute Ohungarumlaut -70
+KPX Yacute Omacron -70
+KPX Yacute Oslash -70
+KPX Yacute Otilde -70
+KPX Yacute a -90
+KPX Yacute aacute -90
+KPX Yacute abreve -90
+KPX Yacute acircumflex -90
+KPX Yacute adieresis -90
+KPX Yacute agrave -90
+KPX Yacute amacron -90
+KPX Yacute aogonek -90
+KPX Yacute aring -90
+KPX Yacute atilde -90
+KPX Yacute colon -50
+KPX Yacute comma -100
+KPX Yacute e -80
+KPX Yacute eacute -80
+KPX Yacute ecaron -80
+KPX Yacute ecircumflex -80
+KPX Yacute edieresis -80
+KPX Yacute edotaccent -80
+KPX Yacute egrave -80
+KPX Yacute emacron -80
+KPX Yacute eogonek -80
+KPX Yacute o -100
+KPX Yacute oacute -100
+KPX Yacute ocircumflex -100
+KPX Yacute odieresis -100
+KPX Yacute ograve -100
+KPX Yacute ohungarumlaut -100
+KPX Yacute omacron -100
+KPX Yacute oslash -100
+KPX Yacute otilde -100
+KPX Yacute period -100
+KPX Yacute semicolon -50
+KPX Yacute u -100
+KPX Yacute uacute -100
+KPX Yacute ucircumflex -100
+KPX Yacute udieresis -100
+KPX Yacute ugrave -100
+KPX Yacute uhungarumlaut -100
+KPX Yacute umacron -100
+KPX Yacute uogonek -100
+KPX Yacute uring -100
+KPX Ydieresis A -110
+KPX Ydieresis Aacute -110
+KPX Ydieresis Abreve -110
+KPX Ydieresis Acircumflex -110
+KPX Ydieresis Adieresis -110
+KPX Ydieresis Agrave -110
+KPX Ydieresis Amacron -110
+KPX Ydieresis Aogonek -110
+KPX Ydieresis Aring -110
+KPX Ydieresis Atilde -110
+KPX Ydieresis O -70
+KPX Ydieresis Oacute -70
+KPX Ydieresis Ocircumflex -70
+KPX Ydieresis Odieresis -70
+KPX Ydieresis Ograve -70
+KPX Ydieresis Ohungarumlaut -70
+KPX Ydieresis Omacron -70
+KPX Ydieresis Oslash -70
+KPX Ydieresis Otilde -70
+KPX Ydieresis a -90
+KPX Ydieresis aacute -90
+KPX Ydieresis abreve -90
+KPX Ydieresis acircumflex -90
+KPX Ydieresis adieresis -90
+KPX Ydieresis agrave -90
+KPX Ydieresis amacron -90
+KPX Ydieresis aogonek -90
+KPX Ydieresis aring -90
+KPX Ydieresis atilde -90
+KPX Ydieresis colon -50
+KPX Ydieresis comma -100
+KPX Ydieresis e -80
+KPX Ydieresis eacute -80
+KPX Ydieresis ecaron -80
+KPX Ydieresis ecircumflex -80
+KPX Ydieresis edieresis -80
+KPX Ydieresis edotaccent -80
+KPX Ydieresis egrave -80
+KPX Ydieresis emacron -80
+KPX Ydieresis eogonek -80
+KPX Ydieresis o -100
+KPX Ydieresis oacute -100
+KPX Ydieresis ocircumflex -100
+KPX Ydieresis odieresis -100
+KPX Ydieresis ograve -100
+KPX Ydieresis ohungarumlaut -100
+KPX Ydieresis omacron -100
+KPX Ydieresis oslash -100
+KPX Ydieresis otilde -100
+KPX Ydieresis period -100
+KPX Ydieresis semicolon -50
+KPX Ydieresis u -100
+KPX Ydieresis uacute -100
+KPX Ydieresis ucircumflex -100
+KPX Ydieresis udieresis -100
+KPX Ydieresis ugrave -100
+KPX Ydieresis uhungarumlaut -100
+KPX Ydieresis umacron -100
+KPX Ydieresis uogonek -100
+KPX Ydieresis uring -100
+KPX a g -10
+KPX a gbreve -10
+KPX a gcommaaccent -10
+KPX a v -15
+KPX a w -15
+KPX a y -20
+KPX a yacute -20
+KPX a ydieresis -20
+KPX aacute g -10
+KPX aacute gbreve -10
+KPX aacute gcommaaccent -10
+KPX aacute v -15
+KPX aacute w -15
+KPX aacute y -20
+KPX aacute yacute -20
+KPX aacute ydieresis -20
+KPX abreve g -10
+KPX abreve gbreve -10
+KPX abreve gcommaaccent -10
+KPX abreve v -15
+KPX abreve w -15
+KPX abreve y -20
+KPX abreve yacute -20
+KPX abreve ydieresis -20
+KPX acircumflex g -10
+KPX acircumflex gbreve -10
+KPX acircumflex gcommaaccent -10
+KPX acircumflex v -15
+KPX acircumflex w -15
+KPX acircumflex y -20
+KPX acircumflex yacute -20
+KPX acircumflex ydieresis -20
+KPX adieresis g -10
+KPX adieresis gbreve -10
+KPX adieresis gcommaaccent -10
+KPX adieresis v -15
+KPX adieresis w -15
+KPX adieresis y -20
+KPX adieresis yacute -20
+KPX adieresis ydieresis -20
+KPX agrave g -10
+KPX agrave gbreve -10
+KPX agrave gcommaaccent -10
+KPX agrave v -15
+KPX agrave w -15
+KPX agrave y -20
+KPX agrave yacute -20
+KPX agrave ydieresis -20
+KPX amacron g -10
+KPX amacron gbreve -10
+KPX amacron gcommaaccent -10
+KPX amacron v -15
+KPX amacron w -15
+KPX amacron y -20
+KPX amacron yacute -20
+KPX amacron ydieresis -20
+KPX aogonek g -10
+KPX aogonek gbreve -10
+KPX aogonek gcommaaccent -10
+KPX aogonek v -15
+KPX aogonek w -15
+KPX aogonek y -20
+KPX aogonek yacute -20
+KPX aogonek ydieresis -20
+KPX aring g -10
+KPX aring gbreve -10
+KPX aring gcommaaccent -10
+KPX aring v -15
+KPX aring w -15
+KPX aring y -20
+KPX aring yacute -20
+KPX aring ydieresis -20
+KPX atilde g -10
+KPX atilde gbreve -10
+KPX atilde gcommaaccent -10
+KPX atilde v -15
+KPX atilde w -15
+KPX atilde y -20
+KPX atilde yacute -20
+KPX atilde ydieresis -20
+KPX b l -10
+KPX b lacute -10
+KPX b lcommaaccent -10
+KPX b lslash -10
+KPX b u -20
+KPX b uacute -20
+KPX b ucircumflex -20
+KPX b udieresis -20
+KPX b ugrave -20
+KPX b uhungarumlaut -20
+KPX b umacron -20
+KPX b uogonek -20
+KPX b uring -20
+KPX b v -20
+KPX b y -20
+KPX b yacute -20
+KPX b ydieresis -20
+KPX c h -10
+KPX c k -20
+KPX c kcommaaccent -20
+KPX c l -20
+KPX c lacute -20
+KPX c lcommaaccent -20
+KPX c lslash -20
+KPX c y -10
+KPX c yacute -10
+KPX c ydieresis -10
+KPX cacute h -10
+KPX cacute k -20
+KPX cacute kcommaaccent -20
+KPX cacute l -20
+KPX cacute lacute -20
+KPX cacute lcommaaccent -20
+KPX cacute lslash -20
+KPX cacute y -10
+KPX cacute yacute -10
+KPX cacute ydieresis -10
+KPX ccaron h -10
+KPX ccaron k -20
+KPX ccaron kcommaaccent -20
+KPX ccaron l -20
+KPX ccaron lacute -20
+KPX ccaron lcommaaccent -20
+KPX ccaron lslash -20
+KPX ccaron y -10
+KPX ccaron yacute -10
+KPX ccaron ydieresis -10
+KPX ccedilla h -10
+KPX ccedilla k -20
+KPX ccedilla kcommaaccent -20
+KPX ccedilla l -20
+KPX ccedilla lacute -20
+KPX ccedilla lcommaaccent -20
+KPX ccedilla lslash -20
+KPX ccedilla y -10
+KPX ccedilla yacute -10
+KPX ccedilla ydieresis -10
+KPX colon space -40
+KPX comma quotedblright -120
+KPX comma quoteright -120
+KPX comma space -40
+KPX d d -10
+KPX d dcroat -10
+KPX d v -15
+KPX d w -15
+KPX d y -15
+KPX d yacute -15
+KPX d ydieresis -15
+KPX dcroat d -10
+KPX dcroat dcroat -10
+KPX dcroat v -15
+KPX dcroat w -15
+KPX dcroat y -15
+KPX dcroat yacute -15
+KPX dcroat ydieresis -15
+KPX e comma 10
+KPX e period 20
+KPX e v -15
+KPX e w -15
+KPX e x -15
+KPX e y -15
+KPX e yacute -15
+KPX e ydieresis -15
+KPX eacute comma 10
+KPX eacute period 20
+KPX eacute v -15
+KPX eacute w -15
+KPX eacute x -15
+KPX eacute y -15
+KPX eacute yacute -15
+KPX eacute ydieresis -15
+KPX ecaron comma 10
+KPX ecaron period 20
+KPX ecaron v -15
+KPX ecaron w -15
+KPX ecaron x -15
+KPX ecaron y -15
+KPX ecaron yacute -15
+KPX ecaron ydieresis -15
+KPX ecircumflex comma 10
+KPX ecircumflex period 20
+KPX ecircumflex v -15
+KPX ecircumflex w -15
+KPX ecircumflex x -15
+KPX ecircumflex y -15
+KPX ecircumflex yacute -15
+KPX ecircumflex ydieresis -15
+KPX edieresis comma 10
+KPX edieresis period 20
+KPX edieresis v -15
+KPX edieresis w -15
+KPX edieresis x -15
+KPX edieresis y -15
+KPX edieresis yacute -15
+KPX edieresis ydieresis -15
+KPX edotaccent comma 10
+KPX edotaccent period 20
+KPX edotaccent v -15
+KPX edotaccent w -15
+KPX edotaccent x -15
+KPX edotaccent y -15
+KPX edotaccent yacute -15
+KPX edotaccent ydieresis -15
+KPX egrave comma 10
+KPX egrave period 20
+KPX egrave v -15
+KPX egrave w -15
+KPX egrave x -15
+KPX egrave y -15
+KPX egrave yacute -15
+KPX egrave ydieresis -15
+KPX emacron comma 10
+KPX emacron period 20
+KPX emacron v -15
+KPX emacron w -15
+KPX emacron x -15
+KPX emacron y -15
+KPX emacron yacute -15
+KPX emacron ydieresis -15
+KPX eogonek comma 10
+KPX eogonek period 20
+KPX eogonek v -15
+KPX eogonek w -15
+KPX eogonek x -15
+KPX eogonek y -15
+KPX eogonek yacute -15
+KPX eogonek ydieresis -15
+KPX f comma -10
+KPX f e -10
+KPX f eacute -10
+KPX f ecaron -10
+KPX f ecircumflex -10
+KPX f edieresis -10
+KPX f edotaccent -10
+KPX f egrave -10
+KPX f emacron -10
+KPX f eogonek -10
+KPX f o -20
+KPX f oacute -20
+KPX f ocircumflex -20
+KPX f odieresis -20
+KPX f ograve -20
+KPX f ohungarumlaut -20
+KPX f omacron -20
+KPX f oslash -20
+KPX f otilde -20
+KPX f period -10
+KPX f quotedblright 30
+KPX f quoteright 30
+KPX g e 10
+KPX g eacute 10
+KPX g ecaron 10
+KPX g ecircumflex 10
+KPX g edieresis 10
+KPX g edotaccent 10
+KPX g egrave 10
+KPX g emacron 10
+KPX g eogonek 10
+KPX g g -10
+KPX g gbreve -10
+KPX g gcommaaccent -10
+KPX gbreve e 10
+KPX gbreve eacute 10
+KPX gbreve ecaron 10
+KPX gbreve ecircumflex 10
+KPX gbreve edieresis 10
+KPX gbreve edotaccent 10
+KPX gbreve egrave 10
+KPX gbreve emacron 10
+KPX gbreve eogonek 10
+KPX gbreve g -10
+KPX gbreve gbreve -10
+KPX gbreve gcommaaccent -10
+KPX gcommaaccent e 10
+KPX gcommaaccent eacute 10
+KPX gcommaaccent ecaron 10
+KPX gcommaaccent ecircumflex 10
+KPX gcommaaccent edieresis 10
+KPX gcommaaccent edotaccent 10
+KPX gcommaaccent egrave 10
+KPX gcommaaccent emacron 10
+KPX gcommaaccent eogonek 10
+KPX gcommaaccent g -10
+KPX gcommaaccent gbreve -10
+KPX gcommaaccent gcommaaccent -10
+KPX h y -20
+KPX h yacute -20
+KPX h ydieresis -20
+KPX k o -15
+KPX k oacute -15
+KPX k ocircumflex -15
+KPX k odieresis -15
+KPX k ograve -15
+KPX k ohungarumlaut -15
+KPX k omacron -15
+KPX k oslash -15
+KPX k otilde -15
+KPX kcommaaccent o -15
+KPX kcommaaccent oacute -15
+KPX kcommaaccent ocircumflex -15
+KPX kcommaaccent odieresis -15
+KPX kcommaaccent ograve -15
+KPX kcommaaccent ohungarumlaut -15
+KPX kcommaaccent omacron -15
+KPX kcommaaccent oslash -15
+KPX kcommaaccent otilde -15
+KPX l w -15
+KPX l y -15
+KPX l yacute -15
+KPX l ydieresis -15
+KPX lacute w -15
+KPX lacute y -15
+KPX lacute yacute -15
+KPX lacute ydieresis -15
+KPX lcommaaccent w -15
+KPX lcommaaccent y -15
+KPX lcommaaccent yacute -15
+KPX lcommaaccent ydieresis -15
+KPX lslash w -15
+KPX lslash y -15
+KPX lslash yacute -15
+KPX lslash ydieresis -15
+KPX m u -20
+KPX m uacute -20
+KPX m ucircumflex -20
+KPX m udieresis -20
+KPX m ugrave -20
+KPX m uhungarumlaut -20
+KPX m umacron -20
+KPX m uogonek -20
+KPX m uring -20
+KPX m y -30
+KPX m yacute -30
+KPX m ydieresis -30
+KPX n u -10
+KPX n uacute -10
+KPX n ucircumflex -10
+KPX n udieresis -10
+KPX n ugrave -10
+KPX n uhungarumlaut -10
+KPX n umacron -10
+KPX n uogonek -10
+KPX n uring -10
+KPX n v -40
+KPX n y -20
+KPX n yacute -20
+KPX n ydieresis -20
+KPX nacute u -10
+KPX nacute uacute -10
+KPX nacute ucircumflex -10
+KPX nacute udieresis -10
+KPX nacute ugrave -10
+KPX nacute uhungarumlaut -10
+KPX nacute umacron -10
+KPX nacute uogonek -10
+KPX nacute uring -10
+KPX nacute v -40
+KPX nacute y -20
+KPX nacute yacute -20
+KPX nacute ydieresis -20
+KPX ncaron u -10
+KPX ncaron uacute -10
+KPX ncaron ucircumflex -10
+KPX ncaron udieresis -10
+KPX ncaron ugrave -10
+KPX ncaron uhungarumlaut -10
+KPX ncaron umacron -10
+KPX ncaron uogonek -10
+KPX ncaron uring -10
+KPX ncaron v -40
+KPX ncaron y -20
+KPX ncaron yacute -20
+KPX ncaron ydieresis -20
+KPX ncommaaccent u -10
+KPX ncommaaccent uacute -10
+KPX ncommaaccent ucircumflex -10
+KPX ncommaaccent udieresis -10
+KPX ncommaaccent ugrave -10
+KPX ncommaaccent uhungarumlaut -10
+KPX ncommaaccent umacron -10
+KPX ncommaaccent uogonek -10
+KPX ncommaaccent uring -10
+KPX ncommaaccent v -40
+KPX ncommaaccent y -20
+KPX ncommaaccent yacute -20
+KPX ncommaaccent ydieresis -20
+KPX ntilde u -10
+KPX ntilde uacute -10
+KPX ntilde ucircumflex -10
+KPX ntilde udieresis -10
+KPX ntilde ugrave -10
+KPX ntilde uhungarumlaut -10
+KPX ntilde umacron -10
+KPX ntilde uogonek -10
+KPX ntilde uring -10
+KPX ntilde v -40
+KPX ntilde y -20
+KPX ntilde yacute -20
+KPX ntilde ydieresis -20
+KPX o v -20
+KPX o w -15
+KPX o x -30
+KPX o y -20
+KPX o yacute -20
+KPX o ydieresis -20
+KPX oacute v -20
+KPX oacute w -15
+KPX oacute x -30
+KPX oacute y -20
+KPX oacute yacute -20
+KPX oacute ydieresis -20
+KPX ocircumflex v -20
+KPX ocircumflex w -15
+KPX ocircumflex x -30
+KPX ocircumflex y -20
+KPX ocircumflex yacute -20
+KPX ocircumflex ydieresis -20
+KPX odieresis v -20
+KPX odieresis w -15
+KPX odieresis x -30
+KPX odieresis y -20
+KPX odieresis yacute -20
+KPX odieresis ydieresis -20
+KPX ograve v -20
+KPX ograve w -15
+KPX ograve x -30
+KPX ograve y -20
+KPX ograve yacute -20
+KPX ograve ydieresis -20
+KPX ohungarumlaut v -20
+KPX ohungarumlaut w -15
+KPX ohungarumlaut x -30
+KPX ohungarumlaut y -20
+KPX ohungarumlaut yacute -20
+KPX ohungarumlaut ydieresis -20
+KPX omacron v -20
+KPX omacron w -15
+KPX omacron x -30
+KPX omacron y -20
+KPX omacron yacute -20
+KPX omacron ydieresis -20
+KPX oslash v -20
+KPX oslash w -15
+KPX oslash x -30
+KPX oslash y -20
+KPX oslash yacute -20
+KPX oslash ydieresis -20
+KPX otilde v -20
+KPX otilde w -15
+KPX otilde x -30
+KPX otilde y -20
+KPX otilde yacute -20
+KPX otilde ydieresis -20
+KPX p y -15
+KPX p yacute -15
+KPX p ydieresis -15
+KPX period quotedblright -120
+KPX period quoteright -120
+KPX period space -40
+KPX quotedblright space -80
+KPX quoteleft quoteleft -46
+KPX quoteright d -80
+KPX quoteright dcroat -80
+KPX quoteright l -20
+KPX quoteright lacute -20
+KPX quoteright lcommaaccent -20
+KPX quoteright lslash -20
+KPX quoteright quoteright -46
+KPX quoteright r -40
+KPX quoteright racute -40
+KPX quoteright rcaron -40
+KPX quoteright rcommaaccent -40
+KPX quoteright s -60
+KPX quoteright sacute -60
+KPX quoteright scaron -60
+KPX quoteright scedilla -60
+KPX quoteright scommaaccent -60
+KPX quoteright space -80
+KPX quoteright v -20
+KPX r c -20
+KPX r cacute -20
+KPX r ccaron -20
+KPX r ccedilla -20
+KPX r comma -60
+KPX r d -20
+KPX r dcroat -20
+KPX r g -15
+KPX r gbreve -15
+KPX r gcommaaccent -15
+KPX r hyphen -20
+KPX r o -20
+KPX r oacute -20
+KPX r ocircumflex -20
+KPX r odieresis -20
+KPX r ograve -20
+KPX r ohungarumlaut -20
+KPX r omacron -20
+KPX r oslash -20
+KPX r otilde -20
+KPX r period -60
+KPX r q -20
+KPX r s -15
+KPX r sacute -15
+KPX r scaron -15
+KPX r scedilla -15
+KPX r scommaaccent -15
+KPX r t 20
+KPX r tcommaaccent 20
+KPX r v 10
+KPX r y 10
+KPX r yacute 10
+KPX r ydieresis 10
+KPX racute c -20
+KPX racute cacute -20
+KPX racute ccaron -20
+KPX racute ccedilla -20
+KPX racute comma -60
+KPX racute d -20
+KPX racute dcroat -20
+KPX racute g -15
+KPX racute gbreve -15
+KPX racute gcommaaccent -15
+KPX racute hyphen -20
+KPX racute o -20
+KPX racute oacute -20
+KPX racute ocircumflex -20
+KPX racute odieresis -20
+KPX racute ograve -20
+KPX racute ohungarumlaut -20
+KPX racute omacron -20
+KPX racute oslash -20
+KPX racute otilde -20
+KPX racute period -60
+KPX racute q -20
+KPX racute s -15
+KPX racute sacute -15
+KPX racute scaron -15
+KPX racute scedilla -15
+KPX racute scommaaccent -15
+KPX racute t 20
+KPX racute tcommaaccent 20
+KPX racute v 10
+KPX racute y 10
+KPX racute yacute 10
+KPX racute ydieresis 10
+KPX rcaron c -20
+KPX rcaron cacute -20
+KPX rcaron ccaron -20
+KPX rcaron ccedilla -20
+KPX rcaron comma -60
+KPX rcaron d -20
+KPX rcaron dcroat -20
+KPX rcaron g -15
+KPX rcaron gbreve -15
+KPX rcaron gcommaaccent -15
+KPX rcaron hyphen -20
+KPX rcaron o -20
+KPX rcaron oacute -20
+KPX rcaron ocircumflex -20
+KPX rcaron odieresis -20
+KPX rcaron ograve -20
+KPX rcaron ohungarumlaut -20
+KPX rcaron omacron -20
+KPX rcaron oslash -20
+KPX rcaron otilde -20
+KPX rcaron period -60
+KPX rcaron q -20
+KPX rcaron s -15
+KPX rcaron sacute -15
+KPX rcaron scaron -15
+KPX rcaron scedilla -15
+KPX rcaron scommaaccent -15
+KPX rcaron t 20
+KPX rcaron tcommaaccent 20
+KPX rcaron v 10
+KPX rcaron y 10
+KPX rcaron yacute 10
+KPX rcaron ydieresis 10
+KPX rcommaaccent c -20
+KPX rcommaaccent cacute -20
+KPX rcommaaccent ccaron -20
+KPX rcommaaccent ccedilla -20
+KPX rcommaaccent comma -60
+KPX rcommaaccent d -20
+KPX rcommaaccent dcroat -20
+KPX rcommaaccent g -15
+KPX rcommaaccent gbreve -15
+KPX rcommaaccent gcommaaccent -15
+KPX rcommaaccent hyphen -20
+KPX rcommaaccent o -20
+KPX rcommaaccent oacute -20
+KPX rcommaaccent ocircumflex -20
+KPX rcommaaccent odieresis -20
+KPX rcommaaccent ograve -20
+KPX rcommaaccent ohungarumlaut -20
+KPX rcommaaccent omacron -20
+KPX rcommaaccent oslash -20
+KPX rcommaaccent otilde -20
+KPX rcommaaccent period -60
+KPX rcommaaccent q -20
+KPX rcommaaccent s -15
+KPX rcommaaccent sacute -15
+KPX rcommaaccent scaron -15
+KPX rcommaaccent scedilla -15
+KPX rcommaaccent scommaaccent -15
+KPX rcommaaccent t 20
+KPX rcommaaccent tcommaaccent 20
+KPX rcommaaccent v 10
+KPX rcommaaccent y 10
+KPX rcommaaccent yacute 10
+KPX rcommaaccent ydieresis 10
+KPX s w -15
+KPX sacute w -15
+KPX scaron w -15
+KPX scedilla w -15
+KPX scommaaccent w -15
+KPX semicolon space -40
+KPX space T -100
+KPX space Tcaron -100
+KPX space Tcommaaccent -100
+KPX space V -80
+KPX space W -80
+KPX space Y -120
+KPX space Yacute -120
+KPX space Ydieresis -120
+KPX space quotedblleft -80
+KPX space quoteleft -60
+KPX v a -20
+KPX v aacute -20
+KPX v abreve -20
+KPX v acircumflex -20
+KPX v adieresis -20
+KPX v agrave -20
+KPX v amacron -20
+KPX v aogonek -20
+KPX v aring -20
+KPX v atilde -20
+KPX v comma -80
+KPX v o -30
+KPX v oacute -30
+KPX v ocircumflex -30
+KPX v odieresis -30
+KPX v ograve -30
+KPX v ohungarumlaut -30
+KPX v omacron -30
+KPX v oslash -30
+KPX v otilde -30
+KPX v period -80
+KPX w comma -40
+KPX w o -20
+KPX w oacute -20
+KPX w ocircumflex -20
+KPX w odieresis -20
+KPX w ograve -20
+KPX w ohungarumlaut -20
+KPX w omacron -20
+KPX w oslash -20
+KPX w otilde -20
+KPX w period -40
+KPX x e -10
+KPX x eacute -10
+KPX x ecaron -10
+KPX x ecircumflex -10
+KPX x edieresis -10
+KPX x edotaccent -10
+KPX x egrave -10
+KPX x emacron -10
+KPX x eogonek -10
+KPX y a -30
+KPX y aacute -30
+KPX y abreve -30
+KPX y acircumflex -30
+KPX y adieresis -30
+KPX y agrave -30
+KPX y amacron -30
+KPX y aogonek -30
+KPX y aring -30
+KPX y atilde -30
+KPX y comma -80
+KPX y e -10
+KPX y eacute -10
+KPX y ecaron -10
+KPX y ecircumflex -10
+KPX y edieresis -10
+KPX y edotaccent -10
+KPX y egrave -10
+KPX y emacron -10
+KPX y eogonek -10
+KPX y o -25
+KPX y oacute -25
+KPX y ocircumflex -25
+KPX y odieresis -25
+KPX y ograve -25
+KPX y ohungarumlaut -25
+KPX y omacron -25
+KPX y oslash -25
+KPX y otilde -25
+KPX y period -80
+KPX yacute a -30
+KPX yacute aacute -30
+KPX yacute abreve -30
+KPX yacute acircumflex -30
+KPX yacute adieresis -30
+KPX yacute agrave -30
+KPX yacute amacron -30
+KPX yacute aogonek -30
+KPX yacute aring -30
+KPX yacute atilde -30
+KPX yacute comma -80
+KPX yacute e -10
+KPX yacute eacute -10
+KPX yacute ecaron -10
+KPX yacute ecircumflex -10
+KPX yacute edieresis -10
+KPX yacute edotaccent -10
+KPX yacute egrave -10
+KPX yacute emacron -10
+KPX yacute eogonek -10
+KPX yacute o -25
+KPX yacute oacute -25
+KPX yacute ocircumflex -25
+KPX yacute odieresis -25
+KPX yacute ograve -25
+KPX yacute ohungarumlaut -25
+KPX yacute omacron -25
+KPX yacute oslash -25
+KPX yacute otilde -25
+KPX yacute period -80
+KPX ydieresis a -30
+KPX ydieresis aacute -30
+KPX ydieresis abreve -30
+KPX ydieresis acircumflex -30
+KPX ydieresis adieresis -30
+KPX ydieresis agrave -30
+KPX ydieresis amacron -30
+KPX ydieresis aogonek -30
+KPX ydieresis aring -30
+KPX ydieresis atilde -30
+KPX ydieresis comma -80
+KPX ydieresis e -10
+KPX ydieresis eacute -10
+KPX ydieresis ecaron -10
+KPX ydieresis ecircumflex -10
+KPX ydieresis edieresis -10
+KPX ydieresis edotaccent -10
+KPX ydieresis egrave -10
+KPX ydieresis emacron -10
+KPX ydieresis eogonek -10
+KPX ydieresis o -25
+KPX ydieresis oacute -25
+KPX ydieresis ocircumflex -25
+KPX ydieresis odieresis -25
+KPX ydieresis ograve -25
+KPX ydieresis ohungarumlaut -25
+KPX ydieresis omacron -25
+KPX ydieresis oslash -25
+KPX ydieresis otilde -25
+KPX ydieresis period -80
+KPX z e 10
+KPX z eacute 10
+KPX z ecaron 10
+KPX z ecircumflex 10
+KPX z edieresis 10
+KPX z edotaccent 10
+KPX z egrave 10
+KPX z emacron 10
+KPX z eogonek 10
+KPX zacute e 10
+KPX zacute eacute 10
+KPX zacute ecaron 10
+KPX zacute ecircumflex 10
+KPX zacute edieresis 10
+KPX zacute edotaccent 10
+KPX zacute egrave 10
+KPX zacute emacron 10
+KPX zacute eogonek 10
+KPX zcaron e 10
+KPX zcaron eacute 10
+KPX zcaron ecaron 10
+KPX zcaron ecircumflex 10
+KPX zcaron edieresis 10
+KPX zcaron edotaccent 10
+KPX zcaron egrave 10
+KPX zcaron emacron 10
+KPX zcaron eogonek 10
+KPX zdotaccent e 10
+KPX zdotaccent eacute 10
+KPX zdotaccent ecaron 10
+KPX zdotaccent ecircumflex 10
+KPX zdotaccent edieresis 10
+KPX zdotaccent edotaccent 10
+KPX zdotaccent egrave 10
+KPX zdotaccent emacron 10
+KPX zdotaccent eogonek 10
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-BoldOblique.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-BoldOblique.afm
new file mode 100644
index 0000000000000000000000000000000000000000..1715b210467ce82625be36f6cbf20eae54cb67e0
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-BoldOblique.afm
@@ -0,0 +1,2827 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 12:45:12 1997
+Comment UniqueID 43053
+Comment VMusage 14482 68586
+FontName Helvetica-BoldOblique
+FullName Helvetica Bold Oblique
+FamilyName Helvetica
+Weight Bold
+ItalicAngle -12
+IsFixedPitch false
+CharacterSet ExtendedRoman
+FontBBox -174 -228 1114 962
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 532
+Ascender 718
+Descender -207
+StdHW 118
+StdVW 140
+StartCharMetrics 315
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 94 0 397 718 ;
+C 34 ; WX 474 ; N quotedbl ; B 193 447 529 718 ;
+C 35 ; WX 556 ; N numbersign ; B 60 0 644 698 ;
+C 36 ; WX 556 ; N dollar ; B 67 -115 622 775 ;
+C 37 ; WX 889 ; N percent ; B 136 -19 901 710 ;
+C 38 ; WX 722 ; N ampersand ; B 89 -19 732 718 ;
+C 39 ; WX 278 ; N quoteright ; B 167 445 362 718 ;
+C 40 ; WX 333 ; N parenleft ; B 76 -208 470 734 ;
+C 41 ; WX 333 ; N parenright ; B -25 -208 369 734 ;
+C 42 ; WX 389 ; N asterisk ; B 146 387 481 718 ;
+C 43 ; WX 584 ; N plus ; B 82 0 610 506 ;
+C 44 ; WX 278 ; N comma ; B 28 -168 245 146 ;
+C 45 ; WX 333 ; N hyphen ; B 73 215 379 345 ;
+C 46 ; WX 278 ; N period ; B 64 0 245 146 ;
+C 47 ; WX 278 ; N slash ; B -37 -19 468 737 ;
+C 48 ; WX 556 ; N zero ; B 86 -19 617 710 ;
+C 49 ; WX 556 ; N one ; B 173 0 529 710 ;
+C 50 ; WX 556 ; N two ; B 26 0 619 710 ;
+C 51 ; WX 556 ; N three ; B 65 -19 608 710 ;
+C 52 ; WX 556 ; N four ; B 60 0 598 710 ;
+C 53 ; WX 556 ; N five ; B 64 -19 636 698 ;
+C 54 ; WX 556 ; N six ; B 85 -19 619 710 ;
+C 55 ; WX 556 ; N seven ; B 125 0 676 698 ;
+C 56 ; WX 556 ; N eight ; B 69 -19 616 710 ;
+C 57 ; WX 556 ; N nine ; B 78 -19 615 710 ;
+C 58 ; WX 333 ; N colon ; B 92 0 351 512 ;
+C 59 ; WX 333 ; N semicolon ; B 56 -168 351 512 ;
+C 60 ; WX 584 ; N less ; B 82 -8 655 514 ;
+C 61 ; WX 584 ; N equal ; B 58 87 633 419 ;
+C 62 ; WX 584 ; N greater ; B 36 -8 609 514 ;
+C 63 ; WX 611 ; N question ; B 165 0 671 727 ;
+C 64 ; WX 975 ; N at ; B 186 -19 954 737 ;
+C 65 ; WX 722 ; N A ; B 20 0 702 718 ;
+C 66 ; WX 722 ; N B ; B 76 0 764 718 ;
+C 67 ; WX 722 ; N C ; B 107 -19 789 737 ;
+C 68 ; WX 722 ; N D ; B 76 0 777 718 ;
+C 69 ; WX 667 ; N E ; B 76 0 757 718 ;
+C 70 ; WX 611 ; N F ; B 76 0 740 718 ;
+C 71 ; WX 778 ; N G ; B 108 -19 817 737 ;
+C 72 ; WX 722 ; N H ; B 71 0 804 718 ;
+C 73 ; WX 278 ; N I ; B 64 0 367 718 ;
+C 74 ; WX 556 ; N J ; B 60 -18 637 718 ;
+C 75 ; WX 722 ; N K ; B 87 0 858 718 ;
+C 76 ; WX 611 ; N L ; B 76 0 611 718 ;
+C 77 ; WX 833 ; N M ; B 69 0 918 718 ;
+C 78 ; WX 722 ; N N ; B 69 0 807 718 ;
+C 79 ; WX 778 ; N O ; B 107 -19 823 737 ;
+C 80 ; WX 667 ; N P ; B 76 0 738 718 ;
+C 81 ; WX 778 ; N Q ; B 107 -52 823 737 ;
+C 82 ; WX 722 ; N R ; B 76 0 778 718 ;
+C 83 ; WX 667 ; N S ; B 81 -19 718 737 ;
+C 84 ; WX 611 ; N T ; B 140 0 751 718 ;
+C 85 ; WX 722 ; N U ; B 116 -19 804 718 ;
+C 86 ; WX 667 ; N V ; B 172 0 801 718 ;
+C 87 ; WX 944 ; N W ; B 169 0 1082 718 ;
+C 88 ; WX 667 ; N X ; B 14 0 791 718 ;
+C 89 ; WX 667 ; N Y ; B 168 0 806 718 ;
+C 90 ; WX 611 ; N Z ; B 25 0 737 718 ;
+C 91 ; WX 333 ; N bracketleft ; B 21 -196 462 722 ;
+C 92 ; WX 278 ; N backslash ; B 124 -19 307 737 ;
+C 93 ; WX 333 ; N bracketright ; B -18 -196 423 722 ;
+C 94 ; WX 584 ; N asciicircum ; B 131 323 591 698 ;
+C 95 ; WX 556 ; N underscore ; B -27 -125 540 -75 ;
+C 96 ; WX 278 ; N quoteleft ; B 165 454 361 727 ;
+C 97 ; WX 556 ; N a ; B 55 -14 583 546 ;
+C 98 ; WX 611 ; N b ; B 61 -14 645 718 ;
+C 99 ; WX 556 ; N c ; B 79 -14 599 546 ;
+C 100 ; WX 611 ; N d ; B 82 -14 704 718 ;
+C 101 ; WX 556 ; N e ; B 70 -14 593 546 ;
+C 102 ; WX 333 ; N f ; B 87 0 469 727 ; L i fi ; L l fl ;
+C 103 ; WX 611 ; N g ; B 38 -217 666 546 ;
+C 104 ; WX 611 ; N h ; B 65 0 629 718 ;
+C 105 ; WX 278 ; N i ; B 69 0 363 725 ;
+C 106 ; WX 278 ; N j ; B -42 -214 363 725 ;
+C 107 ; WX 556 ; N k ; B 69 0 670 718 ;
+C 108 ; WX 278 ; N l ; B 69 0 362 718 ;
+C 109 ; WX 889 ; N m ; B 64 0 909 546 ;
+C 110 ; WX 611 ; N n ; B 65 0 629 546 ;
+C 111 ; WX 611 ; N o ; B 82 -14 643 546 ;
+C 112 ; WX 611 ; N p ; B 18 -207 645 546 ;
+C 113 ; WX 611 ; N q ; B 80 -207 665 546 ;
+C 114 ; WX 389 ; N r ; B 64 0 489 546 ;
+C 115 ; WX 556 ; N s ; B 63 -14 584 546 ;
+C 116 ; WX 333 ; N t ; B 100 -6 422 676 ;
+C 117 ; WX 611 ; N u ; B 98 -14 658 532 ;
+C 118 ; WX 556 ; N v ; B 126 0 656 532 ;
+C 119 ; WX 778 ; N w ; B 123 0 882 532 ;
+C 120 ; WX 556 ; N x ; B 15 0 648 532 ;
+C 121 ; WX 556 ; N y ; B 42 -214 652 532 ;
+C 122 ; WX 500 ; N z ; B 20 0 583 532 ;
+C 123 ; WX 389 ; N braceleft ; B 94 -196 518 722 ;
+C 124 ; WX 280 ; N bar ; B 36 -225 361 775 ;
+C 125 ; WX 389 ; N braceright ; B -18 -196 407 722 ;
+C 126 ; WX 584 ; N asciitilde ; B 115 163 577 343 ;
+C 161 ; WX 333 ; N exclamdown ; B 50 -186 353 532 ;
+C 162 ; WX 556 ; N cent ; B 79 -118 599 628 ;
+C 163 ; WX 556 ; N sterling ; B 50 -16 635 718 ;
+C 164 ; WX 167 ; N fraction ; B -174 -19 487 710 ;
+C 165 ; WX 556 ; N yen ; B 60 0 713 698 ;
+C 166 ; WX 556 ; N florin ; B -50 -210 669 737 ;
+C 167 ; WX 556 ; N section ; B 61 -184 598 727 ;
+C 168 ; WX 556 ; N currency ; B 27 76 680 636 ;
+C 169 ; WX 238 ; N quotesingle ; B 165 447 321 718 ;
+C 170 ; WX 500 ; N quotedblleft ; B 160 454 588 727 ;
+C 171 ; WX 556 ; N guillemotleft ; B 135 76 571 484 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 130 76 353 484 ;
+C 173 ; WX 333 ; N guilsinglright ; B 99 76 322 484 ;
+C 174 ; WX 611 ; N fi ; B 87 0 696 727 ;
+C 175 ; WX 611 ; N fl ; B 87 0 695 727 ;
+C 177 ; WX 556 ; N endash ; B 48 227 627 333 ;
+C 178 ; WX 556 ; N dagger ; B 118 -171 626 718 ;
+C 179 ; WX 556 ; N daggerdbl ; B 46 -171 628 718 ;
+C 180 ; WX 278 ; N periodcentered ; B 110 172 276 334 ;
+C 182 ; WX 556 ; N paragraph ; B 98 -191 688 700 ;
+C 183 ; WX 350 ; N bullet ; B 83 194 420 524 ;
+C 184 ; WX 278 ; N quotesinglbase ; B 41 -146 236 127 ;
+C 185 ; WX 500 ; N quotedblbase ; B 36 -146 463 127 ;
+C 186 ; WX 500 ; N quotedblright ; B 162 445 589 718 ;
+C 187 ; WX 556 ; N guillemotright ; B 104 76 540 484 ;
+C 188 ; WX 1000 ; N ellipsis ; B 92 0 939 146 ;
+C 189 ; WX 1000 ; N perthousand ; B 76 -19 1038 710 ;
+C 191 ; WX 611 ; N questiondown ; B 53 -195 559 532 ;
+C 193 ; WX 333 ; N grave ; B 136 604 353 750 ;
+C 194 ; WX 333 ; N acute ; B 236 604 515 750 ;
+C 195 ; WX 333 ; N circumflex ; B 118 604 471 750 ;
+C 196 ; WX 333 ; N tilde ; B 113 610 507 737 ;
+C 197 ; WX 333 ; N macron ; B 122 604 483 678 ;
+C 198 ; WX 333 ; N breve ; B 156 604 494 750 ;
+C 199 ; WX 333 ; N dotaccent ; B 235 614 385 729 ;
+C 200 ; WX 333 ; N dieresis ; B 137 614 482 729 ;
+C 202 ; WX 333 ; N ring ; B 200 568 420 776 ;
+C 203 ; WX 333 ; N cedilla ; B -37 -228 220 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 137 604 645 750 ;
+C 206 ; WX 333 ; N ogonek ; B 41 -228 264 0 ;
+C 207 ; WX 333 ; N caron ; B 149 604 502 750 ;
+C 208 ; WX 1000 ; N emdash ; B 48 227 1071 333 ;
+C 225 ; WX 1000 ; N AE ; B 5 0 1100 718 ;
+C 227 ; WX 370 ; N ordfeminine ; B 125 401 465 737 ;
+C 232 ; WX 611 ; N Lslash ; B 34 0 611 718 ;
+C 233 ; WX 778 ; N Oslash ; B 35 -27 894 745 ;
+C 234 ; WX 1000 ; N OE ; B 99 -19 1114 737 ;
+C 235 ; WX 365 ; N ordmasculine ; B 123 401 485 737 ;
+C 241 ; WX 889 ; N ae ; B 56 -14 923 546 ;
+C 245 ; WX 278 ; N dotlessi ; B 69 0 322 532 ;
+C 248 ; WX 278 ; N lslash ; B 40 0 407 718 ;
+C 249 ; WX 611 ; N oslash ; B 22 -29 701 560 ;
+C 250 ; WX 944 ; N oe ; B 82 -14 977 546 ;
+C 251 ; WX 611 ; N germandbls ; B 69 -14 657 731 ;
+C -1 ; WX 278 ; N Idieresis ; B 64 0 494 915 ;
+C -1 ; WX 556 ; N eacute ; B 70 -14 627 750 ;
+C -1 ; WX 556 ; N abreve ; B 55 -14 606 750 ;
+C -1 ; WX 611 ; N uhungarumlaut ; B 98 -14 784 750 ;
+C -1 ; WX 556 ; N ecaron ; B 70 -14 614 750 ;
+C -1 ; WX 667 ; N Ydieresis ; B 168 0 806 915 ;
+C -1 ; WX 584 ; N divide ; B 82 -42 610 548 ;
+C -1 ; WX 667 ; N Yacute ; B 168 0 806 936 ;
+C -1 ; WX 722 ; N Acircumflex ; B 20 0 706 936 ;
+C -1 ; WX 556 ; N aacute ; B 55 -14 627 750 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 116 -19 804 936 ;
+C -1 ; WX 556 ; N yacute ; B 42 -214 652 750 ;
+C -1 ; WX 556 ; N scommaaccent ; B 63 -228 584 546 ;
+C -1 ; WX 556 ; N ecircumflex ; B 70 -14 593 750 ;
+C -1 ; WX 722 ; N Uring ; B 116 -19 804 962 ;
+C -1 ; WX 722 ; N Udieresis ; B 116 -19 804 915 ;
+C -1 ; WX 556 ; N aogonek ; B 55 -224 583 546 ;
+C -1 ; WX 722 ; N Uacute ; B 116 -19 804 936 ;
+C -1 ; WX 611 ; N uogonek ; B 98 -228 658 532 ;
+C -1 ; WX 667 ; N Edieresis ; B 76 0 757 915 ;
+C -1 ; WX 722 ; N Dcroat ; B 62 0 777 718 ;
+C -1 ; WX 250 ; N commaaccent ; B 16 -228 188 -50 ;
+C -1 ; WX 737 ; N copyright ; B 56 -19 835 737 ;
+C -1 ; WX 667 ; N Emacron ; B 76 0 757 864 ;
+C -1 ; WX 556 ; N ccaron ; B 79 -14 614 750 ;
+C -1 ; WX 556 ; N aring ; B 55 -14 583 776 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 69 -228 807 718 ;
+C -1 ; WX 278 ; N lacute ; B 69 0 528 936 ;
+C -1 ; WX 556 ; N agrave ; B 55 -14 583 750 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 140 -228 751 718 ;
+C -1 ; WX 722 ; N Cacute ; B 107 -19 789 936 ;
+C -1 ; WX 556 ; N atilde ; B 55 -14 619 737 ;
+C -1 ; WX 667 ; N Edotaccent ; B 76 0 757 915 ;
+C -1 ; WX 556 ; N scaron ; B 63 -14 614 750 ;
+C -1 ; WX 556 ; N scedilla ; B 63 -228 584 546 ;
+C -1 ; WX 278 ; N iacute ; B 69 0 488 750 ;
+C -1 ; WX 494 ; N lozenge ; B 90 0 564 745 ;
+C -1 ; WX 722 ; N Rcaron ; B 76 0 778 936 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 108 -228 817 737 ;
+C -1 ; WX 611 ; N ucircumflex ; B 98 -14 658 750 ;
+C -1 ; WX 556 ; N acircumflex ; B 55 -14 583 750 ;
+C -1 ; WX 722 ; N Amacron ; B 20 0 718 864 ;
+C -1 ; WX 389 ; N rcaron ; B 64 0 530 750 ;
+C -1 ; WX 556 ; N ccedilla ; B 79 -228 599 546 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 25 0 737 915 ;
+C -1 ; WX 667 ; N Thorn ; B 76 0 716 718 ;
+C -1 ; WX 778 ; N Omacron ; B 107 -19 823 864 ;
+C -1 ; WX 722 ; N Racute ; B 76 0 778 936 ;
+C -1 ; WX 667 ; N Sacute ; B 81 -19 722 936 ;
+C -1 ; WX 743 ; N dcaron ; B 82 -14 903 718 ;
+C -1 ; WX 722 ; N Umacron ; B 116 -19 804 864 ;
+C -1 ; WX 611 ; N uring ; B 98 -14 658 776 ;
+C -1 ; WX 333 ; N threesuperior ; B 91 271 441 710 ;
+C -1 ; WX 778 ; N Ograve ; B 107 -19 823 936 ;
+C -1 ; WX 722 ; N Agrave ; B 20 0 702 936 ;
+C -1 ; WX 722 ; N Abreve ; B 20 0 729 936 ;
+C -1 ; WX 584 ; N multiply ; B 57 1 635 505 ;
+C -1 ; WX 611 ; N uacute ; B 98 -14 658 750 ;
+C -1 ; WX 611 ; N Tcaron ; B 140 0 751 936 ;
+C -1 ; WX 494 ; N partialdiff ; B 43 -21 585 750 ;
+C -1 ; WX 556 ; N ydieresis ; B 42 -214 652 729 ;
+C -1 ; WX 722 ; N Nacute ; B 69 0 807 936 ;
+C -1 ; WX 278 ; N icircumflex ; B 69 0 444 750 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 76 0 757 936 ;
+C -1 ; WX 556 ; N adieresis ; B 55 -14 594 729 ;
+C -1 ; WX 556 ; N edieresis ; B 70 -14 594 729 ;
+C -1 ; WX 556 ; N cacute ; B 79 -14 627 750 ;
+C -1 ; WX 611 ; N nacute ; B 65 0 654 750 ;
+C -1 ; WX 611 ; N umacron ; B 98 -14 658 678 ;
+C -1 ; WX 722 ; N Ncaron ; B 69 0 807 936 ;
+C -1 ; WX 278 ; N Iacute ; B 64 0 528 936 ;
+C -1 ; WX 584 ; N plusminus ; B 40 0 625 506 ;
+C -1 ; WX 280 ; N brokenbar ; B 52 -150 345 700 ;
+C -1 ; WX 737 ; N registered ; B 55 -19 834 737 ;
+C -1 ; WX 778 ; N Gbreve ; B 108 -19 817 936 ;
+C -1 ; WX 278 ; N Idotaccent ; B 64 0 397 915 ;
+C -1 ; WX 600 ; N summation ; B 14 -10 670 706 ;
+C -1 ; WX 667 ; N Egrave ; B 76 0 757 936 ;
+C -1 ; WX 389 ; N racute ; B 64 0 543 750 ;
+C -1 ; WX 611 ; N omacron ; B 82 -14 643 678 ;
+C -1 ; WX 611 ; N Zacute ; B 25 0 737 936 ;
+C -1 ; WX 611 ; N Zcaron ; B 25 0 737 936 ;
+C -1 ; WX 549 ; N greaterequal ; B 26 0 629 704 ;
+C -1 ; WX 722 ; N Eth ; B 62 0 777 718 ;
+C -1 ; WX 722 ; N Ccedilla ; B 107 -228 789 737 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 30 -228 362 718 ;
+C -1 ; WX 389 ; N tcaron ; B 100 -6 608 878 ;
+C -1 ; WX 556 ; N eogonek ; B 70 -228 593 546 ;
+C -1 ; WX 722 ; N Uogonek ; B 116 -228 804 718 ;
+C -1 ; WX 722 ; N Aacute ; B 20 0 750 936 ;
+C -1 ; WX 722 ; N Adieresis ; B 20 0 716 915 ;
+C -1 ; WX 556 ; N egrave ; B 70 -14 593 750 ;
+C -1 ; WX 500 ; N zacute ; B 20 0 599 750 ;
+C -1 ; WX 278 ; N iogonek ; B -14 -224 363 725 ;
+C -1 ; WX 778 ; N Oacute ; B 107 -19 823 936 ;
+C -1 ; WX 611 ; N oacute ; B 82 -14 654 750 ;
+C -1 ; WX 556 ; N amacron ; B 55 -14 595 678 ;
+C -1 ; WX 556 ; N sacute ; B 63 -14 627 750 ;
+C -1 ; WX 278 ; N idieresis ; B 69 0 455 729 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 107 -19 823 936 ;
+C -1 ; WX 722 ; N Ugrave ; B 116 -19 804 936 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 611 ; N thorn ; B 18 -208 645 718 ;
+C -1 ; WX 333 ; N twosuperior ; B 69 283 449 710 ;
+C -1 ; WX 778 ; N Odieresis ; B 107 -19 823 915 ;
+C -1 ; WX 611 ; N mu ; B 22 -207 658 532 ;
+C -1 ; WX 278 ; N igrave ; B 69 0 326 750 ;
+C -1 ; WX 611 ; N ohungarumlaut ; B 82 -14 784 750 ;
+C -1 ; WX 667 ; N Eogonek ; B 76 -224 757 718 ;
+C -1 ; WX 611 ; N dcroat ; B 82 -14 789 718 ;
+C -1 ; WX 834 ; N threequarters ; B 99 -19 839 710 ;
+C -1 ; WX 667 ; N Scedilla ; B 81 -228 718 737 ;
+C -1 ; WX 400 ; N lcaron ; B 69 0 561 718 ;
+C -1 ; WX 722 ; N Kcommaaccent ; B 87 -228 858 718 ;
+C -1 ; WX 611 ; N Lacute ; B 76 0 611 936 ;
+C -1 ; WX 1000 ; N trademark ; B 179 306 1109 718 ;
+C -1 ; WX 556 ; N edotaccent ; B 70 -14 593 729 ;
+C -1 ; WX 278 ; N Igrave ; B 64 0 367 936 ;
+C -1 ; WX 278 ; N Imacron ; B 64 0 496 864 ;
+C -1 ; WX 611 ; N Lcaron ; B 76 0 643 718 ;
+C -1 ; WX 834 ; N onehalf ; B 132 -19 858 710 ;
+C -1 ; WX 549 ; N lessequal ; B 29 0 676 704 ;
+C -1 ; WX 611 ; N ocircumflex ; B 82 -14 643 750 ;
+C -1 ; WX 611 ; N ntilde ; B 65 0 646 737 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 116 -19 880 936 ;
+C -1 ; WX 667 ; N Eacute ; B 76 0 757 936 ;
+C -1 ; WX 556 ; N emacron ; B 70 -14 595 678 ;
+C -1 ; WX 611 ; N gbreve ; B 38 -217 666 750 ;
+C -1 ; WX 834 ; N onequarter ; B 132 -19 806 710 ;
+C -1 ; WX 667 ; N Scaron ; B 81 -19 718 936 ;
+C -1 ; WX 667 ; N Scommaaccent ; B 81 -228 718 737 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 107 -19 908 936 ;
+C -1 ; WX 400 ; N degree ; B 175 426 467 712 ;
+C -1 ; WX 611 ; N ograve ; B 82 -14 643 750 ;
+C -1 ; WX 722 ; N Ccaron ; B 107 -19 789 936 ;
+C -1 ; WX 611 ; N ugrave ; B 98 -14 658 750 ;
+C -1 ; WX 549 ; N radical ; B 112 -46 689 850 ;
+C -1 ; WX 722 ; N Dcaron ; B 76 0 777 936 ;
+C -1 ; WX 389 ; N rcommaaccent ; B 26 -228 489 546 ;
+C -1 ; WX 722 ; N Ntilde ; B 69 0 807 923 ;
+C -1 ; WX 611 ; N otilde ; B 82 -14 646 737 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 76 -228 778 718 ;
+C -1 ; WX 611 ; N Lcommaaccent ; B 76 -228 611 718 ;
+C -1 ; WX 722 ; N Atilde ; B 20 0 741 923 ;
+C -1 ; WX 722 ; N Aogonek ; B 20 -224 702 718 ;
+C -1 ; WX 722 ; N Aring ; B 20 0 702 962 ;
+C -1 ; WX 778 ; N Otilde ; B 107 -19 823 923 ;
+C -1 ; WX 500 ; N zdotaccent ; B 20 0 583 729 ;
+C -1 ; WX 667 ; N Ecaron ; B 76 0 757 936 ;
+C -1 ; WX 278 ; N Iogonek ; B -41 -228 367 718 ;
+C -1 ; WX 556 ; N kcommaaccent ; B 69 -228 670 718 ;
+C -1 ; WX 584 ; N minus ; B 82 197 610 309 ;
+C -1 ; WX 278 ; N Icircumflex ; B 64 0 484 936 ;
+C -1 ; WX 611 ; N ncaron ; B 65 0 641 750 ;
+C -1 ; WX 333 ; N tcommaaccent ; B 58 -228 422 676 ;
+C -1 ; WX 584 ; N logicalnot ; B 105 108 633 419 ;
+C -1 ; WX 611 ; N odieresis ; B 82 -14 643 729 ;
+C -1 ; WX 611 ; N udieresis ; B 98 -14 658 729 ;
+C -1 ; WX 549 ; N notequal ; B 32 -49 630 570 ;
+C -1 ; WX 611 ; N gcommaaccent ; B 38 -217 666 850 ;
+C -1 ; WX 611 ; N eth ; B 82 -14 670 737 ;
+C -1 ; WX 500 ; N zcaron ; B 20 0 586 750 ;
+C -1 ; WX 611 ; N ncommaaccent ; B 65 -228 629 546 ;
+C -1 ; WX 333 ; N onesuperior ; B 148 283 388 710 ;
+C -1 ; WX 278 ; N imacron ; B 69 0 429 678 ;
+C -1 ; WX 556 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 2481
+KPX A C -40
+KPX A Cacute -40
+KPX A Ccaron -40
+KPX A Ccedilla -40
+KPX A G -50
+KPX A Gbreve -50
+KPX A Gcommaaccent -50
+KPX A O -40
+KPX A Oacute -40
+KPX A Ocircumflex -40
+KPX A Odieresis -40
+KPX A Ograve -40
+KPX A Ohungarumlaut -40
+KPX A Omacron -40
+KPX A Oslash -40
+KPX A Otilde -40
+KPX A Q -40
+KPX A T -90
+KPX A Tcaron -90
+KPX A Tcommaaccent -90
+KPX A U -50
+KPX A Uacute -50
+KPX A Ucircumflex -50
+KPX A Udieresis -50
+KPX A Ugrave -50
+KPX A Uhungarumlaut -50
+KPX A Umacron -50
+KPX A Uogonek -50
+KPX A Uring -50
+KPX A V -80
+KPX A W -60
+KPX A Y -110
+KPX A Yacute -110
+KPX A Ydieresis -110
+KPX A u -30
+KPX A uacute -30
+KPX A ucircumflex -30
+KPX A udieresis -30
+KPX A ugrave -30
+KPX A uhungarumlaut -30
+KPX A umacron -30
+KPX A uogonek -30
+KPX A uring -30
+KPX A v -40
+KPX A w -30
+KPX A y -30
+KPX A yacute -30
+KPX A ydieresis -30
+KPX Aacute C -40
+KPX Aacute Cacute -40
+KPX Aacute Ccaron -40
+KPX Aacute Ccedilla -40
+KPX Aacute G -50
+KPX Aacute Gbreve -50
+KPX Aacute Gcommaaccent -50
+KPX Aacute O -40
+KPX Aacute Oacute -40
+KPX Aacute Ocircumflex -40
+KPX Aacute Odieresis -40
+KPX Aacute Ograve -40
+KPX Aacute Ohungarumlaut -40
+KPX Aacute Omacron -40
+KPX Aacute Oslash -40
+KPX Aacute Otilde -40
+KPX Aacute Q -40
+KPX Aacute T -90
+KPX Aacute Tcaron -90
+KPX Aacute Tcommaaccent -90
+KPX Aacute U -50
+KPX Aacute Uacute -50
+KPX Aacute Ucircumflex -50
+KPX Aacute Udieresis -50
+KPX Aacute Ugrave -50
+KPX Aacute Uhungarumlaut -50
+KPX Aacute Umacron -50
+KPX Aacute Uogonek -50
+KPX Aacute Uring -50
+KPX Aacute V -80
+KPX Aacute W -60
+KPX Aacute Y -110
+KPX Aacute Yacute -110
+KPX Aacute Ydieresis -110
+KPX Aacute u -30
+KPX Aacute uacute -30
+KPX Aacute ucircumflex -30
+KPX Aacute udieresis -30
+KPX Aacute ugrave -30
+KPX Aacute uhungarumlaut -30
+KPX Aacute umacron -30
+KPX Aacute uogonek -30
+KPX Aacute uring -30
+KPX Aacute v -40
+KPX Aacute w -30
+KPX Aacute y -30
+KPX Aacute yacute -30
+KPX Aacute ydieresis -30
+KPX Abreve C -40
+KPX Abreve Cacute -40
+KPX Abreve Ccaron -40
+KPX Abreve Ccedilla -40
+KPX Abreve G -50
+KPX Abreve Gbreve -50
+KPX Abreve Gcommaaccent -50
+KPX Abreve O -40
+KPX Abreve Oacute -40
+KPX Abreve Ocircumflex -40
+KPX Abreve Odieresis -40
+KPX Abreve Ograve -40
+KPX Abreve Ohungarumlaut -40
+KPX Abreve Omacron -40
+KPX Abreve Oslash -40
+KPX Abreve Otilde -40
+KPX Abreve Q -40
+KPX Abreve T -90
+KPX Abreve Tcaron -90
+KPX Abreve Tcommaaccent -90
+KPX Abreve U -50
+KPX Abreve Uacute -50
+KPX Abreve Ucircumflex -50
+KPX Abreve Udieresis -50
+KPX Abreve Ugrave -50
+KPX Abreve Uhungarumlaut -50
+KPX Abreve Umacron -50
+KPX Abreve Uogonek -50
+KPX Abreve Uring -50
+KPX Abreve V -80
+KPX Abreve W -60
+KPX Abreve Y -110
+KPX Abreve Yacute -110
+KPX Abreve Ydieresis -110
+KPX Abreve u -30
+KPX Abreve uacute -30
+KPX Abreve ucircumflex -30
+KPX Abreve udieresis -30
+KPX Abreve ugrave -30
+KPX Abreve uhungarumlaut -30
+KPX Abreve umacron -30
+KPX Abreve uogonek -30
+KPX Abreve uring -30
+KPX Abreve v -40
+KPX Abreve w -30
+KPX Abreve y -30
+KPX Abreve yacute -30
+KPX Abreve ydieresis -30
+KPX Acircumflex C -40
+KPX Acircumflex Cacute -40
+KPX Acircumflex Ccaron -40
+KPX Acircumflex Ccedilla -40
+KPX Acircumflex G -50
+KPX Acircumflex Gbreve -50
+KPX Acircumflex Gcommaaccent -50
+KPX Acircumflex O -40
+KPX Acircumflex Oacute -40
+KPX Acircumflex Ocircumflex -40
+KPX Acircumflex Odieresis -40
+KPX Acircumflex Ograve -40
+KPX Acircumflex Ohungarumlaut -40
+KPX Acircumflex Omacron -40
+KPX Acircumflex Oslash -40
+KPX Acircumflex Otilde -40
+KPX Acircumflex Q -40
+KPX Acircumflex T -90
+KPX Acircumflex Tcaron -90
+KPX Acircumflex Tcommaaccent -90
+KPX Acircumflex U -50
+KPX Acircumflex Uacute -50
+KPX Acircumflex Ucircumflex -50
+KPX Acircumflex Udieresis -50
+KPX Acircumflex Ugrave -50
+KPX Acircumflex Uhungarumlaut -50
+KPX Acircumflex Umacron -50
+KPX Acircumflex Uogonek -50
+KPX Acircumflex Uring -50
+KPX Acircumflex V -80
+KPX Acircumflex W -60
+KPX Acircumflex Y -110
+KPX Acircumflex Yacute -110
+KPX Acircumflex Ydieresis -110
+KPX Acircumflex u -30
+KPX Acircumflex uacute -30
+KPX Acircumflex ucircumflex -30
+KPX Acircumflex udieresis -30
+KPX Acircumflex ugrave -30
+KPX Acircumflex uhungarumlaut -30
+KPX Acircumflex umacron -30
+KPX Acircumflex uogonek -30
+KPX Acircumflex uring -30
+KPX Acircumflex v -40
+KPX Acircumflex w -30
+KPX Acircumflex y -30
+KPX Acircumflex yacute -30
+KPX Acircumflex ydieresis -30
+KPX Adieresis C -40
+KPX Adieresis Cacute -40
+KPX Adieresis Ccaron -40
+KPX Adieresis Ccedilla -40
+KPX Adieresis G -50
+KPX Adieresis Gbreve -50
+KPX Adieresis Gcommaaccent -50
+KPX Adieresis O -40
+KPX Adieresis Oacute -40
+KPX Adieresis Ocircumflex -40
+KPX Adieresis Odieresis -40
+KPX Adieresis Ograve -40
+KPX Adieresis Ohungarumlaut -40
+KPX Adieresis Omacron -40
+KPX Adieresis Oslash -40
+KPX Adieresis Otilde -40
+KPX Adieresis Q -40
+KPX Adieresis T -90
+KPX Adieresis Tcaron -90
+KPX Adieresis Tcommaaccent -90
+KPX Adieresis U -50
+KPX Adieresis Uacute -50
+KPX Adieresis Ucircumflex -50
+KPX Adieresis Udieresis -50
+KPX Adieresis Ugrave -50
+KPX Adieresis Uhungarumlaut -50
+KPX Adieresis Umacron -50
+KPX Adieresis Uogonek -50
+KPX Adieresis Uring -50
+KPX Adieresis V -80
+KPX Adieresis W -60
+KPX Adieresis Y -110
+KPX Adieresis Yacute -110
+KPX Adieresis Ydieresis -110
+KPX Adieresis u -30
+KPX Adieresis uacute -30
+KPX Adieresis ucircumflex -30
+KPX Adieresis udieresis -30
+KPX Adieresis ugrave -30
+KPX Adieresis uhungarumlaut -30
+KPX Adieresis umacron -30
+KPX Adieresis uogonek -30
+KPX Adieresis uring -30
+KPX Adieresis v -40
+KPX Adieresis w -30
+KPX Adieresis y -30
+KPX Adieresis yacute -30
+KPX Adieresis ydieresis -30
+KPX Agrave C -40
+KPX Agrave Cacute -40
+KPX Agrave Ccaron -40
+KPX Agrave Ccedilla -40
+KPX Agrave G -50
+KPX Agrave Gbreve -50
+KPX Agrave Gcommaaccent -50
+KPX Agrave O -40
+KPX Agrave Oacute -40
+KPX Agrave Ocircumflex -40
+KPX Agrave Odieresis -40
+KPX Agrave Ograve -40
+KPX Agrave Ohungarumlaut -40
+KPX Agrave Omacron -40
+KPX Agrave Oslash -40
+KPX Agrave Otilde -40
+KPX Agrave Q -40
+KPX Agrave T -90
+KPX Agrave Tcaron -90
+KPX Agrave Tcommaaccent -90
+KPX Agrave U -50
+KPX Agrave Uacute -50
+KPX Agrave Ucircumflex -50
+KPX Agrave Udieresis -50
+KPX Agrave Ugrave -50
+KPX Agrave Uhungarumlaut -50
+KPX Agrave Umacron -50
+KPX Agrave Uogonek -50
+KPX Agrave Uring -50
+KPX Agrave V -80
+KPX Agrave W -60
+KPX Agrave Y -110
+KPX Agrave Yacute -110
+KPX Agrave Ydieresis -110
+KPX Agrave u -30
+KPX Agrave uacute -30
+KPX Agrave ucircumflex -30
+KPX Agrave udieresis -30
+KPX Agrave ugrave -30
+KPX Agrave uhungarumlaut -30
+KPX Agrave umacron -30
+KPX Agrave uogonek -30
+KPX Agrave uring -30
+KPX Agrave v -40
+KPX Agrave w -30
+KPX Agrave y -30
+KPX Agrave yacute -30
+KPX Agrave ydieresis -30
+KPX Amacron C -40
+KPX Amacron Cacute -40
+KPX Amacron Ccaron -40
+KPX Amacron Ccedilla -40
+KPX Amacron G -50
+KPX Amacron Gbreve -50
+KPX Amacron Gcommaaccent -50
+KPX Amacron O -40
+KPX Amacron Oacute -40
+KPX Amacron Ocircumflex -40
+KPX Amacron Odieresis -40
+KPX Amacron Ograve -40
+KPX Amacron Ohungarumlaut -40
+KPX Amacron Omacron -40
+KPX Amacron Oslash -40
+KPX Amacron Otilde -40
+KPX Amacron Q -40
+KPX Amacron T -90
+KPX Amacron Tcaron -90
+KPX Amacron Tcommaaccent -90
+KPX Amacron U -50
+KPX Amacron Uacute -50
+KPX Amacron Ucircumflex -50
+KPX Amacron Udieresis -50
+KPX Amacron Ugrave -50
+KPX Amacron Uhungarumlaut -50
+KPX Amacron Umacron -50
+KPX Amacron Uogonek -50
+KPX Amacron Uring -50
+KPX Amacron V -80
+KPX Amacron W -60
+KPX Amacron Y -110
+KPX Amacron Yacute -110
+KPX Amacron Ydieresis -110
+KPX Amacron u -30
+KPX Amacron uacute -30
+KPX Amacron ucircumflex -30
+KPX Amacron udieresis -30
+KPX Amacron ugrave -30
+KPX Amacron uhungarumlaut -30
+KPX Amacron umacron -30
+KPX Amacron uogonek -30
+KPX Amacron uring -30
+KPX Amacron v -40
+KPX Amacron w -30
+KPX Amacron y -30
+KPX Amacron yacute -30
+KPX Amacron ydieresis -30
+KPX Aogonek C -40
+KPX Aogonek Cacute -40
+KPX Aogonek Ccaron -40
+KPX Aogonek Ccedilla -40
+KPX Aogonek G -50
+KPX Aogonek Gbreve -50
+KPX Aogonek Gcommaaccent -50
+KPX Aogonek O -40
+KPX Aogonek Oacute -40
+KPX Aogonek Ocircumflex -40
+KPX Aogonek Odieresis -40
+KPX Aogonek Ograve -40
+KPX Aogonek Ohungarumlaut -40
+KPX Aogonek Omacron -40
+KPX Aogonek Oslash -40
+KPX Aogonek Otilde -40
+KPX Aogonek Q -40
+KPX Aogonek T -90
+KPX Aogonek Tcaron -90
+KPX Aogonek Tcommaaccent -90
+KPX Aogonek U -50
+KPX Aogonek Uacute -50
+KPX Aogonek Ucircumflex -50
+KPX Aogonek Udieresis -50
+KPX Aogonek Ugrave -50
+KPX Aogonek Uhungarumlaut -50
+KPX Aogonek Umacron -50
+KPX Aogonek Uogonek -50
+KPX Aogonek Uring -50
+KPX Aogonek V -80
+KPX Aogonek W -60
+KPX Aogonek Y -110
+KPX Aogonek Yacute -110
+KPX Aogonek Ydieresis -110
+KPX Aogonek u -30
+KPX Aogonek uacute -30
+KPX Aogonek ucircumflex -30
+KPX Aogonek udieresis -30
+KPX Aogonek ugrave -30
+KPX Aogonek uhungarumlaut -30
+KPX Aogonek umacron -30
+KPX Aogonek uogonek -30
+KPX Aogonek uring -30
+KPX Aogonek v -40
+KPX Aogonek w -30
+KPX Aogonek y -30
+KPX Aogonek yacute -30
+KPX Aogonek ydieresis -30
+KPX Aring C -40
+KPX Aring Cacute -40
+KPX Aring Ccaron -40
+KPX Aring Ccedilla -40
+KPX Aring G -50
+KPX Aring Gbreve -50
+KPX Aring Gcommaaccent -50
+KPX Aring O -40
+KPX Aring Oacute -40
+KPX Aring Ocircumflex -40
+KPX Aring Odieresis -40
+KPX Aring Ograve -40
+KPX Aring Ohungarumlaut -40
+KPX Aring Omacron -40
+KPX Aring Oslash -40
+KPX Aring Otilde -40
+KPX Aring Q -40
+KPX Aring T -90
+KPX Aring Tcaron -90
+KPX Aring Tcommaaccent -90
+KPX Aring U -50
+KPX Aring Uacute -50
+KPX Aring Ucircumflex -50
+KPX Aring Udieresis -50
+KPX Aring Ugrave -50
+KPX Aring Uhungarumlaut -50
+KPX Aring Umacron -50
+KPX Aring Uogonek -50
+KPX Aring Uring -50
+KPX Aring V -80
+KPX Aring W -60
+KPX Aring Y -110
+KPX Aring Yacute -110
+KPX Aring Ydieresis -110
+KPX Aring u -30
+KPX Aring uacute -30
+KPX Aring ucircumflex -30
+KPX Aring udieresis -30
+KPX Aring ugrave -30
+KPX Aring uhungarumlaut -30
+KPX Aring umacron -30
+KPX Aring uogonek -30
+KPX Aring uring -30
+KPX Aring v -40
+KPX Aring w -30
+KPX Aring y -30
+KPX Aring yacute -30
+KPX Aring ydieresis -30
+KPX Atilde C -40
+KPX Atilde Cacute -40
+KPX Atilde Ccaron -40
+KPX Atilde Ccedilla -40
+KPX Atilde G -50
+KPX Atilde Gbreve -50
+KPX Atilde Gcommaaccent -50
+KPX Atilde O -40
+KPX Atilde Oacute -40
+KPX Atilde Ocircumflex -40
+KPX Atilde Odieresis -40
+KPX Atilde Ograve -40
+KPX Atilde Ohungarumlaut -40
+KPX Atilde Omacron -40
+KPX Atilde Oslash -40
+KPX Atilde Otilde -40
+KPX Atilde Q -40
+KPX Atilde T -90
+KPX Atilde Tcaron -90
+KPX Atilde Tcommaaccent -90
+KPX Atilde U -50
+KPX Atilde Uacute -50
+KPX Atilde Ucircumflex -50
+KPX Atilde Udieresis -50
+KPX Atilde Ugrave -50
+KPX Atilde Uhungarumlaut -50
+KPX Atilde Umacron -50
+KPX Atilde Uogonek -50
+KPX Atilde Uring -50
+KPX Atilde V -80
+KPX Atilde W -60
+KPX Atilde Y -110
+KPX Atilde Yacute -110
+KPX Atilde Ydieresis -110
+KPX Atilde u -30
+KPX Atilde uacute -30
+KPX Atilde ucircumflex -30
+KPX Atilde udieresis -30
+KPX Atilde ugrave -30
+KPX Atilde uhungarumlaut -30
+KPX Atilde umacron -30
+KPX Atilde uogonek -30
+KPX Atilde uring -30
+KPX Atilde v -40
+KPX Atilde w -30
+KPX Atilde y -30
+KPX Atilde yacute -30
+KPX Atilde ydieresis -30
+KPX B A -30
+KPX B Aacute -30
+KPX B Abreve -30
+KPX B Acircumflex -30
+KPX B Adieresis -30
+KPX B Agrave -30
+KPX B Amacron -30
+KPX B Aogonek -30
+KPX B Aring -30
+KPX B Atilde -30
+KPX B U -10
+KPX B Uacute -10
+KPX B Ucircumflex -10
+KPX B Udieresis -10
+KPX B Ugrave -10
+KPX B Uhungarumlaut -10
+KPX B Umacron -10
+KPX B Uogonek -10
+KPX B Uring -10
+KPX D A -40
+KPX D Aacute -40
+KPX D Abreve -40
+KPX D Acircumflex -40
+KPX D Adieresis -40
+KPX D Agrave -40
+KPX D Amacron -40
+KPX D Aogonek -40
+KPX D Aring -40
+KPX D Atilde -40
+KPX D V -40
+KPX D W -40
+KPX D Y -70
+KPX D Yacute -70
+KPX D Ydieresis -70
+KPX D comma -30
+KPX D period -30
+KPX Dcaron A -40
+KPX Dcaron Aacute -40
+KPX Dcaron Abreve -40
+KPX Dcaron Acircumflex -40
+KPX Dcaron Adieresis -40
+KPX Dcaron Agrave -40
+KPX Dcaron Amacron -40
+KPX Dcaron Aogonek -40
+KPX Dcaron Aring -40
+KPX Dcaron Atilde -40
+KPX Dcaron V -40
+KPX Dcaron W -40
+KPX Dcaron Y -70
+KPX Dcaron Yacute -70
+KPX Dcaron Ydieresis -70
+KPX Dcaron comma -30
+KPX Dcaron period -30
+KPX Dcroat A -40
+KPX Dcroat Aacute -40
+KPX Dcroat Abreve -40
+KPX Dcroat Acircumflex -40
+KPX Dcroat Adieresis -40
+KPX Dcroat Agrave -40
+KPX Dcroat Amacron -40
+KPX Dcroat Aogonek -40
+KPX Dcroat Aring -40
+KPX Dcroat Atilde -40
+KPX Dcroat V -40
+KPX Dcroat W -40
+KPX Dcroat Y -70
+KPX Dcroat Yacute -70
+KPX Dcroat Ydieresis -70
+KPX Dcroat comma -30
+KPX Dcroat period -30
+KPX F A -80
+KPX F Aacute -80
+KPX F Abreve -80
+KPX F Acircumflex -80
+KPX F Adieresis -80
+KPX F Agrave -80
+KPX F Amacron -80
+KPX F Aogonek -80
+KPX F Aring -80
+KPX F Atilde -80
+KPX F a -20
+KPX F aacute -20
+KPX F abreve -20
+KPX F acircumflex -20
+KPX F adieresis -20
+KPX F agrave -20
+KPX F amacron -20
+KPX F aogonek -20
+KPX F aring -20
+KPX F atilde -20
+KPX F comma -100
+KPX F period -100
+KPX J A -20
+KPX J Aacute -20
+KPX J Abreve -20
+KPX J Acircumflex -20
+KPX J Adieresis -20
+KPX J Agrave -20
+KPX J Amacron -20
+KPX J Aogonek -20
+KPX J Aring -20
+KPX J Atilde -20
+KPX J comma -20
+KPX J period -20
+KPX J u -20
+KPX J uacute -20
+KPX J ucircumflex -20
+KPX J udieresis -20
+KPX J ugrave -20
+KPX J uhungarumlaut -20
+KPX J umacron -20
+KPX J uogonek -20
+KPX J uring -20
+KPX K O -30
+KPX K Oacute -30
+KPX K Ocircumflex -30
+KPX K Odieresis -30
+KPX K Ograve -30
+KPX K Ohungarumlaut -30
+KPX K Omacron -30
+KPX K Oslash -30
+KPX K Otilde -30
+KPX K e -15
+KPX K eacute -15
+KPX K ecaron -15
+KPX K ecircumflex -15
+KPX K edieresis -15
+KPX K edotaccent -15
+KPX K egrave -15
+KPX K emacron -15
+KPX K eogonek -15
+KPX K o -35
+KPX K oacute -35
+KPX K ocircumflex -35
+KPX K odieresis -35
+KPX K ograve -35
+KPX K ohungarumlaut -35
+KPX K omacron -35
+KPX K oslash -35
+KPX K otilde -35
+KPX K u -30
+KPX K uacute -30
+KPX K ucircumflex -30
+KPX K udieresis -30
+KPX K ugrave -30
+KPX K uhungarumlaut -30
+KPX K umacron -30
+KPX K uogonek -30
+KPX K uring -30
+KPX K y -40
+KPX K yacute -40
+KPX K ydieresis -40
+KPX Kcommaaccent O -30
+KPX Kcommaaccent Oacute -30
+KPX Kcommaaccent Ocircumflex -30
+KPX Kcommaaccent Odieresis -30
+KPX Kcommaaccent Ograve -30
+KPX Kcommaaccent Ohungarumlaut -30
+KPX Kcommaaccent Omacron -30
+KPX Kcommaaccent Oslash -30
+KPX Kcommaaccent Otilde -30
+KPX Kcommaaccent e -15
+KPX Kcommaaccent eacute -15
+KPX Kcommaaccent ecaron -15
+KPX Kcommaaccent ecircumflex -15
+KPX Kcommaaccent edieresis -15
+KPX Kcommaaccent edotaccent -15
+KPX Kcommaaccent egrave -15
+KPX Kcommaaccent emacron -15
+KPX Kcommaaccent eogonek -15
+KPX Kcommaaccent o -35
+KPX Kcommaaccent oacute -35
+KPX Kcommaaccent ocircumflex -35
+KPX Kcommaaccent odieresis -35
+KPX Kcommaaccent ograve -35
+KPX Kcommaaccent ohungarumlaut -35
+KPX Kcommaaccent omacron -35
+KPX Kcommaaccent oslash -35
+KPX Kcommaaccent otilde -35
+KPX Kcommaaccent u -30
+KPX Kcommaaccent uacute -30
+KPX Kcommaaccent ucircumflex -30
+KPX Kcommaaccent udieresis -30
+KPX Kcommaaccent ugrave -30
+KPX Kcommaaccent uhungarumlaut -30
+KPX Kcommaaccent umacron -30
+KPX Kcommaaccent uogonek -30
+KPX Kcommaaccent uring -30
+KPX Kcommaaccent y -40
+KPX Kcommaaccent yacute -40
+KPX Kcommaaccent ydieresis -40
+KPX L T -90
+KPX L Tcaron -90
+KPX L Tcommaaccent -90
+KPX L V -110
+KPX L W -80
+KPX L Y -120
+KPX L Yacute -120
+KPX L Ydieresis -120
+KPX L quotedblright -140
+KPX L quoteright -140
+KPX L y -30
+KPX L yacute -30
+KPX L ydieresis -30
+KPX Lacute T -90
+KPX Lacute Tcaron -90
+KPX Lacute Tcommaaccent -90
+KPX Lacute V -110
+KPX Lacute W -80
+KPX Lacute Y -120
+KPX Lacute Yacute -120
+KPX Lacute Ydieresis -120
+KPX Lacute quotedblright -140
+KPX Lacute quoteright -140
+KPX Lacute y -30
+KPX Lacute yacute -30
+KPX Lacute ydieresis -30
+KPX Lcommaaccent T -90
+KPX Lcommaaccent Tcaron -90
+KPX Lcommaaccent Tcommaaccent -90
+KPX Lcommaaccent V -110
+KPX Lcommaaccent W -80
+KPX Lcommaaccent Y -120
+KPX Lcommaaccent Yacute -120
+KPX Lcommaaccent Ydieresis -120
+KPX Lcommaaccent quotedblright -140
+KPX Lcommaaccent quoteright -140
+KPX Lcommaaccent y -30
+KPX Lcommaaccent yacute -30
+KPX Lcommaaccent ydieresis -30
+KPX Lslash T -90
+KPX Lslash Tcaron -90
+KPX Lslash Tcommaaccent -90
+KPX Lslash V -110
+KPX Lslash W -80
+KPX Lslash Y -120
+KPX Lslash Yacute -120
+KPX Lslash Ydieresis -120
+KPX Lslash quotedblright -140
+KPX Lslash quoteright -140
+KPX Lslash y -30
+KPX Lslash yacute -30
+KPX Lslash ydieresis -30
+KPX O A -50
+KPX O Aacute -50
+KPX O Abreve -50
+KPX O Acircumflex -50
+KPX O Adieresis -50
+KPX O Agrave -50
+KPX O Amacron -50
+KPX O Aogonek -50
+KPX O Aring -50
+KPX O Atilde -50
+KPX O T -40
+KPX O Tcaron -40
+KPX O Tcommaaccent -40
+KPX O V -50
+KPX O W -50
+KPX O X -50
+KPX O Y -70
+KPX O Yacute -70
+KPX O Ydieresis -70
+KPX O comma -40
+KPX O period -40
+KPX Oacute A -50
+KPX Oacute Aacute -50
+KPX Oacute Abreve -50
+KPX Oacute Acircumflex -50
+KPX Oacute Adieresis -50
+KPX Oacute Agrave -50
+KPX Oacute Amacron -50
+KPX Oacute Aogonek -50
+KPX Oacute Aring -50
+KPX Oacute Atilde -50
+KPX Oacute T -40
+KPX Oacute Tcaron -40
+KPX Oacute Tcommaaccent -40
+KPX Oacute V -50
+KPX Oacute W -50
+KPX Oacute X -50
+KPX Oacute Y -70
+KPX Oacute Yacute -70
+KPX Oacute Ydieresis -70
+KPX Oacute comma -40
+KPX Oacute period -40
+KPX Ocircumflex A -50
+KPX Ocircumflex Aacute -50
+KPX Ocircumflex Abreve -50
+KPX Ocircumflex Acircumflex -50
+KPX Ocircumflex Adieresis -50
+KPX Ocircumflex Agrave -50
+KPX Ocircumflex Amacron -50
+KPX Ocircumflex Aogonek -50
+KPX Ocircumflex Aring -50
+KPX Ocircumflex Atilde -50
+KPX Ocircumflex T -40
+KPX Ocircumflex Tcaron -40
+KPX Ocircumflex Tcommaaccent -40
+KPX Ocircumflex V -50
+KPX Ocircumflex W -50
+KPX Ocircumflex X -50
+KPX Ocircumflex Y -70
+KPX Ocircumflex Yacute -70
+KPX Ocircumflex Ydieresis -70
+KPX Ocircumflex comma -40
+KPX Ocircumflex period -40
+KPX Odieresis A -50
+KPX Odieresis Aacute -50
+KPX Odieresis Abreve -50
+KPX Odieresis Acircumflex -50
+KPX Odieresis Adieresis -50
+KPX Odieresis Agrave -50
+KPX Odieresis Amacron -50
+KPX Odieresis Aogonek -50
+KPX Odieresis Aring -50
+KPX Odieresis Atilde -50
+KPX Odieresis T -40
+KPX Odieresis Tcaron -40
+KPX Odieresis Tcommaaccent -40
+KPX Odieresis V -50
+KPX Odieresis W -50
+KPX Odieresis X -50
+KPX Odieresis Y -70
+KPX Odieresis Yacute -70
+KPX Odieresis Ydieresis -70
+KPX Odieresis comma -40
+KPX Odieresis period -40
+KPX Ograve A -50
+KPX Ograve Aacute -50
+KPX Ograve Abreve -50
+KPX Ograve Acircumflex -50
+KPX Ograve Adieresis -50
+KPX Ograve Agrave -50
+KPX Ograve Amacron -50
+KPX Ograve Aogonek -50
+KPX Ograve Aring -50
+KPX Ograve Atilde -50
+KPX Ograve T -40
+KPX Ograve Tcaron -40
+KPX Ograve Tcommaaccent -40
+KPX Ograve V -50
+KPX Ograve W -50
+KPX Ograve X -50
+KPX Ograve Y -70
+KPX Ograve Yacute -70
+KPX Ograve Ydieresis -70
+KPX Ograve comma -40
+KPX Ograve period -40
+KPX Ohungarumlaut A -50
+KPX Ohungarumlaut Aacute -50
+KPX Ohungarumlaut Abreve -50
+KPX Ohungarumlaut Acircumflex -50
+KPX Ohungarumlaut Adieresis -50
+KPX Ohungarumlaut Agrave -50
+KPX Ohungarumlaut Amacron -50
+KPX Ohungarumlaut Aogonek -50
+KPX Ohungarumlaut Aring -50
+KPX Ohungarumlaut Atilde -50
+KPX Ohungarumlaut T -40
+KPX Ohungarumlaut Tcaron -40
+KPX Ohungarumlaut Tcommaaccent -40
+KPX Ohungarumlaut V -50
+KPX Ohungarumlaut W -50
+KPX Ohungarumlaut X -50
+KPX Ohungarumlaut Y -70
+KPX Ohungarumlaut Yacute -70
+KPX Ohungarumlaut Ydieresis -70
+KPX Ohungarumlaut comma -40
+KPX Ohungarumlaut period -40
+KPX Omacron A -50
+KPX Omacron Aacute -50
+KPX Omacron Abreve -50
+KPX Omacron Acircumflex -50
+KPX Omacron Adieresis -50
+KPX Omacron Agrave -50
+KPX Omacron Amacron -50
+KPX Omacron Aogonek -50
+KPX Omacron Aring -50
+KPX Omacron Atilde -50
+KPX Omacron T -40
+KPX Omacron Tcaron -40
+KPX Omacron Tcommaaccent -40
+KPX Omacron V -50
+KPX Omacron W -50
+KPX Omacron X -50
+KPX Omacron Y -70
+KPX Omacron Yacute -70
+KPX Omacron Ydieresis -70
+KPX Omacron comma -40
+KPX Omacron period -40
+KPX Oslash A -50
+KPX Oslash Aacute -50
+KPX Oslash Abreve -50
+KPX Oslash Acircumflex -50
+KPX Oslash Adieresis -50
+KPX Oslash Agrave -50
+KPX Oslash Amacron -50
+KPX Oslash Aogonek -50
+KPX Oslash Aring -50
+KPX Oslash Atilde -50
+KPX Oslash T -40
+KPX Oslash Tcaron -40
+KPX Oslash Tcommaaccent -40
+KPX Oslash V -50
+KPX Oslash W -50
+KPX Oslash X -50
+KPX Oslash Y -70
+KPX Oslash Yacute -70
+KPX Oslash Ydieresis -70
+KPX Oslash comma -40
+KPX Oslash period -40
+KPX Otilde A -50
+KPX Otilde Aacute -50
+KPX Otilde Abreve -50
+KPX Otilde Acircumflex -50
+KPX Otilde Adieresis -50
+KPX Otilde Agrave -50
+KPX Otilde Amacron -50
+KPX Otilde Aogonek -50
+KPX Otilde Aring -50
+KPX Otilde Atilde -50
+KPX Otilde T -40
+KPX Otilde Tcaron -40
+KPX Otilde Tcommaaccent -40
+KPX Otilde V -50
+KPX Otilde W -50
+KPX Otilde X -50
+KPX Otilde Y -70
+KPX Otilde Yacute -70
+KPX Otilde Ydieresis -70
+KPX Otilde comma -40
+KPX Otilde period -40
+KPX P A -100
+KPX P Aacute -100
+KPX P Abreve -100
+KPX P Acircumflex -100
+KPX P Adieresis -100
+KPX P Agrave -100
+KPX P Amacron -100
+KPX P Aogonek -100
+KPX P Aring -100
+KPX P Atilde -100
+KPX P a -30
+KPX P aacute -30
+KPX P abreve -30
+KPX P acircumflex -30
+KPX P adieresis -30
+KPX P agrave -30
+KPX P amacron -30
+KPX P aogonek -30
+KPX P aring -30
+KPX P atilde -30
+KPX P comma -120
+KPX P e -30
+KPX P eacute -30
+KPX P ecaron -30
+KPX P ecircumflex -30
+KPX P edieresis -30
+KPX P edotaccent -30
+KPX P egrave -30
+KPX P emacron -30
+KPX P eogonek -30
+KPX P o -40
+KPX P oacute -40
+KPX P ocircumflex -40
+KPX P odieresis -40
+KPX P ograve -40
+KPX P ohungarumlaut -40
+KPX P omacron -40
+KPX P oslash -40
+KPX P otilde -40
+KPX P period -120
+KPX Q U -10
+KPX Q Uacute -10
+KPX Q Ucircumflex -10
+KPX Q Udieresis -10
+KPX Q Ugrave -10
+KPX Q Uhungarumlaut -10
+KPX Q Umacron -10
+KPX Q Uogonek -10
+KPX Q Uring -10
+KPX Q comma 20
+KPX Q period 20
+KPX R O -20
+KPX R Oacute -20
+KPX R Ocircumflex -20
+KPX R Odieresis -20
+KPX R Ograve -20
+KPX R Ohungarumlaut -20
+KPX R Omacron -20
+KPX R Oslash -20
+KPX R Otilde -20
+KPX R T -20
+KPX R Tcaron -20
+KPX R Tcommaaccent -20
+KPX R U -20
+KPX R Uacute -20
+KPX R Ucircumflex -20
+KPX R Udieresis -20
+KPX R Ugrave -20
+KPX R Uhungarumlaut -20
+KPX R Umacron -20
+KPX R Uogonek -20
+KPX R Uring -20
+KPX R V -50
+KPX R W -40
+KPX R Y -50
+KPX R Yacute -50
+KPX R Ydieresis -50
+KPX Racute O -20
+KPX Racute Oacute -20
+KPX Racute Ocircumflex -20
+KPX Racute Odieresis -20
+KPX Racute Ograve -20
+KPX Racute Ohungarumlaut -20
+KPX Racute Omacron -20
+KPX Racute Oslash -20
+KPX Racute Otilde -20
+KPX Racute T -20
+KPX Racute Tcaron -20
+KPX Racute Tcommaaccent -20
+KPX Racute U -20
+KPX Racute Uacute -20
+KPX Racute Ucircumflex -20
+KPX Racute Udieresis -20
+KPX Racute Ugrave -20
+KPX Racute Uhungarumlaut -20
+KPX Racute Umacron -20
+KPX Racute Uogonek -20
+KPX Racute Uring -20
+KPX Racute V -50
+KPX Racute W -40
+KPX Racute Y -50
+KPX Racute Yacute -50
+KPX Racute Ydieresis -50
+KPX Rcaron O -20
+KPX Rcaron Oacute -20
+KPX Rcaron Ocircumflex -20
+KPX Rcaron Odieresis -20
+KPX Rcaron Ograve -20
+KPX Rcaron Ohungarumlaut -20
+KPX Rcaron Omacron -20
+KPX Rcaron Oslash -20
+KPX Rcaron Otilde -20
+KPX Rcaron T -20
+KPX Rcaron Tcaron -20
+KPX Rcaron Tcommaaccent -20
+KPX Rcaron U -20
+KPX Rcaron Uacute -20
+KPX Rcaron Ucircumflex -20
+KPX Rcaron Udieresis -20
+KPX Rcaron Ugrave -20
+KPX Rcaron Uhungarumlaut -20
+KPX Rcaron Umacron -20
+KPX Rcaron Uogonek -20
+KPX Rcaron Uring -20
+KPX Rcaron V -50
+KPX Rcaron W -40
+KPX Rcaron Y -50
+KPX Rcaron Yacute -50
+KPX Rcaron Ydieresis -50
+KPX Rcommaaccent O -20
+KPX Rcommaaccent Oacute -20
+KPX Rcommaaccent Ocircumflex -20
+KPX Rcommaaccent Odieresis -20
+KPX Rcommaaccent Ograve -20
+KPX Rcommaaccent Ohungarumlaut -20
+KPX Rcommaaccent Omacron -20
+KPX Rcommaaccent Oslash -20
+KPX Rcommaaccent Otilde -20
+KPX Rcommaaccent T -20
+KPX Rcommaaccent Tcaron -20
+KPX Rcommaaccent Tcommaaccent -20
+KPX Rcommaaccent U -20
+KPX Rcommaaccent Uacute -20
+KPX Rcommaaccent Ucircumflex -20
+KPX Rcommaaccent Udieresis -20
+KPX Rcommaaccent Ugrave -20
+KPX Rcommaaccent Uhungarumlaut -20
+KPX Rcommaaccent Umacron -20
+KPX Rcommaaccent Uogonek -20
+KPX Rcommaaccent Uring -20
+KPX Rcommaaccent V -50
+KPX Rcommaaccent W -40
+KPX Rcommaaccent Y -50
+KPX Rcommaaccent Yacute -50
+KPX Rcommaaccent Ydieresis -50
+KPX T A -90
+KPX T Aacute -90
+KPX T Abreve -90
+KPX T Acircumflex -90
+KPX T Adieresis -90
+KPX T Agrave -90
+KPX T Amacron -90
+KPX T Aogonek -90
+KPX T Aring -90
+KPX T Atilde -90
+KPX T O -40
+KPX T Oacute -40
+KPX T Ocircumflex -40
+KPX T Odieresis -40
+KPX T Ograve -40
+KPX T Ohungarumlaut -40
+KPX T Omacron -40
+KPX T Oslash -40
+KPX T Otilde -40
+KPX T a -80
+KPX T aacute -80
+KPX T abreve -80
+KPX T acircumflex -80
+KPX T adieresis -80
+KPX T agrave -80
+KPX T amacron -80
+KPX T aogonek -80
+KPX T aring -80
+KPX T atilde -80
+KPX T colon -40
+KPX T comma -80
+KPX T e -60
+KPX T eacute -60
+KPX T ecaron -60
+KPX T ecircumflex -60
+KPX T edieresis -60
+KPX T edotaccent -60
+KPX T egrave -60
+KPX T emacron -60
+KPX T eogonek -60
+KPX T hyphen -120
+KPX T o -80
+KPX T oacute -80
+KPX T ocircumflex -80
+KPX T odieresis -80
+KPX T ograve -80
+KPX T ohungarumlaut -80
+KPX T omacron -80
+KPX T oslash -80
+KPX T otilde -80
+KPX T period -80
+KPX T r -80
+KPX T racute -80
+KPX T rcommaaccent -80
+KPX T semicolon -40
+KPX T u -90
+KPX T uacute -90
+KPX T ucircumflex -90
+KPX T udieresis -90
+KPX T ugrave -90
+KPX T uhungarumlaut -90
+KPX T umacron -90
+KPX T uogonek -90
+KPX T uring -90
+KPX T w -60
+KPX T y -60
+KPX T yacute -60
+KPX T ydieresis -60
+KPX Tcaron A -90
+KPX Tcaron Aacute -90
+KPX Tcaron Abreve -90
+KPX Tcaron Acircumflex -90
+KPX Tcaron Adieresis -90
+KPX Tcaron Agrave -90
+KPX Tcaron Amacron -90
+KPX Tcaron Aogonek -90
+KPX Tcaron Aring -90
+KPX Tcaron Atilde -90
+KPX Tcaron O -40
+KPX Tcaron Oacute -40
+KPX Tcaron Ocircumflex -40
+KPX Tcaron Odieresis -40
+KPX Tcaron Ograve -40
+KPX Tcaron Ohungarumlaut -40
+KPX Tcaron Omacron -40
+KPX Tcaron Oslash -40
+KPX Tcaron Otilde -40
+KPX Tcaron a -80
+KPX Tcaron aacute -80
+KPX Tcaron abreve -80
+KPX Tcaron acircumflex -80
+KPX Tcaron adieresis -80
+KPX Tcaron agrave -80
+KPX Tcaron amacron -80
+KPX Tcaron aogonek -80
+KPX Tcaron aring -80
+KPX Tcaron atilde -80
+KPX Tcaron colon -40
+KPX Tcaron comma -80
+KPX Tcaron e -60
+KPX Tcaron eacute -60
+KPX Tcaron ecaron -60
+KPX Tcaron ecircumflex -60
+KPX Tcaron edieresis -60
+KPX Tcaron edotaccent -60
+KPX Tcaron egrave -60
+KPX Tcaron emacron -60
+KPX Tcaron eogonek -60
+KPX Tcaron hyphen -120
+KPX Tcaron o -80
+KPX Tcaron oacute -80
+KPX Tcaron ocircumflex -80
+KPX Tcaron odieresis -80
+KPX Tcaron ograve -80
+KPX Tcaron ohungarumlaut -80
+KPX Tcaron omacron -80
+KPX Tcaron oslash -80
+KPX Tcaron otilde -80
+KPX Tcaron period -80
+KPX Tcaron r -80
+KPX Tcaron racute -80
+KPX Tcaron rcommaaccent -80
+KPX Tcaron semicolon -40
+KPX Tcaron u -90
+KPX Tcaron uacute -90
+KPX Tcaron ucircumflex -90
+KPX Tcaron udieresis -90
+KPX Tcaron ugrave -90
+KPX Tcaron uhungarumlaut -90
+KPX Tcaron umacron -90
+KPX Tcaron uogonek -90
+KPX Tcaron uring -90
+KPX Tcaron w -60
+KPX Tcaron y -60
+KPX Tcaron yacute -60
+KPX Tcaron ydieresis -60
+KPX Tcommaaccent A -90
+KPX Tcommaaccent Aacute -90
+KPX Tcommaaccent Abreve -90
+KPX Tcommaaccent Acircumflex -90
+KPX Tcommaaccent Adieresis -90
+KPX Tcommaaccent Agrave -90
+KPX Tcommaaccent Amacron -90
+KPX Tcommaaccent Aogonek -90
+KPX Tcommaaccent Aring -90
+KPX Tcommaaccent Atilde -90
+KPX Tcommaaccent O -40
+KPX Tcommaaccent Oacute -40
+KPX Tcommaaccent Ocircumflex -40
+KPX Tcommaaccent Odieresis -40
+KPX Tcommaaccent Ograve -40
+KPX Tcommaaccent Ohungarumlaut -40
+KPX Tcommaaccent Omacron -40
+KPX Tcommaaccent Oslash -40
+KPX Tcommaaccent Otilde -40
+KPX Tcommaaccent a -80
+KPX Tcommaaccent aacute -80
+KPX Tcommaaccent abreve -80
+KPX Tcommaaccent acircumflex -80
+KPX Tcommaaccent adieresis -80
+KPX Tcommaaccent agrave -80
+KPX Tcommaaccent amacron -80
+KPX Tcommaaccent aogonek -80
+KPX Tcommaaccent aring -80
+KPX Tcommaaccent atilde -80
+KPX Tcommaaccent colon -40
+KPX Tcommaaccent comma -80
+KPX Tcommaaccent e -60
+KPX Tcommaaccent eacute -60
+KPX Tcommaaccent ecaron -60
+KPX Tcommaaccent ecircumflex -60
+KPX Tcommaaccent edieresis -60
+KPX Tcommaaccent edotaccent -60
+KPX Tcommaaccent egrave -60
+KPX Tcommaaccent emacron -60
+KPX Tcommaaccent eogonek -60
+KPX Tcommaaccent hyphen -120
+KPX Tcommaaccent o -80
+KPX Tcommaaccent oacute -80
+KPX Tcommaaccent ocircumflex -80
+KPX Tcommaaccent odieresis -80
+KPX Tcommaaccent ograve -80
+KPX Tcommaaccent ohungarumlaut -80
+KPX Tcommaaccent omacron -80
+KPX Tcommaaccent oslash -80
+KPX Tcommaaccent otilde -80
+KPX Tcommaaccent period -80
+KPX Tcommaaccent r -80
+KPX Tcommaaccent racute -80
+KPX Tcommaaccent rcommaaccent -80
+KPX Tcommaaccent semicolon -40
+KPX Tcommaaccent u -90
+KPX Tcommaaccent uacute -90
+KPX Tcommaaccent ucircumflex -90
+KPX Tcommaaccent udieresis -90
+KPX Tcommaaccent ugrave -90
+KPX Tcommaaccent uhungarumlaut -90
+KPX Tcommaaccent umacron -90
+KPX Tcommaaccent uogonek -90
+KPX Tcommaaccent uring -90
+KPX Tcommaaccent w -60
+KPX Tcommaaccent y -60
+KPX Tcommaaccent yacute -60
+KPX Tcommaaccent ydieresis -60
+KPX U A -50
+KPX U Aacute -50
+KPX U Abreve -50
+KPX U Acircumflex -50
+KPX U Adieresis -50
+KPX U Agrave -50
+KPX U Amacron -50
+KPX U Aogonek -50
+KPX U Aring -50
+KPX U Atilde -50
+KPX U comma -30
+KPX U period -30
+KPX Uacute A -50
+KPX Uacute Aacute -50
+KPX Uacute Abreve -50
+KPX Uacute Acircumflex -50
+KPX Uacute Adieresis -50
+KPX Uacute Agrave -50
+KPX Uacute Amacron -50
+KPX Uacute Aogonek -50
+KPX Uacute Aring -50
+KPX Uacute Atilde -50
+KPX Uacute comma -30
+KPX Uacute period -30
+KPX Ucircumflex A -50
+KPX Ucircumflex Aacute -50
+KPX Ucircumflex Abreve -50
+KPX Ucircumflex Acircumflex -50
+KPX Ucircumflex Adieresis -50
+KPX Ucircumflex Agrave -50
+KPX Ucircumflex Amacron -50
+KPX Ucircumflex Aogonek -50
+KPX Ucircumflex Aring -50
+KPX Ucircumflex Atilde -50
+KPX Ucircumflex comma -30
+KPX Ucircumflex period -30
+KPX Udieresis A -50
+KPX Udieresis Aacute -50
+KPX Udieresis Abreve -50
+KPX Udieresis Acircumflex -50
+KPX Udieresis Adieresis -50
+KPX Udieresis Agrave -50
+KPX Udieresis Amacron -50
+KPX Udieresis Aogonek -50
+KPX Udieresis Aring -50
+KPX Udieresis Atilde -50
+KPX Udieresis comma -30
+KPX Udieresis period -30
+KPX Ugrave A -50
+KPX Ugrave Aacute -50
+KPX Ugrave Abreve -50
+KPX Ugrave Acircumflex -50
+KPX Ugrave Adieresis -50
+KPX Ugrave Agrave -50
+KPX Ugrave Amacron -50
+KPX Ugrave Aogonek -50
+KPX Ugrave Aring -50
+KPX Ugrave Atilde -50
+KPX Ugrave comma -30
+KPX Ugrave period -30
+KPX Uhungarumlaut A -50
+KPX Uhungarumlaut Aacute -50
+KPX Uhungarumlaut Abreve -50
+KPX Uhungarumlaut Acircumflex -50
+KPX Uhungarumlaut Adieresis -50
+KPX Uhungarumlaut Agrave -50
+KPX Uhungarumlaut Amacron -50
+KPX Uhungarumlaut Aogonek -50
+KPX Uhungarumlaut Aring -50
+KPX Uhungarumlaut Atilde -50
+KPX Uhungarumlaut comma -30
+KPX Uhungarumlaut period -30
+KPX Umacron A -50
+KPX Umacron Aacute -50
+KPX Umacron Abreve -50
+KPX Umacron Acircumflex -50
+KPX Umacron Adieresis -50
+KPX Umacron Agrave -50
+KPX Umacron Amacron -50
+KPX Umacron Aogonek -50
+KPX Umacron Aring -50
+KPX Umacron Atilde -50
+KPX Umacron comma -30
+KPX Umacron period -30
+KPX Uogonek A -50
+KPX Uogonek Aacute -50
+KPX Uogonek Abreve -50
+KPX Uogonek Acircumflex -50
+KPX Uogonek Adieresis -50
+KPX Uogonek Agrave -50
+KPX Uogonek Amacron -50
+KPX Uogonek Aogonek -50
+KPX Uogonek Aring -50
+KPX Uogonek Atilde -50
+KPX Uogonek comma -30
+KPX Uogonek period -30
+KPX Uring A -50
+KPX Uring Aacute -50
+KPX Uring Abreve -50
+KPX Uring Acircumflex -50
+KPX Uring Adieresis -50
+KPX Uring Agrave -50
+KPX Uring Amacron -50
+KPX Uring Aogonek -50
+KPX Uring Aring -50
+KPX Uring Atilde -50
+KPX Uring comma -30
+KPX Uring period -30
+KPX V A -80
+KPX V Aacute -80
+KPX V Abreve -80
+KPX V Acircumflex -80
+KPX V Adieresis -80
+KPX V Agrave -80
+KPX V Amacron -80
+KPX V Aogonek -80
+KPX V Aring -80
+KPX V Atilde -80
+KPX V G -50
+KPX V Gbreve -50
+KPX V Gcommaaccent -50
+KPX V O -50
+KPX V Oacute -50
+KPX V Ocircumflex -50
+KPX V Odieresis -50
+KPX V Ograve -50
+KPX V Ohungarumlaut -50
+KPX V Omacron -50
+KPX V Oslash -50
+KPX V Otilde -50
+KPX V a -60
+KPX V aacute -60
+KPX V abreve -60
+KPX V acircumflex -60
+KPX V adieresis -60
+KPX V agrave -60
+KPX V amacron -60
+KPX V aogonek -60
+KPX V aring -60
+KPX V atilde -60
+KPX V colon -40
+KPX V comma -120
+KPX V e -50
+KPX V eacute -50
+KPX V ecaron -50
+KPX V ecircumflex -50
+KPX V edieresis -50
+KPX V edotaccent -50
+KPX V egrave -50
+KPX V emacron -50
+KPX V eogonek -50
+KPX V hyphen -80
+KPX V o -90
+KPX V oacute -90
+KPX V ocircumflex -90
+KPX V odieresis -90
+KPX V ograve -90
+KPX V ohungarumlaut -90
+KPX V omacron -90
+KPX V oslash -90
+KPX V otilde -90
+KPX V period -120
+KPX V semicolon -40
+KPX V u -60
+KPX V uacute -60
+KPX V ucircumflex -60
+KPX V udieresis -60
+KPX V ugrave -60
+KPX V uhungarumlaut -60
+KPX V umacron -60
+KPX V uogonek -60
+KPX V uring -60
+KPX W A -60
+KPX W Aacute -60
+KPX W Abreve -60
+KPX W Acircumflex -60
+KPX W Adieresis -60
+KPX W Agrave -60
+KPX W Amacron -60
+KPX W Aogonek -60
+KPX W Aring -60
+KPX W Atilde -60
+KPX W O -20
+KPX W Oacute -20
+KPX W Ocircumflex -20
+KPX W Odieresis -20
+KPX W Ograve -20
+KPX W Ohungarumlaut -20
+KPX W Omacron -20
+KPX W Oslash -20
+KPX W Otilde -20
+KPX W a -40
+KPX W aacute -40
+KPX W abreve -40
+KPX W acircumflex -40
+KPX W adieresis -40
+KPX W agrave -40
+KPX W amacron -40
+KPX W aogonek -40
+KPX W aring -40
+KPX W atilde -40
+KPX W colon -10
+KPX W comma -80
+KPX W e -35
+KPX W eacute -35
+KPX W ecaron -35
+KPX W ecircumflex -35
+KPX W edieresis -35
+KPX W edotaccent -35
+KPX W egrave -35
+KPX W emacron -35
+KPX W eogonek -35
+KPX W hyphen -40
+KPX W o -60
+KPX W oacute -60
+KPX W ocircumflex -60
+KPX W odieresis -60
+KPX W ograve -60
+KPX W ohungarumlaut -60
+KPX W omacron -60
+KPX W oslash -60
+KPX W otilde -60
+KPX W period -80
+KPX W semicolon -10
+KPX W u -45
+KPX W uacute -45
+KPX W ucircumflex -45
+KPX W udieresis -45
+KPX W ugrave -45
+KPX W uhungarumlaut -45
+KPX W umacron -45
+KPX W uogonek -45
+KPX W uring -45
+KPX W y -20
+KPX W yacute -20
+KPX W ydieresis -20
+KPX Y A -110
+KPX Y Aacute -110
+KPX Y Abreve -110
+KPX Y Acircumflex -110
+KPX Y Adieresis -110
+KPX Y Agrave -110
+KPX Y Amacron -110
+KPX Y Aogonek -110
+KPX Y Aring -110
+KPX Y Atilde -110
+KPX Y O -70
+KPX Y Oacute -70
+KPX Y Ocircumflex -70
+KPX Y Odieresis -70
+KPX Y Ograve -70
+KPX Y Ohungarumlaut -70
+KPX Y Omacron -70
+KPX Y Oslash -70
+KPX Y Otilde -70
+KPX Y a -90
+KPX Y aacute -90
+KPX Y abreve -90
+KPX Y acircumflex -90
+KPX Y adieresis -90
+KPX Y agrave -90
+KPX Y amacron -90
+KPX Y aogonek -90
+KPX Y aring -90
+KPX Y atilde -90
+KPX Y colon -50
+KPX Y comma -100
+KPX Y e -80
+KPX Y eacute -80
+KPX Y ecaron -80
+KPX Y ecircumflex -80
+KPX Y edieresis -80
+KPX Y edotaccent -80
+KPX Y egrave -80
+KPX Y emacron -80
+KPX Y eogonek -80
+KPX Y o -100
+KPX Y oacute -100
+KPX Y ocircumflex -100
+KPX Y odieresis -100
+KPX Y ograve -100
+KPX Y ohungarumlaut -100
+KPX Y omacron -100
+KPX Y oslash -100
+KPX Y otilde -100
+KPX Y period -100
+KPX Y semicolon -50
+KPX Y u -100
+KPX Y uacute -100
+KPX Y ucircumflex -100
+KPX Y udieresis -100
+KPX Y ugrave -100
+KPX Y uhungarumlaut -100
+KPX Y umacron -100
+KPX Y uogonek -100
+KPX Y uring -100
+KPX Yacute A -110
+KPX Yacute Aacute -110
+KPX Yacute Abreve -110
+KPX Yacute Acircumflex -110
+KPX Yacute Adieresis -110
+KPX Yacute Agrave -110
+KPX Yacute Amacron -110
+KPX Yacute Aogonek -110
+KPX Yacute Aring -110
+KPX Yacute Atilde -110
+KPX Yacute O -70
+KPX Yacute Oacute -70
+KPX Yacute Ocircumflex -70
+KPX Yacute Odieresis -70
+KPX Yacute Ograve -70
+KPX Yacute Ohungarumlaut -70
+KPX Yacute Omacron -70
+KPX Yacute Oslash -70
+KPX Yacute Otilde -70
+KPX Yacute a -90
+KPX Yacute aacute -90
+KPX Yacute abreve -90
+KPX Yacute acircumflex -90
+KPX Yacute adieresis -90
+KPX Yacute agrave -90
+KPX Yacute amacron -90
+KPX Yacute aogonek -90
+KPX Yacute aring -90
+KPX Yacute atilde -90
+KPX Yacute colon -50
+KPX Yacute comma -100
+KPX Yacute e -80
+KPX Yacute eacute -80
+KPX Yacute ecaron -80
+KPX Yacute ecircumflex -80
+KPX Yacute edieresis -80
+KPX Yacute edotaccent -80
+KPX Yacute egrave -80
+KPX Yacute emacron -80
+KPX Yacute eogonek -80
+KPX Yacute o -100
+KPX Yacute oacute -100
+KPX Yacute ocircumflex -100
+KPX Yacute odieresis -100
+KPX Yacute ograve -100
+KPX Yacute ohungarumlaut -100
+KPX Yacute omacron -100
+KPX Yacute oslash -100
+KPX Yacute otilde -100
+KPX Yacute period -100
+KPX Yacute semicolon -50
+KPX Yacute u -100
+KPX Yacute uacute -100
+KPX Yacute ucircumflex -100
+KPX Yacute udieresis -100
+KPX Yacute ugrave -100
+KPX Yacute uhungarumlaut -100
+KPX Yacute umacron -100
+KPX Yacute uogonek -100
+KPX Yacute uring -100
+KPX Ydieresis A -110
+KPX Ydieresis Aacute -110
+KPX Ydieresis Abreve -110
+KPX Ydieresis Acircumflex -110
+KPX Ydieresis Adieresis -110
+KPX Ydieresis Agrave -110
+KPX Ydieresis Amacron -110
+KPX Ydieresis Aogonek -110
+KPX Ydieresis Aring -110
+KPX Ydieresis Atilde -110
+KPX Ydieresis O -70
+KPX Ydieresis Oacute -70
+KPX Ydieresis Ocircumflex -70
+KPX Ydieresis Odieresis -70
+KPX Ydieresis Ograve -70
+KPX Ydieresis Ohungarumlaut -70
+KPX Ydieresis Omacron -70
+KPX Ydieresis Oslash -70
+KPX Ydieresis Otilde -70
+KPX Ydieresis a -90
+KPX Ydieresis aacute -90
+KPX Ydieresis abreve -90
+KPX Ydieresis acircumflex -90
+KPX Ydieresis adieresis -90
+KPX Ydieresis agrave -90
+KPX Ydieresis amacron -90
+KPX Ydieresis aogonek -90
+KPX Ydieresis aring -90
+KPX Ydieresis atilde -90
+KPX Ydieresis colon -50
+KPX Ydieresis comma -100
+KPX Ydieresis e -80
+KPX Ydieresis eacute -80
+KPX Ydieresis ecaron -80
+KPX Ydieresis ecircumflex -80
+KPX Ydieresis edieresis -80
+KPX Ydieresis edotaccent -80
+KPX Ydieresis egrave -80
+KPX Ydieresis emacron -80
+KPX Ydieresis eogonek -80
+KPX Ydieresis o -100
+KPX Ydieresis oacute -100
+KPX Ydieresis ocircumflex -100
+KPX Ydieresis odieresis -100
+KPX Ydieresis ograve -100
+KPX Ydieresis ohungarumlaut -100
+KPX Ydieresis omacron -100
+KPX Ydieresis oslash -100
+KPX Ydieresis otilde -100
+KPX Ydieresis period -100
+KPX Ydieresis semicolon -50
+KPX Ydieresis u -100
+KPX Ydieresis uacute -100
+KPX Ydieresis ucircumflex -100
+KPX Ydieresis udieresis -100
+KPX Ydieresis ugrave -100
+KPX Ydieresis uhungarumlaut -100
+KPX Ydieresis umacron -100
+KPX Ydieresis uogonek -100
+KPX Ydieresis uring -100
+KPX a g -10
+KPX a gbreve -10
+KPX a gcommaaccent -10
+KPX a v -15
+KPX a w -15
+KPX a y -20
+KPX a yacute -20
+KPX a ydieresis -20
+KPX aacute g -10
+KPX aacute gbreve -10
+KPX aacute gcommaaccent -10
+KPX aacute v -15
+KPX aacute w -15
+KPX aacute y -20
+KPX aacute yacute -20
+KPX aacute ydieresis -20
+KPX abreve g -10
+KPX abreve gbreve -10
+KPX abreve gcommaaccent -10
+KPX abreve v -15
+KPX abreve w -15
+KPX abreve y -20
+KPX abreve yacute -20
+KPX abreve ydieresis -20
+KPX acircumflex g -10
+KPX acircumflex gbreve -10
+KPX acircumflex gcommaaccent -10
+KPX acircumflex v -15
+KPX acircumflex w -15
+KPX acircumflex y -20
+KPX acircumflex yacute -20
+KPX acircumflex ydieresis -20
+KPX adieresis g -10
+KPX adieresis gbreve -10
+KPX adieresis gcommaaccent -10
+KPX adieresis v -15
+KPX adieresis w -15
+KPX adieresis y -20
+KPX adieresis yacute -20
+KPX adieresis ydieresis -20
+KPX agrave g -10
+KPX agrave gbreve -10
+KPX agrave gcommaaccent -10
+KPX agrave v -15
+KPX agrave w -15
+KPX agrave y -20
+KPX agrave yacute -20
+KPX agrave ydieresis -20
+KPX amacron g -10
+KPX amacron gbreve -10
+KPX amacron gcommaaccent -10
+KPX amacron v -15
+KPX amacron w -15
+KPX amacron y -20
+KPX amacron yacute -20
+KPX amacron ydieresis -20
+KPX aogonek g -10
+KPX aogonek gbreve -10
+KPX aogonek gcommaaccent -10
+KPX aogonek v -15
+KPX aogonek w -15
+KPX aogonek y -20
+KPX aogonek yacute -20
+KPX aogonek ydieresis -20
+KPX aring g -10
+KPX aring gbreve -10
+KPX aring gcommaaccent -10
+KPX aring v -15
+KPX aring w -15
+KPX aring y -20
+KPX aring yacute -20
+KPX aring ydieresis -20
+KPX atilde g -10
+KPX atilde gbreve -10
+KPX atilde gcommaaccent -10
+KPX atilde v -15
+KPX atilde w -15
+KPX atilde y -20
+KPX atilde yacute -20
+KPX atilde ydieresis -20
+KPX b l -10
+KPX b lacute -10
+KPX b lcommaaccent -10
+KPX b lslash -10
+KPX b u -20
+KPX b uacute -20
+KPX b ucircumflex -20
+KPX b udieresis -20
+KPX b ugrave -20
+KPX b uhungarumlaut -20
+KPX b umacron -20
+KPX b uogonek -20
+KPX b uring -20
+KPX b v -20
+KPX b y -20
+KPX b yacute -20
+KPX b ydieresis -20
+KPX c h -10
+KPX c k -20
+KPX c kcommaaccent -20
+KPX c l -20
+KPX c lacute -20
+KPX c lcommaaccent -20
+KPX c lslash -20
+KPX c y -10
+KPX c yacute -10
+KPX c ydieresis -10
+KPX cacute h -10
+KPX cacute k -20
+KPX cacute kcommaaccent -20
+KPX cacute l -20
+KPX cacute lacute -20
+KPX cacute lcommaaccent -20
+KPX cacute lslash -20
+KPX cacute y -10
+KPX cacute yacute -10
+KPX cacute ydieresis -10
+KPX ccaron h -10
+KPX ccaron k -20
+KPX ccaron kcommaaccent -20
+KPX ccaron l -20
+KPX ccaron lacute -20
+KPX ccaron lcommaaccent -20
+KPX ccaron lslash -20
+KPX ccaron y -10
+KPX ccaron yacute -10
+KPX ccaron ydieresis -10
+KPX ccedilla h -10
+KPX ccedilla k -20
+KPX ccedilla kcommaaccent -20
+KPX ccedilla l -20
+KPX ccedilla lacute -20
+KPX ccedilla lcommaaccent -20
+KPX ccedilla lslash -20
+KPX ccedilla y -10
+KPX ccedilla yacute -10
+KPX ccedilla ydieresis -10
+KPX colon space -40
+KPX comma quotedblright -120
+KPX comma quoteright -120
+KPX comma space -40
+KPX d d -10
+KPX d dcroat -10
+KPX d v -15
+KPX d w -15
+KPX d y -15
+KPX d yacute -15
+KPX d ydieresis -15
+KPX dcroat d -10
+KPX dcroat dcroat -10
+KPX dcroat v -15
+KPX dcroat w -15
+KPX dcroat y -15
+KPX dcroat yacute -15
+KPX dcroat ydieresis -15
+KPX e comma 10
+KPX e period 20
+KPX e v -15
+KPX e w -15
+KPX e x -15
+KPX e y -15
+KPX e yacute -15
+KPX e ydieresis -15
+KPX eacute comma 10
+KPX eacute period 20
+KPX eacute v -15
+KPX eacute w -15
+KPX eacute x -15
+KPX eacute y -15
+KPX eacute yacute -15
+KPX eacute ydieresis -15
+KPX ecaron comma 10
+KPX ecaron period 20
+KPX ecaron v -15
+KPX ecaron w -15
+KPX ecaron x -15
+KPX ecaron y -15
+KPX ecaron yacute -15
+KPX ecaron ydieresis -15
+KPX ecircumflex comma 10
+KPX ecircumflex period 20
+KPX ecircumflex v -15
+KPX ecircumflex w -15
+KPX ecircumflex x -15
+KPX ecircumflex y -15
+KPX ecircumflex yacute -15
+KPX ecircumflex ydieresis -15
+KPX edieresis comma 10
+KPX edieresis period 20
+KPX edieresis v -15
+KPX edieresis w -15
+KPX edieresis x -15
+KPX edieresis y -15
+KPX edieresis yacute -15
+KPX edieresis ydieresis -15
+KPX edotaccent comma 10
+KPX edotaccent period 20
+KPX edotaccent v -15
+KPX edotaccent w -15
+KPX edotaccent x -15
+KPX edotaccent y -15
+KPX edotaccent yacute -15
+KPX edotaccent ydieresis -15
+KPX egrave comma 10
+KPX egrave period 20
+KPX egrave v -15
+KPX egrave w -15
+KPX egrave x -15
+KPX egrave y -15
+KPX egrave yacute -15
+KPX egrave ydieresis -15
+KPX emacron comma 10
+KPX emacron period 20
+KPX emacron v -15
+KPX emacron w -15
+KPX emacron x -15
+KPX emacron y -15
+KPX emacron yacute -15
+KPX emacron ydieresis -15
+KPX eogonek comma 10
+KPX eogonek period 20
+KPX eogonek v -15
+KPX eogonek w -15
+KPX eogonek x -15
+KPX eogonek y -15
+KPX eogonek yacute -15
+KPX eogonek ydieresis -15
+KPX f comma -10
+KPX f e -10
+KPX f eacute -10
+KPX f ecaron -10
+KPX f ecircumflex -10
+KPX f edieresis -10
+KPX f edotaccent -10
+KPX f egrave -10
+KPX f emacron -10
+KPX f eogonek -10
+KPX f o -20
+KPX f oacute -20
+KPX f ocircumflex -20
+KPX f odieresis -20
+KPX f ograve -20
+KPX f ohungarumlaut -20
+KPX f omacron -20
+KPX f oslash -20
+KPX f otilde -20
+KPX f period -10
+KPX f quotedblright 30
+KPX f quoteright 30
+KPX g e 10
+KPX g eacute 10
+KPX g ecaron 10
+KPX g ecircumflex 10
+KPX g edieresis 10
+KPX g edotaccent 10
+KPX g egrave 10
+KPX g emacron 10
+KPX g eogonek 10
+KPX g g -10
+KPX g gbreve -10
+KPX g gcommaaccent -10
+KPX gbreve e 10
+KPX gbreve eacute 10
+KPX gbreve ecaron 10
+KPX gbreve ecircumflex 10
+KPX gbreve edieresis 10
+KPX gbreve edotaccent 10
+KPX gbreve egrave 10
+KPX gbreve emacron 10
+KPX gbreve eogonek 10
+KPX gbreve g -10
+KPX gbreve gbreve -10
+KPX gbreve gcommaaccent -10
+KPX gcommaaccent e 10
+KPX gcommaaccent eacute 10
+KPX gcommaaccent ecaron 10
+KPX gcommaaccent ecircumflex 10
+KPX gcommaaccent edieresis 10
+KPX gcommaaccent edotaccent 10
+KPX gcommaaccent egrave 10
+KPX gcommaaccent emacron 10
+KPX gcommaaccent eogonek 10
+KPX gcommaaccent g -10
+KPX gcommaaccent gbreve -10
+KPX gcommaaccent gcommaaccent -10
+KPX h y -20
+KPX h yacute -20
+KPX h ydieresis -20
+KPX k o -15
+KPX k oacute -15
+KPX k ocircumflex -15
+KPX k odieresis -15
+KPX k ograve -15
+KPX k ohungarumlaut -15
+KPX k omacron -15
+KPX k oslash -15
+KPX k otilde -15
+KPX kcommaaccent o -15
+KPX kcommaaccent oacute -15
+KPX kcommaaccent ocircumflex -15
+KPX kcommaaccent odieresis -15
+KPX kcommaaccent ograve -15
+KPX kcommaaccent ohungarumlaut -15
+KPX kcommaaccent omacron -15
+KPX kcommaaccent oslash -15
+KPX kcommaaccent otilde -15
+KPX l w -15
+KPX l y -15
+KPX l yacute -15
+KPX l ydieresis -15
+KPX lacute w -15
+KPX lacute y -15
+KPX lacute yacute -15
+KPX lacute ydieresis -15
+KPX lcommaaccent w -15
+KPX lcommaaccent y -15
+KPX lcommaaccent yacute -15
+KPX lcommaaccent ydieresis -15
+KPX lslash w -15
+KPX lslash y -15
+KPX lslash yacute -15
+KPX lslash ydieresis -15
+KPX m u -20
+KPX m uacute -20
+KPX m ucircumflex -20
+KPX m udieresis -20
+KPX m ugrave -20
+KPX m uhungarumlaut -20
+KPX m umacron -20
+KPX m uogonek -20
+KPX m uring -20
+KPX m y -30
+KPX m yacute -30
+KPX m ydieresis -30
+KPX n u -10
+KPX n uacute -10
+KPX n ucircumflex -10
+KPX n udieresis -10
+KPX n ugrave -10
+KPX n uhungarumlaut -10
+KPX n umacron -10
+KPX n uogonek -10
+KPX n uring -10
+KPX n v -40
+KPX n y -20
+KPX n yacute -20
+KPX n ydieresis -20
+KPX nacute u -10
+KPX nacute uacute -10
+KPX nacute ucircumflex -10
+KPX nacute udieresis -10
+KPX nacute ugrave -10
+KPX nacute uhungarumlaut -10
+KPX nacute umacron -10
+KPX nacute uogonek -10
+KPX nacute uring -10
+KPX nacute v -40
+KPX nacute y -20
+KPX nacute yacute -20
+KPX nacute ydieresis -20
+KPX ncaron u -10
+KPX ncaron uacute -10
+KPX ncaron ucircumflex -10
+KPX ncaron udieresis -10
+KPX ncaron ugrave -10
+KPX ncaron uhungarumlaut -10
+KPX ncaron umacron -10
+KPX ncaron uogonek -10
+KPX ncaron uring -10
+KPX ncaron v -40
+KPX ncaron y -20
+KPX ncaron yacute -20
+KPX ncaron ydieresis -20
+KPX ncommaaccent u -10
+KPX ncommaaccent uacute -10
+KPX ncommaaccent ucircumflex -10
+KPX ncommaaccent udieresis -10
+KPX ncommaaccent ugrave -10
+KPX ncommaaccent uhungarumlaut -10
+KPX ncommaaccent umacron -10
+KPX ncommaaccent uogonek -10
+KPX ncommaaccent uring -10
+KPX ncommaaccent v -40
+KPX ncommaaccent y -20
+KPX ncommaaccent yacute -20
+KPX ncommaaccent ydieresis -20
+KPX ntilde u -10
+KPX ntilde uacute -10
+KPX ntilde ucircumflex -10
+KPX ntilde udieresis -10
+KPX ntilde ugrave -10
+KPX ntilde uhungarumlaut -10
+KPX ntilde umacron -10
+KPX ntilde uogonek -10
+KPX ntilde uring -10
+KPX ntilde v -40
+KPX ntilde y -20
+KPX ntilde yacute -20
+KPX ntilde ydieresis -20
+KPX o v -20
+KPX o w -15
+KPX o x -30
+KPX o y -20
+KPX o yacute -20
+KPX o ydieresis -20
+KPX oacute v -20
+KPX oacute w -15
+KPX oacute x -30
+KPX oacute y -20
+KPX oacute yacute -20
+KPX oacute ydieresis -20
+KPX ocircumflex v -20
+KPX ocircumflex w -15
+KPX ocircumflex x -30
+KPX ocircumflex y -20
+KPX ocircumflex yacute -20
+KPX ocircumflex ydieresis -20
+KPX odieresis v -20
+KPX odieresis w -15
+KPX odieresis x -30
+KPX odieresis y -20
+KPX odieresis yacute -20
+KPX odieresis ydieresis -20
+KPX ograve v -20
+KPX ograve w -15
+KPX ograve x -30
+KPX ograve y -20
+KPX ograve yacute -20
+KPX ograve ydieresis -20
+KPX ohungarumlaut v -20
+KPX ohungarumlaut w -15
+KPX ohungarumlaut x -30
+KPX ohungarumlaut y -20
+KPX ohungarumlaut yacute -20
+KPX ohungarumlaut ydieresis -20
+KPX omacron v -20
+KPX omacron w -15
+KPX omacron x -30
+KPX omacron y -20
+KPX omacron yacute -20
+KPX omacron ydieresis -20
+KPX oslash v -20
+KPX oslash w -15
+KPX oslash x -30
+KPX oslash y -20
+KPX oslash yacute -20
+KPX oslash ydieresis -20
+KPX otilde v -20
+KPX otilde w -15
+KPX otilde x -30
+KPX otilde y -20
+KPX otilde yacute -20
+KPX otilde ydieresis -20
+KPX p y -15
+KPX p yacute -15
+KPX p ydieresis -15
+KPX period quotedblright -120
+KPX period quoteright -120
+KPX period space -40
+KPX quotedblright space -80
+KPX quoteleft quoteleft -46
+KPX quoteright d -80
+KPX quoteright dcroat -80
+KPX quoteright l -20
+KPX quoteright lacute -20
+KPX quoteright lcommaaccent -20
+KPX quoteright lslash -20
+KPX quoteright quoteright -46
+KPX quoteright r -40
+KPX quoteright racute -40
+KPX quoteright rcaron -40
+KPX quoteright rcommaaccent -40
+KPX quoteright s -60
+KPX quoteright sacute -60
+KPX quoteright scaron -60
+KPX quoteright scedilla -60
+KPX quoteright scommaaccent -60
+KPX quoteright space -80
+KPX quoteright v -20
+KPX r c -20
+KPX r cacute -20
+KPX r ccaron -20
+KPX r ccedilla -20
+KPX r comma -60
+KPX r d -20
+KPX r dcroat -20
+KPX r g -15
+KPX r gbreve -15
+KPX r gcommaaccent -15
+KPX r hyphen -20
+KPX r o -20
+KPX r oacute -20
+KPX r ocircumflex -20
+KPX r odieresis -20
+KPX r ograve -20
+KPX r ohungarumlaut -20
+KPX r omacron -20
+KPX r oslash -20
+KPX r otilde -20
+KPX r period -60
+KPX r q -20
+KPX r s -15
+KPX r sacute -15
+KPX r scaron -15
+KPX r scedilla -15
+KPX r scommaaccent -15
+KPX r t 20
+KPX r tcommaaccent 20
+KPX r v 10
+KPX r y 10
+KPX r yacute 10
+KPX r ydieresis 10
+KPX racute c -20
+KPX racute cacute -20
+KPX racute ccaron -20
+KPX racute ccedilla -20
+KPX racute comma -60
+KPX racute d -20
+KPX racute dcroat -20
+KPX racute g -15
+KPX racute gbreve -15
+KPX racute gcommaaccent -15
+KPX racute hyphen -20
+KPX racute o -20
+KPX racute oacute -20
+KPX racute ocircumflex -20
+KPX racute odieresis -20
+KPX racute ograve -20
+KPX racute ohungarumlaut -20
+KPX racute omacron -20
+KPX racute oslash -20
+KPX racute otilde -20
+KPX racute period -60
+KPX racute q -20
+KPX racute s -15
+KPX racute sacute -15
+KPX racute scaron -15
+KPX racute scedilla -15
+KPX racute scommaaccent -15
+KPX racute t 20
+KPX racute tcommaaccent 20
+KPX racute v 10
+KPX racute y 10
+KPX racute yacute 10
+KPX racute ydieresis 10
+KPX rcaron c -20
+KPX rcaron cacute -20
+KPX rcaron ccaron -20
+KPX rcaron ccedilla -20
+KPX rcaron comma -60
+KPX rcaron d -20
+KPX rcaron dcroat -20
+KPX rcaron g -15
+KPX rcaron gbreve -15
+KPX rcaron gcommaaccent -15
+KPX rcaron hyphen -20
+KPX rcaron o -20
+KPX rcaron oacute -20
+KPX rcaron ocircumflex -20
+KPX rcaron odieresis -20
+KPX rcaron ograve -20
+KPX rcaron ohungarumlaut -20
+KPX rcaron omacron -20
+KPX rcaron oslash -20
+KPX rcaron otilde -20
+KPX rcaron period -60
+KPX rcaron q -20
+KPX rcaron s -15
+KPX rcaron sacute -15
+KPX rcaron scaron -15
+KPX rcaron scedilla -15
+KPX rcaron scommaaccent -15
+KPX rcaron t 20
+KPX rcaron tcommaaccent 20
+KPX rcaron v 10
+KPX rcaron y 10
+KPX rcaron yacute 10
+KPX rcaron ydieresis 10
+KPX rcommaaccent c -20
+KPX rcommaaccent cacute -20
+KPX rcommaaccent ccaron -20
+KPX rcommaaccent ccedilla -20
+KPX rcommaaccent comma -60
+KPX rcommaaccent d -20
+KPX rcommaaccent dcroat -20
+KPX rcommaaccent g -15
+KPX rcommaaccent gbreve -15
+KPX rcommaaccent gcommaaccent -15
+KPX rcommaaccent hyphen -20
+KPX rcommaaccent o -20
+KPX rcommaaccent oacute -20
+KPX rcommaaccent ocircumflex -20
+KPX rcommaaccent odieresis -20
+KPX rcommaaccent ograve -20
+KPX rcommaaccent ohungarumlaut -20
+KPX rcommaaccent omacron -20
+KPX rcommaaccent oslash -20
+KPX rcommaaccent otilde -20
+KPX rcommaaccent period -60
+KPX rcommaaccent q -20
+KPX rcommaaccent s -15
+KPX rcommaaccent sacute -15
+KPX rcommaaccent scaron -15
+KPX rcommaaccent scedilla -15
+KPX rcommaaccent scommaaccent -15
+KPX rcommaaccent t 20
+KPX rcommaaccent tcommaaccent 20
+KPX rcommaaccent v 10
+KPX rcommaaccent y 10
+KPX rcommaaccent yacute 10
+KPX rcommaaccent ydieresis 10
+KPX s w -15
+KPX sacute w -15
+KPX scaron w -15
+KPX scedilla w -15
+KPX scommaaccent w -15
+KPX semicolon space -40
+KPX space T -100
+KPX space Tcaron -100
+KPX space Tcommaaccent -100
+KPX space V -80
+KPX space W -80
+KPX space Y -120
+KPX space Yacute -120
+KPX space Ydieresis -120
+KPX space quotedblleft -80
+KPX space quoteleft -60
+KPX v a -20
+KPX v aacute -20
+KPX v abreve -20
+KPX v acircumflex -20
+KPX v adieresis -20
+KPX v agrave -20
+KPX v amacron -20
+KPX v aogonek -20
+KPX v aring -20
+KPX v atilde -20
+KPX v comma -80
+KPX v o -30
+KPX v oacute -30
+KPX v ocircumflex -30
+KPX v odieresis -30
+KPX v ograve -30
+KPX v ohungarumlaut -30
+KPX v omacron -30
+KPX v oslash -30
+KPX v otilde -30
+KPX v period -80
+KPX w comma -40
+KPX w o -20
+KPX w oacute -20
+KPX w ocircumflex -20
+KPX w odieresis -20
+KPX w ograve -20
+KPX w ohungarumlaut -20
+KPX w omacron -20
+KPX w oslash -20
+KPX w otilde -20
+KPX w period -40
+KPX x e -10
+KPX x eacute -10
+KPX x ecaron -10
+KPX x ecircumflex -10
+KPX x edieresis -10
+KPX x edotaccent -10
+KPX x egrave -10
+KPX x emacron -10
+KPX x eogonek -10
+KPX y a -30
+KPX y aacute -30
+KPX y abreve -30
+KPX y acircumflex -30
+KPX y adieresis -30
+KPX y agrave -30
+KPX y amacron -30
+KPX y aogonek -30
+KPX y aring -30
+KPX y atilde -30
+KPX y comma -80
+KPX y e -10
+KPX y eacute -10
+KPX y ecaron -10
+KPX y ecircumflex -10
+KPX y edieresis -10
+KPX y edotaccent -10
+KPX y egrave -10
+KPX y emacron -10
+KPX y eogonek -10
+KPX y o -25
+KPX y oacute -25
+KPX y ocircumflex -25
+KPX y odieresis -25
+KPX y ograve -25
+KPX y ohungarumlaut -25
+KPX y omacron -25
+KPX y oslash -25
+KPX y otilde -25
+KPX y period -80
+KPX yacute a -30
+KPX yacute aacute -30
+KPX yacute abreve -30
+KPX yacute acircumflex -30
+KPX yacute adieresis -30
+KPX yacute agrave -30
+KPX yacute amacron -30
+KPX yacute aogonek -30
+KPX yacute aring -30
+KPX yacute atilde -30
+KPX yacute comma -80
+KPX yacute e -10
+KPX yacute eacute -10
+KPX yacute ecaron -10
+KPX yacute ecircumflex -10
+KPX yacute edieresis -10
+KPX yacute edotaccent -10
+KPX yacute egrave -10
+KPX yacute emacron -10
+KPX yacute eogonek -10
+KPX yacute o -25
+KPX yacute oacute -25
+KPX yacute ocircumflex -25
+KPX yacute odieresis -25
+KPX yacute ograve -25
+KPX yacute ohungarumlaut -25
+KPX yacute omacron -25
+KPX yacute oslash -25
+KPX yacute otilde -25
+KPX yacute period -80
+KPX ydieresis a -30
+KPX ydieresis aacute -30
+KPX ydieresis abreve -30
+KPX ydieresis acircumflex -30
+KPX ydieresis adieresis -30
+KPX ydieresis agrave -30
+KPX ydieresis amacron -30
+KPX ydieresis aogonek -30
+KPX ydieresis aring -30
+KPX ydieresis atilde -30
+KPX ydieresis comma -80
+KPX ydieresis e -10
+KPX ydieresis eacute -10
+KPX ydieresis ecaron -10
+KPX ydieresis ecircumflex -10
+KPX ydieresis edieresis -10
+KPX ydieresis edotaccent -10
+KPX ydieresis egrave -10
+KPX ydieresis emacron -10
+KPX ydieresis eogonek -10
+KPX ydieresis o -25
+KPX ydieresis oacute -25
+KPX ydieresis ocircumflex -25
+KPX ydieresis odieresis -25
+KPX ydieresis ograve -25
+KPX ydieresis ohungarumlaut -25
+KPX ydieresis omacron -25
+KPX ydieresis oslash -25
+KPX ydieresis otilde -25
+KPX ydieresis period -80
+KPX z e 10
+KPX z eacute 10
+KPX z ecaron 10
+KPX z ecircumflex 10
+KPX z edieresis 10
+KPX z edotaccent 10
+KPX z egrave 10
+KPX z emacron 10
+KPX z eogonek 10
+KPX zacute e 10
+KPX zacute eacute 10
+KPX zacute ecaron 10
+KPX zacute ecircumflex 10
+KPX zacute edieresis 10
+KPX zacute edotaccent 10
+KPX zacute egrave 10
+KPX zacute emacron 10
+KPX zacute eogonek 10
+KPX zcaron e 10
+KPX zcaron eacute 10
+KPX zcaron ecaron 10
+KPX zcaron ecircumflex 10
+KPX zcaron edieresis 10
+KPX zcaron edotaccent 10
+KPX zcaron egrave 10
+KPX zcaron emacron 10
+KPX zcaron eogonek 10
+KPX zdotaccent e 10
+KPX zdotaccent eacute 10
+KPX zdotaccent ecaron 10
+KPX zdotaccent ecircumflex 10
+KPX zdotaccent edieresis 10
+KPX zdotaccent edotaccent 10
+KPX zdotaccent egrave 10
+KPX zdotaccent emacron 10
+KPX zdotaccent eogonek 10
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Oblique.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Oblique.afm
new file mode 100644
index 0000000000000000000000000000000000000000..7a7af0017fe740ac245c5dc6d5d1f4744e89597b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Oblique.afm
@@ -0,0 +1,3051 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 12:44:31 1997
+Comment UniqueID 43055
+Comment VMusage 14960 69346
+FontName Helvetica-Oblique
+FullName Helvetica Oblique
+FamilyName Helvetica
+Weight Medium
+ItalicAngle -12
+IsFixedPitch false
+CharacterSet ExtendedRoman
+FontBBox -170 -225 1116 931
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 523
+Ascender 718
+Descender -207
+StdHW 76
+StdVW 88
+StartCharMetrics 315
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 278 ; N exclam ; B 90 0 340 718 ;
+C 34 ; WX 355 ; N quotedbl ; B 168 463 438 718 ;
+C 35 ; WX 556 ; N numbersign ; B 73 0 631 688 ;
+C 36 ; WX 556 ; N dollar ; B 69 -115 617 775 ;
+C 37 ; WX 889 ; N percent ; B 147 -19 889 703 ;
+C 38 ; WX 667 ; N ampersand ; B 77 -15 647 718 ;
+C 39 ; WX 222 ; N quoteright ; B 151 463 310 718 ;
+C 40 ; WX 333 ; N parenleft ; B 108 -207 454 733 ;
+C 41 ; WX 333 ; N parenright ; B -9 -207 337 733 ;
+C 42 ; WX 389 ; N asterisk ; B 165 431 475 718 ;
+C 43 ; WX 584 ; N plus ; B 85 0 606 505 ;
+C 44 ; WX 278 ; N comma ; B 56 -147 214 106 ;
+C 45 ; WX 333 ; N hyphen ; B 93 232 357 322 ;
+C 46 ; WX 278 ; N period ; B 87 0 214 106 ;
+C 47 ; WX 278 ; N slash ; B -21 -19 452 737 ;
+C 48 ; WX 556 ; N zero ; B 93 -19 608 703 ;
+C 49 ; WX 556 ; N one ; B 207 0 508 703 ;
+C 50 ; WX 556 ; N two ; B 26 0 617 703 ;
+C 51 ; WX 556 ; N three ; B 75 -19 610 703 ;
+C 52 ; WX 556 ; N four ; B 61 0 576 703 ;
+C 53 ; WX 556 ; N five ; B 68 -19 621 688 ;
+C 54 ; WX 556 ; N six ; B 91 -19 615 703 ;
+C 55 ; WX 556 ; N seven ; B 137 0 669 688 ;
+C 56 ; WX 556 ; N eight ; B 74 -19 607 703 ;
+C 57 ; WX 556 ; N nine ; B 82 -19 609 703 ;
+C 58 ; WX 278 ; N colon ; B 87 0 301 516 ;
+C 59 ; WX 278 ; N semicolon ; B 56 -147 301 516 ;
+C 60 ; WX 584 ; N less ; B 94 11 641 495 ;
+C 61 ; WX 584 ; N equal ; B 63 115 628 390 ;
+C 62 ; WX 584 ; N greater ; B 50 11 597 495 ;
+C 63 ; WX 556 ; N question ; B 161 0 610 727 ;
+C 64 ; WX 1015 ; N at ; B 215 -19 965 737 ;
+C 65 ; WX 667 ; N A ; B 14 0 654 718 ;
+C 66 ; WX 667 ; N B ; B 74 0 712 718 ;
+C 67 ; WX 722 ; N C ; B 108 -19 782 737 ;
+C 68 ; WX 722 ; N D ; B 81 0 764 718 ;
+C 69 ; WX 667 ; N E ; B 86 0 762 718 ;
+C 70 ; WX 611 ; N F ; B 86 0 736 718 ;
+C 71 ; WX 778 ; N G ; B 111 -19 799 737 ;
+C 72 ; WX 722 ; N H ; B 77 0 799 718 ;
+C 73 ; WX 278 ; N I ; B 91 0 341 718 ;
+C 74 ; WX 500 ; N J ; B 47 -19 581 718 ;
+C 75 ; WX 667 ; N K ; B 76 0 808 718 ;
+C 76 ; WX 556 ; N L ; B 76 0 555 718 ;
+C 77 ; WX 833 ; N M ; B 73 0 914 718 ;
+C 78 ; WX 722 ; N N ; B 76 0 799 718 ;
+C 79 ; WX 778 ; N O ; B 105 -19 826 737 ;
+C 80 ; WX 667 ; N P ; B 86 0 737 718 ;
+C 81 ; WX 778 ; N Q ; B 105 -56 826 737 ;
+C 82 ; WX 722 ; N R ; B 88 0 773 718 ;
+C 83 ; WX 667 ; N S ; B 90 -19 713 737 ;
+C 84 ; WX 611 ; N T ; B 148 0 750 718 ;
+C 85 ; WX 722 ; N U ; B 123 -19 797 718 ;
+C 86 ; WX 667 ; N V ; B 173 0 800 718 ;
+C 87 ; WX 944 ; N W ; B 169 0 1081 718 ;
+C 88 ; WX 667 ; N X ; B 19 0 790 718 ;
+C 89 ; WX 667 ; N Y ; B 167 0 806 718 ;
+C 90 ; WX 611 ; N Z ; B 23 0 741 718 ;
+C 91 ; WX 278 ; N bracketleft ; B 21 -196 403 722 ;
+C 92 ; WX 278 ; N backslash ; B 140 -19 291 737 ;
+C 93 ; WX 278 ; N bracketright ; B -14 -196 368 722 ;
+C 94 ; WX 469 ; N asciicircum ; B 42 264 539 688 ;
+C 95 ; WX 556 ; N underscore ; B -27 -125 540 -75 ;
+C 96 ; WX 222 ; N quoteleft ; B 165 470 323 725 ;
+C 97 ; WX 556 ; N a ; B 61 -15 559 538 ;
+C 98 ; WX 556 ; N b ; B 58 -15 584 718 ;
+C 99 ; WX 500 ; N c ; B 74 -15 553 538 ;
+C 100 ; WX 556 ; N d ; B 84 -15 652 718 ;
+C 101 ; WX 556 ; N e ; B 84 -15 578 538 ;
+C 102 ; WX 278 ; N f ; B 86 0 416 728 ; L i fi ; L l fl ;
+C 103 ; WX 556 ; N g ; B 42 -220 610 538 ;
+C 104 ; WX 556 ; N h ; B 65 0 573 718 ;
+C 105 ; WX 222 ; N i ; B 67 0 308 718 ;
+C 106 ; WX 222 ; N j ; B -60 -210 308 718 ;
+C 107 ; WX 500 ; N k ; B 67 0 600 718 ;
+C 108 ; WX 222 ; N l ; B 67 0 308 718 ;
+C 109 ; WX 833 ; N m ; B 65 0 852 538 ;
+C 110 ; WX 556 ; N n ; B 65 0 573 538 ;
+C 111 ; WX 556 ; N o ; B 83 -14 585 538 ;
+C 112 ; WX 556 ; N p ; B 14 -207 584 538 ;
+C 113 ; WX 556 ; N q ; B 84 -207 605 538 ;
+C 114 ; WX 333 ; N r ; B 77 0 446 538 ;
+C 115 ; WX 500 ; N s ; B 63 -15 529 538 ;
+C 116 ; WX 278 ; N t ; B 102 -7 368 669 ;
+C 117 ; WX 556 ; N u ; B 94 -15 600 523 ;
+C 118 ; WX 500 ; N v ; B 119 0 603 523 ;
+C 119 ; WX 722 ; N w ; B 125 0 820 523 ;
+C 120 ; WX 500 ; N x ; B 11 0 594 523 ;
+C 121 ; WX 500 ; N y ; B 15 -214 600 523 ;
+C 122 ; WX 500 ; N z ; B 31 0 571 523 ;
+C 123 ; WX 334 ; N braceleft ; B 92 -196 445 722 ;
+C 124 ; WX 260 ; N bar ; B 46 -225 332 775 ;
+C 125 ; WX 334 ; N braceright ; B 0 -196 354 722 ;
+C 126 ; WX 584 ; N asciitilde ; B 111 180 580 326 ;
+C 161 ; WX 333 ; N exclamdown ; B 77 -195 326 523 ;
+C 162 ; WX 556 ; N cent ; B 95 -115 584 623 ;
+C 163 ; WX 556 ; N sterling ; B 49 -16 634 718 ;
+C 164 ; WX 167 ; N fraction ; B -170 -19 482 703 ;
+C 165 ; WX 556 ; N yen ; B 81 0 699 688 ;
+C 166 ; WX 556 ; N florin ; B -52 -207 654 737 ;
+C 167 ; WX 556 ; N section ; B 76 -191 584 737 ;
+C 168 ; WX 556 ; N currency ; B 60 99 646 603 ;
+C 169 ; WX 191 ; N quotesingle ; B 157 463 285 718 ;
+C 170 ; WX 333 ; N quotedblleft ; B 138 470 461 725 ;
+C 171 ; WX 556 ; N guillemotleft ; B 146 108 554 446 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 137 108 340 446 ;
+C 173 ; WX 333 ; N guilsinglright ; B 111 108 314 446 ;
+C 174 ; WX 500 ; N fi ; B 86 0 587 728 ;
+C 175 ; WX 500 ; N fl ; B 86 0 585 728 ;
+C 177 ; WX 556 ; N endash ; B 51 240 623 313 ;
+C 178 ; WX 556 ; N dagger ; B 135 -159 622 718 ;
+C 179 ; WX 556 ; N daggerdbl ; B 52 -159 623 718 ;
+C 180 ; WX 278 ; N periodcentered ; B 129 190 257 315 ;
+C 182 ; WX 537 ; N paragraph ; B 126 -173 650 718 ;
+C 183 ; WX 350 ; N bullet ; B 91 202 413 517 ;
+C 184 ; WX 222 ; N quotesinglbase ; B 21 -149 180 106 ;
+C 185 ; WX 333 ; N quotedblbase ; B -6 -149 318 106 ;
+C 186 ; WX 333 ; N quotedblright ; B 124 463 448 718 ;
+C 187 ; WX 556 ; N guillemotright ; B 120 108 528 446 ;
+C 188 ; WX 1000 ; N ellipsis ; B 115 0 908 106 ;
+C 189 ; WX 1000 ; N perthousand ; B 88 -19 1029 703 ;
+C 191 ; WX 611 ; N questiondown ; B 85 -201 534 525 ;
+C 193 ; WX 333 ; N grave ; B 170 593 337 734 ;
+C 194 ; WX 333 ; N acute ; B 248 593 475 734 ;
+C 195 ; WX 333 ; N circumflex ; B 147 593 438 734 ;
+C 196 ; WX 333 ; N tilde ; B 125 606 490 722 ;
+C 197 ; WX 333 ; N macron ; B 143 627 468 684 ;
+C 198 ; WX 333 ; N breve ; B 167 595 476 731 ;
+C 199 ; WX 333 ; N dotaccent ; B 249 604 362 706 ;
+C 200 ; WX 333 ; N dieresis ; B 168 604 443 706 ;
+C 202 ; WX 333 ; N ring ; B 214 572 402 756 ;
+C 203 ; WX 333 ; N cedilla ; B 2 -225 232 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 157 593 565 734 ;
+C 206 ; WX 333 ; N ogonek ; B 43 -225 249 0 ;
+C 207 ; WX 333 ; N caron ; B 177 593 468 734 ;
+C 208 ; WX 1000 ; N emdash ; B 51 240 1067 313 ;
+C 225 ; WX 1000 ; N AE ; B 8 0 1097 718 ;
+C 227 ; WX 370 ; N ordfeminine ; B 127 405 449 737 ;
+C 232 ; WX 556 ; N Lslash ; B 41 0 555 718 ;
+C 233 ; WX 778 ; N Oslash ; B 43 -19 890 737 ;
+C 234 ; WX 1000 ; N OE ; B 98 -19 1116 737 ;
+C 235 ; WX 365 ; N ordmasculine ; B 141 405 468 737 ;
+C 241 ; WX 889 ; N ae ; B 61 -15 909 538 ;
+C 245 ; WX 278 ; N dotlessi ; B 95 0 294 523 ;
+C 248 ; WX 222 ; N lslash ; B 41 0 347 718 ;
+C 249 ; WX 611 ; N oslash ; B 29 -22 647 545 ;
+C 250 ; WX 944 ; N oe ; B 83 -15 964 538 ;
+C 251 ; WX 611 ; N germandbls ; B 67 -15 658 728 ;
+C -1 ; WX 278 ; N Idieresis ; B 91 0 458 901 ;
+C -1 ; WX 556 ; N eacute ; B 84 -15 587 734 ;
+C -1 ; WX 556 ; N abreve ; B 61 -15 578 731 ;
+C -1 ; WX 556 ; N uhungarumlaut ; B 94 -15 677 734 ;
+C -1 ; WX 556 ; N ecaron ; B 84 -15 580 734 ;
+C -1 ; WX 667 ; N Ydieresis ; B 167 0 806 901 ;
+C -1 ; WX 584 ; N divide ; B 85 -19 606 524 ;
+C -1 ; WX 667 ; N Yacute ; B 167 0 806 929 ;
+C -1 ; WX 667 ; N Acircumflex ; B 14 0 654 929 ;
+C -1 ; WX 556 ; N aacute ; B 61 -15 587 734 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 123 -19 797 929 ;
+C -1 ; WX 500 ; N yacute ; B 15 -214 600 734 ;
+C -1 ; WX 500 ; N scommaaccent ; B 63 -225 529 538 ;
+C -1 ; WX 556 ; N ecircumflex ; B 84 -15 578 734 ;
+C -1 ; WX 722 ; N Uring ; B 123 -19 797 931 ;
+C -1 ; WX 722 ; N Udieresis ; B 123 -19 797 901 ;
+C -1 ; WX 556 ; N aogonek ; B 61 -220 559 538 ;
+C -1 ; WX 722 ; N Uacute ; B 123 -19 797 929 ;
+C -1 ; WX 556 ; N uogonek ; B 94 -225 600 523 ;
+C -1 ; WX 667 ; N Edieresis ; B 86 0 762 901 ;
+C -1 ; WX 722 ; N Dcroat ; B 69 0 764 718 ;
+C -1 ; WX 250 ; N commaaccent ; B 39 -225 172 -40 ;
+C -1 ; WX 737 ; N copyright ; B 54 -19 837 737 ;
+C -1 ; WX 667 ; N Emacron ; B 86 0 762 879 ;
+C -1 ; WX 500 ; N ccaron ; B 74 -15 553 734 ;
+C -1 ; WX 556 ; N aring ; B 61 -15 559 756 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 76 -225 799 718 ;
+C -1 ; WX 222 ; N lacute ; B 67 0 461 929 ;
+C -1 ; WX 556 ; N agrave ; B 61 -15 559 734 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 148 -225 750 718 ;
+C -1 ; WX 722 ; N Cacute ; B 108 -19 782 929 ;
+C -1 ; WX 556 ; N atilde ; B 61 -15 592 722 ;
+C -1 ; WX 667 ; N Edotaccent ; B 86 0 762 901 ;
+C -1 ; WX 500 ; N scaron ; B 63 -15 552 734 ;
+C -1 ; WX 500 ; N scedilla ; B 63 -225 529 538 ;
+C -1 ; WX 278 ; N iacute ; B 95 0 448 734 ;
+C -1 ; WX 471 ; N lozenge ; B 88 0 540 728 ;
+C -1 ; WX 722 ; N Rcaron ; B 88 0 773 929 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 111 -225 799 737 ;
+C -1 ; WX 556 ; N ucircumflex ; B 94 -15 600 734 ;
+C -1 ; WX 556 ; N acircumflex ; B 61 -15 559 734 ;
+C -1 ; WX 667 ; N Amacron ; B 14 0 677 879 ;
+C -1 ; WX 333 ; N rcaron ; B 77 0 508 734 ;
+C -1 ; WX 500 ; N ccedilla ; B 74 -225 553 538 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 23 0 741 901 ;
+C -1 ; WX 667 ; N Thorn ; B 86 0 712 718 ;
+C -1 ; WX 778 ; N Omacron ; B 105 -19 826 879 ;
+C -1 ; WX 722 ; N Racute ; B 88 0 773 929 ;
+C -1 ; WX 667 ; N Sacute ; B 90 -19 713 929 ;
+C -1 ; WX 643 ; N dcaron ; B 84 -15 808 718 ;
+C -1 ; WX 722 ; N Umacron ; B 123 -19 797 879 ;
+C -1 ; WX 556 ; N uring ; B 94 -15 600 756 ;
+C -1 ; WX 333 ; N threesuperior ; B 90 270 436 703 ;
+C -1 ; WX 778 ; N Ograve ; B 105 -19 826 929 ;
+C -1 ; WX 667 ; N Agrave ; B 14 0 654 929 ;
+C -1 ; WX 667 ; N Abreve ; B 14 0 685 926 ;
+C -1 ; WX 584 ; N multiply ; B 50 0 642 506 ;
+C -1 ; WX 556 ; N uacute ; B 94 -15 600 734 ;
+C -1 ; WX 611 ; N Tcaron ; B 148 0 750 929 ;
+C -1 ; WX 476 ; N partialdiff ; B 41 -38 550 714 ;
+C -1 ; WX 500 ; N ydieresis ; B 15 -214 600 706 ;
+C -1 ; WX 722 ; N Nacute ; B 76 0 799 929 ;
+C -1 ; WX 278 ; N icircumflex ; B 95 0 411 734 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 86 0 762 929 ;
+C -1 ; WX 556 ; N adieresis ; B 61 -15 559 706 ;
+C -1 ; WX 556 ; N edieresis ; B 84 -15 578 706 ;
+C -1 ; WX 500 ; N cacute ; B 74 -15 559 734 ;
+C -1 ; WX 556 ; N nacute ; B 65 0 587 734 ;
+C -1 ; WX 556 ; N umacron ; B 94 -15 600 684 ;
+C -1 ; WX 722 ; N Ncaron ; B 76 0 799 929 ;
+C -1 ; WX 278 ; N Iacute ; B 91 0 489 929 ;
+C -1 ; WX 584 ; N plusminus ; B 39 0 618 506 ;
+C -1 ; WX 260 ; N brokenbar ; B 62 -150 316 700 ;
+C -1 ; WX 737 ; N registered ; B 54 -19 837 737 ;
+C -1 ; WX 778 ; N Gbreve ; B 111 -19 799 926 ;
+C -1 ; WX 278 ; N Idotaccent ; B 91 0 377 901 ;
+C -1 ; WX 600 ; N summation ; B 15 -10 671 706 ;
+C -1 ; WX 667 ; N Egrave ; B 86 0 762 929 ;
+C -1 ; WX 333 ; N racute ; B 77 0 475 734 ;
+C -1 ; WX 556 ; N omacron ; B 83 -14 585 684 ;
+C -1 ; WX 611 ; N Zacute ; B 23 0 741 929 ;
+C -1 ; WX 611 ; N Zcaron ; B 23 0 741 929 ;
+C -1 ; WX 549 ; N greaterequal ; B 26 0 620 674 ;
+C -1 ; WX 722 ; N Eth ; B 69 0 764 718 ;
+C -1 ; WX 722 ; N Ccedilla ; B 108 -225 782 737 ;
+C -1 ; WX 222 ; N lcommaaccent ; B 25 -225 308 718 ;
+C -1 ; WX 317 ; N tcaron ; B 102 -7 501 808 ;
+C -1 ; WX 556 ; N eogonek ; B 84 -225 578 538 ;
+C -1 ; WX 722 ; N Uogonek ; B 123 -225 797 718 ;
+C -1 ; WX 667 ; N Aacute ; B 14 0 683 929 ;
+C -1 ; WX 667 ; N Adieresis ; B 14 0 654 901 ;
+C -1 ; WX 556 ; N egrave ; B 84 -15 578 734 ;
+C -1 ; WX 500 ; N zacute ; B 31 0 571 734 ;
+C -1 ; WX 222 ; N iogonek ; B -61 -225 308 718 ;
+C -1 ; WX 778 ; N Oacute ; B 105 -19 826 929 ;
+C -1 ; WX 556 ; N oacute ; B 83 -14 587 734 ;
+C -1 ; WX 556 ; N amacron ; B 61 -15 580 684 ;
+C -1 ; WX 500 ; N sacute ; B 63 -15 559 734 ;
+C -1 ; WX 278 ; N idieresis ; B 95 0 416 706 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 105 -19 826 929 ;
+C -1 ; WX 722 ; N Ugrave ; B 123 -19 797 929 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 556 ; N thorn ; B 14 -207 584 718 ;
+C -1 ; WX 333 ; N twosuperior ; B 64 281 449 703 ;
+C -1 ; WX 778 ; N Odieresis ; B 105 -19 826 901 ;
+C -1 ; WX 556 ; N mu ; B 24 -207 600 523 ;
+C -1 ; WX 278 ; N igrave ; B 95 0 310 734 ;
+C -1 ; WX 556 ; N ohungarumlaut ; B 83 -14 677 734 ;
+C -1 ; WX 667 ; N Eogonek ; B 86 -220 762 718 ;
+C -1 ; WX 556 ; N dcroat ; B 84 -15 689 718 ;
+C -1 ; WX 834 ; N threequarters ; B 130 -19 861 703 ;
+C -1 ; WX 667 ; N Scedilla ; B 90 -225 713 737 ;
+C -1 ; WX 299 ; N lcaron ; B 67 0 464 718 ;
+C -1 ; WX 667 ; N Kcommaaccent ; B 76 -225 808 718 ;
+C -1 ; WX 556 ; N Lacute ; B 76 0 555 929 ;
+C -1 ; WX 1000 ; N trademark ; B 186 306 1056 718 ;
+C -1 ; WX 556 ; N edotaccent ; B 84 -15 578 706 ;
+C -1 ; WX 278 ; N Igrave ; B 91 0 351 929 ;
+C -1 ; WX 278 ; N Imacron ; B 91 0 483 879 ;
+C -1 ; WX 556 ; N Lcaron ; B 76 0 570 718 ;
+C -1 ; WX 834 ; N onehalf ; B 114 -19 839 703 ;
+C -1 ; WX 549 ; N lessequal ; B 26 0 666 674 ;
+C -1 ; WX 556 ; N ocircumflex ; B 83 -14 585 734 ;
+C -1 ; WX 556 ; N ntilde ; B 65 0 592 722 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 123 -19 801 929 ;
+C -1 ; WX 667 ; N Eacute ; B 86 0 762 929 ;
+C -1 ; WX 556 ; N emacron ; B 84 -15 580 684 ;
+C -1 ; WX 556 ; N gbreve ; B 42 -220 610 731 ;
+C -1 ; WX 834 ; N onequarter ; B 150 -19 802 703 ;
+C -1 ; WX 667 ; N Scaron ; B 90 -19 713 929 ;
+C -1 ; WX 667 ; N Scommaaccent ; B 90 -225 713 737 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 105 -19 829 929 ;
+C -1 ; WX 400 ; N degree ; B 169 411 468 703 ;
+C -1 ; WX 556 ; N ograve ; B 83 -14 585 734 ;
+C -1 ; WX 722 ; N Ccaron ; B 108 -19 782 929 ;
+C -1 ; WX 556 ; N ugrave ; B 94 -15 600 734 ;
+C -1 ; WX 453 ; N radical ; B 79 -80 617 762 ;
+C -1 ; WX 722 ; N Dcaron ; B 81 0 764 929 ;
+C -1 ; WX 333 ; N rcommaaccent ; B 30 -225 446 538 ;
+C -1 ; WX 722 ; N Ntilde ; B 76 0 799 917 ;
+C -1 ; WX 556 ; N otilde ; B 83 -14 602 722 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 88 -225 773 718 ;
+C -1 ; WX 556 ; N Lcommaaccent ; B 76 -225 555 718 ;
+C -1 ; WX 667 ; N Atilde ; B 14 0 699 917 ;
+C -1 ; WX 667 ; N Aogonek ; B 14 -225 654 718 ;
+C -1 ; WX 667 ; N Aring ; B 14 0 654 931 ;
+C -1 ; WX 778 ; N Otilde ; B 105 -19 826 917 ;
+C -1 ; WX 500 ; N zdotaccent ; B 31 0 571 706 ;
+C -1 ; WX 667 ; N Ecaron ; B 86 0 762 929 ;
+C -1 ; WX 278 ; N Iogonek ; B -33 -225 341 718 ;
+C -1 ; WX 500 ; N kcommaaccent ; B 67 -225 600 718 ;
+C -1 ; WX 584 ; N minus ; B 85 216 606 289 ;
+C -1 ; WX 278 ; N Icircumflex ; B 91 0 452 929 ;
+C -1 ; WX 556 ; N ncaron ; B 65 0 580 734 ;
+C -1 ; WX 278 ; N tcommaaccent ; B 63 -225 368 669 ;
+C -1 ; WX 584 ; N logicalnot ; B 106 108 628 390 ;
+C -1 ; WX 556 ; N odieresis ; B 83 -14 585 706 ;
+C -1 ; WX 556 ; N udieresis ; B 94 -15 600 706 ;
+C -1 ; WX 549 ; N notequal ; B 34 -35 623 551 ;
+C -1 ; WX 556 ; N gcommaaccent ; B 42 -220 610 822 ;
+C -1 ; WX 556 ; N eth ; B 81 -15 617 737 ;
+C -1 ; WX 500 ; N zcaron ; B 31 0 571 734 ;
+C -1 ; WX 556 ; N ncommaaccent ; B 65 -225 573 538 ;
+C -1 ; WX 333 ; N onesuperior ; B 166 281 371 703 ;
+C -1 ; WX 278 ; N imacron ; B 95 0 417 684 ;
+C -1 ; WX 556 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 2705
+KPX A C -30
+KPX A Cacute -30
+KPX A Ccaron -30
+KPX A Ccedilla -30
+KPX A G -30
+KPX A Gbreve -30
+KPX A Gcommaaccent -30
+KPX A O -30
+KPX A Oacute -30
+KPX A Ocircumflex -30
+KPX A Odieresis -30
+KPX A Ograve -30
+KPX A Ohungarumlaut -30
+KPX A Omacron -30
+KPX A Oslash -30
+KPX A Otilde -30
+KPX A Q -30
+KPX A T -120
+KPX A Tcaron -120
+KPX A Tcommaaccent -120
+KPX A U -50
+KPX A Uacute -50
+KPX A Ucircumflex -50
+KPX A Udieresis -50
+KPX A Ugrave -50
+KPX A Uhungarumlaut -50
+KPX A Umacron -50
+KPX A Uogonek -50
+KPX A Uring -50
+KPX A V -70
+KPX A W -50
+KPX A Y -100
+KPX A Yacute -100
+KPX A Ydieresis -100
+KPX A u -30
+KPX A uacute -30
+KPX A ucircumflex -30
+KPX A udieresis -30
+KPX A ugrave -30
+KPX A uhungarumlaut -30
+KPX A umacron -30
+KPX A uogonek -30
+KPX A uring -30
+KPX A v -40
+KPX A w -40
+KPX A y -40
+KPX A yacute -40
+KPX A ydieresis -40
+KPX Aacute C -30
+KPX Aacute Cacute -30
+KPX Aacute Ccaron -30
+KPX Aacute Ccedilla -30
+KPX Aacute G -30
+KPX Aacute Gbreve -30
+KPX Aacute Gcommaaccent -30
+KPX Aacute O -30
+KPX Aacute Oacute -30
+KPX Aacute Ocircumflex -30
+KPX Aacute Odieresis -30
+KPX Aacute Ograve -30
+KPX Aacute Ohungarumlaut -30
+KPX Aacute Omacron -30
+KPX Aacute Oslash -30
+KPX Aacute Otilde -30
+KPX Aacute Q -30
+KPX Aacute T -120
+KPX Aacute Tcaron -120
+KPX Aacute Tcommaaccent -120
+KPX Aacute U -50
+KPX Aacute Uacute -50
+KPX Aacute Ucircumflex -50
+KPX Aacute Udieresis -50
+KPX Aacute Ugrave -50
+KPX Aacute Uhungarumlaut -50
+KPX Aacute Umacron -50
+KPX Aacute Uogonek -50
+KPX Aacute Uring -50
+KPX Aacute V -70
+KPX Aacute W -50
+KPX Aacute Y -100
+KPX Aacute Yacute -100
+KPX Aacute Ydieresis -100
+KPX Aacute u -30
+KPX Aacute uacute -30
+KPX Aacute ucircumflex -30
+KPX Aacute udieresis -30
+KPX Aacute ugrave -30
+KPX Aacute uhungarumlaut -30
+KPX Aacute umacron -30
+KPX Aacute uogonek -30
+KPX Aacute uring -30
+KPX Aacute v -40
+KPX Aacute w -40
+KPX Aacute y -40
+KPX Aacute yacute -40
+KPX Aacute ydieresis -40
+KPX Abreve C -30
+KPX Abreve Cacute -30
+KPX Abreve Ccaron -30
+KPX Abreve Ccedilla -30
+KPX Abreve G -30
+KPX Abreve Gbreve -30
+KPX Abreve Gcommaaccent -30
+KPX Abreve O -30
+KPX Abreve Oacute -30
+KPX Abreve Ocircumflex -30
+KPX Abreve Odieresis -30
+KPX Abreve Ograve -30
+KPX Abreve Ohungarumlaut -30
+KPX Abreve Omacron -30
+KPX Abreve Oslash -30
+KPX Abreve Otilde -30
+KPX Abreve Q -30
+KPX Abreve T -120
+KPX Abreve Tcaron -120
+KPX Abreve Tcommaaccent -120
+KPX Abreve U -50
+KPX Abreve Uacute -50
+KPX Abreve Ucircumflex -50
+KPX Abreve Udieresis -50
+KPX Abreve Ugrave -50
+KPX Abreve Uhungarumlaut -50
+KPX Abreve Umacron -50
+KPX Abreve Uogonek -50
+KPX Abreve Uring -50
+KPX Abreve V -70
+KPX Abreve W -50
+KPX Abreve Y -100
+KPX Abreve Yacute -100
+KPX Abreve Ydieresis -100
+KPX Abreve u -30
+KPX Abreve uacute -30
+KPX Abreve ucircumflex -30
+KPX Abreve udieresis -30
+KPX Abreve ugrave -30
+KPX Abreve uhungarumlaut -30
+KPX Abreve umacron -30
+KPX Abreve uogonek -30
+KPX Abreve uring -30
+KPX Abreve v -40
+KPX Abreve w -40
+KPX Abreve y -40
+KPX Abreve yacute -40
+KPX Abreve ydieresis -40
+KPX Acircumflex C -30
+KPX Acircumflex Cacute -30
+KPX Acircumflex Ccaron -30
+KPX Acircumflex Ccedilla -30
+KPX Acircumflex G -30
+KPX Acircumflex Gbreve -30
+KPX Acircumflex Gcommaaccent -30
+KPX Acircumflex O -30
+KPX Acircumflex Oacute -30
+KPX Acircumflex Ocircumflex -30
+KPX Acircumflex Odieresis -30
+KPX Acircumflex Ograve -30
+KPX Acircumflex Ohungarumlaut -30
+KPX Acircumflex Omacron -30
+KPX Acircumflex Oslash -30
+KPX Acircumflex Otilde -30
+KPX Acircumflex Q -30
+KPX Acircumflex T -120
+KPX Acircumflex Tcaron -120
+KPX Acircumflex Tcommaaccent -120
+KPX Acircumflex U -50
+KPX Acircumflex Uacute -50
+KPX Acircumflex Ucircumflex -50
+KPX Acircumflex Udieresis -50
+KPX Acircumflex Ugrave -50
+KPX Acircumflex Uhungarumlaut -50
+KPX Acircumflex Umacron -50
+KPX Acircumflex Uogonek -50
+KPX Acircumflex Uring -50
+KPX Acircumflex V -70
+KPX Acircumflex W -50
+KPX Acircumflex Y -100
+KPX Acircumflex Yacute -100
+KPX Acircumflex Ydieresis -100
+KPX Acircumflex u -30
+KPX Acircumflex uacute -30
+KPX Acircumflex ucircumflex -30
+KPX Acircumflex udieresis -30
+KPX Acircumflex ugrave -30
+KPX Acircumflex uhungarumlaut -30
+KPX Acircumflex umacron -30
+KPX Acircumflex uogonek -30
+KPX Acircumflex uring -30
+KPX Acircumflex v -40
+KPX Acircumflex w -40
+KPX Acircumflex y -40
+KPX Acircumflex yacute -40
+KPX Acircumflex ydieresis -40
+KPX Adieresis C -30
+KPX Adieresis Cacute -30
+KPX Adieresis Ccaron -30
+KPX Adieresis Ccedilla -30
+KPX Adieresis G -30
+KPX Adieresis Gbreve -30
+KPX Adieresis Gcommaaccent -30
+KPX Adieresis O -30
+KPX Adieresis Oacute -30
+KPX Adieresis Ocircumflex -30
+KPX Adieresis Odieresis -30
+KPX Adieresis Ograve -30
+KPX Adieresis Ohungarumlaut -30
+KPX Adieresis Omacron -30
+KPX Adieresis Oslash -30
+KPX Adieresis Otilde -30
+KPX Adieresis Q -30
+KPX Adieresis T -120
+KPX Adieresis Tcaron -120
+KPX Adieresis Tcommaaccent -120
+KPX Adieresis U -50
+KPX Adieresis Uacute -50
+KPX Adieresis Ucircumflex -50
+KPX Adieresis Udieresis -50
+KPX Adieresis Ugrave -50
+KPX Adieresis Uhungarumlaut -50
+KPX Adieresis Umacron -50
+KPX Adieresis Uogonek -50
+KPX Adieresis Uring -50
+KPX Adieresis V -70
+KPX Adieresis W -50
+KPX Adieresis Y -100
+KPX Adieresis Yacute -100
+KPX Adieresis Ydieresis -100
+KPX Adieresis u -30
+KPX Adieresis uacute -30
+KPX Adieresis ucircumflex -30
+KPX Adieresis udieresis -30
+KPX Adieresis ugrave -30
+KPX Adieresis uhungarumlaut -30
+KPX Adieresis umacron -30
+KPX Adieresis uogonek -30
+KPX Adieresis uring -30
+KPX Adieresis v -40
+KPX Adieresis w -40
+KPX Adieresis y -40
+KPX Adieresis yacute -40
+KPX Adieresis ydieresis -40
+KPX Agrave C -30
+KPX Agrave Cacute -30
+KPX Agrave Ccaron -30
+KPX Agrave Ccedilla -30
+KPX Agrave G -30
+KPX Agrave Gbreve -30
+KPX Agrave Gcommaaccent -30
+KPX Agrave O -30
+KPX Agrave Oacute -30
+KPX Agrave Ocircumflex -30
+KPX Agrave Odieresis -30
+KPX Agrave Ograve -30
+KPX Agrave Ohungarumlaut -30
+KPX Agrave Omacron -30
+KPX Agrave Oslash -30
+KPX Agrave Otilde -30
+KPX Agrave Q -30
+KPX Agrave T -120
+KPX Agrave Tcaron -120
+KPX Agrave Tcommaaccent -120
+KPX Agrave U -50
+KPX Agrave Uacute -50
+KPX Agrave Ucircumflex -50
+KPX Agrave Udieresis -50
+KPX Agrave Ugrave -50
+KPX Agrave Uhungarumlaut -50
+KPX Agrave Umacron -50
+KPX Agrave Uogonek -50
+KPX Agrave Uring -50
+KPX Agrave V -70
+KPX Agrave W -50
+KPX Agrave Y -100
+KPX Agrave Yacute -100
+KPX Agrave Ydieresis -100
+KPX Agrave u -30
+KPX Agrave uacute -30
+KPX Agrave ucircumflex -30
+KPX Agrave udieresis -30
+KPX Agrave ugrave -30
+KPX Agrave uhungarumlaut -30
+KPX Agrave umacron -30
+KPX Agrave uogonek -30
+KPX Agrave uring -30
+KPX Agrave v -40
+KPX Agrave w -40
+KPX Agrave y -40
+KPX Agrave yacute -40
+KPX Agrave ydieresis -40
+KPX Amacron C -30
+KPX Amacron Cacute -30
+KPX Amacron Ccaron -30
+KPX Amacron Ccedilla -30
+KPX Amacron G -30
+KPX Amacron Gbreve -30
+KPX Amacron Gcommaaccent -30
+KPX Amacron O -30
+KPX Amacron Oacute -30
+KPX Amacron Ocircumflex -30
+KPX Amacron Odieresis -30
+KPX Amacron Ograve -30
+KPX Amacron Ohungarumlaut -30
+KPX Amacron Omacron -30
+KPX Amacron Oslash -30
+KPX Amacron Otilde -30
+KPX Amacron Q -30
+KPX Amacron T -120
+KPX Amacron Tcaron -120
+KPX Amacron Tcommaaccent -120
+KPX Amacron U -50
+KPX Amacron Uacute -50
+KPX Amacron Ucircumflex -50
+KPX Amacron Udieresis -50
+KPX Amacron Ugrave -50
+KPX Amacron Uhungarumlaut -50
+KPX Amacron Umacron -50
+KPX Amacron Uogonek -50
+KPX Amacron Uring -50
+KPX Amacron V -70
+KPX Amacron W -50
+KPX Amacron Y -100
+KPX Amacron Yacute -100
+KPX Amacron Ydieresis -100
+KPX Amacron u -30
+KPX Amacron uacute -30
+KPX Amacron ucircumflex -30
+KPX Amacron udieresis -30
+KPX Amacron ugrave -30
+KPX Amacron uhungarumlaut -30
+KPX Amacron umacron -30
+KPX Amacron uogonek -30
+KPX Amacron uring -30
+KPX Amacron v -40
+KPX Amacron w -40
+KPX Amacron y -40
+KPX Amacron yacute -40
+KPX Amacron ydieresis -40
+KPX Aogonek C -30
+KPX Aogonek Cacute -30
+KPX Aogonek Ccaron -30
+KPX Aogonek Ccedilla -30
+KPX Aogonek G -30
+KPX Aogonek Gbreve -30
+KPX Aogonek Gcommaaccent -30
+KPX Aogonek O -30
+KPX Aogonek Oacute -30
+KPX Aogonek Ocircumflex -30
+KPX Aogonek Odieresis -30
+KPX Aogonek Ograve -30
+KPX Aogonek Ohungarumlaut -30
+KPX Aogonek Omacron -30
+KPX Aogonek Oslash -30
+KPX Aogonek Otilde -30
+KPX Aogonek Q -30
+KPX Aogonek T -120
+KPX Aogonek Tcaron -120
+KPX Aogonek Tcommaaccent -120
+KPX Aogonek U -50
+KPX Aogonek Uacute -50
+KPX Aogonek Ucircumflex -50
+KPX Aogonek Udieresis -50
+KPX Aogonek Ugrave -50
+KPX Aogonek Uhungarumlaut -50
+KPX Aogonek Umacron -50
+KPX Aogonek Uogonek -50
+KPX Aogonek Uring -50
+KPX Aogonek V -70
+KPX Aogonek W -50
+KPX Aogonek Y -100
+KPX Aogonek Yacute -100
+KPX Aogonek Ydieresis -100
+KPX Aogonek u -30
+KPX Aogonek uacute -30
+KPX Aogonek ucircumflex -30
+KPX Aogonek udieresis -30
+KPX Aogonek ugrave -30
+KPX Aogonek uhungarumlaut -30
+KPX Aogonek umacron -30
+KPX Aogonek uogonek -30
+KPX Aogonek uring -30
+KPX Aogonek v -40
+KPX Aogonek w -40
+KPX Aogonek y -40
+KPX Aogonek yacute -40
+KPX Aogonek ydieresis -40
+KPX Aring C -30
+KPX Aring Cacute -30
+KPX Aring Ccaron -30
+KPX Aring Ccedilla -30
+KPX Aring G -30
+KPX Aring Gbreve -30
+KPX Aring Gcommaaccent -30
+KPX Aring O -30
+KPX Aring Oacute -30
+KPX Aring Ocircumflex -30
+KPX Aring Odieresis -30
+KPX Aring Ograve -30
+KPX Aring Ohungarumlaut -30
+KPX Aring Omacron -30
+KPX Aring Oslash -30
+KPX Aring Otilde -30
+KPX Aring Q -30
+KPX Aring T -120
+KPX Aring Tcaron -120
+KPX Aring Tcommaaccent -120
+KPX Aring U -50
+KPX Aring Uacute -50
+KPX Aring Ucircumflex -50
+KPX Aring Udieresis -50
+KPX Aring Ugrave -50
+KPX Aring Uhungarumlaut -50
+KPX Aring Umacron -50
+KPX Aring Uogonek -50
+KPX Aring Uring -50
+KPX Aring V -70
+KPX Aring W -50
+KPX Aring Y -100
+KPX Aring Yacute -100
+KPX Aring Ydieresis -100
+KPX Aring u -30
+KPX Aring uacute -30
+KPX Aring ucircumflex -30
+KPX Aring udieresis -30
+KPX Aring ugrave -30
+KPX Aring uhungarumlaut -30
+KPX Aring umacron -30
+KPX Aring uogonek -30
+KPX Aring uring -30
+KPX Aring v -40
+KPX Aring w -40
+KPX Aring y -40
+KPX Aring yacute -40
+KPX Aring ydieresis -40
+KPX Atilde C -30
+KPX Atilde Cacute -30
+KPX Atilde Ccaron -30
+KPX Atilde Ccedilla -30
+KPX Atilde G -30
+KPX Atilde Gbreve -30
+KPX Atilde Gcommaaccent -30
+KPX Atilde O -30
+KPX Atilde Oacute -30
+KPX Atilde Ocircumflex -30
+KPX Atilde Odieresis -30
+KPX Atilde Ograve -30
+KPX Atilde Ohungarumlaut -30
+KPX Atilde Omacron -30
+KPX Atilde Oslash -30
+KPX Atilde Otilde -30
+KPX Atilde Q -30
+KPX Atilde T -120
+KPX Atilde Tcaron -120
+KPX Atilde Tcommaaccent -120
+KPX Atilde U -50
+KPX Atilde Uacute -50
+KPX Atilde Ucircumflex -50
+KPX Atilde Udieresis -50
+KPX Atilde Ugrave -50
+KPX Atilde Uhungarumlaut -50
+KPX Atilde Umacron -50
+KPX Atilde Uogonek -50
+KPX Atilde Uring -50
+KPX Atilde V -70
+KPX Atilde W -50
+KPX Atilde Y -100
+KPX Atilde Yacute -100
+KPX Atilde Ydieresis -100
+KPX Atilde u -30
+KPX Atilde uacute -30
+KPX Atilde ucircumflex -30
+KPX Atilde udieresis -30
+KPX Atilde ugrave -30
+KPX Atilde uhungarumlaut -30
+KPX Atilde umacron -30
+KPX Atilde uogonek -30
+KPX Atilde uring -30
+KPX Atilde v -40
+KPX Atilde w -40
+KPX Atilde y -40
+KPX Atilde yacute -40
+KPX Atilde ydieresis -40
+KPX B U -10
+KPX B Uacute -10
+KPX B Ucircumflex -10
+KPX B Udieresis -10
+KPX B Ugrave -10
+KPX B Uhungarumlaut -10
+KPX B Umacron -10
+KPX B Uogonek -10
+KPX B Uring -10
+KPX B comma -20
+KPX B period -20
+KPX C comma -30
+KPX C period -30
+KPX Cacute comma -30
+KPX Cacute period -30
+KPX Ccaron comma -30
+KPX Ccaron period -30
+KPX Ccedilla comma -30
+KPX Ccedilla period -30
+KPX D A -40
+KPX D Aacute -40
+KPX D Abreve -40
+KPX D Acircumflex -40
+KPX D Adieresis -40
+KPX D Agrave -40
+KPX D Amacron -40
+KPX D Aogonek -40
+KPX D Aring -40
+KPX D Atilde -40
+KPX D V -70
+KPX D W -40
+KPX D Y -90
+KPX D Yacute -90
+KPX D Ydieresis -90
+KPX D comma -70
+KPX D period -70
+KPX Dcaron A -40
+KPX Dcaron Aacute -40
+KPX Dcaron Abreve -40
+KPX Dcaron Acircumflex -40
+KPX Dcaron Adieresis -40
+KPX Dcaron Agrave -40
+KPX Dcaron Amacron -40
+KPX Dcaron Aogonek -40
+KPX Dcaron Aring -40
+KPX Dcaron Atilde -40
+KPX Dcaron V -70
+KPX Dcaron W -40
+KPX Dcaron Y -90
+KPX Dcaron Yacute -90
+KPX Dcaron Ydieresis -90
+KPX Dcaron comma -70
+KPX Dcaron period -70
+KPX Dcroat A -40
+KPX Dcroat Aacute -40
+KPX Dcroat Abreve -40
+KPX Dcroat Acircumflex -40
+KPX Dcroat Adieresis -40
+KPX Dcroat Agrave -40
+KPX Dcroat Amacron -40
+KPX Dcroat Aogonek -40
+KPX Dcroat Aring -40
+KPX Dcroat Atilde -40
+KPX Dcroat V -70
+KPX Dcroat W -40
+KPX Dcroat Y -90
+KPX Dcroat Yacute -90
+KPX Dcroat Ydieresis -90
+KPX Dcroat comma -70
+KPX Dcroat period -70
+KPX F A -80
+KPX F Aacute -80
+KPX F Abreve -80
+KPX F Acircumflex -80
+KPX F Adieresis -80
+KPX F Agrave -80
+KPX F Amacron -80
+KPX F Aogonek -80
+KPX F Aring -80
+KPX F Atilde -80
+KPX F a -50
+KPX F aacute -50
+KPX F abreve -50
+KPX F acircumflex -50
+KPX F adieresis -50
+KPX F agrave -50
+KPX F amacron -50
+KPX F aogonek -50
+KPX F aring -50
+KPX F atilde -50
+KPX F comma -150
+KPX F e -30
+KPX F eacute -30
+KPX F ecaron -30
+KPX F ecircumflex -30
+KPX F edieresis -30
+KPX F edotaccent -30
+KPX F egrave -30
+KPX F emacron -30
+KPX F eogonek -30
+KPX F o -30
+KPX F oacute -30
+KPX F ocircumflex -30
+KPX F odieresis -30
+KPX F ograve -30
+KPX F ohungarumlaut -30
+KPX F omacron -30
+KPX F oslash -30
+KPX F otilde -30
+KPX F period -150
+KPX F r -45
+KPX F racute -45
+KPX F rcaron -45
+KPX F rcommaaccent -45
+KPX J A -20
+KPX J Aacute -20
+KPX J Abreve -20
+KPX J Acircumflex -20
+KPX J Adieresis -20
+KPX J Agrave -20
+KPX J Amacron -20
+KPX J Aogonek -20
+KPX J Aring -20
+KPX J Atilde -20
+KPX J a -20
+KPX J aacute -20
+KPX J abreve -20
+KPX J acircumflex -20
+KPX J adieresis -20
+KPX J agrave -20
+KPX J amacron -20
+KPX J aogonek -20
+KPX J aring -20
+KPX J atilde -20
+KPX J comma -30
+KPX J period -30
+KPX J u -20
+KPX J uacute -20
+KPX J ucircumflex -20
+KPX J udieresis -20
+KPX J ugrave -20
+KPX J uhungarumlaut -20
+KPX J umacron -20
+KPX J uogonek -20
+KPX J uring -20
+KPX K O -50
+KPX K Oacute -50
+KPX K Ocircumflex -50
+KPX K Odieresis -50
+KPX K Ograve -50
+KPX K Ohungarumlaut -50
+KPX K Omacron -50
+KPX K Oslash -50
+KPX K Otilde -50
+KPX K e -40
+KPX K eacute -40
+KPX K ecaron -40
+KPX K ecircumflex -40
+KPX K edieresis -40
+KPX K edotaccent -40
+KPX K egrave -40
+KPX K emacron -40
+KPX K eogonek -40
+KPX K o -40
+KPX K oacute -40
+KPX K ocircumflex -40
+KPX K odieresis -40
+KPX K ograve -40
+KPX K ohungarumlaut -40
+KPX K omacron -40
+KPX K oslash -40
+KPX K otilde -40
+KPX K u -30
+KPX K uacute -30
+KPX K ucircumflex -30
+KPX K udieresis -30
+KPX K ugrave -30
+KPX K uhungarumlaut -30
+KPX K umacron -30
+KPX K uogonek -30
+KPX K uring -30
+KPX K y -50
+KPX K yacute -50
+KPX K ydieresis -50
+KPX Kcommaaccent O -50
+KPX Kcommaaccent Oacute -50
+KPX Kcommaaccent Ocircumflex -50
+KPX Kcommaaccent Odieresis -50
+KPX Kcommaaccent Ograve -50
+KPX Kcommaaccent Ohungarumlaut -50
+KPX Kcommaaccent Omacron -50
+KPX Kcommaaccent Oslash -50
+KPX Kcommaaccent Otilde -50
+KPX Kcommaaccent e -40
+KPX Kcommaaccent eacute -40
+KPX Kcommaaccent ecaron -40
+KPX Kcommaaccent ecircumflex -40
+KPX Kcommaaccent edieresis -40
+KPX Kcommaaccent edotaccent -40
+KPX Kcommaaccent egrave -40
+KPX Kcommaaccent emacron -40
+KPX Kcommaaccent eogonek -40
+KPX Kcommaaccent o -40
+KPX Kcommaaccent oacute -40
+KPX Kcommaaccent ocircumflex -40
+KPX Kcommaaccent odieresis -40
+KPX Kcommaaccent ograve -40
+KPX Kcommaaccent ohungarumlaut -40
+KPX Kcommaaccent omacron -40
+KPX Kcommaaccent oslash -40
+KPX Kcommaaccent otilde -40
+KPX Kcommaaccent u -30
+KPX Kcommaaccent uacute -30
+KPX Kcommaaccent ucircumflex -30
+KPX Kcommaaccent udieresis -30
+KPX Kcommaaccent ugrave -30
+KPX Kcommaaccent uhungarumlaut -30
+KPX Kcommaaccent umacron -30
+KPX Kcommaaccent uogonek -30
+KPX Kcommaaccent uring -30
+KPX Kcommaaccent y -50
+KPX Kcommaaccent yacute -50
+KPX Kcommaaccent ydieresis -50
+KPX L T -110
+KPX L Tcaron -110
+KPX L Tcommaaccent -110
+KPX L V -110
+KPX L W -70
+KPX L Y -140
+KPX L Yacute -140
+KPX L Ydieresis -140
+KPX L quotedblright -140
+KPX L quoteright -160
+KPX L y -30
+KPX L yacute -30
+KPX L ydieresis -30
+KPX Lacute T -110
+KPX Lacute Tcaron -110
+KPX Lacute Tcommaaccent -110
+KPX Lacute V -110
+KPX Lacute W -70
+KPX Lacute Y -140
+KPX Lacute Yacute -140
+KPX Lacute Ydieresis -140
+KPX Lacute quotedblright -140
+KPX Lacute quoteright -160
+KPX Lacute y -30
+KPX Lacute yacute -30
+KPX Lacute ydieresis -30
+KPX Lcaron T -110
+KPX Lcaron Tcaron -110
+KPX Lcaron Tcommaaccent -110
+KPX Lcaron V -110
+KPX Lcaron W -70
+KPX Lcaron Y -140
+KPX Lcaron Yacute -140
+KPX Lcaron Ydieresis -140
+KPX Lcaron quotedblright -140
+KPX Lcaron quoteright -160
+KPX Lcaron y -30
+KPX Lcaron yacute -30
+KPX Lcaron ydieresis -30
+KPX Lcommaaccent T -110
+KPX Lcommaaccent Tcaron -110
+KPX Lcommaaccent Tcommaaccent -110
+KPX Lcommaaccent V -110
+KPX Lcommaaccent W -70
+KPX Lcommaaccent Y -140
+KPX Lcommaaccent Yacute -140
+KPX Lcommaaccent Ydieresis -140
+KPX Lcommaaccent quotedblright -140
+KPX Lcommaaccent quoteright -160
+KPX Lcommaaccent y -30
+KPX Lcommaaccent yacute -30
+KPX Lcommaaccent ydieresis -30
+KPX Lslash T -110
+KPX Lslash Tcaron -110
+KPX Lslash Tcommaaccent -110
+KPX Lslash V -110
+KPX Lslash W -70
+KPX Lslash Y -140
+KPX Lslash Yacute -140
+KPX Lslash Ydieresis -140
+KPX Lslash quotedblright -140
+KPX Lslash quoteright -160
+KPX Lslash y -30
+KPX Lslash yacute -30
+KPX Lslash ydieresis -30
+KPX O A -20
+KPX O Aacute -20
+KPX O Abreve -20
+KPX O Acircumflex -20
+KPX O Adieresis -20
+KPX O Agrave -20
+KPX O Amacron -20
+KPX O Aogonek -20
+KPX O Aring -20
+KPX O Atilde -20
+KPX O T -40
+KPX O Tcaron -40
+KPX O Tcommaaccent -40
+KPX O V -50
+KPX O W -30
+KPX O X -60
+KPX O Y -70
+KPX O Yacute -70
+KPX O Ydieresis -70
+KPX O comma -40
+KPX O period -40
+KPX Oacute A -20
+KPX Oacute Aacute -20
+KPX Oacute Abreve -20
+KPX Oacute Acircumflex -20
+KPX Oacute Adieresis -20
+KPX Oacute Agrave -20
+KPX Oacute Amacron -20
+KPX Oacute Aogonek -20
+KPX Oacute Aring -20
+KPX Oacute Atilde -20
+KPX Oacute T -40
+KPX Oacute Tcaron -40
+KPX Oacute Tcommaaccent -40
+KPX Oacute V -50
+KPX Oacute W -30
+KPX Oacute X -60
+KPX Oacute Y -70
+KPX Oacute Yacute -70
+KPX Oacute Ydieresis -70
+KPX Oacute comma -40
+KPX Oacute period -40
+KPX Ocircumflex A -20
+KPX Ocircumflex Aacute -20
+KPX Ocircumflex Abreve -20
+KPX Ocircumflex Acircumflex -20
+KPX Ocircumflex Adieresis -20
+KPX Ocircumflex Agrave -20
+KPX Ocircumflex Amacron -20
+KPX Ocircumflex Aogonek -20
+KPX Ocircumflex Aring -20
+KPX Ocircumflex Atilde -20
+KPX Ocircumflex T -40
+KPX Ocircumflex Tcaron -40
+KPX Ocircumflex Tcommaaccent -40
+KPX Ocircumflex V -50
+KPX Ocircumflex W -30
+KPX Ocircumflex X -60
+KPX Ocircumflex Y -70
+KPX Ocircumflex Yacute -70
+KPX Ocircumflex Ydieresis -70
+KPX Ocircumflex comma -40
+KPX Ocircumflex period -40
+KPX Odieresis A -20
+KPX Odieresis Aacute -20
+KPX Odieresis Abreve -20
+KPX Odieresis Acircumflex -20
+KPX Odieresis Adieresis -20
+KPX Odieresis Agrave -20
+KPX Odieresis Amacron -20
+KPX Odieresis Aogonek -20
+KPX Odieresis Aring -20
+KPX Odieresis Atilde -20
+KPX Odieresis T -40
+KPX Odieresis Tcaron -40
+KPX Odieresis Tcommaaccent -40
+KPX Odieresis V -50
+KPX Odieresis W -30
+KPX Odieresis X -60
+KPX Odieresis Y -70
+KPX Odieresis Yacute -70
+KPX Odieresis Ydieresis -70
+KPX Odieresis comma -40
+KPX Odieresis period -40
+KPX Ograve A -20
+KPX Ograve Aacute -20
+KPX Ograve Abreve -20
+KPX Ograve Acircumflex -20
+KPX Ograve Adieresis -20
+KPX Ograve Agrave -20
+KPX Ograve Amacron -20
+KPX Ograve Aogonek -20
+KPX Ograve Aring -20
+KPX Ograve Atilde -20
+KPX Ograve T -40
+KPX Ograve Tcaron -40
+KPX Ograve Tcommaaccent -40
+KPX Ograve V -50
+KPX Ograve W -30
+KPX Ograve X -60
+KPX Ograve Y -70
+KPX Ograve Yacute -70
+KPX Ograve Ydieresis -70
+KPX Ograve comma -40
+KPX Ograve period -40
+KPX Ohungarumlaut A -20
+KPX Ohungarumlaut Aacute -20
+KPX Ohungarumlaut Abreve -20
+KPX Ohungarumlaut Acircumflex -20
+KPX Ohungarumlaut Adieresis -20
+KPX Ohungarumlaut Agrave -20
+KPX Ohungarumlaut Amacron -20
+KPX Ohungarumlaut Aogonek -20
+KPX Ohungarumlaut Aring -20
+KPX Ohungarumlaut Atilde -20
+KPX Ohungarumlaut T -40
+KPX Ohungarumlaut Tcaron -40
+KPX Ohungarumlaut Tcommaaccent -40
+KPX Ohungarumlaut V -50
+KPX Ohungarumlaut W -30
+KPX Ohungarumlaut X -60
+KPX Ohungarumlaut Y -70
+KPX Ohungarumlaut Yacute -70
+KPX Ohungarumlaut Ydieresis -70
+KPX Ohungarumlaut comma -40
+KPX Ohungarumlaut period -40
+KPX Omacron A -20
+KPX Omacron Aacute -20
+KPX Omacron Abreve -20
+KPX Omacron Acircumflex -20
+KPX Omacron Adieresis -20
+KPX Omacron Agrave -20
+KPX Omacron Amacron -20
+KPX Omacron Aogonek -20
+KPX Omacron Aring -20
+KPX Omacron Atilde -20
+KPX Omacron T -40
+KPX Omacron Tcaron -40
+KPX Omacron Tcommaaccent -40
+KPX Omacron V -50
+KPX Omacron W -30
+KPX Omacron X -60
+KPX Omacron Y -70
+KPX Omacron Yacute -70
+KPX Omacron Ydieresis -70
+KPX Omacron comma -40
+KPX Omacron period -40
+KPX Oslash A -20
+KPX Oslash Aacute -20
+KPX Oslash Abreve -20
+KPX Oslash Acircumflex -20
+KPX Oslash Adieresis -20
+KPX Oslash Agrave -20
+KPX Oslash Amacron -20
+KPX Oslash Aogonek -20
+KPX Oslash Aring -20
+KPX Oslash Atilde -20
+KPX Oslash T -40
+KPX Oslash Tcaron -40
+KPX Oslash Tcommaaccent -40
+KPX Oslash V -50
+KPX Oslash W -30
+KPX Oslash X -60
+KPX Oslash Y -70
+KPX Oslash Yacute -70
+KPX Oslash Ydieresis -70
+KPX Oslash comma -40
+KPX Oslash period -40
+KPX Otilde A -20
+KPX Otilde Aacute -20
+KPX Otilde Abreve -20
+KPX Otilde Acircumflex -20
+KPX Otilde Adieresis -20
+KPX Otilde Agrave -20
+KPX Otilde Amacron -20
+KPX Otilde Aogonek -20
+KPX Otilde Aring -20
+KPX Otilde Atilde -20
+KPX Otilde T -40
+KPX Otilde Tcaron -40
+KPX Otilde Tcommaaccent -40
+KPX Otilde V -50
+KPX Otilde W -30
+KPX Otilde X -60
+KPX Otilde Y -70
+KPX Otilde Yacute -70
+KPX Otilde Ydieresis -70
+KPX Otilde comma -40
+KPX Otilde period -40
+KPX P A -120
+KPX P Aacute -120
+KPX P Abreve -120
+KPX P Acircumflex -120
+KPX P Adieresis -120
+KPX P Agrave -120
+KPX P Amacron -120
+KPX P Aogonek -120
+KPX P Aring -120
+KPX P Atilde -120
+KPX P a -40
+KPX P aacute -40
+KPX P abreve -40
+KPX P acircumflex -40
+KPX P adieresis -40
+KPX P agrave -40
+KPX P amacron -40
+KPX P aogonek -40
+KPX P aring -40
+KPX P atilde -40
+KPX P comma -180
+KPX P e -50
+KPX P eacute -50
+KPX P ecaron -50
+KPX P ecircumflex -50
+KPX P edieresis -50
+KPX P edotaccent -50
+KPX P egrave -50
+KPX P emacron -50
+KPX P eogonek -50
+KPX P o -50
+KPX P oacute -50
+KPX P ocircumflex -50
+KPX P odieresis -50
+KPX P ograve -50
+KPX P ohungarumlaut -50
+KPX P omacron -50
+KPX P oslash -50
+KPX P otilde -50
+KPX P period -180
+KPX Q U -10
+KPX Q Uacute -10
+KPX Q Ucircumflex -10
+KPX Q Udieresis -10
+KPX Q Ugrave -10
+KPX Q Uhungarumlaut -10
+KPX Q Umacron -10
+KPX Q Uogonek -10
+KPX Q Uring -10
+KPX R O -20
+KPX R Oacute -20
+KPX R Ocircumflex -20
+KPX R Odieresis -20
+KPX R Ograve -20
+KPX R Ohungarumlaut -20
+KPX R Omacron -20
+KPX R Oslash -20
+KPX R Otilde -20
+KPX R T -30
+KPX R Tcaron -30
+KPX R Tcommaaccent -30
+KPX R U -40
+KPX R Uacute -40
+KPX R Ucircumflex -40
+KPX R Udieresis -40
+KPX R Ugrave -40
+KPX R Uhungarumlaut -40
+KPX R Umacron -40
+KPX R Uogonek -40
+KPX R Uring -40
+KPX R V -50
+KPX R W -30
+KPX R Y -50
+KPX R Yacute -50
+KPX R Ydieresis -50
+KPX Racute O -20
+KPX Racute Oacute -20
+KPX Racute Ocircumflex -20
+KPX Racute Odieresis -20
+KPX Racute Ograve -20
+KPX Racute Ohungarumlaut -20
+KPX Racute Omacron -20
+KPX Racute Oslash -20
+KPX Racute Otilde -20
+KPX Racute T -30
+KPX Racute Tcaron -30
+KPX Racute Tcommaaccent -30
+KPX Racute U -40
+KPX Racute Uacute -40
+KPX Racute Ucircumflex -40
+KPX Racute Udieresis -40
+KPX Racute Ugrave -40
+KPX Racute Uhungarumlaut -40
+KPX Racute Umacron -40
+KPX Racute Uogonek -40
+KPX Racute Uring -40
+KPX Racute V -50
+KPX Racute W -30
+KPX Racute Y -50
+KPX Racute Yacute -50
+KPX Racute Ydieresis -50
+KPX Rcaron O -20
+KPX Rcaron Oacute -20
+KPX Rcaron Ocircumflex -20
+KPX Rcaron Odieresis -20
+KPX Rcaron Ograve -20
+KPX Rcaron Ohungarumlaut -20
+KPX Rcaron Omacron -20
+KPX Rcaron Oslash -20
+KPX Rcaron Otilde -20
+KPX Rcaron T -30
+KPX Rcaron Tcaron -30
+KPX Rcaron Tcommaaccent -30
+KPX Rcaron U -40
+KPX Rcaron Uacute -40
+KPX Rcaron Ucircumflex -40
+KPX Rcaron Udieresis -40
+KPX Rcaron Ugrave -40
+KPX Rcaron Uhungarumlaut -40
+KPX Rcaron Umacron -40
+KPX Rcaron Uogonek -40
+KPX Rcaron Uring -40
+KPX Rcaron V -50
+KPX Rcaron W -30
+KPX Rcaron Y -50
+KPX Rcaron Yacute -50
+KPX Rcaron Ydieresis -50
+KPX Rcommaaccent O -20
+KPX Rcommaaccent Oacute -20
+KPX Rcommaaccent Ocircumflex -20
+KPX Rcommaaccent Odieresis -20
+KPX Rcommaaccent Ograve -20
+KPX Rcommaaccent Ohungarumlaut -20
+KPX Rcommaaccent Omacron -20
+KPX Rcommaaccent Oslash -20
+KPX Rcommaaccent Otilde -20
+KPX Rcommaaccent T -30
+KPX Rcommaaccent Tcaron -30
+KPX Rcommaaccent Tcommaaccent -30
+KPX Rcommaaccent U -40
+KPX Rcommaaccent Uacute -40
+KPX Rcommaaccent Ucircumflex -40
+KPX Rcommaaccent Udieresis -40
+KPX Rcommaaccent Ugrave -40
+KPX Rcommaaccent Uhungarumlaut -40
+KPX Rcommaaccent Umacron -40
+KPX Rcommaaccent Uogonek -40
+KPX Rcommaaccent Uring -40
+KPX Rcommaaccent V -50
+KPX Rcommaaccent W -30
+KPX Rcommaaccent Y -50
+KPX Rcommaaccent Yacute -50
+KPX Rcommaaccent Ydieresis -50
+KPX S comma -20
+KPX S period -20
+KPX Sacute comma -20
+KPX Sacute period -20
+KPX Scaron comma -20
+KPX Scaron period -20
+KPX Scedilla comma -20
+KPX Scedilla period -20
+KPX Scommaaccent comma -20
+KPX Scommaaccent period -20
+KPX T A -120
+KPX T Aacute -120
+KPX T Abreve -120
+KPX T Acircumflex -120
+KPX T Adieresis -120
+KPX T Agrave -120
+KPX T Amacron -120
+KPX T Aogonek -120
+KPX T Aring -120
+KPX T Atilde -120
+KPX T O -40
+KPX T Oacute -40
+KPX T Ocircumflex -40
+KPX T Odieresis -40
+KPX T Ograve -40
+KPX T Ohungarumlaut -40
+KPX T Omacron -40
+KPX T Oslash -40
+KPX T Otilde -40
+KPX T a -120
+KPX T aacute -120
+KPX T abreve -60
+KPX T acircumflex -120
+KPX T adieresis -120
+KPX T agrave -120
+KPX T amacron -60
+KPX T aogonek -120
+KPX T aring -120
+KPX T atilde -60
+KPX T colon -20
+KPX T comma -120
+KPX T e -120
+KPX T eacute -120
+KPX T ecaron -120
+KPX T ecircumflex -120
+KPX T edieresis -120
+KPX T edotaccent -120
+KPX T egrave -60
+KPX T emacron -60
+KPX T eogonek -120
+KPX T hyphen -140
+KPX T o -120
+KPX T oacute -120
+KPX T ocircumflex -120
+KPX T odieresis -120
+KPX T ograve -120
+KPX T ohungarumlaut -120
+KPX T omacron -60
+KPX T oslash -120
+KPX T otilde -60
+KPX T period -120
+KPX T r -120
+KPX T racute -120
+KPX T rcaron -120
+KPX T rcommaaccent -120
+KPX T semicolon -20
+KPX T u -120
+KPX T uacute -120
+KPX T ucircumflex -120
+KPX T udieresis -120
+KPX T ugrave -120
+KPX T uhungarumlaut -120
+KPX T umacron -60
+KPX T uogonek -120
+KPX T uring -120
+KPX T w -120
+KPX T y -120
+KPX T yacute -120
+KPX T ydieresis -60
+KPX Tcaron A -120
+KPX Tcaron Aacute -120
+KPX Tcaron Abreve -120
+KPX Tcaron Acircumflex -120
+KPX Tcaron Adieresis -120
+KPX Tcaron Agrave -120
+KPX Tcaron Amacron -120
+KPX Tcaron Aogonek -120
+KPX Tcaron Aring -120
+KPX Tcaron Atilde -120
+KPX Tcaron O -40
+KPX Tcaron Oacute -40
+KPX Tcaron Ocircumflex -40
+KPX Tcaron Odieresis -40
+KPX Tcaron Ograve -40
+KPX Tcaron Ohungarumlaut -40
+KPX Tcaron Omacron -40
+KPX Tcaron Oslash -40
+KPX Tcaron Otilde -40
+KPX Tcaron a -120
+KPX Tcaron aacute -120
+KPX Tcaron abreve -60
+KPX Tcaron acircumflex -120
+KPX Tcaron adieresis -120
+KPX Tcaron agrave -120
+KPX Tcaron amacron -60
+KPX Tcaron aogonek -120
+KPX Tcaron aring -120
+KPX Tcaron atilde -60
+KPX Tcaron colon -20
+KPX Tcaron comma -120
+KPX Tcaron e -120
+KPX Tcaron eacute -120
+KPX Tcaron ecaron -120
+KPX Tcaron ecircumflex -120
+KPX Tcaron edieresis -120
+KPX Tcaron edotaccent -120
+KPX Tcaron egrave -60
+KPX Tcaron emacron -60
+KPX Tcaron eogonek -120
+KPX Tcaron hyphen -140
+KPX Tcaron o -120
+KPX Tcaron oacute -120
+KPX Tcaron ocircumflex -120
+KPX Tcaron odieresis -120
+KPX Tcaron ograve -120
+KPX Tcaron ohungarumlaut -120
+KPX Tcaron omacron -60
+KPX Tcaron oslash -120
+KPX Tcaron otilde -60
+KPX Tcaron period -120
+KPX Tcaron r -120
+KPX Tcaron racute -120
+KPX Tcaron rcaron -120
+KPX Tcaron rcommaaccent -120
+KPX Tcaron semicolon -20
+KPX Tcaron u -120
+KPX Tcaron uacute -120
+KPX Tcaron ucircumflex -120
+KPX Tcaron udieresis -120
+KPX Tcaron ugrave -120
+KPX Tcaron uhungarumlaut -120
+KPX Tcaron umacron -60
+KPX Tcaron uogonek -120
+KPX Tcaron uring -120
+KPX Tcaron w -120
+KPX Tcaron y -120
+KPX Tcaron yacute -120
+KPX Tcaron ydieresis -60
+KPX Tcommaaccent A -120
+KPX Tcommaaccent Aacute -120
+KPX Tcommaaccent Abreve -120
+KPX Tcommaaccent Acircumflex -120
+KPX Tcommaaccent Adieresis -120
+KPX Tcommaaccent Agrave -120
+KPX Tcommaaccent Amacron -120
+KPX Tcommaaccent Aogonek -120
+KPX Tcommaaccent Aring -120
+KPX Tcommaaccent Atilde -120
+KPX Tcommaaccent O -40
+KPX Tcommaaccent Oacute -40
+KPX Tcommaaccent Ocircumflex -40
+KPX Tcommaaccent Odieresis -40
+KPX Tcommaaccent Ograve -40
+KPX Tcommaaccent Ohungarumlaut -40
+KPX Tcommaaccent Omacron -40
+KPX Tcommaaccent Oslash -40
+KPX Tcommaaccent Otilde -40
+KPX Tcommaaccent a -120
+KPX Tcommaaccent aacute -120
+KPX Tcommaaccent abreve -60
+KPX Tcommaaccent acircumflex -120
+KPX Tcommaaccent adieresis -120
+KPX Tcommaaccent agrave -120
+KPX Tcommaaccent amacron -60
+KPX Tcommaaccent aogonek -120
+KPX Tcommaaccent aring -120
+KPX Tcommaaccent atilde -60
+KPX Tcommaaccent colon -20
+KPX Tcommaaccent comma -120
+KPX Tcommaaccent e -120
+KPX Tcommaaccent eacute -120
+KPX Tcommaaccent ecaron -120
+KPX Tcommaaccent ecircumflex -120
+KPX Tcommaaccent edieresis -120
+KPX Tcommaaccent edotaccent -120
+KPX Tcommaaccent egrave -60
+KPX Tcommaaccent emacron -60
+KPX Tcommaaccent eogonek -120
+KPX Tcommaaccent hyphen -140
+KPX Tcommaaccent o -120
+KPX Tcommaaccent oacute -120
+KPX Tcommaaccent ocircumflex -120
+KPX Tcommaaccent odieresis -120
+KPX Tcommaaccent ograve -120
+KPX Tcommaaccent ohungarumlaut -120
+KPX Tcommaaccent omacron -60
+KPX Tcommaaccent oslash -120
+KPX Tcommaaccent otilde -60
+KPX Tcommaaccent period -120
+KPX Tcommaaccent r -120
+KPX Tcommaaccent racute -120
+KPX Tcommaaccent rcaron -120
+KPX Tcommaaccent rcommaaccent -120
+KPX Tcommaaccent semicolon -20
+KPX Tcommaaccent u -120
+KPX Tcommaaccent uacute -120
+KPX Tcommaaccent ucircumflex -120
+KPX Tcommaaccent udieresis -120
+KPX Tcommaaccent ugrave -120
+KPX Tcommaaccent uhungarumlaut -120
+KPX Tcommaaccent umacron -60
+KPX Tcommaaccent uogonek -120
+KPX Tcommaaccent uring -120
+KPX Tcommaaccent w -120
+KPX Tcommaaccent y -120
+KPX Tcommaaccent yacute -120
+KPX Tcommaaccent ydieresis -60
+KPX U A -40
+KPX U Aacute -40
+KPX U Abreve -40
+KPX U Acircumflex -40
+KPX U Adieresis -40
+KPX U Agrave -40
+KPX U Amacron -40
+KPX U Aogonek -40
+KPX U Aring -40
+KPX U Atilde -40
+KPX U comma -40
+KPX U period -40
+KPX Uacute A -40
+KPX Uacute Aacute -40
+KPX Uacute Abreve -40
+KPX Uacute Acircumflex -40
+KPX Uacute Adieresis -40
+KPX Uacute Agrave -40
+KPX Uacute Amacron -40
+KPX Uacute Aogonek -40
+KPX Uacute Aring -40
+KPX Uacute Atilde -40
+KPX Uacute comma -40
+KPX Uacute period -40
+KPX Ucircumflex A -40
+KPX Ucircumflex Aacute -40
+KPX Ucircumflex Abreve -40
+KPX Ucircumflex Acircumflex -40
+KPX Ucircumflex Adieresis -40
+KPX Ucircumflex Agrave -40
+KPX Ucircumflex Amacron -40
+KPX Ucircumflex Aogonek -40
+KPX Ucircumflex Aring -40
+KPX Ucircumflex Atilde -40
+KPX Ucircumflex comma -40
+KPX Ucircumflex period -40
+KPX Udieresis A -40
+KPX Udieresis Aacute -40
+KPX Udieresis Abreve -40
+KPX Udieresis Acircumflex -40
+KPX Udieresis Adieresis -40
+KPX Udieresis Agrave -40
+KPX Udieresis Amacron -40
+KPX Udieresis Aogonek -40
+KPX Udieresis Aring -40
+KPX Udieresis Atilde -40
+KPX Udieresis comma -40
+KPX Udieresis period -40
+KPX Ugrave A -40
+KPX Ugrave Aacute -40
+KPX Ugrave Abreve -40
+KPX Ugrave Acircumflex -40
+KPX Ugrave Adieresis -40
+KPX Ugrave Agrave -40
+KPX Ugrave Amacron -40
+KPX Ugrave Aogonek -40
+KPX Ugrave Aring -40
+KPX Ugrave Atilde -40
+KPX Ugrave comma -40
+KPX Ugrave period -40
+KPX Uhungarumlaut A -40
+KPX Uhungarumlaut Aacute -40
+KPX Uhungarumlaut Abreve -40
+KPX Uhungarumlaut Acircumflex -40
+KPX Uhungarumlaut Adieresis -40
+KPX Uhungarumlaut Agrave -40
+KPX Uhungarumlaut Amacron -40
+KPX Uhungarumlaut Aogonek -40
+KPX Uhungarumlaut Aring -40
+KPX Uhungarumlaut Atilde -40
+KPX Uhungarumlaut comma -40
+KPX Uhungarumlaut period -40
+KPX Umacron A -40
+KPX Umacron Aacute -40
+KPX Umacron Abreve -40
+KPX Umacron Acircumflex -40
+KPX Umacron Adieresis -40
+KPX Umacron Agrave -40
+KPX Umacron Amacron -40
+KPX Umacron Aogonek -40
+KPX Umacron Aring -40
+KPX Umacron Atilde -40
+KPX Umacron comma -40
+KPX Umacron period -40
+KPX Uogonek A -40
+KPX Uogonek Aacute -40
+KPX Uogonek Abreve -40
+KPX Uogonek Acircumflex -40
+KPX Uogonek Adieresis -40
+KPX Uogonek Agrave -40
+KPX Uogonek Amacron -40
+KPX Uogonek Aogonek -40
+KPX Uogonek Aring -40
+KPX Uogonek Atilde -40
+KPX Uogonek comma -40
+KPX Uogonek period -40
+KPX Uring A -40
+KPX Uring Aacute -40
+KPX Uring Abreve -40
+KPX Uring Acircumflex -40
+KPX Uring Adieresis -40
+KPX Uring Agrave -40
+KPX Uring Amacron -40
+KPX Uring Aogonek -40
+KPX Uring Aring -40
+KPX Uring Atilde -40
+KPX Uring comma -40
+KPX Uring period -40
+KPX V A -80
+KPX V Aacute -80
+KPX V Abreve -80
+KPX V Acircumflex -80
+KPX V Adieresis -80
+KPX V Agrave -80
+KPX V Amacron -80
+KPX V Aogonek -80
+KPX V Aring -80
+KPX V Atilde -80
+KPX V G -40
+KPX V Gbreve -40
+KPX V Gcommaaccent -40
+KPX V O -40
+KPX V Oacute -40
+KPX V Ocircumflex -40
+KPX V Odieresis -40
+KPX V Ograve -40
+KPX V Ohungarumlaut -40
+KPX V Omacron -40
+KPX V Oslash -40
+KPX V Otilde -40
+KPX V a -70
+KPX V aacute -70
+KPX V abreve -70
+KPX V acircumflex -70
+KPX V adieresis -70
+KPX V agrave -70
+KPX V amacron -70
+KPX V aogonek -70
+KPX V aring -70
+KPX V atilde -70
+KPX V colon -40
+KPX V comma -125
+KPX V e -80
+KPX V eacute -80
+KPX V ecaron -80
+KPX V ecircumflex -80
+KPX V edieresis -80
+KPX V edotaccent -80
+KPX V egrave -80
+KPX V emacron -80
+KPX V eogonek -80
+KPX V hyphen -80
+KPX V o -80
+KPX V oacute -80
+KPX V ocircumflex -80
+KPX V odieresis -80
+KPX V ograve -80
+KPX V ohungarumlaut -80
+KPX V omacron -80
+KPX V oslash -80
+KPX V otilde -80
+KPX V period -125
+KPX V semicolon -40
+KPX V u -70
+KPX V uacute -70
+KPX V ucircumflex -70
+KPX V udieresis -70
+KPX V ugrave -70
+KPX V uhungarumlaut -70
+KPX V umacron -70
+KPX V uogonek -70
+KPX V uring -70
+KPX W A -50
+KPX W Aacute -50
+KPX W Abreve -50
+KPX W Acircumflex -50
+KPX W Adieresis -50
+KPX W Agrave -50
+KPX W Amacron -50
+KPX W Aogonek -50
+KPX W Aring -50
+KPX W Atilde -50
+KPX W O -20
+KPX W Oacute -20
+KPX W Ocircumflex -20
+KPX W Odieresis -20
+KPX W Ograve -20
+KPX W Ohungarumlaut -20
+KPX W Omacron -20
+KPX W Oslash -20
+KPX W Otilde -20
+KPX W a -40
+KPX W aacute -40
+KPX W abreve -40
+KPX W acircumflex -40
+KPX W adieresis -40
+KPX W agrave -40
+KPX W amacron -40
+KPX W aogonek -40
+KPX W aring -40
+KPX W atilde -40
+KPX W comma -80
+KPX W e -30
+KPX W eacute -30
+KPX W ecaron -30
+KPX W ecircumflex -30
+KPX W edieresis -30
+KPX W edotaccent -30
+KPX W egrave -30
+KPX W emacron -30
+KPX W eogonek -30
+KPX W hyphen -40
+KPX W o -30
+KPX W oacute -30
+KPX W ocircumflex -30
+KPX W odieresis -30
+KPX W ograve -30
+KPX W ohungarumlaut -30
+KPX W omacron -30
+KPX W oslash -30
+KPX W otilde -30
+KPX W period -80
+KPX W u -30
+KPX W uacute -30
+KPX W ucircumflex -30
+KPX W udieresis -30
+KPX W ugrave -30
+KPX W uhungarumlaut -30
+KPX W umacron -30
+KPX W uogonek -30
+KPX W uring -30
+KPX W y -20
+KPX W yacute -20
+KPX W ydieresis -20
+KPX Y A -110
+KPX Y Aacute -110
+KPX Y Abreve -110
+KPX Y Acircumflex -110
+KPX Y Adieresis -110
+KPX Y Agrave -110
+KPX Y Amacron -110
+KPX Y Aogonek -110
+KPX Y Aring -110
+KPX Y Atilde -110
+KPX Y O -85
+KPX Y Oacute -85
+KPX Y Ocircumflex -85
+KPX Y Odieresis -85
+KPX Y Ograve -85
+KPX Y Ohungarumlaut -85
+KPX Y Omacron -85
+KPX Y Oslash -85
+KPX Y Otilde -85
+KPX Y a -140
+KPX Y aacute -140
+KPX Y abreve -70
+KPX Y acircumflex -140
+KPX Y adieresis -140
+KPX Y agrave -140
+KPX Y amacron -70
+KPX Y aogonek -140
+KPX Y aring -140
+KPX Y atilde -140
+KPX Y colon -60
+KPX Y comma -140
+KPX Y e -140
+KPX Y eacute -140
+KPX Y ecaron -140
+KPX Y ecircumflex -140
+KPX Y edieresis -140
+KPX Y edotaccent -140
+KPX Y egrave -140
+KPX Y emacron -70
+KPX Y eogonek -140
+KPX Y hyphen -140
+KPX Y i -20
+KPX Y iacute -20
+KPX Y iogonek -20
+KPX Y o -140
+KPX Y oacute -140
+KPX Y ocircumflex -140
+KPX Y odieresis -140
+KPX Y ograve -140
+KPX Y ohungarumlaut -140
+KPX Y omacron -140
+KPX Y oslash -140
+KPX Y otilde -140
+KPX Y period -140
+KPX Y semicolon -60
+KPX Y u -110
+KPX Y uacute -110
+KPX Y ucircumflex -110
+KPX Y udieresis -110
+KPX Y ugrave -110
+KPX Y uhungarumlaut -110
+KPX Y umacron -110
+KPX Y uogonek -110
+KPX Y uring -110
+KPX Yacute A -110
+KPX Yacute Aacute -110
+KPX Yacute Abreve -110
+KPX Yacute Acircumflex -110
+KPX Yacute Adieresis -110
+KPX Yacute Agrave -110
+KPX Yacute Amacron -110
+KPX Yacute Aogonek -110
+KPX Yacute Aring -110
+KPX Yacute Atilde -110
+KPX Yacute O -85
+KPX Yacute Oacute -85
+KPX Yacute Ocircumflex -85
+KPX Yacute Odieresis -85
+KPX Yacute Ograve -85
+KPX Yacute Ohungarumlaut -85
+KPX Yacute Omacron -85
+KPX Yacute Oslash -85
+KPX Yacute Otilde -85
+KPX Yacute a -140
+KPX Yacute aacute -140
+KPX Yacute abreve -70
+KPX Yacute acircumflex -140
+KPX Yacute adieresis -140
+KPX Yacute agrave -140
+KPX Yacute amacron -70
+KPX Yacute aogonek -140
+KPX Yacute aring -140
+KPX Yacute atilde -70
+KPX Yacute colon -60
+KPX Yacute comma -140
+KPX Yacute e -140
+KPX Yacute eacute -140
+KPX Yacute ecaron -140
+KPX Yacute ecircumflex -140
+KPX Yacute edieresis -140
+KPX Yacute edotaccent -140
+KPX Yacute egrave -140
+KPX Yacute emacron -70
+KPX Yacute eogonek -140
+KPX Yacute hyphen -140
+KPX Yacute i -20
+KPX Yacute iacute -20
+KPX Yacute iogonek -20
+KPX Yacute o -140
+KPX Yacute oacute -140
+KPX Yacute ocircumflex -140
+KPX Yacute odieresis -140
+KPX Yacute ograve -140
+KPX Yacute ohungarumlaut -140
+KPX Yacute omacron -70
+KPX Yacute oslash -140
+KPX Yacute otilde -140
+KPX Yacute period -140
+KPX Yacute semicolon -60
+KPX Yacute u -110
+KPX Yacute uacute -110
+KPX Yacute ucircumflex -110
+KPX Yacute udieresis -110
+KPX Yacute ugrave -110
+KPX Yacute uhungarumlaut -110
+KPX Yacute umacron -110
+KPX Yacute uogonek -110
+KPX Yacute uring -110
+KPX Ydieresis A -110
+KPX Ydieresis Aacute -110
+KPX Ydieresis Abreve -110
+KPX Ydieresis Acircumflex -110
+KPX Ydieresis Adieresis -110
+KPX Ydieresis Agrave -110
+KPX Ydieresis Amacron -110
+KPX Ydieresis Aogonek -110
+KPX Ydieresis Aring -110
+KPX Ydieresis Atilde -110
+KPX Ydieresis O -85
+KPX Ydieresis Oacute -85
+KPX Ydieresis Ocircumflex -85
+KPX Ydieresis Odieresis -85
+KPX Ydieresis Ograve -85
+KPX Ydieresis Ohungarumlaut -85
+KPX Ydieresis Omacron -85
+KPX Ydieresis Oslash -85
+KPX Ydieresis Otilde -85
+KPX Ydieresis a -140
+KPX Ydieresis aacute -140
+KPX Ydieresis abreve -70
+KPX Ydieresis acircumflex -140
+KPX Ydieresis adieresis -140
+KPX Ydieresis agrave -140
+KPX Ydieresis amacron -70
+KPX Ydieresis aogonek -140
+KPX Ydieresis aring -140
+KPX Ydieresis atilde -70
+KPX Ydieresis colon -60
+KPX Ydieresis comma -140
+KPX Ydieresis e -140
+KPX Ydieresis eacute -140
+KPX Ydieresis ecaron -140
+KPX Ydieresis ecircumflex -140
+KPX Ydieresis edieresis -140
+KPX Ydieresis edotaccent -140
+KPX Ydieresis egrave -140
+KPX Ydieresis emacron -70
+KPX Ydieresis eogonek -140
+KPX Ydieresis hyphen -140
+KPX Ydieresis i -20
+KPX Ydieresis iacute -20
+KPX Ydieresis iogonek -20
+KPX Ydieresis o -140
+KPX Ydieresis oacute -140
+KPX Ydieresis ocircumflex -140
+KPX Ydieresis odieresis -140
+KPX Ydieresis ograve -140
+KPX Ydieresis ohungarumlaut -140
+KPX Ydieresis omacron -140
+KPX Ydieresis oslash -140
+KPX Ydieresis otilde -140
+KPX Ydieresis period -140
+KPX Ydieresis semicolon -60
+KPX Ydieresis u -110
+KPX Ydieresis uacute -110
+KPX Ydieresis ucircumflex -110
+KPX Ydieresis udieresis -110
+KPX Ydieresis ugrave -110
+KPX Ydieresis uhungarumlaut -110
+KPX Ydieresis umacron -110
+KPX Ydieresis uogonek -110
+KPX Ydieresis uring -110
+KPX a v -20
+KPX a w -20
+KPX a y -30
+KPX a yacute -30
+KPX a ydieresis -30
+KPX aacute v -20
+KPX aacute w -20
+KPX aacute y -30
+KPX aacute yacute -30
+KPX aacute ydieresis -30
+KPX abreve v -20
+KPX abreve w -20
+KPX abreve y -30
+KPX abreve yacute -30
+KPX abreve ydieresis -30
+KPX acircumflex v -20
+KPX acircumflex w -20
+KPX acircumflex y -30
+KPX acircumflex yacute -30
+KPX acircumflex ydieresis -30
+KPX adieresis v -20
+KPX adieresis w -20
+KPX adieresis y -30
+KPX adieresis yacute -30
+KPX adieresis ydieresis -30
+KPX agrave v -20
+KPX agrave w -20
+KPX agrave y -30
+KPX agrave yacute -30
+KPX agrave ydieresis -30
+KPX amacron v -20
+KPX amacron w -20
+KPX amacron y -30
+KPX amacron yacute -30
+KPX amacron ydieresis -30
+KPX aogonek v -20
+KPX aogonek w -20
+KPX aogonek y -30
+KPX aogonek yacute -30
+KPX aogonek ydieresis -30
+KPX aring v -20
+KPX aring w -20
+KPX aring y -30
+KPX aring yacute -30
+KPX aring ydieresis -30
+KPX atilde v -20
+KPX atilde w -20
+KPX atilde y -30
+KPX atilde yacute -30
+KPX atilde ydieresis -30
+KPX b b -10
+KPX b comma -40
+KPX b l -20
+KPX b lacute -20
+KPX b lcommaaccent -20
+KPX b lslash -20
+KPX b period -40
+KPX b u -20
+KPX b uacute -20
+KPX b ucircumflex -20
+KPX b udieresis -20
+KPX b ugrave -20
+KPX b uhungarumlaut -20
+KPX b umacron -20
+KPX b uogonek -20
+KPX b uring -20
+KPX b v -20
+KPX b y -20
+KPX b yacute -20
+KPX b ydieresis -20
+KPX c comma -15
+KPX c k -20
+KPX c kcommaaccent -20
+KPX cacute comma -15
+KPX cacute k -20
+KPX cacute kcommaaccent -20
+KPX ccaron comma -15
+KPX ccaron k -20
+KPX ccaron kcommaaccent -20
+KPX ccedilla comma -15
+KPX ccedilla k -20
+KPX ccedilla kcommaaccent -20
+KPX colon space -50
+KPX comma quotedblright -100
+KPX comma quoteright -100
+KPX e comma -15
+KPX e period -15
+KPX e v -30
+KPX e w -20
+KPX e x -30
+KPX e y -20
+KPX e yacute -20
+KPX e ydieresis -20
+KPX eacute comma -15
+KPX eacute period -15
+KPX eacute v -30
+KPX eacute w -20
+KPX eacute x -30
+KPX eacute y -20
+KPX eacute yacute -20
+KPX eacute ydieresis -20
+KPX ecaron comma -15
+KPX ecaron period -15
+KPX ecaron v -30
+KPX ecaron w -20
+KPX ecaron x -30
+KPX ecaron y -20
+KPX ecaron yacute -20
+KPX ecaron ydieresis -20
+KPX ecircumflex comma -15
+KPX ecircumflex period -15
+KPX ecircumflex v -30
+KPX ecircumflex w -20
+KPX ecircumflex x -30
+KPX ecircumflex y -20
+KPX ecircumflex yacute -20
+KPX ecircumflex ydieresis -20
+KPX edieresis comma -15
+KPX edieresis period -15
+KPX edieresis v -30
+KPX edieresis w -20
+KPX edieresis x -30
+KPX edieresis y -20
+KPX edieresis yacute -20
+KPX edieresis ydieresis -20
+KPX edotaccent comma -15
+KPX edotaccent period -15
+KPX edotaccent v -30
+KPX edotaccent w -20
+KPX edotaccent x -30
+KPX edotaccent y -20
+KPX edotaccent yacute -20
+KPX edotaccent ydieresis -20
+KPX egrave comma -15
+KPX egrave period -15
+KPX egrave v -30
+KPX egrave w -20
+KPX egrave x -30
+KPX egrave y -20
+KPX egrave yacute -20
+KPX egrave ydieresis -20
+KPX emacron comma -15
+KPX emacron period -15
+KPX emacron v -30
+KPX emacron w -20
+KPX emacron x -30
+KPX emacron y -20
+KPX emacron yacute -20
+KPX emacron ydieresis -20
+KPX eogonek comma -15
+KPX eogonek period -15
+KPX eogonek v -30
+KPX eogonek w -20
+KPX eogonek x -30
+KPX eogonek y -20
+KPX eogonek yacute -20
+KPX eogonek ydieresis -20
+KPX f a -30
+KPX f aacute -30
+KPX f abreve -30
+KPX f acircumflex -30
+KPX f adieresis -30
+KPX f agrave -30
+KPX f amacron -30
+KPX f aogonek -30
+KPX f aring -30
+KPX f atilde -30
+KPX f comma -30
+KPX f dotlessi -28
+KPX f e -30
+KPX f eacute -30
+KPX f ecaron -30
+KPX f ecircumflex -30
+KPX f edieresis -30
+KPX f edotaccent -30
+KPX f egrave -30
+KPX f emacron -30
+KPX f eogonek -30
+KPX f o -30
+KPX f oacute -30
+KPX f ocircumflex -30
+KPX f odieresis -30
+KPX f ograve -30
+KPX f ohungarumlaut -30
+KPX f omacron -30
+KPX f oslash -30
+KPX f otilde -30
+KPX f period -30
+KPX f quotedblright 60
+KPX f quoteright 50
+KPX g r -10
+KPX g racute -10
+KPX g rcaron -10
+KPX g rcommaaccent -10
+KPX gbreve r -10
+KPX gbreve racute -10
+KPX gbreve rcaron -10
+KPX gbreve rcommaaccent -10
+KPX gcommaaccent r -10
+KPX gcommaaccent racute -10
+KPX gcommaaccent rcaron -10
+KPX gcommaaccent rcommaaccent -10
+KPX h y -30
+KPX h yacute -30
+KPX h ydieresis -30
+KPX k e -20
+KPX k eacute -20
+KPX k ecaron -20
+KPX k ecircumflex -20
+KPX k edieresis -20
+KPX k edotaccent -20
+KPX k egrave -20
+KPX k emacron -20
+KPX k eogonek -20
+KPX k o -20
+KPX k oacute -20
+KPX k ocircumflex -20
+KPX k odieresis -20
+KPX k ograve -20
+KPX k ohungarumlaut -20
+KPX k omacron -20
+KPX k oslash -20
+KPX k otilde -20
+KPX kcommaaccent e -20
+KPX kcommaaccent eacute -20
+KPX kcommaaccent ecaron -20
+KPX kcommaaccent ecircumflex -20
+KPX kcommaaccent edieresis -20
+KPX kcommaaccent edotaccent -20
+KPX kcommaaccent egrave -20
+KPX kcommaaccent emacron -20
+KPX kcommaaccent eogonek -20
+KPX kcommaaccent o -20
+KPX kcommaaccent oacute -20
+KPX kcommaaccent ocircumflex -20
+KPX kcommaaccent odieresis -20
+KPX kcommaaccent ograve -20
+KPX kcommaaccent ohungarumlaut -20
+KPX kcommaaccent omacron -20
+KPX kcommaaccent oslash -20
+KPX kcommaaccent otilde -20
+KPX m u -10
+KPX m uacute -10
+KPX m ucircumflex -10
+KPX m udieresis -10
+KPX m ugrave -10
+KPX m uhungarumlaut -10
+KPX m umacron -10
+KPX m uogonek -10
+KPX m uring -10
+KPX m y -15
+KPX m yacute -15
+KPX m ydieresis -15
+KPX n u -10
+KPX n uacute -10
+KPX n ucircumflex -10
+KPX n udieresis -10
+KPX n ugrave -10
+KPX n uhungarumlaut -10
+KPX n umacron -10
+KPX n uogonek -10
+KPX n uring -10
+KPX n v -20
+KPX n y -15
+KPX n yacute -15
+KPX n ydieresis -15
+KPX nacute u -10
+KPX nacute uacute -10
+KPX nacute ucircumflex -10
+KPX nacute udieresis -10
+KPX nacute ugrave -10
+KPX nacute uhungarumlaut -10
+KPX nacute umacron -10
+KPX nacute uogonek -10
+KPX nacute uring -10
+KPX nacute v -20
+KPX nacute y -15
+KPX nacute yacute -15
+KPX nacute ydieresis -15
+KPX ncaron u -10
+KPX ncaron uacute -10
+KPX ncaron ucircumflex -10
+KPX ncaron udieresis -10
+KPX ncaron ugrave -10
+KPX ncaron uhungarumlaut -10
+KPX ncaron umacron -10
+KPX ncaron uogonek -10
+KPX ncaron uring -10
+KPX ncaron v -20
+KPX ncaron y -15
+KPX ncaron yacute -15
+KPX ncaron ydieresis -15
+KPX ncommaaccent u -10
+KPX ncommaaccent uacute -10
+KPX ncommaaccent ucircumflex -10
+KPX ncommaaccent udieresis -10
+KPX ncommaaccent ugrave -10
+KPX ncommaaccent uhungarumlaut -10
+KPX ncommaaccent umacron -10
+KPX ncommaaccent uogonek -10
+KPX ncommaaccent uring -10
+KPX ncommaaccent v -20
+KPX ncommaaccent y -15
+KPX ncommaaccent yacute -15
+KPX ncommaaccent ydieresis -15
+KPX ntilde u -10
+KPX ntilde uacute -10
+KPX ntilde ucircumflex -10
+KPX ntilde udieresis -10
+KPX ntilde ugrave -10
+KPX ntilde uhungarumlaut -10
+KPX ntilde umacron -10
+KPX ntilde uogonek -10
+KPX ntilde uring -10
+KPX ntilde v -20
+KPX ntilde y -15
+KPX ntilde yacute -15
+KPX ntilde ydieresis -15
+KPX o comma -40
+KPX o period -40
+KPX o v -15
+KPX o w -15
+KPX o x -30
+KPX o y -30
+KPX o yacute -30
+KPX o ydieresis -30
+KPX oacute comma -40
+KPX oacute period -40
+KPX oacute v -15
+KPX oacute w -15
+KPX oacute x -30
+KPX oacute y -30
+KPX oacute yacute -30
+KPX oacute ydieresis -30
+KPX ocircumflex comma -40
+KPX ocircumflex period -40
+KPX ocircumflex v -15
+KPX ocircumflex w -15
+KPX ocircumflex x -30
+KPX ocircumflex y -30
+KPX ocircumflex yacute -30
+KPX ocircumflex ydieresis -30
+KPX odieresis comma -40
+KPX odieresis period -40
+KPX odieresis v -15
+KPX odieresis w -15
+KPX odieresis x -30
+KPX odieresis y -30
+KPX odieresis yacute -30
+KPX odieresis ydieresis -30
+KPX ograve comma -40
+KPX ograve period -40
+KPX ograve v -15
+KPX ograve w -15
+KPX ograve x -30
+KPX ograve y -30
+KPX ograve yacute -30
+KPX ograve ydieresis -30
+KPX ohungarumlaut comma -40
+KPX ohungarumlaut period -40
+KPX ohungarumlaut v -15
+KPX ohungarumlaut w -15
+KPX ohungarumlaut x -30
+KPX ohungarumlaut y -30
+KPX ohungarumlaut yacute -30
+KPX ohungarumlaut ydieresis -30
+KPX omacron comma -40
+KPX omacron period -40
+KPX omacron v -15
+KPX omacron w -15
+KPX omacron x -30
+KPX omacron y -30
+KPX omacron yacute -30
+KPX omacron ydieresis -30
+KPX oslash a -55
+KPX oslash aacute -55
+KPX oslash abreve -55
+KPX oslash acircumflex -55
+KPX oslash adieresis -55
+KPX oslash agrave -55
+KPX oslash amacron -55
+KPX oslash aogonek -55
+KPX oslash aring -55
+KPX oslash atilde -55
+KPX oslash b -55
+KPX oslash c -55
+KPX oslash cacute -55
+KPX oslash ccaron -55
+KPX oslash ccedilla -55
+KPX oslash comma -95
+KPX oslash d -55
+KPX oslash dcroat -55
+KPX oslash e -55
+KPX oslash eacute -55
+KPX oslash ecaron -55
+KPX oslash ecircumflex -55
+KPX oslash edieresis -55
+KPX oslash edotaccent -55
+KPX oslash egrave -55
+KPX oslash emacron -55
+KPX oslash eogonek -55
+KPX oslash f -55
+KPX oslash g -55
+KPX oslash gbreve -55
+KPX oslash gcommaaccent -55
+KPX oslash h -55
+KPX oslash i -55
+KPX oslash iacute -55
+KPX oslash icircumflex -55
+KPX oslash idieresis -55
+KPX oslash igrave -55
+KPX oslash imacron -55
+KPX oslash iogonek -55
+KPX oslash j -55
+KPX oslash k -55
+KPX oslash kcommaaccent -55
+KPX oslash l -55
+KPX oslash lacute -55
+KPX oslash lcommaaccent -55
+KPX oslash lslash -55
+KPX oslash m -55
+KPX oslash n -55
+KPX oslash nacute -55
+KPX oslash ncaron -55
+KPX oslash ncommaaccent -55
+KPX oslash ntilde -55
+KPX oslash o -55
+KPX oslash oacute -55
+KPX oslash ocircumflex -55
+KPX oslash odieresis -55
+KPX oslash ograve -55
+KPX oslash ohungarumlaut -55
+KPX oslash omacron -55
+KPX oslash oslash -55
+KPX oslash otilde -55
+KPX oslash p -55
+KPX oslash period -95
+KPX oslash q -55
+KPX oslash r -55
+KPX oslash racute -55
+KPX oslash rcaron -55
+KPX oslash rcommaaccent -55
+KPX oslash s -55
+KPX oslash sacute -55
+KPX oslash scaron -55
+KPX oslash scedilla -55
+KPX oslash scommaaccent -55
+KPX oslash t -55
+KPX oslash tcommaaccent -55
+KPX oslash u -55
+KPX oslash uacute -55
+KPX oslash ucircumflex -55
+KPX oslash udieresis -55
+KPX oslash ugrave -55
+KPX oslash uhungarumlaut -55
+KPX oslash umacron -55
+KPX oslash uogonek -55
+KPX oslash uring -55
+KPX oslash v -70
+KPX oslash w -70
+KPX oslash x -85
+KPX oslash y -70
+KPX oslash yacute -70
+KPX oslash ydieresis -70
+KPX oslash z -55
+KPX oslash zacute -55
+KPX oslash zcaron -55
+KPX oslash zdotaccent -55
+KPX otilde comma -40
+KPX otilde period -40
+KPX otilde v -15
+KPX otilde w -15
+KPX otilde x -30
+KPX otilde y -30
+KPX otilde yacute -30
+KPX otilde ydieresis -30
+KPX p comma -35
+KPX p period -35
+KPX p y -30
+KPX p yacute -30
+KPX p ydieresis -30
+KPX period quotedblright -100
+KPX period quoteright -100
+KPX period space -60
+KPX quotedblright space -40
+KPX quoteleft quoteleft -57
+KPX quoteright d -50
+KPX quoteright dcroat -50
+KPX quoteright quoteright -57
+KPX quoteright r -50
+KPX quoteright racute -50
+KPX quoteright rcaron -50
+KPX quoteright rcommaaccent -50
+KPX quoteright s -50
+KPX quoteright sacute -50
+KPX quoteright scaron -50
+KPX quoteright scedilla -50
+KPX quoteright scommaaccent -50
+KPX quoteright space -70
+KPX r a -10
+KPX r aacute -10
+KPX r abreve -10
+KPX r acircumflex -10
+KPX r adieresis -10
+KPX r agrave -10
+KPX r amacron -10
+KPX r aogonek -10
+KPX r aring -10
+KPX r atilde -10
+KPX r colon 30
+KPX r comma -50
+KPX r i 15
+KPX r iacute 15
+KPX r icircumflex 15
+KPX r idieresis 15
+KPX r igrave 15
+KPX r imacron 15
+KPX r iogonek 15
+KPX r k 15
+KPX r kcommaaccent 15
+KPX r l 15
+KPX r lacute 15
+KPX r lcommaaccent 15
+KPX r lslash 15
+KPX r m 25
+KPX r n 25
+KPX r nacute 25
+KPX r ncaron 25
+KPX r ncommaaccent 25
+KPX r ntilde 25
+KPX r p 30
+KPX r period -50
+KPX r semicolon 30
+KPX r t 40
+KPX r tcommaaccent 40
+KPX r u 15
+KPX r uacute 15
+KPX r ucircumflex 15
+KPX r udieresis 15
+KPX r ugrave 15
+KPX r uhungarumlaut 15
+KPX r umacron 15
+KPX r uogonek 15
+KPX r uring 15
+KPX r v 30
+KPX r y 30
+KPX r yacute 30
+KPX r ydieresis 30
+KPX racute a -10
+KPX racute aacute -10
+KPX racute abreve -10
+KPX racute acircumflex -10
+KPX racute adieresis -10
+KPX racute agrave -10
+KPX racute amacron -10
+KPX racute aogonek -10
+KPX racute aring -10
+KPX racute atilde -10
+KPX racute colon 30
+KPX racute comma -50
+KPX racute i 15
+KPX racute iacute 15
+KPX racute icircumflex 15
+KPX racute idieresis 15
+KPX racute igrave 15
+KPX racute imacron 15
+KPX racute iogonek 15
+KPX racute k 15
+KPX racute kcommaaccent 15
+KPX racute l 15
+KPX racute lacute 15
+KPX racute lcommaaccent 15
+KPX racute lslash 15
+KPX racute m 25
+KPX racute n 25
+KPX racute nacute 25
+KPX racute ncaron 25
+KPX racute ncommaaccent 25
+KPX racute ntilde 25
+KPX racute p 30
+KPX racute period -50
+KPX racute semicolon 30
+KPX racute t 40
+KPX racute tcommaaccent 40
+KPX racute u 15
+KPX racute uacute 15
+KPX racute ucircumflex 15
+KPX racute udieresis 15
+KPX racute ugrave 15
+KPX racute uhungarumlaut 15
+KPX racute umacron 15
+KPX racute uogonek 15
+KPX racute uring 15
+KPX racute v 30
+KPX racute y 30
+KPX racute yacute 30
+KPX racute ydieresis 30
+KPX rcaron a -10
+KPX rcaron aacute -10
+KPX rcaron abreve -10
+KPX rcaron acircumflex -10
+KPX rcaron adieresis -10
+KPX rcaron agrave -10
+KPX rcaron amacron -10
+KPX rcaron aogonek -10
+KPX rcaron aring -10
+KPX rcaron atilde -10
+KPX rcaron colon 30
+KPX rcaron comma -50
+KPX rcaron i 15
+KPX rcaron iacute 15
+KPX rcaron icircumflex 15
+KPX rcaron idieresis 15
+KPX rcaron igrave 15
+KPX rcaron imacron 15
+KPX rcaron iogonek 15
+KPX rcaron k 15
+KPX rcaron kcommaaccent 15
+KPX rcaron l 15
+KPX rcaron lacute 15
+KPX rcaron lcommaaccent 15
+KPX rcaron lslash 15
+KPX rcaron m 25
+KPX rcaron n 25
+KPX rcaron nacute 25
+KPX rcaron ncaron 25
+KPX rcaron ncommaaccent 25
+KPX rcaron ntilde 25
+KPX rcaron p 30
+KPX rcaron period -50
+KPX rcaron semicolon 30
+KPX rcaron t 40
+KPX rcaron tcommaaccent 40
+KPX rcaron u 15
+KPX rcaron uacute 15
+KPX rcaron ucircumflex 15
+KPX rcaron udieresis 15
+KPX rcaron ugrave 15
+KPX rcaron uhungarumlaut 15
+KPX rcaron umacron 15
+KPX rcaron uogonek 15
+KPX rcaron uring 15
+KPX rcaron v 30
+KPX rcaron y 30
+KPX rcaron yacute 30
+KPX rcaron ydieresis 30
+KPX rcommaaccent a -10
+KPX rcommaaccent aacute -10
+KPX rcommaaccent abreve -10
+KPX rcommaaccent acircumflex -10
+KPX rcommaaccent adieresis -10
+KPX rcommaaccent agrave -10
+KPX rcommaaccent amacron -10
+KPX rcommaaccent aogonek -10
+KPX rcommaaccent aring -10
+KPX rcommaaccent atilde -10
+KPX rcommaaccent colon 30
+KPX rcommaaccent comma -50
+KPX rcommaaccent i 15
+KPX rcommaaccent iacute 15
+KPX rcommaaccent icircumflex 15
+KPX rcommaaccent idieresis 15
+KPX rcommaaccent igrave 15
+KPX rcommaaccent imacron 15
+KPX rcommaaccent iogonek 15
+KPX rcommaaccent k 15
+KPX rcommaaccent kcommaaccent 15
+KPX rcommaaccent l 15
+KPX rcommaaccent lacute 15
+KPX rcommaaccent lcommaaccent 15
+KPX rcommaaccent lslash 15
+KPX rcommaaccent m 25
+KPX rcommaaccent n 25
+KPX rcommaaccent nacute 25
+KPX rcommaaccent ncaron 25
+KPX rcommaaccent ncommaaccent 25
+KPX rcommaaccent ntilde 25
+KPX rcommaaccent p 30
+KPX rcommaaccent period -50
+KPX rcommaaccent semicolon 30
+KPX rcommaaccent t 40
+KPX rcommaaccent tcommaaccent 40
+KPX rcommaaccent u 15
+KPX rcommaaccent uacute 15
+KPX rcommaaccent ucircumflex 15
+KPX rcommaaccent udieresis 15
+KPX rcommaaccent ugrave 15
+KPX rcommaaccent uhungarumlaut 15
+KPX rcommaaccent umacron 15
+KPX rcommaaccent uogonek 15
+KPX rcommaaccent uring 15
+KPX rcommaaccent v 30
+KPX rcommaaccent y 30
+KPX rcommaaccent yacute 30
+KPX rcommaaccent ydieresis 30
+KPX s comma -15
+KPX s period -15
+KPX s w -30
+KPX sacute comma -15
+KPX sacute period -15
+KPX sacute w -30
+KPX scaron comma -15
+KPX scaron period -15
+KPX scaron w -30
+KPX scedilla comma -15
+KPX scedilla period -15
+KPX scedilla w -30
+KPX scommaaccent comma -15
+KPX scommaaccent period -15
+KPX scommaaccent w -30
+KPX semicolon space -50
+KPX space T -50
+KPX space Tcaron -50
+KPX space Tcommaaccent -50
+KPX space V -50
+KPX space W -40
+KPX space Y -90
+KPX space Yacute -90
+KPX space Ydieresis -90
+KPX space quotedblleft -30
+KPX space quoteleft -60
+KPX v a -25
+KPX v aacute -25
+KPX v abreve -25
+KPX v acircumflex -25
+KPX v adieresis -25
+KPX v agrave -25
+KPX v amacron -25
+KPX v aogonek -25
+KPX v aring -25
+KPX v atilde -25
+KPX v comma -80
+KPX v e -25
+KPX v eacute -25
+KPX v ecaron -25
+KPX v ecircumflex -25
+KPX v edieresis -25
+KPX v edotaccent -25
+KPX v egrave -25
+KPX v emacron -25
+KPX v eogonek -25
+KPX v o -25
+KPX v oacute -25
+KPX v ocircumflex -25
+KPX v odieresis -25
+KPX v ograve -25
+KPX v ohungarumlaut -25
+KPX v omacron -25
+KPX v oslash -25
+KPX v otilde -25
+KPX v period -80
+KPX w a -15
+KPX w aacute -15
+KPX w abreve -15
+KPX w acircumflex -15
+KPX w adieresis -15
+KPX w agrave -15
+KPX w amacron -15
+KPX w aogonek -15
+KPX w aring -15
+KPX w atilde -15
+KPX w comma -60
+KPX w e -10
+KPX w eacute -10
+KPX w ecaron -10
+KPX w ecircumflex -10
+KPX w edieresis -10
+KPX w edotaccent -10
+KPX w egrave -10
+KPX w emacron -10
+KPX w eogonek -10
+KPX w o -10
+KPX w oacute -10
+KPX w ocircumflex -10
+KPX w odieresis -10
+KPX w ograve -10
+KPX w ohungarumlaut -10
+KPX w omacron -10
+KPX w oslash -10
+KPX w otilde -10
+KPX w period -60
+KPX x e -30
+KPX x eacute -30
+KPX x ecaron -30
+KPX x ecircumflex -30
+KPX x edieresis -30
+KPX x edotaccent -30
+KPX x egrave -30
+KPX x emacron -30
+KPX x eogonek -30
+KPX y a -20
+KPX y aacute -20
+KPX y abreve -20
+KPX y acircumflex -20
+KPX y adieresis -20
+KPX y agrave -20
+KPX y amacron -20
+KPX y aogonek -20
+KPX y aring -20
+KPX y atilde -20
+KPX y comma -100
+KPX y e -20
+KPX y eacute -20
+KPX y ecaron -20
+KPX y ecircumflex -20
+KPX y edieresis -20
+KPX y edotaccent -20
+KPX y egrave -20
+KPX y emacron -20
+KPX y eogonek -20
+KPX y o -20
+KPX y oacute -20
+KPX y ocircumflex -20
+KPX y odieresis -20
+KPX y ograve -20
+KPX y ohungarumlaut -20
+KPX y omacron -20
+KPX y oslash -20
+KPX y otilde -20
+KPX y period -100
+KPX yacute a -20
+KPX yacute aacute -20
+KPX yacute abreve -20
+KPX yacute acircumflex -20
+KPX yacute adieresis -20
+KPX yacute agrave -20
+KPX yacute amacron -20
+KPX yacute aogonek -20
+KPX yacute aring -20
+KPX yacute atilde -20
+KPX yacute comma -100
+KPX yacute e -20
+KPX yacute eacute -20
+KPX yacute ecaron -20
+KPX yacute ecircumflex -20
+KPX yacute edieresis -20
+KPX yacute edotaccent -20
+KPX yacute egrave -20
+KPX yacute emacron -20
+KPX yacute eogonek -20
+KPX yacute o -20
+KPX yacute oacute -20
+KPX yacute ocircumflex -20
+KPX yacute odieresis -20
+KPX yacute ograve -20
+KPX yacute ohungarumlaut -20
+KPX yacute omacron -20
+KPX yacute oslash -20
+KPX yacute otilde -20
+KPX yacute period -100
+KPX ydieresis a -20
+KPX ydieresis aacute -20
+KPX ydieresis abreve -20
+KPX ydieresis acircumflex -20
+KPX ydieresis adieresis -20
+KPX ydieresis agrave -20
+KPX ydieresis amacron -20
+KPX ydieresis aogonek -20
+KPX ydieresis aring -20
+KPX ydieresis atilde -20
+KPX ydieresis comma -100
+KPX ydieresis e -20
+KPX ydieresis eacute -20
+KPX ydieresis ecaron -20
+KPX ydieresis ecircumflex -20
+KPX ydieresis edieresis -20
+KPX ydieresis edotaccent -20
+KPX ydieresis egrave -20
+KPX ydieresis emacron -20
+KPX ydieresis eogonek -20
+KPX ydieresis o -20
+KPX ydieresis oacute -20
+KPX ydieresis ocircumflex -20
+KPX ydieresis odieresis -20
+KPX ydieresis ograve -20
+KPX ydieresis ohungarumlaut -20
+KPX ydieresis omacron -20
+KPX ydieresis oslash -20
+KPX ydieresis otilde -20
+KPX ydieresis period -100
+KPX z e -15
+KPX z eacute -15
+KPX z ecaron -15
+KPX z ecircumflex -15
+KPX z edieresis -15
+KPX z edotaccent -15
+KPX z egrave -15
+KPX z emacron -15
+KPX z eogonek -15
+KPX z o -15
+KPX z oacute -15
+KPX z ocircumflex -15
+KPX z odieresis -15
+KPX z ograve -15
+KPX z ohungarumlaut -15
+KPX z omacron -15
+KPX z oslash -15
+KPX z otilde -15
+KPX zacute e -15
+KPX zacute eacute -15
+KPX zacute ecaron -15
+KPX zacute ecircumflex -15
+KPX zacute edieresis -15
+KPX zacute edotaccent -15
+KPX zacute egrave -15
+KPX zacute emacron -15
+KPX zacute eogonek -15
+KPX zacute o -15
+KPX zacute oacute -15
+KPX zacute ocircumflex -15
+KPX zacute odieresis -15
+KPX zacute ograve -15
+KPX zacute ohungarumlaut -15
+KPX zacute omacron -15
+KPX zacute oslash -15
+KPX zacute otilde -15
+KPX zcaron e -15
+KPX zcaron eacute -15
+KPX zcaron ecaron -15
+KPX zcaron ecircumflex -15
+KPX zcaron edieresis -15
+KPX zcaron edotaccent -15
+KPX zcaron egrave -15
+KPX zcaron emacron -15
+KPX zcaron eogonek -15
+KPX zcaron o -15
+KPX zcaron oacute -15
+KPX zcaron ocircumflex -15
+KPX zcaron odieresis -15
+KPX zcaron ograve -15
+KPX zcaron ohungarumlaut -15
+KPX zcaron omacron -15
+KPX zcaron oslash -15
+KPX zcaron otilde -15
+KPX zdotaccent e -15
+KPX zdotaccent eacute -15
+KPX zdotaccent ecaron -15
+KPX zdotaccent ecircumflex -15
+KPX zdotaccent edieresis -15
+KPX zdotaccent edotaccent -15
+KPX zdotaccent egrave -15
+KPX zdotaccent emacron -15
+KPX zdotaccent eogonek -15
+KPX zdotaccent o -15
+KPX zdotaccent oacute -15
+KPX zdotaccent ocircumflex -15
+KPX zdotaccent odieresis -15
+KPX zdotaccent ograve -15
+KPX zdotaccent ohungarumlaut -15
+KPX zdotaccent omacron -15
+KPX zdotaccent oslash -15
+KPX zdotaccent otilde -15
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica.afm
new file mode 100644
index 0000000000000000000000000000000000000000..bd32af54dec5563db4033ed2c8bb4a26f1eaeecf
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica.afm
@@ -0,0 +1,3051 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 12:38:23 1997
+Comment UniqueID 43054
+Comment VMusage 37069 48094
+FontName Helvetica
+FullName Helvetica
+FamilyName Helvetica
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+CharacterSet ExtendedRoman
+FontBBox -166 -225 1000 931
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All Rights Reserved.Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 718
+XHeight 523
+Ascender 718
+Descender -207
+StdHW 76
+StdVW 88
+StartCharMetrics 315
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 278 ; N exclam ; B 90 0 187 718 ;
+C 34 ; WX 355 ; N quotedbl ; B 70 463 285 718 ;
+C 35 ; WX 556 ; N numbersign ; B 28 0 529 688 ;
+C 36 ; WX 556 ; N dollar ; B 32 -115 520 775 ;
+C 37 ; WX 889 ; N percent ; B 39 -19 850 703 ;
+C 38 ; WX 667 ; N ampersand ; B 44 -15 645 718 ;
+C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ;
+C 40 ; WX 333 ; N parenleft ; B 68 -207 299 733 ;
+C 41 ; WX 333 ; N parenright ; B 34 -207 265 733 ;
+C 42 ; WX 389 ; N asterisk ; B 39 431 349 718 ;
+C 43 ; WX 584 ; N plus ; B 39 0 545 505 ;
+C 44 ; WX 278 ; N comma ; B 87 -147 191 106 ;
+C 45 ; WX 333 ; N hyphen ; B 44 232 289 322 ;
+C 46 ; WX 278 ; N period ; B 87 0 191 106 ;
+C 47 ; WX 278 ; N slash ; B -17 -19 295 737 ;
+C 48 ; WX 556 ; N zero ; B 37 -19 519 703 ;
+C 49 ; WX 556 ; N one ; B 101 0 359 703 ;
+C 50 ; WX 556 ; N two ; B 26 0 507 703 ;
+C 51 ; WX 556 ; N three ; B 34 -19 522 703 ;
+C 52 ; WX 556 ; N four ; B 25 0 523 703 ;
+C 53 ; WX 556 ; N five ; B 32 -19 514 688 ;
+C 54 ; WX 556 ; N six ; B 38 -19 518 703 ;
+C 55 ; WX 556 ; N seven ; B 37 0 523 688 ;
+C 56 ; WX 556 ; N eight ; B 38 -19 517 703 ;
+C 57 ; WX 556 ; N nine ; B 42 -19 514 703 ;
+C 58 ; WX 278 ; N colon ; B 87 0 191 516 ;
+C 59 ; WX 278 ; N semicolon ; B 87 -147 191 516 ;
+C 60 ; WX 584 ; N less ; B 48 11 536 495 ;
+C 61 ; WX 584 ; N equal ; B 39 115 545 390 ;
+C 62 ; WX 584 ; N greater ; B 48 11 536 495 ;
+C 63 ; WX 556 ; N question ; B 56 0 492 727 ;
+C 64 ; WX 1015 ; N at ; B 147 -19 868 737 ;
+C 65 ; WX 667 ; N A ; B 14 0 654 718 ;
+C 66 ; WX 667 ; N B ; B 74 0 627 718 ;
+C 67 ; WX 722 ; N C ; B 44 -19 681 737 ;
+C 68 ; WX 722 ; N D ; B 81 0 674 718 ;
+C 69 ; WX 667 ; N E ; B 86 0 616 718 ;
+C 70 ; WX 611 ; N F ; B 86 0 583 718 ;
+C 71 ; WX 778 ; N G ; B 48 -19 704 737 ;
+C 72 ; WX 722 ; N H ; B 77 0 646 718 ;
+C 73 ; WX 278 ; N I ; B 91 0 188 718 ;
+C 74 ; WX 500 ; N J ; B 17 -19 428 718 ;
+C 75 ; WX 667 ; N K ; B 76 0 663 718 ;
+C 76 ; WX 556 ; N L ; B 76 0 537 718 ;
+C 77 ; WX 833 ; N M ; B 73 0 761 718 ;
+C 78 ; WX 722 ; N N ; B 76 0 646 718 ;
+C 79 ; WX 778 ; N O ; B 39 -19 739 737 ;
+C 80 ; WX 667 ; N P ; B 86 0 622 718 ;
+C 81 ; WX 778 ; N Q ; B 39 -56 739 737 ;
+C 82 ; WX 722 ; N R ; B 88 0 684 718 ;
+C 83 ; WX 667 ; N S ; B 49 -19 620 737 ;
+C 84 ; WX 611 ; N T ; B 14 0 597 718 ;
+C 85 ; WX 722 ; N U ; B 79 -19 644 718 ;
+C 86 ; WX 667 ; N V ; B 20 0 647 718 ;
+C 87 ; WX 944 ; N W ; B 16 0 928 718 ;
+C 88 ; WX 667 ; N X ; B 19 0 648 718 ;
+C 89 ; WX 667 ; N Y ; B 14 0 653 718 ;
+C 90 ; WX 611 ; N Z ; B 23 0 588 718 ;
+C 91 ; WX 278 ; N bracketleft ; B 63 -196 250 722 ;
+C 92 ; WX 278 ; N backslash ; B -17 -19 295 737 ;
+C 93 ; WX 278 ; N bracketright ; B 28 -196 215 722 ;
+C 94 ; WX 469 ; N asciicircum ; B -14 264 483 688 ;
+C 95 ; WX 556 ; N underscore ; B 0 -125 556 -75 ;
+C 96 ; WX 222 ; N quoteleft ; B 65 470 169 725 ;
+C 97 ; WX 556 ; N a ; B 36 -15 530 538 ;
+C 98 ; WX 556 ; N b ; B 58 -15 517 718 ;
+C 99 ; WX 500 ; N c ; B 30 -15 477 538 ;
+C 100 ; WX 556 ; N d ; B 35 -15 499 718 ;
+C 101 ; WX 556 ; N e ; B 40 -15 516 538 ;
+C 102 ; WX 278 ; N f ; B 14 0 262 728 ; L i fi ; L l fl ;
+C 103 ; WX 556 ; N g ; B 40 -220 499 538 ;
+C 104 ; WX 556 ; N h ; B 65 0 491 718 ;
+C 105 ; WX 222 ; N i ; B 67 0 155 718 ;
+C 106 ; WX 222 ; N j ; B -16 -210 155 718 ;
+C 107 ; WX 500 ; N k ; B 67 0 501 718 ;
+C 108 ; WX 222 ; N l ; B 67 0 155 718 ;
+C 109 ; WX 833 ; N m ; B 65 0 769 538 ;
+C 110 ; WX 556 ; N n ; B 65 0 491 538 ;
+C 111 ; WX 556 ; N o ; B 35 -14 521 538 ;
+C 112 ; WX 556 ; N p ; B 58 -207 517 538 ;
+C 113 ; WX 556 ; N q ; B 35 -207 494 538 ;
+C 114 ; WX 333 ; N r ; B 77 0 332 538 ;
+C 115 ; WX 500 ; N s ; B 32 -15 464 538 ;
+C 116 ; WX 278 ; N t ; B 14 -7 257 669 ;
+C 117 ; WX 556 ; N u ; B 68 -15 489 523 ;
+C 118 ; WX 500 ; N v ; B 8 0 492 523 ;
+C 119 ; WX 722 ; N w ; B 14 0 709 523 ;
+C 120 ; WX 500 ; N x ; B 11 0 490 523 ;
+C 121 ; WX 500 ; N y ; B 11 -214 489 523 ;
+C 122 ; WX 500 ; N z ; B 31 0 469 523 ;
+C 123 ; WX 334 ; N braceleft ; B 42 -196 292 722 ;
+C 124 ; WX 260 ; N bar ; B 94 -225 167 775 ;
+C 125 ; WX 334 ; N braceright ; B 42 -196 292 722 ;
+C 126 ; WX 584 ; N asciitilde ; B 61 180 523 326 ;
+C 161 ; WX 333 ; N exclamdown ; B 118 -195 215 523 ;
+C 162 ; WX 556 ; N cent ; B 51 -115 513 623 ;
+C 163 ; WX 556 ; N sterling ; B 33 -16 539 718 ;
+C 164 ; WX 167 ; N fraction ; B -166 -19 333 703 ;
+C 165 ; WX 556 ; N yen ; B 3 0 553 688 ;
+C 166 ; WX 556 ; N florin ; B -11 -207 501 737 ;
+C 167 ; WX 556 ; N section ; B 43 -191 512 737 ;
+C 168 ; WX 556 ; N currency ; B 28 99 528 603 ;
+C 169 ; WX 191 ; N quotesingle ; B 59 463 132 718 ;
+C 170 ; WX 333 ; N quotedblleft ; B 38 470 307 725 ;
+C 171 ; WX 556 ; N guillemotleft ; B 97 108 459 446 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 88 108 245 446 ;
+C 173 ; WX 333 ; N guilsinglright ; B 88 108 245 446 ;
+C 174 ; WX 500 ; N fi ; B 14 0 434 728 ;
+C 175 ; WX 500 ; N fl ; B 14 0 432 728 ;
+C 177 ; WX 556 ; N endash ; B 0 240 556 313 ;
+C 178 ; WX 556 ; N dagger ; B 43 -159 514 718 ;
+C 179 ; WX 556 ; N daggerdbl ; B 43 -159 514 718 ;
+C 180 ; WX 278 ; N periodcentered ; B 77 190 202 315 ;
+C 182 ; WX 537 ; N paragraph ; B 18 -173 497 718 ;
+C 183 ; WX 350 ; N bullet ; B 18 202 333 517 ;
+C 184 ; WX 222 ; N quotesinglbase ; B 53 -149 157 106 ;
+C 185 ; WX 333 ; N quotedblbase ; B 26 -149 295 106 ;
+C 186 ; WX 333 ; N quotedblright ; B 26 463 295 718 ;
+C 187 ; WX 556 ; N guillemotright ; B 97 108 459 446 ;
+C 188 ; WX 1000 ; N ellipsis ; B 115 0 885 106 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -19 994 703 ;
+C 191 ; WX 611 ; N questiondown ; B 91 -201 527 525 ;
+C 193 ; WX 333 ; N grave ; B 14 593 211 734 ;
+C 194 ; WX 333 ; N acute ; B 122 593 319 734 ;
+C 195 ; WX 333 ; N circumflex ; B 21 593 312 734 ;
+C 196 ; WX 333 ; N tilde ; B -4 606 337 722 ;
+C 197 ; WX 333 ; N macron ; B 10 627 323 684 ;
+C 198 ; WX 333 ; N breve ; B 13 595 321 731 ;
+C 199 ; WX 333 ; N dotaccent ; B 121 604 212 706 ;
+C 200 ; WX 333 ; N dieresis ; B 40 604 293 706 ;
+C 202 ; WX 333 ; N ring ; B 75 572 259 756 ;
+C 203 ; WX 333 ; N cedilla ; B 45 -225 259 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 31 593 409 734 ;
+C 206 ; WX 333 ; N ogonek ; B 73 -225 287 0 ;
+C 207 ; WX 333 ; N caron ; B 21 593 312 734 ;
+C 208 ; WX 1000 ; N emdash ; B 0 240 1000 313 ;
+C 225 ; WX 1000 ; N AE ; B 8 0 951 718 ;
+C 227 ; WX 370 ; N ordfeminine ; B 24 405 346 737 ;
+C 232 ; WX 556 ; N Lslash ; B -20 0 537 718 ;
+C 233 ; WX 778 ; N Oslash ; B 39 -19 740 737 ;
+C 234 ; WX 1000 ; N OE ; B 36 -19 965 737 ;
+C 235 ; WX 365 ; N ordmasculine ; B 25 405 341 737 ;
+C 241 ; WX 889 ; N ae ; B 36 -15 847 538 ;
+C 245 ; WX 278 ; N dotlessi ; B 95 0 183 523 ;
+C 248 ; WX 222 ; N lslash ; B -20 0 242 718 ;
+C 249 ; WX 611 ; N oslash ; B 28 -22 537 545 ;
+C 250 ; WX 944 ; N oe ; B 35 -15 902 538 ;
+C 251 ; WX 611 ; N germandbls ; B 67 -15 571 728 ;
+C -1 ; WX 278 ; N Idieresis ; B 13 0 266 901 ;
+C -1 ; WX 556 ; N eacute ; B 40 -15 516 734 ;
+C -1 ; WX 556 ; N abreve ; B 36 -15 530 731 ;
+C -1 ; WX 556 ; N uhungarumlaut ; B 68 -15 521 734 ;
+C -1 ; WX 556 ; N ecaron ; B 40 -15 516 734 ;
+C -1 ; WX 667 ; N Ydieresis ; B 14 0 653 901 ;
+C -1 ; WX 584 ; N divide ; B 39 -19 545 524 ;
+C -1 ; WX 667 ; N Yacute ; B 14 0 653 929 ;
+C -1 ; WX 667 ; N Acircumflex ; B 14 0 654 929 ;
+C -1 ; WX 556 ; N aacute ; B 36 -15 530 734 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 79 -19 644 929 ;
+C -1 ; WX 500 ; N yacute ; B 11 -214 489 734 ;
+C -1 ; WX 500 ; N scommaaccent ; B 32 -225 464 538 ;
+C -1 ; WX 556 ; N ecircumflex ; B 40 -15 516 734 ;
+C -1 ; WX 722 ; N Uring ; B 79 -19 644 931 ;
+C -1 ; WX 722 ; N Udieresis ; B 79 -19 644 901 ;
+C -1 ; WX 556 ; N aogonek ; B 36 -220 547 538 ;
+C -1 ; WX 722 ; N Uacute ; B 79 -19 644 929 ;
+C -1 ; WX 556 ; N uogonek ; B 68 -225 519 523 ;
+C -1 ; WX 667 ; N Edieresis ; B 86 0 616 901 ;
+C -1 ; WX 722 ; N Dcroat ; B 0 0 674 718 ;
+C -1 ; WX 250 ; N commaaccent ; B 87 -225 181 -40 ;
+C -1 ; WX 737 ; N copyright ; B -14 -19 752 737 ;
+C -1 ; WX 667 ; N Emacron ; B 86 0 616 879 ;
+C -1 ; WX 500 ; N ccaron ; B 30 -15 477 734 ;
+C -1 ; WX 556 ; N aring ; B 36 -15 530 756 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 76 -225 646 718 ;
+C -1 ; WX 222 ; N lacute ; B 67 0 264 929 ;
+C -1 ; WX 556 ; N agrave ; B 36 -15 530 734 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 14 -225 597 718 ;
+C -1 ; WX 722 ; N Cacute ; B 44 -19 681 929 ;
+C -1 ; WX 556 ; N atilde ; B 36 -15 530 722 ;
+C -1 ; WX 667 ; N Edotaccent ; B 86 0 616 901 ;
+C -1 ; WX 500 ; N scaron ; B 32 -15 464 734 ;
+C -1 ; WX 500 ; N scedilla ; B 32 -225 464 538 ;
+C -1 ; WX 278 ; N iacute ; B 95 0 292 734 ;
+C -1 ; WX 471 ; N lozenge ; B 10 0 462 728 ;
+C -1 ; WX 722 ; N Rcaron ; B 88 0 684 929 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 48 -225 704 737 ;
+C -1 ; WX 556 ; N ucircumflex ; B 68 -15 489 734 ;
+C -1 ; WX 556 ; N acircumflex ; B 36 -15 530 734 ;
+C -1 ; WX 667 ; N Amacron ; B 14 0 654 879 ;
+C -1 ; WX 333 ; N rcaron ; B 61 0 352 734 ;
+C -1 ; WX 500 ; N ccedilla ; B 30 -225 477 538 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 23 0 588 901 ;
+C -1 ; WX 667 ; N Thorn ; B 86 0 622 718 ;
+C -1 ; WX 778 ; N Omacron ; B 39 -19 739 879 ;
+C -1 ; WX 722 ; N Racute ; B 88 0 684 929 ;
+C -1 ; WX 667 ; N Sacute ; B 49 -19 620 929 ;
+C -1 ; WX 643 ; N dcaron ; B 35 -15 655 718 ;
+C -1 ; WX 722 ; N Umacron ; B 79 -19 644 879 ;
+C -1 ; WX 556 ; N uring ; B 68 -15 489 756 ;
+C -1 ; WX 333 ; N threesuperior ; B 5 270 325 703 ;
+C -1 ; WX 778 ; N Ograve ; B 39 -19 739 929 ;
+C -1 ; WX 667 ; N Agrave ; B 14 0 654 929 ;
+C -1 ; WX 667 ; N Abreve ; B 14 0 654 926 ;
+C -1 ; WX 584 ; N multiply ; B 39 0 545 506 ;
+C -1 ; WX 556 ; N uacute ; B 68 -15 489 734 ;
+C -1 ; WX 611 ; N Tcaron ; B 14 0 597 929 ;
+C -1 ; WX 476 ; N partialdiff ; B 13 -38 463 714 ;
+C -1 ; WX 500 ; N ydieresis ; B 11 -214 489 706 ;
+C -1 ; WX 722 ; N Nacute ; B 76 0 646 929 ;
+C -1 ; WX 278 ; N icircumflex ; B -6 0 285 734 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 86 0 616 929 ;
+C -1 ; WX 556 ; N adieresis ; B 36 -15 530 706 ;
+C -1 ; WX 556 ; N edieresis ; B 40 -15 516 706 ;
+C -1 ; WX 500 ; N cacute ; B 30 -15 477 734 ;
+C -1 ; WX 556 ; N nacute ; B 65 0 491 734 ;
+C -1 ; WX 556 ; N umacron ; B 68 -15 489 684 ;
+C -1 ; WX 722 ; N Ncaron ; B 76 0 646 929 ;
+C -1 ; WX 278 ; N Iacute ; B 91 0 292 929 ;
+C -1 ; WX 584 ; N plusminus ; B 39 0 545 506 ;
+C -1 ; WX 260 ; N brokenbar ; B 94 -150 167 700 ;
+C -1 ; WX 737 ; N registered ; B -14 -19 752 737 ;
+C -1 ; WX 778 ; N Gbreve ; B 48 -19 704 926 ;
+C -1 ; WX 278 ; N Idotaccent ; B 91 0 188 901 ;
+C -1 ; WX 600 ; N summation ; B 15 -10 586 706 ;
+C -1 ; WX 667 ; N Egrave ; B 86 0 616 929 ;
+C -1 ; WX 333 ; N racute ; B 77 0 332 734 ;
+C -1 ; WX 556 ; N omacron ; B 35 -14 521 684 ;
+C -1 ; WX 611 ; N Zacute ; B 23 0 588 929 ;
+C -1 ; WX 611 ; N Zcaron ; B 23 0 588 929 ;
+C -1 ; WX 549 ; N greaterequal ; B 26 0 523 674 ;
+C -1 ; WX 722 ; N Eth ; B 0 0 674 718 ;
+C -1 ; WX 722 ; N Ccedilla ; B 44 -225 681 737 ;
+C -1 ; WX 222 ; N lcommaaccent ; B 67 -225 167 718 ;
+C -1 ; WX 317 ; N tcaron ; B 14 -7 329 808 ;
+C -1 ; WX 556 ; N eogonek ; B 40 -225 516 538 ;
+C -1 ; WX 722 ; N Uogonek ; B 79 -225 644 718 ;
+C -1 ; WX 667 ; N Aacute ; B 14 0 654 929 ;
+C -1 ; WX 667 ; N Adieresis ; B 14 0 654 901 ;
+C -1 ; WX 556 ; N egrave ; B 40 -15 516 734 ;
+C -1 ; WX 500 ; N zacute ; B 31 0 469 734 ;
+C -1 ; WX 222 ; N iogonek ; B -31 -225 183 718 ;
+C -1 ; WX 778 ; N Oacute ; B 39 -19 739 929 ;
+C -1 ; WX 556 ; N oacute ; B 35 -14 521 734 ;
+C -1 ; WX 556 ; N amacron ; B 36 -15 530 684 ;
+C -1 ; WX 500 ; N sacute ; B 32 -15 464 734 ;
+C -1 ; WX 278 ; N idieresis ; B 13 0 266 706 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 39 -19 739 929 ;
+C -1 ; WX 722 ; N Ugrave ; B 79 -19 644 929 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 556 ; N thorn ; B 58 -207 517 718 ;
+C -1 ; WX 333 ; N twosuperior ; B 4 281 323 703 ;
+C -1 ; WX 778 ; N Odieresis ; B 39 -19 739 901 ;
+C -1 ; WX 556 ; N mu ; B 68 -207 489 523 ;
+C -1 ; WX 278 ; N igrave ; B -13 0 184 734 ;
+C -1 ; WX 556 ; N ohungarumlaut ; B 35 -14 521 734 ;
+C -1 ; WX 667 ; N Eogonek ; B 86 -220 633 718 ;
+C -1 ; WX 556 ; N dcroat ; B 35 -15 550 718 ;
+C -1 ; WX 834 ; N threequarters ; B 45 -19 810 703 ;
+C -1 ; WX 667 ; N Scedilla ; B 49 -225 620 737 ;
+C -1 ; WX 299 ; N lcaron ; B 67 0 311 718 ;
+C -1 ; WX 667 ; N Kcommaaccent ; B 76 -225 663 718 ;
+C -1 ; WX 556 ; N Lacute ; B 76 0 537 929 ;
+C -1 ; WX 1000 ; N trademark ; B 46 306 903 718 ;
+C -1 ; WX 556 ; N edotaccent ; B 40 -15 516 706 ;
+C -1 ; WX 278 ; N Igrave ; B -13 0 188 929 ;
+C -1 ; WX 278 ; N Imacron ; B -17 0 296 879 ;
+C -1 ; WX 556 ; N Lcaron ; B 76 0 537 718 ;
+C -1 ; WX 834 ; N onehalf ; B 43 -19 773 703 ;
+C -1 ; WX 549 ; N lessequal ; B 26 0 523 674 ;
+C -1 ; WX 556 ; N ocircumflex ; B 35 -14 521 734 ;
+C -1 ; WX 556 ; N ntilde ; B 65 0 491 722 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 79 -19 644 929 ;
+C -1 ; WX 667 ; N Eacute ; B 86 0 616 929 ;
+C -1 ; WX 556 ; N emacron ; B 40 -15 516 684 ;
+C -1 ; WX 556 ; N gbreve ; B 40 -220 499 731 ;
+C -1 ; WX 834 ; N onequarter ; B 73 -19 756 703 ;
+C -1 ; WX 667 ; N Scaron ; B 49 -19 620 929 ;
+C -1 ; WX 667 ; N Scommaaccent ; B 49 -225 620 737 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 39 -19 739 929 ;
+C -1 ; WX 400 ; N degree ; B 54 411 346 703 ;
+C -1 ; WX 556 ; N ograve ; B 35 -14 521 734 ;
+C -1 ; WX 722 ; N Ccaron ; B 44 -19 681 929 ;
+C -1 ; WX 556 ; N ugrave ; B 68 -15 489 734 ;
+C -1 ; WX 453 ; N radical ; B -4 -80 458 762 ;
+C -1 ; WX 722 ; N Dcaron ; B 81 0 674 929 ;
+C -1 ; WX 333 ; N rcommaaccent ; B 77 -225 332 538 ;
+C -1 ; WX 722 ; N Ntilde ; B 76 0 646 917 ;
+C -1 ; WX 556 ; N otilde ; B 35 -14 521 722 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 88 -225 684 718 ;
+C -1 ; WX 556 ; N Lcommaaccent ; B 76 -225 537 718 ;
+C -1 ; WX 667 ; N Atilde ; B 14 0 654 917 ;
+C -1 ; WX 667 ; N Aogonek ; B 14 -225 654 718 ;
+C -1 ; WX 667 ; N Aring ; B 14 0 654 931 ;
+C -1 ; WX 778 ; N Otilde ; B 39 -19 739 917 ;
+C -1 ; WX 500 ; N zdotaccent ; B 31 0 469 706 ;
+C -1 ; WX 667 ; N Ecaron ; B 86 0 616 929 ;
+C -1 ; WX 278 ; N Iogonek ; B -3 -225 211 718 ;
+C -1 ; WX 500 ; N kcommaaccent ; B 67 -225 501 718 ;
+C -1 ; WX 584 ; N minus ; B 39 216 545 289 ;
+C -1 ; WX 278 ; N Icircumflex ; B -6 0 285 929 ;
+C -1 ; WX 556 ; N ncaron ; B 65 0 491 734 ;
+C -1 ; WX 278 ; N tcommaaccent ; B 14 -225 257 669 ;
+C -1 ; WX 584 ; N logicalnot ; B 39 108 545 390 ;
+C -1 ; WX 556 ; N odieresis ; B 35 -14 521 706 ;
+C -1 ; WX 556 ; N udieresis ; B 68 -15 489 706 ;
+C -1 ; WX 549 ; N notequal ; B 12 -35 537 551 ;
+C -1 ; WX 556 ; N gcommaaccent ; B 40 -220 499 822 ;
+C -1 ; WX 556 ; N eth ; B 35 -15 522 737 ;
+C -1 ; WX 500 ; N zcaron ; B 31 0 469 734 ;
+C -1 ; WX 556 ; N ncommaaccent ; B 65 -225 491 538 ;
+C -1 ; WX 333 ; N onesuperior ; B 43 281 222 703 ;
+C -1 ; WX 278 ; N imacron ; B 5 0 272 684 ;
+C -1 ; WX 556 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 2705
+KPX A C -30
+KPX A Cacute -30
+KPX A Ccaron -30
+KPX A Ccedilla -30
+KPX A G -30
+KPX A Gbreve -30
+KPX A Gcommaaccent -30
+KPX A O -30
+KPX A Oacute -30
+KPX A Ocircumflex -30
+KPX A Odieresis -30
+KPX A Ograve -30
+KPX A Ohungarumlaut -30
+KPX A Omacron -30
+KPX A Oslash -30
+KPX A Otilde -30
+KPX A Q -30
+KPX A T -120
+KPX A Tcaron -120
+KPX A Tcommaaccent -120
+KPX A U -50
+KPX A Uacute -50
+KPX A Ucircumflex -50
+KPX A Udieresis -50
+KPX A Ugrave -50
+KPX A Uhungarumlaut -50
+KPX A Umacron -50
+KPX A Uogonek -50
+KPX A Uring -50
+KPX A V -70
+KPX A W -50
+KPX A Y -100
+KPX A Yacute -100
+KPX A Ydieresis -100
+KPX A u -30
+KPX A uacute -30
+KPX A ucircumflex -30
+KPX A udieresis -30
+KPX A ugrave -30
+KPX A uhungarumlaut -30
+KPX A umacron -30
+KPX A uogonek -30
+KPX A uring -30
+KPX A v -40
+KPX A w -40
+KPX A y -40
+KPX A yacute -40
+KPX A ydieresis -40
+KPX Aacute C -30
+KPX Aacute Cacute -30
+KPX Aacute Ccaron -30
+KPX Aacute Ccedilla -30
+KPX Aacute G -30
+KPX Aacute Gbreve -30
+KPX Aacute Gcommaaccent -30
+KPX Aacute O -30
+KPX Aacute Oacute -30
+KPX Aacute Ocircumflex -30
+KPX Aacute Odieresis -30
+KPX Aacute Ograve -30
+KPX Aacute Ohungarumlaut -30
+KPX Aacute Omacron -30
+KPX Aacute Oslash -30
+KPX Aacute Otilde -30
+KPX Aacute Q -30
+KPX Aacute T -120
+KPX Aacute Tcaron -120
+KPX Aacute Tcommaaccent -120
+KPX Aacute U -50
+KPX Aacute Uacute -50
+KPX Aacute Ucircumflex -50
+KPX Aacute Udieresis -50
+KPX Aacute Ugrave -50
+KPX Aacute Uhungarumlaut -50
+KPX Aacute Umacron -50
+KPX Aacute Uogonek -50
+KPX Aacute Uring -50
+KPX Aacute V -70
+KPX Aacute W -50
+KPX Aacute Y -100
+KPX Aacute Yacute -100
+KPX Aacute Ydieresis -100
+KPX Aacute u -30
+KPX Aacute uacute -30
+KPX Aacute ucircumflex -30
+KPX Aacute udieresis -30
+KPX Aacute ugrave -30
+KPX Aacute uhungarumlaut -30
+KPX Aacute umacron -30
+KPX Aacute uogonek -30
+KPX Aacute uring -30
+KPX Aacute v -40
+KPX Aacute w -40
+KPX Aacute y -40
+KPX Aacute yacute -40
+KPX Aacute ydieresis -40
+KPX Abreve C -30
+KPX Abreve Cacute -30
+KPX Abreve Ccaron -30
+KPX Abreve Ccedilla -30
+KPX Abreve G -30
+KPX Abreve Gbreve -30
+KPX Abreve Gcommaaccent -30
+KPX Abreve O -30
+KPX Abreve Oacute -30
+KPX Abreve Ocircumflex -30
+KPX Abreve Odieresis -30
+KPX Abreve Ograve -30
+KPX Abreve Ohungarumlaut -30
+KPX Abreve Omacron -30
+KPX Abreve Oslash -30
+KPX Abreve Otilde -30
+KPX Abreve Q -30
+KPX Abreve T -120
+KPX Abreve Tcaron -120
+KPX Abreve Tcommaaccent -120
+KPX Abreve U -50
+KPX Abreve Uacute -50
+KPX Abreve Ucircumflex -50
+KPX Abreve Udieresis -50
+KPX Abreve Ugrave -50
+KPX Abreve Uhungarumlaut -50
+KPX Abreve Umacron -50
+KPX Abreve Uogonek -50
+KPX Abreve Uring -50
+KPX Abreve V -70
+KPX Abreve W -50
+KPX Abreve Y -100
+KPX Abreve Yacute -100
+KPX Abreve Ydieresis -100
+KPX Abreve u -30
+KPX Abreve uacute -30
+KPX Abreve ucircumflex -30
+KPX Abreve udieresis -30
+KPX Abreve ugrave -30
+KPX Abreve uhungarumlaut -30
+KPX Abreve umacron -30
+KPX Abreve uogonek -30
+KPX Abreve uring -30
+KPX Abreve v -40
+KPX Abreve w -40
+KPX Abreve y -40
+KPX Abreve yacute -40
+KPX Abreve ydieresis -40
+KPX Acircumflex C -30
+KPX Acircumflex Cacute -30
+KPX Acircumflex Ccaron -30
+KPX Acircumflex Ccedilla -30
+KPX Acircumflex G -30
+KPX Acircumflex Gbreve -30
+KPX Acircumflex Gcommaaccent -30
+KPX Acircumflex O -30
+KPX Acircumflex Oacute -30
+KPX Acircumflex Ocircumflex -30
+KPX Acircumflex Odieresis -30
+KPX Acircumflex Ograve -30
+KPX Acircumflex Ohungarumlaut -30
+KPX Acircumflex Omacron -30
+KPX Acircumflex Oslash -30
+KPX Acircumflex Otilde -30
+KPX Acircumflex Q -30
+KPX Acircumflex T -120
+KPX Acircumflex Tcaron -120
+KPX Acircumflex Tcommaaccent -120
+KPX Acircumflex U -50
+KPX Acircumflex Uacute -50
+KPX Acircumflex Ucircumflex -50
+KPX Acircumflex Udieresis -50
+KPX Acircumflex Ugrave -50
+KPX Acircumflex Uhungarumlaut -50
+KPX Acircumflex Umacron -50
+KPX Acircumflex Uogonek -50
+KPX Acircumflex Uring -50
+KPX Acircumflex V -70
+KPX Acircumflex W -50
+KPX Acircumflex Y -100
+KPX Acircumflex Yacute -100
+KPX Acircumflex Ydieresis -100
+KPX Acircumflex u -30
+KPX Acircumflex uacute -30
+KPX Acircumflex ucircumflex -30
+KPX Acircumflex udieresis -30
+KPX Acircumflex ugrave -30
+KPX Acircumflex uhungarumlaut -30
+KPX Acircumflex umacron -30
+KPX Acircumflex uogonek -30
+KPX Acircumflex uring -30
+KPX Acircumflex v -40
+KPX Acircumflex w -40
+KPX Acircumflex y -40
+KPX Acircumflex yacute -40
+KPX Acircumflex ydieresis -40
+KPX Adieresis C -30
+KPX Adieresis Cacute -30
+KPX Adieresis Ccaron -30
+KPX Adieresis Ccedilla -30
+KPX Adieresis G -30
+KPX Adieresis Gbreve -30
+KPX Adieresis Gcommaaccent -30
+KPX Adieresis O -30
+KPX Adieresis Oacute -30
+KPX Adieresis Ocircumflex -30
+KPX Adieresis Odieresis -30
+KPX Adieresis Ograve -30
+KPX Adieresis Ohungarumlaut -30
+KPX Adieresis Omacron -30
+KPX Adieresis Oslash -30
+KPX Adieresis Otilde -30
+KPX Adieresis Q -30
+KPX Adieresis T -120
+KPX Adieresis Tcaron -120
+KPX Adieresis Tcommaaccent -120
+KPX Adieresis U -50
+KPX Adieresis Uacute -50
+KPX Adieresis Ucircumflex -50
+KPX Adieresis Udieresis -50
+KPX Adieresis Ugrave -50
+KPX Adieresis Uhungarumlaut -50
+KPX Adieresis Umacron -50
+KPX Adieresis Uogonek -50
+KPX Adieresis Uring -50
+KPX Adieresis V -70
+KPX Adieresis W -50
+KPX Adieresis Y -100
+KPX Adieresis Yacute -100
+KPX Adieresis Ydieresis -100
+KPX Adieresis u -30
+KPX Adieresis uacute -30
+KPX Adieresis ucircumflex -30
+KPX Adieresis udieresis -30
+KPX Adieresis ugrave -30
+KPX Adieresis uhungarumlaut -30
+KPX Adieresis umacron -30
+KPX Adieresis uogonek -30
+KPX Adieresis uring -30
+KPX Adieresis v -40
+KPX Adieresis w -40
+KPX Adieresis y -40
+KPX Adieresis yacute -40
+KPX Adieresis ydieresis -40
+KPX Agrave C -30
+KPX Agrave Cacute -30
+KPX Agrave Ccaron -30
+KPX Agrave Ccedilla -30
+KPX Agrave G -30
+KPX Agrave Gbreve -30
+KPX Agrave Gcommaaccent -30
+KPX Agrave O -30
+KPX Agrave Oacute -30
+KPX Agrave Ocircumflex -30
+KPX Agrave Odieresis -30
+KPX Agrave Ograve -30
+KPX Agrave Ohungarumlaut -30
+KPX Agrave Omacron -30
+KPX Agrave Oslash -30
+KPX Agrave Otilde -30
+KPX Agrave Q -30
+KPX Agrave T -120
+KPX Agrave Tcaron -120
+KPX Agrave Tcommaaccent -120
+KPX Agrave U -50
+KPX Agrave Uacute -50
+KPX Agrave Ucircumflex -50
+KPX Agrave Udieresis -50
+KPX Agrave Ugrave -50
+KPX Agrave Uhungarumlaut -50
+KPX Agrave Umacron -50
+KPX Agrave Uogonek -50
+KPX Agrave Uring -50
+KPX Agrave V -70
+KPX Agrave W -50
+KPX Agrave Y -100
+KPX Agrave Yacute -100
+KPX Agrave Ydieresis -100
+KPX Agrave u -30
+KPX Agrave uacute -30
+KPX Agrave ucircumflex -30
+KPX Agrave udieresis -30
+KPX Agrave ugrave -30
+KPX Agrave uhungarumlaut -30
+KPX Agrave umacron -30
+KPX Agrave uogonek -30
+KPX Agrave uring -30
+KPX Agrave v -40
+KPX Agrave w -40
+KPX Agrave y -40
+KPX Agrave yacute -40
+KPX Agrave ydieresis -40
+KPX Amacron C -30
+KPX Amacron Cacute -30
+KPX Amacron Ccaron -30
+KPX Amacron Ccedilla -30
+KPX Amacron G -30
+KPX Amacron Gbreve -30
+KPX Amacron Gcommaaccent -30
+KPX Amacron O -30
+KPX Amacron Oacute -30
+KPX Amacron Ocircumflex -30
+KPX Amacron Odieresis -30
+KPX Amacron Ograve -30
+KPX Amacron Ohungarumlaut -30
+KPX Amacron Omacron -30
+KPX Amacron Oslash -30
+KPX Amacron Otilde -30
+KPX Amacron Q -30
+KPX Amacron T -120
+KPX Amacron Tcaron -120
+KPX Amacron Tcommaaccent -120
+KPX Amacron U -50
+KPX Amacron Uacute -50
+KPX Amacron Ucircumflex -50
+KPX Amacron Udieresis -50
+KPX Amacron Ugrave -50
+KPX Amacron Uhungarumlaut -50
+KPX Amacron Umacron -50
+KPX Amacron Uogonek -50
+KPX Amacron Uring -50
+KPX Amacron V -70
+KPX Amacron W -50
+KPX Amacron Y -100
+KPX Amacron Yacute -100
+KPX Amacron Ydieresis -100
+KPX Amacron u -30
+KPX Amacron uacute -30
+KPX Amacron ucircumflex -30
+KPX Amacron udieresis -30
+KPX Amacron ugrave -30
+KPX Amacron uhungarumlaut -30
+KPX Amacron umacron -30
+KPX Amacron uogonek -30
+KPX Amacron uring -30
+KPX Amacron v -40
+KPX Amacron w -40
+KPX Amacron y -40
+KPX Amacron yacute -40
+KPX Amacron ydieresis -40
+KPX Aogonek C -30
+KPX Aogonek Cacute -30
+KPX Aogonek Ccaron -30
+KPX Aogonek Ccedilla -30
+KPX Aogonek G -30
+KPX Aogonek Gbreve -30
+KPX Aogonek Gcommaaccent -30
+KPX Aogonek O -30
+KPX Aogonek Oacute -30
+KPX Aogonek Ocircumflex -30
+KPX Aogonek Odieresis -30
+KPX Aogonek Ograve -30
+KPX Aogonek Ohungarumlaut -30
+KPX Aogonek Omacron -30
+KPX Aogonek Oslash -30
+KPX Aogonek Otilde -30
+KPX Aogonek Q -30
+KPX Aogonek T -120
+KPX Aogonek Tcaron -120
+KPX Aogonek Tcommaaccent -120
+KPX Aogonek U -50
+KPX Aogonek Uacute -50
+KPX Aogonek Ucircumflex -50
+KPX Aogonek Udieresis -50
+KPX Aogonek Ugrave -50
+KPX Aogonek Uhungarumlaut -50
+KPX Aogonek Umacron -50
+KPX Aogonek Uogonek -50
+KPX Aogonek Uring -50
+KPX Aogonek V -70
+KPX Aogonek W -50
+KPX Aogonek Y -100
+KPX Aogonek Yacute -100
+KPX Aogonek Ydieresis -100
+KPX Aogonek u -30
+KPX Aogonek uacute -30
+KPX Aogonek ucircumflex -30
+KPX Aogonek udieresis -30
+KPX Aogonek ugrave -30
+KPX Aogonek uhungarumlaut -30
+KPX Aogonek umacron -30
+KPX Aogonek uogonek -30
+KPX Aogonek uring -30
+KPX Aogonek v -40
+KPX Aogonek w -40
+KPX Aogonek y -40
+KPX Aogonek yacute -40
+KPX Aogonek ydieresis -40
+KPX Aring C -30
+KPX Aring Cacute -30
+KPX Aring Ccaron -30
+KPX Aring Ccedilla -30
+KPX Aring G -30
+KPX Aring Gbreve -30
+KPX Aring Gcommaaccent -30
+KPX Aring O -30
+KPX Aring Oacute -30
+KPX Aring Ocircumflex -30
+KPX Aring Odieresis -30
+KPX Aring Ograve -30
+KPX Aring Ohungarumlaut -30
+KPX Aring Omacron -30
+KPX Aring Oslash -30
+KPX Aring Otilde -30
+KPX Aring Q -30
+KPX Aring T -120
+KPX Aring Tcaron -120
+KPX Aring Tcommaaccent -120
+KPX Aring U -50
+KPX Aring Uacute -50
+KPX Aring Ucircumflex -50
+KPX Aring Udieresis -50
+KPX Aring Ugrave -50
+KPX Aring Uhungarumlaut -50
+KPX Aring Umacron -50
+KPX Aring Uogonek -50
+KPX Aring Uring -50
+KPX Aring V -70
+KPX Aring W -50
+KPX Aring Y -100
+KPX Aring Yacute -100
+KPX Aring Ydieresis -100
+KPX Aring u -30
+KPX Aring uacute -30
+KPX Aring ucircumflex -30
+KPX Aring udieresis -30
+KPX Aring ugrave -30
+KPX Aring uhungarumlaut -30
+KPX Aring umacron -30
+KPX Aring uogonek -30
+KPX Aring uring -30
+KPX Aring v -40
+KPX Aring w -40
+KPX Aring y -40
+KPX Aring yacute -40
+KPX Aring ydieresis -40
+KPX Atilde C -30
+KPX Atilde Cacute -30
+KPX Atilde Ccaron -30
+KPX Atilde Ccedilla -30
+KPX Atilde G -30
+KPX Atilde Gbreve -30
+KPX Atilde Gcommaaccent -30
+KPX Atilde O -30
+KPX Atilde Oacute -30
+KPX Atilde Ocircumflex -30
+KPX Atilde Odieresis -30
+KPX Atilde Ograve -30
+KPX Atilde Ohungarumlaut -30
+KPX Atilde Omacron -30
+KPX Atilde Oslash -30
+KPX Atilde Otilde -30
+KPX Atilde Q -30
+KPX Atilde T -120
+KPX Atilde Tcaron -120
+KPX Atilde Tcommaaccent -120
+KPX Atilde U -50
+KPX Atilde Uacute -50
+KPX Atilde Ucircumflex -50
+KPX Atilde Udieresis -50
+KPX Atilde Ugrave -50
+KPX Atilde Uhungarumlaut -50
+KPX Atilde Umacron -50
+KPX Atilde Uogonek -50
+KPX Atilde Uring -50
+KPX Atilde V -70
+KPX Atilde W -50
+KPX Atilde Y -100
+KPX Atilde Yacute -100
+KPX Atilde Ydieresis -100
+KPX Atilde u -30
+KPX Atilde uacute -30
+KPX Atilde ucircumflex -30
+KPX Atilde udieresis -30
+KPX Atilde ugrave -30
+KPX Atilde uhungarumlaut -30
+KPX Atilde umacron -30
+KPX Atilde uogonek -30
+KPX Atilde uring -30
+KPX Atilde v -40
+KPX Atilde w -40
+KPX Atilde y -40
+KPX Atilde yacute -40
+KPX Atilde ydieresis -40
+KPX B U -10
+KPX B Uacute -10
+KPX B Ucircumflex -10
+KPX B Udieresis -10
+KPX B Ugrave -10
+KPX B Uhungarumlaut -10
+KPX B Umacron -10
+KPX B Uogonek -10
+KPX B Uring -10
+KPX B comma -20
+KPX B period -20
+KPX C comma -30
+KPX C period -30
+KPX Cacute comma -30
+KPX Cacute period -30
+KPX Ccaron comma -30
+KPX Ccaron period -30
+KPX Ccedilla comma -30
+KPX Ccedilla period -30
+KPX D A -40
+KPX D Aacute -40
+KPX D Abreve -40
+KPX D Acircumflex -40
+KPX D Adieresis -40
+KPX D Agrave -40
+KPX D Amacron -40
+KPX D Aogonek -40
+KPX D Aring -40
+KPX D Atilde -40
+KPX D V -70
+KPX D W -40
+KPX D Y -90
+KPX D Yacute -90
+KPX D Ydieresis -90
+KPX D comma -70
+KPX D period -70
+KPX Dcaron A -40
+KPX Dcaron Aacute -40
+KPX Dcaron Abreve -40
+KPX Dcaron Acircumflex -40
+KPX Dcaron Adieresis -40
+KPX Dcaron Agrave -40
+KPX Dcaron Amacron -40
+KPX Dcaron Aogonek -40
+KPX Dcaron Aring -40
+KPX Dcaron Atilde -40
+KPX Dcaron V -70
+KPX Dcaron W -40
+KPX Dcaron Y -90
+KPX Dcaron Yacute -90
+KPX Dcaron Ydieresis -90
+KPX Dcaron comma -70
+KPX Dcaron period -70
+KPX Dcroat A -40
+KPX Dcroat Aacute -40
+KPX Dcroat Abreve -40
+KPX Dcroat Acircumflex -40
+KPX Dcroat Adieresis -40
+KPX Dcroat Agrave -40
+KPX Dcroat Amacron -40
+KPX Dcroat Aogonek -40
+KPX Dcroat Aring -40
+KPX Dcroat Atilde -40
+KPX Dcroat V -70
+KPX Dcroat W -40
+KPX Dcroat Y -90
+KPX Dcroat Yacute -90
+KPX Dcroat Ydieresis -90
+KPX Dcroat comma -70
+KPX Dcroat period -70
+KPX F A -80
+KPX F Aacute -80
+KPX F Abreve -80
+KPX F Acircumflex -80
+KPX F Adieresis -80
+KPX F Agrave -80
+KPX F Amacron -80
+KPX F Aogonek -80
+KPX F Aring -80
+KPX F Atilde -80
+KPX F a -50
+KPX F aacute -50
+KPX F abreve -50
+KPX F acircumflex -50
+KPX F adieresis -50
+KPX F agrave -50
+KPX F amacron -50
+KPX F aogonek -50
+KPX F aring -50
+KPX F atilde -50
+KPX F comma -150
+KPX F e -30
+KPX F eacute -30
+KPX F ecaron -30
+KPX F ecircumflex -30
+KPX F edieresis -30
+KPX F edotaccent -30
+KPX F egrave -30
+KPX F emacron -30
+KPX F eogonek -30
+KPX F o -30
+KPX F oacute -30
+KPX F ocircumflex -30
+KPX F odieresis -30
+KPX F ograve -30
+KPX F ohungarumlaut -30
+KPX F omacron -30
+KPX F oslash -30
+KPX F otilde -30
+KPX F period -150
+KPX F r -45
+KPX F racute -45
+KPX F rcaron -45
+KPX F rcommaaccent -45
+KPX J A -20
+KPX J Aacute -20
+KPX J Abreve -20
+KPX J Acircumflex -20
+KPX J Adieresis -20
+KPX J Agrave -20
+KPX J Amacron -20
+KPX J Aogonek -20
+KPX J Aring -20
+KPX J Atilde -20
+KPX J a -20
+KPX J aacute -20
+KPX J abreve -20
+KPX J acircumflex -20
+KPX J adieresis -20
+KPX J agrave -20
+KPX J amacron -20
+KPX J aogonek -20
+KPX J aring -20
+KPX J atilde -20
+KPX J comma -30
+KPX J period -30
+KPX J u -20
+KPX J uacute -20
+KPX J ucircumflex -20
+KPX J udieresis -20
+KPX J ugrave -20
+KPX J uhungarumlaut -20
+KPX J umacron -20
+KPX J uogonek -20
+KPX J uring -20
+KPX K O -50
+KPX K Oacute -50
+KPX K Ocircumflex -50
+KPX K Odieresis -50
+KPX K Ograve -50
+KPX K Ohungarumlaut -50
+KPX K Omacron -50
+KPX K Oslash -50
+KPX K Otilde -50
+KPX K e -40
+KPX K eacute -40
+KPX K ecaron -40
+KPX K ecircumflex -40
+KPX K edieresis -40
+KPX K edotaccent -40
+KPX K egrave -40
+KPX K emacron -40
+KPX K eogonek -40
+KPX K o -40
+KPX K oacute -40
+KPX K ocircumflex -40
+KPX K odieresis -40
+KPX K ograve -40
+KPX K ohungarumlaut -40
+KPX K omacron -40
+KPX K oslash -40
+KPX K otilde -40
+KPX K u -30
+KPX K uacute -30
+KPX K ucircumflex -30
+KPX K udieresis -30
+KPX K ugrave -30
+KPX K uhungarumlaut -30
+KPX K umacron -30
+KPX K uogonek -30
+KPX K uring -30
+KPX K y -50
+KPX K yacute -50
+KPX K ydieresis -50
+KPX Kcommaaccent O -50
+KPX Kcommaaccent Oacute -50
+KPX Kcommaaccent Ocircumflex -50
+KPX Kcommaaccent Odieresis -50
+KPX Kcommaaccent Ograve -50
+KPX Kcommaaccent Ohungarumlaut -50
+KPX Kcommaaccent Omacron -50
+KPX Kcommaaccent Oslash -50
+KPX Kcommaaccent Otilde -50
+KPX Kcommaaccent e -40
+KPX Kcommaaccent eacute -40
+KPX Kcommaaccent ecaron -40
+KPX Kcommaaccent ecircumflex -40
+KPX Kcommaaccent edieresis -40
+KPX Kcommaaccent edotaccent -40
+KPX Kcommaaccent egrave -40
+KPX Kcommaaccent emacron -40
+KPX Kcommaaccent eogonek -40
+KPX Kcommaaccent o -40
+KPX Kcommaaccent oacute -40
+KPX Kcommaaccent ocircumflex -40
+KPX Kcommaaccent odieresis -40
+KPX Kcommaaccent ograve -40
+KPX Kcommaaccent ohungarumlaut -40
+KPX Kcommaaccent omacron -40
+KPX Kcommaaccent oslash -40
+KPX Kcommaaccent otilde -40
+KPX Kcommaaccent u -30
+KPX Kcommaaccent uacute -30
+KPX Kcommaaccent ucircumflex -30
+KPX Kcommaaccent udieresis -30
+KPX Kcommaaccent ugrave -30
+KPX Kcommaaccent uhungarumlaut -30
+KPX Kcommaaccent umacron -30
+KPX Kcommaaccent uogonek -30
+KPX Kcommaaccent uring -30
+KPX Kcommaaccent y -50
+KPX Kcommaaccent yacute -50
+KPX Kcommaaccent ydieresis -50
+KPX L T -110
+KPX L Tcaron -110
+KPX L Tcommaaccent -110
+KPX L V -110
+KPX L W -70
+KPX L Y -140
+KPX L Yacute -140
+KPX L Ydieresis -140
+KPX L quotedblright -140
+KPX L quoteright -160
+KPX L y -30
+KPX L yacute -30
+KPX L ydieresis -30
+KPX Lacute T -110
+KPX Lacute Tcaron -110
+KPX Lacute Tcommaaccent -110
+KPX Lacute V -110
+KPX Lacute W -70
+KPX Lacute Y -140
+KPX Lacute Yacute -140
+KPX Lacute Ydieresis -140
+KPX Lacute quotedblright -140
+KPX Lacute quoteright -160
+KPX Lacute y -30
+KPX Lacute yacute -30
+KPX Lacute ydieresis -30
+KPX Lcaron T -110
+KPX Lcaron Tcaron -110
+KPX Lcaron Tcommaaccent -110
+KPX Lcaron V -110
+KPX Lcaron W -70
+KPX Lcaron Y -140
+KPX Lcaron Yacute -140
+KPX Lcaron Ydieresis -140
+KPX Lcaron quotedblright -140
+KPX Lcaron quoteright -160
+KPX Lcaron y -30
+KPX Lcaron yacute -30
+KPX Lcaron ydieresis -30
+KPX Lcommaaccent T -110
+KPX Lcommaaccent Tcaron -110
+KPX Lcommaaccent Tcommaaccent -110
+KPX Lcommaaccent V -110
+KPX Lcommaaccent W -70
+KPX Lcommaaccent Y -140
+KPX Lcommaaccent Yacute -140
+KPX Lcommaaccent Ydieresis -140
+KPX Lcommaaccent quotedblright -140
+KPX Lcommaaccent quoteright -160
+KPX Lcommaaccent y -30
+KPX Lcommaaccent yacute -30
+KPX Lcommaaccent ydieresis -30
+KPX Lslash T -110
+KPX Lslash Tcaron -110
+KPX Lslash Tcommaaccent -110
+KPX Lslash V -110
+KPX Lslash W -70
+KPX Lslash Y -140
+KPX Lslash Yacute -140
+KPX Lslash Ydieresis -140
+KPX Lslash quotedblright -140
+KPX Lslash quoteright -160
+KPX Lslash y -30
+KPX Lslash yacute -30
+KPX Lslash ydieresis -30
+KPX O A -20
+KPX O Aacute -20
+KPX O Abreve -20
+KPX O Acircumflex -20
+KPX O Adieresis -20
+KPX O Agrave -20
+KPX O Amacron -20
+KPX O Aogonek -20
+KPX O Aring -20
+KPX O Atilde -20
+KPX O T -40
+KPX O Tcaron -40
+KPX O Tcommaaccent -40
+KPX O V -50
+KPX O W -30
+KPX O X -60
+KPX O Y -70
+KPX O Yacute -70
+KPX O Ydieresis -70
+KPX O comma -40
+KPX O period -40
+KPX Oacute A -20
+KPX Oacute Aacute -20
+KPX Oacute Abreve -20
+KPX Oacute Acircumflex -20
+KPX Oacute Adieresis -20
+KPX Oacute Agrave -20
+KPX Oacute Amacron -20
+KPX Oacute Aogonek -20
+KPX Oacute Aring -20
+KPX Oacute Atilde -20
+KPX Oacute T -40
+KPX Oacute Tcaron -40
+KPX Oacute Tcommaaccent -40
+KPX Oacute V -50
+KPX Oacute W -30
+KPX Oacute X -60
+KPX Oacute Y -70
+KPX Oacute Yacute -70
+KPX Oacute Ydieresis -70
+KPX Oacute comma -40
+KPX Oacute period -40
+KPX Ocircumflex A -20
+KPX Ocircumflex Aacute -20
+KPX Ocircumflex Abreve -20
+KPX Ocircumflex Acircumflex -20
+KPX Ocircumflex Adieresis -20
+KPX Ocircumflex Agrave -20
+KPX Ocircumflex Amacron -20
+KPX Ocircumflex Aogonek -20
+KPX Ocircumflex Aring -20
+KPX Ocircumflex Atilde -20
+KPX Ocircumflex T -40
+KPX Ocircumflex Tcaron -40
+KPX Ocircumflex Tcommaaccent -40
+KPX Ocircumflex V -50
+KPX Ocircumflex W -30
+KPX Ocircumflex X -60
+KPX Ocircumflex Y -70
+KPX Ocircumflex Yacute -70
+KPX Ocircumflex Ydieresis -70
+KPX Ocircumflex comma -40
+KPX Ocircumflex period -40
+KPX Odieresis A -20
+KPX Odieresis Aacute -20
+KPX Odieresis Abreve -20
+KPX Odieresis Acircumflex -20
+KPX Odieresis Adieresis -20
+KPX Odieresis Agrave -20
+KPX Odieresis Amacron -20
+KPX Odieresis Aogonek -20
+KPX Odieresis Aring -20
+KPX Odieresis Atilde -20
+KPX Odieresis T -40
+KPX Odieresis Tcaron -40
+KPX Odieresis Tcommaaccent -40
+KPX Odieresis V -50
+KPX Odieresis W -30
+KPX Odieresis X -60
+KPX Odieresis Y -70
+KPX Odieresis Yacute -70
+KPX Odieresis Ydieresis -70
+KPX Odieresis comma -40
+KPX Odieresis period -40
+KPX Ograve A -20
+KPX Ograve Aacute -20
+KPX Ograve Abreve -20
+KPX Ograve Acircumflex -20
+KPX Ograve Adieresis -20
+KPX Ograve Agrave -20
+KPX Ograve Amacron -20
+KPX Ograve Aogonek -20
+KPX Ograve Aring -20
+KPX Ograve Atilde -20
+KPX Ograve T -40
+KPX Ograve Tcaron -40
+KPX Ograve Tcommaaccent -40
+KPX Ograve V -50
+KPX Ograve W -30
+KPX Ograve X -60
+KPX Ograve Y -70
+KPX Ograve Yacute -70
+KPX Ograve Ydieresis -70
+KPX Ograve comma -40
+KPX Ograve period -40
+KPX Ohungarumlaut A -20
+KPX Ohungarumlaut Aacute -20
+KPX Ohungarumlaut Abreve -20
+KPX Ohungarumlaut Acircumflex -20
+KPX Ohungarumlaut Adieresis -20
+KPX Ohungarumlaut Agrave -20
+KPX Ohungarumlaut Amacron -20
+KPX Ohungarumlaut Aogonek -20
+KPX Ohungarumlaut Aring -20
+KPX Ohungarumlaut Atilde -20
+KPX Ohungarumlaut T -40
+KPX Ohungarumlaut Tcaron -40
+KPX Ohungarumlaut Tcommaaccent -40
+KPX Ohungarumlaut V -50
+KPX Ohungarumlaut W -30
+KPX Ohungarumlaut X -60
+KPX Ohungarumlaut Y -70
+KPX Ohungarumlaut Yacute -70
+KPX Ohungarumlaut Ydieresis -70
+KPX Ohungarumlaut comma -40
+KPX Ohungarumlaut period -40
+KPX Omacron A -20
+KPX Omacron Aacute -20
+KPX Omacron Abreve -20
+KPX Omacron Acircumflex -20
+KPX Omacron Adieresis -20
+KPX Omacron Agrave -20
+KPX Omacron Amacron -20
+KPX Omacron Aogonek -20
+KPX Omacron Aring -20
+KPX Omacron Atilde -20
+KPX Omacron T -40
+KPX Omacron Tcaron -40
+KPX Omacron Tcommaaccent -40
+KPX Omacron V -50
+KPX Omacron W -30
+KPX Omacron X -60
+KPX Omacron Y -70
+KPX Omacron Yacute -70
+KPX Omacron Ydieresis -70
+KPX Omacron comma -40
+KPX Omacron period -40
+KPX Oslash A -20
+KPX Oslash Aacute -20
+KPX Oslash Abreve -20
+KPX Oslash Acircumflex -20
+KPX Oslash Adieresis -20
+KPX Oslash Agrave -20
+KPX Oslash Amacron -20
+KPX Oslash Aogonek -20
+KPX Oslash Aring -20
+KPX Oslash Atilde -20
+KPX Oslash T -40
+KPX Oslash Tcaron -40
+KPX Oslash Tcommaaccent -40
+KPX Oslash V -50
+KPX Oslash W -30
+KPX Oslash X -60
+KPX Oslash Y -70
+KPX Oslash Yacute -70
+KPX Oslash Ydieresis -70
+KPX Oslash comma -40
+KPX Oslash period -40
+KPX Otilde A -20
+KPX Otilde Aacute -20
+KPX Otilde Abreve -20
+KPX Otilde Acircumflex -20
+KPX Otilde Adieresis -20
+KPX Otilde Agrave -20
+KPX Otilde Amacron -20
+KPX Otilde Aogonek -20
+KPX Otilde Aring -20
+KPX Otilde Atilde -20
+KPX Otilde T -40
+KPX Otilde Tcaron -40
+KPX Otilde Tcommaaccent -40
+KPX Otilde V -50
+KPX Otilde W -30
+KPX Otilde X -60
+KPX Otilde Y -70
+KPX Otilde Yacute -70
+KPX Otilde Ydieresis -70
+KPX Otilde comma -40
+KPX Otilde period -40
+KPX P A -120
+KPX P Aacute -120
+KPX P Abreve -120
+KPX P Acircumflex -120
+KPX P Adieresis -120
+KPX P Agrave -120
+KPX P Amacron -120
+KPX P Aogonek -120
+KPX P Aring -120
+KPX P Atilde -120
+KPX P a -40
+KPX P aacute -40
+KPX P abreve -40
+KPX P acircumflex -40
+KPX P adieresis -40
+KPX P agrave -40
+KPX P amacron -40
+KPX P aogonek -40
+KPX P aring -40
+KPX P atilde -40
+KPX P comma -180
+KPX P e -50
+KPX P eacute -50
+KPX P ecaron -50
+KPX P ecircumflex -50
+KPX P edieresis -50
+KPX P edotaccent -50
+KPX P egrave -50
+KPX P emacron -50
+KPX P eogonek -50
+KPX P o -50
+KPX P oacute -50
+KPX P ocircumflex -50
+KPX P odieresis -50
+KPX P ograve -50
+KPX P ohungarumlaut -50
+KPX P omacron -50
+KPX P oslash -50
+KPX P otilde -50
+KPX P period -180
+KPX Q U -10
+KPX Q Uacute -10
+KPX Q Ucircumflex -10
+KPX Q Udieresis -10
+KPX Q Ugrave -10
+KPX Q Uhungarumlaut -10
+KPX Q Umacron -10
+KPX Q Uogonek -10
+KPX Q Uring -10
+KPX R O -20
+KPX R Oacute -20
+KPX R Ocircumflex -20
+KPX R Odieresis -20
+KPX R Ograve -20
+KPX R Ohungarumlaut -20
+KPX R Omacron -20
+KPX R Oslash -20
+KPX R Otilde -20
+KPX R T -30
+KPX R Tcaron -30
+KPX R Tcommaaccent -30
+KPX R U -40
+KPX R Uacute -40
+KPX R Ucircumflex -40
+KPX R Udieresis -40
+KPX R Ugrave -40
+KPX R Uhungarumlaut -40
+KPX R Umacron -40
+KPX R Uogonek -40
+KPX R Uring -40
+KPX R V -50
+KPX R W -30
+KPX R Y -50
+KPX R Yacute -50
+KPX R Ydieresis -50
+KPX Racute O -20
+KPX Racute Oacute -20
+KPX Racute Ocircumflex -20
+KPX Racute Odieresis -20
+KPX Racute Ograve -20
+KPX Racute Ohungarumlaut -20
+KPX Racute Omacron -20
+KPX Racute Oslash -20
+KPX Racute Otilde -20
+KPX Racute T -30
+KPX Racute Tcaron -30
+KPX Racute Tcommaaccent -30
+KPX Racute U -40
+KPX Racute Uacute -40
+KPX Racute Ucircumflex -40
+KPX Racute Udieresis -40
+KPX Racute Ugrave -40
+KPX Racute Uhungarumlaut -40
+KPX Racute Umacron -40
+KPX Racute Uogonek -40
+KPX Racute Uring -40
+KPX Racute V -50
+KPX Racute W -30
+KPX Racute Y -50
+KPX Racute Yacute -50
+KPX Racute Ydieresis -50
+KPX Rcaron O -20
+KPX Rcaron Oacute -20
+KPX Rcaron Ocircumflex -20
+KPX Rcaron Odieresis -20
+KPX Rcaron Ograve -20
+KPX Rcaron Ohungarumlaut -20
+KPX Rcaron Omacron -20
+KPX Rcaron Oslash -20
+KPX Rcaron Otilde -20
+KPX Rcaron T -30
+KPX Rcaron Tcaron -30
+KPX Rcaron Tcommaaccent -30
+KPX Rcaron U -40
+KPX Rcaron Uacute -40
+KPX Rcaron Ucircumflex -40
+KPX Rcaron Udieresis -40
+KPX Rcaron Ugrave -40
+KPX Rcaron Uhungarumlaut -40
+KPX Rcaron Umacron -40
+KPX Rcaron Uogonek -40
+KPX Rcaron Uring -40
+KPX Rcaron V -50
+KPX Rcaron W -30
+KPX Rcaron Y -50
+KPX Rcaron Yacute -50
+KPX Rcaron Ydieresis -50
+KPX Rcommaaccent O -20
+KPX Rcommaaccent Oacute -20
+KPX Rcommaaccent Ocircumflex -20
+KPX Rcommaaccent Odieresis -20
+KPX Rcommaaccent Ograve -20
+KPX Rcommaaccent Ohungarumlaut -20
+KPX Rcommaaccent Omacron -20
+KPX Rcommaaccent Oslash -20
+KPX Rcommaaccent Otilde -20
+KPX Rcommaaccent T -30
+KPX Rcommaaccent Tcaron -30
+KPX Rcommaaccent Tcommaaccent -30
+KPX Rcommaaccent U -40
+KPX Rcommaaccent Uacute -40
+KPX Rcommaaccent Ucircumflex -40
+KPX Rcommaaccent Udieresis -40
+KPX Rcommaaccent Ugrave -40
+KPX Rcommaaccent Uhungarumlaut -40
+KPX Rcommaaccent Umacron -40
+KPX Rcommaaccent Uogonek -40
+KPX Rcommaaccent Uring -40
+KPX Rcommaaccent V -50
+KPX Rcommaaccent W -30
+KPX Rcommaaccent Y -50
+KPX Rcommaaccent Yacute -50
+KPX Rcommaaccent Ydieresis -50
+KPX S comma -20
+KPX S period -20
+KPX Sacute comma -20
+KPX Sacute period -20
+KPX Scaron comma -20
+KPX Scaron period -20
+KPX Scedilla comma -20
+KPX Scedilla period -20
+KPX Scommaaccent comma -20
+KPX Scommaaccent period -20
+KPX T A -120
+KPX T Aacute -120
+KPX T Abreve -120
+KPX T Acircumflex -120
+KPX T Adieresis -120
+KPX T Agrave -120
+KPX T Amacron -120
+KPX T Aogonek -120
+KPX T Aring -120
+KPX T Atilde -120
+KPX T O -40
+KPX T Oacute -40
+KPX T Ocircumflex -40
+KPX T Odieresis -40
+KPX T Ograve -40
+KPX T Ohungarumlaut -40
+KPX T Omacron -40
+KPX T Oslash -40
+KPX T Otilde -40
+KPX T a -120
+KPX T aacute -120
+KPX T abreve -60
+KPX T acircumflex -120
+KPX T adieresis -120
+KPX T agrave -120
+KPX T amacron -60
+KPX T aogonek -120
+KPX T aring -120
+KPX T atilde -60
+KPX T colon -20
+KPX T comma -120
+KPX T e -120
+KPX T eacute -120
+KPX T ecaron -120
+KPX T ecircumflex -120
+KPX T edieresis -120
+KPX T edotaccent -120
+KPX T egrave -60
+KPX T emacron -60
+KPX T eogonek -120
+KPX T hyphen -140
+KPX T o -120
+KPX T oacute -120
+KPX T ocircumflex -120
+KPX T odieresis -120
+KPX T ograve -120
+KPX T ohungarumlaut -120
+KPX T omacron -60
+KPX T oslash -120
+KPX T otilde -60
+KPX T period -120
+KPX T r -120
+KPX T racute -120
+KPX T rcaron -120
+KPX T rcommaaccent -120
+KPX T semicolon -20
+KPX T u -120
+KPX T uacute -120
+KPX T ucircumflex -120
+KPX T udieresis -120
+KPX T ugrave -120
+KPX T uhungarumlaut -120
+KPX T umacron -60
+KPX T uogonek -120
+KPX T uring -120
+KPX T w -120
+KPX T y -120
+KPX T yacute -120
+KPX T ydieresis -60
+KPX Tcaron A -120
+KPX Tcaron Aacute -120
+KPX Tcaron Abreve -120
+KPX Tcaron Acircumflex -120
+KPX Tcaron Adieresis -120
+KPX Tcaron Agrave -120
+KPX Tcaron Amacron -120
+KPX Tcaron Aogonek -120
+KPX Tcaron Aring -120
+KPX Tcaron Atilde -120
+KPX Tcaron O -40
+KPX Tcaron Oacute -40
+KPX Tcaron Ocircumflex -40
+KPX Tcaron Odieresis -40
+KPX Tcaron Ograve -40
+KPX Tcaron Ohungarumlaut -40
+KPX Tcaron Omacron -40
+KPX Tcaron Oslash -40
+KPX Tcaron Otilde -40
+KPX Tcaron a -120
+KPX Tcaron aacute -120
+KPX Tcaron abreve -60
+KPX Tcaron acircumflex -120
+KPX Tcaron adieresis -120
+KPX Tcaron agrave -120
+KPX Tcaron amacron -60
+KPX Tcaron aogonek -120
+KPX Tcaron aring -120
+KPX Tcaron atilde -60
+KPX Tcaron colon -20
+KPX Tcaron comma -120
+KPX Tcaron e -120
+KPX Tcaron eacute -120
+KPX Tcaron ecaron -120
+KPX Tcaron ecircumflex -120
+KPX Tcaron edieresis -120
+KPX Tcaron edotaccent -120
+KPX Tcaron egrave -60
+KPX Tcaron emacron -60
+KPX Tcaron eogonek -120
+KPX Tcaron hyphen -140
+KPX Tcaron o -120
+KPX Tcaron oacute -120
+KPX Tcaron ocircumflex -120
+KPX Tcaron odieresis -120
+KPX Tcaron ograve -120
+KPX Tcaron ohungarumlaut -120
+KPX Tcaron omacron -60
+KPX Tcaron oslash -120
+KPX Tcaron otilde -60
+KPX Tcaron period -120
+KPX Tcaron r -120
+KPX Tcaron racute -120
+KPX Tcaron rcaron -120
+KPX Tcaron rcommaaccent -120
+KPX Tcaron semicolon -20
+KPX Tcaron u -120
+KPX Tcaron uacute -120
+KPX Tcaron ucircumflex -120
+KPX Tcaron udieresis -120
+KPX Tcaron ugrave -120
+KPX Tcaron uhungarumlaut -120
+KPX Tcaron umacron -60
+KPX Tcaron uogonek -120
+KPX Tcaron uring -120
+KPX Tcaron w -120
+KPX Tcaron y -120
+KPX Tcaron yacute -120
+KPX Tcaron ydieresis -60
+KPX Tcommaaccent A -120
+KPX Tcommaaccent Aacute -120
+KPX Tcommaaccent Abreve -120
+KPX Tcommaaccent Acircumflex -120
+KPX Tcommaaccent Adieresis -120
+KPX Tcommaaccent Agrave -120
+KPX Tcommaaccent Amacron -120
+KPX Tcommaaccent Aogonek -120
+KPX Tcommaaccent Aring -120
+KPX Tcommaaccent Atilde -120
+KPX Tcommaaccent O -40
+KPX Tcommaaccent Oacute -40
+KPX Tcommaaccent Ocircumflex -40
+KPX Tcommaaccent Odieresis -40
+KPX Tcommaaccent Ograve -40
+KPX Tcommaaccent Ohungarumlaut -40
+KPX Tcommaaccent Omacron -40
+KPX Tcommaaccent Oslash -40
+KPX Tcommaaccent Otilde -40
+KPX Tcommaaccent a -120
+KPX Tcommaaccent aacute -120
+KPX Tcommaaccent abreve -60
+KPX Tcommaaccent acircumflex -120
+KPX Tcommaaccent adieresis -120
+KPX Tcommaaccent agrave -120
+KPX Tcommaaccent amacron -60
+KPX Tcommaaccent aogonek -120
+KPX Tcommaaccent aring -120
+KPX Tcommaaccent atilde -60
+KPX Tcommaaccent colon -20
+KPX Tcommaaccent comma -120
+KPX Tcommaaccent e -120
+KPX Tcommaaccent eacute -120
+KPX Tcommaaccent ecaron -120
+KPX Tcommaaccent ecircumflex -120
+KPX Tcommaaccent edieresis -120
+KPX Tcommaaccent edotaccent -120
+KPX Tcommaaccent egrave -60
+KPX Tcommaaccent emacron -60
+KPX Tcommaaccent eogonek -120
+KPX Tcommaaccent hyphen -140
+KPX Tcommaaccent o -120
+KPX Tcommaaccent oacute -120
+KPX Tcommaaccent ocircumflex -120
+KPX Tcommaaccent odieresis -120
+KPX Tcommaaccent ograve -120
+KPX Tcommaaccent ohungarumlaut -120
+KPX Tcommaaccent omacron -60
+KPX Tcommaaccent oslash -120
+KPX Tcommaaccent otilde -60
+KPX Tcommaaccent period -120
+KPX Tcommaaccent r -120
+KPX Tcommaaccent racute -120
+KPX Tcommaaccent rcaron -120
+KPX Tcommaaccent rcommaaccent -120
+KPX Tcommaaccent semicolon -20
+KPX Tcommaaccent u -120
+KPX Tcommaaccent uacute -120
+KPX Tcommaaccent ucircumflex -120
+KPX Tcommaaccent udieresis -120
+KPX Tcommaaccent ugrave -120
+KPX Tcommaaccent uhungarumlaut -120
+KPX Tcommaaccent umacron -60
+KPX Tcommaaccent uogonek -120
+KPX Tcommaaccent uring -120
+KPX Tcommaaccent w -120
+KPX Tcommaaccent y -120
+KPX Tcommaaccent yacute -120
+KPX Tcommaaccent ydieresis -60
+KPX U A -40
+KPX U Aacute -40
+KPX U Abreve -40
+KPX U Acircumflex -40
+KPX U Adieresis -40
+KPX U Agrave -40
+KPX U Amacron -40
+KPX U Aogonek -40
+KPX U Aring -40
+KPX U Atilde -40
+KPX U comma -40
+KPX U period -40
+KPX Uacute A -40
+KPX Uacute Aacute -40
+KPX Uacute Abreve -40
+KPX Uacute Acircumflex -40
+KPX Uacute Adieresis -40
+KPX Uacute Agrave -40
+KPX Uacute Amacron -40
+KPX Uacute Aogonek -40
+KPX Uacute Aring -40
+KPX Uacute Atilde -40
+KPX Uacute comma -40
+KPX Uacute period -40
+KPX Ucircumflex A -40
+KPX Ucircumflex Aacute -40
+KPX Ucircumflex Abreve -40
+KPX Ucircumflex Acircumflex -40
+KPX Ucircumflex Adieresis -40
+KPX Ucircumflex Agrave -40
+KPX Ucircumflex Amacron -40
+KPX Ucircumflex Aogonek -40
+KPX Ucircumflex Aring -40
+KPX Ucircumflex Atilde -40
+KPX Ucircumflex comma -40
+KPX Ucircumflex period -40
+KPX Udieresis A -40
+KPX Udieresis Aacute -40
+KPX Udieresis Abreve -40
+KPX Udieresis Acircumflex -40
+KPX Udieresis Adieresis -40
+KPX Udieresis Agrave -40
+KPX Udieresis Amacron -40
+KPX Udieresis Aogonek -40
+KPX Udieresis Aring -40
+KPX Udieresis Atilde -40
+KPX Udieresis comma -40
+KPX Udieresis period -40
+KPX Ugrave A -40
+KPX Ugrave Aacute -40
+KPX Ugrave Abreve -40
+KPX Ugrave Acircumflex -40
+KPX Ugrave Adieresis -40
+KPX Ugrave Agrave -40
+KPX Ugrave Amacron -40
+KPX Ugrave Aogonek -40
+KPX Ugrave Aring -40
+KPX Ugrave Atilde -40
+KPX Ugrave comma -40
+KPX Ugrave period -40
+KPX Uhungarumlaut A -40
+KPX Uhungarumlaut Aacute -40
+KPX Uhungarumlaut Abreve -40
+KPX Uhungarumlaut Acircumflex -40
+KPX Uhungarumlaut Adieresis -40
+KPX Uhungarumlaut Agrave -40
+KPX Uhungarumlaut Amacron -40
+KPX Uhungarumlaut Aogonek -40
+KPX Uhungarumlaut Aring -40
+KPX Uhungarumlaut Atilde -40
+KPX Uhungarumlaut comma -40
+KPX Uhungarumlaut period -40
+KPX Umacron A -40
+KPX Umacron Aacute -40
+KPX Umacron Abreve -40
+KPX Umacron Acircumflex -40
+KPX Umacron Adieresis -40
+KPX Umacron Agrave -40
+KPX Umacron Amacron -40
+KPX Umacron Aogonek -40
+KPX Umacron Aring -40
+KPX Umacron Atilde -40
+KPX Umacron comma -40
+KPX Umacron period -40
+KPX Uogonek A -40
+KPX Uogonek Aacute -40
+KPX Uogonek Abreve -40
+KPX Uogonek Acircumflex -40
+KPX Uogonek Adieresis -40
+KPX Uogonek Agrave -40
+KPX Uogonek Amacron -40
+KPX Uogonek Aogonek -40
+KPX Uogonek Aring -40
+KPX Uogonek Atilde -40
+KPX Uogonek comma -40
+KPX Uogonek period -40
+KPX Uring A -40
+KPX Uring Aacute -40
+KPX Uring Abreve -40
+KPX Uring Acircumflex -40
+KPX Uring Adieresis -40
+KPX Uring Agrave -40
+KPX Uring Amacron -40
+KPX Uring Aogonek -40
+KPX Uring Aring -40
+KPX Uring Atilde -40
+KPX Uring comma -40
+KPX Uring period -40
+KPX V A -80
+KPX V Aacute -80
+KPX V Abreve -80
+KPX V Acircumflex -80
+KPX V Adieresis -80
+KPX V Agrave -80
+KPX V Amacron -80
+KPX V Aogonek -80
+KPX V Aring -80
+KPX V Atilde -80
+KPX V G -40
+KPX V Gbreve -40
+KPX V Gcommaaccent -40
+KPX V O -40
+KPX V Oacute -40
+KPX V Ocircumflex -40
+KPX V Odieresis -40
+KPX V Ograve -40
+KPX V Ohungarumlaut -40
+KPX V Omacron -40
+KPX V Oslash -40
+KPX V Otilde -40
+KPX V a -70
+KPX V aacute -70
+KPX V abreve -70
+KPX V acircumflex -70
+KPX V adieresis -70
+KPX V agrave -70
+KPX V amacron -70
+KPX V aogonek -70
+KPX V aring -70
+KPX V atilde -70
+KPX V colon -40
+KPX V comma -125
+KPX V e -80
+KPX V eacute -80
+KPX V ecaron -80
+KPX V ecircumflex -80
+KPX V edieresis -80
+KPX V edotaccent -80
+KPX V egrave -80
+KPX V emacron -80
+KPX V eogonek -80
+KPX V hyphen -80
+KPX V o -80
+KPX V oacute -80
+KPX V ocircumflex -80
+KPX V odieresis -80
+KPX V ograve -80
+KPX V ohungarumlaut -80
+KPX V omacron -80
+KPX V oslash -80
+KPX V otilde -80
+KPX V period -125
+KPX V semicolon -40
+KPX V u -70
+KPX V uacute -70
+KPX V ucircumflex -70
+KPX V udieresis -70
+KPX V ugrave -70
+KPX V uhungarumlaut -70
+KPX V umacron -70
+KPX V uogonek -70
+KPX V uring -70
+KPX W A -50
+KPX W Aacute -50
+KPX W Abreve -50
+KPX W Acircumflex -50
+KPX W Adieresis -50
+KPX W Agrave -50
+KPX W Amacron -50
+KPX W Aogonek -50
+KPX W Aring -50
+KPX W Atilde -50
+KPX W O -20
+KPX W Oacute -20
+KPX W Ocircumflex -20
+KPX W Odieresis -20
+KPX W Ograve -20
+KPX W Ohungarumlaut -20
+KPX W Omacron -20
+KPX W Oslash -20
+KPX W Otilde -20
+KPX W a -40
+KPX W aacute -40
+KPX W abreve -40
+KPX W acircumflex -40
+KPX W adieresis -40
+KPX W agrave -40
+KPX W amacron -40
+KPX W aogonek -40
+KPX W aring -40
+KPX W atilde -40
+KPX W comma -80
+KPX W e -30
+KPX W eacute -30
+KPX W ecaron -30
+KPX W ecircumflex -30
+KPX W edieresis -30
+KPX W edotaccent -30
+KPX W egrave -30
+KPX W emacron -30
+KPX W eogonek -30
+KPX W hyphen -40
+KPX W o -30
+KPX W oacute -30
+KPX W ocircumflex -30
+KPX W odieresis -30
+KPX W ograve -30
+KPX W ohungarumlaut -30
+KPX W omacron -30
+KPX W oslash -30
+KPX W otilde -30
+KPX W period -80
+KPX W u -30
+KPX W uacute -30
+KPX W ucircumflex -30
+KPX W udieresis -30
+KPX W ugrave -30
+KPX W uhungarumlaut -30
+KPX W umacron -30
+KPX W uogonek -30
+KPX W uring -30
+KPX W y -20
+KPX W yacute -20
+KPX W ydieresis -20
+KPX Y A -110
+KPX Y Aacute -110
+KPX Y Abreve -110
+KPX Y Acircumflex -110
+KPX Y Adieresis -110
+KPX Y Agrave -110
+KPX Y Amacron -110
+KPX Y Aogonek -110
+KPX Y Aring -110
+KPX Y Atilde -110
+KPX Y O -85
+KPX Y Oacute -85
+KPX Y Ocircumflex -85
+KPX Y Odieresis -85
+KPX Y Ograve -85
+KPX Y Ohungarumlaut -85
+KPX Y Omacron -85
+KPX Y Oslash -85
+KPX Y Otilde -85
+KPX Y a -140
+KPX Y aacute -140
+KPX Y abreve -70
+KPX Y acircumflex -140
+KPX Y adieresis -140
+KPX Y agrave -140
+KPX Y amacron -70
+KPX Y aogonek -140
+KPX Y aring -140
+KPX Y atilde -140
+KPX Y colon -60
+KPX Y comma -140
+KPX Y e -140
+KPX Y eacute -140
+KPX Y ecaron -140
+KPX Y ecircumflex -140
+KPX Y edieresis -140
+KPX Y edotaccent -140
+KPX Y egrave -140
+KPX Y emacron -70
+KPX Y eogonek -140
+KPX Y hyphen -140
+KPX Y i -20
+KPX Y iacute -20
+KPX Y iogonek -20
+KPX Y o -140
+KPX Y oacute -140
+KPX Y ocircumflex -140
+KPX Y odieresis -140
+KPX Y ograve -140
+KPX Y ohungarumlaut -140
+KPX Y omacron -140
+KPX Y oslash -140
+KPX Y otilde -140
+KPX Y period -140
+KPX Y semicolon -60
+KPX Y u -110
+KPX Y uacute -110
+KPX Y ucircumflex -110
+KPX Y udieresis -110
+KPX Y ugrave -110
+KPX Y uhungarumlaut -110
+KPX Y umacron -110
+KPX Y uogonek -110
+KPX Y uring -110
+KPX Yacute A -110
+KPX Yacute Aacute -110
+KPX Yacute Abreve -110
+KPX Yacute Acircumflex -110
+KPX Yacute Adieresis -110
+KPX Yacute Agrave -110
+KPX Yacute Amacron -110
+KPX Yacute Aogonek -110
+KPX Yacute Aring -110
+KPX Yacute Atilde -110
+KPX Yacute O -85
+KPX Yacute Oacute -85
+KPX Yacute Ocircumflex -85
+KPX Yacute Odieresis -85
+KPX Yacute Ograve -85
+KPX Yacute Ohungarumlaut -85
+KPX Yacute Omacron -85
+KPX Yacute Oslash -85
+KPX Yacute Otilde -85
+KPX Yacute a -140
+KPX Yacute aacute -140
+KPX Yacute abreve -70
+KPX Yacute acircumflex -140
+KPX Yacute adieresis -140
+KPX Yacute agrave -140
+KPX Yacute amacron -70
+KPX Yacute aogonek -140
+KPX Yacute aring -140
+KPX Yacute atilde -70
+KPX Yacute colon -60
+KPX Yacute comma -140
+KPX Yacute e -140
+KPX Yacute eacute -140
+KPX Yacute ecaron -140
+KPX Yacute ecircumflex -140
+KPX Yacute edieresis -140
+KPX Yacute edotaccent -140
+KPX Yacute egrave -140
+KPX Yacute emacron -70
+KPX Yacute eogonek -140
+KPX Yacute hyphen -140
+KPX Yacute i -20
+KPX Yacute iacute -20
+KPX Yacute iogonek -20
+KPX Yacute o -140
+KPX Yacute oacute -140
+KPX Yacute ocircumflex -140
+KPX Yacute odieresis -140
+KPX Yacute ograve -140
+KPX Yacute ohungarumlaut -140
+KPX Yacute omacron -70
+KPX Yacute oslash -140
+KPX Yacute otilde -140
+KPX Yacute period -140
+KPX Yacute semicolon -60
+KPX Yacute u -110
+KPX Yacute uacute -110
+KPX Yacute ucircumflex -110
+KPX Yacute udieresis -110
+KPX Yacute ugrave -110
+KPX Yacute uhungarumlaut -110
+KPX Yacute umacron -110
+KPX Yacute uogonek -110
+KPX Yacute uring -110
+KPX Ydieresis A -110
+KPX Ydieresis Aacute -110
+KPX Ydieresis Abreve -110
+KPX Ydieresis Acircumflex -110
+KPX Ydieresis Adieresis -110
+KPX Ydieresis Agrave -110
+KPX Ydieresis Amacron -110
+KPX Ydieresis Aogonek -110
+KPX Ydieresis Aring -110
+KPX Ydieresis Atilde -110
+KPX Ydieresis O -85
+KPX Ydieresis Oacute -85
+KPX Ydieresis Ocircumflex -85
+KPX Ydieresis Odieresis -85
+KPX Ydieresis Ograve -85
+KPX Ydieresis Ohungarumlaut -85
+KPX Ydieresis Omacron -85
+KPX Ydieresis Oslash -85
+KPX Ydieresis Otilde -85
+KPX Ydieresis a -140
+KPX Ydieresis aacute -140
+KPX Ydieresis abreve -70
+KPX Ydieresis acircumflex -140
+KPX Ydieresis adieresis -140
+KPX Ydieresis agrave -140
+KPX Ydieresis amacron -70
+KPX Ydieresis aogonek -140
+KPX Ydieresis aring -140
+KPX Ydieresis atilde -70
+KPX Ydieresis colon -60
+KPX Ydieresis comma -140
+KPX Ydieresis e -140
+KPX Ydieresis eacute -140
+KPX Ydieresis ecaron -140
+KPX Ydieresis ecircumflex -140
+KPX Ydieresis edieresis -140
+KPX Ydieresis edotaccent -140
+KPX Ydieresis egrave -140
+KPX Ydieresis emacron -70
+KPX Ydieresis eogonek -140
+KPX Ydieresis hyphen -140
+KPX Ydieresis i -20
+KPX Ydieresis iacute -20
+KPX Ydieresis iogonek -20
+KPX Ydieresis o -140
+KPX Ydieresis oacute -140
+KPX Ydieresis ocircumflex -140
+KPX Ydieresis odieresis -140
+KPX Ydieresis ograve -140
+KPX Ydieresis ohungarumlaut -140
+KPX Ydieresis omacron -140
+KPX Ydieresis oslash -140
+KPX Ydieresis otilde -140
+KPX Ydieresis period -140
+KPX Ydieresis semicolon -60
+KPX Ydieresis u -110
+KPX Ydieresis uacute -110
+KPX Ydieresis ucircumflex -110
+KPX Ydieresis udieresis -110
+KPX Ydieresis ugrave -110
+KPX Ydieresis uhungarumlaut -110
+KPX Ydieresis umacron -110
+KPX Ydieresis uogonek -110
+KPX Ydieresis uring -110
+KPX a v -20
+KPX a w -20
+KPX a y -30
+KPX a yacute -30
+KPX a ydieresis -30
+KPX aacute v -20
+KPX aacute w -20
+KPX aacute y -30
+KPX aacute yacute -30
+KPX aacute ydieresis -30
+KPX abreve v -20
+KPX abreve w -20
+KPX abreve y -30
+KPX abreve yacute -30
+KPX abreve ydieresis -30
+KPX acircumflex v -20
+KPX acircumflex w -20
+KPX acircumflex y -30
+KPX acircumflex yacute -30
+KPX acircumflex ydieresis -30
+KPX adieresis v -20
+KPX adieresis w -20
+KPX adieresis y -30
+KPX adieresis yacute -30
+KPX adieresis ydieresis -30
+KPX agrave v -20
+KPX agrave w -20
+KPX agrave y -30
+KPX agrave yacute -30
+KPX agrave ydieresis -30
+KPX amacron v -20
+KPX amacron w -20
+KPX amacron y -30
+KPX amacron yacute -30
+KPX amacron ydieresis -30
+KPX aogonek v -20
+KPX aogonek w -20
+KPX aogonek y -30
+KPX aogonek yacute -30
+KPX aogonek ydieresis -30
+KPX aring v -20
+KPX aring w -20
+KPX aring y -30
+KPX aring yacute -30
+KPX aring ydieresis -30
+KPX atilde v -20
+KPX atilde w -20
+KPX atilde y -30
+KPX atilde yacute -30
+KPX atilde ydieresis -30
+KPX b b -10
+KPX b comma -40
+KPX b l -20
+KPX b lacute -20
+KPX b lcommaaccent -20
+KPX b lslash -20
+KPX b period -40
+KPX b u -20
+KPX b uacute -20
+KPX b ucircumflex -20
+KPX b udieresis -20
+KPX b ugrave -20
+KPX b uhungarumlaut -20
+KPX b umacron -20
+KPX b uogonek -20
+KPX b uring -20
+KPX b v -20
+KPX b y -20
+KPX b yacute -20
+KPX b ydieresis -20
+KPX c comma -15
+KPX c k -20
+KPX c kcommaaccent -20
+KPX cacute comma -15
+KPX cacute k -20
+KPX cacute kcommaaccent -20
+KPX ccaron comma -15
+KPX ccaron k -20
+KPX ccaron kcommaaccent -20
+KPX ccedilla comma -15
+KPX ccedilla k -20
+KPX ccedilla kcommaaccent -20
+KPX colon space -50
+KPX comma quotedblright -100
+KPX comma quoteright -100
+KPX e comma -15
+KPX e period -15
+KPX e v -30
+KPX e w -20
+KPX e x -30
+KPX e y -20
+KPX e yacute -20
+KPX e ydieresis -20
+KPX eacute comma -15
+KPX eacute period -15
+KPX eacute v -30
+KPX eacute w -20
+KPX eacute x -30
+KPX eacute y -20
+KPX eacute yacute -20
+KPX eacute ydieresis -20
+KPX ecaron comma -15
+KPX ecaron period -15
+KPX ecaron v -30
+KPX ecaron w -20
+KPX ecaron x -30
+KPX ecaron y -20
+KPX ecaron yacute -20
+KPX ecaron ydieresis -20
+KPX ecircumflex comma -15
+KPX ecircumflex period -15
+KPX ecircumflex v -30
+KPX ecircumflex w -20
+KPX ecircumflex x -30
+KPX ecircumflex y -20
+KPX ecircumflex yacute -20
+KPX ecircumflex ydieresis -20
+KPX edieresis comma -15
+KPX edieresis period -15
+KPX edieresis v -30
+KPX edieresis w -20
+KPX edieresis x -30
+KPX edieresis y -20
+KPX edieresis yacute -20
+KPX edieresis ydieresis -20
+KPX edotaccent comma -15
+KPX edotaccent period -15
+KPX edotaccent v -30
+KPX edotaccent w -20
+KPX edotaccent x -30
+KPX edotaccent y -20
+KPX edotaccent yacute -20
+KPX edotaccent ydieresis -20
+KPX egrave comma -15
+KPX egrave period -15
+KPX egrave v -30
+KPX egrave w -20
+KPX egrave x -30
+KPX egrave y -20
+KPX egrave yacute -20
+KPX egrave ydieresis -20
+KPX emacron comma -15
+KPX emacron period -15
+KPX emacron v -30
+KPX emacron w -20
+KPX emacron x -30
+KPX emacron y -20
+KPX emacron yacute -20
+KPX emacron ydieresis -20
+KPX eogonek comma -15
+KPX eogonek period -15
+KPX eogonek v -30
+KPX eogonek w -20
+KPX eogonek x -30
+KPX eogonek y -20
+KPX eogonek yacute -20
+KPX eogonek ydieresis -20
+KPX f a -30
+KPX f aacute -30
+KPX f abreve -30
+KPX f acircumflex -30
+KPX f adieresis -30
+KPX f agrave -30
+KPX f amacron -30
+KPX f aogonek -30
+KPX f aring -30
+KPX f atilde -30
+KPX f comma -30
+KPX f dotlessi -28
+KPX f e -30
+KPX f eacute -30
+KPX f ecaron -30
+KPX f ecircumflex -30
+KPX f edieresis -30
+KPX f edotaccent -30
+KPX f egrave -30
+KPX f emacron -30
+KPX f eogonek -30
+KPX f o -30
+KPX f oacute -30
+KPX f ocircumflex -30
+KPX f odieresis -30
+KPX f ograve -30
+KPX f ohungarumlaut -30
+KPX f omacron -30
+KPX f oslash -30
+KPX f otilde -30
+KPX f period -30
+KPX f quotedblright 60
+KPX f quoteright 50
+KPX g r -10
+KPX g racute -10
+KPX g rcaron -10
+KPX g rcommaaccent -10
+KPX gbreve r -10
+KPX gbreve racute -10
+KPX gbreve rcaron -10
+KPX gbreve rcommaaccent -10
+KPX gcommaaccent r -10
+KPX gcommaaccent racute -10
+KPX gcommaaccent rcaron -10
+KPX gcommaaccent rcommaaccent -10
+KPX h y -30
+KPX h yacute -30
+KPX h ydieresis -30
+KPX k e -20
+KPX k eacute -20
+KPX k ecaron -20
+KPX k ecircumflex -20
+KPX k edieresis -20
+KPX k edotaccent -20
+KPX k egrave -20
+KPX k emacron -20
+KPX k eogonek -20
+KPX k o -20
+KPX k oacute -20
+KPX k ocircumflex -20
+KPX k odieresis -20
+KPX k ograve -20
+KPX k ohungarumlaut -20
+KPX k omacron -20
+KPX k oslash -20
+KPX k otilde -20
+KPX kcommaaccent e -20
+KPX kcommaaccent eacute -20
+KPX kcommaaccent ecaron -20
+KPX kcommaaccent ecircumflex -20
+KPX kcommaaccent edieresis -20
+KPX kcommaaccent edotaccent -20
+KPX kcommaaccent egrave -20
+KPX kcommaaccent emacron -20
+KPX kcommaaccent eogonek -20
+KPX kcommaaccent o -20
+KPX kcommaaccent oacute -20
+KPX kcommaaccent ocircumflex -20
+KPX kcommaaccent odieresis -20
+KPX kcommaaccent ograve -20
+KPX kcommaaccent ohungarumlaut -20
+KPX kcommaaccent omacron -20
+KPX kcommaaccent oslash -20
+KPX kcommaaccent otilde -20
+KPX m u -10
+KPX m uacute -10
+KPX m ucircumflex -10
+KPX m udieresis -10
+KPX m ugrave -10
+KPX m uhungarumlaut -10
+KPX m umacron -10
+KPX m uogonek -10
+KPX m uring -10
+KPX m y -15
+KPX m yacute -15
+KPX m ydieresis -15
+KPX n u -10
+KPX n uacute -10
+KPX n ucircumflex -10
+KPX n udieresis -10
+KPX n ugrave -10
+KPX n uhungarumlaut -10
+KPX n umacron -10
+KPX n uogonek -10
+KPX n uring -10
+KPX n v -20
+KPX n y -15
+KPX n yacute -15
+KPX n ydieresis -15
+KPX nacute u -10
+KPX nacute uacute -10
+KPX nacute ucircumflex -10
+KPX nacute udieresis -10
+KPX nacute ugrave -10
+KPX nacute uhungarumlaut -10
+KPX nacute umacron -10
+KPX nacute uogonek -10
+KPX nacute uring -10
+KPX nacute v -20
+KPX nacute y -15
+KPX nacute yacute -15
+KPX nacute ydieresis -15
+KPX ncaron u -10
+KPX ncaron uacute -10
+KPX ncaron ucircumflex -10
+KPX ncaron udieresis -10
+KPX ncaron ugrave -10
+KPX ncaron uhungarumlaut -10
+KPX ncaron umacron -10
+KPX ncaron uogonek -10
+KPX ncaron uring -10
+KPX ncaron v -20
+KPX ncaron y -15
+KPX ncaron yacute -15
+KPX ncaron ydieresis -15
+KPX ncommaaccent u -10
+KPX ncommaaccent uacute -10
+KPX ncommaaccent ucircumflex -10
+KPX ncommaaccent udieresis -10
+KPX ncommaaccent ugrave -10
+KPX ncommaaccent uhungarumlaut -10
+KPX ncommaaccent umacron -10
+KPX ncommaaccent uogonek -10
+KPX ncommaaccent uring -10
+KPX ncommaaccent v -20
+KPX ncommaaccent y -15
+KPX ncommaaccent yacute -15
+KPX ncommaaccent ydieresis -15
+KPX ntilde u -10
+KPX ntilde uacute -10
+KPX ntilde ucircumflex -10
+KPX ntilde udieresis -10
+KPX ntilde ugrave -10
+KPX ntilde uhungarumlaut -10
+KPX ntilde umacron -10
+KPX ntilde uogonek -10
+KPX ntilde uring -10
+KPX ntilde v -20
+KPX ntilde y -15
+KPX ntilde yacute -15
+KPX ntilde ydieresis -15
+KPX o comma -40
+KPX o period -40
+KPX o v -15
+KPX o w -15
+KPX o x -30
+KPX o y -30
+KPX o yacute -30
+KPX o ydieresis -30
+KPX oacute comma -40
+KPX oacute period -40
+KPX oacute v -15
+KPX oacute w -15
+KPX oacute x -30
+KPX oacute y -30
+KPX oacute yacute -30
+KPX oacute ydieresis -30
+KPX ocircumflex comma -40
+KPX ocircumflex period -40
+KPX ocircumflex v -15
+KPX ocircumflex w -15
+KPX ocircumflex x -30
+KPX ocircumflex y -30
+KPX ocircumflex yacute -30
+KPX ocircumflex ydieresis -30
+KPX odieresis comma -40
+KPX odieresis period -40
+KPX odieresis v -15
+KPX odieresis w -15
+KPX odieresis x -30
+KPX odieresis y -30
+KPX odieresis yacute -30
+KPX odieresis ydieresis -30
+KPX ograve comma -40
+KPX ograve period -40
+KPX ograve v -15
+KPX ograve w -15
+KPX ograve x -30
+KPX ograve y -30
+KPX ograve yacute -30
+KPX ograve ydieresis -30
+KPX ohungarumlaut comma -40
+KPX ohungarumlaut period -40
+KPX ohungarumlaut v -15
+KPX ohungarumlaut w -15
+KPX ohungarumlaut x -30
+KPX ohungarumlaut y -30
+KPX ohungarumlaut yacute -30
+KPX ohungarumlaut ydieresis -30
+KPX omacron comma -40
+KPX omacron period -40
+KPX omacron v -15
+KPX omacron w -15
+KPX omacron x -30
+KPX omacron y -30
+KPX omacron yacute -30
+KPX omacron ydieresis -30
+KPX oslash a -55
+KPX oslash aacute -55
+KPX oslash abreve -55
+KPX oslash acircumflex -55
+KPX oslash adieresis -55
+KPX oslash agrave -55
+KPX oslash amacron -55
+KPX oslash aogonek -55
+KPX oslash aring -55
+KPX oslash atilde -55
+KPX oslash b -55
+KPX oslash c -55
+KPX oslash cacute -55
+KPX oslash ccaron -55
+KPX oslash ccedilla -55
+KPX oslash comma -95
+KPX oslash d -55
+KPX oslash dcroat -55
+KPX oslash e -55
+KPX oslash eacute -55
+KPX oslash ecaron -55
+KPX oslash ecircumflex -55
+KPX oslash edieresis -55
+KPX oslash edotaccent -55
+KPX oslash egrave -55
+KPX oslash emacron -55
+KPX oslash eogonek -55
+KPX oslash f -55
+KPX oslash g -55
+KPX oslash gbreve -55
+KPX oslash gcommaaccent -55
+KPX oslash h -55
+KPX oslash i -55
+KPX oslash iacute -55
+KPX oslash icircumflex -55
+KPX oslash idieresis -55
+KPX oslash igrave -55
+KPX oslash imacron -55
+KPX oslash iogonek -55
+KPX oslash j -55
+KPX oslash k -55
+KPX oslash kcommaaccent -55
+KPX oslash l -55
+KPX oslash lacute -55
+KPX oslash lcommaaccent -55
+KPX oslash lslash -55
+KPX oslash m -55
+KPX oslash n -55
+KPX oslash nacute -55
+KPX oslash ncaron -55
+KPX oslash ncommaaccent -55
+KPX oslash ntilde -55
+KPX oslash o -55
+KPX oslash oacute -55
+KPX oslash ocircumflex -55
+KPX oslash odieresis -55
+KPX oslash ograve -55
+KPX oslash ohungarumlaut -55
+KPX oslash omacron -55
+KPX oslash oslash -55
+KPX oslash otilde -55
+KPX oslash p -55
+KPX oslash period -95
+KPX oslash q -55
+KPX oslash r -55
+KPX oslash racute -55
+KPX oslash rcaron -55
+KPX oslash rcommaaccent -55
+KPX oslash s -55
+KPX oslash sacute -55
+KPX oslash scaron -55
+KPX oslash scedilla -55
+KPX oslash scommaaccent -55
+KPX oslash t -55
+KPX oslash tcommaaccent -55
+KPX oslash u -55
+KPX oslash uacute -55
+KPX oslash ucircumflex -55
+KPX oslash udieresis -55
+KPX oslash ugrave -55
+KPX oslash uhungarumlaut -55
+KPX oslash umacron -55
+KPX oslash uogonek -55
+KPX oslash uring -55
+KPX oslash v -70
+KPX oslash w -70
+KPX oslash x -85
+KPX oslash y -70
+KPX oslash yacute -70
+KPX oslash ydieresis -70
+KPX oslash z -55
+KPX oslash zacute -55
+KPX oslash zcaron -55
+KPX oslash zdotaccent -55
+KPX otilde comma -40
+KPX otilde period -40
+KPX otilde v -15
+KPX otilde w -15
+KPX otilde x -30
+KPX otilde y -30
+KPX otilde yacute -30
+KPX otilde ydieresis -30
+KPX p comma -35
+KPX p period -35
+KPX p y -30
+KPX p yacute -30
+KPX p ydieresis -30
+KPX period quotedblright -100
+KPX period quoteright -100
+KPX period space -60
+KPX quotedblright space -40
+KPX quoteleft quoteleft -57
+KPX quoteright d -50
+KPX quoteright dcroat -50
+KPX quoteright quoteright -57
+KPX quoteright r -50
+KPX quoteright racute -50
+KPX quoteright rcaron -50
+KPX quoteright rcommaaccent -50
+KPX quoteright s -50
+KPX quoteright sacute -50
+KPX quoteright scaron -50
+KPX quoteright scedilla -50
+KPX quoteright scommaaccent -50
+KPX quoteright space -70
+KPX r a -10
+KPX r aacute -10
+KPX r abreve -10
+KPX r acircumflex -10
+KPX r adieresis -10
+KPX r agrave -10
+KPX r amacron -10
+KPX r aogonek -10
+KPX r aring -10
+KPX r atilde -10
+KPX r colon 30
+KPX r comma -50
+KPX r i 15
+KPX r iacute 15
+KPX r icircumflex 15
+KPX r idieresis 15
+KPX r igrave 15
+KPX r imacron 15
+KPX r iogonek 15
+KPX r k 15
+KPX r kcommaaccent 15
+KPX r l 15
+KPX r lacute 15
+KPX r lcommaaccent 15
+KPX r lslash 15
+KPX r m 25
+KPX r n 25
+KPX r nacute 25
+KPX r ncaron 25
+KPX r ncommaaccent 25
+KPX r ntilde 25
+KPX r p 30
+KPX r period -50
+KPX r semicolon 30
+KPX r t 40
+KPX r tcommaaccent 40
+KPX r u 15
+KPX r uacute 15
+KPX r ucircumflex 15
+KPX r udieresis 15
+KPX r ugrave 15
+KPX r uhungarumlaut 15
+KPX r umacron 15
+KPX r uogonek 15
+KPX r uring 15
+KPX r v 30
+KPX r y 30
+KPX r yacute 30
+KPX r ydieresis 30
+KPX racute a -10
+KPX racute aacute -10
+KPX racute abreve -10
+KPX racute acircumflex -10
+KPX racute adieresis -10
+KPX racute agrave -10
+KPX racute amacron -10
+KPX racute aogonek -10
+KPX racute aring -10
+KPX racute atilde -10
+KPX racute colon 30
+KPX racute comma -50
+KPX racute i 15
+KPX racute iacute 15
+KPX racute icircumflex 15
+KPX racute idieresis 15
+KPX racute igrave 15
+KPX racute imacron 15
+KPX racute iogonek 15
+KPX racute k 15
+KPX racute kcommaaccent 15
+KPX racute l 15
+KPX racute lacute 15
+KPX racute lcommaaccent 15
+KPX racute lslash 15
+KPX racute m 25
+KPX racute n 25
+KPX racute nacute 25
+KPX racute ncaron 25
+KPX racute ncommaaccent 25
+KPX racute ntilde 25
+KPX racute p 30
+KPX racute period -50
+KPX racute semicolon 30
+KPX racute t 40
+KPX racute tcommaaccent 40
+KPX racute u 15
+KPX racute uacute 15
+KPX racute ucircumflex 15
+KPX racute udieresis 15
+KPX racute ugrave 15
+KPX racute uhungarumlaut 15
+KPX racute umacron 15
+KPX racute uogonek 15
+KPX racute uring 15
+KPX racute v 30
+KPX racute y 30
+KPX racute yacute 30
+KPX racute ydieresis 30
+KPX rcaron a -10
+KPX rcaron aacute -10
+KPX rcaron abreve -10
+KPX rcaron acircumflex -10
+KPX rcaron adieresis -10
+KPX rcaron agrave -10
+KPX rcaron amacron -10
+KPX rcaron aogonek -10
+KPX rcaron aring -10
+KPX rcaron atilde -10
+KPX rcaron colon 30
+KPX rcaron comma -50
+KPX rcaron i 15
+KPX rcaron iacute 15
+KPX rcaron icircumflex 15
+KPX rcaron idieresis 15
+KPX rcaron igrave 15
+KPX rcaron imacron 15
+KPX rcaron iogonek 15
+KPX rcaron k 15
+KPX rcaron kcommaaccent 15
+KPX rcaron l 15
+KPX rcaron lacute 15
+KPX rcaron lcommaaccent 15
+KPX rcaron lslash 15
+KPX rcaron m 25
+KPX rcaron n 25
+KPX rcaron nacute 25
+KPX rcaron ncaron 25
+KPX rcaron ncommaaccent 25
+KPX rcaron ntilde 25
+KPX rcaron p 30
+KPX rcaron period -50
+KPX rcaron semicolon 30
+KPX rcaron t 40
+KPX rcaron tcommaaccent 40
+KPX rcaron u 15
+KPX rcaron uacute 15
+KPX rcaron ucircumflex 15
+KPX rcaron udieresis 15
+KPX rcaron ugrave 15
+KPX rcaron uhungarumlaut 15
+KPX rcaron umacron 15
+KPX rcaron uogonek 15
+KPX rcaron uring 15
+KPX rcaron v 30
+KPX rcaron y 30
+KPX rcaron yacute 30
+KPX rcaron ydieresis 30
+KPX rcommaaccent a -10
+KPX rcommaaccent aacute -10
+KPX rcommaaccent abreve -10
+KPX rcommaaccent acircumflex -10
+KPX rcommaaccent adieresis -10
+KPX rcommaaccent agrave -10
+KPX rcommaaccent amacron -10
+KPX rcommaaccent aogonek -10
+KPX rcommaaccent aring -10
+KPX rcommaaccent atilde -10
+KPX rcommaaccent colon 30
+KPX rcommaaccent comma -50
+KPX rcommaaccent i 15
+KPX rcommaaccent iacute 15
+KPX rcommaaccent icircumflex 15
+KPX rcommaaccent idieresis 15
+KPX rcommaaccent igrave 15
+KPX rcommaaccent imacron 15
+KPX rcommaaccent iogonek 15
+KPX rcommaaccent k 15
+KPX rcommaaccent kcommaaccent 15
+KPX rcommaaccent l 15
+KPX rcommaaccent lacute 15
+KPX rcommaaccent lcommaaccent 15
+KPX rcommaaccent lslash 15
+KPX rcommaaccent m 25
+KPX rcommaaccent n 25
+KPX rcommaaccent nacute 25
+KPX rcommaaccent ncaron 25
+KPX rcommaaccent ncommaaccent 25
+KPX rcommaaccent ntilde 25
+KPX rcommaaccent p 30
+KPX rcommaaccent period -50
+KPX rcommaaccent semicolon 30
+KPX rcommaaccent t 40
+KPX rcommaaccent tcommaaccent 40
+KPX rcommaaccent u 15
+KPX rcommaaccent uacute 15
+KPX rcommaaccent ucircumflex 15
+KPX rcommaaccent udieresis 15
+KPX rcommaaccent ugrave 15
+KPX rcommaaccent uhungarumlaut 15
+KPX rcommaaccent umacron 15
+KPX rcommaaccent uogonek 15
+KPX rcommaaccent uring 15
+KPX rcommaaccent v 30
+KPX rcommaaccent y 30
+KPX rcommaaccent yacute 30
+KPX rcommaaccent ydieresis 30
+KPX s comma -15
+KPX s period -15
+KPX s w -30
+KPX sacute comma -15
+KPX sacute period -15
+KPX sacute w -30
+KPX scaron comma -15
+KPX scaron period -15
+KPX scaron w -30
+KPX scedilla comma -15
+KPX scedilla period -15
+KPX scedilla w -30
+KPX scommaaccent comma -15
+KPX scommaaccent period -15
+KPX scommaaccent w -30
+KPX semicolon space -50
+KPX space T -50
+KPX space Tcaron -50
+KPX space Tcommaaccent -50
+KPX space V -50
+KPX space W -40
+KPX space Y -90
+KPX space Yacute -90
+KPX space Ydieresis -90
+KPX space quotedblleft -30
+KPX space quoteleft -60
+KPX v a -25
+KPX v aacute -25
+KPX v abreve -25
+KPX v acircumflex -25
+KPX v adieresis -25
+KPX v agrave -25
+KPX v amacron -25
+KPX v aogonek -25
+KPX v aring -25
+KPX v atilde -25
+KPX v comma -80
+KPX v e -25
+KPX v eacute -25
+KPX v ecaron -25
+KPX v ecircumflex -25
+KPX v edieresis -25
+KPX v edotaccent -25
+KPX v egrave -25
+KPX v emacron -25
+KPX v eogonek -25
+KPX v o -25
+KPX v oacute -25
+KPX v ocircumflex -25
+KPX v odieresis -25
+KPX v ograve -25
+KPX v ohungarumlaut -25
+KPX v omacron -25
+KPX v oslash -25
+KPX v otilde -25
+KPX v period -80
+KPX w a -15
+KPX w aacute -15
+KPX w abreve -15
+KPX w acircumflex -15
+KPX w adieresis -15
+KPX w agrave -15
+KPX w amacron -15
+KPX w aogonek -15
+KPX w aring -15
+KPX w atilde -15
+KPX w comma -60
+KPX w e -10
+KPX w eacute -10
+KPX w ecaron -10
+KPX w ecircumflex -10
+KPX w edieresis -10
+KPX w edotaccent -10
+KPX w egrave -10
+KPX w emacron -10
+KPX w eogonek -10
+KPX w o -10
+KPX w oacute -10
+KPX w ocircumflex -10
+KPX w odieresis -10
+KPX w ograve -10
+KPX w ohungarumlaut -10
+KPX w omacron -10
+KPX w oslash -10
+KPX w otilde -10
+KPX w period -60
+KPX x e -30
+KPX x eacute -30
+KPX x ecaron -30
+KPX x ecircumflex -30
+KPX x edieresis -30
+KPX x edotaccent -30
+KPX x egrave -30
+KPX x emacron -30
+KPX x eogonek -30
+KPX y a -20
+KPX y aacute -20
+KPX y abreve -20
+KPX y acircumflex -20
+KPX y adieresis -20
+KPX y agrave -20
+KPX y amacron -20
+KPX y aogonek -20
+KPX y aring -20
+KPX y atilde -20
+KPX y comma -100
+KPX y e -20
+KPX y eacute -20
+KPX y ecaron -20
+KPX y ecircumflex -20
+KPX y edieresis -20
+KPX y edotaccent -20
+KPX y egrave -20
+KPX y emacron -20
+KPX y eogonek -20
+KPX y o -20
+KPX y oacute -20
+KPX y ocircumflex -20
+KPX y odieresis -20
+KPX y ograve -20
+KPX y ohungarumlaut -20
+KPX y omacron -20
+KPX y oslash -20
+KPX y otilde -20
+KPX y period -100
+KPX yacute a -20
+KPX yacute aacute -20
+KPX yacute abreve -20
+KPX yacute acircumflex -20
+KPX yacute adieresis -20
+KPX yacute agrave -20
+KPX yacute amacron -20
+KPX yacute aogonek -20
+KPX yacute aring -20
+KPX yacute atilde -20
+KPX yacute comma -100
+KPX yacute e -20
+KPX yacute eacute -20
+KPX yacute ecaron -20
+KPX yacute ecircumflex -20
+KPX yacute edieresis -20
+KPX yacute edotaccent -20
+KPX yacute egrave -20
+KPX yacute emacron -20
+KPX yacute eogonek -20
+KPX yacute o -20
+KPX yacute oacute -20
+KPX yacute ocircumflex -20
+KPX yacute odieresis -20
+KPX yacute ograve -20
+KPX yacute ohungarumlaut -20
+KPX yacute omacron -20
+KPX yacute oslash -20
+KPX yacute otilde -20
+KPX yacute period -100
+KPX ydieresis a -20
+KPX ydieresis aacute -20
+KPX ydieresis abreve -20
+KPX ydieresis acircumflex -20
+KPX ydieresis adieresis -20
+KPX ydieresis agrave -20
+KPX ydieresis amacron -20
+KPX ydieresis aogonek -20
+KPX ydieresis aring -20
+KPX ydieresis atilde -20
+KPX ydieresis comma -100
+KPX ydieresis e -20
+KPX ydieresis eacute -20
+KPX ydieresis ecaron -20
+KPX ydieresis ecircumflex -20
+KPX ydieresis edieresis -20
+KPX ydieresis edotaccent -20
+KPX ydieresis egrave -20
+KPX ydieresis emacron -20
+KPX ydieresis eogonek -20
+KPX ydieresis o -20
+KPX ydieresis oacute -20
+KPX ydieresis ocircumflex -20
+KPX ydieresis odieresis -20
+KPX ydieresis ograve -20
+KPX ydieresis ohungarumlaut -20
+KPX ydieresis omacron -20
+KPX ydieresis oslash -20
+KPX ydieresis otilde -20
+KPX ydieresis period -100
+KPX z e -15
+KPX z eacute -15
+KPX z ecaron -15
+KPX z ecircumflex -15
+KPX z edieresis -15
+KPX z edotaccent -15
+KPX z egrave -15
+KPX z emacron -15
+KPX z eogonek -15
+KPX z o -15
+KPX z oacute -15
+KPX z ocircumflex -15
+KPX z odieresis -15
+KPX z ograve -15
+KPX z ohungarumlaut -15
+KPX z omacron -15
+KPX z oslash -15
+KPX z otilde -15
+KPX zacute e -15
+KPX zacute eacute -15
+KPX zacute ecaron -15
+KPX zacute ecircumflex -15
+KPX zacute edieresis -15
+KPX zacute edotaccent -15
+KPX zacute egrave -15
+KPX zacute emacron -15
+KPX zacute eogonek -15
+KPX zacute o -15
+KPX zacute oacute -15
+KPX zacute ocircumflex -15
+KPX zacute odieresis -15
+KPX zacute ograve -15
+KPX zacute ohungarumlaut -15
+KPX zacute omacron -15
+KPX zacute oslash -15
+KPX zacute otilde -15
+KPX zcaron e -15
+KPX zcaron eacute -15
+KPX zcaron ecaron -15
+KPX zcaron ecircumflex -15
+KPX zcaron edieresis -15
+KPX zcaron edotaccent -15
+KPX zcaron egrave -15
+KPX zcaron emacron -15
+KPX zcaron eogonek -15
+KPX zcaron o -15
+KPX zcaron oacute -15
+KPX zcaron ocircumflex -15
+KPX zcaron odieresis -15
+KPX zcaron ograve -15
+KPX zcaron ohungarumlaut -15
+KPX zcaron omacron -15
+KPX zcaron oslash -15
+KPX zcaron otilde -15
+KPX zdotaccent e -15
+KPX zdotaccent eacute -15
+KPX zdotaccent ecaron -15
+KPX zdotaccent ecircumflex -15
+KPX zdotaccent edieresis -15
+KPX zdotaccent edotaccent -15
+KPX zdotaccent egrave -15
+KPX zdotaccent emacron -15
+KPX zdotaccent eogonek -15
+KPX zdotaccent o -15
+KPX zdotaccent oacute -15
+KPX zdotaccent ocircumflex -15
+KPX zdotaccent odieresis -15
+KPX zdotaccent ograve -15
+KPX zdotaccent ohungarumlaut -15
+KPX zdotaccent omacron -15
+KPX zdotaccent oslash -15
+KPX zdotaccent otilde -15
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Symbol.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Symbol.afm
new file mode 100644
index 0000000000000000000000000000000000000000..6a5386a9190eda3d7e9d4b49cfa7a6dd971c9e70
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Symbol.afm
@@ -0,0 +1,213 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All rights reserved.
+Comment Creation Date: Thu May 1 15:12:25 1997
+Comment UniqueID 43064
+Comment VMusage 30820 39997
+FontName Symbol
+FullName Symbol
+FamilyName Symbol
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+CharacterSet Special
+FontBBox -180 -293 1090 1010
+UnderlinePosition -100
+UnderlineThickness 50
+Version 001.008
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1997 Adobe Systems Incorporated. All rights reserved.
+EncodingScheme FontSpecific
+StdHW 92
+StdVW 85
+StartCharMetrics 190
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 128 -17 240 672 ;
+C 34 ; WX 713 ; N universal ; B 31 0 681 705 ;
+C 35 ; WX 500 ; N numbersign ; B 20 -16 481 673 ;
+C 36 ; WX 549 ; N existential ; B 25 0 478 707 ;
+C 37 ; WX 833 ; N percent ; B 63 -36 771 655 ;
+C 38 ; WX 778 ; N ampersand ; B 41 -18 750 661 ;
+C 39 ; WX 439 ; N suchthat ; B 48 -17 414 500 ;
+C 40 ; WX 333 ; N parenleft ; B 53 -191 300 673 ;
+C 41 ; WX 333 ; N parenright ; B 30 -191 277 673 ;
+C 42 ; WX 500 ; N asteriskmath ; B 65 134 427 551 ;
+C 43 ; WX 549 ; N plus ; B 10 0 539 533 ;
+C 44 ; WX 250 ; N comma ; B 56 -152 194 104 ;
+C 45 ; WX 549 ; N minus ; B 11 233 535 288 ;
+C 46 ; WX 250 ; N period ; B 69 -17 181 95 ;
+C 47 ; WX 278 ; N slash ; B 0 -18 254 646 ;
+C 48 ; WX 500 ; N zero ; B 24 -14 476 685 ;
+C 49 ; WX 500 ; N one ; B 117 0 390 673 ;
+C 50 ; WX 500 ; N two ; B 25 0 475 685 ;
+C 51 ; WX 500 ; N three ; B 43 -14 435 685 ;
+C 52 ; WX 500 ; N four ; B 15 0 469 685 ;
+C 53 ; WX 500 ; N five ; B 32 -14 445 690 ;
+C 54 ; WX 500 ; N six ; B 34 -14 468 685 ;
+C 55 ; WX 500 ; N seven ; B 24 -16 448 673 ;
+C 56 ; WX 500 ; N eight ; B 56 -14 445 685 ;
+C 57 ; WX 500 ; N nine ; B 30 -18 459 685 ;
+C 58 ; WX 278 ; N colon ; B 81 -17 193 460 ;
+C 59 ; WX 278 ; N semicolon ; B 83 -152 221 460 ;
+C 60 ; WX 549 ; N less ; B 26 0 523 522 ;
+C 61 ; WX 549 ; N equal ; B 11 141 537 390 ;
+C 62 ; WX 549 ; N greater ; B 26 0 523 522 ;
+C 63 ; WX 444 ; N question ; B 70 -17 412 686 ;
+C 64 ; WX 549 ; N congruent ; B 11 0 537 475 ;
+C 65 ; WX 722 ; N Alpha ; B 4 0 684 673 ;
+C 66 ; WX 667 ; N Beta ; B 29 0 592 673 ;
+C 67 ; WX 722 ; N Chi ; B -9 0 704 673 ;
+C 68 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C 69 ; WX 611 ; N Epsilon ; B 32 0 617 673 ;
+C 70 ; WX 763 ; N Phi ; B 26 0 741 673 ;
+C 71 ; WX 603 ; N Gamma ; B 24 0 609 673 ;
+C 72 ; WX 722 ; N Eta ; B 39 0 729 673 ;
+C 73 ; WX 333 ; N Iota ; B 32 0 316 673 ;
+C 74 ; WX 631 ; N theta1 ; B 18 -18 623 689 ;
+C 75 ; WX 722 ; N Kappa ; B 35 0 722 673 ;
+C 76 ; WX 686 ; N Lambda ; B 6 0 680 688 ;
+C 77 ; WX 889 ; N Mu ; B 28 0 887 673 ;
+C 78 ; WX 722 ; N Nu ; B 29 -8 720 673 ;
+C 79 ; WX 722 ; N Omicron ; B 41 -17 715 685 ;
+C 80 ; WX 768 ; N Pi ; B 25 0 745 673 ;
+C 81 ; WX 741 ; N Theta ; B 41 -17 715 685 ;
+C 82 ; WX 556 ; N Rho ; B 28 0 563 673 ;
+C 83 ; WX 592 ; N Sigma ; B 5 0 589 673 ;
+C 84 ; WX 611 ; N Tau ; B 33 0 607 673 ;
+C 85 ; WX 690 ; N Upsilon ; B -8 0 694 673 ;
+C 86 ; WX 439 ; N sigma1 ; B 40 -233 436 500 ;
+C 87 ; WX 768 ; N Omega ; B 34 0 736 688 ;
+C 88 ; WX 645 ; N Xi ; B 40 0 599 673 ;
+C 89 ; WX 795 ; N Psi ; B 15 0 781 684 ;
+C 90 ; WX 611 ; N Zeta ; B 44 0 636 673 ;
+C 91 ; WX 333 ; N bracketleft ; B 86 -155 299 674 ;
+C 92 ; WX 863 ; N therefore ; B 163 0 701 487 ;
+C 93 ; WX 333 ; N bracketright ; B 33 -155 246 674 ;
+C 94 ; WX 658 ; N perpendicular ; B 15 0 652 674 ;
+C 95 ; WX 500 ; N underscore ; B -2 -125 502 -75 ;
+C 96 ; WX 500 ; N radicalex ; B 480 881 1090 917 ;
+C 97 ; WX 631 ; N alpha ; B 41 -18 622 500 ;
+C 98 ; WX 549 ; N beta ; B 61 -223 515 741 ;
+C 99 ; WX 549 ; N chi ; B 12 -231 522 499 ;
+C 100 ; WX 494 ; N delta ; B 40 -19 481 740 ;
+C 101 ; WX 439 ; N epsilon ; B 22 -19 427 502 ;
+C 102 ; WX 521 ; N phi ; B 28 -224 492 673 ;
+C 103 ; WX 411 ; N gamma ; B 5 -225 484 499 ;
+C 104 ; WX 603 ; N eta ; B 0 -202 527 514 ;
+C 105 ; WX 329 ; N iota ; B 0 -17 301 503 ;
+C 106 ; WX 603 ; N phi1 ; B 36 -224 587 499 ;
+C 107 ; WX 549 ; N kappa ; B 33 0 558 501 ;
+C 108 ; WX 549 ; N lambda ; B 24 -17 548 739 ;
+C 109 ; WX 576 ; N mu ; B 33 -223 567 500 ;
+C 110 ; WX 521 ; N nu ; B -9 -16 475 507 ;
+C 111 ; WX 549 ; N omicron ; B 35 -19 501 499 ;
+C 112 ; WX 549 ; N pi ; B 10 -19 530 487 ;
+C 113 ; WX 521 ; N theta ; B 43 -17 485 690 ;
+C 114 ; WX 549 ; N rho ; B 50 -230 490 499 ;
+C 115 ; WX 603 ; N sigma ; B 30 -21 588 500 ;
+C 116 ; WX 439 ; N tau ; B 10 -19 418 500 ;
+C 117 ; WX 576 ; N upsilon ; B 7 -18 535 507 ;
+C 118 ; WX 713 ; N omega1 ; B 12 -18 671 583 ;
+C 119 ; WX 686 ; N omega ; B 42 -17 684 500 ;
+C 120 ; WX 493 ; N xi ; B 27 -224 469 766 ;
+C 121 ; WX 686 ; N psi ; B 12 -228 701 500 ;
+C 122 ; WX 494 ; N zeta ; B 60 -225 467 756 ;
+C 123 ; WX 480 ; N braceleft ; B 58 -183 397 673 ;
+C 124 ; WX 200 ; N bar ; B 65 -293 135 707 ;
+C 125 ; WX 480 ; N braceright ; B 79 -183 418 673 ;
+C 126 ; WX 549 ; N similar ; B 17 203 529 307 ;
+C 160 ; WX 750 ; N Euro ; B 20 -12 714 685 ;
+C 161 ; WX 620 ; N Upsilon1 ; B -2 0 610 685 ;
+C 162 ; WX 247 ; N minute ; B 27 459 228 735 ;
+C 163 ; WX 549 ; N lessequal ; B 29 0 526 639 ;
+C 164 ; WX 167 ; N fraction ; B -180 -12 340 677 ;
+C 165 ; WX 713 ; N infinity ; B 26 124 688 404 ;
+C 166 ; WX 500 ; N florin ; B 2 -193 494 686 ;
+C 167 ; WX 753 ; N club ; B 86 -26 660 533 ;
+C 168 ; WX 753 ; N diamond ; B 142 -36 600 550 ;
+C 169 ; WX 753 ; N heart ; B 117 -33 631 532 ;
+C 170 ; WX 753 ; N spade ; B 113 -36 629 548 ;
+C 171 ; WX 1042 ; N arrowboth ; B 24 -15 1024 511 ;
+C 172 ; WX 987 ; N arrowleft ; B 32 -15 942 511 ;
+C 173 ; WX 603 ; N arrowup ; B 45 0 571 910 ;
+C 174 ; WX 987 ; N arrowright ; B 49 -15 959 511 ;
+C 175 ; WX 603 ; N arrowdown ; B 45 -22 571 888 ;
+C 176 ; WX 400 ; N degree ; B 50 385 350 685 ;
+C 177 ; WX 549 ; N plusminus ; B 10 0 539 645 ;
+C 178 ; WX 411 ; N second ; B 20 459 413 737 ;
+C 179 ; WX 549 ; N greaterequal ; B 29 0 526 639 ;
+C 180 ; WX 549 ; N multiply ; B 17 8 533 524 ;
+C 181 ; WX 713 ; N proportional ; B 27 123 639 404 ;
+C 182 ; WX 494 ; N partialdiff ; B 26 -20 462 746 ;
+C 183 ; WX 460 ; N bullet ; B 50 113 410 473 ;
+C 184 ; WX 549 ; N divide ; B 10 71 536 456 ;
+C 185 ; WX 549 ; N notequal ; B 15 -25 540 549 ;
+C 186 ; WX 549 ; N equivalence ; B 14 82 538 443 ;
+C 187 ; WX 549 ; N approxequal ; B 14 135 527 394 ;
+C 188 ; WX 1000 ; N ellipsis ; B 111 -17 889 95 ;
+C 189 ; WX 603 ; N arrowvertex ; B 280 -120 336 1010 ;
+C 190 ; WX 1000 ; N arrowhorizex ; B -60 220 1050 276 ;
+C 191 ; WX 658 ; N carriagereturn ; B 15 -16 602 629 ;
+C 192 ; WX 823 ; N aleph ; B 175 -18 661 658 ;
+C 193 ; WX 686 ; N Ifraktur ; B 10 -53 578 740 ;
+C 194 ; WX 795 ; N Rfraktur ; B 26 -15 759 734 ;
+C 195 ; WX 987 ; N weierstrass ; B 159 -211 870 573 ;
+C 196 ; WX 768 ; N circlemultiply ; B 43 -17 733 673 ;
+C 197 ; WX 768 ; N circleplus ; B 43 -15 733 675 ;
+C 198 ; WX 823 ; N emptyset ; B 39 -24 781 719 ;
+C 199 ; WX 768 ; N intersection ; B 40 0 732 509 ;
+C 200 ; WX 768 ; N union ; B 40 -17 732 492 ;
+C 201 ; WX 713 ; N propersuperset ; B 20 0 673 470 ;
+C 202 ; WX 713 ; N reflexsuperset ; B 20 -125 673 470 ;
+C 203 ; WX 713 ; N notsubset ; B 36 -70 690 540 ;
+C 204 ; WX 713 ; N propersubset ; B 37 0 690 470 ;
+C 205 ; WX 713 ; N reflexsubset ; B 37 -125 690 470 ;
+C 206 ; WX 713 ; N element ; B 45 0 505 468 ;
+C 207 ; WX 713 ; N notelement ; B 45 -58 505 555 ;
+C 208 ; WX 768 ; N angle ; B 26 0 738 673 ;
+C 209 ; WX 713 ; N gradient ; B 36 -19 681 718 ;
+C 210 ; WX 790 ; N registerserif ; B 50 -17 740 673 ;
+C 211 ; WX 790 ; N copyrightserif ; B 51 -15 741 675 ;
+C 212 ; WX 890 ; N trademarkserif ; B 18 293 855 673 ;
+C 213 ; WX 823 ; N product ; B 25 -101 803 751 ;
+C 214 ; WX 549 ; N radical ; B 10 -38 515 917 ;
+C 215 ; WX 250 ; N dotmath ; B 69 210 169 310 ;
+C 216 ; WX 713 ; N logicalnot ; B 15 0 680 288 ;
+C 217 ; WX 603 ; N logicaland ; B 23 0 583 454 ;
+C 218 ; WX 603 ; N logicalor ; B 30 0 578 477 ;
+C 219 ; WX 1042 ; N arrowdblboth ; B 27 -20 1023 510 ;
+C 220 ; WX 987 ; N arrowdblleft ; B 30 -15 939 513 ;
+C 221 ; WX 603 ; N arrowdblup ; B 39 2 567 911 ;
+C 222 ; WX 987 ; N arrowdblright ; B 45 -20 954 508 ;
+C 223 ; WX 603 ; N arrowdbldown ; B 44 -19 572 890 ;
+C 224 ; WX 494 ; N lozenge ; B 18 0 466 745 ;
+C 225 ; WX 329 ; N angleleft ; B 25 -198 306 746 ;
+C 226 ; WX 790 ; N registersans ; B 50 -20 740 670 ;
+C 227 ; WX 790 ; N copyrightsans ; B 49 -15 739 675 ;
+C 228 ; WX 786 ; N trademarksans ; B 5 293 725 673 ;
+C 229 ; WX 713 ; N summation ; B 14 -108 695 752 ;
+C 230 ; WX 384 ; N parenlefttp ; B 24 -293 436 926 ;
+C 231 ; WX 384 ; N parenleftex ; B 24 -85 108 925 ;
+C 232 ; WX 384 ; N parenleftbt ; B 24 -293 436 926 ;
+C 233 ; WX 384 ; N bracketlefttp ; B 0 -80 349 926 ;
+C 234 ; WX 384 ; N bracketleftex ; B 0 -79 77 925 ;
+C 235 ; WX 384 ; N bracketleftbt ; B 0 -80 349 926 ;
+C 236 ; WX 494 ; N bracelefttp ; B 209 -85 445 925 ;
+C 237 ; WX 494 ; N braceleftmid ; B 20 -85 284 935 ;
+C 238 ; WX 494 ; N braceleftbt ; B 209 -75 445 935 ;
+C 239 ; WX 494 ; N braceex ; B 209 -85 284 935 ;
+C 241 ; WX 329 ; N angleright ; B 21 -198 302 746 ;
+C 242 ; WX 274 ; N integral ; B 2 -107 291 916 ;
+C 243 ; WX 686 ; N integraltp ; B 308 -88 675 920 ;
+C 244 ; WX 686 ; N integralex ; B 308 -88 378 975 ;
+C 245 ; WX 686 ; N integralbt ; B 11 -87 378 921 ;
+C 246 ; WX 384 ; N parenrighttp ; B 54 -293 466 926 ;
+C 247 ; WX 384 ; N parenrightex ; B 382 -85 466 925 ;
+C 248 ; WX 384 ; N parenrightbt ; B 54 -293 466 926 ;
+C 249 ; WX 384 ; N bracketrighttp ; B 22 -80 371 926 ;
+C 250 ; WX 384 ; N bracketrightex ; B 294 -79 371 925 ;
+C 251 ; WX 384 ; N bracketrightbt ; B 22 -80 371 926 ;
+C 252 ; WX 494 ; N bracerighttp ; B 48 -85 284 925 ;
+C 253 ; WX 494 ; N bracerightmid ; B 209 -85 473 935 ;
+C 254 ; WX 494 ; N bracerightbt ; B 48 -75 284 935 ;
+C -1 ; WX 790 ; N apple ; B 56 -3 733 808 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Bold.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Bold.afm
new file mode 100644
index 0000000000000000000000000000000000000000..559ebaeb6f099c547502c0e5186df745e36774a7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Bold.afm
@@ -0,0 +1,2588 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 12:52:56 1997
+Comment UniqueID 43065
+Comment VMusage 41636 52661
+FontName Times-Bold
+FullName Times Bold
+FamilyName Times
+Weight Bold
+ItalicAngle 0
+IsFixedPitch false
+CharacterSet ExtendedRoman
+FontBBox -168 -218 1000 935
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype-Hell AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 676
+XHeight 461
+Ascender 683
+Descender -217
+StdHW 44
+StdVW 139
+StartCharMetrics 315
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 81 -13 251 691 ;
+C 34 ; WX 555 ; N quotedbl ; B 83 404 472 691 ;
+C 35 ; WX 500 ; N numbersign ; B 4 0 496 700 ;
+C 36 ; WX 500 ; N dollar ; B 29 -99 472 750 ;
+C 37 ; WX 1000 ; N percent ; B 124 -14 877 692 ;
+C 38 ; WX 833 ; N ampersand ; B 62 -16 787 691 ;
+C 39 ; WX 333 ; N quoteright ; B 79 356 263 691 ;
+C 40 ; WX 333 ; N parenleft ; B 46 -168 306 694 ;
+C 41 ; WX 333 ; N parenright ; B 27 -168 287 694 ;
+C 42 ; WX 500 ; N asterisk ; B 56 255 447 691 ;
+C 43 ; WX 570 ; N plus ; B 33 0 537 506 ;
+C 44 ; WX 250 ; N comma ; B 39 -180 223 155 ;
+C 45 ; WX 333 ; N hyphen ; B 44 171 287 287 ;
+C 46 ; WX 250 ; N period ; B 41 -13 210 156 ;
+C 47 ; WX 278 ; N slash ; B -24 -19 302 691 ;
+C 48 ; WX 500 ; N zero ; B 24 -13 476 688 ;
+C 49 ; WX 500 ; N one ; B 65 0 442 688 ;
+C 50 ; WX 500 ; N two ; B 17 0 478 688 ;
+C 51 ; WX 500 ; N three ; B 16 -14 468 688 ;
+C 52 ; WX 500 ; N four ; B 19 0 475 688 ;
+C 53 ; WX 500 ; N five ; B 22 -8 470 676 ;
+C 54 ; WX 500 ; N six ; B 28 -13 475 688 ;
+C 55 ; WX 500 ; N seven ; B 17 0 477 676 ;
+C 56 ; WX 500 ; N eight ; B 28 -13 472 688 ;
+C 57 ; WX 500 ; N nine ; B 26 -13 473 688 ;
+C 58 ; WX 333 ; N colon ; B 82 -13 251 472 ;
+C 59 ; WX 333 ; N semicolon ; B 82 -180 266 472 ;
+C 60 ; WX 570 ; N less ; B 31 -8 539 514 ;
+C 61 ; WX 570 ; N equal ; B 33 107 537 399 ;
+C 62 ; WX 570 ; N greater ; B 31 -8 539 514 ;
+C 63 ; WX 500 ; N question ; B 57 -13 445 689 ;
+C 64 ; WX 930 ; N at ; B 108 -19 822 691 ;
+C 65 ; WX 722 ; N A ; B 9 0 689 690 ;
+C 66 ; WX 667 ; N B ; B 16 0 619 676 ;
+C 67 ; WX 722 ; N C ; B 49 -19 687 691 ;
+C 68 ; WX 722 ; N D ; B 14 0 690 676 ;
+C 69 ; WX 667 ; N E ; B 16 0 641 676 ;
+C 70 ; WX 611 ; N F ; B 16 0 583 676 ;
+C 71 ; WX 778 ; N G ; B 37 -19 755 691 ;
+C 72 ; WX 778 ; N H ; B 21 0 759 676 ;
+C 73 ; WX 389 ; N I ; B 20 0 370 676 ;
+C 74 ; WX 500 ; N J ; B 3 -96 479 676 ;
+C 75 ; WX 778 ; N K ; B 30 0 769 676 ;
+C 76 ; WX 667 ; N L ; B 19 0 638 676 ;
+C 77 ; WX 944 ; N M ; B 14 0 921 676 ;
+C 78 ; WX 722 ; N N ; B 16 -18 701 676 ;
+C 79 ; WX 778 ; N O ; B 35 -19 743 691 ;
+C 80 ; WX 611 ; N P ; B 16 0 600 676 ;
+C 81 ; WX 778 ; N Q ; B 35 -176 743 691 ;
+C 82 ; WX 722 ; N R ; B 26 0 715 676 ;
+C 83 ; WX 556 ; N S ; B 35 -19 513 692 ;
+C 84 ; WX 667 ; N T ; B 31 0 636 676 ;
+C 85 ; WX 722 ; N U ; B 16 -19 701 676 ;
+C 86 ; WX 722 ; N V ; B 16 -18 701 676 ;
+C 87 ; WX 1000 ; N W ; B 19 -15 981 676 ;
+C 88 ; WX 722 ; N X ; B 16 0 699 676 ;
+C 89 ; WX 722 ; N Y ; B 15 0 699 676 ;
+C 90 ; WX 667 ; N Z ; B 28 0 634 676 ;
+C 91 ; WX 333 ; N bracketleft ; B 67 -149 301 678 ;
+C 92 ; WX 278 ; N backslash ; B -25 -19 303 691 ;
+C 93 ; WX 333 ; N bracketright ; B 32 -149 266 678 ;
+C 94 ; WX 581 ; N asciicircum ; B 73 311 509 676 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 70 356 254 691 ;
+C 97 ; WX 500 ; N a ; B 25 -14 488 473 ;
+C 98 ; WX 556 ; N b ; B 17 -14 521 676 ;
+C 99 ; WX 444 ; N c ; B 25 -14 430 473 ;
+C 100 ; WX 556 ; N d ; B 25 -14 534 676 ;
+C 101 ; WX 444 ; N e ; B 25 -14 426 473 ;
+C 102 ; WX 333 ; N f ; B 14 0 389 691 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B 28 -206 483 473 ;
+C 104 ; WX 556 ; N h ; B 16 0 534 676 ;
+C 105 ; WX 278 ; N i ; B 16 0 255 691 ;
+C 106 ; WX 333 ; N j ; B -57 -203 263 691 ;
+C 107 ; WX 556 ; N k ; B 22 0 543 676 ;
+C 108 ; WX 278 ; N l ; B 16 0 255 676 ;
+C 109 ; WX 833 ; N m ; B 16 0 814 473 ;
+C 110 ; WX 556 ; N n ; B 21 0 539 473 ;
+C 111 ; WX 500 ; N o ; B 25 -14 476 473 ;
+C 112 ; WX 556 ; N p ; B 19 -205 524 473 ;
+C 113 ; WX 556 ; N q ; B 34 -205 536 473 ;
+C 114 ; WX 444 ; N r ; B 29 0 434 473 ;
+C 115 ; WX 389 ; N s ; B 25 -14 361 473 ;
+C 116 ; WX 333 ; N t ; B 20 -12 332 630 ;
+C 117 ; WX 556 ; N u ; B 16 -14 537 461 ;
+C 118 ; WX 500 ; N v ; B 21 -14 485 461 ;
+C 119 ; WX 722 ; N w ; B 23 -14 707 461 ;
+C 120 ; WX 500 ; N x ; B 12 0 484 461 ;
+C 121 ; WX 500 ; N y ; B 16 -205 480 461 ;
+C 122 ; WX 444 ; N z ; B 21 0 420 461 ;
+C 123 ; WX 394 ; N braceleft ; B 22 -175 340 698 ;
+C 124 ; WX 220 ; N bar ; B 66 -218 154 782 ;
+C 125 ; WX 394 ; N braceright ; B 54 -175 372 698 ;
+C 126 ; WX 520 ; N asciitilde ; B 29 173 491 333 ;
+C 161 ; WX 333 ; N exclamdown ; B 82 -203 252 501 ;
+C 162 ; WX 500 ; N cent ; B 53 -140 458 588 ;
+C 163 ; WX 500 ; N sterling ; B 21 -14 477 684 ;
+C 164 ; WX 167 ; N fraction ; B -168 -12 329 688 ;
+C 165 ; WX 500 ; N yen ; B -64 0 547 676 ;
+C 166 ; WX 500 ; N florin ; B 0 -155 498 706 ;
+C 167 ; WX 500 ; N section ; B 57 -132 443 691 ;
+C 168 ; WX 500 ; N currency ; B -26 61 526 613 ;
+C 169 ; WX 278 ; N quotesingle ; B 75 404 204 691 ;
+C 170 ; WX 500 ; N quotedblleft ; B 32 356 486 691 ;
+C 171 ; WX 500 ; N guillemotleft ; B 23 36 473 415 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 51 36 305 415 ;
+C 173 ; WX 333 ; N guilsinglright ; B 28 36 282 415 ;
+C 174 ; WX 556 ; N fi ; B 14 0 536 691 ;
+C 175 ; WX 556 ; N fl ; B 14 0 536 691 ;
+C 177 ; WX 500 ; N endash ; B 0 181 500 271 ;
+C 178 ; WX 500 ; N dagger ; B 47 -134 453 691 ;
+C 179 ; WX 500 ; N daggerdbl ; B 45 -132 456 691 ;
+C 180 ; WX 250 ; N periodcentered ; B 41 248 210 417 ;
+C 182 ; WX 540 ; N paragraph ; B 0 -186 519 676 ;
+C 183 ; WX 350 ; N bullet ; B 35 198 315 478 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 79 -180 263 155 ;
+C 185 ; WX 500 ; N quotedblbase ; B 14 -180 468 155 ;
+C 186 ; WX 500 ; N quotedblright ; B 14 356 468 691 ;
+C 187 ; WX 500 ; N guillemotright ; B 27 36 477 415 ;
+C 188 ; WX 1000 ; N ellipsis ; B 82 -13 917 156 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -29 995 706 ;
+C 191 ; WX 500 ; N questiondown ; B 55 -201 443 501 ;
+C 193 ; WX 333 ; N grave ; B 8 528 246 713 ;
+C 194 ; WX 333 ; N acute ; B 86 528 324 713 ;
+C 195 ; WX 333 ; N circumflex ; B -2 528 335 704 ;
+C 196 ; WX 333 ; N tilde ; B -16 547 349 674 ;
+C 197 ; WX 333 ; N macron ; B 1 565 331 637 ;
+C 198 ; WX 333 ; N breve ; B 15 528 318 691 ;
+C 199 ; WX 333 ; N dotaccent ; B 103 536 258 691 ;
+C 200 ; WX 333 ; N dieresis ; B -2 537 335 667 ;
+C 202 ; WX 333 ; N ring ; B 60 527 273 740 ;
+C 203 ; WX 333 ; N cedilla ; B 68 -218 294 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -13 528 425 713 ;
+C 206 ; WX 333 ; N ogonek ; B 90 -193 319 24 ;
+C 207 ; WX 333 ; N caron ; B -2 528 335 704 ;
+C 208 ; WX 1000 ; N emdash ; B 0 181 1000 271 ;
+C 225 ; WX 1000 ; N AE ; B 4 0 951 676 ;
+C 227 ; WX 300 ; N ordfeminine ; B -1 397 301 688 ;
+C 232 ; WX 667 ; N Lslash ; B 19 0 638 676 ;
+C 233 ; WX 778 ; N Oslash ; B 35 -74 743 737 ;
+C 234 ; WX 1000 ; N OE ; B 22 -5 981 684 ;
+C 235 ; WX 330 ; N ordmasculine ; B 18 397 312 688 ;
+C 241 ; WX 722 ; N ae ; B 33 -14 693 473 ;
+C 245 ; WX 278 ; N dotlessi ; B 16 0 255 461 ;
+C 248 ; WX 278 ; N lslash ; B -22 0 303 676 ;
+C 249 ; WX 500 ; N oslash ; B 25 -92 476 549 ;
+C 250 ; WX 722 ; N oe ; B 22 -14 696 473 ;
+C 251 ; WX 556 ; N germandbls ; B 19 -12 517 691 ;
+C -1 ; WX 389 ; N Idieresis ; B 20 0 370 877 ;
+C -1 ; WX 444 ; N eacute ; B 25 -14 426 713 ;
+C -1 ; WX 500 ; N abreve ; B 25 -14 488 691 ;
+C -1 ; WX 556 ; N uhungarumlaut ; B 16 -14 557 713 ;
+C -1 ; WX 444 ; N ecaron ; B 25 -14 426 704 ;
+C -1 ; WX 722 ; N Ydieresis ; B 15 0 699 877 ;
+C -1 ; WX 570 ; N divide ; B 33 -31 537 537 ;
+C -1 ; WX 722 ; N Yacute ; B 15 0 699 923 ;
+C -1 ; WX 722 ; N Acircumflex ; B 9 0 689 914 ;
+C -1 ; WX 500 ; N aacute ; B 25 -14 488 713 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 16 -19 701 914 ;
+C -1 ; WX 500 ; N yacute ; B 16 -205 480 713 ;
+C -1 ; WX 389 ; N scommaaccent ; B 25 -218 361 473 ;
+C -1 ; WX 444 ; N ecircumflex ; B 25 -14 426 704 ;
+C -1 ; WX 722 ; N Uring ; B 16 -19 701 935 ;
+C -1 ; WX 722 ; N Udieresis ; B 16 -19 701 877 ;
+C -1 ; WX 500 ; N aogonek ; B 25 -193 504 473 ;
+C -1 ; WX 722 ; N Uacute ; B 16 -19 701 923 ;
+C -1 ; WX 556 ; N uogonek ; B 16 -193 539 461 ;
+C -1 ; WX 667 ; N Edieresis ; B 16 0 641 877 ;
+C -1 ; WX 722 ; N Dcroat ; B 6 0 690 676 ;
+C -1 ; WX 250 ; N commaaccent ; B 47 -218 203 -50 ;
+C -1 ; WX 747 ; N copyright ; B 26 -19 721 691 ;
+C -1 ; WX 667 ; N Emacron ; B 16 0 641 847 ;
+C -1 ; WX 444 ; N ccaron ; B 25 -14 430 704 ;
+C -1 ; WX 500 ; N aring ; B 25 -14 488 740 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 16 -188 701 676 ;
+C -1 ; WX 278 ; N lacute ; B 16 0 297 923 ;
+C -1 ; WX 500 ; N agrave ; B 25 -14 488 713 ;
+C -1 ; WX 667 ; N Tcommaaccent ; B 31 -218 636 676 ;
+C -1 ; WX 722 ; N Cacute ; B 49 -19 687 923 ;
+C -1 ; WX 500 ; N atilde ; B 25 -14 488 674 ;
+C -1 ; WX 667 ; N Edotaccent ; B 16 0 641 901 ;
+C -1 ; WX 389 ; N scaron ; B 25 -14 363 704 ;
+C -1 ; WX 389 ; N scedilla ; B 25 -218 361 473 ;
+C -1 ; WX 278 ; N iacute ; B 16 0 289 713 ;
+C -1 ; WX 494 ; N lozenge ; B 10 0 484 745 ;
+C -1 ; WX 722 ; N Rcaron ; B 26 0 715 914 ;
+C -1 ; WX 778 ; N Gcommaaccent ; B 37 -218 755 691 ;
+C -1 ; WX 556 ; N ucircumflex ; B 16 -14 537 704 ;
+C -1 ; WX 500 ; N acircumflex ; B 25 -14 488 704 ;
+C -1 ; WX 722 ; N Amacron ; B 9 0 689 847 ;
+C -1 ; WX 444 ; N rcaron ; B 29 0 434 704 ;
+C -1 ; WX 444 ; N ccedilla ; B 25 -218 430 473 ;
+C -1 ; WX 667 ; N Zdotaccent ; B 28 0 634 901 ;
+C -1 ; WX 611 ; N Thorn ; B 16 0 600 676 ;
+C -1 ; WX 778 ; N Omacron ; B 35 -19 743 847 ;
+C -1 ; WX 722 ; N Racute ; B 26 0 715 923 ;
+C -1 ; WX 556 ; N Sacute ; B 35 -19 513 923 ;
+C -1 ; WX 672 ; N dcaron ; B 25 -14 681 682 ;
+C -1 ; WX 722 ; N Umacron ; B 16 -19 701 847 ;
+C -1 ; WX 556 ; N uring ; B 16 -14 537 740 ;
+C -1 ; WX 300 ; N threesuperior ; B 3 268 297 688 ;
+C -1 ; WX 778 ; N Ograve ; B 35 -19 743 923 ;
+C -1 ; WX 722 ; N Agrave ; B 9 0 689 923 ;
+C -1 ; WX 722 ; N Abreve ; B 9 0 689 901 ;
+C -1 ; WX 570 ; N multiply ; B 48 16 522 490 ;
+C -1 ; WX 556 ; N uacute ; B 16 -14 537 713 ;
+C -1 ; WX 667 ; N Tcaron ; B 31 0 636 914 ;
+C -1 ; WX 494 ; N partialdiff ; B 11 -21 494 750 ;
+C -1 ; WX 500 ; N ydieresis ; B 16 -205 480 667 ;
+C -1 ; WX 722 ; N Nacute ; B 16 -18 701 923 ;
+C -1 ; WX 278 ; N icircumflex ; B -37 0 300 704 ;
+C -1 ; WX 667 ; N Ecircumflex ; B 16 0 641 914 ;
+C -1 ; WX 500 ; N adieresis ; B 25 -14 488 667 ;
+C -1 ; WX 444 ; N edieresis ; B 25 -14 426 667 ;
+C -1 ; WX 444 ; N cacute ; B 25 -14 430 713 ;
+C -1 ; WX 556 ; N nacute ; B 21 0 539 713 ;
+C -1 ; WX 556 ; N umacron ; B 16 -14 537 637 ;
+C -1 ; WX 722 ; N Ncaron ; B 16 -18 701 914 ;
+C -1 ; WX 389 ; N Iacute ; B 20 0 370 923 ;
+C -1 ; WX 570 ; N plusminus ; B 33 0 537 506 ;
+C -1 ; WX 220 ; N brokenbar ; B 66 -143 154 707 ;
+C -1 ; WX 747 ; N registered ; B 26 -19 721 691 ;
+C -1 ; WX 778 ; N Gbreve ; B 37 -19 755 901 ;
+C -1 ; WX 389 ; N Idotaccent ; B 20 0 370 901 ;
+C -1 ; WX 600 ; N summation ; B 14 -10 585 706 ;
+C -1 ; WX 667 ; N Egrave ; B 16 0 641 923 ;
+C -1 ; WX 444 ; N racute ; B 29 0 434 713 ;
+C -1 ; WX 500 ; N omacron ; B 25 -14 476 637 ;
+C -1 ; WX 667 ; N Zacute ; B 28 0 634 923 ;
+C -1 ; WX 667 ; N Zcaron ; B 28 0 634 914 ;
+C -1 ; WX 549 ; N greaterequal ; B 26 0 523 704 ;
+C -1 ; WX 722 ; N Eth ; B 6 0 690 676 ;
+C -1 ; WX 722 ; N Ccedilla ; B 49 -218 687 691 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 16 -218 255 676 ;
+C -1 ; WX 416 ; N tcaron ; B 20 -12 425 815 ;
+C -1 ; WX 444 ; N eogonek ; B 25 -193 426 473 ;
+C -1 ; WX 722 ; N Uogonek ; B 16 -193 701 676 ;
+C -1 ; WX 722 ; N Aacute ; B 9 0 689 923 ;
+C -1 ; WX 722 ; N Adieresis ; B 9 0 689 877 ;
+C -1 ; WX 444 ; N egrave ; B 25 -14 426 713 ;
+C -1 ; WX 444 ; N zacute ; B 21 0 420 713 ;
+C -1 ; WX 278 ; N iogonek ; B 16 -193 274 691 ;
+C -1 ; WX 778 ; N Oacute ; B 35 -19 743 923 ;
+C -1 ; WX 500 ; N oacute ; B 25 -14 476 713 ;
+C -1 ; WX 500 ; N amacron ; B 25 -14 488 637 ;
+C -1 ; WX 389 ; N sacute ; B 25 -14 361 713 ;
+C -1 ; WX 278 ; N idieresis ; B -37 0 300 667 ;
+C -1 ; WX 778 ; N Ocircumflex ; B 35 -19 743 914 ;
+C -1 ; WX 722 ; N Ugrave ; B 16 -19 701 923 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 556 ; N thorn ; B 19 -205 524 676 ;
+C -1 ; WX 300 ; N twosuperior ; B 0 275 300 688 ;
+C -1 ; WX 778 ; N Odieresis ; B 35 -19 743 877 ;
+C -1 ; WX 556 ; N mu ; B 33 -206 536 461 ;
+C -1 ; WX 278 ; N igrave ; B -27 0 255 713 ;
+C -1 ; WX 500 ; N ohungarumlaut ; B 25 -14 529 713 ;
+C -1 ; WX 667 ; N Eogonek ; B 16 -193 644 676 ;
+C -1 ; WX 556 ; N dcroat ; B 25 -14 534 676 ;
+C -1 ; WX 750 ; N threequarters ; B 23 -12 733 688 ;
+C -1 ; WX 556 ; N Scedilla ; B 35 -218 513 692 ;
+C -1 ; WX 394 ; N lcaron ; B 16 0 412 682 ;
+C -1 ; WX 778 ; N Kcommaaccent ; B 30 -218 769 676 ;
+C -1 ; WX 667 ; N Lacute ; B 19 0 638 923 ;
+C -1 ; WX 1000 ; N trademark ; B 24 271 977 676 ;
+C -1 ; WX 444 ; N edotaccent ; B 25 -14 426 691 ;
+C -1 ; WX 389 ; N Igrave ; B 20 0 370 923 ;
+C -1 ; WX 389 ; N Imacron ; B 20 0 370 847 ;
+C -1 ; WX 667 ; N Lcaron ; B 19 0 652 682 ;
+C -1 ; WX 750 ; N onehalf ; B -7 -12 775 688 ;
+C -1 ; WX 549 ; N lessequal ; B 29 0 526 704 ;
+C -1 ; WX 500 ; N ocircumflex ; B 25 -14 476 704 ;
+C -1 ; WX 556 ; N ntilde ; B 21 0 539 674 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 16 -19 701 923 ;
+C -1 ; WX 667 ; N Eacute ; B 16 0 641 923 ;
+C -1 ; WX 444 ; N emacron ; B 25 -14 426 637 ;
+C -1 ; WX 500 ; N gbreve ; B 28 -206 483 691 ;
+C -1 ; WX 750 ; N onequarter ; B 28 -12 743 688 ;
+C -1 ; WX 556 ; N Scaron ; B 35 -19 513 914 ;
+C -1 ; WX 556 ; N Scommaaccent ; B 35 -218 513 692 ;
+C -1 ; WX 778 ; N Ohungarumlaut ; B 35 -19 743 923 ;
+C -1 ; WX 400 ; N degree ; B 57 402 343 688 ;
+C -1 ; WX 500 ; N ograve ; B 25 -14 476 713 ;
+C -1 ; WX 722 ; N Ccaron ; B 49 -19 687 914 ;
+C -1 ; WX 556 ; N ugrave ; B 16 -14 537 713 ;
+C -1 ; WX 549 ; N radical ; B 10 -46 512 850 ;
+C -1 ; WX 722 ; N Dcaron ; B 14 0 690 914 ;
+C -1 ; WX 444 ; N rcommaaccent ; B 29 -218 434 473 ;
+C -1 ; WX 722 ; N Ntilde ; B 16 -18 701 884 ;
+C -1 ; WX 500 ; N otilde ; B 25 -14 476 674 ;
+C -1 ; WX 722 ; N Rcommaaccent ; B 26 -218 715 676 ;
+C -1 ; WX 667 ; N Lcommaaccent ; B 19 -218 638 676 ;
+C -1 ; WX 722 ; N Atilde ; B 9 0 689 884 ;
+C -1 ; WX 722 ; N Aogonek ; B 9 -193 699 690 ;
+C -1 ; WX 722 ; N Aring ; B 9 0 689 935 ;
+C -1 ; WX 778 ; N Otilde ; B 35 -19 743 884 ;
+C -1 ; WX 444 ; N zdotaccent ; B 21 0 420 691 ;
+C -1 ; WX 667 ; N Ecaron ; B 16 0 641 914 ;
+C -1 ; WX 389 ; N Iogonek ; B 20 -193 370 676 ;
+C -1 ; WX 556 ; N kcommaaccent ; B 22 -218 543 676 ;
+C -1 ; WX 570 ; N minus ; B 33 209 537 297 ;
+C -1 ; WX 389 ; N Icircumflex ; B 20 0 370 914 ;
+C -1 ; WX 556 ; N ncaron ; B 21 0 539 704 ;
+C -1 ; WX 333 ; N tcommaaccent ; B 20 -218 332 630 ;
+C -1 ; WX 570 ; N logicalnot ; B 33 108 537 399 ;
+C -1 ; WX 500 ; N odieresis ; B 25 -14 476 667 ;
+C -1 ; WX 556 ; N udieresis ; B 16 -14 537 667 ;
+C -1 ; WX 549 ; N notequal ; B 15 -49 540 570 ;
+C -1 ; WX 500 ; N gcommaaccent ; B 28 -206 483 829 ;
+C -1 ; WX 500 ; N eth ; B 25 -14 476 691 ;
+C -1 ; WX 444 ; N zcaron ; B 21 0 420 704 ;
+C -1 ; WX 556 ; N ncommaaccent ; B 21 -218 539 473 ;
+C -1 ; WX 300 ; N onesuperior ; B 28 275 273 688 ;
+C -1 ; WX 278 ; N imacron ; B -8 0 272 637 ;
+C -1 ; WX 500 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 2242
+KPX A C -55
+KPX A Cacute -55
+KPX A Ccaron -55
+KPX A Ccedilla -55
+KPX A G -55
+KPX A Gbreve -55
+KPX A Gcommaaccent -55
+KPX A O -45
+KPX A Oacute -45
+KPX A Ocircumflex -45
+KPX A Odieresis -45
+KPX A Ograve -45
+KPX A Ohungarumlaut -45
+KPX A Omacron -45
+KPX A Oslash -45
+KPX A Otilde -45
+KPX A Q -45
+KPX A T -95
+KPX A Tcaron -95
+KPX A Tcommaaccent -95
+KPX A U -50
+KPX A Uacute -50
+KPX A Ucircumflex -50
+KPX A Udieresis -50
+KPX A Ugrave -50
+KPX A Uhungarumlaut -50
+KPX A Umacron -50
+KPX A Uogonek -50
+KPX A Uring -50
+KPX A V -145
+KPX A W -130
+KPX A Y -100
+KPX A Yacute -100
+KPX A Ydieresis -100
+KPX A p -25
+KPX A quoteright -74
+KPX A u -50
+KPX A uacute -50
+KPX A ucircumflex -50
+KPX A udieresis -50
+KPX A ugrave -50
+KPX A uhungarumlaut -50
+KPX A umacron -50
+KPX A uogonek -50
+KPX A uring -50
+KPX A v -100
+KPX A w -90
+KPX A y -74
+KPX A yacute -74
+KPX A ydieresis -74
+KPX Aacute C -55
+KPX Aacute Cacute -55
+KPX Aacute Ccaron -55
+KPX Aacute Ccedilla -55
+KPX Aacute G -55
+KPX Aacute Gbreve -55
+KPX Aacute Gcommaaccent -55
+KPX Aacute O -45
+KPX Aacute Oacute -45
+KPX Aacute Ocircumflex -45
+KPX Aacute Odieresis -45
+KPX Aacute Ograve -45
+KPX Aacute Ohungarumlaut -45
+KPX Aacute Omacron -45
+KPX Aacute Oslash -45
+KPX Aacute Otilde -45
+KPX Aacute Q -45
+KPX Aacute T -95
+KPX Aacute Tcaron -95
+KPX Aacute Tcommaaccent -95
+KPX Aacute U -50
+KPX Aacute Uacute -50
+KPX Aacute Ucircumflex -50
+KPX Aacute Udieresis -50
+KPX Aacute Ugrave -50
+KPX Aacute Uhungarumlaut -50
+KPX Aacute Umacron -50
+KPX Aacute Uogonek -50
+KPX Aacute Uring -50
+KPX Aacute V -145
+KPX Aacute W -130
+KPX Aacute Y -100
+KPX Aacute Yacute -100
+KPX Aacute Ydieresis -100
+KPX Aacute p -25
+KPX Aacute quoteright -74
+KPX Aacute u -50
+KPX Aacute uacute -50
+KPX Aacute ucircumflex -50
+KPX Aacute udieresis -50
+KPX Aacute ugrave -50
+KPX Aacute uhungarumlaut -50
+KPX Aacute umacron -50
+KPX Aacute uogonek -50
+KPX Aacute uring -50
+KPX Aacute v -100
+KPX Aacute w -90
+KPX Aacute y -74
+KPX Aacute yacute -74
+KPX Aacute ydieresis -74
+KPX Abreve C -55
+KPX Abreve Cacute -55
+KPX Abreve Ccaron -55
+KPX Abreve Ccedilla -55
+KPX Abreve G -55
+KPX Abreve Gbreve -55
+KPX Abreve Gcommaaccent -55
+KPX Abreve O -45
+KPX Abreve Oacute -45
+KPX Abreve Ocircumflex -45
+KPX Abreve Odieresis -45
+KPX Abreve Ograve -45
+KPX Abreve Ohungarumlaut -45
+KPX Abreve Omacron -45
+KPX Abreve Oslash -45
+KPX Abreve Otilde -45
+KPX Abreve Q -45
+KPX Abreve T -95
+KPX Abreve Tcaron -95
+KPX Abreve Tcommaaccent -95
+KPX Abreve U -50
+KPX Abreve Uacute -50
+KPX Abreve Ucircumflex -50
+KPX Abreve Udieresis -50
+KPX Abreve Ugrave -50
+KPX Abreve Uhungarumlaut -50
+KPX Abreve Umacron -50
+KPX Abreve Uogonek -50
+KPX Abreve Uring -50
+KPX Abreve V -145
+KPX Abreve W -130
+KPX Abreve Y -100
+KPX Abreve Yacute -100
+KPX Abreve Ydieresis -100
+KPX Abreve p -25
+KPX Abreve quoteright -74
+KPX Abreve u -50
+KPX Abreve uacute -50
+KPX Abreve ucircumflex -50
+KPX Abreve udieresis -50
+KPX Abreve ugrave -50
+KPX Abreve uhungarumlaut -50
+KPX Abreve umacron -50
+KPX Abreve uogonek -50
+KPX Abreve uring -50
+KPX Abreve v -100
+KPX Abreve w -90
+KPX Abreve y -74
+KPX Abreve yacute -74
+KPX Abreve ydieresis -74
+KPX Acircumflex C -55
+KPX Acircumflex Cacute -55
+KPX Acircumflex Ccaron -55
+KPX Acircumflex Ccedilla -55
+KPX Acircumflex G -55
+KPX Acircumflex Gbreve -55
+KPX Acircumflex Gcommaaccent -55
+KPX Acircumflex O -45
+KPX Acircumflex Oacute -45
+KPX Acircumflex Ocircumflex -45
+KPX Acircumflex Odieresis -45
+KPX Acircumflex Ograve -45
+KPX Acircumflex Ohungarumlaut -45
+KPX Acircumflex Omacron -45
+KPX Acircumflex Oslash -45
+KPX Acircumflex Otilde -45
+KPX Acircumflex Q -45
+KPX Acircumflex T -95
+KPX Acircumflex Tcaron -95
+KPX Acircumflex Tcommaaccent -95
+KPX Acircumflex U -50
+KPX Acircumflex Uacute -50
+KPX Acircumflex Ucircumflex -50
+KPX Acircumflex Udieresis -50
+KPX Acircumflex Ugrave -50
+KPX Acircumflex Uhungarumlaut -50
+KPX Acircumflex Umacron -50
+KPX Acircumflex Uogonek -50
+KPX Acircumflex Uring -50
+KPX Acircumflex V -145
+KPX Acircumflex W -130
+KPX Acircumflex Y -100
+KPX Acircumflex Yacute -100
+KPX Acircumflex Ydieresis -100
+KPX Acircumflex p -25
+KPX Acircumflex quoteright -74
+KPX Acircumflex u -50
+KPX Acircumflex uacute -50
+KPX Acircumflex ucircumflex -50
+KPX Acircumflex udieresis -50
+KPX Acircumflex ugrave -50
+KPX Acircumflex uhungarumlaut -50
+KPX Acircumflex umacron -50
+KPX Acircumflex uogonek -50
+KPX Acircumflex uring -50
+KPX Acircumflex v -100
+KPX Acircumflex w -90
+KPX Acircumflex y -74
+KPX Acircumflex yacute -74
+KPX Acircumflex ydieresis -74
+KPX Adieresis C -55
+KPX Adieresis Cacute -55
+KPX Adieresis Ccaron -55
+KPX Adieresis Ccedilla -55
+KPX Adieresis G -55
+KPX Adieresis Gbreve -55
+KPX Adieresis Gcommaaccent -55
+KPX Adieresis O -45
+KPX Adieresis Oacute -45
+KPX Adieresis Ocircumflex -45
+KPX Adieresis Odieresis -45
+KPX Adieresis Ograve -45
+KPX Adieresis Ohungarumlaut -45
+KPX Adieresis Omacron -45
+KPX Adieresis Oslash -45
+KPX Adieresis Otilde -45
+KPX Adieresis Q -45
+KPX Adieresis T -95
+KPX Adieresis Tcaron -95
+KPX Adieresis Tcommaaccent -95
+KPX Adieresis U -50
+KPX Adieresis Uacute -50
+KPX Adieresis Ucircumflex -50
+KPX Adieresis Udieresis -50
+KPX Adieresis Ugrave -50
+KPX Adieresis Uhungarumlaut -50
+KPX Adieresis Umacron -50
+KPX Adieresis Uogonek -50
+KPX Adieresis Uring -50
+KPX Adieresis V -145
+KPX Adieresis W -130
+KPX Adieresis Y -100
+KPX Adieresis Yacute -100
+KPX Adieresis Ydieresis -100
+KPX Adieresis p -25
+KPX Adieresis quoteright -74
+KPX Adieresis u -50
+KPX Adieresis uacute -50
+KPX Adieresis ucircumflex -50
+KPX Adieresis udieresis -50
+KPX Adieresis ugrave -50
+KPX Adieresis uhungarumlaut -50
+KPX Adieresis umacron -50
+KPX Adieresis uogonek -50
+KPX Adieresis uring -50
+KPX Adieresis v -100
+KPX Adieresis w -90
+KPX Adieresis y -74
+KPX Adieresis yacute -74
+KPX Adieresis ydieresis -74
+KPX Agrave C -55
+KPX Agrave Cacute -55
+KPX Agrave Ccaron -55
+KPX Agrave Ccedilla -55
+KPX Agrave G -55
+KPX Agrave Gbreve -55
+KPX Agrave Gcommaaccent -55
+KPX Agrave O -45
+KPX Agrave Oacute -45
+KPX Agrave Ocircumflex -45
+KPX Agrave Odieresis -45
+KPX Agrave Ograve -45
+KPX Agrave Ohungarumlaut -45
+KPX Agrave Omacron -45
+KPX Agrave Oslash -45
+KPX Agrave Otilde -45
+KPX Agrave Q -45
+KPX Agrave T -95
+KPX Agrave Tcaron -95
+KPX Agrave Tcommaaccent -95
+KPX Agrave U -50
+KPX Agrave Uacute -50
+KPX Agrave Ucircumflex -50
+KPX Agrave Udieresis -50
+KPX Agrave Ugrave -50
+KPX Agrave Uhungarumlaut -50
+KPX Agrave Umacron -50
+KPX Agrave Uogonek -50
+KPX Agrave Uring -50
+KPX Agrave V -145
+KPX Agrave W -130
+KPX Agrave Y -100
+KPX Agrave Yacute -100
+KPX Agrave Ydieresis -100
+KPX Agrave p -25
+KPX Agrave quoteright -74
+KPX Agrave u -50
+KPX Agrave uacute -50
+KPX Agrave ucircumflex -50
+KPX Agrave udieresis -50
+KPX Agrave ugrave -50
+KPX Agrave uhungarumlaut -50
+KPX Agrave umacron -50
+KPX Agrave uogonek -50
+KPX Agrave uring -50
+KPX Agrave v -100
+KPX Agrave w -90
+KPX Agrave y -74
+KPX Agrave yacute -74
+KPX Agrave ydieresis -74
+KPX Amacron C -55
+KPX Amacron Cacute -55
+KPX Amacron Ccaron -55
+KPX Amacron Ccedilla -55
+KPX Amacron G -55
+KPX Amacron Gbreve -55
+KPX Amacron Gcommaaccent -55
+KPX Amacron O -45
+KPX Amacron Oacute -45
+KPX Amacron Ocircumflex -45
+KPX Amacron Odieresis -45
+KPX Amacron Ograve -45
+KPX Amacron Ohungarumlaut -45
+KPX Amacron Omacron -45
+KPX Amacron Oslash -45
+KPX Amacron Otilde -45
+KPX Amacron Q -45
+KPX Amacron T -95
+KPX Amacron Tcaron -95
+KPX Amacron Tcommaaccent -95
+KPX Amacron U -50
+KPX Amacron Uacute -50
+KPX Amacron Ucircumflex -50
+KPX Amacron Udieresis -50
+KPX Amacron Ugrave -50
+KPX Amacron Uhungarumlaut -50
+KPX Amacron Umacron -50
+KPX Amacron Uogonek -50
+KPX Amacron Uring -50
+KPX Amacron V -145
+KPX Amacron W -130
+KPX Amacron Y -100
+KPX Amacron Yacute -100
+KPX Amacron Ydieresis -100
+KPX Amacron p -25
+KPX Amacron quoteright -74
+KPX Amacron u -50
+KPX Amacron uacute -50
+KPX Amacron ucircumflex -50
+KPX Amacron udieresis -50
+KPX Amacron ugrave -50
+KPX Amacron uhungarumlaut -50
+KPX Amacron umacron -50
+KPX Amacron uogonek -50
+KPX Amacron uring -50
+KPX Amacron v -100
+KPX Amacron w -90
+KPX Amacron y -74
+KPX Amacron yacute -74
+KPX Amacron ydieresis -74
+KPX Aogonek C -55
+KPX Aogonek Cacute -55
+KPX Aogonek Ccaron -55
+KPX Aogonek Ccedilla -55
+KPX Aogonek G -55
+KPX Aogonek Gbreve -55
+KPX Aogonek Gcommaaccent -55
+KPX Aogonek O -45
+KPX Aogonek Oacute -45
+KPX Aogonek Ocircumflex -45
+KPX Aogonek Odieresis -45
+KPX Aogonek Ograve -45
+KPX Aogonek Ohungarumlaut -45
+KPX Aogonek Omacron -45
+KPX Aogonek Oslash -45
+KPX Aogonek Otilde -45
+KPX Aogonek Q -45
+KPX Aogonek T -95
+KPX Aogonek Tcaron -95
+KPX Aogonek Tcommaaccent -95
+KPX Aogonek U -50
+KPX Aogonek Uacute -50
+KPX Aogonek Ucircumflex -50
+KPX Aogonek Udieresis -50
+KPX Aogonek Ugrave -50
+KPX Aogonek Uhungarumlaut -50
+KPX Aogonek Umacron -50
+KPX Aogonek Uogonek -50
+KPX Aogonek Uring -50
+KPX Aogonek V -145
+KPX Aogonek W -130
+KPX Aogonek Y -100
+KPX Aogonek Yacute -100
+KPX Aogonek Ydieresis -100
+KPX Aogonek p -25
+KPX Aogonek quoteright -74
+KPX Aogonek u -50
+KPX Aogonek uacute -50
+KPX Aogonek ucircumflex -50
+KPX Aogonek udieresis -50
+KPX Aogonek ugrave -50
+KPX Aogonek uhungarumlaut -50
+KPX Aogonek umacron -50
+KPX Aogonek uogonek -50
+KPX Aogonek uring -50
+KPX Aogonek v -100
+KPX Aogonek w -90
+KPX Aogonek y -34
+KPX Aogonek yacute -34
+KPX Aogonek ydieresis -34
+KPX Aring C -55
+KPX Aring Cacute -55
+KPX Aring Ccaron -55
+KPX Aring Ccedilla -55
+KPX Aring G -55
+KPX Aring Gbreve -55
+KPX Aring Gcommaaccent -55
+KPX Aring O -45
+KPX Aring Oacute -45
+KPX Aring Ocircumflex -45
+KPX Aring Odieresis -45
+KPX Aring Ograve -45
+KPX Aring Ohungarumlaut -45
+KPX Aring Omacron -45
+KPX Aring Oslash -45
+KPX Aring Otilde -45
+KPX Aring Q -45
+KPX Aring T -95
+KPX Aring Tcaron -95
+KPX Aring Tcommaaccent -95
+KPX Aring U -50
+KPX Aring Uacute -50
+KPX Aring Ucircumflex -50
+KPX Aring Udieresis -50
+KPX Aring Ugrave -50
+KPX Aring Uhungarumlaut -50
+KPX Aring Umacron -50
+KPX Aring Uogonek -50
+KPX Aring Uring -50
+KPX Aring V -145
+KPX Aring W -130
+KPX Aring Y -100
+KPX Aring Yacute -100
+KPX Aring Ydieresis -100
+KPX Aring p -25
+KPX Aring quoteright -74
+KPX Aring u -50
+KPX Aring uacute -50
+KPX Aring ucircumflex -50
+KPX Aring udieresis -50
+KPX Aring ugrave -50
+KPX Aring uhungarumlaut -50
+KPX Aring umacron -50
+KPX Aring uogonek -50
+KPX Aring uring -50
+KPX Aring v -100
+KPX Aring w -90
+KPX Aring y -74
+KPX Aring yacute -74
+KPX Aring ydieresis -74
+KPX Atilde C -55
+KPX Atilde Cacute -55
+KPX Atilde Ccaron -55
+KPX Atilde Ccedilla -55
+KPX Atilde G -55
+KPX Atilde Gbreve -55
+KPX Atilde Gcommaaccent -55
+KPX Atilde O -45
+KPX Atilde Oacute -45
+KPX Atilde Ocircumflex -45
+KPX Atilde Odieresis -45
+KPX Atilde Ograve -45
+KPX Atilde Ohungarumlaut -45
+KPX Atilde Omacron -45
+KPX Atilde Oslash -45
+KPX Atilde Otilde -45
+KPX Atilde Q -45
+KPX Atilde T -95
+KPX Atilde Tcaron -95
+KPX Atilde Tcommaaccent -95
+KPX Atilde U -50
+KPX Atilde Uacute -50
+KPX Atilde Ucircumflex -50
+KPX Atilde Udieresis -50
+KPX Atilde Ugrave -50
+KPX Atilde Uhungarumlaut -50
+KPX Atilde Umacron -50
+KPX Atilde Uogonek -50
+KPX Atilde Uring -50
+KPX Atilde V -145
+KPX Atilde W -130
+KPX Atilde Y -100
+KPX Atilde Yacute -100
+KPX Atilde Ydieresis -100
+KPX Atilde p -25
+KPX Atilde quoteright -74
+KPX Atilde u -50
+KPX Atilde uacute -50
+KPX Atilde ucircumflex -50
+KPX Atilde udieresis -50
+KPX Atilde ugrave -50
+KPX Atilde uhungarumlaut -50
+KPX Atilde umacron -50
+KPX Atilde uogonek -50
+KPX Atilde uring -50
+KPX Atilde v -100
+KPX Atilde w -90
+KPX Atilde y -74
+KPX Atilde yacute -74
+KPX Atilde ydieresis -74
+KPX B A -30
+KPX B Aacute -30
+KPX B Abreve -30
+KPX B Acircumflex -30
+KPX B Adieresis -30
+KPX B Agrave -30
+KPX B Amacron -30
+KPX B Aogonek -30
+KPX B Aring -30
+KPX B Atilde -30
+KPX B U -10
+KPX B Uacute -10
+KPX B Ucircumflex -10
+KPX B Udieresis -10
+KPX B Ugrave -10
+KPX B Uhungarumlaut -10
+KPX B Umacron -10
+KPX B Uogonek -10
+KPX B Uring -10
+KPX D A -35
+KPX D Aacute -35
+KPX D Abreve -35
+KPX D Acircumflex -35
+KPX D Adieresis -35
+KPX D Agrave -35
+KPX D Amacron -35
+KPX D Aogonek -35
+KPX D Aring -35
+KPX D Atilde -35
+KPX D V -40
+KPX D W -40
+KPX D Y -40
+KPX D Yacute -40
+KPX D Ydieresis -40
+KPX D period -20
+KPX Dcaron A -35
+KPX Dcaron Aacute -35
+KPX Dcaron Abreve -35
+KPX Dcaron Acircumflex -35
+KPX Dcaron Adieresis -35
+KPX Dcaron Agrave -35
+KPX Dcaron Amacron -35
+KPX Dcaron Aogonek -35
+KPX Dcaron Aring -35
+KPX Dcaron Atilde -35
+KPX Dcaron V -40
+KPX Dcaron W -40
+KPX Dcaron Y -40
+KPX Dcaron Yacute -40
+KPX Dcaron Ydieresis -40
+KPX Dcaron period -20
+KPX Dcroat A -35
+KPX Dcroat Aacute -35
+KPX Dcroat Abreve -35
+KPX Dcroat Acircumflex -35
+KPX Dcroat Adieresis -35
+KPX Dcroat Agrave -35
+KPX Dcroat Amacron -35
+KPX Dcroat Aogonek -35
+KPX Dcroat Aring -35
+KPX Dcroat Atilde -35
+KPX Dcroat V -40
+KPX Dcroat W -40
+KPX Dcroat Y -40
+KPX Dcroat Yacute -40
+KPX Dcroat Ydieresis -40
+KPX Dcroat period -20
+KPX F A -90
+KPX F Aacute -90
+KPX F Abreve -90
+KPX F Acircumflex -90
+KPX F Adieresis -90
+KPX F Agrave -90
+KPX F Amacron -90
+KPX F Aogonek -90
+KPX F Aring -90
+KPX F Atilde -90
+KPX F a -25
+KPX F aacute -25
+KPX F abreve -25
+KPX F acircumflex -25
+KPX F adieresis -25
+KPX F agrave -25
+KPX F amacron -25
+KPX F aogonek -25
+KPX F aring -25
+KPX F atilde -25
+KPX F comma -92
+KPX F e -25
+KPX F eacute -25
+KPX F ecaron -25
+KPX F ecircumflex -25
+KPX F edieresis -25
+KPX F edotaccent -25
+KPX F egrave -25
+KPX F emacron -25
+KPX F eogonek -25
+KPX F o -25
+KPX F oacute -25
+KPX F ocircumflex -25
+KPX F odieresis -25
+KPX F ograve -25
+KPX F ohungarumlaut -25
+KPX F omacron -25
+KPX F oslash -25
+KPX F otilde -25
+KPX F period -110
+KPX J A -30
+KPX J Aacute -30
+KPX J Abreve -30
+KPX J Acircumflex -30
+KPX J Adieresis -30
+KPX J Agrave -30
+KPX J Amacron -30
+KPX J Aogonek -30
+KPX J Aring -30
+KPX J Atilde -30
+KPX J a -15
+KPX J aacute -15
+KPX J abreve -15
+KPX J acircumflex -15
+KPX J adieresis -15
+KPX J agrave -15
+KPX J amacron -15
+KPX J aogonek -15
+KPX J aring -15
+KPX J atilde -15
+KPX J e -15
+KPX J eacute -15
+KPX J ecaron -15
+KPX J ecircumflex -15
+KPX J edieresis -15
+KPX J edotaccent -15
+KPX J egrave -15
+KPX J emacron -15
+KPX J eogonek -15
+KPX J o -15
+KPX J oacute -15
+KPX J ocircumflex -15
+KPX J odieresis -15
+KPX J ograve -15
+KPX J ohungarumlaut -15
+KPX J omacron -15
+KPX J oslash -15
+KPX J otilde -15
+KPX J period -20
+KPX J u -15
+KPX J uacute -15
+KPX J ucircumflex -15
+KPX J udieresis -15
+KPX J ugrave -15
+KPX J uhungarumlaut -15
+KPX J umacron -15
+KPX J uogonek -15
+KPX J uring -15
+KPX K O -30
+KPX K Oacute -30
+KPX K Ocircumflex -30
+KPX K Odieresis -30
+KPX K Ograve -30
+KPX K Ohungarumlaut -30
+KPX K Omacron -30
+KPX K Oslash -30
+KPX K Otilde -30
+KPX K e -25
+KPX K eacute -25
+KPX K ecaron -25
+KPX K ecircumflex -25
+KPX K edieresis -25
+KPX K edotaccent -25
+KPX K egrave -25
+KPX K emacron -25
+KPX K eogonek -25
+KPX K o -25
+KPX K oacute -25
+KPX K ocircumflex -25
+KPX K odieresis -25
+KPX K ograve -25
+KPX K ohungarumlaut -25
+KPX K omacron -25
+KPX K oslash -25
+KPX K otilde -25
+KPX K u -15
+KPX K uacute -15
+KPX K ucircumflex -15
+KPX K udieresis -15
+KPX K ugrave -15
+KPX K uhungarumlaut -15
+KPX K umacron -15
+KPX K uogonek -15
+KPX K uring -15
+KPX K y -45
+KPX K yacute -45
+KPX K ydieresis -45
+KPX Kcommaaccent O -30
+KPX Kcommaaccent Oacute -30
+KPX Kcommaaccent Ocircumflex -30
+KPX Kcommaaccent Odieresis -30
+KPX Kcommaaccent Ograve -30
+KPX Kcommaaccent Ohungarumlaut -30
+KPX Kcommaaccent Omacron -30
+KPX Kcommaaccent Oslash -30
+KPX Kcommaaccent Otilde -30
+KPX Kcommaaccent e -25
+KPX Kcommaaccent eacute -25
+KPX Kcommaaccent ecaron -25
+KPX Kcommaaccent ecircumflex -25
+KPX Kcommaaccent edieresis -25
+KPX Kcommaaccent edotaccent -25
+KPX Kcommaaccent egrave -25
+KPX Kcommaaccent emacron -25
+KPX Kcommaaccent eogonek -25
+KPX Kcommaaccent o -25
+KPX Kcommaaccent oacute -25
+KPX Kcommaaccent ocircumflex -25
+KPX Kcommaaccent odieresis -25
+KPX Kcommaaccent ograve -25
+KPX Kcommaaccent ohungarumlaut -25
+KPX Kcommaaccent omacron -25
+KPX Kcommaaccent oslash -25
+KPX Kcommaaccent otilde -25
+KPX Kcommaaccent u -15
+KPX Kcommaaccent uacute -15
+KPX Kcommaaccent ucircumflex -15
+KPX Kcommaaccent udieresis -15
+KPX Kcommaaccent ugrave -15
+KPX Kcommaaccent uhungarumlaut -15
+KPX Kcommaaccent umacron -15
+KPX Kcommaaccent uogonek -15
+KPX Kcommaaccent uring -15
+KPX Kcommaaccent y -45
+KPX Kcommaaccent yacute -45
+KPX Kcommaaccent ydieresis -45
+KPX L T -92
+KPX L Tcaron -92
+KPX L Tcommaaccent -92
+KPX L V -92
+KPX L W -92
+KPX L Y -92
+KPX L Yacute -92
+KPX L Ydieresis -92
+KPX L quotedblright -20
+KPX L quoteright -110
+KPX L y -55
+KPX L yacute -55
+KPX L ydieresis -55
+KPX Lacute T -92
+KPX Lacute Tcaron -92
+KPX Lacute Tcommaaccent -92
+KPX Lacute V -92
+KPX Lacute W -92
+KPX Lacute Y -92
+KPX Lacute Yacute -92
+KPX Lacute Ydieresis -92
+KPX Lacute quotedblright -20
+KPX Lacute quoteright -110
+KPX Lacute y -55
+KPX Lacute yacute -55
+KPX Lacute ydieresis -55
+KPX Lcommaaccent T -92
+KPX Lcommaaccent Tcaron -92
+KPX Lcommaaccent Tcommaaccent -92
+KPX Lcommaaccent V -92
+KPX Lcommaaccent W -92
+KPX Lcommaaccent Y -92
+KPX Lcommaaccent Yacute -92
+KPX Lcommaaccent Ydieresis -92
+KPX Lcommaaccent quotedblright -20
+KPX Lcommaaccent quoteright -110
+KPX Lcommaaccent y -55
+KPX Lcommaaccent yacute -55
+KPX Lcommaaccent ydieresis -55
+KPX Lslash T -92
+KPX Lslash Tcaron -92
+KPX Lslash Tcommaaccent -92
+KPX Lslash V -92
+KPX Lslash W -92
+KPX Lslash Y -92
+KPX Lslash Yacute -92
+KPX Lslash Ydieresis -92
+KPX Lslash quotedblright -20
+KPX Lslash quoteright -110
+KPX Lslash y -55
+KPX Lslash yacute -55
+KPX Lslash ydieresis -55
+KPX N A -20
+KPX N Aacute -20
+KPX N Abreve -20
+KPX N Acircumflex -20
+KPX N Adieresis -20
+KPX N Agrave -20
+KPX N Amacron -20
+KPX N Aogonek -20
+KPX N Aring -20
+KPX N Atilde -20
+KPX Nacute A -20
+KPX Nacute Aacute -20
+KPX Nacute Abreve -20
+KPX Nacute Acircumflex -20
+KPX Nacute Adieresis -20
+KPX Nacute Agrave -20
+KPX Nacute Amacron -20
+KPX Nacute Aogonek -20
+KPX Nacute Aring -20
+KPX Nacute Atilde -20
+KPX Ncaron A -20
+KPX Ncaron Aacute -20
+KPX Ncaron Abreve -20
+KPX Ncaron Acircumflex -20
+KPX Ncaron Adieresis -20
+KPX Ncaron Agrave -20
+KPX Ncaron Amacron -20
+KPX Ncaron Aogonek -20
+KPX Ncaron Aring -20
+KPX Ncaron Atilde -20
+KPX Ncommaaccent A -20
+KPX Ncommaaccent Aacute -20
+KPX Ncommaaccent Abreve -20
+KPX Ncommaaccent Acircumflex -20
+KPX Ncommaaccent Adieresis -20
+KPX Ncommaaccent Agrave -20
+KPX Ncommaaccent Amacron -20
+KPX Ncommaaccent Aogonek -20
+KPX Ncommaaccent Aring -20
+KPX Ncommaaccent Atilde -20
+KPX Ntilde A -20
+KPX Ntilde Aacute -20
+KPX Ntilde Abreve -20
+KPX Ntilde Acircumflex -20
+KPX Ntilde Adieresis -20
+KPX Ntilde Agrave -20
+KPX Ntilde Amacron -20
+KPX Ntilde Aogonek -20
+KPX Ntilde Aring -20
+KPX Ntilde Atilde -20
+KPX O A -40
+KPX O Aacute -40
+KPX O Abreve -40
+KPX O Acircumflex -40
+KPX O Adieresis -40
+KPX O Agrave -40
+KPX O Amacron -40
+KPX O Aogonek -40
+KPX O Aring -40
+KPX O Atilde -40
+KPX O T -40
+KPX O Tcaron -40
+KPX O Tcommaaccent -40
+KPX O V -50
+KPX O W -50
+KPX O X -40
+KPX O Y -50
+KPX O Yacute -50
+KPX O Ydieresis -50
+KPX Oacute A -40
+KPX Oacute Aacute -40
+KPX Oacute Abreve -40
+KPX Oacute Acircumflex -40
+KPX Oacute Adieresis -40
+KPX Oacute Agrave -40
+KPX Oacute Amacron -40
+KPX Oacute Aogonek -40
+KPX Oacute Aring -40
+KPX Oacute Atilde -40
+KPX Oacute T -40
+KPX Oacute Tcaron -40
+KPX Oacute Tcommaaccent -40
+KPX Oacute V -50
+KPX Oacute W -50
+KPX Oacute X -40
+KPX Oacute Y -50
+KPX Oacute Yacute -50
+KPX Oacute Ydieresis -50
+KPX Ocircumflex A -40
+KPX Ocircumflex Aacute -40
+KPX Ocircumflex Abreve -40
+KPX Ocircumflex Acircumflex -40
+KPX Ocircumflex Adieresis -40
+KPX Ocircumflex Agrave -40
+KPX Ocircumflex Amacron -40
+KPX Ocircumflex Aogonek -40
+KPX Ocircumflex Aring -40
+KPX Ocircumflex Atilde -40
+KPX Ocircumflex T -40
+KPX Ocircumflex Tcaron -40
+KPX Ocircumflex Tcommaaccent -40
+KPX Ocircumflex V -50
+KPX Ocircumflex W -50
+KPX Ocircumflex X -40
+KPX Ocircumflex Y -50
+KPX Ocircumflex Yacute -50
+KPX Ocircumflex Ydieresis -50
+KPX Odieresis A -40
+KPX Odieresis Aacute -40
+KPX Odieresis Abreve -40
+KPX Odieresis Acircumflex -40
+KPX Odieresis Adieresis -40
+KPX Odieresis Agrave -40
+KPX Odieresis Amacron -40
+KPX Odieresis Aogonek -40
+KPX Odieresis Aring -40
+KPX Odieresis Atilde -40
+KPX Odieresis T -40
+KPX Odieresis Tcaron -40
+KPX Odieresis Tcommaaccent -40
+KPX Odieresis V -50
+KPX Odieresis W -50
+KPX Odieresis X -40
+KPX Odieresis Y -50
+KPX Odieresis Yacute -50
+KPX Odieresis Ydieresis -50
+KPX Ograve A -40
+KPX Ograve Aacute -40
+KPX Ograve Abreve -40
+KPX Ograve Acircumflex -40
+KPX Ograve Adieresis -40
+KPX Ograve Agrave -40
+KPX Ograve Amacron -40
+KPX Ograve Aogonek -40
+KPX Ograve Aring -40
+KPX Ograve Atilde -40
+KPX Ograve T -40
+KPX Ograve Tcaron -40
+KPX Ograve Tcommaaccent -40
+KPX Ograve V -50
+KPX Ograve W -50
+KPX Ograve X -40
+KPX Ograve Y -50
+KPX Ograve Yacute -50
+KPX Ograve Ydieresis -50
+KPX Ohungarumlaut A -40
+KPX Ohungarumlaut Aacute -40
+KPX Ohungarumlaut Abreve -40
+KPX Ohungarumlaut Acircumflex -40
+KPX Ohungarumlaut Adieresis -40
+KPX Ohungarumlaut Agrave -40
+KPX Ohungarumlaut Amacron -40
+KPX Ohungarumlaut Aogonek -40
+KPX Ohungarumlaut Aring -40
+KPX Ohungarumlaut Atilde -40
+KPX Ohungarumlaut T -40
+KPX Ohungarumlaut Tcaron -40
+KPX Ohungarumlaut Tcommaaccent -40
+KPX Ohungarumlaut V -50
+KPX Ohungarumlaut W -50
+KPX Ohungarumlaut X -40
+KPX Ohungarumlaut Y -50
+KPX Ohungarumlaut Yacute -50
+KPX Ohungarumlaut Ydieresis -50
+KPX Omacron A -40
+KPX Omacron Aacute -40
+KPX Omacron Abreve -40
+KPX Omacron Acircumflex -40
+KPX Omacron Adieresis -40
+KPX Omacron Agrave -40
+KPX Omacron Amacron -40
+KPX Omacron Aogonek -40
+KPX Omacron Aring -40
+KPX Omacron Atilde -40
+KPX Omacron T -40
+KPX Omacron Tcaron -40
+KPX Omacron Tcommaaccent -40
+KPX Omacron V -50
+KPX Omacron W -50
+KPX Omacron X -40
+KPX Omacron Y -50
+KPX Omacron Yacute -50
+KPX Omacron Ydieresis -50
+KPX Oslash A -40
+KPX Oslash Aacute -40
+KPX Oslash Abreve -40
+KPX Oslash Acircumflex -40
+KPX Oslash Adieresis -40
+KPX Oslash Agrave -40
+KPX Oslash Amacron -40
+KPX Oslash Aogonek -40
+KPX Oslash Aring -40
+KPX Oslash Atilde -40
+KPX Oslash T -40
+KPX Oslash Tcaron -40
+KPX Oslash Tcommaaccent -40
+KPX Oslash V -50
+KPX Oslash W -50
+KPX Oslash X -40
+KPX Oslash Y -50
+KPX Oslash Yacute -50
+KPX Oslash Ydieresis -50
+KPX Otilde A -40
+KPX Otilde Aacute -40
+KPX Otilde Abreve -40
+KPX Otilde Acircumflex -40
+KPX Otilde Adieresis -40
+KPX Otilde Agrave -40
+KPX Otilde Amacron -40
+KPX Otilde Aogonek -40
+KPX Otilde Aring -40
+KPX Otilde Atilde -40
+KPX Otilde T -40
+KPX Otilde Tcaron -40
+KPX Otilde Tcommaaccent -40
+KPX Otilde V -50
+KPX Otilde W -50
+KPX Otilde X -40
+KPX Otilde Y -50
+KPX Otilde Yacute -50
+KPX Otilde Ydieresis -50
+KPX P A -74
+KPX P Aacute -74
+KPX P Abreve -74
+KPX P Acircumflex -74
+KPX P Adieresis -74
+KPX P Agrave -74
+KPX P Amacron -74
+KPX P Aogonek -74
+KPX P Aring -74
+KPX P Atilde -74
+KPX P a -10
+KPX P aacute -10
+KPX P abreve -10
+KPX P acircumflex -10
+KPX P adieresis -10
+KPX P agrave -10
+KPX P amacron -10
+KPX P aogonek -10
+KPX P aring -10
+KPX P atilde -10
+KPX P comma -92
+KPX P e -20
+KPX P eacute -20
+KPX P ecaron -20
+KPX P ecircumflex -20
+KPX P edieresis -20
+KPX P edotaccent -20
+KPX P egrave -20
+KPX P emacron -20
+KPX P eogonek -20
+KPX P o -20
+KPX P oacute -20
+KPX P ocircumflex -20
+KPX P odieresis -20
+KPX P ograve -20
+KPX P ohungarumlaut -20
+KPX P omacron -20
+KPX P oslash -20
+KPX P otilde -20
+KPX P period -110
+KPX Q U -10
+KPX Q Uacute -10
+KPX Q Ucircumflex -10
+KPX Q Udieresis -10
+KPX Q Ugrave -10
+KPX Q Uhungarumlaut -10
+KPX Q Umacron -10
+KPX Q Uogonek -10
+KPX Q Uring -10
+KPX Q period -20
+KPX R O -30
+KPX R Oacute -30
+KPX R Ocircumflex -30
+KPX R Odieresis -30
+KPX R Ograve -30
+KPX R Ohungarumlaut -30
+KPX R Omacron -30
+KPX R Oslash -30
+KPX R Otilde -30
+KPX R T -40
+KPX R Tcaron -40
+KPX R Tcommaaccent -40
+KPX R U -30
+KPX R Uacute -30
+KPX R Ucircumflex -30
+KPX R Udieresis -30
+KPX R Ugrave -30
+KPX R Uhungarumlaut -30
+KPX R Umacron -30
+KPX R Uogonek -30
+KPX R Uring -30
+KPX R V -55
+KPX R W -35
+KPX R Y -35
+KPX R Yacute -35
+KPX R Ydieresis -35
+KPX Racute O -30
+KPX Racute Oacute -30
+KPX Racute Ocircumflex -30
+KPX Racute Odieresis -30
+KPX Racute Ograve -30
+KPX Racute Ohungarumlaut -30
+KPX Racute Omacron -30
+KPX Racute Oslash -30
+KPX Racute Otilde -30
+KPX Racute T -40
+KPX Racute Tcaron -40
+KPX Racute Tcommaaccent -40
+KPX Racute U -30
+KPX Racute Uacute -30
+KPX Racute Ucircumflex -30
+KPX Racute Udieresis -30
+KPX Racute Ugrave -30
+KPX Racute Uhungarumlaut -30
+KPX Racute Umacron -30
+KPX Racute Uogonek -30
+KPX Racute Uring -30
+KPX Racute V -55
+KPX Racute W -35
+KPX Racute Y -35
+KPX Racute Yacute -35
+KPX Racute Ydieresis -35
+KPX Rcaron O -30
+KPX Rcaron Oacute -30
+KPX Rcaron Ocircumflex -30
+KPX Rcaron Odieresis -30
+KPX Rcaron Ograve -30
+KPX Rcaron Ohungarumlaut -30
+KPX Rcaron Omacron -30
+KPX Rcaron Oslash -30
+KPX Rcaron Otilde -30
+KPX Rcaron T -40
+KPX Rcaron Tcaron -40
+KPX Rcaron Tcommaaccent -40
+KPX Rcaron U -30
+KPX Rcaron Uacute -30
+KPX Rcaron Ucircumflex -30
+KPX Rcaron Udieresis -30
+KPX Rcaron Ugrave -30
+KPX Rcaron Uhungarumlaut -30
+KPX Rcaron Umacron -30
+KPX Rcaron Uogonek -30
+KPX Rcaron Uring -30
+KPX Rcaron V -55
+KPX Rcaron W -35
+KPX Rcaron Y -35
+KPX Rcaron Yacute -35
+KPX Rcaron Ydieresis -35
+KPX Rcommaaccent O -30
+KPX Rcommaaccent Oacute -30
+KPX Rcommaaccent Ocircumflex -30
+KPX Rcommaaccent Odieresis -30
+KPX Rcommaaccent Ograve -30
+KPX Rcommaaccent Ohungarumlaut -30
+KPX Rcommaaccent Omacron -30
+KPX Rcommaaccent Oslash -30
+KPX Rcommaaccent Otilde -30
+KPX Rcommaaccent T -40
+KPX Rcommaaccent Tcaron -40
+KPX Rcommaaccent Tcommaaccent -40
+KPX Rcommaaccent U -30
+KPX Rcommaaccent Uacute -30
+KPX Rcommaaccent Ucircumflex -30
+KPX Rcommaaccent Udieresis -30
+KPX Rcommaaccent Ugrave -30
+KPX Rcommaaccent Uhungarumlaut -30
+KPX Rcommaaccent Umacron -30
+KPX Rcommaaccent Uogonek -30
+KPX Rcommaaccent Uring -30
+KPX Rcommaaccent V -55
+KPX Rcommaaccent W -35
+KPX Rcommaaccent Y -35
+KPX Rcommaaccent Yacute -35
+KPX Rcommaaccent Ydieresis -35
+KPX T A -90
+KPX T Aacute -90
+KPX T Abreve -90
+KPX T Acircumflex -90
+KPX T Adieresis -90
+KPX T Agrave -90
+KPX T Amacron -90
+KPX T Aogonek -90
+KPX T Aring -90
+KPX T Atilde -90
+KPX T O -18
+KPX T Oacute -18
+KPX T Ocircumflex -18
+KPX T Odieresis -18
+KPX T Ograve -18
+KPX T Ohungarumlaut -18
+KPX T Omacron -18
+KPX T Oslash -18
+KPX T Otilde -18
+KPX T a -92
+KPX T aacute -92
+KPX T abreve -52
+KPX T acircumflex -52
+KPX T adieresis -52
+KPX T agrave -52
+KPX T amacron -52
+KPX T aogonek -92
+KPX T aring -92
+KPX T atilde -52
+KPX T colon -74
+KPX T comma -74
+KPX T e -92
+KPX T eacute -92
+KPX T ecaron -92
+KPX T ecircumflex -92
+KPX T edieresis -52
+KPX T edotaccent -92
+KPX T egrave -52
+KPX T emacron -52
+KPX T eogonek -92
+KPX T hyphen -92
+KPX T i -18
+KPX T iacute -18
+KPX T iogonek -18
+KPX T o -92
+KPX T oacute -92
+KPX T ocircumflex -92
+KPX T odieresis -92
+KPX T ograve -92
+KPX T ohungarumlaut -92
+KPX T omacron -92
+KPX T oslash -92
+KPX T otilde -92
+KPX T period -90
+KPX T r -74
+KPX T racute -74
+KPX T rcaron -74
+KPX T rcommaaccent -74
+KPX T semicolon -74
+KPX T u -92
+KPX T uacute -92
+KPX T ucircumflex -92
+KPX T udieresis -92
+KPX T ugrave -92
+KPX T uhungarumlaut -92
+KPX T umacron -92
+KPX T uogonek -92
+KPX T uring -92
+KPX T w -74
+KPX T y -34
+KPX T yacute -34
+KPX T ydieresis -34
+KPX Tcaron A -90
+KPX Tcaron Aacute -90
+KPX Tcaron Abreve -90
+KPX Tcaron Acircumflex -90
+KPX Tcaron Adieresis -90
+KPX Tcaron Agrave -90
+KPX Tcaron Amacron -90
+KPX Tcaron Aogonek -90
+KPX Tcaron Aring -90
+KPX Tcaron Atilde -90
+KPX Tcaron O -18
+KPX Tcaron Oacute -18
+KPX Tcaron Ocircumflex -18
+KPX Tcaron Odieresis -18
+KPX Tcaron Ograve -18
+KPX Tcaron Ohungarumlaut -18
+KPX Tcaron Omacron -18
+KPX Tcaron Oslash -18
+KPX Tcaron Otilde -18
+KPX Tcaron a -92
+KPX Tcaron aacute -92
+KPX Tcaron abreve -52
+KPX Tcaron acircumflex -52
+KPX Tcaron adieresis -52
+KPX Tcaron agrave -52
+KPX Tcaron amacron -52
+KPX Tcaron aogonek -92
+KPX Tcaron aring -92
+KPX Tcaron atilde -52
+KPX Tcaron colon -74
+KPX Tcaron comma -74
+KPX Tcaron e -92
+KPX Tcaron eacute -92
+KPX Tcaron ecaron -92
+KPX Tcaron ecircumflex -92
+KPX Tcaron edieresis -52
+KPX Tcaron edotaccent -92
+KPX Tcaron egrave -52
+KPX Tcaron emacron -52
+KPX Tcaron eogonek -92
+KPX Tcaron hyphen -92
+KPX Tcaron i -18
+KPX Tcaron iacute -18
+KPX Tcaron iogonek -18
+KPX Tcaron o -92
+KPX Tcaron oacute -92
+KPX Tcaron ocircumflex -92
+KPX Tcaron odieresis -92
+KPX Tcaron ograve -92
+KPX Tcaron ohungarumlaut -92
+KPX Tcaron omacron -92
+KPX Tcaron oslash -92
+KPX Tcaron otilde -92
+KPX Tcaron period -90
+KPX Tcaron r -74
+KPX Tcaron racute -74
+KPX Tcaron rcaron -74
+KPX Tcaron rcommaaccent -74
+KPX Tcaron semicolon -74
+KPX Tcaron u -92
+KPX Tcaron uacute -92
+KPX Tcaron ucircumflex -92
+KPX Tcaron udieresis -92
+KPX Tcaron ugrave -92
+KPX Tcaron uhungarumlaut -92
+KPX Tcaron umacron -92
+KPX Tcaron uogonek -92
+KPX Tcaron uring -92
+KPX Tcaron w -74
+KPX Tcaron y -34
+KPX Tcaron yacute -34
+KPX Tcaron ydieresis -34
+KPX Tcommaaccent A -90
+KPX Tcommaaccent Aacute -90
+KPX Tcommaaccent Abreve -90
+KPX Tcommaaccent Acircumflex -90
+KPX Tcommaaccent Adieresis -90
+KPX Tcommaaccent Agrave -90
+KPX Tcommaaccent Amacron -90
+KPX Tcommaaccent Aogonek -90
+KPX Tcommaaccent Aring -90
+KPX Tcommaaccent Atilde -90
+KPX Tcommaaccent O -18
+KPX Tcommaaccent Oacute -18
+KPX Tcommaaccent Ocircumflex -18
+KPX Tcommaaccent Odieresis -18
+KPX Tcommaaccent Ograve -18
+KPX Tcommaaccent Ohungarumlaut -18
+KPX Tcommaaccent Omacron -18
+KPX Tcommaaccent Oslash -18
+KPX Tcommaaccent Otilde -18
+KPX Tcommaaccent a -92
+KPX Tcommaaccent aacute -92
+KPX Tcommaaccent abreve -52
+KPX Tcommaaccent acircumflex -52
+KPX Tcommaaccent adieresis -52
+KPX Tcommaaccent agrave -52
+KPX Tcommaaccent amacron -52
+KPX Tcommaaccent aogonek -92
+KPX Tcommaaccent aring -92
+KPX Tcommaaccent atilde -52
+KPX Tcommaaccent colon -74
+KPX Tcommaaccent comma -74
+KPX Tcommaaccent e -92
+KPX Tcommaaccent eacute -92
+KPX Tcommaaccent ecaron -92
+KPX Tcommaaccent ecircumflex -92
+KPX Tcommaaccent edieresis -52
+KPX Tcommaaccent edotaccent -92
+KPX Tcommaaccent egrave -52
+KPX Tcommaaccent emacron -52
+KPX Tcommaaccent eogonek -92
+KPX Tcommaaccent hyphen -92
+KPX Tcommaaccent i -18
+KPX Tcommaaccent iacute -18
+KPX Tcommaaccent iogonek -18
+KPX Tcommaaccent o -92
+KPX Tcommaaccent oacute -92
+KPX Tcommaaccent ocircumflex -92
+KPX Tcommaaccent odieresis -92
+KPX Tcommaaccent ograve -92
+KPX Tcommaaccent ohungarumlaut -92
+KPX Tcommaaccent omacron -92
+KPX Tcommaaccent oslash -92
+KPX Tcommaaccent otilde -92
+KPX Tcommaaccent period -90
+KPX Tcommaaccent r -74
+KPX Tcommaaccent racute -74
+KPX Tcommaaccent rcaron -74
+KPX Tcommaaccent rcommaaccent -74
+KPX Tcommaaccent semicolon -74
+KPX Tcommaaccent u -92
+KPX Tcommaaccent uacute -92
+KPX Tcommaaccent ucircumflex -92
+KPX Tcommaaccent udieresis -92
+KPX Tcommaaccent ugrave -92
+KPX Tcommaaccent uhungarumlaut -92
+KPX Tcommaaccent umacron -92
+KPX Tcommaaccent uogonek -92
+KPX Tcommaaccent uring -92
+KPX Tcommaaccent w -74
+KPX Tcommaaccent y -34
+KPX Tcommaaccent yacute -34
+KPX Tcommaaccent ydieresis -34
+KPX U A -60
+KPX U Aacute -60
+KPX U Abreve -60
+KPX U Acircumflex -60
+KPX U Adieresis -60
+KPX U Agrave -60
+KPX U Amacron -60
+KPX U Aogonek -60
+KPX U Aring -60
+KPX U Atilde -60
+KPX U comma -50
+KPX U period -50
+KPX Uacute A -60
+KPX Uacute Aacute -60
+KPX Uacute Abreve -60
+KPX Uacute Acircumflex -60
+KPX Uacute Adieresis -60
+KPX Uacute Agrave -60
+KPX Uacute Amacron -60
+KPX Uacute Aogonek -60
+KPX Uacute Aring -60
+KPX Uacute Atilde -60
+KPX Uacute comma -50
+KPX Uacute period -50
+KPX Ucircumflex A -60
+KPX Ucircumflex Aacute -60
+KPX Ucircumflex Abreve -60
+KPX Ucircumflex Acircumflex -60
+KPX Ucircumflex Adieresis -60
+KPX Ucircumflex Agrave -60
+KPX Ucircumflex Amacron -60
+KPX Ucircumflex Aogonek -60
+KPX Ucircumflex Aring -60
+KPX Ucircumflex Atilde -60
+KPX Ucircumflex comma -50
+KPX Ucircumflex period -50
+KPX Udieresis A -60
+KPX Udieresis Aacute -60
+KPX Udieresis Abreve -60
+KPX Udieresis Acircumflex -60
+KPX Udieresis Adieresis -60
+KPX Udieresis Agrave -60
+KPX Udieresis Amacron -60
+KPX Udieresis Aogonek -60
+KPX Udieresis Aring -60
+KPX Udieresis Atilde -60
+KPX Udieresis comma -50
+KPX Udieresis period -50
+KPX Ugrave A -60
+KPX Ugrave Aacute -60
+KPX Ugrave Abreve -60
+KPX Ugrave Acircumflex -60
+KPX Ugrave Adieresis -60
+KPX Ugrave Agrave -60
+KPX Ugrave Amacron -60
+KPX Ugrave Aogonek -60
+KPX Ugrave Aring -60
+KPX Ugrave Atilde -60
+KPX Ugrave comma -50
+KPX Ugrave period -50
+KPX Uhungarumlaut A -60
+KPX Uhungarumlaut Aacute -60
+KPX Uhungarumlaut Abreve -60
+KPX Uhungarumlaut Acircumflex -60
+KPX Uhungarumlaut Adieresis -60
+KPX Uhungarumlaut Agrave -60
+KPX Uhungarumlaut Amacron -60
+KPX Uhungarumlaut Aogonek -60
+KPX Uhungarumlaut Aring -60
+KPX Uhungarumlaut Atilde -60
+KPX Uhungarumlaut comma -50
+KPX Uhungarumlaut period -50
+KPX Umacron A -60
+KPX Umacron Aacute -60
+KPX Umacron Abreve -60
+KPX Umacron Acircumflex -60
+KPX Umacron Adieresis -60
+KPX Umacron Agrave -60
+KPX Umacron Amacron -60
+KPX Umacron Aogonek -60
+KPX Umacron Aring -60
+KPX Umacron Atilde -60
+KPX Umacron comma -50
+KPX Umacron period -50
+KPX Uogonek A -60
+KPX Uogonek Aacute -60
+KPX Uogonek Abreve -60
+KPX Uogonek Acircumflex -60
+KPX Uogonek Adieresis -60
+KPX Uogonek Agrave -60
+KPX Uogonek Amacron -60
+KPX Uogonek Aogonek -60
+KPX Uogonek Aring -60
+KPX Uogonek Atilde -60
+KPX Uogonek comma -50
+KPX Uogonek period -50
+KPX Uring A -60
+KPX Uring Aacute -60
+KPX Uring Abreve -60
+KPX Uring Acircumflex -60
+KPX Uring Adieresis -60
+KPX Uring Agrave -60
+KPX Uring Amacron -60
+KPX Uring Aogonek -60
+KPX Uring Aring -60
+KPX Uring Atilde -60
+KPX Uring comma -50
+KPX Uring period -50
+KPX V A -135
+KPX V Aacute -135
+KPX V Abreve -135
+KPX V Acircumflex -135
+KPX V Adieresis -135
+KPX V Agrave -135
+KPX V Amacron -135
+KPX V Aogonek -135
+KPX V Aring -135
+KPX V Atilde -135
+KPX V G -30
+KPX V Gbreve -30
+KPX V Gcommaaccent -30
+KPX V O -45
+KPX V Oacute -45
+KPX V Ocircumflex -45
+KPX V Odieresis -45
+KPX V Ograve -45
+KPX V Ohungarumlaut -45
+KPX V Omacron -45
+KPX V Oslash -45
+KPX V Otilde -45
+KPX V a -92
+KPX V aacute -92
+KPX V abreve -92
+KPX V acircumflex -92
+KPX V adieresis -92
+KPX V agrave -92
+KPX V amacron -92
+KPX V aogonek -92
+KPX V aring -92
+KPX V atilde -92
+KPX V colon -92
+KPX V comma -129
+KPX V e -100
+KPX V eacute -100
+KPX V ecaron -100
+KPX V ecircumflex -100
+KPX V edieresis -100
+KPX V edotaccent -100
+KPX V egrave -100
+KPX V emacron -100
+KPX V eogonek -100
+KPX V hyphen -74
+KPX V i -37
+KPX V iacute -37
+KPX V icircumflex -37
+KPX V idieresis -37
+KPX V igrave -37
+KPX V imacron -37
+KPX V iogonek -37
+KPX V o -100
+KPX V oacute -100
+KPX V ocircumflex -100
+KPX V odieresis -100
+KPX V ograve -100
+KPX V ohungarumlaut -100
+KPX V omacron -100
+KPX V oslash -100
+KPX V otilde -100
+KPX V period -145
+KPX V semicolon -92
+KPX V u -92
+KPX V uacute -92
+KPX V ucircumflex -92
+KPX V udieresis -92
+KPX V ugrave -92
+KPX V uhungarumlaut -92
+KPX V umacron -92
+KPX V uogonek -92
+KPX V uring -92
+KPX W A -120
+KPX W Aacute -120
+KPX W Abreve -120
+KPX W Acircumflex -120
+KPX W Adieresis -120
+KPX W Agrave -120
+KPX W Amacron -120
+KPX W Aogonek -120
+KPX W Aring -120
+KPX W Atilde -120
+KPX W O -10
+KPX W Oacute -10
+KPX W Ocircumflex -10
+KPX W Odieresis -10
+KPX W Ograve -10
+KPX W Ohungarumlaut -10
+KPX W Omacron -10
+KPX W Oslash -10
+KPX W Otilde -10
+KPX W a -65
+KPX W aacute -65
+KPX W abreve -65
+KPX W acircumflex -65
+KPX W adieresis -65
+KPX W agrave -65
+KPX W amacron -65
+KPX W aogonek -65
+KPX W aring -65
+KPX W atilde -65
+KPX W colon -55
+KPX W comma -92
+KPX W e -65
+KPX W eacute -65
+KPX W ecaron -65
+KPX W ecircumflex -65
+KPX W edieresis -65
+KPX W edotaccent -65
+KPX W egrave -65
+KPX W emacron -65
+KPX W eogonek -65
+KPX W hyphen -37
+KPX W i -18
+KPX W iacute -18
+KPX W iogonek -18
+KPX W o -75
+KPX W oacute -75
+KPX W ocircumflex -75
+KPX W odieresis -75
+KPX W ograve -75
+KPX W ohungarumlaut -75
+KPX W omacron -75
+KPX W oslash -75
+KPX W otilde -75
+KPX W period -92
+KPX W semicolon -55
+KPX W u -50
+KPX W uacute -50
+KPX W ucircumflex -50
+KPX W udieresis -50
+KPX W ugrave -50
+KPX W uhungarumlaut -50
+KPX W umacron -50
+KPX W uogonek -50
+KPX W uring -50
+KPX W y -60
+KPX W yacute -60
+KPX W ydieresis -60
+KPX Y A -110
+KPX Y Aacute -110
+KPX Y Abreve -110
+KPX Y Acircumflex -110
+KPX Y Adieresis -110
+KPX Y Agrave -110
+KPX Y Amacron -110
+KPX Y Aogonek -110
+KPX Y Aring -110
+KPX Y Atilde -110
+KPX Y O -35
+KPX Y Oacute -35
+KPX Y Ocircumflex -35
+KPX Y Odieresis -35
+KPX Y Ograve -35
+KPX Y Ohungarumlaut -35
+KPX Y Omacron -35
+KPX Y Oslash -35
+KPX Y Otilde -35
+KPX Y a -85
+KPX Y aacute -85
+KPX Y abreve -85
+KPX Y acircumflex -85
+KPX Y adieresis -85
+KPX Y agrave -85
+KPX Y amacron -85
+KPX Y aogonek -85
+KPX Y aring -85
+KPX Y atilde -85
+KPX Y colon -92
+KPX Y comma -92
+KPX Y e -111
+KPX Y eacute -111
+KPX Y ecaron -111
+KPX Y ecircumflex -111
+KPX Y edieresis -71
+KPX Y edotaccent -111
+KPX Y egrave -71
+KPX Y emacron -71
+KPX Y eogonek -111
+KPX Y hyphen -92
+KPX Y i -37
+KPX Y iacute -37
+KPX Y iogonek -37
+KPX Y o -111
+KPX Y oacute -111
+KPX Y ocircumflex -111
+KPX Y odieresis -111
+KPX Y ograve -111
+KPX Y ohungarumlaut -111
+KPX Y omacron -111
+KPX Y oslash -111
+KPX Y otilde -111
+KPX Y period -92
+KPX Y semicolon -92
+KPX Y u -92
+KPX Y uacute -92
+KPX Y ucircumflex -92
+KPX Y udieresis -92
+KPX Y ugrave -92
+KPX Y uhungarumlaut -92
+KPX Y umacron -92
+KPX Y uogonek -92
+KPX Y uring -92
+KPX Yacute A -110
+KPX Yacute Aacute -110
+KPX Yacute Abreve -110
+KPX Yacute Acircumflex -110
+KPX Yacute Adieresis -110
+KPX Yacute Agrave -110
+KPX Yacute Amacron -110
+KPX Yacute Aogonek -110
+KPX Yacute Aring -110
+KPX Yacute Atilde -110
+KPX Yacute O -35
+KPX Yacute Oacute -35
+KPX Yacute Ocircumflex -35
+KPX Yacute Odieresis -35
+KPX Yacute Ograve -35
+KPX Yacute Ohungarumlaut -35
+KPX Yacute Omacron -35
+KPX Yacute Oslash -35
+KPX Yacute Otilde -35
+KPX Yacute a -85
+KPX Yacute aacute -85
+KPX Yacute abreve -85
+KPX Yacute acircumflex -85
+KPX Yacute adieresis -85
+KPX Yacute agrave -85
+KPX Yacute amacron -85
+KPX Yacute aogonek -85
+KPX Yacute aring -85
+KPX Yacute atilde -85
+KPX Yacute colon -92
+KPX Yacute comma -92
+KPX Yacute e -111
+KPX Yacute eacute -111
+KPX Yacute ecaron -111
+KPX Yacute ecircumflex -111
+KPX Yacute edieresis -71
+KPX Yacute edotaccent -111
+KPX Yacute egrave -71
+KPX Yacute emacron -71
+KPX Yacute eogonek -111
+KPX Yacute hyphen -92
+KPX Yacute i -37
+KPX Yacute iacute -37
+KPX Yacute iogonek -37
+KPX Yacute o -111
+KPX Yacute oacute -111
+KPX Yacute ocircumflex -111
+KPX Yacute odieresis -111
+KPX Yacute ograve -111
+KPX Yacute ohungarumlaut -111
+KPX Yacute omacron -111
+KPX Yacute oslash -111
+KPX Yacute otilde -111
+KPX Yacute period -92
+KPX Yacute semicolon -92
+KPX Yacute u -92
+KPX Yacute uacute -92
+KPX Yacute ucircumflex -92
+KPX Yacute udieresis -92
+KPX Yacute ugrave -92
+KPX Yacute uhungarumlaut -92
+KPX Yacute umacron -92
+KPX Yacute uogonek -92
+KPX Yacute uring -92
+KPX Ydieresis A -110
+KPX Ydieresis Aacute -110
+KPX Ydieresis Abreve -110
+KPX Ydieresis Acircumflex -110
+KPX Ydieresis Adieresis -110
+KPX Ydieresis Agrave -110
+KPX Ydieresis Amacron -110
+KPX Ydieresis Aogonek -110
+KPX Ydieresis Aring -110
+KPX Ydieresis Atilde -110
+KPX Ydieresis O -35
+KPX Ydieresis Oacute -35
+KPX Ydieresis Ocircumflex -35
+KPX Ydieresis Odieresis -35
+KPX Ydieresis Ograve -35
+KPX Ydieresis Ohungarumlaut -35
+KPX Ydieresis Omacron -35
+KPX Ydieresis Oslash -35
+KPX Ydieresis Otilde -35
+KPX Ydieresis a -85
+KPX Ydieresis aacute -85
+KPX Ydieresis abreve -85
+KPX Ydieresis acircumflex -85
+KPX Ydieresis adieresis -85
+KPX Ydieresis agrave -85
+KPX Ydieresis amacron -85
+KPX Ydieresis aogonek -85
+KPX Ydieresis aring -85
+KPX Ydieresis atilde -85
+KPX Ydieresis colon -92
+KPX Ydieresis comma -92
+KPX Ydieresis e -111
+KPX Ydieresis eacute -111
+KPX Ydieresis ecaron -111
+KPX Ydieresis ecircumflex -111
+KPX Ydieresis edieresis -71
+KPX Ydieresis edotaccent -111
+KPX Ydieresis egrave -71
+KPX Ydieresis emacron -71
+KPX Ydieresis eogonek -111
+KPX Ydieresis hyphen -92
+KPX Ydieresis i -37
+KPX Ydieresis iacute -37
+KPX Ydieresis iogonek -37
+KPX Ydieresis o -111
+KPX Ydieresis oacute -111
+KPX Ydieresis ocircumflex -111
+KPX Ydieresis odieresis -111
+KPX Ydieresis ograve -111
+KPX Ydieresis ohungarumlaut -111
+KPX Ydieresis omacron -111
+KPX Ydieresis oslash -111
+KPX Ydieresis otilde -111
+KPX Ydieresis period -92
+KPX Ydieresis semicolon -92
+KPX Ydieresis u -92
+KPX Ydieresis uacute -92
+KPX Ydieresis ucircumflex -92
+KPX Ydieresis udieresis -92
+KPX Ydieresis ugrave -92
+KPX Ydieresis uhungarumlaut -92
+KPX Ydieresis umacron -92
+KPX Ydieresis uogonek -92
+KPX Ydieresis uring -92
+KPX a v -25
+KPX aacute v -25
+KPX abreve v -25
+KPX acircumflex v -25
+KPX adieresis v -25
+KPX agrave v -25
+KPX amacron v -25
+KPX aogonek v -25
+KPX aring v -25
+KPX atilde v -25
+KPX b b -10
+KPX b period -40
+KPX b u -20
+KPX b uacute -20
+KPX b ucircumflex -20
+KPX b udieresis -20
+KPX b ugrave -20
+KPX b uhungarumlaut -20
+KPX b umacron -20
+KPX b uogonek -20
+KPX b uring -20
+KPX b v -15
+KPX comma quotedblright -45
+KPX comma quoteright -55
+KPX d w -15
+KPX dcroat w -15
+KPX e v -15
+KPX eacute v -15
+KPX ecaron v -15
+KPX ecircumflex v -15
+KPX edieresis v -15
+KPX edotaccent v -15
+KPX egrave v -15
+KPX emacron v -15
+KPX eogonek v -15
+KPX f comma -15
+KPX f dotlessi -35
+KPX f i -25
+KPX f o -25
+KPX f oacute -25
+KPX f ocircumflex -25
+KPX f odieresis -25
+KPX f ograve -25
+KPX f ohungarumlaut -25
+KPX f omacron -25
+KPX f oslash -25
+KPX f otilde -25
+KPX f period -15
+KPX f quotedblright 50
+KPX f quoteright 55
+KPX g period -15
+KPX gbreve period -15
+KPX gcommaaccent period -15
+KPX h y -15
+KPX h yacute -15
+KPX h ydieresis -15
+KPX i v -10
+KPX iacute v -10
+KPX icircumflex v -10
+KPX idieresis v -10
+KPX igrave v -10
+KPX imacron v -10
+KPX iogonek v -10
+KPX k e -10
+KPX k eacute -10
+KPX k ecaron -10
+KPX k ecircumflex -10
+KPX k edieresis -10
+KPX k edotaccent -10
+KPX k egrave -10
+KPX k emacron -10
+KPX k eogonek -10
+KPX k o -15
+KPX k oacute -15
+KPX k ocircumflex -15
+KPX k odieresis -15
+KPX k ograve -15
+KPX k ohungarumlaut -15
+KPX k omacron -15
+KPX k oslash -15
+KPX k otilde -15
+KPX k y -15
+KPX k yacute -15
+KPX k ydieresis -15
+KPX kcommaaccent e -10
+KPX kcommaaccent eacute -10
+KPX kcommaaccent ecaron -10
+KPX kcommaaccent ecircumflex -10
+KPX kcommaaccent edieresis -10
+KPX kcommaaccent edotaccent -10
+KPX kcommaaccent egrave -10
+KPX kcommaaccent emacron -10
+KPX kcommaaccent eogonek -10
+KPX kcommaaccent o -15
+KPX kcommaaccent oacute -15
+KPX kcommaaccent ocircumflex -15
+KPX kcommaaccent odieresis -15
+KPX kcommaaccent ograve -15
+KPX kcommaaccent ohungarumlaut -15
+KPX kcommaaccent omacron -15
+KPX kcommaaccent oslash -15
+KPX kcommaaccent otilde -15
+KPX kcommaaccent y -15
+KPX kcommaaccent yacute -15
+KPX kcommaaccent ydieresis -15
+KPX n v -40
+KPX nacute v -40
+KPX ncaron v -40
+KPX ncommaaccent v -40
+KPX ntilde v -40
+KPX o v -10
+KPX o w -10
+KPX oacute v -10
+KPX oacute w -10
+KPX ocircumflex v -10
+KPX ocircumflex w -10
+KPX odieresis v -10
+KPX odieresis w -10
+KPX ograve v -10
+KPX ograve w -10
+KPX ohungarumlaut v -10
+KPX ohungarumlaut w -10
+KPX omacron v -10
+KPX omacron w -10
+KPX oslash v -10
+KPX oslash w -10
+KPX otilde v -10
+KPX otilde w -10
+KPX period quotedblright -55
+KPX period quoteright -55
+KPX quotedblleft A -10
+KPX quotedblleft Aacute -10
+KPX quotedblleft Abreve -10
+KPX quotedblleft Acircumflex -10
+KPX quotedblleft Adieresis -10
+KPX quotedblleft Agrave -10
+KPX quotedblleft Amacron -10
+KPX quotedblleft Aogonek -10
+KPX quotedblleft Aring -10
+KPX quotedblleft Atilde -10
+KPX quoteleft A -10
+KPX quoteleft Aacute -10
+KPX quoteleft Abreve -10
+KPX quoteleft Acircumflex -10
+KPX quoteleft Adieresis -10
+KPX quoteleft Agrave -10
+KPX quoteleft Amacron -10
+KPX quoteleft Aogonek -10
+KPX quoteleft Aring -10
+KPX quoteleft Atilde -10
+KPX quoteleft quoteleft -63
+KPX quoteright d -20
+KPX quoteright dcroat -20
+KPX quoteright quoteright -63
+KPX quoteright r -20
+KPX quoteright racute -20
+KPX quoteright rcaron -20
+KPX quoteright rcommaaccent -20
+KPX quoteright s -37
+KPX quoteright sacute -37
+KPX quoteright scaron -37
+KPX quoteright scedilla -37
+KPX quoteright scommaaccent -37
+KPX quoteright space -74
+KPX quoteright v -20
+KPX r c -18
+KPX r cacute -18
+KPX r ccaron -18
+KPX r ccedilla -18
+KPX r comma -92
+KPX r e -18
+KPX r eacute -18
+KPX r ecaron -18
+KPX r ecircumflex -18
+KPX r edieresis -18
+KPX r edotaccent -18
+KPX r egrave -18
+KPX r emacron -18
+KPX r eogonek -18
+KPX r g -10
+KPX r gbreve -10
+KPX r gcommaaccent -10
+KPX r hyphen -37
+KPX r n -15
+KPX r nacute -15
+KPX r ncaron -15
+KPX r ncommaaccent -15
+KPX r ntilde -15
+KPX r o -18
+KPX r oacute -18
+KPX r ocircumflex -18
+KPX r odieresis -18
+KPX r ograve -18
+KPX r ohungarumlaut -18
+KPX r omacron -18
+KPX r oslash -18
+KPX r otilde -18
+KPX r p -10
+KPX r period -100
+KPX r q -18
+KPX r v -10
+KPX racute c -18
+KPX racute cacute -18
+KPX racute ccaron -18
+KPX racute ccedilla -18
+KPX racute comma -92
+KPX racute e -18
+KPX racute eacute -18
+KPX racute ecaron -18
+KPX racute ecircumflex -18
+KPX racute edieresis -18
+KPX racute edotaccent -18
+KPX racute egrave -18
+KPX racute emacron -18
+KPX racute eogonek -18
+KPX racute g -10
+KPX racute gbreve -10
+KPX racute gcommaaccent -10
+KPX racute hyphen -37
+KPX racute n -15
+KPX racute nacute -15
+KPX racute ncaron -15
+KPX racute ncommaaccent -15
+KPX racute ntilde -15
+KPX racute o -18
+KPX racute oacute -18
+KPX racute ocircumflex -18
+KPX racute odieresis -18
+KPX racute ograve -18
+KPX racute ohungarumlaut -18
+KPX racute omacron -18
+KPX racute oslash -18
+KPX racute otilde -18
+KPX racute p -10
+KPX racute period -100
+KPX racute q -18
+KPX racute v -10
+KPX rcaron c -18
+KPX rcaron cacute -18
+KPX rcaron ccaron -18
+KPX rcaron ccedilla -18
+KPX rcaron comma -92
+KPX rcaron e -18
+KPX rcaron eacute -18
+KPX rcaron ecaron -18
+KPX rcaron ecircumflex -18
+KPX rcaron edieresis -18
+KPX rcaron edotaccent -18
+KPX rcaron egrave -18
+KPX rcaron emacron -18
+KPX rcaron eogonek -18
+KPX rcaron g -10
+KPX rcaron gbreve -10
+KPX rcaron gcommaaccent -10
+KPX rcaron hyphen -37
+KPX rcaron n -15
+KPX rcaron nacute -15
+KPX rcaron ncaron -15
+KPX rcaron ncommaaccent -15
+KPX rcaron ntilde -15
+KPX rcaron o -18
+KPX rcaron oacute -18
+KPX rcaron ocircumflex -18
+KPX rcaron odieresis -18
+KPX rcaron ograve -18
+KPX rcaron ohungarumlaut -18
+KPX rcaron omacron -18
+KPX rcaron oslash -18
+KPX rcaron otilde -18
+KPX rcaron p -10
+KPX rcaron period -100
+KPX rcaron q -18
+KPX rcaron v -10
+KPX rcommaaccent c -18
+KPX rcommaaccent cacute -18
+KPX rcommaaccent ccaron -18
+KPX rcommaaccent ccedilla -18
+KPX rcommaaccent comma -92
+KPX rcommaaccent e -18
+KPX rcommaaccent eacute -18
+KPX rcommaaccent ecaron -18
+KPX rcommaaccent ecircumflex -18
+KPX rcommaaccent edieresis -18
+KPX rcommaaccent edotaccent -18
+KPX rcommaaccent egrave -18
+KPX rcommaaccent emacron -18
+KPX rcommaaccent eogonek -18
+KPX rcommaaccent g -10
+KPX rcommaaccent gbreve -10
+KPX rcommaaccent gcommaaccent -10
+KPX rcommaaccent hyphen -37
+KPX rcommaaccent n -15
+KPX rcommaaccent nacute -15
+KPX rcommaaccent ncaron -15
+KPX rcommaaccent ncommaaccent -15
+KPX rcommaaccent ntilde -15
+KPX rcommaaccent o -18
+KPX rcommaaccent oacute -18
+KPX rcommaaccent ocircumflex -18
+KPX rcommaaccent odieresis -18
+KPX rcommaaccent ograve -18
+KPX rcommaaccent ohungarumlaut -18
+KPX rcommaaccent omacron -18
+KPX rcommaaccent oslash -18
+KPX rcommaaccent otilde -18
+KPX rcommaaccent p -10
+KPX rcommaaccent period -100
+KPX rcommaaccent q -18
+KPX rcommaaccent v -10
+KPX space A -55
+KPX space Aacute -55
+KPX space Abreve -55
+KPX space Acircumflex -55
+KPX space Adieresis -55
+KPX space Agrave -55
+KPX space Amacron -55
+KPX space Aogonek -55
+KPX space Aring -55
+KPX space Atilde -55
+KPX space T -30
+KPX space Tcaron -30
+KPX space Tcommaaccent -30
+KPX space V -45
+KPX space W -30
+KPX space Y -55
+KPX space Yacute -55
+KPX space Ydieresis -55
+KPX v a -10
+KPX v aacute -10
+KPX v abreve -10
+KPX v acircumflex -10
+KPX v adieresis -10
+KPX v agrave -10
+KPX v amacron -10
+KPX v aogonek -10
+KPX v aring -10
+KPX v atilde -10
+KPX v comma -55
+KPX v e -10
+KPX v eacute -10
+KPX v ecaron -10
+KPX v ecircumflex -10
+KPX v edieresis -10
+KPX v edotaccent -10
+KPX v egrave -10
+KPX v emacron -10
+KPX v eogonek -10
+KPX v o -10
+KPX v oacute -10
+KPX v ocircumflex -10
+KPX v odieresis -10
+KPX v ograve -10
+KPX v ohungarumlaut -10
+KPX v omacron -10
+KPX v oslash -10
+KPX v otilde -10
+KPX v period -70
+KPX w comma -55
+KPX w o -10
+KPX w oacute -10
+KPX w ocircumflex -10
+KPX w odieresis -10
+KPX w ograve -10
+KPX w ohungarumlaut -10
+KPX w omacron -10
+KPX w oslash -10
+KPX w otilde -10
+KPX w period -70
+KPX y comma -55
+KPX y e -10
+KPX y eacute -10
+KPX y ecaron -10
+KPX y ecircumflex -10
+KPX y edieresis -10
+KPX y edotaccent -10
+KPX y egrave -10
+KPX y emacron -10
+KPX y eogonek -10
+KPX y o -25
+KPX y oacute -25
+KPX y ocircumflex -25
+KPX y odieresis -25
+KPX y ograve -25
+KPX y ohungarumlaut -25
+KPX y omacron -25
+KPX y oslash -25
+KPX y otilde -25
+KPX y period -70
+KPX yacute comma -55
+KPX yacute e -10
+KPX yacute eacute -10
+KPX yacute ecaron -10
+KPX yacute ecircumflex -10
+KPX yacute edieresis -10
+KPX yacute edotaccent -10
+KPX yacute egrave -10
+KPX yacute emacron -10
+KPX yacute eogonek -10
+KPX yacute o -25
+KPX yacute oacute -25
+KPX yacute ocircumflex -25
+KPX yacute odieresis -25
+KPX yacute ograve -25
+KPX yacute ohungarumlaut -25
+KPX yacute omacron -25
+KPX yacute oslash -25
+KPX yacute otilde -25
+KPX yacute period -70
+KPX ydieresis comma -55
+KPX ydieresis e -10
+KPX ydieresis eacute -10
+KPX ydieresis ecaron -10
+KPX ydieresis ecircumflex -10
+KPX ydieresis edieresis -10
+KPX ydieresis edotaccent -10
+KPX ydieresis egrave -10
+KPX ydieresis emacron -10
+KPX ydieresis eogonek -10
+KPX ydieresis o -25
+KPX ydieresis oacute -25
+KPX ydieresis ocircumflex -25
+KPX ydieresis odieresis -25
+KPX ydieresis ograve -25
+KPX ydieresis ohungarumlaut -25
+KPX ydieresis omacron -25
+KPX ydieresis oslash -25
+KPX ydieresis otilde -25
+KPX ydieresis period -70
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-BoldItalic.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-BoldItalic.afm
new file mode 100644
index 0000000000000000000000000000000000000000..2301dfd232647c35540f590315823c18f9633670
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-BoldItalic.afm
@@ -0,0 +1,2384 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 13:04:06 1997
+Comment UniqueID 43066
+Comment VMusage 45874 56899
+FontName Times-BoldItalic
+FullName Times Bold Italic
+FamilyName Times
+Weight Bold
+ItalicAngle -15
+IsFixedPitch false
+CharacterSet ExtendedRoman
+FontBBox -200 -218 996 921
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype-Hell AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 669
+XHeight 462
+Ascender 683
+Descender -217
+StdHW 42
+StdVW 121
+StartCharMetrics 315
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 389 ; N exclam ; B 67 -13 370 684 ;
+C 34 ; WX 555 ; N quotedbl ; B 136 398 536 685 ;
+C 35 ; WX 500 ; N numbersign ; B -33 0 533 700 ;
+C 36 ; WX 500 ; N dollar ; B -20 -100 497 733 ;
+C 37 ; WX 833 ; N percent ; B 39 -10 793 692 ;
+C 38 ; WX 778 ; N ampersand ; B 5 -19 699 682 ;
+C 39 ; WX 333 ; N quoteright ; B 98 369 302 685 ;
+C 40 ; WX 333 ; N parenleft ; B 28 -179 344 685 ;
+C 41 ; WX 333 ; N parenright ; B -44 -179 271 685 ;
+C 42 ; WX 500 ; N asterisk ; B 65 249 456 685 ;
+C 43 ; WX 570 ; N plus ; B 33 0 537 506 ;
+C 44 ; WX 250 ; N comma ; B -60 -182 144 134 ;
+C 45 ; WX 333 ; N hyphen ; B 2 166 271 282 ;
+C 46 ; WX 250 ; N period ; B -9 -13 139 135 ;
+C 47 ; WX 278 ; N slash ; B -64 -18 342 685 ;
+C 48 ; WX 500 ; N zero ; B 17 -14 477 683 ;
+C 49 ; WX 500 ; N one ; B 5 0 419 683 ;
+C 50 ; WX 500 ; N two ; B -27 0 446 683 ;
+C 51 ; WX 500 ; N three ; B -15 -13 450 683 ;
+C 52 ; WX 500 ; N four ; B -15 0 503 683 ;
+C 53 ; WX 500 ; N five ; B -11 -13 487 669 ;
+C 54 ; WX 500 ; N six ; B 23 -15 509 679 ;
+C 55 ; WX 500 ; N seven ; B 52 0 525 669 ;
+C 56 ; WX 500 ; N eight ; B 3 -13 476 683 ;
+C 57 ; WX 500 ; N nine ; B -12 -10 475 683 ;
+C 58 ; WX 333 ; N colon ; B 23 -13 264 459 ;
+C 59 ; WX 333 ; N semicolon ; B -25 -183 264 459 ;
+C 60 ; WX 570 ; N less ; B 31 -8 539 514 ;
+C 61 ; WX 570 ; N equal ; B 33 107 537 399 ;
+C 62 ; WX 570 ; N greater ; B 31 -8 539 514 ;
+C 63 ; WX 500 ; N question ; B 79 -13 470 684 ;
+C 64 ; WX 832 ; N at ; B 63 -18 770 685 ;
+C 65 ; WX 667 ; N A ; B -67 0 593 683 ;
+C 66 ; WX 667 ; N B ; B -24 0 624 669 ;
+C 67 ; WX 667 ; N C ; B 32 -18 677 685 ;
+C 68 ; WX 722 ; N D ; B -46 0 685 669 ;
+C 69 ; WX 667 ; N E ; B -27 0 653 669 ;
+C 70 ; WX 667 ; N F ; B -13 0 660 669 ;
+C 71 ; WX 722 ; N G ; B 21 -18 706 685 ;
+C 72 ; WX 778 ; N H ; B -24 0 799 669 ;
+C 73 ; WX 389 ; N I ; B -32 0 406 669 ;
+C 74 ; WX 500 ; N J ; B -46 -99 524 669 ;
+C 75 ; WX 667 ; N K ; B -21 0 702 669 ;
+C 76 ; WX 611 ; N L ; B -22 0 590 669 ;
+C 77 ; WX 889 ; N M ; B -29 -12 917 669 ;
+C 78 ; WX 722 ; N N ; B -27 -15 748 669 ;
+C 79 ; WX 722 ; N O ; B 27 -18 691 685 ;
+C 80 ; WX 611 ; N P ; B -27 0 613 669 ;
+C 81 ; WX 722 ; N Q ; B 27 -208 691 685 ;
+C 82 ; WX 667 ; N R ; B -29 0 623 669 ;
+C 83 ; WX 556 ; N S ; B 2 -18 526 685 ;
+C 84 ; WX 611 ; N T ; B 50 0 650 669 ;
+C 85 ; WX 722 ; N U ; B 67 -18 744 669 ;
+C 86 ; WX 667 ; N V ; B 65 -18 715 669 ;
+C 87 ; WX 889 ; N W ; B 65 -18 940 669 ;
+C 88 ; WX 667 ; N X ; B -24 0 694 669 ;
+C 89 ; WX 611 ; N Y ; B 73 0 659 669 ;
+C 90 ; WX 611 ; N Z ; B -11 0 590 669 ;
+C 91 ; WX 333 ; N bracketleft ; B -37 -159 362 674 ;
+C 92 ; WX 278 ; N backslash ; B -1 -18 279 685 ;
+C 93 ; WX 333 ; N bracketright ; B -56 -157 343 674 ;
+C 94 ; WX 570 ; N asciicircum ; B 67 304 503 669 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 128 369 332 685 ;
+C 97 ; WX 500 ; N a ; B -21 -14 455 462 ;
+C 98 ; WX 500 ; N b ; B -14 -13 444 699 ;
+C 99 ; WX 444 ; N c ; B -5 -13 392 462 ;
+C 100 ; WX 500 ; N d ; B -21 -13 517 699 ;
+C 101 ; WX 444 ; N e ; B 5 -13 398 462 ;
+C 102 ; WX 333 ; N f ; B -169 -205 446 698 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B -52 -203 478 462 ;
+C 104 ; WX 556 ; N h ; B -13 -9 498 699 ;
+C 105 ; WX 278 ; N i ; B 2 -9 263 684 ;
+C 106 ; WX 278 ; N j ; B -189 -207 279 684 ;
+C 107 ; WX 500 ; N k ; B -23 -8 483 699 ;
+C 108 ; WX 278 ; N l ; B 2 -9 290 699 ;
+C 109 ; WX 778 ; N m ; B -14 -9 722 462 ;
+C 110 ; WX 556 ; N n ; B -6 -9 493 462 ;
+C 111 ; WX 500 ; N o ; B -3 -13 441 462 ;
+C 112 ; WX 500 ; N p ; B -120 -205 446 462 ;
+C 113 ; WX 500 ; N q ; B 1 -205 471 462 ;
+C 114 ; WX 389 ; N r ; B -21 0 389 462 ;
+C 115 ; WX 389 ; N s ; B -19 -13 333 462 ;
+C 116 ; WX 278 ; N t ; B -11 -9 281 594 ;
+C 117 ; WX 556 ; N u ; B 15 -9 492 462 ;
+C 118 ; WX 444 ; N v ; B 16 -13 401 462 ;
+C 119 ; WX 667 ; N w ; B 16 -13 614 462 ;
+C 120 ; WX 500 ; N x ; B -46 -13 469 462 ;
+C 121 ; WX 444 ; N y ; B -94 -205 392 462 ;
+C 122 ; WX 389 ; N z ; B -43 -78 368 449 ;
+C 123 ; WX 348 ; N braceleft ; B 5 -187 436 686 ;
+C 124 ; WX 220 ; N bar ; B 66 -218 154 782 ;
+C 125 ; WX 348 ; N braceright ; B -129 -187 302 686 ;
+C 126 ; WX 570 ; N asciitilde ; B 54 173 516 333 ;
+C 161 ; WX 389 ; N exclamdown ; B 19 -205 322 492 ;
+C 162 ; WX 500 ; N cent ; B 42 -143 439 576 ;
+C 163 ; WX 500 ; N sterling ; B -32 -12 510 683 ;
+C 164 ; WX 167 ; N fraction ; B -169 -14 324 683 ;
+C 165 ; WX 500 ; N yen ; B 33 0 628 669 ;
+C 166 ; WX 500 ; N florin ; B -87 -156 537 707 ;
+C 167 ; WX 500 ; N section ; B 36 -143 459 685 ;
+C 168 ; WX 500 ; N currency ; B -26 34 526 586 ;
+C 169 ; WX 278 ; N quotesingle ; B 128 398 268 685 ;
+C 170 ; WX 500 ; N quotedblleft ; B 53 369 513 685 ;
+C 171 ; WX 500 ; N guillemotleft ; B 12 32 468 415 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 32 32 303 415 ;
+C 173 ; WX 333 ; N guilsinglright ; B 10 32 281 415 ;
+C 174 ; WX 556 ; N fi ; B -188 -205 514 703 ;
+C 175 ; WX 556 ; N fl ; B -186 -205 553 704 ;
+C 177 ; WX 500 ; N endash ; B -40 178 477 269 ;
+C 178 ; WX 500 ; N dagger ; B 91 -145 494 685 ;
+C 179 ; WX 500 ; N daggerdbl ; B 10 -139 493 685 ;
+C 180 ; WX 250 ; N periodcentered ; B 51 257 199 405 ;
+C 182 ; WX 500 ; N paragraph ; B -57 -193 562 669 ;
+C 183 ; WX 350 ; N bullet ; B 0 175 350 525 ;
+C 184 ; WX 333 ; N quotesinglbase ; B -5 -182 199 134 ;
+C 185 ; WX 500 ; N quotedblbase ; B -57 -182 403 134 ;
+C 186 ; WX 500 ; N quotedblright ; B 53 369 513 685 ;
+C 187 ; WX 500 ; N guillemotright ; B 12 32 468 415 ;
+C 188 ; WX 1000 ; N ellipsis ; B 40 -13 852 135 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -29 996 706 ;
+C 191 ; WX 500 ; N questiondown ; B 30 -205 421 492 ;
+C 193 ; WX 333 ; N grave ; B 85 516 297 697 ;
+C 194 ; WX 333 ; N acute ; B 139 516 379 697 ;
+C 195 ; WX 333 ; N circumflex ; B 40 516 367 690 ;
+C 196 ; WX 333 ; N tilde ; B 48 536 407 655 ;
+C 197 ; WX 333 ; N macron ; B 51 553 393 623 ;
+C 198 ; WX 333 ; N breve ; B 71 516 387 678 ;
+C 199 ; WX 333 ; N dotaccent ; B 163 550 298 684 ;
+C 200 ; WX 333 ; N dieresis ; B 55 550 402 684 ;
+C 202 ; WX 333 ; N ring ; B 127 516 340 729 ;
+C 203 ; WX 333 ; N cedilla ; B -80 -218 156 5 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 69 516 498 697 ;
+C 206 ; WX 333 ; N ogonek ; B 15 -183 244 34 ;
+C 207 ; WX 333 ; N caron ; B 79 516 411 690 ;
+C 208 ; WX 1000 ; N emdash ; B -40 178 977 269 ;
+C 225 ; WX 944 ; N AE ; B -64 0 918 669 ;
+C 227 ; WX 266 ; N ordfeminine ; B 16 399 330 685 ;
+C 232 ; WX 611 ; N Lslash ; B -22 0 590 669 ;
+C 233 ; WX 722 ; N Oslash ; B 27 -125 691 764 ;
+C 234 ; WX 944 ; N OE ; B 23 -8 946 677 ;
+C 235 ; WX 300 ; N ordmasculine ; B 56 400 347 685 ;
+C 241 ; WX 722 ; N ae ; B -5 -13 673 462 ;
+C 245 ; WX 278 ; N dotlessi ; B 2 -9 238 462 ;
+C 248 ; WX 278 ; N lslash ; B -7 -9 307 699 ;
+C 249 ; WX 500 ; N oslash ; B -3 -119 441 560 ;
+C 250 ; WX 722 ; N oe ; B 6 -13 674 462 ;
+C 251 ; WX 500 ; N germandbls ; B -200 -200 473 705 ;
+C -1 ; WX 389 ; N Idieresis ; B -32 0 450 862 ;
+C -1 ; WX 444 ; N eacute ; B 5 -13 435 697 ;
+C -1 ; WX 500 ; N abreve ; B -21 -14 471 678 ;
+C -1 ; WX 556 ; N uhungarumlaut ; B 15 -9 610 697 ;
+C -1 ; WX 444 ; N ecaron ; B 5 -13 467 690 ;
+C -1 ; WX 611 ; N Ydieresis ; B 73 0 659 862 ;
+C -1 ; WX 570 ; N divide ; B 33 -29 537 535 ;
+C -1 ; WX 611 ; N Yacute ; B 73 0 659 904 ;
+C -1 ; WX 667 ; N Acircumflex ; B -67 0 593 897 ;
+C -1 ; WX 500 ; N aacute ; B -21 -14 463 697 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 67 -18 744 897 ;
+C -1 ; WX 444 ; N yacute ; B -94 -205 435 697 ;
+C -1 ; WX 389 ; N scommaaccent ; B -19 -218 333 462 ;
+C -1 ; WX 444 ; N ecircumflex ; B 5 -13 423 690 ;
+C -1 ; WX 722 ; N Uring ; B 67 -18 744 921 ;
+C -1 ; WX 722 ; N Udieresis ; B 67 -18 744 862 ;
+C -1 ; WX 500 ; N aogonek ; B -21 -183 455 462 ;
+C -1 ; WX 722 ; N Uacute ; B 67 -18 744 904 ;
+C -1 ; WX 556 ; N uogonek ; B 15 -183 492 462 ;
+C -1 ; WX 667 ; N Edieresis ; B -27 0 653 862 ;
+C -1 ; WX 722 ; N Dcroat ; B -31 0 700 669 ;
+C -1 ; WX 250 ; N commaaccent ; B -36 -218 131 -50 ;
+C -1 ; WX 747 ; N copyright ; B 30 -18 718 685 ;
+C -1 ; WX 667 ; N Emacron ; B -27 0 653 830 ;
+C -1 ; WX 444 ; N ccaron ; B -5 -13 467 690 ;
+C -1 ; WX 500 ; N aring ; B -21 -14 455 729 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B -27 -218 748 669 ;
+C -1 ; WX 278 ; N lacute ; B 2 -9 392 904 ;
+C -1 ; WX 500 ; N agrave ; B -21 -14 455 697 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 50 -218 650 669 ;
+C -1 ; WX 667 ; N Cacute ; B 32 -18 677 904 ;
+C -1 ; WX 500 ; N atilde ; B -21 -14 491 655 ;
+C -1 ; WX 667 ; N Edotaccent ; B -27 0 653 862 ;
+C -1 ; WX 389 ; N scaron ; B -19 -13 424 690 ;
+C -1 ; WX 389 ; N scedilla ; B -19 -218 333 462 ;
+C -1 ; WX 278 ; N iacute ; B 2 -9 352 697 ;
+C -1 ; WX 494 ; N lozenge ; B 10 0 484 745 ;
+C -1 ; WX 667 ; N Rcaron ; B -29 0 623 897 ;
+C -1 ; WX 722 ; N Gcommaaccent ; B 21 -218 706 685 ;
+C -1 ; WX 556 ; N ucircumflex ; B 15 -9 492 690 ;
+C -1 ; WX 500 ; N acircumflex ; B -21 -14 455 690 ;
+C -1 ; WX 667 ; N Amacron ; B -67 0 593 830 ;
+C -1 ; WX 389 ; N rcaron ; B -21 0 424 690 ;
+C -1 ; WX 444 ; N ccedilla ; B -5 -218 392 462 ;
+C -1 ; WX 611 ; N Zdotaccent ; B -11 0 590 862 ;
+C -1 ; WX 611 ; N Thorn ; B -27 0 573 669 ;
+C -1 ; WX 722 ; N Omacron ; B 27 -18 691 830 ;
+C -1 ; WX 667 ; N Racute ; B -29 0 623 904 ;
+C -1 ; WX 556 ; N Sacute ; B 2 -18 531 904 ;
+C -1 ; WX 608 ; N dcaron ; B -21 -13 675 708 ;
+C -1 ; WX 722 ; N Umacron ; B 67 -18 744 830 ;
+C -1 ; WX 556 ; N uring ; B 15 -9 492 729 ;
+C -1 ; WX 300 ; N threesuperior ; B 17 265 321 683 ;
+C -1 ; WX 722 ; N Ograve ; B 27 -18 691 904 ;
+C -1 ; WX 667 ; N Agrave ; B -67 0 593 904 ;
+C -1 ; WX 667 ; N Abreve ; B -67 0 593 885 ;
+C -1 ; WX 570 ; N multiply ; B 48 16 522 490 ;
+C -1 ; WX 556 ; N uacute ; B 15 -9 492 697 ;
+C -1 ; WX 611 ; N Tcaron ; B 50 0 650 897 ;
+C -1 ; WX 494 ; N partialdiff ; B 11 -21 494 750 ;
+C -1 ; WX 444 ; N ydieresis ; B -94 -205 443 655 ;
+C -1 ; WX 722 ; N Nacute ; B -27 -15 748 904 ;
+C -1 ; WX 278 ; N icircumflex ; B -3 -9 324 690 ;
+C -1 ; WX 667 ; N Ecircumflex ; B -27 0 653 897 ;
+C -1 ; WX 500 ; N adieresis ; B -21 -14 476 655 ;
+C -1 ; WX 444 ; N edieresis ; B 5 -13 448 655 ;
+C -1 ; WX 444 ; N cacute ; B -5 -13 435 697 ;
+C -1 ; WX 556 ; N nacute ; B -6 -9 493 697 ;
+C -1 ; WX 556 ; N umacron ; B 15 -9 492 623 ;
+C -1 ; WX 722 ; N Ncaron ; B -27 -15 748 897 ;
+C -1 ; WX 389 ; N Iacute ; B -32 0 432 904 ;
+C -1 ; WX 570 ; N plusminus ; B 33 0 537 506 ;
+C -1 ; WX 220 ; N brokenbar ; B 66 -143 154 707 ;
+C -1 ; WX 747 ; N registered ; B 30 -18 718 685 ;
+C -1 ; WX 722 ; N Gbreve ; B 21 -18 706 885 ;
+C -1 ; WX 389 ; N Idotaccent ; B -32 0 406 862 ;
+C -1 ; WX 600 ; N summation ; B 14 -10 585 706 ;
+C -1 ; WX 667 ; N Egrave ; B -27 0 653 904 ;
+C -1 ; WX 389 ; N racute ; B -21 0 407 697 ;
+C -1 ; WX 500 ; N omacron ; B -3 -13 462 623 ;
+C -1 ; WX 611 ; N Zacute ; B -11 0 590 904 ;
+C -1 ; WX 611 ; N Zcaron ; B -11 0 590 897 ;
+C -1 ; WX 549 ; N greaterequal ; B 26 0 523 704 ;
+C -1 ; WX 722 ; N Eth ; B -31 0 700 669 ;
+C -1 ; WX 667 ; N Ccedilla ; B 32 -218 677 685 ;
+C -1 ; WX 278 ; N lcommaaccent ; B -42 -218 290 699 ;
+C -1 ; WX 366 ; N tcaron ; B -11 -9 434 754 ;
+C -1 ; WX 444 ; N eogonek ; B 5 -183 398 462 ;
+C -1 ; WX 722 ; N Uogonek ; B 67 -183 744 669 ;
+C -1 ; WX 667 ; N Aacute ; B -67 0 593 904 ;
+C -1 ; WX 667 ; N Adieresis ; B -67 0 593 862 ;
+C -1 ; WX 444 ; N egrave ; B 5 -13 398 697 ;
+C -1 ; WX 389 ; N zacute ; B -43 -78 407 697 ;
+C -1 ; WX 278 ; N iogonek ; B -20 -183 263 684 ;
+C -1 ; WX 722 ; N Oacute ; B 27 -18 691 904 ;
+C -1 ; WX 500 ; N oacute ; B -3 -13 463 697 ;
+C -1 ; WX 500 ; N amacron ; B -21 -14 467 623 ;
+C -1 ; WX 389 ; N sacute ; B -19 -13 407 697 ;
+C -1 ; WX 278 ; N idieresis ; B 2 -9 364 655 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 27 -18 691 897 ;
+C -1 ; WX 722 ; N Ugrave ; B 67 -18 744 904 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 500 ; N thorn ; B -120 -205 446 699 ;
+C -1 ; WX 300 ; N twosuperior ; B 2 274 313 683 ;
+C -1 ; WX 722 ; N Odieresis ; B 27 -18 691 862 ;
+C -1 ; WX 576 ; N mu ; B -60 -207 516 449 ;
+C -1 ; WX 278 ; N igrave ; B 2 -9 259 697 ;
+C -1 ; WX 500 ; N ohungarumlaut ; B -3 -13 582 697 ;
+C -1 ; WX 667 ; N Eogonek ; B -27 -183 653 669 ;
+C -1 ; WX 500 ; N dcroat ; B -21 -13 552 699 ;
+C -1 ; WX 750 ; N threequarters ; B 7 -14 726 683 ;
+C -1 ; WX 556 ; N Scedilla ; B 2 -218 526 685 ;
+C -1 ; WX 382 ; N lcaron ; B 2 -9 448 708 ;
+C -1 ; WX 667 ; N Kcommaaccent ; B -21 -218 702 669 ;
+C -1 ; WX 611 ; N Lacute ; B -22 0 590 904 ;
+C -1 ; WX 1000 ; N trademark ; B 32 263 968 669 ;
+C -1 ; WX 444 ; N edotaccent ; B 5 -13 398 655 ;
+C -1 ; WX 389 ; N Igrave ; B -32 0 406 904 ;
+C -1 ; WX 389 ; N Imacron ; B -32 0 461 830 ;
+C -1 ; WX 611 ; N Lcaron ; B -22 0 671 718 ;
+C -1 ; WX 750 ; N onehalf ; B -9 -14 723 683 ;
+C -1 ; WX 549 ; N lessequal ; B 29 0 526 704 ;
+C -1 ; WX 500 ; N ocircumflex ; B -3 -13 451 690 ;
+C -1 ; WX 556 ; N ntilde ; B -6 -9 504 655 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 67 -18 744 904 ;
+C -1 ; WX 667 ; N Eacute ; B -27 0 653 904 ;
+C -1 ; WX 444 ; N emacron ; B 5 -13 439 623 ;
+C -1 ; WX 500 ; N gbreve ; B -52 -203 478 678 ;
+C -1 ; WX 750 ; N onequarter ; B 7 -14 721 683 ;
+C -1 ; WX 556 ; N Scaron ; B 2 -18 553 897 ;
+C -1 ; WX 556 ; N Scommaaccent ; B 2 -218 526 685 ;
+C -1 ; WX 722 ; N Ohungarumlaut ; B 27 -18 723 904 ;
+C -1 ; WX 400 ; N degree ; B 83 397 369 683 ;
+C -1 ; WX 500 ; N ograve ; B -3 -13 441 697 ;
+C -1 ; WX 667 ; N Ccaron ; B 32 -18 677 897 ;
+C -1 ; WX 556 ; N ugrave ; B 15 -9 492 697 ;
+C -1 ; WX 549 ; N radical ; B 10 -46 512 850 ;
+C -1 ; WX 722 ; N Dcaron ; B -46 0 685 897 ;
+C -1 ; WX 389 ; N rcommaaccent ; B -67 -218 389 462 ;
+C -1 ; WX 722 ; N Ntilde ; B -27 -15 748 862 ;
+C -1 ; WX 500 ; N otilde ; B -3 -13 491 655 ;
+C -1 ; WX 667 ; N Rcommaaccent ; B -29 -218 623 669 ;
+C -1 ; WX 611 ; N Lcommaaccent ; B -22 -218 590 669 ;
+C -1 ; WX 667 ; N Atilde ; B -67 0 593 862 ;
+C -1 ; WX 667 ; N Aogonek ; B -67 -183 604 683 ;
+C -1 ; WX 667 ; N Aring ; B -67 0 593 921 ;
+C -1 ; WX 722 ; N Otilde ; B 27 -18 691 862 ;
+C -1 ; WX 389 ; N zdotaccent ; B -43 -78 368 655 ;
+C -1 ; WX 667 ; N Ecaron ; B -27 0 653 897 ;
+C -1 ; WX 389 ; N Iogonek ; B -32 -183 406 669 ;
+C -1 ; WX 500 ; N kcommaaccent ; B -23 -218 483 699 ;
+C -1 ; WX 606 ; N minus ; B 51 209 555 297 ;
+C -1 ; WX 389 ; N Icircumflex ; B -32 0 450 897 ;
+C -1 ; WX 556 ; N ncaron ; B -6 -9 523 690 ;
+C -1 ; WX 278 ; N tcommaaccent ; B -62 -218 281 594 ;
+C -1 ; WX 606 ; N logicalnot ; B 51 108 555 399 ;
+C -1 ; WX 500 ; N odieresis ; B -3 -13 471 655 ;
+C -1 ; WX 556 ; N udieresis ; B 15 -9 499 655 ;
+C -1 ; WX 549 ; N notequal ; B 15 -49 540 570 ;
+C -1 ; WX 500 ; N gcommaaccent ; B -52 -203 478 767 ;
+C -1 ; WX 500 ; N eth ; B -3 -13 454 699 ;
+C -1 ; WX 389 ; N zcaron ; B -43 -78 424 690 ;
+C -1 ; WX 556 ; N ncommaaccent ; B -6 -218 493 462 ;
+C -1 ; WX 300 ; N onesuperior ; B 30 274 301 683 ;
+C -1 ; WX 278 ; N imacron ; B 2 -9 294 623 ;
+C -1 ; WX 500 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 2038
+KPX A C -65
+KPX A Cacute -65
+KPX A Ccaron -65
+KPX A Ccedilla -65
+KPX A G -60
+KPX A Gbreve -60
+KPX A Gcommaaccent -60
+KPX A O -50
+KPX A Oacute -50
+KPX A Ocircumflex -50
+KPX A Odieresis -50
+KPX A Ograve -50
+KPX A Ohungarumlaut -50
+KPX A Omacron -50
+KPX A Oslash -50
+KPX A Otilde -50
+KPX A Q -55
+KPX A T -55
+KPX A Tcaron -55
+KPX A Tcommaaccent -55
+KPX A U -50
+KPX A Uacute -50
+KPX A Ucircumflex -50
+KPX A Udieresis -50
+KPX A Ugrave -50
+KPX A Uhungarumlaut -50
+KPX A Umacron -50
+KPX A Uogonek -50
+KPX A Uring -50
+KPX A V -95
+KPX A W -100
+KPX A Y -70
+KPX A Yacute -70
+KPX A Ydieresis -70
+KPX A quoteright -74
+KPX A u -30
+KPX A uacute -30
+KPX A ucircumflex -30
+KPX A udieresis -30
+KPX A ugrave -30
+KPX A uhungarumlaut -30
+KPX A umacron -30
+KPX A uogonek -30
+KPX A uring -30
+KPX A v -74
+KPX A w -74
+KPX A y -74
+KPX A yacute -74
+KPX A ydieresis -74
+KPX Aacute C -65
+KPX Aacute Cacute -65
+KPX Aacute Ccaron -65
+KPX Aacute Ccedilla -65
+KPX Aacute G -60
+KPX Aacute Gbreve -60
+KPX Aacute Gcommaaccent -60
+KPX Aacute O -50
+KPX Aacute Oacute -50
+KPX Aacute Ocircumflex -50
+KPX Aacute Odieresis -50
+KPX Aacute Ograve -50
+KPX Aacute Ohungarumlaut -50
+KPX Aacute Omacron -50
+KPX Aacute Oslash -50
+KPX Aacute Otilde -50
+KPX Aacute Q -55
+KPX Aacute T -55
+KPX Aacute Tcaron -55
+KPX Aacute Tcommaaccent -55
+KPX Aacute U -50
+KPX Aacute Uacute -50
+KPX Aacute Ucircumflex -50
+KPX Aacute Udieresis -50
+KPX Aacute Ugrave -50
+KPX Aacute Uhungarumlaut -50
+KPX Aacute Umacron -50
+KPX Aacute Uogonek -50
+KPX Aacute Uring -50
+KPX Aacute V -95
+KPX Aacute W -100
+KPX Aacute Y -70
+KPX Aacute Yacute -70
+KPX Aacute Ydieresis -70
+KPX Aacute quoteright -74
+KPX Aacute u -30
+KPX Aacute uacute -30
+KPX Aacute ucircumflex -30
+KPX Aacute udieresis -30
+KPX Aacute ugrave -30
+KPX Aacute uhungarumlaut -30
+KPX Aacute umacron -30
+KPX Aacute uogonek -30
+KPX Aacute uring -30
+KPX Aacute v -74
+KPX Aacute w -74
+KPX Aacute y -74
+KPX Aacute yacute -74
+KPX Aacute ydieresis -74
+KPX Abreve C -65
+KPX Abreve Cacute -65
+KPX Abreve Ccaron -65
+KPX Abreve Ccedilla -65
+KPX Abreve G -60
+KPX Abreve Gbreve -60
+KPX Abreve Gcommaaccent -60
+KPX Abreve O -50
+KPX Abreve Oacute -50
+KPX Abreve Ocircumflex -50
+KPX Abreve Odieresis -50
+KPX Abreve Ograve -50
+KPX Abreve Ohungarumlaut -50
+KPX Abreve Omacron -50
+KPX Abreve Oslash -50
+KPX Abreve Otilde -50
+KPX Abreve Q -55
+KPX Abreve T -55
+KPX Abreve Tcaron -55
+KPX Abreve Tcommaaccent -55
+KPX Abreve U -50
+KPX Abreve Uacute -50
+KPX Abreve Ucircumflex -50
+KPX Abreve Udieresis -50
+KPX Abreve Ugrave -50
+KPX Abreve Uhungarumlaut -50
+KPX Abreve Umacron -50
+KPX Abreve Uogonek -50
+KPX Abreve Uring -50
+KPX Abreve V -95
+KPX Abreve W -100
+KPX Abreve Y -70
+KPX Abreve Yacute -70
+KPX Abreve Ydieresis -70
+KPX Abreve quoteright -74
+KPX Abreve u -30
+KPX Abreve uacute -30
+KPX Abreve ucircumflex -30
+KPX Abreve udieresis -30
+KPX Abreve ugrave -30
+KPX Abreve uhungarumlaut -30
+KPX Abreve umacron -30
+KPX Abreve uogonek -30
+KPX Abreve uring -30
+KPX Abreve v -74
+KPX Abreve w -74
+KPX Abreve y -74
+KPX Abreve yacute -74
+KPX Abreve ydieresis -74
+KPX Acircumflex C -65
+KPX Acircumflex Cacute -65
+KPX Acircumflex Ccaron -65
+KPX Acircumflex Ccedilla -65
+KPX Acircumflex G -60
+KPX Acircumflex Gbreve -60
+KPX Acircumflex Gcommaaccent -60
+KPX Acircumflex O -50
+KPX Acircumflex Oacute -50
+KPX Acircumflex Ocircumflex -50
+KPX Acircumflex Odieresis -50
+KPX Acircumflex Ograve -50
+KPX Acircumflex Ohungarumlaut -50
+KPX Acircumflex Omacron -50
+KPX Acircumflex Oslash -50
+KPX Acircumflex Otilde -50
+KPX Acircumflex Q -55
+KPX Acircumflex T -55
+KPX Acircumflex Tcaron -55
+KPX Acircumflex Tcommaaccent -55
+KPX Acircumflex U -50
+KPX Acircumflex Uacute -50
+KPX Acircumflex Ucircumflex -50
+KPX Acircumflex Udieresis -50
+KPX Acircumflex Ugrave -50
+KPX Acircumflex Uhungarumlaut -50
+KPX Acircumflex Umacron -50
+KPX Acircumflex Uogonek -50
+KPX Acircumflex Uring -50
+KPX Acircumflex V -95
+KPX Acircumflex W -100
+KPX Acircumflex Y -70
+KPX Acircumflex Yacute -70
+KPX Acircumflex Ydieresis -70
+KPX Acircumflex quoteright -74
+KPX Acircumflex u -30
+KPX Acircumflex uacute -30
+KPX Acircumflex ucircumflex -30
+KPX Acircumflex udieresis -30
+KPX Acircumflex ugrave -30
+KPX Acircumflex uhungarumlaut -30
+KPX Acircumflex umacron -30
+KPX Acircumflex uogonek -30
+KPX Acircumflex uring -30
+KPX Acircumflex v -74
+KPX Acircumflex w -74
+KPX Acircumflex y -74
+KPX Acircumflex yacute -74
+KPX Acircumflex ydieresis -74
+KPX Adieresis C -65
+KPX Adieresis Cacute -65
+KPX Adieresis Ccaron -65
+KPX Adieresis Ccedilla -65
+KPX Adieresis G -60
+KPX Adieresis Gbreve -60
+KPX Adieresis Gcommaaccent -60
+KPX Adieresis O -50
+KPX Adieresis Oacute -50
+KPX Adieresis Ocircumflex -50
+KPX Adieresis Odieresis -50
+KPX Adieresis Ograve -50
+KPX Adieresis Ohungarumlaut -50
+KPX Adieresis Omacron -50
+KPX Adieresis Oslash -50
+KPX Adieresis Otilde -50
+KPX Adieresis Q -55
+KPX Adieresis T -55
+KPX Adieresis Tcaron -55
+KPX Adieresis Tcommaaccent -55
+KPX Adieresis U -50
+KPX Adieresis Uacute -50
+KPX Adieresis Ucircumflex -50
+KPX Adieresis Udieresis -50
+KPX Adieresis Ugrave -50
+KPX Adieresis Uhungarumlaut -50
+KPX Adieresis Umacron -50
+KPX Adieresis Uogonek -50
+KPX Adieresis Uring -50
+KPX Adieresis V -95
+KPX Adieresis W -100
+KPX Adieresis Y -70
+KPX Adieresis Yacute -70
+KPX Adieresis Ydieresis -70
+KPX Adieresis quoteright -74
+KPX Adieresis u -30
+KPX Adieresis uacute -30
+KPX Adieresis ucircumflex -30
+KPX Adieresis udieresis -30
+KPX Adieresis ugrave -30
+KPX Adieresis uhungarumlaut -30
+KPX Adieresis umacron -30
+KPX Adieresis uogonek -30
+KPX Adieresis uring -30
+KPX Adieresis v -74
+KPX Adieresis w -74
+KPX Adieresis y -74
+KPX Adieresis yacute -74
+KPX Adieresis ydieresis -74
+KPX Agrave C -65
+KPX Agrave Cacute -65
+KPX Agrave Ccaron -65
+KPX Agrave Ccedilla -65
+KPX Agrave G -60
+KPX Agrave Gbreve -60
+KPX Agrave Gcommaaccent -60
+KPX Agrave O -50
+KPX Agrave Oacute -50
+KPX Agrave Ocircumflex -50
+KPX Agrave Odieresis -50
+KPX Agrave Ograve -50
+KPX Agrave Ohungarumlaut -50
+KPX Agrave Omacron -50
+KPX Agrave Oslash -50
+KPX Agrave Otilde -50
+KPX Agrave Q -55
+KPX Agrave T -55
+KPX Agrave Tcaron -55
+KPX Agrave Tcommaaccent -55
+KPX Agrave U -50
+KPX Agrave Uacute -50
+KPX Agrave Ucircumflex -50
+KPX Agrave Udieresis -50
+KPX Agrave Ugrave -50
+KPX Agrave Uhungarumlaut -50
+KPX Agrave Umacron -50
+KPX Agrave Uogonek -50
+KPX Agrave Uring -50
+KPX Agrave V -95
+KPX Agrave W -100
+KPX Agrave Y -70
+KPX Agrave Yacute -70
+KPX Agrave Ydieresis -70
+KPX Agrave quoteright -74
+KPX Agrave u -30
+KPX Agrave uacute -30
+KPX Agrave ucircumflex -30
+KPX Agrave udieresis -30
+KPX Agrave ugrave -30
+KPX Agrave uhungarumlaut -30
+KPX Agrave umacron -30
+KPX Agrave uogonek -30
+KPX Agrave uring -30
+KPX Agrave v -74
+KPX Agrave w -74
+KPX Agrave y -74
+KPX Agrave yacute -74
+KPX Agrave ydieresis -74
+KPX Amacron C -65
+KPX Amacron Cacute -65
+KPX Amacron Ccaron -65
+KPX Amacron Ccedilla -65
+KPX Amacron G -60
+KPX Amacron Gbreve -60
+KPX Amacron Gcommaaccent -60
+KPX Amacron O -50
+KPX Amacron Oacute -50
+KPX Amacron Ocircumflex -50
+KPX Amacron Odieresis -50
+KPX Amacron Ograve -50
+KPX Amacron Ohungarumlaut -50
+KPX Amacron Omacron -50
+KPX Amacron Oslash -50
+KPX Amacron Otilde -50
+KPX Amacron Q -55
+KPX Amacron T -55
+KPX Amacron Tcaron -55
+KPX Amacron Tcommaaccent -55
+KPX Amacron U -50
+KPX Amacron Uacute -50
+KPX Amacron Ucircumflex -50
+KPX Amacron Udieresis -50
+KPX Amacron Ugrave -50
+KPX Amacron Uhungarumlaut -50
+KPX Amacron Umacron -50
+KPX Amacron Uogonek -50
+KPX Amacron Uring -50
+KPX Amacron V -95
+KPX Amacron W -100
+KPX Amacron Y -70
+KPX Amacron Yacute -70
+KPX Amacron Ydieresis -70
+KPX Amacron quoteright -74
+KPX Amacron u -30
+KPX Amacron uacute -30
+KPX Amacron ucircumflex -30
+KPX Amacron udieresis -30
+KPX Amacron ugrave -30
+KPX Amacron uhungarumlaut -30
+KPX Amacron umacron -30
+KPX Amacron uogonek -30
+KPX Amacron uring -30
+KPX Amacron v -74
+KPX Amacron w -74
+KPX Amacron y -74
+KPX Amacron yacute -74
+KPX Amacron ydieresis -74
+KPX Aogonek C -65
+KPX Aogonek Cacute -65
+KPX Aogonek Ccaron -65
+KPX Aogonek Ccedilla -65
+KPX Aogonek G -60
+KPX Aogonek Gbreve -60
+KPX Aogonek Gcommaaccent -60
+KPX Aogonek O -50
+KPX Aogonek Oacute -50
+KPX Aogonek Ocircumflex -50
+KPX Aogonek Odieresis -50
+KPX Aogonek Ograve -50
+KPX Aogonek Ohungarumlaut -50
+KPX Aogonek Omacron -50
+KPX Aogonek Oslash -50
+KPX Aogonek Otilde -50
+KPX Aogonek Q -55
+KPX Aogonek T -55
+KPX Aogonek Tcaron -55
+KPX Aogonek Tcommaaccent -55
+KPX Aogonek U -50
+KPX Aogonek Uacute -50
+KPX Aogonek Ucircumflex -50
+KPX Aogonek Udieresis -50
+KPX Aogonek Ugrave -50
+KPX Aogonek Uhungarumlaut -50
+KPX Aogonek Umacron -50
+KPX Aogonek Uogonek -50
+KPX Aogonek Uring -50
+KPX Aogonek V -95
+KPX Aogonek W -100
+KPX Aogonek Y -70
+KPX Aogonek Yacute -70
+KPX Aogonek Ydieresis -70
+KPX Aogonek quoteright -74
+KPX Aogonek u -30
+KPX Aogonek uacute -30
+KPX Aogonek ucircumflex -30
+KPX Aogonek udieresis -30
+KPX Aogonek ugrave -30
+KPX Aogonek uhungarumlaut -30
+KPX Aogonek umacron -30
+KPX Aogonek uogonek -30
+KPX Aogonek uring -30
+KPX Aogonek v -74
+KPX Aogonek w -74
+KPX Aogonek y -34
+KPX Aogonek yacute -34
+KPX Aogonek ydieresis -34
+KPX Aring C -65
+KPX Aring Cacute -65
+KPX Aring Ccaron -65
+KPX Aring Ccedilla -65
+KPX Aring G -60
+KPX Aring Gbreve -60
+KPX Aring Gcommaaccent -60
+KPX Aring O -50
+KPX Aring Oacute -50
+KPX Aring Ocircumflex -50
+KPX Aring Odieresis -50
+KPX Aring Ograve -50
+KPX Aring Ohungarumlaut -50
+KPX Aring Omacron -50
+KPX Aring Oslash -50
+KPX Aring Otilde -50
+KPX Aring Q -55
+KPX Aring T -55
+KPX Aring Tcaron -55
+KPX Aring Tcommaaccent -55
+KPX Aring U -50
+KPX Aring Uacute -50
+KPX Aring Ucircumflex -50
+KPX Aring Udieresis -50
+KPX Aring Ugrave -50
+KPX Aring Uhungarumlaut -50
+KPX Aring Umacron -50
+KPX Aring Uogonek -50
+KPX Aring Uring -50
+KPX Aring V -95
+KPX Aring W -100
+KPX Aring Y -70
+KPX Aring Yacute -70
+KPX Aring Ydieresis -70
+KPX Aring quoteright -74
+KPX Aring u -30
+KPX Aring uacute -30
+KPX Aring ucircumflex -30
+KPX Aring udieresis -30
+KPX Aring ugrave -30
+KPX Aring uhungarumlaut -30
+KPX Aring umacron -30
+KPX Aring uogonek -30
+KPX Aring uring -30
+KPX Aring v -74
+KPX Aring w -74
+KPX Aring y -74
+KPX Aring yacute -74
+KPX Aring ydieresis -74
+KPX Atilde C -65
+KPX Atilde Cacute -65
+KPX Atilde Ccaron -65
+KPX Atilde Ccedilla -65
+KPX Atilde G -60
+KPX Atilde Gbreve -60
+KPX Atilde Gcommaaccent -60
+KPX Atilde O -50
+KPX Atilde Oacute -50
+KPX Atilde Ocircumflex -50
+KPX Atilde Odieresis -50
+KPX Atilde Ograve -50
+KPX Atilde Ohungarumlaut -50
+KPX Atilde Omacron -50
+KPX Atilde Oslash -50
+KPX Atilde Otilde -50
+KPX Atilde Q -55
+KPX Atilde T -55
+KPX Atilde Tcaron -55
+KPX Atilde Tcommaaccent -55
+KPX Atilde U -50
+KPX Atilde Uacute -50
+KPX Atilde Ucircumflex -50
+KPX Atilde Udieresis -50
+KPX Atilde Ugrave -50
+KPX Atilde Uhungarumlaut -50
+KPX Atilde Umacron -50
+KPX Atilde Uogonek -50
+KPX Atilde Uring -50
+KPX Atilde V -95
+KPX Atilde W -100
+KPX Atilde Y -70
+KPX Atilde Yacute -70
+KPX Atilde Ydieresis -70
+KPX Atilde quoteright -74
+KPX Atilde u -30
+KPX Atilde uacute -30
+KPX Atilde ucircumflex -30
+KPX Atilde udieresis -30
+KPX Atilde ugrave -30
+KPX Atilde uhungarumlaut -30
+KPX Atilde umacron -30
+KPX Atilde uogonek -30
+KPX Atilde uring -30
+KPX Atilde v -74
+KPX Atilde w -74
+KPX Atilde y -74
+KPX Atilde yacute -74
+KPX Atilde ydieresis -74
+KPX B A -25
+KPX B Aacute -25
+KPX B Abreve -25
+KPX B Acircumflex -25
+KPX B Adieresis -25
+KPX B Agrave -25
+KPX B Amacron -25
+KPX B Aogonek -25
+KPX B Aring -25
+KPX B Atilde -25
+KPX B U -10
+KPX B Uacute -10
+KPX B Ucircumflex -10
+KPX B Udieresis -10
+KPX B Ugrave -10
+KPX B Uhungarumlaut -10
+KPX B Umacron -10
+KPX B Uogonek -10
+KPX B Uring -10
+KPX D A -25
+KPX D Aacute -25
+KPX D Abreve -25
+KPX D Acircumflex -25
+KPX D Adieresis -25
+KPX D Agrave -25
+KPX D Amacron -25
+KPX D Aogonek -25
+KPX D Aring -25
+KPX D Atilde -25
+KPX D V -50
+KPX D W -40
+KPX D Y -50
+KPX D Yacute -50
+KPX D Ydieresis -50
+KPX Dcaron A -25
+KPX Dcaron Aacute -25
+KPX Dcaron Abreve -25
+KPX Dcaron Acircumflex -25
+KPX Dcaron Adieresis -25
+KPX Dcaron Agrave -25
+KPX Dcaron Amacron -25
+KPX Dcaron Aogonek -25
+KPX Dcaron Aring -25
+KPX Dcaron Atilde -25
+KPX Dcaron V -50
+KPX Dcaron W -40
+KPX Dcaron Y -50
+KPX Dcaron Yacute -50
+KPX Dcaron Ydieresis -50
+KPX Dcroat A -25
+KPX Dcroat Aacute -25
+KPX Dcroat Abreve -25
+KPX Dcroat Acircumflex -25
+KPX Dcroat Adieresis -25
+KPX Dcroat Agrave -25
+KPX Dcroat Amacron -25
+KPX Dcroat Aogonek -25
+KPX Dcroat Aring -25
+KPX Dcroat Atilde -25
+KPX Dcroat V -50
+KPX Dcroat W -40
+KPX Dcroat Y -50
+KPX Dcroat Yacute -50
+KPX Dcroat Ydieresis -50
+KPX F A -100
+KPX F Aacute -100
+KPX F Abreve -100
+KPX F Acircumflex -100
+KPX F Adieresis -100
+KPX F Agrave -100
+KPX F Amacron -100
+KPX F Aogonek -100
+KPX F Aring -100
+KPX F Atilde -100
+KPX F a -95
+KPX F aacute -95
+KPX F abreve -95
+KPX F acircumflex -95
+KPX F adieresis -95
+KPX F agrave -95
+KPX F amacron -95
+KPX F aogonek -95
+KPX F aring -95
+KPX F atilde -95
+KPX F comma -129
+KPX F e -100
+KPX F eacute -100
+KPX F ecaron -100
+KPX F ecircumflex -100
+KPX F edieresis -100
+KPX F edotaccent -100
+KPX F egrave -100
+KPX F emacron -100
+KPX F eogonek -100
+KPX F i -40
+KPX F iacute -40
+KPX F icircumflex -40
+KPX F idieresis -40
+KPX F igrave -40
+KPX F imacron -40
+KPX F iogonek -40
+KPX F o -70
+KPX F oacute -70
+KPX F ocircumflex -70
+KPX F odieresis -70
+KPX F ograve -70
+KPX F ohungarumlaut -70
+KPX F omacron -70
+KPX F oslash -70
+KPX F otilde -70
+KPX F period -129
+KPX F r -50
+KPX F racute -50
+KPX F rcaron -50
+KPX F rcommaaccent -50
+KPX J A -25
+KPX J Aacute -25
+KPX J Abreve -25
+KPX J Acircumflex -25
+KPX J Adieresis -25
+KPX J Agrave -25
+KPX J Amacron -25
+KPX J Aogonek -25
+KPX J Aring -25
+KPX J Atilde -25
+KPX J a -40
+KPX J aacute -40
+KPX J abreve -40
+KPX J acircumflex -40
+KPX J adieresis -40
+KPX J agrave -40
+KPX J amacron -40
+KPX J aogonek -40
+KPX J aring -40
+KPX J atilde -40
+KPX J comma -10
+KPX J e -40
+KPX J eacute -40
+KPX J ecaron -40
+KPX J ecircumflex -40
+KPX J edieresis -40
+KPX J edotaccent -40
+KPX J egrave -40
+KPX J emacron -40
+KPX J eogonek -40
+KPX J o -40
+KPX J oacute -40
+KPX J ocircumflex -40
+KPX J odieresis -40
+KPX J ograve -40
+KPX J ohungarumlaut -40
+KPX J omacron -40
+KPX J oslash -40
+KPX J otilde -40
+KPX J period -10
+KPX J u -40
+KPX J uacute -40
+KPX J ucircumflex -40
+KPX J udieresis -40
+KPX J ugrave -40
+KPX J uhungarumlaut -40
+KPX J umacron -40
+KPX J uogonek -40
+KPX J uring -40
+KPX K O -30
+KPX K Oacute -30
+KPX K Ocircumflex -30
+KPX K Odieresis -30
+KPX K Ograve -30
+KPX K Ohungarumlaut -30
+KPX K Omacron -30
+KPX K Oslash -30
+KPX K Otilde -30
+KPX K e -25
+KPX K eacute -25
+KPX K ecaron -25
+KPX K ecircumflex -25
+KPX K edieresis -25
+KPX K edotaccent -25
+KPX K egrave -25
+KPX K emacron -25
+KPX K eogonek -25
+KPX K o -25
+KPX K oacute -25
+KPX K ocircumflex -25
+KPX K odieresis -25
+KPX K ograve -25
+KPX K ohungarumlaut -25
+KPX K omacron -25
+KPX K oslash -25
+KPX K otilde -25
+KPX K u -20
+KPX K uacute -20
+KPX K ucircumflex -20
+KPX K udieresis -20
+KPX K ugrave -20
+KPX K uhungarumlaut -20
+KPX K umacron -20
+KPX K uogonek -20
+KPX K uring -20
+KPX K y -20
+KPX K yacute -20
+KPX K ydieresis -20
+KPX Kcommaaccent O -30
+KPX Kcommaaccent Oacute -30
+KPX Kcommaaccent Ocircumflex -30
+KPX Kcommaaccent Odieresis -30
+KPX Kcommaaccent Ograve -30
+KPX Kcommaaccent Ohungarumlaut -30
+KPX Kcommaaccent Omacron -30
+KPX Kcommaaccent Oslash -30
+KPX Kcommaaccent Otilde -30
+KPX Kcommaaccent e -25
+KPX Kcommaaccent eacute -25
+KPX Kcommaaccent ecaron -25
+KPX Kcommaaccent ecircumflex -25
+KPX Kcommaaccent edieresis -25
+KPX Kcommaaccent edotaccent -25
+KPX Kcommaaccent egrave -25
+KPX Kcommaaccent emacron -25
+KPX Kcommaaccent eogonek -25
+KPX Kcommaaccent o -25
+KPX Kcommaaccent oacute -25
+KPX Kcommaaccent ocircumflex -25
+KPX Kcommaaccent odieresis -25
+KPX Kcommaaccent ograve -25
+KPX Kcommaaccent ohungarumlaut -25
+KPX Kcommaaccent omacron -25
+KPX Kcommaaccent oslash -25
+KPX Kcommaaccent otilde -25
+KPX Kcommaaccent u -20
+KPX Kcommaaccent uacute -20
+KPX Kcommaaccent ucircumflex -20
+KPX Kcommaaccent udieresis -20
+KPX Kcommaaccent ugrave -20
+KPX Kcommaaccent uhungarumlaut -20
+KPX Kcommaaccent umacron -20
+KPX Kcommaaccent uogonek -20
+KPX Kcommaaccent uring -20
+KPX Kcommaaccent y -20
+KPX Kcommaaccent yacute -20
+KPX Kcommaaccent ydieresis -20
+KPX L T -18
+KPX L Tcaron -18
+KPX L Tcommaaccent -18
+KPX L V -37
+KPX L W -37
+KPX L Y -37
+KPX L Yacute -37
+KPX L Ydieresis -37
+KPX L quoteright -55
+KPX L y -37
+KPX L yacute -37
+KPX L ydieresis -37
+KPX Lacute T -18
+KPX Lacute Tcaron -18
+KPX Lacute Tcommaaccent -18
+KPX Lacute V -37
+KPX Lacute W -37
+KPX Lacute Y -37
+KPX Lacute Yacute -37
+KPX Lacute Ydieresis -37
+KPX Lacute quoteright -55
+KPX Lacute y -37
+KPX Lacute yacute -37
+KPX Lacute ydieresis -37
+KPX Lcommaaccent T -18
+KPX Lcommaaccent Tcaron -18
+KPX Lcommaaccent Tcommaaccent -18
+KPX Lcommaaccent V -37
+KPX Lcommaaccent W -37
+KPX Lcommaaccent Y -37
+KPX Lcommaaccent Yacute -37
+KPX Lcommaaccent Ydieresis -37
+KPX Lcommaaccent quoteright -55
+KPX Lcommaaccent y -37
+KPX Lcommaaccent yacute -37
+KPX Lcommaaccent ydieresis -37
+KPX Lslash T -18
+KPX Lslash Tcaron -18
+KPX Lslash Tcommaaccent -18
+KPX Lslash V -37
+KPX Lslash W -37
+KPX Lslash Y -37
+KPX Lslash Yacute -37
+KPX Lslash Ydieresis -37
+KPX Lslash quoteright -55
+KPX Lslash y -37
+KPX Lslash yacute -37
+KPX Lslash ydieresis -37
+KPX N A -30
+KPX N Aacute -30
+KPX N Abreve -30
+KPX N Acircumflex -30
+KPX N Adieresis -30
+KPX N Agrave -30
+KPX N Amacron -30
+KPX N Aogonek -30
+KPX N Aring -30
+KPX N Atilde -30
+KPX Nacute A -30
+KPX Nacute Aacute -30
+KPX Nacute Abreve -30
+KPX Nacute Acircumflex -30
+KPX Nacute Adieresis -30
+KPX Nacute Agrave -30
+KPX Nacute Amacron -30
+KPX Nacute Aogonek -30
+KPX Nacute Aring -30
+KPX Nacute Atilde -30
+KPX Ncaron A -30
+KPX Ncaron Aacute -30
+KPX Ncaron Abreve -30
+KPX Ncaron Acircumflex -30
+KPX Ncaron Adieresis -30
+KPX Ncaron Agrave -30
+KPX Ncaron Amacron -30
+KPX Ncaron Aogonek -30
+KPX Ncaron Aring -30
+KPX Ncaron Atilde -30
+KPX Ncommaaccent A -30
+KPX Ncommaaccent Aacute -30
+KPX Ncommaaccent Abreve -30
+KPX Ncommaaccent Acircumflex -30
+KPX Ncommaaccent Adieresis -30
+KPX Ncommaaccent Agrave -30
+KPX Ncommaaccent Amacron -30
+KPX Ncommaaccent Aogonek -30
+KPX Ncommaaccent Aring -30
+KPX Ncommaaccent Atilde -30
+KPX Ntilde A -30
+KPX Ntilde Aacute -30
+KPX Ntilde Abreve -30
+KPX Ntilde Acircumflex -30
+KPX Ntilde Adieresis -30
+KPX Ntilde Agrave -30
+KPX Ntilde Amacron -30
+KPX Ntilde Aogonek -30
+KPX Ntilde Aring -30
+KPX Ntilde Atilde -30
+KPX O A -40
+KPX O Aacute -40
+KPX O Abreve -40
+KPX O Acircumflex -40
+KPX O Adieresis -40
+KPX O Agrave -40
+KPX O Amacron -40
+KPX O Aogonek -40
+KPX O Aring -40
+KPX O Atilde -40
+KPX O T -40
+KPX O Tcaron -40
+KPX O Tcommaaccent -40
+KPX O V -50
+KPX O W -50
+KPX O X -40
+KPX O Y -50
+KPX O Yacute -50
+KPX O Ydieresis -50
+KPX Oacute A -40
+KPX Oacute Aacute -40
+KPX Oacute Abreve -40
+KPX Oacute Acircumflex -40
+KPX Oacute Adieresis -40
+KPX Oacute Agrave -40
+KPX Oacute Amacron -40
+KPX Oacute Aogonek -40
+KPX Oacute Aring -40
+KPX Oacute Atilde -40
+KPX Oacute T -40
+KPX Oacute Tcaron -40
+KPX Oacute Tcommaaccent -40
+KPX Oacute V -50
+KPX Oacute W -50
+KPX Oacute X -40
+KPX Oacute Y -50
+KPX Oacute Yacute -50
+KPX Oacute Ydieresis -50
+KPX Ocircumflex A -40
+KPX Ocircumflex Aacute -40
+KPX Ocircumflex Abreve -40
+KPX Ocircumflex Acircumflex -40
+KPX Ocircumflex Adieresis -40
+KPX Ocircumflex Agrave -40
+KPX Ocircumflex Amacron -40
+KPX Ocircumflex Aogonek -40
+KPX Ocircumflex Aring -40
+KPX Ocircumflex Atilde -40
+KPX Ocircumflex T -40
+KPX Ocircumflex Tcaron -40
+KPX Ocircumflex Tcommaaccent -40
+KPX Ocircumflex V -50
+KPX Ocircumflex W -50
+KPX Ocircumflex X -40
+KPX Ocircumflex Y -50
+KPX Ocircumflex Yacute -50
+KPX Ocircumflex Ydieresis -50
+KPX Odieresis A -40
+KPX Odieresis Aacute -40
+KPX Odieresis Abreve -40
+KPX Odieresis Acircumflex -40
+KPX Odieresis Adieresis -40
+KPX Odieresis Agrave -40
+KPX Odieresis Amacron -40
+KPX Odieresis Aogonek -40
+KPX Odieresis Aring -40
+KPX Odieresis Atilde -40
+KPX Odieresis T -40
+KPX Odieresis Tcaron -40
+KPX Odieresis Tcommaaccent -40
+KPX Odieresis V -50
+KPX Odieresis W -50
+KPX Odieresis X -40
+KPX Odieresis Y -50
+KPX Odieresis Yacute -50
+KPX Odieresis Ydieresis -50
+KPX Ograve A -40
+KPX Ograve Aacute -40
+KPX Ograve Abreve -40
+KPX Ograve Acircumflex -40
+KPX Ograve Adieresis -40
+KPX Ograve Agrave -40
+KPX Ograve Amacron -40
+KPX Ograve Aogonek -40
+KPX Ograve Aring -40
+KPX Ograve Atilde -40
+KPX Ograve T -40
+KPX Ograve Tcaron -40
+KPX Ograve Tcommaaccent -40
+KPX Ograve V -50
+KPX Ograve W -50
+KPX Ograve X -40
+KPX Ograve Y -50
+KPX Ograve Yacute -50
+KPX Ograve Ydieresis -50
+KPX Ohungarumlaut A -40
+KPX Ohungarumlaut Aacute -40
+KPX Ohungarumlaut Abreve -40
+KPX Ohungarumlaut Acircumflex -40
+KPX Ohungarumlaut Adieresis -40
+KPX Ohungarumlaut Agrave -40
+KPX Ohungarumlaut Amacron -40
+KPX Ohungarumlaut Aogonek -40
+KPX Ohungarumlaut Aring -40
+KPX Ohungarumlaut Atilde -40
+KPX Ohungarumlaut T -40
+KPX Ohungarumlaut Tcaron -40
+KPX Ohungarumlaut Tcommaaccent -40
+KPX Ohungarumlaut V -50
+KPX Ohungarumlaut W -50
+KPX Ohungarumlaut X -40
+KPX Ohungarumlaut Y -50
+KPX Ohungarumlaut Yacute -50
+KPX Ohungarumlaut Ydieresis -50
+KPX Omacron A -40
+KPX Omacron Aacute -40
+KPX Omacron Abreve -40
+KPX Omacron Acircumflex -40
+KPX Omacron Adieresis -40
+KPX Omacron Agrave -40
+KPX Omacron Amacron -40
+KPX Omacron Aogonek -40
+KPX Omacron Aring -40
+KPX Omacron Atilde -40
+KPX Omacron T -40
+KPX Omacron Tcaron -40
+KPX Omacron Tcommaaccent -40
+KPX Omacron V -50
+KPX Omacron W -50
+KPX Omacron X -40
+KPX Omacron Y -50
+KPX Omacron Yacute -50
+KPX Omacron Ydieresis -50
+KPX Oslash A -40
+KPX Oslash Aacute -40
+KPX Oslash Abreve -40
+KPX Oslash Acircumflex -40
+KPX Oslash Adieresis -40
+KPX Oslash Agrave -40
+KPX Oslash Amacron -40
+KPX Oslash Aogonek -40
+KPX Oslash Aring -40
+KPX Oslash Atilde -40
+KPX Oslash T -40
+KPX Oslash Tcaron -40
+KPX Oslash Tcommaaccent -40
+KPX Oslash V -50
+KPX Oslash W -50
+KPX Oslash X -40
+KPX Oslash Y -50
+KPX Oslash Yacute -50
+KPX Oslash Ydieresis -50
+KPX Otilde A -40
+KPX Otilde Aacute -40
+KPX Otilde Abreve -40
+KPX Otilde Acircumflex -40
+KPX Otilde Adieresis -40
+KPX Otilde Agrave -40
+KPX Otilde Amacron -40
+KPX Otilde Aogonek -40
+KPX Otilde Aring -40
+KPX Otilde Atilde -40
+KPX Otilde T -40
+KPX Otilde Tcaron -40
+KPX Otilde Tcommaaccent -40
+KPX Otilde V -50
+KPX Otilde W -50
+KPX Otilde X -40
+KPX Otilde Y -50
+KPX Otilde Yacute -50
+KPX Otilde Ydieresis -50
+KPX P A -85
+KPX P Aacute -85
+KPX P Abreve -85
+KPX P Acircumflex -85
+KPX P Adieresis -85
+KPX P Agrave -85
+KPX P Amacron -85
+KPX P Aogonek -85
+KPX P Aring -85
+KPX P Atilde -85
+KPX P a -40
+KPX P aacute -40
+KPX P abreve -40
+KPX P acircumflex -40
+KPX P adieresis -40
+KPX P agrave -40
+KPX P amacron -40
+KPX P aogonek -40
+KPX P aring -40
+KPX P atilde -40
+KPX P comma -129
+KPX P e -50
+KPX P eacute -50
+KPX P ecaron -50
+KPX P ecircumflex -50
+KPX P edieresis -50
+KPX P edotaccent -50
+KPX P egrave -50
+KPX P emacron -50
+KPX P eogonek -50
+KPX P o -55
+KPX P oacute -55
+KPX P ocircumflex -55
+KPX P odieresis -55
+KPX P ograve -55
+KPX P ohungarumlaut -55
+KPX P omacron -55
+KPX P oslash -55
+KPX P otilde -55
+KPX P period -129
+KPX Q U -10
+KPX Q Uacute -10
+KPX Q Ucircumflex -10
+KPX Q Udieresis -10
+KPX Q Ugrave -10
+KPX Q Uhungarumlaut -10
+KPX Q Umacron -10
+KPX Q Uogonek -10
+KPX Q Uring -10
+KPX R O -40
+KPX R Oacute -40
+KPX R Ocircumflex -40
+KPX R Odieresis -40
+KPX R Ograve -40
+KPX R Ohungarumlaut -40
+KPX R Omacron -40
+KPX R Oslash -40
+KPX R Otilde -40
+KPX R T -30
+KPX R Tcaron -30
+KPX R Tcommaaccent -30
+KPX R U -40
+KPX R Uacute -40
+KPX R Ucircumflex -40
+KPX R Udieresis -40
+KPX R Ugrave -40
+KPX R Uhungarumlaut -40
+KPX R Umacron -40
+KPX R Uogonek -40
+KPX R Uring -40
+KPX R V -18
+KPX R W -18
+KPX R Y -18
+KPX R Yacute -18
+KPX R Ydieresis -18
+KPX Racute O -40
+KPX Racute Oacute -40
+KPX Racute Ocircumflex -40
+KPX Racute Odieresis -40
+KPX Racute Ograve -40
+KPX Racute Ohungarumlaut -40
+KPX Racute Omacron -40
+KPX Racute Oslash -40
+KPX Racute Otilde -40
+KPX Racute T -30
+KPX Racute Tcaron -30
+KPX Racute Tcommaaccent -30
+KPX Racute U -40
+KPX Racute Uacute -40
+KPX Racute Ucircumflex -40
+KPX Racute Udieresis -40
+KPX Racute Ugrave -40
+KPX Racute Uhungarumlaut -40
+KPX Racute Umacron -40
+KPX Racute Uogonek -40
+KPX Racute Uring -40
+KPX Racute V -18
+KPX Racute W -18
+KPX Racute Y -18
+KPX Racute Yacute -18
+KPX Racute Ydieresis -18
+KPX Rcaron O -40
+KPX Rcaron Oacute -40
+KPX Rcaron Ocircumflex -40
+KPX Rcaron Odieresis -40
+KPX Rcaron Ograve -40
+KPX Rcaron Ohungarumlaut -40
+KPX Rcaron Omacron -40
+KPX Rcaron Oslash -40
+KPX Rcaron Otilde -40
+KPX Rcaron T -30
+KPX Rcaron Tcaron -30
+KPX Rcaron Tcommaaccent -30
+KPX Rcaron U -40
+KPX Rcaron Uacute -40
+KPX Rcaron Ucircumflex -40
+KPX Rcaron Udieresis -40
+KPX Rcaron Ugrave -40
+KPX Rcaron Uhungarumlaut -40
+KPX Rcaron Umacron -40
+KPX Rcaron Uogonek -40
+KPX Rcaron Uring -40
+KPX Rcaron V -18
+KPX Rcaron W -18
+KPX Rcaron Y -18
+KPX Rcaron Yacute -18
+KPX Rcaron Ydieresis -18
+KPX Rcommaaccent O -40
+KPX Rcommaaccent Oacute -40
+KPX Rcommaaccent Ocircumflex -40
+KPX Rcommaaccent Odieresis -40
+KPX Rcommaaccent Ograve -40
+KPX Rcommaaccent Ohungarumlaut -40
+KPX Rcommaaccent Omacron -40
+KPX Rcommaaccent Oslash -40
+KPX Rcommaaccent Otilde -40
+KPX Rcommaaccent T -30
+KPX Rcommaaccent Tcaron -30
+KPX Rcommaaccent Tcommaaccent -30
+KPX Rcommaaccent U -40
+KPX Rcommaaccent Uacute -40
+KPX Rcommaaccent Ucircumflex -40
+KPX Rcommaaccent Udieresis -40
+KPX Rcommaaccent Ugrave -40
+KPX Rcommaaccent Uhungarumlaut -40
+KPX Rcommaaccent Umacron -40
+KPX Rcommaaccent Uogonek -40
+KPX Rcommaaccent Uring -40
+KPX Rcommaaccent V -18
+KPX Rcommaaccent W -18
+KPX Rcommaaccent Y -18
+KPX Rcommaaccent Yacute -18
+KPX Rcommaaccent Ydieresis -18
+KPX T A -55
+KPX T Aacute -55
+KPX T Abreve -55
+KPX T Acircumflex -55
+KPX T Adieresis -55
+KPX T Agrave -55
+KPX T Amacron -55
+KPX T Aogonek -55
+KPX T Aring -55
+KPX T Atilde -55
+KPX T O -18
+KPX T Oacute -18
+KPX T Ocircumflex -18
+KPX T Odieresis -18
+KPX T Ograve -18
+KPX T Ohungarumlaut -18
+KPX T Omacron -18
+KPX T Oslash -18
+KPX T Otilde -18
+KPX T a -92
+KPX T aacute -92
+KPX T abreve -92
+KPX T acircumflex -92
+KPX T adieresis -92
+KPX T agrave -92
+KPX T amacron -92
+KPX T aogonek -92
+KPX T aring -92
+KPX T atilde -92
+KPX T colon -74
+KPX T comma -92
+KPX T e -92
+KPX T eacute -92
+KPX T ecaron -92
+KPX T ecircumflex -92
+KPX T edieresis -52
+KPX T edotaccent -92
+KPX T egrave -52
+KPX T emacron -52
+KPX T eogonek -92
+KPX T hyphen -92
+KPX T i -37
+KPX T iacute -37
+KPX T iogonek -37
+KPX T o -95
+KPX T oacute -95
+KPX T ocircumflex -95
+KPX T odieresis -95
+KPX T ograve -95
+KPX T ohungarumlaut -95
+KPX T omacron -95
+KPX T oslash -95
+KPX T otilde -95
+KPX T period -92
+KPX T r -37
+KPX T racute -37
+KPX T rcaron -37
+KPX T rcommaaccent -37
+KPX T semicolon -74
+KPX T u -37
+KPX T uacute -37
+KPX T ucircumflex -37
+KPX T udieresis -37
+KPX T ugrave -37
+KPX T uhungarumlaut -37
+KPX T umacron -37
+KPX T uogonek -37
+KPX T uring -37
+KPX T w -37
+KPX T y -37
+KPX T yacute -37
+KPX T ydieresis -37
+KPX Tcaron A -55
+KPX Tcaron Aacute -55
+KPX Tcaron Abreve -55
+KPX Tcaron Acircumflex -55
+KPX Tcaron Adieresis -55
+KPX Tcaron Agrave -55
+KPX Tcaron Amacron -55
+KPX Tcaron Aogonek -55
+KPX Tcaron Aring -55
+KPX Tcaron Atilde -55
+KPX Tcaron O -18
+KPX Tcaron Oacute -18
+KPX Tcaron Ocircumflex -18
+KPX Tcaron Odieresis -18
+KPX Tcaron Ograve -18
+KPX Tcaron Ohungarumlaut -18
+KPX Tcaron Omacron -18
+KPX Tcaron Oslash -18
+KPX Tcaron Otilde -18
+KPX Tcaron a -92
+KPX Tcaron aacute -92
+KPX Tcaron abreve -92
+KPX Tcaron acircumflex -92
+KPX Tcaron adieresis -92
+KPX Tcaron agrave -92
+KPX Tcaron amacron -92
+KPX Tcaron aogonek -92
+KPX Tcaron aring -92
+KPX Tcaron atilde -92
+KPX Tcaron colon -74
+KPX Tcaron comma -92
+KPX Tcaron e -92
+KPX Tcaron eacute -92
+KPX Tcaron ecaron -92
+KPX Tcaron ecircumflex -92
+KPX Tcaron edieresis -52
+KPX Tcaron edotaccent -92
+KPX Tcaron egrave -52
+KPX Tcaron emacron -52
+KPX Tcaron eogonek -92
+KPX Tcaron hyphen -92
+KPX Tcaron i -37
+KPX Tcaron iacute -37
+KPX Tcaron iogonek -37
+KPX Tcaron o -95
+KPX Tcaron oacute -95
+KPX Tcaron ocircumflex -95
+KPX Tcaron odieresis -95
+KPX Tcaron ograve -95
+KPX Tcaron ohungarumlaut -95
+KPX Tcaron omacron -95
+KPX Tcaron oslash -95
+KPX Tcaron otilde -95
+KPX Tcaron period -92
+KPX Tcaron r -37
+KPX Tcaron racute -37
+KPX Tcaron rcaron -37
+KPX Tcaron rcommaaccent -37
+KPX Tcaron semicolon -74
+KPX Tcaron u -37
+KPX Tcaron uacute -37
+KPX Tcaron ucircumflex -37
+KPX Tcaron udieresis -37
+KPX Tcaron ugrave -37
+KPX Tcaron uhungarumlaut -37
+KPX Tcaron umacron -37
+KPX Tcaron uogonek -37
+KPX Tcaron uring -37
+KPX Tcaron w -37
+KPX Tcaron y -37
+KPX Tcaron yacute -37
+KPX Tcaron ydieresis -37
+KPX Tcommaaccent A -55
+KPX Tcommaaccent Aacute -55
+KPX Tcommaaccent Abreve -55
+KPX Tcommaaccent Acircumflex -55
+KPX Tcommaaccent Adieresis -55
+KPX Tcommaaccent Agrave -55
+KPX Tcommaaccent Amacron -55
+KPX Tcommaaccent Aogonek -55
+KPX Tcommaaccent Aring -55
+KPX Tcommaaccent Atilde -55
+KPX Tcommaaccent O -18
+KPX Tcommaaccent Oacute -18
+KPX Tcommaaccent Ocircumflex -18
+KPX Tcommaaccent Odieresis -18
+KPX Tcommaaccent Ograve -18
+KPX Tcommaaccent Ohungarumlaut -18
+KPX Tcommaaccent Omacron -18
+KPX Tcommaaccent Oslash -18
+KPX Tcommaaccent Otilde -18
+KPX Tcommaaccent a -92
+KPX Tcommaaccent aacute -92
+KPX Tcommaaccent abreve -92
+KPX Tcommaaccent acircumflex -92
+KPX Tcommaaccent adieresis -92
+KPX Tcommaaccent agrave -92
+KPX Tcommaaccent amacron -92
+KPX Tcommaaccent aogonek -92
+KPX Tcommaaccent aring -92
+KPX Tcommaaccent atilde -92
+KPX Tcommaaccent colon -74
+KPX Tcommaaccent comma -92
+KPX Tcommaaccent e -92
+KPX Tcommaaccent eacute -92
+KPX Tcommaaccent ecaron -92
+KPX Tcommaaccent ecircumflex -92
+KPX Tcommaaccent edieresis -52
+KPX Tcommaaccent edotaccent -92
+KPX Tcommaaccent egrave -52
+KPX Tcommaaccent emacron -52
+KPX Tcommaaccent eogonek -92
+KPX Tcommaaccent hyphen -92
+KPX Tcommaaccent i -37
+KPX Tcommaaccent iacute -37
+KPX Tcommaaccent iogonek -37
+KPX Tcommaaccent o -95
+KPX Tcommaaccent oacute -95
+KPX Tcommaaccent ocircumflex -95
+KPX Tcommaaccent odieresis -95
+KPX Tcommaaccent ograve -95
+KPX Tcommaaccent ohungarumlaut -95
+KPX Tcommaaccent omacron -95
+KPX Tcommaaccent oslash -95
+KPX Tcommaaccent otilde -95
+KPX Tcommaaccent period -92
+KPX Tcommaaccent r -37
+KPX Tcommaaccent racute -37
+KPX Tcommaaccent rcaron -37
+KPX Tcommaaccent rcommaaccent -37
+KPX Tcommaaccent semicolon -74
+KPX Tcommaaccent u -37
+KPX Tcommaaccent uacute -37
+KPX Tcommaaccent ucircumflex -37
+KPX Tcommaaccent udieresis -37
+KPX Tcommaaccent ugrave -37
+KPX Tcommaaccent uhungarumlaut -37
+KPX Tcommaaccent umacron -37
+KPX Tcommaaccent uogonek -37
+KPX Tcommaaccent uring -37
+KPX Tcommaaccent w -37
+KPX Tcommaaccent y -37
+KPX Tcommaaccent yacute -37
+KPX Tcommaaccent ydieresis -37
+KPX U A -45
+KPX U Aacute -45
+KPX U Abreve -45
+KPX U Acircumflex -45
+KPX U Adieresis -45
+KPX U Agrave -45
+KPX U Amacron -45
+KPX U Aogonek -45
+KPX U Aring -45
+KPX U Atilde -45
+KPX Uacute A -45
+KPX Uacute Aacute -45
+KPX Uacute Abreve -45
+KPX Uacute Acircumflex -45
+KPX Uacute Adieresis -45
+KPX Uacute Agrave -45
+KPX Uacute Amacron -45
+KPX Uacute Aogonek -45
+KPX Uacute Aring -45
+KPX Uacute Atilde -45
+KPX Ucircumflex A -45
+KPX Ucircumflex Aacute -45
+KPX Ucircumflex Abreve -45
+KPX Ucircumflex Acircumflex -45
+KPX Ucircumflex Adieresis -45
+KPX Ucircumflex Agrave -45
+KPX Ucircumflex Amacron -45
+KPX Ucircumflex Aogonek -45
+KPX Ucircumflex Aring -45
+KPX Ucircumflex Atilde -45
+KPX Udieresis A -45
+KPX Udieresis Aacute -45
+KPX Udieresis Abreve -45
+KPX Udieresis Acircumflex -45
+KPX Udieresis Adieresis -45
+KPX Udieresis Agrave -45
+KPX Udieresis Amacron -45
+KPX Udieresis Aogonek -45
+KPX Udieresis Aring -45
+KPX Udieresis Atilde -45
+KPX Ugrave A -45
+KPX Ugrave Aacute -45
+KPX Ugrave Abreve -45
+KPX Ugrave Acircumflex -45
+KPX Ugrave Adieresis -45
+KPX Ugrave Agrave -45
+KPX Ugrave Amacron -45
+KPX Ugrave Aogonek -45
+KPX Ugrave Aring -45
+KPX Ugrave Atilde -45
+KPX Uhungarumlaut A -45
+KPX Uhungarumlaut Aacute -45
+KPX Uhungarumlaut Abreve -45
+KPX Uhungarumlaut Acircumflex -45
+KPX Uhungarumlaut Adieresis -45
+KPX Uhungarumlaut Agrave -45
+KPX Uhungarumlaut Amacron -45
+KPX Uhungarumlaut Aogonek -45
+KPX Uhungarumlaut Aring -45
+KPX Uhungarumlaut Atilde -45
+KPX Umacron A -45
+KPX Umacron Aacute -45
+KPX Umacron Abreve -45
+KPX Umacron Acircumflex -45
+KPX Umacron Adieresis -45
+KPX Umacron Agrave -45
+KPX Umacron Amacron -45
+KPX Umacron Aogonek -45
+KPX Umacron Aring -45
+KPX Umacron Atilde -45
+KPX Uogonek A -45
+KPX Uogonek Aacute -45
+KPX Uogonek Abreve -45
+KPX Uogonek Acircumflex -45
+KPX Uogonek Adieresis -45
+KPX Uogonek Agrave -45
+KPX Uogonek Amacron -45
+KPX Uogonek Aogonek -45
+KPX Uogonek Aring -45
+KPX Uogonek Atilde -45
+KPX Uring A -45
+KPX Uring Aacute -45
+KPX Uring Abreve -45
+KPX Uring Acircumflex -45
+KPX Uring Adieresis -45
+KPX Uring Agrave -45
+KPX Uring Amacron -45
+KPX Uring Aogonek -45
+KPX Uring Aring -45
+KPX Uring Atilde -45
+KPX V A -85
+KPX V Aacute -85
+KPX V Abreve -85
+KPX V Acircumflex -85
+KPX V Adieresis -85
+KPX V Agrave -85
+KPX V Amacron -85
+KPX V Aogonek -85
+KPX V Aring -85
+KPX V Atilde -85
+KPX V G -10
+KPX V Gbreve -10
+KPX V Gcommaaccent -10
+KPX V O -30
+KPX V Oacute -30
+KPX V Ocircumflex -30
+KPX V Odieresis -30
+KPX V Ograve -30
+KPX V Ohungarumlaut -30
+KPX V Omacron -30
+KPX V Oslash -30
+KPX V Otilde -30
+KPX V a -111
+KPX V aacute -111
+KPX V abreve -111
+KPX V acircumflex -111
+KPX V adieresis -111
+KPX V agrave -111
+KPX V amacron -111
+KPX V aogonek -111
+KPX V aring -111
+KPX V atilde -111
+KPX V colon -74
+KPX V comma -129
+KPX V e -111
+KPX V eacute -111
+KPX V ecaron -111
+KPX V ecircumflex -111
+KPX V edieresis -71
+KPX V edotaccent -111
+KPX V egrave -71
+KPX V emacron -71
+KPX V eogonek -111
+KPX V hyphen -70
+KPX V i -55
+KPX V iacute -55
+KPX V iogonek -55
+KPX V o -111
+KPX V oacute -111
+KPX V ocircumflex -111
+KPX V odieresis -111
+KPX V ograve -111
+KPX V ohungarumlaut -111
+KPX V omacron -111
+KPX V oslash -111
+KPX V otilde -111
+KPX V period -129
+KPX V semicolon -74
+KPX V u -55
+KPX V uacute -55
+KPX V ucircumflex -55
+KPX V udieresis -55
+KPX V ugrave -55
+KPX V uhungarumlaut -55
+KPX V umacron -55
+KPX V uogonek -55
+KPX V uring -55
+KPX W A -74
+KPX W Aacute -74
+KPX W Abreve -74
+KPX W Acircumflex -74
+KPX W Adieresis -74
+KPX W Agrave -74
+KPX W Amacron -74
+KPX W Aogonek -74
+KPX W Aring -74
+KPX W Atilde -74
+KPX W O -15
+KPX W Oacute -15
+KPX W Ocircumflex -15
+KPX W Odieresis -15
+KPX W Ograve -15
+KPX W Ohungarumlaut -15
+KPX W Omacron -15
+KPX W Oslash -15
+KPX W Otilde -15
+KPX W a -85
+KPX W aacute -85
+KPX W abreve -85
+KPX W acircumflex -85
+KPX W adieresis -85
+KPX W agrave -85
+KPX W amacron -85
+KPX W aogonek -85
+KPX W aring -85
+KPX W atilde -85
+KPX W colon -55
+KPX W comma -74
+KPX W e -90
+KPX W eacute -90
+KPX W ecaron -90
+KPX W ecircumflex -90
+KPX W edieresis -50
+KPX W edotaccent -90
+KPX W egrave -50
+KPX W emacron -50
+KPX W eogonek -90
+KPX W hyphen -50
+KPX W i -37
+KPX W iacute -37
+KPX W iogonek -37
+KPX W o -80
+KPX W oacute -80
+KPX W ocircumflex -80
+KPX W odieresis -80
+KPX W ograve -80
+KPX W ohungarumlaut -80
+KPX W omacron -80
+KPX W oslash -80
+KPX W otilde -80
+KPX W period -74
+KPX W semicolon -55
+KPX W u -55
+KPX W uacute -55
+KPX W ucircumflex -55
+KPX W udieresis -55
+KPX W ugrave -55
+KPX W uhungarumlaut -55
+KPX W umacron -55
+KPX W uogonek -55
+KPX W uring -55
+KPX W y -55
+KPX W yacute -55
+KPX W ydieresis -55
+KPX Y A -74
+KPX Y Aacute -74
+KPX Y Abreve -74
+KPX Y Acircumflex -74
+KPX Y Adieresis -74
+KPX Y Agrave -74
+KPX Y Amacron -74
+KPX Y Aogonek -74
+KPX Y Aring -74
+KPX Y Atilde -74
+KPX Y O -25
+KPX Y Oacute -25
+KPX Y Ocircumflex -25
+KPX Y Odieresis -25
+KPX Y Ograve -25
+KPX Y Ohungarumlaut -25
+KPX Y Omacron -25
+KPX Y Oslash -25
+KPX Y Otilde -25
+KPX Y a -92
+KPX Y aacute -92
+KPX Y abreve -92
+KPX Y acircumflex -92
+KPX Y adieresis -92
+KPX Y agrave -92
+KPX Y amacron -92
+KPX Y aogonek -92
+KPX Y aring -92
+KPX Y atilde -92
+KPX Y colon -92
+KPX Y comma -92
+KPX Y e -111
+KPX Y eacute -111
+KPX Y ecaron -111
+KPX Y ecircumflex -71
+KPX Y edieresis -71
+KPX Y edotaccent -111
+KPX Y egrave -71
+KPX Y emacron -71
+KPX Y eogonek -111
+KPX Y hyphen -92
+KPX Y i -55
+KPX Y iacute -55
+KPX Y iogonek -55
+KPX Y o -111
+KPX Y oacute -111
+KPX Y ocircumflex -111
+KPX Y odieresis -111
+KPX Y ograve -111
+KPX Y ohungarumlaut -111
+KPX Y omacron -111
+KPX Y oslash -111
+KPX Y otilde -111
+KPX Y period -74
+KPX Y semicolon -92
+KPX Y u -92
+KPX Y uacute -92
+KPX Y ucircumflex -92
+KPX Y udieresis -92
+KPX Y ugrave -92
+KPX Y uhungarumlaut -92
+KPX Y umacron -92
+KPX Y uogonek -92
+KPX Y uring -92
+KPX Yacute A -74
+KPX Yacute Aacute -74
+KPX Yacute Abreve -74
+KPX Yacute Acircumflex -74
+KPX Yacute Adieresis -74
+KPX Yacute Agrave -74
+KPX Yacute Amacron -74
+KPX Yacute Aogonek -74
+KPX Yacute Aring -74
+KPX Yacute Atilde -74
+KPX Yacute O -25
+KPX Yacute Oacute -25
+KPX Yacute Ocircumflex -25
+KPX Yacute Odieresis -25
+KPX Yacute Ograve -25
+KPX Yacute Ohungarumlaut -25
+KPX Yacute Omacron -25
+KPX Yacute Oslash -25
+KPX Yacute Otilde -25
+KPX Yacute a -92
+KPX Yacute aacute -92
+KPX Yacute abreve -92
+KPX Yacute acircumflex -92
+KPX Yacute adieresis -92
+KPX Yacute agrave -92
+KPX Yacute amacron -92
+KPX Yacute aogonek -92
+KPX Yacute aring -92
+KPX Yacute atilde -92
+KPX Yacute colon -92
+KPX Yacute comma -92
+KPX Yacute e -111
+KPX Yacute eacute -111
+KPX Yacute ecaron -111
+KPX Yacute ecircumflex -71
+KPX Yacute edieresis -71
+KPX Yacute edotaccent -111
+KPX Yacute egrave -71
+KPX Yacute emacron -71
+KPX Yacute eogonek -111
+KPX Yacute hyphen -92
+KPX Yacute i -55
+KPX Yacute iacute -55
+KPX Yacute iogonek -55
+KPX Yacute o -111
+KPX Yacute oacute -111
+KPX Yacute ocircumflex -111
+KPX Yacute odieresis -111
+KPX Yacute ograve -111
+KPX Yacute ohungarumlaut -111
+KPX Yacute omacron -111
+KPX Yacute oslash -111
+KPX Yacute otilde -111
+KPX Yacute period -74
+KPX Yacute semicolon -92
+KPX Yacute u -92
+KPX Yacute uacute -92
+KPX Yacute ucircumflex -92
+KPX Yacute udieresis -92
+KPX Yacute ugrave -92
+KPX Yacute uhungarumlaut -92
+KPX Yacute umacron -92
+KPX Yacute uogonek -92
+KPX Yacute uring -92
+KPX Ydieresis A -74
+KPX Ydieresis Aacute -74
+KPX Ydieresis Abreve -74
+KPX Ydieresis Acircumflex -74
+KPX Ydieresis Adieresis -74
+KPX Ydieresis Agrave -74
+KPX Ydieresis Amacron -74
+KPX Ydieresis Aogonek -74
+KPX Ydieresis Aring -74
+KPX Ydieresis Atilde -74
+KPX Ydieresis O -25
+KPX Ydieresis Oacute -25
+KPX Ydieresis Ocircumflex -25
+KPX Ydieresis Odieresis -25
+KPX Ydieresis Ograve -25
+KPX Ydieresis Ohungarumlaut -25
+KPX Ydieresis Omacron -25
+KPX Ydieresis Oslash -25
+KPX Ydieresis Otilde -25
+KPX Ydieresis a -92
+KPX Ydieresis aacute -92
+KPX Ydieresis abreve -92
+KPX Ydieresis acircumflex -92
+KPX Ydieresis adieresis -92
+KPX Ydieresis agrave -92
+KPX Ydieresis amacron -92
+KPX Ydieresis aogonek -92
+KPX Ydieresis aring -92
+KPX Ydieresis atilde -92
+KPX Ydieresis colon -92
+KPX Ydieresis comma -92
+KPX Ydieresis e -111
+KPX Ydieresis eacute -111
+KPX Ydieresis ecaron -111
+KPX Ydieresis ecircumflex -71
+KPX Ydieresis edieresis -71
+KPX Ydieresis edotaccent -111
+KPX Ydieresis egrave -71
+KPX Ydieresis emacron -71
+KPX Ydieresis eogonek -111
+KPX Ydieresis hyphen -92
+KPX Ydieresis i -55
+KPX Ydieresis iacute -55
+KPX Ydieresis iogonek -55
+KPX Ydieresis o -111
+KPX Ydieresis oacute -111
+KPX Ydieresis ocircumflex -111
+KPX Ydieresis odieresis -111
+KPX Ydieresis ograve -111
+KPX Ydieresis ohungarumlaut -111
+KPX Ydieresis omacron -111
+KPX Ydieresis oslash -111
+KPX Ydieresis otilde -111
+KPX Ydieresis period -74
+KPX Ydieresis semicolon -92
+KPX Ydieresis u -92
+KPX Ydieresis uacute -92
+KPX Ydieresis ucircumflex -92
+KPX Ydieresis udieresis -92
+KPX Ydieresis ugrave -92
+KPX Ydieresis uhungarumlaut -92
+KPX Ydieresis umacron -92
+KPX Ydieresis uogonek -92
+KPX Ydieresis uring -92
+KPX b b -10
+KPX b period -40
+KPX b u -20
+KPX b uacute -20
+KPX b ucircumflex -20
+KPX b udieresis -20
+KPX b ugrave -20
+KPX b uhungarumlaut -20
+KPX b umacron -20
+KPX b uogonek -20
+KPX b uring -20
+KPX c h -10
+KPX c k -10
+KPX c kcommaaccent -10
+KPX cacute h -10
+KPX cacute k -10
+KPX cacute kcommaaccent -10
+KPX ccaron h -10
+KPX ccaron k -10
+KPX ccaron kcommaaccent -10
+KPX ccedilla h -10
+KPX ccedilla k -10
+KPX ccedilla kcommaaccent -10
+KPX comma quotedblright -95
+KPX comma quoteright -95
+KPX e b -10
+KPX eacute b -10
+KPX ecaron b -10
+KPX ecircumflex b -10
+KPX edieresis b -10
+KPX edotaccent b -10
+KPX egrave b -10
+KPX emacron b -10
+KPX eogonek b -10
+KPX f comma -10
+KPX f dotlessi -30
+KPX f e -10
+KPX f eacute -10
+KPX f edotaccent -10
+KPX f eogonek -10
+KPX f f -18
+KPX f o -10
+KPX f oacute -10
+KPX f ocircumflex -10
+KPX f ograve -10
+KPX f ohungarumlaut -10
+KPX f oslash -10
+KPX f otilde -10
+KPX f period -10
+KPX f quoteright 55
+KPX k e -30
+KPX k eacute -30
+KPX k ecaron -30
+KPX k ecircumflex -30
+KPX k edieresis -30
+KPX k edotaccent -30
+KPX k egrave -30
+KPX k emacron -30
+KPX k eogonek -30
+KPX k o -10
+KPX k oacute -10
+KPX k ocircumflex -10
+KPX k odieresis -10
+KPX k ograve -10
+KPX k ohungarumlaut -10
+KPX k omacron -10
+KPX k oslash -10
+KPX k otilde -10
+KPX kcommaaccent e -30
+KPX kcommaaccent eacute -30
+KPX kcommaaccent ecaron -30
+KPX kcommaaccent ecircumflex -30
+KPX kcommaaccent edieresis -30
+KPX kcommaaccent edotaccent -30
+KPX kcommaaccent egrave -30
+KPX kcommaaccent emacron -30
+KPX kcommaaccent eogonek -30
+KPX kcommaaccent o -10
+KPX kcommaaccent oacute -10
+KPX kcommaaccent ocircumflex -10
+KPX kcommaaccent odieresis -10
+KPX kcommaaccent ograve -10
+KPX kcommaaccent ohungarumlaut -10
+KPX kcommaaccent omacron -10
+KPX kcommaaccent oslash -10
+KPX kcommaaccent otilde -10
+KPX n v -40
+KPX nacute v -40
+KPX ncaron v -40
+KPX ncommaaccent v -40
+KPX ntilde v -40
+KPX o v -15
+KPX o w -25
+KPX o x -10
+KPX o y -10
+KPX o yacute -10
+KPX o ydieresis -10
+KPX oacute v -15
+KPX oacute w -25
+KPX oacute x -10
+KPX oacute y -10
+KPX oacute yacute -10
+KPX oacute ydieresis -10
+KPX ocircumflex v -15
+KPX ocircumflex w -25
+KPX ocircumflex x -10
+KPX ocircumflex y -10
+KPX ocircumflex yacute -10
+KPX ocircumflex ydieresis -10
+KPX odieresis v -15
+KPX odieresis w -25
+KPX odieresis x -10
+KPX odieresis y -10
+KPX odieresis yacute -10
+KPX odieresis ydieresis -10
+KPX ograve v -15
+KPX ograve w -25
+KPX ograve x -10
+KPX ograve y -10
+KPX ograve yacute -10
+KPX ograve ydieresis -10
+KPX ohungarumlaut v -15
+KPX ohungarumlaut w -25
+KPX ohungarumlaut x -10
+KPX ohungarumlaut y -10
+KPX ohungarumlaut yacute -10
+KPX ohungarumlaut ydieresis -10
+KPX omacron v -15
+KPX omacron w -25
+KPX omacron x -10
+KPX omacron y -10
+KPX omacron yacute -10
+KPX omacron ydieresis -10
+KPX oslash v -15
+KPX oslash w -25
+KPX oslash x -10
+KPX oslash y -10
+KPX oslash yacute -10
+KPX oslash ydieresis -10
+KPX otilde v -15
+KPX otilde w -25
+KPX otilde x -10
+KPX otilde y -10
+KPX otilde yacute -10
+KPX otilde ydieresis -10
+KPX period quotedblright -95
+KPX period quoteright -95
+KPX quoteleft quoteleft -74
+KPX quoteright d -15
+KPX quoteright dcroat -15
+KPX quoteright quoteright -74
+KPX quoteright r -15
+KPX quoteright racute -15
+KPX quoteright rcaron -15
+KPX quoteright rcommaaccent -15
+KPX quoteright s -74
+KPX quoteright sacute -74
+KPX quoteright scaron -74
+KPX quoteright scedilla -74
+KPX quoteright scommaaccent -74
+KPX quoteright space -74
+KPX quoteright t -37
+KPX quoteright tcommaaccent -37
+KPX quoteright v -15
+KPX r comma -65
+KPX r period -65
+KPX racute comma -65
+KPX racute period -65
+KPX rcaron comma -65
+KPX rcaron period -65
+KPX rcommaaccent comma -65
+KPX rcommaaccent period -65
+KPX space A -37
+KPX space Aacute -37
+KPX space Abreve -37
+KPX space Acircumflex -37
+KPX space Adieresis -37
+KPX space Agrave -37
+KPX space Amacron -37
+KPX space Aogonek -37
+KPX space Aring -37
+KPX space Atilde -37
+KPX space V -70
+KPX space W -70
+KPX space Y -70
+KPX space Yacute -70
+KPX space Ydieresis -70
+KPX v comma -37
+KPX v e -15
+KPX v eacute -15
+KPX v ecaron -15
+KPX v ecircumflex -15
+KPX v edieresis -15
+KPX v edotaccent -15
+KPX v egrave -15
+KPX v emacron -15
+KPX v eogonek -15
+KPX v o -15
+KPX v oacute -15
+KPX v ocircumflex -15
+KPX v odieresis -15
+KPX v ograve -15
+KPX v ohungarumlaut -15
+KPX v omacron -15
+KPX v oslash -15
+KPX v otilde -15
+KPX v period -37
+KPX w a -10
+KPX w aacute -10
+KPX w abreve -10
+KPX w acircumflex -10
+KPX w adieresis -10
+KPX w agrave -10
+KPX w amacron -10
+KPX w aogonek -10
+KPX w aring -10
+KPX w atilde -10
+KPX w comma -37
+KPX w e -10
+KPX w eacute -10
+KPX w ecaron -10
+KPX w ecircumflex -10
+KPX w edieresis -10
+KPX w edotaccent -10
+KPX w egrave -10
+KPX w emacron -10
+KPX w eogonek -10
+KPX w o -15
+KPX w oacute -15
+KPX w ocircumflex -15
+KPX w odieresis -15
+KPX w ograve -15
+KPX w ohungarumlaut -15
+KPX w omacron -15
+KPX w oslash -15
+KPX w otilde -15
+KPX w period -37
+KPX x e -10
+KPX x eacute -10
+KPX x ecaron -10
+KPX x ecircumflex -10
+KPX x edieresis -10
+KPX x edotaccent -10
+KPX x egrave -10
+KPX x emacron -10
+KPX x eogonek -10
+KPX y comma -37
+KPX y period -37
+KPX yacute comma -37
+KPX yacute period -37
+KPX ydieresis comma -37
+KPX ydieresis period -37
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Italic.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Italic.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b0eaee40fc6ab16103375431fea06c22f648f471
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Italic.afm
@@ -0,0 +1,2667 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 12:56:55 1997
+Comment UniqueID 43067
+Comment VMusage 47727 58752
+FontName Times-Italic
+FullName Times Italic
+FamilyName Times
+Weight Medium
+ItalicAngle -15.5
+IsFixedPitch false
+CharacterSet ExtendedRoman
+FontBBox -169 -217 1010 883
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype-Hell AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 653
+XHeight 441
+Ascender 683
+Descender -217
+StdHW 32
+StdVW 76
+StartCharMetrics 315
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 39 -11 302 667 ;
+C 34 ; WX 420 ; N quotedbl ; B 144 421 432 666 ;
+C 35 ; WX 500 ; N numbersign ; B 2 0 540 676 ;
+C 36 ; WX 500 ; N dollar ; B 31 -89 497 731 ;
+C 37 ; WX 833 ; N percent ; B 79 -13 790 676 ;
+C 38 ; WX 778 ; N ampersand ; B 76 -18 723 666 ;
+C 39 ; WX 333 ; N quoteright ; B 151 436 290 666 ;
+C 40 ; WX 333 ; N parenleft ; B 42 -181 315 669 ;
+C 41 ; WX 333 ; N parenright ; B 16 -180 289 669 ;
+C 42 ; WX 500 ; N asterisk ; B 128 255 492 666 ;
+C 43 ; WX 675 ; N plus ; B 86 0 590 506 ;
+C 44 ; WX 250 ; N comma ; B -4 -129 135 101 ;
+C 45 ; WX 333 ; N hyphen ; B 49 192 282 255 ;
+C 46 ; WX 250 ; N period ; B 27 -11 138 100 ;
+C 47 ; WX 278 ; N slash ; B -65 -18 386 666 ;
+C 48 ; WX 500 ; N zero ; B 32 -7 497 676 ;
+C 49 ; WX 500 ; N one ; B 49 0 409 676 ;
+C 50 ; WX 500 ; N two ; B 12 0 452 676 ;
+C 51 ; WX 500 ; N three ; B 15 -7 465 676 ;
+C 52 ; WX 500 ; N four ; B 1 0 479 676 ;
+C 53 ; WX 500 ; N five ; B 15 -7 491 666 ;
+C 54 ; WX 500 ; N six ; B 30 -7 521 686 ;
+C 55 ; WX 500 ; N seven ; B 75 -8 537 666 ;
+C 56 ; WX 500 ; N eight ; B 30 -7 493 676 ;
+C 57 ; WX 500 ; N nine ; B 23 -17 492 676 ;
+C 58 ; WX 333 ; N colon ; B 50 -11 261 441 ;
+C 59 ; WX 333 ; N semicolon ; B 27 -129 261 441 ;
+C 60 ; WX 675 ; N less ; B 84 -8 592 514 ;
+C 61 ; WX 675 ; N equal ; B 86 120 590 386 ;
+C 62 ; WX 675 ; N greater ; B 84 -8 592 514 ;
+C 63 ; WX 500 ; N question ; B 132 -12 472 664 ;
+C 64 ; WX 920 ; N at ; B 118 -18 806 666 ;
+C 65 ; WX 611 ; N A ; B -51 0 564 668 ;
+C 66 ; WX 611 ; N B ; B -8 0 588 653 ;
+C 67 ; WX 667 ; N C ; B 66 -18 689 666 ;
+C 68 ; WX 722 ; N D ; B -8 0 700 653 ;
+C 69 ; WX 611 ; N E ; B -1 0 634 653 ;
+C 70 ; WX 611 ; N F ; B 8 0 645 653 ;
+C 71 ; WX 722 ; N G ; B 52 -18 722 666 ;
+C 72 ; WX 722 ; N H ; B -8 0 767 653 ;
+C 73 ; WX 333 ; N I ; B -8 0 384 653 ;
+C 74 ; WX 444 ; N J ; B -6 -18 491 653 ;
+C 75 ; WX 667 ; N K ; B 7 0 722 653 ;
+C 76 ; WX 556 ; N L ; B -8 0 559 653 ;
+C 77 ; WX 833 ; N M ; B -18 0 873 653 ;
+C 78 ; WX 667 ; N N ; B -20 -15 727 653 ;
+C 79 ; WX 722 ; N O ; B 60 -18 699 666 ;
+C 80 ; WX 611 ; N P ; B 0 0 605 653 ;
+C 81 ; WX 722 ; N Q ; B 59 -182 699 666 ;
+C 82 ; WX 611 ; N R ; B -13 0 588 653 ;
+C 83 ; WX 500 ; N S ; B 17 -18 508 667 ;
+C 84 ; WX 556 ; N T ; B 59 0 633 653 ;
+C 85 ; WX 722 ; N U ; B 102 -18 765 653 ;
+C 86 ; WX 611 ; N V ; B 76 -18 688 653 ;
+C 87 ; WX 833 ; N W ; B 71 -18 906 653 ;
+C 88 ; WX 611 ; N X ; B -29 0 655 653 ;
+C 89 ; WX 556 ; N Y ; B 78 0 633 653 ;
+C 90 ; WX 556 ; N Z ; B -6 0 606 653 ;
+C 91 ; WX 389 ; N bracketleft ; B 21 -153 391 663 ;
+C 92 ; WX 278 ; N backslash ; B -41 -18 319 666 ;
+C 93 ; WX 389 ; N bracketright ; B 12 -153 382 663 ;
+C 94 ; WX 422 ; N asciicircum ; B 0 301 422 666 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 171 436 310 666 ;
+C 97 ; WX 500 ; N a ; B 17 -11 476 441 ;
+C 98 ; WX 500 ; N b ; B 23 -11 473 683 ;
+C 99 ; WX 444 ; N c ; B 30 -11 425 441 ;
+C 100 ; WX 500 ; N d ; B 15 -13 527 683 ;
+C 101 ; WX 444 ; N e ; B 31 -11 412 441 ;
+C 102 ; WX 278 ; N f ; B -147 -207 424 678 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B 8 -206 472 441 ;
+C 104 ; WX 500 ; N h ; B 19 -9 478 683 ;
+C 105 ; WX 278 ; N i ; B 49 -11 264 654 ;
+C 106 ; WX 278 ; N j ; B -124 -207 276 654 ;
+C 107 ; WX 444 ; N k ; B 14 -11 461 683 ;
+C 108 ; WX 278 ; N l ; B 41 -11 279 683 ;
+C 109 ; WX 722 ; N m ; B 12 -9 704 441 ;
+C 110 ; WX 500 ; N n ; B 14 -9 474 441 ;
+C 111 ; WX 500 ; N o ; B 27 -11 468 441 ;
+C 112 ; WX 500 ; N p ; B -75 -205 469 441 ;
+C 113 ; WX 500 ; N q ; B 25 -209 483 441 ;
+C 114 ; WX 389 ; N r ; B 45 0 412 441 ;
+C 115 ; WX 389 ; N s ; B 16 -13 366 442 ;
+C 116 ; WX 278 ; N t ; B 37 -11 296 546 ;
+C 117 ; WX 500 ; N u ; B 42 -11 475 441 ;
+C 118 ; WX 444 ; N v ; B 21 -18 426 441 ;
+C 119 ; WX 667 ; N w ; B 16 -18 648 441 ;
+C 120 ; WX 444 ; N x ; B -27 -11 447 441 ;
+C 121 ; WX 444 ; N y ; B -24 -206 426 441 ;
+C 122 ; WX 389 ; N z ; B -2 -81 380 428 ;
+C 123 ; WX 400 ; N braceleft ; B 51 -177 407 687 ;
+C 124 ; WX 275 ; N bar ; B 105 -217 171 783 ;
+C 125 ; WX 400 ; N braceright ; B -7 -177 349 687 ;
+C 126 ; WX 541 ; N asciitilde ; B 40 183 502 323 ;
+C 161 ; WX 389 ; N exclamdown ; B 59 -205 322 473 ;
+C 162 ; WX 500 ; N cent ; B 77 -143 472 560 ;
+C 163 ; WX 500 ; N sterling ; B 10 -6 517 670 ;
+C 164 ; WX 167 ; N fraction ; B -169 -10 337 676 ;
+C 165 ; WX 500 ; N yen ; B 27 0 603 653 ;
+C 166 ; WX 500 ; N florin ; B 25 -182 507 682 ;
+C 167 ; WX 500 ; N section ; B 53 -162 461 666 ;
+C 168 ; WX 500 ; N currency ; B -22 53 522 597 ;
+C 169 ; WX 214 ; N quotesingle ; B 132 421 241 666 ;
+C 170 ; WX 556 ; N quotedblleft ; B 166 436 514 666 ;
+C 171 ; WX 500 ; N guillemotleft ; B 53 37 445 403 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 51 37 281 403 ;
+C 173 ; WX 333 ; N guilsinglright ; B 52 37 282 403 ;
+C 174 ; WX 500 ; N fi ; B -141 -207 481 681 ;
+C 175 ; WX 500 ; N fl ; B -141 -204 518 682 ;
+C 177 ; WX 500 ; N endash ; B -6 197 505 243 ;
+C 178 ; WX 500 ; N dagger ; B 101 -159 488 666 ;
+C 179 ; WX 500 ; N daggerdbl ; B 22 -143 491 666 ;
+C 180 ; WX 250 ; N periodcentered ; B 70 199 181 310 ;
+C 182 ; WX 523 ; N paragraph ; B 55 -123 616 653 ;
+C 183 ; WX 350 ; N bullet ; B 40 191 310 461 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 44 -129 183 101 ;
+C 185 ; WX 556 ; N quotedblbase ; B 57 -129 405 101 ;
+C 186 ; WX 556 ; N quotedblright ; B 151 436 499 666 ;
+C 187 ; WX 500 ; N guillemotright ; B 55 37 447 403 ;
+C 188 ; WX 889 ; N ellipsis ; B 57 -11 762 100 ;
+C 189 ; WX 1000 ; N perthousand ; B 25 -19 1010 706 ;
+C 191 ; WX 500 ; N questiondown ; B 28 -205 368 471 ;
+C 193 ; WX 333 ; N grave ; B 121 492 311 664 ;
+C 194 ; WX 333 ; N acute ; B 180 494 403 664 ;
+C 195 ; WX 333 ; N circumflex ; B 91 492 385 661 ;
+C 196 ; WX 333 ; N tilde ; B 100 517 427 624 ;
+C 197 ; WX 333 ; N macron ; B 99 532 411 583 ;
+C 198 ; WX 333 ; N breve ; B 117 492 418 650 ;
+C 199 ; WX 333 ; N dotaccent ; B 207 548 305 646 ;
+C 200 ; WX 333 ; N dieresis ; B 107 548 405 646 ;
+C 202 ; WX 333 ; N ring ; B 155 492 355 691 ;
+C 203 ; WX 333 ; N cedilla ; B -30 -217 182 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B 93 494 486 664 ;
+C 206 ; WX 333 ; N ogonek ; B 20 -169 203 40 ;
+C 207 ; WX 333 ; N caron ; B 121 492 426 661 ;
+C 208 ; WX 889 ; N emdash ; B -6 197 894 243 ;
+C 225 ; WX 889 ; N AE ; B -27 0 911 653 ;
+C 227 ; WX 276 ; N ordfeminine ; B 42 406 352 676 ;
+C 232 ; WX 556 ; N Lslash ; B -8 0 559 653 ;
+C 233 ; WX 722 ; N Oslash ; B 60 -105 699 722 ;
+C 234 ; WX 944 ; N OE ; B 49 -8 964 666 ;
+C 235 ; WX 310 ; N ordmasculine ; B 67 406 362 676 ;
+C 241 ; WX 667 ; N ae ; B 23 -11 640 441 ;
+C 245 ; WX 278 ; N dotlessi ; B 49 -11 235 441 ;
+C 248 ; WX 278 ; N lslash ; B 41 -11 312 683 ;
+C 249 ; WX 500 ; N oslash ; B 28 -135 469 554 ;
+C 250 ; WX 667 ; N oe ; B 20 -12 646 441 ;
+C 251 ; WX 500 ; N germandbls ; B -168 -207 493 679 ;
+C -1 ; WX 333 ; N Idieresis ; B -8 0 435 818 ;
+C -1 ; WX 444 ; N eacute ; B 31 -11 459 664 ;
+C -1 ; WX 500 ; N abreve ; B 17 -11 502 650 ;
+C -1 ; WX 500 ; N uhungarumlaut ; B 42 -11 580 664 ;
+C -1 ; WX 444 ; N ecaron ; B 31 -11 482 661 ;
+C -1 ; WX 556 ; N Ydieresis ; B 78 0 633 818 ;
+C -1 ; WX 675 ; N divide ; B 86 -11 590 517 ;
+C -1 ; WX 556 ; N Yacute ; B 78 0 633 876 ;
+C -1 ; WX 611 ; N Acircumflex ; B -51 0 564 873 ;
+C -1 ; WX 500 ; N aacute ; B 17 -11 487 664 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 102 -18 765 873 ;
+C -1 ; WX 444 ; N yacute ; B -24 -206 459 664 ;
+C -1 ; WX 389 ; N scommaaccent ; B 16 -217 366 442 ;
+C -1 ; WX 444 ; N ecircumflex ; B 31 -11 441 661 ;
+C -1 ; WX 722 ; N Uring ; B 102 -18 765 883 ;
+C -1 ; WX 722 ; N Udieresis ; B 102 -18 765 818 ;
+C -1 ; WX 500 ; N aogonek ; B 17 -169 476 441 ;
+C -1 ; WX 722 ; N Uacute ; B 102 -18 765 876 ;
+C -1 ; WX 500 ; N uogonek ; B 42 -169 477 441 ;
+C -1 ; WX 611 ; N Edieresis ; B -1 0 634 818 ;
+C -1 ; WX 722 ; N Dcroat ; B -8 0 700 653 ;
+C -1 ; WX 250 ; N commaaccent ; B 8 -217 133 -50 ;
+C -1 ; WX 760 ; N copyright ; B 41 -18 719 666 ;
+C -1 ; WX 611 ; N Emacron ; B -1 0 634 795 ;
+C -1 ; WX 444 ; N ccaron ; B 30 -11 482 661 ;
+C -1 ; WX 500 ; N aring ; B 17 -11 476 691 ;
+C -1 ; WX 667 ; N Ncommaaccent ; B -20 -187 727 653 ;
+C -1 ; WX 278 ; N lacute ; B 41 -11 395 876 ;
+C -1 ; WX 500 ; N agrave ; B 17 -11 476 664 ;
+C -1 ; WX 556 ; N Tcommaaccent ; B 59 -217 633 653 ;
+C -1 ; WX 667 ; N Cacute ; B 66 -18 690 876 ;
+C -1 ; WX 500 ; N atilde ; B 17 -11 511 624 ;
+C -1 ; WX 611 ; N Edotaccent ; B -1 0 634 818 ;
+C -1 ; WX 389 ; N scaron ; B 16 -13 454 661 ;
+C -1 ; WX 389 ; N scedilla ; B 16 -217 366 442 ;
+C -1 ; WX 278 ; N iacute ; B 49 -11 355 664 ;
+C -1 ; WX 471 ; N lozenge ; B 13 0 459 724 ;
+C -1 ; WX 611 ; N Rcaron ; B -13 0 588 873 ;
+C -1 ; WX 722 ; N Gcommaaccent ; B 52 -217 722 666 ;
+C -1 ; WX 500 ; N ucircumflex ; B 42 -11 475 661 ;
+C -1 ; WX 500 ; N acircumflex ; B 17 -11 476 661 ;
+C -1 ; WX 611 ; N Amacron ; B -51 0 564 795 ;
+C -1 ; WX 389 ; N rcaron ; B 45 0 434 661 ;
+C -1 ; WX 444 ; N ccedilla ; B 30 -217 425 441 ;
+C -1 ; WX 556 ; N Zdotaccent ; B -6 0 606 818 ;
+C -1 ; WX 611 ; N Thorn ; B 0 0 569 653 ;
+C -1 ; WX 722 ; N Omacron ; B 60 -18 699 795 ;
+C -1 ; WX 611 ; N Racute ; B -13 0 588 876 ;
+C -1 ; WX 500 ; N Sacute ; B 17 -18 508 876 ;
+C -1 ; WX 544 ; N dcaron ; B 15 -13 658 683 ;
+C -1 ; WX 722 ; N Umacron ; B 102 -18 765 795 ;
+C -1 ; WX 500 ; N uring ; B 42 -11 475 691 ;
+C -1 ; WX 300 ; N threesuperior ; B 43 268 339 676 ;
+C -1 ; WX 722 ; N Ograve ; B 60 -18 699 876 ;
+C -1 ; WX 611 ; N Agrave ; B -51 0 564 876 ;
+C -1 ; WX 611 ; N Abreve ; B -51 0 564 862 ;
+C -1 ; WX 675 ; N multiply ; B 93 8 582 497 ;
+C -1 ; WX 500 ; N uacute ; B 42 -11 477 664 ;
+C -1 ; WX 556 ; N Tcaron ; B 59 0 633 873 ;
+C -1 ; WX 476 ; N partialdiff ; B 17 -38 459 710 ;
+C -1 ; WX 444 ; N ydieresis ; B -24 -206 441 606 ;
+C -1 ; WX 667 ; N Nacute ; B -20 -15 727 876 ;
+C -1 ; WX 278 ; N icircumflex ; B 33 -11 327 661 ;
+C -1 ; WX 611 ; N Ecircumflex ; B -1 0 634 873 ;
+C -1 ; WX 500 ; N adieresis ; B 17 -11 489 606 ;
+C -1 ; WX 444 ; N edieresis ; B 31 -11 451 606 ;
+C -1 ; WX 444 ; N cacute ; B 30 -11 459 664 ;
+C -1 ; WX 500 ; N nacute ; B 14 -9 477 664 ;
+C -1 ; WX 500 ; N umacron ; B 42 -11 485 583 ;
+C -1 ; WX 667 ; N Ncaron ; B -20 -15 727 873 ;
+C -1 ; WX 333 ; N Iacute ; B -8 0 433 876 ;
+C -1 ; WX 675 ; N plusminus ; B 86 0 590 506 ;
+C -1 ; WX 275 ; N brokenbar ; B 105 -142 171 708 ;
+C -1 ; WX 760 ; N registered ; B 41 -18 719 666 ;
+C -1 ; WX 722 ; N Gbreve ; B 52 -18 722 862 ;
+C -1 ; WX 333 ; N Idotaccent ; B -8 0 384 818 ;
+C -1 ; WX 600 ; N summation ; B 15 -10 585 706 ;
+C -1 ; WX 611 ; N Egrave ; B -1 0 634 876 ;
+C -1 ; WX 389 ; N racute ; B 45 0 431 664 ;
+C -1 ; WX 500 ; N omacron ; B 27 -11 495 583 ;
+C -1 ; WX 556 ; N Zacute ; B -6 0 606 876 ;
+C -1 ; WX 556 ; N Zcaron ; B -6 0 606 873 ;
+C -1 ; WX 549 ; N greaterequal ; B 26 0 523 658 ;
+C -1 ; WX 722 ; N Eth ; B -8 0 700 653 ;
+C -1 ; WX 667 ; N Ccedilla ; B 66 -217 689 666 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 22 -217 279 683 ;
+C -1 ; WX 300 ; N tcaron ; B 37 -11 407 681 ;
+C -1 ; WX 444 ; N eogonek ; B 31 -169 412 441 ;
+C -1 ; WX 722 ; N Uogonek ; B 102 -184 765 653 ;
+C -1 ; WX 611 ; N Aacute ; B -51 0 564 876 ;
+C -1 ; WX 611 ; N Adieresis ; B -51 0 564 818 ;
+C -1 ; WX 444 ; N egrave ; B 31 -11 412 664 ;
+C -1 ; WX 389 ; N zacute ; B -2 -81 431 664 ;
+C -1 ; WX 278 ; N iogonek ; B 49 -169 264 654 ;
+C -1 ; WX 722 ; N Oacute ; B 60 -18 699 876 ;
+C -1 ; WX 500 ; N oacute ; B 27 -11 487 664 ;
+C -1 ; WX 500 ; N amacron ; B 17 -11 495 583 ;
+C -1 ; WX 389 ; N sacute ; B 16 -13 431 664 ;
+C -1 ; WX 278 ; N idieresis ; B 49 -11 352 606 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 60 -18 699 873 ;
+C -1 ; WX 722 ; N Ugrave ; B 102 -18 765 876 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 500 ; N thorn ; B -75 -205 469 683 ;
+C -1 ; WX 300 ; N twosuperior ; B 33 271 324 676 ;
+C -1 ; WX 722 ; N Odieresis ; B 60 -18 699 818 ;
+C -1 ; WX 500 ; N mu ; B -30 -209 497 428 ;
+C -1 ; WX 278 ; N igrave ; B 49 -11 284 664 ;
+C -1 ; WX 500 ; N ohungarumlaut ; B 27 -11 590 664 ;
+C -1 ; WX 611 ; N Eogonek ; B -1 -169 634 653 ;
+C -1 ; WX 500 ; N dcroat ; B 15 -13 572 683 ;
+C -1 ; WX 750 ; N threequarters ; B 23 -10 736 676 ;
+C -1 ; WX 500 ; N Scedilla ; B 17 -217 508 667 ;
+C -1 ; WX 300 ; N lcaron ; B 41 -11 407 683 ;
+C -1 ; WX 667 ; N Kcommaaccent ; B 7 -217 722 653 ;
+C -1 ; WX 556 ; N Lacute ; B -8 0 559 876 ;
+C -1 ; WX 980 ; N trademark ; B 30 247 957 653 ;
+C -1 ; WX 444 ; N edotaccent ; B 31 -11 412 606 ;
+C -1 ; WX 333 ; N Igrave ; B -8 0 384 876 ;
+C -1 ; WX 333 ; N Imacron ; B -8 0 441 795 ;
+C -1 ; WX 611 ; N Lcaron ; B -8 0 586 653 ;
+C -1 ; WX 750 ; N onehalf ; B 34 -10 749 676 ;
+C -1 ; WX 549 ; N lessequal ; B 26 0 523 658 ;
+C -1 ; WX 500 ; N ocircumflex ; B 27 -11 468 661 ;
+C -1 ; WX 500 ; N ntilde ; B 14 -9 476 624 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 102 -18 765 876 ;
+C -1 ; WX 611 ; N Eacute ; B -1 0 634 876 ;
+C -1 ; WX 444 ; N emacron ; B 31 -11 457 583 ;
+C -1 ; WX 500 ; N gbreve ; B 8 -206 487 650 ;
+C -1 ; WX 750 ; N onequarter ; B 33 -10 736 676 ;
+C -1 ; WX 500 ; N Scaron ; B 17 -18 520 873 ;
+C -1 ; WX 500 ; N Scommaaccent ; B 17 -217 508 667 ;
+C -1 ; WX 722 ; N Ohungarumlaut ; B 60 -18 699 876 ;
+C -1 ; WX 400 ; N degree ; B 101 390 387 676 ;
+C -1 ; WX 500 ; N ograve ; B 27 -11 468 664 ;
+C -1 ; WX 667 ; N Ccaron ; B 66 -18 689 873 ;
+C -1 ; WX 500 ; N ugrave ; B 42 -11 475 664 ;
+C -1 ; WX 453 ; N radical ; B 2 -60 452 768 ;
+C -1 ; WX 722 ; N Dcaron ; B -8 0 700 873 ;
+C -1 ; WX 389 ; N rcommaaccent ; B -3 -217 412 441 ;
+C -1 ; WX 667 ; N Ntilde ; B -20 -15 727 836 ;
+C -1 ; WX 500 ; N otilde ; B 27 -11 496 624 ;
+C -1 ; WX 611 ; N Rcommaaccent ; B -13 -187 588 653 ;
+C -1 ; WX 556 ; N Lcommaaccent ; B -8 -217 559 653 ;
+C -1 ; WX 611 ; N Atilde ; B -51 0 566 836 ;
+C -1 ; WX 611 ; N Aogonek ; B -51 -169 566 668 ;
+C -1 ; WX 611 ; N Aring ; B -51 0 564 883 ;
+C -1 ; WX 722 ; N Otilde ; B 60 -18 699 836 ;
+C -1 ; WX 389 ; N zdotaccent ; B -2 -81 380 606 ;
+C -1 ; WX 611 ; N Ecaron ; B -1 0 634 873 ;
+C -1 ; WX 333 ; N Iogonek ; B -8 -169 384 653 ;
+C -1 ; WX 444 ; N kcommaaccent ; B 14 -187 461 683 ;
+C -1 ; WX 675 ; N minus ; B 86 220 590 286 ;
+C -1 ; WX 333 ; N Icircumflex ; B -8 0 425 873 ;
+C -1 ; WX 500 ; N ncaron ; B 14 -9 510 661 ;
+C -1 ; WX 278 ; N tcommaaccent ; B 2 -217 296 546 ;
+C -1 ; WX 675 ; N logicalnot ; B 86 108 590 386 ;
+C -1 ; WX 500 ; N odieresis ; B 27 -11 489 606 ;
+C -1 ; WX 500 ; N udieresis ; B 42 -11 479 606 ;
+C -1 ; WX 549 ; N notequal ; B 12 -29 537 541 ;
+C -1 ; WX 500 ; N gcommaaccent ; B 8 -206 472 706 ;
+C -1 ; WX 500 ; N eth ; B 27 -11 482 683 ;
+C -1 ; WX 389 ; N zcaron ; B -2 -81 434 661 ;
+C -1 ; WX 500 ; N ncommaaccent ; B 14 -187 474 441 ;
+C -1 ; WX 300 ; N onesuperior ; B 43 271 284 676 ;
+C -1 ; WX 278 ; N imacron ; B 46 -11 311 583 ;
+C -1 ; WX 500 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 2321
+KPX A C -30
+KPX A Cacute -30
+KPX A Ccaron -30
+KPX A Ccedilla -30
+KPX A G -35
+KPX A Gbreve -35
+KPX A Gcommaaccent -35
+KPX A O -40
+KPX A Oacute -40
+KPX A Ocircumflex -40
+KPX A Odieresis -40
+KPX A Ograve -40
+KPX A Ohungarumlaut -40
+KPX A Omacron -40
+KPX A Oslash -40
+KPX A Otilde -40
+KPX A Q -40
+KPX A T -37
+KPX A Tcaron -37
+KPX A Tcommaaccent -37
+KPX A U -50
+KPX A Uacute -50
+KPX A Ucircumflex -50
+KPX A Udieresis -50
+KPX A Ugrave -50
+KPX A Uhungarumlaut -50
+KPX A Umacron -50
+KPX A Uogonek -50
+KPX A Uring -50
+KPX A V -105
+KPX A W -95
+KPX A Y -55
+KPX A Yacute -55
+KPX A Ydieresis -55
+KPX A quoteright -37
+KPX A u -20
+KPX A uacute -20
+KPX A ucircumflex -20
+KPX A udieresis -20
+KPX A ugrave -20
+KPX A uhungarumlaut -20
+KPX A umacron -20
+KPX A uogonek -20
+KPX A uring -20
+KPX A v -55
+KPX A w -55
+KPX A y -55
+KPX A yacute -55
+KPX A ydieresis -55
+KPX Aacute C -30
+KPX Aacute Cacute -30
+KPX Aacute Ccaron -30
+KPX Aacute Ccedilla -30
+KPX Aacute G -35
+KPX Aacute Gbreve -35
+KPX Aacute Gcommaaccent -35
+KPX Aacute O -40
+KPX Aacute Oacute -40
+KPX Aacute Ocircumflex -40
+KPX Aacute Odieresis -40
+KPX Aacute Ograve -40
+KPX Aacute Ohungarumlaut -40
+KPX Aacute Omacron -40
+KPX Aacute Oslash -40
+KPX Aacute Otilde -40
+KPX Aacute Q -40
+KPX Aacute T -37
+KPX Aacute Tcaron -37
+KPX Aacute Tcommaaccent -37
+KPX Aacute U -50
+KPX Aacute Uacute -50
+KPX Aacute Ucircumflex -50
+KPX Aacute Udieresis -50
+KPX Aacute Ugrave -50
+KPX Aacute Uhungarumlaut -50
+KPX Aacute Umacron -50
+KPX Aacute Uogonek -50
+KPX Aacute Uring -50
+KPX Aacute V -105
+KPX Aacute W -95
+KPX Aacute Y -55
+KPX Aacute Yacute -55
+KPX Aacute Ydieresis -55
+KPX Aacute quoteright -37
+KPX Aacute u -20
+KPX Aacute uacute -20
+KPX Aacute ucircumflex -20
+KPX Aacute udieresis -20
+KPX Aacute ugrave -20
+KPX Aacute uhungarumlaut -20
+KPX Aacute umacron -20
+KPX Aacute uogonek -20
+KPX Aacute uring -20
+KPX Aacute v -55
+KPX Aacute w -55
+KPX Aacute y -55
+KPX Aacute yacute -55
+KPX Aacute ydieresis -55
+KPX Abreve C -30
+KPX Abreve Cacute -30
+KPX Abreve Ccaron -30
+KPX Abreve Ccedilla -30
+KPX Abreve G -35
+KPX Abreve Gbreve -35
+KPX Abreve Gcommaaccent -35
+KPX Abreve O -40
+KPX Abreve Oacute -40
+KPX Abreve Ocircumflex -40
+KPX Abreve Odieresis -40
+KPX Abreve Ograve -40
+KPX Abreve Ohungarumlaut -40
+KPX Abreve Omacron -40
+KPX Abreve Oslash -40
+KPX Abreve Otilde -40
+KPX Abreve Q -40
+KPX Abreve T -37
+KPX Abreve Tcaron -37
+KPX Abreve Tcommaaccent -37
+KPX Abreve U -50
+KPX Abreve Uacute -50
+KPX Abreve Ucircumflex -50
+KPX Abreve Udieresis -50
+KPX Abreve Ugrave -50
+KPX Abreve Uhungarumlaut -50
+KPX Abreve Umacron -50
+KPX Abreve Uogonek -50
+KPX Abreve Uring -50
+KPX Abreve V -105
+KPX Abreve W -95
+KPX Abreve Y -55
+KPX Abreve Yacute -55
+KPX Abreve Ydieresis -55
+KPX Abreve quoteright -37
+KPX Abreve u -20
+KPX Abreve uacute -20
+KPX Abreve ucircumflex -20
+KPX Abreve udieresis -20
+KPX Abreve ugrave -20
+KPX Abreve uhungarumlaut -20
+KPX Abreve umacron -20
+KPX Abreve uogonek -20
+KPX Abreve uring -20
+KPX Abreve v -55
+KPX Abreve w -55
+KPX Abreve y -55
+KPX Abreve yacute -55
+KPX Abreve ydieresis -55
+KPX Acircumflex C -30
+KPX Acircumflex Cacute -30
+KPX Acircumflex Ccaron -30
+KPX Acircumflex Ccedilla -30
+KPX Acircumflex G -35
+KPX Acircumflex Gbreve -35
+KPX Acircumflex Gcommaaccent -35
+KPX Acircumflex O -40
+KPX Acircumflex Oacute -40
+KPX Acircumflex Ocircumflex -40
+KPX Acircumflex Odieresis -40
+KPX Acircumflex Ograve -40
+KPX Acircumflex Ohungarumlaut -40
+KPX Acircumflex Omacron -40
+KPX Acircumflex Oslash -40
+KPX Acircumflex Otilde -40
+KPX Acircumflex Q -40
+KPX Acircumflex T -37
+KPX Acircumflex Tcaron -37
+KPX Acircumflex Tcommaaccent -37
+KPX Acircumflex U -50
+KPX Acircumflex Uacute -50
+KPX Acircumflex Ucircumflex -50
+KPX Acircumflex Udieresis -50
+KPX Acircumflex Ugrave -50
+KPX Acircumflex Uhungarumlaut -50
+KPX Acircumflex Umacron -50
+KPX Acircumflex Uogonek -50
+KPX Acircumflex Uring -50
+KPX Acircumflex V -105
+KPX Acircumflex W -95
+KPX Acircumflex Y -55
+KPX Acircumflex Yacute -55
+KPX Acircumflex Ydieresis -55
+KPX Acircumflex quoteright -37
+KPX Acircumflex u -20
+KPX Acircumflex uacute -20
+KPX Acircumflex ucircumflex -20
+KPX Acircumflex udieresis -20
+KPX Acircumflex ugrave -20
+KPX Acircumflex uhungarumlaut -20
+KPX Acircumflex umacron -20
+KPX Acircumflex uogonek -20
+KPX Acircumflex uring -20
+KPX Acircumflex v -55
+KPX Acircumflex w -55
+KPX Acircumflex y -55
+KPX Acircumflex yacute -55
+KPX Acircumflex ydieresis -55
+KPX Adieresis C -30
+KPX Adieresis Cacute -30
+KPX Adieresis Ccaron -30
+KPX Adieresis Ccedilla -30
+KPX Adieresis G -35
+KPX Adieresis Gbreve -35
+KPX Adieresis Gcommaaccent -35
+KPX Adieresis O -40
+KPX Adieresis Oacute -40
+KPX Adieresis Ocircumflex -40
+KPX Adieresis Odieresis -40
+KPX Adieresis Ograve -40
+KPX Adieresis Ohungarumlaut -40
+KPX Adieresis Omacron -40
+KPX Adieresis Oslash -40
+KPX Adieresis Otilde -40
+KPX Adieresis Q -40
+KPX Adieresis T -37
+KPX Adieresis Tcaron -37
+KPX Adieresis Tcommaaccent -37
+KPX Adieresis U -50
+KPX Adieresis Uacute -50
+KPX Adieresis Ucircumflex -50
+KPX Adieresis Udieresis -50
+KPX Adieresis Ugrave -50
+KPX Adieresis Uhungarumlaut -50
+KPX Adieresis Umacron -50
+KPX Adieresis Uogonek -50
+KPX Adieresis Uring -50
+KPX Adieresis V -105
+KPX Adieresis W -95
+KPX Adieresis Y -55
+KPX Adieresis Yacute -55
+KPX Adieresis Ydieresis -55
+KPX Adieresis quoteright -37
+KPX Adieresis u -20
+KPX Adieresis uacute -20
+KPX Adieresis ucircumflex -20
+KPX Adieresis udieresis -20
+KPX Adieresis ugrave -20
+KPX Adieresis uhungarumlaut -20
+KPX Adieresis umacron -20
+KPX Adieresis uogonek -20
+KPX Adieresis uring -20
+KPX Adieresis v -55
+KPX Adieresis w -55
+KPX Adieresis y -55
+KPX Adieresis yacute -55
+KPX Adieresis ydieresis -55
+KPX Agrave C -30
+KPX Agrave Cacute -30
+KPX Agrave Ccaron -30
+KPX Agrave Ccedilla -30
+KPX Agrave G -35
+KPX Agrave Gbreve -35
+KPX Agrave Gcommaaccent -35
+KPX Agrave O -40
+KPX Agrave Oacute -40
+KPX Agrave Ocircumflex -40
+KPX Agrave Odieresis -40
+KPX Agrave Ograve -40
+KPX Agrave Ohungarumlaut -40
+KPX Agrave Omacron -40
+KPX Agrave Oslash -40
+KPX Agrave Otilde -40
+KPX Agrave Q -40
+KPX Agrave T -37
+KPX Agrave Tcaron -37
+KPX Agrave Tcommaaccent -37
+KPX Agrave U -50
+KPX Agrave Uacute -50
+KPX Agrave Ucircumflex -50
+KPX Agrave Udieresis -50
+KPX Agrave Ugrave -50
+KPX Agrave Uhungarumlaut -50
+KPX Agrave Umacron -50
+KPX Agrave Uogonek -50
+KPX Agrave Uring -50
+KPX Agrave V -105
+KPX Agrave W -95
+KPX Agrave Y -55
+KPX Agrave Yacute -55
+KPX Agrave Ydieresis -55
+KPX Agrave quoteright -37
+KPX Agrave u -20
+KPX Agrave uacute -20
+KPX Agrave ucircumflex -20
+KPX Agrave udieresis -20
+KPX Agrave ugrave -20
+KPX Agrave uhungarumlaut -20
+KPX Agrave umacron -20
+KPX Agrave uogonek -20
+KPX Agrave uring -20
+KPX Agrave v -55
+KPX Agrave w -55
+KPX Agrave y -55
+KPX Agrave yacute -55
+KPX Agrave ydieresis -55
+KPX Amacron C -30
+KPX Amacron Cacute -30
+KPX Amacron Ccaron -30
+KPX Amacron Ccedilla -30
+KPX Amacron G -35
+KPX Amacron Gbreve -35
+KPX Amacron Gcommaaccent -35
+KPX Amacron O -40
+KPX Amacron Oacute -40
+KPX Amacron Ocircumflex -40
+KPX Amacron Odieresis -40
+KPX Amacron Ograve -40
+KPX Amacron Ohungarumlaut -40
+KPX Amacron Omacron -40
+KPX Amacron Oslash -40
+KPX Amacron Otilde -40
+KPX Amacron Q -40
+KPX Amacron T -37
+KPX Amacron Tcaron -37
+KPX Amacron Tcommaaccent -37
+KPX Amacron U -50
+KPX Amacron Uacute -50
+KPX Amacron Ucircumflex -50
+KPX Amacron Udieresis -50
+KPX Amacron Ugrave -50
+KPX Amacron Uhungarumlaut -50
+KPX Amacron Umacron -50
+KPX Amacron Uogonek -50
+KPX Amacron Uring -50
+KPX Amacron V -105
+KPX Amacron W -95
+KPX Amacron Y -55
+KPX Amacron Yacute -55
+KPX Amacron Ydieresis -55
+KPX Amacron quoteright -37
+KPX Amacron u -20
+KPX Amacron uacute -20
+KPX Amacron ucircumflex -20
+KPX Amacron udieresis -20
+KPX Amacron ugrave -20
+KPX Amacron uhungarumlaut -20
+KPX Amacron umacron -20
+KPX Amacron uogonek -20
+KPX Amacron uring -20
+KPX Amacron v -55
+KPX Amacron w -55
+KPX Amacron y -55
+KPX Amacron yacute -55
+KPX Amacron ydieresis -55
+KPX Aogonek C -30
+KPX Aogonek Cacute -30
+KPX Aogonek Ccaron -30
+KPX Aogonek Ccedilla -30
+KPX Aogonek G -35
+KPX Aogonek Gbreve -35
+KPX Aogonek Gcommaaccent -35
+KPX Aogonek O -40
+KPX Aogonek Oacute -40
+KPX Aogonek Ocircumflex -40
+KPX Aogonek Odieresis -40
+KPX Aogonek Ograve -40
+KPX Aogonek Ohungarumlaut -40
+KPX Aogonek Omacron -40
+KPX Aogonek Oslash -40
+KPX Aogonek Otilde -40
+KPX Aogonek Q -40
+KPX Aogonek T -37
+KPX Aogonek Tcaron -37
+KPX Aogonek Tcommaaccent -37
+KPX Aogonek U -50
+KPX Aogonek Uacute -50
+KPX Aogonek Ucircumflex -50
+KPX Aogonek Udieresis -50
+KPX Aogonek Ugrave -50
+KPX Aogonek Uhungarumlaut -50
+KPX Aogonek Umacron -50
+KPX Aogonek Uogonek -50
+KPX Aogonek Uring -50
+KPX Aogonek V -105
+KPX Aogonek W -95
+KPX Aogonek Y -55
+KPX Aogonek Yacute -55
+KPX Aogonek Ydieresis -55
+KPX Aogonek quoteright -37
+KPX Aogonek u -20
+KPX Aogonek uacute -20
+KPX Aogonek ucircumflex -20
+KPX Aogonek udieresis -20
+KPX Aogonek ugrave -20
+KPX Aogonek uhungarumlaut -20
+KPX Aogonek umacron -20
+KPX Aogonek uogonek -20
+KPX Aogonek uring -20
+KPX Aogonek v -55
+KPX Aogonek w -55
+KPX Aogonek y -55
+KPX Aogonek yacute -55
+KPX Aogonek ydieresis -55
+KPX Aring C -30
+KPX Aring Cacute -30
+KPX Aring Ccaron -30
+KPX Aring Ccedilla -30
+KPX Aring G -35
+KPX Aring Gbreve -35
+KPX Aring Gcommaaccent -35
+KPX Aring O -40
+KPX Aring Oacute -40
+KPX Aring Ocircumflex -40
+KPX Aring Odieresis -40
+KPX Aring Ograve -40
+KPX Aring Ohungarumlaut -40
+KPX Aring Omacron -40
+KPX Aring Oslash -40
+KPX Aring Otilde -40
+KPX Aring Q -40
+KPX Aring T -37
+KPX Aring Tcaron -37
+KPX Aring Tcommaaccent -37
+KPX Aring U -50
+KPX Aring Uacute -50
+KPX Aring Ucircumflex -50
+KPX Aring Udieresis -50
+KPX Aring Ugrave -50
+KPX Aring Uhungarumlaut -50
+KPX Aring Umacron -50
+KPX Aring Uogonek -50
+KPX Aring Uring -50
+KPX Aring V -105
+KPX Aring W -95
+KPX Aring Y -55
+KPX Aring Yacute -55
+KPX Aring Ydieresis -55
+KPX Aring quoteright -37
+KPX Aring u -20
+KPX Aring uacute -20
+KPX Aring ucircumflex -20
+KPX Aring udieresis -20
+KPX Aring ugrave -20
+KPX Aring uhungarumlaut -20
+KPX Aring umacron -20
+KPX Aring uogonek -20
+KPX Aring uring -20
+KPX Aring v -55
+KPX Aring w -55
+KPX Aring y -55
+KPX Aring yacute -55
+KPX Aring ydieresis -55
+KPX Atilde C -30
+KPX Atilde Cacute -30
+KPX Atilde Ccaron -30
+KPX Atilde Ccedilla -30
+KPX Atilde G -35
+KPX Atilde Gbreve -35
+KPX Atilde Gcommaaccent -35
+KPX Atilde O -40
+KPX Atilde Oacute -40
+KPX Atilde Ocircumflex -40
+KPX Atilde Odieresis -40
+KPX Atilde Ograve -40
+KPX Atilde Ohungarumlaut -40
+KPX Atilde Omacron -40
+KPX Atilde Oslash -40
+KPX Atilde Otilde -40
+KPX Atilde Q -40
+KPX Atilde T -37
+KPX Atilde Tcaron -37
+KPX Atilde Tcommaaccent -37
+KPX Atilde U -50
+KPX Atilde Uacute -50
+KPX Atilde Ucircumflex -50
+KPX Atilde Udieresis -50
+KPX Atilde Ugrave -50
+KPX Atilde Uhungarumlaut -50
+KPX Atilde Umacron -50
+KPX Atilde Uogonek -50
+KPX Atilde Uring -50
+KPX Atilde V -105
+KPX Atilde W -95
+KPX Atilde Y -55
+KPX Atilde Yacute -55
+KPX Atilde Ydieresis -55
+KPX Atilde quoteright -37
+KPX Atilde u -20
+KPX Atilde uacute -20
+KPX Atilde ucircumflex -20
+KPX Atilde udieresis -20
+KPX Atilde ugrave -20
+KPX Atilde uhungarumlaut -20
+KPX Atilde umacron -20
+KPX Atilde uogonek -20
+KPX Atilde uring -20
+KPX Atilde v -55
+KPX Atilde w -55
+KPX Atilde y -55
+KPX Atilde yacute -55
+KPX Atilde ydieresis -55
+KPX B A -25
+KPX B Aacute -25
+KPX B Abreve -25
+KPX B Acircumflex -25
+KPX B Adieresis -25
+KPX B Agrave -25
+KPX B Amacron -25
+KPX B Aogonek -25
+KPX B Aring -25
+KPX B Atilde -25
+KPX B U -10
+KPX B Uacute -10
+KPX B Ucircumflex -10
+KPX B Udieresis -10
+KPX B Ugrave -10
+KPX B Uhungarumlaut -10
+KPX B Umacron -10
+KPX B Uogonek -10
+KPX B Uring -10
+KPX D A -35
+KPX D Aacute -35
+KPX D Abreve -35
+KPX D Acircumflex -35
+KPX D Adieresis -35
+KPX D Agrave -35
+KPX D Amacron -35
+KPX D Aogonek -35
+KPX D Aring -35
+KPX D Atilde -35
+KPX D V -40
+KPX D W -40
+KPX D Y -40
+KPX D Yacute -40
+KPX D Ydieresis -40
+KPX Dcaron A -35
+KPX Dcaron Aacute -35
+KPX Dcaron Abreve -35
+KPX Dcaron Acircumflex -35
+KPX Dcaron Adieresis -35
+KPX Dcaron Agrave -35
+KPX Dcaron Amacron -35
+KPX Dcaron Aogonek -35
+KPX Dcaron Aring -35
+KPX Dcaron Atilde -35
+KPX Dcaron V -40
+KPX Dcaron W -40
+KPX Dcaron Y -40
+KPX Dcaron Yacute -40
+KPX Dcaron Ydieresis -40
+KPX Dcroat A -35
+KPX Dcroat Aacute -35
+KPX Dcroat Abreve -35
+KPX Dcroat Acircumflex -35
+KPX Dcroat Adieresis -35
+KPX Dcroat Agrave -35
+KPX Dcroat Amacron -35
+KPX Dcroat Aogonek -35
+KPX Dcroat Aring -35
+KPX Dcroat Atilde -35
+KPX Dcroat V -40
+KPX Dcroat W -40
+KPX Dcroat Y -40
+KPX Dcroat Yacute -40
+KPX Dcroat Ydieresis -40
+KPX F A -115
+KPX F Aacute -115
+KPX F Abreve -115
+KPX F Acircumflex -115
+KPX F Adieresis -115
+KPX F Agrave -115
+KPX F Amacron -115
+KPX F Aogonek -115
+KPX F Aring -115
+KPX F Atilde -115
+KPX F a -75
+KPX F aacute -75
+KPX F abreve -75
+KPX F acircumflex -75
+KPX F adieresis -75
+KPX F agrave -75
+KPX F amacron -75
+KPX F aogonek -75
+KPX F aring -75
+KPX F atilde -75
+KPX F comma -135
+KPX F e -75
+KPX F eacute -75
+KPX F ecaron -75
+KPX F ecircumflex -75
+KPX F edieresis -75
+KPX F edotaccent -75
+KPX F egrave -75
+KPX F emacron -75
+KPX F eogonek -75
+KPX F i -45
+KPX F iacute -45
+KPX F icircumflex -45
+KPX F idieresis -45
+KPX F igrave -45
+KPX F imacron -45
+KPX F iogonek -45
+KPX F o -105
+KPX F oacute -105
+KPX F ocircumflex -105
+KPX F odieresis -105
+KPX F ograve -105
+KPX F ohungarumlaut -105
+KPX F omacron -105
+KPX F oslash -105
+KPX F otilde -105
+KPX F period -135
+KPX F r -55
+KPX F racute -55
+KPX F rcaron -55
+KPX F rcommaaccent -55
+KPX J A -40
+KPX J Aacute -40
+KPX J Abreve -40
+KPX J Acircumflex -40
+KPX J Adieresis -40
+KPX J Agrave -40
+KPX J Amacron -40
+KPX J Aogonek -40
+KPX J Aring -40
+KPX J Atilde -40
+KPX J a -35
+KPX J aacute -35
+KPX J abreve -35
+KPX J acircumflex -35
+KPX J adieresis -35
+KPX J agrave -35
+KPX J amacron -35
+KPX J aogonek -35
+KPX J aring -35
+KPX J atilde -35
+KPX J comma -25
+KPX J e -25
+KPX J eacute -25
+KPX J ecaron -25
+KPX J ecircumflex -25
+KPX J edieresis -25
+KPX J edotaccent -25
+KPX J egrave -25
+KPX J emacron -25
+KPX J eogonek -25
+KPX J o -25
+KPX J oacute -25
+KPX J ocircumflex -25
+KPX J odieresis -25
+KPX J ograve -25
+KPX J ohungarumlaut -25
+KPX J omacron -25
+KPX J oslash -25
+KPX J otilde -25
+KPX J period -25
+KPX J u -35
+KPX J uacute -35
+KPX J ucircumflex -35
+KPX J udieresis -35
+KPX J ugrave -35
+KPX J uhungarumlaut -35
+KPX J umacron -35
+KPX J uogonek -35
+KPX J uring -35
+KPX K O -50
+KPX K Oacute -50
+KPX K Ocircumflex -50
+KPX K Odieresis -50
+KPX K Ograve -50
+KPX K Ohungarumlaut -50
+KPX K Omacron -50
+KPX K Oslash -50
+KPX K Otilde -50
+KPX K e -35
+KPX K eacute -35
+KPX K ecaron -35
+KPX K ecircumflex -35
+KPX K edieresis -35
+KPX K edotaccent -35
+KPX K egrave -35
+KPX K emacron -35
+KPX K eogonek -35
+KPX K o -40
+KPX K oacute -40
+KPX K ocircumflex -40
+KPX K odieresis -40
+KPX K ograve -40
+KPX K ohungarumlaut -40
+KPX K omacron -40
+KPX K oslash -40
+KPX K otilde -40
+KPX K u -40
+KPX K uacute -40
+KPX K ucircumflex -40
+KPX K udieresis -40
+KPX K ugrave -40
+KPX K uhungarumlaut -40
+KPX K umacron -40
+KPX K uogonek -40
+KPX K uring -40
+KPX K y -40
+KPX K yacute -40
+KPX K ydieresis -40
+KPX Kcommaaccent O -50
+KPX Kcommaaccent Oacute -50
+KPX Kcommaaccent Ocircumflex -50
+KPX Kcommaaccent Odieresis -50
+KPX Kcommaaccent Ograve -50
+KPX Kcommaaccent Ohungarumlaut -50
+KPX Kcommaaccent Omacron -50
+KPX Kcommaaccent Oslash -50
+KPX Kcommaaccent Otilde -50
+KPX Kcommaaccent e -35
+KPX Kcommaaccent eacute -35
+KPX Kcommaaccent ecaron -35
+KPX Kcommaaccent ecircumflex -35
+KPX Kcommaaccent edieresis -35
+KPX Kcommaaccent edotaccent -35
+KPX Kcommaaccent egrave -35
+KPX Kcommaaccent emacron -35
+KPX Kcommaaccent eogonek -35
+KPX Kcommaaccent o -40
+KPX Kcommaaccent oacute -40
+KPX Kcommaaccent ocircumflex -40
+KPX Kcommaaccent odieresis -40
+KPX Kcommaaccent ograve -40
+KPX Kcommaaccent ohungarumlaut -40
+KPX Kcommaaccent omacron -40
+KPX Kcommaaccent oslash -40
+KPX Kcommaaccent otilde -40
+KPX Kcommaaccent u -40
+KPX Kcommaaccent uacute -40
+KPX Kcommaaccent ucircumflex -40
+KPX Kcommaaccent udieresis -40
+KPX Kcommaaccent ugrave -40
+KPX Kcommaaccent uhungarumlaut -40
+KPX Kcommaaccent umacron -40
+KPX Kcommaaccent uogonek -40
+KPX Kcommaaccent uring -40
+KPX Kcommaaccent y -40
+KPX Kcommaaccent yacute -40
+KPX Kcommaaccent ydieresis -40
+KPX L T -20
+KPX L Tcaron -20
+KPX L Tcommaaccent -20
+KPX L V -55
+KPX L W -55
+KPX L Y -20
+KPX L Yacute -20
+KPX L Ydieresis -20
+KPX L quoteright -37
+KPX L y -30
+KPX L yacute -30
+KPX L ydieresis -30
+KPX Lacute T -20
+KPX Lacute Tcaron -20
+KPX Lacute Tcommaaccent -20
+KPX Lacute V -55
+KPX Lacute W -55
+KPX Lacute Y -20
+KPX Lacute Yacute -20
+KPX Lacute Ydieresis -20
+KPX Lacute quoteright -37
+KPX Lacute y -30
+KPX Lacute yacute -30
+KPX Lacute ydieresis -30
+KPX Lcommaaccent T -20
+KPX Lcommaaccent Tcaron -20
+KPX Lcommaaccent Tcommaaccent -20
+KPX Lcommaaccent V -55
+KPX Lcommaaccent W -55
+KPX Lcommaaccent Y -20
+KPX Lcommaaccent Yacute -20
+KPX Lcommaaccent Ydieresis -20
+KPX Lcommaaccent quoteright -37
+KPX Lcommaaccent y -30
+KPX Lcommaaccent yacute -30
+KPX Lcommaaccent ydieresis -30
+KPX Lslash T -20
+KPX Lslash Tcaron -20
+KPX Lslash Tcommaaccent -20
+KPX Lslash V -55
+KPX Lslash W -55
+KPX Lslash Y -20
+KPX Lslash Yacute -20
+KPX Lslash Ydieresis -20
+KPX Lslash quoteright -37
+KPX Lslash y -30
+KPX Lslash yacute -30
+KPX Lslash ydieresis -30
+KPX N A -27
+KPX N Aacute -27
+KPX N Abreve -27
+KPX N Acircumflex -27
+KPX N Adieresis -27
+KPX N Agrave -27
+KPX N Amacron -27
+KPX N Aogonek -27
+KPX N Aring -27
+KPX N Atilde -27
+KPX Nacute A -27
+KPX Nacute Aacute -27
+KPX Nacute Abreve -27
+KPX Nacute Acircumflex -27
+KPX Nacute Adieresis -27
+KPX Nacute Agrave -27
+KPX Nacute Amacron -27
+KPX Nacute Aogonek -27
+KPX Nacute Aring -27
+KPX Nacute Atilde -27
+KPX Ncaron A -27
+KPX Ncaron Aacute -27
+KPX Ncaron Abreve -27
+KPX Ncaron Acircumflex -27
+KPX Ncaron Adieresis -27
+KPX Ncaron Agrave -27
+KPX Ncaron Amacron -27
+KPX Ncaron Aogonek -27
+KPX Ncaron Aring -27
+KPX Ncaron Atilde -27
+KPX Ncommaaccent A -27
+KPX Ncommaaccent Aacute -27
+KPX Ncommaaccent Abreve -27
+KPX Ncommaaccent Acircumflex -27
+KPX Ncommaaccent Adieresis -27
+KPX Ncommaaccent Agrave -27
+KPX Ncommaaccent Amacron -27
+KPX Ncommaaccent Aogonek -27
+KPX Ncommaaccent Aring -27
+KPX Ncommaaccent Atilde -27
+KPX Ntilde A -27
+KPX Ntilde Aacute -27
+KPX Ntilde Abreve -27
+KPX Ntilde Acircumflex -27
+KPX Ntilde Adieresis -27
+KPX Ntilde Agrave -27
+KPX Ntilde Amacron -27
+KPX Ntilde Aogonek -27
+KPX Ntilde Aring -27
+KPX Ntilde Atilde -27
+KPX O A -55
+KPX O Aacute -55
+KPX O Abreve -55
+KPX O Acircumflex -55
+KPX O Adieresis -55
+KPX O Agrave -55
+KPX O Amacron -55
+KPX O Aogonek -55
+KPX O Aring -55
+KPX O Atilde -55
+KPX O T -40
+KPX O Tcaron -40
+KPX O Tcommaaccent -40
+KPX O V -50
+KPX O W -50
+KPX O X -40
+KPX O Y -50
+KPX O Yacute -50
+KPX O Ydieresis -50
+KPX Oacute A -55
+KPX Oacute Aacute -55
+KPX Oacute Abreve -55
+KPX Oacute Acircumflex -55
+KPX Oacute Adieresis -55
+KPX Oacute Agrave -55
+KPX Oacute Amacron -55
+KPX Oacute Aogonek -55
+KPX Oacute Aring -55
+KPX Oacute Atilde -55
+KPX Oacute T -40
+KPX Oacute Tcaron -40
+KPX Oacute Tcommaaccent -40
+KPX Oacute V -50
+KPX Oacute W -50
+KPX Oacute X -40
+KPX Oacute Y -50
+KPX Oacute Yacute -50
+KPX Oacute Ydieresis -50
+KPX Ocircumflex A -55
+KPX Ocircumflex Aacute -55
+KPX Ocircumflex Abreve -55
+KPX Ocircumflex Acircumflex -55
+KPX Ocircumflex Adieresis -55
+KPX Ocircumflex Agrave -55
+KPX Ocircumflex Amacron -55
+KPX Ocircumflex Aogonek -55
+KPX Ocircumflex Aring -55
+KPX Ocircumflex Atilde -55
+KPX Ocircumflex T -40
+KPX Ocircumflex Tcaron -40
+KPX Ocircumflex Tcommaaccent -40
+KPX Ocircumflex V -50
+KPX Ocircumflex W -50
+KPX Ocircumflex X -40
+KPX Ocircumflex Y -50
+KPX Ocircumflex Yacute -50
+KPX Ocircumflex Ydieresis -50
+KPX Odieresis A -55
+KPX Odieresis Aacute -55
+KPX Odieresis Abreve -55
+KPX Odieresis Acircumflex -55
+KPX Odieresis Adieresis -55
+KPX Odieresis Agrave -55
+KPX Odieresis Amacron -55
+KPX Odieresis Aogonek -55
+KPX Odieresis Aring -55
+KPX Odieresis Atilde -55
+KPX Odieresis T -40
+KPX Odieresis Tcaron -40
+KPX Odieresis Tcommaaccent -40
+KPX Odieresis V -50
+KPX Odieresis W -50
+KPX Odieresis X -40
+KPX Odieresis Y -50
+KPX Odieresis Yacute -50
+KPX Odieresis Ydieresis -50
+KPX Ograve A -55
+KPX Ograve Aacute -55
+KPX Ograve Abreve -55
+KPX Ograve Acircumflex -55
+KPX Ograve Adieresis -55
+KPX Ograve Agrave -55
+KPX Ograve Amacron -55
+KPX Ograve Aogonek -55
+KPX Ograve Aring -55
+KPX Ograve Atilde -55
+KPX Ograve T -40
+KPX Ograve Tcaron -40
+KPX Ograve Tcommaaccent -40
+KPX Ograve V -50
+KPX Ograve W -50
+KPX Ograve X -40
+KPX Ograve Y -50
+KPX Ograve Yacute -50
+KPX Ograve Ydieresis -50
+KPX Ohungarumlaut A -55
+KPX Ohungarumlaut Aacute -55
+KPX Ohungarumlaut Abreve -55
+KPX Ohungarumlaut Acircumflex -55
+KPX Ohungarumlaut Adieresis -55
+KPX Ohungarumlaut Agrave -55
+KPX Ohungarumlaut Amacron -55
+KPX Ohungarumlaut Aogonek -55
+KPX Ohungarumlaut Aring -55
+KPX Ohungarumlaut Atilde -55
+KPX Ohungarumlaut T -40
+KPX Ohungarumlaut Tcaron -40
+KPX Ohungarumlaut Tcommaaccent -40
+KPX Ohungarumlaut V -50
+KPX Ohungarumlaut W -50
+KPX Ohungarumlaut X -40
+KPX Ohungarumlaut Y -50
+KPX Ohungarumlaut Yacute -50
+KPX Ohungarumlaut Ydieresis -50
+KPX Omacron A -55
+KPX Omacron Aacute -55
+KPX Omacron Abreve -55
+KPX Omacron Acircumflex -55
+KPX Omacron Adieresis -55
+KPX Omacron Agrave -55
+KPX Omacron Amacron -55
+KPX Omacron Aogonek -55
+KPX Omacron Aring -55
+KPX Omacron Atilde -55
+KPX Omacron T -40
+KPX Omacron Tcaron -40
+KPX Omacron Tcommaaccent -40
+KPX Omacron V -50
+KPX Omacron W -50
+KPX Omacron X -40
+KPX Omacron Y -50
+KPX Omacron Yacute -50
+KPX Omacron Ydieresis -50
+KPX Oslash A -55
+KPX Oslash Aacute -55
+KPX Oslash Abreve -55
+KPX Oslash Acircumflex -55
+KPX Oslash Adieresis -55
+KPX Oslash Agrave -55
+KPX Oslash Amacron -55
+KPX Oslash Aogonek -55
+KPX Oslash Aring -55
+KPX Oslash Atilde -55
+KPX Oslash T -40
+KPX Oslash Tcaron -40
+KPX Oslash Tcommaaccent -40
+KPX Oslash V -50
+KPX Oslash W -50
+KPX Oslash X -40
+KPX Oslash Y -50
+KPX Oslash Yacute -50
+KPX Oslash Ydieresis -50
+KPX Otilde A -55
+KPX Otilde Aacute -55
+KPX Otilde Abreve -55
+KPX Otilde Acircumflex -55
+KPX Otilde Adieresis -55
+KPX Otilde Agrave -55
+KPX Otilde Amacron -55
+KPX Otilde Aogonek -55
+KPX Otilde Aring -55
+KPX Otilde Atilde -55
+KPX Otilde T -40
+KPX Otilde Tcaron -40
+KPX Otilde Tcommaaccent -40
+KPX Otilde V -50
+KPX Otilde W -50
+KPX Otilde X -40
+KPX Otilde Y -50
+KPX Otilde Yacute -50
+KPX Otilde Ydieresis -50
+KPX P A -90
+KPX P Aacute -90
+KPX P Abreve -90
+KPX P Acircumflex -90
+KPX P Adieresis -90
+KPX P Agrave -90
+KPX P Amacron -90
+KPX P Aogonek -90
+KPX P Aring -90
+KPX P Atilde -90
+KPX P a -80
+KPX P aacute -80
+KPX P abreve -80
+KPX P acircumflex -80
+KPX P adieresis -80
+KPX P agrave -80
+KPX P amacron -80
+KPX P aogonek -80
+KPX P aring -80
+KPX P atilde -80
+KPX P comma -135
+KPX P e -80
+KPX P eacute -80
+KPX P ecaron -80
+KPX P ecircumflex -80
+KPX P edieresis -80
+KPX P edotaccent -80
+KPX P egrave -80
+KPX P emacron -80
+KPX P eogonek -80
+KPX P o -80
+KPX P oacute -80
+KPX P ocircumflex -80
+KPX P odieresis -80
+KPX P ograve -80
+KPX P ohungarumlaut -80
+KPX P omacron -80
+KPX P oslash -80
+KPX P otilde -80
+KPX P period -135
+KPX Q U -10
+KPX Q Uacute -10
+KPX Q Ucircumflex -10
+KPX Q Udieresis -10
+KPX Q Ugrave -10
+KPX Q Uhungarumlaut -10
+KPX Q Umacron -10
+KPX Q Uogonek -10
+KPX Q Uring -10
+KPX R O -40
+KPX R Oacute -40
+KPX R Ocircumflex -40
+KPX R Odieresis -40
+KPX R Ograve -40
+KPX R Ohungarumlaut -40
+KPX R Omacron -40
+KPX R Oslash -40
+KPX R Otilde -40
+KPX R U -40
+KPX R Uacute -40
+KPX R Ucircumflex -40
+KPX R Udieresis -40
+KPX R Ugrave -40
+KPX R Uhungarumlaut -40
+KPX R Umacron -40
+KPX R Uogonek -40
+KPX R Uring -40
+KPX R V -18
+KPX R W -18
+KPX R Y -18
+KPX R Yacute -18
+KPX R Ydieresis -18
+KPX Racute O -40
+KPX Racute Oacute -40
+KPX Racute Ocircumflex -40
+KPX Racute Odieresis -40
+KPX Racute Ograve -40
+KPX Racute Ohungarumlaut -40
+KPX Racute Omacron -40
+KPX Racute Oslash -40
+KPX Racute Otilde -40
+KPX Racute U -40
+KPX Racute Uacute -40
+KPX Racute Ucircumflex -40
+KPX Racute Udieresis -40
+KPX Racute Ugrave -40
+KPX Racute Uhungarumlaut -40
+KPX Racute Umacron -40
+KPX Racute Uogonek -40
+KPX Racute Uring -40
+KPX Racute V -18
+KPX Racute W -18
+KPX Racute Y -18
+KPX Racute Yacute -18
+KPX Racute Ydieresis -18
+KPX Rcaron O -40
+KPX Rcaron Oacute -40
+KPX Rcaron Ocircumflex -40
+KPX Rcaron Odieresis -40
+KPX Rcaron Ograve -40
+KPX Rcaron Ohungarumlaut -40
+KPX Rcaron Omacron -40
+KPX Rcaron Oslash -40
+KPX Rcaron Otilde -40
+KPX Rcaron U -40
+KPX Rcaron Uacute -40
+KPX Rcaron Ucircumflex -40
+KPX Rcaron Udieresis -40
+KPX Rcaron Ugrave -40
+KPX Rcaron Uhungarumlaut -40
+KPX Rcaron Umacron -40
+KPX Rcaron Uogonek -40
+KPX Rcaron Uring -40
+KPX Rcaron V -18
+KPX Rcaron W -18
+KPX Rcaron Y -18
+KPX Rcaron Yacute -18
+KPX Rcaron Ydieresis -18
+KPX Rcommaaccent O -40
+KPX Rcommaaccent Oacute -40
+KPX Rcommaaccent Ocircumflex -40
+KPX Rcommaaccent Odieresis -40
+KPX Rcommaaccent Ograve -40
+KPX Rcommaaccent Ohungarumlaut -40
+KPX Rcommaaccent Omacron -40
+KPX Rcommaaccent Oslash -40
+KPX Rcommaaccent Otilde -40
+KPX Rcommaaccent U -40
+KPX Rcommaaccent Uacute -40
+KPX Rcommaaccent Ucircumflex -40
+KPX Rcommaaccent Udieresis -40
+KPX Rcommaaccent Ugrave -40
+KPX Rcommaaccent Uhungarumlaut -40
+KPX Rcommaaccent Umacron -40
+KPX Rcommaaccent Uogonek -40
+KPX Rcommaaccent Uring -40
+KPX Rcommaaccent V -18
+KPX Rcommaaccent W -18
+KPX Rcommaaccent Y -18
+KPX Rcommaaccent Yacute -18
+KPX Rcommaaccent Ydieresis -18
+KPX T A -50
+KPX T Aacute -50
+KPX T Abreve -50
+KPX T Acircumflex -50
+KPX T Adieresis -50
+KPX T Agrave -50
+KPX T Amacron -50
+KPX T Aogonek -50
+KPX T Aring -50
+KPX T Atilde -50
+KPX T O -18
+KPX T Oacute -18
+KPX T Ocircumflex -18
+KPX T Odieresis -18
+KPX T Ograve -18
+KPX T Ohungarumlaut -18
+KPX T Omacron -18
+KPX T Oslash -18
+KPX T Otilde -18
+KPX T a -92
+KPX T aacute -92
+KPX T abreve -92
+KPX T acircumflex -92
+KPX T adieresis -92
+KPX T agrave -92
+KPX T amacron -92
+KPX T aogonek -92
+KPX T aring -92
+KPX T atilde -92
+KPX T colon -55
+KPX T comma -74
+KPX T e -92
+KPX T eacute -92
+KPX T ecaron -92
+KPX T ecircumflex -52
+KPX T edieresis -52
+KPX T edotaccent -92
+KPX T egrave -52
+KPX T emacron -52
+KPX T eogonek -92
+KPX T hyphen -74
+KPX T i -55
+KPX T iacute -55
+KPX T iogonek -55
+KPX T o -92
+KPX T oacute -92
+KPX T ocircumflex -92
+KPX T odieresis -92
+KPX T ograve -92
+KPX T ohungarumlaut -92
+KPX T omacron -92
+KPX T oslash -92
+KPX T otilde -92
+KPX T period -74
+KPX T r -55
+KPX T racute -55
+KPX T rcaron -55
+KPX T rcommaaccent -55
+KPX T semicolon -65
+KPX T u -55
+KPX T uacute -55
+KPX T ucircumflex -55
+KPX T udieresis -55
+KPX T ugrave -55
+KPX T uhungarumlaut -55
+KPX T umacron -55
+KPX T uogonek -55
+KPX T uring -55
+KPX T w -74
+KPX T y -74
+KPX T yacute -74
+KPX T ydieresis -34
+KPX Tcaron A -50
+KPX Tcaron Aacute -50
+KPX Tcaron Abreve -50
+KPX Tcaron Acircumflex -50
+KPX Tcaron Adieresis -50
+KPX Tcaron Agrave -50
+KPX Tcaron Amacron -50
+KPX Tcaron Aogonek -50
+KPX Tcaron Aring -50
+KPX Tcaron Atilde -50
+KPX Tcaron O -18
+KPX Tcaron Oacute -18
+KPX Tcaron Ocircumflex -18
+KPX Tcaron Odieresis -18
+KPX Tcaron Ograve -18
+KPX Tcaron Ohungarumlaut -18
+KPX Tcaron Omacron -18
+KPX Tcaron Oslash -18
+KPX Tcaron Otilde -18
+KPX Tcaron a -92
+KPX Tcaron aacute -92
+KPX Tcaron abreve -92
+KPX Tcaron acircumflex -92
+KPX Tcaron adieresis -92
+KPX Tcaron agrave -92
+KPX Tcaron amacron -92
+KPX Tcaron aogonek -92
+KPX Tcaron aring -92
+KPX Tcaron atilde -92
+KPX Tcaron colon -55
+KPX Tcaron comma -74
+KPX Tcaron e -92
+KPX Tcaron eacute -92
+KPX Tcaron ecaron -92
+KPX Tcaron ecircumflex -52
+KPX Tcaron edieresis -52
+KPX Tcaron edotaccent -92
+KPX Tcaron egrave -52
+KPX Tcaron emacron -52
+KPX Tcaron eogonek -92
+KPX Tcaron hyphen -74
+KPX Tcaron i -55
+KPX Tcaron iacute -55
+KPX Tcaron iogonek -55
+KPX Tcaron o -92
+KPX Tcaron oacute -92
+KPX Tcaron ocircumflex -92
+KPX Tcaron odieresis -92
+KPX Tcaron ograve -92
+KPX Tcaron ohungarumlaut -92
+KPX Tcaron omacron -92
+KPX Tcaron oslash -92
+KPX Tcaron otilde -92
+KPX Tcaron period -74
+KPX Tcaron r -55
+KPX Tcaron racute -55
+KPX Tcaron rcaron -55
+KPX Tcaron rcommaaccent -55
+KPX Tcaron semicolon -65
+KPX Tcaron u -55
+KPX Tcaron uacute -55
+KPX Tcaron ucircumflex -55
+KPX Tcaron udieresis -55
+KPX Tcaron ugrave -55
+KPX Tcaron uhungarumlaut -55
+KPX Tcaron umacron -55
+KPX Tcaron uogonek -55
+KPX Tcaron uring -55
+KPX Tcaron w -74
+KPX Tcaron y -74
+KPX Tcaron yacute -74
+KPX Tcaron ydieresis -34
+KPX Tcommaaccent A -50
+KPX Tcommaaccent Aacute -50
+KPX Tcommaaccent Abreve -50
+KPX Tcommaaccent Acircumflex -50
+KPX Tcommaaccent Adieresis -50
+KPX Tcommaaccent Agrave -50
+KPX Tcommaaccent Amacron -50
+KPX Tcommaaccent Aogonek -50
+KPX Tcommaaccent Aring -50
+KPX Tcommaaccent Atilde -50
+KPX Tcommaaccent O -18
+KPX Tcommaaccent Oacute -18
+KPX Tcommaaccent Ocircumflex -18
+KPX Tcommaaccent Odieresis -18
+KPX Tcommaaccent Ograve -18
+KPX Tcommaaccent Ohungarumlaut -18
+KPX Tcommaaccent Omacron -18
+KPX Tcommaaccent Oslash -18
+KPX Tcommaaccent Otilde -18
+KPX Tcommaaccent a -92
+KPX Tcommaaccent aacute -92
+KPX Tcommaaccent abreve -92
+KPX Tcommaaccent acircumflex -92
+KPX Tcommaaccent adieresis -92
+KPX Tcommaaccent agrave -92
+KPX Tcommaaccent amacron -92
+KPX Tcommaaccent aogonek -92
+KPX Tcommaaccent aring -92
+KPX Tcommaaccent atilde -92
+KPX Tcommaaccent colon -55
+KPX Tcommaaccent comma -74
+KPX Tcommaaccent e -92
+KPX Tcommaaccent eacute -92
+KPX Tcommaaccent ecaron -92
+KPX Tcommaaccent ecircumflex -52
+KPX Tcommaaccent edieresis -52
+KPX Tcommaaccent edotaccent -92
+KPX Tcommaaccent egrave -52
+KPX Tcommaaccent emacron -52
+KPX Tcommaaccent eogonek -92
+KPX Tcommaaccent hyphen -74
+KPX Tcommaaccent i -55
+KPX Tcommaaccent iacute -55
+KPX Tcommaaccent iogonek -55
+KPX Tcommaaccent o -92
+KPX Tcommaaccent oacute -92
+KPX Tcommaaccent ocircumflex -92
+KPX Tcommaaccent odieresis -92
+KPX Tcommaaccent ograve -92
+KPX Tcommaaccent ohungarumlaut -92
+KPX Tcommaaccent omacron -92
+KPX Tcommaaccent oslash -92
+KPX Tcommaaccent otilde -92
+KPX Tcommaaccent period -74
+KPX Tcommaaccent r -55
+KPX Tcommaaccent racute -55
+KPX Tcommaaccent rcaron -55
+KPX Tcommaaccent rcommaaccent -55
+KPX Tcommaaccent semicolon -65
+KPX Tcommaaccent u -55
+KPX Tcommaaccent uacute -55
+KPX Tcommaaccent ucircumflex -55
+KPX Tcommaaccent udieresis -55
+KPX Tcommaaccent ugrave -55
+KPX Tcommaaccent uhungarumlaut -55
+KPX Tcommaaccent umacron -55
+KPX Tcommaaccent uogonek -55
+KPX Tcommaaccent uring -55
+KPX Tcommaaccent w -74
+KPX Tcommaaccent y -74
+KPX Tcommaaccent yacute -74
+KPX Tcommaaccent ydieresis -34
+KPX U A -40
+KPX U Aacute -40
+KPX U Abreve -40
+KPX U Acircumflex -40
+KPX U Adieresis -40
+KPX U Agrave -40
+KPX U Amacron -40
+KPX U Aogonek -40
+KPX U Aring -40
+KPX U Atilde -40
+KPX U comma -25
+KPX U period -25
+KPX Uacute A -40
+KPX Uacute Aacute -40
+KPX Uacute Abreve -40
+KPX Uacute Acircumflex -40
+KPX Uacute Adieresis -40
+KPX Uacute Agrave -40
+KPX Uacute Amacron -40
+KPX Uacute Aogonek -40
+KPX Uacute Aring -40
+KPX Uacute Atilde -40
+KPX Uacute comma -25
+KPX Uacute period -25
+KPX Ucircumflex A -40
+KPX Ucircumflex Aacute -40
+KPX Ucircumflex Abreve -40
+KPX Ucircumflex Acircumflex -40
+KPX Ucircumflex Adieresis -40
+KPX Ucircumflex Agrave -40
+KPX Ucircumflex Amacron -40
+KPX Ucircumflex Aogonek -40
+KPX Ucircumflex Aring -40
+KPX Ucircumflex Atilde -40
+KPX Ucircumflex comma -25
+KPX Ucircumflex period -25
+KPX Udieresis A -40
+KPX Udieresis Aacute -40
+KPX Udieresis Abreve -40
+KPX Udieresis Acircumflex -40
+KPX Udieresis Adieresis -40
+KPX Udieresis Agrave -40
+KPX Udieresis Amacron -40
+KPX Udieresis Aogonek -40
+KPX Udieresis Aring -40
+KPX Udieresis Atilde -40
+KPX Udieresis comma -25
+KPX Udieresis period -25
+KPX Ugrave A -40
+KPX Ugrave Aacute -40
+KPX Ugrave Abreve -40
+KPX Ugrave Acircumflex -40
+KPX Ugrave Adieresis -40
+KPX Ugrave Agrave -40
+KPX Ugrave Amacron -40
+KPX Ugrave Aogonek -40
+KPX Ugrave Aring -40
+KPX Ugrave Atilde -40
+KPX Ugrave comma -25
+KPX Ugrave period -25
+KPX Uhungarumlaut A -40
+KPX Uhungarumlaut Aacute -40
+KPX Uhungarumlaut Abreve -40
+KPX Uhungarumlaut Acircumflex -40
+KPX Uhungarumlaut Adieresis -40
+KPX Uhungarumlaut Agrave -40
+KPX Uhungarumlaut Amacron -40
+KPX Uhungarumlaut Aogonek -40
+KPX Uhungarumlaut Aring -40
+KPX Uhungarumlaut Atilde -40
+KPX Uhungarumlaut comma -25
+KPX Uhungarumlaut period -25
+KPX Umacron A -40
+KPX Umacron Aacute -40
+KPX Umacron Abreve -40
+KPX Umacron Acircumflex -40
+KPX Umacron Adieresis -40
+KPX Umacron Agrave -40
+KPX Umacron Amacron -40
+KPX Umacron Aogonek -40
+KPX Umacron Aring -40
+KPX Umacron Atilde -40
+KPX Umacron comma -25
+KPX Umacron period -25
+KPX Uogonek A -40
+KPX Uogonek Aacute -40
+KPX Uogonek Abreve -40
+KPX Uogonek Acircumflex -40
+KPX Uogonek Adieresis -40
+KPX Uogonek Agrave -40
+KPX Uogonek Amacron -40
+KPX Uogonek Aogonek -40
+KPX Uogonek Aring -40
+KPX Uogonek Atilde -40
+KPX Uogonek comma -25
+KPX Uogonek period -25
+KPX Uring A -40
+KPX Uring Aacute -40
+KPX Uring Abreve -40
+KPX Uring Acircumflex -40
+KPX Uring Adieresis -40
+KPX Uring Agrave -40
+KPX Uring Amacron -40
+KPX Uring Aogonek -40
+KPX Uring Aring -40
+KPX Uring Atilde -40
+KPX Uring comma -25
+KPX Uring period -25
+KPX V A -60
+KPX V Aacute -60
+KPX V Abreve -60
+KPX V Acircumflex -60
+KPX V Adieresis -60
+KPX V Agrave -60
+KPX V Amacron -60
+KPX V Aogonek -60
+KPX V Aring -60
+KPX V Atilde -60
+KPX V O -30
+KPX V Oacute -30
+KPX V Ocircumflex -30
+KPX V Odieresis -30
+KPX V Ograve -30
+KPX V Ohungarumlaut -30
+KPX V Omacron -30
+KPX V Oslash -30
+KPX V Otilde -30
+KPX V a -111
+KPX V aacute -111
+KPX V abreve -111
+KPX V acircumflex -111
+KPX V adieresis -111
+KPX V agrave -111
+KPX V amacron -111
+KPX V aogonek -111
+KPX V aring -111
+KPX V atilde -111
+KPX V colon -65
+KPX V comma -129
+KPX V e -111
+KPX V eacute -111
+KPX V ecaron -111
+KPX V ecircumflex -111
+KPX V edieresis -71
+KPX V edotaccent -111
+KPX V egrave -71
+KPX V emacron -71
+KPX V eogonek -111
+KPX V hyphen -55
+KPX V i -74
+KPX V iacute -74
+KPX V icircumflex -34
+KPX V idieresis -34
+KPX V igrave -34
+KPX V imacron -34
+KPX V iogonek -74
+KPX V o -111
+KPX V oacute -111
+KPX V ocircumflex -111
+KPX V odieresis -111
+KPX V ograve -111
+KPX V ohungarumlaut -111
+KPX V omacron -111
+KPX V oslash -111
+KPX V otilde -111
+KPX V period -129
+KPX V semicolon -74
+KPX V u -74
+KPX V uacute -74
+KPX V ucircumflex -74
+KPX V udieresis -74
+KPX V ugrave -74
+KPX V uhungarumlaut -74
+KPX V umacron -74
+KPX V uogonek -74
+KPX V uring -74
+KPX W A -60
+KPX W Aacute -60
+KPX W Abreve -60
+KPX W Acircumflex -60
+KPX W Adieresis -60
+KPX W Agrave -60
+KPX W Amacron -60
+KPX W Aogonek -60
+KPX W Aring -60
+KPX W Atilde -60
+KPX W O -25
+KPX W Oacute -25
+KPX W Ocircumflex -25
+KPX W Odieresis -25
+KPX W Ograve -25
+KPX W Ohungarumlaut -25
+KPX W Omacron -25
+KPX W Oslash -25
+KPX W Otilde -25
+KPX W a -92
+KPX W aacute -92
+KPX W abreve -92
+KPX W acircumflex -92
+KPX W adieresis -92
+KPX W agrave -92
+KPX W amacron -92
+KPX W aogonek -92
+KPX W aring -92
+KPX W atilde -92
+KPX W colon -65
+KPX W comma -92
+KPX W e -92
+KPX W eacute -92
+KPX W ecaron -92
+KPX W ecircumflex -92
+KPX W edieresis -52
+KPX W edotaccent -92
+KPX W egrave -52
+KPX W emacron -52
+KPX W eogonek -92
+KPX W hyphen -37
+KPX W i -55
+KPX W iacute -55
+KPX W iogonek -55
+KPX W o -92
+KPX W oacute -92
+KPX W ocircumflex -92
+KPX W odieresis -92
+KPX W ograve -92
+KPX W ohungarumlaut -92
+KPX W omacron -92
+KPX W oslash -92
+KPX W otilde -92
+KPX W period -92
+KPX W semicolon -65
+KPX W u -55
+KPX W uacute -55
+KPX W ucircumflex -55
+KPX W udieresis -55
+KPX W ugrave -55
+KPX W uhungarumlaut -55
+KPX W umacron -55
+KPX W uogonek -55
+KPX W uring -55
+KPX W y -70
+KPX W yacute -70
+KPX W ydieresis -70
+KPX Y A -50
+KPX Y Aacute -50
+KPX Y Abreve -50
+KPX Y Acircumflex -50
+KPX Y Adieresis -50
+KPX Y Agrave -50
+KPX Y Amacron -50
+KPX Y Aogonek -50
+KPX Y Aring -50
+KPX Y Atilde -50
+KPX Y O -15
+KPX Y Oacute -15
+KPX Y Ocircumflex -15
+KPX Y Odieresis -15
+KPX Y Ograve -15
+KPX Y Ohungarumlaut -15
+KPX Y Omacron -15
+KPX Y Oslash -15
+KPX Y Otilde -15
+KPX Y a -92
+KPX Y aacute -92
+KPX Y abreve -92
+KPX Y acircumflex -92
+KPX Y adieresis -92
+KPX Y agrave -92
+KPX Y amacron -92
+KPX Y aogonek -92
+KPX Y aring -92
+KPX Y atilde -92
+KPX Y colon -65
+KPX Y comma -92
+KPX Y e -92
+KPX Y eacute -92
+KPX Y ecaron -92
+KPX Y ecircumflex -92
+KPX Y edieresis -52
+KPX Y edotaccent -92
+KPX Y egrave -52
+KPX Y emacron -52
+KPX Y eogonek -92
+KPX Y hyphen -74
+KPX Y i -74
+KPX Y iacute -74
+KPX Y icircumflex -34
+KPX Y idieresis -34
+KPX Y igrave -34
+KPX Y imacron -34
+KPX Y iogonek -74
+KPX Y o -92
+KPX Y oacute -92
+KPX Y ocircumflex -92
+KPX Y odieresis -92
+KPX Y ograve -92
+KPX Y ohungarumlaut -92
+KPX Y omacron -92
+KPX Y oslash -92
+KPX Y otilde -92
+KPX Y period -92
+KPX Y semicolon -65
+KPX Y u -92
+KPX Y uacute -92
+KPX Y ucircumflex -92
+KPX Y udieresis -92
+KPX Y ugrave -92
+KPX Y uhungarumlaut -92
+KPX Y umacron -92
+KPX Y uogonek -92
+KPX Y uring -92
+KPX Yacute A -50
+KPX Yacute Aacute -50
+KPX Yacute Abreve -50
+KPX Yacute Acircumflex -50
+KPX Yacute Adieresis -50
+KPX Yacute Agrave -50
+KPX Yacute Amacron -50
+KPX Yacute Aogonek -50
+KPX Yacute Aring -50
+KPX Yacute Atilde -50
+KPX Yacute O -15
+KPX Yacute Oacute -15
+KPX Yacute Ocircumflex -15
+KPX Yacute Odieresis -15
+KPX Yacute Ograve -15
+KPX Yacute Ohungarumlaut -15
+KPX Yacute Omacron -15
+KPX Yacute Oslash -15
+KPX Yacute Otilde -15
+KPX Yacute a -92
+KPX Yacute aacute -92
+KPX Yacute abreve -92
+KPX Yacute acircumflex -92
+KPX Yacute adieresis -92
+KPX Yacute agrave -92
+KPX Yacute amacron -92
+KPX Yacute aogonek -92
+KPX Yacute aring -92
+KPX Yacute atilde -92
+KPX Yacute colon -65
+KPX Yacute comma -92
+KPX Yacute e -92
+KPX Yacute eacute -92
+KPX Yacute ecaron -92
+KPX Yacute ecircumflex -92
+KPX Yacute edieresis -52
+KPX Yacute edotaccent -92
+KPX Yacute egrave -52
+KPX Yacute emacron -52
+KPX Yacute eogonek -92
+KPX Yacute hyphen -74
+KPX Yacute i -74
+KPX Yacute iacute -74
+KPX Yacute icircumflex -34
+KPX Yacute idieresis -34
+KPX Yacute igrave -34
+KPX Yacute imacron -34
+KPX Yacute iogonek -74
+KPX Yacute o -92
+KPX Yacute oacute -92
+KPX Yacute ocircumflex -92
+KPX Yacute odieresis -92
+KPX Yacute ograve -92
+KPX Yacute ohungarumlaut -92
+KPX Yacute omacron -92
+KPX Yacute oslash -92
+KPX Yacute otilde -92
+KPX Yacute period -92
+KPX Yacute semicolon -65
+KPX Yacute u -92
+KPX Yacute uacute -92
+KPX Yacute ucircumflex -92
+KPX Yacute udieresis -92
+KPX Yacute ugrave -92
+KPX Yacute uhungarumlaut -92
+KPX Yacute umacron -92
+KPX Yacute uogonek -92
+KPX Yacute uring -92
+KPX Ydieresis A -50
+KPX Ydieresis Aacute -50
+KPX Ydieresis Abreve -50
+KPX Ydieresis Acircumflex -50
+KPX Ydieresis Adieresis -50
+KPX Ydieresis Agrave -50
+KPX Ydieresis Amacron -50
+KPX Ydieresis Aogonek -50
+KPX Ydieresis Aring -50
+KPX Ydieresis Atilde -50
+KPX Ydieresis O -15
+KPX Ydieresis Oacute -15
+KPX Ydieresis Ocircumflex -15
+KPX Ydieresis Odieresis -15
+KPX Ydieresis Ograve -15
+KPX Ydieresis Ohungarumlaut -15
+KPX Ydieresis Omacron -15
+KPX Ydieresis Oslash -15
+KPX Ydieresis Otilde -15
+KPX Ydieresis a -92
+KPX Ydieresis aacute -92
+KPX Ydieresis abreve -92
+KPX Ydieresis acircumflex -92
+KPX Ydieresis adieresis -92
+KPX Ydieresis agrave -92
+KPX Ydieresis amacron -92
+KPX Ydieresis aogonek -92
+KPX Ydieresis aring -92
+KPX Ydieresis atilde -92
+KPX Ydieresis colon -65
+KPX Ydieresis comma -92
+KPX Ydieresis e -92
+KPX Ydieresis eacute -92
+KPX Ydieresis ecaron -92
+KPX Ydieresis ecircumflex -92
+KPX Ydieresis edieresis -52
+KPX Ydieresis edotaccent -92
+KPX Ydieresis egrave -52
+KPX Ydieresis emacron -52
+KPX Ydieresis eogonek -92
+KPX Ydieresis hyphen -74
+KPX Ydieresis i -74
+KPX Ydieresis iacute -74
+KPX Ydieresis icircumflex -34
+KPX Ydieresis idieresis -34
+KPX Ydieresis igrave -34
+KPX Ydieresis imacron -34
+KPX Ydieresis iogonek -74
+KPX Ydieresis o -92
+KPX Ydieresis oacute -92
+KPX Ydieresis ocircumflex -92
+KPX Ydieresis odieresis -92
+KPX Ydieresis ograve -92
+KPX Ydieresis ohungarumlaut -92
+KPX Ydieresis omacron -92
+KPX Ydieresis oslash -92
+KPX Ydieresis otilde -92
+KPX Ydieresis period -92
+KPX Ydieresis semicolon -65
+KPX Ydieresis u -92
+KPX Ydieresis uacute -92
+KPX Ydieresis ucircumflex -92
+KPX Ydieresis udieresis -92
+KPX Ydieresis ugrave -92
+KPX Ydieresis uhungarumlaut -92
+KPX Ydieresis umacron -92
+KPX Ydieresis uogonek -92
+KPX Ydieresis uring -92
+KPX a g -10
+KPX a gbreve -10
+KPX a gcommaaccent -10
+KPX aacute g -10
+KPX aacute gbreve -10
+KPX aacute gcommaaccent -10
+KPX abreve g -10
+KPX abreve gbreve -10
+KPX abreve gcommaaccent -10
+KPX acircumflex g -10
+KPX acircumflex gbreve -10
+KPX acircumflex gcommaaccent -10
+KPX adieresis g -10
+KPX adieresis gbreve -10
+KPX adieresis gcommaaccent -10
+KPX agrave g -10
+KPX agrave gbreve -10
+KPX agrave gcommaaccent -10
+KPX amacron g -10
+KPX amacron gbreve -10
+KPX amacron gcommaaccent -10
+KPX aogonek g -10
+KPX aogonek gbreve -10
+KPX aogonek gcommaaccent -10
+KPX aring g -10
+KPX aring gbreve -10
+KPX aring gcommaaccent -10
+KPX atilde g -10
+KPX atilde gbreve -10
+KPX atilde gcommaaccent -10
+KPX b period -40
+KPX b u -20
+KPX b uacute -20
+KPX b ucircumflex -20
+KPX b udieresis -20
+KPX b ugrave -20
+KPX b uhungarumlaut -20
+KPX b umacron -20
+KPX b uogonek -20
+KPX b uring -20
+KPX c h -15
+KPX c k -20
+KPX c kcommaaccent -20
+KPX cacute h -15
+KPX cacute k -20
+KPX cacute kcommaaccent -20
+KPX ccaron h -15
+KPX ccaron k -20
+KPX ccaron kcommaaccent -20
+KPX ccedilla h -15
+KPX ccedilla k -20
+KPX ccedilla kcommaaccent -20
+KPX comma quotedblright -140
+KPX comma quoteright -140
+KPX e comma -10
+KPX e g -40
+KPX e gbreve -40
+KPX e gcommaaccent -40
+KPX e period -15
+KPX e v -15
+KPX e w -15
+KPX e x -20
+KPX e y -30
+KPX e yacute -30
+KPX e ydieresis -30
+KPX eacute comma -10
+KPX eacute g -40
+KPX eacute gbreve -40
+KPX eacute gcommaaccent -40
+KPX eacute period -15
+KPX eacute v -15
+KPX eacute w -15
+KPX eacute x -20
+KPX eacute y -30
+KPX eacute yacute -30
+KPX eacute ydieresis -30
+KPX ecaron comma -10
+KPX ecaron g -40
+KPX ecaron gbreve -40
+KPX ecaron gcommaaccent -40
+KPX ecaron period -15
+KPX ecaron v -15
+KPX ecaron w -15
+KPX ecaron x -20
+KPX ecaron y -30
+KPX ecaron yacute -30
+KPX ecaron ydieresis -30
+KPX ecircumflex comma -10
+KPX ecircumflex g -40
+KPX ecircumflex gbreve -40
+KPX ecircumflex gcommaaccent -40
+KPX ecircumflex period -15
+KPX ecircumflex v -15
+KPX ecircumflex w -15
+KPX ecircumflex x -20
+KPX ecircumflex y -30
+KPX ecircumflex yacute -30
+KPX ecircumflex ydieresis -30
+KPX edieresis comma -10
+KPX edieresis g -40
+KPX edieresis gbreve -40
+KPX edieresis gcommaaccent -40
+KPX edieresis period -15
+KPX edieresis v -15
+KPX edieresis w -15
+KPX edieresis x -20
+KPX edieresis y -30
+KPX edieresis yacute -30
+KPX edieresis ydieresis -30
+KPX edotaccent comma -10
+KPX edotaccent g -40
+KPX edotaccent gbreve -40
+KPX edotaccent gcommaaccent -40
+KPX edotaccent period -15
+KPX edotaccent v -15
+KPX edotaccent w -15
+KPX edotaccent x -20
+KPX edotaccent y -30
+KPX edotaccent yacute -30
+KPX edotaccent ydieresis -30
+KPX egrave comma -10
+KPX egrave g -40
+KPX egrave gbreve -40
+KPX egrave gcommaaccent -40
+KPX egrave period -15
+KPX egrave v -15
+KPX egrave w -15
+KPX egrave x -20
+KPX egrave y -30
+KPX egrave yacute -30
+KPX egrave ydieresis -30
+KPX emacron comma -10
+KPX emacron g -40
+KPX emacron gbreve -40
+KPX emacron gcommaaccent -40
+KPX emacron period -15
+KPX emacron v -15
+KPX emacron w -15
+KPX emacron x -20
+KPX emacron y -30
+KPX emacron yacute -30
+KPX emacron ydieresis -30
+KPX eogonek comma -10
+KPX eogonek g -40
+KPX eogonek gbreve -40
+KPX eogonek gcommaaccent -40
+KPX eogonek period -15
+KPX eogonek v -15
+KPX eogonek w -15
+KPX eogonek x -20
+KPX eogonek y -30
+KPX eogonek yacute -30
+KPX eogonek ydieresis -30
+KPX f comma -10
+KPX f dotlessi -60
+KPX f f -18
+KPX f i -20
+KPX f iogonek -20
+KPX f period -15
+KPX f quoteright 92
+KPX g comma -10
+KPX g e -10
+KPX g eacute -10
+KPX g ecaron -10
+KPX g ecircumflex -10
+KPX g edieresis -10
+KPX g edotaccent -10
+KPX g egrave -10
+KPX g emacron -10
+KPX g eogonek -10
+KPX g g -10
+KPX g gbreve -10
+KPX g gcommaaccent -10
+KPX g period -15
+KPX gbreve comma -10
+KPX gbreve e -10
+KPX gbreve eacute -10
+KPX gbreve ecaron -10
+KPX gbreve ecircumflex -10
+KPX gbreve edieresis -10
+KPX gbreve edotaccent -10
+KPX gbreve egrave -10
+KPX gbreve emacron -10
+KPX gbreve eogonek -10
+KPX gbreve g -10
+KPX gbreve gbreve -10
+KPX gbreve gcommaaccent -10
+KPX gbreve period -15
+KPX gcommaaccent comma -10
+KPX gcommaaccent e -10
+KPX gcommaaccent eacute -10
+KPX gcommaaccent ecaron -10
+KPX gcommaaccent ecircumflex -10
+KPX gcommaaccent edieresis -10
+KPX gcommaaccent edotaccent -10
+KPX gcommaaccent egrave -10
+KPX gcommaaccent emacron -10
+KPX gcommaaccent eogonek -10
+KPX gcommaaccent g -10
+KPX gcommaaccent gbreve -10
+KPX gcommaaccent gcommaaccent -10
+KPX gcommaaccent period -15
+KPX k e -10
+KPX k eacute -10
+KPX k ecaron -10
+KPX k ecircumflex -10
+KPX k edieresis -10
+KPX k edotaccent -10
+KPX k egrave -10
+KPX k emacron -10
+KPX k eogonek -10
+KPX k o -10
+KPX k oacute -10
+KPX k ocircumflex -10
+KPX k odieresis -10
+KPX k ograve -10
+KPX k ohungarumlaut -10
+KPX k omacron -10
+KPX k oslash -10
+KPX k otilde -10
+KPX k y -10
+KPX k yacute -10
+KPX k ydieresis -10
+KPX kcommaaccent e -10
+KPX kcommaaccent eacute -10
+KPX kcommaaccent ecaron -10
+KPX kcommaaccent ecircumflex -10
+KPX kcommaaccent edieresis -10
+KPX kcommaaccent edotaccent -10
+KPX kcommaaccent egrave -10
+KPX kcommaaccent emacron -10
+KPX kcommaaccent eogonek -10
+KPX kcommaaccent o -10
+KPX kcommaaccent oacute -10
+KPX kcommaaccent ocircumflex -10
+KPX kcommaaccent odieresis -10
+KPX kcommaaccent ograve -10
+KPX kcommaaccent ohungarumlaut -10
+KPX kcommaaccent omacron -10
+KPX kcommaaccent oslash -10
+KPX kcommaaccent otilde -10
+KPX kcommaaccent y -10
+KPX kcommaaccent yacute -10
+KPX kcommaaccent ydieresis -10
+KPX n v -40
+KPX nacute v -40
+KPX ncaron v -40
+KPX ncommaaccent v -40
+KPX ntilde v -40
+KPX o g -10
+KPX o gbreve -10
+KPX o gcommaaccent -10
+KPX o v -10
+KPX oacute g -10
+KPX oacute gbreve -10
+KPX oacute gcommaaccent -10
+KPX oacute v -10
+KPX ocircumflex g -10
+KPX ocircumflex gbreve -10
+KPX ocircumflex gcommaaccent -10
+KPX ocircumflex v -10
+KPX odieresis g -10
+KPX odieresis gbreve -10
+KPX odieresis gcommaaccent -10
+KPX odieresis v -10
+KPX ograve g -10
+KPX ograve gbreve -10
+KPX ograve gcommaaccent -10
+KPX ograve v -10
+KPX ohungarumlaut g -10
+KPX ohungarumlaut gbreve -10
+KPX ohungarumlaut gcommaaccent -10
+KPX ohungarumlaut v -10
+KPX omacron g -10
+KPX omacron gbreve -10
+KPX omacron gcommaaccent -10
+KPX omacron v -10
+KPX oslash g -10
+KPX oslash gbreve -10
+KPX oslash gcommaaccent -10
+KPX oslash v -10
+KPX otilde g -10
+KPX otilde gbreve -10
+KPX otilde gcommaaccent -10
+KPX otilde v -10
+KPX period quotedblright -140
+KPX period quoteright -140
+KPX quoteleft quoteleft -111
+KPX quoteright d -25
+KPX quoteright dcroat -25
+KPX quoteright quoteright -111
+KPX quoteright r -25
+KPX quoteright racute -25
+KPX quoteright rcaron -25
+KPX quoteright rcommaaccent -25
+KPX quoteright s -40
+KPX quoteright sacute -40
+KPX quoteright scaron -40
+KPX quoteright scedilla -40
+KPX quoteright scommaaccent -40
+KPX quoteright space -111
+KPX quoteright t -30
+KPX quoteright tcommaaccent -30
+KPX quoteright v -10
+KPX r a -15
+KPX r aacute -15
+KPX r abreve -15
+KPX r acircumflex -15
+KPX r adieresis -15
+KPX r agrave -15
+KPX r amacron -15
+KPX r aogonek -15
+KPX r aring -15
+KPX r atilde -15
+KPX r c -37
+KPX r cacute -37
+KPX r ccaron -37
+KPX r ccedilla -37
+KPX r comma -111
+KPX r d -37
+KPX r dcroat -37
+KPX r e -37
+KPX r eacute -37
+KPX r ecaron -37
+KPX r ecircumflex -37
+KPX r edieresis -37
+KPX r edotaccent -37
+KPX r egrave -37
+KPX r emacron -37
+KPX r eogonek -37
+KPX r g -37
+KPX r gbreve -37
+KPX r gcommaaccent -37
+KPX r hyphen -20
+KPX r o -45
+KPX r oacute -45
+KPX r ocircumflex -45
+KPX r odieresis -45
+KPX r ograve -45
+KPX r ohungarumlaut -45
+KPX r omacron -45
+KPX r oslash -45
+KPX r otilde -45
+KPX r period -111
+KPX r q -37
+KPX r s -10
+KPX r sacute -10
+KPX r scaron -10
+KPX r scedilla -10
+KPX r scommaaccent -10
+KPX racute a -15
+KPX racute aacute -15
+KPX racute abreve -15
+KPX racute acircumflex -15
+KPX racute adieresis -15
+KPX racute agrave -15
+KPX racute amacron -15
+KPX racute aogonek -15
+KPX racute aring -15
+KPX racute atilde -15
+KPX racute c -37
+KPX racute cacute -37
+KPX racute ccaron -37
+KPX racute ccedilla -37
+KPX racute comma -111
+KPX racute d -37
+KPX racute dcroat -37
+KPX racute e -37
+KPX racute eacute -37
+KPX racute ecaron -37
+KPX racute ecircumflex -37
+KPX racute edieresis -37
+KPX racute edotaccent -37
+KPX racute egrave -37
+KPX racute emacron -37
+KPX racute eogonek -37
+KPX racute g -37
+KPX racute gbreve -37
+KPX racute gcommaaccent -37
+KPX racute hyphen -20
+KPX racute o -45
+KPX racute oacute -45
+KPX racute ocircumflex -45
+KPX racute odieresis -45
+KPX racute ograve -45
+KPX racute ohungarumlaut -45
+KPX racute omacron -45
+KPX racute oslash -45
+KPX racute otilde -45
+KPX racute period -111
+KPX racute q -37
+KPX racute s -10
+KPX racute sacute -10
+KPX racute scaron -10
+KPX racute scedilla -10
+KPX racute scommaaccent -10
+KPX rcaron a -15
+KPX rcaron aacute -15
+KPX rcaron abreve -15
+KPX rcaron acircumflex -15
+KPX rcaron adieresis -15
+KPX rcaron agrave -15
+KPX rcaron amacron -15
+KPX rcaron aogonek -15
+KPX rcaron aring -15
+KPX rcaron atilde -15
+KPX rcaron c -37
+KPX rcaron cacute -37
+KPX rcaron ccaron -37
+KPX rcaron ccedilla -37
+KPX rcaron comma -111
+KPX rcaron d -37
+KPX rcaron dcroat -37
+KPX rcaron e -37
+KPX rcaron eacute -37
+KPX rcaron ecaron -37
+KPX rcaron ecircumflex -37
+KPX rcaron edieresis -37
+KPX rcaron edotaccent -37
+KPX rcaron egrave -37
+KPX rcaron emacron -37
+KPX rcaron eogonek -37
+KPX rcaron g -37
+KPX rcaron gbreve -37
+KPX rcaron gcommaaccent -37
+KPX rcaron hyphen -20
+KPX rcaron o -45
+KPX rcaron oacute -45
+KPX rcaron ocircumflex -45
+KPX rcaron odieresis -45
+KPX rcaron ograve -45
+KPX rcaron ohungarumlaut -45
+KPX rcaron omacron -45
+KPX rcaron oslash -45
+KPX rcaron otilde -45
+KPX rcaron period -111
+KPX rcaron q -37
+KPX rcaron s -10
+KPX rcaron sacute -10
+KPX rcaron scaron -10
+KPX rcaron scedilla -10
+KPX rcaron scommaaccent -10
+KPX rcommaaccent a -15
+KPX rcommaaccent aacute -15
+KPX rcommaaccent abreve -15
+KPX rcommaaccent acircumflex -15
+KPX rcommaaccent adieresis -15
+KPX rcommaaccent agrave -15
+KPX rcommaaccent amacron -15
+KPX rcommaaccent aogonek -15
+KPX rcommaaccent aring -15
+KPX rcommaaccent atilde -15
+KPX rcommaaccent c -37
+KPX rcommaaccent cacute -37
+KPX rcommaaccent ccaron -37
+KPX rcommaaccent ccedilla -37
+KPX rcommaaccent comma -111
+KPX rcommaaccent d -37
+KPX rcommaaccent dcroat -37
+KPX rcommaaccent e -37
+KPX rcommaaccent eacute -37
+KPX rcommaaccent ecaron -37
+KPX rcommaaccent ecircumflex -37
+KPX rcommaaccent edieresis -37
+KPX rcommaaccent edotaccent -37
+KPX rcommaaccent egrave -37
+KPX rcommaaccent emacron -37
+KPX rcommaaccent eogonek -37
+KPX rcommaaccent g -37
+KPX rcommaaccent gbreve -37
+KPX rcommaaccent gcommaaccent -37
+KPX rcommaaccent hyphen -20
+KPX rcommaaccent o -45
+KPX rcommaaccent oacute -45
+KPX rcommaaccent ocircumflex -45
+KPX rcommaaccent odieresis -45
+KPX rcommaaccent ograve -45
+KPX rcommaaccent ohungarumlaut -45
+KPX rcommaaccent omacron -45
+KPX rcommaaccent oslash -45
+KPX rcommaaccent otilde -45
+KPX rcommaaccent period -111
+KPX rcommaaccent q -37
+KPX rcommaaccent s -10
+KPX rcommaaccent sacute -10
+KPX rcommaaccent scaron -10
+KPX rcommaaccent scedilla -10
+KPX rcommaaccent scommaaccent -10
+KPX space A -18
+KPX space Aacute -18
+KPX space Abreve -18
+KPX space Acircumflex -18
+KPX space Adieresis -18
+KPX space Agrave -18
+KPX space Amacron -18
+KPX space Aogonek -18
+KPX space Aring -18
+KPX space Atilde -18
+KPX space T -18
+KPX space Tcaron -18
+KPX space Tcommaaccent -18
+KPX space V -35
+KPX space W -40
+KPX space Y -75
+KPX space Yacute -75
+KPX space Ydieresis -75
+KPX v comma -74
+KPX v period -74
+KPX w comma -74
+KPX w period -74
+KPX y comma -55
+KPX y period -55
+KPX yacute comma -55
+KPX yacute period -55
+KPX ydieresis comma -55
+KPX ydieresis period -55
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Roman.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Roman.afm
new file mode 100644
index 0000000000000000000000000000000000000000..a0953f2802cbde4ca95c212f21195b55c0bc5a42
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Roman.afm
@@ -0,0 +1,2419 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 12:49:17 1997
+Comment UniqueID 43068
+Comment VMusage 43909 54934
+FontName Times-Roman
+FullName Times Roman
+FamilyName Times
+Weight Roman
+ItalicAngle 0
+IsFixedPitch false
+CharacterSet ExtendedRoman
+FontBBox -168 -218 1000 898
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1989, 1990, 1993, 1997 Adobe Systems Incorporated. All Rights Reserved.Times is a trademark of Linotype-Hell AG and/or its subsidiaries.
+EncodingScheme AdobeStandardEncoding
+CapHeight 662
+XHeight 450
+Ascender 683
+Descender -217
+StdHW 28
+StdVW 84
+StartCharMetrics 315
+C 32 ; WX 250 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 333 ; N exclam ; B 130 -9 238 676 ;
+C 34 ; WX 408 ; N quotedbl ; B 77 431 331 676 ;
+C 35 ; WX 500 ; N numbersign ; B 5 0 496 662 ;
+C 36 ; WX 500 ; N dollar ; B 44 -87 457 727 ;
+C 37 ; WX 833 ; N percent ; B 61 -13 772 676 ;
+C 38 ; WX 778 ; N ampersand ; B 42 -13 750 676 ;
+C 39 ; WX 333 ; N quoteright ; B 79 433 218 676 ;
+C 40 ; WX 333 ; N parenleft ; B 48 -177 304 676 ;
+C 41 ; WX 333 ; N parenright ; B 29 -177 285 676 ;
+C 42 ; WX 500 ; N asterisk ; B 69 265 432 676 ;
+C 43 ; WX 564 ; N plus ; B 30 0 534 506 ;
+C 44 ; WX 250 ; N comma ; B 56 -141 195 102 ;
+C 45 ; WX 333 ; N hyphen ; B 39 194 285 257 ;
+C 46 ; WX 250 ; N period ; B 70 -11 181 100 ;
+C 47 ; WX 278 ; N slash ; B -9 -14 287 676 ;
+C 48 ; WX 500 ; N zero ; B 24 -14 476 676 ;
+C 49 ; WX 500 ; N one ; B 111 0 394 676 ;
+C 50 ; WX 500 ; N two ; B 30 0 475 676 ;
+C 51 ; WX 500 ; N three ; B 43 -14 431 676 ;
+C 52 ; WX 500 ; N four ; B 12 0 472 676 ;
+C 53 ; WX 500 ; N five ; B 32 -14 438 688 ;
+C 54 ; WX 500 ; N six ; B 34 -14 468 684 ;
+C 55 ; WX 500 ; N seven ; B 20 -8 449 662 ;
+C 56 ; WX 500 ; N eight ; B 56 -14 445 676 ;
+C 57 ; WX 500 ; N nine ; B 30 -22 459 676 ;
+C 58 ; WX 278 ; N colon ; B 81 -11 192 459 ;
+C 59 ; WX 278 ; N semicolon ; B 80 -141 219 459 ;
+C 60 ; WX 564 ; N less ; B 28 -8 536 514 ;
+C 61 ; WX 564 ; N equal ; B 30 120 534 386 ;
+C 62 ; WX 564 ; N greater ; B 28 -8 536 514 ;
+C 63 ; WX 444 ; N question ; B 68 -8 414 676 ;
+C 64 ; WX 921 ; N at ; B 116 -14 809 676 ;
+C 65 ; WX 722 ; N A ; B 15 0 706 674 ;
+C 66 ; WX 667 ; N B ; B 17 0 593 662 ;
+C 67 ; WX 667 ; N C ; B 28 -14 633 676 ;
+C 68 ; WX 722 ; N D ; B 16 0 685 662 ;
+C 69 ; WX 611 ; N E ; B 12 0 597 662 ;
+C 70 ; WX 556 ; N F ; B 12 0 546 662 ;
+C 71 ; WX 722 ; N G ; B 32 -14 709 676 ;
+C 72 ; WX 722 ; N H ; B 19 0 702 662 ;
+C 73 ; WX 333 ; N I ; B 18 0 315 662 ;
+C 74 ; WX 389 ; N J ; B 10 -14 370 662 ;
+C 75 ; WX 722 ; N K ; B 34 0 723 662 ;
+C 76 ; WX 611 ; N L ; B 12 0 598 662 ;
+C 77 ; WX 889 ; N M ; B 12 0 863 662 ;
+C 78 ; WX 722 ; N N ; B 12 -11 707 662 ;
+C 79 ; WX 722 ; N O ; B 34 -14 688 676 ;
+C 80 ; WX 556 ; N P ; B 16 0 542 662 ;
+C 81 ; WX 722 ; N Q ; B 34 -178 701 676 ;
+C 82 ; WX 667 ; N R ; B 17 0 659 662 ;
+C 83 ; WX 556 ; N S ; B 42 -14 491 676 ;
+C 84 ; WX 611 ; N T ; B 17 0 593 662 ;
+C 85 ; WX 722 ; N U ; B 14 -14 705 662 ;
+C 86 ; WX 722 ; N V ; B 16 -11 697 662 ;
+C 87 ; WX 944 ; N W ; B 5 -11 932 662 ;
+C 88 ; WX 722 ; N X ; B 10 0 704 662 ;
+C 89 ; WX 722 ; N Y ; B 22 0 703 662 ;
+C 90 ; WX 611 ; N Z ; B 9 0 597 662 ;
+C 91 ; WX 333 ; N bracketleft ; B 88 -156 299 662 ;
+C 92 ; WX 278 ; N backslash ; B -9 -14 287 676 ;
+C 93 ; WX 333 ; N bracketright ; B 34 -156 245 662 ;
+C 94 ; WX 469 ; N asciicircum ; B 24 297 446 662 ;
+C 95 ; WX 500 ; N underscore ; B 0 -125 500 -75 ;
+C 96 ; WX 333 ; N quoteleft ; B 115 433 254 676 ;
+C 97 ; WX 444 ; N a ; B 37 -10 442 460 ;
+C 98 ; WX 500 ; N b ; B 3 -10 468 683 ;
+C 99 ; WX 444 ; N c ; B 25 -10 412 460 ;
+C 100 ; WX 500 ; N d ; B 27 -10 491 683 ;
+C 101 ; WX 444 ; N e ; B 25 -10 424 460 ;
+C 102 ; WX 333 ; N f ; B 20 0 383 683 ; L i fi ; L l fl ;
+C 103 ; WX 500 ; N g ; B 28 -218 470 460 ;
+C 104 ; WX 500 ; N h ; B 9 0 487 683 ;
+C 105 ; WX 278 ; N i ; B 16 0 253 683 ;
+C 106 ; WX 278 ; N j ; B -70 -218 194 683 ;
+C 107 ; WX 500 ; N k ; B 7 0 505 683 ;
+C 108 ; WX 278 ; N l ; B 19 0 257 683 ;
+C 109 ; WX 778 ; N m ; B 16 0 775 460 ;
+C 110 ; WX 500 ; N n ; B 16 0 485 460 ;
+C 111 ; WX 500 ; N o ; B 29 -10 470 460 ;
+C 112 ; WX 500 ; N p ; B 5 -217 470 460 ;
+C 113 ; WX 500 ; N q ; B 24 -217 488 460 ;
+C 114 ; WX 333 ; N r ; B 5 0 335 460 ;
+C 115 ; WX 389 ; N s ; B 51 -10 348 460 ;
+C 116 ; WX 278 ; N t ; B 13 -10 279 579 ;
+C 117 ; WX 500 ; N u ; B 9 -10 479 450 ;
+C 118 ; WX 500 ; N v ; B 19 -14 477 450 ;
+C 119 ; WX 722 ; N w ; B 21 -14 694 450 ;
+C 120 ; WX 500 ; N x ; B 17 0 479 450 ;
+C 121 ; WX 500 ; N y ; B 14 -218 475 450 ;
+C 122 ; WX 444 ; N z ; B 27 0 418 450 ;
+C 123 ; WX 480 ; N braceleft ; B 100 -181 350 680 ;
+C 124 ; WX 200 ; N bar ; B 67 -218 133 782 ;
+C 125 ; WX 480 ; N braceright ; B 130 -181 380 680 ;
+C 126 ; WX 541 ; N asciitilde ; B 40 183 502 323 ;
+C 161 ; WX 333 ; N exclamdown ; B 97 -218 205 467 ;
+C 162 ; WX 500 ; N cent ; B 53 -138 448 579 ;
+C 163 ; WX 500 ; N sterling ; B 12 -8 490 676 ;
+C 164 ; WX 167 ; N fraction ; B -168 -14 331 676 ;
+C 165 ; WX 500 ; N yen ; B -53 0 512 662 ;
+C 166 ; WX 500 ; N florin ; B 7 -189 490 676 ;
+C 167 ; WX 500 ; N section ; B 70 -148 426 676 ;
+C 168 ; WX 500 ; N currency ; B -22 58 522 602 ;
+C 169 ; WX 180 ; N quotesingle ; B 48 431 133 676 ;
+C 170 ; WX 444 ; N quotedblleft ; B 43 433 414 676 ;
+C 171 ; WX 500 ; N guillemotleft ; B 42 33 456 416 ;
+C 172 ; WX 333 ; N guilsinglleft ; B 63 33 285 416 ;
+C 173 ; WX 333 ; N guilsinglright ; B 48 33 270 416 ;
+C 174 ; WX 556 ; N fi ; B 31 0 521 683 ;
+C 175 ; WX 556 ; N fl ; B 32 0 521 683 ;
+C 177 ; WX 500 ; N endash ; B 0 201 500 250 ;
+C 178 ; WX 500 ; N dagger ; B 59 -149 442 676 ;
+C 179 ; WX 500 ; N daggerdbl ; B 58 -153 442 676 ;
+C 180 ; WX 250 ; N periodcentered ; B 70 199 181 310 ;
+C 182 ; WX 453 ; N paragraph ; B -22 -154 450 662 ;
+C 183 ; WX 350 ; N bullet ; B 40 196 310 466 ;
+C 184 ; WX 333 ; N quotesinglbase ; B 79 -141 218 102 ;
+C 185 ; WX 444 ; N quotedblbase ; B 45 -141 416 102 ;
+C 186 ; WX 444 ; N quotedblright ; B 30 433 401 676 ;
+C 187 ; WX 500 ; N guillemotright ; B 44 33 458 416 ;
+C 188 ; WX 1000 ; N ellipsis ; B 111 -11 888 100 ;
+C 189 ; WX 1000 ; N perthousand ; B 7 -19 994 706 ;
+C 191 ; WX 444 ; N questiondown ; B 30 -218 376 466 ;
+C 193 ; WX 333 ; N grave ; B 19 507 242 678 ;
+C 194 ; WX 333 ; N acute ; B 93 507 317 678 ;
+C 195 ; WX 333 ; N circumflex ; B 11 507 322 674 ;
+C 196 ; WX 333 ; N tilde ; B 1 532 331 638 ;
+C 197 ; WX 333 ; N macron ; B 11 547 322 601 ;
+C 198 ; WX 333 ; N breve ; B 26 507 307 664 ;
+C 199 ; WX 333 ; N dotaccent ; B 118 581 216 681 ;
+C 200 ; WX 333 ; N dieresis ; B 18 581 315 681 ;
+C 202 ; WX 333 ; N ring ; B 67 512 266 711 ;
+C 203 ; WX 333 ; N cedilla ; B 52 -215 261 0 ;
+C 205 ; WX 333 ; N hungarumlaut ; B -3 507 377 678 ;
+C 206 ; WX 333 ; N ogonek ; B 62 -165 243 0 ;
+C 207 ; WX 333 ; N caron ; B 11 507 322 674 ;
+C 208 ; WX 1000 ; N emdash ; B 0 201 1000 250 ;
+C 225 ; WX 889 ; N AE ; B 0 0 863 662 ;
+C 227 ; WX 276 ; N ordfeminine ; B 4 394 270 676 ;
+C 232 ; WX 611 ; N Lslash ; B 12 0 598 662 ;
+C 233 ; WX 722 ; N Oslash ; B 34 -80 688 734 ;
+C 234 ; WX 889 ; N OE ; B 30 -6 885 668 ;
+C 235 ; WX 310 ; N ordmasculine ; B 6 394 304 676 ;
+C 241 ; WX 667 ; N ae ; B 38 -10 632 460 ;
+C 245 ; WX 278 ; N dotlessi ; B 16 0 253 460 ;
+C 248 ; WX 278 ; N lslash ; B 19 0 259 683 ;
+C 249 ; WX 500 ; N oslash ; B 29 -112 470 551 ;
+C 250 ; WX 722 ; N oe ; B 30 -10 690 460 ;
+C 251 ; WX 500 ; N germandbls ; B 12 -9 468 683 ;
+C -1 ; WX 333 ; N Idieresis ; B 18 0 315 835 ;
+C -1 ; WX 444 ; N eacute ; B 25 -10 424 678 ;
+C -1 ; WX 444 ; N abreve ; B 37 -10 442 664 ;
+C -1 ; WX 500 ; N uhungarumlaut ; B 9 -10 501 678 ;
+C -1 ; WX 444 ; N ecaron ; B 25 -10 424 674 ;
+C -1 ; WX 722 ; N Ydieresis ; B 22 0 703 835 ;
+C -1 ; WX 564 ; N divide ; B 30 -10 534 516 ;
+C -1 ; WX 722 ; N Yacute ; B 22 0 703 890 ;
+C -1 ; WX 722 ; N Acircumflex ; B 15 0 706 886 ;
+C -1 ; WX 444 ; N aacute ; B 37 -10 442 678 ;
+C -1 ; WX 722 ; N Ucircumflex ; B 14 -14 705 886 ;
+C -1 ; WX 500 ; N yacute ; B 14 -218 475 678 ;
+C -1 ; WX 389 ; N scommaaccent ; B 51 -218 348 460 ;
+C -1 ; WX 444 ; N ecircumflex ; B 25 -10 424 674 ;
+C -1 ; WX 722 ; N Uring ; B 14 -14 705 898 ;
+C -1 ; WX 722 ; N Udieresis ; B 14 -14 705 835 ;
+C -1 ; WX 444 ; N aogonek ; B 37 -165 469 460 ;
+C -1 ; WX 722 ; N Uacute ; B 14 -14 705 890 ;
+C -1 ; WX 500 ; N uogonek ; B 9 -155 487 450 ;
+C -1 ; WX 611 ; N Edieresis ; B 12 0 597 835 ;
+C -1 ; WX 722 ; N Dcroat ; B 16 0 685 662 ;
+C -1 ; WX 250 ; N commaaccent ; B 59 -218 184 -50 ;
+C -1 ; WX 760 ; N copyright ; B 38 -14 722 676 ;
+C -1 ; WX 611 ; N Emacron ; B 12 0 597 813 ;
+C -1 ; WX 444 ; N ccaron ; B 25 -10 412 674 ;
+C -1 ; WX 444 ; N aring ; B 37 -10 442 711 ;
+C -1 ; WX 722 ; N Ncommaaccent ; B 12 -198 707 662 ;
+C -1 ; WX 278 ; N lacute ; B 19 0 290 890 ;
+C -1 ; WX 444 ; N agrave ; B 37 -10 442 678 ;
+C -1 ; WX 611 ; N Tcommaaccent ; B 17 -218 593 662 ;
+C -1 ; WX 667 ; N Cacute ; B 28 -14 633 890 ;
+C -1 ; WX 444 ; N atilde ; B 37 -10 442 638 ;
+C -1 ; WX 611 ; N Edotaccent ; B 12 0 597 835 ;
+C -1 ; WX 389 ; N scaron ; B 39 -10 350 674 ;
+C -1 ; WX 389 ; N scedilla ; B 51 -215 348 460 ;
+C -1 ; WX 278 ; N iacute ; B 16 0 290 678 ;
+C -1 ; WX 471 ; N lozenge ; B 13 0 459 724 ;
+C -1 ; WX 667 ; N Rcaron ; B 17 0 659 886 ;
+C -1 ; WX 722 ; N Gcommaaccent ; B 32 -218 709 676 ;
+C -1 ; WX 500 ; N ucircumflex ; B 9 -10 479 674 ;
+C -1 ; WX 444 ; N acircumflex ; B 37 -10 442 674 ;
+C -1 ; WX 722 ; N Amacron ; B 15 0 706 813 ;
+C -1 ; WX 333 ; N rcaron ; B 5 0 335 674 ;
+C -1 ; WX 444 ; N ccedilla ; B 25 -215 412 460 ;
+C -1 ; WX 611 ; N Zdotaccent ; B 9 0 597 835 ;
+C -1 ; WX 556 ; N Thorn ; B 16 0 542 662 ;
+C -1 ; WX 722 ; N Omacron ; B 34 -14 688 813 ;
+C -1 ; WX 667 ; N Racute ; B 17 0 659 890 ;
+C -1 ; WX 556 ; N Sacute ; B 42 -14 491 890 ;
+C -1 ; WX 588 ; N dcaron ; B 27 -10 589 695 ;
+C -1 ; WX 722 ; N Umacron ; B 14 -14 705 813 ;
+C -1 ; WX 500 ; N uring ; B 9 -10 479 711 ;
+C -1 ; WX 300 ; N threesuperior ; B 15 262 291 676 ;
+C -1 ; WX 722 ; N Ograve ; B 34 -14 688 890 ;
+C -1 ; WX 722 ; N Agrave ; B 15 0 706 890 ;
+C -1 ; WX 722 ; N Abreve ; B 15 0 706 876 ;
+C -1 ; WX 564 ; N multiply ; B 38 8 527 497 ;
+C -1 ; WX 500 ; N uacute ; B 9 -10 479 678 ;
+C -1 ; WX 611 ; N Tcaron ; B 17 0 593 886 ;
+C -1 ; WX 476 ; N partialdiff ; B 17 -38 459 710 ;
+C -1 ; WX 500 ; N ydieresis ; B 14 -218 475 623 ;
+C -1 ; WX 722 ; N Nacute ; B 12 -11 707 890 ;
+C -1 ; WX 278 ; N icircumflex ; B -16 0 295 674 ;
+C -1 ; WX 611 ; N Ecircumflex ; B 12 0 597 886 ;
+C -1 ; WX 444 ; N adieresis ; B 37 -10 442 623 ;
+C -1 ; WX 444 ; N edieresis ; B 25 -10 424 623 ;
+C -1 ; WX 444 ; N cacute ; B 25 -10 413 678 ;
+C -1 ; WX 500 ; N nacute ; B 16 0 485 678 ;
+C -1 ; WX 500 ; N umacron ; B 9 -10 479 601 ;
+C -1 ; WX 722 ; N Ncaron ; B 12 -11 707 886 ;
+C -1 ; WX 333 ; N Iacute ; B 18 0 317 890 ;
+C -1 ; WX 564 ; N plusminus ; B 30 0 534 506 ;
+C -1 ; WX 200 ; N brokenbar ; B 67 -143 133 707 ;
+C -1 ; WX 760 ; N registered ; B 38 -14 722 676 ;
+C -1 ; WX 722 ; N Gbreve ; B 32 -14 709 876 ;
+C -1 ; WX 333 ; N Idotaccent ; B 18 0 315 835 ;
+C -1 ; WX 600 ; N summation ; B 15 -10 585 706 ;
+C -1 ; WX 611 ; N Egrave ; B 12 0 597 890 ;
+C -1 ; WX 333 ; N racute ; B 5 0 335 678 ;
+C -1 ; WX 500 ; N omacron ; B 29 -10 470 601 ;
+C -1 ; WX 611 ; N Zacute ; B 9 0 597 890 ;
+C -1 ; WX 611 ; N Zcaron ; B 9 0 597 886 ;
+C -1 ; WX 549 ; N greaterequal ; B 26 0 523 666 ;
+C -1 ; WX 722 ; N Eth ; B 16 0 685 662 ;
+C -1 ; WX 667 ; N Ccedilla ; B 28 -215 633 676 ;
+C -1 ; WX 278 ; N lcommaaccent ; B 19 -218 257 683 ;
+C -1 ; WX 326 ; N tcaron ; B 13 -10 318 722 ;
+C -1 ; WX 444 ; N eogonek ; B 25 -165 424 460 ;
+C -1 ; WX 722 ; N Uogonek ; B 14 -165 705 662 ;
+C -1 ; WX 722 ; N Aacute ; B 15 0 706 890 ;
+C -1 ; WX 722 ; N Adieresis ; B 15 0 706 835 ;
+C -1 ; WX 444 ; N egrave ; B 25 -10 424 678 ;
+C -1 ; WX 444 ; N zacute ; B 27 0 418 678 ;
+C -1 ; WX 278 ; N iogonek ; B 16 -165 265 683 ;
+C -1 ; WX 722 ; N Oacute ; B 34 -14 688 890 ;
+C -1 ; WX 500 ; N oacute ; B 29 -10 470 678 ;
+C -1 ; WX 444 ; N amacron ; B 37 -10 442 601 ;
+C -1 ; WX 389 ; N sacute ; B 51 -10 348 678 ;
+C -1 ; WX 278 ; N idieresis ; B -9 0 288 623 ;
+C -1 ; WX 722 ; N Ocircumflex ; B 34 -14 688 886 ;
+C -1 ; WX 722 ; N Ugrave ; B 14 -14 705 890 ;
+C -1 ; WX 612 ; N Delta ; B 6 0 608 688 ;
+C -1 ; WX 500 ; N thorn ; B 5 -217 470 683 ;
+C -1 ; WX 300 ; N twosuperior ; B 1 270 296 676 ;
+C -1 ; WX 722 ; N Odieresis ; B 34 -14 688 835 ;
+C -1 ; WX 500 ; N mu ; B 36 -218 512 450 ;
+C -1 ; WX 278 ; N igrave ; B -8 0 253 678 ;
+C -1 ; WX 500 ; N ohungarumlaut ; B 29 -10 491 678 ;
+C -1 ; WX 611 ; N Eogonek ; B 12 -165 597 662 ;
+C -1 ; WX 500 ; N dcroat ; B 27 -10 500 683 ;
+C -1 ; WX 750 ; N threequarters ; B 15 -14 718 676 ;
+C -1 ; WX 556 ; N Scedilla ; B 42 -215 491 676 ;
+C -1 ; WX 344 ; N lcaron ; B 19 0 347 695 ;
+C -1 ; WX 722 ; N Kcommaaccent ; B 34 -198 723 662 ;
+C -1 ; WX 611 ; N Lacute ; B 12 0 598 890 ;
+C -1 ; WX 980 ; N trademark ; B 30 256 957 662 ;
+C -1 ; WX 444 ; N edotaccent ; B 25 -10 424 623 ;
+C -1 ; WX 333 ; N Igrave ; B 18 0 315 890 ;
+C -1 ; WX 333 ; N Imacron ; B 11 0 322 813 ;
+C -1 ; WX 611 ; N Lcaron ; B 12 0 598 676 ;
+C -1 ; WX 750 ; N onehalf ; B 31 -14 746 676 ;
+C -1 ; WX 549 ; N lessequal ; B 26 0 523 666 ;
+C -1 ; WX 500 ; N ocircumflex ; B 29 -10 470 674 ;
+C -1 ; WX 500 ; N ntilde ; B 16 0 485 638 ;
+C -1 ; WX 722 ; N Uhungarumlaut ; B 14 -14 705 890 ;
+C -1 ; WX 611 ; N Eacute ; B 12 0 597 890 ;
+C -1 ; WX 444 ; N emacron ; B 25 -10 424 601 ;
+C -1 ; WX 500 ; N gbreve ; B 28 -218 470 664 ;
+C -1 ; WX 750 ; N onequarter ; B 37 -14 718 676 ;
+C -1 ; WX 556 ; N Scaron ; B 42 -14 491 886 ;
+C -1 ; WX 556 ; N Scommaaccent ; B 42 -218 491 676 ;
+C -1 ; WX 722 ; N Ohungarumlaut ; B 34 -14 688 890 ;
+C -1 ; WX 400 ; N degree ; B 57 390 343 676 ;
+C -1 ; WX 500 ; N ograve ; B 29 -10 470 678 ;
+C -1 ; WX 667 ; N Ccaron ; B 28 -14 633 886 ;
+C -1 ; WX 500 ; N ugrave ; B 9 -10 479 678 ;
+C -1 ; WX 453 ; N radical ; B 2 -60 452 768 ;
+C -1 ; WX 722 ; N Dcaron ; B 16 0 685 886 ;
+C -1 ; WX 333 ; N rcommaaccent ; B 5 -218 335 460 ;
+C -1 ; WX 722 ; N Ntilde ; B 12 -11 707 850 ;
+C -1 ; WX 500 ; N otilde ; B 29 -10 470 638 ;
+C -1 ; WX 667 ; N Rcommaaccent ; B 17 -198 659 662 ;
+C -1 ; WX 611 ; N Lcommaaccent ; B 12 -218 598 662 ;
+C -1 ; WX 722 ; N Atilde ; B 15 0 706 850 ;
+C -1 ; WX 722 ; N Aogonek ; B 15 -165 738 674 ;
+C -1 ; WX 722 ; N Aring ; B 15 0 706 898 ;
+C -1 ; WX 722 ; N Otilde ; B 34 -14 688 850 ;
+C -1 ; WX 444 ; N zdotaccent ; B 27 0 418 623 ;
+C -1 ; WX 611 ; N Ecaron ; B 12 0 597 886 ;
+C -1 ; WX 333 ; N Iogonek ; B 18 -165 315 662 ;
+C -1 ; WX 500 ; N kcommaaccent ; B 7 -218 505 683 ;
+C -1 ; WX 564 ; N minus ; B 30 220 534 286 ;
+C -1 ; WX 333 ; N Icircumflex ; B 11 0 322 886 ;
+C -1 ; WX 500 ; N ncaron ; B 16 0 485 674 ;
+C -1 ; WX 278 ; N tcommaaccent ; B 13 -218 279 579 ;
+C -1 ; WX 564 ; N logicalnot ; B 30 108 534 386 ;
+C -1 ; WX 500 ; N odieresis ; B 29 -10 470 623 ;
+C -1 ; WX 500 ; N udieresis ; B 9 -10 479 623 ;
+C -1 ; WX 549 ; N notequal ; B 12 -31 537 547 ;
+C -1 ; WX 500 ; N gcommaaccent ; B 28 -218 470 749 ;
+C -1 ; WX 500 ; N eth ; B 29 -10 471 686 ;
+C -1 ; WX 444 ; N zcaron ; B 27 0 418 674 ;
+C -1 ; WX 500 ; N ncommaaccent ; B 16 -218 485 460 ;
+C -1 ; WX 300 ; N onesuperior ; B 57 270 248 676 ;
+C -1 ; WX 278 ; N imacron ; B 6 0 271 601 ;
+C -1 ; WX 500 ; N Euro ; B 0 0 0 0 ;
+EndCharMetrics
+StartKernData
+StartKernPairs 2073
+KPX A C -40
+KPX A Cacute -40
+KPX A Ccaron -40
+KPX A Ccedilla -40
+KPX A G -40
+KPX A Gbreve -40
+KPX A Gcommaaccent -40
+KPX A O -55
+KPX A Oacute -55
+KPX A Ocircumflex -55
+KPX A Odieresis -55
+KPX A Ograve -55
+KPX A Ohungarumlaut -55
+KPX A Omacron -55
+KPX A Oslash -55
+KPX A Otilde -55
+KPX A Q -55
+KPX A T -111
+KPX A Tcaron -111
+KPX A Tcommaaccent -111
+KPX A U -55
+KPX A Uacute -55
+KPX A Ucircumflex -55
+KPX A Udieresis -55
+KPX A Ugrave -55
+KPX A Uhungarumlaut -55
+KPX A Umacron -55
+KPX A Uogonek -55
+KPX A Uring -55
+KPX A V -135
+KPX A W -90
+KPX A Y -105
+KPX A Yacute -105
+KPX A Ydieresis -105
+KPX A quoteright -111
+KPX A v -74
+KPX A w -92
+KPX A y -92
+KPX A yacute -92
+KPX A ydieresis -92
+KPX Aacute C -40
+KPX Aacute Cacute -40
+KPX Aacute Ccaron -40
+KPX Aacute Ccedilla -40
+KPX Aacute G -40
+KPX Aacute Gbreve -40
+KPX Aacute Gcommaaccent -40
+KPX Aacute O -55
+KPX Aacute Oacute -55
+KPX Aacute Ocircumflex -55
+KPX Aacute Odieresis -55
+KPX Aacute Ograve -55
+KPX Aacute Ohungarumlaut -55
+KPX Aacute Omacron -55
+KPX Aacute Oslash -55
+KPX Aacute Otilde -55
+KPX Aacute Q -55
+KPX Aacute T -111
+KPX Aacute Tcaron -111
+KPX Aacute Tcommaaccent -111
+KPX Aacute U -55
+KPX Aacute Uacute -55
+KPX Aacute Ucircumflex -55
+KPX Aacute Udieresis -55
+KPX Aacute Ugrave -55
+KPX Aacute Uhungarumlaut -55
+KPX Aacute Umacron -55
+KPX Aacute Uogonek -55
+KPX Aacute Uring -55
+KPX Aacute V -135
+KPX Aacute W -90
+KPX Aacute Y -105
+KPX Aacute Yacute -105
+KPX Aacute Ydieresis -105
+KPX Aacute quoteright -111
+KPX Aacute v -74
+KPX Aacute w -92
+KPX Aacute y -92
+KPX Aacute yacute -92
+KPX Aacute ydieresis -92
+KPX Abreve C -40
+KPX Abreve Cacute -40
+KPX Abreve Ccaron -40
+KPX Abreve Ccedilla -40
+KPX Abreve G -40
+KPX Abreve Gbreve -40
+KPX Abreve Gcommaaccent -40
+KPX Abreve O -55
+KPX Abreve Oacute -55
+KPX Abreve Ocircumflex -55
+KPX Abreve Odieresis -55
+KPX Abreve Ograve -55
+KPX Abreve Ohungarumlaut -55
+KPX Abreve Omacron -55
+KPX Abreve Oslash -55
+KPX Abreve Otilde -55
+KPX Abreve Q -55
+KPX Abreve T -111
+KPX Abreve Tcaron -111
+KPX Abreve Tcommaaccent -111
+KPX Abreve U -55
+KPX Abreve Uacute -55
+KPX Abreve Ucircumflex -55
+KPX Abreve Udieresis -55
+KPX Abreve Ugrave -55
+KPX Abreve Uhungarumlaut -55
+KPX Abreve Umacron -55
+KPX Abreve Uogonek -55
+KPX Abreve Uring -55
+KPX Abreve V -135
+KPX Abreve W -90
+KPX Abreve Y -105
+KPX Abreve Yacute -105
+KPX Abreve Ydieresis -105
+KPX Abreve quoteright -111
+KPX Abreve v -74
+KPX Abreve w -92
+KPX Abreve y -92
+KPX Abreve yacute -92
+KPX Abreve ydieresis -92
+KPX Acircumflex C -40
+KPX Acircumflex Cacute -40
+KPX Acircumflex Ccaron -40
+KPX Acircumflex Ccedilla -40
+KPX Acircumflex G -40
+KPX Acircumflex Gbreve -40
+KPX Acircumflex Gcommaaccent -40
+KPX Acircumflex O -55
+KPX Acircumflex Oacute -55
+KPX Acircumflex Ocircumflex -55
+KPX Acircumflex Odieresis -55
+KPX Acircumflex Ograve -55
+KPX Acircumflex Ohungarumlaut -55
+KPX Acircumflex Omacron -55
+KPX Acircumflex Oslash -55
+KPX Acircumflex Otilde -55
+KPX Acircumflex Q -55
+KPX Acircumflex T -111
+KPX Acircumflex Tcaron -111
+KPX Acircumflex Tcommaaccent -111
+KPX Acircumflex U -55
+KPX Acircumflex Uacute -55
+KPX Acircumflex Ucircumflex -55
+KPX Acircumflex Udieresis -55
+KPX Acircumflex Ugrave -55
+KPX Acircumflex Uhungarumlaut -55
+KPX Acircumflex Umacron -55
+KPX Acircumflex Uogonek -55
+KPX Acircumflex Uring -55
+KPX Acircumflex V -135
+KPX Acircumflex W -90
+KPX Acircumflex Y -105
+KPX Acircumflex Yacute -105
+KPX Acircumflex Ydieresis -105
+KPX Acircumflex quoteright -111
+KPX Acircumflex v -74
+KPX Acircumflex w -92
+KPX Acircumflex y -92
+KPX Acircumflex yacute -92
+KPX Acircumflex ydieresis -92
+KPX Adieresis C -40
+KPX Adieresis Cacute -40
+KPX Adieresis Ccaron -40
+KPX Adieresis Ccedilla -40
+KPX Adieresis G -40
+KPX Adieresis Gbreve -40
+KPX Adieresis Gcommaaccent -40
+KPX Adieresis O -55
+KPX Adieresis Oacute -55
+KPX Adieresis Ocircumflex -55
+KPX Adieresis Odieresis -55
+KPX Adieresis Ograve -55
+KPX Adieresis Ohungarumlaut -55
+KPX Adieresis Omacron -55
+KPX Adieresis Oslash -55
+KPX Adieresis Otilde -55
+KPX Adieresis Q -55
+KPX Adieresis T -111
+KPX Adieresis Tcaron -111
+KPX Adieresis Tcommaaccent -111
+KPX Adieresis U -55
+KPX Adieresis Uacute -55
+KPX Adieresis Ucircumflex -55
+KPX Adieresis Udieresis -55
+KPX Adieresis Ugrave -55
+KPX Adieresis Uhungarumlaut -55
+KPX Adieresis Umacron -55
+KPX Adieresis Uogonek -55
+KPX Adieresis Uring -55
+KPX Adieresis V -135
+KPX Adieresis W -90
+KPX Adieresis Y -105
+KPX Adieresis Yacute -105
+KPX Adieresis Ydieresis -105
+KPX Adieresis quoteright -111
+KPX Adieresis v -74
+KPX Adieresis w -92
+KPX Adieresis y -92
+KPX Adieresis yacute -92
+KPX Adieresis ydieresis -92
+KPX Agrave C -40
+KPX Agrave Cacute -40
+KPX Agrave Ccaron -40
+KPX Agrave Ccedilla -40
+KPX Agrave G -40
+KPX Agrave Gbreve -40
+KPX Agrave Gcommaaccent -40
+KPX Agrave O -55
+KPX Agrave Oacute -55
+KPX Agrave Ocircumflex -55
+KPX Agrave Odieresis -55
+KPX Agrave Ograve -55
+KPX Agrave Ohungarumlaut -55
+KPX Agrave Omacron -55
+KPX Agrave Oslash -55
+KPX Agrave Otilde -55
+KPX Agrave Q -55
+KPX Agrave T -111
+KPX Agrave Tcaron -111
+KPX Agrave Tcommaaccent -111
+KPX Agrave U -55
+KPX Agrave Uacute -55
+KPX Agrave Ucircumflex -55
+KPX Agrave Udieresis -55
+KPX Agrave Ugrave -55
+KPX Agrave Uhungarumlaut -55
+KPX Agrave Umacron -55
+KPX Agrave Uogonek -55
+KPX Agrave Uring -55
+KPX Agrave V -135
+KPX Agrave W -90
+KPX Agrave Y -105
+KPX Agrave Yacute -105
+KPX Agrave Ydieresis -105
+KPX Agrave quoteright -111
+KPX Agrave v -74
+KPX Agrave w -92
+KPX Agrave y -92
+KPX Agrave yacute -92
+KPX Agrave ydieresis -92
+KPX Amacron C -40
+KPX Amacron Cacute -40
+KPX Amacron Ccaron -40
+KPX Amacron Ccedilla -40
+KPX Amacron G -40
+KPX Amacron Gbreve -40
+KPX Amacron Gcommaaccent -40
+KPX Amacron O -55
+KPX Amacron Oacute -55
+KPX Amacron Ocircumflex -55
+KPX Amacron Odieresis -55
+KPX Amacron Ograve -55
+KPX Amacron Ohungarumlaut -55
+KPX Amacron Omacron -55
+KPX Amacron Oslash -55
+KPX Amacron Otilde -55
+KPX Amacron Q -55
+KPX Amacron T -111
+KPX Amacron Tcaron -111
+KPX Amacron Tcommaaccent -111
+KPX Amacron U -55
+KPX Amacron Uacute -55
+KPX Amacron Ucircumflex -55
+KPX Amacron Udieresis -55
+KPX Amacron Ugrave -55
+KPX Amacron Uhungarumlaut -55
+KPX Amacron Umacron -55
+KPX Amacron Uogonek -55
+KPX Amacron Uring -55
+KPX Amacron V -135
+KPX Amacron W -90
+KPX Amacron Y -105
+KPX Amacron Yacute -105
+KPX Amacron Ydieresis -105
+KPX Amacron quoteright -111
+KPX Amacron v -74
+KPX Amacron w -92
+KPX Amacron y -92
+KPX Amacron yacute -92
+KPX Amacron ydieresis -92
+KPX Aogonek C -40
+KPX Aogonek Cacute -40
+KPX Aogonek Ccaron -40
+KPX Aogonek Ccedilla -40
+KPX Aogonek G -40
+KPX Aogonek Gbreve -40
+KPX Aogonek Gcommaaccent -40
+KPX Aogonek O -55
+KPX Aogonek Oacute -55
+KPX Aogonek Ocircumflex -55
+KPX Aogonek Odieresis -55
+KPX Aogonek Ograve -55
+KPX Aogonek Ohungarumlaut -55
+KPX Aogonek Omacron -55
+KPX Aogonek Oslash -55
+KPX Aogonek Otilde -55
+KPX Aogonek Q -55
+KPX Aogonek T -111
+KPX Aogonek Tcaron -111
+KPX Aogonek Tcommaaccent -111
+KPX Aogonek U -55
+KPX Aogonek Uacute -55
+KPX Aogonek Ucircumflex -55
+KPX Aogonek Udieresis -55
+KPX Aogonek Ugrave -55
+KPX Aogonek Uhungarumlaut -55
+KPX Aogonek Umacron -55
+KPX Aogonek Uogonek -55
+KPX Aogonek Uring -55
+KPX Aogonek V -135
+KPX Aogonek W -90
+KPX Aogonek Y -105
+KPX Aogonek Yacute -105
+KPX Aogonek Ydieresis -105
+KPX Aogonek quoteright -111
+KPX Aogonek v -74
+KPX Aogonek w -52
+KPX Aogonek y -52
+KPX Aogonek yacute -52
+KPX Aogonek ydieresis -52
+KPX Aring C -40
+KPX Aring Cacute -40
+KPX Aring Ccaron -40
+KPX Aring Ccedilla -40
+KPX Aring G -40
+KPX Aring Gbreve -40
+KPX Aring Gcommaaccent -40
+KPX Aring O -55
+KPX Aring Oacute -55
+KPX Aring Ocircumflex -55
+KPX Aring Odieresis -55
+KPX Aring Ograve -55
+KPX Aring Ohungarumlaut -55
+KPX Aring Omacron -55
+KPX Aring Oslash -55
+KPX Aring Otilde -55
+KPX Aring Q -55
+KPX Aring T -111
+KPX Aring Tcaron -111
+KPX Aring Tcommaaccent -111
+KPX Aring U -55
+KPX Aring Uacute -55
+KPX Aring Ucircumflex -55
+KPX Aring Udieresis -55
+KPX Aring Ugrave -55
+KPX Aring Uhungarumlaut -55
+KPX Aring Umacron -55
+KPX Aring Uogonek -55
+KPX Aring Uring -55
+KPX Aring V -135
+KPX Aring W -90
+KPX Aring Y -105
+KPX Aring Yacute -105
+KPX Aring Ydieresis -105
+KPX Aring quoteright -111
+KPX Aring v -74
+KPX Aring w -92
+KPX Aring y -92
+KPX Aring yacute -92
+KPX Aring ydieresis -92
+KPX Atilde C -40
+KPX Atilde Cacute -40
+KPX Atilde Ccaron -40
+KPX Atilde Ccedilla -40
+KPX Atilde G -40
+KPX Atilde Gbreve -40
+KPX Atilde Gcommaaccent -40
+KPX Atilde O -55
+KPX Atilde Oacute -55
+KPX Atilde Ocircumflex -55
+KPX Atilde Odieresis -55
+KPX Atilde Ograve -55
+KPX Atilde Ohungarumlaut -55
+KPX Atilde Omacron -55
+KPX Atilde Oslash -55
+KPX Atilde Otilde -55
+KPX Atilde Q -55
+KPX Atilde T -111
+KPX Atilde Tcaron -111
+KPX Atilde Tcommaaccent -111
+KPX Atilde U -55
+KPX Atilde Uacute -55
+KPX Atilde Ucircumflex -55
+KPX Atilde Udieresis -55
+KPX Atilde Ugrave -55
+KPX Atilde Uhungarumlaut -55
+KPX Atilde Umacron -55
+KPX Atilde Uogonek -55
+KPX Atilde Uring -55
+KPX Atilde V -135
+KPX Atilde W -90
+KPX Atilde Y -105
+KPX Atilde Yacute -105
+KPX Atilde Ydieresis -105
+KPX Atilde quoteright -111
+KPX Atilde v -74
+KPX Atilde w -92
+KPX Atilde y -92
+KPX Atilde yacute -92
+KPX Atilde ydieresis -92
+KPX B A -35
+KPX B Aacute -35
+KPX B Abreve -35
+KPX B Acircumflex -35
+KPX B Adieresis -35
+KPX B Agrave -35
+KPX B Amacron -35
+KPX B Aogonek -35
+KPX B Aring -35
+KPX B Atilde -35
+KPX B U -10
+KPX B Uacute -10
+KPX B Ucircumflex -10
+KPX B Udieresis -10
+KPX B Ugrave -10
+KPX B Uhungarumlaut -10
+KPX B Umacron -10
+KPX B Uogonek -10
+KPX B Uring -10
+KPX D A -40
+KPX D Aacute -40
+KPX D Abreve -40
+KPX D Acircumflex -40
+KPX D Adieresis -40
+KPX D Agrave -40
+KPX D Amacron -40
+KPX D Aogonek -40
+KPX D Aring -40
+KPX D Atilde -40
+KPX D V -40
+KPX D W -30
+KPX D Y -55
+KPX D Yacute -55
+KPX D Ydieresis -55
+KPX Dcaron A -40
+KPX Dcaron Aacute -40
+KPX Dcaron Abreve -40
+KPX Dcaron Acircumflex -40
+KPX Dcaron Adieresis -40
+KPX Dcaron Agrave -40
+KPX Dcaron Amacron -40
+KPX Dcaron Aogonek -40
+KPX Dcaron Aring -40
+KPX Dcaron Atilde -40
+KPX Dcaron V -40
+KPX Dcaron W -30
+KPX Dcaron Y -55
+KPX Dcaron Yacute -55
+KPX Dcaron Ydieresis -55
+KPX Dcroat A -40
+KPX Dcroat Aacute -40
+KPX Dcroat Abreve -40
+KPX Dcroat Acircumflex -40
+KPX Dcroat Adieresis -40
+KPX Dcroat Agrave -40
+KPX Dcroat Amacron -40
+KPX Dcroat Aogonek -40
+KPX Dcroat Aring -40
+KPX Dcroat Atilde -40
+KPX Dcroat V -40
+KPX Dcroat W -30
+KPX Dcroat Y -55
+KPX Dcroat Yacute -55
+KPX Dcroat Ydieresis -55
+KPX F A -74
+KPX F Aacute -74
+KPX F Abreve -74
+KPX F Acircumflex -74
+KPX F Adieresis -74
+KPX F Agrave -74
+KPX F Amacron -74
+KPX F Aogonek -74
+KPX F Aring -74
+KPX F Atilde -74
+KPX F a -15
+KPX F aacute -15
+KPX F abreve -15
+KPX F acircumflex -15
+KPX F adieresis -15
+KPX F agrave -15
+KPX F amacron -15
+KPX F aogonek -15
+KPX F aring -15
+KPX F atilde -15
+KPX F comma -80
+KPX F o -15
+KPX F oacute -15
+KPX F ocircumflex -15
+KPX F odieresis -15
+KPX F ograve -15
+KPX F ohungarumlaut -15
+KPX F omacron -15
+KPX F oslash -15
+KPX F otilde -15
+KPX F period -80
+KPX J A -60
+KPX J Aacute -60
+KPX J Abreve -60
+KPX J Acircumflex -60
+KPX J Adieresis -60
+KPX J Agrave -60
+KPX J Amacron -60
+KPX J Aogonek -60
+KPX J Aring -60
+KPX J Atilde -60
+KPX K O -30
+KPX K Oacute -30
+KPX K Ocircumflex -30
+KPX K Odieresis -30
+KPX K Ograve -30
+KPX K Ohungarumlaut -30
+KPX K Omacron -30
+KPX K Oslash -30
+KPX K Otilde -30
+KPX K e -25
+KPX K eacute -25
+KPX K ecaron -25
+KPX K ecircumflex -25
+KPX K edieresis -25
+KPX K edotaccent -25
+KPX K egrave -25
+KPX K emacron -25
+KPX K eogonek -25
+KPX K o -35
+KPX K oacute -35
+KPX K ocircumflex -35
+KPX K odieresis -35
+KPX K ograve -35
+KPX K ohungarumlaut -35
+KPX K omacron -35
+KPX K oslash -35
+KPX K otilde -35
+KPX K u -15
+KPX K uacute -15
+KPX K ucircumflex -15
+KPX K udieresis -15
+KPX K ugrave -15
+KPX K uhungarumlaut -15
+KPX K umacron -15
+KPX K uogonek -15
+KPX K uring -15
+KPX K y -25
+KPX K yacute -25
+KPX K ydieresis -25
+KPX Kcommaaccent O -30
+KPX Kcommaaccent Oacute -30
+KPX Kcommaaccent Ocircumflex -30
+KPX Kcommaaccent Odieresis -30
+KPX Kcommaaccent Ograve -30
+KPX Kcommaaccent Ohungarumlaut -30
+KPX Kcommaaccent Omacron -30
+KPX Kcommaaccent Oslash -30
+KPX Kcommaaccent Otilde -30
+KPX Kcommaaccent e -25
+KPX Kcommaaccent eacute -25
+KPX Kcommaaccent ecaron -25
+KPX Kcommaaccent ecircumflex -25
+KPX Kcommaaccent edieresis -25
+KPX Kcommaaccent edotaccent -25
+KPX Kcommaaccent egrave -25
+KPX Kcommaaccent emacron -25
+KPX Kcommaaccent eogonek -25
+KPX Kcommaaccent o -35
+KPX Kcommaaccent oacute -35
+KPX Kcommaaccent ocircumflex -35
+KPX Kcommaaccent odieresis -35
+KPX Kcommaaccent ograve -35
+KPX Kcommaaccent ohungarumlaut -35
+KPX Kcommaaccent omacron -35
+KPX Kcommaaccent oslash -35
+KPX Kcommaaccent otilde -35
+KPX Kcommaaccent u -15
+KPX Kcommaaccent uacute -15
+KPX Kcommaaccent ucircumflex -15
+KPX Kcommaaccent udieresis -15
+KPX Kcommaaccent ugrave -15
+KPX Kcommaaccent uhungarumlaut -15
+KPX Kcommaaccent umacron -15
+KPX Kcommaaccent uogonek -15
+KPX Kcommaaccent uring -15
+KPX Kcommaaccent y -25
+KPX Kcommaaccent yacute -25
+KPX Kcommaaccent ydieresis -25
+KPX L T -92
+KPX L Tcaron -92
+KPX L Tcommaaccent -92
+KPX L V -100
+KPX L W -74
+KPX L Y -100
+KPX L Yacute -100
+KPX L Ydieresis -100
+KPX L quoteright -92
+KPX L y -55
+KPX L yacute -55
+KPX L ydieresis -55
+KPX Lacute T -92
+KPX Lacute Tcaron -92
+KPX Lacute Tcommaaccent -92
+KPX Lacute V -100
+KPX Lacute W -74
+KPX Lacute Y -100
+KPX Lacute Yacute -100
+KPX Lacute Ydieresis -100
+KPX Lacute quoteright -92
+KPX Lacute y -55
+KPX Lacute yacute -55
+KPX Lacute ydieresis -55
+KPX Lcaron quoteright -92
+KPX Lcaron y -55
+KPX Lcaron yacute -55
+KPX Lcaron ydieresis -55
+KPX Lcommaaccent T -92
+KPX Lcommaaccent Tcaron -92
+KPX Lcommaaccent Tcommaaccent -92
+KPX Lcommaaccent V -100
+KPX Lcommaaccent W -74
+KPX Lcommaaccent Y -100
+KPX Lcommaaccent Yacute -100
+KPX Lcommaaccent Ydieresis -100
+KPX Lcommaaccent quoteright -92
+KPX Lcommaaccent y -55
+KPX Lcommaaccent yacute -55
+KPX Lcommaaccent ydieresis -55
+KPX Lslash T -92
+KPX Lslash Tcaron -92
+KPX Lslash Tcommaaccent -92
+KPX Lslash V -100
+KPX Lslash W -74
+KPX Lslash Y -100
+KPX Lslash Yacute -100
+KPX Lslash Ydieresis -100
+KPX Lslash quoteright -92
+KPX Lslash y -55
+KPX Lslash yacute -55
+KPX Lslash ydieresis -55
+KPX N A -35
+KPX N Aacute -35
+KPX N Abreve -35
+KPX N Acircumflex -35
+KPX N Adieresis -35
+KPX N Agrave -35
+KPX N Amacron -35
+KPX N Aogonek -35
+KPX N Aring -35
+KPX N Atilde -35
+KPX Nacute A -35
+KPX Nacute Aacute -35
+KPX Nacute Abreve -35
+KPX Nacute Acircumflex -35
+KPX Nacute Adieresis -35
+KPX Nacute Agrave -35
+KPX Nacute Amacron -35
+KPX Nacute Aogonek -35
+KPX Nacute Aring -35
+KPX Nacute Atilde -35
+KPX Ncaron A -35
+KPX Ncaron Aacute -35
+KPX Ncaron Abreve -35
+KPX Ncaron Acircumflex -35
+KPX Ncaron Adieresis -35
+KPX Ncaron Agrave -35
+KPX Ncaron Amacron -35
+KPX Ncaron Aogonek -35
+KPX Ncaron Aring -35
+KPX Ncaron Atilde -35
+KPX Ncommaaccent A -35
+KPX Ncommaaccent Aacute -35
+KPX Ncommaaccent Abreve -35
+KPX Ncommaaccent Acircumflex -35
+KPX Ncommaaccent Adieresis -35
+KPX Ncommaaccent Agrave -35
+KPX Ncommaaccent Amacron -35
+KPX Ncommaaccent Aogonek -35
+KPX Ncommaaccent Aring -35
+KPX Ncommaaccent Atilde -35
+KPX Ntilde A -35
+KPX Ntilde Aacute -35
+KPX Ntilde Abreve -35
+KPX Ntilde Acircumflex -35
+KPX Ntilde Adieresis -35
+KPX Ntilde Agrave -35
+KPX Ntilde Amacron -35
+KPX Ntilde Aogonek -35
+KPX Ntilde Aring -35
+KPX Ntilde Atilde -35
+KPX O A -35
+KPX O Aacute -35
+KPX O Abreve -35
+KPX O Acircumflex -35
+KPX O Adieresis -35
+KPX O Agrave -35
+KPX O Amacron -35
+KPX O Aogonek -35
+KPX O Aring -35
+KPX O Atilde -35
+KPX O T -40
+KPX O Tcaron -40
+KPX O Tcommaaccent -40
+KPX O V -50
+KPX O W -35
+KPX O X -40
+KPX O Y -50
+KPX O Yacute -50
+KPX O Ydieresis -50
+KPX Oacute A -35
+KPX Oacute Aacute -35
+KPX Oacute Abreve -35
+KPX Oacute Acircumflex -35
+KPX Oacute Adieresis -35
+KPX Oacute Agrave -35
+KPX Oacute Amacron -35
+KPX Oacute Aogonek -35
+KPX Oacute Aring -35
+KPX Oacute Atilde -35
+KPX Oacute T -40
+KPX Oacute Tcaron -40
+KPX Oacute Tcommaaccent -40
+KPX Oacute V -50
+KPX Oacute W -35
+KPX Oacute X -40
+KPX Oacute Y -50
+KPX Oacute Yacute -50
+KPX Oacute Ydieresis -50
+KPX Ocircumflex A -35
+KPX Ocircumflex Aacute -35
+KPX Ocircumflex Abreve -35
+KPX Ocircumflex Acircumflex -35
+KPX Ocircumflex Adieresis -35
+KPX Ocircumflex Agrave -35
+KPX Ocircumflex Amacron -35
+KPX Ocircumflex Aogonek -35
+KPX Ocircumflex Aring -35
+KPX Ocircumflex Atilde -35
+KPX Ocircumflex T -40
+KPX Ocircumflex Tcaron -40
+KPX Ocircumflex Tcommaaccent -40
+KPX Ocircumflex V -50
+KPX Ocircumflex W -35
+KPX Ocircumflex X -40
+KPX Ocircumflex Y -50
+KPX Ocircumflex Yacute -50
+KPX Ocircumflex Ydieresis -50
+KPX Odieresis A -35
+KPX Odieresis Aacute -35
+KPX Odieresis Abreve -35
+KPX Odieresis Acircumflex -35
+KPX Odieresis Adieresis -35
+KPX Odieresis Agrave -35
+KPX Odieresis Amacron -35
+KPX Odieresis Aogonek -35
+KPX Odieresis Aring -35
+KPX Odieresis Atilde -35
+KPX Odieresis T -40
+KPX Odieresis Tcaron -40
+KPX Odieresis Tcommaaccent -40
+KPX Odieresis V -50
+KPX Odieresis W -35
+KPX Odieresis X -40
+KPX Odieresis Y -50
+KPX Odieresis Yacute -50
+KPX Odieresis Ydieresis -50
+KPX Ograve A -35
+KPX Ograve Aacute -35
+KPX Ograve Abreve -35
+KPX Ograve Acircumflex -35
+KPX Ograve Adieresis -35
+KPX Ograve Agrave -35
+KPX Ograve Amacron -35
+KPX Ograve Aogonek -35
+KPX Ograve Aring -35
+KPX Ograve Atilde -35
+KPX Ograve T -40
+KPX Ograve Tcaron -40
+KPX Ograve Tcommaaccent -40
+KPX Ograve V -50
+KPX Ograve W -35
+KPX Ograve X -40
+KPX Ograve Y -50
+KPX Ograve Yacute -50
+KPX Ograve Ydieresis -50
+KPX Ohungarumlaut A -35
+KPX Ohungarumlaut Aacute -35
+KPX Ohungarumlaut Abreve -35
+KPX Ohungarumlaut Acircumflex -35
+KPX Ohungarumlaut Adieresis -35
+KPX Ohungarumlaut Agrave -35
+KPX Ohungarumlaut Amacron -35
+KPX Ohungarumlaut Aogonek -35
+KPX Ohungarumlaut Aring -35
+KPX Ohungarumlaut Atilde -35
+KPX Ohungarumlaut T -40
+KPX Ohungarumlaut Tcaron -40
+KPX Ohungarumlaut Tcommaaccent -40
+KPX Ohungarumlaut V -50
+KPX Ohungarumlaut W -35
+KPX Ohungarumlaut X -40
+KPX Ohungarumlaut Y -50
+KPX Ohungarumlaut Yacute -50
+KPX Ohungarumlaut Ydieresis -50
+KPX Omacron A -35
+KPX Omacron Aacute -35
+KPX Omacron Abreve -35
+KPX Omacron Acircumflex -35
+KPX Omacron Adieresis -35
+KPX Omacron Agrave -35
+KPX Omacron Amacron -35
+KPX Omacron Aogonek -35
+KPX Omacron Aring -35
+KPX Omacron Atilde -35
+KPX Omacron T -40
+KPX Omacron Tcaron -40
+KPX Omacron Tcommaaccent -40
+KPX Omacron V -50
+KPX Omacron W -35
+KPX Omacron X -40
+KPX Omacron Y -50
+KPX Omacron Yacute -50
+KPX Omacron Ydieresis -50
+KPX Oslash A -35
+KPX Oslash Aacute -35
+KPX Oslash Abreve -35
+KPX Oslash Acircumflex -35
+KPX Oslash Adieresis -35
+KPX Oslash Agrave -35
+KPX Oslash Amacron -35
+KPX Oslash Aogonek -35
+KPX Oslash Aring -35
+KPX Oslash Atilde -35
+KPX Oslash T -40
+KPX Oslash Tcaron -40
+KPX Oslash Tcommaaccent -40
+KPX Oslash V -50
+KPX Oslash W -35
+KPX Oslash X -40
+KPX Oslash Y -50
+KPX Oslash Yacute -50
+KPX Oslash Ydieresis -50
+KPX Otilde A -35
+KPX Otilde Aacute -35
+KPX Otilde Abreve -35
+KPX Otilde Acircumflex -35
+KPX Otilde Adieresis -35
+KPX Otilde Agrave -35
+KPX Otilde Amacron -35
+KPX Otilde Aogonek -35
+KPX Otilde Aring -35
+KPX Otilde Atilde -35
+KPX Otilde T -40
+KPX Otilde Tcaron -40
+KPX Otilde Tcommaaccent -40
+KPX Otilde V -50
+KPX Otilde W -35
+KPX Otilde X -40
+KPX Otilde Y -50
+KPX Otilde Yacute -50
+KPX Otilde Ydieresis -50
+KPX P A -92
+KPX P Aacute -92
+KPX P Abreve -92
+KPX P Acircumflex -92
+KPX P Adieresis -92
+KPX P Agrave -92
+KPX P Amacron -92
+KPX P Aogonek -92
+KPX P Aring -92
+KPX P Atilde -92
+KPX P a -15
+KPX P aacute -15
+KPX P abreve -15
+KPX P acircumflex -15
+KPX P adieresis -15
+KPX P agrave -15
+KPX P amacron -15
+KPX P aogonek -15
+KPX P aring -15
+KPX P atilde -15
+KPX P comma -111
+KPX P period -111
+KPX Q U -10
+KPX Q Uacute -10
+KPX Q Ucircumflex -10
+KPX Q Udieresis -10
+KPX Q Ugrave -10
+KPX Q Uhungarumlaut -10
+KPX Q Umacron -10
+KPX Q Uogonek -10
+KPX Q Uring -10
+KPX R O -40
+KPX R Oacute -40
+KPX R Ocircumflex -40
+KPX R Odieresis -40
+KPX R Ograve -40
+KPX R Ohungarumlaut -40
+KPX R Omacron -40
+KPX R Oslash -40
+KPX R Otilde -40
+KPX R T -60
+KPX R Tcaron -60
+KPX R Tcommaaccent -60
+KPX R U -40
+KPX R Uacute -40
+KPX R Ucircumflex -40
+KPX R Udieresis -40
+KPX R Ugrave -40
+KPX R Uhungarumlaut -40
+KPX R Umacron -40
+KPX R Uogonek -40
+KPX R Uring -40
+KPX R V -80
+KPX R W -55
+KPX R Y -65
+KPX R Yacute -65
+KPX R Ydieresis -65
+KPX Racute O -40
+KPX Racute Oacute -40
+KPX Racute Ocircumflex -40
+KPX Racute Odieresis -40
+KPX Racute Ograve -40
+KPX Racute Ohungarumlaut -40
+KPX Racute Omacron -40
+KPX Racute Oslash -40
+KPX Racute Otilde -40
+KPX Racute T -60
+KPX Racute Tcaron -60
+KPX Racute Tcommaaccent -60
+KPX Racute U -40
+KPX Racute Uacute -40
+KPX Racute Ucircumflex -40
+KPX Racute Udieresis -40
+KPX Racute Ugrave -40
+KPX Racute Uhungarumlaut -40
+KPX Racute Umacron -40
+KPX Racute Uogonek -40
+KPX Racute Uring -40
+KPX Racute V -80
+KPX Racute W -55
+KPX Racute Y -65
+KPX Racute Yacute -65
+KPX Racute Ydieresis -65
+KPX Rcaron O -40
+KPX Rcaron Oacute -40
+KPX Rcaron Ocircumflex -40
+KPX Rcaron Odieresis -40
+KPX Rcaron Ograve -40
+KPX Rcaron Ohungarumlaut -40
+KPX Rcaron Omacron -40
+KPX Rcaron Oslash -40
+KPX Rcaron Otilde -40
+KPX Rcaron T -60
+KPX Rcaron Tcaron -60
+KPX Rcaron Tcommaaccent -60
+KPX Rcaron U -40
+KPX Rcaron Uacute -40
+KPX Rcaron Ucircumflex -40
+KPX Rcaron Udieresis -40
+KPX Rcaron Ugrave -40
+KPX Rcaron Uhungarumlaut -40
+KPX Rcaron Umacron -40
+KPX Rcaron Uogonek -40
+KPX Rcaron Uring -40
+KPX Rcaron V -80
+KPX Rcaron W -55
+KPX Rcaron Y -65
+KPX Rcaron Yacute -65
+KPX Rcaron Ydieresis -65
+KPX Rcommaaccent O -40
+KPX Rcommaaccent Oacute -40
+KPX Rcommaaccent Ocircumflex -40
+KPX Rcommaaccent Odieresis -40
+KPX Rcommaaccent Ograve -40
+KPX Rcommaaccent Ohungarumlaut -40
+KPX Rcommaaccent Omacron -40
+KPX Rcommaaccent Oslash -40
+KPX Rcommaaccent Otilde -40
+KPX Rcommaaccent T -60
+KPX Rcommaaccent Tcaron -60
+KPX Rcommaaccent Tcommaaccent -60
+KPX Rcommaaccent U -40
+KPX Rcommaaccent Uacute -40
+KPX Rcommaaccent Ucircumflex -40
+KPX Rcommaaccent Udieresis -40
+KPX Rcommaaccent Ugrave -40
+KPX Rcommaaccent Uhungarumlaut -40
+KPX Rcommaaccent Umacron -40
+KPX Rcommaaccent Uogonek -40
+KPX Rcommaaccent Uring -40
+KPX Rcommaaccent V -80
+KPX Rcommaaccent W -55
+KPX Rcommaaccent Y -65
+KPX Rcommaaccent Yacute -65
+KPX Rcommaaccent Ydieresis -65
+KPX T A -93
+KPX T Aacute -93
+KPX T Abreve -93
+KPX T Acircumflex -93
+KPX T Adieresis -93
+KPX T Agrave -93
+KPX T Amacron -93
+KPX T Aogonek -93
+KPX T Aring -93
+KPX T Atilde -93
+KPX T O -18
+KPX T Oacute -18
+KPX T Ocircumflex -18
+KPX T Odieresis -18
+KPX T Ograve -18
+KPX T Ohungarumlaut -18
+KPX T Omacron -18
+KPX T Oslash -18
+KPX T Otilde -18
+KPX T a -80
+KPX T aacute -80
+KPX T abreve -80
+KPX T acircumflex -80
+KPX T adieresis -40
+KPX T agrave -40
+KPX T amacron -40
+KPX T aogonek -80
+KPX T aring -80
+KPX T atilde -40
+KPX T colon -50
+KPX T comma -74
+KPX T e -70
+KPX T eacute -70
+KPX T ecaron -70
+KPX T ecircumflex -70
+KPX T edieresis -30
+KPX T edotaccent -70
+KPX T egrave -70
+KPX T emacron -30
+KPX T eogonek -70
+KPX T hyphen -92
+KPX T i -35
+KPX T iacute -35
+KPX T iogonek -35
+KPX T o -80
+KPX T oacute -80
+KPX T ocircumflex -80
+KPX T odieresis -80
+KPX T ograve -80
+KPX T ohungarumlaut -80
+KPX T omacron -80
+KPX T oslash -80
+KPX T otilde -80
+KPX T period -74
+KPX T r -35
+KPX T racute -35
+KPX T rcaron -35
+KPX T rcommaaccent -35
+KPX T semicolon -55
+KPX T u -45
+KPX T uacute -45
+KPX T ucircumflex -45
+KPX T udieresis -45
+KPX T ugrave -45
+KPX T uhungarumlaut -45
+KPX T umacron -45
+KPX T uogonek -45
+KPX T uring -45
+KPX T w -80
+KPX T y -80
+KPX T yacute -80
+KPX T ydieresis -80
+KPX Tcaron A -93
+KPX Tcaron Aacute -93
+KPX Tcaron Abreve -93
+KPX Tcaron Acircumflex -93
+KPX Tcaron Adieresis -93
+KPX Tcaron Agrave -93
+KPX Tcaron Amacron -93
+KPX Tcaron Aogonek -93
+KPX Tcaron Aring -93
+KPX Tcaron Atilde -93
+KPX Tcaron O -18
+KPX Tcaron Oacute -18
+KPX Tcaron Ocircumflex -18
+KPX Tcaron Odieresis -18
+KPX Tcaron Ograve -18
+KPX Tcaron Ohungarumlaut -18
+KPX Tcaron Omacron -18
+KPX Tcaron Oslash -18
+KPX Tcaron Otilde -18
+KPX Tcaron a -80
+KPX Tcaron aacute -80
+KPX Tcaron abreve -80
+KPX Tcaron acircumflex -80
+KPX Tcaron adieresis -40
+KPX Tcaron agrave -40
+KPX Tcaron amacron -40
+KPX Tcaron aogonek -80
+KPX Tcaron aring -80
+KPX Tcaron atilde -40
+KPX Tcaron colon -50
+KPX Tcaron comma -74
+KPX Tcaron e -70
+KPX Tcaron eacute -70
+KPX Tcaron ecaron -70
+KPX Tcaron ecircumflex -30
+KPX Tcaron edieresis -30
+KPX Tcaron edotaccent -70
+KPX Tcaron egrave -70
+KPX Tcaron emacron -30
+KPX Tcaron eogonek -70
+KPX Tcaron hyphen -92
+KPX Tcaron i -35
+KPX Tcaron iacute -35
+KPX Tcaron iogonek -35
+KPX Tcaron o -80
+KPX Tcaron oacute -80
+KPX Tcaron ocircumflex -80
+KPX Tcaron odieresis -80
+KPX Tcaron ograve -80
+KPX Tcaron ohungarumlaut -80
+KPX Tcaron omacron -80
+KPX Tcaron oslash -80
+KPX Tcaron otilde -80
+KPX Tcaron period -74
+KPX Tcaron r -35
+KPX Tcaron racute -35
+KPX Tcaron rcaron -35
+KPX Tcaron rcommaaccent -35
+KPX Tcaron semicolon -55
+KPX Tcaron u -45
+KPX Tcaron uacute -45
+KPX Tcaron ucircumflex -45
+KPX Tcaron udieresis -45
+KPX Tcaron ugrave -45
+KPX Tcaron uhungarumlaut -45
+KPX Tcaron umacron -45
+KPX Tcaron uogonek -45
+KPX Tcaron uring -45
+KPX Tcaron w -80
+KPX Tcaron y -80
+KPX Tcaron yacute -80
+KPX Tcaron ydieresis -80
+KPX Tcommaaccent A -93
+KPX Tcommaaccent Aacute -93
+KPX Tcommaaccent Abreve -93
+KPX Tcommaaccent Acircumflex -93
+KPX Tcommaaccent Adieresis -93
+KPX Tcommaaccent Agrave -93
+KPX Tcommaaccent Amacron -93
+KPX Tcommaaccent Aogonek -93
+KPX Tcommaaccent Aring -93
+KPX Tcommaaccent Atilde -93
+KPX Tcommaaccent O -18
+KPX Tcommaaccent Oacute -18
+KPX Tcommaaccent Ocircumflex -18
+KPX Tcommaaccent Odieresis -18
+KPX Tcommaaccent Ograve -18
+KPX Tcommaaccent Ohungarumlaut -18
+KPX Tcommaaccent Omacron -18
+KPX Tcommaaccent Oslash -18
+KPX Tcommaaccent Otilde -18
+KPX Tcommaaccent a -80
+KPX Tcommaaccent aacute -80
+KPX Tcommaaccent abreve -80
+KPX Tcommaaccent acircumflex -80
+KPX Tcommaaccent adieresis -40
+KPX Tcommaaccent agrave -40
+KPX Tcommaaccent amacron -40
+KPX Tcommaaccent aogonek -80
+KPX Tcommaaccent aring -80
+KPX Tcommaaccent atilde -40
+KPX Tcommaaccent colon -50
+KPX Tcommaaccent comma -74
+KPX Tcommaaccent e -70
+KPX Tcommaaccent eacute -70
+KPX Tcommaaccent ecaron -70
+KPX Tcommaaccent ecircumflex -30
+KPX Tcommaaccent edieresis -30
+KPX Tcommaaccent edotaccent -70
+KPX Tcommaaccent egrave -30
+KPX Tcommaaccent emacron -70
+KPX Tcommaaccent eogonek -70
+KPX Tcommaaccent hyphen -92
+KPX Tcommaaccent i -35
+KPX Tcommaaccent iacute -35
+KPX Tcommaaccent iogonek -35
+KPX Tcommaaccent o -80
+KPX Tcommaaccent oacute -80
+KPX Tcommaaccent ocircumflex -80
+KPX Tcommaaccent odieresis -80
+KPX Tcommaaccent ograve -80
+KPX Tcommaaccent ohungarumlaut -80
+KPX Tcommaaccent omacron -80
+KPX Tcommaaccent oslash -80
+KPX Tcommaaccent otilde -80
+KPX Tcommaaccent period -74
+KPX Tcommaaccent r -35
+KPX Tcommaaccent racute -35
+KPX Tcommaaccent rcaron -35
+KPX Tcommaaccent rcommaaccent -35
+KPX Tcommaaccent semicolon -55
+KPX Tcommaaccent u -45
+KPX Tcommaaccent uacute -45
+KPX Tcommaaccent ucircumflex -45
+KPX Tcommaaccent udieresis -45
+KPX Tcommaaccent ugrave -45
+KPX Tcommaaccent uhungarumlaut -45
+KPX Tcommaaccent umacron -45
+KPX Tcommaaccent uogonek -45
+KPX Tcommaaccent uring -45
+KPX Tcommaaccent w -80
+KPX Tcommaaccent y -80
+KPX Tcommaaccent yacute -80
+KPX Tcommaaccent ydieresis -80
+KPX U A -40
+KPX U Aacute -40
+KPX U Abreve -40
+KPX U Acircumflex -40
+KPX U Adieresis -40
+KPX U Agrave -40
+KPX U Amacron -40
+KPX U Aogonek -40
+KPX U Aring -40
+KPX U Atilde -40
+KPX Uacute A -40
+KPX Uacute Aacute -40
+KPX Uacute Abreve -40
+KPX Uacute Acircumflex -40
+KPX Uacute Adieresis -40
+KPX Uacute Agrave -40
+KPX Uacute Amacron -40
+KPX Uacute Aogonek -40
+KPX Uacute Aring -40
+KPX Uacute Atilde -40
+KPX Ucircumflex A -40
+KPX Ucircumflex Aacute -40
+KPX Ucircumflex Abreve -40
+KPX Ucircumflex Acircumflex -40
+KPX Ucircumflex Adieresis -40
+KPX Ucircumflex Agrave -40
+KPX Ucircumflex Amacron -40
+KPX Ucircumflex Aogonek -40
+KPX Ucircumflex Aring -40
+KPX Ucircumflex Atilde -40
+KPX Udieresis A -40
+KPX Udieresis Aacute -40
+KPX Udieresis Abreve -40
+KPX Udieresis Acircumflex -40
+KPX Udieresis Adieresis -40
+KPX Udieresis Agrave -40
+KPX Udieresis Amacron -40
+KPX Udieresis Aogonek -40
+KPX Udieresis Aring -40
+KPX Udieresis Atilde -40
+KPX Ugrave A -40
+KPX Ugrave Aacute -40
+KPX Ugrave Abreve -40
+KPX Ugrave Acircumflex -40
+KPX Ugrave Adieresis -40
+KPX Ugrave Agrave -40
+KPX Ugrave Amacron -40
+KPX Ugrave Aogonek -40
+KPX Ugrave Aring -40
+KPX Ugrave Atilde -40
+KPX Uhungarumlaut A -40
+KPX Uhungarumlaut Aacute -40
+KPX Uhungarumlaut Abreve -40
+KPX Uhungarumlaut Acircumflex -40
+KPX Uhungarumlaut Adieresis -40
+KPX Uhungarumlaut Agrave -40
+KPX Uhungarumlaut Amacron -40
+KPX Uhungarumlaut Aogonek -40
+KPX Uhungarumlaut Aring -40
+KPX Uhungarumlaut Atilde -40
+KPX Umacron A -40
+KPX Umacron Aacute -40
+KPX Umacron Abreve -40
+KPX Umacron Acircumflex -40
+KPX Umacron Adieresis -40
+KPX Umacron Agrave -40
+KPX Umacron Amacron -40
+KPX Umacron Aogonek -40
+KPX Umacron Aring -40
+KPX Umacron Atilde -40
+KPX Uogonek A -40
+KPX Uogonek Aacute -40
+KPX Uogonek Abreve -40
+KPX Uogonek Acircumflex -40
+KPX Uogonek Adieresis -40
+KPX Uogonek Agrave -40
+KPX Uogonek Amacron -40
+KPX Uogonek Aogonek -40
+KPX Uogonek Aring -40
+KPX Uogonek Atilde -40
+KPX Uring A -40
+KPX Uring Aacute -40
+KPX Uring Abreve -40
+KPX Uring Acircumflex -40
+KPX Uring Adieresis -40
+KPX Uring Agrave -40
+KPX Uring Amacron -40
+KPX Uring Aogonek -40
+KPX Uring Aring -40
+KPX Uring Atilde -40
+KPX V A -135
+KPX V Aacute -135
+KPX V Abreve -135
+KPX V Acircumflex -135
+KPX V Adieresis -135
+KPX V Agrave -135
+KPX V Amacron -135
+KPX V Aogonek -135
+KPX V Aring -135
+KPX V Atilde -135
+KPX V G -15
+KPX V Gbreve -15
+KPX V Gcommaaccent -15
+KPX V O -40
+KPX V Oacute -40
+KPX V Ocircumflex -40
+KPX V Odieresis -40
+KPX V Ograve -40
+KPX V Ohungarumlaut -40
+KPX V Omacron -40
+KPX V Oslash -40
+KPX V Otilde -40
+KPX V a -111
+KPX V aacute -111
+KPX V abreve -111
+KPX V acircumflex -71
+KPX V adieresis -71
+KPX V agrave -71
+KPX V amacron -71
+KPX V aogonek -111
+KPX V aring -111
+KPX V atilde -71
+KPX V colon -74
+KPX V comma -129
+KPX V e -111
+KPX V eacute -111
+KPX V ecaron -71
+KPX V ecircumflex -71
+KPX V edieresis -71
+KPX V edotaccent -111
+KPX V egrave -71
+KPX V emacron -71
+KPX V eogonek -111
+KPX V hyphen -100
+KPX V i -60
+KPX V iacute -60
+KPX V icircumflex -20
+KPX V idieresis -20
+KPX V igrave -20
+KPX V imacron -20
+KPX V iogonek -60
+KPX V o -129
+KPX V oacute -129
+KPX V ocircumflex -129
+KPX V odieresis -89
+KPX V ograve -89
+KPX V ohungarumlaut -129
+KPX V omacron -89
+KPX V oslash -129
+KPX V otilde -89
+KPX V period -129
+KPX V semicolon -74
+KPX V u -75
+KPX V uacute -75
+KPX V ucircumflex -75
+KPX V udieresis -75
+KPX V ugrave -75
+KPX V uhungarumlaut -75
+KPX V umacron -75
+KPX V uogonek -75
+KPX V uring -75
+KPX W A -120
+KPX W Aacute -120
+KPX W Abreve -120
+KPX W Acircumflex -120
+KPX W Adieresis -120
+KPX W Agrave -120
+KPX W Amacron -120
+KPX W Aogonek -120
+KPX W Aring -120
+KPX W Atilde -120
+KPX W O -10
+KPX W Oacute -10
+KPX W Ocircumflex -10
+KPX W Odieresis -10
+KPX W Ograve -10
+KPX W Ohungarumlaut -10
+KPX W Omacron -10
+KPX W Oslash -10
+KPX W Otilde -10
+KPX W a -80
+KPX W aacute -80
+KPX W abreve -80
+KPX W acircumflex -80
+KPX W adieresis -80
+KPX W agrave -80
+KPX W amacron -80
+KPX W aogonek -80
+KPX W aring -80
+KPX W atilde -80
+KPX W colon -37
+KPX W comma -92
+KPX W e -80
+KPX W eacute -80
+KPX W ecaron -80
+KPX W ecircumflex -80
+KPX W edieresis -40
+KPX W edotaccent -80
+KPX W egrave -40
+KPX W emacron -40
+KPX W eogonek -80
+KPX W hyphen -65
+KPX W i -40
+KPX W iacute -40
+KPX W iogonek -40
+KPX W o -80
+KPX W oacute -80
+KPX W ocircumflex -80
+KPX W odieresis -80
+KPX W ograve -80
+KPX W ohungarumlaut -80
+KPX W omacron -80
+KPX W oslash -80
+KPX W otilde -80
+KPX W period -92
+KPX W semicolon -37
+KPX W u -50
+KPX W uacute -50
+KPX W ucircumflex -50
+KPX W udieresis -50
+KPX W ugrave -50
+KPX W uhungarumlaut -50
+KPX W umacron -50
+KPX W uogonek -50
+KPX W uring -50
+KPX W y -73
+KPX W yacute -73
+KPX W ydieresis -73
+KPX Y A -120
+KPX Y Aacute -120
+KPX Y Abreve -120
+KPX Y Acircumflex -120
+KPX Y Adieresis -120
+KPX Y Agrave -120
+KPX Y Amacron -120
+KPX Y Aogonek -120
+KPX Y Aring -120
+KPX Y Atilde -120
+KPX Y O -30
+KPX Y Oacute -30
+KPX Y Ocircumflex -30
+KPX Y Odieresis -30
+KPX Y Ograve -30
+KPX Y Ohungarumlaut -30
+KPX Y Omacron -30
+KPX Y Oslash -30
+KPX Y Otilde -30
+KPX Y a -100
+KPX Y aacute -100
+KPX Y abreve -100
+KPX Y acircumflex -100
+KPX Y adieresis -60
+KPX Y agrave -60
+KPX Y amacron -60
+KPX Y aogonek -100
+KPX Y aring -100
+KPX Y atilde -60
+KPX Y colon -92
+KPX Y comma -129
+KPX Y e -100
+KPX Y eacute -100
+KPX Y ecaron -100
+KPX Y ecircumflex -100
+KPX Y edieresis -60
+KPX Y edotaccent -100
+KPX Y egrave -60
+KPX Y emacron -60
+KPX Y eogonek -100
+KPX Y hyphen -111
+KPX Y i -55
+KPX Y iacute -55
+KPX Y iogonek -55
+KPX Y o -110
+KPX Y oacute -110
+KPX Y ocircumflex -110
+KPX Y odieresis -70
+KPX Y ograve -70
+KPX Y ohungarumlaut -110
+KPX Y omacron -70
+KPX Y oslash -110
+KPX Y otilde -70
+KPX Y period -129
+KPX Y semicolon -92
+KPX Y u -111
+KPX Y uacute -111
+KPX Y ucircumflex -111
+KPX Y udieresis -71
+KPX Y ugrave -71
+KPX Y uhungarumlaut -111
+KPX Y umacron -71
+KPX Y uogonek -111
+KPX Y uring -111
+KPX Yacute A -120
+KPX Yacute Aacute -120
+KPX Yacute Abreve -120
+KPX Yacute Acircumflex -120
+KPX Yacute Adieresis -120
+KPX Yacute Agrave -120
+KPX Yacute Amacron -120
+KPX Yacute Aogonek -120
+KPX Yacute Aring -120
+KPX Yacute Atilde -120
+KPX Yacute O -30
+KPX Yacute Oacute -30
+KPX Yacute Ocircumflex -30
+KPX Yacute Odieresis -30
+KPX Yacute Ograve -30
+KPX Yacute Ohungarumlaut -30
+KPX Yacute Omacron -30
+KPX Yacute Oslash -30
+KPX Yacute Otilde -30
+KPX Yacute a -100
+KPX Yacute aacute -100
+KPX Yacute abreve -100
+KPX Yacute acircumflex -100
+KPX Yacute adieresis -60
+KPX Yacute agrave -60
+KPX Yacute amacron -60
+KPX Yacute aogonek -100
+KPX Yacute aring -100
+KPX Yacute atilde -60
+KPX Yacute colon -92
+KPX Yacute comma -129
+KPX Yacute e -100
+KPX Yacute eacute -100
+KPX Yacute ecaron -100
+KPX Yacute ecircumflex -100
+KPX Yacute edieresis -60
+KPX Yacute edotaccent -100
+KPX Yacute egrave -60
+KPX Yacute emacron -60
+KPX Yacute eogonek -100
+KPX Yacute hyphen -111
+KPX Yacute i -55
+KPX Yacute iacute -55
+KPX Yacute iogonek -55
+KPX Yacute o -110
+KPX Yacute oacute -110
+KPX Yacute ocircumflex -110
+KPX Yacute odieresis -70
+KPX Yacute ograve -70
+KPX Yacute ohungarumlaut -110
+KPX Yacute omacron -70
+KPX Yacute oslash -110
+KPX Yacute otilde -70
+KPX Yacute period -129
+KPX Yacute semicolon -92
+KPX Yacute u -111
+KPX Yacute uacute -111
+KPX Yacute ucircumflex -111
+KPX Yacute udieresis -71
+KPX Yacute ugrave -71
+KPX Yacute uhungarumlaut -111
+KPX Yacute umacron -71
+KPX Yacute uogonek -111
+KPX Yacute uring -111
+KPX Ydieresis A -120
+KPX Ydieresis Aacute -120
+KPX Ydieresis Abreve -120
+KPX Ydieresis Acircumflex -120
+KPX Ydieresis Adieresis -120
+KPX Ydieresis Agrave -120
+KPX Ydieresis Amacron -120
+KPX Ydieresis Aogonek -120
+KPX Ydieresis Aring -120
+KPX Ydieresis Atilde -120
+KPX Ydieresis O -30
+KPX Ydieresis Oacute -30
+KPX Ydieresis Ocircumflex -30
+KPX Ydieresis Odieresis -30
+KPX Ydieresis Ograve -30
+KPX Ydieresis Ohungarumlaut -30
+KPX Ydieresis Omacron -30
+KPX Ydieresis Oslash -30
+KPX Ydieresis Otilde -30
+KPX Ydieresis a -100
+KPX Ydieresis aacute -100
+KPX Ydieresis abreve -100
+KPX Ydieresis acircumflex -100
+KPX Ydieresis adieresis -60
+KPX Ydieresis agrave -60
+KPX Ydieresis amacron -60
+KPX Ydieresis aogonek -100
+KPX Ydieresis aring -100
+KPX Ydieresis atilde -100
+KPX Ydieresis colon -92
+KPX Ydieresis comma -129
+KPX Ydieresis e -100
+KPX Ydieresis eacute -100
+KPX Ydieresis ecaron -100
+KPX Ydieresis ecircumflex -100
+KPX Ydieresis edieresis -60
+KPX Ydieresis edotaccent -100
+KPX Ydieresis egrave -60
+KPX Ydieresis emacron -60
+KPX Ydieresis eogonek -100
+KPX Ydieresis hyphen -111
+KPX Ydieresis i -55
+KPX Ydieresis iacute -55
+KPX Ydieresis iogonek -55
+KPX Ydieresis o -110
+KPX Ydieresis oacute -110
+KPX Ydieresis ocircumflex -110
+KPX Ydieresis odieresis -70
+KPX Ydieresis ograve -70
+KPX Ydieresis ohungarumlaut -110
+KPX Ydieresis omacron -70
+KPX Ydieresis oslash -110
+KPX Ydieresis otilde -70
+KPX Ydieresis period -129
+KPX Ydieresis semicolon -92
+KPX Ydieresis u -111
+KPX Ydieresis uacute -111
+KPX Ydieresis ucircumflex -111
+KPX Ydieresis udieresis -71
+KPX Ydieresis ugrave -71
+KPX Ydieresis uhungarumlaut -111
+KPX Ydieresis umacron -71
+KPX Ydieresis uogonek -111
+KPX Ydieresis uring -111
+KPX a v -20
+KPX a w -15
+KPX aacute v -20
+KPX aacute w -15
+KPX abreve v -20
+KPX abreve w -15
+KPX acircumflex v -20
+KPX acircumflex w -15
+KPX adieresis v -20
+KPX adieresis w -15
+KPX agrave v -20
+KPX agrave w -15
+KPX amacron v -20
+KPX amacron w -15
+KPX aogonek v -20
+KPX aogonek w -15
+KPX aring v -20
+KPX aring w -15
+KPX atilde v -20
+KPX atilde w -15
+KPX b period -40
+KPX b u -20
+KPX b uacute -20
+KPX b ucircumflex -20
+KPX b udieresis -20
+KPX b ugrave -20
+KPX b uhungarumlaut -20
+KPX b umacron -20
+KPX b uogonek -20
+KPX b uring -20
+KPX b v -15
+KPX c y -15
+KPX c yacute -15
+KPX c ydieresis -15
+KPX cacute y -15
+KPX cacute yacute -15
+KPX cacute ydieresis -15
+KPX ccaron y -15
+KPX ccaron yacute -15
+KPX ccaron ydieresis -15
+KPX ccedilla y -15
+KPX ccedilla yacute -15
+KPX ccedilla ydieresis -15
+KPX comma quotedblright -70
+KPX comma quoteright -70
+KPX e g -15
+KPX e gbreve -15
+KPX e gcommaaccent -15
+KPX e v -25
+KPX e w -25
+KPX e x -15
+KPX e y -15
+KPX e yacute -15
+KPX e ydieresis -15
+KPX eacute g -15
+KPX eacute gbreve -15
+KPX eacute gcommaaccent -15
+KPX eacute v -25
+KPX eacute w -25
+KPX eacute x -15
+KPX eacute y -15
+KPX eacute yacute -15
+KPX eacute ydieresis -15
+KPX ecaron g -15
+KPX ecaron gbreve -15
+KPX ecaron gcommaaccent -15
+KPX ecaron v -25
+KPX ecaron w -25
+KPX ecaron x -15
+KPX ecaron y -15
+KPX ecaron yacute -15
+KPX ecaron ydieresis -15
+KPX ecircumflex g -15
+KPX ecircumflex gbreve -15
+KPX ecircumflex gcommaaccent -15
+KPX ecircumflex v -25
+KPX ecircumflex w -25
+KPX ecircumflex x -15
+KPX ecircumflex y -15
+KPX ecircumflex yacute -15
+KPX ecircumflex ydieresis -15
+KPX edieresis g -15
+KPX edieresis gbreve -15
+KPX edieresis gcommaaccent -15
+KPX edieresis v -25
+KPX edieresis w -25
+KPX edieresis x -15
+KPX edieresis y -15
+KPX edieresis yacute -15
+KPX edieresis ydieresis -15
+KPX edotaccent g -15
+KPX edotaccent gbreve -15
+KPX edotaccent gcommaaccent -15
+KPX edotaccent v -25
+KPX edotaccent w -25
+KPX edotaccent x -15
+KPX edotaccent y -15
+KPX edotaccent yacute -15
+KPX edotaccent ydieresis -15
+KPX egrave g -15
+KPX egrave gbreve -15
+KPX egrave gcommaaccent -15
+KPX egrave v -25
+KPX egrave w -25
+KPX egrave x -15
+KPX egrave y -15
+KPX egrave yacute -15
+KPX egrave ydieresis -15
+KPX emacron g -15
+KPX emacron gbreve -15
+KPX emacron gcommaaccent -15
+KPX emacron v -25
+KPX emacron w -25
+KPX emacron x -15
+KPX emacron y -15
+KPX emacron yacute -15
+KPX emacron ydieresis -15
+KPX eogonek g -15
+KPX eogonek gbreve -15
+KPX eogonek gcommaaccent -15
+KPX eogonek v -25
+KPX eogonek w -25
+KPX eogonek x -15
+KPX eogonek y -15
+KPX eogonek yacute -15
+KPX eogonek ydieresis -15
+KPX f a -10
+KPX f aacute -10
+KPX f abreve -10
+KPX f acircumflex -10
+KPX f adieresis -10
+KPX f agrave -10
+KPX f amacron -10
+KPX f aogonek -10
+KPX f aring -10
+KPX f atilde -10
+KPX f dotlessi -50
+KPX f f -25
+KPX f i -20
+KPX f iacute -20
+KPX f quoteright 55
+KPX g a -5
+KPX g aacute -5
+KPX g abreve -5
+KPX g acircumflex -5
+KPX g adieresis -5
+KPX g agrave -5
+KPX g amacron -5
+KPX g aogonek -5
+KPX g aring -5
+KPX g atilde -5
+KPX gbreve a -5
+KPX gbreve aacute -5
+KPX gbreve abreve -5
+KPX gbreve acircumflex -5
+KPX gbreve adieresis -5
+KPX gbreve agrave -5
+KPX gbreve amacron -5
+KPX gbreve aogonek -5
+KPX gbreve aring -5
+KPX gbreve atilde -5
+KPX gcommaaccent a -5
+KPX gcommaaccent aacute -5
+KPX gcommaaccent abreve -5
+KPX gcommaaccent acircumflex -5
+KPX gcommaaccent adieresis -5
+KPX gcommaaccent agrave -5
+KPX gcommaaccent amacron -5
+KPX gcommaaccent aogonek -5
+KPX gcommaaccent aring -5
+KPX gcommaaccent atilde -5
+KPX h y -5
+KPX h yacute -5
+KPX h ydieresis -5
+KPX i v -25
+KPX iacute v -25
+KPX icircumflex v -25
+KPX idieresis v -25
+KPX igrave v -25
+KPX imacron v -25
+KPX iogonek v -25
+KPX k e -10
+KPX k eacute -10
+KPX k ecaron -10
+KPX k ecircumflex -10
+KPX k edieresis -10
+KPX k edotaccent -10
+KPX k egrave -10
+KPX k emacron -10
+KPX k eogonek -10
+KPX k o -10
+KPX k oacute -10
+KPX k ocircumflex -10
+KPX k odieresis -10
+KPX k ograve -10
+KPX k ohungarumlaut -10
+KPX k omacron -10
+KPX k oslash -10
+KPX k otilde -10
+KPX k y -15
+KPX k yacute -15
+KPX k ydieresis -15
+KPX kcommaaccent e -10
+KPX kcommaaccent eacute -10
+KPX kcommaaccent ecaron -10
+KPX kcommaaccent ecircumflex -10
+KPX kcommaaccent edieresis -10
+KPX kcommaaccent edotaccent -10
+KPX kcommaaccent egrave -10
+KPX kcommaaccent emacron -10
+KPX kcommaaccent eogonek -10
+KPX kcommaaccent o -10
+KPX kcommaaccent oacute -10
+KPX kcommaaccent ocircumflex -10
+KPX kcommaaccent odieresis -10
+KPX kcommaaccent ograve -10
+KPX kcommaaccent ohungarumlaut -10
+KPX kcommaaccent omacron -10
+KPX kcommaaccent oslash -10
+KPX kcommaaccent otilde -10
+KPX kcommaaccent y -15
+KPX kcommaaccent yacute -15
+KPX kcommaaccent ydieresis -15
+KPX l w -10
+KPX lacute w -10
+KPX lcommaaccent w -10
+KPX lslash w -10
+KPX n v -40
+KPX n y -15
+KPX n yacute -15
+KPX n ydieresis -15
+KPX nacute v -40
+KPX nacute y -15
+KPX nacute yacute -15
+KPX nacute ydieresis -15
+KPX ncaron v -40
+KPX ncaron y -15
+KPX ncaron yacute -15
+KPX ncaron ydieresis -15
+KPX ncommaaccent v -40
+KPX ncommaaccent y -15
+KPX ncommaaccent yacute -15
+KPX ncommaaccent ydieresis -15
+KPX ntilde v -40
+KPX ntilde y -15
+KPX ntilde yacute -15
+KPX ntilde ydieresis -15
+KPX o v -15
+KPX o w -25
+KPX o y -10
+KPX o yacute -10
+KPX o ydieresis -10
+KPX oacute v -15
+KPX oacute w -25
+KPX oacute y -10
+KPX oacute yacute -10
+KPX oacute ydieresis -10
+KPX ocircumflex v -15
+KPX ocircumflex w -25
+KPX ocircumflex y -10
+KPX ocircumflex yacute -10
+KPX ocircumflex ydieresis -10
+KPX odieresis v -15
+KPX odieresis w -25
+KPX odieresis y -10
+KPX odieresis yacute -10
+KPX odieresis ydieresis -10
+KPX ograve v -15
+KPX ograve w -25
+KPX ograve y -10
+KPX ograve yacute -10
+KPX ograve ydieresis -10
+KPX ohungarumlaut v -15
+KPX ohungarumlaut w -25
+KPX ohungarumlaut y -10
+KPX ohungarumlaut yacute -10
+KPX ohungarumlaut ydieresis -10
+KPX omacron v -15
+KPX omacron w -25
+KPX omacron y -10
+KPX omacron yacute -10
+KPX omacron ydieresis -10
+KPX oslash v -15
+KPX oslash w -25
+KPX oslash y -10
+KPX oslash yacute -10
+KPX oslash ydieresis -10
+KPX otilde v -15
+KPX otilde w -25
+KPX otilde y -10
+KPX otilde yacute -10
+KPX otilde ydieresis -10
+KPX p y -10
+KPX p yacute -10
+KPX p ydieresis -10
+KPX period quotedblright -70
+KPX period quoteright -70
+KPX quotedblleft A -80
+KPX quotedblleft Aacute -80
+KPX quotedblleft Abreve -80
+KPX quotedblleft Acircumflex -80
+KPX quotedblleft Adieresis -80
+KPX quotedblleft Agrave -80
+KPX quotedblleft Amacron -80
+KPX quotedblleft Aogonek -80
+KPX quotedblleft Aring -80
+KPX quotedblleft Atilde -80
+KPX quoteleft A -80
+KPX quoteleft Aacute -80
+KPX quoteleft Abreve -80
+KPX quoteleft Acircumflex -80
+KPX quoteleft Adieresis -80
+KPX quoteleft Agrave -80
+KPX quoteleft Amacron -80
+KPX quoteleft Aogonek -80
+KPX quoteleft Aring -80
+KPX quoteleft Atilde -80
+KPX quoteleft quoteleft -74
+KPX quoteright d -50
+KPX quoteright dcroat -50
+KPX quoteright l -10
+KPX quoteright lacute -10
+KPX quoteright lcommaaccent -10
+KPX quoteright lslash -10
+KPX quoteright quoteright -74
+KPX quoteright r -50
+KPX quoteright racute -50
+KPX quoteright rcaron -50
+KPX quoteright rcommaaccent -50
+KPX quoteright s -55
+KPX quoteright sacute -55
+KPX quoteright scaron -55
+KPX quoteright scedilla -55
+KPX quoteright scommaaccent -55
+KPX quoteright space -74
+KPX quoteright t -18
+KPX quoteright tcommaaccent -18
+KPX quoteright v -50
+KPX r comma -40
+KPX r g -18
+KPX r gbreve -18
+KPX r gcommaaccent -18
+KPX r hyphen -20
+KPX r period -55
+KPX racute comma -40
+KPX racute g -18
+KPX racute gbreve -18
+KPX racute gcommaaccent -18
+KPX racute hyphen -20
+KPX racute period -55
+KPX rcaron comma -40
+KPX rcaron g -18
+KPX rcaron gbreve -18
+KPX rcaron gcommaaccent -18
+KPX rcaron hyphen -20
+KPX rcaron period -55
+KPX rcommaaccent comma -40
+KPX rcommaaccent g -18
+KPX rcommaaccent gbreve -18
+KPX rcommaaccent gcommaaccent -18
+KPX rcommaaccent hyphen -20
+KPX rcommaaccent period -55
+KPX space A -55
+KPX space Aacute -55
+KPX space Abreve -55
+KPX space Acircumflex -55
+KPX space Adieresis -55
+KPX space Agrave -55
+KPX space Amacron -55
+KPX space Aogonek -55
+KPX space Aring -55
+KPX space Atilde -55
+KPX space T -18
+KPX space Tcaron -18
+KPX space Tcommaaccent -18
+KPX space V -50
+KPX space W -30
+KPX space Y -90
+KPX space Yacute -90
+KPX space Ydieresis -90
+KPX v a -25
+KPX v aacute -25
+KPX v abreve -25
+KPX v acircumflex -25
+KPX v adieresis -25
+KPX v agrave -25
+KPX v amacron -25
+KPX v aogonek -25
+KPX v aring -25
+KPX v atilde -25
+KPX v comma -65
+KPX v e -15
+KPX v eacute -15
+KPX v ecaron -15
+KPX v ecircumflex -15
+KPX v edieresis -15
+KPX v edotaccent -15
+KPX v egrave -15
+KPX v emacron -15
+KPX v eogonek -15
+KPX v o -20
+KPX v oacute -20
+KPX v ocircumflex -20
+KPX v odieresis -20
+KPX v ograve -20
+KPX v ohungarumlaut -20
+KPX v omacron -20
+KPX v oslash -20
+KPX v otilde -20
+KPX v period -65
+KPX w a -10
+KPX w aacute -10
+KPX w abreve -10
+KPX w acircumflex -10
+KPX w adieresis -10
+KPX w agrave -10
+KPX w amacron -10
+KPX w aogonek -10
+KPX w aring -10
+KPX w atilde -10
+KPX w comma -65
+KPX w o -10
+KPX w oacute -10
+KPX w ocircumflex -10
+KPX w odieresis -10
+KPX w ograve -10
+KPX w ohungarumlaut -10
+KPX w omacron -10
+KPX w oslash -10
+KPX w otilde -10
+KPX w period -65
+KPX x e -15
+KPX x eacute -15
+KPX x ecaron -15
+KPX x ecircumflex -15
+KPX x edieresis -15
+KPX x edotaccent -15
+KPX x egrave -15
+KPX x emacron -15
+KPX x eogonek -15
+KPX y comma -65
+KPX y period -65
+KPX yacute comma -65
+KPX yacute period -65
+KPX ydieresis comma -65
+KPX ydieresis period -65
+EndKernPairs
+EndKernData
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/ZapfDingbats.afm b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/ZapfDingbats.afm
new file mode 100644
index 0000000000000000000000000000000000000000..b2745053e4086c1a5ea7b74e460e62526b64009a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/ZapfDingbats.afm
@@ -0,0 +1,225 @@
+StartFontMetrics 4.1
+Comment Copyright (c) 1985, 1987, 1988, 1989, 1997 Adobe Systems Incorporated. All Rights Reserved.
+Comment Creation Date: Thu May 1 15:14:13 1997
+Comment UniqueID 43082
+Comment VMusage 45775 55535
+FontName ZapfDingbats
+FullName ITC Zapf Dingbats
+FamilyName ZapfDingbats
+Weight Medium
+ItalicAngle 0
+IsFixedPitch false
+CharacterSet Special
+FontBBox -1 -143 981 820
+UnderlinePosition -100
+UnderlineThickness 50
+Version 002.000
+Notice Copyright (c) 1985, 1987, 1988, 1989, 1997 Adobe Systems Incorporated. All Rights Reserved.ITC Zapf Dingbats is a registered trademark of International Typeface Corporation.
+EncodingScheme FontSpecific
+StdHW 28
+StdVW 90
+StartCharMetrics 202
+C 32 ; WX 278 ; N space ; B 0 0 0 0 ;
+C 33 ; WX 974 ; N a1 ; B 35 72 939 621 ;
+C 34 ; WX 961 ; N a2 ; B 35 81 927 611 ;
+C 35 ; WX 974 ; N a202 ; B 35 72 939 621 ;
+C 36 ; WX 980 ; N a3 ; B 35 0 945 692 ;
+C 37 ; WX 719 ; N a4 ; B 34 139 685 566 ;
+C 38 ; WX 789 ; N a5 ; B 35 -14 755 705 ;
+C 39 ; WX 790 ; N a119 ; B 35 -14 755 705 ;
+C 40 ; WX 791 ; N a118 ; B 35 -13 761 705 ;
+C 41 ; WX 690 ; N a117 ; B 34 138 655 553 ;
+C 42 ; WX 960 ; N a11 ; B 35 123 925 568 ;
+C 43 ; WX 939 ; N a12 ; B 35 134 904 559 ;
+C 44 ; WX 549 ; N a13 ; B 29 -11 516 705 ;
+C 45 ; WX 855 ; N a14 ; B 34 59 820 632 ;
+C 46 ; WX 911 ; N a15 ; B 35 50 876 642 ;
+C 47 ; WX 933 ; N a16 ; B 35 139 899 550 ;
+C 48 ; WX 911 ; N a105 ; B 35 50 876 642 ;
+C 49 ; WX 945 ; N a17 ; B 35 139 909 553 ;
+C 50 ; WX 974 ; N a18 ; B 35 104 938 587 ;
+C 51 ; WX 755 ; N a19 ; B 34 -13 721 705 ;
+C 52 ; WX 846 ; N a20 ; B 36 -14 811 705 ;
+C 53 ; WX 762 ; N a21 ; B 35 0 727 692 ;
+C 54 ; WX 761 ; N a22 ; B 35 0 727 692 ;
+C 55 ; WX 571 ; N a23 ; B -1 -68 571 661 ;
+C 56 ; WX 677 ; N a24 ; B 36 -13 642 705 ;
+C 57 ; WX 763 ; N a25 ; B 35 0 728 692 ;
+C 58 ; WX 760 ; N a26 ; B 35 0 726 692 ;
+C 59 ; WX 759 ; N a27 ; B 35 0 725 692 ;
+C 60 ; WX 754 ; N a28 ; B 35 0 720 692 ;
+C 61 ; WX 494 ; N a6 ; B 35 0 460 692 ;
+C 62 ; WX 552 ; N a7 ; B 35 0 517 692 ;
+C 63 ; WX 537 ; N a8 ; B 35 0 503 692 ;
+C 64 ; WX 577 ; N a9 ; B 35 96 542 596 ;
+C 65 ; WX 692 ; N a10 ; B 35 -14 657 705 ;
+C 66 ; WX 786 ; N a29 ; B 35 -14 751 705 ;
+C 67 ; WX 788 ; N a30 ; B 35 -14 752 705 ;
+C 68 ; WX 788 ; N a31 ; B 35 -14 753 705 ;
+C 69 ; WX 790 ; N a32 ; B 35 -14 756 705 ;
+C 70 ; WX 793 ; N a33 ; B 35 -13 759 705 ;
+C 71 ; WX 794 ; N a34 ; B 35 -13 759 705 ;
+C 72 ; WX 816 ; N a35 ; B 35 -14 782 705 ;
+C 73 ; WX 823 ; N a36 ; B 35 -14 787 705 ;
+C 74 ; WX 789 ; N a37 ; B 35 -14 754 705 ;
+C 75 ; WX 841 ; N a38 ; B 35 -14 807 705 ;
+C 76 ; WX 823 ; N a39 ; B 35 -14 789 705 ;
+C 77 ; WX 833 ; N a40 ; B 35 -14 798 705 ;
+C 78 ; WX 816 ; N a41 ; B 35 -13 782 705 ;
+C 79 ; WX 831 ; N a42 ; B 35 -14 796 705 ;
+C 80 ; WX 923 ; N a43 ; B 35 -14 888 705 ;
+C 81 ; WX 744 ; N a44 ; B 35 0 710 692 ;
+C 82 ; WX 723 ; N a45 ; B 35 0 688 692 ;
+C 83 ; WX 749 ; N a46 ; B 35 0 714 692 ;
+C 84 ; WX 790 ; N a47 ; B 34 -14 756 705 ;
+C 85 ; WX 792 ; N a48 ; B 35 -14 758 705 ;
+C 86 ; WX 695 ; N a49 ; B 35 -14 661 706 ;
+C 87 ; WX 776 ; N a50 ; B 35 -6 741 699 ;
+C 88 ; WX 768 ; N a51 ; B 35 -7 734 699 ;
+C 89 ; WX 792 ; N a52 ; B 35 -14 757 705 ;
+C 90 ; WX 759 ; N a53 ; B 35 0 725 692 ;
+C 91 ; WX 707 ; N a54 ; B 35 -13 672 704 ;
+C 92 ; WX 708 ; N a55 ; B 35 -14 672 705 ;
+C 93 ; WX 682 ; N a56 ; B 35 -14 647 705 ;
+C 94 ; WX 701 ; N a57 ; B 35 -14 666 705 ;
+C 95 ; WX 826 ; N a58 ; B 35 -14 791 705 ;
+C 96 ; WX 815 ; N a59 ; B 35 -14 780 705 ;
+C 97 ; WX 789 ; N a60 ; B 35 -14 754 705 ;
+C 98 ; WX 789 ; N a61 ; B 35 -14 754 705 ;
+C 99 ; WX 707 ; N a62 ; B 34 -14 673 705 ;
+C 100 ; WX 687 ; N a63 ; B 36 0 651 692 ;
+C 101 ; WX 696 ; N a64 ; B 35 0 661 691 ;
+C 102 ; WX 689 ; N a65 ; B 35 0 655 692 ;
+C 103 ; WX 786 ; N a66 ; B 34 -14 751 705 ;
+C 104 ; WX 787 ; N a67 ; B 35 -14 752 705 ;
+C 105 ; WX 713 ; N a68 ; B 35 -14 678 705 ;
+C 106 ; WX 791 ; N a69 ; B 35 -14 756 705 ;
+C 107 ; WX 785 ; N a70 ; B 36 -14 751 705 ;
+C 108 ; WX 791 ; N a71 ; B 35 -14 757 705 ;
+C 109 ; WX 873 ; N a72 ; B 35 -14 838 705 ;
+C 110 ; WX 761 ; N a73 ; B 35 0 726 692 ;
+C 111 ; WX 762 ; N a74 ; B 35 0 727 692 ;
+C 112 ; WX 762 ; N a203 ; B 35 0 727 692 ;
+C 113 ; WX 759 ; N a75 ; B 35 0 725 692 ;
+C 114 ; WX 759 ; N a204 ; B 35 0 725 692 ;
+C 115 ; WX 892 ; N a76 ; B 35 0 858 705 ;
+C 116 ; WX 892 ; N a77 ; B 35 -14 858 692 ;
+C 117 ; WX 788 ; N a78 ; B 35 -14 754 705 ;
+C 118 ; WX 784 ; N a79 ; B 35 -14 749 705 ;
+C 119 ; WX 438 ; N a81 ; B 35 -14 403 705 ;
+C 120 ; WX 138 ; N a82 ; B 35 0 104 692 ;
+C 121 ; WX 277 ; N a83 ; B 35 0 242 692 ;
+C 122 ; WX 415 ; N a84 ; B 35 0 380 692 ;
+C 123 ; WX 392 ; N a97 ; B 35 263 357 705 ;
+C 124 ; WX 392 ; N a98 ; B 34 263 357 705 ;
+C 125 ; WX 668 ; N a99 ; B 35 263 633 705 ;
+C 126 ; WX 668 ; N a100 ; B 36 263 634 705 ;
+C 128 ; WX 390 ; N a89 ; B 35 -14 356 705 ;
+C 129 ; WX 390 ; N a90 ; B 35 -14 355 705 ;
+C 130 ; WX 317 ; N a93 ; B 35 0 283 692 ;
+C 131 ; WX 317 ; N a94 ; B 35 0 283 692 ;
+C 132 ; WX 276 ; N a91 ; B 35 0 242 692 ;
+C 133 ; WX 276 ; N a92 ; B 35 0 242 692 ;
+C 134 ; WX 509 ; N a205 ; B 35 0 475 692 ;
+C 135 ; WX 509 ; N a85 ; B 35 0 475 692 ;
+C 136 ; WX 410 ; N a206 ; B 35 0 375 692 ;
+C 137 ; WX 410 ; N a86 ; B 35 0 375 692 ;
+C 138 ; WX 234 ; N a87 ; B 35 -14 199 705 ;
+C 139 ; WX 234 ; N a88 ; B 35 -14 199 705 ;
+C 140 ; WX 334 ; N a95 ; B 35 0 299 692 ;
+C 141 ; WX 334 ; N a96 ; B 35 0 299 692 ;
+C 161 ; WX 732 ; N a101 ; B 35 -143 697 806 ;
+C 162 ; WX 544 ; N a102 ; B 56 -14 488 706 ;
+C 163 ; WX 544 ; N a103 ; B 34 -14 508 705 ;
+C 164 ; WX 910 ; N a104 ; B 35 40 875 651 ;
+C 165 ; WX 667 ; N a106 ; B 35 -14 633 705 ;
+C 166 ; WX 760 ; N a107 ; B 35 -14 726 705 ;
+C 167 ; WX 760 ; N a108 ; B 0 121 758 569 ;
+C 168 ; WX 776 ; N a112 ; B 35 0 741 705 ;
+C 169 ; WX 595 ; N a111 ; B 34 -14 560 705 ;
+C 170 ; WX 694 ; N a110 ; B 35 -14 659 705 ;
+C 171 ; WX 626 ; N a109 ; B 34 0 591 705 ;
+C 172 ; WX 788 ; N a120 ; B 35 -14 754 705 ;
+C 173 ; WX 788 ; N a121 ; B 35 -14 754 705 ;
+C 174 ; WX 788 ; N a122 ; B 35 -14 754 705 ;
+C 175 ; WX 788 ; N a123 ; B 35 -14 754 705 ;
+C 176 ; WX 788 ; N a124 ; B 35 -14 754 705 ;
+C 177 ; WX 788 ; N a125 ; B 35 -14 754 705 ;
+C 178 ; WX 788 ; N a126 ; B 35 -14 754 705 ;
+C 179 ; WX 788 ; N a127 ; B 35 -14 754 705 ;
+C 180 ; WX 788 ; N a128 ; B 35 -14 754 705 ;
+C 181 ; WX 788 ; N a129 ; B 35 -14 754 705 ;
+C 182 ; WX 788 ; N a130 ; B 35 -14 754 705 ;
+C 183 ; WX 788 ; N a131 ; B 35 -14 754 705 ;
+C 184 ; WX 788 ; N a132 ; B 35 -14 754 705 ;
+C 185 ; WX 788 ; N a133 ; B 35 -14 754 705 ;
+C 186 ; WX 788 ; N a134 ; B 35 -14 754 705 ;
+C 187 ; WX 788 ; N a135 ; B 35 -14 754 705 ;
+C 188 ; WX 788 ; N a136 ; B 35 -14 754 705 ;
+C 189 ; WX 788 ; N a137 ; B 35 -14 754 705 ;
+C 190 ; WX 788 ; N a138 ; B 35 -14 754 705 ;
+C 191 ; WX 788 ; N a139 ; B 35 -14 754 705 ;
+C 192 ; WX 788 ; N a140 ; B 35 -14 754 705 ;
+C 193 ; WX 788 ; N a141 ; B 35 -14 754 705 ;
+C 194 ; WX 788 ; N a142 ; B 35 -14 754 705 ;
+C 195 ; WX 788 ; N a143 ; B 35 -14 754 705 ;
+C 196 ; WX 788 ; N a144 ; B 35 -14 754 705 ;
+C 197 ; WX 788 ; N a145 ; B 35 -14 754 705 ;
+C 198 ; WX 788 ; N a146 ; B 35 -14 754 705 ;
+C 199 ; WX 788 ; N a147 ; B 35 -14 754 705 ;
+C 200 ; WX 788 ; N a148 ; B 35 -14 754 705 ;
+C 201 ; WX 788 ; N a149 ; B 35 -14 754 705 ;
+C 202 ; WX 788 ; N a150 ; B 35 -14 754 705 ;
+C 203 ; WX 788 ; N a151 ; B 35 -14 754 705 ;
+C 204 ; WX 788 ; N a152 ; B 35 -14 754 705 ;
+C 205 ; WX 788 ; N a153 ; B 35 -14 754 705 ;
+C 206 ; WX 788 ; N a154 ; B 35 -14 754 705 ;
+C 207 ; WX 788 ; N a155 ; B 35 -14 754 705 ;
+C 208 ; WX 788 ; N a156 ; B 35 -14 754 705 ;
+C 209 ; WX 788 ; N a157 ; B 35 -14 754 705 ;
+C 210 ; WX 788 ; N a158 ; B 35 -14 754 705 ;
+C 211 ; WX 788 ; N a159 ; B 35 -14 754 705 ;
+C 212 ; WX 894 ; N a160 ; B 35 58 860 634 ;
+C 213 ; WX 838 ; N a161 ; B 35 152 803 540 ;
+C 214 ; WX 1016 ; N a163 ; B 34 152 981 540 ;
+C 215 ; WX 458 ; N a164 ; B 35 -127 422 820 ;
+C 216 ; WX 748 ; N a196 ; B 35 94 698 597 ;
+C 217 ; WX 924 ; N a165 ; B 35 140 890 552 ;
+C 218 ; WX 748 ; N a192 ; B 35 94 698 597 ;
+C 219 ; WX 918 ; N a166 ; B 35 166 884 526 ;
+C 220 ; WX 927 ; N a167 ; B 35 32 892 660 ;
+C 221 ; WX 928 ; N a168 ; B 35 129 891 562 ;
+C 222 ; WX 928 ; N a169 ; B 35 128 893 563 ;
+C 223 ; WX 834 ; N a170 ; B 35 155 799 537 ;
+C 224 ; WX 873 ; N a171 ; B 35 93 838 599 ;
+C 225 ; WX 828 ; N a172 ; B 35 104 791 588 ;
+C 226 ; WX 924 ; N a173 ; B 35 98 889 594 ;
+C 227 ; WX 924 ; N a162 ; B 35 98 889 594 ;
+C 228 ; WX 917 ; N a174 ; B 35 0 882 692 ;
+C 229 ; WX 930 ; N a175 ; B 35 84 896 608 ;
+C 230 ; WX 931 ; N a176 ; B 35 84 896 608 ;
+C 231 ; WX 463 ; N a177 ; B 35 -99 429 791 ;
+C 232 ; WX 883 ; N a178 ; B 35 71 848 623 ;
+C 233 ; WX 836 ; N a179 ; B 35 44 802 648 ;
+C 234 ; WX 836 ; N a193 ; B 35 44 802 648 ;
+C 235 ; WX 867 ; N a180 ; B 35 101 832 591 ;
+C 236 ; WX 867 ; N a199 ; B 35 101 832 591 ;
+C 237 ; WX 696 ; N a181 ; B 35 44 661 648 ;
+C 238 ; WX 696 ; N a200 ; B 35 44 661 648 ;
+C 239 ; WX 874 ; N a182 ; B 35 77 840 619 ;
+C 241 ; WX 874 ; N a201 ; B 35 73 840 615 ;
+C 242 ; WX 760 ; N a183 ; B 35 0 725 692 ;
+C 243 ; WX 946 ; N a184 ; B 35 160 911 533 ;
+C 244 ; WX 771 ; N a197 ; B 34 37 736 655 ;
+C 245 ; WX 865 ; N a185 ; B 35 207 830 481 ;
+C 246 ; WX 771 ; N a194 ; B 34 37 736 655 ;
+C 247 ; WX 888 ; N a198 ; B 34 -19 853 712 ;
+C 248 ; WX 967 ; N a186 ; B 35 124 932 568 ;
+C 249 ; WX 888 ; N a195 ; B 34 -19 853 712 ;
+C 250 ; WX 831 ; N a187 ; B 35 113 796 579 ;
+C 251 ; WX 873 ; N a188 ; B 36 118 838 578 ;
+C 252 ; WX 927 ; N a189 ; B 35 150 891 542 ;
+C 253 ; WX 970 ; N a190 ; B 35 76 931 616 ;
+C 254 ; WX 918 ; N a191 ; B 34 99 884 593 ;
+EndCharMetrics
+EndFontMetrics
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/readme.txt b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/readme.txt
new file mode 100644
index 0000000000000000000000000000000000000000..047ae70a17540bae9a246cb206480a1760d820b2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts/readme.txt
@@ -0,0 +1,15 @@
+Font Metrics for the 14 PDF Core Fonts
+======================================
+
+This directory contains font metrics for the 14 PDF Core Fonts,
+downloaded from Adobe. The title and this paragraph were added by
+Matplotlib developers. The download URL was
+.
+
+This file and the 14 PostScript(R) AFM files it accompanies may be used, copied,
+and distributed for any purpose and without charge, with or without modification,
+provided that all copyright notices are retained; that the AFM files are not
+distributed without this file; that all modifications to this file or any of
+the AFM files are prominently noted in the modified file(s); and that this
+paragraph is not modified. Adobe Systems has no responsibility or obligation
+to support the use of the AFM files.
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansDisplay.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansDisplay.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..36758a2e70b6eb05ef8f8694828ed0eb157be3d3
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSansDisplay.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSerifDisplay.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSerifDisplay.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..1623714d223f2b4ae5460269cf3afa34e91dd811
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSerifDisplay.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/LICENSE_DEJAVU b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/LICENSE_DEJAVU
new file mode 100644
index 0000000000000000000000000000000000000000..254e2cc42a6d0135cccf2047768b9e44f25e666f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/LICENSE_DEJAVU
@@ -0,0 +1,99 @@
+Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
+Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
+
+Bitstream Vera Fonts Copyright
+------------------------------
+
+Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
+a trademark of Bitstream, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of the fonts accompanying this license ("Fonts") and associated
+documentation files (the "Font Software"), to reproduce and distribute the
+Font Software, including without limitation the rights to use, copy, merge,
+publish, distribute, and/or sell copies of the Font Software, and to permit
+persons to whom the Font Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright and trademark notices and this permission notice shall
+be included in all copies of one or more of the Font Software typefaces.
+
+The Font Software may be modified, altered, or added to, and in particular
+the designs of glyphs or characters in the Fonts may be modified and
+additional glyphs or characters may be added to the Fonts, only if the fonts
+are renamed to names not containing either the words "Bitstream" or the word
+"Vera".
+
+This License becomes null and void to the extent applicable to Fonts or Font
+Software that has been modified and is distributed under the "Bitstream
+Vera" names.
+
+The Font Software may be sold as part of a larger software package but no
+copy of one or more of the Font Software typefaces may be sold by itself.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
+TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
+FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
+ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
+FONT SOFTWARE.
+
+Except as contained in this notice, the names of Gnome, the Gnome
+Foundation, and Bitstream Inc., shall not be used in advertising or
+otherwise to promote the sale, use or other dealings in this Font Software
+without prior written authorization from the Gnome Foundation or Bitstream
+Inc., respectively. For further information, contact: fonts at gnome dot
+org.
+
+Arev Fonts Copyright
+------------------------------
+
+Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the fonts accompanying this license ("Fonts") and
+associated documentation files (the "Font Software"), to reproduce
+and distribute the modifications to the Bitstream Vera Font Software,
+including without limitation the rights to use, copy, merge, publish,
+distribute, and/or sell copies of the Font Software, and to permit
+persons to whom the Font Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright and trademark notices and this permission notice
+shall be included in all copies of one or more of the Font Software
+typefaces.
+
+The Font Software may be modified, altered, or added to, and in
+particular the designs of glyphs or characters in the Fonts may be
+modified and additional glyphs or characters may be added to the
+Fonts, only if the fonts are renamed to names not containing either
+the words "Tavmjong Bah" or the word "Arev".
+
+This License becomes null and void to the extent applicable to Fonts
+or Font Software that has been modified and is distributed under the
+"Tavmjong Bah Arev" names.
+
+The Font Software may be sold as part of a larger software package but
+no copy of one or more of the Font Software typefaces may be sold by
+itself.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
+TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the name of Tavmjong Bah shall not
+be used in advertising or otherwise to promote the sale, use or other
+dealings in this Font Software without prior written authorization
+from Tavmjong Bah. For further information, contact: tavmjong @ free
+. fr.
+
+$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX
new file mode 100644
index 0000000000000000000000000000000000000000..6034d94748146993f78c8059c345adafc860317b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/LICENSE_STIX
@@ -0,0 +1,124 @@
+The STIX fonts distributed with matplotlib have been modified from
+their canonical form. They have been converted from OTF to TTF format
+using Fontforge and this script:
+
+ #!/usr/bin/env fontforge
+ i=1
+ while ( i<$argc )
+ Open($argv[i])
+ Generate($argv[i]:r + ".ttf")
+ i = i+1
+ endloop
+
+The original STIX Font License begins below.
+
+-----------------------------------------------------------
+
+STIX Font License
+
+24 May 2010
+
+Copyright (c) 2001-2010 by the STI Pub Companies, consisting of the American
+Institute of Physics, the American Chemical Society, the American Mathematical
+Society, the American Physical Society, Elsevier, Inc., and The Institute of
+Electrical and Electronic Engineers, Inc. (www.stixfonts.org), with Reserved
+Font Name STIX Fonts, STIX Fonts (TM) is a trademark of The Institute of
+Electrical and Electronics Engineers, Inc.
+
+Portions copyright (c) 1998-2003 by MicroPress, Inc. (www.micropress-inc.com),
+with Reserved Font Name TM Math. To obtain additional mathematical fonts, please
+contact MicroPress, Inc., 68-30 Harrow Street, Forest Hills, NY 11375, USA,
+Phone: (718) 575-1816.
+
+Portions copyright (c) 1990 by Elsevier, Inc.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://scripts.sil.org/OFL
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..a70c797d092dee1819ec9dcdffa2e6c62b92e12b
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUni.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..ccbd9a6011694d06644eb3e4a97f377145eebf19
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBol.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..e75e09e6c0c376e117789e9287d1a95de9acb009
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniBolIta.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..c27d42fb250a5881efeccbf9c9dabca18efe958b
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXNonUniIta.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..f81717ec1d0c057dcf1be2b9ac4e282fdfbe7987
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFiveSymReg.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..855dec982374b3f452120cbc47e5a892ef51c02b
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymBol.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..f955ca2ad1ba36cd36e185671843448854d517dc
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizFourSymReg.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..6ffd35778fd8eebf304a4842edd92ee49398567a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymBol.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..01ed101cd477dfb112616440bdb6a8a54a30cb67
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizOneSymReg.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..1ccf365e8f1635df3d0672a92c416dca0e8ef033
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymBol.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..bf2b66af7620441b260a339358adf5c9628a4d4e
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizThreeSymReg.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..bd5f93f0e48d5d993b349c160cb2efac071e8599
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymBol.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..73b9930f6cf7388f3337355ffc5cc0035c053e34
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/STIXSizTwoSymReg.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmb10.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmb10.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..189bdf0f0a01c2fb07e436ee4e348ae681b5dd97
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmb10.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..e4b468dcd37369fba8329f015fa644d9053848da
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..8d326610412db20c62cd2f9aa0cfc06f334ab648
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..8bc44966a84421629220f03a87d1cf479733d2aa
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmss10.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmss10.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..ef70532c71098c1ebb1e1666ae89ecc70ac8708a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmss10.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..45d8421a5b118b1f49132337f80fb7730521483a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf
new file mode 100644
index 0000000000000000000000000000000000000000..15bdb68b3f7165c68547949e0b2c0263a7438add
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back-symbolic.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back-symbolic.svg
new file mode 100644
index 0000000000000000000000000000000000000000..0c2d653cbe8f9047f989226d5a00f7fd74ac0695
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back-symbolic.svg
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..79709d8f435ef2031ee4129b2180e725dd1a8d21
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back.pdf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back.svg
new file mode 100644
index 0000000000000000000000000000000000000000..0c2d653cbe8f9047f989226d5a00f7fd74ac0695
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/back.svg
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave-symbolic.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave-symbolic.svg
new file mode 100644
index 0000000000000000000000000000000000000000..856721b6b5e2b671f28838a9e3569bc22b38215e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave-symbolic.svg
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..794a1152f602306c0326b0bac9b194323c521d83
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave.pdf
@@ -0,0 +1,70 @@
+%PDF-1.4
+%¬Ü «ŗ
+1 0 obj
+<< /Pages 2 0 R /Type /Catalog >>
+endobj
+8 0 obj
+<< /ExtGState 4 0 R /Font 3 0 R /Pattern 5 0 R
+/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /Shading 6 0 R
+/XObject 7 0 R >>
+endobj
+10 0 obj
+<< /Annots [ ] /Contents 9 0 R
+/Group << /CS /DeviceRGB /S /Transparency /Type /Group >>
+/MediaBox [ 0 0 72 72 ] /Parent 2 0 R /Resources 8 0 R /Type /Page >>
+endobj
+9 0 obj
+<< /Filter /FlateDecode /Length 11 0 R >>
+stream
+xŚuKn1D÷:
N@©Ļ2AŁē
+
ĒŃÉĘ@|ż¤Ö§£ŪoÄb"ķ«yśÄöåĶ:ūæwĖöa¾<’žq<}|¶Ēqą?MņxõĻ Ųßłß^]UõŻĻ$>zµģȧ2y”,ZßN£4¹’Ó_Ŗž«:äb;øP&¤Ź®§)k¬2„r#ńę3yėū¢§ėbcĆ,¶ÕĮČĖĶ«+ņc*aT»1&'ĶŽ“
+Zøź-pńšŽ"=¹\Ā-X“ Ę’azŻ«D¼IT“ób%ćū\Õ5Qr½’Z„uzõ(T?PTÅłRJwåļ@®f Ūü£¬4JĮōlćWÅA|īZØÓ-AšfäHźEŽšm 6ŅLft"Vė¹Sō+÷Č®¾ŗ\,Įiųv!³²ķRfż#ÉF¦½ŗ2oįķv#ę§÷ `:lō¤±%ÅN»vĒLEڵ”ĀŠ·]J=ŅĪö«ĘHōŃa,Ż5c`æŖf=æąi0W„·`5E?Öu!7x¢2vkt
žŌÖ±Ó®ÅBa1HŅėwgĄÕ½!æH¦š3ūĶ?»\Ŗ
+endstream
+endobj
+11 0 obj
+500
+endobj
+3 0 obj
+<< >>
+endobj
+4 0 obj
+<< /A1 << /CA 0 /Type /ExtGState /ca 0 >>
+/A2 << /CA 1 /Type /ExtGState /ca 1 >> >>
+endobj
+5 0 obj
+<< >>
+endobj
+6 0 obj
+<< >>
+endobj
+7 0 obj
+<< >>
+endobj
+2 0 obj
+<< /Count 1 /Kids [ 10 0 R ] /Type /Pages >>
+endobj
+12 0 obj
+<< /CreationDate (D:20160601123507-04'00')
+/Creator (matplotlib 1.5.2rc2.post1933.dev0+gb775a26, http://matplotlib.org)
+/Producer (matplotlib pdf backend) >>
+endobj
+xref
+0 13
+0000000000 65535 f
+0000000016 00000 n
+0000001161 00000 n
+0000000978 00000 n
+0000000999 00000 n
+0000001098 00000 n
+0000001119 00000 n
+0000001140 00000 n
+0000000065 00000 n
+0000000383 00000 n
+0000000208 00000 n
+0000000958 00000 n
+0000001221 00000 n
+trailer
+<< /Info 12 0 R /Root 1 0 R /Size 13 >>
+startxref
+1395
+%%EOF
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave.svg
new file mode 100644
index 0000000000000000000000000000000000000000..856721b6b5e2b671f28838a9e3569bc22b38215e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/filesave.svg
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward-symbolic.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward-symbolic.svg
new file mode 100644
index 0000000000000000000000000000000000000000..08b6fe174602b0c729b60cfe63af22468798ee95
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward-symbolic.svg
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ce4a1bcb1321efbc3836dc6358c0e5fe0ecca68d
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward.pdf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward.svg
new file mode 100644
index 0000000000000000000000000000000000000000..08b6fe174602b0c729b60cfe63af22468798ee95
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/forward.svg
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/hand.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/hand.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..13088169ee504507746571ce23c1686181e40576
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/hand.pdf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/hand.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/hand.svg
new file mode 100644
index 0000000000000000000000000000000000000000..28b96a2a9c4ac8abfabe8a0d8ba3d8ff0a62b573
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/hand.svg
@@ -0,0 +1,130 @@
+
+
+]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help-symbolic.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help-symbolic.svg
new file mode 100644
index 0000000000000000000000000000000000000000..260528d607aa59c7fabd5e8645a941064967645f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help-symbolic.svg
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..38178d05b2725addadec9f4c005a1a764f1096d1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help.pdf
@@ -0,0 +1,68 @@
+%PDF-1.4
+%¬Ü «ŗ
+1 0 obj
+<< /Pages 2 0 R /Type /Catalog >>
+endobj
+8 0 obj
+<< /ExtGState 4 0 R /Font 3 0 R /Pattern 5 0 R
+/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /Shading 6 0 R
+/XObject 7 0 R >>
+endobj
+10 0 obj
+<< /Annots [ ] /Contents 9 0 R
+/Group << /CS /DeviceRGB /S /Transparency /Type /Group >>
+/MediaBox [ 0 0 72 72 ] /Parent 2 0 R /Resources 8 0 R /Type /Page >>
+endobj
+9 0 obj
+<< /Filter /FlateDecode /Length 11 0 R >>
+stream
+xŚmĶS1
÷yūŲγ!Ķ-bUŖĢf$x}ōŽ^Ō*Õ×8>>¶y»¦§¼½¾oy»āūgū²}Åłmćķy{śōņūēååóóĒķņ2ųÆŌĒĶ|nqüHé
/É|éŃ׿„ĄR*Jb\nÜ(¢½āĮ5sXZ;įGL½ č÷j;Ż»%e2éĘz@ ÖĮ÷'““\ŅA
µū{;Ėc¬ą¢Rįv);ŗ¤Cōoé(n{G4\`r$=“Øņ,(8#¶÷JĆTæµ”ŚLķ„PÕ]\¦6d9ĘālD XxĶeņ¼ÅvļĆ@&Y=vŁrX:4צøTOzsŖ„xZE¹5īµęŁ"cŽ3B\ói!rućnzͲ]²xK&©6»Øź Cŗ×ĮX(×0i/V+5Éč£ĮÕ©FŹ0
Łó-Į<īU9²eYóM©“Q©±£Ī"Ń}BåmłćĀpź½¶Vγļīą!XŲžŁbf9/0T"øµ$÷bĶbėé^ģC±Ņģz¹*!½¬
ø3^£?}Yęp«ųWRńKbś\Įšņ®]Ōm^ńĆ~1Õ¹’Ł9_Åō=„æńb«
+endstream
+endobj
+11 0 obj
+549
+endobj
+3 0 obj
+<< >>
+endobj
+4 0 obj
+<< /A1 << /CA 0 /Type /ExtGState /ca 0 >>
+/A2 << /CA 1 /Type /ExtGState /ca 1 >> >>
+endobj
+5 0 obj
+<< >>
+endobj
+6 0 obj
+<< >>
+endobj
+7 0 obj
+<< >>
+endobj
+2 0 obj
+<< /Count 1 /Kids [ 10 0 R ] /Type /Pages >>
+endobj
+12 0 obj
+<< /CreationDate (D:20170812144045-04'00')
+/Creator (matplotlib 2.0.2.post4623.dev0+gcb3aea0db, http://matplotlib.org)
+/Producer (matplotlib pdf backend 2.0.2.post4623.dev0+gcb3aea0db) >>
+endobj
+xref
+0 13
+0000000000 65535 f
+0000000016 00000 n
+0000001210 00000 n
+0000001027 00000 n
+0000001048 00000 n
+0000001147 00000 n
+0000001168 00000 n
+0000001189 00000 n
+0000000065 00000 n
+0000000383 00000 n
+0000000208 00000 n
+0000001007 00000 n
+0000001270 00000 n
+trailer
+<< /Info 12 0 R /Root 1 0 R /Size 13 >>
+startxref
+1474
+%%EOF
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help.svg
new file mode 100644
index 0000000000000000000000000000000000000000..260528d607aa59c7fabd5e8645a941064967645f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/help.svg
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home-symbolic.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home-symbolic.svg
new file mode 100644
index 0000000000000000000000000000000000000000..db140d43d156b52336d1c7e9d74afb0a0726b6b5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home-symbolic.svg
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f9c6439b9b84bfdf40a2570d6971951b94977841
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home.pdf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home.svg
new file mode 100644
index 0000000000000000000000000000000000000000..db140d43d156b52336d1c7e9d74afb0a0726b6b5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/home.svg
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/matplotlib.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/matplotlib.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..6c44566ad819ba31e93bf50d3b7c2b9fa1bb8f64
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/matplotlib.pdf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/matplotlib.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/matplotlib.svg
new file mode 100644
index 0000000000000000000000000000000000000000..95d1b61203bfad44c8b31fb7bf215c4107d8a830
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/matplotlib.svg
@@ -0,0 +1,3171 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move-symbolic.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move-symbolic.svg
new file mode 100644
index 0000000000000000000000000000000000000000..f7e23ab0451ce2c3f6290e1f093771a0a1a58c9b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move-symbolic.svg
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..d883d9224a6e61436205a18182f5e66708312976
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move.pdf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move.svg
new file mode 100644
index 0000000000000000000000000000000000000000..f7e23ab0451ce2c3f6290e1f093771a0a1a58c9b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/move.svg
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/qt4_editor_options.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/qt4_editor_options.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..a92f2cc3aaee87f45926546bcc135f40a357160a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/qt4_editor_options.pdf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/qt4_editor_options.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/qt4_editor_options.svg
new file mode 100644
index 0000000000000000000000000000000000000000..02adfbc4ae11f473606591813e3360cbf39111fe
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/qt4_editor_options.svg
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots-symbolic.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots-symbolic.svg
new file mode 100644
index 0000000000000000000000000000000000000000..9a0fa90972ff2788edb7791e057e2aced59cf84f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots-symbolic.svg
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..f404665579a0b1916174203f13f7339a75a347a5
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots.pdf differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots.svg
new file mode 100644
index 0000000000000000000000000000000000000000..9a0fa90972ff2788edb7791e057e2aced59cf84f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/subplots.svg
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect-symbolic.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect-symbolic.svg
new file mode 100644
index 0000000000000000000000000000000000000000..44e59a8a4fdca9148d0912d4699c5626dd676834
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect-symbolic.svg
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect.pdf b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..22add33bb8f9f99112681f4ddc52ec96dca8c537
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect.pdf
@@ -0,0 +1,68 @@
+%PDF-1.4
+%¬Ü «ŗ
+1 0 obj
+<< /Pages 2 0 R /Type /Catalog >>
+endobj
+8 0 obj
+<< /ExtGState 4 0 R /Font 3 0 R /Pattern 5 0 R
+/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /Shading 6 0 R
+/XObject 7 0 R >>
+endobj
+10 0 obj
+<< /Annots [ ] /Contents 9 0 R
+/Group << /CS /DeviceRGB /S /Transparency /Type /Group >>
+/MediaBox [ 0 0 72 72 ] /Parent 2 0 R /Resources 8 0 R /Type /Page >>
+endobj
+9 0 obj
+<< /Filter /FlateDecode /Length 11 0 R >>
+stream
+xŚmRKn1Ūė>b},ŪĖŽ¾W$i×n“×/m÷HŲ $,é¾Hz}O9½į’$ŻŅÓ·ē??ēļ·Æéx§üUÅq¾;Ąyü ś
]ÆØ,·q'ņĘā¹[MÖŁ„Gk ŗ ³7·>
+endobj
+4 0 obj
+<< /A1 << /CA 0 /Type /ExtGState /ca 0 >>
+/A2 << /CA 1 /Type /ExtGState /ca 1 >> >>
+endobj
+5 0 obj
+<< >>
+endobj
+6 0 obj
+<< >>
+endobj
+7 0 obj
+<< >>
+endobj
+2 0 obj
+<< /Count 1 /Kids [ 10 0 R ] /Type /Pages >>
+endobj
+12 0 obj
+<< /CreationDate (D:20160601123507-04'00')
+/Creator (matplotlib 1.5.2rc2.post1933.dev0+gb775a26, http://matplotlib.org)
+/Producer (matplotlib pdf backend) >>
+endobj
+xref
+0 13
+0000000000 65535 f
+0000000016 00000 n
+0000001036 00000 n
+0000000853 00000 n
+0000000874 00000 n
+0000000973 00000 n
+0000000994 00000 n
+0000001015 00000 n
+0000000065 00000 n
+0000000383 00000 n
+0000000208 00000 n
+0000000833 00000 n
+0000001096 00000 n
+trailer
+<< /Info 12 0 R /Root 1 0 R /Size 13 >>
+startxref
+1270
+%%EOF
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect.svg b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect.svg
new file mode 100644
index 0000000000000000000000000000000000000000..44e59a8a4fdca9148d0912d4699c5626dd676834
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/images/zoom_to_rect.svg
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/kpsewhich.lua b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/kpsewhich.lua
new file mode 100644
index 0000000000000000000000000000000000000000..8e9172a45082567bee6802113aa40664d1bfc010
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/kpsewhich.lua
@@ -0,0 +1,3 @@
+-- see dviread._LuatexKpsewhich
+kpse.set_program_name("latex")
+while true do print(kpse.lookup(io.read():gsub("\r", ""))); io.flush(); end
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/matplotlibrc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/matplotlibrc
new file mode 100644
index 0000000000000000000000000000000000000000..df4f4afadf96bfb30c5eb62f2b9301994cc395fd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/matplotlibrc
@@ -0,0 +1,813 @@
+#### MATPLOTLIBRC FORMAT
+
+## NOTE FOR END USERS: DO NOT EDIT THIS FILE!
+##
+## This is a sample Matplotlib configuration file - you can find a copy
+## of it on your system in site-packages/matplotlib/mpl-data/matplotlibrc
+## (relative to your Python installation location).
+## DO NOT EDIT IT!
+##
+## If you wish to change your default style, copy this file to one of the
+## following locations:
+## Unix/Linux:
+## $HOME/.config/matplotlib/matplotlibrc OR
+## $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is set)
+## Other platforms:
+## $HOME/.matplotlib/matplotlibrc
+## and edit that copy.
+##
+## See https://matplotlib.org/stable/users/explain/customizing.html#customizing-with-matplotlibrc-files
+## for more details on the paths which are checked for the configuration file.
+##
+## Blank lines, or lines starting with a comment symbol, are ignored, as are
+## trailing comments. Other lines must have the format:
+## key: val # optional comment
+##
+## Formatting: Use PEP8-like style (as enforced in the rest of the codebase).
+## All lines start with an additional '#', so that removing all leading '#'s
+## yields a valid style file.
+##
+## Colors: for the color values below, you can either use
+## - a Matplotlib color string, such as r, k, or b
+## - an RGB tuple, such as (1.0, 0.5, 0.0)
+## - a double-quoted hex string, such as "#ff00ff".
+## The unquoted string ff00ff is also supported for backward
+## compatibility, but is discouraged.
+## - a scalar grayscale intensity such as 0.75
+## - a legal html color name, e.g., red, blue, darkslategray
+##
+## String values may optionally be enclosed in double quotes, which allows
+## using the comment character # in the string.
+##
+## This file (and other style files) must be encoded as utf-8.
+##
+## Matplotlib configuration are currently divided into following parts:
+## - BACKENDS
+## - LINES
+## - PATCHES
+## - HATCHES
+## - BOXPLOT
+## - FONT
+## - TEXT
+## - LaTeX
+## - AXES
+## - DATES
+## - TICKS
+## - GRIDS
+## - LEGEND
+## - FIGURE
+## - IMAGES
+## - CONTOUR PLOTS
+## - ERRORBAR PLOTS
+## - HISTOGRAM PLOTS
+## - SCATTER PLOTS
+## - AGG RENDERING
+## - PATHS
+## - SAVING FIGURES
+## - INTERACTIVE KEYMAPS
+## - ANIMATION
+
+##### CONFIGURATION BEGINS HERE
+
+
+## ***************************************************************************
+## * BACKENDS *
+## ***************************************************************************
+## The default backend. If you omit this parameter, the first working
+## backend from the following list is used:
+## MacOSX QtAgg Gtk4Agg Gtk3Agg TkAgg WxAgg Agg
+## Other choices include:
+## QtCairo GTK4Cairo GTK3Cairo TkCairo WxCairo Cairo
+## Qt5Agg Qt5Cairo Wx # deprecated.
+## PS PDF SVG Template
+## You can also deploy your own backend outside of Matplotlib by referring to
+## the module name (which must be in the PYTHONPATH) as 'module://my_backend'.
+##backend: Agg
+
+## The port to use for the web server in the WebAgg backend.
+#webagg.port: 8988
+
+## The address on which the WebAgg web server should be reachable
+#webagg.address: 127.0.0.1
+
+## If webagg.port is unavailable, a number of other random ports will
+## be tried until one that is available is found.
+#webagg.port_retries: 50
+
+## When True, open the web browser to the plot that is shown
+#webagg.open_in_browser: True
+
+## If you are running pyplot inside a GUI and your backend choice
+## conflicts, we will automatically try to find a compatible one for
+## you if backend_fallback is True
+#backend_fallback: True
+
+#interactive: False
+#figure.hooks: # list of dotted.module.name:dotted.callable.name
+#toolbar: toolbar2 # {None, toolbar2, toolmanager}
+#timezone: UTC # a pytz timezone string, e.g., US/Central or Europe/Paris
+
+
+## ***************************************************************************
+## * LINES *
+## ***************************************************************************
+## See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.lines
+## for more information on line properties.
+#lines.linewidth: 1.5 # line width in points
+#lines.linestyle: - # solid line
+#lines.color: C0 # has no affect on plot(); see axes.prop_cycle
+#lines.marker: None # the default marker
+#lines.markerfacecolor: auto # the default marker face color
+#lines.markeredgecolor: auto # the default marker edge color
+#lines.markeredgewidth: 1.0 # the line width around the marker symbol
+#lines.markersize: 6 # marker size, in points
+#lines.dash_joinstyle: round # {miter, round, bevel}
+#lines.dash_capstyle: butt # {butt, round, projecting}
+#lines.solid_joinstyle: round # {miter, round, bevel}
+#lines.solid_capstyle: projecting # {butt, round, projecting}
+#lines.antialiased: True # render lines in antialiased (no jaggies)
+
+## The three standard dash patterns. These are scaled by the linewidth.
+#lines.dashed_pattern: 3.7, 1.6
+#lines.dashdot_pattern: 6.4, 1.6, 1, 1.6
+#lines.dotted_pattern: 1, 1.65
+#lines.scale_dashes: True
+
+#markers.fillstyle: full # {full, left, right, bottom, top, none}
+
+#pcolor.shading: auto
+#pcolormesh.snap: True # Whether to snap the mesh to pixel boundaries. This is
+ # provided solely to allow old test images to remain
+ # unchanged. Set to False to obtain the previous behavior.
+
+## ***************************************************************************
+## * PATCHES *
+## ***************************************************************************
+## Patches are graphical objects that fill 2D space, like polygons or circles.
+## See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.patches
+## for more information on patch properties.
+#patch.linewidth: 1.0 # edge width in points.
+#patch.facecolor: C0
+#patch.edgecolor: black # By default, Patches and Collections do not draw edges.
+ # This value is only used if facecolor is "none"
+ # (an Artist without facecolor and edgecolor would be
+ # invisible) or if patch.force_edgecolor is True.
+#patch.force_edgecolor: False # By default, Patches and Collections do not draw edges.
+ # Set this to True to draw edges with patch.edgedcolor
+ # as the default edgecolor.
+ # This is mainly relevant for styles.
+#patch.antialiased: True # render patches in antialiased (no jaggies)
+
+
+## ***************************************************************************
+## * HATCHES *
+## ***************************************************************************
+#hatch.color: black
+#hatch.linewidth: 1.0
+
+
+## ***************************************************************************
+## * BOXPLOT *
+## ***************************************************************************
+#boxplot.notch: False
+#boxplot.vertical: True
+#boxplot.whiskers: 1.5
+#boxplot.bootstrap: None
+#boxplot.patchartist: False
+#boxplot.showmeans: False
+#boxplot.showcaps: True
+#boxplot.showbox: True
+#boxplot.showfliers: True
+#boxplot.meanline: False
+
+#boxplot.flierprops.color: black
+#boxplot.flierprops.marker: o
+#boxplot.flierprops.markerfacecolor: none
+#boxplot.flierprops.markeredgecolor: black
+#boxplot.flierprops.markeredgewidth: 1.0
+#boxplot.flierprops.markersize: 6
+#boxplot.flierprops.linestyle: none
+#boxplot.flierprops.linewidth: 1.0
+
+#boxplot.boxprops.color: black
+#boxplot.boxprops.linewidth: 1.0
+#boxplot.boxprops.linestyle: -
+
+#boxplot.whiskerprops.color: black
+#boxplot.whiskerprops.linewidth: 1.0
+#boxplot.whiskerprops.linestyle: -
+
+#boxplot.capprops.color: black
+#boxplot.capprops.linewidth: 1.0
+#boxplot.capprops.linestyle: -
+
+#boxplot.medianprops.color: C1
+#boxplot.medianprops.linewidth: 1.0
+#boxplot.medianprops.linestyle: -
+
+#boxplot.meanprops.color: C2
+#boxplot.meanprops.marker: ^
+#boxplot.meanprops.markerfacecolor: C2
+#boxplot.meanprops.markeredgecolor: C2
+#boxplot.meanprops.markersize: 6
+#boxplot.meanprops.linestyle: --
+#boxplot.meanprops.linewidth: 1.0
+
+
+## ***************************************************************************
+## * FONT *
+## ***************************************************************************
+## The font properties used by `text.Text`.
+## See https://matplotlib.org/stable/api/font_manager_api.html for more information
+## on font properties. The 6 font properties used for font matching are
+## given below with their default values.
+##
+## The font.family property can take either a single or multiple entries of any
+## combination of concrete font names (not supported when rendering text with
+## usetex) or the following five generic values:
+## - 'serif' (e.g., Times),
+## - 'sans-serif' (e.g., Helvetica),
+## - 'cursive' (e.g., Zapf-Chancery),
+## - 'fantasy' (e.g., Western), and
+## - 'monospace' (e.g., Courier).
+## Each of these values has a corresponding default list of font names
+## (font.serif, etc.); the first available font in the list is used. Note that
+## for font.serif, font.sans-serif, and font.monospace, the first element of
+## the list (a DejaVu font) will always be used because DejaVu is shipped with
+## Matplotlib and is thus guaranteed to be available; the other entries are
+## left as examples of other possible values.
+##
+## The font.style property has three values: normal (or roman), italic
+## or oblique. The oblique style will be used for italic, if it is not
+## present.
+##
+## The font.variant property has two values: normal or small-caps. For
+## TrueType fonts, which are scalable fonts, small-caps is equivalent
+## to using a font size of 'smaller', or about 83 % of the current font
+## size.
+##
+## The font.weight property has effectively 13 values: normal, bold,
+## bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as
+## 400, and bold is 700. bolder and lighter are relative values with
+## respect to the current weight.
+##
+## The font.stretch property has 11 values: ultra-condensed,
+## extra-condensed, condensed, semi-condensed, normal, semi-expanded,
+## expanded, extra-expanded, ultra-expanded, wider, and narrower. This
+## property is not currently implemented.
+##
+## The font.size property is the default font size for text, given in points.
+## 10 pt is the standard value.
+##
+## Note that font.size controls default text sizes. To configure
+## special text sizes tick labels, axes, labels, title, etc., see the rc
+## settings for axes and ticks. Special text sizes can be defined
+## relative to font.size, using the following values: xx-small, x-small,
+## small, medium, large, x-large, xx-large, larger, or smaller
+
+#font.family: sans-serif
+#font.style: normal
+#font.variant: normal
+#font.weight: normal
+#font.stretch: normal
+#font.size: 10.0
+
+#font.serif: DejaVu Serif, Bitstream Vera Serif, Computer Modern Roman, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
+#font.sans-serif: DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
+#font.cursive: Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, Comic Neue, Comic Sans MS, cursive
+#font.fantasy: Chicago, Charcoal, Impact, Western, xkcd script, fantasy
+#font.monospace: DejaVu Sans Mono, Bitstream Vera Sans Mono, Computer Modern Typewriter, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
+
+
+## ***************************************************************************
+## * TEXT *
+## ***************************************************************************
+## The text properties used by `text.Text`.
+## See https://matplotlib.org/stable/api/artist_api.html#module-matplotlib.text
+## for more information on text properties
+#text.color: black
+
+## FreeType hinting flag ("foo" corresponds to FT_LOAD_FOO); may be one of the
+## following (Proprietary Matplotlib-specific synonyms are given in parentheses,
+## but their use is discouraged):
+## - default: Use the font's native hinter if possible, else FreeType's auto-hinter.
+## ("either" is a synonym).
+## - no_autohint: Use the font's native hinter if possible, else don't hint.
+## ("native" is a synonym.)
+## - force_autohint: Use FreeType's auto-hinter. ("auto" is a synonym.)
+## - no_hinting: Disable hinting. ("none" is a synonym.)
+#text.hinting: force_autohint
+
+#text.hinting_factor: 8 # Specifies the amount of softness for hinting in the
+ # horizontal direction. A value of 1 will hint to full
+ # pixels. A value of 2 will hint to half pixels etc.
+#text.kerning_factor: 0 # Specifies the scaling factor for kerning values. This
+ # is provided solely to allow old test images to remain
+ # unchanged. Set to 6 to obtain previous behavior.
+ # Values other than 0 or 6 have no defined meaning.
+#text.antialiased: True # If True (default), the text will be antialiased.
+ # This only affects raster outputs.
+#text.parse_math: True # Use mathtext if there is an even number of unescaped
+ # dollar signs.
+
+
+## ***************************************************************************
+## * LaTeX *
+## ***************************************************************************
+## For more information on LaTeX properties, see
+## https://matplotlib.org/stable/users/explain/text/usetex.html
+#text.usetex: False # use latex for all text handling. The following fonts
+ # are supported through the usual rc parameter settings:
+ # new century schoolbook, bookman, times, palatino,
+ # zapf chancery, charter, serif, sans-serif, helvetica,
+ # avant garde, courier, monospace, computer modern roman,
+ # computer modern sans serif, computer modern typewriter
+#text.latex.preamble: # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
+ # AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
+ # IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
+ # text.latex.preamble is a single line of LaTeX code that
+ # will be passed on to the LaTeX system. It may contain
+ # any code that is valid for the LaTeX "preamble", i.e.
+ # between the "\documentclass" and "\begin{document}"
+ # statements.
+ # Note that it has to be put on a single line, which may
+ # become quite long.
+ # The following packages are always loaded with usetex,
+ # so beware of package collisions:
+ # geometry, inputenc, type1cm.
+ # PostScript (PSNFSS) font packages may also be
+ # loaded, depending on your font settings.
+
+## The following settings allow you to select the fonts in math mode.
+#mathtext.fontset: dejavusans # Should be 'dejavusans' (default),
+ # 'dejavuserif', 'cm' (Computer Modern), 'stix',
+ # 'stixsans' or 'custom'
+## "mathtext.fontset: custom" is defined by the mathtext.bf, .cal, .it, ...
+## settings which map a TeX font name to a fontconfig font pattern. (These
+## settings are not used for other font sets.)
+#mathtext.bf: sans:bold
+#mathtext.bfit: sans:italic:bold
+#mathtext.cal: cursive
+#mathtext.it: sans:italic
+#mathtext.rm: sans
+#mathtext.sf: sans
+#mathtext.tt: monospace
+#mathtext.fallback: cm # Select fallback font from ['cm' (Computer Modern), 'stix'
+ # 'stixsans'] when a symbol cannot be found in one of the
+ # custom math fonts. Select 'None' to not perform fallback
+ # and replace the missing character by a dummy symbol.
+#mathtext.default: it # The default font to use for math.
+ # Can be any of the LaTeX font names, including
+ # the special name "regular" for the same font
+ # used in regular text.
+
+
+## ***************************************************************************
+## * AXES *
+## ***************************************************************************
+## Following are default face and edge colors, default tick sizes,
+## default font sizes for tick labels, and so on. See
+## https://matplotlib.org/stable/api/axes_api.html#module-matplotlib.axes
+#axes.facecolor: white # axes background color
+#axes.edgecolor: black # axes edge color
+#axes.linewidth: 0.8 # edge line width
+#axes.grid: False # display grid or not
+#axes.grid.axis: both # which axis the grid should apply to
+#axes.grid.which: major # grid lines at {major, minor, both} ticks
+#axes.titlelocation: center # alignment of the title: {left, right, center}
+#axes.titlesize: large # font size of the axes title
+#axes.titleweight: normal # font weight of title
+#axes.titlecolor: auto # color of the axes title, auto falls back to
+ # text.color as default value
+#axes.titley: None # position title (axes relative units). None implies auto
+#axes.titlepad: 6.0 # pad between axes and title in points
+#axes.labelsize: medium # font size of the x and y labels
+#axes.labelpad: 4.0 # space between label and axis
+#axes.labelweight: normal # weight of the x and y labels
+#axes.labelcolor: black
+#axes.axisbelow: line # draw axis gridlines and ticks:
+ # - below patches (True)
+ # - above patches but below lines ('line')
+ # - above all (False)
+
+#axes.formatter.limits: -5, 6 # use scientific notation if log10
+ # of the axis range is smaller than the
+ # first or larger than the second
+#axes.formatter.use_locale: False # When True, format tick labels
+ # according to the user's locale.
+ # For example, use ',' as a decimal
+ # separator in the fr_FR locale.
+#axes.formatter.use_mathtext: False # When True, use mathtext for scientific
+ # notation.
+#axes.formatter.min_exponent: 0 # minimum exponent to format in scientific notation
+#axes.formatter.useoffset: True # If True, the tick label formatter
+ # will default to labeling ticks relative
+ # to an offset when the data range is
+ # small compared to the minimum absolute
+ # value of the data.
+#axes.formatter.offset_threshold: 4 # When useoffset is True, the offset
+ # will be used when it can remove
+ # at least this number of significant
+ # digits from tick labels.
+
+#axes.spines.left: True # display axis spines
+#axes.spines.bottom: True
+#axes.spines.top: True
+#axes.spines.right: True
+
+#axes.unicode_minus: True # use Unicode for the minus symbol rather than hyphen. See
+ # https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
+#axes.prop_cycle: cycler('color', ['1f77b4', 'ff7f0e', '2ca02c', 'd62728', '9467bd', '8c564b', 'e377c2', '7f7f7f', 'bcbd22', '17becf'])
+ # color cycle for plot lines as list of string color specs:
+ # single letter, long name, or web-style hex
+ # As opposed to all other parameters in this file, the color
+ # values must be enclosed in quotes for this parameter,
+ # e.g. '1f77b4', instead of 1f77b4.
+ # See also https://matplotlib.org/stable/users/explain/artists/color_cycle.html
+ # for more details on prop_cycle usage.
+#axes.xmargin: .05 # x margin. See `axes.Axes.margins`
+#axes.ymargin: .05 # y margin. See `axes.Axes.margins`
+#axes.zmargin: .05 # z margin. See `axes.Axes.margins`
+#axes.autolimit_mode: data # If "data", use axes.xmargin and axes.ymargin as is.
+ # If "round_numbers", after application of margins, axis
+ # limits are further expanded to the nearest "round" number.
+#polaraxes.grid: True # display grid on polar axes
+#axes3d.grid: True # display grid on 3D axes
+#axes3d.automargin: False # automatically add margin when manually setting 3D axis limits
+
+#axes3d.xaxis.panecolor: (0.95, 0.95, 0.95, 0.5) # background pane on 3D axes
+#axes3d.yaxis.panecolor: (0.90, 0.90, 0.90, 0.5) # background pane on 3D axes
+#axes3d.zaxis.panecolor: (0.925, 0.925, 0.925, 0.5) # background pane on 3D axes
+
+#axes3d.mouserotationstyle: arcball # {azel, trackball, sphere, arcball}
+ # See also https://matplotlib.org/stable/api/toolkits/mplot3d/view_angles.html#rotation-with-mouse
+#axes3d.trackballsize: 0.667 # trackball diameter, in units of the Axes bbox
+#axes3d.trackballborder: 0.2 # trackball border width, in units of the Axes bbox (only for 'sphere' and 'arcball' style)
+
+## ***************************************************************************
+## * AXIS *
+## ***************************************************************************
+#xaxis.labellocation: center # alignment of the xaxis label: {left, right, center}
+#yaxis.labellocation: center # alignment of the yaxis label: {bottom, top, center}
+
+
+## ***************************************************************************
+## * DATES *
+## ***************************************************************************
+## These control the default format strings used in AutoDateFormatter.
+## Any valid format datetime format string can be used (see the python
+## `datetime` for details). For example, by using:
+## - '%x' will use the locale date representation
+## - '%X' will use the locale time representation
+## - '%c' will use the full locale datetime representation
+## These values map to the scales:
+## {'year': 365, 'month': 30, 'day': 1, 'hour': 1/24, 'minute': 1 / (24 * 60)}
+
+#date.autoformatter.year: %Y
+#date.autoformatter.month: %Y-%m
+#date.autoformatter.day: %Y-%m-%d
+#date.autoformatter.hour: %m-%d %H
+#date.autoformatter.minute: %d %H:%M
+#date.autoformatter.second: %H:%M:%S
+#date.autoformatter.microsecond: %M:%S.%f
+## The reference date for Matplotlib's internal date representation
+## See https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html
+#date.epoch: 1970-01-01T00:00:00
+## 'auto', 'concise':
+#date.converter: auto
+## For auto converter whether to use interval_multiples:
+#date.interval_multiples: True
+
+## ***************************************************************************
+## * TICKS *
+## ***************************************************************************
+## See https://matplotlib.org/stable/api/axis_api.html#matplotlib.axis.Tick
+#xtick.top: False # draw ticks on the top side
+#xtick.bottom: True # draw ticks on the bottom side
+#xtick.labeltop: False # draw label on the top
+#xtick.labelbottom: True # draw label on the bottom
+#xtick.major.size: 3.5 # major tick size in points
+#xtick.minor.size: 2 # minor tick size in points
+#xtick.major.width: 0.8 # major tick width in points
+#xtick.minor.width: 0.6 # minor tick width in points
+#xtick.major.pad: 3.5 # distance to major tick label in points
+#xtick.minor.pad: 3.4 # distance to the minor tick label in points
+#xtick.color: black # color of the ticks
+#xtick.labelcolor: inherit # color of the tick labels or inherit from xtick.color
+#xtick.labelsize: medium # font size of the tick labels
+#xtick.direction: out # direction: {in, out, inout}
+#xtick.minor.visible: False # visibility of minor ticks on x-axis
+#xtick.major.top: True # draw x axis top major ticks
+#xtick.major.bottom: True # draw x axis bottom major ticks
+#xtick.minor.top: True # draw x axis top minor ticks
+#xtick.minor.bottom: True # draw x axis bottom minor ticks
+#xtick.minor.ndivs: auto # number of minor ticks between the major ticks on x-axis
+#xtick.alignment: center # alignment of xticks
+
+#ytick.left: True # draw ticks on the left side
+#ytick.right: False # draw ticks on the right side
+#ytick.labelleft: True # draw tick labels on the left side
+#ytick.labelright: False # draw tick labels on the right side
+#ytick.major.size: 3.5 # major tick size in points
+#ytick.minor.size: 2 # minor tick size in points
+#ytick.major.width: 0.8 # major tick width in points
+#ytick.minor.width: 0.6 # minor tick width in points
+#ytick.major.pad: 3.5 # distance to major tick label in points
+#ytick.minor.pad: 3.4 # distance to the minor tick label in points
+#ytick.color: black # color of the ticks
+#ytick.labelcolor: inherit # color of the tick labels or inherit from ytick.color
+#ytick.labelsize: medium # font size of the tick labels
+#ytick.direction: out # direction: {in, out, inout}
+#ytick.minor.visible: False # visibility of minor ticks on y-axis
+#ytick.major.left: True # draw y axis left major ticks
+#ytick.major.right: True # draw y axis right major ticks
+#ytick.minor.left: True # draw y axis left minor ticks
+#ytick.minor.right: True # draw y axis right minor ticks
+#ytick.minor.ndivs: auto # number of minor ticks between the major ticks on y-axis
+#ytick.alignment: center_baseline # alignment of yticks
+
+
+## ***************************************************************************
+## * GRIDS *
+## ***************************************************************************
+#grid.color: "#b0b0b0" # grid color
+#grid.linestyle: - # solid
+#grid.linewidth: 0.8 # in points
+#grid.alpha: 1.0 # transparency, between 0.0 and 1.0
+
+
+## ***************************************************************************
+## * LEGEND *
+## ***************************************************************************
+#legend.loc: best
+#legend.frameon: True # if True, draw the legend on a background patch
+#legend.framealpha: 0.8 # legend patch transparency
+#legend.facecolor: inherit # inherit from axes.facecolor; or color spec
+#legend.edgecolor: 0.8 # background patch boundary color
+#legend.fancybox: True # if True, use a rounded box for the
+ # legend background, else a rectangle
+#legend.shadow: False # if True, give background a shadow effect
+#legend.numpoints: 1 # the number of marker points in the legend line
+#legend.scatterpoints: 1 # number of scatter points
+#legend.markerscale: 1.0 # the relative size of legend markers vs. original
+#legend.fontsize: medium
+#legend.labelcolor: None
+#legend.title_fontsize: None # None sets to the same as the default axes.
+
+## Dimensions as fraction of font size:
+#legend.borderpad: 0.4 # border whitespace
+#legend.labelspacing: 0.5 # the vertical space between the legend entries
+#legend.handlelength: 2.0 # the length of the legend lines
+#legend.handleheight: 0.7 # the height of the legend handle
+#legend.handletextpad: 0.8 # the space between the legend line and legend text
+#legend.borderaxespad: 0.5 # the border between the axes and legend edge
+#legend.columnspacing: 2.0 # column separation
+
+
+## ***************************************************************************
+## * FIGURE *
+## ***************************************************************************
+## See https://matplotlib.org/stable/api/figure_api.html#matplotlib.figure.Figure
+#figure.titlesize: large # size of the figure title (``Figure.suptitle()``)
+#figure.titleweight: normal # weight of the figure title
+#figure.labelsize: large # size of the figure label (``Figure.sup[x|y]label()``)
+#figure.labelweight: normal # weight of the figure label
+#figure.figsize: 6.4, 4.8 # figure size in inches
+#figure.dpi: 100 # figure dots per inch
+#figure.facecolor: white # figure face color
+#figure.edgecolor: white # figure edge color
+#figure.frameon: True # enable figure frame
+#figure.max_open_warning: 20 # The maximum number of figures to open through
+ # the pyplot interface before emitting a warning.
+ # If less than one this feature is disabled.
+#figure.raise_window : True # Raise the GUI window to front when show() is called.
+
+## The figure subplot parameters. All dimensions are a fraction of the figure width and height.
+#figure.subplot.left: 0.125 # the left side of the subplots of the figure
+#figure.subplot.right: 0.9 # the right side of the subplots of the figure
+#figure.subplot.bottom: 0.11 # the bottom of the subplots of the figure
+#figure.subplot.top: 0.88 # the top of the subplots of the figure
+#figure.subplot.wspace: 0.2 # the amount of width reserved for space between subplots,
+ # expressed as a fraction of the average axis width
+#figure.subplot.hspace: 0.2 # the amount of height reserved for space between subplots,
+ # expressed as a fraction of the average axis height
+
+## Figure layout
+#figure.autolayout: False # When True, automatically adjust subplot
+ # parameters to make the plot fit the figure
+ # using `tight_layout`
+#figure.constrained_layout.use: False # When True, automatically make plot
+ # elements fit on the figure. (Not
+ # compatible with `autolayout`, above).
+## Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points.
+#figure.constrained_layout.h_pad: 0.04167
+#figure.constrained_layout.w_pad: 0.04167
+## Spacing between subplots, relative to the subplot sizes. Much smaller than for
+## tight_layout (figure.subplot.hspace, figure.subplot.wspace) as constrained_layout
+## already takes surrounding texts (titles, labels, # ticklabels) into account.
+#figure.constrained_layout.hspace: 0.02
+#figure.constrained_layout.wspace: 0.02
+
+
+## ***************************************************************************
+## * IMAGES *
+## ***************************************************************************
+#image.aspect: equal # {equal, auto} or a number
+#image.interpolation: auto # see help(imshow) for options
+#image.interpolation_stage: auto # see help(imshow) for options
+#image.cmap: viridis # A colormap name (plasma, magma, etc.)
+#image.lut: 256 # the size of the colormap lookup table
+#image.origin: upper # {lower, upper}
+#image.resample: True
+#image.composite_image: True # When True, all the images on a set of axes are
+ # combined into a single composite image before
+ # saving a figure as a vector graphics file,
+ # such as a PDF.
+
+
+## ***************************************************************************
+## * CONTOUR PLOTS *
+## ***************************************************************************
+#contour.negative_linestyle: dashed # string or on-off ink sequence
+#contour.corner_mask: True # {True, False}
+#contour.linewidth: None # {float, None} Size of the contour line
+ # widths. If set to None, it falls back to
+ # `line.linewidth`.
+#contour.algorithm: mpl2014 # {mpl2005, mpl2014, serial, threaded}
+
+
+## ***************************************************************************
+## * ERRORBAR PLOTS *
+## ***************************************************************************
+#errorbar.capsize: 0 # length of end cap on error bars in pixels
+
+
+## ***************************************************************************
+## * HISTOGRAM PLOTS *
+## ***************************************************************************
+#hist.bins: 10 # The default number of histogram bins or 'auto'.
+
+
+## ***************************************************************************
+## * SCATTER PLOTS *
+## ***************************************************************************
+#scatter.marker: o # The default marker type for scatter plots.
+#scatter.edgecolors: face # The default edge colors for scatter plots.
+
+
+## ***************************************************************************
+## * AGG RENDERING *
+## ***************************************************************************
+## Warning: experimental, 2008/10/10
+#agg.path.chunksize: 0 # 0 to disable; values in the range
+ # 10000 to 100000 can improve speed slightly
+ # and prevent an Agg rendering failure
+ # when plotting very large data sets,
+ # especially if they are very gappy.
+ # It may cause minor artifacts, though.
+ # A value of 20000 is probably a good
+ # starting point.
+
+
+## ***************************************************************************
+## * PATHS *
+## ***************************************************************************
+#path.simplify: True # When True, simplify paths by removing "invisible"
+ # points to reduce file size and increase rendering
+ # speed
+#path.simplify_threshold: 0.111111111111 # The threshold of similarity below
+ # which vertices will be removed in
+ # the simplification process.
+#path.snap: True # When True, rectilinear axis-aligned paths will be snapped
+ # to the nearest pixel when certain criteria are met.
+ # When False, paths will never be snapped.
+#path.sketch: None # May be None, or a tuple of the form:
+ # path.sketch: (scale, length, randomness)
+ # - *scale* is the amplitude of the wiggle
+ # perpendicular to the line (in pixels).
+ # - *length* is the length of the wiggle along the
+ # line (in pixels).
+ # - *randomness* is the factor by which the length is
+ # randomly scaled.
+#path.effects:
+
+
+## ***************************************************************************
+## * SAVING FIGURES *
+## ***************************************************************************
+## The default savefig parameters can be different from the display parameters
+## e.g., you may want a higher resolution, or to make the figure
+## background white
+#savefig.dpi: figure # figure dots per inch or 'figure'
+#savefig.facecolor: auto # figure face color when saving
+#savefig.edgecolor: auto # figure edge color when saving
+#savefig.format: png # {png, ps, pdf, svg}
+#savefig.bbox: standard # {tight, standard}
+ # 'tight' is incompatible with generating frames
+ # for animation
+#savefig.pad_inches: 0.1 # padding to be used, when bbox is set to 'tight'
+#savefig.directory: ~ # default directory in savefig dialog, gets updated after
+ # interactive saves, unless set to the empty string (i.e.
+ # the current directory); use '.' to start at the current
+ # directory but update after interactive saves
+#savefig.transparent: False # whether figures are saved with a transparent
+ # background by default
+#savefig.orientation: portrait # orientation of saved figure, for PostScript output only
+
+### macosx backend params
+#macosx.window_mode : system # How to open new figures (system, tab, window)
+ # system uses the MacOS system preferences
+
+### tk backend params
+#tk.window_focus: False # Maintain shell focus for TkAgg
+
+### ps backend params
+#ps.papersize: letter # {figure, letter, legal, ledger, A0-A10, B0-B10}
+#ps.useafm: False # use AFM fonts, results in small files
+#ps.usedistiller: False # {ghostscript, xpdf, None}
+ # Experimental: may produce smaller files.
+ # xpdf intended for production of publication quality files,
+ # but requires ghostscript, xpdf and ps2eps
+#ps.distiller.res: 6000 # dpi
+#ps.fonttype: 3 # Output Type 3 (Type3) or Type 42 (TrueType)
+
+### PDF backend params
+#pdf.compression: 6 # integer from 0 to 9
+ # 0 disables compression (good for debugging)
+#pdf.fonttype: 3 # Output Type 3 (Type3) or Type 42 (TrueType)
+#pdf.use14corefonts: False
+#pdf.inheritcolor: False
+
+### SVG backend params
+#svg.image_inline: True # Write raster image data directly into the SVG file
+#svg.fonttype: path # How to handle SVG fonts:
+ # path: Embed characters as paths -- supported
+ # by most SVG renderers
+ # None: Assume fonts are installed on the
+ # machine where the SVG will be viewed.
+#svg.hashsalt: None # If not None, use this string as hash salt instead of uuid4
+#svg.id: None # If not None, use this string as the value for the `id`
+ # attribute in the top tag
+
+### pgf parameter
+## See https://matplotlib.org/stable/tutorials/text/pgf.html for more information.
+#pgf.rcfonts: True
+#pgf.preamble: # See text.latex.preamble for documentation
+#pgf.texsystem: xelatex
+
+### docstring params
+#docstring.hardcopy: False # set this when you want to generate hardcopy docstring
+
+
+## ***************************************************************************
+## * INTERACTIVE KEYMAPS *
+## ***************************************************************************
+## Event keys to interact with figures/plots via keyboard.
+## See https://matplotlib.org/stable/users/explain/interactive.html for more
+## details on interactive navigation. Customize these settings according to
+## your needs. Leave the field(s) empty if you don't need a key-map. (i.e.,
+## fullscreen : '')
+#keymap.fullscreen: f, ctrl+f # toggling
+#keymap.home: h, r, home # home or reset mnemonic
+#keymap.back: left, c, backspace, MouseButton.BACK # forward / backward keys
+#keymap.forward: right, v, MouseButton.FORWARD # for quick navigation
+#keymap.pan: p # pan mnemonic
+#keymap.zoom: o # zoom mnemonic
+#keymap.save: s, ctrl+s # saving current figure
+#keymap.help: f1 # display help about active tools
+#keymap.quit: ctrl+w, cmd+w, q # close the current figure
+#keymap.quit_all: # close all figures
+#keymap.grid: g # switching on/off major grids in current axes
+#keymap.grid_minor: G # switching on/off minor grids in current axes
+#keymap.yscale: l # toggle scaling of y-axes ('log'/'linear')
+#keymap.xscale: k, L # toggle scaling of x-axes ('log'/'linear')
+#keymap.copy: ctrl+c, cmd+c # copy figure to clipboard
+
+
+## ***************************************************************************
+## * ANIMATION *
+## ***************************************************************************
+#animation.html: none # How to display the animation as HTML in
+ # the IPython notebook:
+ # - 'html5' uses HTML5 video tag
+ # - 'jshtml' creates a JavaScript animation
+#animation.writer: ffmpeg # MovieWriter 'backend' to use
+#animation.codec: h264 # Codec to use for writing movie
+#animation.bitrate: -1 # Controls size/quality trade-off for movie.
+ # -1 implies let utility auto-determine
+#animation.frame_format: png # Controls frame format used by temp files
+
+## Path to ffmpeg binary. Unqualified paths are resolved by subprocess.Popen.
+#animation.ffmpeg_path: ffmpeg
+## Additional arguments to pass to ffmpeg.
+#animation.ffmpeg_args:
+
+## Path to ImageMagick's convert binary. Unqualified paths are resolved by
+## subprocess.Popen, except that on Windows, we look up an install of
+## ImageMagick in the registry (as convert is also the name of a system tool).
+#animation.convert_path: convert
+## Additional arguments to pass to convert.
+#animation.convert_args: -layers, OptimizePlus
+#
+#animation.embed_limit: 20.0 # Limit, in MB, of size of base64 encoded
+ # animation in HTML (i.e. IPython notebook)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/plot_directive/plot_directive.css b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/plot_directive/plot_directive.css
new file mode 100644
index 0000000000000000000000000000000000000000..d45593c93c95d3718fb9e53a780c8022371e619c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/plot_directive/plot_directive.css
@@ -0,0 +1,16 @@
+/*
+ * plot_directive.css
+ * ~~~~~~~~~~~~
+ *
+ * Stylesheet controlling images created using the `plot` directive within
+ * Sphinx.
+ *
+ * :copyright: Copyright 2020-* by the Matplotlib development team.
+ * :license: Matplotlib, see LICENSE for details.
+ *
+ */
+
+img.plot-directive {
+ border: 0;
+ max-width: 100%;
+}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/README.txt b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/README.txt
new file mode 100644
index 0000000000000000000000000000000000000000..75a534951d60ef83ede2da26aec25747fbfb95b3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/README.txt
@@ -0,0 +1,2 @@
+This is the sample data needed for some of matplotlib's examples and
+docs. See matplotlib.cbook.get_sample_data for more info.
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/Stocks.csv b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/Stocks.csv
new file mode 100644
index 0000000000000000000000000000000000000000..575d353dffe23db9213e2f7edece89d7f3365877
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/Stocks.csv
@@ -0,0 +1,526 @@
+# Data source: https://finance.yahoo.com
+Date,IBM,AAPL,MSFT,XRX,AMZN,DELL,GOOGL,ADBE,^GSPC,^IXIC
+1990-01-01,10.970438003540039,0.24251236021518707,0.40375930070877075,11.202081680297852,,,,1.379060983657837,329.0799865722656,415.79998779296875
+1990-02-01,11.554415702819824,0.24251236021518707,0.43104037642478943,10.39472484588623,,,,1.7790844440460205,331.8900146484375,425.79998779296875
+1990-02-05,,,,,,,,,,
+1990-03-01,11.951693534851074,0.28801724314689636,0.4834197461605072,11.394058227539062,,,,2.2348830699920654,339.94000244140625,435.5
+1990-04-01,12.275476455688477,0.2817564308643341,0.5063362717628479,10.139430046081543,,,,2.2531447410583496,330.79998779296875,420.1000061035156
+1990-05-01,13.514284133911133,0.295173317193985,0.6372847557067871,9.704153060913086,,,,2.0985164642333984,361.2300109863281,459.0
+1990-05-04,,,,,,,,,,
+1990-06-01,13.380948066711426,0.3211067020893097,0.6634747385978699,9.749448776245117,,,,2.164785146713257,358.0199890136719,462.29998779296875
+1990-07-01,12.697657585144043,0.3013734817504883,0.5805402994155884,9.489465713500977,,,,2.069063901901245,356.1499938964844,438.20001220703125
+1990-08-01,11.601561546325684,0.26549553871154785,0.5368908047676086,8.553519248962402,,,,1.4750508069992065,322.55999755859375,381.20001220703125
+1990-08-06,,,,,,,,,,
+1990-09-01,12.251119613647461,0.20872052013874054,0.5499854683876038,7.255113124847412,,,,1.1210384368896484,306.04998779296875,344.5
+1990-10-01,12.15034294128418,0.22131578624248505,0.5565334558486938,6.248927116394043,,,,1.416249394416809,304.0,329.79998779296875
+1990-11-01,13.08609390258789,0.26449888944625854,0.6307373642921448,7.361023426055908,,,,1.4900128841400146,322.2200012207031,359.1000061035156
+1990-11-05,,,,,,,,,,
+1990-12-01,13.161062240600586,0.31051647663116455,0.6569272875785828,7.519896507263184,,,,1.7186784744262695,330.2200012207031,373.79998779296875
+1991-01-01,14.762505531311035,0.40078282356262207,0.8566243648529053,10.554410934448242,,,,2.242394208908081,343.92999267578125,414.20001220703125
+1991-02-01,14.995450973510742,0.4134202301502228,0.9057300686836243,12.286416053771973,,,,2.8402483463287354,367.07000732421875,453.1000061035156
+1991-02-04,,,,,,,,,,
+1991-03-01,13.39067268371582,0.49208223819732666,0.92646324634552,12.511940002441406,,,,3.1869795322418213,375.2200012207031,482.29998779296875
+1991-04-01,12.111870765686035,0.39800751209259033,0.8642628788948059,12.511940002441406,,,,3.0589873790740967,375.3399963378906,484.7200012207031
+1991-05-01,12.479341506958008,0.34011581540107727,0.9581103920936584,12.73144817352295,,,,2.9850986003875732,389.8299865722656,506.1099853515625
+1991-05-06,,,,,,,,,,
+1991-06-01,11.555957794189453,0.30108359456062317,0.89208984375,11.853414535522461,,,,2.5565452575683594,371.1600036621094,475.9200134277344
+1991-07-01,12.04675579071045,0.33554431796073914,0.9624748229980469,12.397871017456055,,,,3.1678967475891113,387.80999755859375,502.0400085449219
+1991-08-01,11.526222229003906,0.3845158815383911,1.1163398027420044,13.037229537963867,,,,3.012463331222534,395.42999267578125,525.6799926757812
+1991-08-06,,,,,,,,,,
+1991-09-01,12.478833198547363,0.3599340617656708,1.1654454469680786,13.740047454833984,,,,3.0346662998199463,387.8599853515625,526.8800048828125
+1991-10-01,11.83155345916748,0.37447676062583923,1.2292828559875488,14.41578483581543,,,,3.1431360244750977,392.45001220703125,542.97998046875
+1991-11-01,11.139124870300293,0.36902356147766113,1.2734787464141846,13.965290069580078,,,,2.846613883972168,375.2200012207031,523.9000244140625
+1991-11-04,,,,,,,,,,
+1991-12-01,10.851117134094238,0.4109107553958893,1.4568067789077759,15.42939281463623,,,,3.8844411373138428,417.0899963378906,586.3400268554688
+1992-01-01,10.973037719726562,0.4719553291797638,1.5746610164642334,17.584869384765625,,,,3.639812469482422,408.7799987792969,620.2100219726562
+1992-02-01,10.592026710510254,0.49199995398521423,1.61721932888031,18.04088020324707,,,,3.3547844886779785,412.70001220703125,633.469970703125
+1992-02-06,,,,,,,,,,
+1992-03-01,10.317353248596191,0.4253714978694916,1.5517452955245972,16.302349090576172,,,,3.043056011199951,403.69000244140625,603.77001953125
+1992-04-01,11.213163375854492,0.43906375765800476,1.4437123537063599,17.062589645385742,,,,2.631263494491577,414.95001220703125,578.6799926757812
+1992-05-01,11.213163375854492,0.4363253116607666,1.5844820737838745,17.263996124267578,,,,2.705594062805176,415.3500061035156,585.3099975585938
+1992-05-07,,,,,,,,,,
+1992-06-01,12.25231647491455,0.3505205810070038,1.3749638795852661,16.055517196655273,,,,2.705594062805176,408.1400146484375,563.5999755859375
+1992-07-01,11.861115455627441,0.34207984805107117,1.4289811849594116,17.38025665283203,,,,2.263554334640503,424.2099914550781,580.8300170898438
+1992-08-01,10.84400749206543,0.33659130334854126,1.4633547067642212,17.525571823120117,,,,1.9359338283538818,414.0299987792969,563.1199951171875
+1992-08-06,,,,,,,,,,
+1992-09-01,10.243829727172852,0.3310767114162445,1.58120858669281,18.464359283447266,,,,1.6753284931182861,417.79998779296875,583.27001953125
+1992-10-01,8.483662605285645,0.38518592715263367,1.7432584762573242,17.436922073364258,,,,2.12785267829895,418.67999267578125,605.1699829101562
+1992-11-01,8.658098220825195,0.42187052965164185,1.8291932344436646,18.493711471557617,,,,2.030792474746704,431.3500061035156,652.72998046875
+1992-11-05,,,,,,,,,,
+1992-12-01,6.505843639373779,0.43931084871292114,1.6769649982452393,18.788379669189453,,,,1.8814688920974731,435.7099914550781,676.9500122070312
+1993-01-01,6.651134490966797,0.43747296929359436,1.6990629434585571,20.329378128051758,,,,2.4787611961364746,438.7799987792969,696.3400268554688
+1993-02-01,7.022435188293457,0.38968151807785034,1.6376806497573853,19.618152618408203,,,,2.670894145965576,443.3800048828125,670.77001953125
+1993-02-04,,,,,,,,,,
+1993-03-01,6.6405534744262695,0.37947842478752136,1.8169171810150146,19.766319274902344,,,,2.573633909225464,451.6700134277344,690.1300048828125
+1993-04-01,6.346868991851807,0.3776364326477051,1.6794201135635376,18.451818466186523,,,,3.434307336807251,440.19000244140625,661.4199829101562
+1993-05-01,6.885295867919922,0.4172421991825104,1.8193715810775757,18.12286949157715,,,,3.959200859069824,450.19000244140625,700.530029296875
+1993-05-06,,,,,,,,,,
+1993-06-01,6.51603364944458,0.29166528582572937,1.7285257577896118,19.299583435058594,,,,3.7042527198791504,450.5299987792969,703.9500122070312
+1993-07-01,5.872671604156494,0.2049039751291275,1.453533411026001,17.638439178466797,,,,2.9742372035980225,448.1300048828125,704.7000122070312
+1993-08-01,6.037637233734131,0.19567380845546722,1.4756313562393188,17.759246826171875,,,,2.5536391735076904,463.55999755859375,742.8400268554688
+1993-08-05,,,,,,,,,,
+1993-09-01,5.574150562286377,0.1733584851026535,1.620492935180664,17.849544525146484,,,,2.1931254863739014,458.92999267578125,762.780029296875
+1993-10-01,6.105024337768555,0.22805523872375488,1.5738422870635986,19.34462547302246,,,,2.6137242317199707,467.8299865722656,779.260009765625
+1993-11-01,7.150176048278809,0.2336171418428421,1.5713871717453003,20.107433319091797,,,,2.786593437194824,461.7900085449219,754.3900146484375
+1993-11-04,,,,,,,,,,
+1993-12-01,7.535686016082764,0.21771006286144257,1.5836634635925293,22.01595687866211,,,,2.68115496635437,466.45001220703125,776.7999877929688
+1994-01-01,7.535686016082764,0.24376071989536285,1.672054648399353,24.171361923217773,,,,3.64516544342041,481.6099853515625,800.469970703125
+1994-02-01,7.052198886871338,0.27167221903800964,1.620492935180664,23.894229888916016,,,,3.5310842990875244,467.1400146484375,792.5
+1994-02-04,,,,,,,,,,
+1994-03-01,7.31842041015625,0.24837146699428558,1.6646885871887207,23.706161499023438,,,,2.9274797439575195,445.7699890136719,743.4600219726562
+1994-04-01,7.703606128692627,0.22409436106681824,1.8169171810150146,24.543949127197266,,,,3.2354440689086914,450.9100036621094,733.8400268554688
+1994-05-01,8.440468788146973,0.21849241852760315,2.1115520000457764,24.947307586669922,,,,3.4773480892181396,456.5,735.1900024414062
+1994-05-05,,,,,,,,,,
+1994-06-01,7.905290126800537,0.19873161613941193,2.028071165084839,24.444643020629883,,,,3.2959203720092773,444.2699890136719,705.9600219726562
+1994-07-01,8.325791358947754,0.2526327669620514,2.023160934448242,25.569963455200195,,,,3.756444215774536,458.260009765625,722.1599731445312
+1994-08-01,9.217235565185547,0.27138155698776245,2.2834222316741943,26.789077758789062,,,,3.847325563430786,475.489990234375,765.6199951171875
+1994-08-04,,,,,,,,,,
+1994-09-01,9.405942916870117,0.25350791215896606,2.2048532962799072,26.88198471069336,,,,3.9382081031799316,462.7099914550781,764.2899780273438
+1994-10-01,10.064526557922363,0.324998676776886,2.474935293197632,25.811735153198242,,,,4.368794918060303,472.3500061035156,777.489990234375
+1994-11-01,9.557921409606934,0.28031668066978455,2.470024824142456,24.741479873657227,,,,4.004726409912109,453.69000244140625,750.3200073242188
+1994-11-04,,,,,,,,,,
+1994-12-01,9.9633207321167,0.2943686842918396,2.401276111602783,25.12115478515625,,,,3.6103241443634033,459.2699890136719,751.9600219726562
+1995-01-01,9.77692985534668,0.3047473132610321,2.332528591156006,27.753808975219727,,,,3.5117223262786865,470.4200134277344,755.2000122070312
+1995-02-01,10.200541496276855,0.29814332723617554,2.474935293197632,28.13443946838379,,,,4.345465660095215,487.3900146484375,793.72998046875
+1995-02-06,,,,,,,,,,
+1995-03-01,11.169903755187988,0.2667955756187439,2.7941226959228516,29.989917755126953,,,,6.016797065734863,500.7099914550781,817.2100219726562
+1995-04-01,12.870043754577637,0.2895018756389618,3.2115228176116943,31.52293586730957,,,,7.08742618560791,514.7100219726562,843.97998046875
+1995-05-01,12.649023056030273,0.31457316875457764,3.326920747756958,28.96788215637207,,,,6.326970100402832,533.4000244140625,864.5800170898438
+1995-05-04,,,,,,,,,,
+1995-06-01,13.091790199279785,0.3524453043937683,3.5503528118133545,30.15083122253418,,,,7.057007789611816,544.75,933.4500122070312
+1995-07-01,14.847586631774902,0.3415350615978241,3.5552642345428467,30.697277069091797,,,,7.513277530670166,562.0599975585938,1001.2100219726562
+1995-08-01,14.09753131866455,0.32635587453842163,3.6338343620300293,31.08300018310547,,,,6.210629463195801,561.8800048828125,1020.1099853515625
+1995-08-08,,,,,,,,,,
+1995-09-01,12.916881561279297,0.28348639607429504,3.5552642345428467,34.767181396484375,,,,6.301961898803711,584.4099731445312,1043.5400390625
+1995-10-01,13.292764663696289,0.27635207772254944,3.92846941947937,33.5381965637207,,,,6.941293239593506,581.5,1036.06005859375
+1995-11-01,13.207347869873047,0.2901458144187927,3.4226772785186768,35.478694915771484,,,,8.243063926696777,605.3699951171875,1059.199951171875
+1995-11-08,,,,,,,,,,
+1995-12-01,12.52143669128418,0.24333631992340088,3.447230815887451,35.68303298950195,,,,7.557409763336182,615.9299926757812,1052.1300048828125
+1996-01-01,14.868143081665039,0.21089188754558563,3.6338343620300293,32.199371337890625,,,,4.14438533782959,636.02001953125,1059.7900390625
+1996-02-01,16.80373764038086,0.2099376916885376,3.876908779144287,33.924922943115234,,,,4.089058876037598,640.4299926757812,1100.050048828125
+1996-02-07,,,,,,,,,,
+1996-03-01,15.278267860412598,0.1875123232603073,4.051232814788818,32.900360107421875,,,,3.936483860015869,645.5,1101.4000244140625
+1996-04-01,14.797598838806152,0.1860809624195099,4.448990821838379,38.40559768676758,,,,5.248644828796387,654.1699829101562,1190.52001953125
+1996-05-01,14.660264015197754,0.1994406133890152,4.6650567054748535,41.25652313232422,,,,4.538435459136963,669.1199951171875,1243.4300537109375
+1996-05-08,,,,,,,,,,
+1996-06-01,13.641029357910156,0.1603158563375473,4.719073295593262,42.07575225830078,,,,4.385625839233398,670.6300048828125,1185.02001953125
+1996-07-01,14.812233924865723,0.1679503321647644,4.630680561065674,39.836021423339844,,,,3.7132644653320312,639.9500122070312,1080.5899658203125
+1996-08-01,15.759532928466797,0.18512675166130066,4.812370777130127,43.394588470458984,,,,4.269299030303955,651.989990234375,1141.5
+1996-08-07,,,,,,,,,,
+1996-09-01,17.209583282470703,0.16938161849975586,5.180670261383057,42.40607833862305,,,,4.5600385665893555,687.3300170898438,1226.9200439453125
+1996-10-01,17.831613540649414,0.17558389902114868,5.391822814941406,36.86507034301758,,,,4.244296073913574,705.27001953125,1221.510009765625
+1996-11-01,22.03032875061035,0.184172585606575,6.162785530090332,38.95176315307617,,,,4.841867923736572,757.02001953125,1292.6099853515625
+1996-11-06,,,,,,,,,,
+1996-12-01,20.998197555541992,0.15936164557933807,6.491794109344482,41.83340072631836,,,,4.581387996673584,740.739990234375,1291.030029296875
+1997-01-01,21.743183135986328,0.12691716849803925,8.01407527923584,46.8797492980957,,,,4.642676830291748,786.1599731445312,1379.8499755859375
+1997-02-01,19.924028396606445,0.1240537017583847,7.660515785217285,49.97840881347656,,,,4.47982120513916,790.8200073242188,1309.0
+1997-02-06,,,,,,,,,,
+1997-03-01,19.067983627319336,0.13932174444198608,7.203826904296875,45.4803581237793,,,,4.924733638763428,757.1199951171875,1221.699951171875
+1997-04-01,22.298084259033203,0.12977975606918335,9.546177864074707,49.431339263916016,,,,4.807621955871582,801.3400268554688,1260.760009765625
+1997-05-01,24.034704208374023,0.12691716849803925,9.742606163024902,54.45485305786133,,,,5.483453750610352,848.280029296875,1400.3199462890625
+1997-05-07,,,,,,,,,,
+1997-05-28,,,,,,,,,,
+1997-06-01,25.13742446899414,0.10878564417362213,9.929201126098633,63.396705627441406,0.07708299905061722,,,4.3084282875061035,885.1400146484375,1442.0699462890625
+1997-07-01,29.45465660095215,0.1335965245962143,11.107746124267578,66.42845916748047,0.11979199945926666,,,4.592585563659668,954.3099975585938,1593.81005859375
+1997-08-01,28.23609161376953,0.1660410314798355,10.385887145996094,60.97687911987305,0.11692699790000916,,,4.851738929748535,899.469970703125,1587.3199462890625
+1997-08-07,,,,,,,,,,
+1997-09-01,29.579116821289062,0.16556398570537567,10.395710945129395,67.9932632446289,0.21692700684070587,,,6.2071452140808105,947.280029296875,1685.68994140625
+1997-10-01,27.48627281188965,0.13001829385757446,10.214018821716309,64.32245635986328,0.25416699051856995,,,5.889601707458496,914.6199951171875,1593.6099853515625
+1997-11-01,30.555805206298828,0.13550494611263275,11.117568969726562,63.00460433959961,0.20624999701976776,,,5.180382251739502,955.4000244140625,1600.550048828125
+1997-11-06,,,,,,,,,,
+1997-12-01,29.25237274169922,0.10019782930612564,10.155089378356934,59.91267013549805,0.2510420083999634,,,5.087874889373779,970.4299926757812,1570.3499755859375
+1998-01-01,27.609769821166992,0.1397988647222519,11.721570014953613,65.44635009765625,0.24583299458026886,,,4.750911235809326,980.280029296875,1619.3599853515625
+1998-02-01,29.19993782043457,0.1803557574748993,13.317505836486816,72.36756134033203,0.3208329975605011,,,5.452751159667969,1049.3399658203125,1770.510009765625
+1998-02-06,,,,,,,,,,
+1998-03-01,29.10112953186035,0.2099376916885376,14.06391716003418,86.66805267333984,0.35637998580932617,,,5.576151371002197,1101.75,1835.6800537109375
+1998-04-01,32.4630012512207,0.20898354053497314,14.162128448486328,92.79229736328125,0.3822920024394989,,,6.177727699279785,1111.75,1868.4100341796875
+1998-05-01,32.918251037597656,0.2032574564218521,13.327329635620117,84.10579681396484,0.3671880066394806,,,4.930263519287109,1090.8199462890625,1778.8699951171875
+1998-05-06,,,,,,,,,,
+1998-06-01,32.225502014160156,0.2190026193857193,17.029911041259766,83.08383178710938,0.831250011920929,,,5.238887786865234,1133.8399658203125,1894.739990234375
+1998-07-01,37.19002914428711,0.26433059573173523,17.27544403076172,86.6082992553711,0.9239580035209656,,,3.988961935043335,1120.6700439453125,1872.3900146484375
+1998-08-01,31.611520767211914,0.23808826506137848,15.075493812561035,72.04536437988281,0.6979169845581055,,,3.2419238090515137,957.280029296875,1499.25
+1998-08-06,,,,,,,,,,
+1998-09-01,36.12905502319336,0.2910497486591339,17.295076370239258,69.53275299072266,0.9302080273628235,,,4.283971786499023,1017.010009765625,1693.8399658203125
+1998-10-01,41.75224685668945,0.2834153473377228,16.637067794799805,80.36154174804688,1.0536459684371948,,,4.59221076965332,1098.6700439453125,1771.3900146484375
+1998-11-01,46.4265251159668,0.2438134402036667,19.170928955078125,88.54693603515625,1.600000023841858,,,5.535391330718994,1163.6300048828125,1949.5400390625
+1998-11-06,,,,,,,,,,
+1998-12-01,51.91548538208008,0.3125200569629669,21.793180465698242,97.19573974609375,2.6770830154418945,,,5.782783031463623,1229.22998046875,2192.68994140625
+1999-01-01,51.59874725341797,0.3144294023513794,27.499271392822266,102.47120666503906,2.92343807220459,,,5.912916660308838,1279.6400146484375,2505.889892578125
+1999-02-01,47.797481536865234,0.2657618522644043,23.5904541015625,91.21175384521484,3.203125,,,4.984185218811035,1238.3299560546875,2288.030029296875
+1999-02-08,,,,,,,,,,
+1999-03-01,49.97552490234375,0.27435049414634705,28.16712188720703,88.21611785888672,4.304687976837158,,,7.027392387390137,1286.3699951171875,2461.39990234375
+1999-04-01,58.98025894165039,0.35116779804229736,25.554689407348633,97.44929504394531,4.301562786102295,,,7.854666709899902,1335.1800537109375,2542.860107421875
+1999-05-01,65.41220092773438,0.3363769054412842,25.35825538635254,93.19886779785156,2.96875,,,9.187017440795898,1301.8399658203125,2470.52001953125
+1999-05-06,,,,,,,,,,
+1999-05-27,,,,,,,,,,
+1999-06-01,72.96644592285156,0.35355332493782043,28.343910217285156,97.96764373779297,3.128124952316284,,,10.182408332824707,1372.7099609375,2686.1201171875
+1999-07-01,70.95524597167969,0.4251234233379364,26.96893310546875,81.35432434082031,2.50156307220459,,,10.634023666381836,1328.719970703125,2638.489990234375
+1999-08-01,70.32015991210938,0.49812400341033936,29.090301513671875,79.7938461303711,3.109375,,,12.354691505432129,1320.4100341796875,2739.35009765625
+1999-08-06,,,,,,,,,,
+1999-09-01,68.37564849853516,0.48333317041397095,28.46175193786621,69.8066177368164,3.996875047683716,,,14.07535457611084,1282.7099609375,2746.159912109375
+1999-10-01,55.519859313964844,0.6116815209388733,29.090301513671875,47.42917251586914,3.53125,,,17.35419464111328,1362.9300537109375,2966.429931640625
+1999-11-01,58.239349365234375,0.747186541557312,28.613975524902344,45.75767135620117,4.253125190734863,,,17.044021606445312,1388.9100341796875,3336.159912109375
+1999-11-08,,,,,,,,,,
+1999-12-01,61.04003143310547,0.7848799824714661,36.6919059753418,37.92245101928711,3.8062500953674316,,,16.687326431274414,1469.25,4069.31005859375
+2000-01-01,63.515560150146484,0.7920366525650024,30.75990104675293,35.14961242675781,3.2281250953674316,,,13.668244361877441,1394.4599609375,3940.35009765625
+2000-02-01,58.14006042480469,0.8750578165054321,28.088550567626953,36.62297058105469,3.4437499046325684,,,25.31960105895996,1366.4200439453125,4696.68994140625
+2000-02-08,,,,,,,,,,
+2000-03-01,67.05181884765625,1.0368047952651978,33.39197540283203,43.779178619384766,3.3499999046325684,,,27.631258010864258,1498.5799560546875,4572.830078125
+2000-04-01,63.157623291015625,0.947104275226593,21.920852661132812,45.03520965576172,2.7593750953674316,,,30.027847290039062,1452.4300537109375,3860.659912109375
+2000-05-01,60.785640716552734,0.6412634253501892,19.661985397338867,46.097347259521484,2.4156250953674316,,,27.948402404785156,1420.5999755859375,3400.909912109375
+2000-05-08,,,,,,,,,,
+2000-06-01,62.13500213623047,0.7996708750724792,25.142194747924805,35.529056549072266,1.8156249523162842,,,32.277984619140625,1454.5999755859375,3966.110107421875
+2000-07-01,63.65913009643555,0.7758141756057739,21.940492630004883,25.79067039489746,1.506250023841858,,,28.43518829345703,1430.8299560546875,3766.989990234375
+2000-08-01,74.86860656738281,0.9304049015045166,21.940492630004883,27.82395362854004,2.075000047683716,,,32.28449630737305,1517.6800537109375,4206.35009765625
+2000-08-08,,,,,,,,,,
+2000-09-01,63.94328689575195,0.3931553065776825,18.95485496520996,25.980575561523438,1.921875,,,38.555137634277344,1436.510009765625,3672.820068359375
+2000-10-01,55.92375183105469,0.29868337512016296,21.645862579345703,14.6140718460083,1.8312499523162842,,,37.785430908203125,1429.4000244140625,3369.6298828125
+2000-11-01,53.08496856689453,0.2519250810146332,18.03167152404785,12.016016960144043,1.234375,,,31.482683181762695,1314.949951171875,2597.929931640625
+2000-11-08,,,,,,,,,,
+2000-12-01,48.32046127319336,0.22711420059204102,13.631781578063965,8.067792892456055,0.778124988079071,,,28.90570068359375,1320.280029296875,2470.52001953125
+2001-01-01,63.6693229675293,0.33017459511756897,19.190568923950195,14.251648902893066,0.8656250238418579,,,21.702556610107422,1366.010009765625,2772.72998046875
+2001-02-01,56.790767669677734,0.2786443829536438,18.54237174987793,10.536102294921875,0.5093749761581421,,,14.440549850463867,1239.93994140625,2151.830078125
+2001-02-07,,,,,,,,,,
+2001-03-01,54.73835754394531,0.3369686007499695,17.18704605102539,10.535667419433594,0.5115000009536743,,,17.375865936279297,1160.3299560546875,1840.260009765625
+2001-04-01,65.52893829345703,0.38918623328208923,21.292295455932617,15.900238990783691,0.7889999747276306,,,22.32872772216797,1249.4599609375,2116.239990234375
+2001-05-01,63.62804412841797,0.3046000301837921,21.741714477539062,17.430465698242188,0.8345000147819519,,,19.768779754638672,1255.8199462890625,2110.489990234375
+2001-05-08,,,,,,,,,,
+2001-06-01,64.6737060546875,0.35498547554016113,22.942251205444336,16.83243751525879,0.7074999809265137,,,23.362648010253906,1224.3800048828125,2160.5400390625
+2001-07-01,59.949947357177734,0.28688937425613403,20.80202293395996,14.035829544067383,0.6244999766349792,,,18.640790939331055,1211.22998046875,2027.1300048828125
+2001-08-01,56.952762603759766,0.2832247018814087,17.929533004760742,16.18165397644043,0.44699999690055847,,,16.711578369140625,1133.5799560546875,1805.4300537109375
+2001-08-08,,,,,,,,,,
+2001-09-01,52.33213424682617,0.23680917918682098,16.081575393676758,13.6312894821167,0.2985000014305115,,,11.92334270477295,1040.93994140625,1498.800048828125
+2001-10-01,61.660858154296875,0.26810887455940247,18.275238037109375,12.312134742736816,0.3490000069141388,,,13.133195877075195,1059.780029296875,1690.199951171875
+2001-11-01,65.95150756835938,0.3252120614051819,20.17975616455078,14.774558067321777,0.5659999847412109,,,15.958827018737793,1139.449951171875,1930.5799560546875
+2001-11-07,,,,,,,,,,
+2001-12-01,69.1006088256836,0.3343726694583893,20.820878982543945,18.32748794555664,0.5410000085830688,,,15.446427345275879,1148.0799560546875,1950.4000244140625
+2002-01-01,61.63407897949219,0.37742963433265686,20.022619247436523,19.928070068359375,0.7095000147819519,,,16.771486282348633,1130.199951171875,1934.030029296875
+2002-02-01,56.052799224853516,0.3313194811344147,18.334945678710938,17.07868194580078,0.7049999833106995,,,18.105239868164062,1106.72998046875,1731.489990234375
+2002-02-06,,,,,,,,,,
+2002-03-01,59.49020767211914,0.3613981306552887,18.95407485961914,18.907917022705078,0.7149999737739563,,,20.051130294799805,1147.3900146484375,1845.3499755859375
+2002-04-01,47.912540435791016,0.3705587685108185,16.424144744873047,15.56605339050293,0.8345000147819519,,,19.893611907958984,1076.9200439453125,1688.22998046875
+2002-05-01,46.01911926269531,0.35574817657470703,15.999865531921387,15.777122497558594,0.9114999771118164,,,17.971961975097656,1067.1400146484375,1615.72998046875
+2002-05-08,,,,,,,,,,
+2002-06-01,41.26642990112305,0.2705524265766144,17.190977096557617,10.55325984954834,0.8125,,,14.188389778137207,989.8200073242188,1463.2099609375
+2002-07-01,40.349422454833984,0.23299239575862885,15.079033851623535,12.224191665649414,0.7225000262260437,,,11.933782577514648,911.6199951171875,1328.260009765625
+2002-08-01,43.203697204589844,0.22520573437213898,15.424735069274902,12.329721450805664,0.746999979019165,,,10.01123046875,916.0700073242188,1314.8499755859375
+2002-08-07,,,,,,,,,,
+2002-09-01,33.49409484863281,0.22138899564743042,13.746496200561523,8.706437110900879,0.796500027179718,,,9.513158798217773,815.280029296875,1172.06005859375
+2002-10-01,45.344242095947266,0.24535933136940002,16.804426193237305,11.678934097290039,0.9679999947547913,,,11.782204627990723,885.760009765625,1329.75
+2002-11-01,49.92806625366211,0.23665708303451538,18.127525329589844,15.337401390075684,1.1675000190734863,,,14.71778678894043,936.3099975585938,1478.780029296875
+2002-11-06,,,,,,,,,,
+2002-12-01,44.5990104675293,0.2187930941581726,16.248149871826172,14.15894889831543,0.9445000290870667,,,12.360349655151367,879.8200073242188,1335.510009765625
+2003-01-01,45.00184631347656,0.21925139427185059,14.91561222076416,15.56605339050293,1.0924999713897705,,,13.167760848999023,855.7000122070312,1320.9100341796875
+2003-02-01,44.85797119140625,0.22917553782463074,14.896756172180176,15.829883575439453,1.1004999876022339,,,13.712512969970703,841.1500244140625,1337.52001953125
+2003-02-06,,,,,,,,,,
+2003-03-01,45.22197723388672,0.2158920168876648,15.266251564025879,15.302220344543457,1.3014999628067017,,,15.372973442077637,848.1799926757812,1341.1700439453125
+2003-04-01,48.95253372192383,0.21711383759975433,16.123830795288086,17.342517852783203,1.434499979019165,,,17.22471046447754,916.9199829101562,1464.31005859375
+2003-05-01,50.76301956176758,0.2740640342235565,15.518482208251953,19.224523544311523,1.7944999933242798,,,17.618791580200195,963.5900268554688,1595.9100341796875
+2003-05-07,,,,,,,,,,
+2003-06-01,47.655845642089844,0.29101142287254333,16.16796875,18.626508712768555,1.815999984741211,,,15.997578620910645,974.5,1622.800048828125
+2003-07-01,46.933773040771484,0.32185351848602295,16.653514862060547,18.995861053466797,2.0820000171661377,,,16.333431243896484,990.3099975585938,1735.02001953125
+2003-08-01,47.37279510498047,0.34521347284317017,16.722881317138672,18.960683822631836,2.315999984741211,,,19.37755012512207,1008.010009765625,1810.449951171875
+2003-08-06,,,,,,,,,,
+2003-09-01,51.1259651184082,0.3163566291332245,17.530014038085938,18.046072006225586,2.4214999675750732,,,19.657007217407227,995.969970703125,1786.93994140625
+2003-10-01,51.79159927368164,0.3494885563850403,16.48325538635254,18.468202590942383,2.7214999198913574,,,21.84463119506836,1050.7099609375,1932.2099609375
+2003-11-01,52.405128479003906,0.3192576766014099,16.303056716918945,21.423110961914062,2.698499917984009,,,20.621614456176758,1058.199951171875,1960.260009765625
+2003-11-06,,,,,,,,,,
+2003-12-01,53.74093246459961,0.32628077268600464,17.35569190979004,24.272485733032227,2.63100004196167,,,19.5084171295166,1111.9200439453125,2003.3699951171875
+2004-01-01,57.53900146484375,0.3444499373435974,17.533241271972656,25.74994659423828,2.5199999809265137,,,19.119047164916992,1131.1300048828125,2066.14990234375
+2004-02-01,55.95598602294922,0.36521488428115845,16.82303810119629,24.87051010131836,2.1505000591278076,,,18.600963592529297,1144.93994140625,2029.8199462890625
+2004-02-06,,,,,,,,,,
+2004-03-01,53.3401985168457,0.4128514230251312,15.808448791503906,25.6268310546875,2.1640000343322754,,,19.62464141845703,1126.2099609375,1994.219970703125
+2004-04-01,51.208683013916016,0.39361342787742615,16.56939125061035,23.6217041015625,2.180000066757202,,,20.729951858520508,1107.300048828125,1920.1500244140625
+2004-05-01,51.45262145996094,0.4284247159957886,16.632802963256836,23.815183639526367,2.424999952316284,,,22.293439865112305,1120.6800537109375,1986.739990234375
+2004-05-06,,,,,,,,,,
+2004-06-01,51.300846099853516,0.4968261420726776,18.110280990600586,25.503700256347656,2.7200000286102295,,,23.227535247802734,1140.8399658203125,2047.7900390625
+2004-07-01,50.672325134277344,0.4937727451324463,18.065902709960938,24.378023147583008,1.9459999799728394,,,21.075881958007812,1101.719970703125,1887.3599853515625
+2004-08-01,49.28722381591797,0.5265995860099792,17.31130027770996,23.6217041015625,1.906999945640564,,,22.91964340209961,1104.239990234375,1838.0999755859375
+2004-08-06,,,,,,,,,,
+2004-09-01,50.00397872924805,0.5916416049003601,17.5849609375,24.764976501464844,2.0429999828338623,,64.8648681640625,24.718441009521484,1114.5799560546875,1896.8399658203125
+2004-10-01,52.34260559082031,0.800052285194397,17.788476943969727,25.978591918945312,1.7065000534057617,,95.41541290283203,28.003637313842773,1130.199951171875,1974.989990234375
+2004-11-01,54.96117401123047,1.0237311124801636,17.050731658935547,26.945974349975586,1.9839999675750732,,91.0810775756836,30.26772117614746,1173.8199462890625,2096.81005859375
+2004-11-08,,,,,,,,,,
+2004-12-01,57.60344696044922,0.9832708239555359,18.939943313598633,29.918479919433594,2.2144999504089355,,96.49149322509766,31.357276916503906,1211.9200439453125,2175.43994140625
+2005-01-01,54.58831024169922,1.1741228103637695,18.628063201904297,27.930959701538086,2.1610000133514404,,97.90790557861328,28.444419860839844,1181.27001953125,2062.409912109375
+2005-02-01,54.09749221801758,1.3698610067367554,17.83417510986328,27.438472747802734,1.7589999437332153,,94.0890884399414,30.86894416809082,1203.5999755859375,2051.719970703125
+2005-02-08,,,,,,,,,,
+2005-03-01,53.49815368652344,1.2724499702453613,17.18527603149414,26.6469669342041,1.7135000228881836,,90.34534454345703,33.57841110229492,1180.5899658203125,1999.22998046875
+2005-04-01,44.7164421081543,1.1011403799057007,17.988739013671875,23.305103302001953,1.6180000305175781,,110.110107421875,29.735000610351562,1156.8499755859375,1921.6500244140625
+2005-05-01,44.23051071166992,1.2141252756118774,18.3442440032959,23.867952346801758,1.7755000591278076,,138.77377319335938,33.119998931884766,1191.5,2068.219970703125
+2005-05-06,,,,,,,,,,
+2005-06-01,43.555538177490234,1.124043345451355,17.71768569946289,24.254899978637695,1.6545000076293945,,147.22222900390625,28.610000610351562,1191.3299560546875,2056.9599609375
+2005-07-01,48.991188049316406,1.3023751974105835,18.26690673828125,23.234752655029297,2.257499933242798,,144.02401733398438,29.639999389648438,1234.1800537109375,2184.830078125
+2005-08-01,47.3240966796875,1.431849479675293,19.529403686523438,23.58652687072754,2.134999990463257,,143.1431427001953,27.040000915527344,1220.3299560546875,2152.090087890625
+2005-08-08,,,,,,,,,,
+2005-09-01,47.202552795410156,1.6370543241500854,18.40694236755371,24.00865936279297,2.265000104904175,,158.3883819580078,29.850000381469727,1228.81005859375,2151.68994140625
+2005-10-01,48.1793098449707,1.7585887908935547,18.385473251342773,23.867952346801758,1.9930000305175781,,186.25625610351562,32.25,1207.010009765625,2120.300048828125
+2005-11-01,52.309974670410156,2.0709757804870605,19.80194664001465,24.976051330566406,2.4230000972747803,,202.65765380859375,32.61000061035156,1249.47998046875,2232.820068359375
+2005-11-08,,,,,,,,,,
+2005-12-01,48.483585357666016,2.1952593326568604,18.762245178222656,25.76755142211914,2.3575000762939453,,207.63763427734375,36.959999084472656,1248.2900390625,2205.320068359375
+2006-01-01,47.95273208618164,2.305800437927246,20.19721794128418,25.169517517089844,2.240999937057495,,216.5465545654297,39.72999954223633,1280.0799560546875,2305.820068359375
+2006-02-01,47.32752227783203,2.0914342403411865,19.27882957458496,26.207246780395508,1.871999979019165,,181.49148559570312,38.54999923706055,1280.6600341796875,2281.389892578125
+2006-02-08,,,,,,,,,,
+2006-03-01,48.76497268676758,1.9152405261993408,19.588937759399414,26.734920501708984,1.8265000581741333,,195.1951904296875,34.95000076293945,1294.8699951171875,2339.7900390625
+2006-04-01,48.6880989074707,2.149454355239868,17.385986328125,24.694625854492188,1.7604999542236328,,209.17918395996094,39.20000076293945,1310.6099853515625,2322.570068359375
+2006-05-01,47.24531936645508,1.8251585960388184,16.306108474731445,24.149375915527344,1.7304999828338623,,186.09609985351562,28.6299991607666,1270.0899658203125,2178.8798828125
+2006-05-08,,,,,,,,,,
+2006-06-01,45.58832931518555,1.7488168478012085,16.83946990966797,24.465961456298828,1.934000015258789,,209.8748779296875,30.360000610351562,1270.199951171875,2172.090087890625
+2006-07-01,45.938453674316406,2.075251340866089,17.388734817504883,24.78256607055664,1.344499945640564,,193.49349975585938,28.510000228881836,1276.6600341796875,2091.469970703125
+2006-08-01,48.051090240478516,2.0718915462493896,18.574007034301758,26.048952102661133,1.5414999723434448,,189.45445251464844,32.439998626708984,1303.8199462890625,2183.75
+2006-08-08,,,,,,,,,,
+2006-09-01,48.820682525634766,2.350689172744751,19.839282989501953,27.368104934692383,1.6059999465942383,,201.15115356445312,37.459999084472656,1335.8499755859375,2258.429931640625
+2006-10-01,55.01115798950195,2.475886821746826,20.82581329345703,29.90088653564453,1.9045000076293945,,238.4334259033203,38.25,1377.93994140625,2366.7099609375
+2006-11-01,54.766883850097656,2.798962354660034,21.29731559753418,29.021446228027344,2.0169999599456787,,242.64764404296875,40.15999984741211,1400.6300048828125,2431.77001953125
+2006-11-08,,,,,,,,,,
+2006-12-01,58.07079315185547,2.5907039642333984,21.73406219482422,29.812957763671875,1.9730000495910645,,230.47047424316406,41.119998931884766,1418.300048828125,2415.2900390625
+2007-01-01,59.266300201416016,2.617882013320923,22.461923599243164,30.252676010131836,1.8834999799728394,,251.00100708007812,38.869998931884766,1438.239990234375,2463.929931640625
+2007-02-01,55.55428695678711,2.583681344985962,20.50397491455078,30.37578582763672,1.9570000171661377,,224.949951171875,39.25,1406.8199462890625,2416.14990234375
+2007-02-07,,,,,,,,,,
+2007-03-01,56.51309585571289,2.8371317386627197,20.3559513092041,29.707414627075195,1.9895000457763672,,229.30931091308594,41.70000076293945,1420.8599853515625,2421.639892578125
+2007-04-01,61.27952575683594,3.0475287437438965,21.867843627929688,32.539215087890625,3.066499948501587,,235.92591857910156,41.560001373291016,1482.3699951171875,2525.090087890625
+2007-05-01,63.91150665283203,3.700700044631958,22.415639877319336,33.18999099731445,3.4570000171661377,,249.20420837402344,44.060001373291016,1530.6199951171875,2604.52001953125
+2007-05-08,,,,,,,,,,
+2007-06-01,63.347747802734375,3.7266552448272705,21.59428596496582,32.5040397644043,3.4205000400543213,,261.6116027832031,40.150001525878906,1503.3499755859375,2603.22998046875
+2007-07-01,66.59786987304688,4.023471355438232,21.242568969726562,30.70998764038086,3.927000045776367,,255.2552490234375,40.290000915527344,1455.27001953125,2546.27001953125
+2007-08-01,70.23324584960938,4.228675365447998,21.052053451538086,30.12954330444336,3.995500087738037,,257.88287353515625,42.75,1473.989990234375,2596.360107421875
+2007-08-08,,,,,,,,,,
+2007-09-01,71.1520004272461,4.68641471862793,21.662628173828125,30.49891471862793,4.65749979019165,,283.9189147949219,43.65999984741211,1526.75,2701.5
+2007-10-01,70.13726806640625,5.800380706787109,27.067256927490234,30.674802780151367,4.457499980926514,,353.8538513183594,47.900001525878906,1549.3800048828125,2859.1201171875
+2007-11-01,63.529457092285156,5.564334392547607,24.70686912536621,29.6898193359375,4.5279998779296875,,346.8468322753906,42.13999938964844,1481.1400146484375,2660.9599609375
+2007-11-07,,,,,,,,,,
+2007-12-01,65.52474212646484,6.048642158508301,26.26405906677246,28.4762020111084,4.631999969482422,,346.0860900878906,42.72999954223633,1468.3599853515625,2652.280029296875
+2008-01-01,64.92465209960938,4.133399963378906,24.050800323486328,27.21040916442871,3.884999990463257,,282.43243408203125,34.93000030517578,1378.550048828125,2389.860107421875
+2008-02-01,69.0161361694336,3.8176541328430176,20.066930770874023,25.923078536987305,3.2235000133514404,,235.82582092285156,33.650001525878906,1330.6300048828125,2271.47998046875
+2008-02-06,,,,,,,,,,
+2008-03-01,70.05885314941406,4.381966590881348,21.01883316040039,26.399211883544922,3.565000057220459,,220.45545959472656,35.59000015258789,1322.699951171875,2279.10009765625
+2008-04-01,73.44194030761719,5.311798572540283,21.122520446777344,24.706567764282227,3.93149995803833,,287.43243408203125,37.290000915527344,1385.5899658203125,2412.800048828125
+2008-05-01,78.75386810302734,5.763737201690674,20.974388122558594,24.016834259033203,4.080999851226807,,293.1932067871094,44.060001373291016,1400.3800048828125,2522.659912109375
+2008-05-07,,,,,,,,,,
+2008-06-01,72.41636657714844,5.11300802230835,20.449499130249023,23.981456756591797,3.6665000915527344,,263.4734802246094,39.38999938964844,1280.0,2292.97998046875
+2008-07-01,78.18988800048828,4.853753566741943,19.118900299072266,24.197914123535156,3.816999912261963,,237.1121063232422,41.349998474121094,1267.3800048828125,2325.550048828125
+2008-08-01,74.37141418457031,5.176827907562256,20.285959243774414,24.712379455566406,4.040500164031982,,231.8768768310547,42.83000183105469,1282.8299560546875,2367.52001953125
+2008-08-06,,,,,,,,,,
+2008-09-01,71.73551177978516,3.470762014389038,19.91908073425293,20.454687118530273,3.638000011444092,,200.46046447753906,39.470001220703125,1166.3599853515625,2091.8798828125
+2008-10-01,57.02163314819336,3.2854056358337402,16.66515350341797,14.2785062789917,2.861999988555908,,179.85986328125,26.639999389648438,968.75,1720.949951171875
+2008-11-01,50.04803466796875,2.8298041820526123,15.090431213378906,12.444729804992676,2.134999990463257,,146.6266326904297,23.15999984741211,896.239990234375,1535.5699462890625
+2008-11-06,,,,,,,,,,
+2008-12-01,51.90673828125,2.6062774658203125,14.606595039367676,14.189484596252441,2.563999891281128,,153.97897338867188,21.290000915527344,903.25,1577.030029296875
+2009-01-01,56.52627944946289,2.7522425651550293,12.848398208618164,11.888165473937988,2.940999984741211,,169.43443298339844,19.309999465942383,825.8800048828125,1476.4200439453125
+2009-02-01,56.76066589355469,2.7272019386291504,12.13459587097168,9.274202346801758,3.239500045776367,,169.16416931152344,16.700000762939453,735.0900268554688,1377.8399658203125
+2009-02-06,,,,,,,,,,
+2009-03-01,60.08320999145508,3.209982395172119,13.897279739379883,8.146258354187012,3.671999931335449,,174.20420837402344,21.389999389648438,797.8699951171875,1528.5899658203125
+2009-04-01,64.00231170654297,3.8423893451690674,15.3270902633667,11.028571128845215,4.026000022888184,,198.1831817626953,27.350000381469727,872.8099975585938,1717.300048828125
+2009-05-01,65.90607452392578,4.147140979766846,15.803704261779785,12.274019241333008,3.8994998931884766,,208.82382202148438,28.18000030517578,919.1400146484375,1774.3299560546875
+2009-05-06,,,,,,,,,,
+2009-06-01,65.09091186523438,4.349293231964111,18.0966796875,11.69642448425293,4.183000087738037,,211.00601196289062,28.299999237060547,919.3200073242188,1835.0400390625
+2009-07-01,73.51245880126953,4.989336013793945,17.906352996826172,14.879191398620605,4.288000106811523,,221.7467498779297,32.41999816894531,987.47998046875,1978.5
+2009-08-01,73.58724975585938,5.1365203857421875,18.766645431518555,15.714898109436035,4.059500217437744,,231.06607055664062,31.420000076293945,1020.6199951171875,2009.06005859375
+2009-08-06,,,,,,,,,,
+2009-09-01,74.90744018554688,5.659914016723633,19.69136619567871,14.061647415161133,4.668000221252441,,248.1731719970703,33.040000915527344,1057.0799560546875,2122.419921875
+2009-10-01,75.53370666503906,5.756102561950684,21.230228424072266,13.72740650177002,5.940499782562256,,268.3283386230469,32.939998626708984,1036.18994140625,2045.1099853515625
+2009-11-01,79.12847900390625,6.1045241355896,22.51645278930664,14.055986404418945,6.795499801635742,,291.7917785644531,35.08000183105469,1095.6300048828125,2144.60009765625
+2009-11-06,,,,,,,,,,
+2009-12-01,82.34589385986328,6.434925556182861,23.438796997070312,15.443329811096191,6.72599983215332,,310.30029296875,36.779998779296875,1115.0999755859375,2269.14990234375
+2010-01-01,76.99246215820312,5.86481237411499,21.670120239257812,15.999075889587402,6.270500183105469,,265.2352294921875,32.29999923706055,1073.8699951171875,2147.35009765625
+2010-02-01,79.99315643310547,6.248349666595459,22.04693031311035,17.19167137145996,5.920000076293945,,263.6636657714844,34.650001525878906,1104.489990234375,2238.260009765625
+2010-02-08,,,,,,,,,,
+2010-03-01,81.0396728515625,7.176041126251221,22.629026412963867,17.88887596130371,6.78849983215332,,283.8438415527344,35.369998931884766,1169.4300537109375,2397.9599609375
+2010-04-01,81.51359558105469,7.972740650177002,23.594758987426758,20.0878963470459,6.855000019073486,,263.11309814453125,33.599998474121094,1186.68994140625,2461.18994140625
+2010-05-01,79.1503677368164,7.84417724609375,19.932706832885742,17.157638549804688,6.2729997634887695,,243.0580596923828,32.08000183105469,1089.4100341796875,2257.0400390625
+2010-05-06,,,,,,,,,,
+2010-06-01,78.42550659179688,7.680809020996094,17.857412338256836,14.817129135131836,5.4629998207092285,,222.69769287109375,26.43000030517578,1030.7099609375,2109.239990234375
+2010-07-01,81.55033874511719,7.855478763580322,20.03040885925293,18.038850784301758,5.894499778747559,,242.66766357421875,28.719999313354492,1101.5999755859375,2254.699951171875
+2010-08-01,78.20323944091797,7.4233856201171875,18.214401245117188,15.64971923828125,6.241499900817871,,225.2352294921875,27.700000762939453,1049.3299560546875,2114.030029296875
+2010-08-06,,,,,,,,,,
+2010-09-01,85.6181411743164,8.664690971374512,19.10737419128418,19.168588638305664,7.853000164031982,,263.1581726074219,26.149999618530273,1141.199951171875,2368.6201171875
+2010-10-01,91.65619659423828,9.190831184387207,20.808244705200195,21.757949829101562,8.261500358581543,,307.15716552734375,28.149999618530273,1183.260009765625,2507.409912109375
+2010-11-01,90.290283203125,9.501388549804688,19.70814323425293,21.311634063720703,8.770000457763672,,278.1331481933594,27.799999237060547,1180.550048828125,2498.22998046875
+2010-11-08,,,,,,,,,,
+2010-12-01,94.08943176269531,9.84980583190918,21.909496307373047,21.423206329345703,9.0,,297.28228759765625,30.780000686645508,1257.6400146484375,2652.8701171875
+2011-01-01,103.8599853515625,10.361597061157227,21.76820182800293,19.823131561279297,8.482000350952148,,300.48046875,33.04999923706055,1286.1199951171875,2700.080078125
+2011-02-01,103.78302001953125,10.785745620727539,20.865453720092773,20.065792083740234,8.66450023651123,,307.00701904296875,34.5,1327.219970703125,2782.27001953125
+2011-02-08,,,,,,,,,,
+2011-03-01,104.95984649658203,10.64222526550293,20.04909324645996,19.879127502441406,9.006500244140625,,293.6736755371094,33.15999984741211,1325.8299560546875,2781.070068359375
+2011-04-01,109.79368591308594,10.691693305969238,20.467607498168945,18.910266876220703,9.790499687194824,,272.32232666015625,33.54999923706055,1363.6099853515625,2873.5400390625
+2011-05-01,108.73165130615234,10.621461868286133,19.7490291595459,19.135168075561523,9.834500312805176,,264.7747802734375,34.630001068115234,1345.199951171875,2835.300048828125
+2011-05-06,,,,,,,,,,
+2011-06-01,110.91179656982422,10.25013542175293,20.665348052978516,19.510000228881836,10.224499702453613,,253.4434356689453,31.450000762939453,1320.6400146484375,2773.52001953125
+2011-07-01,117.571044921875,11.923834800720215,21.778095245361328,17.562105178833008,11.12600040435791,,302.14715576171875,27.709999084472656,1292.280029296875,2756.3798828125
+2011-08-01,111.14454650878906,11.75130844116211,21.142244338989258,15.623312950134277,10.761500358581543,,270.7507629394531,25.239999771118164,1218.8900146484375,2579.4599609375
+2011-08-08,,,,,,,,,,
+2011-09-01,113.55061340332031,11.644124984741211,19.90796661376953,13.119815826416016,10.81149959564209,,257.77777099609375,24.170000076293945,1131.4200439453125,2415.39990234375
+2011-10-01,119.88819122314453,12.360504150390625,21.299680709838867,15.485393524169922,10.67549991607666,,296.6166076660156,29.40999984741211,1253.300048828125,2684.409912109375
+2011-11-01,122.07645416259766,11.670994758605957,20.459848403930664,15.42860221862793,9.614500045776367,,299.9949951171875,27.420000076293945,1246.9599609375,2620.340087890625
+2011-11-08,,,,,,,,,,
+2011-12-01,119.88117218017578,12.367225646972656,20.92014503479004,15.068914413452148,8.654999732971191,,323.2732849121094,28.270000457763672,1257.5999755859375,2605.14990234375
+2012-01-01,125.56623077392578,13.939234733581543,23.79706382751465,14.749091148376465,9.722000122070312,,290.3453369140625,30.950000762939453,1312.4100341796875,2813.840087890625
+2012-02-01,128.25875854492188,16.564136505126953,25.57801628112793,15.662582397460938,8.98449993133545,,309.4344482421875,32.88999938964844,1365.6800537109375,2966.889892578125
+2012-02-08,,,,,,,,,,
+2012-03-01,136.5597381591797,18.308074951171875,26.1682071685791,15.377117156982422,10.125499725341797,,320.9409484863281,34.310001373291016,1408.469970703125,3091.570068359375
+2012-04-01,135.53221130371094,17.83262062072754,25.97353172302246,14.882647514343262,11.595000267028809,,302.72772216796875,33.54999923706055,1397.9100341796875,3046.360107421875
+2012-05-01,126.25150299072266,17.64176368713379,23.677928924560547,13.811394691467285,10.645500183105469,,290.7207336425781,31.049999237060547,1310.3299560546875,2827.340087890625
+2012-05-08,,,,,,,,,,
+2012-06-01,128.5418243408203,17.83323097229004,24.976381301879883,15.054808616638184,11.417499542236328,,290.3253173828125,32.369998931884766,1362.1600341796875,2935.050048828125
+2012-07-01,128.80467224121094,18.650381088256836,24.06191635131836,13.332178115844727,11.664999961853027,,316.8017883300781,30.8799991607666,1379.3199462890625,2939.52001953125
+2012-08-01,128.06199645996094,20.314008712768555,25.1641845703125,14.178669929504395,12.41349983215332,,342.88787841796875,31.270000457763672,1406.5799560546875,3066.9599609375
+2012-08-08,,,,,,,,,,
+2012-09-01,136.92532348632812,20.458269119262695,24.459667205810547,14.120949745178223,12.715999603271484,,377.62762451171875,32.439998626708984,1440.6700439453125,3116.22998046875
+2012-10-01,128.39756774902344,18.256948471069336,23.456958770751953,12.4627103805542,11.644499778747559,,340.490478515625,34.029998779296875,1412.1600341796875,2977.22998046875
+2012-11-01,125.45381927490234,17.94904899597168,21.878910064697266,13.178736686706543,12.602499961853027,,349.5345458984375,34.61000061035156,1416.1800537109375,3010.239990234375
+2012-11-07,,,,,,,,,,
+2012-12-01,126.98394775390625,16.39484405517578,22.13326644897461,13.19808578491211,12.543499946594238,,354.0440368652344,37.68000030517578,1426.18994140625,3019.510009765625
+2013-01-01,134.6208953857422,14.03252124786377,22.746475219726562,15.598185539245605,13.274999618530273,,378.2232360839844,37.83000183105469,1498.1099853515625,3142.1298828125
+2013-02-01,133.1359405517578,13.598445892333984,23.036500930786133,15.79291820526123,13.213500022888184,,401.0010070800781,39.310001373291016,1514.6800537109375,3160.18994140625
+2013-02-06,,,,,,,,,,
+2013-03-01,141.99786376953125,13.716739654541016,23.903995513916016,16.74711036682129,13.32450008392334,,397.49249267578125,43.52000045776367,1569.18994140625,3267.52001953125
+2013-04-01,134.8347625732422,13.720457077026367,27.655447006225586,16.822824478149414,12.690500259399414,,412.69769287109375,45.08000183105469,1597.5699462890625,3328.7900390625
+2013-05-01,138.48284912109375,13.935823440551758,29.15936851501465,17.234567642211914,13.460000038146973,,436.0460510253906,42.90999984741211,1630.739990234375,3455.909912109375
+2013-05-08,,,,,,,,,,
+2013-06-01,127.82191467285156,12.368638038635254,29.060949325561523,17.783567428588867,13.884499549865723,,440.6256408691406,45.560001373291016,1606.280029296875,3403.25
+2013-07-01,130.45040893554688,14.115401268005371,26.789243698120117,19.142587661743164,15.060999870300293,,444.3193054199219,47.279998779296875,1685.72998046875,3626.3701171875
+2013-08-01,121.90938568115234,15.19745922088623,28.101774215698242,19.695158004760742,14.048999786376953,,423.8738708496094,45.75,1632.969970703125,3589.8701171875
+2013-08-07,,,,,,,,,,
+2013-09-01,124.47478485107422,14.96906566619873,28.19812774658203,20.306934356689453,15.631999969482422,,438.3934020996094,51.939998626708984,1681.550048828125,3771.47998046875
+2013-10-01,120.46192169189453,16.41180992126465,30.002870559692383,19.72601890563965,18.201499938964844,,515.8057861328125,54.220001220703125,1756.5400390625,3919.7099609375
+2013-11-01,120.77778625488281,17.45956802368164,32.30753707885742,22.58371353149414,19.680999755859375,,530.3253173828125,56.779998779296875,1805.81005859375,4059.889892578125
+2013-11-06,,,,,,,,,,
+2013-12-01,126.7584228515625,17.71782684326172,31.937856674194336,24.151473999023438,19.93950080871582,,560.9158935546875,59.880001068115234,1848.3599853515625,4176.58984375
+2014-01-01,119.39906311035156,15.80967903137207,32.304969787597656,21.634523391723633,17.934499740600586,,591.0760498046875,59.189998626708984,1782.5899658203125,4103.8798828125
+2014-02-01,125.13655090332031,16.61942481994629,32.70622634887695,21.913677215576172,18.104999542236328,,608.4334106445312,68.62999725341797,1859.449951171875,4308.1201171875
+2014-02-06,,,,,,,,,,
+2014-03-01,130.79644775390625,17.052499771118164,35.256614685058594,22.53180694580078,16.818500518798828,,557.8128051757812,65.73999786376953,1872.3399658203125,4198.990234375
+2014-04-01,133.50091552734375,18.747455596923828,34.7491340637207,24.246538162231445,15.206500053405762,,534.8800048828125,61.689998626708984,1883.949951171875,4114.56005859375
+2014-05-01,125.27215576171875,20.11072540283203,35.21359634399414,24.767969131469727,15.6274995803833,,571.6500244140625,64.54000091552734,1923.5699462890625,4242.6201171875
+2014-05-07,,,,,,,,,,
+2014-06-01,123.88963317871094,20.782461166381836,36.12032699584961,24.94846534729004,16.23900032043457,,584.6699829101562,72.36000061035156,1960.22998046875,4408.18017578125
+2014-07-01,130.99761962890625,21.37957000732422,37.38497543334961,26.72607421875,15.649499893188477,,579.5499877929688,69.25,1930.6700439453125,4369.77001953125
+2014-08-01,131.4281463623047,22.922651290893555,39.35124206542969,27.834640502929688,16.95199966430664,,582.3599853515625,71.9000015258789,2003.3699951171875,4580.27001953125
+2014-08-06,,,,,,,,,,
+2014-09-01,130.50729370117188,22.643360137939453,40.40761947631836,26.66560935974121,16.121999740600586,,588.4099731445312,69.19000244140625,1972.2900390625,4493.39013671875
+2014-10-01,113.0242691040039,24.27278709411621,40.92185974121094,26.89417266845703,15.27299976348877,,567.8699951171875,70.12000274658203,2018.050048828125,4630.740234375
+2014-11-01,111.49117279052734,26.729284286499023,41.67144012451172,28.27128028869629,16.93199920654297,,549.0800170898438,73.68000030517578,2067.56005859375,4791.6298828125
+2014-11-06,,,,,,,,,,
+2014-12-01,111.05672454833984,24.915250778198242,40.74142074584961,28.068769454956055,15.517499923706055,,530.6599731445312,72.69999694824219,2058.89990234375,4736.0498046875
+2015-01-01,106.12132263183594,26.445661544799805,35.434940338134766,26.79075813293457,17.726499557495117,,537.5499877929688,70.12999725341797,1994.989990234375,4635.240234375
+2015-02-01,112.09505462646484,28.996322631835938,38.460933685302734,27.767194747924805,19.007999420166016,,562.6300048828125,79.0999984741211,2104.5,4963.52978515625
+2015-02-06,,,,,,,,,,
+2015-03-01,111.87759399414062,28.197509765625,35.91679000854492,26.139816284179688,18.604999542236328,,554.7000122070312,73.94000244140625,2067.889892578125,4900.8798828125
+2015-04-01,119.3988265991211,28.360668182373047,42.96587371826172,23.521541595458984,21.089000701904297,,548.77001953125,76.05999755859375,2085.510009765625,4941.419921875
+2015-05-01,118.25563049316406,29.523195266723633,41.39352035522461,23.3579158782959,21.46150016784668,,545.3200073242188,79.08999633789062,2107.389892578125,5070.02978515625
+2015-05-06,,,,,,,,,,
+2015-06-01,114.24130249023438,28.542850494384766,39.253108978271484,21.762542724609375,21.704500198364258,,540.0399780273438,81.01000213623047,2063.110107421875,4986.8701171875
+2015-07-01,113.77072143554688,27.60302734375,41.520286560058594,22.683992385864258,26.8075008392334,,657.5,81.98999786376953,2103.840087890625,5128.27978515625
+2015-08-01,103.86784362792969,25.65966796875,38.692989349365234,20.93431854248047,25.644500732421875,,647.8200073242188,78.56999969482422,1972.1800537109375,4776.509765625
+2015-08-06,,,,,,,,,,
+2015-09-01,102.66226959228516,25.21347999572754,39.61040496826172,20.028608322143555,25.594499588012695,,638.3699951171875,82.22000122070312,1920.030029296875,4620.16015625
+2015-10-01,99.1993637084961,27.31651496887207,47.11008071899414,19.46390151977539,31.295000076293945,,737.3900146484375,88.66000366210938,2079.360107421875,5053.75
+2015-11-01,98.7319564819336,27.042200088500977,48.64043045043945,21.868392944335938,33.2400016784668,,762.8499755859375,91.45999908447266,2080.409912109375,5108.669921875
+2015-11-06,,,,,,,,,,
+2015-12-01,98.37144470214844,24.16438102722168,49.98638916015625,22.03421974182129,33.794498443603516,,778.010009765625,93.94000244140625,2043.93994140625,5007.41015625
+2016-01-01,89.20050811767578,22.3461971282959,49.63501739501953,20.343839645385742,29.350000381469727,,761.3499755859375,89.12999725341797,1940.239990234375,4613.9501953125
+2016-02-01,93.6608657836914,22.196985244750977,45.841888427734375,20.051719665527344,27.625999450683594,,717.219970703125,85.1500015258789,1932.22998046875,4557.9501953125
+2016-02-08,,,,,,,,,,
+2016-03-01,109.36297607421875,25.15644073486328,50.11842727661133,23.285871505737305,29.68199920654297,,762.9000244140625,93.80000305175781,2059.739990234375,4869.85009765625
+2016-04-01,105.3841552734375,21.636524200439453,45.25450134277344,20.178363800048828,32.97949981689453,,707.8800048828125,94.22000122070312,2065.300048828125,4775.35986328125
+2016-05-01,111.01663208007812,23.049110412597656,48.094825744628906,20.956079483032227,36.13949966430664,,748.8499755859375,99.47000122070312,2096.949951171875,4948.0498046875
+2016-05-06,,,,,,,,,,
+2016-06-01,110.65898895263672,22.20018196105957,46.75897216796875,19.947153091430664,35.78099822998047,,703.530029296875,95.79000091552734,2098.860107421875,4842.669921875
+2016-07-01,117.10401916503906,24.199600219726562,51.79398727416992,21.839828491210938,37.94049835205078,,791.3400268554688,97.86000061035156,2173.60009765625,5162.1298828125
+2016-08-01,115.83541107177734,24.638490676879883,52.506752014160156,20.885658264160156,38.45800018310547,,789.8499755859375,102.30999755859375,2170.949951171875,5213.22021484375
+2016-08-08,,,,,,,,,,
+2016-09-01,116.81381225585938,26.394628524780273,52.96271896362305,21.479366302490234,41.865501403808594,13.321450233459473,804.0599975585938,108.54000091552734,2168.27001953125,5312.0
+2016-10-01,113.019287109375,26.509033203125,55.095947265625,20.878395080566406,39.49100112915039,13.680961608886719,809.9000244140625,107.51000213623047,2126.14990234375,5189.14013671875
+2016-11-01,119.29200744628906,25.803936004638672,55.40858840942383,19.980859756469727,37.528499603271484,14.926712036132812,775.8800048828125,102.80999755859375,2198.81005859375,5323.68017578125
+2016-11-08,,,,,,,,,,
+2016-12-01,123.1717300415039,27.180198669433594,57.52321243286133,18.655929565429688,37.493499755859375,15.31966781616211,792.4500122070312,102.94999694824219,2238.830078125,5383.1201171875
+2017-01-01,129.5013427734375,28.47795867919922,59.84672927856445,22.670724868774414,41.17399978637695,17.554771423339844,820.1900024414062,113.37999725341797,2278.8701171875,5614.7900390625
+2017-02-01,133.43417358398438,32.148292541503906,59.22650909423828,24.339130401611328,42.25199890136719,17.69411849975586,844.9299926757812,118.33999633789062,2363.639892578125,5825.43994140625
+2017-02-08,,,,,,,,,,
+2017-03-01,130.24111938476562,33.85976028442383,61.33644485473633,24.011991500854492,44.32699966430664,17.858545303344727,847.7999877929688,130.1300048828125,2362.719970703125,5911.740234375
+2017-04-01,119.88253784179688,33.85739517211914,63.75787353515625,23.72492027282715,46.2495002746582,18.70298194885254,924.52001953125,133.74000549316406,2384.199951171875,6047.60986328125
+2017-05-01,114.1535415649414,36.00456237792969,65.0430908203125,23.328956604003906,49.73099899291992,19.338397979736328,987.0900268554688,141.86000061035156,2411.800048828125,6198.52001953125
+2017-05-08,,,,,,,,,,
+2017-06-01,116.17494201660156,34.084716796875,64.56354522705078,23.700172424316406,48.400001525878906,17.030832290649414,929.6799926757812,141.44000244140625,2423.409912109375,6140.419921875
+2017-07-01,109.25714874267578,35.19940948486328,68.0947265625,25.520694732666016,49.388999938964844,17.911497116088867,945.5,146.49000549316406,2470.300048828125,6348.1201171875
+2017-08-01,108.01860809326172,38.81330490112305,70.03360748291016,26.852062225341797,49.029998779296875,20.882347106933594,955.239990234375,155.16000366210938,2471.64990234375,6428.66015625
+2017-08-08,,,,,,,,,,
+2017-09-01,110.72441864013672,36.6182861328125,70.14307403564453,27.700807571411133,48.067501068115234,21.517763137817383,973.719970703125,149.17999267578125,2519.360107421875,6495.9599609375
+2017-10-01,117.57792663574219,40.163211822509766,78.32596588134766,25.408233642578125,55.263999938964844,23.067289352416992,1033.0400390625,175.16000366210938,2575.260009765625,6727.669921875
+2017-11-01,117.50923919677734,40.83085632324219,79.2582015991211,24.86334991455078,58.837501525878906,21.80481719970703,1036.1700439453125,181.47000122070312,2647.580078125,6873.97021484375
+2017-11-09,,,,,,,,,,
+2017-12-01,118.25981140136719,40.3528938293457,80.95279693603516,24.43583106994629,58.4734992980957,22.65203857421875,1053.4000244140625,175.24000549316406,2673.610107421875,6903.39013671875
+2018-01-01,126.18390655517578,39.9236946105957,89.91493225097656,28.855159759521484,72.54450225830078,19.982173919677734,1182.219970703125,199.75999450683594,2823.81005859375,7411.47998046875
+2018-02-01,120.11751556396484,42.472713470458984,88.74141693115234,25.634004592895508,75.62249755859375,20.7039852142334,1103.9200439453125,209.1300048828125,2713.830078125,7273.009765625
+2018-02-08,,,,,,,,,,
+2018-03-01,119.43197631835938,40.170265197753906,86.7812271118164,24.33201026916504,72.36699676513672,20.402997970581055,1037.1400146484375,216.0800018310547,2640.8701171875,7063.4501953125
+2018-04-01,112.83880615234375,39.566917419433594,88.92057037353516,26.82056999206543,78.30650329589844,20.00168228149414,1018.5800170898438,221.60000610351562,2648.050048828125,7066.27001953125
+2018-05-01,109.99760437011719,44.7408332824707,93.97891998291016,23.179109573364258,81.48100280761719,22.479249954223633,1100.0,249.27999877929688,2705.27001953125,7442.1201171875
+2018-05-09,,,,,,,,,,
+2018-06-01,109.95153045654297,44.4903450012207,94.16664123535156,20.467208862304688,84.98999786376953,23.571720123291016,1129.18994140625,243.80999755859375,2718.3701171875,7510.2998046875
+2018-07-01,114.06781768798828,45.73533630371094,101.30004119873047,22.375450134277344,88.87200164794922,25.784528732299805,1227.219970703125,244.67999267578125,2816.2900390625,7671.7900390625
+2018-08-01,115.2877197265625,54.709842681884766,107.2684097290039,24.00385284423828,100.635498046875,26.8017520904541,1231.800048828125,263.510009765625,2901.52001953125,8109.5400390625
+2018-08-09,,,,,,,,,,
+2018-09-01,120.2962646484375,54.445865631103516,109.63678741455078,23.24565315246582,100.1500015258789,27.066509246826172,1207.0799560546875,269.95001220703125,2913.97998046875,8046.35009765625
+2018-10-01,91.83122253417969,52.78649139404297,102.38966369628906,24.236047744750977,79.90049743652344,25.190916061401367,1090.5799560546875,245.75999450683594,2711.739990234375,7305.89990234375
+2018-11-01,98.86396026611328,43.07142639160156,106.3008041381836,23.4099178314209,84.50849914550781,29.396371841430664,1109.6500244140625,250.88999938964844,2760.169921875,7330.5400390625
+2018-11-08,,,,,,,,,,
+2018-12-01,91.58279418945312,38.17780685424805,97.78714752197266,17.18350601196289,75.09850311279297,24.59708595275879,1044.9599609375,226.24000549316406,2506.85009765625,6635.27978515625
+2019-01-01,108.30086517333984,40.28346252441406,100.5406265258789,24.84735679626465,85.9365005493164,24.456159591674805,1125.8900146484375,247.82000732421875,2704.10009765625,7281.740234375
+2019-02-01,111.28997039794922,41.90748596191406,107.85758972167969,27.216707229614258,81.99150085449219,28.095136642456055,1126.550048828125,262.5,2784.489990234375,7532.52978515625
+2019-02-07,,,,,,,,,,
+2019-03-01,115.00740814208984,46.17075729370117,114.03240966796875,28.167972564697266,89.0374984741211,29.539655685424805,1176.8900146484375,266.489990234375,2834.39990234375,7729.31982421875
+2019-04-01,114.33090209960938,48.77644348144531,126.27296447753906,29.61660385131836,96.32599639892578,33.9285774230957,1198.9599609375,289.25,2945.830078125,8095.39013671875
+2019-05-01,103.50668334960938,42.55390930175781,119.58222198486328,27.175188064575195,88.75350189208984,29.972509384155273,1106.5,270.8999938964844,2752.06005859375,7453.14990234375
+2019-05-09,,,,,,,,,,
+2019-06-01,113.73433685302734,48.293270111083984,130.00108337402344,31.43656349182129,94.68150329589844,25.56848907470703,1082.800048828125,294.6499938964844,2941.760009765625,8006.240234375
+2019-07-01,122.26231384277344,51.98261260986328,132.24281311035156,28.701255798339844,93.33899688720703,29.061506271362305,1218.199951171875,298.8599853515625,2980.3798828125,8175.419921875
+2019-08-01,111.7796401977539,50.93339920043945,133.78579711914062,25.92054557800293,88.81449890136719,25.9359073638916,1190.530029296875,284.510009765625,2926.4599609375,7962.8798828125
+2019-08-08,,,,,,,,,,
+2019-09-01,121.34967803955078,54.85721969604492,135.37051391601562,26.743131637573242,86.79550170898438,26.10200309753418,1221.1400146484375,276.25,2976.739990234375,7999.33984375
+2019-10-01,111.59463500976562,60.929054260253906,139.59625244140625,30.58913803100586,88.83300018310547,26.620418548583984,1258.800048828125,277.92999267578125,3037.56005859375,8292.3603515625
+2019-11-01,112.19547271728516,65.45783996582031,147.39544677734375,35.09682083129883,90.04000091552734,24.40582847595215,1304.0899658203125,309.5299987792969,3140.97998046875,8665.4697265625
+2019-11-07,,,,,,,,,,
+2019-12-01,113.17443084716797,72.13994598388672,154.07154846191406,33.23965072631836,92.39199829101562,25.86544418334961,1339.3900146484375,329.80999755859375,3230.780029296875,8972.599609375
+2020-01-01,121.35601806640625,76.03622436523438,166.31326293945312,32.28398132324219,100.43599700927734,24.546754837036133,1432.780029296875,351.1400146484375,3225.52001953125,9150.9404296875
+2020-02-01,109.88997650146484,67.1553726196289,158.28240966796875,29.225305557250977,94.1875,20.364192962646484,1339.25,345.1199951171875,2954.219970703125,8567.3701171875
+2020-02-07,,,,,,,,,,
+2020-03-01,94.6399154663086,62.61878204345703,154.502197265625,17.190288543701172,97.48600006103516,19.90617561340332,1161.949951171875,318.239990234375,2584.590087890625,7700.10009765625
+2020-04-01,107.12150573730469,72.34808349609375,175.5648956298828,16.6003360748291,123.69999694824219,21.486589431762695,1346.699951171875,353.6400146484375,2912.429931640625,8889.5498046875
+2020-05-01,106.55841827392578,78.29256439208984,179.52272033691406,14.412978172302246,122.11849975585938,24.98464012145996,1433.52001953125,386.6000061035156,3044.31005859375,9489.8701171875
+2020-05-07,,,,,,,,,,
+2020-06-01,104.41674041748047,90.0749740600586,199.92588806152344,13.877481460571289,137.9409942626953,27.652219772338867,1418.050048828125,435.30999755859375,3100.2900390625,10058.76953125
+2020-07-01,106.29290008544922,104.9491958618164,201.3994598388672,15.366937637329102,158.23399353027344,30.11343765258789,1487.949951171875,444.32000732421875,3271.1201171875,10745.26953125
+2020-08-01,106.61280059814453,127.44819641113281,221.55807495117188,17.406635284423828,172.54800415039062,33.25917053222656,1629.530029296875,513.3900146484375,3500.31005859375,11775.4599609375
+2020-08-07,,,,,,,,,,
+2020-09-01,106.57222747802734,114.5876235961914,207.12527465820312,17.323570251464844,157.43649291992188,34.06950759887695,1465.5999755859375,490.42999267578125,3363.0,11167.509765625
+2020-10-01,97.80435180664062,107.71099090576172,199.38504028320312,16.259458541870117,151.8074951171875,30.329862594604492,1616.1099853515625,447.1000061035156,3269.9599609375,10911.58984375
+2020-11-01,108.19266510009766,117.79344177246094,210.8082733154297,20.478687286376953,158.40199279785156,34.74394989013672,1754.4000244140625,478.4700012207031,3621.6298828125,12198.740234375
+2020-11-09,,,,,,,,,,
+2020-12-01,111.85865020751953,131.51597595214844,219.60447692871094,21.694869995117188,162.84649658203125,36.88808059692383,1752.6400146484375,500.1199951171875,3756.070068359375,12888.2802734375
+2021-01-01,105.84272766113281,130.7924346923828,229.0237274169922,19.891191482543945,160.30999755859375,36.6867561340332,1827.3599853515625,458.7699890136719,3714.239990234375,13070.6904296875
+2021-02-01,105.68277740478516,120.18710327148438,229.4384002685547,24.100215911865234,154.64649963378906,40.80388259887695,2021.9100341796875,459.6700134277344,3811.14990234375,13192.349609375
+2021-02-09,,,,,,,,,,
+2021-03-01,119.9990005493164,121.25013732910156,233.32164001464844,22.955739974975586,154.70399475097656,44.367366790771484,2062.52001953125,475.3699951171875,3972.889892578125,13246.8701171875
+2021-04-01,127.76121520996094,130.49156188964844,249.56121826171875,23.070621490478516,173.37100219726562,49.49113082885742,2353.5,508.3399963378906,4181.169921875,13962.6796875
+2021-05-01,129.4361114501953,123.6920166015625,247.08718872070312,22.41118812561035,161.15350341796875,49.64715576171875,2356.85009765625,504.5799865722656,4204.10986328125,13748.740234375
+2021-05-07,,,,,,,,,,
+2021-06-01,133.47738647460938,136.1819610595703,268.70587158203125,22.44941520690918,172.00799560546875,50.16557312011719,2441.7900390625,585.6400146484375,4297.5,14503.9501953125
+2021-07-01,128.35101318359375,145.03138732910156,282.6023864746094,23.305561065673828,166.37950134277344,48.63045883178711,2694.530029296875,621.6300048828125,4395.259765625,14672.6796875
+2021-08-01,127.78646087646484,150.96749877929688,299.4349365234375,21.74091148376465,173.5395050048828,49.053245544433594,2893.949951171875,663.7000122070312,4522.68017578125,15259.240234375
+2021-08-09,,,,,,,,,,
+2021-09-01,127.95899963378906,140.906982421875,280.1719665527344,19.48086166381836,164.2519989013672,52.36507034301758,2673.52001953125,575.719970703125,4307.5400390625,14448.580078125
+2021-10-01,115.22111511230469,149.1721954345703,329.56378173828125,17.397972106933594,168.6215057373047,55.35980224609375,2960.919921875,650.3599853515625,4605.3798828125,15498.3896484375
+2021-11-01,112.8140869140625,164.60723876953125,328.5401611328125,18.003969192504883,175.35350036621094,56.077186584472656,2837.949951171875,669.8499755859375,4567.0,15537.6904296875
+2021-11-04,,,,,,,,,,
+2021-11-09,,,,,,,,,,
+2021-12-01,130.48629760742188,177.08387756347656,334.8461608886719,22.1286563873291,166.7169952392578,55.77927017211914,2897.0400390625,567.0599975585938,4766.18017578125,15644.9697265625
+2022-01-01,130.3984375,174.30149841308594,309.6171875,20.856517791748047,149.57350158691406,56.41482162475586,2706.070068359375,534.2999877929688,4515.5498046875,14239.8798828125
+2022-02-01,119.60104370117188,164.66795349121094,297.4805908203125,19.47332763671875,153.56300354003906,50.60551452636719,2701.139892578125,467.67999267578125,4373.93994140625,13751.400390625
+2022-02-10,,,,,,,,,,
+2022-03-01,128.46168518066406,174.3538360595703,307.59356689453125,19.927804946899414,162.99749755859375,49.84086990356445,2781.35009765625,455.6199951171875,4530.41015625,14220.51953125
+2022-04-01,130.6254425048828,157.418701171875,276.8751220703125,17.399999618530273,124.28150177001953,46.68299102783203,2282.18994140625,395.95001220703125,4131.93017578125,12334.6396484375
+2022-05-01,137.1759796142578,148.6216278076172,271.2382507324219,18.81999969482422,120.20950317382812,49.939998626708984,2275.239990234375,416.4800109863281,4132.14990234375,12081.3896484375
+2022-05-09,,,,,,,,,,
+2022-06-01,141.86000061035156,137.44000244140625,256.4800109863281,15.819999694824219,107.4000015258789,48.939998626708984,2240.14990234375,365.6300048828125,3821.550048828125,11181.5400390625
+2022-06-28,141.86000061035156,137.44000244140625,256.4800109863281,15.819999694824219,107.4000015258789,48.939998626708984,2240.14990234375,365.6300048828125,3821.550048828125,11181.5400390625
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/data_x_x2_x3.csv b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/data_x_x2_x3.csv
new file mode 100644
index 0000000000000000000000000000000000000000..521da1453204a97f4189ecd3c82e99970786f208
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/data_x_x2_x3.csv
@@ -0,0 +1,11 @@
+ 0 0 0
+ 1 1 1
+ 2 4 8
+ 3 9 27
+ 4 16 64
+ 5 25 125
+ 6 36 216
+ 7 49 343
+ 8 64 512
+ 9 81 729
+10 100 1000
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/eeg.dat b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/eeg.dat
new file mode 100644
index 0000000000000000000000000000000000000000..c666c65053bfa37d63c9bdc1e5337e18484ec688
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/eeg.dat differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/embedding_in_wx3.xrc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/embedding_in_wx3.xrc
new file mode 100644
index 0000000000000000000000000000000000000000..220656d735346d99363d97721fe738d8fcb4feeb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/embedding_in_wx3.xrc
@@ -0,0 +1,65 @@
+
+
+
+ embedding_in_wx3
+
+
+ wxVERTICAL
+
+
+ Check out this whizz-bang stuff!
+
+
+ 0
+ wxALL|wxEXPAND
+ 5
+
+
+
+ wxHORIZONTAL
+
+
+ whiz
+
+ 0
+ wxALL|wxEXPAND
+ 2
+
+
+
+ bang
+
+ 0
+ wxALL|wxEXPAND
+ 2
+
+
+
+ bang count:
+
+
+ 1
+ wxALL|wxEXPAND
+ 2
+
+
+
+ 0
+
+ 0
+ wxEXPAND
+
+
+ 0
+ wxLEFT|wxRIGHT|wxEXPAND
+ 5
+
+
+
+ 1
+ wxEXPAND
+
+
+
+
+
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/membrane.dat b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/membrane.dat
new file mode 100644
index 0000000000000000000000000000000000000000..68f5e6b219448dac694aacba66b819564ba33467
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/membrane.dat differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/msft.csv b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/msft.csv
new file mode 100644
index 0000000000000000000000000000000000000000..727b1befe36efde44fb5e2558e02410dad75a390
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/sample_data/msft.csv
@@ -0,0 +1,66 @@
+Date,Open,High,Low,Close,Volume,Adj. Close*
+19-Sep-03,29.76,29.97,29.52,29.96,92433800,29.79
+18-Sep-03,28.49,29.51,28.42,29.50,67268096,29.34
+17-Sep-03,28.76,28.95,28.47,28.50,47221600,28.34
+16-Sep-03,28.41,28.95,28.32,28.90,52060600,28.74
+15-Sep-03,28.37,28.61,28.33,28.36,41432300,28.20
+12-Sep-03,27.48,28.40,27.45,28.34,55777200,28.18
+11-Sep-03,27.66,28.11,27.59,27.84,37813300,27.68
+10-Sep-03,28.03,28.18,27.48,27.55,54763500,27.40
+9-Sep-03,28.65,28.71,28.31,28.37,44315200,28.21
+8-Sep-03,28.39,28.92,28.34,28.84,46105300,28.68
+5-Sep-03,28.23,28.75,28.17,28.38,64024500,28.22
+4-Sep-03,28.10,28.47,27.99,28.43,59840800,28.27
+3-Sep-03,27.42,28.40,27.38,28.30,109437800,28.14
+2-Sep-03,26.70,27.30,26.47,27.26,74168896,27.11
+29-Aug-03,26.46,26.55,26.35,26.52,34503000,26.37
+28-Aug-03,26.50,26.58,26.24,26.51,46211200,26.36
+27-Aug-03,26.51,26.58,26.30,26.42,30633900,26.27
+26-Aug-03,26.31,26.67,25.96,26.57,47546000,26.42
+25-Aug-03,26.31,26.54,26.23,26.50,36132900,26.35
+22-Aug-03,26.78,26.95,26.21,26.22,65846300,26.07
+21-Aug-03,26.65,26.73,26.13,26.24,63802700,26.09
+20-Aug-03,26.30,26.53,26.00,26.45,56739300,26.30
+19-Aug-03,25.85,26.65,25.77,26.62,72952896,26.47
+18-Aug-03,25.56,25.83,25.46,25.70,45817400,25.56
+15-Aug-03,25.61,25.66,25.43,25.54,27607900,25.40
+14-Aug-03,25.66,25.71,25.52,25.63,37338300,25.49
+13-Aug-03,25.79,25.89,25.50,25.60,39636900,25.46
+12-Aug-03,25.71,25.77,25.45,25.73,38208400,25.59
+11-Aug-03,25.61,25.99,25.54,25.61,36433900,25.47
+8-Aug-03,25.88,25.98,25.50,25.58,33241400,25.44
+7-Aug-03,25.72,25.81,25.45,25.71,44258500,25.57
+6-Aug-03,25.54,26.19,25.43,25.65,56294900,25.51
+5-Aug-03,26.31,26.54,25.60,25.66,58825800,25.52
+4-Aug-03,26.15,26.41,25.75,26.18,51825600,26.03
+1-Aug-03,26.33,26.51,26.12,26.17,42649700,26.02
+31-Jul-03,26.60,26.99,26.31,26.41,64504800,26.26
+30-Jul-03,26.46,26.57,26.17,26.23,41240300,26.08
+29-Jul-03,26.88,26.90,26.24,26.47,62391100,26.32
+28-Jul-03,26.94,27.00,26.49,26.61,52658300,26.46
+25-Jul-03,26.28,26.95,26.07,26.89,54173000,26.74
+24-Jul-03,26.78,26.92,25.98,26.00,53556600,25.85
+23-Jul-03,26.42,26.65,26.14,26.45,49828200,26.30
+22-Jul-03,26.28,26.56,26.13,26.38,51791000,26.23
+21-Jul-03,26.87,26.91,26.00,26.04,48480800,25.89
+18-Jul-03,27.11,27.23,26.75,26.89,63388400,26.74
+17-Jul-03,27.14,27.27,26.54,26.69,72805000,26.54
+16-Jul-03,27.56,27.62,27.20,27.52,49838900,27.37
+15-Jul-03,27.47,27.53,27.10,27.27,53567600,27.12
+14-Jul-03,27.63,27.81,27.05,27.40,60464400,27.25
+11-Jul-03,26.95,27.45,26.89,27.31,50377300,27.16
+10-Jul-03,27.25,27.42,26.59,26.91,55350800,26.76
+9-Jul-03,27.56,27.70,27.25,27.47,62300700,27.32
+8-Jul-03,27.26,27.80,27.25,27.70,61896800,27.55
+7-Jul-03,27.02,27.55,26.95,27.42,88960800,27.27
+3-Jul-03,26.69,26.95,26.41,26.50,39440900,26.35
+2-Jul-03,26.50,26.93,26.45,26.88,94069296,26.73
+1-Jul-03,25.59,26.20,25.39,26.15,60926000,26.00
+30-Jun-03,25.94,26.12,25.50,25.64,48073100,25.50
+27-Jun-03,25.95,26.34,25.53,25.63,76040304,25.49
+26-Jun-03,25.39,26.51,25.21,25.75,51758100,25.61
+25-Jun-03,25.64,25.99,25.14,25.26,60483500,25.12
+24-Jun-03,25.65,26.04,25.52,25.70,51820300,25.56
+23-Jun-03,26.14,26.24,25.49,25.78,52584500,25.64
+20-Jun-03,26.34,26.38,26.01,26.33,86048896,26.18
+19-Jun-03,26.09,26.39,26.01,26.07,63626900,25.92
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..418721314335afad04ff288d897636d24d89be70
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/Solarize_Light2.mplstyle
@@ -0,0 +1,53 @@
+# Solarized color palette taken from https://ethanschoonover.com/solarized/
+# Inspired by, and copied from ggthemes https://github.com/jrnold/ggthemes
+
+#TODO:
+# 1. Padding to title from face
+# 2. Remove top & right ticks
+# 3. Give Title a Magenta Color(?)
+
+#base00 ='#657b83'
+#base01 ='#93a1a1'
+#base2 ='#eee8d5'
+#base3 ='#fdf6e3'
+#base01 ='#586e75'
+#Magenta ='#d33682'
+#Blue ='#268bd2'
+#cyan ='#2aa198'
+#violet ='#6c71c4'
+#green ='#859900'
+#orange ='#cb4b16'
+
+figure.facecolor : FDF6E3
+
+patch.antialiased : True
+
+lines.linewidth : 2.0
+lines.solid_capstyle: butt
+
+axes.titlesize : 16
+axes.labelsize : 12
+axes.labelcolor : 657b83
+axes.facecolor : eee8d5
+axes.edgecolor : eee8d5
+axes.axisbelow : True
+axes.prop_cycle : cycler('color', ['268BD2', '2AA198', '859900', 'B58900', 'CB4B16', 'DC322F', 'D33682', '6C71C4'])
+# Blue
+# Cyan
+# Green
+# Yellow
+# Orange
+# Red
+# Magenta
+# Violet
+axes.grid : True
+grid.color : fdf6e3 # grid color
+grid.linestyle : - # line
+grid.linewidth : 1 # in points
+
+### TICKS
+xtick.color : 657b83
+xtick.direction : out
+
+ytick.color : 657b83
+ytick.direction : out
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_classic_test_patch.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_classic_test_patch.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..96f62f4ba5929594fd23da024b183195481012b8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_classic_test_patch.mplstyle
@@ -0,0 +1,6 @@
+# This patch should go on top of the "classic" style and exists solely to avoid
+# changing baseline images.
+
+text.kerning_factor : 6
+
+ytick.alignment: center_baseline
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..911658fe883335f69b3869dad36fc89cdcb92026
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_mpl-gallery-nogrid.mplstyle
@@ -0,0 +1,19 @@
+# This style is used for the plot_types gallery. It is considered private.
+
+axes.grid: False
+axes.axisbelow: True
+
+figure.figsize: 2, 2
+# make it so the axes labels don't show up. Obviously
+# not good style for any quantitative analysis:
+figure.subplot.left: 0.01
+figure.subplot.right: 0.99
+figure.subplot.bottom: 0.01
+figure.subplot.top: 0.99
+
+xtick.major.size: 0.0
+ytick.major.size: 0.0
+
+# colors:
+image.cmap : Blues
+axes.prop_cycle: cycler('color', ['1f77b4', '82bbdb', 'ccdff1'])
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_mpl-gallery.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_mpl-gallery.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..75c95bf16a1f1c1265c6554fba5da038f75bab91
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/_mpl-gallery.mplstyle
@@ -0,0 +1,19 @@
+# This style is used for the plot_types gallery. It is considered part of the private API.
+
+axes.grid: True
+axes.axisbelow: True
+
+figure.figsize: 2, 2
+# make it so the axes labels don't show up. Obviously
+# not good style for any quantitative analysis:
+figure.subplot.left: 0.01
+figure.subplot.right: 0.99
+figure.subplot.bottom: 0.01
+figure.subplot.top: 0.99
+
+xtick.major.size: 0.0
+ytick.major.size: 0.0
+
+# colors:
+image.cmap : Blues
+axes.prop_cycle: cycler('color', ['1f77b4', '58a1cf', 'abd0e6'])
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/bmh.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/bmh.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..1b449cc09fbf25c79ee4cc4f93e26a889bef0b52
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/bmh.mplstyle
@@ -0,0 +1,29 @@
+#Author: Cameron Davidson-Pilon, original styles from Bayesian Methods for Hackers
+# https://github.com/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
+
+lines.linewidth : 2.0
+
+patch.linewidth: 0.5
+patch.facecolor: blue
+patch.edgecolor: eeeeee
+patch.antialiased: True
+
+text.hinting_factor : 8
+
+mathtext.fontset : cm
+
+axes.facecolor: eeeeee
+axes.edgecolor: bcbcbc
+axes.grid : True
+axes.titlesize: x-large
+axes.labelsize: large
+axes.prop_cycle: cycler('color', ['348ABD', 'A60628', '7A68A6', '467821', 'D55E00', 'CC79A7', '56B4E9', '009E73', 'F0E442', '0072B2'])
+
+grid.color: b2b2b2
+grid.linestyle: --
+grid.linewidth: 0.5
+
+legend.fancybox: True
+
+xtick.direction: in
+ytick.direction: in
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/classic.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/classic.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..50516d831ae4c2a04002878daf94a4252bc4b102
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/classic.mplstyle
@@ -0,0 +1,492 @@
+### Classic matplotlib plotting style as of v1.5
+
+
+### LINES
+# See https://matplotlib.org/api/artist_api.html#module-matplotlib.lines for more
+# information on line properties.
+lines.linewidth : 1.0 # line width in points
+lines.linestyle : - # solid line
+lines.color : b # has no affect on plot(); see axes.prop_cycle
+lines.marker : None # the default marker
+lines.markerfacecolor : auto # the default markerfacecolor
+lines.markeredgecolor : auto # the default markeredgecolor
+lines.markeredgewidth : 0.5 # the line width around the marker symbol
+lines.markersize : 6 # markersize, in points
+lines.dash_joinstyle : round # miter|round|bevel
+lines.dash_capstyle : butt # butt|round|projecting
+lines.solid_joinstyle : round # miter|round|bevel
+lines.solid_capstyle : projecting # butt|round|projecting
+lines.antialiased : True # render lines in antialiased (no jaggies)
+lines.dashed_pattern : 6, 6
+lines.dashdot_pattern : 3, 5, 1, 5
+lines.dotted_pattern : 1, 3
+lines.scale_dashes: False
+
+### Marker props
+markers.fillstyle: full
+
+### PATCHES
+# Patches are graphical objects that fill 2D space, like polygons or
+# circles. See
+# https://matplotlib.org/api/artist_api.html#module-matplotlib.patches
+# information on patch properties
+patch.linewidth : 1.0 # edge width in points
+patch.facecolor : b
+patch.force_edgecolor : True
+patch.edgecolor : k
+patch.antialiased : True # render patches in antialiased (no jaggies)
+
+hatch.color : k
+hatch.linewidth : 1.0
+
+hist.bins : 10
+
+### FONT
+#
+# font properties used by text.Text. See
+# https://matplotlib.org/api/font_manager_api.html for more
+# information on font properties. The 6 font properties used for font
+# matching are given below with their default values.
+#
+# The font.family property has five values: 'serif' (e.g., Times),
+# 'sans-serif' (e.g., Helvetica), 'cursive' (e.g., Zapf-Chancery),
+# 'fantasy' (e.g., Western), and 'monospace' (e.g., Courier). Each of
+# these font families has a default list of font names in decreasing
+# order of priority associated with them. When text.usetex is False,
+# font.family may also be one or more concrete font names.
+#
+# The font.style property has three values: normal (or roman), italic
+# or oblique. The oblique style will be used for italic, if it is not
+# present.
+#
+# The font.variant property has two values: normal or small-caps. For
+# TrueType fonts, which are scalable fonts, small-caps is equivalent
+# to using a font size of 'smaller', or about 83% of the current font
+# size.
+#
+# The font.weight property has effectively 13 values: normal, bold,
+# bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as
+# 400, and bold is 700. bolder and lighter are relative values with
+# respect to the current weight.
+#
+# The font.stretch property has 11 values: ultra-condensed,
+# extra-condensed, condensed, semi-condensed, normal, semi-expanded,
+# expanded, extra-expanded, ultra-expanded, wider, and narrower. This
+# property is not currently implemented.
+#
+# The font.size property is the default font size for text, given in pts.
+# 12pt is the standard value.
+#
+font.family : sans-serif
+font.style : normal
+font.variant : normal
+font.weight : normal
+font.stretch : normal
+# note that font.size controls default text sizes. To configure
+# special text sizes tick labels, axes, labels, title, etc, see the rc
+# settings for axes and ticks. Special text sizes can be defined
+# relative to font.size, using the following values: xx-small, x-small,
+# small, medium, large, x-large, xx-large, larger, or smaller
+font.size : 12.0
+font.serif : DejaVu Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
+font.sans-serif: DejaVu Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
+font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive
+font.fantasy : Comic Sans MS, Chicago, Charcoal, ImpactWestern, xkcd script, fantasy
+font.monospace : DejaVu Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
+
+### TEXT
+# text properties used by text.Text. See
+# https://matplotlib.org/api/artist_api.html#module-matplotlib.text for more
+# information on text properties
+
+text.color : k
+
+### LaTeX customizations. See http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex
+text.usetex : False # use latex for all text handling. The following fonts
+ # are supported through the usual rc parameter settings:
+ # new century schoolbook, bookman, times, palatino,
+ # zapf chancery, charter, serif, sans-serif, helvetica,
+ # avant garde, courier, monospace, computer modern roman,
+ # computer modern sans serif, computer modern typewriter
+ # If another font is desired which can loaded using the
+ # LaTeX \usepackage command, please inquire at the
+ # matplotlib mailing list
+text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
+ # AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
+ # IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
+ # text.latex.preamble is a single line of LaTeX code that
+ # will be passed on to the LaTeX system. It may contain
+ # any code that is valid for the LaTeX "preamble", i.e.
+ # between the "\documentclass" and "\begin{document}"
+ # statements.
+ # Note that it has to be put on a single line, which may
+ # become quite long.
+ # The following packages are always loaded with usetex, so
+ # beware of package collisions: color, geometry, graphicx,
+ # type1cm, textcomp.
+ # Adobe Postscript (PSSNFS) font packages may also be
+ # loaded, depending on your font settings.
+
+text.hinting : auto # May be one of the following:
+ # 'none': Perform no hinting
+ # 'auto': Use freetype's autohinter
+ # 'native': Use the hinting information in the
+ # font file, if available, and if your
+ # freetype library supports it
+ # 'either': Use the native hinting information,
+ # or the autohinter if none is available.
+ # For backward compatibility, this value may also be
+ # True === 'auto' or False === 'none'.
+text.hinting_factor : 8 # Specifies the amount of softness for hinting in the
+ # horizontal direction. A value of 1 will hint to full
+ # pixels. A value of 2 will hint to half pixels etc.
+
+text.antialiased : True # If True (default), the text will be antialiased.
+ # This only affects the Agg backend.
+
+# The following settings allow you to select the fonts in math mode.
+# They map from a TeX font name to a fontconfig font pattern.
+# These settings are only used if mathtext.fontset is 'custom'.
+# Note that this "custom" mode is unsupported and may go away in the
+# future.
+mathtext.cal : cursive
+mathtext.rm : serif
+mathtext.tt : monospace
+mathtext.it : serif:italic
+mathtext.bf : serif:bold
+mathtext.sf : sans\-serif
+mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix',
+ # 'stixsans' or 'custom'
+mathtext.fallback: cm # Select fallback font from ['cm' (Computer Modern), 'stix'
+ # 'stixsans'] when a symbol cannot be found in one of the
+ # custom math fonts. Select 'None' to not perform fallback
+ # and replace the missing character by a dummy.
+
+mathtext.default : it # The default font to use for math.
+ # Can be any of the LaTeX font names, including
+ # the special name "regular" for the same font
+ # used in regular text.
+
+### AXES
+# default face and edge color, default tick sizes,
+# default fontsizes for ticklabels, and so on. See
+# https://matplotlib.org/api/axes_api.html#module-matplotlib.axes
+axes.facecolor : w # axes background color
+axes.edgecolor : k # axes edge color
+axes.linewidth : 1.0 # edge linewidth
+axes.grid : False # display grid or not
+axes.grid.which : major
+axes.grid.axis : both
+axes.titlesize : large # fontsize of the axes title
+axes.titley : 1.0 # at the top, no autopositioning.
+axes.titlepad : 5.0 # pad between axes and title in points
+axes.titleweight : normal # font weight for axes title
+axes.labelsize : medium # fontsize of the x any y labels
+axes.labelpad : 5.0 # space between label and axis
+axes.labelweight : normal # weight of the x and y labels
+axes.labelcolor : k
+axes.axisbelow : False # whether axis gridlines and ticks are below
+ # the axes elements (lines, text, etc)
+
+axes.formatter.limits : -7, 7 # use scientific notation if log10
+ # of the axis range is smaller than the
+ # first or larger than the second
+axes.formatter.use_locale : False # When True, format tick labels
+ # according to the user's locale.
+ # For example, use ',' as a decimal
+ # separator in the fr_FR locale.
+axes.formatter.use_mathtext : False # When True, use mathtext for scientific
+ # notation.
+axes.formatter.useoffset : True # If True, the tick label formatter
+ # will default to labeling ticks relative
+ # to an offset when the data range is very
+ # small compared to the minimum absolute
+ # value of the data.
+axes.formatter.offset_threshold : 2 # When useoffset is True, the offset
+ # will be used when it can remove
+ # at least this number of significant
+ # digits from tick labels.
+
+axes.unicode_minus : True # use Unicode for the minus symbol
+ # rather than hyphen. See
+ # https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
+axes.prop_cycle : cycler('color', 'bgrcmyk')
+ # color cycle for plot lines
+ # as list of string colorspecs:
+ # single letter, long name, or
+ # web-style hex
+axes.autolimit_mode : round_numbers
+axes.xmargin : 0 # x margin. See `axes.Axes.margins`
+axes.ymargin : 0 # y margin See `axes.Axes.margins`
+axes.spines.bottom : True
+axes.spines.left : True
+axes.spines.right : True
+axes.spines.top : True
+polaraxes.grid : True # display grid on polar axes
+axes3d.grid : True # display grid on 3D axes
+axes3d.automargin : False # automatically add margin when manually setting 3D axis limits
+
+date.autoformatter.year : %Y
+date.autoformatter.month : %b %Y
+date.autoformatter.day : %b %d %Y
+date.autoformatter.hour : %H:%M:%S
+date.autoformatter.minute : %H:%M:%S.%f
+date.autoformatter.second : %H:%M:%S.%f
+date.autoformatter.microsecond : %H:%M:%S.%f
+date.converter: auto # 'auto', 'concise'
+
+### TICKS
+# see https://matplotlib.org/api/axis_api.html#matplotlib.axis.Tick
+
+xtick.top : True # draw ticks on the top side
+xtick.bottom : True # draw ticks on the bottom side
+xtick.major.size : 4 # major tick size in points
+xtick.minor.size : 2 # minor tick size in points
+xtick.minor.visible : False
+xtick.major.width : 0.5 # major tick width in points
+xtick.minor.width : 0.5 # minor tick width in points
+xtick.major.pad : 4 # distance to major tick label in points
+xtick.minor.pad : 4 # distance to the minor tick label in points
+xtick.color : k # color of the tick labels
+xtick.labelsize : medium # fontsize of the tick labels
+xtick.direction : in # direction: in, out, or inout
+xtick.major.top : True # draw x axis top major ticks
+xtick.major.bottom : True # draw x axis bottom major ticks
+xtick.minor.top : True # draw x axis top minor ticks
+xtick.minor.bottom : True # draw x axis bottom minor ticks
+xtick.alignment : center
+
+ytick.left : True # draw ticks on the left side
+ytick.right : True # draw ticks on the right side
+ytick.major.size : 4 # major tick size in points
+ytick.minor.size : 2 # minor tick size in points
+ytick.minor.visible : False
+ytick.major.width : 0.5 # major tick width in points
+ytick.minor.width : 0.5 # minor tick width in points
+ytick.major.pad : 4 # distance to major tick label in points
+ytick.minor.pad : 4 # distance to the minor tick label in points
+ytick.color : k # color of the tick labels
+ytick.labelsize : medium # fontsize of the tick labels
+ytick.direction : in # direction: in, out, or inout
+ytick.major.left : True # draw y axis left major ticks
+ytick.major.right : True # draw y axis right major ticks
+ytick.minor.left : True # draw y axis left minor ticks
+ytick.minor.right : True # draw y axis right minor ticks
+ytick.alignment : center
+
+### GRIDS
+grid.color : k # grid color
+grid.linestyle : : # dotted
+grid.linewidth : 0.5 # in points
+grid.alpha : 1.0 # transparency, between 0.0 and 1.0
+
+### Legend
+legend.fancybox : False # if True, use a rounded box for the
+ # legend, else a rectangle
+legend.loc : upper right
+legend.numpoints : 2 # the number of points in the legend line
+legend.fontsize : large
+legend.borderpad : 0.4 # border whitespace in fontsize units
+legend.markerscale : 1.0 # the relative size of legend markers vs. original
+# the following dimensions are in axes coords
+legend.labelspacing : 0.5 # the vertical space between the legend entries in fraction of fontsize
+legend.handlelength : 2. # the length of the legend lines in fraction of fontsize
+legend.handleheight : 0.7 # the height of the legend handle in fraction of fontsize
+legend.handletextpad : 0.8 # the space between the legend line and legend text in fraction of fontsize
+legend.borderaxespad : 0.5 # the border between the axes and legend edge in fraction of fontsize
+legend.columnspacing : 2. # the border between the axes and legend edge in fraction of fontsize
+legend.shadow : False
+legend.frameon : True # whether or not to draw a frame around legend
+legend.framealpha : None # opacity of legend frame
+legend.scatterpoints : 3 # number of scatter points
+legend.facecolor : inherit # legend background color (when 'inherit' uses axes.facecolor)
+legend.edgecolor : inherit # legend edge color (when 'inherit' uses axes.edgecolor)
+
+
+
+### FIGURE
+# See https://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure
+figure.titlesize : medium # size of the figure title
+figure.titleweight : normal # weight of the figure title
+figure.labelsize: medium # size of the figure label
+figure.labelweight: normal # weight of the figure label
+figure.figsize : 8, 6 # figure size in inches
+figure.dpi : 80 # figure dots per inch
+figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray
+figure.edgecolor : w # figure edgecolor
+figure.autolayout : False # When True, automatically adjust subplot
+ # parameters to make the plot fit the figure
+figure.frameon : True
+
+# The figure subplot parameters. All dimensions are a fraction of the
+# figure width or height
+figure.subplot.left : 0.125 # the left side of the subplots of the figure
+figure.subplot.right : 0.9 # the right side of the subplots of the figure
+figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure
+figure.subplot.top : 0.9 # the top of the subplots of the figure
+figure.subplot.wspace : 0.2 # the amount of width reserved for space between subplots,
+ # expressed as a fraction of the average axis width
+figure.subplot.hspace : 0.2 # the amount of height reserved for space between subplots,
+ # expressed as a fraction of the average axis height
+
+### IMAGES
+image.aspect : equal # equal | auto | a number
+image.interpolation : bilinear # see help(imshow) for options
+image.cmap : jet # gray | jet | ...
+image.lut : 256 # the size of the colormap lookup table
+image.origin : upper # lower | upper
+image.resample : False
+image.composite_image : True
+
+### CONTOUR PLOTS
+contour.negative_linestyle : dashed # dashed | solid
+contour.corner_mask : True
+
+# errorbar props
+errorbar.capsize: 3
+
+# scatter props
+scatter.marker: o
+
+### Boxplots
+boxplot.bootstrap: None
+boxplot.boxprops.color: b
+boxplot.boxprops.linestyle: -
+boxplot.boxprops.linewidth: 1.0
+boxplot.capprops.color: k
+boxplot.capprops.linestyle: -
+boxplot.capprops.linewidth: 1.0
+boxplot.flierprops.color: b
+boxplot.flierprops.linestyle: none
+boxplot.flierprops.linewidth: 1.0
+boxplot.flierprops.marker: +
+boxplot.flierprops.markeredgecolor: k
+boxplot.flierprops.markerfacecolor: auto
+boxplot.flierprops.markersize: 6.0
+boxplot.meanline: False
+boxplot.meanprops.color: r
+boxplot.meanprops.linestyle: -
+boxplot.meanprops.linewidth: 1.0
+boxplot.medianprops.color: r
+boxplot.meanprops.marker: s
+boxplot.meanprops.markerfacecolor: r
+boxplot.meanprops.markeredgecolor: k
+boxplot.meanprops.markersize: 6.0
+boxplot.medianprops.linestyle: -
+boxplot.medianprops.linewidth: 1.0
+boxplot.notch: False
+boxplot.patchartist: False
+boxplot.showbox: True
+boxplot.showcaps: True
+boxplot.showfliers: True
+boxplot.showmeans: False
+boxplot.whiskerprops.color: b
+boxplot.whiskerprops.linestyle: --
+boxplot.whiskerprops.linewidth: 1.0
+boxplot.whiskers: 1.5
+
+### Agg rendering
+### Warning: experimental, 2008/10/10
+agg.path.chunksize : 0 # 0 to disable; values in the range
+ # 10000 to 100000 can improve speed slightly
+ # and prevent an Agg rendering failure
+ # when plotting very large data sets,
+ # especially if they are very gappy.
+ # It may cause minor artifacts, though.
+ # A value of 20000 is probably a good
+ # starting point.
+### SAVING FIGURES
+path.simplify : True # When True, simplify paths by removing "invisible"
+ # points to reduce file size and increase rendering
+ # speed
+path.simplify_threshold : 0.1111111111111111
+ # The threshold of similarity below which
+ # vertices will be removed in the simplification
+ # process
+path.snap : True # When True, rectilinear axis-aligned paths will be snapped to
+ # the nearest pixel when certain criteria are met. When False,
+ # paths will never be snapped.
+path.sketch : None # May be none, or a 3-tuple of the form (scale, length,
+ # randomness).
+ # *scale* is the amplitude of the wiggle
+ # perpendicular to the line (in pixels). *length*
+ # is the length of the wiggle along the line (in
+ # pixels). *randomness* is the factor by which
+ # the length is randomly scaled.
+
+# the default savefig params can be different from the display params
+# e.g., you may want a higher resolution, or to make the figure
+# background white
+savefig.dpi : 100 # figure dots per inch
+savefig.facecolor : w # figure facecolor when saving
+savefig.edgecolor : w # figure edgecolor when saving
+savefig.format : png # png, ps, pdf, svg
+savefig.bbox : standard # 'tight' or 'standard'.
+ # 'tight' is incompatible with pipe-based animation
+ # backends (e.g. 'ffmpeg') but will work with those
+ # based on temporary files (e.g. 'ffmpeg_file')
+savefig.pad_inches : 0.1 # Padding to be used when bbox is set to 'tight'
+savefig.transparent : False # setting that controls whether figures are saved with a
+ # transparent background by default
+savefig.orientation : portrait
+
+# ps backend params
+ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10
+ps.useafm : False # use of afm fonts, results in small files
+ps.usedistiller : False # can be: None, ghostscript or xpdf
+ # Experimental: may produce smaller files.
+ # xpdf intended for production of publication quality files,
+ # but requires ghostscript, xpdf and ps2eps
+ps.distiller.res : 6000 # dpi
+ps.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType)
+
+# pdf backend params
+pdf.compression : 6 # integer from 0 to 9
+ # 0 disables compression (good for debugging)
+pdf.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType)
+pdf.inheritcolor : False
+pdf.use14corefonts : False
+
+# pgf backend params
+pgf.texsystem : xelatex
+pgf.rcfonts : True
+pgf.preamble :
+
+# svg backend params
+svg.image_inline : True # write raster image data directly into the svg file
+svg.fonttype : path # How to handle SVG fonts:
+# 'none': Assume fonts are installed on the machine where the SVG will be viewed.
+# 'path': Embed characters as paths -- supported by most SVG renderers
+
+# Event keys to interact with figures/plots via keyboard.
+# Customize these settings according to your needs.
+# Leave the field(s) empty if you don't need a key-map. (i.e., fullscreen : '')
+
+keymap.fullscreen : f, ctrl+f # toggling
+keymap.home : h, r, home # home or reset mnemonic
+keymap.back : left, c, backspace # forward / backward keys to enable
+keymap.forward : right, v # left handed quick navigation
+keymap.pan : p # pan mnemonic
+keymap.zoom : o # zoom mnemonic
+keymap.save : s, ctrl+s # saving current figure
+keymap.quit : ctrl+w, cmd+w # close the current figure
+keymap.grid : g # switching on/off a grid in current axes
+keymap.yscale : l # toggle scaling of y-axes ('log'/'linear')
+keymap.xscale : k, L # toggle scaling of x-axes ('log'/'linear')
+
+###ANIMATION settings
+animation.writer : ffmpeg # MovieWriter 'backend' to use
+animation.codec : mpeg4 # Codec to use for writing movie
+animation.bitrate: -1 # Controls size/quality tradeoff for movie.
+ # -1 implies let utility auto-determine
+animation.frame_format: png # Controls frame format used by temp files
+animation.ffmpeg_path: ffmpeg # Path to ffmpeg binary. Without full path
+ # $PATH is searched
+animation.ffmpeg_args: # Additional arguments to pass to ffmpeg
+animation.convert_path: convert # Path to ImageMagick's convert binary.
+ # On Windows use the full path since convert
+ # is also the name of a system tool.
+animation.convert_args:
+animation.html: none
+
+_internal.classic_mode: True
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/dark_background.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/dark_background.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..61a99f3c0d10c3676ec466b53f716d69df40bb1f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/dark_background.mplstyle
@@ -0,0 +1,26 @@
+# Set black background default line colors to white.
+
+lines.color: white
+patch.edgecolor: white
+
+text.color: white
+
+axes.facecolor: black
+axes.edgecolor: white
+axes.labelcolor: white
+axes.prop_cycle: cycler('color', ['8dd3c7', 'feffb3', 'bfbbd9', 'fa8174', '81b1d2', 'fdb462', 'b3de69', 'bc82bd', 'ccebc4', 'ffed6f'])
+
+xtick.color: white
+ytick.color: white
+
+grid.color: white
+
+figure.facecolor: black
+figure.edgecolor: black
+
+### Boxplots
+boxplot.boxprops.color: white
+boxplot.capprops.color: white
+boxplot.flierprops.color: white
+boxplot.flierprops.markeredgecolor: white
+boxplot.whiskerprops.color: white
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/fast.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/fast.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..1f7be7d4632a352f5c96959c8ecdba06c9a06b86
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/fast.mplstyle
@@ -0,0 +1,11 @@
+# a small set of changes that will make your plotting FAST (1).
+#
+# (1) in some cases
+
+# Maximally simplify lines.
+path.simplify: True
+path.simplify_threshold: 1.0
+
+# chunk up large lines into smaller lines!
+# simple trick to avoid those pesky O(>n) algorithms!
+agg.path.chunksize: 10000
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/fivethirtyeight.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/fivethirtyeight.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..cd56d404c3b540e641f0f961504942464f814a31
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/fivethirtyeight.mplstyle
@@ -0,0 +1,37 @@
+#Author: Cameron Davidson-Pilon, replicated styles from FiveThirtyEight.com
+# See https://www.dataorigami.net/blogs/fivethirtyeight-mpl
+
+lines.linewidth: 4
+lines.solid_capstyle: butt
+
+legend.fancybox: true
+
+axes.prop_cycle: cycler('color', ['008fd5', 'fc4f30', 'e5ae38', '6d904f', '8b8b8b', '810f7c'])
+axes.facecolor: f0f0f0
+axes.labelsize: large
+axes.axisbelow: true
+axes.grid: true
+axes.edgecolor: f0f0f0
+axes.linewidth: 3.0
+axes.titlesize: x-large
+
+patch.edgecolor: f0f0f0
+patch.linewidth: 0.5
+
+svg.fonttype: path
+
+grid.linestyle: -
+grid.linewidth: 1.0
+grid.color: cbcbcb
+
+xtick.major.size: 0
+xtick.minor.size: 0
+ytick.major.size: 0
+ytick.minor.size: 0
+
+font.size: 14.0
+
+figure.subplot.left: 0.08
+figure.subplot.right: 0.95
+figure.subplot.bottom: 0.07
+figure.facecolor: f0f0f0
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/ggplot.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/ggplot.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..d1b3ba2e337b02760ad0c3429f8391b50dea6622
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/ggplot.mplstyle
@@ -0,0 +1,39 @@
+# from https://everyhue.me/posts/sane-color-scheme-for-matplotlib/
+
+patch.linewidth: 0.5
+patch.facecolor: 348ABD # blue
+patch.edgecolor: EEEEEE
+patch.antialiased: True
+
+font.size: 10.0
+
+axes.facecolor: E5E5E5
+axes.edgecolor: white
+axes.linewidth: 1
+axes.grid: True
+axes.titlesize: x-large
+axes.labelsize: large
+axes.labelcolor: 555555
+axes.axisbelow: True # grid/ticks are below elements (e.g., lines, text)
+
+axes.prop_cycle: cycler('color', ['E24A33', '348ABD', '988ED5', '777777', 'FBC15E', '8EBA42', 'FFB5B8'])
+ # E24A33 : red
+ # 348ABD : blue
+ # 988ED5 : purple
+ # 777777 : gray
+ # FBC15E : yellow
+ # 8EBA42 : green
+ # FFB5B8 : pink
+
+xtick.color: 555555
+xtick.direction: out
+
+ytick.color: 555555
+ytick.direction: out
+
+grid.color: white
+grid.linestyle: - # solid line
+
+figure.facecolor: white
+figure.edgecolor: 0.50
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/grayscale.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/grayscale.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..6a1114e4069882f09c8e518f362a651a5b90ed9d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/grayscale.mplstyle
@@ -0,0 +1,29 @@
+# Set all colors to grayscale
+# Note: strings of float values are interpreted by matplotlib as gray values.
+
+
+lines.color: black
+patch.facecolor: gray
+patch.edgecolor: black
+
+text.color: black
+
+axes.facecolor: white
+axes.edgecolor: black
+axes.labelcolor: black
+# black to light gray
+axes.prop_cycle: cycler('color', ['0.00', '0.40', '0.60', '0.70'])
+
+xtick.color: black
+ytick.color: black
+
+grid.color: black
+
+figure.facecolor: 0.75
+figure.edgecolor: white
+
+image.cmap: gray
+
+savefig.facecolor: white
+savefig.edgecolor: white
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/petroff10.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/petroff10.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..62d1262a09cd293cf7b8eb42a3bf1cccfd533aa2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/petroff10.mplstyle
@@ -0,0 +1,5 @@
+# Color cycle survey palette from Petroff (2021):
+# https://arxiv.org/abs/2107.02270
+# https://github.com/mpetroff/accessible-color-cycles
+axes.prop_cycle: cycler('color', ['3f90da', 'ffa90e', 'bd1f01', '94a4a2', '832db6', 'a96b59', 'e76300', 'b9ac70', '717581', '92dadd'])
+patch.facecolor: 3f90da
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-bright.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-bright.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..5e9e949378159bf83de825101b088afe23bbc5ec
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-bright.mplstyle
@@ -0,0 +1,3 @@
+# Seaborn bright palette
+axes.prop_cycle: cycler('color', ['003FFF', '03ED3A', 'E8000B', '8A2BE2', 'FFC400', '00D7FF'])
+patch.facecolor: 003FFF
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-colorblind.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-colorblind.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..e13b7aade323933472751664088c68a682cecf6e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-colorblind.mplstyle
@@ -0,0 +1,3 @@
+# Seaborn colorblind palette
+axes.prop_cycle: cycler('color', ['0072B2', '009E73', 'D55E00', 'CC79A7', 'F0E442', '56B4E9'])
+patch.facecolor: 0072B2
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-dark-palette.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-dark-palette.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..30160ae2506c63788b799fa80e3f3dedef7bca77
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-dark-palette.mplstyle
@@ -0,0 +1,3 @@
+# Seaborn dark palette
+axes.prop_cycle: cycler('color', ['001C7F', '017517', '8C0900', '7600A1', 'B8860B', '006374'])
+patch.facecolor: 001C7F
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-dark.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-dark.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..55b50b5bdd2689798504291cf4bca6ed775690d9
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-dark.mplstyle
@@ -0,0 +1,30 @@
+# Seaborn common parameters
+# .15 = dark_gray
+# .8 = light_gray
+figure.facecolor: white
+text.color: .15
+axes.labelcolor: .15
+legend.frameon: False
+legend.numpoints: 1
+legend.scatterpoints: 1
+xtick.direction: out
+ytick.direction: out
+xtick.color: .15
+ytick.color: .15
+axes.axisbelow: True
+image.cmap: Greys
+font.family: sans-serif
+font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif
+grid.linestyle: -
+lines.solid_capstyle: round
+
+# Seaborn dark parameters
+axes.grid: False
+axes.facecolor: EAEAF2
+axes.edgecolor: white
+axes.linewidth: 0
+grid.color: white
+xtick.major.size: 0
+ytick.major.size: 0
+xtick.minor.size: 0
+ytick.minor.size: 0
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-darkgrid.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-darkgrid.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..0f5d955d7df60665cb30067c0fc83907438b319a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-darkgrid.mplstyle
@@ -0,0 +1,30 @@
+# Seaborn common parameters
+# .15 = dark_gray
+# .8 = light_gray
+figure.facecolor: white
+text.color: .15
+axes.labelcolor: .15
+legend.frameon: False
+legend.numpoints: 1
+legend.scatterpoints: 1
+xtick.direction: out
+ytick.direction: out
+xtick.color: .15
+ytick.color: .15
+axes.axisbelow: True
+image.cmap: Greys
+font.family: sans-serif
+font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif
+grid.linestyle: -
+lines.solid_capstyle: round
+
+# Seaborn darkgrid parameters
+axes.grid: True
+axes.facecolor: EAEAF2
+axes.edgecolor: white
+axes.linewidth: 0
+grid.color: white
+xtick.major.size: 0
+ytick.major.size: 0
+xtick.minor.size: 0
+ytick.minor.size: 0
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-deep.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-deep.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..5d6b7c56009882e8f3a1cee0b8c8c8a52eb1fcfd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-deep.mplstyle
@@ -0,0 +1,3 @@
+# Seaborn deep palette
+axes.prop_cycle: cycler('color', ['4C72B0', '55A868', 'C44E52', '8172B2', 'CCB974', '64B5CD'])
+patch.facecolor: 4C72B0
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-muted.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-muted.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..4a71646ce9036116fedfb2094d9f21d52ac3e40a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-muted.mplstyle
@@ -0,0 +1,3 @@
+# Seaborn muted palette
+axes.prop_cycle: cycler('color', ['4878CF', '6ACC65', 'D65F5F', 'B47CC7', 'C4AD66', '77BEDB'])
+patch.facecolor: 4878CF
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-notebook.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-notebook.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..18bcf3e1204208f50834f6438d67d26e20b90482
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-notebook.mplstyle
@@ -0,0 +1,21 @@
+# Seaborn notebook context
+figure.figsize: 8.0, 5.5
+axes.labelsize: 11
+axes.titlesize: 12
+xtick.labelsize: 10
+ytick.labelsize: 10
+legend.fontsize: 10
+
+grid.linewidth: 1
+lines.linewidth: 1.75
+patch.linewidth: .3
+lines.markersize: 7
+lines.markeredgewidth: 0
+
+xtick.major.width: 1
+ytick.major.width: 1
+xtick.minor.width: .5
+ytick.minor.width: .5
+
+xtick.major.pad: 7
+ytick.major.pad: 7
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-paper.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-paper.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..3326be4333b875b481ad294adb8235a7106838e5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-paper.mplstyle
@@ -0,0 +1,21 @@
+# Seaborn paper context
+figure.figsize: 6.4, 4.4
+axes.labelsize: 8.8
+axes.titlesize: 9.6
+xtick.labelsize: 8
+ytick.labelsize: 8
+legend.fontsize: 8
+
+grid.linewidth: 0.8
+lines.linewidth: 1.4
+patch.linewidth: 0.24
+lines.markersize: 5.6
+lines.markeredgewidth: 0
+
+xtick.major.width: 0.8
+ytick.major.width: 0.8
+xtick.minor.width: 0.4
+ytick.minor.width: 0.4
+
+xtick.major.pad: 5.6
+ytick.major.pad: 5.6
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-pastel.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-pastel.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..dff67482c085da8d5d508a4dc5ce946b7230b513
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-pastel.mplstyle
@@ -0,0 +1,3 @@
+# Seaborn pastel palette
+axes.prop_cycle: cycler('color', ['92C6FF', '97F0AA', 'FF9F9A', 'D0BBFF', 'FFFEA3', 'B0E0E6'])
+patch.facecolor: 92C6FF
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-poster.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-poster.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..47f237006caeac212840f23a8c2568947523c596
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-poster.mplstyle
@@ -0,0 +1,21 @@
+# Seaborn poster context
+figure.figsize: 12.8, 8.8
+axes.labelsize: 17.6
+axes.titlesize: 19.2
+xtick.labelsize: 16
+ytick.labelsize: 16
+legend.fontsize: 16
+
+grid.linewidth: 1.6
+lines.linewidth: 2.8
+patch.linewidth: 0.48
+lines.markersize: 11.2
+lines.markeredgewidth: 0
+
+xtick.major.width: 1.6
+ytick.major.width: 1.6
+xtick.minor.width: 0.8
+ytick.minor.width: 0.8
+
+xtick.major.pad: 11.2
+ytick.major.pad: 11.2
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-talk.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-talk.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..29a77c53c4a844a10c1970176f37a6354ad27680
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-talk.mplstyle
@@ -0,0 +1,21 @@
+# Seaborn talk context
+figure.figsize: 10.4, 7.15
+axes.labelsize: 14.3
+axes.titlesize: 15.6
+xtick.labelsize: 13
+ytick.labelsize: 13
+legend.fontsize: 13
+
+grid.linewidth: 1.3
+lines.linewidth: 2.275
+patch.linewidth: 0.39
+lines.markersize: 9.1
+lines.markeredgewidth: 0
+
+xtick.major.width: 1.3
+ytick.major.width: 1.3
+xtick.minor.width: 0.65
+ytick.minor.width: 0.65
+
+xtick.major.pad: 9.1
+ytick.major.pad: 9.1
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-ticks.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-ticks.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..c2a1cab9a5ebb7eee134f7c15133954d5ea9f878
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-ticks.mplstyle
@@ -0,0 +1,30 @@
+# Seaborn common parameters
+# .15 = dark_gray
+# .8 = light_gray
+figure.facecolor: white
+text.color: .15
+axes.labelcolor: .15
+legend.frameon: False
+legend.numpoints: 1
+legend.scatterpoints: 1
+xtick.direction: out
+ytick.direction: out
+xtick.color: .15
+ytick.color: .15
+axes.axisbelow: True
+image.cmap: Greys
+font.family: sans-serif
+font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif
+grid.linestyle: -
+lines.solid_capstyle: round
+
+# Seaborn white parameters
+axes.grid: False
+axes.facecolor: white
+axes.edgecolor: .15
+axes.linewidth: 1.25
+grid.color: .8
+xtick.major.size: 6
+ytick.major.size: 6
+xtick.minor.size: 3
+ytick.minor.size: 3
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-white.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-white.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..dcbe3acf31dad3f06521e254cd54a74252c77839
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-white.mplstyle
@@ -0,0 +1,30 @@
+# Seaborn common parameters
+# .15 = dark_gray
+# .8 = light_gray
+figure.facecolor: white
+text.color: .15
+axes.labelcolor: .15
+legend.frameon: False
+legend.numpoints: 1
+legend.scatterpoints: 1
+xtick.direction: out
+ytick.direction: out
+xtick.color: .15
+ytick.color: .15
+axes.axisbelow: True
+image.cmap: Greys
+font.family: sans-serif
+font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif
+grid.linestyle: -
+lines.solid_capstyle: round
+
+# Seaborn white parameters
+axes.grid: False
+axes.facecolor: white
+axes.edgecolor: .15
+axes.linewidth: 1.25
+grid.color: .8
+xtick.major.size: 0
+ytick.major.size: 0
+xtick.minor.size: 0
+ytick.minor.size: 0
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-whitegrid.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-whitegrid.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..612e21813e198296fe9ab95dbb73f8509f97e678
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8-whitegrid.mplstyle
@@ -0,0 +1,30 @@
+# Seaborn common parameters
+# .15 = dark_gray
+# .8 = light_gray
+figure.facecolor: white
+text.color: .15
+axes.labelcolor: .15
+legend.frameon: False
+legend.numpoints: 1
+legend.scatterpoints: 1
+xtick.direction: out
+ytick.direction: out
+xtick.color: .15
+ytick.color: .15
+axes.axisbelow: True
+image.cmap: Greys
+font.family: sans-serif
+font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif
+grid.linestyle: -
+lines.solid_capstyle: round
+
+# Seaborn whitegrid parameters
+axes.grid: True
+axes.facecolor: white
+axes.edgecolor: .8
+axes.linewidth: 1
+grid.color: .8
+xtick.major.size: 0
+ytick.major.size: 0
+xtick.minor.size: 0
+ytick.minor.size: 0
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..94b1bc837a4728887cefffc6fdfa622ea4dd786c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/seaborn-v0_8.mplstyle
@@ -0,0 +1,57 @@
+# default seaborn aesthetic
+# darkgrid + deep palette + notebook context
+
+axes.axisbelow: True
+axes.edgecolor: white
+axes.facecolor: EAEAF2
+axes.grid: True
+axes.labelcolor: .15
+axes.labelsize: 11
+axes.linewidth: 0
+axes.prop_cycle: cycler('color', ['4C72B0', '55A868', 'C44E52', '8172B2', 'CCB974', '64B5CD'])
+axes.titlesize: 12
+
+figure.facecolor: white
+figure.figsize: 8.0, 5.5
+
+font.family: sans-serif
+font.sans-serif: Arial, Liberation Sans, DejaVu Sans, Bitstream Vera Sans, sans-serif
+
+grid.color: white
+grid.linestyle: -
+grid.linewidth: 1
+
+image.cmap: Greys
+
+legend.fontsize: 10
+legend.frameon: False
+legend.numpoints: 1
+legend.scatterpoints: 1
+
+lines.linewidth: 1.75
+lines.markeredgewidth: 0
+lines.markersize: 7
+lines.solid_capstyle: round
+
+patch.facecolor: 4C72B0
+patch.linewidth: .3
+
+text.color: .15
+
+xtick.color: .15
+xtick.direction: out
+xtick.labelsize: 10
+xtick.major.pad: 7
+xtick.major.size: 0
+xtick.major.width: 1
+xtick.minor.size: 0
+xtick.minor.width: .5
+
+ytick.color: .15
+ytick.direction: out
+ytick.labelsize: 10
+ytick.major.pad: 7
+ytick.major.size: 0
+ytick.major.width: 1
+ytick.minor.size: 0
+ytick.minor.width: .5
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/tableau-colorblind10.mplstyle b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/tableau-colorblind10.mplstyle
new file mode 100644
index 0000000000000000000000000000000000000000..2d8cb0208d5a2af8915bc605931931605229e263
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/mpl-data/stylelib/tableau-colorblind10.mplstyle
@@ -0,0 +1,3 @@
+# Tableau colorblind 10 palette
+axes.prop_cycle: cycler('color', ['006BA4', 'FF800E', 'ABABAB', '595959', '5F9ED1', 'C85200', '898989', 'A2C8EC', 'FFBC79', 'CFCFCF'])
+patch.facecolor: 006BA4
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/offsetbox.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/offsetbox.py
new file mode 100644
index 0000000000000000000000000000000000000000..e987e969871ad6b3856313094696fb91008e6d39
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/offsetbox.py
@@ -0,0 +1,1613 @@
+r"""
+Container classes for `.Artist`\s.
+
+`OffsetBox`
+ The base of all container artists defined in this module.
+
+`AnchoredOffsetbox`, `AnchoredText`
+ Anchor and align an arbitrary `.Artist` or a text relative to the parent
+ axes or a specific anchor point.
+
+`DrawingArea`
+ A container with fixed width and height. Children have a fixed position
+ inside the container and may be clipped.
+
+`HPacker`, `VPacker`
+ Containers for layouting their children vertically or horizontally.
+
+`PaddedBox`
+ A container to add a padding around an `.Artist`.
+
+`TextArea`
+ Contains a single `.Text` instance.
+"""
+
+import functools
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, _docstring
+import matplotlib.artist as martist
+import matplotlib.path as mpath
+import matplotlib.text as mtext
+import matplotlib.transforms as mtransforms
+from matplotlib.font_manager import FontProperties
+from matplotlib.image import BboxImage
+from matplotlib.patches import (
+ FancyBboxPatch, FancyArrowPatch, bbox_artist as mbbox_artist)
+from matplotlib.transforms import Bbox, BboxBase, TransformedBbox
+
+
+DEBUG = False
+
+
+def _compat_get_offset(meth):
+ """
+ Decorator for the get_offset method of OffsetBox and subclasses, that
+ allows supporting both the new signature (self, bbox, renderer) and the old
+ signature (self, width, height, xdescent, ydescent, renderer).
+ """
+ sigs = [lambda self, width, height, xdescent, ydescent, renderer: locals(),
+ lambda self, bbox, renderer: locals()]
+
+ @functools.wraps(meth)
+ def get_offset(self, *args, **kwargs):
+ params = _api.select_matching_signature(sigs, self, *args, **kwargs)
+ bbox = (params["bbox"] if "bbox" in params else
+ Bbox.from_bounds(-params["xdescent"], -params["ydescent"],
+ params["width"], params["height"]))
+ return meth(params["self"], bbox, params["renderer"])
+ return get_offset
+
+
+# for debugging use
+def _bbox_artist(*args, **kwargs):
+ if DEBUG:
+ mbbox_artist(*args, **kwargs)
+
+
+def _get_packed_offsets(widths, total, sep, mode="fixed"):
+ r"""
+ Pack boxes specified by their *widths*.
+
+ For simplicity of the description, the terminology used here assumes a
+ horizontal layout, but the function works equally for a vertical layout.
+
+ There are three packing *mode*\s:
+
+ - 'fixed': The elements are packed tight to the left with a spacing of
+ *sep* in between. If *total* is *None* the returned total will be the
+ right edge of the last box. A non-*None* total will be passed unchecked
+ to the output. In particular this means that right edge of the last
+ box may be further to the right than the returned total.
+
+ - 'expand': Distribute the boxes with equal spacing so that the left edge
+ of the first box is at 0, and the right edge of the last box is at
+ *total*. The parameter *sep* is ignored in this mode. A total of *None*
+ is accepted and considered equal to 1. The total is returned unchanged
+ (except for the conversion *None* to 1). If the total is smaller than
+ the sum of the widths, the laid out boxes will overlap.
+
+ - 'equal': If *total* is given, the total space is divided in N equal
+ ranges and each box is left-aligned within its subspace.
+ Otherwise (*total* is *None*), *sep* must be provided and each box is
+ left-aligned in its subspace of width ``(max(widths) + sep)``. The
+ total width is then calculated to be ``N * (max(widths) + sep)``.
+
+ Parameters
+ ----------
+ widths : list of float
+ Widths of boxes to be packed.
+ total : float or None
+ Intended total length. *None* if not used.
+ sep : float or None
+ Spacing between boxes.
+ mode : {'fixed', 'expand', 'equal'}
+ The packing mode.
+
+ Returns
+ -------
+ total : float
+ The total width needed to accommodate the laid out boxes.
+ offsets : array of float
+ The left offsets of the boxes.
+ """
+ _api.check_in_list(["fixed", "expand", "equal"], mode=mode)
+
+ if mode == "fixed":
+ offsets_ = np.cumsum([0] + [w + sep for w in widths])
+ offsets = offsets_[:-1]
+ if total is None:
+ total = offsets_[-1] - sep
+ return total, offsets
+
+ elif mode == "expand":
+ # This is a bit of a hack to avoid a TypeError when *total*
+ # is None and used in conjugation with tight layout.
+ if total is None:
+ total = 1
+ if len(widths) > 1:
+ sep = (total - sum(widths)) / (len(widths) - 1)
+ else:
+ sep = 0
+ offsets_ = np.cumsum([0] + [w + sep for w in widths])
+ offsets = offsets_[:-1]
+ return total, offsets
+
+ elif mode == "equal":
+ maxh = max(widths)
+ if total is None:
+ if sep is None:
+ raise ValueError("total and sep cannot both be None when "
+ "using layout mode 'equal'")
+ total = (maxh + sep) * len(widths)
+ else:
+ sep = total / len(widths) - maxh
+ offsets = (maxh + sep) * np.arange(len(widths))
+ return total, offsets
+
+
+def _get_aligned_offsets(yspans, height, align="baseline"):
+ """
+ Align boxes each specified by their ``(y0, y1)`` spans.
+
+ For simplicity of the description, the terminology used here assumes a
+ horizontal layout (i.e., vertical alignment), but the function works
+ equally for a vertical layout.
+
+ Parameters
+ ----------
+ yspans
+ List of (y0, y1) spans of boxes to be aligned.
+ height : float or None
+ Intended total height. If None, the maximum of the heights
+ (``y1 - y0``) in *yspans* is used.
+ align : {'baseline', 'left', 'top', 'right', 'bottom', 'center'}
+ The alignment anchor of the boxes.
+
+ Returns
+ -------
+ (y0, y1)
+ y range spanned by the packing. If a *height* was originally passed
+ in, then for all alignments other than "baseline", a span of ``(0,
+ height)`` is used without checking that it is actually large enough).
+ descent
+ The descent of the packing.
+ offsets
+ The bottom offsets of the boxes.
+ """
+
+ _api.check_in_list(
+ ["baseline", "left", "top", "right", "bottom", "center"], align=align)
+ if height is None:
+ height = max(y1 - y0 for y0, y1 in yspans)
+
+ if align == "baseline":
+ yspan = (min(y0 for y0, y1 in yspans), max(y1 for y0, y1 in yspans))
+ offsets = [0] * len(yspans)
+ elif align in ["left", "bottom"]:
+ yspan = (0, height)
+ offsets = [-y0 for y0, y1 in yspans]
+ elif align in ["right", "top"]:
+ yspan = (0, height)
+ offsets = [height - y1 for y0, y1 in yspans]
+ elif align == "center":
+ yspan = (0, height)
+ offsets = [(height - (y1 - y0)) * .5 - y0 for y0, y1 in yspans]
+
+ return yspan, offsets
+
+
+class OffsetBox(martist.Artist):
+ """
+ The OffsetBox is a simple container artist.
+
+ The child artists are meant to be drawn at a relative position to its
+ parent.
+
+ Being an artist itself, all parameters are passed on to `.Artist`.
+ """
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args)
+ self._internal_update(kwargs)
+ # Clipping has not been implemented in the OffsetBox family, so
+ # disable the clip flag for consistency. It can always be turned back
+ # on to zero effect.
+ self.set_clip_on(False)
+ self._children = []
+ self._offset = (0, 0)
+
+ def set_figure(self, fig):
+ """
+ Set the `.Figure` for the `.OffsetBox` and all its children.
+
+ Parameters
+ ----------
+ fig : `~matplotlib.figure.Figure`
+ """
+ super().set_figure(fig)
+ for c in self.get_children():
+ c.set_figure(fig)
+
+ @martist.Artist.axes.setter
+ def axes(self, ax):
+ # TODO deal with this better
+ martist.Artist.axes.fset(self, ax)
+ for c in self.get_children():
+ if c is not None:
+ c.axes = ax
+
+ def contains(self, mouseevent):
+ """
+ Delegate the mouse event contains-check to the children.
+
+ As a container, the `.OffsetBox` does not respond itself to
+ mouseevents.
+
+ Parameters
+ ----------
+ mouseevent : `~matplotlib.backend_bases.MouseEvent`
+
+ Returns
+ -------
+ contains : bool
+ Whether any values are within the radius.
+ details : dict
+ An artist-specific dictionary of details of the event context,
+ such as which points are contained in the pick radius. See the
+ individual Artist subclasses for details.
+
+ See Also
+ --------
+ .Artist.contains
+ """
+ if self._different_canvas(mouseevent):
+ return False, {}
+ for c in self.get_children():
+ a, b = c.contains(mouseevent)
+ if a:
+ return a, b
+ return False, {}
+
+ def set_offset(self, xy):
+ """
+ Set the offset.
+
+ Parameters
+ ----------
+ xy : (float, float) or callable
+ The (x, y) coordinates of the offset in display units. These can
+ either be given explicitly as a tuple (x, y), or by providing a
+ function that converts the extent into the offset. This function
+ must have the signature::
+
+ def offset(width, height, xdescent, ydescent, renderer) \
+-> (float, float)
+ """
+ self._offset = xy
+ self.stale = True
+
+ @_compat_get_offset
+ def get_offset(self, bbox, renderer):
+ """
+ Return the offset as a tuple (x, y).
+
+ The extent parameters have to be provided to handle the case where the
+ offset is dynamically determined by a callable (see
+ `~.OffsetBox.set_offset`).
+
+ Parameters
+ ----------
+ bbox : `.Bbox`
+ renderer : `.RendererBase` subclass
+ """
+ return (
+ self._offset(bbox.width, bbox.height, -bbox.x0, -bbox.y0, renderer)
+ if callable(self._offset)
+ else self._offset)
+
+ def set_width(self, width):
+ """
+ Set the width of the box.
+
+ Parameters
+ ----------
+ width : float
+ """
+ self.width = width
+ self.stale = True
+
+ def set_height(self, height):
+ """
+ Set the height of the box.
+
+ Parameters
+ ----------
+ height : float
+ """
+ self.height = height
+ self.stale = True
+
+ def get_visible_children(self):
+ r"""Return a list of the visible child `.Artist`\s."""
+ return [c for c in self._children if c.get_visible()]
+
+ def get_children(self):
+ r"""Return a list of the child `.Artist`\s."""
+ return self._children
+
+ def _get_bbox_and_child_offsets(self, renderer):
+ """
+ Return the bbox of the offsetbox and the child offsets.
+
+ The bbox should satisfy ``x0 <= x1 and y0 <= y1``.
+
+ Parameters
+ ----------
+ renderer : `.RendererBase` subclass
+
+ Returns
+ -------
+ bbox
+ list of (xoffset, yoffset) pairs
+ """
+ raise NotImplementedError(
+ "get_bbox_and_offsets must be overridden in derived classes")
+
+ def get_bbox(self, renderer):
+ """Return the bbox of the offsetbox, ignoring parent offsets."""
+ bbox, offsets = self._get_bbox_and_child_offsets(renderer)
+ return bbox
+
+ def get_window_extent(self, renderer=None):
+ # docstring inherited
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ bbox = self.get_bbox(renderer)
+ try: # Some subclasses redefine get_offset to take no args.
+ px, py = self.get_offset(bbox, renderer)
+ except TypeError:
+ px, py = self.get_offset()
+ return bbox.translated(px, py)
+
+ def draw(self, renderer):
+ """
+ Update the location of children if necessary and draw them
+ to the given *renderer*.
+ """
+ bbox, offsets = self._get_bbox_and_child_offsets(renderer)
+ px, py = self.get_offset(bbox, renderer)
+ for c, (ox, oy) in zip(self.get_visible_children(), offsets):
+ c.set_offset((px + ox, py + oy))
+ c.draw(renderer)
+ _bbox_artist(self, renderer, fill=False, props=dict(pad=0.))
+ self.stale = False
+
+
+class PackerBase(OffsetBox):
+ def __init__(self, pad=0., sep=0., width=None, height=None,
+ align="baseline", mode="fixed", children=None):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.0
+ The boundary padding in points.
+
+ sep : float, default: 0.0
+ The spacing between items in points.
+
+ width, height : float, optional
+ Width and height of the container box in pixels, calculated if
+ *None*.
+
+ align : {'top', 'bottom', 'left', 'right', 'center', 'baseline'}, \
+default: 'baseline'
+ Alignment of boxes.
+
+ mode : {'fixed', 'expand', 'equal'}, default: 'fixed'
+ The packing mode.
+
+ - 'fixed' packs the given `.Artist`\\s tight with *sep* spacing.
+ - 'expand' uses the maximal available space to distribute the
+ artists with equal spacing in between.
+ - 'equal': Each artist an equal fraction of the available space
+ and is left-aligned (or top-aligned) therein.
+
+ children : list of `.Artist`
+ The artists to pack.
+
+ Notes
+ -----
+ *pad* and *sep* are in points and will be scaled with the renderer
+ dpi, while *width* and *height* are in pixels.
+ """
+ super().__init__()
+ self.height = height
+ self.width = width
+ self.sep = sep
+ self.pad = pad
+ self.mode = mode
+ self.align = align
+ self._children = children
+
+
+class VPacker(PackerBase):
+ """
+ VPacker packs its children vertically, automatically adjusting their
+ relative positions at draw time.
+
+ .. code-block:: none
+
+ +---------+
+ | Child 1 |
+ | Child 2 |
+ | Child 3 |
+ +---------+
+ """
+
+ def _get_bbox_and_child_offsets(self, renderer):
+ # docstring inherited
+ dpicor = renderer.points_to_pixels(1.)
+ pad = self.pad * dpicor
+ sep = self.sep * dpicor
+
+ if self.width is not None:
+ for c in self.get_visible_children():
+ if isinstance(c, PackerBase) and c.mode == "expand":
+ c.set_width(self.width)
+
+ bboxes = [c.get_bbox(renderer) for c in self.get_visible_children()]
+ (x0, x1), xoffsets = _get_aligned_offsets(
+ [bbox.intervalx for bbox in bboxes], self.width, self.align)
+ height, yoffsets = _get_packed_offsets(
+ [bbox.height for bbox in bboxes], self.height, sep, self.mode)
+
+ yoffsets = height - (yoffsets + [bbox.y1 for bbox in bboxes])
+ ydescent = yoffsets[0]
+ yoffsets = yoffsets - ydescent
+
+ return (
+ Bbox.from_bounds(x0, -ydescent, x1 - x0, height).padded(pad),
+ [*zip(xoffsets, yoffsets)])
+
+
+class HPacker(PackerBase):
+ """
+ HPacker packs its children horizontally, automatically adjusting their
+ relative positions at draw time.
+
+ .. code-block:: none
+
+ +-------------------------------+
+ | Child 1 Child 2 Child 3 |
+ +-------------------------------+
+ """
+
+ def _get_bbox_and_child_offsets(self, renderer):
+ # docstring inherited
+ dpicor = renderer.points_to_pixels(1.)
+ pad = self.pad * dpicor
+ sep = self.sep * dpicor
+
+ bboxes = [c.get_bbox(renderer) for c in self.get_visible_children()]
+ if not bboxes:
+ return Bbox.from_bounds(0, 0, 0, 0).padded(pad), []
+
+ (y0, y1), yoffsets = _get_aligned_offsets(
+ [bbox.intervaly for bbox in bboxes], self.height, self.align)
+ width, xoffsets = _get_packed_offsets(
+ [bbox.width for bbox in bboxes], self.width, sep, self.mode)
+
+ x0 = bboxes[0].x0
+ xoffsets -= ([bbox.x0 for bbox in bboxes] - x0)
+
+ return (Bbox.from_bounds(x0, y0, width, y1 - y0).padded(pad),
+ [*zip(xoffsets, yoffsets)])
+
+
+class PaddedBox(OffsetBox):
+ """
+ A container to add a padding around an `.Artist`.
+
+ The `.PaddedBox` contains a `.FancyBboxPatch` that is used to visualize
+ it when rendering.
+
+ .. code-block:: none
+
+ +----------------------------+
+ | |
+ | |
+ | |
+ | <--pad--> Artist |
+ | ^ |
+ | pad |
+ | v |
+ +----------------------------+
+
+ Attributes
+ ----------
+ pad : float
+ The padding in points.
+ patch : `.FancyBboxPatch`
+ When *draw_frame* is True, this `.FancyBboxPatch` is made visible and
+ creates a border around the box.
+ """
+
+ def __init__(self, child, pad=0., *, draw_frame=False, patch_attrs=None):
+ """
+ Parameters
+ ----------
+ child : `~matplotlib.artist.Artist`
+ The contained `.Artist`.
+ pad : float, default: 0.0
+ The padding in points. This will be scaled with the renderer dpi.
+ In contrast, *width* and *height* are in *pixels* and thus not
+ scaled.
+ draw_frame : bool
+ Whether to draw the contained `.FancyBboxPatch`.
+ patch_attrs : dict or None
+ Additional parameters passed to the contained `.FancyBboxPatch`.
+ """
+ super().__init__()
+ self.pad = pad
+ self._children = [child]
+ self.patch = FancyBboxPatch(
+ xy=(0.0, 0.0), width=1., height=1.,
+ facecolor='w', edgecolor='k',
+ mutation_scale=1, # self.prop.get_size_in_points(),
+ snap=True,
+ visible=draw_frame,
+ boxstyle="square,pad=0",
+ )
+ if patch_attrs is not None:
+ self.patch.update(patch_attrs)
+
+ def _get_bbox_and_child_offsets(self, renderer):
+ # docstring inherited.
+ pad = self.pad * renderer.points_to_pixels(1.)
+ return (self._children[0].get_bbox(renderer).padded(pad), [(0, 0)])
+
+ def draw(self, renderer):
+ # docstring inherited
+ bbox, offsets = self._get_bbox_and_child_offsets(renderer)
+ px, py = self.get_offset(bbox, renderer)
+ for c, (ox, oy) in zip(self.get_visible_children(), offsets):
+ c.set_offset((px + ox, py + oy))
+
+ self.draw_frame(renderer)
+
+ for c in self.get_visible_children():
+ c.draw(renderer)
+
+ self.stale = False
+
+ def update_frame(self, bbox, fontsize=None):
+ self.patch.set_bounds(bbox.bounds)
+ if fontsize:
+ self.patch.set_mutation_scale(fontsize)
+ self.stale = True
+
+ def draw_frame(self, renderer):
+ # update the location and size of the legend
+ self.update_frame(self.get_window_extent(renderer))
+ self.patch.draw(renderer)
+
+
+class DrawingArea(OffsetBox):
+ """
+ The DrawingArea can contain any Artist as a child. The DrawingArea
+ has a fixed width and height. The position of children relative to
+ the parent is fixed. The children can be clipped at the
+ boundaries of the parent.
+ """
+
+ def __init__(self, width, height, xdescent=0., ydescent=0., clip=False):
+ """
+ Parameters
+ ----------
+ width, height : float
+ Width and height of the container box.
+ xdescent, ydescent : float
+ Descent of the box in x- and y-direction.
+ clip : bool
+ Whether to clip the children to the box.
+ """
+ super().__init__()
+ self.width = width
+ self.height = height
+ self.xdescent = xdescent
+ self.ydescent = ydescent
+ self._clip_children = clip
+ self.offset_transform = mtransforms.Affine2D()
+ self.dpi_transform = mtransforms.Affine2D()
+
+ @property
+ def clip_children(self):
+ """
+ If the children of this DrawingArea should be clipped
+ by DrawingArea bounding box.
+ """
+ return self._clip_children
+
+ @clip_children.setter
+ def clip_children(self, val):
+ self._clip_children = bool(val)
+ self.stale = True
+
+ def get_transform(self):
+ """
+ Return the `~matplotlib.transforms.Transform` applied to the children.
+ """
+ return self.dpi_transform + self.offset_transform
+
+ def set_transform(self, t):
+ """
+ set_transform is ignored.
+ """
+
+ def set_offset(self, xy):
+ """
+ Set the offset of the container.
+
+ Parameters
+ ----------
+ xy : (float, float)
+ The (x, y) coordinates of the offset in display units.
+ """
+ self._offset = xy
+ self.offset_transform.clear()
+ self.offset_transform.translate(xy[0], xy[1])
+ self.stale = True
+
+ def get_offset(self):
+ """Return offset of the container."""
+ return self._offset
+
+ def get_bbox(self, renderer):
+ # docstring inherited
+ dpi_cor = renderer.points_to_pixels(1.)
+ return Bbox.from_bounds(
+ -self.xdescent * dpi_cor, -self.ydescent * dpi_cor,
+ self.width * dpi_cor, self.height * dpi_cor)
+
+ def add_artist(self, a):
+ """Add an `.Artist` to the container box."""
+ self._children.append(a)
+ if not a.is_transform_set():
+ a.set_transform(self.get_transform())
+ if self.axes is not None:
+ a.axes = self.axes
+ fig = self.get_figure(root=False)
+ if fig is not None:
+ a.set_figure(fig)
+
+ def draw(self, renderer):
+ # docstring inherited
+
+ dpi_cor = renderer.points_to_pixels(1.)
+ self.dpi_transform.clear()
+ self.dpi_transform.scale(dpi_cor)
+
+ # At this point the DrawingArea has a transform
+ # to the display space so the path created is
+ # good for clipping children
+ tpath = mtransforms.TransformedPath(
+ mpath.Path([[0, 0], [0, self.height],
+ [self.width, self.height],
+ [self.width, 0]]),
+ self.get_transform())
+ for c in self._children:
+ if self._clip_children and not (c.clipbox or c._clippath):
+ c.set_clip_path(tpath)
+ c.draw(renderer)
+
+ _bbox_artist(self, renderer, fill=False, props=dict(pad=0.))
+ self.stale = False
+
+
+class TextArea(OffsetBox):
+ """
+ The TextArea is a container artist for a single Text instance.
+
+ The text is placed at (0, 0) with baseline+left alignment, by default. The
+ width and height of the TextArea instance is the width and height of its
+ child text.
+ """
+
+ def __init__(self, s,
+ *,
+ textprops=None,
+ multilinebaseline=False,
+ ):
+ """
+ Parameters
+ ----------
+ s : str
+ The text to be displayed.
+ textprops : dict, default: {}
+ Dictionary of keyword parameters to be passed to the `.Text`
+ instance in the TextArea.
+ multilinebaseline : bool, default: False
+ Whether the baseline for multiline text is adjusted so that it
+ is (approximately) center-aligned with single-line text.
+ """
+ if textprops is None:
+ textprops = {}
+ self._text = mtext.Text(0, 0, s, **textprops)
+ super().__init__()
+ self._children = [self._text]
+ self.offset_transform = mtransforms.Affine2D()
+ self._baseline_transform = mtransforms.Affine2D()
+ self._text.set_transform(self.offset_transform +
+ self._baseline_transform)
+ self._multilinebaseline = multilinebaseline
+
+ def set_text(self, s):
+ """Set the text of this area as a string."""
+ self._text.set_text(s)
+ self.stale = True
+
+ def get_text(self):
+ """Return the string representation of this area's text."""
+ return self._text.get_text()
+
+ def set_multilinebaseline(self, t):
+ """
+ Set multilinebaseline.
+
+ If True, the baseline for multiline text is adjusted so that it is
+ (approximately) center-aligned with single-line text. This is used
+ e.g. by the legend implementation so that single-line labels are
+ baseline-aligned, but multiline labels are "center"-aligned with them.
+ """
+ self._multilinebaseline = t
+ self.stale = True
+
+ def get_multilinebaseline(self):
+ """
+ Get multilinebaseline.
+ """
+ return self._multilinebaseline
+
+ def set_transform(self, t):
+ """
+ set_transform is ignored.
+ """
+
+ def set_offset(self, xy):
+ """
+ Set the offset of the container.
+
+ Parameters
+ ----------
+ xy : (float, float)
+ The (x, y) coordinates of the offset in display units.
+ """
+ self._offset = xy
+ self.offset_transform.clear()
+ self.offset_transform.translate(xy[0], xy[1])
+ self.stale = True
+
+ def get_offset(self):
+ """Return offset of the container."""
+ return self._offset
+
+ def get_bbox(self, renderer):
+ _, h_, d_ = mtext._get_text_metrics_with_cache(
+ renderer, "lp", self._text._fontproperties,
+ ismath="TeX" if self._text.get_usetex() else False,
+ dpi=self.get_figure(root=True).dpi)
+
+ bbox, info, yd = self._text._get_layout(renderer)
+ w, h = bbox.size
+
+ self._baseline_transform.clear()
+
+ if len(info) > 1 and self._multilinebaseline:
+ yd_new = 0.5 * h - 0.5 * (h_ - d_)
+ self._baseline_transform.translate(0, yd - yd_new)
+ yd = yd_new
+ else: # single line
+ h_d = max(h_ - d_, h - yd)
+ h = h_d + yd
+
+ ha = self._text.get_horizontalalignment()
+ x0 = {"left": 0, "center": -w / 2, "right": -w}[ha]
+
+ return Bbox.from_bounds(x0, -yd, w, h)
+
+ def draw(self, renderer):
+ # docstring inherited
+ self._text.draw(renderer)
+ _bbox_artist(self, renderer, fill=False, props=dict(pad=0.))
+ self.stale = False
+
+
+class AuxTransformBox(OffsetBox):
+ """
+ Offset Box with the aux_transform. Its children will be
+ transformed with the aux_transform first then will be
+ offsetted. The absolute coordinate of the aux_transform is meaning
+ as it will be automatically adjust so that the left-lower corner
+ of the bounding box of children will be set to (0, 0) before the
+ offset transform.
+
+ It is similar to drawing area, except that the extent of the box
+ is not predetermined but calculated from the window extent of its
+ children. Furthermore, the extent of the children will be
+ calculated in the transformed coordinate.
+ """
+ def __init__(self, aux_transform):
+ self.aux_transform = aux_transform
+ super().__init__()
+ self.offset_transform = mtransforms.Affine2D()
+ # ref_offset_transform makes offset_transform always relative to the
+ # lower-left corner of the bbox of its children.
+ self.ref_offset_transform = mtransforms.Affine2D()
+
+ def add_artist(self, a):
+ """Add an `.Artist` to the container box."""
+ self._children.append(a)
+ a.set_transform(self.get_transform())
+ self.stale = True
+
+ def get_transform(self):
+ """
+ Return the :class:`~matplotlib.transforms.Transform` applied
+ to the children
+ """
+ return (self.aux_transform
+ + self.ref_offset_transform
+ + self.offset_transform)
+
+ def set_transform(self, t):
+ """
+ set_transform is ignored.
+ """
+
+ def set_offset(self, xy):
+ """
+ Set the offset of the container.
+
+ Parameters
+ ----------
+ xy : (float, float)
+ The (x, y) coordinates of the offset in display units.
+ """
+ self._offset = xy
+ self.offset_transform.clear()
+ self.offset_transform.translate(xy[0], xy[1])
+ self.stale = True
+
+ def get_offset(self):
+ """Return offset of the container."""
+ return self._offset
+
+ def get_bbox(self, renderer):
+ # clear the offset transforms
+ _off = self.offset_transform.get_matrix() # to be restored later
+ self.ref_offset_transform.clear()
+ self.offset_transform.clear()
+ # calculate the extent
+ bboxes = [c.get_window_extent(renderer) for c in self._children]
+ ub = Bbox.union(bboxes)
+ # adjust ref_offset_transform
+ self.ref_offset_transform.translate(-ub.x0, -ub.y0)
+ # restore offset transform
+ self.offset_transform.set_matrix(_off)
+ return Bbox.from_bounds(0, 0, ub.width, ub.height)
+
+ def draw(self, renderer):
+ # docstring inherited
+ for c in self._children:
+ c.draw(renderer)
+ _bbox_artist(self, renderer, fill=False, props=dict(pad=0.))
+ self.stale = False
+
+
+class AnchoredOffsetbox(OffsetBox):
+ """
+ An offset box placed according to location *loc*.
+
+ AnchoredOffsetbox has a single child. When multiple children are needed,
+ use an extra OffsetBox to enclose them. By default, the offset box is
+ anchored against its parent Axes. You may explicitly specify the
+ *bbox_to_anchor*.
+ """
+ zorder = 5 # zorder of the legend
+
+ # Location codes
+ codes = {'upper right': 1,
+ 'upper left': 2,
+ 'lower left': 3,
+ 'lower right': 4,
+ 'right': 5,
+ 'center left': 6,
+ 'center right': 7,
+ 'lower center': 8,
+ 'upper center': 9,
+ 'center': 10,
+ }
+
+ def __init__(self, loc, *,
+ pad=0.4, borderpad=0.5,
+ child=None, prop=None, frameon=True,
+ bbox_to_anchor=None,
+ bbox_transform=None,
+ **kwargs):
+ """
+ Parameters
+ ----------
+ loc : str
+ The box location. Valid locations are
+ 'upper left', 'upper center', 'upper right',
+ 'center left', 'center', 'center right',
+ 'lower left', 'lower center', 'lower right'.
+ For backward compatibility, numeric values are accepted as well.
+ See the parameter *loc* of `.Legend` for details.
+ pad : float, default: 0.4
+ Padding around the child as fraction of the fontsize.
+ borderpad : float, default: 0.5
+ Padding between the offsetbox frame and the *bbox_to_anchor*.
+ child : `.OffsetBox`
+ The box that will be anchored.
+ prop : `.FontProperties`
+ This is only used as a reference for paddings. If not given,
+ :rc:`legend.fontsize` is used.
+ frameon : bool
+ Whether to draw a frame around the box.
+ bbox_to_anchor : `.BboxBase`, 2-tuple, or 4-tuple of floats
+ Box that is used to position the legend in conjunction with *loc*.
+ bbox_transform : None or :class:`matplotlib.transforms.Transform`
+ The transform for the bounding box (*bbox_to_anchor*).
+ **kwargs
+ All other parameters are passed on to `.OffsetBox`.
+
+ Notes
+ -----
+ See `.Legend` for a detailed description of the anchoring mechanism.
+ """
+ super().__init__(**kwargs)
+
+ self.set_bbox_to_anchor(bbox_to_anchor, bbox_transform)
+ self.set_child(child)
+
+ if isinstance(loc, str):
+ loc = _api.check_getitem(self.codes, loc=loc)
+
+ self.loc = loc
+ self.borderpad = borderpad
+ self.pad = pad
+
+ if prop is None:
+ self.prop = FontProperties(size=mpl.rcParams["legend.fontsize"])
+ else:
+ self.prop = FontProperties._from_any(prop)
+ if isinstance(prop, dict) and "size" not in prop:
+ self.prop.set_size(mpl.rcParams["legend.fontsize"])
+
+ self.patch = FancyBboxPatch(
+ xy=(0.0, 0.0), width=1., height=1.,
+ facecolor='w', edgecolor='k',
+ mutation_scale=self.prop.get_size_in_points(),
+ snap=True,
+ visible=frameon,
+ boxstyle="square,pad=0",
+ )
+
+ def set_child(self, child):
+ """Set the child to be anchored."""
+ self._child = child
+ if child is not None:
+ child.axes = self.axes
+ self.stale = True
+
+ def get_child(self):
+ """Return the child."""
+ return self._child
+
+ def get_children(self):
+ """Return the list of children."""
+ return [self._child]
+
+ def get_bbox(self, renderer):
+ # docstring inherited
+ fontsize = renderer.points_to_pixels(self.prop.get_size_in_points())
+ pad = self.pad * fontsize
+ return self.get_child().get_bbox(renderer).padded(pad)
+
+ def get_bbox_to_anchor(self):
+ """Return the bbox that the box is anchored to."""
+ if self._bbox_to_anchor is None:
+ return self.axes.bbox
+ else:
+ transform = self._bbox_to_anchor_transform
+ if transform is None:
+ return self._bbox_to_anchor
+ else:
+ return TransformedBbox(self._bbox_to_anchor, transform)
+
+ def set_bbox_to_anchor(self, bbox, transform=None):
+ """
+ Set the bbox that the box is anchored to.
+
+ *bbox* can be a Bbox instance, a list of [left, bottom, width,
+ height], or a list of [left, bottom] where the width and
+ height will be assumed to be zero. The bbox will be
+ transformed to display coordinate by the given transform.
+ """
+ if bbox is None or isinstance(bbox, BboxBase):
+ self._bbox_to_anchor = bbox
+ else:
+ try:
+ l = len(bbox)
+ except TypeError as err:
+ raise ValueError(f"Invalid bbox: {bbox}") from err
+
+ if l == 2:
+ bbox = [bbox[0], bbox[1], 0, 0]
+
+ self._bbox_to_anchor = Bbox.from_bounds(*bbox)
+
+ self._bbox_to_anchor_transform = transform
+ self.stale = True
+
+ @_compat_get_offset
+ def get_offset(self, bbox, renderer):
+ # docstring inherited
+ pad = (self.borderpad
+ * renderer.points_to_pixels(self.prop.get_size_in_points()))
+ bbox_to_anchor = self.get_bbox_to_anchor()
+ x0, y0 = _get_anchored_bbox(
+ self.loc, Bbox.from_bounds(0, 0, bbox.width, bbox.height),
+ bbox_to_anchor, pad)
+ return x0 - bbox.x0, y0 - bbox.y0
+
+ def update_frame(self, bbox, fontsize=None):
+ self.patch.set_bounds(bbox.bounds)
+ if fontsize:
+ self.patch.set_mutation_scale(fontsize)
+
+ def draw(self, renderer):
+ # docstring inherited
+ if not self.get_visible():
+ return
+
+ # update the location and size of the legend
+ bbox = self.get_window_extent(renderer)
+ fontsize = renderer.points_to_pixels(self.prop.get_size_in_points())
+ self.update_frame(bbox, fontsize)
+ self.patch.draw(renderer)
+
+ px, py = self.get_offset(self.get_bbox(renderer), renderer)
+ self.get_child().set_offset((px, py))
+ self.get_child().draw(renderer)
+ self.stale = False
+
+
+def _get_anchored_bbox(loc, bbox, parentbbox, borderpad):
+ """
+ Return the (x, y) position of the *bbox* anchored at the *parentbbox* with
+ the *loc* code with the *borderpad*.
+ """
+ # This is only called internally and *loc* should already have been
+ # validated. If 0 (None), we just let ``bbox.anchored`` raise.
+ c = [None, "NE", "NW", "SW", "SE", "E", "W", "E", "S", "N", "C"][loc]
+ container = parentbbox.padded(-borderpad)
+ return bbox.anchored(c, container=container).p0
+
+
+class AnchoredText(AnchoredOffsetbox):
+ """
+ AnchoredOffsetbox with Text.
+ """
+
+ def __init__(self, s, loc, *, pad=0.4, borderpad=0.5, prop=None, **kwargs):
+ """
+ Parameters
+ ----------
+ s : str
+ Text.
+
+ loc : str
+ Location code. See `AnchoredOffsetbox`.
+
+ pad : float, default: 0.4
+ Padding around the text as fraction of the fontsize.
+
+ borderpad : float, default: 0.5
+ Spacing between the offsetbox frame and the *bbox_to_anchor*.
+
+ prop : dict, optional
+ Dictionary of keyword parameters to be passed to the
+ `~matplotlib.text.Text` instance contained inside AnchoredText.
+
+ **kwargs
+ All other parameters are passed to `AnchoredOffsetbox`.
+ """
+
+ if prop is None:
+ prop = {}
+ badkwargs = {'va', 'verticalalignment'}
+ if badkwargs & set(prop):
+ raise ValueError(
+ 'Mixing verticalalignment with AnchoredText is not supported.')
+
+ self.txt = TextArea(s, textprops=prop)
+ fp = self.txt._text.get_fontproperties()
+ super().__init__(
+ loc, pad=pad, borderpad=borderpad, child=self.txt, prop=fp,
+ **kwargs)
+
+
+class OffsetImage(OffsetBox):
+
+ def __init__(self, arr, *,
+ zoom=1,
+ cmap=None,
+ norm=None,
+ interpolation=None,
+ origin=None,
+ filternorm=True,
+ filterrad=4.0,
+ resample=False,
+ dpi_cor=True,
+ **kwargs
+ ):
+
+ super().__init__()
+ self._dpi_cor = dpi_cor
+
+ self.image = BboxImage(bbox=self.get_window_extent,
+ cmap=cmap,
+ norm=norm,
+ interpolation=interpolation,
+ origin=origin,
+ filternorm=filternorm,
+ filterrad=filterrad,
+ resample=resample,
+ **kwargs
+ )
+
+ self._children = [self.image]
+
+ self.set_zoom(zoom)
+ self.set_data(arr)
+
+ def set_data(self, arr):
+ self._data = np.asarray(arr)
+ self.image.set_data(self._data)
+ self.stale = True
+
+ def get_data(self):
+ return self._data
+
+ def set_zoom(self, zoom):
+ self._zoom = zoom
+ self.stale = True
+
+ def get_zoom(self):
+ return self._zoom
+
+ def get_offset(self):
+ """Return offset of the container."""
+ return self._offset
+
+ def get_children(self):
+ return [self.image]
+
+ def get_bbox(self, renderer):
+ dpi_cor = renderer.points_to_pixels(1.) if self._dpi_cor else 1.
+ zoom = self.get_zoom()
+ data = self.get_data()
+ ny, nx = data.shape[:2]
+ w, h = dpi_cor * nx * zoom, dpi_cor * ny * zoom
+ return Bbox.from_bounds(0, 0, w, h)
+
+ def draw(self, renderer):
+ # docstring inherited
+ self.image.draw(renderer)
+ # bbox_artist(self, renderer, fill=False, props=dict(pad=0.))
+ self.stale = False
+
+
+class AnnotationBbox(martist.Artist, mtext._AnnotationBase):
+ """
+ Container for an `OffsetBox` referring to a specific position *xy*.
+
+ Optionally an arrow pointing from the offsetbox to *xy* can be drawn.
+
+ This is like `.Annotation`, but with `OffsetBox` instead of `.Text`.
+ """
+
+ zorder = 3
+
+ def __str__(self):
+ return f"AnnotationBbox({self.xy[0]:g},{self.xy[1]:g})"
+
+ @_docstring.interpd
+ def __init__(self, offsetbox, xy, xybox=None, xycoords='data', boxcoords=None, *,
+ frameon=True, pad=0.4, # FancyBboxPatch boxstyle.
+ annotation_clip=None,
+ box_alignment=(0.5, 0.5),
+ bboxprops=None,
+ arrowprops=None,
+ fontsize=None,
+ **kwargs):
+ """
+ Parameters
+ ----------
+ offsetbox : `OffsetBox`
+
+ xy : (float, float)
+ The point *(x, y)* to annotate. The coordinate system is determined
+ by *xycoords*.
+
+ xybox : (float, float), default: *xy*
+ The position *(x, y)* to place the text at. The coordinate system
+ is determined by *boxcoords*.
+
+ xycoords : single or two-tuple of str or `.Artist` or `.Transform` or \
+callable, default: 'data'
+ The coordinate system that *xy* is given in. See the parameter
+ *xycoords* in `.Annotation` for a detailed description.
+
+ boxcoords : single or two-tuple of str or `.Artist` or `.Transform` \
+or callable, default: value of *xycoords*
+ The coordinate system that *xybox* is given in. See the parameter
+ *textcoords* in `.Annotation` for a detailed description.
+
+ frameon : bool, default: True
+ By default, the text is surrounded by a white `.FancyBboxPatch`
+ (accessible as the ``patch`` attribute of the `.AnnotationBbox`).
+ If *frameon* is set to False, this patch is made invisible.
+
+ annotation_clip: bool or None, default: None
+ Whether to clip (i.e. not draw) the annotation when the annotation
+ point *xy* is outside the Axes area.
+
+ - If *True*, the annotation will be clipped when *xy* is outside
+ the Axes.
+ - If *False*, the annotation will always be drawn.
+ - If *None*, the annotation will be clipped when *xy* is outside
+ the Axes and *xycoords* is 'data'.
+
+ pad : float, default: 0.4
+ Padding around the offsetbox.
+
+ box_alignment : (float, float)
+ A tuple of two floats for a vertical and horizontal alignment of
+ the offset box w.r.t. the *boxcoords*.
+ The lower-left corner is (0, 0) and upper-right corner is (1, 1).
+
+ bboxprops : dict, optional
+ A dictionary of properties to set for the annotation bounding box,
+ for example *boxstyle* and *alpha*. See `.FancyBboxPatch` for
+ details.
+
+ arrowprops: dict, optional
+ Arrow properties, see `.Annotation` for description.
+
+ fontsize: float or str, optional
+ Translated to points and passed as *mutation_scale* into
+ `.FancyBboxPatch` to scale attributes of the box style (e.g. pad
+ or rounding_size). The name is chosen in analogy to `.Text` where
+ *fontsize* defines the mutation scale as well. If not given,
+ :rc:`legend.fontsize` is used. See `.Text.set_fontsize` for valid
+ values.
+
+ **kwargs
+ Other `AnnotationBbox` properties. See `.AnnotationBbox.set` for
+ a list.
+ """
+
+ martist.Artist.__init__(self)
+ mtext._AnnotationBase.__init__(
+ self, xy, xycoords=xycoords, annotation_clip=annotation_clip)
+
+ self.offsetbox = offsetbox
+ self.arrowprops = arrowprops.copy() if arrowprops is not None else None
+ self.set_fontsize(fontsize)
+ self.xybox = xybox if xybox is not None else xy
+ self.boxcoords = boxcoords if boxcoords is not None else xycoords
+ self._box_alignment = box_alignment
+
+ if arrowprops is not None:
+ self._arrow_relpos = self.arrowprops.pop("relpos", (0.5, 0.5))
+ self.arrow_patch = FancyArrowPatch((0, 0), (1, 1),
+ **self.arrowprops)
+ else:
+ self._arrow_relpos = None
+ self.arrow_patch = None
+
+ self.patch = FancyBboxPatch( # frame
+ xy=(0.0, 0.0), width=1., height=1.,
+ facecolor='w', edgecolor='k',
+ mutation_scale=self.prop.get_size_in_points(),
+ snap=True,
+ visible=frameon,
+ )
+ self.patch.set_boxstyle("square", pad=pad)
+ if bboxprops:
+ self.patch.set(**bboxprops)
+
+ self._internal_update(kwargs)
+
+ @property
+ def xyann(self):
+ return self.xybox
+
+ @xyann.setter
+ def xyann(self, xyann):
+ self.xybox = xyann
+ self.stale = True
+
+ @property
+ def anncoords(self):
+ return self.boxcoords
+
+ @anncoords.setter
+ def anncoords(self, coords):
+ self.boxcoords = coords
+ self.stale = True
+
+ def contains(self, mouseevent):
+ if self._different_canvas(mouseevent):
+ return False, {}
+ if not self._check_xy(None):
+ return False, {}
+ return self.offsetbox.contains(mouseevent)
+ # self.arrow_patch is currently not checked as this can be a line - JJ
+
+ def get_children(self):
+ children = [self.offsetbox, self.patch]
+ if self.arrow_patch:
+ children.append(self.arrow_patch)
+ return children
+
+ def set_figure(self, fig):
+ if self.arrow_patch is not None:
+ self.arrow_patch.set_figure(fig)
+ self.offsetbox.set_figure(fig)
+ martist.Artist.set_figure(self, fig)
+
+ def set_fontsize(self, s=None):
+ """
+ Set the fontsize in points.
+
+ If *s* is not given, reset to :rc:`legend.fontsize`.
+ """
+ if s is None:
+ s = mpl.rcParams["legend.fontsize"]
+
+ self.prop = FontProperties(size=s)
+ self.stale = True
+
+ def get_fontsize(self):
+ """Return the fontsize in points."""
+ return self.prop.get_size_in_points()
+
+ def get_window_extent(self, renderer=None):
+ # docstring inherited
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ self.update_positions(renderer)
+ return Bbox.union([child.get_window_extent(renderer)
+ for child in self.get_children()])
+
+ def get_tightbbox(self, renderer=None):
+ # docstring inherited
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ self.update_positions(renderer)
+ return Bbox.union([child.get_tightbbox(renderer)
+ for child in self.get_children()])
+
+ def update_positions(self, renderer):
+ """Update pixel positions for the annotated point, the text, and the arrow."""
+
+ ox0, oy0 = self._get_xy(renderer, self.xybox, self.boxcoords)
+ bbox = self.offsetbox.get_bbox(renderer)
+ fw, fh = self._box_alignment
+ self.offsetbox.set_offset(
+ (ox0 - fw*bbox.width - bbox.x0, oy0 - fh*bbox.height - bbox.y0))
+
+ bbox = self.offsetbox.get_window_extent(renderer)
+ self.patch.set_bounds(bbox.bounds)
+
+ mutation_scale = renderer.points_to_pixels(self.get_fontsize())
+ self.patch.set_mutation_scale(mutation_scale)
+
+ if self.arrowprops:
+ # Use FancyArrowPatch if self.arrowprops has "arrowstyle" key.
+
+ # Adjust the starting point of the arrow relative to the textbox.
+ # TODO: Rotation needs to be accounted.
+ arrow_begin = bbox.p0 + bbox.size * self._arrow_relpos
+ arrow_end = self._get_position_xy(renderer)
+ # The arrow (from arrow_begin to arrow_end) will be first clipped
+ # by patchA and patchB, then shrunk by shrinkA and shrinkB (in
+ # points). If patch A is not set, self.bbox_patch is used.
+ self.arrow_patch.set_positions(arrow_begin, arrow_end)
+
+ if "mutation_scale" in self.arrowprops:
+ mutation_scale = renderer.points_to_pixels(
+ self.arrowprops["mutation_scale"])
+ # Else, use fontsize-based mutation_scale defined above.
+ self.arrow_patch.set_mutation_scale(mutation_scale)
+
+ patchA = self.arrowprops.get("patchA", self.patch)
+ self.arrow_patch.set_patchA(patchA)
+
+ def draw(self, renderer):
+ # docstring inherited
+ if not self.get_visible() or not self._check_xy(renderer):
+ return
+ renderer.open_group(self.__class__.__name__, gid=self.get_gid())
+ self.update_positions(renderer)
+ if self.arrow_patch is not None:
+ if (self.arrow_patch.get_figure(root=False) is None and
+ (fig := self.get_figure(root=False)) is not None):
+ self.arrow_patch.set_figure(fig)
+ self.arrow_patch.draw(renderer)
+ self.patch.draw(renderer)
+ self.offsetbox.draw(renderer)
+ renderer.close_group(self.__class__.__name__)
+ self.stale = False
+
+
+class DraggableBase:
+ """
+ Helper base class for a draggable artist (legend, offsetbox).
+
+ Derived classes must override the following methods::
+
+ def save_offset(self):
+ '''
+ Called when the object is picked for dragging; should save the
+ reference position of the artist.
+ '''
+
+ def update_offset(self, dx, dy):
+ '''
+ Called during the dragging; (*dx*, *dy*) is the pixel offset from
+ the point where the mouse drag started.
+ '''
+
+ Optionally, you may override the following method::
+
+ def finalize_offset(self):
+ '''Called when the mouse is released.'''
+
+ In the current implementation of `.DraggableLegend` and
+ `DraggableAnnotation`, `update_offset` places the artists in display
+ coordinates, and `finalize_offset` recalculates their position in axes
+ coordinate and set a relevant attribute.
+ """
+
+ def __init__(self, ref_artist, use_blit=False):
+ self.ref_artist = ref_artist
+ if not ref_artist.pickable():
+ ref_artist.set_picker(self._picker)
+ self.got_artist = False
+ self._use_blit = use_blit and self.canvas.supports_blit
+ callbacks = self.canvas.callbacks
+ self._disconnectors = [
+ functools.partial(
+ callbacks.disconnect, callbacks._connect_picklable(name, func))
+ for name, func in [
+ ("pick_event", self.on_pick),
+ ("button_release_event", self.on_release),
+ ("motion_notify_event", self.on_motion),
+ ]
+ ]
+
+ @staticmethod
+ def _picker(artist, mouseevent):
+ # A custom picker to prevent dragging on mouse scroll events
+ return (artist.contains(mouseevent) and mouseevent.name != "scroll_event"), {}
+
+ # A property, not an attribute, to maintain picklability.
+ canvas = property(lambda self: self.ref_artist.get_figure(root=True).canvas)
+ cids = property(lambda self: [
+ disconnect.args[0] for disconnect in self._disconnectors[:2]])
+
+ def on_motion(self, evt):
+ if self._check_still_parented() and self.got_artist:
+ dx = evt.x - self.mouse_x
+ dy = evt.y - self.mouse_y
+ self.update_offset(dx, dy)
+ if self._use_blit:
+ self.canvas.restore_region(self.background)
+ self.ref_artist.draw(
+ self.ref_artist.get_figure(root=True)._get_renderer())
+ self.canvas.blit()
+ else:
+ self.canvas.draw()
+
+ def on_pick(self, evt):
+ if self._check_still_parented():
+ if evt.artist == self.ref_artist:
+ self.mouse_x = evt.mouseevent.x
+ self.mouse_y = evt.mouseevent.y
+ self.save_offset()
+ self.got_artist = True
+ if self.got_artist and self._use_blit:
+ self.ref_artist.set_animated(True)
+ self.canvas.draw()
+ fig = self.ref_artist.get_figure(root=False)
+ self.background = self.canvas.copy_from_bbox(fig.bbox)
+ self.ref_artist.draw(fig._get_renderer())
+ self.canvas.blit()
+
+ def on_release(self, event):
+ if self._check_still_parented() and self.got_artist:
+ self.finalize_offset()
+ self.got_artist = False
+ if self._use_blit:
+ self.canvas.restore_region(self.background)
+ self.ref_artist.draw(self.ref_artist.figure._get_renderer())
+ self.canvas.blit()
+ self.ref_artist.set_animated(False)
+
+ def _check_still_parented(self):
+ if self.ref_artist.get_figure(root=False) is None:
+ self.disconnect()
+ return False
+ else:
+ return True
+
+ def disconnect(self):
+ """Disconnect the callbacks."""
+ for disconnector in self._disconnectors:
+ disconnector()
+
+ def save_offset(self):
+ pass
+
+ def update_offset(self, dx, dy):
+ pass
+
+ def finalize_offset(self):
+ pass
+
+
+class DraggableOffsetBox(DraggableBase):
+ def __init__(self, ref_artist, offsetbox, use_blit=False):
+ super().__init__(ref_artist, use_blit=use_blit)
+ self.offsetbox = offsetbox
+
+ def save_offset(self):
+ offsetbox = self.offsetbox
+ renderer = offsetbox.get_figure(root=True)._get_renderer()
+ offset = offsetbox.get_offset(offsetbox.get_bbox(renderer), renderer)
+ self.offsetbox_x, self.offsetbox_y = offset
+ self.offsetbox.set_offset(offset)
+
+ def update_offset(self, dx, dy):
+ loc_in_canvas = self.offsetbox_x + dx, self.offsetbox_y + dy
+ self.offsetbox.set_offset(loc_in_canvas)
+
+ def get_loc_in_canvas(self):
+ offsetbox = self.offsetbox
+ renderer = offsetbox.get_figure(root=True)._get_renderer()
+ bbox = offsetbox.get_bbox(renderer)
+ ox, oy = offsetbox._offset
+ loc_in_canvas = (ox + bbox.x0, oy + bbox.y0)
+ return loc_in_canvas
+
+
+class DraggableAnnotation(DraggableBase):
+ def __init__(self, annotation, use_blit=False):
+ super().__init__(annotation, use_blit=use_blit)
+ self.annotation = annotation
+
+ def save_offset(self):
+ ann = self.annotation
+ self.ox, self.oy = ann.get_transform().transform(ann.xyann)
+
+ def update_offset(self, dx, dy):
+ ann = self.annotation
+ ann.xyann = ann.get_transform().inverted().transform(
+ (self.ox + dx, self.oy + dy))
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/offsetbox.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/offsetbox.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..3b1520e171385a334e0b4893de6bf152c379c52a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/offsetbox.pyi
@@ -0,0 +1,298 @@
+import matplotlib.artist as martist
+from matplotlib.backend_bases import RendererBase, Event, FigureCanvasBase
+from matplotlib.colors import Colormap, Normalize
+import matplotlib.text as mtext
+from matplotlib.figure import Figure, SubFigure
+from matplotlib.font_manager import FontProperties
+from matplotlib.image import BboxImage
+from matplotlib.patches import FancyArrowPatch, FancyBboxPatch
+from matplotlib.transforms import Bbox, BboxBase, Transform
+from matplotlib.typing import CoordsType
+
+import numpy as np
+from numpy.typing import ArrayLike
+from collections.abc import Callable, Sequence
+from typing import Any, Literal, overload
+
+DEBUG: bool
+
+def _get_packed_offsets(
+ widths: Sequence[float],
+ total: float | None,
+ sep: float | None,
+ mode: Literal["fixed", "expand", "equal"] = ...,
+) -> tuple[float, np.ndarray]: ...
+
+class OffsetBox(martist.Artist):
+ width: float | None
+ height: float | None
+ def __init__(self, *args, **kwargs) -> None: ...
+ def set_figure(self, fig: Figure | SubFigure) -> None: ...
+ def set_offset(
+ self,
+ xy: tuple[float, float]
+ | Callable[[float, float, float, float, RendererBase], tuple[float, float]],
+ ) -> None: ...
+
+ @overload
+ def get_offset(self, bbox: Bbox, renderer: RendererBase) -> tuple[float, float]: ...
+ @overload
+ def get_offset(
+ self,
+ width: float,
+ height: float,
+ xdescent: float,
+ ydescent: float,
+ renderer: RendererBase
+ ) -> tuple[float, float]: ...
+
+ def set_width(self, width: float) -> None: ...
+ def set_height(self, height: float) -> None: ...
+ def get_visible_children(self) -> list[martist.Artist]: ...
+ def get_children(self) -> list[martist.Artist]: ...
+ def get_bbox(self, renderer: RendererBase) -> Bbox: ...
+ def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ...
+
+class PackerBase(OffsetBox):
+ height: float | None
+ width: float | None
+ sep: float | None
+ pad: float | None
+ mode: Literal["fixed", "expand", "equal"]
+ align: Literal["top", "bottom", "left", "right", "center", "baseline"]
+ def __init__(
+ self,
+ pad: float | None = ...,
+ sep: float | None = ...,
+ width: float | None = ...,
+ height: float | None = ...,
+ align: Literal["top", "bottom", "left", "right", "center", "baseline"] = ...,
+ mode: Literal["fixed", "expand", "equal"] = ...,
+ children: list[martist.Artist] | None = ...,
+ ) -> None: ...
+
+class VPacker(PackerBase): ...
+class HPacker(PackerBase): ...
+
+class PaddedBox(OffsetBox):
+ pad: float | None
+ patch: FancyBboxPatch
+ def __init__(
+ self,
+ child: martist.Artist,
+ pad: float | None = ...,
+ *,
+ draw_frame: bool = ...,
+ patch_attrs: dict[str, Any] | None = ...,
+ ) -> None: ...
+ def update_frame(self, bbox: Bbox, fontsize: float | None = ...) -> None: ...
+ def draw_frame(self, renderer: RendererBase) -> None: ...
+
+class DrawingArea(OffsetBox):
+ width: float
+ height: float
+ xdescent: float
+ ydescent: float
+ offset_transform: Transform
+ dpi_transform: Transform
+ def __init__(
+ self,
+ width: float,
+ height: float,
+ xdescent: float = ...,
+ ydescent: float = ...,
+ clip: bool = ...,
+ ) -> None: ...
+ @property
+ def clip_children(self) -> bool: ...
+ @clip_children.setter
+ def clip_children(self, val: bool) -> None: ...
+ def get_transform(self) -> Transform: ...
+
+ # does not accept all options of superclass
+ def set_offset(self, xy: tuple[float, float]) -> None: ... # type: ignore[override]
+ def get_offset(self) -> tuple[float, float]: ... # type: ignore[override]
+ def add_artist(self, a: martist.Artist) -> None: ...
+
+class TextArea(OffsetBox):
+ offset_transform: Transform
+ def __init__(
+ self,
+ s: str,
+ *,
+ textprops: dict[str, Any] | None = ...,
+ multilinebaseline: bool = ...,
+ ) -> None: ...
+ def set_text(self, s: str) -> None: ...
+ def get_text(self) -> str: ...
+ def set_multilinebaseline(self, t: bool) -> None: ...
+ def get_multilinebaseline(self) -> bool: ...
+
+ # does not accept all options of superclass
+ def set_offset(self, xy: tuple[float, float]) -> None: ... # type: ignore[override]
+ def get_offset(self) -> tuple[float, float]: ... # type: ignore[override]
+
+class AuxTransformBox(OffsetBox):
+ aux_transform: Transform
+ offset_transform: Transform
+ ref_offset_transform: Transform
+ def __init__(self, aux_transform: Transform) -> None: ...
+ def add_artist(self, a: martist.Artist) -> None: ...
+ def get_transform(self) -> Transform: ...
+
+ # does not accept all options of superclass
+ def set_offset(self, xy: tuple[float, float]) -> None: ... # type: ignore[override]
+ def get_offset(self) -> tuple[float, float]: ... # type: ignore[override]
+
+class AnchoredOffsetbox(OffsetBox):
+ zorder: float
+ codes: dict[str, int]
+ loc: int
+ borderpad: float
+ pad: float
+ prop: FontProperties
+ patch: FancyBboxPatch
+ def __init__(
+ self,
+ loc: str,
+ *,
+ pad: float = ...,
+ borderpad: float = ...,
+ child: OffsetBox | None = ...,
+ prop: FontProperties | None = ...,
+ frameon: bool = ...,
+ bbox_to_anchor: BboxBase
+ | tuple[float, float]
+ | tuple[float, float, float, float]
+ | None = ...,
+ bbox_transform: Transform | None = ...,
+ **kwargs
+ ) -> None: ...
+ def set_child(self, child: OffsetBox | None) -> None: ...
+ def get_child(self) -> OffsetBox | None: ...
+ def get_children(self) -> list[martist.Artist]: ...
+ def get_bbox_to_anchor(self) -> Bbox: ...
+ def set_bbox_to_anchor(
+ self, bbox: BboxBase, transform: Transform | None = ...
+ ) -> None: ...
+ def update_frame(self, bbox: Bbox, fontsize: float | None = ...) -> None: ...
+
+class AnchoredText(AnchoredOffsetbox):
+ txt: TextArea
+ def __init__(
+ self,
+ s: str,
+ loc: str,
+ *,
+ pad: float = ...,
+ borderpad: float = ...,
+ prop: dict[str, Any] | None = ...,
+ **kwargs
+ ) -> None: ...
+
+class OffsetImage(OffsetBox):
+ image: BboxImage
+ def __init__(
+ self,
+ arr: ArrayLike,
+ *,
+ zoom: float = ...,
+ cmap: Colormap | str | None = ...,
+ norm: Normalize | str | None = ...,
+ interpolation: str | None = ...,
+ origin: Literal["upper", "lower"] | None = ...,
+ filternorm: bool = ...,
+ filterrad: float = ...,
+ resample: bool = ...,
+ dpi_cor: bool = ...,
+ **kwargs
+ ) -> None: ...
+ stale: bool
+ def set_data(self, arr: ArrayLike | None) -> None: ...
+ def get_data(self) -> ArrayLike | None: ...
+ def set_zoom(self, zoom: float) -> None: ...
+ def get_zoom(self) -> float: ...
+ def get_children(self) -> list[martist.Artist]: ...
+ def get_offset(self) -> tuple[float, float]: ... # type: ignore[override]
+
+class AnnotationBbox(martist.Artist, mtext._AnnotationBase):
+ zorder: float
+ offsetbox: OffsetBox
+ arrowprops: dict[str, Any] | None
+ xybox: tuple[float, float]
+ boxcoords: CoordsType
+ arrow_patch: FancyArrowPatch | None
+ patch: FancyBboxPatch
+ prop: FontProperties
+ def __init__(
+ self,
+ offsetbox: OffsetBox,
+ xy: tuple[float, float],
+ xybox: tuple[float, float] | None = ...,
+ xycoords: CoordsType = ...,
+ boxcoords: CoordsType | None = ...,
+ *,
+ frameon: bool = ...,
+ pad: float = ...,
+ annotation_clip: bool | None = ...,
+ box_alignment: tuple[float, float] = ...,
+ bboxprops: dict[str, Any] | None = ...,
+ arrowprops: dict[str, Any] | None = ...,
+ fontsize: float | str | None = ...,
+ **kwargs
+ ) -> None: ...
+ @property
+ def xyann(self) -> tuple[float, float]: ...
+ @xyann.setter
+ def xyann(self, xyann: tuple[float, float]) -> None: ...
+ @property
+ def anncoords(
+ self,
+ ) -> CoordsType: ...
+ @anncoords.setter
+ def anncoords(
+ self,
+ coords: CoordsType,
+ ) -> None: ...
+ def get_children(self) -> list[martist.Artist]: ...
+ def set_figure(self, fig: Figure | SubFigure) -> None: ...
+ def set_fontsize(self, s: str | float | None = ...) -> None: ...
+ def get_fontsize(self) -> float: ...
+ def get_tightbbox(self, renderer: RendererBase | None = ...) -> Bbox: ...
+ def update_positions(self, renderer: RendererBase) -> None: ...
+
+class DraggableBase:
+ ref_artist: martist.Artist
+ got_artist: bool
+ mouse_x: int
+ mouse_y: int
+ background: Any
+
+ @property
+ def canvas(self) -> FigureCanvasBase: ...
+ @property
+ def cids(self) -> list[int]: ...
+
+ def __init__(self, ref_artist: martist.Artist, use_blit: bool = ...) -> None: ...
+ def on_motion(self, evt: Event) -> None: ...
+ def on_pick(self, evt: Event) -> None: ...
+ def on_release(self, event: Event) -> None: ...
+ def disconnect(self) -> None: ...
+ def save_offset(self) -> None: ...
+ def update_offset(self, dx: float, dy: float) -> None: ...
+ def finalize_offset(self) -> None: ...
+
+class DraggableOffsetBox(DraggableBase):
+ offsetbox: OffsetBox
+ def __init__(
+ self, ref_artist: martist.Artist, offsetbox: OffsetBox, use_blit: bool = ...
+ ) -> None: ...
+ def save_offset(self) -> None: ...
+ def update_offset(self, dx: float, dy: float) -> None: ...
+ def get_loc_in_canvas(self) -> tuple[float, float]: ...
+
+class DraggableAnnotation(DraggableBase):
+ annotation: mtext.Annotation
+ def __init__(self, annotation: mtext.Annotation, use_blit: bool = ...) -> None: ...
+ def save_offset(self) -> None: ...
+ def update_offset(self, dx: float, dy: float) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patches.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patches.py
new file mode 100644
index 0000000000000000000000000000000000000000..736b1e77e1aca1c925266ab2e9de991f82f2284f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patches.py
@@ -0,0 +1,4760 @@
+r"""
+Patches are `.Artist`\s with a face color and an edge color.
+"""
+
+import functools
+import inspect
+import math
+from numbers import Number, Real
+import textwrap
+from types import SimpleNamespace
+from collections import namedtuple
+from matplotlib.transforms import Affine2D
+
+import numpy as np
+
+import matplotlib as mpl
+from . import (_api, artist, cbook, colors, _docstring, hatch as mhatch,
+ lines as mlines, transforms)
+from .bezier import (
+ NonIntersectingPathException, get_cos_sin, get_intersection,
+ get_parallels, inside_circle, make_wedged_bezier2,
+ split_bezier_intersecting_with_closedpath, split_path_inout)
+from .path import Path
+from ._enums import JoinStyle, CapStyle
+
+
+@_docstring.interpd
+@_api.define_aliases({
+ "antialiased": ["aa"],
+ "edgecolor": ["ec"],
+ "facecolor": ["fc"],
+ "linestyle": ["ls"],
+ "linewidth": ["lw"],
+})
+class Patch(artist.Artist):
+ """
+ A patch is a 2D artist with a face color and an edge color.
+
+ If any of *edgecolor*, *facecolor*, *linewidth*, or *antialiased*
+ are *None*, they default to their rc params setting.
+ """
+ zorder = 1
+
+ # Whether to draw an edge by default. Set on a
+ # subclass-by-subclass basis.
+ _edge_default = False
+
+ def __init__(self, *,
+ edgecolor=None,
+ facecolor=None,
+ color=None,
+ linewidth=None,
+ linestyle=None,
+ antialiased=None,
+ hatch=None,
+ fill=True,
+ capstyle=None,
+ joinstyle=None,
+ **kwargs):
+ """
+ The following kwarg properties are supported
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__()
+
+ if linestyle is None:
+ linestyle = "solid"
+ if capstyle is None:
+ capstyle = CapStyle.butt
+ if joinstyle is None:
+ joinstyle = JoinStyle.miter
+
+ self._hatch_color = colors.to_rgba(mpl.rcParams['hatch.color'])
+ self._hatch_linewidth = mpl.rcParams['hatch.linewidth']
+ self._fill = bool(fill) # needed for set_facecolor call
+ if color is not None:
+ if edgecolor is not None or facecolor is not None:
+ _api.warn_external(
+ "Setting the 'color' property will override "
+ "the edgecolor or facecolor properties.")
+ self.set_color(color)
+ else:
+ self.set_edgecolor(edgecolor)
+ self.set_facecolor(facecolor)
+
+ self._linewidth = 0
+ self._unscaled_dash_pattern = (0, None) # offset, dash
+ self._dash_pattern = (0, None) # offset, dash (scaled by linewidth)
+
+ self.set_linestyle(linestyle)
+ self.set_linewidth(linewidth)
+ self.set_antialiased(antialiased)
+ self.set_hatch(hatch)
+ self.set_capstyle(capstyle)
+ self.set_joinstyle(joinstyle)
+
+ if len(kwargs):
+ self._internal_update(kwargs)
+
+ def get_verts(self):
+ """
+ Return a copy of the vertices used in this patch.
+
+ If the patch contains BƩzier curves, the curves will be interpolated by
+ line segments. To access the curves as curves, use `get_path`.
+ """
+ trans = self.get_transform()
+ path = self.get_path()
+ polygons = path.to_polygons(trans)
+ if len(polygons):
+ return polygons[0]
+ return []
+
+ def _process_radius(self, radius):
+ if radius is not None:
+ return radius
+ if isinstance(self._picker, Number):
+ _radius = self._picker
+ else:
+ if self.get_edgecolor()[3] == 0:
+ _radius = 0
+ else:
+ _radius = self.get_linewidth()
+ return _radius
+
+ def contains(self, mouseevent, radius=None):
+ """
+ Test whether the mouse event occurred in the patch.
+
+ Parameters
+ ----------
+ mouseevent : `~matplotlib.backend_bases.MouseEvent`
+ Where the user clicked.
+
+ radius : float, optional
+ Additional margin on the patch in target coordinates of
+ `.Patch.get_transform`. See `.Path.contains_point` for further
+ details.
+
+ If `None`, the default value depends on the state of the object:
+
+ - If `.Artist.get_picker` is a number, the default
+ is that value. This is so that picking works as expected.
+ - Otherwise if the edge color has a non-zero alpha, the default
+ is half of the linewidth. This is so that all the colored
+ pixels are "in" the patch.
+ - Finally, if the edge has 0 alpha, the default is 0. This is
+ so that patches without a stroked edge do not have points
+ outside of the filled region report as "in" due to an
+ invisible edge.
+
+
+ Returns
+ -------
+ (bool, empty dict)
+ """
+ if self._different_canvas(mouseevent):
+ return False, {}
+ radius = self._process_radius(radius)
+ codes = self.get_path().codes
+ if codes is not None:
+ vertices = self.get_path().vertices
+ # if the current path is concatenated by multiple sub paths.
+ # get the indexes of the starting code(MOVETO) of all sub paths
+ idxs, = np.where(codes == Path.MOVETO)
+ # Don't split before the first MOVETO.
+ idxs = idxs[1:]
+ subpaths = map(
+ Path, np.split(vertices, idxs), np.split(codes, idxs))
+ else:
+ subpaths = [self.get_path()]
+ inside = any(
+ subpath.contains_point(
+ (mouseevent.x, mouseevent.y), self.get_transform(), radius)
+ for subpath in subpaths)
+ return inside, {}
+
+ def contains_point(self, point, radius=None):
+ """
+ Return whether the given point is inside the patch.
+
+ Parameters
+ ----------
+ point : (float, float)
+ The point (x, y) to check, in target coordinates of
+ ``.Patch.get_transform()``. These are display coordinates for patches
+ that are added to a figure or Axes.
+ radius : float, optional
+ Additional margin on the patch in target coordinates of
+ `.Patch.get_transform`. See `.Path.contains_point` for further
+ details.
+
+ If `None`, the default value depends on the state of the object:
+
+ - If `.Artist.get_picker` is a number, the default
+ is that value. This is so that picking works as expected.
+ - Otherwise if the edge color has a non-zero alpha, the default
+ is half of the linewidth. This is so that all the colored
+ pixels are "in" the patch.
+ - Finally, if the edge has 0 alpha, the default is 0. This is
+ so that patches without a stroked edge do not have points
+ outside of the filled region report as "in" due to an
+ invisible edge.
+
+ Returns
+ -------
+ bool
+
+ Notes
+ -----
+ The proper use of this method depends on the transform of the patch.
+ Isolated patches do not have a transform. In this case, the patch
+ creation coordinates and the point coordinates match. The following
+ example checks that the center of a circle is within the circle
+
+ >>> center = 0, 0
+ >>> c = Circle(center, radius=1)
+ >>> c.contains_point(center)
+ True
+
+ The convention of checking against the transformed patch stems from
+ the fact that this method is predominantly used to check if display
+ coordinates (e.g. from mouse events) are within the patch. If you want
+ to do the above check with data coordinates, you have to properly
+ transform them first:
+
+ >>> center = 0, 0
+ >>> c = Circle(center, radius=3)
+ >>> plt.gca().add_patch(c)
+ >>> transformed_interior_point = c.get_data_transform().transform((0, 2))
+ >>> c.contains_point(transformed_interior_point)
+ True
+
+ """
+ radius = self._process_radius(radius)
+ return self.get_path().contains_point(point,
+ self.get_transform(),
+ radius)
+
+ def contains_points(self, points, radius=None):
+ """
+ Return whether the given points are inside the patch.
+
+ Parameters
+ ----------
+ points : (N, 2) array
+ The points to check, in target coordinates of
+ ``self.get_transform()``. These are display coordinates for patches
+ that are added to a figure or Axes. Columns contain x and y values.
+ radius : float, optional
+ Additional margin on the patch in target coordinates of
+ `.Patch.get_transform`. See `.Path.contains_point` for further
+ details.
+
+ If `None`, the default value depends on the state of the object:
+
+ - If `.Artist.get_picker` is a number, the default
+ is that value. This is so that picking works as expected.
+ - Otherwise if the edge color has a non-zero alpha, the default
+ is half of the linewidth. This is so that all the colored
+ pixels are "in" the patch.
+ - Finally, if the edge has 0 alpha, the default is 0. This is
+ so that patches without a stroked edge do not have points
+ outside of the filled region report as "in" due to an
+ invisible edge.
+
+ Returns
+ -------
+ length-N bool array
+
+ Notes
+ -----
+ The proper use of this method depends on the transform of the patch.
+ See the notes on `.Patch.contains_point`.
+ """
+ radius = self._process_radius(radius)
+ return self.get_path().contains_points(points,
+ self.get_transform(),
+ radius)
+
+ def update_from(self, other):
+ # docstring inherited.
+ super().update_from(other)
+ # For some properties we don't need or don't want to go through the
+ # getters/setters, so we just copy them directly.
+ self._edgecolor = other._edgecolor
+ self._facecolor = other._facecolor
+ self._original_edgecolor = other._original_edgecolor
+ self._original_facecolor = other._original_facecolor
+ self._fill = other._fill
+ self._hatch = other._hatch
+ self._hatch_color = other._hatch_color
+ self._unscaled_dash_pattern = other._unscaled_dash_pattern
+ self.set_linewidth(other._linewidth) # also sets scaled dashes
+ self.set_transform(other.get_data_transform())
+ # If the transform of other needs further initialization, then it will
+ # be the case for this artist too.
+ self._transformSet = other.is_transform_set()
+
+ def get_extents(self):
+ """
+ Return the `Patch`'s axis-aligned extents as a `~.transforms.Bbox`.
+ """
+ return self.get_path().get_extents(self.get_transform())
+
+ def get_transform(self):
+ """Return the `~.transforms.Transform` applied to the `Patch`."""
+ return self.get_patch_transform() + artist.Artist.get_transform(self)
+
+ def get_data_transform(self):
+ """
+ Return the `~.transforms.Transform` mapping data coordinates to
+ physical coordinates.
+ """
+ return artist.Artist.get_transform(self)
+
+ def get_patch_transform(self):
+ """
+ Return the `~.transforms.Transform` instance mapping patch coordinates
+ to data coordinates.
+
+ For example, one may define a patch of a circle which represents a
+ radius of 5 by providing coordinates for a unit circle, and a
+ transform which scales the coordinates (the patch coordinate) by 5.
+ """
+ return transforms.IdentityTransform()
+
+ def get_antialiased(self):
+ """Return whether antialiasing is used for drawing."""
+ return self._antialiased
+
+ def get_edgecolor(self):
+ """Return the edge color."""
+ return self._edgecolor
+
+ def get_facecolor(self):
+ """Return the face color."""
+ return self._facecolor
+
+ def get_linewidth(self):
+ """Return the line width in points."""
+ return self._linewidth
+
+ def get_linestyle(self):
+ """Return the linestyle."""
+ return self._linestyle
+
+ def set_antialiased(self, aa):
+ """
+ Set whether to use antialiased rendering.
+
+ Parameters
+ ----------
+ aa : bool or None
+ """
+ if aa is None:
+ aa = mpl.rcParams['patch.antialiased']
+ self._antialiased = aa
+ self.stale = True
+
+ def _set_edgecolor(self, color):
+ set_hatch_color = True
+ if color is None:
+ if (mpl.rcParams['patch.force_edgecolor'] or
+ not self._fill or self._edge_default):
+ color = mpl.rcParams['patch.edgecolor']
+ else:
+ color = 'none'
+ set_hatch_color = False
+
+ self._edgecolor = colors.to_rgba(color, self._alpha)
+ if set_hatch_color:
+ self._hatch_color = self._edgecolor
+ self.stale = True
+
+ def set_edgecolor(self, color):
+ """
+ Set the patch edge color.
+
+ Parameters
+ ----------
+ color : :mpltype:`color` or None
+ """
+ self._original_edgecolor = color
+ self._set_edgecolor(color)
+
+ def _set_facecolor(self, color):
+ if color is None:
+ color = mpl.rcParams['patch.facecolor']
+ alpha = self._alpha if self._fill else 0
+ self._facecolor = colors.to_rgba(color, alpha)
+ self.stale = True
+
+ def set_facecolor(self, color):
+ """
+ Set the patch face color.
+
+ Parameters
+ ----------
+ color : :mpltype:`color` or None
+ """
+ self._original_facecolor = color
+ self._set_facecolor(color)
+
+ def set_color(self, c):
+ """
+ Set both the edgecolor and the facecolor.
+
+ Parameters
+ ----------
+ c : :mpltype:`color`
+
+ See Also
+ --------
+ Patch.set_facecolor, Patch.set_edgecolor
+ For setting the edge or face color individually.
+ """
+ self.set_facecolor(c)
+ self.set_edgecolor(c)
+
+ def set_alpha(self, alpha):
+ # docstring inherited
+ super().set_alpha(alpha)
+ self._set_facecolor(self._original_facecolor)
+ self._set_edgecolor(self._original_edgecolor)
+ # stale is already True
+
+ def set_linewidth(self, w):
+ """
+ Set the patch linewidth in points.
+
+ Parameters
+ ----------
+ w : float or None
+ """
+ if w is None:
+ w = mpl.rcParams['patch.linewidth']
+ self._linewidth = float(w)
+ self._dash_pattern = mlines._scale_dashes(
+ *self._unscaled_dash_pattern, w)
+ self.stale = True
+
+ def set_linestyle(self, ls):
+ """
+ Set the patch linestyle.
+
+ ========================================== =================
+ linestyle description
+ ========================================== =================
+ ``'-'`` or ``'solid'`` solid line
+ ``'--'`` or ``'dashed'`` dashed line
+ ``'-.'`` or ``'dashdot'`` dash-dotted line
+ ``':'`` or ``'dotted'`` dotted line
+ ``'none'``, ``'None'``, ``' '``, or ``''`` draw nothing
+ ========================================== =================
+
+ Alternatively a dash tuple of the following form can be provided::
+
+ (offset, onoffseq)
+
+ where ``onoffseq`` is an even length tuple of on and off ink in points.
+
+ Parameters
+ ----------
+ ls : {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
+ The line style.
+ """
+ if ls is None:
+ ls = "solid"
+ if ls in [' ', '', 'none']:
+ ls = 'None'
+ self._linestyle = ls
+ self._unscaled_dash_pattern = mlines._get_dash_pattern(ls)
+ self._dash_pattern = mlines._scale_dashes(
+ *self._unscaled_dash_pattern, self._linewidth)
+ self.stale = True
+
+ def set_fill(self, b):
+ """
+ Set whether to fill the patch.
+
+ Parameters
+ ----------
+ b : bool
+ """
+ self._fill = bool(b)
+ self._set_facecolor(self._original_facecolor)
+ self._set_edgecolor(self._original_edgecolor)
+ self.stale = True
+
+ def get_fill(self):
+ """Return whether the patch is filled."""
+ return self._fill
+
+ # Make fill a property so as to preserve the long-standing
+ # but somewhat inconsistent behavior in which fill was an
+ # attribute.
+ fill = property(get_fill, set_fill)
+
+ @_docstring.interpd
+ def set_capstyle(self, s):
+ """
+ Set the `.CapStyle`.
+
+ The default capstyle is 'round' for `.FancyArrowPatch` and 'butt' for
+ all other patches.
+
+ Parameters
+ ----------
+ s : `.CapStyle` or %(CapStyle)s
+ """
+ cs = CapStyle(s)
+ self._capstyle = cs
+ self.stale = True
+
+ def get_capstyle(self):
+ """Return the capstyle."""
+ return self._capstyle.name
+
+ @_docstring.interpd
+ def set_joinstyle(self, s):
+ """
+ Set the `.JoinStyle`.
+
+ The default joinstyle is 'round' for `.FancyArrowPatch` and 'miter' for
+ all other patches.
+
+ Parameters
+ ----------
+ s : `.JoinStyle` or %(JoinStyle)s
+ """
+ js = JoinStyle(s)
+ self._joinstyle = js
+ self.stale = True
+
+ def get_joinstyle(self):
+ """Return the joinstyle."""
+ return self._joinstyle.name
+
+ def set_hatch(self, hatch):
+ r"""
+ Set the hatching pattern.
+
+ *hatch* can be one of::
+
+ / - diagonal hatching
+ \ - back diagonal
+ | - vertical
+ - - horizontal
+ + - crossed
+ x - crossed diagonal
+ o - small circle
+ O - large circle
+ . - dots
+ * - stars
+
+ Letters can be combined, in which case all the specified
+ hatchings are done. If same letter repeats, it increases the
+ density of hatching of that pattern.
+
+ Parameters
+ ----------
+ hatch : {'/', '\\', '|', '-', '+', 'x', 'o', 'O', '.', '*'}
+ """
+ # Use validate_hatch(list) after deprecation.
+ mhatch._validate_hatch_pattern(hatch)
+ self._hatch = hatch
+ self.stale = True
+
+ def get_hatch(self):
+ """Return the hatching pattern."""
+ return self._hatch
+
+ def set_hatch_linewidth(self, lw):
+ """Set the hatch linewidth."""
+ self._hatch_linewidth = lw
+
+ def get_hatch_linewidth(self):
+ """Return the hatch linewidth."""
+ return self._hatch_linewidth
+
+ def _draw_paths_with_artist_properties(
+ self, renderer, draw_path_args_list):
+ """
+ ``draw()`` helper factored out for sharing with `FancyArrowPatch`.
+
+ Configure *renderer* and the associated graphics context *gc*
+ from the artist properties, then repeatedly call
+ ``renderer.draw_path(gc, *draw_path_args)`` for each tuple
+ *draw_path_args* in *draw_path_args_list*.
+ """
+
+ renderer.open_group('patch', self.get_gid())
+ gc = renderer.new_gc()
+
+ gc.set_foreground(self._edgecolor, isRGBA=True)
+
+ lw = self._linewidth
+ if self._edgecolor[3] == 0 or self._linestyle == 'None':
+ lw = 0
+ gc.set_linewidth(lw)
+ gc.set_dashes(*self._dash_pattern)
+ gc.set_capstyle(self._capstyle)
+ gc.set_joinstyle(self._joinstyle)
+
+ gc.set_antialiased(self._antialiased)
+ self._set_gc_clip(gc)
+ gc.set_url(self._url)
+ gc.set_snap(self.get_snap())
+
+ gc.set_alpha(self._alpha)
+
+ if self._hatch:
+ gc.set_hatch(self._hatch)
+ gc.set_hatch_color(self._hatch_color)
+ gc.set_hatch_linewidth(self._hatch_linewidth)
+
+ if self.get_sketch_params() is not None:
+ gc.set_sketch_params(*self.get_sketch_params())
+
+ if self.get_path_effects():
+ from matplotlib.patheffects import PathEffectRenderer
+ renderer = PathEffectRenderer(self.get_path_effects(), renderer)
+
+ for draw_path_args in draw_path_args_list:
+ renderer.draw_path(gc, *draw_path_args)
+
+ gc.restore()
+ renderer.close_group('patch')
+ self.stale = False
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+ if not self.get_visible():
+ return
+ path = self.get_path()
+ transform = self.get_transform()
+ tpath = transform.transform_path_non_affine(path)
+ affine = transform.get_affine()
+ self._draw_paths_with_artist_properties(
+ renderer,
+ [(tpath, affine,
+ # Work around a bug in the PDF and SVG renderers, which
+ # do not draw the hatches if the facecolor is fully
+ # transparent, but do if it is None.
+ self._facecolor if self._facecolor[3] else None)])
+
+ def get_path(self):
+ """Return the path of this patch."""
+ raise NotImplementedError('Derived must override')
+
+ def get_window_extent(self, renderer=None):
+ return self.get_path().get_extents(self.get_transform())
+
+ def _convert_xy_units(self, xy):
+ """Convert x and y units for a tuple (x, y)."""
+ x = self.convert_xunits(xy[0])
+ y = self.convert_yunits(xy[1])
+ return x, y
+
+
+class Shadow(Patch):
+ def __str__(self):
+ return f"Shadow({self.patch})"
+
+ @_docstring.interpd
+ def __init__(self, patch, ox, oy, *, shade=0.7, **kwargs):
+ """
+ Create a shadow of the given *patch*.
+
+ By default, the shadow will have the same face color as the *patch*,
+ but darkened. The darkness can be controlled by *shade*.
+
+ Parameters
+ ----------
+ patch : `~matplotlib.patches.Patch`
+ The patch to create the shadow for.
+ ox, oy : float
+ The shift of the shadow in data coordinates, scaled by a factor
+ of dpi/72.
+ shade : float, default: 0.7
+ How the darkness of the shadow relates to the original color. If 1, the
+ shadow is black, if 0, the shadow has the same color as the *patch*.
+
+ .. versionadded:: 3.8
+
+ **kwargs
+ Properties of the shadow patch. Supported keys are:
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__()
+ self.patch = patch
+ self._ox, self._oy = ox, oy
+ self._shadow_transform = transforms.Affine2D()
+
+ self.update_from(self.patch)
+ if not 0 <= shade <= 1:
+ raise ValueError("shade must be between 0 and 1.")
+ color = (1 - shade) * np.asarray(colors.to_rgb(self.patch.get_facecolor()))
+ self.update({'facecolor': color, 'edgecolor': color, 'alpha': 0.5,
+ # Place shadow patch directly behind the inherited patch.
+ 'zorder': np.nextafter(self.patch.zorder, -np.inf),
+ **kwargs})
+
+ def _update_transform(self, renderer):
+ ox = renderer.points_to_pixels(self._ox)
+ oy = renderer.points_to_pixels(self._oy)
+ self._shadow_transform.clear().translate(ox, oy)
+
+ def get_path(self):
+ return self.patch.get_path()
+
+ def get_patch_transform(self):
+ return self.patch.get_patch_transform() + self._shadow_transform
+
+ def draw(self, renderer):
+ self._update_transform(renderer)
+ super().draw(renderer)
+
+
+class Rectangle(Patch):
+ """
+ A rectangle defined via an anchor point *xy* and its *width* and *height*.
+
+ The rectangle extends from ``xy[0]`` to ``xy[0] + width`` in x-direction
+ and from ``xy[1]`` to ``xy[1] + height`` in y-direction. ::
+
+ : +------------------+
+ : | |
+ : height |
+ : | |
+ : (xy)---- width -----+
+
+ One may picture *xy* as the bottom left corner, but which corner *xy* is
+ actually depends on the direction of the axis and the sign of *width*
+ and *height*; e.g. *xy* would be the bottom right corner if the x-axis
+ was inverted or if *width* was negative.
+ """
+
+ def __str__(self):
+ pars = self._x0, self._y0, self._width, self._height, self.angle
+ fmt = "Rectangle(xy=(%g, %g), width=%g, height=%g, angle=%g)"
+ return fmt % pars
+
+ @_docstring.interpd
+ def __init__(self, xy, width, height, *,
+ angle=0.0, rotation_point='xy', **kwargs):
+ """
+ Parameters
+ ----------
+ xy : (float, float)
+ The anchor point.
+ width : float
+ Rectangle width.
+ height : float
+ Rectangle height.
+ angle : float, default: 0
+ Rotation in degrees anti-clockwise about the rotation point.
+ rotation_point : {'xy', 'center', (number, number)}, default: 'xy'
+ If ``'xy'``, rotate around the anchor point. If ``'center'`` rotate
+ around the center. If 2-tuple of number, rotate around this
+ coordinate.
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.patches.Patch` properties
+ %(Patch:kwdoc)s
+ """
+ super().__init__(**kwargs)
+ self._x0 = xy[0]
+ self._y0 = xy[1]
+ self._width = width
+ self._height = height
+ self.angle = float(angle)
+ self.rotation_point = rotation_point
+ # Required for RectangleSelector with axes aspect ratio != 1
+ # The patch is defined in data coordinates and when changing the
+ # selector with square modifier and not in data coordinates, we need
+ # to correct for the aspect ratio difference between the data and
+ # display coordinate systems. Its value is typically provide by
+ # Axes._get_aspect_ratio()
+ self._aspect_ratio_correction = 1.0
+ self._convert_units() # Validate the inputs.
+
+ def get_path(self):
+ """Return the vertices of the rectangle."""
+ return Path.unit_rectangle()
+
+ def _convert_units(self):
+ """Convert bounds of the rectangle."""
+ x0 = self.convert_xunits(self._x0)
+ y0 = self.convert_yunits(self._y0)
+ x1 = self.convert_xunits(self._x0 + self._width)
+ y1 = self.convert_yunits(self._y0 + self._height)
+ return x0, y0, x1, y1
+
+ def get_patch_transform(self):
+ # Note: This cannot be called until after this has been added to
+ # an Axes, otherwise unit conversion will fail. This makes it very
+ # important to call the accessor method and not directly access the
+ # transformation member variable.
+ bbox = self.get_bbox()
+ if self.rotation_point == 'center':
+ width, height = bbox.x1 - bbox.x0, bbox.y1 - bbox.y0
+ rotation_point = bbox.x0 + width / 2., bbox.y0 + height / 2.
+ elif self.rotation_point == 'xy':
+ rotation_point = bbox.x0, bbox.y0
+ else:
+ rotation_point = self.rotation_point
+ return transforms.BboxTransformTo(bbox) \
+ + transforms.Affine2D() \
+ .translate(-rotation_point[0], -rotation_point[1]) \
+ .scale(1, self._aspect_ratio_correction) \
+ .rotate_deg(self.angle) \
+ .scale(1, 1 / self._aspect_ratio_correction) \
+ .translate(*rotation_point)
+
+ @property
+ def rotation_point(self):
+ """The rotation point of the patch."""
+ return self._rotation_point
+
+ @rotation_point.setter
+ def rotation_point(self, value):
+ if value in ['center', 'xy'] or (
+ isinstance(value, tuple) and len(value) == 2 and
+ isinstance(value[0], Real) and isinstance(value[1], Real)
+ ):
+ self._rotation_point = value
+ else:
+ raise ValueError("`rotation_point` must be one of "
+ "{'xy', 'center', (number, number)}.")
+
+ def get_x(self):
+ """Return the left coordinate of the rectangle."""
+ return self._x0
+
+ def get_y(self):
+ """Return the bottom coordinate of the rectangle."""
+ return self._y0
+
+ def get_xy(self):
+ """Return the left and bottom coords of the rectangle as a tuple."""
+ return self._x0, self._y0
+
+ def get_corners(self):
+ """
+ Return the corners of the rectangle, moving anti-clockwise from
+ (x0, y0).
+ """
+ return self.get_patch_transform().transform(
+ [(0, 0), (1, 0), (1, 1), (0, 1)])
+
+ def get_center(self):
+ """Return the centre of the rectangle."""
+ return self.get_patch_transform().transform((0.5, 0.5))
+
+ def get_width(self):
+ """Return the width of the rectangle."""
+ return self._width
+
+ def get_height(self):
+ """Return the height of the rectangle."""
+ return self._height
+
+ def get_angle(self):
+ """Get the rotation angle in degrees."""
+ return self.angle
+
+ def set_x(self, x):
+ """Set the left coordinate of the rectangle."""
+ self._x0 = x
+ self.stale = True
+
+ def set_y(self, y):
+ """Set the bottom coordinate of the rectangle."""
+ self._y0 = y
+ self.stale = True
+
+ def set_angle(self, angle):
+ """
+ Set the rotation angle in degrees.
+
+ The rotation is performed anti-clockwise around *xy*.
+ """
+ self.angle = angle
+ self.stale = True
+
+ def set_xy(self, xy):
+ """
+ Set the left and bottom coordinates of the rectangle.
+
+ Parameters
+ ----------
+ xy : (float, float)
+ """
+ self._x0, self._y0 = xy
+ self.stale = True
+
+ def set_width(self, w):
+ """Set the width of the rectangle."""
+ self._width = w
+ self.stale = True
+
+ def set_height(self, h):
+ """Set the height of the rectangle."""
+ self._height = h
+ self.stale = True
+
+ def set_bounds(self, *args):
+ """
+ Set the bounds of the rectangle as *left*, *bottom*, *width*, *height*.
+
+ The values may be passed as separate parameters or as a tuple::
+
+ set_bounds(left, bottom, width, height)
+ set_bounds((left, bottom, width, height))
+
+ .. ACCEPTS: (left, bottom, width, height)
+ """
+ if len(args) == 1:
+ l, b, w, h = args[0]
+ else:
+ l, b, w, h = args
+ self._x0 = l
+ self._y0 = b
+ self._width = w
+ self._height = h
+ self.stale = True
+
+ def get_bbox(self):
+ """Return the `.Bbox`."""
+ return transforms.Bbox.from_extents(*self._convert_units())
+
+ xy = property(get_xy, set_xy)
+
+
+class RegularPolygon(Patch):
+ """A regular polygon patch."""
+
+ def __str__(self):
+ s = "RegularPolygon((%g, %g), %d, radius=%g, orientation=%g)"
+ return s % (self.xy[0], self.xy[1], self.numvertices, self.radius,
+ self.orientation)
+
+ @_docstring.interpd
+ def __init__(self, xy, numVertices, *,
+ radius=5, orientation=0, **kwargs):
+ """
+ Parameters
+ ----------
+ xy : (float, float)
+ The center position.
+
+ numVertices : int
+ The number of vertices.
+
+ radius : float
+ The distance from the center to each of the vertices.
+
+ orientation : float
+ The polygon rotation angle (in radians).
+
+ **kwargs
+ `Patch` properties:
+
+ %(Patch:kwdoc)s
+ """
+ self.xy = xy
+ self.numvertices = numVertices
+ self.orientation = orientation
+ self.radius = radius
+ self._path = Path.unit_regular_polygon(numVertices)
+ self._patch_transform = transforms.Affine2D()
+ super().__init__(**kwargs)
+
+ def get_path(self):
+ return self._path
+
+ def get_patch_transform(self):
+ return self._patch_transform.clear() \
+ .scale(self.radius) \
+ .rotate(self.orientation) \
+ .translate(*self.xy)
+
+
+class PathPatch(Patch):
+ """A general polycurve path patch."""
+
+ _edge_default = True
+
+ def __str__(self):
+ s = "PathPatch%d((%g, %g) ...)"
+ return s % (len(self._path.vertices), *tuple(self._path.vertices[0]))
+
+ @_docstring.interpd
+ def __init__(self, path, **kwargs):
+ """
+ *path* is a `.Path` object.
+
+ Valid keyword arguments are:
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__(**kwargs)
+ self._path = path
+
+ def get_path(self):
+ return self._path
+
+ def set_path(self, path):
+ self._path = path
+
+
+class StepPatch(PathPatch):
+ """
+ A path patch describing a stepwise constant function.
+
+ By default, the path is not closed and starts and stops at
+ baseline value.
+ """
+
+ _edge_default = False
+
+ @_docstring.interpd
+ def __init__(self, values, edges, *,
+ orientation='vertical', baseline=0, **kwargs):
+ """
+ Parameters
+ ----------
+ values : array-like
+ The step heights.
+
+ edges : array-like
+ The edge positions, with ``len(edges) == len(vals) + 1``,
+ between which the curve takes on vals values.
+
+ orientation : {'vertical', 'horizontal'}, default: 'vertical'
+ The direction of the steps. Vertical means that *values* are
+ along the y-axis, and edges are along the x-axis.
+
+ baseline : float, array-like or None, default: 0
+ The bottom value of the bounding edges or when
+ ``fill=True``, position of lower edge. If *fill* is
+ True or an array is passed to *baseline*, a closed
+ path is drawn.
+
+ **kwargs
+ `Patch` properties:
+
+ %(Patch:kwdoc)s
+ """
+ self.orientation = orientation
+ self._edges = np.asarray(edges)
+ self._values = np.asarray(values)
+ self._baseline = np.asarray(baseline) if baseline is not None else None
+ self._update_path()
+ super().__init__(self._path, **kwargs)
+
+ def _update_path(self):
+ if np.isnan(np.sum(self._edges)):
+ raise ValueError('Nan values in "edges" are disallowed')
+ if self._edges.size - 1 != self._values.size:
+ raise ValueError('Size mismatch between "values" and "edges". '
+ "Expected `len(values) + 1 == len(edges)`, but "
+ f"`len(values) = {self._values.size}` and "
+ f"`len(edges) = {self._edges.size}`.")
+ # Initializing with empty arrays allows supporting empty stairs.
+ verts, codes = [np.empty((0, 2))], [np.empty(0, dtype=Path.code_type)]
+
+ _nan_mask = np.isnan(self._values)
+ if self._baseline is not None:
+ _nan_mask |= np.isnan(self._baseline)
+ for idx0, idx1 in cbook.contiguous_regions(~_nan_mask):
+ x = np.repeat(self._edges[idx0:idx1+1], 2)
+ y = np.repeat(self._values[idx0:idx1], 2)
+ if self._baseline is None:
+ y = np.concatenate([y[:1], y, y[-1:]])
+ elif self._baseline.ndim == 0: # single baseline value
+ y = np.concatenate([[self._baseline], y, [self._baseline]])
+ elif self._baseline.ndim == 1: # baseline array
+ base = np.repeat(self._baseline[idx0:idx1], 2)[::-1]
+ x = np.concatenate([x, x[::-1]])
+ y = np.concatenate([base[-1:], y, base[:1],
+ base[:1], base, base[-1:]])
+ else: # no baseline
+ raise ValueError('Invalid `baseline` specified')
+ if self.orientation == 'vertical':
+ xy = np.column_stack([x, y])
+ else:
+ xy = np.column_stack([y, x])
+ verts.append(xy)
+ codes.append([Path.MOVETO] + [Path.LINETO]*(len(xy)-1))
+ self._path = Path(np.concatenate(verts), np.concatenate(codes))
+
+ def get_data(self):
+ """Get `.StepPatch` values, edges and baseline as namedtuple."""
+ StairData = namedtuple('StairData', 'values edges baseline')
+ return StairData(self._values, self._edges, self._baseline)
+
+ def set_data(self, values=None, edges=None, baseline=None):
+ """
+ Set `.StepPatch` values, edges and baseline.
+
+ Parameters
+ ----------
+ values : 1D array-like or None
+ Will not update values, if passing None
+ edges : 1D array-like, optional
+ baseline : float, 1D array-like or None
+ """
+ if values is None and edges is None and baseline is None:
+ raise ValueError("Must set *values*, *edges* or *baseline*.")
+ if values is not None:
+ self._values = np.asarray(values)
+ if edges is not None:
+ self._edges = np.asarray(edges)
+ if baseline is not None:
+ self._baseline = np.asarray(baseline)
+ self._update_path()
+ self.stale = True
+
+
+class Polygon(Patch):
+ """A general polygon patch."""
+
+ def __str__(self):
+ if len(self._path.vertices):
+ s = "Polygon%d((%g, %g) ...)"
+ return s % (len(self._path.vertices), *self._path.vertices[0])
+ else:
+ return "Polygon0()"
+
+ @_docstring.interpd
+ def __init__(self, xy, *, closed=True, **kwargs):
+ """
+ Parameters
+ ----------
+ xy : (N, 2) array
+
+ closed : bool, default: True
+ Whether the polygon is closed (i.e., has identical start and end
+ points).
+
+ **kwargs
+ %(Patch:kwdoc)s
+ """
+ super().__init__(**kwargs)
+ self._closed = closed
+ self.set_xy(xy)
+
+ def get_path(self):
+ """Get the `.Path` of the polygon."""
+ return self._path
+
+ def get_closed(self):
+ """Return whether the polygon is closed."""
+ return self._closed
+
+ def set_closed(self, closed):
+ """
+ Set whether the polygon is closed.
+
+ Parameters
+ ----------
+ closed : bool
+ True if the polygon is closed
+ """
+ if self._closed == bool(closed):
+ return
+ self._closed = bool(closed)
+ self.set_xy(self.get_xy())
+ self.stale = True
+
+ def get_xy(self):
+ """
+ Get the vertices of the path.
+
+ Returns
+ -------
+ (N, 2) array
+ The coordinates of the vertices.
+ """
+ return self._path.vertices
+
+ def set_xy(self, xy):
+ """
+ Set the vertices of the polygon.
+
+ Parameters
+ ----------
+ xy : (N, 2) array-like
+ The coordinates of the vertices.
+
+ Notes
+ -----
+ Unlike `.Path`, we do not ignore the last input vertex. If the
+ polygon is meant to be closed, and the last point of the polygon is not
+ equal to the first, we assume that the user has not explicitly passed a
+ ``CLOSEPOLY`` vertex, and add it ourselves.
+ """
+ xy = np.asarray(xy)
+ nverts, _ = xy.shape
+ if self._closed:
+ # if the first and last vertex are the "same", then we assume that
+ # the user explicitly passed the CLOSEPOLY vertex. Otherwise, we
+ # have to append one since the last vertex will be "ignored" by
+ # Path
+ if nverts == 1 or nverts > 1 and (xy[0] != xy[-1]).any():
+ xy = np.concatenate([xy, [xy[0]]])
+ else:
+ # if we aren't closed, and the last vertex matches the first, then
+ # we assume we have an unnecessary CLOSEPOLY vertex and remove it
+ if nverts > 2 and (xy[0] == xy[-1]).all():
+ xy = xy[:-1]
+ self._path = Path(xy, closed=self._closed)
+ self.stale = True
+
+ xy = property(get_xy, set_xy,
+ doc='The vertices of the path as a (N, 2) array.')
+
+
+class Wedge(Patch):
+ """Wedge shaped patch."""
+
+ def __str__(self):
+ pars = (self.center[0], self.center[1], self.r,
+ self.theta1, self.theta2, self.width)
+ fmt = "Wedge(center=(%g, %g), r=%g, theta1=%g, theta2=%g, width=%s)"
+ return fmt % pars
+
+ @_docstring.interpd
+ def __init__(self, center, r, theta1, theta2, *, width=None, **kwargs):
+ """
+ A wedge centered at *x*, *y* center with radius *r* that
+ sweeps *theta1* to *theta2* (in degrees). If *width* is given,
+ then a partial wedge is drawn from inner radius *r* - *width*
+ to outer radius *r*.
+
+ Valid keyword arguments are:
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__(**kwargs)
+ self.center = center
+ self.r, self.width = r, width
+ self.theta1, self.theta2 = theta1, theta2
+ self._patch_transform = transforms.IdentityTransform()
+ self._recompute_path()
+
+ def _recompute_path(self):
+ # Inner and outer rings are connected unless the annulus is complete
+ if abs((self.theta2 - self.theta1) - 360) <= 1e-12:
+ theta1, theta2 = 0, 360
+ connector = Path.MOVETO
+ else:
+ theta1, theta2 = self.theta1, self.theta2
+ connector = Path.LINETO
+
+ # Form the outer ring
+ arc = Path.arc(theta1, theta2)
+
+ if self.width is not None:
+ # Partial annulus needs to draw the outer ring
+ # followed by a reversed and scaled inner ring
+ v1 = arc.vertices
+ v2 = arc.vertices[::-1] * (self.r - self.width) / self.r
+ v = np.concatenate([v1, v2, [(0, 0)]])
+ c = [*arc.codes, connector, *arc.codes[1:], Path.CLOSEPOLY]
+ else:
+ # Wedge doesn't need an inner ring
+ v = np.concatenate([arc.vertices, [(0, 0), (0, 0)]])
+ c = [*arc.codes, connector, Path.CLOSEPOLY]
+
+ # Shift and scale the wedge to the final location.
+ self._path = Path(v * self.r + self.center, c)
+
+ def set_center(self, center):
+ self._path = None
+ self.center = center
+ self.stale = True
+
+ def set_radius(self, radius):
+ self._path = None
+ self.r = radius
+ self.stale = True
+
+ def set_theta1(self, theta1):
+ self._path = None
+ self.theta1 = theta1
+ self.stale = True
+
+ def set_theta2(self, theta2):
+ self._path = None
+ self.theta2 = theta2
+ self.stale = True
+
+ def set_width(self, width):
+ self._path = None
+ self.width = width
+ self.stale = True
+
+ def get_path(self):
+ if self._path is None:
+ self._recompute_path()
+ return self._path
+
+
+# COVERAGE NOTE: Not used internally or from examples
+class Arrow(Patch):
+ """An arrow patch."""
+
+ def __str__(self):
+ return "Arrow()"
+
+ _path = Path._create_closed([
+ [0.0, 0.1], [0.0, -0.1], [0.8, -0.1], [0.8, -0.3], [1.0, 0.0],
+ [0.8, 0.3], [0.8, 0.1]])
+
+ @_docstring.interpd
+ def __init__(self, x, y, dx, dy, *, width=1.0, **kwargs):
+ """
+ Draws an arrow from (*x*, *y*) to (*x* + *dx*, *y* + *dy*).
+ The width of the arrow is scaled by *width*.
+
+ Parameters
+ ----------
+ x : float
+ x coordinate of the arrow tail.
+ y : float
+ y coordinate of the arrow tail.
+ dx : float
+ Arrow length in the x direction.
+ dy : float
+ Arrow length in the y direction.
+ width : float, default: 1
+ Scale factor for the width of the arrow. With a default value of 1,
+ the tail width is 0.2 and head width is 0.6.
+ **kwargs
+ Keyword arguments control the `Patch` properties:
+
+ %(Patch:kwdoc)s
+
+ See Also
+ --------
+ FancyArrow
+ Patch that allows independent control of the head and tail
+ properties.
+ """
+ super().__init__(**kwargs)
+ self.set_data(x, y, dx, dy, width)
+
+ def get_path(self):
+ return self._path
+
+ def get_patch_transform(self):
+ return self._patch_transform
+
+ def set_data(self, x=None, y=None, dx=None, dy=None, width=None):
+ """
+ Set `.Arrow` x, y, dx, dy and width.
+ Values left as None will not be updated.
+
+ Parameters
+ ----------
+ x, y : float or None, default: None
+ The x and y coordinates of the arrow base.
+
+ dx, dy : float or None, default: None
+ The length of the arrow along x and y direction.
+
+ width : float or None, default: None
+ Width of full arrow tail.
+ """
+ if x is not None:
+ self._x = x
+ if y is not None:
+ self._y = y
+ if dx is not None:
+ self._dx = dx
+ if dy is not None:
+ self._dy = dy
+ if width is not None:
+ self._width = width
+ self._patch_transform = (
+ transforms.Affine2D()
+ .scale(np.hypot(self._dx, self._dy), self._width)
+ .rotate(np.arctan2(self._dy, self._dx))
+ .translate(self._x, self._y)
+ .frozen())
+
+
+class FancyArrow(Polygon):
+ """
+ Like Arrow, but lets you set head width and head height independently.
+ """
+
+ _edge_default = True
+
+ def __str__(self):
+ return "FancyArrow()"
+
+ @_docstring.interpd
+ def __init__(self, x, y, dx, dy, *,
+ width=0.001, length_includes_head=False, head_width=None,
+ head_length=None, shape='full', overhang=0,
+ head_starts_at_zero=False, **kwargs):
+ """
+ Parameters
+ ----------
+ x, y : float
+ The x and y coordinates of the arrow base.
+
+ dx, dy : float
+ The length of the arrow along x and y direction.
+
+ width : float, default: 0.001
+ Width of full arrow tail.
+
+ length_includes_head : bool, default: False
+ True if head is to be counted in calculating the length.
+
+ head_width : float or None, default: 3*width
+ Total width of the full arrow head.
+
+ head_length : float or None, default: 1.5*head_width
+ Length of arrow head.
+
+ shape : {'full', 'left', 'right'}, default: 'full'
+ Draw the left-half, right-half, or full arrow.
+
+ overhang : float, default: 0
+ Fraction that the arrow is swept back (0 overhang means
+ triangular shape). Can be negative or greater than one.
+
+ head_starts_at_zero : bool, default: False
+ If True, the head starts being drawn at coordinate 0
+ instead of ending at coordinate 0.
+
+ **kwargs
+ `.Patch` properties:
+
+ %(Patch:kwdoc)s
+ """
+ self._x = x
+ self._y = y
+ self._dx = dx
+ self._dy = dy
+ self._width = width
+ self._length_includes_head = length_includes_head
+ self._head_width = head_width
+ self._head_length = head_length
+ self._shape = shape
+ self._overhang = overhang
+ self._head_starts_at_zero = head_starts_at_zero
+ self._make_verts()
+ super().__init__(self.verts, closed=True, **kwargs)
+
+ def set_data(self, *, x=None, y=None, dx=None, dy=None, width=None,
+ head_width=None, head_length=None):
+ """
+ Set `.FancyArrow` x, y, dx, dy, width, head_with, and head_length.
+ Values left as None will not be updated.
+
+ Parameters
+ ----------
+ x, y : float or None, default: None
+ The x and y coordinates of the arrow base.
+
+ dx, dy : float or None, default: None
+ The length of the arrow along x and y direction.
+
+ width : float or None, default: None
+ Width of full arrow tail.
+
+ head_width : float or None, default: None
+ Total width of the full arrow head.
+
+ head_length : float or None, default: None
+ Length of arrow head.
+ """
+ if x is not None:
+ self._x = x
+ if y is not None:
+ self._y = y
+ if dx is not None:
+ self._dx = dx
+ if dy is not None:
+ self._dy = dy
+ if width is not None:
+ self._width = width
+ if head_width is not None:
+ self._head_width = head_width
+ if head_length is not None:
+ self._head_length = head_length
+ self._make_verts()
+ self.set_xy(self.verts)
+
+ def _make_verts(self):
+ if self._head_width is None:
+ head_width = 3 * self._width
+ else:
+ head_width = self._head_width
+ if self._head_length is None:
+ head_length = 1.5 * head_width
+ else:
+ head_length = self._head_length
+
+ distance = np.hypot(self._dx, self._dy)
+
+ if self._length_includes_head:
+ length = distance
+ else:
+ length = distance + head_length
+ if not length:
+ self.verts = np.empty([0, 2]) # display nothing if empty
+ else:
+ # start by drawing horizontal arrow, point at (0, 0)
+ hw, hl = head_width, head_length
+ hs, lw = self._overhang, self._width
+ left_half_arrow = np.array([
+ [0.0, 0.0], # tip
+ [-hl, -hw / 2], # leftmost
+ [-hl * (1 - hs), -lw / 2], # meets stem
+ [-length, -lw / 2], # bottom left
+ [-length, 0],
+ ])
+ # if we're not including the head, shift up by head length
+ if not self._length_includes_head:
+ left_half_arrow += [head_length, 0]
+ # if the head starts at 0, shift up by another head length
+ if self._head_starts_at_zero:
+ left_half_arrow += [head_length / 2, 0]
+ # figure out the shape, and complete accordingly
+ if self._shape == 'left':
+ coords = left_half_arrow
+ else:
+ right_half_arrow = left_half_arrow * [1, -1]
+ if self._shape == 'right':
+ coords = right_half_arrow
+ elif self._shape == 'full':
+ # The half-arrows contain the midpoint of the stem,
+ # which we can omit from the full arrow. Including it
+ # twice caused a problem with xpdf.
+ coords = np.concatenate([left_half_arrow[:-1],
+ right_half_arrow[-2::-1]])
+ else:
+ raise ValueError(f"Got unknown shape: {self._shape!r}")
+ if distance != 0:
+ cx = self._dx / distance
+ sx = self._dy / distance
+ else:
+ # Account for division by zero
+ cx, sx = 0, 1
+ M = [[cx, sx], [-sx, cx]]
+ self.verts = np.dot(coords, M) + [
+ self._x + self._dx,
+ self._y + self._dy,
+ ]
+
+
+_docstring.interpd.register(
+ FancyArrow="\n".join(
+ (inspect.getdoc(FancyArrow.__init__) or "").splitlines()[2:]))
+
+
+class CirclePolygon(RegularPolygon):
+ """A polygon-approximation of a circle patch."""
+
+ def __str__(self):
+ s = "CirclePolygon((%g, %g), radius=%g, resolution=%d)"
+ return s % (self.xy[0], self.xy[1], self.radius, self.numvertices)
+
+ @_docstring.interpd
+ def __init__(self, xy, radius=5, *,
+ resolution=20, # the number of vertices
+ ** kwargs):
+ """
+ Create a circle at *xy* = (*x*, *y*) with given *radius*.
+
+ This circle is approximated by a regular polygon with *resolution*
+ sides. For a smoother circle drawn with splines, see `Circle`.
+
+ Valid keyword arguments are:
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__(
+ xy, resolution, radius=radius, orientation=0, **kwargs)
+
+
+class Ellipse(Patch):
+ """A scale-free ellipse."""
+
+ def __str__(self):
+ pars = (self._center[0], self._center[1],
+ self.width, self.height, self.angle)
+ fmt = "Ellipse(xy=(%s, %s), width=%s, height=%s, angle=%s)"
+ return fmt % pars
+
+ @_docstring.interpd
+ def __init__(self, xy, width, height, *, angle=0, **kwargs):
+ """
+ Parameters
+ ----------
+ xy : (float, float)
+ xy coordinates of ellipse centre.
+ width : float
+ Total length (diameter) of horizontal axis.
+ height : float
+ Total length (diameter) of vertical axis.
+ angle : float, default: 0
+ Rotation in degrees anti-clockwise.
+
+ Notes
+ -----
+ Valid keyword arguments are:
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__(**kwargs)
+
+ self._center = xy
+ self._width, self._height = width, height
+ self._angle = angle
+ self._path = Path.unit_circle()
+ # Required for EllipseSelector with axes aspect ratio != 1
+ # The patch is defined in data coordinates and when changing the
+ # selector with square modifier and not in data coordinates, we need
+ # to correct for the aspect ratio difference between the data and
+ # display coordinate systems.
+ self._aspect_ratio_correction = 1.0
+ # Note: This cannot be calculated until this is added to an Axes
+ self._patch_transform = transforms.IdentityTransform()
+
+ def _recompute_transform(self):
+ """
+ Notes
+ -----
+ This cannot be called until after this has been added to an Axes,
+ otherwise unit conversion will fail. This makes it very important to
+ call the accessor method and not directly access the transformation
+ member variable.
+ """
+ center = (self.convert_xunits(self._center[0]),
+ self.convert_yunits(self._center[1]))
+ width = self.convert_xunits(self._width)
+ height = self.convert_yunits(self._height)
+ self._patch_transform = transforms.Affine2D() \
+ .scale(width * 0.5, height * 0.5 * self._aspect_ratio_correction) \
+ .rotate_deg(self.angle) \
+ .scale(1, 1 / self._aspect_ratio_correction) \
+ .translate(*center)
+
+ def get_path(self):
+ """Return the path of the ellipse."""
+ return self._path
+
+ def get_patch_transform(self):
+ self._recompute_transform()
+ return self._patch_transform
+
+ def set_center(self, xy):
+ """
+ Set the center of the ellipse.
+
+ Parameters
+ ----------
+ xy : (float, float)
+ """
+ self._center = xy
+ self.stale = True
+
+ def get_center(self):
+ """Return the center of the ellipse."""
+ return self._center
+
+ center = property(get_center, set_center)
+
+ def set_width(self, width):
+ """
+ Set the width of the ellipse.
+
+ Parameters
+ ----------
+ width : float
+ """
+ self._width = width
+ self.stale = True
+
+ def get_width(self):
+ """
+ Return the width of the ellipse.
+ """
+ return self._width
+
+ width = property(get_width, set_width)
+
+ def set_height(self, height):
+ """
+ Set the height of the ellipse.
+
+ Parameters
+ ----------
+ height : float
+ """
+ self._height = height
+ self.stale = True
+
+ def get_height(self):
+ """Return the height of the ellipse."""
+ return self._height
+
+ height = property(get_height, set_height)
+
+ def set_angle(self, angle):
+ """
+ Set the angle of the ellipse.
+
+ Parameters
+ ----------
+ angle : float
+ """
+ self._angle = angle
+ self.stale = True
+
+ def get_angle(self):
+ """Return the angle of the ellipse."""
+ return self._angle
+
+ angle = property(get_angle, set_angle)
+
+ def get_corners(self):
+ """
+ Return the corners of the ellipse bounding box.
+
+ The bounding box orientation is moving anti-clockwise from the
+ lower left corner defined before rotation.
+ """
+ return self.get_patch_transform().transform(
+ [(-1, -1), (1, -1), (1, 1), (-1, 1)])
+
+ def get_vertices(self):
+ """
+ Return the vertices coordinates of the ellipse.
+
+ The definition can be found `here `_
+
+ .. versionadded:: 3.8
+ """
+ if self.width < self.height:
+ ret = self.get_patch_transform().transform([(0, 1), (0, -1)])
+ else:
+ ret = self.get_patch_transform().transform([(1, 0), (-1, 0)])
+ return [tuple(x) for x in ret]
+
+ def get_co_vertices(self):
+ """
+ Return the co-vertices coordinates of the ellipse.
+
+ The definition can be found `here `_
+
+ .. versionadded:: 3.8
+ """
+ if self.width < self.height:
+ ret = self.get_patch_transform().transform([(1, 0), (-1, 0)])
+ else:
+ ret = self.get_patch_transform().transform([(0, 1), (0, -1)])
+ return [tuple(x) for x in ret]
+
+
+class Annulus(Patch):
+ """
+ An elliptical annulus.
+ """
+
+ @_docstring.interpd
+ def __init__(self, xy, r, width, angle=0.0, **kwargs):
+ """
+ Parameters
+ ----------
+ xy : (float, float)
+ xy coordinates of annulus centre.
+ r : float or (float, float)
+ The radius, or semi-axes:
+
+ - If float: radius of the outer circle.
+ - If two floats: semi-major and -minor axes of outer ellipse.
+ width : float
+ Width (thickness) of the annular ring. The width is measured inward
+ from the outer ellipse so that for the inner ellipse the semi-axes
+ are given by ``r - width``. *width* must be less than or equal to
+ the semi-minor axis.
+ angle : float, default: 0
+ Rotation angle in degrees (anti-clockwise from the positive
+ x-axis). Ignored for circular annuli (i.e., if *r* is a scalar).
+ **kwargs
+ Keyword arguments control the `Patch` properties:
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__(**kwargs)
+
+ self.set_radii(r)
+ self.center = xy
+ self.width = width
+ self.angle = angle
+ self._path = None
+
+ def __str__(self):
+ if self.a == self.b:
+ r = self.a
+ else:
+ r = (self.a, self.b)
+
+ return "Annulus(xy=(%s, %s), r=%s, width=%s, angle=%s)" % \
+ (*self.center, r, self.width, self.angle)
+
+ def set_center(self, xy):
+ """
+ Set the center of the annulus.
+
+ Parameters
+ ----------
+ xy : (float, float)
+ """
+ self._center = xy
+ self._path = None
+ self.stale = True
+
+ def get_center(self):
+ """Return the center of the annulus."""
+ return self._center
+
+ center = property(get_center, set_center)
+
+ def set_width(self, width):
+ """
+ Set the width (thickness) of the annulus ring.
+
+ The width is measured inwards from the outer ellipse.
+
+ Parameters
+ ----------
+ width : float
+ """
+ if width > min(self.a, self.b):
+ raise ValueError(
+ 'Width of annulus must be less than or equal to semi-minor axis')
+
+ self._width = width
+ self._path = None
+ self.stale = True
+
+ def get_width(self):
+ """Return the width (thickness) of the annulus ring."""
+ return self._width
+
+ width = property(get_width, set_width)
+
+ def set_angle(self, angle):
+ """
+ Set the tilt angle of the annulus.
+
+ Parameters
+ ----------
+ angle : float
+ """
+ self._angle = angle
+ self._path = None
+ self.stale = True
+
+ def get_angle(self):
+ """Return the angle of the annulus."""
+ return self._angle
+
+ angle = property(get_angle, set_angle)
+
+ def set_semimajor(self, a):
+ """
+ Set the semi-major axis *a* of the annulus.
+
+ Parameters
+ ----------
+ a : float
+ """
+ self.a = float(a)
+ self._path = None
+ self.stale = True
+
+ def set_semiminor(self, b):
+ """
+ Set the semi-minor axis *b* of the annulus.
+
+ Parameters
+ ----------
+ b : float
+ """
+ self.b = float(b)
+ self._path = None
+ self.stale = True
+
+ def set_radii(self, r):
+ """
+ Set the semi-major (*a*) and semi-minor radii (*b*) of the annulus.
+
+ Parameters
+ ----------
+ r : float or (float, float)
+ The radius, or semi-axes:
+
+ - If float: radius of the outer circle.
+ - If two floats: semi-major and -minor axes of outer ellipse.
+ """
+ if np.shape(r) == (2,):
+ self.a, self.b = r
+ elif np.shape(r) == ():
+ self.a = self.b = float(r)
+ else:
+ raise ValueError("Parameter 'r' must be one or two floats.")
+
+ self._path = None
+ self.stale = True
+
+ def get_radii(self):
+ """Return the semi-major and semi-minor radii of the annulus."""
+ return self.a, self.b
+
+ radii = property(get_radii, set_radii)
+
+ def _transform_verts(self, verts, a, b):
+ return transforms.Affine2D() \
+ .scale(*self._convert_xy_units((a, b))) \
+ .rotate_deg(self.angle) \
+ .translate(*self._convert_xy_units(self.center)) \
+ .transform(verts)
+
+ def _recompute_path(self):
+ # circular arc
+ arc = Path.arc(0, 360)
+
+ # annulus needs to draw an outer ring
+ # followed by a reversed and scaled inner ring
+ a, b, w = self.a, self.b, self.width
+ v1 = self._transform_verts(arc.vertices, a, b)
+ v2 = self._transform_verts(arc.vertices[::-1], a - w, b - w)
+ v = np.vstack([v1, v2, v1[0, :], (0, 0)])
+ c = np.hstack([arc.codes, Path.MOVETO,
+ arc.codes[1:], Path.MOVETO,
+ Path.CLOSEPOLY])
+ self._path = Path(v, c)
+
+ def get_path(self):
+ if self._path is None:
+ self._recompute_path()
+ return self._path
+
+
+class Circle(Ellipse):
+ """
+ A circle patch.
+ """
+ def __str__(self):
+ pars = self.center[0], self.center[1], self.radius
+ fmt = "Circle(xy=(%g, %g), radius=%g)"
+ return fmt % pars
+
+ @_docstring.interpd
+ def __init__(self, xy, radius=5, **kwargs):
+ """
+ Create a true circle at center *xy* = (*x*, *y*) with given *radius*.
+
+ Unlike `CirclePolygon` which is a polygonal approximation, this uses
+ Bezier splines and is much closer to a scale-free circle.
+
+ Valid keyword arguments are:
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__(xy, radius * 2, radius * 2, **kwargs)
+ self.radius = radius
+
+ def set_radius(self, radius):
+ """
+ Set the radius of the circle.
+
+ Parameters
+ ----------
+ radius : float
+ """
+ self.width = self.height = 2 * radius
+ self.stale = True
+
+ def get_radius(self):
+ """Return the radius of the circle."""
+ return self.width / 2.
+
+ radius = property(get_radius, set_radius)
+
+
+class Arc(Ellipse):
+ """
+ An elliptical arc, i.e. a segment of an ellipse.
+
+ Due to internal optimizations, the arc cannot be filled.
+ """
+
+ def __str__(self):
+ pars = (self.center[0], self.center[1], self.width,
+ self.height, self.angle, self.theta1, self.theta2)
+ fmt = ("Arc(xy=(%g, %g), width=%g, "
+ "height=%g, angle=%g, theta1=%g, theta2=%g)")
+ return fmt % pars
+
+ @_docstring.interpd
+ def __init__(self, xy, width, height, *,
+ angle=0.0, theta1=0.0, theta2=360.0, **kwargs):
+ """
+ Parameters
+ ----------
+ xy : (float, float)
+ The center of the ellipse.
+
+ width : float
+ The length of the horizontal axis.
+
+ height : float
+ The length of the vertical axis.
+
+ angle : float
+ Rotation of the ellipse in degrees (counterclockwise).
+
+ theta1, theta2 : float, default: 0, 360
+ Starting and ending angles of the arc in degrees. These values
+ are relative to *angle*, e.g. if *angle* = 45 and *theta1* = 90
+ the absolute starting angle is 135.
+ Default *theta1* = 0, *theta2* = 360, i.e. a complete ellipse.
+ The arc is drawn in the counterclockwise direction.
+ Angles greater than or equal to 360, or smaller than 0, are
+ represented by an equivalent angle in the range [0, 360), by
+ taking the input value mod 360.
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.patches.Patch` properties
+ Most `.Patch` properties are supported as keyword arguments,
+ except *fill* and *facecolor* because filling is not supported.
+
+ %(Patch:kwdoc)s
+ """
+ fill = kwargs.setdefault('fill', False)
+ if fill:
+ raise ValueError("Arc objects cannot be filled")
+
+ super().__init__(xy, width, height, angle=angle, **kwargs)
+
+ self.theta1 = theta1
+ self.theta2 = theta2
+ (self._theta1, self._theta2, self._stretched_width,
+ self._stretched_height) = self._theta_stretch()
+ self._path = Path.arc(self._theta1, self._theta2)
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ """
+ Draw the arc to the given *renderer*.
+
+ Notes
+ -----
+ Ellipses are normally drawn using an approximation that uses
+ eight cubic Bezier splines. The error of this approximation
+ is 1.89818e-6, according to this unverified source:
+
+ Lancaster, Don. *Approximating a Circle or an Ellipse Using
+ Four Bezier Cubic Splines.*
+
+ https://www.tinaja.com/glib/ellipse4.pdf
+
+ There is a use case where very large ellipses must be drawn
+ with very high accuracy, and it is too expensive to render the
+ entire ellipse with enough segments (either splines or line
+ segments). Therefore, in the case where either radius of the
+ ellipse is large enough that the error of the spline
+ approximation will be visible (greater than one pixel offset
+ from the ideal), a different technique is used.
+
+ In that case, only the visible parts of the ellipse are drawn,
+ with each visible arc using a fixed number of spline segments
+ (8). The algorithm proceeds as follows:
+
+ 1. The points where the ellipse intersects the axes (or figure)
+ bounding box are located. (This is done by performing an inverse
+ transformation on the bbox such that it is relative to the unit
+ circle -- this makes the intersection calculation much easier than
+ doing rotated ellipse intersection directly.)
+
+ This uses the "line intersecting a circle" algorithm from:
+
+ Vince, John. *Geometry for Computer Graphics: Formulae,
+ Examples & Proofs.* London: Springer-Verlag, 2005.
+
+ 2. The angles of each of the intersection points are calculated.
+
+ 3. Proceeding counterclockwise starting in the positive
+ x-direction, each of the visible arc-segments between the
+ pairs of vertices are drawn using the Bezier arc
+ approximation technique implemented in `.Path.arc`.
+ """
+ if not self.get_visible():
+ return
+
+ self._recompute_transform()
+
+ self._update_path()
+ # Get width and height in pixels we need to use
+ # `self.get_data_transform` rather than `self.get_transform`
+ # because we want the transform from dataspace to the
+ # screen space to estimate how big the arc will be in physical
+ # units when rendered (the transform that we get via
+ # `self.get_transform()` goes from an idealized unit-radius
+ # space to screen space).
+ data_to_screen_trans = self.get_data_transform()
+ pwidth, pheight = (
+ data_to_screen_trans.transform((self._stretched_width,
+ self._stretched_height)) -
+ data_to_screen_trans.transform((0, 0)))
+ inv_error = (1.0 / 1.89818e-6) * 0.5
+
+ if pwidth < inv_error and pheight < inv_error:
+ return Patch.draw(self, renderer)
+
+ def line_circle_intersect(x0, y0, x1, y1):
+ dx = x1 - x0
+ dy = y1 - y0
+ dr2 = dx * dx + dy * dy
+ D = x0 * y1 - x1 * y0
+ D2 = D * D
+ discrim = dr2 - D2
+ if discrim >= 0.0:
+ sign_dy = np.copysign(1, dy) # +/-1, never 0.
+ sqrt_discrim = np.sqrt(discrim)
+ return np.array(
+ [[(D * dy + sign_dy * dx * sqrt_discrim) / dr2,
+ (-D * dx + abs(dy) * sqrt_discrim) / dr2],
+ [(D * dy - sign_dy * dx * sqrt_discrim) / dr2,
+ (-D * dx - abs(dy) * sqrt_discrim) / dr2]])
+ else:
+ return np.empty((0, 2))
+
+ def segment_circle_intersect(x0, y0, x1, y1):
+ epsilon = 1e-9
+ if x1 < x0:
+ x0e, x1e = x1, x0
+ else:
+ x0e, x1e = x0, x1
+ if y1 < y0:
+ y0e, y1e = y1, y0
+ else:
+ y0e, y1e = y0, y1
+ xys = line_circle_intersect(x0, y0, x1, y1)
+ xs, ys = xys.T
+ return xys[
+ (x0e - epsilon < xs) & (xs < x1e + epsilon)
+ & (y0e - epsilon < ys) & (ys < y1e + epsilon)
+ ]
+
+ # Transform the Axes (or figure) box_path so that it is relative to
+ # the unit circle in the same way that it is relative to the desired
+ # ellipse.
+ box_path_transform = (
+ transforms.BboxTransformTo((self.axes or self.get_figure(root=False)).bbox)
+ - self.get_transform())
+ box_path = Path.unit_rectangle().transformed(box_path_transform)
+
+ thetas = set()
+ # For each of the point pairs, there is a line segment
+ for p0, p1 in zip(box_path.vertices[:-1], box_path.vertices[1:]):
+ xy = segment_circle_intersect(*p0, *p1)
+ x, y = xy.T
+ # arctan2 return [-pi, pi), the rest of our angles are in
+ # [0, 360], adjust as needed.
+ theta = (np.rad2deg(np.arctan2(y, x)) + 360) % 360
+ thetas.update(
+ theta[(self._theta1 < theta) & (theta < self._theta2)])
+ thetas = sorted(thetas) + [self._theta2]
+ last_theta = self._theta1
+ theta1_rad = np.deg2rad(self._theta1)
+ inside = box_path.contains_point(
+ (np.cos(theta1_rad), np.sin(theta1_rad))
+ )
+
+ # save original path
+ path_original = self._path
+ for theta in thetas:
+ if inside:
+ self._path = Path.arc(last_theta, theta, 8)
+ Patch.draw(self, renderer)
+ inside = False
+ else:
+ inside = True
+ last_theta = theta
+
+ # restore original path
+ self._path = path_original
+
+ def _update_path(self):
+ # Compute new values and update and set new _path if any value changed
+ stretched = self._theta_stretch()
+ if any(a != b for a, b in zip(
+ stretched, (self._theta1, self._theta2, self._stretched_width,
+ self._stretched_height))):
+ (self._theta1, self._theta2, self._stretched_width,
+ self._stretched_height) = stretched
+ self._path = Path.arc(self._theta1, self._theta2)
+
+ def _theta_stretch(self):
+ # If the width and height of ellipse are not equal, take into account
+ # stretching when calculating angles to draw between
+ def theta_stretch(theta, scale):
+ theta = np.deg2rad(theta)
+ x = np.cos(theta)
+ y = np.sin(theta)
+ stheta = np.rad2deg(np.arctan2(scale * y, x))
+ # arctan2 has the range [-pi, pi], we expect [0, 2*pi]
+ return (stheta + 360) % 360
+
+ width = self.convert_xunits(self.width)
+ height = self.convert_yunits(self.height)
+ if (
+ # if we need to stretch the angles because we are distorted
+ width != height
+ # and we are not doing a full circle.
+ #
+ # 0 and 360 do not exactly round-trip through the angle
+ # stretching (due to both float precision limitations and
+ # the difference between the range of arctan2 [-pi, pi] and
+ # this method [0, 360]) so avoid doing it if we don't have to.
+ and not (self.theta1 != self.theta2 and
+ self.theta1 % 360 == self.theta2 % 360)
+ ):
+ theta1 = theta_stretch(self.theta1, width / height)
+ theta2 = theta_stretch(self.theta2, width / height)
+ return theta1, theta2, width, height
+ return self.theta1, self.theta2, width, height
+
+
+def bbox_artist(artist, renderer, props=None, fill=True):
+ """
+ A debug function to draw a rectangle around the bounding
+ box returned by an artist's `.Artist.get_window_extent`
+ to test whether the artist is returning the correct bbox.
+
+ *props* is a dict of rectangle props with the additional property
+ 'pad' that sets the padding around the bbox in points.
+ """
+ if props is None:
+ props = {}
+ props = props.copy() # don't want to alter the pad externally
+ pad = props.pop('pad', 4)
+ pad = renderer.points_to_pixels(pad)
+ bbox = artist.get_window_extent(renderer)
+ r = Rectangle(
+ xy=(bbox.x0 - pad / 2, bbox.y0 - pad / 2),
+ width=bbox.width + pad, height=bbox.height + pad,
+ fill=fill, transform=transforms.IdentityTransform(), clip_on=False)
+ r.update(props)
+ r.draw(renderer)
+
+
+def draw_bbox(bbox, renderer, color='k', trans=None):
+ """
+ A debug function to draw a rectangle around the bounding
+ box returned by an artist's `.Artist.get_window_extent`
+ to test whether the artist is returning the correct bbox.
+ """
+ r = Rectangle(xy=bbox.p0, width=bbox.width, height=bbox.height,
+ edgecolor=color, fill=False, clip_on=False)
+ if trans is not None:
+ r.set_transform(trans)
+ r.draw(renderer)
+
+
+class _Style:
+ """
+ A base class for the Styles. It is meant to be a container class,
+ where actual styles are declared as subclass of it, and it
+ provides some helper functions.
+ """
+
+ def __init_subclass__(cls):
+ # Automatically perform docstring interpolation on the subclasses:
+ # This allows listing the supported styles via
+ # - %(BoxStyle:table)s
+ # - %(ConnectionStyle:table)s
+ # - %(ArrowStyle:table)s
+ # and additionally adding .. ACCEPTS: blocks via
+ # - %(BoxStyle:table_and_accepts)s
+ # - %(ConnectionStyle:table_and_accepts)s
+ # - %(ArrowStyle:table_and_accepts)s
+ _docstring.interpd.register(**{
+ f"{cls.__name__}:table": cls.pprint_styles(),
+ f"{cls.__name__}:table_and_accepts": (
+ cls.pprint_styles()
+ + "\n\n .. ACCEPTS: ["
+ + "|".join(map(" '{}' ".format, cls._style_list))
+ + "]")
+ })
+
+ def __new__(cls, stylename, **kwargs):
+ """Return the instance of the subclass with the given style name."""
+ # The "class" should have the _style_list attribute, which is a mapping
+ # of style names to style classes.
+ _list = stylename.replace(" ", "").split(",")
+ _name = _list[0].lower()
+ try:
+ _cls = cls._style_list[_name]
+ except KeyError as err:
+ raise ValueError(f"Unknown style: {stylename!r}") from err
+ try:
+ _args_pair = [cs.split("=") for cs in _list[1:]]
+ _args = {k: float(v) for k, v in _args_pair}
+ except ValueError as err:
+ raise ValueError(
+ f"Incorrect style argument: {stylename!r}") from err
+ return _cls(**{**_args, **kwargs})
+
+ @classmethod
+ def get_styles(cls):
+ """Return a dictionary of available styles."""
+ return cls._style_list
+
+ @classmethod
+ def pprint_styles(cls):
+ """Return the available styles as pretty-printed string."""
+ table = [('Class', 'Name', 'Parameters'),
+ *[(cls.__name__,
+ # Add backquotes, as - and | have special meaning in reST.
+ f'``{name}``',
+ # [1:-1] drops the surrounding parentheses.
+ str(inspect.signature(cls))[1:-1] or 'None')
+ for name, cls in cls._style_list.items()]]
+ # Convert to rst table.
+ col_len = [max(len(cell) for cell in column) for column in zip(*table)]
+ table_formatstr = ' '.join('=' * cl for cl in col_len)
+ rst_table = '\n'.join([
+ '',
+ table_formatstr,
+ ' '.join(cell.ljust(cl) for cell, cl in zip(table[0], col_len)),
+ table_formatstr,
+ *[' '.join(cell.ljust(cl) for cell, cl in zip(row, col_len))
+ for row in table[1:]],
+ table_formatstr,
+ ])
+ return textwrap.indent(rst_table, prefix=' ' * 4)
+
+ @classmethod
+ @_api.deprecated(
+ '3.10.0',
+ message="This method is never used internally.",
+ alternative="No replacement. Please open an issue if you use this."
+ )
+ def register(cls, name, style):
+ """Register a new style."""
+ if not issubclass(style, cls._Base):
+ raise ValueError(f"{style} must be a subclass of {cls._Base}")
+ cls._style_list[name] = style
+
+
+def _register_style(style_list, cls=None, *, name=None):
+ """Class decorator that stashes a class in a (style) dictionary."""
+ if cls is None:
+ return functools.partial(_register_style, style_list, name=name)
+ style_list[name or cls.__name__.lower()] = cls
+ return cls
+
+
+@_docstring.interpd
+class BoxStyle(_Style):
+ """
+ `BoxStyle` is a container class which defines several
+ boxstyle classes, which are used for `FancyBboxPatch`.
+
+ A style object can be created as::
+
+ BoxStyle.Round(pad=0.2)
+
+ or::
+
+ BoxStyle("Round", pad=0.2)
+
+ or::
+
+ BoxStyle("Round, pad=0.2")
+
+ The following boxstyle classes are defined.
+
+ %(BoxStyle:table)s
+
+ An instance of a boxstyle class is a callable object, with the signature ::
+
+ __call__(self, x0, y0, width, height, mutation_size) -> Path
+
+ *x0*, *y0*, *width* and *height* specify the location and size of the box
+ to be drawn; *mutation_size* scales the outline properties such as padding.
+ """
+
+ _style_list = {}
+
+ @_register_style(_style_list)
+ class Square:
+ """A square box."""
+
+ def __init__(self, pad=0.3):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.3
+ The amount of padding around the original box.
+ """
+ self.pad = pad
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+ pad = mutation_size * self.pad
+ # width and height with padding added.
+ width, height = width + 2 * pad, height + 2 * pad
+ # boundary of the padded box
+ x0, y0 = x0 - pad, y0 - pad
+ x1, y1 = x0 + width, y0 + height
+ return Path._create_closed(
+ [(x0, y0), (x1, y0), (x1, y1), (x0, y1)])
+
+ @_register_style(_style_list)
+ class Circle:
+ """A circular box."""
+
+ def __init__(self, pad=0.3):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.3
+ The amount of padding around the original box.
+ """
+ self.pad = pad
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+ pad = mutation_size * self.pad
+ width, height = width + 2 * pad, height + 2 * pad
+ # boundary of the padded box
+ x0, y0 = x0 - pad, y0 - pad
+ return Path.circle((x0 + width / 2, y0 + height / 2),
+ max(width, height) / 2)
+
+ @_register_style(_style_list)
+ class Ellipse:
+ """
+ An elliptical box.
+
+ .. versionadded:: 3.7
+ """
+
+ def __init__(self, pad=0.3):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.3
+ The amount of padding around the original box.
+ """
+ self.pad = pad
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+ pad = mutation_size * self.pad
+ width, height = width + 2 * pad, height + 2 * pad
+ # boundary of the padded box
+ x0, y0 = x0 - pad, y0 - pad
+ a = width / math.sqrt(2)
+ b = height / math.sqrt(2)
+ trans = Affine2D().scale(a, b).translate(x0 + width / 2,
+ y0 + height / 2)
+ return trans.transform_path(Path.unit_circle())
+
+ @_register_style(_style_list)
+ class LArrow:
+ """A box in the shape of a left-pointing arrow."""
+
+ def __init__(self, pad=0.3):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.3
+ The amount of padding around the original box.
+ """
+ self.pad = pad
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+ # padding
+ pad = mutation_size * self.pad
+ # width and height with padding added.
+ width, height = width + 2 * pad, height + 2 * pad
+ # boundary of the padded box
+ x0, y0 = x0 - pad, y0 - pad,
+ x1, y1 = x0 + width, y0 + height
+
+ dx = (y1 - y0) / 2
+ dxx = dx / 2
+ x0 = x0 + pad / 1.4 # adjust by ~sqrt(2)
+
+ return Path._create_closed(
+ [(x0 + dxx, y0), (x1, y0), (x1, y1), (x0 + dxx, y1),
+ (x0 + dxx, y1 + dxx), (x0 - dx, y0 + dx),
+ (x0 + dxx, y0 - dxx), # arrow
+ (x0 + dxx, y0)])
+
+ @_register_style(_style_list)
+ class RArrow(LArrow):
+ """A box in the shape of a right-pointing arrow."""
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+ p = BoxStyle.LArrow.__call__(
+ self, x0, y0, width, height, mutation_size)
+ p.vertices[:, 0] = 2 * x0 + width - p.vertices[:, 0]
+ return p
+
+ @_register_style(_style_list)
+ class DArrow:
+ """A box in the shape of a two-way arrow."""
+ # Modified from LArrow to add a right arrow to the bbox.
+
+ def __init__(self, pad=0.3):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.3
+ The amount of padding around the original box.
+ """
+ self.pad = pad
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+ # padding
+ pad = mutation_size * self.pad
+ # width and height with padding added.
+ # The width is padded by the arrows, so we don't need to pad it.
+ height = height + 2 * pad
+ # boundary of the padded box
+ x0, y0 = x0 - pad, y0 - pad
+ x1, y1 = x0 + width, y0 + height
+
+ dx = (y1 - y0) / 2
+ dxx = dx / 2
+ x0 = x0 + pad / 1.4 # adjust by ~sqrt(2)
+
+ return Path._create_closed([
+ (x0 + dxx, y0), (x1, y0), # bot-segment
+ (x1, y0 - dxx), (x1 + dx + dxx, y0 + dx),
+ (x1, y1 + dxx), # right-arrow
+ (x1, y1), (x0 + dxx, y1), # top-segment
+ (x0 + dxx, y1 + dxx), (x0 - dx, y0 + dx),
+ (x0 + dxx, y0 - dxx), # left-arrow
+ (x0 + dxx, y0)])
+
+ @_register_style(_style_list)
+ class Round:
+ """A box with round corners."""
+
+ def __init__(self, pad=0.3, rounding_size=None):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.3
+ The amount of padding around the original box.
+ rounding_size : float, default: *pad*
+ Radius of the corners.
+ """
+ self.pad = pad
+ self.rounding_size = rounding_size
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+
+ # padding
+ pad = mutation_size * self.pad
+
+ # size of the rounding corner
+ if self.rounding_size:
+ dr = mutation_size * self.rounding_size
+ else:
+ dr = pad
+
+ width, height = width + 2 * pad, height + 2 * pad
+
+ x0, y0 = x0 - pad, y0 - pad,
+ x1, y1 = x0 + width, y0 + height
+
+ # Round corners are implemented as quadratic Bezier, e.g.,
+ # [(x0, y0-dr), (x0, y0), (x0+dr, y0)] for lower left corner.
+ cp = [(x0 + dr, y0),
+ (x1 - dr, y0),
+ (x1, y0), (x1, y0 + dr),
+ (x1, y1 - dr),
+ (x1, y1), (x1 - dr, y1),
+ (x0 + dr, y1),
+ (x0, y1), (x0, y1 - dr),
+ (x0, y0 + dr),
+ (x0, y0), (x0 + dr, y0),
+ (x0 + dr, y0)]
+
+ com = [Path.MOVETO,
+ Path.LINETO,
+ Path.CURVE3, Path.CURVE3,
+ Path.LINETO,
+ Path.CURVE3, Path.CURVE3,
+ Path.LINETO,
+ Path.CURVE3, Path.CURVE3,
+ Path.LINETO,
+ Path.CURVE3, Path.CURVE3,
+ Path.CLOSEPOLY]
+
+ return Path(cp, com)
+
+ @_register_style(_style_list)
+ class Round4:
+ """A box with rounded edges."""
+
+ def __init__(self, pad=0.3, rounding_size=None):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.3
+ The amount of padding around the original box.
+ rounding_size : float, default: *pad*/2
+ Rounding of edges.
+ """
+ self.pad = pad
+ self.rounding_size = rounding_size
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+
+ # padding
+ pad = mutation_size * self.pad
+
+ # Rounding size; defaults to half of the padding.
+ if self.rounding_size:
+ dr = mutation_size * self.rounding_size
+ else:
+ dr = pad / 2.
+
+ width = width + 2 * pad - 2 * dr
+ height = height + 2 * pad - 2 * dr
+
+ x0, y0 = x0 - pad + dr, y0 - pad + dr,
+ x1, y1 = x0 + width, y0 + height
+
+ cp = [(x0, y0),
+ (x0 + dr, y0 - dr), (x1 - dr, y0 - dr), (x1, y0),
+ (x1 + dr, y0 + dr), (x1 + dr, y1 - dr), (x1, y1),
+ (x1 - dr, y1 + dr), (x0 + dr, y1 + dr), (x0, y1),
+ (x0 - dr, y1 - dr), (x0 - dr, y0 + dr), (x0, y0),
+ (x0, y0)]
+
+ com = [Path.MOVETO,
+ Path.CURVE4, Path.CURVE4, Path.CURVE4,
+ Path.CURVE4, Path.CURVE4, Path.CURVE4,
+ Path.CURVE4, Path.CURVE4, Path.CURVE4,
+ Path.CURVE4, Path.CURVE4, Path.CURVE4,
+ Path.CLOSEPOLY]
+
+ return Path(cp, com)
+
+ @_register_style(_style_list)
+ class Sawtooth:
+ """A box with a sawtooth outline."""
+
+ def __init__(self, pad=0.3, tooth_size=None):
+ """
+ Parameters
+ ----------
+ pad : float, default: 0.3
+ The amount of padding around the original box.
+ tooth_size : float, default: *pad*/2
+ Size of the sawtooth.
+ """
+ self.pad = pad
+ self.tooth_size = tooth_size
+
+ def _get_sawtooth_vertices(self, x0, y0, width, height, mutation_size):
+
+ # padding
+ pad = mutation_size * self.pad
+
+ # size of sawtooth
+ if self.tooth_size is None:
+ tooth_size = self.pad * .5 * mutation_size
+ else:
+ tooth_size = self.tooth_size * mutation_size
+
+ hsz = tooth_size / 2
+ width = width + 2 * pad - tooth_size
+ height = height + 2 * pad - tooth_size
+
+ # the sizes of the vertical and horizontal sawtooth are
+ # separately adjusted to fit the given box size.
+ dsx_n = round((width - tooth_size) / (tooth_size * 2)) * 2
+ dsy_n = round((height - tooth_size) / (tooth_size * 2)) * 2
+
+ x0, y0 = x0 - pad + hsz, y0 - pad + hsz
+ x1, y1 = x0 + width, y0 + height
+
+ xs = [
+ x0, *np.linspace(x0 + hsz, x1 - hsz, 2 * dsx_n + 1), # bottom
+ *([x1, x1 + hsz, x1, x1 - hsz] * dsy_n)[:2*dsy_n+2], # right
+ x1, *np.linspace(x1 - hsz, x0 + hsz, 2 * dsx_n + 1), # top
+ *([x0, x0 - hsz, x0, x0 + hsz] * dsy_n)[:2*dsy_n+2], # left
+ ]
+ ys = [
+ *([y0, y0 - hsz, y0, y0 + hsz] * dsx_n)[:2*dsx_n+2], # bottom
+ y0, *np.linspace(y0 + hsz, y1 - hsz, 2 * dsy_n + 1), # right
+ *([y1, y1 + hsz, y1, y1 - hsz] * dsx_n)[:2*dsx_n+2], # top
+ y1, *np.linspace(y1 - hsz, y0 + hsz, 2 * dsy_n + 1), # left
+ ]
+
+ return [*zip(xs, ys), (xs[0], ys[0])]
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+ saw_vertices = self._get_sawtooth_vertices(x0, y0, width,
+ height, mutation_size)
+ return Path(saw_vertices, closed=True)
+
+ @_register_style(_style_list)
+ class Roundtooth(Sawtooth):
+ """A box with a rounded sawtooth outline."""
+
+ def __call__(self, x0, y0, width, height, mutation_size):
+ saw_vertices = self._get_sawtooth_vertices(x0, y0,
+ width, height,
+ mutation_size)
+ # Add a trailing vertex to allow us to close the polygon correctly
+ saw_vertices = np.concatenate([saw_vertices, [saw_vertices[0]]])
+ codes = ([Path.MOVETO] +
+ [Path.CURVE3, Path.CURVE3] * ((len(saw_vertices)-1)//2) +
+ [Path.CLOSEPOLY])
+ return Path(saw_vertices, codes)
+
+
+@_docstring.interpd
+class ConnectionStyle(_Style):
+ """
+ `ConnectionStyle` is a container class which defines
+ several connectionstyle classes, which is used to create a path
+ between two points. These are mainly used with `FancyArrowPatch`.
+
+ A connectionstyle object can be either created as::
+
+ ConnectionStyle.Arc3(rad=0.2)
+
+ or::
+
+ ConnectionStyle("Arc3", rad=0.2)
+
+ or::
+
+ ConnectionStyle("Arc3, rad=0.2")
+
+ The following classes are defined
+
+ %(ConnectionStyle:table)s
+
+ An instance of any connection style class is a callable object,
+ whose call signature is::
+
+ __call__(self, posA, posB,
+ patchA=None, patchB=None,
+ shrinkA=2., shrinkB=2.)
+
+ and it returns a `.Path` instance. *posA* and *posB* are
+ tuples of (x, y) coordinates of the two points to be
+ connected. *patchA* (or *patchB*) is given, the returned path is
+ clipped so that it start (or end) from the boundary of the
+ patch. The path is further shrunk by *shrinkA* (or *shrinkB*)
+ which is given in points.
+ """
+
+ _style_list = {}
+
+ class _Base:
+ """
+ A base class for connectionstyle classes. The subclass needs
+ to implement a *connect* method whose call signature is::
+
+ connect(posA, posB)
+
+ where posA and posB are tuples of x, y coordinates to be
+ connected. The method needs to return a path connecting two
+ points. This base class defines a __call__ method, and a few
+ helper methods.
+ """
+ def _in_patch(self, patch):
+ """
+ Return a predicate function testing whether a point *xy* is
+ contained in *patch*.
+ """
+ return lambda xy: patch.contains(
+ SimpleNamespace(x=xy[0], y=xy[1]))[0]
+
+ def _clip(self, path, in_start, in_stop):
+ """
+ Clip *path* at its start by the region where *in_start* returns
+ True, and at its stop by the region where *in_stop* returns True.
+
+ The original path is assumed to start in the *in_start* region and
+ to stop in the *in_stop* region.
+ """
+ if in_start:
+ try:
+ _, path = split_path_inout(path, in_start)
+ except ValueError:
+ pass
+ if in_stop:
+ try:
+ path, _ = split_path_inout(path, in_stop)
+ except ValueError:
+ pass
+ return path
+
+ def __call__(self, posA, posB,
+ shrinkA=2., shrinkB=2., patchA=None, patchB=None):
+ """
+ Call the *connect* method to create a path between *posA* and
+ *posB*; then clip and shrink the path.
+ """
+ path = self.connect(posA, posB)
+ path = self._clip(
+ path,
+ self._in_patch(patchA) if patchA else None,
+ self._in_patch(patchB) if patchB else None,
+ )
+ path = self._clip(
+ path,
+ inside_circle(*path.vertices[0], shrinkA) if shrinkA else None,
+ inside_circle(*path.vertices[-1], shrinkB) if shrinkB else None
+ )
+ return path
+
+ @_register_style(_style_list)
+ class Arc3(_Base):
+ """
+ Creates a simple quadratic BƩzier curve between two
+ points. The curve is created so that the middle control point
+ (C1) is located at the same distance from the start (C0) and
+ end points(C2) and the distance of the C1 to the line
+ connecting C0-C2 is *rad* times the distance of C0-C2.
+ """
+
+ def __init__(self, rad=0.):
+ """
+ Parameters
+ ----------
+ rad : float
+ Curvature of the curve.
+ """
+ self.rad = rad
+
+ def connect(self, posA, posB):
+ x1, y1 = posA
+ x2, y2 = posB
+ x12, y12 = (x1 + x2) / 2., (y1 + y2) / 2.
+ dx, dy = x2 - x1, y2 - y1
+
+ f = self.rad
+
+ cx, cy = x12 + f * dy, y12 - f * dx
+
+ vertices = [(x1, y1),
+ (cx, cy),
+ (x2, y2)]
+ codes = [Path.MOVETO,
+ Path.CURVE3,
+ Path.CURVE3]
+
+ return Path(vertices, codes)
+
+ @_register_style(_style_list)
+ class Angle3(_Base):
+ """
+ Creates a simple quadratic BƩzier curve between two points. The middle
+ control point is placed at the intersecting point of two lines which
+ cross the start and end point, and have a slope of *angleA* and
+ *angleB*, respectively.
+ """
+
+ def __init__(self, angleA=90, angleB=0):
+ """
+ Parameters
+ ----------
+ angleA : float
+ Starting angle of the path.
+
+ angleB : float
+ Ending angle of the path.
+ """
+
+ self.angleA = angleA
+ self.angleB = angleB
+
+ def connect(self, posA, posB):
+ x1, y1 = posA
+ x2, y2 = posB
+
+ cosA = math.cos(math.radians(self.angleA))
+ sinA = math.sin(math.radians(self.angleA))
+ cosB = math.cos(math.radians(self.angleB))
+ sinB = math.sin(math.radians(self.angleB))
+
+ cx, cy = get_intersection(x1, y1, cosA, sinA,
+ x2, y2, cosB, sinB)
+
+ vertices = [(x1, y1), (cx, cy), (x2, y2)]
+ codes = [Path.MOVETO, Path.CURVE3, Path.CURVE3]
+
+ return Path(vertices, codes)
+
+ @_register_style(_style_list)
+ class Angle(_Base):
+ """
+ Creates a piecewise continuous quadratic BƩzier path between two
+ points. The path has a one passing-through point placed at the
+ intersecting point of two lines which cross the start and end point,
+ and have a slope of *angleA* and *angleB*, respectively.
+ The connecting edges are rounded with *rad*.
+ """
+
+ def __init__(self, angleA=90, angleB=0, rad=0.):
+ """
+ Parameters
+ ----------
+ angleA : float
+ Starting angle of the path.
+
+ angleB : float
+ Ending angle of the path.
+
+ rad : float
+ Rounding radius of the edge.
+ """
+
+ self.angleA = angleA
+ self.angleB = angleB
+
+ self.rad = rad
+
+ def connect(self, posA, posB):
+ x1, y1 = posA
+ x2, y2 = posB
+
+ cosA = math.cos(math.radians(self.angleA))
+ sinA = math.sin(math.radians(self.angleA))
+ cosB = math.cos(math.radians(self.angleB))
+ sinB = math.sin(math.radians(self.angleB))
+
+ cx, cy = get_intersection(x1, y1, cosA, sinA,
+ x2, y2, cosB, sinB)
+
+ vertices = [(x1, y1)]
+ codes = [Path.MOVETO]
+
+ if self.rad == 0.:
+ vertices.append((cx, cy))
+ codes.append(Path.LINETO)
+ else:
+ dx1, dy1 = x1 - cx, y1 - cy
+ d1 = np.hypot(dx1, dy1)
+ f1 = self.rad / d1
+ dx2, dy2 = x2 - cx, y2 - cy
+ d2 = np.hypot(dx2, dy2)
+ f2 = self.rad / d2
+ vertices.extend([(cx + dx1 * f1, cy + dy1 * f1),
+ (cx, cy),
+ (cx + dx2 * f2, cy + dy2 * f2)])
+ codes.extend([Path.LINETO, Path.CURVE3, Path.CURVE3])
+
+ vertices.append((x2, y2))
+ codes.append(Path.LINETO)
+
+ return Path(vertices, codes)
+
+ @_register_style(_style_list)
+ class Arc(_Base):
+ """
+ Creates a piecewise continuous quadratic BƩzier path between two
+ points. The path can have two passing-through points, a
+ point placed at the distance of *armA* and angle of *angleA* from
+ point A, another point with respect to point B. The edges are
+ rounded with *rad*.
+ """
+
+ def __init__(self, angleA=0, angleB=0, armA=None, armB=None, rad=0.):
+ """
+ Parameters
+ ----------
+ angleA : float
+ Starting angle of the path.
+
+ angleB : float
+ Ending angle of the path.
+
+ armA : float or None
+ Length of the starting arm.
+
+ armB : float or None
+ Length of the ending arm.
+
+ rad : float
+ Rounding radius of the edges.
+ """
+
+ self.angleA = angleA
+ self.angleB = angleB
+ self.armA = armA
+ self.armB = armB
+
+ self.rad = rad
+
+ def connect(self, posA, posB):
+ x1, y1 = posA
+ x2, y2 = posB
+
+ vertices = [(x1, y1)]
+ rounded = []
+ codes = [Path.MOVETO]
+
+ if self.armA:
+ cosA = math.cos(math.radians(self.angleA))
+ sinA = math.sin(math.radians(self.angleA))
+ # x_armA, y_armB
+ d = self.armA - self.rad
+ rounded.append((x1 + d * cosA, y1 + d * sinA))
+ d = self.armA
+ rounded.append((x1 + d * cosA, y1 + d * sinA))
+
+ if self.armB:
+ cosB = math.cos(math.radians(self.angleB))
+ sinB = math.sin(math.radians(self.angleB))
+ x_armB, y_armB = x2 + self.armB * cosB, y2 + self.armB * sinB
+
+ if rounded:
+ xp, yp = rounded[-1]
+ dx, dy = x_armB - xp, y_armB - yp
+ dd = (dx * dx + dy * dy) ** .5
+
+ rounded.append((xp + self.rad * dx / dd,
+ yp + self.rad * dy / dd))
+ vertices.extend(rounded)
+ codes.extend([Path.LINETO,
+ Path.CURVE3,
+ Path.CURVE3])
+ else:
+ xp, yp = vertices[-1]
+ dx, dy = x_armB - xp, y_armB - yp
+ dd = (dx * dx + dy * dy) ** .5
+
+ d = dd - self.rad
+ rounded = [(xp + d * dx / dd, yp + d * dy / dd),
+ (x_armB, y_armB)]
+
+ if rounded:
+ xp, yp = rounded[-1]
+ dx, dy = x2 - xp, y2 - yp
+ dd = (dx * dx + dy * dy) ** .5
+
+ rounded.append((xp + self.rad * dx / dd,
+ yp + self.rad * dy / dd))
+ vertices.extend(rounded)
+ codes.extend([Path.LINETO,
+ Path.CURVE3,
+ Path.CURVE3])
+
+ vertices.append((x2, y2))
+ codes.append(Path.LINETO)
+
+ return Path(vertices, codes)
+
+ @_register_style(_style_list)
+ class Bar(_Base):
+ """
+ A line with *angle* between A and B with *armA* and *armB*. One of the
+ arms is extended so that they are connected in a right angle. The
+ length of *armA* is determined by (*armA* + *fraction* x AB distance).
+ Same for *armB*.
+ """
+
+ def __init__(self, armA=0., armB=0., fraction=0.3, angle=None):
+ """
+ Parameters
+ ----------
+ armA : float
+ Minimum length of armA.
+
+ armB : float
+ Minimum length of armB.
+
+ fraction : float
+ A fraction of the distance between two points that will be
+ added to armA and armB.
+
+ angle : float or None
+ Angle of the connecting line (if None, parallel to A and B).
+ """
+ self.armA = armA
+ self.armB = armB
+ self.fraction = fraction
+ self.angle = angle
+
+ def connect(self, posA, posB):
+ x1, y1 = posA
+ x20, y20 = x2, y2 = posB
+
+ theta1 = math.atan2(y2 - y1, x2 - x1)
+ dx, dy = x2 - x1, y2 - y1
+ dd = (dx * dx + dy * dy) ** .5
+ ddx, ddy = dx / dd, dy / dd
+
+ armA, armB = self.armA, self.armB
+
+ if self.angle is not None:
+ theta0 = np.deg2rad(self.angle)
+ dtheta = theta1 - theta0
+ dl = dd * math.sin(dtheta)
+ dL = dd * math.cos(dtheta)
+ x2, y2 = x1 + dL * math.cos(theta0), y1 + dL * math.sin(theta0)
+ armB = armB - dl
+
+ # update
+ dx, dy = x2 - x1, y2 - y1
+ dd2 = (dx * dx + dy * dy) ** .5
+ ddx, ddy = dx / dd2, dy / dd2
+
+ arm = max(armA, armB)
+ f = self.fraction * dd + arm
+
+ cx1, cy1 = x1 + f * ddy, y1 - f * ddx
+ cx2, cy2 = x2 + f * ddy, y2 - f * ddx
+
+ vertices = [(x1, y1),
+ (cx1, cy1),
+ (cx2, cy2),
+ (x20, y20)]
+ codes = [Path.MOVETO,
+ Path.LINETO,
+ Path.LINETO,
+ Path.LINETO]
+
+ return Path(vertices, codes)
+
+
+def _point_along_a_line(x0, y0, x1, y1, d):
+ """
+ Return the point on the line connecting (*x0*, *y0*) -- (*x1*, *y1*) whose
+ distance from (*x0*, *y0*) is *d*.
+ """
+ dx, dy = x0 - x1, y0 - y1
+ ff = d / (dx * dx + dy * dy) ** .5
+ x2, y2 = x0 - ff * dx, y0 - ff * dy
+
+ return x2, y2
+
+
+@_docstring.interpd
+class ArrowStyle(_Style):
+ """
+ `ArrowStyle` is a container class which defines several
+ arrowstyle classes, which is used to create an arrow path along a
+ given path. These are mainly used with `FancyArrowPatch`.
+
+ An arrowstyle object can be either created as::
+
+ ArrowStyle.Fancy(head_length=.4, head_width=.4, tail_width=.4)
+
+ or::
+
+ ArrowStyle("Fancy", head_length=.4, head_width=.4, tail_width=.4)
+
+ or::
+
+ ArrowStyle("Fancy, head_length=.4, head_width=.4, tail_width=.4")
+
+ The following classes are defined
+
+ %(ArrowStyle:table)s
+
+ For an overview of the visual appearance, see
+ :doc:`/gallery/text_labels_and_annotations/fancyarrow_demo`.
+
+ An instance of any arrow style class is a callable object,
+ whose call signature is::
+
+ __call__(self, path, mutation_size, linewidth, aspect_ratio=1.)
+
+ and it returns a tuple of a `.Path` instance and a boolean
+ value. *path* is a `.Path` instance along which the arrow
+ will be drawn. *mutation_size* and *aspect_ratio* have the same
+ meaning as in `BoxStyle`. *linewidth* is a line width to be
+ stroked. This is meant to be used to correct the location of the
+ head so that it does not overshoot the destination point, but not all
+ classes support it.
+
+ Notes
+ -----
+ *angleA* and *angleB* specify the orientation of the bracket, as either a
+ clockwise or counterclockwise angle depending on the arrow type. 0 degrees
+ means perpendicular to the line connecting the arrow's head and tail.
+
+ .. plot:: gallery/text_labels_and_annotations/angles_on_bracket_arrows.py
+ """
+
+ _style_list = {}
+
+ class _Base:
+ """
+ Arrow Transmuter Base class
+
+ ArrowTransmuterBase and its derivatives are used to make a fancy
+ arrow around a given path. The __call__ method returns a path
+ (which will be used to create a PathPatch instance) and a boolean
+ value indicating the path is open therefore is not fillable. This
+ class is not an artist and actual drawing of the fancy arrow is
+ done by the FancyArrowPatch class.
+ """
+
+ # The derived classes are required to be able to be initialized
+ # w/o arguments, i.e., all its argument (except self) must have
+ # the default values.
+
+ @staticmethod
+ def ensure_quadratic_bezier(path):
+ """
+ Some ArrowStyle classes only works with a simple quadratic
+ BƩzier curve (created with `.ConnectionStyle.Arc3` or
+ `.ConnectionStyle.Angle3`). This static method checks if the
+ provided path is a simple quadratic BƩzier curve and returns its
+ control points if true.
+ """
+ segments = list(path.iter_segments())
+ if (len(segments) != 2 or segments[0][1] != Path.MOVETO or
+ segments[1][1] != Path.CURVE3):
+ raise ValueError(
+ "'path' is not a valid quadratic Bezier curve")
+ return [*segments[0][0], *segments[1][0]]
+
+ def transmute(self, path, mutation_size, linewidth):
+ """
+ The transmute method is the very core of the ArrowStyle class and
+ must be overridden in the subclasses. It receives the *path*
+ object along which the arrow will be drawn, and the
+ *mutation_size*, with which the arrow head etc. will be scaled.
+ The *linewidth* may be used to adjust the path so that it does not
+ pass beyond the given points. It returns a tuple of a `.Path`
+ instance and a boolean. The boolean value indicate whether the
+ path can be filled or not. The return value can also be a list of
+ paths and list of booleans of the same length.
+ """
+ raise NotImplementedError('Derived must override')
+
+ def __call__(self, path, mutation_size, linewidth,
+ aspect_ratio=1.):
+ """
+ The __call__ method is a thin wrapper around the transmute method
+ and takes care of the aspect ratio.
+ """
+
+ if aspect_ratio is not None:
+ # Squeeze the given height by the aspect_ratio
+ vertices = path.vertices / [1, aspect_ratio]
+ path_shrunk = Path(vertices, path.codes)
+ # call transmute method with squeezed height.
+ path_mutated, fillable = self.transmute(path_shrunk,
+ mutation_size,
+ linewidth)
+ if np.iterable(fillable):
+ # Restore the height
+ path_list = [Path(p.vertices * [1, aspect_ratio], p.codes)
+ for p in path_mutated]
+ return path_list, fillable
+ else:
+ return path_mutated, fillable
+ else:
+ return self.transmute(path, mutation_size, linewidth)
+
+ class _Curve(_Base):
+ """
+ A simple arrow which will work with any path instance. The
+ returned path is the concatenation of the original path, and at
+ most two paths representing the arrow head or bracket at the start
+ point and at the end point. The arrow heads can be either open
+ or closed.
+ """
+
+ arrow = "-"
+ fillbegin = fillend = False # Whether arrows are filled.
+
+ def __init__(self, head_length=.4, head_width=.2, widthA=1., widthB=1.,
+ lengthA=0.2, lengthB=0.2, angleA=0, angleB=0, scaleA=None,
+ scaleB=None):
+ """
+ Parameters
+ ----------
+ head_length : float, default: 0.4
+ Length of the arrow head, relative to *mutation_size*.
+ head_width : float, default: 0.2
+ Width of the arrow head, relative to *mutation_size*.
+ widthA, widthB : float, default: 1.0
+ Width of the bracket.
+ lengthA, lengthB : float, default: 0.2
+ Length of the bracket.
+ angleA, angleB : float, default: 0
+ Orientation of the bracket, as a counterclockwise angle.
+ 0 degrees means perpendicular to the line.
+ scaleA, scaleB : float, default: *mutation_size*
+ The scale of the brackets.
+ """
+
+ self.head_length, self.head_width = head_length, head_width
+ self.widthA, self.widthB = widthA, widthB
+ self.lengthA, self.lengthB = lengthA, lengthB
+ self.angleA, self.angleB = angleA, angleB
+ self.scaleA, self.scaleB = scaleA, scaleB
+
+ self._beginarrow_head = False
+ self._beginarrow_bracket = False
+ self._endarrow_head = False
+ self._endarrow_bracket = False
+
+ if "-" not in self.arrow:
+ raise ValueError("arrow must have the '-' between "
+ "the two heads")
+
+ beginarrow, endarrow = self.arrow.split("-", 1)
+
+ if beginarrow == "<":
+ self._beginarrow_head = True
+ self._beginarrow_bracket = False
+ elif beginarrow == "<|":
+ self._beginarrow_head = True
+ self._beginarrow_bracket = False
+ self.fillbegin = True
+ elif beginarrow in ("]", "|"):
+ self._beginarrow_head = False
+ self._beginarrow_bracket = True
+
+ if endarrow == ">":
+ self._endarrow_head = True
+ self._endarrow_bracket = False
+ elif endarrow == "|>":
+ self._endarrow_head = True
+ self._endarrow_bracket = False
+ self.fillend = True
+ elif endarrow in ("[", "|"):
+ self._endarrow_head = False
+ self._endarrow_bracket = True
+
+ super().__init__()
+
+ def _get_arrow_wedge(self, x0, y0, x1, y1,
+ head_dist, cos_t, sin_t, linewidth):
+ """
+ Return the paths for arrow heads. Since arrow lines are
+ drawn with capstyle=projected, The arrow goes beyond the
+ desired point. This method also returns the amount of the path
+ to be shrunken so that it does not overshoot.
+ """
+
+ # arrow from x0, y0 to x1, y1
+ dx, dy = x0 - x1, y0 - y1
+
+ cp_distance = np.hypot(dx, dy)
+
+ # pad_projected : amount of pad to account the
+ # overshooting of the projection of the wedge
+ pad_projected = (.5 * linewidth / sin_t)
+
+ # Account for division by zero
+ if cp_distance == 0:
+ cp_distance = 1
+
+ # apply pad for projected edge
+ ddx = pad_projected * dx / cp_distance
+ ddy = pad_projected * dy / cp_distance
+
+ # offset for arrow wedge
+ dx = dx / cp_distance * head_dist
+ dy = dy / cp_distance * head_dist
+
+ dx1, dy1 = cos_t * dx + sin_t * dy, -sin_t * dx + cos_t * dy
+ dx2, dy2 = cos_t * dx - sin_t * dy, sin_t * dx + cos_t * dy
+
+ vertices_arrow = [(x1 + ddx + dx1, y1 + ddy + dy1),
+ (x1 + ddx, y1 + ddy),
+ (x1 + ddx + dx2, y1 + ddy + dy2)]
+ codes_arrow = [Path.MOVETO,
+ Path.LINETO,
+ Path.LINETO]
+
+ return vertices_arrow, codes_arrow, ddx, ddy
+
+ def _get_bracket(self, x0, y0,
+ x1, y1, width, length, angle):
+
+ cos_t, sin_t = get_cos_sin(x1, y1, x0, y0)
+
+ # arrow from x0, y0 to x1, y1
+ from matplotlib.bezier import get_normal_points
+ x1, y1, x2, y2 = get_normal_points(x0, y0, cos_t, sin_t, width)
+
+ dx, dy = length * cos_t, length * sin_t
+
+ vertices_arrow = [(x1 + dx, y1 + dy),
+ (x1, y1),
+ (x2, y2),
+ (x2 + dx, y2 + dy)]
+ codes_arrow = [Path.MOVETO,
+ Path.LINETO,
+ Path.LINETO,
+ Path.LINETO]
+
+ if angle:
+ trans = transforms.Affine2D().rotate_deg_around(x0, y0, angle)
+ vertices_arrow = trans.transform(vertices_arrow)
+
+ return vertices_arrow, codes_arrow
+
+ def transmute(self, path, mutation_size, linewidth):
+ # docstring inherited
+ if self._beginarrow_head or self._endarrow_head:
+ head_length = self.head_length * mutation_size
+ head_width = self.head_width * mutation_size
+ head_dist = np.hypot(head_length, head_width)
+ cos_t, sin_t = head_length / head_dist, head_width / head_dist
+
+ scaleA = mutation_size if self.scaleA is None else self.scaleA
+ scaleB = mutation_size if self.scaleB is None else self.scaleB
+
+ # begin arrow
+ x0, y0 = path.vertices[0]
+ x1, y1 = path.vertices[1]
+
+ # If there is no room for an arrow and a line, then skip the arrow
+ has_begin_arrow = self._beginarrow_head and (x0, y0) != (x1, y1)
+ verticesA, codesA, ddxA, ddyA = (
+ self._get_arrow_wedge(x1, y1, x0, y0,
+ head_dist, cos_t, sin_t, linewidth)
+ if has_begin_arrow
+ else ([], [], 0, 0)
+ )
+
+ # end arrow
+ x2, y2 = path.vertices[-2]
+ x3, y3 = path.vertices[-1]
+
+ # If there is no room for an arrow and a line, then skip the arrow
+ has_end_arrow = self._endarrow_head and (x2, y2) != (x3, y3)
+ verticesB, codesB, ddxB, ddyB = (
+ self._get_arrow_wedge(x2, y2, x3, y3,
+ head_dist, cos_t, sin_t, linewidth)
+ if has_end_arrow
+ else ([], [], 0, 0)
+ )
+
+ # This simple code will not work if ddx, ddy is greater than the
+ # separation between vertices.
+ paths = [Path(np.concatenate([[(x0 + ddxA, y0 + ddyA)],
+ path.vertices[1:-1],
+ [(x3 + ddxB, y3 + ddyB)]]),
+ path.codes)]
+ fills = [False]
+
+ if has_begin_arrow:
+ if self.fillbegin:
+ paths.append(
+ Path([*verticesA, (0, 0)], [*codesA, Path.CLOSEPOLY]))
+ fills.append(True)
+ else:
+ paths.append(Path(verticesA, codesA))
+ fills.append(False)
+ elif self._beginarrow_bracket:
+ x0, y0 = path.vertices[0]
+ x1, y1 = path.vertices[1]
+ verticesA, codesA = self._get_bracket(x0, y0, x1, y1,
+ self.widthA * scaleA,
+ self.lengthA * scaleA,
+ self.angleA)
+
+ paths.append(Path(verticesA, codesA))
+ fills.append(False)
+
+ if has_end_arrow:
+ if self.fillend:
+ fills.append(True)
+ paths.append(
+ Path([*verticesB, (0, 0)], [*codesB, Path.CLOSEPOLY]))
+ else:
+ fills.append(False)
+ paths.append(Path(verticesB, codesB))
+ elif self._endarrow_bracket:
+ x0, y0 = path.vertices[-1]
+ x1, y1 = path.vertices[-2]
+ verticesB, codesB = self._get_bracket(x0, y0, x1, y1,
+ self.widthB * scaleB,
+ self.lengthB * scaleB,
+ self.angleB)
+
+ paths.append(Path(verticesB, codesB))
+ fills.append(False)
+
+ return paths, fills
+
+ @_register_style(_style_list, name="-")
+ class Curve(_Curve):
+ """A simple curve without any arrow head."""
+
+ def __init__(self): # hide head_length, head_width
+ # These attributes (whose values come from backcompat) only matter
+ # if someone modifies beginarrow/etc. on an ArrowStyle instance.
+ super().__init__(head_length=.2, head_width=.1)
+
+ @_register_style(_style_list, name="<-")
+ class CurveA(_Curve):
+ """An arrow with a head at its start point."""
+ arrow = "<-"
+
+ @_register_style(_style_list, name="->")
+ class CurveB(_Curve):
+ """An arrow with a head at its end point."""
+ arrow = "->"
+
+ @_register_style(_style_list, name="<->")
+ class CurveAB(_Curve):
+ """An arrow with heads both at the start and the end point."""
+ arrow = "<->"
+
+ @_register_style(_style_list, name="<|-")
+ class CurveFilledA(_Curve):
+ """An arrow with filled triangle head at the start."""
+ arrow = "<|-"
+
+ @_register_style(_style_list, name="-|>")
+ class CurveFilledB(_Curve):
+ """An arrow with filled triangle head at the end."""
+ arrow = "-|>"
+
+ @_register_style(_style_list, name="<|-|>")
+ class CurveFilledAB(_Curve):
+ """An arrow with filled triangle heads at both ends."""
+ arrow = "<|-|>"
+
+ @_register_style(_style_list, name="]-")
+ class BracketA(_Curve):
+ """An arrow with an outward square bracket at its start."""
+ arrow = "]-"
+
+ def __init__(self, widthA=1., lengthA=0.2, angleA=0):
+ """
+ Parameters
+ ----------
+ widthA : float, default: 1.0
+ Width of the bracket.
+ lengthA : float, default: 0.2
+ Length of the bracket.
+ angleA : float, default: 0 degrees
+ Orientation of the bracket, as a counterclockwise angle.
+ 0 degrees means perpendicular to the line.
+ """
+ super().__init__(widthA=widthA, lengthA=lengthA, angleA=angleA)
+
+ @_register_style(_style_list, name="-[")
+ class BracketB(_Curve):
+ """An arrow with an outward square bracket at its end."""
+ arrow = "-["
+
+ def __init__(self, widthB=1., lengthB=0.2, angleB=0):
+ """
+ Parameters
+ ----------
+ widthB : float, default: 1.0
+ Width of the bracket.
+ lengthB : float, default: 0.2
+ Length of the bracket.
+ angleB : float, default: 0 degrees
+ Orientation of the bracket, as a counterclockwise angle.
+ 0 degrees means perpendicular to the line.
+ """
+ super().__init__(widthB=widthB, lengthB=lengthB, angleB=angleB)
+
+ @_register_style(_style_list, name="]-[")
+ class BracketAB(_Curve):
+ """An arrow with outward square brackets at both ends."""
+ arrow = "]-["
+
+ def __init__(self,
+ widthA=1., lengthA=0.2, angleA=0,
+ widthB=1., lengthB=0.2, angleB=0):
+ """
+ Parameters
+ ----------
+ widthA, widthB : float, default: 1.0
+ Width of the bracket.
+ lengthA, lengthB : float, default: 0.2
+ Length of the bracket.
+ angleA, angleB : float, default: 0 degrees
+ Orientation of the bracket, as a counterclockwise angle.
+ 0 degrees means perpendicular to the line.
+ """
+ super().__init__(widthA=widthA, lengthA=lengthA, angleA=angleA,
+ widthB=widthB, lengthB=lengthB, angleB=angleB)
+
+ @_register_style(_style_list, name="|-|")
+ class BarAB(_Curve):
+ """An arrow with vertical bars ``|`` at both ends."""
+ arrow = "|-|"
+
+ def __init__(self, widthA=1., angleA=0, widthB=1., angleB=0):
+ """
+ Parameters
+ ----------
+ widthA, widthB : float, default: 1.0
+ Width of the bracket.
+ angleA, angleB : float, default: 0 degrees
+ Orientation of the bracket, as a counterclockwise angle.
+ 0 degrees means perpendicular to the line.
+ """
+ super().__init__(widthA=widthA, lengthA=0, angleA=angleA,
+ widthB=widthB, lengthB=0, angleB=angleB)
+
+ @_register_style(_style_list, name=']->')
+ class BracketCurve(_Curve):
+ """
+ An arrow with an outward square bracket at its start and a head at
+ the end.
+ """
+ arrow = "]->"
+
+ def __init__(self, widthA=1., lengthA=0.2, angleA=None):
+ """
+ Parameters
+ ----------
+ widthA : float, default: 1.0
+ Width of the bracket.
+ lengthA : float, default: 0.2
+ Length of the bracket.
+ angleA : float, default: 0 degrees
+ Orientation of the bracket, as a counterclockwise angle.
+ 0 degrees means perpendicular to the line.
+ """
+ super().__init__(widthA=widthA, lengthA=lengthA, angleA=angleA)
+
+ @_register_style(_style_list, name='<-[')
+ class CurveBracket(_Curve):
+ """
+ An arrow with an outward square bracket at its end and a head at
+ the start.
+ """
+ arrow = "<-["
+
+ def __init__(self, widthB=1., lengthB=0.2, angleB=None):
+ """
+ Parameters
+ ----------
+ widthB : float, default: 1.0
+ Width of the bracket.
+ lengthB : float, default: 0.2
+ Length of the bracket.
+ angleB : float, default: 0 degrees
+ Orientation of the bracket, as a counterclockwise angle.
+ 0 degrees means perpendicular to the line.
+ """
+ super().__init__(widthB=widthB, lengthB=lengthB, angleB=angleB)
+
+ @_register_style(_style_list)
+ class Simple(_Base):
+ """A simple arrow. Only works with a quadratic BƩzier curve."""
+
+ def __init__(self, head_length=.5, head_width=.5, tail_width=.2):
+ """
+ Parameters
+ ----------
+ head_length : float, default: 0.5
+ Length of the arrow head.
+
+ head_width : float, default: 0.5
+ Width of the arrow head.
+
+ tail_width : float, default: 0.2
+ Width of the arrow tail.
+ """
+ self.head_length, self.head_width, self.tail_width = \
+ head_length, head_width, tail_width
+ super().__init__()
+
+ def transmute(self, path, mutation_size, linewidth):
+ # docstring inherited
+ x0, y0, x1, y1, x2, y2 = self.ensure_quadratic_bezier(path)
+
+ # divide the path into a head and a tail
+ head_length = self.head_length * mutation_size
+ in_f = inside_circle(x2, y2, head_length)
+ arrow_path = [(x0, y0), (x1, y1), (x2, y2)]
+
+ try:
+ arrow_out, arrow_in = \
+ split_bezier_intersecting_with_closedpath(arrow_path, in_f)
+ except NonIntersectingPathException:
+ # if this happens, make a straight line of the head_length
+ # long.
+ x0, y0 = _point_along_a_line(x2, y2, x1, y1, head_length)
+ x1n, y1n = 0.5 * (x0 + x2), 0.5 * (y0 + y2)
+ arrow_in = [(x0, y0), (x1n, y1n), (x2, y2)]
+ arrow_out = None
+
+ # head
+ head_width = self.head_width * mutation_size
+ head_left, head_right = make_wedged_bezier2(arrow_in,
+ head_width / 2., wm=.5)
+
+ # tail
+ if arrow_out is not None:
+ tail_width = self.tail_width * mutation_size
+ tail_left, tail_right = get_parallels(arrow_out,
+ tail_width / 2.)
+
+ patch_path = [(Path.MOVETO, tail_right[0]),
+ (Path.CURVE3, tail_right[1]),
+ (Path.CURVE3, tail_right[2]),
+ (Path.LINETO, head_right[0]),
+ (Path.CURVE3, head_right[1]),
+ (Path.CURVE3, head_right[2]),
+ (Path.CURVE3, head_left[1]),
+ (Path.CURVE3, head_left[0]),
+ (Path.LINETO, tail_left[2]),
+ (Path.CURVE3, tail_left[1]),
+ (Path.CURVE3, tail_left[0]),
+ (Path.LINETO, tail_right[0]),
+ (Path.CLOSEPOLY, tail_right[0]),
+ ]
+ else:
+ patch_path = [(Path.MOVETO, head_right[0]),
+ (Path.CURVE3, head_right[1]),
+ (Path.CURVE3, head_right[2]),
+ (Path.CURVE3, head_left[1]),
+ (Path.CURVE3, head_left[0]),
+ (Path.CLOSEPOLY, head_left[0]),
+ ]
+
+ path = Path([p for c, p in patch_path], [c for c, p in patch_path])
+
+ return path, True
+
+ @_register_style(_style_list)
+ class Fancy(_Base):
+ """A fancy arrow. Only works with a quadratic BƩzier curve."""
+
+ def __init__(self, head_length=.4, head_width=.4, tail_width=.4):
+ """
+ Parameters
+ ----------
+ head_length : float, default: 0.4
+ Length of the arrow head.
+
+ head_width : float, default: 0.4
+ Width of the arrow head.
+
+ tail_width : float, default: 0.4
+ Width of the arrow tail.
+ """
+ self.head_length, self.head_width, self.tail_width = \
+ head_length, head_width, tail_width
+ super().__init__()
+
+ def transmute(self, path, mutation_size, linewidth):
+ # docstring inherited
+ x0, y0, x1, y1, x2, y2 = self.ensure_quadratic_bezier(path)
+
+ # divide the path into a head and a tail
+ head_length = self.head_length * mutation_size
+ arrow_path = [(x0, y0), (x1, y1), (x2, y2)]
+
+ # path for head
+ in_f = inside_circle(x2, y2, head_length)
+ try:
+ path_out, path_in = split_bezier_intersecting_with_closedpath(
+ arrow_path, in_f)
+ except NonIntersectingPathException:
+ # if this happens, make a straight line of the head_length
+ # long.
+ x0, y0 = _point_along_a_line(x2, y2, x1, y1, head_length)
+ x1n, y1n = 0.5 * (x0 + x2), 0.5 * (y0 + y2)
+ arrow_path = [(x0, y0), (x1n, y1n), (x2, y2)]
+ path_head = arrow_path
+ else:
+ path_head = path_in
+
+ # path for head
+ in_f = inside_circle(x2, y2, head_length * .8)
+ path_out, path_in = split_bezier_intersecting_with_closedpath(
+ arrow_path, in_f)
+ path_tail = path_out
+
+ # head
+ head_width = self.head_width * mutation_size
+ head_l, head_r = make_wedged_bezier2(path_head,
+ head_width / 2.,
+ wm=.6)
+
+ # tail
+ tail_width = self.tail_width * mutation_size
+ tail_left, tail_right = make_wedged_bezier2(path_tail,
+ tail_width * .5,
+ w1=1., wm=0.6, w2=0.3)
+
+ # path for head
+ in_f = inside_circle(x0, y0, tail_width * .3)
+ path_in, path_out = split_bezier_intersecting_with_closedpath(
+ arrow_path, in_f)
+ tail_start = path_in[-1]
+
+ head_right, head_left = head_r, head_l
+ patch_path = [(Path.MOVETO, tail_start),
+ (Path.LINETO, tail_right[0]),
+ (Path.CURVE3, tail_right[1]),
+ (Path.CURVE3, tail_right[2]),
+ (Path.LINETO, head_right[0]),
+ (Path.CURVE3, head_right[1]),
+ (Path.CURVE3, head_right[2]),
+ (Path.CURVE3, head_left[1]),
+ (Path.CURVE3, head_left[0]),
+ (Path.LINETO, tail_left[2]),
+ (Path.CURVE3, tail_left[1]),
+ (Path.CURVE3, tail_left[0]),
+ (Path.LINETO, tail_start),
+ (Path.CLOSEPOLY, tail_start),
+ ]
+ path = Path([p for c, p in patch_path], [c for c, p in patch_path])
+
+ return path, True
+
+ @_register_style(_style_list)
+ class Wedge(_Base):
+ """
+ Wedge(?) shape. Only works with a quadratic BƩzier curve. The
+ start point has a width of the *tail_width* and the end point has a
+ width of 0. At the middle, the width is *shrink_factor*x*tail_width*.
+ """
+
+ def __init__(self, tail_width=.3, shrink_factor=0.5):
+ """
+ Parameters
+ ----------
+ tail_width : float, default: 0.3
+ Width of the tail.
+
+ shrink_factor : float, default: 0.5
+ Fraction of the arrow width at the middle point.
+ """
+ self.tail_width = tail_width
+ self.shrink_factor = shrink_factor
+ super().__init__()
+
+ def transmute(self, path, mutation_size, linewidth):
+ # docstring inherited
+ x0, y0, x1, y1, x2, y2 = self.ensure_quadratic_bezier(path)
+
+ arrow_path = [(x0, y0), (x1, y1), (x2, y2)]
+ b_plus, b_minus = make_wedged_bezier2(
+ arrow_path,
+ self.tail_width * mutation_size / 2.,
+ wm=self.shrink_factor)
+
+ patch_path = [(Path.MOVETO, b_plus[0]),
+ (Path.CURVE3, b_plus[1]),
+ (Path.CURVE3, b_plus[2]),
+ (Path.LINETO, b_minus[2]),
+ (Path.CURVE3, b_minus[1]),
+ (Path.CURVE3, b_minus[0]),
+ (Path.CLOSEPOLY, b_minus[0]),
+ ]
+ path = Path([p for c, p in patch_path], [c for c, p in patch_path])
+
+ return path, True
+
+
+class FancyBboxPatch(Patch):
+ """
+ A fancy box around a rectangle with lower left at *xy* = (*x*, *y*)
+ with specified width and height.
+
+ `.FancyBboxPatch` is similar to `.Rectangle`, but it draws a fancy box
+ around the rectangle. The transformation of the rectangle box to the
+ fancy box is delegated to the style classes defined in `.BoxStyle`.
+ """
+
+ _edge_default = True
+
+ def __str__(self):
+ s = self.__class__.__name__ + "((%g, %g), width=%g, height=%g)"
+ return s % (self._x, self._y, self._width, self._height)
+
+ @_docstring.interpd
+ def __init__(self, xy, width, height, boxstyle="round", *,
+ mutation_scale=1, mutation_aspect=1, **kwargs):
+ """
+ Parameters
+ ----------
+ xy : (float, float)
+ The lower left corner of the box.
+
+ width : float
+ The width of the box.
+
+ height : float
+ The height of the box.
+
+ boxstyle : str or `~matplotlib.patches.BoxStyle`
+ The style of the fancy box. This can either be a `.BoxStyle`
+ instance or a string of the style name and optionally comma
+ separated attributes (e.g. "Round, pad=0.2"). This string is
+ passed to `.BoxStyle` to construct a `.BoxStyle` object. See
+ there for a full documentation.
+
+ The following box styles are available:
+
+ %(BoxStyle:table)s
+
+ mutation_scale : float, default: 1
+ Scaling factor applied to the attributes of the box style
+ (e.g. pad or rounding_size).
+
+ mutation_aspect : float, default: 1
+ The height of the rectangle will be squeezed by this value before
+ the mutation and the mutated box will be stretched by the inverse
+ of it. For example, this allows different horizontal and vertical
+ padding.
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.patches.Patch` properties
+
+ %(Patch:kwdoc)s
+ """
+
+ super().__init__(**kwargs)
+ self._x, self._y = xy
+ self._width = width
+ self._height = height
+ self.set_boxstyle(boxstyle)
+ self._mutation_scale = mutation_scale
+ self._mutation_aspect = mutation_aspect
+ self.stale = True
+
+ @_docstring.interpd
+ def set_boxstyle(self, boxstyle=None, **kwargs):
+ """
+ Set the box style, possibly with further attributes.
+
+ Attributes from the previous box style are not reused.
+
+ Without argument (or with ``boxstyle=None``), the available box styles
+ are returned as a human-readable string.
+
+ Parameters
+ ----------
+ boxstyle : str or `~matplotlib.patches.BoxStyle`
+ The style of the box: either a `.BoxStyle` instance, or a string,
+ which is the style name and optionally comma separated attributes
+ (e.g. "Round,pad=0.2"). Such a string is used to construct a
+ `.BoxStyle` object, as documented in that class.
+
+ The following box styles are available:
+
+ %(BoxStyle:table_and_accepts)s
+
+ **kwargs
+ Additional attributes for the box style. See the table above for
+ supported parameters.
+
+ Examples
+ --------
+ ::
+
+ set_boxstyle("Round,pad=0.2")
+ set_boxstyle("round", pad=0.2)
+ """
+ if boxstyle is None:
+ return BoxStyle.pprint_styles()
+ self._bbox_transmuter = (
+ BoxStyle(boxstyle, **kwargs)
+ if isinstance(boxstyle, str) else boxstyle)
+ self.stale = True
+
+ def get_boxstyle(self):
+ """Return the boxstyle object."""
+ return self._bbox_transmuter
+
+ def set_mutation_scale(self, scale):
+ """
+ Set the mutation scale.
+
+ Parameters
+ ----------
+ scale : float
+ """
+ self._mutation_scale = scale
+ self.stale = True
+
+ def get_mutation_scale(self):
+ """Return the mutation scale."""
+ return self._mutation_scale
+
+ def set_mutation_aspect(self, aspect):
+ """
+ Set the aspect ratio of the bbox mutation.
+
+ Parameters
+ ----------
+ aspect : float
+ """
+ self._mutation_aspect = aspect
+ self.stale = True
+
+ def get_mutation_aspect(self):
+ """Return the aspect ratio of the bbox mutation."""
+ return (self._mutation_aspect if self._mutation_aspect is not None
+ else 1) # backcompat.
+
+ def get_path(self):
+ """Return the mutated path of the rectangle."""
+ boxstyle = self.get_boxstyle()
+ m_aspect = self.get_mutation_aspect()
+ # Call boxstyle with y, height squeezed by aspect_ratio.
+ path = boxstyle(self._x, self._y / m_aspect,
+ self._width, self._height / m_aspect,
+ self.get_mutation_scale())
+ return Path(path.vertices * [1, m_aspect], path.codes) # Unsqueeze y.
+
+ # Following methods are borrowed from the Rectangle class.
+
+ def get_x(self):
+ """Return the left coord of the rectangle."""
+ return self._x
+
+ def get_y(self):
+ """Return the bottom coord of the rectangle."""
+ return self._y
+
+ def get_width(self):
+ """Return the width of the rectangle."""
+ return self._width
+
+ def get_height(self):
+ """Return the height of the rectangle."""
+ return self._height
+
+ def set_x(self, x):
+ """
+ Set the left coord of the rectangle.
+
+ Parameters
+ ----------
+ x : float
+ """
+ self._x = x
+ self.stale = True
+
+ def set_y(self, y):
+ """
+ Set the bottom coord of the rectangle.
+
+ Parameters
+ ----------
+ y : float
+ """
+ self._y = y
+ self.stale = True
+
+ def set_width(self, w):
+ """
+ Set the rectangle width.
+
+ Parameters
+ ----------
+ w : float
+ """
+ self._width = w
+ self.stale = True
+
+ def set_height(self, h):
+ """
+ Set the rectangle height.
+
+ Parameters
+ ----------
+ h : float
+ """
+ self._height = h
+ self.stale = True
+
+ def set_bounds(self, *args):
+ """
+ Set the bounds of the rectangle.
+
+ Call signatures::
+
+ set_bounds(left, bottom, width, height)
+ set_bounds((left, bottom, width, height))
+
+ Parameters
+ ----------
+ left, bottom : float
+ The coordinates of the bottom left corner of the rectangle.
+ width, height : float
+ The width/height of the rectangle.
+ """
+ if len(args) == 1:
+ l, b, w, h = args[0]
+ else:
+ l, b, w, h = args
+ self._x = l
+ self._y = b
+ self._width = w
+ self._height = h
+ self.stale = True
+
+ def get_bbox(self):
+ """Return the `.Bbox`."""
+ return transforms.Bbox.from_bounds(self._x, self._y,
+ self._width, self._height)
+
+
+class FancyArrowPatch(Patch):
+ """
+ A fancy arrow patch.
+
+ It draws an arrow using the `ArrowStyle`. It is primarily used by the
+ `~.axes.Axes.annotate` method. For most purposes, use the annotate method for
+ drawing arrows.
+
+ The head and tail positions are fixed at the specified start and end points
+ of the arrow, but the size and shape (in display coordinates) of the arrow
+ does not change when the axis is moved or zoomed.
+ """
+ _edge_default = True
+
+ def __str__(self):
+ if self._posA_posB is not None:
+ (x1, y1), (x2, y2) = self._posA_posB
+ return f"{type(self).__name__}(({x1:g}, {y1:g})->({x2:g}, {y2:g}))"
+ else:
+ return f"{type(self).__name__}({self._path_original})"
+
+ @_docstring.interpd
+ def __init__(self, posA=None, posB=None, *,
+ path=None, arrowstyle="simple", connectionstyle="arc3",
+ patchA=None, patchB=None, shrinkA=2, shrinkB=2,
+ mutation_scale=1, mutation_aspect=1, **kwargs):
+ """
+ **Defining the arrow position and path**
+
+ There are two ways to define the arrow position and path:
+
+ - **Start, end and connection**:
+ The typical approach is to define the start and end points of the
+ arrow using *posA* and *posB*. The curve between these two can
+ further be configured using *connectionstyle*.
+
+ If given, the arrow curve is clipped by *patchA* and *patchB*,
+ allowing it to start/end at the border of these patches.
+ Additionally, the arrow curve can be shortened by *shrinkA* and *shrinkB*
+ to create a margin between start/end (after possible clipping) and the
+ drawn arrow.
+
+ - **path**: Alternatively if *path* is provided, an arrow is drawn along
+ this Path. In this case, *connectionstyle*, *patchA*, *patchB*,
+ *shrinkA*, and *shrinkB* are ignored.
+
+ **Styling**
+
+ The *arrowstyle* defines the styling of the arrow head, tail and shaft.
+ The resulting arrows can be styled further by setting the `.Patch`
+ properties such as *linewidth*, *color*, *facecolor*, *edgecolor*
+ etc. via keyword arguments.
+
+ Parameters
+ ----------
+ posA, posB : (float, float), optional
+ (x, y) coordinates of start and end point of the arrow.
+ The actually drawn start and end positions may be modified
+ through *patchA*, *patchB*, *shrinkA*, and *shrinkB*.
+
+ *posA*, *posB* are exclusive of *path*.
+
+ path : `~matplotlib.path.Path`, optional
+ If provided, an arrow is drawn along this path and *patchA*,
+ *patchB*, *shrinkA*, and *shrinkB* are ignored.
+
+ *path* is exclusive of *posA*, *posB*.
+
+ arrowstyle : str or `.ArrowStyle`, default: 'simple'
+ The styling of arrow head, tail and shaft. This can be
+
+ - `.ArrowStyle` or one of its subclasses
+ - The shorthand string name (e.g. "->") as given in the table below,
+ optionally containing a comma-separated list of style parameters,
+ e.g. "->, head_length=10, head_width=5".
+
+ The style parameters are scaled by *mutation_scale*.
+
+ The following arrow styles are available. See also
+ :doc:`/gallery/text_labels_and_annotations/fancyarrow_demo`.
+
+ %(ArrowStyle:table)s
+
+ Only the styles ``<|-``, ``-|>``, ``<|-|>`` ``simple``, ``fancy``
+ and ``wedge`` contain closed paths and can be filled.
+
+ connectionstyle : str or `.ConnectionStyle` or None, optional, \
+default: 'arc3'
+ `.ConnectionStyle` with which *posA* and *posB* are connected.
+ This can be
+
+ - `.ConnectionStyle` or one of its subclasses
+ - The shorthand string name as given in the table below, e.g. "arc3".
+
+ %(ConnectionStyle:table)s
+
+ Ignored if *path* is provided.
+
+ patchA, patchB : `~matplotlib.patches.Patch`, default: None
+ Optional Patches at *posA* and *posB*, respectively. If given,
+ the arrow path is clipped by these patches such that head and tail
+ are at the border of the patches.
+
+ Ignored if *path* is provided.
+
+ shrinkA, shrinkB : float, default: 2
+ Shorten the arrow path at *posA* and *posB* by this amount in points.
+ This allows to add a margin between the intended start/end points and
+ the arrow.
+
+ Ignored if *path* is provided.
+
+ mutation_scale : float, default: 1
+ Value with which attributes of *arrowstyle* (e.g., *head_length*)
+ will be scaled.
+
+ mutation_aspect : None or float, default: None
+ The height of the rectangle will be squeezed by this value before
+ the mutation and the mutated box will be stretched by the inverse
+ of it.
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.patches.Patch` properties, optional
+ Here is a list of available `.Patch` properties:
+
+ %(Patch:kwdoc)s
+
+ In contrast to other patches, the default ``capstyle`` and
+ ``joinstyle`` for `FancyArrowPatch` are set to ``"round"``.
+ """
+ # Traditionally, the cap- and joinstyle for FancyArrowPatch are round
+ kwargs.setdefault("joinstyle", JoinStyle.round)
+ kwargs.setdefault("capstyle", CapStyle.round)
+
+ super().__init__(**kwargs)
+
+ if posA is not None and posB is not None and path is None:
+ self._posA_posB = [posA, posB]
+
+ if connectionstyle is None:
+ connectionstyle = "arc3"
+ self.set_connectionstyle(connectionstyle)
+
+ elif posA is None and posB is None and path is not None:
+ self._posA_posB = None
+ else:
+ raise ValueError("Either posA and posB, or path need to provided")
+
+ self.patchA = patchA
+ self.patchB = patchB
+ self.shrinkA = shrinkA
+ self.shrinkB = shrinkB
+
+ self._path_original = path
+
+ self.set_arrowstyle(arrowstyle)
+
+ self._mutation_scale = mutation_scale
+ self._mutation_aspect = mutation_aspect
+
+ self._dpi_cor = 1.0
+
+ def set_positions(self, posA, posB):
+ """
+ Set the start and end positions of the connecting path.
+
+ Parameters
+ ----------
+ posA, posB : None, tuple
+ (x, y) coordinates of arrow tail and arrow head respectively. If
+ `None` use current value.
+ """
+ if posA is not None:
+ self._posA_posB[0] = posA
+ if posB is not None:
+ self._posA_posB[1] = posB
+ self.stale = True
+
+ def set_patchA(self, patchA):
+ """
+ Set the tail patch.
+
+ Parameters
+ ----------
+ patchA : `.patches.Patch`
+ """
+ self.patchA = patchA
+ self.stale = True
+
+ def set_patchB(self, patchB):
+ """
+ Set the head patch.
+
+ Parameters
+ ----------
+ patchB : `.patches.Patch`
+ """
+ self.patchB = patchB
+ self.stale = True
+
+ @_docstring.interpd
+ def set_connectionstyle(self, connectionstyle=None, **kwargs):
+ """
+ Set the connection style, possibly with further attributes.
+
+ Attributes from the previous connection style are not reused.
+
+ Without argument (or with ``connectionstyle=None``), the available box
+ styles are returned as a human-readable string.
+
+ Parameters
+ ----------
+ connectionstyle : str or `~matplotlib.patches.ConnectionStyle`
+ The style of the connection: either a `.ConnectionStyle` instance,
+ or a string, which is the style name and optionally comma separated
+ attributes (e.g. "Arc,armA=30,rad=10"). Such a string is used to
+ construct a `.ConnectionStyle` object, as documented in that class.
+
+ The following connection styles are available:
+
+ %(ConnectionStyle:table_and_accepts)s
+
+ **kwargs
+ Additional attributes for the connection style. See the table above
+ for supported parameters.
+
+ Examples
+ --------
+ ::
+
+ set_connectionstyle("Arc,armA=30,rad=10")
+ set_connectionstyle("arc", armA=30, rad=10)
+ """
+ if connectionstyle is None:
+ return ConnectionStyle.pprint_styles()
+ self._connector = (
+ ConnectionStyle(connectionstyle, **kwargs)
+ if isinstance(connectionstyle, str) else connectionstyle)
+ self.stale = True
+
+ def get_connectionstyle(self):
+ """Return the `ConnectionStyle` used."""
+ return self._connector
+
+ @_docstring.interpd
+ def set_arrowstyle(self, arrowstyle=None, **kwargs):
+ """
+ Set the arrow style, possibly with further attributes.
+
+ Attributes from the previous arrow style are not reused.
+
+ Without argument (or with ``arrowstyle=None``), the available box
+ styles are returned as a human-readable string.
+
+ Parameters
+ ----------
+ arrowstyle : str or `~matplotlib.patches.ArrowStyle`
+ The style of the arrow: either a `.ArrowStyle` instance, or a
+ string, which is the style name and optionally comma separated
+ attributes (e.g. "Fancy,head_length=0.2"). Such a string is used to
+ construct a `.ArrowStyle` object, as documented in that class.
+
+ The following arrow styles are available:
+
+ %(ArrowStyle:table_and_accepts)s
+
+ **kwargs
+ Additional attributes for the arrow style. See the table above for
+ supported parameters.
+
+ Examples
+ --------
+ ::
+
+ set_arrowstyle("Fancy,head_length=0.2")
+ set_arrowstyle("fancy", head_length=0.2)
+ """
+ if arrowstyle is None:
+ return ArrowStyle.pprint_styles()
+ self._arrow_transmuter = (
+ ArrowStyle(arrowstyle, **kwargs)
+ if isinstance(arrowstyle, str) else arrowstyle)
+ self.stale = True
+
+ def get_arrowstyle(self):
+ """Return the arrowstyle object."""
+ return self._arrow_transmuter
+
+ def set_mutation_scale(self, scale):
+ """
+ Set the mutation scale.
+
+ Parameters
+ ----------
+ scale : float
+ """
+ self._mutation_scale = scale
+ self.stale = True
+
+ def get_mutation_scale(self):
+ """
+ Return the mutation scale.
+
+ Returns
+ -------
+ scalar
+ """
+ return self._mutation_scale
+
+ def set_mutation_aspect(self, aspect):
+ """
+ Set the aspect ratio of the bbox mutation.
+
+ Parameters
+ ----------
+ aspect : float
+ """
+ self._mutation_aspect = aspect
+ self.stale = True
+
+ def get_mutation_aspect(self):
+ """Return the aspect ratio of the bbox mutation."""
+ return (self._mutation_aspect if self._mutation_aspect is not None
+ else 1) # backcompat.
+
+ def get_path(self):
+ """Return the path of the arrow in the data coordinates."""
+ # The path is generated in display coordinates, then converted back to
+ # data coordinates.
+ _path, fillable = self._get_path_in_displaycoord()
+ if np.iterable(fillable):
+ _path = Path.make_compound_path(*_path)
+ return self.get_transform().inverted().transform_path(_path)
+
+ def _get_path_in_displaycoord(self):
+ """Return the mutated path of the arrow in display coordinates."""
+ dpi_cor = self._dpi_cor
+
+ if self._posA_posB is not None:
+ posA = self._convert_xy_units(self._posA_posB[0])
+ posB = self._convert_xy_units(self._posA_posB[1])
+ (posA, posB) = self.get_transform().transform((posA, posB))
+ _path = self.get_connectionstyle()(posA, posB,
+ patchA=self.patchA,
+ patchB=self.patchB,
+ shrinkA=self.shrinkA * dpi_cor,
+ shrinkB=self.shrinkB * dpi_cor
+ )
+ else:
+ _path = self.get_transform().transform_path(self._path_original)
+
+ _path, fillable = self.get_arrowstyle()(
+ _path,
+ self.get_mutation_scale() * dpi_cor,
+ self.get_linewidth() * dpi_cor,
+ self.get_mutation_aspect())
+
+ return _path, fillable
+
+ def draw(self, renderer):
+ if not self.get_visible():
+ return
+
+ # FIXME: dpi_cor is for the dpi-dependency of the linewidth. There
+ # could be room for improvement. Maybe _get_path_in_displaycoord could
+ # take a renderer argument, but get_path should be adapted too.
+ self._dpi_cor = renderer.points_to_pixels(1.)
+ path, fillable = self._get_path_in_displaycoord()
+
+ if not np.iterable(fillable):
+ path = [path]
+ fillable = [fillable]
+
+ affine = transforms.IdentityTransform()
+
+ self._draw_paths_with_artist_properties(
+ renderer,
+ [(p, affine, self._facecolor if f and self._facecolor[3] else None)
+ for p, f in zip(path, fillable)])
+
+
+class ConnectionPatch(FancyArrowPatch):
+ """A patch that connects two points (possibly in different Axes)."""
+
+ def __str__(self):
+ return "ConnectionPatch((%g, %g), (%g, %g))" % \
+ (self.xy1[0], self.xy1[1], self.xy2[0], self.xy2[1])
+
+ @_docstring.interpd
+ def __init__(self, xyA, xyB, coordsA, coordsB=None, *,
+ axesA=None, axesB=None,
+ arrowstyle="-",
+ connectionstyle="arc3",
+ patchA=None,
+ patchB=None,
+ shrinkA=0.,
+ shrinkB=0.,
+ mutation_scale=10.,
+ mutation_aspect=None,
+ clip_on=False,
+ **kwargs):
+ """
+ Connect point *xyA* in *coordsA* with point *xyB* in *coordsB*.
+
+ Valid keys are
+
+ =============== ======================================================
+ Key Description
+ =============== ======================================================
+ arrowstyle the arrow style
+ connectionstyle the connection style
+ relpos default is (0.5, 0.5)
+ patchA default is bounding box of the text
+ patchB default is None
+ shrinkA default is 2 points
+ shrinkB default is 2 points
+ mutation_scale default is text size (in points)
+ mutation_aspect default is 1.
+ ? any key for `matplotlib.patches.PathPatch`
+ =============== ======================================================
+
+ *coordsA* and *coordsB* are strings that indicate the
+ coordinates of *xyA* and *xyB*.
+
+ ==================== ==================================================
+ Property Description
+ ==================== ==================================================
+ 'figure points' points from the lower left corner of the figure
+ 'figure pixels' pixels from the lower left corner of the figure
+ 'figure fraction' 0, 0 is lower left of figure and 1, 1 is upper
+ right
+ 'subfigure points' points from the lower left corner of the subfigure
+ 'subfigure pixels' pixels from the lower left corner of the subfigure
+ 'subfigure fraction' fraction of the subfigure, 0, 0 is lower left.
+ 'axes points' points from lower left corner of the Axes
+ 'axes pixels' pixels from lower left corner of the Axes
+ 'axes fraction' 0, 0 is lower left of Axes and 1, 1 is upper right
+ 'data' use the coordinate system of the object being
+ annotated (default)
+ 'offset points' offset (in points) from the *xy* value
+ 'polar' you can specify *theta*, *r* for the annotation,
+ even in cartesian plots. Note that if you are
+ using a polar Axes, you do not need to specify
+ polar for the coordinate system since that is the
+ native "data" coordinate system.
+ ==================== ==================================================
+
+ Alternatively they can be set to any valid
+ `~matplotlib.transforms.Transform`.
+
+ Note that 'subfigure pixels' and 'figure pixels' are the same
+ for the parent figure, so users who want code that is usable in
+ a subfigure can use 'subfigure pixels'.
+
+ .. note::
+
+ Using `ConnectionPatch` across two `~.axes.Axes` instances
+ is not directly compatible with :ref:`constrained layout
+ `. Add the artist
+ directly to the `.Figure` instead of adding it to a specific Axes,
+ or exclude it from the layout using ``con.set_in_layout(False)``.
+
+ .. code-block:: default
+
+ fig, ax = plt.subplots(1, 2, constrained_layout=True)
+ con = ConnectionPatch(..., axesA=ax[0], axesB=ax[1])
+ fig.add_artist(con)
+
+ """
+ if coordsB is None:
+ coordsB = coordsA
+ # we'll draw ourself after the artist we annotate by default
+ self.xy1 = xyA
+ self.xy2 = xyB
+ self.coords1 = coordsA
+ self.coords2 = coordsB
+
+ self.axesA = axesA
+ self.axesB = axesB
+
+ super().__init__(posA=(0, 0), posB=(1, 1),
+ arrowstyle=arrowstyle,
+ connectionstyle=connectionstyle,
+ patchA=patchA, patchB=patchB,
+ shrinkA=shrinkA, shrinkB=shrinkB,
+ mutation_scale=mutation_scale,
+ mutation_aspect=mutation_aspect,
+ clip_on=clip_on,
+ **kwargs)
+ # if True, draw annotation only if self.xy is inside the Axes
+ self._annotation_clip = None
+
+ def _get_xy(self, xy, s, axes=None):
+ """Calculate the pixel position of given point."""
+ s0 = s # For the error message, if needed.
+ if axes is None:
+ axes = self.axes
+
+ # preserve mixed type input (such as str, int)
+ x = np.array(xy[0])
+ y = np.array(xy[1])
+
+ fig = self.get_figure(root=False)
+ if s in ["figure points", "axes points"]:
+ x = x * fig.dpi / 72
+ y = y * fig.dpi / 72
+ s = s.replace("points", "pixels")
+ elif s == "figure fraction":
+ s = fig.transFigure
+ elif s == "subfigure fraction":
+ s = fig.transSubfigure
+ elif s == "axes fraction":
+ s = axes.transAxes
+
+ if s == 'data':
+ trans = axes.transData
+ x = cbook._to_unmasked_float_array(axes.xaxis.convert_units(x))
+ y = cbook._to_unmasked_float_array(axes.yaxis.convert_units(y))
+ return trans.transform((x, y))
+ elif s == 'offset points':
+ if self.xycoords == 'offset points': # prevent recursion
+ return self._get_xy(self.xy, 'data')
+ return (
+ self._get_xy(self.xy, self.xycoords) # converted data point
+ + xy * self.get_figure(root=True).dpi / 72) # converted offset
+ elif s == 'polar':
+ theta, r = x, y
+ x = r * np.cos(theta)
+ y = r * np.sin(theta)
+ trans = axes.transData
+ return trans.transform((x, y))
+ elif s == 'figure pixels':
+ # pixels from the lower left corner of the figure
+ bb = self.get_figure(root=False).figbbox
+ x = bb.x0 + x if x >= 0 else bb.x1 + x
+ y = bb.y0 + y if y >= 0 else bb.y1 + y
+ return x, y
+ elif s == 'subfigure pixels':
+ # pixels from the lower left corner of the figure
+ bb = self.get_figure(root=False).bbox
+ x = bb.x0 + x if x >= 0 else bb.x1 + x
+ y = bb.y0 + y if y >= 0 else bb.y1 + y
+ return x, y
+ elif s == 'axes pixels':
+ # pixels from the lower left corner of the Axes
+ bb = axes.bbox
+ x = bb.x0 + x if x >= 0 else bb.x1 + x
+ y = bb.y0 + y if y >= 0 else bb.y1 + y
+ return x, y
+ elif isinstance(s, transforms.Transform):
+ return s.transform(xy)
+ else:
+ raise ValueError(f"{s0} is not a valid coordinate transformation")
+
+ def set_annotation_clip(self, b):
+ """
+ Set the annotation's clipping behavior.
+
+ Parameters
+ ----------
+ b : bool or None
+ - True: The annotation will be clipped when ``self.xy`` is
+ outside the Axes.
+ - False: The annotation will always be drawn.
+ - None: The annotation will be clipped when ``self.xy`` is
+ outside the Axes and ``self.xycoords == "data"``.
+ """
+ self._annotation_clip = b
+ self.stale = True
+
+ def get_annotation_clip(self):
+ """
+ Return the clipping behavior.
+
+ See `.set_annotation_clip` for the meaning of the return value.
+ """
+ return self._annotation_clip
+
+ def _get_path_in_displaycoord(self):
+ """Return the mutated path of the arrow in display coordinates."""
+ dpi_cor = self._dpi_cor
+ posA = self._get_xy(self.xy1, self.coords1, self.axesA)
+ posB = self._get_xy(self.xy2, self.coords2, self.axesB)
+ path = self.get_connectionstyle()(
+ posA, posB,
+ patchA=self.patchA, patchB=self.patchB,
+ shrinkA=self.shrinkA * dpi_cor, shrinkB=self.shrinkB * dpi_cor,
+ )
+ path, fillable = self.get_arrowstyle()(
+ path,
+ self.get_mutation_scale() * dpi_cor,
+ self.get_linewidth() * dpi_cor,
+ self.get_mutation_aspect()
+ )
+ return path, fillable
+
+ def _check_xy(self, renderer):
+ """Check whether the annotation needs to be drawn."""
+
+ b = self.get_annotation_clip()
+
+ if b or (b is None and self.coords1 == "data"):
+ xy_pixel = self._get_xy(self.xy1, self.coords1, self.axesA)
+ if self.axesA is None:
+ axes = self.axes
+ else:
+ axes = self.axesA
+ if not axes.contains_point(xy_pixel):
+ return False
+
+ if b or (b is None and self.coords2 == "data"):
+ xy_pixel = self._get_xy(self.xy2, self.coords2, self.axesB)
+ if self.axesB is None:
+ axes = self.axes
+ else:
+ axes = self.axesB
+ if not axes.contains_point(xy_pixel):
+ return False
+
+ return True
+
+ def draw(self, renderer):
+ if not self.get_visible() or not self._check_xy(renderer):
+ return
+ super().draw(renderer)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patches.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patches.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..0645479ee5e75de2279a0d619b8860d7abe4bd32
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patches.pyi
@@ -0,0 +1,757 @@
+from . import artist
+from .axes import Axes
+from .backend_bases import RendererBase, MouseEvent
+from .path import Path
+from .transforms import Transform, Bbox
+
+from typing import Any, Literal, overload
+
+import numpy as np
+from numpy.typing import ArrayLike
+from .typing import ColorType, LineStyleType, CapStyleType, JoinStyleType
+
+class Patch(artist.Artist):
+ zorder: float
+ def __init__(
+ self,
+ *,
+ edgecolor: ColorType | None = ...,
+ facecolor: ColorType | None = ...,
+ color: ColorType | None = ...,
+ linewidth: float | None = ...,
+ linestyle: LineStyleType | None = ...,
+ antialiased: bool | None = ...,
+ hatch: str | None = ...,
+ fill: bool = ...,
+ capstyle: CapStyleType | None = ...,
+ joinstyle: JoinStyleType | None = ...,
+ **kwargs,
+ ) -> None: ...
+ def get_verts(self) -> ArrayLike: ...
+ def contains(self, mouseevent: MouseEvent, radius: float | None = None) -> tuple[bool, dict[Any, Any]]: ...
+ def contains_point(
+ self, point: tuple[float, float], radius: float | None = ...
+ ) -> bool: ...
+ def contains_points(
+ self, points: ArrayLike, radius: float | None = ...
+ ) -> np.ndarray: ...
+ def get_extents(self) -> Bbox: ...
+ def get_transform(self) -> Transform: ...
+ def get_data_transform(self) -> Transform: ...
+ def get_patch_transform(self) -> Transform: ...
+ def get_antialiased(self) -> bool: ...
+ def get_edgecolor(self) -> ColorType: ...
+ def get_facecolor(self) -> ColorType: ...
+ def get_linewidth(self) -> float: ...
+ def get_linestyle(self) -> LineStyleType: ...
+ def set_antialiased(self, aa: bool | None) -> None: ...
+ def set_edgecolor(self, color: ColorType | None) -> None: ...
+ def set_facecolor(self, color: ColorType | None) -> None: ...
+ def set_color(self, c: ColorType | None) -> None: ...
+ def set_alpha(self, alpha: float | None) -> None: ...
+ def set_linewidth(self, w: float | None) -> None: ...
+ def set_linestyle(self, ls: LineStyleType | None) -> None: ...
+ def set_fill(self, b: bool) -> None: ...
+ def get_fill(self) -> bool: ...
+ fill = property(get_fill, set_fill)
+ def set_capstyle(self, s: CapStyleType) -> None: ...
+ def get_capstyle(self) -> Literal["butt", "projecting", "round"]: ...
+ def set_joinstyle(self, s: JoinStyleType) -> None: ...
+ def get_joinstyle(self) -> Literal["miter", "round", "bevel"]: ...
+ def set_hatch(self, hatch: str) -> None: ...
+ def set_hatch_linewidth(self, lw: float) -> None: ...
+ def get_hatch_linewidth(self) -> float: ...
+ def get_hatch(self) -> str: ...
+ def get_path(self) -> Path: ...
+
+class Shadow(Patch):
+ patch: Patch
+ def __init__(self, patch: Patch, ox: float, oy: float, *, shade: float = ..., **kwargs) -> None: ...
+
+class Rectangle(Patch):
+ angle: float
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ width: float,
+ height: float,
+ *,
+ angle: float = ...,
+ rotation_point: Literal["xy", "center"] | tuple[float, float] = ...,
+ **kwargs,
+ ) -> None: ...
+ @property
+ def rotation_point(self) -> Literal["xy", "center"] | tuple[float, float]: ...
+ @rotation_point.setter
+ def rotation_point(
+ self, value: Literal["xy", "center"] | tuple[float, float]
+ ) -> None: ...
+ def get_x(self) -> float: ...
+ def get_y(self) -> float: ...
+ def get_xy(self) -> tuple[float, float]: ...
+ def get_corners(self) -> np.ndarray: ...
+ def get_center(self) -> np.ndarray: ...
+ def get_width(self) -> float: ...
+ def get_height(self) -> float: ...
+ def get_angle(self) -> float: ...
+ def set_x(self, x: float) -> None: ...
+ def set_y(self, y: float) -> None: ...
+ def set_angle(self, angle: float) -> None: ...
+ def set_xy(self, xy: tuple[float, float]) -> None: ...
+ def set_width(self, w: float) -> None: ...
+ def set_height(self, h: float) -> None: ...
+ @overload
+ def set_bounds(self, args: tuple[float, float, float, float], /) -> None: ...
+ @overload
+ def set_bounds(
+ self, left: float, bottom: float, width: float, height: float, /
+ ) -> None: ...
+ def get_bbox(self) -> Bbox: ...
+ xy = property(get_xy, set_xy)
+
+class RegularPolygon(Patch):
+ xy: tuple[float, float]
+ numvertices: int
+ orientation: float
+ radius: float
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ numVertices: int,
+ *,
+ radius: float = ...,
+ orientation: float = ...,
+ **kwargs,
+ ) -> None: ...
+
+class PathPatch(Patch):
+ def __init__(self, path: Path, **kwargs) -> None: ...
+ def set_path(self, path: Path) -> None: ...
+
+class StepPatch(PathPatch):
+ orientation: Literal["vertical", "horizontal"]
+ def __init__(
+ self,
+ values: ArrayLike,
+ edges: ArrayLike,
+ *,
+ orientation: Literal["vertical", "horizontal"] = ...,
+ baseline: float = ...,
+ **kwargs,
+ ) -> None: ...
+
+ # NamedTuple StairData, defined in body of method
+ def get_data(self) -> tuple[np.ndarray, np.ndarray, float]: ...
+ def set_data(
+ self,
+ values: ArrayLike | None = ...,
+ edges: ArrayLike | None = ...,
+ baseline: float | None = ...,
+ ) -> None: ...
+
+class Polygon(Patch):
+ def __init__(self, xy: ArrayLike, *, closed: bool = ..., **kwargs) -> None: ...
+ def get_closed(self) -> bool: ...
+ def set_closed(self, closed: bool) -> None: ...
+ def get_xy(self) -> np.ndarray: ...
+ def set_xy(self, xy: ArrayLike) -> None: ...
+ xy = property(get_xy, set_xy)
+
+class Wedge(Patch):
+ center: tuple[float, float]
+ r: float
+ theta1: float
+ theta2: float
+ width: float | None
+ def __init__(
+ self,
+ center: tuple[float, float],
+ r: float,
+ theta1: float,
+ theta2: float,
+ *,
+ width: float | None = ...,
+ **kwargs,
+ ) -> None: ...
+ def set_center(self, center: tuple[float, float]) -> None: ...
+ def set_radius(self, radius: float) -> None: ...
+ def set_theta1(self, theta1: float) -> None: ...
+ def set_theta2(self, theta2: float) -> None: ...
+ def set_width(self, width: float | None) -> None: ...
+
+class Arrow(Patch):
+ def __init__(
+ self, x: float, y: float, dx: float, dy: float, *, width: float = ..., **kwargs
+ ) -> None: ...
+ def set_data(
+ self,
+ x: float | None = ...,
+ y: float | None = ...,
+ dx: float | None = ...,
+ dy: float | None = ...,
+ width: float | None = ...,
+ ) -> None: ...
+class FancyArrow(Polygon):
+ def __init__(
+ self,
+ x: float,
+ y: float,
+ dx: float,
+ dy: float,
+ *,
+ width: float = ...,
+ length_includes_head: bool = ...,
+ head_width: float | None = ...,
+ head_length: float | None = ...,
+ shape: Literal["full", "left", "right"] = ...,
+ overhang: float = ...,
+ head_starts_at_zero: bool = ...,
+ **kwargs,
+ ) -> None: ...
+ def set_data(
+ self,
+ *,
+ x: float | None = ...,
+ y: float | None = ...,
+ dx: float | None = ...,
+ dy: float | None = ...,
+ width: float | None = ...,
+ head_width: float | None = ...,
+ head_length: float | None = ...,
+ ) -> None: ...
+
+class CirclePolygon(RegularPolygon):
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ radius: float = ...,
+ *,
+ resolution: int = ...,
+ **kwargs,
+ ) -> None: ...
+
+class Ellipse(Patch):
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ width: float,
+ height: float,
+ *,
+ angle: float = ...,
+ **kwargs,
+ ) -> None: ...
+ def set_center(self, xy: tuple[float, float]) -> None: ...
+ def get_center(self) -> float: ...
+ center = property(get_center, set_center)
+
+ def set_width(self, width: float) -> None: ...
+ def get_width(self) -> float: ...
+ width = property(get_width, set_width)
+
+ def set_height(self, height: float) -> None: ...
+ def get_height(self) -> float: ...
+ height = property(get_height, set_height)
+
+ def set_angle(self, angle: float) -> None: ...
+ def get_angle(self) -> float: ...
+ angle = property(get_angle, set_angle)
+
+ def get_corners(self) -> np.ndarray: ...
+
+ def get_vertices(self) -> list[tuple[float, float]]: ...
+ def get_co_vertices(self) -> list[tuple[float, float]]: ...
+
+
+class Annulus(Patch):
+ a: float
+ b: float
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ r: float | tuple[float, float],
+ width: float,
+ angle: float = ...,
+ **kwargs,
+ ) -> None: ...
+ def set_center(self, xy: tuple[float, float]) -> None: ...
+ def get_center(self) -> tuple[float, float]: ...
+ center = property(get_center, set_center)
+
+ def set_width(self, width: float) -> None: ...
+ def get_width(self) -> float: ...
+ width = property(get_width, set_width)
+
+ def set_angle(self, angle: float) -> None: ...
+ def get_angle(self) -> float: ...
+ angle = property(get_angle, set_angle)
+
+ def set_semimajor(self, a: float) -> None: ...
+ def set_semiminor(self, b: float) -> None: ...
+ def set_radii(self, r: float | tuple[float, float]) -> None: ...
+ def get_radii(self) -> tuple[float, float]: ...
+ radii = property(get_radii, set_radii)
+
+class Circle(Ellipse):
+ def __init__(
+ self, xy: tuple[float, float], radius: float = ..., **kwargs
+ ) -> None: ...
+ def set_radius(self, radius: float) -> None: ...
+ def get_radius(self) -> float: ...
+ radius = property(get_radius, set_radius)
+
+class Arc(Ellipse):
+ theta1: float
+ theta2: float
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ width: float,
+ height: float,
+ *,
+ angle: float = ...,
+ theta1: float = ...,
+ theta2: float = ...,
+ **kwargs,
+ ) -> None: ...
+
+def bbox_artist(
+ artist: artist.Artist,
+ renderer: RendererBase,
+ props: dict[str, Any] | None = ...,
+ fill: bool = ...,
+) -> None: ...
+def draw_bbox(
+ bbox: Bbox,
+ renderer: RendererBase,
+ color: ColorType = ...,
+ trans: Transform | None = ...,
+) -> None: ...
+
+class _Style:
+ def __new__(cls, stylename, **kwargs): ...
+ @classmethod
+ def get_styles(cls) -> dict[str, type]: ...
+ @classmethod
+ def pprint_styles(cls) -> str: ...
+ @classmethod
+ def register(cls, name: str, style: type) -> None: ...
+
+class BoxStyle(_Style):
+ class Square(BoxStyle):
+ pad: float
+ def __init__(self, pad: float = ...) -> None: ...
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class Circle(BoxStyle):
+ pad: float
+ def __init__(self, pad: float = ...) -> None: ...
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class Ellipse(BoxStyle):
+ pad: float
+ def __init__(self, pad: float = ...) -> None: ...
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class LArrow(BoxStyle):
+ pad: float
+ def __init__(self, pad: float = ...) -> None: ...
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class RArrow(LArrow):
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class DArrow(BoxStyle):
+ pad: float
+ def __init__(self, pad: float = ...) -> None: ...
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class Round(BoxStyle):
+ pad: float
+ rounding_size: float | None
+ def __init__(
+ self, pad: float = ..., rounding_size: float | None = ...
+ ) -> None: ...
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class Round4(BoxStyle):
+ pad: float
+ rounding_size: float | None
+ def __init__(
+ self, pad: float = ..., rounding_size: float | None = ...
+ ) -> None: ...
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class Sawtooth(BoxStyle):
+ pad: float
+ tooth_size: float | None
+ def __init__(
+ self, pad: float = ..., tooth_size: float | None = ...
+ ) -> None: ...
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+ class Roundtooth(Sawtooth):
+ def __call__(
+ self,
+ x0: float,
+ y0: float,
+ width: float,
+ height: float,
+ mutation_size: float,
+ ) -> Path: ...
+
+class ConnectionStyle(_Style):
+ class _Base(ConnectionStyle):
+ def __call__(
+ self,
+ posA: tuple[float, float],
+ posB: tuple[float, float],
+ shrinkA: float = ...,
+ shrinkB: float = ...,
+ patchA: Patch | None = ...,
+ patchB: Patch | None = ...,
+ ) -> Path: ...
+
+ class Arc3(_Base):
+ rad: float
+ def __init__(self, rad: float = ...) -> None: ...
+ def connect(
+ self, posA: tuple[float, float], posB: tuple[float, float]
+ ) -> Path: ...
+
+ class Angle3(_Base):
+ angleA: float
+ angleB: float
+ def __init__(self, angleA: float = ..., angleB: float = ...) -> None: ...
+ def connect(
+ self, posA: tuple[float, float], posB: tuple[float, float]
+ ) -> Path: ...
+
+ class Angle(_Base):
+ angleA: float
+ angleB: float
+ rad: float
+ def __init__(
+ self, angleA: float = ..., angleB: float = ..., rad: float = ...
+ ) -> None: ...
+ def connect(
+ self, posA: tuple[float, float], posB: tuple[float, float]
+ ) -> Path: ...
+
+ class Arc(_Base):
+ angleA: float
+ angleB: float
+ armA: float | None
+ armB: float | None
+ rad: float
+ def __init__(
+ self,
+ angleA: float = ...,
+ angleB: float = ...,
+ armA: float | None = ...,
+ armB: float | None = ...,
+ rad: float = ...,
+ ) -> None: ...
+ def connect(
+ self, posA: tuple[float, float], posB: tuple[float, float]
+ ) -> Path: ...
+
+ class Bar(_Base):
+ armA: float
+ armB: float
+ fraction: float
+ angle: float | None
+ def __init__(
+ self,
+ armA: float = ...,
+ armB: float = ...,
+ fraction: float = ...,
+ angle: float | None = ...,
+ ) -> None: ...
+ def connect(
+ self, posA: tuple[float, float], posB: tuple[float, float]
+ ) -> Path: ...
+
+class ArrowStyle(_Style):
+ class _Base(ArrowStyle):
+ @staticmethod
+ def ensure_quadratic_bezier(path: Path) -> list[float]: ...
+ def transmute(
+ self, path: Path, mutation_size: float, linewidth: float
+ ) -> tuple[Path, bool]: ...
+ def __call__(
+ self,
+ path: Path,
+ mutation_size: float,
+ linewidth: float,
+ aspect_ratio: float = ...,
+ ) -> tuple[Path, bool]: ...
+
+ class _Curve(_Base):
+ arrow: str
+ fillbegin: bool
+ fillend: bool
+ def __init__(
+ self,
+ head_length: float = ...,
+ head_width: float = ...,
+ widthA: float = ...,
+ widthB: float = ...,
+ lengthA: float = ...,
+ lengthB: float = ...,
+ angleA: float | None = ...,
+ angleB: float | None = ...,
+ scaleA: float | None = ...,
+ scaleB: float | None = ...,
+ ) -> None: ...
+
+ class Curve(_Curve):
+ def __init__(self) -> None: ...
+
+ class CurveA(_Curve):
+ arrow: str
+
+ class CurveB(_Curve):
+ arrow: str
+
+ class CurveAB(_Curve):
+ arrow: str
+
+ class CurveFilledA(_Curve):
+ arrow: str
+
+ class CurveFilledB(_Curve):
+ arrow: str
+
+ class CurveFilledAB(_Curve):
+ arrow: str
+
+ class BracketA(_Curve):
+ arrow: str
+ def __init__(
+ self, widthA: float = ..., lengthA: float = ..., angleA: float = ...
+ ) -> None: ...
+
+ class BracketB(_Curve):
+ arrow: str
+ def __init__(
+ self, widthB: float = ..., lengthB: float = ..., angleB: float = ...
+ ) -> None: ...
+
+ class BracketAB(_Curve):
+ arrow: str
+ def __init__(
+ self,
+ widthA: float = ...,
+ lengthA: float = ...,
+ angleA: float = ...,
+ widthB: float = ...,
+ lengthB: float = ...,
+ angleB: float = ...,
+ ) -> None: ...
+
+ class BarAB(_Curve):
+ arrow: str
+ def __init__(
+ self,
+ widthA: float = ...,
+ angleA: float = ...,
+ widthB: float = ...,
+ angleB: float = ...,
+ ) -> None: ...
+
+ class BracketCurve(_Curve):
+ arrow: str
+ def __init__(
+ self, widthA: float = ..., lengthA: float = ..., angleA: float | None = ...
+ ) -> None: ...
+
+ class CurveBracket(_Curve):
+ arrow: str
+ def __init__(
+ self, widthB: float = ..., lengthB: float = ..., angleB: float | None = ...
+ ) -> None: ...
+
+ class Simple(_Base):
+ def __init__(
+ self,
+ head_length: float = ...,
+ head_width: float = ...,
+ tail_width: float = ...,
+ ) -> None: ...
+
+ class Fancy(_Base):
+ def __init__(
+ self,
+ head_length: float = ...,
+ head_width: float = ...,
+ tail_width: float = ...,
+ ) -> None: ...
+
+ class Wedge(_Base):
+ tail_width: float
+ shrink_factor: float
+ def __init__(
+ self, tail_width: float = ..., shrink_factor: float = ...
+ ) -> None: ...
+
+class FancyBboxPatch(Patch):
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ width: float,
+ height: float,
+ boxstyle: str | BoxStyle = ...,
+ *,
+ mutation_scale: float = ...,
+ mutation_aspect: float = ...,
+ **kwargs,
+ ) -> None: ...
+ def set_boxstyle(self, boxstyle: str | BoxStyle | None = ..., **kwargs) -> None: ...
+ def get_boxstyle(self) -> BoxStyle: ...
+ def set_mutation_scale(self, scale: float) -> None: ...
+ def get_mutation_scale(self) -> float: ...
+ def set_mutation_aspect(self, aspect: float) -> None: ...
+ def get_mutation_aspect(self) -> float: ...
+ def get_x(self) -> float: ...
+ def get_y(self) -> float: ...
+ def get_width(self) -> float: ...
+ def get_height(self) -> float: ...
+ def set_x(self, x: float) -> None: ...
+ def set_y(self, y: float) -> None: ...
+ def set_width(self, w: float) -> None: ...
+ def set_height(self, h: float) -> None: ...
+ @overload
+ def set_bounds(self, args: tuple[float, float, float, float], /) -> None: ...
+ @overload
+ def set_bounds(
+ self, left: float, bottom: float, width: float, height: float, /
+ ) -> None: ...
+ def get_bbox(self) -> Bbox: ...
+
+class FancyArrowPatch(Patch):
+ patchA: Patch
+ patchB: Patch
+ shrinkA: float
+ shrinkB: float
+ def __init__(
+ self,
+ posA: tuple[float, float] | None = ...,
+ posB: tuple[float, float] | None = ...,
+ *,
+ path: Path | None = ...,
+ arrowstyle: str | ArrowStyle = ...,
+ connectionstyle: str | ConnectionStyle = ...,
+ patchA: Patch | None = ...,
+ patchB: Patch | None = ...,
+ shrinkA: float = ...,
+ shrinkB: float = ...,
+ mutation_scale: float = ...,
+ mutation_aspect: float | None = ...,
+ **kwargs,
+ ) -> None: ...
+ def set_positions(
+ self, posA: tuple[float, float], posB: tuple[float, float]
+ ) -> None: ...
+ def set_patchA(self, patchA: Patch) -> None: ...
+ def set_patchB(self, patchB: Patch) -> None: ...
+ def set_connectionstyle(self, connectionstyle: str | ConnectionStyle | None = ..., **kwargs) -> None: ...
+ def get_connectionstyle(self) -> ConnectionStyle: ...
+ def set_arrowstyle(self, arrowstyle: str | ArrowStyle | None = ..., **kwargs) -> None: ...
+ def get_arrowstyle(self) -> ArrowStyle: ...
+ def set_mutation_scale(self, scale: float) -> None: ...
+ def get_mutation_scale(self) -> float: ...
+ def set_mutation_aspect(self, aspect: float | None) -> None: ...
+ def get_mutation_aspect(self) -> float: ...
+
+class ConnectionPatch(FancyArrowPatch):
+ xy1: tuple[float, float]
+ xy2: tuple[float, float]
+ coords1: str | Transform
+ coords2: str | Transform | None
+ axesA: Axes | None
+ axesB: Axes | None
+ def __init__(
+ self,
+ xyA: tuple[float, float],
+ xyB: tuple[float, float],
+ coordsA: str | Transform,
+ coordsB: str | Transform | None = ...,
+ *,
+ axesA: Axes | None = ...,
+ axesB: Axes | None = ...,
+ arrowstyle: str | ArrowStyle = ...,
+ connectionstyle: str | ConnectionStyle = ...,
+ patchA: Patch | None = ...,
+ patchB: Patch | None = ...,
+ shrinkA: float = ...,
+ shrinkB: float = ...,
+ mutation_scale: float = ...,
+ mutation_aspect: float | None = ...,
+ clip_on: bool = ...,
+ **kwargs,
+ ) -> None: ...
+ def set_annotation_clip(self, b: bool | None) -> None: ...
+ def get_annotation_clip(self) -> bool | None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/path.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/path.py
new file mode 100644
index 0000000000000000000000000000000000000000..3fa3fb262e27a31a116834a356314799d4539dae
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/path.py
@@ -0,0 +1,1114 @@
+r"""
+A module for dealing with the polylines used throughout Matplotlib.
+
+The primary class for polyline handling in Matplotlib is `Path`. Almost all
+vector drawing makes use of `Path`\s somewhere in the drawing pipeline.
+
+Whilst a `Path` instance itself cannot be drawn, some `.Artist` subclasses,
+such as `.PathPatch` and `.PathCollection`, can be used for convenient `Path`
+visualisation.
+"""
+
+import copy
+from functools import lru_cache
+from weakref import WeakValueDictionary
+
+import numpy as np
+
+import matplotlib as mpl
+from . import _api, _path
+from .cbook import _to_unmasked_float_array, simple_linear_interpolation
+from .bezier import BezierSegment
+
+
+class Path:
+ """
+ A series of possibly disconnected, possibly closed, line and curve
+ segments.
+
+ The underlying storage is made up of two parallel numpy arrays:
+
+ - *vertices*: an (N, 2) float array of vertices
+ - *codes*: an N-length `numpy.uint8` array of path codes, or None
+
+ These two arrays always have the same length in the first
+ dimension. For example, to represent a cubic curve, you must
+ provide three vertices and three `CURVE4` codes.
+
+ The code types are:
+
+ - `STOP` : 1 vertex (ignored)
+ A marker for the end of the entire path (currently not required and
+ ignored)
+
+ - `MOVETO` : 1 vertex
+ Pick up the pen and move to the given vertex.
+
+ - `LINETO` : 1 vertex
+ Draw a line from the current position to the given vertex.
+
+ - `CURVE3` : 1 control point, 1 endpoint
+ Draw a quadratic BƩzier curve from the current position, with the given
+ control point, to the given end point.
+
+ - `CURVE4` : 2 control points, 1 endpoint
+ Draw a cubic BƩzier curve from the current position, with the given
+ control points, to the given end point.
+
+ - `CLOSEPOLY` : 1 vertex (ignored)
+ Draw a line segment to the start point of the current polyline.
+
+ If *codes* is None, it is interpreted as a `MOVETO` followed by a series
+ of `LINETO`.
+
+ Users of Path objects should not access the vertices and codes arrays
+ directly. Instead, they should use `iter_segments` or `cleaned` to get the
+ vertex/code pairs. This helps, in particular, to consistently handle the
+ case of *codes* being None.
+
+ Some behavior of Path objects can be controlled by rcParams. See the
+ rcParams whose keys start with 'path.'.
+
+ .. note::
+
+ The vertices and codes arrays should be treated as
+ immutable -- there are a number of optimizations and assumptions
+ made up front in the constructor that will not change when the
+ data changes.
+ """
+
+ code_type = np.uint8
+
+ # Path codes
+ STOP = code_type(0) # 1 vertex
+ MOVETO = code_type(1) # 1 vertex
+ LINETO = code_type(2) # 1 vertex
+ CURVE3 = code_type(3) # 2 vertices
+ CURVE4 = code_type(4) # 3 vertices
+ CLOSEPOLY = code_type(79) # 1 vertex
+
+ #: A dictionary mapping Path codes to the number of vertices that the
+ #: code expects.
+ NUM_VERTICES_FOR_CODE = {STOP: 1,
+ MOVETO: 1,
+ LINETO: 1,
+ CURVE3: 2,
+ CURVE4: 3,
+ CLOSEPOLY: 1}
+
+ def __init__(self, vertices, codes=None, _interpolation_steps=1,
+ closed=False, readonly=False):
+ """
+ Create a new path with the given vertices and codes.
+
+ Parameters
+ ----------
+ vertices : (N, 2) array-like
+ The path vertices, as an array, masked array or sequence of pairs.
+ Masked values, if any, will be converted to NaNs, which are then
+ handled correctly by the Agg PathIterator and other consumers of
+ path data, such as :meth:`iter_segments`.
+ codes : array-like or None, optional
+ N-length array of integers representing the codes of the path.
+ If not None, codes must be the same length as vertices.
+ If None, *vertices* will be treated as a series of line segments.
+ _interpolation_steps : int, optional
+ Used as a hint to certain projections, such as Polar, that this
+ path should be linearly interpolated immediately before drawing.
+ This attribute is primarily an implementation detail and is not
+ intended for public use.
+ closed : bool, optional
+ If *codes* is None and closed is True, vertices will be treated as
+ line segments of a closed polygon. Note that the last vertex will
+ then be ignored (as the corresponding code will be set to
+ `CLOSEPOLY`).
+ readonly : bool, optional
+ Makes the path behave in an immutable way and sets the vertices
+ and codes as read-only arrays.
+ """
+ vertices = _to_unmasked_float_array(vertices)
+ _api.check_shape((None, 2), vertices=vertices)
+
+ if codes is not None and len(vertices):
+ codes = np.asarray(codes, self.code_type)
+ if codes.ndim != 1 or len(codes) != len(vertices):
+ raise ValueError("'codes' must be a 1D list or array with the "
+ "same length of 'vertices'. "
+ f"Your vertices have shape {vertices.shape} "
+ f"but your codes have shape {codes.shape}")
+ if len(codes) and codes[0] != self.MOVETO:
+ raise ValueError("The first element of 'code' must be equal "
+ f"to 'MOVETO' ({self.MOVETO}). "
+ f"Your first code is {codes[0]}")
+ elif closed and len(vertices):
+ codes = np.empty(len(vertices), dtype=self.code_type)
+ codes[0] = self.MOVETO
+ codes[1:-1] = self.LINETO
+ codes[-1] = self.CLOSEPOLY
+
+ self._vertices = vertices
+ self._codes = codes
+ self._interpolation_steps = _interpolation_steps
+ self._update_values()
+
+ if readonly:
+ self._vertices.flags.writeable = False
+ if self._codes is not None:
+ self._codes.flags.writeable = False
+ self._readonly = True
+ else:
+ self._readonly = False
+
+ @classmethod
+ def _fast_from_codes_and_verts(cls, verts, codes, internals_from=None):
+ """
+ Create a Path instance without the expense of calling the constructor.
+
+ Parameters
+ ----------
+ verts : array-like
+ codes : array
+ internals_from : Path or None
+ If not None, another `Path` from which the attributes
+ ``should_simplify``, ``simplify_threshold``, and
+ ``interpolation_steps`` will be copied. Note that ``readonly`` is
+ never copied, and always set to ``False`` by this constructor.
+ """
+ pth = cls.__new__(cls)
+ pth._vertices = _to_unmasked_float_array(verts)
+ pth._codes = codes
+ pth._readonly = False
+ if internals_from is not None:
+ pth._should_simplify = internals_from._should_simplify
+ pth._simplify_threshold = internals_from._simplify_threshold
+ pth._interpolation_steps = internals_from._interpolation_steps
+ else:
+ pth._should_simplify = True
+ pth._simplify_threshold = mpl.rcParams['path.simplify_threshold']
+ pth._interpolation_steps = 1
+ return pth
+
+ @classmethod
+ def _create_closed(cls, vertices):
+ """
+ Create a closed polygonal path going through *vertices*.
+
+ Unlike ``Path(..., closed=True)``, *vertices* should **not** end with
+ an entry for the CLOSEPATH; this entry is added by `._create_closed`.
+ """
+ v = _to_unmasked_float_array(vertices)
+ return cls(np.concatenate([v, v[:1]]), closed=True)
+
+ def _update_values(self):
+ self._simplify_threshold = mpl.rcParams['path.simplify_threshold']
+ self._should_simplify = (
+ self._simplify_threshold > 0 and
+ mpl.rcParams['path.simplify'] and
+ len(self._vertices) >= 128 and
+ (self._codes is None or np.all(self._codes <= Path.LINETO))
+ )
+
+ @property
+ def vertices(self):
+ """The vertices of the `Path` as an (N, 2) array."""
+ return self._vertices
+
+ @vertices.setter
+ def vertices(self, vertices):
+ if self._readonly:
+ raise AttributeError("Can't set vertices on a readonly Path")
+ self._vertices = vertices
+ self._update_values()
+
+ @property
+ def codes(self):
+ """
+ The list of codes in the `Path` as a 1D array.
+
+ Each code is one of `STOP`, `MOVETO`, `LINETO`, `CURVE3`, `CURVE4` or
+ `CLOSEPOLY`. For codes that correspond to more than one vertex
+ (`CURVE3` and `CURVE4`), that code will be repeated so that the length
+ of `vertices` and `codes` is always the same.
+ """
+ return self._codes
+
+ @codes.setter
+ def codes(self, codes):
+ if self._readonly:
+ raise AttributeError("Can't set codes on a readonly Path")
+ self._codes = codes
+ self._update_values()
+
+ @property
+ def simplify_threshold(self):
+ """
+ The fraction of a pixel difference below which vertices will
+ be simplified out.
+ """
+ return self._simplify_threshold
+
+ @simplify_threshold.setter
+ def simplify_threshold(self, threshold):
+ self._simplify_threshold = threshold
+
+ @property
+ def should_simplify(self):
+ """
+ `True` if the vertices array should be simplified.
+ """
+ return self._should_simplify
+
+ @should_simplify.setter
+ def should_simplify(self, should_simplify):
+ self._should_simplify = should_simplify
+
+ @property
+ def readonly(self):
+ """
+ `True` if the `Path` is read-only.
+ """
+ return self._readonly
+
+ def copy(self):
+ """
+ Return a shallow copy of the `Path`, which will share the
+ vertices and codes with the source `Path`.
+ """
+ return copy.copy(self)
+
+ def __deepcopy__(self, memo=None):
+ """
+ Return a deepcopy of the `Path`. The `Path` will not be
+ readonly, even if the source `Path` is.
+ """
+ # Deepcopying arrays (vertices, codes) strips the writeable=False flag.
+ p = copy.deepcopy(super(), memo)
+ p._readonly = False
+ return p
+
+ deepcopy = __deepcopy__
+
+ @classmethod
+ def make_compound_path_from_polys(cls, XY):
+ """
+ Make a compound `Path` object to draw a number of polygons with equal
+ numbers of sides.
+
+ .. plot:: gallery/misc/histogram_path.py
+
+ Parameters
+ ----------
+ XY : (numpolys, numsides, 2) array
+ """
+ # for each poly: 1 for the MOVETO, (numsides-1) for the LINETO, 1 for
+ # the CLOSEPOLY; the vert for the closepoly is ignored but we still
+ # need it to keep the codes aligned with the vertices
+ numpolys, numsides, two = XY.shape
+ if two != 2:
+ raise ValueError("The third dimension of 'XY' must be 2")
+ stride = numsides + 1
+ nverts = numpolys * stride
+ verts = np.zeros((nverts, 2))
+ codes = np.full(nverts, cls.LINETO, dtype=cls.code_type)
+ codes[0::stride] = cls.MOVETO
+ codes[numsides::stride] = cls.CLOSEPOLY
+ for i in range(numsides):
+ verts[i::stride] = XY[:, i]
+ return cls(verts, codes)
+
+ @classmethod
+ def make_compound_path(cls, *args):
+ r"""
+ Concatenate a list of `Path`\s into a single `Path`, removing all `STOP`\s.
+ """
+ if not args:
+ return Path(np.empty([0, 2], dtype=np.float32))
+ vertices = np.concatenate([path.vertices for path in args])
+ codes = np.empty(len(vertices), dtype=cls.code_type)
+ i = 0
+ for path in args:
+ size = len(path.vertices)
+ if path.codes is None:
+ if size:
+ codes[i] = cls.MOVETO
+ codes[i+1:i+size] = cls.LINETO
+ else:
+ codes[i:i+size] = path.codes
+ i += size
+ not_stop_mask = codes != cls.STOP # Remove STOPs, as internal STOPs are a bug.
+ return cls(vertices[not_stop_mask], codes[not_stop_mask])
+
+ def __repr__(self):
+ return f"Path({self.vertices!r}, {self.codes!r})"
+
+ def __len__(self):
+ return len(self.vertices)
+
+ def iter_segments(self, transform=None, remove_nans=True, clip=None,
+ snap=False, stroke_width=1.0, simplify=None,
+ curves=True, sketch=None):
+ """
+ Iterate over all curve segments in the path.
+
+ Each iteration returns a pair ``(vertices, code)``, where ``vertices``
+ is a sequence of 1-3 coordinate pairs, and ``code`` is a `Path` code.
+
+ Additionally, this method can provide a number of standard cleanups and
+ conversions to the path.
+
+ Parameters
+ ----------
+ transform : None or :class:`~matplotlib.transforms.Transform`
+ If not None, the given affine transformation will be applied to the
+ path.
+ remove_nans : bool, optional
+ Whether to remove all NaNs from the path and skip over them using
+ MOVETO commands.
+ clip : None or (float, float, float, float), optional
+ If not None, must be a four-tuple (x1, y1, x2, y2)
+ defining a rectangle in which to clip the path.
+ snap : None or bool, optional
+ If True, snap all nodes to pixels; if False, don't snap them.
+ If None, snap if the path contains only segments
+ parallel to the x or y axes, and no more than 1024 of them.
+ stroke_width : float, optional
+ The width of the stroke being drawn (used for path snapping).
+ simplify : None or bool, optional
+ Whether to simplify the path by removing vertices
+ that do not affect its appearance. If None, use the
+ :attr:`should_simplify` attribute. See also :rc:`path.simplify`
+ and :rc:`path.simplify_threshold`.
+ curves : bool, optional
+ If True, curve segments will be returned as curve segments.
+ If False, all curves will be converted to line segments.
+ sketch : None or sequence, optional
+ If not None, must be a 3-tuple of the form
+ (scale, length, randomness), representing the sketch parameters.
+ """
+ if not len(self):
+ return
+
+ cleaned = self.cleaned(transform=transform,
+ remove_nans=remove_nans, clip=clip,
+ snap=snap, stroke_width=stroke_width,
+ simplify=simplify, curves=curves,
+ sketch=sketch)
+
+ # Cache these object lookups for performance in the loop.
+ NUM_VERTICES_FOR_CODE = self.NUM_VERTICES_FOR_CODE
+ STOP = self.STOP
+
+ vertices = iter(cleaned.vertices)
+ codes = iter(cleaned.codes)
+ for curr_vertices, code in zip(vertices, codes):
+ if code == STOP:
+ break
+ extra_vertices = NUM_VERTICES_FOR_CODE[code] - 1
+ if extra_vertices:
+ for i in range(extra_vertices):
+ next(codes)
+ curr_vertices = np.append(curr_vertices, next(vertices))
+ yield curr_vertices, code
+
+ def iter_bezier(self, **kwargs):
+ """
+ Iterate over each BƩzier curve (lines included) in a `Path`.
+
+ Parameters
+ ----------
+ **kwargs
+ Forwarded to `.iter_segments`.
+
+ Yields
+ ------
+ B : `~matplotlib.bezier.BezierSegment`
+ The BƩzier curves that make up the current path. Note in particular
+ that freestanding points are BƩzier curves of order 0, and lines
+ are BƩzier curves of order 1 (with two control points).
+ code : `~matplotlib.path.Path.code_type`
+ The code describing what kind of curve is being returned.
+ `MOVETO`, `LINETO`, `CURVE3`, and `CURVE4` correspond to
+ BƩzier curves with 1, 2, 3, and 4 control points (respectively).
+ `CLOSEPOLY` is a `LINETO` with the control points correctly
+ chosen based on the start/end points of the current stroke.
+ """
+ first_vert = None
+ prev_vert = None
+ for verts, code in self.iter_segments(**kwargs):
+ if first_vert is None:
+ if code != Path.MOVETO:
+ raise ValueError("Malformed path, must start with MOVETO.")
+ if code == Path.MOVETO: # a point is like "CURVE1"
+ first_vert = verts
+ yield BezierSegment(np.array([first_vert])), code
+ elif code == Path.LINETO: # "CURVE2"
+ yield BezierSegment(np.array([prev_vert, verts])), code
+ elif code == Path.CURVE3:
+ yield BezierSegment(np.array([prev_vert, verts[:2],
+ verts[2:]])), code
+ elif code == Path.CURVE4:
+ yield BezierSegment(np.array([prev_vert, verts[:2],
+ verts[2:4], verts[4:]])), code
+ elif code == Path.CLOSEPOLY:
+ yield BezierSegment(np.array([prev_vert, first_vert])), code
+ elif code == Path.STOP:
+ return
+ else:
+ raise ValueError(f"Invalid Path.code_type: {code}")
+ prev_vert = verts[-2:]
+
+ def _iter_connected_components(self):
+ """Return subpaths split at MOVETOs."""
+ if self.codes is None:
+ yield self
+ else:
+ idxs = np.append((self.codes == Path.MOVETO).nonzero()[0], len(self.codes))
+ for sl in map(slice, idxs, idxs[1:]):
+ yield Path._fast_from_codes_and_verts(
+ self.vertices[sl], self.codes[sl], self)
+
+ def cleaned(self, transform=None, remove_nans=False, clip=None,
+ *, simplify=False, curves=False,
+ stroke_width=1.0, snap=False, sketch=None):
+ """
+ Return a new `Path` with vertices and codes cleaned according to the
+ parameters.
+
+ See Also
+ --------
+ Path.iter_segments : for details of the keyword arguments.
+ """
+ vertices, codes = _path.cleanup_path(
+ self, transform, remove_nans, clip, snap, stroke_width, simplify,
+ curves, sketch)
+ pth = Path._fast_from_codes_and_verts(vertices, codes, self)
+ if not simplify:
+ pth._should_simplify = False
+ return pth
+
+ def transformed(self, transform):
+ """
+ Return a transformed copy of the path.
+
+ See Also
+ --------
+ matplotlib.transforms.TransformedPath
+ A specialized path class that will cache the transformed result and
+ automatically update when the transform changes.
+ """
+ return Path(transform.transform(self.vertices), self.codes,
+ self._interpolation_steps)
+
+ def contains_point(self, point, transform=None, radius=0.0):
+ """
+ Return whether the area enclosed by the path contains the given point.
+
+ The path is always treated as closed; i.e. if the last code is not
+ `CLOSEPOLY` an implicit segment connecting the last vertex to the first
+ vertex is assumed.
+
+ Parameters
+ ----------
+ point : (float, float)
+ The point (x, y) to check.
+ transform : `~matplotlib.transforms.Transform`, optional
+ If not ``None``, *point* will be compared to ``self`` transformed
+ by *transform*; i.e. for a correct check, *transform* should
+ transform the path into the coordinate system of *point*.
+ radius : float, default: 0
+ Additional margin on the path in coordinates of *point*.
+ The path is extended tangentially by *radius/2*; i.e. if you would
+ draw the path with a linewidth of *radius*, all points on the line
+ would still be considered to be contained in the area. Conversely,
+ negative values shrink the area: Points on the imaginary line
+ will be considered outside the area.
+
+ Returns
+ -------
+ bool
+
+ Notes
+ -----
+ The current algorithm has some limitations:
+
+ - The result is undefined for points exactly at the boundary
+ (i.e. at the path shifted by *radius/2*).
+ - The result is undefined if there is no enclosed area, i.e. all
+ vertices are on a straight line.
+ - If bounding lines start to cross each other due to *radius* shift,
+ the result is not guaranteed to be correct.
+ """
+ if transform is not None:
+ transform = transform.frozen()
+ # `point_in_path` does not handle nonlinear transforms, so we
+ # transform the path ourselves. If *transform* is affine, letting
+ # `point_in_path` handle the transform avoids allocating an extra
+ # buffer.
+ if transform and not transform.is_affine:
+ self = transform.transform_path(self)
+ transform = None
+ return _path.point_in_path(point[0], point[1], radius, self, transform)
+
+ def contains_points(self, points, transform=None, radius=0.0):
+ """
+ Return whether the area enclosed by the path contains the given points.
+
+ The path is always treated as closed; i.e. if the last code is not
+ `CLOSEPOLY` an implicit segment connecting the last vertex to the first
+ vertex is assumed.
+
+ Parameters
+ ----------
+ points : (N, 2) array
+ The points to check. Columns contain x and y values.
+ transform : `~matplotlib.transforms.Transform`, optional
+ If not ``None``, *points* will be compared to ``self`` transformed
+ by *transform*; i.e. for a correct check, *transform* should
+ transform the path into the coordinate system of *points*.
+ radius : float, default: 0
+ Additional margin on the path in coordinates of *points*.
+ The path is extended tangentially by *radius/2*; i.e. if you would
+ draw the path with a linewidth of *radius*, all points on the line
+ would still be considered to be contained in the area. Conversely,
+ negative values shrink the area: Points on the imaginary line
+ will be considered outside the area.
+
+ Returns
+ -------
+ length-N bool array
+
+ Notes
+ -----
+ The current algorithm has some limitations:
+
+ - The result is undefined for points exactly at the boundary
+ (i.e. at the path shifted by *radius/2*).
+ - The result is undefined if there is no enclosed area, i.e. all
+ vertices are on a straight line.
+ - If bounding lines start to cross each other due to *radius* shift,
+ the result is not guaranteed to be correct.
+ """
+ if transform is not None:
+ transform = transform.frozen()
+ result = _path.points_in_path(points, radius, self, transform)
+ return result.astype('bool')
+
+ def contains_path(self, path, transform=None):
+ """
+ Return whether this (closed) path completely contains the given path.
+
+ If *transform* is not ``None``, the path will be transformed before
+ checking for containment.
+ """
+ if transform is not None:
+ transform = transform.frozen()
+ return _path.path_in_path(self, None, path, transform)
+
+ def get_extents(self, transform=None, **kwargs):
+ """
+ Get Bbox of the path.
+
+ Parameters
+ ----------
+ transform : `~matplotlib.transforms.Transform`, optional
+ Transform to apply to path before computing extents, if any.
+ **kwargs
+ Forwarded to `.iter_bezier`.
+
+ Returns
+ -------
+ matplotlib.transforms.Bbox
+ The extents of the path Bbox([[xmin, ymin], [xmax, ymax]])
+ """
+ from .transforms import Bbox
+ if transform is not None:
+ self = transform.transform_path(self)
+ if self.codes is None:
+ xys = self.vertices
+ elif len(np.intersect1d(self.codes, [Path.CURVE3, Path.CURVE4])) == 0:
+ # Optimization for the straight line case.
+ # Instead of iterating through each curve, consider
+ # each line segment's end-points
+ # (recall that STOP and CLOSEPOLY vertices are ignored)
+ xys = self.vertices[np.isin(self.codes,
+ [Path.MOVETO, Path.LINETO])]
+ else:
+ xys = []
+ for curve, code in self.iter_bezier(**kwargs):
+ # places where the derivative is zero can be extrema
+ _, dzeros = curve.axis_aligned_extrema()
+ # as can the ends of the curve
+ xys.append(curve([0, *dzeros, 1]))
+ xys = np.concatenate(xys)
+ if len(xys):
+ return Bbox([xys.min(axis=0), xys.max(axis=0)])
+ else:
+ return Bbox.null()
+
+ def intersects_path(self, other, filled=True):
+ """
+ Return whether if this path intersects another given path.
+
+ If *filled* is True, then this also returns True if one path completely
+ encloses the other (i.e., the paths are treated as filled).
+ """
+ return _path.path_intersects_path(self, other, filled)
+
+ def intersects_bbox(self, bbox, filled=True):
+ """
+ Return whether this path intersects a given `~.transforms.Bbox`.
+
+ If *filled* is True, then this also returns True if the path completely
+ encloses the `.Bbox` (i.e., the path is treated as filled).
+
+ The bounding box is always considered filled.
+ """
+ return _path.path_intersects_rectangle(
+ self, bbox.x0, bbox.y0, bbox.x1, bbox.y1, filled)
+
+ def interpolated(self, steps):
+ """
+ Return a new path with each segment divided into *steps* parts.
+
+ Codes other than `LINETO`, `MOVETO`, and `CLOSEPOLY` are not handled correctly.
+
+ Parameters
+ ----------
+ steps : int
+ The number of segments in the new path for each in the original.
+
+ Returns
+ -------
+ Path
+ The interpolated path.
+ """
+ if steps == 1 or len(self) == 0:
+ return self
+
+ if self.codes is not None and self.MOVETO in self.codes[1:]:
+ return self.make_compound_path(
+ *(p.interpolated(steps) for p in self._iter_connected_components()))
+
+ if self.codes is not None and self.CLOSEPOLY in self.codes and not np.all(
+ self.vertices[self.codes == self.CLOSEPOLY] == self.vertices[0]):
+ vertices = self.vertices.copy()
+ vertices[self.codes == self.CLOSEPOLY] = vertices[0]
+ else:
+ vertices = self.vertices
+
+ vertices = simple_linear_interpolation(vertices, steps)
+ codes = self.codes
+ if codes is not None:
+ new_codes = np.full((len(codes) - 1) * steps + 1, Path.LINETO,
+ dtype=self.code_type)
+ new_codes[0::steps] = codes
+ else:
+ new_codes = None
+ return Path(vertices, new_codes)
+
+ def to_polygons(self, transform=None, width=0, height=0, closed_only=True):
+ """
+ Convert this path to a list of polygons or polylines. Each
+ polygon/polyline is an (N, 2) array of vertices. In other words,
+ each polygon has no `MOVETO` instructions or curves. This
+ is useful for displaying in backends that do not support
+ compound paths or BƩzier curves.
+
+ If *width* and *height* are both non-zero then the lines will
+ be simplified so that vertices outside of (0, 0), (width,
+ height) will be clipped.
+
+ The resulting polygons will be simplified if the
+ :attr:`Path.should_simplify` attribute of the path is `True`.
+
+ If *closed_only* is `True` (default), only closed polygons,
+ with the last point being the same as the first point, will be
+ returned. Any unclosed polylines in the path will be
+ explicitly closed. If *closed_only* is `False`, any unclosed
+ polygons in the path will be returned as unclosed polygons,
+ and the closed polygons will be returned explicitly closed by
+ setting the last point to the same as the first point.
+ """
+ if len(self.vertices) == 0:
+ return []
+
+ if transform is not None:
+ transform = transform.frozen()
+
+ if self.codes is None and (width == 0 or height == 0):
+ vertices = self.vertices
+ if closed_only:
+ if len(vertices) < 3:
+ return []
+ elif np.any(vertices[0] != vertices[-1]):
+ vertices = [*vertices, vertices[0]]
+
+ if transform is None:
+ return [vertices]
+ else:
+ return [transform.transform(vertices)]
+
+ # Deal with the case where there are curves and/or multiple
+ # subpaths (using extension code)
+ return _path.convert_path_to_polygons(
+ self, transform, width, height, closed_only)
+
+ _unit_rectangle = None
+
+ @classmethod
+ def unit_rectangle(cls):
+ """
+ Return a `Path` instance of the unit rectangle from (0, 0) to (1, 1).
+ """
+ if cls._unit_rectangle is None:
+ cls._unit_rectangle = cls([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]],
+ closed=True, readonly=True)
+ return cls._unit_rectangle
+
+ _unit_regular_polygons = WeakValueDictionary()
+
+ @classmethod
+ def unit_regular_polygon(cls, numVertices):
+ """
+ Return a :class:`Path` instance for a unit regular polygon with the
+ given *numVertices* such that the circumscribing circle has radius 1.0,
+ centered at (0, 0).
+ """
+ if numVertices <= 16:
+ path = cls._unit_regular_polygons.get(numVertices)
+ else:
+ path = None
+ if path is None:
+ theta = ((2 * np.pi / numVertices) * np.arange(numVertices + 1)
+ # This initial rotation is to make sure the polygon always
+ # "points-up".
+ + np.pi / 2)
+ verts = np.column_stack((np.cos(theta), np.sin(theta)))
+ path = cls(verts, closed=True, readonly=True)
+ if numVertices <= 16:
+ cls._unit_regular_polygons[numVertices] = path
+ return path
+
+ _unit_regular_stars = WeakValueDictionary()
+
+ @classmethod
+ def unit_regular_star(cls, numVertices, innerCircle=0.5):
+ """
+ Return a :class:`Path` for a unit regular star with the given
+ numVertices and radius of 1.0, centered at (0, 0).
+ """
+ if numVertices <= 16:
+ path = cls._unit_regular_stars.get((numVertices, innerCircle))
+ else:
+ path = None
+ if path is None:
+ ns2 = numVertices * 2
+ theta = (2*np.pi/ns2 * np.arange(ns2 + 1))
+ # This initial rotation is to make sure the polygon always
+ # "points-up"
+ theta += np.pi / 2.0
+ r = np.ones(ns2 + 1)
+ r[1::2] = innerCircle
+ verts = (r * np.vstack((np.cos(theta), np.sin(theta)))).T
+ path = cls(verts, closed=True, readonly=True)
+ if numVertices <= 16:
+ cls._unit_regular_stars[(numVertices, innerCircle)] = path
+ return path
+
+ @classmethod
+ def unit_regular_asterisk(cls, numVertices):
+ """
+ Return a :class:`Path` for a unit regular asterisk with the given
+ numVertices and radius of 1.0, centered at (0, 0).
+ """
+ return cls.unit_regular_star(numVertices, 0.0)
+
+ _unit_circle = None
+
+ @classmethod
+ def unit_circle(cls):
+ """
+ Return the readonly :class:`Path` of the unit circle.
+
+ For most cases, :func:`Path.circle` will be what you want.
+ """
+ if cls._unit_circle is None:
+ cls._unit_circle = cls.circle(center=(0, 0), radius=1,
+ readonly=True)
+ return cls._unit_circle
+
+ @classmethod
+ def circle(cls, center=(0., 0.), radius=1., readonly=False):
+ """
+ Return a `Path` representing a circle of a given radius and center.
+
+ Parameters
+ ----------
+ center : (float, float), default: (0, 0)
+ The center of the circle.
+ radius : float, default: 1
+ The radius of the circle.
+ readonly : bool
+ Whether the created path should have the "readonly" argument
+ set when creating the Path instance.
+
+ Notes
+ -----
+ The circle is approximated using 8 cubic BƩzier curves, as described in
+
+ Lancaster, Don. `Approximating a Circle or an Ellipse Using Four
+ Bezier Cubic Splines `_.
+ """
+ MAGIC = 0.2652031
+ SQRTHALF = np.sqrt(0.5)
+ MAGIC45 = SQRTHALF * MAGIC
+
+ vertices = np.array([[0.0, -1.0],
+
+ [MAGIC, -1.0],
+ [SQRTHALF-MAGIC45, -SQRTHALF-MAGIC45],
+ [SQRTHALF, -SQRTHALF],
+
+ [SQRTHALF+MAGIC45, -SQRTHALF+MAGIC45],
+ [1.0, -MAGIC],
+ [1.0, 0.0],
+
+ [1.0, MAGIC],
+ [SQRTHALF+MAGIC45, SQRTHALF-MAGIC45],
+ [SQRTHALF, SQRTHALF],
+
+ [SQRTHALF-MAGIC45, SQRTHALF+MAGIC45],
+ [MAGIC, 1.0],
+ [0.0, 1.0],
+
+ [-MAGIC, 1.0],
+ [-SQRTHALF+MAGIC45, SQRTHALF+MAGIC45],
+ [-SQRTHALF, SQRTHALF],
+
+ [-SQRTHALF-MAGIC45, SQRTHALF-MAGIC45],
+ [-1.0, MAGIC],
+ [-1.0, 0.0],
+
+ [-1.0, -MAGIC],
+ [-SQRTHALF-MAGIC45, -SQRTHALF+MAGIC45],
+ [-SQRTHALF, -SQRTHALF],
+
+ [-SQRTHALF+MAGIC45, -SQRTHALF-MAGIC45],
+ [-MAGIC, -1.0],
+ [0.0, -1.0],
+
+ [0.0, -1.0]],
+ dtype=float)
+
+ codes = [cls.CURVE4] * 26
+ codes[0] = cls.MOVETO
+ codes[-1] = cls.CLOSEPOLY
+ return Path(vertices * radius + center, codes, readonly=readonly)
+
+ _unit_circle_righthalf = None
+
+ @classmethod
+ def unit_circle_righthalf(cls):
+ """
+ Return a `Path` of the right half of a unit circle.
+
+ See `Path.circle` for the reference on the approximation used.
+ """
+ if cls._unit_circle_righthalf is None:
+ MAGIC = 0.2652031
+ SQRTHALF = np.sqrt(0.5)
+ MAGIC45 = SQRTHALF * MAGIC
+
+ vertices = np.array(
+ [[0.0, -1.0],
+
+ [MAGIC, -1.0],
+ [SQRTHALF-MAGIC45, -SQRTHALF-MAGIC45],
+ [SQRTHALF, -SQRTHALF],
+
+ [SQRTHALF+MAGIC45, -SQRTHALF+MAGIC45],
+ [1.0, -MAGIC],
+ [1.0, 0.0],
+
+ [1.0, MAGIC],
+ [SQRTHALF+MAGIC45, SQRTHALF-MAGIC45],
+ [SQRTHALF, SQRTHALF],
+
+ [SQRTHALF-MAGIC45, SQRTHALF+MAGIC45],
+ [MAGIC, 1.0],
+ [0.0, 1.0],
+
+ [0.0, -1.0]],
+
+ float)
+
+ codes = np.full(14, cls.CURVE4, dtype=cls.code_type)
+ codes[0] = cls.MOVETO
+ codes[-1] = cls.CLOSEPOLY
+
+ cls._unit_circle_righthalf = cls(vertices, codes, readonly=True)
+ return cls._unit_circle_righthalf
+
+ @classmethod
+ def arc(cls, theta1, theta2, n=None, is_wedge=False):
+ """
+ Return a `Path` for the unit circle arc from angles *theta1* to
+ *theta2* (in degrees).
+
+ *theta2* is unwrapped to produce the shortest arc within 360 degrees.
+ That is, if *theta2* > *theta1* + 360, the arc will be from *theta1* to
+ *theta2* - 360 and not a full circle plus some extra overlap.
+
+ If *n* is provided, it is the number of spline segments to make.
+ If *n* is not provided, the number of spline segments is
+ determined based on the delta between *theta1* and *theta2*.
+
+ Masionobe, L. 2003. `Drawing an elliptical arc using
+ polylines, quadratic or cubic Bezier curves
+ `_.
+ """
+ halfpi = np.pi * 0.5
+
+ eta1 = theta1
+ eta2 = theta2 - 360 * np.floor((theta2 - theta1) / 360)
+ # Ensure 2pi range is not flattened to 0 due to floating-point errors,
+ # but don't try to expand existing 0 range.
+ if theta2 != theta1 and eta2 <= eta1:
+ eta2 += 360
+ eta1, eta2 = np.deg2rad([eta1, eta2])
+
+ # number of curve segments to make
+ if n is None:
+ n = int(2 ** np.ceil((eta2 - eta1) / halfpi))
+ if n < 1:
+ raise ValueError("n must be >= 1 or None")
+
+ deta = (eta2 - eta1) / n
+ t = np.tan(0.5 * deta)
+ alpha = np.sin(deta) * (np.sqrt(4.0 + 3.0 * t * t) - 1) / 3.0
+
+ steps = np.linspace(eta1, eta2, n + 1, True)
+ cos_eta = np.cos(steps)
+ sin_eta = np.sin(steps)
+
+ xA = cos_eta[:-1]
+ yA = sin_eta[:-1]
+ xA_dot = -yA
+ yA_dot = xA
+
+ xB = cos_eta[1:]
+ yB = sin_eta[1:]
+ xB_dot = -yB
+ yB_dot = xB
+
+ if is_wedge:
+ length = n * 3 + 4
+ vertices = np.zeros((length, 2), float)
+ codes = np.full(length, cls.CURVE4, dtype=cls.code_type)
+ vertices[1] = [xA[0], yA[0]]
+ codes[0:2] = [cls.MOVETO, cls.LINETO]
+ codes[-2:] = [cls.LINETO, cls.CLOSEPOLY]
+ vertex_offset = 2
+ end = length - 2
+ else:
+ length = n * 3 + 1
+ vertices = np.empty((length, 2), float)
+ codes = np.full(length, cls.CURVE4, dtype=cls.code_type)
+ vertices[0] = [xA[0], yA[0]]
+ codes[0] = cls.MOVETO
+ vertex_offset = 1
+ end = length
+
+ vertices[vertex_offset:end:3, 0] = xA + alpha * xA_dot
+ vertices[vertex_offset:end:3, 1] = yA + alpha * yA_dot
+ vertices[vertex_offset+1:end:3, 0] = xB - alpha * xB_dot
+ vertices[vertex_offset+1:end:3, 1] = yB - alpha * yB_dot
+ vertices[vertex_offset+2:end:3, 0] = xB
+ vertices[vertex_offset+2:end:3, 1] = yB
+
+ return cls(vertices, codes, readonly=True)
+
+ @classmethod
+ def wedge(cls, theta1, theta2, n=None):
+ """
+ Return a `Path` for the unit circle wedge from angles *theta1* to
+ *theta2* (in degrees).
+
+ *theta2* is unwrapped to produce the shortest wedge within 360 degrees.
+ That is, if *theta2* > *theta1* + 360, the wedge will be from *theta1*
+ to *theta2* - 360 and not a full circle plus some extra overlap.
+
+ If *n* is provided, it is the number of spline segments to make.
+ If *n* is not provided, the number of spline segments is
+ determined based on the delta between *theta1* and *theta2*.
+
+ See `Path.arc` for the reference on the approximation used.
+ """
+ return cls.arc(theta1, theta2, n, True)
+
+ @staticmethod
+ @lru_cache(8)
+ def hatch(hatchpattern, density=6):
+ """
+ Given a hatch specifier, *hatchpattern*, generates a `Path` that
+ can be used in a repeated hatching pattern. *density* is the
+ number of lines per unit square.
+ """
+ from matplotlib.hatch import get_path
+ return (get_path(hatchpattern, density)
+ if hatchpattern is not None else None)
+
+ def clip_to_bbox(self, bbox, inside=True):
+ """
+ Clip the path to the given bounding box.
+
+ The path must be made up of one or more closed polygons. This
+ algorithm will not behave correctly for unclosed paths.
+
+ If *inside* is `True`, clip to the inside of the box, otherwise
+ to the outside of the box.
+ """
+ verts = _path.clip_path_to_rect(self, bbox, inside)
+ paths = [Path(poly) for poly in verts]
+ return self.make_compound_path(*paths)
+
+
+def get_path_collection_extents(
+ master_transform, paths, transforms, offsets, offset_transform):
+ r"""
+ Get bounding box of a `.PathCollection`\s internal objects.
+
+ That is, given a sequence of `Path`\s, `.Transform`\s objects, and offsets, as found
+ in a `.PathCollection`, return the bounding box that encapsulates all of them.
+
+ Parameters
+ ----------
+ master_transform : `~matplotlib.transforms.Transform`
+ Global transformation applied to all paths.
+ paths : list of `Path`
+ transforms : list of `~matplotlib.transforms.Affine2DBase`
+ If non-empty, this overrides *master_transform*.
+ offsets : (N, 2) array-like
+ offset_transform : `~matplotlib.transforms.Affine2DBase`
+ Transform applied to the offsets before offsetting the path.
+
+ Notes
+ -----
+ The way that *paths*, *transforms* and *offsets* are combined follows the same
+ method as for collections: each is iterated over independently, so if you have 3
+ paths (A, B, C), 2 transforms (α, β) and 1 offset (O), their combinations are as
+ follows:
+
+ - (A, α, O)
+ - (B, β, O)
+ - (C, α, O)
+ """
+ from .transforms import Bbox
+ if len(paths) == 0:
+ raise ValueError("No paths provided")
+ if len(offsets) == 0:
+ raise ValueError("No offsets provided")
+ extents, minpos = _path.get_path_collection_extents(
+ master_transform, paths, np.atleast_3d(transforms),
+ offsets, offset_transform)
+ return Bbox.from_extents(*extents, minpos=minpos)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/path.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/path.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..464fc6d9a912e359d1deb0f3bb71a8ac349cfb6a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/path.pyi
@@ -0,0 +1,140 @@
+from .bezier import BezierSegment
+from .transforms import Affine2D, Transform, Bbox
+from collections.abc import Generator, Iterable, Sequence
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+from typing import Any, overload
+
+class Path:
+ code_type: type[np.uint8]
+ STOP: np.uint8
+ MOVETO: np.uint8
+ LINETO: np.uint8
+ CURVE3: np.uint8
+ CURVE4: np.uint8
+ CLOSEPOLY: np.uint8
+ NUM_VERTICES_FOR_CODE: dict[np.uint8, int]
+
+ def __init__(
+ self,
+ vertices: ArrayLike,
+ codes: ArrayLike | None = ...,
+ _interpolation_steps: int = ...,
+ closed: bool = ...,
+ readonly: bool = ...,
+ ) -> None: ...
+ @property
+ def vertices(self) -> ArrayLike: ...
+ @vertices.setter
+ def vertices(self, vertices: ArrayLike) -> None: ...
+ @property
+ def codes(self) -> ArrayLike | None: ...
+ @codes.setter
+ def codes(self, codes: ArrayLike) -> None: ...
+ @property
+ def simplify_threshold(self) -> float: ...
+ @simplify_threshold.setter
+ def simplify_threshold(self, threshold: float) -> None: ...
+ @property
+ def should_simplify(self) -> bool: ...
+ @should_simplify.setter
+ def should_simplify(self, should_simplify: bool) -> None: ...
+ @property
+ def readonly(self) -> bool: ...
+ def copy(self) -> Path: ...
+ def __deepcopy__(self, memo: dict[int, Any] | None = ...) -> Path: ...
+ deepcopy = __deepcopy__
+
+ @classmethod
+ def make_compound_path_from_polys(cls, XY: ArrayLike) -> Path: ...
+ @classmethod
+ def make_compound_path(cls, *args: Path) -> Path: ...
+ def __len__(self) -> int: ...
+ def iter_segments(
+ self,
+ transform: Transform | None = ...,
+ remove_nans: bool = ...,
+ clip: tuple[float, float, float, float] | None = ...,
+ snap: bool | None = ...,
+ stroke_width: float = ...,
+ simplify: bool | None = ...,
+ curves: bool = ...,
+ sketch: tuple[float, float, float] | None = ...,
+ ) -> Generator[tuple[np.ndarray, np.uint8], None, None]: ...
+ def iter_bezier(self, **kwargs) -> Generator[BezierSegment, None, None]: ...
+ def cleaned(
+ self,
+ transform: Transform | None = ...,
+ remove_nans: bool = ...,
+ clip: tuple[float, float, float, float] | None = ...,
+ *,
+ simplify: bool | None = ...,
+ curves: bool = ...,
+ stroke_width: float = ...,
+ snap: bool | None = ...,
+ sketch: tuple[float, float, float] | None = ...
+ ) -> Path: ...
+ def transformed(self, transform: Transform) -> Path: ...
+ def contains_point(
+ self,
+ point: tuple[float, float],
+ transform: Transform | None = ...,
+ radius: float = ...,
+ ) -> bool: ...
+ def contains_points(
+ self, points: ArrayLike, transform: Transform | None = ..., radius: float = ...
+ ) -> np.ndarray: ...
+ def contains_path(self, path: Path, transform: Transform | None = ...) -> bool: ...
+ def get_extents(self, transform: Transform | None = ..., **kwargs) -> Bbox: ...
+ def intersects_path(self, other: Path, filled: bool = ...) -> bool: ...
+ def intersects_bbox(self, bbox: Bbox, filled: bool = ...) -> bool: ...
+ def interpolated(self, steps: int) -> Path: ...
+ def to_polygons(
+ self,
+ transform: Transform | None = ...,
+ width: float = ...,
+ height: float = ...,
+ closed_only: bool = ...,
+ ) -> list[ArrayLike]: ...
+ @classmethod
+ def unit_rectangle(cls) -> Path: ...
+ @classmethod
+ def unit_regular_polygon(cls, numVertices: int) -> Path: ...
+ @classmethod
+ def unit_regular_star(cls, numVertices: int, innerCircle: float = ...) -> Path: ...
+ @classmethod
+ def unit_regular_asterisk(cls, numVertices: int) -> Path: ...
+ @classmethod
+ def unit_circle(cls) -> Path: ...
+ @classmethod
+ def circle(
+ cls,
+ center: tuple[float, float] = ...,
+ radius: float = ...,
+ readonly: bool = ...,
+ ) -> Path: ...
+ @classmethod
+ def unit_circle_righthalf(cls) -> Path: ...
+ @classmethod
+ def arc(
+ cls, theta1: float, theta2: float, n: int | None = ..., is_wedge: bool = ...
+ ) -> Path: ...
+ @classmethod
+ def wedge(cls, theta1: float, theta2: float, n: int | None = ...) -> Path: ...
+ @overload
+ @staticmethod
+ def hatch(hatchpattern: str, density: float = ...) -> Path: ...
+ @overload
+ @staticmethod
+ def hatch(hatchpattern: None, density: float = ...) -> None: ...
+ def clip_to_bbox(self, bbox: Bbox, inside: bool = ...) -> Path: ...
+
+def get_path_collection_extents(
+ master_transform: Transform,
+ paths: Sequence[Path],
+ transforms: Iterable[Affine2D],
+ offsets: ArrayLike,
+ offset_transform: Affine2D,
+) -> Bbox: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patheffects.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patheffects.py
new file mode 100644
index 0000000000000000000000000000000000000000..e7a0138bd7507a18f96e445572c59fdd2cde0e7c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patheffects.py
@@ -0,0 +1,511 @@
+"""
+Defines classes for path effects. The path effects are supported in `.Text`,
+`.Line2D` and `.Patch`.
+
+.. seealso::
+ :ref:`patheffects_guide`
+"""
+
+from matplotlib.backend_bases import RendererBase
+from matplotlib import colors as mcolors
+from matplotlib import patches as mpatches
+from matplotlib import transforms as mtransforms
+from matplotlib.path import Path
+import numpy as np
+
+
+class AbstractPathEffect:
+ """
+ A base class for path effects.
+
+ Subclasses should override the ``draw_path`` method to add effect
+ functionality.
+ """
+
+ def __init__(self, offset=(0., 0.)):
+ """
+ Parameters
+ ----------
+ offset : (float, float), default: (0, 0)
+ The (x, y) offset to apply to the path, measured in points.
+ """
+ self._offset = offset
+
+ def _offset_transform(self, renderer):
+ """Apply the offset to the given transform."""
+ return mtransforms.Affine2D().translate(
+ *map(renderer.points_to_pixels, self._offset))
+
+ def _update_gc(self, gc, new_gc_dict):
+ """
+ Update the given GraphicsContext with the given dict of properties.
+
+ The keys in the dictionary are used to identify the appropriate
+ ``set_`` method on the *gc*.
+ """
+ new_gc_dict = new_gc_dict.copy()
+
+ dashes = new_gc_dict.pop("dashes", None)
+ if dashes:
+ gc.set_dashes(**dashes)
+
+ for k, v in new_gc_dict.items():
+ set_method = getattr(gc, 'set_' + k, None)
+ if not callable(set_method):
+ raise AttributeError(f'Unknown property {k}')
+ set_method(v)
+ return gc
+
+ def draw_path(self, renderer, gc, tpath, affine, rgbFace=None):
+ """
+ Derived should override this method. The arguments are the same
+ as :meth:`matplotlib.backend_bases.RendererBase.draw_path`
+ except the first argument is a renderer.
+ """
+ # Get the real renderer, not a PathEffectRenderer.
+ if isinstance(renderer, PathEffectRenderer):
+ renderer = renderer._renderer
+ return renderer.draw_path(gc, tpath, affine, rgbFace)
+
+
+class PathEffectRenderer(RendererBase):
+ """
+ Implements a Renderer which contains another renderer.
+
+ This proxy then intercepts draw calls, calling the appropriate
+ :class:`AbstractPathEffect` draw method.
+
+ .. note::
+ Not all methods have been overridden on this RendererBase subclass.
+ It may be necessary to add further methods to extend the PathEffects
+ capabilities further.
+ """
+
+ def __init__(self, path_effects, renderer):
+ """
+ Parameters
+ ----------
+ path_effects : iterable of :class:`AbstractPathEffect`
+ The path effects which this renderer represents.
+ renderer : `~matplotlib.backend_bases.RendererBase` subclass
+
+ """
+ self._path_effects = path_effects
+ self._renderer = renderer
+
+ def copy_with_path_effect(self, path_effects):
+ return self.__class__(path_effects, self._renderer)
+
+ def __getattribute__(self, name):
+ if name in ['flipy', 'get_canvas_width_height', 'new_gc',
+ 'points_to_pixels', '_text2path', 'height', 'width']:
+ return getattr(self._renderer, name)
+ else:
+ return object.__getattribute__(self, name)
+
+ def draw_path(self, gc, tpath, affine, rgbFace=None):
+ for path_effect in self._path_effects:
+ path_effect.draw_path(self._renderer, gc, tpath, affine,
+ rgbFace)
+
+ def draw_markers(
+ self, gc, marker_path, marker_trans, path, *args, **kwargs):
+ # We do a little shimmy so that all markers are drawn for each path
+ # effect in turn. Essentially, we induce recursion (depth 1) which is
+ # terminated once we have just a single path effect to work with.
+ if len(self._path_effects) == 1:
+ # Call the base path effect function - this uses the unoptimised
+ # approach of calling "draw_path" multiple times.
+ return super().draw_markers(gc, marker_path, marker_trans, path,
+ *args, **kwargs)
+
+ for path_effect in self._path_effects:
+ renderer = self.copy_with_path_effect([path_effect])
+ # Recursively call this method, only next time we will only have
+ # one path effect.
+ renderer.draw_markers(gc, marker_path, marker_trans, path,
+ *args, **kwargs)
+
+ def draw_path_collection(self, gc, master_transform, paths, *args,
+ **kwargs):
+ # We do a little shimmy so that all paths are drawn for each path
+ # effect in turn. Essentially, we induce recursion (depth 1) which is
+ # terminated once we have just a single path effect to work with.
+ if len(self._path_effects) == 1:
+ # Call the base path effect function - this uses the unoptimised
+ # approach of calling "draw_path" multiple times.
+ return super().draw_path_collection(gc, master_transform, paths,
+ *args, **kwargs)
+
+ for path_effect in self._path_effects:
+ renderer = self.copy_with_path_effect([path_effect])
+ # Recursively call this method, only next time we will only have
+ # one path effect.
+ renderer.draw_path_collection(gc, master_transform, paths,
+ *args, **kwargs)
+
+ def open_group(self, s, gid=None):
+ return self._renderer.open_group(s, gid)
+
+ def close_group(self, s):
+ return self._renderer.close_group(s)
+
+
+class Normal(AbstractPathEffect):
+ """
+ The "identity" PathEffect.
+
+ The Normal PathEffect's sole purpose is to draw the original artist with
+ no special path effect.
+ """
+
+
+def _subclass_with_normal(effect_class):
+ """
+ Create a PathEffect class combining *effect_class* and a normal draw.
+ """
+
+ class withEffect(effect_class):
+ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
+ super().draw_path(renderer, gc, tpath, affine, rgbFace)
+ renderer.draw_path(gc, tpath, affine, rgbFace)
+
+ withEffect.__name__ = f"with{effect_class.__name__}"
+ withEffect.__qualname__ = f"with{effect_class.__name__}"
+ withEffect.__doc__ = f"""
+ A shortcut PathEffect for applying `.{effect_class.__name__}` and then
+ drawing the original Artist.
+
+ With this class you can use ::
+
+ artist.set_path_effects([patheffects.with{effect_class.__name__}()])
+
+ as a shortcut for ::
+
+ artist.set_path_effects([patheffects.{effect_class.__name__}(),
+ patheffects.Normal()])
+ """
+ # Docstring inheritance doesn't work for locally-defined subclasses.
+ withEffect.draw_path.__doc__ = effect_class.draw_path.__doc__
+ return withEffect
+
+
+class Stroke(AbstractPathEffect):
+ """A line based PathEffect which re-draws a stroke."""
+
+ def __init__(self, offset=(0, 0), **kwargs):
+ """
+ The path will be stroked with its gc updated with the given
+ keyword arguments, i.e., the keyword arguments should be valid
+ gc parameter values.
+ """
+ super().__init__(offset)
+ self._gc = kwargs
+
+ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
+ """Draw the path with updated gc."""
+ gc0 = renderer.new_gc() # Don't modify gc, but a copy!
+ gc0.copy_properties(gc)
+ gc0 = self._update_gc(gc0, self._gc)
+ renderer.draw_path(
+ gc0, tpath, affine + self._offset_transform(renderer), rgbFace)
+ gc0.restore()
+
+
+withStroke = _subclass_with_normal(effect_class=Stroke)
+
+
+class SimplePatchShadow(AbstractPathEffect):
+ """A simple shadow via a filled patch."""
+
+ def __init__(self, offset=(2, -2),
+ shadow_rgbFace=None, alpha=None,
+ rho=0.3, **kwargs):
+ """
+ Parameters
+ ----------
+ offset : (float, float), default: (2, -2)
+ The (x, y) offset of the shadow in points.
+ shadow_rgbFace : :mpltype:`color`
+ The shadow color.
+ alpha : float, default: 0.3
+ The alpha transparency of the created shadow patch.
+ rho : float, default: 0.3
+ A scale factor to apply to the rgbFace color if *shadow_rgbFace*
+ is not specified.
+ **kwargs
+ Extra keywords are stored and passed through to
+ :meth:`AbstractPathEffect._update_gc`.
+
+ """
+ super().__init__(offset)
+
+ if shadow_rgbFace is None:
+ self._shadow_rgbFace = shadow_rgbFace
+ else:
+ self._shadow_rgbFace = mcolors.to_rgba(shadow_rgbFace)
+
+ if alpha is None:
+ alpha = 0.3
+
+ self._alpha = alpha
+ self._rho = rho
+
+ #: The dictionary of keywords to update the graphics collection with.
+ self._gc = kwargs
+
+ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
+ """
+ Overrides the standard draw_path to add the shadow offset and
+ necessary color changes for the shadow.
+ """
+ gc0 = renderer.new_gc() # Don't modify gc, but a copy!
+ gc0.copy_properties(gc)
+
+ if self._shadow_rgbFace is None:
+ r, g, b = (rgbFace or (1., 1., 1.))[:3]
+ # Scale the colors by a factor to improve the shadow effect.
+ shadow_rgbFace = (r * self._rho, g * self._rho, b * self._rho)
+ else:
+ shadow_rgbFace = self._shadow_rgbFace
+
+ gc0.set_foreground("none")
+ gc0.set_alpha(self._alpha)
+ gc0.set_linewidth(0)
+
+ gc0 = self._update_gc(gc0, self._gc)
+ renderer.draw_path(
+ gc0, tpath, affine + self._offset_transform(renderer),
+ shadow_rgbFace)
+ gc0.restore()
+
+
+withSimplePatchShadow = _subclass_with_normal(effect_class=SimplePatchShadow)
+
+
+class SimpleLineShadow(AbstractPathEffect):
+ """A simple shadow via a line."""
+
+ def __init__(self, offset=(2, -2),
+ shadow_color='k', alpha=0.3, rho=0.3, **kwargs):
+ """
+ Parameters
+ ----------
+ offset : (float, float), default: (2, -2)
+ The (x, y) offset to apply to the path, in points.
+ shadow_color : :mpltype:`color`, default: 'black'
+ The shadow color.
+ A value of ``None`` takes the original artist's color
+ with a scale factor of *rho*.
+ alpha : float, default: 0.3
+ The alpha transparency of the created shadow patch.
+ rho : float, default: 0.3
+ A scale factor to apply to the rgbFace color if *shadow_color*
+ is ``None``.
+ **kwargs
+ Extra keywords are stored and passed through to
+ :meth:`AbstractPathEffect._update_gc`.
+ """
+ super().__init__(offset)
+ if shadow_color is None:
+ self._shadow_color = shadow_color
+ else:
+ self._shadow_color = mcolors.to_rgba(shadow_color)
+ self._alpha = alpha
+ self._rho = rho
+ #: The dictionary of keywords to update the graphics collection with.
+ self._gc = kwargs
+
+ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
+ """
+ Overrides the standard draw_path to add the shadow offset and
+ necessary color changes for the shadow.
+ """
+ gc0 = renderer.new_gc() # Don't modify gc, but a copy!
+ gc0.copy_properties(gc)
+
+ if self._shadow_color is None:
+ r, g, b = (gc0.get_foreground() or (1., 1., 1.))[:3]
+ # Scale the colors by a factor to improve the shadow effect.
+ shadow_rgbFace = (r * self._rho, g * self._rho, b * self._rho)
+ else:
+ shadow_rgbFace = self._shadow_color
+
+ gc0.set_foreground(shadow_rgbFace)
+ gc0.set_alpha(self._alpha)
+
+ gc0 = self._update_gc(gc0, self._gc)
+ renderer.draw_path(
+ gc0, tpath, affine + self._offset_transform(renderer))
+ gc0.restore()
+
+
+class PathPatchEffect(AbstractPathEffect):
+ """
+ Draws a `.PathPatch` instance whose Path comes from the original
+ PathEffect artist.
+ """
+
+ def __init__(self, offset=(0, 0), **kwargs):
+ """
+ Parameters
+ ----------
+ offset : (float, float), default: (0, 0)
+ The (x, y) offset to apply to the path, in points.
+ **kwargs
+ All keyword arguments are passed through to the
+ :class:`~matplotlib.patches.PathPatch` constructor. The
+ properties which cannot be overridden are "path", "clip_box"
+ "transform" and "clip_path".
+ """
+ super().__init__(offset=offset)
+ self.patch = mpatches.PathPatch([], **kwargs)
+
+ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
+ self.patch._path = tpath
+ self.patch.set_transform(affine + self._offset_transform(renderer))
+ self.patch.set_clip_box(gc.get_clip_rectangle())
+ clip_path = gc.get_clip_path()
+ if clip_path and self.patch.get_clip_path() is None:
+ self.patch.set_clip_path(*clip_path)
+ self.patch.draw(renderer)
+
+
+class TickedStroke(AbstractPathEffect):
+ """
+ A line-based PathEffect which draws a path with a ticked style.
+
+ This line style is frequently used to represent constraints in
+ optimization. The ticks may be used to indicate that one side
+ of the line is invalid or to represent a closed boundary of a
+ domain (i.e. a wall or the edge of a pipe).
+
+ The spacing, length, and angle of ticks can be controlled.
+
+ This line style is sometimes referred to as a hatched line.
+
+ See also the :doc:`/gallery/misc/tickedstroke_demo` example.
+ """
+
+ def __init__(self, offset=(0, 0),
+ spacing=10.0, angle=45.0, length=np.sqrt(2),
+ **kwargs):
+ """
+ Parameters
+ ----------
+ offset : (float, float), default: (0, 0)
+ The (x, y) offset to apply to the path, in points.
+ spacing : float, default: 10.0
+ The spacing between ticks in points.
+ angle : float, default: 45.0
+ The angle between the path and the tick in degrees. The angle
+ is measured as if you were an ant walking along the curve, with
+ zero degrees pointing directly ahead, 90 to your left, -90
+ to your right, and 180 behind you. To change side of the ticks,
+ change sign of the angle.
+ length : float, default: 1.414
+ The length of the tick relative to spacing.
+ Recommended length = 1.414 (sqrt(2)) when angle=45, length=1.0
+ when angle=90 and length=2.0 when angle=60.
+ **kwargs
+ Extra keywords are stored and passed through to
+ :meth:`AbstractPathEffect._update_gc`.
+
+ Examples
+ --------
+ See :doc:`/gallery/misc/tickedstroke_demo`.
+ """
+ super().__init__(offset)
+
+ self._spacing = spacing
+ self._angle = angle
+ self._length = length
+ self._gc = kwargs
+
+ def draw_path(self, renderer, gc, tpath, affine, rgbFace):
+ """Draw the path with updated gc."""
+ # Do not modify the input! Use copy instead.
+ gc0 = renderer.new_gc()
+ gc0.copy_properties(gc)
+
+ gc0 = self._update_gc(gc0, self._gc)
+ trans = affine + self._offset_transform(renderer)
+
+ theta = -np.radians(self._angle)
+ trans_matrix = np.array([[np.cos(theta), -np.sin(theta)],
+ [np.sin(theta), np.cos(theta)]])
+
+ # Convert spacing parameter to pixels.
+ spacing_px = renderer.points_to_pixels(self._spacing)
+
+ # Transform before evaluation because to_polygons works at resolution
+ # of one -- assuming it is working in pixel space.
+ transpath = affine.transform_path(tpath)
+
+ # Evaluate path to straight line segments that can be used to
+ # construct line ticks.
+ polys = transpath.to_polygons(closed_only=False)
+
+ for p in polys:
+ x = p[:, 0]
+ y = p[:, 1]
+
+ # Can not interpolate points or draw line if only one point in
+ # polyline.
+ if x.size < 2:
+ continue
+
+ # Find distance between points on the line
+ ds = np.hypot(x[1:] - x[:-1], y[1:] - y[:-1])
+
+ # Build parametric coordinate along curve
+ s = np.concatenate(([0.0], np.cumsum(ds)))
+ s_total = s[-1]
+
+ num = int(np.ceil(s_total / spacing_px)) - 1
+ # Pick parameter values for ticks.
+ s_tick = np.linspace(spacing_px/2, s_total - spacing_px/2, num)
+
+ # Find points along the parameterized curve
+ x_tick = np.interp(s_tick, s, x)
+ y_tick = np.interp(s_tick, s, y)
+
+ # Find unit vectors in local direction of curve
+ delta_s = self._spacing * .001
+ u = (np.interp(s_tick + delta_s, s, x) - x_tick) / delta_s
+ v = (np.interp(s_tick + delta_s, s, y) - y_tick) / delta_s
+
+ # Normalize slope into unit slope vector.
+ n = np.hypot(u, v)
+ mask = n == 0
+ n[mask] = 1.0
+
+ uv = np.array([u / n, v / n]).T
+ uv[mask] = np.array([0, 0]).T
+
+ # Rotate and scale unit vector into tick vector
+ dxy = np.dot(uv, trans_matrix) * self._length * spacing_px
+
+ # Build tick endpoints
+ x_end = x_tick + dxy[:, 0]
+ y_end = y_tick + dxy[:, 1]
+
+ # Interleave ticks to form Path vertices
+ xyt = np.empty((2 * num, 2), dtype=x_tick.dtype)
+ xyt[0::2, 0] = x_tick
+ xyt[1::2, 0] = x_end
+ xyt[0::2, 1] = y_tick
+ xyt[1::2, 1] = y_end
+
+ # Build up vector of Path codes
+ codes = np.tile([Path.MOVETO, Path.LINETO], num)
+
+ # Construct and draw resulting path
+ h = Path(xyt, codes)
+ # Transform back to data space during render
+ renderer.draw_path(gc0, h, affine.inverted() + trans, rgbFace)
+
+ gc0.restore()
+
+
+withTickedStroke = _subclass_with_normal(effect_class=TickedStroke)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patheffects.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patheffects.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..2c1634ca9314700c437df83a41b2bb8a58f4dec6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/patheffects.pyi
@@ -0,0 +1,106 @@
+from collections.abc import Iterable, Sequence
+from typing import Any
+
+from matplotlib.backend_bases import RendererBase, GraphicsContextBase
+from matplotlib.path import Path
+from matplotlib.patches import Patch
+from matplotlib.transforms import Transform
+
+from matplotlib.typing import ColorType
+
+class AbstractPathEffect:
+ def __init__(self, offset: tuple[float, float] = ...) -> None: ...
+ def draw_path(
+ self,
+ renderer: RendererBase,
+ gc: GraphicsContextBase,
+ tpath: Path,
+ affine: Transform,
+ rgbFace: ColorType | None = ...,
+ ) -> None: ...
+
+class PathEffectRenderer(RendererBase):
+ def __init__(
+ self, path_effects: Iterable[AbstractPathEffect], renderer: RendererBase
+ ) -> None: ...
+ def copy_with_path_effect(self, path_effects: Iterable[AbstractPathEffect]) -> PathEffectRenderer: ...
+ def draw_path(
+ self,
+ gc: GraphicsContextBase,
+ tpath: Path,
+ affine: Transform,
+ rgbFace: ColorType | None = ...,
+ ) -> None: ...
+ def draw_markers(
+ self,
+ gc: GraphicsContextBase,
+ marker_path: Path,
+ marker_trans: Transform,
+ path: Path,
+ *args,
+ **kwargs
+ ) -> None: ...
+ def draw_path_collection(
+ self,
+ gc: GraphicsContextBase,
+ master_transform: Transform,
+ paths: Sequence[Path],
+ *args,
+ **kwargs
+ ) -> None: ...
+ def __getattribute__(self, name: str) -> Any: ...
+
+class Normal(AbstractPathEffect): ...
+
+class Stroke(AbstractPathEffect):
+ def __init__(self, offset: tuple[float, float] = ..., **kwargs) -> None: ...
+ # rgbFace becomes non-optional
+ def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore[override]
+
+class withStroke(Stroke): ...
+
+class SimplePatchShadow(AbstractPathEffect):
+ def __init__(
+ self,
+ offset: tuple[float, float] = ...,
+ shadow_rgbFace: ColorType | None = ...,
+ alpha: float | None = ...,
+ rho: float = ...,
+ **kwargs
+ ) -> None: ...
+ # rgbFace becomes non-optional
+ def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore[override]
+
+class withSimplePatchShadow(SimplePatchShadow): ...
+
+class SimpleLineShadow(AbstractPathEffect):
+ def __init__(
+ self,
+ offset: tuple[float, float] = ...,
+ shadow_color: ColorType = ...,
+ alpha: float = ...,
+ rho: float = ...,
+ **kwargs
+ ) -> None: ...
+ # rgbFace becomes non-optional
+ def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore[override]
+
+class PathPatchEffect(AbstractPathEffect):
+ patch: Patch
+ def __init__(self, offset: tuple[float, float] = ..., **kwargs) -> None: ...
+ # rgbFace becomes non-optional
+ def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore[override]
+
+class TickedStroke(AbstractPathEffect):
+ def __init__(
+ self,
+ offset: tuple[float, float] = ...,
+ spacing: float = ...,
+ angle: float = ...,
+ length: float = ...,
+ **kwargs
+ ) -> None: ...
+ # rgbFace becomes non-optional
+ def draw_path(self, renderer: RendererBase, gc: GraphicsContextBase, tpath: Path, affine: Transform, rgbFace: ColorType) -> None: ... # type: ignore[override]
+
+class withTickedStroke(TickedStroke): ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..f7b46192a84ea047959f71183c1aa1627514fac4
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__init__.py
@@ -0,0 +1,126 @@
+"""
+Non-separable transforms that map from data space to screen space.
+
+Projections are defined as `~.axes.Axes` subclasses. They include the
+following elements:
+
+- A transformation from data coordinates into display coordinates.
+
+- An inverse of that transformation. This is used, for example, to convert
+ mouse positions from screen space back into data space.
+
+- Transformations for the gridlines, ticks and ticklabels. Custom projections
+ will often need to place these elements in special locations, and Matplotlib
+ has a facility to help with doing so.
+
+- Setting up default values (overriding `~.axes.Axes.cla`), since the defaults
+ for a rectilinear Axes may not be appropriate.
+
+- Defining the shape of the Axes, for example, an elliptical Axes, that will be
+ used to draw the background of the plot and for clipping any data elements.
+
+- Defining custom locators and formatters for the projection. For example, in
+ a geographic projection, it may be more convenient to display the grid in
+ degrees, even if the data is in radians.
+
+- Set up interactive panning and zooming. This is left as an "advanced"
+ feature left to the reader, but there is an example of this for polar plots
+ in `matplotlib.projections.polar`.
+
+- Any additional methods for additional convenience or features.
+
+Once the projection Axes is defined, it can be used in one of two ways:
+
+- By defining the class attribute ``name``, the projection Axes can be
+ registered with `matplotlib.projections.register_projection` and subsequently
+ simply invoked by name::
+
+ fig.add_subplot(projection="my_proj_name")
+
+- For more complex, parameterisable projections, a generic "projection" object
+ may be defined which includes the method ``_as_mpl_axes``. ``_as_mpl_axes``
+ should take no arguments and return the projection's Axes subclass and a
+ dictionary of additional arguments to pass to the subclass' ``__init__``
+ method. Subsequently a parameterised projection can be initialised with::
+
+ fig.add_subplot(projection=MyProjection(param1=param1_value))
+
+ where MyProjection is an object which implements a ``_as_mpl_axes`` method.
+
+A full-fledged and heavily annotated example is in
+:doc:`/gallery/misc/custom_projection`. The polar plot functionality in
+`matplotlib.projections.polar` may also be of interest.
+"""
+
+from .. import axes, _docstring
+from .geo import AitoffAxes, HammerAxes, LambertAxes, MollweideAxes
+from .polar import PolarAxes
+
+try:
+ from mpl_toolkits.mplot3d import Axes3D
+except Exception:
+ import warnings
+ warnings.warn("Unable to import Axes3D. This may be due to multiple versions of "
+ "Matplotlib being installed (e.g. as a system package and as a pip "
+ "package). As a result, the 3D projection is not available.")
+ Axes3D = None
+
+
+class ProjectionRegistry:
+ """A mapping of registered projection names to projection classes."""
+
+ def __init__(self):
+ self._all_projection_types = {}
+
+ def register(self, *projections):
+ """Register a new set of projections."""
+ for projection in projections:
+ name = projection.name
+ self._all_projection_types[name] = projection
+
+ def get_projection_class(self, name):
+ """Get a projection class from its *name*."""
+ return self._all_projection_types[name]
+
+ def get_projection_names(self):
+ """Return the names of all projections currently registered."""
+ return sorted(self._all_projection_types)
+
+
+projection_registry = ProjectionRegistry()
+projection_registry.register(
+ axes.Axes,
+ PolarAxes,
+ AitoffAxes,
+ HammerAxes,
+ LambertAxes,
+ MollweideAxes,
+)
+if Axes3D is not None:
+ projection_registry.register(Axes3D)
+else:
+ # remove from namespace if not importable
+ del Axes3D
+
+
+def register_projection(cls):
+ projection_registry.register(cls)
+
+
+def get_projection_class(projection=None):
+ """
+ Get a projection class from its name.
+
+ If *projection* is None, a standard rectilinear projection is returned.
+ """
+ if projection is None:
+ projection = 'rectilinear'
+
+ try:
+ return projection_registry.get_projection_class(projection)
+ except KeyError as err:
+ raise ValueError("Unknown projection %r" % projection) from err
+
+
+get_projection_names = projection_registry.get_projection_names
+_docstring.interpd.register(projection_names=get_projection_names())
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__init__.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__init__.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..4e0d210f1c9e9d71160c32646850c4ef57494238
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__init__.pyi
@@ -0,0 +1,20 @@
+from .geo import (
+ AitoffAxes as AitoffAxes,
+ HammerAxes as HammerAxes,
+ LambertAxes as LambertAxes,
+ MollweideAxes as MollweideAxes,
+)
+from .polar import PolarAxes as PolarAxes
+from ..axes import Axes
+
+class ProjectionRegistry:
+ def __init__(self) -> None: ...
+ def register(self, *projections: type[Axes]) -> None: ...
+ def get_projection_class(self, name: str) -> type[Axes]: ...
+ def get_projection_names(self) -> list[str]: ...
+
+projection_registry: ProjectionRegistry
+
+def register_projection(cls: type[Axes]) -> None: ...
+def get_projection_class(projection: str | None = ...) -> type[Axes]: ...
+def get_projection_names() -> list[str]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c32cdaacd9ed33423ff21e6cbb9f16d1ea548666
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/geo.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/geo.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..749191c9519eab6ce6335074f1d47df05265d3dd
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/geo.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/polar.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/polar.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..79e2c544615c00c0bd738f0d56350382f8c9fe9c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/__pycache__/polar.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/geo.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/geo.py
new file mode 100644
index 0000000000000000000000000000000000000000..d5ab3c746deab63e8fec0fe7053fd02eaade8cc5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/geo.py
@@ -0,0 +1,511 @@
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api
+from matplotlib.axes import Axes
+import matplotlib.axis as maxis
+from matplotlib.patches import Circle
+from matplotlib.path import Path
+import matplotlib.spines as mspines
+from matplotlib.ticker import (
+ Formatter, NullLocator, FixedLocator, NullFormatter)
+from matplotlib.transforms import Affine2D, BboxTransformTo, Transform
+
+
+class GeoAxes(Axes):
+ """An abstract base class for geographic projections."""
+
+ class ThetaFormatter(Formatter):
+ """
+ Used to format the theta tick labels. Converts the native
+ unit of radians into degrees and adds a degree symbol.
+ """
+ def __init__(self, round_to=1.0):
+ self._round_to = round_to
+
+ def __call__(self, x, pos=None):
+ degrees = round(np.rad2deg(x) / self._round_to) * self._round_to
+ return f"{degrees:0.0f}\N{DEGREE SIGN}"
+
+ RESOLUTION = 75
+
+ def _init_axis(self):
+ self.xaxis = maxis.XAxis(self, clear=False)
+ self.yaxis = maxis.YAxis(self, clear=False)
+ self.spines['geo'].register_axis(self.yaxis)
+
+ def clear(self):
+ # docstring inherited
+ super().clear()
+
+ self.set_longitude_grid(30)
+ self.set_latitude_grid(15)
+ self.set_longitude_grid_ends(75)
+ self.xaxis.set_minor_locator(NullLocator())
+ self.yaxis.set_minor_locator(NullLocator())
+ self.xaxis.set_ticks_position('none')
+ self.yaxis.set_ticks_position('none')
+ self.yaxis.set_tick_params(label1On=True)
+ # Why do we need to turn on yaxis tick labels, but
+ # xaxis tick labels are already on?
+
+ self.grid(mpl.rcParams['axes.grid'])
+
+ Axes.set_xlim(self, -np.pi, np.pi)
+ Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0)
+
+ def _set_lim_and_transforms(self):
+ # A (possibly non-linear) projection on the (already scaled) data
+ self.transProjection = self._get_core_transform(self.RESOLUTION)
+
+ self.transAffine = self._get_affine_transform()
+
+ self.transAxes = BboxTransformTo(self.bbox)
+
+ # The complete data transformation stack -- from data all the
+ # way to display coordinates
+ self.transData = \
+ self.transProjection + \
+ self.transAffine + \
+ self.transAxes
+
+ # This is the transform for longitude ticks.
+ self._xaxis_pretransform = \
+ Affine2D() \
+ .scale(1, self._longitude_cap * 2) \
+ .translate(0, -self._longitude_cap)
+ self._xaxis_transform = \
+ self._xaxis_pretransform + \
+ self.transData
+ self._xaxis_text1_transform = \
+ Affine2D().scale(1, 0) + \
+ self.transData + \
+ Affine2D().translate(0, 4)
+ self._xaxis_text2_transform = \
+ Affine2D().scale(1, 0) + \
+ self.transData + \
+ Affine2D().translate(0, -4)
+
+ # This is the transform for latitude ticks.
+ yaxis_stretch = Affine2D().scale(np.pi * 2, 1).translate(-np.pi, 0)
+ yaxis_space = Affine2D().scale(1, 1.1)
+ self._yaxis_transform = \
+ yaxis_stretch + \
+ self.transData
+ yaxis_text_base = \
+ yaxis_stretch + \
+ self.transProjection + \
+ (yaxis_space +
+ self.transAffine +
+ self.transAxes)
+ self._yaxis_text1_transform = \
+ yaxis_text_base + \
+ Affine2D().translate(-8, 0)
+ self._yaxis_text2_transform = \
+ yaxis_text_base + \
+ Affine2D().translate(8, 0)
+
+ def _get_affine_transform(self):
+ transform = self._get_core_transform(1)
+ xscale, _ = transform.transform((np.pi, 0))
+ _, yscale = transform.transform((0, np.pi/2))
+ return Affine2D() \
+ .scale(0.5 / xscale, 0.5 / yscale) \
+ .translate(0.5, 0.5)
+
+ def get_xaxis_transform(self, which='grid'):
+ _api.check_in_list(['tick1', 'tick2', 'grid'], which=which)
+ return self._xaxis_transform
+
+ def get_xaxis_text1_transform(self, pad):
+ return self._xaxis_text1_transform, 'bottom', 'center'
+
+ def get_xaxis_text2_transform(self, pad):
+ return self._xaxis_text2_transform, 'top', 'center'
+
+ def get_yaxis_transform(self, which='grid'):
+ _api.check_in_list(['tick1', 'tick2', 'grid'], which=which)
+ return self._yaxis_transform
+
+ def get_yaxis_text1_transform(self, pad):
+ return self._yaxis_text1_transform, 'center', 'right'
+
+ def get_yaxis_text2_transform(self, pad):
+ return self._yaxis_text2_transform, 'center', 'left'
+
+ def _gen_axes_patch(self):
+ return Circle((0.5, 0.5), 0.5)
+
+ def _gen_axes_spines(self):
+ return {'geo': mspines.Spine.circular_spine(self, (0.5, 0.5), 0.5)}
+
+ def set_yscale(self, *args, **kwargs):
+ if args[0] != 'linear':
+ raise NotImplementedError
+
+ set_xscale = set_yscale
+
+ def set_xlim(self, *args, **kwargs):
+ """Not supported. Please consider using Cartopy."""
+ raise TypeError("Changing axes limits of a geographic projection is "
+ "not supported. Please consider using Cartopy.")
+
+ set_ylim = set_xlim
+ set_xbound = set_xlim
+ set_ybound = set_ylim
+
+ def invert_xaxis(self):
+ """Not supported. Please consider using Cartopy."""
+ raise TypeError("Changing axes limits of a geographic projection is "
+ "not supported. Please consider using Cartopy.")
+
+ invert_yaxis = invert_xaxis
+
+ def format_coord(self, lon, lat):
+ """Return a format string formatting the coordinate."""
+ lon, lat = np.rad2deg([lon, lat])
+ ns = 'N' if lat >= 0.0 else 'S'
+ ew = 'E' if lon >= 0.0 else 'W'
+ return ('%f\N{DEGREE SIGN}%s, %f\N{DEGREE SIGN}%s'
+ % (abs(lat), ns, abs(lon), ew))
+
+ def set_longitude_grid(self, degrees):
+ """
+ Set the number of degrees between each longitude grid.
+ """
+ # Skip -180 and 180, which are the fixed limits.
+ grid = np.arange(-180 + degrees, 180, degrees)
+ self.xaxis.set_major_locator(FixedLocator(np.deg2rad(grid)))
+ self.xaxis.set_major_formatter(self.ThetaFormatter(degrees))
+
+ def set_latitude_grid(self, degrees):
+ """
+ Set the number of degrees between each latitude grid.
+ """
+ # Skip -90 and 90, which are the fixed limits.
+ grid = np.arange(-90 + degrees, 90, degrees)
+ self.yaxis.set_major_locator(FixedLocator(np.deg2rad(grid)))
+ self.yaxis.set_major_formatter(self.ThetaFormatter(degrees))
+
+ def set_longitude_grid_ends(self, degrees):
+ """
+ Set the latitude(s) at which to stop drawing the longitude grids.
+ """
+ self._longitude_cap = np.deg2rad(degrees)
+ self._xaxis_pretransform \
+ .clear() \
+ .scale(1.0, self._longitude_cap * 2.0) \
+ .translate(0.0, -self._longitude_cap)
+
+ def get_data_ratio(self):
+ """Return the aspect ratio of the data itself."""
+ return 1.0
+
+ ### Interactive panning
+
+ def can_zoom(self):
+ """
+ Return whether this Axes supports the zoom box button functionality.
+
+ This Axes object does not support interactive zoom box.
+ """
+ return False
+
+ def can_pan(self):
+ """
+ Return whether this Axes supports the pan/zoom button functionality.
+
+ This Axes object does not support interactive pan/zoom.
+ """
+ return False
+
+ def start_pan(self, x, y, button):
+ pass
+
+ def end_pan(self):
+ pass
+
+ def drag_pan(self, button, key, x, y):
+ pass
+
+
+class _GeoTransform(Transform):
+ # Factoring out some common functionality.
+ input_dims = output_dims = 2
+
+ def __init__(self, resolution):
+ """
+ Create a new geographical transform.
+
+ Resolution is the number of steps to interpolate between each input
+ line segment to approximate its path in curved space.
+ """
+ super().__init__()
+ self._resolution = resolution
+
+ def __str__(self):
+ return f"{type(self).__name__}({self._resolution})"
+
+ def transform_path_non_affine(self, path):
+ # docstring inherited
+ ipath = path.interpolated(self._resolution)
+ return Path(self.transform(ipath.vertices), ipath.codes)
+
+
+class AitoffAxes(GeoAxes):
+ name = 'aitoff'
+
+ class AitoffTransform(_GeoTransform):
+ """The base Aitoff transform."""
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ longitude, latitude = values.T
+
+ # Pre-compute some values
+ half_long = longitude / 2.0
+ cos_latitude = np.cos(latitude)
+
+ alpha = np.arccos(cos_latitude * np.cos(half_long))
+ sinc_alpha = np.sinc(alpha / np.pi) # np.sinc is sin(pi*x)/(pi*x).
+
+ x = (cos_latitude * np.sin(half_long)) / sinc_alpha
+ y = np.sin(latitude) / sinc_alpha
+ return np.column_stack([x, y])
+
+ def inverted(self):
+ # docstring inherited
+ return AitoffAxes.InvertedAitoffTransform(self._resolution)
+
+ class InvertedAitoffTransform(_GeoTransform):
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ # MGDTODO: Math is hard ;(
+ return np.full_like(values, np.nan)
+
+ def inverted(self):
+ # docstring inherited
+ return AitoffAxes.AitoffTransform(self._resolution)
+
+ def __init__(self, *args, **kwargs):
+ self._longitude_cap = np.pi / 2.0
+ super().__init__(*args, **kwargs)
+ self.set_aspect(0.5, adjustable='box', anchor='C')
+ self.clear()
+
+ def _get_core_transform(self, resolution):
+ return self.AitoffTransform(resolution)
+
+
+class HammerAxes(GeoAxes):
+ name = 'hammer'
+
+ class HammerTransform(_GeoTransform):
+ """The base Hammer transform."""
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ longitude, latitude = values.T
+ half_long = longitude / 2.0
+ cos_latitude = np.cos(latitude)
+ sqrt2 = np.sqrt(2.0)
+ alpha = np.sqrt(1.0 + cos_latitude * np.cos(half_long))
+ x = (2.0 * sqrt2) * (cos_latitude * np.sin(half_long)) / alpha
+ y = (sqrt2 * np.sin(latitude)) / alpha
+ return np.column_stack([x, y])
+
+ def inverted(self):
+ # docstring inherited
+ return HammerAxes.InvertedHammerTransform(self._resolution)
+
+ class InvertedHammerTransform(_GeoTransform):
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ x, y = values.T
+ z = np.sqrt(1 - (x / 4) ** 2 - (y / 2) ** 2)
+ longitude = 2 * np.arctan((z * x) / (2 * (2 * z ** 2 - 1)))
+ latitude = np.arcsin(y*z)
+ return np.column_stack([longitude, latitude])
+
+ def inverted(self):
+ # docstring inherited
+ return HammerAxes.HammerTransform(self._resolution)
+
+ def __init__(self, *args, **kwargs):
+ self._longitude_cap = np.pi / 2.0
+ super().__init__(*args, **kwargs)
+ self.set_aspect(0.5, adjustable='box', anchor='C')
+ self.clear()
+
+ def _get_core_transform(self, resolution):
+ return self.HammerTransform(resolution)
+
+
+class MollweideAxes(GeoAxes):
+ name = 'mollweide'
+
+ class MollweideTransform(_GeoTransform):
+ """The base Mollweide transform."""
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ def d(theta):
+ delta = (-(theta + np.sin(theta) - pi_sin_l)
+ / (1 + np.cos(theta)))
+ return delta, np.abs(delta) > 0.001
+
+ longitude, latitude = values.T
+
+ clat = np.pi/2 - np.abs(latitude)
+ ihigh = clat < 0.087 # within 5 degrees of the poles
+ ilow = ~ihigh
+ aux = np.empty(latitude.shape, dtype=float)
+
+ if ilow.any(): # Newton-Raphson iteration
+ pi_sin_l = np.pi * np.sin(latitude[ilow])
+ theta = 2.0 * latitude[ilow]
+ delta, large_delta = d(theta)
+ while np.any(large_delta):
+ theta[large_delta] += delta[large_delta]
+ delta, large_delta = d(theta)
+ aux[ilow] = theta / 2
+
+ if ihigh.any(): # Taylor series-based approx. solution
+ e = clat[ihigh]
+ d = 0.5 * (3 * np.pi * e**2) ** (1.0/3)
+ aux[ihigh] = (np.pi/2 - d) * np.sign(latitude[ihigh])
+
+ xy = np.empty(values.shape, dtype=float)
+ xy[:, 0] = (2.0 * np.sqrt(2.0) / np.pi) * longitude * np.cos(aux)
+ xy[:, 1] = np.sqrt(2.0) * np.sin(aux)
+
+ return xy
+
+ def inverted(self):
+ # docstring inherited
+ return MollweideAxes.InvertedMollweideTransform(self._resolution)
+
+ class InvertedMollweideTransform(_GeoTransform):
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ x, y = values.T
+ # from Equations (7, 8) of
+ # https://mathworld.wolfram.com/MollweideProjection.html
+ theta = np.arcsin(y / np.sqrt(2))
+ longitude = (np.pi / (2 * np.sqrt(2))) * x / np.cos(theta)
+ latitude = np.arcsin((2 * theta + np.sin(2 * theta)) / np.pi)
+ return np.column_stack([longitude, latitude])
+
+ def inverted(self):
+ # docstring inherited
+ return MollweideAxes.MollweideTransform(self._resolution)
+
+ def __init__(self, *args, **kwargs):
+ self._longitude_cap = np.pi / 2.0
+ super().__init__(*args, **kwargs)
+ self.set_aspect(0.5, adjustable='box', anchor='C')
+ self.clear()
+
+ def _get_core_transform(self, resolution):
+ return self.MollweideTransform(resolution)
+
+
+class LambertAxes(GeoAxes):
+ name = 'lambert'
+
+ class LambertTransform(_GeoTransform):
+ """The base Lambert transform."""
+
+ def __init__(self, center_longitude, center_latitude, resolution):
+ """
+ Create a new Lambert transform. Resolution is the number of steps
+ to interpolate between each input line segment to approximate its
+ path in curved Lambert space.
+ """
+ _GeoTransform.__init__(self, resolution)
+ self._center_longitude = center_longitude
+ self._center_latitude = center_latitude
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ longitude, latitude = values.T
+ clong = self._center_longitude
+ clat = self._center_latitude
+ cos_lat = np.cos(latitude)
+ sin_lat = np.sin(latitude)
+ diff_long = longitude - clong
+ cos_diff_long = np.cos(diff_long)
+
+ inner_k = np.maximum( # Prevent divide-by-zero problems
+ 1 + np.sin(clat)*sin_lat + np.cos(clat)*cos_lat*cos_diff_long,
+ 1e-15)
+ k = np.sqrt(2 / inner_k)
+ x = k * cos_lat*np.sin(diff_long)
+ y = k * (np.cos(clat)*sin_lat - np.sin(clat)*cos_lat*cos_diff_long)
+
+ return np.column_stack([x, y])
+
+ def inverted(self):
+ # docstring inherited
+ return LambertAxes.InvertedLambertTransform(
+ self._center_longitude,
+ self._center_latitude,
+ self._resolution)
+
+ class InvertedLambertTransform(_GeoTransform):
+
+ def __init__(self, center_longitude, center_latitude, resolution):
+ _GeoTransform.__init__(self, resolution)
+ self._center_longitude = center_longitude
+ self._center_latitude = center_latitude
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ x, y = values.T
+ clong = self._center_longitude
+ clat = self._center_latitude
+ p = np.maximum(np.hypot(x, y), 1e-9)
+ c = 2 * np.arcsin(0.5 * p)
+ sin_c = np.sin(c)
+ cos_c = np.cos(c)
+
+ latitude = np.arcsin(cos_c*np.sin(clat) +
+ ((y*sin_c*np.cos(clat)) / p))
+ longitude = clong + np.arctan(
+ (x*sin_c) / (p*np.cos(clat)*cos_c - y*np.sin(clat)*sin_c))
+
+ return np.column_stack([longitude, latitude])
+
+ def inverted(self):
+ # docstring inherited
+ return LambertAxes.LambertTransform(
+ self._center_longitude,
+ self._center_latitude,
+ self._resolution)
+
+ def __init__(self, *args, center_longitude=0, center_latitude=0, **kwargs):
+ self._longitude_cap = np.pi / 2
+ self._center_longitude = center_longitude
+ self._center_latitude = center_latitude
+ super().__init__(*args, **kwargs)
+ self.set_aspect('equal', adjustable='box', anchor='C')
+ self.clear()
+
+ def clear(self):
+ # docstring inherited
+ super().clear()
+ self.yaxis.set_major_formatter(NullFormatter())
+
+ def _get_core_transform(self, resolution):
+ return self.LambertTransform(
+ self._center_longitude,
+ self._center_latitude,
+ resolution)
+
+ def _get_affine_transform(self):
+ return Affine2D() \
+ .scale(0.25) \
+ .translate(0.5, 0.5)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/geo.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/geo.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..93220f8cbcd58278b90bd18bbc58d5ef92d45d4f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/geo.pyi
@@ -0,0 +1,112 @@
+from matplotlib.axes import Axes
+from matplotlib.ticker import Formatter
+from matplotlib.transforms import Transform
+
+from typing import Any, Literal
+
+class GeoAxes(Axes):
+ class ThetaFormatter(Formatter):
+ def __init__(self, round_to: float = ...) -> None: ...
+ def __call__(self, x: float, pos: Any | None = ...): ...
+ RESOLUTION: float
+ def get_xaxis_transform(
+ self, which: Literal["tick1", "tick2", "grid"] = ...
+ ) -> Transform: ...
+ def get_xaxis_text1_transform(
+ self, pad: float
+ ) -> tuple[
+ Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_xaxis_text2_transform(
+ self, pad: float
+ ) -> tuple[
+ Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_yaxis_transform(
+ self, which: Literal["tick1", "tick2", "grid"] = ...
+ ) -> Transform: ...
+ def get_yaxis_text1_transform(
+ self, pad: float
+ ) -> tuple[
+ Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_yaxis_text2_transform(
+ self, pad: float
+ ) -> tuple[
+ Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def set_xlim(self, *args, **kwargs) -> tuple[float, float]: ...
+ def set_ylim(self, *args, **kwargs) -> tuple[float, float]: ...
+ def format_coord(self, lon: float, lat: float) -> str: ...
+ def set_longitude_grid(self, degrees: float) -> None: ...
+ def set_latitude_grid(self, degrees: float) -> None: ...
+ def set_longitude_grid_ends(self, degrees: float) -> None: ...
+ def get_data_ratio(self) -> float: ...
+ def can_zoom(self) -> bool: ...
+ def can_pan(self) -> bool: ...
+ def start_pan(self, x, y, button) -> None: ...
+ def end_pan(self) -> None: ...
+ def drag_pan(self, button, key, x, y) -> None: ...
+
+class _GeoTransform(Transform):
+ input_dims: int
+ output_dims: int
+ def __init__(self, resolution: int) -> None: ...
+
+class AitoffAxes(GeoAxes):
+ name: str
+
+ class AitoffTransform(_GeoTransform):
+ def inverted(self) -> AitoffAxes.InvertedAitoffTransform: ...
+
+ class InvertedAitoffTransform(_GeoTransform):
+ def inverted(self) -> AitoffAxes.AitoffTransform: ...
+
+class HammerAxes(GeoAxes):
+ name: str
+
+ class HammerTransform(_GeoTransform):
+ def inverted(self) -> HammerAxes.InvertedHammerTransform: ...
+
+ class InvertedHammerTransform(_GeoTransform):
+ def inverted(self) -> HammerAxes.HammerTransform: ...
+
+class MollweideAxes(GeoAxes):
+ name: str
+
+ class MollweideTransform(_GeoTransform):
+ def inverted(self) -> MollweideAxes.InvertedMollweideTransform: ...
+
+ class InvertedMollweideTransform(_GeoTransform):
+ def inverted(self) -> MollweideAxes.MollweideTransform: ...
+
+class LambertAxes(GeoAxes):
+ name: str
+
+ class LambertTransform(_GeoTransform):
+ def __init__(
+ self, center_longitude: float, center_latitude: float, resolution: int
+ ) -> None: ...
+ def inverted(self) -> LambertAxes.InvertedLambertTransform: ...
+
+ class InvertedLambertTransform(_GeoTransform):
+ def __init__(
+ self, center_longitude: float, center_latitude: float, resolution: int
+ ) -> None: ...
+ def inverted(self) -> LambertAxes.LambertTransform: ...
+
+ def __init__(
+ self,
+ *args,
+ center_longitude: float = ...,
+ center_latitude: float = ...,
+ **kwargs
+ ) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/polar.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/polar.py
new file mode 100644
index 0000000000000000000000000000000000000000..7fe6045039b152801c35933e8432ccd59ab8615b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/polar.py
@@ -0,0 +1,1557 @@
+import math
+import types
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cbook
+from matplotlib.axes import Axes
+import matplotlib.axis as maxis
+import matplotlib.markers as mmarkers
+import matplotlib.patches as mpatches
+from matplotlib.path import Path
+import matplotlib.ticker as mticker
+import matplotlib.transforms as mtransforms
+from matplotlib.spines import Spine
+
+
+def _apply_theta_transforms_warn():
+ _api.warn_deprecated(
+ "3.9",
+ message=(
+ "Passing `apply_theta_transforms=True` (the default) "
+ "is deprecated since Matplotlib %(since)s. "
+ "Support for this will be removed in Matplotlib in %(removal)s. "
+ "To prevent this warning, set `apply_theta_transforms=False`, "
+ "and make sure to shift theta values before being passed to "
+ "this transform."
+ )
+ )
+
+
+class PolarTransform(mtransforms.Transform):
+ r"""
+ The base polar transform.
+
+ This transform maps polar coordinates :math:`\theta, r` into Cartesian
+ coordinates :math:`x, y = r \cos(\theta), r \sin(\theta)`
+ (but does not fully transform into Axes coordinates or
+ handle positioning in screen space).
+
+ This transformation is designed to be applied to data after any scaling
+ along the radial axis (e.g. log-scaling) has been applied to the input
+ data.
+
+ Path segments at a fixed radius are automatically transformed to circular
+ arcs as long as ``path._interpolation_steps > 1``.
+ """
+
+ input_dims = output_dims = 2
+
+ def __init__(self, axis=None, use_rmin=True, *,
+ apply_theta_transforms=True, scale_transform=None):
+ """
+ Parameters
+ ----------
+ axis : `~matplotlib.axis.Axis`, optional
+ Axis associated with this transform. This is used to get the
+ minimum radial limit.
+ use_rmin : `bool`, optional
+ If ``True``, subtract the minimum radial axis limit before
+ transforming to Cartesian coordinates. *axis* must also be
+ specified for this to take effect.
+ """
+ super().__init__()
+ self._axis = axis
+ self._use_rmin = use_rmin
+ self._apply_theta_transforms = apply_theta_transforms
+ self._scale_transform = scale_transform
+ if apply_theta_transforms:
+ _apply_theta_transforms_warn()
+
+ __str__ = mtransforms._make_str_method(
+ "_axis",
+ use_rmin="_use_rmin",
+ apply_theta_transforms="_apply_theta_transforms")
+
+ def _get_rorigin(self):
+ # Get lower r limit after being scaled by the radial scale transform
+ return self._scale_transform.transform(
+ (0, self._axis.get_rorigin()))[1]
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ theta, r = np.transpose(values)
+ # PolarAxes does not use the theta transforms here, but apply them for
+ # backwards-compatibility if not being used by it.
+ if self._apply_theta_transforms and self._axis is not None:
+ theta *= self._axis.get_theta_direction()
+ theta += self._axis.get_theta_offset()
+ if self._use_rmin and self._axis is not None:
+ r = (r - self._get_rorigin()) * self._axis.get_rsign()
+ r = np.where(r >= 0, r, np.nan)
+ return np.column_stack([r * np.cos(theta), r * np.sin(theta)])
+
+ def transform_path_non_affine(self, path):
+ # docstring inherited
+ if not len(path) or path._interpolation_steps == 1:
+ return Path(self.transform_non_affine(path.vertices), path.codes)
+ xys = []
+ codes = []
+ last_t = last_r = None
+ for trs, c in path.iter_segments():
+ trs = trs.reshape((-1, 2))
+ if c == Path.LINETO:
+ (t, r), = trs
+ if t == last_t: # Same angle: draw a straight line.
+ xys.extend(self.transform_non_affine(trs))
+ codes.append(Path.LINETO)
+ elif r == last_r: # Same radius: draw an arc.
+ # The following is complicated by Path.arc() being
+ # "helpful" and unwrapping the angles, but we don't want
+ # that behavior here.
+ last_td, td = np.rad2deg([last_t, t])
+ if self._use_rmin and self._axis is not None:
+ r = ((r - self._get_rorigin())
+ * self._axis.get_rsign())
+ if last_td <= td:
+ while td - last_td > 360:
+ arc = Path.arc(last_td, last_td + 360)
+ xys.extend(arc.vertices[1:] * r)
+ codes.extend(arc.codes[1:])
+ last_td += 360
+ arc = Path.arc(last_td, td)
+ xys.extend(arc.vertices[1:] * r)
+ codes.extend(arc.codes[1:])
+ else:
+ # The reverse version also relies on the fact that all
+ # codes but the first one are the same.
+ while last_td - td > 360:
+ arc = Path.arc(last_td - 360, last_td)
+ xys.extend(arc.vertices[::-1][1:] * r)
+ codes.extend(arc.codes[1:])
+ last_td -= 360
+ arc = Path.arc(td, last_td)
+ xys.extend(arc.vertices[::-1][1:] * r)
+ codes.extend(arc.codes[1:])
+ else: # Interpolate.
+ trs = cbook.simple_linear_interpolation(
+ np.vstack([(last_t, last_r), trs]),
+ path._interpolation_steps)[1:]
+ xys.extend(self.transform_non_affine(trs))
+ codes.extend([Path.LINETO] * len(trs))
+ else: # Not a straight line.
+ xys.extend(self.transform_non_affine(trs))
+ codes.extend([c] * len(trs))
+ last_t, last_r = trs[-1]
+ return Path(xys, codes)
+
+ def inverted(self):
+ # docstring inherited
+ return PolarAxes.InvertedPolarTransform(
+ self._axis, self._use_rmin,
+ apply_theta_transforms=self._apply_theta_transforms
+ )
+
+
+class PolarAffine(mtransforms.Affine2DBase):
+ r"""
+ The affine part of the polar projection.
+
+ Scales the output so that maximum radius rests on the edge of the Axes
+ circle and the origin is mapped to (0.5, 0.5). The transform applied is
+ the same to x and y components and given by:
+
+ .. math::
+
+ x_{1} = 0.5 \left [ \frac{x_{0}}{(r_{\max} - r_{\min})} + 1 \right ]
+
+ :math:`r_{\min}, r_{\max}` are the minimum and maximum radial limits after
+ any scaling (e.g. log scaling) has been removed.
+ """
+ def __init__(self, scale_transform, limits):
+ """
+ Parameters
+ ----------
+ scale_transform : `~matplotlib.transforms.Transform`
+ Scaling transform for the data. This is used to remove any scaling
+ from the radial view limits.
+ limits : `~matplotlib.transforms.BboxBase`
+ View limits of the data. The only part of its bounds that is used
+ is the y limits (for the radius limits).
+ """
+ super().__init__()
+ self._scale_transform = scale_transform
+ self._limits = limits
+ self.set_children(scale_transform, limits)
+ self._mtx = None
+
+ __str__ = mtransforms._make_str_method("_scale_transform", "_limits")
+
+ def get_matrix(self):
+ # docstring inherited
+ if self._invalid:
+ limits_scaled = self._limits.transformed(self._scale_transform)
+ yscale = limits_scaled.ymax - limits_scaled.ymin
+ affine = mtransforms.Affine2D() \
+ .scale(0.5 / yscale) \
+ .translate(0.5, 0.5)
+ self._mtx = affine.get_matrix()
+ self._inverted = None
+ self._invalid = 0
+ return self._mtx
+
+
+class InvertedPolarTransform(mtransforms.Transform):
+ """
+ The inverse of the polar transform, mapping Cartesian
+ coordinate space *x* and *y* back to *theta* and *r*.
+ """
+ input_dims = output_dims = 2
+
+ def __init__(self, axis=None, use_rmin=True,
+ *, apply_theta_transforms=True):
+ """
+ Parameters
+ ----------
+ axis : `~matplotlib.axis.Axis`, optional
+ Axis associated with this transform. This is used to get the
+ minimum radial limit.
+ use_rmin : `bool`, optional
+ If ``True``, add the minimum radial axis limit after
+ transforming from Cartesian coordinates. *axis* must also be
+ specified for this to take effect.
+ """
+ super().__init__()
+ self._axis = axis
+ self._use_rmin = use_rmin
+ self._apply_theta_transforms = apply_theta_transforms
+ if apply_theta_transforms:
+ _apply_theta_transforms_warn()
+
+ __str__ = mtransforms._make_str_method(
+ "_axis",
+ use_rmin="_use_rmin",
+ apply_theta_transforms="_apply_theta_transforms")
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ x, y = values.T
+ r = np.hypot(x, y)
+ theta = (np.arctan2(y, x) + 2 * np.pi) % (2 * np.pi)
+ # PolarAxes does not use the theta transforms here, but apply them for
+ # backwards-compatibility if not being used by it.
+ if self._apply_theta_transforms and self._axis is not None:
+ theta -= self._axis.get_theta_offset()
+ theta *= self._axis.get_theta_direction()
+ theta %= 2 * np.pi
+ if self._use_rmin and self._axis is not None:
+ r += self._axis.get_rorigin()
+ r *= self._axis.get_rsign()
+ return np.column_stack([theta, r])
+
+ def inverted(self):
+ # docstring inherited
+ return PolarAxes.PolarTransform(
+ self._axis, self._use_rmin,
+ apply_theta_transforms=self._apply_theta_transforms
+ )
+
+
+class ThetaFormatter(mticker.Formatter):
+ """
+ Used to format the *theta* tick labels. Converts the native
+ unit of radians into degrees and adds a degree symbol.
+ """
+
+ def __call__(self, x, pos=None):
+ vmin, vmax = self.axis.get_view_interval()
+ d = np.rad2deg(abs(vmax - vmin))
+ digits = max(-int(np.log10(d) - 1.5), 0)
+ return f"{np.rad2deg(x):0.{digits}f}\N{DEGREE SIGN}"
+
+
+class _AxisWrapper:
+ def __init__(self, axis):
+ self._axis = axis
+
+ def get_view_interval(self):
+ return np.rad2deg(self._axis.get_view_interval())
+
+ def set_view_interval(self, vmin, vmax):
+ self._axis.set_view_interval(*np.deg2rad((vmin, vmax)))
+
+ def get_minpos(self):
+ return np.rad2deg(self._axis.get_minpos())
+
+ def get_data_interval(self):
+ return np.rad2deg(self._axis.get_data_interval())
+
+ def set_data_interval(self, vmin, vmax):
+ self._axis.set_data_interval(*np.deg2rad((vmin, vmax)))
+
+ def get_tick_space(self):
+ return self._axis.get_tick_space()
+
+
+class ThetaLocator(mticker.Locator):
+ """
+ Used to locate theta ticks.
+
+ This will work the same as the base locator except in the case that the
+ view spans the entire circle. In such cases, the previously used default
+ locations of every 45 degrees are returned.
+ """
+
+ def __init__(self, base):
+ self.base = base
+ self.axis = self.base.axis = _AxisWrapper(self.base.axis)
+
+ def set_axis(self, axis):
+ self.axis = _AxisWrapper(axis)
+ self.base.set_axis(self.axis)
+
+ def __call__(self):
+ lim = self.axis.get_view_interval()
+ if _is_full_circle_deg(lim[0], lim[1]):
+ return np.deg2rad(min(lim)) + np.arange(8) * 2 * np.pi / 8
+ else:
+ return np.deg2rad(self.base())
+
+ def view_limits(self, vmin, vmax):
+ vmin, vmax = np.rad2deg((vmin, vmax))
+ return np.deg2rad(self.base.view_limits(vmin, vmax))
+
+
+class ThetaTick(maxis.XTick):
+ """
+ A theta-axis tick.
+
+ This subclass of `.XTick` provides angular ticks with some small
+ modification to their re-positioning such that ticks are rotated based on
+ tick location. This results in ticks that are correctly perpendicular to
+ the arc spine.
+
+ When 'auto' rotation is enabled, labels are also rotated to be parallel to
+ the spine. The label padding is also applied here since it's not possible
+ to use a generic axes transform to produce tick-specific padding.
+ """
+
+ def __init__(self, axes, *args, **kwargs):
+ self._text1_translate = mtransforms.ScaledTranslation(
+ 0, 0, axes.get_figure(root=False).dpi_scale_trans)
+ self._text2_translate = mtransforms.ScaledTranslation(
+ 0, 0, axes.get_figure(root=False).dpi_scale_trans)
+ super().__init__(axes, *args, **kwargs)
+ self.label1.set(
+ rotation_mode='anchor',
+ transform=self.label1.get_transform() + self._text1_translate)
+ self.label2.set(
+ rotation_mode='anchor',
+ transform=self.label2.get_transform() + self._text2_translate)
+
+ def _apply_params(self, **kwargs):
+ super()._apply_params(**kwargs)
+ # Ensure transform is correct; sometimes this gets reset.
+ trans = self.label1.get_transform()
+ if not trans.contains_branch(self._text1_translate):
+ self.label1.set_transform(trans + self._text1_translate)
+ trans = self.label2.get_transform()
+ if not trans.contains_branch(self._text2_translate):
+ self.label2.set_transform(trans + self._text2_translate)
+
+ def _update_padding(self, pad, angle):
+ padx = pad * np.cos(angle) / 72
+ pady = pad * np.sin(angle) / 72
+ self._text1_translate._t = (padx, pady)
+ self._text1_translate.invalidate()
+ self._text2_translate._t = (-padx, -pady)
+ self._text2_translate.invalidate()
+
+ def update_position(self, loc):
+ super().update_position(loc)
+ axes = self.axes
+ angle = loc * axes.get_theta_direction() + axes.get_theta_offset()
+ text_angle = np.rad2deg(angle) % 360 - 90
+ angle -= np.pi / 2
+
+ marker = self.tick1line.get_marker()
+ if marker in (mmarkers.TICKUP, '|'):
+ trans = mtransforms.Affine2D().scale(1, 1).rotate(angle)
+ elif marker == mmarkers.TICKDOWN:
+ trans = mtransforms.Affine2D().scale(1, -1).rotate(angle)
+ else:
+ # Don't modify custom tick line markers.
+ trans = self.tick1line._marker._transform
+ self.tick1line._marker._transform = trans
+
+ marker = self.tick2line.get_marker()
+ if marker in (mmarkers.TICKUP, '|'):
+ trans = mtransforms.Affine2D().scale(1, 1).rotate(angle)
+ elif marker == mmarkers.TICKDOWN:
+ trans = mtransforms.Affine2D().scale(1, -1).rotate(angle)
+ else:
+ # Don't modify custom tick line markers.
+ trans = self.tick2line._marker._transform
+ self.tick2line._marker._transform = trans
+
+ mode, user_angle = self._labelrotation
+ if mode == 'default':
+ text_angle = user_angle
+ else:
+ if text_angle > 90:
+ text_angle -= 180
+ elif text_angle < -90:
+ text_angle += 180
+ text_angle += user_angle
+ self.label1.set_rotation(text_angle)
+ self.label2.set_rotation(text_angle)
+
+ # This extra padding helps preserve the look from previous releases but
+ # is also needed because labels are anchored to their center.
+ pad = self._pad + 7
+ self._update_padding(pad,
+ self._loc * axes.get_theta_direction() +
+ axes.get_theta_offset())
+
+
+class ThetaAxis(maxis.XAxis):
+ """
+ A theta Axis.
+
+ This overrides certain properties of an `.XAxis` to provide special-casing
+ for an angular axis.
+ """
+ __name__ = 'thetaaxis'
+ axis_name = 'theta' #: Read-only name identifying the axis.
+ _tick_class = ThetaTick
+
+ def _wrap_locator_formatter(self):
+ self.set_major_locator(ThetaLocator(self.get_major_locator()))
+ self.set_major_formatter(ThetaFormatter())
+ self.isDefault_majloc = True
+ self.isDefault_majfmt = True
+
+ def clear(self):
+ # docstring inherited
+ super().clear()
+ self.set_ticks_position('none')
+ self._wrap_locator_formatter()
+
+ def _set_scale(self, value, **kwargs):
+ if value != 'linear':
+ raise NotImplementedError(
+ "The xscale cannot be set on a polar plot")
+ super()._set_scale(value, **kwargs)
+ # LinearScale.set_default_locators_and_formatters just set the major
+ # locator to be an AutoLocator, so we customize it here to have ticks
+ # at sensible degree multiples.
+ self.get_major_locator().set_params(steps=[1, 1.5, 3, 4.5, 9, 10])
+ self._wrap_locator_formatter()
+
+ def _copy_tick_props(self, src, dest):
+ """Copy the props from src tick to dest tick."""
+ if src is None or dest is None:
+ return
+ super()._copy_tick_props(src, dest)
+
+ # Ensure that tick transforms are independent so that padding works.
+ trans = dest._get_text1_transform()[0]
+ dest.label1.set_transform(trans + dest._text1_translate)
+ trans = dest._get_text2_transform()[0]
+ dest.label2.set_transform(trans + dest._text2_translate)
+
+
+class RadialLocator(mticker.Locator):
+ """
+ Used to locate radius ticks.
+
+ Ensures that all ticks are strictly positive. For all other tasks, it
+ delegates to the base `.Locator` (which may be different depending on the
+ scale of the *r*-axis).
+ """
+
+ def __init__(self, base, axes=None):
+ self.base = base
+ self._axes = axes
+
+ def set_axis(self, axis):
+ self.base.set_axis(axis)
+
+ def __call__(self):
+ # Ensure previous behaviour with full circle non-annular views.
+ if self._axes:
+ if _is_full_circle_rad(*self._axes.viewLim.intervalx):
+ rorigin = self._axes.get_rorigin() * self._axes.get_rsign()
+ if self._axes.get_rmin() <= rorigin:
+ return [tick for tick in self.base() if tick > rorigin]
+ return self.base()
+
+ def _zero_in_bounds(self):
+ """
+ Return True if zero is within the valid values for the
+ scale of the radial axis.
+ """
+ vmin, vmax = self._axes.yaxis._scale.limit_range_for_scale(0, 1, 1e-5)
+ return vmin == 0
+
+ def nonsingular(self, vmin, vmax):
+ # docstring inherited
+ if self._zero_in_bounds() and (vmin, vmax) == (-np.inf, np.inf):
+ # Initial view limits
+ return (0, 1)
+ else:
+ return self.base.nonsingular(vmin, vmax)
+
+ def view_limits(self, vmin, vmax):
+ vmin, vmax = self.base.view_limits(vmin, vmax)
+ if self._zero_in_bounds() and vmax > vmin:
+ # this allows inverted r/y-lims
+ vmin = min(0, vmin)
+ return mtransforms.nonsingular(vmin, vmax)
+
+
+class _ThetaShift(mtransforms.ScaledTranslation):
+ """
+ Apply a padding shift based on axes theta limits.
+
+ This is used to create padding for radial ticks.
+
+ Parameters
+ ----------
+ axes : `~matplotlib.axes.Axes`
+ The owning Axes; used to determine limits.
+ pad : float
+ The padding to apply, in points.
+ mode : {'min', 'max', 'rlabel'}
+ Whether to shift away from the start (``'min'``) or the end (``'max'``)
+ of the axes, or using the rlabel position (``'rlabel'``).
+ """
+ def __init__(self, axes, pad, mode):
+ super().__init__(pad, pad, axes.get_figure(root=False).dpi_scale_trans)
+ self.set_children(axes._realViewLim)
+ self.axes = axes
+ self.mode = mode
+ self.pad = pad
+
+ __str__ = mtransforms._make_str_method("axes", "pad", "mode")
+
+ def get_matrix(self):
+ if self._invalid:
+ if self.mode == 'rlabel':
+ angle = (
+ np.deg2rad(self.axes.get_rlabel_position()
+ * self.axes.get_theta_direction())
+ + self.axes.get_theta_offset()
+ - np.pi / 2
+ )
+ elif self.mode == 'min':
+ angle = self.axes._realViewLim.xmin - np.pi / 2
+ elif self.mode == 'max':
+ angle = self.axes._realViewLim.xmax + np.pi / 2
+ self._t = (self.pad * np.cos(angle) / 72, self.pad * np.sin(angle) / 72)
+ return super().get_matrix()
+
+
+class RadialTick(maxis.YTick):
+ """
+ A radial-axis tick.
+
+ This subclass of `.YTick` provides radial ticks with some small
+ modification to their re-positioning such that ticks are rotated based on
+ axes limits. This results in ticks that are correctly perpendicular to
+ the spine. Labels are also rotated to be perpendicular to the spine, when
+ 'auto' rotation is enabled.
+ """
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.label1.set_rotation_mode('anchor')
+ self.label2.set_rotation_mode('anchor')
+
+ def _determine_anchor(self, mode, angle, start):
+ # Note: angle is the (spine angle - 90) because it's used for the tick
+ # & text setup, so all numbers below are -90 from (normed) spine angle.
+ if mode == 'auto':
+ if start:
+ if -90 <= angle <= 90:
+ return 'left', 'center'
+ else:
+ return 'right', 'center'
+ else:
+ if -90 <= angle <= 90:
+ return 'right', 'center'
+ else:
+ return 'left', 'center'
+ else:
+ if start:
+ if angle < -68.5:
+ return 'center', 'top'
+ elif angle < -23.5:
+ return 'left', 'top'
+ elif angle < 22.5:
+ return 'left', 'center'
+ elif angle < 67.5:
+ return 'left', 'bottom'
+ elif angle < 112.5:
+ return 'center', 'bottom'
+ elif angle < 157.5:
+ return 'right', 'bottom'
+ elif angle < 202.5:
+ return 'right', 'center'
+ elif angle < 247.5:
+ return 'right', 'top'
+ else:
+ return 'center', 'top'
+ else:
+ if angle < -68.5:
+ return 'center', 'bottom'
+ elif angle < -23.5:
+ return 'right', 'bottom'
+ elif angle < 22.5:
+ return 'right', 'center'
+ elif angle < 67.5:
+ return 'right', 'top'
+ elif angle < 112.5:
+ return 'center', 'top'
+ elif angle < 157.5:
+ return 'left', 'top'
+ elif angle < 202.5:
+ return 'left', 'center'
+ elif angle < 247.5:
+ return 'left', 'bottom'
+ else:
+ return 'center', 'bottom'
+
+ def update_position(self, loc):
+ super().update_position(loc)
+ axes = self.axes
+ thetamin = axes.get_thetamin()
+ thetamax = axes.get_thetamax()
+ direction = axes.get_theta_direction()
+ offset_rad = axes.get_theta_offset()
+ offset = np.rad2deg(offset_rad)
+ full = _is_full_circle_deg(thetamin, thetamax)
+
+ if full:
+ angle = (axes.get_rlabel_position() * direction +
+ offset) % 360 - 90
+ tick_angle = 0
+ else:
+ angle = (thetamin * direction + offset) % 360 - 90
+ if direction > 0:
+ tick_angle = np.deg2rad(angle)
+ else:
+ tick_angle = np.deg2rad(angle + 180)
+ text_angle = (angle + 90) % 180 - 90 # between -90 and +90.
+ mode, user_angle = self._labelrotation
+ if mode == 'auto':
+ text_angle += user_angle
+ else:
+ text_angle = user_angle
+
+ if full:
+ ha = self.label1.get_horizontalalignment()
+ va = self.label1.get_verticalalignment()
+ else:
+ ha, va = self._determine_anchor(mode, angle, direction > 0)
+ self.label1.set_horizontalalignment(ha)
+ self.label1.set_verticalalignment(va)
+ self.label1.set_rotation(text_angle)
+
+ marker = self.tick1line.get_marker()
+ if marker == mmarkers.TICKLEFT:
+ trans = mtransforms.Affine2D().rotate(tick_angle)
+ elif marker == '_':
+ trans = mtransforms.Affine2D().rotate(tick_angle + np.pi / 2)
+ elif marker == mmarkers.TICKRIGHT:
+ trans = mtransforms.Affine2D().scale(-1, 1).rotate(tick_angle)
+ else:
+ # Don't modify custom tick line markers.
+ trans = self.tick1line._marker._transform
+ self.tick1line._marker._transform = trans
+
+ if full:
+ self.label2.set_visible(False)
+ self.tick2line.set_visible(False)
+ angle = (thetamax * direction + offset) % 360 - 90
+ if direction > 0:
+ tick_angle = np.deg2rad(angle)
+ else:
+ tick_angle = np.deg2rad(angle + 180)
+ text_angle = (angle + 90) % 180 - 90 # between -90 and +90.
+ mode, user_angle = self._labelrotation
+ if mode == 'auto':
+ text_angle += user_angle
+ else:
+ text_angle = user_angle
+
+ ha, va = self._determine_anchor(mode, angle, direction < 0)
+ self.label2.set_ha(ha)
+ self.label2.set_va(va)
+ self.label2.set_rotation(text_angle)
+
+ marker = self.tick2line.get_marker()
+ if marker == mmarkers.TICKLEFT:
+ trans = mtransforms.Affine2D().rotate(tick_angle)
+ elif marker == '_':
+ trans = mtransforms.Affine2D().rotate(tick_angle + np.pi / 2)
+ elif marker == mmarkers.TICKRIGHT:
+ trans = mtransforms.Affine2D().scale(-1, 1).rotate(tick_angle)
+ else:
+ # Don't modify custom tick line markers.
+ trans = self.tick2line._marker._transform
+ self.tick2line._marker._transform = trans
+
+
+class RadialAxis(maxis.YAxis):
+ """
+ A radial Axis.
+
+ This overrides certain properties of a `.YAxis` to provide special-casing
+ for a radial axis.
+ """
+ __name__ = 'radialaxis'
+ axis_name = 'radius' #: Read-only name identifying the axis.
+ _tick_class = RadialTick
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.sticky_edges.y.append(0)
+
+ def _wrap_locator_formatter(self):
+ self.set_major_locator(RadialLocator(self.get_major_locator(),
+ self.axes))
+ self.isDefault_majloc = True
+
+ def clear(self):
+ # docstring inherited
+ super().clear()
+ self.set_ticks_position('none')
+ self._wrap_locator_formatter()
+
+ def _set_scale(self, value, **kwargs):
+ super()._set_scale(value, **kwargs)
+ self._wrap_locator_formatter()
+
+
+def _is_full_circle_deg(thetamin, thetamax):
+ """
+ Determine if a wedge (in degrees) spans the full circle.
+
+ The condition is derived from :class:`~matplotlib.patches.Wedge`.
+ """
+ return abs(abs(thetamax - thetamin) - 360.0) < 1e-12
+
+
+def _is_full_circle_rad(thetamin, thetamax):
+ """
+ Determine if a wedge (in radians) spans the full circle.
+
+ The condition is derived from :class:`~matplotlib.patches.Wedge`.
+ """
+ return abs(abs(thetamax - thetamin) - 2 * np.pi) < 1.74e-14
+
+
+class _WedgeBbox(mtransforms.Bbox):
+ """
+ Transform (theta, r) wedge Bbox into Axes bounding box.
+
+ Parameters
+ ----------
+ center : (float, float)
+ Center of the wedge
+ viewLim : `~matplotlib.transforms.Bbox`
+ Bbox determining the boundaries of the wedge
+ originLim : `~matplotlib.transforms.Bbox`
+ Bbox determining the origin for the wedge, if different from *viewLim*
+ """
+ def __init__(self, center, viewLim, originLim, **kwargs):
+ super().__init__([[0, 0], [1, 1]], **kwargs)
+ self._center = center
+ self._viewLim = viewLim
+ self._originLim = originLim
+ self.set_children(viewLim, originLim)
+
+ __str__ = mtransforms._make_str_method("_center", "_viewLim", "_originLim")
+
+ def get_points(self):
+ # docstring inherited
+ if self._invalid:
+ points = self._viewLim.get_points().copy()
+ # Scale angular limits to work with Wedge.
+ points[:, 0] *= 180 / np.pi
+ if points[0, 0] > points[1, 0]:
+ points[:, 0] = points[::-1, 0]
+
+ # Scale radial limits based on origin radius.
+ points[:, 1] -= self._originLim.y0
+
+ # Scale radial limits to match axes limits.
+ rscale = 0.5 / points[1, 1]
+ points[:, 1] *= rscale
+ width = min(points[1, 1] - points[0, 1], 0.5)
+
+ # Generate bounding box for wedge.
+ wedge = mpatches.Wedge(self._center, points[1, 1],
+ points[0, 0], points[1, 0],
+ width=width)
+ self.update_from_path(wedge.get_path())
+
+ # Ensure equal aspect ratio.
+ w, h = self._points[1] - self._points[0]
+ deltah = max(w - h, 0) / 2
+ deltaw = max(h - w, 0) / 2
+ self._points += np.array([[-deltaw, -deltah], [deltaw, deltah]])
+
+ self._invalid = 0
+
+ return self._points
+
+
+class PolarAxes(Axes):
+ """
+ A polar graph projection, where the input dimensions are *theta*, *r*.
+
+ Theta starts pointing east and goes anti-clockwise.
+ """
+ name = 'polar'
+
+ def __init__(self, *args,
+ theta_offset=0, theta_direction=1, rlabel_position=22.5,
+ **kwargs):
+ # docstring inherited
+ self._default_theta_offset = theta_offset
+ self._default_theta_direction = theta_direction
+ self._default_rlabel_position = np.deg2rad(rlabel_position)
+ super().__init__(*args, **kwargs)
+ self.use_sticky_edges = True
+ self.set_aspect('equal', adjustable='box', anchor='C')
+ self.clear()
+
+ def clear(self):
+ # docstring inherited
+ super().clear()
+
+ self.title.set_y(1.05)
+
+ start = self.spines.get('start', None)
+ if start:
+ start.set_visible(False)
+ end = self.spines.get('end', None)
+ if end:
+ end.set_visible(False)
+ self.set_xlim(0.0, 2 * np.pi)
+
+ self.grid(mpl.rcParams['polaraxes.grid'])
+ inner = self.spines.get('inner', None)
+ if inner:
+ inner.set_visible(False)
+
+ self.set_rorigin(None)
+ self.set_theta_offset(self._default_theta_offset)
+ self.set_theta_direction(self._default_theta_direction)
+
+ def _init_axis(self):
+ # This is moved out of __init__ because non-separable axes don't use it
+ self.xaxis = ThetaAxis(self, clear=False)
+ self.yaxis = RadialAxis(self, clear=False)
+ self.spines['polar'].register_axis(self.yaxis)
+
+ def _set_lim_and_transforms(self):
+ # A view limit where the minimum radius can be locked if the user
+ # specifies an alternate origin.
+ self._originViewLim = mtransforms.LockableBbox(self.viewLim)
+
+ # Handle angular offset and direction.
+ self._direction = mtransforms.Affine2D() \
+ .scale(self._default_theta_direction, 1.0)
+ self._theta_offset = mtransforms.Affine2D() \
+ .translate(self._default_theta_offset, 0.0)
+ self.transShift = self._direction + self._theta_offset
+ # A view limit shifted to the correct location after accounting for
+ # orientation and offset.
+ self._realViewLim = mtransforms.TransformedBbox(self.viewLim,
+ self.transShift)
+
+ # Transforms the x and y axis separately by a scale factor
+ # It is assumed that this part will have non-linear components
+ self.transScale = mtransforms.TransformWrapper(
+ mtransforms.IdentityTransform())
+
+ # Scale view limit into a bbox around the selected wedge. This may be
+ # smaller than the usual unit axes rectangle if not plotting the full
+ # circle.
+ self.axesLim = _WedgeBbox((0.5, 0.5),
+ self._realViewLim, self._originViewLim)
+
+ # Scale the wedge to fill the axes.
+ self.transWedge = mtransforms.BboxTransformFrom(self.axesLim)
+
+ # Scale the axes to fill the figure.
+ self.transAxes = mtransforms.BboxTransformTo(self.bbox)
+
+ # A (possibly non-linear) projection on the (already scaled)
+ # data. This one is aware of rmin
+ self.transProjection = self.PolarTransform(
+ self,
+ apply_theta_transforms=False,
+ scale_transform=self.transScale
+ )
+ # Add dependency on rorigin.
+ self.transProjection.set_children(self._originViewLim)
+
+ # An affine transformation on the data, generally to limit the
+ # range of the axes
+ self.transProjectionAffine = self.PolarAffine(self.transScale,
+ self._originViewLim)
+
+ # The complete data transformation stack -- from data all the
+ # way to display coordinates
+ #
+ # 1. Remove any radial axis scaling (e.g. log scaling)
+ # 2. Shift data in the theta direction
+ # 3. Project the data from polar to cartesian values
+ # (with the origin in the same place)
+ # 4. Scale and translate the cartesian values to Axes coordinates
+ # (here the origin is moved to the lower left of the Axes)
+ # 5. Move and scale to fill the Axes
+ # 6. Convert from Axes coordinates to Figure coordinates
+ self.transData = (
+ self.transScale +
+ self.transShift +
+ self.transProjection +
+ (
+ self.transProjectionAffine +
+ self.transWedge +
+ self.transAxes
+ )
+ )
+
+ # This is the transform for theta-axis ticks. It is
+ # equivalent to transData, except it always puts r == 0.0 and r == 1.0
+ # at the edge of the axis circles.
+ self._xaxis_transform = (
+ mtransforms.blended_transform_factory(
+ mtransforms.IdentityTransform(),
+ mtransforms.BboxTransformTo(self.viewLim)) +
+ self.transData)
+ # The theta labels are flipped along the radius, so that text 1 is on
+ # the outside by default. This should work the same as before.
+ flipr_transform = mtransforms.Affine2D() \
+ .translate(0.0, -0.5) \
+ .scale(1.0, -1.0) \
+ .translate(0.0, 0.5)
+ self._xaxis_text_transform = flipr_transform + self._xaxis_transform
+
+ # This is the transform for r-axis ticks. It scales the theta
+ # axis so the gridlines from 0.0 to 1.0, now go from thetamin to
+ # thetamax.
+ self._yaxis_transform = (
+ mtransforms.blended_transform_factory(
+ mtransforms.BboxTransformTo(self.viewLim),
+ mtransforms.IdentityTransform()) +
+ self.transData)
+ # The r-axis labels are put at an angle and padded in the r-direction
+ self._r_label_position = mtransforms.Affine2D() \
+ .translate(self._default_rlabel_position, 0.0)
+ self._yaxis_text_transform = mtransforms.TransformWrapper(
+ self._r_label_position + self.transData)
+
+ def get_xaxis_transform(self, which='grid'):
+ _api.check_in_list(['tick1', 'tick2', 'grid'], which=which)
+ return self._xaxis_transform
+
+ def get_xaxis_text1_transform(self, pad):
+ return self._xaxis_text_transform, 'center', 'center'
+
+ def get_xaxis_text2_transform(self, pad):
+ return self._xaxis_text_transform, 'center', 'center'
+
+ def get_yaxis_transform(self, which='grid'):
+ if which in ('tick1', 'tick2'):
+ return self._yaxis_text_transform
+ elif which == 'grid':
+ return self._yaxis_transform
+ else:
+ _api.check_in_list(['tick1', 'tick2', 'grid'], which=which)
+
+ def get_yaxis_text1_transform(self, pad):
+ thetamin, thetamax = self._realViewLim.intervalx
+ if _is_full_circle_rad(thetamin, thetamax):
+ return self._yaxis_text_transform, 'bottom', 'left'
+ elif self.get_theta_direction() > 0:
+ halign = 'left'
+ pad_shift = _ThetaShift(self, pad, 'min')
+ else:
+ halign = 'right'
+ pad_shift = _ThetaShift(self, pad, 'max')
+ return self._yaxis_text_transform + pad_shift, 'center', halign
+
+ def get_yaxis_text2_transform(self, pad):
+ if self.get_theta_direction() > 0:
+ halign = 'right'
+ pad_shift = _ThetaShift(self, pad, 'max')
+ else:
+ halign = 'left'
+ pad_shift = _ThetaShift(self, pad, 'min')
+ return self._yaxis_text_transform + pad_shift, 'center', halign
+
+ def draw(self, renderer):
+ self._unstale_viewLim()
+ thetamin, thetamax = np.rad2deg(self._realViewLim.intervalx)
+ if thetamin > thetamax:
+ thetamin, thetamax = thetamax, thetamin
+ rmin, rmax = ((self._realViewLim.intervaly - self.get_rorigin()) *
+ self.get_rsign())
+ if isinstance(self.patch, mpatches.Wedge):
+ # Backwards-compatibility: Any subclassed Axes might override the
+ # patch to not be the Wedge that PolarAxes uses.
+ center = self.transWedge.transform((0.5, 0.5))
+ self.patch.set_center(center)
+ self.patch.set_theta1(thetamin)
+ self.patch.set_theta2(thetamax)
+
+ edge, _ = self.transWedge.transform((1, 0))
+ radius = edge - center[0]
+ width = min(radius * (rmax - rmin) / rmax, radius)
+ self.patch.set_radius(radius)
+ self.patch.set_width(width)
+
+ inner_width = radius - width
+ inner = self.spines.get('inner', None)
+ if inner:
+ inner.set_visible(inner_width != 0.0)
+
+ visible = not _is_full_circle_deg(thetamin, thetamax)
+ # For backwards compatibility, any subclassed Axes might override the
+ # spines to not include start/end that PolarAxes uses.
+ start = self.spines.get('start', None)
+ end = self.spines.get('end', None)
+ if start:
+ start.set_visible(visible)
+ if end:
+ end.set_visible(visible)
+ if visible:
+ yaxis_text_transform = self._yaxis_transform
+ else:
+ yaxis_text_transform = self._r_label_position + self.transData
+ if self._yaxis_text_transform != yaxis_text_transform:
+ self._yaxis_text_transform.set(yaxis_text_transform)
+ self.yaxis.reset_ticks()
+ self.yaxis.set_clip_path(self.patch)
+
+ super().draw(renderer)
+
+ def _gen_axes_patch(self):
+ return mpatches.Wedge((0.5, 0.5), 0.5, 0.0, 360.0)
+
+ def _gen_axes_spines(self):
+ spines = {
+ 'polar': Spine.arc_spine(self, 'top', (0.5, 0.5), 0.5, 0, 360),
+ 'start': Spine.linear_spine(self, 'left'),
+ 'end': Spine.linear_spine(self, 'right'),
+ 'inner': Spine.arc_spine(self, 'bottom', (0.5, 0.5), 0.0, 0, 360),
+ }
+ spines['polar'].set_transform(self.transWedge + self.transAxes)
+ spines['inner'].set_transform(self.transWedge + self.transAxes)
+ spines['start'].set_transform(self._yaxis_transform)
+ spines['end'].set_transform(self._yaxis_transform)
+ return spines
+
+ def set_thetamax(self, thetamax):
+ """Set the maximum theta limit in degrees."""
+ self.viewLim.x1 = np.deg2rad(thetamax)
+
+ def get_thetamax(self):
+ """Return the maximum theta limit in degrees."""
+ return np.rad2deg(self.viewLim.xmax)
+
+ def set_thetamin(self, thetamin):
+ """Set the minimum theta limit in degrees."""
+ self.viewLim.x0 = np.deg2rad(thetamin)
+
+ def get_thetamin(self):
+ """Get the minimum theta limit in degrees."""
+ return np.rad2deg(self.viewLim.xmin)
+
+ def set_thetalim(self, *args, **kwargs):
+ r"""
+ Set the minimum and maximum theta values.
+
+ Can take the following signatures:
+
+ - ``set_thetalim(minval, maxval)``: Set the limits in radians.
+ - ``set_thetalim(thetamin=minval, thetamax=maxval)``: Set the limits
+ in degrees.
+
+ where minval and maxval are the minimum and maximum limits. Values are
+ wrapped in to the range :math:`[0, 2\pi]` (in radians), so for example
+ it is possible to do ``set_thetalim(-np.pi / 2, np.pi / 2)`` to have
+ an axis symmetric around 0. A ValueError is raised if the absolute
+ angle difference is larger than a full circle.
+ """
+ orig_lim = self.get_xlim() # in radians
+ if 'thetamin' in kwargs:
+ kwargs['xmin'] = np.deg2rad(kwargs.pop('thetamin'))
+ if 'thetamax' in kwargs:
+ kwargs['xmax'] = np.deg2rad(kwargs.pop('thetamax'))
+ new_min, new_max = self.set_xlim(*args, **kwargs)
+ # Parsing all permutations of *args, **kwargs is tricky; it is simpler
+ # to let set_xlim() do it and then validate the limits.
+ if abs(new_max - new_min) > 2 * np.pi:
+ self.set_xlim(orig_lim) # un-accept the change
+ raise ValueError("The angle range must be less than a full circle")
+ return tuple(np.rad2deg((new_min, new_max)))
+
+ def set_theta_offset(self, offset):
+ """
+ Set the offset for the location of 0 in radians.
+ """
+ mtx = self._theta_offset.get_matrix()
+ mtx[0, 2] = offset
+ self._theta_offset.invalidate()
+
+ def get_theta_offset(self):
+ """
+ Get the offset for the location of 0 in radians.
+ """
+ return self._theta_offset.get_matrix()[0, 2]
+
+ def set_theta_zero_location(self, loc, offset=0.0):
+ """
+ Set the location of theta's zero.
+
+ This simply calls `set_theta_offset` with the correct value in radians.
+
+ Parameters
+ ----------
+ loc : str
+ May be one of "N", "NW", "W", "SW", "S", "SE", "E", or "NE".
+ offset : float, default: 0
+ An offset in degrees to apply from the specified *loc*. **Note:**
+ this offset is *always* applied counter-clockwise regardless of
+ the direction setting.
+ """
+ mapping = {
+ 'N': np.pi * 0.5,
+ 'NW': np.pi * 0.75,
+ 'W': np.pi,
+ 'SW': np.pi * 1.25,
+ 'S': np.pi * 1.5,
+ 'SE': np.pi * 1.75,
+ 'E': 0,
+ 'NE': np.pi * 0.25}
+ return self.set_theta_offset(mapping[loc] + np.deg2rad(offset))
+
+ def set_theta_direction(self, direction):
+ """
+ Set the direction in which theta increases.
+
+ clockwise, -1:
+ Theta increases in the clockwise direction
+
+ counterclockwise, anticlockwise, 1:
+ Theta increases in the counterclockwise direction
+ """
+ mtx = self._direction.get_matrix()
+ if direction in ('clockwise', -1):
+ mtx[0, 0] = -1
+ elif direction in ('counterclockwise', 'anticlockwise', 1):
+ mtx[0, 0] = 1
+ else:
+ _api.check_in_list(
+ [-1, 1, 'clockwise', 'counterclockwise', 'anticlockwise'],
+ direction=direction)
+ self._direction.invalidate()
+
+ def get_theta_direction(self):
+ """
+ Get the direction in which theta increases.
+
+ -1:
+ Theta increases in the clockwise direction
+
+ 1:
+ Theta increases in the counterclockwise direction
+ """
+ return self._direction.get_matrix()[0, 0]
+
+ def set_rmax(self, rmax):
+ """
+ Set the outer radial limit.
+
+ Parameters
+ ----------
+ rmax : float
+ """
+ self.viewLim.y1 = rmax
+
+ def get_rmax(self):
+ """
+ Returns
+ -------
+ float
+ Outer radial limit.
+ """
+ return self.viewLim.ymax
+
+ def set_rmin(self, rmin):
+ """
+ Set the inner radial limit.
+
+ Parameters
+ ----------
+ rmin : float
+ """
+ self.viewLim.y0 = rmin
+
+ def get_rmin(self):
+ """
+ Returns
+ -------
+ float
+ The inner radial limit.
+ """
+ return self.viewLim.ymin
+
+ def set_rorigin(self, rorigin):
+ """
+ Update the radial origin.
+
+ Parameters
+ ----------
+ rorigin : float
+ """
+ self._originViewLim.locked_y0 = rorigin
+
+ def get_rorigin(self):
+ """
+ Returns
+ -------
+ float
+ """
+ return self._originViewLim.y0
+
+ def get_rsign(self):
+ return np.sign(self._originViewLim.y1 - self._originViewLim.y0)
+
+ def set_rlim(self, bottom=None, top=None, *,
+ emit=True, auto=False, **kwargs):
+ """
+ Set the radial axis view limits.
+
+ This function behaves like `.Axes.set_ylim`, but additionally supports
+ *rmin* and *rmax* as aliases for *bottom* and *top*.
+
+ See Also
+ --------
+ .Axes.set_ylim
+ """
+ if 'rmin' in kwargs:
+ if bottom is None:
+ bottom = kwargs.pop('rmin')
+ else:
+ raise ValueError('Cannot supply both positional "bottom"'
+ 'argument and kwarg "rmin"')
+ if 'rmax' in kwargs:
+ if top is None:
+ top = kwargs.pop('rmax')
+ else:
+ raise ValueError('Cannot supply both positional "top"'
+ 'argument and kwarg "rmax"')
+ return self.set_ylim(bottom=bottom, top=top, emit=emit, auto=auto,
+ **kwargs)
+
+ def get_rlabel_position(self):
+ """
+ Returns
+ -------
+ float
+ The theta position of the radius labels in degrees.
+ """
+ return np.rad2deg(self._r_label_position.get_matrix()[0, 2])
+
+ def set_rlabel_position(self, value):
+ """
+ Update the theta position of the radius labels.
+
+ Parameters
+ ----------
+ value : number
+ The angular position of the radius labels in degrees.
+ """
+ self._r_label_position.clear().translate(np.deg2rad(value), 0.0)
+
+ def set_yscale(self, *args, **kwargs):
+ super().set_yscale(*args, **kwargs)
+ self.yaxis.set_major_locator(
+ self.RadialLocator(self.yaxis.get_major_locator(), self))
+
+ def set_rscale(self, *args, **kwargs):
+ return Axes.set_yscale(self, *args, **kwargs)
+
+ def set_rticks(self, *args, **kwargs):
+ return Axes.set_yticks(self, *args, **kwargs)
+
+ def set_thetagrids(self, angles, labels=None, fmt=None, **kwargs):
+ """
+ Set the theta gridlines in a polar plot.
+
+ Parameters
+ ----------
+ angles : tuple with floats, degrees
+ The angles of the theta gridlines.
+
+ labels : tuple with strings or None
+ The labels to use at each theta gridline. The
+ `.projections.polar.ThetaFormatter` will be used if None.
+
+ fmt : str or None
+ Format string used in `matplotlib.ticker.FormatStrFormatter`.
+ For example '%f'. Note that the angle that is used is in
+ radians.
+
+ Returns
+ -------
+ lines : list of `.lines.Line2D`
+ The theta gridlines.
+
+ labels : list of `.text.Text`
+ The tick labels.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ *kwargs* are optional `.Text` properties for the labels.
+
+ .. warning::
+
+ This only sets the properties of the current ticks.
+ Ticks are not guaranteed to be persistent. Various operations
+ can create, delete and modify the Tick instances. There is an
+ imminent risk that these settings can get lost if you work on
+ the figure further (including also panning/zooming on a
+ displayed figure).
+
+ Use `.set_tick_params` instead if possible.
+
+ See Also
+ --------
+ .PolarAxes.set_rgrids
+ .Axis.get_gridlines
+ .Axis.get_ticklabels
+ """
+
+ # Make sure we take into account unitized data
+ angles = self.convert_yunits(angles)
+ angles = np.deg2rad(angles)
+ self.set_xticks(angles)
+ if labels is not None:
+ self.set_xticklabels(labels)
+ elif fmt is not None:
+ self.xaxis.set_major_formatter(mticker.FormatStrFormatter(fmt))
+ for t in self.xaxis.get_ticklabels():
+ t._internal_update(kwargs)
+ return self.xaxis.get_ticklines(), self.xaxis.get_ticklabels()
+
+ def set_rgrids(self, radii, labels=None, angle=None, fmt=None, **kwargs):
+ """
+ Set the radial gridlines on a polar plot.
+
+ Parameters
+ ----------
+ radii : tuple with floats
+ The radii for the radial gridlines
+
+ labels : tuple with strings or None
+ The labels to use at each radial gridline. The
+ `matplotlib.ticker.ScalarFormatter` will be used if None.
+
+ angle : float
+ The angular position of the radius labels in degrees.
+
+ fmt : str or None
+ Format string used in `matplotlib.ticker.FormatStrFormatter`.
+ For example '%f'.
+
+ Returns
+ -------
+ lines : list of `.lines.Line2D`
+ The radial gridlines.
+
+ labels : list of `.text.Text`
+ The tick labels.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ *kwargs* are optional `.Text` properties for the labels.
+
+ .. warning::
+
+ This only sets the properties of the current ticks.
+ Ticks are not guaranteed to be persistent. Various operations
+ can create, delete and modify the Tick instances. There is an
+ imminent risk that these settings can get lost if you work on
+ the figure further (including also panning/zooming on a
+ displayed figure).
+
+ Use `.set_tick_params` instead if possible.
+
+ See Also
+ --------
+ .PolarAxes.set_thetagrids
+ .Axis.get_gridlines
+ .Axis.get_ticklabels
+ """
+ # Make sure we take into account unitized data
+ radii = self.convert_xunits(radii)
+ radii = np.asarray(radii)
+
+ self.set_yticks(radii)
+ if labels is not None:
+ self.set_yticklabels(labels)
+ elif fmt is not None:
+ self.yaxis.set_major_formatter(mticker.FormatStrFormatter(fmt))
+ if angle is None:
+ angle = self.get_rlabel_position()
+ self.set_rlabel_position(angle)
+ for t in self.yaxis.get_ticklabels():
+ t._internal_update(kwargs)
+ return self.yaxis.get_gridlines(), self.yaxis.get_ticklabels()
+
+ def format_coord(self, theta, r):
+ # docstring inherited
+ screen_xy = self.transData.transform((theta, r))
+ screen_xys = screen_xy + np.stack(
+ np.meshgrid([-1, 0, 1], [-1, 0, 1])).reshape((2, -1)).T
+ ts, rs = self.transData.inverted().transform(screen_xys).T
+ delta_t = abs((ts - theta + np.pi) % (2 * np.pi) - np.pi).max()
+ delta_t_halfturns = delta_t / np.pi
+ delta_t_degrees = delta_t_halfturns * 180
+ delta_r = abs(rs - r).max()
+ if theta < 0:
+ theta += 2 * np.pi
+ theta_halfturns = theta / np.pi
+ theta_degrees = theta_halfturns * 180
+
+ # See ScalarFormatter.format_data_short. For r, use #g-formatting
+ # (as for linear axes), but for theta, use f-formatting as scientific
+ # notation doesn't make sense and the trailing dot is ugly.
+ def format_sig(value, delta, opt, fmt):
+ # For "f", only count digits after decimal point.
+ prec = (max(0, -math.floor(math.log10(delta))) if fmt == "f" else
+ cbook._g_sig_digits(value, delta))
+ return f"{value:-{opt}.{prec}{fmt}}"
+
+ # In case fmt_xdata was not specified, resort to default
+
+ if self.fmt_ydata is None:
+ r_label = format_sig(r, delta_r, "#", "g")
+ else:
+ r_label = self.format_ydata(r)
+
+ if self.fmt_xdata is None:
+ return ('\N{GREEK SMALL LETTER THETA}={}\N{GREEK SMALL LETTER PI} '
+ '({}\N{DEGREE SIGN}), r={}').format(
+ format_sig(theta_halfturns, delta_t_halfturns, "", "f"),
+ format_sig(theta_degrees, delta_t_degrees, "", "f"),
+ r_label
+ )
+ else:
+ return '\N{GREEK SMALL LETTER THETA}={}, r={}'.format(
+ self.format_xdata(theta),
+ r_label
+ )
+
+ def get_data_ratio(self):
+ """
+ Return the aspect ratio of the data itself. For a polar plot,
+ this should always be 1.0
+ """
+ return 1.0
+
+ # # # Interactive panning
+
+ def can_zoom(self):
+ """
+ Return whether this Axes supports the zoom box button functionality.
+
+ A polar Axes does not support zoom boxes.
+ """
+ return False
+
+ def can_pan(self):
+ """
+ Return whether this Axes supports the pan/zoom button functionality.
+
+ For a polar Axes, this is slightly misleading. Both panning and
+ zooming are performed by the same button. Panning is performed
+ in azimuth while zooming is done along the radial.
+ """
+ return True
+
+ def start_pan(self, x, y, button):
+ angle = np.deg2rad(self.get_rlabel_position())
+ mode = ''
+ if button == 1:
+ epsilon = np.pi / 45.0
+ t, r = self.transData.inverted().transform((x, y))
+ if angle - epsilon <= t <= angle + epsilon:
+ mode = 'drag_r_labels'
+ elif button == 3:
+ mode = 'zoom'
+
+ self._pan_start = types.SimpleNamespace(
+ rmax=self.get_rmax(),
+ trans=self.transData.frozen(),
+ trans_inverse=self.transData.inverted().frozen(),
+ r_label_angle=self.get_rlabel_position(),
+ x=x,
+ y=y,
+ mode=mode)
+
+ def end_pan(self):
+ del self._pan_start
+
+ def drag_pan(self, button, key, x, y):
+ p = self._pan_start
+
+ if p.mode == 'drag_r_labels':
+ (startt, startr), (t, r) = p.trans_inverse.transform(
+ [(p.x, p.y), (x, y)])
+
+ # Deal with theta
+ dt = np.rad2deg(startt - t)
+ self.set_rlabel_position(p.r_label_angle - dt)
+
+ trans, vert1, horiz1 = self.get_yaxis_text1_transform(0.0)
+ trans, vert2, horiz2 = self.get_yaxis_text2_transform(0.0)
+ for t in self.yaxis.majorTicks + self.yaxis.minorTicks:
+ t.label1.set_va(vert1)
+ t.label1.set_ha(horiz1)
+ t.label2.set_va(vert2)
+ t.label2.set_ha(horiz2)
+
+ elif p.mode == 'zoom':
+ (startt, startr), (t, r) = p.trans_inverse.transform(
+ [(p.x, p.y), (x, y)])
+
+ # Deal with r
+ scale = r / startr
+ self.set_rmax(p.rmax / scale)
+
+
+# To keep things all self-contained, we can put aliases to the Polar classes
+# defined above. This isn't strictly necessary, but it makes some of the
+# code more readable, and provides a backwards compatible Polar API. In
+# particular, this is used by the :doc:`/gallery/specialty_plots/radar_chart`
+# example to override PolarTransform on a PolarAxes subclass, so make sure that
+# that example is unaffected before changing this.
+PolarAxes.PolarTransform = PolarTransform
+PolarAxes.PolarAffine = PolarAffine
+PolarAxes.InvertedPolarTransform = InvertedPolarTransform
+PolarAxes.ThetaFormatter = ThetaFormatter
+PolarAxes.RadialLocator = RadialLocator
+PolarAxes.ThetaLocator = ThetaLocator
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/polar.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/polar.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..de1cbc293900382e25e6ebfb6e94a3409ad16462
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/projections/polar.pyi
@@ -0,0 +1,197 @@
+import matplotlib.axis as maxis
+import matplotlib.ticker as mticker
+import matplotlib.transforms as mtransforms
+from matplotlib.axes import Axes
+from matplotlib.lines import Line2D
+from matplotlib.text import Text
+
+import numpy as np
+from numpy.typing import ArrayLike
+from collections.abc import Sequence
+from typing import Any, ClassVar, Literal, overload
+
+class PolarTransform(mtransforms.Transform):
+ input_dims: int
+ output_dims: int
+ def __init__(
+ self,
+ axis: PolarAxes | None = ...,
+ use_rmin: bool = ...,
+ *,
+ apply_theta_transforms: bool = ...,
+ scale_transform: mtransforms.Transform | None = ...,
+ ) -> None: ...
+ def inverted(self) -> InvertedPolarTransform: ...
+
+class PolarAffine(mtransforms.Affine2DBase):
+ def __init__(
+ self, scale_transform: mtransforms.Transform, limits: mtransforms.BboxBase
+ ) -> None: ...
+
+class InvertedPolarTransform(mtransforms.Transform):
+ input_dims: int
+ output_dims: int
+ def __init__(
+ self,
+ axis: PolarAxes | None = ...,
+ use_rmin: bool = ...,
+ *,
+ apply_theta_transforms: bool = ...,
+ ) -> None: ...
+ def inverted(self) -> PolarTransform: ...
+
+class ThetaFormatter(mticker.Formatter): ...
+
+class _AxisWrapper:
+ def __init__(self, axis: maxis.Axis) -> None: ...
+ def get_view_interval(self) -> np.ndarray: ...
+ def set_view_interval(self, vmin: float, vmax: float) -> None: ...
+ def get_minpos(self) -> float: ...
+ def get_data_interval(self) -> np.ndarray: ...
+ def set_data_interval(self, vmin: float, vmax: float) -> None: ...
+ def get_tick_space(self) -> int: ...
+
+class ThetaLocator(mticker.Locator):
+ base: mticker.Locator
+ axis: _AxisWrapper | None
+ def __init__(self, base: mticker.Locator) -> None: ...
+
+class ThetaTick(maxis.XTick):
+ def __init__(self, axes: PolarAxes, *args, **kwargs) -> None: ...
+
+class ThetaAxis(maxis.XAxis):
+ axis_name: str
+
+class RadialLocator(mticker.Locator):
+ base: mticker.Locator
+ def __init__(self, base, axes: PolarAxes | None = ...) -> None: ...
+
+class RadialTick(maxis.YTick): ...
+
+class RadialAxis(maxis.YAxis):
+ axis_name: str
+
+class _WedgeBbox(mtransforms.Bbox):
+ def __init__(
+ self,
+ center: tuple[float, float],
+ viewLim: mtransforms.Bbox,
+ originLim: mtransforms.Bbox,
+ **kwargs,
+ ) -> None: ...
+
+class PolarAxes(Axes):
+
+ PolarTransform: ClassVar[type] = PolarTransform
+ PolarAffine: ClassVar[type] = PolarAffine
+ InvertedPolarTransform: ClassVar[type] = InvertedPolarTransform
+ ThetaFormatter: ClassVar[type] = ThetaFormatter
+ RadialLocator: ClassVar[type] = RadialLocator
+ ThetaLocator: ClassVar[type] = ThetaLocator
+
+ name: str
+ use_sticky_edges: bool
+ def __init__(
+ self,
+ *args,
+ theta_offset: float = ...,
+ theta_direction: float = ...,
+ rlabel_position: float = ...,
+ **kwargs,
+ ) -> None: ...
+ def get_xaxis_transform(
+ self, which: Literal["tick1", "tick2", "grid"] = ...
+ ) -> mtransforms.Transform: ...
+ def get_xaxis_text1_transform(
+ self, pad: float
+ ) -> tuple[
+ mtransforms.Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_xaxis_text2_transform(
+ self, pad: float
+ ) -> tuple[
+ mtransforms.Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_yaxis_transform(
+ self, which: Literal["tick1", "tick2", "grid"] = ...
+ ) -> mtransforms.Transform: ...
+ def get_yaxis_text1_transform(
+ self, pad: float
+ ) -> tuple[
+ mtransforms.Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def get_yaxis_text2_transform(
+ self, pad: float
+ ) -> tuple[
+ mtransforms.Transform,
+ Literal["center", "top", "bottom", "baseline", "center_baseline"],
+ Literal["center", "left", "right"],
+ ]: ...
+ def set_thetamax(self, thetamax: float) -> None: ...
+ def get_thetamax(self) -> float: ...
+ def set_thetamin(self, thetamin: float) -> None: ...
+ def get_thetamin(self) -> float: ...
+ @overload
+ def set_thetalim(self, minval: float, maxval: float, /) -> tuple[float, float]: ...
+ @overload
+ def set_thetalim(self, *, thetamin: float, thetamax: float) -> tuple[float, float]: ...
+ def set_theta_offset(self, offset: float) -> None: ...
+ def get_theta_offset(self) -> float: ...
+ def set_theta_zero_location(
+ self,
+ loc: Literal["N", "NW", "W", "SW", "S", "SE", "E", "NE"],
+ offset: float = ...,
+ ) -> None: ...
+ def set_theta_direction(
+ self,
+ direction: Literal[-1, 1, "clockwise", "counterclockwise", "anticlockwise"],
+ ) -> None: ...
+ def get_theta_direction(self) -> Literal[-1, 1]: ...
+ def set_rmax(self, rmax: float) -> None: ...
+ def get_rmax(self) -> float: ...
+ def set_rmin(self, rmin: float) -> None: ...
+ def get_rmin(self) -> float: ...
+ def set_rorigin(self, rorigin: float | None) -> None: ...
+ def get_rorigin(self) -> float: ...
+ def get_rsign(self) -> float: ...
+ def set_rlim(
+ self,
+ bottom: float | tuple[float, float] | None = ...,
+ top: float | None = ...,
+ *,
+ emit: bool = ...,
+ auto: bool = ...,
+ **kwargs,
+ ) -> tuple[float, float]: ...
+ def get_rlabel_position(self) -> float: ...
+ def set_rlabel_position(self, value: float) -> None: ...
+ def set_rscale(self, *args, **kwargs) -> None: ...
+ def set_rticks(self, *args, **kwargs) -> None: ...
+ def set_thetagrids(
+ self,
+ angles: ArrayLike,
+ labels: Sequence[str | Text] | None = ...,
+ fmt: str | None = ...,
+ **kwargs,
+ ) -> tuple[list[Line2D], list[Text]]: ...
+ def set_rgrids(
+ self,
+ radii: ArrayLike,
+ labels: Sequence[str | Text] | None = ...,
+ angle: float | None = ...,
+ fmt: str | None = ...,
+ **kwargs,
+ ) -> tuple[list[Line2D], list[Text]]: ...
+ def format_coord(self, theta: float, r: float) -> str: ...
+ def get_data_ratio(self) -> float: ...
+ def can_zoom(self) -> bool: ...
+ def can_pan(self) -> bool: ...
+ def start_pan(self, x: float, y: float, button: int) -> None: ...
+ def end_pan(self) -> None: ...
+ def drag_pan(self, button: Any, key: Any, x: float, y: float) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/py.typed b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/py.typed
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/pylab.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/pylab.py
new file mode 100644
index 0000000000000000000000000000000000000000..a50779cf6d264408f1f99a086a25cb5c9d525588
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/pylab.py
@@ -0,0 +1,67 @@
+"""
+`pylab` is a historic interface and its use is strongly discouraged. The equivalent
+replacement is `matplotlib.pyplot`. See :ref:`api_interfaces` for a full overview
+of Matplotlib interfaces.
+
+`pylab` was designed to support a MATLAB-like way of working with all plotting related
+functions directly available in the global namespace. This was achieved through a
+wildcard import (``from pylab import *``).
+
+.. warning::
+ The use of `pylab` is discouraged for the following reasons:
+
+ ``from pylab import *`` imports all the functions from `matplotlib.pyplot`, `numpy`,
+ `numpy.fft`, `numpy.linalg`, and `numpy.random`, and some additional functions into
+ the global namespace.
+
+ Such a pattern is considered bad practice in modern python, as it clutters the global
+ namespace. Even more severely, in the case of `pylab`, this will overwrite some
+ builtin functions (e.g. the builtin `sum` will be replaced by `numpy.sum`), which
+ can lead to unexpected behavior.
+
+"""
+
+from matplotlib.cbook import flatten, silent_list
+
+import matplotlib as mpl
+
+from matplotlib.dates import (
+ date2num, num2date, datestr2num, drange, DateFormatter, DateLocator,
+ RRuleLocator, YearLocator, MonthLocator, WeekdayLocator, DayLocator,
+ HourLocator, MinuteLocator, SecondLocator, rrule, MO, TU, WE, TH, FR,
+ SA, SU, YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY,
+ relativedelta)
+
+# bring all the symbols in so folks can import them from
+# pylab in one fell swoop
+
+## We are still importing too many things from mlab; more cleanup is needed.
+
+from matplotlib.mlab import (
+ detrend, detrend_linear, detrend_mean, detrend_none, window_hanning,
+ window_none)
+
+from matplotlib import cbook, mlab, pyplot as plt
+from matplotlib.pyplot import *
+
+from numpy import *
+from numpy.fft import *
+from numpy.random import *
+from numpy.linalg import *
+
+import numpy as np
+import numpy.ma as ma
+
+# don't let numpy's datetime hide stdlib
+import datetime
+
+# This is needed, or bytes will be numpy.random.bytes from
+# "from numpy.random import *" above
+bytes = __import__("builtins").bytes
+# We also don't want the numpy version of these functions
+abs = __import__("builtins").abs
+bool = __import__("builtins").bool
+max = __import__("builtins").max
+min = __import__("builtins").min
+pow = __import__("builtins").pow
+round = __import__("builtins").round
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/pyplot.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/pyplot.py
new file mode 100644
index 0000000000000000000000000000000000000000..2dd8e76d98b4842a16b101cf1dee2cbce702a5e2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/pyplot.py
@@ -0,0 +1,4645 @@
+# Note: The first part of this file can be modified in place, but the latter
+# part is autogenerated by the boilerplate.py script.
+
+"""
+`matplotlib.pyplot` is a state-based interface to matplotlib. It provides
+an implicit, MATLAB-like, way of plotting. It also opens figures on your
+screen, and acts as the figure GUI manager.
+
+pyplot is mainly intended for interactive plots and simple cases of
+programmatic plot generation::
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ x = np.arange(0, 5, 0.1)
+ y = np.sin(x)
+ plt.plot(x, y)
+ plt.show()
+
+The explicit object-oriented API is recommended for complex plots, though
+pyplot is still usually used to create the figure and often the Axes in the
+figure. See `.pyplot.figure`, `.pyplot.subplots`, and
+`.pyplot.subplot_mosaic` to create figures, and
+:doc:`Axes API ` for the plotting methods on an Axes::
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ x = np.arange(0, 5, 0.1)
+ y = np.sin(x)
+ fig, ax = plt.subplots()
+ ax.plot(x, y)
+ plt.show()
+
+
+See :ref:`api_interfaces` for an explanation of the tradeoffs between the
+implicit and explicit interfaces.
+"""
+
+# fmt: off
+
+from __future__ import annotations
+
+from contextlib import AbstractContextManager, ExitStack
+from enum import Enum
+import functools
+import importlib
+import inspect
+import logging
+import sys
+import threading
+import time
+from typing import TYPE_CHECKING, cast, overload
+
+from cycler import cycler # noqa: F401
+import matplotlib
+import matplotlib.colorbar
+import matplotlib.image
+from matplotlib import _api
+# Re-exported (import x as x) for typing.
+from matplotlib import get_backend as get_backend, rcParams as rcParams
+from matplotlib import cm as cm # noqa: F401
+from matplotlib import style as style # noqa: F401
+from matplotlib import _pylab_helpers
+from matplotlib import interactive # noqa: F401
+from matplotlib import cbook
+from matplotlib import _docstring
+from matplotlib.backend_bases import (
+ FigureCanvasBase, FigureManagerBase, MouseButton)
+from matplotlib.figure import Figure, FigureBase, figaspect
+from matplotlib.gridspec import GridSpec, SubplotSpec
+from matplotlib import rcsetup, rcParamsDefault, rcParamsOrig
+from matplotlib.artist import Artist
+from matplotlib.axes import Axes
+from matplotlib.axes import Subplot # noqa: F401
+from matplotlib.backends import BackendFilter, backend_registry
+from matplotlib.projections import PolarAxes
+from matplotlib.colorizer import _ColorizerInterface, ColorizingArtist, Colorizer
+from matplotlib import mlab # for detrend_none, window_hanning
+from matplotlib.scale import get_scale_names # noqa: F401
+
+from matplotlib.cm import _colormaps
+from matplotlib.colors import _color_sequences, Colormap
+
+import numpy as np
+
+if TYPE_CHECKING:
+ from collections.abc import Callable, Hashable, Iterable, Sequence
+ import datetime
+ import pathlib
+ import os
+ from typing import Any, BinaryIO, Literal, TypeVar
+ from typing_extensions import ParamSpec
+
+ import PIL.Image
+ from numpy.typing import ArrayLike
+
+ import matplotlib.axes
+ import matplotlib.artist
+ import matplotlib.backend_bases
+ from matplotlib.axis import Tick
+ from matplotlib.axes._base import _AxesBase
+ from matplotlib.backend_bases import Event
+ from matplotlib.cm import ScalarMappable
+ from matplotlib.contour import ContourSet, QuadContourSet
+ from matplotlib.collections import (
+ Collection,
+ FillBetweenPolyCollection,
+ LineCollection,
+ PolyCollection,
+ PathCollection,
+ EventCollection,
+ QuadMesh,
+ )
+ from matplotlib.colorbar import Colorbar
+ from matplotlib.container import (
+ BarContainer,
+ ErrorbarContainer,
+ StemContainer,
+ )
+ from matplotlib.figure import SubFigure
+ from matplotlib.legend import Legend
+ from matplotlib.mlab import GaussianKDE
+ from matplotlib.image import AxesImage, FigureImage
+ from matplotlib.patches import FancyArrow, StepPatch, Wedge
+ from matplotlib.quiver import Barbs, Quiver, QuiverKey
+ from matplotlib.scale import ScaleBase
+ from matplotlib.typing import (
+ ColorType,
+ CoordsType,
+ HashableList,
+ LineStyleType,
+ MarkerType,
+ )
+ from matplotlib.widgets import SubplotTool
+
+ _P = ParamSpec('_P')
+ _R = TypeVar('_R')
+ _T = TypeVar('_T')
+
+
+# We may not need the following imports here:
+from matplotlib.colors import Normalize
+from matplotlib.lines import Line2D, AxLine
+from matplotlib.text import Text, Annotation
+from matplotlib.patches import Arrow, Circle, Rectangle # noqa: F401
+from matplotlib.patches import Polygon
+from matplotlib.widgets import Button, Slider, Widget # noqa: F401
+
+from .ticker import ( # noqa: F401
+ TickHelper, Formatter, FixedFormatter, NullFormatter, FuncFormatter,
+ FormatStrFormatter, ScalarFormatter, LogFormatter, LogFormatterExponent,
+ LogFormatterMathtext, Locator, IndexLocator, FixedLocator, NullLocator,
+ LinearLocator, LogLocator, AutoLocator, MultipleLocator, MaxNLocator)
+
+_log = logging.getLogger(__name__)
+
+
+# Explicit rename instead of import-as for typing's sake.
+colormaps = _colormaps
+color_sequences = _color_sequences
+
+
+@overload
+def _copy_docstring_and_deprecators(
+ method: Any,
+ func: Literal[None] = None
+) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
+
+
+@overload
+def _copy_docstring_and_deprecators(
+ method: Any, func: Callable[_P, _R]) -> Callable[_P, _R]: ...
+
+
+def _copy_docstring_and_deprecators(
+ method: Any,
+ func: Callable[_P, _R] | None = None
+) -> Callable[[Callable[_P, _R]], Callable[_P, _R]] | Callable[_P, _R]:
+ if func is None:
+ return cast('Callable[[Callable[_P, _R]], Callable[_P, _R]]',
+ functools.partial(_copy_docstring_and_deprecators, method))
+ decorators: list[Callable[[Callable[_P, _R]], Callable[_P, _R]]] = [
+ _docstring.copy(method)
+ ]
+ # Check whether the definition of *method* includes @_api.rename_parameter
+ # or @_api.make_keyword_only decorators; if so, propagate them to the
+ # pyplot wrapper as well.
+ while hasattr(method, "__wrapped__"):
+ potential_decorator = _api.deprecation.DECORATORS.get(method)
+ if potential_decorator:
+ decorators.append(potential_decorator)
+ method = method.__wrapped__
+ for decorator in decorators[::-1]:
+ func = decorator(func)
+ _add_pyplot_note(func, method)
+ return func
+
+
+_NO_PYPLOT_NOTE = [
+ 'FigureBase._gci', # wrapped_func is private
+ '_AxesBase._sci', # wrapped_func is private
+ 'Artist.findobj', # not a standard pyplot wrapper because it does not operate
+ # on the current Figure / Axes. Explanation of relation would
+ # be more complex and is not too important.
+]
+
+
+def _add_pyplot_note(func, wrapped_func):
+ """
+ Add a note to the docstring of *func* that it is a pyplot wrapper.
+
+ The note is added to the "Notes" section of the docstring. If that does
+ not exist, a "Notes" section is created. In numpydoc, the "Notes"
+ section is the third last possible section, only potentially followed by
+ "References" and "Examples".
+ """
+ if not func.__doc__:
+ return # nothing to do
+
+ qualname = wrapped_func.__qualname__
+ if qualname in _NO_PYPLOT_NOTE:
+ return
+
+ wrapped_func_is_method = True
+ if "." not in qualname:
+ # method qualnames are prefixed by the class and ".", e.g. "Axes.plot"
+ wrapped_func_is_method = False
+ link = f"{wrapped_func.__module__}.{qualname}"
+ elif qualname.startswith("Axes."): # e.g. "Axes.plot"
+ link = ".axes." + qualname
+ elif qualname.startswith("_AxesBase."): # e.g. "_AxesBase.set_xlabel"
+ link = ".axes.Axes" + qualname[9:]
+ elif qualname.startswith("Figure."): # e.g. "Figure.figimage"
+ link = "." + qualname
+ elif qualname.startswith("FigureBase."): # e.g. "FigureBase.gca"
+ link = ".Figure" + qualname[10:]
+ elif qualname.startswith("FigureCanvasBase."): # "FigureBaseCanvas.mpl_connect"
+ link = "." + qualname
+ else:
+ raise RuntimeError(f"Wrapped method from unexpected class: {qualname}")
+
+ if wrapped_func_is_method:
+ message = f"This is the :ref:`pyplot wrapper ` for `{link}`."
+ else:
+ message = f"This is equivalent to `{link}`."
+
+ # Find the correct insert position:
+ # - either we already have a "Notes" section into which we can insert
+ # - or we create one before the next present section. Note that in numpydoc, the
+ # "Notes" section is the third last possible section, only potentially followed
+ # by "References" and "Examples".
+ # - or we append a new "Notes" section at the end.
+ doc = inspect.cleandoc(func.__doc__)
+ if "\nNotes\n-----" in doc:
+ before, after = doc.split("\nNotes\n-----", 1)
+ elif (index := doc.find("\nReferences\n----------")) != -1:
+ before, after = doc[:index], doc[index:]
+ elif (index := doc.find("\nExamples\n--------")) != -1:
+ before, after = doc[:index], doc[index:]
+ else:
+ # No "Notes", "References", or "Examples" --> append to the end.
+ before = doc + "\n"
+ after = ""
+
+ func.__doc__ = f"{before}\nNotes\n-----\n\n.. note::\n\n {message}\n{after}"
+
+
+## Global ##
+
+
+# The state controlled by {,un}install_repl_displayhook().
+_ReplDisplayHook = Enum("_ReplDisplayHook", ["NONE", "PLAIN", "IPYTHON"])
+_REPL_DISPLAYHOOK = _ReplDisplayHook.NONE
+
+
+def _draw_all_if_interactive() -> None:
+ if matplotlib.is_interactive():
+ draw_all()
+
+
+def install_repl_displayhook() -> None:
+ """
+ Connect to the display hook of the current shell.
+
+ The display hook gets called when the read-evaluate-print-loop (REPL) of
+ the shell has finished the execution of a command. We use this callback
+ to be able to automatically update a figure in interactive mode.
+
+ This works both with IPython and with vanilla python shells.
+ """
+ global _REPL_DISPLAYHOOK
+
+ if _REPL_DISPLAYHOOK is _ReplDisplayHook.IPYTHON:
+ return
+
+ # See if we have IPython hooks around, if so use them.
+ # Use ``sys.modules.get(name)`` rather than ``name in sys.modules`` as
+ # entries can also have been explicitly set to None.
+ mod_ipython = sys.modules.get("IPython")
+ if not mod_ipython:
+ _REPL_DISPLAYHOOK = _ReplDisplayHook.PLAIN
+ return
+ ip = mod_ipython.get_ipython()
+ if not ip:
+ _REPL_DISPLAYHOOK = _ReplDisplayHook.PLAIN
+ return
+
+ ip.events.register("post_execute", _draw_all_if_interactive)
+ _REPL_DISPLAYHOOK = _ReplDisplayHook.IPYTHON
+
+ if mod_ipython.version_info[:2] < (8, 24):
+ # Use of backend2gui is not needed for IPython >= 8.24 as that functionality
+ # has been moved to Matplotlib.
+ # This code can be removed when Python 3.12, the latest version supported by
+ # IPython < 8.24, reaches end-of-life in late 2028.
+ from IPython.core.pylabtools import backend2gui
+ ipython_gui_name = backend2gui.get(get_backend())
+ else:
+ _, ipython_gui_name = backend_registry.resolve_backend(get_backend())
+ # trigger IPython's eventloop integration, if available
+ if ipython_gui_name:
+ ip.enable_gui(ipython_gui_name)
+
+
+def uninstall_repl_displayhook() -> None:
+ """Disconnect from the display hook of the current shell."""
+ global _REPL_DISPLAYHOOK
+ if _REPL_DISPLAYHOOK is _ReplDisplayHook.IPYTHON:
+ from IPython import get_ipython
+ ip = get_ipython()
+ ip.events.unregister("post_execute", _draw_all_if_interactive)
+ _REPL_DISPLAYHOOK = _ReplDisplayHook.NONE
+
+
+draw_all = _pylab_helpers.Gcf.draw_all
+
+
+# Ensure this appears in the pyplot docs.
+@_copy_docstring_and_deprecators(matplotlib.set_loglevel)
+def set_loglevel(*args, **kwargs) -> None:
+ return matplotlib.set_loglevel(*args, **kwargs)
+
+
+@_copy_docstring_and_deprecators(Artist.findobj)
+def findobj(
+ o: Artist | None = None,
+ match: Callable[[Artist], bool] | type[Artist] | None = None,
+ include_self: bool = True
+) -> list[Artist]:
+ if o is None:
+ o = gcf()
+ return o.findobj(match, include_self=include_self)
+
+
+_backend_mod: type[matplotlib.backend_bases._Backend] | None = None
+
+
+def _get_backend_mod() -> type[matplotlib.backend_bases._Backend]:
+ """
+ Ensure that a backend is selected and return it.
+
+ This is currently private, but may be made public in the future.
+ """
+ if _backend_mod is None:
+ # Use rcParams._get("backend") to avoid going through the fallback
+ # logic (which will (re)import pyplot and then call switch_backend if
+ # we need to resolve the auto sentinel)
+ switch_backend(rcParams._get("backend"))
+ return cast(type[matplotlib.backend_bases._Backend], _backend_mod)
+
+
+def switch_backend(newbackend: str) -> None:
+ """
+ Set the pyplot backend.
+
+ Switching to an interactive backend is possible only if no event loop for
+ another interactive backend has started. Switching to and from
+ non-interactive backends is always possible.
+
+ If the new backend is different than the current backend then all open
+ Figures will be closed via ``plt.close('all')``.
+
+ Parameters
+ ----------
+ newbackend : str
+ The case-insensitive name of the backend to use.
+
+ """
+ global _backend_mod
+ # make sure the init is pulled up so we can assign to it later
+ import matplotlib.backends
+
+ if newbackend is rcsetup._auto_backend_sentinel:
+ current_framework = cbook._get_running_interactive_framework()
+
+ if (current_framework and
+ (backend := backend_registry.backend_for_gui_framework(
+ current_framework))):
+ candidates = [backend]
+ else:
+ candidates = []
+ candidates += [
+ "macosx", "qtagg", "gtk4agg", "gtk3agg", "tkagg", "wxagg"]
+
+ # Don't try to fallback on the cairo-based backends as they each have
+ # an additional dependency (pycairo) over the agg-based backend, and
+ # are of worse quality.
+ for candidate in candidates:
+ try:
+ switch_backend(candidate)
+ except ImportError:
+ continue
+ else:
+ rcParamsOrig['backend'] = candidate
+ return
+ else:
+ # Switching to Agg should always succeed; if it doesn't, let the
+ # exception propagate out.
+ switch_backend("agg")
+ rcParamsOrig["backend"] = "agg"
+ return
+ old_backend = rcParams._get('backend') # get without triggering backend resolution
+
+ module = backend_registry.load_backend_module(newbackend)
+ canvas_class = module.FigureCanvas
+
+ required_framework = canvas_class.required_interactive_framework
+ if required_framework is not None:
+ current_framework = cbook._get_running_interactive_framework()
+ if (current_framework and required_framework
+ and current_framework != required_framework):
+ raise ImportError(
+ "Cannot load backend {!r} which requires the {!r} interactive "
+ "framework, as {!r} is currently running".format(
+ newbackend, required_framework, current_framework))
+
+ # Load the new_figure_manager() and show() functions from the backend.
+
+ # Classically, backends can directly export these functions. This should
+ # keep working for backcompat.
+ new_figure_manager = getattr(module, "new_figure_manager", None)
+ show = getattr(module, "show", None)
+
+ # In that classical approach, backends are implemented as modules, but
+ # "inherit" default method implementations from backend_bases._Backend.
+ # This is achieved by creating a "class" that inherits from
+ # backend_bases._Backend and whose body is filled with the module globals.
+ class backend_mod(matplotlib.backend_bases._Backend):
+ locals().update(vars(module))
+
+ # However, the newer approach for defining new_figure_manager and
+ # show is to derive them from canvas methods. In that case, also
+ # update backend_mod accordingly; also, per-backend customization of
+ # draw_if_interactive is disabled.
+ if new_figure_manager is None:
+
+ def new_figure_manager_given_figure(num, figure):
+ return canvas_class.new_manager(figure, num)
+
+ def new_figure_manager(num, *args, FigureClass=Figure, **kwargs):
+ fig = FigureClass(*args, **kwargs)
+ return new_figure_manager_given_figure(num, fig)
+
+ def draw_if_interactive() -> None:
+ if matplotlib.is_interactive():
+ manager = _pylab_helpers.Gcf.get_active()
+ if manager:
+ manager.canvas.draw_idle()
+
+ backend_mod.new_figure_manager_given_figure = ( # type: ignore[method-assign]
+ new_figure_manager_given_figure)
+ backend_mod.new_figure_manager = ( # type: ignore[method-assign]
+ new_figure_manager)
+ backend_mod.draw_if_interactive = ( # type: ignore[method-assign]
+ draw_if_interactive)
+
+ # If the manager explicitly overrides pyplot_show, use it even if a global
+ # show is already present, as the latter may be here for backcompat.
+ manager_class = getattr(canvas_class, "manager_class", None)
+ # We can't compare directly manager_class.pyplot_show and FMB.pyplot_show because
+ # pyplot_show is a classmethod so the above constructs are bound classmethods, and
+ # thus always different (being bound to different classes). We also have to use
+ # getattr_static instead of vars as manager_class could have no __dict__.
+ manager_pyplot_show = inspect.getattr_static(manager_class, "pyplot_show", None)
+ base_pyplot_show = inspect.getattr_static(FigureManagerBase, "pyplot_show", None)
+ if (show is None
+ or (manager_pyplot_show is not None
+ and manager_pyplot_show != base_pyplot_show)):
+ if not manager_pyplot_show:
+ raise ValueError(
+ f"Backend {newbackend} defines neither FigureCanvas.manager_class nor "
+ f"a toplevel show function")
+ _pyplot_show = cast('Any', manager_class).pyplot_show
+ backend_mod.show = _pyplot_show # type: ignore[method-assign]
+
+ _log.debug("Loaded backend %s version %s.",
+ newbackend, backend_mod.backend_version)
+
+ if newbackend in ("ipympl", "widget"):
+ # ipympl < 0.9.4 expects rcParams["backend"] to be the fully-qualified backend
+ # name "module://ipympl.backend_nbagg" not short names "ipympl" or "widget".
+ import importlib.metadata as im
+ from matplotlib import _parse_to_version_info # type: ignore[attr-defined]
+ try:
+ module_version = im.version("ipympl")
+ if _parse_to_version_info(module_version) < (0, 9, 4):
+ newbackend = "module://ipympl.backend_nbagg"
+ except im.PackageNotFoundError:
+ pass
+
+ rcParams['backend'] = rcParamsDefault['backend'] = newbackend
+ _backend_mod = backend_mod
+ for func_name in ["new_figure_manager", "draw_if_interactive", "show"]:
+ globals()[func_name].__signature__ = inspect.signature(
+ getattr(backend_mod, func_name))
+
+ # Need to keep a global reference to the backend for compatibility reasons.
+ # See https://github.com/matplotlib/matplotlib/issues/6092
+ matplotlib.backends.backend = newbackend # type: ignore[attr-defined]
+
+ # Make sure the repl display hook is installed in case we become interactive.
+ install_repl_displayhook()
+
+
+def _warn_if_gui_out_of_main_thread() -> None:
+ warn = False
+ canvas_class = cast(type[FigureCanvasBase], _get_backend_mod().FigureCanvas)
+ if canvas_class.required_interactive_framework:
+ if hasattr(threading, 'get_native_id'):
+ # This compares native thread ids because even if Python-level
+ # Thread objects match, the underlying OS thread (which is what
+ # really matters) may be different on Python implementations with
+ # green threads.
+ if threading.get_native_id() != threading.main_thread().native_id:
+ warn = True
+ else:
+ # Fall back to Python-level Thread if native IDs are unavailable,
+ # mainly for PyPy.
+ if threading.current_thread() is not threading.main_thread():
+ warn = True
+ if warn:
+ _api.warn_external(
+ "Starting a Matplotlib GUI outside of the main thread will likely "
+ "fail.")
+
+
+# This function's signature is rewritten upon backend-load by switch_backend.
+def new_figure_manager(*args, **kwargs):
+ """Create a new figure manager instance."""
+ _warn_if_gui_out_of_main_thread()
+ return _get_backend_mod().new_figure_manager(*args, **kwargs)
+
+
+# This function's signature is rewritten upon backend-load by switch_backend.
+def draw_if_interactive(*args, **kwargs):
+ """
+ Redraw the current figure if in interactive mode.
+
+ .. warning::
+
+ End users will typically not have to call this function because the
+ the interactive mode takes care of this.
+ """
+ return _get_backend_mod().draw_if_interactive(*args, **kwargs)
+
+
+# This function's signature is rewritten upon backend-load by switch_backend.
+def show(*args, **kwargs) -> None:
+ """
+ Display all open figures.
+
+ Parameters
+ ----------
+ block : bool, optional
+ Whether to wait for all figures to be closed before returning.
+
+ If `True` block and run the GUI main loop until all figure windows
+ are closed.
+
+ If `False` ensure that all figure windows are displayed and return
+ immediately. In this case, you are responsible for ensuring
+ that the event loop is running to have responsive figures.
+
+ Defaults to True in non-interactive mode and to False in interactive
+ mode (see `.pyplot.isinteractive`).
+
+ See Also
+ --------
+ ion : Enable interactive mode, which shows / updates the figure after
+ every plotting command, so that calling ``show()`` is not necessary.
+ ioff : Disable interactive mode.
+ savefig : Save the figure to an image file instead of showing it on screen.
+
+ Notes
+ -----
+ **Saving figures to file and showing a window at the same time**
+
+ If you want an image file as well as a user interface window, use
+ `.pyplot.savefig` before `.pyplot.show`. At the end of (a blocking)
+ ``show()`` the figure is closed and thus unregistered from pyplot. Calling
+ `.pyplot.savefig` afterwards would save a new and thus empty figure. This
+ limitation of command order does not apply if the show is non-blocking or
+ if you keep a reference to the figure and use `.Figure.savefig`.
+
+ **Auto-show in jupyter notebooks**
+
+ The jupyter backends (activated via ``%matplotlib inline``,
+ ``%matplotlib notebook``, or ``%matplotlib widget``), call ``show()`` at
+ the end of every cell by default. Thus, you usually don't have to call it
+ explicitly there.
+ """
+ _warn_if_gui_out_of_main_thread()
+ return _get_backend_mod().show(*args, **kwargs)
+
+
+def isinteractive() -> bool:
+ """
+ Return whether plots are updated after every plotting command.
+
+ The interactive mode is mainly useful if you build plots from the command
+ line and want to see the effect of each command while you are building the
+ figure.
+
+ In interactive mode:
+
+ - newly created figures will be shown immediately;
+ - figures will automatically redraw on change;
+ - `.pyplot.show` will not block by default.
+
+ In non-interactive mode:
+
+ - newly created figures and changes to figures will not be reflected until
+ explicitly asked to be;
+ - `.pyplot.show` will block by default.
+
+ See Also
+ --------
+ ion : Enable interactive mode.
+ ioff : Disable interactive mode.
+ show : Show all figures (and maybe block).
+ pause : Show all figures, and block for a time.
+ """
+ return matplotlib.is_interactive()
+
+
+# Note: The return type of ioff being AbstractContextManager
+# instead of ExitStack is deliberate.
+# See https://github.com/matplotlib/matplotlib/issues/27659
+# and https://github.com/matplotlib/matplotlib/pull/27667 for more info.
+def ioff() -> AbstractContextManager:
+ """
+ Disable interactive mode.
+
+ See `.pyplot.isinteractive` for more details.
+
+ See Also
+ --------
+ ion : Enable interactive mode.
+ isinteractive : Whether interactive mode is enabled.
+ show : Show all figures (and maybe block).
+ pause : Show all figures, and block for a time.
+
+ Notes
+ -----
+ For a temporary change, this can be used as a context manager::
+
+ # if interactive mode is on
+ # then figures will be shown on creation
+ plt.ion()
+ # This figure will be shown immediately
+ fig = plt.figure()
+
+ with plt.ioff():
+ # interactive mode will be off
+ # figures will not automatically be shown
+ fig2 = plt.figure()
+ # ...
+
+ To enable optional usage as a context manager, this function returns a
+ context manager object, which is not intended to be stored or
+ accessed by the user.
+ """
+ stack = ExitStack()
+ stack.callback(ion if isinteractive() else ioff)
+ matplotlib.interactive(False)
+ uninstall_repl_displayhook()
+ return stack
+
+
+# Note: The return type of ion being AbstractContextManager
+# instead of ExitStack is deliberate.
+# See https://github.com/matplotlib/matplotlib/issues/27659
+# and https://github.com/matplotlib/matplotlib/pull/27667 for more info.
+def ion() -> AbstractContextManager:
+ """
+ Enable interactive mode.
+
+ See `.pyplot.isinteractive` for more details.
+
+ See Also
+ --------
+ ioff : Disable interactive mode.
+ isinteractive : Whether interactive mode is enabled.
+ show : Show all figures (and maybe block).
+ pause : Show all figures, and block for a time.
+
+ Notes
+ -----
+ For a temporary change, this can be used as a context manager::
+
+ # if interactive mode is off
+ # then figures will not be shown on creation
+ plt.ioff()
+ # This figure will not be shown immediately
+ fig = plt.figure()
+
+ with plt.ion():
+ # interactive mode will be on
+ # figures will automatically be shown
+ fig2 = plt.figure()
+ # ...
+
+ To enable optional usage as a context manager, this function returns a
+ context manager object, which is not intended to be stored or
+ accessed by the user.
+ """
+ stack = ExitStack()
+ stack.callback(ion if isinteractive() else ioff)
+ matplotlib.interactive(True)
+ install_repl_displayhook()
+ return stack
+
+
+def pause(interval: float) -> None:
+ """
+ Run the GUI event loop for *interval* seconds.
+
+ If there is an active figure, it will be updated and displayed before the
+ pause, and the GUI event loop (if any) will run during the pause.
+
+ This can be used for crude animation. For more complex animation use
+ :mod:`matplotlib.animation`.
+
+ If there is no active figure, sleep for *interval* seconds instead.
+
+ See Also
+ --------
+ matplotlib.animation : Proper animations
+ show : Show all figures and optional block until all figures are closed.
+ """
+ manager = _pylab_helpers.Gcf.get_active()
+ if manager is not None:
+ canvas = manager.canvas
+ if canvas.figure.stale:
+ canvas.draw_idle()
+ show(block=False)
+ canvas.start_event_loop(interval)
+ else:
+ time.sleep(interval)
+
+
+@_copy_docstring_and_deprecators(matplotlib.rc)
+def rc(group: str, **kwargs) -> None:
+ matplotlib.rc(group, **kwargs)
+
+
+@_copy_docstring_and_deprecators(matplotlib.rc_context)
+def rc_context(
+ rc: dict[str, Any] | None = None,
+ fname: str | pathlib.Path | os.PathLike | None = None,
+) -> AbstractContextManager[None]:
+ return matplotlib.rc_context(rc, fname)
+
+
+@_copy_docstring_and_deprecators(matplotlib.rcdefaults)
+def rcdefaults() -> None:
+ matplotlib.rcdefaults()
+ if matplotlib.is_interactive():
+ draw_all()
+
+
+# getp/get/setp are explicitly reexported so that they show up in pyplot docs.
+
+
+@_copy_docstring_and_deprecators(matplotlib.artist.getp)
+def getp(obj, *args, **kwargs):
+ return matplotlib.artist.getp(obj, *args, **kwargs)
+
+
+@_copy_docstring_and_deprecators(matplotlib.artist.get)
+def get(obj, *args, **kwargs):
+ return matplotlib.artist.get(obj, *args, **kwargs)
+
+
+@_copy_docstring_and_deprecators(matplotlib.artist.setp)
+def setp(obj, *args, **kwargs):
+ return matplotlib.artist.setp(obj, *args, **kwargs)
+
+
+def xkcd(
+ scale: float = 1, length: float = 100, randomness: float = 2
+) -> ExitStack:
+ """
+ Turn on `xkcd `_ sketch-style drawing mode.
+
+ This will only have an effect on things drawn after this function is called.
+
+ For best results, install the `xkcd script `_
+ font; xkcd fonts are not packaged with Matplotlib.
+
+ Parameters
+ ----------
+ scale : float, optional
+ The amplitude of the wiggle perpendicular to the source line.
+ length : float, optional
+ The length of the wiggle along the line.
+ randomness : float, optional
+ The scale factor by which the length is shrunken or expanded.
+
+ Notes
+ -----
+ This function works by a number of rcParams, so it will probably
+ override others you have set before.
+
+ If you want the effects of this function to be temporary, it can
+ be used as a context manager, for example::
+
+ with plt.xkcd():
+ # This figure will be in XKCD-style
+ fig1 = plt.figure()
+ # ...
+
+ # This figure will be in regular style
+ fig2 = plt.figure()
+ """
+ # This cannot be implemented in terms of contextmanager() or rc_context()
+ # because this needs to work as a non-contextmanager too.
+
+ if rcParams['text.usetex']:
+ raise RuntimeError(
+ "xkcd mode is not compatible with text.usetex = True")
+
+ stack = ExitStack()
+ stack.callback(rcParams._update_raw, rcParams.copy()) # type: ignore[arg-type]
+
+ from matplotlib import patheffects
+ rcParams.update({
+ 'font.family': ['xkcd', 'xkcd Script', 'Comic Neue', 'Comic Sans MS'],
+ 'font.size': 14.0,
+ 'path.sketch': (scale, length, randomness),
+ 'path.effects': [
+ patheffects.withStroke(linewidth=4, foreground="w")],
+ 'axes.linewidth': 1.5,
+ 'lines.linewidth': 2.0,
+ 'figure.facecolor': 'white',
+ 'grid.linewidth': 0.0,
+ 'axes.grid': False,
+ 'axes.unicode_minus': False,
+ 'axes.edgecolor': 'black',
+ 'xtick.major.size': 8,
+ 'xtick.major.width': 3,
+ 'ytick.major.size': 8,
+ 'ytick.major.width': 3,
+ })
+
+ return stack
+
+
+## Figures ##
+
+def figure(
+ # autoincrement if None, else integer from 1-N
+ num: int | str | Figure | SubFigure | None = None,
+ # defaults to rc figure.figsize
+ figsize: ArrayLike | None = None,
+ # defaults to rc figure.dpi
+ dpi: float | None = None,
+ *,
+ # defaults to rc figure.facecolor
+ facecolor: ColorType | None = None,
+ # defaults to rc figure.edgecolor
+ edgecolor: ColorType | None = None,
+ frameon: bool = True,
+ FigureClass: type[Figure] = Figure,
+ clear: bool = False,
+ **kwargs
+) -> Figure:
+ """
+ Create a new figure, or activate an existing figure.
+
+ Parameters
+ ----------
+ num : int or str or `.Figure` or `.SubFigure`, optional
+ A unique identifier for the figure.
+
+ If a figure with that identifier already exists, this figure is made
+ active and returned. An integer refers to the ``Figure.number``
+ attribute, a string refers to the figure label.
+
+ If there is no figure with the identifier or *num* is not given, a new
+ figure is created, made active and returned. If *num* is an int, it
+ will be used for the ``Figure.number`` attribute, otherwise, an
+ auto-generated integer value is used (starting at 1 and incremented
+ for each new figure). If *num* is a string, the figure label and the
+ window title is set to this value. If num is a ``SubFigure``, its
+ parent ``Figure`` is activated.
+
+ figsize : (float, float), default: :rc:`figure.figsize`
+ Width, height in inches.
+
+ dpi : float, default: :rc:`figure.dpi`
+ The resolution of the figure in dots-per-inch.
+
+ facecolor : :mpltype:`color`, default: :rc:`figure.facecolor`
+ The background color.
+
+ edgecolor : :mpltype:`color`, default: :rc:`figure.edgecolor`
+ The border color.
+
+ frameon : bool, default: True
+ If False, suppress drawing the figure frame.
+
+ FigureClass : subclass of `~matplotlib.figure.Figure`
+ If set, an instance of this subclass will be created, rather than a
+ plain `.Figure`.
+
+ clear : bool, default: False
+ If True and the figure already exists, then it is cleared.
+
+ layout : {'constrained', 'compressed', 'tight', 'none', `.LayoutEngine`, None}, \
+default: None
+ The layout mechanism for positioning of plot elements to avoid
+ overlapping Axes decorations (labels, ticks, etc). Note that layout
+ managers can measurably slow down figure display.
+
+ - 'constrained': The constrained layout solver adjusts Axes sizes
+ to avoid overlapping Axes decorations. Can handle complex plot
+ layouts and colorbars, and is thus recommended.
+
+ See :ref:`constrainedlayout_guide`
+ for examples.
+
+ - 'compressed': uses the same algorithm as 'constrained', but
+ removes extra space between fixed-aspect-ratio Axes. Best for
+ simple grids of Axes.
+
+ - 'tight': Use the tight layout mechanism. This is a relatively
+ simple algorithm that adjusts the subplot parameters so that
+ decorations do not overlap. See `.Figure.set_tight_layout` for
+ further details.
+
+ - 'none': Do not use a layout engine.
+
+ - A `.LayoutEngine` instance. Builtin layout classes are
+ `.ConstrainedLayoutEngine` and `.TightLayoutEngine`, more easily
+ accessible by 'constrained' and 'tight'. Passing an instance
+ allows third parties to provide their own layout engine.
+
+ If not given, fall back to using the parameters *tight_layout* and
+ *constrained_layout*, including their config defaults
+ :rc:`figure.autolayout` and :rc:`figure.constrained_layout.use`.
+
+ **kwargs
+ Additional keyword arguments are passed to the `.Figure` constructor.
+
+ Returns
+ -------
+ `~matplotlib.figure.Figure`
+
+ Notes
+ -----
+ A newly created figure is passed to the `~.FigureCanvasBase.new_manager`
+ method or the `new_figure_manager` function provided by the current
+ backend, which install a canvas and a manager on the figure.
+
+ Once this is done, :rc:`figure.hooks` are called, one at a time, on the
+ figure; these hooks allow arbitrary customization of the figure (e.g.,
+ attaching callbacks) or of associated elements (e.g., modifying the
+ toolbar). See :doc:`/gallery/user_interfaces/mplcvd` for an example of
+ toolbar customization.
+
+ If you are creating many figures, make sure you explicitly call
+ `.pyplot.close` on the figures you are not using, because this will
+ enable pyplot to properly clean up the memory.
+
+ `~matplotlib.rcParams` defines the default values, which can be modified
+ in the matplotlibrc file.
+ """
+ allnums = get_fignums()
+
+ if isinstance(num, FigureBase):
+ # type narrowed to `Figure | SubFigure` by combination of input and isinstance
+ root_fig = num.get_figure(root=True)
+ if root_fig.canvas.manager is None:
+ raise ValueError("The passed figure is not managed by pyplot")
+ elif (any(param is not None for param in [figsize, dpi, facecolor, edgecolor])
+ or not frameon or kwargs) and root_fig.canvas.manager.num in allnums:
+ _api.warn_external(
+ "Ignoring specified arguments in this call because figure "
+ f"with num: {root_fig.canvas.manager.num} already exists")
+ _pylab_helpers.Gcf.set_active(root_fig.canvas.manager)
+ return root_fig
+
+ next_num = max(allnums) + 1 if allnums else 1
+ fig_label = ''
+ if num is None:
+ num = next_num
+ else:
+ if (any(param is not None for param in [figsize, dpi, facecolor, edgecolor])
+ or not frameon or kwargs) and num in allnums:
+ _api.warn_external(
+ "Ignoring specified arguments in this call "
+ f"because figure with num: {num} already exists")
+ if isinstance(num, str):
+ fig_label = num
+ all_labels = get_figlabels()
+ if fig_label not in all_labels:
+ if fig_label == 'all':
+ _api.warn_external("close('all') closes all existing figures.")
+ num = next_num
+ else:
+ inum = all_labels.index(fig_label)
+ num = allnums[inum]
+ else:
+ num = int(num) # crude validation of num argument
+
+ # Type of "num" has narrowed to int, but mypy can't quite see it
+ manager = _pylab_helpers.Gcf.get_fig_manager(num) # type: ignore[arg-type]
+ if manager is None:
+ max_open_warning = rcParams['figure.max_open_warning']
+ if len(allnums) == max_open_warning >= 1:
+ _api.warn_external(
+ f"More than {max_open_warning} figures have been opened. "
+ f"Figures created through the pyplot interface "
+ f"(`matplotlib.pyplot.figure`) are retained until explicitly "
+ f"closed and may consume too much memory. (To control this "
+ f"warning, see the rcParam `figure.max_open_warning`). "
+ f"Consider using `matplotlib.pyplot.close()`.",
+ RuntimeWarning)
+
+ manager = new_figure_manager(
+ num, figsize=figsize, dpi=dpi,
+ facecolor=facecolor, edgecolor=edgecolor, frameon=frameon,
+ FigureClass=FigureClass, **kwargs)
+ fig = manager.canvas.figure
+ if fig_label:
+ fig.set_label(fig_label)
+
+ for hookspecs in rcParams["figure.hooks"]:
+ module_name, dotted_name = hookspecs.split(":")
+ obj: Any = importlib.import_module(module_name)
+ for part in dotted_name.split("."):
+ obj = getattr(obj, part)
+ obj(fig)
+
+ _pylab_helpers.Gcf._set_new_active_manager(manager)
+
+ # make sure backends (inline) that we don't ship that expect this
+ # to be called in plotting commands to make the figure call show
+ # still work. There is probably a better way to do this in the
+ # FigureManager base class.
+ draw_if_interactive()
+
+ if _REPL_DISPLAYHOOK is _ReplDisplayHook.PLAIN:
+ fig.stale_callback = _auto_draw_if_interactive
+
+ if clear:
+ manager.canvas.figure.clear()
+
+ return manager.canvas.figure
+
+
+def _auto_draw_if_interactive(fig, val):
+ """
+ An internal helper function for making sure that auto-redrawing
+ works as intended in the plain python repl.
+
+ Parameters
+ ----------
+ fig : Figure
+ A figure object which is assumed to be associated with a canvas
+ """
+ if (val and matplotlib.is_interactive()
+ and not fig.canvas.is_saving()
+ and not fig.canvas._is_idle_drawing):
+ # Some artists can mark themselves as stale in the middle of drawing
+ # (e.g. axes position & tick labels being computed at draw time), but
+ # this shouldn't trigger a redraw because the current redraw will
+ # already take them into account.
+ with fig.canvas._idle_draw_cntx():
+ fig.canvas.draw_idle()
+
+
+def gcf() -> Figure:
+ """
+ Get the current figure.
+
+ If there is currently no figure on the pyplot figure stack, a new one is
+ created using `~.pyplot.figure()`. (To test whether there is currently a
+ figure on the pyplot figure stack, check whether `~.pyplot.get_fignums()`
+ is empty.)
+ """
+ manager = _pylab_helpers.Gcf.get_active()
+ if manager is not None:
+ return manager.canvas.figure
+ else:
+ return figure()
+
+
+def fignum_exists(num: int | str) -> bool:
+ """
+ Return whether the figure with the given id exists.
+
+ Parameters
+ ----------
+ num : int or str
+ A figure identifier.
+
+ Returns
+ -------
+ bool
+ Whether or not a figure with id *num* exists.
+ """
+ return (
+ _pylab_helpers.Gcf.has_fignum(num)
+ if isinstance(num, int)
+ else num in get_figlabels()
+ )
+
+
+def get_fignums() -> list[int]:
+ """Return a list of existing figure numbers."""
+ return sorted(_pylab_helpers.Gcf.figs)
+
+
+def get_figlabels() -> list[Any]:
+ """Return a list of existing figure labels."""
+ managers = _pylab_helpers.Gcf.get_all_fig_managers()
+ managers.sort(key=lambda m: m.num)
+ return [m.canvas.figure.get_label() for m in managers]
+
+
+def get_current_fig_manager() -> FigureManagerBase | None:
+ """
+ Return the figure manager of the current figure.
+
+ The figure manager is a container for the actual backend-depended window
+ that displays the figure on screen.
+
+ If no current figure exists, a new one is created, and its figure
+ manager is returned.
+
+ Returns
+ -------
+ `.FigureManagerBase` or backend-dependent subclass thereof
+ """
+ return gcf().canvas.manager
+
+
+@_copy_docstring_and_deprecators(FigureCanvasBase.mpl_connect)
+def connect(s: str, func: Callable[[Event], Any]) -> int:
+ return gcf().canvas.mpl_connect(s, func)
+
+
+@_copy_docstring_and_deprecators(FigureCanvasBase.mpl_disconnect)
+def disconnect(cid: int) -> None:
+ gcf().canvas.mpl_disconnect(cid)
+
+
+def close(fig: None | int | str | Figure | Literal["all"] = None) -> None:
+ """
+ Close a figure window, and unregister it from pyplot.
+
+ Parameters
+ ----------
+ fig : None or int or str or `.Figure`
+ The figure to close. There are a number of ways to specify this:
+
+ - *None*: the current figure
+ - `.Figure`: the given `.Figure` instance
+ - ``int``: a figure number
+ - ``str``: a figure name
+ - 'all': all figures
+
+ Notes
+ -----
+ pyplot maintains a reference to figures created with `figure()`. When
+ work on the figure is completed, it should be closed, i.e. deregistered
+ from pyplot, to free its memory (see also :rc:figure.max_open_warning).
+ Closing a figure window created by `show()` automatically deregisters the
+ figure. For all other use cases, most prominently `savefig()` without
+ `show()`, the figure must be deregistered explicitly using `close()`.
+ """
+ if fig is None:
+ manager = _pylab_helpers.Gcf.get_active()
+ if manager is None:
+ return
+ else:
+ _pylab_helpers.Gcf.destroy(manager)
+ elif fig == 'all':
+ _pylab_helpers.Gcf.destroy_all()
+ elif isinstance(fig, int):
+ _pylab_helpers.Gcf.destroy(fig)
+ elif hasattr(fig, 'int'):
+ # if we are dealing with a type UUID, we
+ # can use its integer representation
+ _pylab_helpers.Gcf.destroy(fig.int)
+ elif isinstance(fig, str):
+ all_labels = get_figlabels()
+ if fig in all_labels:
+ num = get_fignums()[all_labels.index(fig)]
+ _pylab_helpers.Gcf.destroy(num)
+ elif isinstance(fig, Figure):
+ _pylab_helpers.Gcf.destroy_fig(fig)
+ else:
+ raise TypeError("close() argument must be a Figure, an int, a string, "
+ "or None, not %s" % type(fig))
+
+
+def clf() -> None:
+ """Clear the current figure."""
+ gcf().clear()
+
+
+def draw() -> None:
+ """
+ Redraw the current figure.
+
+ This is used to update a figure that has been altered, but not
+ automatically re-drawn. If interactive mode is on (via `.ion()`), this
+ should be only rarely needed, but there may be ways to modify the state of
+ a figure without marking it as "stale". Please report these cases as bugs.
+
+ This is equivalent to calling ``fig.canvas.draw_idle()``, where ``fig`` is
+ the current figure.
+
+ See Also
+ --------
+ .FigureCanvasBase.draw_idle
+ .FigureCanvasBase.draw
+ """
+ gcf().canvas.draw_idle()
+
+
+@_copy_docstring_and_deprecators(Figure.savefig)
+def savefig(*args, **kwargs) -> None:
+ fig = gcf()
+ # savefig default implementation has no return, so mypy is unhappy
+ # presumably this is here because subclasses can return?
+ res = fig.savefig(*args, **kwargs) # type: ignore[func-returns-value]
+ fig.canvas.draw_idle() # Need this if 'transparent=True', to reset colors.
+ return res
+
+
+## Putting things in figures ##
+
+
+def figlegend(*args, **kwargs) -> Legend:
+ return gcf().legend(*args, **kwargs)
+if Figure.legend.__doc__:
+ figlegend.__doc__ = Figure.legend.__doc__ \
+ .replace(" legend(", " figlegend(") \
+ .replace("fig.legend(", "plt.figlegend(") \
+ .replace("ax.plot(", "plt.plot(")
+
+
+## Axes ##
+
+@_docstring.interpd
+def axes(
+ arg: None | tuple[float, float, float, float] = None,
+ **kwargs
+) -> matplotlib.axes.Axes:
+ """
+ Add an Axes to the current figure and make it the current Axes.
+
+ Call signatures::
+
+ plt.axes()
+ plt.axes(rect, projection=None, polar=False, **kwargs)
+ plt.axes(ax)
+
+ Parameters
+ ----------
+ arg : None or 4-tuple
+ The exact behavior of this function depends on the type:
+
+ - *None*: A new full window Axes is added using
+ ``subplot(**kwargs)``.
+ - 4-tuple of floats *rect* = ``(left, bottom, width, height)``.
+ A new Axes is added with dimensions *rect* in normalized
+ (0, 1) units using `~.Figure.add_axes` on the current figure.
+
+ projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \
+'polar', 'rectilinear', str}, optional
+ The projection type of the `~.axes.Axes`. *str* is the name of
+ a custom projection, see `~matplotlib.projections`. The default
+ None results in a 'rectilinear' projection.
+
+ polar : bool, default: False
+ If True, equivalent to projection='polar'.
+
+ sharex, sharey : `~matplotlib.axes.Axes`, optional
+ Share the x or y `~matplotlib.axis` with sharex and/or sharey.
+ The axis will have the same limits, ticks, and scale as the axis
+ of the shared Axes.
+
+ label : str
+ A label for the returned Axes.
+
+ Returns
+ -------
+ `~.axes.Axes`, or a subclass of `~.axes.Axes`
+ The returned Axes class depends on the projection used. It is
+ `~.axes.Axes` if rectilinear projection is used and
+ `.projections.polar.PolarAxes` if polar projection is used.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ This method also takes the keyword arguments for
+ the returned Axes class. The keyword arguments for the
+ rectilinear Axes class `~.axes.Axes` can be found in
+ the following table but there might also be other keyword
+ arguments if another projection is used, see the actual Axes
+ class.
+
+ %(Axes:kwdoc)s
+
+ See Also
+ --------
+ .Figure.add_axes
+ .pyplot.subplot
+ .Figure.add_subplot
+ .Figure.subplots
+ .pyplot.subplots
+
+ Examples
+ --------
+ ::
+
+ # Creating a new full window Axes
+ plt.axes()
+
+ # Creating a new Axes with specified dimensions and a grey background
+ plt.axes((left, bottom, width, height), facecolor='grey')
+ """
+ fig = gcf()
+ pos = kwargs.pop('position', None)
+ if arg is None:
+ if pos is None:
+ return fig.add_subplot(**kwargs)
+ else:
+ return fig.add_axes(pos, **kwargs)
+ else:
+ return fig.add_axes(arg, **kwargs)
+
+
+def delaxes(ax: matplotlib.axes.Axes | None = None) -> None:
+ """
+ Remove an `~.axes.Axes` (defaulting to the current Axes) from its figure.
+ """
+ if ax is None:
+ ax = gca()
+ ax.remove()
+
+
+def sca(ax: Axes) -> None:
+ """
+ Set the current Axes to *ax* and the current Figure to the parent of *ax*.
+ """
+ # Mypy sees ax.figure as potentially None,
+ # but if you are calling this, it won't be None
+ # Additionally the slight difference between `Figure` and `FigureBase` mypy catches
+ fig = ax.get_figure(root=False)
+ figure(fig) # type: ignore[arg-type]
+ fig.sca(ax) # type: ignore[union-attr]
+
+
+def cla() -> None:
+ """Clear the current Axes."""
+ # Not generated via boilerplate.py to allow a different docstring.
+ return gca().cla()
+
+
+## More ways of creating Axes ##
+
+@_docstring.interpd
+def subplot(*args, **kwargs) -> Axes:
+ """
+ Add an Axes to the current figure or retrieve an existing Axes.
+
+ This is a wrapper of `.Figure.add_subplot` which provides additional
+ behavior when working with the implicit API (see the notes section).
+
+ Call signatures::
+
+ subplot(nrows, ncols, index, **kwargs)
+ subplot(pos, **kwargs)
+ subplot(**kwargs)
+ subplot(ax)
+
+ Parameters
+ ----------
+ *args : int, (int, int, *index*), or `.SubplotSpec`, default: (1, 1, 1)
+ The position of the subplot described by one of
+
+ - Three integers (*nrows*, *ncols*, *index*). The subplot will take the
+ *index* position on a grid with *nrows* rows and *ncols* columns.
+ *index* starts at 1 in the upper left corner and increases to the
+ right. *index* can also be a two-tuple specifying the (*first*,
+ *last*) indices (1-based, and including *last*) of the subplot, e.g.,
+ ``fig.add_subplot(3, 1, (1, 2))`` makes a subplot that spans the
+ upper 2/3 of the figure.
+ - A 3-digit integer. The digits are interpreted as if given separately
+ as three single-digit integers, i.e. ``fig.add_subplot(235)`` is the
+ same as ``fig.add_subplot(2, 3, 5)``. Note that this can only be used
+ if there are no more than 9 subplots.
+ - A `.SubplotSpec`.
+
+ projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \
+'polar', 'rectilinear', str}, optional
+ The projection type of the subplot (`~.axes.Axes`). *str* is the name
+ of a custom projection, see `~matplotlib.projections`. The default
+ None results in a 'rectilinear' projection.
+
+ polar : bool, default: False
+ If True, equivalent to projection='polar'.
+
+ sharex, sharey : `~matplotlib.axes.Axes`, optional
+ Share the x or y `~matplotlib.axis` with sharex and/or sharey. The
+ axis will have the same limits, ticks, and scale as the axis of the
+ shared Axes.
+
+ label : str
+ A label for the returned Axes.
+
+ Returns
+ -------
+ `~.axes.Axes`
+
+ The Axes of the subplot. The returned Axes can actually be an instance
+ of a subclass, such as `.projections.polar.PolarAxes` for polar
+ projections.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ This method also takes the keyword arguments for the returned Axes
+ base class; except for the *figure* argument. The keyword arguments
+ for the rectilinear base class `~.axes.Axes` can be found in
+ the following table but there might also be other keyword
+ arguments if another projection is used.
+
+ %(Axes:kwdoc)s
+
+ Notes
+ -----
+ .. versionchanged:: 3.8
+ In versions prior to 3.8, any preexisting Axes that overlap with the new Axes
+ beyond sharing a boundary was deleted. Deletion does not happen in more
+ recent versions anymore. Use `.Axes.remove` explicitly if needed.
+
+ If you do not want this behavior, use the `.Figure.add_subplot` method
+ or the `.pyplot.axes` function instead.
+
+ If no *kwargs* are passed and there exists an Axes in the location
+ specified by *args* then that Axes will be returned rather than a new
+ Axes being created.
+
+ If *kwargs* are passed and there exists an Axes in the location
+ specified by *args*, the projection type is the same, and the
+ *kwargs* match with the existing Axes, then the existing Axes is
+ returned. Otherwise a new Axes is created with the specified
+ parameters. We save a reference to the *kwargs* which we use
+ for this comparison. If any of the values in *kwargs* are
+ mutable we will not detect the case where they are mutated.
+ In these cases we suggest using `.Figure.add_subplot` and the
+ explicit Axes API rather than the implicit pyplot API.
+
+ See Also
+ --------
+ .Figure.add_subplot
+ .pyplot.subplots
+ .pyplot.axes
+ .Figure.subplots
+
+ Examples
+ --------
+ ::
+
+ plt.subplot(221)
+
+ # equivalent but more general
+ ax1 = plt.subplot(2, 2, 1)
+
+ # add a subplot with no frame
+ ax2 = plt.subplot(222, frameon=False)
+
+ # add a polar subplot
+ plt.subplot(223, projection='polar')
+
+ # add a red subplot that shares the x-axis with ax1
+ plt.subplot(224, sharex=ax1, facecolor='red')
+
+ # delete ax2 from the figure
+ plt.delaxes(ax2)
+
+ # add ax2 to the figure again
+ plt.subplot(ax2)
+
+ # make the first Axes "current" again
+ plt.subplot(221)
+
+ """
+ # Here we will only normalize `polar=True` vs `projection='polar'` and let
+ # downstream code deal with the rest.
+ unset = object()
+ projection = kwargs.get('projection', unset)
+ polar = kwargs.pop('polar', unset)
+ if polar is not unset and polar:
+ # if we got mixed messages from the user, raise
+ if projection is not unset and projection != 'polar':
+ raise ValueError(
+ f"polar={polar}, yet projection={projection!r}. "
+ "Only one of these arguments should be supplied."
+ )
+ kwargs['projection'] = projection = 'polar'
+
+ # if subplot called without arguments, create subplot(1, 1, 1)
+ if len(args) == 0:
+ args = (1, 1, 1)
+
+ # This check was added because it is very easy to type subplot(1, 2, False)
+ # when subplots(1, 2, False) was intended (sharex=False, that is). In most
+ # cases, no error will ever occur, but mysterious behavior can result
+ # because what was intended to be the sharex argument is instead treated as
+ # a subplot index for subplot()
+ if len(args) >= 3 and isinstance(args[2], bool):
+ _api.warn_external("The subplot index argument to subplot() appears "
+ "to be a boolean. Did you intend to use "
+ "subplots()?")
+ # Check for nrows and ncols, which are not valid subplot args:
+ if 'nrows' in kwargs or 'ncols' in kwargs:
+ raise TypeError("subplot() got an unexpected keyword argument 'ncols' "
+ "and/or 'nrows'. Did you intend to call subplots()?")
+
+ fig = gcf()
+
+ # First, search for an existing subplot with a matching spec.
+ key = SubplotSpec._from_subplot_args(fig, args)
+
+ for ax in fig.axes:
+ # If we found an Axes at the position, we can reuse it if the user passed no
+ # kwargs or if the Axes class and kwargs are identical.
+ if (ax.get_subplotspec() == key
+ and (kwargs == {}
+ or (ax._projection_init
+ == fig._process_projection_requirements(**kwargs)))):
+ break
+ else:
+ # we have exhausted the known Axes and none match, make a new one!
+ ax = fig.add_subplot(*args, **kwargs)
+
+ fig.sca(ax)
+
+ return ax
+
+
+@overload
+def subplots(
+ nrows: Literal[1] = ...,
+ ncols: Literal[1] = ...,
+ *,
+ sharex: bool | Literal["none", "all", "row", "col"] = ...,
+ sharey: bool | Literal["none", "all", "row", "col"] = ...,
+ squeeze: Literal[True] = ...,
+ width_ratios: Sequence[float] | None = ...,
+ height_ratios: Sequence[float] | None = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ **fig_kw
+) -> tuple[Figure, Axes]:
+ ...
+
+
+@overload
+def subplots(
+ nrows: int = ...,
+ ncols: int = ...,
+ *,
+ sharex: bool | Literal["none", "all", "row", "col"] = ...,
+ sharey: bool | Literal["none", "all", "row", "col"] = ...,
+ squeeze: Literal[False],
+ width_ratios: Sequence[float] | None = ...,
+ height_ratios: Sequence[float] | None = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ **fig_kw
+) -> tuple[Figure, np.ndarray]: # TODO numpy/numpy#24738
+ ...
+
+
+@overload
+def subplots(
+ nrows: int = ...,
+ ncols: int = ...,
+ *,
+ sharex: bool | Literal["none", "all", "row", "col"] = ...,
+ sharey: bool | Literal["none", "all", "row", "col"] = ...,
+ squeeze: bool = ...,
+ width_ratios: Sequence[float] | None = ...,
+ height_ratios: Sequence[float] | None = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ **fig_kw
+) -> tuple[Figure, Any]:
+ ...
+
+
+def subplots(
+ nrows: int = 1, ncols: int = 1, *,
+ sharex: bool | Literal["none", "all", "row", "col"] = False,
+ sharey: bool | Literal["none", "all", "row", "col"] = False,
+ squeeze: bool = True,
+ width_ratios: Sequence[float] | None = None,
+ height_ratios: Sequence[float] | None = None,
+ subplot_kw: dict[str, Any] | None = None,
+ gridspec_kw: dict[str, Any] | None = None,
+ **fig_kw
+) -> tuple[Figure, Any]:
+ """
+ Create a figure and a set of subplots.
+
+ This utility wrapper makes it convenient to create common layouts of
+ subplots, including the enclosing figure object, in a single call.
+
+ Parameters
+ ----------
+ nrows, ncols : int, default: 1
+ Number of rows/columns of the subplot grid.
+
+ sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
+ Controls sharing of properties among x (*sharex*) or y (*sharey*)
+ axes:
+
+ - True or 'all': x- or y-axis will be shared among all subplots.
+ - False or 'none': each subplot x- or y-axis will be independent.
+ - 'row': each subplot row will share an x- or y-axis.
+ - 'col': each subplot column will share an x- or y-axis.
+
+ When subplots have a shared x-axis along a column, only the x tick
+ labels of the bottom subplot are created. Similarly, when subplots
+ have a shared y-axis along a row, only the y tick labels of the first
+ column subplot are created. To later turn other subplots' ticklabels
+ on, use `~matplotlib.axes.Axes.tick_params`.
+
+ When subplots have a shared axis that has units, calling
+ `.Axis.set_units` will update each axis with the new units.
+
+ Note that it is not possible to unshare axes.
+
+ squeeze : bool, default: True
+ - If True, extra dimensions are squeezed out from the returned
+ array of `~matplotlib.axes.Axes`:
+
+ - if only one subplot is constructed (nrows=ncols=1), the
+ resulting single Axes object is returned as a scalar.
+ - for Nx1 or 1xM subplots, the returned object is a 1D numpy
+ object array of Axes objects.
+ - for NxM, subplots with N>1 and M>1 are returned as a 2D array.
+
+ - If False, no squeezing at all is done: the returned Axes object is
+ always a 2D array containing Axes instances, even if it ends up
+ being 1x1.
+
+ width_ratios : array-like of length *ncols*, optional
+ Defines the relative widths of the columns. Each column gets a
+ relative width of ``width_ratios[i] / sum(width_ratios)``.
+ If not given, all columns will have the same width. Equivalent
+ to ``gridspec_kw={'width_ratios': [...]}``.
+
+ height_ratios : array-like of length *nrows*, optional
+ Defines the relative heights of the rows. Each row gets a
+ relative height of ``height_ratios[i] / sum(height_ratios)``.
+ If not given, all rows will have the same height. Convenience
+ for ``gridspec_kw={'height_ratios': [...]}``.
+
+ subplot_kw : dict, optional
+ Dict with keywords passed to the
+ `~matplotlib.figure.Figure.add_subplot` call used to create each
+ subplot.
+
+ gridspec_kw : dict, optional
+ Dict with keywords passed to the `~matplotlib.gridspec.GridSpec`
+ constructor used to create the grid the subplots are placed on.
+
+ **fig_kw
+ All additional keyword arguments are passed to the
+ `.pyplot.figure` call.
+
+ Returns
+ -------
+ fig : `.Figure`
+
+ ax : `~matplotlib.axes.Axes` or array of Axes
+ *ax* can be either a single `~.axes.Axes` object, or an array of Axes
+ objects if more than one subplot was created. The dimensions of the
+ resulting array can be controlled with the squeeze keyword, see above.
+
+ Typical idioms for handling the return value are::
+
+ # using the variable ax for single a Axes
+ fig, ax = plt.subplots()
+
+ # using the variable axs for multiple Axes
+ fig, axs = plt.subplots(2, 2)
+
+ # using tuple unpacking for multiple Axes
+ fig, (ax1, ax2) = plt.subplots(1, 2)
+ fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2)
+
+ The names ``ax`` and pluralized ``axs`` are preferred over ``axes``
+ because for the latter it's not clear if it refers to a single
+ `~.axes.Axes` instance or a collection of these.
+
+ See Also
+ --------
+ .pyplot.figure
+ .pyplot.subplot
+ .pyplot.axes
+ .Figure.subplots
+ .Figure.add_subplot
+
+ Examples
+ --------
+ ::
+
+ # First create some toy data:
+ x = np.linspace(0, 2*np.pi, 400)
+ y = np.sin(x**2)
+
+ # Create just a figure and only one subplot
+ fig, ax = plt.subplots()
+ ax.plot(x, y)
+ ax.set_title('Simple plot')
+
+ # Create two subplots and unpack the output array immediately
+ f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
+ ax1.plot(x, y)
+ ax1.set_title('Sharing Y axis')
+ ax2.scatter(x, y)
+
+ # Create four polar Axes and access them through the returned array
+ fig, axs = plt.subplots(2, 2, subplot_kw=dict(projection="polar"))
+ axs[0, 0].plot(x, y)
+ axs[1, 1].scatter(x, y)
+
+ # Share a X axis with each column of subplots
+ plt.subplots(2, 2, sharex='col')
+
+ # Share a Y axis with each row of subplots
+ plt.subplots(2, 2, sharey='row')
+
+ # Share both X and Y axes with all subplots
+ plt.subplots(2, 2, sharex='all', sharey='all')
+
+ # Note that this is the same as
+ plt.subplots(2, 2, sharex=True, sharey=True)
+
+ # Create figure number 10 with a single subplot
+ # and clears it if it already exists.
+ fig, ax = plt.subplots(num=10, clear=True)
+
+ """
+ fig = figure(**fig_kw)
+ axs = fig.subplots(nrows=nrows, ncols=ncols, sharex=sharex, sharey=sharey,
+ squeeze=squeeze, subplot_kw=subplot_kw,
+ gridspec_kw=gridspec_kw, height_ratios=height_ratios,
+ width_ratios=width_ratios)
+ return fig, axs
+
+
+@overload
+def subplot_mosaic(
+ mosaic: str,
+ *,
+ sharex: bool = ...,
+ sharey: bool = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ empty_sentinel: str = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ per_subplot_kw: dict[str | tuple[str, ...], dict[str, Any]] | None = ...,
+ **fig_kw: Any
+) -> tuple[Figure, dict[str, matplotlib.axes.Axes]]: ...
+
+
+@overload
+def subplot_mosaic(
+ mosaic: list[HashableList[_T]],
+ *,
+ sharex: bool = ...,
+ sharey: bool = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ empty_sentinel: _T = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ per_subplot_kw: dict[_T | tuple[_T, ...], dict[str, Any]] | None = ...,
+ **fig_kw: Any
+) -> tuple[Figure, dict[_T, matplotlib.axes.Axes]]: ...
+
+
+@overload
+def subplot_mosaic(
+ mosaic: list[HashableList[Hashable]],
+ *,
+ sharex: bool = ...,
+ sharey: bool = ...,
+ width_ratios: ArrayLike | None = ...,
+ height_ratios: ArrayLike | None = ...,
+ empty_sentinel: Any = ...,
+ subplot_kw: dict[str, Any] | None = ...,
+ gridspec_kw: dict[str, Any] | None = ...,
+ per_subplot_kw: dict[Hashable | tuple[Hashable, ...], dict[str, Any]] | None = ...,
+ **fig_kw: Any
+) -> tuple[Figure, dict[Hashable, matplotlib.axes.Axes]]: ...
+
+
+def subplot_mosaic(
+ mosaic: str | list[HashableList[_T]] | list[HashableList[Hashable]],
+ *,
+ sharex: bool = False,
+ sharey: bool = False,
+ width_ratios: ArrayLike | None = None,
+ height_ratios: ArrayLike | None = None,
+ empty_sentinel: Any = '.',
+ subplot_kw: dict[str, Any] | None = None,
+ gridspec_kw: dict[str, Any] | None = None,
+ per_subplot_kw: dict[str | tuple[str, ...], dict[str, Any]] |
+ dict[_T | tuple[_T, ...], dict[str, Any]] |
+ dict[Hashable | tuple[Hashable, ...], dict[str, Any]] | None = None,
+ **fig_kw: Any
+) -> tuple[Figure, dict[str, matplotlib.axes.Axes]] | \
+ tuple[Figure, dict[_T, matplotlib.axes.Axes]] | \
+ tuple[Figure, dict[Hashable, matplotlib.axes.Axes]]:
+ """
+ Build a layout of Axes based on ASCII art or nested lists.
+
+ This is a helper function to build complex GridSpec layouts visually.
+
+ See :ref:`mosaic`
+ for an example and full API documentation
+
+ Parameters
+ ----------
+ mosaic : list of list of {hashable or nested} or str
+
+ A visual layout of how you want your Axes to be arranged
+ labeled as strings. For example ::
+
+ x = [['A panel', 'A panel', 'edge'],
+ ['C panel', '.', 'edge']]
+
+ produces 4 Axes:
+
+ - 'A panel' which is 1 row high and spans the first two columns
+ - 'edge' which is 2 rows high and is on the right edge
+ - 'C panel' which in 1 row and 1 column wide in the bottom left
+ - a blank space 1 row and 1 column wide in the bottom center
+
+ Any of the entries in the layout can be a list of lists
+ of the same form to create nested layouts.
+
+ If input is a str, then it must be of the form ::
+
+ '''
+ AAE
+ C.E
+ '''
+
+ where each character is a column and each line is a row.
+ This only allows only single character Axes labels and does
+ not allow nesting but is very terse.
+
+ sharex, sharey : bool, default: False
+ If True, the x-axis (*sharex*) or y-axis (*sharey*) will be shared
+ among all subplots. In that case, tick label visibility and axis units
+ behave as for `subplots`. If False, each subplot's x- or y-axis will
+ be independent.
+
+ width_ratios : array-like of length *ncols*, optional
+ Defines the relative widths of the columns. Each column gets a
+ relative width of ``width_ratios[i] / sum(width_ratios)``.
+ If not given, all columns will have the same width. Convenience
+ for ``gridspec_kw={'width_ratios': [...]}``.
+
+ height_ratios : array-like of length *nrows*, optional
+ Defines the relative heights of the rows. Each row gets a
+ relative height of ``height_ratios[i] / sum(height_ratios)``.
+ If not given, all rows will have the same height. Convenience
+ for ``gridspec_kw={'height_ratios': [...]}``.
+
+ empty_sentinel : object, optional
+ Entry in the layout to mean "leave this space empty". Defaults
+ to ``'.'``. Note, if *layout* is a string, it is processed via
+ `inspect.cleandoc` to remove leading white space, which may
+ interfere with using white-space as the empty sentinel.
+
+ subplot_kw : dict, optional
+ Dictionary with keywords passed to the `.Figure.add_subplot` call
+ used to create each subplot. These values may be overridden by
+ values in *per_subplot_kw*.
+
+ per_subplot_kw : dict, optional
+ A dictionary mapping the Axes identifiers or tuples of identifiers
+ to a dictionary of keyword arguments to be passed to the
+ `.Figure.add_subplot` call used to create each subplot. The values
+ in these dictionaries have precedence over the values in
+ *subplot_kw*.
+
+ If *mosaic* is a string, and thus all keys are single characters,
+ it is possible to use a single string instead of a tuple as keys;
+ i.e. ``"AB"`` is equivalent to ``("A", "B")``.
+
+ .. versionadded:: 3.7
+
+ gridspec_kw : dict, optional
+ Dictionary with keywords passed to the `.GridSpec` constructor used
+ to create the grid the subplots are placed on.
+
+ **fig_kw
+ All additional keyword arguments are passed to the
+ `.pyplot.figure` call.
+
+ Returns
+ -------
+ fig : `.Figure`
+ The new figure
+
+ dict[label, Axes]
+ A dictionary mapping the labels to the Axes objects. The order of
+ the Axes is left-to-right and top-to-bottom of their position in the
+ total layout.
+
+ """
+ fig = figure(**fig_kw)
+ ax_dict = fig.subplot_mosaic( # type: ignore[misc]
+ mosaic, # type: ignore[arg-type]
+ sharex=sharex, sharey=sharey,
+ height_ratios=height_ratios, width_ratios=width_ratios,
+ subplot_kw=subplot_kw, gridspec_kw=gridspec_kw,
+ empty_sentinel=empty_sentinel,
+ per_subplot_kw=per_subplot_kw, # type: ignore[arg-type]
+ )
+ return fig, ax_dict
+
+
+def subplot2grid(
+ shape: tuple[int, int], loc: tuple[int, int],
+ rowspan: int = 1, colspan: int = 1,
+ fig: Figure | None = None,
+ **kwargs
+) -> matplotlib.axes.Axes:
+ """
+ Create a subplot at a specific location inside a regular grid.
+
+ Parameters
+ ----------
+ shape : (int, int)
+ Number of rows and of columns of the grid in which to place axis.
+ loc : (int, int)
+ Row number and column number of the axis location within the grid.
+ rowspan : int, default: 1
+ Number of rows for the axis to span downwards.
+ colspan : int, default: 1
+ Number of columns for the axis to span to the right.
+ fig : `.Figure`, optional
+ Figure to place the subplot in. Defaults to the current figure.
+ **kwargs
+ Additional keyword arguments are handed to `~.Figure.add_subplot`.
+
+ Returns
+ -------
+ `~.axes.Axes`
+
+ The Axes of the subplot. The returned Axes can actually be an instance
+ of a subclass, such as `.projections.polar.PolarAxes` for polar
+ projections.
+
+ Notes
+ -----
+ The following call ::
+
+ ax = subplot2grid((nrows, ncols), (row, col), rowspan, colspan)
+
+ is identical to ::
+
+ fig = gcf()
+ gs = fig.add_gridspec(nrows, ncols)
+ ax = fig.add_subplot(gs[row:row+rowspan, col:col+colspan])
+ """
+ if fig is None:
+ fig = gcf()
+ rows, cols = shape
+ gs = GridSpec._check_gridspec_exists(fig, rows, cols)
+ subplotspec = gs.new_subplotspec(loc, rowspan=rowspan, colspan=colspan)
+ return fig.add_subplot(subplotspec, **kwargs)
+
+
+def twinx(ax: matplotlib.axes.Axes | None = None) -> _AxesBase:
+ """
+ Make and return a second Axes that shares the *x*-axis. The new Axes will
+ overlay *ax* (or the current Axes if *ax* is *None*), and its ticks will be
+ on the right.
+
+ Examples
+ --------
+ :doc:`/gallery/subplots_axes_and_figures/two_scales`
+ """
+ if ax is None:
+ ax = gca()
+ ax1 = ax.twinx()
+ return ax1
+
+
+def twiny(ax: matplotlib.axes.Axes | None = None) -> _AxesBase:
+ """
+ Make and return a second Axes that shares the *y*-axis. The new Axes will
+ overlay *ax* (or the current Axes if *ax* is *None*), and its ticks will be
+ on the top.
+
+ Examples
+ --------
+ :doc:`/gallery/subplots_axes_and_figures/two_scales`
+ """
+ if ax is None:
+ ax = gca()
+ ax1 = ax.twiny()
+ return ax1
+
+
+def subplot_tool(targetfig: Figure | None = None) -> SubplotTool | None:
+ """
+ Launch a subplot tool window for a figure.
+
+ Returns
+ -------
+ `matplotlib.widgets.SubplotTool`
+ """
+ if targetfig is None:
+ targetfig = gcf()
+ tb = targetfig.canvas.manager.toolbar # type: ignore[union-attr]
+ if hasattr(tb, "configure_subplots"): # toolbar2
+ from matplotlib.backend_bases import NavigationToolbar2
+ return cast(NavigationToolbar2, tb).configure_subplots()
+ elif hasattr(tb, "trigger_tool"): # toolmanager
+ from matplotlib.backend_bases import ToolContainerBase
+ cast(ToolContainerBase, tb).trigger_tool("subplots")
+ return None
+ else:
+ raise ValueError("subplot_tool can only be launched for figures with "
+ "an associated toolbar")
+
+
+def box(on: bool | None = None) -> None:
+ """
+ Turn the Axes box on or off on the current Axes.
+
+ Parameters
+ ----------
+ on : bool or None
+ The new `~matplotlib.axes.Axes` box state. If ``None``, toggle
+ the state.
+
+ See Also
+ --------
+ :meth:`matplotlib.axes.Axes.set_frame_on`
+ :meth:`matplotlib.axes.Axes.get_frame_on`
+ """
+ ax = gca()
+ if on is None:
+ on = not ax.get_frame_on()
+ ax.set_frame_on(on)
+
+## Axis ##
+
+
+def xlim(*args, **kwargs) -> tuple[float, float]:
+ """
+ Get or set the x limits of the current Axes.
+
+ Call signatures::
+
+ left, right = xlim() # return the current xlim
+ xlim((left, right)) # set the xlim to left, right
+ xlim(left, right) # set the xlim to left, right
+
+ If you do not specify args, you can pass *left* or *right* as kwargs,
+ i.e.::
+
+ xlim(right=3) # adjust the right leaving left unchanged
+ xlim(left=1) # adjust the left leaving right unchanged
+
+ Setting limits turns autoscaling off for the x-axis.
+
+ Returns
+ -------
+ left, right
+ A tuple of the new x-axis limits.
+
+ Notes
+ -----
+ Calling this function with no arguments (e.g. ``xlim()``) is the pyplot
+ equivalent of calling `~.Axes.get_xlim` on the current Axes.
+ Calling this function with arguments is the pyplot equivalent of calling
+ `~.Axes.set_xlim` on the current Axes. All arguments are passed though.
+ """
+ ax = gca()
+ if not args and not kwargs:
+ return ax.get_xlim()
+ ret = ax.set_xlim(*args, **kwargs)
+ return ret
+
+
+def ylim(*args, **kwargs) -> tuple[float, float]:
+ """
+ Get or set the y-limits of the current Axes.
+
+ Call signatures::
+
+ bottom, top = ylim() # return the current ylim
+ ylim((bottom, top)) # set the ylim to bottom, top
+ ylim(bottom, top) # set the ylim to bottom, top
+
+ If you do not specify args, you can alternatively pass *bottom* or
+ *top* as kwargs, i.e.::
+
+ ylim(top=3) # adjust the top leaving bottom unchanged
+ ylim(bottom=1) # adjust the bottom leaving top unchanged
+
+ Setting limits turns autoscaling off for the y-axis.
+
+ Returns
+ -------
+ bottom, top
+ A tuple of the new y-axis limits.
+
+ Notes
+ -----
+ Calling this function with no arguments (e.g. ``ylim()``) is the pyplot
+ equivalent of calling `~.Axes.get_ylim` on the current Axes.
+ Calling this function with arguments is the pyplot equivalent of calling
+ `~.Axes.set_ylim` on the current Axes. All arguments are passed though.
+ """
+ ax = gca()
+ if not args and not kwargs:
+ return ax.get_ylim()
+ ret = ax.set_ylim(*args, **kwargs)
+ return ret
+
+
+def xticks(
+ ticks: ArrayLike | None = None,
+ labels: Sequence[str] | None = None,
+ *,
+ minor: bool = False,
+ **kwargs
+) -> tuple[list[Tick] | np.ndarray, list[Text]]:
+ """
+ Get or set the current tick locations and labels of the x-axis.
+
+ Pass no arguments to return the current values without modifying them.
+
+ Parameters
+ ----------
+ ticks : array-like, optional
+ The list of xtick locations. Passing an empty list removes all xticks.
+ labels : array-like, optional
+ The labels to place at the given *ticks* locations. This argument can
+ only be passed if *ticks* is passed as well.
+ minor : bool, default: False
+ If ``False``, get/set the major ticks/labels; if ``True``, the minor
+ ticks/labels.
+ **kwargs
+ `.Text` properties can be used to control the appearance of the labels.
+
+ .. warning::
+
+ This only sets the properties of the current ticks, which is
+ only sufficient if you either pass *ticks*, resulting in a
+ fixed list of ticks, or if the plot is static.
+
+ Ticks are not guaranteed to be persistent. Various operations
+ can create, delete and modify the Tick instances. There is an
+ imminent risk that these settings can get lost if you work on
+ the figure further (including also panning/zooming on a
+ displayed figure).
+
+ Use `~.pyplot.tick_params` instead if possible.
+
+
+ Returns
+ -------
+ locs
+ The list of xtick locations.
+ labels
+ The list of xlabel `.Text` objects.
+
+ Notes
+ -----
+ Calling this function with no arguments (e.g. ``xticks()``) is the pyplot
+ equivalent of calling `~.Axes.get_xticks` and `~.Axes.get_xticklabels` on
+ the current Axes.
+ Calling this function with arguments is the pyplot equivalent of calling
+ `~.Axes.set_xticks` and `~.Axes.set_xticklabels` on the current Axes.
+
+ Examples
+ --------
+ >>> locs, labels = xticks() # Get the current locations and labels.
+ >>> xticks(np.arange(0, 1, step=0.2)) # Set label locations.
+ >>> xticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
+ >>> xticks([0, 1, 2], ['January', 'February', 'March'],
+ ... rotation=20) # Set text labels and properties.
+ >>> xticks([]) # Disable xticks.
+ """
+ ax = gca()
+
+ locs: list[Tick] | np.ndarray
+ if ticks is None:
+ locs = ax.get_xticks(minor=minor)
+ if labels is not None:
+ raise TypeError("xticks(): Parameter 'labels' can't be set "
+ "without setting 'ticks'")
+ else:
+ locs = ax.set_xticks(ticks, minor=minor)
+
+ labels_out: list[Text] = []
+ if labels is None:
+ labels_out = ax.get_xticklabels(minor=minor)
+ for l in labels_out:
+ l._internal_update(kwargs)
+ else:
+ labels_out = ax.set_xticklabels(labels, minor=minor, **kwargs)
+
+ return locs, labels_out
+
+
+def yticks(
+ ticks: ArrayLike | None = None,
+ labels: Sequence[str] | None = None,
+ *,
+ minor: bool = False,
+ **kwargs
+) -> tuple[list[Tick] | np.ndarray, list[Text]]:
+ """
+ Get or set the current tick locations and labels of the y-axis.
+
+ Pass no arguments to return the current values without modifying them.
+
+ Parameters
+ ----------
+ ticks : array-like, optional
+ The list of ytick locations. Passing an empty list removes all yticks.
+ labels : array-like, optional
+ The labels to place at the given *ticks* locations. This argument can
+ only be passed if *ticks* is passed as well.
+ minor : bool, default: False
+ If ``False``, get/set the major ticks/labels; if ``True``, the minor
+ ticks/labels.
+ **kwargs
+ `.Text` properties can be used to control the appearance of the labels.
+
+ .. warning::
+
+ This only sets the properties of the current ticks, which is
+ only sufficient if you either pass *ticks*, resulting in a
+ fixed list of ticks, or if the plot is static.
+
+ Ticks are not guaranteed to be persistent. Various operations
+ can create, delete and modify the Tick instances. There is an
+ imminent risk that these settings can get lost if you work on
+ the figure further (including also panning/zooming on a
+ displayed figure).
+
+ Use `~.pyplot.tick_params` instead if possible.
+
+ Returns
+ -------
+ locs
+ The list of ytick locations.
+ labels
+ The list of ylabel `.Text` objects.
+
+ Notes
+ -----
+ Calling this function with no arguments (e.g. ``yticks()``) is the pyplot
+ equivalent of calling `~.Axes.get_yticks` and `~.Axes.get_yticklabels` on
+ the current Axes.
+ Calling this function with arguments is the pyplot equivalent of calling
+ `~.Axes.set_yticks` and `~.Axes.set_yticklabels` on the current Axes.
+
+ Examples
+ --------
+ >>> locs, labels = yticks() # Get the current locations and labels.
+ >>> yticks(np.arange(0, 1, step=0.2)) # Set label locations.
+ >>> yticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
+ >>> yticks([0, 1, 2], ['January', 'February', 'March'],
+ ... rotation=45) # Set text labels and properties.
+ >>> yticks([]) # Disable yticks.
+ """
+ ax = gca()
+
+ locs: list[Tick] | np.ndarray
+ if ticks is None:
+ locs = ax.get_yticks(minor=minor)
+ if labels is not None:
+ raise TypeError("yticks(): Parameter 'labels' can't be set "
+ "without setting 'ticks'")
+ else:
+ locs = ax.set_yticks(ticks, minor=minor)
+
+ labels_out: list[Text] = []
+ if labels is None:
+ labels_out = ax.get_yticklabels(minor=minor)
+ for l in labels_out:
+ l._internal_update(kwargs)
+ else:
+ labels_out = ax.set_yticklabels(labels, minor=minor, **kwargs)
+
+ return locs, labels_out
+
+
+def rgrids(
+ radii: ArrayLike | None = None,
+ labels: Sequence[str | Text] | None = None,
+ angle: float | None = None,
+ fmt: str | None = None,
+ **kwargs
+) -> tuple[list[Line2D], list[Text]]:
+ """
+ Get or set the radial gridlines on the current polar plot.
+
+ Call signatures::
+
+ lines, labels = rgrids()
+ lines, labels = rgrids(radii, labels=None, angle=22.5, fmt=None, **kwargs)
+
+ When called with no arguments, `.rgrids` simply returns the tuple
+ (*lines*, *labels*). When called with arguments, the labels will
+ appear at the specified radial distances and angle.
+
+ Parameters
+ ----------
+ radii : tuple with floats
+ The radii for the radial gridlines
+
+ labels : tuple with strings or None
+ The labels to use at each radial gridline. The
+ `matplotlib.ticker.ScalarFormatter` will be used if None.
+
+ angle : float
+ The angular position of the radius labels in degrees.
+
+ fmt : str or None
+ Format string used in `matplotlib.ticker.FormatStrFormatter`.
+ For example '%f'.
+
+ Returns
+ -------
+ lines : list of `.lines.Line2D`
+ The radial gridlines.
+
+ labels : list of `.text.Text`
+ The tick labels.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ *kwargs* are optional `.Text` properties for the labels.
+
+ See Also
+ --------
+ .pyplot.thetagrids
+ .projections.polar.PolarAxes.set_rgrids
+ .Axis.get_gridlines
+ .Axis.get_ticklabels
+
+ Examples
+ --------
+ ::
+
+ # set the locations of the radial gridlines
+ lines, labels = rgrids( (0.25, 0.5, 1.0) )
+
+ # set the locations and labels of the radial gridlines
+ lines, labels = rgrids( (0.25, 0.5, 1.0), ('Tom', 'Dick', 'Harry' ))
+ """
+ ax = gca()
+ if not isinstance(ax, PolarAxes):
+ raise RuntimeError('rgrids only defined for polar Axes')
+ if all(p is None for p in [radii, labels, angle, fmt]) and not kwargs:
+ lines_out: list[Line2D] = ax.yaxis.get_gridlines()
+ labels_out: list[Text] = ax.yaxis.get_ticklabels()
+ elif radii is None:
+ raise TypeError("'radii' cannot be None when other parameters are passed")
+ else:
+ lines_out, labels_out = ax.set_rgrids(
+ radii, labels=labels, angle=angle, fmt=fmt, **kwargs)
+ return lines_out, labels_out
+
+
+def thetagrids(
+ angles: ArrayLike | None = None,
+ labels: Sequence[str | Text] | None = None,
+ fmt: str | None = None,
+ **kwargs
+) -> tuple[list[Line2D], list[Text]]:
+ """
+ Get or set the theta gridlines on the current polar plot.
+
+ Call signatures::
+
+ lines, labels = thetagrids()
+ lines, labels = thetagrids(angles, labels=None, fmt=None, **kwargs)
+
+ When called with no arguments, `.thetagrids` simply returns the tuple
+ (*lines*, *labels*). When called with arguments, the labels will
+ appear at the specified angles.
+
+ Parameters
+ ----------
+ angles : tuple with floats, degrees
+ The angles of the theta gridlines.
+
+ labels : tuple with strings or None
+ The labels to use at each radial gridline. The
+ `.projections.polar.ThetaFormatter` will be used if None.
+
+ fmt : str or None
+ Format string used in `matplotlib.ticker.FormatStrFormatter`.
+ For example '%f'. Note that the angle in radians will be used.
+
+ Returns
+ -------
+ lines : list of `.lines.Line2D`
+ The theta gridlines.
+
+ labels : list of `.text.Text`
+ The tick labels.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ *kwargs* are optional `.Text` properties for the labels.
+
+ See Also
+ --------
+ .pyplot.rgrids
+ .projections.polar.PolarAxes.set_thetagrids
+ .Axis.get_gridlines
+ .Axis.get_ticklabels
+
+ Examples
+ --------
+ ::
+
+ # set the locations of the angular gridlines
+ lines, labels = thetagrids(range(45, 360, 90))
+
+ # set the locations and labels of the angular gridlines
+ lines, labels = thetagrids(range(45, 360, 90), ('NE', 'NW', 'SW', 'SE'))
+ """
+ ax = gca()
+ if not isinstance(ax, PolarAxes):
+ raise RuntimeError('thetagrids only defined for polar Axes')
+ if all(param is None for param in [angles, labels, fmt]) and not kwargs:
+ lines_out: list[Line2D] = ax.xaxis.get_ticklines()
+ labels_out: list[Text] = ax.xaxis.get_ticklabels()
+ elif angles is None:
+ raise TypeError("'angles' cannot be None when other parameters are passed")
+ else:
+ lines_out, labels_out = ax.set_thetagrids(angles,
+ labels=labels, fmt=fmt,
+ **kwargs)
+ return lines_out, labels_out
+
+
+@_api.deprecated("3.7", pending=True)
+def get_plot_commands() -> list[str]:
+ """
+ Get a sorted list of all of the plotting commands.
+ """
+ NON_PLOT_COMMANDS = {
+ 'connect', 'disconnect', 'get_current_fig_manager', 'ginput',
+ 'new_figure_manager', 'waitforbuttonpress'}
+ return [name for name in _get_pyplot_commands()
+ if name not in NON_PLOT_COMMANDS]
+
+
+def _get_pyplot_commands() -> list[str]:
+ # This works by searching for all functions in this module and removing
+ # a few hard-coded exclusions, as well as all of the colormap-setting
+ # functions, and anything marked as private with a preceding underscore.
+ exclude = {'colormaps', 'colors', 'get_plot_commands', *colormaps}
+ this_module = inspect.getmodule(get_plot_commands)
+ return sorted(
+ name for name, obj in globals().items()
+ if not name.startswith('_') and name not in exclude
+ and inspect.isfunction(obj)
+ and inspect.getmodule(obj) is this_module)
+
+
+## Plotting part 1: manually generated functions and wrappers ##
+
+
+@_copy_docstring_and_deprecators(Figure.colorbar)
+def colorbar(
+ mappable: ScalarMappable | ColorizingArtist | None = None,
+ cax: matplotlib.axes.Axes | None = None,
+ ax: matplotlib.axes.Axes | Iterable[matplotlib.axes.Axes] | None = None,
+ **kwargs
+) -> Colorbar:
+ if mappable is None:
+ mappable = gci()
+ if mappable is None:
+ raise RuntimeError('No mappable was found to use for colorbar '
+ 'creation. First define a mappable such as '
+ 'an image (with imshow) or a contour set ('
+ 'with contourf).')
+ ret = gcf().colorbar(mappable, cax=cax, ax=ax, **kwargs)
+ return ret
+
+
+def clim(vmin: float | None = None, vmax: float | None = None) -> None:
+ """
+ Set the color limits of the current image.
+
+ If either *vmin* or *vmax* is None, the image min/max respectively
+ will be used for color scaling.
+
+ If you want to set the clim of multiple images, use
+ `~.ScalarMappable.set_clim` on every image, for example::
+
+ for im in gca().get_images():
+ im.set_clim(0, 0.5)
+
+ """
+ im = gci()
+ if im is None:
+ raise RuntimeError('You must first define an image, e.g., with imshow')
+
+ im.set_clim(vmin, vmax)
+
+
+def get_cmap(name: Colormap | str | None = None, lut: int | None = None) -> Colormap:
+ """
+ Get a colormap instance, defaulting to rc values if *name* is None.
+
+ Parameters
+ ----------
+ name : `~matplotlib.colors.Colormap` or str or None, default: None
+ If a `.Colormap` instance, it will be returned. Otherwise, the name of
+ a colormap known to Matplotlib, which will be resampled by *lut*. The
+ default, None, means :rc:`image.cmap`.
+ lut : int or None, default: None
+ If *name* is not already a Colormap instance and *lut* is not None, the
+ colormap will be resampled to have *lut* entries in the lookup table.
+
+ Returns
+ -------
+ Colormap
+ """
+ if name is None:
+ name = rcParams['image.cmap']
+ if isinstance(name, Colormap):
+ return name
+ _api.check_in_list(sorted(_colormaps), name=name)
+ if lut is None:
+ return _colormaps[name]
+ else:
+ return _colormaps[name].resampled(lut)
+
+
+def set_cmap(cmap: Colormap | str) -> None:
+ """
+ Set the default colormap, and applies it to the current image if any.
+
+ Parameters
+ ----------
+ cmap : `~matplotlib.colors.Colormap` or str
+ A colormap instance or the name of a registered colormap.
+
+ See Also
+ --------
+ colormaps
+ get_cmap
+ """
+ cmap = get_cmap(cmap)
+
+ rc('image', cmap=cmap.name)
+ im = gci()
+
+ if im is not None:
+ im.set_cmap(cmap)
+
+
+@_copy_docstring_and_deprecators(matplotlib.image.imread)
+def imread(
+ fname: str | pathlib.Path | BinaryIO, format: str | None = None
+) -> np.ndarray:
+ return matplotlib.image.imread(fname, format)
+
+
+@_copy_docstring_and_deprecators(matplotlib.image.imsave)
+def imsave(
+ fname: str | os.PathLike | BinaryIO, arr: ArrayLike, **kwargs
+) -> None:
+ matplotlib.image.imsave(fname, arr, **kwargs)
+
+
+def matshow(A: ArrayLike, fignum: None | int = None, **kwargs) -> AxesImage:
+ """
+ Display a 2D array as a matrix in a new figure window.
+
+ The origin is set at the upper left hand corner.
+ The indexing is ``(row, column)`` so that the first index runs vertically
+ and the second index runs horizontally in the figure:
+
+ .. code-block:: none
+
+ A[0, 0] ⯠A[0, M-1]
+ ā® ā®
+ A[N-1, 0] ⯠A[N-1, M-1]
+
+ The aspect ratio of the figure window is that of the array,
+ unless this would make an excessively short or narrow figure.
+
+ Tick labels for the xaxis are placed on top.
+
+ Parameters
+ ----------
+ A : 2D array-like
+ The matrix to be displayed.
+
+ fignum : None or int
+ If *None*, create a new, appropriately sized figure window.
+
+ If 0, use the current Axes (creating one if there is none, without ever
+ adjusting the figure size).
+
+ Otherwise, create a new Axes on the figure with the given number
+ (creating it at the appropriate size if it does not exist, but not
+ adjusting the figure size otherwise). Note that this will be drawn on
+ top of any preexisting Axes on the figure.
+
+ Returns
+ -------
+ `~matplotlib.image.AxesImage`
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.axes.Axes.imshow` arguments
+
+ """
+ A = np.asanyarray(A)
+ if fignum == 0:
+ ax = gca()
+ else:
+ if fignum is not None and fignum_exists(fignum):
+ # Do not try to set a figure size.
+ figsize = None
+ else:
+ # Extract actual aspect ratio of array and make appropriately sized figure.
+ figsize = figaspect(A)
+ fig = figure(fignum, figsize=figsize)
+ ax = fig.add_axes((0.15, 0.09, 0.775, 0.775))
+ im = ax.matshow(A, **kwargs)
+ sci(im)
+ return im
+
+
+def polar(*args, **kwargs) -> list[Line2D]:
+ """
+ Make a polar plot.
+
+ call signature::
+
+ polar(theta, r, [fmt], **kwargs)
+
+ This is a convenience wrapper around `.pyplot.plot`. It ensures that the
+ current Axes is polar (or creates one if needed) and then passes all parameters
+ to ``.pyplot.plot``.
+
+ .. note::
+ When making polar plots using the :ref:`pyplot API `,
+ ``polar()`` should typically be the first command because that makes sure
+ a polar Axes is created. Using other commands such as ``plt.title()``
+ before this can lead to the implicit creation of a rectangular Axes, in which
+ case a subsequent ``polar()`` call will fail.
+ """
+ # If an axis already exists, check if it has a polar projection
+ if gcf().get_axes():
+ ax = gca()
+ if not isinstance(ax, PolarAxes):
+ _api.warn_deprecated(
+ "3.10",
+ message="There exists a non-polar current Axes. Therefore, the "
+ "resulting plot from 'polar()' is non-polar. You likely "
+ "should call 'polar()' before any other pyplot plotting "
+ "commands. "
+ "Support for this scenario is deprecated in %(since)s and "
+ "will raise an error in %(removal)s"
+ )
+ else:
+ ax = axes(projection="polar")
+ return ax.plot(*args, **kwargs)
+
+
+# If rcParams['backend_fallback'] is true, and an interactive backend is
+# requested, ignore rcParams['backend'] and force selection of a backend that
+# is compatible with the current running interactive framework.
+if rcParams["backend_fallback"]:
+ requested_backend = rcParams._get_backend_or_none() # type: ignore[attr-defined]
+ requested_backend = None if requested_backend is None else requested_backend.lower()
+ available_backends = backend_registry.list_builtin(BackendFilter.INTERACTIVE)
+ if (
+ requested_backend in (set(available_backends) - {'webagg', 'nbagg'})
+ and cbook._get_running_interactive_framework()
+ ):
+ rcParams._set("backend", rcsetup._auto_backend_sentinel)
+
+# fmt: on
+
+################# REMAINING CONTENT GENERATED BY boilerplate.py ##############
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure.figimage)
+def figimage(
+ X: ArrayLike,
+ xo: int = 0,
+ yo: int = 0,
+ alpha: float | None = None,
+ norm: str | Normalize | None = None,
+ cmap: str | Colormap | None = None,
+ vmin: float | None = None,
+ vmax: float | None = None,
+ origin: Literal["upper", "lower"] | None = None,
+ resize: bool = False,
+ *,
+ colorizer: Colorizer | None = None,
+ **kwargs,
+) -> FigureImage:
+ return gcf().figimage(
+ X,
+ xo=xo,
+ yo=yo,
+ alpha=alpha,
+ norm=norm,
+ cmap=cmap,
+ vmin=vmin,
+ vmax=vmax,
+ origin=origin,
+ resize=resize,
+ colorizer=colorizer,
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure.text)
+def figtext(
+ x: float, y: float, s: str, fontdict: dict[str, Any] | None = None, **kwargs
+) -> Text:
+ return gcf().text(x, y, s, fontdict=fontdict, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure.gca)
+def gca() -> Axes:
+ return gcf().gca()
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure._gci)
+def gci() -> ColorizingArtist | None:
+ return gcf()._gci()
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure.ginput)
+def ginput(
+ n: int = 1,
+ timeout: float = 30,
+ show_clicks: bool = True,
+ mouse_add: MouseButton = MouseButton.LEFT,
+ mouse_pop: MouseButton = MouseButton.RIGHT,
+ mouse_stop: MouseButton = MouseButton.MIDDLE,
+) -> list[tuple[int, int]]:
+ return gcf().ginput(
+ n=n,
+ timeout=timeout,
+ show_clicks=show_clicks,
+ mouse_add=mouse_add,
+ mouse_pop=mouse_pop,
+ mouse_stop=mouse_stop,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure.subplots_adjust)
+def subplots_adjust(
+ left: float | None = None,
+ bottom: float | None = None,
+ right: float | None = None,
+ top: float | None = None,
+ wspace: float | None = None,
+ hspace: float | None = None,
+) -> None:
+ gcf().subplots_adjust(
+ left=left, bottom=bottom, right=right, top=top, wspace=wspace, hspace=hspace
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure.suptitle)
+def suptitle(t: str, **kwargs) -> Text:
+ return gcf().suptitle(t, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure.tight_layout)
+def tight_layout(
+ *,
+ pad: float = 1.08,
+ h_pad: float | None = None,
+ w_pad: float | None = None,
+ rect: tuple[float, float, float, float] | None = None,
+) -> None:
+ gcf().tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Figure.waitforbuttonpress)
+def waitforbuttonpress(timeout: float = -1) -> None | bool:
+ return gcf().waitforbuttonpress(timeout=timeout)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.acorr)
+def acorr(
+ x: ArrayLike, *, data=None, **kwargs
+) -> tuple[np.ndarray, np.ndarray, LineCollection | Line2D, Line2D | None]:
+ return gca().acorr(x, **({"data": data} if data is not None else {}), **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.angle_spectrum)
+def angle_spectrum(
+ x: ArrayLike,
+ Fs: float | None = None,
+ Fc: int | None = None,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None,
+ pad_to: int | None = None,
+ sides: Literal["default", "onesided", "twosided"] | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray, Line2D]:
+ return gca().angle_spectrum(
+ x,
+ Fs=Fs,
+ Fc=Fc,
+ window=window,
+ pad_to=pad_to,
+ sides=sides,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.annotate)
+def annotate(
+ text: str,
+ xy: tuple[float, float],
+ xytext: tuple[float, float] | None = None,
+ xycoords: CoordsType = "data",
+ textcoords: CoordsType | None = None,
+ arrowprops: dict[str, Any] | None = None,
+ annotation_clip: bool | None = None,
+ **kwargs,
+) -> Annotation:
+ return gca().annotate(
+ text,
+ xy,
+ xytext=xytext,
+ xycoords=xycoords,
+ textcoords=textcoords,
+ arrowprops=arrowprops,
+ annotation_clip=annotation_clip,
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.arrow)
+def arrow(x: float, y: float, dx: float, dy: float, **kwargs) -> FancyArrow:
+ return gca().arrow(x, y, dx, dy, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.autoscale)
+def autoscale(
+ enable: bool = True,
+ axis: Literal["both", "x", "y"] = "both",
+ tight: bool | None = None,
+) -> None:
+ gca().autoscale(enable=enable, axis=axis, tight=tight)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.axhline)
+def axhline(y: float = 0, xmin: float = 0, xmax: float = 1, **kwargs) -> Line2D:
+ return gca().axhline(y=y, xmin=xmin, xmax=xmax, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.axhspan)
+def axhspan(
+ ymin: float, ymax: float, xmin: float = 0, xmax: float = 1, **kwargs
+) -> Rectangle:
+ return gca().axhspan(ymin, ymax, xmin=xmin, xmax=xmax, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.axis)
+def axis(
+ arg: tuple[float, float, float, float] | bool | str | None = None,
+ /,
+ *,
+ emit: bool = True,
+ **kwargs,
+) -> tuple[float, float, float, float]:
+ return gca().axis(arg, emit=emit, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.axline)
+def axline(
+ xy1: tuple[float, float],
+ xy2: tuple[float, float] | None = None,
+ *,
+ slope: float | None = None,
+ **kwargs,
+) -> AxLine:
+ return gca().axline(xy1, xy2=xy2, slope=slope, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.axvline)
+def axvline(x: float = 0, ymin: float = 0, ymax: float = 1, **kwargs) -> Line2D:
+ return gca().axvline(x=x, ymin=ymin, ymax=ymax, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.axvspan)
+def axvspan(
+ xmin: float, xmax: float, ymin: float = 0, ymax: float = 1, **kwargs
+) -> Rectangle:
+ return gca().axvspan(xmin, xmax, ymin=ymin, ymax=ymax, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.bar)
+def bar(
+ x: float | ArrayLike,
+ height: float | ArrayLike,
+ width: float | ArrayLike = 0.8,
+ bottom: float | ArrayLike | None = None,
+ *,
+ align: Literal["center", "edge"] = "center",
+ data=None,
+ **kwargs,
+) -> BarContainer:
+ return gca().bar(
+ x,
+ height,
+ width=width,
+ bottom=bottom,
+ align=align,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.barbs)
+def barbs(*args, data=None, **kwargs) -> Barbs:
+ return gca().barbs(*args, **({"data": data} if data is not None else {}), **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.barh)
+def barh(
+ y: float | ArrayLike,
+ width: float | ArrayLike,
+ height: float | ArrayLike = 0.8,
+ left: float | ArrayLike | None = None,
+ *,
+ align: Literal["center", "edge"] = "center",
+ data=None,
+ **kwargs,
+) -> BarContainer:
+ return gca().barh(
+ y,
+ width,
+ height=height,
+ left=left,
+ align=align,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.bar_label)
+def bar_label(
+ container: BarContainer,
+ labels: ArrayLike | None = None,
+ *,
+ fmt: str | Callable[[float], str] = "%g",
+ label_type: Literal["center", "edge"] = "edge",
+ padding: float = 0,
+ **kwargs,
+) -> list[Annotation]:
+ return gca().bar_label(
+ container,
+ labels=labels,
+ fmt=fmt,
+ label_type=label_type,
+ padding=padding,
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.boxplot)
+def boxplot(
+ x: ArrayLike | Sequence[ArrayLike],
+ notch: bool | None = None,
+ sym: str | None = None,
+ vert: bool | None = None,
+ orientation: Literal["vertical", "horizontal"] = "vertical",
+ whis: float | tuple[float, float] | None = None,
+ positions: ArrayLike | None = None,
+ widths: float | ArrayLike | None = None,
+ patch_artist: bool | None = None,
+ bootstrap: int | None = None,
+ usermedians: ArrayLike | None = None,
+ conf_intervals: ArrayLike | None = None,
+ meanline: bool | None = None,
+ showmeans: bool | None = None,
+ showcaps: bool | None = None,
+ showbox: bool | None = None,
+ showfliers: bool | None = None,
+ boxprops: dict[str, Any] | None = None,
+ tick_labels: Sequence[str] | None = None,
+ flierprops: dict[str, Any] | None = None,
+ medianprops: dict[str, Any] | None = None,
+ meanprops: dict[str, Any] | None = None,
+ capprops: dict[str, Any] | None = None,
+ whiskerprops: dict[str, Any] | None = None,
+ manage_ticks: bool = True,
+ autorange: bool = False,
+ zorder: float | None = None,
+ capwidths: float | ArrayLike | None = None,
+ label: Sequence[str] | None = None,
+ *,
+ data=None,
+) -> dict[str, Any]:
+ return gca().boxplot(
+ x,
+ notch=notch,
+ sym=sym,
+ vert=vert,
+ orientation=orientation,
+ whis=whis,
+ positions=positions,
+ widths=widths,
+ patch_artist=patch_artist,
+ bootstrap=bootstrap,
+ usermedians=usermedians,
+ conf_intervals=conf_intervals,
+ meanline=meanline,
+ showmeans=showmeans,
+ showcaps=showcaps,
+ showbox=showbox,
+ showfliers=showfliers,
+ boxprops=boxprops,
+ tick_labels=tick_labels,
+ flierprops=flierprops,
+ medianprops=medianprops,
+ meanprops=meanprops,
+ capprops=capprops,
+ whiskerprops=whiskerprops,
+ manage_ticks=manage_ticks,
+ autorange=autorange,
+ zorder=zorder,
+ capwidths=capwidths,
+ label=label,
+ **({"data": data} if data is not None else {}),
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.broken_barh)
+def broken_barh(
+ xranges: Sequence[tuple[float, float]],
+ yrange: tuple[float, float],
+ *,
+ data=None,
+ **kwargs,
+) -> PolyCollection:
+ return gca().broken_barh(
+ xranges, yrange, **({"data": data} if data is not None else {}), **kwargs
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.clabel)
+def clabel(CS: ContourSet, levels: ArrayLike | None = None, **kwargs) -> list[Text]:
+ return gca().clabel(CS, levels=levels, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.cohere)
+def cohere(
+ x: ArrayLike,
+ y: ArrayLike,
+ NFFT: int = 256,
+ Fs: float = 2,
+ Fc: int = 0,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike], ArrayLike] = mlab.detrend_none,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike = mlab.window_hanning,
+ noverlap: int = 0,
+ pad_to: int | None = None,
+ sides: Literal["default", "onesided", "twosided"] = "default",
+ scale_by_freq: bool | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray]:
+ return gca().cohere(
+ x,
+ y,
+ NFFT=NFFT,
+ Fs=Fs,
+ Fc=Fc,
+ detrend=detrend,
+ window=window,
+ noverlap=noverlap,
+ pad_to=pad_to,
+ sides=sides,
+ scale_by_freq=scale_by_freq,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.contour)
+def contour(*args, data=None, **kwargs) -> QuadContourSet:
+ __ret = gca().contour(
+ *args, **({"data": data} if data is not None else {}), **kwargs
+ )
+ if __ret._A is not None: # type: ignore[attr-defined]
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.contourf)
+def contourf(*args, data=None, **kwargs) -> QuadContourSet:
+ __ret = gca().contourf(
+ *args, **({"data": data} if data is not None else {}), **kwargs
+ )
+ if __ret._A is not None: # type: ignore[attr-defined]
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.csd)
+def csd(
+ x: ArrayLike,
+ y: ArrayLike,
+ NFFT: int | None = None,
+ Fs: float | None = None,
+ Fc: int | None = None,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike], ArrayLike]
+ | None = None,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None,
+ noverlap: int | None = None,
+ pad_to: int | None = None,
+ sides: Literal["default", "onesided", "twosided"] | None = None,
+ scale_by_freq: bool | None = None,
+ return_line: bool | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray] | tuple[np.ndarray, np.ndarray, Line2D]:
+ return gca().csd(
+ x,
+ y,
+ NFFT=NFFT,
+ Fs=Fs,
+ Fc=Fc,
+ detrend=detrend,
+ window=window,
+ noverlap=noverlap,
+ pad_to=pad_to,
+ sides=sides,
+ scale_by_freq=scale_by_freq,
+ return_line=return_line,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.ecdf)
+def ecdf(
+ x: ArrayLike,
+ weights: ArrayLike | None = None,
+ *,
+ complementary: bool = False,
+ orientation: Literal["vertical", "horizontal"] = "vertical",
+ compress: bool = False,
+ data=None,
+ **kwargs,
+) -> Line2D:
+ return gca().ecdf(
+ x,
+ weights=weights,
+ complementary=complementary,
+ orientation=orientation,
+ compress=compress,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.errorbar)
+def errorbar(
+ x: float | ArrayLike,
+ y: float | ArrayLike,
+ yerr: float | ArrayLike | None = None,
+ xerr: float | ArrayLike | None = None,
+ fmt: str = "",
+ ecolor: ColorType | None = None,
+ elinewidth: float | None = None,
+ capsize: float | None = None,
+ barsabove: bool = False,
+ lolims: bool | ArrayLike = False,
+ uplims: bool | ArrayLike = False,
+ xlolims: bool | ArrayLike = False,
+ xuplims: bool | ArrayLike = False,
+ errorevery: int | tuple[int, int] = 1,
+ capthick: float | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> ErrorbarContainer:
+ return gca().errorbar(
+ x,
+ y,
+ yerr=yerr,
+ xerr=xerr,
+ fmt=fmt,
+ ecolor=ecolor,
+ elinewidth=elinewidth,
+ capsize=capsize,
+ barsabove=barsabove,
+ lolims=lolims,
+ uplims=uplims,
+ xlolims=xlolims,
+ xuplims=xuplims,
+ errorevery=errorevery,
+ capthick=capthick,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.eventplot)
+def eventplot(
+ positions: ArrayLike | Sequence[ArrayLike],
+ orientation: Literal["horizontal", "vertical"] = "horizontal",
+ lineoffsets: float | Sequence[float] = 1,
+ linelengths: float | Sequence[float] = 1,
+ linewidths: float | Sequence[float] | None = None,
+ colors: ColorType | Sequence[ColorType] | None = None,
+ alpha: float | Sequence[float] | None = None,
+ linestyles: LineStyleType | Sequence[LineStyleType] = "solid",
+ *,
+ data=None,
+ **kwargs,
+) -> EventCollection:
+ return gca().eventplot(
+ positions,
+ orientation=orientation,
+ lineoffsets=lineoffsets,
+ linelengths=linelengths,
+ linewidths=linewidths,
+ colors=colors,
+ alpha=alpha,
+ linestyles=linestyles,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.fill)
+def fill(*args, data=None, **kwargs) -> list[Polygon]:
+ return gca().fill(*args, **({"data": data} if data is not None else {}), **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.fill_between)
+def fill_between(
+ x: ArrayLike,
+ y1: ArrayLike | float,
+ y2: ArrayLike | float = 0,
+ where: Sequence[bool] | None = None,
+ interpolate: bool = False,
+ step: Literal["pre", "post", "mid"] | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> FillBetweenPolyCollection:
+ return gca().fill_between(
+ x,
+ y1,
+ y2=y2,
+ where=where,
+ interpolate=interpolate,
+ step=step,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.fill_betweenx)
+def fill_betweenx(
+ y: ArrayLike,
+ x1: ArrayLike | float,
+ x2: ArrayLike | float = 0,
+ where: Sequence[bool] | None = None,
+ step: Literal["pre", "post", "mid"] | None = None,
+ interpolate: bool = False,
+ *,
+ data=None,
+ **kwargs,
+) -> FillBetweenPolyCollection:
+ return gca().fill_betweenx(
+ y,
+ x1,
+ x2=x2,
+ where=where,
+ step=step,
+ interpolate=interpolate,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.grid)
+def grid(
+ visible: bool | None = None,
+ which: Literal["major", "minor", "both"] = "major",
+ axis: Literal["both", "x", "y"] = "both",
+ **kwargs,
+) -> None:
+ gca().grid(visible=visible, which=which, axis=axis, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.hexbin)
+def hexbin(
+ x: ArrayLike,
+ y: ArrayLike,
+ C: ArrayLike | None = None,
+ gridsize: int | tuple[int, int] = 100,
+ bins: Literal["log"] | int | Sequence[float] | None = None,
+ xscale: Literal["linear", "log"] = "linear",
+ yscale: Literal["linear", "log"] = "linear",
+ extent: tuple[float, float, float, float] | None = None,
+ cmap: str | Colormap | None = None,
+ norm: str | Normalize | None = None,
+ vmin: float | None = None,
+ vmax: float | None = None,
+ alpha: float | None = None,
+ linewidths: float | None = None,
+ edgecolors: Literal["face", "none"] | ColorType = "face",
+ reduce_C_function: Callable[[np.ndarray | list[float]], float] = np.mean,
+ mincnt: int | None = None,
+ marginals: bool = False,
+ colorizer: Colorizer | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> PolyCollection:
+ __ret = gca().hexbin(
+ x,
+ y,
+ C=C,
+ gridsize=gridsize,
+ bins=bins,
+ xscale=xscale,
+ yscale=yscale,
+ extent=extent,
+ cmap=cmap,
+ norm=norm,
+ vmin=vmin,
+ vmax=vmax,
+ alpha=alpha,
+ linewidths=linewidths,
+ edgecolors=edgecolors,
+ reduce_C_function=reduce_C_function,
+ mincnt=mincnt,
+ marginals=marginals,
+ colorizer=colorizer,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.hist)
+def hist(
+ x: ArrayLike | Sequence[ArrayLike],
+ bins: int | Sequence[float] | str | None = None,
+ range: tuple[float, float] | None = None,
+ density: bool = False,
+ weights: ArrayLike | None = None,
+ cumulative: bool | float = False,
+ bottom: ArrayLike | float | None = None,
+ histtype: Literal["bar", "barstacked", "step", "stepfilled"] = "bar",
+ align: Literal["left", "mid", "right"] = "mid",
+ orientation: Literal["vertical", "horizontal"] = "vertical",
+ rwidth: float | None = None,
+ log: bool = False,
+ color: ColorType | Sequence[ColorType] | None = None,
+ label: str | Sequence[str] | None = None,
+ stacked: bool = False,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[
+ np.ndarray | list[np.ndarray],
+ np.ndarray,
+ BarContainer | Polygon | list[BarContainer | Polygon],
+]:
+ return gca().hist(
+ x,
+ bins=bins,
+ range=range,
+ density=density,
+ weights=weights,
+ cumulative=cumulative,
+ bottom=bottom,
+ histtype=histtype,
+ align=align,
+ orientation=orientation,
+ rwidth=rwidth,
+ log=log,
+ color=color,
+ label=label,
+ stacked=stacked,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.stairs)
+def stairs(
+ values: ArrayLike,
+ edges: ArrayLike | None = None,
+ *,
+ orientation: Literal["vertical", "horizontal"] = "vertical",
+ baseline: float | ArrayLike | None = 0,
+ fill: bool = False,
+ data=None,
+ **kwargs,
+) -> StepPatch:
+ return gca().stairs(
+ values,
+ edges=edges,
+ orientation=orientation,
+ baseline=baseline,
+ fill=fill,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.hist2d)
+def hist2d(
+ x: ArrayLike,
+ y: ArrayLike,
+ bins: None | int | tuple[int, int] | ArrayLike | tuple[ArrayLike, ArrayLike] = 10,
+ range: ArrayLike | None = None,
+ density: bool = False,
+ weights: ArrayLike | None = None,
+ cmin: float | None = None,
+ cmax: float | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray, np.ndarray, QuadMesh]:
+ __ret = gca().hist2d(
+ x,
+ y,
+ bins=bins,
+ range=range,
+ density=density,
+ weights=weights,
+ cmin=cmin,
+ cmax=cmax,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+ sci(__ret[-1])
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.hlines)
+def hlines(
+ y: float | ArrayLike,
+ xmin: float | ArrayLike,
+ xmax: float | ArrayLike,
+ colors: ColorType | Sequence[ColorType] | None = None,
+ linestyles: LineStyleType = "solid",
+ label: str = "",
+ *,
+ data=None,
+ **kwargs,
+) -> LineCollection:
+ return gca().hlines(
+ y,
+ xmin,
+ xmax,
+ colors=colors,
+ linestyles=linestyles,
+ label=label,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.imshow)
+def imshow(
+ X: ArrayLike | PIL.Image.Image,
+ cmap: str | Colormap | None = None,
+ norm: str | Normalize | None = None,
+ *,
+ aspect: Literal["equal", "auto"] | float | None = None,
+ interpolation: str | None = None,
+ alpha: float | ArrayLike | None = None,
+ vmin: float | None = None,
+ vmax: float | None = None,
+ colorizer: Colorizer | None = None,
+ origin: Literal["upper", "lower"] | None = None,
+ extent: tuple[float, float, float, float] | None = None,
+ interpolation_stage: Literal["data", "rgba", "auto"] | None = None,
+ filternorm: bool = True,
+ filterrad: float = 4.0,
+ resample: bool | None = None,
+ url: str | None = None,
+ data=None,
+ **kwargs,
+) -> AxesImage:
+ __ret = gca().imshow(
+ X,
+ cmap=cmap,
+ norm=norm,
+ aspect=aspect,
+ interpolation=interpolation,
+ alpha=alpha,
+ vmin=vmin,
+ vmax=vmax,
+ colorizer=colorizer,
+ origin=origin,
+ extent=extent,
+ interpolation_stage=interpolation_stage,
+ filternorm=filternorm,
+ filterrad=filterrad,
+ resample=resample,
+ url=url,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.legend)
+def legend(*args, **kwargs) -> Legend:
+ return gca().legend(*args, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.locator_params)
+def locator_params(
+ axis: Literal["both", "x", "y"] = "both", tight: bool | None = None, **kwargs
+) -> None:
+ gca().locator_params(axis=axis, tight=tight, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.loglog)
+def loglog(*args, **kwargs) -> list[Line2D]:
+ return gca().loglog(*args, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.magnitude_spectrum)
+def magnitude_spectrum(
+ x: ArrayLike,
+ Fs: float | None = None,
+ Fc: int | None = None,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None,
+ pad_to: int | None = None,
+ sides: Literal["default", "onesided", "twosided"] | None = None,
+ scale: Literal["default", "linear", "dB"] | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray, Line2D]:
+ return gca().magnitude_spectrum(
+ x,
+ Fs=Fs,
+ Fc=Fc,
+ window=window,
+ pad_to=pad_to,
+ sides=sides,
+ scale=scale,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.margins)
+def margins(
+ *margins: float,
+ x: float | None = None,
+ y: float | None = None,
+ tight: bool | None = True,
+) -> tuple[float, float] | None:
+ return gca().margins(*margins, x=x, y=y, tight=tight)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.minorticks_off)
+def minorticks_off() -> None:
+ gca().minorticks_off()
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.minorticks_on)
+def minorticks_on() -> None:
+ gca().minorticks_on()
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.pcolor)
+def pcolor(
+ *args: ArrayLike,
+ shading: Literal["flat", "nearest", "auto"] | None = None,
+ alpha: float | None = None,
+ norm: str | Normalize | None = None,
+ cmap: str | Colormap | None = None,
+ vmin: float | None = None,
+ vmax: float | None = None,
+ colorizer: Colorizer | None = None,
+ data=None,
+ **kwargs,
+) -> Collection:
+ __ret = gca().pcolor(
+ *args,
+ shading=shading,
+ alpha=alpha,
+ norm=norm,
+ cmap=cmap,
+ vmin=vmin,
+ vmax=vmax,
+ colorizer=colorizer,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.pcolormesh)
+def pcolormesh(
+ *args: ArrayLike,
+ alpha: float | None = None,
+ norm: str | Normalize | None = None,
+ cmap: str | Colormap | None = None,
+ vmin: float | None = None,
+ vmax: float | None = None,
+ colorizer: Colorizer | None = None,
+ shading: Literal["flat", "nearest", "gouraud", "auto"] | None = None,
+ antialiased: bool = False,
+ data=None,
+ **kwargs,
+) -> QuadMesh:
+ __ret = gca().pcolormesh(
+ *args,
+ alpha=alpha,
+ norm=norm,
+ cmap=cmap,
+ vmin=vmin,
+ vmax=vmax,
+ colorizer=colorizer,
+ shading=shading,
+ antialiased=antialiased,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.phase_spectrum)
+def phase_spectrum(
+ x: ArrayLike,
+ Fs: float | None = None,
+ Fc: int | None = None,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None,
+ pad_to: int | None = None,
+ sides: Literal["default", "onesided", "twosided"] | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray, Line2D]:
+ return gca().phase_spectrum(
+ x,
+ Fs=Fs,
+ Fc=Fc,
+ window=window,
+ pad_to=pad_to,
+ sides=sides,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.pie)
+def pie(
+ x: ArrayLike,
+ explode: ArrayLike | None = None,
+ labels: Sequence[str] | None = None,
+ colors: ColorType | Sequence[ColorType] | None = None,
+ autopct: str | Callable[[float], str] | None = None,
+ pctdistance: float = 0.6,
+ shadow: bool = False,
+ labeldistance: float | None = 1.1,
+ startangle: float = 0,
+ radius: float = 1,
+ counterclock: bool = True,
+ wedgeprops: dict[str, Any] | None = None,
+ textprops: dict[str, Any] | None = None,
+ center: tuple[float, float] = (0, 0),
+ frame: bool = False,
+ rotatelabels: bool = False,
+ *,
+ normalize: bool = True,
+ hatch: str | Sequence[str] | None = None,
+ data=None,
+) -> tuple[list[Wedge], list[Text]] | tuple[list[Wedge], list[Text], list[Text]]:
+ return gca().pie(
+ x,
+ explode=explode,
+ labels=labels,
+ colors=colors,
+ autopct=autopct,
+ pctdistance=pctdistance,
+ shadow=shadow,
+ labeldistance=labeldistance,
+ startangle=startangle,
+ radius=radius,
+ counterclock=counterclock,
+ wedgeprops=wedgeprops,
+ textprops=textprops,
+ center=center,
+ frame=frame,
+ rotatelabels=rotatelabels,
+ normalize=normalize,
+ hatch=hatch,
+ **({"data": data} if data is not None else {}),
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.plot)
+def plot(
+ *args: float | ArrayLike | str,
+ scalex: bool = True,
+ scaley: bool = True,
+ data=None,
+ **kwargs,
+) -> list[Line2D]:
+ return gca().plot(
+ *args,
+ scalex=scalex,
+ scaley=scaley,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.plot_date)
+def plot_date(
+ x: ArrayLike,
+ y: ArrayLike,
+ fmt: str = "o",
+ tz: str | datetime.tzinfo | None = None,
+ xdate: bool = True,
+ ydate: bool = False,
+ *,
+ data=None,
+ **kwargs,
+) -> list[Line2D]:
+ return gca().plot_date(
+ x,
+ y,
+ fmt=fmt,
+ tz=tz,
+ xdate=xdate,
+ ydate=ydate,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.psd)
+def psd(
+ x: ArrayLike,
+ NFFT: int | None = None,
+ Fs: float | None = None,
+ Fc: int | None = None,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike], ArrayLike]
+ | None = None,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None,
+ noverlap: int | None = None,
+ pad_to: int | None = None,
+ sides: Literal["default", "onesided", "twosided"] | None = None,
+ scale_by_freq: bool | None = None,
+ return_line: bool | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray] | tuple[np.ndarray, np.ndarray, Line2D]:
+ return gca().psd(
+ x,
+ NFFT=NFFT,
+ Fs=Fs,
+ Fc=Fc,
+ detrend=detrend,
+ window=window,
+ noverlap=noverlap,
+ pad_to=pad_to,
+ sides=sides,
+ scale_by_freq=scale_by_freq,
+ return_line=return_line,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.quiver)
+def quiver(*args, data=None, **kwargs) -> Quiver:
+ __ret = gca().quiver(
+ *args, **({"data": data} if data is not None else {}), **kwargs
+ )
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.quiverkey)
+def quiverkey(
+ Q: Quiver, X: float, Y: float, U: float, label: str, **kwargs
+) -> QuiverKey:
+ return gca().quiverkey(Q, X, Y, U, label, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.scatter)
+def scatter(
+ x: float | ArrayLike,
+ y: float | ArrayLike,
+ s: float | ArrayLike | None = None,
+ c: ArrayLike | Sequence[ColorType] | ColorType | None = None,
+ marker: MarkerType | None = None,
+ cmap: str | Colormap | None = None,
+ norm: str | Normalize | None = None,
+ vmin: float | None = None,
+ vmax: float | None = None,
+ alpha: float | None = None,
+ linewidths: float | Sequence[float] | None = None,
+ *,
+ edgecolors: Literal["face", "none"] | ColorType | Sequence[ColorType] | None = None,
+ colorizer: Colorizer | None = None,
+ plotnonfinite: bool = False,
+ data=None,
+ **kwargs,
+) -> PathCollection:
+ __ret = gca().scatter(
+ x,
+ y,
+ s=s,
+ c=c,
+ marker=marker,
+ cmap=cmap,
+ norm=norm,
+ vmin=vmin,
+ vmax=vmax,
+ alpha=alpha,
+ linewidths=linewidths,
+ edgecolors=edgecolors,
+ colorizer=colorizer,
+ plotnonfinite=plotnonfinite,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.semilogx)
+def semilogx(*args, **kwargs) -> list[Line2D]:
+ return gca().semilogx(*args, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.semilogy)
+def semilogy(*args, **kwargs) -> list[Line2D]:
+ return gca().semilogy(*args, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.specgram)
+def specgram(
+ x: ArrayLike,
+ NFFT: int | None = None,
+ Fs: float | None = None,
+ Fc: int | None = None,
+ detrend: Literal["none", "mean", "linear"]
+ | Callable[[ArrayLike], ArrayLike]
+ | None = None,
+ window: Callable[[ArrayLike], ArrayLike] | ArrayLike | None = None,
+ noverlap: int | None = None,
+ cmap: str | Colormap | None = None,
+ xextent: tuple[float, float] | None = None,
+ pad_to: int | None = None,
+ sides: Literal["default", "onesided", "twosided"] | None = None,
+ scale_by_freq: bool | None = None,
+ mode: Literal["default", "psd", "magnitude", "angle", "phase"] | None = None,
+ scale: Literal["default", "linear", "dB"] | None = None,
+ vmin: float | None = None,
+ vmax: float | None = None,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray, np.ndarray, AxesImage]:
+ __ret = gca().specgram(
+ x,
+ NFFT=NFFT,
+ Fs=Fs,
+ Fc=Fc,
+ detrend=detrend,
+ window=window,
+ noverlap=noverlap,
+ cmap=cmap,
+ xextent=xextent,
+ pad_to=pad_to,
+ sides=sides,
+ scale_by_freq=scale_by_freq,
+ mode=mode,
+ scale=scale,
+ vmin=vmin,
+ vmax=vmax,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+ sci(__ret[-1])
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.spy)
+def spy(
+ Z: ArrayLike,
+ precision: float | Literal["present"] = 0,
+ marker: str | None = None,
+ markersize: float | None = None,
+ aspect: Literal["equal", "auto"] | float | None = "equal",
+ origin: Literal["upper", "lower"] = "upper",
+ **kwargs,
+) -> AxesImage:
+ __ret = gca().spy(
+ Z,
+ precision=precision,
+ marker=marker,
+ markersize=markersize,
+ aspect=aspect,
+ origin=origin,
+ **kwargs,
+ )
+ if isinstance(__ret, _ColorizerInterface):
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.stackplot)
+def stackplot(
+ x, *args, labels=(), colors=None, hatch=None, baseline="zero", data=None, **kwargs
+):
+ return gca().stackplot(
+ x,
+ *args,
+ labels=labels,
+ colors=colors,
+ hatch=hatch,
+ baseline=baseline,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.stem)
+def stem(
+ *args: ArrayLike | str,
+ linefmt: str | None = None,
+ markerfmt: str | None = None,
+ basefmt: str | None = None,
+ bottom: float = 0,
+ label: str | None = None,
+ orientation: Literal["vertical", "horizontal"] = "vertical",
+ data=None,
+) -> StemContainer:
+ return gca().stem(
+ *args,
+ linefmt=linefmt,
+ markerfmt=markerfmt,
+ basefmt=basefmt,
+ bottom=bottom,
+ label=label,
+ orientation=orientation,
+ **({"data": data} if data is not None else {}),
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.step)
+def step(
+ x: ArrayLike,
+ y: ArrayLike,
+ *args,
+ where: Literal["pre", "post", "mid"] = "pre",
+ data=None,
+ **kwargs,
+) -> list[Line2D]:
+ return gca().step(
+ x,
+ y,
+ *args,
+ where=where,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.streamplot)
+def streamplot(
+ x,
+ y,
+ u,
+ v,
+ density=1,
+ linewidth=None,
+ color=None,
+ cmap=None,
+ norm=None,
+ arrowsize=1,
+ arrowstyle="-|>",
+ minlength=0.1,
+ transform=None,
+ zorder=None,
+ start_points=None,
+ maxlength=4.0,
+ integration_direction="both",
+ broken_streamlines=True,
+ *,
+ data=None,
+):
+ __ret = gca().streamplot(
+ x,
+ y,
+ u,
+ v,
+ density=density,
+ linewidth=linewidth,
+ color=color,
+ cmap=cmap,
+ norm=norm,
+ arrowsize=arrowsize,
+ arrowstyle=arrowstyle,
+ minlength=minlength,
+ transform=transform,
+ zorder=zorder,
+ start_points=start_points,
+ maxlength=maxlength,
+ integration_direction=integration_direction,
+ broken_streamlines=broken_streamlines,
+ **({"data": data} if data is not None else {}),
+ )
+ sci(__ret.lines)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.table)
+def table(
+ cellText=None,
+ cellColours=None,
+ cellLoc="right",
+ colWidths=None,
+ rowLabels=None,
+ rowColours=None,
+ rowLoc="left",
+ colLabels=None,
+ colColours=None,
+ colLoc="center",
+ loc="bottom",
+ bbox=None,
+ edges="closed",
+ **kwargs,
+):
+ return gca().table(
+ cellText=cellText,
+ cellColours=cellColours,
+ cellLoc=cellLoc,
+ colWidths=colWidths,
+ rowLabels=rowLabels,
+ rowColours=rowColours,
+ rowLoc=rowLoc,
+ colLabels=colLabels,
+ colColours=colColours,
+ colLoc=colLoc,
+ loc=loc,
+ bbox=bbox,
+ edges=edges,
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.text)
+def text(
+ x: float, y: float, s: str, fontdict: dict[str, Any] | None = None, **kwargs
+) -> Text:
+ return gca().text(x, y, s, fontdict=fontdict, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.tick_params)
+def tick_params(axis: Literal["both", "x", "y"] = "both", **kwargs) -> None:
+ gca().tick_params(axis=axis, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.ticklabel_format)
+def ticklabel_format(
+ *,
+ axis: Literal["both", "x", "y"] = "both",
+ style: Literal["", "sci", "scientific", "plain"] | None = None,
+ scilimits: tuple[int, int] | None = None,
+ useOffset: bool | float | None = None,
+ useLocale: bool | None = None,
+ useMathText: bool | None = None,
+) -> None:
+ gca().ticklabel_format(
+ axis=axis,
+ style=style,
+ scilimits=scilimits,
+ useOffset=useOffset,
+ useLocale=useLocale,
+ useMathText=useMathText,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.tricontour)
+def tricontour(*args, **kwargs):
+ __ret = gca().tricontour(*args, **kwargs)
+ if __ret._A is not None: # type: ignore[attr-defined]
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.tricontourf)
+def tricontourf(*args, **kwargs):
+ __ret = gca().tricontourf(*args, **kwargs)
+ if __ret._A is not None: # type: ignore[attr-defined]
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.tripcolor)
+def tripcolor(
+ *args,
+ alpha=1.0,
+ norm=None,
+ cmap=None,
+ vmin=None,
+ vmax=None,
+ shading="flat",
+ facecolors=None,
+ **kwargs,
+):
+ __ret = gca().tripcolor(
+ *args,
+ alpha=alpha,
+ norm=norm,
+ cmap=cmap,
+ vmin=vmin,
+ vmax=vmax,
+ shading=shading,
+ facecolors=facecolors,
+ **kwargs,
+ )
+ sci(__ret)
+ return __ret
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.triplot)
+def triplot(*args, **kwargs):
+ return gca().triplot(*args, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.violinplot)
+def violinplot(
+ dataset: ArrayLike | Sequence[ArrayLike],
+ positions: ArrayLike | None = None,
+ vert: bool | None = None,
+ orientation: Literal["vertical", "horizontal"] = "vertical",
+ widths: float | ArrayLike = 0.5,
+ showmeans: bool = False,
+ showextrema: bool = True,
+ showmedians: bool = False,
+ quantiles: Sequence[float | Sequence[float]] | None = None,
+ points: int = 100,
+ bw_method: Literal["scott", "silverman"]
+ | float
+ | Callable[[GaussianKDE], float]
+ | None = None,
+ side: Literal["both", "low", "high"] = "both",
+ *,
+ data=None,
+) -> dict[str, Collection]:
+ return gca().violinplot(
+ dataset,
+ positions=positions,
+ vert=vert,
+ orientation=orientation,
+ widths=widths,
+ showmeans=showmeans,
+ showextrema=showextrema,
+ showmedians=showmedians,
+ quantiles=quantiles,
+ points=points,
+ bw_method=bw_method,
+ side=side,
+ **({"data": data} if data is not None else {}),
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.vlines)
+def vlines(
+ x: float | ArrayLike,
+ ymin: float | ArrayLike,
+ ymax: float | ArrayLike,
+ colors: ColorType | Sequence[ColorType] | None = None,
+ linestyles: LineStyleType = "solid",
+ label: str = "",
+ *,
+ data=None,
+ **kwargs,
+) -> LineCollection:
+ return gca().vlines(
+ x,
+ ymin,
+ ymax,
+ colors=colors,
+ linestyles=linestyles,
+ label=label,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.xcorr)
+def xcorr(
+ x: ArrayLike,
+ y: ArrayLike,
+ normed: bool = True,
+ detrend: Callable[[ArrayLike], ArrayLike] = mlab.detrend_none,
+ usevlines: bool = True,
+ maxlags: int = 10,
+ *,
+ data=None,
+ **kwargs,
+) -> tuple[np.ndarray, np.ndarray, LineCollection | Line2D, Line2D | None]:
+ return gca().xcorr(
+ x,
+ y,
+ normed=normed,
+ detrend=detrend,
+ usevlines=usevlines,
+ maxlags=maxlags,
+ **({"data": data} if data is not None else {}),
+ **kwargs,
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes._sci)
+def sci(im: ColorizingArtist) -> None:
+ gca()._sci(im)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.set_title)
+def title(
+ label: str,
+ fontdict: dict[str, Any] | None = None,
+ loc: Literal["left", "center", "right"] | None = None,
+ pad: float | None = None,
+ *,
+ y: float | None = None,
+ **kwargs,
+) -> Text:
+ return gca().set_title(label, fontdict=fontdict, loc=loc, pad=pad, y=y, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.set_xlabel)
+def xlabel(
+ xlabel: str,
+ fontdict: dict[str, Any] | None = None,
+ labelpad: float | None = None,
+ *,
+ loc: Literal["left", "center", "right"] | None = None,
+ **kwargs,
+) -> Text:
+ return gca().set_xlabel(
+ xlabel, fontdict=fontdict, labelpad=labelpad, loc=loc, **kwargs
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.set_ylabel)
+def ylabel(
+ ylabel: str,
+ fontdict: dict[str, Any] | None = None,
+ labelpad: float | None = None,
+ *,
+ loc: Literal["bottom", "center", "top"] | None = None,
+ **kwargs,
+) -> Text:
+ return gca().set_ylabel(
+ ylabel, fontdict=fontdict, labelpad=labelpad, loc=loc, **kwargs
+ )
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.set_xscale)
+def xscale(value: str | ScaleBase, **kwargs) -> None:
+ gca().set_xscale(value, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+@_copy_docstring_and_deprecators(Axes.set_yscale)
+def yscale(value: str | ScaleBase, **kwargs) -> None:
+ gca().set_yscale(value, **kwargs)
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def autumn() -> None:
+ """
+ Set the colormap to 'autumn'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("autumn")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def bone() -> None:
+ """
+ Set the colormap to 'bone'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("bone")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def cool() -> None:
+ """
+ Set the colormap to 'cool'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("cool")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def copper() -> None:
+ """
+ Set the colormap to 'copper'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("copper")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def flag() -> None:
+ """
+ Set the colormap to 'flag'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("flag")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def gray() -> None:
+ """
+ Set the colormap to 'gray'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("gray")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def hot() -> None:
+ """
+ Set the colormap to 'hot'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("hot")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def hsv() -> None:
+ """
+ Set the colormap to 'hsv'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("hsv")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def jet() -> None:
+ """
+ Set the colormap to 'jet'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("jet")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def pink() -> None:
+ """
+ Set the colormap to 'pink'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("pink")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def prism() -> None:
+ """
+ Set the colormap to 'prism'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("prism")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def spring() -> None:
+ """
+ Set the colormap to 'spring'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("spring")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def summer() -> None:
+ """
+ Set the colormap to 'summer'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("summer")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def winter() -> None:
+ """
+ Set the colormap to 'winter'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("winter")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def magma() -> None:
+ """
+ Set the colormap to 'magma'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("magma")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def inferno() -> None:
+ """
+ Set the colormap to 'inferno'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("inferno")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def plasma() -> None:
+ """
+ Set the colormap to 'plasma'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("plasma")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def viridis() -> None:
+ """
+ Set the colormap to 'viridis'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("viridis")
+
+
+# Autogenerated by boilerplate.py. Do not edit as changes will be lost.
+def nipy_spectral() -> None:
+ """
+ Set the colormap to 'nipy_spectral'.
+
+ This changes the default colormap as well as the colormap of the current
+ image if there is one. See ``help(colormaps)`` for more information.
+ """
+ set_cmap("nipy_spectral")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/quiver.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/quiver.py
new file mode 100644
index 0000000000000000000000000000000000000000..e66f1f97b21f65ac3cdeaadd4ff6ef4b74ddaed8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/quiver.py
@@ -0,0 +1,1228 @@
+"""
+Support for plotting vector fields.
+
+Presently this contains Quiver and Barb. Quiver plots an arrow in the
+direction of the vector, with the size of the arrow related to the
+magnitude of the vector.
+
+Barbs are like quiver in that they point along a vector, but
+the magnitude of the vector is given schematically by the presence of barbs
+or flags on the barb.
+
+This will also become a home for things such as standard
+deviation ellipses, which can and will be derived very easily from
+the Quiver code.
+"""
+
+import math
+
+import numpy as np
+from numpy import ma
+
+from matplotlib import _api, cbook, _docstring
+import matplotlib.artist as martist
+import matplotlib.collections as mcollections
+from matplotlib.patches import CirclePolygon
+import matplotlib.text as mtext
+import matplotlib.transforms as transforms
+
+
+_quiver_doc = """
+Plot a 2D field of arrows.
+
+Call signature::
+
+ quiver([X, Y], U, V, [C], /, **kwargs)
+
+*X*, *Y* define the arrow locations, *U*, *V* define the arrow directions, and
+*C* optionally sets the color. The arguments *X*, *Y*, *U*, *V*, *C* are
+positional-only.
+
+**Arrow length**
+
+The default settings auto-scales the length of the arrows to a reasonable size.
+To change this behavior see the *scale* and *scale_units* parameters.
+
+**Arrow shape**
+
+The arrow shape is determined by *width*, *headwidth*, *headlength* and
+*headaxislength*. See the notes below.
+
+**Arrow styling**
+
+Each arrow is internally represented by a filled polygon with a default edge
+linewidth of 0. As a result, an arrow is rather a filled area, not a line with
+a head, and `.PolyCollection` properties like *linewidth*, *edgecolor*,
+*facecolor*, etc. act accordingly.
+
+
+Parameters
+----------
+X, Y : 1D or 2D array-like, optional
+ The x and y coordinates of the arrow locations.
+
+ If not given, they will be generated as a uniform integer meshgrid based
+ on the dimensions of *U* and *V*.
+
+ If *X* and *Y* are 1D but *U*, *V* are 2D, *X*, *Y* are expanded to 2D
+ using ``X, Y = np.meshgrid(X, Y)``. In this case ``len(X)`` and ``len(Y)``
+ must match the column and row dimensions of *U* and *V*.
+
+U, V : 1D or 2D array-like
+ The x and y direction components of the arrow vectors. The interpretation
+ of these components (in data or in screen space) depends on *angles*.
+
+ *U* and *V* must have the same number of elements, matching the number of
+ arrow locations in *X*, *Y*. *U* and *V* may be masked. Locations masked
+ in any of *U*, *V*, and *C* will not be drawn.
+
+C : 1D or 2D array-like, optional
+ Numeric data that defines the arrow colors by colormapping via *norm* and
+ *cmap*.
+
+ This does not support explicit colors. If you want to set colors directly,
+ use *color* instead. The size of *C* must match the number of arrow
+ locations.
+
+angles : {'uv', 'xy'} or array-like, default: 'uv'
+ Method for determining the angle of the arrows.
+
+ - 'uv': Arrow directions are based on
+ :ref:`display coordinates `; i.e. a 45° angle will
+ always show up as diagonal on the screen, irrespective of figure or Axes
+ aspect ratio or Axes data ranges. This is useful when the arrows represent
+ a quantity whose direction is not tied to the x and y data coordinates.
+
+ If *U* == *V* the orientation of the arrow on the plot is 45 degrees
+ counter-clockwise from the horizontal axis (positive to the right).
+
+ - 'xy': Arrow direction in data coordinates, i.e. the arrows point from
+ (x, y) to (x+u, y+v). This is ideal for vector fields or gradient plots
+ where the arrows should directly represent movements or gradients in the
+ x and y directions.
+
+ - Arbitrary angles may be specified explicitly as an array of values
+ in degrees, counter-clockwise from the horizontal axis.
+
+ In this case *U*, *V* is only used to determine the length of the
+ arrows.
+
+ For example, ``angles=[30, 60, 90]`` will orient the arrows at 30, 60, and 90
+ degrees respectively, regardless of the *U* and *V* components.
+
+ Note: inverting a data axis will correspondingly invert the
+ arrows only with ``angles='xy'``.
+
+pivot : {'tail', 'mid', 'middle', 'tip'}, default: 'tail'
+ The part of the arrow that is anchored to the *X*, *Y* grid. The arrow
+ rotates about this point.
+
+ 'mid' is a synonym for 'middle'.
+
+scale : float, optional
+ Scales the length of the arrow inversely.
+
+ Number of data values represented by one unit of arrow length on the plot.
+ For example, if the data represents velocity in meters per second (m/s), the
+ scale parameter determines how many meters per second correspond to one unit of
+ arrow length relative to the width of the plot.
+ Smaller scale parameter makes the arrow longer.
+
+ By default, an autoscaling algorithm is used to scale the arrow length to a
+ reasonable size, which is based on the average vector length and the number of
+ vectors.
+
+ The arrow length unit is given by the *scale_units* parameter.
+
+scale_units : {'width', 'height', 'dots', 'inches', 'x', 'y', 'xy'}, default: 'width'
+
+ The physical image unit, which is used for rendering the scaled arrow data *U*, *V*.
+
+ The rendered arrow length is given by
+
+ length in x direction = $\\frac{u}{\\mathrm{scale}} \\mathrm{scale_unit}$
+
+ length in y direction = $\\frac{v}{\\mathrm{scale}} \\mathrm{scale_unit}$
+
+ For example, ``(u, v) = (0.5, 0)`` with ``scale=10, scale_unit="width"`` results
+ in a horizontal arrow with a length of *0.5 / 10 * "width"*, i.e. 0.05 times the
+ Axes width.
+
+ Supported values are:
+
+ - 'width' or 'height': The arrow length is scaled relative to the width or height
+ of the Axes.
+ For example, ``scale_units='width', scale=1.0``, will result in an arrow length
+ of width of the Axes.
+
+ - 'dots': The arrow length of the arrows is in measured in display dots (pixels).
+
+ - 'inches': Arrow lengths are scaled based on the DPI (dots per inch) of the figure.
+ This ensures that the arrows have a consistent physical size on the figure,
+ in inches, regardless of data values or plot scaling.
+ For example, ``(u, v) = (1, 0)`` with ``scale_units='inches', scale=2`` results
+ in a 0.5 inch-long arrow.
+
+ - 'x' or 'y': The arrow length is scaled relative to the x or y axis units.
+ For example, ``(u, v) = (0, 1)`` with ``scale_units='x', scale=1`` results
+ in a vertical arrow with the length of 1 x-axis unit.
+
+ - 'xy': Arrow length will be same as 'x' or 'y' units.
+ This is useful for creating vectors in the x-y plane where u and v have
+ the same units as x and y. To plot vectors in the x-y plane with u and v having
+ the same units as x and y, use ``angles='xy', scale_units='xy', scale=1``.
+
+ Note: Setting *scale_units* without setting scale does not have any effect because
+ the scale units only differ by a constant factor and that is rescaled through
+ autoscaling.
+
+units : {'width', 'height', 'dots', 'inches', 'x', 'y', 'xy'}, default: 'width'
+ Affects the arrow size (except for the length). In particular, the shaft
+ *width* is measured in multiples of this unit.
+
+ Supported values are:
+
+ - 'width', 'height': The width or height of the Axes.
+ - 'dots', 'inches': Pixels or inches based on the figure dpi.
+ - 'x', 'y', 'xy': *X*, *Y* or :math:`\\sqrt{X^2 + Y^2}` in data units.
+
+ The following table summarizes how these values affect the visible arrow
+ size under zooming and figure size changes:
+
+ ================= ================= ==================
+ units zoom figure size change
+ ================= ================= ==================
+ 'x', 'y', 'xy' arrow size scales ā
+ 'width', 'height' ā arrow size scales
+ 'dots', 'inches' ā ā
+ ================= ================= ==================
+
+width : float, optional
+ Shaft width in arrow units. All head parameters are relative to *width*.
+
+ The default depends on choice of *units* above, and number of vectors;
+ a typical starting value is about 0.005 times the width of the plot.
+
+headwidth : float, default: 3
+ Head width as multiple of shaft *width*. See the notes below.
+
+headlength : float, default: 5
+ Head length as multiple of shaft *width*. See the notes below.
+
+headaxislength : float, default: 4.5
+ Head length at shaft intersection as multiple of shaft *width*.
+ See the notes below.
+
+minshaft : float, default: 1
+ Length below which arrow scales, in units of head length. Do not
+ set this to less than 1, or small arrows will look terrible!
+
+minlength : float, default: 1
+ Minimum length as a multiple of shaft width; if an arrow length
+ is less than this, plot a dot (hexagon) of this diameter instead.
+
+color : :mpltype:`color` or list :mpltype:`color`, optional
+ Explicit color(s) for the arrows. If *C* has been set, *color* has no
+ effect.
+
+ This is a synonym for the `.PolyCollection` *facecolor* parameter.
+
+Other Parameters
+----------------
+data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+**kwargs : `~matplotlib.collections.PolyCollection` properties, optional
+ All other keyword arguments are passed on to `.PolyCollection`:
+
+ %(PolyCollection:kwdoc)s
+
+Returns
+-------
+`~matplotlib.quiver.Quiver`
+
+See Also
+--------
+.Axes.quiverkey : Add a key to a quiver plot.
+
+Notes
+-----
+
+**Arrow shape**
+
+The arrow is drawn as a polygon using the nodes as shown below. The values
+*headwidth*, *headlength*, and *headaxislength* are in units of *width*.
+
+.. image:: /_static/quiver_sizes.svg
+ :width: 500px
+
+The defaults give a slightly swept-back arrow. Here are some guidelines how to
+get other head shapes:
+
+- To make the head a triangle, make *headaxislength* the same as *headlength*.
+- To make the arrow more pointed, reduce *headwidth* or increase *headlength*
+ and *headaxislength*.
+- To make the head smaller relative to the shaft, scale down all the head
+ parameters proportionally.
+- To remove the head completely, set all *head* parameters to 0.
+- To get a diamond-shaped head, make *headaxislength* larger than *headlength*.
+- Warning: For *headaxislength* < (*headlength* / *headwidth*), the "headaxis"
+ nodes (i.e. the ones connecting the head with the shaft) will protrude out
+ of the head in forward direction so that the arrow head looks broken.
+""" % _docstring.interpd.params
+
+_docstring.interpd.register(quiver_doc=_quiver_doc)
+
+
+class QuiverKey(martist.Artist):
+ """Labelled arrow for use as a quiver plot scale key."""
+ halign = {'N': 'center', 'S': 'center', 'E': 'left', 'W': 'right'}
+ valign = {'N': 'bottom', 'S': 'top', 'E': 'center', 'W': 'center'}
+ pivot = {'N': 'middle', 'S': 'middle', 'E': 'tip', 'W': 'tail'}
+
+ def __init__(self, Q, X, Y, U, label,
+ *, angle=0, coordinates='axes', color=None, labelsep=0.1,
+ labelpos='N', labelcolor=None, fontproperties=None,
+ zorder=None, **kwargs):
+ """
+ Add a key to a quiver plot.
+
+ The positioning of the key depends on *X*, *Y*, *coordinates*, and
+ *labelpos*. If *labelpos* is 'N' or 'S', *X*, *Y* give the position of
+ the middle of the key arrow. If *labelpos* is 'E', *X*, *Y* positions
+ the head, and if *labelpos* is 'W', *X*, *Y* positions the tail; in
+ either of these two cases, *X*, *Y* is somewhere in the middle of the
+ arrow+label key object.
+
+ Parameters
+ ----------
+ Q : `~matplotlib.quiver.Quiver`
+ A `.Quiver` object as returned by a call to `~.Axes.quiver()`.
+ X, Y : float
+ The location of the key.
+ U : float
+ The length of the key.
+ label : str
+ The key label (e.g., length and units of the key).
+ angle : float, default: 0
+ The angle of the key arrow, in degrees anti-clockwise from the
+ horizontal axis.
+ coordinates : {'axes', 'figure', 'data', 'inches'}, default: 'axes'
+ Coordinate system and units for *X*, *Y*: 'axes' and 'figure' are
+ normalized coordinate systems with (0, 0) in the lower left and
+ (1, 1) in the upper right; 'data' are the axes data coordinates
+ (used for the locations of the vectors in the quiver plot itself);
+ 'inches' is position in the figure in inches, with (0, 0) at the
+ lower left corner.
+ color : :mpltype:`color`
+ Overrides face and edge colors from *Q*.
+ labelpos : {'N', 'S', 'E', 'W'}
+ Position the label above, below, to the right, to the left of the
+ arrow, respectively.
+ labelsep : float, default: 0.1
+ Distance in inches between the arrow and the label.
+ labelcolor : :mpltype:`color`, default: :rc:`text.color`
+ Label color.
+ fontproperties : dict, optional
+ A dictionary with keyword arguments accepted by the
+ `~matplotlib.font_manager.FontProperties` initializer:
+ *family*, *style*, *variant*, *size*, *weight*.
+ zorder : float
+ The zorder of the key. The default is 0.1 above *Q*.
+ **kwargs
+ Any additional keyword arguments are used to override vector
+ properties taken from *Q*.
+ """
+ super().__init__()
+ self.Q = Q
+ self.X = X
+ self.Y = Y
+ self.U = U
+ self.angle = angle
+ self.coord = coordinates
+ self.color = color
+ self.label = label
+ self._labelsep_inches = labelsep
+
+ self.labelpos = labelpos
+ self.labelcolor = labelcolor
+ self.fontproperties = fontproperties or dict()
+ self.kw = kwargs
+ self.text = mtext.Text(
+ text=label,
+ horizontalalignment=self.halign[self.labelpos],
+ verticalalignment=self.valign[self.labelpos],
+ fontproperties=self.fontproperties)
+ if self.labelcolor is not None:
+ self.text.set_color(self.labelcolor)
+ self._dpi_at_last_init = None
+ self.zorder = zorder if zorder is not None else Q.zorder + 0.1
+
+ @property
+ def labelsep(self):
+ return self._labelsep_inches * self.Q.axes.get_figure(root=True).dpi
+
+ def _init(self):
+ if True: # self._dpi_at_last_init != self.axes.get_figure().dpi
+ if self.Q._dpi_at_last_init != self.Q.axes.get_figure(root=True).dpi:
+ self.Q._init()
+ self._set_transform()
+ with cbook._setattr_cm(self.Q, pivot=self.pivot[self.labelpos],
+ # Hack: save and restore the Umask
+ Umask=ma.nomask):
+ u = self.U * np.cos(np.radians(self.angle))
+ v = self.U * np.sin(np.radians(self.angle))
+ self.verts = self.Q._make_verts([[0., 0.]],
+ np.array([u]), np.array([v]), 'uv')
+ kwargs = self.Q.polykw
+ kwargs.update(self.kw)
+ self.vector = mcollections.PolyCollection(
+ self.verts,
+ offsets=[(self.X, self.Y)],
+ offset_transform=self.get_transform(),
+ **kwargs)
+ if self.color is not None:
+ self.vector.set_color(self.color)
+ self.vector.set_transform(self.Q.get_transform())
+ self.vector.set_figure(self.get_figure())
+ self._dpi_at_last_init = self.Q.axes.get_figure(root=True).dpi
+
+ def _text_shift(self):
+ return {
+ "N": (0, +self.labelsep),
+ "S": (0, -self.labelsep),
+ "E": (+self.labelsep, 0),
+ "W": (-self.labelsep, 0),
+ }[self.labelpos]
+
+ @martist.allow_rasterization
+ def draw(self, renderer):
+ self._init()
+ self.vector.draw(renderer)
+ pos = self.get_transform().transform((self.X, self.Y))
+ self.text.set_position(pos + self._text_shift())
+ self.text.draw(renderer)
+ self.stale = False
+
+ def _set_transform(self):
+ fig = self.Q.axes.get_figure(root=False)
+ self.set_transform(_api.check_getitem({
+ "data": self.Q.axes.transData,
+ "axes": self.Q.axes.transAxes,
+ "figure": fig.transFigure,
+ "inches": fig.dpi_scale_trans,
+ }, coordinates=self.coord))
+
+ def set_figure(self, fig):
+ super().set_figure(fig)
+ self.text.set_figure(fig)
+
+ def contains(self, mouseevent):
+ if self._different_canvas(mouseevent):
+ return False, {}
+ # Maybe the dictionary should allow one to
+ # distinguish between a text hit and a vector hit.
+ if (self.text.contains(mouseevent)[0] or
+ self.vector.contains(mouseevent)[0]):
+ return True, {}
+ return False, {}
+
+
+def _parse_args(*args, caller_name='function'):
+ """
+ Helper function to parse positional parameters for colored vector plots.
+
+ This is currently used for Quiver and Barbs.
+
+ Parameters
+ ----------
+ *args : list
+ list of 2-5 arguments. Depending on their number they are parsed to::
+
+ U, V
+ U, V, C
+ X, Y, U, V
+ X, Y, U, V, C
+
+ caller_name : str
+ Name of the calling method (used in error messages).
+ """
+ X = Y = C = None
+
+ nargs = len(args)
+ if nargs == 2:
+ # The use of atleast_1d allows for handling scalar arguments while also
+ # keeping masked arrays
+ U, V = np.atleast_1d(*args)
+ elif nargs == 3:
+ U, V, C = np.atleast_1d(*args)
+ elif nargs == 4:
+ X, Y, U, V = np.atleast_1d(*args)
+ elif nargs == 5:
+ X, Y, U, V, C = np.atleast_1d(*args)
+ else:
+ raise _api.nargs_error(caller_name, takes="from 2 to 5", given=nargs)
+
+ nr, nc = (1, U.shape[0]) if U.ndim == 1 else U.shape
+
+ if X is not None:
+ X = X.ravel()
+ Y = Y.ravel()
+ if len(X) == nc and len(Y) == nr:
+ X, Y = (a.ravel() for a in np.meshgrid(X, Y))
+ elif len(X) != len(Y):
+ raise ValueError('X and Y must be the same size, but '
+ f'X.size is {X.size} and Y.size is {Y.size}.')
+ else:
+ indexgrid = np.meshgrid(np.arange(nc), np.arange(nr))
+ X, Y = (np.ravel(a) for a in indexgrid)
+ # Size validation for U, V, C is left to the set_UVC method.
+ return X, Y, U, V, C
+
+
+def _check_consistent_shapes(*arrays):
+ all_shapes = {a.shape for a in arrays}
+ if len(all_shapes) != 1:
+ raise ValueError('The shapes of the passed in arrays do not match')
+
+
+class Quiver(mcollections.PolyCollection):
+ """
+ Specialized PolyCollection for arrows.
+
+ The only API method is set_UVC(), which can be used
+ to change the size, orientation, and color of the
+ arrows; their locations are fixed when the class is
+ instantiated. Possibly this method will be useful
+ in animations.
+
+ Much of the work in this class is done in the draw()
+ method so that as much information as possible is available
+ about the plot. In subsequent draw() calls, recalculation
+ is limited to things that might have changed, so there
+ should be no performance penalty from putting the calculations
+ in the draw() method.
+ """
+
+ _PIVOT_VALS = ('tail', 'middle', 'tip')
+
+ @_docstring.Substitution(_quiver_doc)
+ def __init__(self, ax, *args,
+ scale=None, headwidth=3, headlength=5, headaxislength=4.5,
+ minshaft=1, minlength=1, units='width', scale_units=None,
+ angles='uv', width=None, color='k', pivot='tail', **kwargs):
+ """
+ The constructor takes one required argument, an Axes
+ instance, followed by the args and kwargs described
+ by the following pyplot interface documentation:
+ %s
+ """
+ self._axes = ax # The attr actually set by the Artist.axes property.
+ X, Y, U, V, C = _parse_args(*args, caller_name='quiver')
+ self.X = X
+ self.Y = Y
+ self.XY = np.column_stack((X, Y))
+ self.N = len(X)
+ self.scale = scale
+ self.headwidth = headwidth
+ self.headlength = float(headlength)
+ self.headaxislength = headaxislength
+ self.minshaft = minshaft
+ self.minlength = minlength
+ self.units = units
+ self.scale_units = scale_units
+ self.angles = angles
+ self.width = width
+
+ if pivot.lower() == 'mid':
+ pivot = 'middle'
+ self.pivot = pivot.lower()
+ _api.check_in_list(self._PIVOT_VALS, pivot=self.pivot)
+
+ self.transform = kwargs.pop('transform', ax.transData)
+ kwargs.setdefault('facecolors', color)
+ kwargs.setdefault('linewidths', (0,))
+ super().__init__([], offsets=self.XY, offset_transform=self.transform,
+ closed=False, **kwargs)
+ self.polykw = kwargs
+ self.set_UVC(U, V, C)
+ self._dpi_at_last_init = None
+
+ def _init(self):
+ """
+ Initialization delayed until first draw;
+ allow time for axes setup.
+ """
+ # It seems that there are not enough event notifications
+ # available to have this work on an as-needed basis at present.
+ if True: # self._dpi_at_last_init != self.axes.figure.dpi
+ trans = self._set_transform()
+ self.span = trans.inverted().transform_bbox(self.axes.bbox).width
+ if self.width is None:
+ sn = np.clip(math.sqrt(self.N), 8, 25)
+ self.width = 0.06 * self.span / sn
+
+ # _make_verts sets self.scale if not already specified
+ if (self._dpi_at_last_init != self.axes.get_figure(root=True).dpi
+ and self.scale is None):
+ self._make_verts(self.XY, self.U, self.V, self.angles)
+
+ self._dpi_at_last_init = self.axes.get_figure(root=True).dpi
+
+ def get_datalim(self, transData):
+ trans = self.get_transform()
+ offset_trf = self.get_offset_transform()
+ full_transform = (trans - transData) + (offset_trf - transData)
+ XY = full_transform.transform(self.XY)
+ bbox = transforms.Bbox.null()
+ bbox.update_from_data_xy(XY, ignore=True)
+ return bbox
+
+ @martist.allow_rasterization
+ def draw(self, renderer):
+ self._init()
+ verts = self._make_verts(self.XY, self.U, self.V, self.angles)
+ self.set_verts(verts, closed=False)
+ super().draw(renderer)
+ self.stale = False
+
+ def set_UVC(self, U, V, C=None):
+ # We need to ensure we have a copy, not a reference
+ # to an array that might change before draw().
+ U = ma.masked_invalid(U, copy=True).ravel()
+ V = ma.masked_invalid(V, copy=True).ravel()
+ if C is not None:
+ C = ma.masked_invalid(C, copy=True).ravel()
+ for name, var in zip(('U', 'V', 'C'), (U, V, C)):
+ if not (var is None or var.size == self.N or var.size == 1):
+ raise ValueError(f'Argument {name} has a size {var.size}'
+ f' which does not match {self.N},'
+ ' the number of arrow positions')
+
+ mask = ma.mask_or(U.mask, V.mask, copy=False, shrink=True)
+ if C is not None:
+ mask = ma.mask_or(mask, C.mask, copy=False, shrink=True)
+ if mask is ma.nomask:
+ C = C.filled()
+ else:
+ C = ma.array(C, mask=mask, copy=False)
+ self.U = U.filled(1)
+ self.V = V.filled(1)
+ self.Umask = mask
+ if C is not None:
+ self.set_array(C)
+ self.stale = True
+
+ def _dots_per_unit(self, units):
+ """Return a scale factor for converting from units to pixels."""
+ bb = self.axes.bbox
+ vl = self.axes.viewLim
+ return _api.check_getitem({
+ 'x': bb.width / vl.width,
+ 'y': bb.height / vl.height,
+ 'xy': np.hypot(*bb.size) / np.hypot(*vl.size),
+ 'width': bb.width,
+ 'height': bb.height,
+ 'dots': 1.,
+ 'inches': self.axes.get_figure(root=True).dpi,
+ }, units=units)
+
+ def _set_transform(self):
+ """
+ Set the PolyCollection transform to go
+ from arrow width units to pixels.
+ """
+ dx = self._dots_per_unit(self.units)
+ self._trans_scale = dx # pixels per arrow width unit
+ trans = transforms.Affine2D().scale(dx)
+ self.set_transform(trans)
+ return trans
+
+ # Calculate angles and lengths for segment between (x, y), (x+u, y+v)
+ def _angles_lengths(self, XY, U, V, eps=1):
+ xy = self.axes.transData.transform(XY)
+ uv = np.column_stack((U, V))
+ xyp = self.axes.transData.transform(XY + eps * uv)
+ dxy = xyp - xy
+ angles = np.arctan2(dxy[:, 1], dxy[:, 0])
+ lengths = np.hypot(*dxy.T) / eps
+ return angles, lengths
+
+ # XY is stacked [X, Y].
+ # See quiver() doc for meaning of X, Y, U, V, angles.
+ def _make_verts(self, XY, U, V, angles):
+ uv = (U + V * 1j)
+ str_angles = angles if isinstance(angles, str) else ''
+ if str_angles == 'xy' and self.scale_units == 'xy':
+ # Here eps is 1 so that if we get U, V by diffing
+ # the X, Y arrays, the vectors will connect the
+ # points, regardless of the axis scaling (including log).
+ angles, lengths = self._angles_lengths(XY, U, V, eps=1)
+ elif str_angles == 'xy' or self.scale_units == 'xy':
+ # Calculate eps based on the extents of the plot
+ # so that we don't end up with roundoff error from
+ # adding a small number to a large.
+ eps = np.abs(self.axes.dataLim.extents).max() * 0.001
+ angles, lengths = self._angles_lengths(XY, U, V, eps=eps)
+
+ if str_angles and self.scale_units == 'xy':
+ a = lengths
+ else:
+ a = np.abs(uv)
+
+ if self.scale is None:
+ sn = max(10, math.sqrt(self.N))
+ if self.Umask is not ma.nomask:
+ amean = a[~self.Umask].mean()
+ else:
+ amean = a.mean()
+ # crude auto-scaling
+ # scale is typical arrow length as a multiple of the arrow width
+ scale = 1.8 * amean * sn / self.span
+
+ if self.scale_units is None:
+ if self.scale is None:
+ self.scale = scale
+ widthu_per_lenu = 1.0
+ else:
+ if self.scale_units == 'xy':
+ dx = 1
+ else:
+ dx = self._dots_per_unit(self.scale_units)
+ widthu_per_lenu = dx / self._trans_scale
+ if self.scale is None:
+ self.scale = scale * widthu_per_lenu
+ length = a * (widthu_per_lenu / (self.scale * self.width))
+ X, Y = self._h_arrows(length)
+ if str_angles == 'xy':
+ theta = angles
+ elif str_angles == 'uv':
+ theta = np.angle(uv)
+ else:
+ theta = ma.masked_invalid(np.deg2rad(angles)).filled(0)
+ theta = theta.reshape((-1, 1)) # for broadcasting
+ xy = (X + Y * 1j) * np.exp(1j * theta) * self.width
+ XY = np.stack((xy.real, xy.imag), axis=2)
+ if self.Umask is not ma.nomask:
+ XY = ma.array(XY)
+ XY[self.Umask] = ma.masked
+ # This might be handled more efficiently with nans, given
+ # that nans will end up in the paths anyway.
+
+ return XY
+
+ def _h_arrows(self, length):
+ """Length is in arrow width units."""
+ # It might be possible to streamline the code
+ # and speed it up a bit by using complex (x, y)
+ # instead of separate arrays; but any gain would be slight.
+ minsh = self.minshaft * self.headlength
+ N = len(length)
+ length = length.reshape(N, 1)
+ # This number is chosen based on when pixel values overflow in Agg
+ # causing rendering errors
+ # length = np.minimum(length, 2 ** 16)
+ np.clip(length, 0, 2 ** 16, out=length)
+ # x, y: normal horizontal arrow
+ x = np.array([0, -self.headaxislength,
+ -self.headlength, 0],
+ np.float64)
+ x = x + np.array([0, 1, 1, 1]) * length
+ y = 0.5 * np.array([1, 1, self.headwidth, 0], np.float64)
+ y = np.repeat(y[np.newaxis, :], N, axis=0)
+ # x0, y0: arrow without shaft, for short vectors
+ x0 = np.array([0, minsh - self.headaxislength,
+ minsh - self.headlength, minsh], np.float64)
+ y0 = 0.5 * np.array([1, 1, self.headwidth, 0], np.float64)
+ ii = [0, 1, 2, 3, 2, 1, 0, 0]
+ X = x[:, ii]
+ Y = y[:, ii]
+ Y[:, 3:-1] *= -1
+ X0 = x0[ii]
+ Y0 = y0[ii]
+ Y0[3:-1] *= -1
+ shrink = length / minsh if minsh != 0. else 0.
+ X0 = shrink * X0[np.newaxis, :]
+ Y0 = shrink * Y0[np.newaxis, :]
+ short = np.repeat(length < minsh, 8, axis=1)
+ # Now select X0, Y0 if short, otherwise X, Y
+ np.copyto(X, X0, where=short)
+ np.copyto(Y, Y0, where=short)
+ if self.pivot == 'middle':
+ X -= 0.5 * X[:, 3, np.newaxis]
+ elif self.pivot == 'tip':
+ # numpy bug? using -= does not work here unless we multiply by a
+ # float first, as with 'mid'.
+ X = X - X[:, 3, np.newaxis]
+ elif self.pivot != 'tail':
+ _api.check_in_list(["middle", "tip", "tail"], pivot=self.pivot)
+
+ tooshort = length < self.minlength
+ if tooshort.any():
+ # Use a heptagonal dot:
+ th = np.arange(0, 8, 1, np.float64) * (np.pi / 3.0)
+ x1 = np.cos(th) * self.minlength * 0.5
+ y1 = np.sin(th) * self.minlength * 0.5
+ X1 = np.repeat(x1[np.newaxis, :], N, axis=0)
+ Y1 = np.repeat(y1[np.newaxis, :], N, axis=0)
+ tooshort = np.repeat(tooshort, 8, 1)
+ np.copyto(X, X1, where=tooshort)
+ np.copyto(Y, Y1, where=tooshort)
+ # Mask handling is deferred to the caller, _make_verts.
+ return X, Y
+
+
+_barbs_doc = r"""
+Plot a 2D field of wind barbs.
+
+Call signature::
+
+ barbs([X, Y], U, V, [C], /, **kwargs)
+
+Where *X*, *Y* define the barb locations, *U*, *V* define the barb
+directions, and *C* optionally sets the color.
+
+The arguments *X*, *Y*, *U*, *V*, *C* are positional-only and may be
+1D or 2D. *U*, *V*, *C* may be masked arrays, but masked *X*, *Y*
+are not supported at present.
+
+Barbs are traditionally used in meteorology as a way to plot the speed
+and direction of wind observations, but can technically be used to
+plot any two dimensional vector quantity. As opposed to arrows, which
+give vector magnitude by the length of the arrow, the barbs give more
+quantitative information about the vector magnitude by putting slanted
+lines or a triangle for various increments in magnitude, as show
+schematically below::
+
+ : /\ \
+ : / \ \
+ : / \ \ \
+ : / \ \ \
+ : ------------------------------
+
+The largest increment is given by a triangle (or "flag"). After those
+come full lines (barbs). The smallest increment is a half line. There
+is only, of course, ever at most 1 half line. If the magnitude is
+small and only needs a single half-line and no full lines or
+triangles, the half-line is offset from the end of the barb so that it
+can be easily distinguished from barbs with a single full line. The
+magnitude for the barb shown above would nominally be 65, using the
+standard increments of 50, 10, and 5.
+
+See also https://en.wikipedia.org/wiki/Wind_barb.
+
+Parameters
+----------
+X, Y : 1D or 2D array-like, optional
+ The x and y coordinates of the barb locations. See *pivot* for how the
+ barbs are drawn to the x, y positions.
+
+ If not given, they will be generated as a uniform integer meshgrid based
+ on the dimensions of *U* and *V*.
+
+ If *X* and *Y* are 1D but *U*, *V* are 2D, *X*, *Y* are expanded to 2D
+ using ``X, Y = np.meshgrid(X, Y)``. In this case ``len(X)`` and ``len(Y)``
+ must match the column and row dimensions of *U* and *V*.
+
+U, V : 1D or 2D array-like
+ The x and y components of the barb shaft.
+
+C : 1D or 2D array-like, optional
+ Numeric data that defines the barb colors by colormapping via *norm* and
+ *cmap*.
+
+ This does not support explicit colors. If you want to set colors directly,
+ use *barbcolor* instead.
+
+length : float, default: 7
+ Length of the barb in points; the other parts of the barb
+ are scaled against this.
+
+pivot : {'tip', 'middle'} or float, default: 'tip'
+ The part of the arrow that is anchored to the *X*, *Y* grid. The barb
+ rotates about this point. This can also be a number, which shifts the
+ start of the barb that many points away from grid point.
+
+barbcolor : :mpltype:`color` or color sequence
+ The color of all parts of the barb except for the flags. This parameter
+ is analogous to the *edgecolor* parameter for polygons, which can be used
+ instead. However this parameter will override facecolor.
+
+flagcolor : :mpltype:`color` or color sequence
+ The color of any flags on the barb. This parameter is analogous to the
+ *facecolor* parameter for polygons, which can be used instead. However,
+ this parameter will override facecolor. If this is not set (and *C* has
+ not either) then *flagcolor* will be set to match *barbcolor* so that the
+ barb has a uniform color. If *C* has been set, *flagcolor* has no effect.
+
+sizes : dict, optional
+ A dictionary of coefficients specifying the ratio of a given
+ feature to the length of the barb. Only those values one wishes to
+ override need to be included. These features include:
+
+ - 'spacing' - space between features (flags, full/half barbs)
+ - 'height' - height (distance from shaft to top) of a flag or full barb
+ - 'width' - width of a flag, twice the width of a full barb
+ - 'emptybarb' - radius of the circle used for low magnitudes
+
+fill_empty : bool, default: False
+ Whether the empty barbs (circles) that are drawn should be filled with
+ the flag color. If they are not filled, the center is transparent.
+
+rounding : bool, default: True
+ Whether the vector magnitude should be rounded when allocating barb
+ components. If True, the magnitude is rounded to the nearest multiple
+ of the half-barb increment. If False, the magnitude is simply truncated
+ to the next lowest multiple.
+
+barb_increments : dict, optional
+ A dictionary of increments specifying values to associate with
+ different parts of the barb. Only those values one wishes to
+ override need to be included.
+
+ - 'half' - half barbs (Default is 5)
+ - 'full' - full barbs (Default is 10)
+ - 'flag' - flags (default is 50)
+
+flip_barb : bool or array-like of bool, default: False
+ Whether the lines and flags should point opposite to normal.
+ Normal behavior is for the barbs and lines to point right (comes from wind
+ barbs having these features point towards low pressure in the Northern
+ Hemisphere).
+
+ A single value is applied to all barbs. Individual barbs can be flipped by
+ passing a bool array of the same size as *U* and *V*.
+
+Returns
+-------
+barbs : `~matplotlib.quiver.Barbs`
+
+Other Parameters
+----------------
+data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+**kwargs
+ The barbs can further be customized using `.PolyCollection` keyword
+ arguments:
+
+ %(PolyCollection:kwdoc)s
+""" % _docstring.interpd.params
+
+_docstring.interpd.register(barbs_doc=_barbs_doc)
+
+
+class Barbs(mcollections.PolyCollection):
+ """
+ Specialized PolyCollection for barbs.
+
+ The only API method is :meth:`set_UVC`, which can be used to
+ change the size, orientation, and color of the arrows. Locations
+ are changed using the :meth:`set_offsets` collection method.
+ Possibly this method will be useful in animations.
+
+ There is one internal function :meth:`_find_tails` which finds
+ exactly what should be put on the barb given the vector magnitude.
+ From there :meth:`_make_barbs` is used to find the vertices of the
+ polygon to represent the barb based on this information.
+ """
+
+ # This may be an abuse of polygons here to render what is essentially maybe
+ # 1 triangle and a series of lines. It works fine as far as I can tell
+ # however.
+
+ @_docstring.interpd
+ def __init__(self, ax, *args,
+ pivot='tip', length=7, barbcolor=None, flagcolor=None,
+ sizes=None, fill_empty=False, barb_increments=None,
+ rounding=True, flip_barb=False, **kwargs):
+ """
+ The constructor takes one required argument, an Axes
+ instance, followed by the args and kwargs described
+ by the following pyplot interface documentation:
+ %(barbs_doc)s
+ """
+ self.sizes = sizes or dict()
+ self.fill_empty = fill_empty
+ self.barb_increments = barb_increments or dict()
+ self.rounding = rounding
+ self.flip = np.atleast_1d(flip_barb)
+ transform = kwargs.pop('transform', ax.transData)
+ self._pivot = pivot
+ self._length = length
+
+ # Flagcolor and barbcolor provide convenience parameters for
+ # setting the facecolor and edgecolor, respectively, of the barb
+ # polygon. We also work here to make the flag the same color as the
+ # rest of the barb by default
+
+ if None in (barbcolor, flagcolor):
+ kwargs['edgecolors'] = 'face'
+ if flagcolor:
+ kwargs['facecolors'] = flagcolor
+ elif barbcolor:
+ kwargs['facecolors'] = barbcolor
+ else:
+ # Set to facecolor passed in or default to black
+ kwargs.setdefault('facecolors', 'k')
+ else:
+ kwargs['edgecolors'] = barbcolor
+ kwargs['facecolors'] = flagcolor
+
+ # Explicitly set a line width if we're not given one, otherwise
+ # polygons are not outlined and we get no barbs
+ if 'linewidth' not in kwargs and 'lw' not in kwargs:
+ kwargs['linewidth'] = 1
+
+ # Parse out the data arrays from the various configurations supported
+ x, y, u, v, c = _parse_args(*args, caller_name='barbs')
+ self.x = x
+ self.y = y
+ xy = np.column_stack((x, y))
+
+ # Make a collection
+ barb_size = self._length ** 2 / 4 # Empirically determined
+ super().__init__(
+ [], (barb_size,), offsets=xy, offset_transform=transform, **kwargs)
+ self.set_transform(transforms.IdentityTransform())
+
+ self.set_UVC(u, v, c)
+
+ def _find_tails(self, mag, rounding=True, half=5, full=10, flag=50):
+ """
+ Find how many of each of the tail pieces is necessary.
+
+ Parameters
+ ----------
+ mag : `~numpy.ndarray`
+ Vector magnitudes; must be non-negative (and an actual ndarray).
+ rounding : bool, default: True
+ Whether to round or to truncate to the nearest half-barb.
+ half, full, flag : float, defaults: 5, 10, 50
+ Increments for a half-barb, a barb, and a flag.
+
+ Returns
+ -------
+ n_flags, n_barbs : int array
+ For each entry in *mag*, the number of flags and barbs.
+ half_flag : bool array
+ For each entry in *mag*, whether a half-barb is needed.
+ empty_flag : bool array
+ For each entry in *mag*, whether nothing is drawn.
+ """
+ # If rounding, round to the nearest multiple of half, the smallest
+ # increment
+ if rounding:
+ mag = half * np.around(mag / half)
+ n_flags, mag = divmod(mag, flag)
+ n_barb, mag = divmod(mag, full)
+ half_flag = mag >= half
+ empty_flag = ~(half_flag | (n_flags > 0) | (n_barb > 0))
+ return n_flags.astype(int), n_barb.astype(int), half_flag, empty_flag
+
+ def _make_barbs(self, u, v, nflags, nbarbs, half_barb, empty_flag, length,
+ pivot, sizes, fill_empty, flip):
+ """
+ Create the wind barbs.
+
+ Parameters
+ ----------
+ u, v
+ Components of the vector in the x and y directions, respectively.
+
+ nflags, nbarbs, half_barb, empty_flag
+ Respectively, the number of flags, number of barbs, flag for
+ half a barb, and flag for empty barb, ostensibly obtained from
+ :meth:`_find_tails`.
+
+ length
+ The length of the barb staff in points.
+
+ pivot : {"tip", "middle"} or number
+ The point on the barb around which the entire barb should be
+ rotated. If a number, the start of the barb is shifted by that
+ many points from the origin.
+
+ sizes : dict
+ Coefficients specifying the ratio of a given feature to the length
+ of the barb. These features include:
+
+ - *spacing*: space between features (flags, full/half barbs).
+ - *height*: distance from shaft of top of a flag or full barb.
+ - *width*: width of a flag, twice the width of a full barb.
+ - *emptybarb*: radius of the circle used for low magnitudes.
+
+ fill_empty : bool
+ Whether the circle representing an empty barb should be filled or
+ not (this changes the drawing of the polygon).
+
+ flip : list of bool
+ Whether the features should be flipped to the other side of the
+ barb (useful for winds in the southern hemisphere).
+
+ Returns
+ -------
+ list of arrays of vertices
+ Polygon vertices for each of the wind barbs. These polygons have
+ been rotated to properly align with the vector direction.
+ """
+
+ # These control the spacing and size of barb elements relative to the
+ # length of the shaft
+ spacing = length * sizes.get('spacing', 0.125)
+ full_height = length * sizes.get('height', 0.4)
+ full_width = length * sizes.get('width', 0.25)
+ empty_rad = length * sizes.get('emptybarb', 0.15)
+
+ # Controls y point where to pivot the barb.
+ pivot_points = dict(tip=0.0, middle=-length / 2.)
+
+ endx = 0.0
+ try:
+ endy = float(pivot)
+ except ValueError:
+ endy = pivot_points[pivot.lower()]
+
+ # Get the appropriate angle for the vector components. The offset is
+ # due to the way the barb is initially drawn, going down the y-axis.
+ # This makes sense in a meteorological mode of thinking since there 0
+ # degrees corresponds to north (the y-axis traditionally)
+ angles = -(ma.arctan2(v, u) + np.pi / 2)
+
+ # Used for low magnitude. We just get the vertices, so if we make it
+ # out here, it can be reused. The center set here should put the
+ # center of the circle at the location(offset), rather than at the
+ # same point as the barb pivot; this seems more sensible.
+ circ = CirclePolygon((0, 0), radius=empty_rad).get_verts()
+ if fill_empty:
+ empty_barb = circ
+ else:
+ # If we don't want the empty one filled, we make a degenerate
+ # polygon that wraps back over itself
+ empty_barb = np.concatenate((circ, circ[::-1]))
+
+ barb_list = []
+ for index, angle in np.ndenumerate(angles):
+ # If the vector magnitude is too weak to draw anything, plot an
+ # empty circle instead
+ if empty_flag[index]:
+ # We can skip the transform since the circle has no preferred
+ # orientation
+ barb_list.append(empty_barb)
+ continue
+
+ poly_verts = [(endx, endy)]
+ offset = length
+
+ # Handle if this barb should be flipped
+ barb_height = -full_height if flip[index] else full_height
+
+ # Add vertices for each flag
+ for i in range(nflags[index]):
+ # The spacing that works for the barbs is a little to much for
+ # the flags, but this only occurs when we have more than 1
+ # flag.
+ if offset != length:
+ offset += spacing / 2.
+ poly_verts.extend(
+ [[endx, endy + offset],
+ [endx + barb_height, endy - full_width / 2 + offset],
+ [endx, endy - full_width + offset]])
+
+ offset -= full_width + spacing
+
+ # Add vertices for each barb. These really are lines, but works
+ # great adding 3 vertices that basically pull the polygon out and
+ # back down the line
+ for i in range(nbarbs[index]):
+ poly_verts.extend(
+ [(endx, endy + offset),
+ (endx + barb_height, endy + offset + full_width / 2),
+ (endx, endy + offset)])
+
+ offset -= spacing
+
+ # Add the vertices for half a barb, if needed
+ if half_barb[index]:
+ # If the half barb is the first on the staff, traditionally it
+ # is offset from the end to make it easy to distinguish from a
+ # barb with a full one
+ if offset == length:
+ poly_verts.append((endx, endy + offset))
+ offset -= 1.5 * spacing
+ poly_verts.extend(
+ [(endx, endy + offset),
+ (endx + barb_height / 2, endy + offset + full_width / 4),
+ (endx, endy + offset)])
+
+ # Rotate the barb according the angle. Making the barb first and
+ # then rotating it made the math for drawing the barb really easy.
+ # Also, the transform framework makes doing the rotation simple.
+ poly_verts = transforms.Affine2D().rotate(-angle).transform(
+ poly_verts)
+ barb_list.append(poly_verts)
+
+ return barb_list
+
+ def set_UVC(self, U, V, C=None):
+ # We need to ensure we have a copy, not a reference to an array that
+ # might change before draw().
+ self.u = ma.masked_invalid(U, copy=True).ravel()
+ self.v = ma.masked_invalid(V, copy=True).ravel()
+
+ # Flip needs to have the same number of entries as everything else.
+ # Use broadcast_to to avoid a bloated array of identical values.
+ # (can't rely on actual broadcasting)
+ if len(self.flip) == 1:
+ flip = np.broadcast_to(self.flip, self.u.shape)
+ else:
+ flip = self.flip
+
+ if C is not None:
+ c = ma.masked_invalid(C, copy=True).ravel()
+ x, y, u, v, c, flip = cbook.delete_masked_points(
+ self.x.ravel(), self.y.ravel(), self.u, self.v, c,
+ flip.ravel())
+ _check_consistent_shapes(x, y, u, v, c, flip)
+ else:
+ x, y, u, v, flip = cbook.delete_masked_points(
+ self.x.ravel(), self.y.ravel(), self.u, self.v, flip.ravel())
+ _check_consistent_shapes(x, y, u, v, flip)
+
+ magnitude = np.hypot(u, v)
+ flags, barbs, halves, empty = self._find_tails(
+ magnitude, self.rounding, **self.barb_increments)
+
+ # Get the vertices for each of the barbs
+
+ plot_barbs = self._make_barbs(u, v, flags, barbs, halves, empty,
+ self._length, self._pivot, self.sizes,
+ self.fill_empty, flip)
+ self.set_verts(plot_barbs)
+
+ # Set the color array
+ if C is not None:
+ self.set_array(c)
+
+ # Update the offsets in case the masked data changed
+ xy = np.column_stack((x, y))
+ self._offsets = xy
+ self.stale = True
+
+ def set_offsets(self, xy):
+ """
+ Set the offsets for the barb polygons. This saves the offsets passed
+ in and masks them as appropriate for the existing U/V data.
+
+ Parameters
+ ----------
+ xy : sequence of pairs of floats
+ """
+ self.x = xy[:, 0]
+ self.y = xy[:, 1]
+ x, y, u, v = cbook.delete_masked_points(
+ self.x.ravel(), self.y.ravel(), self.u, self.v)
+ _check_consistent_shapes(x, y, u, v)
+ xy = np.column_stack((x, y))
+ super().set_offsets(xy)
+ self.stale = True
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/quiver.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/quiver.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..8a14083c434863d229b4b14287df06c8c85b102d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/quiver.pyi
@@ -0,0 +1,184 @@
+import matplotlib.artist as martist
+import matplotlib.collections as mcollections
+from matplotlib.axes import Axes
+from matplotlib.figure import Figure, SubFigure
+from matplotlib.text import Text
+from matplotlib.transforms import Transform, Bbox
+
+
+import numpy as np
+from numpy.typing import ArrayLike
+from collections.abc import Sequence
+from typing import Any, Literal, overload
+from matplotlib.typing import ColorType
+
+class QuiverKey(martist.Artist):
+ halign: dict[Literal["N", "S", "E", "W"], Literal["left", "center", "right"]]
+ valign: dict[Literal["N", "S", "E", "W"], Literal["top", "center", "bottom"]]
+ pivot: dict[Literal["N", "S", "E", "W"], Literal["middle", "tip", "tail"]]
+ Q: Quiver
+ X: float
+ Y: float
+ U: float
+ angle: float
+ coord: Literal["axes", "figure", "data", "inches"]
+ color: ColorType | None
+ label: str
+ labelpos: Literal["N", "S", "E", "W"]
+ labelcolor: ColorType | None
+ fontproperties: dict[str, Any]
+ kw: dict[str, Any]
+ text: Text
+ zorder: float
+ def __init__(
+ self,
+ Q: Quiver,
+ X: float,
+ Y: float,
+ U: float,
+ label: str,
+ *,
+ angle: float = ...,
+ coordinates: Literal["axes", "figure", "data", "inches"] = ...,
+ color: ColorType | None = ...,
+ labelsep: float = ...,
+ labelpos: Literal["N", "S", "E", "W"] = ...,
+ labelcolor: ColorType | None = ...,
+ fontproperties: dict[str, Any] | None = ...,
+ zorder: float | None = ...,
+ **kwargs
+ ) -> None: ...
+ @property
+ def labelsep(self) -> float: ...
+ def set_figure(self, fig: Figure | SubFigure) -> None: ...
+
+class Quiver(mcollections.PolyCollection):
+ X: ArrayLike
+ Y: ArrayLike
+ XY: ArrayLike
+ U: ArrayLike
+ V: ArrayLike
+ Umask: ArrayLike
+ N: int
+ scale: float | None
+ headwidth: float
+ headlength: float
+ headaxislength: float
+ minshaft: float
+ minlength: float
+ units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
+ scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] | None
+ angles: Literal["uv", "xy"] | ArrayLike
+ width: float | None
+ pivot: Literal["tail", "middle", "tip"]
+ transform: Transform
+ polykw: dict[str, Any]
+
+ @overload
+ def __init__(
+ self,
+ ax: Axes,
+ U: ArrayLike,
+ V: ArrayLike,
+ C: ArrayLike = ...,
+ *,
+ scale: float | None = ...,
+ headwidth: float = ...,
+ headlength: float = ...,
+ headaxislength: float = ...,
+ minshaft: float = ...,
+ minlength: float = ...,
+ units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] = ...,
+ scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
+ | None = ...,
+ angles: Literal["uv", "xy"] | ArrayLike = ...,
+ width: float | None = ...,
+ color: ColorType | Sequence[ColorType] = ...,
+ pivot: Literal["tail", "mid", "middle", "tip"] = ...,
+ **kwargs
+ ) -> None: ...
+ @overload
+ def __init__(
+ self,
+ ax: Axes,
+ X: ArrayLike,
+ Y: ArrayLike,
+ U: ArrayLike,
+ V: ArrayLike,
+ C: ArrayLike = ...,
+ *,
+ scale: float | None = ...,
+ headwidth: float = ...,
+ headlength: float = ...,
+ headaxislength: float = ...,
+ minshaft: float = ...,
+ minlength: float = ...,
+ units: Literal["width", "height", "dots", "inches", "x", "y", "xy"] = ...,
+ scale_units: Literal["width", "height", "dots", "inches", "x", "y", "xy"]
+ | None = ...,
+ angles: Literal["uv", "xy"] | ArrayLike = ...,
+ width: float | None = ...,
+ color: ColorType | Sequence[ColorType] = ...,
+ pivot: Literal["tail", "mid", "middle", "tip"] = ...,
+ **kwargs
+ ) -> None: ...
+ def get_datalim(self, transData: Transform) -> Bbox: ...
+ def set_UVC(
+ self, U: ArrayLike, V: ArrayLike, C: ArrayLike | None = ...
+ ) -> None: ...
+
+class Barbs(mcollections.PolyCollection):
+ sizes: dict[str, float]
+ fill_empty: bool
+ barb_increments: dict[str, float]
+ rounding: bool
+ flip: np.ndarray
+ x: ArrayLike
+ y: ArrayLike
+ u: ArrayLike
+ v: ArrayLike
+
+ @overload
+ def __init__(
+ self,
+ ax: Axes,
+ U: ArrayLike,
+ V: ArrayLike,
+ C: ArrayLike = ...,
+ *,
+ pivot: str = ...,
+ length: int = ...,
+ barbcolor: ColorType | Sequence[ColorType] | None = ...,
+ flagcolor: ColorType | Sequence[ColorType] | None = ...,
+ sizes: dict[str, float] | None = ...,
+ fill_empty: bool = ...,
+ barb_increments: dict[str, float] | None = ...,
+ rounding: bool = ...,
+ flip_barb: bool | ArrayLike = ...,
+ **kwargs
+ ) -> None: ...
+ @overload
+ def __init__(
+ self,
+ ax: Axes,
+ X: ArrayLike,
+ Y: ArrayLike,
+ U: ArrayLike,
+ V: ArrayLike,
+ C: ArrayLike = ...,
+ *,
+ pivot: str = ...,
+ length: int = ...,
+ barbcolor: ColorType | Sequence[ColorType] | None = ...,
+ flagcolor: ColorType | Sequence[ColorType] | None = ...,
+ sizes: dict[str, float] | None = ...,
+ fill_empty: bool = ...,
+ barb_increments: dict[str, float] | None = ...,
+ rounding: bool = ...,
+ flip_barb: bool | ArrayLike = ...,
+ **kwargs
+ ) -> None: ...
+ def set_UVC(
+ self, U: ArrayLike, V: ArrayLike, C: ArrayLike | None = ...
+ ) -> None: ...
+ def set_offsets(self, xy: ArrayLike) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/rcsetup.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/rcsetup.py
new file mode 100644
index 0000000000000000000000000000000000000000..c23d9f818454cda653ed6e2b08f6bb0e1045cbf4
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/rcsetup.py
@@ -0,0 +1,1371 @@
+"""
+The rcsetup module contains the validation code for customization using
+Matplotlib's rc settings.
+
+Each rc setting is assigned a function used to validate any attempted changes
+to that setting. The validation functions are defined in the rcsetup module,
+and are used to construct the rcParams global object which stores the settings
+and is referenced throughout Matplotlib.
+
+The default values of the rc settings are set in the default matplotlibrc file.
+Any additions or deletions to the parameter set listed here should also be
+propagated to the :file:`lib/matplotlib/mpl-data/matplotlibrc` in Matplotlib's
+root source directory.
+"""
+
+import ast
+from functools import lru_cache, reduce
+from numbers import Real
+import operator
+import os
+import re
+
+import numpy as np
+
+from matplotlib import _api, cbook
+from matplotlib.backends import BackendFilter, backend_registry
+from matplotlib.cbook import ls_mapper
+from matplotlib.colors import Colormap, is_color_like
+from matplotlib._fontconfig_pattern import parse_fontconfig_pattern
+from matplotlib._enums import JoinStyle, CapStyle
+
+# Don't let the original cycler collide with our validating cycler
+from cycler import Cycler, cycler as ccycler
+
+
+@_api.caching_module_getattr
+class __getattr__:
+ @_api.deprecated(
+ "3.9",
+ alternative="``matplotlib.backends.backend_registry.list_builtin"
+ "(matplotlib.backends.BackendFilter.INTERACTIVE)``")
+ @property
+ def interactive_bk(self):
+ return backend_registry.list_builtin(BackendFilter.INTERACTIVE)
+
+ @_api.deprecated(
+ "3.9",
+ alternative="``matplotlib.backends.backend_registry.list_builtin"
+ "(matplotlib.backends.BackendFilter.NON_INTERACTIVE)``")
+ @property
+ def non_interactive_bk(self):
+ return backend_registry.list_builtin(BackendFilter.NON_INTERACTIVE)
+
+ @_api.deprecated(
+ "3.9",
+ alternative="``matplotlib.backends.backend_registry.list_builtin()``")
+ @property
+ def all_backends(self):
+ return backend_registry.list_builtin()
+
+
+class ValidateInStrings:
+ def __init__(self, key, valid, ignorecase=False, *,
+ _deprecated_since=None):
+ """*valid* is a list of legal strings."""
+ self.key = key
+ self.ignorecase = ignorecase
+ self._deprecated_since = _deprecated_since
+
+ def func(s):
+ if ignorecase:
+ return s.lower()
+ else:
+ return s
+ self.valid = {func(k): k for k in valid}
+
+ def __call__(self, s):
+ if self._deprecated_since:
+ name, = (k for k, v in globals().items() if v is self)
+ _api.warn_deprecated(
+ self._deprecated_since, name=name, obj_type="function")
+ if self.ignorecase and isinstance(s, str):
+ s = s.lower()
+ if s in self.valid:
+ return self.valid[s]
+ msg = (f"{s!r} is not a valid value for {self.key}; supported values "
+ f"are {[*self.valid.values()]}")
+ if (isinstance(s, str)
+ and (s.startswith('"') and s.endswith('"')
+ or s.startswith("'") and s.endswith("'"))
+ and s[1:-1] in self.valid):
+ msg += "; remove quotes surrounding your string"
+ raise ValueError(msg)
+
+
+@lru_cache
+def _listify_validator(scalar_validator, allow_stringlist=False, *,
+ n=None, doc=None):
+ def f(s):
+ if isinstance(s, str):
+ try:
+ val = [scalar_validator(v.strip()) for v in s.split(',')
+ if v.strip()]
+ except Exception:
+ if allow_stringlist:
+ # Sometimes, a list of colors might be a single string
+ # of single-letter colornames. So give that a shot.
+ val = [scalar_validator(v.strip()) for v in s if v.strip()]
+ else:
+ raise
+ # Allow any ordered sequence type -- generators, np.ndarray, pd.Series
+ # -- but not sets, whose iteration order is non-deterministic.
+ elif np.iterable(s) and not isinstance(s, (set, frozenset)):
+ # The condition on this list comprehension will preserve the
+ # behavior of filtering out any empty strings (behavior was
+ # from the original validate_stringlist()), while allowing
+ # any non-string/text scalar values such as numbers and arrays.
+ val = [scalar_validator(v) for v in s
+ if not isinstance(v, str) or v]
+ else:
+ raise ValueError(
+ f"Expected str or other non-set iterable, but got {s}")
+ if n is not None and len(val) != n:
+ raise ValueError(
+ f"Expected {n} values, but there are {len(val)} values in {s}")
+ return val
+
+ try:
+ f.__name__ = f"{scalar_validator.__name__}list"
+ except AttributeError: # class instance.
+ f.__name__ = f"{type(scalar_validator).__name__}List"
+ f.__qualname__ = f.__qualname__.rsplit(".", 1)[0] + "." + f.__name__
+ f.__doc__ = doc if doc is not None else scalar_validator.__doc__
+ return f
+
+
+def validate_any(s):
+ return s
+validate_anylist = _listify_validator(validate_any)
+
+
+def _validate_date(s):
+ try:
+ np.datetime64(s)
+ return s
+ except ValueError:
+ raise ValueError(
+ f'{s!r} should be a string that can be parsed by numpy.datetime64')
+
+
+def validate_bool(b):
+ """Convert b to ``bool`` or raise."""
+ if isinstance(b, str):
+ b = b.lower()
+ if b in ('t', 'y', 'yes', 'on', 'true', '1', 1, True):
+ return True
+ elif b in ('f', 'n', 'no', 'off', 'false', '0', 0, False):
+ return False
+ else:
+ raise ValueError(f'Cannot convert {b!r} to bool')
+
+
+def validate_axisbelow(s):
+ try:
+ return validate_bool(s)
+ except ValueError:
+ if isinstance(s, str):
+ if s == 'line':
+ return 'line'
+ raise ValueError(f'{s!r} cannot be interpreted as'
+ ' True, False, or "line"')
+
+
+def validate_dpi(s):
+ """Confirm s is string 'figure' or convert s to float or raise."""
+ if s == 'figure':
+ return s
+ try:
+ return float(s)
+ except ValueError as e:
+ raise ValueError(f'{s!r} is not string "figure" and '
+ f'could not convert {s!r} to float') from e
+
+
+def _make_type_validator(cls, *, allow_none=False):
+ """
+ Return a validator that converts inputs to *cls* or raises (and possibly
+ allows ``None`` as well).
+ """
+
+ def validator(s):
+ if (allow_none and
+ (s is None or cbook._str_lower_equal(s, "none"))):
+ return None
+ if cls is str and not isinstance(s, str):
+ raise ValueError(f'Could not convert {s!r} to str')
+ try:
+ return cls(s)
+ except (TypeError, ValueError) as e:
+ raise ValueError(
+ f'Could not convert {s!r} to {cls.__name__}') from e
+
+ validator.__name__ = f"validate_{cls.__name__}"
+ if allow_none:
+ validator.__name__ += "_or_None"
+ validator.__qualname__ = (
+ validator.__qualname__.rsplit(".", 1)[0] + "." + validator.__name__)
+ return validator
+
+
+validate_string = _make_type_validator(str)
+validate_string_or_None = _make_type_validator(str, allow_none=True)
+validate_stringlist = _listify_validator(
+ validate_string, doc='return a list of strings')
+validate_int = _make_type_validator(int)
+validate_int_or_None = _make_type_validator(int, allow_none=True)
+validate_float = _make_type_validator(float)
+validate_float_or_None = _make_type_validator(float, allow_none=True)
+validate_floatlist = _listify_validator(
+ validate_float, doc='return a list of floats')
+
+
+def _validate_marker(s):
+ try:
+ return validate_int(s)
+ except ValueError as e:
+ try:
+ return validate_string(s)
+ except ValueError as e:
+ raise ValueError('Supported markers are [string, int]') from e
+
+
+_validate_markerlist = _listify_validator(
+ _validate_marker, doc='return a list of markers')
+
+
+def _validate_pathlike(s):
+ if isinstance(s, (str, os.PathLike)):
+ # Store value as str because savefig.directory needs to distinguish
+ # between "" (cwd) and "." (cwd, but gets updated by user selections).
+ return os.fsdecode(s)
+ else:
+ return validate_string(s)
+
+
+def validate_fonttype(s):
+ """
+ Confirm that this is a Postscript or PDF font type that we know how to
+ convert to.
+ """
+ fonttypes = {'type3': 3,
+ 'truetype': 42}
+ try:
+ fonttype = validate_int(s)
+ except ValueError:
+ try:
+ return fonttypes[s.lower()]
+ except KeyError as e:
+ raise ValueError('Supported Postscript/PDF font types are %s'
+ % list(fonttypes)) from e
+ else:
+ if fonttype not in fonttypes.values():
+ raise ValueError(
+ 'Supported Postscript/PDF font types are %s' %
+ list(fonttypes.values()))
+ return fonttype
+
+
+_auto_backend_sentinel = object()
+
+
+def validate_backend(s):
+ if s is _auto_backend_sentinel or backend_registry.is_valid_backend(s):
+ return s
+ else:
+ msg = (f"'{s}' is not a valid value for backend; supported values are "
+ f"{backend_registry.list_all()}")
+ raise ValueError(msg)
+
+
+def _validate_toolbar(s):
+ s = ValidateInStrings(
+ 'toolbar', ['None', 'toolbar2', 'toolmanager'], ignorecase=True)(s)
+ if s == 'toolmanager':
+ _api.warn_external(
+ "Treat the new Tool classes introduced in v1.5 as experimental "
+ "for now; the API and rcParam may change in future versions.")
+ return s
+
+
+def validate_color_or_inherit(s):
+ """Return a valid color arg."""
+ if cbook._str_equal(s, 'inherit'):
+ return s
+ return validate_color(s)
+
+
+def validate_color_or_auto(s):
+ if cbook._str_equal(s, 'auto'):
+ return s
+ return validate_color(s)
+
+
+def validate_color_for_prop_cycle(s):
+ # N-th color cycle syntax can't go into the color cycle.
+ if isinstance(s, str) and re.match("^C[0-9]$", s):
+ raise ValueError(f"Cannot put cycle reference ({s!r}) in prop_cycler")
+ return validate_color(s)
+
+
+def _validate_color_or_linecolor(s):
+ if cbook._str_equal(s, 'linecolor'):
+ return s
+ elif cbook._str_equal(s, 'mfc') or cbook._str_equal(s, 'markerfacecolor'):
+ return 'markerfacecolor'
+ elif cbook._str_equal(s, 'mec') or cbook._str_equal(s, 'markeredgecolor'):
+ return 'markeredgecolor'
+ elif s is None:
+ return None
+ elif isinstance(s, str) and len(s) == 6 or len(s) == 8:
+ stmp = '#' + s
+ if is_color_like(stmp):
+ return stmp
+ if s.lower() == 'none':
+ return None
+ elif is_color_like(s):
+ return s
+
+ raise ValueError(f'{s!r} does not look like a color arg')
+
+
+def validate_color(s):
+ """Return a valid color arg."""
+ if isinstance(s, str):
+ if s.lower() == 'none':
+ return 'none'
+ if len(s) == 6 or len(s) == 8:
+ stmp = '#' + s
+ if is_color_like(stmp):
+ return stmp
+
+ if is_color_like(s):
+ return s
+
+ # If it is still valid, it must be a tuple (as a string from matplotlibrc).
+ try:
+ color = ast.literal_eval(s)
+ except (SyntaxError, ValueError):
+ pass
+ else:
+ if is_color_like(color):
+ return color
+
+ raise ValueError(f'{s!r} does not look like a color arg')
+
+
+validate_colorlist = _listify_validator(
+ validate_color, allow_stringlist=True, doc='return a list of colorspecs')
+
+
+def _validate_cmap(s):
+ _api.check_isinstance((str, Colormap), cmap=s)
+ return s
+
+
+def validate_aspect(s):
+ if s in ('auto', 'equal'):
+ return s
+ try:
+ return float(s)
+ except ValueError as e:
+ raise ValueError('not a valid aspect specification') from e
+
+
+def validate_fontsize_None(s):
+ if s is None or s == 'None':
+ return None
+ else:
+ return validate_fontsize(s)
+
+
+def validate_fontsize(s):
+ fontsizes = ['xx-small', 'x-small', 'small', 'medium', 'large',
+ 'x-large', 'xx-large', 'smaller', 'larger']
+ if isinstance(s, str):
+ s = s.lower()
+ if s in fontsizes:
+ return s
+ try:
+ return float(s)
+ except ValueError as e:
+ raise ValueError("%s is not a valid font size. Valid font sizes "
+ "are %s." % (s, ", ".join(fontsizes))) from e
+
+
+validate_fontsizelist = _listify_validator(validate_fontsize)
+
+
+def validate_fontweight(s):
+ weights = [
+ 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman',
+ 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black']
+ # Note: Historically, weights have been case-sensitive in Matplotlib
+ if s in weights:
+ return s
+ try:
+ return int(s)
+ except (ValueError, TypeError) as e:
+ raise ValueError(f'{s} is not a valid font weight.') from e
+
+
+def validate_fontstretch(s):
+ stretchvalues = [
+ 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed',
+ 'normal', 'semi-expanded', 'expanded', 'extra-expanded',
+ 'ultra-expanded']
+ # Note: Historically, stretchvalues have been case-sensitive in Matplotlib
+ if s in stretchvalues:
+ return s
+ try:
+ return int(s)
+ except (ValueError, TypeError) as e:
+ raise ValueError(f'{s} is not a valid font stretch.') from e
+
+
+def validate_font_properties(s):
+ parse_fontconfig_pattern(s)
+ return s
+
+
+def _validate_mathtext_fallback(s):
+ _fallback_fonts = ['cm', 'stix', 'stixsans']
+ if isinstance(s, str):
+ s = s.lower()
+ if s is None or s == 'none':
+ return None
+ elif s.lower() in _fallback_fonts:
+ return s
+ else:
+ raise ValueError(
+ f"{s} is not a valid fallback font name. Valid fallback font "
+ f"names are {','.join(_fallback_fonts)}. Passing 'None' will turn "
+ "fallback off.")
+
+
+def validate_whiskers(s):
+ try:
+ return _listify_validator(validate_float, n=2)(s)
+ except (TypeError, ValueError):
+ try:
+ return float(s)
+ except ValueError as e:
+ raise ValueError("Not a valid whisker value [float, "
+ "(float, float)]") from e
+
+
+def validate_ps_distiller(s):
+ if isinstance(s, str):
+ s = s.lower()
+ if s in ('none', None, 'false', False):
+ return None
+ else:
+ return ValidateInStrings('ps.usedistiller', ['ghostscript', 'xpdf'])(s)
+
+
+# A validator dedicated to the named line styles, based on the items in
+# ls_mapper, and a list of possible strings read from Line2D.set_linestyle
+_validate_named_linestyle = ValidateInStrings(
+ 'linestyle',
+ [*ls_mapper.keys(), *ls_mapper.values(), 'None', 'none', ' ', ''],
+ ignorecase=True)
+
+
+def _validate_linestyle(ls):
+ """
+ A validator for all possible line styles, the named ones *and*
+ the on-off ink sequences.
+ """
+ if isinstance(ls, str):
+ try: # Look first for a valid named line style, like '--' or 'solid'.
+ return _validate_named_linestyle(ls)
+ except ValueError:
+ pass
+ try:
+ ls = ast.literal_eval(ls) # Parsing matplotlibrc.
+ except (SyntaxError, ValueError):
+ pass # Will error with the ValueError at the end.
+
+ def _is_iterable_not_string_like(x):
+ # Explicitly exclude bytes/bytearrays so that they are not
+ # nonsensically interpreted as sequences of numbers (codepoints).
+ return np.iterable(x) and not isinstance(x, (str, bytes, bytearray))
+
+ if _is_iterable_not_string_like(ls):
+ if len(ls) == 2 and _is_iterable_not_string_like(ls[1]):
+ # (offset, (on, off, on, off, ...))
+ offset, onoff = ls
+ else:
+ # For backcompat: (on, off, on, off, ...); the offset is implicit.
+ offset = 0
+ onoff = ls
+
+ if (isinstance(offset, Real)
+ and len(onoff) % 2 == 0
+ and all(isinstance(elem, Real) for elem in onoff)):
+ return (offset, onoff)
+
+ raise ValueError(f"linestyle {ls!r} is not a valid on-off ink sequence.")
+
+
+validate_fillstyle = ValidateInStrings(
+ 'markers.fillstyle', ['full', 'left', 'right', 'bottom', 'top', 'none'])
+
+
+validate_fillstylelist = _listify_validator(validate_fillstyle)
+
+
+def validate_markevery(s):
+ """
+ Validate the markevery property of a Line2D object.
+
+ Parameters
+ ----------
+ s : None, int, (int, int), slice, float, (float, float), or list[int]
+
+ Returns
+ -------
+ None, int, (int, int), slice, float, (float, float), or list[int]
+ """
+ # Validate s against type slice float int and None
+ if isinstance(s, (slice, float, int, type(None))):
+ return s
+ # Validate s against type tuple
+ if isinstance(s, tuple):
+ if (len(s) == 2
+ and (all(isinstance(e, int) for e in s)
+ or all(isinstance(e, float) for e in s))):
+ return s
+ else:
+ raise TypeError(
+ "'markevery' tuple must be pair of ints or of floats")
+ # Validate s against type list
+ if isinstance(s, list):
+ if all(isinstance(e, int) for e in s):
+ return s
+ else:
+ raise TypeError(
+ "'markevery' list must have all elements of type int")
+ raise TypeError("'markevery' is of an invalid type")
+
+
+validate_markeverylist = _listify_validator(validate_markevery)
+
+
+def validate_bbox(s):
+ if isinstance(s, str):
+ s = s.lower()
+ if s == 'tight':
+ return s
+ if s == 'standard':
+ return None
+ raise ValueError("bbox should be 'tight' or 'standard'")
+ elif s is not None:
+ # Backwards compatibility. None is equivalent to 'standard'.
+ raise ValueError("bbox should be 'tight' or 'standard'")
+ return s
+
+
+def validate_sketch(s):
+
+ if isinstance(s, str):
+ s = s.lower().strip()
+ if s.startswith("(") and s.endswith(")"):
+ s = s[1:-1]
+ if s == 'none' or s is None:
+ return None
+ try:
+ return tuple(_listify_validator(validate_float, n=3)(s))
+ except ValueError as exc:
+ raise ValueError("Expected a (scale, length, randomness) tuple") from exc
+
+
+def _validate_greaterthan_minushalf(s):
+ s = validate_float(s)
+ if s > -0.5:
+ return s
+ else:
+ raise RuntimeError(f'Value must be >-0.5; got {s}')
+
+
+def _validate_greaterequal0_lessequal1(s):
+ s = validate_float(s)
+ if 0 <= s <= 1:
+ return s
+ else:
+ raise RuntimeError(f'Value must be >=0 and <=1; got {s}')
+
+
+def _validate_int_greaterequal0(s):
+ s = validate_int(s)
+ if s >= 0:
+ return s
+ else:
+ raise RuntimeError(f'Value must be >=0; got {s}')
+
+
+def validate_hatch(s):
+ r"""
+ Validate a hatch pattern.
+ A hatch pattern string can have any sequence of the following
+ characters: ``\ / | - + * . x o O``.
+ """
+ if not isinstance(s, str):
+ raise ValueError("Hatch pattern must be a string")
+ _api.check_isinstance(str, hatch_pattern=s)
+ unknown = set(s) - {'\\', '/', '|', '-', '+', '*', '.', 'x', 'o', 'O'}
+ if unknown:
+ raise ValueError("Unknown hatch symbol(s): %s" % list(unknown))
+ return s
+
+
+validate_hatchlist = _listify_validator(validate_hatch)
+validate_dashlist = _listify_validator(validate_floatlist)
+
+
+def _validate_minor_tick_ndivs(n):
+ """
+ Validate ndiv parameter related to the minor ticks.
+ It controls the number of minor ticks to be placed between
+ two major ticks.
+ """
+
+ if cbook._str_lower_equal(n, 'auto'):
+ return n
+ try:
+ n = _validate_int_greaterequal0(n)
+ return n
+ except (RuntimeError, ValueError):
+ pass
+
+ raise ValueError("'tick.minor.ndivs' must be 'auto' or non-negative int")
+
+
+_prop_validators = {
+ 'color': _listify_validator(validate_color_for_prop_cycle,
+ allow_stringlist=True),
+ 'linewidth': validate_floatlist,
+ 'linestyle': _listify_validator(_validate_linestyle),
+ 'facecolor': validate_colorlist,
+ 'edgecolor': validate_colorlist,
+ 'joinstyle': _listify_validator(JoinStyle),
+ 'capstyle': _listify_validator(CapStyle),
+ 'fillstyle': validate_fillstylelist,
+ 'markerfacecolor': validate_colorlist,
+ 'markersize': validate_floatlist,
+ 'markeredgewidth': validate_floatlist,
+ 'markeredgecolor': validate_colorlist,
+ 'markevery': validate_markeverylist,
+ 'alpha': validate_floatlist,
+ 'marker': _validate_markerlist,
+ 'hatch': validate_hatchlist,
+ 'dashes': validate_dashlist,
+ }
+_prop_aliases = {
+ 'c': 'color',
+ 'lw': 'linewidth',
+ 'ls': 'linestyle',
+ 'fc': 'facecolor',
+ 'ec': 'edgecolor',
+ 'mfc': 'markerfacecolor',
+ 'mec': 'markeredgecolor',
+ 'mew': 'markeredgewidth',
+ 'ms': 'markersize',
+ }
+
+
+def cycler(*args, **kwargs):
+ """
+ Create a `~cycler.Cycler` object much like :func:`cycler.cycler`,
+ but includes input validation.
+
+ Call signatures::
+
+ cycler(cycler)
+ cycler(label=values, label2=values2, ...)
+ cycler(label, values)
+
+ Form 1 copies a given `~cycler.Cycler` object.
+
+ Form 2 creates a `~cycler.Cycler` which cycles over one or more
+ properties simultaneously. If multiple properties are given, their
+ value lists must have the same length.
+
+ Form 3 creates a `~cycler.Cycler` for a single property. This form
+ exists for compatibility with the original cycler. Its use is
+ discouraged in favor of the kwarg form, i.e. ``cycler(label=values)``.
+
+ Parameters
+ ----------
+ cycler : Cycler
+ Copy constructor for Cycler.
+
+ label : str
+ The property key. Must be a valid `.Artist` property.
+ For example, 'color' or 'linestyle'. Aliases are allowed,
+ such as 'c' for 'color' and 'lw' for 'linewidth'.
+
+ values : iterable
+ Finite-length iterable of the property values. These values
+ are validated and will raise a ValueError if invalid.
+
+ Returns
+ -------
+ Cycler
+ A new :class:`~cycler.Cycler` for the given properties.
+
+ Examples
+ --------
+ Creating a cycler for a single property:
+
+ >>> c = cycler(color=['red', 'green', 'blue'])
+
+ Creating a cycler for simultaneously cycling over multiple properties
+ (e.g. red circle, green plus, blue cross):
+
+ >>> c = cycler(color=['red', 'green', 'blue'],
+ ... marker=['o', '+', 'x'])
+
+ """
+ if args and kwargs:
+ raise TypeError("cycler() can only accept positional OR keyword "
+ "arguments -- not both.")
+ elif not args and not kwargs:
+ raise TypeError("cycler() must have positional OR keyword arguments")
+
+ if len(args) == 1:
+ if not isinstance(args[0], Cycler):
+ raise TypeError("If only one positional argument given, it must "
+ "be a Cycler instance.")
+ return validate_cycler(args[0])
+ elif len(args) == 2:
+ pairs = [(args[0], args[1])]
+ elif len(args) > 2:
+ raise _api.nargs_error('cycler', '0-2', len(args))
+ else:
+ pairs = kwargs.items()
+
+ validated = []
+ for prop, vals in pairs:
+ norm_prop = _prop_aliases.get(prop, prop)
+ validator = _prop_validators.get(norm_prop, None)
+ if validator is None:
+ raise TypeError("Unknown artist property: %s" % prop)
+ vals = validator(vals)
+ # We will normalize the property names as well to reduce
+ # the amount of alias handling code elsewhere.
+ validated.append((norm_prop, vals))
+
+ return reduce(operator.add, (ccycler(k, v) for k, v in validated))
+
+
+class _DunderChecker(ast.NodeVisitor):
+ def visit_Attribute(self, node):
+ if node.attr.startswith("__") and node.attr.endswith("__"):
+ raise ValueError("cycler strings with dunders are forbidden")
+ self.generic_visit(node)
+
+
+# A validator dedicated to the named legend loc
+_validate_named_legend_loc = ValidateInStrings(
+ 'legend.loc',
+ [
+ "best",
+ "upper right", "upper left", "lower left", "lower right", "right",
+ "center left", "center right", "lower center", "upper center",
+ "center"],
+ ignorecase=True)
+
+
+def _validate_legend_loc(loc):
+ """
+ Confirm that loc is a type which rc.Params["legend.loc"] supports.
+
+ .. versionadded:: 3.8
+
+ Parameters
+ ----------
+ loc : str | int | (float, float) | str((float, float))
+ The location of the legend.
+
+ Returns
+ -------
+ loc : str | int | (float, float) or raise ValueError exception
+ The location of the legend.
+ """
+ if isinstance(loc, str):
+ try:
+ return _validate_named_legend_loc(loc)
+ except ValueError:
+ pass
+ try:
+ loc = ast.literal_eval(loc)
+ except (SyntaxError, ValueError):
+ pass
+ if isinstance(loc, int):
+ if 0 <= loc <= 10:
+ return loc
+ if isinstance(loc, tuple):
+ if len(loc) == 2 and all(isinstance(e, Real) for e in loc):
+ return loc
+ raise ValueError(f"{loc} is not a valid legend location.")
+
+
+def validate_cycler(s):
+ """Return a Cycler object from a string repr or the object itself."""
+ if isinstance(s, str):
+ # TODO: We might want to rethink this...
+ # While I think I have it quite locked down, it is execution of
+ # arbitrary code without sanitation.
+ # Combine this with the possibility that rcparams might come from the
+ # internet (future plans), this could be downright dangerous.
+ # I locked it down by only having the 'cycler()' function available.
+ # UPDATE: Partly plugging a security hole.
+ # I really should have read this:
+ # https://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html
+ # We should replace this eval with a combo of PyParsing and
+ # ast.literal_eval()
+ try:
+ _DunderChecker().visit(ast.parse(s))
+ s = eval(s, {'cycler': cycler, '__builtins__': {}})
+ except BaseException as e:
+ raise ValueError(f"{s!r} is not a valid cycler construction: {e}"
+ ) from e
+ # Should make sure what comes from the above eval()
+ # is a Cycler object.
+ if isinstance(s, Cycler):
+ cycler_inst = s
+ else:
+ raise ValueError(f"Object is not a string or Cycler instance: {s!r}")
+
+ unknowns = cycler_inst.keys - (set(_prop_validators) | set(_prop_aliases))
+ if unknowns:
+ raise ValueError("Unknown artist properties: %s" % unknowns)
+
+ # Not a full validation, but it'll at least normalize property names
+ # A fuller validation would require v0.10 of cycler.
+ checker = set()
+ for prop in cycler_inst.keys:
+ norm_prop = _prop_aliases.get(prop, prop)
+ if norm_prop != prop and norm_prop in cycler_inst.keys:
+ raise ValueError(f"Cannot specify both {norm_prop!r} and alias "
+ f"{prop!r} in the same prop_cycle")
+ if norm_prop in checker:
+ raise ValueError(f"Another property was already aliased to "
+ f"{norm_prop!r}. Collision normalizing {prop!r}.")
+ checker.update([norm_prop])
+
+ # This is just an extra-careful check, just in case there is some
+ # edge-case I haven't thought of.
+ assert len(checker) == len(cycler_inst.keys)
+
+ # Now, it should be safe to mutate this cycler
+ for prop in cycler_inst.keys:
+ norm_prop = _prop_aliases.get(prop, prop)
+ cycler_inst.change_key(prop, norm_prop)
+
+ for key, vals in cycler_inst.by_key().items():
+ _prop_validators[key](vals)
+
+ return cycler_inst
+
+
+def validate_hist_bins(s):
+ valid_strs = ["auto", "sturges", "fd", "doane", "scott", "rice", "sqrt"]
+ if isinstance(s, str) and s in valid_strs:
+ return s
+ try:
+ return int(s)
+ except (TypeError, ValueError):
+ pass
+ try:
+ return validate_floatlist(s)
+ except ValueError:
+ pass
+ raise ValueError(f"'hist.bins' must be one of {valid_strs}, an int or"
+ " a sequence of floats")
+
+
+class _ignorecase(list):
+ """A marker class indicating that a list-of-str is case-insensitive."""
+
+
+def _convert_validator_spec(key, conv):
+ if isinstance(conv, list):
+ ignorecase = isinstance(conv, _ignorecase)
+ return ValidateInStrings(key, conv, ignorecase=ignorecase)
+ else:
+ return conv
+
+
+# Mapping of rcParams to validators.
+# Converters given as lists or _ignorecase are converted to ValidateInStrings
+# immediately below.
+# The rcParams defaults are defined in lib/matplotlib/mpl-data/matplotlibrc, which
+# gets copied to matplotlib/mpl-data/matplotlibrc by the setup script.
+_validators = {
+ "backend": validate_backend,
+ "backend_fallback": validate_bool,
+ "figure.hooks": validate_stringlist,
+ "toolbar": _validate_toolbar,
+ "interactive": validate_bool,
+ "timezone": validate_string,
+
+ "webagg.port": validate_int,
+ "webagg.address": validate_string,
+ "webagg.open_in_browser": validate_bool,
+ "webagg.port_retries": validate_int,
+
+ # line props
+ "lines.linewidth": validate_float, # line width in points
+ "lines.linestyle": _validate_linestyle, # solid line
+ "lines.color": validate_color, # first color in color cycle
+ "lines.marker": _validate_marker, # marker name
+ "lines.markerfacecolor": validate_color_or_auto, # default color
+ "lines.markeredgecolor": validate_color_or_auto, # default color
+ "lines.markeredgewidth": validate_float,
+ "lines.markersize": validate_float, # markersize, in points
+ "lines.antialiased": validate_bool, # antialiased (no jaggies)
+ "lines.dash_joinstyle": JoinStyle,
+ "lines.solid_joinstyle": JoinStyle,
+ "lines.dash_capstyle": CapStyle,
+ "lines.solid_capstyle": CapStyle,
+ "lines.dashed_pattern": validate_floatlist,
+ "lines.dashdot_pattern": validate_floatlist,
+ "lines.dotted_pattern": validate_floatlist,
+ "lines.scale_dashes": validate_bool,
+
+ # marker props
+ "markers.fillstyle": validate_fillstyle,
+
+ ## pcolor(mesh) props:
+ "pcolor.shading": ["auto", "flat", "nearest", "gouraud"],
+ "pcolormesh.snap": validate_bool,
+
+ ## patch props
+ "patch.linewidth": validate_float, # line width in points
+ "patch.edgecolor": validate_color,
+ "patch.force_edgecolor": validate_bool,
+ "patch.facecolor": validate_color, # first color in cycle
+ "patch.antialiased": validate_bool, # antialiased (no jaggies)
+
+ ## hatch props
+ "hatch.color": validate_color,
+ "hatch.linewidth": validate_float,
+
+ ## Histogram properties
+ "hist.bins": validate_hist_bins,
+
+ ## Boxplot properties
+ "boxplot.notch": validate_bool,
+ "boxplot.vertical": validate_bool,
+ "boxplot.whiskers": validate_whiskers,
+ "boxplot.bootstrap": validate_int_or_None,
+ "boxplot.patchartist": validate_bool,
+ "boxplot.showmeans": validate_bool,
+ "boxplot.showcaps": validate_bool,
+ "boxplot.showbox": validate_bool,
+ "boxplot.showfliers": validate_bool,
+ "boxplot.meanline": validate_bool,
+
+ "boxplot.flierprops.color": validate_color,
+ "boxplot.flierprops.marker": _validate_marker,
+ "boxplot.flierprops.markerfacecolor": validate_color_or_auto,
+ "boxplot.flierprops.markeredgecolor": validate_color,
+ "boxplot.flierprops.markeredgewidth": validate_float,
+ "boxplot.flierprops.markersize": validate_float,
+ "boxplot.flierprops.linestyle": _validate_linestyle,
+ "boxplot.flierprops.linewidth": validate_float,
+
+ "boxplot.boxprops.color": validate_color,
+ "boxplot.boxprops.linewidth": validate_float,
+ "boxplot.boxprops.linestyle": _validate_linestyle,
+
+ "boxplot.whiskerprops.color": validate_color,
+ "boxplot.whiskerprops.linewidth": validate_float,
+ "boxplot.whiskerprops.linestyle": _validate_linestyle,
+
+ "boxplot.capprops.color": validate_color,
+ "boxplot.capprops.linewidth": validate_float,
+ "boxplot.capprops.linestyle": _validate_linestyle,
+
+ "boxplot.medianprops.color": validate_color,
+ "boxplot.medianprops.linewidth": validate_float,
+ "boxplot.medianprops.linestyle": _validate_linestyle,
+
+ "boxplot.meanprops.color": validate_color,
+ "boxplot.meanprops.marker": _validate_marker,
+ "boxplot.meanprops.markerfacecolor": validate_color,
+ "boxplot.meanprops.markeredgecolor": validate_color,
+ "boxplot.meanprops.markersize": validate_float,
+ "boxplot.meanprops.linestyle": _validate_linestyle,
+ "boxplot.meanprops.linewidth": validate_float,
+
+ ## font props
+ "font.family": validate_stringlist, # used by text object
+ "font.style": validate_string,
+ "font.variant": validate_string,
+ "font.stretch": validate_fontstretch,
+ "font.weight": validate_fontweight,
+ "font.size": validate_float, # Base font size in points
+ "font.serif": validate_stringlist,
+ "font.sans-serif": validate_stringlist,
+ "font.cursive": validate_stringlist,
+ "font.fantasy": validate_stringlist,
+ "font.monospace": validate_stringlist,
+
+ # text props
+ "text.color": validate_color,
+ "text.usetex": validate_bool,
+ "text.latex.preamble": validate_string,
+ "text.hinting": ["default", "no_autohint", "force_autohint",
+ "no_hinting", "auto", "native", "either", "none"],
+ "text.hinting_factor": validate_int,
+ "text.kerning_factor": validate_int,
+ "text.antialiased": validate_bool,
+ "text.parse_math": validate_bool,
+
+ "mathtext.cal": validate_font_properties,
+ "mathtext.rm": validate_font_properties,
+ "mathtext.tt": validate_font_properties,
+ "mathtext.it": validate_font_properties,
+ "mathtext.bf": validate_font_properties,
+ "mathtext.bfit": validate_font_properties,
+ "mathtext.sf": validate_font_properties,
+ "mathtext.fontset": ["dejavusans", "dejavuserif", "cm", "stix",
+ "stixsans", "custom"],
+ "mathtext.default": ["rm", "cal", "bfit", "it", "tt", "sf", "bf", "default",
+ "bb", "frak", "scr", "regular"],
+ "mathtext.fallback": _validate_mathtext_fallback,
+
+ "image.aspect": validate_aspect, # equal, auto, a number
+ "image.interpolation": validate_string,
+ "image.interpolation_stage": ["auto", "data", "rgba"],
+ "image.cmap": _validate_cmap, # gray, jet, etc.
+ "image.lut": validate_int, # lookup table
+ "image.origin": ["upper", "lower"],
+ "image.resample": validate_bool,
+ # Specify whether vector graphics backends will combine all images on a
+ # set of Axes into a single composite image
+ "image.composite_image": validate_bool,
+
+ # contour props
+ "contour.negative_linestyle": _validate_linestyle,
+ "contour.corner_mask": validate_bool,
+ "contour.linewidth": validate_float_or_None,
+ "contour.algorithm": ["mpl2005", "mpl2014", "serial", "threaded"],
+
+ # errorbar props
+ "errorbar.capsize": validate_float,
+
+ # axis props
+ # alignment of x/y axis title
+ "xaxis.labellocation": ["left", "center", "right"],
+ "yaxis.labellocation": ["bottom", "center", "top"],
+
+ # Axes props
+ "axes.axisbelow": validate_axisbelow,
+ "axes.facecolor": validate_color, # background color
+ "axes.edgecolor": validate_color, # edge color
+ "axes.linewidth": validate_float, # edge linewidth
+
+ "axes.spines.left": validate_bool, # Set visibility of axes spines,
+ "axes.spines.right": validate_bool, # i.e., the lines around the chart
+ "axes.spines.bottom": validate_bool, # denoting data boundary.
+ "axes.spines.top": validate_bool,
+
+ "axes.titlesize": validate_fontsize, # Axes title fontsize
+ "axes.titlelocation": ["left", "center", "right"], # Axes title alignment
+ "axes.titleweight": validate_fontweight, # Axes title font weight
+ "axes.titlecolor": validate_color_or_auto, # Axes title font color
+ # title location, axes units, None means auto
+ "axes.titley": validate_float_or_None,
+ # pad from Axes top decoration to title in points
+ "axes.titlepad": validate_float,
+ "axes.grid": validate_bool, # display grid or not
+ "axes.grid.which": ["minor", "both", "major"], # which grids are drawn
+ "axes.grid.axis": ["x", "y", "both"], # grid type
+ "axes.labelsize": validate_fontsize, # fontsize of x & y labels
+ "axes.labelpad": validate_float, # space between label and axis
+ "axes.labelweight": validate_fontweight, # fontsize of x & y labels
+ "axes.labelcolor": validate_color, # color of axis label
+ # use scientific notation if log10 of the axis range is smaller than the
+ # first or larger than the second
+ "axes.formatter.limits": _listify_validator(validate_int, n=2),
+ # use current locale to format ticks
+ "axes.formatter.use_locale": validate_bool,
+ "axes.formatter.use_mathtext": validate_bool,
+ # minimum exponent to format in scientific notation
+ "axes.formatter.min_exponent": validate_int,
+ "axes.formatter.useoffset": validate_bool,
+ "axes.formatter.offset_threshold": validate_int,
+ "axes.unicode_minus": validate_bool,
+ # This entry can be either a cycler object or a string repr of a
+ # cycler-object, which gets eval()'ed to create the object.
+ "axes.prop_cycle": validate_cycler,
+ # If "data", axes limits are set close to the data.
+ # If "round_numbers" axes limits are set to the nearest round numbers.
+ "axes.autolimit_mode": ["data", "round_numbers"],
+ "axes.xmargin": _validate_greaterthan_minushalf, # margin added to xaxis
+ "axes.ymargin": _validate_greaterthan_minushalf, # margin added to yaxis
+ "axes.zmargin": _validate_greaterthan_minushalf, # margin added to zaxis
+
+ "polaraxes.grid": validate_bool, # display polar grid or not
+ "axes3d.grid": validate_bool, # display 3d grid
+ "axes3d.automargin": validate_bool, # automatically add margin when
+ # manually setting 3D axis limits
+
+ "axes3d.xaxis.panecolor": validate_color, # 3d background pane
+ "axes3d.yaxis.panecolor": validate_color, # 3d background pane
+ "axes3d.zaxis.panecolor": validate_color, # 3d background pane
+
+ "axes3d.mouserotationstyle": ["azel", "trackball", "sphere", "arcball"],
+ "axes3d.trackballsize": validate_float,
+ "axes3d.trackballborder": validate_float,
+
+ # scatter props
+ "scatter.marker": _validate_marker,
+ "scatter.edgecolors": validate_string,
+
+ "date.epoch": _validate_date,
+ "date.autoformatter.year": validate_string,
+ "date.autoformatter.month": validate_string,
+ "date.autoformatter.day": validate_string,
+ "date.autoformatter.hour": validate_string,
+ "date.autoformatter.minute": validate_string,
+ "date.autoformatter.second": validate_string,
+ "date.autoformatter.microsecond": validate_string,
+
+ 'date.converter': ['auto', 'concise'],
+ # for auto date locator, choose interval_multiples
+ 'date.interval_multiples': validate_bool,
+
+ # legend properties
+ "legend.fancybox": validate_bool,
+ "legend.loc": _validate_legend_loc,
+
+ # the number of points in the legend line
+ "legend.numpoints": validate_int,
+ # the number of points in the legend line for scatter
+ "legend.scatterpoints": validate_int,
+ "legend.fontsize": validate_fontsize,
+ "legend.title_fontsize": validate_fontsize_None,
+ # color of the legend
+ "legend.labelcolor": _validate_color_or_linecolor,
+ # the relative size of legend markers vs. original
+ "legend.markerscale": validate_float,
+ # using dict in rcParams not yet supported, so make sure it is bool
+ "legend.shadow": validate_bool,
+ # whether or not to draw a frame around legend
+ "legend.frameon": validate_bool,
+ # alpha value of the legend frame
+ "legend.framealpha": validate_float_or_None,
+
+ ## the following dimensions are in fraction of the font size
+ "legend.borderpad": validate_float, # units are fontsize
+ # the vertical space between the legend entries
+ "legend.labelspacing": validate_float,
+ # the length of the legend lines
+ "legend.handlelength": validate_float,
+ # the length of the legend lines
+ "legend.handleheight": validate_float,
+ # the space between the legend line and legend text
+ "legend.handletextpad": validate_float,
+ # the border between the Axes and legend edge
+ "legend.borderaxespad": validate_float,
+ # the border between the Axes and legend edge
+ "legend.columnspacing": validate_float,
+ "legend.facecolor": validate_color_or_inherit,
+ "legend.edgecolor": validate_color_or_inherit,
+
+ # tick properties
+ "xtick.top": validate_bool, # draw ticks on top side
+ "xtick.bottom": validate_bool, # draw ticks on bottom side
+ "xtick.labeltop": validate_bool, # draw label on top
+ "xtick.labelbottom": validate_bool, # draw label on bottom
+ "xtick.major.size": validate_float, # major xtick size in points
+ "xtick.minor.size": validate_float, # minor xtick size in points
+ "xtick.major.width": validate_float, # major xtick width in points
+ "xtick.minor.width": validate_float, # minor xtick width in points
+ "xtick.major.pad": validate_float, # distance to label in points
+ "xtick.minor.pad": validate_float, # distance to label in points
+ "xtick.color": validate_color, # color of xticks
+ "xtick.labelcolor": validate_color_or_inherit, # color of xtick labels
+ "xtick.minor.visible": validate_bool, # visibility of minor xticks
+ "xtick.minor.top": validate_bool, # draw top minor xticks
+ "xtick.minor.bottom": validate_bool, # draw bottom minor xticks
+ "xtick.major.top": validate_bool, # draw top major xticks
+ "xtick.major.bottom": validate_bool, # draw bottom major xticks
+ # number of minor xticks
+ "xtick.minor.ndivs": _validate_minor_tick_ndivs,
+ "xtick.labelsize": validate_fontsize, # fontsize of xtick labels
+ "xtick.direction": ["out", "in", "inout"], # direction of xticks
+ "xtick.alignment": ["center", "right", "left"],
+
+ "ytick.left": validate_bool, # draw ticks on left side
+ "ytick.right": validate_bool, # draw ticks on right side
+ "ytick.labelleft": validate_bool, # draw tick labels on left side
+ "ytick.labelright": validate_bool, # draw tick labels on right side
+ "ytick.major.size": validate_float, # major ytick size in points
+ "ytick.minor.size": validate_float, # minor ytick size in points
+ "ytick.major.width": validate_float, # major ytick width in points
+ "ytick.minor.width": validate_float, # minor ytick width in points
+ "ytick.major.pad": validate_float, # distance to label in points
+ "ytick.minor.pad": validate_float, # distance to label in points
+ "ytick.color": validate_color, # color of yticks
+ "ytick.labelcolor": validate_color_or_inherit, # color of ytick labels
+ "ytick.minor.visible": validate_bool, # visibility of minor yticks
+ "ytick.minor.left": validate_bool, # draw left minor yticks
+ "ytick.minor.right": validate_bool, # draw right minor yticks
+ "ytick.major.left": validate_bool, # draw left major yticks
+ "ytick.major.right": validate_bool, # draw right major yticks
+ # number of minor yticks
+ "ytick.minor.ndivs": _validate_minor_tick_ndivs,
+ "ytick.labelsize": validate_fontsize, # fontsize of ytick labels
+ "ytick.direction": ["out", "in", "inout"], # direction of yticks
+ "ytick.alignment": [
+ "center", "top", "bottom", "baseline", "center_baseline"],
+
+ "grid.color": validate_color, # grid color
+ "grid.linestyle": _validate_linestyle, # solid
+ "grid.linewidth": validate_float, # in points
+ "grid.alpha": validate_float,
+
+ ## figure props
+ # figure title
+ "figure.titlesize": validate_fontsize,
+ "figure.titleweight": validate_fontweight,
+
+ # figure labels
+ "figure.labelsize": validate_fontsize,
+ "figure.labelweight": validate_fontweight,
+
+ # figure size in inches: width by height
+ "figure.figsize": _listify_validator(validate_float, n=2),
+ "figure.dpi": validate_float,
+ "figure.facecolor": validate_color,
+ "figure.edgecolor": validate_color,
+ "figure.frameon": validate_bool,
+ "figure.autolayout": validate_bool,
+ "figure.max_open_warning": validate_int,
+ "figure.raise_window": validate_bool,
+ "macosx.window_mode": ["system", "tab", "window"],
+
+ "figure.subplot.left": validate_float,
+ "figure.subplot.right": validate_float,
+ "figure.subplot.bottom": validate_float,
+ "figure.subplot.top": validate_float,
+ "figure.subplot.wspace": validate_float,
+ "figure.subplot.hspace": validate_float,
+
+ "figure.constrained_layout.use": validate_bool, # run constrained_layout?
+ # wspace and hspace are fraction of adjacent subplots to use for space.
+ # Much smaller than above because we don't need room for the text.
+ "figure.constrained_layout.hspace": validate_float,
+ "figure.constrained_layout.wspace": validate_float,
+ # buffer around the Axes, in inches.
+ "figure.constrained_layout.h_pad": validate_float,
+ "figure.constrained_layout.w_pad": validate_float,
+
+ ## Saving figure's properties
+ 'savefig.dpi': validate_dpi,
+ 'savefig.facecolor': validate_color_or_auto,
+ 'savefig.edgecolor': validate_color_or_auto,
+ 'savefig.orientation': ['landscape', 'portrait'],
+ "savefig.format": validate_string,
+ "savefig.bbox": validate_bbox, # "tight", or "standard" (= None)
+ "savefig.pad_inches": validate_float,
+ # default directory in savefig dialog box
+ "savefig.directory": _validate_pathlike,
+ "savefig.transparent": validate_bool,
+
+ "tk.window_focus": validate_bool, # Maintain shell focus for TkAgg
+
+ # Set the papersize/type
+ "ps.papersize": _ignorecase(
+ ["figure", "letter", "legal", "ledger",
+ *[f"{ab}{i}" for ab in "ab" for i in range(11)]]),
+ "ps.useafm": validate_bool,
+ # use ghostscript or xpdf to distill ps output
+ "ps.usedistiller": validate_ps_distiller,
+ "ps.distiller.res": validate_int, # dpi
+ "ps.fonttype": validate_fonttype, # 3 (Type3) or 42 (Truetype)
+ "pdf.compression": validate_int, # 0-9 compression level; 0 to disable
+ "pdf.inheritcolor": validate_bool, # skip color setting commands
+ # use only the 14 PDF core fonts embedded in every PDF viewing application
+ "pdf.use14corefonts": validate_bool,
+ "pdf.fonttype": validate_fonttype, # 3 (Type3) or 42 (Truetype)
+
+ "pgf.texsystem": ["xelatex", "lualatex", "pdflatex"], # latex variant used
+ "pgf.rcfonts": validate_bool, # use mpl's rc settings for font config
+ "pgf.preamble": validate_string, # custom LaTeX preamble
+
+ # write raster image data into the svg file
+ "svg.image_inline": validate_bool,
+ "svg.fonttype": ["none", "path"], # save text as text ("none") or "paths"
+ "svg.hashsalt": validate_string_or_None,
+ "svg.id": validate_string_or_None,
+
+ # set this when you want to generate hardcopy docstring
+ "docstring.hardcopy": validate_bool,
+
+ "path.simplify": validate_bool,
+ "path.simplify_threshold": _validate_greaterequal0_lessequal1,
+ "path.snap": validate_bool,
+ "path.sketch": validate_sketch,
+ "path.effects": validate_anylist,
+ "agg.path.chunksize": validate_int, # 0 to disable chunking
+
+ # key-mappings (multi-character mappings should be a list/tuple)
+ "keymap.fullscreen": validate_stringlist,
+ "keymap.home": validate_stringlist,
+ "keymap.back": validate_stringlist,
+ "keymap.forward": validate_stringlist,
+ "keymap.pan": validate_stringlist,
+ "keymap.zoom": validate_stringlist,
+ "keymap.save": validate_stringlist,
+ "keymap.quit": validate_stringlist,
+ "keymap.quit_all": validate_stringlist, # e.g.: "W", "cmd+W", "Q"
+ "keymap.grid": validate_stringlist,
+ "keymap.grid_minor": validate_stringlist,
+ "keymap.yscale": validate_stringlist,
+ "keymap.xscale": validate_stringlist,
+ "keymap.help": validate_stringlist,
+ "keymap.copy": validate_stringlist,
+
+ # Animation settings
+ "animation.html": ["html5", "jshtml", "none"],
+ # Limit, in MB, of size of base64 encoded animation in HTML
+ # (i.e. IPython notebook)
+ "animation.embed_limit": validate_float,
+ "animation.writer": validate_string,
+ "animation.codec": validate_string,
+ "animation.bitrate": validate_int,
+ # Controls image format when frames are written to disk
+ "animation.frame_format": ["png", "jpeg", "tiff", "raw", "rgba", "ppm",
+ "sgi", "bmp", "pbm", "svg"],
+ # Path to ffmpeg binary. If just binary name, subprocess uses $PATH.
+ "animation.ffmpeg_path": _validate_pathlike,
+ # Additional arguments for ffmpeg movie writer (using pipes)
+ "animation.ffmpeg_args": validate_stringlist,
+ # Path to convert binary. If just binary name, subprocess uses $PATH.
+ "animation.convert_path": _validate_pathlike,
+ # Additional arguments for convert movie writer (using pipes)
+ "animation.convert_args": validate_stringlist,
+
+ # Classic (pre 2.0) compatibility mode
+ # This is used for things that are hard to make backward compatible
+ # with a sane rcParam alone. This does *not* turn on classic mode
+ # altogether. For that use `matplotlib.style.use("classic")`.
+ "_internal.classic_mode": validate_bool
+}
+_hardcoded_defaults = { # Defaults not inferred from
+ # lib/matplotlib/mpl-data/matplotlibrc...
+ # ... because they are private:
+ "_internal.classic_mode": False,
+ # ... because they are deprecated:
+ # No current deprecations.
+ # backend is handled separately when constructing rcParamsDefault.
+}
+_validators = {k: _convert_validator_spec(k, conv)
+ for k, conv in _validators.items()}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/rcsetup.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/rcsetup.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..1538dac7510ee54fff13977a408480bb2b45fa18
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/rcsetup.pyi
@@ -0,0 +1,159 @@
+from cycler import Cycler
+
+from collections.abc import Callable, Iterable
+from typing import Any, Literal, TypeVar
+from matplotlib.typing import ColorType, LineStyleType, MarkEveryType
+
+interactive_bk: list[str]
+non_interactive_bk: list[str]
+all_backends: list[str]
+
+_T = TypeVar("_T")
+
+def _listify_validator(s: Callable[[Any], _T]) -> Callable[[Any], list[_T]]: ...
+
+class ValidateInStrings:
+ key: str
+ ignorecase: bool
+ valid: dict[str, str]
+ def __init__(
+ self,
+ key: str,
+ valid: Iterable[str],
+ ignorecase: bool = ...,
+ *,
+ _deprecated_since: str | None = ...
+ ) -> None: ...
+ def __call__(self, s: Any) -> str: ...
+
+def validate_any(s: Any) -> Any: ...
+def validate_anylist(s: Any) -> list[Any]: ...
+def validate_bool(b: Any) -> bool: ...
+def validate_axisbelow(s: Any) -> bool | Literal["line"]: ...
+def validate_dpi(s: Any) -> Literal["figure"] | float: ...
+def validate_string(s: Any) -> str: ...
+def validate_string_or_None(s: Any) -> str | None: ...
+def validate_stringlist(s: Any) -> list[str]: ...
+def validate_int(s: Any) -> int: ...
+def validate_int_or_None(s: Any) -> int | None: ...
+def validate_float(s: Any) -> float: ...
+def validate_float_or_None(s: Any) -> float | None: ...
+def validate_floatlist(s: Any) -> list[float]: ...
+def _validate_marker(s: Any) -> int | str: ...
+def _validate_markerlist(s: Any) -> list[int | str]: ...
+def validate_fonttype(s: Any) -> int: ...
+
+_auto_backend_sentinel: object
+
+def validate_backend(s: Any) -> str: ...
+def validate_color_or_inherit(s: Any) -> Literal["inherit"] | ColorType: ...
+def validate_color_or_auto(s: Any) -> ColorType | Literal["auto"]: ...
+def validate_color_for_prop_cycle(s: Any) -> ColorType: ...
+def validate_color(s: Any) -> ColorType: ...
+def validate_colorlist(s: Any) -> list[ColorType]: ...
+def _validate_color_or_linecolor(
+ s: Any,
+) -> ColorType | Literal["linecolor", "markerfacecolor", "markeredgecolor"] | None: ...
+def validate_aspect(s: Any) -> Literal["auto", "equal"] | float: ...
+def validate_fontsize_None(
+ s: Any,
+) -> Literal[
+ "xx-small",
+ "x-small",
+ "small",
+ "medium",
+ "large",
+ "x-large",
+ "xx-large",
+ "smaller",
+ "larger",
+] | float | None: ...
+def validate_fontsize(
+ s: Any,
+) -> Literal[
+ "xx-small",
+ "x-small",
+ "small",
+ "medium",
+ "large",
+ "x-large",
+ "xx-large",
+ "smaller",
+ "larger",
+] | float: ...
+def validate_fontsizelist(
+ s: Any,
+) -> list[
+ Literal[
+ "xx-small",
+ "x-small",
+ "small",
+ "medium",
+ "large",
+ "x-large",
+ "xx-large",
+ "smaller",
+ "larger",
+ ]
+ | float
+]: ...
+def validate_fontweight(
+ s: Any,
+) -> Literal[
+ "ultralight",
+ "light",
+ "normal",
+ "regular",
+ "book",
+ "medium",
+ "roman",
+ "semibold",
+ "demibold",
+ "demi",
+ "bold",
+ "heavy",
+ "extra bold",
+ "black",
+] | int: ...
+def validate_fontstretch(
+ s: Any,
+) -> Literal[
+ "ultra-condensed",
+ "extra-condensed",
+ "condensed",
+ "semi-condensed",
+ "normal",
+ "semi-expanded",
+ "expanded",
+ "extra-expanded",
+ "ultra-expanded",
+] | int: ...
+def validate_font_properties(s: Any) -> dict[str, Any]: ...
+def validate_whiskers(s: Any) -> list[float] | float: ...
+def validate_ps_distiller(s: Any) -> None | Literal["ghostscript", "xpdf"]: ...
+
+validate_fillstyle: ValidateInStrings
+
+def validate_fillstylelist(
+ s: Any,
+) -> list[Literal["full", "left", "right", "bottom", "top", "none"]]: ...
+def validate_markevery(s: Any) -> MarkEveryType: ...
+def _validate_linestyle(s: Any) -> LineStyleType: ...
+def validate_markeverylist(s: Any) -> list[MarkEveryType]: ...
+def validate_bbox(s: Any) -> Literal["tight", "standard"] | None: ...
+def validate_sketch(s: Any) -> None | tuple[float, float, float]: ...
+def validate_hatch(s: Any) -> str: ...
+def validate_hatchlist(s: Any) -> list[str]: ...
+def validate_dashlist(s: Any) -> list[list[float]]: ...
+
+# TODO: copy cycler overloads?
+def cycler(*args, **kwargs) -> Cycler: ...
+def validate_cycler(s: Any) -> Cycler: ...
+def validate_hist_bins(
+ s: Any,
+) -> Literal["auto", "sturges", "fd", "doane", "scott", "rice", "sqrt"] | int | list[
+ float
+]: ...
+
+# At runtime is added in __init__.py
+defaultParams: dict[str, Any]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sankey.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sankey.py
new file mode 100644
index 0000000000000000000000000000000000000000..637cfc849f9dc8ef3916883d5870bcbdde67e632
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sankey.py
@@ -0,0 +1,814 @@
+"""
+Module for creating Sankey diagrams using Matplotlib.
+"""
+
+import logging
+from types import SimpleNamespace
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib.path import Path
+from matplotlib.patches import PathPatch
+from matplotlib.transforms import Affine2D
+from matplotlib import _docstring
+
+_log = logging.getLogger(__name__)
+
+__author__ = "Kevin L. Davies"
+__credits__ = ["Yannick Copin"]
+__license__ = "BSD"
+__version__ = "2011/09/16"
+
+# Angles [deg/90]
+RIGHT = 0
+UP = 1
+# LEFT = 2
+DOWN = 3
+
+
+class Sankey:
+ """
+ Sankey diagram.
+
+ Sankey diagrams are a specific type of flow diagram, in which
+ the width of the arrows is shown proportionally to the flow
+ quantity. They are typically used to visualize energy or
+ material or cost transfers between processes.
+ `Wikipedia (6/1/2011) `_
+
+ """
+
+ def __init__(self, ax=None, scale=1.0, unit='', format='%G', gap=0.25,
+ radius=0.1, shoulder=0.03, offset=0.15, head_angle=100,
+ margin=0.4, tolerance=1e-6, **kwargs):
+ """
+ Create a new Sankey instance.
+
+ The optional arguments listed below are applied to all subdiagrams so
+ that there is consistent alignment and formatting.
+
+ In order to draw a complex Sankey diagram, create an instance of
+ `Sankey` by calling it without any kwargs::
+
+ sankey = Sankey()
+
+ Then add simple Sankey sub-diagrams::
+
+ sankey.add() # 1
+ sankey.add() # 2
+ #...
+ sankey.add() # n
+
+ Finally, create the full diagram::
+
+ sankey.finish()
+
+ Or, instead, simply daisy-chain those calls::
+
+ Sankey().add().add... .add().finish()
+
+ Other Parameters
+ ----------------
+ ax : `~matplotlib.axes.Axes`
+ Axes onto which the data should be plotted. If *ax* isn't
+ provided, new Axes will be created.
+ scale : float
+ Scaling factor for the flows. *scale* sizes the width of the paths
+ in order to maintain proper layout. The same scale is applied to
+ all subdiagrams. The value should be chosen such that the product
+ of the scale and the sum of the inputs is approximately 1.0 (and
+ the product of the scale and the sum of the outputs is
+ approximately -1.0).
+ unit : str
+ The physical unit associated with the flow quantities. If *unit*
+ is None, then none of the quantities are labeled.
+ format : str or callable
+ A Python number formatting string or callable used to label the
+ flows with their quantities (i.e., a number times a unit, where the
+ unit is given). If a format string is given, the label will be
+ ``format % quantity``. If a callable is given, it will be called
+ with ``quantity`` as an argument.
+ gap : float
+ Space between paths that break in/break away to/from the top or
+ bottom.
+ radius : float
+ Inner radius of the vertical paths.
+ shoulder : float
+ Size of the shoulders of output arrows.
+ offset : float
+ Text offset (from the dip or tip of the arrow).
+ head_angle : float
+ Angle, in degrees, of the arrow heads (and negative of the angle of
+ the tails).
+ margin : float
+ Minimum space between Sankey outlines and the edge of the plot
+ area.
+ tolerance : float
+ Acceptable maximum of the magnitude of the sum of flows. The
+ magnitude of the sum of connected flows cannot be greater than
+ *tolerance*.
+ **kwargs
+ Any additional keyword arguments will be passed to `add`, which
+ will create the first subdiagram.
+
+ See Also
+ --------
+ Sankey.add
+ Sankey.finish
+
+ Examples
+ --------
+ .. plot:: gallery/specialty_plots/sankey_basics.py
+ """
+ # Check the arguments.
+ if gap < 0:
+ raise ValueError(
+ "'gap' is negative, which is not allowed because it would "
+ "cause the paths to overlap")
+ if radius > gap:
+ raise ValueError(
+ "'radius' is greater than 'gap', which is not allowed because "
+ "it would cause the paths to overlap")
+ if head_angle < 0:
+ raise ValueError(
+ "'head_angle' is negative, which is not allowed because it "
+ "would cause inputs to look like outputs and vice versa")
+ if tolerance < 0:
+ raise ValueError(
+ "'tolerance' is negative, but it must be a magnitude")
+
+ # Create Axes if necessary.
+ if ax is None:
+ import matplotlib.pyplot as plt
+ fig = plt.figure()
+ ax = fig.add_subplot(1, 1, 1, xticks=[], yticks=[])
+
+ self.diagrams = []
+
+ # Store the inputs.
+ self.ax = ax
+ self.unit = unit
+ self.format = format
+ self.scale = scale
+ self.gap = gap
+ self.radius = radius
+ self.shoulder = shoulder
+ self.offset = offset
+ self.margin = margin
+ self.pitch = np.tan(np.pi * (1 - head_angle / 180.0) / 2.0)
+ self.tolerance = tolerance
+
+ # Initialize the vertices of tight box around the diagram(s).
+ self.extent = np.array((np.inf, -np.inf, np.inf, -np.inf))
+
+ # If there are any kwargs, create the first subdiagram.
+ if len(kwargs):
+ self.add(**kwargs)
+
+ def _arc(self, quadrant=0, cw=True, radius=1, center=(0, 0)):
+ """
+ Return the codes and vertices for a rotated, scaled, and translated
+ 90 degree arc.
+
+ Other Parameters
+ ----------------
+ quadrant : {0, 1, 2, 3}, default: 0
+ Uses 0-based indexing (0, 1, 2, or 3).
+ cw : bool, default: True
+ If True, the arc vertices are produced clockwise; counter-clockwise
+ otherwise.
+ radius : float, default: 1
+ The radius of the arc.
+ center : (float, float), default: (0, 0)
+ (x, y) tuple of the arc's center.
+ """
+ # Note: It would be possible to use matplotlib's transforms to rotate,
+ # scale, and translate the arc, but since the angles are discrete,
+ # it's just as easy and maybe more efficient to do it here.
+ ARC_CODES = [Path.LINETO,
+ Path.CURVE4,
+ Path.CURVE4,
+ Path.CURVE4,
+ Path.CURVE4,
+ Path.CURVE4,
+ Path.CURVE4]
+ # Vertices of a cubic Bezier curve approximating a 90 deg arc
+ # These can be determined by Path.arc(0, 90).
+ ARC_VERTICES = np.array([[1.00000000e+00, 0.00000000e+00],
+ [1.00000000e+00, 2.65114773e-01],
+ [8.94571235e-01, 5.19642327e-01],
+ [7.07106781e-01, 7.07106781e-01],
+ [5.19642327e-01, 8.94571235e-01],
+ [2.65114773e-01, 1.00000000e+00],
+ # Insignificant
+ # [6.12303177e-17, 1.00000000e+00]])
+ [0.00000000e+00, 1.00000000e+00]])
+ if quadrant in (0, 2):
+ if cw:
+ vertices = ARC_VERTICES
+ else:
+ vertices = ARC_VERTICES[:, ::-1] # Swap x and y.
+ else: # 1, 3
+ # Negate x.
+ if cw:
+ # Swap x and y.
+ vertices = np.column_stack((-ARC_VERTICES[:, 1],
+ ARC_VERTICES[:, 0]))
+ else:
+ vertices = np.column_stack((-ARC_VERTICES[:, 0],
+ ARC_VERTICES[:, 1]))
+ if quadrant > 1:
+ radius = -radius # Rotate 180 deg.
+ return list(zip(ARC_CODES, radius * vertices +
+ np.tile(center, (ARC_VERTICES.shape[0], 1))))
+
+ def _add_input(self, path, angle, flow, length):
+ """
+ Add an input to a path and return its tip and label locations.
+ """
+ if angle is None:
+ return [0, 0], [0, 0]
+ else:
+ x, y = path[-1][1] # Use the last point as a reference.
+ dipdepth = (flow / 2) * self.pitch
+ if angle == RIGHT:
+ x -= length
+ dip = [x + dipdepth, y + flow / 2.0]
+ path.extend([(Path.LINETO, [x, y]),
+ (Path.LINETO, dip),
+ (Path.LINETO, [x, y + flow]),
+ (Path.LINETO, [x + self.gap, y + flow])])
+ label_location = [dip[0] - self.offset, dip[1]]
+ else: # Vertical
+ x -= self.gap
+ if angle == UP:
+ sign = 1
+ else:
+ sign = -1
+
+ dip = [x - flow / 2, y - sign * (length - dipdepth)]
+ if angle == DOWN:
+ quadrant = 2
+ else:
+ quadrant = 1
+
+ # Inner arc isn't needed if inner radius is zero
+ if self.radius:
+ path.extend(self._arc(quadrant=quadrant,
+ cw=angle == UP,
+ radius=self.radius,
+ center=(x + self.radius,
+ y - sign * self.radius)))
+ else:
+ path.append((Path.LINETO, [x, y]))
+ path.extend([(Path.LINETO, [x, y - sign * length]),
+ (Path.LINETO, dip),
+ (Path.LINETO, [x - flow, y - sign * length])])
+ path.extend(self._arc(quadrant=quadrant,
+ cw=angle == DOWN,
+ radius=flow + self.radius,
+ center=(x + self.radius,
+ y - sign * self.radius)))
+ path.append((Path.LINETO, [x - flow, y + sign * flow]))
+ label_location = [dip[0], dip[1] - sign * self.offset]
+
+ return dip, label_location
+
+ def _add_output(self, path, angle, flow, length):
+ """
+ Append an output to a path and return its tip and label locations.
+
+ .. note:: *flow* is negative for an output.
+ """
+ if angle is None:
+ return [0, 0], [0, 0]
+ else:
+ x, y = path[-1][1] # Use the last point as a reference.
+ tipheight = (self.shoulder - flow / 2) * self.pitch
+ if angle == RIGHT:
+ x += length
+ tip = [x + tipheight, y + flow / 2.0]
+ path.extend([(Path.LINETO, [x, y]),
+ (Path.LINETO, [x, y + self.shoulder]),
+ (Path.LINETO, tip),
+ (Path.LINETO, [x, y - self.shoulder + flow]),
+ (Path.LINETO, [x, y + flow]),
+ (Path.LINETO, [x - self.gap, y + flow])])
+ label_location = [tip[0] + self.offset, tip[1]]
+ else: # Vertical
+ x += self.gap
+ if angle == UP:
+ sign, quadrant = 1, 3
+ else:
+ sign, quadrant = -1, 0
+
+ tip = [x - flow / 2.0, y + sign * (length + tipheight)]
+ # Inner arc isn't needed if inner radius is zero
+ if self.radius:
+ path.extend(self._arc(quadrant=quadrant,
+ cw=angle == UP,
+ radius=self.radius,
+ center=(x - self.radius,
+ y + sign * self.radius)))
+ else:
+ path.append((Path.LINETO, [x, y]))
+ path.extend([(Path.LINETO, [x, y + sign * length]),
+ (Path.LINETO, [x - self.shoulder,
+ y + sign * length]),
+ (Path.LINETO, tip),
+ (Path.LINETO, [x + self.shoulder - flow,
+ y + sign * length]),
+ (Path.LINETO, [x - flow, y + sign * length])])
+ path.extend(self._arc(quadrant=quadrant,
+ cw=angle == DOWN,
+ radius=self.radius - flow,
+ center=(x - self.radius,
+ y + sign * self.radius)))
+ path.append((Path.LINETO, [x - flow, y + sign * flow]))
+ label_location = [tip[0], tip[1] + sign * self.offset]
+ return tip, label_location
+
+ def _revert(self, path, first_action=Path.LINETO):
+ """
+ A path is not simply reversible by path[::-1] since the code
+ specifies an action to take from the **previous** point.
+ """
+ reverse_path = []
+ next_code = first_action
+ for code, position in path[::-1]:
+ reverse_path.append((next_code, position))
+ next_code = code
+ return reverse_path
+ # This might be more efficient, but it fails because 'tuple' object
+ # doesn't support item assignment:
+ # path[1] = path[1][-1:0:-1]
+ # path[1][0] = first_action
+ # path[2] = path[2][::-1]
+ # return path
+
+ @_docstring.interpd
+ def add(self, patchlabel='', flows=None, orientations=None, labels='',
+ trunklength=1.0, pathlengths=0.25, prior=None, connect=(0, 0),
+ rotation=0, **kwargs):
+ """
+ Add a simple Sankey diagram with flows at the same hierarchical level.
+
+ Parameters
+ ----------
+ patchlabel : str
+ Label to be placed at the center of the diagram.
+ Note that *label* (not *patchlabel*) can be passed as keyword
+ argument to create an entry in the legend.
+
+ flows : list of float
+ Array of flow values. By convention, inputs are positive and
+ outputs are negative.
+
+ Flows are placed along the top of the diagram from the inside out
+ in order of their index within *flows*. They are placed along the
+ sides of the diagram from the top down and along the bottom from
+ the outside in.
+
+ If the sum of the inputs and outputs is
+ nonzero, the discrepancy will appear as a cubic BƩzier curve along
+ the top and bottom edges of the trunk.
+
+ orientations : list of {-1, 0, 1}
+ List of orientations of the flows (or a single orientation to be
+ used for all flows). Valid values are 0 (inputs from
+ the left, outputs to the right), 1 (from and to the top) or -1
+ (from and to the bottom).
+
+ labels : list of (str or None)
+ List of labels for the flows (or a single label to be used for all
+ flows). Each label may be *None* (no label), or a labeling string.
+ If an entry is a (possibly empty) string, then the quantity for the
+ corresponding flow will be shown below the string. However, if
+ the *unit* of the main diagram is None, then quantities are never
+ shown, regardless of the value of this argument.
+
+ trunklength : float
+ Length between the bases of the input and output groups (in
+ data-space units).
+
+ pathlengths : list of float
+ List of lengths of the vertical arrows before break-in or after
+ break-away. If a single value is given, then it will be applied to
+ the first (inside) paths on the top and bottom, and the length of
+ all other arrows will be justified accordingly. The *pathlengths*
+ are not applied to the horizontal inputs and outputs.
+
+ prior : int
+ Index of the prior diagram to which this diagram should be
+ connected.
+
+ connect : (int, int)
+ A (prior, this) tuple indexing the flow of the prior diagram and
+ the flow of this diagram which should be connected. If this is the
+ first diagram or *prior* is *None*, *connect* will be ignored.
+
+ rotation : float
+ Angle of rotation of the diagram in degrees. The interpretation of
+ the *orientations* argument will be rotated accordingly (e.g., if
+ *rotation* == 90, an *orientations* entry of 1 means to/from the
+ left). *rotation* is ignored if this diagram is connected to an
+ existing one (using *prior* and *connect*).
+
+ Returns
+ -------
+ Sankey
+ The current `.Sankey` instance.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Additional keyword arguments set `matplotlib.patches.PathPatch`
+ properties, listed below. For example, one may want to use
+ ``fill=False`` or ``label="A legend entry"``.
+
+ %(Patch:kwdoc)s
+
+ See Also
+ --------
+ Sankey.finish
+ """
+ # Check and preprocess the arguments.
+ flows = np.array([1.0, -1.0]) if flows is None else np.array(flows)
+ n = flows.shape[0] # Number of flows
+ if rotation is None:
+ rotation = 0
+ else:
+ # In the code below, angles are expressed in deg/90.
+ rotation /= 90.0
+ if orientations is None:
+ orientations = 0
+ try:
+ orientations = np.broadcast_to(orientations, n)
+ except ValueError:
+ raise ValueError(
+ f"The shapes of 'flows' {np.shape(flows)} and 'orientations' "
+ f"{np.shape(orientations)} are incompatible"
+ ) from None
+ try:
+ labels = np.broadcast_to(labels, n)
+ except ValueError:
+ raise ValueError(
+ f"The shapes of 'flows' {np.shape(flows)} and 'labels' "
+ f"{np.shape(labels)} are incompatible"
+ ) from None
+ if trunklength < 0:
+ raise ValueError(
+ "'trunklength' is negative, which is not allowed because it "
+ "would cause poor layout")
+ if abs(np.sum(flows)) > self.tolerance:
+ _log.info("The sum of the flows is nonzero (%f; patchlabel=%r); "
+ "is the system not at steady state?",
+ np.sum(flows), patchlabel)
+ scaled_flows = self.scale * flows
+ gain = sum(max(flow, 0) for flow in scaled_flows)
+ loss = sum(min(flow, 0) for flow in scaled_flows)
+ if prior is not None:
+ if prior < 0:
+ raise ValueError("The index of the prior diagram is negative")
+ if min(connect) < 0:
+ raise ValueError(
+ "At least one of the connection indices is negative")
+ if prior >= len(self.diagrams):
+ raise ValueError(
+ f"The index of the prior diagram is {prior}, but there "
+ f"are only {len(self.diagrams)} other diagrams")
+ if connect[0] >= len(self.diagrams[prior].flows):
+ raise ValueError(
+ "The connection index to the source diagram is {}, but "
+ "that diagram has only {} flows".format(
+ connect[0], len(self.diagrams[prior].flows)))
+ if connect[1] >= n:
+ raise ValueError(
+ f"The connection index to this diagram is {connect[1]}, "
+ f"but this diagram has only {n} flows")
+ if self.diagrams[prior].angles[connect[0]] is None:
+ raise ValueError(
+ f"The connection cannot be made, which may occur if the "
+ f"magnitude of flow {connect[0]} of diagram {prior} is "
+ f"less than the specified tolerance")
+ flow_error = (self.diagrams[prior].flows[connect[0]] +
+ flows[connect[1]])
+ if abs(flow_error) >= self.tolerance:
+ raise ValueError(
+ f"The scaled sum of the connected flows is {flow_error}, "
+ f"which is not within the tolerance ({self.tolerance})")
+
+ # Determine if the flows are inputs.
+ are_inputs = [None] * n
+ for i, flow in enumerate(flows):
+ if flow >= self.tolerance:
+ are_inputs[i] = True
+ elif flow <= -self.tolerance:
+ are_inputs[i] = False
+ else:
+ _log.info(
+ "The magnitude of flow %d (%f) is below the tolerance "
+ "(%f).\nIt will not be shown, and it cannot be used in a "
+ "connection.", i, flow, self.tolerance)
+
+ # Determine the angles of the arrows (before rotation).
+ angles = [None] * n
+ for i, (orient, is_input) in enumerate(zip(orientations, are_inputs)):
+ if orient == 1:
+ if is_input:
+ angles[i] = DOWN
+ elif is_input is False:
+ # Be specific since is_input can be None.
+ angles[i] = UP
+ elif orient == 0:
+ if is_input is not None:
+ angles[i] = RIGHT
+ else:
+ if orient != -1:
+ raise ValueError(
+ f"The value of orientations[{i}] is {orient}, "
+ f"but it must be -1, 0, or 1")
+ if is_input:
+ angles[i] = UP
+ elif is_input is False:
+ angles[i] = DOWN
+
+ # Justify the lengths of the paths.
+ if np.iterable(pathlengths):
+ if len(pathlengths) != n:
+ raise ValueError(
+ f"The lengths of 'flows' ({n}) and 'pathlengths' "
+ f"({len(pathlengths)}) are incompatible")
+ else: # Make pathlengths into a list.
+ urlength = pathlengths
+ ullength = pathlengths
+ lrlength = pathlengths
+ lllength = pathlengths
+ d = dict(RIGHT=pathlengths)
+ pathlengths = [d.get(angle, 0) for angle in angles]
+ # Determine the lengths of the top-side arrows
+ # from the middle outwards.
+ for i, (angle, is_input, flow) in enumerate(zip(angles, are_inputs,
+ scaled_flows)):
+ if angle == DOWN and is_input:
+ pathlengths[i] = ullength
+ ullength += flow
+ elif angle == UP and is_input is False:
+ pathlengths[i] = urlength
+ urlength -= flow # Flow is negative for outputs.
+ # Determine the lengths of the bottom-side arrows
+ # from the middle outwards.
+ for i, (angle, is_input, flow) in enumerate(reversed(list(zip(
+ angles, are_inputs, scaled_flows)))):
+ if angle == UP and is_input:
+ pathlengths[n - i - 1] = lllength
+ lllength += flow
+ elif angle == DOWN and is_input is False:
+ pathlengths[n - i - 1] = lrlength
+ lrlength -= flow
+ # Determine the lengths of the left-side arrows
+ # from the bottom upwards.
+ has_left_input = False
+ for i, (angle, is_input, spec) in enumerate(reversed(list(zip(
+ angles, are_inputs, zip(scaled_flows, pathlengths))))):
+ if angle == RIGHT:
+ if is_input:
+ if has_left_input:
+ pathlengths[n - i - 1] = 0
+ else:
+ has_left_input = True
+ # Determine the lengths of the right-side arrows
+ # from the top downwards.
+ has_right_output = False
+ for i, (angle, is_input, spec) in enumerate(zip(
+ angles, are_inputs, list(zip(scaled_flows, pathlengths)))):
+ if angle == RIGHT:
+ if is_input is False:
+ if has_right_output:
+ pathlengths[i] = 0
+ else:
+ has_right_output = True
+
+ # Begin the subpaths, and smooth the transition if the sum of the flows
+ # is nonzero.
+ urpath = [(Path.MOVETO, [(self.gap - trunklength / 2.0), # Upper right
+ gain / 2.0]),
+ (Path.LINETO, [(self.gap - trunklength / 2.0) / 2.0,
+ gain / 2.0]),
+ (Path.CURVE4, [(self.gap - trunklength / 2.0) / 8.0,
+ gain / 2.0]),
+ (Path.CURVE4, [(trunklength / 2.0 - self.gap) / 8.0,
+ -loss / 2.0]),
+ (Path.LINETO, [(trunklength / 2.0 - self.gap) / 2.0,
+ -loss / 2.0]),
+ (Path.LINETO, [(trunklength / 2.0 - self.gap),
+ -loss / 2.0])]
+ llpath = [(Path.LINETO, [(trunklength / 2.0 - self.gap), # Lower left
+ loss / 2.0]),
+ (Path.LINETO, [(trunklength / 2.0 - self.gap) / 2.0,
+ loss / 2.0]),
+ (Path.CURVE4, [(trunklength / 2.0 - self.gap) / 8.0,
+ loss / 2.0]),
+ (Path.CURVE4, [(self.gap - trunklength / 2.0) / 8.0,
+ -gain / 2.0]),
+ (Path.LINETO, [(self.gap - trunklength / 2.0) / 2.0,
+ -gain / 2.0]),
+ (Path.LINETO, [(self.gap - trunklength / 2.0),
+ -gain / 2.0])]
+ lrpath = [(Path.LINETO, [(trunklength / 2.0 - self.gap), # Lower right
+ loss / 2.0])]
+ ulpath = [(Path.LINETO, [self.gap - trunklength / 2.0, # Upper left
+ gain / 2.0])]
+
+ # Add the subpaths and assign the locations of the tips and labels.
+ tips = np.zeros((n, 2))
+ label_locations = np.zeros((n, 2))
+ # Add the top-side inputs and outputs from the middle outwards.
+ for i, (angle, is_input, spec) in enumerate(zip(
+ angles, are_inputs, list(zip(scaled_flows, pathlengths)))):
+ if angle == DOWN and is_input:
+ tips[i, :], label_locations[i, :] = self._add_input(
+ ulpath, angle, *spec)
+ elif angle == UP and is_input is False:
+ tips[i, :], label_locations[i, :] = self._add_output(
+ urpath, angle, *spec)
+ # Add the bottom-side inputs and outputs from the middle outwards.
+ for i, (angle, is_input, spec) in enumerate(reversed(list(zip(
+ angles, are_inputs, list(zip(scaled_flows, pathlengths)))))):
+ if angle == UP and is_input:
+ tip, label_location = self._add_input(llpath, angle, *spec)
+ tips[n - i - 1, :] = tip
+ label_locations[n - i - 1, :] = label_location
+ elif angle == DOWN and is_input is False:
+ tip, label_location = self._add_output(lrpath, angle, *spec)
+ tips[n - i - 1, :] = tip
+ label_locations[n - i - 1, :] = label_location
+ # Add the left-side inputs from the bottom upwards.
+ has_left_input = False
+ for i, (angle, is_input, spec) in enumerate(reversed(list(zip(
+ angles, are_inputs, list(zip(scaled_flows, pathlengths)))))):
+ if angle == RIGHT and is_input:
+ if not has_left_input:
+ # Make sure the lower path extends
+ # at least as far as the upper one.
+ if llpath[-1][1][0] > ulpath[-1][1][0]:
+ llpath.append((Path.LINETO, [ulpath[-1][1][0],
+ llpath[-1][1][1]]))
+ has_left_input = True
+ tip, label_location = self._add_input(llpath, angle, *spec)
+ tips[n - i - 1, :] = tip
+ label_locations[n - i - 1, :] = label_location
+ # Add the right-side outputs from the top downwards.
+ has_right_output = False
+ for i, (angle, is_input, spec) in enumerate(zip(
+ angles, are_inputs, list(zip(scaled_flows, pathlengths)))):
+ if angle == RIGHT and is_input is False:
+ if not has_right_output:
+ # Make sure the upper path extends
+ # at least as far as the lower one.
+ if urpath[-1][1][0] < lrpath[-1][1][0]:
+ urpath.append((Path.LINETO, [lrpath[-1][1][0],
+ urpath[-1][1][1]]))
+ has_right_output = True
+ tips[i, :], label_locations[i, :] = self._add_output(
+ urpath, angle, *spec)
+ # Trim any hanging vertices.
+ if not has_left_input:
+ ulpath.pop()
+ llpath.pop()
+ if not has_right_output:
+ lrpath.pop()
+ urpath.pop()
+
+ # Concatenate the subpaths in the correct order (clockwise from top).
+ path = (urpath + self._revert(lrpath) + llpath + self._revert(ulpath) +
+ [(Path.CLOSEPOLY, urpath[0][1])])
+
+ # Create a patch with the Sankey outline.
+ codes, vertices = zip(*path)
+ vertices = np.array(vertices)
+
+ def _get_angle(a, r):
+ if a is None:
+ return None
+ else:
+ return a + r
+
+ if prior is None:
+ if rotation != 0: # By default, none of this is needed.
+ angles = [_get_angle(angle, rotation) for angle in angles]
+ rotate = Affine2D().rotate_deg(rotation * 90).transform_affine
+ tips = rotate(tips)
+ label_locations = rotate(label_locations)
+ vertices = rotate(vertices)
+ text = self.ax.text(0, 0, s=patchlabel, ha='center', va='center')
+ else:
+ rotation = (self.diagrams[prior].angles[connect[0]] -
+ angles[connect[1]])
+ angles = [_get_angle(angle, rotation) for angle in angles]
+ rotate = Affine2D().rotate_deg(rotation * 90).transform_affine
+ tips = rotate(tips)
+ offset = self.diagrams[prior].tips[connect[0]] - tips[connect[1]]
+ translate = Affine2D().translate(*offset).transform_affine
+ tips = translate(tips)
+ label_locations = translate(rotate(label_locations))
+ vertices = translate(rotate(vertices))
+ kwds = dict(s=patchlabel, ha='center', va='center')
+ text = self.ax.text(*offset, **kwds)
+ if mpl.rcParams['_internal.classic_mode']:
+ fc = kwargs.pop('fc', kwargs.pop('facecolor', '#bfd1d4'))
+ lw = kwargs.pop('lw', kwargs.pop('linewidth', 0.5))
+ else:
+ fc = kwargs.pop('fc', kwargs.pop('facecolor', None))
+ lw = kwargs.pop('lw', kwargs.pop('linewidth', None))
+ if fc is None:
+ fc = self.ax._get_patches_for_fill.get_next_color()
+ patch = PathPatch(Path(vertices, codes), fc=fc, lw=lw, **kwargs)
+ self.ax.add_patch(patch)
+
+ # Add the path labels.
+ texts = []
+ for number, angle, label, location in zip(flows, angles, labels,
+ label_locations):
+ if label is None or angle is None:
+ label = ''
+ elif self.unit is not None:
+ if isinstance(self.format, str):
+ quantity = self.format % abs(number) + self.unit
+ elif callable(self.format):
+ quantity = self.format(number)
+ else:
+ raise TypeError(
+ 'format must be callable or a format string')
+ if label != '':
+ label += "\n"
+ label += quantity
+ texts.append(self.ax.text(x=location[0], y=location[1],
+ s=label,
+ ha='center', va='center'))
+ # Text objects are placed even they are empty (as long as the magnitude
+ # of the corresponding flow is larger than the tolerance) in case the
+ # user wants to provide labels later.
+
+ # Expand the size of the diagram if necessary.
+ self.extent = (min(np.min(vertices[:, 0]),
+ np.min(label_locations[:, 0]),
+ self.extent[0]),
+ max(np.max(vertices[:, 0]),
+ np.max(label_locations[:, 0]),
+ self.extent[1]),
+ min(np.min(vertices[:, 1]),
+ np.min(label_locations[:, 1]),
+ self.extent[2]),
+ max(np.max(vertices[:, 1]),
+ np.max(label_locations[:, 1]),
+ self.extent[3]))
+ # Include both vertices _and_ label locations in the extents; there are
+ # where either could determine the margins (e.g., arrow shoulders).
+
+ # Add this diagram as a subdiagram.
+ self.diagrams.append(
+ SimpleNamespace(patch=patch, flows=flows, angles=angles, tips=tips,
+ text=text, texts=texts))
+
+ # Allow a daisy-chained call structure (see docstring for the class).
+ return self
+
+ def finish(self):
+ """
+ Adjust the Axes and return a list of information about the Sankey
+ subdiagram(s).
+
+ Returns a list of subdiagrams with the following fields:
+
+ ======== =============================================================
+ Field Description
+ ======== =============================================================
+ *patch* Sankey outline (a `~matplotlib.patches.PathPatch`).
+ *flows* Flow values (positive for input, negative for output).
+ *angles* List of angles of the arrows [deg/90].
+ For example, if the diagram has not been rotated,
+ an input to the top side has an angle of 3 (DOWN),
+ and an output from the top side has an angle of 1 (UP).
+ If a flow has been skipped (because its magnitude is less
+ than *tolerance*), then its angle will be *None*.
+ *tips* (N, 2)-array of the (x, y) positions of the tips (or "dips")
+ of the flow paths.
+ If the magnitude of a flow is less the *tolerance* of this
+ `Sankey` instance, the flow is skipped and its tip will be at
+ the center of the diagram.
+ *text* `.Text` instance for the diagram label.
+ *texts* List of `.Text` instances for the flow labels.
+ ======== =============================================================
+
+ See Also
+ --------
+ Sankey.add
+ """
+ self.ax.axis([self.extent[0] - self.margin,
+ self.extent[1] + self.margin,
+ self.extent[2] - self.margin,
+ self.extent[3] + self.margin])
+ self.ax.set_aspect('equal', adjustable='datalim')
+ return self.diagrams
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sankey.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sankey.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..33565b998a9caf00ead62bdfa0adb50e272dd6ac
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sankey.pyi
@@ -0,0 +1,61 @@
+from matplotlib.axes import Axes
+
+from collections.abc import Callable, Iterable
+from typing import Any
+from typing_extensions import Self # < Py 3.11
+
+import numpy as np
+
+__license__: str
+__credits__: list[str]
+__author__: str
+__version__: str
+
+RIGHT: int
+UP: int
+DOWN: int
+
+# TODO typing units
+class Sankey:
+ diagrams: list[Any]
+ ax: Axes
+ unit: Any
+ format: str | Callable[[float], str]
+ scale: float
+ gap: float
+ radius: float
+ shoulder: float
+ offset: float
+ margin: float
+ pitch: float
+ tolerance: float
+ extent: np.ndarray
+ def __init__(
+ self,
+ ax: Axes | None = ...,
+ scale: float = ...,
+ unit: Any = ...,
+ format: str | Callable[[float], str] = ...,
+ gap: float = ...,
+ radius: float = ...,
+ shoulder: float = ...,
+ offset: float = ...,
+ head_angle: float = ...,
+ margin: float = ...,
+ tolerance: float = ...,
+ **kwargs
+ ) -> None: ...
+ def add(
+ self,
+ patchlabel: str = ...,
+ flows: Iterable[float] | None = ...,
+ orientations: Iterable[int] | None = ...,
+ labels: str | Iterable[str | None] = ...,
+ trunklength: float = ...,
+ pathlengths: float | Iterable[float] = ...,
+ prior: int | None = ...,
+ connect: tuple[int, int] = ...,
+ rotation: float = ...,
+ **kwargs
+ ) -> Self: ...
+ def finish(self) -> list[Any]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/scale.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/scale.py
new file mode 100644
index 0000000000000000000000000000000000000000..7630ba6e54b91dacf533aa196ab12c5570cc76d2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/scale.py
@@ -0,0 +1,767 @@
+"""
+Scales define the distribution of data values on an axis, e.g. a log scaling.
+
+The mapping is implemented through `.Transform` subclasses.
+
+The following scales are built-in:
+
+.. _builtin_scales:
+
+============= ===================== ================================ =================================
+Name Class Transform Inverted transform
+============= ===================== ================================ =================================
+"asinh" `AsinhScale` `AsinhTransform` `InvertedAsinhTransform`
+"function" `FuncScale` `FuncTransform` `FuncTransform`
+"functionlog" `FuncScaleLog` `FuncTransform` + `LogTransform` `InvertedLogTransform` + `FuncTransform`
+"linear" `LinearScale` `.IdentityTransform` `.IdentityTransform`
+"log" `LogScale` `LogTransform` `InvertedLogTransform`
+"logit" `LogitScale` `LogitTransform` `LogisticTransform`
+"symlog" `SymmetricalLogScale` `SymmetricalLogTransform` `InvertedSymmetricalLogTransform`
+============= ===================== ================================ =================================
+
+A user will often only use the scale name, e.g. when setting the scale through
+`~.Axes.set_xscale`: ``ax.set_xscale("log")``.
+
+See also the :ref:`scales examples ` in the documentation.
+
+Custom scaling can be achieved through `FuncScale`, or by creating your own
+`ScaleBase` subclass and corresponding transforms (see :doc:`/gallery/scales/custom_scale`).
+Third parties can register their scales by name through `register_scale`.
+""" # noqa: E501
+
+import inspect
+import textwrap
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, _docstring
+from matplotlib.ticker import (
+ NullFormatter, ScalarFormatter, LogFormatterSciNotation, LogitFormatter,
+ NullLocator, LogLocator, AutoLocator, AutoMinorLocator,
+ SymmetricalLogLocator, AsinhLocator, LogitLocator)
+from matplotlib.transforms import Transform, IdentityTransform
+
+
+class ScaleBase:
+ """
+ The base class for all scales.
+
+ Scales are separable transformations, working on a single dimension.
+
+ Subclasses should override
+
+ :attr:`name`
+ The scale's name.
+ :meth:`get_transform`
+ A method returning a `.Transform`, which converts data coordinates to
+ scaled coordinates. This transform should be invertible, so that e.g.
+ mouse positions can be converted back to data coordinates.
+ :meth:`set_default_locators_and_formatters`
+ A method that sets default locators and formatters for an `~.axis.Axis`
+ that uses this scale.
+ :meth:`limit_range_for_scale`
+ An optional method that "fixes" the axis range to acceptable values,
+ e.g. restricting log-scaled axes to positive values.
+ """
+
+ def __init__(self, axis):
+ r"""
+ Construct a new scale.
+
+ Notes
+ -----
+ The following note is for scale implementers.
+
+ For back-compatibility reasons, scales take an `~matplotlib.axis.Axis`
+ object as first argument. However, this argument should not
+ be used: a single scale object should be usable by multiple
+ `~matplotlib.axis.Axis`\es at the same time.
+ """
+
+ def get_transform(self):
+ """
+ Return the `.Transform` object associated with this scale.
+ """
+ raise NotImplementedError()
+
+ def set_default_locators_and_formatters(self, axis):
+ """
+ Set the locators and formatters of *axis* to instances suitable for
+ this scale.
+ """
+ raise NotImplementedError()
+
+ def limit_range_for_scale(self, vmin, vmax, minpos):
+ """
+ Return the range *vmin*, *vmax*, restricted to the
+ domain supported by this scale (if any).
+
+ *minpos* should be the minimum positive value in the data.
+ This is used by log scales to determine a minimum value.
+ """
+ return vmin, vmax
+
+
+class LinearScale(ScaleBase):
+ """
+ The default linear scale.
+ """
+
+ name = 'linear'
+
+ def __init__(self, axis):
+ # This method is present only to prevent inheritance of the base class'
+ # constructor docstring, which would otherwise end up interpolated into
+ # the docstring of Axis.set_scale.
+ """
+ """ # noqa: D419
+
+ def set_default_locators_and_formatters(self, axis):
+ # docstring inherited
+ axis.set_major_locator(AutoLocator())
+ axis.set_major_formatter(ScalarFormatter())
+ axis.set_minor_formatter(NullFormatter())
+ # update the minor locator for x and y axis based on rcParams
+ if (axis.axis_name == 'x' and mpl.rcParams['xtick.minor.visible'] or
+ axis.axis_name == 'y' and mpl.rcParams['ytick.minor.visible']):
+ axis.set_minor_locator(AutoMinorLocator())
+ else:
+ axis.set_minor_locator(NullLocator())
+
+ def get_transform(self):
+ """
+ Return the transform for linear scaling, which is just the
+ `~matplotlib.transforms.IdentityTransform`.
+ """
+ return IdentityTransform()
+
+
+class FuncTransform(Transform):
+ """
+ A simple transform that takes and arbitrary function for the
+ forward and inverse transform.
+ """
+
+ input_dims = output_dims = 1
+
+ def __init__(self, forward, inverse):
+ """
+ Parameters
+ ----------
+ forward : callable
+ The forward function for the transform. This function must have
+ an inverse and, for best behavior, be monotonic.
+ It must have the signature::
+
+ def forward(values: array-like) -> array-like
+
+ inverse : callable
+ The inverse of the forward function. Signature as ``forward``.
+ """
+ super().__init__()
+ if callable(forward) and callable(inverse):
+ self._forward = forward
+ self._inverse = inverse
+ else:
+ raise ValueError('arguments to FuncTransform must be functions')
+
+ def transform_non_affine(self, values):
+ return self._forward(values)
+
+ def inverted(self):
+ return FuncTransform(self._inverse, self._forward)
+
+
+class FuncScale(ScaleBase):
+ """
+ Provide an arbitrary scale with user-supplied function for the axis.
+ """
+
+ name = 'function'
+
+ def __init__(self, axis, functions):
+ """
+ Parameters
+ ----------
+ axis : `~matplotlib.axis.Axis`
+ The axis for the scale.
+ functions : (callable, callable)
+ two-tuple of the forward and inverse functions for the scale.
+ The forward function must be monotonic.
+
+ Both functions must have the signature::
+
+ def forward(values: array-like) -> array-like
+ """
+ forward, inverse = functions
+ transform = FuncTransform(forward, inverse)
+ self._transform = transform
+
+ def get_transform(self):
+ """Return the `.FuncTransform` associated with this scale."""
+ return self._transform
+
+ def set_default_locators_and_formatters(self, axis):
+ # docstring inherited
+ axis.set_major_locator(AutoLocator())
+ axis.set_major_formatter(ScalarFormatter())
+ axis.set_minor_formatter(NullFormatter())
+ # update the minor locator for x and y axis based on rcParams
+ if (axis.axis_name == 'x' and mpl.rcParams['xtick.minor.visible'] or
+ axis.axis_name == 'y' and mpl.rcParams['ytick.minor.visible']):
+ axis.set_minor_locator(AutoMinorLocator())
+ else:
+ axis.set_minor_locator(NullLocator())
+
+
+class LogTransform(Transform):
+ input_dims = output_dims = 1
+
+ def __init__(self, base, nonpositive='clip'):
+ super().__init__()
+ if base <= 0 or base == 1:
+ raise ValueError('The log base cannot be <= 0 or == 1')
+ self.base = base
+ self._clip = _api.check_getitem(
+ {"clip": True, "mask": False}, nonpositive=nonpositive)
+
+ def __str__(self):
+ return "{}(base={}, nonpositive={!r})".format(
+ type(self).__name__, self.base, "clip" if self._clip else "mask")
+
+ def transform_non_affine(self, values):
+ # Ignore invalid values due to nans being passed to the transform.
+ with np.errstate(divide="ignore", invalid="ignore"):
+ log = {np.e: np.log, 2: np.log2, 10: np.log10}.get(self.base)
+ if log: # If possible, do everything in a single call to NumPy.
+ out = log(values)
+ else:
+ out = np.log(values)
+ out /= np.log(self.base)
+ if self._clip:
+ # SVG spec says that conforming viewers must support values up
+ # to 3.4e38 (C float); however experiments suggest that
+ # Inkscape (which uses cairo for rendering) runs into cairo's
+ # 24-bit limit (which is apparently shared by Agg).
+ # Ghostscript (used for pdf rendering appears to overflow even
+ # earlier, with the max value around 2 ** 15 for the tests to
+ # pass. On the other hand, in practice, we want to clip beyond
+ # np.log10(np.nextafter(0, 1)) ~ -323
+ # so 1000 seems safe.
+ out[values <= 0] = -1000
+ return out
+
+ def inverted(self):
+ return InvertedLogTransform(self.base)
+
+
+class InvertedLogTransform(Transform):
+ input_dims = output_dims = 1
+
+ def __init__(self, base):
+ super().__init__()
+ self.base = base
+
+ def __str__(self):
+ return f"{type(self).__name__}(base={self.base})"
+
+ def transform_non_affine(self, values):
+ return np.power(self.base, values)
+
+ def inverted(self):
+ return LogTransform(self.base)
+
+
+class LogScale(ScaleBase):
+ """
+ A standard logarithmic scale. Care is taken to only plot positive values.
+ """
+ name = 'log'
+
+ def __init__(self, axis, *, base=10, subs=None, nonpositive="clip"):
+ """
+ Parameters
+ ----------
+ axis : `~matplotlib.axis.Axis`
+ The axis for the scale.
+ base : float, default: 10
+ The base of the logarithm.
+ nonpositive : {'clip', 'mask'}, default: 'clip'
+ Determines the behavior for non-positive values. They can either
+ be masked as invalid, or clipped to a very small positive number.
+ subs : sequence of int, default: None
+ Where to place the subticks between each major tick. For example,
+ in a log10 scale, ``[2, 3, 4, 5, 6, 7, 8, 9]`` will place 8
+ logarithmically spaced minor ticks between each major tick.
+ """
+ self._transform = LogTransform(base, nonpositive)
+ self.subs = subs
+
+ base = property(lambda self: self._transform.base)
+
+ def set_default_locators_and_formatters(self, axis):
+ # docstring inherited
+ axis.set_major_locator(LogLocator(self.base))
+ axis.set_major_formatter(LogFormatterSciNotation(self.base))
+ axis.set_minor_locator(LogLocator(self.base, self.subs))
+ axis.set_minor_formatter(
+ LogFormatterSciNotation(self.base,
+ labelOnlyBase=(self.subs is not None)))
+
+ def get_transform(self):
+ """Return the `.LogTransform` associated with this scale."""
+ return self._transform
+
+ def limit_range_for_scale(self, vmin, vmax, minpos):
+ """Limit the domain to positive values."""
+ if not np.isfinite(minpos):
+ minpos = 1e-300 # Should rarely (if ever) have a visible effect.
+
+ return (minpos if vmin <= 0 else vmin,
+ minpos if vmax <= 0 else vmax)
+
+
+class FuncScaleLog(LogScale):
+ """
+ Provide an arbitrary scale with user-supplied function for the axis and
+ then put on a logarithmic axes.
+ """
+
+ name = 'functionlog'
+
+ def __init__(self, axis, functions, base=10):
+ """
+ Parameters
+ ----------
+ axis : `~matplotlib.axis.Axis`
+ The axis for the scale.
+ functions : (callable, callable)
+ two-tuple of the forward and inverse functions for the scale.
+ The forward function must be monotonic.
+
+ Both functions must have the signature::
+
+ def forward(values: array-like) -> array-like
+
+ base : float, default: 10
+ Logarithmic base of the scale.
+ """
+ forward, inverse = functions
+ self.subs = None
+ self._transform = FuncTransform(forward, inverse) + LogTransform(base)
+
+ @property
+ def base(self):
+ return self._transform._b.base # Base of the LogTransform.
+
+ def get_transform(self):
+ """Return the `.Transform` associated with this scale."""
+ return self._transform
+
+
+class SymmetricalLogTransform(Transform):
+ input_dims = output_dims = 1
+
+ def __init__(self, base, linthresh, linscale):
+ super().__init__()
+ if base <= 1.0:
+ raise ValueError("'base' must be larger than 1")
+ if linthresh <= 0.0:
+ raise ValueError("'linthresh' must be positive")
+ if linscale <= 0.0:
+ raise ValueError("'linscale' must be positive")
+ self.base = base
+ self.linthresh = linthresh
+ self.linscale = linscale
+ self._linscale_adj = (linscale / (1.0 - self.base ** -1))
+ self._log_base = np.log(base)
+
+ def transform_non_affine(self, values):
+ abs_a = np.abs(values)
+ with np.errstate(divide="ignore", invalid="ignore"):
+ out = np.sign(values) * self.linthresh * (
+ self._linscale_adj +
+ np.log(abs_a / self.linthresh) / self._log_base)
+ inside = abs_a <= self.linthresh
+ out[inside] = values[inside] * self._linscale_adj
+ return out
+
+ def inverted(self):
+ return InvertedSymmetricalLogTransform(self.base, self.linthresh,
+ self.linscale)
+
+
+class InvertedSymmetricalLogTransform(Transform):
+ input_dims = output_dims = 1
+
+ def __init__(self, base, linthresh, linscale):
+ super().__init__()
+ symlog = SymmetricalLogTransform(base, linthresh, linscale)
+ self.base = base
+ self.linthresh = linthresh
+ self.invlinthresh = symlog.transform(linthresh)
+ self.linscale = linscale
+ self._linscale_adj = (linscale / (1.0 - self.base ** -1))
+
+ def transform_non_affine(self, values):
+ abs_a = np.abs(values)
+ with np.errstate(divide="ignore", invalid="ignore"):
+ out = np.sign(values) * self.linthresh * (
+ np.power(self.base,
+ abs_a / self.linthresh - self._linscale_adj))
+ inside = abs_a <= self.invlinthresh
+ out[inside] = values[inside] / self._linscale_adj
+ return out
+
+ def inverted(self):
+ return SymmetricalLogTransform(self.base,
+ self.linthresh, self.linscale)
+
+
+class SymmetricalLogScale(ScaleBase):
+ """
+ The symmetrical logarithmic scale is logarithmic in both the
+ positive and negative directions from the origin.
+
+ Since the values close to zero tend toward infinity, there is a
+ need to have a range around zero that is linear. The parameter
+ *linthresh* allows the user to specify the size of this range
+ (-*linthresh*, *linthresh*).
+
+ See :doc:`/gallery/scales/symlog_demo` for a detailed description.
+
+ Parameters
+ ----------
+ base : float, default: 10
+ The base of the logarithm.
+
+ linthresh : float, default: 2
+ Defines the range ``(-x, x)``, within which the plot is linear.
+ This avoids having the plot go to infinity around zero.
+
+ subs : sequence of int
+ Where to place the subticks between each major tick.
+ For example, in a log10 scale: ``[2, 3, 4, 5, 6, 7, 8, 9]`` will place
+ 8 logarithmically spaced minor ticks between each major tick.
+
+ linscale : float, optional
+ This allows the linear range ``(-linthresh, linthresh)`` to be
+ stretched relative to the logarithmic range. Its value is the number of
+ decades to use for each half of the linear range. For example, when
+ *linscale* == 1.0 (the default), the space used for the positive and
+ negative halves of the linear range will be equal to one decade in
+ the logarithmic range.
+ """
+ name = 'symlog'
+
+ def __init__(self, axis, *, base=10, linthresh=2, subs=None, linscale=1):
+ self._transform = SymmetricalLogTransform(base, linthresh, linscale)
+ self.subs = subs
+
+ base = property(lambda self: self._transform.base)
+ linthresh = property(lambda self: self._transform.linthresh)
+ linscale = property(lambda self: self._transform.linscale)
+
+ def set_default_locators_and_formatters(self, axis):
+ # docstring inherited
+ axis.set_major_locator(SymmetricalLogLocator(self.get_transform()))
+ axis.set_major_formatter(LogFormatterSciNotation(self.base))
+ axis.set_minor_locator(SymmetricalLogLocator(self.get_transform(),
+ self.subs))
+ axis.set_minor_formatter(NullFormatter())
+
+ def get_transform(self):
+ """Return the `.SymmetricalLogTransform` associated with this scale."""
+ return self._transform
+
+
+class AsinhTransform(Transform):
+ """Inverse hyperbolic-sine transformation used by `.AsinhScale`"""
+ input_dims = output_dims = 1
+
+ def __init__(self, linear_width):
+ super().__init__()
+ if linear_width <= 0.0:
+ raise ValueError("Scale parameter 'linear_width' " +
+ "must be strictly positive")
+ self.linear_width = linear_width
+
+ def transform_non_affine(self, values):
+ return self.linear_width * np.arcsinh(values / self.linear_width)
+
+ def inverted(self):
+ return InvertedAsinhTransform(self.linear_width)
+
+
+class InvertedAsinhTransform(Transform):
+ """Hyperbolic sine transformation used by `.AsinhScale`"""
+ input_dims = output_dims = 1
+
+ def __init__(self, linear_width):
+ super().__init__()
+ self.linear_width = linear_width
+
+ def transform_non_affine(self, values):
+ return self.linear_width * np.sinh(values / self.linear_width)
+
+ def inverted(self):
+ return AsinhTransform(self.linear_width)
+
+
+class AsinhScale(ScaleBase):
+ """
+ A quasi-logarithmic scale based on the inverse hyperbolic sine (asinh)
+
+ For values close to zero, this is essentially a linear scale,
+ but for large magnitude values (either positive or negative)
+ it is asymptotically logarithmic. The transition between these
+ linear and logarithmic regimes is smooth, and has no discontinuities
+ in the function gradient in contrast to
+ the `.SymmetricalLogScale` ("symlog") scale.
+
+ Specifically, the transformation of an axis coordinate :math:`a` is
+ :math:`a \\rightarrow a_0 \\sinh^{-1} (a / a_0)` where :math:`a_0`
+ is the effective width of the linear region of the transformation.
+ In that region, the transformation is
+ :math:`a \\rightarrow a + \\mathcal{O}(a^3)`.
+ For large values of :math:`a` the transformation behaves as
+ :math:`a \\rightarrow a_0 \\, \\mathrm{sgn}(a) \\ln |a| + \\mathcal{O}(1)`.
+
+ .. note::
+
+ This API is provisional and may be revised in the future
+ based on early user feedback.
+ """
+
+ name = 'asinh'
+
+ auto_tick_multipliers = {
+ 3: (2, ),
+ 4: (2, ),
+ 5: (2, ),
+ 8: (2, 4),
+ 10: (2, 5),
+ 16: (2, 4, 8),
+ 64: (4, 16),
+ 1024: (256, 512)
+ }
+
+ def __init__(self, axis, *, linear_width=1.0,
+ base=10, subs='auto', **kwargs):
+ """
+ Parameters
+ ----------
+ linear_width : float, default: 1
+ The scale parameter (elsewhere referred to as :math:`a_0`)
+ defining the extent of the quasi-linear region,
+ and the coordinate values beyond which the transformation
+ becomes asymptotically logarithmic.
+ base : int, default: 10
+ The number base used for rounding tick locations
+ on a logarithmic scale. If this is less than one,
+ then rounding is to the nearest integer multiple
+ of powers of ten.
+ subs : sequence of int
+ Multiples of the number base used for minor ticks.
+ If set to 'auto', this will use built-in defaults,
+ e.g. (2, 5) for base=10.
+ """
+ super().__init__(axis)
+ self._transform = AsinhTransform(linear_width)
+ self._base = int(base)
+ if subs == 'auto':
+ self._subs = self.auto_tick_multipliers.get(self._base)
+ else:
+ self._subs = subs
+
+ linear_width = property(lambda self: self._transform.linear_width)
+
+ def get_transform(self):
+ return self._transform
+
+ def set_default_locators_and_formatters(self, axis):
+ axis.set(major_locator=AsinhLocator(self.linear_width,
+ base=self._base),
+ minor_locator=AsinhLocator(self.linear_width,
+ base=self._base,
+ subs=self._subs),
+ minor_formatter=NullFormatter())
+ if self._base > 1:
+ axis.set_major_formatter(LogFormatterSciNotation(self._base))
+ else:
+ axis.set_major_formatter('{x:.3g}')
+
+
+class LogitTransform(Transform):
+ input_dims = output_dims = 1
+
+ def __init__(self, nonpositive='mask'):
+ super().__init__()
+ _api.check_in_list(['mask', 'clip'], nonpositive=nonpositive)
+ self._nonpositive = nonpositive
+ self._clip = {"clip": True, "mask": False}[nonpositive]
+
+ def transform_non_affine(self, values):
+ """logit transform (base 10), masked or clipped"""
+ with np.errstate(divide="ignore", invalid="ignore"):
+ out = np.log10(values / (1 - values))
+ if self._clip: # See LogTransform for choice of clip value.
+ out[values <= 0] = -1000
+ out[1 <= values] = 1000
+ return out
+
+ def inverted(self):
+ return LogisticTransform(self._nonpositive)
+
+ def __str__(self):
+ return f"{type(self).__name__}({self._nonpositive!r})"
+
+
+class LogisticTransform(Transform):
+ input_dims = output_dims = 1
+
+ def __init__(self, nonpositive='mask'):
+ super().__init__()
+ self._nonpositive = nonpositive
+
+ def transform_non_affine(self, values):
+ """logistic transform (base 10)"""
+ return 1.0 / (1 + 10**(-values))
+
+ def inverted(self):
+ return LogitTransform(self._nonpositive)
+
+ def __str__(self):
+ return f"{type(self).__name__}({self._nonpositive!r})"
+
+
+class LogitScale(ScaleBase):
+ """
+ Logit scale for data between zero and one, both excluded.
+
+ This scale is similar to a log scale close to zero and to one, and almost
+ linear around 0.5. It maps the interval ]0, 1[ onto ]-infty, +infty[.
+ """
+ name = 'logit'
+
+ def __init__(self, axis, nonpositive='mask', *,
+ one_half=r"\frac{1}{2}", use_overline=False):
+ r"""
+ Parameters
+ ----------
+ axis : `~matplotlib.axis.Axis`
+ Currently unused.
+ nonpositive : {'mask', 'clip'}
+ Determines the behavior for values beyond the open interval ]0, 1[.
+ They can either be masked as invalid, or clipped to a number very
+ close to 0 or 1.
+ use_overline : bool, default: False
+ Indicate the usage of survival notation (\overline{x}) in place of
+ standard notation (1-x) for probability close to one.
+ one_half : str, default: r"\frac{1}{2}"
+ The string used for ticks formatter to represent 1/2.
+ """
+ self._transform = LogitTransform(nonpositive)
+ self._use_overline = use_overline
+ self._one_half = one_half
+
+ def get_transform(self):
+ """Return the `.LogitTransform` associated with this scale."""
+ return self._transform
+
+ def set_default_locators_and_formatters(self, axis):
+ # docstring inherited
+ # ..., 0.01, 0.1, 0.5, 0.9, 0.99, ...
+ axis.set_major_locator(LogitLocator())
+ axis.set_major_formatter(
+ LogitFormatter(
+ one_half=self._one_half,
+ use_overline=self._use_overline
+ )
+ )
+ axis.set_minor_locator(LogitLocator(minor=True))
+ axis.set_minor_formatter(
+ LogitFormatter(
+ minor=True,
+ one_half=self._one_half,
+ use_overline=self._use_overline
+ )
+ )
+
+ def limit_range_for_scale(self, vmin, vmax, minpos):
+ """
+ Limit the domain to values between 0 and 1 (excluded).
+ """
+ if not np.isfinite(minpos):
+ minpos = 1e-7 # Should rarely (if ever) have a visible effect.
+ return (minpos if vmin <= 0 else vmin,
+ 1 - minpos if vmax >= 1 else vmax)
+
+
+_scale_mapping = {
+ 'linear': LinearScale,
+ 'log': LogScale,
+ 'symlog': SymmetricalLogScale,
+ 'asinh': AsinhScale,
+ 'logit': LogitScale,
+ 'function': FuncScale,
+ 'functionlog': FuncScaleLog,
+ }
+
+
+def get_scale_names():
+ """Return the names of the available scales."""
+ return sorted(_scale_mapping)
+
+
+def scale_factory(scale, axis, **kwargs):
+ """
+ Return a scale class by name.
+
+ Parameters
+ ----------
+ scale : {%(names)s}
+ axis : `~matplotlib.axis.Axis`
+ """
+ scale_cls = _api.check_getitem(_scale_mapping, scale=scale)
+ return scale_cls(axis, **kwargs)
+
+
+if scale_factory.__doc__:
+ scale_factory.__doc__ = scale_factory.__doc__ % {
+ "names": ", ".join(map(repr, get_scale_names()))}
+
+
+def register_scale(scale_class):
+ """
+ Register a new kind of scale.
+
+ Parameters
+ ----------
+ scale_class : subclass of `ScaleBase`
+ The scale to register.
+ """
+ _scale_mapping[scale_class.name] = scale_class
+
+
+def _get_scale_docs():
+ """
+ Helper function for generating docstrings related to scales.
+ """
+ docs = []
+ for name, scale_class in _scale_mapping.items():
+ docstring = inspect.getdoc(scale_class.__init__) or ""
+ docs.extend([
+ f" {name!r}",
+ "",
+ textwrap.indent(docstring, " " * 8),
+ ""
+ ])
+ return "\n".join(docs)
+
+
+_docstring.interpd.register(
+ scale_type='{%s}' % ', '.join([repr(x) for x in get_scale_names()]),
+ scale_docs=_get_scale_docs().rstrip(),
+ )
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/scale.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/scale.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..7fec8e68cc5ae0d31cd49ddda33a545ec1708e0a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/scale.pyi
@@ -0,0 +1,178 @@
+from matplotlib.axis import Axis
+from matplotlib.transforms import Transform
+
+from collections.abc import Callable, Iterable
+from typing import Literal
+from numpy.typing import ArrayLike
+
+class ScaleBase:
+ def __init__(self, axis: Axis | None) -> None: ...
+ def get_transform(self) -> Transform: ...
+ def set_default_locators_and_formatters(self, axis: Axis) -> None: ...
+ def limit_range_for_scale(
+ self, vmin: float, vmax: float, minpos: float
+ ) -> tuple[float, float]: ...
+
+class LinearScale(ScaleBase):
+ name: str
+
+class FuncTransform(Transform):
+ input_dims: int
+ output_dims: int
+ def __init__(
+ self,
+ forward: Callable[[ArrayLike], ArrayLike],
+ inverse: Callable[[ArrayLike], ArrayLike],
+ ) -> None: ...
+ def inverted(self) -> FuncTransform: ...
+
+class FuncScale(ScaleBase):
+ name: str
+ def __init__(
+ self,
+ axis: Axis | None,
+ functions: tuple[
+ Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
+ ],
+ ) -> None: ...
+
+class LogTransform(Transform):
+ input_dims: int
+ output_dims: int
+ base: float
+ def __init__(
+ self, base: float, nonpositive: Literal["clip", "mask"] = ...
+ ) -> None: ...
+ def inverted(self) -> InvertedLogTransform: ...
+
+class InvertedLogTransform(Transform):
+ input_dims: int
+ output_dims: int
+ base: float
+ def __init__(self, base: float) -> None: ...
+ def inverted(self) -> LogTransform: ...
+
+class LogScale(ScaleBase):
+ name: str
+ subs: Iterable[int] | None
+ def __init__(
+ self,
+ axis: Axis | None,
+ *,
+ base: float = ...,
+ subs: Iterable[int] | None = ...,
+ nonpositive: Literal["clip", "mask"] = ...
+ ) -> None: ...
+ @property
+ def base(self) -> float: ...
+ def get_transform(self) -> Transform: ...
+
+class FuncScaleLog(LogScale):
+ def __init__(
+ self,
+ axis: Axis | None,
+ functions: tuple[
+ Callable[[ArrayLike], ArrayLike], Callable[[ArrayLike], ArrayLike]
+ ],
+ base: float = ...,
+ ) -> None: ...
+ @property
+ def base(self) -> float: ...
+ def get_transform(self) -> Transform: ...
+
+class SymmetricalLogTransform(Transform):
+ input_dims: int
+ output_dims: int
+ base: float
+ linthresh: float
+ linscale: float
+ def __init__(self, base: float, linthresh: float, linscale: float) -> None: ...
+ def inverted(self) -> InvertedSymmetricalLogTransform: ...
+
+class InvertedSymmetricalLogTransform(Transform):
+ input_dims: int
+ output_dims: int
+ base: float
+ linthresh: float
+ invlinthresh: float
+ linscale: float
+ def __init__(self, base: float, linthresh: float, linscale: float) -> None: ...
+ def inverted(self) -> SymmetricalLogTransform: ...
+
+class SymmetricalLogScale(ScaleBase):
+ name: str
+ subs: Iterable[int] | None
+ def __init__(
+ self,
+ axis: Axis | None,
+ *,
+ base: float = ...,
+ linthresh: float = ...,
+ subs: Iterable[int] | None = ...,
+ linscale: float = ...
+ ) -> None: ...
+ @property
+ def base(self) -> float: ...
+ @property
+ def linthresh(self) -> float: ...
+ @property
+ def linscale(self) -> float: ...
+ def get_transform(self) -> SymmetricalLogTransform: ...
+
+class AsinhTransform(Transform):
+ input_dims: int
+ output_dims: int
+ linear_width: float
+ def __init__(self, linear_width: float) -> None: ...
+ def inverted(self) -> InvertedAsinhTransform: ...
+
+class InvertedAsinhTransform(Transform):
+ input_dims: int
+ output_dims: int
+ linear_width: float
+ def __init__(self, linear_width: float) -> None: ...
+ def inverted(self) -> AsinhTransform: ...
+
+class AsinhScale(ScaleBase):
+ name: str
+ auto_tick_multipliers: dict[int, tuple[int, ...]]
+ def __init__(
+ self,
+ axis: Axis | None,
+ *,
+ linear_width: float = ...,
+ base: float = ...,
+ subs: Iterable[int] | Literal["auto"] | None = ...,
+ **kwargs
+ ) -> None: ...
+ @property
+ def linear_width(self) -> float: ...
+ def get_transform(self) -> AsinhTransform: ...
+
+class LogitTransform(Transform):
+ input_dims: int
+ output_dims: int
+ def __init__(self, nonpositive: Literal["mask", "clip"] = ...) -> None: ...
+ def inverted(self) -> LogisticTransform: ...
+
+class LogisticTransform(Transform):
+ input_dims: int
+ output_dims: int
+ def __init__(self, nonpositive: Literal["mask", "clip"] = ...) -> None: ...
+ def inverted(self) -> LogitTransform: ...
+
+class LogitScale(ScaleBase):
+ name: str
+ def __init__(
+ self,
+ axis: Axis | None,
+ nonpositive: Literal["mask", "clip"] = ...,
+ *,
+ one_half: str = ...,
+ use_overline: bool = ...
+ ) -> None: ...
+ def get_transform(self) -> LogitTransform: ...
+
+def get_scale_names() -> list[str]: ...
+def scale_factory(scale: str, axis: Axis, **kwargs) -> ScaleBase: ...
+def register_scale(scale_class: type[ScaleBase]) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/figmpl_directive.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/figmpl_directive.py
new file mode 100644
index 0000000000000000000000000000000000000000..7cb9c6c04e8a130fe9d61c3a4c66f0ba4d80b1ad
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/figmpl_directive.py
@@ -0,0 +1,286 @@
+"""
+Add a ``figure-mpl`` directive that is a responsive version of ``figure``.
+
+This implementation is very similar to ``.. figure::``, except it also allows a
+``srcset=`` argument to be passed to the image tag, hence allowing responsive
+resolution images.
+
+There is no particular reason this could not be used standalone, but is meant
+to be used with :doc:`/api/sphinxext_plot_directive_api`.
+
+Note that the directory organization is a bit different than ``.. figure::``.
+See the *FigureMpl* documentation below.
+
+"""
+import os
+from os.path import relpath
+from pathlib import PurePath, Path
+import shutil
+
+from docutils import nodes
+from docutils.parsers.rst import directives
+from docutils.parsers.rst.directives.images import Figure, Image
+from sphinx.errors import ExtensionError
+
+import matplotlib
+
+
+class figmplnode(nodes.General, nodes.Element):
+ pass
+
+
+class FigureMpl(Figure):
+ """
+ Implements a directive to allow an optional hidpi image.
+
+ Meant to be used with the *plot_srcset* configuration option in conf.py,
+ and gets set in the TEMPLATE of plot_directive.py
+
+ e.g.::
+
+ .. figure-mpl:: plot_directive/some_plots-1.png
+ :alt: bar
+ :srcset: plot_directive/some_plots-1.png,
+ plot_directive/some_plots-1.2x.png 2.00x
+ :class: plot-directive
+
+ The resulting html (at ``some_plots.html``) is::
+
+
+
+ Note that the handling of subdirectories is different than that used by the sphinx
+ figure directive::
+
+ .. figure-mpl:: plot_directive/nestedpage/index-1.png
+ :alt: bar
+ :srcset: plot_directive/nestedpage/index-1.png
+ plot_directive/nestedpage/index-1.2x.png 2.00x
+ :class: plot_directive
+
+ The resulting html (at ``nestedpage/index.html``)::
+
+
+
+ where the subdirectory is included in the image name for uniqueness.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 2
+ final_argument_whitespace = False
+ option_spec = {
+ 'alt': directives.unchanged,
+ 'height': directives.length_or_unitless,
+ 'width': directives.length_or_percentage_or_unitless,
+ 'scale': directives.nonnegative_int,
+ 'align': Image.align,
+ 'class': directives.class_option,
+ 'caption': directives.unchanged,
+ 'srcset': directives.unchanged,
+ }
+
+ def run(self):
+
+ image_node = figmplnode()
+
+ imagenm = self.arguments[0]
+ image_node['alt'] = self.options.get('alt', '')
+ image_node['align'] = self.options.get('align', None)
+ image_node['class'] = self.options.get('class', None)
+ image_node['width'] = self.options.get('width', None)
+ image_node['height'] = self.options.get('height', None)
+ image_node['scale'] = self.options.get('scale', None)
+ image_node['caption'] = self.options.get('caption', None)
+
+ # we would like uri to be the highest dpi version so that
+ # latex etc will use that. But for now, lets just make
+ # imagenm... maybe pdf one day?
+
+ image_node['uri'] = imagenm
+ image_node['srcset'] = self.options.get('srcset', None)
+
+ return [image_node]
+
+
+def _parse_srcsetNodes(st):
+ """
+ parse srcset...
+ """
+ entries = st.split(',')
+ srcset = {}
+ for entry in entries:
+ spl = entry.strip().split(' ')
+ if len(spl) == 1:
+ srcset[0] = spl[0]
+ elif len(spl) == 2:
+ mult = spl[1][:-1]
+ srcset[float(mult)] = spl[0]
+ else:
+ raise ExtensionError(f'srcset argument "{entry}" is invalid.')
+ return srcset
+
+
+def _copy_images_figmpl(self, node):
+
+ # these will be the temporary place the plot-directive put the images eg:
+ # ../../../build/html/plot_directive/users/explain/artists/index-1.png
+ if node['srcset']:
+ srcset = _parse_srcsetNodes(node['srcset'])
+ else:
+ srcset = None
+
+ # the rst file's location: eg /Users/username/matplotlib/doc/users/explain/artists
+ docsource = PurePath(self.document['source']).parent
+
+ # get the relpath relative to root:
+ srctop = self.builder.srcdir
+ rel = relpath(docsource, srctop).replace('.', '').replace(os.sep, '-')
+ if len(rel):
+ rel += '-'
+ # eg: users/explain/artists
+
+ imagedir = PurePath(self.builder.outdir, self.builder.imagedir)
+ # eg: /Users/username/matplotlib/doc/build/html/_images/users/explain/artists
+
+ Path(imagedir).mkdir(parents=True, exist_ok=True)
+
+ # copy all the sources to the imagedir:
+ if srcset:
+ for src in srcset.values():
+ # the entries in srcset are relative to docsource's directory
+ abspath = PurePath(docsource, src)
+ name = rel + abspath.name
+ shutil.copyfile(abspath, imagedir / name)
+ else:
+ abspath = PurePath(docsource, node['uri'])
+ name = rel + abspath.name
+ shutil.copyfile(abspath, imagedir / name)
+
+ return imagedir, srcset, rel
+
+
+def visit_figmpl_html(self, node):
+
+ imagedir, srcset, rel = _copy_images_figmpl(self, node)
+
+ # /doc/examples/subd/plot_1.rst
+ docsource = PurePath(self.document['source'])
+ # /doc/
+ # make sure to add the trailing slash:
+ srctop = PurePath(self.builder.srcdir, '')
+ # examples/subd/plot_1.rst
+ relsource = relpath(docsource, srctop)
+ # /doc/build/html
+ desttop = PurePath(self.builder.outdir, '')
+ # /doc/build/html/examples/subd
+ dest = desttop / relsource
+
+ # ../../_images/ for dirhtml and ../_images/ for html
+ imagerel = PurePath(relpath(imagedir, dest.parent)).as_posix()
+ if self.builder.name == "dirhtml":
+ imagerel = f'..{imagerel}'
+
+ # make uri also be relative...
+ nm = PurePath(node['uri'][1:]).name
+ uri = f'{imagerel}/{rel}{nm}'
+ img_attrs = {'src': uri, 'alt': node['alt']}
+
+ # make srcset str. Need to change all the prefixes!
+ maxsrc = uri
+ if srcset:
+ maxmult = -1
+ srcsetst = ''
+ for mult, src in srcset.items():
+ nm = PurePath(src[1:]).name
+ # ../../_images/plot_1_2_0x.png
+ path = f'{imagerel}/{rel}{nm}'
+ srcsetst += path
+ if mult == 0:
+ srcsetst += ', '
+ else:
+ srcsetst += f' {mult:1.2f}x, '
+
+ if mult > maxmult:
+ maxmult = mult
+ maxsrc = path
+
+ # trim trailing comma and space...
+ img_attrs['srcset'] = srcsetst[:-2]
+
+ if node['class'] is not None:
+ img_attrs['class'] = ' '.join(node['class'])
+ for style in ['width', 'height', 'scale']:
+ if node[style]:
+ if 'style' not in img_attrs:
+ img_attrs['style'] = f'{style}: {node[style]};'
+ else:
+ img_attrs['style'] += f'{style}: {node[style]};'
+
+ #
+ #
+ #
+ #
+ #
+ # Figure caption is here....
+ #
+ #
+ #
+ self.body.append(
+ self.starttag(
+ node, 'figure',
+ CLASS=f'align-{node["align"]}' if node['align'] else 'align-center'))
+ self.body.append(
+ self.starttag(node, 'a', CLASS='reference internal image-reference',
+ href=maxsrc) +
+ self.emptytag(node, 'img', **img_attrs) +
+ ' \n')
+ if node['caption']:
+ self.body.append(self.starttag(node, 'figcaption'))
+ self.body.append(self.starttag(node, 'p'))
+ self.body.append(self.starttag(node, 'span', CLASS='caption-text'))
+ self.body.append(node['caption'])
+ self.body.append('\n')
+ self.body.append('\n')
+
+
+def visit_figmpl_latex(self, node):
+
+ if node['srcset'] is not None:
+ imagedir, srcset = _copy_images_figmpl(self, node)
+ maxmult = -1
+ # choose the highest res version for latex:
+ maxmult = max(srcset, default=-1)
+ node['uri'] = PurePath(srcset[maxmult]).name
+
+ self.visit_figure(node)
+
+
+def depart_figmpl_html(self, node):
+ pass
+
+
+def depart_figmpl_latex(self, node):
+ self.depart_figure(node)
+
+
+def figurempl_addnode(app):
+ app.add_node(figmplnode,
+ html=(visit_figmpl_html, depart_figmpl_html),
+ latex=(visit_figmpl_latex, depart_figmpl_latex))
+
+
+def setup(app):
+ app.add_directive("figure-mpl", FigureMpl)
+ figurempl_addnode(app)
+ metadata = {'parallel_read_safe': True, 'parallel_write_safe': True,
+ 'version': matplotlib.__version__}
+ return metadata
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/mathmpl.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/mathmpl.py
new file mode 100644
index 0000000000000000000000000000000000000000..30f0245242583c5ea162de9e5443da67d7111465
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/mathmpl.py
@@ -0,0 +1,242 @@
+r"""
+A role and directive to display mathtext in Sphinx
+==================================================
+
+The ``mathmpl`` Sphinx extension creates a mathtext image in Matplotlib and
+shows it in html output. Thus, it is a true and faithful representation of what
+you will see if you pass a given LaTeX string to Matplotlib (see
+:ref:`mathtext`).
+
+.. warning::
+ In most cases, you will likely want to use one of `Sphinx's builtin Math
+ extensions
+ `__
+ instead of this one. The builtin Sphinx math directive uses MathJax to
+ render mathematical expressions, and addresses accessibility concerns that
+ ``mathmpl`` doesn't address.
+
+Mathtext may be included in two ways:
+
+1. Inline, using the role::
+
+ This text uses inline math: :mathmpl:`\alpha > \beta`.
+
+ which produces:
+
+ This text uses inline math: :mathmpl:`\alpha > \beta`.
+
+2. Standalone, using the directive::
+
+ Here is some standalone math:
+
+ .. mathmpl::
+
+ \alpha > \beta
+
+ which produces:
+
+ Here is some standalone math:
+
+ .. mathmpl::
+
+ \alpha > \beta
+
+Options
+-------
+
+The ``mathmpl`` role and directive both support the following options:
+
+fontset : str, default: 'cm'
+ The font set to use when displaying math. See :rc:`mathtext.fontset`.
+
+fontsize : float
+ The font size, in points. Defaults to the value from the extension
+ configuration option defined below.
+
+Configuration options
+---------------------
+
+The mathtext extension has the following configuration options:
+
+mathmpl_fontsize : float, default: 10.0
+ Default font size, in points.
+
+mathmpl_srcset : list of str, default: []
+ Additional image sizes to generate when embedding in HTML, to support
+ `responsive resolution images
+ `__.
+ The list should contain additional x-descriptors (``'1.5x'``, ``'2x'``,
+ etc.) to generate (1x is the default and always included.)
+
+"""
+
+import hashlib
+from pathlib import Path
+
+from docutils import nodes
+from docutils.parsers.rst import Directive, directives
+import sphinx
+from sphinx.errors import ConfigError, ExtensionError
+
+import matplotlib as mpl
+from matplotlib import _api, mathtext
+from matplotlib.rcsetup import validate_float_or_None
+
+
+# Define LaTeX math node:
+class latex_math(nodes.General, nodes.Element):
+ pass
+
+
+def fontset_choice(arg):
+ return directives.choice(arg, mathtext.MathTextParser._font_type_mapping)
+
+
+def math_role(role, rawtext, text, lineno, inliner,
+ options={}, content=[]):
+ i = rawtext.find('`')
+ latex = rawtext[i+1:-1]
+ node = latex_math(rawtext)
+ node['latex'] = latex
+ node['fontset'] = options.get('fontset', 'cm')
+ node['fontsize'] = options.get('fontsize',
+ setup.app.config.mathmpl_fontsize)
+ return [node], []
+math_role.options = {'fontset': fontset_choice,
+ 'fontsize': validate_float_or_None}
+
+
+class MathDirective(Directive):
+ """
+ The ``.. mathmpl::`` directive, as documented in the module's docstring.
+ """
+ has_content = True
+ required_arguments = 0
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {'fontset': fontset_choice,
+ 'fontsize': validate_float_or_None}
+
+ def run(self):
+ latex = ''.join(self.content)
+ node = latex_math(self.block_text)
+ node['latex'] = latex
+ node['fontset'] = self.options.get('fontset', 'cm')
+ node['fontsize'] = self.options.get('fontsize',
+ setup.app.config.mathmpl_fontsize)
+ return [node]
+
+
+# This uses mathtext to render the expression
+def latex2png(latex, filename, fontset='cm', fontsize=10, dpi=100):
+ with mpl.rc_context({'mathtext.fontset': fontset, 'font.size': fontsize}):
+ try:
+ depth = mathtext.math_to_image(
+ f"${latex}$", filename, dpi=dpi, format="png")
+ except Exception:
+ _api.warn_external(f"Could not render math expression {latex}")
+ depth = 0
+ return depth
+
+
+# LaTeX to HTML translation stuff:
+def latex2html(node, source):
+ inline = isinstance(node.parent, nodes.TextElement)
+ latex = node['latex']
+ fontset = node['fontset']
+ fontsize = node['fontsize']
+ name = 'math-{}'.format(
+ hashlib.sha256(
+ f'{latex}{fontset}{fontsize}'.encode(),
+ usedforsecurity=False,
+ ).hexdigest()[-10:])
+
+ destdir = Path(setup.app.builder.outdir, '_images', 'mathmpl')
+ destdir.mkdir(parents=True, exist_ok=True)
+
+ dest = destdir / f'{name}.png'
+ depth = latex2png(latex, dest, fontset, fontsize=fontsize)
+
+ srcset = []
+ for size in setup.app.config.mathmpl_srcset:
+ filename = f'{name}-{size.replace(".", "_")}.png'
+ latex2png(latex, destdir / filename, fontset, fontsize=fontsize,
+ dpi=100 * float(size[:-1]))
+ srcset.append(
+ f'{setup.app.builder.imgpath}/mathmpl/{filename} {size}')
+ if srcset:
+ srcset = (f'srcset="{setup.app.builder.imgpath}/mathmpl/{name}.png, ' +
+ ', '.join(srcset) + '" ')
+
+ if inline:
+ cls = ''
+ else:
+ cls = 'class="center" '
+ if inline and depth != 0:
+ style = 'style="position: relative; bottom: -%dpx"' % (depth + 1)
+ else:
+ style = ''
+
+ return (f' ')
+
+
+def _config_inited(app, config):
+ # Check for srcset hidpi images
+ for i, size in enumerate(app.config.mathmpl_srcset):
+ if size[-1] == 'x': # "2x" = "2.0"
+ try:
+ float(size[:-1])
+ except ValueError:
+ raise ConfigError(
+ f'Invalid value for mathmpl_srcset parameter: {size!r}. '
+ 'Must be a list of strings with the multiplicative '
+ 'factor followed by an "x". e.g. ["2.0x", "1.5x"]')
+ else:
+ raise ConfigError(
+ f'Invalid value for mathmpl_srcset parameter: {size!r}. '
+ 'Must be a list of strings with the multiplicative '
+ 'factor followed by an "x". e.g. ["2.0x", "1.5x"]')
+
+
+def setup(app):
+ setup.app = app
+ app.add_config_value('mathmpl_fontsize', 10.0, True)
+ app.add_config_value('mathmpl_srcset', [], True)
+ try:
+ app.connect('config-inited', _config_inited) # Sphinx 1.8+
+ except ExtensionError:
+ app.connect('env-updated', lambda app, env: _config_inited(app, None))
+
+ # Add visit/depart methods to HTML-Translator:
+ def visit_latex_math_html(self, node):
+ source = self.document.attributes['source']
+ self.body.append(latex2html(node, source))
+
+ def depart_latex_math_html(self, node):
+ pass
+
+ # Add visit/depart methods to LaTeX-Translator:
+ def visit_latex_math_latex(self, node):
+ inline = isinstance(node.parent, nodes.TextElement)
+ if inline:
+ self.body.append('$%s$' % node['latex'])
+ else:
+ self.body.extend(['\\begin{equation}',
+ node['latex'],
+ '\\end{equation}'])
+
+ def depart_latex_math_latex(self, node):
+ pass
+
+ app.add_node(latex_math,
+ html=(visit_latex_math_html, depart_latex_math_html),
+ latex=(visit_latex_math_latex, depart_latex_math_latex))
+ app.add_role('mathmpl', math_role)
+ app.add_directive('mathmpl', MathDirective)
+ if sphinx.version_info < (1, 8):
+ app.add_role('math', math_role)
+ app.add_directive('math', MathDirective)
+
+ metadata = {'parallel_read_safe': True, 'parallel_write_safe': True}
+ return metadata
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/plot_directive.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/plot_directive.py
new file mode 100644
index 0000000000000000000000000000000000000000..ab9b7d76955015186d148e1a04fa32f3ab245a3e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/plot_directive.py
@@ -0,0 +1,936 @@
+"""
+A directive for including a Matplotlib plot in a Sphinx document
+================================================================
+
+This is a Sphinx extension providing a reStructuredText directive
+``.. plot::`` for including a plot in a Sphinx document.
+
+In HTML output, ``.. plot::`` will include a .png file with a link
+to a high-res .png and .pdf. In LaTeX output, it will include a .pdf.
+
+The plot content may be defined in one of three ways:
+
+1. **A path to a source file** as the argument to the directive::
+
+ .. plot:: path/to/plot.py
+
+ When a path to a source file is given, the content of the
+ directive may optionally contain a caption for the plot::
+
+ .. plot:: path/to/plot.py
+
+ The plot caption.
+
+ Additionally, one may specify the name of a function to call (with
+ no arguments) immediately after importing the module::
+
+ .. plot:: path/to/plot.py plot_function1
+
+2. Included as **inline content** to the directive::
+
+ .. plot::
+
+ import matplotlib.pyplot as plt
+ plt.plot([1, 2, 3], [4, 5, 6])
+ plt.title("A plotting exammple")
+
+3. Using **doctest** syntax::
+
+ .. plot::
+
+ A plotting example:
+ >>> import matplotlib.pyplot as plt
+ >>> plt.plot([1, 2, 3], [4, 5, 6])
+
+Options
+-------
+
+The ``.. plot::`` directive supports the following options:
+
+``:format:`` : {'python', 'doctest'}
+ The format of the input. If unset, the format is auto-detected.
+
+``:include-source:`` : bool
+ Whether to display the source code. The default can be changed using
+ the ``plot_include_source`` variable in :file:`conf.py` (which itself
+ defaults to False).
+
+``:show-source-link:`` : bool
+ Whether to show a link to the source in HTML. The default can be
+ changed using the ``plot_html_show_source_link`` variable in
+ :file:`conf.py` (which itself defaults to True).
+
+``:context:`` : bool or str
+ If provided, the code will be run in the context of all previous plot
+ directives for which the ``:context:`` option was specified. This only
+ applies to inline code plot directives, not those run from files. If
+ the ``:context: reset`` option is specified, the context is reset
+ for this and future plots, and previous figures are closed prior to
+ running the code. ``:context: close-figs`` keeps the context but closes
+ previous figures before running the code.
+
+``:nofigs:`` : bool
+ If specified, the code block will be run, but no figures will be
+ inserted. This is usually useful with the ``:context:`` option.
+
+``:caption:`` : str
+ If specified, the option's argument will be used as a caption for the
+ figure. This overwrites the caption given in the content, when the plot
+ is generated from a file.
+
+Additionally, this directive supports all the options of the `image directive
+`_,
+except for ``:target:`` (since plot will add its own target). These include
+``:alt:``, ``:height:``, ``:width:``, ``:scale:``, ``:align:`` and ``:class:``.
+
+Configuration options
+---------------------
+
+The plot directive has the following configuration options:
+
+plot_include_source
+ Default value for the include-source option (default: False).
+
+plot_html_show_source_link
+ Whether to show a link to the source in HTML (default: True).
+
+plot_pre_code
+ Code that should be executed before each plot. If None (the default),
+ it will default to a string containing::
+
+ import numpy as np
+ from matplotlib import pyplot as plt
+
+plot_basedir
+ Base directory, to which ``plot::`` file names are relative to.
+ If None or empty (the default), file names are relative to the
+ directory where the file containing the directive is.
+
+plot_formats
+ File formats to generate (default: ['png', 'hires.png', 'pdf']).
+ List of tuples or strings::
+
+ [(suffix, dpi), suffix, ...]
+
+ that determine the file format and the DPI. For entries whose
+ DPI was omitted, sensible defaults are chosen. When passing from
+ the command line through sphinx_build the list should be passed as
+ suffix:dpi,suffix:dpi, ...
+
+plot_html_show_formats
+ Whether to show links to the files in HTML (default: True).
+
+plot_rcparams
+ A dictionary containing any non-standard rcParams that should
+ be applied before each plot (default: {}).
+
+plot_apply_rcparams
+ By default, rcParams are applied when ``:context:`` option is not used
+ in a plot directive. If set, this configuration option overrides this
+ behavior and applies rcParams before each plot.
+
+plot_working_directory
+ By default, the working directory will be changed to the directory of
+ the example, so the code can get at its data files, if any. Also its
+ path will be added to `sys.path` so it can import any helper modules
+ sitting beside it. This configuration option can be used to specify
+ a central directory (also added to `sys.path`) where data files and
+ helper modules for all code are located.
+
+plot_template
+ Provide a customized template for preparing restructured text.
+
+plot_srcset
+ Allow the srcset image option for responsive image resolutions. List of
+ strings with the multiplicative factors followed by an "x".
+ e.g. ["2.0x", "1.5x"]. "2.0x" will create a png with the default "png"
+ resolution from plot_formats, multiplied by 2. If plot_srcset is
+ specified, the plot directive uses the
+ :doc:`/api/sphinxext_figmpl_directive_api` (instead of the usual figure
+ directive) in the intermediary rst file that is generated.
+ The plot_srcset option is incompatible with *singlehtml* builds, and an
+ error will be raised.
+
+Notes on how it works
+---------------------
+
+The plot directive runs the code it is given, either in the source file or the
+code under the directive. The figure created (if any) is saved in the sphinx
+build directory under a subdirectory named ``plot_directive``. It then creates
+an intermediate rst file that calls a ``.. figure:`` directive (or
+``.. figmpl::`` directive if ``plot_srcset`` is being used) and has links to
+the ``*.png`` files in the ``plot_directive`` directory. These translations can
+be customized by changing the *plot_template*. See the source of
+:doc:`/api/sphinxext_plot_directive_api` for the templates defined in *TEMPLATE*
+and *TEMPLATE_SRCSET*.
+"""
+
+import contextlib
+import doctest
+from io import StringIO
+import itertools
+import os
+from os.path import relpath
+from pathlib import Path
+import re
+import shutil
+import sys
+import textwrap
+import traceback
+
+from docutils.parsers.rst import directives, Directive
+from docutils.parsers.rst.directives.images import Image
+import jinja2 # Sphinx dependency.
+
+from sphinx.errors import ExtensionError
+
+import matplotlib
+from matplotlib.backend_bases import FigureManagerBase
+import matplotlib.pyplot as plt
+from matplotlib import _pylab_helpers, cbook
+
+matplotlib.use("agg")
+
+__version__ = 2
+
+
+# -----------------------------------------------------------------------------
+# Registration hook
+# -----------------------------------------------------------------------------
+
+
+def _option_boolean(arg):
+ if not arg or not arg.strip():
+ # no argument given, assume used as a flag
+ return True
+ elif arg.strip().lower() in ('no', '0', 'false'):
+ return False
+ elif arg.strip().lower() in ('yes', '1', 'true'):
+ return True
+ else:
+ raise ValueError(f'{arg!r} unknown boolean')
+
+
+def _option_context(arg):
+ if arg in [None, 'reset', 'close-figs']:
+ return arg
+ raise ValueError("Argument should be None or 'reset' or 'close-figs'")
+
+
+def _option_format(arg):
+ return directives.choice(arg, ('python', 'doctest'))
+
+
+def mark_plot_labels(app, document):
+ """
+ To make plots referenceable, we need to move the reference from the
+ "htmlonly" (or "latexonly") node to the actual figure node itself.
+ """
+ for name, explicit in document.nametypes.items():
+ if not explicit:
+ continue
+ labelid = document.nameids[name]
+ if labelid is None:
+ continue
+ node = document.ids[labelid]
+ if node.tagname in ('html_only', 'latex_only'):
+ for n in node:
+ if n.tagname == 'figure':
+ sectname = name
+ for c in n:
+ if c.tagname == 'caption':
+ sectname = c.astext()
+ break
+
+ node['ids'].remove(labelid)
+ node['names'].remove(name)
+ n['ids'].append(labelid)
+ n['names'].append(name)
+ document.settings.env.labels[name] = \
+ document.settings.env.docname, labelid, sectname
+ break
+
+
+class PlotDirective(Directive):
+ """The ``.. plot::`` directive, as documented in the module's docstring."""
+
+ has_content = True
+ required_arguments = 0
+ optional_arguments = 2
+ final_argument_whitespace = False
+ option_spec = {
+ 'alt': directives.unchanged,
+ 'height': directives.length_or_unitless,
+ 'width': directives.length_or_percentage_or_unitless,
+ 'scale': directives.nonnegative_int,
+ 'align': Image.align,
+ 'class': directives.class_option,
+ 'include-source': _option_boolean,
+ 'show-source-link': _option_boolean,
+ 'format': _option_format,
+ 'context': _option_context,
+ 'nofigs': directives.flag,
+ 'caption': directives.unchanged,
+ }
+
+ def run(self):
+ """Run the plot directive."""
+ try:
+ return run(self.arguments, self.content, self.options,
+ self.state_machine, self.state, self.lineno)
+ except Exception as e:
+ raise self.error(str(e))
+
+
+def _copy_css_file(app, exc):
+ if exc is None and app.builder.format == 'html':
+ src = cbook._get_data_path('plot_directive/plot_directive.css')
+ dst = app.outdir / Path('_static')
+ dst.mkdir(exist_ok=True)
+ # Use copyfile because we do not want to copy src's permissions.
+ shutil.copyfile(src, dst / Path('plot_directive.css'))
+
+
+def setup(app):
+ setup.app = app
+ setup.config = app.config
+ setup.confdir = app.confdir
+ app.add_directive('plot', PlotDirective)
+ app.add_config_value('plot_pre_code', None, True)
+ app.add_config_value('plot_include_source', False, True)
+ app.add_config_value('plot_html_show_source_link', True, True)
+ app.add_config_value('plot_formats', ['png', 'hires.png', 'pdf'], True)
+ app.add_config_value('plot_basedir', None, True)
+ app.add_config_value('plot_html_show_formats', True, True)
+ app.add_config_value('plot_rcparams', {}, True)
+ app.add_config_value('plot_apply_rcparams', False, True)
+ app.add_config_value('plot_working_directory', None, True)
+ app.add_config_value('plot_template', None, True)
+ app.add_config_value('plot_srcset', [], True)
+ app.connect('doctree-read', mark_plot_labels)
+ app.add_css_file('plot_directive.css')
+ app.connect('build-finished', _copy_css_file)
+ metadata = {'parallel_read_safe': True, 'parallel_write_safe': True,
+ 'version': matplotlib.__version__}
+ return metadata
+
+
+# -----------------------------------------------------------------------------
+# Doctest handling
+# -----------------------------------------------------------------------------
+
+
+def contains_doctest(text):
+ try:
+ # check if it's valid Python as-is
+ compile(text, '', 'exec')
+ return False
+ except SyntaxError:
+ pass
+ r = re.compile(r'^\s*>>>', re.M)
+ m = r.search(text)
+ return bool(m)
+
+
+def _split_code_at_show(text, function_name):
+ """Split code at plt.show()."""
+
+ is_doctest = contains_doctest(text)
+ if function_name is None:
+ parts = []
+ part = []
+ for line in text.split("\n"):
+ if ((not is_doctest and line.startswith('plt.show(')) or
+ (is_doctest and line.strip() == '>>> plt.show()')):
+ part.append(line)
+ parts.append("\n".join(part))
+ part = []
+ else:
+ part.append(line)
+ if "\n".join(part).strip():
+ parts.append("\n".join(part))
+ else:
+ parts = [text]
+ return is_doctest, parts
+
+
+# -----------------------------------------------------------------------------
+# Template
+# -----------------------------------------------------------------------------
+
+_SOURCECODE = """
+{{ source_code }}
+
+.. only:: html
+
+ {% if src_name or (html_show_formats and not multi_image) %}
+ (
+ {%- if src_name -%}
+ :download:`Source code <{{ build_dir }}/{{ src_name }}>`
+ {%- endif -%}
+ {%- if html_show_formats and not multi_image -%}
+ {%- for img in images -%}
+ {%- for fmt in img.formats -%}
+ {%- if src_name or not loop.first -%}, {% endif -%}
+ :download:`{{ fmt }} <{{ build_dir }}/{{ img.basename }}.{{ fmt }}>`
+ {%- endfor -%}
+ {%- endfor -%}
+ {%- endif -%}
+ )
+ {% endif %}
+"""
+
+TEMPLATE_SRCSET = _SOURCECODE + """
+ {% for img in images %}
+ .. figure-mpl:: {{ build_dir }}/{{ img.basename }}.{{ default_fmt }}
+ {% for option in options -%}
+ {{ option }}
+ {% endfor %}
+ {%- if caption -%}
+ {{ caption }} {# appropriate leading whitespace added beforehand #}
+ {% endif -%}
+ {%- if srcset -%}
+ :srcset: {{ build_dir }}/{{ img.basename }}.{{ default_fmt }}
+ {%- for sr in srcset -%}
+ , {{ build_dir }}/{{ img.basename }}.{{ sr }}.{{ default_fmt }} {{sr}}
+ {%- endfor -%}
+ {% endif %}
+
+ {% if html_show_formats and multi_image %}
+ (
+ {%- for fmt in img.formats -%}
+ {%- if not loop.first -%}, {% endif -%}
+ :download:`{{ fmt }} <{{ build_dir }}/{{ img.basename }}.{{ fmt }}>`
+ {%- endfor -%}
+ )
+ {% endif %}
+
+
+ {% endfor %}
+
+.. only:: not html
+
+ {% for img in images %}
+ .. figure-mpl:: {{ build_dir }}/{{ img.basename }}.*
+ {% for option in options -%}
+ {{ option }}
+ {% endfor -%}
+
+ {{ caption }} {# appropriate leading whitespace added beforehand #}
+ {% endfor %}
+
+"""
+
+TEMPLATE = _SOURCECODE + """
+
+ {% for img in images %}
+ .. figure:: {{ build_dir }}/{{ img.basename }}.{{ default_fmt }}
+ {% for option in options -%}
+ {{ option }}
+ {% endfor %}
+
+ {% if html_show_formats and multi_image -%}
+ (
+ {%- for fmt in img.formats -%}
+ {%- if not loop.first -%}, {% endif -%}
+ :download:`{{ fmt }} <{{ build_dir }}/{{ img.basename }}.{{ fmt }}>`
+ {%- endfor -%}
+ )
+ {%- endif -%}
+
+ {{ caption }} {# appropriate leading whitespace added beforehand #}
+ {% endfor %}
+
+.. only:: not html
+
+ {% for img in images %}
+ .. figure:: {{ build_dir }}/{{ img.basename }}.*
+ {% for option in options -%}
+ {{ option }}
+ {% endfor -%}
+
+ {{ caption }} {# appropriate leading whitespace added beforehand #}
+ {% endfor %}
+
+"""
+
+exception_template = """
+.. only:: html
+
+ [`source code <%(linkdir)s/%(basename)s.py>`__]
+
+Exception occurred rendering plot.
+
+"""
+
+# the context of the plot for all directives specified with the
+# :context: option
+plot_context = dict()
+
+
+class ImageFile:
+ def __init__(self, basename, dirname):
+ self.basename = basename
+ self.dirname = dirname
+ self.formats = []
+
+ def filename(self, format):
+ return os.path.join(self.dirname, f"{self.basename}.{format}")
+
+ def filenames(self):
+ return [self.filename(fmt) for fmt in self.formats]
+
+
+def out_of_date(original, derived, includes=None):
+ """
+ Return whether *derived* is out-of-date relative to *original* or any of
+ the RST files included in it using the RST include directive (*includes*).
+ *derived* and *original* are full paths, and *includes* is optionally a
+ list of full paths which may have been included in the *original*.
+ """
+ if not os.path.exists(derived):
+ return True
+
+ if includes is None:
+ includes = []
+ files_to_check = [original, *includes]
+
+ def out_of_date_one(original, derived_mtime):
+ return (os.path.exists(original) and
+ derived_mtime < os.stat(original).st_mtime)
+
+ derived_mtime = os.stat(derived).st_mtime
+ return any(out_of_date_one(f, derived_mtime) for f in files_to_check)
+
+
+class PlotError(RuntimeError):
+ pass
+
+
+def _run_code(code, code_path, ns=None, function_name=None):
+ """
+ Import a Python module from a path, and run the function given by
+ name, if function_name is not None.
+ """
+
+ # Change the working directory to the directory of the example, so
+ # it can get at its data files, if any. Add its path to sys.path
+ # so it can import any helper modules sitting beside it.
+ pwd = os.getcwd()
+ if setup.config.plot_working_directory is not None:
+ try:
+ os.chdir(setup.config.plot_working_directory)
+ except OSError as err:
+ raise OSError(f'{err}\n`plot_working_directory` option in '
+ f'Sphinx configuration file must be a valid '
+ f'directory path') from err
+ except TypeError as err:
+ raise TypeError(f'{err}\n`plot_working_directory` option in '
+ f'Sphinx configuration file must be a string or '
+ f'None') from err
+ elif code_path is not None:
+ dirname = os.path.abspath(os.path.dirname(code_path))
+ os.chdir(dirname)
+
+ with cbook._setattr_cm(
+ sys, argv=[code_path], path=[os.getcwd(), *sys.path]), \
+ contextlib.redirect_stdout(StringIO()):
+ try:
+ if ns is None:
+ ns = {}
+ if not ns:
+ if setup.config.plot_pre_code is None:
+ exec('import numpy as np\n'
+ 'from matplotlib import pyplot as plt\n', ns)
+ else:
+ exec(str(setup.config.plot_pre_code), ns)
+ if "__main__" in code:
+ ns['__name__'] = '__main__'
+
+ # Patch out non-interactive show() to avoid triggering a warning.
+ with cbook._setattr_cm(FigureManagerBase, show=lambda self: None):
+ exec(code, ns)
+ if function_name is not None:
+ exec(function_name + "()", ns)
+
+ except (Exception, SystemExit) as err:
+ raise PlotError(traceback.format_exc()) from err
+ finally:
+ os.chdir(pwd)
+ return ns
+
+
+def clear_state(plot_rcparams, close=True):
+ if close:
+ plt.close('all')
+ matplotlib.rc_file_defaults()
+ matplotlib.rcParams.update(plot_rcparams)
+
+
+def get_plot_formats(config):
+ default_dpi = {'png': 80, 'hires.png': 200, 'pdf': 200}
+ formats = []
+ plot_formats = config.plot_formats
+ for fmt in plot_formats:
+ if isinstance(fmt, str):
+ if ':' in fmt:
+ suffix, dpi = fmt.split(':')
+ formats.append((str(suffix), int(dpi)))
+ else:
+ formats.append((fmt, default_dpi.get(fmt, 80)))
+ elif isinstance(fmt, (tuple, list)) and len(fmt) == 2:
+ formats.append((str(fmt[0]), int(fmt[1])))
+ else:
+ raise PlotError('invalid image format "%r" in plot_formats' % fmt)
+ return formats
+
+
+def _parse_srcset(entries):
+ """
+ Parse srcset for multiples...
+ """
+ srcset = {}
+ for entry in entries:
+ entry = entry.strip()
+ if len(entry) >= 2:
+ mult = entry[:-1]
+ srcset[float(mult)] = entry
+ else:
+ raise ExtensionError(f'srcset argument {entry!r} is invalid.')
+ return srcset
+
+
+def render_figures(code, code_path, output_dir, output_base, context,
+ function_name, config, context_reset=False,
+ close_figs=False,
+ code_includes=None):
+ """
+ Run a pyplot script and save the images in *output_dir*.
+
+ Save the images under *output_dir* with file names derived from
+ *output_base*
+ """
+
+ if function_name is not None:
+ output_base = f'{output_base}_{function_name}'
+ formats = get_plot_formats(config)
+
+ # Try to determine if all images already exist
+
+ is_doctest, code_pieces = _split_code_at_show(code, function_name)
+ # Look for single-figure output files first
+ img = ImageFile(output_base, output_dir)
+ for format, dpi in formats:
+ if context or out_of_date(code_path, img.filename(format),
+ includes=code_includes):
+ all_exists = False
+ break
+ img.formats.append(format)
+ else:
+ all_exists = True
+
+ if all_exists:
+ return [(code, [img])]
+
+ # Then look for multi-figure output files
+ results = []
+ for i, code_piece in enumerate(code_pieces):
+ images = []
+ for j in itertools.count():
+ if len(code_pieces) > 1:
+ img = ImageFile('%s_%02d_%02d' % (output_base, i, j),
+ output_dir)
+ else:
+ img = ImageFile('%s_%02d' % (output_base, j), output_dir)
+ for fmt, dpi in formats:
+ if context or out_of_date(code_path, img.filename(fmt),
+ includes=code_includes):
+ all_exists = False
+ break
+ img.formats.append(fmt)
+
+ # assume that if we have one, we have them all
+ if not all_exists:
+ all_exists = (j > 0)
+ break
+ images.append(img)
+ if not all_exists:
+ break
+ results.append((code_piece, images))
+ else:
+ all_exists = True
+
+ if all_exists:
+ return results
+
+ # We didn't find the files, so build them
+
+ results = []
+ ns = plot_context if context else {}
+
+ if context_reset:
+ clear_state(config.plot_rcparams)
+ plot_context.clear()
+
+ close_figs = not context or close_figs
+
+ for i, code_piece in enumerate(code_pieces):
+
+ if not context or config.plot_apply_rcparams:
+ clear_state(config.plot_rcparams, close_figs)
+ elif close_figs:
+ plt.close('all')
+
+ _run_code(doctest.script_from_examples(code_piece) if is_doctest
+ else code_piece,
+ code_path, ns, function_name)
+
+ images = []
+ fig_managers = _pylab_helpers.Gcf.get_all_fig_managers()
+ for j, figman in enumerate(fig_managers):
+ if len(fig_managers) == 1 and len(code_pieces) == 1:
+ img = ImageFile(output_base, output_dir)
+ elif len(code_pieces) == 1:
+ img = ImageFile("%s_%02d" % (output_base, j), output_dir)
+ else:
+ img = ImageFile("%s_%02d_%02d" % (output_base, i, j),
+ output_dir)
+ images.append(img)
+
+ for fmt, dpi in formats:
+ try:
+ figman.canvas.figure.savefig(img.filename(fmt), dpi=dpi)
+ if fmt == formats[0][0] and config.plot_srcset:
+ # save a 2x, 3x etc version of the default...
+ srcset = _parse_srcset(config.plot_srcset)
+ for mult, suffix in srcset.items():
+ fm = f'{suffix}.{fmt}'
+ img.formats.append(fm)
+ figman.canvas.figure.savefig(img.filename(fm),
+ dpi=int(dpi * mult))
+ except Exception as err:
+ raise PlotError(traceback.format_exc()) from err
+ img.formats.append(fmt)
+
+ results.append((code_piece, images))
+
+ if not context or config.plot_apply_rcparams:
+ clear_state(config.plot_rcparams, close=not context)
+
+ return results
+
+
+def run(arguments, content, options, state_machine, state, lineno):
+ document = state_machine.document
+ config = document.settings.env.config
+ nofigs = 'nofigs' in options
+
+ if config.plot_srcset and setup.app.builder.name == 'singlehtml':
+ raise ExtensionError(
+ 'plot_srcset option not compatible with single HTML writer')
+
+ formats = get_plot_formats(config)
+ default_fmt = formats[0][0]
+
+ options.setdefault('include-source', config.plot_include_source)
+ options.setdefault('show-source-link', config.plot_html_show_source_link)
+
+ if 'class' in options:
+ # classes are parsed into a list of string, and output by simply
+ # printing the list, abusing the fact that RST guarantees to strip
+ # non-conforming characters
+ options['class'] = ['plot-directive'] + options['class']
+ else:
+ options.setdefault('class', ['plot-directive'])
+ keep_context = 'context' in options
+ context_opt = None if not keep_context else options['context']
+
+ rst_file = document.attributes['source']
+ rst_dir = os.path.dirname(rst_file)
+
+ if len(arguments):
+ if not config.plot_basedir:
+ source_file_name = os.path.join(setup.app.builder.srcdir,
+ directives.uri(arguments[0]))
+ else:
+ source_file_name = os.path.join(setup.confdir, config.plot_basedir,
+ directives.uri(arguments[0]))
+ # If there is content, it will be passed as a caption.
+ caption = '\n'.join(content)
+
+ # Enforce unambiguous use of captions.
+ if "caption" in options:
+ if caption:
+ raise ValueError(
+ 'Caption specified in both content and options.'
+ ' Please remove ambiguity.'
+ )
+ # Use caption option
+ caption = options["caption"]
+
+ # If the optional function name is provided, use it
+ if len(arguments) == 2:
+ function_name = arguments[1]
+ else:
+ function_name = None
+
+ code = Path(source_file_name).read_text(encoding='utf-8')
+ output_base = os.path.basename(source_file_name)
+ else:
+ source_file_name = rst_file
+ code = textwrap.dedent("\n".join(map(str, content)))
+ counter = document.attributes.get('_plot_counter', 0) + 1
+ document.attributes['_plot_counter'] = counter
+ base, ext = os.path.splitext(os.path.basename(source_file_name))
+ output_base = '%s-%d.py' % (base, counter)
+ function_name = None
+ caption = options.get('caption', '')
+
+ base, source_ext = os.path.splitext(output_base)
+ if source_ext in ('.py', '.rst', '.txt'):
+ output_base = base
+ else:
+ source_ext = ''
+
+ # ensure that LaTeX includegraphics doesn't choke in foo.bar.pdf filenames
+ output_base = output_base.replace('.', '-')
+
+ # is it in doctest format?
+ is_doctest = contains_doctest(code)
+ if 'format' in options:
+ if options['format'] == 'python':
+ is_doctest = False
+ else:
+ is_doctest = True
+
+ # determine output directory name fragment
+ source_rel_name = relpath(source_file_name, setup.confdir)
+ source_rel_dir = os.path.dirname(source_rel_name).lstrip(os.path.sep)
+
+ # build_dir: where to place output files (temporarily)
+ build_dir = os.path.join(os.path.dirname(setup.app.doctreedir),
+ 'plot_directive',
+ source_rel_dir)
+ # get rid of .. in paths, also changes pathsep
+ # see note in Python docs for warning about symbolic links on Windows.
+ # need to compare source and dest paths at end
+ build_dir = os.path.normpath(build_dir)
+ os.makedirs(build_dir, exist_ok=True)
+
+ # how to link to files from the RST file
+ try:
+ build_dir_link = relpath(build_dir, rst_dir).replace(os.path.sep, '/')
+ except ValueError:
+ # on Windows, relpath raises ValueError when path and start are on
+ # different mounts/drives
+ build_dir_link = build_dir
+
+ # get list of included rst files so that the output is updated when any
+ # plots in the included files change. These attributes are modified by the
+ # include directive (see the docutils.parsers.rst.directives.misc module).
+ try:
+ source_file_includes = [os.path.join(os.getcwd(), t[0])
+ for t in state.document.include_log]
+ except AttributeError:
+ # the document.include_log attribute only exists in docutils >=0.17,
+ # before that we need to inspect the state machine
+ possible_sources = {os.path.join(setup.confdir, t[0])
+ for t in state_machine.input_lines.items}
+ source_file_includes = [f for f in possible_sources
+ if os.path.isfile(f)]
+ # remove the source file itself from the includes
+ try:
+ source_file_includes.remove(source_file_name)
+ except ValueError:
+ pass
+
+ # save script (if necessary)
+ if options['show-source-link']:
+ Path(build_dir, output_base + source_ext).write_text(
+ doctest.script_from_examples(code)
+ if source_file_name == rst_file and is_doctest
+ else code,
+ encoding='utf-8')
+
+ # make figures
+ try:
+ results = render_figures(code=code,
+ code_path=source_file_name,
+ output_dir=build_dir,
+ output_base=output_base,
+ context=keep_context,
+ function_name=function_name,
+ config=config,
+ context_reset=context_opt == 'reset',
+ close_figs=context_opt == 'close-figs',
+ code_includes=source_file_includes)
+ errors = []
+ except PlotError as err:
+ reporter = state.memo.reporter
+ sm = reporter.system_message(
+ 2, "Exception occurred in plotting {}\n from {}:\n{}".format(
+ output_base, source_file_name, err),
+ line=lineno)
+ results = [(code, [])]
+ errors = [sm]
+
+ # Properly indent the caption
+ if caption and config.plot_srcset:
+ caption = ':caption: ' + caption.replace('\n', ' ')
+ elif caption:
+ caption = '\n' + '\n'.join(' ' + line.strip()
+ for line in caption.split('\n'))
+ # generate output restructuredtext
+ total_lines = []
+ for j, (code_piece, images) in enumerate(results):
+ if options['include-source']:
+ if is_doctest:
+ lines = ['', *code_piece.splitlines()]
+ else:
+ lines = ['.. code-block:: python', '',
+ *textwrap.indent(code_piece, ' ').splitlines()]
+ source_code = "\n".join(lines)
+ else:
+ source_code = ""
+
+ if nofigs:
+ images = []
+
+ if 'alt' in options:
+ options['alt'] = options['alt'].replace('\n', ' ')
+
+ opts = [
+ f':{key}: {val}' for key, val in options.items()
+ if key in ('alt', 'height', 'width', 'scale', 'align', 'class')]
+
+ # Not-None src_name signals the need for a source download in the
+ # generated html
+ if j == 0 and options['show-source-link']:
+ src_name = output_base + source_ext
+ else:
+ src_name = None
+ if config.plot_srcset:
+ srcset = [*_parse_srcset(config.plot_srcset).values()]
+ template = TEMPLATE_SRCSET
+ else:
+ srcset = None
+ template = TEMPLATE
+
+ result = jinja2.Template(config.plot_template or template).render(
+ default_fmt=default_fmt,
+ build_dir=build_dir_link,
+ src_name=src_name,
+ multi_image=len(images) > 1,
+ options=opts,
+ srcset=srcset,
+ images=images,
+ source_code=source_code,
+ html_show_formats=config.plot_html_show_formats and len(images),
+ caption=caption)
+ total_lines.extend(result.split("\n"))
+ total_lines.extend("\n")
+
+ if total_lines:
+ state_machine.insert_input(total_lines, source=source_file_name)
+
+ return errors
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/roles.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/roles.py
new file mode 100644
index 0000000000000000000000000000000000000000..301adcd8a5f5e0b18d28df297ee2025947e5c90d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/sphinxext/roles.py
@@ -0,0 +1,147 @@
+"""
+Custom roles for the Matplotlib documentation.
+
+.. warning::
+
+ These roles are considered semi-public. They are only intended to be used in
+ the Matplotlib documentation.
+
+However, it can happen that downstream packages end up pulling these roles into
+their documentation, which will result in documentation build errors. The following
+describes the exact mechanism and how to fix the errors.
+
+There are two ways, Matplotlib docstrings can end up in downstream documentation.
+You have to subclass a Matplotlib class and either use the ``:inherited-members:``
+option in your autodoc configuration, or you have to override a method without
+specifying a new docstring; the new method will inherit the original docstring and
+still render in your autodoc. If the docstring contains one of the custom sphinx
+roles, you'll see one of the following error messages:
+
+.. code-block:: none
+
+ Unknown interpreted text role "mpltype".
+ Unknown interpreted text role "rc".
+
+To fix this, you can add this module as extension to your sphinx :file:`conf.py`::
+
+ extensions = [
+ 'matplotlib.sphinxext.roles',
+ # Other extensions.
+ ]
+
+.. warning::
+
+ Direct use of these roles in other packages is not officially supported. We
+ reserve the right to modify or remove these roles without prior notification.
+"""
+
+from urllib.parse import urlsplit, urlunsplit
+
+from docutils import nodes
+
+import matplotlib
+from matplotlib import rcParamsDefault
+
+
+class _QueryReference(nodes.Inline, nodes.TextElement):
+ """
+ Wraps a reference or pending reference to add a query string.
+
+ The query string is generated from the attributes added to this node.
+
+ Also equivalent to a `~docutils.nodes.literal` node.
+ """
+
+ def to_query_string(self):
+ """Generate query string from node attributes."""
+ return '&'.join(f'{name}={value}' for name, value in self.attlist())
+
+
+def _visit_query_reference_node(self, node):
+ """
+ Resolve *node* into query strings on its ``reference`` children.
+
+ Then act as if this is a `~docutils.nodes.literal`.
+ """
+ query = node.to_query_string()
+ for refnode in node.findall(nodes.reference):
+ uri = urlsplit(refnode['refuri'])._replace(query=query)
+ refnode['refuri'] = urlunsplit(uri)
+
+ self.visit_literal(node)
+
+
+def _depart_query_reference_node(self, node):
+ """
+ Act as if this is a `~docutils.nodes.literal`.
+ """
+ self.depart_literal(node)
+
+
+def _rcparam_role(name, rawtext, text, lineno, inliner, options=None, content=None):
+ """
+ Sphinx role ``:rc:`` to highlight and link ``rcParams`` entries.
+
+ Usage: Give the desired ``rcParams`` key as parameter.
+
+ :code:`:rc:`figure.dpi`` will render as: :rc:`figure.dpi`
+ """
+ # Generate a pending cross-reference so that Sphinx will ensure this link
+ # isn't broken at some point in the future.
+ title = f'rcParams["{text}"]'
+ target = 'matplotlibrc-sample'
+ ref_nodes, messages = inliner.interpreted(title, f'{title} <{target}>',
+ 'ref', lineno)
+
+ qr = _QueryReference(rawtext, highlight=text)
+ qr += ref_nodes
+ node_list = [qr]
+
+ # The default backend would be printed as "agg", but that's not correct (as
+ # the default is actually determined by fallback).
+ if text in rcParamsDefault and text != "backend":
+ node_list.extend([
+ nodes.Text(' (default: '),
+ nodes.literal('', repr(rcParamsDefault[text])),
+ nodes.Text(')'),
+ ])
+
+ return node_list, messages
+
+
+def _mpltype_role(name, rawtext, text, lineno, inliner, options=None, content=None):
+ """
+ Sphinx role ``:mpltype:`` for custom matplotlib types.
+
+ In Matplotlib, there are a number of type-like concepts that do not have a
+ direct type representation; example: color. This role allows to properly
+ highlight them in the docs and link to their definition.
+
+ Currently supported values:
+
+ - :code:`:mpltype:`color`` will render as: :mpltype:`color`
+
+ """
+ mpltype = text
+ type_to_link_target = {
+ 'color': 'colors_def',
+ }
+ if mpltype not in type_to_link_target:
+ raise ValueError(f"Unknown mpltype: {mpltype!r}")
+
+ node_list, messages = inliner.interpreted(
+ mpltype, f'{mpltype} <{type_to_link_target[mpltype]}>', 'ref', lineno)
+ return node_list, messages
+
+
+def setup(app):
+ app.add_role("rc", _rcparam_role)
+ app.add_role("mpltype", _mpltype_role)
+ app.add_node(
+ _QueryReference,
+ html=(_visit_query_reference_node, _depart_query_reference_node),
+ latex=(_visit_query_reference_node, _depart_query_reference_node),
+ text=(_visit_query_reference_node, _depart_query_reference_node),
+ )
+ return {"version": matplotlib.__version__,
+ "parallel_read_safe": True, "parallel_write_safe": True}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/spines.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/spines.py
new file mode 100644
index 0000000000000000000000000000000000000000..7e77a393f2a28ff9fe976292f0062a6cc7e5adf3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/spines.py
@@ -0,0 +1,596 @@
+from collections.abc import MutableMapping
+import functools
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, _docstring
+from matplotlib.artist import allow_rasterization
+import matplotlib.transforms as mtransforms
+import matplotlib.patches as mpatches
+import matplotlib.path as mpath
+
+
+class Spine(mpatches.Patch):
+ """
+ An axis spine -- the line noting the data area boundaries.
+
+ Spines are the lines connecting the axis tick marks and noting the
+ boundaries of the data area. They can be placed at arbitrary
+ positions. See `~.Spine.set_position` for more information.
+
+ The default position is ``('outward', 0)``.
+
+ Spines are subclasses of `.Patch`, and inherit much of their behavior.
+
+ Spines draw a line, a circle, or an arc depending on if
+ `~.Spine.set_patch_line`, `~.Spine.set_patch_circle`, or
+ `~.Spine.set_patch_arc` has been called. Line-like is the default.
+
+ For examples see :ref:`spines_examples`.
+ """
+ def __str__(self):
+ return "Spine"
+
+ @_docstring.interpd
+ def __init__(self, axes, spine_type, path, **kwargs):
+ """
+ Parameters
+ ----------
+ axes : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` instance containing the spine.
+ spine_type : str
+ The spine type.
+ path : `~matplotlib.path.Path`
+ The `.Path` instance used to draw the spine.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ Valid keyword arguments are:
+
+ %(Patch:kwdoc)s
+ """
+ super().__init__(**kwargs)
+ self.axes = axes
+ self.set_figure(self.axes.get_figure(root=False))
+ self.spine_type = spine_type
+ self.set_facecolor('none')
+ self.set_edgecolor(mpl.rcParams['axes.edgecolor'])
+ self.set_linewidth(mpl.rcParams['axes.linewidth'])
+ self.set_capstyle('projecting')
+ self.axis = None
+
+ self.set_zorder(2.5)
+ self.set_transform(self.axes.transData) # default transform
+
+ self._bounds = None # default bounds
+
+ # Defer initial position determination. (Not much support for
+ # non-rectangular axes is currently implemented, and this lets
+ # them pass through the spines machinery without errors.)
+ self._position = None
+ _api.check_isinstance(mpath.Path, path=path)
+ self._path = path
+
+ # To support drawing both linear and circular spines, this
+ # class implements Patch behavior three ways. If
+ # self._patch_type == 'line', behave like a mpatches.PathPatch
+ # instance. If self._patch_type == 'circle', behave like a
+ # mpatches.Ellipse instance. If self._patch_type == 'arc', behave like
+ # a mpatches.Arc instance.
+ self._patch_type = 'line'
+
+ # Behavior copied from mpatches.Ellipse:
+ # Note: This cannot be calculated until this is added to an Axes
+ self._patch_transform = mtransforms.IdentityTransform()
+
+ def set_patch_arc(self, center, radius, theta1, theta2):
+ """Set the spine to be arc-like."""
+ self._patch_type = 'arc'
+ self._center = center
+ self._width = radius * 2
+ self._height = radius * 2
+ self._theta1 = theta1
+ self._theta2 = theta2
+ self._path = mpath.Path.arc(theta1, theta2)
+ # arc drawn on axes transform
+ self.set_transform(self.axes.transAxes)
+ self.stale = True
+
+ def set_patch_circle(self, center, radius):
+ """Set the spine to be circular."""
+ self._patch_type = 'circle'
+ self._center = center
+ self._width = radius * 2
+ self._height = radius * 2
+ # circle drawn on axes transform
+ self.set_transform(self.axes.transAxes)
+ self.stale = True
+
+ def set_patch_line(self):
+ """Set the spine to be linear."""
+ self._patch_type = 'line'
+ self.stale = True
+
+ # Behavior copied from mpatches.Ellipse:
+ def _recompute_transform(self):
+ """
+ Notes
+ -----
+ This cannot be called until after this has been added to an Axes,
+ otherwise unit conversion will fail. This makes it very important to
+ call the accessor method and not directly access the transformation
+ member variable.
+ """
+ assert self._patch_type in ('arc', 'circle')
+ center = (self.convert_xunits(self._center[0]),
+ self.convert_yunits(self._center[1]))
+ width = self.convert_xunits(self._width)
+ height = self.convert_yunits(self._height)
+ self._patch_transform = mtransforms.Affine2D() \
+ .scale(width * 0.5, height * 0.5) \
+ .translate(*center)
+
+ def get_patch_transform(self):
+ if self._patch_type in ('arc', 'circle'):
+ self._recompute_transform()
+ return self._patch_transform
+ else:
+ return super().get_patch_transform()
+
+ def get_window_extent(self, renderer=None):
+ """
+ Return the window extent of the spines in display space, including
+ padding for ticks (but not their labels)
+
+ See Also
+ --------
+ matplotlib.axes.Axes.get_tightbbox
+ matplotlib.axes.Axes.get_window_extent
+ """
+ # make sure the location is updated so that transforms etc are correct:
+ self._adjust_location()
+ bb = super().get_window_extent(renderer=renderer)
+ if self.axis is None or not self.axis.get_visible():
+ return bb
+ bboxes = [bb]
+ drawn_ticks = self.axis._update_ticks()
+
+ major_tick = next(iter({*drawn_ticks} & {*self.axis.majorTicks}), None)
+ minor_tick = next(iter({*drawn_ticks} & {*self.axis.minorTicks}), None)
+ for tick in [major_tick, minor_tick]:
+ if tick is None:
+ continue
+ bb0 = bb.frozen()
+ tickl = tick._size
+ tickdir = tick._tickdir
+ if tickdir == 'out':
+ padout = 1
+ padin = 0
+ elif tickdir == 'in':
+ padout = 0
+ padin = 1
+ else:
+ padout = 0.5
+ padin = 0.5
+ dpi = self.get_figure(root=True).dpi
+ padout = padout * tickl / 72 * dpi
+ padin = padin * tickl / 72 * dpi
+
+ if tick.tick1line.get_visible():
+ if self.spine_type == 'left':
+ bb0.x0 = bb0.x0 - padout
+ bb0.x1 = bb0.x1 + padin
+ elif self.spine_type == 'bottom':
+ bb0.y0 = bb0.y0 - padout
+ bb0.y1 = bb0.y1 + padin
+
+ if tick.tick2line.get_visible():
+ if self.spine_type == 'right':
+ bb0.x1 = bb0.x1 + padout
+ bb0.x0 = bb0.x0 - padin
+ elif self.spine_type == 'top':
+ bb0.y1 = bb0.y1 + padout
+ bb0.y0 = bb0.y0 - padout
+ bboxes.append(bb0)
+
+ return mtransforms.Bbox.union(bboxes)
+
+ def get_path(self):
+ return self._path
+
+ def _ensure_position_is_set(self):
+ if self._position is None:
+ # default position
+ self._position = ('outward', 0.0) # in points
+ self.set_position(self._position)
+
+ def register_axis(self, axis):
+ """
+ Register an axis.
+
+ An axis should be registered with its corresponding spine from
+ the Axes instance. This allows the spine to clear any axis
+ properties when needed.
+ """
+ self.axis = axis
+ self.stale = True
+
+ def clear(self):
+ """Clear the current spine."""
+ self._clear()
+ if self.axis is not None:
+ self.axis.clear()
+
+ def _clear(self):
+ """
+ Clear things directly related to the spine.
+
+ In this way it is possible to avoid clearing the Axis as well when calling
+ from library code where it is known that the Axis is cleared separately.
+ """
+ self._position = None # clear position
+
+ def _adjust_location(self):
+ """Automatically set spine bounds to the view interval."""
+
+ if self.spine_type == 'circle':
+ return
+
+ if self._bounds is not None:
+ low, high = self._bounds
+ elif self.spine_type in ('left', 'right'):
+ low, high = self.axes.viewLim.intervaly
+ elif self.spine_type in ('top', 'bottom'):
+ low, high = self.axes.viewLim.intervalx
+ else:
+ raise ValueError(f'unknown spine spine_type: {self.spine_type}')
+
+ if self._patch_type == 'arc':
+ if self.spine_type in ('bottom', 'top'):
+ try:
+ direction = self.axes.get_theta_direction()
+ except AttributeError:
+ direction = 1
+ try:
+ offset = self.axes.get_theta_offset()
+ except AttributeError:
+ offset = 0
+ low = low * direction + offset
+ high = high * direction + offset
+ if low > high:
+ low, high = high, low
+
+ self._path = mpath.Path.arc(np.rad2deg(low), np.rad2deg(high))
+
+ if self.spine_type == 'bottom':
+ rmin, rmax = self.axes.viewLim.intervaly
+ try:
+ rorigin = self.axes.get_rorigin()
+ except AttributeError:
+ rorigin = rmin
+ scaled_diameter = (rmin - rorigin) / (rmax - rorigin)
+ self._height = scaled_diameter
+ self._width = scaled_diameter
+
+ else:
+ raise ValueError('unable to set bounds for spine "%s"' %
+ self.spine_type)
+ else:
+ v1 = self._path.vertices
+ assert v1.shape == (2, 2), 'unexpected vertices shape'
+ if self.spine_type in ['left', 'right']:
+ v1[0, 1] = low
+ v1[1, 1] = high
+ elif self.spine_type in ['bottom', 'top']:
+ v1[0, 0] = low
+ v1[1, 0] = high
+ else:
+ raise ValueError('unable to set bounds for spine "%s"' %
+ self.spine_type)
+
+ @allow_rasterization
+ def draw(self, renderer):
+ self._adjust_location()
+ ret = super().draw(renderer)
+ self.stale = False
+ return ret
+
+ def set_position(self, position):
+ """
+ Set the position of the spine.
+
+ Spine position is specified by a 2 tuple of (position type,
+ amount). The position types are:
+
+ * 'outward': place the spine out from the data area by the specified
+ number of points. (Negative values place the spine inwards.)
+ * 'axes': place the spine at the specified Axes coordinate (0 to 1).
+ * 'data': place the spine at the specified data coordinate.
+
+ Additionally, shorthand notations define a special positions:
+
+ * 'center' -> ``('axes', 0.5)``
+ * 'zero' -> ``('data', 0.0)``
+
+ Examples
+ --------
+ :doc:`/gallery/spines/spine_placement_demo`
+ """
+ if position in ('center', 'zero'): # special positions
+ pass
+ else:
+ if len(position) != 2:
+ raise ValueError("position should be 'center' or 2-tuple")
+ if position[0] not in ['outward', 'axes', 'data']:
+ raise ValueError("position[0] should be one of 'outward', "
+ "'axes', or 'data' ")
+ self._position = position
+ self.set_transform(self.get_spine_transform())
+ if self.axis is not None:
+ self.axis.reset_ticks()
+ self.stale = True
+
+ def get_position(self):
+ """Return the spine position."""
+ self._ensure_position_is_set()
+ return self._position
+
+ def get_spine_transform(self):
+ """Return the spine transform."""
+ self._ensure_position_is_set()
+
+ position = self._position
+ if isinstance(position, str):
+ if position == 'center':
+ position = ('axes', 0.5)
+ elif position == 'zero':
+ position = ('data', 0)
+ assert len(position) == 2, 'position should be 2-tuple'
+ position_type, amount = position
+ _api.check_in_list(['axes', 'outward', 'data'],
+ position_type=position_type)
+ if self.spine_type in ['left', 'right']:
+ base_transform = self.axes.get_yaxis_transform(which='grid')
+ elif self.spine_type in ['top', 'bottom']:
+ base_transform = self.axes.get_xaxis_transform(which='grid')
+ else:
+ raise ValueError(f'unknown spine spine_type: {self.spine_type!r}')
+
+ if position_type == 'outward':
+ if amount == 0: # short circuit commonest case
+ return base_transform
+ else:
+ offset_vec = {'left': (-1, 0), 'right': (1, 0),
+ 'bottom': (0, -1), 'top': (0, 1),
+ }[self.spine_type]
+ # calculate x and y offset in dots
+ offset_dots = amount * np.array(offset_vec) / 72
+ return (base_transform
+ + mtransforms.ScaledTranslation(
+ *offset_dots, self.get_figure(root=False).dpi_scale_trans))
+ elif position_type == 'axes':
+ if self.spine_type in ['left', 'right']:
+ # keep y unchanged, fix x at amount
+ return (mtransforms.Affine2D.from_values(0, 0, 0, 1, amount, 0)
+ + base_transform)
+ elif self.spine_type in ['bottom', 'top']:
+ # keep x unchanged, fix y at amount
+ return (mtransforms.Affine2D.from_values(1, 0, 0, 0, 0, amount)
+ + base_transform)
+ elif position_type == 'data':
+ if self.spine_type in ('right', 'top'):
+ # The right and top spines have a default position of 1 in
+ # axes coordinates. When specifying the position in data
+ # coordinates, we need to calculate the position relative to 0.
+ amount -= 1
+ if self.spine_type in ('left', 'right'):
+ return mtransforms.blended_transform_factory(
+ mtransforms.Affine2D().translate(amount, 0)
+ + self.axes.transData,
+ self.axes.transData)
+ elif self.spine_type in ('bottom', 'top'):
+ return mtransforms.blended_transform_factory(
+ self.axes.transData,
+ mtransforms.Affine2D().translate(0, amount)
+ + self.axes.transData)
+
+ def set_bounds(self, low=None, high=None):
+ """
+ Set the spine bounds.
+
+ Parameters
+ ----------
+ low : float or None, optional
+ The lower spine bound. Passing *None* leaves the limit unchanged.
+
+ The bounds may also be passed as the tuple (*low*, *high*) as the
+ first positional argument.
+
+ .. ACCEPTS: (low: float, high: float)
+
+ high : float or None, optional
+ The higher spine bound. Passing *None* leaves the limit unchanged.
+ """
+ if self.spine_type == 'circle':
+ raise ValueError(
+ 'set_bounds() method incompatible with circular spines')
+ if high is None and np.iterable(low):
+ low, high = low
+ old_low, old_high = self.get_bounds() or (None, None)
+ if low is None:
+ low = old_low
+ if high is None:
+ high = old_high
+ self._bounds = (low, high)
+ self.stale = True
+
+ def get_bounds(self):
+ """Get the bounds of the spine."""
+ return self._bounds
+
+ @classmethod
+ def linear_spine(cls, axes, spine_type, **kwargs):
+ """Create and return a linear `Spine`."""
+ # all values of 0.999 get replaced upon call to set_bounds()
+ if spine_type == 'left':
+ path = mpath.Path([(0.0, 0.999), (0.0, 0.999)])
+ elif spine_type == 'right':
+ path = mpath.Path([(1.0, 0.999), (1.0, 0.999)])
+ elif spine_type == 'bottom':
+ path = mpath.Path([(0.999, 0.0), (0.999, 0.0)])
+ elif spine_type == 'top':
+ path = mpath.Path([(0.999, 1.0), (0.999, 1.0)])
+ else:
+ raise ValueError('unable to make path for spine "%s"' % spine_type)
+ result = cls(axes, spine_type, path, **kwargs)
+ result.set_visible(mpl.rcParams[f'axes.spines.{spine_type}'])
+
+ return result
+
+ @classmethod
+ def arc_spine(cls, axes, spine_type, center, radius, theta1, theta2,
+ **kwargs):
+ """Create and return an arc `Spine`."""
+ path = mpath.Path.arc(theta1, theta2)
+ result = cls(axes, spine_type, path, **kwargs)
+ result.set_patch_arc(center, radius, theta1, theta2)
+ return result
+
+ @classmethod
+ def circular_spine(cls, axes, center, radius, **kwargs):
+ """Create and return a circular `Spine`."""
+ path = mpath.Path.unit_circle()
+ spine_type = 'circle'
+ result = cls(axes, spine_type, path, **kwargs)
+ result.set_patch_circle(center, radius)
+ return result
+
+ def set_color(self, c):
+ """
+ Set the edgecolor.
+
+ Parameters
+ ----------
+ c : :mpltype:`color`
+
+ Notes
+ -----
+ This method does not modify the facecolor (which defaults to "none"),
+ unlike the `.Patch.set_color` method defined in the parent class. Use
+ `.Patch.set_facecolor` to set the facecolor.
+ """
+ self.set_edgecolor(c)
+ self.stale = True
+
+
+class SpinesProxy:
+ """
+ A proxy to broadcast ``set_*()`` and ``set()`` method calls to contained `.Spines`.
+
+ The proxy cannot be used for any other operations on its members.
+
+ The supported methods are determined dynamically based on the contained
+ spines. If not all spines support a given method, it's executed only on
+ the subset of spines that support it.
+ """
+ def __init__(self, spine_dict):
+ self._spine_dict = spine_dict
+
+ def __getattr__(self, name):
+ broadcast_targets = [spine for spine in self._spine_dict.values()
+ if hasattr(spine, name)]
+ if (name != 'set' and not name.startswith('set_')) or not broadcast_targets:
+ raise AttributeError(
+ f"'SpinesProxy' object has no attribute '{name}'")
+
+ def x(_targets, _funcname, *args, **kwargs):
+ for spine in _targets:
+ getattr(spine, _funcname)(*args, **kwargs)
+ x = functools.partial(x, broadcast_targets, name)
+ x.__doc__ = broadcast_targets[0].__doc__
+ return x
+
+ def __dir__(self):
+ names = []
+ for spine in self._spine_dict.values():
+ names.extend(name
+ for name in dir(spine) if name.startswith('set_'))
+ return list(sorted(set(names)))
+
+
+class Spines(MutableMapping):
+ r"""
+ The container of all `.Spine`\s in an Axes.
+
+ The interface is dict-like mapping names (e.g. 'left') to `.Spine` objects.
+ Additionally, it implements some pandas.Series-like features like accessing
+ elements by attribute::
+
+ spines['top'].set_visible(False)
+ spines.top.set_visible(False)
+
+ Multiple spines can be addressed simultaneously by passing a list::
+
+ spines[['top', 'right']].set_visible(False)
+
+ Use an open slice to address all spines::
+
+ spines[:].set_visible(False)
+
+ The latter two indexing methods will return a `SpinesProxy` that broadcasts all
+ ``set_*()`` and ``set()`` calls to its members, but cannot be used for any other
+ operation.
+ """
+ def __init__(self, **kwargs):
+ self._dict = kwargs
+
+ @classmethod
+ def from_dict(cls, d):
+ return cls(**d)
+
+ def __getstate__(self):
+ return self._dict
+
+ def __setstate__(self, state):
+ self.__init__(**state)
+
+ def __getattr__(self, name):
+ try:
+ return self._dict[name]
+ except KeyError:
+ raise AttributeError(
+ f"'Spines' object does not contain a '{name}' spine")
+
+ def __getitem__(self, key):
+ if isinstance(key, list):
+ unknown_keys = [k for k in key if k not in self._dict]
+ if unknown_keys:
+ raise KeyError(', '.join(unknown_keys))
+ return SpinesProxy({k: v for k, v in self._dict.items()
+ if k in key})
+ if isinstance(key, tuple):
+ raise ValueError('Multiple spines must be passed as a single list')
+ if isinstance(key, slice):
+ if key.start is None and key.stop is None and key.step is None:
+ return SpinesProxy(self._dict)
+ else:
+ raise ValueError(
+ 'Spines does not support slicing except for the fully '
+ 'open slice [:] to access all spines.')
+ return self._dict[key]
+
+ def __setitem__(self, key, value):
+ # TODO: Do we want to deprecate adding spines?
+ self._dict[key] = value
+
+ def __delitem__(self, key):
+ # TODO: Do we want to deprecate deleting spines?
+ del self._dict[key]
+
+ def __iter__(self):
+ return iter(self._dict)
+
+ def __len__(self):
+ return len(self._dict)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/spines.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/spines.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..ff2a1a40bf947005692ccaf2b95977e57a1747b6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/spines.pyi
@@ -0,0 +1,83 @@
+from collections.abc import Callable, Iterator, MutableMapping
+from typing import Literal, TypeVar, overload
+
+import matplotlib.patches as mpatches
+from matplotlib.axes import Axes
+from matplotlib.axis import Axis
+from matplotlib.path import Path
+from matplotlib.transforms import Transform
+from matplotlib.typing import ColorType
+
+class Spine(mpatches.Patch):
+ axes: Axes
+ spine_type: str
+ axis: Axis | None
+ def __init__(self, axes: Axes, spine_type: str, path: Path, **kwargs) -> None: ...
+ def set_patch_arc(
+ self, center: tuple[float, float], radius: float, theta1: float, theta2: float
+ ) -> None: ...
+ def set_patch_circle(self, center: tuple[float, float], radius: float) -> None: ...
+ def set_patch_line(self) -> None: ...
+ def get_patch_transform(self) -> Transform: ...
+ def get_path(self) -> Path: ...
+ def register_axis(self, axis: Axis) -> None: ...
+ def clear(self) -> None: ...
+ def set_position(
+ self,
+ position: Literal["center", "zero"]
+ | tuple[Literal["outward", "axes", "data"], float],
+ ) -> None: ...
+ def get_position(
+ self,
+ ) -> Literal["center", "zero"] | tuple[
+ Literal["outward", "axes", "data"], float
+ ]: ...
+ def get_spine_transform(self) -> Transform: ...
+ def set_bounds(self, low: float | None = ..., high: float | None = ...) -> None: ...
+ def get_bounds(self) -> tuple[float, float]: ...
+
+ _T = TypeVar("_T", bound=Spine)
+ @classmethod
+ def linear_spine(
+ cls: type[_T],
+ axes: Axes,
+ spine_type: Literal["left", "right", "bottom", "top"],
+ **kwargs
+ ) -> _T: ...
+ @classmethod
+ def arc_spine(
+ cls: type[_T],
+ axes: Axes,
+ spine_type: Literal["left", "right", "bottom", "top"],
+ center: tuple[float, float],
+ radius: float,
+ theta1: float,
+ theta2: float,
+ **kwargs
+ ) -> _T: ...
+ @classmethod
+ def circular_spine(
+ cls: type[_T], axes: Axes, center: tuple[float, float], radius: float, **kwargs
+ ) -> _T: ...
+ def set_color(self, c: ColorType | None) -> None: ...
+
+class SpinesProxy:
+ def __init__(self, spine_dict: dict[str, Spine]) -> None: ...
+ def __getattr__(self, name: str) -> Callable[..., None]: ...
+ def __dir__(self) -> list[str]: ...
+
+class Spines(MutableMapping[str, Spine]):
+ def __init__(self, **kwargs: Spine) -> None: ...
+ @classmethod
+ def from_dict(cls, d: dict[str, Spine]) -> Spines: ...
+ def __getattr__(self, name: str) -> Spine: ...
+ @overload
+ def __getitem__(self, key: str) -> Spine: ...
+ @overload
+ def __getitem__(self, key: list[str]) -> SpinesProxy: ...
+ @overload
+ def __getitem__(self, key: slice) -> SpinesProxy: ...
+ def __setitem__(self, key: str, value: Spine) -> None: ...
+ def __delitem__(self, key: str) -> None: ...
+ def __iter__(self) -> Iterator[str]: ...
+ def __len__(self) -> int: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/stackplot.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/stackplot.py
new file mode 100644
index 0000000000000000000000000000000000000000..bd11558b0da99ad0774ea85b2996e699c6e15717
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/stackplot.py
@@ -0,0 +1,147 @@
+"""
+Stacked area plot for 1D arrays inspired by Douglas Y'barbo's stackoverflow
+answer:
+https://stackoverflow.com/q/2225995/
+
+(https://stackoverflow.com/users/66549/doug)
+"""
+
+import itertools
+
+import numpy as np
+
+from matplotlib import _api
+
+__all__ = ['stackplot']
+
+
+def stackplot(axes, x, *args,
+ labels=(), colors=None, hatch=None, baseline='zero',
+ **kwargs):
+ """
+ Draw a stacked area plot or a streamgraph.
+
+ Parameters
+ ----------
+ x : (N,) array-like
+
+ y : (M, N) array-like
+ The data can be either stacked or unstacked. Each of the following
+ calls is legal::
+
+ stackplot(x, y) # where y has shape (M, N) e.g. y = [y1, y2, y3, y4]
+ stackplot(x, y1, y2, y3, y4) # where y1, y2, y3, y4 have length N
+
+ baseline : {'zero', 'sym', 'wiggle', 'weighted_wiggle'}
+ Method used to calculate the baseline:
+
+ - ``'zero'``: Constant zero baseline, i.e. a simple stacked plot.
+ - ``'sym'``: Symmetric around zero and is sometimes called
+ 'ThemeRiver'.
+ - ``'wiggle'``: Minimizes the sum of the squared slopes.
+ - ``'weighted_wiggle'``: Does the same but weights to account for
+ size of each layer. It is also called 'Streamgraph'-layout. More
+ details can be found at http://leebyron.com/streamgraph/.
+
+ labels : list of str, optional
+ A sequence of labels to assign to each data series. If unspecified,
+ then no labels will be applied to artists.
+
+ colors : list of :mpltype:`color`, optional
+ A sequence of colors to be cycled through and used to color the stacked
+ areas. The sequence need not be exactly the same length as the number
+ of provided *y*, in which case the colors will repeat from the
+ beginning.
+
+ If not specified, the colors from the Axes property cycle will be used.
+
+ hatch : list of str, default: None
+ A sequence of hatching styles. See
+ :doc:`/gallery/shapes_and_collections/hatch_style_reference`.
+ The sequence will be cycled through for filling the
+ stacked areas from bottom to top.
+ It need not be exactly the same length as the number
+ of provided *y*, in which case the styles will repeat from the
+ beginning.
+
+ .. versionadded:: 3.9
+ Support for list input
+
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+
+ **kwargs
+ All other keyword arguments are passed to `.Axes.fill_between`.
+
+ Returns
+ -------
+ list of `.PolyCollection`
+ A list of `.PolyCollection` instances, one for each element in the
+ stacked area plot.
+ """
+
+ y = np.vstack(args)
+
+ labels = iter(labels)
+ if colors is not None:
+ colors = itertools.cycle(colors)
+ else:
+ colors = (axes._get_lines.get_next_color() for _ in y)
+
+ if hatch is None or isinstance(hatch, str):
+ hatch = itertools.cycle([hatch])
+ else:
+ hatch = itertools.cycle(hatch)
+
+ # Assume data passed has not been 'stacked', so stack it here.
+ # We'll need a float buffer for the upcoming calculations.
+ stack = np.cumsum(y, axis=0, dtype=np.promote_types(y.dtype, np.float32))
+
+ _api.check_in_list(['zero', 'sym', 'wiggle', 'weighted_wiggle'],
+ baseline=baseline)
+ if baseline == 'zero':
+ first_line = 0.
+
+ elif baseline == 'sym':
+ first_line = -np.sum(y, 0) * 0.5
+ stack += first_line[None, :]
+
+ elif baseline == 'wiggle':
+ m = y.shape[0]
+ first_line = (y * (m - 0.5 - np.arange(m)[:, None])).sum(0)
+ first_line /= -m
+ stack += first_line
+
+ elif baseline == 'weighted_wiggle':
+ total = np.sum(y, 0)
+ # multiply by 1/total (or zero) to avoid infinities in the division:
+ inv_total = np.zeros_like(total)
+ mask = total > 0
+ inv_total[mask] = 1.0 / total[mask]
+ increase = np.hstack((y[:, 0:1], np.diff(y)))
+ below_size = total - stack
+ below_size += 0.5 * y
+ move_up = below_size * inv_total
+ move_up[:, 0] = 0.5
+ center = (move_up - 0.5) * increase
+ center = np.cumsum(center.sum(0))
+ first_line = center - 0.5 * total
+ stack += first_line
+
+ # Color between x = 0 and the first array.
+ coll = axes.fill_between(x, first_line, stack[0, :],
+ facecolor=next(colors),
+ hatch=next(hatch),
+ label=next(labels, None),
+ **kwargs)
+ coll.sticky_edges.y[:] = [0]
+ r = [coll]
+
+ # Color between array i-1 and array i
+ for i in range(len(y) - 1):
+ r.append(axes.fill_between(x, stack[i, :], stack[i + 1, :],
+ facecolor=next(colors),
+ hatch=next(hatch),
+ label=next(labels, None),
+ **kwargs))
+ return r
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/stackplot.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/stackplot.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..9509f858a4bfbf6fd54fa1111077341b31ec03b2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/stackplot.pyi
@@ -0,0 +1,20 @@
+from matplotlib.axes import Axes
+from matplotlib.collections import PolyCollection
+
+from collections.abc import Iterable
+from typing import Literal
+from numpy.typing import ArrayLike
+from matplotlib.typing import ColorType
+
+def stackplot(
+ axes: Axes,
+ x: ArrayLike,
+ *args: ArrayLike,
+ labels: Iterable[str] = ...,
+ colors: Iterable[ColorType] | None = ...,
+ hatch: Iterable[str] | str | None = ...,
+ baseline: Literal["zero", "sym", "wiggle", "weighted_wiggle"] = ...,
+ **kwargs
+) -> list[PolyCollection]: ...
+
+__all__ = ['stackplot']
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/streamplot.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/streamplot.py
new file mode 100644
index 0000000000000000000000000000000000000000..84f99732c709d25a0efb2518156ef213f3ee6a4d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/streamplot.py
@@ -0,0 +1,712 @@
+"""
+Streamline plotting for 2D vector fields.
+
+"""
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cm, patches
+import matplotlib.colors as mcolors
+import matplotlib.collections as mcollections
+import matplotlib.lines as mlines
+
+
+__all__ = ['streamplot']
+
+
+def streamplot(axes, x, y, u, v, density=1, linewidth=None, color=None,
+ cmap=None, norm=None, arrowsize=1, arrowstyle='-|>',
+ minlength=0.1, transform=None, zorder=None, start_points=None,
+ maxlength=4.0, integration_direction='both',
+ broken_streamlines=True):
+ """
+ Draw streamlines of a vector flow.
+
+ Parameters
+ ----------
+ x, y : 1D/2D arrays
+ Evenly spaced strictly increasing arrays to make a grid. If 2D, all
+ rows of *x* must be equal and all columns of *y* must be equal; i.e.,
+ they must be as if generated by ``np.meshgrid(x_1d, y_1d)``.
+ u, v : 2D arrays
+ *x* and *y*-velocities. The number of rows and columns must match
+ the length of *y* and *x*, respectively.
+ density : float or (float, float)
+ Controls the closeness of streamlines. When ``density = 1``, the domain
+ is divided into a 30x30 grid. *density* linearly scales this grid.
+ Each cell in the grid can have, at most, one traversing streamline.
+ For different densities in each direction, use a tuple
+ (density_x, density_y).
+ linewidth : float or 2D array
+ The width of the streamlines. With a 2D array the line width can be
+ varied across the grid. The array must have the same shape as *u*
+ and *v*.
+ color : :mpltype:`color` or 2D array
+ The streamline color. If given an array, its values are converted to
+ colors using *cmap* and *norm*. The array must have the same shape
+ as *u* and *v*.
+ cmap, norm
+ Data normalization and colormapping parameters for *color*; only used
+ if *color* is an array of floats. See `~.Axes.imshow` for a detailed
+ description.
+ arrowsize : float
+ Scaling factor for the arrow size.
+ arrowstyle : str
+ Arrow style specification.
+ See `~matplotlib.patches.FancyArrowPatch`.
+ minlength : float
+ Minimum length of streamline in axes coordinates.
+ start_points : (N, 2) array
+ Coordinates of starting points for the streamlines in data coordinates
+ (the same coordinates as the *x* and *y* arrays).
+ zorder : float
+ The zorder of the streamlines and arrows.
+ Artists with lower zorder values are drawn first.
+ maxlength : float
+ Maximum length of streamline in axes coordinates.
+ integration_direction : {'forward', 'backward', 'both'}, default: 'both'
+ Integrate the streamline in forward, backward or both directions.
+ data : indexable object, optional
+ DATA_PARAMETER_PLACEHOLDER
+ broken_streamlines : boolean, default: True
+ If False, forces streamlines to continue until they
+ leave the plot domain. If True, they may be terminated if they
+ come too close to another streamline.
+
+ Returns
+ -------
+ StreamplotSet
+ Container object with attributes
+
+ - ``lines``: `.LineCollection` of streamlines
+
+ - ``arrows``: `.PatchCollection` containing `.FancyArrowPatch`
+ objects representing the arrows half-way along streamlines.
+
+ This container will probably change in the future to allow changes
+ to the colormap, alpha, etc. for both lines and arrows, but these
+ changes should be backward compatible.
+ """
+ grid = Grid(x, y)
+ mask = StreamMask(density)
+ dmap = DomainMap(grid, mask)
+
+ if zorder is None:
+ zorder = mlines.Line2D.zorder
+
+ # default to data coordinates
+ if transform is None:
+ transform = axes.transData
+
+ if color is None:
+ color = axes._get_lines.get_next_color()
+
+ if linewidth is None:
+ linewidth = mpl.rcParams['lines.linewidth']
+
+ line_kw = {}
+ arrow_kw = dict(arrowstyle=arrowstyle, mutation_scale=10 * arrowsize)
+
+ _api.check_in_list(['both', 'forward', 'backward'],
+ integration_direction=integration_direction)
+
+ if integration_direction == 'both':
+ maxlength /= 2.
+
+ use_multicolor_lines = isinstance(color, np.ndarray)
+ if use_multicolor_lines:
+ if color.shape != grid.shape:
+ raise ValueError("If 'color' is given, it must match the shape of "
+ "the (x, y) grid")
+ line_colors = [[]] # Empty entry allows concatenation of zero arrays.
+ color = np.ma.masked_invalid(color)
+ else:
+ line_kw['color'] = color
+ arrow_kw['color'] = color
+
+ if isinstance(linewidth, np.ndarray):
+ if linewidth.shape != grid.shape:
+ raise ValueError("If 'linewidth' is given, it must match the "
+ "shape of the (x, y) grid")
+ line_kw['linewidth'] = []
+ else:
+ line_kw['linewidth'] = linewidth
+ arrow_kw['linewidth'] = linewidth
+
+ line_kw['zorder'] = zorder
+ arrow_kw['zorder'] = zorder
+
+ # Sanity checks.
+ if u.shape != grid.shape or v.shape != grid.shape:
+ raise ValueError("'u' and 'v' must match the shape of the (x, y) grid")
+
+ u = np.ma.masked_invalid(u)
+ v = np.ma.masked_invalid(v)
+
+ integrate = _get_integrator(u, v, dmap, minlength, maxlength,
+ integration_direction)
+
+ trajectories = []
+ if start_points is None:
+ for xm, ym in _gen_starting_points(mask.shape):
+ if mask[ym, xm] == 0:
+ xg, yg = dmap.mask2grid(xm, ym)
+ t = integrate(xg, yg, broken_streamlines)
+ if t is not None:
+ trajectories.append(t)
+ else:
+ sp2 = np.asanyarray(start_points, dtype=float).copy()
+
+ # Check if start_points are outside the data boundaries
+ for xs, ys in sp2:
+ if not (grid.x_origin <= xs <= grid.x_origin + grid.width and
+ grid.y_origin <= ys <= grid.y_origin + grid.height):
+ raise ValueError(f"Starting point ({xs}, {ys}) outside of "
+ "data boundaries")
+
+ # Convert start_points from data to array coords
+ # Shift the seed points from the bottom left of the data so that
+ # data2grid works properly.
+ sp2[:, 0] -= grid.x_origin
+ sp2[:, 1] -= grid.y_origin
+
+ for xs, ys in sp2:
+ xg, yg = dmap.data2grid(xs, ys)
+ # Floating point issues can cause xg, yg to be slightly out of
+ # bounds for xs, ys on the upper boundaries. Because we have
+ # already checked that the starting points are within the original
+ # grid, clip the xg, yg to the grid to work around this issue
+ xg = np.clip(xg, 0, grid.nx - 1)
+ yg = np.clip(yg, 0, grid.ny - 1)
+
+ t = integrate(xg, yg, broken_streamlines)
+ if t is not None:
+ trajectories.append(t)
+
+ if use_multicolor_lines:
+ if norm is None:
+ norm = mcolors.Normalize(color.min(), color.max())
+ cmap = cm._ensure_cmap(cmap)
+
+ streamlines = []
+ arrows = []
+ for t in trajectories:
+ tgx, tgy = t.T
+ # Rescale from grid-coordinates to data-coordinates.
+ tx, ty = dmap.grid2data(tgx, tgy)
+ tx += grid.x_origin
+ ty += grid.y_origin
+
+ # Create multiple tiny segments if varying width or color is given
+ if isinstance(linewidth, np.ndarray) or use_multicolor_lines:
+ points = np.transpose([tx, ty]).reshape(-1, 1, 2)
+ streamlines.extend(np.hstack([points[:-1], points[1:]]))
+ else:
+ points = np.transpose([tx, ty])
+ streamlines.append(points)
+
+ # Add arrows halfway along each trajectory.
+ s = np.cumsum(np.hypot(np.diff(tx), np.diff(ty)))
+ n = np.searchsorted(s, s[-1] / 2.)
+ arrow_tail = (tx[n], ty[n])
+ arrow_head = (np.mean(tx[n:n + 2]), np.mean(ty[n:n + 2]))
+
+ if isinstance(linewidth, np.ndarray):
+ line_widths = interpgrid(linewidth, tgx, tgy)[:-1]
+ line_kw['linewidth'].extend(line_widths)
+ arrow_kw['linewidth'] = line_widths[n]
+
+ if use_multicolor_lines:
+ color_values = interpgrid(color, tgx, tgy)[:-1]
+ line_colors.append(color_values)
+ arrow_kw['color'] = cmap(norm(color_values[n]))
+
+ p = patches.FancyArrowPatch(
+ arrow_tail, arrow_head, transform=transform, **arrow_kw)
+ arrows.append(p)
+
+ lc = mcollections.LineCollection(
+ streamlines, transform=transform, **line_kw)
+ lc.sticky_edges.x[:] = [grid.x_origin, grid.x_origin + grid.width]
+ lc.sticky_edges.y[:] = [grid.y_origin, grid.y_origin + grid.height]
+ if use_multicolor_lines:
+ lc.set_array(np.ma.hstack(line_colors))
+ lc.set_cmap(cmap)
+ lc.set_norm(norm)
+ axes.add_collection(lc)
+
+ ac = mcollections.PatchCollection(arrows)
+ # Adding the collection itself is broken; see #2341.
+ for p in arrows:
+ axes.add_patch(p)
+
+ axes.autoscale_view()
+ stream_container = StreamplotSet(lc, ac)
+ return stream_container
+
+
+class StreamplotSet:
+
+ def __init__(self, lines, arrows):
+ self.lines = lines
+ self.arrows = arrows
+
+
+# Coordinate definitions
+# ========================
+
+class DomainMap:
+ """
+ Map representing different coordinate systems.
+
+ Coordinate definitions:
+
+ * axes-coordinates goes from 0 to 1 in the domain.
+ * data-coordinates are specified by the input x-y coordinates.
+ * grid-coordinates goes from 0 to N and 0 to M for an N x M grid,
+ where N and M match the shape of the input data.
+ * mask-coordinates goes from 0 to N and 0 to M for an N x M mask,
+ where N and M are user-specified to control the density of streamlines.
+
+ This class also has methods for adding trajectories to the StreamMask.
+ Before adding a trajectory, run `start_trajectory` to keep track of regions
+ crossed by a given trajectory. Later, if you decide the trajectory is bad
+ (e.g., if the trajectory is very short) just call `undo_trajectory`.
+ """
+
+ def __init__(self, grid, mask):
+ self.grid = grid
+ self.mask = mask
+ # Constants for conversion between grid- and mask-coordinates
+ self.x_grid2mask = (mask.nx - 1) / (grid.nx - 1)
+ self.y_grid2mask = (mask.ny - 1) / (grid.ny - 1)
+
+ self.x_mask2grid = 1. / self.x_grid2mask
+ self.y_mask2grid = 1. / self.y_grid2mask
+
+ self.x_data2grid = 1. / grid.dx
+ self.y_data2grid = 1. / grid.dy
+
+ def grid2mask(self, xi, yi):
+ """Return nearest space in mask-coords from given grid-coords."""
+ return round(xi * self.x_grid2mask), round(yi * self.y_grid2mask)
+
+ def mask2grid(self, xm, ym):
+ return xm * self.x_mask2grid, ym * self.y_mask2grid
+
+ def data2grid(self, xd, yd):
+ return xd * self.x_data2grid, yd * self.y_data2grid
+
+ def grid2data(self, xg, yg):
+ return xg / self.x_data2grid, yg / self.y_data2grid
+
+ def start_trajectory(self, xg, yg, broken_streamlines=True):
+ xm, ym = self.grid2mask(xg, yg)
+ self.mask._start_trajectory(xm, ym, broken_streamlines)
+
+ def reset_start_point(self, xg, yg):
+ xm, ym = self.grid2mask(xg, yg)
+ self.mask._current_xy = (xm, ym)
+
+ def update_trajectory(self, xg, yg, broken_streamlines=True):
+ if not self.grid.within_grid(xg, yg):
+ raise InvalidIndexError
+ xm, ym = self.grid2mask(xg, yg)
+ self.mask._update_trajectory(xm, ym, broken_streamlines)
+
+ def undo_trajectory(self):
+ self.mask._undo_trajectory()
+
+
+class Grid:
+ """Grid of data."""
+ def __init__(self, x, y):
+
+ if np.ndim(x) == 1:
+ pass
+ elif np.ndim(x) == 2:
+ x_row = x[0]
+ if not np.allclose(x_row, x):
+ raise ValueError("The rows of 'x' must be equal")
+ x = x_row
+ else:
+ raise ValueError("'x' can have at maximum 2 dimensions")
+
+ if np.ndim(y) == 1:
+ pass
+ elif np.ndim(y) == 2:
+ yt = np.transpose(y) # Also works for nested lists.
+ y_col = yt[0]
+ if not np.allclose(y_col, yt):
+ raise ValueError("The columns of 'y' must be equal")
+ y = y_col
+ else:
+ raise ValueError("'y' can have at maximum 2 dimensions")
+
+ if not (np.diff(x) > 0).all():
+ raise ValueError("'x' must be strictly increasing")
+ if not (np.diff(y) > 0).all():
+ raise ValueError("'y' must be strictly increasing")
+
+ self.nx = len(x)
+ self.ny = len(y)
+
+ self.dx = x[1] - x[0]
+ self.dy = y[1] - y[0]
+
+ self.x_origin = x[0]
+ self.y_origin = y[0]
+
+ self.width = x[-1] - x[0]
+ self.height = y[-1] - y[0]
+
+ if not np.allclose(np.diff(x), self.width / (self.nx - 1)):
+ raise ValueError("'x' values must be equally spaced")
+ if not np.allclose(np.diff(y), self.height / (self.ny - 1)):
+ raise ValueError("'y' values must be equally spaced")
+
+ @property
+ def shape(self):
+ return self.ny, self.nx
+
+ def within_grid(self, xi, yi):
+ """Return whether (*xi*, *yi*) is a valid index of the grid."""
+ # Note that xi/yi can be floats; so, for example, we can't simply check
+ # `xi < self.nx` since *xi* can be `self.nx - 1 < xi < self.nx`
+ return 0 <= xi <= self.nx - 1 and 0 <= yi <= self.ny - 1
+
+
+class StreamMask:
+ """
+ Mask to keep track of discrete regions crossed by streamlines.
+
+ The resolution of this grid determines the approximate spacing between
+ trajectories. Streamlines are only allowed to pass through zeroed cells:
+ When a streamline enters a cell, that cell is set to 1, and no new
+ streamlines are allowed to enter.
+ """
+
+ def __init__(self, density):
+ try:
+ self.nx, self.ny = (30 * np.broadcast_to(density, 2)).astype(int)
+ except ValueError as err:
+ raise ValueError("'density' must be a scalar or be of length "
+ "2") from err
+ if self.nx < 0 or self.ny < 0:
+ raise ValueError("'density' must be positive")
+ self._mask = np.zeros((self.ny, self.nx))
+ self.shape = self._mask.shape
+
+ self._current_xy = None
+
+ def __getitem__(self, args):
+ return self._mask[args]
+
+ def _start_trajectory(self, xm, ym, broken_streamlines=True):
+ """Start recording streamline trajectory"""
+ self._traj = []
+ self._update_trajectory(xm, ym, broken_streamlines)
+
+ def _undo_trajectory(self):
+ """Remove current trajectory from mask"""
+ for t in self._traj:
+ self._mask[t] = 0
+
+ def _update_trajectory(self, xm, ym, broken_streamlines=True):
+ """
+ Update current trajectory position in mask.
+
+ If the new position has already been filled, raise `InvalidIndexError`.
+ """
+ if self._current_xy != (xm, ym):
+ if self[ym, xm] == 0:
+ self._traj.append((ym, xm))
+ self._mask[ym, xm] = 1
+ self._current_xy = (xm, ym)
+ else:
+ if broken_streamlines:
+ raise InvalidIndexError
+ else:
+ pass
+
+
+class InvalidIndexError(Exception):
+ pass
+
+
+class TerminateTrajectory(Exception):
+ pass
+
+
+# Integrator definitions
+# =======================
+
+def _get_integrator(u, v, dmap, minlength, maxlength, integration_direction):
+
+ # rescale velocity onto grid-coordinates for integrations.
+ u, v = dmap.data2grid(u, v)
+
+ # speed (path length) will be in axes-coordinates
+ u_ax = u / (dmap.grid.nx - 1)
+ v_ax = v / (dmap.grid.ny - 1)
+ speed = np.ma.sqrt(u_ax ** 2 + v_ax ** 2)
+
+ def forward_time(xi, yi):
+ if not dmap.grid.within_grid(xi, yi):
+ raise OutOfBounds
+ ds_dt = interpgrid(speed, xi, yi)
+ if ds_dt == 0:
+ raise TerminateTrajectory()
+ dt_ds = 1. / ds_dt
+ ui = interpgrid(u, xi, yi)
+ vi = interpgrid(v, xi, yi)
+ return ui * dt_ds, vi * dt_ds
+
+ def backward_time(xi, yi):
+ dxi, dyi = forward_time(xi, yi)
+ return -dxi, -dyi
+
+ def integrate(x0, y0, broken_streamlines=True):
+ """
+ Return x, y grid-coordinates of trajectory based on starting point.
+
+ Integrate both forward and backward in time from starting point in
+ grid coordinates.
+
+ Integration is terminated when a trajectory reaches a domain boundary
+ or when it crosses into an already occupied cell in the StreamMask. The
+ resulting trajectory is None if it is shorter than `minlength`.
+ """
+
+ stotal, xy_traj = 0., []
+
+ try:
+ dmap.start_trajectory(x0, y0, broken_streamlines)
+ except InvalidIndexError:
+ return None
+ if integration_direction in ['both', 'backward']:
+ s, xyt = _integrate_rk12(x0, y0, dmap, backward_time, maxlength,
+ broken_streamlines)
+ stotal += s
+ xy_traj += xyt[::-1]
+
+ if integration_direction in ['both', 'forward']:
+ dmap.reset_start_point(x0, y0)
+ s, xyt = _integrate_rk12(x0, y0, dmap, forward_time, maxlength,
+ broken_streamlines)
+ stotal += s
+ xy_traj += xyt[1:]
+
+ if stotal > minlength:
+ return np.broadcast_arrays(xy_traj, np.empty((1, 2)))[0]
+ else: # reject short trajectories
+ dmap.undo_trajectory()
+ return None
+
+ return integrate
+
+
+class OutOfBounds(IndexError):
+ pass
+
+
+def _integrate_rk12(x0, y0, dmap, f, maxlength, broken_streamlines=True):
+ """
+ 2nd-order Runge-Kutta algorithm with adaptive step size.
+
+ This method is also referred to as the improved Euler's method, or Heun's
+ method. This method is favored over higher-order methods because:
+
+ 1. To get decent looking trajectories and to sample every mask cell
+ on the trajectory we need a small timestep, so a lower order
+ solver doesn't hurt us unless the data is *very* high resolution.
+ In fact, for cases where the user inputs
+ data smaller or of similar grid size to the mask grid, the higher
+ order corrections are negligible because of the very fast linear
+ interpolation used in `interpgrid`.
+
+ 2. For high resolution input data (i.e. beyond the mask
+ resolution), we must reduce the timestep. Therefore, an adaptive
+ timestep is more suited to the problem as this would be very hard
+ to judge automatically otherwise.
+
+ This integrator is about 1.5 - 2x as fast as RK4 and RK45 solvers (using
+ similar Python implementations) in most setups.
+ """
+ # This error is below that needed to match the RK4 integrator. It
+ # is set for visual reasons -- too low and corners start
+ # appearing ugly and jagged. Can be tuned.
+ maxerror = 0.003
+
+ # This limit is important (for all integrators) to avoid the
+ # trajectory skipping some mask cells. We could relax this
+ # condition if we use the code which is commented out below to
+ # increment the location gradually. However, due to the efficient
+ # nature of the interpolation, this doesn't boost speed by much
+ # for quite a bit of complexity.
+ maxds = min(1. / dmap.mask.nx, 1. / dmap.mask.ny, 0.1)
+
+ ds = maxds
+ stotal = 0
+ xi = x0
+ yi = y0
+ xyf_traj = []
+
+ while True:
+ try:
+ if dmap.grid.within_grid(xi, yi):
+ xyf_traj.append((xi, yi))
+ else:
+ raise OutOfBounds
+
+ # Compute the two intermediate gradients.
+ # f should raise OutOfBounds if the locations given are
+ # outside the grid.
+ k1x, k1y = f(xi, yi)
+ k2x, k2y = f(xi + ds * k1x, yi + ds * k1y)
+
+ except OutOfBounds:
+ # Out of the domain during this step.
+ # Take an Euler step to the boundary to improve neatness
+ # unless the trajectory is currently empty.
+ if xyf_traj:
+ ds, xyf_traj = _euler_step(xyf_traj, dmap, f)
+ stotal += ds
+ break
+ except TerminateTrajectory:
+ break
+
+ dx1 = ds * k1x
+ dy1 = ds * k1y
+ dx2 = ds * 0.5 * (k1x + k2x)
+ dy2 = ds * 0.5 * (k1y + k2y)
+
+ ny, nx = dmap.grid.shape
+ # Error is normalized to the axes coordinates
+ error = np.hypot((dx2 - dx1) / (nx - 1), (dy2 - dy1) / (ny - 1))
+
+ # Only save step if within error tolerance
+ if error < maxerror:
+ xi += dx2
+ yi += dy2
+ try:
+ dmap.update_trajectory(xi, yi, broken_streamlines)
+ except InvalidIndexError:
+ break
+ if stotal + ds > maxlength:
+ break
+ stotal += ds
+
+ # recalculate stepsize based on step error
+ if error == 0:
+ ds = maxds
+ else:
+ ds = min(maxds, 0.85 * ds * (maxerror / error) ** 0.5)
+
+ return stotal, xyf_traj
+
+
+def _euler_step(xyf_traj, dmap, f):
+ """Simple Euler integration step that extends streamline to boundary."""
+ ny, nx = dmap.grid.shape
+ xi, yi = xyf_traj[-1]
+ cx, cy = f(xi, yi)
+ if cx == 0:
+ dsx = np.inf
+ elif cx < 0:
+ dsx = xi / -cx
+ else:
+ dsx = (nx - 1 - xi) / cx
+ if cy == 0:
+ dsy = np.inf
+ elif cy < 0:
+ dsy = yi / -cy
+ else:
+ dsy = (ny - 1 - yi) / cy
+ ds = min(dsx, dsy)
+ xyf_traj.append((xi + cx * ds, yi + cy * ds))
+ return ds, xyf_traj
+
+
+# Utility functions
+# ========================
+
+def interpgrid(a, xi, yi):
+ """Fast 2D, linear interpolation on an integer grid"""
+
+ Ny, Nx = np.shape(a)
+ if isinstance(xi, np.ndarray):
+ x = xi.astype(int)
+ y = yi.astype(int)
+ # Check that xn, yn don't exceed max index
+ xn = np.clip(x + 1, 0, Nx - 1)
+ yn = np.clip(y + 1, 0, Ny - 1)
+ else:
+ x = int(xi)
+ y = int(yi)
+ # conditional is faster than clipping for integers
+ if x == (Nx - 1):
+ xn = x
+ else:
+ xn = x + 1
+ if y == (Ny - 1):
+ yn = y
+ else:
+ yn = y + 1
+
+ a00 = a[y, x]
+ a01 = a[y, xn]
+ a10 = a[yn, x]
+ a11 = a[yn, xn]
+ xt = xi - x
+ yt = yi - y
+ a0 = a00 * (1 - xt) + a01 * xt
+ a1 = a10 * (1 - xt) + a11 * xt
+ ai = a0 * (1 - yt) + a1 * yt
+
+ if not isinstance(xi, np.ndarray):
+ if np.ma.is_masked(ai):
+ raise TerminateTrajectory
+
+ return ai
+
+
+def _gen_starting_points(shape):
+ """
+ Yield starting points for streamlines.
+
+ Trying points on the boundary first gives higher quality streamlines.
+ This algorithm starts with a point on the mask corner and spirals inward.
+ This algorithm is inefficient, but fast compared to rest of streamplot.
+ """
+ ny, nx = shape
+ xfirst = 0
+ yfirst = 1
+ xlast = nx - 1
+ ylast = ny - 1
+ x, y = 0, 0
+ direction = 'right'
+ for i in range(nx * ny):
+ yield x, y
+
+ if direction == 'right':
+ x += 1
+ if x >= xlast:
+ xlast -= 1
+ direction = 'up'
+ elif direction == 'up':
+ y += 1
+ if y >= ylast:
+ ylast -= 1
+ direction = 'left'
+ elif direction == 'left':
+ x -= 1
+ if x <= xfirst:
+ xfirst += 1
+ direction = 'down'
+ elif direction == 'down':
+ y -= 1
+ if y <= yfirst:
+ yfirst += 1
+ direction = 'right'
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/streamplot.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/streamplot.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..be745802044907a32084934576269eaf228e07e4
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/streamplot.pyi
@@ -0,0 +1,84 @@
+from matplotlib.axes import Axes
+from matplotlib.colors import Normalize, Colormap
+from matplotlib.collections import LineCollection, PatchCollection
+from matplotlib.patches import ArrowStyle
+from matplotlib.transforms import Transform
+
+from typing import Literal
+from numpy.typing import ArrayLike
+from .typing import ColorType
+
+def streamplot(
+ axes: Axes,
+ x: ArrayLike,
+ y: ArrayLike,
+ u: ArrayLike,
+ v: ArrayLike,
+ density: float | tuple[float, float] = ...,
+ linewidth: float | ArrayLike | None = ...,
+ color: ColorType | ArrayLike | None = ...,
+ cmap: str | Colormap | None = ...,
+ norm: str | Normalize | None = ...,
+ arrowsize: float = ...,
+ arrowstyle: str | ArrowStyle = ...,
+ minlength: float = ...,
+ transform: Transform | None = ...,
+ zorder: float | None = ...,
+ start_points: ArrayLike | None = ...,
+ maxlength: float = ...,
+ integration_direction: Literal["forward", "backward", "both"] = ...,
+ broken_streamlines: bool = ...,
+) -> StreamplotSet: ...
+
+class StreamplotSet:
+ lines: LineCollection
+ arrows: PatchCollection
+ def __init__(self, lines: LineCollection, arrows: PatchCollection) -> None: ...
+
+class DomainMap:
+ grid: Grid
+ mask: StreamMask
+ x_grid2mask: float
+ y_grid2mask: float
+ x_mask2grid: float
+ y_mask2grid: float
+ x_data2grid: float
+ y_data2grid: float
+ def __init__(self, grid: Grid, mask: StreamMask) -> None: ...
+ def grid2mask(self, xi: float, yi: float) -> tuple[int, int]: ...
+ def mask2grid(self, xm: float, ym: float) -> tuple[float, float]: ...
+ def data2grid(self, xd: float, yd: float) -> tuple[float, float]: ...
+ def grid2data(self, xg: float, yg: float) -> tuple[float, float]: ...
+ def start_trajectory(
+ self, xg: float, yg: float, broken_streamlines: bool = ...
+ ) -> None: ...
+ def reset_start_point(self, xg: float, yg: float) -> None: ...
+ def update_trajectory(self, xg, yg, broken_streamlines: bool = ...) -> None: ...
+ def undo_trajectory(self) -> None: ...
+
+class Grid:
+ nx: int
+ ny: int
+ dx: float
+ dy: float
+ x_origin: float
+ y_origin: float
+ width: float
+ height: float
+ def __init__(self, x: ArrayLike, y: ArrayLike) -> None: ...
+ @property
+ def shape(self) -> tuple[int, int]: ...
+ def within_grid(self, xi: float, yi: float) -> bool: ...
+
+class StreamMask:
+ nx: int
+ ny: int
+ shape: tuple[int, int]
+ def __init__(self, density: float | tuple[float, float]) -> None: ...
+ def __getitem__(self, args): ...
+
+class InvalidIndexError(Exception): ...
+class TerminateTrajectory(Exception): ...
+class OutOfBounds(IndexError): ...
+
+__all__ = ['streamplot']
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..488c6d6ae1ec310cdd84bb209b4103da26fed284
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__init__.py
@@ -0,0 +1,4 @@
+from .core import available, context, library, reload_library, use
+
+
+__all__ = ["available", "context", "library", "reload_library", "use"]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ff92d6cbd03b730a99e31aa3961696f54c056efe
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__pycache__/core.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__pycache__/core.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fdc6d626a4ee6d345f0bb0a79eefb8bda1d112e4
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/__pycache__/core.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/core.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/core.py
new file mode 100644
index 0000000000000000000000000000000000000000..e36c3c37a882492afbb71716b4d98a46208bfe55
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/core.py
@@ -0,0 +1,237 @@
+"""
+Core functions and attributes for the matplotlib style library:
+
+``use``
+ Select style sheet to override the current matplotlib settings.
+``context``
+ Context manager to use a style sheet temporarily.
+``available``
+ List available style sheets.
+``library``
+ A dictionary of style names and matplotlib settings.
+"""
+
+import contextlib
+import importlib.resources
+import logging
+import os
+from pathlib import Path
+import warnings
+
+import matplotlib as mpl
+from matplotlib import _api, _docstring, _rc_params_in_file, rcParamsDefault
+
+_log = logging.getLogger(__name__)
+
+__all__ = ['use', 'context', 'available', 'library', 'reload_library']
+
+
+BASE_LIBRARY_PATH = os.path.join(mpl.get_data_path(), 'stylelib')
+# Users may want multiple library paths, so store a list of paths.
+USER_LIBRARY_PATHS = [os.path.join(mpl.get_configdir(), 'stylelib')]
+STYLE_EXTENSION = 'mplstyle'
+# A list of rcParams that should not be applied from styles
+STYLE_BLACKLIST = {
+ 'interactive', 'backend', 'webagg.port', 'webagg.address',
+ 'webagg.port_retries', 'webagg.open_in_browser', 'backend_fallback',
+ 'toolbar', 'timezone', 'figure.max_open_warning',
+ 'figure.raise_window', 'savefig.directory', 'tk.window_focus',
+ 'docstring.hardcopy', 'date.epoch'}
+
+
+@_docstring.Substitution(
+ "\n".join(map("- {}".format, sorted(STYLE_BLACKLIST, key=str.lower)))
+)
+def use(style):
+ """
+ Use Matplotlib style settings from a style specification.
+
+ The style name of 'default' is reserved for reverting back to
+ the default style settings.
+
+ .. note::
+
+ This updates the `.rcParams` with the settings from the style.
+ `.rcParams` not defined in the style are kept.
+
+ Parameters
+ ----------
+ style : str, dict, Path or list
+
+ A style specification. Valid options are:
+
+ str
+ - One of the style names in `.style.available` (a builtin style or
+ a style installed in the user library path).
+
+ - A dotted name of the form "package.style_name"; in that case,
+ "package" should be an importable Python package name, e.g. at
+ ``/path/to/package/__init__.py``; the loaded style file is
+ ``/path/to/package/style_name.mplstyle``. (Style files in
+ subpackages are likewise supported.)
+
+ - The path or URL to a style file, which gets loaded by
+ `.rc_params_from_file`.
+
+ dict
+ A mapping of key/value pairs for `matplotlib.rcParams`.
+
+ Path
+ The path to a style file, which gets loaded by
+ `.rc_params_from_file`.
+
+ list
+ A list of style specifiers (str, Path or dict), which are applied
+ from first to last in the list.
+
+ Notes
+ -----
+ The following `.rcParams` are not related to style and will be ignored if
+ found in a style specification:
+
+ %s
+ """
+ if isinstance(style, (str, Path)) or hasattr(style, 'keys'):
+ # If name is a single str, Path or dict, make it a single element list.
+ styles = [style]
+ else:
+ styles = style
+
+ style_alias = {'mpl20': 'default', 'mpl15': 'classic'}
+
+ for style in styles:
+ if isinstance(style, str):
+ style = style_alias.get(style, style)
+ if style == "default":
+ # Deprecation warnings were already handled when creating
+ # rcParamsDefault, no need to reemit them here.
+ with _api.suppress_matplotlib_deprecation_warning():
+ # don't trigger RcParams.__getitem__('backend')
+ style = {k: rcParamsDefault[k] for k in rcParamsDefault
+ if k not in STYLE_BLACKLIST}
+ elif style in library:
+ style = library[style]
+ elif "." in style:
+ pkg, _, name = style.rpartition(".")
+ try:
+ path = importlib.resources.files(pkg) / f"{name}.{STYLE_EXTENSION}"
+ style = _rc_params_in_file(path)
+ except (ModuleNotFoundError, OSError, TypeError) as exc:
+ # There is an ambiguity whether a dotted name refers to a
+ # package.style_name or to a dotted file path. Currently,
+ # we silently try the first form and then the second one;
+ # in the future, we may consider forcing file paths to
+ # either use Path objects or be prepended with "./" and use
+ # the slash as marker for file paths.
+ pass
+ if isinstance(style, (str, Path)):
+ try:
+ style = _rc_params_in_file(style)
+ except OSError as err:
+ raise OSError(
+ f"{style!r} is not a valid package style, path of style "
+ f"file, URL of style file, or library style name (library "
+ f"styles are listed in `style.available`)") from err
+ filtered = {}
+ for k in style: # don't trigger RcParams.__getitem__('backend')
+ if k in STYLE_BLACKLIST:
+ _api.warn_external(
+ f"Style includes a parameter, {k!r}, that is not "
+ f"related to style. Ignoring this parameter.")
+ else:
+ filtered[k] = style[k]
+ mpl.rcParams.update(filtered)
+
+
+@contextlib.contextmanager
+def context(style, after_reset=False):
+ """
+ Context manager for using style settings temporarily.
+
+ Parameters
+ ----------
+ style : str, dict, Path or list
+ A style specification. Valid options are:
+
+ str
+ - One of the style names in `.style.available` (a builtin style or
+ a style installed in the user library path).
+
+ - A dotted name of the form "package.style_name"; in that case,
+ "package" should be an importable Python package name, e.g. at
+ ``/path/to/package/__init__.py``; the loaded style file is
+ ``/path/to/package/style_name.mplstyle``. (Style files in
+ subpackages are likewise supported.)
+
+ - The path or URL to a style file, which gets loaded by
+ `.rc_params_from_file`.
+ dict
+ A mapping of key/value pairs for `matplotlib.rcParams`.
+
+ Path
+ The path to a style file, which gets loaded by
+ `.rc_params_from_file`.
+
+ list
+ A list of style specifiers (str, Path or dict), which are applied
+ from first to last in the list.
+
+ after_reset : bool
+ If True, apply style after resetting settings to their defaults;
+ otherwise, apply style on top of the current settings.
+ """
+ with mpl.rc_context():
+ if after_reset:
+ mpl.rcdefaults()
+ use(style)
+ yield
+
+
+def update_user_library(library):
+ """Update style library with user-defined rc files."""
+ for stylelib_path in map(os.path.expanduser, USER_LIBRARY_PATHS):
+ styles = read_style_directory(stylelib_path)
+ update_nested_dict(library, styles)
+ return library
+
+
+def read_style_directory(style_dir):
+ """Return dictionary of styles defined in *style_dir*."""
+ styles = dict()
+ for path in Path(style_dir).glob(f"*.{STYLE_EXTENSION}"):
+ with warnings.catch_warnings(record=True) as warns:
+ styles[path.stem] = _rc_params_in_file(path)
+ for w in warns:
+ _log.warning('In %s: %s', path, w.message)
+ return styles
+
+
+def update_nested_dict(main_dict, new_dict):
+ """
+ Update nested dict (only level of nesting) with new values.
+
+ Unlike `dict.update`, this assumes that the values of the parent dict are
+ dicts (or dict-like), so you shouldn't replace the nested dict if it
+ already exists. Instead you should update the sub-dict.
+ """
+ # update named styles specified by user
+ for name, rc_dict in new_dict.items():
+ main_dict.setdefault(name, {}).update(rc_dict)
+ return main_dict
+
+
+# Load style library
+# ==================
+_base_library = read_style_directory(BASE_LIBRARY_PATH)
+library = {}
+available = []
+
+
+def reload_library():
+ """Reload the style library."""
+ library.clear()
+ library.update(update_user_library(_base_library))
+ available[:] = sorted(library.keys())
+
+
+reload_library()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/core.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/core.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..5734b017f7c41ee09908c191d18e8f557ed814a2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/style/core.pyi
@@ -0,0 +1,21 @@
+from collections.abc import Generator
+import contextlib
+
+from matplotlib import RcParams
+from matplotlib.typing import RcStyleType
+
+USER_LIBRARY_PATHS: list[str] = ...
+STYLE_EXTENSION: str = ...
+
+def use(style: RcStyleType) -> None: ...
+@contextlib.contextmanager
+def context(
+ style: RcStyleType, after_reset: bool = ...
+) -> Generator[None, None, None]: ...
+
+library: dict[str, RcParams]
+available: list[str]
+
+def reload_library() -> None: ...
+
+__all__ = ['use', 'context', 'available', 'library', 'reload_library']
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/table.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/table.py
new file mode 100644
index 0000000000000000000000000000000000000000..370ce9fe922fab333b8acc418e36d57a228d74e5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/table.py
@@ -0,0 +1,846 @@
+# Original code by:
+# John Gill
+# Copyright 2004 John Gill and John Hunter
+#
+# Subsequent changes:
+# The Matplotlib development team
+# Copyright The Matplotlib development team
+
+"""
+Tables drawing.
+
+.. note::
+ The table implementation in Matplotlib is lightly maintained. For a more
+ featureful table implementation, you may wish to try `blume
+ `_.
+
+Use the factory function `~matplotlib.table.table` to create a ready-made
+table from texts. If you need more control, use the `.Table` class and its
+methods.
+
+The table consists of a grid of cells, which are indexed by (row, column).
+The cell (0, 0) is positioned at the top left.
+
+Thanks to John Gill for providing the class and table.
+"""
+
+import numpy as np
+
+from . import _api, _docstring
+from .artist import Artist, allow_rasterization
+from .patches import Rectangle
+from .text import Text
+from .transforms import Bbox
+from .path import Path
+
+from .cbook import _is_pandas_dataframe
+
+
+class Cell(Rectangle):
+ """
+ A cell is a `.Rectangle` with some associated `.Text`.
+
+ As a user, you'll most likely not creates cells yourself. Instead, you
+ should use either the `~matplotlib.table.table` factory function or
+ `.Table.add_cell`.
+ """
+
+ PAD = 0.1
+ """Padding between text and rectangle."""
+
+ _edges = 'BRTL'
+ _edge_aliases = {'open': '',
+ 'closed': _edges, # default
+ 'horizontal': 'BT',
+ 'vertical': 'RL'
+ }
+
+ def __init__(self, xy, width, height, *,
+ edgecolor='k', facecolor='w',
+ fill=True,
+ text='',
+ loc='right',
+ fontproperties=None,
+ visible_edges='closed',
+ ):
+ """
+ Parameters
+ ----------
+ xy : 2-tuple
+ The position of the bottom left corner of the cell.
+ width : float
+ The cell width.
+ height : float
+ The cell height.
+ edgecolor : :mpltype:`color`, default: 'k'
+ The color of the cell border.
+ facecolor : :mpltype:`color`, default: 'w'
+ The cell facecolor.
+ fill : bool, default: True
+ Whether the cell background is filled.
+ text : str, optional
+ The cell text.
+ loc : {'right', 'center', 'left'}
+ The alignment of the text within the cell.
+ fontproperties : dict, optional
+ A dict defining the font properties of the text. Supported keys and
+ values are the keyword arguments accepted by `.FontProperties`.
+ visible_edges : {'closed', 'open', 'horizontal', 'vertical'} or \
+substring of 'BRTL'
+ The cell edges to be drawn with a line: a substring of 'BRTL'
+ (bottom, right, top, left), or one of 'open' (no edges drawn),
+ 'closed' (all edges drawn), 'horizontal' (bottom and top),
+ 'vertical' (right and left).
+ """
+
+ # Call base
+ super().__init__(xy, width=width, height=height, fill=fill,
+ edgecolor=edgecolor, facecolor=facecolor)
+ self.set_clip_on(False)
+ self.visible_edges = visible_edges
+
+ # Create text object
+ self._loc = loc
+ self._text = Text(x=xy[0], y=xy[1], clip_on=False,
+ text=text, fontproperties=fontproperties,
+ horizontalalignment=loc, verticalalignment='center')
+
+ def set_transform(self, t):
+ super().set_transform(t)
+ # the text does not get the transform!
+ self.stale = True
+
+ def set_figure(self, fig):
+ super().set_figure(fig)
+ self._text.set_figure(fig)
+
+ def get_text(self):
+ """Return the cell `.Text` instance."""
+ return self._text
+
+ def set_fontsize(self, size):
+ """Set the text fontsize."""
+ self._text.set_fontsize(size)
+ self.stale = True
+
+ def get_fontsize(self):
+ """Return the cell fontsize."""
+ return self._text.get_fontsize()
+
+ def auto_set_font_size(self, renderer):
+ """Shrink font size until the text fits into the cell width."""
+ fontsize = self.get_fontsize()
+ required = self.get_required_width(renderer)
+ while fontsize > 1 and required > self.get_width():
+ fontsize -= 1
+ self.set_fontsize(fontsize)
+ required = self.get_required_width(renderer)
+
+ return fontsize
+
+ @allow_rasterization
+ def draw(self, renderer):
+ if not self.get_visible():
+ return
+ # draw the rectangle
+ super().draw(renderer)
+ # position the text
+ self._set_text_position(renderer)
+ self._text.draw(renderer)
+ self.stale = False
+
+ def _set_text_position(self, renderer):
+ """Set text up so it is drawn in the right place."""
+ bbox = self.get_window_extent(renderer)
+ # center vertically
+ y = bbox.y0 + bbox.height / 2
+ # position horizontally
+ loc = self._text.get_horizontalalignment()
+ if loc == 'center':
+ x = bbox.x0 + bbox.width / 2
+ elif loc == 'left':
+ x = bbox.x0 + bbox.width * self.PAD
+ else: # right.
+ x = bbox.x0 + bbox.width * (1 - self.PAD)
+ self._text.set_position((x, y))
+
+ def get_text_bounds(self, renderer):
+ """
+ Return the text bounds as *(x, y, width, height)* in table coordinates.
+ """
+ return (self._text.get_window_extent(renderer)
+ .transformed(self.get_data_transform().inverted())
+ .bounds)
+
+ def get_required_width(self, renderer):
+ """Return the minimal required width for the cell."""
+ l, b, w, h = self.get_text_bounds(renderer)
+ return w * (1.0 + (2.0 * self.PAD))
+
+ @_docstring.interpd
+ def set_text_props(self, **kwargs):
+ """
+ Update the text properties.
+
+ Valid keyword arguments are:
+
+ %(Text:kwdoc)s
+ """
+ self._text._internal_update(kwargs)
+ self.stale = True
+
+ @property
+ def visible_edges(self):
+ """
+ The cell edges to be drawn with a line.
+
+ Reading this property returns a substring of 'BRTL' (bottom, right,
+ top, left').
+
+ When setting this property, you can use a substring of 'BRTL' or one
+ of {'open', 'closed', 'horizontal', 'vertical'}.
+ """
+ return self._visible_edges
+
+ @visible_edges.setter
+ def visible_edges(self, value):
+ if value is None:
+ self._visible_edges = self._edges
+ elif value in self._edge_aliases:
+ self._visible_edges = self._edge_aliases[value]
+ else:
+ if any(edge not in self._edges for edge in value):
+ raise ValueError('Invalid edge param {}, must only be one of '
+ '{} or string of {}'.format(
+ value,
+ ", ".join(self._edge_aliases),
+ ", ".join(self._edges)))
+ self._visible_edges = value
+ self.stale = True
+
+ def get_path(self):
+ """Return a `.Path` for the `.visible_edges`."""
+ codes = [Path.MOVETO]
+ codes.extend(
+ Path.LINETO if edge in self._visible_edges else Path.MOVETO
+ for edge in self._edges)
+ if Path.MOVETO not in codes[1:]: # All sides are visible
+ codes[-1] = Path.CLOSEPOLY
+ return Path(
+ [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0], [0.0, 0.0]],
+ codes,
+ readonly=True
+ )
+
+
+CustomCell = Cell # Backcompat. alias.
+
+
+class Table(Artist):
+ """
+ A table of cells.
+
+ The table consists of a grid of cells, which are indexed by (row, column).
+
+ For a simple table, you'll have a full grid of cells with indices from
+ (0, 0) to (num_rows-1, num_cols-1), in which the cell (0, 0) is positioned
+ at the top left. However, you can also add cells with negative indices.
+ You don't have to add a cell to every grid position, so you can create
+ tables that have holes.
+
+ *Note*: You'll usually not create an empty table from scratch. Instead use
+ `~matplotlib.table.table` to create a table from data.
+ """
+ codes = {'best': 0,
+ 'upper right': 1, # default
+ 'upper left': 2,
+ 'lower left': 3,
+ 'lower right': 4,
+ 'center left': 5,
+ 'center right': 6,
+ 'lower center': 7,
+ 'upper center': 8,
+ 'center': 9,
+ 'top right': 10,
+ 'top left': 11,
+ 'bottom left': 12,
+ 'bottom right': 13,
+ 'right': 14,
+ 'left': 15,
+ 'top': 16,
+ 'bottom': 17,
+ }
+ """Possible values where to place the table relative to the Axes."""
+
+ FONTSIZE = 10
+
+ AXESPAD = 0.02
+ """The border between the Axes and the table edge in Axes units."""
+
+ def __init__(self, ax, loc=None, bbox=None, **kwargs):
+ """
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` to plot the table into.
+ loc : str, optional
+ The position of the cell with respect to *ax*. This must be one of
+ the `~.Table.codes`.
+ bbox : `.Bbox` or [xmin, ymin, width, height], optional
+ A bounding box to draw the table into. If this is not *None*, this
+ overrides *loc*.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ `.Artist` properties.
+ """
+
+ super().__init__()
+
+ if isinstance(loc, str):
+ if loc not in self.codes:
+ raise ValueError(
+ "Unrecognized location {!r}. Valid locations are\n\t{}"
+ .format(loc, '\n\t'.join(self.codes)))
+ loc = self.codes[loc]
+ self.set_figure(ax.get_figure(root=False))
+ self._axes = ax
+ self._loc = loc
+ self._bbox = bbox
+
+ # use axes coords
+ ax._unstale_viewLim()
+ self.set_transform(ax.transAxes)
+
+ self._cells = {}
+ self._edges = None
+ self._autoColumns = []
+ self._autoFontsize = True
+ self._internal_update(kwargs)
+
+ self.set_clip_on(False)
+
+ def add_cell(self, row, col, *args, **kwargs):
+ """
+ Create a cell and add it to the table.
+
+ Parameters
+ ----------
+ row : int
+ Row index.
+ col : int
+ Column index.
+ *args, **kwargs
+ All other parameters are passed on to `Cell`.
+
+ Returns
+ -------
+ `.Cell`
+ The created cell.
+
+ """
+ xy = (0, 0)
+ cell = Cell(xy, visible_edges=self.edges, *args, **kwargs)
+ self[row, col] = cell
+ return cell
+
+ def __setitem__(self, position, cell):
+ """
+ Set a custom cell in a given position.
+ """
+ _api.check_isinstance(Cell, cell=cell)
+ try:
+ row, col = position[0], position[1]
+ except Exception as err:
+ raise KeyError('Only tuples length 2 are accepted as '
+ 'coordinates') from err
+ cell.set_figure(self.get_figure(root=False))
+ cell.set_transform(self.get_transform())
+ cell.set_clip_on(False)
+ self._cells[row, col] = cell
+ self.stale = True
+
+ def __getitem__(self, position):
+ """Retrieve a custom cell from a given position."""
+ return self._cells[position]
+
+ @property
+ def edges(self):
+ """
+ The default value of `~.Cell.visible_edges` for newly added
+ cells using `.add_cell`.
+
+ Notes
+ -----
+ This setting does currently only affect newly created cells using
+ `.add_cell`.
+
+ To change existing cells, you have to set their edges explicitly::
+
+ for c in tab.get_celld().values():
+ c.visible_edges = 'horizontal'
+
+ """
+ return self._edges
+
+ @edges.setter
+ def edges(self, value):
+ self._edges = value
+ self.stale = True
+
+ def _approx_text_height(self):
+ return (self.FONTSIZE / 72.0 * self.get_figure(root=True).dpi /
+ self._axes.bbox.height * 1.2)
+
+ @allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+
+ # Need a renderer to do hit tests on mouseevent; assume the last one
+ # will do
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ if renderer is None:
+ raise RuntimeError('No renderer defined')
+
+ if not self.get_visible():
+ return
+ renderer.open_group('table', gid=self.get_gid())
+ self._update_positions(renderer)
+
+ for key in sorted(self._cells):
+ self._cells[key].draw(renderer)
+
+ renderer.close_group('table')
+ self.stale = False
+
+ def _get_grid_bbox(self, renderer):
+ """
+ Get a bbox, in axes coordinates for the cells.
+
+ Only include those in the range (0, 0) to (maxRow, maxCol).
+ """
+ boxes = [cell.get_window_extent(renderer)
+ for (row, col), cell in self._cells.items()
+ if row >= 0 and col >= 0]
+ bbox = Bbox.union(boxes)
+ return bbox.transformed(self.get_transform().inverted())
+
+ def contains(self, mouseevent):
+ # docstring inherited
+ if self._different_canvas(mouseevent):
+ return False, {}
+ # TODO: Return index of the cell containing the cursor so that the user
+ # doesn't have to bind to each one individually.
+ renderer = self.get_figure(root=True)._get_renderer()
+ if renderer is not None:
+ boxes = [cell.get_window_extent(renderer)
+ for (row, col), cell in self._cells.items()
+ if row >= 0 and col >= 0]
+ bbox = Bbox.union(boxes)
+ return bbox.contains(mouseevent.x, mouseevent.y), {}
+ else:
+ return False, {}
+
+ def get_children(self):
+ """Return the Artists contained by the table."""
+ return list(self._cells.values())
+
+ def get_window_extent(self, renderer=None):
+ # docstring inherited
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ self._update_positions(renderer)
+ boxes = [cell.get_window_extent(renderer)
+ for cell in self._cells.values()]
+ return Bbox.union(boxes)
+
+ def _do_cell_alignment(self):
+ """
+ Calculate row heights and column widths; position cells accordingly.
+ """
+ # Calculate row/column widths
+ widths = {}
+ heights = {}
+ for (row, col), cell in self._cells.items():
+ height = heights.setdefault(row, 0.0)
+ heights[row] = max(height, cell.get_height())
+ width = widths.setdefault(col, 0.0)
+ widths[col] = max(width, cell.get_width())
+
+ # work out left position for each column
+ xpos = 0
+ lefts = {}
+ for col in sorted(widths):
+ lefts[col] = xpos
+ xpos += widths[col]
+
+ ypos = 0
+ bottoms = {}
+ for row in sorted(heights, reverse=True):
+ bottoms[row] = ypos
+ ypos += heights[row]
+
+ # set cell positions
+ for (row, col), cell in self._cells.items():
+ cell.set_x(lefts[col])
+ cell.set_y(bottoms[row])
+
+ def auto_set_column_width(self, col):
+ """
+ Automatically set the widths of given columns to optimal sizes.
+
+ Parameters
+ ----------
+ col : int or sequence of ints
+ The indices of the columns to auto-scale.
+ """
+ col1d = np.atleast_1d(col)
+ if not np.issubdtype(col1d.dtype, np.integer):
+ raise TypeError("col must be an int or sequence of ints.")
+ for cell in col1d:
+ self._autoColumns.append(cell)
+
+ self.stale = True
+
+ def _auto_set_column_width(self, col, renderer):
+ """Automatically set width for column."""
+ cells = [cell for key, cell in self._cells.items() if key[1] == col]
+ max_width = max((cell.get_required_width(renderer) for cell in cells),
+ default=0)
+ for cell in cells:
+ cell.set_width(max_width)
+
+ def auto_set_font_size(self, value=True):
+ """Automatically set font size."""
+ self._autoFontsize = value
+ self.stale = True
+
+ def _auto_set_font_size(self, renderer):
+
+ if len(self._cells) == 0:
+ return
+ fontsize = next(iter(self._cells.values())).get_fontsize()
+ cells = []
+ for key, cell in self._cells.items():
+ # ignore auto-sized columns
+ if key[1] in self._autoColumns:
+ continue
+ size = cell.auto_set_font_size(renderer)
+ fontsize = min(fontsize, size)
+ cells.append(cell)
+
+ # now set all fontsizes equal
+ for cell in self._cells.values():
+ cell.set_fontsize(fontsize)
+
+ def scale(self, xscale, yscale):
+ """Scale column widths by *xscale* and row heights by *yscale*."""
+ for c in self._cells.values():
+ c.set_width(c.get_width() * xscale)
+ c.set_height(c.get_height() * yscale)
+
+ def set_fontsize(self, size):
+ """
+ Set the font size, in points, of the cell text.
+
+ Parameters
+ ----------
+ size : float
+
+ Notes
+ -----
+ As long as auto font size has not been disabled, the value will be
+ clipped such that the text fits horizontally into the cell.
+
+ You can disable this behavior using `.auto_set_font_size`.
+
+ >>> the_table.auto_set_font_size(False)
+ >>> the_table.set_fontsize(20)
+
+ However, there is no automatic scaling of the row height so that the
+ text may exceed the cell boundary.
+ """
+ for cell in self._cells.values():
+ cell.set_fontsize(size)
+ self.stale = True
+
+ def _offset(self, ox, oy):
+ """Move all the artists by ox, oy (axes coords)."""
+ for c in self._cells.values():
+ x, y = c.get_x(), c.get_y()
+ c.set_x(x + ox)
+ c.set_y(y + oy)
+
+ def _update_positions(self, renderer):
+ # called from renderer to allow more precise estimates of
+ # widths and heights with get_window_extent
+
+ # Do any auto width setting
+ for col in self._autoColumns:
+ self._auto_set_column_width(col, renderer)
+
+ if self._autoFontsize:
+ self._auto_set_font_size(renderer)
+
+ # Align all the cells
+ self._do_cell_alignment()
+
+ bbox = self._get_grid_bbox(renderer)
+ l, b, w, h = bbox.bounds
+
+ if self._bbox is not None:
+ # Position according to bbox
+ if isinstance(self._bbox, Bbox):
+ rl, rb, rw, rh = self._bbox.bounds
+ else:
+ rl, rb, rw, rh = self._bbox
+ self.scale(rw / w, rh / h)
+ ox = rl - l
+ oy = rb - b
+ self._do_cell_alignment()
+ else:
+ # Position using loc
+ (BEST, UR, UL, LL, LR, CL, CR, LC, UC, C,
+ TR, TL, BL, BR, R, L, T, B) = range(len(self.codes))
+ # defaults for center
+ ox = (0.5 - w / 2) - l
+ oy = (0.5 - h / 2) - b
+ if self._loc in (UL, LL, CL): # left
+ ox = self.AXESPAD - l
+ if self._loc in (BEST, UR, LR, R, CR): # right
+ ox = 1 - (l + w + self.AXESPAD)
+ if self._loc in (BEST, UR, UL, UC): # upper
+ oy = 1 - (b + h + self.AXESPAD)
+ if self._loc in (LL, LR, LC): # lower
+ oy = self.AXESPAD - b
+ if self._loc in (LC, UC, C): # center x
+ ox = (0.5 - w / 2) - l
+ if self._loc in (CL, CR, C): # center y
+ oy = (0.5 - h / 2) - b
+
+ if self._loc in (TL, BL, L): # out left
+ ox = - (l + w)
+ if self._loc in (TR, BR, R): # out right
+ ox = 1.0 - l
+ if self._loc in (TR, TL, T): # out top
+ oy = 1.0 - b
+ if self._loc in (BL, BR, B): # out bottom
+ oy = - (b + h)
+
+ self._offset(ox, oy)
+
+ def get_celld(self):
+ r"""
+ Return a dict of cells in the table mapping *(row, column)* to
+ `.Cell`\s.
+
+ Notes
+ -----
+ You can also directly index into the Table object to access individual
+ cells::
+
+ cell = table[row, col]
+
+ """
+ return self._cells
+
+
+@_docstring.interpd
+def table(ax,
+ cellText=None, cellColours=None,
+ cellLoc='right', colWidths=None,
+ rowLabels=None, rowColours=None, rowLoc='left',
+ colLabels=None, colColours=None, colLoc='center',
+ loc='bottom', bbox=None, edges='closed',
+ **kwargs):
+ """
+ Add a table to an `~.axes.Axes`.
+
+ At least one of *cellText* or *cellColours* must be specified. These
+ parameters must be 2D lists, in which the outer lists define the rows and
+ the inner list define the column values per row. Each row must have the
+ same number of elements.
+
+ The table can optionally have row and column headers, which are configured
+ using *rowLabels*, *rowColours*, *rowLoc* and *colLabels*, *colColours*,
+ *colLoc* respectively.
+
+ For finer grained control over tables, use the `.Table` class and add it to
+ the Axes with `.Axes.add_table`.
+
+ Parameters
+ ----------
+ cellText : 2D list of str or pandas.DataFrame, optional
+ The texts to place into the table cells.
+
+ *Note*: Line breaks in the strings are currently not accounted for and
+ will result in the text exceeding the cell boundaries.
+
+ cellColours : 2D list of :mpltype:`color`, optional
+ The background colors of the cells.
+
+ cellLoc : {'right', 'center', 'left'}
+ The alignment of the text within the cells.
+
+ colWidths : list of float, optional
+ The column widths in units of the axes. If not given, all columns will
+ have a width of *1 / ncols*.
+
+ rowLabels : list of str, optional
+ The text of the row header cells.
+
+ rowColours : list of :mpltype:`color`, optional
+ The colors of the row header cells.
+
+ rowLoc : {'left', 'center', 'right'}
+ The text alignment of the row header cells.
+
+ colLabels : list of str, optional
+ The text of the column header cells.
+
+ colColours : list of :mpltype:`color`, optional
+ The colors of the column header cells.
+
+ colLoc : {'center', 'left', 'right'}
+ The text alignment of the column header cells.
+
+ loc : str, default: 'bottom'
+ The position of the cell with respect to *ax*. This must be one of
+ the `~.Table.codes`.
+
+ bbox : `.Bbox` or [xmin, ymin, width, height], optional
+ A bounding box to draw the table into. If this is not *None*, this
+ overrides *loc*.
+
+ edges : {'closed', 'open', 'horizontal', 'vertical'} or substring of 'BRTL'
+ The cell edges to be drawn with a line. See also
+ `~.Cell.visible_edges`.
+
+ Returns
+ -------
+ `~matplotlib.table.Table`
+ The created table.
+
+ Other Parameters
+ ----------------
+ **kwargs
+ `.Table` properties.
+
+ %(Table:kwdoc)s
+ """
+
+ if cellColours is None and cellText is None:
+ raise ValueError('At least one argument from "cellColours" or '
+ '"cellText" must be provided to create a table.')
+
+ # Check we have some cellText
+ if cellText is None:
+ # assume just colours are needed
+ rows = len(cellColours)
+ cols = len(cellColours[0])
+ cellText = [[''] * cols] * rows
+
+ # Check if we have a Pandas DataFrame
+ if _is_pandas_dataframe(cellText):
+ # if rowLabels/colLabels are empty, use DataFrame entries.
+ # Otherwise, throw an error.
+ if rowLabels is None:
+ rowLabels = cellText.index
+ else:
+ raise ValueError("rowLabels cannot be used alongside Pandas DataFrame")
+ if colLabels is None:
+ colLabels = cellText.columns
+ else:
+ raise ValueError("colLabels cannot be used alongside Pandas DataFrame")
+ # Update cellText with only values
+ cellText = cellText.values
+
+ rows = len(cellText)
+ cols = len(cellText[0])
+ for row in cellText:
+ if len(row) != cols:
+ raise ValueError(f"Each row in 'cellText' must have {cols} "
+ "columns")
+
+ if cellColours is not None:
+ if len(cellColours) != rows:
+ raise ValueError(f"'cellColours' must have {rows} rows")
+ for row in cellColours:
+ if len(row) != cols:
+ raise ValueError("Each row in 'cellColours' must have "
+ f"{cols} columns")
+ else:
+ cellColours = ['w' * cols] * rows
+
+ # Set colwidths if not given
+ if colWidths is None:
+ colWidths = [1.0 / cols] * cols
+
+ # Fill in missing information for column
+ # and row labels
+ rowLabelWidth = 0
+ if rowLabels is None:
+ if rowColours is not None:
+ rowLabels = [''] * rows
+ rowLabelWidth = colWidths[0]
+ elif rowColours is None:
+ rowColours = 'w' * rows
+
+ if rowLabels is not None:
+ if len(rowLabels) != rows:
+ raise ValueError(f"'rowLabels' must be of length {rows}")
+
+ # If we have column labels, need to shift
+ # the text and colour arrays down 1 row
+ offset = 1
+ if colLabels is None:
+ if colColours is not None:
+ colLabels = [''] * cols
+ else:
+ offset = 0
+ elif colColours is None:
+ colColours = 'w' * cols
+
+ # Set up cell colours if not given
+ if cellColours is None:
+ cellColours = ['w' * cols] * rows
+
+ # Now create the table
+ table = Table(ax, loc, bbox, **kwargs)
+ table.edges = edges
+ height = table._approx_text_height()
+
+ # Add the cells
+ for row in range(rows):
+ for col in range(cols):
+ table.add_cell(row + offset, col,
+ width=colWidths[col], height=height,
+ text=cellText[row][col],
+ facecolor=cellColours[row][col],
+ loc=cellLoc)
+ # Do column labels
+ if colLabels is not None:
+ for col in range(cols):
+ table.add_cell(0, col,
+ width=colWidths[col], height=height,
+ text=colLabels[col], facecolor=colColours[col],
+ loc=colLoc)
+
+ # Do row labels
+ if rowLabels is not None:
+ for row in range(rows):
+ table.add_cell(row + offset, -1,
+ width=rowLabelWidth or 1e-15, height=height,
+ text=rowLabels[row], facecolor=rowColours[row],
+ loc=rowLoc)
+ if rowLabelWidth == 0:
+ table.auto_set_column_width(-1)
+
+ # set_fontsize is only effective after cells are added
+ if "fontsize" in kwargs:
+ table.set_fontsize(kwargs["fontsize"])
+
+ ax.add_table(table)
+ return table
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/table.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/table.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..07d2427f66dc184efaf46af83e6733d157bc089b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/table.pyi
@@ -0,0 +1,87 @@
+from .artist import Artist
+from .axes import Axes
+from .backend_bases import RendererBase
+from .patches import Rectangle
+from .path import Path
+from .text import Text
+from .transforms import Bbox
+from .typing import ColorType
+
+from collections.abc import Sequence
+from typing import Any, Literal, TYPE_CHECKING
+
+from pandas import DataFrame
+
+class Cell(Rectangle):
+ PAD: float
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ width: float,
+ height: float,
+ *,
+ edgecolor: ColorType = ...,
+ facecolor: ColorType = ...,
+ fill: bool = ...,
+ text: str = ...,
+ loc: Literal["left", "center", "right"] = ...,
+ fontproperties: dict[str, Any] | None = ...,
+ visible_edges: str | None = ...
+ ) -> None: ...
+ def get_text(self) -> Text: ...
+ def set_fontsize(self, size: float) -> None: ...
+ def get_fontsize(self) -> float: ...
+ def auto_set_font_size(self, renderer: RendererBase) -> float: ...
+ def get_text_bounds(
+ self, renderer: RendererBase
+ ) -> tuple[float, float, float, float]: ...
+ def get_required_width(self, renderer: RendererBase) -> float: ...
+ def set_text_props(self, **kwargs) -> None: ...
+ @property
+ def visible_edges(self) -> str: ...
+ @visible_edges.setter
+ def visible_edges(self, value: str | None) -> None: ...
+ def get_path(self) -> Path: ...
+
+CustomCell = Cell
+
+class Table(Artist):
+ codes: dict[str, int]
+ FONTSIZE: float
+ AXESPAD: float
+ def __init__(
+ self, ax: Axes, loc: str | None = ..., bbox: Bbox | None = ..., **kwargs
+ ) -> None: ...
+ def add_cell(self, row: int, col: int, *args, **kwargs) -> Cell: ...
+ def __setitem__(self, position: tuple[int, int], cell: Cell) -> None: ...
+ def __getitem__(self, position: tuple[int, int]) -> Cell: ...
+ @property
+ def edges(self) -> str | None: ...
+ @edges.setter
+ def edges(self, value: str | None) -> None: ...
+ def draw(self, renderer) -> None: ...
+ def get_children(self) -> list[Artist]: ...
+ def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ...
+ def auto_set_column_width(self, col: int | Sequence[int]) -> None: ...
+ def auto_set_font_size(self, value: bool = ...) -> None: ...
+ def scale(self, xscale: float, yscale: float) -> None: ...
+ def set_fontsize(self, size: float) -> None: ...
+ def get_celld(self) -> dict[tuple[int, int], Cell]: ...
+
+def table(
+ ax: Axes,
+ cellText: Sequence[Sequence[str]] | DataFrame | None = ...,
+ cellColours: Sequence[Sequence[ColorType]] | None = ...,
+ cellLoc: Literal["left", "center", "right"] = ...,
+ colWidths: Sequence[float] | None = ...,
+ rowLabels: Sequence[str] | None = ...,
+ rowColours: Sequence[ColorType] | None = ...,
+ rowLoc: Literal["left", "center", "right"] = ...,
+ colLabels: Sequence[str] | None = ...,
+ colColours: Sequence[ColorType] | None = ...,
+ colLoc: Literal["left", "center", "right"] = ...,
+ loc: str = ...,
+ bbox: Bbox | None = ...,
+ edges: str = ...,
+ **kwargs
+) -> Table: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..19113d3996268ca6d3cec637785f7a30da0aae2f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/__init__.py
@@ -0,0 +1,234 @@
+"""
+Helper functions for testing.
+"""
+from pathlib import Path
+from tempfile import TemporaryDirectory
+import locale
+import logging
+import os
+import subprocess
+import sys
+
+import matplotlib as mpl
+from matplotlib import _api
+
+_log = logging.getLogger(__name__)
+
+
+def set_font_settings_for_testing():
+ mpl.rcParams['font.family'] = 'DejaVu Sans'
+ mpl.rcParams['text.hinting'] = 'none'
+ mpl.rcParams['text.hinting_factor'] = 8
+
+
+def set_reproducibility_for_testing():
+ mpl.rcParams['svg.hashsalt'] = 'matplotlib'
+
+
+def setup():
+ # The baseline images are created in this locale, so we should use
+ # it during all of the tests.
+
+ try:
+ locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
+ except locale.Error:
+ try:
+ locale.setlocale(locale.LC_ALL, 'English_United States.1252')
+ except locale.Error:
+ _log.warning(
+ "Could not set locale to English/United States. "
+ "Some date-related tests may fail.")
+
+ mpl.use('Agg')
+
+ with _api.suppress_matplotlib_deprecation_warning():
+ mpl.rcdefaults() # Start with all defaults
+
+ # These settings *must* be hardcoded for running the comparison tests and
+ # are not necessarily the default values as specified in rcsetup.py.
+ set_font_settings_for_testing()
+ set_reproducibility_for_testing()
+
+
+def subprocess_run_for_testing(command, env=None, timeout=60, stdout=None,
+ stderr=None, check=False, text=True,
+ capture_output=False):
+ """
+ Create and run a subprocess.
+
+ Thin wrapper around `subprocess.run`, intended for testing. Will
+ mark fork() failures on Cygwin as expected failures: not a
+ success, but not indicating a problem with the code either.
+
+ Parameters
+ ----------
+ args : list of str
+ env : dict[str, str]
+ timeout : float
+ stdout, stderr
+ check : bool
+ text : bool
+ Also called ``universal_newlines`` in subprocess. I chose this
+ name since the main effect is returning bytes (`False`) vs. str
+ (`True`), though it also tries to normalize newlines across
+ platforms.
+ capture_output : bool
+ Set stdout and stderr to subprocess.PIPE
+
+ Returns
+ -------
+ proc : subprocess.Popen
+
+ See Also
+ --------
+ subprocess.run
+
+ Raises
+ ------
+ pytest.xfail
+ If platform is Cygwin and subprocess reports a fork() failure.
+ """
+ if capture_output:
+ stdout = stderr = subprocess.PIPE
+ try:
+ proc = subprocess.run(
+ command, env=env,
+ timeout=timeout, check=check,
+ stdout=stdout, stderr=stderr,
+ text=text
+ )
+ except BlockingIOError:
+ if sys.platform == "cygwin":
+ # Might want to make this more specific
+ import pytest
+ pytest.xfail("Fork failure")
+ raise
+ return proc
+
+
+def subprocess_run_helper(func, *args, timeout, extra_env=None):
+ """
+ Run a function in a sub-process.
+
+ Parameters
+ ----------
+ func : function
+ The function to be run. It must be in a module that is importable.
+ *args : str
+ Any additional command line arguments to be passed in
+ the first argument to ``subprocess.run``.
+ extra_env : dict[str, str]
+ Any additional environment variables to be set for the subprocess.
+ """
+ target = func.__name__
+ module = func.__module__
+ file = func.__code__.co_filename
+ proc = subprocess_run_for_testing(
+ [
+ sys.executable,
+ "-c",
+ f"import importlib.util;"
+ f"_spec = importlib.util.spec_from_file_location({module!r}, {file!r});"
+ f"_module = importlib.util.module_from_spec(_spec);"
+ f"_spec.loader.exec_module(_module);"
+ f"_module.{target}()",
+ *args
+ ],
+ env={**os.environ, "SOURCE_DATE_EPOCH": "0", **(extra_env or {})},
+ timeout=timeout, check=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ text=True
+ )
+ return proc
+
+
+def _check_for_pgf(texsystem):
+ """
+ Check if a given TeX system + pgf is available
+
+ Parameters
+ ----------
+ texsystem : str
+ The executable name to check
+ """
+ with TemporaryDirectory() as tmpdir:
+ tex_path = Path(tmpdir, "test.tex")
+ tex_path.write_text(r"""
+ \documentclass{article}
+ \usepackage{pgf}
+ \begin{document}
+ \typeout{pgfversion=\pgfversion}
+ \makeatletter
+ \@@end
+ """, encoding="utf-8")
+ try:
+ subprocess.check_call(
+ [texsystem, "-halt-on-error", str(tex_path)], cwd=tmpdir,
+ stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ except (OSError, subprocess.CalledProcessError):
+ return False
+ return True
+
+
+def _has_tex_package(package):
+ try:
+ mpl.dviread.find_tex_file(f"{package}.sty")
+ return True
+ except FileNotFoundError:
+ return False
+
+
+def ipython_in_subprocess(requested_backend_or_gui_framework, all_expected_backends):
+ import pytest
+ IPython = pytest.importorskip("IPython")
+
+ if sys.platform == "win32":
+ pytest.skip("Cannot change backend running IPython in subprocess on Windows")
+
+ if (IPython.version_info[:3] == (8, 24, 0) and
+ requested_backend_or_gui_framework == "osx"):
+ pytest.skip("Bug using macosx backend in IPython 8.24.0 fixed in 8.24.1")
+
+ # This code can be removed when Python 3.12, the latest version supported
+ # by IPython < 8.24, reaches end-of-life in late 2028.
+ for min_version, backend in all_expected_backends.items():
+ if IPython.version_info[:2] >= min_version:
+ expected_backend = backend
+ break
+
+ code = ("import matplotlib as mpl, matplotlib.pyplot as plt;"
+ "fig, ax=plt.subplots(); ax.plot([1, 3, 2]); mpl.get_backend()")
+ proc = subprocess_run_for_testing(
+ [
+ "ipython",
+ "--no-simple-prompt",
+ f"--matplotlib={requested_backend_or_gui_framework}",
+ "-c", code,
+ ],
+ check=True,
+ capture_output=True,
+ )
+
+ assert proc.stdout.strip().endswith(f"'{expected_backend}'")
+
+
+def is_ci_environment():
+ # Common CI variables
+ ci_environment_variables = [
+ 'CI', # Generic CI environment variable
+ 'CONTINUOUS_INTEGRATION', # Generic CI environment variable
+ 'TRAVIS', # Travis CI
+ 'CIRCLECI', # CircleCI
+ 'JENKINS', # Jenkins
+ 'GITLAB_CI', # GitLab CI
+ 'GITHUB_ACTIONS', # GitHub Actions
+ 'TEAMCITY_VERSION' # TeamCity
+ # Add other CI environment variables as needed
+ ]
+
+ for env_var in ci_environment_variables:
+ if os.getenv(env_var):
+ return True
+
+ return False
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/__init__.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/__init__.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..6917b6a5a38080b389f5d970beb8973c1c041206
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/__init__.pyi
@@ -0,0 +1,54 @@
+from collections.abc import Callable
+import subprocess
+from typing import Any, IO, Literal, overload
+
+def set_font_settings_for_testing() -> None: ...
+def set_reproducibility_for_testing() -> None: ...
+def setup() -> None: ...
+@overload
+def subprocess_run_for_testing(
+ command: list[str],
+ env: dict[str, str] | None = ...,
+ timeout: float | None = ...,
+ stdout: int | IO[Any] | None = ...,
+ stderr: int | IO[Any] | None = ...,
+ check: bool = ...,
+ *,
+ text: Literal[True],
+ capture_output: bool = ...,
+) -> subprocess.CompletedProcess[str]: ...
+@overload
+def subprocess_run_for_testing(
+ command: list[str],
+ env: dict[str, str] | None = ...,
+ timeout: float | None = ...,
+ stdout: int | IO[Any] | None = ...,
+ stderr: int | IO[Any] | None = ...,
+ check: bool = ...,
+ text: Literal[False] = ...,
+ capture_output: bool = ...,
+) -> subprocess.CompletedProcess[bytes]: ...
+@overload
+def subprocess_run_for_testing(
+ command: list[str],
+ env: dict[str, str] | None = ...,
+ timeout: float | None = ...,
+ stdout: int | IO[Any] | None = ...,
+ stderr: int | IO[Any] | None = ...,
+ check: bool = ...,
+ text: bool = ...,
+ capture_output: bool = ...,
+) -> subprocess.CompletedProcess[bytes] | subprocess.CompletedProcess[str]: ...
+def subprocess_run_helper(
+ func: Callable[[], None],
+ *args: Any,
+ timeout: float,
+ extra_env: dict[str, str] | None = ...,
+) -> subprocess.CompletedProcess[str]: ...
+def _check_for_pgf(texsystem: str) -> bool: ...
+def _has_tex_package(package: str) -> bool: ...
+def ipython_in_subprocess(
+ requested_backend_or_gui_framework: str,
+ all_expected_backends: dict[tuple[int, int], str],
+) -> None: ...
+def is_ci_environment() -> bool: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/_markers.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/_markers.py
new file mode 100644
index 0000000000000000000000000000000000000000..c7ef8687a8b39766ba0385b5145b841043251de5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/_markers.py
@@ -0,0 +1,49 @@
+"""
+pytest markers for the internal Matplotlib test suite.
+"""
+
+import logging
+import shutil
+
+import pytest
+
+import matplotlib.testing
+import matplotlib.testing.compare
+from matplotlib import _get_executable_info, ExecutableNotFoundError
+
+
+_log = logging.getLogger(__name__)
+
+
+def _checkdep_usetex() -> bool:
+ if not shutil.which("tex"):
+ _log.warning("usetex mode requires TeX.")
+ return False
+ try:
+ _get_executable_info("dvipng")
+ except ExecutableNotFoundError:
+ _log.warning("usetex mode requires dvipng.")
+ return False
+ try:
+ _get_executable_info("gs")
+ except ExecutableNotFoundError:
+ _log.warning("usetex mode requires ghostscript.")
+ return False
+ return True
+
+
+needs_ghostscript = pytest.mark.skipif(
+ "eps" not in matplotlib.testing.compare.converter,
+ reason="This test needs a ghostscript installation")
+needs_pgf_lualatex = pytest.mark.skipif(
+ not matplotlib.testing._check_for_pgf('lualatex'),
+ reason='lualatex + pgf is required')
+needs_pgf_pdflatex = pytest.mark.skipif(
+ not matplotlib.testing._check_for_pgf('pdflatex'),
+ reason='pdflatex + pgf is required')
+needs_pgf_xelatex = pytest.mark.skipif(
+ not matplotlib.testing._check_for_pgf('xelatex'),
+ reason='xelatex + pgf is required')
+needs_usetex = pytest.mark.skipif(
+ not _checkdep_usetex(),
+ reason="This test needs a TeX installation")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/compare.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/compare.py
new file mode 100644
index 0000000000000000000000000000000000000000..3aeddcbe2b5e9cf99a665171cf5c58e33fc90497
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/compare.py
@@ -0,0 +1,527 @@
+"""
+Utilities for comparing image results.
+"""
+
+import atexit
+import functools
+import hashlib
+import logging
+import os
+from pathlib import Path
+import shutil
+import subprocess
+import sys
+from tempfile import TemporaryDirectory, TemporaryFile
+import weakref
+import re
+
+import numpy as np
+from PIL import Image
+
+import matplotlib as mpl
+from matplotlib import cbook
+from matplotlib.testing.exceptions import ImageComparisonFailure
+
+_log = logging.getLogger(__name__)
+
+__all__ = ['calculate_rms', 'comparable_formats', 'compare_images']
+
+
+def make_test_filename(fname, purpose):
+ """
+ Make a new filename by inserting *purpose* before the file's extension.
+ """
+ base, ext = os.path.splitext(fname)
+ return f'{base}-{purpose}{ext}'
+
+
+def _get_cache_path():
+ cache_dir = Path(mpl.get_cachedir(), 'test_cache')
+ cache_dir.mkdir(parents=True, exist_ok=True)
+ return cache_dir
+
+
+def get_cache_dir():
+ return str(_get_cache_path())
+
+
+def get_file_hash(path, block_size=2 ** 20):
+ sha256 = hashlib.sha256(usedforsecurity=False)
+ with open(path, 'rb') as fd:
+ while True:
+ data = fd.read(block_size)
+ if not data:
+ break
+ sha256.update(data)
+
+ if Path(path).suffix == '.pdf':
+ sha256.update(str(mpl._get_executable_info("gs").version).encode('utf-8'))
+ elif Path(path).suffix == '.svg':
+ sha256.update(str(mpl._get_executable_info("inkscape").version).encode('utf-8'))
+
+ return sha256.hexdigest()
+
+
+class _ConverterError(Exception):
+ pass
+
+
+class _Converter:
+ def __init__(self):
+ self._proc = None
+ # Explicitly register deletion from an atexit handler because if we
+ # wait until the object is GC'd (which occurs later), then some module
+ # globals (e.g. signal.SIGKILL) has already been set to None, and
+ # kill() doesn't work anymore...
+ atexit.register(self.__del__)
+
+ def __del__(self):
+ if self._proc:
+ self._proc.kill()
+ self._proc.wait()
+ for stream in filter(None, [self._proc.stdin,
+ self._proc.stdout,
+ self._proc.stderr]):
+ stream.close()
+ self._proc = None
+
+ def _read_until(self, terminator):
+ """Read until the prompt is reached."""
+ buf = bytearray()
+ while True:
+ c = self._proc.stdout.read(1)
+ if not c:
+ raise _ConverterError(os.fsdecode(bytes(buf)))
+ buf.extend(c)
+ if buf.endswith(terminator):
+ return bytes(buf)
+
+
+class _GSConverter(_Converter):
+ def __call__(self, orig, dest):
+ if not self._proc:
+ self._proc = subprocess.Popen(
+ [mpl._get_executable_info("gs").executable,
+ "-dNOSAFER", "-dNOPAUSE", "-dEPSCrop", "-sDEVICE=png16m"],
+ # As far as I can see, ghostscript never outputs to stderr.
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ try:
+ self._read_until(b"\nGS")
+ except _ConverterError as e:
+ raise OSError(f"Failed to start Ghostscript:\n\n{e.args[0]}") from None
+
+ def encode_and_escape(name):
+ return (os.fsencode(name)
+ .replace(b"\\", b"\\\\")
+ .replace(b"(", br"\(")
+ .replace(b")", br"\)"))
+
+ self._proc.stdin.write(
+ b"<< /OutputFile ("
+ + encode_and_escape(dest)
+ + b") >> setpagedevice ("
+ + encode_and_escape(orig)
+ + b") run flush\n")
+ self._proc.stdin.flush()
+ # GS> if nothing left on the stack; GS if n items left on the stack.
+ err = self._read_until((b"GS<", b"GS>"))
+ stack = self._read_until(b">") if err.endswith(b"GS<") else b""
+ if stack or not os.path.exists(dest):
+ stack_size = int(stack[:-1]) if stack else 0
+ self._proc.stdin.write(b"pop\n" * stack_size)
+ # Using the systemencoding should at least get the filenames right.
+ raise ImageComparisonFailure(
+ (err + stack).decode(sys.getfilesystemencoding(), "replace"))
+
+
+class _SVGConverter(_Converter):
+ def __call__(self, orig, dest):
+ old_inkscape = mpl._get_executable_info("inkscape").version.major < 1
+ terminator = b"\n>" if old_inkscape else b"> "
+ if not hasattr(self, "_tmpdir"):
+ self._tmpdir = TemporaryDirectory()
+ # On Windows, we must make sure that self._proc has terminated
+ # (which __del__ does) before clearing _tmpdir.
+ weakref.finalize(self._tmpdir, self.__del__)
+ if (not self._proc # First run.
+ or self._proc.poll() is not None): # Inkscape terminated.
+ if self._proc is not None and self._proc.poll() is not None:
+ for stream in filter(None, [self._proc.stdin,
+ self._proc.stdout,
+ self._proc.stderr]):
+ stream.close()
+ env = {
+ **os.environ,
+ # If one passes e.g. a png file to Inkscape, it will try to
+ # query the user for conversion options via a GUI (even with
+ # `--without-gui`). Unsetting `DISPLAY` prevents this (and
+ # causes GTK to crash and Inkscape to terminate, but that'll
+ # just be reported as a regular exception below).
+ "DISPLAY": "",
+ # Do not load any user options.
+ "INKSCAPE_PROFILE_DIR": self._tmpdir.name,
+ }
+ # Old versions of Inkscape (e.g. 0.48.3.1) seem to sometimes
+ # deadlock when stderr is redirected to a pipe, so we redirect it
+ # to a temporary file instead. This is not necessary anymore as of
+ # Inkscape 0.92.1.
+ stderr = TemporaryFile()
+ self._proc = subprocess.Popen(
+ ["inkscape", "--without-gui", "--shell"] if old_inkscape else
+ ["inkscape", "--shell"],
+ stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr,
+ env=env, cwd=self._tmpdir.name)
+ # Slight abuse, but makes shutdown handling easier.
+ self._proc.stderr = stderr
+ try:
+ self._read_until(terminator)
+ except _ConverterError as err:
+ raise OSError(
+ "Failed to start Inkscape in interactive mode:\n\n"
+ + err.args[0]) from err
+
+ # Inkscape's shell mode does not support escaping metacharacters in the
+ # filename ("\n", and ":;" for inkscape>=1). Avoid any problems by
+ # running from a temporary directory and using fixed filenames.
+ inkscape_orig = Path(self._tmpdir.name, os.fsdecode(b"f.svg"))
+ inkscape_dest = Path(self._tmpdir.name, os.fsdecode(b"f.png"))
+ try:
+ inkscape_orig.symlink_to(Path(orig).resolve())
+ except OSError:
+ shutil.copyfile(orig, inkscape_orig)
+ self._proc.stdin.write(
+ b"f.svg --export-png=f.png\n" if old_inkscape else
+ b"file-open:f.svg;export-filename:f.png;export-do;file-close\n")
+ self._proc.stdin.flush()
+ try:
+ self._read_until(terminator)
+ except _ConverterError as err:
+ # Inkscape's output is not localized but gtk's is, so the output
+ # stream probably has a mixed encoding. Using the filesystem
+ # encoding should at least get the filenames right...
+ self._proc.stderr.seek(0)
+ raise ImageComparisonFailure(
+ self._proc.stderr.read().decode(
+ sys.getfilesystemencoding(), "replace")) from err
+ os.remove(inkscape_orig)
+ shutil.move(inkscape_dest, dest)
+
+ def __del__(self):
+ super().__del__()
+ if hasattr(self, "_tmpdir"):
+ self._tmpdir.cleanup()
+
+
+class _SVGWithMatplotlibFontsConverter(_SVGConverter):
+ """
+ A SVG converter which explicitly adds the fonts shipped by Matplotlib to
+ Inkspace's font search path, to better support `svg.fonttype = "none"`
+ (which is in particular used by certain mathtext tests).
+ """
+
+ def __call__(self, orig, dest):
+ if not hasattr(self, "_tmpdir"):
+ self._tmpdir = TemporaryDirectory()
+ shutil.copytree(cbook._get_data_path("fonts/ttf"),
+ Path(self._tmpdir.name, "fonts"))
+ return super().__call__(orig, dest)
+
+
+def _update_converter():
+ try:
+ mpl._get_executable_info("gs")
+ except mpl.ExecutableNotFoundError:
+ pass
+ else:
+ converter['pdf'] = converter['eps'] = _GSConverter()
+ try:
+ mpl._get_executable_info("inkscape")
+ except mpl.ExecutableNotFoundError:
+ pass
+ else:
+ converter['svg'] = _SVGConverter()
+
+
+#: A dictionary that maps filename extensions to functions which themselves
+#: convert between arguments `old` and `new` (filenames).
+converter = {}
+_update_converter()
+_svg_with_matplotlib_fonts_converter = _SVGWithMatplotlibFontsConverter()
+
+
+def comparable_formats():
+ """
+ Return the list of file formats that `.compare_images` can compare
+ on this system.
+
+ Returns
+ -------
+ list of str
+ E.g. ``['png', 'pdf', 'svg', 'eps']``.
+
+ """
+ return ['png', *converter]
+
+
+def convert(filename, cache):
+ """
+ Convert the named file to png; return the name of the created file.
+
+ If *cache* is True, the result of the conversion is cached in
+ `matplotlib.get_cachedir() + '/test_cache/'`. The caching is based on a
+ hash of the exact contents of the input file. Old cache entries are
+ automatically deleted as needed to keep the size of the cache capped to
+ twice the size of all baseline images.
+ """
+ path = Path(filename)
+ if not path.exists():
+ raise OSError(f"{path} does not exist")
+ if path.suffix[1:] not in converter:
+ import pytest
+ pytest.skip(f"Don't know how to convert {path.suffix} files to png")
+ newpath = path.parent / f"{path.stem}_{path.suffix[1:]}.png"
+
+ # Only convert the file if the destination doesn't already exist or
+ # is out of date.
+ if not newpath.exists() or newpath.stat().st_mtime < path.stat().st_mtime:
+ cache_dir = _get_cache_path() if cache else None
+
+ if cache_dir is not None:
+ _register_conversion_cache_cleaner_once()
+ hash_value = get_file_hash(path)
+ cached_path = cache_dir / (hash_value + newpath.suffix)
+ if cached_path.exists():
+ _log.debug("For %s: reusing cached conversion.", filename)
+ shutil.copyfile(cached_path, newpath)
+ return str(newpath)
+
+ _log.debug("For %s: converting to png.", filename)
+ convert = converter[path.suffix[1:]]
+ if path.suffix == ".svg":
+ contents = path.read_text()
+ # NOTE: This check should be kept in sync with font styling in
+ # `lib/matplotlib/backends/backend_svg.py`. If it changes, then be sure to
+ # re-generate any SVG test files using this mode, or else such tests will
+ # fail to use the converter for the expected images (but will for the
+ # results), and the tests will fail strangely.
+ if re.search(
+ # searches for attributes :
+ # style=[font|font-size|font-weight|
+ # font-family|font-variant|font-style]
+ # taking care of the possibility of multiple style attributes
+ # before the font styling (i.e. opacity)
+ r'style="[^"]*font(|-size|-weight|-family|-variant|-style):',
+ contents # raw contents of the svg file
+ ):
+ # for svg.fonttype = none, we explicitly patch the font search
+ # path so that fonts shipped by Matplotlib are found.
+ convert = _svg_with_matplotlib_fonts_converter
+ convert(path, newpath)
+
+ if cache_dir is not None:
+ _log.debug("For %s: caching conversion result.", filename)
+ shutil.copyfile(newpath, cached_path)
+
+ return str(newpath)
+
+
+def _clean_conversion_cache():
+ # This will actually ignore mpl_toolkits baseline images, but they're
+ # relatively small.
+ baseline_images_size = sum(
+ path.stat().st_size
+ for path in Path(mpl.__file__).parent.glob("**/baseline_images/**/*"))
+ # 2x: one full copy of baselines, and one full copy of test results
+ # (actually an overestimate: we don't convert png baselines and results).
+ max_cache_size = 2 * baseline_images_size
+ # Reduce cache until it fits.
+ with cbook._lock_path(_get_cache_path()):
+ cache_stat = {
+ path: path.stat() for path in _get_cache_path().glob("*")}
+ cache_size = sum(stat.st_size for stat in cache_stat.values())
+ paths_by_atime = sorted( # Oldest at the end.
+ cache_stat, key=lambda path: cache_stat[path].st_atime,
+ reverse=True)
+ while cache_size > max_cache_size:
+ path = paths_by_atime.pop()
+ cache_size -= cache_stat[path].st_size
+ path.unlink()
+
+
+@functools.cache # Ensure this is only registered once.
+def _register_conversion_cache_cleaner_once():
+ atexit.register(_clean_conversion_cache)
+
+
+def crop_to_same(actual_path, actual_image, expected_path, expected_image):
+ # clip the images to the same size -- this is useful only when
+ # comparing eps to pdf
+ if actual_path[-7:-4] == 'eps' and expected_path[-7:-4] == 'pdf':
+ aw, ah, ad = actual_image.shape
+ ew, eh, ed = expected_image.shape
+ actual_image = actual_image[int(aw / 2 - ew / 2):int(
+ aw / 2 + ew / 2), int(ah / 2 - eh / 2):int(ah / 2 + eh / 2)]
+ return actual_image, expected_image
+
+
+def calculate_rms(expected_image, actual_image):
+ """
+ Calculate the per-pixel errors, then compute the root mean square error.
+ """
+ if expected_image.shape != actual_image.shape:
+ raise ImageComparisonFailure(
+ f"Image sizes do not match expected size: {expected_image.shape} "
+ f"actual size {actual_image.shape}")
+ # Convert to float to avoid overflowing finite integer types.
+ return np.sqrt(((expected_image - actual_image).astype(float) ** 2).mean())
+
+
+# NOTE: compare_image and save_diff_image assume that the image does not have
+# 16-bit depth, as Pillow converts these to RGB incorrectly.
+
+
+def _load_image(path):
+ img = Image.open(path)
+ # In an RGBA image, if the smallest value in the alpha channel is 255, all
+ # values in it must be 255, meaning that the image is opaque. If so,
+ # discard the alpha channel so that it may compare equal to an RGB image.
+ if img.mode != "RGBA" or img.getextrema()[3][0] == 255:
+ img = img.convert("RGB")
+ return np.asarray(img)
+
+
+def compare_images(expected, actual, tol, in_decorator=False):
+ """
+ Compare two "image" files checking differences within a tolerance.
+
+ The two given filenames may point to files which are convertible to
+ PNG via the `.converter` dictionary. The underlying RMS is calculated
+ with the `.calculate_rms` function.
+
+ Parameters
+ ----------
+ expected : str
+ The filename of the expected image.
+ actual : str
+ The filename of the actual image.
+ tol : float
+ The tolerance (a color value difference, where 255 is the
+ maximal difference). The test fails if the average pixel
+ difference is greater than this value.
+ in_decorator : bool
+ Determines the output format. If called from image_comparison
+ decorator, this should be True. (default=False)
+
+ Returns
+ -------
+ None or dict or str
+ Return *None* if the images are equal within the given tolerance.
+
+ If the images differ, the return value depends on *in_decorator*.
+ If *in_decorator* is true, a dict with the following entries is
+ returned:
+
+ - *rms*: The RMS of the image difference.
+ - *expected*: The filename of the expected image.
+ - *actual*: The filename of the actual image.
+ - *diff_image*: The filename of the difference image.
+ - *tol*: The comparison tolerance.
+
+ Otherwise, a human-readable multi-line string representation of this
+ information is returned.
+
+ Examples
+ --------
+ ::
+
+ img1 = "./baseline/plot.png"
+ img2 = "./output/plot.png"
+ compare_images(img1, img2, 0.001)
+
+ """
+ actual = os.fspath(actual)
+ if not os.path.exists(actual):
+ raise Exception(f"Output image {actual} does not exist.")
+ if os.stat(actual).st_size == 0:
+ raise Exception(f"Output image file {actual} is empty.")
+
+ # Convert the image to png
+ expected = os.fspath(expected)
+ if not os.path.exists(expected):
+ raise OSError(f'Baseline image {expected!r} does not exist.')
+ extension = expected.split('.')[-1]
+ if extension != 'png':
+ actual = convert(actual, cache=True)
+ expected = convert(expected, cache=True)
+
+ # open the image files
+ expected_image = _load_image(expected)
+ actual_image = _load_image(actual)
+
+ actual_image, expected_image = crop_to_same(
+ actual, actual_image, expected, expected_image)
+
+ diff_image = make_test_filename(actual, 'failed-diff')
+
+ if tol <= 0:
+ if np.array_equal(expected_image, actual_image):
+ return None
+
+ # convert to signed integers, so that the images can be subtracted without
+ # overflow
+ expected_image = expected_image.astype(np.int16)
+ actual_image = actual_image.astype(np.int16)
+
+ rms = calculate_rms(expected_image, actual_image)
+
+ if rms <= tol:
+ return None
+
+ save_diff_image(expected, actual, diff_image)
+
+ results = dict(rms=rms, expected=str(expected),
+ actual=str(actual), diff=str(diff_image), tol=tol)
+
+ if not in_decorator:
+ # Then the results should be a string suitable for stdout.
+ template = ['Error: Image files did not match.',
+ 'RMS Value: {rms}',
+ 'Expected: \n {expected}',
+ 'Actual: \n {actual}',
+ 'Difference:\n {diff}',
+ 'Tolerance: \n {tol}', ]
+ results = '\n '.join([line.format(**results) for line in template])
+ return results
+
+
+def save_diff_image(expected, actual, output):
+ """
+ Parameters
+ ----------
+ expected : str
+ File path of expected image.
+ actual : str
+ File path of actual image.
+ output : str
+ File path to save difference image to.
+ """
+ expected_image = _load_image(expected)
+ actual_image = _load_image(actual)
+ actual_image, expected_image = crop_to_same(
+ actual, actual_image, expected, expected_image)
+ expected_image = np.array(expected_image, float)
+ actual_image = np.array(actual_image, float)
+ if expected_image.shape != actual_image.shape:
+ raise ImageComparisonFailure(
+ f"Image sizes do not match expected size: {expected_image.shape} "
+ f"actual size {actual_image.shape}")
+ abs_diff = np.abs(expected_image - actual_image)
+
+ # expand differences in luminance domain
+ abs_diff *= 10
+ abs_diff = np.clip(abs_diff, 0, 255).astype(np.uint8)
+
+ if abs_diff.shape[2] == 4: # Hard-code the alpha channel to fully solid
+ abs_diff[:, :, 3] = 255
+
+ Image.fromarray(abs_diff).save(output, format="png")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/compare.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/compare.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..8f11b3bebc1a0f4186448b1e8d6a8f11f06e3b4f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/compare.pyi
@@ -0,0 +1,32 @@
+from collections.abc import Callable
+from typing import Literal, overload
+
+from numpy.typing import NDArray
+
+__all__ = ["calculate_rms", "comparable_formats", "compare_images"]
+
+def make_test_filename(fname: str, purpose: str) -> str: ...
+def get_cache_dir() -> str: ...
+def get_file_hash(path: str, block_size: int = ...) -> str: ...
+
+converter: dict[str, Callable[[str, str], None]] = {}
+
+def comparable_formats() -> list[str]: ...
+def convert(filename: str, cache: bool) -> str: ...
+def crop_to_same(
+ actual_path: str, actual_image: NDArray, expected_path: str, expected_image: NDArray
+) -> tuple[NDArray, NDArray]: ...
+def calculate_rms(expected_image: NDArray, actual_image: NDArray) -> float: ...
+@overload
+def compare_images(
+ expected: str, actual: str, tol: float, in_decorator: Literal[True]
+) -> None | dict[str, float | str]: ...
+@overload
+def compare_images(
+ expected: str, actual: str, tol: float, in_decorator: Literal[False]
+) -> None | str: ...
+@overload
+def compare_images(
+ expected: str, actual: str, tol: float, in_decorator: bool = ...
+) -> None | str | dict[str, float | str]: ...
+def save_diff_image(expected: str, actual: str, output: str) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/conftest.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/conftest.py
new file mode 100644
index 0000000000000000000000000000000000000000..2961e7f02f3f9081f9918f090233281e18db2c2e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/conftest.py
@@ -0,0 +1,178 @@
+import pytest
+import sys
+import matplotlib
+from matplotlib import _api
+
+
+def pytest_configure(config):
+ # config is initialized here rather than in pytest.ini so that `pytest
+ # --pyargs matplotlib` (which would not find pytest.ini) works. The only
+ # entries in pytest.ini set minversion (which is checked earlier),
+ # testpaths/python_files, as they are required to properly find the tests
+ for key, value in [
+ ("markers", "flaky: (Provided by pytest-rerunfailures.)"),
+ ("markers", "timeout: (Provided by pytest-timeout.)"),
+ ("markers", "backend: Set alternate Matplotlib backend temporarily."),
+ ("markers", "baseline_images: Compare output against references."),
+ ("markers", "pytz: Tests that require pytz to be installed."),
+ ("filterwarnings", "error"),
+ ("filterwarnings",
+ "ignore:.*The py23 module has been deprecated:DeprecationWarning"),
+ ("filterwarnings",
+ r"ignore:DynamicImporter.find_spec\(\) not found; "
+ r"falling back to find_module\(\):ImportWarning"),
+ ]:
+ config.addinivalue_line(key, value)
+
+ matplotlib.use('agg', force=True)
+ matplotlib._called_from_pytest = True
+ matplotlib._init_tests()
+
+
+def pytest_unconfigure(config):
+ matplotlib._called_from_pytest = False
+
+
+@pytest.fixture(autouse=True)
+def mpl_test_settings(request):
+ from matplotlib.testing.decorators import _cleanup_cm
+
+ with _cleanup_cm():
+
+ backend = None
+ backend_marker = request.node.get_closest_marker('backend')
+ prev_backend = matplotlib.get_backend()
+ if backend_marker is not None:
+ assert len(backend_marker.args) == 1, \
+ "Marker 'backend' must specify 1 backend."
+ backend, = backend_marker.args
+ skip_on_importerror = backend_marker.kwargs.get(
+ 'skip_on_importerror', False)
+
+ # special case Qt backend importing to avoid conflicts
+ if backend.lower().startswith('qt5'):
+ if any(sys.modules.get(k) for k in ('PyQt4', 'PySide')):
+ pytest.skip('Qt4 binding already imported')
+
+ matplotlib.testing.setup()
+ with _api.suppress_matplotlib_deprecation_warning():
+ if backend is not None:
+ # This import must come after setup() so it doesn't load the
+ # default backend prematurely.
+ import matplotlib.pyplot as plt
+ try:
+ plt.switch_backend(backend)
+ except ImportError as exc:
+ # Should only occur for the cairo backend tests, if neither
+ # pycairo nor cairocffi are installed.
+ if 'cairo' in backend.lower() or skip_on_importerror:
+ pytest.skip("Failed to switch to backend "
+ f"{backend} ({exc}).")
+ else:
+ raise
+ # Default of cleanup and image_comparison too.
+ matplotlib.style.use(["classic", "_classic_test_patch"])
+ try:
+ yield
+ finally:
+ if backend is not None:
+ plt.close("all")
+ matplotlib.use(prev_backend)
+
+
+@pytest.fixture
+def pd():
+ """
+ Fixture to import and configure pandas. Using this fixture, the test is skipped when
+ pandas is not installed. Use this fixture instead of importing pandas in test files.
+
+ Examples
+ --------
+ Request the pandas fixture by passing in ``pd`` as an argument to the test ::
+
+ def test_matshow_pandas(pd):
+
+ df = pd.DataFrame({'x':[1,2,3], 'y':[4,5,6]})
+ im = plt.figure().subplots().matshow(df)
+ np.testing.assert_array_equal(im.get_array(), df)
+ """
+ pd = pytest.importorskip('pandas')
+ try:
+ from pandas.plotting import (
+ deregister_matplotlib_converters as deregister)
+ deregister()
+ except ImportError:
+ pass
+ return pd
+
+
+@pytest.fixture
+def xr():
+ """
+ Fixture to import xarray so that the test is skipped when xarray is not installed.
+ Use this fixture instead of importing xrray in test files.
+
+ Examples
+ --------
+ Request the xarray fixture by passing in ``xr`` as an argument to the test ::
+
+ def test_imshow_xarray(xr):
+
+ ds = xr.DataArray(np.random.randn(2, 3))
+ im = plt.figure().subplots().imshow(ds)
+ np.testing.assert_array_equal(im.get_array(), ds)
+ """
+
+ xr = pytest.importorskip('xarray')
+ return xr
+
+
+@pytest.fixture
+def text_placeholders(monkeypatch):
+ """
+ Replace texts with placeholder rectangles.
+
+ The rectangle size only depends on the font size and the number of characters. It is
+ thus insensitive to font properties and rendering details. This should be used for
+ tests that depend on text geometries but not the actual text rendering, e.g. layout
+ tests.
+ """
+ from matplotlib.patches import Rectangle
+
+ def patched_get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi):
+ """
+ Replace ``_get_text_metrics_with_cache`` with fixed results.
+
+ The usual ``renderer.get_text_width_height_descent`` would depend on font
+ metrics; instead the fixed results are based on font size and the length of the
+ string only.
+ """
+ # While get_window_extent returns pixels and font size is in points, font size
+ # includes ascenders and descenders. Leaving out this factor and setting
+ # descent=0 ends up with a box that is relatively close to DejaVu Sans.
+ height = fontprop.get_size()
+ width = len(text) * height / 1.618 # Golden ratio for character size.
+ descent = 0
+ return width, height, descent
+
+ def patched_text_draw(self, renderer):
+ """
+ Replace ``Text.draw`` with a fixed bounding box Rectangle.
+
+ The bounding box corresponds to ``Text.get_window_extent``, which ultimately
+ depends on the above patched ``_get_text_metrics_with_cache``.
+ """
+ if renderer is not None:
+ self._renderer = renderer
+ if not self.get_visible():
+ return
+ if self.get_text() == '':
+ return
+ bbox = self.get_window_extent()
+ rect = Rectangle(bbox.p0, bbox.width, bbox.height,
+ facecolor=self.get_color(), edgecolor='none')
+ rect.draw(renderer)
+
+ monkeypatch.setattr('matplotlib.text._get_text_metrics_with_cache',
+ patched_get_text_metrics_with_cache)
+ monkeypatch.setattr('matplotlib.text.Text.draw', patched_text_draw)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/conftest.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/conftest.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..f5d90bc88f738244c463b6a070a756ace8c56202
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/conftest.pyi
@@ -0,0 +1,14 @@
+from types import ModuleType
+
+import pytest
+
+def pytest_configure(config: pytest.Config) -> None: ...
+def pytest_unconfigure(config: pytest.Config) -> None: ...
+@pytest.fixture
+def mpl_test_settings(request: pytest.FixtureRequest) -> None: ...
+@pytest.fixture
+def pd() -> ModuleType: ...
+@pytest.fixture
+def xr() -> ModuleType: ...
+@pytest.fixture
+def text_placeholders(monkeypatch: pytest.MonkeyPatch) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/decorators.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/decorators.py
new file mode 100644
index 0000000000000000000000000000000000000000..6f1af7debdb3160b9975b5278d2864e1b79d64e3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/decorators.py
@@ -0,0 +1,464 @@
+import contextlib
+import functools
+import inspect
+import os
+from platform import uname
+from pathlib import Path
+import shutil
+import string
+import sys
+import warnings
+
+from packaging.version import parse as parse_version
+
+import matplotlib.style
+import matplotlib.units
+import matplotlib.testing
+from matplotlib import _pylab_helpers, cbook, ft2font, pyplot as plt, ticker
+from .compare import comparable_formats, compare_images, make_test_filename
+from .exceptions import ImageComparisonFailure
+
+
+@contextlib.contextmanager
+def _cleanup_cm():
+ orig_units_registry = matplotlib.units.registry.copy()
+ try:
+ with warnings.catch_warnings(), matplotlib.rc_context():
+ yield
+ finally:
+ matplotlib.units.registry.clear()
+ matplotlib.units.registry.update(orig_units_registry)
+ plt.close("all")
+
+
+def _check_freetype_version(ver):
+ if ver is None:
+ return True
+
+ if isinstance(ver, str):
+ ver = (ver, ver)
+ ver = [parse_version(x) for x in ver]
+ found = parse_version(ft2font.__freetype_version__)
+
+ return ver[0] <= found <= ver[1]
+
+
+def _checked_on_freetype_version(required_freetype_version):
+ import pytest
+ return pytest.mark.xfail(
+ not _check_freetype_version(required_freetype_version),
+ reason=f"Mismatched version of freetype. "
+ f"Test requires '{required_freetype_version}', "
+ f"you have '{ft2font.__freetype_version__}'",
+ raises=ImageComparisonFailure, strict=False)
+
+
+def remove_ticks_and_titles(figure):
+ figure.suptitle("")
+ null_formatter = ticker.NullFormatter()
+ def remove_ticks(ax):
+ """Remove ticks in *ax* and all its child Axes."""
+ ax.set_title("")
+ ax.xaxis.set_major_formatter(null_formatter)
+ ax.xaxis.set_minor_formatter(null_formatter)
+ ax.yaxis.set_major_formatter(null_formatter)
+ ax.yaxis.set_minor_formatter(null_formatter)
+ try:
+ ax.zaxis.set_major_formatter(null_formatter)
+ ax.zaxis.set_minor_formatter(null_formatter)
+ except AttributeError:
+ pass
+ for child in ax.child_axes:
+ remove_ticks(child)
+ for ax in figure.get_axes():
+ remove_ticks(ax)
+
+
+@contextlib.contextmanager
+def _collect_new_figures():
+ """
+ After::
+
+ with _collect_new_figures() as figs:
+ some_code()
+
+ the list *figs* contains the figures that have been created during the
+ execution of ``some_code``, sorted by figure number.
+ """
+ managers = _pylab_helpers.Gcf.figs
+ preexisting = [manager for manager in managers.values()]
+ new_figs = []
+ try:
+ yield new_figs
+ finally:
+ new_managers = sorted([manager for manager in managers.values()
+ if manager not in preexisting],
+ key=lambda manager: manager.num)
+ new_figs[:] = [manager.canvas.figure for manager in new_managers]
+
+
+def _raise_on_image_difference(expected, actual, tol):
+ __tracebackhide__ = True
+
+ err = compare_images(expected, actual, tol, in_decorator=True)
+ if err:
+ for key in ["actual", "expected", "diff"]:
+ err[key] = os.path.relpath(err[key])
+ raise ImageComparisonFailure(
+ ('images not close (RMS %(rms).3f):'
+ '\n\t%(actual)s\n\t%(expected)s\n\t%(diff)s') % err)
+
+
+class _ImageComparisonBase:
+ """
+ Image comparison base class
+
+ This class provides *just* the comparison-related functionality and avoids
+ any code that would be specific to any testing framework.
+ """
+
+ def __init__(self, func, tol, remove_text, savefig_kwargs):
+ self.func = func
+ self.baseline_dir, self.result_dir = _image_directories(func)
+ self.tol = tol
+ self.remove_text = remove_text
+ self.savefig_kwargs = savefig_kwargs
+
+ def copy_baseline(self, baseline, extension):
+ baseline_path = self.baseline_dir / baseline
+ orig_expected_path = baseline_path.with_suffix(f'.{extension}')
+ if extension == 'eps' and not orig_expected_path.exists():
+ orig_expected_path = orig_expected_path.with_suffix('.pdf')
+ expected_fname = make_test_filename(
+ self.result_dir / orig_expected_path.name, 'expected')
+ try:
+ # os.symlink errors if the target already exists.
+ with contextlib.suppress(OSError):
+ os.remove(expected_fname)
+ try:
+ if 'microsoft' in uname().release.lower():
+ raise OSError # On WSL, symlink breaks silently
+ os.symlink(orig_expected_path, expected_fname)
+ except OSError: # On Windows, symlink *may* be unavailable.
+ shutil.copyfile(orig_expected_path, expected_fname)
+ except OSError as err:
+ raise ImageComparisonFailure(
+ f"Missing baseline image {expected_fname} because the "
+ f"following file cannot be accessed: "
+ f"{orig_expected_path}") from err
+ return expected_fname
+
+ def compare(self, fig, baseline, extension, *, _lock=False):
+ __tracebackhide__ = True
+
+ if self.remove_text:
+ remove_ticks_and_titles(fig)
+
+ actual_path = (self.result_dir / baseline).with_suffix(f'.{extension}')
+ kwargs = self.savefig_kwargs.copy()
+ if extension == 'pdf':
+ kwargs.setdefault('metadata',
+ {'Creator': None, 'Producer': None,
+ 'CreationDate': None})
+
+ lock = (cbook._lock_path(actual_path)
+ if _lock else contextlib.nullcontext())
+ with lock:
+ try:
+ fig.savefig(actual_path, **kwargs)
+ finally:
+ # Matplotlib has an autouse fixture to close figures, but this
+ # makes things more convenient for third-party users.
+ plt.close(fig)
+ expected_path = self.copy_baseline(baseline, extension)
+ _raise_on_image_difference(expected_path, actual_path, self.tol)
+
+
+def _pytest_image_comparison(baseline_images, extensions, tol,
+ freetype_version, remove_text, savefig_kwargs,
+ style):
+ """
+ Decorate function with image comparison for pytest.
+
+ This function creates a decorator that wraps a figure-generating function
+ with image comparison code.
+ """
+ import pytest
+
+ KEYWORD_ONLY = inspect.Parameter.KEYWORD_ONLY
+
+ def decorator(func):
+ old_sig = inspect.signature(func)
+
+ @functools.wraps(func)
+ @pytest.mark.parametrize('extension', extensions)
+ @matplotlib.style.context(style)
+ @_checked_on_freetype_version(freetype_version)
+ @functools.wraps(func)
+ def wrapper(*args, extension, request, **kwargs):
+ __tracebackhide__ = True
+ if 'extension' in old_sig.parameters:
+ kwargs['extension'] = extension
+ if 'request' in old_sig.parameters:
+ kwargs['request'] = request
+
+ if extension not in comparable_formats():
+ reason = {
+ 'pdf': 'because Ghostscript is not installed',
+ 'eps': 'because Ghostscript is not installed',
+ 'svg': 'because Inkscape is not installed',
+ }.get(extension, 'on this system')
+ pytest.skip(f"Cannot compare {extension} files {reason}")
+
+ img = _ImageComparisonBase(func, tol=tol, remove_text=remove_text,
+ savefig_kwargs=savefig_kwargs)
+ matplotlib.testing.set_font_settings_for_testing()
+
+ with _collect_new_figures() as figs:
+ func(*args, **kwargs)
+
+ # If the test is parametrized in any way other than applied via
+ # this decorator, then we need to use a lock to prevent two
+ # processes from touching the same output file.
+ needs_lock = any(
+ marker.args[0] != 'extension'
+ for marker in request.node.iter_markers('parametrize'))
+
+ if baseline_images is not None:
+ our_baseline_images = baseline_images
+ else:
+ # Allow baseline image list to be produced on the fly based on
+ # current parametrization.
+ our_baseline_images = request.getfixturevalue(
+ 'baseline_images')
+
+ assert len(figs) == len(our_baseline_images), (
+ f"Test generated {len(figs)} images but there are "
+ f"{len(our_baseline_images)} baseline images")
+ for fig, baseline in zip(figs, our_baseline_images):
+ img.compare(fig, baseline, extension, _lock=needs_lock)
+
+ parameters = list(old_sig.parameters.values())
+ if 'extension' not in old_sig.parameters:
+ parameters += [inspect.Parameter('extension', KEYWORD_ONLY)]
+ if 'request' not in old_sig.parameters:
+ parameters += [inspect.Parameter("request", KEYWORD_ONLY)]
+ new_sig = old_sig.replace(parameters=parameters)
+ wrapper.__signature__ = new_sig
+
+ # Reach a bit into pytest internals to hoist the marks from our wrapped
+ # function.
+ new_marks = getattr(func, 'pytestmark', []) + wrapper.pytestmark
+ wrapper.pytestmark = new_marks
+
+ return wrapper
+
+ return decorator
+
+
+def image_comparison(baseline_images, extensions=None, tol=0,
+ freetype_version=None, remove_text=False,
+ savefig_kwarg=None,
+ # Default of mpl_test_settings fixture and cleanup too.
+ style=("classic", "_classic_test_patch")):
+ """
+ Compare images generated by the test with those specified in
+ *baseline_images*, which must correspond, else an `.ImageComparisonFailure`
+ exception will be raised.
+
+ Parameters
+ ----------
+ baseline_images : list or None
+ A list of strings specifying the names of the images generated by
+ calls to `.Figure.savefig`.
+
+ If *None*, the test function must use the ``baseline_images`` fixture,
+ either as a parameter or with `pytest.mark.usefixtures`. This value is
+ only allowed when using pytest.
+
+ extensions : None or list of str
+ The list of extensions to test, e.g. ``['png', 'pdf']``.
+
+ If *None*, defaults to all supported extensions: png, pdf, and svg.
+
+ When testing a single extension, it can be directly included in the
+ names passed to *baseline_images*. In that case, *extensions* must not
+ be set.
+
+ In order to keep the size of the test suite from ballooning, we only
+ include the ``svg`` or ``pdf`` outputs if the test is explicitly
+ exercising a feature dependent on that backend (see also the
+ `check_figures_equal` decorator for that purpose).
+
+ tol : float, default: 0
+ The RMS threshold above which the test is considered failed.
+
+ Due to expected small differences in floating-point calculations, on
+ 32-bit systems an additional 0.06 is added to this threshold.
+
+ freetype_version : str or tuple
+ The expected freetype version or range of versions for this test to
+ pass.
+
+ remove_text : bool
+ Remove the title and tick text from the figure before comparison. This
+ is useful to make the baseline images independent of variations in text
+ rendering between different versions of FreeType.
+
+ This does not remove other, more deliberate, text, such as legends and
+ annotations.
+
+ savefig_kwarg : dict
+ Optional arguments that are passed to the savefig method.
+
+ style : str, dict, or list
+ The optional style(s) to apply to the image test. The test itself
+ can also apply additional styles if desired. Defaults to ``["classic",
+ "_classic_test_patch"]``.
+ """
+
+ if baseline_images is not None:
+ # List of non-empty filename extensions.
+ baseline_exts = [*filter(None, {Path(baseline).suffix[1:]
+ for baseline in baseline_images})]
+ if baseline_exts:
+ if extensions is not None:
+ raise ValueError(
+ "When including extensions directly in 'baseline_images', "
+ "'extensions' cannot be set as well")
+ if len(baseline_exts) > 1:
+ raise ValueError(
+ "When including extensions directly in 'baseline_images', "
+ "all baselines must share the same suffix")
+ extensions = baseline_exts
+ baseline_images = [ # Chop suffix out from baseline_images.
+ Path(baseline).stem for baseline in baseline_images]
+ if extensions is None:
+ # Default extensions to test, if not set via baseline_images.
+ extensions = ['png', 'pdf', 'svg']
+ if savefig_kwarg is None:
+ savefig_kwarg = dict() # default no kwargs to savefig
+ if sys.maxsize <= 2**32:
+ tol += 0.06
+ return _pytest_image_comparison(
+ baseline_images=baseline_images, extensions=extensions, tol=tol,
+ freetype_version=freetype_version, remove_text=remove_text,
+ savefig_kwargs=savefig_kwarg, style=style)
+
+
+def check_figures_equal(*, extensions=("png", "pdf", "svg"), tol=0):
+ """
+ Decorator for test cases that generate and compare two figures.
+
+ The decorated function must take two keyword arguments, *fig_test*
+ and *fig_ref*, and draw the test and reference images on them.
+ After the function returns, the figures are saved and compared.
+
+ This decorator should be preferred over `image_comparison` when possible in
+ order to keep the size of the test suite from ballooning.
+
+ Parameters
+ ----------
+ extensions : list, default: ["png", "pdf", "svg"]
+ The extensions to test.
+ tol : float
+ The RMS threshold above which the test is considered failed.
+
+ Raises
+ ------
+ RuntimeError
+ If any new figures are created (and not subsequently closed) inside
+ the test function.
+
+ Examples
+ --------
+ Check that calling `.Axes.plot` with a single argument plots it against
+ ``[0, 1, 2, ...]``::
+
+ @check_figures_equal()
+ def test_plot(fig_test, fig_ref):
+ fig_test.subplots().plot([1, 3, 5])
+ fig_ref.subplots().plot([0, 1, 2], [1, 3, 5])
+
+ """
+ ALLOWED_CHARS = set(string.digits + string.ascii_letters + '_-[]()')
+ KEYWORD_ONLY = inspect.Parameter.KEYWORD_ONLY
+
+ def decorator(func):
+ import pytest
+
+ _, result_dir = _image_directories(func)
+ old_sig = inspect.signature(func)
+
+ if not {"fig_test", "fig_ref"}.issubset(old_sig.parameters):
+ raise ValueError("The decorated function must have at least the "
+ "parameters 'fig_test' and 'fig_ref', but your "
+ f"function has the signature {old_sig}")
+
+ @pytest.mark.parametrize("ext", extensions)
+ def wrapper(*args, ext, request, **kwargs):
+ if 'ext' in old_sig.parameters:
+ kwargs['ext'] = ext
+ if 'request' in old_sig.parameters:
+ kwargs['request'] = request
+
+ file_name = "".join(c for c in request.node.name
+ if c in ALLOWED_CHARS)
+ try:
+ fig_test = plt.figure("test")
+ fig_ref = plt.figure("reference")
+ with _collect_new_figures() as figs:
+ func(*args, fig_test=fig_test, fig_ref=fig_ref, **kwargs)
+ if figs:
+ raise RuntimeError('Number of open figures changed during '
+ 'test. Make sure you are plotting to '
+ 'fig_test or fig_ref, or if this is '
+ 'deliberate explicitly close the '
+ 'new figure(s) inside the test.')
+ test_image_path = result_dir / (file_name + "." + ext)
+ ref_image_path = result_dir / (file_name + "-expected." + ext)
+ fig_test.savefig(test_image_path)
+ fig_ref.savefig(ref_image_path)
+ _raise_on_image_difference(
+ ref_image_path, test_image_path, tol=tol
+ )
+ finally:
+ plt.close(fig_test)
+ plt.close(fig_ref)
+
+ parameters = [
+ param
+ for param in old_sig.parameters.values()
+ if param.name not in {"fig_test", "fig_ref"}
+ ]
+ if 'ext' not in old_sig.parameters:
+ parameters += [inspect.Parameter("ext", KEYWORD_ONLY)]
+ if 'request' not in old_sig.parameters:
+ parameters += [inspect.Parameter("request", KEYWORD_ONLY)]
+ new_sig = old_sig.replace(parameters=parameters)
+ wrapper.__signature__ = new_sig
+
+ # reach a bit into pytest internals to hoist the marks from
+ # our wrapped function
+ new_marks = getattr(func, "pytestmark", []) + wrapper.pytestmark
+ wrapper.pytestmark = new_marks
+
+ return wrapper
+
+ return decorator
+
+
+def _image_directories(func):
+ """
+ Compute the baseline and result image directories for testing *func*.
+
+ For test module ``foo.bar.test_baz``, the baseline directory is at
+ ``foo/bar/baseline_images/test_baz`` and the result directory at
+ ``$(pwd)/result_images/test_baz``. The result directory is created if it
+ doesn't exist.
+ """
+ module_path = Path(inspect.getfile(func))
+ baseline_dir = module_path.parent / "baseline_images" / module_path.stem
+ result_dir = Path().resolve() / "result_images" / module_path.stem
+ result_dir.mkdir(parents=True, exist_ok=True)
+ return baseline_dir, result_dir
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/decorators.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/decorators.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..f1b6c5e595cbca4899cf169a6a85b917ad98bfb4
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/decorators.pyi
@@ -0,0 +1,25 @@
+from collections.abc import Callable, Sequence
+from pathlib import Path
+from typing import Any, TypeVar
+from typing_extensions import ParamSpec
+
+from matplotlib.figure import Figure
+from matplotlib.typing import RcStyleType
+
+_P = ParamSpec("_P")
+_R = TypeVar("_R")
+
+def remove_ticks_and_titles(figure: Figure) -> None: ...
+def image_comparison(
+ baseline_images: list[str] | None,
+ extensions: list[str] | None = ...,
+ tol: float = ...,
+ freetype_version: tuple[str, str] | str | None = ...,
+ remove_text: bool = ...,
+ savefig_kwarg: dict[str, Any] | None = ...,
+ style: RcStyleType = ...,
+) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
+def check_figures_equal(
+ *, extensions: Sequence[str] = ..., tol: float = ...
+) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
+def _image_directories(func: Callable) -> tuple[Path, Path]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/exceptions.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/exceptions.py
new file mode 100644
index 0000000000000000000000000000000000000000..c39a39207747c75d768ea2dd498dfed364eb88c5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/exceptions.py
@@ -0,0 +1,4 @@
+class ImageComparisonFailure(AssertionError):
+ """
+ Raise this exception to mark a test as a comparison between two images.
+ """
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/Duration.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/Duration.py
new file mode 100644
index 0000000000000000000000000000000000000000..052c5a47c0fd8313795acfcfc2e1aaf851d05c60
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/Duration.py
@@ -0,0 +1,138 @@
+"""Duration module."""
+
+import functools
+import operator
+
+from matplotlib import _api
+
+
+class Duration:
+ """Class Duration in development."""
+
+ allowed = ["ET", "UTC"]
+
+ def __init__(self, frame, seconds):
+ """
+ Create a new Duration object.
+
+ = ERROR CONDITIONS
+ - If the input frame is not in the allowed list, an error is thrown.
+
+ = INPUT VARIABLES
+ - frame The frame of the duration. Must be 'ET' or 'UTC'
+ - seconds The number of seconds in the Duration.
+ """
+ _api.check_in_list(self.allowed, frame=frame)
+ self._frame = frame
+ self._seconds = seconds
+
+ def frame(self):
+ """Return the frame the duration is in."""
+ return self._frame
+
+ def __abs__(self):
+ """Return the absolute value of the duration."""
+ return Duration(self._frame, abs(self._seconds))
+
+ def __neg__(self):
+ """Return the negative value of this Duration."""
+ return Duration(self._frame, -self._seconds)
+
+ def seconds(self):
+ """Return the number of seconds in the Duration."""
+ return self._seconds
+
+ def __bool__(self):
+ return self._seconds != 0
+
+ def _cmp(self, op, rhs):
+ """
+ Check that *self* and *rhs* share frames; compare them using *op*.
+ """
+ self.checkSameFrame(rhs, "compare")
+ return op(self._seconds, rhs._seconds)
+
+ __eq__ = functools.partialmethod(_cmp, operator.eq)
+ __ne__ = functools.partialmethod(_cmp, operator.ne)
+ __lt__ = functools.partialmethod(_cmp, operator.lt)
+ __le__ = functools.partialmethod(_cmp, operator.le)
+ __gt__ = functools.partialmethod(_cmp, operator.gt)
+ __ge__ = functools.partialmethod(_cmp, operator.ge)
+
+ def __add__(self, rhs):
+ """
+ Add two Durations.
+
+ = ERROR CONDITIONS
+ - If the input rhs is not in the same frame, an error is thrown.
+
+ = INPUT VARIABLES
+ - rhs The Duration to add.
+
+ = RETURN VALUE
+ - Returns the sum of ourselves and the input Duration.
+ """
+ # Delay-load due to circular dependencies.
+ import matplotlib.testing.jpl_units as U
+
+ if isinstance(rhs, U.Epoch):
+ return rhs + self
+
+ self.checkSameFrame(rhs, "add")
+ return Duration(self._frame, self._seconds + rhs._seconds)
+
+ def __sub__(self, rhs):
+ """
+ Subtract two Durations.
+
+ = ERROR CONDITIONS
+ - If the input rhs is not in the same frame, an error is thrown.
+
+ = INPUT VARIABLES
+ - rhs The Duration to subtract.
+
+ = RETURN VALUE
+ - Returns the difference of ourselves and the input Duration.
+ """
+ self.checkSameFrame(rhs, "sub")
+ return Duration(self._frame, self._seconds - rhs._seconds)
+
+ def __mul__(self, rhs):
+ """
+ Scale a UnitDbl by a value.
+
+ = INPUT VARIABLES
+ - rhs The scalar to multiply by.
+
+ = RETURN VALUE
+ - Returns the scaled Duration.
+ """
+ return Duration(self._frame, self._seconds * float(rhs))
+
+ __rmul__ = __mul__
+
+ def __str__(self):
+ """Print the Duration."""
+ return f"{self._seconds:g} {self._frame}"
+
+ def __repr__(self):
+ """Print the Duration."""
+ return f"Duration('{self._frame}', {self._seconds:g})"
+
+ def checkSameFrame(self, rhs, func):
+ """
+ Check to see if frames are the same.
+
+ = ERROR CONDITIONS
+ - If the frame of the rhs Duration is not the same as our frame,
+ an error is thrown.
+
+ = INPUT VARIABLES
+ - rhs The Duration to check for the same frame
+ - func The name of the function doing the check.
+ """
+ if self._frame != rhs._frame:
+ raise ValueError(
+ f"Cannot {func} Durations with different frames.\n"
+ f"LHS: {self._frame}\n"
+ f"RHS: {rhs._frame}")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/Epoch.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/Epoch.py
new file mode 100644
index 0000000000000000000000000000000000000000..501b7fa38c792d5bc3c7c683e62e1393a63a4ff7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/Epoch.py
@@ -0,0 +1,211 @@
+"""Epoch module."""
+
+import functools
+import operator
+import math
+import datetime as DT
+
+from matplotlib import _api
+from matplotlib.dates import date2num
+
+
+class Epoch:
+ # Frame conversion offsets in seconds
+ # t(TO) = t(FROM) + allowed[ FROM ][ TO ]
+ allowed = {
+ "ET": {
+ "UTC": +64.1839,
+ },
+ "UTC": {
+ "ET": -64.1839,
+ },
+ }
+
+ def __init__(self, frame, sec=None, jd=None, daynum=None, dt=None):
+ """
+ Create a new Epoch object.
+
+ Build an epoch 1 of 2 ways:
+
+ Using seconds past a Julian date:
+ # Epoch('ET', sec=1e8, jd=2451545)
+
+ or using a matplotlib day number
+ # Epoch('ET', daynum=730119.5)
+
+ = ERROR CONDITIONS
+ - If the input units are not in the allowed list, an error is thrown.
+
+ = INPUT VARIABLES
+ - frame The frame of the epoch. Must be 'ET' or 'UTC'
+ - sec The number of seconds past the input JD.
+ - jd The Julian date of the epoch.
+ - daynum The matplotlib day number of the epoch.
+ - dt A python datetime instance.
+ """
+ if ((sec is None and jd is not None) or
+ (sec is not None and jd is None) or
+ (daynum is not None and
+ (sec is not None or jd is not None)) or
+ (daynum is None and dt is None and
+ (sec is None or jd is None)) or
+ (daynum is not None and dt is not None) or
+ (dt is not None and (sec is not None or jd is not None)) or
+ ((dt is not None) and not isinstance(dt, DT.datetime))):
+ raise ValueError(
+ "Invalid inputs. Must enter sec and jd together, "
+ "daynum by itself, or dt (must be a python datetime).\n"
+ "Sec = %s\n"
+ "JD = %s\n"
+ "dnum= %s\n"
+ "dt = %s" % (sec, jd, daynum, dt))
+
+ _api.check_in_list(self.allowed, frame=frame)
+ self._frame = frame
+
+ if dt is not None:
+ daynum = date2num(dt)
+
+ if daynum is not None:
+ # 1-JAN-0001 in JD = 1721425.5
+ jd = float(daynum) + 1721425.5
+ self._jd = math.floor(jd)
+ self._seconds = (jd - self._jd) * 86400.0
+
+ else:
+ self._seconds = float(sec)
+ self._jd = float(jd)
+
+ # Resolve seconds down to [ 0, 86400)
+ deltaDays = math.floor(self._seconds / 86400)
+ self._jd += deltaDays
+ self._seconds -= deltaDays * 86400.0
+
+ def convert(self, frame):
+ if self._frame == frame:
+ return self
+
+ offset = self.allowed[self._frame][frame]
+
+ return Epoch(frame, self._seconds + offset, self._jd)
+
+ def frame(self):
+ return self._frame
+
+ def julianDate(self, frame):
+ t = self
+ if frame != self._frame:
+ t = self.convert(frame)
+
+ return t._jd + t._seconds / 86400.0
+
+ def secondsPast(self, frame, jd):
+ t = self
+ if frame != self._frame:
+ t = self.convert(frame)
+
+ delta = t._jd - jd
+ return t._seconds + delta * 86400
+
+ def _cmp(self, op, rhs):
+ """Compare Epochs *self* and *rhs* using operator *op*."""
+ t = self
+ if self._frame != rhs._frame:
+ t = self.convert(rhs._frame)
+ if t._jd != rhs._jd:
+ return op(t._jd, rhs._jd)
+ return op(t._seconds, rhs._seconds)
+
+ __eq__ = functools.partialmethod(_cmp, operator.eq)
+ __ne__ = functools.partialmethod(_cmp, operator.ne)
+ __lt__ = functools.partialmethod(_cmp, operator.lt)
+ __le__ = functools.partialmethod(_cmp, operator.le)
+ __gt__ = functools.partialmethod(_cmp, operator.gt)
+ __ge__ = functools.partialmethod(_cmp, operator.ge)
+
+ def __add__(self, rhs):
+ """
+ Add a duration to an Epoch.
+
+ = INPUT VARIABLES
+ - rhs The Epoch to subtract.
+
+ = RETURN VALUE
+ - Returns the difference of ourselves and the input Epoch.
+ """
+ t = self
+ if self._frame != rhs.frame():
+ t = self.convert(rhs._frame)
+
+ sec = t._seconds + rhs.seconds()
+
+ return Epoch(t._frame, sec, t._jd)
+
+ def __sub__(self, rhs):
+ """
+ Subtract two Epoch's or a Duration from an Epoch.
+
+ Valid:
+ Duration = Epoch - Epoch
+ Epoch = Epoch - Duration
+
+ = INPUT VARIABLES
+ - rhs The Epoch to subtract.
+
+ = RETURN VALUE
+ - Returns either the duration between to Epoch's or the a new
+ Epoch that is the result of subtracting a duration from an epoch.
+ """
+ # Delay-load due to circular dependencies.
+ import matplotlib.testing.jpl_units as U
+
+ # Handle Epoch - Duration
+ if isinstance(rhs, U.Duration):
+ return self + -rhs
+
+ t = self
+ if self._frame != rhs._frame:
+ t = self.convert(rhs._frame)
+
+ days = t._jd - rhs._jd
+ sec = t._seconds - rhs._seconds
+
+ return U.Duration(rhs._frame, days*86400 + sec)
+
+ def __str__(self):
+ """Print the Epoch."""
+ return f"{self.julianDate(self._frame):22.15e} {self._frame}"
+
+ def __repr__(self):
+ """Print the Epoch."""
+ return str(self)
+
+ @staticmethod
+ def range(start, stop, step):
+ """
+ Generate a range of Epoch objects.
+
+ Similar to the Python range() method. Returns the range [
+ start, stop) at the requested step. Each element will be a
+ Epoch object.
+
+ = INPUT VARIABLES
+ - start The starting value of the range.
+ - stop The stop value of the range.
+ - step Step to use.
+
+ = RETURN VALUE
+ - Returns a list containing the requested Epoch values.
+ """
+ elems = []
+
+ i = 0
+ while True:
+ d = start + i * step
+ if d >= stop:
+ break
+
+ elems.append(d)
+ i += 1
+
+ return elems
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/EpochConverter.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/EpochConverter.py
new file mode 100644
index 0000000000000000000000000000000000000000..1edc2acf2b24fe4aab242455dd32679456f69b57
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/EpochConverter.py
@@ -0,0 +1,94 @@
+"""EpochConverter module containing class EpochConverter."""
+
+from matplotlib import cbook, units
+import matplotlib.dates as date_ticker
+
+__all__ = ['EpochConverter']
+
+
+class EpochConverter(units.ConversionInterface):
+ """
+ Provides Matplotlib conversion functionality for Monte Epoch and Duration
+ classes.
+ """
+
+ jdRef = 1721425.5
+
+ @staticmethod
+ def axisinfo(unit, axis):
+ # docstring inherited
+ majloc = date_ticker.AutoDateLocator()
+ majfmt = date_ticker.AutoDateFormatter(majloc)
+ return units.AxisInfo(majloc=majloc, majfmt=majfmt, label=unit)
+
+ @staticmethod
+ def float2epoch(value, unit):
+ """
+ Convert a Matplotlib floating-point date into an Epoch of the specified
+ units.
+
+ = INPUT VARIABLES
+ - value The Matplotlib floating-point date.
+ - unit The unit system to use for the Epoch.
+
+ = RETURN VALUE
+ - Returns the value converted to an Epoch in the specified time system.
+ """
+ # Delay-load due to circular dependencies.
+ import matplotlib.testing.jpl_units as U
+
+ secPastRef = value * 86400.0 * U.UnitDbl(1.0, 'sec')
+ return U.Epoch(unit, secPastRef, EpochConverter.jdRef)
+
+ @staticmethod
+ def epoch2float(value, unit):
+ """
+ Convert an Epoch value to a float suitable for plotting as a python
+ datetime object.
+
+ = INPUT VARIABLES
+ - value An Epoch or list of Epochs that need to be converted.
+ - unit The units to use for an axis with Epoch data.
+
+ = RETURN VALUE
+ - Returns the value parameter converted to floats.
+ """
+ return value.julianDate(unit) - EpochConverter.jdRef
+
+ @staticmethod
+ def duration2float(value):
+ """
+ Convert a Duration value to a float suitable for plotting as a python
+ datetime object.
+
+ = INPUT VARIABLES
+ - value A Duration or list of Durations that need to be converted.
+
+ = RETURN VALUE
+ - Returns the value parameter converted to floats.
+ """
+ return value.seconds() / 86400.0
+
+ @staticmethod
+ def convert(value, unit, axis):
+ # docstring inherited
+
+ # Delay-load due to circular dependencies.
+ import matplotlib.testing.jpl_units as U
+
+ if not cbook.is_scalar_or_string(value):
+ return [EpochConverter.convert(x, unit, axis) for x in value]
+ if unit is None:
+ unit = EpochConverter.default_units(value, axis)
+ if isinstance(value, U.Duration):
+ return EpochConverter.duration2float(value)
+ else:
+ return EpochConverter.epoch2float(value, unit)
+
+ @staticmethod
+ def default_units(value, axis):
+ # docstring inherited
+ if cbook.is_scalar_or_string(value):
+ return value.frame()
+ else:
+ return EpochConverter.default_units(value[0], axis)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/StrConverter.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/StrConverter.py
new file mode 100644
index 0000000000000000000000000000000000000000..a62d4981dc79201214dc926eaa6a4c74ffcba078
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/StrConverter.py
@@ -0,0 +1,97 @@
+"""StrConverter module containing class StrConverter."""
+
+import numpy as np
+
+import matplotlib.units as units
+
+__all__ = ['StrConverter']
+
+
+class StrConverter(units.ConversionInterface):
+ """
+ A Matplotlib converter class for string data values.
+
+ Valid units for string are:
+ - 'indexed' : Values are indexed as they are specified for plotting.
+ - 'sorted' : Values are sorted alphanumerically.
+ - 'inverted' : Values are inverted so that the first value is on top.
+ - 'sorted-inverted' : A combination of 'sorted' and 'inverted'
+ """
+
+ @staticmethod
+ def axisinfo(unit, axis):
+ # docstring inherited
+ return None
+
+ @staticmethod
+ def convert(value, unit, axis):
+ # docstring inherited
+
+ if value == []:
+ return []
+
+ # we delay loading to make matplotlib happy
+ ax = axis.axes
+ if axis is ax.xaxis:
+ isXAxis = True
+ else:
+ isXAxis = False
+
+ axis.get_major_ticks()
+ ticks = axis.get_ticklocs()
+ labels = axis.get_ticklabels()
+
+ labels = [l.get_text() for l in labels if l.get_text()]
+
+ if not labels:
+ ticks = []
+ labels = []
+
+ if not np.iterable(value):
+ value = [value]
+
+ newValues = []
+ for v in value:
+ if v not in labels and v not in newValues:
+ newValues.append(v)
+
+ labels.extend(newValues)
+
+ # DISABLED: This is disabled because matplotlib bar plots do not
+ # DISABLED: recalculate the unit conversion of the data values
+ # DISABLED: this is due to design and is not really a bug.
+ # DISABLED: If this gets changed, then we can activate the following
+ # DISABLED: block of code. Note that this works for line plots.
+ # DISABLED if unit:
+ # DISABLED if unit.find("sorted") > -1:
+ # DISABLED labels.sort()
+ # DISABLED if unit.find("inverted") > -1:
+ # DISABLED labels = labels[::-1]
+
+ # add padding (so they do not appear on the axes themselves)
+ labels = [''] + labels + ['']
+ ticks = list(range(len(labels)))
+ ticks[0] = 0.5
+ ticks[-1] = ticks[-1] - 0.5
+
+ axis.set_ticks(ticks)
+ axis.set_ticklabels(labels)
+ # we have to do the following lines to make ax.autoscale_view work
+ loc = axis.get_major_locator()
+ loc.set_bounds(ticks[0], ticks[-1])
+
+ if isXAxis:
+ ax.set_xlim(ticks[0], ticks[-1])
+ else:
+ ax.set_ylim(ticks[0], ticks[-1])
+
+ result = [ticks[labels.index(v)] for v in value]
+
+ ax.viewLim.ignore(-1)
+ return result
+
+ @staticmethod
+ def default_units(value, axis):
+ # docstring inherited
+ # The default behavior for string indexing.
+ return "indexed"
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDbl.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDbl.py
new file mode 100644
index 0000000000000000000000000000000000000000..5226c06ad54b9f7718a59e7ed19198d442c04f31
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDbl.py
@@ -0,0 +1,180 @@
+"""UnitDbl module."""
+
+import functools
+import operator
+
+from matplotlib import _api
+
+
+class UnitDbl:
+ """Class UnitDbl in development."""
+
+ # Unit conversion table. Small subset of the full one but enough
+ # to test the required functions. First field is a scale factor to
+ # convert the input units to the units of the second field. Only
+ # units in this table are allowed.
+ allowed = {
+ "m": (0.001, "km"),
+ "km": (1, "km"),
+ "mile": (1.609344, "km"),
+
+ "rad": (1, "rad"),
+ "deg": (1.745329251994330e-02, "rad"),
+
+ "sec": (1, "sec"),
+ "min": (60.0, "sec"),
+ "hour": (3600, "sec"),
+ }
+
+ _types = {
+ "km": "distance",
+ "rad": "angle",
+ "sec": "time",
+ }
+
+ def __init__(self, value, units):
+ """
+ Create a new UnitDbl object.
+
+ Units are internally converted to km, rad, and sec. The only
+ valid inputs for units are [m, km, mile, rad, deg, sec, min, hour].
+
+ The field UnitDbl.value will contain the converted value. Use
+ the convert() method to get a specific type of units back.
+
+ = ERROR CONDITIONS
+ - If the input units are not in the allowed list, an error is thrown.
+
+ = INPUT VARIABLES
+ - value The numeric value of the UnitDbl.
+ - units The string name of the units the value is in.
+ """
+ data = _api.check_getitem(self.allowed, units=units)
+ self._value = float(value * data[0])
+ self._units = data[1]
+
+ def convert(self, units):
+ """
+ Convert the UnitDbl to a specific set of units.
+
+ = ERROR CONDITIONS
+ - If the input units are not in the allowed list, an error is thrown.
+
+ = INPUT VARIABLES
+ - units The string name of the units to convert to.
+
+ = RETURN VALUE
+ - Returns the value of the UnitDbl in the requested units as a floating
+ point number.
+ """
+ if self._units == units:
+ return self._value
+ data = _api.check_getitem(self.allowed, units=units)
+ if self._units != data[1]:
+ raise ValueError(f"Error trying to convert to different units.\n"
+ f" Invalid conversion requested.\n"
+ f" UnitDbl: {self}\n"
+ f" Units: {units}\n")
+ return self._value / data[0]
+
+ def __abs__(self):
+ """Return the absolute value of this UnitDbl."""
+ return UnitDbl(abs(self._value), self._units)
+
+ def __neg__(self):
+ """Return the negative value of this UnitDbl."""
+ return UnitDbl(-self._value, self._units)
+
+ def __bool__(self):
+ """Return the truth value of a UnitDbl."""
+ return bool(self._value)
+
+ def _cmp(self, op, rhs):
+ """Check that *self* and *rhs* share units; compare them using *op*."""
+ self.checkSameUnits(rhs, "compare")
+ return op(self._value, rhs._value)
+
+ __eq__ = functools.partialmethod(_cmp, operator.eq)
+ __ne__ = functools.partialmethod(_cmp, operator.ne)
+ __lt__ = functools.partialmethod(_cmp, operator.lt)
+ __le__ = functools.partialmethod(_cmp, operator.le)
+ __gt__ = functools.partialmethod(_cmp, operator.gt)
+ __ge__ = functools.partialmethod(_cmp, operator.ge)
+
+ def _binop_unit_unit(self, op, rhs):
+ """Check that *self* and *rhs* share units; combine them using *op*."""
+ self.checkSameUnits(rhs, op.__name__)
+ return UnitDbl(op(self._value, rhs._value), self._units)
+
+ __add__ = functools.partialmethod(_binop_unit_unit, operator.add)
+ __sub__ = functools.partialmethod(_binop_unit_unit, operator.sub)
+
+ def _binop_unit_scalar(self, op, scalar):
+ """Combine *self* and *scalar* using *op*."""
+ return UnitDbl(op(self._value, scalar), self._units)
+
+ __mul__ = functools.partialmethod(_binop_unit_scalar, operator.mul)
+ __rmul__ = functools.partialmethod(_binop_unit_scalar, operator.mul)
+
+ def __str__(self):
+ """Print the UnitDbl."""
+ return f"{self._value:g} *{self._units}"
+
+ def __repr__(self):
+ """Print the UnitDbl."""
+ return f"UnitDbl({self._value:g}, '{self._units}')"
+
+ def type(self):
+ """Return the type of UnitDbl data."""
+ return self._types[self._units]
+
+ @staticmethod
+ def range(start, stop, step=None):
+ """
+ Generate a range of UnitDbl objects.
+
+ Similar to the Python range() method. Returns the range [
+ start, stop) at the requested step. Each element will be a
+ UnitDbl object.
+
+ = INPUT VARIABLES
+ - start The starting value of the range.
+ - stop The stop value of the range.
+ - step Optional step to use. If set to None, then a UnitDbl of
+ value 1 w/ the units of the start is used.
+
+ = RETURN VALUE
+ - Returns a list containing the requested UnitDbl values.
+ """
+ if step is None:
+ step = UnitDbl(1, start._units)
+
+ elems = []
+
+ i = 0
+ while True:
+ d = start + i * step
+ if d >= stop:
+ break
+
+ elems.append(d)
+ i += 1
+
+ return elems
+
+ def checkSameUnits(self, rhs, func):
+ """
+ Check to see if units are the same.
+
+ = ERROR CONDITIONS
+ - If the units of the rhs UnitDbl are not the same as our units,
+ an error is thrown.
+
+ = INPUT VARIABLES
+ - rhs The UnitDbl to check for the same units
+ - func The name of the function doing the check.
+ """
+ if self._units != rhs._units:
+ raise ValueError(f"Cannot {func} units of different types.\n"
+ f"LHS: {self._units}\n"
+ f"RHS: {rhs._units}")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.py
new file mode 100644
index 0000000000000000000000000000000000000000..23065379f58193ae2f240d7bff44aaf70f8a8dca
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDblConverter.py
@@ -0,0 +1,85 @@
+"""UnitDblConverter module containing class UnitDblConverter."""
+
+import numpy as np
+
+from matplotlib import cbook, units
+import matplotlib.projections.polar as polar
+
+__all__ = ['UnitDblConverter']
+
+
+# A special function for use with the matplotlib FuncFormatter class
+# for formatting axes with radian units.
+# This was copied from matplotlib example code.
+def rad_fn(x, pos=None):
+ """Radian function formatter."""
+ n = int((x / np.pi) * 2.0 + 0.25)
+ if n == 0:
+ return str(x)
+ elif n == 1:
+ return r'$\pi/2$'
+ elif n == 2:
+ return r'$\pi$'
+ elif n % 2 == 0:
+ return fr'${n//2}\pi$'
+ else:
+ return fr'${n}\pi/2$'
+
+
+class UnitDblConverter(units.ConversionInterface):
+ """
+ Provides Matplotlib conversion functionality for the Monte UnitDbl class.
+ """
+ # default for plotting
+ defaults = {
+ "distance": 'km',
+ "angle": 'deg',
+ "time": 'sec',
+ }
+
+ @staticmethod
+ def axisinfo(unit, axis):
+ # docstring inherited
+
+ # Delay-load due to circular dependencies.
+ import matplotlib.testing.jpl_units as U
+
+ # Check to see if the value used for units is a string unit value
+ # or an actual instance of a UnitDbl so that we can use the unit
+ # value for the default axis label value.
+ if unit:
+ label = unit if isinstance(unit, str) else unit.label()
+ else:
+ label = None
+
+ if label == "deg" and isinstance(axis.axes, polar.PolarAxes):
+ # If we want degrees for a polar plot, use the PolarPlotFormatter
+ majfmt = polar.PolarAxes.ThetaFormatter()
+ else:
+ majfmt = U.UnitDblFormatter(useOffset=False)
+
+ return units.AxisInfo(majfmt=majfmt, label=label)
+
+ @staticmethod
+ def convert(value, unit, axis):
+ # docstring inherited
+ if not cbook.is_scalar_or_string(value):
+ return [UnitDblConverter.convert(x, unit, axis) for x in value]
+ # If no units were specified, then get the default units to use.
+ if unit is None:
+ unit = UnitDblConverter.default_units(value, axis)
+ # Convert the incoming UnitDbl value/values to float/floats
+ if isinstance(axis.axes, polar.PolarAxes) and value.type() == "angle":
+ # Guarantee that units are radians for polar plots.
+ return value.convert("rad")
+ return value.convert(unit)
+
+ @staticmethod
+ def default_units(value, axis):
+ # docstring inherited
+ # Determine the default units based on the user preferences set for
+ # default units when printing a UnitDbl.
+ if cbook.is_scalar_or_string(value):
+ return UnitDblConverter.defaults[value.type()]
+ else:
+ return UnitDblConverter.default_units(value[0], axis)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDblFormatter.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDblFormatter.py
new file mode 100644
index 0000000000000000000000000000000000000000..30a9914015bc7eb955c88e562a771591b82ad2e8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/UnitDblFormatter.py
@@ -0,0 +1,28 @@
+"""UnitDblFormatter module containing class UnitDblFormatter."""
+
+import matplotlib.ticker as ticker
+
+__all__ = ['UnitDblFormatter']
+
+
+class UnitDblFormatter(ticker.ScalarFormatter):
+ """
+ The formatter for UnitDbl data types.
+
+ This allows for formatting with the unit string.
+ """
+
+ def __call__(self, x, pos=None):
+ # docstring inherited
+ if len(self.locs) == 0:
+ return ''
+ else:
+ return f'{x:.12}'
+
+ def format_data_short(self, value):
+ # docstring inherited
+ return f'{value:.12}'
+
+ def format_data(self, value):
+ # docstring inherited
+ return f'{value:.12}'
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..b8caa9a8957a250b78712c25175bec415507e416
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/jpl_units/__init__.py
@@ -0,0 +1,76 @@
+"""
+A sample set of units for use with testing unit conversion
+of Matplotlib routines. These are used because they use very strict
+enforcement of unitized data which will test the entire spectrum of how
+unitized data might be used (it is not always meaningful to convert to
+a float without specific units given).
+
+UnitDbl is essentially a unitized floating point number. It has a
+minimal set of supported units (enough for testing purposes). All
+of the mathematical operation are provided to fully test any behaviour
+that might occur with unitized data. Remember that unitized data has
+rules as to how it can be applied to one another (a value of distance
+cannot be added to a value of time). Thus we need to guard against any
+accidental "default" conversion that will strip away the meaning of the
+data and render it neutered.
+
+Epoch is different than a UnitDbl of time. Time is something that can be
+measured where an Epoch is a specific moment in time. Epochs are typically
+referenced as an offset from some predetermined epoch.
+
+A difference of two epochs is a Duration. The distinction between a Duration
+and a UnitDbl of time is made because an Epoch can have different frames (or
+units). In the case of our test Epoch class the two allowed frames are 'UTC'
+and 'ET' (Note that these are rough estimates provided for testing purposes
+and should not be used in production code where accuracy of time frames is
+desired). As such a Duration also has a frame of reference and therefore needs
+to be called out as different that a simple measurement of time since a delta-t
+in one frame may not be the same in another.
+"""
+
+from .Duration import Duration
+from .Epoch import Epoch
+from .UnitDbl import UnitDbl
+
+from .StrConverter import StrConverter
+from .EpochConverter import EpochConverter
+from .UnitDblConverter import UnitDblConverter
+
+from .UnitDblFormatter import UnitDblFormatter
+
+
+__version__ = "1.0"
+
+__all__ = [
+ 'register',
+ 'Duration',
+ 'Epoch',
+ 'UnitDbl',
+ 'UnitDblFormatter',
+ ]
+
+
+def register():
+ """Register the unit conversion classes with matplotlib."""
+ import matplotlib.units as mplU
+
+ mplU.registry[str] = StrConverter()
+ mplU.registry[Epoch] = EpochConverter()
+ mplU.registry[Duration] = EpochConverter()
+ mplU.registry[UnitDbl] = UnitDblConverter()
+
+
+# Some default unit instances
+# Distances
+m = UnitDbl(1.0, "m")
+km = UnitDbl(1.0, "km")
+mile = UnitDbl(1.0, "mile")
+# Angles
+deg = UnitDbl(1.0, "deg")
+rad = UnitDbl(1.0, "rad")
+# Time
+sec = UnitDbl(1.0, "sec")
+min = UnitDbl(1.0, "min")
+hr = UnitDbl(1.0, "hour")
+day = UnitDbl(24.0, "hour")
+sec = UnitDbl(1.0, "sec")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/widgets.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/widgets.py
new file mode 100644
index 0000000000000000000000000000000000000000..3962567aa7c03eb978db53e3d6007446bb177d28
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/widgets.py
@@ -0,0 +1,119 @@
+"""
+========================
+Widget testing utilities
+========================
+
+See also :mod:`matplotlib.tests.test_widgets`.
+"""
+
+from unittest import mock
+
+import matplotlib.pyplot as plt
+
+
+def get_ax():
+ """Create a plot and return its Axes."""
+ fig, ax = plt.subplots(1, 1)
+ ax.plot([0, 200], [0, 200])
+ ax.set_aspect(1.0)
+ fig.canvas.draw()
+ return ax
+
+
+def noop(*args, **kwargs):
+ pass
+
+
+def mock_event(ax, button=1, xdata=0, ydata=0, key=None, step=1):
+ r"""
+ Create a mock event that can stand in for `.Event` and its subclasses.
+
+ This event is intended to be used in tests where it can be passed into
+ event handling functions.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The Axes the event will be in.
+ xdata : float
+ x coord of mouse in data coords.
+ ydata : float
+ y coord of mouse in data coords.
+ button : None or `MouseButton` or {'up', 'down'}
+ The mouse button pressed in this event (see also `.MouseEvent`).
+ key : None or str
+ The key pressed when the mouse event triggered (see also `.KeyEvent`).
+ step : int
+ Number of scroll steps (positive for 'up', negative for 'down').
+
+ Returns
+ -------
+ event
+ A `.Event`\-like Mock instance.
+ """
+ event = mock.Mock()
+ event.button = button
+ event.x, event.y = ax.transData.transform([(xdata, ydata),
+ (xdata, ydata)])[0]
+ event.xdata, event.ydata = xdata, ydata
+ event.inaxes = ax
+ event.canvas = ax.get_figure(root=True).canvas
+ event.key = key
+ event.step = step
+ event.guiEvent = None
+ event.name = 'Custom'
+ return event
+
+
+def do_event(tool, etype, button=1, xdata=0, ydata=0, key=None, step=1):
+ """
+ Trigger an event on the given tool.
+
+ Parameters
+ ----------
+ tool : matplotlib.widgets.AxesWidget
+ etype : str
+ The event to trigger.
+ xdata : float
+ x coord of mouse in data coords.
+ ydata : float
+ y coord of mouse in data coords.
+ button : None or `MouseButton` or {'up', 'down'}
+ The mouse button pressed in this event (see also `.MouseEvent`).
+ key : None or str
+ The key pressed when the mouse event triggered (see also `.KeyEvent`).
+ step : int
+ Number of scroll steps (positive for 'up', negative for 'down').
+ """
+ event = mock_event(tool.ax, button, xdata, ydata, key, step)
+ func = getattr(tool, etype)
+ func(event)
+
+
+def click_and_drag(tool, start, end, key=None):
+ """
+ Helper to simulate a mouse drag operation.
+
+ Parameters
+ ----------
+ tool : `~matplotlib.widgets.Widget`
+ start : [float, float]
+ Starting point in data coordinates.
+ end : [float, float]
+ End point in data coordinates.
+ key : None or str
+ An optional key that is pressed during the whole operation
+ (see also `.KeyEvent`).
+ """
+ if key is not None:
+ # Press key
+ do_event(tool, 'on_key_press', xdata=start[0], ydata=start[1],
+ button=1, key=key)
+ # Click, move, and release mouse
+ do_event(tool, 'press', xdata=start[0], ydata=start[1], button=1)
+ do_event(tool, 'onmove', xdata=end[0], ydata=end[1], button=1)
+ do_event(tool, 'release', xdata=end[0], ydata=end[1], button=1)
+ if key is not None:
+ # Release key
+ do_event(tool, 'on_key_release', xdata=end[0], ydata=end[1],
+ button=1, key=key)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/widgets.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/widgets.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..858ff457158283bae9db974e05098890ef5ac260
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/testing/widgets.pyi
@@ -0,0 +1,31 @@
+from typing import Any, Literal
+
+from matplotlib.axes import Axes
+from matplotlib.backend_bases import Event, MouseButton
+from matplotlib.widgets import AxesWidget, Widget
+
+def get_ax() -> Axes: ...
+def noop(*args: Any, **kwargs: Any) -> None: ...
+def mock_event(
+ ax: Axes,
+ button: MouseButton | int | Literal["up", "down"] | None = ...,
+ xdata: float = ...,
+ ydata: float = ...,
+ key: str | None = ...,
+ step: int = ...,
+) -> Event: ...
+def do_event(
+ tool: AxesWidget,
+ etype: str,
+ button: MouseButton | int | Literal["up", "down"] | None = ...,
+ xdata: float = ...,
+ ydata: float = ...,
+ key: str | None = ...,
+ step: int = ...,
+) -> None: ...
+def click_and_drag(
+ tool: Widget,
+ start: tuple[float, float],
+ end: tuple[float, float],
+ key: str | None = ...,
+) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_gridspec.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_gridspec.py
new file mode 100644
index 0000000000000000000000000000000000000000..deda73c3b6abfc08fb921b6cbe395aca7efd3613
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_gridspec.py
@@ -0,0 +1,50 @@
+import matplotlib.gridspec as gridspec
+import matplotlib.pyplot as plt
+import pytest
+
+
+def test_equal():
+ gs = gridspec.GridSpec(2, 1)
+ assert gs[0, 0] == gs[0, 0]
+ assert gs[:, 0] == gs[:, 0]
+
+
+def test_width_ratios():
+ """
+ Addresses issue #5835.
+ See at https://github.com/matplotlib/matplotlib/issues/5835.
+ """
+ with pytest.raises(ValueError):
+ gridspec.GridSpec(1, 1, width_ratios=[2, 1, 3])
+
+
+def test_height_ratios():
+ """
+ Addresses issue #5835.
+ See at https://github.com/matplotlib/matplotlib/issues/5835.
+ """
+ with pytest.raises(ValueError):
+ gridspec.GridSpec(1, 1, height_ratios=[2, 1, 3])
+
+
+def test_repr():
+ ss = gridspec.GridSpec(3, 3)[2, 1:3]
+ assert repr(ss) == "GridSpec(3, 3)[2:3, 1:3]"
+
+ ss = gridspec.GridSpec(2, 2,
+ height_ratios=(3, 1),
+ width_ratios=(1, 3))
+ assert repr(ss) == \
+ "GridSpec(2, 2, height_ratios=(3, 1), width_ratios=(1, 3))"
+
+
+def test_subplotspec_args():
+ fig, axs = plt.subplots(1, 2)
+ # should work:
+ gs = gridspec.GridSpecFromSubplotSpec(2, 1,
+ subplot_spec=axs[0].get_subplotspec())
+ assert gs.get_topmost_subplotspec() == axs[0].get_subplotspec()
+ with pytest.raises(TypeError, match="subplot_spec must be type SubplotSpec"):
+ gs = gridspec.GridSpecFromSubplotSpec(2, 1, subplot_spec=axs[0])
+ with pytest.raises(TypeError, match="subplot_spec must be type SubplotSpec"):
+ gs = gridspec.GridSpecFromSubplotSpec(2, 1, subplot_spec=axs)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_rcparams.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_rcparams.py
new file mode 100644
index 0000000000000000000000000000000000000000..bea5e90ea4e54cb1ea480b2b20c7eb72e087bdcb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_rcparams.py
@@ -0,0 +1,682 @@
+import copy
+import os
+import subprocess
+import sys
+from unittest import mock
+
+from cycler import cycler, Cycler
+from packaging.version import parse as parse_version
+import pytest
+
+import matplotlib as mpl
+from matplotlib import _api, _c_internal_utils
+import matplotlib.pyplot as plt
+import matplotlib.colors as mcolors
+import numpy as np
+from matplotlib.rcsetup import (
+ validate_bool,
+ validate_color,
+ validate_colorlist,
+ _validate_color_or_linecolor,
+ validate_cycler,
+ validate_float,
+ validate_fontstretch,
+ validate_fontweight,
+ validate_hatch,
+ validate_hist_bins,
+ validate_int,
+ validate_markevery,
+ validate_stringlist,
+ validate_sketch,
+ _validate_linestyle,
+ _listify_validator)
+from matplotlib.testing import subprocess_run_for_testing
+
+
+def test_rcparams(tmp_path):
+ mpl.rc('text', usetex=False)
+ mpl.rc('lines', linewidth=22)
+
+ usetex = mpl.rcParams['text.usetex']
+ linewidth = mpl.rcParams['lines.linewidth']
+
+ rcpath = tmp_path / 'test_rcparams.rc'
+ rcpath.write_text('lines.linewidth: 33', encoding='utf-8')
+
+ # test context given dictionary
+ with mpl.rc_context(rc={'text.usetex': not usetex}):
+ assert mpl.rcParams['text.usetex'] == (not usetex)
+ assert mpl.rcParams['text.usetex'] == usetex
+
+ # test context given filename (mpl.rc sets linewidth to 33)
+ with mpl.rc_context(fname=rcpath):
+ assert mpl.rcParams['lines.linewidth'] == 33
+ assert mpl.rcParams['lines.linewidth'] == linewidth
+
+ # test context given filename and dictionary
+ with mpl.rc_context(fname=rcpath, rc={'lines.linewidth': 44}):
+ assert mpl.rcParams['lines.linewidth'] == 44
+ assert mpl.rcParams['lines.linewidth'] == linewidth
+
+ # test context as decorator (and test reusability, by calling func twice)
+ @mpl.rc_context({'lines.linewidth': 44})
+ def func():
+ assert mpl.rcParams['lines.linewidth'] == 44
+
+ func()
+ func()
+
+ # test rc_file
+ mpl.rc_file(rcpath)
+ assert mpl.rcParams['lines.linewidth'] == 33
+
+
+def test_RcParams_class():
+ rc = mpl.RcParams({'font.cursive': ['Apple Chancery',
+ 'Textile',
+ 'Zapf Chancery',
+ 'cursive'],
+ 'font.family': 'sans-serif',
+ 'font.weight': 'normal',
+ 'font.size': 12})
+
+ expected_repr = """
+RcParams({'font.cursive': ['Apple Chancery',
+ 'Textile',
+ 'Zapf Chancery',
+ 'cursive'],
+ 'font.family': ['sans-serif'],
+ 'font.size': 12.0,
+ 'font.weight': 'normal'})""".lstrip()
+
+ assert expected_repr == repr(rc)
+
+ expected_str = """
+font.cursive: ['Apple Chancery', 'Textile', 'Zapf Chancery', 'cursive']
+font.family: ['sans-serif']
+font.size: 12.0
+font.weight: normal""".lstrip()
+
+ assert expected_str == str(rc)
+
+ # test the find_all functionality
+ assert ['font.cursive', 'font.size'] == sorted(rc.find_all('i[vz]'))
+ assert ['font.family'] == list(rc.find_all('family'))
+
+
+def test_rcparams_update():
+ rc = mpl.RcParams({'figure.figsize': (3.5, 42)})
+ bad_dict = {'figure.figsize': (3.5, 42, 1)}
+ # make sure validation happens on input
+ with pytest.raises(ValueError):
+ rc.update(bad_dict)
+
+
+def test_rcparams_init():
+ with pytest.raises(ValueError):
+ mpl.RcParams({'figure.figsize': (3.5, 42, 1)})
+
+
+def test_nargs_cycler():
+ from matplotlib.rcsetup import cycler as ccl
+ with pytest.raises(TypeError, match='3 were given'):
+ # cycler() takes 0-2 arguments.
+ ccl(ccl(color=list('rgb')), 2, 3)
+
+
+def test_Bug_2543():
+ # Test that it possible to add all values to itself / deepcopy
+ # https://github.com/matplotlib/matplotlib/issues/2543
+ # We filter warnings at this stage since a number of them are raised
+ # for deprecated rcparams as they should. We don't want these in the
+ # printed in the test suite.
+ with _api.suppress_matplotlib_deprecation_warning():
+ with mpl.rc_context():
+ _copy = mpl.rcParams.copy()
+ for key in _copy:
+ mpl.rcParams[key] = _copy[key]
+ with mpl.rc_context():
+ copy.deepcopy(mpl.rcParams)
+ with pytest.raises(ValueError):
+ validate_bool(None)
+ with pytest.raises(ValueError):
+ with mpl.rc_context():
+ mpl.rcParams['svg.fonttype'] = True
+
+
+legend_color_tests = [
+ ('face', {'color': 'r'}, mcolors.to_rgba('r')),
+ ('face', {'color': 'inherit', 'axes.facecolor': 'r'},
+ mcolors.to_rgba('r')),
+ ('face', {'color': 'g', 'axes.facecolor': 'r'}, mcolors.to_rgba('g')),
+ ('edge', {'color': 'r'}, mcolors.to_rgba('r')),
+ ('edge', {'color': 'inherit', 'axes.edgecolor': 'r'},
+ mcolors.to_rgba('r')),
+ ('edge', {'color': 'g', 'axes.facecolor': 'r'}, mcolors.to_rgba('g'))
+]
+legend_color_test_ids = [
+ 'same facecolor',
+ 'inherited facecolor',
+ 'different facecolor',
+ 'same edgecolor',
+ 'inherited edgecolor',
+ 'different facecolor',
+]
+
+
+@pytest.mark.parametrize('color_type, param_dict, target', legend_color_tests,
+ ids=legend_color_test_ids)
+def test_legend_colors(color_type, param_dict, target):
+ param_dict[f'legend.{color_type}color'] = param_dict.pop('color')
+ get_func = f'get_{color_type}color'
+
+ with mpl.rc_context(param_dict):
+ _, ax = plt.subplots()
+ ax.plot(range(3), label='test')
+ leg = ax.legend()
+ assert getattr(leg.legendPatch, get_func)() == target
+
+
+def test_mfc_rcparams():
+ mpl.rcParams['lines.markerfacecolor'] = 'r'
+ ln = mpl.lines.Line2D([1, 2], [1, 2])
+ assert ln.get_markerfacecolor() == 'r'
+
+
+def test_mec_rcparams():
+ mpl.rcParams['lines.markeredgecolor'] = 'r'
+ ln = mpl.lines.Line2D([1, 2], [1, 2])
+ assert ln.get_markeredgecolor() == 'r'
+
+
+def test_axes_titlecolor_rcparams():
+ mpl.rcParams['axes.titlecolor'] = 'r'
+ _, ax = plt.subplots()
+ title = ax.set_title("Title")
+ assert title.get_color() == 'r'
+
+
+def test_Issue_1713(tmp_path):
+ rcpath = tmp_path / 'test_rcparams.rc'
+ rcpath.write_text('timezone: UTC', encoding='utf-8')
+ with mock.patch('locale.getpreferredencoding', return_value='UTF-32-BE'):
+ rc = mpl.rc_params_from_file(rcpath, True, False)
+ assert rc.get('timezone') == 'UTC'
+
+
+def test_animation_frame_formats():
+ # Animation frame_format should allow any of the following
+ # if any of these are not allowed, an exception will be raised
+ # test for gh issue #17908
+ for fmt in ['png', 'jpeg', 'tiff', 'raw', 'rgba', 'ppm',
+ 'sgi', 'bmp', 'pbm', 'svg']:
+ mpl.rcParams['animation.frame_format'] = fmt
+
+
+def generate_validator_testcases(valid):
+ validation_tests = (
+ {'validator': validate_bool,
+ 'success': (*((_, True) for _ in
+ ('t', 'y', 'yes', 'on', 'true', '1', 1, True)),
+ *((_, False) for _ in
+ ('f', 'n', 'no', 'off', 'false', '0', 0, False))),
+ 'fail': ((_, ValueError)
+ for _ in ('aardvark', 2, -1, [], ))
+ },
+ {'validator': validate_stringlist,
+ 'success': (('', []),
+ ('a,b', ['a', 'b']),
+ ('aardvark', ['aardvark']),
+ ('aardvark, ', ['aardvark']),
+ ('aardvark, ,', ['aardvark']),
+ (['a', 'b'], ['a', 'b']),
+ (('a', 'b'), ['a', 'b']),
+ (iter(['a', 'b']), ['a', 'b']),
+ (np.array(['a', 'b']), ['a', 'b']),
+ ),
+ 'fail': ((set(), ValueError),
+ (1, ValueError),
+ )
+ },
+ {'validator': _listify_validator(validate_int, n=2),
+ 'success': ((_, [1, 2])
+ for _ in ('1, 2', [1.5, 2.5], [1, 2],
+ (1, 2), np.array((1, 2)))),
+ 'fail': ((_, ValueError)
+ for _ in ('aardvark', ('a', 1),
+ (1, 2, 3)
+ ))
+ },
+ {'validator': _listify_validator(validate_float, n=2),
+ 'success': ((_, [1.5, 2.5])
+ for _ in ('1.5, 2.5', [1.5, 2.5], [1.5, 2.5],
+ (1.5, 2.5), np.array((1.5, 2.5)))),
+ 'fail': ((_, ValueError)
+ for _ in ('aardvark', ('a', 1), (1, 2, 3), (None, ), None))
+ },
+ {'validator': validate_cycler,
+ 'success': (('cycler("color", "rgb")',
+ cycler("color", 'rgb')),
+ (cycler('linestyle', ['-', '--']),
+ cycler('linestyle', ['-', '--'])),
+ ("""(cycler("color", ["r", "g", "b"]) +
+ cycler("mew", [2, 3, 5]))""",
+ (cycler("color", 'rgb') +
+ cycler("markeredgewidth", [2, 3, 5]))),
+ ("cycler(c='rgb', lw=[1, 2, 3])",
+ cycler('color', 'rgb') + cycler('linewidth', [1, 2, 3])),
+ ("cycler('c', 'rgb') * cycler('linestyle', ['-', '--'])",
+ (cycler('color', 'rgb') *
+ cycler('linestyle', ['-', '--']))),
+ (cycler('ls', ['-', '--']),
+ cycler('linestyle', ['-', '--'])),
+ (cycler(mew=[2, 5]),
+ cycler('markeredgewidth', [2, 5])),
+ ),
+ # This is *so* incredibly important: validate_cycler() eval's
+ # an arbitrary string! I think I have it locked down enough,
+ # and that is what this is testing.
+ # TODO: Note that these tests are actually insufficient, as it may
+ # be that they raised errors, but still did an action prior to
+ # raising the exception. We should devise some additional tests
+ # for that...
+ 'fail': ((4, ValueError), # Gotta be a string or Cycler object
+ ('cycler("bleh, [])', ValueError), # syntax error
+ ('Cycler("linewidth", [1, 2, 3])',
+ ValueError), # only 'cycler()' function is allowed
+ # do not allow dunder in string literals
+ ("cycler('c', [j.__class__(j) for j in ['r', 'b']])",
+ ValueError),
+ ("cycler('c', [j. __class__(j) for j in ['r', 'b']])",
+ ValueError),
+ ("cycler('c', [j.\t__class__(j) for j in ['r', 'b']])",
+ ValueError),
+ ("cycler('c', [j.\u000c__class__(j) for j in ['r', 'b']])",
+ ValueError),
+ ("cycler('c', [j.__class__(j).lower() for j in ['r', 'b']])",
+ ValueError),
+ ('1 + 2', ValueError), # doesn't produce a Cycler object
+ ('os.system("echo Gotcha")', ValueError), # os not available
+ ('import os', ValueError), # should not be able to import
+ ('def badjuju(a): return a; badjuju(cycler("color", "rgb"))',
+ ValueError), # Should not be able to define anything
+ # even if it does return a cycler
+ ('cycler("waka", [1, 2, 3])', ValueError), # not a property
+ ('cycler(c=[1, 2, 3])', ValueError), # invalid values
+ ("cycler(lw=['a', 'b', 'c'])", ValueError), # invalid values
+ (cycler('waka', [1, 3, 5]), ValueError), # not a property
+ (cycler('color', ['C1', 'r', 'g']), ValueError) # no CN
+ )
+ },
+ {'validator': validate_hatch,
+ 'success': (('--|', '--|'), ('\\oO', '\\oO'),
+ ('/+*/.x', '/+*/.x'), ('', '')),
+ 'fail': (('--_', ValueError),
+ (8, ValueError),
+ ('X', ValueError)),
+ },
+ {'validator': validate_colorlist,
+ 'success': (('r,g,b', ['r', 'g', 'b']),
+ (['r', 'g', 'b'], ['r', 'g', 'b']),
+ ('r, ,', ['r']),
+ (['', 'g', 'blue'], ['g', 'blue']),
+ ([np.array([1, 0, 0]), np.array([0, 1, 0])],
+ np.array([[1, 0, 0], [0, 1, 0]])),
+ (np.array([[1, 0, 0], [0, 1, 0]]),
+ np.array([[1, 0, 0], [0, 1, 0]])),
+ ),
+ 'fail': (('fish', ValueError),
+ ),
+ },
+ {'validator': validate_color,
+ 'success': (('None', 'none'),
+ ('none', 'none'),
+ ('AABBCC', '#AABBCC'), # RGB hex code
+ ('AABBCC00', '#AABBCC00'), # RGBA hex code
+ ('tab:blue', 'tab:blue'), # named color
+ ('C12', 'C12'), # color from cycle
+ ('(0, 1, 0)', (0.0, 1.0, 0.0)), # RGB tuple
+ ((0, 1, 0), (0, 1, 0)), # non-string version
+ ('(0, 1, 0, 1)', (0.0, 1.0, 0.0, 1.0)), # RGBA tuple
+ ((0, 1, 0, 1), (0, 1, 0, 1)), # non-string version
+ ),
+ 'fail': (('tab:veryblue', ValueError), # invalid name
+ ('(0, 1)', ValueError), # tuple with length < 3
+ ('(0, 1, 0, 1, 0)', ValueError), # tuple with length > 4
+ ('(0, 1, none)', ValueError), # cannot cast none to float
+ ('(0, 1, "0.5")', ValueError), # last one not a float
+ ),
+ },
+ {'validator': _validate_color_or_linecolor,
+ 'success': (('linecolor', 'linecolor'),
+ ('markerfacecolor', 'markerfacecolor'),
+ ('mfc', 'markerfacecolor'),
+ ('markeredgecolor', 'markeredgecolor'),
+ ('mec', 'markeredgecolor')
+ ),
+ 'fail': (('line', ValueError),
+ ('marker', ValueError)
+ )
+ },
+ {'validator': validate_hist_bins,
+ 'success': (('auto', 'auto'),
+ ('fd', 'fd'),
+ ('10', 10),
+ ('1, 2, 3', [1, 2, 3]),
+ ([1, 2, 3], [1, 2, 3]),
+ (np.arange(15), np.arange(15))
+ ),
+ 'fail': (('aardvark', ValueError),
+ )
+ },
+ {'validator': validate_markevery,
+ 'success': ((None, None),
+ (1, 1),
+ (0.1, 0.1),
+ ((1, 1), (1, 1)),
+ ((0.1, 0.1), (0.1, 0.1)),
+ ([1, 2, 3], [1, 2, 3]),
+ (slice(2), slice(None, 2, None)),
+ (slice(1, 2, 3), slice(1, 2, 3))
+ ),
+ 'fail': (((1, 2, 3), TypeError),
+ ([1, 2, 0.3], TypeError),
+ (['a', 2, 3], TypeError),
+ ([1, 2, 'a'], TypeError),
+ ((0.1, 0.2, 0.3), TypeError),
+ ((0.1, 2, 3), TypeError),
+ ((1, 0.2, 0.3), TypeError),
+ ((1, 0.1), TypeError),
+ ((0.1, 1), TypeError),
+ (('abc'), TypeError),
+ ((1, 'a'), TypeError),
+ ((0.1, 'b'), TypeError),
+ (('a', 1), TypeError),
+ (('a', 0.1), TypeError),
+ ('abc', TypeError),
+ ('a', TypeError),
+ (object(), TypeError)
+ )
+ },
+ {'validator': _validate_linestyle,
+ 'success': (('-', '-'), ('solid', 'solid'),
+ ('--', '--'), ('dashed', 'dashed'),
+ ('-.', '-.'), ('dashdot', 'dashdot'),
+ (':', ':'), ('dotted', 'dotted'),
+ ('', ''), (' ', ' '),
+ ('None', 'none'), ('none', 'none'),
+ ('DoTtEd', 'dotted'), # case-insensitive
+ ('1, 3', (0, (1, 3))),
+ ([1.23, 456], (0, [1.23, 456.0])),
+ ([1, 2, 3, 4], (0, [1.0, 2.0, 3.0, 4.0])),
+ ((0, [1, 2]), (0, [1, 2])),
+ ((-1, [1, 2]), (-1, [1, 2])),
+ ),
+ 'fail': (('aardvark', ValueError), # not a valid string
+ (b'dotted', ValueError),
+ ('dotted'.encode('utf-16'), ValueError),
+ ([1, 2, 3], ValueError), # sequence with odd length
+ (1.23, ValueError), # not a sequence
+ (("a", [1, 2]), ValueError), # wrong explicit offset
+ ((None, [1, 2]), ValueError), # wrong explicit offset
+ ((1, [1, 2, 3]), ValueError), # odd length sequence
+ (([1, 2], 1), ValueError), # inverted offset/onoff
+ )
+ },
+ )
+
+ for validator_dict in validation_tests:
+ validator = validator_dict['validator']
+ if valid:
+ for arg, target in validator_dict['success']:
+ yield validator, arg, target
+ else:
+ for arg, error_type in validator_dict['fail']:
+ yield validator, arg, error_type
+
+
+@pytest.mark.parametrize('validator, arg, target',
+ generate_validator_testcases(True))
+def test_validator_valid(validator, arg, target):
+ res = validator(arg)
+ if isinstance(target, np.ndarray):
+ np.testing.assert_equal(res, target)
+ elif not isinstance(target, Cycler):
+ assert res == target
+ else:
+ # Cyclers can't simply be asserted equal. They don't implement __eq__
+ assert list(res) == list(target)
+
+
+@pytest.mark.parametrize('validator, arg, exception_type',
+ generate_validator_testcases(False))
+def test_validator_invalid(validator, arg, exception_type):
+ with pytest.raises(exception_type):
+ validator(arg)
+
+
+@pytest.mark.parametrize('weight, parsed_weight', [
+ ('bold', 'bold'),
+ ('BOLD', ValueError), # weight is case-sensitive
+ (100, 100),
+ ('100', 100),
+ (np.array(100), 100),
+ # fractional fontweights are not defined. This should actually raise a
+ # ValueError, but historically did not.
+ (20.6, 20),
+ ('20.6', ValueError),
+ ([100], ValueError),
+])
+def test_validate_fontweight(weight, parsed_weight):
+ if parsed_weight is ValueError:
+ with pytest.raises(ValueError):
+ validate_fontweight(weight)
+ else:
+ assert validate_fontweight(weight) == parsed_weight
+
+
+@pytest.mark.parametrize('stretch, parsed_stretch', [
+ ('expanded', 'expanded'),
+ ('EXPANDED', ValueError), # stretch is case-sensitive
+ (100, 100),
+ ('100', 100),
+ (np.array(100), 100),
+ # fractional fontweights are not defined. This should actually raise a
+ # ValueError, but historically did not.
+ (20.6, 20),
+ ('20.6', ValueError),
+ ([100], ValueError),
+])
+def test_validate_fontstretch(stretch, parsed_stretch):
+ if parsed_stretch is ValueError:
+ with pytest.raises(ValueError):
+ validate_fontstretch(stretch)
+ else:
+ assert validate_fontstretch(stretch) == parsed_stretch
+
+
+def test_keymaps():
+ key_list = [k for k in mpl.rcParams if 'keymap' in k]
+ for k in key_list:
+ assert isinstance(mpl.rcParams[k], list)
+
+
+def test_no_backend_reset_rccontext():
+ assert mpl.rcParams['backend'] != 'module://aardvark'
+ with mpl.rc_context():
+ mpl.rcParams['backend'] = 'module://aardvark'
+ assert mpl.rcParams['backend'] == 'module://aardvark'
+
+
+def test_rcparams_reset_after_fail():
+ # There was previously a bug that meant that if rc_context failed and
+ # raised an exception due to issues in the supplied rc parameters, the
+ # global rc parameters were left in a modified state.
+ with mpl.rc_context(rc={'text.usetex': False}):
+ assert mpl.rcParams['text.usetex'] is False
+ with pytest.raises(KeyError):
+ with mpl.rc_context(rc={'text.usetex': True, 'test.blah': True}):
+ pass
+ assert mpl.rcParams['text.usetex'] is False
+
+
+@pytest.mark.skipif(sys.platform != "linux", reason="Linux only")
+def test_backend_fallback_headless_invalid_backend(tmp_path):
+ env = {**os.environ,
+ "DISPLAY": "", "WAYLAND_DISPLAY": "",
+ "MPLBACKEND": "", "MPLCONFIGDIR": str(tmp_path)}
+ # plotting should fail with the tkagg backend selected in a headless environment
+ with pytest.raises(subprocess.CalledProcessError):
+ subprocess_run_for_testing(
+ [sys.executable, "-c",
+ "import matplotlib;"
+ "matplotlib.use('tkagg');"
+ "import matplotlib.pyplot;"
+ "matplotlib.pyplot.plot(42);"
+ ],
+ env=env, check=True, stderr=subprocess.DEVNULL)
+
+
+@pytest.mark.skipif(sys.platform != "linux", reason="Linux only")
+def test_backend_fallback_headless_auto_backend(tmp_path):
+ # specify a headless mpl environment, but request a graphical (tk) backend
+ env = {**os.environ,
+ "DISPLAY": "", "WAYLAND_DISPLAY": "",
+ "MPLBACKEND": "TkAgg", "MPLCONFIGDIR": str(tmp_path)}
+
+ # allow fallback to an available interactive backend explicitly in configuration
+ rc_path = tmp_path / "matplotlibrc"
+ rc_path.write_text("backend_fallback: true")
+
+ # plotting should succeed, by falling back to use the generic agg backend
+ backend = subprocess_run_for_testing(
+ [sys.executable, "-c",
+ "import matplotlib.pyplot;"
+ "matplotlib.pyplot.plot(42);"
+ "print(matplotlib.get_backend());"
+ ],
+ env=env, text=True, check=True, capture_output=True).stdout
+ assert backend.strip().lower() == "agg"
+
+
+@pytest.mark.skipif(
+ sys.platform == "linux" and not _c_internal_utils.xdisplay_is_valid(),
+ reason="headless")
+def test_backend_fallback_headful(tmp_path):
+ if parse_version(pytest.__version__) >= parse_version('8.2.0'):
+ pytest_kwargs = dict(exc_type=ImportError)
+ else:
+ pytest_kwargs = {}
+
+ pytest.importorskip("tkinter", **pytest_kwargs)
+ env = {**os.environ, "MPLBACKEND": "", "MPLCONFIGDIR": str(tmp_path)}
+ backend = subprocess_run_for_testing(
+ [sys.executable, "-c",
+ "import matplotlib as mpl; "
+ "sentinel = mpl.rcsetup._auto_backend_sentinel; "
+ # Check that access on another instance does not resolve the sentinel.
+ "assert mpl.RcParams({'backend': sentinel})['backend'] == sentinel; "
+ "assert mpl.rcParams._get('backend') == sentinel; "
+ "assert mpl.get_backend(auto_select=False) is None; "
+ "import matplotlib.pyplot; "
+ "print(matplotlib.get_backend())"],
+ env=env, text=True, check=True, capture_output=True).stdout
+ # The actual backend will depend on what's installed, but at least tkagg is
+ # present.
+ assert backend.strip().lower() != "agg"
+
+
+def test_deprecation(monkeypatch):
+ monkeypatch.setitem(
+ mpl._deprecated_map, "patch.linewidth",
+ ("0.0", "axes.linewidth", lambda old: 2 * old, lambda new: new / 2))
+ with pytest.warns(mpl.MatplotlibDeprecationWarning):
+ assert mpl.rcParams["patch.linewidth"] \
+ == mpl.rcParams["axes.linewidth"] / 2
+ with pytest.warns(mpl.MatplotlibDeprecationWarning):
+ mpl.rcParams["patch.linewidth"] = 1
+ assert mpl.rcParams["axes.linewidth"] == 2
+
+ monkeypatch.setitem(
+ mpl._deprecated_ignore_map, "patch.edgecolor",
+ ("0.0", "axes.edgecolor"))
+ with pytest.warns(mpl.MatplotlibDeprecationWarning):
+ assert mpl.rcParams["patch.edgecolor"] \
+ == mpl.rcParams["axes.edgecolor"]
+ with pytest.warns(mpl.MatplotlibDeprecationWarning):
+ mpl.rcParams["patch.edgecolor"] = "#abcd"
+ assert mpl.rcParams["axes.edgecolor"] != "#abcd"
+
+ monkeypatch.setitem(
+ mpl._deprecated_ignore_map, "patch.force_edgecolor",
+ ("0.0", None))
+ with pytest.warns(mpl.MatplotlibDeprecationWarning):
+ assert mpl.rcParams["patch.force_edgecolor"] is None
+
+ monkeypatch.setitem(
+ mpl._deprecated_remain_as_none, "svg.hashsalt",
+ ("0.0",))
+ with pytest.warns(mpl.MatplotlibDeprecationWarning):
+ mpl.rcParams["svg.hashsalt"] = "foobar"
+ assert mpl.rcParams["svg.hashsalt"] == "foobar" # Doesn't warn.
+ mpl.rcParams["svg.hashsalt"] = None # Doesn't warn.
+
+ mpl.rcParams.update(mpl.rcParams.copy()) # Doesn't warn.
+ # Note that the warning suppression actually arises from the
+ # iteration over the updater rcParams being protected by
+ # suppress_matplotlib_deprecation_warning, rather than any explicit check.
+
+
+@pytest.mark.parametrize("value", [
+ "best",
+ 1,
+ "1",
+ (0.9, .7),
+ (-0.9, .7),
+ "(0.9, .7)"
+])
+def test_rcparams_legend_loc(value):
+ # rcParams['legend.loc'] should allow any of the following formats.
+ # if any of these are not allowed, an exception will be raised
+ # test for gh issue #22338
+ mpl.rcParams["legend.loc"] = value
+
+
+@pytest.mark.parametrize("value", [
+ "best",
+ 1,
+ (0.9, .7),
+ (-0.9, .7),
+])
+def test_rcparams_legend_loc_from_file(tmp_path, value):
+ # rcParams['legend.loc'] should be settable from matplotlibrc.
+ # if any of these are not allowed, an exception will be raised.
+ # test for gh issue #22338
+ rc_path = tmp_path / "matplotlibrc"
+ rc_path.write_text(f"legend.loc: {value}")
+
+ with mpl.rc_context(fname=rc_path):
+ assert mpl.rcParams["legend.loc"] == value
+
+
+@pytest.mark.parametrize("value", [(1, 2, 3), '1, 2, 3', '(1, 2, 3)'])
+def test_validate_sketch(value):
+ mpl.rcParams["path.sketch"] = value
+ assert mpl.rcParams["path.sketch"] == (1, 2, 3)
+ assert validate_sketch(value) == (1, 2, 3)
+
+
+@pytest.mark.parametrize("value", [1, '1', '1 2 3'])
+def test_validate_sketch_error(value):
+ with pytest.raises(ValueError, match="scale, length, randomness"):
+ validate_sketch(value)
+ with pytest.raises(ValueError, match="scale, length, randomness"):
+ mpl.rcParams["path.sketch"] = value
+
+
+@pytest.mark.parametrize("value", ['1, 2, 3', '(1,2,3)'])
+def test_rcparams_path_sketch_from_file(tmp_path, value):
+ rc_path = tmp_path / "matplotlibrc"
+ rc_path.write_text(f"path.sketch: {value}")
+ with mpl.rc_context(fname=rc_path):
+ assert mpl.rcParams["path.sketch"] == (1, 2, 3)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_triangulation.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_triangulation.py
new file mode 100644
index 0000000000000000000000000000000000000000..dd91144f240cefa592a0c73387974c7fcd977ba9
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tests/test_triangulation.py
@@ -0,0 +1,1403 @@
+import numpy as np
+from numpy.testing import (
+ assert_array_equal, assert_array_almost_equal, assert_array_less)
+import numpy.ma.testutils as matest
+import pytest
+
+import matplotlib as mpl
+import matplotlib.pyplot as plt
+import matplotlib.tri as mtri
+from matplotlib.path import Path
+from matplotlib.testing.decorators import image_comparison, check_figures_equal
+
+
+class TestTriangulationParams:
+ x = [-1, 0, 1, 0]
+ y = [0, -1, 0, 1]
+ triangles = [[0, 1, 2], [0, 2, 3]]
+ mask = [False, True]
+
+ @pytest.mark.parametrize('args, kwargs, expected', [
+ ([x, y], {}, [x, y, None, None]),
+ ([x, y, triangles], {}, [x, y, triangles, None]),
+ ([x, y], dict(triangles=triangles), [x, y, triangles, None]),
+ ([x, y], dict(mask=mask), [x, y, None, mask]),
+ ([x, y, triangles], dict(mask=mask), [x, y, triangles, mask]),
+ ([x, y], dict(triangles=triangles, mask=mask), [x, y, triangles, mask])
+ ])
+ def test_extract_triangulation_params(self, args, kwargs, expected):
+ other_args = [1, 2]
+ other_kwargs = {'a': 3, 'b': '4'}
+ x_, y_, triangles_, mask_, args_, kwargs_ = \
+ mtri.Triangulation._extract_triangulation_params(
+ args + other_args, {**kwargs, **other_kwargs})
+ x, y, triangles, mask = expected
+ assert x_ is x
+ assert y_ is y
+ assert_array_equal(triangles_, triangles)
+ assert mask_ is mask
+ assert args_ == other_args
+ assert kwargs_ == other_kwargs
+
+
+def test_extract_triangulation_positional_mask():
+ # mask cannot be passed positionally
+ mask = [True]
+ args = [[0, 2, 1], [0, 0, 1], [[0, 1, 2]], mask]
+ x_, y_, triangles_, mask_, args_, kwargs_ = \
+ mtri.Triangulation._extract_triangulation_params(args, {})
+ assert mask_ is None
+ assert args_ == [mask]
+ # the positional mask must be caught downstream because this must pass
+ # unknown args through
+
+
+def test_triangulation_init():
+ x = [-1, 0, 1, 0]
+ y = [0, -1, 0, 1]
+ with pytest.raises(ValueError, match="x and y must be equal-length"):
+ mtri.Triangulation(x, [1, 2])
+ with pytest.raises(
+ ValueError,
+ match=r"triangles must be a \(N, 3\) int array, but found shape "
+ r"\(3,\)"):
+ mtri.Triangulation(x, y, [0, 1, 2])
+ with pytest.raises(
+ ValueError,
+ match=r"triangles must be a \(N, 3\) int array, not 'other'"):
+ mtri.Triangulation(x, y, 'other')
+ with pytest.raises(ValueError, match="found value 99"):
+ mtri.Triangulation(x, y, [[0, 1, 99]])
+ with pytest.raises(ValueError, match="found value -1"):
+ mtri.Triangulation(x, y, [[0, 1, -1]])
+
+
+def test_triangulation_set_mask():
+ x = [-1, 0, 1, 0]
+ y = [0, -1, 0, 1]
+ triangles = [[0, 1, 2], [2, 3, 0]]
+ triang = mtri.Triangulation(x, y, triangles)
+
+ # Check neighbors, which forces creation of C++ triangulation
+ assert_array_equal(triang.neighbors, [[-1, -1, 1], [-1, -1, 0]])
+
+ # Set mask
+ triang.set_mask([False, True])
+ assert_array_equal(triang.mask, [False, True])
+
+ # Reset mask
+ triang.set_mask(None)
+ assert triang.mask is None
+
+ msg = r"mask array must have same length as triangles array"
+ for mask in ([False, True, False], [False], [True], False, True):
+ with pytest.raises(ValueError, match=msg):
+ triang.set_mask(mask)
+
+
+def test_delaunay():
+ # No duplicate points, regular grid.
+ nx = 5
+ ny = 4
+ x, y = np.meshgrid(np.linspace(0.0, 1.0, nx), np.linspace(0.0, 1.0, ny))
+ x = x.ravel()
+ y = y.ravel()
+ npoints = nx*ny
+ ntriangles = 2 * (nx-1) * (ny-1)
+ nedges = 3*nx*ny - 2*nx - 2*ny + 1
+
+ # Create delaunay triangulation.
+ triang = mtri.Triangulation(x, y)
+
+ # The tests in the remainder of this function should be passed by any
+ # triangulation that does not contain duplicate points.
+
+ # Points - floating point.
+ assert_array_almost_equal(triang.x, x)
+ assert_array_almost_equal(triang.y, y)
+
+ # Triangles - integers.
+ assert len(triang.triangles) == ntriangles
+ assert np.min(triang.triangles) == 0
+ assert np.max(triang.triangles) == npoints-1
+
+ # Edges - integers.
+ assert len(triang.edges) == nedges
+ assert np.min(triang.edges) == 0
+ assert np.max(triang.edges) == npoints-1
+
+ # Neighbors - integers.
+ # Check that neighbors calculated by C++ triangulation class are the same
+ # as those returned from delaunay routine.
+ neighbors = triang.neighbors
+ triang._neighbors = None
+ assert_array_equal(triang.neighbors, neighbors)
+
+ # Is each point used in at least one triangle?
+ assert_array_equal(np.unique(triang.triangles), np.arange(npoints))
+
+
+def test_delaunay_duplicate_points():
+ npoints = 10
+ duplicate = 7
+ duplicate_of = 3
+
+ np.random.seed(23)
+ x = np.random.random(npoints)
+ y = np.random.random(npoints)
+ x[duplicate] = x[duplicate_of]
+ y[duplicate] = y[duplicate_of]
+
+ # Create delaunay triangulation.
+ triang = mtri.Triangulation(x, y)
+
+ # Duplicate points should be ignored, so the index of the duplicate points
+ # should not appear in any triangle.
+ assert_array_equal(np.unique(triang.triangles),
+ np.delete(np.arange(npoints), duplicate))
+
+
+def test_delaunay_points_in_line():
+ # Cannot triangulate points that are all in a straight line, but check
+ # that delaunay code fails gracefully.
+ x = np.linspace(0.0, 10.0, 11)
+ y = np.linspace(0.0, 10.0, 11)
+ with pytest.raises(RuntimeError):
+ mtri.Triangulation(x, y)
+
+ # Add an extra point not on the line and the triangulation is OK.
+ x = np.append(x, 2.0)
+ y = np.append(y, 8.0)
+ mtri.Triangulation(x, y)
+
+
+@pytest.mark.parametrize('x, y', [
+ # Triangulation should raise a ValueError if passed less than 3 points.
+ ([], []),
+ ([1], [5]),
+ ([1, 2], [5, 6]),
+ # Triangulation should also raise a ValueError if passed duplicate points
+ # such that there are less than 3 unique points.
+ ([1, 2, 1], [5, 6, 5]),
+ ([1, 2, 2], [5, 6, 6]),
+ ([1, 1, 1, 2, 1, 2], [5, 5, 5, 6, 5, 6]),
+])
+def test_delaunay_insufficient_points(x, y):
+ with pytest.raises(ValueError):
+ mtri.Triangulation(x, y)
+
+
+def test_delaunay_robust():
+ # Fails when mtri.Triangulation uses matplotlib.delaunay, works when using
+ # qhull.
+ tri_points = np.array([
+ [0.8660254037844384, -0.5000000000000004],
+ [0.7577722283113836, -0.5000000000000004],
+ [0.6495190528383288, -0.5000000000000003],
+ [0.5412658773652739, -0.5000000000000003],
+ [0.811898816047911, -0.40625000000000044],
+ [0.7036456405748561, -0.4062500000000004],
+ [0.5953924651018013, -0.40625000000000033]])
+ test_points = np.asarray([
+ [0.58, -0.46],
+ [0.65, -0.46],
+ [0.65, -0.42],
+ [0.7, -0.48],
+ [0.7, -0.44],
+ [0.75, -0.44],
+ [0.8, -0.48]])
+
+ # Utility function that indicates if a triangle defined by 3 points
+ # (xtri, ytri) contains the test point xy. Avoid calling with a point that
+ # lies on or very near to an edge of the triangle.
+ def tri_contains_point(xtri, ytri, xy):
+ tri_points = np.vstack((xtri, ytri)).T
+ return Path(tri_points).contains_point(xy)
+
+ # Utility function that returns how many triangles of the specified
+ # triangulation contain the test point xy. Avoid calling with a point that
+ # lies on or very near to an edge of any triangle in the triangulation.
+ def tris_contain_point(triang, xy):
+ return sum(tri_contains_point(triang.x[tri], triang.y[tri], xy)
+ for tri in triang.triangles)
+
+ # Using matplotlib.delaunay, an invalid triangulation is created with
+ # overlapping triangles; qhull is OK.
+ triang = mtri.Triangulation(tri_points[:, 0], tri_points[:, 1])
+ for test_point in test_points:
+ assert tris_contain_point(triang, test_point) == 1
+
+ # If ignore the first point of tri_points, matplotlib.delaunay throws a
+ # KeyError when calculating the convex hull; qhull is OK.
+ triang = mtri.Triangulation(tri_points[1:, 0], tri_points[1:, 1])
+
+
+@image_comparison(['tripcolor1.png'])
+def test_tripcolor():
+ x = np.asarray([0, 0.5, 1, 0, 0.5, 1, 0, 0.5, 1, 0.75])
+ y = np.asarray([0, 0, 0, 0.5, 0.5, 0.5, 1, 1, 1, 0.75])
+ triangles = np.asarray([
+ [0, 1, 3], [1, 4, 3],
+ [1, 2, 4], [2, 5, 4],
+ [3, 4, 6], [4, 7, 6],
+ [4, 5, 9], [7, 4, 9], [8, 7, 9], [5, 8, 9]])
+
+ # Triangulation with same number of points and triangles.
+ triang = mtri.Triangulation(x, y, triangles)
+
+ Cpoints = x + 0.5*y
+
+ xmid = x[triang.triangles].mean(axis=1)
+ ymid = y[triang.triangles].mean(axis=1)
+ Cfaces = 0.5*xmid + ymid
+
+ plt.subplot(121)
+ plt.tripcolor(triang, Cpoints, edgecolors='k')
+ plt.title('point colors')
+
+ plt.subplot(122)
+ plt.tripcolor(triang, facecolors=Cfaces, edgecolors='k')
+ plt.title('facecolors')
+
+
+def test_tripcolor_color():
+ x = [-1, 0, 1, 0]
+ y = [0, -1, 0, 1]
+ fig, ax = plt.subplots()
+ with pytest.raises(TypeError, match=r"tripcolor\(\) missing 1 required "):
+ ax.tripcolor(x, y)
+ with pytest.raises(ValueError, match="The length of c must match either"):
+ ax.tripcolor(x, y, [1, 2, 3])
+ with pytest.raises(ValueError,
+ match="length of facecolors must match .* triangles"):
+ ax.tripcolor(x, y, facecolors=[1, 2, 3, 4])
+ with pytest.raises(ValueError,
+ match="'gouraud' .* at the points.* not at the faces"):
+ ax.tripcolor(x, y, facecolors=[1, 2], shading='gouraud')
+ with pytest.raises(ValueError,
+ match="'gouraud' .* at the points.* not at the faces"):
+ ax.tripcolor(x, y, [1, 2], shading='gouraud') # faces
+ with pytest.raises(TypeError,
+ match="positional.*'c'.*keyword-only.*'facecolors'"):
+ ax.tripcolor(x, y, C=[1, 2, 3, 4])
+ with pytest.raises(TypeError, match="Unexpected positional parameter"):
+ ax.tripcolor(x, y, [1, 2], 'unused_positional')
+
+ # smoke test for valid color specifications (via C or facecolors)
+ ax.tripcolor(x, y, [1, 2, 3, 4]) # edges
+ ax.tripcolor(x, y, [1, 2, 3, 4], shading='gouraud') # edges
+ ax.tripcolor(x, y, [1, 2]) # faces
+ ax.tripcolor(x, y, facecolors=[1, 2]) # faces
+
+
+def test_tripcolor_clim():
+ np.random.seed(19680801)
+ a, b, c = np.random.rand(10), np.random.rand(10), np.random.rand(10)
+
+ ax = plt.figure().add_subplot()
+ clim = (0.25, 0.75)
+ norm = ax.tripcolor(a, b, c, clim=clim).norm
+ assert (norm.vmin, norm.vmax) == clim
+
+
+def test_tripcolor_warnings():
+ x = [-1, 0, 1, 0]
+ y = [0, -1, 0, 1]
+ c = [0.4, 0.5]
+ fig, ax = plt.subplots()
+ # facecolors takes precedence over c
+ with pytest.warns(UserWarning, match="Positional parameter c .*no effect"):
+ ax.tripcolor(x, y, c, facecolors=c)
+ with pytest.warns(UserWarning, match="Positional parameter c .*no effect"):
+ ax.tripcolor(x, y, 'interpreted as c', facecolors=c)
+
+
+def test_no_modify():
+ # Test that Triangulation does not modify triangles array passed to it.
+ triangles = np.array([[3, 2, 0], [3, 1, 0]], dtype=np.int32)
+ points = np.array([(0, 0), (0, 1.1), (1, 0), (1, 1)])
+
+ old_triangles = triangles.copy()
+ mtri.Triangulation(points[:, 0], points[:, 1], triangles).edges
+ assert_array_equal(old_triangles, triangles)
+
+
+def test_trifinder():
+ # Test points within triangles of masked triangulation.
+ x, y = np.meshgrid(np.arange(4), np.arange(4))
+ x = x.ravel()
+ y = y.ravel()
+ triangles = [[0, 1, 4], [1, 5, 4], [1, 2, 5], [2, 6, 5], [2, 3, 6],
+ [3, 7, 6], [4, 5, 8], [5, 9, 8], [5, 6, 9], [6, 10, 9],
+ [6, 7, 10], [7, 11, 10], [8, 9, 12], [9, 13, 12], [9, 10, 13],
+ [10, 14, 13], [10, 11, 14], [11, 15, 14]]
+ mask = np.zeros(len(triangles))
+ mask[8:10] = 1
+ triang = mtri.Triangulation(x, y, triangles, mask)
+ trifinder = triang.get_trifinder()
+
+ xs = [0.25, 1.25, 2.25, 3.25]
+ ys = [0.25, 1.25, 2.25, 3.25]
+ xs, ys = np.meshgrid(xs, ys)
+ xs = xs.ravel()
+ ys = ys.ravel()
+ tris = trifinder(xs, ys)
+ assert_array_equal(tris, [0, 2, 4, -1, 6, -1, 10, -1,
+ 12, 14, 16, -1, -1, -1, -1, -1])
+ tris = trifinder(xs-0.5, ys-0.5)
+ assert_array_equal(tris, [-1, -1, -1, -1, -1, 1, 3, 5,
+ -1, 7, -1, 11, -1, 13, 15, 17])
+
+ # Test points exactly on boundary edges of masked triangulation.
+ xs = [0.5, 1.5, 2.5, 0.5, 1.5, 2.5, 1.5, 1.5, 0.0, 1.0, 2.0, 3.0]
+ ys = [0.0, 0.0, 0.0, 3.0, 3.0, 3.0, 1.0, 2.0, 1.5, 1.5, 1.5, 1.5]
+ tris = trifinder(xs, ys)
+ assert_array_equal(tris, [0, 2, 4, 13, 15, 17, 3, 14, 6, 7, 10, 11])
+
+ # Test points exactly on boundary corners of masked triangulation.
+ xs = [0.0, 3.0]
+ ys = [0.0, 3.0]
+ tris = trifinder(xs, ys)
+ assert_array_equal(tris, [0, 17])
+
+ #
+ # Test triangles with horizontal colinear points. These are not valid
+ # triangulations, but we try to deal with the simplest violations.
+ #
+
+ # If +ve, triangulation is OK, if -ve triangulation invalid,
+ # if zero have colinear points but should pass tests anyway.
+ delta = 0.0
+
+ x = [1.5, 0, 1, 2, 3, 1.5, 1.5]
+ y = [-1, 0, 0, 0, 0, delta, 1]
+ triangles = [[0, 2, 1], [0, 3, 2], [0, 4, 3], [1, 2, 5], [2, 3, 5],
+ [3, 4, 5], [1, 5, 6], [4, 6, 5]]
+ triang = mtri.Triangulation(x, y, triangles)
+ trifinder = triang.get_trifinder()
+
+ xs = [-0.1, 0.4, 0.9, 1.4, 1.9, 2.4, 2.9]
+ ys = [-0.1, 0.1]
+ xs, ys = np.meshgrid(xs, ys)
+ tris = trifinder(xs, ys)
+ assert_array_equal(tris, [[-1, 0, 0, 1, 1, 2, -1],
+ [-1, 6, 6, 6, 7, 7, -1]])
+
+ #
+ # Test triangles with vertical colinear points. These are not valid
+ # triangulations, but we try to deal with the simplest violations.
+ #
+
+ # If +ve, triangulation is OK, if -ve triangulation invalid,
+ # if zero have colinear points but should pass tests anyway.
+ delta = 0.0
+
+ x = [-1, -delta, 0, 0, 0, 0, 1]
+ y = [1.5, 1.5, 0, 1, 2, 3, 1.5]
+ triangles = [[0, 1, 2], [0, 1, 5], [1, 2, 3], [1, 3, 4], [1, 4, 5],
+ [2, 6, 3], [3, 6, 4], [4, 6, 5]]
+ triang = mtri.Triangulation(x, y, triangles)
+ trifinder = triang.get_trifinder()
+
+ xs = [-0.1, 0.1]
+ ys = [-0.1, 0.4, 0.9, 1.4, 1.9, 2.4, 2.9]
+ xs, ys = np.meshgrid(xs, ys)
+ tris = trifinder(xs, ys)
+ assert_array_equal(tris, [[-1, -1], [0, 5], [0, 5], [0, 6], [1, 6], [1, 7],
+ [-1, -1]])
+
+ # Test that changing triangulation by setting a mask causes the trifinder
+ # to be reinitialised.
+ x = [0, 1, 0, 1]
+ y = [0, 0, 1, 1]
+ triangles = [[0, 1, 2], [1, 3, 2]]
+ triang = mtri.Triangulation(x, y, triangles)
+ trifinder = triang.get_trifinder()
+
+ xs = [-0.2, 0.2, 0.8, 1.2]
+ ys = [0.5, 0.5, 0.5, 0.5]
+ tris = trifinder(xs, ys)
+ assert_array_equal(tris, [-1, 0, 1, -1])
+
+ triang.set_mask([1, 0])
+ assert trifinder == triang.get_trifinder()
+ tris = trifinder(xs, ys)
+ assert_array_equal(tris, [-1, -1, 1, -1])
+
+
+def test_triinterp():
+ # Test points within triangles of masked triangulation.
+ x, y = np.meshgrid(np.arange(4), np.arange(4))
+ x = x.ravel()
+ y = y.ravel()
+ z = 1.23*x - 4.79*y
+ triangles = [[0, 1, 4], [1, 5, 4], [1, 2, 5], [2, 6, 5], [2, 3, 6],
+ [3, 7, 6], [4, 5, 8], [5, 9, 8], [5, 6, 9], [6, 10, 9],
+ [6, 7, 10], [7, 11, 10], [8, 9, 12], [9, 13, 12], [9, 10, 13],
+ [10, 14, 13], [10, 11, 14], [11, 15, 14]]
+ mask = np.zeros(len(triangles))
+ mask[8:10] = 1
+ triang = mtri.Triangulation(x, y, triangles, mask)
+ linear_interp = mtri.LinearTriInterpolator(triang, z)
+ cubic_min_E = mtri.CubicTriInterpolator(triang, z)
+ cubic_geom = mtri.CubicTriInterpolator(triang, z, kind='geom')
+
+ xs = np.linspace(0.25, 2.75, 6)
+ ys = [0.25, 0.75, 2.25, 2.75]
+ xs, ys = np.meshgrid(xs, ys) # Testing arrays with array.ndim = 2
+ for interp in (linear_interp, cubic_min_E, cubic_geom):
+ zs = interp(xs, ys)
+ assert_array_almost_equal(zs, (1.23*xs - 4.79*ys))
+
+ # Test points outside triangulation.
+ xs = [-0.25, 1.25, 1.75, 3.25]
+ ys = xs
+ xs, ys = np.meshgrid(xs, ys)
+ for interp in (linear_interp, cubic_min_E, cubic_geom):
+ zs = linear_interp(xs, ys)
+ assert_array_equal(zs.mask, [[True]*4]*4)
+
+ # Test mixed configuration (outside / inside).
+ xs = np.linspace(0.25, 1.75, 6)
+ ys = [0.25, 0.75, 1.25, 1.75]
+ xs, ys = np.meshgrid(xs, ys)
+ for interp in (linear_interp, cubic_min_E, cubic_geom):
+ zs = interp(xs, ys)
+ matest.assert_array_almost_equal(zs, (1.23*xs - 4.79*ys))
+ mask = (xs >= 1) * (xs <= 2) * (ys >= 1) * (ys <= 2)
+ assert_array_equal(zs.mask, mask)
+
+ # 2nd order patch test: on a grid with an 'arbitrary shaped' triangle,
+ # patch test shall be exact for quadratic functions and cubic
+ # interpolator if *kind* = user
+ (a, b, c) = (1.23, -4.79, 0.6)
+
+ def quad(x, y):
+ return a*(x-0.5)**2 + b*(y-0.5)**2 + c*x*y
+
+ def gradient_quad(x, y):
+ return (2*a*(x-0.5) + c*y, 2*b*(y-0.5) + c*x)
+
+ x = np.array([0.2, 0.33367, 0.669, 0., 1., 1., 0.])
+ y = np.array([0.3, 0.80755, 0.4335, 0., 0., 1., 1.])
+ triangles = np.array([[0, 1, 2], [3, 0, 4], [4, 0, 2], [4, 2, 5],
+ [1, 5, 2], [6, 5, 1], [6, 1, 0], [6, 0, 3]])
+ triang = mtri.Triangulation(x, y, triangles)
+ z = quad(x, y)
+ dz = gradient_quad(x, y)
+ # test points for 2nd order patch test
+ xs = np.linspace(0., 1., 5)
+ ys = np.linspace(0., 1., 5)
+ xs, ys = np.meshgrid(xs, ys)
+ cubic_user = mtri.CubicTriInterpolator(triang, z, kind='user', dz=dz)
+ interp_zs = cubic_user(xs, ys)
+ assert_array_almost_equal(interp_zs, quad(xs, ys))
+ (interp_dzsdx, interp_dzsdy) = cubic_user.gradient(x, y)
+ (dzsdx, dzsdy) = gradient_quad(x, y)
+ assert_array_almost_equal(interp_dzsdx, dzsdx)
+ assert_array_almost_equal(interp_dzsdy, dzsdy)
+
+ # Cubic improvement: cubic interpolation shall perform better than linear
+ # on a sufficiently dense mesh for a quadratic function.
+ n = 11
+ x, y = np.meshgrid(np.linspace(0., 1., n+1), np.linspace(0., 1., n+1))
+ x = x.ravel()
+ y = y.ravel()
+ z = quad(x, y)
+ triang = mtri.Triangulation(x, y, triangles=meshgrid_triangles(n+1))
+ xs, ys = np.meshgrid(np.linspace(0.1, 0.9, 5), np.linspace(0.1, 0.9, 5))
+ xs = xs.ravel()
+ ys = ys.ravel()
+ linear_interp = mtri.LinearTriInterpolator(triang, z)
+ cubic_min_E = mtri.CubicTriInterpolator(triang, z)
+ cubic_geom = mtri.CubicTriInterpolator(triang, z, kind='geom')
+ zs = quad(xs, ys)
+ diff_lin = np.abs(linear_interp(xs, ys) - zs)
+ for interp in (cubic_min_E, cubic_geom):
+ diff_cubic = np.abs(interp(xs, ys) - zs)
+ assert np.max(diff_lin) >= 10 * np.max(diff_cubic)
+ assert (np.dot(diff_lin, diff_lin) >=
+ 100 * np.dot(diff_cubic, diff_cubic))
+
+
+def test_triinterpcubic_C1_continuity():
+ # Below the 4 tests which demonstrate C1 continuity of the
+ # TriCubicInterpolator (testing the cubic shape functions on arbitrary
+ # triangle):
+ #
+ # 1) Testing continuity of function & derivatives at corner for all 9
+ # shape functions. Testing also function values at same location.
+ # 2) Testing C1 continuity along each edge (as gradient is polynomial of
+ # 2nd order, it is sufficient to test at the middle).
+ # 3) Testing C1 continuity at triangle barycenter (where the 3 subtriangles
+ # meet)
+ # 4) Testing C1 continuity at median 1/3 points (midside between 2
+ # subtriangles)
+
+ # Utility test function check_continuity
+ def check_continuity(interpolator, loc, values=None):
+ """
+ Checks the continuity of interpolator (and its derivatives) near
+ location loc. Can check the value at loc itself if *values* is
+ provided.
+
+ *interpolator* TriInterpolator
+ *loc* location to test (x0, y0)
+ *values* (optional) array [z0, dzx0, dzy0] to check the value at *loc*
+ """
+ n_star = 24 # Number of continuity points in a boundary of loc
+ epsilon = 1.e-10 # Distance for loc boundary
+ k = 100. # Continuity coefficient
+ (loc_x, loc_y) = loc
+ star_x = loc_x + epsilon*np.cos(np.linspace(0., 2*np.pi, n_star))
+ star_y = loc_y + epsilon*np.sin(np.linspace(0., 2*np.pi, n_star))
+ z = interpolator([loc_x], [loc_y])[0]
+ (dzx, dzy) = interpolator.gradient([loc_x], [loc_y])
+ if values is not None:
+ assert_array_almost_equal(z, values[0])
+ assert_array_almost_equal(dzx[0], values[1])
+ assert_array_almost_equal(dzy[0], values[2])
+ diff_z = interpolator(star_x, star_y) - z
+ (tab_dzx, tab_dzy) = interpolator.gradient(star_x, star_y)
+ diff_dzx = tab_dzx - dzx
+ diff_dzy = tab_dzy - dzy
+ assert_array_less(diff_z, epsilon*k)
+ assert_array_less(diff_dzx, epsilon*k)
+ assert_array_less(diff_dzy, epsilon*k)
+
+ # Drawing arbitrary triangle (a, b, c) inside a unit square.
+ (ax, ay) = (0.2, 0.3)
+ (bx, by) = (0.33367, 0.80755)
+ (cx, cy) = (0.669, 0.4335)
+ x = np.array([ax, bx, cx, 0., 1., 1., 0.])
+ y = np.array([ay, by, cy, 0., 0., 1., 1.])
+ triangles = np.array([[0, 1, 2], [3, 0, 4], [4, 0, 2], [4, 2, 5],
+ [1, 5, 2], [6, 5, 1], [6, 1, 0], [6, 0, 3]])
+ triang = mtri.Triangulation(x, y, triangles)
+
+ for idof in range(9):
+ z = np.zeros(7, dtype=np.float64)
+ dzx = np.zeros(7, dtype=np.float64)
+ dzy = np.zeros(7, dtype=np.float64)
+ values = np.zeros([3, 3], dtype=np.float64)
+ case = idof//3
+ values[case, idof % 3] = 1.0
+ if case == 0:
+ z[idof] = 1.0
+ elif case == 1:
+ dzx[idof % 3] = 1.0
+ elif case == 2:
+ dzy[idof % 3] = 1.0
+ interp = mtri.CubicTriInterpolator(triang, z, kind='user',
+ dz=(dzx, dzy))
+ # Test 1) Checking values and continuity at nodes
+ check_continuity(interp, (ax, ay), values[:, 0])
+ check_continuity(interp, (bx, by), values[:, 1])
+ check_continuity(interp, (cx, cy), values[:, 2])
+ # Test 2) Checking continuity at midside nodes
+ check_continuity(interp, ((ax+bx)*0.5, (ay+by)*0.5))
+ check_continuity(interp, ((ax+cx)*0.5, (ay+cy)*0.5))
+ check_continuity(interp, ((cx+bx)*0.5, (cy+by)*0.5))
+ # Test 3) Checking continuity at barycenter
+ check_continuity(interp, ((ax+bx+cx)/3., (ay+by+cy)/3.))
+ # Test 4) Checking continuity at median 1/3-point
+ check_continuity(interp, ((4.*ax+bx+cx)/6., (4.*ay+by+cy)/6.))
+ check_continuity(interp, ((ax+4.*bx+cx)/6., (ay+4.*by+cy)/6.))
+ check_continuity(interp, ((ax+bx+4.*cx)/6., (ay+by+4.*cy)/6.))
+
+
+def test_triinterpcubic_cg_solver():
+ # Now 3 basic tests of the Sparse CG solver, used for
+ # TriCubicInterpolator with *kind* = 'min_E'
+ # 1) A commonly used test involves a 2d Poisson matrix.
+ def poisson_sparse_matrix(n, m):
+ """
+ Return the sparse, (n*m, n*m) matrix in coo format resulting from the
+ discretisation of the 2-dimensional Poisson equation according to a
+ finite difference numerical scheme on a uniform (n, m) grid.
+ """
+ l = m*n
+ rows = np.concatenate([
+ np.arange(l, dtype=np.int32),
+ np.arange(l-1, dtype=np.int32), np.arange(1, l, dtype=np.int32),
+ np.arange(l-n, dtype=np.int32), np.arange(n, l, dtype=np.int32)])
+ cols = np.concatenate([
+ np.arange(l, dtype=np.int32),
+ np.arange(1, l, dtype=np.int32), np.arange(l-1, dtype=np.int32),
+ np.arange(n, l, dtype=np.int32), np.arange(l-n, dtype=np.int32)])
+ vals = np.concatenate([
+ 4*np.ones(l, dtype=np.float64),
+ -np.ones(l-1, dtype=np.float64), -np.ones(l-1, dtype=np.float64),
+ -np.ones(l-n, dtype=np.float64), -np.ones(l-n, dtype=np.float64)])
+ # In fact +1 and -1 diags have some zeros
+ vals[l:2*l-1][m-1::m] = 0.
+ vals[2*l-1:3*l-2][m-1::m] = 0.
+ return vals, rows, cols, (n*m, n*m)
+
+ # Instantiating a sparse Poisson matrix of size 48 x 48:
+ (n, m) = (12, 4)
+ mat = mtri._triinterpolate._Sparse_Matrix_coo(*poisson_sparse_matrix(n, m))
+ mat.compress_csc()
+ mat_dense = mat.to_dense()
+ # Testing a sparse solve for all 48 basis vector
+ for itest in range(n*m):
+ b = np.zeros(n*m, dtype=np.float64)
+ b[itest] = 1.
+ x, _ = mtri._triinterpolate._cg(A=mat, b=b, x0=np.zeros(n*m),
+ tol=1.e-10)
+ assert_array_almost_equal(np.dot(mat_dense, x), b)
+
+ # 2) Same matrix with inserting 2 rows - cols with null diag terms
+ # (but still linked with the rest of the matrix by extra-diag terms)
+ (i_zero, j_zero) = (12, 49)
+ vals, rows, cols, _ = poisson_sparse_matrix(n, m)
+ rows = rows + 1*(rows >= i_zero) + 1*(rows >= j_zero)
+ cols = cols + 1*(cols >= i_zero) + 1*(cols >= j_zero)
+ # adding extra-diag terms
+ rows = np.concatenate([rows, [i_zero, i_zero-1, j_zero, j_zero-1]])
+ cols = np.concatenate([cols, [i_zero-1, i_zero, j_zero-1, j_zero]])
+ vals = np.concatenate([vals, [1., 1., 1., 1.]])
+ mat = mtri._triinterpolate._Sparse_Matrix_coo(vals, rows, cols,
+ (n*m + 2, n*m + 2))
+ mat.compress_csc()
+ mat_dense = mat.to_dense()
+ # Testing a sparse solve for all 50 basis vec
+ for itest in range(n*m + 2):
+ b = np.zeros(n*m + 2, dtype=np.float64)
+ b[itest] = 1.
+ x, _ = mtri._triinterpolate._cg(A=mat, b=b, x0=np.ones(n * m + 2),
+ tol=1.e-10)
+ assert_array_almost_equal(np.dot(mat_dense, x), b)
+
+ # 3) Now a simple test that summation of duplicate (i.e. with same rows,
+ # same cols) entries occurs when compressed.
+ vals = np.ones(17, dtype=np.float64)
+ rows = np.array([0, 1, 2, 0, 0, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1],
+ dtype=np.int32)
+ cols = np.array([0, 1, 2, 1, 1, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2],
+ dtype=np.int32)
+ dim = (3, 3)
+ mat = mtri._triinterpolate._Sparse_Matrix_coo(vals, rows, cols, dim)
+ mat.compress_csc()
+ mat_dense = mat.to_dense()
+ assert_array_almost_equal(mat_dense, np.array([
+ [1., 2., 0.], [2., 1., 5.], [0., 5., 1.]], dtype=np.float64))
+
+
+def test_triinterpcubic_geom_weights():
+ # Tests to check computation of weights for _DOF_estimator_geom:
+ # The weight sum per triangle can be 1. (in case all angles < 90 degrees)
+ # or (2*w_i) where w_i = 1-alpha_i/np.pi is the weight of apex i; alpha_i
+ # is the apex angle > 90 degrees.
+ (ax, ay) = (0., 1.687)
+ x = np.array([ax, 0.5*ax, 0., 1.])
+ y = np.array([ay, -ay, 0., 0.])
+ z = np.zeros(4, dtype=np.float64)
+ triangles = [[0, 2, 3], [1, 3, 2]]
+ sum_w = np.zeros([4, 2]) # 4 possibilities; 2 triangles
+ for theta in np.linspace(0., 2*np.pi, 14): # rotating the figure...
+ x_rot = np.cos(theta)*x + np.sin(theta)*y
+ y_rot = -np.sin(theta)*x + np.cos(theta)*y
+ triang = mtri.Triangulation(x_rot, y_rot, triangles)
+ cubic_geom = mtri.CubicTriInterpolator(triang, z, kind='geom')
+ dof_estimator = mtri._triinterpolate._DOF_estimator_geom(cubic_geom)
+ weights = dof_estimator.compute_geom_weights()
+ # Testing for the 4 possibilities...
+ sum_w[0, :] = np.sum(weights, 1) - 1
+ for itri in range(3):
+ sum_w[itri+1, :] = np.sum(weights, 1) - 2*weights[:, itri]
+ assert_array_almost_equal(np.min(np.abs(sum_w), axis=0),
+ np.array([0., 0.], dtype=np.float64))
+
+
+def test_triinterp_colinear():
+ # Tests interpolating inside a triangulation with horizontal colinear
+ # points (refer also to the tests :func:`test_trifinder` ).
+ #
+ # These are not valid triangulations, but we try to deal with the
+ # simplest violations (i. e. those handled by default TriFinder).
+ #
+ # Note that the LinearTriInterpolator and the CubicTriInterpolator with
+ # kind='min_E' or 'geom' still pass a linear patch test.
+ # We also test interpolation inside a flat triangle, by forcing
+ # *tri_index* in a call to :meth:`_interpolate_multikeys`.
+
+ # If +ve, triangulation is OK, if -ve triangulation invalid,
+ # if zero have colinear points but should pass tests anyway.
+ delta = 0.
+
+ x0 = np.array([1.5, 0, 1, 2, 3, 1.5, 1.5])
+ y0 = np.array([-1, 0, 0, 0, 0, delta, 1])
+
+ # We test different affine transformations of the initial figure; to
+ # avoid issues related to round-off errors we only use integer
+ # coefficients (otherwise the Triangulation might become invalid even with
+ # delta == 0).
+ transformations = [[1, 0], [0, 1], [1, 1], [1, 2], [-2, -1], [-2, 1]]
+ for transformation in transformations:
+ x_rot = transformation[0]*x0 + transformation[1]*y0
+ y_rot = -transformation[1]*x0 + transformation[0]*y0
+ (x, y) = (x_rot, y_rot)
+ z = 1.23*x - 4.79*y
+ triangles = [[0, 2, 1], [0, 3, 2], [0, 4, 3], [1, 2, 5], [2, 3, 5],
+ [3, 4, 5], [1, 5, 6], [4, 6, 5]]
+ triang = mtri.Triangulation(x, y, triangles)
+ xs = np.linspace(np.min(triang.x), np.max(triang.x), 20)
+ ys = np.linspace(np.min(triang.y), np.max(triang.y), 20)
+ xs, ys = np.meshgrid(xs, ys)
+ xs = xs.ravel()
+ ys = ys.ravel()
+ mask_out = (triang.get_trifinder()(xs, ys) == -1)
+ zs_target = np.ma.array(1.23*xs - 4.79*ys, mask=mask_out)
+
+ linear_interp = mtri.LinearTriInterpolator(triang, z)
+ cubic_min_E = mtri.CubicTriInterpolator(triang, z)
+ cubic_geom = mtri.CubicTriInterpolator(triang, z, kind='geom')
+
+ for interp in (linear_interp, cubic_min_E, cubic_geom):
+ zs = interp(xs, ys)
+ assert_array_almost_equal(zs_target, zs)
+
+ # Testing interpolation inside the flat triangle number 4: [2, 3, 5]
+ # by imposing *tri_index* in a call to :meth:`_interpolate_multikeys`
+ itri = 4
+ pt1 = triang.triangles[itri, 0]
+ pt2 = triang.triangles[itri, 1]
+ xs = np.linspace(triang.x[pt1], triang.x[pt2], 10)
+ ys = np.linspace(triang.y[pt1], triang.y[pt2], 10)
+ zs_target = 1.23*xs - 4.79*ys
+ for interp in (linear_interp, cubic_min_E, cubic_geom):
+ zs, = interp._interpolate_multikeys(
+ xs, ys, tri_index=itri*np.ones(10, dtype=np.int32))
+ assert_array_almost_equal(zs_target, zs)
+
+
+def test_triinterp_transformations():
+ # 1) Testing that the interpolation scheme is invariant by rotation of the
+ # whole figure.
+ # Note: This test is non-trivial for a CubicTriInterpolator with
+ # kind='min_E'. It does fail for a non-isotropic stiffness matrix E of
+ # :class:`_ReducedHCT_Element` (tested with E=np.diag([1., 1., 1.])), and
+ # provides a good test for :meth:`get_Kff_and_Ff`of the same class.
+ #
+ # 2) Also testing that the interpolation scheme is invariant by expansion
+ # of the whole figure along one axis.
+ n_angles = 20
+ n_radii = 10
+ min_radius = 0.15
+
+ def z(x, y):
+ r1 = np.hypot(0.5 - x, 0.5 - y)
+ theta1 = np.arctan2(0.5 - x, 0.5 - y)
+ r2 = np.hypot(-x - 0.2, -y - 0.2)
+ theta2 = np.arctan2(-x - 0.2, -y - 0.2)
+ z = -(2*(np.exp((r1/10)**2)-1)*30. * np.cos(7.*theta1) +
+ (np.exp((r2/10)**2)-1)*30. * np.cos(11.*theta2) +
+ 0.7*(x**2 + y**2))
+ return (np.max(z)-z)/(np.max(z)-np.min(z))
+
+ # First create the x and y coordinates of the points.
+ radii = np.linspace(min_radius, 0.95, n_radii)
+ angles = np.linspace(0 + n_angles, 2*np.pi + n_angles,
+ n_angles, endpoint=False)
+ angles = np.repeat(angles[..., np.newaxis], n_radii, axis=1)
+ angles[:, 1::2] += np.pi/n_angles
+ x0 = (radii*np.cos(angles)).flatten()
+ y0 = (radii*np.sin(angles)).flatten()
+ triang0 = mtri.Triangulation(x0, y0) # Delaunay triangulation
+ z0 = z(x0, y0)
+
+ # Then create the test points
+ xs0 = np.linspace(-1., 1., 23)
+ ys0 = np.linspace(-1., 1., 23)
+ xs0, ys0 = np.meshgrid(xs0, ys0)
+ xs0 = xs0.ravel()
+ ys0 = ys0.ravel()
+
+ interp_z0 = {}
+ for i_angle in range(2):
+ # Rotating everything
+ theta = 2*np.pi / n_angles * i_angle
+ x = np.cos(theta)*x0 + np.sin(theta)*y0
+ y = -np.sin(theta)*x0 + np.cos(theta)*y0
+ xs = np.cos(theta)*xs0 + np.sin(theta)*ys0
+ ys = -np.sin(theta)*xs0 + np.cos(theta)*ys0
+ triang = mtri.Triangulation(x, y, triang0.triangles)
+ linear_interp = mtri.LinearTriInterpolator(triang, z0)
+ cubic_min_E = mtri.CubicTriInterpolator(triang, z0)
+ cubic_geom = mtri.CubicTriInterpolator(triang, z0, kind='geom')
+ dic_interp = {'lin': linear_interp,
+ 'min_E': cubic_min_E,
+ 'geom': cubic_geom}
+ # Testing that the interpolation is invariant by rotation...
+ for interp_key in ['lin', 'min_E', 'geom']:
+ interp = dic_interp[interp_key]
+ if i_angle == 0:
+ interp_z0[interp_key] = interp(xs0, ys0) # storage
+ else:
+ interpz = interp(xs, ys)
+ matest.assert_array_almost_equal(interpz,
+ interp_z0[interp_key])
+
+ scale_factor = 987654.3210
+ for scaled_axis in ('x', 'y'):
+ # Scaling everything (expansion along scaled_axis)
+ if scaled_axis == 'x':
+ x = scale_factor * x0
+ y = y0
+ xs = scale_factor * xs0
+ ys = ys0
+ else:
+ x = x0
+ y = scale_factor * y0
+ xs = xs0
+ ys = scale_factor * ys0
+ triang = mtri.Triangulation(x, y, triang0.triangles)
+ linear_interp = mtri.LinearTriInterpolator(triang, z0)
+ cubic_min_E = mtri.CubicTriInterpolator(triang, z0)
+ cubic_geom = mtri.CubicTriInterpolator(triang, z0, kind='geom')
+ dic_interp = {'lin': linear_interp,
+ 'min_E': cubic_min_E,
+ 'geom': cubic_geom}
+ # Test that the interpolation is invariant by expansion along 1 axis...
+ for interp_key in ['lin', 'min_E', 'geom']:
+ interpz = dic_interp[interp_key](xs, ys)
+ matest.assert_array_almost_equal(interpz, interp_z0[interp_key])
+
+
+@image_comparison(['tri_smooth_contouring.png'], remove_text=True, tol=0.072)
+def test_tri_smooth_contouring():
+ # Image comparison based on example tricontour_smooth_user.
+ n_angles = 20
+ n_radii = 10
+ min_radius = 0.15
+
+ def z(x, y):
+ r1 = np.hypot(0.5 - x, 0.5 - y)
+ theta1 = np.arctan2(0.5 - x, 0.5 - y)
+ r2 = np.hypot(-x - 0.2, -y - 0.2)
+ theta2 = np.arctan2(-x - 0.2, -y - 0.2)
+ z = -(2*(np.exp((r1/10)**2)-1)*30. * np.cos(7.*theta1) +
+ (np.exp((r2/10)**2)-1)*30. * np.cos(11.*theta2) +
+ 0.7*(x**2 + y**2))
+ return (np.max(z)-z)/(np.max(z)-np.min(z))
+
+ # First create the x and y coordinates of the points.
+ radii = np.linspace(min_radius, 0.95, n_radii)
+ angles = np.linspace(0 + n_angles, 2*np.pi + n_angles,
+ n_angles, endpoint=False)
+ angles = np.repeat(angles[..., np.newaxis], n_radii, axis=1)
+ angles[:, 1::2] += np.pi/n_angles
+ x0 = (radii*np.cos(angles)).flatten()
+ y0 = (radii*np.sin(angles)).flatten()
+ triang0 = mtri.Triangulation(x0, y0) # Delaunay triangulation
+ z0 = z(x0, y0)
+ triang0.set_mask(np.hypot(x0[triang0.triangles].mean(axis=1),
+ y0[triang0.triangles].mean(axis=1))
+ < min_radius)
+
+ # Then the plot
+ refiner = mtri.UniformTriRefiner(triang0)
+ tri_refi, z_test_refi = refiner.refine_field(z0, subdiv=4)
+ levels = np.arange(0., 1., 0.025)
+ plt.triplot(triang0, lw=0.5, color='0.5')
+ plt.tricontour(tri_refi, z_test_refi, levels=levels, colors="black")
+
+
+@image_comparison(['tri_smooth_gradient.png'], remove_text=True, tol=0.092)
+def test_tri_smooth_gradient():
+ # Image comparison based on example trigradient_demo.
+
+ def dipole_potential(x, y):
+ """An electric dipole potential V."""
+ r_sq = x**2 + y**2
+ theta = np.arctan2(y, x)
+ z = np.cos(theta)/r_sq
+ return (np.max(z)-z) / (np.max(z)-np.min(z))
+
+ # Creating a Triangulation
+ n_angles = 30
+ n_radii = 10
+ min_radius = 0.2
+ radii = np.linspace(min_radius, 0.95, n_radii)
+ angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)
+ angles = np.repeat(angles[..., np.newaxis], n_radii, axis=1)
+ angles[:, 1::2] += np.pi/n_angles
+ x = (radii*np.cos(angles)).flatten()
+ y = (radii*np.sin(angles)).flatten()
+ V = dipole_potential(x, y)
+ triang = mtri.Triangulation(x, y)
+ triang.set_mask(np.hypot(x[triang.triangles].mean(axis=1),
+ y[triang.triangles].mean(axis=1))
+ < min_radius)
+
+ # Refine data - interpolates the electrical potential V
+ refiner = mtri.UniformTriRefiner(triang)
+ tri_refi, z_test_refi = refiner.refine_field(V, subdiv=3)
+
+ # Computes the electrical field (Ex, Ey) as gradient of -V
+ tci = mtri.CubicTriInterpolator(triang, -V)
+ Ex, Ey = tci.gradient(triang.x, triang.y)
+ E_norm = np.hypot(Ex, Ey)
+
+ # Plot the triangulation, the potential iso-contours and the vector field
+ plt.figure()
+ plt.gca().set_aspect('equal')
+ plt.triplot(triang, color='0.8')
+
+ levels = np.arange(0., 1., 0.01)
+ cmap = mpl.colormaps['hot']
+ plt.tricontour(tri_refi, z_test_refi, levels=levels, cmap=cmap,
+ linewidths=[2.0, 1.0, 1.0, 1.0])
+ # Plots direction of the electrical vector field
+ plt.quiver(triang.x, triang.y, Ex/E_norm, Ey/E_norm,
+ units='xy', scale=10., zorder=3, color='blue',
+ width=0.007, headwidth=3., headlength=4.)
+ # We are leaving ax.use_sticky_margins as True, so the
+ # view limits are the contour data limits.
+
+
+def test_tritools():
+ # Tests TriAnalyzer.scale_factors on masked triangulation
+ # Tests circle_ratios on equilateral and right-angled triangle.
+ x = np.array([0., 1., 0.5, 0., 2.])
+ y = np.array([0., 0., 0.5*np.sqrt(3.), -1., 1.])
+ triangles = np.array([[0, 1, 2], [0, 1, 3], [1, 2, 4]], dtype=np.int32)
+ mask = np.array([False, False, True], dtype=bool)
+ triang = mtri.Triangulation(x, y, triangles, mask=mask)
+ analyser = mtri.TriAnalyzer(triang)
+ assert_array_almost_equal(analyser.scale_factors, [1, 1/(1+3**.5/2)])
+ assert_array_almost_equal(
+ analyser.circle_ratios(rescale=False),
+ np.ma.masked_array([0.5, 1./(1.+np.sqrt(2.)), np.nan], mask))
+
+ # Tests circle ratio of a flat triangle
+ x = np.array([0., 1., 2.])
+ y = np.array([1., 1.+3., 1.+6.])
+ triangles = np.array([[0, 1, 2]], dtype=np.int32)
+ triang = mtri.Triangulation(x, y, triangles)
+ analyser = mtri.TriAnalyzer(triang)
+ assert_array_almost_equal(analyser.circle_ratios(), np.array([0.]))
+
+ # Tests TriAnalyzer.get_flat_tri_mask
+ # Creates a triangulation of [-1, 1] x [-1, 1] with contiguous groups of
+ # 'flat' triangles at the 4 corners and at the center. Checks that only
+ # those at the borders are eliminated by TriAnalyzer.get_flat_tri_mask
+ n = 9
+
+ def power(x, a):
+ return np.abs(x)**a*np.sign(x)
+
+ x = np.linspace(-1., 1., n+1)
+ x, y = np.meshgrid(power(x, 2.), power(x, 0.25))
+ x = x.ravel()
+ y = y.ravel()
+
+ triang = mtri.Triangulation(x, y, triangles=meshgrid_triangles(n+1))
+ analyser = mtri.TriAnalyzer(triang)
+ mask_flat = analyser.get_flat_tri_mask(0.2)
+ verif_mask = np.zeros(162, dtype=bool)
+ corners_index = [0, 1, 2, 3, 14, 15, 16, 17, 18, 19, 34, 35, 126, 127,
+ 142, 143, 144, 145, 146, 147, 158, 159, 160, 161]
+ verif_mask[corners_index] = True
+ assert_array_equal(mask_flat, verif_mask)
+
+ # Now including a hole (masked triangle) at the center. The center also
+ # shall be eliminated by get_flat_tri_mask.
+ mask = np.zeros(162, dtype=bool)
+ mask[80] = True
+ triang.set_mask(mask)
+ mask_flat = analyser.get_flat_tri_mask(0.2)
+ center_index = [44, 45, 62, 63, 78, 79, 80, 81, 82, 83, 98, 99, 116, 117]
+ verif_mask[center_index] = True
+ assert_array_equal(mask_flat, verif_mask)
+
+
+def test_trirefine():
+ # Testing subdiv=2 refinement
+ n = 3
+ subdiv = 2
+ x = np.linspace(-1., 1., n+1)
+ x, y = np.meshgrid(x, x)
+ x = x.ravel()
+ y = y.ravel()
+ mask = np.zeros(2*n**2, dtype=bool)
+ mask[n**2:] = True
+ triang = mtri.Triangulation(x, y, triangles=meshgrid_triangles(n+1),
+ mask=mask)
+ refiner = mtri.UniformTriRefiner(triang)
+ refi_triang = refiner.refine_triangulation(subdiv=subdiv)
+ x_refi = refi_triang.x
+ y_refi = refi_triang.y
+
+ n_refi = n * subdiv**2
+ x_verif = np.linspace(-1., 1., n_refi+1)
+ x_verif, y_verif = np.meshgrid(x_verif, x_verif)
+ x_verif = x_verif.ravel()
+ y_verif = y_verif.ravel()
+ ind1d = np.isin(np.around(x_verif*(2.5+y_verif), 8),
+ np.around(x_refi*(2.5+y_refi), 8))
+ assert_array_equal(ind1d, True)
+
+ # Testing the mask of the refined triangulation
+ refi_mask = refi_triang.mask
+ refi_tri_barycenter_x = np.sum(refi_triang.x[refi_triang.triangles],
+ axis=1) / 3.
+ refi_tri_barycenter_y = np.sum(refi_triang.y[refi_triang.triangles],
+ axis=1) / 3.
+ tri_finder = triang.get_trifinder()
+ refi_tri_indices = tri_finder(refi_tri_barycenter_x,
+ refi_tri_barycenter_y)
+ refi_tri_mask = triang.mask[refi_tri_indices]
+ assert_array_equal(refi_mask, refi_tri_mask)
+
+ # Testing that the numbering of triangles does not change the
+ # interpolation result.
+ x = np.asarray([0.0, 1.0, 0.0, 1.0])
+ y = np.asarray([0.0, 0.0, 1.0, 1.0])
+ triang = [mtri.Triangulation(x, y, [[0, 1, 3], [3, 2, 0]]),
+ mtri.Triangulation(x, y, [[0, 1, 3], [2, 0, 3]])]
+ z = np.hypot(x - 0.3, y - 0.4)
+ # Refining the 2 triangulations and reordering the points
+ xyz_data = []
+ for i in range(2):
+ refiner = mtri.UniformTriRefiner(triang[i])
+ refined_triang, refined_z = refiner.refine_field(z, subdiv=1)
+ xyz = np.dstack((refined_triang.x, refined_triang.y, refined_z))[0]
+ xyz = xyz[np.lexsort((xyz[:, 1], xyz[:, 0]))]
+ xyz_data += [xyz]
+ assert_array_almost_equal(xyz_data[0], xyz_data[1])
+
+
+@pytest.mark.parametrize('interpolator',
+ [mtri.LinearTriInterpolator,
+ mtri.CubicTriInterpolator],
+ ids=['linear', 'cubic'])
+def test_trirefine_masked(interpolator):
+ # Repeated points means we will have fewer triangles than points, and thus
+ # get masking.
+ x, y = np.mgrid[:2, :2]
+ x = np.repeat(x.flatten(), 2)
+ y = np.repeat(y.flatten(), 2)
+
+ z = np.zeros_like(x)
+ tri = mtri.Triangulation(x, y)
+ refiner = mtri.UniformTriRefiner(tri)
+ interp = interpolator(tri, z)
+ refiner.refine_field(z, triinterpolator=interp, subdiv=2)
+
+
+def meshgrid_triangles(n):
+ """
+ Return (2*(N-1)**2, 3) array of triangles to mesh (N, N)-point np.meshgrid.
+ """
+ tri = []
+ for i in range(n-1):
+ for j in range(n-1):
+ a = i + j*n
+ b = (i+1) + j*n
+ c = i + (j+1)*n
+ d = (i+1) + (j+1)*n
+ tri += [[a, b, d], [a, d, c]]
+ return np.array(tri, dtype=np.int32)
+
+
+def test_triplot_return():
+ # Check that triplot returns the artists it adds
+ ax = plt.figure().add_subplot()
+ triang = mtri.Triangulation(
+ [0.0, 1.0, 0.0, 1.0], [0.0, 0.0, 1.0, 1.0],
+ triangles=[[0, 1, 3], [3, 2, 0]])
+ assert ax.triplot(triang, "b-") is not None, \
+ 'triplot should return the artist it adds'
+
+
+def test_trirefiner_fortran_contiguous_triangles():
+ # github issue 4180. Test requires two arrays of triangles that are
+ # identical except that one is C-contiguous and one is fortran-contiguous.
+ triangles1 = np.array([[2, 0, 3], [2, 1, 0]])
+ assert not np.isfortran(triangles1)
+
+ triangles2 = np.array(triangles1, copy=True, order='F')
+ assert np.isfortran(triangles2)
+
+ x = np.array([0.39, 0.59, 0.43, 0.32])
+ y = np.array([33.99, 34.01, 34.19, 34.18])
+ triang1 = mtri.Triangulation(x, y, triangles1)
+ triang2 = mtri.Triangulation(x, y, triangles2)
+
+ refiner1 = mtri.UniformTriRefiner(triang1)
+ refiner2 = mtri.UniformTriRefiner(triang2)
+
+ fine_triang1 = refiner1.refine_triangulation(subdiv=1)
+ fine_triang2 = refiner2.refine_triangulation(subdiv=1)
+
+ assert_array_equal(fine_triang1.triangles, fine_triang2.triangles)
+
+
+def test_qhull_triangle_orientation():
+ # github issue 4437.
+ xi = np.linspace(-2, 2, 100)
+ x, y = map(np.ravel, np.meshgrid(xi, xi))
+ w = (x > y - 1) & (x < -1.95) & (y > -1.2)
+ x, y = x[w], y[w]
+ theta = np.radians(25)
+ x1 = x*np.cos(theta) - y*np.sin(theta)
+ y1 = x*np.sin(theta) + y*np.cos(theta)
+
+ # Calculate Delaunay triangulation using Qhull.
+ triang = mtri.Triangulation(x1, y1)
+
+ # Neighbors returned by Qhull.
+ qhull_neighbors = triang.neighbors
+
+ # Obtain neighbors using own C++ calculation.
+ triang._neighbors = None
+ own_neighbors = triang.neighbors
+
+ assert_array_equal(qhull_neighbors, own_neighbors)
+
+
+def test_trianalyzer_mismatched_indices():
+ # github issue 4999.
+ x = np.array([0., 1., 0.5, 0., 2.])
+ y = np.array([0., 0., 0.5*np.sqrt(3.), -1., 1.])
+ triangles = np.array([[0, 1, 2], [0, 1, 3], [1, 2, 4]], dtype=np.int32)
+ mask = np.array([False, False, True], dtype=bool)
+ triang = mtri.Triangulation(x, y, triangles, mask=mask)
+ analyser = mtri.TriAnalyzer(triang)
+ # numpy >= 1.10 raises a VisibleDeprecationWarning in the following line
+ # prior to the fix.
+ analyser._get_compressed_triangulation()
+
+
+def test_tricontourf_decreasing_levels():
+ # github issue 5477.
+ x = [0.0, 1.0, 1.0]
+ y = [0.0, 0.0, 1.0]
+ z = [0.2, 0.4, 0.6]
+ plt.figure()
+ with pytest.raises(ValueError):
+ plt.tricontourf(x, y, z, [1.0, 0.0])
+
+
+def test_internal_cpp_api() -> None:
+ # Following github issue 8197.
+ from matplotlib import _tri # noqa: F401, ensure lazy-loaded module *is* loaded.
+
+ # C++ Triangulation.
+ with pytest.raises(
+ TypeError,
+ match=r'__init__\(\): incompatible constructor arguments.'):
+ mpl._tri.Triangulation() # type: ignore[call-arg]
+
+ with pytest.raises(
+ ValueError, match=r'x and y must be 1D arrays of the same length'):
+ mpl._tri.Triangulation(np.array([]), np.array([1]), np.array([[]]), (), (), (),
+ False)
+
+ x = np.array([0, 1, 1], dtype=np.float64)
+ y = np.array([0, 0, 1], dtype=np.float64)
+ with pytest.raises(
+ ValueError,
+ match=r'triangles must be a 2D array of shape \(\?,3\)'):
+ mpl._tri.Triangulation(x, y, np.array([[0, 1]]), (), (), (), False)
+
+ tris = np.array([[0, 1, 2]], dtype=np.int_)
+ with pytest.raises(
+ ValueError,
+ match=r'mask must be a 1D array with the same length as the '
+ r'triangles array'):
+ mpl._tri.Triangulation(x, y, tris, np.array([0, 1]), (), (), False)
+
+ with pytest.raises(
+ ValueError, match=r'edges must be a 2D array with shape \(\?,2\)'):
+ mpl._tri.Triangulation(x, y, tris, (), np.array([[1]]), (), False)
+
+ with pytest.raises(
+ ValueError,
+ match=r'neighbors must be a 2D array with the same shape as the '
+ r'triangles array'):
+ mpl._tri.Triangulation(x, y, tris, (), (), np.array([[-1]]), False)
+
+ triang = mpl._tri.Triangulation(x, y, tris, (), (), (), False)
+
+ with pytest.raises(
+ ValueError,
+ match=r'z must be a 1D array with the same length as the '
+ r'triangulation x and y arrays'):
+ triang.calculate_plane_coefficients([])
+
+ for mask in ([0, 1], None):
+ with pytest.raises(
+ ValueError,
+ match=r'mask must be a 1D array with the same length as the '
+ r'triangles array'):
+ triang.set_mask(mask) # type: ignore[arg-type]
+
+ triang.set_mask(np.array([True]))
+ assert_array_equal(triang.get_edges(), np.empty((0, 2)))
+
+ triang.set_mask(()) # Equivalent to Python Triangulation mask=None
+ assert_array_equal(triang.get_edges(), [[1, 0], [2, 0], [2, 1]])
+
+ # C++ TriContourGenerator.
+ with pytest.raises(
+ TypeError,
+ match=r'__init__\(\): incompatible constructor arguments.'):
+ mpl._tri.TriContourGenerator() # type: ignore[call-arg]
+
+ with pytest.raises(
+ ValueError,
+ match=r'z must be a 1D array with the same length as the x and y arrays'):
+ mpl._tri.TriContourGenerator(triang, np.array([1]))
+
+ z = np.array([0, 1, 2])
+ tcg = mpl._tri.TriContourGenerator(triang, z)
+
+ with pytest.raises(
+ ValueError, match=r'filled contour levels must be increasing'):
+ tcg.create_filled_contour(1, 0)
+
+ # C++ TrapezoidMapTriFinder.
+ with pytest.raises(
+ TypeError,
+ match=r'__init__\(\): incompatible constructor arguments.'):
+ mpl._tri.TrapezoidMapTriFinder() # type: ignore[call-arg]
+
+ trifinder = mpl._tri.TrapezoidMapTriFinder(triang)
+
+ with pytest.raises(
+ ValueError, match=r'x and y must be array-like with same shape'):
+ trifinder.find_many(np.array([0]), np.array([0, 1]))
+
+
+def test_qhull_large_offset():
+ # github issue 8682.
+ x = np.asarray([0, 1, 0, 1, 0.5])
+ y = np.asarray([0, 0, 1, 1, 0.5])
+
+ offset = 1e10
+ triang = mtri.Triangulation(x, y)
+ triang_offset = mtri.Triangulation(x + offset, y + offset)
+ assert len(triang.triangles) == len(triang_offset.triangles)
+
+
+def test_tricontour_non_finite_z():
+ # github issue 10167.
+ x = [0, 1, 0, 1]
+ y = [0, 0, 1, 1]
+ triang = mtri.Triangulation(x, y)
+ plt.figure()
+
+ with pytest.raises(ValueError, match='z array must not contain non-finite '
+ 'values within the triangulation'):
+ plt.tricontourf(triang, [0, 1, 2, np.inf])
+
+ with pytest.raises(ValueError, match='z array must not contain non-finite '
+ 'values within the triangulation'):
+ plt.tricontourf(triang, [0, 1, 2, -np.inf])
+
+ with pytest.raises(ValueError, match='z array must not contain non-finite '
+ 'values within the triangulation'):
+ plt.tricontourf(triang, [0, 1, 2, np.nan])
+
+ with pytest.raises(ValueError, match='z must not contain masked points '
+ 'within the triangulation'):
+ plt.tricontourf(triang, np.ma.array([0, 1, 2, 3], mask=[1, 0, 0, 0]))
+
+
+def test_tricontourset_reuse():
+ # If TriContourSet returned from one tricontour(f) call is passed as first
+ # argument to another the underlying C++ contour generator will be reused.
+ x = [0.0, 0.5, 1.0]
+ y = [0.0, 1.0, 0.0]
+ z = [1.0, 2.0, 3.0]
+ fig, ax = plt.subplots()
+ tcs1 = ax.tricontourf(x, y, z)
+ tcs2 = ax.tricontour(x, y, z)
+ assert tcs2._contour_generator != tcs1._contour_generator
+ tcs3 = ax.tricontour(tcs1, z)
+ assert tcs3._contour_generator == tcs1._contour_generator
+
+
+@check_figures_equal(extensions=['png'])
+def test_triplot_with_ls(fig_test, fig_ref):
+ x = [0, 2, 1]
+ y = [0, 0, 1]
+ data = [[0, 1, 2]]
+ fig_test.subplots().triplot(x, y, data, ls='--')
+ fig_ref.subplots().triplot(x, y, data, linestyle='--')
+
+
+def test_triplot_label():
+ x = [0, 2, 1]
+ y = [0, 0, 1]
+ data = [[0, 1, 2]]
+ fig, ax = plt.subplots()
+ lines, markers = ax.triplot(x, y, data, label='label')
+ handles, labels = ax.get_legend_handles_labels()
+ assert labels == ['label']
+ assert len(handles) == 1
+ assert handles[0] is lines
+
+
+def test_tricontour_path():
+ x = [0, 4, 4, 0, 2]
+ y = [0, 0, 4, 4, 2]
+ triang = mtri.Triangulation(x, y)
+ _, ax = plt.subplots()
+
+ # Line strip from boundary to boundary
+ cs = ax.tricontour(triang, [1, 0, 0, 0, 0], levels=[0.5])
+ paths = cs.get_paths()
+ assert len(paths) == 1
+ expected_vertices = [[2, 0], [1, 1], [0, 2]]
+ assert_array_almost_equal(paths[0].vertices, expected_vertices)
+ assert_array_equal(paths[0].codes, [1, 2, 2])
+ assert_array_almost_equal(
+ paths[0].to_polygons(closed_only=False), [expected_vertices])
+
+ # Closed line loop inside domain
+ cs = ax.tricontour(triang, [0, 0, 0, 0, 1], levels=[0.5])
+ paths = cs.get_paths()
+ assert len(paths) == 1
+ expected_vertices = [[3, 1], [3, 3], [1, 3], [1, 1], [3, 1]]
+ assert_array_almost_equal(paths[0].vertices, expected_vertices)
+ assert_array_equal(paths[0].codes, [1, 2, 2, 2, 79])
+ assert_array_almost_equal(paths[0].to_polygons(), [expected_vertices])
+
+
+def test_tricontourf_path():
+ x = [0, 4, 4, 0, 2]
+ y = [0, 0, 4, 4, 2]
+ triang = mtri.Triangulation(x, y)
+ _, ax = plt.subplots()
+
+ # Polygon inside domain
+ cs = ax.tricontourf(triang, [0, 0, 0, 0, 1], levels=[0.5, 1.5])
+ paths = cs.get_paths()
+ assert len(paths) == 1
+ expected_vertices = [[3, 1], [3, 3], [1, 3], [1, 1], [3, 1]]
+ assert_array_almost_equal(paths[0].vertices, expected_vertices)
+ assert_array_equal(paths[0].codes, [1, 2, 2, 2, 79])
+ assert_array_almost_equal(paths[0].to_polygons(), [expected_vertices])
+
+ # Polygon following boundary and inside domain
+ cs = ax.tricontourf(triang, [1, 0, 0, 0, 0], levels=[0.5, 1.5])
+ paths = cs.get_paths()
+ assert len(paths) == 1
+ expected_vertices = [[2, 0], [1, 1], [0, 2], [0, 0], [2, 0]]
+ assert_array_almost_equal(paths[0].vertices, expected_vertices)
+ assert_array_equal(paths[0].codes, [1, 2, 2, 2, 79])
+ assert_array_almost_equal(paths[0].to_polygons(), [expected_vertices])
+
+ # Polygon is outer boundary with hole
+ cs = ax.tricontourf(triang, [0, 0, 0, 0, 1], levels=[-0.5, 0.5])
+ paths = cs.get_paths()
+ assert len(paths) == 1
+ expected_vertices = [[0, 0], [4, 0], [4, 4], [0, 4], [0, 0],
+ [1, 1], [1, 3], [3, 3], [3, 1], [1, 1]]
+ assert_array_almost_equal(paths[0].vertices, expected_vertices)
+ assert_array_equal(paths[0].codes, [1, 2, 2, 2, 79, 1, 2, 2, 2, 79])
+ assert_array_almost_equal(paths[0].to_polygons(), np.split(expected_vertices, [5]))
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/texmanager.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/texmanager.py
new file mode 100644
index 0000000000000000000000000000000000000000..2083510396f1af8325dafd98396f62a68c142f7d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/texmanager.py
@@ -0,0 +1,368 @@
+r"""
+Support for embedded TeX expressions in Matplotlib.
+
+Requirements:
+
+* LaTeX.
+* \*Agg backends: dvipng>=1.6.
+* PS backend: PSfrag, dvips, and Ghostscript>=9.0.
+* PDF and SVG backends: if LuaTeX is present, it will be used to speed up some
+ post-processing steps, but note that it is not used to parse the TeX string
+ itself (only LaTeX is supported).
+
+To enable TeX rendering of all text in your Matplotlib figure, set
+:rc:`text.usetex` to True.
+
+TeX and dvipng/dvips processing results are cached
+in ~/.matplotlib/tex.cache for reuse between sessions.
+
+`TexManager.get_rgba` can also be used to directly obtain raster output as RGBA
+NumPy arrays.
+"""
+
+import functools
+import hashlib
+import logging
+import os
+from pathlib import Path
+import subprocess
+from tempfile import TemporaryDirectory
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import cbook, dviread
+
+_log = logging.getLogger(__name__)
+
+
+def _usepackage_if_not_loaded(package, *, option=None):
+ """
+ Output LaTeX code that loads a package (possibly with an option) if it
+ hasn't been loaded yet.
+
+ LaTeX cannot load twice a package with different options, so this helper
+ can be used to protect against users loading arbitrary packages/options in
+ their custom preamble.
+ """
+ option = f"[{option}]" if option is not None else ""
+ return (
+ r"\makeatletter"
+ r"\@ifpackageloaded{%(package)s}{}{\usepackage%(option)s{%(package)s}}"
+ r"\makeatother"
+ ) % {"package": package, "option": option}
+
+
+class TexManager:
+ """
+ Convert strings to dvi files using TeX, caching the results to a directory.
+
+ The cache directory is called ``tex.cache`` and is located in the directory
+ returned by `.get_cachedir`.
+
+ Repeated calls to this constructor always return the same instance.
+ """
+
+ _texcache = os.path.join(mpl.get_cachedir(), 'tex.cache')
+ _grey_arrayd = {}
+
+ _font_families = ('serif', 'sans-serif', 'cursive', 'monospace')
+ _font_preambles = {
+ 'new century schoolbook': r'\renewcommand{\rmdefault}{pnc}',
+ 'bookman': r'\renewcommand{\rmdefault}{pbk}',
+ 'times': r'\usepackage{mathptmx}',
+ 'palatino': r'\usepackage{mathpazo}',
+ 'zapf chancery': r'\usepackage{chancery}',
+ 'cursive': r'\usepackage{chancery}',
+ 'charter': r'\usepackage{charter}',
+ 'serif': '',
+ 'sans-serif': '',
+ 'helvetica': r'\usepackage{helvet}',
+ 'avant garde': r'\usepackage{avant}',
+ 'courier': r'\usepackage{courier}',
+ # Loading the type1ec package ensures that cm-super is installed, which
+ # is necessary for Unicode computer modern. (It also allows the use of
+ # computer modern at arbitrary sizes, but that's just a side effect.)
+ 'monospace': r'\usepackage{type1ec}',
+ 'computer modern roman': r'\usepackage{type1ec}',
+ 'computer modern sans serif': r'\usepackage{type1ec}',
+ 'computer modern typewriter': r'\usepackage{type1ec}',
+ }
+ _font_types = {
+ 'new century schoolbook': 'serif',
+ 'bookman': 'serif',
+ 'times': 'serif',
+ 'palatino': 'serif',
+ 'zapf chancery': 'cursive',
+ 'charter': 'serif',
+ 'helvetica': 'sans-serif',
+ 'avant garde': 'sans-serif',
+ 'courier': 'monospace',
+ 'computer modern roman': 'serif',
+ 'computer modern sans serif': 'sans-serif',
+ 'computer modern typewriter': 'monospace',
+ }
+
+ @functools.lru_cache # Always return the same instance.
+ def __new__(cls):
+ Path(cls._texcache).mkdir(parents=True, exist_ok=True)
+ return object.__new__(cls)
+
+ @classmethod
+ def _get_font_family_and_reduced(cls):
+ """Return the font family name and whether the font is reduced."""
+ ff = mpl.rcParams['font.family']
+ ff_val = ff[0].lower() if len(ff) == 1 else None
+ if len(ff) == 1 and ff_val in cls._font_families:
+ return ff_val, False
+ elif len(ff) == 1 and ff_val in cls._font_preambles:
+ return cls._font_types[ff_val], True
+ else:
+ _log.info('font.family must be one of (%s) when text.usetex is '
+ 'True. serif will be used by default.',
+ ', '.join(cls._font_families))
+ return 'serif', False
+
+ @classmethod
+ def _get_font_preamble_and_command(cls):
+ requested_family, is_reduced_font = cls._get_font_family_and_reduced()
+
+ preambles = {}
+ for font_family in cls._font_families:
+ if is_reduced_font and font_family == requested_family:
+ preambles[font_family] = cls._font_preambles[
+ mpl.rcParams['font.family'][0].lower()]
+ else:
+ rcfonts = mpl.rcParams[f"font.{font_family}"]
+ for i, font in enumerate(map(str.lower, rcfonts)):
+ if font in cls._font_preambles:
+ preambles[font_family] = cls._font_preambles[font]
+ _log.debug(
+ 'family: %s, package: %s, font: %s, skipped: %s',
+ font_family, cls._font_preambles[font], rcfonts[i],
+ ', '.join(rcfonts[:i]),
+ )
+ break
+ else:
+ _log.info('No LaTeX-compatible font found for the %s font'
+ 'family in rcParams. Using default.',
+ font_family)
+ preambles[font_family] = cls._font_preambles[font_family]
+
+ # The following packages and commands need to be included in the latex
+ # file's preamble:
+ cmd = {preambles[family]
+ for family in ['serif', 'sans-serif', 'monospace']}
+ if requested_family == 'cursive':
+ cmd.add(preambles['cursive'])
+ cmd.add(r'\usepackage{type1cm}')
+ preamble = '\n'.join(sorted(cmd))
+ fontcmd = (r'\sffamily' if requested_family == 'sans-serif' else
+ r'\ttfamily' if requested_family == 'monospace' else
+ r'\rmfamily')
+ return preamble, fontcmd
+
+ @classmethod
+ def get_basefile(cls, tex, fontsize, dpi=None):
+ """
+ Return a filename based on a hash of the string, fontsize, and dpi.
+ """
+ src = cls._get_tex_source(tex, fontsize) + str(dpi)
+ filehash = hashlib.sha256(
+ src.encode('utf-8'),
+ usedforsecurity=False
+ ).hexdigest()
+ filepath = Path(cls._texcache)
+
+ num_letters, num_levels = 2, 2
+ for i in range(0, num_letters*num_levels, num_letters):
+ filepath = filepath / Path(filehash[i:i+2])
+
+ filepath.mkdir(parents=True, exist_ok=True)
+ return os.path.join(filepath, filehash)
+
+ @classmethod
+ def get_font_preamble(cls):
+ """
+ Return a string containing font configuration for the tex preamble.
+ """
+ font_preamble, command = cls._get_font_preamble_and_command()
+ return font_preamble
+
+ @classmethod
+ def get_custom_preamble(cls):
+ """Return a string containing user additions to the tex preamble."""
+ return mpl.rcParams['text.latex.preamble']
+
+ @classmethod
+ def _get_tex_source(cls, tex, fontsize):
+ """Return the complete TeX source for processing a TeX string."""
+ font_preamble, fontcmd = cls._get_font_preamble_and_command()
+ baselineskip = 1.25 * fontsize
+ return "\n".join([
+ r"\documentclass{article}",
+ r"% Pass-through \mathdefault, which is used in non-usetex mode",
+ r"% to use the default text font but was historically suppressed",
+ r"% in usetex mode.",
+ r"\newcommand{\mathdefault}[1]{#1}",
+ font_preamble,
+ r"\usepackage[utf8]{inputenc}",
+ r"\DeclareUnicodeCharacter{2212}{\ensuremath{-}}",
+ r"% geometry is loaded before the custom preamble as ",
+ r"% convert_psfrags relies on a custom preamble to change the ",
+ r"% geometry.",
+ r"\usepackage[papersize=72in, margin=1in]{geometry}",
+ cls.get_custom_preamble(),
+ r"% Use `underscore` package to take care of underscores in text.",
+ r"% The [strings] option allows to use underscores in file names.",
+ _usepackage_if_not_loaded("underscore", option="strings"),
+ r"% Custom packages (e.g. newtxtext) may already have loaded ",
+ r"% textcomp with different options.",
+ _usepackage_if_not_loaded("textcomp"),
+ r"\pagestyle{empty}",
+ r"\begin{document}",
+ r"% The empty hbox ensures that a page is printed even for empty",
+ r"% inputs, except when using psfrag which gets confused by it.",
+ r"% matplotlibbaselinemarker is used by dviread to detect the",
+ r"% last line's baseline.",
+ rf"\fontsize{{{fontsize}}}{{{baselineskip}}}%",
+ r"\ifdefined\psfrag\else\hbox{}\fi%",
+ rf"{{{fontcmd} {tex}}}%",
+ r"\end{document}",
+ ])
+
+ @classmethod
+ def make_tex(cls, tex, fontsize):
+ """
+ Generate a tex file to render the tex string at a specific font size.
+
+ Return the file name.
+ """
+ texfile = cls.get_basefile(tex, fontsize) + ".tex"
+ Path(texfile).write_text(cls._get_tex_source(tex, fontsize),
+ encoding='utf-8')
+ return texfile
+
+ @classmethod
+ def _run_checked_subprocess(cls, command, tex, *, cwd=None):
+ _log.debug(cbook._pformat_subprocess(command))
+ try:
+ report = subprocess.check_output(
+ command, cwd=cwd if cwd is not None else cls._texcache,
+ stderr=subprocess.STDOUT)
+ except FileNotFoundError as exc:
+ raise RuntimeError(
+ f'Failed to process string with tex because {command[0]} '
+ 'could not be found') from exc
+ except subprocess.CalledProcessError as exc:
+ raise RuntimeError(
+ '{prog} was not able to process the following string:\n'
+ '{tex!r}\n\n'
+ 'Here is the full command invocation and its output:\n\n'
+ '{format_command}\n\n'
+ '{exc}\n\n'.format(
+ prog=command[0],
+ format_command=cbook._pformat_subprocess(command),
+ tex=tex.encode('unicode_escape'),
+ exc=exc.output.decode('utf-8', 'backslashreplace'))
+ ) from None
+ _log.debug(report)
+ return report
+
+ @classmethod
+ def make_dvi(cls, tex, fontsize):
+ """
+ Generate a dvi file containing latex's layout of tex string.
+
+ Return the file name.
+ """
+ basefile = cls.get_basefile(tex, fontsize)
+ dvifile = '%s.dvi' % basefile
+ if not os.path.exists(dvifile):
+ texfile = Path(cls.make_tex(tex, fontsize))
+ # Generate the dvi in a temporary directory to avoid race
+ # conditions e.g. if multiple processes try to process the same tex
+ # string at the same time. Having tmpdir be a subdirectory of the
+ # final output dir ensures that they are on the same filesystem,
+ # and thus replace() works atomically. It also allows referring to
+ # the texfile with a relative path (for pathological MPLCONFIGDIRs,
+ # the absolute path may contain characters (e.g. ~) that TeX does
+ # not support; n.b. relative paths cannot traverse parents, or it
+ # will be blocked when `openin_any = p` in texmf.cnf).
+ cwd = Path(dvifile).parent
+ with TemporaryDirectory(dir=cwd) as tmpdir:
+ tmppath = Path(tmpdir)
+ cls._run_checked_subprocess(
+ ["latex", "-interaction=nonstopmode", "--halt-on-error",
+ f"--output-directory={tmppath.name}",
+ f"{texfile.name}"], tex, cwd=cwd)
+ (tmppath / Path(dvifile).name).replace(dvifile)
+ return dvifile
+
+ @classmethod
+ def make_png(cls, tex, fontsize, dpi):
+ """
+ Generate a png file containing latex's rendering of tex string.
+
+ Return the file name.
+ """
+ basefile = cls.get_basefile(tex, fontsize, dpi)
+ pngfile = '%s.png' % basefile
+ # see get_rgba for a discussion of the background
+ if not os.path.exists(pngfile):
+ dvifile = cls.make_dvi(tex, fontsize)
+ cmd = ["dvipng", "-bg", "Transparent", "-D", str(dpi),
+ "-T", "tight", "-o", pngfile, dvifile]
+ # When testing, disable FreeType rendering for reproducibility; but
+ # dvipng 1.16 has a bug (fixed in f3ff241) that breaks --freetype0
+ # mode, so for it we keep FreeType enabled; the image will be
+ # slightly off.
+ if (getattr(mpl, "_called_from_pytest", False) and
+ mpl._get_executable_info("dvipng").raw_version != "1.16"):
+ cmd.insert(1, "--freetype0")
+ cls._run_checked_subprocess(cmd, tex)
+ return pngfile
+
+ @classmethod
+ def get_grey(cls, tex, fontsize=None, dpi=None):
+ """Return the alpha channel."""
+ if not fontsize:
+ fontsize = mpl.rcParams['font.size']
+ if not dpi:
+ dpi = mpl.rcParams['savefig.dpi']
+ key = cls._get_tex_source(tex, fontsize), dpi
+ alpha = cls._grey_arrayd.get(key)
+ if alpha is None:
+ pngfile = cls.make_png(tex, fontsize, dpi)
+ rgba = mpl.image.imread(os.path.join(cls._texcache, pngfile))
+ cls._grey_arrayd[key] = alpha = rgba[:, :, -1]
+ return alpha
+
+ @classmethod
+ def get_rgba(cls, tex, fontsize=None, dpi=None, rgb=(0, 0, 0)):
+ r"""
+ Return latex's rendering of the tex string as an RGBA array.
+
+ Examples
+ --------
+ >>> texmanager = TexManager()
+ >>> s = r"\TeX\ is $\displaystyle\sum_n\frac{-e^{i\pi}}{2^n}$!"
+ >>> Z = texmanager.get_rgba(s, fontsize=12, dpi=80, rgb=(1, 0, 0))
+ """
+ alpha = cls.get_grey(tex, fontsize, dpi)
+ rgba = np.empty((*alpha.shape, 4))
+ rgba[..., :3] = mpl.colors.to_rgb(rgb)
+ rgba[..., -1] = alpha
+ return rgba
+
+ @classmethod
+ def get_text_width_height_descent(cls, tex, fontsize, renderer=None):
+ """Return width, height and descent of the text."""
+ if tex.strip() == '':
+ return 0, 0, 0
+ dvifile = cls.make_dvi(tex, fontsize)
+ dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
+ with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:
+ page, = dvi
+ # A total height (including the descent) needs to be returned.
+ return page.width, page.height + page.descent, page.descent
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/texmanager.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/texmanager.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..94f0d76fa814c6015fd4acefca5b1c1732645c85
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/texmanager.pyi
@@ -0,0 +1,38 @@
+from .backend_bases import RendererBase
+
+from matplotlib.typing import ColorType
+
+import numpy as np
+
+class TexManager:
+ texcache: str
+ @classmethod
+ def get_basefile(
+ cls, tex: str, fontsize: float, dpi: float | None = ...
+ ) -> str: ...
+ @classmethod
+ def get_font_preamble(cls) -> str: ...
+ @classmethod
+ def get_custom_preamble(cls) -> str: ...
+ @classmethod
+ def make_tex(cls, tex: str, fontsize: float) -> str: ...
+ @classmethod
+ def make_dvi(cls, tex: str, fontsize: float) -> str: ...
+ @classmethod
+ def make_png(cls, tex: str, fontsize: float, dpi: float) -> str: ...
+ @classmethod
+ def get_grey(
+ cls, tex: str, fontsize: float | None = ..., dpi: float | None = ...
+ ) -> np.ndarray: ...
+ @classmethod
+ def get_rgba(
+ cls,
+ tex: str,
+ fontsize: float | None = ...,
+ dpi: float | None = ...,
+ rgb: ColorType = ...,
+ ) -> np.ndarray: ...
+ @classmethod
+ def get_text_width_height_descent(
+ cls, tex: str, fontsize, renderer: RendererBase | None = ...
+ ) -> tuple[int, int, int]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/text.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/text.py
new file mode 100644
index 0000000000000000000000000000000000000000..d18fc51b070c58a079f01b550bc9d2072c7e4d80
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/text.py
@@ -0,0 +1,2035 @@
+"""
+Classes for including text in a figure.
+"""
+
+import functools
+import logging
+import math
+from numbers import Real
+import weakref
+
+import numpy as np
+
+import matplotlib as mpl
+from . import _api, artist, cbook, _docstring
+from .artist import Artist
+from .font_manager import FontProperties
+from .patches import FancyArrowPatch, FancyBboxPatch, Rectangle
+from .textpath import TextPath, TextToPath # noqa # Logically located here
+from .transforms import (
+ Affine2D, Bbox, BboxBase, BboxTransformTo, IdentityTransform, Transform)
+
+
+_log = logging.getLogger(__name__)
+
+
+def _get_textbox(text, renderer):
+ """
+ Calculate the bounding box of the text.
+
+ The bbox position takes text rotation into account, but the width and
+ height are those of the unrotated box (unlike `.Text.get_window_extent`).
+ """
+ # TODO : This function may move into the Text class as a method. As a
+ # matter of fact, the information from the _get_textbox function
+ # should be available during the Text._get_layout() call, which is
+ # called within the _get_textbox. So, it would better to move this
+ # function as a method with some refactoring of _get_layout method.
+
+ projected_xs = []
+ projected_ys = []
+
+ theta = np.deg2rad(text.get_rotation())
+ tr = Affine2D().rotate(-theta)
+
+ _, parts, d = text._get_layout(renderer)
+
+ for t, wh, x, y in parts:
+ w, h = wh
+
+ xt1, yt1 = tr.transform((x, y))
+ yt1 -= d
+ xt2, yt2 = xt1 + w, yt1 + h
+
+ projected_xs.extend([xt1, xt2])
+ projected_ys.extend([yt1, yt2])
+
+ xt_box, yt_box = min(projected_xs), min(projected_ys)
+ w_box, h_box = max(projected_xs) - xt_box, max(projected_ys) - yt_box
+
+ x_box, y_box = Affine2D().rotate(theta).transform((xt_box, yt_box))
+
+ return x_box, y_box, w_box, h_box
+
+
+def _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi):
+ """Call ``renderer.get_text_width_height_descent``, caching the results."""
+ # Cached based on a copy of fontprop so that later in-place mutations of
+ # the passed-in argument do not mess up the cache.
+ return _get_text_metrics_with_cache_impl(
+ weakref.ref(renderer), text, fontprop.copy(), ismath, dpi)
+
+
+@functools.lru_cache(4096)
+def _get_text_metrics_with_cache_impl(
+ renderer_ref, text, fontprop, ismath, dpi):
+ # dpi is unused, but participates in cache invalidation (via the renderer).
+ return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)
+
+
+@_docstring.interpd
+@_api.define_aliases({
+ "color": ["c"],
+ "fontproperties": ["font", "font_properties"],
+ "fontfamily": ["family"],
+ "fontname": ["name"],
+ "fontsize": ["size"],
+ "fontstretch": ["stretch"],
+ "fontstyle": ["style"],
+ "fontvariant": ["variant"],
+ "fontweight": ["weight"],
+ "horizontalalignment": ["ha"],
+ "verticalalignment": ["va"],
+ "multialignment": ["ma"],
+})
+class Text(Artist):
+ """Handle storing and drawing of text in window or data coordinates."""
+
+ zorder = 3
+ _charsize_cache = dict()
+
+ def __repr__(self):
+ return f"Text({self._x}, {self._y}, {self._text!r})"
+
+ def __init__(self,
+ x=0, y=0, text='', *,
+ color=None, # defaults to rc params
+ verticalalignment='baseline',
+ horizontalalignment='left',
+ multialignment=None,
+ fontproperties=None, # defaults to FontProperties()
+ rotation=None,
+ linespacing=None,
+ rotation_mode=None,
+ usetex=None, # defaults to rcParams['text.usetex']
+ wrap=False,
+ transform_rotates_text=False,
+ parse_math=None, # defaults to rcParams['text.parse_math']
+ antialiased=None, # defaults to rcParams['text.antialiased']
+ **kwargs
+ ):
+ """
+ Create a `.Text` instance at *x*, *y* with string *text*.
+
+ The text is aligned relative to the anchor point (*x*, *y*) according
+ to ``horizontalalignment`` (default: 'left') and ``verticalalignment``
+ (default: 'baseline'). See also
+ :doc:`/gallery/text_labels_and_annotations/text_alignment`.
+
+ While Text accepts the 'label' keyword argument, by default it is not
+ added to the handles of a legend.
+
+ Valid keyword arguments are:
+
+ %(Text:kwdoc)s
+ """
+ super().__init__()
+ self._x, self._y = x, y
+ self._text = ''
+ self._reset_visual_defaults(
+ text=text,
+ color=color,
+ fontproperties=fontproperties,
+ usetex=usetex,
+ parse_math=parse_math,
+ wrap=wrap,
+ verticalalignment=verticalalignment,
+ horizontalalignment=horizontalalignment,
+ multialignment=multialignment,
+ rotation=rotation,
+ transform_rotates_text=transform_rotates_text,
+ linespacing=linespacing,
+ rotation_mode=rotation_mode,
+ antialiased=antialiased
+ )
+ self.update(kwargs)
+
+ def _reset_visual_defaults(
+ self,
+ text='',
+ color=None,
+ fontproperties=None,
+ usetex=None,
+ parse_math=None,
+ wrap=False,
+ verticalalignment='baseline',
+ horizontalalignment='left',
+ multialignment=None,
+ rotation=None,
+ transform_rotates_text=False,
+ linespacing=None,
+ rotation_mode=None,
+ antialiased=None
+ ):
+ self.set_text(text)
+ self.set_color(mpl._val_or_rc(color, "text.color"))
+ self.set_fontproperties(fontproperties)
+ self.set_usetex(usetex)
+ self.set_parse_math(mpl._val_or_rc(parse_math, 'text.parse_math'))
+ self.set_wrap(wrap)
+ self.set_verticalalignment(verticalalignment)
+ self.set_horizontalalignment(horizontalalignment)
+ self._multialignment = multialignment
+ self.set_rotation(rotation)
+ self._transform_rotates_text = transform_rotates_text
+ self._bbox_patch = None # a FancyBboxPatch instance
+ self._renderer = None
+ if linespacing is None:
+ linespacing = 1.2 # Maybe use rcParam later.
+ self.set_linespacing(linespacing)
+ self.set_rotation_mode(rotation_mode)
+ self.set_antialiased(antialiased if antialiased is not None else
+ mpl.rcParams['text.antialiased'])
+
+ def update(self, kwargs):
+ # docstring inherited
+ ret = []
+ kwargs = cbook.normalize_kwargs(kwargs, Text)
+ sentinel = object() # bbox can be None, so use another sentinel.
+ # Update fontproperties first, as it has lowest priority.
+ fontproperties = kwargs.pop("fontproperties", sentinel)
+ if fontproperties is not sentinel:
+ ret.append(self.set_fontproperties(fontproperties))
+ # Update bbox last, as it depends on font properties.
+ bbox = kwargs.pop("bbox", sentinel)
+ ret.extend(super().update(kwargs))
+ if bbox is not sentinel:
+ ret.append(self.set_bbox(bbox))
+ return ret
+
+ def __getstate__(self):
+ d = super().__getstate__()
+ # remove the cached _renderer (if it exists)
+ d['_renderer'] = None
+ return d
+
+ def contains(self, mouseevent):
+ """
+ Return whether the mouse event occurred inside the axis-aligned
+ bounding-box of the text.
+ """
+ if (self._different_canvas(mouseevent) or not self.get_visible()
+ or self._renderer is None):
+ return False, {}
+ # Explicitly use Text.get_window_extent(self) and not
+ # self.get_window_extent() so that Annotation.contains does not
+ # accidentally cover the entire annotation bounding box.
+ bbox = Text.get_window_extent(self)
+ inside = (bbox.x0 <= mouseevent.x <= bbox.x1
+ and bbox.y0 <= mouseevent.y <= bbox.y1)
+ cattr = {}
+ # if the text has a surrounding patch, also check containment for it,
+ # and merge the results with the results for the text.
+ if self._bbox_patch:
+ patch_inside, patch_cattr = self._bbox_patch.contains(mouseevent)
+ inside = inside or patch_inside
+ cattr["bbox_patch"] = patch_cattr
+ return inside, cattr
+
+ def _get_xy_display(self):
+ """
+ Get the (possibly unit converted) transformed x, y in display coords.
+ """
+ x, y = self.get_unitless_position()
+ return self.get_transform().transform((x, y))
+
+ def _get_multialignment(self):
+ if self._multialignment is not None:
+ return self._multialignment
+ else:
+ return self._horizontalalignment
+
+ def _char_index_at(self, x):
+ """
+ Calculate the index closest to the coordinate x in display space.
+
+ The position of text[index] is assumed to be the sum of the widths
+ of all preceding characters text[:index].
+
+ This works only on single line texts.
+ """
+ if not self._text:
+ return 0
+
+ text = self._text
+
+ fontproperties = str(self._fontproperties)
+ if fontproperties not in Text._charsize_cache:
+ Text._charsize_cache[fontproperties] = dict()
+
+ charsize_cache = Text._charsize_cache[fontproperties]
+ for char in set(text):
+ if char not in charsize_cache:
+ self.set_text(char)
+ bb = self.get_window_extent()
+ charsize_cache[char] = bb.x1 - bb.x0
+
+ self.set_text(text)
+ bb = self.get_window_extent()
+
+ size_accum = np.cumsum([0] + [charsize_cache[x] for x in text])
+ std_x = x - bb.x0
+ return (np.abs(size_accum - std_x)).argmin()
+
+ def get_rotation(self):
+ """Return the text angle in degrees between 0 and 360."""
+ if self.get_transform_rotates_text():
+ return self.get_transform().transform_angles(
+ [self._rotation], [self.get_unitless_position()]).item(0)
+ else:
+ return self._rotation
+
+ def get_transform_rotates_text(self):
+ """
+ Return whether rotations of the transform affect the text direction.
+ """
+ return self._transform_rotates_text
+
+ def set_rotation_mode(self, m):
+ """
+ Set text rotation mode.
+
+ Parameters
+ ----------
+ m : {None, 'default', 'anchor'}
+ If ``"default"``, the text will be first rotated, then aligned according
+ to their horizontal and vertical alignments. If ``"anchor"``, then
+ alignment occurs before rotation. Passing ``None`` will set the rotation
+ mode to ``"default"``.
+ """
+ if m is None:
+ m = "default"
+ else:
+ _api.check_in_list(("anchor", "default"), rotation_mode=m)
+ self._rotation_mode = m
+ self.stale = True
+
+ def get_rotation_mode(self):
+ """Return the text rotation mode."""
+ return self._rotation_mode
+
+ def set_antialiased(self, antialiased):
+ """
+ Set whether to use antialiased rendering.
+
+ Parameters
+ ----------
+ antialiased : bool
+
+ Notes
+ -----
+ Antialiasing will be determined by :rc:`text.antialiased`
+ and the parameter *antialiased* will have no effect if the text contains
+ math expressions.
+ """
+ self._antialiased = antialiased
+ self.stale = True
+
+ def get_antialiased(self):
+ """Return whether antialiased rendering is used."""
+ return self._antialiased
+
+ def update_from(self, other):
+ # docstring inherited
+ super().update_from(other)
+ self._color = other._color
+ self._multialignment = other._multialignment
+ self._verticalalignment = other._verticalalignment
+ self._horizontalalignment = other._horizontalalignment
+ self._fontproperties = other._fontproperties.copy()
+ self._usetex = other._usetex
+ self._rotation = other._rotation
+ self._transform_rotates_text = other._transform_rotates_text
+ self._picker = other._picker
+ self._linespacing = other._linespacing
+ self._antialiased = other._antialiased
+ self.stale = True
+
+ def _get_layout(self, renderer):
+ """
+ Return the extent (bbox) of the text together with
+ multiple-alignment information. Note that it returns an extent
+ of a rotated text when necessary.
+ """
+ thisx, thisy = 0.0, 0.0
+ lines = self._get_wrapped_text().split("\n") # Ensures lines is not empty.
+
+ ws = []
+ hs = []
+ xs = []
+ ys = []
+
+ # Full vertical extent of font, including ascenders and descenders:
+ _, lp_h, lp_d = _get_text_metrics_with_cache(
+ renderer, "lp", self._fontproperties,
+ ismath="TeX" if self.get_usetex() else False,
+ dpi=self.get_figure(root=True).dpi)
+ min_dy = (lp_h - lp_d) * self._linespacing
+
+ for i, line in enumerate(lines):
+ clean_line, ismath = self._preprocess_math(line)
+ if clean_line:
+ w, h, d = _get_text_metrics_with_cache(
+ renderer, clean_line, self._fontproperties,
+ ismath=ismath, dpi=self.get_figure(root=True).dpi)
+ else:
+ w = h = d = 0
+
+ # For multiline text, increase the line spacing when the text
+ # net-height (excluding baseline) is larger than that of a "l"
+ # (e.g., use of superscripts), which seems what TeX does.
+ h = max(h, lp_h)
+ d = max(d, lp_d)
+
+ ws.append(w)
+ hs.append(h)
+
+ # Metrics of the last line that are needed later:
+ baseline = (h - d) - thisy
+
+ if i == 0:
+ # position at baseline
+ thisy = -(h - d)
+ else:
+ # put baseline a good distance from bottom of previous line
+ thisy -= max(min_dy, (h - d) * self._linespacing)
+
+ xs.append(thisx) # == 0.
+ ys.append(thisy)
+
+ thisy -= d
+
+ # Metrics of the last line that are needed later:
+ descent = d
+
+ # Bounding box definition:
+ width = max(ws)
+ xmin = 0
+ xmax = width
+ ymax = 0
+ ymin = ys[-1] - descent # baseline of last line minus its descent
+
+ # get the rotation matrix
+ M = Affine2D().rotate_deg(self.get_rotation())
+
+ # now offset the individual text lines within the box
+ malign = self._get_multialignment()
+ if malign == 'left':
+ offset_layout = [(x, y) for x, y in zip(xs, ys)]
+ elif malign == 'center':
+ offset_layout = [(x + width / 2 - w / 2, y)
+ for x, y, w in zip(xs, ys, ws)]
+ elif malign == 'right':
+ offset_layout = [(x + width - w, y)
+ for x, y, w in zip(xs, ys, ws)]
+
+ # the corners of the unrotated bounding box
+ corners_horiz = np.array(
+ [(xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)])
+
+ # now rotate the bbox
+ corners_rotated = M.transform(corners_horiz)
+ # compute the bounds of the rotated box
+ xmin = corners_rotated[:, 0].min()
+ xmax = corners_rotated[:, 0].max()
+ ymin = corners_rotated[:, 1].min()
+ ymax = corners_rotated[:, 1].max()
+ width = xmax - xmin
+ height = ymax - ymin
+
+ # Now move the box to the target position offset the display
+ # bbox by alignment
+ halign = self._horizontalalignment
+ valign = self._verticalalignment
+
+ rotation_mode = self.get_rotation_mode()
+ if rotation_mode != "anchor":
+ # compute the text location in display coords and the offsets
+ # necessary to align the bbox with that location
+ if halign == 'center':
+ offsetx = (xmin + xmax) / 2
+ elif halign == 'right':
+ offsetx = xmax
+ else:
+ offsetx = xmin
+
+ if valign == 'center':
+ offsety = (ymin + ymax) / 2
+ elif valign == 'top':
+ offsety = ymax
+ elif valign == 'baseline':
+ offsety = ymin + descent
+ elif valign == 'center_baseline':
+ offsety = ymin + height - baseline / 2.0
+ else:
+ offsety = ymin
+ else:
+ xmin1, ymin1 = corners_horiz[0]
+ xmax1, ymax1 = corners_horiz[2]
+
+ if halign == 'center':
+ offsetx = (xmin1 + xmax1) / 2.0
+ elif halign == 'right':
+ offsetx = xmax1
+ else:
+ offsetx = xmin1
+
+ if valign == 'center':
+ offsety = (ymin1 + ymax1) / 2.0
+ elif valign == 'top':
+ offsety = ymax1
+ elif valign == 'baseline':
+ offsety = ymax1 - baseline
+ elif valign == 'center_baseline':
+ offsety = ymax1 - baseline / 2.0
+ else:
+ offsety = ymin1
+
+ offsetx, offsety = M.transform((offsetx, offsety))
+
+ xmin -= offsetx
+ ymin -= offsety
+
+ bbox = Bbox.from_bounds(xmin, ymin, width, height)
+
+ # now rotate the positions around the first (x, y) position
+ xys = M.transform(offset_layout) - (offsetx, offsety)
+
+ return bbox, list(zip(lines, zip(ws, hs), *xys.T)), descent
+
+ def set_bbox(self, rectprops):
+ """
+ Draw a bounding box around self.
+
+ Parameters
+ ----------
+ rectprops : dict with properties for `.patches.FancyBboxPatch`
+ The default boxstyle is 'square'. The mutation
+ scale of the `.patches.FancyBboxPatch` is set to the fontsize.
+
+ Examples
+ --------
+ ::
+
+ t.set_bbox(dict(facecolor='red', alpha=0.5))
+ """
+
+ if rectprops is not None:
+ props = rectprops.copy()
+ boxstyle = props.pop("boxstyle", None)
+ pad = props.pop("pad", None)
+ if boxstyle is None:
+ boxstyle = "square"
+ if pad is None:
+ pad = 4 # points
+ pad /= self.get_size() # to fraction of font size
+ else:
+ if pad is None:
+ pad = 0.3
+ # boxstyle could be a callable or a string
+ if isinstance(boxstyle, str) and "pad" not in boxstyle:
+ boxstyle += ",pad=%0.2f" % pad
+ self._bbox_patch = FancyBboxPatch(
+ (0, 0), 1, 1,
+ boxstyle=boxstyle, transform=IdentityTransform(), **props)
+ else:
+ self._bbox_patch = None
+
+ self._update_clip_properties()
+
+ def get_bbox_patch(self):
+ """
+ Return the bbox Patch, or None if the `.patches.FancyBboxPatch`
+ is not made.
+ """
+ return self._bbox_patch
+
+ def update_bbox_position_size(self, renderer):
+ """
+ Update the location and the size of the bbox.
+
+ This method should be used when the position and size of the bbox needs
+ to be updated before actually drawing the bbox.
+ """
+ if self._bbox_patch:
+ # don't use self.get_unitless_position here, which refers to text
+ # position in Text:
+ posx = float(self.convert_xunits(self._x))
+ posy = float(self.convert_yunits(self._y))
+ posx, posy = self.get_transform().transform((posx, posy))
+
+ x_box, y_box, w_box, h_box = _get_textbox(self, renderer)
+ self._bbox_patch.set_bounds(0., 0., w_box, h_box)
+ self._bbox_patch.set_transform(
+ Affine2D()
+ .rotate_deg(self.get_rotation())
+ .translate(posx + x_box, posy + y_box))
+ fontsize_in_pixel = renderer.points_to_pixels(self.get_size())
+ self._bbox_patch.set_mutation_scale(fontsize_in_pixel)
+
+ def _update_clip_properties(self):
+ if self._bbox_patch:
+ clipprops = dict(clip_box=self.clipbox,
+ clip_path=self._clippath,
+ clip_on=self._clipon)
+ self._bbox_patch.update(clipprops)
+
+ def set_clip_box(self, clipbox):
+ # docstring inherited.
+ super().set_clip_box(clipbox)
+ self._update_clip_properties()
+
+ def set_clip_path(self, path, transform=None):
+ # docstring inherited.
+ super().set_clip_path(path, transform)
+ self._update_clip_properties()
+
+ def set_clip_on(self, b):
+ # docstring inherited.
+ super().set_clip_on(b)
+ self._update_clip_properties()
+
+ def get_wrap(self):
+ """Return whether the text can be wrapped."""
+ return self._wrap
+
+ def set_wrap(self, wrap):
+ """
+ Set whether the text can be wrapped.
+
+ Wrapping makes sure the text is confined to the (sub)figure box. It
+ does not take into account any other artists.
+
+ Parameters
+ ----------
+ wrap : bool
+
+ Notes
+ -----
+ Wrapping does not work together with
+ ``savefig(..., bbox_inches='tight')`` (which is also used internally
+ by ``%matplotlib inline`` in IPython/Jupyter). The 'tight' setting
+ rescales the canvas to accommodate all content and happens before
+ wrapping.
+ """
+ self._wrap = wrap
+
+ def _get_wrap_line_width(self):
+ """
+ Return the maximum line width for wrapping text based on the current
+ orientation.
+ """
+ x0, y0 = self.get_transform().transform(self.get_position())
+ figure_box = self.get_figure().get_window_extent()
+
+ # Calculate available width based on text alignment
+ alignment = self.get_horizontalalignment()
+ self.set_rotation_mode('anchor')
+ rotation = self.get_rotation()
+
+ left = self._get_dist_to_box(rotation, x0, y0, figure_box)
+ right = self._get_dist_to_box(
+ (180 + rotation) % 360, x0, y0, figure_box)
+
+ if alignment == 'left':
+ line_width = left
+ elif alignment == 'right':
+ line_width = right
+ else:
+ line_width = 2 * min(left, right)
+
+ return line_width
+
+ def _get_dist_to_box(self, rotation, x0, y0, figure_box):
+ """
+ Return the distance from the given points to the boundaries of a
+ rotated box, in pixels.
+ """
+ if rotation > 270:
+ quad = rotation - 270
+ h1 = (y0 - figure_box.y0) / math.cos(math.radians(quad))
+ h2 = (figure_box.x1 - x0) / math.cos(math.radians(90 - quad))
+ elif rotation > 180:
+ quad = rotation - 180
+ h1 = (x0 - figure_box.x0) / math.cos(math.radians(quad))
+ h2 = (y0 - figure_box.y0) / math.cos(math.radians(90 - quad))
+ elif rotation > 90:
+ quad = rotation - 90
+ h1 = (figure_box.y1 - y0) / math.cos(math.radians(quad))
+ h2 = (x0 - figure_box.x0) / math.cos(math.radians(90 - quad))
+ else:
+ h1 = (figure_box.x1 - x0) / math.cos(math.radians(rotation))
+ h2 = (figure_box.y1 - y0) / math.cos(math.radians(90 - rotation))
+
+ return min(h1, h2)
+
+ def _get_rendered_text_width(self, text):
+ """
+ Return the width of a given text string, in pixels.
+ """
+
+ w, h, d = _get_text_metrics_with_cache(
+ self._renderer, text, self.get_fontproperties(),
+ cbook.is_math_text(text),
+ self.get_figure(root=True).dpi)
+ return math.ceil(w)
+
+ def _get_wrapped_text(self):
+ """
+ Return a copy of the text string with new lines added so that the text
+ is wrapped relative to the parent figure (if `get_wrap` is True).
+ """
+ if not self.get_wrap():
+ return self.get_text()
+
+ # Not fit to handle breaking up latex syntax correctly, so
+ # ignore latex for now.
+ if self.get_usetex():
+ return self.get_text()
+
+ # Build the line incrementally, for a more accurate measure of length
+ line_width = self._get_wrap_line_width()
+ wrapped_lines = []
+
+ # New lines in the user's text force a split
+ unwrapped_lines = self.get_text().split('\n')
+
+ # Now wrap each individual unwrapped line
+ for unwrapped_line in unwrapped_lines:
+
+ sub_words = unwrapped_line.split(' ')
+ # Remove items from sub_words as we go, so stop when empty
+ while len(sub_words) > 0:
+ if len(sub_words) == 1:
+ # Only one word, so just add it to the end
+ wrapped_lines.append(sub_words.pop(0))
+ continue
+
+ for i in range(2, len(sub_words) + 1):
+ # Get width of all words up to and including here
+ line = ' '.join(sub_words[:i])
+ current_width = self._get_rendered_text_width(line)
+
+ # If all these words are too wide, append all not including
+ # last word
+ if current_width > line_width:
+ wrapped_lines.append(' '.join(sub_words[:i - 1]))
+ sub_words = sub_words[i - 1:]
+ break
+
+ # Otherwise if all words fit in the width, append them all
+ elif i == len(sub_words):
+ wrapped_lines.append(' '.join(sub_words[:i]))
+ sub_words = []
+ break
+
+ return '\n'.join(wrapped_lines)
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+
+ if renderer is not None:
+ self._renderer = renderer
+ if not self.get_visible():
+ return
+ if self.get_text() == '':
+ return
+
+ renderer.open_group('text', self.get_gid())
+
+ with self._cm_set(text=self._get_wrapped_text()):
+ bbox, info, descent = self._get_layout(renderer)
+ trans = self.get_transform()
+
+ # don't use self.get_position here, which refers to text
+ # position in Text:
+ x, y = self._x, self._y
+ if np.ma.is_masked(x):
+ x = np.nan
+ if np.ma.is_masked(y):
+ y = np.nan
+ posx = float(self.convert_xunits(x))
+ posy = float(self.convert_yunits(y))
+ posx, posy = trans.transform((posx, posy))
+ if np.isnan(posx) or np.isnan(posy):
+ return # don't throw a warning here
+ if not np.isfinite(posx) or not np.isfinite(posy):
+ _log.warning("posx and posy should be finite values")
+ return
+ canvasw, canvash = renderer.get_canvas_width_height()
+
+ # Update the location and size of the bbox
+ # (`.patches.FancyBboxPatch`), and draw it.
+ if self._bbox_patch:
+ self.update_bbox_position_size(renderer)
+ self._bbox_patch.draw(renderer)
+
+ gc = renderer.new_gc()
+ gc.set_foreground(self.get_color())
+ gc.set_alpha(self.get_alpha())
+ gc.set_url(self._url)
+ gc.set_antialiased(self._antialiased)
+ self._set_gc_clip(gc)
+
+ angle = self.get_rotation()
+
+ for line, wh, x, y in info:
+
+ mtext = self if len(info) == 1 else None
+ x = x + posx
+ y = y + posy
+ if renderer.flipy():
+ y = canvash - y
+ clean_line, ismath = self._preprocess_math(line)
+
+ if self.get_path_effects():
+ from matplotlib.patheffects import PathEffectRenderer
+ textrenderer = PathEffectRenderer(
+ self.get_path_effects(), renderer)
+ else:
+ textrenderer = renderer
+
+ if self.get_usetex():
+ textrenderer.draw_tex(gc, x, y, clean_line,
+ self._fontproperties, angle,
+ mtext=mtext)
+ else:
+ textrenderer.draw_text(gc, x, y, clean_line,
+ self._fontproperties, angle,
+ ismath=ismath, mtext=mtext)
+
+ gc.restore()
+ renderer.close_group('text')
+ self.stale = False
+
+ def get_color(self):
+ """Return the color of the text."""
+ return self._color
+
+ def get_fontproperties(self):
+ """Return the `.font_manager.FontProperties`."""
+ return self._fontproperties
+
+ def get_fontfamily(self):
+ """
+ Return the list of font families used for font lookup.
+
+ See Also
+ --------
+ .font_manager.FontProperties.get_family
+ """
+ return self._fontproperties.get_family()
+
+ def get_fontname(self):
+ """
+ Return the font name as a string.
+
+ See Also
+ --------
+ .font_manager.FontProperties.get_name
+ """
+ return self._fontproperties.get_name()
+
+ def get_fontstyle(self):
+ """
+ Return the font style as a string.
+
+ See Also
+ --------
+ .font_manager.FontProperties.get_style
+ """
+ return self._fontproperties.get_style()
+
+ def get_fontsize(self):
+ """
+ Return the font size as an integer.
+
+ See Also
+ --------
+ .font_manager.FontProperties.get_size_in_points
+ """
+ return self._fontproperties.get_size_in_points()
+
+ def get_fontvariant(self):
+ """
+ Return the font variant as a string.
+
+ See Also
+ --------
+ .font_manager.FontProperties.get_variant
+ """
+ return self._fontproperties.get_variant()
+
+ def get_fontweight(self):
+ """
+ Return the font weight as a string or a number.
+
+ See Also
+ --------
+ .font_manager.FontProperties.get_weight
+ """
+ return self._fontproperties.get_weight()
+
+ def get_stretch(self):
+ """
+ Return the font stretch as a string or a number.
+
+ See Also
+ --------
+ .font_manager.FontProperties.get_stretch
+ """
+ return self._fontproperties.get_stretch()
+
+ def get_horizontalalignment(self):
+ """
+ Return the horizontal alignment as a string. Will be one of
+ 'left', 'center' or 'right'.
+ """
+ return self._horizontalalignment
+
+ def get_unitless_position(self):
+ """Return the (x, y) unitless position of the text."""
+ # This will get the position with all unit information stripped away.
+ # This is here for convenience since it is done in several locations.
+ x = float(self.convert_xunits(self._x))
+ y = float(self.convert_yunits(self._y))
+ return x, y
+
+ def get_position(self):
+ """Return the (x, y) position of the text."""
+ # This should return the same data (possible unitized) as was
+ # specified with 'set_x' and 'set_y'.
+ return self._x, self._y
+
+ def get_text(self):
+ """Return the text string."""
+ return self._text
+
+ def get_verticalalignment(self):
+ """
+ Return the vertical alignment as a string. Will be one of
+ 'top', 'center', 'bottom', 'baseline' or 'center_baseline'.
+ """
+ return self._verticalalignment
+
+ def get_window_extent(self, renderer=None, dpi=None):
+ """
+ Return the `.Bbox` bounding the text, in display units.
+
+ In addition to being used internally, this is useful for specifying
+ clickable regions in a png file on a web page.
+
+ Parameters
+ ----------
+ renderer : Renderer, optional
+ A renderer is needed to compute the bounding box. If the artist
+ has already been drawn, the renderer is cached; thus, it is only
+ necessary to pass this argument when calling `get_window_extent`
+ before the first draw. In practice, it is usually easier to
+ trigger a draw first, e.g. by calling
+ `~.Figure.draw_without_rendering` or ``plt.show()``.
+
+ dpi : float, optional
+ The dpi value for computing the bbox, defaults to
+ ``self.get_figure(root=True).dpi`` (*not* the renderer dpi); should be set
+ e.g. if to match regions with a figure saved with a custom dpi value.
+ """
+ if not self.get_visible():
+ return Bbox.unit()
+
+ fig = self.get_figure(root=True)
+ if dpi is None:
+ dpi = fig.dpi
+ if self.get_text() == '':
+ with cbook._setattr_cm(fig, dpi=dpi):
+ tx, ty = self._get_xy_display()
+ return Bbox.from_bounds(tx, ty, 0, 0)
+
+ if renderer is not None:
+ self._renderer = renderer
+ if self._renderer is None:
+ self._renderer = fig._get_renderer()
+ if self._renderer is None:
+ raise RuntimeError(
+ "Cannot get window extent of text w/o renderer. You likely "
+ "want to call 'figure.draw_without_rendering()' first.")
+
+ with cbook._setattr_cm(fig, dpi=dpi):
+ bbox, info, descent = self._get_layout(self._renderer)
+ x, y = self.get_unitless_position()
+ x, y = self.get_transform().transform((x, y))
+ bbox = bbox.translated(x, y)
+ return bbox
+
+ def set_backgroundcolor(self, color):
+ """
+ Set the background color of the text by updating the bbox.
+
+ Parameters
+ ----------
+ color : :mpltype:`color`
+
+ See Also
+ --------
+ .set_bbox : To change the position of the bounding box
+ """
+ if self._bbox_patch is None:
+ self.set_bbox(dict(facecolor=color, edgecolor=color))
+ else:
+ self._bbox_patch.update(dict(facecolor=color))
+
+ self._update_clip_properties()
+ self.stale = True
+
+ def set_color(self, color):
+ """
+ Set the foreground color of the text
+
+ Parameters
+ ----------
+ color : :mpltype:`color`
+ """
+ # "auto" is only supported by axisartist, but we can just let it error
+ # out at draw time for simplicity.
+ if not cbook._str_equal(color, "auto"):
+ mpl.colors._check_color_like(color=color)
+ self._color = color
+ self.stale = True
+
+ def set_horizontalalignment(self, align):
+ """
+ Set the horizontal alignment relative to the anchor point.
+
+ See also :doc:`/gallery/text_labels_and_annotations/text_alignment`.
+
+ Parameters
+ ----------
+ align : {'left', 'center', 'right'}
+ """
+ _api.check_in_list(['center', 'right', 'left'], align=align)
+ self._horizontalalignment = align
+ self.stale = True
+
+ def set_multialignment(self, align):
+ """
+ Set the text alignment for multiline texts.
+
+ The layout of the bounding box of all the lines is determined by the
+ horizontalalignment and verticalalignment properties. This property
+ controls the alignment of the text lines within that box.
+
+ Parameters
+ ----------
+ align : {'left', 'right', 'center'}
+ """
+ _api.check_in_list(['center', 'right', 'left'], align=align)
+ self._multialignment = align
+ self.stale = True
+
+ def set_linespacing(self, spacing):
+ """
+ Set the line spacing as a multiple of the font size.
+
+ The default line spacing is 1.2.
+
+ Parameters
+ ----------
+ spacing : float (multiple of font size)
+ """
+ _api.check_isinstance(Real, spacing=spacing)
+ self._linespacing = spacing
+ self.stale = True
+
+ def set_fontfamily(self, fontname):
+ """
+ Set the font family. Can be either a single string, or a list of
+ strings in decreasing priority. Each string may be either a real font
+ name or a generic font class name. If the latter, the specific font
+ names will be looked up in the corresponding rcParams.
+
+ If a `Text` instance is constructed with ``fontfamily=None``, then the
+ font is set to :rc:`font.family`, and the
+ same is done when `set_fontfamily()` is called on an existing
+ `Text` instance.
+
+ Parameters
+ ----------
+ fontname : {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', \
+'monospace'}
+
+ See Also
+ --------
+ .font_manager.FontProperties.set_family
+ """
+ self._fontproperties.set_family(fontname)
+ self.stale = True
+
+ def set_fontvariant(self, variant):
+ """
+ Set the font variant.
+
+ Parameters
+ ----------
+ variant : {'normal', 'small-caps'}
+
+ See Also
+ --------
+ .font_manager.FontProperties.set_variant
+ """
+ self._fontproperties.set_variant(variant)
+ self.stale = True
+
+ def set_fontstyle(self, fontstyle):
+ """
+ Set the font style.
+
+ Parameters
+ ----------
+ fontstyle : {'normal', 'italic', 'oblique'}
+
+ See Also
+ --------
+ .font_manager.FontProperties.set_style
+ """
+ self._fontproperties.set_style(fontstyle)
+ self.stale = True
+
+ def set_fontsize(self, fontsize):
+ """
+ Set the font size.
+
+ Parameters
+ ----------
+ fontsize : float or {'xx-small', 'x-small', 'small', 'medium', \
+'large', 'x-large', 'xx-large'}
+ If a float, the fontsize in points. The string values denote sizes
+ relative to the default font size.
+
+ See Also
+ --------
+ .font_manager.FontProperties.set_size
+ """
+ self._fontproperties.set_size(fontsize)
+ self.stale = True
+
+ def get_math_fontfamily(self):
+ """
+ Return the font family name for math text rendered by Matplotlib.
+
+ The default value is :rc:`mathtext.fontset`.
+
+ See Also
+ --------
+ set_math_fontfamily
+ """
+ return self._fontproperties.get_math_fontfamily()
+
+ def set_math_fontfamily(self, fontfamily):
+ """
+ Set the font family for math text rendered by Matplotlib.
+
+ This does only affect Matplotlib's own math renderer. It has no effect
+ when rendering with TeX (``usetex=True``).
+
+ Parameters
+ ----------
+ fontfamily : str
+ The name of the font family.
+
+ Available font families are defined in the
+ :ref:`default matplotlibrc file
+ `.
+
+ See Also
+ --------
+ get_math_fontfamily
+ """
+ self._fontproperties.set_math_fontfamily(fontfamily)
+
+ def set_fontweight(self, weight):
+ """
+ Set the font weight.
+
+ Parameters
+ ----------
+ weight : {a numeric value in range 0-1000, 'ultralight', 'light', \
+'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', \
+'demi', 'bold', 'heavy', 'extra bold', 'black'}
+
+ See Also
+ --------
+ .font_manager.FontProperties.set_weight
+ """
+ self._fontproperties.set_weight(weight)
+ self.stale = True
+
+ def set_fontstretch(self, stretch):
+ """
+ Set the font stretch (horizontal condensation or expansion).
+
+ Parameters
+ ----------
+ stretch : {a numeric value in range 0-1000, 'ultra-condensed', \
+'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', \
+'expanded', 'extra-expanded', 'ultra-expanded'}
+
+ See Also
+ --------
+ .font_manager.FontProperties.set_stretch
+ """
+ self._fontproperties.set_stretch(stretch)
+ self.stale = True
+
+ def set_position(self, xy):
+ """
+ Set the (*x*, *y*) position of the text.
+
+ Parameters
+ ----------
+ xy : (float, float)
+ """
+ self.set_x(xy[0])
+ self.set_y(xy[1])
+
+ def set_x(self, x):
+ """
+ Set the *x* position of the text.
+
+ Parameters
+ ----------
+ x : float
+ """
+ self._x = x
+ self.stale = True
+
+ def set_y(self, y):
+ """
+ Set the *y* position of the text.
+
+ Parameters
+ ----------
+ y : float
+ """
+ self._y = y
+ self.stale = True
+
+ def set_rotation(self, s):
+ """
+ Set the rotation of the text.
+
+ Parameters
+ ----------
+ s : float or {'vertical', 'horizontal'}
+ The rotation angle in degrees in mathematically positive direction
+ (counterclockwise). 'horizontal' equals 0, 'vertical' equals 90.
+ """
+ if isinstance(s, Real):
+ self._rotation = float(s) % 360
+ elif cbook._str_equal(s, 'horizontal') or s is None:
+ self._rotation = 0.
+ elif cbook._str_equal(s, 'vertical'):
+ self._rotation = 90.
+ else:
+ raise ValueError("rotation must be 'vertical', 'horizontal' or "
+ f"a number, not {s}")
+ self.stale = True
+
+ def set_transform_rotates_text(self, t):
+ """
+ Whether rotations of the transform affect the text direction.
+
+ Parameters
+ ----------
+ t : bool
+ """
+ self._transform_rotates_text = t
+ self.stale = True
+
+ def set_verticalalignment(self, align):
+ """
+ Set the vertical alignment relative to the anchor point.
+
+ See also :doc:`/gallery/text_labels_and_annotations/text_alignment`.
+
+ Parameters
+ ----------
+ align : {'baseline', 'bottom', 'center', 'center_baseline', 'top'}
+ """
+ _api.check_in_list(
+ ['top', 'bottom', 'center', 'baseline', 'center_baseline'],
+ align=align)
+ self._verticalalignment = align
+ self.stale = True
+
+ def set_text(self, s):
+ r"""
+ Set the text string *s*.
+
+ It may contain newlines (``\n``) or math in LaTeX syntax.
+
+ Parameters
+ ----------
+ s : object
+ Any object gets converted to its `str` representation, except for
+ ``None`` which is converted to an empty string.
+ """
+ s = '' if s is None else str(s)
+ if s != self._text:
+ self._text = s
+ self.stale = True
+
+ def _preprocess_math(self, s):
+ """
+ Return the string *s* after mathtext preprocessing, and the kind of
+ mathtext support needed.
+
+ - If *self* is configured to use TeX, return *s* unchanged except that
+ a single space gets escaped, and the flag "TeX".
+ - Otherwise, if *s* is mathtext (has an even number of unescaped dollar
+ signs) and ``parse_math`` is not set to False, return *s* and the
+ flag True.
+ - Otherwise, return *s* with dollar signs unescaped, and the flag
+ False.
+ """
+ if self.get_usetex():
+ if s == " ":
+ s = r"\ "
+ return s, "TeX"
+ elif not self.get_parse_math():
+ return s, False
+ elif cbook.is_math_text(s):
+ return s, True
+ else:
+ return s.replace(r"\$", "$"), False
+
+ def set_fontproperties(self, fp):
+ """
+ Set the font properties that control the text.
+
+ Parameters
+ ----------
+ fp : `.font_manager.FontProperties` or `str` or `pathlib.Path`
+ If a `str`, it is interpreted as a fontconfig pattern parsed by
+ `.FontProperties`. If a `pathlib.Path`, it is interpreted as the
+ absolute path to a font file.
+ """
+ self._fontproperties = FontProperties._from_any(fp).copy()
+ self.stale = True
+
+ @_docstring.kwarg_doc("bool, default: :rc:`text.usetex`")
+ def set_usetex(self, usetex):
+ """
+ Parameters
+ ----------
+ usetex : bool or None
+ Whether to render using TeX, ``None`` means to use
+ :rc:`text.usetex`.
+ """
+ if usetex is None:
+ self._usetex = mpl.rcParams['text.usetex']
+ else:
+ self._usetex = bool(usetex)
+ self.stale = True
+
+ def get_usetex(self):
+ """Return whether this `Text` object uses TeX for rendering."""
+ return self._usetex
+
+ def set_parse_math(self, parse_math):
+ """
+ Override switch to disable any mathtext parsing for this `Text`.
+
+ Parameters
+ ----------
+ parse_math : bool
+ If False, this `Text` will never use mathtext. If True, mathtext
+ will be used if there is an even number of unescaped dollar signs.
+ """
+ self._parse_math = bool(parse_math)
+
+ def get_parse_math(self):
+ """Return whether mathtext parsing is considered for this `Text`."""
+ return self._parse_math
+
+ def set_fontname(self, fontname):
+ """
+ Alias for `set_fontfamily`.
+
+ One-way alias only: the getter differs.
+
+ Parameters
+ ----------
+ fontname : {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', \
+'monospace'}
+
+ See Also
+ --------
+ .font_manager.FontProperties.set_family
+
+ """
+ self.set_fontfamily(fontname)
+
+
+class OffsetFrom:
+ """Callable helper class for working with `Annotation`."""
+
+ def __init__(self, artist, ref_coord, unit="points"):
+ """
+ Parameters
+ ----------
+ artist : `~matplotlib.artist.Artist` or `.BboxBase` or `.Transform`
+ The object to compute the offset from.
+
+ ref_coord : (float, float)
+ If *artist* is an `.Artist` or `.BboxBase`, this values is
+ the location to of the offset origin in fractions of the
+ *artist* bounding box.
+
+ If *artist* is a transform, the offset origin is the
+ transform applied to this value.
+
+ unit : {'points, 'pixels'}, default: 'points'
+ The screen units to use (pixels or points) for the offset input.
+ """
+ self._artist = artist
+ x, y = ref_coord # Make copy when ref_coord is an array (and check the shape).
+ self._ref_coord = x, y
+ self.set_unit(unit)
+
+ def set_unit(self, unit):
+ """
+ Set the unit for input to the transform used by ``__call__``.
+
+ Parameters
+ ----------
+ unit : {'points', 'pixels'}
+ """
+ _api.check_in_list(["points", "pixels"], unit=unit)
+ self._unit = unit
+
+ def get_unit(self):
+ """Return the unit for input to the transform used by ``__call__``."""
+ return self._unit
+
+ def __call__(self, renderer):
+ """
+ Return the offset transform.
+
+ Parameters
+ ----------
+ renderer : `RendererBase`
+ The renderer to use to compute the offset
+
+ Returns
+ -------
+ `Transform`
+ Maps (x, y) in pixel or point units to screen units
+ relative to the given artist.
+ """
+ if isinstance(self._artist, Artist):
+ bbox = self._artist.get_window_extent(renderer)
+ xf, yf = self._ref_coord
+ x = bbox.x0 + bbox.width * xf
+ y = bbox.y0 + bbox.height * yf
+ elif isinstance(self._artist, BboxBase):
+ bbox = self._artist
+ xf, yf = self._ref_coord
+ x = bbox.x0 + bbox.width * xf
+ y = bbox.y0 + bbox.height * yf
+ elif isinstance(self._artist, Transform):
+ x, y = self._artist.transform(self._ref_coord)
+ else:
+ _api.check_isinstance((Artist, BboxBase, Transform), artist=self._artist)
+ scale = 1 if self._unit == "pixels" else renderer.points_to_pixels(1)
+ return Affine2D().scale(scale).translate(x, y)
+
+
+class _AnnotationBase:
+ def __init__(self,
+ xy,
+ xycoords='data',
+ annotation_clip=None):
+
+ x, y = xy # Make copy when xy is an array (and check the shape).
+ self.xy = x, y
+ self.xycoords = xycoords
+ self.set_annotation_clip(annotation_clip)
+
+ self._draggable = None
+
+ def _get_xy(self, renderer, xy, coords):
+ x, y = xy
+ xcoord, ycoord = coords if isinstance(coords, tuple) else (coords, coords)
+ if xcoord == 'data':
+ x = float(self.convert_xunits(x))
+ if ycoord == 'data':
+ y = float(self.convert_yunits(y))
+ return self._get_xy_transform(renderer, coords).transform((x, y))
+
+ def _get_xy_transform(self, renderer, coords):
+
+ if isinstance(coords, tuple):
+ xcoord, ycoord = coords
+ from matplotlib.transforms import blended_transform_factory
+ tr1 = self._get_xy_transform(renderer, xcoord)
+ tr2 = self._get_xy_transform(renderer, ycoord)
+ return blended_transform_factory(tr1, tr2)
+ elif callable(coords):
+ tr = coords(renderer)
+ if isinstance(tr, BboxBase):
+ return BboxTransformTo(tr)
+ elif isinstance(tr, Transform):
+ return tr
+ else:
+ raise TypeError(
+ f"xycoords callable must return a BboxBase or Transform, not a "
+ f"{type(tr).__name__}")
+ elif isinstance(coords, Artist):
+ bbox = coords.get_window_extent(renderer)
+ return BboxTransformTo(bbox)
+ elif isinstance(coords, BboxBase):
+ return BboxTransformTo(coords)
+ elif isinstance(coords, Transform):
+ return coords
+ elif not isinstance(coords, str):
+ raise TypeError(
+ f"'xycoords' must be an instance of str, tuple[str, str], Artist, "
+ f"Transform, or Callable, not a {type(coords).__name__}")
+
+ if coords == 'data':
+ return self.axes.transData
+ elif coords == 'polar':
+ from matplotlib.projections import PolarAxes
+ tr = PolarAxes.PolarTransform(apply_theta_transforms=False)
+ trans = tr + self.axes.transData
+ return trans
+
+ try:
+ bbox_name, unit = coords.split()
+ except ValueError: # i.e. len(coords.split()) != 2.
+ raise ValueError(f"{coords!r} is not a valid coordinate") from None
+
+ bbox0, xy0 = None, None
+
+ # if unit is offset-like
+ if bbox_name == "figure":
+ bbox0 = self.get_figure(root=False).figbbox
+ elif bbox_name == "subfigure":
+ bbox0 = self.get_figure(root=False).bbox
+ elif bbox_name == "axes":
+ bbox0 = self.axes.bbox
+
+ # reference x, y in display coordinate
+ if bbox0 is not None:
+ xy0 = bbox0.p0
+ elif bbox_name == "offset":
+ xy0 = self._get_position_xy(renderer)
+ else:
+ raise ValueError(f"{coords!r} is not a valid coordinate")
+
+ if unit == "points":
+ tr = Affine2D().scale(
+ self.get_figure(root=True).dpi / 72) # dpi/72 dots per point
+ elif unit == "pixels":
+ tr = Affine2D()
+ elif unit == "fontsize":
+ tr = Affine2D().scale(
+ self.get_size() * self.get_figure(root=True).dpi / 72)
+ elif unit == "fraction":
+ tr = Affine2D().scale(*bbox0.size)
+ else:
+ raise ValueError(f"{unit!r} is not a recognized unit")
+
+ return tr.translate(*xy0)
+
+ def set_annotation_clip(self, b):
+ """
+ Set the annotation's clipping behavior.
+
+ Parameters
+ ----------
+ b : bool or None
+ - True: The annotation will be clipped when ``self.xy`` is
+ outside the Axes.
+ - False: The annotation will always be drawn.
+ - None: The annotation will be clipped when ``self.xy`` is
+ outside the Axes and ``self.xycoords == "data"``.
+ """
+ self._annotation_clip = b
+
+ def get_annotation_clip(self):
+ """
+ Return the annotation's clipping behavior.
+
+ See `set_annotation_clip` for the meaning of return values.
+ """
+ return self._annotation_clip
+
+ def _get_position_xy(self, renderer):
+ """Return the pixel position of the annotated point."""
+ return self._get_xy(renderer, self.xy, self.xycoords)
+
+ def _check_xy(self, renderer=None):
+ """Check whether the annotation at *xy_pixel* should be drawn."""
+ if renderer is None:
+ renderer = self.get_figure(root=True)._get_renderer()
+ b = self.get_annotation_clip()
+ if b or (b is None and self.xycoords == "data"):
+ # check if self.xy is inside the Axes.
+ xy_pixel = self._get_position_xy(renderer)
+ return self.axes.contains_point(xy_pixel)
+ return True
+
+ def draggable(self, state=None, use_blit=False):
+ """
+ Set whether the annotation is draggable with the mouse.
+
+ Parameters
+ ----------
+ state : bool or None
+ - True or False: set the draggability.
+ - None: toggle the draggability.
+ use_blit : bool, default: False
+ Use blitting for faster image composition. For details see
+ :ref:`func-animation`.
+
+ Returns
+ -------
+ DraggableAnnotation or None
+ If the annotation is draggable, the corresponding
+ `.DraggableAnnotation` helper is returned.
+ """
+ from matplotlib.offsetbox import DraggableAnnotation
+ is_draggable = self._draggable is not None
+
+ # if state is None we'll toggle
+ if state is None:
+ state = not is_draggable
+
+ if state:
+ if self._draggable is None:
+ self._draggable = DraggableAnnotation(self, use_blit)
+ else:
+ if self._draggable is not None:
+ self._draggable.disconnect()
+ self._draggable = None
+
+ return self._draggable
+
+
+class Annotation(Text, _AnnotationBase):
+ """
+ An `.Annotation` is a `.Text` that can refer to a specific position *xy*.
+ Optionally an arrow pointing from the text to *xy* can be drawn.
+
+ Attributes
+ ----------
+ xy
+ The annotated position.
+ xycoords
+ The coordinate system for *xy*.
+ arrow_patch
+ A `.FancyArrowPatch` to point from *xytext* to *xy*.
+ """
+
+ def __str__(self):
+ return f"Annotation({self.xy[0]:g}, {self.xy[1]:g}, {self._text!r})"
+
+ def __init__(self, text, xy,
+ xytext=None,
+ xycoords='data',
+ textcoords=None,
+ arrowprops=None,
+ annotation_clip=None,
+ **kwargs):
+ """
+ Annotate the point *xy* with text *text*.
+
+ In the simplest form, the text is placed at *xy*.
+
+ Optionally, the text can be displayed in another position *xytext*.
+ An arrow pointing from the text to the annotated point *xy* can then
+ be added by defining *arrowprops*.
+
+ Parameters
+ ----------
+ text : str
+ The text of the annotation.
+
+ xy : (float, float)
+ The point *(x, y)* to annotate. The coordinate system is determined
+ by *xycoords*.
+
+ xytext : (float, float), default: *xy*
+ The position *(x, y)* to place the text at. The coordinate system
+ is determined by *textcoords*.
+
+ xycoords : single or two-tuple of str or `.Artist` or `.Transform` or \
+callable, default: 'data'
+
+ The coordinate system that *xy* is given in. The following types
+ of values are supported:
+
+ - One of the following strings:
+
+ ==================== ============================================
+ Value Description
+ ==================== ============================================
+ 'figure points' Points from the lower left of the figure
+ 'figure pixels' Pixels from the lower left of the figure
+ 'figure fraction' Fraction of figure from lower left
+ 'subfigure points' Points from the lower left of the subfigure
+ 'subfigure pixels' Pixels from the lower left of the subfigure
+ 'subfigure fraction' Fraction of subfigure from lower left
+ 'axes points' Points from lower left corner of the Axes
+ 'axes pixels' Pixels from lower left corner of the Axes
+ 'axes fraction' Fraction of Axes from lower left
+ 'data' Use the coordinate system of the object
+ being annotated (default)
+ 'polar' *(theta, r)* if not native 'data'
+ coordinates
+ ==================== ============================================
+
+ Note that 'subfigure pixels' and 'figure pixels' are the same
+ for the parent figure, so users who want code that is usable in
+ a subfigure can use 'subfigure pixels'.
+
+ - An `.Artist`: *xy* is interpreted as a fraction of the artist's
+ `~matplotlib.transforms.Bbox`. E.g. *(0, 0)* would be the lower
+ left corner of the bounding box and *(0.5, 1)* would be the
+ center top of the bounding box.
+
+ - A `.Transform` to transform *xy* to screen coordinates.
+
+ - A function with one of the following signatures::
+
+ def transform(renderer) -> Bbox
+ def transform(renderer) -> Transform
+
+ where *renderer* is a `.RendererBase` subclass.
+
+ The result of the function is interpreted like the `.Artist` and
+ `.Transform` cases above.
+
+ - A tuple *(xcoords, ycoords)* specifying separate coordinate
+ systems for *x* and *y*. *xcoords* and *ycoords* must each be
+ of one of the above described types.
+
+ See :ref:`plotting-guide-annotation` for more details.
+
+ textcoords : single or two-tuple of str or `.Artist` or `.Transform` \
+or callable, default: value of *xycoords*
+ The coordinate system that *xytext* is given in.
+
+ All *xycoords* values are valid as well as the following strings:
+
+ ================= =================================================
+ Value Description
+ ================= =================================================
+ 'offset points' Offset, in points, from the *xy* value
+ 'offset pixels' Offset, in pixels, from the *xy* value
+ 'offset fontsize' Offset, relative to fontsize, from the *xy* value
+ ================= =================================================
+
+ arrowprops : dict, optional
+ The properties used to draw a `.FancyArrowPatch` arrow between the
+ positions *xy* and *xytext*. Defaults to None, i.e. no arrow is
+ drawn.
+
+ For historical reasons there are two different ways to specify
+ arrows, "simple" and "fancy":
+
+ **Simple arrow:**
+
+ If *arrowprops* does not contain the key 'arrowstyle' the
+ allowed keys are:
+
+ ========== =================================================
+ Key Description
+ ========== =================================================
+ width The width of the arrow in points
+ headwidth The width of the base of the arrow head in points
+ headlength The length of the arrow head in points
+ shrink Fraction of total length to shrink from both ends
+ ? Any `.FancyArrowPatch` property
+ ========== =================================================
+
+ The arrow is attached to the edge of the text box, the exact
+ position (corners or centers) depending on where it's pointing to.
+
+ **Fancy arrow:**
+
+ This is used if 'arrowstyle' is provided in the *arrowprops*.
+
+ Valid keys are the following `.FancyArrowPatch` parameters:
+
+ =============== ===================================
+ Key Description
+ =============== ===================================
+ arrowstyle The arrow style
+ connectionstyle The connection style
+ relpos See below; default is (0.5, 0.5)
+ patchA Default is bounding box of the text
+ patchB Default is None
+ shrinkA In points. Default is 2 points
+ shrinkB In points. Default is 2 points
+ mutation_scale Default is text size (in points)
+ mutation_aspect Default is 1
+ ? Any `.FancyArrowPatch` property
+ =============== ===================================
+
+ The exact starting point position of the arrow is defined by
+ *relpos*. It's a tuple of relative coordinates of the text box,
+ where (0, 0) is the lower left corner and (1, 1) is the upper
+ right corner. Values <0 and >1 are supported and specify points
+ outside the text box. By default (0.5, 0.5), so the starting point
+ is centered in the text box.
+
+ annotation_clip : bool or None, default: None
+ Whether to clip (i.e. not draw) the annotation when the annotation
+ point *xy* is outside the Axes area.
+
+ - If *True*, the annotation will be clipped when *xy* is outside
+ the Axes.
+ - If *False*, the annotation will always be drawn.
+ - If *None*, the annotation will be clipped when *xy* is outside
+ the Axes and *xycoords* is 'data'.
+
+ **kwargs
+ Additional kwargs are passed to `.Text`.
+
+ Returns
+ -------
+ `.Annotation`
+
+ See Also
+ --------
+ :ref:`annotations`
+
+ """
+ _AnnotationBase.__init__(self,
+ xy,
+ xycoords=xycoords,
+ annotation_clip=annotation_clip)
+ # warn about wonky input data
+ if (xytext is None and
+ textcoords is not None and
+ textcoords != xycoords):
+ _api.warn_external("You have used the `textcoords` kwarg, but "
+ "not the `xytext` kwarg. This can lead to "
+ "surprising results.")
+
+ # clean up textcoords and assign default
+ if textcoords is None:
+ textcoords = self.xycoords
+ self._textcoords = textcoords
+
+ # cleanup xytext defaults
+ if xytext is None:
+ xytext = self.xy
+ x, y = xytext
+
+ self.arrowprops = arrowprops
+ if arrowprops is not None:
+ arrowprops = arrowprops.copy()
+ if "arrowstyle" in arrowprops:
+ self._arrow_relpos = arrowprops.pop("relpos", (0.5, 0.5))
+ else:
+ # modified YAArrow API to be used with FancyArrowPatch
+ for key in ['width', 'headwidth', 'headlength', 'shrink']:
+ arrowprops.pop(key, None)
+ self.arrow_patch = FancyArrowPatch((0, 0), (1, 1), **arrowprops)
+ else:
+ self.arrow_patch = None
+
+ # Must come last, as some kwargs may be propagated to arrow_patch.
+ Text.__init__(self, x, y, text, **kwargs)
+
+ def contains(self, mouseevent):
+ if self._different_canvas(mouseevent):
+ return False, {}
+ contains, tinfo = Text.contains(self, mouseevent)
+ if self.arrow_patch is not None:
+ in_patch, _ = self.arrow_patch.contains(mouseevent)
+ contains = contains or in_patch
+ return contains, tinfo
+
+ @property
+ def xycoords(self):
+ return self._xycoords
+
+ @xycoords.setter
+ def xycoords(self, xycoords):
+ def is_offset(s):
+ return isinstance(s, str) and s.startswith("offset")
+
+ if (isinstance(xycoords, tuple) and any(map(is_offset, xycoords))
+ or is_offset(xycoords)):
+ raise ValueError("xycoords cannot be an offset coordinate")
+ self._xycoords = xycoords
+
+ @property
+ def xyann(self):
+ """
+ The text position.
+
+ See also *xytext* in `.Annotation`.
+ """
+ return self.get_position()
+
+ @xyann.setter
+ def xyann(self, xytext):
+ self.set_position(xytext)
+
+ def get_anncoords(self):
+ """
+ Return the coordinate system to use for `.Annotation.xyann`.
+
+ See also *xycoords* in `.Annotation`.
+ """
+ return self._textcoords
+
+ def set_anncoords(self, coords):
+ """
+ Set the coordinate system to use for `.Annotation.xyann`.
+
+ See also *xycoords* in `.Annotation`.
+ """
+ self._textcoords = coords
+
+ anncoords = property(get_anncoords, set_anncoords, doc="""
+ The coordinate system to use for `.Annotation.xyann`.""")
+
+ def set_figure(self, fig):
+ # docstring inherited
+ if self.arrow_patch is not None:
+ self.arrow_patch.set_figure(fig)
+ Artist.set_figure(self, fig)
+
+ def update_positions(self, renderer):
+ """
+ Update the pixel positions of the annotation text and the arrow patch.
+ """
+ # generate transformation
+ self.set_transform(self._get_xy_transform(renderer, self.anncoords))
+
+ arrowprops = self.arrowprops
+ if arrowprops is None:
+ return
+
+ bbox = Text.get_window_extent(self, renderer)
+
+ arrow_end = x1, y1 = self._get_position_xy(renderer) # Annotated pos.
+
+ ms = arrowprops.get("mutation_scale", self.get_size())
+ self.arrow_patch.set_mutation_scale(ms)
+
+ if "arrowstyle" not in arrowprops:
+ # Approximately simulate the YAArrow.
+ shrink = arrowprops.get('shrink', 0.0)
+ width = arrowprops.get('width', 4)
+ headwidth = arrowprops.get('headwidth', 12)
+ headlength = arrowprops.get('headlength', 12)
+
+ # NB: ms is in pts
+ stylekw = dict(head_length=headlength / ms,
+ head_width=headwidth / ms,
+ tail_width=width / ms)
+
+ self.arrow_patch.set_arrowstyle('simple', **stylekw)
+
+ # using YAArrow style:
+ # pick the corner of the text bbox closest to annotated point.
+ xpos = [(bbox.x0, 0), ((bbox.x0 + bbox.x1) / 2, 0.5), (bbox.x1, 1)]
+ ypos = [(bbox.y0, 0), ((bbox.y0 + bbox.y1) / 2, 0.5), (bbox.y1, 1)]
+ x, relposx = min(xpos, key=lambda v: abs(v[0] - x1))
+ y, relposy = min(ypos, key=lambda v: abs(v[0] - y1))
+ self._arrow_relpos = (relposx, relposy)
+ r = np.hypot(y - y1, x - x1)
+ shrink_pts = shrink * r / renderer.points_to_pixels(1)
+ self.arrow_patch.shrinkA = self.arrow_patch.shrinkB = shrink_pts
+
+ # adjust the starting point of the arrow relative to the textbox.
+ # TODO : Rotation needs to be accounted.
+ arrow_begin = bbox.p0 + bbox.size * self._arrow_relpos
+ # The arrow is drawn from arrow_begin to arrow_end. It will be first
+ # clipped by patchA and patchB. Then it will be shrunk by shrinkA and
+ # shrinkB (in points). If patchA is not set, self.bbox_patch is used.
+ self.arrow_patch.set_positions(arrow_begin, arrow_end)
+
+ if "patchA" in arrowprops:
+ patchA = arrowprops["patchA"]
+ elif self._bbox_patch:
+ patchA = self._bbox_patch
+ elif self.get_text() == "":
+ patchA = None
+ else:
+ pad = renderer.points_to_pixels(4)
+ patchA = Rectangle(
+ xy=(bbox.x0 - pad / 2, bbox.y0 - pad / 2),
+ width=bbox.width + pad, height=bbox.height + pad,
+ transform=IdentityTransform(), clip_on=False)
+ self.arrow_patch.set_patchA(patchA)
+
+ @artist.allow_rasterization
+ def draw(self, renderer):
+ # docstring inherited
+ if renderer is not None:
+ self._renderer = renderer
+ if not self.get_visible() or not self._check_xy(renderer):
+ return
+ # Update text positions before `Text.draw` would, so that the
+ # FancyArrowPatch is correctly positioned.
+ self.update_positions(renderer)
+ self.update_bbox_position_size(renderer)
+ if self.arrow_patch is not None: # FancyArrowPatch
+ if (self.arrow_patch.get_figure(root=False) is None and
+ (fig := self.get_figure(root=False)) is not None):
+ self.arrow_patch.set_figure(fig)
+ self.arrow_patch.draw(renderer)
+ # Draw text, including FancyBboxPatch, after FancyArrowPatch.
+ # Otherwise, a wedge arrowstyle can land partly on top of the Bbox.
+ Text.draw(self, renderer)
+
+ def get_window_extent(self, renderer=None):
+ # docstring inherited
+ # This block is the same as in Text.get_window_extent, but we need to
+ # set the renderer before calling update_positions().
+ if not self.get_visible() or not self._check_xy(renderer):
+ return Bbox.unit()
+ if renderer is not None:
+ self._renderer = renderer
+ if self._renderer is None:
+ self._renderer = self.get_figure(root=True)._get_renderer()
+ if self._renderer is None:
+ raise RuntimeError('Cannot get window extent without renderer')
+
+ self.update_positions(self._renderer)
+
+ text_bbox = Text.get_window_extent(self)
+ bboxes = [text_bbox]
+
+ if self.arrow_patch is not None:
+ bboxes.append(self.arrow_patch.get_window_extent())
+
+ return Bbox.union(bboxes)
+
+ def get_tightbbox(self, renderer=None):
+ # docstring inherited
+ if not self._check_xy(renderer):
+ return Bbox.null()
+ return super().get_tightbbox(renderer)
+
+
+_docstring.interpd.register(Annotation=Annotation.__init__.__doc__)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/text.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/text.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..d65a3dc4c7da2754b35e59f79e47318e55effa7e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/text.pyi
@@ -0,0 +1,181 @@
+from .artist import Artist
+from .backend_bases import RendererBase
+from .font_manager import FontProperties
+from .offsetbox import DraggableAnnotation
+from .path import Path
+from .patches import FancyArrowPatch, FancyBboxPatch
+from .textpath import ( # noqa: F401, reexported API
+ TextPath as TextPath,
+ TextToPath as TextToPath,
+)
+from .transforms import (
+ Bbox,
+ BboxBase,
+ Transform,
+)
+
+from collections.abc import Callable, Iterable
+from typing import Any, Literal
+from .typing import ColorType, CoordsType
+
+class Text(Artist):
+ zorder: float
+ def __init__(
+ self,
+ x: float = ...,
+ y: float = ...,
+ text: Any = ...,
+ *,
+ color: ColorType | None = ...,
+ verticalalignment: Literal[
+ "bottom", "baseline", "center", "center_baseline", "top"
+ ] = ...,
+ horizontalalignment: Literal["left", "center", "right"] = ...,
+ multialignment: Literal["left", "center", "right"] | None = ...,
+ fontproperties: str | Path | FontProperties | None = ...,
+ rotation: float | Literal["vertical", "horizontal"] | None = ...,
+ linespacing: float | None = ...,
+ rotation_mode: Literal["default", "anchor"] | None = ...,
+ usetex: bool | None = ...,
+ wrap: bool = ...,
+ transform_rotates_text: bool = ...,
+ parse_math: bool | None = ...,
+ antialiased: bool | None = ...,
+ **kwargs
+ ) -> None: ...
+ def update(self, kwargs: dict[str, Any]) -> list[Any]: ...
+ def get_rotation(self) -> float: ...
+ def get_transform_rotates_text(self) -> bool: ...
+ def set_rotation_mode(self, m: None | Literal["default", "anchor"]) -> None: ...
+ def get_rotation_mode(self) -> Literal["default", "anchor"]: ...
+ def set_bbox(self, rectprops: dict[str, Any]) -> None: ...
+ def get_bbox_patch(self) -> None | FancyBboxPatch: ...
+ def update_bbox_position_size(self, renderer: RendererBase) -> None: ...
+ def get_wrap(self) -> bool: ...
+ def set_wrap(self, wrap: bool) -> None: ...
+ def get_color(self) -> ColorType: ...
+ def get_fontproperties(self) -> FontProperties: ...
+ def get_fontfamily(self) -> list[str]: ...
+ def get_fontname(self) -> str: ...
+ def get_fontstyle(self) -> Literal["normal", "italic", "oblique"]: ...
+ def get_fontsize(self) -> float | str: ...
+ def get_fontvariant(self) -> Literal["normal", "small-caps"]: ...
+ def get_fontweight(self) -> int | str: ...
+ def get_stretch(self) -> int | str: ...
+ def get_horizontalalignment(self) -> Literal["left", "center", "right"]: ...
+ def get_unitless_position(self) -> tuple[float, float]: ...
+ def get_position(self) -> tuple[float, float]: ...
+ def get_text(self) -> str: ...
+ def get_verticalalignment(
+ self,
+ ) -> Literal["bottom", "baseline", "center", "center_baseline", "top"]: ...
+ def get_window_extent(
+ self, renderer: RendererBase | None = ..., dpi: float | None = ...
+ ) -> Bbox: ...
+ def set_backgroundcolor(self, color: ColorType) -> None: ...
+ def set_color(self, color: ColorType) -> None: ...
+ def set_horizontalalignment(
+ self, align: Literal["left", "center", "right"]
+ ) -> None: ...
+ def set_multialignment(self, align: Literal["left", "center", "right"]) -> None: ...
+ def set_linespacing(self, spacing: float) -> None: ...
+ def set_fontfamily(self, fontname: str | Iterable[str]) -> None: ...
+ def set_fontvariant(self, variant: Literal["normal", "small-caps"]) -> None: ...
+ def set_fontstyle(
+ self, fontstyle: Literal["normal", "italic", "oblique"]
+ ) -> None: ...
+ def set_fontsize(self, fontsize: float | str) -> None: ...
+ def get_math_fontfamily(self) -> str: ...
+ def set_math_fontfamily(self, fontfamily: str) -> None: ...
+ def set_fontweight(self, weight: int | str) -> None: ...
+ def set_fontstretch(self, stretch: int | str) -> None: ...
+ def set_position(self, xy: tuple[float, float]) -> None: ...
+ def set_x(self, x: float) -> None: ...
+ def set_y(self, y: float) -> None: ...
+ def set_rotation(self, s: float) -> None: ...
+ def set_transform_rotates_text(self, t: bool) -> None: ...
+ def set_verticalalignment(
+ self, align: Literal["bottom", "baseline", "center", "center_baseline", "top"]
+ ) -> None: ...
+ def set_text(self, s: Any) -> None: ...
+ def set_fontproperties(self, fp: FontProperties | str | Path | None) -> None: ...
+ def set_usetex(self, usetex: bool | None) -> None: ...
+ def get_usetex(self) -> bool: ...
+ def set_parse_math(self, parse_math: bool) -> None: ...
+ def get_parse_math(self) -> bool: ...
+ def set_fontname(self, fontname: str | Iterable[str]) -> None: ...
+ def get_antialiased(self) -> bool: ...
+ def set_antialiased(self, antialiased: bool) -> None: ...
+
+class OffsetFrom:
+ def __init__(
+ self,
+ artist: Artist | BboxBase | Transform,
+ ref_coord: tuple[float, float],
+ unit: Literal["points", "pixels"] = ...,
+ ) -> None: ...
+ def set_unit(self, unit: Literal["points", "pixels"]) -> None: ...
+ def get_unit(self) -> Literal["points", "pixels"]: ...
+ def __call__(self, renderer: RendererBase) -> Transform: ...
+
+class _AnnotationBase:
+ xy: tuple[float, float]
+ xycoords: CoordsType
+ def __init__(
+ self,
+ xy,
+ xycoords: CoordsType = ...,
+ annotation_clip: bool | None = ...,
+ ) -> None: ...
+ def set_annotation_clip(self, b: bool | None) -> None: ...
+ def get_annotation_clip(self) -> bool | None: ...
+ def draggable(
+ self, state: bool | None = ..., use_blit: bool = ...
+ ) -> DraggableAnnotation | None: ...
+
+class Annotation(Text, _AnnotationBase):
+ arrowprops: dict[str, Any] | None
+ arrow_patch: FancyArrowPatch | None
+ def __init__(
+ self,
+ text: str,
+ xy: tuple[float, float],
+ xytext: tuple[float, float] | None = ...,
+ xycoords: CoordsType = ...,
+ textcoords: CoordsType | None = ...,
+ arrowprops: dict[str, Any] | None = ...,
+ annotation_clip: bool | None = ...,
+ **kwargs
+ ) -> None: ...
+ @property
+ def xycoords(
+ self,
+ ) -> CoordsType: ...
+ @xycoords.setter
+ def xycoords(
+ self,
+ xycoords: CoordsType,
+ ) -> None: ...
+ @property
+ def xyann(self) -> tuple[float, float]: ...
+ @xyann.setter
+ def xyann(self, xytext: tuple[float, float]) -> None: ...
+ def get_anncoords(
+ self,
+ ) -> CoordsType: ...
+ def set_anncoords(
+ self,
+ coords: CoordsType,
+ ) -> None: ...
+ @property
+ def anncoords(
+ self,
+ ) -> CoordsType: ...
+ @anncoords.setter
+ def anncoords(
+ self,
+ coords: CoordsType,
+ ) -> None: ...
+ def update_positions(self, renderer: RendererBase) -> None: ...
+ # Drops `dpi` parameter from superclass
+ def get_window_extent(self, renderer: RendererBase | None = ...) -> Bbox: ... # type: ignore[override]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/textpath.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/textpath.py
new file mode 100644
index 0000000000000000000000000000000000000000..83182e3f54002fbdef9c8fcae89f64ad0ff87d5f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/textpath.py
@@ -0,0 +1,397 @@
+from collections import OrderedDict
+import logging
+import urllib.parse
+
+import numpy as np
+
+from matplotlib import _text_helpers, dviread
+from matplotlib.font_manager import (
+ FontProperties, get_font, fontManager as _fontManager
+)
+from matplotlib.ft2font import LoadFlags
+from matplotlib.mathtext import MathTextParser
+from matplotlib.path import Path
+from matplotlib.texmanager import TexManager
+from matplotlib.transforms import Affine2D
+
+_log = logging.getLogger(__name__)
+
+
+class TextToPath:
+ """A class that converts strings to paths."""
+
+ FONT_SCALE = 100.
+ DPI = 72
+
+ def __init__(self):
+ self.mathtext_parser = MathTextParser('path')
+ self._texmanager = None
+
+ def _get_font(self, prop):
+ """
+ Find the `FT2Font` matching font properties *prop*, with its size set.
+ """
+ filenames = _fontManager._find_fonts_by_props(prop)
+ font = get_font(filenames)
+ font.set_size(self.FONT_SCALE, self.DPI)
+ return font
+
+ def _get_hinting_flag(self):
+ return LoadFlags.NO_HINTING
+
+ def _get_char_id(self, font, ccode):
+ """
+ Return a unique id for the given font and character-code set.
+ """
+ return urllib.parse.quote(f"{font.postscript_name}-{ccode:x}")
+
+ def get_text_width_height_descent(self, s, prop, ismath):
+ fontsize = prop.get_size_in_points()
+
+ if ismath == "TeX":
+ return TexManager().get_text_width_height_descent(s, fontsize)
+
+ scale = fontsize / self.FONT_SCALE
+
+ if ismath:
+ prop = prop.copy()
+ prop.set_size(self.FONT_SCALE)
+ width, height, descent, *_ = \
+ self.mathtext_parser.parse(s, 72, prop)
+ return width * scale, height * scale, descent * scale
+
+ font = self._get_font(prop)
+ font.set_text(s, 0.0, flags=LoadFlags.NO_HINTING)
+ w, h = font.get_width_height()
+ w /= 64.0 # convert from subpixels
+ h /= 64.0
+ d = font.get_descent()
+ d /= 64.0
+ return w * scale, h * scale, d * scale
+
+ def get_text_path(self, prop, s, ismath=False):
+ """
+ Convert text *s* to path (a tuple of vertices and codes for
+ matplotlib.path.Path).
+
+ Parameters
+ ----------
+ prop : `~matplotlib.font_manager.FontProperties`
+ The font properties for the text.
+ s : str
+ The text to be converted.
+ ismath : {False, True, "TeX"}
+ If True, use mathtext parser. If "TeX", use tex for rendering.
+
+ Returns
+ -------
+ verts : list
+ A list of arrays containing the (x, y) coordinates of the vertices.
+ codes : list
+ A list of path codes.
+
+ Examples
+ --------
+ Create a list of vertices and codes from a text, and create a `.Path`
+ from those::
+
+ from matplotlib.path import Path
+ from matplotlib.text import TextToPath
+ from matplotlib.font_manager import FontProperties
+
+ fp = FontProperties(family="Comic Neue", style="italic")
+ verts, codes = TextToPath().get_text_path(fp, "ABC")
+ path = Path(verts, codes, closed=False)
+
+ Also see `TextPath` for a more direct way to create a path from a text.
+ """
+ if ismath == "TeX":
+ glyph_info, glyph_map, rects = self.get_glyphs_tex(prop, s)
+ elif not ismath:
+ font = self._get_font(prop)
+ glyph_info, glyph_map, rects = self.get_glyphs_with_font(font, s)
+ else:
+ glyph_info, glyph_map, rects = self.get_glyphs_mathtext(prop, s)
+
+ verts, codes = [], []
+ for glyph_id, xposition, yposition, scale in glyph_info:
+ verts1, codes1 = glyph_map[glyph_id]
+ verts.extend(verts1 * scale + [xposition, yposition])
+ codes.extend(codes1)
+ for verts1, codes1 in rects:
+ verts.extend(verts1)
+ codes.extend(codes1)
+
+ # Make sure an empty string or one with nothing to print
+ # (e.g. only spaces & newlines) will be valid/empty path
+ if not verts:
+ verts = np.empty((0, 2))
+
+ return verts, codes
+
+ def get_glyphs_with_font(self, font, s, glyph_map=None,
+ return_new_glyphs_only=False):
+ """
+ Convert string *s* to vertices and codes using the provided ttf font.
+ """
+
+ if glyph_map is None:
+ glyph_map = OrderedDict()
+
+ if return_new_glyphs_only:
+ glyph_map_new = OrderedDict()
+ else:
+ glyph_map_new = glyph_map
+
+ xpositions = []
+ glyph_ids = []
+ for item in _text_helpers.layout(s, font):
+ char_id = self._get_char_id(item.ft_object, ord(item.char))
+ glyph_ids.append(char_id)
+ xpositions.append(item.x)
+ if char_id not in glyph_map:
+ glyph_map_new[char_id] = item.ft_object.get_path()
+
+ ypositions = [0] * len(xpositions)
+ sizes = [1.] * len(xpositions)
+
+ rects = []
+
+ return (list(zip(glyph_ids, xpositions, ypositions, sizes)),
+ glyph_map_new, rects)
+
+ def get_glyphs_mathtext(self, prop, s, glyph_map=None,
+ return_new_glyphs_only=False):
+ """
+ Parse mathtext string *s* and convert it to a (vertices, codes) pair.
+ """
+
+ prop = prop.copy()
+ prop.set_size(self.FONT_SCALE)
+
+ width, height, descent, glyphs, rects = self.mathtext_parser.parse(
+ s, self.DPI, prop)
+
+ if not glyph_map:
+ glyph_map = OrderedDict()
+
+ if return_new_glyphs_only:
+ glyph_map_new = OrderedDict()
+ else:
+ glyph_map_new = glyph_map
+
+ xpositions = []
+ ypositions = []
+ glyph_ids = []
+ sizes = []
+
+ for font, fontsize, ccode, ox, oy in glyphs:
+ char_id = self._get_char_id(font, ccode)
+ if char_id not in glyph_map:
+ font.clear()
+ font.set_size(self.FONT_SCALE, self.DPI)
+ font.load_char(ccode, flags=LoadFlags.NO_HINTING)
+ glyph_map_new[char_id] = font.get_path()
+
+ xpositions.append(ox)
+ ypositions.append(oy)
+ glyph_ids.append(char_id)
+ size = fontsize / self.FONT_SCALE
+ sizes.append(size)
+
+ myrects = []
+ for ox, oy, w, h in rects:
+ vert1 = [(ox, oy), (ox, oy + h), (ox + w, oy + h),
+ (ox + w, oy), (ox, oy), (0, 0)]
+ code1 = [Path.MOVETO,
+ Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO,
+ Path.CLOSEPOLY]
+ myrects.append((vert1, code1))
+
+ return (list(zip(glyph_ids, xpositions, ypositions, sizes)),
+ glyph_map_new, myrects)
+
+ def get_glyphs_tex(self, prop, s, glyph_map=None,
+ return_new_glyphs_only=False):
+ """Convert the string *s* to vertices and codes using usetex mode."""
+ # Mostly borrowed from pdf backend.
+
+ dvifile = TexManager().make_dvi(s, self.FONT_SCALE)
+ with dviread.Dvi(dvifile, self.DPI) as dvi:
+ page, = dvi
+
+ if glyph_map is None:
+ glyph_map = OrderedDict()
+
+ if return_new_glyphs_only:
+ glyph_map_new = OrderedDict()
+ else:
+ glyph_map_new = glyph_map
+
+ glyph_ids, xpositions, ypositions, sizes = [], [], [], []
+
+ # Gather font information and do some setup for combining
+ # characters into strings.
+ for text in page.text:
+ font = get_font(text.font_path)
+ char_id = self._get_char_id(font, text.glyph)
+ if char_id not in glyph_map:
+ font.clear()
+ font.set_size(self.FONT_SCALE, self.DPI)
+ glyph_name_or_index = text.glyph_name_or_index
+ if isinstance(glyph_name_or_index, str):
+ index = font.get_name_index(glyph_name_or_index)
+ font.load_glyph(index, flags=LoadFlags.TARGET_LIGHT)
+ elif isinstance(glyph_name_or_index, int):
+ self._select_native_charmap(font)
+ font.load_char(
+ glyph_name_or_index, flags=LoadFlags.TARGET_LIGHT)
+ else: # Should not occur.
+ raise TypeError(f"Glyph spec of unexpected type: "
+ f"{glyph_name_or_index!r}")
+ glyph_map_new[char_id] = font.get_path()
+
+ glyph_ids.append(char_id)
+ xpositions.append(text.x)
+ ypositions.append(text.y)
+ sizes.append(text.font_size / self.FONT_SCALE)
+
+ myrects = []
+
+ for ox, oy, h, w in page.boxes:
+ vert1 = [(ox, oy), (ox + w, oy), (ox + w, oy + h),
+ (ox, oy + h), (ox, oy), (0, 0)]
+ code1 = [Path.MOVETO,
+ Path.LINETO, Path.LINETO, Path.LINETO, Path.LINETO,
+ Path.CLOSEPOLY]
+ myrects.append((vert1, code1))
+
+ return (list(zip(glyph_ids, xpositions, ypositions, sizes)),
+ glyph_map_new, myrects)
+
+ @staticmethod
+ def _select_native_charmap(font):
+ # Select the native charmap. (we can't directly identify it but it's
+ # typically an Adobe charmap).
+ for charmap_code in [
+ 1094992451, # ADOBE_CUSTOM.
+ 1094995778, # ADOBE_STANDARD.
+ ]:
+ try:
+ font.select_charmap(charmap_code)
+ except (ValueError, RuntimeError):
+ pass
+ else:
+ break
+ else:
+ _log.warning("No supported encoding in font (%s).", font.fname)
+
+
+text_to_path = TextToPath()
+
+
+class TextPath(Path):
+ """
+ Create a path from the text.
+ """
+
+ def __init__(self, xy, s, size=None, prop=None,
+ _interpolation_steps=1, usetex=False):
+ r"""
+ Create a path from the text. Note that it simply is a path,
+ not an artist. You need to use the `.PathPatch` (or other artists)
+ to draw this path onto the canvas.
+
+ Parameters
+ ----------
+ xy : tuple or array of two float values
+ Position of the text. For no offset, use ``xy=(0, 0)``.
+
+ s : str
+ The text to convert to a path.
+
+ size : float, optional
+ Font size in points. Defaults to the size specified via the font
+ properties *prop*.
+
+ prop : `~matplotlib.font_manager.FontProperties`, optional
+ Font property. If not provided, will use a default
+ `.FontProperties` with parameters from the
+ :ref:`rcParams`.
+
+ _interpolation_steps : int, optional
+ (Currently ignored)
+
+ usetex : bool, default: False
+ Whether to use tex rendering.
+
+ Examples
+ --------
+ The following creates a path from the string "ABC" with Helvetica
+ font face; and another path from the latex fraction 1/2::
+
+ from matplotlib.text import TextPath
+ from matplotlib.font_manager import FontProperties
+
+ fp = FontProperties(family="Helvetica", style="italic")
+ path1 = TextPath((12, 12), "ABC", size=12, prop=fp)
+ path2 = TextPath((0, 0), r"$\frac{1}{2}$", size=12, usetex=True)
+
+ Also see :doc:`/gallery/text_labels_and_annotations/demo_text_path`.
+ """
+ # Circular import.
+ from matplotlib.text import Text
+
+ prop = FontProperties._from_any(prop)
+ if size is None:
+ size = prop.get_size_in_points()
+
+ self._xy = xy
+ self.set_size(size)
+
+ self._cached_vertices = None
+ s, ismath = Text(usetex=usetex)._preprocess_math(s)
+ super().__init__(
+ *text_to_path.get_text_path(prop, s, ismath=ismath),
+ _interpolation_steps=_interpolation_steps,
+ readonly=True)
+ self._should_simplify = False
+
+ def set_size(self, size):
+ """Set the text size."""
+ self._size = size
+ self._invalid = True
+
+ def get_size(self):
+ """Get the text size."""
+ return self._size
+
+ @property
+ def vertices(self):
+ """
+ Return the cached path after updating it if necessary.
+ """
+ self._revalidate_path()
+ return self._cached_vertices
+
+ @property
+ def codes(self):
+ """
+ Return the codes
+ """
+ return self._codes
+
+ def _revalidate_path(self):
+ """
+ Update the path if necessary.
+
+ The path for the text is initially create with the font size of
+ `.FONT_SCALE`, and this path is rescaled to other size when necessary.
+ """
+ if self._invalid or self._cached_vertices is None:
+ tr = (Affine2D()
+ .scale(self._size / text_to_path.FONT_SCALE)
+ .translate(*self._xy))
+ self._cached_vertices = tr.transform(self._vertices)
+ self._cached_vertices.flags.writeable = False
+ self._invalid = False
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/textpath.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/textpath.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..34d4e92ac47ef45c70ab906bc3b8d1fa2bac07dd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/textpath.pyi
@@ -0,0 +1,74 @@
+from matplotlib.font_manager import FontProperties
+from matplotlib.ft2font import FT2Font
+from matplotlib.mathtext import MathTextParser, VectorParse
+from matplotlib.path import Path
+
+import numpy as np
+
+from typing import Literal
+
+class TextToPath:
+ FONT_SCALE: float
+ DPI: float
+ mathtext_parser: MathTextParser[VectorParse]
+ def __init__(self) -> None: ...
+ def get_text_width_height_descent(
+ self, s: str, prop: FontProperties, ismath: bool | Literal["TeX"]
+ ) -> tuple[float, float, float]: ...
+ def get_text_path(
+ self, prop: FontProperties, s: str, ismath: bool | Literal["TeX"] = ...
+ ) -> list[np.ndarray]: ...
+ def get_glyphs_with_font(
+ self,
+ font: FT2Font,
+ s: str,
+ glyph_map: dict[str, tuple[np.ndarray, np.ndarray]] | None = ...,
+ return_new_glyphs_only: bool = ...,
+ ) -> tuple[
+ list[tuple[str, float, float, float]],
+ dict[str, tuple[np.ndarray, np.ndarray]],
+ list[tuple[list[tuple[float, float]], list[int]]],
+ ]: ...
+ def get_glyphs_mathtext(
+ self,
+ prop: FontProperties,
+ s: str,
+ glyph_map: dict[str, tuple[np.ndarray, np.ndarray]] | None = ...,
+ return_new_glyphs_only: bool = ...,
+ ) -> tuple[
+ list[tuple[str, float, float, float]],
+ dict[str, tuple[np.ndarray, np.ndarray]],
+ list[tuple[list[tuple[float, float]], list[int]]],
+ ]: ...
+ def get_glyphs_tex(
+ self,
+ prop: FontProperties,
+ s: str,
+ glyph_map: dict[str, tuple[np.ndarray, np.ndarray]] | None = ...,
+ return_new_glyphs_only: bool = ...,
+ ) -> tuple[
+ list[tuple[str, float, float, float]],
+ dict[str, tuple[np.ndarray, np.ndarray]],
+ list[tuple[list[tuple[float, float]], list[int]]],
+ ]: ...
+
+text_to_path: TextToPath
+
+class TextPath(Path):
+ def __init__(
+ self,
+ xy: tuple[float, float],
+ s: str,
+ size: float | None = ...,
+ prop: FontProperties | None = ...,
+ _interpolation_steps: int = ...,
+ usetex: bool = ...,
+ ) -> None: ...
+ def set_size(self, size: float | None) -> None: ...
+ def get_size(self) -> float | None: ...
+
+ # These are read only... there actually are protections in the base class, so probably can be deleted...
+ @property # type: ignore[misc]
+ def vertices(self) -> np.ndarray: ... # type: ignore[override]
+ @property # type: ignore[misc]
+ def codes(self) -> np.ndarray: ... # type: ignore[override]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ticker.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ticker.py
new file mode 100644
index 0000000000000000000000000000000000000000..3d0059e5aca33923a167d8731de9285d5d24d833
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ticker.py
@@ -0,0 +1,2990 @@
+"""
+Tick locating and formatting
+============================
+
+This module contains classes for configuring tick locating and formatting.
+Generic tick locators and formatters are provided, as well as domain specific
+custom ones.
+
+Although the locators know nothing about major or minor ticks, they are used
+by the Axis class to support major and minor tick locating and formatting.
+
+.. _tick_locating:
+.. _locators:
+
+Tick locating
+-------------
+
+The Locator class is the base class for all tick locators. The locators
+handle autoscaling of the view limits based on the data limits, and the
+choosing of tick locations. A useful semi-automatic tick locator is
+`MultipleLocator`. It is initialized with a base, e.g., 10, and it picks
+axis limits and ticks that are multiples of that base.
+
+The Locator subclasses defined here are:
+
+======================= =======================================================
+`AutoLocator` `MaxNLocator` with simple defaults. This is the default
+ tick locator for most plotting.
+`MaxNLocator` Finds up to a max number of intervals with ticks at
+ nice locations.
+`LinearLocator` Space ticks evenly from min to max.
+`LogLocator` Space ticks logarithmically from min to max.
+`MultipleLocator` Ticks and range are a multiple of base; either integer
+ or float.
+`FixedLocator` Tick locations are fixed.
+`IndexLocator` Locator for index plots (e.g., where
+ ``x = range(len(y))``).
+`NullLocator` No ticks.
+`SymmetricalLogLocator` Locator for use with the symlog norm; works like
+ `LogLocator` for the part outside of the threshold and
+ adds 0 if inside the limits.
+`AsinhLocator` Locator for use with the asinh norm, attempting to
+ space ticks approximately uniformly.
+`LogitLocator` Locator for logit scaling.
+`AutoMinorLocator` Locator for minor ticks when the axis is linear and the
+ major ticks are uniformly spaced. Subdivides the major
+ tick interval into a specified number of minor
+ intervals, defaulting to 4 or 5 depending on the major
+ interval.
+======================= =======================================================
+
+There are a number of locators specialized for date locations - see
+the :mod:`.dates` module.
+
+You can define your own locator by deriving from Locator. You must
+override the ``__call__`` method, which returns a sequence of locations,
+and you will probably want to override the autoscale method to set the
+view limits from the data limits.
+
+If you want to override the default locator, use one of the above or a custom
+locator and pass it to the x- or y-axis instance. The relevant methods are::
+
+ ax.xaxis.set_major_locator(xmajor_locator)
+ ax.xaxis.set_minor_locator(xminor_locator)
+ ax.yaxis.set_major_locator(ymajor_locator)
+ ax.yaxis.set_minor_locator(yminor_locator)
+
+The default minor locator is `NullLocator`, i.e., no minor ticks on by default.
+
+.. note::
+ `Locator` instances should not be used with more than one
+ `~matplotlib.axis.Axis` or `~matplotlib.axes.Axes`. So instead of::
+
+ locator = MultipleLocator(5)
+ ax.xaxis.set_major_locator(locator)
+ ax2.xaxis.set_major_locator(locator)
+
+ do the following instead::
+
+ ax.xaxis.set_major_locator(MultipleLocator(5))
+ ax2.xaxis.set_major_locator(MultipleLocator(5))
+
+.. _formatters:
+
+Tick formatting
+---------------
+
+Tick formatting is controlled by classes derived from Formatter. The formatter
+operates on a single tick value and returns a string to the axis.
+
+========================= =====================================================
+`NullFormatter` No labels on the ticks.
+`FixedFormatter` Set the strings manually for the labels.
+`FuncFormatter` User defined function sets the labels.
+`StrMethodFormatter` Use string `format` method.
+`FormatStrFormatter` Use an old-style sprintf format string.
+`ScalarFormatter` Default formatter for scalars: autopick the format
+ string.
+`LogFormatter` Formatter for log axes.
+`LogFormatterExponent` Format values for log axis using
+ ``exponent = log_base(value)``.
+`LogFormatterMathtext` Format values for log axis using
+ ``exponent = log_base(value)`` using Math text.
+`LogFormatterSciNotation` Format values for log axis using scientific notation.
+`LogitFormatter` Probability formatter.
+`EngFormatter` Format labels in engineering notation.
+`PercentFormatter` Format labels as a percentage.
+========================= =====================================================
+
+You can derive your own formatter from the Formatter base class by
+simply overriding the ``__call__`` method. The formatter class has
+access to the axis view and data limits.
+
+To control the major and minor tick label formats, use one of the
+following methods::
+
+ ax.xaxis.set_major_formatter(xmajor_formatter)
+ ax.xaxis.set_minor_formatter(xminor_formatter)
+ ax.yaxis.set_major_formatter(ymajor_formatter)
+ ax.yaxis.set_minor_formatter(yminor_formatter)
+
+In addition to a `.Formatter` instance, `~.Axis.set_major_formatter` and
+`~.Axis.set_minor_formatter` also accept a ``str`` or function. ``str`` input
+will be internally replaced with an autogenerated `.StrMethodFormatter` with
+the input ``str``. For function input, a `.FuncFormatter` with the input
+function will be generated and used.
+
+See :doc:`/gallery/ticks/major_minor_demo` for an example of setting major
+and minor ticks. See the :mod:`matplotlib.dates` module for more information
+and examples of using date locators and formatters.
+"""
+
+import itertools
+import logging
+import locale
+import math
+from numbers import Integral
+import string
+
+import numpy as np
+
+import matplotlib as mpl
+from matplotlib import _api, cbook
+from matplotlib import transforms as mtransforms
+
+_log = logging.getLogger(__name__)
+
+__all__ = ('TickHelper', 'Formatter', 'FixedFormatter',
+ 'NullFormatter', 'FuncFormatter', 'FormatStrFormatter',
+ 'StrMethodFormatter', 'ScalarFormatter', 'LogFormatter',
+ 'LogFormatterExponent', 'LogFormatterMathtext',
+ 'LogFormatterSciNotation',
+ 'LogitFormatter', 'EngFormatter', 'PercentFormatter',
+ 'Locator', 'IndexLocator', 'FixedLocator', 'NullLocator',
+ 'LinearLocator', 'LogLocator', 'AutoLocator',
+ 'MultipleLocator', 'MaxNLocator', 'AutoMinorLocator',
+ 'SymmetricalLogLocator', 'AsinhLocator', 'LogitLocator')
+
+
+class _DummyAxis:
+ __name__ = "dummy"
+
+ def __init__(self, minpos=0):
+ self._data_interval = (0, 1)
+ self._view_interval = (0, 1)
+ self._minpos = minpos
+
+ def get_view_interval(self):
+ return self._view_interval
+
+ def set_view_interval(self, vmin, vmax):
+ self._view_interval = (vmin, vmax)
+
+ def get_minpos(self):
+ return self._minpos
+
+ def get_data_interval(self):
+ return self._data_interval
+
+ def set_data_interval(self, vmin, vmax):
+ self._data_interval = (vmin, vmax)
+
+ def get_tick_space(self):
+ # Just use the long-standing default of nbins==9
+ return 9
+
+
+class TickHelper:
+ axis = None
+
+ def set_axis(self, axis):
+ self.axis = axis
+
+ def create_dummy_axis(self, **kwargs):
+ if self.axis is None:
+ self.axis = _DummyAxis(**kwargs)
+
+
+class Formatter(TickHelper):
+ """
+ Create a string based on a tick value and location.
+ """
+ # some classes want to see all the locs to help format
+ # individual ones
+ locs = []
+
+ def __call__(self, x, pos=None):
+ """
+ Return the format for tick value *x* at position pos.
+ ``pos=None`` indicates an unspecified location.
+ """
+ raise NotImplementedError('Derived must override')
+
+ def format_ticks(self, values):
+ """Return the tick labels for all the ticks at once."""
+ self.set_locs(values)
+ return [self(value, i) for i, value in enumerate(values)]
+
+ def format_data(self, value):
+ """
+ Return the full string representation of the value with the
+ position unspecified.
+ """
+ return self.__call__(value)
+
+ def format_data_short(self, value):
+ """
+ Return a short string version of the tick value.
+
+ Defaults to the position-independent long value.
+ """
+ return self.format_data(value)
+
+ def get_offset(self):
+ return ''
+
+ def set_locs(self, locs):
+ """
+ Set the locations of the ticks.
+
+ This method is called before computing the tick labels because some
+ formatters need to know all tick locations to do so.
+ """
+ self.locs = locs
+
+ @staticmethod
+ def fix_minus(s):
+ """
+ Some classes may want to replace a hyphen for minus with the proper
+ Unicode symbol (U+2212) for typographical correctness. This is a
+ helper method to perform such a replacement when it is enabled via
+ :rc:`axes.unicode_minus`.
+ """
+ return (s.replace('-', '\N{MINUS SIGN}')
+ if mpl.rcParams['axes.unicode_minus']
+ else s)
+
+ def _set_locator(self, locator):
+ """Subclasses may want to override this to set a locator."""
+ pass
+
+
+class NullFormatter(Formatter):
+ """Always return the empty string."""
+
+ def __call__(self, x, pos=None):
+ # docstring inherited
+ return ''
+
+
+class FixedFormatter(Formatter):
+ """
+ Return fixed strings for tick labels based only on position, not value.
+
+ .. note::
+ `.FixedFormatter` should only be used together with `.FixedLocator`.
+ Otherwise, the labels may end up in unexpected positions.
+ """
+
+ def __init__(self, seq):
+ """Set the sequence *seq* of strings that will be used for labels."""
+ self.seq = seq
+ self.offset_string = ''
+
+ def __call__(self, x, pos=None):
+ """
+ Return the label that matches the position, regardless of the value.
+
+ For positions ``pos < len(seq)``, return ``seq[i]`` regardless of
+ *x*. Otherwise return empty string. ``seq`` is the sequence of
+ strings that this object was initialized with.
+ """
+ if pos is None or pos >= len(self.seq):
+ return ''
+ else:
+ return self.seq[pos]
+
+ def get_offset(self):
+ return self.offset_string
+
+ def set_offset_string(self, ofs):
+ self.offset_string = ofs
+
+
+class FuncFormatter(Formatter):
+ """
+ Use a user-defined function for formatting.
+
+ The function should take in two inputs (a tick value ``x`` and a
+ position ``pos``), and return a string containing the corresponding
+ tick label.
+ """
+
+ def __init__(self, func):
+ self.func = func
+ self.offset_string = ""
+
+ def __call__(self, x, pos=None):
+ """
+ Return the value of the user defined function.
+
+ *x* and *pos* are passed through as-is.
+ """
+ return self.func(x, pos)
+
+ def get_offset(self):
+ return self.offset_string
+
+ def set_offset_string(self, ofs):
+ self.offset_string = ofs
+
+
+class FormatStrFormatter(Formatter):
+ """
+ Use an old-style ('%' operator) format string to format the tick.
+
+ The format string should have a single variable format (%) in it.
+ It will be applied to the value (not the position) of the tick.
+
+ Negative numeric values (e.g., -1) will use a dash, not a Unicode minus;
+ use mathtext to get a Unicode minus by wrapping the format specifier with $
+ (e.g. "$%g$").
+ """
+
+ def __init__(self, fmt):
+ self.fmt = fmt
+
+ def __call__(self, x, pos=None):
+ """
+ Return the formatted label string.
+
+ Only the value *x* is formatted. The position is ignored.
+ """
+ return self.fmt % x
+
+
+class _UnicodeMinusFormat(string.Formatter):
+ """
+ A specialized string formatter so that `.StrMethodFormatter` respects
+ :rc:`axes.unicode_minus`. This implementation relies on the fact that the
+ format string is only ever called with kwargs *x* and *pos*, so it blindly
+ replaces dashes by unicode minuses without further checking.
+ """
+
+ def format_field(self, value, format_spec):
+ return Formatter.fix_minus(super().format_field(value, format_spec))
+
+
+class StrMethodFormatter(Formatter):
+ """
+ Use a new-style format string (as used by `str.format`) to format the tick.
+
+ The field used for the tick value must be labeled *x* and the field used
+ for the tick position must be labeled *pos*.
+
+ The formatter will respect :rc:`axes.unicode_minus` when formatting
+ negative numeric values.
+
+ It is typically unnecessary to explicitly construct `.StrMethodFormatter`
+ objects, as `~.Axis.set_major_formatter` directly accepts the format string
+ itself.
+ """
+
+ def __init__(self, fmt):
+ self.fmt = fmt
+
+ def __call__(self, x, pos=None):
+ """
+ Return the formatted label string.
+
+ *x* and *pos* are passed to `str.format` as keyword arguments
+ with those exact names.
+ """
+ return _UnicodeMinusFormat().format(self.fmt, x=x, pos=pos)
+
+
+class ScalarFormatter(Formatter):
+ """
+ Format tick values as a number.
+
+ Parameters
+ ----------
+ useOffset : bool or float, default: :rc:`axes.formatter.useoffset`
+ Whether to use offset notation. See `.set_useOffset`.
+ useMathText : bool, default: :rc:`axes.formatter.use_mathtext`
+ Whether to use fancy math formatting. See `.set_useMathText`.
+ useLocale : bool, default: :rc:`axes.formatter.use_locale`.
+ Whether to use locale settings for decimal sign and positive sign.
+ See `.set_useLocale`.
+ usetex : bool, default: :rc:`text.usetex`
+ To enable/disable the use of TeX's math mode for rendering the
+ numbers in the formatter.
+
+ .. versionadded:: 3.10
+
+ Notes
+ -----
+ In addition to the parameters above, the formatting of scientific vs.
+ floating point representation can be configured via `.set_scientific`
+ and `.set_powerlimits`).
+
+ **Offset notation and scientific notation**
+
+ Offset notation and scientific notation look quite similar at first sight.
+ Both split some information from the formatted tick values and display it
+ at the end of the axis.
+
+ - The scientific notation splits up the order of magnitude, i.e. a
+ multiplicative scaling factor, e.g. ``1e6``.
+
+ - The offset notation separates an additive constant, e.g. ``+1e6``. The
+ offset notation label is always prefixed with a ``+`` or ``-`` sign
+ and is thus distinguishable from the order of magnitude label.
+
+ The following plot with x limits ``1_000_000`` to ``1_000_010`` illustrates
+ the different formatting. Note the labels at the right edge of the x axis.
+
+ .. plot::
+
+ lim = (1_000_000, 1_000_010)
+
+ fig, (ax1, ax2, ax3) = plt.subplots(3, 1, gridspec_kw={'hspace': 2})
+ ax1.set(title='offset notation', xlim=lim)
+ ax2.set(title='scientific notation', xlim=lim)
+ ax2.xaxis.get_major_formatter().set_useOffset(False)
+ ax3.set(title='floating-point notation', xlim=lim)
+ ax3.xaxis.get_major_formatter().set_useOffset(False)
+ ax3.xaxis.get_major_formatter().set_scientific(False)
+
+ """
+
+ def __init__(self, useOffset=None, useMathText=None, useLocale=None, *,
+ usetex=None):
+ if useOffset is None:
+ useOffset = mpl.rcParams['axes.formatter.useoffset']
+ self._offset_threshold = \
+ mpl.rcParams['axes.formatter.offset_threshold']
+ self.set_useOffset(useOffset)
+ self.set_usetex(usetex)
+ self.set_useMathText(useMathText)
+ self.orderOfMagnitude = 0
+ self.format = ''
+ self._scientific = True
+ self._powerlimits = mpl.rcParams['axes.formatter.limits']
+ self.set_useLocale(useLocale)
+
+ def get_usetex(self):
+ """Return whether TeX's math mode is enabled for rendering."""
+ return self._usetex
+
+ def set_usetex(self, val):
+ """Set whether to use TeX's math mode for rendering numbers in the formatter."""
+ self._usetex = mpl._val_or_rc(val, 'text.usetex')
+
+ usetex = property(fget=get_usetex, fset=set_usetex)
+
+ def get_useOffset(self):
+ """
+ Return whether automatic mode for offset notation is active.
+
+ This returns True if ``set_useOffset(True)``; it returns False if an
+ explicit offset was set, e.g. ``set_useOffset(1000)``.
+
+ See Also
+ --------
+ ScalarFormatter.set_useOffset
+ """
+ return self._useOffset
+
+ def set_useOffset(self, val):
+ """
+ Set whether to use offset notation.
+
+ When formatting a set numbers whose value is large compared to their
+ range, the formatter can separate an additive constant. This can
+ shorten the formatted numbers so that they are less likely to overlap
+ when drawn on an axis.
+
+ Parameters
+ ----------
+ val : bool or float
+ - If False, do not use offset notation.
+ - If True (=automatic mode), use offset notation if it can make
+ the residual numbers significantly shorter. The exact behavior
+ is controlled by :rc:`axes.formatter.offset_threshold`.
+ - If a number, force an offset of the given value.
+
+ Examples
+ --------
+ With active offset notation, the values
+
+ ``100_000, 100_002, 100_004, 100_006, 100_008``
+
+ will be formatted as ``0, 2, 4, 6, 8`` plus an offset ``+1e5``, which
+ is written to the edge of the axis.
+ """
+ if val in [True, False]:
+ self.offset = 0
+ self._useOffset = val
+ else:
+ self._useOffset = False
+ self.offset = val
+
+ useOffset = property(fget=get_useOffset, fset=set_useOffset)
+
+ def get_useLocale(self):
+ """
+ Return whether locale settings are used for formatting.
+
+ See Also
+ --------
+ ScalarFormatter.set_useLocale
+ """
+ return self._useLocale
+
+ def set_useLocale(self, val):
+ """
+ Set whether to use locale settings for decimal sign and positive sign.
+
+ Parameters
+ ----------
+ val : bool or None
+ *None* resets to :rc:`axes.formatter.use_locale`.
+ """
+ if val is None:
+ self._useLocale = mpl.rcParams['axes.formatter.use_locale']
+ else:
+ self._useLocale = val
+
+ useLocale = property(fget=get_useLocale, fset=set_useLocale)
+
+ def _format_maybe_minus_and_locale(self, fmt, arg):
+ """
+ Format *arg* with *fmt*, applying Unicode minus and locale if desired.
+ """
+ return self.fix_minus(
+ # Escape commas introduced by locale.format_string if using math text,
+ # but not those present from the beginning in fmt.
+ (",".join(locale.format_string(part, (arg,), True).replace(",", "{,}")
+ for part in fmt.split(",")) if self._useMathText
+ else locale.format_string(fmt, (arg,), True))
+ if self._useLocale
+ else fmt % arg)
+
+ def get_useMathText(self):
+ """
+ Return whether to use fancy math formatting.
+
+ See Also
+ --------
+ ScalarFormatter.set_useMathText
+ """
+ return self._useMathText
+
+ def set_useMathText(self, val):
+ r"""
+ Set whether to use fancy math formatting.
+
+ If active, scientific notation is formatted as :math:`1.2 \times 10^3`.
+
+ Parameters
+ ----------
+ val : bool or None
+ *None* resets to :rc:`axes.formatter.use_mathtext`.
+ """
+ if val is None:
+ self._useMathText = mpl.rcParams['axes.formatter.use_mathtext']
+ if self._useMathText is False:
+ try:
+ from matplotlib import font_manager
+ ufont = font_manager.findfont(
+ font_manager.FontProperties(
+ family=mpl.rcParams["font.family"]
+ ),
+ fallback_to_default=False,
+ )
+ except ValueError:
+ ufont = None
+
+ if ufont == str(cbook._get_data_path("fonts/ttf/cmr10.ttf")):
+ _api.warn_external(
+ "cmr10 font should ideally be used with "
+ "mathtext, set axes.formatter.use_mathtext to True"
+ )
+ else:
+ self._useMathText = val
+
+ useMathText = property(fget=get_useMathText, fset=set_useMathText)
+
+ def __call__(self, x, pos=None):
+ """
+ Return the format for tick value *x* at position *pos*.
+ """
+ if len(self.locs) == 0:
+ return ''
+ else:
+ xp = (x - self.offset) / (10. ** self.orderOfMagnitude)
+ if abs(xp) < 1e-8:
+ xp = 0
+ return self._format_maybe_minus_and_locale(self.format, xp)
+
+ def set_scientific(self, b):
+ """
+ Turn scientific notation on or off.
+
+ See Also
+ --------
+ ScalarFormatter.set_powerlimits
+ """
+ self._scientific = bool(b)
+
+ def set_powerlimits(self, lims):
+ r"""
+ Set size thresholds for scientific notation.
+
+ Parameters
+ ----------
+ lims : (int, int)
+ A tuple *(min_exp, max_exp)* containing the powers of 10 that
+ determine the switchover threshold. For a number representable as
+ :math:`a \times 10^\mathrm{exp}` with :math:`1 <= |a| < 10`,
+ scientific notation will be used if ``exp <= min_exp`` or
+ ``exp >= max_exp``.
+
+ The default limits are controlled by :rc:`axes.formatter.limits`.
+
+ In particular numbers with *exp* equal to the thresholds are
+ written in scientific notation.
+
+ Typically, *min_exp* will be negative and *max_exp* will be
+ positive.
+
+ For example, ``formatter.set_powerlimits((-3, 4))`` will provide
+ the following formatting:
+ :math:`1 \times 10^{-3}, 9.9 \times 10^{-3}, 0.01,`
+ :math:`9999, 1 \times 10^4`.
+
+ See Also
+ --------
+ ScalarFormatter.set_scientific
+ """
+ if len(lims) != 2:
+ raise ValueError("'lims' must be a sequence of length 2")
+ self._powerlimits = lims
+
+ def format_data_short(self, value):
+ # docstring inherited
+ if value is np.ma.masked:
+ return ""
+ if isinstance(value, Integral):
+ fmt = "%d"
+ else:
+ if getattr(self.axis, "__name__", "") in ["xaxis", "yaxis"]:
+ if self.axis.__name__ == "xaxis":
+ axis_trf = self.axis.axes.get_xaxis_transform()
+ axis_inv_trf = axis_trf.inverted()
+ screen_xy = axis_trf.transform((value, 0))
+ neighbor_values = axis_inv_trf.transform(
+ screen_xy + [[-1, 0], [+1, 0]])[:, 0]
+ else: # yaxis:
+ axis_trf = self.axis.axes.get_yaxis_transform()
+ axis_inv_trf = axis_trf.inverted()
+ screen_xy = axis_trf.transform((0, value))
+ neighbor_values = axis_inv_trf.transform(
+ screen_xy + [[0, -1], [0, +1]])[:, 1]
+ delta = abs(neighbor_values - value).max()
+ else:
+ # Rough approximation: no more than 1e4 divisions.
+ a, b = self.axis.get_view_interval()
+ delta = (b - a) / 1e4
+ fmt = f"%-#.{cbook._g_sig_digits(value, delta)}g"
+ return self._format_maybe_minus_and_locale(fmt, value)
+
+ def format_data(self, value):
+ # docstring inherited
+ e = math.floor(math.log10(abs(value)))
+ s = round(value / 10**e, 10)
+ significand = self._format_maybe_minus_and_locale(
+ "%d" if s % 1 == 0 else "%1.10g", s)
+ if e == 0:
+ return significand
+ exponent = self._format_maybe_minus_and_locale("%d", e)
+ if self._useMathText or self._usetex:
+ exponent = "10^{%s}" % exponent
+ return (exponent if s == 1 # reformat 1x10^y as 10^y
+ else rf"{significand} \times {exponent}")
+ else:
+ return f"{significand}e{exponent}"
+
+ def get_offset(self):
+ """
+ Return scientific notation, plus offset.
+ """
+ if len(self.locs) == 0:
+ return ''
+ if self.orderOfMagnitude or self.offset:
+ offsetStr = ''
+ sciNotStr = ''
+ if self.offset:
+ offsetStr = self.format_data(self.offset)
+ if self.offset > 0:
+ offsetStr = '+' + offsetStr
+ if self.orderOfMagnitude:
+ if self._usetex or self._useMathText:
+ sciNotStr = self.format_data(10 ** self.orderOfMagnitude)
+ else:
+ sciNotStr = '1e%d' % self.orderOfMagnitude
+ if self._useMathText or self._usetex:
+ if sciNotStr != '':
+ sciNotStr = r'\times\mathdefault{%s}' % sciNotStr
+ s = fr'${sciNotStr}\mathdefault{{{offsetStr}}}$'
+ else:
+ s = ''.join((sciNotStr, offsetStr))
+ return self.fix_minus(s)
+ return ''
+
+ def set_locs(self, locs):
+ # docstring inherited
+ self.locs = locs
+ if len(self.locs) > 0:
+ if self._useOffset:
+ self._compute_offset()
+ self._set_order_of_magnitude()
+ self._set_format()
+
+ def _compute_offset(self):
+ locs = self.locs
+ # Restrict to visible ticks.
+ vmin, vmax = sorted(self.axis.get_view_interval())
+ locs = np.asarray(locs)
+ locs = locs[(vmin <= locs) & (locs <= vmax)]
+ if not len(locs):
+ self.offset = 0
+ return
+ lmin, lmax = locs.min(), locs.max()
+ # Only use offset if there are at least two ticks and every tick has
+ # the same sign.
+ if lmin == lmax or lmin <= 0 <= lmax:
+ self.offset = 0
+ return
+ # min, max comparing absolute values (we want division to round towards
+ # zero so we work on absolute values).
+ abs_min, abs_max = sorted([abs(float(lmin)), abs(float(lmax))])
+ sign = math.copysign(1, lmin)
+ # What is the smallest power of ten such that abs_min and abs_max are
+ # equal up to that precision?
+ # Note: Internally using oom instead of 10 ** oom avoids some numerical
+ # accuracy issues.
+ oom_max = np.ceil(math.log10(abs_max))
+ oom = 1 + next(oom for oom in itertools.count(oom_max, -1)
+ if abs_min // 10 ** oom != abs_max // 10 ** oom)
+ if (abs_max - abs_min) / 10 ** oom <= 1e-2:
+ # Handle the case of straddling a multiple of a large power of ten
+ # (relative to the span).
+ # What is the smallest power of ten such that abs_min and abs_max
+ # are no more than 1 apart at that precision?
+ oom = 1 + next(oom for oom in itertools.count(oom_max, -1)
+ if abs_max // 10 ** oom - abs_min // 10 ** oom > 1)
+ # Only use offset if it saves at least _offset_threshold digits.
+ n = self._offset_threshold - 1
+ self.offset = (sign * (abs_max // 10 ** oom) * 10 ** oom
+ if abs_max // 10 ** oom >= 10**n
+ else 0)
+
+ def _set_order_of_magnitude(self):
+ # if scientific notation is to be used, find the appropriate exponent
+ # if using a numerical offset, find the exponent after applying the
+ # offset. When lower power limit = upper <> 0, use provided exponent.
+ if not self._scientific:
+ self.orderOfMagnitude = 0
+ return
+ if self._powerlimits[0] == self._powerlimits[1] != 0:
+ # fixed scaling when lower power limit = upper <> 0.
+ self.orderOfMagnitude = self._powerlimits[0]
+ return
+ # restrict to visible ticks
+ vmin, vmax = sorted(self.axis.get_view_interval())
+ locs = np.asarray(self.locs)
+ locs = locs[(vmin <= locs) & (locs <= vmax)]
+ locs = np.abs(locs)
+ if not len(locs):
+ self.orderOfMagnitude = 0
+ return
+ if self.offset:
+ oom = math.floor(math.log10(vmax - vmin))
+ else:
+ val = locs.max()
+ if val == 0:
+ oom = 0
+ else:
+ oom = math.floor(math.log10(val))
+ if oom <= self._powerlimits[0]:
+ self.orderOfMagnitude = oom
+ elif oom >= self._powerlimits[1]:
+ self.orderOfMagnitude = oom
+ else:
+ self.orderOfMagnitude = 0
+
+ def _set_format(self):
+ # set the format string to format all the ticklabels
+ if len(self.locs) < 2:
+ # Temporarily augment the locations with the axis end points.
+ _locs = [*self.locs, *self.axis.get_view_interval()]
+ else:
+ _locs = self.locs
+ locs = (np.asarray(_locs) - self.offset) / 10. ** self.orderOfMagnitude
+ loc_range = np.ptp(locs)
+ # Curvilinear coordinates can yield two identical points.
+ if loc_range == 0:
+ loc_range = np.max(np.abs(locs))
+ # Both points might be zero.
+ if loc_range == 0:
+ loc_range = 1
+ if len(self.locs) < 2:
+ # We needed the end points only for the loc_range calculation.
+ locs = locs[:-2]
+ loc_range_oom = int(math.floor(math.log10(loc_range)))
+ # first estimate:
+ sigfigs = max(0, 3 - loc_range_oom)
+ # refined estimate:
+ thresh = 1e-3 * 10 ** loc_range_oom
+ while sigfigs >= 0:
+ if np.abs(locs - np.round(locs, decimals=sigfigs)).max() < thresh:
+ sigfigs -= 1
+ else:
+ break
+ sigfigs += 1
+ self.format = f'%1.{sigfigs}f'
+ if self._usetex or self._useMathText:
+ self.format = r'$\mathdefault{%s}$' % self.format
+
+
+class LogFormatter(Formatter):
+ """
+ Base class for formatting ticks on a log or symlog scale.
+
+ It may be instantiated directly, or subclassed.
+
+ Parameters
+ ----------
+ base : float, default: 10.
+ Base of the logarithm used in all calculations.
+
+ labelOnlyBase : bool, default: False
+ If True, label ticks only at integer powers of base.
+ This is normally True for major ticks and False for
+ minor ticks.
+
+ minor_thresholds : (subset, all), default: (1, 0.4)
+ If labelOnlyBase is False, these two numbers control
+ the labeling of ticks that are not at integer powers of
+ base; normally these are the minor ticks. The controlling
+ parameter is the log of the axis data range. In the typical
+ case where base is 10 it is the number of decades spanned
+ by the axis, so we can call it 'numdec'. If ``numdec <= all``,
+ all minor ticks will be labeled. If ``all < numdec <= subset``,
+ then only a subset of minor ticks will be labeled, so as to
+ avoid crowding. If ``numdec > subset`` then no minor ticks will
+ be labeled.
+
+ linthresh : None or float, default: None
+ If a symmetric log scale is in use, its ``linthresh``
+ parameter must be supplied here.
+
+ Notes
+ -----
+ The `set_locs` method must be called to enable the subsetting
+ logic controlled by the ``minor_thresholds`` parameter.
+
+ In some cases such as the colorbar, there is no distinction between
+ major and minor ticks; the tick locations might be set manually,
+ or by a locator that puts ticks at integer powers of base and
+ at intermediate locations. For this situation, disable the
+ minor_thresholds logic by using ``minor_thresholds=(np.inf, np.inf)``,
+ so that all ticks will be labeled.
+
+ To disable labeling of minor ticks when 'labelOnlyBase' is False,
+ use ``minor_thresholds=(0, 0)``. This is the default for the
+ "classic" style.
+
+ Examples
+ --------
+ To label a subset of minor ticks when the view limits span up
+ to 2 decades, and all of the ticks when zoomed in to 0.5 decades
+ or less, use ``minor_thresholds=(2, 0.5)``.
+
+ To label all minor ticks when the view limits span up to 1.5
+ decades, use ``minor_thresholds=(1.5, 1.5)``.
+ """
+
+ def __init__(self, base=10.0, labelOnlyBase=False,
+ minor_thresholds=None,
+ linthresh=None):
+
+ self.set_base(base)
+ self.set_label_minor(labelOnlyBase)
+ if minor_thresholds is None:
+ if mpl.rcParams['_internal.classic_mode']:
+ minor_thresholds = (0, 0)
+ else:
+ minor_thresholds = (1, 0.4)
+ self.minor_thresholds = minor_thresholds
+ self._sublabels = None
+ self._linthresh = linthresh
+
+ def set_base(self, base):
+ """
+ Change the *base* for labeling.
+
+ .. warning::
+ Should always match the base used for :class:`LogLocator`
+ """
+ self._base = float(base)
+
+ def set_label_minor(self, labelOnlyBase):
+ """
+ Switch minor tick labeling on or off.
+
+ Parameters
+ ----------
+ labelOnlyBase : bool
+ If True, label ticks only at integer powers of base.
+ """
+ self.labelOnlyBase = labelOnlyBase
+
+ def set_locs(self, locs=None):
+ """
+ Use axis view limits to control which ticks are labeled.
+
+ The *locs* parameter is ignored in the present algorithm.
+ """
+ if np.isinf(self.minor_thresholds[0]):
+ self._sublabels = None
+ return
+
+ # Handle symlog case:
+ linthresh = self._linthresh
+ if linthresh is None:
+ try:
+ linthresh = self.axis.get_transform().linthresh
+ except AttributeError:
+ pass
+
+ vmin, vmax = self.axis.get_view_interval()
+ if vmin > vmax:
+ vmin, vmax = vmax, vmin
+
+ if linthresh is None and vmin <= 0:
+ # It's probably a colorbar with
+ # a format kwarg setting a LogFormatter in the manner
+ # that worked with 1.5.x, but that doesn't work now.
+ self._sublabels = {1} # label powers of base
+ return
+
+ b = self._base
+ if linthresh is not None: # symlog
+ # Only compute the number of decades in the logarithmic part of the
+ # axis
+ numdec = 0
+ if vmin < -linthresh:
+ rhs = min(vmax, -linthresh)
+ numdec += math.log(vmin / rhs) / math.log(b)
+ if vmax > linthresh:
+ lhs = max(vmin, linthresh)
+ numdec += math.log(vmax / lhs) / math.log(b)
+ else:
+ vmin = math.log(vmin) / math.log(b)
+ vmax = math.log(vmax) / math.log(b)
+ numdec = abs(vmax - vmin)
+
+ if numdec > self.minor_thresholds[0]:
+ # Label only bases
+ self._sublabels = {1}
+ elif numdec > self.minor_thresholds[1]:
+ # Add labels between bases at log-spaced coefficients;
+ # include base powers in case the locations include
+ # "major" and "minor" points, as in colorbar.
+ c = np.geomspace(1, b, int(b)//2 + 1)
+ self._sublabels = set(np.round(c))
+ # For base 10, this yields (1, 2, 3, 4, 6, 10).
+ else:
+ # Label all integer multiples of base**n.
+ self._sublabels = set(np.arange(1, b + 1))
+
+ def _num_to_string(self, x, vmin, vmax):
+ return self._pprint_val(x, vmax - vmin) if 1 <= x <= 10000 else f"{x:1.0e}"
+
+ def __call__(self, x, pos=None):
+ # docstring inherited
+ if x == 0.0: # Symlog
+ return '0'
+
+ x = abs(x)
+ b = self._base
+ # only label the decades
+ fx = math.log(x) / math.log(b)
+ is_x_decade = _is_close_to_int(fx)
+ exponent = round(fx) if is_x_decade else np.floor(fx)
+ coeff = round(b ** (fx - exponent))
+
+ if self.labelOnlyBase and not is_x_decade:
+ return ''
+ if self._sublabels is not None and coeff not in self._sublabels:
+ return ''
+
+ vmin, vmax = self.axis.get_view_interval()
+ vmin, vmax = mtransforms.nonsingular(vmin, vmax, expander=0.05)
+ s = self._num_to_string(x, vmin, vmax)
+ return self.fix_minus(s)
+
+ def format_data(self, value):
+ with cbook._setattr_cm(self, labelOnlyBase=False):
+ return cbook.strip_math(self.__call__(value))
+
+ def format_data_short(self, value):
+ # docstring inherited
+ return ('%-12g' % value).rstrip()
+
+ def _pprint_val(self, x, d):
+ # If the number is not too big and it's an int, format it as an int.
+ if abs(x) < 1e4 and x == int(x):
+ return '%d' % x
+ fmt = ('%1.3e' if d < 1e-2 else
+ '%1.3f' if d <= 1 else
+ '%1.2f' if d <= 10 else
+ '%1.1f' if d <= 1e5 else
+ '%1.1e')
+ s = fmt % x
+ tup = s.split('e')
+ if len(tup) == 2:
+ mantissa = tup[0].rstrip('0').rstrip('.')
+ exponent = int(tup[1])
+ if exponent:
+ s = '%se%d' % (mantissa, exponent)
+ else:
+ s = mantissa
+ else:
+ s = s.rstrip('0').rstrip('.')
+ return s
+
+
+class LogFormatterExponent(LogFormatter):
+ """
+ Format values for log axis using ``exponent = log_base(value)``.
+ """
+
+ def _num_to_string(self, x, vmin, vmax):
+ fx = math.log(x) / math.log(self._base)
+ if 1 <= abs(fx) <= 10000:
+ fd = math.log(vmax - vmin) / math.log(self._base)
+ s = self._pprint_val(fx, fd)
+ else:
+ s = f"{fx:1.0g}"
+ return s
+
+
+class LogFormatterMathtext(LogFormatter):
+ """
+ Format values for log axis using ``exponent = log_base(value)``.
+ """
+
+ def _non_decade_format(self, sign_string, base, fx, usetex):
+ """Return string for non-decade locations."""
+ return r'$\mathdefault{%s%s^{%.2f}}$' % (sign_string, base, fx)
+
+ def __call__(self, x, pos=None):
+ # docstring inherited
+ if x == 0: # Symlog
+ return r'$\mathdefault{0}$'
+
+ sign_string = '-' if x < 0 else ''
+ x = abs(x)
+ b = self._base
+
+ # only label the decades
+ fx = math.log(x) / math.log(b)
+ is_x_decade = _is_close_to_int(fx)
+ exponent = round(fx) if is_x_decade else np.floor(fx)
+ coeff = round(b ** (fx - exponent))
+
+ if self.labelOnlyBase and not is_x_decade:
+ return ''
+ if self._sublabels is not None and coeff not in self._sublabels:
+ return ''
+
+ if is_x_decade:
+ fx = round(fx)
+
+ # use string formatting of the base if it is not an integer
+ if b % 1 == 0.0:
+ base = '%d' % b
+ else:
+ base = '%s' % b
+
+ if abs(fx) < mpl.rcParams['axes.formatter.min_exponent']:
+ return r'$\mathdefault{%s%g}$' % (sign_string, x)
+ elif not is_x_decade:
+ usetex = mpl.rcParams['text.usetex']
+ return self._non_decade_format(sign_string, base, fx, usetex)
+ else:
+ return r'$\mathdefault{%s%s^{%d}}$' % (sign_string, base, fx)
+
+
+class LogFormatterSciNotation(LogFormatterMathtext):
+ """
+ Format values following scientific notation in a logarithmic axis.
+ """
+
+ def _non_decade_format(self, sign_string, base, fx, usetex):
+ """Return string for non-decade locations."""
+ b = float(base)
+ exponent = math.floor(fx)
+ coeff = b ** (fx - exponent)
+ if _is_close_to_int(coeff):
+ coeff = round(coeff)
+ return r'$\mathdefault{%s%g\times%s^{%d}}$' \
+ % (sign_string, coeff, base, exponent)
+
+
+class LogitFormatter(Formatter):
+ """
+ Probability formatter (using Math text).
+ """
+
+ def __init__(
+ self,
+ *,
+ use_overline=False,
+ one_half=r"\frac{1}{2}",
+ minor=False,
+ minor_threshold=25,
+ minor_number=6,
+ ):
+ r"""
+ Parameters
+ ----------
+ use_overline : bool, default: False
+ If x > 1/2, with x = 1 - v, indicate if x should be displayed as
+ $\overline{v}$. The default is to display $1 - v$.
+
+ one_half : str, default: r"\\frac{1}{2}"
+ The string used to represent 1/2.
+
+ minor : bool, default: False
+ Indicate if the formatter is formatting minor ticks or not.
+ Basically minor ticks are not labelled, except when only few ticks
+ are provided, ticks with most space with neighbor ticks are
+ labelled. See other parameters to change the default behavior.
+
+ minor_threshold : int, default: 25
+ Maximum number of locs for labelling some minor ticks. This
+ parameter have no effect if minor is False.
+
+ minor_number : int, default: 6
+ Number of ticks which are labelled when the number of ticks is
+ below the threshold.
+ """
+ self._use_overline = use_overline
+ self._one_half = one_half
+ self._minor = minor
+ self._labelled = set()
+ self._minor_threshold = minor_threshold
+ self._minor_number = minor_number
+
+ def use_overline(self, use_overline):
+ r"""
+ Switch display mode with overline for labelling p>1/2.
+
+ Parameters
+ ----------
+ use_overline : bool
+ If x > 1/2, with x = 1 - v, indicate if x should be displayed as
+ $\overline{v}$. The default is to display $1 - v$.
+ """
+ self._use_overline = use_overline
+
+ def set_one_half(self, one_half):
+ r"""
+ Set the way one half is displayed.
+
+ one_half : str
+ The string used to represent 1/2.
+ """
+ self._one_half = one_half
+
+ def set_minor_threshold(self, minor_threshold):
+ """
+ Set the threshold for labelling minors ticks.
+
+ Parameters
+ ----------
+ minor_threshold : int
+ Maximum number of locations for labelling some minor ticks. This
+ parameter have no effect if minor is False.
+ """
+ self._minor_threshold = minor_threshold
+
+ def set_minor_number(self, minor_number):
+ """
+ Set the number of minor ticks to label when some minor ticks are
+ labelled.
+
+ Parameters
+ ----------
+ minor_number : int
+ Number of ticks which are labelled when the number of ticks is
+ below the threshold.
+ """
+ self._minor_number = minor_number
+
+ def set_locs(self, locs):
+ self.locs = np.array(locs)
+ self._labelled.clear()
+
+ if not self._minor:
+ return None
+ if all(
+ _is_decade(x, rtol=1e-7)
+ or _is_decade(1 - x, rtol=1e-7)
+ or (_is_close_to_int(2 * x) and
+ int(np.round(2 * x)) == 1)
+ for x in locs
+ ):
+ # minor ticks are subsample from ideal, so no label
+ return None
+ if len(locs) < self._minor_threshold:
+ if len(locs) < self._minor_number:
+ self._labelled.update(locs)
+ else:
+ # we do not have a lot of minor ticks, so only few decades are
+ # displayed, then we choose some (spaced) minor ticks to label.
+ # Only minor ticks are known, we assume it is sufficient to
+ # choice which ticks are displayed.
+ # For each ticks we compute the distance between the ticks and
+ # the previous, and between the ticks and the next one. Ticks
+ # with smallest minimum are chosen. As tiebreak, the ticks
+ # with smallest sum is chosen.
+ diff = np.diff(-np.log(1 / self.locs - 1))
+ space_pessimistic = np.minimum(
+ np.concatenate(((np.inf,), diff)),
+ np.concatenate((diff, (np.inf,))),
+ )
+ space_sum = (
+ np.concatenate(((0,), diff))
+ + np.concatenate((diff, (0,)))
+ )
+ good_minor = sorted(
+ range(len(self.locs)),
+ key=lambda i: (space_pessimistic[i], space_sum[i]),
+ )[-self._minor_number:]
+ self._labelled.update(locs[i] for i in good_minor)
+
+ def _format_value(self, x, locs, sci_notation=True):
+ if sci_notation:
+ exponent = math.floor(np.log10(x))
+ min_precision = 0
+ else:
+ exponent = 0
+ min_precision = 1
+ value = x * 10 ** (-exponent)
+ if len(locs) < 2:
+ precision = min_precision
+ else:
+ diff = np.sort(np.abs(locs - x))[1]
+ precision = -np.log10(diff) + exponent
+ precision = (
+ int(np.round(precision))
+ if _is_close_to_int(precision)
+ else math.ceil(precision)
+ )
+ if precision < min_precision:
+ precision = min_precision
+ mantissa = r"%.*f" % (precision, value)
+ if not sci_notation:
+ return mantissa
+ s = r"%s\cdot10^{%d}" % (mantissa, exponent)
+ return s
+
+ def _one_minus(self, s):
+ if self._use_overline:
+ return r"\overline{%s}" % s
+ else:
+ return f"1-{s}"
+
+ def __call__(self, x, pos=None):
+ if self._minor and x not in self._labelled:
+ return ""
+ if x <= 0 or x >= 1:
+ return ""
+ if _is_close_to_int(2 * x) and round(2 * x) == 1:
+ s = self._one_half
+ elif x < 0.5 and _is_decade(x, rtol=1e-7):
+ exponent = round(math.log10(x))
+ s = "10^{%d}" % exponent
+ elif x > 0.5 and _is_decade(1 - x, rtol=1e-7):
+ exponent = round(math.log10(1 - x))
+ s = self._one_minus("10^{%d}" % exponent)
+ elif x < 0.1:
+ s = self._format_value(x, self.locs)
+ elif x > 0.9:
+ s = self._one_minus(self._format_value(1-x, 1-self.locs))
+ else:
+ s = self._format_value(x, self.locs, sci_notation=False)
+ return r"$\mathdefault{%s}$" % s
+
+ def format_data_short(self, value):
+ # docstring inherited
+ # Thresholds chosen to use scientific notation iff exponent <= -2.
+ if value < 0.1:
+ return f"{value:e}"
+ if value < 0.9:
+ return f"{value:f}"
+ return f"1-{1 - value:e}"
+
+
+class EngFormatter(ScalarFormatter):
+ """
+ Format axis values using engineering prefixes to represent powers
+ of 1000, plus a specified unit, e.g., 10 MHz instead of 1e7.
+ """
+
+ # The SI engineering prefixes
+ ENG_PREFIXES = {
+ -30: "q",
+ -27: "r",
+ -24: "y",
+ -21: "z",
+ -18: "a",
+ -15: "f",
+ -12: "p",
+ -9: "n",
+ -6: "\N{MICRO SIGN}",
+ -3: "m",
+ 0: "",
+ 3: "k",
+ 6: "M",
+ 9: "G",
+ 12: "T",
+ 15: "P",
+ 18: "E",
+ 21: "Z",
+ 24: "Y",
+ 27: "R",
+ 30: "Q"
+ }
+
+ def __init__(self, unit="", places=None, sep=" ", *, usetex=None,
+ useMathText=None, useOffset=False):
+ r"""
+ Parameters
+ ----------
+ unit : str, default: ""
+ Unit symbol to use, suitable for use with single-letter
+ representations of powers of 1000. For example, 'Hz' or 'm'.
+
+ places : int, default: None
+ Precision with which to display the number, specified in
+ digits after the decimal point (there will be between one
+ and three digits before the decimal point). If it is None,
+ the formatting falls back to the floating point format '%g',
+ which displays up to 6 *significant* digits, i.e. the equivalent
+ value for *places* varies between 0 and 5 (inclusive).
+
+ sep : str, default: " "
+ Separator used between the value and the prefix/unit. For
+ example, one get '3.14 mV' if ``sep`` is " " (default) and
+ '3.14mV' if ``sep`` is "". Besides the default behavior, some
+ other useful options may be:
+
+ * ``sep=""`` to append directly the prefix/unit to the value;
+ * ``sep="\N{THIN SPACE}"`` (``U+2009``);
+ * ``sep="\N{NARROW NO-BREAK SPACE}"`` (``U+202F``);
+ * ``sep="\N{NO-BREAK SPACE}"`` (``U+00A0``).
+
+ usetex : bool, default: :rc:`text.usetex`
+ To enable/disable the use of TeX's math mode for rendering the
+ numbers in the formatter.
+
+ useMathText : bool, default: :rc:`axes.formatter.use_mathtext`
+ To enable/disable the use mathtext for rendering the numbers in
+ the formatter.
+ useOffset : bool or float, default: False
+ Whether to use offset notation with :math:`10^{3*N}` based prefixes.
+ This features allows showing an offset with standard SI order of
+ magnitude prefix near the axis. Offset is computed similarly to
+ how `ScalarFormatter` computes it internally, but here you are
+ guaranteed to get an offset which will make the tick labels exceed
+ 3 digits. See also `.set_useOffset`.
+
+ .. versionadded:: 3.10
+ """
+ self.unit = unit
+ self.places = places
+ self.sep = sep
+ super().__init__(
+ useOffset=useOffset,
+ useMathText=useMathText,
+ useLocale=False,
+ usetex=usetex,
+ )
+
+ def __call__(self, x, pos=None):
+ """
+ Return the format for tick value *x* at position *pos*.
+
+ If there is no currently offset in the data, it returns the best
+ engineering formatting that fits the given argument, independently.
+ """
+ if len(self.locs) == 0 or self.offset == 0:
+ return self.fix_minus(self.format_data(x))
+ else:
+ xp = (x - self.offset) / (10. ** self.orderOfMagnitude)
+ if abs(xp) < 1e-8:
+ xp = 0
+ return self._format_maybe_minus_and_locale(self.format, xp)
+
+ def set_locs(self, locs):
+ # docstring inherited
+ self.locs = locs
+ if len(self.locs) > 0:
+ vmin, vmax = sorted(self.axis.get_view_interval())
+ if self._useOffset:
+ self._compute_offset()
+ if self.offset != 0:
+ # We don't want to use the offset computed by
+ # self._compute_offset because it rounds the offset unaware
+ # of our engineering prefixes preference, and this can
+ # cause ticks with 4+ digits to appear. These ticks are
+ # slightly less readable, so if offset is justified
+ # (decided by self._compute_offset) we set it to better
+ # value:
+ self.offset = round((vmin + vmax)/2, 3)
+ # Use log1000 to use engineers' oom standards
+ self.orderOfMagnitude = math.floor(math.log(vmax - vmin, 1000))*3
+ self._set_format()
+
+ # Simplify a bit ScalarFormatter.get_offset: We always want to use
+ # self.format_data. Also we want to return a non-empty string only if there
+ # is an offset, no matter what is self.orderOfMagnitude. If there _is_ an
+ # offset, self.orderOfMagnitude is consulted. This behavior is verified
+ # in `test_ticker.py`.
+ def get_offset(self):
+ # docstring inherited
+ if len(self.locs) == 0:
+ return ''
+ if self.offset:
+ offsetStr = ''
+ if self.offset:
+ offsetStr = self.format_data(self.offset)
+ if self.offset > 0:
+ offsetStr = '+' + offsetStr
+ sciNotStr = self.format_data(10 ** self.orderOfMagnitude)
+ if self._useMathText or self._usetex:
+ if sciNotStr != '':
+ sciNotStr = r'\times%s' % sciNotStr
+ s = f'${sciNotStr}{offsetStr}$'
+ else:
+ s = sciNotStr + offsetStr
+ return self.fix_minus(s)
+ return ''
+
+ def format_eng(self, num):
+ """Alias to EngFormatter.format_data"""
+ return self.format_data(num)
+
+ def format_data(self, value):
+ """
+ Format a number in engineering notation, appending a letter
+ representing the power of 1000 of the original number.
+ Some examples:
+
+ >>> format_data(0) # for self.places = 0
+ '0'
+
+ >>> format_data(1000000) # for self.places = 1
+ '1.0 M'
+
+ >>> format_data(-1e-6) # for self.places = 2
+ '-1.00 \N{MICRO SIGN}'
+ """
+ sign = 1
+ fmt = "g" if self.places is None else f".{self.places:d}f"
+
+ if value < 0:
+ sign = -1
+ value = -value
+
+ if value != 0:
+ pow10 = int(math.floor(math.log10(value) / 3) * 3)
+ else:
+ pow10 = 0
+ # Force value to zero, to avoid inconsistencies like
+ # format_eng(-0) = "0" and format_eng(0.0) = "0"
+ # but format_eng(-0.0) = "-0.0"
+ value = 0.0
+
+ pow10 = np.clip(pow10, min(self.ENG_PREFIXES), max(self.ENG_PREFIXES))
+
+ mant = sign * value / (10.0 ** pow10)
+ # Taking care of the cases like 999.9..., which may be rounded to 1000
+ # instead of 1 k. Beware of the corner case of values that are beyond
+ # the range of SI prefixes (i.e. > 'Y').
+ if (abs(float(format(mant, fmt))) >= 1000
+ and pow10 < max(self.ENG_PREFIXES)):
+ mant /= 1000
+ pow10 += 3
+
+ unit_prefix = self.ENG_PREFIXES[int(pow10)]
+ if self.unit or unit_prefix:
+ suffix = f"{self.sep}{unit_prefix}{self.unit}"
+ else:
+ suffix = ""
+ if self._usetex or self._useMathText:
+ return f"${mant:{fmt}}${suffix}"
+ else:
+ return f"{mant:{fmt}}{suffix}"
+
+
+class PercentFormatter(Formatter):
+ """
+ Format numbers as a percentage.
+
+ Parameters
+ ----------
+ xmax : float
+ Determines how the number is converted into a percentage.
+ *xmax* is the data value that corresponds to 100%.
+ Percentages are computed as ``x / xmax * 100``. So if the data is
+ already scaled to be percentages, *xmax* will be 100. Another common
+ situation is where *xmax* is 1.0.
+
+ decimals : None or int
+ The number of decimal places to place after the point.
+ If *None* (the default), the number will be computed automatically.
+
+ symbol : str or None
+ A string that will be appended to the label. It may be
+ *None* or empty to indicate that no symbol should be used. LaTeX
+ special characters are escaped in *symbol* whenever latex mode is
+ enabled, unless *is_latex* is *True*.
+
+ is_latex : bool
+ If *False*, reserved LaTeX characters in *symbol* will be escaped.
+ """
+ def __init__(self, xmax=100, decimals=None, symbol='%', is_latex=False):
+ self.xmax = xmax + 0.0
+ self.decimals = decimals
+ self._symbol = symbol
+ self._is_latex = is_latex
+
+ def __call__(self, x, pos=None):
+ """Format the tick as a percentage with the appropriate scaling."""
+ ax_min, ax_max = self.axis.get_view_interval()
+ display_range = abs(ax_max - ax_min)
+ return self.fix_minus(self.format_pct(x, display_range))
+
+ def format_pct(self, x, display_range):
+ """
+ Format the number as a percentage number with the correct
+ number of decimals and adds the percent symbol, if any.
+
+ If ``self.decimals`` is `None`, the number of digits after the
+ decimal point is set based on the *display_range* of the axis
+ as follows:
+
+ ============= ======== =======================
+ display_range decimals sample
+ ============= ======== =======================
+ >50 0 ``x = 34.5`` => 35%
+ >5 1 ``x = 34.5`` => 34.5%
+ >0.5 2 ``x = 34.5`` => 34.50%
+ ... ... ...
+ ============= ======== =======================
+
+ This method will not be very good for tiny axis ranges or
+ extremely large ones. It assumes that the values on the chart
+ are percentages displayed on a reasonable scale.
+ """
+ x = self.convert_to_pct(x)
+ if self.decimals is None:
+ # conversion works because display_range is a difference
+ scaled_range = self.convert_to_pct(display_range)
+ if scaled_range <= 0:
+ decimals = 0
+ else:
+ # Luckily Python's built-in ceil rounds to +inf, not away from
+ # zero. This is very important since the equation for decimals
+ # starts out as `scaled_range > 0.5 * 10**(2 - decimals)`
+ # and ends up with `decimals > 2 - log10(2 * scaled_range)`.
+ decimals = math.ceil(2.0 - math.log10(2.0 * scaled_range))
+ if decimals > 5:
+ decimals = 5
+ elif decimals < 0:
+ decimals = 0
+ else:
+ decimals = self.decimals
+ s = f'{x:0.{int(decimals)}f}'
+
+ return s + self.symbol
+
+ def convert_to_pct(self, x):
+ return 100.0 * (x / self.xmax)
+
+ @property
+ def symbol(self):
+ r"""
+ The configured percent symbol as a string.
+
+ If LaTeX is enabled via :rc:`text.usetex`, the special characters
+ ``{'#', '$', '%', '&', '~', '_', '^', '\', '{', '}'}`` are
+ automatically escaped in the string.
+ """
+ symbol = self._symbol
+ if not symbol:
+ symbol = ''
+ elif not self._is_latex and mpl.rcParams['text.usetex']:
+ # Source: http://www.personal.ceu.hu/tex/specchar.htm
+ # Backslash must be first for this to work correctly since
+ # it keeps getting added in
+ for spec in r'\#$%&~_^{}':
+ symbol = symbol.replace(spec, '\\' + spec)
+ return symbol
+
+ @symbol.setter
+ def symbol(self, symbol):
+ self._symbol = symbol
+
+
+class Locator(TickHelper):
+ """
+ Determine tick locations.
+
+ Note that the same locator should not be used across multiple
+ `~matplotlib.axis.Axis` because the locator stores references to the Axis
+ data and view limits.
+ """
+
+ # Some automatic tick locators can generate so many ticks they
+ # kill the machine when you try and render them.
+ # This parameter is set to cause locators to raise an error if too
+ # many ticks are generated.
+ MAXTICKS = 1000
+
+ def tick_values(self, vmin, vmax):
+ """
+ Return the values of the located ticks given **vmin** and **vmax**.
+
+ .. note::
+ To get tick locations with the vmin and vmax values defined
+ automatically for the associated ``axis`` simply call
+ the Locator instance::
+
+ >>> print(type(loc))
+
+ >>> print(loc())
+ [1, 2, 3, 4]
+
+ """
+ raise NotImplementedError('Derived must override')
+
+ def set_params(self, **kwargs):
+ """
+ Do nothing, and raise a warning. Any locator class not supporting the
+ set_params() function will call this.
+ """
+ _api.warn_external(
+ "'set_params()' not defined for locator of type " +
+ str(type(self)))
+
+ def __call__(self):
+ """Return the locations of the ticks."""
+ # note: some locators return data limits, other return view limits,
+ # hence there is no *one* interface to call self.tick_values.
+ raise NotImplementedError('Derived must override')
+
+ def raise_if_exceeds(self, locs):
+ """
+ Log at WARNING level if *locs* is longer than `Locator.MAXTICKS`.
+
+ This is intended to be called immediately before returning *locs* from
+ ``__call__`` to inform users in case their Locator returns a huge
+ number of ticks, causing Matplotlib to run out of memory.
+
+ The "strange" name of this method dates back to when it would raise an
+ exception instead of emitting a log.
+ """
+ if len(locs) >= self.MAXTICKS:
+ _log.warning(
+ "Locator attempting to generate %s ticks ([%s, ..., %s]), "
+ "which exceeds Locator.MAXTICKS (%s).",
+ len(locs), locs[0], locs[-1], self.MAXTICKS)
+ return locs
+
+ def nonsingular(self, v0, v1):
+ """
+ Adjust a range as needed to avoid singularities.
+
+ This method gets called during autoscaling, with ``(v0, v1)`` set to
+ the data limits on the Axes if the Axes contains any data, or
+ ``(-inf, +inf)`` if not.
+
+ - If ``v0 == v1`` (possibly up to some floating point slop), this
+ method returns an expanded interval around this value.
+ - If ``(v0, v1) == (-inf, +inf)``, this method returns appropriate
+ default view limits.
+ - Otherwise, ``(v0, v1)`` is returned without modification.
+ """
+ return mtransforms.nonsingular(v0, v1, expander=.05)
+
+ def view_limits(self, vmin, vmax):
+ """
+ Select a scale for the range from vmin to vmax.
+
+ Subclasses should override this method to change locator behaviour.
+ """
+ return mtransforms.nonsingular(vmin, vmax)
+
+
+class IndexLocator(Locator):
+ """
+ Place ticks at every nth point plotted.
+
+ IndexLocator assumes index plotting; i.e., that the ticks are placed at integer
+ values in the range between 0 and len(data) inclusive.
+ """
+ def __init__(self, base, offset):
+ """Place ticks every *base* data point, starting at *offset*."""
+ self._base = base
+ self.offset = offset
+
+ def set_params(self, base=None, offset=None):
+ """Set parameters within this locator"""
+ if base is not None:
+ self._base = base
+ if offset is not None:
+ self.offset = offset
+
+ def __call__(self):
+ """Return the locations of the ticks"""
+ dmin, dmax = self.axis.get_data_interval()
+ return self.tick_values(dmin, dmax)
+
+ def tick_values(self, vmin, vmax):
+ return self.raise_if_exceeds(
+ np.arange(vmin + self.offset, vmax + 1, self._base))
+
+
+class FixedLocator(Locator):
+ r"""
+ Place ticks at a set of fixed values.
+
+ If *nbins* is None ticks are placed at all values. Otherwise, the *locs* array of
+ possible positions will be subsampled to keep the number of ticks
+ :math:`\leq nbins + 1`. The subsampling will be done to include the smallest
+ absolute value; for example, if zero is included in the array of possibilities, then
+ it will be included in the chosen ticks.
+ """
+
+ def __init__(self, locs, nbins=None):
+ self.locs = np.asarray(locs)
+ _api.check_shape((None,), locs=self.locs)
+ self.nbins = max(nbins, 2) if nbins is not None else None
+
+ def set_params(self, nbins=None):
+ """Set parameters within this locator."""
+ if nbins is not None:
+ self.nbins = nbins
+
+ def __call__(self):
+ return self.tick_values(None, None)
+
+ def tick_values(self, vmin, vmax):
+ """
+ Return the locations of the ticks.
+
+ .. note::
+
+ Because the values are fixed, vmin and vmax are not used in this
+ method.
+
+ """
+ if self.nbins is None:
+ return self.locs
+ step = max(int(np.ceil(len(self.locs) / self.nbins)), 1)
+ ticks = self.locs[::step]
+ for i in range(1, step):
+ ticks1 = self.locs[i::step]
+ if np.abs(ticks1).min() < np.abs(ticks).min():
+ ticks = ticks1
+ return self.raise_if_exceeds(ticks)
+
+
+class NullLocator(Locator):
+ """
+ No ticks
+ """
+
+ def __call__(self):
+ return self.tick_values(None, None)
+
+ def tick_values(self, vmin, vmax):
+ """
+ Return the locations of the ticks.
+
+ .. note::
+
+ Because the values are Null, vmin and vmax are not used in this
+ method.
+ """
+ return []
+
+
+class LinearLocator(Locator):
+ """
+ Place ticks at evenly spaced values.
+
+ The first time this function is called it will try to set the
+ number of ticks to make a nice tick partitioning. Thereafter, the
+ number of ticks will be fixed so that interactive navigation will
+ be nice
+
+ """
+ def __init__(self, numticks=None, presets=None):
+ """
+ Parameters
+ ----------
+ numticks : int or None, default None
+ Number of ticks. If None, *numticks* = 11.
+ presets : dict or None, default: None
+ Dictionary mapping ``(vmin, vmax)`` to an array of locations.
+ Overrides *numticks* if there is an entry for the current
+ ``(vmin, vmax)``.
+ """
+ self.numticks = numticks
+ if presets is None:
+ self.presets = {}
+ else:
+ self.presets = presets
+
+ @property
+ def numticks(self):
+ # Old hard-coded default.
+ return self._numticks if self._numticks is not None else 11
+
+ @numticks.setter
+ def numticks(self, numticks):
+ self._numticks = numticks
+
+ def set_params(self, numticks=None, presets=None):
+ """Set parameters within this locator."""
+ if presets is not None:
+ self.presets = presets
+ if numticks is not None:
+ self.numticks = numticks
+
+ def __call__(self):
+ """Return the locations of the ticks."""
+ vmin, vmax = self.axis.get_view_interval()
+ return self.tick_values(vmin, vmax)
+
+ def tick_values(self, vmin, vmax):
+ vmin, vmax = mtransforms.nonsingular(vmin, vmax, expander=0.05)
+
+ if (vmin, vmax) in self.presets:
+ return self.presets[(vmin, vmax)]
+
+ if self.numticks == 0:
+ return []
+ ticklocs = np.linspace(vmin, vmax, self.numticks)
+
+ return self.raise_if_exceeds(ticklocs)
+
+ def view_limits(self, vmin, vmax):
+ """Try to choose the view limits intelligently."""
+
+ if vmax < vmin:
+ vmin, vmax = vmax, vmin
+
+ if vmin == vmax:
+ vmin -= 1
+ vmax += 1
+
+ if mpl.rcParams['axes.autolimit_mode'] == 'round_numbers':
+ exponent, remainder = divmod(
+ math.log10(vmax - vmin), math.log10(max(self.numticks - 1, 1)))
+ exponent -= (remainder < .5)
+ scale = max(self.numticks - 1, 1) ** (-exponent)
+ vmin = math.floor(scale * vmin) / scale
+ vmax = math.ceil(scale * vmax) / scale
+
+ return mtransforms.nonsingular(vmin, vmax)
+
+
+class MultipleLocator(Locator):
+ """
+ Place ticks at every integer multiple of a base plus an offset.
+ """
+
+ def __init__(self, base=1.0, offset=0.0):
+ """
+ Parameters
+ ----------
+ base : float > 0, default: 1.0
+ Interval between ticks.
+ offset : float, default: 0.0
+ Value added to each multiple of *base*.
+
+ .. versionadded:: 3.8
+ """
+ self._edge = _Edge_integer(base, 0)
+ self._offset = offset
+
+ def set_params(self, base=None, offset=None):
+ """
+ Set parameters within this locator.
+
+ Parameters
+ ----------
+ base : float > 0, optional
+ Interval between ticks.
+ offset : float, optional
+ Value added to each multiple of *base*.
+
+ .. versionadded:: 3.8
+ """
+ if base is not None:
+ self._edge = _Edge_integer(base, 0)
+ if offset is not None:
+ self._offset = offset
+
+ def __call__(self):
+ """Return the locations of the ticks."""
+ vmin, vmax = self.axis.get_view_interval()
+ return self.tick_values(vmin, vmax)
+
+ def tick_values(self, vmin, vmax):
+ if vmax < vmin:
+ vmin, vmax = vmax, vmin
+ step = self._edge.step
+ vmin -= self._offset
+ vmax -= self._offset
+ vmin = self._edge.ge(vmin) * step
+ n = (vmax - vmin + 0.001 * step) // step
+ locs = vmin - step + np.arange(n + 3) * step + self._offset
+ return self.raise_if_exceeds(locs)
+
+ def view_limits(self, dmin, dmax):
+ """
+ Set the view limits to the nearest tick values that contain the data.
+ """
+ if mpl.rcParams['axes.autolimit_mode'] == 'round_numbers':
+ vmin = self._edge.le(dmin - self._offset) * self._edge.step + self._offset
+ vmax = self._edge.ge(dmax - self._offset) * self._edge.step + self._offset
+ if vmin == vmax:
+ vmin -= 1
+ vmax += 1
+ else:
+ vmin = dmin
+ vmax = dmax
+
+ return mtransforms.nonsingular(vmin, vmax)
+
+
+def scale_range(vmin, vmax, n=1, threshold=100):
+ dv = abs(vmax - vmin) # > 0 as nonsingular is called before.
+ meanv = (vmax + vmin) / 2
+ if abs(meanv) / dv < threshold:
+ offset = 0
+ else:
+ offset = math.copysign(10 ** (math.log10(abs(meanv)) // 1), meanv)
+ scale = 10 ** (math.log10(dv / n) // 1)
+ return scale, offset
+
+
+class _Edge_integer:
+ """
+ Helper for `.MaxNLocator`, `.MultipleLocator`, etc.
+
+ Take floating-point precision limitations into account when calculating
+ tick locations as integer multiples of a step.
+ """
+ def __init__(self, step, offset):
+ """
+ Parameters
+ ----------
+ step : float > 0
+ Interval between ticks.
+ offset : float
+ Offset subtracted from the data limits prior to calculating tick
+ locations.
+ """
+ if step <= 0:
+ raise ValueError("'step' must be positive")
+ self.step = step
+ self._offset = abs(offset)
+
+ def closeto(self, ms, edge):
+ # Allow more slop when the offset is large compared to the step.
+ if self._offset > 0:
+ digits = np.log10(self._offset / self.step)
+ tol = max(1e-10, 10 ** (digits - 12))
+ tol = min(0.4999, tol)
+ else:
+ tol = 1e-10
+ return abs(ms - edge) < tol
+
+ def le(self, x):
+ """Return the largest n: n*step <= x."""
+ d, m = divmod(x, self.step)
+ if self.closeto(m / self.step, 1):
+ return d + 1
+ return d
+
+ def ge(self, x):
+ """Return the smallest n: n*step >= x."""
+ d, m = divmod(x, self.step)
+ if self.closeto(m / self.step, 0):
+ return d
+ return d + 1
+
+
+class MaxNLocator(Locator):
+ """
+ Place evenly spaced ticks, with a cap on the total number of ticks.
+
+ Finds nice tick locations with no more than :math:`nbins + 1` ticks being within the
+ view limits. Locations beyond the limits are added to support autoscaling.
+ """
+ default_params = dict(nbins=10,
+ steps=None,
+ integer=False,
+ symmetric=False,
+ prune=None,
+ min_n_ticks=2)
+
+ def __init__(self, nbins=None, **kwargs):
+ """
+ Parameters
+ ----------
+ nbins : int or 'auto', default: 10
+ Maximum number of intervals; one less than max number of
+ ticks. If the string 'auto', the number of bins will be
+ automatically determined based on the length of the axis.
+
+ steps : array-like, optional
+ Sequence of acceptable tick multiples, starting with 1 and
+ ending with 10. For example, if ``steps=[1, 2, 4, 5, 10]``,
+ ``20, 40, 60`` or ``0.4, 0.6, 0.8`` would be possible
+ sets of ticks because they are multiples of 2.
+ ``30, 60, 90`` would not be generated because 3 does not
+ appear in this example list of steps.
+
+ integer : bool, default: False
+ If True, ticks will take only integer values, provided at least
+ *min_n_ticks* integers are found within the view limits.
+
+ symmetric : bool, default: False
+ If True, autoscaling will result in a range symmetric about zero.
+
+ prune : {'lower', 'upper', 'both', None}, default: None
+ Remove the 'lower' tick, the 'upper' tick, or ticks on 'both' sides
+ *if they fall exactly on an axis' edge* (this typically occurs when
+ :rc:`axes.autolimit_mode` is 'round_numbers'). Removing such ticks
+ is mostly useful for stacked or ganged plots, where the upper tick
+ of an Axes overlaps with the lower tick of the axes above it.
+
+ min_n_ticks : int, default: 2
+ Relax *nbins* and *integer* constraints if necessary to obtain
+ this minimum number of ticks.
+ """
+ if nbins is not None:
+ kwargs['nbins'] = nbins
+ self.set_params(**{**self.default_params, **kwargs})
+
+ @staticmethod
+ def _validate_steps(steps):
+ if not np.iterable(steps):
+ raise ValueError('steps argument must be an increasing sequence '
+ 'of numbers between 1 and 10 inclusive')
+ steps = np.asarray(steps)
+ if np.any(np.diff(steps) <= 0) or steps[-1] > 10 or steps[0] < 1:
+ raise ValueError('steps argument must be an increasing sequence '
+ 'of numbers between 1 and 10 inclusive')
+ if steps[0] != 1:
+ steps = np.concatenate([[1], steps])
+ if steps[-1] != 10:
+ steps = np.concatenate([steps, [10]])
+ return steps
+
+ @staticmethod
+ def _staircase(steps):
+ # Make an extended staircase within which the needed step will be
+ # found. This is probably much larger than necessary.
+ return np.concatenate([0.1 * steps[:-1], steps, [10 * steps[1]]])
+
+ def set_params(self, **kwargs):
+ """
+ Set parameters for this locator.
+
+ Parameters
+ ----------
+ nbins : int or 'auto', optional
+ see `.MaxNLocator`
+ steps : array-like, optional
+ see `.MaxNLocator`
+ integer : bool, optional
+ see `.MaxNLocator`
+ symmetric : bool, optional
+ see `.MaxNLocator`
+ prune : {'lower', 'upper', 'both', None}, optional
+ see `.MaxNLocator`
+ min_n_ticks : int, optional
+ see `.MaxNLocator`
+ """
+ if 'nbins' in kwargs:
+ self._nbins = kwargs.pop('nbins')
+ if self._nbins != 'auto':
+ self._nbins = int(self._nbins)
+ if 'symmetric' in kwargs:
+ self._symmetric = kwargs.pop('symmetric')
+ if 'prune' in kwargs:
+ prune = kwargs.pop('prune')
+ _api.check_in_list(['upper', 'lower', 'both', None], prune=prune)
+ self._prune = prune
+ if 'min_n_ticks' in kwargs:
+ self._min_n_ticks = max(1, kwargs.pop('min_n_ticks'))
+ if 'steps' in kwargs:
+ steps = kwargs.pop('steps')
+ if steps is None:
+ self._steps = np.array([1, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10])
+ else:
+ self._steps = self._validate_steps(steps)
+ self._extended_steps = self._staircase(self._steps)
+ if 'integer' in kwargs:
+ self._integer = kwargs.pop('integer')
+ if kwargs:
+ raise _api.kwarg_error("set_params", kwargs)
+
+ def _raw_ticks(self, vmin, vmax):
+ """
+ Generate a list of tick locations including the range *vmin* to
+ *vmax*. In some applications, one or both of the end locations
+ will not be needed, in which case they are trimmed off
+ elsewhere.
+ """
+ if self._nbins == 'auto':
+ if self.axis is not None:
+ nbins = np.clip(self.axis.get_tick_space(),
+ max(1, self._min_n_ticks - 1), 9)
+ else:
+ nbins = 9
+ else:
+ nbins = self._nbins
+
+ scale, offset = scale_range(vmin, vmax, nbins)
+ _vmin = vmin - offset
+ _vmax = vmax - offset
+ steps = self._extended_steps * scale
+ if self._integer:
+ # For steps > 1, keep only integer values.
+ igood = (steps < 1) | (np.abs(steps - np.round(steps)) < 0.001)
+ steps = steps[igood]
+
+ raw_step = ((_vmax - _vmin) / nbins)
+ if hasattr(self.axis, "axes") and self.axis.axes.name == '3d':
+ # Due to the change in automargin behavior in mpl3.9, we need to
+ # adjust the raw step to match the mpl3.8 appearance. The zoom
+ # factor of 2/48, gives us the 23/24 modifier.
+ raw_step = raw_step * 23/24
+ large_steps = steps >= raw_step
+ if mpl.rcParams['axes.autolimit_mode'] == 'round_numbers':
+ # Classic round_numbers mode may require a larger step.
+ # Get first multiple of steps that are <= _vmin
+ floored_vmins = (_vmin // steps) * steps
+ floored_vmaxs = floored_vmins + steps * nbins
+ large_steps = large_steps & (floored_vmaxs >= _vmax)
+
+ # Find index of smallest large step
+ if any(large_steps):
+ istep = np.nonzero(large_steps)[0][0]
+ else:
+ istep = len(steps) - 1
+
+ # Start at smallest of the steps greater than the raw step, and check
+ # if it provides enough ticks. If not, work backwards through
+ # smaller steps until one is found that provides enough ticks.
+ for step in steps[:istep+1][::-1]:
+
+ if (self._integer and
+ np.floor(_vmax) - np.ceil(_vmin) >= self._min_n_ticks - 1):
+ step = max(1, step)
+ best_vmin = (_vmin // step) * step
+
+ # Find tick locations spanning the vmin-vmax range, taking into
+ # account degradation of precision when there is a large offset.
+ # The edge ticks beyond vmin and/or vmax are needed for the
+ # "round_numbers" autolimit mode.
+ edge = _Edge_integer(step, offset)
+ low = edge.le(_vmin - best_vmin)
+ high = edge.ge(_vmax - best_vmin)
+ ticks = np.arange(low, high + 1) * step + best_vmin
+ # Count only the ticks that will be displayed.
+ nticks = ((ticks <= _vmax) & (ticks >= _vmin)).sum()
+ if nticks >= self._min_n_ticks:
+ break
+ return ticks + offset
+
+ def __call__(self):
+ vmin, vmax = self.axis.get_view_interval()
+ return self.tick_values(vmin, vmax)
+
+ def tick_values(self, vmin, vmax):
+ if self._symmetric:
+ vmax = max(abs(vmin), abs(vmax))
+ vmin = -vmax
+ vmin, vmax = mtransforms.nonsingular(
+ vmin, vmax, expander=1e-13, tiny=1e-14)
+ locs = self._raw_ticks(vmin, vmax)
+
+ prune = self._prune
+ if prune == 'lower':
+ locs = locs[1:]
+ elif prune == 'upper':
+ locs = locs[:-1]
+ elif prune == 'both':
+ locs = locs[1:-1]
+ return self.raise_if_exceeds(locs)
+
+ def view_limits(self, dmin, dmax):
+ if self._symmetric:
+ dmax = max(abs(dmin), abs(dmax))
+ dmin = -dmax
+
+ dmin, dmax = mtransforms.nonsingular(
+ dmin, dmax, expander=1e-12, tiny=1e-13)
+
+ if mpl.rcParams['axes.autolimit_mode'] == 'round_numbers':
+ return self._raw_ticks(dmin, dmax)[[0, -1]]
+ else:
+ return dmin, dmax
+
+
+def _is_decade(x, *, base=10, rtol=None):
+ """Return True if *x* is an integer power of *base*."""
+ if not np.isfinite(x):
+ return False
+ if x == 0.0:
+ return True
+ lx = np.log(abs(x)) / np.log(base)
+ if rtol is None:
+ return np.isclose(lx, np.round(lx))
+ else:
+ return np.isclose(lx, np.round(lx), rtol=rtol)
+
+
+def _decade_less_equal(x, base):
+ """
+ Return the largest integer power of *base* that's less or equal to *x*.
+
+ If *x* is negative, the exponent will be *greater*.
+ """
+ return (x if x == 0 else
+ -_decade_greater_equal(-x, base) if x < 0 else
+ base ** np.floor(np.log(x) / np.log(base)))
+
+
+def _decade_greater_equal(x, base):
+ """
+ Return the smallest integer power of *base* that's greater or equal to *x*.
+
+ If *x* is negative, the exponent will be *smaller*.
+ """
+ return (x if x == 0 else
+ -_decade_less_equal(-x, base) if x < 0 else
+ base ** np.ceil(np.log(x) / np.log(base)))
+
+
+def _decade_less(x, base):
+ """
+ Return the largest integer power of *base* that's less than *x*.
+
+ If *x* is negative, the exponent will be *greater*.
+ """
+ if x < 0:
+ return -_decade_greater(-x, base)
+ less = _decade_less_equal(x, base)
+ if less == x:
+ less /= base
+ return less
+
+
+def _decade_greater(x, base):
+ """
+ Return the smallest integer power of *base* that's greater than *x*.
+
+ If *x* is negative, the exponent will be *smaller*.
+ """
+ if x < 0:
+ return -_decade_less(-x, base)
+ greater = _decade_greater_equal(x, base)
+ if greater == x:
+ greater *= base
+ return greater
+
+
+def _is_close_to_int(x):
+ return math.isclose(x, round(x))
+
+
+class LogLocator(Locator):
+ """
+ Place logarithmically spaced ticks.
+
+ Places ticks at the values ``subs[j] * base**i``.
+ """
+
+ def __init__(self, base=10.0, subs=(1.0,), *, numticks=None):
+ """
+ Parameters
+ ----------
+ base : float, default: 10.0
+ The base of the log used, so major ticks are placed at ``base**n``, where
+ ``n`` is an integer.
+ subs : None or {'auto', 'all'} or sequence of float, default: (1.0,)
+ Gives the multiples of integer powers of the base at which to place ticks.
+ The default of ``(1.0, )`` places ticks only at integer powers of the base.
+ Permitted string values are ``'auto'`` and ``'all'``. Both of these use an
+ algorithm based on the axis view limits to determine whether and how to put
+ ticks between integer powers of the base:
+ - ``'auto'``: Ticks are placed only between integer powers.
+ - ``'all'``: Ticks are placed between *and* at integer powers.
+ - ``None``: Equivalent to ``'auto'``.
+ numticks : None or int, default: None
+ The maximum number of ticks to allow on a given axis. The default of
+ ``None`` will try to choose intelligently as long as this Locator has
+ already been assigned to an axis using `~.axis.Axis.get_tick_space`, but
+ otherwise falls back to 9.
+ """
+ if numticks is None:
+ if mpl.rcParams['_internal.classic_mode']:
+ numticks = 15
+ else:
+ numticks = 'auto'
+ self._base = float(base)
+ self._set_subs(subs)
+ self.numticks = numticks
+
+ def set_params(self, base=None, subs=None, *, numticks=None):
+ """Set parameters within this locator."""
+ if base is not None:
+ self._base = float(base)
+ if subs is not None:
+ self._set_subs(subs)
+ if numticks is not None:
+ self.numticks = numticks
+
+ def _set_subs(self, subs):
+ """
+ Set the minor ticks for the log scaling every ``base**i*subs[j]``.
+ """
+ if subs is None: # consistency with previous bad API
+ self._subs = 'auto'
+ elif isinstance(subs, str):
+ _api.check_in_list(('all', 'auto'), subs=subs)
+ self._subs = subs
+ else:
+ try:
+ self._subs = np.asarray(subs, dtype=float)
+ except ValueError as e:
+ raise ValueError("subs must be None, 'all', 'auto' or "
+ "a sequence of floats, not "
+ f"{subs}.") from e
+ if self._subs.ndim != 1:
+ raise ValueError("A sequence passed to subs must be "
+ "1-dimensional, not "
+ f"{self._subs.ndim}-dimensional.")
+
+ def __call__(self):
+ """Return the locations of the ticks."""
+ vmin, vmax = self.axis.get_view_interval()
+ return self.tick_values(vmin, vmax)
+
+ def tick_values(self, vmin, vmax):
+ if self.numticks == 'auto':
+ if self.axis is not None:
+ numticks = np.clip(self.axis.get_tick_space(), 2, 9)
+ else:
+ numticks = 9
+ else:
+ numticks = self.numticks
+
+ b = self._base
+ if vmin <= 0.0:
+ if self.axis is not None:
+ vmin = self.axis.get_minpos()
+
+ if vmin <= 0.0 or not np.isfinite(vmin):
+ raise ValueError(
+ "Data has no positive values, and therefore cannot be log-scaled.")
+
+ _log.debug('vmin %s vmax %s', vmin, vmax)
+
+ if vmax < vmin:
+ vmin, vmax = vmax, vmin
+ log_vmin = math.log(vmin) / math.log(b)
+ log_vmax = math.log(vmax) / math.log(b)
+
+ numdec = math.floor(log_vmax) - math.ceil(log_vmin)
+
+ if isinstance(self._subs, str):
+ if numdec > 10 or b < 3:
+ if self._subs == 'auto':
+ return np.array([]) # no minor or major ticks
+ else:
+ subs = np.array([1.0]) # major ticks
+ else:
+ _first = 2.0 if self._subs == 'auto' else 1.0
+ subs = np.arange(_first, b)
+ else:
+ subs = self._subs
+
+ # Get decades between major ticks.
+ stride = (max(math.ceil(numdec / (numticks - 1)), 1)
+ if mpl.rcParams['_internal.classic_mode'] else
+ numdec // numticks + 1)
+
+ # if we have decided that the stride is as big or bigger than
+ # the range, clip the stride back to the available range - 1
+ # with a floor of 1. This prevents getting axis with only 1 tick
+ # visible.
+ if stride >= numdec:
+ stride = max(1, numdec - 1)
+
+ # Does subs include anything other than 1? Essentially a hack to know
+ # whether we're a major or a minor locator.
+ have_subs = len(subs) > 1 or (len(subs) == 1 and subs[0] != 1.0)
+
+ decades = np.arange(math.floor(log_vmin) - stride,
+ math.ceil(log_vmax) + 2 * stride, stride)
+
+ if have_subs:
+ if stride == 1:
+ ticklocs = np.concatenate(
+ [subs * decade_start for decade_start in b ** decades])
+ else:
+ ticklocs = np.array([])
+ else:
+ ticklocs = b ** decades
+
+ _log.debug('ticklocs %r', ticklocs)
+ if (len(subs) > 1
+ and stride == 1
+ and ((vmin <= ticklocs) & (ticklocs <= vmax)).sum() <= 1):
+ # If we're a minor locator *that expects at least two ticks per
+ # decade* and the major locator stride is 1 and there's no more
+ # than one minor tick, switch to AutoLocator.
+ return AutoLocator().tick_values(vmin, vmax)
+ else:
+ return self.raise_if_exceeds(ticklocs)
+
+ def view_limits(self, vmin, vmax):
+ """Try to choose the view limits intelligently."""
+ b = self._base
+
+ vmin, vmax = self.nonsingular(vmin, vmax)
+
+ if mpl.rcParams['axes.autolimit_mode'] == 'round_numbers':
+ vmin = _decade_less_equal(vmin, b)
+ vmax = _decade_greater_equal(vmax, b)
+
+ return vmin, vmax
+
+ def nonsingular(self, vmin, vmax):
+ if vmin > vmax:
+ vmin, vmax = vmax, vmin
+ if not np.isfinite(vmin) or not np.isfinite(vmax):
+ vmin, vmax = 1, 10 # Initial range, no data plotted yet.
+ elif vmax <= 0:
+ _api.warn_external(
+ "Data has no positive values, and therefore cannot be "
+ "log-scaled.")
+ vmin, vmax = 1, 10
+ else:
+ # Consider shared axises
+ minpos = min(axis.get_minpos() for axis in self.axis._get_shared_axis())
+ if not np.isfinite(minpos):
+ minpos = 1e-300 # This should never take effect.
+ if vmin <= 0:
+ vmin = minpos
+ if vmin == vmax:
+ vmin = _decade_less(vmin, self._base)
+ vmax = _decade_greater(vmax, self._base)
+ return vmin, vmax
+
+
+class SymmetricalLogLocator(Locator):
+ """
+ Place ticks spaced linearly near zero and spaced logarithmically beyond a threshold.
+ """
+
+ def __init__(self, transform=None, subs=None, linthresh=None, base=None):
+ """
+ Parameters
+ ----------
+ transform : `~.scale.SymmetricalLogTransform`, optional
+ If set, defines the *base* and *linthresh* of the symlog transform.
+ base, linthresh : float, optional
+ The *base* and *linthresh* of the symlog transform, as documented
+ for `.SymmetricalLogScale`. These parameters are only used if
+ *transform* is not set.
+ subs : sequence of float, default: [1]
+ The multiples of integer powers of the base where ticks are placed,
+ i.e., ticks are placed at
+ ``[sub * base**i for i in ... for sub in subs]``.
+
+ Notes
+ -----
+ Either *transform*, or both *base* and *linthresh*, must be given.
+ """
+ if transform is not None:
+ self._base = transform.base
+ self._linthresh = transform.linthresh
+ elif linthresh is not None and base is not None:
+ self._base = base
+ self._linthresh = linthresh
+ else:
+ raise ValueError("Either transform, or both linthresh "
+ "and base, must be provided.")
+ if subs is None:
+ self._subs = [1.0]
+ else:
+ self._subs = subs
+ self.numticks = 15
+
+ def set_params(self, subs=None, numticks=None):
+ """Set parameters within this locator."""
+ if numticks is not None:
+ self.numticks = numticks
+ if subs is not None:
+ self._subs = subs
+
+ def __call__(self):
+ """Return the locations of the ticks."""
+ # Note, these are untransformed coordinates
+ vmin, vmax = self.axis.get_view_interval()
+ return self.tick_values(vmin, vmax)
+
+ def tick_values(self, vmin, vmax):
+ linthresh = self._linthresh
+
+ if vmax < vmin:
+ vmin, vmax = vmax, vmin
+
+ # The domain is divided into three sections, only some of
+ # which may actually be present.
+ #
+ # <======== -t ==0== t ========>
+ # aaaaaaaaa bbbbb ccccccccc
+ #
+ # a) and c) will have ticks at integral log positions. The
+ # number of ticks needs to be reduced if there are more
+ # than self.numticks of them.
+ #
+ # b) has a tick at 0 and only 0 (we assume t is a small
+ # number, and the linear segment is just an implementation
+ # detail and not interesting.)
+ #
+ # We could also add ticks at t, but that seems to usually be
+ # uninteresting.
+ #
+ # "simple" mode is when the range falls entirely within [-t, t]
+ # -- it should just display (vmin, 0, vmax)
+ if -linthresh <= vmin < vmax <= linthresh:
+ # only the linear range is present
+ return sorted({vmin, 0, vmax})
+
+ # Lower log range is present
+ has_a = (vmin < -linthresh)
+ # Upper log range is present
+ has_c = (vmax > linthresh)
+
+ # Check if linear range is present
+ has_b = (has_a and vmax > -linthresh) or (has_c and vmin < linthresh)
+
+ base = self._base
+
+ def get_log_range(lo, hi):
+ lo = np.floor(np.log(lo) / np.log(base))
+ hi = np.ceil(np.log(hi) / np.log(base))
+ return lo, hi
+
+ # Calculate all the ranges, so we can determine striding
+ a_lo, a_hi = (0, 0)
+ if has_a:
+ a_upper_lim = min(-linthresh, vmax)
+ a_lo, a_hi = get_log_range(abs(a_upper_lim), abs(vmin) + 1)
+
+ c_lo, c_hi = (0, 0)
+ if has_c:
+ c_lower_lim = max(linthresh, vmin)
+ c_lo, c_hi = get_log_range(c_lower_lim, vmax + 1)
+
+ # Calculate the total number of integer exponents in a and c ranges
+ total_ticks = (a_hi - a_lo) + (c_hi - c_lo)
+ if has_b:
+ total_ticks += 1
+ stride = max(total_ticks // (self.numticks - 1), 1)
+
+ decades = []
+ if has_a:
+ decades.extend(-1 * (base ** (np.arange(a_lo, a_hi,
+ stride)[::-1])))
+
+ if has_b:
+ decades.append(0.0)
+
+ if has_c:
+ decades.extend(base ** (np.arange(c_lo, c_hi, stride)))
+
+ subs = np.asarray(self._subs)
+
+ if len(subs) > 1 or subs[0] != 1.0:
+ ticklocs = []
+ for decade in decades:
+ if decade == 0:
+ ticklocs.append(decade)
+ else:
+ ticklocs.extend(subs * decade)
+ else:
+ ticklocs = decades
+
+ return self.raise_if_exceeds(np.array(ticklocs))
+
+ def view_limits(self, vmin, vmax):
+ """Try to choose the view limits intelligently."""
+ b = self._base
+ if vmax < vmin:
+ vmin, vmax = vmax, vmin
+
+ if mpl.rcParams['axes.autolimit_mode'] == 'round_numbers':
+ vmin = _decade_less_equal(vmin, b)
+ vmax = _decade_greater_equal(vmax, b)
+ if vmin == vmax:
+ vmin = _decade_less(vmin, b)
+ vmax = _decade_greater(vmax, b)
+
+ return mtransforms.nonsingular(vmin, vmax)
+
+
+class AsinhLocator(Locator):
+ """
+ Place ticks spaced evenly on an inverse-sinh scale.
+
+ Generally used with the `~.scale.AsinhScale` class.
+
+ .. note::
+
+ This API is provisional and may be revised in the future
+ based on early user feedback.
+ """
+ def __init__(self, linear_width, numticks=11, symthresh=0.2,
+ base=10, subs=None):
+ """
+ Parameters
+ ----------
+ linear_width : float
+ The scale parameter defining the extent
+ of the quasi-linear region.
+ numticks : int, default: 11
+ The approximate number of major ticks that will fit
+ along the entire axis
+ symthresh : float, default: 0.2
+ The fractional threshold beneath which data which covers
+ a range that is approximately symmetric about zero
+ will have ticks that are exactly symmetric.
+ base : int, default: 10
+ The number base used for rounding tick locations
+ on a logarithmic scale. If this is less than one,
+ then rounding is to the nearest integer multiple
+ of powers of ten.
+ subs : tuple, default: None
+ Multiples of the number base, typically used
+ for the minor ticks, e.g. (2, 5) when base=10.
+ """
+ super().__init__()
+ self.linear_width = linear_width
+ self.numticks = numticks
+ self.symthresh = symthresh
+ self.base = base
+ self.subs = subs
+
+ def set_params(self, numticks=None, symthresh=None,
+ base=None, subs=None):
+ """Set parameters within this locator."""
+ if numticks is not None:
+ self.numticks = numticks
+ if symthresh is not None:
+ self.symthresh = symthresh
+ if base is not None:
+ self.base = base
+ if subs is not None:
+ self.subs = subs if len(subs) > 0 else None
+
+ def __call__(self):
+ vmin, vmax = self.axis.get_view_interval()
+ if (vmin * vmax) < 0 and abs(1 + vmax / vmin) < self.symthresh:
+ # Data-range appears to be almost symmetric, so round up:
+ bound = max(abs(vmin), abs(vmax))
+ return self.tick_values(-bound, bound)
+ else:
+ return self.tick_values(vmin, vmax)
+
+ def tick_values(self, vmin, vmax):
+ # Construct a set of uniformly-spaced "on-screen" locations.
+ ymin, ymax = self.linear_width * np.arcsinh(np.array([vmin, vmax])
+ / self.linear_width)
+ ys = np.linspace(ymin, ymax, self.numticks)
+ zero_dev = abs(ys / (ymax - ymin))
+ if ymin * ymax < 0:
+ # Ensure that the zero tick-mark is included, if the axis straddles zero.
+ ys = np.hstack([ys[(zero_dev > 0.5 / self.numticks)], 0.0])
+
+ # Transform the "on-screen" grid to the data space:
+ xs = self.linear_width * np.sinh(ys / self.linear_width)
+ zero_xs = (ys == 0)
+
+ # Round the data-space values to be intuitive base-n numbers, keeping track of
+ # positive and negative values separately and carefully treating the zero value.
+ with np.errstate(divide="ignore"): # base ** log(0) = base ** -inf = 0.
+ if self.base > 1:
+ pows = (np.sign(xs)
+ * self.base ** np.floor(np.log(abs(xs)) / math.log(self.base)))
+ qs = np.outer(pows, self.subs).flatten() if self.subs else pows
+ else: # No need to adjust sign(pows), as it cancels out when computing qs.
+ pows = np.where(zero_xs, 1, 10**np.floor(np.log10(abs(xs))))
+ qs = pows * np.round(xs / pows)
+ ticks = np.array(sorted(set(qs)))
+
+ return ticks if len(ticks) >= 2 else np.linspace(vmin, vmax, self.numticks)
+
+
+class LogitLocator(MaxNLocator):
+ """
+ Place ticks spaced evenly on a logit scale.
+ """
+
+ def __init__(self, minor=False, *, nbins="auto"):
+ """
+ Parameters
+ ----------
+ nbins : int or 'auto', optional
+ Number of ticks. Only used if minor is False.
+ minor : bool, default: False
+ Indicate if this locator is for minor ticks or not.
+ """
+
+ self._minor = minor
+ super().__init__(nbins=nbins, steps=[1, 2, 5, 10])
+
+ def set_params(self, minor=None, **kwargs):
+ """Set parameters within this locator."""
+ if minor is not None:
+ self._minor = minor
+ super().set_params(**kwargs)
+
+ @property
+ def minor(self):
+ return self._minor
+
+ @minor.setter
+ def minor(self, value):
+ self.set_params(minor=value)
+
+ def tick_values(self, vmin, vmax):
+ # dummy axis has no axes attribute
+ if hasattr(self.axis, "axes") and self.axis.axes.name == "polar":
+ raise NotImplementedError("Polar axis cannot be logit scaled yet")
+
+ if self._nbins == "auto":
+ if self.axis is not None:
+ nbins = self.axis.get_tick_space()
+ if nbins < 2:
+ nbins = 2
+ else:
+ nbins = 9
+ else:
+ nbins = self._nbins
+
+ # We define ideal ticks with their index:
+ # linscale: ... 1e-3 1e-2 1e-1 1/2 1-1e-1 1-1e-2 1-1e-3 ...
+ # b-scale : ... -3 -2 -1 0 1 2 3 ...
+ def ideal_ticks(x):
+ return 10 ** x if x < 0 else 1 - (10 ** (-x)) if x > 0 else 0.5
+
+ vmin, vmax = self.nonsingular(vmin, vmax)
+ binf = int(
+ np.floor(np.log10(vmin))
+ if vmin < 0.5
+ else 0
+ if vmin < 0.9
+ else -np.ceil(np.log10(1 - vmin))
+ )
+ bsup = int(
+ np.ceil(np.log10(vmax))
+ if vmax <= 0.5
+ else 1
+ if vmax <= 0.9
+ else -np.floor(np.log10(1 - vmax))
+ )
+ numideal = bsup - binf - 1
+ if numideal >= 2:
+ # have 2 or more wanted ideal ticks, so use them as major ticks
+ if numideal > nbins:
+ # to many ideal ticks, subsampling ideals for major ticks, and
+ # take others for minor ticks
+ subsampling_factor = math.ceil(numideal / nbins)
+ if self._minor:
+ ticklocs = [
+ ideal_ticks(b)
+ for b in range(binf, bsup + 1)
+ if (b % subsampling_factor) != 0
+ ]
+ else:
+ ticklocs = [
+ ideal_ticks(b)
+ for b in range(binf, bsup + 1)
+ if (b % subsampling_factor) == 0
+ ]
+ return self.raise_if_exceeds(np.array(ticklocs))
+ if self._minor:
+ ticklocs = []
+ for b in range(binf, bsup):
+ if b < -1:
+ ticklocs.extend(np.arange(2, 10) * 10 ** b)
+ elif b == -1:
+ ticklocs.extend(np.arange(2, 5) / 10)
+ elif b == 0:
+ ticklocs.extend(np.arange(6, 9) / 10)
+ else:
+ ticklocs.extend(
+ 1 - np.arange(2, 10)[::-1] * 10 ** (-b - 1)
+ )
+ return self.raise_if_exceeds(np.array(ticklocs))
+ ticklocs = [ideal_ticks(b) for b in range(binf, bsup + 1)]
+ return self.raise_if_exceeds(np.array(ticklocs))
+ # the scale is zoomed so same ticks as linear scale can be used
+ if self._minor:
+ return []
+ return super().tick_values(vmin, vmax)
+
+ def nonsingular(self, vmin, vmax):
+ standard_minpos = 1e-7
+ initial_range = (standard_minpos, 1 - standard_minpos)
+ if vmin > vmax:
+ vmin, vmax = vmax, vmin
+ if not np.isfinite(vmin) or not np.isfinite(vmax):
+ vmin, vmax = initial_range # Initial range, no data plotted yet.
+ elif vmax <= 0 or vmin >= 1:
+ # vmax <= 0 occurs when all values are negative
+ # vmin >= 1 occurs when all values are greater than one
+ _api.warn_external(
+ "Data has no values between 0 and 1, and therefore cannot be "
+ "logit-scaled."
+ )
+ vmin, vmax = initial_range
+ else:
+ minpos = (
+ self.axis.get_minpos()
+ if self.axis is not None
+ else standard_minpos
+ )
+ if not np.isfinite(minpos):
+ minpos = standard_minpos # This should never take effect.
+ if vmin <= 0:
+ vmin = minpos
+ # NOTE: for vmax, we should query a property similar to get_minpos,
+ # but related to the maximal, less-than-one data point.
+ # Unfortunately, Bbox._minpos is defined very deep in the BBox and
+ # updated with data, so for now we use 1 - minpos as a substitute.
+ if vmax >= 1:
+ vmax = 1 - minpos
+ if vmin == vmax:
+ vmin, vmax = 0.1 * vmin, 1 - 0.1 * vmin
+
+ return vmin, vmax
+
+
+class AutoLocator(MaxNLocator):
+ """
+ Place evenly spaced ticks, with the step size and maximum number of ticks chosen
+ automatically.
+
+ This is a subclass of `~matplotlib.ticker.MaxNLocator`, with parameters
+ *nbins = 'auto'* and *steps = [1, 2, 2.5, 5, 10]*.
+ """
+ def __init__(self):
+ """
+ To know the values of the non-public parameters, please have a
+ look to the defaults of `~matplotlib.ticker.MaxNLocator`.
+ """
+ if mpl.rcParams['_internal.classic_mode']:
+ nbins = 9
+ steps = [1, 2, 5, 10]
+ else:
+ nbins = 'auto'
+ steps = [1, 2, 2.5, 5, 10]
+ super().__init__(nbins=nbins, steps=steps)
+
+
+class AutoMinorLocator(Locator):
+ """
+ Place evenly spaced minor ticks, with the step size and maximum number of ticks
+ chosen automatically.
+
+ The Axis must use a linear scale and have evenly spaced major ticks.
+ """
+
+ def __init__(self, n=None):
+ """
+ Parameters
+ ----------
+ n : int or 'auto', default: :rc:`xtick.minor.ndivs` or :rc:`ytick.minor.ndivs`
+ The number of subdivisions of the interval between major ticks;
+ e.g., n=2 will place a single minor tick midway between major ticks.
+
+ If *n* is 'auto', it will be set to 4 or 5: if the distance
+ between the major ticks equals 1, 2.5, 5 or 10 it can be perfectly
+ divided in 5 equidistant sub-intervals with a length multiple of
+ 0.05; otherwise, it is divided in 4 sub-intervals.
+ """
+ self.ndivs = n
+
+ def __call__(self):
+ # docstring inherited
+ if self.axis.get_scale() == 'log':
+ _api.warn_external('AutoMinorLocator does not work on logarithmic scales')
+ return []
+
+ majorlocs = np.unique(self.axis.get_majorticklocs())
+ if len(majorlocs) < 2:
+ # Need at least two major ticks to find minor tick locations.
+ # TODO: Figure out a way to still be able to display minor ticks with less
+ # than two major ticks visible. For now, just display no ticks at all.
+ return []
+ majorstep = majorlocs[1] - majorlocs[0]
+
+ if self.ndivs is None:
+ self.ndivs = mpl.rcParams[
+ 'ytick.minor.ndivs' if self.axis.axis_name == 'y'
+ else 'xtick.minor.ndivs'] # for x and z axis
+
+ if self.ndivs == 'auto':
+ majorstep_mantissa = 10 ** (np.log10(majorstep) % 1)
+ ndivs = 5 if np.isclose(majorstep_mantissa, [1, 2.5, 5, 10]).any() else 4
+ else:
+ ndivs = self.ndivs
+
+ minorstep = majorstep / ndivs
+
+ vmin, vmax = sorted(self.axis.get_view_interval())
+ t0 = majorlocs[0]
+ tmin = round((vmin - t0) / minorstep)
+ tmax = round((vmax - t0) / minorstep) + 1
+ locs = (np.arange(tmin, tmax) * minorstep) + t0
+
+ return self.raise_if_exceeds(locs)
+
+ def tick_values(self, vmin, vmax):
+ raise NotImplementedError(
+ f"Cannot get tick locations for a {type(self).__name__}")
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ticker.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ticker.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..bed288658909860008a3b9055ad63cfc4614dd5d
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/ticker.pyi
@@ -0,0 +1,308 @@
+from collections.abc import Callable, Sequence
+from typing import Any, Literal
+
+from matplotlib.axis import Axis
+from matplotlib.transforms import Transform
+from matplotlib.projections.polar import _AxisWrapper
+
+import numpy as np
+
+class _DummyAxis:
+ __name__: str
+ def __init__(self, minpos: float = ...) -> None: ...
+ def get_view_interval(self) -> tuple[float, float]: ...
+ def set_view_interval(self, vmin: float, vmax: float) -> None: ...
+ def get_minpos(self) -> float: ...
+ def get_data_interval(self) -> tuple[float, float]: ...
+ def set_data_interval(self, vmin: float, vmax: float) -> None: ...
+ def get_tick_space(self) -> int: ...
+
+class TickHelper:
+ axis: None | Axis | _DummyAxis | _AxisWrapper
+ def set_axis(self, axis: Axis | _DummyAxis | _AxisWrapper | None) -> None: ...
+ def create_dummy_axis(self, **kwargs) -> None: ...
+
+class Formatter(TickHelper):
+ locs: list[float]
+ def __call__(self, x: float, pos: int | None = ...) -> str: ...
+ def format_ticks(self, values: list[float]) -> list[str]: ...
+ def format_data(self, value: float) -> str: ...
+ def format_data_short(self, value: float) -> str: ...
+ def get_offset(self) -> str: ...
+ def set_locs(self, locs: list[float]) -> None: ...
+ @staticmethod
+ def fix_minus(s: str) -> str: ...
+
+class NullFormatter(Formatter): ...
+
+class FixedFormatter(Formatter):
+ seq: Sequence[str]
+ offset_string: str
+ def __init__(self, seq: Sequence[str]) -> None: ...
+ def set_offset_string(self, ofs: str) -> None: ...
+
+class FuncFormatter(Formatter):
+ func: Callable[[float, int | None], str]
+ offset_string: str
+ # Callable[[float, int | None], str] | Callable[[float], str]
+ def __init__(self, func: Callable[..., str]) -> None: ...
+ def set_offset_string(self, ofs: str) -> None: ...
+
+class FormatStrFormatter(Formatter):
+ fmt: str
+ def __init__(self, fmt: str) -> None: ...
+
+class StrMethodFormatter(Formatter):
+ fmt: str
+ def __init__(self, fmt: str) -> None: ...
+
+class ScalarFormatter(Formatter):
+ orderOfMagnitude: int
+ format: str
+ def __init__(
+ self,
+ useOffset: bool | float | None = ...,
+ useMathText: bool | None = ...,
+ useLocale: bool | None = ...,
+ *,
+ usetex: bool | None = ...,
+ ) -> None: ...
+ offset: float
+ def get_usetex(self) -> bool: ...
+ def set_usetex(self, val: bool) -> None: ...
+ @property
+ def usetex(self) -> bool: ...
+ @usetex.setter
+ def usetex(self, val: bool) -> None: ...
+ def get_useOffset(self) -> bool: ...
+ def set_useOffset(self, val: bool | float) -> None: ...
+ @property
+ def useOffset(self) -> bool: ...
+ @useOffset.setter
+ def useOffset(self, val: bool | float) -> None: ...
+ def get_useLocale(self) -> bool: ...
+ def set_useLocale(self, val: bool | None) -> None: ...
+ @property
+ def useLocale(self) -> bool: ...
+ @useLocale.setter
+ def useLocale(self, val: bool | None) -> None: ...
+ def get_useMathText(self) -> bool: ...
+ def set_useMathText(self, val: bool | None) -> None: ...
+ @property
+ def useMathText(self) -> bool: ...
+ @useMathText.setter
+ def useMathText(self, val: bool | None) -> None: ...
+ def set_scientific(self, b: bool) -> None: ...
+ def set_powerlimits(self, lims: tuple[int, int]) -> None: ...
+ def format_data_short(self, value: float | np.ma.MaskedArray) -> str: ...
+ def format_data(self, value: float) -> str: ...
+
+class LogFormatter(Formatter):
+ minor_thresholds: tuple[float, float]
+ def __init__(
+ self,
+ base: float = ...,
+ labelOnlyBase: bool = ...,
+ minor_thresholds: tuple[float, float] | None = ...,
+ linthresh: float | None = ...,
+ ) -> None: ...
+ def set_base(self, base: float) -> None: ...
+ labelOnlyBase: bool
+ def set_label_minor(self, labelOnlyBase: bool) -> None: ...
+ def set_locs(self, locs: Any | None = ...) -> None: ...
+ def format_data(self, value: float) -> str: ...
+ def format_data_short(self, value: float) -> str: ...
+
+class LogFormatterExponent(LogFormatter): ...
+class LogFormatterMathtext(LogFormatter): ...
+class LogFormatterSciNotation(LogFormatterMathtext): ...
+
+class LogitFormatter(Formatter):
+ def __init__(
+ self,
+ *,
+ use_overline: bool = ...,
+ one_half: str = ...,
+ minor: bool = ...,
+ minor_threshold: int = ...,
+ minor_number: int = ...
+ ) -> None: ...
+ def use_overline(self, use_overline: bool) -> None: ...
+ def set_one_half(self, one_half: str) -> None: ...
+ def set_minor_threshold(self, minor_threshold: int) -> None: ...
+ def set_minor_number(self, minor_number: int) -> None: ...
+ def format_data_short(self, value: float) -> str: ...
+
+class EngFormatter(ScalarFormatter):
+ ENG_PREFIXES: dict[int, str]
+ unit: str
+ places: int | None
+ sep: str
+ def __init__(
+ self,
+ unit: str = ...,
+ places: int | None = ...,
+ sep: str = ...,
+ *,
+ usetex: bool | None = ...,
+ useMathText: bool | None = ...,
+ useOffset: bool | float | None = ...,
+ ) -> None: ...
+ def format_eng(self, num: float) -> str: ...
+
+class PercentFormatter(Formatter):
+ xmax: float
+ decimals: int | None
+ def __init__(
+ self,
+ xmax: float = ...,
+ decimals: int | None = ...,
+ symbol: str | None = ...,
+ is_latex: bool = ...,
+ ) -> None: ...
+ def format_pct(self, x: float, display_range: float) -> str: ...
+ def convert_to_pct(self, x: float) -> float: ...
+ @property
+ def symbol(self) -> str: ...
+ @symbol.setter
+ def symbol(self, symbol: str) -> None: ...
+
+class Locator(TickHelper):
+ MAXTICKS: int
+ def tick_values(self, vmin: float, vmax: float) -> Sequence[float]: ...
+ # Implementation accepts **kwargs, but is a no-op other than a warning
+ # Typing as **kwargs would require each subclass to accept **kwargs for mypy
+ def set_params(self) -> None: ...
+ def __call__(self) -> Sequence[float]: ...
+ def raise_if_exceeds(self, locs: Sequence[float]) -> Sequence[float]: ...
+ def nonsingular(self, v0: float, v1: float) -> tuple[float, float]: ...
+ def view_limits(self, vmin: float, vmax: float) -> tuple[float, float]: ...
+
+class IndexLocator(Locator):
+ offset: float
+ def __init__(self, base: float, offset: float) -> None: ...
+ def set_params(
+ self, base: float | None = ..., offset: float | None = ...
+ ) -> None: ...
+
+class FixedLocator(Locator):
+ nbins: int | None
+ def __init__(self, locs: Sequence[float], nbins: int | None = ...) -> None: ...
+ def set_params(self, nbins: int | None = ...) -> None: ...
+
+class NullLocator(Locator): ...
+
+class LinearLocator(Locator):
+ presets: dict[tuple[float, float], Sequence[float]]
+ def __init__(
+ self,
+ numticks: int | None = ...,
+ presets: dict[tuple[float, float], Sequence[float]] | None = ...,
+ ) -> None: ...
+ @property
+ def numticks(self) -> int: ...
+ @numticks.setter
+ def numticks(self, numticks: int | None) -> None: ...
+ def set_params(
+ self,
+ numticks: int | None = ...,
+ presets: dict[tuple[float, float], Sequence[float]] | None = ...,
+ ) -> None: ...
+
+class MultipleLocator(Locator):
+ def __init__(self, base: float = ..., offset: float = ...) -> None: ...
+ def set_params(self, base: float | None = ..., offset: float | None = ...) -> None: ...
+ def view_limits(self, dmin: float, dmax: float) -> tuple[float, float]: ...
+
+class _Edge_integer:
+ step: float
+ def __init__(self, step: float, offset: float) -> None: ...
+ def closeto(self, ms: float, edge: float) -> bool: ...
+ def le(self, x: float) -> float: ...
+ def ge(self, x: float) -> float: ...
+
+class MaxNLocator(Locator):
+ default_params: dict[str, Any]
+ def __init__(self, nbins: int | Literal["auto"] | None = ..., **kwargs) -> None: ...
+ def set_params(self, **kwargs) -> None: ...
+ def view_limits(self, dmin: float, dmax: float) -> tuple[float, float]: ...
+
+class LogLocator(Locator):
+ numticks: int | None
+ def __init__(
+ self,
+ base: float = ...,
+ subs: None | Literal["auto", "all"] | Sequence[float] = ...,
+ *,
+ numticks: int | None = ...,
+ ) -> None: ...
+ def set_params(
+ self,
+ base: float | None = ...,
+ subs: Literal["auto", "all"] | Sequence[float] | None = ...,
+ *,
+ numticks: int | None = ...,
+ ) -> None: ...
+
+class SymmetricalLogLocator(Locator):
+ numticks: int
+ def __init__(
+ self,
+ transform: Transform | None = ...,
+ subs: Sequence[float] | None = ...,
+ linthresh: float | None = ...,
+ base: float | None = ...,
+ ) -> None: ...
+ def set_params(
+ self, subs: Sequence[float] | None = ..., numticks: int | None = ...
+ ) -> None: ...
+
+class AsinhLocator(Locator):
+ linear_width: float
+ numticks: int
+ symthresh: float
+ base: int
+ subs: Sequence[float] | None
+ def __init__(
+ self,
+ linear_width: float,
+ numticks: int = ...,
+ symthresh: float = ...,
+ base: int = ...,
+ subs: Sequence[float] | None = ...,
+ ) -> None: ...
+ def set_params(
+ self,
+ numticks: int | None = ...,
+ symthresh: float | None = ...,
+ base: int | None = ...,
+ subs: Sequence[float] | None = ...,
+ ) -> None: ...
+
+class LogitLocator(MaxNLocator):
+ def __init__(
+ self, minor: bool = ..., *, nbins: Literal["auto"] | int = ...
+ ) -> None: ...
+ def set_params(self, minor: bool | None = ..., **kwargs) -> None: ...
+ @property
+ def minor(self) -> bool: ...
+ @minor.setter
+ def minor(self, value: bool) -> None: ...
+
+class AutoLocator(MaxNLocator):
+ def __init__(self) -> None: ...
+
+class AutoMinorLocator(Locator):
+ ndivs: int
+ def __init__(self, n: int | None = ...) -> None: ...
+
+__all__ = ('TickHelper', 'Formatter', 'FixedFormatter',
+ 'NullFormatter', 'FuncFormatter', 'FormatStrFormatter',
+ 'StrMethodFormatter', 'ScalarFormatter', 'LogFormatter',
+ 'LogFormatterExponent', 'LogFormatterMathtext',
+ 'LogFormatterSciNotation',
+ 'LogitFormatter', 'EngFormatter', 'PercentFormatter',
+ 'Locator', 'IndexLocator', 'FixedLocator', 'NullLocator',
+ 'LinearLocator', 'LogLocator', 'AutoLocator',
+ 'MultipleLocator', 'MaxNLocator', 'AutoMinorLocator',
+ 'SymmetricalLogLocator', 'AsinhLocator', 'LogitLocator')
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/transforms.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/transforms.py
new file mode 100644
index 0000000000000000000000000000000000000000..2934b0a77809cb160b516557f6eca1ca5cadca8f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/transforms.py
@@ -0,0 +1,2995 @@
+"""
+Matplotlib includes a framework for arbitrary geometric transformations that is used to
+determine the final position of all elements drawn on the canvas.
+
+Transforms are composed into trees of `TransformNode` objects
+whose actual value depends on their children. When the contents of
+children change, their parents are automatically invalidated. The
+next time an invalidated transform is accessed, it is recomputed to
+reflect those changes. This invalidation/caching approach prevents
+unnecessary recomputations of transforms, and contributes to better
+interactive performance.
+
+For example, here is a graph of the transform tree used to plot data to the figure:
+
+.. graphviz:: /api/transforms.dot
+ :alt: Diagram of transform tree from data to figure coordinates.
+
+The framework can be used for both affine and non-affine
+transformations. However, for speed, we want to use the backend
+renderers to perform affine transformations whenever possible.
+Therefore, it is possible to perform just the affine or non-affine
+part of a transformation on a set of data. The affine is always
+assumed to occur after the non-affine. For any transform::
+
+ full transform == non-affine part + affine part
+
+The backends are not expected to handle non-affine transformations
+themselves.
+
+See the tutorial :ref:`transforms_tutorial` for examples
+of how to use transforms.
+"""
+
+# Note: There are a number of places in the code where we use `np.min` or
+# `np.minimum` instead of the builtin `min`, and likewise for `max`. This is
+# done so that `nan`s are propagated, instead of being silently dropped.
+
+import copy
+import functools
+import itertools
+import textwrap
+import weakref
+import math
+
+import numpy as np
+from numpy.linalg import inv
+
+from matplotlib import _api
+from matplotlib._path import (
+ affine_transform, count_bboxes_overlapping_bbox, update_path_extents)
+from .path import Path
+
+DEBUG = False
+
+
+def _make_str_method(*args, **kwargs):
+ """
+ Generate a ``__str__`` method for a `.Transform` subclass.
+
+ After ::
+
+ class T:
+ __str__ = _make_str_method("attr", key="other")
+
+ ``str(T(...))`` will be
+
+ .. code-block:: text
+
+ {type(T).__name__}(
+ {self.attr},
+ key={self.other})
+ """
+ indent = functools.partial(textwrap.indent, prefix=" " * 4)
+ def strrepr(x): return repr(x) if isinstance(x, str) else str(x)
+ return lambda self: (
+ type(self).__name__ + "("
+ + ",".join([*(indent("\n" + strrepr(getattr(self, arg)))
+ for arg in args),
+ *(indent("\n" + k + "=" + strrepr(getattr(self, arg)))
+ for k, arg in kwargs.items())])
+ + ")")
+
+
+class TransformNode:
+ """
+ The base class for anything that participates in the transform tree
+ and needs to invalidate its parents or be invalidated. This includes
+ classes that are not really transforms, such as bounding boxes, since some
+ transforms depend on bounding boxes to compute their values.
+ """
+
+ # Invalidation may affect only the affine part. If the
+ # invalidation was "affine-only", the _invalid member is set to
+ # INVALID_AFFINE_ONLY
+
+ # Possible values for the _invalid attribute.
+ _VALID, _INVALID_AFFINE_ONLY, _INVALID_FULL = range(3)
+
+ # Some metadata about the transform, used to determine whether an
+ # invalidation is affine-only
+ is_affine = False
+ is_bbox = _api.deprecated("3.9")(_api.classproperty(lambda cls: False))
+
+ pass_through = False
+ """
+ If pass_through is True, all ancestors will always be
+ invalidated, even if 'self' is already invalid.
+ """
+
+ def __init__(self, shorthand_name=None):
+ """
+ Parameters
+ ----------
+ shorthand_name : str
+ A string representing the "name" of the transform. The name carries
+ no significance other than to improve the readability of
+ ``str(transform)`` when DEBUG=True.
+ """
+ self._parents = {}
+ # Initially invalid, until first computation.
+ self._invalid = self._INVALID_FULL
+ self._shorthand_name = shorthand_name or ''
+
+ if DEBUG:
+ def __str__(self):
+ # either just return the name of this TransformNode, or its repr
+ return self._shorthand_name or repr(self)
+
+ def __getstate__(self):
+ # turn the dictionary with weak values into a normal dictionary
+ return {**self.__dict__,
+ '_parents': {k: v() for k, v in self._parents.items()}}
+
+ def __setstate__(self, data_dict):
+ self.__dict__ = data_dict
+ # turn the normal dictionary back into a dictionary with weak values
+ # The extra lambda is to provide a callback to remove dead
+ # weakrefs from the dictionary when garbage collection is done.
+ self._parents = {
+ k: weakref.ref(v, lambda _, pop=self._parents.pop, k=k: pop(k))
+ for k, v in self._parents.items() if v is not None}
+
+ def __copy__(self):
+ other = copy.copy(super())
+ # If `c = a + b; a1 = copy(a)`, then modifications to `a1` do not
+ # propagate back to `c`, i.e. we need to clear the parents of `a1`.
+ other._parents = {}
+ # If `c = a + b; c1 = copy(c)`, then modifications to `a` also need to
+ # be propagated to `c1`.
+ for key, val in vars(self).items():
+ if isinstance(val, TransformNode) and id(self) in val._parents:
+ other.set_children(val) # val == getattr(other, key)
+ return other
+
+ def invalidate(self):
+ """
+ Invalidate this `TransformNode` and triggers an invalidation of its
+ ancestors. Should be called any time the transform changes.
+ """
+ return self._invalidate_internal(
+ level=self._INVALID_AFFINE_ONLY if self.is_affine else self._INVALID_FULL,
+ invalidating_node=self)
+
+ def _invalidate_internal(self, level, invalidating_node):
+ """
+ Called by :meth:`invalidate` and subsequently ascends the transform
+ stack calling each TransformNode's _invalidate_internal method.
+ """
+ # If we are already more invalid than the currently propagated invalidation,
+ # then we don't need to do anything.
+ if level <= self._invalid and not self.pass_through:
+ return
+ self._invalid = level
+ for parent in list(self._parents.values()):
+ parent = parent() # Dereference the weak reference.
+ if parent is not None:
+ parent._invalidate_internal(level=level, invalidating_node=self)
+
+ def set_children(self, *children):
+ """
+ Set the children of the transform, to let the invalidation
+ system know which transforms can invalidate this transform.
+ Should be called from the constructor of any transforms that
+ depend on other transforms.
+ """
+ # Parents are stored as weak references, so that if the
+ # parents are destroyed, references from the children won't
+ # keep them alive.
+ id_self = id(self)
+ for child in children:
+ # Use weak references so this dictionary won't keep obsolete nodes
+ # alive; the callback deletes the dictionary entry. This is a
+ # performance improvement over using WeakValueDictionary.
+ ref = weakref.ref(
+ self, lambda _, pop=child._parents.pop, k=id_self: pop(k))
+ child._parents[id_self] = ref
+
+ def frozen(self):
+ """
+ Return a frozen copy of this transform node. The frozen copy will not
+ be updated when its children change. Useful for storing a previously
+ known state of a transform where ``copy.deepcopy()`` might normally be
+ used.
+ """
+ return self
+
+
+class BboxBase(TransformNode):
+ """
+ The base class of all bounding boxes.
+
+ This class is immutable; `Bbox` is a mutable subclass.
+
+ The canonical representation is as two points, with no
+ restrictions on their ordering. Convenience properties are
+ provided to get the left, bottom, right and top edges and width
+ and height, but these are not stored explicitly.
+ """
+
+ is_bbox = _api.deprecated("3.9")(_api.classproperty(lambda cls: True))
+ is_affine = True
+
+ if DEBUG:
+ @staticmethod
+ def _check(points):
+ if isinstance(points, np.ma.MaskedArray):
+ _api.warn_external("Bbox bounds are a masked array.")
+ points = np.asarray(points)
+ if any((points[1, :] - points[0, :]) == 0):
+ _api.warn_external("Singular Bbox.")
+
+ def frozen(self):
+ return Bbox(self.get_points().copy())
+ frozen.__doc__ = TransformNode.__doc__
+
+ def __array__(self, *args, **kwargs):
+ return self.get_points()
+
+ @property
+ def x0(self):
+ """
+ The first of the pair of *x* coordinates that define the bounding box.
+
+ This is not guaranteed to be less than :attr:`x1` (for that, use
+ :attr:`xmin`).
+ """
+ return self.get_points()[0, 0]
+
+ @property
+ def y0(self):
+ """
+ The first of the pair of *y* coordinates that define the bounding box.
+
+ This is not guaranteed to be less than :attr:`y1` (for that, use
+ :attr:`ymin`).
+ """
+ return self.get_points()[0, 1]
+
+ @property
+ def x1(self):
+ """
+ The second of the pair of *x* coordinates that define the bounding box.
+
+ This is not guaranteed to be greater than :attr:`x0` (for that, use
+ :attr:`xmax`).
+ """
+ return self.get_points()[1, 0]
+
+ @property
+ def y1(self):
+ """
+ The second of the pair of *y* coordinates that define the bounding box.
+
+ This is not guaranteed to be greater than :attr:`y0` (for that, use
+ :attr:`ymax`).
+ """
+ return self.get_points()[1, 1]
+
+ @property
+ def p0(self):
+ """
+ The first pair of (*x*, *y*) coordinates that define the bounding box.
+
+ This is not guaranteed to be the bottom-left corner (for that, use
+ :attr:`min`).
+ """
+ return self.get_points()[0]
+
+ @property
+ def p1(self):
+ """
+ The second pair of (*x*, *y*) coordinates that define the bounding box.
+
+ This is not guaranteed to be the top-right corner (for that, use
+ :attr:`max`).
+ """
+ return self.get_points()[1]
+
+ @property
+ def xmin(self):
+ """The left edge of the bounding box."""
+ return np.min(self.get_points()[:, 0])
+
+ @property
+ def ymin(self):
+ """The bottom edge of the bounding box."""
+ return np.min(self.get_points()[:, 1])
+
+ @property
+ def xmax(self):
+ """The right edge of the bounding box."""
+ return np.max(self.get_points()[:, 0])
+
+ @property
+ def ymax(self):
+ """The top edge of the bounding box."""
+ return np.max(self.get_points()[:, 1])
+
+ @property
+ def min(self):
+ """The bottom-left corner of the bounding box."""
+ return np.min(self.get_points(), axis=0)
+
+ @property
+ def max(self):
+ """The top-right corner of the bounding box."""
+ return np.max(self.get_points(), axis=0)
+
+ @property
+ def intervalx(self):
+ """
+ The pair of *x* coordinates that define the bounding box.
+
+ This is not guaranteed to be sorted from left to right.
+ """
+ return self.get_points()[:, 0]
+
+ @property
+ def intervaly(self):
+ """
+ The pair of *y* coordinates that define the bounding box.
+
+ This is not guaranteed to be sorted from bottom to top.
+ """
+ return self.get_points()[:, 1]
+
+ @property
+ def width(self):
+ """The (signed) width of the bounding box."""
+ points = self.get_points()
+ return points[1, 0] - points[0, 0]
+
+ @property
+ def height(self):
+ """The (signed) height of the bounding box."""
+ points = self.get_points()
+ return points[1, 1] - points[0, 1]
+
+ @property
+ def size(self):
+ """The (signed) width and height of the bounding box."""
+ points = self.get_points()
+ return points[1] - points[0]
+
+ @property
+ def bounds(self):
+ """Return (:attr:`x0`, :attr:`y0`, :attr:`width`, :attr:`height`)."""
+ (x0, y0), (x1, y1) = self.get_points()
+ return (x0, y0, x1 - x0, y1 - y0)
+
+ @property
+ def extents(self):
+ """Return (:attr:`x0`, :attr:`y0`, :attr:`x1`, :attr:`y1`)."""
+ return self.get_points().flatten() # flatten returns a copy.
+
+ def get_points(self):
+ raise NotImplementedError
+
+ def containsx(self, x):
+ """
+ Return whether *x* is in the closed (:attr:`x0`, :attr:`x1`) interval.
+ """
+ x0, x1 = self.intervalx
+ return x0 <= x <= x1 or x0 >= x >= x1
+
+ def containsy(self, y):
+ """
+ Return whether *y* is in the closed (:attr:`y0`, :attr:`y1`) interval.
+ """
+ y0, y1 = self.intervaly
+ return y0 <= y <= y1 or y0 >= y >= y1
+
+ def contains(self, x, y):
+ """
+ Return whether ``(x, y)`` is in the bounding box or on its edge.
+ """
+ return self.containsx(x) and self.containsy(y)
+
+ def overlaps(self, other):
+ """
+ Return whether this bounding box overlaps with the other bounding box.
+
+ Parameters
+ ----------
+ other : `.BboxBase`
+ """
+ ax1, ay1, ax2, ay2 = self.extents
+ bx1, by1, bx2, by2 = other.extents
+ if ax2 < ax1:
+ ax2, ax1 = ax1, ax2
+ if ay2 < ay1:
+ ay2, ay1 = ay1, ay2
+ if bx2 < bx1:
+ bx2, bx1 = bx1, bx2
+ if by2 < by1:
+ by2, by1 = by1, by2
+ return ax1 <= bx2 and bx1 <= ax2 and ay1 <= by2 and by1 <= ay2
+
+ def fully_containsx(self, x):
+ """
+ Return whether *x* is in the open (:attr:`x0`, :attr:`x1`) interval.
+ """
+ x0, x1 = self.intervalx
+ return x0 < x < x1 or x0 > x > x1
+
+ def fully_containsy(self, y):
+ """
+ Return whether *y* is in the open (:attr:`y0`, :attr:`y1`) interval.
+ """
+ y0, y1 = self.intervaly
+ return y0 < y < y1 or y0 > y > y1
+
+ def fully_contains(self, x, y):
+ """
+ Return whether ``x, y`` is in the bounding box, but not on its edge.
+ """
+ return self.fully_containsx(x) and self.fully_containsy(y)
+
+ def fully_overlaps(self, other):
+ """
+ Return whether this bounding box overlaps with the other bounding box,
+ not including the edges.
+
+ Parameters
+ ----------
+ other : `.BboxBase`
+ """
+ ax1, ay1, ax2, ay2 = self.extents
+ bx1, by1, bx2, by2 = other.extents
+ if ax2 < ax1:
+ ax2, ax1 = ax1, ax2
+ if ay2 < ay1:
+ ay2, ay1 = ay1, ay2
+ if bx2 < bx1:
+ bx2, bx1 = bx1, bx2
+ if by2 < by1:
+ by2, by1 = by1, by2
+ return ax1 < bx2 and bx1 < ax2 and ay1 < by2 and by1 < ay2
+
+ def transformed(self, transform):
+ """
+ Construct a `Bbox` by statically transforming this one by *transform*.
+ """
+ pts = self.get_points()
+ ll, ul, lr = transform.transform(np.array(
+ [pts[0], [pts[0, 0], pts[1, 1]], [pts[1, 0], pts[0, 1]]]))
+ return Bbox([ll, [lr[0], ul[1]]])
+
+ coefs = {'C': (0.5, 0.5),
+ 'SW': (0, 0),
+ 'S': (0.5, 0),
+ 'SE': (1.0, 0),
+ 'E': (1.0, 0.5),
+ 'NE': (1.0, 1.0),
+ 'N': (0.5, 1.0),
+ 'NW': (0, 1.0),
+ 'W': (0, 0.5)}
+
+ def anchored(self, c, container):
+ """
+ Return a copy of the `Bbox` anchored to *c* within *container*.
+
+ Parameters
+ ----------
+ c : (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
+ Either an (*x*, *y*) pair of relative coordinates (0 is left or
+ bottom, 1 is right or top), 'C' (center), or a cardinal direction
+ ('SW', southwest, is bottom left, etc.).
+ container : `Bbox`
+ The box within which the `Bbox` is positioned.
+
+ See Also
+ --------
+ .Axes.set_anchor
+ """
+ l, b, w, h = container.bounds
+ L, B, W, H = self.bounds
+ cx, cy = self.coefs[c] if isinstance(c, str) else c
+ return Bbox(self._points +
+ [(l + cx * (w - W)) - L,
+ (b + cy * (h - H)) - B])
+
+ def shrunk(self, mx, my):
+ """
+ Return a copy of the `Bbox`, shrunk by the factor *mx*
+ in the *x* direction and the factor *my* in the *y* direction.
+ The lower left corner of the box remains unchanged. Normally
+ *mx* and *my* will be less than 1, but this is not enforced.
+ """
+ w, h = self.size
+ return Bbox([self._points[0],
+ self._points[0] + [mx * w, my * h]])
+
+ def shrunk_to_aspect(self, box_aspect, container=None, fig_aspect=1.0):
+ """
+ Return a copy of the `Bbox`, shrunk so that it is as
+ large as it can be while having the desired aspect ratio,
+ *box_aspect*. If the box coordinates are relative (i.e.
+ fractions of a larger box such as a figure) then the
+ physical aspect ratio of that figure is specified with
+ *fig_aspect*, so that *box_aspect* can also be given as a
+ ratio of the absolute dimensions, not the relative dimensions.
+ """
+ if box_aspect <= 0 or fig_aspect <= 0:
+ raise ValueError("'box_aspect' and 'fig_aspect' must be positive")
+ if container is None:
+ container = self
+ w, h = container.size
+ H = w * box_aspect / fig_aspect
+ if H <= h:
+ W = w
+ else:
+ W = h * fig_aspect / box_aspect
+ H = h
+ return Bbox([self._points[0],
+ self._points[0] + (W, H)])
+
+ def splitx(self, *args):
+ """
+ Return a list of new `Bbox` objects formed by splitting the original
+ one with vertical lines at fractional positions given by *args*.
+ """
+ xf = [0, *args, 1]
+ x0, y0, x1, y1 = self.extents
+ w = x1 - x0
+ return [Bbox([[x0 + xf0 * w, y0], [x0 + xf1 * w, y1]])
+ for xf0, xf1 in itertools.pairwise(xf)]
+
+ def splity(self, *args):
+ """
+ Return a list of new `Bbox` objects formed by splitting the original
+ one with horizontal lines at fractional positions given by *args*.
+ """
+ yf = [0, *args, 1]
+ x0, y0, x1, y1 = self.extents
+ h = y1 - y0
+ return [Bbox([[x0, y0 + yf0 * h], [x1, y0 + yf1 * h]])
+ for yf0, yf1 in itertools.pairwise(yf)]
+
+ def count_contains(self, vertices):
+ """
+ Count the number of vertices contained in the `Bbox`.
+ Any vertices with a non-finite x or y value are ignored.
+
+ Parameters
+ ----------
+ vertices : (N, 2) array
+ """
+ if len(vertices) == 0:
+ return 0
+ vertices = np.asarray(vertices)
+ with np.errstate(invalid='ignore'):
+ return (((self.min < vertices) &
+ (vertices < self.max)).all(axis=1).sum())
+
+ def count_overlaps(self, bboxes):
+ """
+ Count the number of bounding boxes that overlap this one.
+
+ Parameters
+ ----------
+ bboxes : sequence of `.BboxBase`
+ """
+ return count_bboxes_overlapping_bbox(
+ self, np.atleast_3d([np.array(x) for x in bboxes]))
+
+ def expanded(self, sw, sh):
+ """
+ Construct a `Bbox` by expanding this one around its center by the
+ factors *sw* and *sh*.
+ """
+ width = self.width
+ height = self.height
+ deltaw = (sw * width - width) / 2.0
+ deltah = (sh * height - height) / 2.0
+ a = np.array([[-deltaw, -deltah], [deltaw, deltah]])
+ return Bbox(self._points + a)
+
+ def padded(self, w_pad, h_pad=None):
+ """
+ Construct a `Bbox` by padding this one on all four sides.
+
+ Parameters
+ ----------
+ w_pad : float
+ Width pad
+ h_pad : float, optional
+ Height pad. Defaults to *w_pad*.
+
+ """
+ points = self.get_points()
+ if h_pad is None:
+ h_pad = w_pad
+ return Bbox(points + [[-w_pad, -h_pad], [w_pad, h_pad]])
+
+ def translated(self, tx, ty):
+ """Construct a `Bbox` by translating this one by *tx* and *ty*."""
+ return Bbox(self._points + (tx, ty))
+
+ def corners(self):
+ """
+ Return the corners of this rectangle as an array of points.
+
+ Specifically, this returns the array
+ ``[[x0, y0], [x0, y1], [x1, y0], [x1, y1]]``.
+ """
+ (x0, y0), (x1, y1) = self.get_points()
+ return np.array([[x0, y0], [x0, y1], [x1, y0], [x1, y1]])
+
+ def rotated(self, radians):
+ """
+ Return the axes-aligned bounding box that bounds the result of rotating
+ this `Bbox` by an angle of *radians*.
+ """
+ corners = self.corners()
+ corners_rotated = Affine2D().rotate(radians).transform(corners)
+ bbox = Bbox.unit()
+ bbox.update_from_data_xy(corners_rotated, ignore=True)
+ return bbox
+
+ @staticmethod
+ def union(bboxes):
+ """Return a `Bbox` that contains all of the given *bboxes*."""
+ if not len(bboxes):
+ raise ValueError("'bboxes' cannot be empty")
+ x0 = np.min([bbox.xmin for bbox in bboxes])
+ x1 = np.max([bbox.xmax for bbox in bboxes])
+ y0 = np.min([bbox.ymin for bbox in bboxes])
+ y1 = np.max([bbox.ymax for bbox in bboxes])
+ return Bbox([[x0, y0], [x1, y1]])
+
+ @staticmethod
+ def intersection(bbox1, bbox2):
+ """
+ Return the intersection of *bbox1* and *bbox2* if they intersect, or
+ None if they don't.
+ """
+ x0 = np.maximum(bbox1.xmin, bbox2.xmin)
+ x1 = np.minimum(bbox1.xmax, bbox2.xmax)
+ y0 = np.maximum(bbox1.ymin, bbox2.ymin)
+ y1 = np.minimum(bbox1.ymax, bbox2.ymax)
+ return Bbox([[x0, y0], [x1, y1]]) if x0 <= x1 and y0 <= y1 else None
+
+
+_default_minpos = np.array([np.inf, np.inf])
+
+
+class Bbox(BboxBase):
+ """
+ A mutable bounding box.
+
+ Examples
+ --------
+ **Create from known bounds**
+
+ The default constructor takes the boundary "points" ``[[xmin, ymin],
+ [xmax, ymax]]``.
+
+ >>> Bbox([[1, 1], [3, 7]])
+ Bbox([[1.0, 1.0], [3.0, 7.0]])
+
+ Alternatively, a Bbox can be created from the flattened points array, the
+ so-called "extents" ``(xmin, ymin, xmax, ymax)``
+
+ >>> Bbox.from_extents(1, 1, 3, 7)
+ Bbox([[1.0, 1.0], [3.0, 7.0]])
+
+ or from the "bounds" ``(xmin, ymin, width, height)``.
+
+ >>> Bbox.from_bounds(1, 1, 2, 6)
+ Bbox([[1.0, 1.0], [3.0, 7.0]])
+
+ **Create from collections of points**
+
+ The "empty" object for accumulating Bboxs is the null bbox, which is a
+ stand-in for the empty set.
+
+ >>> Bbox.null()
+ Bbox([[inf, inf], [-inf, -inf]])
+
+ Adding points to the null bbox will give you the bbox of those points.
+
+ >>> box = Bbox.null()
+ >>> box.update_from_data_xy([[1, 1]])
+ >>> box
+ Bbox([[1.0, 1.0], [1.0, 1.0]])
+ >>> box.update_from_data_xy([[2, 3], [3, 2]], ignore=False)
+ >>> box
+ Bbox([[1.0, 1.0], [3.0, 3.0]])
+
+ Setting ``ignore=True`` is equivalent to starting over from a null bbox.
+
+ >>> box.update_from_data_xy([[1, 1]], ignore=True)
+ >>> box
+ Bbox([[1.0, 1.0], [1.0, 1.0]])
+
+ .. warning::
+
+ It is recommended to always specify ``ignore`` explicitly. If not, the
+ default value of ``ignore`` can be changed at any time by code with
+ access to your Bbox, for example using the method `~.Bbox.ignore`.
+
+ **Properties of the ``null`` bbox**
+
+ .. note::
+
+ The current behavior of `Bbox.null()` may be surprising as it does
+ not have all of the properties of the "empty set", and as such does
+ not behave like a "zero" object in the mathematical sense. We may
+ change that in the future (with a deprecation period).
+
+ The null bbox is the identity for intersections
+
+ >>> Bbox.intersection(Bbox([[1, 1], [3, 7]]), Bbox.null())
+ Bbox([[1.0, 1.0], [3.0, 7.0]])
+
+ except with itself, where it returns the full space.
+
+ >>> Bbox.intersection(Bbox.null(), Bbox.null())
+ Bbox([[-inf, -inf], [inf, inf]])
+
+ A union containing null will always return the full space (not the other
+ set!)
+
+ >>> Bbox.union([Bbox([[0, 0], [0, 0]]), Bbox.null()])
+ Bbox([[-inf, -inf], [inf, inf]])
+ """
+
+ def __init__(self, points, **kwargs):
+ """
+ Parameters
+ ----------
+ points : `~numpy.ndarray`
+ A (2, 2) array of the form ``[[x0, y0], [x1, y1]]``.
+ """
+ super().__init__(**kwargs)
+ points = np.asarray(points, float)
+ if points.shape != (2, 2):
+ raise ValueError('Bbox points must be of the form '
+ '"[[x0, y0], [x1, y1]]".')
+ self._points = points
+ self._minpos = _default_minpos.copy()
+ self._ignore = True
+ # it is helpful in some contexts to know if the bbox is a
+ # default or has been mutated; we store the orig points to
+ # support the mutated methods
+ self._points_orig = self._points.copy()
+ if DEBUG:
+ ___init__ = __init__
+
+ def __init__(self, points, **kwargs):
+ self._check(points)
+ self.___init__(points, **kwargs)
+
+ def invalidate(self):
+ self._check(self._points)
+ super().invalidate()
+
+ def frozen(self):
+ # docstring inherited
+ frozen_bbox = super().frozen()
+ frozen_bbox._minpos = self.minpos.copy()
+ return frozen_bbox
+
+ @staticmethod
+ def unit():
+ """Create a new unit `Bbox` from (0, 0) to (1, 1)."""
+ return Bbox([[0, 0], [1, 1]])
+
+ @staticmethod
+ def null():
+ """Create a new null `Bbox` from (inf, inf) to (-inf, -inf)."""
+ return Bbox([[np.inf, np.inf], [-np.inf, -np.inf]])
+
+ @staticmethod
+ def from_bounds(x0, y0, width, height):
+ """
+ Create a new `Bbox` from *x0*, *y0*, *width* and *height*.
+
+ *width* and *height* may be negative.
+ """
+ return Bbox.from_extents(x0, y0, x0 + width, y0 + height)
+
+ @staticmethod
+ def from_extents(*args, minpos=None):
+ """
+ Create a new Bbox from *left*, *bottom*, *right* and *top*.
+
+ The *y*-axis increases upwards.
+
+ Parameters
+ ----------
+ left, bottom, right, top : float
+ The four extents of the bounding box.
+ minpos : float or None
+ If this is supplied, the Bbox will have a minimum positive value
+ set. This is useful when dealing with logarithmic scales and other
+ scales where negative bounds result in floating point errors.
+ """
+ bbox = Bbox(np.reshape(args, (2, 2)))
+ if minpos is not None:
+ bbox._minpos[:] = minpos
+ return bbox
+
+ def __format__(self, fmt):
+ return (
+ 'Bbox(x0={0.x0:{1}}, y0={0.y0:{1}}, x1={0.x1:{1}}, y1={0.y1:{1}})'.
+ format(self, fmt))
+
+ def __str__(self):
+ return format(self, '')
+
+ def __repr__(self):
+ return 'Bbox([[{0.x0}, {0.y0}], [{0.x1}, {0.y1}]])'.format(self)
+
+ def ignore(self, value):
+ """
+ Set whether the existing bounds of the box should be ignored
+ by subsequent calls to :meth:`update_from_data_xy`.
+
+ value : bool
+ - When ``True``, subsequent calls to `update_from_data_xy` will
+ ignore the existing bounds of the `Bbox`.
+ - When ``False``, subsequent calls to `update_from_data_xy` will
+ include the existing bounds of the `Bbox`.
+ """
+ self._ignore = value
+
+ def update_from_path(self, path, ignore=None, updatex=True, updatey=True):
+ """
+ Update the bounds of the `Bbox` to contain the vertices of the
+ provided path. After updating, the bounds will have positive *width*
+ and *height*; *x0* and *y0* will be the minimal values.
+
+ Parameters
+ ----------
+ path : `~matplotlib.path.Path`
+ ignore : bool, optional
+ - When ``True``, ignore the existing bounds of the `Bbox`.
+ - When ``False``, include the existing bounds of the `Bbox`.
+ - When ``None``, use the last value passed to :meth:`ignore`.
+ updatex, updatey : bool, default: True
+ When ``True``, update the x/y values.
+ """
+ if ignore is None:
+ ignore = self._ignore
+
+ if path.vertices.size == 0:
+ return
+
+ points, minpos, changed = update_path_extents(
+ path, None, self._points, self._minpos, ignore)
+
+ if changed:
+ self.invalidate()
+ if updatex:
+ self._points[:, 0] = points[:, 0]
+ self._minpos[0] = minpos[0]
+ if updatey:
+ self._points[:, 1] = points[:, 1]
+ self._minpos[1] = minpos[1]
+
+ def update_from_data_x(self, x, ignore=None):
+ """
+ Update the x-bounds of the `Bbox` based on the passed in data. After
+ updating, the bounds will have positive *width*, and *x0* will be the
+ minimal value.
+
+ Parameters
+ ----------
+ x : `~numpy.ndarray`
+ Array of x-values.
+ ignore : bool, optional
+ - When ``True``, ignore the existing bounds of the `Bbox`.
+ - When ``False``, include the existing bounds of the `Bbox`.
+ - When ``None``, use the last value passed to :meth:`ignore`.
+ """
+ x = np.ravel(x)
+ self.update_from_data_xy(np.column_stack([x, np.ones(x.size)]),
+ ignore=ignore, updatey=False)
+
+ def update_from_data_y(self, y, ignore=None):
+ """
+ Update the y-bounds of the `Bbox` based on the passed in data. After
+ updating, the bounds will have positive *height*, and *y0* will be the
+ minimal value.
+
+ Parameters
+ ----------
+ y : `~numpy.ndarray`
+ Array of y-values.
+ ignore : bool, optional
+ - When ``True``, ignore the existing bounds of the `Bbox`.
+ - When ``False``, include the existing bounds of the `Bbox`.
+ - When ``None``, use the last value passed to :meth:`ignore`.
+ """
+ y = np.ravel(y)
+ self.update_from_data_xy(np.column_stack([np.ones(y.size), y]),
+ ignore=ignore, updatex=False)
+
+ def update_from_data_xy(self, xy, ignore=None, updatex=True, updatey=True):
+ """
+ Update the `Bbox` bounds based on the passed in *xy* coordinates.
+
+ After updating, the bounds will have positive *width* and *height*;
+ *x0* and *y0* will be the minimal values.
+
+ Parameters
+ ----------
+ xy : (N, 2) array-like
+ The (x, y) coordinates.
+ ignore : bool, optional
+ - When ``True``, ignore the existing bounds of the `Bbox`.
+ - When ``False``, include the existing bounds of the `Bbox`.
+ - When ``None``, use the last value passed to :meth:`ignore`.
+ updatex, updatey : bool, default: True
+ When ``True``, update the x/y values.
+ """
+ if len(xy) == 0:
+ return
+
+ path = Path(xy)
+ self.update_from_path(path, ignore=ignore,
+ updatex=updatex, updatey=updatey)
+
+ @BboxBase.x0.setter
+ def x0(self, val):
+ self._points[0, 0] = val
+ self.invalidate()
+
+ @BboxBase.y0.setter
+ def y0(self, val):
+ self._points[0, 1] = val
+ self.invalidate()
+
+ @BboxBase.x1.setter
+ def x1(self, val):
+ self._points[1, 0] = val
+ self.invalidate()
+
+ @BboxBase.y1.setter
+ def y1(self, val):
+ self._points[1, 1] = val
+ self.invalidate()
+
+ @BboxBase.p0.setter
+ def p0(self, val):
+ self._points[0] = val
+ self.invalidate()
+
+ @BboxBase.p1.setter
+ def p1(self, val):
+ self._points[1] = val
+ self.invalidate()
+
+ @BboxBase.intervalx.setter
+ def intervalx(self, interval):
+ self._points[:, 0] = interval
+ self.invalidate()
+
+ @BboxBase.intervaly.setter
+ def intervaly(self, interval):
+ self._points[:, 1] = interval
+ self.invalidate()
+
+ @BboxBase.bounds.setter
+ def bounds(self, bounds):
+ l, b, w, h = bounds
+ points = np.array([[l, b], [l + w, b + h]], float)
+ if np.any(self._points != points):
+ self._points = points
+ self.invalidate()
+
+ @property
+ def minpos(self):
+ """
+ The minimum positive value in both directions within the Bbox.
+
+ This is useful when dealing with logarithmic scales and other scales
+ where negative bounds result in floating point errors, and will be used
+ as the minimum extent instead of *p0*.
+ """
+ return self._minpos
+
+ @minpos.setter
+ def minpos(self, val):
+ self._minpos[:] = val
+
+ @property
+ def minposx(self):
+ """
+ The minimum positive value in the *x*-direction within the Bbox.
+
+ This is useful when dealing with logarithmic scales and other scales
+ where negative bounds result in floating point errors, and will be used
+ as the minimum *x*-extent instead of *x0*.
+ """
+ return self._minpos[0]
+
+ @minposx.setter
+ def minposx(self, val):
+ self._minpos[0] = val
+
+ @property
+ def minposy(self):
+ """
+ The minimum positive value in the *y*-direction within the Bbox.
+
+ This is useful when dealing with logarithmic scales and other scales
+ where negative bounds result in floating point errors, and will be used
+ as the minimum *y*-extent instead of *y0*.
+ """
+ return self._minpos[1]
+
+ @minposy.setter
+ def minposy(self, val):
+ self._minpos[1] = val
+
+ def get_points(self):
+ """
+ Get the points of the bounding box as an array of the form
+ ``[[x0, y0], [x1, y1]]``.
+ """
+ self._invalid = 0
+ return self._points
+
+ def set_points(self, points):
+ """
+ Set the points of the bounding box directly from an array of the form
+ ``[[x0, y0], [x1, y1]]``. No error checking is performed, as this
+ method is mainly for internal use.
+ """
+ if np.any(self._points != points):
+ self._points = points
+ self.invalidate()
+
+ def set(self, other):
+ """
+ Set this bounding box from the "frozen" bounds of another `Bbox`.
+ """
+ if np.any(self._points != other.get_points()):
+ self._points = other.get_points()
+ self.invalidate()
+
+ def mutated(self):
+ """Return whether the bbox has changed since init."""
+ return self.mutatedx() or self.mutatedy()
+
+ def mutatedx(self):
+ """Return whether the x-limits have changed since init."""
+ return (self._points[0, 0] != self._points_orig[0, 0] or
+ self._points[1, 0] != self._points_orig[1, 0])
+
+ def mutatedy(self):
+ """Return whether the y-limits have changed since init."""
+ return (self._points[0, 1] != self._points_orig[0, 1] or
+ self._points[1, 1] != self._points_orig[1, 1])
+
+
+class TransformedBbox(BboxBase):
+ """
+ A `Bbox` that is automatically transformed by a given
+ transform. When either the child bounding box or transform
+ changes, the bounds of this bbox will update accordingly.
+ """
+
+ def __init__(self, bbox, transform, **kwargs):
+ """
+ Parameters
+ ----------
+ bbox : `Bbox`
+ transform : `Transform`
+ """
+ _api.check_isinstance(BboxBase, bbox=bbox)
+ _api.check_isinstance(Transform, transform=transform)
+ if transform.input_dims != 2 or transform.output_dims != 2:
+ raise ValueError(
+ "The input and output dimensions of 'transform' must be 2")
+
+ super().__init__(**kwargs)
+ self._bbox = bbox
+ self._transform = transform
+ self.set_children(bbox, transform)
+ self._points = None
+
+ __str__ = _make_str_method("_bbox", "_transform")
+
+ def get_points(self):
+ # docstring inherited
+ if self._invalid:
+ p = self._bbox.get_points()
+ # Transform all four points, then make a new bounding box
+ # from the result, taking care to make the orientation the
+ # same.
+ points = self._transform.transform(
+ [[p[0, 0], p[0, 1]],
+ [p[1, 0], p[0, 1]],
+ [p[0, 0], p[1, 1]],
+ [p[1, 0], p[1, 1]]])
+ points = np.ma.filled(points, 0.0)
+
+ xs = min(points[:, 0]), max(points[:, 0])
+ if p[0, 0] > p[1, 0]:
+ xs = xs[::-1]
+
+ ys = min(points[:, 1]), max(points[:, 1])
+ if p[0, 1] > p[1, 1]:
+ ys = ys[::-1]
+
+ self._points = np.array([
+ [xs[0], ys[0]],
+ [xs[1], ys[1]]
+ ])
+
+ self._invalid = 0
+ return self._points
+
+ if DEBUG:
+ _get_points = get_points
+
+ def get_points(self):
+ points = self._get_points()
+ self._check(points)
+ return points
+
+ def contains(self, x, y):
+ # Docstring inherited.
+ return self._bbox.contains(*self._transform.inverted().transform((x, y)))
+
+ def fully_contains(self, x, y):
+ # Docstring inherited.
+ return self._bbox.fully_contains(*self._transform.inverted().transform((x, y)))
+
+
+class LockableBbox(BboxBase):
+ """
+ A `Bbox` where some elements may be locked at certain values.
+
+ When the child bounding box changes, the bounds of this bbox will update
+ accordingly with the exception of the locked elements.
+ """
+ def __init__(self, bbox, x0=None, y0=None, x1=None, y1=None, **kwargs):
+ """
+ Parameters
+ ----------
+ bbox : `Bbox`
+ The child bounding box to wrap.
+
+ x0 : float or None
+ The locked value for x0, or None to leave unlocked.
+
+ y0 : float or None
+ The locked value for y0, or None to leave unlocked.
+
+ x1 : float or None
+ The locked value for x1, or None to leave unlocked.
+
+ y1 : float or None
+ The locked value for y1, or None to leave unlocked.
+
+ """
+ _api.check_isinstance(BboxBase, bbox=bbox)
+ super().__init__(**kwargs)
+ self._bbox = bbox
+ self.set_children(bbox)
+ self._points = None
+ fp = [x0, y0, x1, y1]
+ mask = [val is None for val in fp]
+ self._locked_points = np.ma.array(fp, float, mask=mask).reshape((2, 2))
+
+ __str__ = _make_str_method("_bbox", "_locked_points")
+
+ def get_points(self):
+ # docstring inherited
+ if self._invalid:
+ points = self._bbox.get_points()
+ self._points = np.where(self._locked_points.mask,
+ points,
+ self._locked_points)
+ self._invalid = 0
+ return self._points
+
+ if DEBUG:
+ _get_points = get_points
+
+ def get_points(self):
+ points = self._get_points()
+ self._check(points)
+ return points
+
+ @property
+ def locked_x0(self):
+ """
+ float or None: The value used for the locked x0.
+ """
+ if self._locked_points.mask[0, 0]:
+ return None
+ else:
+ return self._locked_points[0, 0]
+
+ @locked_x0.setter
+ def locked_x0(self, x0):
+ self._locked_points.mask[0, 0] = x0 is None
+ self._locked_points.data[0, 0] = x0
+ self.invalidate()
+
+ @property
+ def locked_y0(self):
+ """
+ float or None: The value used for the locked y0.
+ """
+ if self._locked_points.mask[0, 1]:
+ return None
+ else:
+ return self._locked_points[0, 1]
+
+ @locked_y0.setter
+ def locked_y0(self, y0):
+ self._locked_points.mask[0, 1] = y0 is None
+ self._locked_points.data[0, 1] = y0
+ self.invalidate()
+
+ @property
+ def locked_x1(self):
+ """
+ float or None: The value used for the locked x1.
+ """
+ if self._locked_points.mask[1, 0]:
+ return None
+ else:
+ return self._locked_points[1, 0]
+
+ @locked_x1.setter
+ def locked_x1(self, x1):
+ self._locked_points.mask[1, 0] = x1 is None
+ self._locked_points.data[1, 0] = x1
+ self.invalidate()
+
+ @property
+ def locked_y1(self):
+ """
+ float or None: The value used for the locked y1.
+ """
+ if self._locked_points.mask[1, 1]:
+ return None
+ else:
+ return self._locked_points[1, 1]
+
+ @locked_y1.setter
+ def locked_y1(self, y1):
+ self._locked_points.mask[1, 1] = y1 is None
+ self._locked_points.data[1, 1] = y1
+ self.invalidate()
+
+
+class Transform(TransformNode):
+ """
+ The base class of all `TransformNode` instances that
+ actually perform a transformation.
+
+ All non-affine transformations should be subclasses of this class.
+ New affine transformations should be subclasses of `Affine2D`.
+
+ Subclasses of this class should override the following members (at
+ minimum):
+
+ - :attr:`input_dims`
+ - :attr:`output_dims`
+ - :meth:`transform`
+ - :meth:`inverted` (if an inverse exists)
+
+ The following attributes may be overridden if the default is unsuitable:
+
+ - :attr:`is_separable` (defaults to True for 1D -> 1D transforms, False
+ otherwise)
+ - :attr:`has_inverse` (defaults to True if :meth:`inverted` is overridden,
+ False otherwise)
+
+ If the transform needs to do something non-standard with
+ `matplotlib.path.Path` objects, such as adding curves
+ where there were once line segments, it should override:
+
+ - :meth:`transform_path`
+ """
+
+ input_dims = None
+ """
+ The number of input dimensions of this transform.
+ Must be overridden (with integers) in the subclass.
+ """
+
+ output_dims = None
+ """
+ The number of output dimensions of this transform.
+ Must be overridden (with integers) in the subclass.
+ """
+
+ is_separable = False
+ """True if this transform is separable in the x- and y- dimensions."""
+
+ has_inverse = False
+ """True if this transform has a corresponding inverse transform."""
+
+ def __init_subclass__(cls):
+ # 1d transforms are always separable; we assume higher-dimensional ones
+ # are not but subclasses can also directly set is_separable -- this is
+ # verified by checking whether "is_separable" appears more than once in
+ # the class's MRO (it appears once in Transform).
+ if (sum("is_separable" in vars(parent) for parent in cls.__mro__) == 1
+ and cls.input_dims == cls.output_dims == 1):
+ cls.is_separable = True
+ # Transform.inverted raises NotImplementedError; we assume that if this
+ # is overridden then the transform is invertible but subclass can also
+ # directly set has_inverse.
+ if (sum("has_inverse" in vars(parent) for parent in cls.__mro__) == 1
+ and hasattr(cls, "inverted")
+ and cls.inverted is not Transform.inverted):
+ cls.has_inverse = True
+
+ def __add__(self, other):
+ """
+ Compose two transforms together so that *self* is followed by *other*.
+
+ ``A + B`` returns a transform ``C`` so that
+ ``C.transform(x) == B.transform(A.transform(x))``.
+ """
+ return (composite_transform_factory(self, other)
+ if isinstance(other, Transform) else
+ NotImplemented)
+
+ # Equality is based on object identity for `Transform`s (so we don't
+ # override `__eq__`), but some subclasses, such as TransformWrapper &
+ # AffineBase, override this behavior.
+
+ def _iter_break_from_left_to_right(self):
+ """
+ Return an iterator breaking down this transform stack from left to
+ right recursively. If self == ((A, N), A) then the result will be an
+ iterator which yields I : ((A, N), A), followed by A : (N, A),
+ followed by (A, N) : (A), but not ((A, N), A) : I.
+
+ This is equivalent to flattening the stack then yielding
+ ``flat_stack[:i], flat_stack[i:]`` where i=0..(n-1).
+ """
+ yield IdentityTransform(), self
+
+ @property
+ def depth(self):
+ """
+ Return the number of transforms which have been chained
+ together to form this Transform instance.
+
+ .. note::
+
+ For the special case of a Composite transform, the maximum depth
+ of the two is returned.
+
+ """
+ return 1
+
+ def contains_branch(self, other):
+ """
+ Return whether the given transform is a sub-tree of this transform.
+
+ This routine uses transform equality to identify sub-trees, therefore
+ in many situations it is object id which will be used.
+
+ For the case where the given transform represents the whole
+ of this transform, returns True.
+ """
+ if self.depth < other.depth:
+ return False
+
+ # check that a subtree is equal to other (starting from self)
+ for _, sub_tree in self._iter_break_from_left_to_right():
+ if sub_tree == other:
+ return True
+ return False
+
+ def contains_branch_seperately(self, other_transform):
+ """
+ Return whether the given branch is a sub-tree of this transform on
+ each separate dimension.
+
+ A common use for this method is to identify if a transform is a blended
+ transform containing an Axes' data transform. e.g.::
+
+ x_isdata, y_isdata = trans.contains_branch_seperately(ax.transData)
+
+ """
+ if self.output_dims != 2:
+ raise ValueError('contains_branch_seperately only supports '
+ 'transforms with 2 output dimensions')
+ # for a non-blended transform each separate dimension is the same, so
+ # just return the appropriate shape.
+ return (self.contains_branch(other_transform), ) * 2
+
+ def __sub__(self, other):
+ """
+ Compose *self* with the inverse of *other*, cancelling identical terms
+ if any::
+
+ # In general:
+ A - B == A + B.inverted()
+ # (but see note regarding frozen transforms below).
+
+ # If A "ends with" B (i.e. A == A' + B for some A') we can cancel
+ # out B:
+ (A' + B) - B == A'
+
+ # Likewise, if B "starts with" A (B = A + B'), we can cancel out A:
+ A - (A + B') == B'.inverted() == B'^-1
+
+ Cancellation (rather than naively returning ``A + B.inverted()``) is
+ important for multiple reasons:
+
+ - It avoids floating-point inaccuracies when computing the inverse of
+ B: ``B - B`` is guaranteed to cancel out exactly (resulting in the
+ identity transform), whereas ``B + B.inverted()`` may differ by a
+ small epsilon.
+ - ``B.inverted()`` always returns a frozen transform: if one computes
+ ``A + B + B.inverted()`` and later mutates ``B``, then
+ ``B.inverted()`` won't be updated and the last two terms won't cancel
+ out anymore; on the other hand, ``A + B - B`` will always be equal to
+ ``A`` even if ``B`` is mutated.
+ """
+ # we only know how to do this operation if other is a Transform.
+ if not isinstance(other, Transform):
+ return NotImplemented
+ for remainder, sub_tree in self._iter_break_from_left_to_right():
+ if sub_tree == other:
+ return remainder
+ for remainder, sub_tree in other._iter_break_from_left_to_right():
+ if sub_tree == self:
+ if not remainder.has_inverse:
+ raise ValueError(
+ "The shortcut cannot be computed since 'other' "
+ "includes a non-invertible component")
+ return remainder.inverted()
+ # if we have got this far, then there was no shortcut possible
+ if other.has_inverse:
+ return self + other.inverted()
+ else:
+ raise ValueError('It is not possible to compute transA - transB '
+ 'since transB cannot be inverted and there is no '
+ 'shortcut possible.')
+
+ def __array__(self, *args, **kwargs):
+ """Array interface to get at this Transform's affine matrix."""
+ return self.get_affine().get_matrix()
+
+ def transform(self, values):
+ """
+ Apply this transformation on the given array of *values*.
+
+ Parameters
+ ----------
+ values : array-like
+ The input values as an array of length :attr:`input_dims` or
+ shape (N, :attr:`input_dims`).
+
+ Returns
+ -------
+ array
+ The output values as an array of length :attr:`output_dims` or
+ shape (N, :attr:`output_dims`), depending on the input.
+ """
+ # Ensure that values is a 2d array (but remember whether
+ # we started with a 1d or 2d array).
+ values = np.asanyarray(values)
+ ndim = values.ndim
+ values = values.reshape((-1, self.input_dims))
+
+ # Transform the values
+ res = self.transform_affine(self.transform_non_affine(values))
+
+ # Convert the result back to the shape of the input values.
+ if ndim == 0:
+ assert not np.ma.is_masked(res) # just to be on the safe side
+ return res[0, 0]
+ if ndim == 1:
+ return res.reshape(-1)
+ elif ndim == 2:
+ return res
+ raise ValueError(
+ "Input values must have shape (N, {dims}) or ({dims},)"
+ .format(dims=self.input_dims))
+
+ def transform_affine(self, values):
+ """
+ Apply only the affine part of this transformation on the
+ given array of values.
+
+ ``transform(values)`` is always equivalent to
+ ``transform_affine(transform_non_affine(values))``.
+
+ In non-affine transformations, this is generally a no-op. In
+ affine transformations, this is equivalent to
+ ``transform(values)``.
+
+ Parameters
+ ----------
+ values : array
+ The input values as an array of length :attr:`input_dims` or
+ shape (N, :attr:`input_dims`).
+
+ Returns
+ -------
+ array
+ The output values as an array of length :attr:`output_dims` or
+ shape (N, :attr:`output_dims`), depending on the input.
+ """
+ return self.get_affine().transform(values)
+
+ def transform_non_affine(self, values):
+ """
+ Apply only the non-affine part of this transformation.
+
+ ``transform(values)`` is always equivalent to
+ ``transform_affine(transform_non_affine(values))``.
+
+ In non-affine transformations, this is generally equivalent to
+ ``transform(values)``. In affine transformations, this is
+ always a no-op.
+
+ Parameters
+ ----------
+ values : array
+ The input values as an array of length :attr:`input_dims` or
+ shape (N, :attr:`input_dims`).
+
+ Returns
+ -------
+ array
+ The output values as an array of length :attr:`output_dims` or
+ shape (N, :attr:`output_dims`), depending on the input.
+ """
+ return values
+
+ def transform_bbox(self, bbox):
+ """
+ Transform the given bounding box.
+
+ For smarter transforms including caching (a common requirement in
+ Matplotlib), see `TransformedBbox`.
+ """
+ return Bbox(self.transform(bbox.get_points()))
+
+ def get_affine(self):
+ """Get the affine part of this transform."""
+ return IdentityTransform()
+
+ def get_matrix(self):
+ """Get the matrix for the affine part of this transform."""
+ return self.get_affine().get_matrix()
+
+ def transform_point(self, point):
+ """
+ Return a transformed point.
+
+ This function is only kept for backcompatibility; the more general
+ `.transform` method is capable of transforming both a list of points
+ and a single point.
+
+ The point is given as a sequence of length :attr:`input_dims`.
+ The transformed point is returned as a sequence of length
+ :attr:`output_dims`.
+ """
+ if len(point) != self.input_dims:
+ raise ValueError("The length of 'point' must be 'self.input_dims'")
+ return self.transform(point)
+
+ def transform_path(self, path):
+ """
+ Apply the transform to `.Path` *path*, returning a new `.Path`.
+
+ In some cases, this transform may insert curves into the path
+ that began as line segments.
+ """
+ return self.transform_path_affine(self.transform_path_non_affine(path))
+
+ def transform_path_affine(self, path):
+ """
+ Apply the affine part of this transform to `.Path` *path*, returning a
+ new `.Path`.
+
+ ``transform_path(path)`` is equivalent to
+ ``transform_path_affine(transform_path_non_affine(values))``.
+ """
+ return self.get_affine().transform_path_affine(path)
+
+ def transform_path_non_affine(self, path):
+ """
+ Apply the non-affine part of this transform to `.Path` *path*,
+ returning a new `.Path`.
+
+ ``transform_path(path)`` is equivalent to
+ ``transform_path_affine(transform_path_non_affine(values))``.
+ """
+ x = self.transform_non_affine(path.vertices)
+ return Path._fast_from_codes_and_verts(x, path.codes, path)
+
+ def transform_angles(self, angles, pts, radians=False, pushoff=1e-5):
+ """
+ Transform a set of angles anchored at specific locations.
+
+ Parameters
+ ----------
+ angles : (N,) array-like
+ The angles to transform.
+ pts : (N, 2) array-like
+ The points where the angles are anchored.
+ radians : bool, default: False
+ Whether *angles* are radians or degrees.
+ pushoff : float
+ For each point in *pts* and angle in *angles*, the transformed
+ angle is computed by transforming a segment of length *pushoff*
+ starting at that point and making that angle relative to the
+ horizontal axis, and measuring the angle between the horizontal
+ axis and the transformed segment.
+
+ Returns
+ -------
+ (N,) array
+ """
+ # Must be 2D
+ if self.input_dims != 2 or self.output_dims != 2:
+ raise NotImplementedError('Only defined in 2D')
+ angles = np.asarray(angles)
+ pts = np.asarray(pts)
+ _api.check_shape((None, 2), pts=pts)
+ _api.check_shape((None,), angles=angles)
+ if len(angles) != len(pts):
+ raise ValueError("There must be as many 'angles' as 'pts'")
+ # Convert to radians if desired
+ if not radians:
+ angles = np.deg2rad(angles)
+ # Move a short distance away
+ pts2 = pts + pushoff * np.column_stack([np.cos(angles),
+ np.sin(angles)])
+ # Transform both sets of points
+ tpts = self.transform(pts)
+ tpts2 = self.transform(pts2)
+ # Calculate transformed angles
+ d = tpts2 - tpts
+ a = np.arctan2(d[:, 1], d[:, 0])
+ # Convert back to degrees if desired
+ if not radians:
+ a = np.rad2deg(a)
+ return a
+
+ def inverted(self):
+ """
+ Return the corresponding inverse transformation.
+
+ It holds ``x == self.inverted().transform(self.transform(x))``.
+
+ The return value of this method should be treated as
+ temporary. An update to *self* does not cause a corresponding
+ update to its inverted copy.
+ """
+ raise NotImplementedError()
+
+
+class TransformWrapper(Transform):
+ """
+ A helper class that holds a single child transform and acts
+ equivalently to it.
+
+ This is useful if a node of the transform tree must be replaced at
+ run time with a transform of a different type. This class allows
+ that replacement to correctly trigger invalidation.
+
+ `TransformWrapper` instances must have the same input and output dimensions
+ during their entire lifetime, so the child transform may only be replaced
+ with another child transform of the same dimensions.
+ """
+
+ pass_through = True
+
+ def __init__(self, child):
+ """
+ *child*: A `Transform` instance. This child may later
+ be replaced with :meth:`set`.
+ """
+ _api.check_isinstance(Transform, child=child)
+ super().__init__()
+ self.set(child)
+
+ def __eq__(self, other):
+ return self._child.__eq__(other)
+
+ __str__ = _make_str_method("_child")
+
+ def frozen(self):
+ # docstring inherited
+ return self._child.frozen()
+
+ def set(self, child):
+ """
+ Replace the current child of this transform with another one.
+
+ The new child must have the same number of input and output
+ dimensions as the current child.
+ """
+ if hasattr(self, "_child"): # Absent during init.
+ self.invalidate()
+ new_dims = (child.input_dims, child.output_dims)
+ old_dims = (self._child.input_dims, self._child.output_dims)
+ if new_dims != old_dims:
+ raise ValueError(
+ f"The input and output dims of the new child {new_dims} "
+ f"do not match those of current child {old_dims}")
+ self._child._parents.pop(id(self), None)
+
+ self._child = child
+ self.set_children(child)
+
+ self.transform = child.transform
+ self.transform_affine = child.transform_affine
+ self.transform_non_affine = child.transform_non_affine
+ self.transform_path = child.transform_path
+ self.transform_path_affine = child.transform_path_affine
+ self.transform_path_non_affine = child.transform_path_non_affine
+ self.get_affine = child.get_affine
+ self.inverted = child.inverted
+ self.get_matrix = child.get_matrix
+ # note we do not wrap other properties here since the transform's
+ # child can be changed with WrappedTransform.set and so checking
+ # is_affine and other such properties may be dangerous.
+
+ self._invalid = 0
+ self.invalidate()
+ self._invalid = 0
+
+ input_dims = property(lambda self: self._child.input_dims)
+ output_dims = property(lambda self: self._child.output_dims)
+ is_affine = property(lambda self: self._child.is_affine)
+ is_separable = property(lambda self: self._child.is_separable)
+ has_inverse = property(lambda self: self._child.has_inverse)
+
+
+class AffineBase(Transform):
+ """
+ The base class of all affine transformations of any number of dimensions.
+ """
+ is_affine = True
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self._inverted = None
+
+ def __array__(self, *args, **kwargs):
+ # optimises the access of the transform matrix vs. the superclass
+ return self.get_matrix()
+
+ def __eq__(self, other):
+ if getattr(other, "is_affine", False) and hasattr(other, "get_matrix"):
+ return (self.get_matrix() == other.get_matrix()).all()
+ return NotImplemented
+
+ def transform(self, values):
+ # docstring inherited
+ return self.transform_affine(values)
+
+ def transform_affine(self, values):
+ # docstring inherited
+ raise NotImplementedError('Affine subclasses should override this '
+ 'method.')
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ return values
+
+ def transform_path(self, path):
+ # docstring inherited
+ return self.transform_path_affine(path)
+
+ def transform_path_affine(self, path):
+ # docstring inherited
+ return Path(self.transform_affine(path.vertices),
+ path.codes, path._interpolation_steps)
+
+ def transform_path_non_affine(self, path):
+ # docstring inherited
+ return path
+
+ def get_affine(self):
+ # docstring inherited
+ return self
+
+
+class Affine2DBase(AffineBase):
+ """
+ The base class of all 2D affine transformations.
+
+ 2D affine transformations are performed using a 3x3 numpy array::
+
+ a c e
+ b d f
+ 0 0 1
+
+ This class provides the read-only interface. For a mutable 2D
+ affine transformation, use `Affine2D`.
+
+ Subclasses of this class will generally only need to override a
+ constructor and `~.Transform.get_matrix` that generates a custom 3x3 matrix.
+ """
+ input_dims = 2
+ output_dims = 2
+
+ def frozen(self):
+ # docstring inherited
+ return Affine2D(self.get_matrix().copy())
+
+ @property
+ def is_separable(self):
+ mtx = self.get_matrix()
+ return mtx[0, 1] == mtx[1, 0] == 0.0
+
+ def to_values(self):
+ """
+ Return the values of the matrix as an ``(a, b, c, d, e, f)`` tuple.
+ """
+ mtx = self.get_matrix()
+ return tuple(mtx[:2].swapaxes(0, 1).flat)
+
+ def transform_affine(self, values):
+ mtx = self.get_matrix()
+ if isinstance(values, np.ma.MaskedArray):
+ tpoints = affine_transform(values.data, mtx)
+ return np.ma.MaskedArray(tpoints, mask=np.ma.getmask(values))
+ return affine_transform(values, mtx)
+
+ if DEBUG:
+ _transform_affine = transform_affine
+
+ def transform_affine(self, values):
+ # docstring inherited
+ # The major speed trap here is just converting to the
+ # points to an array in the first place. If we can use
+ # more arrays upstream, that should help here.
+ if not isinstance(values, np.ndarray):
+ _api.warn_external(
+ f'A non-numpy array of type {type(values)} was passed in '
+ f'for transformation, which results in poor performance.')
+ return self._transform_affine(values)
+
+ def inverted(self):
+ # docstring inherited
+ if self._inverted is None or self._invalid:
+ mtx = self.get_matrix()
+ shorthand_name = None
+ if self._shorthand_name:
+ shorthand_name = '(%s)-1' % self._shorthand_name
+ self._inverted = Affine2D(inv(mtx), shorthand_name=shorthand_name)
+ self._invalid = 0
+ return self._inverted
+
+
+class Affine2D(Affine2DBase):
+ """
+ A mutable 2D affine transformation.
+ """
+
+ def __init__(self, matrix=None, **kwargs):
+ """
+ Initialize an Affine transform from a 3x3 numpy float array::
+
+ a c e
+ b d f
+ 0 0 1
+
+ If *matrix* is None, initialize with the identity transform.
+ """
+ super().__init__(**kwargs)
+ if matrix is None:
+ # A bit faster than np.identity(3).
+ matrix = IdentityTransform._mtx
+ self._mtx = matrix.copy()
+ self._invalid = 0
+
+ _base_str = _make_str_method("_mtx")
+
+ def __str__(self):
+ return (self._base_str()
+ if (self._mtx != np.diag(np.diag(self._mtx))).any()
+ else f"Affine2D().scale({self._mtx[0, 0]}, {self._mtx[1, 1]})"
+ if self._mtx[0, 0] != self._mtx[1, 1]
+ else f"Affine2D().scale({self._mtx[0, 0]})")
+
+ @staticmethod
+ def from_values(a, b, c, d, e, f):
+ """
+ Create a new Affine2D instance from the given values::
+
+ a c e
+ b d f
+ 0 0 1
+
+ .
+ """
+ return Affine2D(
+ np.array([a, c, e, b, d, f, 0.0, 0.0, 1.0], float).reshape((3, 3)))
+
+ def get_matrix(self):
+ """
+ Get the underlying transformation matrix as a 3x3 array::
+
+ a c e
+ b d f
+ 0 0 1
+
+ .
+ """
+ if self._invalid:
+ self._inverted = None
+ self._invalid = 0
+ return self._mtx
+
+ def set_matrix(self, mtx):
+ """
+ Set the underlying transformation matrix from a 3x3 array::
+
+ a c e
+ b d f
+ 0 0 1
+
+ .
+ """
+ self._mtx = mtx
+ self.invalidate()
+
+ def set(self, other):
+ """
+ Set this transformation from the frozen copy of another
+ `Affine2DBase` object.
+ """
+ _api.check_isinstance(Affine2DBase, other=other)
+ self._mtx = other.get_matrix()
+ self.invalidate()
+
+ def clear(self):
+ """
+ Reset the underlying matrix to the identity transform.
+ """
+ # A bit faster than np.identity(3).
+ self._mtx = IdentityTransform._mtx.copy()
+ self.invalidate()
+ return self
+
+ def rotate(self, theta):
+ """
+ Add a rotation (in radians) to this transform in place.
+
+ Returns *self*, so this method can easily be chained with more
+ calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
+ and :meth:`scale`.
+ """
+ a = math.cos(theta)
+ b = math.sin(theta)
+ mtx = self._mtx
+ # Operating and assigning one scalar at a time is much faster.
+ (xx, xy, x0), (yx, yy, y0), _ = mtx.tolist()
+ # mtx = [[a -b 0], [b a 0], [0 0 1]] * mtx
+ mtx[0, 0] = a * xx - b * yx
+ mtx[0, 1] = a * xy - b * yy
+ mtx[0, 2] = a * x0 - b * y0
+ mtx[1, 0] = b * xx + a * yx
+ mtx[1, 1] = b * xy + a * yy
+ mtx[1, 2] = b * x0 + a * y0
+ self.invalidate()
+ return self
+
+ def rotate_deg(self, degrees):
+ """
+ Add a rotation (in degrees) to this transform in place.
+
+ Returns *self*, so this method can easily be chained with more
+ calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
+ and :meth:`scale`.
+ """
+ return self.rotate(math.radians(degrees))
+
+ def rotate_around(self, x, y, theta):
+ """
+ Add a rotation (in radians) around the point (x, y) in place.
+
+ Returns *self*, so this method can easily be chained with more
+ calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
+ and :meth:`scale`.
+ """
+ return self.translate(-x, -y).rotate(theta).translate(x, y)
+
+ def rotate_deg_around(self, x, y, degrees):
+ """
+ Add a rotation (in degrees) around the point (x, y) in place.
+
+ Returns *self*, so this method can easily be chained with more
+ calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
+ and :meth:`scale`.
+ """
+ # Cast to float to avoid wraparound issues with uint8's
+ x, y = float(x), float(y)
+ return self.translate(-x, -y).rotate_deg(degrees).translate(x, y)
+
+ def translate(self, tx, ty):
+ """
+ Add a translation in place.
+
+ Returns *self*, so this method can easily be chained with more
+ calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
+ and :meth:`scale`.
+ """
+ self._mtx[0, 2] += tx
+ self._mtx[1, 2] += ty
+ self.invalidate()
+ return self
+
+ def scale(self, sx, sy=None):
+ """
+ Add a scale in place.
+
+ If *sy* is None, the same scale is applied in both the *x*- and
+ *y*-directions.
+
+ Returns *self*, so this method can easily be chained with more
+ calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
+ and :meth:`scale`.
+ """
+ if sy is None:
+ sy = sx
+ # explicit element-wise scaling is fastest
+ self._mtx[0, 0] *= sx
+ self._mtx[0, 1] *= sx
+ self._mtx[0, 2] *= sx
+ self._mtx[1, 0] *= sy
+ self._mtx[1, 1] *= sy
+ self._mtx[1, 2] *= sy
+ self.invalidate()
+ return self
+
+ def skew(self, xShear, yShear):
+ """
+ Add a skew in place.
+
+ *xShear* and *yShear* are the shear angles along the *x*- and
+ *y*-axes, respectively, in radians.
+
+ Returns *self*, so this method can easily be chained with more
+ calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
+ and :meth:`scale`.
+ """
+ rx = math.tan(xShear)
+ ry = math.tan(yShear)
+ mtx = self._mtx
+ # Operating and assigning one scalar at a time is much faster.
+ (xx, xy, x0), (yx, yy, y0), _ = mtx.tolist()
+ # mtx = [[1 rx 0], [ry 1 0], [0 0 1]] * mtx
+ mtx[0, 0] += rx * yx
+ mtx[0, 1] += rx * yy
+ mtx[0, 2] += rx * y0
+ mtx[1, 0] += ry * xx
+ mtx[1, 1] += ry * xy
+ mtx[1, 2] += ry * x0
+ self.invalidate()
+ return self
+
+ def skew_deg(self, xShear, yShear):
+ """
+ Add a skew in place.
+
+ *xShear* and *yShear* are the shear angles along the *x*- and
+ *y*-axes, respectively, in degrees.
+
+ Returns *self*, so this method can easily be chained with more
+ calls to :meth:`rotate`, :meth:`rotate_deg`, :meth:`translate`
+ and :meth:`scale`.
+ """
+ return self.skew(math.radians(xShear), math.radians(yShear))
+
+
+class IdentityTransform(Affine2DBase):
+ """
+ A special class that does one thing, the identity transform, in a
+ fast way.
+ """
+ _mtx = np.identity(3)
+
+ def frozen(self):
+ # docstring inherited
+ return self
+
+ __str__ = _make_str_method()
+
+ def get_matrix(self):
+ # docstring inherited
+ return self._mtx
+
+ def transform(self, values):
+ # docstring inherited
+ return np.asanyarray(values)
+
+ def transform_affine(self, values):
+ # docstring inherited
+ return np.asanyarray(values)
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ return np.asanyarray(values)
+
+ def transform_path(self, path):
+ # docstring inherited
+ return path
+
+ def transform_path_affine(self, path):
+ # docstring inherited
+ return path
+
+ def transform_path_non_affine(self, path):
+ # docstring inherited
+ return path
+
+ def get_affine(self):
+ # docstring inherited
+ return self
+
+ def inverted(self):
+ # docstring inherited
+ return self
+
+
+class _BlendedMixin:
+ """Common methods for `BlendedGenericTransform` and `BlendedAffine2D`."""
+
+ def __eq__(self, other):
+ if isinstance(other, (BlendedAffine2D, BlendedGenericTransform)):
+ return (self._x == other._x) and (self._y == other._y)
+ elif self._x == self._y:
+ return self._x == other
+ else:
+ return NotImplemented
+
+ def contains_branch_seperately(self, transform):
+ return (self._x.contains_branch(transform),
+ self._y.contains_branch(transform))
+
+ __str__ = _make_str_method("_x", "_y")
+
+
+class BlendedGenericTransform(_BlendedMixin, Transform):
+ """
+ A "blended" transform uses one transform for the *x*-direction, and
+ another transform for the *y*-direction.
+
+ This "generic" version can handle any given child transform in the
+ *x*- and *y*-directions.
+ """
+ input_dims = 2
+ output_dims = 2
+ is_separable = True
+ pass_through = True
+
+ def __init__(self, x_transform, y_transform, **kwargs):
+ """
+ Create a new "blended" transform using *x_transform* to transform the
+ *x*-axis and *y_transform* to transform the *y*-axis.
+
+ You will generally not call this constructor directly but use the
+ `blended_transform_factory` function instead, which can determine
+ automatically which kind of blended transform to create.
+ """
+ Transform.__init__(self, **kwargs)
+ self._x = x_transform
+ self._y = y_transform
+ self.set_children(x_transform, y_transform)
+ self._affine = None
+
+ @property
+ def depth(self):
+ return max(self._x.depth, self._y.depth)
+
+ def contains_branch(self, other):
+ # A blended transform cannot possibly contain a branch from two
+ # different transforms.
+ return False
+
+ is_affine = property(lambda self: self._x.is_affine and self._y.is_affine)
+ has_inverse = property(
+ lambda self: self._x.has_inverse and self._y.has_inverse)
+
+ def frozen(self):
+ # docstring inherited
+ return blended_transform_factory(self._x.frozen(), self._y.frozen())
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ if self._x.is_affine and self._y.is_affine:
+ return values
+ x = self._x
+ y = self._y
+
+ if x == y and x.input_dims == 2:
+ return x.transform_non_affine(values)
+
+ if x.input_dims == 2:
+ x_points = x.transform_non_affine(values)[:, 0:1]
+ else:
+ x_points = x.transform_non_affine(values[:, 0])
+ x_points = x_points.reshape((len(x_points), 1))
+
+ if y.input_dims == 2:
+ y_points = y.transform_non_affine(values)[:, 1:]
+ else:
+ y_points = y.transform_non_affine(values[:, 1])
+ y_points = y_points.reshape((len(y_points), 1))
+
+ if (isinstance(x_points, np.ma.MaskedArray) or
+ isinstance(y_points, np.ma.MaskedArray)):
+ return np.ma.concatenate((x_points, y_points), 1)
+ else:
+ return np.concatenate((x_points, y_points), 1)
+
+ def inverted(self):
+ # docstring inherited
+ return BlendedGenericTransform(self._x.inverted(), self._y.inverted())
+
+ def get_affine(self):
+ # docstring inherited
+ if self._invalid or self._affine is None:
+ if self._x == self._y:
+ self._affine = self._x.get_affine()
+ else:
+ x_mtx = self._x.get_affine().get_matrix()
+ y_mtx = self._y.get_affine().get_matrix()
+ # We already know the transforms are separable, so we can skip
+ # setting b and c to zero.
+ mtx = np.array([x_mtx[0], y_mtx[1], [0.0, 0.0, 1.0]])
+ self._affine = Affine2D(mtx)
+ self._invalid = 0
+ return self._affine
+
+
+class BlendedAffine2D(_BlendedMixin, Affine2DBase):
+ """
+ A "blended" transform uses one transform for the *x*-direction, and
+ another transform for the *y*-direction.
+
+ This version is an optimization for the case where both child
+ transforms are of type `Affine2DBase`.
+ """
+
+ is_separable = True
+
+ def __init__(self, x_transform, y_transform, **kwargs):
+ """
+ Create a new "blended" transform using *x_transform* to transform the
+ *x*-axis and *y_transform* to transform the *y*-axis.
+
+ Both *x_transform* and *y_transform* must be 2D affine transforms.
+
+ You will generally not call this constructor directly but use the
+ `blended_transform_factory` function instead, which can determine
+ automatically which kind of blended transform to create.
+ """
+ is_affine = x_transform.is_affine and y_transform.is_affine
+ is_separable = x_transform.is_separable and y_transform.is_separable
+ is_correct = is_affine and is_separable
+ if not is_correct:
+ raise ValueError("Both *x_transform* and *y_transform* must be 2D "
+ "affine transforms")
+
+ Transform.__init__(self, **kwargs)
+ self._x = x_transform
+ self._y = y_transform
+ self.set_children(x_transform, y_transform)
+
+ Affine2DBase.__init__(self)
+ self._mtx = None
+
+ def get_matrix(self):
+ # docstring inherited
+ if self._invalid:
+ if self._x == self._y:
+ self._mtx = self._x.get_matrix()
+ else:
+ x_mtx = self._x.get_matrix()
+ y_mtx = self._y.get_matrix()
+ # We already know the transforms are separable, so we can skip
+ # setting b and c to zero.
+ self._mtx = np.array([x_mtx[0], y_mtx[1], [0.0, 0.0, 1.0]])
+ self._inverted = None
+ self._invalid = 0
+ return self._mtx
+
+
+def blended_transform_factory(x_transform, y_transform):
+ """
+ Create a new "blended" transform using *x_transform* to transform
+ the *x*-axis and *y_transform* to transform the *y*-axis.
+
+ A faster version of the blended transform is returned for the case
+ where both child transforms are affine.
+ """
+ if (isinstance(x_transform, Affine2DBase) and
+ isinstance(y_transform, Affine2DBase)):
+ return BlendedAffine2D(x_transform, y_transform)
+ return BlendedGenericTransform(x_transform, y_transform)
+
+
+class CompositeGenericTransform(Transform):
+ """
+ A composite transform formed by applying transform *a* then
+ transform *b*.
+
+ This "generic" version can handle any two arbitrary
+ transformations.
+ """
+ pass_through = True
+
+ def __init__(self, a, b, **kwargs):
+ """
+ Create a new composite transform that is the result of
+ applying transform *a* then transform *b*.
+
+ You will generally not call this constructor directly but write ``a +
+ b`` instead, which will automatically choose the best kind of composite
+ transform instance to create.
+ """
+ if a.output_dims != b.input_dims:
+ raise ValueError("The output dimension of 'a' must be equal to "
+ "the input dimensions of 'b'")
+ self.input_dims = a.input_dims
+ self.output_dims = b.output_dims
+
+ super().__init__(**kwargs)
+ self._a = a
+ self._b = b
+ self.set_children(a, b)
+
+ def frozen(self):
+ # docstring inherited
+ self._invalid = 0
+ frozen = composite_transform_factory(
+ self._a.frozen(), self._b.frozen())
+ if not isinstance(frozen, CompositeGenericTransform):
+ return frozen.frozen()
+ return frozen
+
+ def _invalidate_internal(self, level, invalidating_node):
+ # When the left child is invalidated at AFFINE_ONLY level and the right child is
+ # non-affine, the composite transform is FULLY invalidated.
+ if invalidating_node is self._a and not self._b.is_affine:
+ level = Transform._INVALID_FULL
+ super()._invalidate_internal(level, invalidating_node)
+
+ def __eq__(self, other):
+ if isinstance(other, (CompositeGenericTransform, CompositeAffine2D)):
+ return self is other or (self._a == other._a
+ and self._b == other._b)
+ else:
+ return False
+
+ def _iter_break_from_left_to_right(self):
+ for left, right in self._a._iter_break_from_left_to_right():
+ yield left, right + self._b
+ for left, right in self._b._iter_break_from_left_to_right():
+ yield self._a + left, right
+
+ def contains_branch_seperately(self, other_transform):
+ # docstring inherited
+ if self.output_dims != 2:
+ raise ValueError('contains_branch_seperately only supports '
+ 'transforms with 2 output dimensions')
+ if self == other_transform:
+ return (True, True)
+ return self._b.contains_branch_seperately(other_transform)
+
+ depth = property(lambda self: self._a.depth + self._b.depth)
+ is_affine = property(lambda self: self._a.is_affine and self._b.is_affine)
+ is_separable = property(
+ lambda self: self._a.is_separable and self._b.is_separable)
+ has_inverse = property(
+ lambda self: self._a.has_inverse and self._b.has_inverse)
+
+ __str__ = _make_str_method("_a", "_b")
+
+ def transform_affine(self, values):
+ # docstring inherited
+ return self.get_affine().transform(values)
+
+ def transform_non_affine(self, values):
+ # docstring inherited
+ if self._a.is_affine and self._b.is_affine:
+ return values
+ elif not self._a.is_affine and self._b.is_affine:
+ return self._a.transform_non_affine(values)
+ else:
+ return self._b.transform_non_affine(self._a.transform(values))
+
+ def transform_path_non_affine(self, path):
+ # docstring inherited
+ if self._a.is_affine and self._b.is_affine:
+ return path
+ elif not self._a.is_affine and self._b.is_affine:
+ return self._a.transform_path_non_affine(path)
+ else:
+ return self._b.transform_path_non_affine(
+ self._a.transform_path(path))
+
+ def get_affine(self):
+ # docstring inherited
+ if not self._b.is_affine:
+ return self._b.get_affine()
+ else:
+ return Affine2D(np.dot(self._b.get_affine().get_matrix(),
+ self._a.get_affine().get_matrix()))
+
+ def inverted(self):
+ # docstring inherited
+ return CompositeGenericTransform(
+ self._b.inverted(), self._a.inverted())
+
+
+class CompositeAffine2D(Affine2DBase):
+ """
+ A composite transform formed by applying transform *a* then transform *b*.
+
+ This version is an optimization that handles the case where both *a*
+ and *b* are 2D affines.
+ """
+ def __init__(self, a, b, **kwargs):
+ """
+ Create a new composite transform that is the result of
+ applying `Affine2DBase` *a* then `Affine2DBase` *b*.
+
+ You will generally not call this constructor directly but write ``a +
+ b`` instead, which will automatically choose the best kind of composite
+ transform instance to create.
+ """
+ if not a.is_affine or not b.is_affine:
+ raise ValueError("'a' and 'b' must be affine transforms")
+ if a.output_dims != b.input_dims:
+ raise ValueError("The output dimension of 'a' must be equal to "
+ "the input dimensions of 'b'")
+ self.input_dims = a.input_dims
+ self.output_dims = b.output_dims
+
+ super().__init__(**kwargs)
+ self._a = a
+ self._b = b
+ self.set_children(a, b)
+ self._mtx = None
+
+ @property
+ def depth(self):
+ return self._a.depth + self._b.depth
+
+ def _iter_break_from_left_to_right(self):
+ for left, right in self._a._iter_break_from_left_to_right():
+ yield left, right + self._b
+ for left, right in self._b._iter_break_from_left_to_right():
+ yield self._a + left, right
+
+ __str__ = _make_str_method("_a", "_b")
+
+ def get_matrix(self):
+ # docstring inherited
+ if self._invalid:
+ self._mtx = np.dot(
+ self._b.get_matrix(),
+ self._a.get_matrix())
+ self._inverted = None
+ self._invalid = 0
+ return self._mtx
+
+
+def composite_transform_factory(a, b):
+ """
+ Create a new composite transform that is the result of applying
+ transform a then transform b.
+
+ Shortcut versions of the blended transform are provided for the
+ case where both child transforms are affine, or one or the other
+ is the identity transform.
+
+ Composite transforms may also be created using the '+' operator,
+ e.g.::
+
+ c = a + b
+ """
+ # check to see if any of a or b are IdentityTransforms. We use
+ # isinstance here to guarantee that the transforms will *always*
+ # be IdentityTransforms. Since TransformWrappers are mutable,
+ # use of equality here would be wrong.
+ if isinstance(a, IdentityTransform):
+ return b
+ elif isinstance(b, IdentityTransform):
+ return a
+ elif isinstance(a, Affine2D) and isinstance(b, Affine2D):
+ return CompositeAffine2D(a, b)
+ return CompositeGenericTransform(a, b)
+
+
+class BboxTransform(Affine2DBase):
+ """
+ `BboxTransform` linearly transforms points from one `Bbox` to another.
+ """
+
+ is_separable = True
+
+ def __init__(self, boxin, boxout, **kwargs):
+ """
+ Create a new `BboxTransform` that linearly transforms
+ points from *boxin* to *boxout*.
+ """
+ _api.check_isinstance(BboxBase, boxin=boxin, boxout=boxout)
+
+ super().__init__(**kwargs)
+ self._boxin = boxin
+ self._boxout = boxout
+ self.set_children(boxin, boxout)
+ self._mtx = None
+ self._inverted = None
+
+ __str__ = _make_str_method("_boxin", "_boxout")
+
+ def get_matrix(self):
+ # docstring inherited
+ if self._invalid:
+ inl, inb, inw, inh = self._boxin.bounds
+ outl, outb, outw, outh = self._boxout.bounds
+ x_scale = outw / inw
+ y_scale = outh / inh
+ if DEBUG and (x_scale == 0 or y_scale == 0):
+ raise ValueError(
+ "Transforming from or to a singular bounding box")
+ self._mtx = np.array([[x_scale, 0.0, -inl*x_scale+outl],
+ [ 0.0, y_scale, -inb*y_scale+outb],
+ [ 0.0, 0.0, 1.0]],
+ float)
+ self._inverted = None
+ self._invalid = 0
+ return self._mtx
+
+
+class BboxTransformTo(Affine2DBase):
+ """
+ `BboxTransformTo` is a transformation that linearly transforms points from
+ the unit bounding box to a given `Bbox`.
+ """
+
+ is_separable = True
+
+ def __init__(self, boxout, **kwargs):
+ """
+ Create a new `BboxTransformTo` that linearly transforms
+ points from the unit bounding box to *boxout*.
+ """
+ _api.check_isinstance(BboxBase, boxout=boxout)
+
+ super().__init__(**kwargs)
+ self._boxout = boxout
+ self.set_children(boxout)
+ self._mtx = None
+ self._inverted = None
+
+ __str__ = _make_str_method("_boxout")
+
+ def get_matrix(self):
+ # docstring inherited
+ if self._invalid:
+ outl, outb, outw, outh = self._boxout.bounds
+ if DEBUG and (outw == 0 or outh == 0):
+ raise ValueError("Transforming to a singular bounding box.")
+ self._mtx = np.array([[outw, 0.0, outl],
+ [ 0.0, outh, outb],
+ [ 0.0, 0.0, 1.0]],
+ float)
+ self._inverted = None
+ self._invalid = 0
+ return self._mtx
+
+
+@_api.deprecated("3.9")
+class BboxTransformToMaxOnly(BboxTransformTo):
+ """
+ `BboxTransformToMaxOnly` is a transformation that linearly transforms points from
+ the unit bounding box to a given `Bbox` with a fixed upper left of (0, 0).
+ """
+ def get_matrix(self):
+ # docstring inherited
+ if self._invalid:
+ xmax, ymax = self._boxout.max
+ if DEBUG and (xmax == 0 or ymax == 0):
+ raise ValueError("Transforming to a singular bounding box.")
+ self._mtx = np.array([[xmax, 0.0, 0.0],
+ [ 0.0, ymax, 0.0],
+ [ 0.0, 0.0, 1.0]],
+ float)
+ self._inverted = None
+ self._invalid = 0
+ return self._mtx
+
+
+class BboxTransformFrom(Affine2DBase):
+ """
+ `BboxTransformFrom` linearly transforms points from a given `Bbox` to the
+ unit bounding box.
+ """
+ is_separable = True
+
+ def __init__(self, boxin, **kwargs):
+ _api.check_isinstance(BboxBase, boxin=boxin)
+
+ super().__init__(**kwargs)
+ self._boxin = boxin
+ self.set_children(boxin)
+ self._mtx = None
+ self._inverted = None
+
+ __str__ = _make_str_method("_boxin")
+
+ def get_matrix(self):
+ # docstring inherited
+ if self._invalid:
+ inl, inb, inw, inh = self._boxin.bounds
+ if DEBUG and (inw == 0 or inh == 0):
+ raise ValueError("Transforming from a singular bounding box.")
+ x_scale = 1.0 / inw
+ y_scale = 1.0 / inh
+ self._mtx = np.array([[x_scale, 0.0, -inl*x_scale],
+ [ 0.0, y_scale, -inb*y_scale],
+ [ 0.0, 0.0, 1.0]],
+ float)
+ self._inverted = None
+ self._invalid = 0
+ return self._mtx
+
+
+class ScaledTranslation(Affine2DBase):
+ """
+ A transformation that translates by *xt* and *yt*, after *xt* and *yt*
+ have been transformed by *scale_trans*.
+ """
+ def __init__(self, xt, yt, scale_trans, **kwargs):
+ super().__init__(**kwargs)
+ self._t = (xt, yt)
+ self._scale_trans = scale_trans
+ self.set_children(scale_trans)
+ self._mtx = None
+ self._inverted = None
+
+ __str__ = _make_str_method("_t")
+
+ def get_matrix(self):
+ # docstring inherited
+ if self._invalid:
+ # A bit faster than np.identity(3).
+ self._mtx = IdentityTransform._mtx.copy()
+ self._mtx[:2, 2] = self._scale_trans.transform(self._t)
+ self._invalid = 0
+ self._inverted = None
+ return self._mtx
+
+
+class _ScaledRotation(Affine2DBase):
+ """
+ A transformation that applies rotation by *theta*, after transform by *trans_shift*.
+ """
+ def __init__(self, theta, trans_shift):
+ super().__init__()
+ self._theta = theta
+ self._trans_shift = trans_shift
+ self._mtx = None
+
+ def get_matrix(self):
+ if self._invalid:
+ transformed_coords = self._trans_shift.transform([[self._theta, 0]])[0]
+ adjusted_theta = transformed_coords[0]
+ rotation = Affine2D().rotate(adjusted_theta)
+ self._mtx = rotation.get_matrix()
+ return self._mtx
+
+
+class AffineDeltaTransform(Affine2DBase):
+ r"""
+ A transform wrapper for transforming displacements between pairs of points.
+
+ This class is intended to be used to transform displacements ("position
+ deltas") between pairs of points (e.g., as the ``offset_transform``
+ of `.Collection`\s): given a transform ``t`` such that ``t =
+ AffineDeltaTransform(t) + offset``, ``AffineDeltaTransform``
+ satisfies ``AffineDeltaTransform(a - b) == AffineDeltaTransform(a) -
+ AffineDeltaTransform(b)``.
+
+ This is implemented by forcing the offset components of the transform
+ matrix to zero.
+
+ This class is experimental as of 3.3, and the API may change.
+ """
+
+ pass_through = True
+
+ def __init__(self, transform, **kwargs):
+ super().__init__(**kwargs)
+ self._base_transform = transform
+ self.set_children(transform)
+
+ __str__ = _make_str_method("_base_transform")
+
+ def get_matrix(self):
+ if self._invalid:
+ self._mtx = self._base_transform.get_matrix().copy()
+ self._mtx[:2, -1] = 0
+ return self._mtx
+
+
+class TransformedPath(TransformNode):
+ """
+ A `TransformedPath` caches a non-affine transformed copy of the
+ `~.path.Path`. This cached copy is automatically updated when the
+ non-affine part of the transform changes.
+
+ .. note::
+
+ Paths are considered immutable by this class. Any update to the
+ path's vertices/codes will not trigger a transform recomputation.
+
+ """
+ def __init__(self, path, transform):
+ """
+ Parameters
+ ----------
+ path : `~.path.Path`
+ transform : `Transform`
+ """
+ _api.check_isinstance(Transform, transform=transform)
+ super().__init__()
+ self._path = path
+ self._transform = transform
+ self.set_children(transform)
+ self._transformed_path = None
+ self._transformed_points = None
+
+ def _revalidate(self):
+ # only recompute if the invalidation includes the non_affine part of
+ # the transform
+ if (self._invalid == self._INVALID_FULL
+ or self._transformed_path is None):
+ self._transformed_path = \
+ self._transform.transform_path_non_affine(self._path)
+ self._transformed_points = \
+ Path._fast_from_codes_and_verts(
+ self._transform.transform_non_affine(self._path.vertices),
+ None, self._path)
+ self._invalid = 0
+
+ def get_transformed_points_and_affine(self):
+ """
+ Return a copy of the child path, with the non-affine part of
+ the transform already applied, along with the affine part of
+ the path necessary to complete the transformation. Unlike
+ :meth:`get_transformed_path_and_affine`, no interpolation will
+ be performed.
+ """
+ self._revalidate()
+ return self._transformed_points, self.get_affine()
+
+ def get_transformed_path_and_affine(self):
+ """
+ Return a copy of the child path, with the non-affine part of
+ the transform already applied, along with the affine part of
+ the path necessary to complete the transformation.
+ """
+ self._revalidate()
+ return self._transformed_path, self.get_affine()
+
+ def get_fully_transformed_path(self):
+ """
+ Return a fully-transformed copy of the child path.
+ """
+ self._revalidate()
+ return self._transform.transform_path_affine(self._transformed_path)
+
+ def get_affine(self):
+ return self._transform.get_affine()
+
+
+class TransformedPatchPath(TransformedPath):
+ """
+ A `TransformedPatchPath` caches a non-affine transformed copy of the
+ `~.patches.Patch`. This cached copy is automatically updated when the
+ non-affine part of the transform or the patch changes.
+ """
+
+ def __init__(self, patch):
+ """
+ Parameters
+ ----------
+ patch : `~.patches.Patch`
+ """
+ # Defer to TransformedPath.__init__.
+ super().__init__(patch.get_path(), patch.get_transform())
+ self._patch = patch
+
+ def _revalidate(self):
+ patch_path = self._patch.get_path()
+ # Force invalidation if the patch path changed; otherwise, let base
+ # class check invalidation.
+ if patch_path != self._path:
+ self._path = patch_path
+ self._transformed_path = None
+ super()._revalidate()
+
+
+def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True):
+ """
+ Modify the endpoints of a range as needed to avoid singularities.
+
+ Parameters
+ ----------
+ vmin, vmax : float
+ The initial endpoints.
+ expander : float, default: 0.001
+ Fractional amount by which *vmin* and *vmax* are expanded if
+ the original interval is too small, based on *tiny*.
+ tiny : float, default: 1e-15
+ Threshold for the ratio of the interval to the maximum absolute
+ value of its endpoints. If the interval is smaller than
+ this, it will be expanded. This value should be around
+ 1e-15 or larger; otherwise the interval will be approaching
+ the double precision resolution limit.
+ increasing : bool, default: True
+ If True, swap *vmin*, *vmax* if *vmin* > *vmax*.
+
+ Returns
+ -------
+ vmin, vmax : float
+ Endpoints, expanded and/or swapped if necessary.
+ If either input is inf or NaN, or if both inputs are 0 or very
+ close to zero, it returns -*expander*, *expander*.
+ """
+
+ if (not np.isfinite(vmin)) or (not np.isfinite(vmax)):
+ return -expander, expander
+
+ swapped = False
+ if vmax < vmin:
+ vmin, vmax = vmax, vmin
+ swapped = True
+
+ # Expand vmin, vmax to float: if they were integer types, they can wrap
+ # around in abs (abs(np.int8(-128)) == -128) and vmax - vmin can overflow.
+ vmin, vmax = map(float, [vmin, vmax])
+
+ maxabsvalue = max(abs(vmin), abs(vmax))
+ if maxabsvalue < (1e6 / tiny) * np.finfo(float).tiny:
+ vmin = -expander
+ vmax = expander
+
+ elif vmax - vmin <= maxabsvalue * tiny:
+ if vmax == 0 and vmin == 0:
+ vmin = -expander
+ vmax = expander
+ else:
+ vmin -= expander*abs(vmin)
+ vmax += expander*abs(vmax)
+
+ if swapped and not increasing:
+ vmin, vmax = vmax, vmin
+ return vmin, vmax
+
+
+def interval_contains(interval, val):
+ """
+ Check, inclusively, whether an interval includes a given value.
+
+ Parameters
+ ----------
+ interval : (float, float)
+ The endpoints of the interval.
+ val : float
+ Value to check is within interval.
+
+ Returns
+ -------
+ bool
+ Whether *val* is within the *interval*.
+ """
+ a, b = interval
+ if a > b:
+ a, b = b, a
+ return a <= val <= b
+
+
+def _interval_contains_close(interval, val, rtol=1e-10):
+ """
+ Check, inclusively, whether an interval includes a given value, with the
+ interval expanded by a small tolerance to admit floating point errors.
+
+ Parameters
+ ----------
+ interval : (float, float)
+ The endpoints of the interval.
+ val : float
+ Value to check is within interval.
+ rtol : float, default: 1e-10
+ Relative tolerance slippage allowed outside of the interval.
+ For an interval ``[a, b]``, values
+ ``a - rtol * (b - a) <= val <= b + rtol * (b - a)`` are considered
+ inside the interval.
+
+ Returns
+ -------
+ bool
+ Whether *val* is within the *interval* (with tolerance).
+ """
+ a, b = interval
+ if a > b:
+ a, b = b, a
+ rtol = (b - a) * rtol
+ return a - rtol <= val <= b + rtol
+
+
+def interval_contains_open(interval, val):
+ """
+ Check, excluding endpoints, whether an interval includes a given value.
+
+ Parameters
+ ----------
+ interval : (float, float)
+ The endpoints of the interval.
+ val : float
+ Value to check is within interval.
+
+ Returns
+ -------
+ bool
+ Whether *val* is within the *interval*.
+ """
+ a, b = interval
+ return a < val < b or a > val > b
+
+
+def offset_copy(trans, fig=None, x=0.0, y=0.0, units='inches'):
+ """
+ Return a new transform with an added offset.
+
+ Parameters
+ ----------
+ trans : `Transform` subclass
+ Any transform, to which offset will be applied.
+ fig : `~matplotlib.figure.Figure`, default: None
+ Current figure. It can be None if *units* are 'dots'.
+ x, y : float, default: 0.0
+ The offset to apply.
+ units : {'inches', 'points', 'dots'}, default: 'inches'
+ Units of the offset.
+
+ Returns
+ -------
+ `Transform` subclass
+ Transform with applied offset.
+ """
+ _api.check_in_list(['dots', 'points', 'inches'], units=units)
+ if units == 'dots':
+ return trans + Affine2D().translate(x, y)
+ if fig is None:
+ raise ValueError('For units of inches or points a fig kwarg is needed')
+ if units == 'points':
+ x /= 72.0
+ y /= 72.0
+ # Default units are 'inches'
+ return trans + ScaledTranslation(x, y, fig.dpi_scale_trans)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/transforms.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/transforms.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..551487a11c6015ba392d32fa1a86b5c7b61090e5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/transforms.pyi
@@ -0,0 +1,341 @@
+from .path import Path
+from .patches import Patch
+from .figure import Figure
+import numpy as np
+from numpy.typing import ArrayLike
+from collections.abc import Iterable, Sequence
+from typing import Literal
+
+DEBUG: bool
+
+class TransformNode:
+ INVALID_NON_AFFINE: int
+ INVALID_AFFINE: int
+ INVALID: int
+ is_bbox: bool
+ # Implemented as a standard attr in base class, but functionally readonly and some subclasses implement as such
+ @property
+ def is_affine(self) -> bool: ...
+ pass_through: bool
+ def __init__(self, shorthand_name: str | None = ...) -> None: ...
+ def __copy__(self) -> TransformNode: ...
+ def invalidate(self) -> None: ...
+ def set_children(self, *children: TransformNode) -> None: ...
+ def frozen(self) -> TransformNode: ...
+
+class BboxBase(TransformNode):
+ is_bbox: bool
+ is_affine: bool
+ def frozen(self) -> Bbox: ...
+ def __array__(self, *args, **kwargs): ...
+ @property
+ def x0(self) -> float: ...
+ @property
+ def y0(self) -> float: ...
+ @property
+ def x1(self) -> float: ...
+ @property
+ def y1(self) -> float: ...
+ @property
+ def p0(self) -> tuple[float, float]: ...
+ @property
+ def p1(self) -> tuple[float, float]: ...
+ @property
+ def xmin(self) -> float: ...
+ @property
+ def ymin(self) -> float: ...
+ @property
+ def xmax(self) -> float: ...
+ @property
+ def ymax(self) -> float: ...
+ @property
+ def min(self) -> tuple[float, float]: ...
+ @property
+ def max(self) -> tuple[float, float]: ...
+ @property
+ def intervalx(self) -> tuple[float, float]: ...
+ @property
+ def intervaly(self) -> tuple[float, float]: ...
+ @property
+ def width(self) -> float: ...
+ @property
+ def height(self) -> float: ...
+ @property
+ def size(self) -> tuple[float, float]: ...
+ @property
+ def bounds(self) -> tuple[float, float, float, float]: ...
+ @property
+ def extents(self) -> tuple[float, float, float, float]: ...
+ def get_points(self) -> np.ndarray: ...
+ def containsx(self, x: float) -> bool: ...
+ def containsy(self, y: float) -> bool: ...
+ def contains(self, x: float, y: float) -> bool: ...
+ def overlaps(self, other: BboxBase) -> bool: ...
+ def fully_containsx(self, x: float) -> bool: ...
+ def fully_containsy(self, y: float) -> bool: ...
+ def fully_contains(self, x: float, y: float) -> bool: ...
+ def fully_overlaps(self, other: BboxBase) -> bool: ...
+ def transformed(self, transform: Transform) -> Bbox: ...
+ coefs: dict[str, tuple[float, float]]
+ def anchored(
+ self,
+ c: tuple[float, float] | Literal['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'],
+ container: BboxBase,
+ ) -> Bbox: ...
+ def shrunk(self, mx: float, my: float) -> Bbox: ...
+ def shrunk_to_aspect(
+ self,
+ box_aspect: float,
+ container: BboxBase | None = ...,
+ fig_aspect: float = ...,
+ ) -> Bbox: ...
+ def splitx(self, *args: float) -> list[Bbox]: ...
+ def splity(self, *args: float) -> list[Bbox]: ...
+ def count_contains(self, vertices: ArrayLike) -> int: ...
+ def count_overlaps(self, bboxes: Iterable[BboxBase]) -> int: ...
+ def expanded(self, sw: float, sh: float) -> Bbox: ...
+ def padded(self, w_pad: float, h_pad: float | None = ...) -> Bbox: ...
+ def translated(self, tx: float, ty: float) -> Bbox: ...
+ def corners(self) -> np.ndarray: ...
+ def rotated(self, radians: float) -> Bbox: ...
+ @staticmethod
+ def union(bboxes: Sequence[BboxBase]) -> Bbox: ...
+ @staticmethod
+ def intersection(bbox1: BboxBase, bbox2: BboxBase) -> Bbox | None: ...
+
+class Bbox(BboxBase):
+ def __init__(self, points: ArrayLike, **kwargs) -> None: ...
+ @staticmethod
+ def unit() -> Bbox: ...
+ @staticmethod
+ def null() -> Bbox: ...
+ @staticmethod
+ def from_bounds(x0: float, y0: float, width: float, height: float) -> Bbox: ...
+ @staticmethod
+ def from_extents(*args: float, minpos: float | None = ...) -> Bbox: ...
+ def __format__(self, fmt: str) -> str: ...
+ def ignore(self, value: bool) -> None: ...
+ def update_from_path(
+ self,
+ path: Path,
+ ignore: bool | None = ...,
+ updatex: bool = ...,
+ updatey: bool = ...,
+ ) -> None: ...
+ def update_from_data_x(self, x: ArrayLike, ignore: bool | None = ...) -> None: ...
+ def update_from_data_y(self, y: ArrayLike, ignore: bool | None = ...) -> None: ...
+ def update_from_data_xy(
+ self,
+ xy: ArrayLike,
+ ignore: bool | None = ...,
+ updatex: bool = ...,
+ updatey: bool = ...,
+ ) -> None: ...
+ @property
+ def minpos(self) -> float: ...
+ @property
+ def minposx(self) -> float: ...
+ @property
+ def minposy(self) -> float: ...
+ def get_points(self) -> np.ndarray: ...
+ def set_points(self, points: ArrayLike) -> None: ...
+ def set(self, other: Bbox) -> None: ...
+ def mutated(self) -> bool: ...
+ def mutatedx(self) -> bool: ...
+ def mutatedy(self) -> bool: ...
+
+class TransformedBbox(BboxBase):
+ def __init__(self, bbox: Bbox, transform: Transform, **kwargs) -> None: ...
+ def get_points(self) -> np.ndarray: ...
+
+class LockableBbox(BboxBase):
+ def __init__(
+ self,
+ bbox: BboxBase,
+ x0: float | None = ...,
+ y0: float | None = ...,
+ x1: float | None = ...,
+ y1: float | None = ...,
+ **kwargs
+ ) -> None: ...
+ @property
+ def locked_x0(self) -> float | None: ...
+ @locked_x0.setter
+ def locked_x0(self, x0: float | None) -> None: ...
+ @property
+ def locked_y0(self) -> float | None: ...
+ @locked_y0.setter
+ def locked_y0(self, y0: float | None) -> None: ...
+ @property
+ def locked_x1(self) -> float | None: ...
+ @locked_x1.setter
+ def locked_x1(self, x1: float | None) -> None: ...
+ @property
+ def locked_y1(self) -> float | None: ...
+ @locked_y1.setter
+ def locked_y1(self, y1: float | None) -> None: ...
+
+class Transform(TransformNode):
+
+ # Implemented as a standard attrs in base class, but functionally readonly and some subclasses implement as such
+ @property
+ def input_dims(self) -> int | None: ...
+ @property
+ def output_dims(self) -> int | None: ...
+ @property
+ def is_separable(self) -> bool: ...
+ @property
+ def has_inverse(self) -> bool: ...
+
+ def __add__(self, other: Transform) -> Transform: ...
+ @property
+ def depth(self) -> int: ...
+ def contains_branch(self, other: Transform) -> bool: ...
+ def contains_branch_seperately(
+ self, other_transform: Transform
+ ) -> Sequence[bool]: ...
+ def __sub__(self, other: Transform) -> Transform: ...
+ def __array__(self, *args, **kwargs) -> np.ndarray: ...
+ def transform(self, values: ArrayLike) -> np.ndarray: ...
+ def transform_affine(self, values: ArrayLike) -> np.ndarray: ...
+ def transform_non_affine(self, values: ArrayLike) -> ArrayLike: ...
+ def transform_bbox(self, bbox: BboxBase) -> Bbox: ...
+ def get_affine(self) -> Transform: ...
+ def get_matrix(self) -> np.ndarray: ...
+ def transform_point(self, point: ArrayLike) -> np.ndarray: ...
+ def transform_path(self, path: Path) -> Path: ...
+ def transform_path_affine(self, path: Path) -> Path: ...
+ def transform_path_non_affine(self, path: Path) -> Path: ...
+ def transform_angles(
+ self,
+ angles: ArrayLike,
+ pts: ArrayLike,
+ radians: bool = ...,
+ pushoff: float = ...,
+ ) -> np.ndarray: ...
+ def inverted(self) -> Transform: ...
+
+class TransformWrapper(Transform):
+ pass_through: bool
+ def __init__(self, child: Transform) -> None: ...
+ def __eq__(self, other: object) -> bool: ...
+ def frozen(self) -> Transform: ...
+ def set(self, child: Transform) -> None: ...
+
+class AffineBase(Transform):
+ is_affine: Literal[True]
+ def __init__(self, *args, **kwargs) -> None: ...
+ def __eq__(self, other: object) -> bool: ...
+
+class Affine2DBase(AffineBase):
+ input_dims: Literal[2]
+ output_dims: Literal[2]
+ def frozen(self) -> Affine2D: ...
+ def to_values(self) -> tuple[float, float, float, float, float, float]: ...
+
+class Affine2D(Affine2DBase):
+ def __init__(self, matrix: ArrayLike | None = ..., **kwargs) -> None: ...
+ @staticmethod
+ def from_values(
+ a: float, b: float, c: float, d: float, e: float, f: float
+ ) -> Affine2D: ...
+ def set_matrix(self, mtx: ArrayLike) -> None: ...
+ def clear(self) -> Affine2D: ...
+ def rotate(self, theta: float) -> Affine2D: ...
+ def rotate_deg(self, degrees: float) -> Affine2D: ...
+ def rotate_around(self, x: float, y: float, theta: float) -> Affine2D: ...
+ def rotate_deg_around(self, x: float, y: float, degrees: float) -> Affine2D: ...
+ def translate(self, tx: float, ty: float) -> Affine2D: ...
+ def scale(self, sx: float, sy: float | None = ...) -> Affine2D: ...
+ def skew(self, xShear: float, yShear: float) -> Affine2D: ...
+ def skew_deg(self, xShear: float, yShear: float) -> Affine2D: ...
+
+class IdentityTransform(Affine2DBase): ...
+
+class _BlendedMixin:
+ def __eq__(self, other: object) -> bool: ...
+ def contains_branch_seperately(self, transform: Transform) -> Sequence[bool]: ...
+
+class BlendedGenericTransform(_BlendedMixin, Transform):
+ input_dims: Literal[2]
+ output_dims: Literal[2]
+ pass_through: bool
+ def __init__(
+ self, x_transform: Transform, y_transform: Transform, **kwargs
+ ) -> None: ...
+ @property
+ def depth(self) -> int: ...
+ def contains_branch(self, other: Transform) -> Literal[False]: ...
+ @property
+ def is_affine(self) -> bool: ...
+
+class BlendedAffine2D(_BlendedMixin, Affine2DBase):
+ def __init__(
+ self, x_transform: Transform, y_transform: Transform, **kwargs
+ ) -> None: ...
+
+def blended_transform_factory(
+ x_transform: Transform, y_transform: Transform
+) -> BlendedGenericTransform | BlendedAffine2D: ...
+
+class CompositeGenericTransform(Transform):
+ pass_through: bool
+ def __init__(self, a: Transform, b: Transform, **kwargs) -> None: ...
+
+class CompositeAffine2D(Affine2DBase):
+ def __init__(self, a: Affine2DBase, b: Affine2DBase, **kwargs) -> None: ...
+ @property
+ def depth(self) -> int: ...
+
+def composite_transform_factory(a: Transform, b: Transform) -> Transform: ...
+
+class BboxTransform(Affine2DBase):
+ def __init__(self, boxin: BboxBase, boxout: BboxBase, **kwargs) -> None: ...
+
+class BboxTransformTo(Affine2DBase):
+ def __init__(self, boxout: BboxBase, **kwargs) -> None: ...
+
+class BboxTransformToMaxOnly(BboxTransformTo): ...
+
+class BboxTransformFrom(Affine2DBase):
+ def __init__(self, boxin: BboxBase, **kwargs) -> None: ...
+
+class ScaledTranslation(Affine2DBase):
+ def __init__(
+ self, xt: float, yt: float, scale_trans: Affine2DBase, **kwargs
+ ) -> None: ...
+
+class AffineDeltaTransform(Affine2DBase):
+ def __init__(self, transform: Affine2DBase, **kwargs) -> None: ...
+
+class TransformedPath(TransformNode):
+ def __init__(self, path: Path, transform: Transform) -> None: ...
+ def get_transformed_points_and_affine(self) -> tuple[Path, Transform]: ...
+ def get_transformed_path_and_affine(self) -> tuple[Path, Transform]: ...
+ def get_fully_transformed_path(self) -> Path: ...
+ def get_affine(self) -> Transform: ...
+
+class TransformedPatchPath(TransformedPath):
+ def __init__(self, patch: Patch) -> None: ...
+
+def nonsingular(
+ vmin: float,
+ vmax: float,
+ expander: float = ...,
+ tiny: float = ...,
+ increasing: bool = ...,
+) -> tuple[float, float]: ...
+def interval_contains(interval: tuple[float, float], val: float) -> bool: ...
+def interval_contains_open(interval: tuple[float, float], val: float) -> bool: ...
+def offset_copy(
+ trans: Transform,
+ fig: Figure | None = ...,
+ x: float = ...,
+ y: float = ...,
+ units: Literal["inches", "points", "dots"] = ...,
+) -> Transform: ...
+
+
+class _ScaledRotation(Affine2DBase):
+ def __init__(self, theta: float, trans_shift: Transform) -> None: ...
+ def get_matrix(self) -> np.ndarray: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e000831d8a080a4bf6e8af758b1d978755c2bd14
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__init__.py
@@ -0,0 +1,23 @@
+"""
+Unstructured triangular grid functions.
+"""
+
+from ._triangulation import Triangulation
+from ._tricontour import TriContourSet, tricontour, tricontourf
+from ._trifinder import TriFinder, TrapezoidMapTriFinder
+from ._triinterpolate import (TriInterpolator, LinearTriInterpolator,
+ CubicTriInterpolator)
+from ._tripcolor import tripcolor
+from ._triplot import triplot
+from ._trirefine import TriRefiner, UniformTriRefiner
+from ._tritools import TriAnalyzer
+
+
+__all__ = ["Triangulation",
+ "TriContourSet", "tricontour", "tricontourf",
+ "TriFinder", "TrapezoidMapTriFinder",
+ "TriInterpolator", "LinearTriInterpolator", "CubicTriInterpolator",
+ "tripcolor",
+ "triplot",
+ "TriRefiner", "UniformTriRefiner",
+ "TriAnalyzer"]
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..66ad8de111abde3afddbda1805c955ef1c212d0e
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triangulation.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triangulation.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..97b009c4f90ea8039a9e3c9f0c19b95b602dfa98
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triangulation.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tricontour.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tricontour.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c34d7170968ede6cd4a1892251c5e9fccf25714a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tricontour.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_trifinder.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_trifinder.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e2859599f6a2495e60431c962e7360204b75bb47
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_trifinder.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triinterpolate.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triinterpolate.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..2ad652d658be89ceb2c6ce0d9a777da791d1f7b7
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triinterpolate.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tripcolor.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tripcolor.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8cc106d140ed88cbd8343e0dd1b24477641c2110
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tripcolor.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triplot.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triplot.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b9066acc8d8763658dffa88f6593541c11c600b8
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_triplot.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_trirefine.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_trirefine.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d6f14d3c5d76edaa20dc615d341fff5c0a8f7174
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_trirefine.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tritools.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tritools.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fd8231f34e5c8b89af2c94e20a154a2c837a2b47
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/__pycache__/_tritools.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triangulation.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triangulation.py
new file mode 100644
index 0000000000000000000000000000000000000000..a07192dfc8cac08a102be6ef3b22047f264a5099
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triangulation.py
@@ -0,0 +1,247 @@
+import sys
+
+import numpy as np
+
+from matplotlib import _api
+
+
+class Triangulation:
+ """
+ An unstructured triangular grid consisting of npoints points and
+ ntri triangles. The triangles can either be specified by the user
+ or automatically generated using a Delaunay triangulation.
+
+ Parameters
+ ----------
+ x, y : (npoints,) array-like
+ Coordinates of grid points.
+ triangles : (ntri, 3) array-like of int, optional
+ For each triangle, the indices of the three points that make
+ up the triangle, ordered in an anticlockwise manner. If not
+ specified, the Delaunay triangulation is calculated.
+ mask : (ntri,) array-like of bool, optional
+ Which triangles are masked out.
+
+ Attributes
+ ----------
+ triangles : (ntri, 3) array of int
+ For each triangle, the indices of the three points that make
+ up the triangle, ordered in an anticlockwise manner. If you want to
+ take the *mask* into account, use `get_masked_triangles` instead.
+ mask : (ntri, 3) array of bool or None
+ Masked out triangles.
+ is_delaunay : bool
+ Whether the Triangulation is a calculated Delaunay
+ triangulation (where *triangles* was not specified) or not.
+
+ Notes
+ -----
+ For a Triangulation to be valid it must not have duplicate points,
+ triangles formed from colinear points, or overlapping triangles.
+ """
+ def __init__(self, x, y, triangles=None, mask=None):
+ from matplotlib import _qhull
+
+ self.x = np.asarray(x, dtype=np.float64)
+ self.y = np.asarray(y, dtype=np.float64)
+ if self.x.shape != self.y.shape or self.x.ndim != 1:
+ raise ValueError("x and y must be equal-length 1D arrays, but "
+ f"found shapes {self.x.shape!r} and "
+ f"{self.y.shape!r}")
+
+ self.mask = None
+ self._edges = None
+ self._neighbors = None
+ self.is_delaunay = False
+
+ if triangles is None:
+ # No triangulation specified, so use matplotlib._qhull to obtain
+ # Delaunay triangulation.
+ self.triangles, self._neighbors = _qhull.delaunay(x, y, sys.flags.verbose)
+ self.is_delaunay = True
+ else:
+ # Triangulation specified. Copy, since we may correct triangle
+ # orientation.
+ try:
+ self.triangles = np.array(triangles, dtype=np.int32, order='C')
+ except ValueError as e:
+ raise ValueError('triangles must be a (N, 3) int array, not '
+ f'{triangles!r}') from e
+ if self.triangles.ndim != 2 or self.triangles.shape[1] != 3:
+ raise ValueError(
+ 'triangles must be a (N, 3) int array, but found shape '
+ f'{self.triangles.shape!r}')
+ if self.triangles.max() >= len(self.x):
+ raise ValueError(
+ 'triangles are indices into the points and must be in the '
+ f'range 0 <= i < {len(self.x)} but found value '
+ f'{self.triangles.max()}')
+ if self.triangles.min() < 0:
+ raise ValueError(
+ 'triangles are indices into the points and must be in the '
+ f'range 0 <= i < {len(self.x)} but found value '
+ f'{self.triangles.min()}')
+
+ # Underlying C++ object is not created until first needed.
+ self._cpp_triangulation = None
+
+ # Default TriFinder not created until needed.
+ self._trifinder = None
+
+ self.set_mask(mask)
+
+ def calculate_plane_coefficients(self, z):
+ """
+ Calculate plane equation coefficients for all unmasked triangles from
+ the point (x, y) coordinates and specified z-array of shape (npoints).
+ The returned array has shape (npoints, 3) and allows z-value at (x, y)
+ position in triangle tri to be calculated using
+ ``z = array[tri, 0] * x + array[tri, 1] * y + array[tri, 2]``.
+ """
+ return self.get_cpp_triangulation().calculate_plane_coefficients(z)
+
+ @property
+ def edges(self):
+ """
+ Return integer array of shape (nedges, 2) containing all edges of
+ non-masked triangles.
+
+ Each row defines an edge by its start point index and end point
+ index. Each edge appears only once, i.e. for an edge between points
+ *i* and *j*, there will only be either *(i, j)* or *(j, i)*.
+ """
+ if self._edges is None:
+ self._edges = self.get_cpp_triangulation().get_edges()
+ return self._edges
+
+ def get_cpp_triangulation(self):
+ """
+ Return the underlying C++ Triangulation object, creating it
+ if necessary.
+ """
+ from matplotlib import _tri
+ if self._cpp_triangulation is None:
+ self._cpp_triangulation = _tri.Triangulation(
+ # For unset arrays use empty tuple which has size of zero.
+ self.x, self.y, self.triangles,
+ self.mask if self.mask is not None else (),
+ self._edges if self._edges is not None else (),
+ self._neighbors if self._neighbors is not None else (),
+ not self.is_delaunay)
+ return self._cpp_triangulation
+
+ def get_masked_triangles(self):
+ """
+ Return an array of triangles taking the mask into account.
+ """
+ if self.mask is not None:
+ return self.triangles[~self.mask]
+ else:
+ return self.triangles
+
+ @staticmethod
+ def get_from_args_and_kwargs(*args, **kwargs):
+ """
+ Return a Triangulation object from the args and kwargs, and
+ the remaining args and kwargs with the consumed values removed.
+
+ There are two alternatives: either the first argument is a
+ Triangulation object, in which case it is returned, or the args
+ and kwargs are sufficient to create a new Triangulation to
+ return. In the latter case, see Triangulation.__init__ for
+ the possible args and kwargs.
+ """
+ if isinstance(args[0], Triangulation):
+ triangulation, *args = args
+ if 'triangles' in kwargs:
+ _api.warn_external(
+ "Passing the keyword 'triangles' has no effect when also "
+ "passing a Triangulation")
+ if 'mask' in kwargs:
+ _api.warn_external(
+ "Passing the keyword 'mask' has no effect when also "
+ "passing a Triangulation")
+ else:
+ x, y, triangles, mask, args, kwargs = \
+ Triangulation._extract_triangulation_params(args, kwargs)
+ triangulation = Triangulation(x, y, triangles, mask)
+ return triangulation, args, kwargs
+
+ @staticmethod
+ def _extract_triangulation_params(args, kwargs):
+ x, y, *args = args
+ # Check triangles in kwargs then args.
+ triangles = kwargs.pop('triangles', None)
+ from_args = False
+ if triangles is None and args:
+ triangles = args[0]
+ from_args = True
+ if triangles is not None:
+ try:
+ triangles = np.asarray(triangles, dtype=np.int32)
+ except ValueError:
+ triangles = None
+ if triangles is not None and (triangles.ndim != 2 or
+ triangles.shape[1] != 3):
+ triangles = None
+ if triangles is not None and from_args:
+ args = args[1:] # Consumed first item in args.
+ # Check for mask in kwargs.
+ mask = kwargs.pop('mask', None)
+ return x, y, triangles, mask, args, kwargs
+
+ def get_trifinder(self):
+ """
+ Return the default `matplotlib.tri.TriFinder` of this
+ triangulation, creating it if necessary. This allows the same
+ TriFinder object to be easily shared.
+ """
+ if self._trifinder is None:
+ # Default TriFinder class.
+ from matplotlib.tri._trifinder import TrapezoidMapTriFinder
+ self._trifinder = TrapezoidMapTriFinder(self)
+ return self._trifinder
+
+ @property
+ def neighbors(self):
+ """
+ Return integer array of shape (ntri, 3) containing neighbor triangles.
+
+ For each triangle, the indices of the three triangles that
+ share the same edges, or -1 if there is no such neighboring
+ triangle. ``neighbors[i, j]`` is the triangle that is the neighbor
+ to the edge from point index ``triangles[i, j]`` to point index
+ ``triangles[i, (j+1)%3]``.
+ """
+ if self._neighbors is None:
+ self._neighbors = self.get_cpp_triangulation().get_neighbors()
+ return self._neighbors
+
+ def set_mask(self, mask):
+ """
+ Set or clear the mask array.
+
+ Parameters
+ ----------
+ mask : None or bool array of length ntri
+ """
+ if mask is None:
+ self.mask = None
+ else:
+ self.mask = np.asarray(mask, dtype=bool)
+ if self.mask.shape != (self.triangles.shape[0],):
+ raise ValueError('mask array must have same length as '
+ 'triangles array')
+
+ # Set mask in C++ Triangulation.
+ if self._cpp_triangulation is not None:
+ self._cpp_triangulation.set_mask(
+ self.mask if self.mask is not None else ())
+
+ # Clear derived fields so they are recalculated when needed.
+ self._edges = None
+ self._neighbors = None
+
+ # Recalculate TriFinder if it exists.
+ if self._trifinder is not None:
+ self._trifinder._initialize()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triangulation.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triangulation.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..6e00b272eda93554db53b9fc98e9b4f1b94fbebd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triangulation.pyi
@@ -0,0 +1,33 @@
+from matplotlib import _tri
+from matplotlib.tri._trifinder import TriFinder
+
+import numpy as np
+from numpy.typing import ArrayLike
+from typing import Any
+
+class Triangulation:
+ x: np.ndarray
+ y: np.ndarray
+ mask: np.ndarray | None
+ is_delaunay: bool
+ triangles: np.ndarray
+ def __init__(
+ self,
+ x: ArrayLike,
+ y: ArrayLike,
+ triangles: ArrayLike | None = ...,
+ mask: ArrayLike | None = ...,
+ ) -> None: ...
+ def calculate_plane_coefficients(self, z: ArrayLike) -> np.ndarray: ...
+ @property
+ def edges(self) -> np.ndarray: ...
+ def get_cpp_triangulation(self) -> _tri.Triangulation: ...
+ def get_masked_triangles(self) -> np.ndarray: ...
+ @staticmethod
+ def get_from_args_and_kwargs(
+ *args, **kwargs
+ ) -> tuple[Triangulation, tuple[Any, ...], dict[str, Any]]: ...
+ def get_trifinder(self) -> TriFinder: ...
+ @property
+ def neighbors(self) -> np.ndarray: ...
+ def set_mask(self, mask: None | ArrayLike) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tricontour.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tricontour.py
new file mode 100644
index 0000000000000000000000000000000000000000..8250515f3ef8fde7fecb57cc441b7f1ea50b95f0
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tricontour.py
@@ -0,0 +1,270 @@
+import numpy as np
+
+from matplotlib import _docstring
+from matplotlib.contour import ContourSet
+from matplotlib.tri._triangulation import Triangulation
+
+
+@_docstring.interpd
+class TriContourSet(ContourSet):
+ """
+ Create and store a set of contour lines or filled regions for
+ a triangular grid.
+
+ This class is typically not instantiated directly by the user but by
+ `~.Axes.tricontour` and `~.Axes.tricontourf`.
+
+ %(contour_set_attributes)s
+ """
+ def __init__(self, ax, *args, **kwargs):
+ """
+ Draw triangular grid contour lines or filled regions,
+ depending on whether keyword arg *filled* is False
+ (default) or True.
+
+ The first argument of the initializer must be an `~.axes.Axes`
+ object. The remaining arguments and keyword arguments
+ are described in the docstring of `~.Axes.tricontour`.
+ """
+ super().__init__(ax, *args, **kwargs)
+
+ def _process_args(self, *args, **kwargs):
+ """
+ Process args and kwargs.
+ """
+ if isinstance(args[0], TriContourSet):
+ C = args[0]._contour_generator
+ if self.levels is None:
+ self.levels = args[0].levels
+ self.zmin = args[0].zmin
+ self.zmax = args[0].zmax
+ self._mins = args[0]._mins
+ self._maxs = args[0]._maxs
+ else:
+ from matplotlib import _tri
+ tri, z = self._contour_args(args, kwargs)
+ C = _tri.TriContourGenerator(tri.get_cpp_triangulation(), z)
+ self._mins = [tri.x.min(), tri.y.min()]
+ self._maxs = [tri.x.max(), tri.y.max()]
+
+ self._contour_generator = C
+ return kwargs
+
+ def _contour_args(self, args, kwargs):
+ tri, args, kwargs = Triangulation.get_from_args_and_kwargs(*args,
+ **kwargs)
+ z, *args = args
+ z = np.ma.asarray(z)
+ if z.shape != tri.x.shape:
+ raise ValueError('z array must have same length as triangulation x'
+ ' and y arrays')
+
+ # z values must be finite, only need to check points that are included
+ # in the triangulation.
+ z_check = z[np.unique(tri.get_masked_triangles())]
+ if np.ma.is_masked(z_check):
+ raise ValueError('z must not contain masked points within the '
+ 'triangulation')
+ if not np.isfinite(z_check).all():
+ raise ValueError('z array must not contain non-finite values '
+ 'within the triangulation')
+
+ z = np.ma.masked_invalid(z, copy=False)
+ self.zmax = float(z_check.max())
+ self.zmin = float(z_check.min())
+ if self.logscale and self.zmin <= 0:
+ func = 'contourf' if self.filled else 'contour'
+ raise ValueError(f'Cannot {func} log of negative values.')
+ self._process_contour_level_args(args, z.dtype)
+ return (tri, z)
+
+
+_docstring.interpd.register(_tricontour_doc="""
+Draw contour %%(type)s on an unstructured triangular grid.
+
+Call signatures::
+
+ %%(func)s(triangulation, z, [levels], ...)
+ %%(func)s(x, y, z, [levels], *, [triangles=triangles], [mask=mask], ...)
+
+The triangular grid can be specified either by passing a `.Triangulation`
+object as the first parameter, or by passing the points *x*, *y* and
+optionally the *triangles* and a *mask*. See `.Triangulation` for an
+explanation of these parameters. If neither of *triangulation* or
+*triangles* are given, the triangulation is calculated on the fly.
+
+It is possible to pass *triangles* positionally, i.e.
+``%%(func)s(x, y, triangles, z, ...)``. However, this is discouraged. For more
+clarity, pass *triangles* via keyword argument.
+
+Parameters
+----------
+triangulation : `.Triangulation`, optional
+ An already created triangular grid.
+
+x, y, triangles, mask
+ Parameters defining the triangular grid. See `.Triangulation`.
+ This is mutually exclusive with specifying *triangulation*.
+
+z : array-like
+ The height values over which the contour is drawn. Color-mapping is
+ controlled by *cmap*, *norm*, *vmin*, and *vmax*.
+
+ .. note::
+ All values in *z* must be finite. Hence, nan and inf values must
+ either be removed or `~.Triangulation.set_mask` be used.
+
+levels : int or array-like, optional
+ Determines the number and positions of the contour lines / regions.
+
+ If an int *n*, use `~matplotlib.ticker.MaxNLocator`, which tries to
+ automatically choose no more than *n+1* "nice" contour levels between
+ between minimum and maximum numeric values of *Z*.
+
+ If array-like, draw contour lines at the specified levels. The values must
+ be in increasing order.
+
+Returns
+-------
+`~matplotlib.tri.TriContourSet`
+
+Other Parameters
+----------------
+colors : :mpltype:`color` or list of :mpltype:`color`, optional
+ The colors of the levels, i.e., the contour %%(type)s.
+
+ The sequence is cycled for the levels in ascending order. If the sequence
+ is shorter than the number of levels, it is repeated.
+
+ As a shortcut, single color strings may be used in place of one-element
+ lists, i.e. ``'red'`` instead of ``['red']`` to color all levels with the
+ same color. This shortcut does only work for color strings, not for other
+ ways of specifying colors.
+
+ By default (value *None*), the colormap specified by *cmap* will be used.
+
+alpha : float, default: 1
+ The alpha blending value, between 0 (transparent) and 1 (opaque).
+
+%(cmap_doc)s
+
+ This parameter is ignored if *colors* is set.
+
+%(norm_doc)s
+
+ This parameter is ignored if *colors* is set.
+
+%(vmin_vmax_doc)s
+
+ If *vmin* or *vmax* are not given, the default color scaling is based on
+ *levels*.
+
+ This parameter is ignored if *colors* is set.
+
+origin : {*None*, 'upper', 'lower', 'image'}, default: None
+ Determines the orientation and exact position of *z* by specifying the
+ position of ``z[0, 0]``. This is only relevant, if *X*, *Y* are not given.
+
+ - *None*: ``z[0, 0]`` is at X=0, Y=0 in the lower left corner.
+ - 'lower': ``z[0, 0]`` is at X=0.5, Y=0.5 in the lower left corner.
+ - 'upper': ``z[0, 0]`` is at X=N+0.5, Y=0.5 in the upper left corner.
+ - 'image': Use the value from :rc:`image.origin`.
+
+extent : (x0, x1, y0, y1), optional
+ If *origin* is not *None*, then *extent* is interpreted as in `.imshow`: it
+ gives the outer pixel boundaries. In this case, the position of z[0, 0] is
+ the center of the pixel, not a corner. If *origin* is *None*, then
+ (*x0*, *y0*) is the position of z[0, 0], and (*x1*, *y1*) is the position
+ of z[-1, -1].
+
+ This argument is ignored if *X* and *Y* are specified in the call to
+ contour.
+
+locator : ticker.Locator subclass, optional
+ The locator is used to determine the contour levels if they are not given
+ explicitly via *levels*.
+ Defaults to `~.ticker.MaxNLocator`.
+
+extend : {'neither', 'both', 'min', 'max'}, default: 'neither'
+ Determines the ``%%(func)s``-coloring of values that are outside the
+ *levels* range.
+
+ If 'neither', values outside the *levels* range are not colored. If 'min',
+ 'max' or 'both', color the values below, above or below and above the
+ *levels* range.
+
+ Values below ``min(levels)`` and above ``max(levels)`` are mapped to the
+ under/over values of the `.Colormap`. Note that most colormaps do not have
+ dedicated colors for these by default, so that the over and under values
+ are the edge values of the colormap. You may want to set these values
+ explicitly using `.Colormap.set_under` and `.Colormap.set_over`.
+
+ .. note::
+
+ An existing `.TriContourSet` does not get notified if properties of its
+ colormap are changed. Therefore, an explicit call to
+ `.ContourSet.changed()` is needed after modifying the colormap. The
+ explicit call can be left out, if a colorbar is assigned to the
+ `.TriContourSet` because it internally calls `.ContourSet.changed()`.
+
+xunits, yunits : registered units, optional
+ Override axis units by specifying an instance of a
+ :class:`matplotlib.units.ConversionInterface`.
+
+antialiased : bool, optional
+ Enable antialiasing, overriding the defaults. For
+ filled contours, the default is *True*. For line contours,
+ it is taken from :rc:`lines.antialiased`.""" % _docstring.interpd.params)
+
+
+@_docstring.Substitution(func='tricontour', type='lines')
+@_docstring.interpd
+def tricontour(ax, *args, **kwargs):
+ """
+ %(_tricontour_doc)s
+
+ linewidths : float or array-like, default: :rc:`contour.linewidth`
+ The line width of the contour lines.
+
+ If a number, all levels will be plotted with this linewidth.
+
+ If a sequence, the levels in ascending order will be plotted with
+ the linewidths in the order specified.
+
+ If None, this falls back to :rc:`lines.linewidth`.
+
+ linestyles : {*None*, 'solid', 'dashed', 'dashdot', 'dotted'}, optional
+ If *linestyles* is *None*, the default is 'solid' unless the lines are
+ monochrome. In that case, negative contours will take their linestyle
+ from :rc:`contour.negative_linestyle` setting.
+
+ *linestyles* can also be an iterable of the above strings specifying a
+ set of linestyles to be used. If this iterable is shorter than the
+ number of contour levels it will be repeated as necessary.
+ """
+ kwargs['filled'] = False
+ return TriContourSet(ax, *args, **kwargs)
+
+
+@_docstring.Substitution(func='tricontourf', type='regions')
+@_docstring.interpd
+def tricontourf(ax, *args, **kwargs):
+ """
+ %(_tricontour_doc)s
+
+ hatches : list[str], optional
+ A list of crosshatch patterns to use on the filled areas.
+ If None, no hatching will be added to the contour.
+
+ Notes
+ -----
+ `.tricontourf` fills intervals that are closed at the top; that is, for
+ boundaries *z1* and *z2*, the filled region is::
+
+ z1 < Z <= z2
+
+ except for the lowest interval, which is closed on both sides (i.e. it
+ includes the lowest value).
+ """
+ kwargs['filled'] = True
+ return TriContourSet(ax, *args, **kwargs)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tricontour.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tricontour.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..31929d8661560cce2d63e735c37163baca02c001
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tricontour.pyi
@@ -0,0 +1,52 @@
+from matplotlib.axes import Axes
+from matplotlib.contour import ContourSet
+from matplotlib.tri._triangulation import Triangulation
+
+from numpy.typing import ArrayLike
+from typing import overload
+
+# TODO: more explicit args/kwargs (for all things in this module)?
+
+class TriContourSet(ContourSet):
+ def __init__(self, ax: Axes, *args, **kwargs) -> None: ...
+
+@overload
+def tricontour(
+ ax: Axes,
+ triangulation: Triangulation,
+ z: ArrayLike,
+ levels: int | ArrayLike = ...,
+ **kwargs
+) -> TriContourSet: ...
+@overload
+def tricontour(
+ ax: Axes,
+ x: ArrayLike,
+ y: ArrayLike,
+ z: ArrayLike,
+ levels: int | ArrayLike = ...,
+ *,
+ triangles: ArrayLike = ...,
+ mask: ArrayLike = ...,
+ **kwargs
+) -> TriContourSet: ...
+@overload
+def tricontourf(
+ ax: Axes,
+ triangulation: Triangulation,
+ z: ArrayLike,
+ levels: int | ArrayLike = ...,
+ **kwargs
+) -> TriContourSet: ...
+@overload
+def tricontourf(
+ ax: Axes,
+ x: ArrayLike,
+ y: ArrayLike,
+ z: ArrayLike,
+ levels: int | ArrayLike = ...,
+ *,
+ triangles: ArrayLike = ...,
+ mask: ArrayLike = ...,
+ **kwargs
+) -> TriContourSet: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trifinder.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trifinder.py
new file mode 100644
index 0000000000000000000000000000000000000000..852f3d9eebccf1492a98e6bd8f327b87d5e014c8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trifinder.py
@@ -0,0 +1,96 @@
+import numpy as np
+
+from matplotlib import _api
+from matplotlib.tri import Triangulation
+
+
+class TriFinder:
+ """
+ Abstract base class for classes used to find the triangles of a
+ Triangulation in which (x, y) points lie.
+
+ Rather than instantiate an object of a class derived from TriFinder, it is
+ usually better to use the function `.Triangulation.get_trifinder`.
+
+ Derived classes implement __call__(x, y) where x and y are array-like point
+ coordinates of the same shape.
+ """
+
+ def __init__(self, triangulation):
+ _api.check_isinstance(Triangulation, triangulation=triangulation)
+ self._triangulation = triangulation
+
+ def __call__(self, x, y):
+ raise NotImplementedError
+
+
+class TrapezoidMapTriFinder(TriFinder):
+ """
+ `~matplotlib.tri.TriFinder` class implemented using the trapezoid
+ map algorithm from the book "Computational Geometry, Algorithms and
+ Applications", second edition, by M. de Berg, M. van Kreveld, M. Overmars
+ and O. Schwarzkopf.
+
+ The triangulation must be valid, i.e. it must not have duplicate points,
+ triangles formed from colinear points, or overlapping triangles. The
+ algorithm has some tolerance to triangles formed from colinear points, but
+ this should not be relied upon.
+ """
+
+ def __init__(self, triangulation):
+ from matplotlib import _tri
+ super().__init__(triangulation)
+ self._cpp_trifinder = _tri.TrapezoidMapTriFinder(
+ triangulation.get_cpp_triangulation())
+ self._initialize()
+
+ def __call__(self, x, y):
+ """
+ Return an array containing the indices of the triangles in which the
+ specified *x*, *y* points lie, or -1 for points that do not lie within
+ a triangle.
+
+ *x*, *y* are array-like x and y coordinates of the same shape and any
+ number of dimensions.
+
+ Returns integer array with the same shape and *x* and *y*.
+ """
+ x = np.asarray(x, dtype=np.float64)
+ y = np.asarray(y, dtype=np.float64)
+ if x.shape != y.shape:
+ raise ValueError("x and y must be array-like with the same shape")
+
+ # C++ does the heavy lifting, and expects 1D arrays.
+ indices = (self._cpp_trifinder.find_many(x.ravel(), y.ravel())
+ .reshape(x.shape))
+ return indices
+
+ def _get_tree_stats(self):
+ """
+ Return a python list containing the statistics about the node tree:
+ 0: number of nodes (tree size)
+ 1: number of unique nodes
+ 2: number of trapezoids (tree leaf nodes)
+ 3: number of unique trapezoids
+ 4: maximum parent count (max number of times a node is repeated in
+ tree)
+ 5: maximum depth of tree (one more than the maximum number of
+ comparisons needed to search through the tree)
+ 6: mean of all trapezoid depths (one more than the average number
+ of comparisons needed to search through the tree)
+ """
+ return self._cpp_trifinder.get_tree_stats()
+
+ def _initialize(self):
+ """
+ Initialize the underlying C++ object. Can be called multiple times if,
+ for example, the triangulation is modified.
+ """
+ self._cpp_trifinder.initialize()
+
+ def _print_tree(self):
+ """
+ Print a text representation of the node tree, which is useful for
+ debugging purposes.
+ """
+ self._cpp_trifinder.print_tree()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trifinder.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trifinder.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..41a9990b898826c3a5e455f4e91b5b3af6da83e7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trifinder.pyi
@@ -0,0 +1,10 @@
+from matplotlib.tri import Triangulation
+from numpy.typing import ArrayLike
+
+class TriFinder:
+ def __init__(self, triangulation: Triangulation) -> None: ...
+ def __call__(self, x: ArrayLike, y: ArrayLike) -> ArrayLike: ...
+
+class TrapezoidMapTriFinder(TriFinder):
+ def __init__(self, triangulation: Triangulation) -> None: ...
+ def __call__(self, x: ArrayLike, y: ArrayLike) -> ArrayLike: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triinterpolate.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triinterpolate.py
new file mode 100644
index 0000000000000000000000000000000000000000..90ad6cf3a76c45fa0fa2a607c6acee1cab1c5b05
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triinterpolate.py
@@ -0,0 +1,1574 @@
+"""
+Interpolation inside triangular grids.
+"""
+
+import numpy as np
+
+from matplotlib import _api
+from matplotlib.tri import Triangulation
+from matplotlib.tri._trifinder import TriFinder
+from matplotlib.tri._tritools import TriAnalyzer
+
+__all__ = ('TriInterpolator', 'LinearTriInterpolator', 'CubicTriInterpolator')
+
+
+class TriInterpolator:
+ """
+ Abstract base class for classes used to interpolate on a triangular grid.
+
+ Derived classes implement the following methods:
+
+ - ``__call__(x, y)``,
+ where x, y are array-like point coordinates of the same shape, and
+ that returns a masked array of the same shape containing the
+ interpolated z-values.
+
+ - ``gradient(x, y)``,
+ where x, y are array-like point coordinates of the same
+ shape, and that returns a list of 2 masked arrays of the same shape
+ containing the 2 derivatives of the interpolator (derivatives of
+ interpolated z values with respect to x and y).
+ """
+
+ def __init__(self, triangulation, z, trifinder=None):
+ _api.check_isinstance(Triangulation, triangulation=triangulation)
+ self._triangulation = triangulation
+
+ self._z = np.asarray(z)
+ if self._z.shape != self._triangulation.x.shape:
+ raise ValueError("z array must have same length as triangulation x"
+ " and y arrays")
+
+ _api.check_isinstance((TriFinder, None), trifinder=trifinder)
+ self._trifinder = trifinder or self._triangulation.get_trifinder()
+
+ # Default scaling factors : 1.0 (= no scaling)
+ # Scaling may be used for interpolations for which the order of
+ # magnitude of x, y has an impact on the interpolant definition.
+ # Please refer to :meth:`_interpolate_multikeys` for details.
+ self._unit_x = 1.0
+ self._unit_y = 1.0
+
+ # Default triangle renumbering: None (= no renumbering)
+ # Renumbering may be used to avoid unnecessary computations
+ # if complex calculations are done inside the Interpolator.
+ # Please refer to :meth:`_interpolate_multikeys` for details.
+ self._tri_renum = None
+
+ # __call__ and gradient docstrings are shared by all subclasses
+ # (except, if needed, relevant additions).
+ # However these methods are only implemented in subclasses to avoid
+ # confusion in the documentation.
+ _docstring__call__ = """
+ Returns a masked array containing interpolated values at the specified
+ (x, y) points.
+
+ Parameters
+ ----------
+ x, y : array-like
+ x and y coordinates of the same shape and any number of
+ dimensions.
+
+ Returns
+ -------
+ np.ma.array
+ Masked array of the same shape as *x* and *y*; values corresponding
+ to (*x*, *y*) points outside of the triangulation are masked out.
+
+ """
+
+ _docstringgradient = r"""
+ Returns a list of 2 masked arrays containing interpolated derivatives
+ at the specified (x, y) points.
+
+ Parameters
+ ----------
+ x, y : array-like
+ x and y coordinates of the same shape and any number of
+ dimensions.
+
+ Returns
+ -------
+ dzdx, dzdy : np.ma.array
+ 2 masked arrays of the same shape as *x* and *y*; values
+ corresponding to (x, y) points outside of the triangulation
+ are masked out.
+ The first returned array contains the values of
+ :math:`\frac{\partial z}{\partial x}` and the second those of
+ :math:`\frac{\partial z}{\partial y}`.
+
+ """
+
+ def _interpolate_multikeys(self, x, y, tri_index=None,
+ return_keys=('z',)):
+ """
+ Versatile (private) method defined for all TriInterpolators.
+
+ :meth:`_interpolate_multikeys` is a wrapper around method
+ :meth:`_interpolate_single_key` (to be defined in the child
+ subclasses).
+ :meth:`_interpolate_single_key actually performs the interpolation,
+ but only for 1-dimensional inputs and at valid locations (inside
+ unmasked triangles of the triangulation).
+
+ The purpose of :meth:`_interpolate_multikeys` is to implement the
+ following common tasks needed in all subclasses implementations:
+
+ - calculation of containing triangles
+ - dealing with more than one interpolation request at the same
+ location (e.g., if the 2 derivatives are requested, it is
+ unnecessary to compute the containing triangles twice)
+ - scaling according to self._unit_x, self._unit_y
+ - dealing with points outside of the grid (with fill value np.nan)
+ - dealing with multi-dimensional *x*, *y* arrays: flattening for
+ :meth:`_interpolate_params` call and final reshaping.
+
+ (Note that np.vectorize could do most of those things very well for
+ you, but it does it by function evaluations over successive tuples of
+ the input arrays. Therefore, this tends to be more time-consuming than
+ using optimized numpy functions - e.g., np.dot - which can be used
+ easily on the flattened inputs, in the child-subclass methods
+ :meth:`_interpolate_single_key`.)
+
+ It is guaranteed that the calls to :meth:`_interpolate_single_key`
+ will be done with flattened (1-d) array-like input parameters *x*, *y*
+ and with flattened, valid `tri_index` arrays (no -1 index allowed).
+
+ Parameters
+ ----------
+ x, y : array-like
+ x and y coordinates where interpolated values are requested.
+ tri_index : array-like of int, optional
+ Array of the containing triangle indices, same shape as
+ *x* and *y*. Defaults to None. If None, these indices
+ will be computed by a TriFinder instance.
+ (Note: For point outside the grid, tri_index[ipt] shall be -1).
+ return_keys : tuple of keys from {'z', 'dzdx', 'dzdy'}
+ Defines the interpolation arrays to return, and in which order.
+
+ Returns
+ -------
+ list of arrays
+ Each array-like contains the expected interpolated values in the
+ order defined by *return_keys* parameter.
+ """
+ # Flattening and rescaling inputs arrays x, y
+ # (initial shape is stored for output)
+ x = np.asarray(x, dtype=np.float64)
+ y = np.asarray(y, dtype=np.float64)
+ sh_ret = x.shape
+ if x.shape != y.shape:
+ raise ValueError("x and y shall have same shapes."
+ f" Given: {x.shape} and {y.shape}")
+ x = np.ravel(x)
+ y = np.ravel(y)
+ x_scaled = x/self._unit_x
+ y_scaled = y/self._unit_y
+ size_ret = np.size(x_scaled)
+
+ # Computes & ravels the element indexes, extract the valid ones.
+ if tri_index is None:
+ tri_index = self._trifinder(x, y)
+ else:
+ if tri_index.shape != sh_ret:
+ raise ValueError(
+ "tri_index array is provided and shall"
+ " have same shape as x and y. Given: "
+ f"{tri_index.shape} and {sh_ret}")
+ tri_index = np.ravel(tri_index)
+
+ mask_in = (tri_index != -1)
+ if self._tri_renum is None:
+ valid_tri_index = tri_index[mask_in]
+ else:
+ valid_tri_index = self._tri_renum[tri_index[mask_in]]
+ valid_x = x_scaled[mask_in]
+ valid_y = y_scaled[mask_in]
+
+ ret = []
+ for return_key in return_keys:
+ # Find the return index associated with the key.
+ try:
+ return_index = {'z': 0, 'dzdx': 1, 'dzdy': 2}[return_key]
+ except KeyError as err:
+ raise ValueError("return_keys items shall take values in"
+ " {'z', 'dzdx', 'dzdy'}") from err
+
+ # Sets the scale factor for f & df components
+ scale = [1., 1./self._unit_x, 1./self._unit_y][return_index]
+
+ # Computes the interpolation
+ ret_loc = np.empty(size_ret, dtype=np.float64)
+ ret_loc[~mask_in] = np.nan
+ ret_loc[mask_in] = self._interpolate_single_key(
+ return_key, valid_tri_index, valid_x, valid_y) * scale
+ ret += [np.ma.masked_invalid(ret_loc.reshape(sh_ret), copy=False)]
+
+ return ret
+
+ def _interpolate_single_key(self, return_key, tri_index, x, y):
+ """
+ Interpolate at points belonging to the triangulation
+ (inside an unmasked triangles).
+
+ Parameters
+ ----------
+ return_key : {'z', 'dzdx', 'dzdy'}
+ The requested values (z or its derivatives).
+ tri_index : 1D int array
+ Valid triangle index (cannot be -1).
+ x, y : 1D arrays, same shape as `tri_index`
+ Valid locations where interpolation is requested.
+
+ Returns
+ -------
+ 1-d array
+ Returned array of the same size as *tri_index*
+ """
+ raise NotImplementedError("TriInterpolator subclasses" +
+ "should implement _interpolate_single_key!")
+
+
+class LinearTriInterpolator(TriInterpolator):
+ """
+ Linear interpolator on a triangular grid.
+
+ Each triangle is represented by a plane so that an interpolated value at
+ point (x, y) lies on the plane of the triangle containing (x, y).
+ Interpolated values are therefore continuous across the triangulation, but
+ their first derivatives are discontinuous at edges between triangles.
+
+ Parameters
+ ----------
+ triangulation : `~matplotlib.tri.Triangulation`
+ The triangulation to interpolate over.
+ z : (npoints,) array-like
+ Array of values, defined at grid points, to interpolate between.
+ trifinder : `~matplotlib.tri.TriFinder`, optional
+ If this is not specified, the Triangulation's default TriFinder will
+ be used by calling `.Triangulation.get_trifinder`.
+
+ Methods
+ -------
+ `__call__` (x, y) : Returns interpolated values at (x, y) points.
+ `gradient` (x, y) : Returns interpolated derivatives at (x, y) points.
+
+ """
+ def __init__(self, triangulation, z, trifinder=None):
+ super().__init__(triangulation, z, trifinder)
+
+ # Store plane coefficients for fast interpolation calculations.
+ self._plane_coefficients = \
+ self._triangulation.calculate_plane_coefficients(self._z)
+
+ def __call__(self, x, y):
+ return self._interpolate_multikeys(x, y, tri_index=None,
+ return_keys=('z',))[0]
+ __call__.__doc__ = TriInterpolator._docstring__call__
+
+ def gradient(self, x, y):
+ return self._interpolate_multikeys(x, y, tri_index=None,
+ return_keys=('dzdx', 'dzdy'))
+ gradient.__doc__ = TriInterpolator._docstringgradient
+
+ def _interpolate_single_key(self, return_key, tri_index, x, y):
+ _api.check_in_list(['z', 'dzdx', 'dzdy'], return_key=return_key)
+ if return_key == 'z':
+ return (self._plane_coefficients[tri_index, 0]*x +
+ self._plane_coefficients[tri_index, 1]*y +
+ self._plane_coefficients[tri_index, 2])
+ elif return_key == 'dzdx':
+ return self._plane_coefficients[tri_index, 0]
+ else: # 'dzdy'
+ return self._plane_coefficients[tri_index, 1]
+
+
+class CubicTriInterpolator(TriInterpolator):
+ r"""
+ Cubic interpolator on a triangular grid.
+
+ In one-dimension - on a segment - a cubic interpolating function is
+ defined by the values of the function and its derivative at both ends.
+ This is almost the same in 2D inside a triangle, except that the values
+ of the function and its 2 derivatives have to be defined at each triangle
+ node.
+
+ The CubicTriInterpolator takes the value of the function at each node -
+ provided by the user - and internally computes the value of the
+ derivatives, resulting in a smooth interpolation.
+ (As a special feature, the user can also impose the value of the
+ derivatives at each node, but this is not supposed to be the common
+ usage.)
+
+ Parameters
+ ----------
+ triangulation : `~matplotlib.tri.Triangulation`
+ The triangulation to interpolate over.
+ z : (npoints,) array-like
+ Array of values, defined at grid points, to interpolate between.
+ kind : {'min_E', 'geom', 'user'}, optional
+ Choice of the smoothing algorithm, in order to compute
+ the interpolant derivatives (defaults to 'min_E'):
+
+ - if 'min_E': (default) The derivatives at each node is computed
+ to minimize a bending energy.
+ - if 'geom': The derivatives at each node is computed as a
+ weighted average of relevant triangle normals. To be used for
+ speed optimization (large grids).
+ - if 'user': The user provides the argument *dz*, no computation
+ is hence needed.
+
+ trifinder : `~matplotlib.tri.TriFinder`, optional
+ If not specified, the Triangulation's default TriFinder will
+ be used by calling `.Triangulation.get_trifinder`.
+ dz : tuple of array-likes (dzdx, dzdy), optional
+ Used only if *kind* ='user'. In this case *dz* must be provided as
+ (dzdx, dzdy) where dzdx, dzdy are arrays of the same shape as *z* and
+ are the interpolant first derivatives at the *triangulation* points.
+
+ Methods
+ -------
+ `__call__` (x, y) : Returns interpolated values at (x, y) points.
+ `gradient` (x, y) : Returns interpolated derivatives at (x, y) points.
+
+ Notes
+ -----
+ This note is a bit technical and details how the cubic interpolation is
+ computed.
+
+ The interpolation is based on a Clough-Tocher subdivision scheme of
+ the *triangulation* mesh (to make it clearer, each triangle of the
+ grid will be divided in 3 child-triangles, and on each child triangle
+ the interpolated function is a cubic polynomial of the 2 coordinates).
+ This technique originates from FEM (Finite Element Method) analysis;
+ the element used is a reduced Hsieh-Clough-Tocher (HCT)
+ element. Its shape functions are described in [1]_.
+ The assembled function is guaranteed to be C1-smooth, i.e. it is
+ continuous and its first derivatives are also continuous (this
+ is easy to show inside the triangles but is also true when crossing the
+ edges).
+
+ In the default case (*kind* ='min_E'), the interpolant minimizes a
+ curvature energy on the functional space generated by the HCT element
+ shape functions - with imposed values but arbitrary derivatives at each
+ node. The minimized functional is the integral of the so-called total
+ curvature (implementation based on an algorithm from [2]_ - PCG sparse
+ solver):
+
+ .. math::
+
+ E(z) = \frac{1}{2} \int_{\Omega} \left(
+ \left( \frac{\partial^2{z}}{\partial{x}^2} \right)^2 +
+ \left( \frac{\partial^2{z}}{\partial{y}^2} \right)^2 +
+ 2\left( \frac{\partial^2{z}}{\partial{y}\partial{x}} \right)^2
+ \right) dx\,dy
+
+ If the case *kind* ='geom' is chosen by the user, a simple geometric
+ approximation is used (weighted average of the triangle normal
+ vectors), which could improve speed on very large grids.
+
+ References
+ ----------
+ .. [1] Michel Bernadou, Kamal Hassan, "Basis functions for general
+ Hsieh-Clough-Tocher triangles, complete or reduced.",
+ International Journal for Numerical Methods in Engineering,
+ 17(5):784 - 789. 2.01.
+ .. [2] C.T. Kelley, "Iterative Methods for Optimization".
+
+ """
+ def __init__(self, triangulation, z, kind='min_E', trifinder=None,
+ dz=None):
+ super().__init__(triangulation, z, trifinder)
+
+ # Loads the underlying c++ _triangulation.
+ # (During loading, reordering of triangulation._triangles may occur so
+ # that all final triangles are now anti-clockwise)
+ self._triangulation.get_cpp_triangulation()
+
+ # To build the stiffness matrix and avoid zero-energy spurious modes
+ # we will only store internally the valid (unmasked) triangles and
+ # the necessary (used) points coordinates.
+ # 2 renumbering tables need to be computed and stored:
+ # - a triangle renum table in order to translate the result from a
+ # TriFinder instance into the internal stored triangle number.
+ # - a node renum table to overwrite the self._z values into the new
+ # (used) node numbering.
+ tri_analyzer = TriAnalyzer(self._triangulation)
+ (compressed_triangles, compressed_x, compressed_y, tri_renum,
+ node_renum) = tri_analyzer._get_compressed_triangulation()
+ self._triangles = compressed_triangles
+ self._tri_renum = tri_renum
+ # Taking into account the node renumbering in self._z:
+ valid_node = (node_renum != -1)
+ self._z[node_renum[valid_node]] = self._z[valid_node]
+
+ # Computing scale factors
+ self._unit_x = np.ptp(compressed_x)
+ self._unit_y = np.ptp(compressed_y)
+ self._pts = np.column_stack([compressed_x / self._unit_x,
+ compressed_y / self._unit_y])
+ # Computing triangle points
+ self._tris_pts = self._pts[self._triangles]
+ # Computing eccentricities
+ self._eccs = self._compute_tri_eccentricities(self._tris_pts)
+ # Computing dof estimations for HCT triangle shape function
+ _api.check_in_list(['user', 'geom', 'min_E'], kind=kind)
+ self._dof = self._compute_dof(kind, dz=dz)
+ # Loading HCT element
+ self._ReferenceElement = _ReducedHCT_Element()
+
+ def __call__(self, x, y):
+ return self._interpolate_multikeys(x, y, tri_index=None,
+ return_keys=('z',))[0]
+ __call__.__doc__ = TriInterpolator._docstring__call__
+
+ def gradient(self, x, y):
+ return self._interpolate_multikeys(x, y, tri_index=None,
+ return_keys=('dzdx', 'dzdy'))
+ gradient.__doc__ = TriInterpolator._docstringgradient
+
+ def _interpolate_single_key(self, return_key, tri_index, x, y):
+ _api.check_in_list(['z', 'dzdx', 'dzdy'], return_key=return_key)
+ tris_pts = self._tris_pts[tri_index]
+ alpha = self._get_alpha_vec(x, y, tris_pts)
+ ecc = self._eccs[tri_index]
+ dof = np.expand_dims(self._dof[tri_index], axis=1)
+ if return_key == 'z':
+ return self._ReferenceElement.get_function_values(
+ alpha, ecc, dof)
+ else: # 'dzdx', 'dzdy'
+ J = self._get_jacobian(tris_pts)
+ dzdx = self._ReferenceElement.get_function_derivatives(
+ alpha, J, ecc, dof)
+ if return_key == 'dzdx':
+ return dzdx[:, 0, 0]
+ else:
+ return dzdx[:, 1, 0]
+
+ def _compute_dof(self, kind, dz=None):
+ """
+ Compute and return nodal dofs according to kind.
+
+ Parameters
+ ----------
+ kind : {'min_E', 'geom', 'user'}
+ Choice of the _DOF_estimator subclass to estimate the gradient.
+ dz : tuple of array-likes (dzdx, dzdy), optional
+ Used only if *kind*=user; in this case passed to the
+ :class:`_DOF_estimator_user`.
+
+ Returns
+ -------
+ array-like, shape (npts, 2)
+ Estimation of the gradient at triangulation nodes (stored as
+ degree of freedoms of reduced-HCT triangle elements).
+ """
+ if kind == 'user':
+ if dz is None:
+ raise ValueError("For a CubicTriInterpolator with "
+ "*kind*='user', a valid *dz* "
+ "argument is expected.")
+ TE = _DOF_estimator_user(self, dz=dz)
+ elif kind == 'geom':
+ TE = _DOF_estimator_geom(self)
+ else: # 'min_E', checked in __init__
+ TE = _DOF_estimator_min_E(self)
+ return TE.compute_dof_from_df()
+
+ @staticmethod
+ def _get_alpha_vec(x, y, tris_pts):
+ """
+ Fast (vectorized) function to compute barycentric coordinates alpha.
+
+ Parameters
+ ----------
+ x, y : array-like of dim 1 (shape (nx,))
+ Coordinates of the points whose points barycentric coordinates are
+ requested.
+ tris_pts : array like of dim 3 (shape: (nx, 3, 2))
+ Coordinates of the containing triangles apexes.
+
+ Returns
+ -------
+ array of dim 2 (shape (nx, 3))
+ Barycentric coordinates of the points inside the containing
+ triangles.
+ """
+ ndim = tris_pts.ndim-2
+
+ a = tris_pts[:, 1, :] - tris_pts[:, 0, :]
+ b = tris_pts[:, 2, :] - tris_pts[:, 0, :]
+ abT = np.stack([a, b], axis=-1)
+ ab = _transpose_vectorized(abT)
+ OM = np.stack([x, y], axis=1) - tris_pts[:, 0, :]
+
+ metric = ab @ abT
+ # Here we try to deal with the colinear cases.
+ # metric_inv is in this case set to the Moore-Penrose pseudo-inverse
+ # meaning that we will still return a set of valid barycentric
+ # coordinates.
+ metric_inv = _pseudo_inv22sym_vectorized(metric)
+ Covar = ab @ _transpose_vectorized(np.expand_dims(OM, ndim))
+ ksi = metric_inv @ Covar
+ alpha = _to_matrix_vectorized([
+ [1-ksi[:, 0, 0]-ksi[:, 1, 0]], [ksi[:, 0, 0]], [ksi[:, 1, 0]]])
+ return alpha
+
+ @staticmethod
+ def _get_jacobian(tris_pts):
+ """
+ Fast (vectorized) function to compute triangle jacobian matrix.
+
+ Parameters
+ ----------
+ tris_pts : array like of dim 3 (shape: (nx, 3, 2))
+ Coordinates of the containing triangles apexes.
+
+ Returns
+ -------
+ array of dim 3 (shape (nx, 2, 2))
+ Barycentric coordinates of the points inside the containing
+ triangles.
+ J[itri, :, :] is the jacobian matrix at apex 0 of the triangle
+ itri, so that the following (matrix) relationship holds:
+ [dz/dksi] = [J] x [dz/dx]
+ with x: global coordinates
+ ksi: element parametric coordinates in triangle first apex
+ local basis.
+ """
+ a = np.array(tris_pts[:, 1, :] - tris_pts[:, 0, :])
+ b = np.array(tris_pts[:, 2, :] - tris_pts[:, 0, :])
+ J = _to_matrix_vectorized([[a[:, 0], a[:, 1]],
+ [b[:, 0], b[:, 1]]])
+ return J
+
+ @staticmethod
+ def _compute_tri_eccentricities(tris_pts):
+ """
+ Compute triangle eccentricities.
+
+ Parameters
+ ----------
+ tris_pts : array like of dim 3 (shape: (nx, 3, 2))
+ Coordinates of the triangles apexes.
+
+ Returns
+ -------
+ array like of dim 2 (shape: (nx, 3))
+ The so-called eccentricity parameters [1] needed for HCT triangular
+ element.
+ """
+ a = np.expand_dims(tris_pts[:, 2, :] - tris_pts[:, 1, :], axis=2)
+ b = np.expand_dims(tris_pts[:, 0, :] - tris_pts[:, 2, :], axis=2)
+ c = np.expand_dims(tris_pts[:, 1, :] - tris_pts[:, 0, :], axis=2)
+ # Do not use np.squeeze, this is dangerous if only one triangle
+ # in the triangulation...
+ dot_a = (_transpose_vectorized(a) @ a)[:, 0, 0]
+ dot_b = (_transpose_vectorized(b) @ b)[:, 0, 0]
+ dot_c = (_transpose_vectorized(c) @ c)[:, 0, 0]
+ # Note that this line will raise a warning for dot_a, dot_b or dot_c
+ # zeros, but we choose not to support triangles with duplicate points.
+ return _to_matrix_vectorized([[(dot_c-dot_b) / dot_a],
+ [(dot_a-dot_c) / dot_b],
+ [(dot_b-dot_a) / dot_c]])
+
+
+# FEM element used for interpolation and for solving minimisation
+# problem (Reduced HCT element)
+class _ReducedHCT_Element:
+ """
+ Implementation of reduced HCT triangular element with explicit shape
+ functions.
+
+ Computes z, dz, d2z and the element stiffness matrix for bending energy:
+ E(f) = integral( (d2z/dx2 + d2z/dy2)**2 dA)
+
+ *** Reference for the shape functions: ***
+ [1] Basis functions for general Hsieh-Clough-Tocher _triangles, complete or
+ reduced.
+ Michel Bernadou, Kamal Hassan
+ International Journal for Numerical Methods in Engineering.
+ 17(5):784 - 789. 2.01
+
+ *** Element description: ***
+ 9 dofs: z and dz given at 3 apex
+ C1 (conform)
+
+ """
+ # 1) Loads matrices to generate shape functions as a function of
+ # triangle eccentricities - based on [1] p.11 '''
+ M = np.array([
+ [ 0.00, 0.00, 0.00, 4.50, 4.50, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [-0.25, 0.00, 0.00, 0.50, 1.25, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [-0.25, 0.00, 0.00, 1.25, 0.50, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.50, 1.00, 0.00, -1.50, 0.00, 3.00, 3.00, 0.00, 0.00, 3.00],
+ [ 0.00, 0.00, 0.00, -0.25, 0.25, 0.00, 1.00, 0.00, 0.00, 0.50],
+ [ 0.25, 0.00, 0.00, -0.50, -0.25, 1.00, 0.00, 0.00, 0.00, 1.00],
+ [ 0.50, 0.00, 1.00, 0.00, -1.50, 0.00, 0.00, 3.00, 3.00, 3.00],
+ [ 0.25, 0.00, 0.00, -0.25, -0.50, 0.00, 0.00, 0.00, 1.00, 1.00],
+ [ 0.00, 0.00, 0.00, 0.25, -0.25, 0.00, 0.00, 1.00, 0.00, 0.50]])
+ M0 = np.array([
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [-1.00, 0.00, 0.00, 1.50, 1.50, 0.00, 0.00, 0.00, 0.00, -3.00],
+ [-0.50, 0.00, 0.00, 0.75, 0.75, 0.00, 0.00, 0.00, 0.00, -1.50],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 1.00, 0.00, 0.00, -1.50, -1.50, 0.00, 0.00, 0.00, 0.00, 3.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.50, 0.00, 0.00, -0.75, -0.75, 0.00, 0.00, 0.00, 0.00, 1.50]])
+ M1 = np.array([
+ [-0.50, 0.00, 0.00, 1.50, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [-0.25, 0.00, 0.00, 0.75, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.50, 0.00, 0.00, -1.50, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.25, 0.00, 0.00, -0.75, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00]])
+ M2 = np.array([
+ [ 0.50, 0.00, 0.00, 0.00, -1.50, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.25, 0.00, 0.00, 0.00, -0.75, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [-0.50, 0.00, 0.00, 0.00, 1.50, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [-0.25, 0.00, 0.00, 0.00, 0.75, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00],
+ [ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00]])
+
+ # 2) Loads matrices to rotate components of gradient & Hessian
+ # vectors in the reference basis of triangle first apex (a0)
+ rotate_dV = np.array([[ 1., 0.], [ 0., 1.],
+ [ 0., 1.], [-1., -1.],
+ [-1., -1.], [ 1., 0.]])
+
+ rotate_d2V = np.array([[1., 0., 0.], [0., 1., 0.], [ 0., 0., 1.],
+ [0., 1., 0.], [1., 1., 1.], [ 0., -2., -1.],
+ [1., 1., 1.], [1., 0., 0.], [-2., 0., -1.]])
+
+ # 3) Loads Gauss points & weights on the 3 sub-_triangles for P2
+ # exact integral - 3 points on each subtriangles.
+ # NOTE: as the 2nd derivative is discontinuous , we really need those 9
+ # points!
+ n_gauss = 9
+ gauss_pts = np.array([[13./18., 4./18., 1./18.],
+ [ 4./18., 13./18., 1./18.],
+ [ 7./18., 7./18., 4./18.],
+ [ 1./18., 13./18., 4./18.],
+ [ 1./18., 4./18., 13./18.],
+ [ 4./18., 7./18., 7./18.],
+ [ 4./18., 1./18., 13./18.],
+ [13./18., 1./18., 4./18.],
+ [ 7./18., 4./18., 7./18.]], dtype=np.float64)
+ gauss_w = np.ones([9], dtype=np.float64) / 9.
+
+ # 4) Stiffness matrix for curvature energy
+ E = np.array([[1., 0., 0.], [0., 1., 0.], [0., 0., 2.]])
+
+ # 5) Loads the matrix to compute DOF_rot from tri_J at apex 0
+ J0_to_J1 = np.array([[-1., 1.], [-1., 0.]])
+ J0_to_J2 = np.array([[ 0., -1.], [ 1., -1.]])
+
+ def get_function_values(self, alpha, ecc, dofs):
+ """
+ Parameters
+ ----------
+ alpha : is a (N x 3 x 1) array (array of column-matrices) of
+ barycentric coordinates,
+ ecc : is a (N x 3 x 1) array (array of column-matrices) of triangle
+ eccentricities,
+ dofs : is a (N x 1 x 9) arrays (arrays of row-matrices) of computed
+ degrees of freedom.
+
+ Returns
+ -------
+ Returns the N-array of interpolated function values.
+ """
+ subtri = np.argmin(alpha, axis=1)[:, 0]
+ ksi = _roll_vectorized(alpha, -subtri, axis=0)
+ E = _roll_vectorized(ecc, -subtri, axis=0)
+ x = ksi[:, 0, 0]
+ y = ksi[:, 1, 0]
+ z = ksi[:, 2, 0]
+ x_sq = x*x
+ y_sq = y*y
+ z_sq = z*z
+ V = _to_matrix_vectorized([
+ [x_sq*x], [y_sq*y], [z_sq*z], [x_sq*z], [x_sq*y], [y_sq*x],
+ [y_sq*z], [z_sq*y], [z_sq*x], [x*y*z]])
+ prod = self.M @ V
+ prod += _scalar_vectorized(E[:, 0, 0], self.M0 @ V)
+ prod += _scalar_vectorized(E[:, 1, 0], self.M1 @ V)
+ prod += _scalar_vectorized(E[:, 2, 0], self.M2 @ V)
+ s = _roll_vectorized(prod, 3*subtri, axis=0)
+ return (dofs @ s)[:, 0, 0]
+
+ def get_function_derivatives(self, alpha, J, ecc, dofs):
+ """
+ Parameters
+ ----------
+ *alpha* is a (N x 3 x 1) array (array of column-matrices of
+ barycentric coordinates)
+ *J* is a (N x 2 x 2) array of jacobian matrices (jacobian matrix at
+ triangle first apex)
+ *ecc* is a (N x 3 x 1) array (array of column-matrices of triangle
+ eccentricities)
+ *dofs* is a (N x 1 x 9) arrays (arrays of row-matrices) of computed
+ degrees of freedom.
+
+ Returns
+ -------
+ Returns the values of interpolated function derivatives [dz/dx, dz/dy]
+ in global coordinates at locations alpha, as a column-matrices of
+ shape (N x 2 x 1).
+ """
+ subtri = np.argmin(alpha, axis=1)[:, 0]
+ ksi = _roll_vectorized(alpha, -subtri, axis=0)
+ E = _roll_vectorized(ecc, -subtri, axis=0)
+ x = ksi[:, 0, 0]
+ y = ksi[:, 1, 0]
+ z = ksi[:, 2, 0]
+ x_sq = x*x
+ y_sq = y*y
+ z_sq = z*z
+ dV = _to_matrix_vectorized([
+ [ -3.*x_sq, -3.*x_sq],
+ [ 3.*y_sq, 0.],
+ [ 0., 3.*z_sq],
+ [ -2.*x*z, -2.*x*z+x_sq],
+ [-2.*x*y+x_sq, -2.*x*y],
+ [ 2.*x*y-y_sq, -y_sq],
+ [ 2.*y*z, y_sq],
+ [ z_sq, 2.*y*z],
+ [ -z_sq, 2.*x*z-z_sq],
+ [ x*z-y*z, x*y-y*z]])
+ # Puts back dV in first apex basis
+ dV = dV @ _extract_submatrices(
+ self.rotate_dV, subtri, block_size=2, axis=0)
+
+ prod = self.M @ dV
+ prod += _scalar_vectorized(E[:, 0, 0], self.M0 @ dV)
+ prod += _scalar_vectorized(E[:, 1, 0], self.M1 @ dV)
+ prod += _scalar_vectorized(E[:, 2, 0], self.M2 @ dV)
+ dsdksi = _roll_vectorized(prod, 3*subtri, axis=0)
+ dfdksi = dofs @ dsdksi
+ # In global coordinates:
+ # Here we try to deal with the simplest colinear cases, returning a
+ # null matrix.
+ J_inv = _safe_inv22_vectorized(J)
+ dfdx = J_inv @ _transpose_vectorized(dfdksi)
+ return dfdx
+
+ def get_function_hessians(self, alpha, J, ecc, dofs):
+ """
+ Parameters
+ ----------
+ *alpha* is a (N x 3 x 1) array (array of column-matrices) of
+ barycentric coordinates
+ *J* is a (N x 2 x 2) array of jacobian matrices (jacobian matrix at
+ triangle first apex)
+ *ecc* is a (N x 3 x 1) array (array of column-matrices) of triangle
+ eccentricities
+ *dofs* is a (N x 1 x 9) arrays (arrays of row-matrices) of computed
+ degrees of freedom.
+
+ Returns
+ -------
+ Returns the values of interpolated function 2nd-derivatives
+ [d2z/dx2, d2z/dy2, d2z/dxdy] in global coordinates at locations alpha,
+ as a column-matrices of shape (N x 3 x 1).
+ """
+ d2sdksi2 = self.get_d2Sidksij2(alpha, ecc)
+ d2fdksi2 = dofs @ d2sdksi2
+ H_rot = self.get_Hrot_from_J(J)
+ d2fdx2 = d2fdksi2 @ H_rot
+ return _transpose_vectorized(d2fdx2)
+
+ def get_d2Sidksij2(self, alpha, ecc):
+ """
+ Parameters
+ ----------
+ *alpha* is a (N x 3 x 1) array (array of column-matrices) of
+ barycentric coordinates
+ *ecc* is a (N x 3 x 1) array (array of column-matrices) of triangle
+ eccentricities
+
+ Returns
+ -------
+ Returns the arrays d2sdksi2 (N x 3 x 1) Hessian of shape functions
+ expressed in covariant coordinates in first apex basis.
+ """
+ subtri = np.argmin(alpha, axis=1)[:, 0]
+ ksi = _roll_vectorized(alpha, -subtri, axis=0)
+ E = _roll_vectorized(ecc, -subtri, axis=0)
+ x = ksi[:, 0, 0]
+ y = ksi[:, 1, 0]
+ z = ksi[:, 2, 0]
+ d2V = _to_matrix_vectorized([
+ [ 6.*x, 6.*x, 6.*x],
+ [ 6.*y, 0., 0.],
+ [ 0., 6.*z, 0.],
+ [ 2.*z, 2.*z-4.*x, 2.*z-2.*x],
+ [2.*y-4.*x, 2.*y, 2.*y-2.*x],
+ [2.*x-4.*y, 0., -2.*y],
+ [ 2.*z, 0., 2.*y],
+ [ 0., 2.*y, 2.*z],
+ [ 0., 2.*x-4.*z, -2.*z],
+ [ -2.*z, -2.*y, x-y-z]])
+ # Puts back d2V in first apex basis
+ d2V = d2V @ _extract_submatrices(
+ self.rotate_d2V, subtri, block_size=3, axis=0)
+ prod = self.M @ d2V
+ prod += _scalar_vectorized(E[:, 0, 0], self.M0 @ d2V)
+ prod += _scalar_vectorized(E[:, 1, 0], self.M1 @ d2V)
+ prod += _scalar_vectorized(E[:, 2, 0], self.M2 @ d2V)
+ d2sdksi2 = _roll_vectorized(prod, 3*subtri, axis=0)
+ return d2sdksi2
+
+ def get_bending_matrices(self, J, ecc):
+ """
+ Parameters
+ ----------
+ *J* is a (N x 2 x 2) array of jacobian matrices (jacobian matrix at
+ triangle first apex)
+ *ecc* is a (N x 3 x 1) array (array of column-matrices) of triangle
+ eccentricities
+
+ Returns
+ -------
+ Returns the element K matrices for bending energy expressed in
+ GLOBAL nodal coordinates.
+ K_ij = integral [ (d2zi/dx2 + d2zi/dy2) * (d2zj/dx2 + d2zj/dy2) dA]
+ tri_J is needed to rotate dofs from local basis to global basis
+ """
+ n = np.size(ecc, 0)
+
+ # 1) matrix to rotate dofs in global coordinates
+ J1 = self.J0_to_J1 @ J
+ J2 = self.J0_to_J2 @ J
+ DOF_rot = np.zeros([n, 9, 9], dtype=np.float64)
+ DOF_rot[:, 0, 0] = 1
+ DOF_rot[:, 3, 3] = 1
+ DOF_rot[:, 6, 6] = 1
+ DOF_rot[:, 1:3, 1:3] = J
+ DOF_rot[:, 4:6, 4:6] = J1
+ DOF_rot[:, 7:9, 7:9] = J2
+
+ # 2) matrix to rotate Hessian in global coordinates.
+ H_rot, area = self.get_Hrot_from_J(J, return_area=True)
+
+ # 3) Computes stiffness matrix
+ # Gauss quadrature.
+ K = np.zeros([n, 9, 9], dtype=np.float64)
+ weights = self.gauss_w
+ pts = self.gauss_pts
+ for igauss in range(self.n_gauss):
+ alpha = np.tile(pts[igauss, :], n).reshape(n, 3)
+ alpha = np.expand_dims(alpha, 2)
+ weight = weights[igauss]
+ d2Skdksi2 = self.get_d2Sidksij2(alpha, ecc)
+ d2Skdx2 = d2Skdksi2 @ H_rot
+ K += weight * (d2Skdx2 @ self.E @ _transpose_vectorized(d2Skdx2))
+
+ # 4) With nodal (not elem) dofs
+ K = _transpose_vectorized(DOF_rot) @ K @ DOF_rot
+
+ # 5) Need the area to compute total element energy
+ return _scalar_vectorized(area, K)
+
+ def get_Hrot_from_J(self, J, return_area=False):
+ """
+ Parameters
+ ----------
+ *J* is a (N x 2 x 2) array of jacobian matrices (jacobian matrix at
+ triangle first apex)
+
+ Returns
+ -------
+ Returns H_rot used to rotate Hessian from local basis of first apex,
+ to global coordinates.
+ if *return_area* is True, returns also the triangle area (0.5*det(J))
+ """
+ # Here we try to deal with the simplest colinear cases; a null
+ # energy and area is imposed.
+ J_inv = _safe_inv22_vectorized(J)
+ Ji00 = J_inv[:, 0, 0]
+ Ji11 = J_inv[:, 1, 1]
+ Ji10 = J_inv[:, 1, 0]
+ Ji01 = J_inv[:, 0, 1]
+ H_rot = _to_matrix_vectorized([
+ [Ji00*Ji00, Ji10*Ji10, Ji00*Ji10],
+ [Ji01*Ji01, Ji11*Ji11, Ji01*Ji11],
+ [2*Ji00*Ji01, 2*Ji11*Ji10, Ji00*Ji11+Ji10*Ji01]])
+ if not return_area:
+ return H_rot
+ else:
+ area = 0.5 * (J[:, 0, 0]*J[:, 1, 1] - J[:, 0, 1]*J[:, 1, 0])
+ return H_rot, area
+
+ def get_Kff_and_Ff(self, J, ecc, triangles, Uc):
+ """
+ Build K and F for the following elliptic formulation:
+ minimization of curvature energy with value of function at node
+ imposed and derivatives 'free'.
+
+ Build the global Kff matrix in cco format.
+ Build the full Ff vec Ff = - Kfc x Uc.
+
+ Parameters
+ ----------
+ *J* is a (N x 2 x 2) array of jacobian matrices (jacobian matrix at
+ triangle first apex)
+ *ecc* is a (N x 3 x 1) array (array of column-matrices) of triangle
+ eccentricities
+ *triangles* is a (N x 3) array of nodes indexes.
+ *Uc* is (N x 3) array of imposed displacements at nodes
+
+ Returns
+ -------
+ (Kff_rows, Kff_cols, Kff_vals) Kff matrix in coo format - Duplicate
+ (row, col) entries must be summed.
+ Ff: force vector - dim npts * 3
+ """
+ ntri = np.size(ecc, 0)
+ vec_range = np.arange(ntri, dtype=np.int32)
+ c_indices = np.full(ntri, -1, dtype=np.int32) # for unused dofs, -1
+ f_dof = [1, 2, 4, 5, 7, 8]
+ c_dof = [0, 3, 6]
+
+ # vals, rows and cols indices in global dof numbering
+ f_dof_indices = _to_matrix_vectorized([[
+ c_indices, triangles[:, 0]*2, triangles[:, 0]*2+1,
+ c_indices, triangles[:, 1]*2, triangles[:, 1]*2+1,
+ c_indices, triangles[:, 2]*2, triangles[:, 2]*2+1]])
+
+ expand_indices = np.ones([ntri, 9, 1], dtype=np.int32)
+ f_row_indices = _transpose_vectorized(expand_indices @ f_dof_indices)
+ f_col_indices = expand_indices @ f_dof_indices
+ K_elem = self.get_bending_matrices(J, ecc)
+
+ # Extracting sub-matrices
+ # Explanation & notations:
+ # * Subscript f denotes 'free' degrees of freedom (i.e. dz/dx, dz/dx)
+ # * Subscript c denotes 'condensated' (imposed) degrees of freedom
+ # (i.e. z at all nodes)
+ # * F = [Ff, Fc] is the force vector
+ # * U = [Uf, Uc] is the imposed dof vector
+ # [ Kff Kfc ]
+ # * K = [ ] is the laplacian stiffness matrix
+ # [ Kcf Kff ]
+ # * As F = K x U one gets straightforwardly: Ff = - Kfc x Uc
+
+ # Computing Kff stiffness matrix in sparse coo format
+ Kff_vals = np.ravel(K_elem[np.ix_(vec_range, f_dof, f_dof)])
+ Kff_rows = np.ravel(f_row_indices[np.ix_(vec_range, f_dof, f_dof)])
+ Kff_cols = np.ravel(f_col_indices[np.ix_(vec_range, f_dof, f_dof)])
+
+ # Computing Ff force vector in sparse coo format
+ Kfc_elem = K_elem[np.ix_(vec_range, f_dof, c_dof)]
+ Uc_elem = np.expand_dims(Uc, axis=2)
+ Ff_elem = -(Kfc_elem @ Uc_elem)[:, :, 0]
+ Ff_indices = f_dof_indices[np.ix_(vec_range, [0], f_dof)][:, 0, :]
+
+ # Extracting Ff force vector in dense format
+ # We have to sum duplicate indices - using bincount
+ Ff = np.bincount(np.ravel(Ff_indices), weights=np.ravel(Ff_elem))
+ return Kff_rows, Kff_cols, Kff_vals, Ff
+
+
+# :class:_DOF_estimator, _DOF_estimator_user, _DOF_estimator_geom,
+# _DOF_estimator_min_E
+# Private classes used to compute the degree of freedom of each triangular
+# element for the TriCubicInterpolator.
+class _DOF_estimator:
+ """
+ Abstract base class for classes used to estimate a function's first
+ derivatives, and deduce the dofs for a CubicTriInterpolator using a
+ reduced HCT element formulation.
+
+ Derived classes implement ``compute_df(self, **kwargs)``, returning
+ ``np.vstack([dfx, dfy]).T`` where ``dfx, dfy`` are the estimation of the 2
+ gradient coordinates.
+ """
+ def __init__(self, interpolator, **kwargs):
+ _api.check_isinstance(CubicTriInterpolator, interpolator=interpolator)
+ self._pts = interpolator._pts
+ self._tris_pts = interpolator._tris_pts
+ self.z = interpolator._z
+ self._triangles = interpolator._triangles
+ (self._unit_x, self._unit_y) = (interpolator._unit_x,
+ interpolator._unit_y)
+ self.dz = self.compute_dz(**kwargs)
+ self.compute_dof_from_df()
+
+ def compute_dz(self, **kwargs):
+ raise NotImplementedError
+
+ def compute_dof_from_df(self):
+ """
+ Compute reduced-HCT elements degrees of freedom, from the gradient.
+ """
+ J = CubicTriInterpolator._get_jacobian(self._tris_pts)
+ tri_z = self.z[self._triangles]
+ tri_dz = self.dz[self._triangles]
+ tri_dof = self.get_dof_vec(tri_z, tri_dz, J)
+ return tri_dof
+
+ @staticmethod
+ def get_dof_vec(tri_z, tri_dz, J):
+ """
+ Compute the dof vector of a triangle, from the value of f, df and
+ of the local Jacobian at each node.
+
+ Parameters
+ ----------
+ tri_z : shape (3,) array
+ f nodal values.
+ tri_dz : shape (3, 2) array
+ df/dx, df/dy nodal values.
+ J
+ Jacobian matrix in local basis of apex 0.
+
+ Returns
+ -------
+ dof : shape (9,) array
+ For each apex ``iapex``::
+
+ dof[iapex*3+0] = f(Ai)
+ dof[iapex*3+1] = df(Ai).(AiAi+)
+ dof[iapex*3+2] = df(Ai).(AiAi-)
+ """
+ npt = tri_z.shape[0]
+ dof = np.zeros([npt, 9], dtype=np.float64)
+ J1 = _ReducedHCT_Element.J0_to_J1 @ J
+ J2 = _ReducedHCT_Element.J0_to_J2 @ J
+
+ col0 = J @ np.expand_dims(tri_dz[:, 0, :], axis=2)
+ col1 = J1 @ np.expand_dims(tri_dz[:, 1, :], axis=2)
+ col2 = J2 @ np.expand_dims(tri_dz[:, 2, :], axis=2)
+
+ dfdksi = _to_matrix_vectorized([
+ [col0[:, 0, 0], col1[:, 0, 0], col2[:, 0, 0]],
+ [col0[:, 1, 0], col1[:, 1, 0], col2[:, 1, 0]]])
+ dof[:, 0:7:3] = tri_z
+ dof[:, 1:8:3] = dfdksi[:, 0]
+ dof[:, 2:9:3] = dfdksi[:, 1]
+ return dof
+
+
+class _DOF_estimator_user(_DOF_estimator):
+ """dz is imposed by user; accounts for scaling if any."""
+
+ def compute_dz(self, dz):
+ (dzdx, dzdy) = dz
+ dzdx = dzdx * self._unit_x
+ dzdy = dzdy * self._unit_y
+ return np.vstack([dzdx, dzdy]).T
+
+
+class _DOF_estimator_geom(_DOF_estimator):
+ """Fast 'geometric' approximation, recommended for large arrays."""
+
+ def compute_dz(self):
+ """
+ self.df is computed as weighted average of _triangles sharing a common
+ node. On each triangle itri f is first assumed linear (= ~f), which
+ allows to compute d~f[itri]
+ Then the following approximation of df nodal values is then proposed:
+ f[ipt] = SUM ( w[itri] x d~f[itri] , for itri sharing apex ipt)
+ The weighted coeff. w[itri] are proportional to the angle of the
+ triangle itri at apex ipt
+ """
+ el_geom_w = self.compute_geom_weights()
+ el_geom_grad = self.compute_geom_grads()
+
+ # Sum of weights coeffs
+ w_node_sum = np.bincount(np.ravel(self._triangles),
+ weights=np.ravel(el_geom_w))
+
+ # Sum of weighted df = (dfx, dfy)
+ dfx_el_w = np.empty_like(el_geom_w)
+ dfy_el_w = np.empty_like(el_geom_w)
+ for iapex in range(3):
+ dfx_el_w[:, iapex] = el_geom_w[:, iapex]*el_geom_grad[:, 0]
+ dfy_el_w[:, iapex] = el_geom_w[:, iapex]*el_geom_grad[:, 1]
+ dfx_node_sum = np.bincount(np.ravel(self._triangles),
+ weights=np.ravel(dfx_el_w))
+ dfy_node_sum = np.bincount(np.ravel(self._triangles),
+ weights=np.ravel(dfy_el_w))
+
+ # Estimation of df
+ dfx_estim = dfx_node_sum/w_node_sum
+ dfy_estim = dfy_node_sum/w_node_sum
+ return np.vstack([dfx_estim, dfy_estim]).T
+
+ def compute_geom_weights(self):
+ """
+ Build the (nelems, 3) weights coeffs of _triangles angles,
+ renormalized so that np.sum(weights, axis=1) == np.ones(nelems)
+ """
+ weights = np.zeros([np.size(self._triangles, 0), 3])
+ tris_pts = self._tris_pts
+ for ipt in range(3):
+ p0 = tris_pts[:, ipt % 3, :]
+ p1 = tris_pts[:, (ipt+1) % 3, :]
+ p2 = tris_pts[:, (ipt-1) % 3, :]
+ alpha1 = np.arctan2(p1[:, 1]-p0[:, 1], p1[:, 0]-p0[:, 0])
+ alpha2 = np.arctan2(p2[:, 1]-p0[:, 1], p2[:, 0]-p0[:, 0])
+ # In the below formula we could take modulo 2. but
+ # modulo 1. is safer regarding round-off errors (flat triangles).
+ angle = np.abs(((alpha2-alpha1) / np.pi) % 1)
+ # Weight proportional to angle up np.pi/2; null weight for
+ # degenerated cases 0 and np.pi (note that *angle* is normalized
+ # by np.pi).
+ weights[:, ipt] = 0.5 - np.abs(angle-0.5)
+ return weights
+
+ def compute_geom_grads(self):
+ """
+ Compute the (global) gradient component of f assumed linear (~f).
+ returns array df of shape (nelems, 2)
+ df[ielem].dM[ielem] = dz[ielem] i.e. df = dz x dM = dM.T^-1 x dz
+ """
+ tris_pts = self._tris_pts
+ tris_f = self.z[self._triangles]
+
+ dM1 = tris_pts[:, 1, :] - tris_pts[:, 0, :]
+ dM2 = tris_pts[:, 2, :] - tris_pts[:, 0, :]
+ dM = np.dstack([dM1, dM2])
+ # Here we try to deal with the simplest colinear cases: a null
+ # gradient is assumed in this case.
+ dM_inv = _safe_inv22_vectorized(dM)
+
+ dZ1 = tris_f[:, 1] - tris_f[:, 0]
+ dZ2 = tris_f[:, 2] - tris_f[:, 0]
+ dZ = np.vstack([dZ1, dZ2]).T
+ df = np.empty_like(dZ)
+
+ # With np.einsum: could be ej,eji -> ej
+ df[:, 0] = dZ[:, 0]*dM_inv[:, 0, 0] + dZ[:, 1]*dM_inv[:, 1, 0]
+ df[:, 1] = dZ[:, 0]*dM_inv[:, 0, 1] + dZ[:, 1]*dM_inv[:, 1, 1]
+ return df
+
+
+class _DOF_estimator_min_E(_DOF_estimator_geom):
+ """
+ The 'smoothest' approximation, df is computed through global minimization
+ of the bending energy:
+ E(f) = integral[(d2z/dx2 + d2z/dy2 + 2 d2z/dxdy)**2 dA]
+ """
+ def __init__(self, Interpolator):
+ self._eccs = Interpolator._eccs
+ super().__init__(Interpolator)
+
+ def compute_dz(self):
+ """
+ Elliptic solver for bending energy minimization.
+ Uses a dedicated 'toy' sparse Jacobi PCG solver.
+ """
+ # Initial guess for iterative PCG solver.
+ dz_init = super().compute_dz()
+ Uf0 = np.ravel(dz_init)
+
+ reference_element = _ReducedHCT_Element()
+ J = CubicTriInterpolator._get_jacobian(self._tris_pts)
+ eccs = self._eccs
+ triangles = self._triangles
+ Uc = self.z[self._triangles]
+
+ # Building stiffness matrix and force vector in coo format
+ Kff_rows, Kff_cols, Kff_vals, Ff = reference_element.get_Kff_and_Ff(
+ J, eccs, triangles, Uc)
+
+ # Building sparse matrix and solving minimization problem
+ # We could use scipy.sparse direct solver; however to avoid this
+ # external dependency an implementation of a simple PCG solver with
+ # a simple diagonal Jacobi preconditioner is implemented.
+ tol = 1.e-10
+ n_dof = Ff.shape[0]
+ Kff_coo = _Sparse_Matrix_coo(Kff_vals, Kff_rows, Kff_cols,
+ shape=(n_dof, n_dof))
+ Kff_coo.compress_csc()
+ Uf, err = _cg(A=Kff_coo, b=Ff, x0=Uf0, tol=tol)
+ # If the PCG did not converge, we return the best guess between Uf0
+ # and Uf.
+ err0 = np.linalg.norm(Kff_coo.dot(Uf0) - Ff)
+ if err0 < err:
+ # Maybe a good occasion to raise a warning here ?
+ _api.warn_external("In TriCubicInterpolator initialization, "
+ "PCG sparse solver did not converge after "
+ "1000 iterations. `geom` approximation is "
+ "used instead of `min_E`")
+ Uf = Uf0
+
+ # Building dz from Uf
+ dz = np.empty([self._pts.shape[0], 2], dtype=np.float64)
+ dz[:, 0] = Uf[::2]
+ dz[:, 1] = Uf[1::2]
+ return dz
+
+
+# The following private :class:_Sparse_Matrix_coo and :func:_cg provide
+# a PCG sparse solver for (symmetric) elliptic problems.
+class _Sparse_Matrix_coo:
+ def __init__(self, vals, rows, cols, shape):
+ """
+ Create a sparse matrix in coo format.
+ *vals*: arrays of values of non-null entries of the matrix
+ *rows*: int arrays of rows of non-null entries of the matrix
+ *cols*: int arrays of cols of non-null entries of the matrix
+ *shape*: 2-tuple (n, m) of matrix shape
+ """
+ self.n, self.m = shape
+ self.vals = np.asarray(vals, dtype=np.float64)
+ self.rows = np.asarray(rows, dtype=np.int32)
+ self.cols = np.asarray(cols, dtype=np.int32)
+
+ def dot(self, V):
+ """
+ Dot product of self by a vector *V* in sparse-dense to dense format
+ *V* dense vector of shape (self.m,).
+ """
+ assert V.shape == (self.m,)
+ return np.bincount(self.rows,
+ weights=self.vals*V[self.cols],
+ minlength=self.m)
+
+ def compress_csc(self):
+ """
+ Compress rows, cols, vals / summing duplicates. Sort for csc format.
+ """
+ _, unique, indices = np.unique(
+ self.rows + self.n*self.cols,
+ return_index=True, return_inverse=True)
+ self.rows = self.rows[unique]
+ self.cols = self.cols[unique]
+ self.vals = np.bincount(indices, weights=self.vals)
+
+ def compress_csr(self):
+ """
+ Compress rows, cols, vals / summing duplicates. Sort for csr format.
+ """
+ _, unique, indices = np.unique(
+ self.m*self.rows + self.cols,
+ return_index=True, return_inverse=True)
+ self.rows = self.rows[unique]
+ self.cols = self.cols[unique]
+ self.vals = np.bincount(indices, weights=self.vals)
+
+ def to_dense(self):
+ """
+ Return a dense matrix representing self, mainly for debugging purposes.
+ """
+ ret = np.zeros([self.n, self.m], dtype=np.float64)
+ nvals = self.vals.size
+ for i in range(nvals):
+ ret[self.rows[i], self.cols[i]] += self.vals[i]
+ return ret
+
+ def __str__(self):
+ return self.to_dense().__str__()
+
+ @property
+ def diag(self):
+ """Return the (dense) vector of the diagonal elements."""
+ in_diag = (self.rows == self.cols)
+ diag = np.zeros(min(self.n, self.n), dtype=np.float64) # default 0.
+ diag[self.rows[in_diag]] = self.vals[in_diag]
+ return diag
+
+
+def _cg(A, b, x0=None, tol=1.e-10, maxiter=1000):
+ """
+ Use Preconditioned Conjugate Gradient iteration to solve A x = b
+ A simple Jacobi (diagonal) preconditioner is used.
+
+ Parameters
+ ----------
+ A : _Sparse_Matrix_coo
+ *A* must have been compressed before by compress_csc or
+ compress_csr method.
+ b : array
+ Right hand side of the linear system.
+ x0 : array, optional
+ Starting guess for the solution. Defaults to the zero vector.
+ tol : float, optional
+ Tolerance to achieve. The algorithm terminates when the relative
+ residual is below tol. Default is 1e-10.
+ maxiter : int, optional
+ Maximum number of iterations. Iteration will stop after *maxiter*
+ steps even if the specified tolerance has not been achieved. Defaults
+ to 1000.
+
+ Returns
+ -------
+ x : array
+ The converged solution.
+ err : float
+ The absolute error np.linalg.norm(A.dot(x) - b)
+ """
+ n = b.size
+ assert A.n == n
+ assert A.m == n
+ b_norm = np.linalg.norm(b)
+
+ # Jacobi pre-conditioner
+ kvec = A.diag
+ # For diag elem < 1e-6 we keep 1e-6.
+ kvec = np.maximum(kvec, 1e-6)
+
+ # Initial guess
+ if x0 is None:
+ x = np.zeros(n)
+ else:
+ x = x0
+
+ r = b - A.dot(x)
+ w = r/kvec
+
+ p = np.zeros(n)
+ beta = 0.0
+ rho = np.dot(r, w)
+ k = 0
+
+ # Following C. T. Kelley
+ while (np.sqrt(abs(rho)) > tol*b_norm) and (k < maxiter):
+ p = w + beta*p
+ z = A.dot(p)
+ alpha = rho/np.dot(p, z)
+ r = r - alpha*z
+ w = r/kvec
+ rhoold = rho
+ rho = np.dot(r, w)
+ x = x + alpha*p
+ beta = rho/rhoold
+ # err = np.linalg.norm(A.dot(x) - b) # absolute accuracy - not used
+ k += 1
+ err = np.linalg.norm(A.dot(x) - b)
+ return x, err
+
+
+# The following private functions:
+# :func:`_safe_inv22_vectorized`
+# :func:`_pseudo_inv22sym_vectorized`
+# :func:`_scalar_vectorized`
+# :func:`_transpose_vectorized`
+# :func:`_roll_vectorized`
+# :func:`_to_matrix_vectorized`
+# :func:`_extract_submatrices`
+# provide fast numpy implementation of some standard operations on arrays of
+# matrices - stored as (:, n_rows, n_cols)-shaped np.arrays.
+
+# Development note: Dealing with pathologic 'flat' triangles in the
+# CubicTriInterpolator code and impact on (2, 2)-matrix inversion functions
+# :func:`_safe_inv22_vectorized` and :func:`_pseudo_inv22sym_vectorized`.
+#
+# Goals:
+# 1) The CubicTriInterpolator should be able to handle flat or almost flat
+# triangles without raising an error,
+# 2) These degenerated triangles should have no impact on the automatic dof
+# calculation (associated with null weight for the _DOF_estimator_geom and
+# with null energy for the _DOF_estimator_min_E),
+# 3) Linear patch test should be passed exactly on degenerated meshes,
+# 4) Interpolation (with :meth:`_interpolate_single_key` or
+# :meth:`_interpolate_multi_key`) shall be correctly handled even *inside*
+# the pathologic triangles, to interact correctly with a TriRefiner class.
+#
+# Difficulties:
+# Flat triangles have rank-deficient *J* (so-called jacobian matrix) and
+# *metric* (the metric tensor = J x J.T). Computation of the local
+# tangent plane is also problematic.
+#
+# Implementation:
+# Most of the time, when computing the inverse of a rank-deficient matrix it
+# is safe to simply return the null matrix (which is the implementation in
+# :func:`_safe_inv22_vectorized`). This is because of point 2), itself
+# enforced by:
+# - null area hence null energy in :class:`_DOF_estimator_min_E`
+# - angles close or equal to 0 or np.pi hence null weight in
+# :class:`_DOF_estimator_geom`.
+# Note that the function angle -> weight is continuous and maximum for an
+# angle np.pi/2 (refer to :meth:`compute_geom_weights`)
+# The exception is the computation of barycentric coordinates, which is done
+# by inversion of the *metric* matrix. In this case, we need to compute a set
+# of valid coordinates (1 among numerous possibilities), to ensure point 4).
+# We benefit here from the symmetry of metric = J x J.T, which makes it easier
+# to compute a pseudo-inverse in :func:`_pseudo_inv22sym_vectorized`
+def _safe_inv22_vectorized(M):
+ """
+ Inversion of arrays of (2, 2) matrices, returns 0 for rank-deficient
+ matrices.
+
+ *M* : array of (2, 2) matrices to inverse, shape (n, 2, 2)
+ """
+ _api.check_shape((None, 2, 2), M=M)
+ M_inv = np.empty_like(M)
+ prod1 = M[:, 0, 0]*M[:, 1, 1]
+ delta = prod1 - M[:, 0, 1]*M[:, 1, 0]
+
+ # We set delta_inv to 0. in case of a rank deficient matrix; a
+ # rank-deficient input matrix *M* will lead to a null matrix in output
+ rank2 = (np.abs(delta) > 1e-8*np.abs(prod1))
+ if np.all(rank2):
+ # Normal 'optimized' flow.
+ delta_inv = 1./delta
+ else:
+ # 'Pathologic' flow.
+ delta_inv = np.zeros(M.shape[0])
+ delta_inv[rank2] = 1./delta[rank2]
+
+ M_inv[:, 0, 0] = M[:, 1, 1]*delta_inv
+ M_inv[:, 0, 1] = -M[:, 0, 1]*delta_inv
+ M_inv[:, 1, 0] = -M[:, 1, 0]*delta_inv
+ M_inv[:, 1, 1] = M[:, 0, 0]*delta_inv
+ return M_inv
+
+
+def _pseudo_inv22sym_vectorized(M):
+ """
+ Inversion of arrays of (2, 2) SYMMETRIC matrices; returns the
+ (Moore-Penrose) pseudo-inverse for rank-deficient matrices.
+
+ In case M is of rank 1, we have M = trace(M) x P where P is the orthogonal
+ projection on Im(M), and we return trace(M)^-1 x P == M / trace(M)**2
+ In case M is of rank 0, we return the null matrix.
+
+ *M* : array of (2, 2) matrices to inverse, shape (n, 2, 2)
+ """
+ _api.check_shape((None, 2, 2), M=M)
+ M_inv = np.empty_like(M)
+ prod1 = M[:, 0, 0]*M[:, 1, 1]
+ delta = prod1 - M[:, 0, 1]*M[:, 1, 0]
+ rank2 = (np.abs(delta) > 1e-8*np.abs(prod1))
+
+ if np.all(rank2):
+ # Normal 'optimized' flow.
+ M_inv[:, 0, 0] = M[:, 1, 1] / delta
+ M_inv[:, 0, 1] = -M[:, 0, 1] / delta
+ M_inv[:, 1, 0] = -M[:, 1, 0] / delta
+ M_inv[:, 1, 1] = M[:, 0, 0] / delta
+ else:
+ # 'Pathologic' flow.
+ # Here we have to deal with 2 sub-cases
+ # 1) First sub-case: matrices of rank 2:
+ delta = delta[rank2]
+ M_inv[rank2, 0, 0] = M[rank2, 1, 1] / delta
+ M_inv[rank2, 0, 1] = -M[rank2, 0, 1] / delta
+ M_inv[rank2, 1, 0] = -M[rank2, 1, 0] / delta
+ M_inv[rank2, 1, 1] = M[rank2, 0, 0] / delta
+ # 2) Second sub-case: rank-deficient matrices of rank 0 and 1:
+ rank01 = ~rank2
+ tr = M[rank01, 0, 0] + M[rank01, 1, 1]
+ tr_zeros = (np.abs(tr) < 1.e-8)
+ sq_tr_inv = (1.-tr_zeros) / (tr**2+tr_zeros)
+ # sq_tr_inv = 1. / tr**2
+ M_inv[rank01, 0, 0] = M[rank01, 0, 0] * sq_tr_inv
+ M_inv[rank01, 0, 1] = M[rank01, 0, 1] * sq_tr_inv
+ M_inv[rank01, 1, 0] = M[rank01, 1, 0] * sq_tr_inv
+ M_inv[rank01, 1, 1] = M[rank01, 1, 1] * sq_tr_inv
+
+ return M_inv
+
+
+def _scalar_vectorized(scalar, M):
+ """
+ Scalar product between scalars and matrices.
+ """
+ return scalar[:, np.newaxis, np.newaxis]*M
+
+
+def _transpose_vectorized(M):
+ """
+ Transposition of an array of matrices *M*.
+ """
+ return np.transpose(M, [0, 2, 1])
+
+
+def _roll_vectorized(M, roll_indices, axis):
+ """
+ Roll an array of matrices along *axis* (0: rows, 1: columns) according to
+ an array of indices *roll_indices*.
+ """
+ assert axis in [0, 1]
+ ndim = M.ndim
+ assert ndim == 3
+ ndim_roll = roll_indices.ndim
+ assert ndim_roll == 1
+ sh = M.shape
+ r, c = sh[-2:]
+ assert sh[0] == roll_indices.shape[0]
+ vec_indices = np.arange(sh[0], dtype=np.int32)
+
+ # Builds the rolled matrix
+ M_roll = np.empty_like(M)
+ if axis == 0:
+ for ir in range(r):
+ for ic in range(c):
+ M_roll[:, ir, ic] = M[vec_indices, (-roll_indices+ir) % r, ic]
+ else: # 1
+ for ir in range(r):
+ for ic in range(c):
+ M_roll[:, ir, ic] = M[vec_indices, ir, (-roll_indices+ic) % c]
+ return M_roll
+
+
+def _to_matrix_vectorized(M):
+ """
+ Build an array of matrices from individuals np.arrays of identical shapes.
+
+ Parameters
+ ----------
+ M
+ ncols-list of nrows-lists of shape sh.
+
+ Returns
+ -------
+ M_res : np.array of shape (sh, nrow, ncols)
+ *M_res* satisfies ``M_res[..., i, j] = M[i][j]``.
+ """
+ assert isinstance(M, (tuple, list))
+ assert all(isinstance(item, (tuple, list)) for item in M)
+ c_vec = np.asarray([len(item) for item in M])
+ assert np.all(c_vec-c_vec[0] == 0)
+ r = len(M)
+ c = c_vec[0]
+ M00 = np.asarray(M[0][0])
+ dt = M00.dtype
+ sh = [M00.shape[0], r, c]
+ M_ret = np.empty(sh, dtype=dt)
+ for irow in range(r):
+ for icol in range(c):
+ M_ret[:, irow, icol] = np.asarray(M[irow][icol])
+ return M_ret
+
+
+def _extract_submatrices(M, block_indices, block_size, axis):
+ """
+ Extract selected blocks of a matrices *M* depending on parameters
+ *block_indices* and *block_size*.
+
+ Returns the array of extracted matrices *Mres* so that ::
+
+ M_res[..., ir, :] = M[(block_indices*block_size+ir), :]
+ """
+ assert block_indices.ndim == 1
+ assert axis in [0, 1]
+
+ r, c = M.shape
+ if axis == 0:
+ sh = [block_indices.shape[0], block_size, c]
+ else: # 1
+ sh = [block_indices.shape[0], r, block_size]
+
+ dt = M.dtype
+ M_res = np.empty(sh, dtype=dt)
+ if axis == 0:
+ for ir in range(block_size):
+ M_res[:, ir, :] = M[(block_indices*block_size+ir), :]
+ else: # 1
+ for ic in range(block_size):
+ M_res[:, :, ic] = M[:, (block_indices*block_size+ic)]
+
+ return M_res
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triinterpolate.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triinterpolate.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..33b2fd8be4cdac2437ead73c6be972902edfcb4f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triinterpolate.pyi
@@ -0,0 +1,32 @@
+from matplotlib.tri import Triangulation, TriFinder
+
+from typing import Literal
+import numpy as np
+from numpy.typing import ArrayLike
+
+class TriInterpolator:
+ def __init__(
+ self,
+ triangulation: Triangulation,
+ z: ArrayLike,
+ trifinder: TriFinder | None = ...,
+ ) -> None: ...
+ # __call__ and gradient are not actually implemented by the ABC, but are specified as required
+ def __call__(self, x: ArrayLike, y: ArrayLike) -> np.ma.MaskedArray: ...
+ def gradient(
+ self, x: ArrayLike, y: ArrayLike
+ ) -> tuple[np.ma.MaskedArray, np.ma.MaskedArray]: ...
+
+class LinearTriInterpolator(TriInterpolator): ...
+
+class CubicTriInterpolator(TriInterpolator):
+ def __init__(
+ self,
+ triangulation: Triangulation,
+ z: ArrayLike,
+ kind: Literal["min_E", "geom", "user"] = ...,
+ trifinder: TriFinder | None = ...,
+ dz: tuple[ArrayLike, ArrayLike] | None = ...,
+ ) -> None: ...
+
+__all__ = ('TriInterpolator', 'LinearTriInterpolator', 'CubicTriInterpolator')
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tripcolor.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tripcolor.py
new file mode 100644
index 0000000000000000000000000000000000000000..f3c26b0b25ffa7bd5b449c77f765dd5e66d4801c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tripcolor.py
@@ -0,0 +1,167 @@
+import numpy as np
+
+from matplotlib import _api, _docstring
+from matplotlib.collections import PolyCollection, TriMesh
+from matplotlib.tri._triangulation import Triangulation
+
+
+@_docstring.interpd
+def tripcolor(ax, *args, alpha=1.0, norm=None, cmap=None, vmin=None,
+ vmax=None, shading='flat', facecolors=None, **kwargs):
+ """
+ Create a pseudocolor plot of an unstructured triangular grid.
+
+ Call signatures::
+
+ tripcolor(triangulation, c, *, ...)
+ tripcolor(x, y, c, *, [triangles=triangles], [mask=mask], ...)
+
+ The triangular grid can be specified either by passing a `.Triangulation`
+ object as the first parameter, or by passing the points *x*, *y* and
+ optionally the *triangles* and a *mask*. See `.Triangulation` for an
+ explanation of these parameters.
+
+ It is possible to pass the triangles positionally, i.e.
+ ``tripcolor(x, y, triangles, c, ...)``. However, this is discouraged.
+ For more clarity, pass *triangles* via keyword argument.
+
+ If neither of *triangulation* or *triangles* are given, the triangulation
+ is calculated on the fly. In this case, it does not make sense to provide
+ colors at the triangle faces via *c* or *facecolors* because there are
+ multiple possible triangulations for a group of points and you don't know
+ which triangles will be constructed.
+
+ Parameters
+ ----------
+ triangulation : `.Triangulation`
+ An already created triangular grid.
+ x, y, triangles, mask
+ Parameters defining the triangular grid. See `.Triangulation`.
+ This is mutually exclusive with specifying *triangulation*.
+ c : array-like
+ The color values, either for the points or for the triangles. Which one
+ is automatically inferred from the length of *c*, i.e. does it match
+ the number of points or the number of triangles. If there are the same
+ number of points and triangles in the triangulation it is assumed that
+ color values are defined at points; to force the use of color values at
+ triangles use the keyword argument ``facecolors=c`` instead of just
+ ``c``.
+ This parameter is position-only.
+ facecolors : array-like, optional
+ Can be used alternatively to *c* to specify colors at the triangle
+ faces. This parameter takes precedence over *c*.
+ shading : {'flat', 'gouraud'}, default: 'flat'
+ If 'flat' and the color values *c* are defined at points, the color
+ values used for each triangle are from the mean c of the triangle's
+ three points. If *shading* is 'gouraud' then color values must be
+ defined at points.
+ %(cmap_doc)s
+
+ %(norm_doc)s
+
+ %(vmin_vmax_doc)s
+
+ %(colorizer_doc)s
+
+ Returns
+ -------
+ `~matplotlib.collections.PolyCollection` or `~matplotlib.collections.TriMesh`
+ The result depends on *shading*: For ``shading='flat'`` the result is a
+ `.PolyCollection`, for ``shading='gouraud'`` the result is a `.TriMesh`.
+
+ Other Parameters
+ ----------------
+ **kwargs : `~matplotlib.collections.Collection` properties
+
+ %(Collection:kwdoc)s
+ """
+ _api.check_in_list(['flat', 'gouraud'], shading=shading)
+
+ tri, args, kwargs = Triangulation.get_from_args_and_kwargs(*args, **kwargs)
+
+ # Parse the color to be in one of (the other variable will be None):
+ # - facecolors: if specified at the triangle faces
+ # - point_colors: if specified at the points
+ if facecolors is not None:
+ if args:
+ _api.warn_external(
+ "Positional parameter c has no effect when the keyword "
+ "facecolors is given")
+ point_colors = None
+ if len(facecolors) != len(tri.triangles):
+ raise ValueError("The length of facecolors must match the number "
+ "of triangles")
+ else:
+ # Color from positional parameter c
+ if not args:
+ raise TypeError(
+ "tripcolor() missing 1 required positional argument: 'c'; or "
+ "1 required keyword-only argument: 'facecolors'")
+ elif len(args) > 1:
+ raise TypeError(f"Unexpected positional parameters: {args[1:]!r}")
+ c = np.asarray(args[0])
+ if len(c) == len(tri.x):
+ # having this before the len(tri.triangles) comparison gives
+ # precedence to nodes if there are as many nodes as triangles
+ point_colors = c
+ facecolors = None
+ elif len(c) == len(tri.triangles):
+ point_colors = None
+ facecolors = c
+ else:
+ raise ValueError('The length of c must match either the number '
+ 'of points or the number of triangles')
+
+ # Handling of linewidths, shading, edgecolors and antialiased as
+ # in Axes.pcolor
+ linewidths = (0.25,)
+ if 'linewidth' in kwargs:
+ kwargs['linewidths'] = kwargs.pop('linewidth')
+ kwargs.setdefault('linewidths', linewidths)
+
+ edgecolors = 'none'
+ if 'edgecolor' in kwargs:
+ kwargs['edgecolors'] = kwargs.pop('edgecolor')
+ ec = kwargs.setdefault('edgecolors', edgecolors)
+
+ if 'antialiased' in kwargs:
+ kwargs['antialiaseds'] = kwargs.pop('antialiased')
+ if 'antialiaseds' not in kwargs and ec.lower() == "none":
+ kwargs['antialiaseds'] = False
+
+ if shading == 'gouraud':
+ if facecolors is not None:
+ raise ValueError(
+ "shading='gouraud' can only be used when the colors "
+ "are specified at the points, not at the faces.")
+ collection = TriMesh(tri, alpha=alpha, array=point_colors,
+ cmap=cmap, norm=norm, **kwargs)
+ else: # 'flat'
+ # Vertices of triangles.
+ maskedTris = tri.get_masked_triangles()
+ verts = np.stack((tri.x[maskedTris], tri.y[maskedTris]), axis=-1)
+
+ # Color values.
+ if facecolors is None:
+ # One color per triangle, the mean of the 3 vertex color values.
+ colors = point_colors[maskedTris].mean(axis=1)
+ elif tri.mask is not None:
+ # Remove color values of masked triangles.
+ colors = facecolors[~tri.mask]
+ else:
+ colors = facecolors
+ collection = PolyCollection(verts, alpha=alpha, array=colors,
+ cmap=cmap, norm=norm, **kwargs)
+
+ collection._scale_norm(norm, vmin, vmax)
+ ax.grid(False)
+
+ minx = tri.x.min()
+ maxx = tri.x.max()
+ miny = tri.y.min()
+ maxy = tri.y.max()
+ corners = (minx, miny), (maxx, maxy)
+ ax.update_datalim(corners)
+ ax.autoscale_view()
+ ax.add_collection(collection)
+ return collection
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tripcolor.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tripcolor.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..42acffcdc52e0215508a5038ffa292396a457549
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tripcolor.pyi
@@ -0,0 +1,71 @@
+from matplotlib.axes import Axes
+from matplotlib.collections import PolyCollection, TriMesh
+from matplotlib.colors import Normalize, Colormap
+from matplotlib.tri._triangulation import Triangulation
+
+from numpy.typing import ArrayLike
+
+from typing import overload, Literal
+
+@overload
+def tripcolor(
+ ax: Axes,
+ triangulation: Triangulation,
+ c: ArrayLike = ...,
+ *,
+ alpha: float = ...,
+ norm: str | Normalize | None = ...,
+ cmap: str | Colormap | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ shading: Literal["flat"] = ...,
+ facecolors: ArrayLike | None = ...,
+ **kwargs
+) -> PolyCollection: ...
+@overload
+def tripcolor(
+ ax: Axes,
+ x: ArrayLike,
+ y: ArrayLike,
+ c: ArrayLike = ...,
+ *,
+ alpha: float = ...,
+ norm: str | Normalize | None = ...,
+ cmap: str | Colormap | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ shading: Literal["flat"] = ...,
+ facecolors: ArrayLike | None = ...,
+ **kwargs
+) -> PolyCollection: ...
+@overload
+def tripcolor(
+ ax: Axes,
+ triangulation: Triangulation,
+ c: ArrayLike = ...,
+ *,
+ alpha: float = ...,
+ norm: str | Normalize | None = ...,
+ cmap: str | Colormap | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ shading: Literal["gouraud"],
+ facecolors: ArrayLike | None = ...,
+ **kwargs
+) -> TriMesh: ...
+@overload
+def tripcolor(
+ ax: Axes,
+ x: ArrayLike,
+ y: ArrayLike,
+ c: ArrayLike = ...,
+ *,
+ alpha: float = ...,
+ norm: str | Normalize | None = ...,
+ cmap: str | Colormap | None = ...,
+ vmin: float | None = ...,
+ vmax: float | None = ...,
+ shading: Literal["gouraud"],
+ facecolors: ArrayLike | None = ...,
+ **kwargs
+) -> TriMesh: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triplot.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triplot.py
new file mode 100644
index 0000000000000000000000000000000000000000..6168946b153180f8e6439a01885263eaa017280a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triplot.py
@@ -0,0 +1,86 @@
+import numpy as np
+from matplotlib.tri._triangulation import Triangulation
+import matplotlib.cbook as cbook
+import matplotlib.lines as mlines
+
+
+def triplot(ax, *args, **kwargs):
+ """
+ Draw an unstructured triangular grid as lines and/or markers.
+
+ Call signatures::
+
+ triplot(triangulation, ...)
+ triplot(x, y, [triangles], *, [mask=mask], ...)
+
+ The triangular grid can be specified either by passing a `.Triangulation`
+ object as the first parameter, or by passing the points *x*, *y* and
+ optionally the *triangles* and a *mask*. If neither of *triangulation* or
+ *triangles* are given, the triangulation is calculated on the fly.
+
+ Parameters
+ ----------
+ triangulation : `.Triangulation`
+ An already created triangular grid.
+ x, y, triangles, mask
+ Parameters defining the triangular grid. See `.Triangulation`.
+ This is mutually exclusive with specifying *triangulation*.
+ other_parameters
+ All other args and kwargs are forwarded to `~.Axes.plot`.
+
+ Returns
+ -------
+ lines : `~matplotlib.lines.Line2D`
+ The drawn triangles edges.
+ markers : `~matplotlib.lines.Line2D`
+ The drawn marker nodes.
+ """
+ import matplotlib.axes
+
+ tri, args, kwargs = Triangulation.get_from_args_and_kwargs(*args, **kwargs)
+ x, y, edges = (tri.x, tri.y, tri.edges)
+
+ # Decode plot format string, e.g., 'ro-'
+ fmt = args[0] if args else ""
+ linestyle, marker, color = matplotlib.axes._base._process_plot_format(fmt)
+
+ # Insert plot format string into a copy of kwargs (kwargs values prevail).
+ kw = cbook.normalize_kwargs(kwargs, mlines.Line2D)
+ for key, val in zip(('linestyle', 'marker', 'color'),
+ (linestyle, marker, color)):
+ if val is not None:
+ kw.setdefault(key, val)
+
+ # Draw lines without markers.
+ # Note 1: If we drew markers here, most markers would be drawn more than
+ # once as they belong to several edges.
+ # Note 2: We insert nan values in the flattened edges arrays rather than
+ # plotting directly (triang.x[edges].T, triang.y[edges].T)
+ # as it considerably speeds-up code execution.
+ linestyle = kw['linestyle']
+ kw_lines = {
+ **kw,
+ 'marker': 'None', # No marker to draw.
+ 'zorder': kw.get('zorder', 1), # Path default zorder is used.
+ }
+ if linestyle not in [None, 'None', '', ' ']:
+ tri_lines_x = np.insert(x[edges], 2, np.nan, axis=1)
+ tri_lines_y = np.insert(y[edges], 2, np.nan, axis=1)
+ tri_lines = ax.plot(tri_lines_x.ravel(), tri_lines_y.ravel(),
+ **kw_lines)
+ else:
+ tri_lines = ax.plot([], [], **kw_lines)
+
+ # Draw markers separately.
+ marker = kw['marker']
+ kw_markers = {
+ **kw,
+ 'linestyle': 'None', # No line to draw.
+ }
+ kw_markers.pop('label', None)
+ if marker not in [None, 'None', '', ' ']:
+ tri_markers = ax.plot(x, y, **kw_markers)
+ else:
+ tri_markers = ax.plot([], [], **kw_markers)
+
+ return tri_lines + tri_markers
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triplot.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triplot.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..6224276afdb86dd85d85f1be24c8c62d73fb963c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_triplot.pyi
@@ -0,0 +1,15 @@
+from matplotlib.tri._triangulation import Triangulation
+from matplotlib.axes import Axes
+from matplotlib.lines import Line2D
+
+from typing import overload
+from numpy.typing import ArrayLike
+
+@overload
+def triplot(
+ ax: Axes, triangulation: Triangulation, *args, **kwargs
+) -> tuple[Line2D, Line2D]: ...
+@overload
+def triplot(
+ ax: Axes, x: ArrayLike, y: ArrayLike, triangles: ArrayLike = ..., *args, **kwargs
+) -> tuple[Line2D, Line2D]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trirefine.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trirefine.py
new file mode 100644
index 0000000000000000000000000000000000000000..7f5110ab9e218e24683acd1489d38bded16c7420
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trirefine.py
@@ -0,0 +1,307 @@
+"""
+Mesh refinement for triangular grids.
+"""
+
+import numpy as np
+
+from matplotlib import _api
+from matplotlib.tri._triangulation import Triangulation
+import matplotlib.tri._triinterpolate
+
+
+class TriRefiner:
+ """
+ Abstract base class for classes implementing mesh refinement.
+
+ A TriRefiner encapsulates a Triangulation object and provides tools for
+ mesh refinement and interpolation.
+
+ Derived classes must implement:
+
+ - ``refine_triangulation(return_tri_index=False, **kwargs)`` , where
+ the optional keyword arguments *kwargs* are defined in each
+ TriRefiner concrete implementation, and which returns:
+
+ - a refined triangulation,
+ - optionally (depending on *return_tri_index*), for each
+ point of the refined triangulation: the index of
+ the initial triangulation triangle to which it belongs.
+
+ - ``refine_field(z, triinterpolator=None, **kwargs)``, where:
+
+ - *z* array of field values (to refine) defined at the base
+ triangulation nodes,
+ - *triinterpolator* is an optional `~matplotlib.tri.TriInterpolator`,
+ - the other optional keyword arguments *kwargs* are defined in
+ each TriRefiner concrete implementation;
+
+ and which returns (as a tuple) a refined triangular mesh and the
+ interpolated values of the field at the refined triangulation nodes.
+ """
+
+ def __init__(self, triangulation):
+ _api.check_isinstance(Triangulation, triangulation=triangulation)
+ self._triangulation = triangulation
+
+
+class UniformTriRefiner(TriRefiner):
+ """
+ Uniform mesh refinement by recursive subdivisions.
+
+ Parameters
+ ----------
+ triangulation : `~matplotlib.tri.Triangulation`
+ The encapsulated triangulation (to be refined)
+ """
+# See Also
+# --------
+# :class:`~matplotlib.tri.CubicTriInterpolator` and
+# :class:`~matplotlib.tri.TriAnalyzer`.
+# """
+ def __init__(self, triangulation):
+ super().__init__(triangulation)
+
+ def refine_triangulation(self, return_tri_index=False, subdiv=3):
+ """
+ Compute a uniformly refined triangulation *refi_triangulation* of
+ the encapsulated :attr:`triangulation`.
+
+ This function refines the encapsulated triangulation by splitting each
+ father triangle into 4 child sub-triangles built on the edges midside
+ nodes, recursing *subdiv* times. In the end, each triangle is hence
+ divided into ``4**subdiv`` child triangles.
+
+ Parameters
+ ----------
+ return_tri_index : bool, default: False
+ Whether an index table indicating the father triangle index of each
+ point is returned.
+ subdiv : int, default: 3
+ Recursion level for the subdivision.
+ Each triangle is divided into ``4**subdiv`` child triangles;
+ hence, the default results in 64 refined subtriangles for each
+ triangle of the initial triangulation.
+
+ Returns
+ -------
+ refi_triangulation : `~matplotlib.tri.Triangulation`
+ The refined triangulation.
+ found_index : int array
+ Index of the initial triangulation containing triangle, for each
+ point of *refi_triangulation*.
+ Returned only if *return_tri_index* is set to True.
+ """
+ refi_triangulation = self._triangulation
+ ntri = refi_triangulation.triangles.shape[0]
+
+ # Computes the triangulation ancestors numbers in the reference
+ # triangulation.
+ ancestors = np.arange(ntri, dtype=np.int32)
+ for _ in range(subdiv):
+ refi_triangulation, ancestors = self._refine_triangulation_once(
+ refi_triangulation, ancestors)
+ refi_npts = refi_triangulation.x.shape[0]
+ refi_triangles = refi_triangulation.triangles
+
+ # Now we compute found_index table if needed
+ if return_tri_index:
+ # We have to initialize found_index with -1 because some nodes
+ # may very well belong to no triangle at all, e.g., in case of
+ # Delaunay Triangulation with DuplicatePointWarning.
+ found_index = np.full(refi_npts, -1, dtype=np.int32)
+ tri_mask = self._triangulation.mask
+ if tri_mask is None:
+ found_index[refi_triangles] = np.repeat(ancestors,
+ 3).reshape(-1, 3)
+ else:
+ # There is a subtlety here: we want to avoid whenever possible
+ # that refined points container is a masked triangle (which
+ # would result in artifacts in plots).
+ # So we impose the numbering from masked ancestors first,
+ # then overwrite it with unmasked ancestor numbers.
+ ancestor_mask = tri_mask[ancestors]
+ found_index[refi_triangles[ancestor_mask, :]
+ ] = np.repeat(ancestors[ancestor_mask],
+ 3).reshape(-1, 3)
+ found_index[refi_triangles[~ancestor_mask, :]
+ ] = np.repeat(ancestors[~ancestor_mask],
+ 3).reshape(-1, 3)
+ return refi_triangulation, found_index
+ else:
+ return refi_triangulation
+
+ def refine_field(self, z, triinterpolator=None, subdiv=3):
+ """
+ Refine a field defined on the encapsulated triangulation.
+
+ Parameters
+ ----------
+ z : (npoints,) array-like
+ Values of the field to refine, defined at the nodes of the
+ encapsulated triangulation. (``n_points`` is the number of points
+ in the initial triangulation)
+ triinterpolator : `~matplotlib.tri.TriInterpolator`, optional
+ Interpolator used for field interpolation. If not specified,
+ a `~matplotlib.tri.CubicTriInterpolator` will be used.
+ subdiv : int, default: 3
+ Recursion level for the subdivision.
+ Each triangle is divided into ``4**subdiv`` child triangles.
+
+ Returns
+ -------
+ refi_tri : `~matplotlib.tri.Triangulation`
+ The returned refined triangulation.
+ refi_z : 1D array of length: *refi_tri* node count.
+ The returned interpolated field (at *refi_tri* nodes).
+ """
+ if triinterpolator is None:
+ interp = matplotlib.tri.CubicTriInterpolator(
+ self._triangulation, z)
+ else:
+ _api.check_isinstance(matplotlib.tri.TriInterpolator,
+ triinterpolator=triinterpolator)
+ interp = triinterpolator
+
+ refi_tri, found_index = self.refine_triangulation(
+ subdiv=subdiv, return_tri_index=True)
+ refi_z = interp._interpolate_multikeys(
+ refi_tri.x, refi_tri.y, tri_index=found_index)[0]
+ return refi_tri, refi_z
+
+ @staticmethod
+ def _refine_triangulation_once(triangulation, ancestors=None):
+ """
+ Refine a `.Triangulation` by splitting each triangle into 4
+ child-masked_triangles built on the edges midside nodes.
+
+ Masked triangles, if present, are also split, but their children
+ returned masked.
+
+ If *ancestors* is not provided, returns only a new triangulation:
+ child_triangulation.
+
+ If the array-like key table *ancestor* is given, it shall be of shape
+ (ntri,) where ntri is the number of *triangulation* masked_triangles.
+ In this case, the function returns
+ (child_triangulation, child_ancestors)
+ child_ancestors is defined so that the 4 child masked_triangles share
+ the same index as their father: child_ancestors.shape = (4 * ntri,).
+ """
+
+ x = triangulation.x
+ y = triangulation.y
+
+ # According to tri.triangulation doc:
+ # neighbors[i, j] is the triangle that is the neighbor
+ # to the edge from point index masked_triangles[i, j] to point
+ # index masked_triangles[i, (j+1)%3].
+ neighbors = triangulation.neighbors
+ triangles = triangulation.triangles
+ npts = np.shape(x)[0]
+ ntri = np.shape(triangles)[0]
+ if ancestors is not None:
+ ancestors = np.asarray(ancestors)
+ if np.shape(ancestors) != (ntri,):
+ raise ValueError(
+ "Incompatible shapes provide for "
+ "triangulation.masked_triangles and ancestors: "
+ f"{np.shape(triangles)} and {np.shape(ancestors)}")
+
+ # Initiating tables refi_x and refi_y of the refined triangulation
+ # points
+ # hint: each apex is shared by 2 masked_triangles except the borders.
+ borders = np.sum(neighbors == -1)
+ added_pts = (3*ntri + borders) // 2
+ refi_npts = npts + added_pts
+ refi_x = np.zeros(refi_npts)
+ refi_y = np.zeros(refi_npts)
+
+ # First part of refi_x, refi_y is just the initial points
+ refi_x[:npts] = x
+ refi_y[:npts] = y
+
+ # Second part contains the edge midside nodes.
+ # Each edge belongs to 1 triangle (if border edge) or is shared by 2
+ # masked_triangles (interior edge).
+ # We first build 2 * ntri arrays of edge starting nodes (edge_elems,
+ # edge_apexes); we then extract only the masters to avoid overlaps.
+ # The so-called 'master' is the triangle with biggest index
+ # The 'slave' is the triangle with lower index
+ # (can be -1 if border edge)
+ # For slave and master we will identify the apex pointing to the edge
+ # start
+ edge_elems = np.tile(np.arange(ntri, dtype=np.int32), 3)
+ edge_apexes = np.repeat(np.arange(3, dtype=np.int32), ntri)
+ edge_neighbors = neighbors[edge_elems, edge_apexes]
+ mask_masters = (edge_elems > edge_neighbors)
+
+ # Identifying the "masters" and adding to refi_x, refi_y vec
+ masters = edge_elems[mask_masters]
+ apex_masters = edge_apexes[mask_masters]
+ x_add = (x[triangles[masters, apex_masters]] +
+ x[triangles[masters, (apex_masters+1) % 3]]) * 0.5
+ y_add = (y[triangles[masters, apex_masters]] +
+ y[triangles[masters, (apex_masters+1) % 3]]) * 0.5
+ refi_x[npts:] = x_add
+ refi_y[npts:] = y_add
+
+ # Building the new masked_triangles; each old masked_triangles hosts
+ # 4 new masked_triangles
+ # there are 6 pts to identify per 'old' triangle, 3 new_pt_corner and
+ # 3 new_pt_midside
+ new_pt_corner = triangles
+
+ # What is the index in refi_x, refi_y of point at middle of apex iapex
+ # of elem ielem ?
+ # If ielem is the apex master: simple count, given the way refi_x was
+ # built.
+ # If ielem is the apex slave: yet we do not know; but we will soon
+ # using the neighbors table.
+ new_pt_midside = np.empty([ntri, 3], dtype=np.int32)
+ cum_sum = npts
+ for imid in range(3):
+ mask_st_loc = (imid == apex_masters)
+ n_masters_loc = np.sum(mask_st_loc)
+ elem_masters_loc = masters[mask_st_loc]
+ new_pt_midside[:, imid][elem_masters_loc] = np.arange(
+ n_masters_loc, dtype=np.int32) + cum_sum
+ cum_sum += n_masters_loc
+
+ # Now dealing with slave elems.
+ # for each slave element we identify the master and then the inode
+ # once slave_masters is identified, slave_masters_apex is such that:
+ # neighbors[slaves_masters, slave_masters_apex] == slaves
+ mask_slaves = np.logical_not(mask_masters)
+ slaves = edge_elems[mask_slaves]
+ slaves_masters = edge_neighbors[mask_slaves]
+ diff_table = np.abs(neighbors[slaves_masters, :] -
+ np.outer(slaves, np.ones(3, dtype=np.int32)))
+ slave_masters_apex = np.argmin(diff_table, axis=1)
+ slaves_apex = edge_apexes[mask_slaves]
+ new_pt_midside[slaves, slaves_apex] = new_pt_midside[
+ slaves_masters, slave_masters_apex]
+
+ # Builds the 4 child masked_triangles
+ child_triangles = np.empty([ntri*4, 3], dtype=np.int32)
+ child_triangles[0::4, :] = np.vstack([
+ new_pt_corner[:, 0], new_pt_midside[:, 0],
+ new_pt_midside[:, 2]]).T
+ child_triangles[1::4, :] = np.vstack([
+ new_pt_corner[:, 1], new_pt_midside[:, 1],
+ new_pt_midside[:, 0]]).T
+ child_triangles[2::4, :] = np.vstack([
+ new_pt_corner[:, 2], new_pt_midside[:, 2],
+ new_pt_midside[:, 1]]).T
+ child_triangles[3::4, :] = np.vstack([
+ new_pt_midside[:, 0], new_pt_midside[:, 1],
+ new_pt_midside[:, 2]]).T
+ child_triangulation = Triangulation(refi_x, refi_y, child_triangles)
+
+ # Builds the child mask
+ if triangulation.mask is not None:
+ child_triangulation.set_mask(np.repeat(triangulation.mask, 4))
+
+ if ancestors is None:
+ return child_triangulation
+ else:
+ return child_triangulation, np.repeat(ancestors, 4)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trirefine.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trirefine.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..7c60dc76e2f158325ad2b143abe4228599ee1b83
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_trirefine.pyi
@@ -0,0 +1,31 @@
+from typing import Literal, overload
+
+import numpy as np
+from numpy.typing import ArrayLike
+
+from matplotlib.tri._triangulation import Triangulation
+from matplotlib.tri._triinterpolate import TriInterpolator
+
+class TriRefiner:
+ def __init__(self, triangulation: Triangulation) -> None: ...
+
+class UniformTriRefiner(TriRefiner):
+ def __init__(self, triangulation: Triangulation) -> None: ...
+ @overload
+ def refine_triangulation(
+ self, *, return_tri_index: Literal[True], subdiv: int = ...
+ ) -> tuple[Triangulation, np.ndarray]: ...
+ @overload
+ def refine_triangulation(
+ self, return_tri_index: Literal[False] = ..., subdiv: int = ...
+ ) -> Triangulation: ...
+ @overload
+ def refine_triangulation(
+ self, return_tri_index: bool = ..., subdiv: int = ...
+ ) -> tuple[Triangulation, np.ndarray] | Triangulation: ...
+ def refine_field(
+ self,
+ z: ArrayLike,
+ triinterpolator: TriInterpolator | None = ...,
+ subdiv: int = ...,
+ ) -> tuple[Triangulation, np.ndarray]: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tritools.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tritools.py
new file mode 100644
index 0000000000000000000000000000000000000000..9837309f7e810ba1c9d41aa52a9856cb6e1aa062
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tritools.py
@@ -0,0 +1,263 @@
+"""
+Tools for triangular grids.
+"""
+
+import numpy as np
+
+from matplotlib import _api
+from matplotlib.tri import Triangulation
+
+
+class TriAnalyzer:
+ """
+ Define basic tools for triangular mesh analysis and improvement.
+
+ A TriAnalyzer encapsulates a `.Triangulation` object and provides basic
+ tools for mesh analysis and mesh improvement.
+
+ Attributes
+ ----------
+ scale_factors
+
+ Parameters
+ ----------
+ triangulation : `~matplotlib.tri.Triangulation`
+ The encapsulated triangulation to analyze.
+ """
+
+ def __init__(self, triangulation):
+ _api.check_isinstance(Triangulation, triangulation=triangulation)
+ self._triangulation = triangulation
+
+ @property
+ def scale_factors(self):
+ """
+ Factors to rescale the triangulation into a unit square.
+
+ Returns
+ -------
+ (float, float)
+ Scaling factors (kx, ky) so that the triangulation
+ ``[triangulation.x * kx, triangulation.y * ky]``
+ fits exactly inside a unit square.
+ """
+ compressed_triangles = self._triangulation.get_masked_triangles()
+ node_used = (np.bincount(np.ravel(compressed_triangles),
+ minlength=self._triangulation.x.size) != 0)
+ return (1 / np.ptp(self._triangulation.x[node_used]),
+ 1 / np.ptp(self._triangulation.y[node_used]))
+
+ def circle_ratios(self, rescale=True):
+ """
+ Return a measure of the triangulation triangles flatness.
+
+ The ratio of the incircle radius over the circumcircle radius is a
+ widely used indicator of a triangle flatness.
+ It is always ``<= 0.5`` and ``== 0.5`` only for equilateral
+ triangles. Circle ratios below 0.01 denote very flat triangles.
+
+ To avoid unduly low values due to a difference of scale between the 2
+ axis, the triangular mesh can first be rescaled to fit inside a unit
+ square with `scale_factors` (Only if *rescale* is True, which is
+ its default value).
+
+ Parameters
+ ----------
+ rescale : bool, default: True
+ If True, internally rescale (based on `scale_factors`), so that the
+ (unmasked) triangles fit exactly inside a unit square mesh.
+
+ Returns
+ -------
+ masked array
+ Ratio of the incircle radius over the circumcircle radius, for
+ each 'rescaled' triangle of the encapsulated triangulation.
+ Values corresponding to masked triangles are masked out.
+
+ """
+ # Coords rescaling
+ if rescale:
+ (kx, ky) = self.scale_factors
+ else:
+ (kx, ky) = (1.0, 1.0)
+ pts = np.vstack([self._triangulation.x*kx,
+ self._triangulation.y*ky]).T
+ tri_pts = pts[self._triangulation.triangles]
+ # Computes the 3 side lengths
+ a = tri_pts[:, 1, :] - tri_pts[:, 0, :]
+ b = tri_pts[:, 2, :] - tri_pts[:, 1, :]
+ c = tri_pts[:, 0, :] - tri_pts[:, 2, :]
+ a = np.hypot(a[:, 0], a[:, 1])
+ b = np.hypot(b[:, 0], b[:, 1])
+ c = np.hypot(c[:, 0], c[:, 1])
+ # circumcircle and incircle radii
+ s = (a+b+c)*0.5
+ prod = s*(a+b-s)*(a+c-s)*(b+c-s)
+ # We have to deal with flat triangles with infinite circum_radius
+ bool_flat = (prod == 0.)
+ if np.any(bool_flat):
+ # Pathologic flow
+ ntri = tri_pts.shape[0]
+ circum_radius = np.empty(ntri, dtype=np.float64)
+ circum_radius[bool_flat] = np.inf
+ abc = a*b*c
+ circum_radius[~bool_flat] = abc[~bool_flat] / (
+ 4.0*np.sqrt(prod[~bool_flat]))
+ else:
+ # Normal optimized flow
+ circum_radius = (a*b*c) / (4.0*np.sqrt(prod))
+ in_radius = (a*b*c) / (4.0*circum_radius*s)
+ circle_ratio = in_radius/circum_radius
+ mask = self._triangulation.mask
+ if mask is None:
+ return circle_ratio
+ else:
+ return np.ma.array(circle_ratio, mask=mask)
+
+ def get_flat_tri_mask(self, min_circle_ratio=0.01, rescale=True):
+ """
+ Eliminate excessively flat border triangles from the triangulation.
+
+ Returns a mask *new_mask* which allows to clean the encapsulated
+ triangulation from its border-located flat triangles
+ (according to their :meth:`circle_ratios`).
+ This mask is meant to be subsequently applied to the triangulation
+ using `.Triangulation.set_mask`.
+ *new_mask* is an extension of the initial triangulation mask
+ in the sense that an initially masked triangle will remain masked.
+
+ The *new_mask* array is computed recursively; at each step flat
+ triangles are removed only if they share a side with the current mesh
+ border. Thus, no new holes in the triangulated domain will be created.
+
+ Parameters
+ ----------
+ min_circle_ratio : float, default: 0.01
+ Border triangles with incircle/circumcircle radii ratio r/R will
+ be removed if r/R < *min_circle_ratio*.
+ rescale : bool, default: True
+ If True, first, internally rescale (based on `scale_factors`) so
+ that the (unmasked) triangles fit exactly inside a unit square
+ mesh. This rescaling accounts for the difference of scale which
+ might exist between the 2 axis.
+
+ Returns
+ -------
+ array of bool
+ Mask to apply to encapsulated triangulation.
+ All the initially masked triangles remain masked in the
+ *new_mask*.
+
+ Notes
+ -----
+ The rationale behind this function is that a Delaunay
+ triangulation - of an unstructured set of points - sometimes contains
+ almost flat triangles at its border, leading to artifacts in plots
+ (especially for high-resolution contouring).
+ Masked with computed *new_mask*, the encapsulated
+ triangulation would contain no more unmasked border triangles
+ with a circle ratio below *min_circle_ratio*, thus improving the
+ mesh quality for subsequent plots or interpolation.
+ """
+ # Recursively computes the mask_current_borders, true if a triangle is
+ # at the border of the mesh OR touching the border through a chain of
+ # invalid aspect ratio masked_triangles.
+ ntri = self._triangulation.triangles.shape[0]
+ mask_bad_ratio = self.circle_ratios(rescale) < min_circle_ratio
+
+ current_mask = self._triangulation.mask
+ if current_mask is None:
+ current_mask = np.zeros(ntri, dtype=bool)
+ valid_neighbors = np.copy(self._triangulation.neighbors)
+ renum_neighbors = np.arange(ntri, dtype=np.int32)
+ nadd = -1
+ while nadd != 0:
+ # The active wavefront is the triangles from the border (unmasked
+ # but with a least 1 neighbor equal to -1
+ wavefront = (np.min(valid_neighbors, axis=1) == -1) & ~current_mask
+ # The element from the active wavefront will be masked if their
+ # circle ratio is bad.
+ added_mask = wavefront & mask_bad_ratio
+ current_mask = added_mask | current_mask
+ nadd = np.sum(added_mask)
+
+ # now we have to update the tables valid_neighbors
+ valid_neighbors[added_mask, :] = -1
+ renum_neighbors[added_mask] = -1
+ valid_neighbors = np.where(valid_neighbors == -1, -1,
+ renum_neighbors[valid_neighbors])
+
+ return np.ma.filled(current_mask, True)
+
+ def _get_compressed_triangulation(self):
+ """
+ Compress (if masked) the encapsulated triangulation.
+
+ Returns minimal-length triangles array (*compressed_triangles*) and
+ coordinates arrays (*compressed_x*, *compressed_y*) that can still
+ describe the unmasked triangles of the encapsulated triangulation.
+
+ Returns
+ -------
+ compressed_triangles : array-like
+ the returned compressed triangulation triangles
+ compressed_x : array-like
+ the returned compressed triangulation 1st coordinate
+ compressed_y : array-like
+ the returned compressed triangulation 2nd coordinate
+ tri_renum : int array
+ renumbering table to translate the triangle numbers from the
+ encapsulated triangulation into the new (compressed) renumbering.
+ -1 for masked triangles (deleted from *compressed_triangles*).
+ node_renum : int array
+ renumbering table to translate the point numbers from the
+ encapsulated triangulation into the new (compressed) renumbering.
+ -1 for unused points (i.e. those deleted from *compressed_x* and
+ *compressed_y*).
+
+ """
+ # Valid triangles and renumbering
+ tri_mask = self._triangulation.mask
+ compressed_triangles = self._triangulation.get_masked_triangles()
+ ntri = self._triangulation.triangles.shape[0]
+ if tri_mask is not None:
+ tri_renum = self._total_to_compress_renum(~tri_mask)
+ else:
+ tri_renum = np.arange(ntri, dtype=np.int32)
+
+ # Valid nodes and renumbering
+ valid_node = (np.bincount(np.ravel(compressed_triangles),
+ minlength=self._triangulation.x.size) != 0)
+ compressed_x = self._triangulation.x[valid_node]
+ compressed_y = self._triangulation.y[valid_node]
+ node_renum = self._total_to_compress_renum(valid_node)
+
+ # Now renumbering the valid triangles nodes
+ compressed_triangles = node_renum[compressed_triangles]
+
+ return (compressed_triangles, compressed_x, compressed_y, tri_renum,
+ node_renum)
+
+ @staticmethod
+ def _total_to_compress_renum(valid):
+ """
+ Parameters
+ ----------
+ valid : 1D bool array
+ Validity mask.
+
+ Returns
+ -------
+ int array
+ Array so that (`valid_array` being a compressed array
+ based on a `masked_array` with mask ~*valid*):
+
+ - For all i with valid[i] = True:
+ valid_array[renum[i]] = masked_array[i]
+ - For all i with valid[i] = False:
+ renum[i] = -1 (invalid value)
+ """
+ renum = np.full(np.size(valid), -1, dtype=np.int32)
+ n_valid = np.sum(valid)
+ renum[valid] = np.arange(n_valid, dtype=np.int32)
+ return renum
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tritools.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tritools.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..9b5e1bec4b81616c99a00021d91f78845e7cd283
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/tri/_tritools.pyi
@@ -0,0 +1,12 @@
+from matplotlib.tri import Triangulation
+
+import numpy as np
+
+class TriAnalyzer:
+ def __init__(self, triangulation: Triangulation) -> None: ...
+ @property
+ def scale_factors(self) -> tuple[float, float]: ...
+ def circle_ratios(self, rescale: bool = ...) -> np.ndarray: ...
+ def get_flat_tri_mask(
+ self, min_circle_ratio: float = ..., rescale: bool = ...
+ ) -> np.ndarray: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/typing.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/typing.py
new file mode 100644
index 0000000000000000000000000000000000000000..20e1022fa0a5a0487aa771da822ff481685f236f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/typing.py
@@ -0,0 +1,78 @@
+"""
+Typing support for Matplotlib
+
+This module contains Type aliases which are useful for Matplotlib and potentially
+downstream libraries.
+
+.. admonition:: Provisional status of typing
+
+ The ``typing`` module and type stub files are considered provisional and may change
+ at any time without a deprecation period.
+"""
+from collections.abc import Hashable, Sequence
+import pathlib
+from typing import Any, Callable, Literal, TypeAlias, TypeVar, Union
+
+from . import path
+from ._enums import JoinStyle, CapStyle
+from .artist import Artist
+from .backend_bases import RendererBase
+from .markers import MarkerStyle
+from .transforms import Bbox, Transform
+
+RGBColorType: TypeAlias = tuple[float, float, float] | str
+RGBAColorType: TypeAlias = (
+ str | # "none" or "#RRGGBBAA"/"#RGBA" hex strings
+ tuple[float, float, float, float] |
+ # 2 tuple (color, alpha) representations, not infinitely recursive
+ # RGBColorType includes the (str, float) tuple, even for RGBA strings
+ tuple[RGBColorType, float] |
+ # (4-tuple, float) is odd, but accepted as the outer float overriding A of 4-tuple
+ tuple[tuple[float, float, float, float], float]
+)
+
+ColorType: TypeAlias = RGBColorType | RGBAColorType
+
+RGBColourType: TypeAlias = RGBColorType
+RGBAColourType: TypeAlias = RGBAColorType
+ColourType: TypeAlias = ColorType
+
+LineStyleType: TypeAlias = str | tuple[float, Sequence[float]]
+DrawStyleType: TypeAlias = Literal["default", "steps", "steps-pre", "steps-mid",
+ "steps-post"]
+MarkEveryType: TypeAlias = (
+ None |
+ int | tuple[int, int] | slice | list[int] |
+ float | tuple[float, float] |
+ list[bool]
+)
+
+MarkerType: TypeAlias = str | path.Path | MarkerStyle
+FillStyleType: TypeAlias = Literal["full", "left", "right", "bottom", "top", "none"]
+JoinStyleType: TypeAlias = JoinStyle | Literal["miter", "round", "bevel"]
+CapStyleType: TypeAlias = CapStyle | Literal["butt", "projecting", "round"]
+
+CoordsBaseType = Union[
+ str,
+ Artist,
+ Transform,
+ Callable[
+ [RendererBase],
+ Union[Bbox, Transform]
+ ]
+]
+CoordsType = Union[
+ CoordsBaseType,
+ tuple[CoordsBaseType, CoordsBaseType]
+]
+
+RcStyleType: TypeAlias = (
+ str |
+ dict[str, Any] |
+ pathlib.Path |
+ Sequence[str | pathlib.Path | dict[str, Any]]
+)
+
+_HT = TypeVar("_HT", bound=Hashable)
+HashableList: TypeAlias = list[_HT | "HashableList[_HT]"]
+"""A nested list of Hashable values."""
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/units.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/units.py
new file mode 100644
index 0000000000000000000000000000000000000000..e3480f228bb45cff45ed0566ceabdb1f3dcd53e1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/units.py
@@ -0,0 +1,195 @@
+"""
+The classes here provide support for using custom classes with
+Matplotlib, e.g., those that do not expose the array interface but know
+how to convert themselves to arrays. It also supports classes with
+units and units conversion. Use cases include converters for custom
+objects, e.g., a list of datetime objects, as well as for objects that
+are unit aware. We don't assume any particular units implementation;
+rather a units implementation must register with the Registry converter
+dictionary and provide a `ConversionInterface`. For example,
+here is a complete implementation which supports plotting with native
+datetime objects::
+
+ import matplotlib.units as units
+ import matplotlib.dates as dates
+ import matplotlib.ticker as ticker
+ import datetime
+
+ class DateConverter(units.ConversionInterface):
+
+ @staticmethod
+ def convert(value, unit, axis):
+ "Convert a datetime value to a scalar or array."
+ return dates.date2num(value)
+
+ @staticmethod
+ def axisinfo(unit, axis):
+ "Return major and minor tick locators and formatters."
+ if unit != 'date':
+ return None
+ majloc = dates.AutoDateLocator()
+ majfmt = dates.AutoDateFormatter(majloc)
+ return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='date')
+
+ @staticmethod
+ def default_units(x, axis):
+ "Return the default unit for x or None."
+ return 'date'
+
+ # Finally we register our object type with the Matplotlib units registry.
+ units.registry[datetime.date] = DateConverter()
+"""
+
+from decimal import Decimal
+from numbers import Number
+
+import numpy as np
+from numpy import ma
+
+from matplotlib import cbook
+
+
+class ConversionError(TypeError):
+ pass
+
+
+def _is_natively_supported(x):
+ """
+ Return whether *x* is of a type that Matplotlib natively supports or an
+ array of objects of such types.
+ """
+ # Matplotlib natively supports all number types except Decimal.
+ if np.iterable(x):
+ # Assume lists are homogeneous as other functions in unit system.
+ for thisx in x:
+ if thisx is ma.masked:
+ continue
+ return isinstance(thisx, Number) and not isinstance(thisx, Decimal)
+ else:
+ return isinstance(x, Number) and not isinstance(x, Decimal)
+
+
+class AxisInfo:
+ """
+ Information to support default axis labeling, tick labeling, and limits.
+
+ An instance of this class must be returned by
+ `ConversionInterface.axisinfo`.
+ """
+ def __init__(self, majloc=None, minloc=None,
+ majfmt=None, minfmt=None, label=None,
+ default_limits=None):
+ """
+ Parameters
+ ----------
+ majloc, minloc : Locator, optional
+ Tick locators for the major and minor ticks.
+ majfmt, minfmt : Formatter, optional
+ Tick formatters for the major and minor ticks.
+ label : str, optional
+ The default axis label.
+ default_limits : optional
+ The default min and max limits of the axis if no data has
+ been plotted.
+
+ Notes
+ -----
+ If any of the above are ``None``, the axis will simply use the
+ default value.
+ """
+ self.majloc = majloc
+ self.minloc = minloc
+ self.majfmt = majfmt
+ self.minfmt = minfmt
+ self.label = label
+ self.default_limits = default_limits
+
+
+class ConversionInterface:
+ """
+ The minimal interface for a converter to take custom data types (or
+ sequences) and convert them to values Matplotlib can use.
+ """
+
+ @staticmethod
+ def axisinfo(unit, axis):
+ """Return an `.AxisInfo` for the axis with the specified units."""
+ return None
+
+ @staticmethod
+ def default_units(x, axis):
+ """Return the default unit for *x* or ``None`` for the given axis."""
+ return None
+
+ @staticmethod
+ def convert(obj, unit, axis):
+ """
+ Convert *obj* using *unit* for the specified *axis*.
+
+ If *obj* is a sequence, return the converted sequence. The output must
+ be a sequence of scalars that can be used by the numpy array layer.
+ """
+ return obj
+
+
+class DecimalConverter(ConversionInterface):
+ """Converter for decimal.Decimal data to float."""
+
+ @staticmethod
+ def convert(value, unit, axis):
+ """
+ Convert Decimals to floats.
+
+ The *unit* and *axis* arguments are not used.
+
+ Parameters
+ ----------
+ value : decimal.Decimal or iterable
+ Decimal or list of Decimal need to be converted
+ """
+ if isinstance(value, Decimal):
+ return float(value)
+ # value is Iterable[Decimal]
+ elif isinstance(value, ma.MaskedArray):
+ return ma.asarray(value, dtype=float)
+ else:
+ return np.asarray(value, dtype=float)
+
+ # axisinfo and default_units can be inherited as Decimals are Numbers.
+
+
+class Registry(dict):
+ """Register types with conversion interface."""
+
+ def get_converter(self, x):
+ """Get the converter interface instance for *x*, or None."""
+ # Unpack in case of e.g. Pandas or xarray object
+ x = cbook._unpack_to_numpy(x)
+
+ if isinstance(x, np.ndarray):
+ # In case x in a masked array, access the underlying data (only its
+ # type matters). If x is a regular ndarray, getdata() just returns
+ # the array itself.
+ x = np.ma.getdata(x).ravel()
+ # If there are no elements in x, infer the units from its dtype
+ if not x.size:
+ return self.get_converter(np.array([0], dtype=x.dtype))
+ for cls in type(x).__mro__: # Look up in the cache.
+ try:
+ return self[cls]
+ except KeyError:
+ pass
+ try: # If cache lookup fails, look up based on first element...
+ first = cbook._safe_first_finite(x)
+ except (TypeError, StopIteration):
+ pass
+ else:
+ # ... and avoid infinite recursion for pathological iterables for
+ # which indexing returns instances of the same iterable class.
+ if type(first) is not type(x):
+ return self.get_converter(first)
+ return None
+
+
+registry = Registry()
+registry[Decimal] = DecimalConverter()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/widgets.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/widgets.py
new file mode 100644
index 0000000000000000000000000000000000000000..9c676574310c3ccbed5daefca32278084750a3d8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/widgets.py
@@ -0,0 +1,4175 @@
+"""
+GUI neutral widgets
+===================
+
+Widgets that are designed to work for any of the GUI backends.
+All of these widgets require you to predefine an `~.axes.Axes`
+instance and pass that as the first parameter. Matplotlib doesn't try to
+be too smart with respect to layout -- you will have to figure out how
+wide and tall you want your Axes to be to accommodate your widget.
+"""
+
+from contextlib import ExitStack
+import copy
+import itertools
+from numbers import Integral, Number
+
+from cycler import cycler
+import numpy as np
+
+import matplotlib as mpl
+from . import (_api, _docstring, backend_tools, cbook, collections, colors,
+ text as mtext, ticker, transforms)
+from .lines import Line2D
+from .patches import Rectangle, Ellipse, Polygon
+from .transforms import TransformedPatchPath, Affine2D
+
+
+class LockDraw:
+ """
+ Some widgets, like the cursor, draw onto the canvas, and this is not
+ desirable under all circumstances, like when the toolbar is in zoom-to-rect
+ mode and drawing a rectangle. To avoid this, a widget can acquire a
+ canvas' lock with ``canvas.widgetlock(widget)`` before drawing on the
+ canvas; this will prevent other widgets from doing so at the same time (if
+ they also try to acquire the lock first).
+ """
+
+ def __init__(self):
+ self._owner = None
+
+ def __call__(self, o):
+ """Reserve the lock for *o*."""
+ if not self.available(o):
+ raise ValueError('already locked')
+ self._owner = o
+
+ def release(self, o):
+ """Release the lock from *o*."""
+ if not self.available(o):
+ raise ValueError('you do not own this lock')
+ self._owner = None
+
+ def available(self, o):
+ """Return whether drawing is available to *o*."""
+ return not self.locked() or self.isowner(o)
+
+ def isowner(self, o):
+ """Return whether *o* owns this lock."""
+ return self._owner is o
+
+ def locked(self):
+ """Return whether the lock is currently held by an owner."""
+ return self._owner is not None
+
+
+class Widget:
+ """
+ Abstract base class for GUI neutral widgets.
+ """
+ drawon = True
+ eventson = True
+ _active = True
+
+ def set_active(self, active):
+ """Set whether the widget is active."""
+ self._active = active
+
+ def get_active(self):
+ """Get whether the widget is active."""
+ return self._active
+
+ # set_active is overridden by SelectorWidgets.
+ active = property(get_active, set_active, doc="Is the widget active?")
+
+ def ignore(self, event):
+ """
+ Return whether *event* should be ignored.
+
+ This method should be called at the beginning of any event callback.
+ """
+ return not self.active
+
+
+class AxesWidget(Widget):
+ """
+ Widget connected to a single `~matplotlib.axes.Axes`.
+
+ To guarantee that the widget remains responsive and not garbage-collected,
+ a reference to the object should be maintained by the user.
+
+ This is necessary because the callback registry
+ maintains only weak-refs to the functions, which are member
+ functions of the widget. If there are no references to the widget
+ object it may be garbage collected which will disconnect the callbacks.
+
+ Attributes
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+ canvas : `~matplotlib.backend_bases.FigureCanvasBase`
+ The parent figure canvas for the widget.
+ active : bool
+ If False, the widget does not respond to events.
+ """
+
+ def __init__(self, ax):
+ self.ax = ax
+ self._cids = []
+
+ canvas = property(lambda self: self.ax.get_figure(root=True).canvas)
+
+ def connect_event(self, event, callback):
+ """
+ Connect a callback function with an event.
+
+ This should be used in lieu of ``figure.canvas.mpl_connect`` since this
+ function stores callback ids for later clean up.
+ """
+ cid = self.canvas.mpl_connect(event, callback)
+ self._cids.append(cid)
+
+ def disconnect_events(self):
+ """Disconnect all events created by this widget."""
+ for c in self._cids:
+ self.canvas.mpl_disconnect(c)
+
+ def _get_data_coords(self, event):
+ """Return *event*'s data coordinates in this widget's Axes."""
+ # This method handles the possibility that event.inaxes != self.ax (which may
+ # occur if multiple Axes are overlaid), in which case event.xdata/.ydata will
+ # be wrong. Note that we still special-case the common case where
+ # event.inaxes == self.ax and avoid re-running the inverse data transform,
+ # because that can introduce floating point errors for synthetic events.
+ return ((event.xdata, event.ydata) if event.inaxes is self.ax
+ else self.ax.transData.inverted().transform((event.x, event.y)))
+
+
+class Button(AxesWidget):
+ """
+ A GUI neutral button.
+
+ For the button to remain responsive you must keep a reference to it.
+ Call `.on_clicked` to connect to the button.
+
+ Attributes
+ ----------
+ ax
+ The `~.axes.Axes` the button renders into.
+ label
+ A `.Text` instance.
+ color
+ The color of the button when not hovering.
+ hovercolor
+ The color of the button when hovering.
+ """
+
+ def __init__(self, ax, label, image=None,
+ color='0.85', hovercolor='0.95', *, useblit=True):
+ """
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` instance the button will be placed into.
+ label : str
+ The button text.
+ image : array-like or PIL Image
+ The image to place in the button, if not *None*. The parameter is
+ directly forwarded to `~.axes.Axes.imshow`.
+ color : :mpltype:`color`
+ The color of the button when not activated.
+ hovercolor : :mpltype:`color`
+ The color of the button when the mouse is over it.
+ useblit : bool, default: True
+ Use blitting for faster drawing if supported by the backend.
+ See the tutorial :ref:`blitting` for details.
+
+ .. versionadded:: 3.7
+ """
+ super().__init__(ax)
+
+ if image is not None:
+ ax.imshow(image)
+ self.label = ax.text(0.5, 0.5, label,
+ verticalalignment='center',
+ horizontalalignment='center',
+ transform=ax.transAxes)
+
+ self._useblit = useblit and self.canvas.supports_blit
+
+ self._observers = cbook.CallbackRegistry(signals=["clicked"])
+
+ self.connect_event('button_press_event', self._click)
+ self.connect_event('button_release_event', self._release)
+ self.connect_event('motion_notify_event', self._motion)
+ ax.set_navigate(False)
+ ax.set_facecolor(color)
+ ax.set_xticks([])
+ ax.set_yticks([])
+ self.color = color
+ self.hovercolor = hovercolor
+
+ def _click(self, event):
+ if not self.eventson or self.ignore(event) or not self.ax.contains(event)[0]:
+ return
+ if event.canvas.mouse_grabber != self.ax:
+ event.canvas.grab_mouse(self.ax)
+
+ def _release(self, event):
+ if self.ignore(event) or event.canvas.mouse_grabber != self.ax:
+ return
+ event.canvas.release_mouse(self.ax)
+ if self.eventson and self.ax.contains(event)[0]:
+ self._observers.process('clicked', event)
+
+ def _motion(self, event):
+ if self.ignore(event):
+ return
+ c = self.hovercolor if self.ax.contains(event)[0] else self.color
+ if not colors.same_color(c, self.ax.get_facecolor()):
+ self.ax.set_facecolor(c)
+ if self.drawon:
+ if self._useblit:
+ self.ax.draw_artist(self.ax)
+ self.canvas.blit(self.ax.bbox)
+ else:
+ self.canvas.draw()
+
+ def on_clicked(self, func):
+ """
+ Connect the callback function *func* to button click events.
+
+ Returns a connection id, which can be used to disconnect the callback.
+ """
+ return self._observers.connect('clicked', lambda event: func(event))
+
+ def disconnect(self, cid):
+ """Remove the callback function with connection id *cid*."""
+ self._observers.disconnect(cid)
+
+
+class SliderBase(AxesWidget):
+ """
+ The base class for constructing Slider widgets. Not intended for direct
+ usage.
+
+ For the slider to remain responsive you must maintain a reference to it.
+ """
+ def __init__(self, ax, orientation, closedmin, closedmax,
+ valmin, valmax, valfmt, dragging, valstep):
+ if ax.name == '3d':
+ raise ValueError('Sliders cannot be added to 3D Axes')
+
+ super().__init__(ax)
+ _api.check_in_list(['horizontal', 'vertical'], orientation=orientation)
+
+ self.orientation = orientation
+ self.closedmin = closedmin
+ self.closedmax = closedmax
+ self.valmin = valmin
+ self.valmax = valmax
+ self.valstep = valstep
+ self.drag_active = False
+ self.valfmt = valfmt
+
+ if orientation == "vertical":
+ ax.set_ylim((valmin, valmax))
+ axis = ax.yaxis
+ else:
+ ax.set_xlim((valmin, valmax))
+ axis = ax.xaxis
+
+ self._fmt = axis.get_major_formatter()
+ if not isinstance(self._fmt, ticker.ScalarFormatter):
+ self._fmt = ticker.ScalarFormatter()
+ self._fmt.set_axis(axis)
+ self._fmt.set_useOffset(False) # No additive offset.
+ self._fmt.set_useMathText(True) # x sign before multiplicative offset.
+
+ ax.set_axis_off()
+ ax.set_navigate(False)
+
+ self.connect_event("button_press_event", self._update)
+ self.connect_event("button_release_event", self._update)
+ if dragging:
+ self.connect_event("motion_notify_event", self._update)
+ self._observers = cbook.CallbackRegistry(signals=["changed"])
+
+ def _stepped_value(self, val):
+ """Return *val* coerced to closest number in the ``valstep`` grid."""
+ if isinstance(self.valstep, Number):
+ val = (self.valmin
+ + round((val - self.valmin) / self.valstep) * self.valstep)
+ elif self.valstep is not None:
+ valstep = np.asanyarray(self.valstep)
+ if valstep.ndim != 1:
+ raise ValueError(
+ f"valstep must have 1 dimension but has {valstep.ndim}"
+ )
+ val = valstep[np.argmin(np.abs(valstep - val))]
+ return val
+
+ def disconnect(self, cid):
+ """
+ Remove the observer with connection id *cid*.
+
+ Parameters
+ ----------
+ cid : int
+ Connection id of the observer to be removed.
+ """
+ self._observers.disconnect(cid)
+
+ def reset(self):
+ """Reset the slider to the initial value."""
+ if np.any(self.val != self.valinit):
+ self.set_val(self.valinit)
+
+
+class Slider(SliderBase):
+ """
+ A slider representing a floating point range.
+
+ Create a slider from *valmin* to *valmax* in Axes *ax*. For the slider to
+ remain responsive you must maintain a reference to it. Call
+ :meth:`on_changed` to connect to the slider event.
+
+ Attributes
+ ----------
+ val : float
+ Slider value.
+ """
+
+ def __init__(self, ax, label, valmin, valmax, *, valinit=0.5, valfmt=None,
+ closedmin=True, closedmax=True, slidermin=None,
+ slidermax=None, dragging=True, valstep=None,
+ orientation='horizontal', initcolor='r',
+ track_color='lightgrey', handle_style=None, **kwargs):
+ """
+ Parameters
+ ----------
+ ax : Axes
+ The Axes to put the slider in.
+
+ label : str
+ Slider label.
+
+ valmin : float
+ The minimum value of the slider.
+
+ valmax : float
+ The maximum value of the slider.
+
+ valinit : float, default: 0.5
+ The slider initial position.
+
+ valfmt : str, default: None
+ %-format string used to format the slider value. If None, a
+ `.ScalarFormatter` is used instead.
+
+ closedmin : bool, default: True
+ Whether the slider interval is closed on the bottom.
+
+ closedmax : bool, default: True
+ Whether the slider interval is closed on the top.
+
+ slidermin : Slider, default: None
+ Do not allow the current slider to have a value less than
+ the value of the Slider *slidermin*.
+
+ slidermax : Slider, default: None
+ Do not allow the current slider to have a value greater than
+ the value of the Slider *slidermax*.
+
+ dragging : bool, default: True
+ If True the slider can be dragged by the mouse.
+
+ valstep : float or array-like, default: None
+ If a float, the slider will snap to multiples of *valstep*.
+ If an array the slider will snap to the values in the array.
+
+ orientation : {'horizontal', 'vertical'}, default: 'horizontal'
+ The orientation of the slider.
+
+ initcolor : :mpltype:`color`, default: 'r'
+ The color of the line at the *valinit* position. Set to ``'none'``
+ for no line.
+
+ track_color : :mpltype:`color`, default: 'lightgrey'
+ The color of the background track. The track is accessible for
+ further styling via the *track* attribute.
+
+ handle_style : dict
+ Properties of the slider handle. Default values are
+
+ ========= ===== ======= ========================================
+ Key Value Default Description
+ ========= ===== ======= ========================================
+ facecolor color 'white' The facecolor of the slider handle.
+ edgecolor color '.75' The edgecolor of the slider handle.
+ size int 10 The size of the slider handle in points.
+ ========= ===== ======= ========================================
+
+ Other values will be transformed as marker{foo} and passed to the
+ `~.Line2D` constructor. e.g. ``handle_style = {'style'='x'}`` will
+ result in ``markerstyle = 'x'``.
+
+ Notes
+ -----
+ Additional kwargs are passed on to ``self.poly`` which is the
+ `~matplotlib.patches.Rectangle` that draws the slider knob. See the
+ `.Rectangle` documentation for valid property names (``facecolor``,
+ ``edgecolor``, ``alpha``, etc.).
+ """
+ super().__init__(ax, orientation, closedmin, closedmax,
+ valmin, valmax, valfmt, dragging, valstep)
+
+ if slidermin is not None and not hasattr(slidermin, 'val'):
+ raise ValueError(
+ f"Argument slidermin ({type(slidermin)}) has no 'val'")
+ if slidermax is not None and not hasattr(slidermax, 'val'):
+ raise ValueError(
+ f"Argument slidermax ({type(slidermax)}) has no 'val'")
+ self.slidermin = slidermin
+ self.slidermax = slidermax
+ valinit = self._value_in_bounds(valinit)
+ if valinit is None:
+ valinit = valmin
+ self.val = valinit
+ self.valinit = valinit
+
+ defaults = {'facecolor': 'white', 'edgecolor': '.75', 'size': 10}
+ handle_style = {} if handle_style is None else handle_style
+ marker_props = {
+ f'marker{k}': v for k, v in {**defaults, **handle_style}.items()
+ }
+
+ if orientation == 'vertical':
+ self.track = Rectangle(
+ (.25, 0), .5, 1,
+ transform=ax.transAxes,
+ facecolor=track_color
+ )
+ ax.add_patch(self.track)
+ self.poly = ax.axhspan(valmin, valinit, .25, .75, **kwargs)
+ # Drawing a longer line and clipping it to the track avoids
+ # pixelation-related asymmetries.
+ self.hline = ax.axhline(valinit, 0, 1, color=initcolor, lw=1,
+ clip_path=TransformedPatchPath(self.track))
+ handleXY = [[0.5], [valinit]]
+ else:
+ self.track = Rectangle(
+ (0, .25), 1, .5,
+ transform=ax.transAxes,
+ facecolor=track_color
+ )
+ ax.add_patch(self.track)
+ self.poly = ax.axvspan(valmin, valinit, .25, .75, **kwargs)
+ self.vline = ax.axvline(valinit, 0, 1, color=initcolor, lw=1,
+ clip_path=TransformedPatchPath(self.track))
+ handleXY = [[valinit], [0.5]]
+ self._handle, = ax.plot(
+ *handleXY,
+ "o",
+ **marker_props,
+ clip_on=False
+ )
+
+ if orientation == 'vertical':
+ self.label = ax.text(0.5, 1.02, label, transform=ax.transAxes,
+ verticalalignment='bottom',
+ horizontalalignment='center')
+
+ self.valtext = ax.text(0.5, -0.02, self._format(valinit),
+ transform=ax.transAxes,
+ verticalalignment='top',
+ horizontalalignment='center')
+ else:
+ self.label = ax.text(-0.02, 0.5, label, transform=ax.transAxes,
+ verticalalignment='center',
+ horizontalalignment='right')
+
+ self.valtext = ax.text(1.02, 0.5, self._format(valinit),
+ transform=ax.transAxes,
+ verticalalignment='center',
+ horizontalalignment='left')
+
+ self.set_val(valinit)
+
+ def _value_in_bounds(self, val):
+ """Makes sure *val* is with given bounds."""
+ val = self._stepped_value(val)
+
+ if val <= self.valmin:
+ if not self.closedmin:
+ return
+ val = self.valmin
+ elif val >= self.valmax:
+ if not self.closedmax:
+ return
+ val = self.valmax
+
+ if self.slidermin is not None and val <= self.slidermin.val:
+ if not self.closedmin:
+ return
+ val = self.slidermin.val
+
+ if self.slidermax is not None and val >= self.slidermax.val:
+ if not self.closedmax:
+ return
+ val = self.slidermax.val
+ return val
+
+ def _update(self, event):
+ """Update the slider position."""
+ if self.ignore(event) or event.button != 1:
+ return
+
+ if event.name == 'button_press_event' and self.ax.contains(event)[0]:
+ self.drag_active = True
+ event.canvas.grab_mouse(self.ax)
+
+ if not self.drag_active:
+ return
+
+ if (event.name == 'button_release_event'
+ or event.name == 'button_press_event' and not self.ax.contains(event)[0]):
+ self.drag_active = False
+ event.canvas.release_mouse(self.ax)
+ return
+
+ xdata, ydata = self._get_data_coords(event)
+ val = self._value_in_bounds(
+ xdata if self.orientation == 'horizontal' else ydata)
+ if val not in [None, self.val]:
+ self.set_val(val)
+
+ def _format(self, val):
+ """Pretty-print *val*."""
+ if self.valfmt is not None:
+ return self.valfmt % val
+ else:
+ _, s, _ = self._fmt.format_ticks([self.valmin, val, self.valmax])
+ # fmt.get_offset is actually the multiplicative factor, if any.
+ return s + self._fmt.get_offset()
+
+ def set_val(self, val):
+ """
+ Set slider value to *val*.
+
+ Parameters
+ ----------
+ val : float
+ """
+ if self.orientation == 'vertical':
+ self.poly.set_height(val - self.poly.get_y())
+ self._handle.set_ydata([val])
+ else:
+ self.poly.set_width(val - self.poly.get_x())
+ self._handle.set_xdata([val])
+ self.valtext.set_text(self._format(val))
+ if self.drawon:
+ self.ax.get_figure(root=True).canvas.draw_idle()
+ self.val = val
+ if self.eventson:
+ self._observers.process('changed', val)
+
+ def on_changed(self, func):
+ """
+ Connect *func* as callback function to changes of the slider value.
+
+ Parameters
+ ----------
+ func : callable
+ Function to call when slider is changed.
+ The function must accept a single float as its arguments.
+
+ Returns
+ -------
+ int
+ Connection id (which can be used to disconnect *func*).
+ """
+ return self._observers.connect('changed', lambda val: func(val))
+
+
+class RangeSlider(SliderBase):
+ """
+ A slider representing a range of floating point values. Defines the min and
+ max of the range via the *val* attribute as a tuple of (min, max).
+
+ Create a slider that defines a range contained within [*valmin*, *valmax*]
+ in Axes *ax*. For the slider to remain responsive you must maintain a
+ reference to it. Call :meth:`on_changed` to connect to the slider event.
+
+ Attributes
+ ----------
+ val : tuple of float
+ Slider value.
+ """
+
+ def __init__(
+ self,
+ ax,
+ label,
+ valmin,
+ valmax,
+ *,
+ valinit=None,
+ valfmt=None,
+ closedmin=True,
+ closedmax=True,
+ dragging=True,
+ valstep=None,
+ orientation="horizontal",
+ track_color='lightgrey',
+ handle_style=None,
+ **kwargs,
+ ):
+ """
+ Parameters
+ ----------
+ ax : Axes
+ The Axes to put the slider in.
+
+ label : str
+ Slider label.
+
+ valmin : float
+ The minimum value of the slider.
+
+ valmax : float
+ The maximum value of the slider.
+
+ valinit : tuple of float or None, default: None
+ The initial positions of the slider. If None the initial positions
+ will be at the 25th and 75th percentiles of the range.
+
+ valfmt : str, default: None
+ %-format string used to format the slider values. If None, a
+ `.ScalarFormatter` is used instead.
+
+ closedmin : bool, default: True
+ Whether the slider interval is closed on the bottom.
+
+ closedmax : bool, default: True
+ Whether the slider interval is closed on the top.
+
+ dragging : bool, default: True
+ If True the slider can be dragged by the mouse.
+
+ valstep : float, default: None
+ If given, the slider will snap to multiples of *valstep*.
+
+ orientation : {'horizontal', 'vertical'}, default: 'horizontal'
+ The orientation of the slider.
+
+ track_color : :mpltype:`color`, default: 'lightgrey'
+ The color of the background track. The track is accessible for
+ further styling via the *track* attribute.
+
+ handle_style : dict
+ Properties of the slider handles. Default values are
+
+ ========= ===== ======= =========================================
+ Key Value Default Description
+ ========= ===== ======= =========================================
+ facecolor color 'white' The facecolor of the slider handles.
+ edgecolor color '.75' The edgecolor of the slider handles.
+ size int 10 The size of the slider handles in points.
+ ========= ===== ======= =========================================
+
+ Other values will be transformed as marker{foo} and passed to the
+ `~.Line2D` constructor. e.g. ``handle_style = {'style'='x'}`` will
+ result in ``markerstyle = 'x'``.
+
+ Notes
+ -----
+ Additional kwargs are passed on to ``self.poly`` which is the
+ `~matplotlib.patches.Polygon` that draws the slider knob. See the
+ `.Polygon` documentation for valid property names (``facecolor``,
+ ``edgecolor``, ``alpha``, etc.).
+ """
+ super().__init__(ax, orientation, closedmin, closedmax,
+ valmin, valmax, valfmt, dragging, valstep)
+
+ # Set a value to allow _value_in_bounds() to work.
+ self.val = (valmin, valmax)
+ if valinit is None:
+ # Place at the 25th and 75th percentiles
+ extent = valmax - valmin
+ valinit = np.array([valmin + extent * 0.25,
+ valmin + extent * 0.75])
+ else:
+ valinit = self._value_in_bounds(valinit)
+ self.val = valinit
+ self.valinit = valinit
+
+ defaults = {'facecolor': 'white', 'edgecolor': '.75', 'size': 10}
+ handle_style = {} if handle_style is None else handle_style
+ marker_props = {
+ f'marker{k}': v for k, v in {**defaults, **handle_style}.items()
+ }
+
+ if orientation == "vertical":
+ self.track = Rectangle(
+ (.25, 0), .5, 2,
+ transform=ax.transAxes,
+ facecolor=track_color
+ )
+ ax.add_patch(self.track)
+ poly_transform = self.ax.get_yaxis_transform(which="grid")
+ handleXY_1 = [.5, valinit[0]]
+ handleXY_2 = [.5, valinit[1]]
+ else:
+ self.track = Rectangle(
+ (0, .25), 1, .5,
+ transform=ax.transAxes,
+ facecolor=track_color
+ )
+ ax.add_patch(self.track)
+ poly_transform = self.ax.get_xaxis_transform(which="grid")
+ handleXY_1 = [valinit[0], .5]
+ handleXY_2 = [valinit[1], .5]
+ self.poly = Polygon(np.zeros([5, 2]), **kwargs)
+ self._update_selection_poly(*valinit)
+ self.poly.set_transform(poly_transform)
+ self.poly.get_path()._interpolation_steps = 100
+ self.ax.add_patch(self.poly)
+ self.ax._request_autoscale_view()
+ self._handles = [
+ ax.plot(
+ *handleXY_1,
+ "o",
+ **marker_props,
+ clip_on=False
+ )[0],
+ ax.plot(
+ *handleXY_2,
+ "o",
+ **marker_props,
+ clip_on=False
+ )[0]
+ ]
+
+ if orientation == "vertical":
+ self.label = ax.text(
+ 0.5,
+ 1.02,
+ label,
+ transform=ax.transAxes,
+ verticalalignment="bottom",
+ horizontalalignment="center",
+ )
+
+ self.valtext = ax.text(
+ 0.5,
+ -0.02,
+ self._format(valinit),
+ transform=ax.transAxes,
+ verticalalignment="top",
+ horizontalalignment="center",
+ )
+ else:
+ self.label = ax.text(
+ -0.02,
+ 0.5,
+ label,
+ transform=ax.transAxes,
+ verticalalignment="center",
+ horizontalalignment="right",
+ )
+
+ self.valtext = ax.text(
+ 1.02,
+ 0.5,
+ self._format(valinit),
+ transform=ax.transAxes,
+ verticalalignment="center",
+ horizontalalignment="left",
+ )
+
+ self._active_handle = None
+ self.set_val(valinit)
+
+ def _update_selection_poly(self, vmin, vmax):
+ """
+ Update the vertices of the *self.poly* slider in-place
+ to cover the data range *vmin*, *vmax*.
+ """
+ # The vertices are positioned
+ # 1 ------ 2
+ # | |
+ # 0, 4 ---- 3
+ verts = self.poly.xy
+ if self.orientation == "vertical":
+ verts[0] = verts[4] = .25, vmin
+ verts[1] = .25, vmax
+ verts[2] = .75, vmax
+ verts[3] = .75, vmin
+ else:
+ verts[0] = verts[4] = vmin, .25
+ verts[1] = vmin, .75
+ verts[2] = vmax, .75
+ verts[3] = vmax, .25
+
+ def _min_in_bounds(self, min):
+ """Ensure the new min value is between valmin and self.val[1]."""
+ if min <= self.valmin:
+ if not self.closedmin:
+ return self.val[0]
+ min = self.valmin
+
+ if min > self.val[1]:
+ min = self.val[1]
+ return self._stepped_value(min)
+
+ def _max_in_bounds(self, max):
+ """Ensure the new max value is between valmax and self.val[0]."""
+ if max >= self.valmax:
+ if not self.closedmax:
+ return self.val[1]
+ max = self.valmax
+
+ if max <= self.val[0]:
+ max = self.val[0]
+ return self._stepped_value(max)
+
+ def _value_in_bounds(self, vals):
+ """Clip min, max values to the bounds."""
+ return (self._min_in_bounds(vals[0]), self._max_in_bounds(vals[1]))
+
+ def _update_val_from_pos(self, pos):
+ """Update the slider value based on a given position."""
+ idx = np.argmin(np.abs(self.val - pos))
+ if idx == 0:
+ val = self._min_in_bounds(pos)
+ self.set_min(val)
+ else:
+ val = self._max_in_bounds(pos)
+ self.set_max(val)
+ if self._active_handle:
+ if self.orientation == "vertical":
+ self._active_handle.set_ydata([val])
+ else:
+ self._active_handle.set_xdata([val])
+
+ def _update(self, event):
+ """Update the slider position."""
+ if self.ignore(event) or event.button != 1:
+ return
+
+ if event.name == "button_press_event" and self.ax.contains(event)[0]:
+ self.drag_active = True
+ event.canvas.grab_mouse(self.ax)
+
+ if not self.drag_active:
+ return
+
+ if (event.name == "button_release_event"
+ or event.name == "button_press_event" and not self.ax.contains(event)[0]):
+ self.drag_active = False
+ event.canvas.release_mouse(self.ax)
+ self._active_handle = None
+ return
+
+ # determine which handle was grabbed
+ xdata, ydata = self._get_data_coords(event)
+ handle_index = np.argmin(np.abs(
+ [h.get_xdata()[0] - xdata for h in self._handles]
+ if self.orientation == "horizontal" else
+ [h.get_ydata()[0] - ydata for h in self._handles]))
+ handle = self._handles[handle_index]
+
+ # these checks ensure smooth behavior if the handles swap which one
+ # has a higher value. i.e. if one is dragged over and past the other.
+ if handle is not self._active_handle:
+ self._active_handle = handle
+
+ self._update_val_from_pos(xdata if self.orientation == "horizontal" else ydata)
+
+ def _format(self, val):
+ """Pretty-print *val*."""
+ if self.valfmt is not None:
+ return f"({self.valfmt % val[0]}, {self.valfmt % val[1]})"
+ else:
+ _, s1, s2, _ = self._fmt.format_ticks(
+ [self.valmin, *val, self.valmax]
+ )
+ # fmt.get_offset is actually the multiplicative factor, if any.
+ s1 += self._fmt.get_offset()
+ s2 += self._fmt.get_offset()
+ # Use f string to avoid issues with backslashes when cast to a str
+ return f"({s1}, {s2})"
+
+ def set_min(self, min):
+ """
+ Set the lower value of the slider to *min*.
+
+ Parameters
+ ----------
+ min : float
+ """
+ self.set_val((min, self.val[1]))
+
+ def set_max(self, max):
+ """
+ Set the lower value of the slider to *max*.
+
+ Parameters
+ ----------
+ max : float
+ """
+ self.set_val((self.val[0], max))
+
+ def set_val(self, val):
+ """
+ Set slider value to *val*.
+
+ Parameters
+ ----------
+ val : tuple or array-like of float
+ """
+ val = np.sort(val)
+ _api.check_shape((2,), val=val)
+ # Reset value to allow _value_in_bounds() to work.
+ self.val = (self.valmin, self.valmax)
+ vmin, vmax = self._value_in_bounds(val)
+ self._update_selection_poly(vmin, vmax)
+ if self.orientation == "vertical":
+ self._handles[0].set_ydata([vmin])
+ self._handles[1].set_ydata([vmax])
+ else:
+ self._handles[0].set_xdata([vmin])
+ self._handles[1].set_xdata([vmax])
+
+ self.valtext.set_text(self._format((vmin, vmax)))
+
+ if self.drawon:
+ self.ax.get_figure(root=True).canvas.draw_idle()
+ self.val = (vmin, vmax)
+ if self.eventson:
+ self._observers.process("changed", (vmin, vmax))
+
+ def on_changed(self, func):
+ """
+ Connect *func* as callback function to changes of the slider value.
+
+ Parameters
+ ----------
+ func : callable
+ Function to call when slider is changed. The function
+ must accept a 2-tuple of floats as its argument.
+
+ Returns
+ -------
+ int
+ Connection id (which can be used to disconnect *func*).
+ """
+ return self._observers.connect('changed', lambda val: func(val))
+
+
+def _expand_text_props(props):
+ props = cbook.normalize_kwargs(props, mtext.Text)
+ return cycler(**props)() if props else itertools.repeat({})
+
+
+class CheckButtons(AxesWidget):
+ r"""
+ A GUI neutral set of check buttons.
+
+ For the check buttons to remain responsive you must keep a
+ reference to this object.
+
+ Connect to the CheckButtons with the `.on_clicked` method.
+
+ Attributes
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+ labels : list of `~matplotlib.text.Text`
+ The text label objects of the check buttons.
+ """
+
+ def __init__(self, ax, labels, actives=None, *, useblit=True,
+ label_props=None, frame_props=None, check_props=None):
+ """
+ Add check buttons to `~.axes.Axes` instance *ax*.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+ labels : list of str
+ The labels of the check buttons.
+ actives : list of bool, optional
+ The initial check states of the buttons. The list must have the
+ same length as *labels*. If not given, all buttons are unchecked.
+ useblit : bool, default: True
+ Use blitting for faster drawing if supported by the backend.
+ See the tutorial :ref:`blitting` for details.
+
+ .. versionadded:: 3.7
+
+ label_props : dict, optional
+ Dictionary of `.Text` properties to be used for the labels.
+
+ .. versionadded:: 3.7
+ frame_props : dict, optional
+ Dictionary of scatter `.Collection` properties to be used for the
+ check button frame. Defaults (label font size / 2)**2 size, black
+ edgecolor, no facecolor, and 1.0 linewidth.
+
+ .. versionadded:: 3.7
+ check_props : dict, optional
+ Dictionary of scatter `.Collection` properties to be used for the
+ check button check. Defaults to (label font size / 2)**2 size,
+ black color, and 1.0 linewidth.
+
+ .. versionadded:: 3.7
+ """
+ super().__init__(ax)
+
+ _api.check_isinstance((dict, None), label_props=label_props,
+ frame_props=frame_props, check_props=check_props)
+
+ ax.set_xticks([])
+ ax.set_yticks([])
+ ax.set_navigate(False)
+
+ if actives is None:
+ actives = [False] * len(labels)
+
+ self._useblit = useblit and self.canvas.supports_blit
+ self._background = None
+
+ ys = np.linspace(1, 0, len(labels)+2)[1:-1]
+
+ label_props = _expand_text_props(label_props)
+ self.labels = [
+ ax.text(0.25, y, label, transform=ax.transAxes,
+ horizontalalignment="left", verticalalignment="center",
+ **props)
+ for y, label, props in zip(ys, labels, label_props)]
+ text_size = np.array([text.get_fontsize() for text in self.labels]) / 2
+
+ frame_props = {
+ 's': text_size**2,
+ 'linewidth': 1,
+ **cbook.normalize_kwargs(frame_props, collections.PathCollection),
+ 'marker': 's',
+ 'transform': ax.transAxes,
+ }
+ frame_props.setdefault('facecolor', frame_props.get('color', 'none'))
+ frame_props.setdefault('edgecolor', frame_props.pop('color', 'black'))
+ self._frames = ax.scatter([0.15] * len(ys), ys, **frame_props)
+ check_props = {
+ 'linewidth': 1,
+ 's': text_size**2,
+ **cbook.normalize_kwargs(check_props, collections.PathCollection),
+ 'marker': 'x',
+ 'transform': ax.transAxes,
+ 'animated': self._useblit,
+ }
+ check_props.setdefault('facecolor', check_props.pop('color', 'black'))
+ self._checks = ax.scatter([0.15] * len(ys), ys, **check_props)
+ # The user may have passed custom colours in check_props, so we need to
+ # create the checks (above), and modify the visibility after getting
+ # whatever the user set.
+ self._init_status(actives)
+
+ self.connect_event('button_press_event', self._clicked)
+ if self._useblit:
+ self.connect_event('draw_event', self._clear)
+
+ self._observers = cbook.CallbackRegistry(signals=["clicked"])
+
+ def _clear(self, event):
+ """Internal event handler to clear the buttons."""
+ if self.ignore(event) or self.canvas.is_saving():
+ return
+ self._background = self.canvas.copy_from_bbox(self.ax.bbox)
+ self.ax.draw_artist(self._checks)
+
+ def _clicked(self, event):
+ if self.ignore(event) or event.button != 1 or not self.ax.contains(event)[0]:
+ return
+ idxs = [ # Indices of frames and of texts that contain the event.
+ *self._frames.contains(event)[1]["ind"],
+ *[i for i, text in enumerate(self.labels) if text.contains(event)[0]]]
+ if idxs:
+ coords = self._frames.get_offset_transform().transform(
+ self._frames.get_offsets())
+ self.set_active( # Closest index, only looking in idxs.
+ idxs[(((event.x, event.y) - coords[idxs]) ** 2).sum(-1).argmin()])
+
+ def set_label_props(self, props):
+ """
+ Set properties of the `.Text` labels.
+
+ .. versionadded:: 3.7
+
+ Parameters
+ ----------
+ props : dict
+ Dictionary of `.Text` properties to be used for the labels.
+ """
+ _api.check_isinstance(dict, props=props)
+ props = _expand_text_props(props)
+ for text, prop in zip(self.labels, props):
+ text.update(prop)
+
+ def set_frame_props(self, props):
+ """
+ Set properties of the check button frames.
+
+ .. versionadded:: 3.7
+
+ Parameters
+ ----------
+ props : dict
+ Dictionary of `.Collection` properties to be used for the check
+ button frames.
+ """
+ _api.check_isinstance(dict, props=props)
+ if 's' in props: # Keep API consistent with constructor.
+ props['sizes'] = np.broadcast_to(props.pop('s'), len(self.labels))
+ self._frames.update(props)
+
+ def set_check_props(self, props):
+ """
+ Set properties of the check button checks.
+
+ .. versionadded:: 3.7
+
+ Parameters
+ ----------
+ props : dict
+ Dictionary of `.Collection` properties to be used for the check
+ button check.
+ """
+ _api.check_isinstance(dict, props=props)
+ if 's' in props: # Keep API consistent with constructor.
+ props['sizes'] = np.broadcast_to(props.pop('s'), len(self.labels))
+ actives = self.get_status()
+ self._checks.update(props)
+ # If new colours are supplied, then we must re-apply the status.
+ self._init_status(actives)
+
+ def set_active(self, index, state=None):
+ """
+ Modify the state of a check button by index.
+
+ Callbacks will be triggered if :attr:`eventson` is True.
+
+ Parameters
+ ----------
+ index : int
+ Index of the check button to toggle.
+
+ state : bool, optional
+ If a boolean value, set the state explicitly. If no value is
+ provided, the state is toggled.
+
+ Raises
+ ------
+ ValueError
+ If *index* is invalid.
+ TypeError
+ If *state* is not boolean.
+ """
+ if index not in range(len(self.labels)):
+ raise ValueError(f'Invalid CheckButton index: {index}')
+ _api.check_isinstance((bool, None), state=state)
+
+ invisible = colors.to_rgba('none')
+
+ facecolors = self._checks.get_facecolor()
+ if state is None:
+ state = colors.same_color(facecolors[index], invisible)
+ facecolors[index] = self._active_check_colors[index] if state else invisible
+ self._checks.set_facecolor(facecolors)
+
+ if self.drawon:
+ if self._useblit:
+ if self._background is not None:
+ self.canvas.restore_region(self._background)
+ self.ax.draw_artist(self._checks)
+ self.canvas.blit(self.ax.bbox)
+ else:
+ self.canvas.draw()
+
+ if self.eventson:
+ self._observers.process('clicked', self.labels[index].get_text())
+
+ def _init_status(self, actives):
+ """
+ Initialize properties to match active status.
+
+ The user may have passed custom colours in *check_props* to the
+ constructor, or to `.set_check_props`, so we need to modify the
+ visibility after getting whatever the user set.
+ """
+ self._active_check_colors = self._checks.get_facecolor()
+ if len(self._active_check_colors) == 1:
+ self._active_check_colors = np.repeat(self._active_check_colors,
+ len(actives), axis=0)
+ self._checks.set_facecolor(
+ [ec if active else "none"
+ for ec, active in zip(self._active_check_colors, actives)])
+
+ def clear(self):
+ """Uncheck all checkboxes."""
+
+ self._checks.set_facecolor(['none'] * len(self._active_check_colors))
+
+ if hasattr(self, '_lines'):
+ for l1, l2 in self._lines:
+ l1.set_visible(False)
+ l2.set_visible(False)
+
+ if self.drawon:
+ self.canvas.draw()
+
+ if self.eventson:
+ # Call with no label, as all checkboxes are being cleared.
+ self._observers.process('clicked', None)
+
+ def get_status(self):
+ """
+ Return a list of the status (True/False) of all of the check buttons.
+ """
+ return [not colors.same_color(color, colors.to_rgba("none"))
+ for color in self._checks.get_facecolors()]
+
+ def get_checked_labels(self):
+ """Return a list of labels currently checked by user."""
+
+ return [l.get_text() for l, box_checked in
+ zip(self.labels, self.get_status())
+ if box_checked]
+
+ def on_clicked(self, func):
+ """
+ Connect the callback function *func* to button click events.
+
+ Parameters
+ ----------
+ func : callable
+ When the button is clicked, call *func* with button label.
+ When all buttons are cleared, call *func* with None.
+ The callback func must have the signature::
+
+ def func(label: str | None) -> Any
+
+ Return values may exist, but are ignored.
+
+ Returns
+ -------
+ A connection id, which can be used to disconnect the callback.
+ """
+ return self._observers.connect('clicked', lambda text: func(text))
+
+ def disconnect(self, cid):
+ """Remove the observer with connection id *cid*."""
+ self._observers.disconnect(cid)
+
+
+class TextBox(AxesWidget):
+ """
+ A GUI neutral text input box.
+
+ For the text box to remain responsive you must keep a reference to it.
+
+ Call `.on_text_change` to be updated whenever the text changes.
+
+ Call `.on_submit` to be updated whenever the user hits enter or
+ leaves the text entry field.
+
+ Attributes
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+ label : `~matplotlib.text.Text`
+
+ color : :mpltype:`color`
+ The color of the text box when not hovering.
+ hovercolor : :mpltype:`color`
+ The color of the text box when hovering.
+ """
+
+ def __init__(self, ax, label, initial='', *,
+ color='.95', hovercolor='1', label_pad=.01,
+ textalignment="left"):
+ """
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` instance the button will be placed into.
+ label : str
+ Label for this text box.
+ initial : str
+ Initial value in the text box.
+ color : :mpltype:`color`
+ The color of the box.
+ hovercolor : :mpltype:`color`
+ The color of the box when the mouse is over it.
+ label_pad : float
+ The distance between the label and the right side of the textbox.
+ textalignment : {'left', 'center', 'right'}
+ The horizontal location of the text.
+ """
+ super().__init__(ax)
+
+ self._text_position = _api.check_getitem(
+ {"left": 0.05, "center": 0.5, "right": 0.95},
+ textalignment=textalignment)
+
+ self.label = ax.text(
+ -label_pad, 0.5, label, transform=ax.transAxes,
+ verticalalignment='center', horizontalalignment='right')
+
+ # TextBox's text object should not parse mathtext at all.
+ self.text_disp = self.ax.text(
+ self._text_position, 0.5, initial, transform=self.ax.transAxes,
+ verticalalignment='center', horizontalalignment=textalignment,
+ parse_math=False)
+
+ self._observers = cbook.CallbackRegistry(signals=["change", "submit"])
+
+ ax.set(
+ xlim=(0, 1), ylim=(0, 1), # s.t. cursor appears from first click.
+ navigate=False, facecolor=color,
+ xticks=[], yticks=[])
+
+ self.cursor_index = 0
+
+ self.cursor = ax.vlines(0, 0, 0, visible=False, color="k", lw=1,
+ transform=mpl.transforms.IdentityTransform())
+
+ self.connect_event('button_press_event', self._click)
+ self.connect_event('button_release_event', self._release)
+ self.connect_event('motion_notify_event', self._motion)
+ self.connect_event('key_press_event', self._keypress)
+ self.connect_event('resize_event', self._resize)
+
+ self.color = color
+ self.hovercolor = hovercolor
+
+ self.capturekeystrokes = False
+
+ @property
+ def text(self):
+ return self.text_disp.get_text()
+
+ def _rendercursor(self):
+ # this is a hack to figure out where the cursor should go.
+ # we draw the text up to where the cursor should go, measure
+ # and save its dimensions, draw the real text, then put the cursor
+ # at the saved dimensions
+
+ # This causes a single extra draw if the figure has never been rendered
+ # yet, which should be fine as we're going to repeatedly re-render the
+ # figure later anyways.
+ fig = self.ax.get_figure(root=True)
+ if fig._get_renderer() is None:
+ fig.canvas.draw()
+
+ text = self.text_disp.get_text() # Save value before overwriting it.
+ widthtext = text[:self.cursor_index]
+
+ bb_text = self.text_disp.get_window_extent()
+ self.text_disp.set_text(widthtext or ",")
+ bb_widthtext = self.text_disp.get_window_extent()
+
+ if bb_text.y0 == bb_text.y1: # Restoring the height if no text.
+ bb_text.y0 -= bb_widthtext.height / 2
+ bb_text.y1 += bb_widthtext.height / 2
+ elif not widthtext: # Keep width to 0.
+ bb_text.x1 = bb_text.x0
+ else: # Move the cursor using width of bb_widthtext.
+ bb_text.x1 = bb_text.x0 + bb_widthtext.width
+
+ self.cursor.set(
+ segments=[[(bb_text.x1, bb_text.y0), (bb_text.x1, bb_text.y1)]],
+ visible=True)
+ self.text_disp.set_text(text)
+
+ fig.canvas.draw()
+
+ def _release(self, event):
+ if self.ignore(event):
+ return
+ if event.canvas.mouse_grabber != self.ax:
+ return
+ event.canvas.release_mouse(self.ax)
+
+ def _keypress(self, event):
+ if self.ignore(event):
+ return
+ if self.capturekeystrokes:
+ key = event.key
+ text = self.text
+ if len(key) == 1:
+ text = (text[:self.cursor_index] + key +
+ text[self.cursor_index:])
+ self.cursor_index += 1
+ elif key == "right":
+ if self.cursor_index != len(text):
+ self.cursor_index += 1
+ elif key == "left":
+ if self.cursor_index != 0:
+ self.cursor_index -= 1
+ elif key == "home":
+ self.cursor_index = 0
+ elif key == "end":
+ self.cursor_index = len(text)
+ elif key == "backspace":
+ if self.cursor_index != 0:
+ text = (text[:self.cursor_index - 1] +
+ text[self.cursor_index:])
+ self.cursor_index -= 1
+ elif key == "delete":
+ if self.cursor_index != len(self.text):
+ text = (text[:self.cursor_index] +
+ text[self.cursor_index + 1:])
+ self.text_disp.set_text(text)
+ self._rendercursor()
+ if self.eventson:
+ self._observers.process('change', self.text)
+ if key in ["enter", "return"]:
+ self._observers.process('submit', self.text)
+
+ def set_val(self, val):
+ newval = str(val)
+ if self.text == newval:
+ return
+ self.text_disp.set_text(newval)
+ self._rendercursor()
+ if self.eventson:
+ self._observers.process('change', self.text)
+ self._observers.process('submit', self.text)
+
+ def begin_typing(self):
+ self.capturekeystrokes = True
+ # Disable keypress shortcuts, which may otherwise cause the figure to
+ # be saved, closed, etc., until the user stops typing. The way to
+ # achieve this depends on whether toolmanager is in use.
+ stack = ExitStack() # Register cleanup actions when user stops typing.
+ self._on_stop_typing = stack.close
+ toolmanager = getattr(
+ self.ax.get_figure(root=True).canvas.manager, "toolmanager", None)
+ if toolmanager is not None:
+ # If using toolmanager, lock keypresses, and plan to release the
+ # lock when typing stops.
+ toolmanager.keypresslock(self)
+ stack.callback(toolmanager.keypresslock.release, self)
+ else:
+ # If not using toolmanager, disable all keypress-related rcParams.
+ # Avoid spurious warnings if keymaps are getting deprecated.
+ with _api.suppress_matplotlib_deprecation_warning():
+ stack.enter_context(mpl.rc_context(
+ {k: [] for k in mpl.rcParams if k.startswith("keymap.")}))
+
+ def stop_typing(self):
+ if self.capturekeystrokes:
+ self._on_stop_typing()
+ self._on_stop_typing = None
+ notifysubmit = True
+ else:
+ notifysubmit = False
+ self.capturekeystrokes = False
+ self.cursor.set_visible(False)
+ self.ax.get_figure(root=True).canvas.draw()
+ if notifysubmit and self.eventson:
+ # Because process() might throw an error in the user's code, only
+ # call it once we've already done our cleanup.
+ self._observers.process('submit', self.text)
+
+ def _click(self, event):
+ if self.ignore(event):
+ return
+ if not self.ax.contains(event)[0]:
+ self.stop_typing()
+ return
+ if not self.eventson:
+ return
+ if event.canvas.mouse_grabber != self.ax:
+ event.canvas.grab_mouse(self.ax)
+ if not self.capturekeystrokes:
+ self.begin_typing()
+ self.cursor_index = self.text_disp._char_index_at(event.x)
+ self._rendercursor()
+
+ def _resize(self, event):
+ self.stop_typing()
+
+ def _motion(self, event):
+ if self.ignore(event):
+ return
+ c = self.hovercolor if self.ax.contains(event)[0] else self.color
+ if not colors.same_color(c, self.ax.get_facecolor()):
+ self.ax.set_facecolor(c)
+ if self.drawon:
+ self.ax.get_figure(root=True).canvas.draw()
+
+ def on_text_change(self, func):
+ """
+ When the text changes, call this *func* with event.
+
+ A connection id is returned which can be used to disconnect.
+ """
+ return self._observers.connect('change', lambda text: func(text))
+
+ def on_submit(self, func):
+ """
+ When the user hits enter or leaves the submission box, call this
+ *func* with event.
+
+ A connection id is returned which can be used to disconnect.
+ """
+ return self._observers.connect('submit', lambda text: func(text))
+
+ def disconnect(self, cid):
+ """Remove the observer with connection id *cid*."""
+ self._observers.disconnect(cid)
+
+
+class RadioButtons(AxesWidget):
+ """
+ A GUI neutral radio button.
+
+ For the buttons to remain responsive you must keep a reference to this
+ object.
+
+ Connect to the RadioButtons with the `.on_clicked` method.
+
+ Attributes
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+ activecolor : :mpltype:`color`
+ The color of the selected button.
+ labels : list of `.Text`
+ The button labels.
+ value_selected : str
+ The label text of the currently selected button.
+ index_selected : int
+ The index of the selected button.
+ """
+
+ def __init__(self, ax, labels, active=0, activecolor=None, *,
+ useblit=True, label_props=None, radio_props=None):
+ """
+ Add radio buttons to an `~.axes.Axes`.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The Axes to add the buttons to.
+ labels : list of str
+ The button labels.
+ active : int
+ The index of the initially selected button.
+ activecolor : :mpltype:`color`
+ The color of the selected button. The default is ``'blue'`` if not
+ specified here or in *radio_props*.
+ useblit : bool, default: True
+ Use blitting for faster drawing if supported by the backend.
+ See the tutorial :ref:`blitting` for details.
+
+ .. versionadded:: 3.7
+
+ label_props : dict or list of dict, optional
+ Dictionary of `.Text` properties to be used for the labels.
+
+ .. versionadded:: 3.7
+ radio_props : dict, optional
+ Dictionary of scatter `.Collection` properties to be used for the
+ radio buttons. Defaults to (label font size / 2)**2 size, black
+ edgecolor, and *activecolor* facecolor (when active).
+
+ .. note::
+ If a facecolor is supplied in *radio_props*, it will override
+ *activecolor*. This may be used to provide an active color per
+ button.
+
+ .. versionadded:: 3.7
+ """
+ super().__init__(ax)
+
+ _api.check_isinstance((dict, None), label_props=label_props,
+ radio_props=radio_props)
+
+ radio_props = cbook.normalize_kwargs(radio_props,
+ collections.PathCollection)
+ if activecolor is not None:
+ if 'facecolor' in radio_props:
+ _api.warn_external(
+ 'Both the *activecolor* parameter and the *facecolor* '
+ 'key in the *radio_props* parameter has been specified. '
+ '*activecolor* will be ignored.')
+ else:
+ activecolor = 'blue' # Default.
+
+ self._activecolor = activecolor
+ self._initial_active = active
+ self.value_selected = labels[active]
+ self.index_selected = active
+
+ ax.set_xticks([])
+ ax.set_yticks([])
+ ax.set_navigate(False)
+
+ ys = np.linspace(1, 0, len(labels) + 2)[1:-1]
+
+ self._useblit = useblit and self.canvas.supports_blit
+ self._background = None
+
+ label_props = _expand_text_props(label_props)
+ self.labels = [
+ ax.text(0.25, y, label, transform=ax.transAxes,
+ horizontalalignment="left", verticalalignment="center",
+ **props)
+ for y, label, props in zip(ys, labels, label_props)]
+ text_size = np.array([text.get_fontsize() for text in self.labels]) / 2
+
+ radio_props = {
+ 's': text_size**2,
+ **radio_props,
+ 'marker': 'o',
+ 'transform': ax.transAxes,
+ 'animated': self._useblit,
+ }
+ radio_props.setdefault('edgecolor', radio_props.get('color', 'black'))
+ radio_props.setdefault('facecolor',
+ radio_props.pop('color', activecolor))
+ self._buttons = ax.scatter([.15] * len(ys), ys, **radio_props)
+ # The user may have passed custom colours in radio_props, so we need to
+ # create the radios, and modify the visibility after getting whatever
+ # the user set.
+ self._active_colors = self._buttons.get_facecolor()
+ if len(self._active_colors) == 1:
+ self._active_colors = np.repeat(self._active_colors, len(labels),
+ axis=0)
+ self._buttons.set_facecolor(
+ [activecolor if i == active else "none"
+ for i, activecolor in enumerate(self._active_colors)])
+
+ self.connect_event('button_press_event', self._clicked)
+ if self._useblit:
+ self.connect_event('draw_event', self._clear)
+
+ self._observers = cbook.CallbackRegistry(signals=["clicked"])
+
+ def _clear(self, event):
+ """Internal event handler to clear the buttons."""
+ if self.ignore(event) or self.canvas.is_saving():
+ return
+ self._background = self.canvas.copy_from_bbox(self.ax.bbox)
+ self.ax.draw_artist(self._buttons)
+
+ def _clicked(self, event):
+ if self.ignore(event) or event.button != 1 or not self.ax.contains(event)[0]:
+ return
+ idxs = [ # Indices of buttons and of texts that contain the event.
+ *self._buttons.contains(event)[1]["ind"],
+ *[i for i, text in enumerate(self.labels) if text.contains(event)[0]]]
+ if idxs:
+ coords = self._buttons.get_offset_transform().transform(
+ self._buttons.get_offsets())
+ self.set_active( # Closest index, only looking in idxs.
+ idxs[(((event.x, event.y) - coords[idxs]) ** 2).sum(-1).argmin()])
+
+ def set_label_props(self, props):
+ """
+ Set properties of the `.Text` labels.
+
+ .. versionadded:: 3.7
+
+ Parameters
+ ----------
+ props : dict
+ Dictionary of `.Text` properties to be used for the labels.
+ """
+ _api.check_isinstance(dict, props=props)
+ props = _expand_text_props(props)
+ for text, prop in zip(self.labels, props):
+ text.update(prop)
+
+ def set_radio_props(self, props):
+ """
+ Set properties of the `.Text` labels.
+
+ .. versionadded:: 3.7
+
+ Parameters
+ ----------
+ props : dict
+ Dictionary of `.Collection` properties to be used for the radio
+ buttons.
+ """
+ _api.check_isinstance(dict, props=props)
+ if 's' in props: # Keep API consistent with constructor.
+ props['sizes'] = np.broadcast_to(props.pop('s'), len(self.labels))
+ self._buttons.update(props)
+ self._active_colors = self._buttons.get_facecolor()
+ if len(self._active_colors) == 1:
+ self._active_colors = np.repeat(self._active_colors,
+ len(self.labels), axis=0)
+ self._buttons.set_facecolor(
+ [activecolor if text.get_text() == self.value_selected else "none"
+ for text, activecolor in zip(self.labels, self._active_colors)])
+
+ @property
+ def activecolor(self):
+ return self._activecolor
+
+ @activecolor.setter
+ def activecolor(self, activecolor):
+ colors._check_color_like(activecolor=activecolor)
+ self._activecolor = activecolor
+ self.set_radio_props({'facecolor': activecolor})
+
+ def set_active(self, index):
+ """
+ Select button with number *index*.
+
+ Callbacks will be triggered if :attr:`eventson` is True.
+
+ Parameters
+ ----------
+ index : int
+ The index of the button to activate.
+
+ Raises
+ ------
+ ValueError
+ If the index is invalid.
+ """
+ if index not in range(len(self.labels)):
+ raise ValueError(f'Invalid RadioButton index: {index}')
+ self.value_selected = self.labels[index].get_text()
+ self.index_selected = index
+ button_facecolors = self._buttons.get_facecolor()
+ button_facecolors[:] = colors.to_rgba("none")
+ button_facecolors[index] = colors.to_rgba(self._active_colors[index])
+ self._buttons.set_facecolor(button_facecolors)
+
+ if self.drawon:
+ if self._useblit:
+ if self._background is not None:
+ self.canvas.restore_region(self._background)
+ self.ax.draw_artist(self._buttons)
+ self.canvas.blit(self.ax.bbox)
+ else:
+ self.canvas.draw()
+
+ if self.eventson:
+ self._observers.process('clicked', self.labels[index].get_text())
+
+ def clear(self):
+ """Reset the active button to the initially active one."""
+ self.set_active(self._initial_active)
+
+ def on_clicked(self, func):
+ """
+ Connect the callback function *func* to button click events.
+
+ Parameters
+ ----------
+ func : callable
+ When the button is clicked, call *func* with button label.
+ When all buttons are cleared, call *func* with None.
+ The callback func must have the signature::
+
+ def func(label: str | None) -> Any
+
+ Return values may exist, but are ignored.
+
+ Returns
+ -------
+ A connection id, which can be used to disconnect the callback.
+ """
+ return self._observers.connect('clicked', func)
+
+ def disconnect(self, cid):
+ """Remove the observer with connection id *cid*."""
+ self._observers.disconnect(cid)
+
+
+class SubplotTool(Widget):
+ """
+ A tool to adjust the subplot params of a `.Figure`.
+ """
+
+ def __init__(self, targetfig, toolfig):
+ """
+ Parameters
+ ----------
+ targetfig : `~matplotlib.figure.Figure`
+ The figure instance to adjust.
+ toolfig : `~matplotlib.figure.Figure`
+ The figure instance to embed the subplot tool into.
+ """
+
+ self.figure = toolfig
+ self.targetfig = targetfig
+ toolfig.subplots_adjust(left=0.2, right=0.9)
+ toolfig.suptitle("Click on slider to adjust subplot param")
+
+ self._sliders = []
+ names = ["left", "bottom", "right", "top", "wspace", "hspace"]
+ # The last subplot, removed below, keeps space for the "Reset" button.
+ for name, ax in zip(names, toolfig.subplots(len(names) + 1)):
+ ax.set_navigate(False)
+ slider = Slider(ax, name, 0, 1,
+ valinit=getattr(targetfig.subplotpars, name))
+ slider.on_changed(self._on_slider_changed)
+ self._sliders.append(slider)
+ toolfig.axes[-1].remove()
+ (self.sliderleft, self.sliderbottom, self.sliderright, self.slidertop,
+ self.sliderwspace, self.sliderhspace) = self._sliders
+ for slider in [self.sliderleft, self.sliderbottom,
+ self.sliderwspace, self.sliderhspace]:
+ slider.closedmax = False
+ for slider in [self.sliderright, self.slidertop]:
+ slider.closedmin = False
+
+ # constraints
+ self.sliderleft.slidermax = self.sliderright
+ self.sliderright.slidermin = self.sliderleft
+ self.sliderbottom.slidermax = self.slidertop
+ self.slidertop.slidermin = self.sliderbottom
+
+ bax = toolfig.add_axes([0.8, 0.05, 0.15, 0.075])
+ self.buttonreset = Button(bax, 'Reset')
+ self.buttonreset.on_clicked(self._on_reset)
+
+ def _on_slider_changed(self, _):
+ self.targetfig.subplots_adjust(
+ **{slider.label.get_text(): slider.val
+ for slider in self._sliders})
+ if self.drawon:
+ self.targetfig.canvas.draw()
+
+ def _on_reset(self, event):
+ with ExitStack() as stack:
+ # Temporarily disable drawing on self and self's sliders, and
+ # disconnect slider events (as the subplotparams can be temporarily
+ # invalid, depending on the order in which they are restored).
+ stack.enter_context(cbook._setattr_cm(self, drawon=False))
+ for slider in self._sliders:
+ stack.enter_context(
+ cbook._setattr_cm(slider, drawon=False, eventson=False))
+ # Reset the slider to the initial position.
+ for slider in self._sliders:
+ slider.reset()
+ if self.drawon:
+ event.canvas.draw() # Redraw the subplottool canvas.
+ self._on_slider_changed(None) # Apply changes to the target window.
+
+
+class Cursor(AxesWidget):
+ """
+ A crosshair cursor that spans the Axes and moves with mouse cursor.
+
+ For the cursor to remain responsive you must keep a reference to it.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The `~.axes.Axes` to attach the cursor to.
+ horizOn : bool, default: True
+ Whether to draw the horizontal line.
+ vertOn : bool, default: True
+ Whether to draw the vertical line.
+ useblit : bool, default: False
+ Use blitting for faster drawing if supported by the backend.
+ See the tutorial :ref:`blitting` for details.
+
+ Other Parameters
+ ----------------
+ **lineprops
+ `.Line2D` properties that control the appearance of the lines.
+ See also `~.Axes.axhline`.
+
+ Examples
+ --------
+ See :doc:`/gallery/widgets/cursor`.
+ """
+ def __init__(self, ax, *, horizOn=True, vertOn=True, useblit=False,
+ **lineprops):
+ super().__init__(ax)
+
+ self.connect_event('motion_notify_event', self.onmove)
+ self.connect_event('draw_event', self.clear)
+
+ self.visible = True
+ self.horizOn = horizOn
+ self.vertOn = vertOn
+ self.useblit = useblit and self.canvas.supports_blit
+
+ if self.useblit:
+ lineprops['animated'] = True
+ self.lineh = ax.axhline(ax.get_ybound()[0], visible=False, **lineprops)
+ self.linev = ax.axvline(ax.get_xbound()[0], visible=False, **lineprops)
+
+ self.background = None
+ self.needclear = False
+
+ def clear(self, event):
+ """Internal event handler to clear the cursor."""
+ if self.ignore(event) or self.canvas.is_saving():
+ return
+ if self.useblit:
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+
+ def onmove(self, event):
+ """Internal event handler to draw the cursor when the mouse moves."""
+ if self.ignore(event):
+ return
+ if not self.canvas.widgetlock.available(self):
+ return
+ if not self.ax.contains(event)[0]:
+ self.linev.set_visible(False)
+ self.lineh.set_visible(False)
+ if self.needclear:
+ self.canvas.draw()
+ self.needclear = False
+ return
+ self.needclear = True
+ xdata, ydata = self._get_data_coords(event)
+ self.linev.set_xdata((xdata, xdata))
+ self.linev.set_visible(self.visible and self.vertOn)
+ self.lineh.set_ydata((ydata, ydata))
+ self.lineh.set_visible(self.visible and self.horizOn)
+ if not (self.visible and (self.vertOn or self.horizOn)):
+ return
+ # Redraw.
+ if self.useblit:
+ if self.background is not None:
+ self.canvas.restore_region(self.background)
+ self.ax.draw_artist(self.linev)
+ self.ax.draw_artist(self.lineh)
+ self.canvas.blit(self.ax.bbox)
+ else:
+ self.canvas.draw_idle()
+
+
+class MultiCursor(Widget):
+ """
+ Provide a vertical (default) and/or horizontal line cursor shared between
+ multiple Axes.
+
+ For the cursor to remain responsive you must keep a reference to it.
+
+ Parameters
+ ----------
+ canvas : object
+ This parameter is entirely unused and only kept for back-compatibility.
+
+ axes : list of `~matplotlib.axes.Axes`
+ The `~.axes.Axes` to attach the cursor to.
+
+ useblit : bool, default: True
+ Use blitting for faster drawing if supported by the backend.
+ See the tutorial :ref:`blitting`
+ for details.
+
+ horizOn : bool, default: False
+ Whether to draw the horizontal line.
+
+ vertOn : bool, default: True
+ Whether to draw the vertical line.
+
+ Other Parameters
+ ----------------
+ **lineprops
+ `.Line2D` properties that control the appearance of the lines.
+ See also `~.Axes.axhline`.
+
+ Examples
+ --------
+ See :doc:`/gallery/widgets/multicursor`.
+ """
+
+ def __init__(self, canvas, axes, *, useblit=True, horizOn=False, vertOn=True,
+ **lineprops):
+ # canvas is stored only to provide the deprecated .canvas attribute;
+ # once it goes away the unused argument won't need to be stored at all.
+ self._canvas = canvas
+
+ self.axes = axes
+ self.horizOn = horizOn
+ self.vertOn = vertOn
+
+ self._canvas_infos = {
+ ax.get_figure(root=True).canvas:
+ {"cids": [], "background": None} for ax in axes}
+
+ xmin, xmax = axes[-1].get_xlim()
+ ymin, ymax = axes[-1].get_ylim()
+ xmid = 0.5 * (xmin + xmax)
+ ymid = 0.5 * (ymin + ymax)
+
+ self.visible = True
+ self.useblit = (
+ useblit
+ and all(canvas.supports_blit for canvas in self._canvas_infos))
+
+ if self.useblit:
+ lineprops['animated'] = True
+
+ self.vlines = [ax.axvline(xmid, visible=False, **lineprops)
+ for ax in axes]
+ self.hlines = [ax.axhline(ymid, visible=False, **lineprops)
+ for ax in axes]
+
+ self.connect()
+
+ def connect(self):
+ """Connect events."""
+ for canvas, info in self._canvas_infos.items():
+ info["cids"] = [
+ canvas.mpl_connect('motion_notify_event', self.onmove),
+ canvas.mpl_connect('draw_event', self.clear),
+ ]
+
+ def disconnect(self):
+ """Disconnect events."""
+ for canvas, info in self._canvas_infos.items():
+ for cid in info["cids"]:
+ canvas.mpl_disconnect(cid)
+ info["cids"].clear()
+
+ def clear(self, event):
+ """Clear the cursor."""
+ if self.ignore(event):
+ return
+ if self.useblit:
+ for canvas, info in self._canvas_infos.items():
+ # someone has switched the canvas on us! This happens if
+ # `savefig` needs to save to a format the previous backend did
+ # not support (e.g. saving a figure using an Agg based backend
+ # saved to a vector format).
+ if canvas is not canvas.figure.canvas:
+ continue
+ info["background"] = canvas.copy_from_bbox(canvas.figure.bbox)
+
+ def onmove(self, event):
+ axs = [ax for ax in self.axes if ax.contains(event)[0]]
+ if self.ignore(event) or not axs or not event.canvas.widgetlock.available(self):
+ return
+ ax = cbook._topmost_artist(axs)
+ xdata, ydata = ((event.xdata, event.ydata) if event.inaxes is ax
+ else ax.transData.inverted().transform((event.x, event.y)))
+ for line in self.vlines:
+ line.set_xdata((xdata, xdata))
+ line.set_visible(self.visible and self.vertOn)
+ for line in self.hlines:
+ line.set_ydata((ydata, ydata))
+ line.set_visible(self.visible and self.horizOn)
+ if not (self.visible and (self.vertOn or self.horizOn)):
+ return
+ # Redraw.
+ if self.useblit:
+ for canvas, info in self._canvas_infos.items():
+ if info["background"]:
+ canvas.restore_region(info["background"])
+ if self.vertOn:
+ for ax, line in zip(self.axes, self.vlines):
+ ax.draw_artist(line)
+ if self.horizOn:
+ for ax, line in zip(self.axes, self.hlines):
+ ax.draw_artist(line)
+ for canvas in self._canvas_infos:
+ canvas.blit()
+ else:
+ for canvas in self._canvas_infos:
+ canvas.draw_idle()
+
+
+class _SelectorWidget(AxesWidget):
+
+ def __init__(self, ax, onselect=None, useblit=False, button=None,
+ state_modifier_keys=None, use_data_coordinates=False):
+ super().__init__(ax)
+
+ self._visible = True
+ if onselect is None:
+ self.onselect = lambda *args: None
+ else:
+ self.onselect = onselect
+ self.useblit = useblit and self.canvas.supports_blit
+ self.connect_default_events()
+
+ self._state_modifier_keys = dict(move=' ', clear='escape',
+ square='shift', center='control',
+ rotate='r')
+ self._state_modifier_keys.update(state_modifier_keys or {})
+ self._use_data_coordinates = use_data_coordinates
+
+ self.background = None
+
+ if isinstance(button, Integral):
+ self.validButtons = [button]
+ else:
+ self.validButtons = button
+
+ # Set to True when a selection is completed, otherwise is False
+ self._selection_completed = False
+
+ # will save the data (position at mouseclick)
+ self._eventpress = None
+ # will save the data (pos. at mouserelease)
+ self._eventrelease = None
+ self._prev_event = None
+ self._state = set()
+
+ def set_active(self, active):
+ super().set_active(active)
+ if active:
+ self.update_background(None)
+
+ def _get_animated_artists(self):
+ """
+ Convenience method to get all animated artists of the figure containing
+ this widget, excluding those already present in self.artists.
+ The returned tuple is not sorted by 'z_order': z_order sorting is
+ valid only when considering all artists and not only a subset of all
+ artists.
+ """
+ return tuple(a for ax_ in self.ax.get_figure().get_axes()
+ for a in ax_.get_children()
+ if a.get_animated() and a not in self.artists)
+
+ def update_background(self, event):
+ """Force an update of the background."""
+ # If you add a call to `ignore` here, you'll want to check edge case:
+ # `release` can call a draw event even when `ignore` is True.
+ if not self.useblit:
+ return
+ # Make sure that widget artists don't get accidentally included in the
+ # background, by re-rendering the background if needed (and then
+ # re-re-rendering the canvas with the visible widget artists).
+ # We need to remove all artists which will be drawn when updating
+ # the selector: if we have animated artists in the figure, it is safer
+ # to redrawn by default, in case they have updated by the callback
+ # zorder needs to be respected when redrawing
+ artists = sorted(self.artists + self._get_animated_artists(),
+ key=lambda a: a.get_zorder())
+ needs_redraw = any(artist.get_visible() for artist in artists)
+ with ExitStack() as stack:
+ if needs_redraw:
+ for artist in artists:
+ stack.enter_context(artist._cm_set(visible=False))
+ self.canvas.draw()
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+ if needs_redraw:
+ for artist in artists:
+ self.ax.draw_artist(artist)
+
+ def connect_default_events(self):
+ """Connect the major canvas events to methods."""
+ self.connect_event('motion_notify_event', self.onmove)
+ self.connect_event('button_press_event', self.press)
+ self.connect_event('button_release_event', self.release)
+ self.connect_event('draw_event', self.update_background)
+ self.connect_event('key_press_event', self.on_key_press)
+ self.connect_event('key_release_event', self.on_key_release)
+ self.connect_event('scroll_event', self.on_scroll)
+
+ def ignore(self, event):
+ # docstring inherited
+ if not self.active or not self.ax.get_visible():
+ return True
+ # If canvas was locked
+ if not self.canvas.widgetlock.available(self):
+ return True
+ if not hasattr(event, 'button'):
+ event.button = None
+ # Only do rectangle selection if event was triggered
+ # with a desired button
+ if (self.validButtons is not None
+ and event.button not in self.validButtons):
+ return True
+ # If no button was pressed yet ignore the event if it was out of the Axes.
+ if self._eventpress is None:
+ return not self.ax.contains(event)[0]
+ # If a button was pressed, check if the release-button is the same.
+ if event.button == self._eventpress.button:
+ return False
+ # If a button was pressed, check if the release-button is the same.
+ return (not self.ax.contains(event)[0] or
+ event.button != self._eventpress.button)
+
+ def update(self):
+ """Draw using blit() or draw_idle(), depending on ``self.useblit``."""
+ if (not self.ax.get_visible() or
+ self.ax.get_figure(root=True)._get_renderer() is None):
+ return
+ if self.useblit:
+ if self.background is not None:
+ self.canvas.restore_region(self.background)
+ else:
+ self.update_background(None)
+ # We need to draw all artists, which are not included in the
+ # background, therefore we also draw self._get_animated_artists()
+ # and we make sure that we respect z_order
+ artists = sorted(self.artists + self._get_animated_artists(),
+ key=lambda a: a.get_zorder())
+ for artist in artists:
+ self.ax.draw_artist(artist)
+ self.canvas.blit(self.ax.bbox)
+ else:
+ self.canvas.draw_idle()
+
+ def _get_data(self, event):
+ """Get the xdata and ydata for event, with limits."""
+ if event.xdata is None:
+ return None, None
+ xdata, ydata = self._get_data_coords(event)
+ xdata = np.clip(xdata, *self.ax.get_xbound())
+ ydata = np.clip(ydata, *self.ax.get_ybound())
+ return xdata, ydata
+
+ def _clean_event(self, event):
+ """
+ Preprocess an event:
+
+ - Replace *event* by the previous event if *event* has no ``xdata``.
+ - Get ``xdata`` and ``ydata`` from this widget's Axes, and clip them to the axes
+ limits.
+ - Update the previous event.
+ """
+ if event.xdata is None:
+ event = self._prev_event
+ else:
+ event = copy.copy(event)
+ event.xdata, event.ydata = self._get_data(event)
+ self._prev_event = event
+ return event
+
+ def press(self, event):
+ """Button press handler and validator."""
+ if not self.ignore(event):
+ event = self._clean_event(event)
+ self._eventpress = event
+ self._prev_event = event
+ key = event.key or ''
+ key = key.replace('ctrl', 'control')
+ # move state is locked in on a button press
+ if key == self._state_modifier_keys['move']:
+ self._state.add('move')
+ self._press(event)
+ return True
+ return False
+
+ def _press(self, event):
+ """Button press event handler."""
+
+ def release(self, event):
+ """Button release event handler and validator."""
+ if not self.ignore(event) and self._eventpress:
+ event = self._clean_event(event)
+ self._eventrelease = event
+ self._release(event)
+ self._eventpress = None
+ self._eventrelease = None
+ self._state.discard('move')
+ return True
+ return False
+
+ def _release(self, event):
+ """Button release event handler."""
+
+ def onmove(self, event):
+ """Cursor move event handler and validator."""
+ if not self.ignore(event) and self._eventpress:
+ event = self._clean_event(event)
+ self._onmove(event)
+ return True
+ return False
+
+ def _onmove(self, event):
+ """Cursor move event handler."""
+
+ def on_scroll(self, event):
+ """Mouse scroll event handler and validator."""
+ if not self.ignore(event):
+ self._on_scroll(event)
+
+ def _on_scroll(self, event):
+ """Mouse scroll event handler."""
+
+ def on_key_press(self, event):
+ """Key press event handler and validator for all selection widgets."""
+ if self.active:
+ key = event.key or ''
+ key = key.replace('ctrl', 'control')
+ if key == self._state_modifier_keys['clear']:
+ self.clear()
+ return
+ for (state, modifier) in self._state_modifier_keys.items():
+ if modifier in key.split('+'):
+ # 'rotate' is changing _state on press and is not removed
+ # from _state when releasing
+ if state == 'rotate':
+ if state in self._state:
+ self._state.discard(state)
+ else:
+ self._state.add(state)
+ else:
+ self._state.add(state)
+ self._on_key_press(event)
+
+ def _on_key_press(self, event):
+ """Key press event handler - for widget-specific key press actions."""
+
+ def on_key_release(self, event):
+ """Key release event handler and validator."""
+ if self.active:
+ key = event.key or ''
+ for (state, modifier) in self._state_modifier_keys.items():
+ # 'rotate' is changing _state on press and is not removed
+ # from _state when releasing
+ if modifier in key.split('+') and state != 'rotate':
+ self._state.discard(state)
+ self._on_key_release(event)
+
+ def _on_key_release(self, event):
+ """Key release event handler."""
+
+ def set_visible(self, visible):
+ """Set the visibility of the selector artists."""
+ self._visible = visible
+ for artist in self.artists:
+ artist.set_visible(visible)
+
+ def get_visible(self):
+ """Get the visibility of the selector artists."""
+ return self._visible
+
+ def clear(self):
+ """Clear the selection and set the selector ready to make a new one."""
+ self._clear_without_update()
+ self.update()
+
+ def _clear_without_update(self):
+ self._selection_completed = False
+ self.set_visible(False)
+
+ @property
+ def artists(self):
+ """Tuple of the artists of the selector."""
+ handles_artists = getattr(self, '_handles_artists', ())
+ return (self._selection_artist,) + handles_artists
+
+ def set_props(self, **props):
+ """
+ Set the properties of the selector artist.
+
+ See the *props* argument in the selector docstring to know which properties are
+ supported.
+ """
+ artist = self._selection_artist
+ props = cbook.normalize_kwargs(props, artist)
+ artist.set(**props)
+ if self.useblit:
+ self.update()
+
+ def set_handle_props(self, **handle_props):
+ """
+ Set the properties of the handles selector artist. See the
+ `handle_props` argument in the selector docstring to know which
+ properties are supported.
+ """
+ if not hasattr(self, '_handles_artists'):
+ raise NotImplementedError("This selector doesn't have handles.")
+
+ artist = self._handles_artists[0]
+ handle_props = cbook.normalize_kwargs(handle_props, artist)
+ for handle in self._handles_artists:
+ handle.set(**handle_props)
+ if self.useblit:
+ self.update()
+ self._handle_props.update(handle_props)
+
+ def _validate_state(self, state):
+ supported_state = [
+ key for key, value in self._state_modifier_keys.items()
+ if key != 'clear' and value != 'not-applicable'
+ ]
+ _api.check_in_list(supported_state, state=state)
+
+ def add_state(self, state):
+ """
+ Add a state to define the widget's behavior. See the
+ `state_modifier_keys` parameters for details.
+
+ Parameters
+ ----------
+ state : str
+ Must be a supported state of the selector. See the
+ `state_modifier_keys` parameters for details.
+
+ Raises
+ ------
+ ValueError
+ When the state is not supported by the selector.
+
+ """
+ self._validate_state(state)
+ self._state.add(state)
+
+ def remove_state(self, state):
+ """
+ Remove a state to define the widget's behavior. See the
+ `state_modifier_keys` parameters for details.
+
+ Parameters
+ ----------
+ state : str
+ Must be a supported state of the selector. See the
+ `state_modifier_keys` parameters for details.
+
+ Raises
+ ------
+ ValueError
+ When the state is not supported by the selector.
+
+ """
+ self._validate_state(state)
+ self._state.remove(state)
+
+
+class SpanSelector(_SelectorWidget):
+ """
+ Visually select a min/max range on a single axis and call a function with
+ those values.
+
+ To guarantee that the selector remains responsive, keep a reference to it.
+
+ In order to turn off the SpanSelector, set ``span_selector.active`` to
+ False. To turn it back on, set it to True.
+
+ Press and release events triggered at the same coordinates outside the
+ selection will clear the selector, except when
+ ``ignore_event_outside=True``.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+
+ onselect : callable with signature ``func(min: float, max: float)``
+ A callback function that is called after a release event and the
+ selection is created, changed or removed.
+
+ direction : {"horizontal", "vertical"}
+ The direction along which to draw the span selector.
+
+ minspan : float, default: 0
+ If selection is less than or equal to *minspan*, the selection is
+ removed (when already existing) or cancelled.
+
+ useblit : bool, default: False
+ If True, use the backend-dependent blitting features for faster
+ canvas updates. See the tutorial :ref:`blitting` for details.
+
+ props : dict, default: {'facecolor': 'red', 'alpha': 0.5}
+ Dictionary of `.Patch` properties.
+
+ onmove_callback : callable with signature ``func(min: float, max: float)``, optional
+ Called on mouse move while the span is being selected.
+
+ interactive : bool, default: False
+ Whether to draw a set of handles that allow interaction with the
+ widget after it is drawn.
+
+ button : `.MouseButton` or list of `.MouseButton`, default: all buttons
+ The mouse buttons which activate the span selector.
+
+ handle_props : dict, default: None
+ Properties of the handle lines at the edges of the span. Only used
+ when *interactive* is True. See `.Line2D` for valid properties.
+
+ grab_range : float, default: 10
+ Distance in pixels within which the interactive tool handles can be activated.
+
+ state_modifier_keys : dict, optional
+ Keyboard modifiers which affect the widget's behavior. Values
+ amend the defaults, which are:
+
+ - "clear": Clear the current shape, default: "escape".
+
+ drag_from_anywhere : bool, default: False
+ If `True`, the widget can be moved by clicking anywhere within its bounds.
+
+ ignore_event_outside : bool, default: False
+ If `True`, the event triggered outside the span selector will be ignored.
+
+ snap_values : 1D array-like, optional
+ Snap the selector edges to the given values.
+
+ Examples
+ --------
+ >>> import matplotlib.pyplot as plt
+ >>> import matplotlib.widgets as mwidgets
+ >>> fig, ax = plt.subplots()
+ >>> ax.plot([1, 2, 3], [10, 50, 100])
+ >>> def onselect(vmin, vmax):
+ ... print(vmin, vmax)
+ >>> span = mwidgets.SpanSelector(ax, onselect, 'horizontal',
+ ... props=dict(facecolor='blue', alpha=0.5))
+ >>> fig.show()
+
+ See also: :doc:`/gallery/widgets/span_selector`
+ """
+
+ def __init__(self, ax, onselect, direction, *, minspan=0, useblit=False,
+ props=None, onmove_callback=None, interactive=False,
+ button=None, handle_props=None, grab_range=10,
+ state_modifier_keys=None, drag_from_anywhere=False,
+ ignore_event_outside=False, snap_values=None):
+
+ if state_modifier_keys is None:
+ state_modifier_keys = dict(clear='escape',
+ square='not-applicable',
+ center='not-applicable',
+ rotate='not-applicable')
+ super().__init__(ax, onselect, useblit=useblit, button=button,
+ state_modifier_keys=state_modifier_keys)
+
+ if props is None:
+ props = dict(facecolor='red', alpha=0.5)
+
+ props['animated'] = self.useblit
+
+ self.direction = direction
+ self._extents_on_press = None
+ self.snap_values = snap_values
+
+ self.onmove_callback = onmove_callback
+ self.minspan = minspan
+
+ self.grab_range = grab_range
+ self._interactive = interactive
+ self._edge_handles = None
+ self.drag_from_anywhere = drag_from_anywhere
+ self.ignore_event_outside = ignore_event_outside
+
+ self.new_axes(ax, _props=props, _init=True)
+
+ # Setup handles
+ self._handle_props = {
+ 'color': props.get('facecolor', 'r'),
+ **cbook.normalize_kwargs(handle_props, Line2D)}
+
+ if self._interactive:
+ self._edge_order = ['min', 'max']
+ self._setup_edge_handles(self._handle_props)
+
+ self._active_handle = None
+
+ def new_axes(self, ax, *, _props=None, _init=False):
+ """Set SpanSelector to operate on a new Axes."""
+ reconnect = False
+ if _init or self.canvas is not ax.get_figure(root=True).canvas:
+ if self.canvas is not None:
+ self.disconnect_events()
+ reconnect = True
+ self.ax = ax
+ if reconnect:
+ self.connect_default_events()
+
+ # Reset
+ self._selection_completed = False
+
+ if self.direction == 'horizontal':
+ trans = ax.get_xaxis_transform()
+ w, h = 0, 1
+ else:
+ trans = ax.get_yaxis_transform()
+ w, h = 1, 0
+ rect_artist = Rectangle((0, 0), w, h, transform=trans, visible=False)
+ if _props is not None:
+ rect_artist.update(_props)
+ elif self._selection_artist is not None:
+ rect_artist.update_from(self._selection_artist)
+
+ self.ax.add_patch(rect_artist)
+ self._selection_artist = rect_artist
+
+ def _setup_edge_handles(self, props):
+ # Define initial position using the axis bounds to keep the same bounds
+ if self.direction == 'horizontal':
+ positions = self.ax.get_xbound()
+ else:
+ positions = self.ax.get_ybound()
+ self._edge_handles = ToolLineHandles(self.ax, positions,
+ direction=self.direction,
+ line_props=props,
+ useblit=self.useblit)
+
+ @property
+ def _handles_artists(self):
+ if self._edge_handles is not None:
+ return self._edge_handles.artists
+ else:
+ return ()
+
+ def _set_cursor(self, enabled):
+ """Update the canvas cursor based on direction of the selector."""
+ if enabled:
+ cursor = (backend_tools.Cursors.RESIZE_HORIZONTAL
+ if self.direction == 'horizontal' else
+ backend_tools.Cursors.RESIZE_VERTICAL)
+ else:
+ cursor = backend_tools.Cursors.POINTER
+
+ self.ax.get_figure(root=True).canvas.set_cursor(cursor)
+
+ def connect_default_events(self):
+ # docstring inherited
+ super().connect_default_events()
+ if getattr(self, '_interactive', False):
+ self.connect_event('motion_notify_event', self._hover)
+
+ def _press(self, event):
+ """Button press event handler."""
+ self._set_cursor(True)
+ if self._interactive and self._selection_artist.get_visible():
+ self._set_active_handle(event)
+ else:
+ self._active_handle = None
+
+ if self._active_handle is None or not self._interactive:
+ # Clear previous rectangle before drawing new rectangle.
+ self.update()
+
+ xdata, ydata = self._get_data_coords(event)
+ v = xdata if self.direction == 'horizontal' else ydata
+
+ if self._active_handle is None and not self.ignore_event_outside:
+ # when the press event outside the span, we initially set the
+ # visibility to False and extents to (v, v)
+ # update will be called when setting the extents
+ self._visible = False
+ self._set_extents((v, v))
+ # We need to set the visibility back, so the span selector will be
+ # drawn when necessary (span width > 0)
+ self._visible = True
+ else:
+ self.set_visible(True)
+
+ return False
+
+ @property
+ def direction(self):
+ """Direction of the span selector: 'vertical' or 'horizontal'."""
+ return self._direction
+
+ @direction.setter
+ def direction(self, direction):
+ """Set the direction of the span selector."""
+ _api.check_in_list(['horizontal', 'vertical'], direction=direction)
+ if hasattr(self, '_direction') and direction != self._direction:
+ # remove previous artists
+ self._selection_artist.remove()
+ if self._interactive:
+ self._edge_handles.remove()
+ self._direction = direction
+ self.new_axes(self.ax)
+ if self._interactive:
+ self._setup_edge_handles(self._handle_props)
+ else:
+ self._direction = direction
+
+ def _release(self, event):
+ """Button release event handler."""
+ self._set_cursor(False)
+
+ if not self._interactive:
+ self._selection_artist.set_visible(False)
+
+ if (self._active_handle is None and self._selection_completed and
+ self.ignore_event_outside):
+ return
+
+ vmin, vmax = self.extents
+ span = vmax - vmin
+
+ if span <= self.minspan:
+ # Remove span and set self._selection_completed = False
+ self.set_visible(False)
+ if self._selection_completed:
+ # Call onselect, only when the span is already existing
+ self.onselect(vmin, vmax)
+ self._selection_completed = False
+ else:
+ self.onselect(vmin, vmax)
+ self._selection_completed = True
+
+ self.update()
+
+ self._active_handle = None
+
+ return False
+
+ def _hover(self, event):
+ """Update the canvas cursor if it's over a handle."""
+ if self.ignore(event):
+ return
+
+ if self._active_handle is not None or not self._selection_completed:
+ # Do nothing if button is pressed and a handle is active, which may
+ # occur with drag_from_anywhere=True.
+ # Do nothing if selection is not completed, which occurs when
+ # a selector has been cleared
+ return
+
+ _, e_dist = self._edge_handles.closest(event.x, event.y)
+ self._set_cursor(e_dist <= self.grab_range)
+
+ def _onmove(self, event):
+ """Motion notify event handler."""
+
+ xdata, ydata = self._get_data_coords(event)
+ if self.direction == 'horizontal':
+ v = xdata
+ vpress = self._eventpress.xdata
+ else:
+ v = ydata
+ vpress = self._eventpress.ydata
+
+ # move existing span
+ # When "dragging from anywhere", `self._active_handle` is set to 'C'
+ # (match notation used in the RectangleSelector)
+ if self._active_handle == 'C' and self._extents_on_press is not None:
+ vmin, vmax = self._extents_on_press
+ dv = v - vpress
+ vmin += dv
+ vmax += dv
+
+ # resize an existing shape
+ elif self._active_handle and self._active_handle != 'C':
+ vmin, vmax = self._extents_on_press
+ if self._active_handle == 'min':
+ vmin = v
+ else:
+ vmax = v
+ # new shape
+ else:
+ # Don't create a new span if there is already one when
+ # ignore_event_outside=True
+ if self.ignore_event_outside and self._selection_completed:
+ return
+ vmin, vmax = vpress, v
+ if vmin > vmax:
+ vmin, vmax = vmax, vmin
+
+ self._set_extents((vmin, vmax))
+
+ if self.onmove_callback is not None:
+ self.onmove_callback(vmin, vmax)
+
+ return False
+
+ def _draw_shape(self, vmin, vmax):
+ if vmin > vmax:
+ vmin, vmax = vmax, vmin
+ if self.direction == 'horizontal':
+ self._selection_artist.set_x(vmin)
+ self._selection_artist.set_width(vmax - vmin)
+ else:
+ self._selection_artist.set_y(vmin)
+ self._selection_artist.set_height(vmax - vmin)
+
+ def _set_active_handle(self, event):
+ """Set active handle based on the location of the mouse event."""
+ # Note: event.xdata/ydata in data coordinates, event.x/y in pixels
+ e_idx, e_dist = self._edge_handles.closest(event.x, event.y)
+
+ # Prioritise center handle over other handles
+ # Use 'C' to match the notation used in the RectangleSelector
+ if 'move' in self._state:
+ self._active_handle = 'C'
+ elif e_dist > self.grab_range:
+ # Not close to any handles
+ self._active_handle = None
+ if self.drag_from_anywhere and self._contains(event):
+ # Check if we've clicked inside the region
+ self._active_handle = 'C'
+ self._extents_on_press = self.extents
+ else:
+ self._active_handle = None
+ return
+ else:
+ # Closest to an edge handle
+ self._active_handle = self._edge_order[e_idx]
+
+ # Save coordinates of rectangle at the start of handle movement.
+ self._extents_on_press = self.extents
+
+ def _contains(self, event):
+ """Return True if event is within the patch."""
+ return self._selection_artist.contains(event, radius=0)[0]
+
+ @staticmethod
+ def _snap(values, snap_values):
+ """Snap values to a given array values (snap_values)."""
+ # take into account machine precision
+ eps = np.min(np.abs(np.diff(snap_values))) * 1e-12
+ return tuple(
+ snap_values[np.abs(snap_values - v + np.sign(v) * eps).argmin()]
+ for v in values)
+
+ @property
+ def extents(self):
+ """
+ (float, float)
+ The values, in data coordinates, for the start and end points of the current
+ selection. If there is no selection then the start and end values will be
+ the same.
+ """
+ if self.direction == 'horizontal':
+ vmin = self._selection_artist.get_x()
+ vmax = vmin + self._selection_artist.get_width()
+ else:
+ vmin = self._selection_artist.get_y()
+ vmax = vmin + self._selection_artist.get_height()
+ return vmin, vmax
+
+ @extents.setter
+ def extents(self, extents):
+ self._set_extents(extents)
+ self._selection_completed = True
+
+ def _set_extents(self, extents):
+ # Update displayed shape
+ if self.snap_values is not None:
+ extents = tuple(self._snap(extents, self.snap_values))
+ self._draw_shape(*extents)
+ if self._interactive:
+ # Update displayed handles
+ self._edge_handles.set_data(self.extents)
+ self.set_visible(self._visible)
+ self.update()
+
+
+class ToolLineHandles:
+ """
+ Control handles for canvas tools.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ Matplotlib Axes where tool handles are displayed.
+ positions : 1D array
+ Positions of handles in data coordinates.
+ direction : {"horizontal", "vertical"}
+ Direction of handles, either 'vertical' or 'horizontal'
+ line_props : dict, optional
+ Additional line properties. See `.Line2D`.
+ useblit : bool, default: True
+ Whether to use blitting for faster drawing (if supported by the
+ backend). See the tutorial :ref:`blitting`
+ for details.
+ """
+
+ def __init__(self, ax, positions, direction, *, line_props=None,
+ useblit=True):
+ self.ax = ax
+
+ _api.check_in_list(['horizontal', 'vertical'], direction=direction)
+ self._direction = direction
+
+ line_props = {
+ **(line_props if line_props is not None else {}),
+ 'visible': False,
+ 'animated': useblit,
+ }
+
+ line_fun = ax.axvline if self.direction == 'horizontal' else ax.axhline
+
+ self._artists = [line_fun(p, **line_props) for p in positions]
+
+ @property
+ def artists(self):
+ return tuple(self._artists)
+
+ @property
+ def positions(self):
+ """Positions of the handle in data coordinates."""
+ method = 'get_xdata' if self.direction == 'horizontal' else 'get_ydata'
+ return [getattr(line, method)()[0] for line in self.artists]
+
+ @property
+ def direction(self):
+ """Direction of the handle: 'vertical' or 'horizontal'."""
+ return self._direction
+
+ def set_data(self, positions):
+ """
+ Set x- or y-positions of handles, depending on if the lines are
+ vertical or horizontal.
+
+ Parameters
+ ----------
+ positions : tuple of length 2
+ Set the positions of the handle in data coordinates
+ """
+ method = 'set_xdata' if self.direction == 'horizontal' else 'set_ydata'
+ for line, p in zip(self.artists, positions):
+ getattr(line, method)([p, p])
+
+ def set_visible(self, value):
+ """Set the visibility state of the handles artist."""
+ for artist in self.artists:
+ artist.set_visible(value)
+
+ def set_animated(self, value):
+ """Set the animated state of the handles artist."""
+ for artist in self.artists:
+ artist.set_animated(value)
+
+ def remove(self):
+ """Remove the handles artist from the figure."""
+ for artist in self._artists:
+ artist.remove()
+
+ def closest(self, x, y):
+ """
+ Return index and pixel distance to closest handle.
+
+ Parameters
+ ----------
+ x, y : float
+ x, y position from which the distance will be calculated to
+ determinate the closest handle
+
+ Returns
+ -------
+ index, distance : index of the handle and its distance from
+ position x, y
+ """
+ if self.direction == 'horizontal':
+ p_pts = np.array([
+ self.ax.transData.transform((p, 0))[0] for p in self.positions
+ ])
+ dist = abs(p_pts - x)
+ else:
+ p_pts = np.array([
+ self.ax.transData.transform((0, p))[1] for p in self.positions
+ ])
+ dist = abs(p_pts - y)
+ index = np.argmin(dist)
+ return index, dist[index]
+
+
+class ToolHandles:
+ """
+ Control handles for canvas tools.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ Matplotlib Axes where tool handles are displayed.
+ x, y : 1D arrays
+ Coordinates of control handles.
+ marker : str, default: 'o'
+ Shape of marker used to display handle. See `~.pyplot.plot`.
+ marker_props : dict, optional
+ Additional marker properties. See `.Line2D`.
+ useblit : bool, default: True
+ Whether to use blitting for faster drawing (if supported by the
+ backend). See the tutorial :ref:`blitting`
+ for details.
+ """
+
+ def __init__(self, ax, x, y, *, marker='o', marker_props=None, useblit=True):
+ self.ax = ax
+ props = {'marker': marker, 'markersize': 7, 'markerfacecolor': 'w',
+ 'linestyle': 'none', 'alpha': 0.5, 'visible': False,
+ 'label': '_nolegend_',
+ **cbook.normalize_kwargs(marker_props, Line2D._alias_map)}
+ self._markers = Line2D(x, y, animated=useblit, **props)
+ self.ax.add_line(self._markers)
+
+ @property
+ def x(self):
+ return self._markers.get_xdata()
+
+ @property
+ def y(self):
+ return self._markers.get_ydata()
+
+ @property
+ def artists(self):
+ return (self._markers, )
+
+ def set_data(self, pts, y=None):
+ """Set x and y positions of handles."""
+ if y is not None:
+ x = pts
+ pts = np.array([x, y])
+ self._markers.set_data(pts)
+
+ def set_visible(self, val):
+ self._markers.set_visible(val)
+
+ def set_animated(self, val):
+ self._markers.set_animated(val)
+
+ def closest(self, x, y):
+ """Return index and pixel distance to closest index."""
+ pts = np.column_stack([self.x, self.y])
+ # Transform data coordinates to pixel coordinates.
+ pts = self.ax.transData.transform(pts)
+ diff = pts - [x, y]
+ dist = np.hypot(*diff.T)
+ min_index = np.argmin(dist)
+ return min_index, dist[min_index]
+
+
+_RECTANGLESELECTOR_PARAMETERS_DOCSTRING = \
+ r"""
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+
+ onselect : function, optional
+ A callback function that is called after a release event and the
+ selection is created, changed or removed.
+ It must have the signature::
+
+ def onselect(eclick: MouseEvent, erelease: MouseEvent)
+
+ where *eclick* and *erelease* are the mouse click and release
+ `.MouseEvent`\s that start and complete the selection.
+
+ minspanx : float, default: 0
+ Selections with an x-span less than or equal to *minspanx* are removed
+ (when already existing) or cancelled.
+
+ minspany : float, default: 0
+ Selections with an y-span less than or equal to *minspanx* are removed
+ (when already existing) or cancelled.
+
+ useblit : bool, default: False
+ Whether to use blitting for faster drawing (if supported by the
+ backend). See the tutorial :ref:`blitting`
+ for details.
+
+ props : dict, optional
+ Properties with which the __ARTIST_NAME__ is drawn. See
+ `.Patch` for valid properties.
+ Default:
+
+ ``dict(facecolor='red', edgecolor='black', alpha=0.2, fill=True)``
+
+ spancoords : {"data", "pixels"}, default: "data"
+ Whether to interpret *minspanx* and *minspany* in data or in pixel
+ coordinates.
+
+ button : `.MouseButton`, list of `.MouseButton`, default: all buttons
+ Button(s) that trigger rectangle selection.
+
+ grab_range : float, default: 10
+ Distance in pixels within which the interactive tool handles can be
+ activated.
+
+ handle_props : dict, optional
+ Properties with which the interactive handles (marker artists) are
+ drawn. See the marker arguments in `.Line2D` for valid
+ properties. Default values are defined in ``mpl.rcParams`` except for
+ the default value of ``markeredgecolor`` which will be the same as the
+ ``edgecolor`` property in *props*.
+
+ interactive : bool, default: False
+ Whether to draw a set of handles that allow interaction with the
+ widget after it is drawn.
+
+ state_modifier_keys : dict, optional
+ Keyboard modifiers which affect the widget's behavior. Values
+ amend the defaults, which are:
+
+ - "move": Move the existing shape, default: no modifier.
+ - "clear": Clear the current shape, default: "escape".
+ - "square": Make the shape square, default: "shift".
+ - "center": change the shape around its center, default: "ctrl".
+ - "rotate": Rotate the shape around its center between -45° and 45°,
+ default: "r".
+
+ "square" and "center" can be combined. The square shape can be defined
+ in data or display coordinates as determined by the
+ ``use_data_coordinates`` argument specified when creating the selector.
+
+ drag_from_anywhere : bool, default: False
+ If `True`, the widget can be moved by clicking anywhere within
+ its bounds.
+
+ ignore_event_outside : bool, default: False
+ If `True`, the event triggered outside the span selector will be
+ ignored.
+
+ use_data_coordinates : bool, default: False
+ If `True`, the "square" shape of the selector is defined in
+ data coordinates instead of display coordinates.
+ """
+
+
+@_docstring.Substitution(_RECTANGLESELECTOR_PARAMETERS_DOCSTRING.replace(
+ '__ARTIST_NAME__', 'rectangle'))
+class RectangleSelector(_SelectorWidget):
+ """
+ Select a rectangular region of an Axes.
+
+ For the cursor to remain responsive you must keep a reference to it.
+
+ Press and release events triggered at the same coordinates outside the
+ selection will clear the selector, except when
+ ``ignore_event_outside=True``.
+
+ %s
+
+ Examples
+ --------
+ >>> import matplotlib.pyplot as plt
+ >>> import matplotlib.widgets as mwidgets
+ >>> fig, ax = plt.subplots()
+ >>> ax.plot([1, 2, 3], [10, 50, 100])
+ >>> def onselect(eclick, erelease):
+ ... print(eclick.xdata, eclick.ydata)
+ ... print(erelease.xdata, erelease.ydata)
+ >>> props = dict(facecolor='blue', alpha=0.5)
+ >>> rect = mwidgets.RectangleSelector(ax, onselect, interactive=True,
+ ... props=props)
+ >>> fig.show()
+ >>> rect.add_state('square')
+
+ See also: :doc:`/gallery/widgets/rectangle_selector`
+ """
+
+ def __init__(self, ax, onselect=None, *, minspanx=0,
+ minspany=0, useblit=False,
+ props=None, spancoords='data', button=None, grab_range=10,
+ handle_props=None, interactive=False,
+ state_modifier_keys=None, drag_from_anywhere=False,
+ ignore_event_outside=False, use_data_coordinates=False):
+ super().__init__(ax, onselect, useblit=useblit, button=button,
+ state_modifier_keys=state_modifier_keys,
+ use_data_coordinates=use_data_coordinates)
+
+ self._interactive = interactive
+ self.drag_from_anywhere = drag_from_anywhere
+ self.ignore_event_outside = ignore_event_outside
+ self._rotation = 0.0
+ self._aspect_ratio_correction = 1.0
+
+ # State to allow the option of an interactive selector that can't be
+ # interactively drawn. This is used in PolygonSelector as an
+ # interactive bounding box to allow the polygon to be easily resized
+ self._allow_creation = True
+
+ if props is None:
+ props = dict(facecolor='red', edgecolor='black',
+ alpha=0.2, fill=True)
+ props = {**props, 'animated': self.useblit}
+ self._visible = props.pop('visible', self._visible)
+ to_draw = self._init_shape(**props)
+ self.ax.add_patch(to_draw)
+
+ self._selection_artist = to_draw
+ self._set_aspect_ratio_correction()
+
+ self.minspanx = minspanx
+ self.minspany = minspany
+
+ _api.check_in_list(['data', 'pixels'], spancoords=spancoords)
+ self.spancoords = spancoords
+
+ self.grab_range = grab_range
+
+ if self._interactive:
+ self._handle_props = {
+ 'markeredgecolor': (props or {}).get('edgecolor', 'black'),
+ **cbook.normalize_kwargs(handle_props, Line2D)}
+
+ self._corner_order = ['SW', 'SE', 'NE', 'NW']
+ xc, yc = self.corners
+ self._corner_handles = ToolHandles(self.ax, xc, yc,
+ marker_props=self._handle_props,
+ useblit=self.useblit)
+
+ self._edge_order = ['W', 'S', 'E', 'N']
+ xe, ye = self.edge_centers
+ self._edge_handles = ToolHandles(self.ax, xe, ye, marker='s',
+ marker_props=self._handle_props,
+ useblit=self.useblit)
+
+ xc, yc = self.center
+ self._center_handle = ToolHandles(self.ax, [xc], [yc], marker='s',
+ marker_props=self._handle_props,
+ useblit=self.useblit)
+
+ self._active_handle = None
+
+ self._extents_on_press = None
+
+ @property
+ def _handles_artists(self):
+ return (*self._center_handle.artists, *self._corner_handles.artists,
+ *self._edge_handles.artists)
+
+ def _init_shape(self, **props):
+ return Rectangle((0, 0), 0, 1, visible=False,
+ rotation_point='center', **props)
+
+ def _press(self, event):
+ """Button press event handler."""
+ # make the drawn box/line visible get the click-coordinates, button, ...
+ if self._interactive and self._selection_artist.get_visible():
+ self._set_active_handle(event)
+ else:
+ self._active_handle = None
+
+ if ((self._active_handle is None or not self._interactive) and
+ self._allow_creation):
+ # Clear previous rectangle before drawing new rectangle.
+ self.update()
+
+ if (self._active_handle is None and not self.ignore_event_outside and
+ self._allow_creation):
+ x, y = self._get_data_coords(event)
+ self._visible = False
+ self.extents = x, x, y, y
+ self._visible = True
+ else:
+ self.set_visible(True)
+
+ self._extents_on_press = self.extents
+ self._rotation_on_press = self._rotation
+ self._set_aspect_ratio_correction()
+
+ return False
+
+ def _release(self, event):
+ """Button release event handler."""
+ if not self._interactive:
+ self._selection_artist.set_visible(False)
+
+ if (self._active_handle is None and self._selection_completed and
+ self.ignore_event_outside):
+ return
+
+ # update the eventpress and eventrelease with the resulting extents
+ x0, x1, y0, y1 = self.extents
+ self._eventpress.xdata = x0
+ self._eventpress.ydata = y0
+ xy0 = self.ax.transData.transform([x0, y0])
+ self._eventpress.x, self._eventpress.y = xy0
+
+ self._eventrelease.xdata = x1
+ self._eventrelease.ydata = y1
+ xy1 = self.ax.transData.transform([x1, y1])
+ self._eventrelease.x, self._eventrelease.y = xy1
+
+ # calculate dimensions of box or line
+ if self.spancoords == 'data':
+ spanx = abs(self._eventpress.xdata - self._eventrelease.xdata)
+ spany = abs(self._eventpress.ydata - self._eventrelease.ydata)
+ elif self.spancoords == 'pixels':
+ spanx = abs(self._eventpress.x - self._eventrelease.x)
+ spany = abs(self._eventpress.y - self._eventrelease.y)
+ else:
+ _api.check_in_list(['data', 'pixels'],
+ spancoords=self.spancoords)
+ # check if drawn distance (if it exists) is not too small in
+ # either x or y-direction
+ if spanx <= self.minspanx or spany <= self.minspany:
+ if self._selection_completed:
+ # Call onselect, only when the selection is already existing
+ self.onselect(self._eventpress, self._eventrelease)
+ self._clear_without_update()
+ else:
+ self.onselect(self._eventpress, self._eventrelease)
+ self._selection_completed = True
+
+ self.update()
+ self._active_handle = None
+ self._extents_on_press = None
+
+ return False
+
+ def _onmove(self, event):
+ """
+ Motion notify event handler.
+
+ This can do one of four things:
+ - Translate
+ - Rotate
+ - Re-size
+ - Continue the creation of a new shape
+ """
+ eventpress = self._eventpress
+ # The calculations are done for rotation at zero: we apply inverse
+ # transformation to events except when we rotate and move
+ state = self._state
+ rotate = 'rotate' in state and self._active_handle in self._corner_order
+ move = self._active_handle == 'C'
+ resize = self._active_handle and not move
+
+ xdata, ydata = self._get_data_coords(event)
+ if resize:
+ inv_tr = self._get_rotation_transform().inverted()
+ xdata, ydata = inv_tr.transform([xdata, ydata])
+ eventpress.xdata, eventpress.ydata = inv_tr.transform(
+ (eventpress.xdata, eventpress.ydata))
+
+ dx = xdata - eventpress.xdata
+ dy = ydata - eventpress.ydata
+ # refmax is used when moving the corner handle with the square state
+ # and is the maximum between refx and refy
+ refmax = None
+ if self._use_data_coordinates:
+ refx, refy = dx, dy
+ else:
+ # Get dx/dy in display coordinates
+ refx = event.x - eventpress.x
+ refy = event.y - eventpress.y
+
+ x0, x1, y0, y1 = self._extents_on_press
+ # rotate an existing shape
+ if rotate:
+ # calculate angle abc
+ a = (eventpress.xdata, eventpress.ydata)
+ b = self.center
+ c = (xdata, ydata)
+ angle = (np.arctan2(c[1]-b[1], c[0]-b[0]) -
+ np.arctan2(a[1]-b[1], a[0]-b[0]))
+ self.rotation = np.rad2deg(self._rotation_on_press + angle)
+
+ elif resize:
+ size_on_press = [x1 - x0, y1 - y0]
+ center = (x0 + size_on_press[0] / 2, y0 + size_on_press[1] / 2)
+
+ # Keeping the center fixed
+ if 'center' in state:
+ # hh, hw are half-height and half-width
+ if 'square' in state:
+ # when using a corner, find which reference to use
+ if self._active_handle in self._corner_order:
+ refmax = max(refx, refy, key=abs)
+ if self._active_handle in ['E', 'W'] or refmax == refx:
+ hw = xdata - center[0]
+ hh = hw / self._aspect_ratio_correction
+ else:
+ hh = ydata - center[1]
+ hw = hh * self._aspect_ratio_correction
+ else:
+ hw = size_on_press[0] / 2
+ hh = size_on_press[1] / 2
+ # cancel changes in perpendicular direction
+ if self._active_handle in ['E', 'W'] + self._corner_order:
+ hw = abs(xdata - center[0])
+ if self._active_handle in ['N', 'S'] + self._corner_order:
+ hh = abs(ydata - center[1])
+
+ x0, x1, y0, y1 = (center[0] - hw, center[0] + hw,
+ center[1] - hh, center[1] + hh)
+
+ else:
+ # change sign of relative changes to simplify calculation
+ # Switch variables so that x1 and/or y1 are updated on move
+ if 'W' in self._active_handle:
+ x0 = x1
+ if 'S' in self._active_handle:
+ y0 = y1
+ if self._active_handle in ['E', 'W'] + self._corner_order:
+ x1 = xdata
+ if self._active_handle in ['N', 'S'] + self._corner_order:
+ y1 = ydata
+ if 'square' in state:
+ # when using a corner, find which reference to use
+ if self._active_handle in self._corner_order:
+ refmax = max(refx, refy, key=abs)
+ if self._active_handle in ['E', 'W'] or refmax == refx:
+ sign = np.sign(ydata - y0)
+ y1 = y0 + sign * abs(x1 - x0) / self._aspect_ratio_correction
+ else:
+ sign = np.sign(xdata - x0)
+ x1 = x0 + sign * abs(y1 - y0) * self._aspect_ratio_correction
+
+ elif move:
+ x0, x1, y0, y1 = self._extents_on_press
+ dx = xdata - eventpress.xdata
+ dy = ydata - eventpress.ydata
+ x0 += dx
+ x1 += dx
+ y0 += dy
+ y1 += dy
+
+ else:
+ # Create a new shape
+ self._rotation = 0
+ # Don't create a new rectangle if there is already one when
+ # ignore_event_outside=True
+ if ((self.ignore_event_outside and self._selection_completed) or
+ not self._allow_creation):
+ return
+ center = [eventpress.xdata, eventpress.ydata]
+ dx = (xdata - center[0]) / 2
+ dy = (ydata - center[1]) / 2
+
+ # square shape
+ if 'square' in state:
+ refmax = max(refx, refy, key=abs)
+ if refmax == refx:
+ dy = np.sign(dy) * abs(dx) / self._aspect_ratio_correction
+ else:
+ dx = np.sign(dx) * abs(dy) * self._aspect_ratio_correction
+
+ # from center
+ if 'center' in state:
+ dx *= 2
+ dy *= 2
+
+ # from corner
+ else:
+ center[0] += dx
+ center[1] += dy
+
+ x0, x1, y0, y1 = (center[0] - dx, center[0] + dx,
+ center[1] - dy, center[1] + dy)
+
+ self.extents = x0, x1, y0, y1
+
+ @property
+ def _rect_bbox(self):
+ return self._selection_artist.get_bbox().bounds
+
+ def _set_aspect_ratio_correction(self):
+ aspect_ratio = self.ax._get_aspect_ratio()
+ self._selection_artist._aspect_ratio_correction = aspect_ratio
+ if self._use_data_coordinates:
+ self._aspect_ratio_correction = 1
+ else:
+ self._aspect_ratio_correction = aspect_ratio
+
+ def _get_rotation_transform(self):
+ aspect_ratio = self.ax._get_aspect_ratio()
+ return Affine2D().translate(-self.center[0], -self.center[1]) \
+ .scale(1, aspect_ratio) \
+ .rotate(self._rotation) \
+ .scale(1, 1 / aspect_ratio) \
+ .translate(*self.center)
+
+ @property
+ def corners(self):
+ """
+ Corners of rectangle in data coordinates from lower left,
+ moving clockwise.
+ """
+ x0, y0, width, height = self._rect_bbox
+ xc = x0, x0 + width, x0 + width, x0
+ yc = y0, y0, y0 + height, y0 + height
+ transform = self._get_rotation_transform()
+ coords = transform.transform(np.array([xc, yc]).T).T
+ return coords[0], coords[1]
+
+ @property
+ def edge_centers(self):
+ """
+ Midpoint of rectangle edges in data coordinates from left,
+ moving anti-clockwise.
+ """
+ x0, y0, width, height = self._rect_bbox
+ w = width / 2.
+ h = height / 2.
+ xe = x0, x0 + w, x0 + width, x0 + w
+ ye = y0 + h, y0, y0 + h, y0 + height
+ transform = self._get_rotation_transform()
+ coords = transform.transform(np.array([xe, ye]).T).T
+ return coords[0], coords[1]
+
+ @property
+ def center(self):
+ """Center of rectangle in data coordinates."""
+ x0, y0, width, height = self._rect_bbox
+ return x0 + width / 2., y0 + height / 2.
+
+ @property
+ def extents(self):
+ """
+ Return (xmin, xmax, ymin, ymax) in data coordinates as defined by the
+ bounding box before rotation.
+ """
+ x0, y0, width, height = self._rect_bbox
+ xmin, xmax = sorted([x0, x0 + width])
+ ymin, ymax = sorted([y0, y0 + height])
+ return xmin, xmax, ymin, ymax
+
+ @extents.setter
+ def extents(self, extents):
+ # Update displayed shape
+ self._draw_shape(extents)
+ if self._interactive:
+ # Update displayed handles
+ self._corner_handles.set_data(*self.corners)
+ self._edge_handles.set_data(*self.edge_centers)
+ x, y = self.center
+ self._center_handle.set_data([x], [y])
+ self.set_visible(self._visible)
+ self.update()
+
+ @property
+ def rotation(self):
+ """
+ Rotation in degree in interval [-45°, 45°]. The rotation is limited in
+ range to keep the implementation simple.
+ """
+ return np.rad2deg(self._rotation)
+
+ @rotation.setter
+ def rotation(self, value):
+ # Restrict to a limited range of rotation [-45°, 45°] to avoid changing
+ # order of handles
+ if -45 <= value and value <= 45:
+ self._rotation = np.deg2rad(value)
+ # call extents setter to draw shape and update handles positions
+ self.extents = self.extents
+
+ def _draw_shape(self, extents):
+ x0, x1, y0, y1 = extents
+ xmin, xmax = sorted([x0, x1])
+ ymin, ymax = sorted([y0, y1])
+ xlim = sorted(self.ax.get_xlim())
+ ylim = sorted(self.ax.get_ylim())
+
+ xmin = max(xlim[0], xmin)
+ ymin = max(ylim[0], ymin)
+ xmax = min(xmax, xlim[1])
+ ymax = min(ymax, ylim[1])
+
+ self._selection_artist.set_x(xmin)
+ self._selection_artist.set_y(ymin)
+ self._selection_artist.set_width(xmax - xmin)
+ self._selection_artist.set_height(ymax - ymin)
+ self._selection_artist.set_angle(self.rotation)
+
+ def _set_active_handle(self, event):
+ """Set active handle based on the location of the mouse event."""
+ # Note: event.xdata/ydata in data coordinates, event.x/y in pixels
+ c_idx, c_dist = self._corner_handles.closest(event.x, event.y)
+ e_idx, e_dist = self._edge_handles.closest(event.x, event.y)
+ m_idx, m_dist = self._center_handle.closest(event.x, event.y)
+
+ if 'move' in self._state:
+ self._active_handle = 'C'
+ # Set active handle as closest handle, if mouse click is close enough.
+ elif m_dist < self.grab_range * 2:
+ # Prioritise center handle over other handles
+ self._active_handle = 'C'
+ elif c_dist > self.grab_range and e_dist > self.grab_range:
+ # Not close to any handles
+ if self.drag_from_anywhere and self._contains(event):
+ # Check if we've clicked inside the region
+ self._active_handle = 'C'
+ else:
+ self._active_handle = None
+ return
+ elif c_dist < e_dist:
+ # Closest to a corner handle
+ self._active_handle = self._corner_order[c_idx]
+ else:
+ # Closest to an edge handle
+ self._active_handle = self._edge_order[e_idx]
+
+ def _contains(self, event):
+ """Return True if event is within the patch."""
+ return self._selection_artist.contains(event, radius=0)[0]
+
+ @property
+ def geometry(self):
+ """
+ Return an array of shape (2, 5) containing the
+ x (``RectangleSelector.geometry[1, :]``) and
+ y (``RectangleSelector.geometry[0, :]``) data coordinates of the four
+ corners of the rectangle starting and ending in the top left corner.
+ """
+ if hasattr(self._selection_artist, 'get_verts'):
+ xfm = self.ax.transData.inverted()
+ y, x = xfm.transform(self._selection_artist.get_verts()).T
+ return np.array([x, y])
+ else:
+ return np.array(self._selection_artist.get_data())
+
+
+@_docstring.Substitution(_RECTANGLESELECTOR_PARAMETERS_DOCSTRING.replace(
+ '__ARTIST_NAME__', 'ellipse'))
+class EllipseSelector(RectangleSelector):
+ """
+ Select an elliptical region of an Axes.
+
+ For the cursor to remain responsive you must keep a reference to it.
+
+ Press and release events triggered at the same coordinates outside the
+ selection will clear the selector, except when
+ ``ignore_event_outside=True``.
+
+ %s
+
+ Examples
+ --------
+ :doc:`/gallery/widgets/rectangle_selector`
+ """
+ def _init_shape(self, **props):
+ return Ellipse((0, 0), 0, 1, visible=False, **props)
+
+ def _draw_shape(self, extents):
+ x0, x1, y0, y1 = extents
+ xmin, xmax = sorted([x0, x1])
+ ymin, ymax = sorted([y0, y1])
+ center = [x0 + (x1 - x0) / 2., y0 + (y1 - y0) / 2.]
+ a = (xmax - xmin) / 2.
+ b = (ymax - ymin) / 2.
+
+ self._selection_artist.center = center
+ self._selection_artist.width = 2 * a
+ self._selection_artist.height = 2 * b
+ self._selection_artist.angle = self.rotation
+
+ @property
+ def _rect_bbox(self):
+ x, y = self._selection_artist.center
+ width = self._selection_artist.width
+ height = self._selection_artist.height
+ return x - width / 2., y - height / 2., width, height
+
+
+class LassoSelector(_SelectorWidget):
+ """
+ Selection curve of an arbitrary shape.
+
+ For the selector to remain responsive you must keep a reference to it.
+
+ The selected path can be used in conjunction with `~.Path.contains_point`
+ to select data points from an image.
+
+ In contrast to `Lasso`, `LassoSelector` is written with an interface
+ similar to `RectangleSelector` and `SpanSelector`, and will continue to
+ interact with the Axes until disconnected.
+
+ Example usage::
+
+ ax = plt.subplot()
+ ax.plot(x, y)
+
+ def onselect(verts):
+ print(verts)
+ lasso = LassoSelector(ax, onselect)
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+ onselect : function, optional
+ Whenever the lasso is released, the *onselect* function is called and
+ passed the vertices of the selected path.
+ useblit : bool, default: True
+ Whether to use blitting for faster drawing (if supported by the
+ backend). See the tutorial :ref:`blitting`
+ for details.
+ props : dict, optional
+ Properties with which the line is drawn, see `.Line2D`
+ for valid properties. Default values are defined in ``mpl.rcParams``.
+ button : `.MouseButton` or list of `.MouseButton`, optional
+ The mouse buttons used for rectangle selection. Default is ``None``,
+ which corresponds to all buttons.
+ """
+
+ def __init__(self, ax, onselect=None, *, useblit=True, props=None, button=None):
+ super().__init__(ax, onselect, useblit=useblit, button=button)
+ self.verts = None
+ props = {
+ **(props if props is not None else {}),
+ # Note that self.useblit may be != useblit, if the canvas doesn't
+ # support blitting.
+ 'animated': self.useblit, 'visible': False,
+ }
+ line = Line2D([], [], **props)
+ self.ax.add_line(line)
+ self._selection_artist = line
+
+ def _press(self, event):
+ self.verts = [self._get_data(event)]
+ self._selection_artist.set_visible(True)
+
+ def _release(self, event):
+ if self.verts is not None:
+ self.verts.append(self._get_data(event))
+ self.onselect(self.verts)
+ self._selection_artist.set_data([[], []])
+ self._selection_artist.set_visible(False)
+ self.verts = None
+
+ def _onmove(self, event):
+ if self.verts is None:
+ return
+ self.verts.append(self._get_data(event))
+ self._selection_artist.set_data(list(zip(*self.verts)))
+
+ self.update()
+
+
+class PolygonSelector(_SelectorWidget):
+ """
+ Select a polygon region of an Axes.
+
+ Place vertices with each mouse click, and make the selection by completing
+ the polygon (clicking on the first vertex). Once drawn individual vertices
+ can be moved by clicking and dragging with the left mouse button, or
+ removed by clicking the right mouse button.
+
+ In addition, the following modifier keys can be used:
+
+ - Hold *ctrl* and click and drag a vertex to reposition it before the
+ polygon has been completed.
+ - Hold the *shift* key and click and drag anywhere in the Axes to move
+ all vertices.
+ - Press the *esc* key to start a new polygon.
+
+ For the selector to remain responsive you must keep a reference to it.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+
+ onselect : function, optional
+ When a polygon is completed or modified after completion,
+ the *onselect* function is called and passed a list of the vertices as
+ ``(xdata, ydata)`` tuples.
+
+ useblit : bool, default: False
+ Whether to use blitting for faster drawing (if supported by the
+ backend). See the tutorial :ref:`blitting`
+ for details.
+
+ props : dict, optional
+ Properties with which the line is drawn, see `.Line2D` for valid properties.
+ Default::
+
+ dict(color='k', linestyle='-', linewidth=2, alpha=0.5)
+
+ handle_props : dict, optional
+ Artist properties for the markers drawn at the vertices of the polygon.
+ See the marker arguments in `.Line2D` for valid
+ properties. Default values are defined in ``mpl.rcParams`` except for
+ the default value of ``markeredgecolor`` which will be the same as the
+ ``color`` property in *props*.
+
+ grab_range : float, default: 10
+ A vertex is selected (to complete the polygon or to move a vertex) if
+ the mouse click is within *grab_range* pixels of the vertex.
+
+ draw_bounding_box : bool, optional
+ If `True`, a bounding box will be drawn around the polygon selector
+ once it is complete. This box can be used to move and resize the
+ selector.
+
+ box_handle_props : dict, optional
+ Properties to set for the box handles. See the documentation for the
+ *handle_props* argument to `RectangleSelector` for more info.
+
+ box_props : dict, optional
+ Properties to set for the box. See the documentation for the *props*
+ argument to `RectangleSelector` for more info.
+
+ Examples
+ --------
+ :doc:`/gallery/widgets/polygon_selector_simple`
+ :doc:`/gallery/widgets/polygon_selector_demo`
+
+ Notes
+ -----
+ If only one point remains after removing points, the selector reverts to an
+ incomplete state and you can start drawing a new polygon from the existing
+ point.
+ """
+
+ def __init__(self, ax, onselect=None, *, useblit=False,
+ props=None, handle_props=None, grab_range=10,
+ draw_bounding_box=False, box_handle_props=None,
+ box_props=None):
+ # The state modifiers 'move', 'square', and 'center' are expected by
+ # _SelectorWidget but are not supported by PolygonSelector
+ # Note: could not use the existing 'move' state modifier in-place of
+ # 'move_all' because _SelectorWidget automatically discards 'move'
+ # from the state on button release.
+ state_modifier_keys = dict(clear='escape', move_vertex='control',
+ move_all='shift', move='not-applicable',
+ square='not-applicable',
+ center='not-applicable',
+ rotate='not-applicable')
+ super().__init__(ax, onselect, useblit=useblit,
+ state_modifier_keys=state_modifier_keys)
+
+ self._xys = [(0, 0)]
+
+ if props is None:
+ props = dict(color='k', linestyle='-', linewidth=2, alpha=0.5)
+ props = {**props, 'animated': self.useblit}
+ self._selection_artist = line = Line2D([], [], **props)
+ self.ax.add_line(line)
+
+ if handle_props is None:
+ handle_props = dict(markeredgecolor='k',
+ markerfacecolor=props.get('color', 'k'))
+ self._handle_props = handle_props
+ self._polygon_handles = ToolHandles(self.ax, [], [],
+ useblit=self.useblit,
+ marker_props=self._handle_props)
+
+ self._active_handle_idx = -1
+ self.grab_range = grab_range
+
+ self.set_visible(True)
+ self._draw_box = draw_bounding_box
+ self._box = None
+
+ if box_handle_props is None:
+ box_handle_props = {}
+ self._box_handle_props = self._handle_props.update(box_handle_props)
+ self._box_props = box_props
+
+ def _get_bbox(self):
+ return self._selection_artist.get_bbox()
+
+ def _add_box(self):
+ self._box = RectangleSelector(self.ax,
+ useblit=self.useblit,
+ grab_range=self.grab_range,
+ handle_props=self._box_handle_props,
+ props=self._box_props,
+ interactive=True)
+ self._box._state_modifier_keys.pop('rotate')
+ self._box.connect_event('motion_notify_event', self._scale_polygon)
+ self._update_box()
+ # Set state that prevents the RectangleSelector from being created
+ # by the user
+ self._box._allow_creation = False
+ self._box._selection_completed = True
+ self._draw_polygon()
+
+ def _remove_box(self):
+ if self._box is not None:
+ self._box.set_visible(False)
+ self._box = None
+
+ def _update_box(self):
+ # Update selection box extents to the extents of the polygon
+ if self._box is not None:
+ bbox = self._get_bbox()
+ self._box.extents = [bbox.x0, bbox.x1, bbox.y0, bbox.y1]
+ # Save a copy
+ self._old_box_extents = self._box.extents
+
+ def _scale_polygon(self, event):
+ """
+ Scale the polygon selector points when the bounding box is moved or
+ scaled.
+
+ This is set as a callback on the bounding box RectangleSelector.
+ """
+ if not self._selection_completed:
+ return
+
+ if self._old_box_extents == self._box.extents:
+ return
+
+ # Create transform from old box to new box
+ x1, y1, w1, h1 = self._box._rect_bbox
+ old_bbox = self._get_bbox()
+ t = (transforms.Affine2D()
+ .translate(-old_bbox.x0, -old_bbox.y0)
+ .scale(1 / old_bbox.width, 1 / old_bbox.height)
+ .scale(w1, h1)
+ .translate(x1, y1))
+
+ # Update polygon verts. Must be a list of tuples for consistency.
+ new_verts = [(x, y) for x, y in t.transform(np.array(self.verts))]
+ self._xys = [*new_verts, new_verts[0]]
+ self._draw_polygon()
+ self._old_box_extents = self._box.extents
+
+ @property
+ def _handles_artists(self):
+ return self._polygon_handles.artists
+
+ def _remove_vertex(self, i):
+ """Remove vertex with index i."""
+ if (len(self._xys) > 2 and
+ self._selection_completed and
+ i in (0, len(self._xys) - 1)):
+ # If selecting the first or final vertex, remove both first and
+ # last vertex as they are the same for a closed polygon
+ self._xys.pop(0)
+ self._xys.pop(-1)
+ # Close the polygon again by appending the new first vertex to the
+ # end
+ self._xys.append(self._xys[0])
+ else:
+ self._xys.pop(i)
+ if len(self._xys) <= 2:
+ # If only one point left, return to incomplete state to let user
+ # start drawing again
+ self._selection_completed = False
+ self._remove_box()
+
+ def _press(self, event):
+ """Button press event handler."""
+ # Check for selection of a tool handle.
+ if ((self._selection_completed or 'move_vertex' in self._state)
+ and len(self._xys) > 0):
+ h_idx, h_dist = self._polygon_handles.closest(event.x, event.y)
+ if h_dist < self.grab_range:
+ self._active_handle_idx = h_idx
+ # Save the vertex positions at the time of the press event (needed to
+ # support the 'move_all' state modifier).
+ self._xys_at_press = self._xys.copy()
+
+ def _release(self, event):
+ """Button release event handler."""
+ # Release active tool handle.
+ if self._active_handle_idx >= 0:
+ if event.button == 3:
+ self._remove_vertex(self._active_handle_idx)
+ self._draw_polygon()
+ self._active_handle_idx = -1
+
+ # Complete the polygon.
+ elif len(self._xys) > 3 and self._xys[-1] == self._xys[0]:
+ self._selection_completed = True
+ if self._draw_box and self._box is None:
+ self._add_box()
+
+ # Place new vertex.
+ elif (not self._selection_completed
+ and 'move_all' not in self._state
+ and 'move_vertex' not in self._state):
+ self._xys.insert(-1, self._get_data_coords(event))
+
+ if self._selection_completed:
+ self.onselect(self.verts)
+
+ def onmove(self, event):
+ """Cursor move event handler and validator."""
+ # Method overrides _SelectorWidget.onmove because the polygon selector
+ # needs to process the move callback even if there is no button press.
+ # _SelectorWidget.onmove include logic to ignore move event if
+ # _eventpress is None.
+ if self.ignore(event):
+ # Hide the cursor when interactive zoom/pan is active
+ if not self.canvas.widgetlock.available(self) and self._xys:
+ self._xys[-1] = (np.nan, np.nan)
+ self._draw_polygon()
+ return False
+
+ else:
+ event = self._clean_event(event)
+ self._onmove(event)
+ return True
+
+ def _onmove(self, event):
+ """Cursor move event handler."""
+ # Move the active vertex (ToolHandle).
+ if self._active_handle_idx >= 0:
+ idx = self._active_handle_idx
+ self._xys[idx] = self._get_data_coords(event)
+ # Also update the end of the polygon line if the first vertex is
+ # the active handle and the polygon is completed.
+ if idx == 0 and self._selection_completed:
+ self._xys[-1] = self._get_data_coords(event)
+
+ # Move all vertices.
+ elif 'move_all' in self._state and self._eventpress:
+ xdata, ydata = self._get_data_coords(event)
+ dx = xdata - self._eventpress.xdata
+ dy = ydata - self._eventpress.ydata
+ for k in range(len(self._xys)):
+ x_at_press, y_at_press = self._xys_at_press[k]
+ self._xys[k] = x_at_press + dx, y_at_press + dy
+
+ # Do nothing if completed or waiting for a move.
+ elif (self._selection_completed
+ or 'move_vertex' in self._state or 'move_all' in self._state):
+ return
+
+ # Position pending vertex.
+ else:
+ # Calculate distance to the start vertex.
+ x0, y0 = \
+ self._selection_artist.get_transform().transform(self._xys[0])
+ v0_dist = np.hypot(x0 - event.x, y0 - event.y)
+ # Lock on to the start vertex if near it and ready to complete.
+ if len(self._xys) > 3 and v0_dist < self.grab_range:
+ self._xys[-1] = self._xys[0]
+ else:
+ self._xys[-1] = self._get_data_coords(event)
+
+ self._draw_polygon()
+
+ def _on_key_press(self, event):
+ """Key press event handler."""
+ # Remove the pending vertex if entering the 'move_vertex' or
+ # 'move_all' mode
+ if (not self._selection_completed
+ and ('move_vertex' in self._state or
+ 'move_all' in self._state)):
+ self._xys.pop()
+ self._draw_polygon()
+
+ def _on_key_release(self, event):
+ """Key release event handler."""
+ # Add back the pending vertex if leaving the 'move_vertex' or
+ # 'move_all' mode (by checking the released key)
+ if (not self._selection_completed
+ and
+ (event.key == self._state_modifier_keys.get('move_vertex')
+ or event.key == self._state_modifier_keys.get('move_all'))):
+ self._xys.append(self._get_data_coords(event))
+ self._draw_polygon()
+ # Reset the polygon if the released key is the 'clear' key.
+ elif event.key == self._state_modifier_keys.get('clear'):
+ event = self._clean_event(event)
+ self._xys = [self._get_data_coords(event)]
+ self._selection_completed = False
+ self._remove_box()
+ self.set_visible(True)
+
+ def _draw_polygon_without_update(self):
+ """Redraw the polygon based on new vertex positions, no update()."""
+ xs, ys = zip(*self._xys) if self._xys else ([], [])
+ self._selection_artist.set_data(xs, ys)
+ self._update_box()
+ # Only show one tool handle at the start and end vertex of the polygon
+ # if the polygon is completed or the user is locked on to the start
+ # vertex.
+ if (self._selection_completed
+ or (len(self._xys) > 3
+ and self._xys[-1] == self._xys[0])):
+ self._polygon_handles.set_data(xs[:-1], ys[:-1])
+ else:
+ self._polygon_handles.set_data(xs, ys)
+
+ def _draw_polygon(self):
+ """Redraw the polygon based on the new vertex positions."""
+ self._draw_polygon_without_update()
+ self.update()
+
+ @property
+ def verts(self):
+ """The polygon vertices, as a list of ``(x, y)`` pairs."""
+ return self._xys[:-1]
+
+ @verts.setter
+ def verts(self, xys):
+ """
+ Set the polygon vertices.
+
+ This will remove any preexisting vertices, creating a complete polygon
+ with the new vertices.
+ """
+ self._xys = [*xys, xys[0]]
+ self._selection_completed = True
+ self.set_visible(True)
+ if self._draw_box and self._box is None:
+ self._add_box()
+ self._draw_polygon()
+
+ def _clear_without_update(self):
+ self._selection_completed = False
+ self._xys = [(0, 0)]
+ self._draw_polygon_without_update()
+
+
+class Lasso(AxesWidget):
+ """
+ Selection curve of an arbitrary shape.
+
+ The selected path can be used in conjunction with
+ `~matplotlib.path.Path.contains_point` to select data points from an image.
+
+ Unlike `LassoSelector`, this must be initialized with a starting
+ point *xy*, and the `Lasso` events are destroyed upon release.
+
+ Parameters
+ ----------
+ ax : `~matplotlib.axes.Axes`
+ The parent Axes for the widget.
+ xy : (float, float)
+ Coordinates of the start of the lasso.
+ callback : callable
+ Whenever the lasso is released, the *callback* function is called and
+ passed the vertices of the selected path.
+ useblit : bool, default: True
+ Whether to use blitting for faster drawing (if supported by the
+ backend). See the tutorial :ref:`blitting`
+ for details.
+ props: dict, optional
+ Lasso line properties. See `.Line2D` for valid properties.
+ Default *props* are::
+
+ {'linestyle' : '-', 'color' : 'black', 'lw' : 2}
+
+ .. versionadded:: 3.9
+ """
+ def __init__(self, ax, xy, callback, *, useblit=True, props=None):
+ super().__init__(ax)
+
+ self.useblit = useblit and self.canvas.supports_blit
+ if self.useblit:
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+
+ style = {'linestyle': '-', 'color': 'black', 'lw': 2}
+
+ if props is not None:
+ style.update(props)
+
+ x, y = xy
+ self.verts = [(x, y)]
+ self.line = Line2D([x], [y], **style)
+ self.ax.add_line(self.line)
+ self.callback = callback
+ self.connect_event('button_release_event', self.onrelease)
+ self.connect_event('motion_notify_event', self.onmove)
+
+ def onrelease(self, event):
+ if self.ignore(event):
+ return
+ if self.verts is not None:
+ self.verts.append(self._get_data_coords(event))
+ if len(self.verts) > 2:
+ self.callback(self.verts)
+ self.line.remove()
+ self.verts = None
+ self.disconnect_events()
+
+ def onmove(self, event):
+ if (self.ignore(event)
+ or self.verts is None
+ or event.button != 1
+ or not self.ax.contains(event)[0]):
+ return
+ self.verts.append(self._get_data_coords(event))
+ self.line.set_data(list(zip(*self.verts)))
+
+ if self.useblit:
+ self.canvas.restore_region(self.background)
+ self.ax.draw_artist(self.line)
+ self.canvas.blit(self.ax.bbox)
+ else:
+ self.canvas.draw_idle()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/widgets.pyi b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/widgets.pyi
new file mode 100644
index 0000000000000000000000000000000000000000..0fcd1990e17e0a005532522de33bb27cf1d05d17
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/matplotlib/widgets.pyi
@@ -0,0 +1,488 @@
+from .artist import Artist
+from .axes import Axes
+from .backend_bases import FigureCanvasBase, Event, MouseEvent, MouseButton
+from .collections import LineCollection
+from .figure import Figure
+from .lines import Line2D
+from .patches import Polygon, Rectangle
+from .text import Text
+
+import PIL.Image
+
+from collections.abc import Callable, Collection, Iterable, Sequence
+from typing import Any, Literal
+from numpy.typing import ArrayLike
+from .typing import ColorType
+import numpy as np
+
+class LockDraw:
+ def __init__(self) -> None: ...
+ def __call__(self, o: Any) -> None: ...
+ def release(self, o: Any) -> None: ...
+ def available(self, o: Any) -> bool: ...
+ def isowner(self, o: Any) -> bool: ...
+ def locked(self) -> bool: ...
+
+class Widget:
+ drawon: bool
+ eventson: bool
+ active: bool
+ def set_active(self, active: bool) -> None: ...
+ def get_active(self) -> None: ...
+ def ignore(self, event) -> bool: ...
+
+class AxesWidget(Widget):
+ ax: Axes
+ def __init__(self, ax: Axes) -> None: ...
+ @property
+ def canvas(self) -> FigureCanvasBase | None: ...
+ def connect_event(self, event: Event, callback: Callable) -> None: ...
+ def disconnect_events(self) -> None: ...
+
+class Button(AxesWidget):
+ label: Text
+ color: ColorType
+ hovercolor: ColorType
+ def __init__(
+ self,
+ ax: Axes,
+ label: str,
+ image: ArrayLike | PIL.Image.Image | None = ...,
+ color: ColorType = ...,
+ hovercolor: ColorType = ...,
+ *,
+ useblit: bool = ...
+ ) -> None: ...
+ def on_clicked(self, func: Callable[[Event], Any]) -> int: ...
+ def disconnect(self, cid: int) -> None: ...
+
+class SliderBase(AxesWidget):
+ orientation: Literal["horizontal", "vertical"]
+ closedmin: bool
+ closedmax: bool
+ valmin: float
+ valmax: float
+ valstep: float | ArrayLike | None
+ drag_active: bool
+ valfmt: str
+ def __init__(
+ self,
+ ax: Axes,
+ orientation: Literal["horizontal", "vertical"],
+ closedmin: bool,
+ closedmax: bool,
+ valmin: float,
+ valmax: float,
+ valfmt: str,
+ dragging: Slider | None,
+ valstep: float | ArrayLike | None,
+ ) -> None: ...
+ def disconnect(self, cid: int) -> None: ...
+ def reset(self) -> None: ...
+
+class Slider(SliderBase):
+ slidermin: Slider | None
+ slidermax: Slider | None
+ val: float
+ valinit: float
+ track: Rectangle
+ poly: Polygon
+ hline: Line2D
+ vline: Line2D
+ label: Text
+ valtext: Text
+ def __init__(
+ self,
+ ax: Axes,
+ label: str,
+ valmin: float,
+ valmax: float,
+ *,
+ valinit: float = ...,
+ valfmt: str | None = ...,
+ closedmin: bool = ...,
+ closedmax: bool = ...,
+ slidermin: Slider | None = ...,
+ slidermax: Slider | None = ...,
+ dragging: bool = ...,
+ valstep: float | ArrayLike | None = ...,
+ orientation: Literal["horizontal", "vertical"] = ...,
+ initcolor: ColorType = ...,
+ track_color: ColorType = ...,
+ handle_style: dict[str, Any] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def set_val(self, val: float) -> None: ...
+ def on_changed(self, func: Callable[[float], Any]) -> int: ...
+
+class RangeSlider(SliderBase):
+ val: tuple[float, float]
+ valinit: tuple[float, float]
+ track: Rectangle
+ poly: Polygon
+ label: Text
+ valtext: Text
+ def __init__(
+ self,
+ ax: Axes,
+ label: str,
+ valmin: float,
+ valmax: float,
+ *,
+ valinit: tuple[float, float] | None = ...,
+ valfmt: str | None = ...,
+ closedmin: bool = ...,
+ closedmax: bool = ...,
+ dragging: bool = ...,
+ valstep: float | ArrayLike | None = ...,
+ orientation: Literal["horizontal", "vertical"] = ...,
+ track_color: ColorType = ...,
+ handle_style: dict[str, Any] | None = ...,
+ **kwargs
+ ) -> None: ...
+ def set_min(self, min: float) -> None: ...
+ def set_max(self, max: float) -> None: ...
+ def set_val(self, val: ArrayLike) -> None: ...
+ def on_changed(self, func: Callable[[tuple[float, float]], Any]) -> int: ...
+
+class CheckButtons(AxesWidget):
+ labels: list[Text]
+ def __init__(
+ self,
+ ax: Axes,
+ labels: Sequence[str],
+ actives: Iterable[bool] | None = ...,
+ *,
+ useblit: bool = ...,
+ label_props: dict[str, Any] | None = ...,
+ frame_props: dict[str, Any] | None = ...,
+ check_props: dict[str, Any] | None = ...,
+ ) -> None: ...
+ def set_label_props(self, props: dict[str, Any]) -> None: ...
+ def set_frame_props(self, props: dict[str, Any]) -> None: ...
+ def set_check_props(self, props: dict[str, Any]) -> None: ...
+ def set_active(self, index: int, state: bool | None = ...) -> None: ... # type: ignore[override]
+ def clear(self) -> None: ...
+ def get_status(self) -> list[bool]: ...
+ def get_checked_labels(self) -> list[str]: ...
+ def on_clicked(self, func: Callable[[str | None], Any]) -> int: ...
+ def disconnect(self, cid: int) -> None: ...
+
+class TextBox(AxesWidget):
+ label: Text
+ text_disp: Text
+ cursor_index: int
+ cursor: LineCollection
+ color: ColorType
+ hovercolor: ColorType
+ capturekeystrokes: bool
+ def __init__(
+ self,
+ ax: Axes,
+ label: str,
+ initial: str = ...,
+ *,
+ color: ColorType = ...,
+ hovercolor: ColorType = ...,
+ label_pad: float = ...,
+ textalignment: Literal["left", "center", "right"] = ...,
+ ) -> None: ...
+ @property
+ def text(self) -> str: ...
+ def set_val(self, val: str) -> None: ...
+ def begin_typing(self) -> None: ...
+ def stop_typing(self) -> None: ...
+ def on_text_change(self, func: Callable[[str], Any]) -> int: ...
+ def on_submit(self, func: Callable[[str], Any]) -> int: ...
+ def disconnect(self, cid: int) -> None: ...
+
+class RadioButtons(AxesWidget):
+ activecolor: ColorType
+ value_selected: str
+ labels: list[Text]
+ def __init__(
+ self,
+ ax: Axes,
+ labels: Iterable[str],
+ active: int = ...,
+ activecolor: ColorType | None = ...,
+ *,
+ useblit: bool = ...,
+ label_props: dict[str, Any] | Sequence[dict[str, Any]] | None = ...,
+ radio_props: dict[str, Any] | None = ...,
+ ) -> None: ...
+ def set_label_props(self, props: dict[str, Any]) -> None: ...
+ def set_radio_props(self, props: dict[str, Any]) -> None: ...
+ def set_active(self, index: int) -> None: ...
+ def clear(self) -> None: ...
+ def on_clicked(self, func: Callable[[str | None], Any]) -> int: ...
+ def disconnect(self, cid: int) -> None: ...
+
+class SubplotTool(Widget):
+ figure: Figure
+ targetfig: Figure
+ buttonreset: Button
+ def __init__(self, targetfig: Figure, toolfig: Figure) -> None: ...
+
+class Cursor(AxesWidget):
+ visible: bool
+ horizOn: bool
+ vertOn: bool
+ useblit: bool
+ lineh: Line2D
+ linev: Line2D
+ background: Any
+ needclear: bool
+ def __init__(
+ self,
+ ax: Axes,
+ *,
+ horizOn: bool = ...,
+ vertOn: bool = ...,
+ useblit: bool = ...,
+ **lineprops
+ ) -> None: ...
+ def clear(self, event: Event) -> None: ...
+ def onmove(self, event: Event) -> None: ...
+
+class MultiCursor(Widget):
+ axes: Sequence[Axes]
+ horizOn: bool
+ vertOn: bool
+ visible: bool
+ useblit: bool
+ vlines: list[Line2D]
+ hlines: list[Line2D]
+ def __init__(
+ self,
+ canvas: Any,
+ axes: Sequence[Axes],
+ *,
+ useblit: bool = ...,
+ horizOn: bool = ...,
+ vertOn: bool = ...,
+ **lineprops
+ ) -> None: ...
+ def connect(self) -> None: ...
+ def disconnect(self) -> None: ...
+ def clear(self, event: Event) -> None: ...
+ def onmove(self, event: Event) -> None: ...
+
+class _SelectorWidget(AxesWidget):
+ onselect: Callable[[float, float], Any]
+ useblit: bool
+ background: Any
+ validButtons: list[MouseButton]
+ def __init__(
+ self,
+ ax: Axes,
+ onselect: Callable[[float, float], Any] | None = ...,
+ useblit: bool = ...,
+ button: MouseButton | Collection[MouseButton] | None = ...,
+ state_modifier_keys: dict[str, str] | None = ...,
+ use_data_coordinates: bool = ...,
+ ) -> None: ...
+ def update_background(self, event: Event) -> None: ...
+ def connect_default_events(self) -> None: ...
+ def ignore(self, event: Event) -> bool: ...
+ def update(self) -> None: ...
+ def press(self, event: Event) -> bool: ...
+ def release(self, event: Event) -> bool: ...
+ def onmove(self, event: Event) -> bool: ...
+ def on_scroll(self, event: Event) -> None: ...
+ def on_key_press(self, event: Event) -> None: ...
+ def on_key_release(self, event: Event) -> None: ...
+ def set_visible(self, visible: bool) -> None: ...
+ def get_visible(self) -> bool: ...
+ def clear(self) -> None: ...
+ @property
+ def artists(self) -> tuple[Artist]: ...
+ def set_props(self, **props) -> None: ...
+ def set_handle_props(self, **handle_props) -> None: ...
+ def add_state(self, state: str) -> None: ...
+ def remove_state(self, state: str) -> None: ...
+
+class SpanSelector(_SelectorWidget):
+ snap_values: ArrayLike | None
+ onmove_callback: Callable[[float, float], Any]
+ minspan: float
+ grab_range: float
+ drag_from_anywhere: bool
+ ignore_event_outside: bool
+ def __init__(
+ self,
+ ax: Axes,
+ onselect: Callable[[float, float], Any],
+ direction: Literal["horizontal", "vertical"],
+ *,
+ minspan: float = ...,
+ useblit: bool = ...,
+ props: dict[str, Any] | None = ...,
+ onmove_callback: Callable[[float, float], Any] | None = ...,
+ interactive: bool = ...,
+ button: MouseButton | Collection[MouseButton] | None = ...,
+ handle_props: dict[str, Any] | None = ...,
+ grab_range: float = ...,
+ state_modifier_keys: dict[str, str] | None = ...,
+ drag_from_anywhere: bool = ...,
+ ignore_event_outside: bool = ...,
+ snap_values: ArrayLike | None = ...,
+ ) -> None: ...
+ def new_axes(
+ self,
+ ax: Axes,
+ *,
+ _props: dict[str, Any] | None = ...,
+ _init: bool = ...,
+ ) -> None: ...
+ def connect_default_events(self) -> None: ...
+ @property
+ def direction(self) -> Literal["horizontal", "vertical"]: ...
+ @direction.setter
+ def direction(self, direction: Literal["horizontal", "vertical"]) -> None: ...
+ @property
+ def extents(self) -> tuple[float, float]: ...
+ @extents.setter
+ def extents(self, extents: tuple[float, float]) -> None: ...
+
+class ToolLineHandles:
+ ax: Axes
+ def __init__(
+ self,
+ ax: Axes,
+ positions: ArrayLike,
+ direction: Literal["horizontal", "vertical"],
+ *,
+ line_props: dict[str, Any] | None = ...,
+ useblit: bool = ...,
+ ) -> None: ...
+ @property
+ def artists(self) -> tuple[Line2D]: ...
+ @property
+ def positions(self) -> list[float]: ...
+ @property
+ def direction(self) -> Literal["horizontal", "vertical"]: ...
+ def set_data(self, positions: ArrayLike) -> None: ...
+ def set_visible(self, value: bool) -> None: ...
+ def set_animated(self, value: bool) -> None: ...
+ def remove(self) -> None: ...
+ def closest(self, x: float, y: float) -> tuple[int, float]: ...
+
+class ToolHandles:
+ ax: Axes
+ def __init__(
+ self,
+ ax: Axes,
+ x: ArrayLike,
+ y: ArrayLike,
+ *,
+ marker: str = ...,
+ marker_props: dict[str, Any] | None = ...,
+ useblit: bool = ...,
+ ) -> None: ...
+ @property
+ def x(self) -> ArrayLike: ...
+ @property
+ def y(self) -> ArrayLike: ...
+ @property
+ def artists(self) -> tuple[Line2D]: ...
+ def set_data(self, pts: ArrayLike, y: ArrayLike | None = ...) -> None: ...
+ def set_visible(self, val: bool) -> None: ...
+ def set_animated(self, val: bool) -> None: ...
+ def closest(self, x: float, y: float) -> tuple[int, float]: ...
+
+class RectangleSelector(_SelectorWidget):
+ drag_from_anywhere: bool
+ ignore_event_outside: bool
+ minspanx: float
+ minspany: float
+ spancoords: Literal["data", "pixels"]
+ grab_range: float
+ def __init__(
+ self,
+ ax: Axes,
+ onselect: Callable[[MouseEvent, MouseEvent], Any] | None = ...,
+ *,
+ minspanx: float = ...,
+ minspany: float = ...,
+ useblit: bool = ...,
+ props: dict[str, Any] | None = ...,
+ spancoords: Literal["data", "pixels"] = ...,
+ button: MouseButton | Collection[MouseButton] | None = ...,
+ grab_range: float = ...,
+ handle_props: dict[str, Any] | None = ...,
+ interactive: bool = ...,
+ state_modifier_keys: dict[str, str] | None = ...,
+ drag_from_anywhere: bool = ...,
+ ignore_event_outside: bool = ...,
+ use_data_coordinates: bool = ...,
+ ) -> None: ...
+ @property
+ def corners(self) -> tuple[np.ndarray, np.ndarray]: ...
+ @property
+ def edge_centers(self) -> tuple[np.ndarray, np.ndarray]: ...
+ @property
+ def center(self) -> tuple[float, float]: ...
+ @property
+ def extents(self) -> tuple[float, float, float, float]: ...
+ @extents.setter
+ def extents(self, extents: tuple[float, float, float, float]) -> None: ...
+ @property
+ def rotation(self) -> float: ...
+ @rotation.setter
+ def rotation(self, value: float) -> None: ...
+ @property
+ def geometry(self) -> np.ndarray: ...
+
+class EllipseSelector(RectangleSelector): ...
+
+class LassoSelector(_SelectorWidget):
+ verts: None | list[tuple[float, float]]
+ def __init__(
+ self,
+ ax: Axes,
+ onselect: Callable[[list[tuple[float, float]]], Any] | None = ...,
+ *,
+ useblit: bool = ...,
+ props: dict[str, Any] | None = ...,
+ button: MouseButton | Collection[MouseButton] | None = ...,
+ ) -> None: ...
+
+class PolygonSelector(_SelectorWidget):
+ grab_range: float
+ def __init__(
+ self,
+ ax: Axes,
+ onselect: Callable[[ArrayLike, ArrayLike], Any] | None = ...,
+ *,
+ useblit: bool = ...,
+ props: dict[str, Any] | None = ...,
+ handle_props: dict[str, Any] | None = ...,
+ grab_range: float = ...,
+ draw_bounding_box: bool = ...,
+ box_handle_props: dict[str, Any] | None = ...,
+ box_props: dict[str, Any] | None = ...
+ ) -> None: ...
+ def onmove(self, event: Event) -> bool: ...
+ @property
+ def verts(self) -> list[tuple[float, float]]: ...
+ @verts.setter
+ def verts(self, xys: Sequence[tuple[float, float]]) -> None: ...
+
+class Lasso(AxesWidget):
+ useblit: bool
+ background: Any
+ verts: list[tuple[float, float]] | None
+ line: Line2D
+ callback: Callable[[list[tuple[float, float]]], Any]
+ def __init__(
+ self,
+ ax: Axes,
+ xy: tuple[float, float],
+ callback: Callable[[list[tuple[float, float]]], Any],
+ *,
+ useblit: bool = ...,
+ props: dict[str, Any] | None = ...,
+ ) -> None: ...
+ def onrelease(self, event: Event) -> None: ...
+ def onmove(self, event: Event) -> None: ...
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cuda_stdint.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cuda_stdint.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a9814410e4b6fb4f07ad9edc8394e956b77dbcd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cuda_stdint.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2009-2017 NVIDIA Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of NVIDIA CORPORATION nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __cuda_stdint_h__
+#define __cuda_stdint_h__
+
+// Compiler-specific treatment for C99's stdint.h
+//
+// By default, this header will use the standard headers (so it
+// is your responsibility to make sure they are available), except
+// on MSVC before Visual Studio 2010, when they were not provided.
+// To support old MSVC, a few of the commonly-used definitions are
+// provided here. If more definitions are needed, add them here,
+// or replace these definitions with a complete implementation,
+// such as the ones available from Google, Boost, or MSVC10. You
+// can prevent the definition of any of these types (in order to
+// use your own) by #defining CU_STDINT_TYPES_ALREADY_DEFINED.
+
+#if !defined(CU_STDINT_TYPES_ALREADY_DEFINED)
+
+// In VS including stdint.h forces the C++ runtime dep - provide an opt-out
+// (CU_STDINT_VS_FORCE_NO_STDINT_H) for users that care (notably static
+// cudart).
+#if defined(_MSC_VER) && ((_MSC_VER < 1600) || defined(CU_STDINT_VS_FORCE_NO_STDINT_H))
+
+// These definitions can be used with MSVC 8 and 9,
+// which don't ship with stdint.h:
+
+typedef unsigned char uint8_t;
+
+typedef short int16_t;
+typedef unsigned short uint16_t;
+
+// To keep it consistent with all MSVC build. define those types
+// in the exact same way they are defined with the MSVC headers
+#if defined(_MSC_VER)
+typedef signed char int8_t;
+
+typedef int int32_t;
+typedef unsigned int uint32_t;
+
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+#else
+typedef char int8_t;
+
+typedef long int32_t;
+typedef unsigned long uint32_t;
+
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
+#endif
+
+#elif defined(__DJGPP__)
+
+// These definitions can be used when compiling
+// C code with DJGPP, which only provides stdint.h
+// when compiling C++ code with TR1 enabled.
+
+typedef char int8_t;
+typedef unsigned char uint8_t;
+
+typedef short int16_t;
+typedef unsigned short uint16_t;
+
+typedef long int32_t;
+typedef unsigned long uint32_t;
+
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+
+#else
+
+// Use standard headers, as specified by C99 and C++ TR1.
+// Known to be provided by:
+// - gcc/glibc, supported by all versions of glibc
+// - djgpp, supported since 2001
+// - MSVC, supported by Visual Studio 2010 and later
+
+#include
+
+#endif
+
+#endif // !defined(CU_STDINT_TYPES_ALREADY_DEFINED)
+
+
+#endif // file guard
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti.h
new file mode 100644
index 0000000000000000000000000000000000000000..be316531dcfd846bcea8feadf3604437ce2447a1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2010-2017 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if !defined(_CUPTI_H_)
+#define _CUPTI_H_
+
+#ifdef _WIN32
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#ifdef NOMINMAX
+#include
+#else
+#define NOMINMAX
+#include
+#undef NOMINMAX
+#endif
+#endif
+
+#include
+#include
+#include
+
+/* Activity, callback, event and metric APIs */
+#include
+#include
+#include
+#include
+
+/* Runtime, driver, and nvtx function identifiers */
+#include
+#include
+#include
+
+/* To support function parameter structures for obsoleted API. See
+ cuda.h for the actual definition of these structures. */
+typedef unsigned int CUdeviceptr_v1;
+typedef struct CUDA_MEMCPY2D_v1_st { int dummy; } CUDA_MEMCPY2D_v1;
+typedef struct CUDA_MEMCPY3D_v1_st { int dummy; } CUDA_MEMCPY3D_v1;
+typedef struct CUDA_ARRAY_DESCRIPTOR_v1_st { int dummy; } CUDA_ARRAY_DESCRIPTOR_v1;
+typedef struct CUDA_ARRAY3D_DESCRIPTOR_v1_st { int dummy; } CUDA_ARRAY3D_DESCRIPTOR_v1;
+
+/* Function parameter structures */
+#include
+#include
+
+/* The following parameter structures cannot be included unless a
+ header that defines GL_VERSION is included before including them.
+ If these are needed then make sure such a header is included
+ already. */
+#ifdef GL_VERSION
+#include
+#include
+#endif
+
+//#include
+
+/* The following parameter structures cannot be included by default as
+ they are not guaranteed to be available on all systems. Uncomment
+ the includes that are available, or use the include explicitly. */
+#if defined(__linux__)
+//#include
+//#include
+#endif
+
+#ifdef _WIN32
+//#include
+//#include
+//#include
+//#include
+//#include
+//#include
+#endif
+
+#endif /*_CUPTI_H_*/
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_activity.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_activity.h
new file mode 100644
index 0000000000000000000000000000000000000000..21fa5193b1fe38893994b62442b61cbb30b21227
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_activity.h
@@ -0,0 +1,7692 @@
+/*
+ * Copyright 2011-2024 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if !defined(_CUPTI_ACTIVITY_H_)
+#define _CUPTI_ACTIVITY_H_
+
+/**
+ * Deprecated APIs and structures have been moved to the
+ * header :doc: `cupti_activity_deprecated.h`, which is included at
+ * the bottom of this file. Header cupti_activity.h contains
+ * only the latest version of APIs and structures.
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+#if defined(CUPTI_DIRECTIVE_SUPPORT)
+#include
+#include
+#endif
+
+#include
+
+#define CUPTI_UNIFIED_MEMORY_CPU_DEVICE_ID ((uint32_t) 0xFFFFFFFFU)
+#define CUPTI_INVALID_CONTEXT_ID ((uint32_t) 0xFFFFFFFFU)
+#define CUPTI_INVALID_STREAM_ID ((uint32_t) 0xFFFFFFFFU)
+#define CUPTI_INVALID_CHANNEL_ID ((uint32_t) 0xFFFFFFFFU)
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility push(default)
+#endif
+
+#define invalidNumaId ((uint32_t) 0xFFFFFFFF)
+
+/**
+ * \defgroup CUPTI_ACTIVITY_API CUPTI Activity API
+ * Functions, types, and enums that implement the CUPTI Activity API.
+ * @{
+ */
+
+/**
+ * \brief The kinds of activity records.
+ *
+ * Each activity record kind represents information about a GPU or an
+ * activity occurring on a CPU or GPU. Each kind is associated with a
+ * activity record structure that holds the information associated
+ * with the kind.
+ * \see CUpti_Activity
+ * \see CUpti_ActivityAPI
+ * \see CUpti_ActivityContext
+ * \see CUpti_ActivityContext2
+ * \see CUpti_ActivityContext3
+ * \see CUpti_ActivityDevice
+ * \see CUpti_ActivityDevice2
+ * \see CUpti_ActivityDevice3
+ * \see CUpti_ActivityDevice4
+ * \see CUpti_ActivityDeviceAttribute
+ * \see CUpti_ActivityEvent
+ * \see CUpti_ActivityEventInstance
+ * \see CUpti_ActivityKernel
+ * \see CUpti_ActivityKernel2
+ * \see CUpti_ActivityKernel3
+ * \see CUpti_ActivityKernel4
+ * \see CUpti_ActivityKernel5
+ * \see CUpti_ActivityKernel6
+ * \see CUpti_ActivityKernel7
+ * \see CUpti_ActivityKernel8
+ * \see CUpti_ActivityKernel9
+ * \see CUpti_ActivityCdpKernel
+ * \see CUpti_ActivityPreemption
+ * \see CUpti_ActivityMemcpy
+ * \see CUpti_ActivityMemcpy3
+ * \see CUpti_ActivityMemcpy4
+ * \see CUpti_ActivityMemcpy5
+ * \see CUpti_ActivityMemcpyPtoP
+ * \see CUpti_ActivityMemcpyPtoP2
+ * \see CUpti_ActivityMemcpyPtoP3
+ * \see CUpti_ActivityMemcpyPtoP4
+ * \see CUpti_ActivityMemset
+ * \see CUpti_ActivityMemset2
+ * \see CUpti_ActivityMemset3
+ * \see CUpti_ActivityMemset4
+ * \see CUpti_ActivityMemory
+ * \see CUpti_ActivityMemory2
+ * \see CUpti_ActivityMemory3
+ * \see CUpti_ActivityMemory4
+ * \see CUpti_ActivityMemoryPool
+ * \see CUpti_ActivityMemoryPool2
+ * \see CUpti_ActivityMetric
+ * \see CUpti_ActivityMetricInstance
+ * \see CUpti_ActivityName
+ * \see CUpti_ActivityMarker
+ * \see CUpti_ActivityMarker2
+ * \see CUpti_ActivityMarkerData
+ * \see CUpti_ActivitySourceLocator
+ * \see CUpti_ActivityGlobalAccess
+ * \see CUpti_ActivityGlobalAccess2
+ * \see CUpti_ActivityGlobalAccess3
+ * \see CUpti_ActivityBranch
+ * \see CUpti_ActivityBranch2
+ * \see CUpti_ActivityOverhead3
+ * \see CUpti_ActivityEnvironment
+ * \see CUpti_ActivityInstructionExecution
+ * \see CUpti_ActivityUnifiedMemoryCounter
+ * \see CUpti_ActivityFunction
+ * \see CUpti_ActivityModule
+ * \see CUpti_ActivitySharedAccess
+ * \see CUpti_ActivityPCSampling
+ * \see CUpti_ActivityPCSampling2
+ * \see CUpti_ActivityPCSampling3
+ * \see CUpti_ActivityPCSamplingRecordInfo
+ * \see CUpti_ActivityCudaEvent
+ * \see CUpti_ActivityStream
+ * \see CUpti_ActivitySynchronization
+ * \see CUpti_ActivityInstructionCorrelation
+ * \see CUpti_ActivityExternalCorrelation
+ * \see CUpti_ActivityUnifiedMemoryCounter2
+ * \see CUpti_ActivityOpenAccData
+ * \see CUpti_ActivityOpenAccLaunch
+ * \see CUpti_ActivityOpenAccOther
+ * \see CUpti_ActivityOpenMp
+ * \see CUpti_ActivityNvLink
+ * \see CUpti_ActivityNvLink2
+ * \see CUpti_ActivityNvLink3
+ * \see CUpti_ActivityNvLink4
+ * \see CUpti_ActivityPcie
+ * \see CUpti_ActivityConfidentialComputeRotation
+ */
+
+typedef enum {
+ /**
+ * The activity record is invalid.
+ */
+ CUPTI_ACTIVITY_KIND_INVALID = 0,
+
+ /**
+ * A host<->host, host<->device, or device<->device memory copy. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivityMemcpy5.
+ */
+ CUPTI_ACTIVITY_KIND_MEMCPY = 1,
+
+ /**
+ * A memory set executing on the GPU. The corresponding activity
+ * record structure is \ref CUpti_ActivityMemset4.
+ */
+ CUPTI_ACTIVITY_KIND_MEMSET = 2,
+
+ /**
+ * A kernel executing on the GPU. This activity kind may significantly change
+ * the overall performance characteristics of the application because all
+ * kernel executions are serialized on the GPU. Other activity kind for kernel
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL doesn't break kernel concurrency.
+ * The corresponding activity record structure is \ref CUpti_ActivityKernel9.
+ */
+ CUPTI_ACTIVITY_KIND_KERNEL = 3,
+
+ /**
+ * A CUDA driver API function execution. The corresponding activity
+ * record structure is \ref CUpti_ActivityAPI.
+ */
+ CUPTI_ACTIVITY_KIND_DRIVER = 4,
+
+ /**
+ * A CUDA runtime API function execution. The corresponding activity
+ * record structure is \ref CUpti_ActivityAPI.
+ */
+ CUPTI_ACTIVITY_KIND_RUNTIME = 5,
+
+ /**
+ * An event value. The corresponding activity record structure is
+ * \ref CUpti_ActivityEvent.
+ */
+ CUPTI_ACTIVITY_KIND_EVENT = 6,
+
+ /**
+ * A metric value. The corresponding activity record structure is
+ * \ref CUpti_ActivityMetric.
+ */
+ CUPTI_ACTIVITY_KIND_METRIC = 7,
+
+ /**
+ * Information about a device. The corresponding activity record
+ * structure is \ref CUpti_ActivityDevice5.
+ */
+ CUPTI_ACTIVITY_KIND_DEVICE = 8,
+
+ /**
+ * Information about a context. The corresponding activity record
+ * structure is \ref CUpti_ActivityContext3.
+ */
+ CUPTI_ACTIVITY_KIND_CONTEXT = 9,
+
+ /**
+ * A kernel executing on the GPU. This activity kind doesn't break
+ * kernel concurrency. The corresponding activity record structure
+ * is \ref CUpti_ActivityKernel9.
+ */
+ CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL = 10,
+
+ /**
+ * Resource naming done via NVTX APIs for thread, device, context, etc.
+ * The corresponding activity record structure is \ref CUpti_ActivityName.
+ */
+ CUPTI_ACTIVITY_KIND_NAME = 11,
+
+ /**
+ * Instantaneous, start, or end NVTX marker. The corresponding activity
+ * record structure is \ref CUpti_ActivityMarker2.
+ */
+ CUPTI_ACTIVITY_KIND_MARKER = 12,
+
+ /**
+ * Extended, optional, data about a marker. User must enable
+ * CUPTI_ACTIVITY_KIND_MARKER as well to get records for marker data.
+ * The corresponding activity record structure is \ref CUpti_ActivityMarkerData.
+ */
+ CUPTI_ACTIVITY_KIND_MARKER_DATA = 13,
+
+ /**
+ * Source information about source level result. The corresponding
+ * activity record structure is \ref CUpti_ActivitySourceLocator.
+ * In CUDA 12.6, this kind is deprecated for Volta and later GPU architectures
+ * in favor of SASS Metric APIs from the header cupti_sass_metrics.h.
+ */
+ CUPTI_ACTIVITY_KIND_SOURCE_LOCATOR = 14,
+
+ /**
+ * Results for source-level global access. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivityGlobalAccess3.
+ * In CUDA 12.6, this kind is deprecated for Volta and later GPU architectures
+ * in favor of SASS Metric APIs from the header cupti_sass_metrics.h.
+ */
+ CUPTI_ACTIVITY_KIND_GLOBAL_ACCESS = 15,
+
+ /**
+ * Results for source-level branch. The corresponding
+ * activity record structure is \ref CUpti_ActivityBranch2.
+ * In CUDA 12.6, this kind is deprecated for Volta and later GPU architectures
+ * in favor of SASS Metric APIs from the header cupti_sass_metrics.h.
+ */
+ CUPTI_ACTIVITY_KIND_BRANCH = 16,
+
+ /**
+ * Overhead activity records. The
+ * corresponding activity record structure is
+ * \ref CUpti_ActivityOverhead3.
+ */
+ CUPTI_ACTIVITY_KIND_OVERHEAD = 17,
+
+ /**
+ * A CDP (CUDA Dynamic Parallel) kernel executing on the GPU. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivityCdpKernel. This activity can not be directly
+ * enabled or disabled. It is enabled and disabled through
+ * concurrent kernel activity i.e. _CONCURRENT_KERNEL.
+ */
+ CUPTI_ACTIVITY_KIND_CDP_KERNEL = 18,
+ /**
+ * Preemption activity record indicating a preemption of a CDP (CUDA
+ * Dynamic Parallel) kernel executing on the GPU. The corresponding
+ * activity record structure is \ref CUpti_ActivityPreemption.
+ */
+ CUPTI_ACTIVITY_KIND_PREEMPTION = 19,
+
+ /**
+ * Environment activity records indicating power, clock, thermal,
+ * etc. levels of the GPU. The corresponding activity record
+ * structure is \ref CUpti_ActivityEnvironment.
+ */
+ CUPTI_ACTIVITY_KIND_ENVIRONMENT = 20,
+
+ /**
+ * An event value associated with a specific event domain
+ * instance. The corresponding activity record structure is \ref
+ * CUpti_ActivityEventInstance.
+ */
+ CUPTI_ACTIVITY_KIND_EVENT_INSTANCE = 21,
+
+ /**
+ * A peer to peer memory copy. The corresponding activity record
+ * structure is \ref CUpti_ActivityMemcpyPtoP4.
+ */
+ CUPTI_ACTIVITY_KIND_MEMCPY2 = 22,
+
+ /**
+ * A metric value associated with a specific metric domain
+ * instance. The corresponding activity record structure is \ref
+ * CUpti_ActivityMetricInstance.
+ */
+ CUPTI_ACTIVITY_KIND_METRIC_INSTANCE = 23,
+
+ /**
+ * Results for source-level instruction execution.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityInstructionExecution.
+ * In CUDA 12.6, this kind is deprecated for Volta and later GPU architectures
+ * in favor of SASS Metric APIs from the header cupti_sass_metrics.h.
+ */
+ CUPTI_ACTIVITY_KIND_INSTRUCTION_EXECUTION = 24,
+
+ /**
+ * Unified Memory counter record. The corresponding activity
+ * record structure is \ref CUpti_ActivityUnifiedMemoryCounter2.
+ */
+ CUPTI_ACTIVITY_KIND_UNIFIED_MEMORY_COUNTER = 25,
+
+ /**
+ * Device global/function record. The corresponding activity
+ * record structure is \ref CUpti_ActivityFunction.
+ */
+ CUPTI_ACTIVITY_KIND_FUNCTION = 26,
+
+ /**
+ * CUDA Module record. The corresponding activity
+ * record structure is \ref CUpti_ActivityModule.
+ */
+ CUPTI_ACTIVITY_KIND_MODULE = 27,
+
+ /**
+ * A device attribute value. The corresponding activity record
+ * structure is \ref CUpti_ActivityDeviceAttribute.
+ */
+ CUPTI_ACTIVITY_KIND_DEVICE_ATTRIBUTE = 28,
+
+ /**
+ * Results for source-level shared access. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivitySharedAccess.
+ * In CUDA 12.6, this kind is deprecated for Volta and later GPU architectures
+ * in favor of SASS Metric APIs from the header cupti_sass_metrics.h.
+ */
+ CUPTI_ACTIVITY_KIND_SHARED_ACCESS = 29,
+
+ /**
+ * Enable PC sampling for kernels. This will serialize
+ * kernels. The corresponding activity record structure
+ * is \ref CUpti_ActivityPCSampling3. In CUDA 12.5, this kind
+ * is deprecated for Volta and later GPU architectures in favor
+ * of PC Sampling APIs from the header cupti_pcsampling.h.
+ */
+ CUPTI_ACTIVITY_KIND_PC_SAMPLING = 30,
+
+ /**
+ * Summary information about PC sampling records. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivityPCSamplingRecordInfo. In CUDA 12.5, this kind
+ * is deprecated for Volta and later GPU architectures in favor
+ * of PC Sampling APIs from the header cupti_pcsampling.h.
+ */
+ CUPTI_ACTIVITY_KIND_PC_SAMPLING_RECORD_INFO = 31,
+
+ /**
+ * SASS/Source line-by-line correlation record.
+ * This will generate sass/source correlation for functions that have source
+ * level analysis or pc sampling results. The records will be generated only
+ * when either of source level analysis or pc sampling activity is enabled.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityInstructionCorrelation.
+ * In CUDA 12.6, this kind is deprecated for Volta and later GPU architectures
+ * in favor of SASS Metric APIs from the header cupti_sass_metrics.h.
+ */
+ CUPTI_ACTIVITY_KIND_INSTRUCTION_CORRELATION = 32,
+
+ /**
+ * OpenACC data events.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityOpenAccData.
+ */
+ CUPTI_ACTIVITY_KIND_OPENACC_DATA = 33,
+
+ /**
+ * OpenACC launch events.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityOpenAccLaunch.
+ */
+ CUPTI_ACTIVITY_KIND_OPENACC_LAUNCH = 34,
+
+ /**
+ * OpenACC other events.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityOpenAccOther.
+ */
+ CUPTI_ACTIVITY_KIND_OPENACC_OTHER = 35,
+
+ /**
+ * Information about a CUDA event. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivityCudaEvent.
+ */
+ CUPTI_ACTIVITY_KIND_CUDA_EVENT = 36,
+
+ /**
+ * Information about a CUDA stream. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivityStream.
+ */
+ CUPTI_ACTIVITY_KIND_STREAM = 37,
+
+ /**
+ * Records for synchronization management. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivitySynchronization.
+ */
+ CUPTI_ACTIVITY_KIND_SYNCHRONIZATION = 38,
+
+ /**
+ * Records for correlation of different programming APIs. The
+ * corresponding activity record structure is \ref
+ * CUpti_ActivityExternalCorrelation.
+ */
+ CUPTI_ACTIVITY_KIND_EXTERNAL_CORRELATION = 39,
+
+ /**
+ * NVLink information.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityNvLink4.
+ */
+ CUPTI_ACTIVITY_KIND_NVLINK = 40,
+
+ /**
+ * Instantaneous Event information.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityInstantaneousEvent.
+ */
+ CUPTI_ACTIVITY_KIND_INSTANTANEOUS_EVENT = 41,
+
+ /**
+ * Instantaneous Event information for a specific event
+ * domain instance.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityInstantaneousEventInstance
+ */
+ CUPTI_ACTIVITY_KIND_INSTANTANEOUS_EVENT_INSTANCE = 42,
+
+ /**
+ * Instantaneous Metric information
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityInstantaneousMetric.
+ */
+ CUPTI_ACTIVITY_KIND_INSTANTANEOUS_METRIC = 43,
+
+ /**
+ * Instantaneous Metric information for a specific metric
+ * domain instance.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityInstantaneousMetricInstance.
+ */
+ CUPTI_ACTIVITY_KIND_INSTANTANEOUS_METRIC_INSTANCE = 44,
+
+ /**
+ * Memory activity tracking allocation and freeing of the memory
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityMemory.
+ */
+ CUPTI_ACTIVITY_KIND_MEMORY = 45,
+
+ /**
+ * PCI devices information used for PCI topology.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityPcie.
+ */
+ CUPTI_ACTIVITY_KIND_PCIE = 46,
+
+ /**
+ * OpenMP parallel events.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityOpenMp.
+ */
+ CUPTI_ACTIVITY_KIND_OPENMP = 47,
+
+ /**
+ * A CUDA driver kernel launch occurring outside of any
+ * public API function execution. Tools can handle these
+ * like records for driver API launch functions, although
+ * the cbid field is not used here.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityAPI.
+ */
+ CUPTI_ACTIVITY_KIND_INTERNAL_LAUNCH_API = 48,
+
+ /**
+ * Memory activity tracking allocation and freeing of the memory
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityMemory4.
+ */
+ CUPTI_ACTIVITY_KIND_MEMORY2 = 49,
+
+ /**
+ * Memory pool activity tracking creation, destruction and
+ * trimming of the memory pool.
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityMemoryPool2.
+ */
+ CUPTI_ACTIVITY_KIND_MEMORY_POOL = 50,
+
+ /**
+ * The corresponding activity record structure is
+ * \ref CUpti_ActivityGraphTrace2.
+ */
+ CUPTI_ACTIVITY_KIND_GRAPH_TRACE = 51,
+
+ /**
+ * JIT operation tracking
+ * The corresponding activity record structure is \ref
+ * CUpti_ActivityJit.
+ */
+ CUPTI_ACTIVITY_KIND_JIT = 52,
+
+
+
+ CUPTI_ACTIVITY_KIND_COUNT,
+
+ CUPTI_ACTIVITY_KIND_FORCE_INT = 0x7fffffff
+} CUpti_ActivityKind;
+
+/**
+ * \brief The kinds of activity objects.
+ * \see CUpti_ActivityObjectKindId
+ */
+typedef enum {
+ /**
+ * The object kind is not known.
+ */
+ CUPTI_ACTIVITY_OBJECT_UNKNOWN = 0,
+
+ /**
+ * A process.
+ */
+ CUPTI_ACTIVITY_OBJECT_PROCESS = 1,
+
+ /**
+ * A thread.
+ */
+ CUPTI_ACTIVITY_OBJECT_THREAD = 2,
+
+ /**
+ * A device.
+ */
+ CUPTI_ACTIVITY_OBJECT_DEVICE = 3,
+
+ /**
+ * A context.
+ */
+ CUPTI_ACTIVITY_OBJECT_CONTEXT = 4,
+
+ /**
+ * A stream.
+ */
+ CUPTI_ACTIVITY_OBJECT_STREAM = 5,
+
+ CUPTI_ACTIVITY_OBJECT_FORCE_INT = 0x7fffffff
+} CUpti_ActivityObjectKind;
+
+/**
+ * \brief Identifiers for object kinds as specified by
+ * CUpti_ActivityObjectKind.
+ * \see CUpti_ActivityObjectKind
+ */
+typedef union {
+ /**
+ * A process object requires that we identify the process ID. A
+ * thread object requires that we identify both the process and
+ * thread ID.
+ */
+ struct {
+ uint32_t processId;
+ uint32_t threadId;
+ } pt;
+
+ /**
+ * A device object requires that we identify the device ID. A
+ * context object requires that we identify both the device and
+ * context ID. A stream object requires that we identify device,
+ * context, and stream ID.
+ */
+ struct {
+ uint32_t deviceId;
+ uint32_t contextId;
+ uint32_t streamId;
+ } dcs;
+} CUpti_ActivityObjectKindId;
+
+/**
+ * \brief The structure to provide additional data for CUPTI_ACTIVITY_OVERHEAD_COMMAND_BUFFER_FULL.
+ */
+typedef struct {
+ /**
+ * The length of the command buffer.
+ *
+ */
+ uint32_t commandBufferLength;
+ /**
+ * The channel ID of the command buffer.
+ *
+ */
+ uint32_t channelID;
+ /**
+ * The channel type of the command buffer.
+ *
+ */
+ uint32_t channelType;
+} CUpti_ActivityOverheadCommandBufferFullData;
+
+/**
+ * \brief The kinds of activity overhead.
+ */
+typedef enum {
+ /**
+ * The overhead kind is not known.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_UNKNOWN = 0,
+
+ /**
+ * Compiler overhead.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_DRIVER_COMPILER = 1,
+
+ /**
+ * Activity buffer flush overhead.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_CUPTI_BUFFER_FLUSH = 1<<16,
+
+ /**
+ * CUPTI instrumentation overhead.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_CUPTI_INSTRUMENTATION = 2<<16,
+
+ /**
+ * CUPTI resource creation and destruction overhead.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_CUPTI_RESOURCE = 3<<16,
+
+ /**
+ * CUDA Runtime triggered module loading overhead.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_RUNTIME_TRIGGERED_MODULE_LOADING = 4<<16,
+
+ /**
+ * Lazy function loading overhead.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_LAZY_FUNCTION_LOADING = 5<<16,
+
+ /**
+ * Overhead due to lack of command buffer space.
+ * Refer CUpti_ActivityOverheadCommandBufferFullData for more details.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_COMMAND_BUFFER_FULL = 6<<16,
+
+ /**
+ * Overhead due to activity buffer request.
+ */
+ CUPTI_ACTIVITY_OVERHEAD_ACTIVITY_BUFFER_REQUEST = 7<<16,
+
+ CUPTI_ACTIVITY_OVERHEAD_FORCE_INT = 0x7fffffff
+} CUpti_ActivityOverheadKind;
+
+/**
+ * \brief The kind of a compute API.
+ */
+typedef enum {
+ /**
+ * The compute API is not known.
+ */
+ CUPTI_ACTIVITY_COMPUTE_API_UNKNOWN = 0,
+
+ /**
+ * The compute APIs are for CUDA.
+ */
+ CUPTI_ACTIVITY_COMPUTE_API_CUDA = 1,
+
+ /**
+ * The compute APIs are for CUDA running
+ * in MPS (Multi-Process Service) environment.
+ */
+ CUPTI_ACTIVITY_COMPUTE_API_CUDA_MPS = 2,
+
+ CUPTI_ACTIVITY_COMPUTE_API_FORCE_INT = 0x7fffffff
+} CUpti_ActivityComputeApiKind;
+
+/**
+ * \brief Flags associated with activity records.
+ *
+ * Activity record flags. Flags can be combined by bitwise OR to
+ * associated multiple flags with an activity record. Each flag is
+ * specific to a certain activity kind, as noted below.
+ */
+typedef enum {
+ /**
+ * Indicates the activity record has no flags.
+ */
+ CUPTI_ACTIVITY_FLAG_NONE = 0,
+
+ /**
+ * Indicates the activity represents a device that supports
+ * concurrent kernel execution. Valid for
+ * CUPTI_ACTIVITY_KIND_DEVICE.
+ */
+ CUPTI_ACTIVITY_FLAG_DEVICE_CONCURRENT_KERNELS = 1 << 0,
+
+ /**
+ * Indicates if the activity represents a CUdevice_attribute value
+ * or a CUpti_DeviceAttribute value. Valid for
+ * CUPTI_ACTIVITY_KIND_DEVICE_ATTRIBUTE.
+ */
+ CUPTI_ACTIVITY_FLAG_DEVICE_ATTRIBUTE_CUDEVICE = 1 << 0,
+
+ /**
+ * Indicates the activity represents an asynchronous memcpy
+ * operation. Valid for CUPTI_ACTIVITY_KIND_MEMCPY.
+ */
+ CUPTI_ACTIVITY_FLAG_MEMCPY_ASYNC = 1 << 0,
+
+ /**
+ * Indicates the activity represents an instantaneous marker. Valid
+ * for CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_INSTANTANEOUS = 1 << 0,
+
+ /**
+ * Indicates the activity represents a region start marker. Valid
+ * for CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_START = 1 << 1,
+
+ /**
+ * Indicates the activity represents a region end marker. Valid for
+ * CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_END = 1 << 2,
+
+ /**
+ * Indicates the activity represents an attempt to acquire a user
+ * defined synchronization object.
+ * Valid for CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_SYNC_ACQUIRE = 1 << 3,
+
+ /**
+ * Indicates the activity represents success in acquiring the
+ * user defined synchronization object.
+ * Valid for CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_SYNC_ACQUIRE_SUCCESS = 1 << 4,
+
+ /**
+ * Indicates the activity represents failure in acquiring the
+ * user defined synchronization object.
+ * Valid for CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_SYNC_ACQUIRE_FAILED = 1 << 5,
+
+ /**
+ * Indicates the activity represents releasing a reservation on
+ * user defined synchronization object.
+ * Valid for CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_SYNC_RELEASE = 1 << 6,
+
+ /**
+ * Indicates the activity represents a marker that does not specify
+ * a color. Valid for CUPTI_ACTIVITY_KIND_MARKER_DATA.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_COLOR_NONE = 1 << 0,
+
+ /**
+ * Indicates the activity represents a marker that specifies a color
+ * in alpha-red-green-blue format. Valid for
+ * CUPTI_ACTIVITY_KIND_MARKER_DATA.
+ */
+ CUPTI_ACTIVITY_FLAG_MARKER_COLOR_ARGB = 1 << 1,
+
+ /**
+ * The number of bytes requested by each thread
+ * Valid for CUpti_ActivityGlobalAccess3.
+ */
+ CUPTI_ACTIVITY_FLAG_GLOBAL_ACCESS_KIND_SIZE_MASK = 0xFF << 0,
+
+ /**
+ * If bit in this flag is set, the access was load, else it is a
+ * store access. Valid for CUpti_ActivityGlobalAccess3.
+ */
+ CUPTI_ACTIVITY_FLAG_GLOBAL_ACCESS_KIND_LOAD = 1 << 8,
+
+ /**
+ * If this bit in flag is set, the load access was cached else it is
+ * uncached. Valid for CUpti_ActivityGlobalAccess3.
+ */
+ CUPTI_ACTIVITY_FLAG_GLOBAL_ACCESS_KIND_CACHED = 1 << 9,
+
+ /**
+ * If this bit in flag is set, the metric value overflowed. Valid
+ * for CUpti_ActivityMetric and CUpti_ActivityMetricInstance.
+ */
+ CUPTI_ACTIVITY_FLAG_METRIC_OVERFLOWED = 1 << 0,
+
+ /**
+ * If this bit in flag is set, the metric value couldn't be
+ * calculated. This occurs when a value(s) required to calculate the
+ * metric is missing. Valid for CUpti_ActivityMetric and
+ * CUpti_ActivityMetricInstance.
+ */
+ CUPTI_ACTIVITY_FLAG_METRIC_VALUE_INVALID = 1 << 1,
+
+ /**
+ * If this bit in flag is set, the source level metric value couldn't be
+ * calculated. This occurs when a value(s) required to calculate the
+ * source level metric cannot be evaluated.
+ * Valid for CUpti_ActivityInstructionExecution.
+ */
+ CUPTI_ACTIVITY_FLAG_INSTRUCTION_VALUE_INVALID = 1 << 0,
+
+ /**
+ * The mask for the instruction class, \ref CUpti_ActivityInstructionClass
+ * Valid for CUpti_ActivityInstructionExecution and
+ * CUpti_ActivityInstructionCorrelation
+ */
+ CUPTI_ACTIVITY_FLAG_INSTRUCTION_CLASS_MASK = 0xFF << 1,
+
+ /**
+ * When calling cuptiActivityFlushAll, this flag
+ * can be set to force CUPTI to flush all records in the buffer, whether
+ * finished or not
+ */
+ CUPTI_ACTIVITY_FLAG_FLUSH_FORCED = 1 << 0,
+
+ /**
+ * The number of bytes requested by each thread
+ * Valid for CUpti_ActivitySharedAccess.
+ */
+ CUPTI_ACTIVITY_FLAG_SHARED_ACCESS_KIND_SIZE_MASK = 0xFF << 0,
+
+ /**
+ * If bit in this flag is set, the access was load, else it is a
+ * store access. Valid for CUpti_ActivitySharedAccess.
+ */
+ CUPTI_ACTIVITY_FLAG_SHARED_ACCESS_KIND_LOAD = 1 << 8,
+
+ /**
+ * Indicates the activity represents an asynchronous memset
+ * operation. Valid for CUPTI_ACTIVITY_KIND_MEMSET.
+ */
+ CUPTI_ACTIVITY_FLAG_MEMSET_ASYNC = 1 << 0,
+
+ /**
+ * Indicates the activity represents thrashing in CPU.
+ * Valid for counter of kind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THRASHING in
+ * CUPTI_ACTIVITY_KIND_UNIFIED_MEMORY_COUNTER
+ */
+ CUPTI_ACTIVITY_FLAG_THRASHING_IN_CPU = 1 << 0,
+
+ /**
+ * Indicates the activity represents page throttling in CPU.
+ * Valid for counter of kind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THROTTLING in
+ * CUPTI_ACTIVITY_KIND_UNIFIED_MEMORY_COUNTER
+ */
+ CUPTI_ACTIVITY_FLAG_THROTTLING_IN_CPU = 1 << 0,
+
+ CUPTI_ACTIVITY_FLAG_FORCE_INT = 0x7fffffff
+} CUpti_ActivityFlag;
+
+/**
+ * \brief The stall reason for PC sampling activity.
+ */
+typedef enum {
+ /**
+ * Invalid reason
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_INVALID = 0,
+
+ /**
+ * No stall, instruction is selected for issue
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_NONE = 1,
+
+ /**
+ * Warp is blocked because next instruction is not yet available,
+ * because of instruction cache miss, or because of branching effects
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_INST_FETCH = 2,
+
+ /**
+ * Instruction is waiting on an arithmetic dependency
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_EXEC_DEPENDENCY = 3,
+
+ /**
+ * Warp is blocked because it is waiting for a memory access to complete.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_MEMORY_DEPENDENCY = 4,
+
+ /**
+ * Texture sub-system is fully utilized or has too many outstanding requests.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_TEXTURE = 5,
+
+ /**
+ * Warp is blocked as it is waiting at __syncthreads() or at memory barrier.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_SYNC = 6,
+
+ /**
+ * Warp is blocked waiting for __constant__ memory and immediate memory access to complete.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_CONSTANT_MEMORY_DEPENDENCY = 7,
+
+ /**
+ * Compute operation cannot be performed due to the required resources not
+ * being available.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_PIPE_BUSY = 8,
+
+ /**
+ * Warp is blocked because there are too many pending memory operations.
+ * In Kepler architecture it often indicates high number of memory replays.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_MEMORY_THROTTLE = 9,
+
+ /**
+ * Warp was ready to issue, but some other warp issued instead.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_NOT_SELECTED = 10,
+
+ /**
+ * Miscellaneous reasons
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_OTHER = 11,
+
+ /**
+ * Sleeping.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_SLEEPING = 12,
+
+ CUPTI_ACTIVITY_PC_SAMPLING_STALL_FORCE_INT = 0x7fffffff
+} CUpti_ActivityPCSamplingStallReason;
+
+/**
+ * \brief Sampling period for PC sampling method
+ *
+ * Sampling period can be set using \ref cuptiActivityConfigurePCSampling
+ */
+typedef enum {
+ /**
+ * The PC sampling period is not set.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_PERIOD_INVALID = 0,
+
+ /**
+ * Minimum sampling period available on the device.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_PERIOD_MIN = 1,
+
+ /**
+ * Sampling period in lower range.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_PERIOD_LOW = 2,
+
+ /**
+ * Medium sampling period.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_PERIOD_MID = 3,
+
+ /**
+ * Sampling period in higher range.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_PERIOD_HIGH = 4,
+
+ /**
+ * Maximum sampling period available on the device.
+ */
+ CUPTI_ACTIVITY_PC_SAMPLING_PERIOD_MAX = 5,
+
+ CUPTI_ACTIVITY_PC_SAMPLING_PERIOD_FORCE_INT = 0x7fffffff
+} CUpti_ActivityPCSamplingPeriod;
+
+/**
+ * \brief The kind of a memory copy, indicating the source and
+ * destination targets of the copy.
+ *
+ * Each kind represents the source and destination targets of a memory
+ * copy. Targets are host, device, and array.
+ */
+typedef enum {
+ /**
+ * The memory copy kind is not known.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_UNKNOWN = 0,
+
+ /**
+ * A host to device memory copy.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_HTOD = 1,
+
+ /**
+ * A device to host memory copy.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_DTOH = 2,
+
+ /**
+ * A host to device array memory copy.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_HTOA = 3,
+
+ /**
+ * A device array to host memory copy.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_ATOH = 4,
+
+ /**
+ * A device array to device array memory copy.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_ATOA = 5,
+
+ /**
+ * A device array to device memory copy.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_ATOD = 6,
+
+ /**
+ * A device to device array memory copy.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_DTOA = 7,
+
+ /**
+ * A device to device memory copy on the same device.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_DTOD = 8,
+
+ /**
+ * A host to host memory copy.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_HTOH = 9,
+
+ /**
+ * A peer to peer memory copy across different devices.
+ */
+ CUPTI_ACTIVITY_MEMCPY_KIND_PTOP = 10,
+
+ CUPTI_ACTIVITY_MEMCPY_KIND_FORCE_INT = 0x7fffffff
+} CUpti_ActivityMemcpyKind;
+
+/**
+ * \brief The kinds of memory accessed by a memory operation/copy.
+ *
+ * Each kind represents the type of the memory
+ * accessed by a memory operation/copy.
+ */
+typedef enum {
+ /**
+ * The memory kind is unknown.
+ */
+ CUPTI_ACTIVITY_MEMORY_KIND_UNKNOWN = 0,
+
+ /**
+ * The memory is pageable.
+ */
+ CUPTI_ACTIVITY_MEMORY_KIND_PAGEABLE = 1,
+
+ /**
+ * The memory is pinned.
+ */
+ CUPTI_ACTIVITY_MEMORY_KIND_PINNED = 2,
+
+ /**
+ * The memory is on the device.
+ */
+ CUPTI_ACTIVITY_MEMORY_KIND_DEVICE = 3,
+
+ /**
+ * The memory is an array.
+ */
+ CUPTI_ACTIVITY_MEMORY_KIND_ARRAY = 4,
+
+ /**
+ * The memory is managed
+ */
+ CUPTI_ACTIVITY_MEMORY_KIND_MANAGED = 5,
+
+ /**
+ * The memory is device static
+ */
+ CUPTI_ACTIVITY_MEMORY_KIND_DEVICE_STATIC = 6,
+
+ /**
+ * The memory is managed static
+ */
+ CUPTI_ACTIVITY_MEMORY_KIND_MANAGED_STATIC = 7,
+
+ CUPTI_ACTIVITY_MEMORY_KIND_FORCE_INT = 0x7fffffff
+} CUpti_ActivityMemoryKind;
+
+/**
+ * \brief The kind of a preemption activity.
+ */
+typedef enum {
+ /**
+ * The preemption kind is not known.
+ */
+ CUPTI_ACTIVITY_PREEMPTION_KIND_UNKNOWN = 0,
+
+ /**
+ * Preemption to save CDP block.
+ */
+ CUPTI_ACTIVITY_PREEMPTION_KIND_SAVE = 1,
+
+ /**
+ * Preemption to restore CDP block.
+ */
+ CUPTI_ACTIVITY_PREEMPTION_KIND_RESTORE = 2,
+
+ CUPTI_ACTIVITY_PREEMPTION_KIND_FORCE_INT = 0x7fffffff
+} CUpti_ActivityPreemptionKind;
+
+/**
+ * \brief The kind of environment data. Used to indicate what type of
+ * data is being reported by an environment activity record.
+ */
+typedef enum {
+ /**
+ * Unknown data.
+ */
+ CUPTI_ACTIVITY_ENVIRONMENT_UNKNOWN = 0,
+
+ /**
+ * The environment data is related to speed.
+ */
+ CUPTI_ACTIVITY_ENVIRONMENT_SPEED = 1,
+
+ /**
+ * The environment data is related to temperature.
+ */
+ CUPTI_ACTIVITY_ENVIRONMENT_TEMPERATURE = 2,
+
+ /**
+ * The environment data is related to power.
+ */
+ CUPTI_ACTIVITY_ENVIRONMENT_POWER = 3,
+
+ /**
+ * The environment data is related to cooling.
+ */
+ CUPTI_ACTIVITY_ENVIRONMENT_COOLING = 4,
+
+ CUPTI_ACTIVITY_ENVIRONMENT_COUNT,
+
+ CUPTI_ACTIVITY_ENVIRONMENT_KIND_FORCE_INT = 0x7fffffff
+} CUpti_ActivityEnvironmentKind;
+
+/**
+ * \brief Reasons for clock throttling.
+ *
+ * The possible reasons that a clock can be throttled. There can be
+ * more than one reason that a clock is being throttled so these types
+ * can be combined by bitwise OR. These are used in the
+ * clocksThrottleReason field in the Environment Activity Record.
+ */
+typedef enum {
+ /**
+ * Nothing is running on the GPU and the clocks are dropping to idle
+ * state.
+ */
+ CUPTI_CLOCKS_THROTTLE_REASON_GPU_IDLE = 0x00000001,
+
+ /**
+ * The GPU clocks are limited by a user specified limit.
+ */
+ CUPTI_CLOCKS_THROTTLE_REASON_USER_DEFINED_CLOCKS = 0x00000002,
+
+ /**
+ * A software power scaling algorithm is reducing the clocks below
+ * requested clocks.
+ */
+ CUPTI_CLOCKS_THROTTLE_REASON_SW_POWER_CAP = 0x00000004,
+
+ /**
+ * Hardware slowdown to reduce the clock by a factor of two or more
+ * is engaged. This is an indicator of one of the following: 1)
+ * Temperature is too high, 2) External power brake assertion is
+ * being triggered (e.g. by the system power supply), 3) Change in
+ * power state.
+ */
+ CUPTI_CLOCKS_THROTTLE_REASON_HW_SLOWDOWN = 0x00000008,
+
+ /**
+ * Some unspecified factor is reducing the clocks.
+ */
+ CUPTI_CLOCKS_THROTTLE_REASON_UNKNOWN = 0x80000000,
+
+ /**
+ * Throttle reason is not supported for this GPU.
+ */
+ CUPTI_CLOCKS_THROTTLE_REASON_UNSUPPORTED = 0x40000000,
+
+ /**
+ * No clock throttling.
+ */
+ CUPTI_CLOCKS_THROTTLE_REASON_NONE = 0x00000000,
+
+ CUPTI_CLOCKS_THROTTLE_REASON_FORCE_INT = 0x7fffffff
+} CUpti_EnvironmentClocksThrottleReason;
+
+/**
+ * \brief Scope of the unified memory counter (deprecated in CUDA 7.0)
+ */
+typedef enum {
+ /**
+ * The unified memory counter scope is not known.
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_UNKNOWN = 0,
+
+ /**
+ * Collect unified memory counter for single process on one device
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_SINGLE_DEVICE = 1,
+
+ /**
+ * Collect unified memory counter for single process across all devices
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_PROCESS_ALL_DEVICES = 2,
+
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_COUNT,
+
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_SCOPE_FORCE_INT = 0x7fffffff
+} CUpti_ActivityUnifiedMemoryCounterScope;
+
+/**
+ * \brief Kind of the Unified Memory counter
+ *
+ * Many activities are associated with Unified Memory mechanism; among them
+ * are transfers from host to device, device to host, page fault at
+ * host side.
+ */
+typedef enum {
+ /**
+ * The unified memory counter kind is not known.
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_UNKNOWN = 0,
+
+ /**
+ * Number of bytes transferred from host to device
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD = 1,
+
+ /**
+ * Number of bytes transferred from device to host
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_DTOH = 2,
+
+ /**
+ * Number of CPU page faults, this is only supported on 64 bit
+ * Linux and Mac platforms
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT = 3,
+
+ /**
+ * Number of GPU page faults, this is only supported on devices with
+ * compute capability 6.0 and higher and 64 bit Linux platforms
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT = 4,
+
+ /**
+ * Thrashing occurs when data is frequently accessed by
+ * multiple processors and has to be constantly migrated around
+ * to achieve data locality. In this case the overhead of migration
+ * may exceed the benefits of locality.
+ * This is only supported on 64 bit Linux platforms.
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THRASHING = 5,
+
+ /**
+ * Throttling is a prevention technique used by the driver to avoid
+ * further thrashing. Here, the driver doesn't service the fault for
+ * one of the contending processors for a specific period of time,
+ * so that the other processor can run at full-speed.
+ * This is only supported on 64 bit Linux platforms.
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THROTTLING = 6,
+
+ /**
+ * In case throttling does not help, the driver tries to pin the memory
+ * to a processor for a specific period of time. One of the contending
+ * processors will have slow access to the memory, while the other will
+ * have fast access.
+ * This is only supported on 64 bit Linux platforms.
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_REMOTE_MAP = 7,
+
+ /**
+ * Number of bytes transferred from one device to another device.
+ * This is only supported on 64 bit Linux platforms.
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_DTOD = 8,
+
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_COUNT,
+
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_FORCE_INT = 0x7fffffff
+} CUpti_ActivityUnifiedMemoryCounterKind;
+
+/**
+ * \brief Memory access type for unified memory page faults
+ *
+ * This is valid for \ref CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT
+ * and \ref CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT
+ */
+typedef enum {
+ /**
+ * The unified memory access type is not known
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_ACCESS_TYPE_UNKNOWN = 0,
+
+ /**
+ * The page fault was triggered by read memory instruction
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_ACCESS_TYPE_READ = 1,
+
+ /**
+ * The page fault was triggered by write memory instruction
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_ACCESS_TYPE_WRITE = 2,
+
+ /**
+ * The page fault was triggered by atomic memory instruction
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_ACCESS_TYPE_ATOMIC = 3,
+
+ /**
+ * The page fault was triggered by memory prefetch operation
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_ACCESS_TYPE_PREFETCH = 4
+} CUpti_ActivityUnifiedMemoryAccessType;
+
+/**
+ * \brief Migration cause of the Unified Memory counter
+ *
+ * This is valid for \ref CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD and
+ * \ref CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_DTOH
+ */
+typedef enum {
+ /**
+ * The unified memory migration cause is not known
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_MIGRATION_CAUSE_UNKNOWN = 0,
+
+ /**
+ * The unified memory migrated due to an explicit call from
+ * the user e.g. cudaMemPrefetchAsync
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_MIGRATION_CAUSE_USER = 1,
+
+ /**
+ * The unified memory migrated to guarantee data coherence
+ * e.g. CPU/GPU faults on Pascal+ and kernel launch on pre-Pascal GPUs
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_MIGRATION_CAUSE_COHERENCE = 2,
+
+ /**
+ * The unified memory was speculatively migrated by the UVM driver
+ * before being accessed by the destination processor to improve
+ * performance
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_MIGRATION_CAUSE_PREFETCH = 3,
+
+ /**
+ * The unified memory migrated to the CPU because it was evicted to make
+ * room for another block of memory on the GPU
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_MIGRATION_CAUSE_EVICTION = 4,
+
+ /**
+ * The unified memory migrated to another processor because of access counter
+ * notifications. Only frequently accessed pages are migrated between CPU and GPU, or
+ * between peer GPUs.
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_MIGRATION_CAUSE_ACCESS_COUNTERS = 5,
+} CUpti_ActivityUnifiedMemoryMigrationCause;
+
+/**
+ * \brief Remote memory map cause of the Unified Memory counter
+ *
+ * This is valid for \ref CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_REMOTE_MAP
+ */
+typedef enum {
+ /**
+ * The cause of mapping to remote memory was unknown
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_REMOTE_MAP_CAUSE_UNKNOWN = 0,
+
+ /**
+ * Mapping to remote memory was added to maintain data coherence.
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_REMOTE_MAP_CAUSE_COHERENCE = 1,
+
+ /**
+ * Mapping to remote memory was added to prevent further thrashing
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_REMOTE_MAP_CAUSE_THRASHING = 2,
+
+ /**
+ * Mapping to remote memory was added to enforce the hints
+ * specified by the programmer or by performance heuristics of the
+ * UVM driver
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_REMOTE_MAP_CAUSE_POLICY = 3,
+
+ /**
+ * Mapping to remote memory was added because there is no more
+ * memory available on the processor and eviction was not
+ * possible
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_REMOTE_MAP_CAUSE_OUT_OF_MEMORY = 4,
+
+ /**
+ * Mapping to remote memory was added after the memory was
+ * evicted to make room for another block of memory on the GPU
+ */
+ CUPTI_ACTIVITY_UNIFIED_MEMORY_REMOTE_MAP_CAUSE_EVICTION = 5,
+} CUpti_ActivityUnifiedMemoryRemoteMapCause;
+
+/**
+ * \brief SASS instruction classification.
+ *
+ * The sass instruction are broadly divided into different class. Each enum represents a classification.
+ */
+typedef enum {
+ /**
+ * The instruction class is not known.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_UNKNOWN = 0,
+
+ /**
+ * Represents a 32 bit floating point operation.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_FP_32 = 1,
+
+ /**
+ * Represents a 64 bit floating point operation.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_FP_64 = 2,
+
+ /**
+ * Represents an integer operation.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_INTEGER = 3,
+
+ /**
+ * Represents a bit conversion operation.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_BIT_CONVERSION = 4,
+
+ /**
+ * Represents a control flow instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_CONTROL_FLOW = 5,
+
+ /**
+ * Represents a global load-store instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_GLOBAL = 6,
+
+ /**
+ * Represents a shared load-store instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_SHARED = 7,
+
+ /**
+ * Represents a local load-store instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_LOCAL = 8,
+
+ /**
+ * Represents a generic load-store instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_GENERIC = 9,
+
+ /**
+ * Represents a surface load-store instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_SURFACE = 10,
+
+ /**
+ * Represents a constant load instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_CONSTANT = 11,
+
+ /**
+ * Represents a texture load-store instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_TEXTURE = 12,
+
+ /**
+ * Represents a global atomic instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_GLOBAL_ATOMIC = 13,
+
+ /**
+ * Represents a shared atomic instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_SHARED_ATOMIC = 14,
+
+ /**
+ * Represents a surface atomic instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_SURFACE_ATOMIC = 15,
+
+ /**
+ * Represents a inter-thread communication instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_INTER_THREAD_COMMUNICATION = 16,
+
+ /**
+ * Represents a barrier instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_BARRIER = 17,
+
+ /**
+ * Represents some miscellaneous instructions which do not fit in the above classification.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_MISCELLANEOUS = 18,
+
+ /**
+ * Represents a 16 bit floating point operation.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_FP_16 = 19,
+
+ /**
+ * Represents uniform instruction.
+ */
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_UNIFORM = 20,
+
+ CUPTI_ACTIVITY_INSTRUCTION_CLASS_KIND_FORCE_INT = 0x7fffffff
+} CUpti_ActivityInstructionClass;
+
+/**
+ * \brief Partitioned global caching option
+ */
+typedef enum {
+ /**
+ * Partitioned global cache config unknown.
+ */
+ CUPTI_ACTIVITY_PARTITIONED_GLOBAL_CACHE_CONFIG_UNKNOWN = 0,
+
+ /**
+ * Partitioned global cache not supported.
+ */
+ CUPTI_ACTIVITY_PARTITIONED_GLOBAL_CACHE_CONFIG_NOT_SUPPORTED = 1,
+
+ /**
+ * Partitioned global cache config off.
+ */
+ CUPTI_ACTIVITY_PARTITIONED_GLOBAL_CACHE_CONFIG_OFF = 2,
+
+ /**
+ * Partitioned global cache config on.
+ */
+ CUPTI_ACTIVITY_PARTITIONED_GLOBAL_CACHE_CONFIG_ON = 3,
+
+ CUPTI_ACTIVITY_PARTITIONED_GLOBAL_CACHE_CONFIG_FORCE_INT = 0x7fffffff
+} CUpti_ActivityPartitionedGlobalCacheConfig;
+
+/**
+ * \brief Synchronization type.
+ *
+ * The types of synchronization to be used with CUpti_ActivitySynchronization.
+ */
+
+typedef enum {
+ /**
+ * Unknown data.
+ */
+ CUPTI_ACTIVITY_SYNCHRONIZATION_TYPE_UNKNOWN = 0,
+
+ /**
+ * Event synchronize API.
+ */
+ CUPTI_ACTIVITY_SYNCHRONIZATION_TYPE_EVENT_SYNCHRONIZE = 1,
+
+ /**
+ * Stream wait event API.
+ */
+ CUPTI_ACTIVITY_SYNCHRONIZATION_TYPE_STREAM_WAIT_EVENT = 2,
+
+ /**
+ * Stream synchronize API.
+ */
+ CUPTI_ACTIVITY_SYNCHRONIZATION_TYPE_STREAM_SYNCHRONIZE = 3,
+
+ /**
+ * Context synchronize API.
+ */
+ CUPTI_ACTIVITY_SYNCHRONIZATION_TYPE_CONTEXT_SYNCHRONIZE = 4,
+
+ CUPTI_ACTIVITY_SYNCHRONIZATION_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_ActivitySynchronizationType;
+
+/**
+ * \brief stream type.
+ *
+ * The types of stream to be used with CUpti_ActivityStream.
+ */
+
+typedef enum {
+ /**
+ * Unknown data.
+ */
+ CUPTI_ACTIVITY_STREAM_CREATE_FLAG_UNKNOWN = 0,
+
+ /**
+ * Default stream.
+ */
+ CUPTI_ACTIVITY_STREAM_CREATE_FLAG_DEFAULT = 1,
+
+ /**
+ * Non-blocking stream.
+ */
+ CUPTI_ACTIVITY_STREAM_CREATE_FLAG_NON_BLOCKING = 2,
+
+ /**
+ * Null stream.
+ */
+ CUPTI_ACTIVITY_STREAM_CREATE_FLAG_NULL = 3,
+
+ /**
+ * Stream create Mask
+ */
+ CUPTI_ACTIVITY_STREAM_CREATE_MASK = 0xFFFF,
+
+ CUPTI_ACTIVITY_STREAM_CREATE_FLAG_FORCE_INT = 0x7fffffff
+} CUpti_ActivityStreamFlag;
+
+/**
+* \brief Link flags.
+*
+* Describes link properties, to be used with CUpti_ActivityNvLink.
+*/
+
+typedef enum {
+ /**
+ * The flag is invalid.
+ */
+ CUPTI_LINK_FLAG_INVALID = 0,
+
+ /**
+ * Is peer to peer access supported by this link.
+ */
+ CUPTI_LINK_FLAG_PEER_ACCESS = (1 << 1),
+
+ /**
+ * Is system memory access supported by this link.
+ */
+ CUPTI_LINK_FLAG_SYSMEM_ACCESS = (1 << 2),
+
+ /**
+ * Is peer atomic access supported by this link.
+ */
+ CUPTI_LINK_FLAG_PEER_ATOMICS = (1 << 3),
+
+ /**
+ * Is system memory atomic access supported by this link.
+ */
+ CUPTI_LINK_FLAG_SYSMEM_ATOMICS = (1 << 4),
+
+ CUPTI_LINK_FLAG_FORCE_INT = 0x7fffffff
+} CUpti_LinkFlag;
+
+/**
+* \brief Memory operation types.
+*
+* Describes the type of memory operation, to be used with CUpti_ActivityMemory4.
+*/
+
+typedef enum {
+ /**
+ * The operation is invalid.
+ */
+ CUPTI_ACTIVITY_MEMORY_OPERATION_TYPE_INVALID = 0,
+
+ /**
+ * Memory is allocated.
+ */
+ CUPTI_ACTIVITY_MEMORY_OPERATION_TYPE_ALLOCATION = 1,
+
+ /**
+ * Memory is released.
+ */
+ CUPTI_ACTIVITY_MEMORY_OPERATION_TYPE_RELEASE = 2,
+
+ CUPTI_ACTIVITY_MEMORY_OPERATION_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_ActivityMemoryOperationType;
+
+/**
+* \brief Memory pool types.
+*
+* Describes the type of memory pool, to be used with CUpti_ActivityMemory4.
+*/
+
+typedef enum {
+ /**
+ * The operation is invalid.
+ */
+ CUPTI_ACTIVITY_MEMORY_POOL_TYPE_INVALID = 0,
+
+ /**
+ * Memory pool is local to the process.
+ */
+ CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL = 1,
+
+ /**
+ * Memory pool is imported by the process.
+ */
+ CUPTI_ACTIVITY_MEMORY_POOL_TYPE_IMPORTED = 2,
+
+ CUPTI_ACTIVITY_MEMORY_POOL_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_ActivityMemoryPoolType;
+
+/**
+* \brief Memory pool operation types.
+*
+* Describes the type of memory pool operation, to be used with CUpti_ActivityMemoryPool2.
+*/
+
+typedef enum {
+ /**
+ * The operation is invalid.
+ */
+ CUPTI_ACTIVITY_MEMORY_POOL_OPERATION_TYPE_INVALID = 0,
+
+ /**
+ * Memory pool is created.
+ */
+ CUPTI_ACTIVITY_MEMORY_POOL_OPERATION_TYPE_CREATED = 1,
+
+ /**
+ * Memory pool is destroyed.
+ */
+ CUPTI_ACTIVITY_MEMORY_POOL_OPERATION_TYPE_DESTROYED = 2,
+
+ /**
+ * Memory pool is trimmed.
+ */
+ CUPTI_ACTIVITY_MEMORY_POOL_OPERATION_TYPE_TRIMMED = 3,
+
+ CUPTI_ACTIVITY_MEMORY_POOL_OPERATION_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_ActivityMemoryPoolOperationType;
+
+typedef enum {
+ CUPTI_CHANNEL_TYPE_INVALID = 0,
+
+ /**
+ * Channel is used for standard work launch and tracking
+ */
+ CUPTI_CHANNEL_TYPE_COMPUTE = 1,
+
+ /**
+ * Channel is used by an asynchronous copy engine
+ * For confidential compute configurations, work launch and
+ * completion are done using the copy engines.
+ */
+ CUPTI_CHANNEL_TYPE_ASYNC_MEMCPY = 2,
+
+ CUPTI_CHANNEL_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_ChannelType;
+
+/**
+* \brief CIG (CUDA in Graphics) Modes.
+*
+* Describes the CIG modes associated with the CUDA context.
+*/
+
+typedef enum
+{
+ /**
+ * Regular (non-CIG) mode
+ */
+ CUPTI_CONTEXT_CIG_MODE_NONE = 0,
+ /**
+ * CIG mode
+ */
+ CUPTI_CONTEXT_CIG_MODE_CIG = 1,
+ /**
+ * CIG fallback mode
+ */
+ CUPTI_CONTEXT_CIG_MODE_CIG_FALLBACK = 2,
+
+ CUPTI_CONTEXT_CIG_MODE_FORCE_INT = 0x7fffffff
+} CUpti_ContextCigMode;
+
+/**
+ * The source-locator ID that indicates an unknown source
+ * location. There is not an actual CUpti_ActivitySourceLocator object
+ * corresponding to this value.
+ */
+#define CUPTI_SOURCE_LOCATOR_ID_UNKNOWN 0
+
+/**
+ * An invalid function index ID.
+ */
+#define CUPTI_FUNCTION_INDEX_ID_INVALID 0
+
+/**
+ * An invalid/unknown correlation ID. A correlation ID of this value
+ * indicates that there is no correlation for the activity record.
+ */
+#define CUPTI_CORRELATION_ID_UNKNOWN 0
+
+/**
+ * An invalid/unknown grid ID.
+ */
+#define CUPTI_GRID_ID_UNKNOWN 0LL
+
+/**
+ * An invalid/unknown timestamp for a start, end, queued, submitted,
+ * or completed time.
+ */
+#define CUPTI_TIMESTAMP_UNKNOWN 0LL
+
+/**
+ * An invalid/unknown value.
+ */
+#define CUPTI_SYNCHRONIZATION_INVALID_VALUE -1
+
+/**
+ * An invalid/unknown process id.
+ */
+#define CUPTI_AUTO_BOOST_INVALID_CLIENT_PID 0
+
+/**
+ * Invalid/unknown NVLink port number.
+*/
+#define CUPTI_NVLINK_INVALID_PORT -1
+
+/**
+ * Maximum NVLink port numbers.
+*/
+#define CUPTI_MAX_NVLINK_PORTS 32
+
+START_PACKED_ALIGNMENT
+/**
+ * \brief Unified Memory counters configuration structure
+ *
+ * This structure controls the enable/disable of the various
+ * Unified Memory counters consisting of scope, kind and other parameters.
+ * See function \ref cuptiActivityConfigureUnifiedMemoryCounter
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * Unified Memory counter Counter scope. (deprecated in CUDA 7.0)
+ */
+ CUpti_ActivityUnifiedMemoryCounterScope scope;
+
+ /**
+ * Unified Memory counter Counter kind
+ */
+ CUpti_ActivityUnifiedMemoryCounterKind kind;
+
+ /**
+ * Device id of the target device. This is relevant only
+ * for single device scopes. (deprecated in CUDA 7.0)
+ */
+ uint32_t deviceId;
+
+ /**
+ * Control to enable/disable the counter. To enable the counter
+ * set it to non-zero value while disable is indicated by zero.
+ */
+ uint32_t enable;
+} CUpti_ActivityUnifiedMemoryCounterConfig;
+
+/**
+ * \brief Device auto boost state structure
+ *
+ * This structure defines auto boost state for a device.
+ * See function \ref cuptiGetAutoBoostState
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * Returned auto boost state. 1 is returned in case auto boost is enabled, 0
+ * otherwise
+ */
+ uint32_t enabled;
+
+ /**
+ * Id of process that has set the current boost state. The value will be
+ * CUPTI_AUTO_BOOST_INVALID_CLIENT_PID if the user does not have the
+ * permission to query process ids or there is an error in querying the
+ * process id.
+ */
+ uint32_t pid;
+
+} CUpti_ActivityAutoBoostState;
+
+/**
+ * \brief PC sampling configuration structure
+ *
+ * This structure defines the pc sampling configuration.
+ *
+ * See function \ref cuptiActivityConfigurePCSampling
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * Size of configuration structure.
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ uint32_t size;
+
+ /**
+ * There are 5 level provided for sampling period. The level
+ * internally maps to a period in terms of cycles. Same level can
+ * map to different number of cycles on different gpus. No of
+ * cycles will be chosen to minimize information loss. The period
+ * chosen will be given by samplingPeriodInCycles in
+ * \ref CUpti_ActivityPCSamplingRecordInfo for each kernel instance.
+ */
+ CUpti_ActivityPCSamplingPeriod samplingPeriod;
+
+ /**
+ * This will override the period set by samplingPeriod. Value 0 in samplingPeriod2 will be
+ * considered as samplingPeriod2 should not be used and samplingPeriod should be used.
+ * Valid values for samplingPeriod2 are between 5 to 31 both inclusive.
+ * This will set the sampling period to (2^samplingPeriod2) cycles.
+ */
+ uint32_t samplingPeriod2;
+} CUpti_ActivityPCSamplingConfig;
+
+/**
+ * \brief The base activity record.
+ *
+ * The activity API uses a CUpti_Activity as a generic representation
+ * for any activity. The 'kind' field is used to determine the
+ * specific activity kind, and from that the CUpti_Activity object can
+ * be cast to the specific activity record type appropriate for that kind.
+ *
+ * Note that all activity record types are padded and aligned to
+ * ensure that each member of the record is naturally aligned.
+ *
+ * \see CUpti_ActivityKind
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The kind of this activity.
+ */
+ CUpti_ActivityKind kind;
+} CUpti_Activity;
+
+/**
+ * \brief The activity record for memory copies.
+ *
+ * This activity record represents a memory copy
+ * (CUPTI_ACTIVITY_KIND_MEMCPY).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMCPY.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of the memory copy, stored as a byte to reduce record
+ * size. \see CUpti_ActivityMemcpyKind
+ */
+ uint8_t copyKind;
+
+ /**
+ * The source memory kind read by the memory copy, stored as a byte
+ * to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t srcKind;
+
+ /**
+ * The destination memory kind read by the memory copy, stored as a
+ * byte to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t dstKind;
+
+ /**
+ * The flags associated with the memory copy. \see CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The number of bytes transferred by the memory copy.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory copy is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory copy is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory copy is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The correlation ID of the memory copy. Each memory copy is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver API activity record that launched
+ * the memory copy.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The runtime correlation ID of the memory copy. Each memory copy
+ * is assigned a unique runtime correlation ID that is identical to
+ * the correlation ID in the runtime API activity record that
+ * launched the memory copy.
+ */
+ uint32_t runtimeCorrelationId;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed this memcpy through graph launch.
+ * This field will be 0 if the memcpy is not done through graph launch.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The unique ID of the graph that executed this memcpy through graph launch.
+ * This field will be 0 if the memcpy is not done through graph launch.
+ */
+ uint32_t graphId;
+
+ /**
+ * The ID of the HW channel on which the memory copy is occurring.
+ */
+ uint32_t channelID;
+
+ /**
+ * The type of the channel
+ */
+ CUpti_ChannelType channelType;
+
+ /**
+ * Reserved for internal use.
+ */
+ uint32_t pad2;
+} CUpti_ActivityMemcpy5;
+
+/**
+ * \brief The activity record for peer-to-peer memory copies.
+ *
+ * This activity record represents a peer-to-peer memory copy
+ * (CUPTI_ACTIVITY_KIND_MEMCPY2).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMCPY2.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of the memory copy, stored as a byte to reduce record
+ * size. \see CUpti_ActivityMemcpyKind
+ */
+ uint8_t copyKind;
+
+ /**
+ * The source memory kind read by the memory copy, stored as a byte
+ * to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t srcKind;
+
+ /**
+ * The destination memory kind read by the memory copy, stored as a
+ * byte to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t dstKind;
+
+ /**
+ * The flags associated with the memory copy. \see
+ * CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The number of bytes transferred by the memory copy.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory copy is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory copy is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory copy is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The ID of the device where memory is being copied from.
+ */
+ uint32_t srcDeviceId;
+
+ /**
+ * The ID of the context owning the memory being copied from.
+ */
+ uint32_t srcContextId;
+
+ /**
+ * The ID of the device where memory is being copied to.
+ */
+ uint32_t dstDeviceId;
+
+ /**
+ * The ID of the context owning the memory being copied to.
+ */
+ uint32_t dstContextId;
+
+ /**
+ * The correlation ID of the memory copy. Each memory copy is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory copy.
+ */
+ uint32_t correlationId;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed the memcpy through graph launch.
+ * This field will be 0 if memcpy is not done using graph launch.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The unique ID of the graph that executed this memcpy through graph launch.
+ * This field will be 0 if the memcpy is not done through graph launch.
+ */
+ uint32_t graphId;
+
+ /**
+ * The ID of the HW channel on which the memory copy is occurring.
+ */
+ uint32_t channelID;
+
+ /**
+ * The type of the channel
+ */
+ CUpti_ChannelType channelType;
+} CUpti_ActivityMemcpyPtoP4;
+
+/**
+ * \brief The activity record for memset.
+ *
+ * This activity record represents a memory set operation
+ * (CUPTI_ACTIVITY_KIND_MEMSET).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMSET.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The value being assigned to memory by the memory set.
+ */
+ uint32_t value;
+
+ /**
+ * The number of bytes being set by the memory set.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory set, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory set.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory set, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory set.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory set is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory set is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory set is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The correlation ID of the memory set. Each memory set is assigned
+ * a unique correlation ID that is identical to the correlation ID
+ * in the driver API activity record that launched the memory set.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The flags associated with the memset. \see CUpti_ActivityFlag
+ */
+ uint16_t flags;
+
+ /**
+ * The memory kind of the memory set \see CUpti_ActivityMemoryKind
+ */
+ uint16_t memoryKind;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed this memset through graph launch.
+ * This field will be 0 if the memset is not executed through graph launch.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The unique ID of the graph that executed this memset through graph launch.
+ * This field will be 0 if the memset is not executed through graph launch.
+ */
+ uint32_t graphId;
+
+ /**
+ * The ID of the HW channel on which the memory set is occurring.
+ */
+ uint32_t channelID;
+
+ /**
+ * The type of the channel
+ */
+ CUpti_ChannelType channelType;
+
+ /**
+ * Undefined. Reserved for internal use
+ */
+ uint32_t pad2;
+} CUpti_ActivityMemset4;
+
+/**
+ * \brief The activity record for memory.
+ *
+ * This activity record represents a memory allocation and free operation
+ * (CUPTI_ACTIVITY_KIND_MEMORY).
+ * This activity record provides a single record for the memory
+ * allocation and memory release operations.
+ *
+ * Note: It is recommended to move to the new activity record \ref CUpti_ActivityMemory4
+ * enabled using the kind \ref CUPTI_ACTIVITY_KIND_MEMORY2.
+ * \ref CUpti_ActivityMemory4 provides separate records for memory
+ * allocation and memory release operations. This allows to correlate the
+ * corresponding driver and runtime API activity record with the memory operation.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMORY
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The memory kind requested by the user
+ */
+ CUpti_ActivityMemoryKind memoryKind;
+
+ /**
+ * The virtual address of the allocation
+ */
+ uint64_t address;
+
+ /**
+ * The number of bytes of memory allocated.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory operation, i.e.
+ * the time when memory was allocated, in ns.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory operation, i.e.
+ * the time when memory was freed, in ns.
+ * This will be 0 if memory is not freed in the application
+ */
+ uint64_t end;
+
+ /**
+ * The program counter of the allocation of memory
+ */
+ uint64_t allocPC;
+
+ /**
+ * The program counter of the freeing of memory. This will
+ * be 0 if memory is not freed in the application
+ */
+ uint64_t freePC;
+
+ /**
+ * The ID of the process to which this record belongs to.
+ */
+ uint32_t processId;
+
+ /**
+ * The ID of the device where the memory allocation is taking place.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context. If context is NULL, \p contextId is set to CUPTI_INVALID_CONTEXT_ID.
+ */
+ uint32_t contextId;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Variable name. This name is shared across all activity
+ * records representing the same symbol, and so should not be
+ * modified.
+ */
+ const char* name;
+} CUpti_ActivityMemory;
+
+/**
+ * \brief The activity record for memory.
+ *
+ * This activity record represents a memory allocation and free operation
+ * (CUPTI_ACTIVITY_KIND_MEMORY2).
+ * This activity record provides separate records for memory allocation and
+ * memory release operations.
+ * This allows to correlate the corresponding driver and runtime API
+ * activity record with the memory operation.
+ *
+ * Note: This activity record is an upgrade over \ref CUpti_ActivityMemory
+ * enabled using the kind \ref CUPTI_ACTIVITY_KIND_MEMORY.
+ * \ref CUpti_ActivityMemory provides a single record for the memory
+ * allocation and memory release operations.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMORY2
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The memory operation requested by the user, \ref CUpti_ActivityMemoryOperationType.
+ */
+ CUpti_ActivityMemoryOperationType memoryOperationType;
+
+ /**
+ * The memory kind requested by the user, \ref CUpti_ActivityMemoryKind.
+ */
+ CUpti_ActivityMemoryKind memoryKind;
+
+ /**
+ * The correlation ID of the memory operation. Each memory operation is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory operation.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The virtual address of the allocation.
+ */
+ uint64_t address;
+
+ /**
+ * The number of bytes of memory allocated.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory operation, in ns.
+ */
+ uint64_t timestamp;
+
+ /**
+ * The program counter of the memory operation.
+ */
+ uint64_t PC;
+
+ /**
+ * The ID of the process to which this record belongs to.
+ */
+ uint32_t processId;
+
+ /**
+ * The ID of the device where the memory operation is taking place.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context. If context is NULL, \p contextId is set to CUPTI_INVALID_CONTEXT_ID.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream. If memory operation is not async, \p streamId is set to CUPTI_INVALID_STREAM_ID.
+ */
+ uint32_t streamId;
+
+ /**
+ * Variable name. This name is shared across all activity
+ * records representing the same symbol, and so should not be
+ * modified.
+ */
+ const char* name;
+
+ /**
+ * \p isAsync is set if memory operation happens through async memory APIs.
+ */
+ uint32_t isAsync;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad1;
+#endif
+
+ /**
+ * The memory pool configuration used for the memory operations.
+ */
+ struct PACKED_ALIGNMENT {
+ /**
+ * The type of the memory pool, \ref CUpti_ActivityMemoryPoolType
+ */
+ CUpti_ActivityMemoryPoolType memoryPoolType;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad2;
+#endif
+
+ /**
+ * The base address of the memory pool.
+ */
+ uint64_t address;
+
+ /**
+ * The release threshold of the memory pool in bytes. \p releaseThreshold is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t releaseThreshold;
+
+ /**
+ * The size of memory pool in bytes and the processId of the memory pools
+ * \p size is valid if \p memoryPoolType is
+ * CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ * \p processId is valid if \p memoryPoolType is
+ * CUPTI_ACTIVITY_MEMORY_POOL_TYPE_IMPORTED, \ref CUpti_ActivityMemoryPoolType
+ */
+ union {
+ uint64_t size;
+ uint64_t processId;
+ } pool;
+
+ /**
+ * The utilized size of the memory pool. \p utilizedSize is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t utilizedSize;
+ } memoryPoolConfig;
+
+ /**
+ * The shared object or binary that the memory allocation request comes from.
+ */
+ const char* source;
+} CUpti_ActivityMemory4;
+
+/**
+ * \brief The activity record for memory pool.
+ *
+ * This activity record represents a memory pool creation, destruction and
+ * trimming (CUPTI_ACTIVITY_KIND_MEMORY_POOL).
+ * This activity record provides separate records for memory pool creation,
+ * destruction and trimming operations.
+ * This allows to correlate the corresponding driver and runtime API
+ * activity record with the memory pool operation.
+ *
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMORY_POOL
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The memory operation requested by the user, \ref CUpti_ActivityMemoryPoolOperationType.
+ */
+ CUpti_ActivityMemoryPoolOperationType memoryPoolOperationType;
+
+ /**
+ * The type of the memory pool, \ref CUpti_ActivityMemoryPoolType
+ */
+ CUpti_ActivityMemoryPoolType memoryPoolType;
+
+ /**
+ * The correlation ID of the memory pool operation. Each memory pool
+ * operation is assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory operation.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The ID of the process to which this record belongs to.
+ */
+ uint32_t processId;
+
+ /**
+ * The ID of the device where the memory pool is created.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The minimum bytes to keep of the memory pool. \p minBytesToKeep is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_OPERATION_TYPE_TRIMMED,
+ * \ref CUpti_ActivityMemoryPoolOperationType
+ */
+ size_t minBytesToKeep;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The virtual address of the allocation.
+ */
+ uint64_t address;
+
+ /**
+ * The size of the memory pool operation in bytes. \p size is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t size;
+
+ /**
+ * The release threshold of the memory pool. \p releaseThreshold is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t releaseThreshold;
+
+ /**
+ * The start timestamp for the memory operation, in ns.
+ */
+ uint64_t timestamp;
+
+ /**
+ * The utilized size of the memory pool. \p utilizedSize is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t utilizedSize;
+} CUpti_ActivityMemoryPool2;
+
+/**
+ * \brief The type of the CUDA kernel launch.
+ */
+typedef enum {
+ /**
+ * The kernel was launched via a regular kernel call
+ */
+ CUPTI_ACTIVITY_LAUNCH_TYPE_REGULAR = 0,
+
+ /**
+ * The kernel was launched via API \ref cudaLaunchCooperativeKernel() or
+ * \ref cuLaunchCooperativeKernel()
+ */
+ CUPTI_ACTIVITY_LAUNCH_TYPE_COOPERATIVE_SINGLE_DEVICE = 1,
+
+ /**
+ * The kernel was launched via API \ref cudaLaunchCooperativeKernelMultiDevice() or
+ * \ref cuLaunchCooperativeKernelMultiDevice()
+ */
+ CUPTI_ACTIVITY_LAUNCH_TYPE_COOPERATIVE_MULTI_DEVICE = 2,
+
+ /**
+ * The kernel was launched as a CBL commandlist
+ */
+ CUPTI_ACTIVITY_LAUNCH_TYPE_CBL_COMMANDLIST = 3,
+} CUpti_ActivityLaunchType;
+
+/**
+ * \brief The shared memory limit per block config for a kernel
+ * This should be used to set 'cudaOccFuncShmemConfig' field in occupancy calculator API
+ */
+typedef enum {
+ /** The shared memory limit config is default
+ */
+ CUPTI_FUNC_SHMEM_LIMIT_DEFAULT = 0x00,
+
+ /** User has opted for a higher dynamic shared memory limit using function attribute
+ * 'cudaFuncAttributeMaxDynamicSharedMemorySize' for runtime API or
+ * CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES for driver API
+ */
+ CUPTI_FUNC_SHMEM_LIMIT_OPTIN = 0x01,
+
+ CUPTI_FUNC_SHMEM_LIMIT_FORCE_INT = 0x7fffffff
+} CUpti_FuncShmemLimitConfig;
+
+/**
+ * \brief The activity record for kernel.
+ *
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL)
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL or
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * For devices with compute capability 7.0+ cacheConfig values are not updated
+ * in case field isSharedMemoryCarveoutRequested is set
+ */
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The partitioned global caching requested for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheRequested;
+
+ /**
+ * The partitioned global caching executed for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2. Partitioned global caching can be
+ * automatically disabled if the occupancy requirement of the launch cannot
+ * support caching.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheExecuted;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The completed timestamp for the kernel execution, in ns. It
+ * represents the completion of all it's child kernels and the
+ * kernel itself. A value of CUPTI_TIMESTAMP_UNKNOWN indicates that
+ * the completion time is unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes (deprecated in CUDA 11.8).
+ * Refer field localMemoryTotal_v2
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel is assigned a unique
+ * grid ID at runtime.
+ */
+ int64_t gridId;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The timestamp when the kernel is queued up in the command buffer, in ns.
+ * A value of CUPTI_TIMESTAMP_UNKNOWN indicates that the queued time
+ * could not be collected for the kernel. This timestamp is not collected
+ * by default. Use API \ref cuptiActivityEnableLatencyTimestamps() to
+ * enable collection.
+ *
+ * Command buffer is a buffer written by CUDA driver to send commands
+ * like kernel launch, memory copy etc to the GPU. All launches of CUDA
+ * kernels are asynchronous with respect to the host, the host requests
+ * the launch by writing commands into the command buffer, then returns
+ * without checking the GPU's progress.
+ */
+ uint64_t queued;
+
+ /**
+ * The timestamp when the command buffer containing the kernel launch
+ * is submitted to the GPU, in ns. A value of CUPTI_TIMESTAMP_UNKNOWN
+ * indicates that the submitted time could not be collected for the kernel.
+ * This timestamp is not collected by default. Use API \ref
+ * cuptiActivityEnableLatencyTimestamps() to enable collection.
+ */
+ uint64_t submitted;
+
+ /**
+ * The indicates if the kernel was executed via a regular launch or via a
+ * single/multi device cooperative launch. \see CUpti_ActivityLaunchType
+ */
+ uint8_t launchType;
+
+ /**
+ * This indicates if CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT was
+ * updated for the kernel launch
+ */
+ uint8_t isSharedMemoryCarveoutRequested;
+
+ /**
+ * Shared memory carveout value requested for the function in percentage of
+ * the total resource. The value will be updated only if field
+ * isSharedMemoryCarveoutRequested is set.
+ */
+ uint8_t sharedMemoryCarveoutRequested;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint8_t padding;
+
+ /**
+ * Shared memory size set by the driver.
+ */
+ uint32_t sharedMemoryExecuted;
+
+ /**
+ * The unique ID of the graph node that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The shared memory limit config for the kernel. This field shows whether user has opted for a
+ * higher per block limit of dynamic shared memory.
+ */
+ CUpti_FuncShmemLimitConfig shmemLimitConfig;
+
+ /**
+ * The unique ID of the graph that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint32_t graphId;
+
+ /**
+ * The pointer to the access policy window. The structure CUaccessPolicyWindow is
+ * defined in cuda.h.
+ */
+ CUaccessPolicyWindow *pAccessPolicyWindow;
+
+ /**
+ * The ID of the HW channel on which the kernel is launched.
+ */
+ uint32_t channelID;
+
+ /**
+ * The type of the channel
+ */
+ CUpti_ChannelType channelType;
+
+ /**
+ * The X-dimension cluster size for the kernel.
+ * Field is valid for devices with compute capability 9.0 and higher
+ */
+ uint32_t clusterX;
+
+ /**
+ * The Y-dimension cluster size for the kernel.
+ * Field is valid for devices with compute capability 9.0 and higher
+ */
+ uint32_t clusterY;
+
+ /**
+ * The Z-dimension cluster size for the kernel.
+ * Field is valid for devices with compute capability 9.0 and higher
+ */
+ uint32_t clusterZ;
+
+ /**
+ * The cluster scheduling policy for the kernel. Refer CUclusterSchedulingPolicy
+ * Field is valid for devices with compute capability 9.0 and higher
+ */
+ uint32_t clusterSchedulingPolicy;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint64_t localMemoryTotal_v2;
+
+ /**
+ * The maximum cluster size for the kernel
+ */
+ uint32_t maxPotentialClusterSize;
+
+ /**
+ * The maximum clusters that could co-exist on the target device for the kernel
+ */
+ uint32_t maxActiveClusters;
+} CUpti_ActivityKernel9;
+
+/**
+ * \brief The activity record for CDP (CUDA Dynamic Parallelism)
+ * kernel.
+ *
+ * This activity record represents a CDP kernel execution.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_CDP_KERNEL
+ */
+ CUpti_ActivityKind kind;
+
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver API activity record that launched
+ * the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel execution
+ * is assigned a unique grid ID.
+ */
+ int64_t gridId;
+
+ /**
+ * The grid ID of the parent kernel.
+ */
+ int64_t parentGridId;
+
+ /**
+ * The timestamp when kernel is queued up, in ns. A value of
+ * CUPTI_TIMESTAMP_UNKNOWN indicates that the queued time is
+ * unknown.
+ */
+ uint64_t queued;
+
+ /**
+ * The timestamp when kernel is submitted to the gpu, in ns. A value
+ * of CUPTI_TIMESTAMP_UNKNOWN indicates that the submission time is
+ * unknown.
+ */
+ uint64_t submitted;
+
+ /**
+ * The timestamp when kernel is marked as completed, in ns. A value
+ * of CUPTI_TIMESTAMP_UNKNOWN indicates that the completion time is
+ * unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The X-dimension of the parent block.
+ */
+ uint32_t parentBlockX;
+
+ /**
+ * The Y-dimension of the parent block.
+ */
+ uint32_t parentBlockY;
+
+ /**
+ * The Z-dimension of the parent block.
+ */
+ uint32_t parentBlockZ;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+} CUpti_ActivityCdpKernel;
+
+/**
+ * \brief The activity record for a preemption of a CDP kernel.
+ *
+ * This activity record represents a preemption of a CDP kernel.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_PREEMPTION
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * kind of the preemption
+ */
+ CUpti_ActivityPreemptionKind preemptionKind;
+
+ /**
+ * The timestamp of the preemption, in ns. A value of 0 indicates
+ * that timestamp information could not be collected for the
+ * preemption.
+ */
+ uint64_t timestamp;
+
+ /**
+ * The grid-id of the block that is preempted
+ */
+ int64_t gridId;
+
+ /**
+ * The X-dimension of the block that is preempted
+ */
+ uint32_t blockX;
+
+ /**
+ * The Y-dimension of the block that is preempted
+ */
+ uint32_t blockY;
+
+ /**
+ * The Z-dimension of the block that is preempted
+ */
+ uint32_t blockZ;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityPreemption;
+
+/**
+ * \brief The activity record for a driver or runtime API invocation.
+ *
+ * This activity record represents an invocation of a driver or
+ * runtime API (CUPTI_ACTIVITY_KIND_DRIVER and
+ * CUPTI_ACTIVITY_KIND_RUNTIME).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_DRIVER,
+ * CUPTI_ACTIVITY_KIND_RUNTIME, or CUPTI_ACTIVITY_KIND_INTERNAL_LAUNCH_API.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The ID of the driver or runtime function.
+ */
+ CUpti_CallbackId cbid;
+
+ /**
+ * The start timestamp for the function, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the function.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the function, in ns. A value of 0 for both
+ * the start and end timestamps indicates that timestamp information
+ * could not be collected for the function.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the process where the driver or runtime CUDA function
+ * is executing.
+ */
+ uint32_t processId;
+
+ /**
+ * The ID of the thread where the driver or runtime CUDA function is
+ * executing.
+ */
+ uint32_t threadId;
+
+ /**
+ * The correlation ID of the driver or runtime CUDA function. Each
+ * function invocation is assigned a unique correlation ID that is
+ * identical to the correlation ID in the memcpy, memset, or kernel
+ * activity record that is associated with this function.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The return value for the function. For a CUDA driver function
+ * with will be a CUresult value, and for a CUDA runtime function
+ * this will be a cudaError_t value.
+ */
+ uint32_t returnValue;
+} CUpti_ActivityAPI;
+
+/**
+ * \brief The activity record for a CUPTI event.
+ *
+ * This activity record represents a CUPTI event value
+ * (CUPTI_ACTIVITY_KIND_EVENT). This activity record kind is not
+ * produced by the activity API but is included for completeness and
+ * ease-of-use. Profile frameworks built on top of CUPTI that collect
+ * event data may choose to use this type to store the collected event
+ * data.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_EVENT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The event ID.
+ */
+ CUpti_EventID id;
+
+ /**
+ * The event value.
+ */
+ uint64_t value;
+
+ /**
+ * The event domain ID.
+ */
+ CUpti_EventDomainID domain;
+
+ /**
+ * The correlation ID of the event. Use of this ID is user-defined,
+ * but typically this ID value will equal the correlation ID of the
+ * kernel for which the event was gathered.
+ */
+ uint32_t correlationId;
+} CUpti_ActivityEvent;
+
+/**
+ * \brief The activity record for a CUPTI event with instance
+ * information.
+ *
+ * This activity record represents the a CUPTI event value for a
+ * specific event domain instance
+ * (CUPTI_ACTIVITY_KIND_EVENT_INSTANCE). This activity record kind is
+ * not produced by the activity API but is included for completeness
+ * and ease-of-use. Profile frameworks built on top of CUPTI that
+ * collect event data may choose to use this type to store the
+ * collected event data. This activity record should be used when
+ * event domain instance information needs to be associated with the
+ * event.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be
+ * CUPTI_ACTIVITY_KIND_EVENT_INSTANCE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The event ID.
+ */
+ CUpti_EventID id;
+
+ /**
+ * The event domain ID.
+ */
+ CUpti_EventDomainID domain;
+
+ /**
+ * The event domain instance.
+ */
+ uint32_t instance;
+
+ /**
+ * The event value.
+ */
+ uint64_t value;
+
+ /**
+ * The correlation ID of the event. Use of this ID is user-defined,
+ * but typically this ID value will equal the correlation ID of the
+ * kernel for which the event was gathered.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityEventInstance;
+
+/**
+ * \brief The activity record for a CUPTI metric.
+ *
+ * This activity record represents the collection of a CUPTI metric
+ * value (CUPTI_ACTIVITY_KIND_METRIC). This activity record kind is not
+ * produced by the activity API but is included for completeness and
+ * ease-of-use. Profile frameworks built on top of CUPTI that collect
+ * metric data may choose to use this type to store the collected metric
+ * data.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_METRIC.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The metric ID.
+ */
+ CUpti_MetricID id;
+
+ /**
+ * The metric value.
+ */
+ CUpti_MetricValue value;
+
+ /**
+ * The correlation ID of the metric. Use of this ID is user-defined,
+ * but typically this ID value will equal the correlation ID of the
+ * kernel for which the metric was gathered.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The properties of this metric. \see CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint8_t pad[3];
+} CUpti_ActivityMetric;
+
+/**
+ * \brief The activity record for a CUPTI metric with instance
+ * information.
+ *
+ * This activity record represents a CUPTI metric value
+ * for a specific metric domain instance
+ * (CUPTI_ACTIVITY_KIND_METRIC_INSTANCE). This activity record kind
+ * is not produced by the activity API but is included for
+ * completeness and ease-of-use. Profile frameworks built on top of
+ * CUPTI that collect metric data may choose to use this type to store
+ * the collected metric data. This activity record should be used when
+ * metric domain instance information needs to be associated with the
+ * metric.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be
+ * CUPTI_ACTIVITY_KIND_METRIC_INSTANCE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The metric ID.
+ */
+ CUpti_MetricID id;
+
+ /**
+ * The metric value.
+ */
+ CUpti_MetricValue value;
+
+ /**
+ * The metric domain instance.
+ */
+ uint32_t instance;
+
+ /**
+ * The correlation ID of the metric. Use of this ID is user-defined,
+ * but typically this ID value will equal the correlation ID of the
+ * kernel for which the metric was gathered.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The properties of this metric. \see CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint8_t pad[7];
+} CUpti_ActivityMetricInstance;
+
+/**
+ * \brief The activity record for source locator.
+ *
+ * This activity record represents a source locator
+ * (CUPTI_ACTIVITY_KIND_SOURCE_LOCATOR).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_SOURCE_LOCATOR.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The ID for the source path, will be used in all the source level
+ * results.
+ */
+ uint32_t id;
+
+ /**
+ * The line number in the source .
+ */
+ uint32_t lineNumber;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The path for the file.
+ */
+ const char *fileName;
+} CUpti_ActivitySourceLocator;
+
+/**
+ * \brief The activity record for source-level global
+ * access.
+ *
+ * This activity records the locations of the global
+ * accesses in the source (CUPTI_ACTIVITY_KIND_GLOBAL_ACCESS).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_GLOBAL_ACCESS.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this global access.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * The number of times this instruction was executed per warp. It will be incremented
+ * when at least one of thread among warp is active with predicate and condition code
+ * evaluating to true.
+ */
+ uint32_t executed;
+
+ /**
+ * The pc offset for the access.
+ */
+ uint64_t pcOffset;
+
+ /**
+ * This increments each time when this instruction is executed by number of
+ * threads that executed this instruction with predicate and condition code
+ * evaluating to true.
+ */
+ uint64_t threadsExecuted;
+
+ /**
+ * The total number of 32 bytes transactions to L2 cache generated by this
+ access
+ */
+ uint64_t l2_transactions;
+
+ /**
+ * The minimum number of L2 transactions possible based on the access pattern.
+ */
+ uint64_t theoreticalL2Transactions;
+} CUpti_ActivityGlobalAccess3;
+
+/**
+ * \brief The activity record for source level result
+ * branch.
+ *
+ * This activity record the locations of the branches in the
+ * source (CUPTI_ACTIVITY_KIND_BRANCH).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_BRANCH.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * The pc offset for the branch.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * Number of times this branch diverged
+ */
+ uint32_t diverged;
+
+ /**
+ * This increments each time when this instruction is executed by number
+ * of threads that executed this instruction
+ */
+ uint64_t threadsExecuted;
+
+ /**
+ * The number of times this instruction was executed per warp. It will be incremented
+ * regardless of predicate or condition code.
+ */
+ uint32_t executed;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityBranch2;
+
+/**
+ * \brief The activity record for a device. (CUDA 11.6 onwards)
+ *
+ * This activity record represents information about a GPU device
+ * (CUPTI_ACTIVITY_KIND_DEVICE).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_DEVICE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the device. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The global memory bandwidth available on the device, in
+ * kBytes/sec.
+ */
+ uint64_t globalMemoryBandwidth;
+
+ /**
+ * The amount of global memory on the device, in bytes.
+ */
+ uint64_t globalMemorySize;
+
+ /**
+ * The amount of constant memory on the device, in bytes.
+ */
+ uint32_t constantMemorySize;
+
+ /**
+ * The size of the L2 cache on the device, in bytes.
+ */
+ uint32_t l2CacheSize;
+
+ /**
+ * The number of threads per warp on the device.
+ */
+ uint32_t numThreadsPerWarp;
+
+ /**
+ * The core clock rate of the device, in kHz.
+ */
+ uint32_t coreClockRate;
+
+ /**
+ * Number of memory copy engines on the device.
+ */
+ uint32_t numMemcpyEngines;
+
+ /**
+ * Number of multiprocessors on the device.
+ */
+ uint32_t numMultiprocessors;
+
+ /**
+ * The maximum "instructions per cycle" possible on each device
+ * multiprocessor.
+ */
+ uint32_t maxIPC;
+
+ /**
+ * Maximum number of warps that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxWarpsPerMultiprocessor;
+
+ /**
+ * Maximum number of blocks that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxBlocksPerMultiprocessor;
+
+ /**
+ * Maximum amount of shared memory available per multiprocessor, in bytes.
+ */
+ uint32_t maxSharedMemoryPerMultiprocessor;
+
+ /**
+ * Maximum number of 32-bit registers available per multiprocessor.
+ */
+ uint32_t maxRegistersPerMultiprocessor;
+
+ /**
+ * Maximum number of registers that can be allocated to a block.
+ */
+ uint32_t maxRegistersPerBlock;
+
+ /**
+ * Maximum amount of shared memory that can be assigned to a block,
+ * in bytes.
+ */
+ uint32_t maxSharedMemoryPerBlock;
+
+ /**
+ * Maximum number of threads allowed in a block.
+ */
+ uint32_t maxThreadsPerBlock;
+
+ /**
+ * Maximum allowed X dimension for a block.
+ */
+ uint32_t maxBlockDimX;
+
+ /**
+ * Maximum allowed Y dimension for a block.
+ */
+ uint32_t maxBlockDimY;
+
+ /**
+ * Maximum allowed Z dimension for a block.
+ */
+ uint32_t maxBlockDimZ;
+
+ /**
+ * Maximum allowed X dimension for a grid.
+ */
+ uint32_t maxGridDimX;
+
+ /**
+ * Maximum allowed Y dimension for a grid.
+ */
+ uint32_t maxGridDimY;
+
+ /**
+ * Maximum allowed Z dimension for a grid.
+ */
+ uint32_t maxGridDimZ;
+
+ /**
+ * Compute capability for the device, major number.
+ */
+ uint32_t computeCapabilityMajor;
+
+ /**
+ * Compute capability for the device, minor number.
+ */
+ uint32_t computeCapabilityMinor;
+
+ /**
+ * The device ID.
+ */
+ uint32_t id;
+
+ /**
+ * ECC enabled flag for device
+ */
+ uint32_t eccEnabled;
+
+ /**
+ * The device UUID. This value is the globally unique immutable
+ * alphanumeric identifier of the device.
+ */
+ CUuuid uuid;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The device name. This name is shared across all activity records
+ * representing instances of the device, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Flag to indicate whether the device is visible to CUDA. Users can
+ * set the device visibility using CUDA_VISIBLE_DEVICES environment
+ */
+ uint8_t isCudaVisible;
+
+ /**
+ * MIG enabled flag for device
+ */
+ uint8_t isMigEnabled;
+
+ uint8_t reserved[6];
+
+ /**
+ * GPU Instance id for MIG enabled devices.
+ * If mig mode is disabled value is set to UINT32_MAX
+ */
+ uint32_t gpuInstanceId;
+
+ /**
+ * Compute Instance id for MIG enabled devices.
+ * If mig mode is disabled value is set to UINT32_MAX
+ */
+ uint32_t computeInstanceId;
+
+ /**
+ * The MIG UUID. This value is the globally unique immutable
+ * alphanumeric identifier of the device.
+ */
+ CUuuid migUuid;
+
+ /**
+ * Numa (Non-uniform memory access) information for device
+ * GPU is a NUMA node or not
+ */
+ uint32_t isNumaNode;
+
+ /**
+ * Numa (Non-uniform memory access) information for device
+ * NUMA node ID of the GPU memory
+ * if GPU is not a NUMA node, it returns invalidNumaId
+ */
+ uint32_t numaId;
+} CUpti_ActivityDevice5;
+
+/**
+ * \brief The activity record for a device attribute.
+ *
+ * This activity record represents information about a GPU device:
+ * either a CUpti_DeviceAttribute or CUdevice_attribute value
+ * (CUPTI_ACTIVITY_KIND_DEVICE_ATTRIBUTE).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be
+ * CUPTI_ACTIVITY_KIND_DEVICE_ATTRIBUTE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the device. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID of the device that this attribute applies to.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The attribute, either a CUpti_DeviceAttribute or
+ * CUdevice_attribute. Flag
+ * CUPTI_ACTIVITY_FLAG_DEVICE_ATTRIBUTE_CUDEVICE is used to indicate
+ * what kind of attribute this is. If
+ * CUPTI_ACTIVITY_FLAG_DEVICE_ATTRIBUTE_CUDEVICE is 1 then
+ * CUdevice_attribute field is value, otherwise
+ * CUpti_DeviceAttribute field is valid.
+ */
+ union {
+ CUdevice_attribute cu;
+ CUpti_DeviceAttribute cupti;
+ } attribute;
+
+ /**
+ * The value for the attribute. See CUpti_DeviceAttribute and
+ * CUdevice_attribute for the type of the value for a given
+ * attribute.
+ */
+ union {
+ double vDouble;
+ uint32_t vUint32;
+ uint64_t vUint64;
+ int32_t vInt32;
+ int64_t vInt64;
+ } value;
+} CUpti_ActivityDeviceAttribute;
+
+/**
+ * \brief The activity record for a context.
+ *
+ * This activity record represents information about a context
+ * (CUPTI_ACTIVITY_KIND_CONTEXT).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_CONTEXT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The context ID.
+ */
+ uint32_t contextId;
+
+ /**
+ * The device ID.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The compute API kind. \see CUpti_ActivityComputeApiKind
+ */
+ uint16_t computeApiKind;
+
+ /**
+ * The ID for the NULL stream in this context
+ */
+ uint16_t nullStreamId;
+
+ /**
+ * The ID of the parent context. It would be 0 if
+ * context does not have parent
+ */
+ uint32_t parentContextId;
+
+ /**
+ * This field indicates whether the context is a green context
+ */
+ uint8_t isGreenContext;
+
+ uint8_t padding;
+
+ /**
+ * Number of multiprocessors assigned to the green context
+ * Invalid if the field 'isGreenContext' is 0
+ */
+ uint16_t numMultiprocessors;
+
+ /**
+ * This field indicates the CIG mode
+ */
+ CUpti_ContextCigMode cigMode;
+
+ uint32_t padding2;
+
+} CUpti_ActivityContext3;
+
+/**
+ * \brief The activity record providing a name.
+ *
+ * This activity record provides a name for a device, context, thread,
+ * etc. and other resource naming done via NVTX APIs
+ * (CUPTI_ACTIVITY_KIND_NAME).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_NAME.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of activity object being named.
+ */
+ CUpti_ActivityObjectKind objectKind;
+
+ /**
+ * The identifier for the activity object. 'objectKind' indicates
+ * which ID is valid for this record.
+ */
+ CUpti_ActivityObjectKindId objectId;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The name.
+ */
+ const char *name;
+
+} CUpti_ActivityName;
+
+/**
+ * \brief The activity record providing a marker which is an
+ * instantaneous point in time.
+ *
+ * The marker is specified with a descriptive name and unique id
+ * (CUPTI_ACTIVITY_KIND_MARKER).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the marker. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The timestamp for the marker, in ns. A value of 0 indicates that
+ * timestamp information could not be collected for the marker.
+ */
+ uint64_t timestamp;
+
+ /**
+ * The marker ID.
+ */
+ uint32_t id;
+
+ /**
+ * The kind of activity object associated with this marker.
+ */
+ CUpti_ActivityObjectKind objectKind;
+
+ /**
+ * The identifier for the activity object associated with this
+ * marker. 'objectKind' indicates which ID is valid for this record.
+ */
+ CUpti_ActivityObjectKindId objectId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+
+
+ /**
+ * The marker name for an instantaneous or start marker. This will
+ * be NULL for an end marker.
+ */
+ const char *name;
+
+ /**
+ * The name of the domain to which this marker belongs to.
+ * This will be NULL for default domain.
+ */
+ const char *domain;
+
+} CUpti_ActivityMarker2;
+
+/**
+ * \brief The activity record providing detailed information for a marker.
+ *
+ * User must enable CUPTI_ACTIVITY_KIND_MARKER as well
+ * to get records for marker data.
+ * The marker data contains color, payload, and category.
+ * (CUPTI_ACTIVITY_KIND_MARKER_DATA).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be
+ * CUPTI_ACTIVITY_KIND_MARKER_DATA.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the marker. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The marker ID.
+ */
+ uint32_t id;
+
+ /**
+ * Defines the payload format for the value associated with the marker.
+ */
+ CUpti_MetricValueKind payloadKind;
+
+ /**
+ * The payload value.
+ */
+ CUpti_MetricValue payload;
+
+ /**
+ * The color for the marker.
+ */
+ uint32_t color;
+
+ /**
+ * The category for the marker.
+ */
+ uint32_t category;
+
+} CUpti_ActivityMarkerData;
+
+/**
+ * \brief The activity record for CUPTI and driver overheads.
+ *
+ * This activity record provides CUPTI and driver overhead information
+ * (CUPTI_ACTIVITY_OVERHEAD).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_OVERHEAD.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of overhead, CUPTI, DRIVER, COMPILER etc.
+ */
+ CUpti_ActivityOverheadKind overheadKind;
+
+ /**
+ * The kind of activity object that the overhead is associated with.
+ */
+ CUpti_ActivityObjectKind objectKind;
+
+ /**
+ * The identifier for the activity object. 'objectKind' indicates
+ * which ID is valid for this record.
+ */
+ CUpti_ActivityObjectKindId objectId;
+
+ /**
+ * The start timestamp for the overhead, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the overhead.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the overhead, in ns. A value of 0 for both
+ * the start and end timestamps indicates that timestamp information
+ * could not be collected for the overhead.
+ */
+ uint64_t end;
+
+ /**
+ * The correlation ID of the overhead operation to which
+ * records belong to. This ID is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the overhead operation.
+ * In some cases, it can be zero, such as for CUPTI_ACTIVITY_OVERHEAD_CUPTI_BUFFER_FLUSH records.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Reserved for internal use.
+ */
+ uint32_t reserved0;
+
+ /**
+ * Pointer to the struct with additional details about the overhead.
+ * Refer CUpti_ActivityOverheadKind enum and the corresponding structure to typecast and access additional overhead data.
+ * Client is responsible for freeing this memory using the free function when done.
+ */
+ void *overheadData;
+
+} CUpti_ActivityOverhead3;
+
+/**
+ * \brief The activity record for CUPTI environmental data.
+ *
+ * This activity record provides CUPTI environmental data, include
+ * power, clocks, and thermals. This information is sampled at
+ * various rates and returned in this activity record. The consumer
+ * of the record needs to check the environmentKind field to figure
+ * out what kind of environmental record this is.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_ENVIRONMENT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The ID of the device
+ */
+ uint32_t deviceId;
+
+ /**
+ * The timestamp when this sample was retrieved, in ns. A value of 0
+ * indicates that timestamp information could not be collected for
+ * the marker.
+ */
+ uint64_t timestamp;
+
+ /**
+ * The kind of data reported in this record.
+ */
+ CUpti_ActivityEnvironmentKind environmentKind;
+
+ union {
+ /**
+ * Data returned for CUPTI_ACTIVITY_ENVIRONMENT_SPEED environment
+ * kind.
+ */
+ struct {
+ /**
+ * The SM frequency in MHz
+ */
+ uint32_t smClock;
+
+ /**
+ * The memory frequency in MHz
+ */
+ uint32_t memoryClock;
+
+ /**
+ * The PCIe link generation.
+ */
+ uint32_t pcieLinkGen;
+
+ /**
+ * The PCIe link width.
+ */
+ uint32_t pcieLinkWidth;
+
+ /**
+ * The clocks throttle reasons.
+ */
+ CUpti_EnvironmentClocksThrottleReason clocksThrottleReasons;
+ } speed;
+
+ /**
+ * Data returned for CUPTI_ACTIVITY_ENVIRONMENT_TEMPERATURE
+ * environment kind.
+ */
+ struct {
+ /**
+ * The GPU temperature in degrees C.
+ */
+ uint32_t gpuTemperature;
+ } temperature;
+
+ /**
+ * Data returned for CUPTI_ACTIVITY_ENVIRONMENT_POWER environment kind.
+ * The power in milliwatts consumed by GPU and associated circuitry.
+ * The power in milliwatts that will trigger power management algorithm.
+ */
+ struct {
+
+ uint32_t power;
+ uint32_t powerLimit;
+ } power;
+
+ /**
+ * Data returned for CUPTI_ACTIVITY_ENVIRONMENT_COOLING
+ * environment kind.
+ */
+ struct {
+ /**
+ * The fan speed as percentage of maximum.
+ */
+ uint32_t fanSpeed;
+ } cooling;
+ } data;
+} CUpti_ActivityEnvironment;
+
+/**
+ * \brief The activity record for source-level instruction execution.
+ *
+ * This activity records result for source level instruction execution.
+ * (CUPTI_ACTIVITY_KIND_INSTRUCTION_EXECUTION).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_INSTRUCTION_EXECUTION.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this instruction execution.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * The pc offset for the instruction.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * This increments each time when this instruction is executed by number
+ * of threads that executed this instruction, regardless of predicate or condition code.
+ */
+ uint64_t threadsExecuted;
+
+ /**
+ * This increments each time when this instruction is executed by number
+ * of threads that executed this instruction with predicate and condition code evaluating to true.
+ */
+ uint64_t notPredOffThreadsExecuted;
+
+ /**
+ * The number of times this instruction was executed per warp. It will be incremented
+ * regardless of predicate or condition code.
+ */
+ uint32_t executed;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityInstructionExecution;
+
+/**
+ * \brief The activity record for PC sampling.
+ *
+ * This activity records information obtained by sampling PC
+ * (CUPTI_ACTIVITY_KIND_PC_SAMPLING).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_PC_SAMPLING.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this instruction.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * Number of times the PC was sampled with the stallReason in the record.
+ * These samples indicate that no instruction was issued in that cycle from
+ * the warp scheduler from where the warp was sampled.
+ * Field is valid for devices with compute capability 6.0 and higher
+ */
+ uint32_t latencySamples;
+
+ /**
+ * Number of times the PC was sampled with the stallReason in the record.
+ * The same PC can be sampled with different stall reasons. The count includes
+ * latencySamples.
+ */
+ uint32_t samples;
+
+ /**
+ * Current stall reason. Includes one of the reasons from
+ * \ref CUpti_ActivityPCSamplingStallReason
+ */
+ CUpti_ActivityPCSamplingStallReason stallReason;
+
+ /**
+ * The pc offset for the instruction.
+ */
+ uint64_t pcOffset;
+} CUpti_ActivityPCSampling3;
+
+/**
+ * \brief The activity record for record status for PC sampling.
+ *
+ * This activity records information obtained by sampling PC
+ * (CUPTI_ACTIVITY_KIND_PC_SAMPLING_RECORD_INFO).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_PC_SAMPLING_RECORD_INFO.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Number of times the PC was sampled for this kernel instance including all
+ * dropped samples.
+ */
+ uint64_t totalSamples;
+
+ /**
+ * Number of samples that were dropped by hardware due to backpressure/overflow.
+ */
+ uint64_t droppedSamples;
+ /**
+ * Sampling period in terms of number of cycles .
+ */
+ uint64_t samplingPeriodInCycles;
+} CUpti_ActivityPCSamplingRecordInfo;
+
+/**
+ * \brief The activity record for Unified Memory counters (CUDA 7.0 and beyond)
+ *
+ * This activity record represents a Unified Memory counter
+ * (CUPTI_ACTIVITY_KIND_UNIFIED_MEMORY_COUNTER).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_UNIFIED_MEMORY_COUNTER
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The Unified Memory counter kind
+ */
+ CUpti_ActivityUnifiedMemoryCounterKind counterKind;
+
+ /**
+ * Value of the counter
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD,
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_DTOH,
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THREASHING and
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_REMOTE_MAP, it is the size of the
+ * memory region in bytes.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT, it
+ * is the number of page fault groups for the same page.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT,
+ * it is the program counter for the instruction that caused fault.
+ */
+ uint64_t value;
+
+ /**
+ * The start timestamp of the counter, in ns.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD and
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_DTOH, timestamp is
+ * captured when activity starts on GPU.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT and
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT, timestamp is
+ * captured when CUDA driver started processing the fault.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THRASHING, timestamp
+ * is captured when CUDA driver detected thrashing of memory region.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THROTTLING,
+ * timestamp is captured when throttling operation was started by CUDA driver.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_REMOTE_MAP,
+ * timestamp is captured when CUDA driver has pushed all required operations
+ * to the processor specified by dstId.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp of the counter, in ns.
+ * Ignore this field if counterKind is
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT or
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THRASHING or
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_REMOTE_MAP.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD and
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_DTOH, timestamp is
+ * captured when activity finishes on GPU.
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT, timestamp is
+ * captured when CUDA driver queues the replay of faulting memory accesses on the GPU
+ * For counterKind CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THROTTLING, timestamp
+ * is captured when throttling operation was finished by CUDA driver
+ */
+ uint64_t end;
+
+ /**
+ * This is the virtual base address of the page/s being transferred. For cpu and
+ * gpu faults, the virtual address for the page that faulted.
+ */
+ uint64_t address;
+
+ /**
+ * The ID of the source CPU/device involved in the memory transfer, page fault, thrashing,
+ * throttling or remote map operation. For counterKind
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THRASHING, it is a bitwise ORing of the
+ * device IDs fighting for the memory region. Ignore this field if counterKind is
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT
+ */
+ uint32_t srcId;
+
+ /**
+ * The ID of the destination CPU/device involved in the memory transfer or remote map
+ * operation. Ignore this field if counterKind is
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT or
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_CPU_PAGE_FAULT_COUNT or
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THRASHING or
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THROTTLING
+ */
+ uint32_t dstId;
+
+ /**
+ * The ID of the stream causing the transfer.
+ * This value of this field is invalid.
+ */
+ uint32_t streamId;
+
+ /**
+ * The ID of the process to which this record belongs to.
+ */
+ uint32_t processId;
+
+ /**
+ * The flags associated with this record. See enums \ref CUpti_ActivityUnifiedMemoryAccessType
+ * if counterKind is CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_GPU_PAGE_FAULT
+ * and \ref CUpti_ActivityUnifiedMemoryMigrationCause if counterKind is
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD or
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_BYTES_TRANSFER_HTOD
+ * and \ref CUpti_ActivityUnifiedMemoryRemoteMapCause if counterKind is
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_REMOTE_MAP and \ref CUpti_ActivityFlag
+ * if counterKind is CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THRASHING or
+ * CUPTI_ACTIVITY_UNIFIED_MEMORY_COUNTER_KIND_THROTTLING
+ */
+ uint32_t flags;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityUnifiedMemoryCounter2;
+
+/**
+ * \brief The activity record for global/device functions.
+ *
+ * This activity records function name and corresponding module
+ * information.
+ * (CUPTI_ACTIVITY_KIND_FUNCTION).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_FUNCTION.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * ID to uniquely identify the record
+ */
+ uint32_t id;
+
+ /**
+ * The ID of the context where the function is launched.
+ */
+ uint32_t contextId;
+
+ /**
+ * The module ID in which this global/device function is present.
+ */
+ uint32_t moduleId;
+
+ /**
+ * The function's unique symbol index in the module.
+ */
+ uint32_t functionIndex;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The name of the function. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+} CUpti_ActivityFunction;
+
+/**
+ * \brief The activity record for a CUDA module.
+ *
+ * This activity record represents a CUDA module
+ * (CUPTI_ACTIVITY_KIND_MODULE). This activity record kind is not
+ * produced by the activity API but is included for completeness and
+ * ease-of-use. Profile frameworks built on top of CUPTI that collect
+ * module data from the module callback may choose to use this type to
+ * store the collected module data.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MODULE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The ID of the context where the module is loaded.
+ */
+ uint32_t contextId;
+
+ /**
+ * The module ID.
+ */
+ uint32_t id;
+
+ /**
+ * The cubin size.
+ */
+ uint32_t cubinSize;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The pointer to cubin.
+ */
+ const void *cubin;
+} CUpti_ActivityModule;
+
+/**
+ * \brief The activity record for source-level shared
+ * access.
+ *
+ * This activity records the locations of the shared
+ * accesses in the source
+ * (CUPTI_ACTIVITY_KIND_SHARED_ACCESS).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_SHARED_ACCESS.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this shared access.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * The pc offset for the access.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * This increments each time when this instruction is executed by number
+ * of threads that executed this instruction with predicate and condition code evaluating to true.
+ */
+ uint64_t threadsExecuted;
+
+ /**
+ * The total number of shared memory transactions generated by this access
+ */
+ uint64_t sharedTransactions;
+
+ /**
+ * The minimum number of shared memory transactions possible based on the access pattern.
+ */
+ uint64_t theoreticalSharedTransactions;
+
+ /**
+ * The number of times this instruction was executed per warp. It will be incremented
+ * when at least one of thread among warp is active with predicate and condition code
+ * evaluating to true.
+ */
+ uint32_t executed;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivitySharedAccess;
+
+/**
+ * \brief The activity record for CUDA event.
+ *
+ * This activity is used to track recorded events.
+ * (CUPTI_ACTIVITY_KIND_CUDA_EVENT).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_CUDA_EVENT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The correlation ID of the API to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The ID of the context where the event was recorded.
+ */
+ uint32_t contextId;
+
+ /**
+ * The compute stream where the event was recorded.
+ */
+ uint32_t streamId;
+
+ /**
+ * A unique event ID to identify the event record.
+ */
+ uint32_t eventId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityCudaEvent;
+
+/**
+ * \brief The activity record for CUDA stream.
+ *
+ * This activity is used to track created streams.
+ * (CUPTI_ACTIVITY_KIND_STREAM).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_STREAM.
+ */
+ CUpti_ActivityKind kind;
+ /**
+ * The ID of the context where the stream was created.
+ */
+ uint32_t contextId;
+
+ /**
+ * A unique stream ID to identify the stream.
+ */
+ uint32_t streamId;
+
+ /**
+ * The clamped priority for the stream.
+ */
+ uint32_t priority;
+
+ /**
+ * Flags associated with the stream.
+ */
+ CUpti_ActivityStreamFlag flag;
+
+ /**
+ * The correlation ID of the API to which this result is associated.
+ */
+ uint32_t correlationId;
+} CUpti_ActivityStream;
+
+/**
+ * \brief The activity record for synchronization management.
+ *
+ * This activity is used to track various CUDA synchronization APIs.
+ * (CUPTI_ACTIVITY_KIND_SYNCHRONIZATION).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_SYNCHRONIZATION.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The type of record.
+ */
+ CUpti_ActivitySynchronizationType type;
+
+ /**
+ * The start timestamp for the function, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the function.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the function, in ns. A value of 0 for both
+ * the start and end timestamps indicates that timestamp information
+ * could not be collected for the function.
+ */
+ uint64_t end;
+
+ /**
+ * The correlation ID of the API to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The ID of the context for which the synchronization API is called.
+ * In case of context synchronization API it is the context id for which the API is called.
+ * In case of stream/event synchronization it is the ID of the context where the stream/event was created.
+ */
+ uint32_t contextId;
+
+ /**
+ * The compute stream for which the synchronization API is called.
+ * A CUPTI_SYNCHRONIZATION_INVALID_VALUE value indicate the field is not applicable for this record.
+ * Not valid for cuCtxSynchronize, cuEventSynchronize.
+ */
+ uint32_t streamId;
+
+ /**
+ * The event ID for which the synchronization API is called.
+ * A CUPTI_SYNCHRONIZATION_INVALID_VALUE value indicate the field is not applicable for this record.
+ * Not valid for cuCtxSynchronize, cuStreamSynchronize.
+ */
+ uint32_t cudaEventId;
+} CUpti_ActivitySynchronization;
+
+/**
+ * \brief The activity record for source-level sass/source
+ * line-by-line correlation.
+ *
+ * This activity records source level sass/source correlation
+ * information.
+ * (CUPTI_ACTIVITY_KIND_INSTRUCTION_CORRELATION).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_INSTRUCTION_CORRELATION.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this instruction.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * The pc offset for the instruction.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityInstructionCorrelation;
+
+/**
+ * \brief The OpenAcc event kind for OpenAcc activity records.
+ *
+ * \see CUpti_ActivityKindOpenAcc
+ */
+typedef enum {
+ CUPTI_OPENACC_EVENT_KIND_INVALID = 0,
+ CUPTI_OPENACC_EVENT_KIND_DEVICE_INIT = 1,
+ CUPTI_OPENACC_EVENT_KIND_DEVICE_SHUTDOWN = 2,
+ CUPTI_OPENACC_EVENT_KIND_RUNTIME_SHUTDOWN = 3,
+ CUPTI_OPENACC_EVENT_KIND_ENQUEUE_LAUNCH = 4,
+ CUPTI_OPENACC_EVENT_KIND_ENQUEUE_UPLOAD = 5,
+ CUPTI_OPENACC_EVENT_KIND_ENQUEUE_DOWNLOAD = 6,
+ CUPTI_OPENACC_EVENT_KIND_WAIT = 7,
+ CUPTI_OPENACC_EVENT_KIND_IMPLICIT_WAIT = 8,
+ CUPTI_OPENACC_EVENT_KIND_COMPUTE_CONSTRUCT = 9,
+ CUPTI_OPENACC_EVENT_KIND_UPDATE = 10,
+ CUPTI_OPENACC_EVENT_KIND_ENTER_DATA = 11,
+ CUPTI_OPENACC_EVENT_KIND_EXIT_DATA = 12,
+ CUPTI_OPENACC_EVENT_KIND_CREATE = 13,
+ CUPTI_OPENACC_EVENT_KIND_DELETE = 14,
+ CUPTI_OPENACC_EVENT_KIND_ALLOC = 15,
+ CUPTI_OPENACC_EVENT_KIND_FREE = 16,
+ CUPTI_OPENACC_EVENT_KIND_FORCE_INT = 0x7fffffff
+} CUpti_OpenAccEventKind;
+
+/**
+ * \brief The OpenAcc parent construct kind for OpenAcc activity records.
+ */
+typedef enum {
+ CUPTI_OPENACC_CONSTRUCT_KIND_UNKNOWN = 0,
+ CUPTI_OPENACC_CONSTRUCT_KIND_PARALLEL = 1,
+ CUPTI_OPENACC_CONSTRUCT_KIND_KERNELS = 2,
+ CUPTI_OPENACC_CONSTRUCT_KIND_LOOP = 3,
+ CUPTI_OPENACC_CONSTRUCT_KIND_DATA = 4,
+ CUPTI_OPENACC_CONSTRUCT_KIND_ENTER_DATA = 5,
+ CUPTI_OPENACC_CONSTRUCT_KIND_EXIT_DATA = 6,
+ CUPTI_OPENACC_CONSTRUCT_KIND_HOST_DATA = 7,
+ CUPTI_OPENACC_CONSTRUCT_KIND_ATOMIC = 8,
+ CUPTI_OPENACC_CONSTRUCT_KIND_DECLARE = 9,
+ CUPTI_OPENACC_CONSTRUCT_KIND_INIT = 10,
+ CUPTI_OPENACC_CONSTRUCT_KIND_SHUTDOWN = 11,
+ CUPTI_OPENACC_CONSTRUCT_KIND_SET = 12,
+ CUPTI_OPENACC_CONSTRUCT_KIND_UPDATE = 13,
+ CUPTI_OPENACC_CONSTRUCT_KIND_ROUTINE = 14,
+ CUPTI_OPENACC_CONSTRUCT_KIND_WAIT = 15,
+ CUPTI_OPENACC_CONSTRUCT_KIND_RUNTIME_API = 16,
+ CUPTI_OPENACC_CONSTRUCT_KIND_FORCE_INT = 0x7fffffff
+
+} CUpti_OpenAccConstructKind;
+
+typedef enum {
+ CUPTI_OPENMP_EVENT_KIND_INVALID = 0,
+ CUPTI_OPENMP_EVENT_KIND_PARALLEL = 1,
+ CUPTI_OPENMP_EVENT_KIND_TASK = 2,
+ CUPTI_OPENMP_EVENT_KIND_THREAD = 3,
+ CUPTI_OPENMP_EVENT_KIND_IDLE = 4,
+ CUPTI_OPENMP_EVENT_KIND_WAIT_BARRIER = 5,
+ CUPTI_OPENMP_EVENT_KIND_WAIT_TASKWAIT = 6,
+ CUPTI_OPENMP_EVENT_KIND_FORCE_INT = 0x7fffffff
+} CUpti_OpenMpEventKind;
+
+/**
+ * \brief The base activity record for OpenAcc records.
+ *
+ * The OpenACC activity API part uses a CUpti_ActivityOpenAcc as a generic
+ * representation for any OpenACC activity. The 'kind' field is used to determine the
+ * specific activity kind, and from that the CUpti_ActivityOpenAcc object can
+ * be cast to the specific OpenACC activity record type appropriate for that kind.
+ *
+ * Note that all OpenACC activity record types are padded and aligned to
+ * ensure that each member of the record is naturally aligned.
+ *
+ * \see CUpti_ActivityKind
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The kind of this activity.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * CUPTI OpenACC event kind (\see CUpti_OpenAccEventKind)
+ */
+ CUpti_OpenAccEventKind eventKind;
+
+ /**
+ * CUPTI OpenACC parent construct kind (\see CUpti_OpenAccConstructKind)
+ *
+ * Note that for applications using PGI OpenACC runtime < 16.1, this
+ * will always be CUPTI_OPENACC_CONSTRUCT_KIND_UNKNOWN.
+ */
+ CUpti_OpenAccConstructKind parentConstruct;
+
+ /**
+ * Version number
+ */
+ uint32_t version;
+
+ /**
+ * 1 for any implicit event, such as an implicit wait at a synchronous data construct
+ * 0 otherwise
+ */
+ uint32_t implicit;
+
+ /**
+ * Device type
+ */
+ uint32_t deviceType;
+
+ /**
+ * Device number
+ */
+ uint32_t deviceNumber;
+
+ /**
+ * ThreadId
+ */
+ uint32_t threadId;
+
+ /**
+ * Value of async() clause of the corresponding directive
+ */
+ uint64_t async;
+
+ /**
+ * Internal asynchronous queue number used
+ */
+ uint64_t asyncMap;
+
+ /**
+ * The line number of the directive or program construct or the starting line
+ * number of the OpenACC construct corresponding to the event.
+ * A zero value means the line number is not known.
+ */
+ uint32_t lineNo;
+
+ /**
+ * For an OpenACC construct, this contains the line number of the end
+ * of the construct. A zero value means the line number is not known.
+ */
+ uint32_t endLineNo;
+
+ /**
+ * The line number of the first line of the function named in funcName.
+ * A zero value means the line number is not known.
+ */
+ uint32_t funcLineNo;
+
+ /**
+ * The last line number of the function named in funcName.
+ * A zero value means the line number is not known.
+ */
+ uint32_t funcEndLineNo;
+
+ /**
+ * CUPTI start timestamp
+ */
+ uint64_t start;
+
+ /**
+ * CUPTI end timestamp
+ */
+ uint64_t end;
+
+ /**
+ * CUDA device id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuDeviceId;
+
+ /**
+ * CUDA context id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuContextId;
+
+ /**
+ * CUDA stream id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuStreamId;
+
+ /**
+ * The ID of the process where the OpenACC activity is executing.
+ */
+ uint32_t cuProcessId;
+
+ /**
+ * The ID of the thread where the OpenACC activity is executing.
+ */
+ uint32_t cuThreadId;
+
+ /**
+ * The OpenACC correlation ID.
+ * Valid only if deviceType is acc_device_nvidia.
+ * If not 0, it uniquely identifies this record. It is identical to the
+ * externalId in the preceding external correlation record of type
+ * CUPTI_EXTERNAL_CORRELATION_KIND_OPENACC.
+ */
+ uint32_t externalId;
+
+ /*
+ * A pointer to null-terminated string containing the name of or path to
+ * the source file, if known, or a null pointer if not.
+ */
+ const char *srcFile;
+
+ /*
+ * A pointer to a null-terminated string containing the name of the
+ * function in which the event occurred.
+ */
+ const char *funcName;
+} CUpti_ActivityOpenAcc;
+
+/**
+ * \brief The activity record for OpenACC data.
+ *
+ * (CUPTI_ACTIVITY_KIND_OPENACC_DATA).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_OPENACC_DATA.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * CUPTI OpenACC event kind (\see CUpti_OpenAccEventKind)
+ */
+ CUpti_OpenAccEventKind eventKind;
+
+ /*
+ * CUPTI OpenACC parent construct kind (\see CUpti_OpenAccConstructKind)
+ *
+ * Note that for applications using PGI OpenACC runtime < 16.1, this
+ * will always be CUPTI_OPENACC_CONSTRUCT_KIND_UNKNOWN.
+ */
+ CUpti_OpenAccConstructKind parentConstruct;
+
+ /*
+ * Version number
+ */
+ uint32_t version;
+
+ /*
+ * 1 for any implicit event, such as an implicit wait at a synchronous data construct
+ * 0 otherwise
+ */
+ uint32_t implicit;
+
+ /*
+ * Device type
+ */
+ uint32_t deviceType;
+
+ /*
+ * Device number
+ */
+ uint32_t deviceNumber;
+
+ /**
+ * ThreadId
+ */
+ uint32_t threadId;
+
+ /*
+ * Value of async() clause of the corresponding directive
+ */
+ uint64_t async;
+
+ /*
+ * Internal asynchronous queue number used
+ */
+ uint64_t asyncMap;
+
+ /*
+ * The line number of the directive or program construct or the starting line
+ * number of the OpenACC construct corresponding to the event.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t lineNo;
+
+ /*
+ * For an OpenACC construct, this contains the line number of the end
+ * of the construct. A negative or zero value means the line number is not known.
+ */
+ uint32_t endLineNo;
+
+ /*
+ * The line number of the first line of the function named in func_name.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t funcLineNo;
+
+ /*
+ * The last line number of the function named in func_name.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t funcEndLineNo;
+
+ /**
+ * CUPTI start timestamp
+ */
+ uint64_t start;
+
+ /**
+ * CUPTI end timestamp
+ */
+ uint64_t end;
+
+ /**
+ * CUDA device id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuDeviceId;
+
+ /**
+ * CUDA context id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuContextId;
+
+ /**
+ * CUDA stream id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuStreamId;
+
+ /**
+ * The ID of the process where the OpenACC activity is executing.
+ */
+ uint32_t cuProcessId;
+
+ /**
+ * The ID of the thread where the OpenACC activity is executing.
+ */
+ uint32_t cuThreadId;
+
+ /**
+ * The OpenACC correlation ID.
+ * Valid only if deviceType is acc_device_nvidia.
+ * If not 0, it uniquely identifies this record. It is identical to the
+ * externalId in the preceding external correlation record of type
+ * CUPTI_EXTERNAL_CORRELATION_KIND_OPENACC.
+ */
+ uint32_t externalId;
+
+ /*
+ * A pointer to null-terminated string containing the name of or path to
+ * the source file, if known, or a null pointer if not.
+ */
+ const char *srcFile;
+
+ /*
+ * A pointer to a null-terminated string containing the name of the
+ * function in which the event occurred.
+ */
+ const char *funcName;
+
+ /* --- end of common CUpti_ActivityOpenAcc part --- */
+
+ /**
+ * Number of bytes
+ */
+ uint64_t bytes;
+
+ /**
+ * Host pointer if available
+ */
+ uint64_t hostPtr;
+
+ /**
+ * Device pointer if available
+ */
+ uint64_t devicePtr;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad1;
+#endif
+
+ /*
+ * A pointer to null-terminated string containing the name of the variable
+ * for which this event is triggered, if known, or a null pointer if not.
+ */
+ const char *varName;
+
+} CUpti_ActivityOpenAccData;
+
+/**
+ * \brief The activity record for OpenACC launch.
+ *
+ * (CUPTI_ACTIVITY_KIND_OPENACC_LAUNCH).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_OPENACC_LAUNCH.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * CUPTI OpenACC event kind (\see CUpti_OpenAccEventKind)
+ */
+ CUpti_OpenAccEventKind eventKind;
+
+ /**
+ * CUPTI OpenACC parent construct kind (\see CUpti_OpenAccConstructKind)
+ *
+ * Note that for applications using PGI OpenACC runtime < 16.1, this
+ * will always be CUPTI_OPENACC_CONSTRUCT_KIND_UNKNOWN.
+ */
+ CUpti_OpenAccConstructKind parentConstruct;
+
+ /**
+ * Version number
+ */
+ uint32_t version;
+
+ /**
+ * 1 for any implicit event, such as an implicit wait at a synchronous data construct
+ * 0 otherwise
+ */
+ uint32_t implicit;
+
+ /**
+ * Device type
+ */
+ uint32_t deviceType;
+
+ /**
+ * Device number
+ */
+ uint32_t deviceNumber;
+
+ /**
+ * ThreadId
+ */
+ uint32_t threadId;
+
+ /**
+ * Value of async() clause of the corresponding directive
+ */
+ uint64_t async;
+
+ /**
+ * Internal asynchronous queue number used
+ */
+ uint64_t asyncMap;
+
+ /**
+ * The line number of the directive or program construct or the starting line
+ * number of the OpenACC construct corresponding to the event.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t lineNo;
+
+ /**
+ * For an OpenACC construct, this contains the line number of the end
+ * of the construct. A negative or zero value means the line number is not known.
+ */
+ uint32_t endLineNo;
+
+ /**
+ * The line number of the first line of the function named in func_name.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t funcLineNo;
+
+ /**
+ * The last line number of the function named in func_name.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t funcEndLineNo;
+
+ /**
+ * CUPTI start timestamp
+ */
+ uint64_t start;
+
+ /**
+ * CUPTI end timestamp
+ */
+ uint64_t end;
+
+ /**
+ * CUDA device id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuDeviceId;
+
+ /**
+ * CUDA context id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuContextId;
+
+ /**
+ * CUDA stream id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuStreamId;
+
+ /**
+ * The ID of the process where the OpenACC activity is executing.
+ */
+ uint32_t cuProcessId;
+
+ /**
+ * The ID of the thread where the OpenACC activity is executing.
+ */
+ uint32_t cuThreadId;
+
+ /**
+ * The OpenACC correlation ID.
+ * Valid only if deviceType is acc_device_nvidia.
+ * If not 0, it uniquely identifies this record. It is identical to the
+ * externalId in the preceding external correlation record of type
+ * CUPTI_EXTERNAL_CORRELATION_KIND_OPENACC.
+ */
+ uint32_t externalId;
+
+ /**
+ * A pointer to null-terminated string containing the name of or path to
+ * the source file, if known, or a null pointer if not.
+ */
+ const char *srcFile;
+
+ /**
+ * A pointer to a null-terminated string containing the name of the
+ * function in which the event occurred.
+ */
+ const char *funcName;
+
+ /* --- end of common CUpti_ActivityOpenAcc part --- */
+
+ /**
+ * The number of gangs created for this kernel launch
+ */
+ uint64_t numGangs;
+
+ /**
+ * The number of workers created for this kernel launch
+ */
+ uint64_t numWorkers;
+
+ /**
+ * The number of vector lanes created for this kernel launch
+ */
+ uint64_t vectorLength;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad1;
+#endif
+
+ /**
+ * A pointer to null-terminated string containing the name of the
+ * kernel being launched, if known, or a null pointer if not.
+ */
+ const char *kernelName;
+
+} CUpti_ActivityOpenAccLaunch;
+
+/**
+ * \brief The activity record for OpenACC other.
+ *
+ * (CUPTI_ACTIVITY_KIND_OPENACC_OTHER).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_OPENACC_OTHER.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * CUPTI OpenACC event kind (\see CUpti_OpenAccEventKind)
+ */
+ CUpti_OpenAccEventKind eventKind;
+
+ /**
+ * CUPTI OpenACC parent construct kind (\see CUpti_OpenAccConstructKind)
+ *
+ * Note that for applications using PGI OpenACC runtime < 16.1, this
+ * will always be CUPTI_OPENACC_CONSTRUCT_KIND_UNKNOWN.
+ */
+ CUpti_OpenAccConstructKind parentConstruct;
+
+ /**
+ * Version number
+ */
+ uint32_t version;
+
+ /**
+ * 1 for any implicit event, such as an implicit wait at a synchronous data construct
+ * 0 otherwise
+ */
+ uint32_t implicit;
+
+ /**
+ * Device type
+ */
+ uint32_t deviceType;
+
+ /**
+ * Device number
+ */
+ uint32_t deviceNumber;
+
+ /**
+ * ThreadId
+ */
+ uint32_t threadId;
+
+ /**
+ * Value of async() clause of the corresponding directive
+ */
+ uint64_t async;
+
+ /**
+ * Internal asynchronous queue number used
+ */
+ uint64_t asyncMap;
+
+ /**
+ * The line number of the directive or program construct or the starting line
+ * number of the OpenACC construct corresponding to the event.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t lineNo;
+
+ /**
+ * For an OpenACC construct, this contains the line number of the end
+ * of the construct. A negative or zero value means the line number is not known.
+ */
+ uint32_t endLineNo;
+
+ /**
+ * The line number of the first line of the function named in func_name.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t funcLineNo;
+
+ /**
+ * The last line number of the function named in func_name.
+ * A negative or zero value means the line number is not known.
+ */
+ uint32_t funcEndLineNo;
+
+ /**
+ * CUPTI start timestamp
+ */
+ uint64_t start;
+
+ /**
+ * CUPTI end timestamp
+ */
+ uint64_t end;
+
+ /**
+ * CUDA device id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuDeviceId;
+
+ /**
+ * CUDA context id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuContextId;
+
+ /**
+ * CUDA stream id
+ * Valid only if deviceType is acc_device_nvidia.
+ */
+ uint32_t cuStreamId;
+
+ /**
+ * The ID of the process where the OpenACC activity is executing.
+ */
+ uint32_t cuProcessId;
+
+ /**
+ * The ID of the thread where the OpenACC activity is executing.
+ */
+ uint32_t cuThreadId;
+
+ /**
+ * The OpenACC correlation ID.
+ * Valid only if deviceType is acc_device_nvidia.
+ * If not 0, it uniquely identifies this record. It is identical to the
+ * externalId in the preceding external correlation record of type
+ * CUPTI_EXTERNAL_CORRELATION_KIND_OPENACC.
+ */
+ uint32_t externalId;
+
+ /**
+ * A pointer to null-terminated string containing the name of or path to
+ * the source file, if known, or a null pointer if not.
+ */
+ const char *srcFile;
+
+ /**
+ * A pointer to a null-terminated string containing the name of the
+ * function in which the event occurred.
+ */
+ const char *funcName;
+
+ /* --- end of common CUpti_ActivityOpenAcc part --- */
+} CUpti_ActivityOpenAccOther;
+
+/**
+ * \brief The base activity record for OpenMp records.
+ *
+ * \see CUpti_ActivityKind
+ */
+typedef struct PACKED_ALIGNMENT {
+
+ /**
+ * The kind of this activity.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * CUPTI OpenMP event kind (\see CUpti_OpenMpEventKind)
+ */
+ CUpti_OpenMpEventKind eventKind;
+
+ /**
+ * Version number
+ */
+ uint32_t version;
+
+ /**
+ * ThreadId
+ */
+ uint32_t threadId;
+
+ /**
+ * CUPTI start timestamp
+ */
+ uint64_t start;
+
+ /**
+ * CUPTI end timestamp
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the process where the OpenMP activity is executing.
+ */
+ uint32_t cuProcessId;
+
+ /**
+ * The ID of the thread where the OpenMP activity is executing.
+ */
+ uint32_t cuThreadId;
+} CUpti_ActivityOpenMp;
+
+/**
+ * \brief The kind of external APIs supported for correlation.
+ *
+ * Custom correlation kinds are reserved for usage in external tools.
+ *
+ * \see CUpti_ActivityExternalCorrelation
+ */
+typedef enum {
+ CUPTI_EXTERNAL_CORRELATION_KIND_INVALID = 0,
+
+ /**
+ * The external API is unknown to CUPTI
+ */
+ CUPTI_EXTERNAL_CORRELATION_KIND_UNKNOWN = 1,
+
+ /**
+ * The external API is OpenACC
+ */
+ CUPTI_EXTERNAL_CORRELATION_KIND_OPENACC = 2,
+
+ /**
+ * The external API is custom0
+ */
+ CUPTI_EXTERNAL_CORRELATION_KIND_CUSTOM0 = 3,
+
+ /**
+ * The external API is custom1
+ */
+ CUPTI_EXTERNAL_CORRELATION_KIND_CUSTOM1 = 4,
+
+ /**
+ * The external API is custom2
+ */
+ CUPTI_EXTERNAL_CORRELATION_KIND_CUSTOM2 = 5,
+
+ /**
+ * Add new kinds before this line
+ */
+ CUPTI_EXTERNAL_CORRELATION_KIND_SIZE,
+
+ CUPTI_EXTERNAL_CORRELATION_KIND_FORCE_INT = 0x7fffffff
+} CUpti_ExternalCorrelationKind;
+
+/**
+ * \brief The activity record for correlation with external records
+ *
+ * This activity record correlates native CUDA records (e.g. CUDA Driver API,
+ * kernels, memcpys, ...) with records from external APIs such as OpenACC.
+ * (CUPTI_ACTIVITY_KIND_EXTERNAL_CORRELATION).
+ *
+ * \see CUpti_ActivityKind
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The kind of this activity.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of external API this record correlated to.
+ */
+ CUpti_ExternalCorrelationKind externalKind;
+
+ /**
+ * The correlation ID of the associated non-CUDA API record.
+ * The exact field in the associated external record depends
+ * on that record's activity kind (\see externalKind).
+ */
+ uint64_t externalId;
+
+ /**
+ * The correlation ID of the associated CUDA driver or runtime API record.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t reserved;
+} CUpti_ActivityExternalCorrelation;
+
+/**
+* \brief The device type for device connected to NVLink.
+*/
+typedef enum {
+ CUPTI_DEV_TYPE_INVALID = 0,
+
+ /**
+ * The device type is GPU.
+ */
+ CUPTI_DEV_TYPE_GPU = 1,
+
+ /**
+ * The device type is NVLink processing unit in CPU.
+ */
+ CUPTI_DEV_TYPE_NPU = 2,
+
+ CUPTI_DEV_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_DevType;
+
+/**
+* \brief NVLink information.
+*
+* This structure gives capabilities of each logical NVLink connection between two devices,
+* gpu<->gpu or gpu<->CPU which can be used to understand the topology.
+*/
+
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_NVLINK.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * NvLink version.
+ */
+ uint32_t nvlinkVersion;
+
+ /**
+ * Type of device 0 \ref CUpti_DevType
+ */
+ CUpti_DevType typeDev0;
+
+ /**
+ * Type of device 1 \ref CUpti_DevType
+ */
+ CUpti_DevType typeDev1;
+
+ /**
+ * If typeDev0 is CUPTI_DEV_TYPE_GPU, UUID for device 0. \ref CUpti_ActivityDevice5.
+ * If typeDev0 is CUPTI_DEV_TYPE_NPU, struct npu for NPU.
+ */
+ union {
+ CUuuid uuidDev;
+ struct {
+ /**
+ * Index of the NPU. First index will always be zero.
+ */
+ uint32_t index;
+
+ /**
+ * Domain ID of NPU. On Linux, this can be queried using lspci.
+ */
+ uint32_t domainId;
+ } npu;
+ } idDev0;
+
+ /**
+ * If typeDev1 is CUPTI_DEV_TYPE_GPU, UUID for device 1. \ref CUpti_ActivityDevice5.
+ * If typeDev1 is CUPTI_DEV_TYPE_NPU, struct npu for NPU.
+ */
+ union {
+ CUuuid uuidDev;
+ struct {
+
+ /**
+ * Index of the NPU. First index will always be zero.
+ */
+ uint32_t index;
+
+ /**
+ * Domain ID of NPU. On Linux, this can be queried using lspci.
+ */
+ uint32_t domainId;
+ } npu;
+ } idDev1;
+
+ /**
+ * Flag gives capabilities of the link \see CUpti_LinkFlag
+ */
+ uint32_t flag;
+
+ /**
+ * Number of physical NVLinks present between two devices.
+ */
+ uint32_t physicalNvLinkCount;
+
+ /**
+ * Port numbers for maximum 32 NVLinks connected to device 0.
+ * If typeDev0 is CUPTI_DEV_TYPE_NPU, ignore this field.
+ * In case of invalid/unknown port number, this field will be set
+ * to value CUPTI_NVLINK_INVALID_PORT.
+ * This will be used to correlate the metric values to individual
+ * physical link and attribute traffic to the logical NVLink in
+ * the topology.
+ */
+ int8_t portDev0[CUPTI_MAX_NVLINK_PORTS];
+
+ /**
+ * Port numbers for maximum 32 NVLinks connected to device 1.
+ * If typeDev1 is CUPTI_DEV_TYPE_NPU, ignore this field.
+ * In case of invalid/unknown port number, this field will be set
+ * to value CUPTI_NVLINK_INVALID_PORT.
+ * This will be used to correlate the metric values to individual
+ * physical link and attribute traffic to the logical NVLink in
+ * the topology.
+ */
+ int8_t portDev1[CUPTI_MAX_NVLINK_PORTS];
+
+ /**
+ * Bandwidth of NVLink in kbytes/sec
+ */
+ uint64_t bandwidth;
+
+ /**
+ * NVSwitch is connected as an intermediate node.
+ */
+ uint8_t nvswitchConnected;
+
+ /**
+ * Undefined. reserved for internal use
+ */
+ uint8_t pad[7];
+} CUpti_ActivityNvLink4;
+
+#define CUPTI_MAX_GPUS 32
+/**
+ * Field to differentiate whether PCIE Activity record
+ * is of a GPU or a PCI Bridge
+ */
+typedef enum {
+ /**
+ * PCIE GPU record
+ */
+ CUPTI_PCIE_DEVICE_TYPE_GPU = 0,
+
+ /**
+ * PCIE Bridge record
+ */
+ CUPTI_PCIE_DEVICE_TYPE_BRIDGE = 1,
+
+ CUPTI_PCIE_DEVICE_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_PcieDeviceType;
+
+/**
+ * \brief PCI devices information required to construct topology
+ *
+ * This structure gives capabilities of GPU and PCI bridge connected to the PCIE bus
+ * which can be used to understand the topology.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_PCIE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * Type of device in topology, \ref CUpti_PcieDeviceType. If type is
+ * CUPTI_PCIE_DEVICE_TYPE_GPU use devId for id and gpuAttr and if type is
+ * CUPTI_PCIE_DEVICE_TYPE_BRIDGE use bridgeId for id and bridgeAttr.
+ */
+ CUpti_PcieDeviceType type;
+
+ /**
+ * A unique identifier for GPU or Bridge in Topology
+ */
+ union {
+ /**
+ * GPU device ID
+ */
+ CUdevice devId;
+
+ /**
+ * A unique identifier for Bridge in the Topology
+ */
+ uint32_t bridgeId;
+ } id;
+
+ /**
+ * Domain for the GPU or Bridge, required to identify which PCIE bus it belongs to in
+ * multiple NUMA systems.
+ */
+ uint32_t domain;
+
+ /**
+ * PCIE Generation of GPU or Bridge.
+ */
+ uint16_t pcieGeneration;
+
+ /**
+ * Link rate of the GPU or bridge in gigatransfers per second (GT/s)
+ */
+ uint16_t linkRate;
+
+ /**
+ * Link width of the GPU or bridge
+ */
+ uint16_t linkWidth;
+
+ /**
+ * Upstream bus ID for the GPU or PCI bridge. Required to identify which bus it is
+ * connected to in the topology.
+ */
+ uint16_t upstreamBus;
+
+ /**
+ * Attributes for more information about GPU (gpuAttr) or PCI Bridge (bridgeAttr)
+ */
+ union {
+ struct {
+ /**
+ * UUID for the device. \ref CUpti_ActivityDevice5.
+ */
+ CUuuid uuidDev;
+
+ /**
+ * CUdevice with which this device has P2P capability.
+ * This can also be obtained by querying cuDeviceCanAccessPeer or
+ * cudaDeviceCanAccessPeer APIs
+ */
+ CUdevice peerDev[CUPTI_MAX_GPUS];
+ } gpuAttr;
+
+ struct {
+ /**
+ * The downstream bus number, used to search downstream devices/bridges connected
+ * to this bridge.
+ */
+ uint16_t secondaryBus;
+
+ /**
+ * Device ID of the bridge
+ */
+ uint16_t deviceId;
+
+ /**
+ * Vendor ID of the bridge
+ */
+ uint16_t vendorId;
+
+ /**
+ * Padding for alignment
+ */
+ uint16_t pad0;
+ } bridgeAttr;
+ } attr;
+} CUpti_ActivityPcie;
+
+/**
+ * \brief PCIE Generation.
+ *
+ * Enumeration of PCIE Generation for
+ * pcie activity attribute pcieGeneration
+ */
+typedef enum {
+ /**
+ * PCIE Generation 1
+ */
+ CUPTI_PCIE_GEN_GEN1 = 1,
+
+ /**
+ * PCIE Generation 2
+ */
+ CUPTI_PCIE_GEN_GEN2 = 2,
+
+ /**
+ * PCIE Generation 3
+ */
+ CUPTI_PCIE_GEN_GEN3 = 3,
+
+ /**
+ * PCIE Generation 4
+ */
+ CUPTI_PCIE_GEN_GEN4 = 4,
+
+ /**
+ * PCIE Generation 5
+ */
+ CUPTI_PCIE_GEN_GEN5 = 5,
+
+ CUPTI_PCIE_GEN_FORCE_INT = 0x7fffffff
+} CUpti_PcieGen;
+
+
+/**
+ * \brief The activity record for an instantaneous CUPTI event.
+ *
+ * This activity record represents a CUPTI event value
+ * (CUPTI_ACTIVITY_KIND_EVENT) sampled at a particular instant.
+ * This activity record kind is not produced by the activity API but is
+ * included for completeness and ease-of-use. Profiler frameworks built on
+ * top of CUPTI that collect event data at a particular time may choose to
+ * use this type to store the collected event data.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_INSTANTANEOUS_EVENT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The event ID.
+ */
+ CUpti_EventID id;
+
+ /**
+ * The event value.
+ */
+ uint64_t value;
+
+ /**
+ * The timestamp at which event is sampled
+ */
+ uint64_t timestamp;
+
+ /**
+ * The device id
+ */
+ uint32_t deviceId;
+
+ /**
+ * Undefined. reserved for internal use
+ */
+ uint32_t reserved;
+} CUpti_ActivityInstantaneousEvent;
+
+/**
+ * \brief The activity record for an instantaneous CUPTI event
+ * with event domain instance information.
+ *
+ * This activity record represents the a CUPTI event value for a
+ * specific event domain instance
+ * (CUPTI_ACTIVITY_KIND_EVENT_INSTANCE) sampled at a particular instant.
+ * This activity record kind is not produced by the activity API but is
+ * included for completeness and ease-of-use. Profiler frameworks built on
+ * top of CUPTI that collect event data may choose to use this type to store the
+ * collected event data. This activity record should be used when
+ * event domain instance information needs to be associated with the
+ * event.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_INSTANTANEOUS_EVENT_INSTANCE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The event ID.
+ */
+ CUpti_EventID id;
+
+ /**
+ * The event value.
+ */
+ uint64_t value;
+
+ /**
+ * The timestamp at which event is sampled
+ */
+ uint64_t timestamp;
+
+ /**
+ * The device id
+ */
+ uint32_t deviceId;
+
+ /**
+ * The event domain instance
+ */
+ uint8_t instance;
+
+ /**
+ * Undefined. reserved for internal use
+ */
+ uint8_t pad[3];
+} CUpti_ActivityInstantaneousEventInstance;
+
+/**
+ * \brief The activity record for an instantaneous CUPTI metric.
+ *
+ * This activity record represents the collection of a CUPTI metric
+ * value (CUPTI_ACTIVITY_KIND_METRIC) at a particular instance.
+ * This activity record kind is not produced by the activity API but
+ * is included for completeness and ease-of-use. Profiler frameworks built
+ * on top of CUPTI that collect metric data may choose to use this type to
+ * store the collected metric data.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_INSTANTANEOUS_METRIC.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The metric ID.
+ */
+ CUpti_MetricID id;
+
+ /**
+ * The metric value.
+ */
+ CUpti_MetricValue value;
+
+ /**
+ * The timestamp at which metric is sampled
+ */
+ uint64_t timestamp;
+
+ /**
+ * The device id
+ */
+ uint32_t deviceId;
+
+ /**
+ * The properties of this metric. \see CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * Undefined. reserved for internal use
+ */
+ uint8_t pad[3];
+} CUpti_ActivityInstantaneousMetric;
+
+/**
+ * \brief The instantaneous activity record for a CUPTI metric with instance
+ * information.
+
+ * This activity record represents a CUPTI metric value
+ * for a specific metric domain instance
+ * (CUPTI_ACTIVITY_KIND_METRIC_INSTANCE) sampled at a particular time. This
+ * activity record kind is not produced by the activity API but is included for
+ * completeness and ease-of-use. Profiler frameworks built on top of
+ * CUPTI that collect metric data may choose to use this type to store
+ * the collected metric data. This activity record should be used when
+ * metric domain instance information needs to be associated with the
+ * metric.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_INSTANTANEOUS_METRIC_INSTANCE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The metric ID.
+ */
+ CUpti_MetricID id;
+
+ /**
+ * The metric value.
+ */
+ CUpti_MetricValue value;
+
+ /**
+ * The timestamp at which metric is sampled
+ */
+ uint64_t timestamp;
+
+ /**
+ * The device id
+ */
+ uint32_t deviceId;
+
+ /**
+ * The properties of this metric. \see CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The metric domain instance
+ */
+ uint8_t instance;
+
+ /**
+ * Undefined. reserved for internal use
+ */
+ uint8_t pad[2];
+} CUpti_ActivityInstantaneousMetricInstance;
+
+/**
+ * \brief The types of JIT entry.
+ *
+ * To be used in CUpti_ActivityJit.
+ */
+typedef enum {
+ CUPTI_ACTIVITY_JIT_ENTRY_INVALID= 0,
+
+ /**
+ * PTX to CUBIN.
+ */
+ CUPTI_ACTIVITY_JIT_ENTRY_PTX_TO_CUBIN = 1,
+
+ /**
+ * NVVM-IR to PTX
+ */
+ CUPTI_ACTIVITY_JIT_ENTRY_NVVM_IR_TO_PTX = 2,
+
+ CUPTI_ACTIVITY_JIT_ENTRY_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_ActivityJitEntryType;
+
+/**
+ * \brief The types of JIT compilation operations.
+ *
+ * To be used in CUpti_ActivityJit.
+ */
+
+typedef enum {
+ CUPTI_ACTIVITY_JIT_OPERATION_INVALID = 0,
+ /**
+ * Loaded from the compute cache.
+ */
+ CUPTI_ACTIVITY_JIT_OPERATION_CACHE_LOAD = 1,
+
+ /**
+ * Stored in the compute cache.
+ */
+ CUPTI_ACTIVITY_JIT_OPERATION_CACHE_STORE = 2,
+
+ /**
+ * JIT compilation.
+ */
+ CUPTI_ACTIVITY_JIT_OPERATION_COMPILE = 3,
+
+ CUPTI_ACTIVITY_JIT_OPERATION_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_ActivityJitOperationType;
+
+/**
+ * \brief The activity record for JIT operations.
+ * This activity represents the JIT operations (compile, load, store) of a CUmodule
+ * from the Compute Cache.
+ * Gives the exact hashed path of where the cached module is loaded from,
+ * or where the module will be stored after Just-In-Time (JIT) compilation.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind must be CUPTI_ACTIVITY_KIND_JIT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The JIT entry type.
+ */
+ CUpti_ActivityJitEntryType jitEntryType;
+
+ /**
+ * The JIT operation type.
+ */
+ CUpti_ActivityJitOperationType jitOperationType;
+
+ /**
+ * The device ID.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The start timestamp for the JIT operation, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the JIT operation.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the JIT operation, in ns. A value of 0 for both
+ * the start and end timestamps indicates that timestamp information
+ * could not be collected for the JIT operation.
+ */
+ uint64_t end;
+
+ /**
+ * The correlation ID of the JIT operation to which
+ * records belong to. Each JIT operation is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the JIT operation.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Internal use.
+ */
+ uint32_t padding;
+
+ /**
+ * The correlation ID to correlate JIT compilation, load and store operations.
+ * Each JIT compilation unit is assigned a unique correlation ID
+ * at the time of the JIT compilation. This correlation id can be used
+ * to find the matching JIT cache load/store records.
+ */
+ uint64_t jitOperationCorrelationId;
+
+ /**
+ * The size of compute cache.
+ */
+ uint64_t cacheSize;
+
+ /**
+ * The path where the fat binary is cached.
+ */
+ const char* cachePath;
+
+ /**
+ * The ID of the process where the JIT operation is executing.
+ */
+ uint32_t processId;
+
+ /**
+ * The ID of the thread where the JIT operation is executing.
+ */
+ uint32_t threadId;
+} CUpti_ActivityJit2;
+
+
+/**
+ * \brief The activity record for trace of graph execution.
+ *
+ * This activity record represents execution for a graph without giving visibility
+ * about the execution of its nodes. This is intended to reduce overheads in tracing
+ * each node. The activity kind is CUPTI_ACTIVITY_KIND_GRAPH_TRACE
+ */
+typedef struct {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_GRAPH_TRACE
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The correlation ID of the graph launch. Each graph launch is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver API activity record that launched
+ * the graph.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The start timestamp for the graph execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the graph.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the graph execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the graph.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the first node of the graph is executed.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The unique ID of the graph that is launched.
+ */
+ uint32_t graphId;
+
+ /**
+ * The ID of the context where the first node of the graph is executed.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the graph is being launched.
+ */
+ uint32_t streamId;
+
+ /**
+ * This field is reserved for internal use
+ */
+ void *reserved;
+
+ /**
+ * The ID of the device where last node of the graph is executed
+ */
+ uint32_t endDeviceId;
+
+ /**
+ * The ID of the context where the last node of the graph is executed.
+ */
+ uint32_t endContextId;
+} CUpti_ActivityGraphTrace2;
+
+END_PACKED_ALIGNMENT
+
+/**
+ * \brief Activity attributes.
+ *
+ * These attributes are used to control the behavior of the activity
+ * API.
+ */
+typedef enum {
+ /**
+ * The device memory size (in bytes) reserved for storing profiling data for concurrent
+ * kernels (activity kind \ref CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL), memcopies and memsets
+ * for each buffer on a context. The value is a size_t.
+ *
+ * There is a limit on how many device buffers can be allocated per context. User
+ * can query and set this limit using the attribute
+ * \ref CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_POOL_LIMIT.
+ * CUPTI doesn't pre-allocate all the buffers, it pre-allocates only those many
+ * buffers as set by the attribute \ref CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_PRE_ALLOCATE_VALUE.
+ * When all of the data in a buffer is consumed, it is added in the reuse pool, and
+ * CUPTI picks a buffer from this pool when a new buffer is needed. Thus memory
+ * footprint does not scale with the kernel count. Applications with the high density
+ * of kernels, memcopies and memsets might result in having CUPTI to allocate more device buffers.
+ * CUPTI allocates another buffer only when it runs out of the buffers in the
+ * reuse pool.
+ *
+ * Since buffer allocation happens in the main application thread, this might result
+ * in stalls in the critical path. CUPTI pre-allocates 3 buffers of the same size to
+ * mitigate this issue. User can query and set the pre-allocation limit using the
+ * attribute \ref CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_PRE_ALLOCATE_VALUE.
+ *
+ * Having larger buffer size leaves less device memory for the application.
+ * Having smaller buffer size increases the risk of dropping timestamps for
+ * records if too many kernels or memcopies or memsets are launched at one time.
+ *
+ * This value only applies to new buffer allocations. Set this value before initializing
+ * CUDA or before creating a context to ensure it is considered for the following allocations.
+ *
+ * The default value is 3200000 (~3MB) which can accommodate profiling data
+ * up to 100,000 kernels, memcopies and memsets combined.
+ *
+ * Note: Starting with the CUDA 12.0 Update 1 release, CUPTI allocates profiling buffer in the
+ * device memory by default as this might help in improving the performance of the
+ * tracing run. Refer to the description of the attribute
+ * \ref CUPTI_ACTIVITY_ATTR_MEM_ALLOCATION_TYPE_HOST_PINNED for more details.
+ * Size of the memory and maximum number of pools are still controlled by the attributes
+ * \ref CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_SIZE and \ref CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_POOL_LIMIT.
+ *
+ * Note: The actual amount of device memory per buffer reserved by CUPTI might be larger.
+ */
+ CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_SIZE = 0,
+
+ /**
+ * The device memory size (in bytes) reserved for storing profiling
+ * data for CDP operations for each buffer on a context. The
+ * value is a size_t.
+ *
+ * Having larger buffer size means less flush operations but
+ * consumes more device memory. This value only applies to new
+ * allocations.
+ *
+ * Set this value before initializing CUDA or before creating a
+ * context to ensure it is considered for the following allocations.
+ *
+ * The default value is 8388608 (8MB).
+ *
+ * Note: The actual amount of device memory per context reserved by
+ * CUPTI might be larger.
+ */
+ CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_SIZE_CDP = 1,
+
+ /**
+ * The maximum number of device memory buffers per context. The value is a size_t.
+ *
+ * For an application with high rate of kernel launches, memcopies and memsets having a bigger pool
+ * limit helps in timestamp collection for all these activities at the expense of a larger memory footprint.
+ * Refer to the description of the attribute \ref CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_SIZE
+ * for more details.
+ *
+ * Setting this value will not modify the number of memory buffers
+ * currently stored.
+ *
+ * Set this value before initializing CUDA to ensure the limit is
+ * not exceeded.
+ *
+ * The default value is 250.
+ */
+ CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_POOL_LIMIT = 2,
+
+ /**
+ * This attribute is not supported starting with CUDA 12.3
+ * CUPTI no longer uses profiling semaphore pool to store profiling data.
+ *
+ * There is a limit on how many semaphore pools can be allocated per context. User
+ * can query and set this limit using the attribute
+ * \ref CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_POOL_LIMIT.
+ * CUPTI doesn't pre-allocate all the semaphore pools, it pre-allocates only those many
+ * semaphore pools as set by the attribute \ref CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_PRE_ALLOCATE_VALUE.
+ * When all of the data in a semaphore pool is consumed, it is added in the reuse pool, and
+ * CUPTI picks a semaphore pool from the reuse pool when a new semaphore pool is needed. Thus memory
+ * footprint does not scale with the kernel count. Applications with the high density
+ * of kernels might result in having CUPTI to allocate more semaphore pools.
+ * CUPTI allocates another semaphore pool only when it runs out of the semaphore pools in the
+ * reuse pool.
+ *
+ * Since semaphore pool allocation happens in the main application thread, this might result
+ * in stalls in the critical path. CUPTI pre-allocates 3 semaphore pools of the same size to
+ * mitigate this issue. User can query and set the pre-allocation limit using the
+ * attribute \ref CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_PRE_ALLOCATE_VALUE.
+ *
+ * Having larger semaphore pool size leaves less device memory for the application.
+ * Having smaller semaphore pool size increases the risk of dropping timestamps for
+ * kernel records if too many kernels are issued/launched at one time.
+ *
+ * This value only applies to new semaphore pool allocations. Set this value before initializing
+ * CUDA or before creating a context to ensure it is considered for the following allocations.
+ *
+ * The default value is 25000 which can accommodate profiling data for upto 25,000 kernels.
+ *
+ */
+ CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_POOL_SIZE = 3,
+
+ /**
+ * This attribute is not supported starting with CUDA 12.3
+ * CUPTI no longer uses profiling semaphore pool to store profiling data.
+ *
+ * The maximum number of profiling semaphore pools per context. The value is a size_t.
+ *
+ * Refer to the description of the attribute \ref CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_POOL_SIZE
+ * for more details.
+ *
+ * Set this value before initializing CUDA to ensure the limit is not exceeded.
+ *
+ * The default value is 250.
+ */
+ CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_POOL_LIMIT = 4,
+
+ /**
+ * The flag to indicate whether user should provide activity buffer of zero value.
+ * The value is a uint8_t.
+ *
+ * If the value of this attribute is non-zero, user should provide
+ * a zero value buffer in the \ref CUpti_BuffersCallbackRequestFunc.
+ * If the user does not provide a zero value buffer after setting this to non-zero,
+ * the activity buffer may contain some uninitialized values when CUPTI returns it in
+ * \ref CUpti_BuffersCallbackCompleteFunc
+ *
+ * If the value of this attribute is zero, CUPTI will initialize the user buffer
+ * received in the \ref CUpti_BuffersCallbackRequestFunc to zero before filling it.
+ * If the user sets this to zero, a few stalls may appear in critical path because CUPTI
+ * will zero out the buffer in the main thread.
+ * Set this value before returning from \ref CUpti_BuffersCallbackRequestFunc to
+ * ensure it is considered for all the subsequent user buffers.
+ *
+ * The default value is 0.
+ */
+ CUPTI_ACTIVITY_ATTR_ZEROED_OUT_ACTIVITY_BUFFER = 5,
+
+ /**
+ * Number of device buffers to pre-allocate for a context during the initialization phase.
+ * The value is a size_t.
+ *
+ * Refer to the description of the attribute \ref CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_SIZE
+ * for details.
+ *
+ * This value must be less than the maximum number of device buffers set using
+ * the attribute \ref CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_POOL_LIMIT
+ *
+ * Set this value before initializing CUDA or before creating a context to ensure it
+ * is considered by the CUPTI.
+ *
+ * The default value is set to 3 to ping pong between these buffers (if possible).
+ */
+ CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_PRE_ALLOCATE_VALUE = 6,
+
+ /**
+ * This attribute is not supported starting with CUDA 12.3
+ * CUPTI no longer uses profiling semaphore pool to store profiling data.
+ *
+ * Number of profiling semaphore pools to pre-allocate for a context during the
+ * initialization phase. The value is a size_t.
+ *
+ * Refer to the description of the attribute \ref CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_POOL_SIZE
+ * for details.
+ *
+ * This value must be less than the maximum number of profiling semaphore pools set
+ * using the attribute \ref CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_POOL_LIMIT
+ *
+ * Set this value before initializing CUDA or before creating a context to ensure it
+ * is considered by the CUPTI.
+ *
+ * The default value is set to 3 to ping pong between these pools (if possible).
+ */
+ CUPTI_ACTIVITY_ATTR_PROFILING_SEMAPHORE_PRE_ALLOCATE_VALUE = 7,
+
+ /**
+ * Allocate page-locked (pinned) host memory for storing profiling data for concurrent
+ * kernels, memcopies and memsets for each buffer on a context. The value is a uint8_t.
+ *
+ * Starting with the CUDA 11.2 release, CUPTI allocates profiling buffer in the pinned host
+ * memory by default as this might help in improving the performance of the tracing run.
+ * Allocating excessive amounts of pinned memory may degrade system performance, since it
+ * reduces the amount of memory available to the system for paging. For this reason user
+ * might want to change the location from pinned host memory to device memory by setting
+ * value of this attribute to 0.
+ *
+ * Using page-locked (pinned) host memory buffers is not supported on confidential computing
+ * devices. On setting this attribute to 1, CUPTI will return CUPTI_ERROR_NOT_SUPPORTED.
+ *
+ * The default value is 1.
+ */
+ CUPTI_ACTIVITY_ATTR_MEM_ALLOCATION_TYPE_HOST_PINNED = 8,
+
+ /**
+ * Request activity buffers per-thread to store CUPTI activity records
+ * in the activity buffer on per-thread basis. The value is a uint8_t.
+ *
+ * The attribute should be set before registering the buffer callbacks using
+ * cuptiActivityRegisterCallbacks API and before any of the CUPTI activity kinds are enabled.
+ * This makes sure that all the records are stored in activity buffers allocated per-thread.
+ * Changing this attribute in the middle of the profiling session will result in undefined behavior.
+ *
+ * The default value is 0.
+ */
+ CUPTI_ACTIVITY_ATTR_PER_THREAD_ACTIVITY_BUFFER,
+
+
+
+ CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_FORCE_INT = 0x7fffffff
+} CUpti_ActivityAttribute;
+
+/**
+ * \brief Thread-Id types.
+ *
+ * CUPTI uses different methods to obtain the thread-id depending on the
+ * support and the underlying platform. This enum documents these methods
+ * for each type. APIs \ref cuptiSetThreadIdType and \ref cuptiGetThreadIdType
+ * can be used to set and get the thread-id type.
+ */
+typedef enum {
+ /**
+ * Default type
+ * Windows uses API GetCurrentThreadId()
+ * Linux/Mac/Android/QNX use POSIX pthread API pthread_self()
+ */
+ CUPTI_ACTIVITY_THREAD_ID_TYPE_DEFAULT = 0,
+
+ /**
+ * This type is based on the system API available on the underlying platform
+ * and thread-id obtained is supposed to be unique for the process lifetime.
+ * Windows uses API GetCurrentThreadId()
+ * Linux uses syscall SYS_gettid
+ * Mac uses syscall SYS_thread_selfid
+ * Android/QNX use gettid()
+ */
+ CUPTI_ACTIVITY_THREAD_ID_TYPE_SYSTEM = 1,
+
+ /**
+ * Add new enums before this field.
+ */
+ CUPTI_ACTIVITY_THREAD_ID_TYPE_SIZE = 2,
+
+ CUPTI_ACTIVITY_THREAD_ID_TYPE_FORCE_INT = 0x7fffffff
+} CUpti_ActivityThreadIdType;
+
+/**
+ * \brief Get the CUPTI timestamp.
+ *
+ * Returns a timestamp normalized to correspond with the start and end
+ * timestamps reported in the CUPTI activity records. The timestamp is
+ * reported in nanoseconds.
+ *
+ * \param timestamp Returns the CUPTI timestamp
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p timestamp is NULL
+ */
+CUptiResult CUPTIAPI cuptiGetTimestamp(uint64_t *timestamp);
+
+/**
+ * \brief Get the ID of a context.
+ *
+ * Get the ID of a context.
+ *
+ * \param context The context
+ * \param contextId Returns a process-unique ID for the context
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_CONTEXT The context is NULL or not valid.
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p contextId is NULL
+ */
+CUptiResult CUPTIAPI cuptiGetContextId(CUcontext context, uint32_t *contextId);
+
+/**
+ * \brief Get the ID of a stream.
+ *
+ * Get the ID of a stream. The stream ID is unique within a context
+ * (i.e. all streams within a context will have unique stream
+ * IDs).
+ *
+ * \param context If non-NULL then the stream is checked to ensure
+ * that it belongs to this context. Typically this parameter should be
+ * null.
+ * \param stream The stream
+ * \param streamId Returns a context-unique ID for the stream
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_STREAM if unable to get stream ID, or
+ * if \p context is non-NULL and \p stream does not belong to the
+ * context
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p streamId is NULL
+ *
+ * **DEPRECATED** This method is deprecated as of CUDA 8.0.
+ * Use method cuptiGetStreamIdEx instead.
+ */
+CUptiResult CUPTIAPI cuptiGetStreamId(CUcontext context, CUstream stream, uint32_t *streamId);
+
+/**
+* \brief Get the ID of a stream.
+*
+* Get the ID of a stream. The stream ID is unique within a context
+* (i.e. all streams within a context will have unique stream
+* IDs).
+*
+* \param context If non-NULL then the stream is checked to ensure
+* that it belongs to this context. Typically this parameter should be
+* null.
+* \param stream The stream
+* \param perThreadStream Flag to indicate if program is compiled for per-thread streams
+* \param streamId Returns a context-unique ID for the stream
+*
+* \retval CUPTI_SUCCESS
+* \retval CUPTI_ERROR_NOT_INITIALIZED
+* \retval CUPTI_ERROR_INVALID_STREAM if unable to get stream ID, or
+* if \p context is non-NULL and \p stream does not belong to the
+* context
+* \retval CUPTI_ERROR_INVALID_PARAMETER if \p streamId is NULL
+*/
+CUptiResult CUPTIAPI cuptiGetStreamIdEx(CUcontext context, CUstream stream, uint8_t perThreadStream, uint32_t *streamId);
+
+/**
+ * \brief Get the ID of a device
+ *
+ * If \p context is NULL, returns the ID of the device that contains
+ * the currently active context. If \p context is non-NULL, returns
+ * the ID of the device which contains that context. Operates in a
+ * similar manner to cudaGetDevice() or cuCtxGetDevice() but may be
+ * called from within callback functions.
+ *
+ * \param context The context, or NULL to indicate the current context.
+ * \param deviceId Returns the ID of the device that is current for
+ * the calling thread.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE if unable to get device ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p deviceId is NULL
+ */
+CUptiResult CUPTIAPI cuptiGetDeviceId(CUcontext context, uint32_t *deviceId);
+
+/**
+ * \brief Get the unique ID of a graph node
+ *
+ * Returns the unique ID of the CUDA graph node.
+ *
+ * \param node The graph node.
+ * \param nodeId Returns the unique ID of the node
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p node is NULL
+ */
+CUptiResult CUPTIAPI cuptiGetGraphNodeId(CUgraphNode node, uint64_t *nodeId);
+
+/**
+ * \brief Get the unique ID of graph
+ *
+ * Returns the unique ID of CUDA graph.
+ *
+ * \param graph The graph.
+ * \param pId Returns the unique ID of the graph
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p graph is NULL
+ */
+CUptiResult CUPTIAPI cuptiGetGraphId(CUgraph graph, uint32_t *pId);
+
+/**
+ * \brief Get the unique ID of executable graph
+ *
+ * Returns the unique ID of executable CUDA graph.
+ *
+ * \param graphExec The executable graph.
+ * \param pId Returns the unique ID of the executable graph
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p graph is NULL
+ */
+CUptiResult CUPTIAPI cuptiGetGraphExecId(CUgraphExec graphExec, uint32_t *pId);
+
+/**
+ * \brief Enable collection of a specific kind of activity record.
+ *
+ * Enable collection of a specific kind of activity record. Multiple
+ * kinds can be enabled by calling this function multiple times. By
+ * default all activity kinds are disabled for collection.
+ *
+ * \param kind The kind of activity record to collect
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_NOT_COMPATIBLE if the activity kind cannot be enabled
+ * \retval CUPTI_ERROR_INVALID_KIND if the activity kind is not supported
+ */
+CUptiResult CUPTIAPI cuptiActivityEnable(CUpti_ActivityKind kind);
+
+/**
+ * \brief Enable collection of a specific kind of activity record. For certain activity kinds
+ * it dumps existing records.
+ *
+ * In general, the behavior of this API is similar to the API \ref cuptiActivityEnable i.e. it
+ * enables the collection of a specific kind of activity record.
+ * Additionally, this API can help in dumping the records for activities which happened in
+ * the past before enabling the corresponding activity kind.
+ * The API allows to get records for the current resource allocations done in CUDA
+ * For CUPTI_ACTIVITY_KIND_DEVICE, existing device records are dumped
+ * For CUPTI_ACTIVITY_KIND_CONTEXT, existing context records are dumped
+ * For CUPTI_ACTIVITY_KIND_STREAM, existing stream records are dumped
+ * For CUPTI_ACTIVITY_KIND_ NVLINK, existing NVLINK records are dumped
+ * For CUPTI_ACTIVITY_KIND_PCIE, existing PCIE records are dumped
+ * For other activities, the behavior is similar to the API \ref cuptiActivityEnable
+ *
+ * Device records are emitted in CUPTI on CUDA driver initialization. Those records
+ * can only be retrieved by the user if CUPTI is attached before CUDA initialization.
+ * Context and stream records are emitted on context and stream creation.
+ * The use case of the API is to provide the records for CUDA resources
+ * (contexts/streams/devices) that are currently active if user late attaches CUPTI.
+ *
+ * Before calling this function, the user must register buffer callbacks
+ * to get the activity records by calling \ref cuptiActivityRegisterCallbacks.
+ * If the user does not register the buffers and calls API \ref cuptiActivityEnableAndDump,
+ * then CUPTI will enable the activity kind but not provide any records for that
+ * activity kind.
+ *
+ * \param kind The kind of activity record to collect
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_UNKNOWN if buffer is not initialized.
+ * \retval CUPTI_ERROR_NOT_COMPATIBLE if the activity kind cannot be enabled
+ * \retval CUPTI_ERROR_INVALID_KIND if the activity kind is not supported
+ */
+CUptiResult CUPTIAPI cuptiActivityEnableAndDump(CUpti_ActivityKind kind);
+
+/**
+ * \brief Disable collection of a specific kind of activity record.
+ *
+ * Disable collection of a specific kind of activity record. Multiple
+ * kinds can be disabled by calling this function multiple times. By
+ * default all activity kinds are disabled for collection.
+ *
+ * \param kind The kind of activity record to stop collecting
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_KIND if the activity kind is not supported
+ */
+CUptiResult CUPTIAPI cuptiActivityDisable(CUpti_ActivityKind kind);
+
+/**
+ * \brief Enable collection of a specific kind of activity record for
+ * a context.
+ *
+ * Enable collection of a specific kind of activity record for a
+ * context. This setting done by this API will supersede the global
+ * settings for activity records enabled by \ref cuptiActivityEnable.
+ * Multiple kinds can be enabled by calling this function multiple
+ * times.
+ *
+ * \param context The context for which activity is to be enabled
+ * \param kind The kind of activity record to collect
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_NOT_COMPATIBLE if the activity kind cannot be enabled
+ * \retval CUPTI_ERROR_INVALID_KIND if the activity kind is not supported
+ */
+CUptiResult CUPTIAPI cuptiActivityEnableContext(CUcontext context, CUpti_ActivityKind kind);
+
+/**
+ * \brief Disable collection of a specific kind of activity record for
+ * a context.
+ *
+ * Disable collection of a specific kind of activity record for a context.
+ * This setting done by this API will supersede the global settings
+ * for activity records.
+ * Multiple kinds can be enabled by calling this function multiple times.
+ *
+ * \param context The context for which activity is to be disabled
+ * \param kind The kind of activity record to stop collecting
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_KIND if the activity kind is not supported
+ */
+CUptiResult CUPTIAPI cuptiActivityDisableContext(CUcontext context, CUpti_ActivityKind kind);
+
+/**
+ * \brief Get the number of activity records that were dropped of
+ * insufficient buffer space.
+ *
+ * Get the number of records that were dropped because of insufficient
+ * buffer space. The dropped count includes records that could not be
+ * recorded because CUPTI did not have activity buffer space available
+ * for the record (because the CUpti_BuffersCallbackRequestFunc
+ * callback did not return an empty buffer of sufficient size) and
+ * also CDP records that could not be record because the device-size
+ * buffer was full (size is controlled by the
+ * CUPTI_ACTIVITY_ATTR_DEVICE_BUFFER_SIZE_CDP attribute). The dropped
+ * count maintained for the queue is reset to zero when this function
+ * is called.
+ *
+ * \param context The context, or NULL to get dropped count from global queue
+ * \param streamId The stream ID
+ * \param dropped The number of records that were dropped since the last call
+ * to this function.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p dropped is NULL
+ */
+CUptiResult CUPTIAPI cuptiActivityGetNumDroppedRecords(CUcontext context, uint32_t streamId,
+ size_t *dropped);
+
+/**
+ * \brief Iterate over the activity records in a buffer.
+ *
+ * This is a helper function to iterate over the activity records in a
+ * buffer. A buffer of activity records is typically obtained by
+ * receiving a CUpti_BuffersCallbackCompleteFunc callback. Stop iterating
+ * the buffer when an error occurs.
+ *
+ * An example of typical usage:
+ * \code
+ * CUpti_Activity *record = NULL;
+ * CUptiResult status = CUPTI_SUCCESS;
+ * do {
+ * status = cuptiActivityGetNextRecord(buffer, validSize, &record);
+ * if(status == CUPTI_SUCCESS) {
+ * // Use record here...
+ * }
+ * else if (status == CUPTI_ERROR_MAX_LIMIT_REACHED)
+ * break;
+ * else if (status == CUPTI_ERROR_INVALID_KIND)
+ * break;
+ * else {
+ * goto Error;
+ * }
+ * } while (1);
+ * \endcode
+ *
+ * \param buffer The buffer containing activity records
+ * \param record Inputs the previous record returned by
+ * cuptiActivityGetNextRecord and returns the next activity record
+ * from the buffer. If input value is NULL, returns the first activity
+ * record in the buffer. Records of certain kinds like CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL
+ * may contain invalid (0) timestamps, indicating that no timing information could
+ * be collected for lack of device memory.
+ * \param validBufferSizeBytes The number of valid bytes in the buffer.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_MAX_LIMIT_REACHED if no more records in the buffer
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p buffer is NULL.
+ * \retval CUPTI_ERROR_INVALID_KIND if activity record is either incomplete or invalid
+ */
+CUptiResult CUPTIAPI cuptiActivityGetNextRecord(uint8_t* buffer, size_t validBufferSizeBytes,
+ CUpti_Activity **record);
+
+/**
+ * \brief Function type for callback used by CUPTI to request an empty
+ * buffer for storing activity records.
+ *
+ * This callback function signals the CUPTI client that an activity
+ * buffer is needed by CUPTI. The activity buffer is used by CUPTI to
+ * store activity records. The callback function can decline the
+ * request by setting \p *buffer to NULL. In this case CUPTI may drop
+ * activity records.
+ *
+ * \param buffer Returns the new buffer. If set to NULL then no buffer
+ * is returned.
+ * \param size Returns the size of the returned buffer.
+ * \param maxNumRecords Returns the maximum number of records that
+ * should be placed in the buffer. If 0 then the buffer is filled with
+ * as many records as possible. If > 0 the buffer is filled with at
+ * most that many records before it is returned.
+ */
+typedef void (CUPTIAPI *CUpti_BuffersCallbackRequestFunc)(
+ uint8_t **buffer,
+ size_t *size,
+ size_t *maxNumRecords);
+
+/**
+ * \brief Function type for callback used by CUPTI to return a buffer
+ * of activity records.
+ *
+ * This callback function returns to the CUPTI client a buffer
+ * containing activity records. The buffer contains \p validSize
+ * bytes of activity records which should be read using
+ * cuptiActivityGetNextRecord. The number of dropped records can be
+ * read using cuptiActivityGetNumDroppedRecords. After this call CUPTI
+ * relinquished ownership of the buffer and will not use it
+ * anymore. The client may return the buffer to CUPTI using the
+ * CUpti_BuffersCallbackRequestFunc callback.
+ * Note: CUDA 6.0 onwards, all buffers returned by this callback are
+ * global buffers i.e. there is no context/stream specific buffer.
+ * User needs to parse the global buffer to extract the context/stream
+ * specific activity records.
+ *
+ * \param context The context this buffer is associated with. If NULL, the
+ * buffer is associated with the global activities. This field is deprecated
+ * as of CUDA 6.0 and will always be NULL.
+ * \param streamId The stream id this buffer is associated with.
+ * This field is deprecated as of CUDA 6.0 and will always be NULL.
+ * \param buffer The activity record buffer.
+ * \param size The total size of the buffer in bytes as set in
+ * CUpti_BuffersCallbackRequestFunc.
+ * \param validSize The number of valid bytes in the buffer.
+ */
+typedef void (CUPTIAPI *CUpti_BuffersCallbackCompleteFunc)(
+ CUcontext context,
+ uint32_t streamId,
+ uint8_t *buffer,
+ size_t size,
+ size_t validSize);
+
+/**
+ * \brief Registers callback functions with CUPTI for activity buffer
+ * handling.
+ *
+ * This function registers two callback functions to be used in asynchronous
+ * buffer handling. If registered, activity record buffers are handled using
+ * asynchronous requested/completed callbacks from CUPTI.
+ *
+ * Registering these callbacks prevents the client from using CUPTI's
+ * blocking enqueue/dequeue functions.
+ *
+ * \param funcBufferRequested callback which is invoked when an empty
+ * buffer is requested by CUPTI
+ * \param funcBufferCompleted callback which is invoked when a buffer
+ * containing activity records is available from CUPTI
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if either \p
+ * funcBufferRequested or \p funcBufferCompleted is NULL
+ */
+CUptiResult CUPTIAPI cuptiActivityRegisterCallbacks(CUpti_BuffersCallbackRequestFunc funcBufferRequested,
+ CUpti_BuffersCallbackCompleteFunc funcBufferCompleted);
+
+/**
+ * \brief Wait for all activity records to be delivered via the
+ * completion callback.
+ *
+ * This function does not return until all activity records associated
+ * with the specified context/stream are returned to the CUPTI client
+ * using the callback registered in cuptiActivityRegisterCallbacks. To
+ * ensure that all activity records are complete, the requested
+ * stream(s), if any, are synchronized.
+ *
+ * If \p context is NULL, the global activity records (i.e. those not
+ * associated with a particular stream) are flushed (in this case no
+ * streams are synchronized). If \p context is a valid CUcontext and
+ * \p streamId is 0, the buffers of all streams of this context are
+ * flushed. Otherwise, the buffers of the specified stream in this
+ * context is flushed.
+ *
+ * Before calling this function, the buffer handling callback api
+ * must be activated by calling cuptiActivityRegisterCallbacks.
+ *
+ * \param context A valid CUcontext or NULL.
+ * \param streamId The stream ID.
+ * \param flag The flag can be set to indicate a forced flush. See CUpti_ActivityFlag
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_CUPTI_ERROR_INVALID_OPERATION if not preceded
+ * by a successful call to cuptiActivityRegisterCallbacks
+ * \retval CUPTI_ERROR_UNKNOWN an internal error occurred
+ *
+ * **DEPRECATED** This method is deprecated
+ * CONTEXT and STREAMID will be ignored. Use cuptiActivityFlushAll
+ * to flush all data.
+ */
+CUptiResult CUPTIAPI cuptiActivityFlush(CUcontext context, uint32_t streamId, uint32_t flag);
+
+/**
+ * \brief Request to deliver activity records via the buffer completion callback.
+ *
+ * This function returns the activity records associated with all contexts/streams
+ * (and the global buffers not associated with any stream) to the CUPTI client
+ * using the callback registered in cuptiActivityRegisterCallbacks.
+ *
+ * This is a blocking call but it doesn't issue any CUDA synchronization calls
+ * implicitly thus it's not guaranteed that all activities are completed on the
+ * underlying devices. Activity record is considered as completed if it has all
+ * the information filled up including the timestamps if any. It is the client's
+ * responsibility to issue necessary CUDA synchronization calls before calling
+ * this function if all activity records with complete information are expected
+ * to be delivered.
+ *
+ * Behavior of the function based on the input flag:
+ * (-) ::For default flush i.e. when flag is set as 0, it returns all the
+ * activity buffers which have all the activity records completed, buffers need not
+ * to be full though. It doesn't return buffers which have one or more incomplete
+ * records. Default flush can be done at a regular interval in a separate thread.
+ * (-) ::For forced flush i.e. when flag CUPTI_ACTIVITY_FLAG_FLUSH_FORCED is passed
+ * to the function, it returns all the activity buffers including the ones which have
+ * one or more incomplete activity records. It's suggested for clients to do the
+ * force flush before the termination of the profiling session to allow remaining
+ * buffers to be delivered. In general, it can be done in the at-exit handler.
+ *
+ * Before calling this function, the buffer handling callback api must be activated
+ * by calling cuptiActivityRegisterCallbacks.
+ *
+ * \param flag The flag can be set to indicate a forced flush. See CUpti_ActivityFlag
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_OPERATION if not preceded by a
+ * successful call to cuptiActivityRegisterCallbacks
+ * \retval CUPTI_ERROR_UNKNOWN an internal error occurred
+ *
+ * \see cuptiActivityFlushPeriod
+ */
+CUptiResult CUPTIAPI cuptiActivityFlushAll(uint32_t flag);
+
+/**
+ * \brief Read an activity API attribute.
+ *
+ * Read an activity API attribute and return it in \p *value.
+ *
+ * \param attr The attribute to read
+ * \param valueSize Size of buffer pointed by the value, and
+ * returns the number of bytes written to \p value
+ * \param value Returns the value of the attribute
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value is NULL, or
+ * if \p attr is not an activity attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT Indicates that
+ * the \p value buffer is too small to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiActivityGetAttribute(CUpti_ActivityAttribute attr,
+ size_t *valueSize, void* value);
+
+/**
+ * \brief Write an activity API attribute.
+ *
+ * Write an activity API attribute.
+ *
+ * \param attr The attribute to write
+ * \param valueSize The size, in bytes, of the value
+ * \param value The attribute value to write
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value is NULL, or
+ * if \p attr is not an activity attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT Indicates that
+ * the \p value buffer is too small to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiActivitySetAttribute(CUpti_ActivityAttribute attr,
+ size_t *valueSize, void* value);
+
+
+/**
+ * \brief Set Unified Memory Counter configuration.
+ *
+ * \param config A pointer to \ref CUpti_ActivityUnifiedMemoryCounterConfig structures
+ * containing Unified Memory counter configuration.
+ * \param count Number of Unified Memory counter configuration structures
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p config is NULL or
+ * any parameter in the \p config structures is not a valid value
+ * \retval CUPTI_ERROR_UM_PROFILING_NOT_SUPPORTED One potential reason is that
+ * platform (OS/arch) does not support the unified memory counters
+ * \retval CUPTI_ERROR_UM_PROFILING_NOT_SUPPORTED_ON_DEVICE Indicates that the device
+ * does not support the unified memory counters
+ * \retval CUPTI_ERROR_UM_PROFILING_NOT_SUPPORTED_ON_NON_P2P_DEVICES Indicates that
+ * multi-GPU configuration without P2P support between any pair of devices
+ * does not support the unified memory counters
+ */
+CUptiResult CUPTIAPI cuptiActivityConfigureUnifiedMemoryCounter(CUpti_ActivityUnifiedMemoryCounterConfig *config, uint32_t count);
+
+/**
+ * \brief Get auto boost state
+ *
+ * The profiling results can be inconsistent in case auto boost is enabled.
+ * CUPTI tries to disable auto boost while profiling. It can fail to disable in
+ * cases where user does not have the permissions or CUDA_AUTO_BOOST env
+ * variable is set. The function can be used to query whether auto boost is
+ * enabled.
+ *
+ * \param context A valid CUcontext.
+ * \param state A pointer to \ref CUpti_ActivityAutoBoostState structure which
+ * contains the current state and the id of the process that has requested the
+ * current state
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p CUcontext or \p state is NULL
+ * \retval CUPTI_ERROR_NOT_SUPPORTED Indicates that the device does not support auto boost
+ * \retval CUPTI_ERROR_UNKNOWN an internal error occurred
+ */
+CUptiResult CUPTIAPI cuptiGetAutoBoostState(CUcontext context, CUpti_ActivityAutoBoostState *state);
+
+/**
+ * \brief Set PC sampling configuration.
+ *
+ * For Pascal and older GPU architectures this API must be called before enabling
+ * activity kind CUPTI_ACTIVITY_KIND_PC_SAMPLING. There is no such requirement
+ * for Volta and newer GPU architectures.
+ *
+ * For Volta and newer GPU architectures if this API is called in the middle of
+ * execution, PC sampling configuration will be updated for subsequent kernel launches.
+ *
+ * \param ctx The context
+ * \param config A pointer to \ref CUpti_ActivityPCSamplingConfig structure
+ * containing PC sampling configuration.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_OPERATION if this api is called while
+ * some valid event collection method is set.
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p config is NULL or
+ * any parameter in the \p config structures is not a valid value
+ * \retval CUPTI_ERROR_NOT_SUPPORTED Indicates that the system/device
+ * does not support the unified memory counters
+ */
+CUptiResult CUPTIAPI cuptiActivityConfigurePCSampling(CUcontext ctx, CUpti_ActivityPCSamplingConfig *config);
+
+/**
+ * \brief Returns the last error from a cupti call or callback
+ *
+ * Returns the last error that has been produced by any of the cupti api calls
+ * or the callback in the same host thread and resets it to CUPTI_SUCCESS.
+ */
+CUptiResult CUPTIAPI cuptiGetLastError(void);
+
+/**
+ * \brief Set the thread-id type
+ *
+ * CUPTI uses the method corresponding to set type to generate the thread-id.
+ * See enum \ref CUpti_ActivityThreadIdType for the list of methods.
+ * Activity records having thread-id field contain the same value.
+ * Thread id type must not be changed during the profiling session to
+ * avoid thread-id value mismatch across activity records.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_SUPPORTED if \p type is not supported on the platform
+ */
+CUptiResult CUPTIAPI cuptiSetThreadIdType(CUpti_ActivityThreadIdType type);
+
+/**
+ * \brief Get the thread-id type
+ *
+ * Returns the thread-id type used in CUPTI
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p type is NULL
+ */
+CUptiResult CUPTIAPI cuptiGetThreadIdType(CUpti_ActivityThreadIdType *type);
+
+/**
+* \brief Check support for a compute capability
+*
+* This function is used to check the support for a device based on
+* it's compute capability. It sets the \p support when the compute
+* capability is supported by the current version of CUPTI, and clears
+* it otherwise. This version of CUPTI might not support all GPUs sharing
+* the same compute capability. It is suggested to use API \ref
+* cuptiDeviceSupported which provides correct information.
+*
+* \param major The major revision number of the compute capability
+* \param minor The minor revision number of the compute capability
+* \param support Pointer to an integer to return the support status
+*
+* \retval CUPTI_SUCCESS
+* \retval CUPTI_ERROR_INVALID_PARAMETER if \p support is NULL
+*
+* \sa ::cuptiDeviceSupported
+*/
+CUptiResult CUPTIAPI cuptiComputeCapabilitySupported(int major, int minor, int *support);
+
+/**
+* \brief Check support for a compute device
+*
+* This function is used to check the support for a compute device.
+* It sets the \p support when the device is supported by the current
+* version of CUPTI, and clears it otherwise.
+*
+* \param dev The device handle returned by CUDA Driver API cuDeviceGet
+* \param support Pointer to an integer to return the support status
+*
+* \retval CUPTI_SUCCESS
+* \retval CUPTI_ERROR_INVALID_PARAMETER if \p support is NULL
+* \retval CUPTI_ERROR_INVALID_DEVICE if \p dev is not a valid device
+*
+* \sa ::cuptiComputeCapabilitySupported
+*/
+CUptiResult CUPTIAPI cuptiDeviceSupported(CUdevice dev, int *support);
+
+/**
+ * This indicates the virtualization mode in which CUDA device is running
+ */
+typedef enum {
+ /**
+ * No virtualization mode is associated with the device
+ * i.e. it's a baremetal GPU
+ */
+ CUPTI_DEVICE_VIRTUALIZATION_MODE_NONE = 0,
+ /**
+ * The device is associated with the pass-through GPU.
+ * In this mode, an entire physical GPU is directly assigned
+ * to one virtual machine (VM).
+ */
+ CUPTI_DEVICE_VIRTUALIZATION_MODE_PASS_THROUGH = 1,
+ /**
+ * The device is associated with the virtual GPU (vGPU).
+ * In this mode multiple virtual machines (VMs) have simultaneous,
+ * direct access to a single physical GPU.
+ */
+ CUPTI_DEVICE_VIRTUALIZATION_MODE_VIRTUAL_GPU = 2,
+
+ CUPTI_DEVICE_VIRTUALIZATION_MODE_FORCE_INT = 0x7fffffff
+} CUpti_DeviceVirtualizationMode;
+
+/**
+ * \brief Query the virtualization mode of the device
+ *
+ * This function is used to query the virtualization mode of the CUDA device.
+ *
+ * \param dev The device handle returned by CUDA Driver API cuDeviceGet
+ * \param mode Pointer to an CUpti_DeviceVirtualizationMode to return the virtualization mode
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_DEVICE if \p dev is not a valid device
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p mode is NULL
+ *
+ */
+CUptiResult CUPTIAPI cuptiDeviceVirtualizationMode(CUdevice dev, CUpti_DeviceVirtualizationMode *mode);
+
+/**
+ * \brief Detach CUPTI from the running process
+ *
+ * This API detaches the CUPTI from the running process. It destroys and cleans up all the
+ * resources associated with CUPTI in the current process. After CUPTI detaches from the process,
+ * the process will keep on running with no CUPTI attached to it.
+ * For safe operation of the API, it is recommended this API is invoked from the exit callsite
+ * of any of the CUDA Driver or Runtime API. Otherwise CUPTI client needs to make sure that
+ * required CUDA synchronization and CUPTI activity buffer flush is done before calling the API.
+ * Sample code showing the usage of the API in the cupti callback handler code:
+ * \code
+ void CUPTIAPI
+ cuptiCallbackHandler(void *userdata, CUpti_CallbackDomain domain,
+ CUpti_CallbackId cbid, void *cbdata)
+ {
+ const CUpti_CallbackData *cbInfo = (CUpti_CallbackData *)cbdata;
+
+ // Take this code path when CUPTI detach is requested
+ if (detachCupti) {
+ switch(domain)
+ {
+ case CUPTI_CB_DOMAIN_RUNTIME_API:
+ case CUPTI_CB_DOMAIN_DRIVER_API:
+ if (cbInfo->callbackSite == CUPTI_API_EXIT) {
+ // call the CUPTI detach API
+ cuptiFinalize();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ \endcode
+ */
+CUptiResult CUPTIAPI cuptiFinalize(void);
+
+/**
+ * \brief Push an external correlation id for the calling thread
+ *
+ * This function notifies CUPTI that the calling thread is entering an external API region.
+ * When a CUPTI activity API record is created while within an external API region and
+ * CUPTI_ACTIVITY_KIND_EXTERNAL_CORRELATION is enabled, the activity API record will
+ * be preceded by a CUpti_ActivityExternalCorrelation record for each \ref CUpti_ExternalCorrelationKind.
+ *
+ * \param kind The kind of external API activities should be correlated with.
+ * \param id External correlation id.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER The external API kind is invalid
+ */
+CUptiResult CUPTIAPI cuptiActivityPushExternalCorrelationId(CUpti_ExternalCorrelationKind kind, uint64_t id);
+
+/**
+ * \brief Pop an external correlation id for the calling thread
+ *
+ * This function notifies CUPTI that the calling thread is leaving an external API region.
+ *
+ * \param kind The kind of external API activities should be correlated with.
+ * \param lastId If the function returns successful, contains the last external correlation id for this \p kind, can be NULL.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER The external API kind is invalid.
+ * \retval CUPTI_ERROR_QUEUE_EMPTY No external id is currently associated with \p kind.
+ */
+CUptiResult CUPTIAPI cuptiActivityPopExternalCorrelationId(CUpti_ExternalCorrelationKind kind, uint64_t *lastId);
+
+/**
+ * \brief Controls the collection of queued and submitted timestamps for kernels.
+ *
+ * This API is used to control the collection of queued and submitted timestamps
+ * for kernels whose records are provided through the struct \ref CUpti_ActivityKernel9.
+ * Default value is 0, i.e. these timestamps are not collected. This API needs
+ * to be called before initialization of CUDA and this setting should not be
+ * changed during the profiling session.
+ *
+ * \param enable is a boolean, denoting whether these timestamps should be
+ * collected
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ */
+CUptiResult CUPTIAPI cuptiActivityEnableLatencyTimestamps(uint8_t enable);
+
+/**
+ * \brief Sets the flush period for the worker thread
+ *
+ * CUPTI creates a worker thread to minimize the perturbance for the application created
+ * threads. CUPTI offloads certain operations from the application threads to the worker
+ * thread, this includes synchronization of profiling resources between host and device,
+ * delivery of the activity buffers to the client using the callback registered in
+ * cuptiActivityRegisterCallbacks. For performance reasons, CUPTI wakes up the worker
+ * thread based on certain heuristics.
+ *
+ * This API is used to control the flush period of the worker thread. This setting will
+ * override the CUPTI heuristics. Setting time to zero disables the periodic flush and
+ * restores the default behavior.
+ *
+ * Periodic flush can return only those activity buffers which are full and have all the
+ * activity records completed.
+ *
+ * It's allowed to use the API \ref cuptiActivityFlushAll to flush the data on-demand, even
+ * when client sets the periodic flush.
+ *
+ * \param time flush period in milliseconds (ms)
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ *
+ * \see cuptiActivityFlushAll
+ */
+CUptiResult CUPTIAPI cuptiActivityFlushPeriod(uint32_t time);
+
+/**
+ * \brief Controls the collection of launch attributes for kernels.
+ *
+ * This API is used to control the collection of launch attributes for kernels whose
+ * records are provided through the struct \ref CUpti_ActivityKernel9.
+ * Default value is 0, i.e. these attributes are not collected.
+ *
+ * \param enable is a boolean denoting whether these launch attributes should be collected
+ */
+CUptiResult CUPTIAPI cuptiActivityEnableLaunchAttributes(uint8_t enable);
+
+/**
+ * \brief Function type for callback used by CUPTI to request a timestamp
+ * to be used in activity records.
+ *
+ * This callback function signals the CUPTI client that a timestamp needs
+ * to be returned. This timestamp would be treated as normalized timestamp
+ * to be used for various purposes in CUPTI. For example to store start and
+ * end timestamps reported in the CUPTI activity records.
+ * The returned timestamp must be in nanoseconds.
+ *
+ * \sa ::cuptiActivityRegisterTimestampCallback
+ */
+typedef uint64_t (CUPTIAPI *CUpti_TimestampCallbackFunc)(void);
+
+/**
+ * \brief Registers callback function with CUPTI for providing timestamp.
+ *
+ * This function registers a callback function to obtain timestamp of user's
+ * choice instead of using CUPTI provided timestamp.
+ * By default CUPTI uses different methods, based on the underlying platform,
+ * to retrieve the timestamp
+ * Linux and Android use clock_gettime(CLOCK_REALTIME, ..)
+ * Windows uses QueryPerformanceCounter()
+ * Mac uses mach_absolute_time()
+ * QNX uses ClockCycles()
+ * Timestamps retrieved using these methods are converted to nanosecond if needed
+ * before usage.
+ *
+ * The registration of timestamp callback should be done before any of the CUPTI
+ * activity kinds are enabled to make sure that all the records report the timestamp using
+ * the callback function registered through cuptiActivityRegisterTimestampCallback API.
+ *
+ * Changing the timestamp callback function in CUPTI through
+ * cuptiActivityRegisterTimestampCallback API in the middle of the profiling
+ * session can cause records generated prior to the change to report
+ * timestamps through previous timestamp method.
+ *
+ * \param funcTimestamp callback which is invoked when a timestamp is
+ * needed by CUPTI
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p funcTimestamp is NULL
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ */
+CUptiResult CUPTIAPI cuptiActivityRegisterTimestampCallback(CUpti_TimestampCallbackFunc funcTimestamp);
+
+/**
+ * \brief Controls the collection of records for device launched graphs.
+ *
+ * This API is used to control the collection of records for device launched graphs.
+ * Default value is 0, i.e. these records are not collected. This API needs
+ * to be called before initialization of CUDA and this setting should not be
+ * changed during the profiling session.
+ *
+ * \param enable is a boolean, denoting whether these records should be
+ * collected
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ */
+CUptiResult CUPTIAPI cuptiActivityEnableDeviceGraph(uint8_t enable);
+
+/**
+ * \brief Controls the collection of activity records for specific CUDA Driver APIs.
+ *
+ * Activity kind CUPTI_ACTIVITY_KIND_DRIVER controls the collection of either all
+ * CUDA Driver APIs or none. API cuptiActivityEnableDriverApi can be used for fine-grained
+ * control, it allows enabling/disabling tracing of a specific set of CUDA Driver APIs.
+ * To disable collection of a small set of CUDA Driver APIs, user can
+ * first enable the collection of all Driver APIs using the activity kind
+ * CUPTI_ACTIVITY_KIND_DRIVER and call this API to disable specific Driver APIs.
+ * And to enable the collection of a small set of CUDA Driver APIs, user can
+ * call this API without using the activity kind CUPTI_ACTIVITY_KIND_DRIVER.
+ *
+ * Note: Activity kind CUPTI_ACTIVITY_KIND_DRIVER overrides the settings done by this API
+ * if it is called after the API.
+ *
+ * \param cbid callback id of the CUDA Driver API. This can be found in the header cupti_driver_cbid.h.
+ * \param enable is a boolean, denoting whether to enable or disable the collection
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ */
+CUptiResult CUPTIAPI cuptiActivityEnableDriverApi(CUpti_CallbackId cbid, uint8_t enable);
+
+/**
+ * \brief Controls the collection of activity records for specific CUDA Runtime APIs.
+ *
+ * Activity kind CUPTI_ACTIVITY_KIND_RUNTIME controls the collection of either all
+ * CUDA Runtime APIs or none. API cuptiActivityEnableRuntimeApi can be used for fine-grained
+ * control, it allows enabling/disabling tracing of a specific set of CUDA Runtime APIs.
+ * To disable collection of a small set of CUDA Runtime APIs, user can
+ * first enable the collection of all Runtime APIs using the activity kind
+ * CUPTI_ACTIVITY_KIND_RUNTIME and call this API to disable specific Runtime APIs.
+ * And to enable the collection of a small set of CUDA Runtime APIs, user can
+ * call this API without using the activity kind CUPTI_ACTIVITY_KIND_RUNTIME.
+ *
+ * Note: Activity kind CUPTI_ACTIVITY_KIND_RUNTIME overrides the settings done by this API
+ * if it is called after the API.
+ *
+ * \param cbid callback id of the CUDA Runtime API. This can be found in the header cupti_runtime_cbid.h.
+ * \param enable is a boolean, denoting whether to enable or disable the collection
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ */
+CUptiResult CUPTIAPI cuptiActivityEnableRuntimeApi(CUpti_CallbackId cbid, uint8_t enable);
+
+
+
+/**
+ * \brief Enables tracking the source library for memory allocation requests.
+ *
+ * This API is used to control whether or not we track the source library of
+ * memory allocation requests. Default value is 0, i.e. it is not tracked. The
+ * activity kind CUPTI_ACTIVITY_KIND_MEMORY2 needs to be enabled, and if this flag is
+ * set, we get the full path of the shared object responsible for the GPU memory allocation
+ * request in the member source in the CUpti_ActivityMemory4 records. Also note that this feature
+ * adds runtime overhead.
+ *
+ * \param enable is a boolean, denoting whether the source library of the memory allocation
+ * request needs to be tracked
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+*/
+CUptiResult CUPTIAPI cuptiActivityEnableAllocationSource (uint8_t enable);
+/** @} */ /* END CUPTI_ACTIVITY_API */
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+// Including deprecated structures of CUPTI_ACTIVITY_API
+#include "cupti_activity_deprecated.h"
+
+#endif /*_CUPTI_ACTIVITY_H_*/
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_activity_deprecated.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_activity_deprecated.h
new file mode 100644
index 0000000000000000000000000000000000000000..cd0fbc4a2a9dcc6cd4e1c5fa344f5270141a34f8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_activity_deprecated.h
@@ -0,0 +1,4985 @@
+/*
+ * Copyright 2011-2024 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if !defined(_CUPTI_ACTIVITY_DEPRECATED_H_)
+#define _CUPTI_ACTIVITY_DEPRECATED_H_
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility push(default)
+#endif
+
+/**
+ * \brief The kinds of activity records.
+ *
+ * Each activity record kind represents information about a GPU or an
+ * activity occurring on a CPU or GPU. Each kind is associated with a
+ * activity record structure that holds the information associated
+ * with the kind.
+ * \see CUpti_ActivityOverhead
+ * \see CUpti_ActivityOverhead2
+ * \see CUpti_ActivityDevice
+ * \see CUpti_ActivityDevice2
+ * \see CUpti_ActivityDevice3
+ * \see CUpti_ActivityDevice4
+ * \see CUpti_ActivityKernel
+ * \see CUpti_ActivityKernel2
+ * \see CUpti_ActivityKernel3
+ * \see CUpti_ActivityKernel4
+ * \see CUpti_ActivityKernel5
+ * \see CUpti_ActivityKernel6
+ * \see CUpti_ActivityKernel7
+ * \see CUpti_ActivityKernel8
+ * \see CUpti_ActivityMemcpy
+ * \see CUpti_ActivityMemcpy3
+ * \see CUpti_ActivityMemcpy4
+ * \see CUpti_ActivityMemcpyPtoP
+ * \see CUpti_ActivityMemcpyPtoP2
+ * \see CUpti_ActivityMemcpyPtoP3
+ * \see CUpti_ActivityMemset
+ * \see CUpti_ActivityMemset2
+ * \see CUpti_ActivityMemset3
+ * \see CUpti_ActivityMemory2
+ * \see CUpti_ActivityMemory3
+ * \see CUpti_ActivityMemoryPool
+ * \see CUpti_ActivityMarker
+ * \see CUpti_ActivityGlobalAccess
+ * \see CUpti_ActivityGlobalAccess2
+ * \see CUpti_ActivityBranch
+ * \see CUpti_ActivityPCSampling
+ * \see CUpti_ActivityPCSampling2
+ * \see CUpti_ActivityUnifiedMemoryCounter
+ * \see CUpti_ActivityNvLink
+ * \see CUpti_ActivityNvLink2
+ * \see CUpti_ActivityNvLink3
+ */
+
+/**
+ * \brief The activity record for CUPTI and driver overheads.
+ * (Deprecated in CUDA 12.2)
+ *
+ * This activity record provides CUPTI and driver overhead information
+ * (CUPTI_ACTIVITY_OVERHEAD). These records are now reported using
+ * CUpti_ActivityOverhead3
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_OVERHEAD.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of overhead, CUPTI, DRIVER, COMPILER etc.
+ */
+ CUpti_ActivityOverheadKind overheadKind;
+
+ /**
+ * The kind of activity object that the overhead is associated with.
+ */
+ CUpti_ActivityObjectKind objectKind;
+
+ /**
+ * The identifier for the activity object. 'objectKind' indicates
+ * which ID is valid for this record.
+ */
+ CUpti_ActivityObjectKindId objectId;
+
+ /**
+ * The start timestamp for the overhead, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the overhead.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the overhead, in ns. A value of 0 for both
+ * the start and end timestamps indicates that timestamp information
+ * could not be collected for the overhead.
+ */
+ uint64_t end;
+} CUpti_ActivityOverhead;
+
+/**
+ * \brief The activity record for CUPTI and driver overheads.
+ *
+ * This activity record provides CUPTI and driver overhead information
+ * (CUPTI_ACTIVITY_OVERHEAD).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_OVERHEAD.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of overhead, CUPTI, DRIVER, COMPILER etc.
+ */
+ CUpti_ActivityOverheadKind overheadKind;
+
+ /**
+ * The kind of activity object that the overhead is associated with.
+ */
+ CUpti_ActivityObjectKind objectKind;
+
+ /**
+ * The identifier for the activity object. 'objectKind' indicates
+ * which ID is valid for this record.
+ */
+ CUpti_ActivityObjectKindId objectId;
+
+ /**
+ * The start timestamp for the overhead, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the overhead.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the overhead, in ns. A value of 0 for both
+ * the start and end timestamps indicates that timestamp information
+ * could not be collected for the overhead.
+ */
+ uint64_t end;
+
+ /**
+ * The correlation ID of the overhead operation to which
+ * records belong to. This ID is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the overhead operation.
+ * In some cases, it can be zero, such as for CUPTI_ACTIVITY_OVERHEAD_CUPTI_BUFFER_FLUSH records.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Reserved for internal use.
+ */
+ uint32_t reserved0;
+} CUpti_ActivityOverhead2;
+
+/**
+ * \brief The activity record for a device. (deprecated)
+ *
+ * This activity record represents information about a GPU device
+ * (CUPTI_ACTIVITY_KIND_DEVICE).
+ * Device activity is now reported using the
+ * CUpti_ActivityDevice5 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_DEVICE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the device. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The global memory bandwidth available on the device, in
+ * kBytes/sec.
+ */
+ uint64_t globalMemoryBandwidth;
+
+ /**
+ * The amount of global memory on the device, in bytes.
+ */
+ uint64_t globalMemorySize;
+
+ /**
+ * The amount of constant memory on the device, in bytes.
+ */
+ uint32_t constantMemorySize;
+
+ /**
+ * The size of the L2 cache on the device, in bytes.
+ */
+ uint32_t l2CacheSize;
+
+ /**
+ * The number of threads per warp on the device.
+ */
+ uint32_t numThreadsPerWarp;
+
+ /**
+ * The core clock rate of the device, in kHz.
+ */
+ uint32_t coreClockRate;
+
+ /**
+ * Number of memory copy engines on the device.
+ */
+ uint32_t numMemcpyEngines;
+
+ /**
+ * Number of multiprocessors on the device.
+ */
+ uint32_t numMultiprocessors;
+
+ /**
+ * The maximum "instructions per cycle" possible on each device
+ * multiprocessor.
+ */
+ uint32_t maxIPC;
+
+ /**
+ * Maximum number of warps that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxWarpsPerMultiprocessor;
+
+ /**
+ * Maximum number of blocks that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxBlocksPerMultiprocessor;
+
+ /**
+ * Maximum number of registers that can be allocated to a block.
+ */
+ uint32_t maxRegistersPerBlock;
+
+ /**
+ * Maximum amount of shared memory that can be assigned to a block,
+ * in bytes.
+ */
+ uint32_t maxSharedMemoryPerBlock;
+
+ /**
+ * Maximum number of threads allowed in a block.
+ */
+ uint32_t maxThreadsPerBlock;
+
+ /**
+ * Maximum allowed X dimension for a block.
+ */
+ uint32_t maxBlockDimX;
+
+ /**
+ * Maximum allowed Y dimension for a block.
+ */
+ uint32_t maxBlockDimY;
+
+ /**
+ * Maximum allowed Z dimension for a block.
+ */
+ uint32_t maxBlockDimZ;
+
+ /**
+ * Maximum allowed X dimension for a grid.
+ */
+ uint32_t maxGridDimX;
+
+ /**
+ * Maximum allowed Y dimension for a grid.
+ */
+ uint32_t maxGridDimY;
+
+ /**
+ * Maximum allowed Z dimension for a grid.
+ */
+ uint32_t maxGridDimZ;
+
+ /**
+ * Compute capability for the device, major number.
+ */
+ uint32_t computeCapabilityMajor;
+
+ /**
+ * Compute capability for the device, minor number.
+ */
+ uint32_t computeCapabilityMinor;
+
+ /**
+ * The device ID.
+ */
+ uint32_t id;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The device name. This name is shared across all activity records
+ * representing instances of the device, and so should not be
+ * modified.
+ */
+ const char *name;
+} CUpti_ActivityDevice;
+
+/**
+ * \brief The activity record for a device. (deprecated)
+ *
+ * This activity record represents information about a GPU device
+ * (CUPTI_ACTIVITY_KIND_DEVICE).
+ * Device activity is now reported using the
+ * CUpti_ActivityDevice5 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_DEVICE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the device. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The global memory bandwidth available on the device, in
+ * kBytes/sec.
+ */
+ uint64_t globalMemoryBandwidth;
+
+ /**
+ * The amount of global memory on the device, in bytes.
+ */
+ uint64_t globalMemorySize;
+
+ /**
+ * The amount of constant memory on the device, in bytes.
+ */
+ uint32_t constantMemorySize;
+
+ /**
+ * The size of the L2 cache on the device, in bytes.
+ */
+ uint32_t l2CacheSize;
+
+ /**
+ * The number of threads per warp on the device.
+ */
+ uint32_t numThreadsPerWarp;
+
+ /**
+ * The core clock rate of the device, in kHz.
+ */
+ uint32_t coreClockRate;
+
+ /**
+ * Number of memory copy engines on the device.
+ */
+ uint32_t numMemcpyEngines;
+
+ /**
+ * Number of multiprocessors on the device.
+ */
+ uint32_t numMultiprocessors;
+
+ /**
+ * The maximum "instructions per cycle" possible on each device
+ * multiprocessor.
+ */
+ uint32_t maxIPC;
+
+ /**
+ * Maximum number of warps that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxWarpsPerMultiprocessor;
+
+ /**
+ * Maximum number of blocks that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxBlocksPerMultiprocessor;
+
+ /**
+ * Maximum amount of shared memory available per multiprocessor, in bytes.
+ */
+ uint32_t maxSharedMemoryPerMultiprocessor;
+
+ /**
+ * Maximum number of 32-bit registers available per multiprocessor.
+ */
+ uint32_t maxRegistersPerMultiprocessor;
+
+ /**
+ * Maximum number of registers that can be allocated to a block.
+ */
+ uint32_t maxRegistersPerBlock;
+
+ /**
+ * Maximum amount of shared memory that can be assigned to a block,
+ * in bytes.
+ */
+ uint32_t maxSharedMemoryPerBlock;
+
+ /**
+ * Maximum number of threads allowed in a block.
+ */
+ uint32_t maxThreadsPerBlock;
+
+ /**
+ * Maximum allowed X dimension for a block.
+ */
+ uint32_t maxBlockDimX;
+
+ /**
+ * Maximum allowed Y dimension for a block.
+ */
+ uint32_t maxBlockDimY;
+
+ /**
+ * Maximum allowed Z dimension for a block.
+ */
+ uint32_t maxBlockDimZ;
+
+ /**
+ * Maximum allowed X dimension for a grid.
+ */
+ uint32_t maxGridDimX;
+
+ /**
+ * Maximum allowed Y dimension for a grid.
+ */
+ uint32_t maxGridDimY;
+
+ /**
+ * Maximum allowed Z dimension for a grid.
+ */
+ uint32_t maxGridDimZ;
+
+ /**
+ * Compute capability for the device, major number.
+ */
+ uint32_t computeCapabilityMajor;
+
+ /**
+ * Compute capability for the device, minor number.
+ */
+ uint32_t computeCapabilityMinor;
+
+ /**
+ * The device ID.
+ */
+ uint32_t id;
+
+ /**
+ * ECC enabled flag for device
+ */
+ uint32_t eccEnabled;
+
+ /**
+ * The device UUID. This value is the globally unique immutable
+ * alphanumeric identifier of the device.
+ */
+ CUuuid uuid;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The device name. This name is shared across all activity records
+ * representing instances of the device, and so should not be
+ * modified.
+ */
+ const char *name;
+} CUpti_ActivityDevice2;
+
+/**
+ * \brief The activity record for a device. (CUDA 7.0 onwards)
+ *
+ * This activity record represents information about a GPU device
+ * (CUPTI_ACTIVITY_KIND_DEVICE).
+ * Device activity is now reported using the
+ * CUpti_ActivityDevice5 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_DEVICE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the device. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The global memory bandwidth available on the device, in
+ * kBytes/sec.
+ */
+ uint64_t globalMemoryBandwidth;
+
+ /**
+ * The amount of global memory on the device, in bytes.
+ */
+ uint64_t globalMemorySize;
+
+ /**
+ * The amount of constant memory on the device, in bytes.
+ */
+ uint32_t constantMemorySize;
+
+ /**
+ * The size of the L2 cache on the device, in bytes.
+ */
+ uint32_t l2CacheSize;
+
+ /**
+ * The number of threads per warp on the device.
+ */
+ uint32_t numThreadsPerWarp;
+
+ /**
+ * The core clock rate of the device, in kHz.
+ */
+ uint32_t coreClockRate;
+
+ /**
+ * Number of memory copy engines on the device.
+ */
+ uint32_t numMemcpyEngines;
+
+ /**
+ * Number of multiprocessors on the device.
+ */
+ uint32_t numMultiprocessors;
+
+ /**
+ * The maximum "instructions per cycle" possible on each device
+ * multiprocessor.
+ */
+ uint32_t maxIPC;
+
+ /**
+ * Maximum number of warps that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxWarpsPerMultiprocessor;
+
+ /**
+ * Maximum number of blocks that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxBlocksPerMultiprocessor;
+
+ /**
+ * Maximum amount of shared memory available per multiprocessor, in bytes.
+ */
+ uint32_t maxSharedMemoryPerMultiprocessor;
+
+ /**
+ * Maximum number of 32-bit registers available per multiprocessor.
+ */
+ uint32_t maxRegistersPerMultiprocessor;
+
+ /**
+ * Maximum number of registers that can be allocated to a block.
+ */
+ uint32_t maxRegistersPerBlock;
+
+ /**
+ * Maximum amount of shared memory that can be assigned to a block,
+ * in bytes.
+ */
+ uint32_t maxSharedMemoryPerBlock;
+
+ /**
+ * Maximum number of threads allowed in a block.
+ */
+ uint32_t maxThreadsPerBlock;
+
+ /**
+ * Maximum allowed X dimension for a block.
+ */
+ uint32_t maxBlockDimX;
+
+ /**
+ * Maximum allowed Y dimension for a block.
+ */
+ uint32_t maxBlockDimY;
+
+ /**
+ * Maximum allowed Z dimension for a block.
+ */
+ uint32_t maxBlockDimZ;
+
+ /**
+ * Maximum allowed X dimension for a grid.
+ */
+ uint32_t maxGridDimX;
+
+ /**
+ * Maximum allowed Y dimension for a grid.
+ */
+ uint32_t maxGridDimY;
+
+ /**
+ * Maximum allowed Z dimension for a grid.
+ */
+ uint32_t maxGridDimZ;
+
+ /**
+ * Compute capability for the device, major number.
+ */
+ uint32_t computeCapabilityMajor;
+
+ /**
+ * Compute capability for the device, minor number.
+ */
+ uint32_t computeCapabilityMinor;
+
+ /**
+ * The device ID.
+ */
+ uint32_t id;
+
+ /**
+ * ECC enabled flag for device
+ */
+ uint32_t eccEnabled;
+
+ /**
+ * The device UUID. This value is the globally unique immutable
+ * alphanumeric identifier of the device.
+ */
+ CUuuid uuid;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The device name. This name is shared across all activity records
+ * representing instances of the device, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Flag to indicate whether the device is visible to CUDA. Users can
+ * set the device visibility using CUDA_VISIBLE_DEVICES environment
+ */
+ uint8_t isCudaVisible;
+
+ uint8_t reserved[7];
+} CUpti_ActivityDevice3;
+
+/**
+ * \brief The activity record for a device. (CUDA 11.6 onwards)
+ *
+ * This activity record represents information about a GPU device
+ * (CUPTI_ACTIVITY_KIND_DEVICE).
+ * Device activity is now reported using the
+ * CUpti_ActivityDevice5 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_DEVICE.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the device. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The global memory bandwidth available on the device, in
+ * kBytes/sec.
+ */
+ uint64_t globalMemoryBandwidth;
+
+ /**
+ * The amount of global memory on the device, in bytes.
+ */
+ uint64_t globalMemorySize;
+
+ /**
+ * The amount of constant memory on the device, in bytes.
+ */
+ uint32_t constantMemorySize;
+
+ /**
+ * The size of the L2 cache on the device, in bytes.
+ */
+ uint32_t l2CacheSize;
+
+ /**
+ * The number of threads per warp on the device.
+ */
+ uint32_t numThreadsPerWarp;
+
+ /**
+ * The core clock rate of the device, in kHz.
+ */
+ uint32_t coreClockRate;
+
+ /**
+ * Number of memory copy engines on the device.
+ */
+ uint32_t numMemcpyEngines;
+
+ /**
+ * Number of multiprocessors on the device.
+ */
+ uint32_t numMultiprocessors;
+
+ /**
+ * The maximum "instructions per cycle" possible on each device
+ * multiprocessor.
+ */
+ uint32_t maxIPC;
+
+ /**
+ * Maximum number of warps that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxWarpsPerMultiprocessor;
+
+ /**
+ * Maximum number of blocks that can be present on a multiprocessor
+ * at any given time.
+ */
+ uint32_t maxBlocksPerMultiprocessor;
+
+ /**
+ * Maximum amount of shared memory available per multiprocessor, in bytes.
+ */
+ uint32_t maxSharedMemoryPerMultiprocessor;
+
+ /**
+ * Maximum number of 32-bit registers available per multiprocessor.
+ */
+ uint32_t maxRegistersPerMultiprocessor;
+
+ /**
+ * Maximum number of registers that can be allocated to a block.
+ */
+ uint32_t maxRegistersPerBlock;
+
+ /**
+ * Maximum amount of shared memory that can be assigned to a block,
+ * in bytes.
+ */
+ uint32_t maxSharedMemoryPerBlock;
+
+ /**
+ * Maximum number of threads allowed in a block.
+ */
+ uint32_t maxThreadsPerBlock;
+
+ /**
+ * Maximum allowed X dimension for a block.
+ */
+ uint32_t maxBlockDimX;
+
+ /**
+ * Maximum allowed Y dimension for a block.
+ */
+ uint32_t maxBlockDimY;
+
+ /**
+ * Maximum allowed Z dimension for a block.
+ */
+ uint32_t maxBlockDimZ;
+
+ /**
+ * Maximum allowed X dimension for a grid.
+ */
+ uint32_t maxGridDimX;
+
+ /**
+ * Maximum allowed Y dimension for a grid.
+ */
+ uint32_t maxGridDimY;
+
+ /**
+ * Maximum allowed Z dimension for a grid.
+ */
+ uint32_t maxGridDimZ;
+
+ /**
+ * Compute capability for the device, major number.
+ */
+ uint32_t computeCapabilityMajor;
+
+ /**
+ * Compute capability for the device, minor number.
+ */
+ uint32_t computeCapabilityMinor;
+
+ /**
+ * The device ID.
+ */
+ uint32_t id;
+
+ /**
+ * ECC enabled flag for device
+ */
+ uint32_t eccEnabled;
+
+ /**
+ * The device UUID. This value is the globally unique immutable
+ * alphanumeric identifier of the device.
+ */
+ CUuuid uuid;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The device name. This name is shared across all activity records
+ * representing instances of the device, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Flag to indicate whether the device is visible to CUDA. Users can
+ * set the device visibility using CUDA_VISIBLE_DEVICES environment
+ */
+ uint8_t isCudaVisible;
+
+ /**
+ * MIG enabled flag for device
+ */
+ uint8_t isMigEnabled;
+
+ uint8_t reserved[6];
+
+ /**
+ * GPU Instance id for MIG enabled devices.
+ * If mig mode is disabled value is set to UINT32_MAX
+ */
+ uint32_t gpuInstanceId;
+
+ /**
+ * Compute Instance id for MIG enabled devices.
+ * If mig mode is disabled value is set to UINT32_MAX
+ */
+ uint32_t computeInstanceId;
+
+ /**
+ * The MIG UUID. This value is the globally unique immutable
+ * alphanumeric identifier of the device.
+ */
+ CUuuid migUuid;
+
+} CUpti_ActivityDevice4;
+
+/**
+ * \brief The activity record for kernel. (deprecated)
+ *
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL) but is no longer generated
+ * by CUPTI. Kernel activities are now reported using the
+ * CUpti_ActivityKernel9 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL
+ * or CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t cacheConfigRequested;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t cacheConfigExecuted;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver API activity record that launched
+ * the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The runtime correlation ID of the kernel. Each kernel execution
+ * is assigned a unique runtime correlation ID that is identical to
+ * the correlation ID in the runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t runtimeCorrelationId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+} CUpti_ActivityKernel;
+
+/**
+ * \brief The activity record for kernel. (deprecated)
+ *
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL) but is no longer generated
+ * by CUPTI. Kernel activities are now reported using the
+ * CUpti_ActivityKernel9 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL or
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The completed timestamp for the kernel execution, in ns. It
+ * represents the completion of all it's child kernels and the
+ * kernel itself. A value of CUPTI_TIMESTAMP_UNKNOWN indicates that
+ * the completion time is unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel is assigned a unique
+ * grid ID at runtime.
+ */
+ int64_t gridId;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+} CUpti_ActivityKernel2;
+
+/**
+ * \brief The activity record for a kernel (CUDA 6.5(with sm_52 support) onwards).
+ * (deprecated in CUDA 9.0)
+ *
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL).
+ * Kernel activities are now reported using the CUpti_ActivityKernel9 activity
+ * record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL or
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The partitioned global caching requested for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheRequested;
+
+ /**
+ * The partitioned global caching executed for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2. Partitioned global caching can be
+ * automatically disabled if the occupancy requirement of the launch cannot
+ * support caching.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheExecuted;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The completed timestamp for the kernel execution, in ns. It
+ * represents the completion of all it's child kernels and the
+ * kernel itself. A value of CUPTI_TIMESTAMP_UNKNOWN indicates that
+ * the completion time is unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel is assigned a unique
+ * grid ID at runtime.
+ */
+ int64_t gridId;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+} CUpti_ActivityKernel3;
+
+/**
+ * \brief The activity record for a kernel (CUDA 9.0(with sm_70 support) onwards).
+ * (deprecated in CUDA 11.0)
+ *
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL).
+ * Kernel activities are now reported using the CUpti_ActivityKernel9 activity
+ * record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL or
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * For devices with compute capability 7.0+ cacheConfig values are not updated
+ * in case field isSharedMemoryCarveoutRequested is set
+ */
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The partitioned global caching requested for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheRequested;
+
+ /**
+ * The partitioned global caching executed for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2. Partitioned global caching can be
+ * automatically disabled if the occupancy requirement of the launch cannot
+ * support caching.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheExecuted;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The completed timestamp for the kernel execution, in ns. It
+ * represents the completion of all it's child kernels and the
+ * kernel itself. A value of CUPTI_TIMESTAMP_UNKNOWN indicates that
+ * the completion time is unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel is assigned a unique
+ * grid ID at runtime.
+ */
+ int64_t gridId;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The timestamp when the kernel is queued up in the command buffer, in ns.
+ * A value of CUPTI_TIMESTAMP_UNKNOWN indicates that the queued time
+ * could not be collected for the kernel. This timestamp is not collected
+ * by default. Use API \ref cuptiActivityEnableLatencyTimestamps() to
+ * enable collection.
+ *
+ * Command buffer is a buffer written by CUDA driver to send commands
+ * like kernel launch, memory copy etc to the GPU. All launches of CUDA
+ * kernels are asynchronous with respect to the host, the host requests
+ * the launch by writing commands into the command buffer, then returns
+ * without checking the GPU's progress.
+ */
+ uint64_t queued;
+
+ /**
+ * The timestamp when the command buffer containing the kernel launch
+ * is submitted to the GPU, in ns. A value of CUPTI_TIMESTAMP_UNKNOWN
+ * indicates that the submitted time could not be collected for the kernel.
+ * This timestamp is not collected by default. Use API \ref
+ * cuptiActivityEnableLatencyTimestamps() to enable collection.
+ */
+ uint64_t submitted;
+
+ /**
+ * The indicates if the kernel was executed via a regular launch or via a
+ * single/multi device cooperative launch. \see CUpti_ActivityLaunchType
+ */
+ uint8_t launchType;
+
+ /**
+ * This indicates if CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT was
+ * updated for the kernel launch
+ */
+ uint8_t isSharedMemoryCarveoutRequested;
+
+ /**
+ * Shared memory carveout value requested for the function in percentage of
+ * the total resource. The value will be updated only if field
+ * isSharedMemoryCarveoutRequested is set.
+ */
+ uint8_t sharedMemoryCarveoutRequested;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint8_t padding;
+
+ /**
+ * Shared memory size set by the driver.
+ */
+ uint32_t sharedMemoryExecuted;
+} CUpti_ActivityKernel4;
+
+/**
+ * \brief The activity record for a kernel (CUDA 11.0(with sm_80 support) onwards).
+ * (deprecated in CUDA 11.2)
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL) but is no longer generated
+ * by CUPTI. Kernel activities are now reported using the
+ * CUpti_ActivityKernel9 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL or
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * For devices with compute capability 7.0+ cacheConfig values are not updated
+ * in case field isSharedMemoryCarveoutRequested is set
+ */
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The partitioned global caching requested for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheRequested;
+
+ /**
+ * The partitioned global caching executed for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2. Partitioned global caching can be
+ * automatically disabled if the occupancy requirement of the launch cannot
+ * support caching.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheExecuted;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The completed timestamp for the kernel execution, in ns. It
+ * represents the completion of all it's child kernels and the
+ * kernel itself. A value of CUPTI_TIMESTAMP_UNKNOWN indicates that
+ * the completion time is unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel is assigned a unique
+ * grid ID at runtime.
+ */
+ int64_t gridId;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The timestamp when the kernel is queued up in the command buffer, in ns.
+ * A value of CUPTI_TIMESTAMP_UNKNOWN indicates that the queued time
+ * could not be collected for the kernel. This timestamp is not collected
+ * by default. Use API \ref cuptiActivityEnableLatencyTimestamps() to
+ * enable collection.
+ *
+ * Command buffer is a buffer written by CUDA driver to send commands
+ * like kernel launch, memory copy etc to the GPU. All launches of CUDA
+ * kernels are asynchronous with respect to the host, the host requests
+ * the launch by writing commands into the command buffer, then returns
+ * without checking the GPU's progress.
+ */
+ uint64_t queued;
+
+ /**
+ * The timestamp when the command buffer containing the kernel launch
+ * is submitted to the GPU, in ns. A value of CUPTI_TIMESTAMP_UNKNOWN
+ * indicates that the submitted time could not be collected for the kernel.
+ * This timestamp is not collected by default. Use API \ref
+ * cuptiActivityEnableLatencyTimestamps() to enable collection.
+ */
+ uint64_t submitted;
+
+ /**
+ * The indicates if the kernel was executed via a regular launch or via a
+ * single/multi device cooperative launch. \see CUpti_ActivityLaunchType
+ */
+ uint8_t launchType;
+
+ /**
+ * This indicates if CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT was
+ * updated for the kernel launch
+ */
+ uint8_t isSharedMemoryCarveoutRequested;
+
+ /**
+ * Shared memory carveout value requested for the function in percentage of
+ * the total resource. The value will be updated only if field
+ * isSharedMemoryCarveoutRequested is set.
+ */
+ uint8_t sharedMemoryCarveoutRequested;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint8_t padding;
+
+ /**
+ * Shared memory size set by the driver.
+ */
+ uint32_t sharedMemoryExecuted;
+
+ /**
+ * The unique ID of the graph node that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The shared memory limit config for the kernel. This field shows whether user has opted for a
+ * higher per block limit of dynamic shared memory.
+ */
+ CUpti_FuncShmemLimitConfig shmemLimitConfig;
+
+ /**
+ * The unique ID of the graph that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint32_t graphId;
+} CUpti_ActivityKernel5;
+
+/**
+ * \brief The activity record for kernel. (deprecated in CUDA 11.6)
+ *
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL) but is no longer generated
+ * by CUPTI. Kernel activities are now reported using the
+ * CUpti_ActivityKernel9 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL or
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * For devices with compute capability 7.0+ cacheConfig values are not updated
+ * in case field isSharedMemoryCarveoutRequested is set
+ */
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The partitioned global caching requested for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheRequested;
+
+ /**
+ * The partitioned global caching executed for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2. Partitioned global caching can be
+ * automatically disabled if the occupancy requirement of the launch cannot
+ * support caching.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheExecuted;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The completed timestamp for the kernel execution, in ns. It
+ * represents the completion of all it's child kernels and the
+ * kernel itself. A value of CUPTI_TIMESTAMP_UNKNOWN indicates that
+ * the completion time is unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel is assigned a unique
+ * grid ID at runtime.
+ */
+ int64_t gridId;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The timestamp when the kernel is queued up in the command buffer, in ns.
+ * A value of CUPTI_TIMESTAMP_UNKNOWN indicates that the queued time
+ * could not be collected for the kernel. This timestamp is not collected
+ * by default. Use API \ref cuptiActivityEnableLatencyTimestamps() to
+ * enable collection.
+ *
+ * Command buffer is a buffer written by CUDA driver to send commands
+ * like kernel launch, memory copy etc to the GPU. All launches of CUDA
+ * kernels are asynchronous with respect to the host, the host requests
+ * the launch by writing commands into the command buffer, then returns
+ * without checking the GPU's progress.
+ */
+ uint64_t queued;
+
+ /**
+ * The timestamp when the command buffer containing the kernel launch
+ * is submitted to the GPU, in ns. A value of CUPTI_TIMESTAMP_UNKNOWN
+ * indicates that the submitted time could not be collected for the kernel.
+ * This timestamp is not collected by default. Use API \ref
+ * cuptiActivityEnableLatencyTimestamps() to enable collection.
+ */
+ uint64_t submitted;
+
+ /**
+ * The indicates if the kernel was executed via a regular launch or via a
+ * single/multi device cooperative launch. \see CUpti_ActivityLaunchType
+ */
+ uint8_t launchType;
+
+ /**
+ * This indicates if CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT was
+ * updated for the kernel launch
+ */
+ uint8_t isSharedMemoryCarveoutRequested;
+
+ /**
+ * Shared memory carveout value requested for the function in percentage of
+ * the total resource. The value will be updated only if field
+ * isSharedMemoryCarveoutRequested is set.
+ */
+ uint8_t sharedMemoryCarveoutRequested;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint8_t padding;
+
+ /**
+ * Shared memory size set by the driver.
+ */
+ uint32_t sharedMemoryExecuted;
+
+ /**
+ * The unique ID of the graph node that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The shared memory limit config for the kernel. This field shows whether user has opted for a
+ * higher per block limit of dynamic shared memory.
+ */
+ CUpti_FuncShmemLimitConfig shmemLimitConfig;
+
+ /**
+ * The unique ID of the graph that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint32_t graphId;
+
+ /**
+ * The pointer to the access policy window. The structure CUaccessPolicyWindow is
+ * defined in cuda.h.
+ */
+ CUaccessPolicyWindow *pAccessPolicyWindow;
+} CUpti_ActivityKernel6;
+
+/**
+ * \brief The activity record for kernel. (deprecated in CUDA 11.8)
+ *
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL) but is no longer generated
+ * by CUPTI. Kernel activities are now reported using the
+ * CUpti_ActivityKernel9 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL or
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * For devices with compute capability 7.0+ cacheConfig values are not updated
+ * in case field isSharedMemoryCarveoutRequested is set
+ */
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The partitioned global caching requested for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheRequested;
+
+ /**
+ * The partitioned global caching executed for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2. Partitioned global caching can be
+ * automatically disabled if the occupancy requirement of the launch cannot
+ * support caching.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheExecuted;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The completed timestamp for the kernel execution, in ns. It
+ * represents the completion of all it's child kernels and the
+ * kernel itself. A value of CUPTI_TIMESTAMP_UNKNOWN indicates that
+ * the completion time is unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel is assigned a unique
+ * grid ID at runtime.
+ */
+ int64_t gridId;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The timestamp when the kernel is queued up in the command buffer, in ns.
+ * A value of CUPTI_TIMESTAMP_UNKNOWN indicates that the queued time
+ * could not be collected for the kernel. This timestamp is not collected
+ * by default. Use API \ref cuptiActivityEnableLatencyTimestamps() to
+ * enable collection.
+ *
+ * Command buffer is a buffer written by CUDA driver to send commands
+ * like kernel launch, memory copy etc to the GPU. All launches of CUDA
+ * kernels are asynchronous with respect to the host, the host requests
+ * the launch by writing commands into the command buffer, then returns
+ * without checking the GPU's progress.
+ */
+ uint64_t queued;
+
+ /**
+ * The timestamp when the command buffer containing the kernel launch
+ * is submitted to the GPU, in ns. A value of CUPTI_TIMESTAMP_UNKNOWN
+ * indicates that the submitted time could not be collected for the kernel.
+ * This timestamp is not collected by default. Use API \ref
+ * cuptiActivityEnableLatencyTimestamps() to enable collection.
+ */
+ uint64_t submitted;
+
+ /**
+ * The indicates if the kernel was executed via a regular launch or via a
+ * single/multi device cooperative launch. \see CUpti_ActivityLaunchType
+ */
+ uint8_t launchType;
+
+ /**
+ * This indicates if CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT was
+ * updated for the kernel launch
+ */
+ uint8_t isSharedMemoryCarveoutRequested;
+
+ /**
+ * Shared memory carveout value requested for the function in percentage of
+ * the total resource. The value will be updated only if field
+ * isSharedMemoryCarveoutRequested is set.
+ */
+ uint8_t sharedMemoryCarveoutRequested;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint8_t padding;
+
+ /**
+ * Shared memory size set by the driver.
+ */
+ uint32_t sharedMemoryExecuted;
+
+ /**
+ * The unique ID of the graph node that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The shared memory limit config for the kernel. This field shows whether user has opted for a
+ * higher per block limit of dynamic shared memory.
+ */
+ CUpti_FuncShmemLimitConfig shmemLimitConfig;
+
+ /**
+ * The unique ID of the graph that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint32_t graphId;
+
+ /**
+ * The pointer to the access policy window. The structure CUaccessPolicyWindow is
+ * defined in cuda.h.
+ */
+ CUaccessPolicyWindow *pAccessPolicyWindow;
+
+ /**
+ * The ID of the HW channel on which the kernel is launched.
+ */
+ uint32_t channelID;
+
+ /**
+ * The type of the channel
+ */
+ CUpti_ChannelType channelType;
+} CUpti_ActivityKernel7;
+
+/**
+ * \brief The activity record for kernel.
+ *
+ * This activity record represents a kernel execution
+ * (CUPTI_ACTIVITY_KIND_KERNEL and
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL)
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_KERNEL or
+ * CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * For devices with compute capability 7.0+ cacheConfig values are not updated
+ * in case field isSharedMemoryCarveoutRequested is set
+ */
+ union {
+ uint8_t both;
+ struct {
+ /**
+ * The cache configuration requested by the kernel. The value is one
+ * of the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t requested:4;
+
+ /**
+ * The cache configuration used for the kernel. The value is one of
+ * the CUfunc_cache enumeration values from cuda.h.
+ */
+ uint8_t executed:4;
+ } config;
+ } cacheConfig;
+
+ /**
+ * The shared memory configuration used for the kernel. The value is one of
+ * the CUsharedconfig enumeration values from cuda.h.
+ */
+ uint8_t sharedMemoryConfig;
+
+ /**
+ * The number of registers required for each thread executing the
+ * kernel.
+ */
+ uint16_t registersPerThread;
+
+ /**
+ * The partitioned global caching requested for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheRequested;
+
+ /**
+ * The partitioned global caching executed for the kernel. Partitioned
+ * global caching is required to enable caching on certain chips, such as
+ * devices with compute capability 5.2. Partitioned global caching can be
+ * automatically disabled if the occupancy requirement of the launch cannot
+ * support caching.
+ */
+ CUpti_ActivityPartitionedGlobalCacheConfig partitionedGlobalCacheExecuted;
+
+ /**
+ * The start timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the kernel execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the kernel.
+ */
+ uint64_t end;
+
+ /**
+ * The completed timestamp for the kernel execution, in ns. It
+ * represents the completion of all it's child kernels and the
+ * kernel itself. A value of CUPTI_TIMESTAMP_UNKNOWN indicates that
+ * the completion time is unknown.
+ */
+ uint64_t completed;
+
+ /**
+ * The ID of the device where the kernel is executing.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the kernel is executing.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the kernel is executing.
+ */
+ uint32_t streamId;
+
+ /**
+ * The X-dimension grid size for the kernel.
+ */
+ int32_t gridX;
+
+ /**
+ * The Y-dimension grid size for the kernel.
+ */
+ int32_t gridY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t gridZ;
+
+ /**
+ * The X-dimension block size for the kernel.
+ */
+ int32_t blockX;
+
+ /**
+ * The Y-dimension block size for the kernel.
+ */
+ int32_t blockY;
+
+ /**
+ * The Z-dimension grid size for the kernel.
+ */
+ int32_t blockZ;
+
+ /**
+ * The static shared memory allocated for the kernel, in bytes.
+ */
+ int32_t staticSharedMemory;
+
+ /**
+ * The dynamic shared memory reserved for the kernel, in bytes.
+ */
+ int32_t dynamicSharedMemory;
+
+ /**
+ * The amount of local memory reserved for each thread, in bytes.
+ */
+ uint32_t localMemoryPerThread;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes (deprecated in CUDA 11.8).
+ * Refer field localMemoryTotal_v2
+ */
+ uint32_t localMemoryTotal;
+
+ /**
+ * The correlation ID of the kernel. Each kernel execution is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the kernel.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The grid ID of the kernel. Each kernel is assigned a unique
+ * grid ID at runtime.
+ */
+ int64_t gridId;
+
+ /**
+ * The name of the kernel. This name is shared across all activity
+ * records representing the same kernel, and so should not be
+ * modified.
+ */
+ const char *name;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The timestamp when the kernel is queued up in the command buffer, in ns.
+ * A value of CUPTI_TIMESTAMP_UNKNOWN indicates that the queued time
+ * could not be collected for the kernel. This timestamp is not collected
+ * by default. Use API \ref cuptiActivityEnableLatencyTimestamps() to
+ * enable collection.
+ *
+ * Command buffer is a buffer written by CUDA driver to send commands
+ * like kernel launch, memory copy etc to the GPU. All launches of CUDA
+ * kernels are asynchronous with respect to the host, the host requests
+ * the launch by writing commands into the command buffer, then returns
+ * without checking the GPU's progress.
+ */
+ uint64_t queued;
+
+ /**
+ * The timestamp when the command buffer containing the kernel launch
+ * is submitted to the GPU, in ns. A value of CUPTI_TIMESTAMP_UNKNOWN
+ * indicates that the submitted time could not be collected for the kernel.
+ * This timestamp is not collected by default. Use API \ref
+ * cuptiActivityEnableLatencyTimestamps() to enable collection.
+ */
+ uint64_t submitted;
+
+ /**
+ * The indicates if the kernel was executed via a regular launch or via a
+ * single/multi device cooperative launch. \see CUpti_ActivityLaunchType
+ */
+ uint8_t launchType;
+
+ /**
+ * This indicates if CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT was
+ * updated for the kernel launch
+ */
+ uint8_t isSharedMemoryCarveoutRequested;
+
+ /**
+ * Shared memory carveout value requested for the function in percentage of
+ * the total resource. The value will be updated only if field
+ * isSharedMemoryCarveoutRequested is set.
+ */
+ uint8_t sharedMemoryCarveoutRequested;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint8_t padding;
+
+ /**
+ * Shared memory size set by the driver.
+ */
+ uint32_t sharedMemoryExecuted;
+
+ /**
+ * The unique ID of the graph node that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The shared memory limit config for the kernel. This field shows whether user has opted for a
+ * higher per block limit of dynamic shared memory.
+ */
+ CUpti_FuncShmemLimitConfig shmemLimitConfig;
+
+ /**
+ * The unique ID of the graph that launched this kernel through graph launch APIs.
+ * This field will be 0 if the kernel is not launched through graph launch APIs.
+ */
+ uint32_t graphId;
+
+ /**
+ * The pointer to the access policy window. The structure CUaccessPolicyWindow is
+ * defined in cuda.h.
+ */
+ CUaccessPolicyWindow *pAccessPolicyWindow;
+
+ /**
+ * The ID of the HW channel on which the kernel is launched.
+ */
+ uint32_t channelID;
+
+ /**
+ * The type of the channel
+ */
+ CUpti_ChannelType channelType;
+
+ /**
+ * The X-dimension cluster size for the kernel.
+ * Field is valid for devices with compute capability 9.0 and higher
+ */
+ uint32_t clusterX;
+
+ /**
+ * The Y-dimension cluster size for the kernel.
+ * Field is valid for devices with compute capability 9.0 and higher
+ */
+ uint32_t clusterY;
+
+ /**
+ * The Z-dimension cluster size for the kernel.
+ * Field is valid for devices with compute capability 9.0 and higher
+ */
+ uint32_t clusterZ;
+
+ /**
+ * The cluster scheduling policy for the kernel. Refer CUclusterSchedulingPolicy
+ * Field is valid for devices with compute capability 9.0 and higher
+ */
+ uint32_t clusterSchedulingPolicy;
+
+ /**
+ * The total amount of local memory reserved for the kernel, in
+ * bytes.
+ */
+ uint64_t localMemoryTotal_v2;
+} CUpti_ActivityKernel8;
+
+/**
+ * \brief The activity record for memory copies. (deprecated)
+ *
+ * This activity record represents a memory copy
+ * (CUPTI_ACTIVITY_KIND_MEMCPY).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMCPY.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of the memory copy, stored as a byte to reduce record
+ * size. \see CUpti_ActivityMemcpyKind
+ */
+ uint8_t copyKind;
+
+ /**
+ * The source memory kind read by the memory copy, stored as a byte
+ * to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t srcKind;
+
+ /**
+ * The destination memory kind read by the memory copy, stored as a
+ * byte to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t dstKind;
+
+ /**
+ * The flags associated with the memory copy. \see CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The number of bytes transferred by the memory copy.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory copy is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory copy is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory copy is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The correlation ID of the memory copy. Each memory copy is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver API activity record that launched
+ * the memory copy.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The runtime correlation ID of the memory copy. Each memory copy
+ * is assigned a unique runtime correlation ID that is identical to
+ * the correlation ID in the runtime API activity record that
+ * launched the memory copy.
+ */
+ uint32_t runtimeCorrelationId;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+} CUpti_ActivityMemcpy;
+
+/**
+ * \brief The activity record for memory copies. (deprecated in CUDA 11.1)
+ *
+ * This activity record represents a memory copy
+ * (CUPTI_ACTIVITY_KIND_MEMCPY).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMCPY.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of the memory copy, stored as a byte to reduce record
+ * size. \see CUpti_ActivityMemcpyKind
+ */
+ uint8_t copyKind;
+
+ /**
+ * The source memory kind read by the memory copy, stored as a byte
+ * to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t srcKind;
+
+ /**
+ * The destination memory kind read by the memory copy, stored as a
+ * byte to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t dstKind;
+
+ /**
+ * The flags associated with the memory copy. \see CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The number of bytes transferred by the memory copy.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory copy is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory copy is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory copy is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The correlation ID of the memory copy. Each memory copy is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver API activity record that launched
+ * the memory copy.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The runtime correlation ID of the memory copy. Each memory copy
+ * is assigned a unique runtime correlation ID that is identical to
+ * the correlation ID in the runtime API activity record that
+ * launched the memory copy.
+ */
+ uint32_t runtimeCorrelationId;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed this memcpy through graph launch.
+ * This field will be 0 if the memcpy is not done through graph launch.
+ */
+ uint64_t graphNodeId;
+} CUpti_ActivityMemcpy3;
+
+/**
+ * \brief The activity record for memory copies. (deprecated in CUDA 11.6)
+ *
+ * This activity record represents a memory copy
+ * (CUPTI_ACTIVITY_KIND_MEMCPY).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMCPY.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of the memory copy, stored as a byte to reduce record
+ * size. \see CUpti_ActivityMemcpyKind
+ */
+ uint8_t copyKind;
+
+ /**
+ * The source memory kind read by the memory copy, stored as a byte
+ * to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t srcKind;
+
+ /**
+ * The destination memory kind read by the memory copy, stored as a
+ * byte to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t dstKind;
+
+ /**
+ * The flags associated with the memory copy. \see CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The number of bytes transferred by the memory copy.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory copy is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory copy is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory copy is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The correlation ID of the memory copy. Each memory copy is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver API activity record that launched
+ * the memory copy.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The runtime correlation ID of the memory copy. Each memory copy
+ * is assigned a unique runtime correlation ID that is identical to
+ * the correlation ID in the runtime API activity record that
+ * launched the memory copy.
+ */
+ uint32_t runtimeCorrelationId;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed this memcpy through graph launch.
+ * This field will be 0 if the memcpy is not done through graph launch.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The unique ID of the graph that executed this memcpy through graph launch.
+ * This field will be 0 if the memcpy is not done through graph launch.
+ */
+ uint32_t graphId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t padding;
+} CUpti_ActivityMemcpy4;
+
+/**
+ * \brief The activity record for peer-to-peer memory copies.
+ *
+ * This activity record represents a peer-to-peer memory copy
+ * (CUPTI_ACTIVITY_KIND_MEMCPY2) but is no longer generated
+ * by CUPTI. Peer-to-peer memory copy activities are now reported using the
+ * CUpti_ActivityMemcpyPtoP2 activity record..
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMCPY2.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of the memory copy, stored as a byte to reduce record
+ * size. \see CUpti_ActivityMemcpyKind
+ */
+ uint8_t copyKind;
+
+ /**
+ * The source memory kind read by the memory copy, stored as a byte
+ * to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t srcKind;
+
+ /**
+ * The destination memory kind read by the memory copy, stored as a
+ * byte to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t dstKind;
+
+ /**
+ * The flags associated with the memory copy. \see
+ * CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The number of bytes transferred by the memory copy.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory copy is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory copy is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory copy is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The ID of the device where memory is being copied from.
+ */
+ uint32_t srcDeviceId;
+
+ /**
+ * The ID of the context owning the memory being copied from.
+ */
+ uint32_t srcContextId;
+
+ /**
+ * The ID of the device where memory is being copied to.
+ */
+ uint32_t dstDeviceId;
+
+ /**
+ * The ID of the context owning the memory being copied to.
+ */
+ uint32_t dstContextId;
+
+ /**
+ * The correlation ID of the memory copy. Each memory copy is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory copy.
+ */
+ uint32_t correlationId;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+} CUpti_ActivityMemcpyPtoP;
+
+typedef CUpti_ActivityMemcpyPtoP CUpti_ActivityMemcpy2;
+
+/**
+ * \brief The activity record for peer-to-peer memory copies.
+ * (deprecated in CUDA 11.1)
+ *
+ * This activity record represents a peer-to-peer memory copy
+ * (CUPTI_ACTIVITY_KIND_MEMCPY2).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMCPY2.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of the memory copy, stored as a byte to reduce record
+ * size. \see CUpti_ActivityMemcpyKind
+ */
+ uint8_t copyKind;
+
+ /**
+ * The source memory kind read by the memory copy, stored as a byte
+ * to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t srcKind;
+
+ /**
+ * The destination memory kind read by the memory copy, stored as a
+ * byte to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t dstKind;
+
+ /**
+ * The flags associated with the memory copy. \see
+ * CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The number of bytes transferred by the memory copy.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory copy is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory copy is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory copy is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The ID of the device where memory is being copied from.
+ */
+ uint32_t srcDeviceId;
+
+ /**
+ * The ID of the context owning the memory being copied from.
+ */
+ uint32_t srcContextId;
+
+ /**
+ * The ID of the device where memory is being copied to.
+ */
+ uint32_t dstDeviceId;
+
+ /**
+ * The ID of the context owning the memory being copied to.
+ */
+ uint32_t dstContextId;
+
+ /**
+ * The correlation ID of the memory copy. Each memory copy is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory copy.
+ */
+ uint32_t correlationId;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed the memcpy through graph launch.
+ * This field will be 0 if memcpy is not done using graph launch.
+ */
+ uint64_t graphNodeId;
+} CUpti_ActivityMemcpyPtoP2;
+
+/**
+ * \brief The activity record for peer-to-peer memory copies.
+ * (deprecated in CUDA 11.6)
+ *
+ * This activity record represents a peer-to-peer memory copy
+ * (CUPTI_ACTIVITY_KIND_MEMCPY2).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMCPY2.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The kind of the memory copy, stored as a byte to reduce record
+ * size. \see CUpti_ActivityMemcpyKind
+ */
+ uint8_t copyKind;
+
+ /**
+ * The source memory kind read by the memory copy, stored as a byte
+ * to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t srcKind;
+
+ /**
+ * The destination memory kind read by the memory copy, stored as a
+ * byte to reduce record size. \see CUpti_ActivityMemoryKind
+ */
+ uint8_t dstKind;
+
+ /**
+ * The flags associated with the memory copy. \see
+ * CUpti_ActivityFlag
+ */
+ uint8_t flags;
+
+ /**
+ * The number of bytes transferred by the memory copy.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory copy, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory copy.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory copy is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory copy is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory copy is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The ID of the device where memory is being copied from.
+ */
+ uint32_t srcDeviceId;
+
+ /**
+ * The ID of the context owning the memory being copied from.
+ */
+ uint32_t srcContextId;
+
+ /**
+ * The ID of the device where memory is being copied to.
+ */
+ uint32_t dstDeviceId;
+
+ /**
+ * The ID of the context owning the memory being copied to.
+ */
+ uint32_t dstContextId;
+
+ /**
+ * The correlation ID of the memory copy. Each memory copy is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory copy.
+ */
+ uint32_t correlationId;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed the memcpy through graph launch.
+ * This field will be 0 if memcpy is not done using graph launch.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The unique ID of the graph that executed this memcpy through graph launch.
+ * This field will be 0 if the memcpy is not done through graph launch.
+ */
+ uint32_t graphId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t padding;
+} CUpti_ActivityMemcpyPtoP3;
+
+/**
+ * \brief The activity record for memset. (deprecated)
+ *
+ * This activity record represents a memory set operation
+ * (CUPTI_ACTIVITY_KIND_MEMSET).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMSET.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The value being assigned to memory by the memory set.
+ */
+ uint32_t value;
+
+ /**
+ * The number of bytes being set by the memory set.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory set, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory set.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory set, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory set.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory set is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory set is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory set is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The correlation ID of the memory set. Each memory set is assigned
+ * a unique correlation ID that is identical to the correlation ID
+ * in the driver API activity record that launched the memory set.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The flags associated with the memset. \see CUpti_ActivityFlag
+ */
+ uint16_t flags;
+
+ /**
+ * The memory kind of the memory set \see CUpti_ActivityMemoryKind
+ */
+ uint16_t memoryKind;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+} CUpti_ActivityMemset;
+
+/**
+ * \brief The activity record for memset. (deprecated in CUDA 11.1)
+ *
+ * This activity record represents a memory set operation
+ * (CUPTI_ACTIVITY_KIND_MEMSET).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMSET.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The value being assigned to memory by the memory set.
+ */
+ uint32_t value;
+
+ /**
+ * The number of bytes being set by the memory set.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory set, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory set.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory set, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory set.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory set is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory set is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory set is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The correlation ID of the memory set. Each memory set is assigned
+ * a unique correlation ID that is identical to the correlation ID
+ * in the driver API activity record that launched the memory set.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The flags associated with the memset. \see CUpti_ActivityFlag
+ */
+ uint16_t flags;
+
+ /**
+ * The memory kind of the memory set \see CUpti_ActivityMemoryKind
+ */
+ uint16_t memoryKind;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed this memset through graph launch.
+ * This field will be 0 if the memset is not executed through graph launch.
+ */
+ uint64_t graphNodeId;
+} CUpti_ActivityMemset2;
+
+/**
+ * \brief The activity record for memset. (deprecated in CUDA 11.6)
+ *
+ * This activity record represents a memory set operation
+ * (CUPTI_ACTIVITY_KIND_MEMSET).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMSET.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The value being assigned to memory by the memory set.
+ */
+ uint32_t value;
+
+ /**
+ * The number of bytes being set by the memory set.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory set, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory set.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the memory set, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the memory set.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the memory set is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context where the memory set is occurring.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the memory set is occurring.
+ */
+ uint32_t streamId;
+
+ /**
+ * The correlation ID of the memory set. Each memory set is assigned
+ * a unique correlation ID that is identical to the correlation ID
+ * in the driver API activity record that launched the memory set.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The flags associated with the memset. \see CUpti_ActivityFlag
+ */
+ uint16_t flags;
+
+ /**
+ * The memory kind of the memory set \see CUpti_ActivityMemoryKind
+ */
+ uint16_t memoryKind;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ void *reserved0;
+
+ /**
+ * The unique ID of the graph node that executed this memset through graph launch.
+ * This field will be 0 if the memset is not executed through graph launch.
+ */
+ uint64_t graphNodeId;
+
+ /**
+ * The unique ID of the graph that executed this memset through graph launch.
+ * This field will be 0 if the memset is not executed through graph launch.
+ */
+ uint32_t graphId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t padding;
+} CUpti_ActivityMemset3;
+
+/**
+ * \brief The activity record for memory.
+ *
+ * This activity record represents a memory allocation and free operation
+ * (CUPTI_ACTIVITY_KIND_MEMORY2).
+ * This activity record provides separate records for memory allocation and
+ * memory release operations.
+ * This allows to correlate the corresponding driver and runtime API
+ * activity record with the memory operation.
+ *
+ * Note: This activity record is an upgrade over \ref CUpti_ActivityMemory
+ * enabled using the kind \ref CUPTI_ACTIVITY_KIND_MEMORY.
+ * \ref CUpti_ActivityMemory provides a single record for the memory
+ * allocation and memory release operations.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMORY2
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The memory operation requested by the user, \ref CUpti_ActivityMemoryOperationType.
+ */
+ CUpti_ActivityMemoryOperationType memoryOperationType;
+
+ /**
+ * The memory kind requested by the user, \ref CUpti_ActivityMemoryKind.
+ */
+ CUpti_ActivityMemoryKind memoryKind;
+
+ /**
+ * The correlation ID of the memory operation. Each memory operation is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory operation.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The virtual address of the allocation.
+ */
+ uint64_t address;
+
+ /**
+ * The number of bytes of memory allocated.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory operation, in ns.
+ */
+ uint64_t timestamp;
+
+ /**
+ * The program counter of the memory operation.
+ */
+ uint64_t PC;
+
+ /**
+ * The ID of the process to which this record belongs to.
+ */
+ uint32_t processId;
+
+ /**
+ * The ID of the device where the memory operation is taking place.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context. If context is NULL, \p contextId is set to CUPTI_INVALID_CONTEXT_ID.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream. If memory operation is not async, \p streamId is set to CUPTI_INVALID_STREAM_ID.
+ */
+ uint32_t streamId;
+
+ /**
+ * Variable name. This name is shared across all activity
+ * records representing the same symbol, and so should not be
+ * modified.
+ */
+ const char* name;
+
+ /**
+ * \p isAsync is set if memory operation happens through async memory APIs.
+ */
+ uint32_t isAsync;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad1;
+#endif
+
+ /**
+ * The memory pool configuration used for the memory operations.
+ */
+ struct {
+ /**
+ * The type of the memory pool, \ref CUpti_ActivityMemoryPoolType
+ */
+ CUpti_ActivityMemoryPoolType memoryPoolType;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad2;
+#endif
+
+ /**
+ * The base address of the memory pool.
+ */
+ uint64_t address;
+
+ /**
+ * The release threshold of the memory pool in bytes. \p releaseThreshold is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t releaseThreshold;
+
+ /**
+ * The size of the memory pool in bytes and the processID of the memory pool.
+ * \p size is valid if \p memoryPoolType is
+ * CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ * \p processId is valid if \p memoryPoolType is
+ * CUPTI_ACTIVITY_MEMORY_POOL_TYPE_IMPORTED, \ref CUpti_ActivityMemoryPoolType.
+ */
+ union {
+ uint64_t size;
+ uint64_t processId;
+ } pool;
+ } memoryPoolConfig;
+
+} CUpti_ActivityMemory2;
+
+/**
+ * \brief The activity record for memory.
+ *
+ * This activity record represents a memory allocation and free operation
+ * (CUPTI_ACTIVITY_KIND_MEMORY2).
+ * This activity record provides separate records for memory allocation and
+ * memory release operations.
+ * This allows to correlate the corresponding driver and runtime API
+ * activity record with the memory operation.
+ *
+ * Note: This activity record is an upgrade over \ref CUpti_ActivityMemory2
+ * enabled using the kind \ref CUPTI_ACTIVITY_KIND_MEMORY.
+ * \ref CUpti_ActivityMemory provides a single record for the memory
+ * allocation and memory release operations.
+ */
+
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMORY2
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The memory operation requested by the user, \ref CUpti_ActivityMemoryOperationType.
+ */
+ CUpti_ActivityMemoryOperationType memoryOperationType;
+
+ /**
+ * The memory kind requested by the user, \ref CUpti_ActivityMemoryKind.
+ */
+ CUpti_ActivityMemoryKind memoryKind;
+
+ /**
+ * The correlation ID of the memory operation. Each memory operation is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory operation.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The virtual address of the allocation.
+ */
+ uint64_t address;
+
+ /**
+ * The number of bytes of memory allocated.
+ */
+ uint64_t bytes;
+
+ /**
+ * The start timestamp for the memory operation, in ns.
+ */
+ uint64_t timestamp;
+
+ /**
+ * The program counter of the memory operation.
+ */
+ uint64_t PC;
+
+ /**
+ * The ID of the process to which this record belongs to.
+ */
+ uint32_t processId;
+
+ /**
+ * The ID of the device where the memory operation is taking place.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The ID of the context. If context is NULL, \p contextId is set to CUPTI_INVALID_CONTEXT_ID.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream. If memory operation is not async, \p streamId is set to CUPTI_INVALID_STREAM_ID.
+ */
+ uint32_t streamId;
+
+ /**
+ * Variable name. This name is shared across all activity
+ * records representing the same symbol, and so should not be
+ * modified.
+ */
+ const char* name;
+
+ /**
+ * \p isAsync is set if memory operation happens through async memory APIs.
+ */
+ uint32_t isAsync;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad1;
+#endif
+
+ /**
+ * The memory pool configuration used for the memory operations.
+ */
+ struct PACKED_ALIGNMENT {
+ /**
+ * The type of the memory pool, \ref CUpti_ActivityMemoryPoolType
+ */
+ CUpti_ActivityMemoryPoolType memoryPoolType;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad2;
+#endif
+
+ /**
+ * The base address of the memory pool.
+ */
+ uint64_t address;
+
+ /**
+ * The release threshold of the memory pool in bytes. \p releaseThreshold is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t releaseThreshold;
+
+ /**
+ * The size of memory pool in bytes and the processId of the memory pools
+ * \p size is valid if \p memoryPoolType is
+ * CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ * \p processId is valid if \p memoryPoolType is
+ * CUPTI_ACTIVITY_MEMORY_POOL_TYPE_IMPORTED, \ref CUpti_ActivityMemoryPoolType
+ */
+ union {
+ uint64_t size;
+ uint64_t processId;
+ } pool;
+
+ /**
+ * The utilized size of the memory pool. \p utilizedSize is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t utilizedSize;
+ } memoryPoolConfig;
+
+} CUpti_ActivityMemory3;
+
+/**
+ * \brief The activity record for memory pool.
+ *
+ * This activity record represents a memory pool creation, destruction and
+ * trimming (CUPTI_ACTIVITY_KIND_MEMORY_POOL).
+ * This activity record provides separate records for memory pool creation,
+ * destruction and trimming operations.
+ * This allows to correlate the corresponding driver and runtime API
+ * activity record with the memory pool operation.
+ *
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MEMORY_POOL
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The memory operation requested by the user, \ref CUpti_ActivityMemoryPoolOperationType.
+ */
+ CUpti_ActivityMemoryPoolOperationType memoryPoolOperationType;
+
+ /**
+ * The type of the memory pool, \ref CUpti_ActivityMemoryPoolType
+ */
+ CUpti_ActivityMemoryPoolType memoryPoolType;
+
+ /**
+ * The correlation ID of the memory pool operation. Each memory pool
+ * operation is assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver and runtime API activity record that
+ * launched the memory operation.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The ID of the process to which this record belongs to.
+ */
+ uint32_t processId;
+
+ /**
+ * The ID of the device where the memory pool is created.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The minimum bytes to keep of the memory pool. \p minBytesToKeep is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_OPERATION_TYPE_TRIMMED,
+ * \ref CUpti_ActivityMemoryPoolOperationType
+ */
+ size_t minBytesToKeep;
+
+#ifndef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The virtual address of the allocation.
+ */
+ uint64_t address;
+
+ /**
+ * The size of the memory pool operation in bytes. \p size is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t size;
+
+ /**
+ * The release threshold of the memory pool. \p releaseThreshold is
+ * valid for CUPTI_ACTIVITY_MEMORY_POOL_TYPE_LOCAL, \ref CUpti_ActivityMemoryPoolType.
+ */
+ uint64_t releaseThreshold;
+
+ /**
+ * The start timestamp for the memory operation, in ns.
+ */
+ uint64_t timestamp;
+} CUpti_ActivityMemoryPool;
+
+/**
+ * \brief The activity record providing a marker which is an
+ * instantaneous point in time. (deprecated in CUDA 8.0)
+ *
+ * The marker is specified with a descriptive name and unique id
+ * (CUPTI_ACTIVITY_KIND_MARKER).
+ * Marker activity is now reported using the
+ * CUpti_ActivityMarker2 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_MARKER.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The flags associated with the marker. \see CUpti_ActivityFlag
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The timestamp for the marker, in ns. A value of 0 indicates that
+ * timestamp information could not be collected for the marker.
+ */
+ uint64_t timestamp;
+
+ /**
+ * The marker ID.
+ */
+ uint32_t id;
+
+ /**
+ * The kind of activity object associated with this marker.
+ */
+ CUpti_ActivityObjectKind objectKind;
+
+ /**
+ * The identifier for the activity object associated with this
+ * marker. 'objectKind' indicates which ID is valid for this record.
+ */
+ CUpti_ActivityObjectKindId objectId;
+
+#ifdef CUPTILP64
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+#endif
+
+ /**
+ * The marker name for an instantaneous or start marker. This will
+ * be NULL for an end marker.
+ */
+ const char *name;
+
+} CUpti_ActivityMarker;
+
+/**
+ * \brief The activity record for source-level global
+ * access. (deprecated)
+ *
+ * This activity records the locations of the global
+ * accesses in the source (CUPTI_ACTIVITY_KIND_GLOBAL_ACCESS).
+ * Global access activities are now reported using the
+ * CUpti_ActivityGlobalAccess3 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_GLOBAL_ACCESS.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this global access.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The pc offset for the access.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * The number of times this instruction was executed per warp. It will be incremented
+ * when at least one of thread among warp is active with predicate and condition code
+ * evaluating to true.
+ */
+ uint32_t executed;
+
+ /**
+ * This increments each time when this instruction is executed by number
+ * of threads that executed this instruction with predicate and condition code evaluating to true.
+ */
+ uint64_t threadsExecuted;
+
+ /**
+ * The total number of 32 bytes transactions to L2 cache generated by this access
+ */
+ uint64_t l2_transactions;
+} CUpti_ActivityGlobalAccess;
+
+/**
+ * \brief The activity record for source-level global
+ * access. (deprecated in CUDA 9.0)
+ *
+ * This activity records the locations of the global
+ * accesses in the source (CUPTI_ACTIVITY_KIND_GLOBAL_ACCESS).
+ * Global access activities are now reported using the
+ * CUpti_ActivityGlobalAccess3 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_GLOBAL_ACCESS.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this global access.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * The pc offset for the access.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * This increments each time when this instruction is executed by number
+ * of threads that executed this instruction with predicate and condition code evaluating to true.
+ */
+ uint64_t threadsExecuted;
+
+ /**
+ * The total number of 32 bytes transactions to L2 cache generated by this access
+ */
+ uint64_t l2_transactions;
+
+ /**
+ * The minimum number of L2 transactions possible based on the access pattern.
+ */
+ uint64_t theoreticalL2Transactions;
+
+ /**
+ * The number of times this instruction was executed per warp. It will be incremented
+ * when at least one of thread among warp is active with predicate and condition code
+ * evaluating to true.
+ */
+ uint32_t executed;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityGlobalAccess2;
+
+/**
+ * \brief The activity record for source level result
+ * branch. (deprecated)
+ *
+ * This activity record the locations of the branches in the
+ * source (CUPTI_ACTIVITY_KIND_BRANCH).
+ * Branch activities are now reported using the
+ * CUpti_ActivityBranch2 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_BRANCH.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The pc offset for the branch.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * The number of times this instruction was executed per warp. It will be incremented
+ * regardless of predicate or condition code.
+ */
+ uint32_t executed;
+
+ /**
+ * Number of times this branch diverged
+ */
+ uint32_t diverged;
+
+ /**
+ * This increments each time when this instruction is executed by number
+ * of threads that executed this instruction
+ */
+ uint64_t threadsExecuted;
+} CUpti_ActivityBranch;
+
+/**
+ * \brief The activity record for PC sampling. (deprecated in CUDA 8.0)
+ *
+ * This activity records information obtained by sampling PC
+ * (CUPTI_ACTIVITY_KIND_PC_SAMPLING).
+ * PC sampling activities are now reported using the
+ * CUpti_ActivityPCSampling2 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_PC_SAMPLING.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this instruction.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * The pc offset for the instruction.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * Number of times the PC was sampled with the stallReason in the record.
+ * The same PC can be sampled with different stall reasons.
+ */
+ uint32_t samples;
+
+ /**
+ * Current stall reason. Includes one of the reasons from
+ * \ref CUpti_ActivityPCSamplingStallReason
+ */
+ CUpti_ActivityPCSamplingStallReason stallReason;
+} CUpti_ActivityPCSampling;
+
+/**
+ * \brief The activity record for PC sampling. (deprecated in CUDA 9.0)
+ *
+ * This activity records information obtained by sampling PC
+ * (CUPTI_ACTIVITY_KIND_PC_SAMPLING).
+ * PC sampling activities are now reported using the
+ * CUpti_ActivityPCSampling3 activity record.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_PC_SAMPLING.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The properties of this instruction.
+ */
+ CUpti_ActivityFlag flags;
+
+ /**
+ * The ID for source locator.
+ */
+ uint32_t sourceLocatorId;
+
+ /**
+ * The correlation ID of the kernel to which this result is associated.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Correlation ID with global/device function name
+ */
+ uint32_t functionId;
+
+ /**
+ * The pc offset for the instruction.
+ */
+ uint32_t pcOffset;
+
+ /**
+ * Number of times the PC was sampled with the stallReason in the record.
+ * These samples indicate that no instruction was issued in that cycle from
+ * the warp scheduler from where the warp was sampled.
+ * Field is valid for devices with compute capability 6.0 and higher
+ */
+ uint32_t latencySamples;
+
+ /**
+ * Number of times the PC was sampled with the stallReason in the record.
+ * The same PC can be sampled with different stall reasons. The count includes
+ * latencySamples.
+ */
+ uint32_t samples;
+
+ /**
+ * Current stall reason. Includes one of the reasons from
+ * \ref CUpti_ActivityPCSamplingStallReason
+ */
+ CUpti_ActivityPCSamplingStallReason stallReason;
+
+ uint32_t pad;
+} CUpti_ActivityPCSampling2;
+
+/**
+ * \brief The activity record for Unified Memory counters (deprecated in CUDA 7.0)
+ *
+ * This activity record represents a Unified Memory counter
+ * (CUPTI_ACTIVITY_KIND_UNIFIED_MEMORY_COUNTER).
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_UNIFIED_MEMORY_COUNTER
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The Unified Memory counter kind. See \ref CUpti_ActivityUnifiedMemoryCounterKind
+ */
+ CUpti_ActivityUnifiedMemoryCounterKind counterKind;
+
+ /**
+ * Scope of the Unified Memory counter. See \ref CUpti_ActivityUnifiedMemoryCounterScope
+ */
+ CUpti_ActivityUnifiedMemoryCounterScope scope;
+
+ /**
+ * The ID of the device involved in the memory transfer operation.
+ * It is not relevant if the scope of the counter is global (all devices).
+ */
+ uint32_t deviceId;
+
+ /**
+ * Value of the counter
+ *
+ */
+ uint64_t value;
+
+ /**
+ * The timestamp when this sample was retrieved, in ns. A value of 0
+ * indicates that timestamp information could not be collected
+ */
+ uint64_t timestamp;
+
+ /**
+ * The ID of the process to which this record belongs to. In case of
+ * global scope, processId is undefined.
+ */
+ uint32_t processId;
+
+ /**
+ * Undefined. Reserved for internal use.
+ */
+ uint32_t pad;
+} CUpti_ActivityUnifiedMemoryCounter;
+
+/**
+* \brief NVLink information. (deprecated in CUDA 9.0)
+*
+* This structure gives capabilities of each logical NVLink connection between two devices,
+* gpu<->gpu or gpu<->CPU which can be used to understand the topology.
+* NVLink information are now reported using the
+* CUpti_ActivityNvLink2 activity record.
+*/
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_NVLINK.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * NVLink version.
+ */
+ uint32_t nvlinkVersion;
+
+ /**
+ * Type of device 0 \ref CUpti_DevType
+ */
+ CUpti_DevType typeDev0;
+
+ /**
+ * Type of device 1 \ref CUpti_DevType
+ */
+ CUpti_DevType typeDev1;
+
+ /**
+ * If typeDev0 is CUPTI_DEV_TYPE_GPU, UUID for device 0. \ref CUpti_ActivityDevice5.
+ * If typeDev0 is CUPTI_DEV_TYPE_NPU, struct npu for NPU.
+ */
+ union {
+ CUuuid uuidDev;
+ struct {
+ /**
+ * Index of the NPU. First index will always be zero.
+ */
+ uint32_t index;
+
+ /**
+ * Domain ID of NPU. On Linux, this can be queried using lspci.
+ */
+ uint32_t domainId;
+ } npu;
+ } idDev0;
+
+ /**
+ * If typeDev1 is CUPTI_DEV_TYPE_GPU, UUID for device 1. \ref CUpti_ActivityDevice5.
+ * If typeDev1 is CUPTI_DEV_TYPE_NPU, struct npu for NPU.
+ */
+ union {
+ CUuuid uuidDev;
+ struct {
+ /**
+ * Index of the NPU. First index will always be zero.
+ */
+ uint32_t index;
+
+ /**
+ * Domain ID of NPU. On Linux, this can be queried using lspci.
+ */
+ uint32_t domainId;
+ } npu;
+ } idDev1;
+
+ /**
+ * Flag gives capabilities of the link \see CUpti_LinkFlag
+ */
+ uint32_t flag;
+
+ /**
+ * Number of physical NVLinks present between two devices.
+ */
+ uint32_t physicalNvLinkCount;
+
+ /**
+ * Port numbers for maximum 4 NVLinks connected to device 0.
+ * If typeDev0 is CUPTI_DEV_TYPE_NPU, ignore this field.
+ * In case of invalid/unknown port number, this field will be set
+ * to value CUPTI_NVLINK_INVALID_PORT.
+ * This will be used to correlate the metric values to individual
+ * physical link and attribute traffic to the logical NVLink in
+ * the topology.
+ */
+ int8_t portDev0[4];
+
+ /**
+ * Port numbers for maximum 4 NVLinks connected to device 1.
+ * If typeDev1 is CUPTI_DEV_TYPE_NPU, ignore this field.
+ * In case of invalid/unknown port number, this field will be set
+ * to value CUPTI_NVLINK_INVALID_PORT.
+ * This will be used to correlate the metric values to individual
+ * physical link and attribute traffic to the logical NVLink in
+ * the topology.
+ */
+ int8_t portDev1[4];
+
+ /**
+ * Bandwidth of NVLink in kbytes/sec
+ */
+ uint64_t bandwidth;
+} CUpti_ActivityNvLink;
+
+/**
+* \brief NVLink information. (deprecated in CUDA 10.0)
+*
+* This structure gives capabilities of each logical NVLink connection between two devices,
+* gpu<->gpu or gpu<->CPU which can be used to understand the topology.
+* NvLink information are now reported using the
+* CUpti_ActivityNvLink4 activity record.
+*/
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_NVLINK.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * NvLink version.
+ */
+ uint32_t nvlinkVersion;
+
+ /**
+ * Type of device 0 \ref CUpti_DevType
+ */
+ CUpti_DevType typeDev0;
+
+ /**
+ * Type of device 1 \ref CUpti_DevType
+ */
+ CUpti_DevType typeDev1;
+
+ /**
+ * If typeDev0 is CUPTI_DEV_TYPE_GPU, UUID for device 0. \ref CUpti_ActivityDevice5.
+ * If typeDev0 is CUPTI_DEV_TYPE_NPU, struct npu for NPU.
+ */
+ union {
+ CUuuid uuidDev;
+ struct {
+ /**
+ * Index of the NPU. First index will always be zero.
+ */
+ uint32_t index;
+
+ /**
+ * Domain ID of NPU. On Linux, this can be queried using lspci.
+ */
+ uint32_t domainId;
+ } npu;
+ } idDev0;
+
+ /**
+ * If typeDev1 is CUPTI_DEV_TYPE_GPU, UUID for device 1. \ref CUpti_ActivityDevice5.
+ * If typeDev1 is CUPTI_DEV_TYPE_NPU, struct npu for NPU.
+ */
+ union {
+ CUuuid uuidDev;
+ struct {
+ /**
+ * Index of the NPU. First index will always be zero.
+ */
+ uint32_t index;
+
+ /**
+ * Domain ID of NPU. On Linux, this can be queried using lspci.
+ */
+ uint32_t domainId;
+ } npu;
+ } idDev1;
+
+ /**
+ * Flag gives capabilities of the link \see CUpti_LinkFlag
+ */
+ uint32_t flag;
+
+ /**
+ * Number of physical NVLinks present between two devices.
+ */
+ uint32_t physicalNvLinkCount;
+
+ /**
+ * Port numbers for maximum 16 NVLinks connected to device 0.
+ * If typeDev0 is CUPTI_DEV_TYPE_NPU, ignore this field.
+ * In case of invalid/unknown port number, this field will be set
+ * to value CUPTI_NVLINK_INVALID_PORT.
+ * This will be used to correlate the metric values to individual
+ * physical link and attribute traffic to the logical NVLink in
+ * the topology.
+ */
+ int8_t portDev0[CUPTI_MAX_NVLINK_PORTS];
+
+ /**
+ * Port numbers for maximum 16 NVLinks connected to device 1.
+ * If typeDev1 is CUPTI_DEV_TYPE_NPU, ignore this field.
+ * In case of invalid/unknown port number, this field will be set
+ * to value CUPTI_NVLINK_INVALID_PORT.
+ * This will be used to correlate the metric values to individual
+ * physical link and attribute traffic to the logical NVLink in
+ * the topology.
+ */
+ int8_t portDev1[CUPTI_MAX_NVLINK_PORTS];
+
+ /**
+ * Bandwidth of NVLink in kbytes/sec
+ */
+ uint64_t bandwidth;
+} CUpti_ActivityNvLink2;
+
+/**
+* \brief NVLink information.
+*
+* This structure gives capabilities of each logical NVLink connection between two devices,
+* gpu<->gpu or gpu<->CPU which can be used to understand the topology.
+* NvLink information are now reported using the
+* CUpti_ActivityNvLink4 activity record.
+*/
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_NVLINK.
+ */
+ CUpti_ActivityKind kind;
+ /**
+ * NvLink version.
+ */
+ uint32_t nvlinkVersion;
+
+ /**
+ * Type of device 0 \ref CUpti_DevType
+ */
+ CUpti_DevType typeDev0;
+
+ /**
+ * Type of device 1 \ref CUpti_DevType
+ */
+ CUpti_DevType typeDev1;
+
+ /**
+ * If typeDev0 is CUPTI_DEV_TYPE_GPU, UUID for device 0. \ref CUpti_ActivityDevice5.
+ * If typeDev0 is CUPTI_DEV_TYPE_NPU, struct npu for NPU.
+ */
+ union {
+ CUuuid uuidDev;
+ struct {
+ /**
+ * Index of the NPU. First index will always be zero.
+ */
+ uint32_t index;
+
+ /**
+ * Domain ID of NPU. On Linux, this can be queried using lspci.
+ */
+ uint32_t domainId;
+ } npu;
+ } idDev0;
+
+ /**
+ * If typeDev1 is CUPTI_DEV_TYPE_GPU, UUID for device 1. \ref CUpti_ActivityDevice5.
+ * If typeDev1 is CUPTI_DEV_TYPE_NPU, struct npu for NPU.
+ */
+ union {
+ CUuuid uuidDev;
+ struct {
+ /**
+ * Index of the NPU. First index will always be zero.
+ */
+ uint32_t index;
+
+ /**
+ * Domain ID of NPU. On Linux, this can be queried using lspci.
+ */
+ uint32_t domainId;
+ } npu;
+ } idDev1;
+
+ /**
+ * Flag gives capabilities of the link \see CUpti_LinkFlag
+ */
+ uint32_t flag;
+
+ /**
+ * Number of physical NVLinks present between two devices.
+ */
+ uint32_t physicalNvLinkCount;
+
+ /**
+ * Port numbers for maximum 16 NVLinks connected to device 0.
+ * If typeDev0 is CUPTI_DEV_TYPE_NPU, ignore this field.
+ * In case of invalid/unknown port number, this field will be set
+ * to value CUPTI_NVLINK_INVALID_PORT.
+ * This will be used to correlate the metric values to individual
+ * physical link and attribute traffic to the logical NVLink in
+ * the topology.
+ */
+ int8_t portDev0[CUPTI_MAX_NVLINK_PORTS];
+
+ /**
+ * Port numbers for maximum 16 NVLinks connected to device 1.
+ * If typeDev1 is CUPTI_DEV_TYPE_NPU, ignore this field.
+ * In case of invalid/unknown port number, this field will be set
+ * to value CUPTI_NVLINK_INVALID_PORT.
+ * This will be used to correlate the metric values to individual
+ * physical link and attribute traffic to the logical NVLink in
+ * the topology.
+ */
+ int8_t portDev1[CUPTI_MAX_NVLINK_PORTS];
+
+ /**
+ * Bandwidth of NVLink in kbytes/sec
+ */
+ uint64_t bandwidth;
+
+ /**
+ * NVSwitch is connected as an intermediate node.
+ */
+ uint8_t nvswitchConnected;
+
+ /**
+ * Undefined. reserved for internal use
+ */
+ uint8_t pad[7];
+} CUpti_ActivityNvLink3;
+
+/**
+ * \brief The activity record for trace of graph execution.
+ *
+ * This activity record represents execution for a graph without giving visibility
+ * about the execution of its nodes. This is intended to reduce overheads in tracing
+ * each node. The activity kind is CUPTI_ACTIVITY_KIND_GRAPH_TRACE
+ * Graph trace activity is now reported using CUpti_ActivityGraphTrace2 record.
+ */
+typedef struct {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_GRAPH_TRACE
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The correlation ID of the graph launch. Each graph launch is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver API activity record that launched
+ * the graph.
+ */
+ uint32_t correlationId;
+
+ /**
+ * The start timestamp for the graph execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the graph.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the graph execution, in ns. A value of 0
+ * for both the start and end timestamps indicates that timestamp
+ * information could not be collected for the graph.
+ */
+ uint64_t end;
+
+ /**
+ * The ID of the device where the graph execution is occurring.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The unique ID of the graph that is launched.
+ */
+ uint32_t graphId;
+
+ /**
+ * The ID of the context where the graph is being launched.
+ */
+ uint32_t contextId;
+
+ /**
+ * The ID of the stream where the graph is being launched.
+ */
+ uint32_t streamId;
+
+ /**
+ * This field is reserved for internal use
+ */
+ void *reserved;
+} CUpti_ActivityGraphTrace;
+
+/**
+ * \brief The activity record for a context.
+ *
+ * This activity record represents information about a context
+ * (CUPTI_ACTIVITY_KIND_CONTEXT).
+ * Context activity is now reported using CUpti_ActivityContext3 record
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_CONTEXT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The context ID.
+ */
+ uint32_t contextId;
+
+ /**
+ * The device ID.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The compute API kind. \see CUpti_ActivityComputeApiKind
+ */
+ uint16_t computeApiKind;
+
+ /**
+ * The ID for the NULL stream in this context
+ */
+ uint16_t nullStreamId;
+} CUpti_ActivityContext;
+
+/**
+ * \brief The activity record for a context.
+ *
+ * This activity record represents information about a context
+ * (CUPTI_ACTIVITY_KIND_CONTEXT).
+ * Context activity is now reported using CUpti_ActivityContext3 record
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind, must be CUPTI_ACTIVITY_KIND_CONTEXT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The context ID.
+ */
+ uint32_t contextId;
+
+ /**
+ * The device ID.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The compute API kind. \see CUpti_ActivityComputeApiKind
+ */
+ uint16_t computeApiKind;
+
+ /**
+ * The ID for the NULL stream in this context
+ */
+ uint16_t nullStreamId;
+
+ /**
+ * The ID of the parent context. It would be 0 if
+ * context does not have parent
+ */
+ uint32_t parentContextId;
+
+ /**
+ * This field indicates whether the context is a green context
+ */
+ uint8_t isGreenContext;
+
+ uint8_t padding;
+
+ /**
+ * Number of multiprocessors assigned to the green context
+ * Invalid if the field 'isGreenContext' is 0
+ */
+ uint16_t numMultiprocessors;
+} CUpti_ActivityContext2;
+
+/**
+ * \brief The activity record for JIT operations.
+ * This activity represents the JIT operations (compile, load, store) of a CUmodule
+ * from the Compute Cache.
+ * Gives the exact hashed path of where the cached module is loaded from,
+ * or where the module will be stored after Just-In-Time (JIT) compilation.
+ *
+ * JIT activity is now reported using CUpti_ActivityJit2 record
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * The activity record kind must be CUPTI_ACTIVITY_KIND_JIT.
+ */
+ CUpti_ActivityKind kind;
+
+ /**
+ * The JIT entry type.
+ */
+ CUpti_ActivityJitEntryType jitEntryType;
+
+ /**
+ * The JIT operation type.
+ */
+ CUpti_ActivityJitOperationType jitOperationType;
+
+ /**
+ * The device ID.
+ */
+ uint32_t deviceId;
+
+ /**
+ * The start timestamp for the JIT operation, in ns. A value of 0 for
+ * both the start and end timestamps indicates that timestamp
+ * information could not be collected for the JIT operation.
+ */
+ uint64_t start;
+
+ /**
+ * The end timestamp for the JIT operation, in ns. A value of 0 for both
+ * the start and end timestamps indicates that timestamp information
+ * could not be collected for the JIT operation.
+ */
+ uint64_t end;
+
+ /**
+ * The correlation ID of the JIT operation to which
+ * records belong to. Each JIT operation is
+ * assigned a unique correlation ID that is identical to the
+ * correlation ID in the driver or runtime API activity record that
+ * launched the JIT operation.
+ */
+ uint32_t correlationId;
+
+ /**
+ * Internal use.
+ */
+ uint32_t padding;
+
+ /**
+ * The correlation ID to correlate JIT compilation, load and store operations.
+ * Each JIT compilation unit is assigned a unique correlation ID
+ * at the time of the JIT compilation. This correlation id can be used
+ * to find the matching JIT cache load/store records.
+ */
+ uint64_t jitOperationCorrelationId;
+
+ /**
+ * The size of compute cache.
+ */
+ uint64_t cacheSize;
+
+ /**
+ * The path where the fat binary is cached.
+ */
+ const char* cachePath;
+} CUpti_ActivityJit;
+
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /*_CUPTI_ACTIVITY_DEPRECATED_H_*/
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_callbacks.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_callbacks.h
new file mode 100644
index 0000000000000000000000000000000000000000..d1e032db489e54e4b2661668a51169e3393dfec2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_callbacks.h
@@ -0,0 +1,864 @@
+/*
+ * Copyright 2010-2023 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if !defined(__CUPTI_CALLBACKS_H__)
+#define __CUPTI_CALLBACKS_H__
+
+#include
+#include
+#include
+#include
+#include
+
+#ifndef CUPTIAPI
+#ifdef _WIN32
+#define CUPTIAPI __stdcall
+#else
+#define CUPTIAPI
+#endif
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility push(default)
+#endif
+
+/**
+ * \defgroup CUPTI_CALLBACK_API CUPTI Callback API
+ * Functions, types, and enums that implement the CUPTI Callback API.
+ * @{
+ */
+
+/**
+ * \brief Specifies the point in an API call that a callback is issued.
+ *
+ * Specifies the point in an API call that a callback is issued. This
+ * value is communicated to the callback function via \ref
+ * CUpti_CallbackData::callbackSite.
+ */
+typedef enum {
+ /**
+ * The callback is at the entry of the API call.
+ */
+ CUPTI_API_ENTER = 0,
+ /**
+ * The callback is at the exit of the API call.
+ */
+ CUPTI_API_EXIT = 1,
+ CUPTI_API_CBSITE_FORCE_INT = 0x7fffffff
+} CUpti_ApiCallbackSite;
+
+/**
+ * \brief Callback domains.
+ *
+ * Callback domains. Each domain represents callback points for a
+ * group of related API functions or CUDA driver activity.
+ */
+typedef enum {
+ /**
+ * Invalid domain.
+ */
+ CUPTI_CB_DOMAIN_INVALID = 0,
+ /**
+ * Domain containing callback points for all driver API functions.
+ */
+ CUPTI_CB_DOMAIN_DRIVER_API = 1,
+ /**
+ * Domain containing callback points for all runtime API
+ * functions.
+ */
+ CUPTI_CB_DOMAIN_RUNTIME_API = 2,
+ /**
+ * Domain containing callback points for CUDA resource tracking.
+ */
+ CUPTI_CB_DOMAIN_RESOURCE = 3,
+ /**
+ * Domain containing callback points for CUDA synchronization.
+ */
+ CUPTI_CB_DOMAIN_SYNCHRONIZE = 4,
+ /**
+ * Domain containing callback points for NVTX API functions.
+ */
+ CUPTI_CB_DOMAIN_NVTX = 5,
+ /**
+ * Domain containing callback points for various states.
+ */
+ CUPTI_CB_DOMAIN_STATE = 6,
+
+ CUPTI_CB_DOMAIN_SIZE,
+
+ CUPTI_CB_DOMAIN_FORCE_INT = 0x7fffffff
+} CUpti_CallbackDomain;
+
+/**
+ * \brief Callback IDs for resource domain.
+ *
+ * Callback IDs for resource domain, CUPTI_CB_DOMAIN_RESOURCE. This
+ * value is communicated to the callback function via the \p cbid
+ * parameter.
+ */
+typedef enum {
+ /**
+ * Invalid resource callback ID.
+ */
+ CUPTI_CBID_RESOURCE_INVALID = 0,
+ /**
+ * A new context has been created.
+ */
+ CUPTI_CBID_RESOURCE_CONTEXT_CREATED = 1,
+ /**
+ * A context is about to be destroyed.
+ */
+ CUPTI_CBID_RESOURCE_CONTEXT_DESTROY_STARTING = 2,
+ /**
+ * A new stream has been created.
+ */
+ CUPTI_CBID_RESOURCE_STREAM_CREATED = 3,
+ /**
+ * A stream is about to be destroyed.
+ */
+ CUPTI_CBID_RESOURCE_STREAM_DESTROY_STARTING = 4,
+ /**
+ * The driver has finished initializing.
+ */
+ CUPTI_CBID_RESOURCE_CU_INIT_FINISHED = 5,
+ /**
+ * A module has been loaded.
+ */
+ CUPTI_CBID_RESOURCE_MODULE_LOADED = 6,
+ /**
+ * A module is about to be unloaded.
+ */
+ CUPTI_CBID_RESOURCE_MODULE_UNLOAD_STARTING = 7,
+ /**
+ * The current module which is being profiled.
+ */
+ CUPTI_CBID_RESOURCE_MODULE_PROFILED = 8,
+ /**
+ * CUDA graph has been created.
+ */
+ CUPTI_CBID_RESOURCE_GRAPH_CREATED = 9,
+ /**
+ * CUDA graph is about to be destroyed.
+ */
+ CUPTI_CBID_RESOURCE_GRAPH_DESTROY_STARTING = 10,
+ /**
+ * CUDA graph is cloned.
+ */
+ CUPTI_CBID_RESOURCE_GRAPH_CLONED = 11,
+ /**
+ * CUDA graph node is about to be created
+ */
+ CUPTI_CBID_RESOURCE_GRAPHNODE_CREATE_STARTING = 12,
+ /**
+ * CUDA graph node is created.
+ */
+ CUPTI_CBID_RESOURCE_GRAPHNODE_CREATED = 13,
+ /**
+ * CUDA graph node is about to be destroyed.
+ */
+ CUPTI_CBID_RESOURCE_GRAPHNODE_DESTROY_STARTING = 14,
+ /**
+ * Dependency on a CUDA graph node is created.
+ */
+ CUPTI_CBID_RESOURCE_GRAPHNODE_DEPENDENCY_CREATED = 15,
+ /**
+ * Dependency on a CUDA graph node is destroyed.
+ */
+ CUPTI_CBID_RESOURCE_GRAPHNODE_DEPENDENCY_DESTROY_STARTING = 16,
+ /**
+ * An executable CUDA graph is about to be created.
+ */
+ CUPTI_CBID_RESOURCE_GRAPHEXEC_CREATE_STARTING = 17,
+ /**
+ * An executable CUDA graph is created.
+ */
+ CUPTI_CBID_RESOURCE_GRAPHEXEC_CREATED = 18,
+ /**
+ * An executable CUDA graph is about to be destroyed.
+ */
+ CUPTI_CBID_RESOURCE_GRAPHEXEC_DESTROY_STARTING = 19,
+ /**
+ * CUDA graph node is cloned.
+ */
+ CUPTI_CBID_RESOURCE_GRAPHNODE_CLONED = 20,
+ /**
+ * CUDA stream attribute is changed.
+ */
+ CUPTI_CBID_RESOURCE_STREAM_ATTRIBUTE_CHANGED = 21,
+
+ CUPTI_CBID_RESOURCE_SIZE,
+ CUPTI_CBID_RESOURCE_FORCE_INT = 0x7fffffff
+} CUpti_CallbackIdResource;
+
+/**
+ * \brief Callback IDs for synchronization domain.
+ *
+ * Callback IDs for synchronization domain,
+ * CUPTI_CB_DOMAIN_SYNCHRONIZE. This value is communicated to the
+ * callback function via the \p cbid parameter.
+ */
+typedef enum {
+ /**
+ * Invalid synchronize callback ID.
+ */
+ CUPTI_CBID_SYNCHRONIZE_INVALID = 0,
+ /**
+ * Stream synchronization has completed for the stream.
+ */
+ CUPTI_CBID_SYNCHRONIZE_STREAM_SYNCHRONIZED = 1,
+ /**
+ * Context synchronization has completed for the context.
+ */
+ CUPTI_CBID_SYNCHRONIZE_CONTEXT_SYNCHRONIZED = 2,
+ CUPTI_CBID_SYNCHRONIZE_SIZE,
+ CUPTI_CBID_SYNCHRONIZE_FORCE_INT = 0x7fffffff
+} CUpti_CallbackIdSync;
+
+
+/**
+ * \brief Callback IDs for state domain.
+ *
+ * Callback IDs for state domain,
+ * CUPTI_CB_DOMAIN_STATE. This value is communicated to the
+ * callback function via the \p cbid parameter.
+ */
+typedef enum {
+ /**
+ * Invalid state callback ID.
+ */
+ CUPTI_CBID_STATE_INVALID = 0,
+ /**
+ * Notification of fatal errors - high impact, non-recoverable
+ * When encountered, CUPTI automatically invokes cuptiFinalize()
+ * User can control behavior of the application in future from
+ * receiving this callback - such as continuing without profiling, or
+ * terminating the whole application.
+ */
+ CUPTI_CBID_STATE_FATAL_ERROR = 1,
+ /**
+ * Notification of non fatal errors - high impact, but recoverable
+ * This notification is not issued in the current release.
+ */
+ CUPTI_CBID_STATE_ERROR = 2,
+ /**
+ * Notification of warnings - low impact, recoverable
+ * This notification is not issued in the current release.
+ */
+ CUPTI_CBID_STATE_WARNING = 3,
+
+ CUPTI_CBID_STATE_SIZE,
+ CUPTI_CBID_STATE_FORCE_INT = 0x7fffffff
+} CUpti_CallbackIdState;
+
+
+/**
+ * \brief Data passed into a runtime or driver API callback function.
+ *
+ * Data passed into a runtime or driver API callback function as the
+ * \p cbdata argument to \ref CUpti_CallbackFunc. The \p cbdata will
+ * be this type for \p domain equal to CUPTI_CB_DOMAIN_DRIVER_API or
+ * CUPTI_CB_DOMAIN_RUNTIME_API. The callback data is valid only within
+ * the invocation of the callback function that is passed the data. If
+ * you need to retain some data for use outside of the callback, you
+ * must make a copy of that data. For example, if you make a shallow
+ * copy of CUpti_CallbackData within a callback, you cannot
+ * dereference \p functionParams outside of that callback to access
+ * the function parameters. \p functionName is an exception: the
+ * string pointed to by \p functionName is a global constant and so
+ * may be accessed outside of the callback.
+ */
+typedef struct {
+ /**
+ * Point in the runtime or driver function from where the callback
+ * was issued.
+ */
+ CUpti_ApiCallbackSite callbackSite;
+
+ /**
+ * Name of the runtime or driver API function which issued the
+ * callback. This string is a global constant and so may be
+ * accessed outside of the callback.
+ */
+ const char *functionName;
+
+ /**
+ * Pointer to the arguments passed to the runtime or driver API
+ * call. See generated_cuda_runtime_api_meta.h and
+ * generated_cuda_meta.h for structure definitions for the
+ * parameters for each runtime and driver API function.
+ */
+ const void *functionParams;
+
+ /**
+ * Pointer to the return value of the runtime or driver API
+ * call. This field is only valid within the exit::CUPTI_API_EXIT
+ * callback. For a runtime API \p functionReturnValue points to a
+ * \p cudaError_t. For a driver API \p functionReturnValue points
+ * to a \p CUresult.
+ */
+ void *functionReturnValue;
+
+ /**
+ * Name of the symbol operated on by the runtime or driver API
+ * function which issued the callback. This entry is valid only for
+ * driver and runtime launch callbacks, where it returns the name of
+ * the kernel.
+ */
+ const char *symbolName;
+
+ /**
+ * Driver context current to the thread, or null if no context is
+ * current. This value can change from the entry to exit callback
+ * of a runtime API function if the runtime initializes a context.
+ */
+ CUcontext context;
+
+ /**
+ * Unique ID for the CUDA context associated with the thread. The
+ * UIDs are assigned sequentially as contexts are created and are
+ * unique within a process.
+ */
+ uint32_t contextUid;
+
+ /**
+ * Pointer to data shared between the entry and exit callbacks of
+ * a given runtime or drive API function invocation. This field
+ * can be used to pass 64-bit values from the entry callback to
+ * the corresponding exit callback.
+ */
+ uint64_t *correlationData;
+
+ /**
+ * The activity record correlation ID for this callback. For a
+ * driver domain callback (i.e. \p domain
+ * CUPTI_CB_DOMAIN_DRIVER_API) this ID will equal the correlation ID
+ * in the CUpti_ActivityAPI record corresponding to the CUDA driver
+ * function call. For a runtime domain callback (i.e. \p domain
+ * CUPTI_CB_DOMAIN_RUNTIME_API) this ID will equal the correlation
+ * ID in the CUpti_ActivityAPI record corresponding to the CUDA
+ * runtime function call. Within the callback, this ID can be
+ * recorded to correlate user data with the activity record. This
+ * field is new in 4.1.
+ */
+ uint32_t correlationId;
+
+} CUpti_CallbackData;
+
+/**
+ * \brief Data passed into a resource callback function.
+ *
+ * Data passed into a resource callback function as the \p cbdata
+ * argument to \ref CUpti_CallbackFunc. The \p cbdata will be this
+ * type for \p domain equal to CUPTI_CB_DOMAIN_RESOURCE. The callback
+ * data is valid only within the invocation of the callback function
+ * that is passed the data. If you need to retain some data for use
+ * outside of the callback, you must make a copy of that data.
+ */
+typedef struct {
+ /**
+ * For CUPTI_CBID_RESOURCE_CONTEXT_CREATED and
+ * CUPTI_CBID_RESOURCE_CONTEXT_DESTROY_STARTING, the context being
+ * created or destroyed. For CUPTI_CBID_RESOURCE_STREAM_CREATED and
+ * CUPTI_CBID_RESOURCE_STREAM_DESTROY_STARTING, the context
+ * containing the stream being created or destroyed.
+ */
+ CUcontext context;
+
+ union {
+ /**
+ * For CUPTI_CBID_RESOURCE_STREAM_CREATED and
+ * CUPTI_CBID_RESOURCE_STREAM_DESTROY_STARTING, the stream being
+ * created or destroyed.
+ */
+ CUstream stream;
+ } resourceHandle;
+
+ /**
+ * Reserved for future use.
+ */
+ void *resourceDescriptor;
+} CUpti_ResourceData;
+
+
+/**
+ * \brief Module data passed into a resource callback function.
+ *
+ * CUDA module data passed into a resource callback function as the \p cbdata
+ * argument to \ref CUpti_CallbackFunc. The \p cbdata will be this
+ * type for \p domain equal to CUPTI_CB_DOMAIN_RESOURCE. The module
+ * data is valid only within the invocation of the callback function
+ * that is passed the data. If you need to retain some data for use
+ * outside of the callback, you must make a copy of that data.
+ */
+
+typedef struct {
+ /**
+ * Identifier to associate with the CUDA module.
+ */
+ uint32_t moduleId;
+
+ /**
+ * The size of the cubin.
+ */
+ size_t cubinSize;
+
+ /**
+ * Pointer to the associated cubin.
+ */
+ const char *pCubin;
+} CUpti_ModuleResourceData;
+
+/**
+ * \brief CUDA graphs data passed into a resource callback function.
+ *
+ * CUDA graphs data passed into a resource callback function as the \p cbdata
+ * argument to \ref CUpti_CallbackFunc. The \p cbdata will be this
+ * type for \p domain equal to CUPTI_CB_DOMAIN_RESOURCE. The graph
+ * data is valid only within the invocation of the callback function
+ * that is passed the data. If you need to retain some data for use
+ * outside of the callback, you must make a copy of that data.
+ */
+
+typedef struct {
+ /**
+ * CUDA graph
+ */
+ CUgraph graph;
+ /**
+ * The original CUDA graph from which \param graph is cloned
+ */
+ CUgraph originalGraph;
+ /**
+ * CUDA graph node
+ */
+ CUgraphNode node;
+ /**
+ * The original CUDA graph node from which \param node is cloned
+ */
+ CUgraphNode originalNode;
+ /**
+ * Type of the \param node
+ */
+ CUgraphNodeType nodeType;
+ /**
+ * The dependent graph node
+ * The size of the array is \param numDependencies.
+ */
+ CUgraphNode dependency;
+ /**
+ * CUDA executable graph
+ */
+ CUgraphExec graphExec;
+} CUpti_GraphData;
+
+/**
+ * \brief Data passed into a synchronize callback function.
+ *
+ * Data passed into a synchronize callback function as the \p cbdata
+ * argument to \ref CUpti_CallbackFunc. The \p cbdata will be this
+ * type for \p domain equal to CUPTI_CB_DOMAIN_SYNCHRONIZE. The
+ * callback data is valid only within the invocation of the callback
+ * function that is passed the data. If you need to retain some data
+ * for use outside of the callback, you must make a copy of that data.
+ */
+typedef struct {
+ /**
+ * The context of the stream being synchronized.
+ */
+ CUcontext context;
+ /**
+ * The stream being synchronized.
+ */
+ CUstream stream;
+} CUpti_SynchronizeData;
+
+/**
+ * \brief Data passed into a NVTX callback function.
+ *
+ * Data passed into a NVTX callback function as the \p cbdata argument
+ * to \ref CUpti_CallbackFunc. The \p cbdata will be this type for \p
+ * domain equal to CUPTI_CB_DOMAIN_NVTX. Unless otherwise notes, the
+ * callback data is valid only within the invocation of the callback
+ * function that is passed the data. If you need to retain some data
+ * for use outside of the callback, you must make a copy of that data.
+ */
+typedef struct {
+ /**
+ * Name of the NVTX API function which issued the callback. This
+ * string is a global constant and so may be accessed outside of the
+ * callback.
+ */
+ const char *functionName;
+
+ /**
+ * Pointer to the arguments passed to the NVTX API call. See
+ * generated_nvtx_meta.h for structure definitions for the
+ * parameters for each NVTX API function.
+ */
+ const void *functionParams;
+
+ /**
+ * Pointer to the return value of the NVTX API call. See
+ * nvToolsExt.h for each NVTX API function's return value.
+ */
+ const void *functionReturnValue;
+} CUpti_NvtxData;
+
+/**
+ * \brief Stream attribute data passed into a resource callback function
+ * for CUPTI_CBID_RESOURCE_STREAM_ATTRIBUTE_CHANGED callback
+
+ * Data passed into a resource callback function as the \p cbdata
+ * argument to \ref CUpti_CallbackFunc. The \p cbdata will be this
+ * type for \p domain equal to CUPTI_CB_DOMAIN_RESOURCE. The
+ * stream attribute data is valid only within the invocation of the callback
+ * function that is passed the data. If you need to retain some data
+ * for use outside of the callback, you must make a copy of that data.
+ */
+typedef struct {
+ /**
+ * The CUDA stream handle for the attribute
+ */
+ CUstream stream;
+
+ /**
+ * The type of the CUDA stream attribute
+ */
+ CUstreamAttrID attr;
+
+ /**
+ * The value of the CUDA stream attribute
+ */
+ const CUstreamAttrValue *value;
+} CUpti_StreamAttrData;
+
+/**
+ * \brief Data passed into a State callback function.
+ *
+ * Data passed into a State callback function as the \p cbdata argument
+ * to \ref CUpti_CallbackFunc. The \p cbdata will be this type for \p
+ * domain equal to CUPTI_CB_DOMAIN_STATE and callback Ids belonging to CUpti_CallbackIdState.
+ * Unless otherwise noted, the callback data is valid only within the invocation of the callback
+ * function that is passed the data. If you need to retain some data
+ * for use outside of the callback, you must make a copy of that data.
+ */
+typedef struct {
+ union {
+ /**
+ * Data passed along with the callback Ids
+ * Enum CUpti_CallbackIdState used to denote callback ids
+ */
+ struct {
+ /**
+ * Error code
+ */
+ CUptiResult result;
+ /**
+ * String containing more details. It can be NULL.
+ */
+ const char *message;
+ } notification;
+ };
+} CUpti_StateData;
+
+/**
+ * \brief An ID for a driver API, runtime API, resource or
+ * synchronization callback.
+ *
+ * An ID for a driver API, runtime API, resource or synchronization
+ * callback. Within a driver API callback this should be interpreted
+ * as a CUpti_driver_api_trace_cbid value (these values are defined in
+ * cupti_driver_cbid.h). Within a runtime API callback this should be
+ * interpreted as a CUpti_runtime_api_trace_cbid value (these values
+ * are defined in cupti_runtime_cbid.h). Within a resource API
+ * callback this should be interpreted as a \ref
+ * CUpti_CallbackIdResource value. Within a synchronize API callback
+ * this should be interpreted as a \ref CUpti_CallbackIdSync value.
+ */
+typedef uint32_t CUpti_CallbackId;
+
+/**
+ * \brief Function type for a callback.
+ *
+ * Function type for a callback. The type of the data passed to the
+ * callback in \p cbdata depends on the \p domain. If \p domain is
+ * CUPTI_CB_DOMAIN_DRIVER_API or CUPTI_CB_DOMAIN_RUNTIME_API the type
+ * of \p cbdata will be CUpti_CallbackData. If \p domain is
+ * CUPTI_CB_DOMAIN_RESOURCE the type of \p cbdata will be
+ * CUpti_ResourceData. If \p domain is CUPTI_CB_DOMAIN_SYNCHRONIZE the
+ * type of \p cbdata will be CUpti_SynchronizeData. If \p domain is
+ * CUPTI_CB_DOMAIN_NVTX the type of \p cbdata will be CUpti_NvtxData.
+ *
+ * \param userdata User data supplied at subscription of the callback
+ * \param domain The domain of the callback
+ * \param cbid The ID of the callback
+ * \param cbdata Data passed to the callback.
+ */
+typedef void (CUPTIAPI *CUpti_CallbackFunc)(
+ void *userdata,
+ CUpti_CallbackDomain domain,
+ CUpti_CallbackId cbid,
+ const void *cbdata);
+
+/**
+ * \brief A callback subscriber.
+ */
+typedef struct CUpti_Subscriber_st *CUpti_SubscriberHandle;
+
+/**
+ * \brief Pointer to an array of callback domains.
+ */
+typedef CUpti_CallbackDomain *CUpti_DomainTable;
+
+/**
+ * \brief Get the available callback domains.
+ *
+ * Returns in \p *domainTable an array of size \p *domainCount of all
+ * the available callback domains.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param domainCount Returns number of callback domains
+ * \param domainTable Returns pointer to array of available callback domains
+ *
+ * \retval CUPTI_SUCCESS on success
+ * \retval CUPTI_ERROR_NOT_INITIALIZED if unable to initialize CUPTI
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p domainCount or \p domainTable are NULL
+ */
+CUptiResult CUPTIAPI cuptiSupportedDomains(size_t *domainCount,
+ CUpti_DomainTable *domainTable);
+
+/**
+ * \brief Initialize a callback subscriber with a callback function
+ * and user data.
+ *
+ * Initializes a callback subscriber with a callback function and
+ * (optionally) a pointer to user data. The returned subscriber handle
+ * can be used to enable and disable the callback for specific domains
+ * and callback IDs.
+ * \note Only a single subscriber can be registered at a time. To ensure
+ * that no other CUPTI client interrupts the profiling session, it's the
+ * responsibility of all the CUPTI clients to call this function before
+ * starting the profling session. In case profiling session is already
+ * started by another CUPTI client, this function returns the error code
+ * CUPTI_ERROR_MULTIPLE_SUBSCRIBERS_NOT_SUPPORTED.
+ * Note that this function returns the same error when application is
+ * launched using NVIDIA tools like nvprof, Visual Profiler, Nsight Systems,
+ * Nsight Compute, cuda-gdb and cuda-memcheck.
+ * \note This function does not enable any callbacks.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param subscriber Returns handle to initialize subscriber
+ * \param callback The callback function
+ * \param userdata A pointer to user data. This data will be passed to
+ * the callback function via the \p userdata parameter.
+ *
+ * \retval CUPTI_SUCCESS on success
+ * \retval CUPTI_ERROR_NOT_INITIALIZED if unable to initialize CUPTI
+ * \retval CUPTI_ERROR_MULTIPLE_SUBSCRIBERS_NOT_SUPPORTED if there is already a CUPTI subscriber
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p subscriber is NULL
+ */
+CUptiResult CUPTIAPI cuptiSubscribe(CUpti_SubscriberHandle *subscriber,
+ CUpti_CallbackFunc callback,
+ void *userdata);
+
+/**
+ * \brief Unregister a callback subscriber.
+ *
+ * Removes a callback subscriber so that no future callbacks will be
+ * issued to that subscriber.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param subscriber Handle to the initialize subscriber
+ *
+ * \retval CUPTI_SUCCESS on success
+ * \retval CUPTI_ERROR_NOT_INITIALIZED if unable to initialized CUPTI
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p subscriber is NULL or not initialized
+ */
+CUptiResult CUPTIAPI cuptiUnsubscribe(CUpti_SubscriberHandle subscriber);
+
+/**
+ * \brief Get the current enabled/disabled state of a callback for a specific
+ * domain and function ID.
+ *
+ * Returns non-zero in \p *enable if the callback for a domain and
+ * callback ID is enabled, and zero if not enabled.
+ *
+ * \note \b Thread-safety: a subscriber must serialize access to
+ * cuptiGetCallbackState, cuptiEnableCallback, cuptiEnableDomain, and
+ * cuptiEnableAllDomains. For example, if cuptiGetCallbackState(sub,
+ * d, c) and cuptiEnableCallback(sub, d, c) are called concurrently,
+ * the results are undefined.
+ *
+ * \param enable Returns non-zero if callback enabled, zero if not enabled
+ * \param subscriber Handle to the initialize subscriber
+ * \param domain The domain of the callback
+ * \param cbid The ID of the callback
+ *
+ * \retval CUPTI_SUCCESS on success
+ * \retval CUPTI_ERROR_NOT_INITIALIZED if unable to initialized CUPTI
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p enabled is NULL, or if \p
+ * subscriber, \p domain or \p cbid is invalid.
+ */
+CUptiResult CUPTIAPI cuptiGetCallbackState(uint32_t *enable,
+ CUpti_SubscriberHandle subscriber,
+ CUpti_CallbackDomain domain,
+ CUpti_CallbackId cbid);
+
+/**
+ * \brief Enable or disabled callbacks for a specific domain and
+ * callback ID.
+ *
+ * Enable or disabled callbacks for a subscriber for a specific domain
+ * and callback ID.
+ *
+ * \note \b Thread-safety: a subscriber must serialize access to
+ * cuptiGetCallbackState, cuptiEnableCallback, cuptiEnableDomain, and
+ * cuptiEnableAllDomains. For example, if cuptiGetCallbackState(sub,
+ * d, c) and cuptiEnableCallback(sub, d, c) are called concurrently,
+ * the results are undefined.
+ *
+ * \param enable New enable state for the callback. Zero disables the
+ * callback, non-zero enables the callback.
+ * \param subscriber - Handle to callback subscription
+ * \param domain The domain of the callback
+ * \param cbid The ID of the callback
+ *
+ * \retval CUPTI_SUCCESS on success
+ * \retval CUPTI_ERROR_NOT_INITIALIZED if unable to initialized CUPTI
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p subscriber, \p domain or \p
+ * cbid is invalid.
+ */
+CUptiResult CUPTIAPI cuptiEnableCallback(uint32_t enable,
+ CUpti_SubscriberHandle subscriber,
+ CUpti_CallbackDomain domain,
+ CUpti_CallbackId cbid);
+
+/**
+ * \brief Enable or disabled all callbacks for a specific domain.
+ *
+ * Enable or disabled all callbacks for a specific domain.
+ *
+ * \note \b Thread-safety: a subscriber must serialize access to
+ * cuptiGetCallbackState, cuptiEnableCallback, cuptiEnableDomain, and
+ * cuptiEnableAllDomains. For example, if cuptiGetCallbackEnabled(sub,
+ * d, *) and cuptiEnableDomain(sub, d) are called concurrently, the
+ * results are undefined.
+ *
+ * \param enable New enable state for all callbacks in the
+ * domain. Zero disables all callbacks, non-zero enables all
+ * callbacks.
+ * \param subscriber - Handle to callback subscription
+ * \param domain The domain of the callback
+ *
+ * \retval CUPTI_SUCCESS on success
+ * \retval CUPTI_ERROR_NOT_INITIALIZED if unable to initialized CUPTI
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p subscriber or \p domain is invalid
+ */
+CUptiResult CUPTIAPI cuptiEnableDomain(uint32_t enable,
+ CUpti_SubscriberHandle subscriber,
+ CUpti_CallbackDomain domain);
+
+/**
+ * \brief Enable or disable all callbacks in all domains.
+ *
+ * Enable or disable all callbacks in all domains.
+ *
+ * \note \b Thread-safety: a subscriber must serialize access to
+ * cuptiGetCallbackState, cuptiEnableCallback, cuptiEnableDomain, and
+ * cuptiEnableAllDomains. For example, if cuptiGetCallbackState(sub,
+ * d, *) and cuptiEnableAllDomains(sub) are called concurrently, the
+ * results are undefined.
+ *
+ * \param enable New enable state for all callbacks in all
+ * domain. Zero disables all callbacks, non-zero enables all
+ * callbacks.
+ * \param subscriber - Handle to callback subscription
+ *
+ * \retval CUPTI_SUCCESS on success
+ * \retval CUPTI_ERROR_NOT_INITIALIZED if unable to initialized CUPTI
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p subscriber is invalid
+ */
+CUptiResult CUPTIAPI cuptiEnableAllDomains(uint32_t enable,
+ CUpti_SubscriberHandle subscriber);
+
+/**
+ * \brief Get the name of a callback for a specific domain and callback ID.
+ *
+ * Returns a pointer to the name c_string in \p **name.
+ *
+ * \note \b Names are available only for the DRIVER and RUNTIME domains.
+ *
+ * \param domain The domain of the callback
+ * \param cbid The ID of the callback
+ * \param name Returns pointer to the name string on success, NULL otherwise
+ *
+ * \retval CUPTI_SUCCESS on success
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p name is NULL, or if
+ * \p domain or \p cbid is invalid.
+ */
+CUptiResult CUPTIAPI cuptiGetCallbackName(CUpti_CallbackDomain domain,
+ uint32_t cbid,
+ const char **name);
+
+/** @} */ /* END CUPTI_CALLBACK_API */
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif // file guard
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_checkpoint.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_checkpoint.h
new file mode 100644
index 0000000000000000000000000000000000000000..36eeddc4e2b7bfd1902ce313d71f173db70beaef
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_checkpoint.h
@@ -0,0 +1,127 @@
+#pragma once
+
+#include
+#include
+
+#include
+#include
+
+namespace NV { namespace Cupti { namespace Checkpoint {
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ * \defgroup CUPTI_CHECKPOINT_API CUPTI Checkpoint API
+ * Functions, types, and enums that implement the CUPTI Checkpoint API.
+ * @{
+ */
+
+/**
+ * \brief Specifies optimization options for a checkpoint, may be OR'd together to specify multiple options.
+ */
+typedef enum
+{
+ CUPTI_CHECKPOINT_OPT_NONE = 0, //!< Default behavior
+ CUPTI_CHECKPOINT_OPT_TRANSFER = 1, //!< Determine which mem blocks have changed, and only restore those. This optimization is cached, which means cuptiCheckpointRestore must always be called at the same point in the application when this option is enabled, or the result may be incorrect.
+} CUpti_CheckpointOptimizations;
+
+/**
+ * \brief Configuration and handle for a CUPTI Checkpoint
+ *
+ * A CUptiCheckpoint object should be initialized with desired options prior to passing into any
+ * CUPTI Checkpoint API function. The first call into a Checkpoint API function will initialize internal
+ * state based on these options. Subsequent changes to these options will not have any effect.
+ *
+ * Checkpoint data is saved in device, host, and filesystem space. There are options to reserve memory
+ * at each level (device, host, filesystem) which are intended to allow a guarantee that a certain amount
+ * of memory will remain free for use after the checkpoint is saved.
+ * Note, however, that falling back to slower levels of memory (host, and then filesystem) to save the checkpoint
+ * will result in performance degradation.
+ * Currently, the filesystem limitation is not implemented. Note that falling back to filesystem storage may
+ * significantly impact the performance for saving and restoring a checkpoint.
+ */
+typedef struct
+{
+ size_t structSize; //!< [in] Must be set to CUpti_Checkpoint_STRUCT_SIZE
+
+ CUcontext ctx; //!< [in] Set to context to save from, or will use current context if NULL
+
+ size_t reserveDeviceMB; //!< [in] Restrict checkpoint from using last N MB of device memory (-1 = use no device memory)
+ size_t reserveHostMB; //!< [in] Restrict checkpoint from using last N MB of host memory (-1 = use no host memory)
+ uint8_t allowOverwrite; //!< [in] Boolean, Allow checkpoint to save over existing checkpoint
+ uint8_t optimizations; //!< [in] Mask of CUpti_CheckpointOptimizations flags for this checkpoint
+
+ void * pPriv; //!< [in] Assign to NULL
+} CUpti_Checkpoint;
+
+#define CUpti_Checkpoint_STRUCT_SIZE \
+(offsetof(CUpti_Checkpoint, pPriv) + \
+sizeof(((CUpti_Checkpoint*)(nullptr))->pPriv))
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility push(default)
+#endif
+
+/**
+ * \brief Initialize and save a checkpoint of the device state associated with the handle context
+ *
+ * Uses the handle options to configure and save a checkpoint of the device state associated with the specified context.
+ *
+ * \param handle A pointer to a CUpti_Checkpoint object
+ *
+ * \retval CUPTI_SUCCESS if a checkpoint was successfully initialized and saved
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p handle does not appear to refer to a valid CUpti_Checkpoint
+ * \retval CUPTI_ERROR_INVALID_CONTEXT
+ * \retval CUPTI_ERROR_INVALID_DEVICE if device associated with context is not compatible with checkpoint API
+ * \retval CUPTI_ERROR_INVALID_OPERATION if Save is requested over an existing checkpoint, but \p allowOverwrite was not originally specified
+ * \retval CUPTI_ERROR_OUT_OF_MEMORY if as configured, not enough backing storage space to save the checkpoint
+ */
+CUptiResult cuptiCheckpointSave(CUpti_Checkpoint * const handle);
+
+/**
+ * \brief Restore a checkpoint to the device associated with its context
+ *
+ * Restores device, pinned, and allocated memory to the state when the checkpoint was saved
+ *
+ * \param handle A pointer to a previously saved CUpti_Checkpoint object
+ *
+ * \retval CUTPI_SUCCESS if the checkpoint was successfully restored
+ * \retval CUPTI_ERROR_NOT_INITIALIZED if the checkpoint was not previously initialized
+ * \retval CUPTI_ERROR_INVALID_CONTEXT
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if the handle appears invalid
+ * \retval CUPTI_ERROR_UNKNOWN if the restore or optimization operation fails
+ */
+CUptiResult cuptiCheckpointRestore(CUpti_Checkpoint * const handle);
+
+/**
+ * \brief Free the backing data for a checkpoint
+ *
+ * Frees all associated device, host memory and filesystem storage used for this context.
+ * After freeing a handle, it may be re-used as if it was new - options may be re-configured and will
+ * take effect on the next call to \p cuptiCheckpointSave.
+ *
+ * \param handle A pointer to a previously saved CUpti_Checkpoint object
+ *
+ * \retval CUPTI_SUCCESS if the handle was successfully freed
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if the handle was already freed or appears invalid
+ * \retval CUPTI_ERROR_INVALID_CONTEXT if the context is no longer valid
+ */
+CUptiResult cuptiCheckpointFree(CUpti_Checkpoint * const handle);
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility pop
+#endif
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+// Exit namespace NV::Cupti::Checkpoint
+}}}
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_common.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_common.h
new file mode 100644
index 0000000000000000000000000000000000000000..96d228c4df3c1f090a4979bfe10132e080042fef
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_common.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2023 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if !defined(__CUPTI_COMMON_H__)
+#define __CUPTI_COMMON_H__
+
+#ifndef CUPTIAPI
+#ifdef _WIN32
+#define CUPTIAPI __stdcall
+#else
+#define CUPTIAPI
+#endif
+#endif
+
+#ifndef CUPTIUTILAPI
+#ifdef _WIN32
+#define CUPTIUTILAPI __stdcall
+#else
+#define CUPTIUTILAPI
+#endif
+#endif
+
+#if defined(__LP64__)
+#define CUPTILP64 1
+#elif defined(_WIN64)
+#define CUPTILP64 1
+#else
+#undef CUPTILP64
+#endif
+
+#define ACTIVITY_RECORD_ALIGNMENT 8
+#if defined(_WIN32) // Windows 32- and 64-bit
+#define START_PACKED_ALIGNMENT __pragma(pack(push,1)) // exact fit - no padding
+#define PACKED_ALIGNMENT __declspec(align(ACTIVITY_RECORD_ALIGNMENT))
+#define END_PACKED_ALIGNMENT __pragma(pack(pop))
+#elif defined(__GNUC__) // GCC
+#define START_PACKED_ALIGNMENT
+#define PACKED_ALIGNMENT __attribute__ ((__packed__)) __attribute__ ((aligned (ACTIVITY_RECORD_ALIGNMENT)))
+#define END_PACKED_ALIGNMENT
+#else // all other compilers
+#define START_PACKED_ALIGNMENT
+#define PACKED_ALIGNMENT
+#define END_PACKED_ALIGNMENT
+#endif
+
+#endif /*__CUPTI_COMMON_H__*/
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_driver_cbid.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_driver_cbid.h
new file mode 100644
index 0000000000000000000000000000000000000000..1d3a0bc84fb23e1d97521b54cdd3a292fce5f4a7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_driver_cbid.h
@@ -0,0 +1,780 @@
+
+// *************************************************************************
+// Definitions of indices for API functions, unique across entire API
+// *************************************************************************
+
+// This file is generated. Any changes you make will be lost during the next clean build.
+// CUDA public interface, for type definitions and cu* function prototypes
+
+#if !defined(_CUPTI_DRIVER_CBID_H_)
+#define _CUPTI_DRIVER_CBID_H_
+
+typedef enum CUpti_driver_api_trace_cbid_enum {
+ CUPTI_DRIVER_TRACE_CBID_INVALID = 0,
+ CUPTI_DRIVER_TRACE_CBID_cuInit = 1,
+ CUPTI_DRIVER_TRACE_CBID_cuDriverGetVersion = 2,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGet = 3,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetCount = 4,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetName = 5,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceComputeCapability = 6,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceTotalMem = 7,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetProperties = 8,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetAttribute = 9,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxCreate = 10,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxDestroy = 11,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxAttach = 12,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxDetach = 13,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxPushCurrent = 14,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxPopCurrent = 15,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetDevice = 16,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxSynchronize = 17,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleLoad = 18,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleLoadData = 19,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleLoadDataEx = 20,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleLoadFatBinary = 21,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleUnload = 22,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleGetFunction = 23,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleGetGlobal = 24,
+ CUPTI_DRIVER_TRACE_CBID_cu64ModuleGetGlobal = 25,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleGetTexRef = 26,
+ CUPTI_DRIVER_TRACE_CBID_cuMemGetInfo = 27,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemGetInfo = 28,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAlloc = 29,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemAlloc = 30,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocPitch = 31,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemAllocPitch = 32,
+ CUPTI_DRIVER_TRACE_CBID_cuMemFree = 33,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemFree = 34,
+ CUPTI_DRIVER_TRACE_CBID_cuMemGetAddressRange = 35,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemGetAddressRange = 36,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocHost = 37,
+ CUPTI_DRIVER_TRACE_CBID_cuMemFreeHost = 38,
+ CUPTI_DRIVER_TRACE_CBID_cuMemHostAlloc = 39,
+ CUPTI_DRIVER_TRACE_CBID_cuMemHostGetDevicePointer = 40,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemHostGetDevicePointer = 41,
+ CUPTI_DRIVER_TRACE_CBID_cuMemHostGetFlags = 42,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoD = 43,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemcpyHtoD = 44,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoH = 45,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoH = 46,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoD = 47,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoD = 48,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoA = 49,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoA = 50,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoD = 51,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemcpyAtoD = 52,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoA = 53,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoH = 54,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoA = 55,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2D = 56,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DUnaligned = 57,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3D = 58,
+ CUPTI_DRIVER_TRACE_CBID_cu64Memcpy3D = 59,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoDAsync = 60,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemcpyHtoDAsync = 61,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoHAsync = 62,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoHAsync = 63,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoDAsync = 64,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemcpyDtoDAsync = 65,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoAAsync = 66,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoHAsync = 67,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DAsync = 68,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DAsync = 69,
+ CUPTI_DRIVER_TRACE_CBID_cu64Memcpy3DAsync = 70,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD8 = 71,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD8 = 72,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD16 = 73,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD16 = 74,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD32 = 75,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD32 = 76,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8 = 77,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D8 = 78,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16 = 79,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D16 = 80,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32 = 81,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D32 = 82,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncSetBlockShape = 83,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncSetSharedSize = 84,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncGetAttribute = 85,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncSetCacheConfig = 86,
+ CUPTI_DRIVER_TRACE_CBID_cuArrayCreate = 87,
+ CUPTI_DRIVER_TRACE_CBID_cuArrayGetDescriptor = 88,
+ CUPTI_DRIVER_TRACE_CBID_cuArrayDestroy = 89,
+ CUPTI_DRIVER_TRACE_CBID_cuArray3DCreate = 90,
+ CUPTI_DRIVER_TRACE_CBID_cuArray3DGetDescriptor = 91,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefCreate = 92,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefDestroy = 93,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetArray = 94,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress = 95,
+ CUPTI_DRIVER_TRACE_CBID_cu64TexRefSetAddress = 96,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress2D = 97,
+ CUPTI_DRIVER_TRACE_CBID_cu64TexRefSetAddress2D = 98,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetFormat = 99,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddressMode = 100,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetFilterMode = 101,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetFlags = 102,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetAddress = 103,
+ CUPTI_DRIVER_TRACE_CBID_cu64TexRefGetAddress = 104,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetArray = 105,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetAddressMode = 106,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetFilterMode = 107,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetFormat = 108,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetFlags = 109,
+ CUPTI_DRIVER_TRACE_CBID_cuParamSetSize = 110,
+ CUPTI_DRIVER_TRACE_CBID_cuParamSeti = 111,
+ CUPTI_DRIVER_TRACE_CBID_cuParamSetf = 112,
+ CUPTI_DRIVER_TRACE_CBID_cuParamSetv = 113,
+ CUPTI_DRIVER_TRACE_CBID_cuParamSetTexRef = 114,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunch = 115,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchGrid = 116,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchGridAsync = 117,
+ CUPTI_DRIVER_TRACE_CBID_cuEventCreate = 118,
+ CUPTI_DRIVER_TRACE_CBID_cuEventRecord = 119,
+ CUPTI_DRIVER_TRACE_CBID_cuEventQuery = 120,
+ CUPTI_DRIVER_TRACE_CBID_cuEventSynchronize = 121,
+ CUPTI_DRIVER_TRACE_CBID_cuEventDestroy = 122,
+ CUPTI_DRIVER_TRACE_CBID_cuEventElapsedTime = 123,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamCreate = 124,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamQuery = 125,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamSynchronize = 126,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamDestroy = 127,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsUnregisterResource = 128,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsSubResourceGetMappedArray = 129,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceGetMappedPointer = 130,
+ CUPTI_DRIVER_TRACE_CBID_cu64GraphicsResourceGetMappedPointer = 131,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceSetMapFlags = 132,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsMapResources = 133,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsUnmapResources = 134,
+ CUPTI_DRIVER_TRACE_CBID_cuGetExportTable = 135,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxSetLimit = 136,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetLimit = 137,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10GetDevice = 138,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10CtxCreate = 139,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsD3D10RegisterResource = 140,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10RegisterResource = 141,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10UnregisterResource = 142,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10MapResources = 143,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10UnmapResources = 144,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceSetMapFlags = 145,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedArray = 146,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedPointer = 147,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedSize = 148,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedPitch = 149,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetSurfaceDimensions = 150,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D11GetDevice = 151,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D11CtxCreate = 152,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsD3D11RegisterResource = 153,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9GetDevice = 154,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9CtxCreate = 155,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsD3D9RegisterResource = 156,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9GetDirect3DDevice = 157,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9RegisterResource = 158,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9UnregisterResource = 159,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9MapResources = 160,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9UnmapResources = 161,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceSetMapFlags = 162,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetSurfaceDimensions = 163,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedArray = 164,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedPointer = 165,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedSize = 166,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedPitch = 167,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9Begin = 168,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9End = 169,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9RegisterVertexBuffer = 170,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9MapVertexBuffer = 171,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9UnmapVertexBuffer = 172,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9UnregisterVertexBuffer = 173,
+ CUPTI_DRIVER_TRACE_CBID_cuGLCtxCreate = 174,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsGLRegisterBuffer = 175,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsGLRegisterImage = 176,
+ CUPTI_DRIVER_TRACE_CBID_cuWGLGetDevice = 177,
+ CUPTI_DRIVER_TRACE_CBID_cuGLInit = 178,
+ CUPTI_DRIVER_TRACE_CBID_cuGLRegisterBufferObject = 179,
+ CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObject = 180,
+ CUPTI_DRIVER_TRACE_CBID_cuGLUnmapBufferObject = 181,
+ CUPTI_DRIVER_TRACE_CBID_cuGLUnregisterBufferObject = 182,
+ CUPTI_DRIVER_TRACE_CBID_cuGLSetBufferObjectMapFlags = 183,
+ CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObjectAsync = 184,
+ CUPTI_DRIVER_TRACE_CBID_cuGLUnmapBufferObjectAsync = 185,
+ CUPTI_DRIVER_TRACE_CBID_cuVDPAUGetDevice = 186,
+ CUPTI_DRIVER_TRACE_CBID_cuVDPAUCtxCreate = 187,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsVDPAURegisterVideoSurface = 188,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsVDPAURegisterOutputSurface = 189,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleGetSurfRef = 190,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfRefCreate = 191,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfRefDestroy = 192,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfRefSetFormat = 193,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfRefSetArray = 194,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfRefGetFormat = 195,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfRefGetArray = 196,
+ CUPTI_DRIVER_TRACE_CBID_cu64DeviceTotalMem = 197,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D10ResourceGetMappedPointer = 198,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D10ResourceGetMappedSize = 199,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D10ResourceGetMappedPitch = 200,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D10ResourceGetSurfaceDimensions = 201,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D9ResourceGetSurfaceDimensions = 202,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D9ResourceGetMappedPointer = 203,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D9ResourceGetMappedSize = 204,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D9ResourceGetMappedPitch = 205,
+ CUPTI_DRIVER_TRACE_CBID_cu64D3D9MapVertexBuffer = 206,
+ CUPTI_DRIVER_TRACE_CBID_cu64GLMapBufferObject = 207,
+ CUPTI_DRIVER_TRACE_CBID_cu64GLMapBufferObjectAsync = 208,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D11GetDevices = 209,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D11CtxCreateOnDevice = 210,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10GetDevices = 211,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10CtxCreateOnDevice = 212,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9GetDevices = 213,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9CtxCreateOnDevice = 214,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemHostAlloc = 215,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD8Async = 216,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD8Async = 217,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD16Async = 218,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD16Async = 219,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD32Async = 220,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD32Async = 221,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8Async = 222,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D8Async = 223,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16Async = 224,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D16Async = 225,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32Async = 226,
+ CUPTI_DRIVER_TRACE_CBID_cu64MemsetD2D32Async = 227,
+ CUPTI_DRIVER_TRACE_CBID_cu64ArrayCreate = 228,
+ CUPTI_DRIVER_TRACE_CBID_cu64ArrayGetDescriptor = 229,
+ CUPTI_DRIVER_TRACE_CBID_cu64Array3DCreate = 230,
+ CUPTI_DRIVER_TRACE_CBID_cu64Array3DGetDescriptor = 231,
+ CUPTI_DRIVER_TRACE_CBID_cu64Memcpy2D = 232,
+ CUPTI_DRIVER_TRACE_CBID_cu64Memcpy2DUnaligned = 233,
+ CUPTI_DRIVER_TRACE_CBID_cu64Memcpy2DAsync = 234,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxCreate_v2 = 235,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10CtxCreate_v2 = 236,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D11CtxCreate_v2 = 237,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9CtxCreate_v2 = 238,
+ CUPTI_DRIVER_TRACE_CBID_cuGLCtxCreate_v2 = 239,
+ CUPTI_DRIVER_TRACE_CBID_cuVDPAUCtxCreate_v2 = 240,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleGetGlobal_v2 = 241,
+ CUPTI_DRIVER_TRACE_CBID_cuMemGetInfo_v2 = 242,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAlloc_v2 = 243,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocPitch_v2 = 244,
+ CUPTI_DRIVER_TRACE_CBID_cuMemFree_v2 = 245,
+ CUPTI_DRIVER_TRACE_CBID_cuMemGetAddressRange_v2 = 246,
+ CUPTI_DRIVER_TRACE_CBID_cuMemHostGetDevicePointer_v2 = 247,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy_v2 = 248,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD8_v2 = 249,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD16_v2 = 250,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD32_v2 = 251,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8_v2 = 252,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16_v2 = 253,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32_v2 = 254,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress_v2 = 255,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress2D_v2 = 256,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetAddress_v2 = 257,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceGetMappedPointer_v2 = 258,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceTotalMem_v2 = 259,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedPointer_v2 = 260,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedSize_v2 = 261,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetMappedPitch_v2 = 262,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10ResourceGetSurfaceDimensions_v2 = 263,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetSurfaceDimensions_v2 = 264,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedPointer_v2 = 265,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedSize_v2 = 266,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9ResourceGetMappedPitch_v2 = 267,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D9MapVertexBuffer_v2 = 268,
+ CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObject_v2 = 269,
+ CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObjectAsync_v2 = 270,
+ CUPTI_DRIVER_TRACE_CBID_cuMemHostAlloc_v2 = 271,
+ CUPTI_DRIVER_TRACE_CBID_cuArrayCreate_v2 = 272,
+ CUPTI_DRIVER_TRACE_CBID_cuArrayGetDescriptor_v2 = 273,
+ CUPTI_DRIVER_TRACE_CBID_cuArray3DCreate_v2 = 274,
+ CUPTI_DRIVER_TRACE_CBID_cuArray3DGetDescriptor_v2 = 275,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoD_v2 = 276,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoDAsync_v2 = 277,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoH_v2 = 278,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoHAsync_v2 = 279,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoD_v2 = 280,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoDAsync_v2 = 281,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoH_v2 = 282,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoHAsync_v2 = 283,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoD_v2 = 284,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoA_v2 = 285,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoA_v2 = 286,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2D_v2 = 287,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DUnaligned_v2 = 288,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DAsync_v2 = 289,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3D_v2 = 290,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DAsync_v2 = 291,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoA_v2 = 292,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoAAsync_v2 = 293,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocHost_v2 = 294,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitEvent = 295,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetApiVersion = 296,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D10GetDirect3DDevice = 297,
+ CUPTI_DRIVER_TRACE_CBID_cuD3D11GetDirect3DDevice = 298,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetCacheConfig = 299,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxSetCacheConfig = 300,
+ CUPTI_DRIVER_TRACE_CBID_cuMemHostRegister = 301,
+ CUPTI_DRIVER_TRACE_CBID_cuMemHostUnregister = 302,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxSetCurrent = 303,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetCurrent = 304,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy = 305,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAsync = 306,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchKernel = 307,
+ CUPTI_DRIVER_TRACE_CBID_cuProfilerStart = 308,
+ CUPTI_DRIVER_TRACE_CBID_cuProfilerStop = 309,
+ CUPTI_DRIVER_TRACE_CBID_cuPointerGetAttribute = 310,
+ CUPTI_DRIVER_TRACE_CBID_cuProfilerInitialize = 311,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceCanAccessPeer = 312,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxEnablePeerAccess = 313,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxDisablePeerAccess = 314,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPeerRegister = 315,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPeerUnregister = 316,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPeerGetDevicePointer = 317,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyPeer = 318,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyPeerAsync = 319,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DPeer = 320,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DPeerAsync = 321,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxDestroy_v2 = 322,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxPushCurrent_v2 = 323,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxPopCurrent_v2 = 324,
+ CUPTI_DRIVER_TRACE_CBID_cuEventDestroy_v2 = 325,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamDestroy_v2 = 326,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetAddress2D_v3 = 327,
+ CUPTI_DRIVER_TRACE_CBID_cuIpcGetMemHandle = 328,
+ CUPTI_DRIVER_TRACE_CBID_cuIpcOpenMemHandle = 329,
+ CUPTI_DRIVER_TRACE_CBID_cuIpcCloseMemHandle = 330,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetByPCIBusId = 331,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetPCIBusId = 332,
+ CUPTI_DRIVER_TRACE_CBID_cuGLGetDevices = 333,
+ CUPTI_DRIVER_TRACE_CBID_cuIpcGetEventHandle = 334,
+ CUPTI_DRIVER_TRACE_CBID_cuIpcOpenEventHandle = 335,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxSetSharedMemConfig = 336,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetSharedMemConfig = 337,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncSetSharedMemConfig = 338,
+ CUPTI_DRIVER_TRACE_CBID_cuTexObjectCreate = 339,
+ CUPTI_DRIVER_TRACE_CBID_cuTexObjectDestroy = 340,
+ CUPTI_DRIVER_TRACE_CBID_cuTexObjectGetResourceDesc = 341,
+ CUPTI_DRIVER_TRACE_CBID_cuTexObjectGetTextureDesc = 342,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfObjectCreate = 343,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfObjectDestroy = 344,
+ CUPTI_DRIVER_TRACE_CBID_cuSurfObjectGetResourceDesc = 345,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamAddCallback = 346,
+ CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayCreate = 347,
+ CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayGetLevel = 348,
+ CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayDestroy = 349,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMipmappedArray = 350,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMipmapFilterMode = 351,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMipmapLevelBias = 352,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMipmapLevelClamp = 353,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetMaxAnisotropy = 354,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMipmappedArray = 355,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMipmapFilterMode = 356,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMipmapLevelBias = 357,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMipmapLevelClamp = 358,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetMaxAnisotropy = 359,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceGetMappedMipmappedArray = 360,
+ CUPTI_DRIVER_TRACE_CBID_cuTexObjectGetResourceViewDesc = 361,
+ CUPTI_DRIVER_TRACE_CBID_cuLinkCreate = 362,
+ CUPTI_DRIVER_TRACE_CBID_cuLinkAddData = 363,
+ CUPTI_DRIVER_TRACE_CBID_cuLinkAddFile = 364,
+ CUPTI_DRIVER_TRACE_CBID_cuLinkComplete = 365,
+ CUPTI_DRIVER_TRACE_CBID_cuLinkDestroy = 366,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamCreateWithPriority = 367,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetPriority = 368,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetFlags = 369,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetStreamPriorityRange = 370,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocManaged = 371,
+ CUPTI_DRIVER_TRACE_CBID_cuGetErrorString = 372,
+ CUPTI_DRIVER_TRACE_CBID_cuGetErrorName = 373,
+ CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxActiveBlocksPerMultiprocessor = 374,
+ CUPTI_DRIVER_TRACE_CBID_cuCompilePtx = 375,
+ CUPTI_DRIVER_TRACE_CBID_cuBinaryFree = 376,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamAttachMemAsync = 377,
+ CUPTI_DRIVER_TRACE_CBID_cuPointerSetAttribute = 378,
+ CUPTI_DRIVER_TRACE_CBID_cuMemHostRegister_v2 = 379,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceSetMapFlags_v2 = 380,
+ CUPTI_DRIVER_TRACE_CBID_cuLinkCreate_v2 = 381,
+ CUPTI_DRIVER_TRACE_CBID_cuLinkAddData_v2 = 382,
+ CUPTI_DRIVER_TRACE_CBID_cuLinkAddFile_v2 = 383,
+ CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxPotentialBlockSize = 384,
+ CUPTI_DRIVER_TRACE_CBID_cuGLGetDevices_v2 = 385,
+ CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxRetain = 386,
+ CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxRelease = 387,
+ CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxSetFlags = 388,
+ CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxReset = 389,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsEGLRegisterImage = 390,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetFlags = 391,
+ CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxGetState = 392,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerConnect = 393,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerDisconnect = 394,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerAcquireFrame = 395,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerReleaseFrame = 396,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoD_v2_ptds = 397,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoH_v2_ptds = 398,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoD_v2_ptds = 399,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoA_v2_ptds = 400,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoD_v2_ptds = 401,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoA_v2_ptds = 402,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoH_v2_ptds = 403,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoA_v2_ptds = 404,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2D_v2_ptds = 405,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DUnaligned_v2_ptds = 406,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3D_v2_ptds = 407,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy_ptds = 408,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyPeer_ptds = 409,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DPeer_ptds = 410,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD8_v2_ptds = 411,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD16_v2_ptds = 412,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD32_v2_ptds = 413,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8_v2_ptds = 414,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16_v2_ptds = 415,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32_v2_ptds = 416,
+ CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObject_v2_ptds = 417,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAsync_ptsz = 418,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoAAsync_v2_ptsz = 419,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyAtoHAsync_v2_ptsz = 420,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyHtoDAsync_v2_ptsz = 421,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoHAsync_v2_ptsz = 422,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyDtoDAsync_v2_ptsz = 423,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy2DAsync_v2_ptsz = 424,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DAsync_v2_ptsz = 425,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpyPeerAsync_ptsz = 426,
+ CUPTI_DRIVER_TRACE_CBID_cuMemcpy3DPeerAsync_ptsz = 427,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD8Async_ptsz = 428,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD16Async_ptsz = 429,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD32Async_ptsz = 430,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D8Async_ptsz = 431,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D16Async_ptsz = 432,
+ CUPTI_DRIVER_TRACE_CBID_cuMemsetD2D32Async_ptsz = 433,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetPriority_ptsz = 434,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetFlags_ptsz = 435,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitEvent_ptsz = 436,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamAddCallback_ptsz = 437,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamAttachMemAsync_ptsz = 438,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamQuery_ptsz = 439,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamSynchronize_ptsz = 440,
+ CUPTI_DRIVER_TRACE_CBID_cuEventRecord_ptsz = 441,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchKernel_ptsz = 442,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsMapResources_ptsz = 443,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsUnmapResources_ptsz = 444,
+ CUPTI_DRIVER_TRACE_CBID_cuGLMapBufferObjectAsync_v2_ptsz = 445,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamProducerConnect = 446,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamProducerDisconnect = 447,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamProducerPresentFrame = 448,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphicsResourceGetMappedEglFrame = 449,
+ CUPTI_DRIVER_TRACE_CBID_cuPointerGetAttributes = 450,
+ CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = 451,
+ CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxPotentialBlockSizeWithFlags = 452,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamProducerReturnFrame = 453,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetP2PAttribute = 454,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefSetBorderColor = 455,
+ CUPTI_DRIVER_TRACE_CBID_cuTexRefGetBorderColor = 456,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAdvise = 457,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue32 = 458,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue32_ptsz = 459,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue32 = 460,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue32_ptsz = 461,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBatchMemOp = 462,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBatchMemOp_ptsz = 463,
+ CUPTI_DRIVER_TRACE_CBID_cuNVNbufferGetPointer = 464,
+ CUPTI_DRIVER_TRACE_CBID_cuNVNtextureGetArray = 465,
+ CUPTI_DRIVER_TRACE_CBID_cuNNSetAllocator = 466,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPrefetchAsync = 467,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPrefetchAsync_ptsz = 468,
+ CUPTI_DRIVER_TRACE_CBID_cuEventCreateFromNVNSync = 469,
+ CUPTI_DRIVER_TRACE_CBID_cuEGLStreamConsumerConnectWithFlags = 470,
+ CUPTI_DRIVER_TRACE_CBID_cuMemRangeGetAttribute = 471,
+ CUPTI_DRIVER_TRACE_CBID_cuMemRangeGetAttributes = 472,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue64 = 473,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue64_ptsz = 474,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue64 = 475,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue64_ptsz = 476,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchCooperativeKernel = 477,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchCooperativeKernel_ptsz = 478,
+ CUPTI_DRIVER_TRACE_CBID_cuEventCreateFromEGLSync = 479,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchCooperativeKernelMultiDevice = 480,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncSetAttribute = 481,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetUuid = 482,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCtx = 483,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCtx_ptsz = 484,
+ CUPTI_DRIVER_TRACE_CBID_cuImportExternalMemory = 485,
+ CUPTI_DRIVER_TRACE_CBID_cuExternalMemoryGetMappedBuffer = 486,
+ CUPTI_DRIVER_TRACE_CBID_cuExternalMemoryGetMappedMipmappedArray = 487,
+ CUPTI_DRIVER_TRACE_CBID_cuDestroyExternalMemory = 488,
+ CUPTI_DRIVER_TRACE_CBID_cuImportExternalSemaphore = 489,
+ CUPTI_DRIVER_TRACE_CBID_cuSignalExternalSemaphoresAsync = 490,
+ CUPTI_DRIVER_TRACE_CBID_cuSignalExternalSemaphoresAsync_ptsz = 491,
+ CUPTI_DRIVER_TRACE_CBID_cuWaitExternalSemaphoresAsync = 492,
+ CUPTI_DRIVER_TRACE_CBID_cuWaitExternalSemaphoresAsync_ptsz = 493,
+ CUPTI_DRIVER_TRACE_CBID_cuDestroyExternalSemaphore = 494,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCapture = 495,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCapture_ptsz = 496,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamEndCapture = 497,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamEndCapture_ptsz = 498,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamIsCapturing = 499,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamIsCapturing_ptsz = 500,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphCreate = 501,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddKernelNode = 502,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeGetParams = 503,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddMemcpyNode = 504,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphMemcpyNodeGetParams = 505,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddMemsetNode = 506,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphMemsetNodeGetParams = 507,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphMemsetNodeSetParams = 508,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetType = 509,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphGetRootNodes = 510,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetDependencies = 511,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetDependentNodes = 512,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiate = 513,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphLaunch = 514,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphLaunch_ptsz = 515,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecDestroy = 516,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphDestroy = 517,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddDependencies = 518,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphRemoveDependencies = 519,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphMemcpyNodeSetParams = 520,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeSetParams = 521,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphDestroyNode = 522,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphClone = 523,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeFindInClone = 524,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddChildGraphNode = 525,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddEmptyNode = 526,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchHostFunc = 527,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchHostFunc_ptsz = 528,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphChildGraphNodeGetGraph = 529,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddHostNode = 530,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphHostNodeGetParams = 531,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetLuid = 532,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphHostNodeSetParams = 533,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphGetNodes = 534,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphGetEdges = 535,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo = 536,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo_ptsz = 537,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecKernelNodeSetParams = 538,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCapture_v2 = 539,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCapture_v2_ptsz = 540,
+ CUPTI_DRIVER_TRACE_CBID_cuThreadExchangeStreamCaptureMode = 541,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetNvSciSyncAttributes = 542,
+ CUPTI_DRIVER_TRACE_CBID_cuOccupancyAvailableDynamicSMemPerBlock = 543,
+ CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxRelease_v2 = 544,
+ CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxReset_v2 = 545,
+ CUPTI_DRIVER_TRACE_CBID_cuDevicePrimaryCtxSetFlags_v2 = 546,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAddressReserve = 547,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAddressFree = 548,
+ CUPTI_DRIVER_TRACE_CBID_cuMemCreate = 549,
+ CUPTI_DRIVER_TRACE_CBID_cuMemRelease = 550,
+ CUPTI_DRIVER_TRACE_CBID_cuMemMap = 551,
+ CUPTI_DRIVER_TRACE_CBID_cuMemUnmap = 552,
+ CUPTI_DRIVER_TRACE_CBID_cuMemSetAccess = 553,
+ CUPTI_DRIVER_TRACE_CBID_cuMemExportToShareableHandle = 554,
+ CUPTI_DRIVER_TRACE_CBID_cuMemImportFromShareableHandle = 555,
+ CUPTI_DRIVER_TRACE_CBID_cuMemGetAllocationGranularity = 556,
+ CUPTI_DRIVER_TRACE_CBID_cuMemGetAllocationPropertiesFromHandle = 557,
+ CUPTI_DRIVER_TRACE_CBID_cuMemGetAccess = 558,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamSetFlags = 559,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamSetFlags_ptsz = 560,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecUpdate = 561,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecMemcpyNodeSetParams = 562,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecMemsetNodeSetParams = 563,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecHostNodeSetParams = 564,
+ CUPTI_DRIVER_TRACE_CBID_cuMemRetainAllocationHandle = 565,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncGetModule = 566,
+ CUPTI_DRIVER_TRACE_CBID_cuIpcOpenMemHandle_v2 = 567,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxResetPersistingL2Cache = 568,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeCopyAttributes = 569,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeGetAttribute = 570,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeSetAttribute = 571,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamCopyAttributes = 572,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamCopyAttributes_ptsz = 573,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetAttribute = 574,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetAttribute_ptsz = 575,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamSetAttribute = 576,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamSetAttribute_ptsz = 577,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiate_v2 = 578,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetTexture1DLinearMaxWidth = 579,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphUpload = 580,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphUpload_ptsz = 581,
+ CUPTI_DRIVER_TRACE_CBID_cuArrayGetSparseProperties = 582,
+ CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayGetSparseProperties = 583,
+ CUPTI_DRIVER_TRACE_CBID_cuMemMapArrayAsync = 584,
+ CUPTI_DRIVER_TRACE_CBID_cuMemMapArrayAsync_ptsz = 585,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecChildGraphNodeSetParams = 586,
+ CUPTI_DRIVER_TRACE_CBID_cuEventRecordWithFlags = 587,
+ CUPTI_DRIVER_TRACE_CBID_cuEventRecordWithFlags_ptsz = 588,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddEventRecordNode = 589,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddEventWaitNode = 590,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphEventRecordNodeGetEvent = 591,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphEventWaitNodeGetEvent = 592,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphEventRecordNodeSetEvent = 593,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphEventWaitNodeSetEvent = 594,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecEventRecordNodeSetEvent = 595,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecEventWaitNodeSetEvent = 596,
+ CUPTI_DRIVER_TRACE_CBID_cuArrayGetPlane = 597,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocAsync = 598,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocAsync_ptsz = 599,
+ CUPTI_DRIVER_TRACE_CBID_cuMemFreeAsync = 600,
+ CUPTI_DRIVER_TRACE_CBID_cuMemFreeAsync_ptsz = 601,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolTrimTo = 602,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolSetAttribute = 603,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolGetAttribute = 604,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolSetAccess = 605,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetDefaultMemPool = 606,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolCreate = 607,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolDestroy = 608,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceSetMemPool = 609,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetMemPool = 610,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocFromPoolAsync = 611,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAllocFromPoolAsync_ptsz = 612,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolExportToShareableHandle = 613,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolImportFromShareableHandle = 614,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolExportPointer = 615,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolImportPointer = 616,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPoolGetAccess = 617,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddExternalSemaphoresSignalNode = 618,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExternalSemaphoresSignalNodeGetParams = 619,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExternalSemaphoresSignalNodeSetParams = 620,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddExternalSemaphoresWaitNode = 621,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExternalSemaphoresWaitNodeGetParams = 622,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExternalSemaphoresWaitNodeSetParams = 623,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecExternalSemaphoresSignalNodeSetParams = 624,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecExternalSemaphoresWaitNodeSetParams = 625,
+ CUPTI_DRIVER_TRACE_CBID_cuGetProcAddress = 626,
+ CUPTI_DRIVER_TRACE_CBID_cuFlushGPUDirectRDMAWrites = 627,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphDebugDotPrint = 628,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo_v2 = 629,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo_v2_ptsz = 630,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamUpdateCaptureDependencies = 631,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamUpdateCaptureDependencies_ptsz = 632,
+ CUPTI_DRIVER_TRACE_CBID_cuUserObjectCreate = 633,
+ CUPTI_DRIVER_TRACE_CBID_cuUserObjectRetain = 634,
+ CUPTI_DRIVER_TRACE_CBID_cuUserObjectRelease = 635,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphRetainUserObject = 636,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphReleaseUserObject = 637,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddMemAllocNode = 638,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddMemFreeNode = 639,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGraphMemTrim = 640,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetGraphMemAttribute = 641,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceSetGraphMemAttribute = 642,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiateWithFlags = 643,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetExecAffinitySupport = 644,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxCreate_v3 = 645,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetExecAffinity = 646,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetUuid_v2 = 647,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphMemAllocNodeGetParams = 648,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphMemFreeNodeGetParams = 649,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeSetEnabled = 650,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetEnabled = 651,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchKernelEx = 652,
+ CUPTI_DRIVER_TRACE_CBID_cuLaunchKernelEx_ptsz = 653,
+ CUPTI_DRIVER_TRACE_CBID_cuArrayGetMemoryRequirements = 654,
+ CUPTI_DRIVER_TRACE_CBID_cuMipmappedArrayGetMemoryRequirements = 655,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiateWithParams = 656,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphInstantiateWithParams_ptsz = 657,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecGetFlags = 658,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue32_v2 = 659,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue32_v2_ptsz = 660,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue64_v2 = 661,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWaitValue64_v2_ptsz = 662,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue32_v2 = 663,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue32_v2_ptsz = 664,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue64_v2 = 665,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamWriteValue64_v2_ptsz = 666,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBatchMemOp_v2 = 667,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBatchMemOp_v2_ptsz = 668,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddBatchMemOpNode = 669,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphBatchMemOpNodeGetParams = 670,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphBatchMemOpNodeSetParams = 671,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecBatchMemOpNodeSetParams = 672,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleGetLoadingMode = 673,
+ CUPTI_DRIVER_TRACE_CBID_cuMemGetHandleForAddressRange = 674,
+ CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxPotentialClusterSize = 675,
+ CUPTI_DRIVER_TRACE_CBID_cuOccupancyMaxActiveClusters = 676,
+ CUPTI_DRIVER_TRACE_CBID_cuGetProcAddress_v2 = 677,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryLoadData = 678,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryLoadFromFile = 679,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryUnload = 680,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryGetKernel = 681,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryGetModule = 682,
+ CUPTI_DRIVER_TRACE_CBID_cuKernelGetFunction = 683,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryGetGlobal = 684,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryGetManaged = 685,
+ CUPTI_DRIVER_TRACE_CBID_cuKernelGetAttribute = 686,
+ CUPTI_DRIVER_TRACE_CBID_cuKernelSetAttribute = 687,
+ CUPTI_DRIVER_TRACE_CBID_cuKernelSetCacheConfig = 688,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddKernelNode_v2 = 689,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeGetParams_v2 = 690,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphKernelNodeSetParams_v2 = 691,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecKernelNodeSetParams_v2 = 692,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetId = 693,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetId_ptsz = 694,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetId = 695,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecUpdate_v2 = 696,
+ CUPTI_DRIVER_TRACE_CBID_cuTensorMapEncodeTiled = 697,
+ CUPTI_DRIVER_TRACE_CBID_cuTensorMapEncodeIm2col = 698,
+ CUPTI_DRIVER_TRACE_CBID_cuTensorMapReplaceAddress = 699,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryGetUnifiedFunction = 700,
+ CUPTI_DRIVER_TRACE_CBID_cuCoredumpGetAttribute = 701,
+ CUPTI_DRIVER_TRACE_CBID_cuCoredumpGetAttributeGlobal = 702,
+ CUPTI_DRIVER_TRACE_CBID_cuCoredumpSetAttribute = 703,
+ CUPTI_DRIVER_TRACE_CBID_cuCoredumpSetAttributeGlobal = 704,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxSetFlags = 705,
+ CUPTI_DRIVER_TRACE_CBID_cuMulticastCreate = 706,
+ CUPTI_DRIVER_TRACE_CBID_cuMulticastAddDevice = 707,
+ CUPTI_DRIVER_TRACE_CBID_cuMulticastBindMem = 708,
+ CUPTI_DRIVER_TRACE_CBID_cuMulticastBindAddr = 709,
+ CUPTI_DRIVER_TRACE_CBID_cuMulticastUnbind = 710,
+ CUPTI_DRIVER_TRACE_CBID_cuMulticastGetGranularity = 711,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddNode = 712,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeSetParams = 713,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphExecNodeSetParams = 714,
+ CUPTI_DRIVER_TRACE_CBID_cuMemAdvise_v2 = 715,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPrefetchAsync_v2 = 716,
+ CUPTI_DRIVER_TRACE_CBID_cuMemPrefetchAsync_v2_ptsz = 717,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncGetName = 718,
+ CUPTI_DRIVER_TRACE_CBID_cuKernelGetName = 719,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCaptureToGraph = 720,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamBeginCaptureToGraph_ptsz = 721,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphConditionalHandleCreate = 722,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddNode_v2 = 723,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphGetEdges_v2 = 724,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetDependencies_v2 = 725,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphNodeGetDependentNodes_v2 = 726,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphAddDependencies_v2 = 727,
+ CUPTI_DRIVER_TRACE_CBID_cuGraphRemoveDependencies_v2 = 728,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo_v3 = 729,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCaptureInfo_v3_ptsz = 730,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamUpdateCaptureDependencies_v2 = 731,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamUpdateCaptureDependencies_v2_ptsz = 732,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncGetParamInfo = 733,
+ CUPTI_DRIVER_TRACE_CBID_cuKernelGetParamInfo = 734,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceRegisterAsyncNotification = 735,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceUnregisterAsyncNotification = 736,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleGetFunctionCount = 737,
+ CUPTI_DRIVER_TRACE_CBID_cuModuleEnumerateFunctions = 738,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryGetKernelCount = 739,
+ CUPTI_DRIVER_TRACE_CBID_cuLibraryEnumerateKernels = 740,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncIsLoaded = 741,
+ CUPTI_DRIVER_TRACE_CBID_cuFuncLoad = 742,
+ CUPTI_DRIVER_TRACE_CBID_cuGreenCtxCreate = 743,
+ CUPTI_DRIVER_TRACE_CBID_cuGreenCtxDestroy = 744,
+ CUPTI_DRIVER_TRACE_CBID_cuDeviceGetDevResource = 745,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxGetDevResource = 746,
+ CUPTI_DRIVER_TRACE_CBID_cuGreenCtxGetDevResource = 747,
+ CUPTI_DRIVER_TRACE_CBID_cuDevResourceGenerateDesc = 748,
+ CUPTI_DRIVER_TRACE_CBID_cuGreenCtxRecordEvent = 749,
+ CUPTI_DRIVER_TRACE_CBID_cuGreenCtxWaitEvent = 750,
+ CUPTI_DRIVER_TRACE_CBID_cuDevSmResourceSplitByCount = 751,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetGreenCtx = 752,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxFromGreenCtx = 753,
+ CUPTI_DRIVER_TRACE_CBID_cuKernelGetLibrary = 754,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxRecordEvent = 755,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxWaitEvent = 756,
+ CUPTI_DRIVER_TRACE_CBID_cuCtxCreate_v4 = 757,
+ CUPTI_DRIVER_TRACE_CBID_cuGreenCtxStreamCreate = 758,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCtx_v2 = 759,
+ CUPTI_DRIVER_TRACE_CBID_cuStreamGetCtx_v2_ptsz = 760,
+ CUPTI_DRIVER_TRACE_CBID_cuMemBatchDecompressAsync = 761,
+ CUPTI_DRIVER_TRACE_CBID_cuMemBatchDecompressAsync_ptsz = 762,
+ CUPTI_DRIVER_TRACE_CBID_SIZE = 763,
+ CUPTI_DRIVER_TRACE_CBID_FORCE_INT = 0x7fffffff
+} CUpti_driver_api_trace_cbid;
+
+#endif
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_events.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_events.h
new file mode 100644
index 0000000000000000000000000000000000000000..142d70fd10f6ba5b680c0917c475208e657e94a0
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_events.h
@@ -0,0 +1,1350 @@
+/*
+ * Copyright 2010-2021 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if !defined(_CUPTI_EVENTS_H_)
+#define _CUPTI_EVENTS_H_
+
+#include
+#include
+#include
+#include
+
+#ifndef CUPTIAPI
+#ifdef _WIN32
+#define CUPTIAPI __stdcall
+#else
+#define CUPTIAPI
+#endif
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility push(default)
+#endif
+
+/**
+ * \defgroup CUPTI_EVENT_API CUPTI Event API
+ * Functions, types, and enums that implement the CUPTI Event API.
+ *
+ * \note CUPTI event API from the header cupti_events.h are not supported on devices
+ * with compute capability 7.5 and higher (i.e. Turing and later GPU architectures).
+ * These API will be deprecated in a future CUDA release. These are replaced by
+ * Profiling API in the header cupti_profiler_target.h and Perfworks metrics API
+ * in the headers nvperf_host.h and nvperf_target.h which are supported on
+ * devices with compute capability 7.0 and higher (i.e. Volta and later GPU
+ * architectures).
+ *
+ * @{
+ */
+
+/**
+ * \brief ID for an event.
+ *
+ * An event represents a countable activity, action, or occurrence on
+ * the device.
+ */
+typedef uint32_t CUpti_EventID;
+
+/**
+ * \brief ID for an event domain.
+ *
+ * ID for an event domain. An event domain represents a group of
+ * related events. A device may have multiple instances of a domain,
+ * indicating that the device can simultaneously record multiple
+ * instances of each event within that domain.
+ */
+typedef uint32_t CUpti_EventDomainID;
+
+/**
+ * \brief A group of events.
+ *
+ * An event group is a collection of events that are managed
+ * together. All events in an event group must belong to the same
+ * domain.
+ */
+typedef void *CUpti_EventGroup;
+
+/**
+ * \brief Device class.
+ *
+ * Enumeration of device classes for device attribute
+ * CUPTI_DEVICE_ATTR_DEVICE_CLASS.
+ */
+typedef enum {
+ CUPTI_DEVICE_ATTR_DEVICE_CLASS_TESLA = 0,
+ CUPTI_DEVICE_ATTR_DEVICE_CLASS_QUADRO = 1,
+ CUPTI_DEVICE_ATTR_DEVICE_CLASS_GEFORCE = 2,
+ CUPTI_DEVICE_ATTR_DEVICE_CLASS_TEGRA = 3,
+} CUpti_DeviceAttributeDeviceClass;
+
+/**
+ * \brief Device attributes.
+ *
+ * CUPTI device attributes. These attributes can be read using \ref
+ * cuptiDeviceGetAttribute.
+ */
+typedef enum {
+ /**
+ * Number of event IDs for a device. Value is a uint32_t.
+ */
+ CUPTI_DEVICE_ATTR_MAX_EVENT_ID = 1,
+ /**
+ * Number of event domain IDs for a device. Value is a uint32_t.
+ */
+ CUPTI_DEVICE_ATTR_MAX_EVENT_DOMAIN_ID = 2,
+ /**
+ * Get global memory bandwidth in Kbytes/sec. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_GLOBAL_MEMORY_BANDWIDTH = 3,
+ /**
+ * Get theoretical maximum number of instructions per cycle. Value
+ * is a uint32_t.
+ */
+ CUPTI_DEVICE_ATTR_INSTRUCTION_PER_CYCLE = 4,
+ /**
+ * Get theoretical maximum number of single precision instructions
+ * that can be executed per second. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_INSTRUCTION_THROUGHPUT_SINGLE_PRECISION = 5,
+ /**
+ * Get number of frame buffers for device. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_MAX_FRAME_BUFFERS = 6,
+ /**
+ * Get PCIE link rate in Mega bits/sec for device. Return 0 if bus-type
+ * is non-PCIE. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_PCIE_LINK_RATE = 7,
+ /**
+ * Get PCIE link width for device. Return 0 if bus-type
+ * is non-PCIE. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_PCIE_LINK_WIDTH = 8,
+ /**
+ * Get PCIE generation for device. Return 0 if bus-type
+ * is non-PCIE. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_PCIE_GEN = 9,
+ /**
+ * Get the class for the device. Value is a
+ * CUpti_DeviceAttributeDeviceClass.
+ */
+ CUPTI_DEVICE_ATTR_DEVICE_CLASS = 10,
+ /**
+ * Get the peak single precision flop per cycle. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_FLOP_SP_PER_CYCLE = 11,
+ /**
+ * Get the peak double precision flop per cycle. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_FLOP_DP_PER_CYCLE = 12,
+ /**
+ * Get number of L2 units. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_MAX_L2_UNITS = 13,
+ /**
+ * Get the maximum shared memory for the CU_FUNC_CACHE_PREFER_SHARED
+ * preference. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_MAX_SHARED_MEMORY_CACHE_CONFIG_PREFER_SHARED = 14,
+ /**
+ * Get the maximum shared memory for the CU_FUNC_CACHE_PREFER_L1
+ * preference. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_MAX_SHARED_MEMORY_CACHE_CONFIG_PREFER_L1 = 15,
+ /**
+ * Get the maximum shared memory for the CU_FUNC_CACHE_PREFER_EQUAL
+ * preference. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_MAX_SHARED_MEMORY_CACHE_CONFIG_PREFER_EQUAL = 16,
+ /**
+ * Get the peak half precision flop per cycle. Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_FLOP_HP_PER_CYCLE = 17,
+ /**
+ * Check if Nvlink is connected to device. Returns 1, if at least one
+ * Nvlink is connected to the device, returns 0 otherwise.
+ * Value is a uint32_t.
+ */
+ CUPTI_DEVICE_ATTR_NVLINK_PRESENT = 18,
+ /**
+ * Check if Nvlink is present between GPU and CPU. Returns Bandwidth,
+ * in Bytes/sec, if Nvlink is present, returns 0 otherwise.
+ * Value is a uint64_t.
+ */
+ CUPTI_DEVICE_ATTR_GPU_CPU_NVLINK_BW = 19,
+ /**
+ * Check if NVSwitch is present in the underlying topology.
+ * Returns 1, if present, returns 0 otherwise.
+ * Value is a uint32_t.
+ */
+ CUPTI_DEVICE_ATTR_NVSWITCH_PRESENT = 20,
+ CUPTI_DEVICE_ATTR_FORCE_INT = 0x7fffffff,
+} CUpti_DeviceAttribute;
+
+/**
+ * \brief Event domain attributes.
+ *
+ * Event domain attributes. Except where noted, all the attributes can
+ * be read using either \ref cuptiDeviceGetEventDomainAttribute or
+ * \ref cuptiEventDomainGetAttribute.
+ */
+typedef enum {
+ /**
+ * Event domain name. Value is a null terminated const c-string.
+ */
+ CUPTI_EVENT_DOMAIN_ATTR_NAME = 0,
+ /**
+ * Number of instances of the domain for which event counts will be
+ * collected. The domain may have additional instances that cannot
+ * be profiled (see CUPTI_EVENT_DOMAIN_ATTR_TOTAL_INSTANCE_COUNT).
+ * Can be read only with \ref
+ * cuptiDeviceGetEventDomainAttribute. Value is a uint32_t.
+ */
+ CUPTI_EVENT_DOMAIN_ATTR_INSTANCE_COUNT = 1,
+ /**
+ * Total number of instances of the domain, including instances that
+ * cannot be profiled. Use CUPTI_EVENT_DOMAIN_ATTR_INSTANCE_COUNT
+ * to get the number of instances that can be profiled. Can be read
+ * only with \ref cuptiDeviceGetEventDomainAttribute. Value is a
+ * uint32_t.
+ */
+ CUPTI_EVENT_DOMAIN_ATTR_TOTAL_INSTANCE_COUNT = 3,
+ /**
+ * Collection method used for events contained in the event domain.
+ * Value is a \ref CUpti_EventCollectionMethod.
+ */
+ CUPTI_EVENT_DOMAIN_ATTR_COLLECTION_METHOD = 4,
+
+ CUPTI_EVENT_DOMAIN_ATTR_FORCE_INT = 0x7fffffff,
+} CUpti_EventDomainAttribute;
+
+/**
+ * \brief The collection method used for an event.
+ *
+ * The collection method indicates how an event is collected.
+ */
+typedef enum {
+ /**
+ * Event is collected using a hardware global performance monitor.
+ */
+ CUPTI_EVENT_COLLECTION_METHOD_PM = 0,
+ /**
+ * Event is collected using a hardware SM performance monitor.
+ */
+ CUPTI_EVENT_COLLECTION_METHOD_SM = 1,
+ /**
+ * Event is collected using software instrumentation.
+ */
+ CUPTI_EVENT_COLLECTION_METHOD_INSTRUMENTED = 2,
+ /**
+ * Event is collected using NvLink throughput counter method.
+ */
+ CUPTI_EVENT_COLLECTION_METHOD_NVLINK_TC = 3,
+ CUPTI_EVENT_COLLECTION_METHOD_FORCE_INT = 0x7fffffff
+} CUpti_EventCollectionMethod;
+
+/**
+ * \brief Event group attributes.
+ *
+ * Event group attributes. These attributes can be read using \ref
+ * cuptiEventGroupGetAttribute. Attributes marked [rw] can also be
+ * written using \ref cuptiEventGroupSetAttribute.
+ */
+typedef enum {
+ /**
+ * The domain to which the event group is bound. This attribute is
+ * set when the first event is added to the group. Value is a
+ * CUpti_EventDomainID.
+ */
+ CUPTI_EVENT_GROUP_ATTR_EVENT_DOMAIN_ID = 0,
+ /**
+ * [rw] Profile all the instances of the domain for this
+ * eventgroup. This feature can be used to get load balancing
+ * across all instances of a domain. Value is an integer.
+ */
+ CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES = 1,
+ /**
+ * [rw] Reserved for user data.
+ */
+ CUPTI_EVENT_GROUP_ATTR_USER_DATA = 2,
+ /**
+ * Number of events in the group. Value is a uint32_t.
+ */
+ CUPTI_EVENT_GROUP_ATTR_NUM_EVENTS = 3,
+ /**
+ * Enumerates events in the group. Value is a pointer to buffer of
+ * size sizeof(CUpti_EventID) * num_of_events in the eventgroup.
+ * num_of_events can be queried using
+ * CUPTI_EVENT_GROUP_ATTR_NUM_EVENTS.
+ */
+ CUPTI_EVENT_GROUP_ATTR_EVENTS = 4,
+ /**
+ * Number of instances of the domain bound to this event group that
+ * will be counted. Value is a uint32_t.
+ */
+ CUPTI_EVENT_GROUP_ATTR_INSTANCE_COUNT = 5,
+ /**
+ * Event group scope can be set to CUPTI_EVENT_PROFILING_SCOPE_DEVICE or
+ * CUPTI_EVENT_PROFILING_SCOPE_CONTEXT for an eventGroup, before
+ * adding any event.
+ * Sets the scope of eventgroup as CUPTI_EVENT_PROFILING_SCOPE_DEVICE or
+ * CUPTI_EVENT_PROFILING_SCOPE_CONTEXT when the scope of the events
+ * that will be added is CUPTI_EVENT_PROFILING_SCOPE_BOTH.
+ * If profiling scope of event is either
+ * CUPTI_EVENT_PROFILING_SCOPE_DEVICE or CUPTI_EVENT_PROFILING_SCOPE_CONTEXT
+ * then setting this attribute will not affect the default scope.
+ * It is not allowed to add events of different scope to same eventgroup.
+ * Value is a uint32_t.
+ */
+ CUPTI_EVENT_GROUP_ATTR_PROFILING_SCOPE = 6,
+ CUPTI_EVENT_GROUP_ATTR_FORCE_INT = 0x7fffffff,
+} CUpti_EventGroupAttribute;
+
+/**
+* \brief Profiling scope for event.
+*
+* Profiling scope of event indicates if the event can be collected at context
+* scope or device scope or both i.e. it can be collected at any of context or
+* device scope.
+*/
+typedef enum {
+ /**
+ * Event is collected at context scope.
+ */
+ CUPTI_EVENT_PROFILING_SCOPE_CONTEXT = 0,
+ /**
+ * Event is collected at device scope.
+ */
+ CUPTI_EVENT_PROFILING_SCOPE_DEVICE = 1,
+ /**
+ * Event can be collected at device or context scope.
+ * The scope can be set using \ref cuptiEventGroupSetAttribute API.
+ */
+ CUPTI_EVENT_PROFILING_SCOPE_BOTH = 2,
+ CUPTI_EVENT_PROFILING_SCOPE_FORCE_INT = 0x7fffffff
+} CUpti_EventProfilingScope;
+
+/**
+ * \brief Event attributes.
+ *
+ * Event attributes. These attributes can be read using \ref
+ * cuptiEventGetAttribute.
+ */
+typedef enum {
+ /**
+ * Event name. Value is a null terminated const c-string.
+ */
+ CUPTI_EVENT_ATTR_NAME = 0,
+ /**
+ * Short description of event. Value is a null terminated const
+ * c-string.
+ */
+ CUPTI_EVENT_ATTR_SHORT_DESCRIPTION = 1,
+ /**
+ * Long description of event. Value is a null terminated const
+ * c-string.
+ */
+ CUPTI_EVENT_ATTR_LONG_DESCRIPTION = 2,
+ /**
+ * Category of event. Value is CUpti_EventCategory.
+ */
+ CUPTI_EVENT_ATTR_CATEGORY = 3,
+ /**
+ * Profiling scope of the events. It can be either device or context or both.
+ * Value is a \ref CUpti_EventProfilingScope.
+ */
+ CUPTI_EVENT_ATTR_PROFILING_SCOPE = 5,
+
+ CUPTI_EVENT_ATTR_FORCE_INT = 0x7fffffff,
+} CUpti_EventAttribute;
+
+/**
+ * \brief Event collection modes.
+ *
+ * The event collection mode determines the period over which the
+ * events within the enabled event groups will be collected.
+ */
+typedef enum {
+ /**
+ * Events are collected for the entire duration between the
+ * cuptiEventGroupEnable and cuptiEventGroupDisable calls.
+ * Event values are reset when the events are read.
+ * For CUDA toolkit v6.0 and older this was the default mode.
+ */
+ CUPTI_EVENT_COLLECTION_MODE_CONTINUOUS = 0,
+ /**
+ * Events are collected only for the durations of kernel executions
+ * that occur between the cuptiEventGroupEnable and
+ * cuptiEventGroupDisable calls. Event collection begins when a
+ * kernel execution begins, and stops when kernel execution
+ * completes. Event values are reset to zero when each kernel
+ * execution begins. If multiple kernel executions occur between the
+ * cuptiEventGroupEnable and cuptiEventGroupDisable calls then the
+ * event values must be read after each kernel launch if those
+ * events need to be associated with the specific kernel launch.
+ * Note that collection in this mode may significantly change the
+ * overall performance characteristics of the application because
+ * kernel executions that occur between the cuptiEventGroupEnable and
+ * cuptiEventGroupDisable calls are serialized on the GPU.
+ * This is the default mode from CUDA toolkit v6.5
+ */
+ CUPTI_EVENT_COLLECTION_MODE_KERNEL = 1,
+ CUPTI_EVENT_COLLECTION_MODE_FORCE_INT = 0x7fffffff
+} CUpti_EventCollectionMode;
+
+/**
+ * \brief An event category.
+ *
+ * Each event is assigned to a category that represents the general
+ * type of the event. A event's category is accessed using \ref
+ * cuptiEventGetAttribute and the CUPTI_EVENT_ATTR_CATEGORY attribute.
+ */
+typedef enum {
+ /**
+ * An instruction related event.
+ */
+ CUPTI_EVENT_CATEGORY_INSTRUCTION = 0,
+ /**
+ * A memory related event.
+ */
+ CUPTI_EVENT_CATEGORY_MEMORY = 1,
+ /**
+ * A cache related event.
+ */
+ CUPTI_EVENT_CATEGORY_CACHE = 2,
+ /**
+ * A profile-trigger event.
+ */
+ CUPTI_EVENT_CATEGORY_PROFILE_TRIGGER = 3,
+ /**
+ * A system event.
+ */
+ CUPTI_EVENT_CATEGORY_SYSTEM = 4,
+ CUPTI_EVENT_CATEGORY_FORCE_INT = 0x7fffffff
+} CUpti_EventCategory;
+
+/**
+ * \brief The overflow value for a CUPTI event.
+ *
+ * The CUPTI event value that indicates an overflow.
+ */
+#define CUPTI_EVENT_OVERFLOW ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
+
+/**
+ * \brief The value that indicates the event value is invalid
+ */
+#define CUPTI_EVENT_INVALID ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
+
+/**
+ * \brief Flags for cuptiEventGroupReadEvent an
+ * cuptiEventGroupReadAllEvents.
+ *
+ * Flags for \ref cuptiEventGroupReadEvent an \ref
+ * cuptiEventGroupReadAllEvents.
+ */
+typedef enum {
+ /**
+ * No flags.
+ */
+ CUPTI_EVENT_READ_FLAG_NONE = 0,
+ CUPTI_EVENT_READ_FLAG_FORCE_INT = 0x7fffffff,
+} CUpti_ReadEventFlags;
+
+
+/**
+ * \brief A set of event groups.
+ *
+ * A set of event groups. When returned by \ref
+ * cuptiEventGroupSetsCreate and \ref cuptiMetricCreateEventGroupSets
+ * a set indicates that event groups that can be enabled at the same
+ * time (i.e. all the events in the set can be collected
+ * simultaneously).
+ */
+typedef struct {
+ /**
+ * The number of event groups in the set.
+ */
+ uint32_t numEventGroups;
+ /**
+ * An array of \p numEventGroups event groups.
+ */
+ CUpti_EventGroup *eventGroups;
+} CUpti_EventGroupSet;
+
+/**
+ * \brief A set of event group sets.
+ *
+ * A set of event group sets. When returned by \ref
+ * cuptiEventGroupSetsCreate and \ref cuptiMetricCreateEventGroupSets
+ * a CUpti_EventGroupSets indicates the number of passes required to
+ * collect all the events, and the event groups that should be
+ * collected during each pass.
+ */
+typedef struct {
+ /**
+ * Number of event group sets.
+ */
+ uint32_t numSets;
+ /**
+ * An array of \p numSets event group sets.
+ */
+ CUpti_EventGroupSet *sets;
+} CUpti_EventGroupSets;
+
+/**
+ * \brief Set the event collection mode.
+ *
+ * Set the event collection mode for a \p context. The \p mode
+ * controls the event collection behavior of all events in event
+ * groups created in the \p context. This API is invalid in kernel
+ * replay mode.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param context The context
+ * \param mode The event collection mode
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_CONTEXT
+ * \retval CUPTI_ERROR_INVALID_OPERATION if called when replay mode is enabled
+ * \retval CUPTI_ERROR_NOT_SUPPORTED if mode is not supported on the device
+ */
+
+CUptiResult CUPTIAPI cuptiSetEventCollectionMode(CUcontext context,
+ CUpti_EventCollectionMode mode);
+
+/**
+ * \brief Read a device attribute.
+ *
+ * Read a device attribute and return it in \p *value.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param device The CUDA device
+ * \param attrib The attribute to read
+ * \param valueSize Size of buffer pointed by the value, and
+ * returns the number of bytes written to \p value
+ * \param value Returns the value of the attribute
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value
+ * is NULL, or if \p attrib is not a device attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT For non-c-string
+ * attribute values, indicates that the \p value buffer is too small
+ * to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiDeviceGetAttribute(CUdevice device,
+ CUpti_DeviceAttribute attrib,
+ size_t *valueSize,
+ void *value);
+
+/**
+ * \brief Get the number of domains for a device.
+ *
+ * Returns the number of domains in \p numDomains for a device.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param device The CUDA device
+ * \param numDomains Returns the number of domains
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p numDomains is NULL
+ */
+CUptiResult CUPTIAPI cuptiDeviceGetNumEventDomains(CUdevice device,
+ uint32_t *numDomains);
+
+/**
+ * \brief Get the event domains for a device.
+ *
+ * Returns the event domains IDs in \p domainArray for a device. The
+ * size of the \p domainArray buffer is given by \p
+ * *arraySizeBytes. The size of the \p domainArray buffer must be at
+ * least \p numdomains * sizeof(CUpti_EventDomainID) or else all
+ * domains will not be returned. The value returned in \p
+ * *arraySizeBytes contains the number of bytes returned in \p
+ * domainArray.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param device The CUDA device
+ * \param arraySizeBytes The size of \p domainArray in bytes, and
+ * returns the number of bytes written to \p domainArray
+ * \param domainArray Returns the IDs of the event domains for the device
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p arraySizeBytes or
+ * \p domainArray are NULL
+ */
+CUptiResult CUPTIAPI cuptiDeviceEnumEventDomains(CUdevice device,
+ size_t *arraySizeBytes,
+ CUpti_EventDomainID *domainArray);
+
+/**
+ * \brief Read an event domain attribute.
+ *
+ * Returns an event domain attribute in \p *value. The size of the \p
+ * value buffer is given by \p *valueSize. The value returned in \p
+ * *valueSize contains the number of bytes returned in \p value.
+ *
+ * If the attribute value is a c-string that is longer than \p
+ * *valueSize, then only the first \p *valueSize characters will be
+ * returned and there will be no terminating null byte.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param device The CUDA device
+ * \param eventDomain ID of the event domain
+ * \param attrib The event domain attribute to read
+ * \param valueSize The size of the \p value buffer in bytes, and
+ * returns the number of bytes written to \p value
+ * \param value Returns the attribute's value
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE
+ * \retval CUPTI_ERROR_INVALID_EVENT_DOMAIN_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value
+ * is NULL, or if \p attrib is not an event domain attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT For non-c-string
+ * attribute values, indicates that the \p value buffer is too small
+ * to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiDeviceGetEventDomainAttribute(CUdevice device,
+ CUpti_EventDomainID eventDomain,
+ CUpti_EventDomainAttribute attrib,
+ size_t *valueSize,
+ void *value);
+
+/**
+ * \brief Get the number of event domains available on any device.
+ *
+ * Returns the total number of event domains available on any
+ * CUDA-capable device.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param numDomains Returns the number of domains
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p numDomains is NULL
+ */
+CUptiResult CUPTIAPI cuptiGetNumEventDomains(uint32_t *numDomains);
+
+/**
+ * \brief Get the event domains available on any device.
+ *
+ * Returns all the event domains available on any CUDA-capable device.
+ * Event domain IDs are returned in \p domainArray. The size of the \p
+ * domainArray buffer is given by \p *arraySizeBytes. The size of the
+ * \p domainArray buffer must be at least \p numDomains *
+ * sizeof(CUpti_EventDomainID) or all domains will not be
+ * returned. The value returned in \p *arraySizeBytes contains the
+ * number of bytes returned in \p domainArray.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param arraySizeBytes The size of \p domainArray in bytes, and
+ * returns the number of bytes written to \p domainArray
+ * \param domainArray Returns all the event domains
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p arraySizeBytes or
+ * \p domainArray are NULL
+ */
+CUptiResult CUPTIAPI cuptiEnumEventDomains(size_t *arraySizeBytes,
+ CUpti_EventDomainID *domainArray);
+
+/**
+ * \brief Read an event domain attribute.
+ *
+ * Returns an event domain attribute in \p *value. The size of the \p
+ * value buffer is given by \p *valueSize. The value returned in \p
+ * *valueSize contains the number of bytes returned in \p value.
+ *
+ * If the attribute value is a c-string that is longer than \p
+ * *valueSize, then only the first \p *valueSize characters will be
+ * returned and there will be no terminating null byte.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventDomain ID of the event domain
+ * \param attrib The event domain attribute to read
+ * \param valueSize The size of the \p value buffer in bytes, and
+ * returns the number of bytes written to \p value
+ * \param value Returns the attribute's value
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_EVENT_DOMAIN_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value
+ * is NULL, or if \p attrib is not an event domain attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT For non-c-string
+ * attribute values, indicates that the \p value buffer is too small
+ * to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiEventDomainGetAttribute(CUpti_EventDomainID eventDomain,
+ CUpti_EventDomainAttribute attrib,
+ size_t *valueSize,
+ void *value);
+
+/**
+ * \brief Get number of events in a domain.
+ *
+ * Returns the number of events in \p numEvents for a domain.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventDomain ID of the event domain
+ * \param numEvents Returns the number of events in the domain
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_EVENT_DOMAIN_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p numEvents is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventDomainGetNumEvents(CUpti_EventDomainID eventDomain,
+ uint32_t *numEvents);
+
+/**
+ * \brief Get the events in a domain.
+ *
+ * Returns the event IDs in \p eventArray for a domain. The size of
+ * the \p eventArray buffer is given by \p *arraySizeBytes. The size
+ * of the \p eventArray buffer must be at least \p numdomainevents *
+ * sizeof(CUpti_EventID) or else all events will not be returned. The
+ * value returned in \p *arraySizeBytes contains the number of bytes
+ * returned in \p eventArray.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventDomain ID of the event domain
+ * \param arraySizeBytes The size of \p eventArray in bytes, and
+ * returns the number of bytes written to \p eventArray
+ * \param eventArray Returns the IDs of the events in the domain
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_EVENT_DOMAIN_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p arraySizeBytes or \p
+ * eventArray are NULL
+ */
+CUptiResult CUPTIAPI cuptiEventDomainEnumEvents(CUpti_EventDomainID eventDomain,
+ size_t *arraySizeBytes,
+ CUpti_EventID *eventArray);
+
+/**
+ * \brief Get an event attribute.
+ *
+ * Returns an event attribute in \p *value. The size of the \p
+ * value buffer is given by \p *valueSize. The value returned in \p
+ * *valueSize contains the number of bytes returned in \p value.
+ *
+ * If the attribute value is a c-string that is longer than \p
+ * *valueSize, then only the first \p *valueSize characters will be
+ * returned and there will be no terminating null byte.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param event ID of the event
+ * \param attrib The event attribute to read
+ * \param valueSize The size of the \p value buffer in bytes, and
+ * returns the number of bytes written to \p value
+ * \param value Returns the attribute's value
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_EVENT_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value
+ * is NULL, or if \p attrib is not an event attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT For non-c-string
+ * attribute values, indicates that the \p value buffer is too small
+ * to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiEventGetAttribute(CUpti_EventID event,
+ CUpti_EventAttribute attrib,
+ size_t *valueSize,
+ void *value);
+
+/**
+ * \brief Find an event by name.
+ *
+ * Find an event by name and return the event ID in \p *event.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param device The CUDA device
+ * \param eventName The name of the event to find
+ * \param event Returns the ID of the found event or undefined if
+ * unable to find the event
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE
+ * \retval CUPTI_ERROR_INVALID_EVENT_NAME if unable to find an event
+ * with name \p eventName. In this case \p *event is undefined
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventName or \p event are NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGetIdFromName(CUdevice device,
+ const char *eventName,
+ CUpti_EventID *event);
+
+/**
+ * \brief Create a new event group for a context.
+ *
+ * Creates a new event group for \p context and returns the new group
+ * in \p *eventGroup.
+ * \note \p flags are reserved for future use and should be set to zero.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param context The context for the event group
+ * \param eventGroup Returns the new event group
+ * \param flags Reserved - must be zero
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_CONTEXT
+ * \retval CUPTI_ERROR_OUT_OF_MEMORY
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupCreate(CUcontext context,
+ CUpti_EventGroup *eventGroup,
+ uint32_t flags);
+
+/**
+ * \brief Destroy an event group.
+ *
+ * Destroy an \p eventGroup and free its resources. An event group
+ * cannot be destroyed if it is enabled.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroup The event group to destroy
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_OPERATION if the event group is enabled
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if eventGroup is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupDestroy(CUpti_EventGroup eventGroup);
+
+/**
+ * \brief Read an event group attribute.
+ *
+ * Read an event group attribute and return it in \p *value.
+ * \note \b Thread-safety: this function is thread safe but client
+ * must guard against simultaneous destruction or modification of \p
+ * eventGroup (for example, client must guard against simultaneous
+ * calls to \ref cuptiEventGroupDestroy, \ref cuptiEventGroupAddEvent,
+ * etc.), and must guard against simultaneous destruction of the
+ * context in which \p eventGroup was created (for example, client
+ * must guard against simultaneous calls to cudaDeviceReset,
+ * cuCtxDestroy, etc.).
+ *
+ * \param eventGroup The event group
+ * \param attrib The attribute to read
+ * \param valueSize Size of buffer pointed by the value, and
+ * returns the number of bytes written to \p value
+ * \param value Returns the value of the attribute
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value
+ * is NULL, or if \p attrib is not an eventgroup attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT For non-c-string
+ * attribute values, indicates that the \p value buffer is too small
+ * to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiEventGroupGetAttribute(CUpti_EventGroup eventGroup,
+ CUpti_EventGroupAttribute attrib,
+ size_t *valueSize,
+ void *value);
+
+/**
+ * \brief Write an event group attribute.
+ *
+ * Write an event group attribute.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroup The event group
+ * \param attrib The attribute to write
+ * \param valueSize The size, in bytes, of the value
+ * \param value The attribute value to write
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value
+ * is NULL, or if \p attrib is not an event group attribute, or if
+ * \p attrib is not a writable attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT Indicates that
+ * the \p value buffer is too small to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiEventGroupSetAttribute(CUpti_EventGroup eventGroup,
+ CUpti_EventGroupAttribute attrib,
+ size_t valueSize,
+ void *value);
+
+/**
+ * \brief Add an event to an event group.
+ *
+ * Add an event to an event group. The event add can fail for a number of reasons:
+ * \li The event group is enabled
+ * \li The event does not belong to the same event domain as the
+ * events that are already in the event group
+ * \li Device limitations on the events that can belong to the same group
+ * \li The event group is full
+ *
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroup The event group
+ * \param event The event to add to the group
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_EVENT_ID
+ * \retval CUPTI_ERROR_OUT_OF_MEMORY
+ * \retval CUPTI_ERROR_INVALID_OPERATION if \p eventGroup is enabled
+ * \retval CUPTI_ERROR_NOT_COMPATIBLE if \p event belongs to a
+ * different event domain than the events already in \p eventGroup, or
+ * if a device limitation prevents \p event from being collected at
+ * the same time as the events already in \p eventGroup
+ * \retval CUPTI_ERROR_MAX_LIMIT_REACHED if \p eventGroup is full
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupAddEvent(CUpti_EventGroup eventGroup,
+ CUpti_EventID event);
+
+/**
+ * \brief Remove an event from an event group.
+ *
+ * Remove \p event from the an event group. The event cannot be
+ * removed if the event group is enabled.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroup The event group
+ * \param event The event to remove from the group
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_EVENT_ID
+ * \retval CUPTI_ERROR_INVALID_OPERATION if \p eventGroup is enabled
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupRemoveEvent(CUpti_EventGroup eventGroup,
+ CUpti_EventID event);
+
+/**
+ * \brief Remove all events from an event group.
+ *
+ * Remove all events from an event group. Events cannot be removed if
+ * the event group is enabled.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroup The event group
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_OPERATION if \p eventGroup is enabled
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupRemoveAllEvents(CUpti_EventGroup eventGroup);
+
+/**
+ * \brief Zero all the event counts in an event group.
+ *
+ * Zero all the event counts in an event group.
+ * \note \b Thread-safety: this function is thread safe but client
+ * must guard against simultaneous destruction or modification of \p
+ * eventGroup (for example, client must guard against simultaneous
+ * calls to \ref cuptiEventGroupDestroy, \ref cuptiEventGroupAddEvent,
+ * etc.), and must guard against simultaneous destruction of the
+ * context in which \p eventGroup was created (for example, client
+ * must guard against simultaneous calls to cudaDeviceReset,
+ * cuCtxDestroy, etc.).
+ *
+ * \param eventGroup The event group
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_HARDWARE
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupResetAllEvents(CUpti_EventGroup eventGroup);
+
+/**
+ * \brief Enable an event group.
+ *
+ * Enable an event group. Enabling an event group zeros the value of
+ * all the events in the group and then starts collection of those
+ * events.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroup The event group
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_HARDWARE
+ * \retval CUPTI_ERROR_NOT_READY if \p eventGroup does not contain any events
+ * \retval CUPTI_ERROR_NOT_COMPATIBLE if \p eventGroup cannot be
+ * enabled due to other already enabled event groups
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup is NULL
+ * \retval CUPTI_ERROR_HARDWARE_BUSY if another client is profiling
+ * and hardware is busy
+ */
+CUptiResult CUPTIAPI cuptiEventGroupEnable(CUpti_EventGroup eventGroup);
+
+/**
+ * \brief Disable an event group.
+ *
+ * Disable an event group. Disabling an event group stops collection
+ * of events contained in the group.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroup The event group
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_HARDWARE
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupDisable(CUpti_EventGroup eventGroup);
+
+/**
+ * \brief Read the value for an event in an event group.
+ *
+ * Read the value for an event in an event group. The event value is
+ * returned in the \p eventValueBuffer buffer. \p
+ * eventValueBufferSizeBytes indicates the size of the \p
+ * eventValueBuffer buffer. The buffer must be at least sizeof(uint64)
+ * if ::CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES is not set
+ * on the group containing the event. The buffer must be at least
+ * (sizeof(uint64) * number of domain instances) if
+ * ::CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES is set on the
+ * group.
+ *
+ * If any instance of an event counter overflows, the value returned
+ * for that event instance will be ::CUPTI_EVENT_OVERFLOW.
+ *
+ * The only allowed value for \p flags is ::CUPTI_EVENT_READ_FLAG_NONE.
+ *
+ * Reading an event from a disabled event group is not allowed. After
+ * being read, an event's value is reset to zero.
+ * \note \b Thread-safety: this function is thread safe but client
+ * must guard against simultaneous destruction or modification of \p
+ * eventGroup (for example, client must guard against simultaneous
+ * calls to \ref cuptiEventGroupDestroy, \ref cuptiEventGroupAddEvent,
+ * etc.), and must guard against simultaneous destruction of the
+ * context in which \p eventGroup was created (for example, client
+ * must guard against simultaneous calls to cudaDeviceReset,
+ * cuCtxDestroy, etc.). If \ref cuptiEventGroupResetAllEvents is
+ * called simultaneously with this function, then returned event
+ * values are undefined.
+ *
+ * \param eventGroup The event group
+ * \param flags Flags controlling the reading mode
+ * \param event The event to read
+ * \param eventValueBufferSizeBytes The size of \p eventValueBuffer
+ * in bytes, and returns the number of bytes written to \p
+ * eventValueBuffer
+ * \param eventValueBuffer Returns the event value(s)
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_EVENT_ID
+ * \retval CUPTI_ERROR_HARDWARE
+ * \retval CUPTI_ERROR_INVALID_OPERATION if \p eventGroup is disabled
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup, \p
+ * eventValueBufferSizeBytes or \p eventValueBuffer is NULL
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT if size of \p eventValueBuffer
+ * is not sufficient
+ */
+CUptiResult CUPTIAPI cuptiEventGroupReadEvent(CUpti_EventGroup eventGroup,
+ CUpti_ReadEventFlags flags,
+ CUpti_EventID event,
+ size_t *eventValueBufferSizeBytes,
+ uint64_t *eventValueBuffer);
+
+/**
+ * \brief Read the values for all the events in an event group.
+ *
+ * Read the values for all the events in an event group. The event
+ * values are returned in the \p eventValueBuffer buffer. \p
+ * eventValueBufferSizeBytes indicates the size of \p
+ * eventValueBuffer. The buffer must be at least (sizeof(uint64) *
+ * number of events in group) if
+ * ::CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES is not set on
+ * the group containing the events. The buffer must be at least
+ * (sizeof(uint64) * number of domain instances * number of events in
+ * group) if ::CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES is
+ * set on the group.
+ *
+ * The data format returned in \p eventValueBuffer is:
+ * - domain instance 0: event0 event1 ... eventN
+ * - domain instance 1: event0 event1 ... eventN
+ * - ...
+ * - domain instance M: event0 event1 ... eventN
+ *
+ * The event order in \p eventValueBuffer is returned in \p
+ * eventIdArray. The size of \p eventIdArray is specified in \p
+ * eventIdArraySizeBytes. The size should be at least
+ * (sizeof(CUpti_EventID) * number of events in group).
+ *
+ * If any instance of any event counter overflows, the value returned
+ * for that event instance will be ::CUPTI_EVENT_OVERFLOW.
+ *
+ * The only allowed value for \p flags is ::CUPTI_EVENT_READ_FLAG_NONE.
+ *
+ * Reading events from a disabled event group is not allowed. After
+ * being read, an event's value is reset to zero.
+ * \note \b Thread-safety: this function is thread safe but client
+ * must guard against simultaneous destruction or modification of \p
+ * eventGroup (for example, client must guard against simultaneous
+ * calls to \ref cuptiEventGroupDestroy, \ref cuptiEventGroupAddEvent,
+ * etc.), and must guard against simultaneous destruction of the
+ * context in which \p eventGroup was created (for example, client
+ * must guard against simultaneous calls to cudaDeviceReset,
+ * cuCtxDestroy, etc.). If \ref cuptiEventGroupResetAllEvents is
+ * called simultaneously with this function, then returned event
+ * values are undefined.
+ *
+ * \param eventGroup The event group
+ * \param flags Flags controlling the reading mode
+ * \param eventValueBufferSizeBytes The size of \p eventValueBuffer in
+ * bytes, and returns the number of bytes written to \p
+ * eventValueBuffer
+ * \param eventValueBuffer Returns the event values
+ * \param eventIdArraySizeBytes The size of \p eventIdArray in bytes,
+ * and returns the number of bytes written to \p eventIdArray
+ * \param eventIdArray Returns the IDs of the events in the same order
+ * as the values return in eventValueBuffer.
+ * \param numEventIdsRead Returns the number of event IDs returned
+ * in \p eventIdArray
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_HARDWARE
+ * \retval CUPTI_ERROR_INVALID_OPERATION if \p eventGroup is disabled
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroup, \p
+ * eventValueBufferSizeBytes, \p eventValueBuffer, \p
+ * eventIdArraySizeBytes, \p eventIdArray or \p numEventIdsRead is
+ * NULL
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT if size of \p eventValueBuffer
+ * or \p eventIdArray is not sufficient
+ */
+CUptiResult CUPTIAPI cuptiEventGroupReadAllEvents(CUpti_EventGroup eventGroup,
+ CUpti_ReadEventFlags flags,
+ size_t *eventValueBufferSizeBytes,
+ uint64_t *eventValueBuffer,
+ size_t *eventIdArraySizeBytes,
+ CUpti_EventID *eventIdArray,
+ size_t *numEventIdsRead);
+
+/**
+ * \brief For a set of events, get the grouping that indicates the
+ * number of passes and the event groups necessary to collect the
+ * events.
+ *
+ * The number of events that can be collected simultaneously varies by
+ * device and by the type of the events. When events can be collected
+ * simultaneously, they may need to be grouped into multiple event
+ * groups because they are from different event domains. This function
+ * takes a set of events and determines how many passes are required
+ * to collect all those events, and which events can be collected
+ * simultaneously in each pass.
+ *
+ * The CUpti_EventGroupSets returned in \p eventGroupPasses indicates
+ * how many passes are required to collect the events with the \p
+ * numSets field. Within each event group set, the \p sets array
+ * indicates the event groups that should be collected on each pass.
+ * \note \b Thread-safety: this function is thread safe, but client
+ * must guard against another thread simultaneously destroying \p
+ * context.
+ *
+ * \param context The context for event collection
+ * \param eventIdArraySizeBytes Size of \p eventIdArray in bytes
+ * \param eventIdArray Array of event IDs that need to be grouped
+ * \param eventGroupPasses Returns a CUpti_EventGroupSets object that
+ * indicates the number of passes required to collect the events and
+ * the events to collect on each pass
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_CONTEXT
+ * \retval CUPTI_ERROR_INVALID_EVENT_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventIdArray or
+ * \p eventGroupPasses is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupSetsCreate(CUcontext context,
+ size_t eventIdArraySizeBytes,
+ CUpti_EventID *eventIdArray,
+ CUpti_EventGroupSets **eventGroupPasses);
+
+/**
+ * \brief Destroy a event group sets object.
+ *
+ * Destroy a CUpti_EventGroupSets object.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroupSets The object to destroy
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_OPERATION if any of the event groups
+ * contained in the sets is enabled
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroupSets is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupSetsDestroy(CUpti_EventGroupSets *eventGroupSets);
+
+
+/**
+ * \brief Enable an event group set.
+ *
+ * Enable a set of event groups. Enabling a set of event groups zeros the value of
+ * all the events in all the groups and then starts collection of those events.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param eventGroupSet The pointer to the event group set
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_HARDWARE
+ * \retval CUPTI_ERROR_NOT_READY if \p eventGroup does not contain any events
+ * \retval CUPTI_ERROR_NOT_COMPATIBLE if \p eventGroup cannot be
+ * enabled due to other already enabled event groups
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroupSet is NULL
+ * \retval CUPTI_ERROR_HARDWARE_BUSY if other client is profiling and hardware is
+ * busy
+ */
+CUptiResult CUPTIAPI cuptiEventGroupSetEnable(CUpti_EventGroupSet *eventGroupSet);
+
+/**
+ * \brief Disable an event group set.
+ *
+ * Disable a set of event groups. Disabling a set of event groups
+ * stops collection of events contained in the groups.
+ * \note \b Thread-safety: this function is thread safe.
+ * \note \b If this call fails, some of the event groups in the set may be disabled
+ * and other event groups may remain enabled.
+ *
+ * \param eventGroupSet The pointer to the event group set
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_HARDWARE
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventGroupSet is NULL
+ */
+CUptiResult CUPTIAPI cuptiEventGroupSetDisable(CUpti_EventGroupSet *eventGroupSet);
+
+/**
+ * \brief Enable kernel replay mode.
+ *
+ * Set profiling mode for the context to replay mode. In this mode,
+ * any number of events can be collected in one run of the kernel. The
+ * event collection mode will automatically switch to
+ * CUPTI_EVENT_COLLECTION_MODE_KERNEL. In this mode, \ref
+ * cuptiSetEventCollectionMode will return
+ * CUPTI_ERROR_INVALID_OPERATION.
+ * \note \b Kernels might take longer to run if many events are enabled.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param context The context
+ * \retval CUPTI_SUCCESS
+ */
+CUptiResult CUPTIAPI cuptiEnableKernelReplayMode(CUcontext context);
+
+/**
+ * \brief Disable kernel replay mode.
+ *
+ * Set profiling mode for the context to non-replay (default)
+ * mode. Event collection mode will be set to
+ * CUPTI_EVENT_COLLECTION_MODE_KERNEL. All previously enabled
+ * event groups and event group sets will be disabled.
+ * \note \b Thread-safety: this function is thread safe.
+ *
+ * \param context The context
+ * \retval CUPTI_SUCCESS
+ */
+CUptiResult CUPTIAPI cuptiDisableKernelReplayMode(CUcontext context);
+
+/**
+ * \brief Function type for getting updates on kernel replay.
+ *
+ * \param kernelName The mangled kernel name
+ * \param numReplaysDone Number of replays done so far
+ * \param customData Pointer of any custom data passed in when subscribing
+ */
+typedef void (CUPTIAPI *CUpti_KernelReplayUpdateFunc)(
+ const char *kernelName,
+ int numReplaysDone,
+ void *customData);
+
+/**
+ * \brief Subscribe to kernel replay updates.
+ *
+ * When subscribed, the function pointer passed in will be called each time a
+ * kernel run is finished during kernel replay. Previously subscribed function
+ * pointer will be replaced. Pass in NULL as the function pointer unsubscribes
+ * the update.
+ *
+ * \param updateFunc The update function pointer
+ * \param customData Pointer to any custom data
+ * \retval CUPTI_SUCCESS
+ */
+CUptiResult CUPTIAPI cuptiKernelReplaySubscribeUpdate(CUpti_KernelReplayUpdateFunc updateFunc, void *customData);
+
+/** @} */ /* END CUPTI_EVENT_API */
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /*_CUPTI_EVENTS_H_*/
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_metrics.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_metrics.h
new file mode 100644
index 0000000000000000000000000000000000000000..28d441e6b51a1be18f22a018800316fda0a779ec
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_metrics.h
@@ -0,0 +1,825 @@
+/*
+ * Copyright 2011-2020 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if !defined(_CUPTI_METRIC_H_)
+#define _CUPTI_METRIC_H_
+
+#include
+#include
+#include
+#include
+
+#ifndef CUPTIAPI
+#ifdef _WIN32
+#define CUPTIAPI __stdcall
+#else
+#define CUPTIAPI
+#endif
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility push(default)
+#endif
+
+/**
+ * \defgroup CUPTI_METRIC_API CUPTI Metric API
+ * Functions, types, and enums that implement the CUPTI Metric API.
+ *
+ * \note CUPTI metric API from the header cupti_metrics.h are not supported on devices
+ * with compute capability 7.5 and higher (i.e. Turing and later GPU architectures).
+ * These API will be deprecated in a future CUDA release. These are replaced by
+ * Profiling API in the header cupti_profiler_target.h and Perfworks metrics API
+ * in the headers nvperf_host.h and nvperf_target.h which are supported on
+ * devices with compute capability 7.0 and higher (i.e. Volta and later GPU
+ * architectures).
+ *
+ * @{
+ */
+
+/**
+ * \brief ID for a metric.
+ *
+ * A metric provides a measure of some aspect of the device.
+ */
+typedef uint32_t CUpti_MetricID;
+
+/**
+ * \brief A metric category.
+ *
+ * Each metric is assigned to a category that represents the general
+ * type of the metric. A metric's category is accessed using \ref
+ * cuptiMetricGetAttribute and the CUPTI_METRIC_ATTR_CATEGORY
+ * attribute.
+ */
+typedef enum {
+ /**
+ * A memory related metric.
+ */
+ CUPTI_METRIC_CATEGORY_MEMORY = 0,
+ /**
+ * An instruction related metric.
+ */
+ CUPTI_METRIC_CATEGORY_INSTRUCTION = 1,
+ /**
+ * A multiprocessor related metric.
+ */
+ CUPTI_METRIC_CATEGORY_MULTIPROCESSOR = 2,
+ /**
+ * A cache related metric.
+ */
+ CUPTI_METRIC_CATEGORY_CACHE = 3,
+ /**
+ * A texture related metric.
+ */
+ CUPTI_METRIC_CATEGORY_TEXTURE = 4,
+ /**
+ *A Nvlink related metric.
+ */
+ CUPTI_METRIC_CATEGORY_NVLINK = 5,
+ /**
+ *A PCIe related metric.
+ */
+ CUPTI_METRIC_CATEGORY_PCIE = 6,
+ CUPTI_METRIC_CATEGORY_FORCE_INT = 0x7fffffff,
+} CUpti_MetricCategory;
+
+/**
+ * \brief A metric evaluation mode.
+ *
+ * A metric can be evaluated per hardware instance to know the load balancing
+ * across instances of a domain or the metric can be evaluated in aggregate mode
+ * when the events involved in metric evaluation are from different event
+ * domains. It might be possible to evaluate some metrics in both
+ * modes for convenience. A metric's evaluation mode is accessed using \ref
+ * CUpti_MetricEvaluationMode and the CUPTI_METRIC_ATTR_EVALUATION_MODE
+ * attribute.
+ */
+typedef enum {
+ /**
+ * If this bit is set, the metric can be profiled for each instance of the
+ * domain. The event values passed to \ref cuptiMetricGetValue can contain
+ * values for one instance of the domain. And \ref cuptiMetricGetValue can
+ * be called for each instance.
+ */
+ CUPTI_METRIC_EVALUATION_MODE_PER_INSTANCE = 1,
+ /**
+ * If this bit is set, the metric can be profiled over all instances. The
+ * event values passed to \ref cuptiMetricGetValue can be aggregated values
+ * of events for all instances of the domain.
+ */
+ CUPTI_METRIC_EVALUATION_MODE_AGGREGATE = 1 << 1,
+ CUPTI_METRIC_EVALUATION_MODE_FORCE_INT = 0x7fffffff,
+} CUpti_MetricEvaluationMode;
+
+/**
+ * \brief Kinds of metric values.
+ *
+ * Metric values can be one of several different kinds. Corresponding
+ * to each kind is a member of the CUpti_MetricValue union. The metric
+ * value returned by \ref cuptiMetricGetValue should be accessed using
+ * the appropriate member of that union based on its value kind.
+ */
+typedef enum {
+ /**
+ * The metric value is a 64-bit double.
+ */
+ CUPTI_METRIC_VALUE_KIND_DOUBLE = 0,
+ /**
+ * The metric value is a 64-bit unsigned integer.
+ */
+ CUPTI_METRIC_VALUE_KIND_UINT64 = 1,
+ /**
+ * The metric value is a percentage represented by a 64-bit
+ * double. For example, 57.5% is represented by the value 57.5.
+ */
+ CUPTI_METRIC_VALUE_KIND_PERCENT = 2,
+ /**
+ * The metric value is a throughput represented by a 64-bit
+ * integer. The unit for throughput values is bytes/second.
+ */
+ CUPTI_METRIC_VALUE_KIND_THROUGHPUT = 3,
+ /**
+ * The metric value is a 64-bit signed integer.
+ */
+ CUPTI_METRIC_VALUE_KIND_INT64 = 4,
+ /**
+ * The metric value is a utilization level, as represented by
+ * CUpti_MetricValueUtilizationLevel.
+ */
+ CUPTI_METRIC_VALUE_KIND_UTILIZATION_LEVEL = 5,
+
+ CUPTI_METRIC_VALUE_KIND_FORCE_INT = 0x7fffffff
+} CUpti_MetricValueKind;
+
+/**
+ * \brief Enumeration of utilization levels for metrics values of kind
+ * CUPTI_METRIC_VALUE_KIND_UTILIZATION_LEVEL. Utilization values can
+ * vary from IDLE (0) to MAX (10) but the enumeration only provides
+ * specific names for a few values.
+ */
+typedef enum {
+ CUPTI_METRIC_VALUE_UTILIZATION_IDLE = 0,
+ CUPTI_METRIC_VALUE_UTILIZATION_LOW = 2,
+ CUPTI_METRIC_VALUE_UTILIZATION_MID = 5,
+ CUPTI_METRIC_VALUE_UTILIZATION_HIGH = 8,
+ CUPTI_METRIC_VALUE_UTILIZATION_MAX = 10,
+ CUPTI_METRIC_VALUE_UTILIZATION_FORCE_INT = 0x7fffffff
+} CUpti_MetricValueUtilizationLevel;
+
+/**
+ * \brief Metric attributes.
+ *
+ * Metric attributes describe properties of a metric. These attributes
+ * can be read using \ref cuptiMetricGetAttribute.
+ */
+typedef enum {
+ /**
+ * Metric name. Value is a null terminated const c-string.
+ */
+ CUPTI_METRIC_ATTR_NAME = 0,
+ /**
+ * Short description of metric. Value is a null terminated const c-string.
+ */
+ CUPTI_METRIC_ATTR_SHORT_DESCRIPTION = 1,
+ /**
+ * Long description of metric. Value is a null terminated const c-string.
+ */
+ CUPTI_METRIC_ATTR_LONG_DESCRIPTION = 2,
+ /**
+ * Category of the metric. Value is of type CUpti_MetricCategory.
+ */
+ CUPTI_METRIC_ATTR_CATEGORY = 3,
+ /**
+ * Value type of the metric. Value is of type CUpti_MetricValueKind.
+ */
+ CUPTI_METRIC_ATTR_VALUE_KIND = 4,
+ /**
+ * Metric evaluation mode. Value is of type CUpti_MetricEvaluationMode.
+ */
+ CUPTI_METRIC_ATTR_EVALUATION_MODE = 5,
+ CUPTI_METRIC_ATTR_FORCE_INT = 0x7fffffff,
+} CUpti_MetricAttribute;
+
+/**
+ * \brief A metric value.
+ *
+ * Metric values can be one of several different kinds. Corresponding
+ * to each kind is a member of the CUpti_MetricValue union. The metric
+ * value returned by \ref cuptiMetricGetValue should be accessed using
+ * the appropriate member of that union based on its value kind.
+ */
+typedef union {
+ /*
+ * Value for CUPTI_METRIC_VALUE_KIND_DOUBLE.
+ */
+ double metricValueDouble;
+ /*
+ * Value for CUPTI_METRIC_VALUE_KIND_UINT64.
+ */
+ uint64_t metricValueUint64;
+ /*
+ * Value for CUPTI_METRIC_VALUE_KIND_INT64.
+ */
+ int64_t metricValueInt64;
+ /*
+ * Value for CUPTI_METRIC_VALUE_KIND_PERCENT. For example, 57.5% is
+ * represented by the value 57.5.
+ */
+ double metricValuePercent;
+ /*
+ * Value for CUPTI_METRIC_VALUE_KIND_THROUGHPUT. The unit for
+ * throughput values is bytes/second.
+ */
+ uint64_t metricValueThroughput;
+ /*
+ * Value for CUPTI_METRIC_VALUE_KIND_UTILIZATION_LEVEL.
+ */
+ CUpti_MetricValueUtilizationLevel metricValueUtilizationLevel;
+} CUpti_MetricValue;
+
+/**
+ * \brief Device class.
+ *
+ * Enumeration of device classes for metric property
+ * CUPTI_METRIC_PROPERTY_DEVICE_CLASS.
+ */
+typedef enum {
+ CUPTI_METRIC_PROPERTY_DEVICE_CLASS_TESLA = 0,
+ CUPTI_METRIC_PROPERTY_DEVICE_CLASS_QUADRO = 1,
+ CUPTI_METRIC_PROPERTY_DEVICE_CLASS_GEFORCE = 2,
+ CUPTI_METRIC_PROPERTY_DEVICE_CLASS_TEGRA = 3,
+} CUpti_MetricPropertyDeviceClass;
+
+/**
+ * \brief Metric device properties.
+ *
+ * Metric device properties describe device properties which are needed for a metric.
+ * Some of these properties can be collected using cuDeviceGetAttribute.
+ */
+typedef enum {
+ /*
+ * Number of multiprocessors on a device. This can be collected
+ * using value of \param CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT of
+ * cuDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_MULTIPROCESSOR_COUNT,
+ /*
+ * Maximum number of warps on a multiprocessor. This can be
+ * collected using ratio of value of \param
+ * CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR and \param
+ * CU_DEVICE_ATTRIBUTE_WARP_SIZE of cuDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_WARPS_PER_MULTIPROCESSOR,
+ /*
+ * GPU Time for kernel in ns. This should be profiled using CUPTI
+ * Activity API.
+ */
+ CUPTI_METRIC_PROPERTY_KERNEL_GPU_TIME,
+ /*
+ * Clock rate for device in KHz. This should be collected using
+ * value of \param CU_DEVICE_ATTRIBUTE_CLOCK_RATE of
+ * cuDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_CLOCK_RATE,
+ /*
+ * Number of Frame buffer units for device. This should be collected
+ * using value of \param CUPTI_DEVICE_ATTRIBUTE_MAX_FRAME_BUFFERS of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_FRAME_BUFFER_COUNT,
+ /*
+ * Global memory bandwidth in KBytes/sec. This should be collected
+ * using value of \param CUPTI_DEVICE_ATTR_GLOBAL_MEMORY_BANDWIDTH
+ * of cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_GLOBAL_MEMORY_BANDWIDTH,
+ /*
+ * PCIE link rate in Mega bits/sec. This should be collected using
+ * value of \param CUPTI_DEVICE_ATTR_PCIE_LINK_RATE of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_PCIE_LINK_RATE,
+ /*
+ * PCIE link width for device. This should be collected using
+ * value of \param CUPTI_DEVICE_ATTR_PCIE_LINK_WIDTH of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_PCIE_LINK_WIDTH,
+ /*
+ * PCIE generation for device. This should be collected using
+ * value of \param CUPTI_DEVICE_ATTR_PCIE_GEN of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_PCIE_GEN,
+ /*
+ * The device class. This should be collected using
+ * value of \param CUPTI_DEVICE_ATTR_DEVICE_CLASS of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_DEVICE_CLASS,
+ /*
+ * Peak single precision floating point operations that
+ * can be performed in one cycle by the device.
+ * This should be collected using value of
+ * \param CUPTI_DEVICE_ATTR_FLOP_SP_PER_CYCLE of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_FLOP_SP_PER_CYCLE,
+ /*
+ * Peak double precision floating point operations that
+ * can be performed in one cycle by the device.
+ * This should be collected using value of
+ * \param CUPTI_DEVICE_ATTR_FLOP_DP_PER_CYCLE of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_FLOP_DP_PER_CYCLE,
+ /*
+ * Number of L2 units on a device. This can be collected
+ * using value of \param CUPTI_DEVICE_ATTR_MAX_L2_UNITS of
+ * cuDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_L2_UNITS,
+ /*
+ * Whether ECC support is enabled on the device. This can be
+ * collected using value of \param CU_DEVICE_ATTRIBUTE_ECC_ENABLED of
+ * cuDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_ECC_ENABLED,
+ /*
+ * Peak half precision floating point operations that
+ * can be performed in one cycle by the device.
+ * This should be collected using value of
+ * \param CUPTI_DEVICE_ATTR_FLOP_HP_PER_CYCLE of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_FLOP_HP_PER_CYCLE,
+ /*
+ * NVLINK Bandwitdh for device. This should be collected
+ * using value of \param CUPTI_DEVICE_ATTR_GPU_CPU_NVLINK_BW of
+ * cuptiDeviceGetAttribute.
+ */
+ CUPTI_METRIC_PROPERTY_GPU_CPU_NVLINK_BANDWIDTH,
+} CUpti_MetricPropertyID;
+
+/**
+ * \brief Get the total number of metrics available on any device.
+ *
+ * Returns the total number of metrics available on any CUDA-capable
+ * devices.
+ *
+ * \param numMetrics Returns the number of metrics
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p numMetrics is NULL
+*/
+CUptiResult CUPTIAPI cuptiGetNumMetrics(uint32_t *numMetrics);
+
+/**
+ * \brief Get all the metrics available on any device.
+ *
+ * Returns the metric IDs in \p metricArray for all CUDA-capable
+ * devices. The size of the \p metricArray buffer is given by \p
+ * *arraySizeBytes. The size of the \p metricArray buffer must be at
+ * least \p numMetrics * sizeof(CUpti_MetricID) or all metric IDs will
+ * not be returned. The value returned in \p *arraySizeBytes contains
+ * the number of bytes returned in \p metricArray.
+ *
+ * \param arraySizeBytes The size of \p metricArray in bytes, and
+ * returns the number of bytes written to \p metricArray
+ * \param metricArray Returns the IDs of the metrics
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p arraySizeBytes or
+ * \p metricArray are NULL
+*/
+CUptiResult CUPTIAPI cuptiEnumMetrics(size_t *arraySizeBytes,
+ CUpti_MetricID *metricArray);
+
+/**
+ * \brief Get the number of metrics for a device.
+ *
+ * Returns the number of metrics available for a device.
+ *
+ * \param device The CUDA device
+ * \param numMetrics Returns the number of metrics available for the
+ * device
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p numMetrics is NULL
+ */
+CUptiResult CUPTIAPI cuptiDeviceGetNumMetrics(CUdevice device,
+ uint32_t *numMetrics);
+
+/**
+ * \brief Get the metrics for a device.
+ *
+ * Returns the metric IDs in \p metricArray for a device. The size of
+ * the \p metricArray buffer is given by \p *arraySizeBytes. The size
+ * of the \p metricArray buffer must be at least \p numMetrics *
+ * sizeof(CUpti_MetricID) or else all metric IDs will not be
+ * returned. The value returned in \p *arraySizeBytes contains the
+ * number of bytes returned in \p metricArray.
+ *
+ * \param device The CUDA device
+ * \param arraySizeBytes The size of \p metricArray in bytes, and
+ * returns the number of bytes written to \p metricArray
+ * \param metricArray Returns the IDs of the metrics for the device
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p arraySizeBytes or
+ * \p metricArray are NULL
+ */
+CUptiResult CUPTIAPI cuptiDeviceEnumMetrics(CUdevice device,
+ size_t *arraySizeBytes,
+ CUpti_MetricID *metricArray);
+
+/**
+ * \brief Get a metric attribute.
+ *
+ * Returns a metric attribute in \p *value. The size of the \p
+ * value buffer is given by \p *valueSize. The value returned in \p
+ * *valueSize contains the number of bytes returned in \p value.
+ *
+ * If the attribute value is a c-string that is longer than \p
+ * *valueSize, then only the first \p *valueSize characters will be
+ * returned and there will be no terminating null byte.
+ *
+ * \param metric ID of the metric
+ * \param attrib The metric attribute to read
+ * \param valueSize The size of the \p value buffer in bytes, and
+ * returns the number of bytes written to \p value
+ * \param value Returns the attribute's value
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p valueSize or \p value
+ * is NULL, or if \p attrib is not a metric attribute
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT For non-c-string
+ * attribute values, indicates that the \p value buffer is too small
+ * to hold the attribute value.
+ */
+CUptiResult CUPTIAPI cuptiMetricGetAttribute(CUpti_MetricID metric,
+ CUpti_MetricAttribute attrib,
+ size_t *valueSize,
+ void *value);
+
+/**
+ * \brief Find an metric by name.
+ *
+ * Find a metric by name and return the metric ID in \p *metric.
+ *
+ * \param device The CUDA device
+ * \param metricName The name of metric to find
+ * \param metric Returns the ID of the found metric or undefined if
+ * unable to find the metric
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_DEVICE
+ * \retval CUPTI_ERROR_INVALID_METRIC_NAME if unable to find a metric
+ * with name \p metricName. In this case \p *metric is undefined
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p metricName or \p
+ * metric are NULL.
+ */
+CUptiResult CUPTIAPI cuptiMetricGetIdFromName(CUdevice device,
+ const char *metricName,
+ CUpti_MetricID *metric);
+
+/**
+ * \brief Get number of events required to calculate a metric.
+ *
+ * Returns the number of events in \p numEvents that are required to
+ * calculate a metric.
+ *
+ * \param metric ID of the metric
+ * \param numEvents Returns the number of events required for the metric
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p numEvents is NULL
+ */
+CUptiResult CUPTIAPI cuptiMetricGetNumEvents(CUpti_MetricID metric,
+ uint32_t *numEvents);
+
+/**
+ * \brief Get the events required to calculating a metric.
+ *
+ * Gets the event IDs in \p eventIdArray required to calculate a \p
+ * metric. The size of the \p eventIdArray buffer is given by \p
+ * *eventIdArraySizeBytes and must be at least \p numEvents *
+ * sizeof(CUpti_EventID) or all events will not be returned. The value
+ * returned in \p *eventIdArraySizeBytes contains the number of bytes
+ * returned in \p eventIdArray.
+ *
+ * \param metric ID of the metric
+ * \param eventIdArraySizeBytes The size of \p eventIdArray in bytes,
+ * and returns the number of bytes written to \p eventIdArray
+ * \param eventIdArray Returns the IDs of the events required to
+ * calculate \p metric
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p eventIdArraySizeBytes or \p
+ * eventIdArray are NULL.
+ */
+CUptiResult CUPTIAPI cuptiMetricEnumEvents(CUpti_MetricID metric,
+ size_t *eventIdArraySizeBytes,
+ CUpti_EventID *eventIdArray);
+
+/**
+ * \brief Get number of properties required to calculate a metric.
+ *
+ * Returns the number of properties in \p numProp that are required to
+ * calculate a metric.
+ *
+ * \param metric ID of the metric
+ * \param numProp Returns the number of properties required for the
+ * metric
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p numProp is NULL
+ */
+CUptiResult CUPTIAPI cuptiMetricGetNumProperties(CUpti_MetricID metric,
+ uint32_t *numProp);
+
+/**
+ * \brief Get the properties required to calculating a metric.
+ *
+ * Gets the property IDs in \p propIdArray required to calculate a \p
+ * metric. The size of the \p propIdArray buffer is given by \p
+ * *propIdArraySizeBytes and must be at least \p numProp *
+ * sizeof(CUpti_DeviceAttribute) or all properties will not be
+ * returned. The value returned in \p *propIdArraySizeBytes contains
+ * the number of bytes returned in \p propIdArray.
+ *
+ * \param metric ID of the metric
+ * \param propIdArraySizeBytes The size of \p propIdArray in bytes,
+ * and returns the number of bytes written to \p propIdArray
+ * \param propIdArray Returns the IDs of the properties required to
+ * calculate \p metric
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p propIdArraySizeBytes or \p
+ * propIdArray are NULL.
+ */
+CUptiResult CUPTIAPI cuptiMetricEnumProperties(CUpti_MetricID metric,
+ size_t *propIdArraySizeBytes,
+ CUpti_MetricPropertyID *propIdArray);
+
+
+/**
+ * \brief For a metric get the groups of events that must be collected
+ * in the same pass.
+ *
+ * For a metric get the groups of events that must be collected in the
+ * same pass to ensure that the metric is calculated correctly. If the
+ * events are not collected as specified then the metric value may be
+ * inaccurate.
+ *
+ * The function returns NULL if a metric does not have any required
+ * event group. In this case the events needed for the metric can be
+ * grouped in any manner for collection.
+ *
+ * \param context The context for event collection
+ * \param metric The metric ID
+ * \param eventGroupSets Returns a CUpti_EventGroupSets object that
+ * indicates the events that must be collected in the same pass to
+ * ensure the metric is calculated correctly. Returns NULL if no
+ * grouping is required for metric
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ */
+CUptiResult CUPTIAPI cuptiMetricGetRequiredEventGroupSets(CUcontext context,
+ CUpti_MetricID metric,
+ CUpti_EventGroupSets **eventGroupSets);
+
+/**
+ * \brief For a set of metrics, get the grouping that indicates the
+ * number of passes and the event groups necessary to collect the
+ * events required for those metrics.
+ *
+ * For a set of metrics, get the grouping that indicates the number of
+ * passes and the event groups necessary to collect the events
+ * required for those metrics.
+ *
+ * \see cuptiEventGroupSetsCreate for details on event group set
+ * creation.
+ *
+ * \param context The context for event collection
+ * \param metricIdArraySizeBytes Size of the metricIdArray in bytes
+ * \param metricIdArray Array of metric IDs
+ * \param eventGroupPasses Returns a CUpti_EventGroupSets object that
+ * indicates the number of passes required to collect the events and
+ * the events to collect on each pass
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_CONTEXT
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p metricIdArray or
+ * \p eventGroupPasses is NULL
+ */
+CUptiResult CUPTIAPI cuptiMetricCreateEventGroupSets(CUcontext context,
+ size_t metricIdArraySizeBytes,
+ CUpti_MetricID *metricIdArray,
+ CUpti_EventGroupSets **eventGroupPasses);
+
+/**
+ * \brief Calculate the value for a metric.
+ *
+ * Use the events collected for a metric to calculate the metric
+ * value. Metric value evaluation depends on the evaluation mode
+ * \ref CUpti_MetricEvaluationMode that the metric supports.
+ * If a metric has evaluation mode as CUPTI_METRIC_EVALUATION_MODE_PER_INSTANCE,
+ * then it assumes that the input event value is for one domain instance.
+ * If a metric has evaluation mode as CUPTI_METRIC_EVALUATION_MODE_AGGREGATE,
+ * it assumes that input event values are
+ * normalized to represent all domain instances on a device. For the
+ * most accurate metric collection, the events required for the metric
+ * should be collected for all profiled domain instances. For example,
+ * to collect all instances of an event, set the
+ * CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES attribute on
+ * the group containing the event to 1. The normalized value for the
+ * event is then: (\p sum_event_values * \p totalInstanceCount) / \p
+ * instanceCount, where \p sum_event_values is the summation of the
+ * event values across all profiled domain instances, \p
+ * totalInstanceCount is obtained from querying
+ * CUPTI_EVENT_DOMAIN_ATTR_TOTAL_INSTANCE_COUNT and \p instanceCount
+ * is obtained from querying CUPTI_EVENT_GROUP_ATTR_INSTANCE_COUNT (or
+ * CUPTI_EVENT_DOMAIN_ATTR_INSTANCE_COUNT).
+ *
+ * \param device The CUDA device that the metric is being calculated for
+ * \param metric The metric ID
+ * \param eventIdArraySizeBytes The size of \p eventIdArray in bytes
+ * \param eventIdArray The event IDs required to calculate \p metric
+ * \param eventValueArraySizeBytes The size of \p eventValueArray in bytes
+ * \param eventValueArray The normalized event values required to
+ * calculate \p metric. The values must be order to match the order of
+ * events in \p eventIdArray
+ * \param timeDuration The duration over which the events were
+ * collected, in ns
+ * \param metricValue Returns the value for the metric
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ * \retval CUPTI_ERROR_INVALID_OPERATION
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT if the
+ * eventIdArray does not contain all the events needed for metric
+ * \retval CUPTI_ERROR_INVALID_EVENT_VALUE if any of the
+ * event values required for the metric is CUPTI_EVENT_OVERFLOW
+ * \retval CUPTI_ERROR_INVALID_METRIC_VALUE if the computed metric value
+ * cannot be represented in the metric's value type. For example,
+ * if the metric value type is unsigned and the computed metric value is negative
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p metricValue,
+ * \p eventIdArray or \p eventValueArray is NULL
+ */
+CUptiResult CUPTIAPI cuptiMetricGetValue(CUdevice device,
+ CUpti_MetricID metric,
+ size_t eventIdArraySizeBytes,
+ CUpti_EventID *eventIdArray,
+ size_t eventValueArraySizeBytes,
+ uint64_t *eventValueArray,
+ uint64_t timeDuration,
+ CUpti_MetricValue *metricValue);
+
+/**
+ * \brief Calculate the value for a metric.
+ *
+ * Use the events and properties collected for a metric to calculate
+ * the metric value. Metric value evaluation depends on the evaluation
+ * mode \ref CUpti_MetricEvaluationMode that the metric supports. If
+ * a metric has evaluation mode as
+ * CUPTI_METRIC_EVALUATION_MODE_PER_INSTANCE, then it assumes that the
+ * input event value is for one domain instance. If a metric has
+ * evaluation mode as CUPTI_METRIC_EVALUATION_MODE_AGGREGATE, it
+ * assumes that input event values are normalized to represent all
+ * domain instances on a device. For the most accurate metric
+ * collection, the events required for the metric should be collected
+ * for all profiled domain instances. For example, to collect all
+ * instances of an event, set the
+ * CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES attribute on
+ * the group containing the event to 1. The normalized value for the
+ * event is then: (\p sum_event_values * \p totalInstanceCount) / \p
+ * instanceCount, where \p sum_event_values is the summation of the
+ * event values across all profiled domain instances, \p
+ * totalInstanceCount is obtained from querying
+ * CUPTI_EVENT_DOMAIN_ATTR_TOTAL_INSTANCE_COUNT and \p instanceCount
+ * is obtained from querying CUPTI_EVENT_GROUP_ATTR_INSTANCE_COUNT (or
+ * CUPTI_EVENT_DOMAIN_ATTR_INSTANCE_COUNT).
+ *
+ * \param metric The metric ID
+ * \param eventIdArraySizeBytes The size of \p eventIdArray in bytes
+ * \param eventIdArray The event IDs required to calculate \p metric
+ * \param eventValueArraySizeBytes The size of \p eventValueArray in bytes
+ * \param eventValueArray The normalized event values required to
+ * calculate \p metric. The values must be order to match the order of
+ * events in \p eventIdArray
+ * \param propIdArraySizeBytes The size of \p propIdArray in bytes
+ * \param propIdArray The metric property IDs required to calculate \p metric
+ * \param propValueArraySizeBytes The size of \p propValueArray in bytes
+ * \param propValueArray The metric property values required to
+ * calculate \p metric. The values must be order to match the order of
+ * metric properties in \p propIdArray
+ * \param metricValue Returns the value for the metric
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_NOT_INITIALIZED
+ * \retval CUPTI_ERROR_INVALID_METRIC_ID
+ * \retval CUPTI_ERROR_INVALID_OPERATION
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT if the
+ * eventIdArray does not contain all the events needed for metric
+ * \retval CUPTI_ERROR_INVALID_EVENT_VALUE if any of the
+ * event values required for the metric is CUPTI_EVENT_OVERFLOW
+ * \retval CUPTI_ERROR_NOT_COMPATIBLE if the computed metric value
+ * cannot be represented in the metric's value type. For example,
+ * if the metric value type is unsigned and the computed metric value is negative
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p metricValue,
+ * \p eventIdArray or \p eventValueArray is NULL
+ */
+CUptiResult CUPTIAPI cuptiMetricGetValue2(CUpti_MetricID metric,
+ size_t eventIdArraySizeBytes,
+ CUpti_EventID *eventIdArray,
+ size_t eventValueArraySizeBytes,
+ uint64_t *eventValueArray,
+ size_t propIdArraySizeBytes,
+ CUpti_MetricPropertyID *propIdArray,
+ size_t propValueArraySizeBytes,
+ uint64_t *propValueArray,
+ CUpti_MetricValue *metricValue);
+
+/** @} */ /* END CUPTI_METRIC_API */
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /*_CUPTI_METRIC_H_*/
+
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_nvtx_cbid.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_nvtx_cbid.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ad8c85e6e674b9a016580be88d3c5a2d2619990
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_nvtx_cbid.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2013-2017 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility push(default)
+#endif
+
+typedef enum {
+ CUPTI_CBID_NVTX_INVALID = 0,
+ CUPTI_CBID_NVTX_nvtxMarkA = 1,
+ CUPTI_CBID_NVTX_nvtxMarkW = 2,
+ CUPTI_CBID_NVTX_nvtxMarkEx = 3,
+ CUPTI_CBID_NVTX_nvtxRangeStartA = 4,
+ CUPTI_CBID_NVTX_nvtxRangeStartW = 5,
+ CUPTI_CBID_NVTX_nvtxRangeStartEx = 6,
+ CUPTI_CBID_NVTX_nvtxRangeEnd = 7,
+ CUPTI_CBID_NVTX_nvtxRangePushA = 8,
+ CUPTI_CBID_NVTX_nvtxRangePushW = 9,
+ CUPTI_CBID_NVTX_nvtxRangePushEx = 10,
+ CUPTI_CBID_NVTX_nvtxRangePop = 11,
+ CUPTI_CBID_NVTX_nvtxNameCategoryA = 12,
+ CUPTI_CBID_NVTX_nvtxNameCategoryW = 13,
+ CUPTI_CBID_NVTX_nvtxNameOsThreadA = 14,
+ CUPTI_CBID_NVTX_nvtxNameOsThreadW = 15,
+ CUPTI_CBID_NVTX_nvtxNameCuDeviceA = 16,
+ CUPTI_CBID_NVTX_nvtxNameCuDeviceW = 17,
+ CUPTI_CBID_NVTX_nvtxNameCuContextA = 18,
+ CUPTI_CBID_NVTX_nvtxNameCuContextW = 19,
+ CUPTI_CBID_NVTX_nvtxNameCuStreamA = 20,
+ CUPTI_CBID_NVTX_nvtxNameCuStreamW = 21,
+ CUPTI_CBID_NVTX_nvtxNameCuEventA = 22,
+ CUPTI_CBID_NVTX_nvtxNameCuEventW = 23,
+ CUPTI_CBID_NVTX_nvtxNameCudaDeviceA = 24,
+ CUPTI_CBID_NVTX_nvtxNameCudaDeviceW = 25,
+ CUPTI_CBID_NVTX_nvtxNameCudaStreamA = 26,
+ CUPTI_CBID_NVTX_nvtxNameCudaStreamW = 27,
+ CUPTI_CBID_NVTX_nvtxNameCudaEventA = 28,
+ CUPTI_CBID_NVTX_nvtxNameCudaEventW = 29,
+ CUPTI_CBID_NVTX_nvtxDomainMarkEx = 30,
+ CUPTI_CBID_NVTX_nvtxDomainRangeStartEx = 31,
+ CUPTI_CBID_NVTX_nvtxDomainRangeEnd = 32,
+ CUPTI_CBID_NVTX_nvtxDomainRangePushEx = 33,
+ CUPTI_CBID_NVTX_nvtxDomainRangePop = 34,
+ CUPTI_CBID_NVTX_nvtxDomainResourceCreate = 35,
+ CUPTI_CBID_NVTX_nvtxDomainResourceDestroy = 36,
+ CUPTI_CBID_NVTX_nvtxDomainNameCategoryA = 37,
+ CUPTI_CBID_NVTX_nvtxDomainNameCategoryW = 38,
+ CUPTI_CBID_NVTX_nvtxDomainRegisterStringA = 39,
+ CUPTI_CBID_NVTX_nvtxDomainRegisterStringW = 40,
+ CUPTI_CBID_NVTX_nvtxDomainCreateA = 41,
+ CUPTI_CBID_NVTX_nvtxDomainCreateW = 42,
+ CUPTI_CBID_NVTX_nvtxDomainDestroy = 43,
+ CUPTI_CBID_NVTX_nvtxDomainSyncUserCreate = 44,
+ CUPTI_CBID_NVTX_nvtxDomainSyncUserDestroy = 45,
+ CUPTI_CBID_NVTX_nvtxDomainSyncUserAcquireStart = 46,
+ CUPTI_CBID_NVTX_nvtxDomainSyncUserAcquireFailed = 47,
+ CUPTI_CBID_NVTX_nvtxDomainSyncUserAcquireSuccess = 48,
+ CUPTI_CBID_NVTX_nvtxDomainSyncUserReleasing = 49,
+ CUPTI_CBID_NVTX_SIZE,
+ CUPTI_CBID_NVTX_FORCE_INT = 0x7fffffff
+} CUpti_nvtx_api_trace_cbid;
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility pop
+#endif
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_pcsampling.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_pcsampling.h
new file mode 100644
index 0000000000000000000000000000000000000000..97f42d14b938204b3b79c4ca1356b88896bcae35
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_pcsampling.h
@@ -0,0 +1,936 @@
+/*
+ * Copyright 2020-2022 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+#if !defined(_CUPTI_PCSAMPLING_H_)
+#define _CUPTI_PCSAMPLING_H_
+
+#include
+#include
+#include
+#include "cupti_result.h"
+#include "cupti_common.h"
+
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility push(default)
+#endif
+
+/**
+ * \defgroup CUPTI_PCSAMPLING_API CUPTI PC Sampling API
+ * Functions, types, and enums that implement the CUPTI PC Sampling API.
+ * @{
+ */
+
+#ifndef CUPTI_PCSAMPLING_STRUCT_SIZE
+#define CUPTI_PCSAMPLING_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
+#endif
+
+#ifndef CUPTI_STALL_REASON_STRING_SIZE
+#define CUPTI_STALL_REASON_STRING_SIZE 128
+#endif
+
+/**
+ * \brief PC Sampling collection mode
+ */
+typedef enum
+{
+ /**
+ * INVALID Value
+ */
+ CUPTI_PC_SAMPLING_COLLECTION_MODE_INVALID = 0,
+ /**
+ * Continuous mode. Kernels are not serialized in this mode.
+ */
+ CUPTI_PC_SAMPLING_COLLECTION_MODE_CONTINUOUS = 1,
+ /**
+ * Serialized mode. Kernels are serialized in this mode.
+ */
+ CUPTI_PC_SAMPLING_COLLECTION_MODE_KERNEL_SERIALIZED = 2,
+} CUpti_PCSamplingCollectionMode;
+
+/**
+ * \brief PC Sampling stall reasons
+ */
+typedef struct PACKED_ALIGNMENT
+{
+ /**
+ * [r] Collected stall reason index
+ */
+ uint32_t pcSamplingStallReasonIndex;
+ /**
+ * [r] Number of times the PC was sampled with the stallReason.
+ */
+ uint32_t samples;
+} CUpti_PCSamplingStallReason;
+
+/**
+ * \brief PC Sampling data
+ */
+typedef struct PACKED_ALIGNMENT
+{
+ /**
+ * [w] Size of the data structure.
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [r] Unique cubin id
+ */
+ uint64_t cubinCrc;
+ /**
+ * [r] PC offset
+ */
+ uint64_t pcOffset;
+ /**
+ * The function's unique symbol index in the module.
+ */
+ uint32_t functionIndex;
+ /**
+ * Padding
+ */
+ uint32_t pad;
+ /**
+ * [r] The function name. This name string might be shared across all the records
+ * including records from activity APIs representing the same function, and so it should not be
+ * modified or freed until post processing of all the records is done. Once done, it is userās responsibility to
+ * free the memory using free() function.
+ */
+ char* functionName;
+ /**
+ * [r] Collected stall reason count
+ */
+ size_t stallReasonCount;
+ /**
+ * [r] Stall reason id
+ * Total samples
+ */
+ CUpti_PCSamplingStallReason *stallReason;
+ /**
+ * The correlation ID of the kernel to which this result is associated. Only valid for serialized mode of pc sampling collection.
+ * For continous mode of collection the correlationId will be set to 0.
+ */
+ uint32_t correlationId;
+} CUpti_PCSamplingPCData;
+
+/**
+ * \brief PC Sampling output data format
+ */
+typedef enum
+{
+ CUPTI_PC_SAMPLING_OUTPUT_DATA_FORMAT_INVALID = 0,
+ /**
+ * HW buffer data will be parsed during collection of data
+ */
+ CUPTI_PC_SAMPLING_OUTPUT_DATA_FORMAT_PARSED = 1,
+} CUpti_PCSamplingOutputDataFormat;
+
+/**
+ * \brief Collected PC Sampling data
+ *
+ */
+typedef struct PACKED_ALIGNMENT
+{
+ /**
+ * [w] Size of the data structure.
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Number of PCs to be collected
+ */
+ size_t collectNumPcs;
+ /**
+ * [r] Number of samples collected across all PCs.
+ * It includes samples for user modules, samples for non-user kernels and dropped samples.
+ * It includes counts for all non selected stall reasons.
+ * CUPTI does not provide PC records for non-user kernels.
+ * CUPTI does not provide PC records for instructions for which all selected stall reason metrics counts are zero.
+ */
+ uint64_t totalSamples;
+ /**
+ * [r] Number of samples that were dropped by hardware due to backpressure/overflow.
+ */
+ uint64_t droppedSamples;
+ /**
+ * [r] Number of PCs collected
+ */
+ size_t totalNumPcs;
+ /**
+ * [r] Number of PCs available for collection
+ */
+ size_t remainingNumPcs;
+ /**
+ * [r] Unique identifier for each range.
+ * Data collected across multiple ranges in multiple buffers can be identified using range id.
+ */
+ uint64_t rangeId;
+ /**
+ * [r] Profiled PC data
+ * This data struct should have enough memory to collect number of PCs mentioned in \brief collectNumPcs
+ */
+ CUpti_PCSamplingPCData *pPcData;
+ /**
+ * [r] Number of samples collected across all non user kernels PCs.
+ * It includes samples for non-user kernels.
+ * It includes counts for all non selected stall reasons as well.
+ * CUPTI does not provide PC records for non-user kernels.
+ */
+ uint64_t nonUsrKernelsTotalSamples;
+
+ /**
+ * [r] Status of the hardware buffer.
+ * CUPTI returns the error code CUPTI_ERROR_OUT_OF_MEMORY when hardware buffer is full.
+ * When hardware buffer is full, user will get pc data as 0. To mitigate this issue, one or more of the below options can be tried:
+ * 1. Increase the hardware buffer size using the attribute CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_HARDWARE_BUFFER_SIZE
+ * 2. Decrease the thread sleep span using the attribute CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_WORKER_THREAD_PERIODIC_SLEEP_SPAN
+ * 3. Decrease the sampling frequency using the attribute CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_SAMPLING_PERIOD
+ */
+ uint8_t hardwareBufferFull;
+} CUpti_PCSamplingData;
+
+/**
+ * \brief PC Sampling configuration attributes
+ *
+ * PC Sampling configuration attribute types. These attributes can be read
+ * using \ref cuptiPCSamplingGetConfigurationAttribute and can be written
+ * using \ref cuptiPCSamplingSetConfigurationAttribute. Attributes marked
+ * [r] can only be read using \ref cuptiPCSamplingGetConfigurationAttribute
+ * [w] can only be written using \ref cuptiPCSamplingSetConfigurationAttribute
+ * [rw] can be read using \ref cuptiPCSamplingGetConfigurationAttribute and
+ * written using \ref cuptiPCSamplingSetConfigurationAttribute
+ */
+typedef enum
+{
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_INVALID = 0,
+ /**
+ * [rw] Sampling period for PC Sampling.
+ * DEFAULT - CUPTI defined value based on number of SMs
+ * Valid values for the sampling
+ * periods are between 5 to 31 both inclusive. This will set the
+ * sampling period to (2^samplingPeriod) cycles.
+ * For e.g. for sampling period = 5 to 31, cycles = 32, 64, 128,..., 2^31
+ * Value is a uint32_t
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_SAMPLING_PERIOD = 1,
+ /**
+ * [w] Number of stall reasons to collect.
+ * DEFAULT - All stall reasons will be collected
+ * Value is a size_t
+ * [w] Stall reasons to collect
+ * DEFAULT - All stall reasons will be collected
+ * Input value should be a pointer pointing to array of stall reason indexes
+ * containing all the stall reason indexes to collect.
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_STALL_REASON = 2,
+ /**
+ * [rw] Size of SW buffer for raw PC counter data downloaded from HW buffer
+ * DEFAULT - 1 MB, which can accommodate approximately 5500 PCs
+ * with all stall reasons
+ * Approximately it takes 16 Bytes (and some fixed size memory)
+ * to accommodate one PC with one stall reason
+ * For e.g. 1 PC with 1 stall reason = 32 Bytes
+ * 1 PC with 2 stall reason = 48 Bytes
+ * 1 PC with 4 stall reason = 96 Bytes
+ * Value is a size_t
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_SCRATCH_BUFFER_SIZE = 3,
+ /**
+ * [rw] Size of HW buffer in bytes
+ * DEFAULT - 512 MB
+ * If sampling period is too less, HW buffer can overflow
+ * and drop PC data
+ * Value is a size_t
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_HARDWARE_BUFFER_SIZE = 4,
+ /**
+ * [rw] PC Sampling collection mode
+ * DEFAULT - CUPTI_PC_SAMPLING_COLLECTION_MODE_CONTINUOUS
+ * Input value should be of type \ref CUpti_PCSamplingCollectionMode.
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_COLLECTION_MODE = 5,
+ /**
+ * [rw] Control over PC Sampling data collection range
+ * Default - 0
+ * 1 - Allows user to start and stop PC Sampling using APIs -
+ * \ref cuptiPCSamplingStart() - Start PC Sampling
+ * \ref cuptiPCSamplingStop() - Stop PC Sampling
+ * Value is a uint32_t
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_ENABLE_START_STOP_CONTROL = 6,
+ /**
+ * [w] Value for output data format
+ * Default - CUPTI_PC_SAMPLING_OUTPUT_DATA_FORMAT_PARSED
+ * Input value should be of type \ref CUpti_PCSamplingOutputDataFormat.
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_OUTPUT_DATA_FORMAT = 7,
+ /**
+ * [w] Data buffer to hold collected PC Sampling data PARSED_DATA
+ * Default - none.
+ * Buffer type is void * which can point to PARSED_DATA
+ * Refer \ref CUpti_PCSamplingData for buffer format for PARSED_DATA
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_SAMPLING_DATA_BUFFER = 8,
+ /**
+ * [rw] Control sleep time of the worker threads created by CUPTI for various PC sampling operations.
+ * CUPTI creates multiple worker threads to offload certain operations to these threads. This includes decoding of HW data to
+ * the CUPTI PC sampling data and correlating PC data to SASS instructions. CUPTI wakes up these threads periodically.
+ * Default - 100 milliseconds.
+ * Value is a uint32_t
+ */
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_WORKER_THREAD_PERIODIC_SLEEP_SPAN = 9,
+ CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_FORCE_INT = 0x7fffffff,
+} CUpti_PCSamplingConfigurationAttributeType;
+
+/**
+ * \brief PC sampling configuration information structure
+ *
+ * This structure provides \ref CUpti_PCSamplingConfigurationAttributeType which can be configured
+ * or queried for PC sampling configuration
+ */
+typedef struct
+{
+ /**
+ * Refer \ref CUpti_PCSamplingConfigurationAttributeType for all supported attribute types
+ */
+ CUpti_PCSamplingConfigurationAttributeType attributeType;
+ /*
+ * Configure or query status for \p attributeType
+ * CUPTI_SUCCESS for valid \p attributeType and \p attributeData
+ * CUPTI_ERROR_INVALID_OPERATION if \p attributeData is not valid
+ * CUPTI_ERROR_INVALID_PARAMETER if \p attributeType is not valid
+ */
+ CUptiResult attributeStatus;
+ union
+ {
+ /**
+ * Invalid Value
+ */
+ struct
+ {
+ uint64_t data[3];
+ } invalidData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_SAMPLING_PERIOD
+ */
+ struct
+ {
+ uint32_t samplingPeriod;
+ } samplingPeriodData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_STALL_REASON
+ */
+ struct
+ {
+ size_t stallReasonCount;
+ uint32_t *pStallReasonIndex;
+ } stallReasonData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_SCRATCH_BUFFER_SIZE
+ */
+ struct
+ {
+ size_t scratchBufferSize;
+ } scratchBufferSizeData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_HARDWARE_BUFFER_SIZE
+ */
+ struct
+ {
+ size_t hardwareBufferSize;
+ } hardwareBufferSizeData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_COLLECTION_MODE
+ */
+ struct
+ {
+ CUpti_PCSamplingCollectionMode collectionMode;
+ } collectionModeData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_ENABLE_START_STOP_CONTROL
+ */
+ struct
+ {
+ uint32_t enableStartStopControl;
+ } enableStartStopControlData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_OUTPUT_DATA_FORMAT
+ */
+ struct
+ {
+ CUpti_PCSamplingOutputDataFormat outputDataFormat;
+ } outputDataFormatData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_SAMPLING_DATA_BUFFER
+ */
+ struct
+ {
+ void *samplingDataBuffer;
+ } samplingDataBufferData;
+ /**
+ * Refer \ref CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_WORKER_THREAD_PERIODIC_SLEEP_SPAN
+ */
+ struct
+ {
+ uint32_t workerThreadPeriodicSleepSpan;
+ } workerThreadPeriodicSleepSpanData;
+
+ } attributeData;
+} CUpti_PCSamplingConfigurationInfo;
+
+/**
+ * \brief PC sampling configuration structure
+ *
+ * This structure configures PC sampling using \ref cuptiPCSamplingSetConfigurationAttribute
+ * and queries PC sampling default configuration using \ref cuptiPCSamplingGetConfigurationAttribute
+ */
+typedef struct
+{
+ /**
+ * [w] Size of the data structure i.e. CUpti_PCSamplingConfigurationInfoParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Assign to NULL
+ */
+ void* pPriv;
+ /**
+ * [w] CUcontext
+ */
+ CUcontext ctx;
+ /**
+ * [w] Number of attributes to configure using \ref cuptiPCSamplingSetConfigurationAttribute or query
+ * using \ref cuptiPCSamplingGetConfigurationAttribute
+ */
+ size_t numAttributes;
+ /**
+ * Refer \ref CUpti_PCSamplingConfigurationInfo
+ */
+ CUpti_PCSamplingConfigurationInfo *pPCSamplingConfigurationInfo;
+} CUpti_PCSamplingConfigurationInfoParams;
+#define CUpti_PCSamplingConfigurationInfoParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_PCSamplingConfigurationInfoParams,pPCSamplingConfigurationInfo)
+
+/**
+ * \brief Write PC Sampling configuration attribute.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingConfigurationInfoParams
+ * containing PC sampling configuration.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_OPERATION if this API is called with
+ * some invalid \p attrib.
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if attribute \p value is not valid
+ * or any \p pParams is not valid
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingSetConfigurationAttribute(CUpti_PCSamplingConfigurationInfoParams *pParams);
+
+/**
+ * \brief Read PC Sampling configuration attribute.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingConfigurationInfoParams
+ * containing PC sampling configuration.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_OPERATION if this API is called with
+ * some invalid attribute.
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p attrib is not valid
+ * or any \p pParams is not valid
+ * \retval CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT indicates that
+ * the \p value buffer is too small to hold the attribute value
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingGetConfigurationAttribute(CUpti_PCSamplingConfigurationInfoParams *pParams);
+
+/**
+ * \brief Params for cuptiPCSamplingEnable
+ */
+typedef struct
+{
+ /**
+ * [w] Size of the data structure i.e. CUpti_PCSamplingGetDataParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Assign to NULL
+ */
+ void* pPriv;
+ /**
+ * [w] CUcontext
+ */
+ CUcontext ctx;
+ /**
+ * \param pcSamplingData Data buffer to hold collected PC Sampling data PARSED_DATA
+ * Buffer type is void * which can point to PARSED_DATA
+ * Refer \ref CUpti_PCSamplingData for buffer format for PARSED_DATA
+ */
+ void *pcSamplingData;
+} CUpti_PCSamplingGetDataParams;
+#define CUpti_PCSamplingGetDataParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_PCSamplingGetDataParams, pcSamplingData)
+/**
+ * \brief Flush GPU PC sampling data periodically.
+ *
+ * Flushing of GPU PC Sampling data is required at following point to maintain uniqueness of PCs:
+ * For \brief CUPTI_PC_SAMPLING_COLLECTION_MODE_CONTINUOUS, after every module load-unload-load
+ * For \brief CUPTI_PC_SAMPLING_COLLECTION_MODE_KERNEL_SERIALIZED, after every kernel ends
+ * If configuration option \brief CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_ENABLE_START_STOP_CONTROL
+ * is enabled, then after every range end i.e. \brief cuptiPCSamplingStop()
+ *
+ * If application is profiled in \brief CUPTI_PC_SAMPLING_COLLECTION_MODE_CONTINUOUS, with disabled
+ * \brief CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_ENABLE_START_STOP_CONTROL, and there is no module unload,
+ * user can collect data in two ways:
+ * Use \brief cuptiPCSamplingGetData() API periodically
+ * Use \brief cuptiPCSamplingDisable() on application exit and read GPU PC sampling data from sampling
+ * data buffer passed during configuration.
+ * Note: In case, \brief cuptiPCSamplingGetData() API is not called periodically, then sampling data buffer
+ * passed during configuration should be large enough to hold all PCs data.
+ * \brief cuptiPCSamplingGetData() API never does device synchronization.
+ * It is possible that when the API is called there is some unconsumed data from the HW buffer. In this case
+ * CUPTI provides only the data available with it at that moment.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingGetDataParams
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_OPERATION if this API is called without
+ * enabling PC sampling.
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if any \p pParams is not valid
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * \retval CUPTI_ERROR_OUT_OF_MEMORY indicates that the HW buffer is full
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingGetData(CUpti_PCSamplingGetDataParams *pParams);
+
+/**
+ * \brief Params for cuptiPCSamplingEnable
+ */
+typedef struct
+{
+ /**
+ * [w] Size of the data structure i.e. CUpti_PCSamplingEnableParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Assign to NULL
+ */
+ void* pPriv;
+ /**
+ * [w] CUcontext
+ */
+ CUcontext ctx;
+} CUpti_PCSamplingEnableParams;
+#define CUpti_PCSamplingEnableParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_PCSamplingEnableParams, ctx)
+
+/**
+ * \brief Enable PC sampling.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingEnableParams
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if any \p pParams is not valid
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingEnable(CUpti_PCSamplingEnableParams *pParams);
+
+/**
+ * \brief Params for cuptiPCSamplingDisable
+ */
+typedef struct
+{
+ /**
+ * [w] Size of the data structure i.e. CUpti_PCSamplingDisableParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Assign to NULL
+ */
+ void* pPriv;
+ /**
+ * [w] CUcontext
+ */
+ CUcontext ctx;
+} CUpti_PCSamplingDisableParams;
+#define CUpti_PCSamplingDisableParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_PCSamplingDisableParams, ctx)
+
+/**
+ * \brief Disable PC sampling.
+ *
+ * For application which doesn't destroy the CUDA context explicitly,
+ * this API does the PC Sampling tear-down, joins threads and copies PC records in the buffer provided
+ * during the PC sampling configuration. PC records which can't be accommodated in the buffer are discarded.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingDisableParams
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if any \p pParams is not valid
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingDisable(CUpti_PCSamplingDisableParams *pParams);
+
+/**
+ * \brief Params for cuptiPCSamplingStart
+ */
+typedef struct
+{
+ /**
+ * [w] Size of the data structure i.e. CUpti_PCSamplingStartParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Assign to NULL
+ */
+ void* pPriv;
+ /**
+ * [w] CUcontext
+ */
+ CUcontext ctx;
+} CUpti_PCSamplingStartParams;
+#define CUpti_PCSamplingStartParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_PCSamplingStartParams, ctx)
+
+/**
+ * \brief Start PC sampling.
+ *
+ * User can collect PC Sampling data for user-defined range specified by Start/Stop APIs.
+ * This API can be used to mark starting of range. Set configuration option
+ * \brief CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_ENABLE_START_STOP_CONTROL to use this API.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingStartParams
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_OPERATION if this API is called with
+ * incorrect PC Sampling configuration.
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if any \p pParams is not valid
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingStart(CUpti_PCSamplingStartParams *pParams);
+
+/**
+ * \brief Params for cuptiPCSamplingStop
+ */
+typedef struct
+{
+ /**
+ * [w] Size of the data structure i.e. CUpti_PCSamplingStopParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Assign to NULL
+ */
+ void* pPriv;
+ /**
+ * [w] CUcontext
+ */
+ CUcontext ctx;
+} CUpti_PCSamplingStopParams;
+#define CUpti_PCSamplingStopParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_PCSamplingStopParams, ctx)
+
+/**
+ * \brief Stop PC sampling.
+ *
+ * User can collect PC Sampling data for user-defined range specified by Start/Stop APIs.
+ * This API can be used to mark end of range. Set configuration option
+ * \brief CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_ENABLE_START_STOP_CONTROL to use this API.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingStopParams
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_OPERATION if this API is called with
+ * incorrect PC Sampling configuration.
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if any \p pParams is not valid
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingStop(CUpti_PCSamplingStopParams *pParams);
+
+/**
+ * \brief Params for cuptiPCSamplingGetNumStallReasons
+ */
+typedef struct
+{
+ /**
+ * [w] Size of the data structure i.e. CUpti_PCSamplingGetNumStallReasonsParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Assign to NULL
+ */
+ void* pPriv;
+ /**
+ * [w] CUcontext
+ */
+ CUcontext ctx;
+ /**
+ * [r] Number of stall reasons
+ */
+ size_t *numStallReasons;
+} CUpti_PCSamplingGetNumStallReasonsParams;
+#define CUpti_PCSamplingGetNumStallReasonsParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_PCSamplingGetNumStallReasonsParams, numStallReasons)
+
+/**
+ * \brief Get PC sampling stall reason count.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingGetNumStallReasonsParams
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if any \p pParams is not valid
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingGetNumStallReasons(CUpti_PCSamplingGetNumStallReasonsParams *pParams);
+
+/**
+ * \brief Params for cuptiPCSamplingGetStallReasons
+ */
+typedef struct
+{
+ /**
+ * [w] Size of the data structure i.e. CUpti_PCSamplingGetStallReasonsParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Assign to NULL
+ */
+ void* pPriv;
+ /**
+ * [w] CUcontext
+ */
+ CUcontext ctx;
+ /**
+ * [w] Number of stall reasons
+ */
+ size_t numStallReasons;
+ /**
+ * [r] Stall reason index
+ */
+ uint32_t *stallReasonIndex;
+ /**
+ * [r] Stall reasons name
+ */
+ char **stallReasons;
+} CUpti_PCSamplingGetStallReasonsParams;
+#define CUpti_PCSamplingGetStallReasonsParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_PCSamplingGetStallReasonsParams, stallReasons)
+
+/**
+ * \brief Get PC sampling stall reasons.
+ *
+ * \param pParams A pointer to \ref CUpti_PCSamplingGetStallReasonsParams
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if any \p pParams is not valid
+ * \retval CUPTI_ERROR_NOT_SUPPORTED indicates that the system/device
+ * does not support the API
+ */
+CUptiResult CUPTIAPI cuptiPCSamplingGetStallReasons(CUpti_PCSamplingGetStallReasonsParams *pParams);
+
+
+/**
+ * \brief Params for cuptiGetSassToSourceCorrelation
+ */
+typedef struct CUpti_GetSassToSourceCorrelationParams {
+ /**
+ * [w] Size of the data structure i.e. CUpti_GetSassToSourceCorrelationParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Pointer to cubin binary where function belongs.
+ */
+ const void* cubin;
+ /**
+ * [w] Function name to which PC belongs.
+ */
+ const char *functionName;
+ /**
+ * [w] Size of cubin binary.
+ */
+ size_t cubinSize;
+ /**
+ * [r] Line number in the source code.
+ */
+ uint32_t lineNumber;
+ /**
+ * [w] PC offset
+ */
+ uint64_t pcOffset;
+ /**
+ * [r] Path for the source file.
+ */
+ char *fileName;
+ /**
+ * [r] Path for the directory of source file.
+ */
+ char *dirName;
+} CUpti_GetSassToSourceCorrelationParams;
+
+#define CUpti_GetSassToSourceCorrelationParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_GetSassToSourceCorrelationParams, dirName)
+
+/**
+ * \brief SASS to Source correlation.
+ *
+ * \param pParams A pointer to \ref CUpti_GetSassToSourceCorrelationParams
+ *
+ * It is expected from user to free allocated memory for fileName and dirName after use.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if either of the parameters cubin or functionName
+ * is NULL or cubinSize is zero or size field is not set correctly.
+ * \retval CUPTI_ERROR_INVALID_MODULE provided cubin is invalid.
+ * \retval CUPTI_ERROR_UNKNOWN an internal error occurred.
+ * This error code is also used for cases when the function is not present in the module.
+ * A better error code will be returned in the future release.
+ */
+CUptiResult CUPTIAPI cuptiGetSassToSourceCorrelation(CUpti_GetSassToSourceCorrelationParams *pParams);
+
+/**
+ * \brief Params for cuptiGetCubinCrc
+ */
+typedef struct {
+ /**
+ * [w] Size of configuration structure.
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * [w] Size of cubin binary.
+ */
+ size_t cubinSize;
+ /**
+ * [w] Pointer to cubin binary
+ */
+ const void* cubin;
+ /**
+ * [r] Computed CRC will be stored in it.
+ */
+ uint64_t cubinCrc;
+} CUpti_GetCubinCrcParams;
+#define CUpti_GetCubinCrcParamsSize CUPTI_PCSAMPLING_STRUCT_SIZE(CUpti_GetCubinCrcParams, cubinCrc)
+
+/**
+ * \brief Get the CRC of cubin.
+ *
+ * This function returns the CRC of provided cubin binary.
+ *
+ * \param pParams A pointer to \ref CUpti_GetCubinCrcParams
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if parameter cubin is NULL or
+ * provided cubinSize is zero or size field is not set.
+ */
+CUptiResult CUPTIAPI cuptiGetCubinCrc(CUpti_GetCubinCrcParams *pParams);
+
+/**
+ * \brief Function type for callback used by CUPTI to request crc of
+ * loaded module.
+ *
+ * This callback function ask for crc of provided module in function.
+ * The provided crc will be stored in PC sampling records i.e. in the field 'cubinCrc' of the PC sampling
+ * struct CUpti_PCSamplingPCData. The CRC is uses during the offline source correlation to uniquely identify the module.
+ *
+ * \param cubin The pointer to cubin binary
+ * \param cubinSize The size of cubin binary.
+ * \param cubinCrc Returns the computed crc of cubin.
+ */
+typedef void (CUPTIAPI *CUpti_ComputeCrcCallbackFunc)(
+ const void* cubin,
+ size_t cubinSize,
+ uint64_t *cubinCrc);
+
+/**
+ * \brief Register callback function with CUPTI to use
+ * your own algorithm to compute cubin crc.
+ *
+ * This function registers a callback function and it gets called
+ * from CUPTI when a CUDA module is loaded.
+ *
+ * \param funcComputeCubinCrc callback is invoked when a CUDA module
+ * is loaded.
+ *
+ * \retval CUPTI_SUCCESS
+ * \retval CUPTI_ERROR_INVALID_PARAMETER if \p funcComputeCubinCrc is NULL.
+ */
+CUptiResult CUPTIAPI cuptiRegisterComputeCrcCallback(CUpti_ComputeCrcCallbackFunc funcComputeCubinCrc);
+
+/** @} */ /* END CUPTI_PCSAMPLING_API */
+
+#if defined(__GNUC__) && defined(CUPTI_LIB)
+ #pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /*_CUPTI_PCSAMPLING_H_*/
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_pcsampling_util.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_pcsampling_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..595d6028fbf2ff9a3bbffaafe90ec80f7d512533
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/include/cupti_pcsampling_util.h
@@ -0,0 +1,402 @@
+#if !defined(_CUPTI_PCSAMPLING_UTIL_H_)
+#define _CUPTI_PCSAMPLING_UTIL_H_
+
+#include
+#include
+
+#include
+
+#ifndef CUPTI_UTIL_STRUCT_SIZE
+#define CUPTI_UTIL_STRUCT_SIZE(type_, lastfield_) (offsetof(type_, lastfield_) + sizeof(((type_*)0)->lastfield_))
+#endif
+
+#ifndef CHECK_PC_SAMPLING_STRUCT_FIELD_EXISTS
+#define CHECK_PC_SAMPLING_STRUCT_FIELD_EXISTS(type, member, structSize) \
+ (offsetof(type, member) < structSize)
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(__GNUC__)
+ #pragma GCC visibility push(default)
+#endif
+
+namespace CUPTI { namespace PcSamplingUtil {
+
+/**
+ * \defgroup CUPTI_PCSAMPLING_UTILITY CUPTI PC Sampling Utility API
+ * Functions, types, and enums that implement the CUPTI PC Sampling Utility API.
+ * @{
+ */
+
+/**
+ * \brief Header info will be stored in file.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * Version of file format.
+ */
+ uint32_t version;
+ /**
+ * Total number of buffers present in the file.
+ */
+ uint32_t totalBuffers;
+} Header;
+
+/**
+ * \brief BufferInfo will be stored in the file for every buffer
+ * i.e for every call of UtilDumpPcSamplingBufferInFile() API.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * Total number of PC records.
+ */
+ uint64_t recordCount;
+ /**
+ * Count of all stall reasons supported on the GPU
+ */
+ size_t numStallReasons;
+ /**
+ * Total number of stall reasons in single record.
+ */
+ uint64_t numSelectedStallReasons;
+ /**
+ * Buffer size in Bytes.
+ */
+ uint64_t bufferByteSize;
+} BufferInfo;
+
+/**
+ * \brief All available stall reasons name and respective indexes
+ * will be stored in it.
+ */
+typedef struct PACKED_ALIGNMENT {
+ /**
+ * Number of all available stall reasons
+ */
+ size_t numStallReasons;
+ /**
+ * Stall reasons names of all available stall reasons
+ */
+ char **stallReasons;
+ /**
+ * Stall reason index of all available stall reasons
+ */
+ uint32_t *stallReasonIndex;
+} PcSamplingStallReasons;
+
+/**
+ * \brief CUPTI PC sampling buffer types.
+ *
+ */
+typedef enum {
+ /**
+ * Invalid buffer type.
+ */
+ PC_SAMPLING_BUFFER_INVALID = 0,
+ /**
+ * Refers to CUpti_PCSamplingData buffer.
+ */
+ PC_SAMPLING_BUFFER_PC_TO_COUNTER_DATA = 1
+} PcSamplingBufferType;
+
+/**
+ * \brief CUPTI PC sampling utility API result codes.
+ *
+ * Error and result codes returned by CUPTI PC sampling utility API.
+ */
+typedef enum {
+ /**
+ * No error
+ */
+ CUPTI_UTIL_SUCCESS = 0,
+ /**
+ * One or more of the parameters are invalid.
+ */
+ CUPTI_UTIL_ERROR_INVALID_PARAMETER = 1,
+ /**
+ * Unable to create a new file
+ */
+ CUPTI_UTIL_ERROR_UNABLE_TO_CREATE_FILE = 2,
+ /**
+ * Unable to open a file
+ */
+ CUPTI_UTIL_ERROR_UNABLE_TO_OPEN_FILE = 3,
+ /**
+ * Read or write operation failed
+ */
+ CUPTI_UTIL_ERROR_READ_WRITE_OPERATION_FAILED = 4,
+ /**
+ * Provided file handle is corrupted.
+ */
+ CUPTI_UTIL_ERROR_FILE_HANDLE_CORRUPTED = 5,
+ /**
+ * seek operation failed.
+ */
+ CUPTI_UTIL_ERROR_SEEK_OPERATION_FAILED = 6,
+ /**
+ * Unable to allocate enough memory to perform the requested
+ * operation.
+ */
+ CUPTI_UTIL_ERROR_OUT_OF_MEMORY = 7,
+ /**
+ * An unknown internal error has occurred.
+ */
+ CUPTI_UTIL_ERROR_UNKNOWN = 999,
+ CUPTI_UTIL_ERROR_FORCE_INT = 0x7fffffff
+} CUptiUtilResult;
+
+/**
+ * \brief Params for \ref CuptiUtilPutPcSampData
+ */
+typedef struct {
+ /**
+ * Size of the data structure i.e. CUpti_PCSamplingDisableParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * Type of buffer to store in file
+ */
+ PcSamplingBufferType bufferType;
+ /**
+ * PC sampling buffer.
+ */
+ void *pSamplingData;
+ /**
+ * Number of configured attributes
+ */
+ size_t numAttributes;
+ /**
+ * Refer \ref CUpti_PCSamplingConfigurationInfo
+ * It is expected to provide configuration details of at least
+ * CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_STALL_REASON attribute.
+ */
+ CUpti_PCSamplingConfigurationInfo *pPCSamplingConfigurationInfo;
+ /**
+ * Refer \ref PcSamplingStallReasons.
+ */
+ PcSamplingStallReasons *pPcSamplingStallReasons;
+ /**
+ * File name to store buffer into it.
+ */
+ const char* fileName;
+} CUptiUtil_PutPcSampDataParams;
+#define CUptiUtil_PutPcSampDataParamsSize CUPTI_UTIL_STRUCT_SIZE(CUptiUtil_PutPcSampDataParams, fileName)
+
+/**
+ * \brief Dump PC sampling data into the file.
+ *
+ * This API can be called multiple times.
+ * It will append buffer in the file.
+ * For every buffer it will store BufferInfo
+ * so that before retrieving data it will help to allocate buffer
+ * to store retrieved data.
+ * This API creates file if file does not present.
+ * If stallReasonIndex or stallReasons pointer of \ref CUptiUtil_PutPcSampDataParams is NULL
+ * then stall reasons data will not be stored in file.
+ * It is expected to store all available stall reason data at least once to refer it during
+ * offline correlation.
+ *
+ * \retval CUPTI_UTIL_SUCCESS
+ * \retval CUPTI_UTIL_ERROR_INVALID_PARAMETER error out if buffer type is invalid
+ * or if either of pSamplingData, pParams pointer is NULL or stall reason configuration details not provided
+ * or filename is empty.
+ * \retval CUPTI_UTIL_ERROR_UNABLE_TO_CREATE_FILE
+ * \retval CUPTI_UTIL_ERROR_UNABLE_TO_OPEN_FILE
+ * \retval CUPTI_UTIL_ERROR_READ_WRITE_OPERATION_FAILED
+ */
+CUptiUtilResult CUPTIUTILAPI CuptiUtilPutPcSampData(CUptiUtil_PutPcSampDataParams *pParams);
+
+/**
+ * \brief Params for \ref CuptiUtilGetHeaderData
+ */
+typedef struct {
+ /**
+ * Size of the data structure i.e. CUpti_PCSamplingDisableParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * File handle.
+ */
+ std::ifstream *fileHandler;
+ /**
+ * Header Info.
+ */
+ Header headerInfo;
+
+} CUptiUtil_GetHeaderDataParams;
+#define CUptiUtil_GetHeaderDataParamsSize CUPTI_UTIL_STRUCT_SIZE(CUptiUtil_GetHeaderDataParams, headerInfo)
+
+/**
+ * \brief Get header data of file.
+ *
+ * This API must be called once initially while retrieving data from file.
+ * \ref Header structure, it gives info about total number
+ * of buffers present in the file.
+ *
+ * \retval CUPTI_UTIL_SUCCESS
+ * \retval CUPTI_UTIL_ERROR_INVALID_PARAMETER error out if either of pParam or fileHandle is NULL or param struct size is incorrect.
+ * \retval CUPTI_UTIL_ERROR_FILE_HANDLE_CORRUPTED file handle is not in good state to read data from file
+ * \retval CUPTI_UTIL_ERROR_READ_WRITE_OPERATION_FAILED failed to read data from file.
+ */
+CUptiUtilResult CUPTIUTILAPI CuptiUtilGetHeaderData(CUptiUtil_GetHeaderDataParams *pParams);
+
+/**
+ * \brief Params for \ref CuptiUtilGetBufferInfo
+ */
+typedef struct {
+ /**
+ * Size of the data structure i.e. CUpti_PCSamplingDisableParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * File handle.
+ */
+ std::ifstream *fileHandler;
+ /**
+ * Buffer Info.
+ */
+ BufferInfo bufferInfoData;
+} CUptiUtil_GetBufferInfoParams;
+#define CUptiUtil_GetBufferInfoParamsSize CUPTI_UTIL_STRUCT_SIZE(CUptiUtil_GetBufferInfoParams, bufferInfoData)
+
+/**
+ * \brief Get buffer info data of file.
+ *
+ * This API must be called every time before calling CuptiUtilGetPcSampData API.
+ * \ref BufferInfo structure, it gives info about recordCount and stallReasonCount
+ * of every record in the buffer. This will help to allocate exact buffer to retrieve data into it.
+ *
+ * \retval CUPTI_UTIL_SUCCESS
+ * \retval CUPTI_UTIL_ERROR_INVALID_PARAMETER error out if either of pParam or fileHandle is NULL or param struct size is incorrect.
+ * \retval CUPTI_UTIL_ERROR_FILE_HANDLE_CORRUPTED file handle is not in good state to read data from file.
+ * \retval CUPTI_UTIL_ERROR_READ_WRITE_OPERATION_FAILED failed to read data from file.
+ */
+CUptiUtilResult CUPTIUTILAPI CuptiUtilGetBufferInfo(CUptiUtil_GetBufferInfoParams *pParams);
+
+/**
+ * \brief Params for \ref CuptiUtilGetPcSampData
+ */
+typedef struct {
+ /**
+ * Size of the data structure i.e. CUpti_PCSamplingDisableParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * File handle.
+ */
+ std::ifstream *fileHandler;
+ /**
+ * Type of buffer to store in file
+ */
+ PcSamplingBufferType bufferType;
+ /**
+ * Pointer to collected buffer info using \ref CuptiUtilGetBufferInfo
+ */
+ BufferInfo *pBufferInfoData;
+ /**
+ * Pointer to allocated memory to store retrieved data from file.
+ */
+ void *pSamplingData;
+ /**
+ * Number of configuration attributes
+ */
+ size_t numAttributes;
+ /**
+ * Refer \ref CUpti_PCSamplingConfigurationInfo
+ */
+ CUpti_PCSamplingConfigurationInfo *pPCSamplingConfigurationInfo;
+ /**
+ * Refer \ref PcSamplingStallReasons.
+ * For stallReasons field of \ref PcSamplingStallReasons it is expected to
+ * allocate memory for each string element of array.
+ */
+ PcSamplingStallReasons *pPcSamplingStallReasons;
+} CUptiUtil_GetPcSampDataParams;
+#define CUptiUtil_GetPcSampDataParamsSize CUPTI_UTIL_STRUCT_SIZE(CUptiUtil_GetPcSampDataParams, pPcSamplingStallReasons)
+
+/**
+ * \brief Retrieve PC sampling data from file into allocated buffer.
+ *
+ * This API must be called after CuptiUtilGetBufferInfo API.
+ * It will retrieve data from file into allocated buffer.
+ *
+ * \retval CUPTI_UTIL_SUCCESS
+ * \retval CUPTI_UTIL_ERROR_INVALID_PARAMETER error out if buffer type is invalid
+ * or if either of pSampData, pParams is NULL. If pPcSamplingStallReasons is not NULL then
+ * error out if either of stallReasonIndex, stallReasons or stallReasons array element pointer is NULL.
+ * or filename is empty.
+ * \retval CUPTI_UTIL_ERROR_READ_WRITE_OPERATION_FAILED
+ * \retval CUPTI_UTIL_ERROR_FILE_HANDLE_CORRUPTED file handle is not in good state to read data from file.
+ */
+CUptiUtilResult CUPTIUTILAPI CuptiUtilGetPcSampData(CUptiUtil_GetPcSampDataParams *pParams);
+
+/**
+ * \brief Params for \ref CuptiUtilMergePcSampData
+ */
+typedef struct
+{
+ /**
+ * Size of the data structure i.e. CUpti_PCSamplingDisableParamsSize
+ * CUPTI client should set the size of the structure. It will be used in CUPTI to check what fields are
+ * available in the structure. Used to preserve backward compatibility.
+ */
+ size_t size;
+ /**
+ * Number of buffers to merge.
+ */
+ size_t numberOfBuffers;
+ /**
+ * Pointer to array of buffers to merge
+ */
+ CUpti_PCSamplingData *PcSampDataBuffer;
+ /**
+ * Pointer to array of merged buffers as per the range id.
+ */
+ CUpti_PCSamplingData **MergedPcSampDataBuffers;
+ /**
+ * Number of merged buffers.
+ */
+ size_t *numMergedBuffer;
+} CUptiUtil_MergePcSampDataParams;
+#define CUptiUtil_MergePcSampDataParamsSize CUPTI_UTIL_STRUCT_SIZE(CUptiUtil_MergePcSampDataParams, numMergedBuffer)
+
+/**
+ * \brief Merge PC sampling data range id wise.
+ *
+ * This API merge PC sampling data range id wise.
+ * It allocates memory for merged data and fill data in it
+ * and provide buffer pointer in MergedPcSampDataBuffers field.
+ * It is expected from user to free merge data buffers after use.
+ *
+ * \retval CUPTI_UTIL_SUCCESS
+ * \retval CUPTI_UTIL_ERROR_INVALID_PARAMETER error out if param struct size is invalid
+ * or count of buffers to merge is invalid i.e less than 1
+ * or either of PcSampDataBuffer, MergedPcSampDataBuffers, numMergedBuffer is NULL
+ * \retval CUPTI_UTIL_ERROR_OUT_OF_MEMORY Unable to allocate memory for merged buffer.
+ */
+CUptiUtilResult CUPTIUTILAPI CuptiUtilMergePcSampData(CUptiUtil_MergePcSampDataParams *pParams);
+
+/** @} */ /* END CUPTI_PCSAMPLING_UTILITY */
+
+} }
+
+#if defined(__GNUC__)
+ #pragma GCC visibility pop
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/lib/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_cupti/lib/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/nvrtc.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/nvrtc.h
new file mode 100644
index 0000000000000000000000000000000000000000..8aff162e26860e755addd9d2b221c5365cb89f40
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/include/nvrtc.h
@@ -0,0 +1,876 @@
+//
+// NVIDIA_COPYRIGHT_BEGIN
+//
+// Copyright (c) 2014-2024, NVIDIA CORPORATION. All rights reserved.
+//
+// NVIDIA CORPORATION and its licensors retain all intellectual property
+// and proprietary rights in and to this software, related documentation
+// and any modifications thereto. Any use, reproduction, disclosure or
+// distribution of this software and related documentation without an express
+// license agreement from NVIDIA CORPORATION is strictly prohibited.
+//
+// NVIDIA_COPYRIGHT_END
+//
+
+#ifndef __NVRTC_H__
+#define __NVRTC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include
+
+
+/*************************************************************************//**
+ *
+ * \defgroup error Error Handling
+ *
+ * NVRTC defines the following enumeration type and function for API call
+ * error handling.
+ *
+ ****************************************************************************/
+
+
+/**
+ * \ingroup error
+ * \brief The enumerated type nvrtcResult defines API call result codes.
+ * NVRTC API functions return nvrtcResult to indicate the call
+ * result.
+ */
+typedef enum {
+ NVRTC_SUCCESS = 0,
+ NVRTC_ERROR_OUT_OF_MEMORY = 1,
+ NVRTC_ERROR_PROGRAM_CREATION_FAILURE = 2,
+ NVRTC_ERROR_INVALID_INPUT = 3,
+ NVRTC_ERROR_INVALID_PROGRAM = 4,
+ NVRTC_ERROR_INVALID_OPTION = 5,
+ NVRTC_ERROR_COMPILATION = 6,
+ NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7,
+ NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8,
+ NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9,
+ NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10,
+ NVRTC_ERROR_INTERNAL_ERROR = 11,
+ NVRTC_ERROR_TIME_FILE_WRITE_FAILED = 12
+} nvrtcResult;
+
+
+/**
+ * \ingroup error
+ * \brief nvrtcGetErrorString is a helper function that returns a string
+ * describing the given nvrtcResult code, e.g., NVRTC_SUCCESS to
+ * \c "NVRTC_SUCCESS".
+ * For unrecognized enumeration values, it returns
+ * \c "NVRTC_ERROR unknown".
+ *
+ * \param [in] result CUDA Runtime Compilation API result code.
+ * \return Message string for the given #nvrtcResult code.
+ */
+const char *nvrtcGetErrorString(nvrtcResult result);
+
+
+/*************************************************************************//**
+ *
+ * \defgroup query General Information Query
+ *
+ * NVRTC defines the following function for general information query.
+ *
+ ****************************************************************************/
+
+
+/**
+ * \ingroup query
+ * \brief nvrtcVersion sets the output parameters \p major and \p minor
+ * with the CUDA Runtime Compilation version number.
+ *
+ * \param [out] major CUDA Runtime Compilation major version number.
+ * \param [out] minor CUDA Runtime Compilation minor version number.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ *
+ */
+nvrtcResult nvrtcVersion(int *major, int *minor);
+
+
+/**
+ * \ingroup query
+ * \brief nvrtcGetNumSupportedArchs sets the output parameter \p numArchs
+ * with the number of architectures supported by NVRTC. This can
+ * then be used to pass an array to ::nvrtcGetSupportedArchs to
+ * get the supported architectures.
+ *
+ * \param [out] numArchs number of supported architectures.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ *
+ * see ::nvrtcGetSupportedArchs
+ */
+nvrtcResult nvrtcGetNumSupportedArchs(int* numArchs);
+
+
+/**
+ * \ingroup query
+ * \brief nvrtcGetSupportedArchs populates the array passed via the output parameter
+ * \p supportedArchs with the architectures supported by NVRTC. The array is
+ * sorted in the ascending order. The size of the array to be passed can be
+ * determined using ::nvrtcGetNumSupportedArchs.
+ *
+ * \param [out] supportedArchs sorted array of supported architectures.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ *
+ * see ::nvrtcGetNumSupportedArchs
+ */
+nvrtcResult nvrtcGetSupportedArchs(int* supportedArchs);
+
+
+/*************************************************************************//**
+ *
+ * \defgroup compilation Compilation
+ *
+ * NVRTC defines the following type and functions for actual compilation.
+ *
+ ****************************************************************************/
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcProgram is the unit of compilation, and an opaque handle for
+ * a program.
+ *
+ * To compile a CUDA program string, an instance of nvrtcProgram must be
+ * created first with ::nvrtcCreateProgram, then compiled with
+ * ::nvrtcCompileProgram.
+ */
+typedef struct _nvrtcProgram *nvrtcProgram;
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcCreateProgram creates an instance of nvrtcProgram with the
+ * given input parameters, and sets the output parameter \p prog with
+ * it.
+ *
+ * \param [out] prog CUDA Runtime Compilation program.
+ * \param [in] src CUDA program source.
+ * \param [in] name CUDA program name.\n
+ * \p name can be \c NULL; \c "default_program" is
+ * used when \p name is \c NULL or "".
+ * \param [in] numHeaders Number of headers used.\n
+ * \p numHeaders must be greater than or equal to 0.
+ * \param [in] headers Sources of the headers.\n
+ * \p headers can be \c NULL when \p numHeaders is
+ * 0.
+ * \param [in] includeNames Name of each header by which they can be
+ * included in the CUDA program source.\n
+ * \p includeNames can be \c NULL when \p numHeaders
+ * is 0. These headers must be included with the exact
+ * names specified here.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_OUT_OF_MEMORY \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_PROGRAM_CREATION_FAILURE \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcDestroyProgram
+ */
+nvrtcResult nvrtcCreateProgram(nvrtcProgram *prog,
+ const char *src,
+ const char *name,
+ int numHeaders,
+ const char * const *headers,
+ const char * const *includeNames);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcDestroyProgram destroys the given program.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcCreateProgram
+ */
+nvrtcResult nvrtcDestroyProgram(nvrtcProgram *prog);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcCompileProgram compiles the given program.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [in] numOptions Number of compiler options passed.
+ * \param [in] options Compiler options in the form of C string array.\n
+ * \p options can be \c NULL when \p numOptions is 0.
+ *
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_OUT_OF_MEMORY \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_OPTION \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_COMPILATION \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_BUILTIN_OPERATION_FAILURE \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_TIME_FILE_WRITE_FAILED \endlink
+ *
+ * It supports compile options listed in \ref options.
+ */
+nvrtcResult nvrtcCompileProgram(nvrtcProgram prog,
+ int numOptions, const char * const *options);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetPTXSize sets the value of \p ptxSizeRet with the size of the PTX
+ * generated by the previous compilation of \p prog (including the
+ * trailing \c NULL).
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] ptxSizeRet Size of the generated PTX (including the trailing
+ * \c NULL).
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetPTX
+ */
+nvrtcResult nvrtcGetPTXSize(nvrtcProgram prog, size_t *ptxSizeRet);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetPTX stores the PTX generated by the previous compilation
+ * of \p prog in the memory pointed by \p ptx.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] ptx Compiled result.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetPTXSize
+ */
+nvrtcResult nvrtcGetPTX(nvrtcProgram prog, char *ptx);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetCUBINSize sets the value of \p cubinSizeRet with the size of the cubin
+ * generated by the previous compilation of \p prog. The value of
+ * cubinSizeRet is set to 0 if the value specified to \c -arch is a
+ * virtual architecture instead of an actual architecture.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] cubinSizeRet Size of the generated cubin.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetCUBIN
+ */
+nvrtcResult nvrtcGetCUBINSize(nvrtcProgram prog, size_t *cubinSizeRet);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetCUBIN stores the cubin generated by the previous compilation
+ * of \p prog in the memory pointed by \p cubin. No cubin is available
+ * if the value specified to \c -arch is a virtual architecture instead
+ * of an actual architecture.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] cubin Compiled and assembled result.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetCUBINSize
+ */
+nvrtcResult nvrtcGetCUBIN(nvrtcProgram prog, char *cubin);
+
+
+#if defined(_WIN32)
+# define __DEPRECATED__(msg) __declspec(deprecated(msg))
+#elif (defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5 && !defined(__clang__))))
+# define __DEPRECATED__(msg) __attribute__((deprecated))
+#elif (defined(__GNUC__))
+# define __DEPRECATED__(msg) __attribute__((deprecated(msg)))
+#else
+# define __DEPRECATED__(msg)
+#endif
+
+/**
+ * \ingroup compilation
+ * \brief
+ * DEPRECATION NOTICE: This function will be removed in a future release. Please use
+ * nvrtcGetLTOIRSize (and nvrtcGetLTOIR) instead.
+ */
+__DEPRECATED__("This function will be removed in a future release. Please use nvrtcGetLTOIRSize instead")
+nvrtcResult nvrtcGetNVVMSize(nvrtcProgram prog, size_t *nvvmSizeRet);
+
+/**
+ * \ingroup compilation
+ * \brief
+ * DEPRECATION NOTICE: This function will be removed in a future release. Please use
+ * nvrtcGetLTOIR (and nvrtcGetLTOIRSize) instead.
+ */
+__DEPRECATED__("This function will be removed in a future release. Please use nvrtcGetLTOIR instead")
+nvrtcResult nvrtcGetNVVM(nvrtcProgram prog, char *nvvm);
+
+#undef __DEPRECATED__
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetLTOIRSize sets the value of \p LTOIRSizeRet with the size of the LTO IR
+ * generated by the previous compilation of \p prog. The value of
+ * LTOIRSizeRet is set to 0 if the program was not compiled with
+ * \c -dlto.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] LTOIRSizeRet Size of the generated LTO IR.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetLTOIR
+ */
+nvrtcResult nvrtcGetLTOIRSize(nvrtcProgram prog, size_t *LTOIRSizeRet);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetLTOIR stores the LTO IR generated by the previous compilation
+ * of \p prog in the memory pointed by \p LTOIR. No LTO IR is available
+ * if the program was compiled without \c -dlto.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] LTOIR Compiled result.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetLTOIRSize
+ */
+nvrtcResult nvrtcGetLTOIR(nvrtcProgram prog, char *LTOIR);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetOptiXIRSize sets the value of \p optixirSizeRet with the size of the OptiX IR
+ * generated by the previous compilation of \p prog. The value of
+ * nvrtcGetOptiXIRSize is set to 0 if the program was compiled with
+ * options incompatible with OptiX IR generation.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] optixirSizeRet Size of the generated LTO IR.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetOptiXIR
+ */
+nvrtcResult nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t *optixirSizeRet);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetOptiXIR stores the OptiX IR generated by the previous compilation
+ * of \p prog in the memory pointed by \p optixir. No OptiX IR is available
+ * if the program was compiled with options incompatible with OptiX IR generation.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] Optix IR Compiled result.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetOptiXIRSize
+ */
+nvrtcResult nvrtcGetOptiXIR(nvrtcProgram prog, char *optixir);
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetProgramLogSize sets \p logSizeRet with the size of the
+ * log generated by the previous compilation of \p prog (including the
+ * trailing \c NULL).
+ *
+ * Note that compilation log may be generated with warnings and informative
+ * messages, even when the compilation of \p prog succeeds.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] logSizeRet Size of the compilation log
+ * (including the trailing \c NULL).
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetProgramLog
+ */
+nvrtcResult nvrtcGetProgramLogSize(nvrtcProgram prog, size_t *logSizeRet);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetProgramLog stores the log generated by the previous
+ * compilation of \p prog in the memory pointed by \p log.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [out] log Compilation log.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ *
+ * \see ::nvrtcGetProgramLogSize
+ */
+nvrtcResult nvrtcGetProgramLog(nvrtcProgram prog, char *log);
+
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcAddNameExpression notes the given name expression
+ * denoting the address of a __global__ function
+ * or __device__/__constant__ variable.
+ *
+ * The identical name expression string must be provided on a subsequent
+ * call to nvrtcGetLoweredName to extract the lowered name.
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [in] name_expression constant expression denoting the address of
+ * a __global__ function or __device__/__constant__ variable.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION \endlink
+ *
+ * \see ::nvrtcGetLoweredName
+ */
+nvrtcResult nvrtcAddNameExpression(nvrtcProgram prog,
+ const char * const name_expression);
+
+/**
+ * \ingroup compilation
+ * \brief nvrtcGetLoweredName extracts the lowered (mangled) name
+ * for a __global__ function or __device__/__constant__ variable,
+ * and updates *lowered_name to point to it. The memory containing
+ * the name is released when the NVRTC program is destroyed by
+ * nvrtcDestroyProgram.
+ * The identical name expression must have been previously
+ * provided to nvrtcAddNameExpression.
+ *
+ * \param [in] prog CUDA Runtime Compilation program.
+ * \param [in] name_expression constant expression denoting the address of
+ * a __global__ function or __device__/__constant__ variable.
+ * \param [out] lowered_name initialized by the function to point to a
+ * C string containing the lowered (mangled)
+ * name corresponding to the provided name expression.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_PROGRAM \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INVALID_INPUT \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID \endlink
+ *
+ * \see ::nvrtcAddNameExpression
+ */
+nvrtcResult nvrtcGetLoweredName(nvrtcProgram prog,
+ const char *const name_expression,
+ const char** lowered_name);
+
+
+/**
+ * \defgroup options Supported Compile Options
+ *
+ * NVRTC supports the compile options below.
+ * Option names with two preceding dashs (\c --) are long option names and
+ * option names with one preceding dash (\c -) are short option names.
+ * Short option names can be used instead of long option names.
+ * When a compile option takes an argument, an assignment operator (\c =)
+ * is used to separate the compile option argument from the compile option
+ * name, e.g., \c "--gpu-architecture=compute_60".
+ * Alternatively, the compile option name and the argument can be specified in
+ * separate strings without an assignment operator, .e.g,
+ * \c "--gpu-architecture" \c "compute_60".
+ * Single-character short option names, such as \c -D, \c -U, and \c -I, do
+ * not require an assignment operator, and the compile option name and the
+ * argument can be present in the same string with or without spaces between
+ * them.
+ * For instance, \c "-D=", \c "-D", and \c "-D " are all
+ * supported.
+ *
+ * The valid compiler options are:
+ *
+ * - Compilation targets
+ * - \c --gpu-architecture=\ (\c -arch)\n
+ * Specify the name of the class of GPU architectures for which the
+ * input must be compiled.\n
+ * - Valid \ s:
+ * - \c compute_50
+ * - \c compute_52
+ * - \c compute_53
+ * - \c compute_60
+ * - \c compute_61
+ * - \c compute_62
+ * - \c compute_70
+ * - \c compute_72
+ * - \c compute_75
+ * - \c compute_80
+ * - \c compute_87
+ * - \c compute_89
+ * - \c compute_90
+ * - \c compute_90a
+ * - \c sm_50
+ * - \c sm_52
+ * - \c sm_53
+ * - \c sm_60
+ * - \c sm_61
+ * - \c sm_62
+ * - \c sm_70
+ * - \c sm_72
+ * - \c sm_75
+ * - \c sm_80
+ * - \c sm_87
+ * - \c sm_89
+ * - \c sm_90
+ * - \c sm_90a
+ * - Default: \c compute_52
+ * - Separate compilation / whole-program compilation
+ * - \c --device-c (\c -dc)\n
+ * Generate relocatable code that can be linked with other relocatable
+ * device code. It is equivalent to --relocatable-device-code=true.
+ * - \c --device-w (\c -dw)\n
+ * Generate non-relocatable code. It is equivalent to
+ * \c --relocatable-device-code=false.
+ * - \c --relocatable-device-code={true|false} (\c -rdc)\n
+ * Enable (disable) the generation of relocatable device code.
+ * - Default: \c false
+ * - \c --extensible-whole-program (\c -ewp)\n
+ * Do extensible whole program compilation of device code.
+ * - Default: \c false
+ * - Debugging support
+ * - \c --device-debug (\c -G)\n
+ * Generate debug information. If --dopt is not specified,
+ * then turns off all optimizations.
+ * - \c --generate-line-info (\c -lineinfo)\n
+ * Generate line-number information.
+ * - Code generation
+ * - \c --dopt on (\c -dopt)\n
+ * - \c --dopt=on \n
+ * Enable device code optimization. When specified along with '-G', enables
+ * limited debug information generation for optimized device code (currently,
+ * only line number information).
+ * When '-G' is not specified, '-dopt=on' is implicit.
+ * - \c --ptxas-options \ (\c -Xptxas)\n
+ * - \c --ptxas-options=\ \n
+ * Specify options directly to ptxas, the PTX optimizing assembler.
+ * - \c --maxrregcount=\ (\c -maxrregcount)\n
+ * Specify the maximum amount of registers that GPU functions can use.
+ * Until a function-specific limit, a higher value will generally
+ * increase the performance of individual GPU threads that execute this
+ * function. However, because thread registers are allocated from a
+ * global register pool on each GPU, a higher value of this option will
+ * also reduce the maximum thread block size, thereby reducing the amount
+ * of thread parallelism. Hence, a good maxrregcount value is the result
+ * of a trade-off. If this option is not specified, then no maximum is
+ * assumed. Value less than the minimum registers required by ABI will
+ * be bumped up by the compiler to ABI minimum limit.
+ * - \c --ftz={true|false} (\c -ftz)\n
+ * When performing single-precision floating-point operations, flush
+ * denormal values to zero or preserve denormal values.
+ * \c --use_fast_math implies \c --ftz=true.
+ * - Default: \c false
+ * - \c --prec-sqrt={true|false} (\c -prec-sqrt)\n
+ * For single-precision floating-point square root, use IEEE
+ * round-to-nearest mode or use a faster approximation.
+ * \c --use_fast_math implies \c --prec-sqrt=false.
+ * - Default: \c true
+ * - \c --prec-div={true|false} (\c -prec-div)\n
+ * For single-precision floating-point division and reciprocals, use IEEE
+ * round-to-nearest mode or use a faster approximation.
+ * \c --use_fast_math implies \c --prec-div=false.
+ * - Default: \c true
+ * - \c --fmad={true|false} (\c -fmad)\n
+ * Enables (disables) the contraction of floating-point multiplies and
+ * adds/subtracts into floating-point multiply-add operations (FMAD,
+ * FFMA, or DFMA). \c --use_fast_math implies \c --fmad=true.
+ * - Default: \c true
+ * - \c --use_fast_math (\c -use_fast_math)\n
+ * Make use of fast math operations.
+ * \c --use_fast_math implies \c --ftz=true \c --prec-div=false
+ * \c --prec-sqrt=false \c --fmad=true.
+ * - \c --extra-device-vectorization (\c -extra-device-vectorization)\n
+ * Enables more aggressive device code vectorization in the NVVM optimizer.
+ * - \c --modify-stack-limit={true|false} (\c -modify-stack-limit)\n
+ * On Linux, during compilation, use \c setrlimit() to increase stack size
+ * to maximum allowed. The limit is reset to the previous value at the
+ * end of compilation.
+ * Note: \c setrlimit() changes the value for the entire process.
+ * - Default: \c true
+ * - \c --dlink-time-opt (\c -dlto)\n
+ * Generate intermediate code for later link-time optimization.
+ * It implies \c -rdc=true.
+ * Note: when this option is used the nvrtcGetLTOIR API should be used,
+ * as PTX or Cubin will not be generated.
+ * - \c --gen-opt-lto (\c -gen-opt-lto)\n
+ * Run the optimizer passes before generating the LTO IR.
+ * - \c --optix-ir (\c -optix-ir)\n
+ * Generate OptiX IR. The Optix IR is only intended for consumption by OptiX
+ * through appropriate APIs. This feature is not supported with
+ * link-time-optimization (\c -dlto)\n.
+ * Note: when this option is used the nvrtcGetOptiX API should be used,
+ * as PTX or Cubin will not be generated.
+ * - \c --jump-table-density=[0-101] (\c -jtd)\n
+ * Specify the case density percentage in switch statements, and use it as
+ * a minimal threshold to determine whether jump table(brx.idx instruction)
+ * will be used to implement a switch statement. Default value is 101. The
+ * percentage ranges from 0 to 101 inclusively.
+ * - \c --device-stack-protector={true|false} (\c -device-stack-protector)\n
+ * Enable (disable) the generation of stack canaries in device code.\n
+ * - Default: \c false
+ * - Preprocessing
+ * - \c --define-macro=\ (\c -D)\n
+ * \c \ can be either \c \ or \c \.
+ * - \c \ \n
+ * Predefine \c \ as a macro with definition \c 1.
+ * - \c \=\ \n
+ * The contents of \c \ are tokenized and preprocessed
+ * as if they appeared during translation phase three in a \c \#define
+ * directive. In particular, the definition will be truncated by
+ * embedded new line characters.
+ * - \c --undefine-macro=\ (\c -U)\n
+ * Cancel any previous definition of \c \.
+ * - \c --include-path=\ (\c -I)\n
+ * Add the directory \c \ to the list of directories to be
+ * searched for headers. These paths are searched after the list of
+ * headers given to ::nvrtcCreateProgram.
+ * - \c --pre-include=\ (\c -include)\n
+ * Preinclude \c \ during preprocessing.
+ * - \c --no-source-include (\c -no-source-include)
+ * The preprocessor by default adds the directory of each input sources
+ * to the include path. This option disables this feature and only
+ * considers the path specified explicitly.
+ * - Language Dialect
+ * - \c --std={c++03|c++11|c++14|c++17|c++20}
+ * (\c -std={c++11|c++14|c++17|c++20})\n
+ * Set language dialect to C++03, C++11, C++14, C++17 or C++20
+ * - Default: \c c++17
+ * - \c --builtin-move-forward={true|false} (\c -builtin-move-forward)\n
+ * Provide builtin definitions of \c std::move and \c std::forward,
+ * when C++11 or later language dialect is selected.
+ * - Default: \c true
+ * - \c --builtin-initializer-list={true|false}
+ * (\c -builtin-initializer-list)\n
+ * Provide builtin definitions of \c std::initializer_list class and
+ * member functions when C++11 or later language dialect is selected.
+ * - Default: \c true
+ * - Misc.
+ * - \c --disable-warnings (\c -w)\n
+ * Inhibit all warning messages.
+ * - \c --restrict (\c -restrict)\n
+ * Programmer assertion that all kernel pointer parameters are restrict
+ * pointers.
+ * - \c --device-as-default-execution-space
+ * (\c -default-device)\n
+ * Treat entities with no execution space annotation as \c __device__
+ * entities.
+ * - \c --device-int128 (\c -device-int128)\n
+ * Allow the \c __int128 type in device code. Also causes the macro \c __CUDACC_RTC_INT128__
+ * to be defined.
+ * - \c --optimization-info=\ (\c -opt-info)\n
+ * Provide optimization reports for the specified kind of optimization.
+ * The following kind tags are supported:
+ * - \c inline : emit a remark when a function is inlined.
+ * - \c --display-error-number (\c -err-no)\n
+ * Display diagnostic number for warning messages. (Default)
+ * - \c --no-display-error-number (\c -no-err-no)\n
+ * Disables the display of a diagnostic number for warning messages.
+ * - \c --diag-error=,... (\c -diag-error)\n
+ * Emit error for specified diagnostic message number(s). Message numbers can be separated by comma.
+ * - \c --diag-suppress=,... (\c -diag-suppress)\n
+ * Suppress specified diagnostic message number(s). Message numbers can be separated by comma.
+ * - \c --diag-warn=,... (\c -diag-warn)\n
+ * Emit warning for specified diagnostic message number(s). Message numbers can be separated by comma.
+ * - \c --brief-diagnostics={true|false} (\c -brief-diag)\n
+ * This option disables or enables showing source line and column info
+ * in a diagnostic.
+ * The --brief-diagnostics=true will not show the source line and column info.
+ * - Default: \c false
+ * - \c --time= (\c -time)\n
+ * Generate a comma separated value table with the time taken by each compilation
+ * phase, and append it at the end of the file given as the option argument.
+ * If the file does not exist, the column headings are generated in the first row
+ * of the table. If the file name is '-', the timing data is written to the compilation log.
+ * - \c --split-compile= (\c -split-compile=)\n
+ * Perform compiler optimizations in parallel.
+ * Split compilation attempts to reduce compile time by enabling the compiler to run certain
+ * optimization passes concurrently. This option accepts a numerical value that specifies the
+ * maximum number of threads the compiler can use. One can also allow the compiler to use the maximum
+ * threads available on the system by setting --split-compile=0.
+ * Setting --split-compile=1 will cause this option to be ignored.
+ * - \c --fdevice-syntax-only (\c -fdevice-syntax-only)\n
+ * Ends device compilation after front-end syntax checking. This option does not generate valid
+ * device code.
+ * - \c --minimal (\c -minimal)\n
+ * Omit certain language features to reduce compile time for small programs.
+ * In particular, the following are omitted:
+ * - Texture and surface functions and associated types, e.g., \c cudaTextureObject_t.
+ * - CUDA Runtime Functions that are provided by the cudadevrt device code library,
+ * typically named with prefix "cuda", e.g., \c cudaMalloc.
+ * - Kernel launch from device code.
+ * - Types and macros associated with CUDA Runtime and Driver APIs,
+ * provided by cuda/tools/cudart/driver_types.h, typically named with prefix "cuda", e.g., \c cudaError_t.
+ * - \c --device-stack-protector (\c -device-stack-protector)\n
+ * Enable stack canaries in device code.
+ * Stack canaries make it more difficult to exploit certain types of memory safety bugs involving stack-local variables.
+ * The compiler uses heuristics to assess the risk of such a bug in each function. Only those functions which are deemed high-risk make use of a stack canary.
+ *
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+/* The utility function 'nvrtcGetTypeName' is not available by default. Define
+ the macro 'NVRTC_GET_TYPE_NAME' to a non-zero value to make it available.
+*/
+
+#if NVRTC_GET_TYPE_NAME || __DOXYGEN_ONLY__
+
+#if NVRTC_USE_CXXABI || __clang__ || __GNUC__ || __DOXYGEN_ONLY__
+#include
+#include
+
+#elif defined(_WIN32)
+#include
+#include
+#endif /* NVRTC_USE_CXXABI || __clang__ || __GNUC__ */
+
+
+#include
+#include
+
+template struct __nvrtcGetTypeName_helper_t { };
+
+/*************************************************************************//**
+ *
+ * \defgroup hosthelper Host Helper
+ *
+ * NVRTC defines the following functions for easier interaction with host code.
+ *
+ ****************************************************************************/
+
+/**
+ * \ingroup hosthelper
+ * \brief nvrtcGetTypeName stores the source level name of a type in the given
+ * std::string location.
+ *
+ * This function is only provided when the macro NVRTC_GET_TYPE_NAME is
+ * defined with a non-zero value. It uses abi::__cxa_demangle or UnDecorateSymbolName
+ * function calls to extract the type name, when using gcc/clang or cl.exe compilers,
+ * respectively. If the name extraction fails, it will return NVRTC_INTERNAL_ERROR,
+ * otherwise *result is initialized with the extracted name.
+ *
+ * Windows-specific notes:
+ * - nvrtcGetTypeName() is not multi-thread safe because it calls UnDecorateSymbolName(),
+ * which is not multi-thread safe.
+ * - The returned string may contain Microsoft-specific keywords such as __ptr64 and __cdecl.
+ *
+ * \param [in] tinfo: reference to object of type std::type_info for a given type.
+ * \param [in] result: pointer to std::string in which to store the type name.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INTERNAL_ERROR \endlink
+ *
+ */
+inline nvrtcResult nvrtcGetTypeName(const std::type_info &tinfo, std::string *result)
+{
+#if USE_CXXABI || __clang__ || __GNUC__
+ const char *name = tinfo.name();
+ int status;
+ char *undecorated_name = abi::__cxa_demangle(name, 0, 0, &status);
+ if (status == 0) {
+ *result = undecorated_name;
+ free(undecorated_name);
+ return NVRTC_SUCCESS;
+ }
+#elif defined(_WIN32)
+ const char *name = tinfo.raw_name();
+ if (!name || *name != '.') {
+ return NVRTC_ERROR_INTERNAL_ERROR;
+ }
+ char undecorated_name[4096];
+ //name+1 skips over the '.' prefix
+ if(UnDecorateSymbolName(name+1, undecorated_name,
+ sizeof(undecorated_name) / sizeof(*undecorated_name),
+ //note: doesn't seem to work correctly without UNDNAME_NO_ARGUMENTS.
+ UNDNAME_NO_ARGUMENTS | UNDNAME_NAME_ONLY ) ) {
+ *result = undecorated_name;
+ return NVRTC_SUCCESS;
+ }
+#endif /* USE_CXXABI || __clang__ || __GNUC__ */
+
+ return NVRTC_ERROR_INTERNAL_ERROR;
+}
+
+/**
+ * \ingroup hosthelper
+ * \brief nvrtcGetTypeName stores the source level name of the template type argument
+ * T in the given std::string location.
+ *
+ * This function is only provided when the macro NVRTC_GET_TYPE_NAME is
+ * defined with a non-zero value. It uses abi::__cxa_demangle or UnDecorateSymbolName
+ * function calls to extract the type name, when using gcc/clang or cl.exe compilers,
+ * respectively. If the name extraction fails, it will return NVRTC_INTERNAL_ERROR,
+ * otherwise *result is initialized with the extracted name.
+ *
+ * Windows-specific notes:
+ * - nvrtcGetTypeName() is not multi-thread safe because it calls UnDecorateSymbolName(),
+ * which is not multi-thread safe.
+ * - The returned string may contain Microsoft-specific keywords such as __ptr64 and __cdecl.
+ *
+ * \param [in] result: pointer to std::string in which to store the type name.
+ * \return
+ * - \link #nvrtcResult NVRTC_SUCCESS \endlink
+ * - \link #nvrtcResult NVRTC_ERROR_INTERNAL_ERROR \endlink
+ *
+ */
+
+template
+nvrtcResult nvrtcGetTypeName(std::string *result)
+{
+ nvrtcResult res = nvrtcGetTypeName(typeid(__nvrtcGetTypeName_helper_t),
+ result);
+ if (res != NVRTC_SUCCESS)
+ return res;
+
+ std::string repr = *result;
+ std::size_t idx = repr.find("__nvrtcGetTypeName_helper_t");
+ idx = (idx != std::string::npos) ? repr.find("<", idx) : idx;
+ std::size_t last_idx = repr.find_last_of('>');
+ if (idx == std::string::npos || last_idx == std::string::npos) {
+ return NVRTC_ERROR_INTERNAL_ERROR;
+ }
+ ++idx;
+ *result = repr.substr(idx, last_idx - idx);
+ return NVRTC_SUCCESS;
+}
+
+#endif /* NVRTC_GET_TYPE_NAME */
+
+#endif /* __NVRTC_H__ */
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/lib/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cuda_nvrtc/lib/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cudalibxt.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cudalibxt.h
new file mode 100644
index 0000000000000000000000000000000000000000..94fcf4745fafa04f57678ba5ee64103f8ebd6444
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cudalibxt.h
@@ -0,0 +1,97 @@
+ /* Copyright 2013,2014 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * The source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * The Licensed Deliverables contained herein are PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and are being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+/*!
+* \file cudalibxt.h
+* \brief Public header file for the NVIDIA library multi-GPU support structures
+*/
+
+#ifndef _CUDA_LIB_XT_H_
+#define _CUDA_LIB_XT_H_
+#include
+
+#define CUDA_XT_DESCRIPTOR_VERSION 0x01000000 // This is added to CUDART_VERSION
+
+enum cudaXtCopyType_t {
+ LIB_XT_COPY_HOST_TO_DEVICE,
+ LIB_XT_COPY_DEVICE_TO_HOST,
+ LIB_XT_COPY_DEVICE_TO_DEVICE
+} ;
+typedef enum cudaXtCopyType_t cudaLibXtCopyType;
+
+enum libFormat_t {
+ LIB_FORMAT_CUFFT = 0x0,
+ LIB_FORMAT_UNDEFINED = 0x1
+};
+
+typedef enum libFormat_t libFormat;
+
+#define MAX_CUDA_DESCRIPTOR_GPUS 64
+
+struct cudaXtDesc_t{
+ int version; //descriptor version
+ int nGPUs; //number of GPUs
+ int GPUs[MAX_CUDA_DESCRIPTOR_GPUS]; //array of device IDs
+ void *data[MAX_CUDA_DESCRIPTOR_GPUS]; //array of pointers to data, one per GPU
+ size_t size[MAX_CUDA_DESCRIPTOR_GPUS]; //array of data sizes, one per GPU
+ void *cudaXtState; //opaque CUDA utility structure
+};
+typedef struct cudaXtDesc_t cudaXtDesc;
+
+struct cudaLibXtDesc_t{
+ int version; //descriptor version
+ cudaXtDesc *descriptor; //multi-GPU memory descriptor
+ libFormat library; //which library recognizes the format
+ int subFormat; //library specific enumerator of sub formats
+ void *libDescriptor; //library specific descriptor e.g. FFT transform plan object
+};
+typedef struct cudaLibXtDesc_t cudaLibXtDesc;
+
+
+#endif
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufft.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufft.h
new file mode 100644
index 0000000000000000000000000000000000000000..2c3dbc4efc36a510117a1e9ed0973f7319d76ce9
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufft.h
@@ -0,0 +1,335 @@
+ /* Copyright 2005-2021 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * The source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * The Licensed Deliverables contained herein are PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and are being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+/*!
+* \file cufft.h
+* \brief Public header file for the NVIDIA CUDA FFT library (CUFFT)
+*/
+
+#ifndef _CUFFT_H_
+#define _CUFFT_H_
+
+
+#include "cuComplex.h"
+#include "driver_types.h"
+#include "library_types.h"
+
+#ifndef CUFFTAPI
+#ifdef _WIN32
+#define CUFFTAPI __stdcall
+#elif __GNUC__ >= 4
+#define CUFFTAPI __attribute__ ((visibility ("default")))
+#else
+#define CUFFTAPI
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define CUFFT_VER_MAJOR 11
+#define CUFFT_VER_MINOR 3
+#define CUFFT_VER_PATCH 0
+#define CUFFT_VER_BUILD 4
+
+#define CUFFT_VERSION 11300
+
+// CUFFT API function return values
+typedef enum cufftResult_t {
+ CUFFT_SUCCESS = 0x0,
+ CUFFT_INVALID_PLAN = 0x1,
+ CUFFT_ALLOC_FAILED = 0x2,
+ CUFFT_INVALID_TYPE = 0x3,
+ CUFFT_INVALID_VALUE = 0x4,
+ CUFFT_INTERNAL_ERROR = 0x5,
+ CUFFT_EXEC_FAILED = 0x6,
+ CUFFT_SETUP_FAILED = 0x7,
+ CUFFT_INVALID_SIZE = 0x8,
+ CUFFT_UNALIGNED_DATA = 0x9,
+ CUFFT_INCOMPLETE_PARAMETER_LIST = 0xA,
+ CUFFT_INVALID_DEVICE = 0xB,
+ CUFFT_PARSE_ERROR = 0xC,
+ CUFFT_NO_WORKSPACE = 0xD,
+ CUFFT_NOT_IMPLEMENTED = 0xE,
+ CUFFT_LICENSE_ERROR = 0x0F,
+ CUFFT_NOT_SUPPORTED = 0x10
+
+} cufftResult;
+
+#define MAX_CUFFT_ERROR 0x11
+
+
+// CUFFT defines and supports the following data types
+
+
+// cufftReal is a single-precision, floating-point real data type.
+// cufftDoubleReal is a double-precision, real data type.
+typedef float cufftReal;
+typedef double cufftDoubleReal;
+
+// cufftComplex is a single-precision, floating-point complex data type that
+// consists of interleaved real and imaginary components.
+// cufftDoubleComplex is the double-precision equivalent.
+typedef cuComplex cufftComplex;
+typedef cuDoubleComplex cufftDoubleComplex;
+
+// CUFFT transform directions
+#define CUFFT_FORWARD -1 // Forward FFT
+#define CUFFT_INVERSE 1 // Inverse FFT
+
+// CUFFT supports the following transform types
+typedef enum cufftType_t {
+ CUFFT_R2C = 0x2a, // Real to Complex (interleaved)
+ CUFFT_C2R = 0x2c, // Complex (interleaved) to Real
+ CUFFT_C2C = 0x29, // Complex to Complex, interleaved
+ CUFFT_D2Z = 0x6a, // Double to Double-Complex
+ CUFFT_Z2D = 0x6c, // Double-Complex to Double
+ CUFFT_Z2Z = 0x69 // Double-Complex to Double-Complex
+} cufftType;
+
+// CUFFT supports the following data layouts
+typedef enum cufftCompatibility_t {
+ CUFFT_COMPATIBILITY_FFTW_PADDING = 0x01 // The default value
+} cufftCompatibility;
+
+#define CUFFT_COMPATIBILITY_DEFAULT CUFFT_COMPATIBILITY_FFTW_PADDING
+
+//
+// structure definition used by the shim between old and new APIs
+//
+#define MAX_SHIM_RANK 3
+
+// cufftHandle is a handle type used to store and access CUFFT plans.
+typedef int cufftHandle;
+
+
+cufftResult CUFFTAPI cufftPlan1d(cufftHandle *plan,
+ int nx,
+ cufftType type,
+ int batch);
+
+cufftResult CUFFTAPI cufftPlan2d(cufftHandle *plan,
+ int nx, int ny,
+ cufftType type);
+
+cufftResult CUFFTAPI cufftPlan3d(cufftHandle *plan,
+ int nx, int ny, int nz,
+ cufftType type);
+
+cufftResult CUFFTAPI cufftPlanMany(cufftHandle *plan,
+ int rank,
+ int *n,
+ int *inembed, int istride, int idist,
+ int *onembed, int ostride, int odist,
+ cufftType type,
+ int batch);
+
+cufftResult CUFFTAPI cufftMakePlan1d(cufftHandle plan,
+ int nx,
+ cufftType type,
+ int batch,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftMakePlan2d(cufftHandle plan,
+ int nx, int ny,
+ cufftType type,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftMakePlan3d(cufftHandle plan,
+ int nx, int ny, int nz,
+ cufftType type,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftMakePlanMany(cufftHandle plan,
+ int rank,
+ int *n,
+ int *inembed, int istride, int idist,
+ int *onembed, int ostride, int odist,
+ cufftType type,
+ int batch,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftMakePlanMany64(cufftHandle plan,
+ int rank,
+ long long int *n,
+ long long int *inembed,
+ long long int istride,
+ long long int idist,
+ long long int *onembed,
+ long long int ostride, long long int odist,
+ cufftType type,
+ long long int batch,
+ size_t * workSize);
+
+cufftResult CUFFTAPI cufftGetSizeMany64(cufftHandle plan,
+ int rank,
+ long long int *n,
+ long long int *inembed,
+ long long int istride, long long int idist,
+ long long int *onembed,
+ long long int ostride, long long int odist,
+ cufftType type,
+ long long int batch,
+ size_t *workSize);
+
+
+
+
+cufftResult CUFFTAPI cufftEstimate1d(int nx,
+ cufftType type,
+ int batch,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftEstimate2d(int nx, int ny,
+ cufftType type,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftEstimate3d(int nx, int ny, int nz,
+ cufftType type,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftEstimateMany(int rank,
+ int *n,
+ int *inembed, int istride, int idist,
+ int *onembed, int ostride, int odist,
+ cufftType type,
+ int batch,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftCreate(cufftHandle * handle);
+
+cufftResult CUFFTAPI cufftGetSize1d(cufftHandle handle,
+ int nx,
+ cufftType type,
+ int batch,
+ size_t *workSize );
+
+cufftResult CUFFTAPI cufftGetSize2d(cufftHandle handle,
+ int nx, int ny,
+ cufftType type,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftGetSize3d(cufftHandle handle,
+ int nx, int ny, int nz,
+ cufftType type,
+ size_t *workSize);
+
+cufftResult CUFFTAPI cufftGetSizeMany(cufftHandle handle,
+ int rank, int *n,
+ int *inembed, int istride, int idist,
+ int *onembed, int ostride, int odist,
+ cufftType type, int batch, size_t *workArea);
+
+cufftResult CUFFTAPI cufftGetSize(cufftHandle handle, size_t *workSize);
+
+cufftResult CUFFTAPI cufftSetWorkArea(cufftHandle plan, void *workArea);
+
+cufftResult CUFFTAPI cufftSetAutoAllocation(cufftHandle plan, int autoAllocate);
+
+cufftResult CUFFTAPI cufftExecC2C(cufftHandle plan,
+ cufftComplex *idata,
+ cufftComplex *odata,
+ int direction);
+
+cufftResult CUFFTAPI cufftExecR2C(cufftHandle plan,
+ cufftReal *idata,
+ cufftComplex *odata);
+
+cufftResult CUFFTAPI cufftExecC2R(cufftHandle plan,
+ cufftComplex *idata,
+ cufftReal *odata);
+
+cufftResult CUFFTAPI cufftExecZ2Z(cufftHandle plan,
+ cufftDoubleComplex *idata,
+ cufftDoubleComplex *odata,
+ int direction);
+
+cufftResult CUFFTAPI cufftExecD2Z(cufftHandle plan,
+ cufftDoubleReal *idata,
+ cufftDoubleComplex *odata);
+
+cufftResult CUFFTAPI cufftExecZ2D(cufftHandle plan,
+ cufftDoubleComplex *idata,
+ cufftDoubleReal *odata);
+
+
+// utility functions
+cufftResult CUFFTAPI cufftSetStream(cufftHandle plan,
+ cudaStream_t stream);
+
+cufftResult CUFFTAPI cufftDestroy(cufftHandle plan);
+
+cufftResult CUFFTAPI cufftGetVersion(int *version);
+
+cufftResult CUFFTAPI cufftGetProperty(libraryPropertyType type,
+ int *value);
+
+//
+// Set/Get PlanProperty APIs configures per-plan behavior
+//
+typedef enum cufftProperty_t {
+ NVFFT_PLAN_PROPERTY_INT64_PATIENT_JIT = 0x1,
+ NVFFT_PLAN_PROPERTY_INT64_MAX_NUM_HOST_THREADS = 0x2,
+} cufftProperty;
+
+cufftResult CUFFTAPI cufftSetPlanPropertyInt64(cufftHandle plan,
+ cufftProperty property,
+ const long long int inputValueInt);
+
+cufftResult CUFFTAPI cufftGetPlanPropertyInt64(cufftHandle plan,
+ cufftProperty property,
+ long long int* returnPtrValue);
+
+cufftResult CUFFTAPI cufftResetPlanProperty(cufftHandle plan, cufftProperty property);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _CUFFT_H_ */
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufftXt.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufftXt.h
new file mode 100644
index 0000000000000000000000000000000000000000..cb587e061cd85e5cfc8d6cb7015f575778e45ec7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufftXt.h
@@ -0,0 +1,278 @@
+
+ /* Copyright 2005-2021 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * The source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * The Licensed Deliverables contained herein are PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and are being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+/*!
+* \file cufftXt.h
+* \brief Public header file for the NVIDIA CUDA FFT library (CUFFT)
+*/
+
+#ifndef _CUFFTXT_H_
+#define _CUFFTXT_H_
+#include "cudalibxt.h"
+#include "cufft.h"
+
+
+#ifndef CUFFTAPI
+#ifdef _WIN32
+#define CUFFTAPI __stdcall
+#else
+#define CUFFTAPI
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+// cufftXtSubFormat identifies the data layout of
+// a memory descriptor owned by cufft.
+// note that multi GPU cufft does not yet support out-of-place transforms
+//
+
+typedef enum cufftXtSubFormat_t {
+ CUFFT_XT_FORMAT_INPUT = 0x00, //by default input is in linear order across GPUs
+ CUFFT_XT_FORMAT_OUTPUT = 0x01, //by default output is in scrambled order depending on transform
+ CUFFT_XT_FORMAT_INPLACE = 0x02, //by default inplace is input order, which is linear across GPUs
+ CUFFT_XT_FORMAT_INPLACE_SHUFFLED = 0x03, //shuffled output order after execution of the transform
+ CUFFT_XT_FORMAT_1D_INPUT_SHUFFLED = 0x04, //shuffled input order prior to execution of 1D transforms
+ CUFFT_XT_FORMAT_DISTRIBUTED_INPUT = 0x05,
+ CUFFT_XT_FORMAT_DISTRIBUTED_OUTPUT = 0x06,
+ CUFFT_FORMAT_UNDEFINED = 0x07
+} cufftXtSubFormat;
+
+//
+// cufftXtCopyType specifies the type of copy for cufftXtMemcpy
+//
+typedef enum cufftXtCopyType_t {
+ CUFFT_COPY_HOST_TO_DEVICE = 0x00,
+ CUFFT_COPY_DEVICE_TO_HOST = 0x01,
+ CUFFT_COPY_DEVICE_TO_DEVICE = 0x02,
+ CUFFT_COPY_UNDEFINED = 0x03
+} cufftXtCopyType;
+
+//
+// cufftXtQueryType specifies the type of query for cufftXtQueryPlan
+//
+typedef enum cufftXtQueryType_t {
+ CUFFT_QUERY_1D_FACTORS = 0x00,
+ CUFFT_QUERY_UNDEFINED = 0x01
+} cufftXtQueryType;
+
+typedef struct cufftXt1dFactors_t {
+ long long int size;
+ long long int stringCount;
+ long long int stringLength;
+ long long int substringLength;
+ long long int factor1;
+ long long int factor2;
+ long long int stringMask;
+ long long int substringMask;
+ long long int factor1Mask;
+ long long int factor2Mask;
+ int stringShift;
+ int substringShift;
+ int factor1Shift;
+ int factor2Shift;
+} cufftXt1dFactors;
+
+//
+// cufftXtWorkAreaPolicy specifies policy for cufftXtSetWorkAreaPolicy
+//
+typedef enum cufftXtWorkAreaPolicy_t {
+ CUFFT_WORKAREA_MINIMAL = 0, /* maximum reduction */
+ CUFFT_WORKAREA_USER = 1, /* use workSize parameter as limit */
+ CUFFT_WORKAREA_PERFORMANCE = 2, /* default - 1x overhead or more, maximum performance */
+} cufftXtWorkAreaPolicy;
+
+// multi-GPU routines
+cufftResult CUFFTAPI cufftXtSetGPUs(cufftHandle handle, int nGPUs, int *whichGPUs);
+
+cufftResult CUFFTAPI cufftXtMalloc(cufftHandle plan,
+ cudaLibXtDesc ** descriptor,
+ cufftXtSubFormat format);
+
+cufftResult CUFFTAPI cufftXtMemcpy(cufftHandle plan,
+ void *dstPointer,
+ void *srcPointer,
+ cufftXtCopyType type);
+
+cufftResult CUFFTAPI cufftXtFree(cudaLibXtDesc *descriptor);
+
+cufftResult CUFFTAPI cufftXtSetWorkArea(cufftHandle plan, void **workArea);
+
+cufftResult CUFFTAPI cufftXtExecDescriptorC2C(cufftHandle plan,
+ cudaLibXtDesc *input,
+ cudaLibXtDesc *output,
+ int direction);
+
+cufftResult CUFFTAPI cufftXtExecDescriptorR2C(cufftHandle plan,
+ cudaLibXtDesc *input,
+ cudaLibXtDesc *output);
+
+cufftResult CUFFTAPI cufftXtExecDescriptorC2R(cufftHandle plan,
+ cudaLibXtDesc *input,
+ cudaLibXtDesc *output);
+
+cufftResult CUFFTAPI cufftXtExecDescriptorZ2Z(cufftHandle plan,
+ cudaLibXtDesc *input,
+ cudaLibXtDesc *output,
+ int direction);
+
+cufftResult CUFFTAPI cufftXtExecDescriptorD2Z(cufftHandle plan,
+ cudaLibXtDesc *input,
+ cudaLibXtDesc *output);
+
+cufftResult CUFFTAPI cufftXtExecDescriptorZ2D(cufftHandle plan,
+ cudaLibXtDesc *input,
+ cudaLibXtDesc *output);
+
+// Utility functions
+
+cufftResult CUFFTAPI cufftXtQueryPlan(cufftHandle plan, void *queryStruct, cufftXtQueryType queryType);
+
+
+// callbacks
+
+
+typedef enum cufftXtCallbackType_t {
+ CUFFT_CB_LD_COMPLEX = 0x0,
+ CUFFT_CB_LD_COMPLEX_DOUBLE = 0x1,
+ CUFFT_CB_LD_REAL = 0x2,
+ CUFFT_CB_LD_REAL_DOUBLE = 0x3,
+ CUFFT_CB_ST_COMPLEX = 0x4,
+ CUFFT_CB_ST_COMPLEX_DOUBLE = 0x5,
+ CUFFT_CB_ST_REAL = 0x6,
+ CUFFT_CB_ST_REAL_DOUBLE = 0x7,
+ CUFFT_CB_UNDEFINED = 0x8
+
+} cufftXtCallbackType;
+
+// Legacy callbacks
+typedef cufftComplex (*cufftCallbackLoadC)(void *dataIn, size_t offset, void *callerInfo, void *sharedPointer);
+typedef cufftDoubleComplex (*cufftCallbackLoadZ)(void *dataIn, size_t offset, void *callerInfo, void *sharedPointer);
+typedef cufftReal (*cufftCallbackLoadR)(void *dataIn, size_t offset, void *callerInfo, void *sharedPointer);
+typedef cufftDoubleReal(*cufftCallbackLoadD)(void *dataIn, size_t offset, void *callerInfo, void *sharedPointer);
+
+typedef void (*cufftCallbackStoreC)(void *dataOut, size_t offset, cufftComplex element, void *callerInfo, void *sharedPointer);
+typedef void (*cufftCallbackStoreZ)(void *dataOut, size_t offset, cufftDoubleComplex element, void *callerInfo, void *sharedPointer);
+typedef void (*cufftCallbackStoreR)(void *dataOut, size_t offset, cufftReal element, void *callerInfo, void *sharedPointer);
+typedef void (*cufftCallbackStoreD)(void *dataOut, size_t offset, cufftDoubleReal element, void *callerInfo, void *sharedPointer);
+
+// LTO callbacks (notice the different offset type vs. legacy callbacks)
+typedef cufftComplex (*cufftJITCallbackLoadC)(void *dataIn, unsigned long long offset, void *callerInfo, void *sharedPointer);
+typedef cufftDoubleComplex (*cufftJITCallbackLoadZ)(void *dataIn, unsigned long long offset, void *callerInfo, void *sharedPointer);
+typedef cufftReal (*cufftJITCallbackLoadR)(void *dataIn, unsigned long long offset, void *callerInfo, void *sharedPointer);
+typedef cufftDoubleReal(*cufftJITCallbackLoadD)(void *dataIn, unsigned long long offset, void *callerInfo, void *sharedPointer);
+
+typedef void (*cufftJITCallbackStoreC)(void *dataOut, unsigned long long offset, cufftComplex element, void *callerInfo, void *sharedPointer);
+typedef void (*cufftJITCallbackStoreZ)(void *dataOut, unsigned long long offset, cufftDoubleComplex element, void *callerInfo, void *sharedPointer);
+typedef void (*cufftJITCallbackStoreR)(void *dataOut, unsigned long long offset, cufftReal element, void *callerInfo, void *sharedPointer);
+typedef void (*cufftJITCallbackStoreD)(void *dataOut, unsigned long long offset, cufftDoubleReal element, void *callerInfo, void *sharedPointer);
+
+cufftResult CUFFTAPI cufftXtSetCallback(cufftHandle plan, void **callback_routine, cufftXtCallbackType cbType, void **caller_info);
+cufftResult CUFFTAPI cufftXtClearCallback(cufftHandle plan, cufftXtCallbackType cbType);
+cufftResult CUFFTAPI cufftXtSetCallbackSharedSize(cufftHandle plan, cufftXtCallbackType cbType, size_t sharedSize);
+
+cufftResult CUFFTAPI __cufftXtSetJITCallback_12_7(cufftHandle plan, const char* lto_callback_symbol_name, const void *lto_callback_fatbin, size_t lto_callback_fatbin_size, cufftXtCallbackType type, void **caller_info );
+
+#ifndef CUFFT_NO_INLINE
+static inline cufftResult cufftXtSetJITCallback(cufftHandle plan, const char* lto_callback_symbol_name, const void *lto_callback_fatbin, size_t lto_callback_fatbin_size, cufftXtCallbackType type, void **caller_info) {
+ return __cufftXtSetJITCallback_12_7(plan, lto_callback_symbol_name, lto_callback_fatbin, lto_callback_fatbin_size, type, caller_info);
+};
+#endif
+
+cufftResult CUFFTAPI cufftXtMakePlanMany(cufftHandle plan,
+ int rank,
+ long long int *n,
+ long long int *inembed,
+ long long int istride,
+ long long int idist,
+ cudaDataType inputtype,
+ long long int *onembed,
+ long long int ostride,
+ long long int odist,
+ cudaDataType outputtype,
+ long long int batch,
+ size_t *workSize,
+ cudaDataType executiontype);
+
+cufftResult CUFFTAPI cufftXtGetSizeMany(cufftHandle plan,
+ int rank,
+ long long int *n,
+ long long int *inembed,
+ long long int istride,
+ long long int idist,
+ cudaDataType inputtype,
+ long long int *onembed,
+ long long int ostride,
+ long long int odist,
+ cudaDataType outputtype,
+ long long int batch,
+ size_t *workSize,
+ cudaDataType executiontype);
+
+
+cufftResult CUFFTAPI cufftXtExec(cufftHandle plan,
+ void *input,
+ void *output,
+ int direction);
+
+cufftResult CUFFTAPI cufftXtExecDescriptor(cufftHandle plan,
+ cudaLibXtDesc *input,
+ cudaLibXtDesc *output,
+ int direction);
+
+cufftResult CUFFTAPI cufftXtSetWorkAreaPolicy(cufftHandle plan, cufftXtWorkAreaPolicy policy, size_t *workSize);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufftw.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufftw.h
new file mode 100644
index 0000000000000000000000000000000000000000..dcf72370f777bc0aaa76dddae9a34efd667a5922
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/include/cufftw.h
@@ -0,0 +1,465 @@
+
+ /* Copyright 2005-2014 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * The source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * The Licensed Deliverables contained herein are PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and are being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. THEY ARE
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and are provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+/*!
+* \file cufftw.h
+* \brief Public header file for the NVIDIA CUDA FFTW library (CUFFTW)
+*/
+
+#ifndef _CUFFTW_H_
+#define _CUFFTW_H_
+
+
+#include
+#include "cufft.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Transform direction
+#define FFTW_FORWARD -1
+#define FFTW_INVERSE 1
+#define FFTW_BACKWARD 1
+
+// Planner flags
+#define FFTW_ESTIMATE 0x01
+#define FFTW_MEASURE 0x02
+#define FFTW_PATIENT 0x03
+#define FFTW_EXHAUSTIVE 0x04
+#define FFTW_WISDOM_ONLY 0x05
+
+// Algorithm restriction flags
+#define FFTW_DESTROY_INPUT 0x08
+#define FFTW_PRESERVE_INPUT 0x0C
+#define FFTW_UNALIGNED 0x10
+
+// CUFFTW defines and supports the following data types
+
+// note if complex.h has been included we use the C99 complex types
+#if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined (complex)
+ typedef double _Complex fftw_complex;
+ typedef float _Complex fftwf_complex;
+#else
+ typedef double fftw_complex[2];
+ typedef float fftwf_complex[2];
+#endif
+
+typedef void *fftw_plan;
+
+typedef void *fftwf_plan;
+
+typedef struct {
+ int n;
+ int is;
+ int os;
+} fftw_iodim;
+
+typedef fftw_iodim fftwf_iodim;
+
+typedef struct {
+ ptrdiff_t n;
+ ptrdiff_t is;
+ ptrdiff_t os;
+} fftw_iodim64;
+
+typedef fftw_iodim64 fftwf_iodim64;
+
+// CUFFTW defines and supports the following double precision APIs
+
+fftw_plan CUFFTAPI fftw_plan_dft_1d(int n,
+ fftw_complex *in,
+ fftw_complex *out,
+ int sign,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_2d(int n0,
+ int n1,
+ fftw_complex *in,
+ fftw_complex *out,
+ int sign,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_3d(int n0,
+ int n1,
+ int n2,
+ fftw_complex *in,
+ fftw_complex *out,
+ int sign,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft(int rank,
+ const int *n,
+ fftw_complex *in,
+ fftw_complex *out,
+ int sign,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_r2c_1d(int n,
+ double *in,
+ fftw_complex *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_r2c_2d(int n0,
+ int n1,
+ double *in,
+ fftw_complex *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_r2c_3d(int n0,
+ int n1,
+ int n2,
+ double *in,
+ fftw_complex *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_r2c(int rank,
+ const int *n,
+ double *in,
+ fftw_complex *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_c2r_1d(int n,
+ fftw_complex *in,
+ double *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_c2r_2d(int n0,
+ int n1,
+ fftw_complex *in,
+ double *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_c2r_3d(int n0,
+ int n1,
+ int n2,
+ fftw_complex *in,
+ double *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_dft_c2r(int rank,
+ const int *n,
+ fftw_complex *in,
+ double *out,
+ unsigned flags);
+
+
+fftw_plan CUFFTAPI fftw_plan_many_dft(int rank,
+ const int *n,
+ int batch,
+ fftw_complex *in,
+ const int *inembed, int istride, int idist,
+ fftw_complex *out,
+ const int *onembed, int ostride, int odist,
+ int sign, unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_many_dft_r2c(int rank,
+ const int *n,
+ int batch,
+ double *in,
+ const int *inembed, int istride, int idist,
+ fftw_complex *out,
+ const int *onembed, int ostride, int odist,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_many_dft_c2r(int rank,
+ const int *n,
+ int batch,
+ fftw_complex *in,
+ const int *inembed, int istride, int idist,
+ double *out,
+ const int *onembed, int ostride, int odist,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_guru_dft(int rank, const fftw_iodim *dims,
+ int batch_rank, const fftw_iodim *batch_dims,
+ fftw_complex *in, fftw_complex *out,
+ int sign, unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_guru_dft_r2c(int rank, const fftw_iodim *dims,
+ int batch_rank, const fftw_iodim *batch_dims,
+ double *in, fftw_complex *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_guru_dft_c2r(int rank, const fftw_iodim *dims,
+ int batch_rank, const fftw_iodim *batch_dims,
+ fftw_complex *in, double *out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_guru64_dft(int rank, const fftw_iodim64* dims,
+ int batch_rank, const fftw_iodim64* batch_dims,
+ fftw_complex* in, fftw_complex* out,
+ int sign, unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_guru64_dft_r2c(int rank, const fftw_iodim64* dims,
+ int batch_rank, const fftw_iodim64* batch_dims,
+ double* in, fftw_complex* out,
+ unsigned flags);
+
+fftw_plan CUFFTAPI fftw_plan_guru64_dft_c2r(int rank, const fftw_iodim64* dims,
+ int batch_rank, const fftw_iodim64* batch_dims,
+ fftw_complex* in, double* out,
+ unsigned flags);
+
+void CUFFTAPI fftw_execute(const fftw_plan plan);
+
+void CUFFTAPI fftw_execute_dft(const fftw_plan plan,
+ fftw_complex *idata,
+ fftw_complex *odata);
+
+void CUFFTAPI fftw_execute_dft_r2c(const fftw_plan plan,
+ double *idata,
+ fftw_complex *odata);
+
+void CUFFTAPI fftw_execute_dft_c2r(const fftw_plan plan,
+ fftw_complex *idata,
+ double *odata);
+
+// CUFFTW defines and supports the following single precision APIs
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_1d(int n,
+ fftwf_complex *in,
+ fftwf_complex *out,
+ int sign,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_2d(int n0,
+ int n1,
+ fftwf_complex *in,
+ fftwf_complex *out,
+ int sign,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_3d(int n0,
+ int n1,
+ int n2,
+ fftwf_complex *in,
+ fftwf_complex *out,
+ int sign,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft(int rank,
+ const int *n,
+ fftwf_complex *in,
+ fftwf_complex *out,
+ int sign,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_r2c_1d(int n,
+ float *in,
+ fftwf_complex *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_r2c_2d(int n0,
+ int n1,
+ float *in,
+ fftwf_complex *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_r2c_3d(int n0,
+ int n1,
+ int n2,
+ float *in,
+ fftwf_complex *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_r2c(int rank,
+ const int *n,
+ float *in,
+ fftwf_complex *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_c2r_1d(int n,
+ fftwf_complex *in,
+ float *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_c2r_2d(int n0,
+ int n1,
+ fftwf_complex *in,
+ float *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_c2r_3d(int n0,
+ int n1,
+ int n2,
+ fftwf_complex *in,
+ float *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_dft_c2r(int rank,
+ const int *n,
+ fftwf_complex *in,
+ float *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_many_dft(int rank,
+ const int *n,
+ int batch,
+ fftwf_complex *in,
+ const int *inembed, int istride, int idist,
+ fftwf_complex *out,
+ const int *onembed, int ostride, int odist,
+ int sign, unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_many_dft_r2c(int rank,
+ const int *n,
+ int batch,
+ float *in,
+ const int *inembed, int istride, int idist,
+ fftwf_complex *out,
+ const int *onembed, int ostride, int odist,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_many_dft_c2r(int rank,
+ const int *n,
+ int batch,
+ fftwf_complex *in,
+ const int *inembed, int istride, int idist,
+ float *out,
+ const int *onembed, int ostride, int odist,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_guru_dft(int rank, const fftwf_iodim *dims,
+ int batch_rank, const fftwf_iodim *batch_dims,
+ fftwf_complex *in, fftwf_complex *out,
+ int sign, unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_guru_dft_r2c(int rank, const fftwf_iodim *dims,
+ int batch_rank, const fftwf_iodim *batch_dims,
+ float *in, fftwf_complex *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_guru_dft_c2r(int rank, const fftwf_iodim *dims,
+ int batch_rank, const fftwf_iodim *batch_dims,
+ fftwf_complex *in, float *out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_guru64_dft(int rank, const fftwf_iodim64* dims,
+ int batch_rank, const fftwf_iodim64* batch_dims,
+ fftwf_complex* in, fftwf_complex* out,
+ int sign, unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_guru64_dft_r2c(int rank, const fftwf_iodim64* dims,
+ int batch_rank, const fftwf_iodim64* batch_dims,
+ float* in, fftwf_complex* out,
+ unsigned flags);
+
+fftwf_plan CUFFTAPI fftwf_plan_guru64_dft_c2r(int rank, const fftwf_iodim64* dims,
+ int batch_rank, const fftwf_iodim64* batch_dims,
+ fftwf_complex* in, float* out,
+ unsigned flags);
+
+void CUFFTAPI fftwf_execute(const fftw_plan plan);
+
+void CUFFTAPI fftwf_execute_dft(const fftwf_plan plan,
+ fftwf_complex *idata,
+ fftwf_complex *odata);
+
+void CUFFTAPI fftwf_execute_dft_r2c(const fftwf_plan plan,
+ float *idata,
+ fftwf_complex *odata);
+
+void CUFFTAPI fftwf_execute_dft_c2r(const fftwf_plan plan,
+ fftwf_complex *idata,
+ float *odata);
+
+#ifdef _WIN32
+#define _CUFFTAPI(T) T CUFFTAPI
+#else
+#define _CUFFTAPI(T) CUFFTAPI T
+#endif
+
+// CUFFTW defines and supports the following support APIs
+
+_CUFFTAPI(void *) fftw_malloc(size_t n);
+
+_CUFFTAPI(void *) fftwf_malloc(size_t n);
+
+void CUFFTAPI fftw_free(void *pointer);
+
+void CUFFTAPI fftwf_free(void *pointer);
+
+void CUFFTAPI fftw_export_wisdom_to_file(FILE * output_file);
+
+void CUFFTAPI fftwf_export_wisdom_to_file(FILE * output_file);
+
+int CUFFTAPI fftw_import_wisdom_from_file(FILE * input_file);
+
+int CUFFTAPI fftwf_import_wisdom_from_file(FILE * input_file);
+
+void CUFFTAPI fftw_print_plan(const fftw_plan plan);
+
+void CUFFTAPI fftwf_print_plan(const fftwf_plan plan);
+
+void CUFFTAPI fftw_set_timelimit(double seconds);
+
+void CUFFTAPI fftwf_set_timelimit(double seconds);
+
+double CUFFTAPI fftw_cost(const fftw_plan plan);
+
+double CUFFTAPI fftwf_cost(const fftw_plan plan);
+
+void CUFFTAPI fftw_flops(const fftw_plan plan, double *add, double *mul, double *fma);
+
+void CUFFTAPI fftwf_flops(const fftw_plan plan, double *add, double *mul, double *fma);
+
+void CUFFTAPI fftw_destroy_plan(fftw_plan plan);
+
+void CUFFTAPI fftwf_destroy_plan(fftwf_plan plan);
+
+void CUFFTAPI fftw_cleanup(void);
+
+void CUFFTAPI fftwf_cleanup(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _CUFFTW_H_ */
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/lib/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufft/lib/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/include/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/include/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/include/cufile.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/include/cufile.h
new file mode 100644
index 0000000000000000000000000000000000000000..f035cb6638e5f79abeaca57760adca001d414ae6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/include/cufile.h
@@ -0,0 +1,738 @@
+/*
+ * Copyright 1993-2023 NVIDIA Corporation. All rights reserved.
+ *
+ * NOTICE TO LICENSEE:
+ *
+ * This source code and/or documentation ("Licensed Deliverables") are
+ * subject to NVIDIA intellectual property rights under U.S. and
+ * international Copyright laws.
+ *
+ * These Licensed Deliverables contained herein is PROPRIETARY and
+ * CONFIDENTIAL to NVIDIA and is being provided under the terms and
+ * conditions of a form of NVIDIA software license agreement by and
+ * between NVIDIA and Licensee ("License Agreement") or electronically
+ * accepted by Licensee. Notwithstanding any terms or conditions to
+ * the contrary in the License Agreement, reproduction or disclosure
+ * of the Licensed Deliverables to any third party without the express
+ * written consent of NVIDIA is prohibited.
+ *
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, NVIDIA MAKES NO REPRESENTATION ABOUT THE
+ * SUITABILITY OF THESE LICENSED DELIVERABLES FOR ANY PURPOSE. IT IS
+ * PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND.
+ * NVIDIA DISCLAIMS ALL WARRANTIES WITH REGARD TO THESE LICENSED
+ * DELIVERABLES, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE.
+ * NOTWITHSTANDING ANY TERMS OR CONDITIONS TO THE CONTRARY IN THE
+ * LICENSE AGREEMENT, IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THESE LICENSED DELIVERABLES.
+ *
+ * U.S. Government End Users. These Licensed Deliverables are a
+ * "commercial item" as that term is defined at 48 C.F.R. 2.101 (OCT
+ * 1995), consisting of "commercial computer software" and "commercial
+ * computer software documentation" as such terms are used in 48
+ * C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Government
+ * only as a commercial end item. Consistent with 48 C.F.R.12.212 and
+ * 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), all
+ * U.S. Government End Users acquire the Licensed Deliverables with
+ * only those rights set forth herein.
+ *
+ * Any use of the Licensed Deliverables in individual and commercial
+ * software must include, in the user documentation and internal
+ * comments to the code, the above Disclaimer and U.S. Government End
+ * Users Notice.
+ */
+
+/**
+ * @file cufile.h
+ * @brief cuFile C APIs
+ *
+ * This file contains all the C APIs to perform GPUDirect Storage supported IO operations
+ */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/// @cond DOXYGEN_SKIP_MACRO
+#ifndef __CUFILE_H_
+#define __CUFILE_H_
+
+#include
+#include
+
+#include
+#include
+#include
+
+#define CUFILEOP_BASE_ERR 5000
+
+//Note :Data path errors are captured via standard error codes
+#define CUFILEOP_STATUS_ENTRIES \
+ CUFILE_OP(0, CU_FILE_SUCCESS, cufile success) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 1, CU_FILE_DRIVER_NOT_INITIALIZED, nvidia-fs driver is not loaded. Set allow_compat_mode to true in cufile.json file to enable compatible mode) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 2, CU_FILE_DRIVER_INVALID_PROPS, invalid property) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 3, CU_FILE_DRIVER_UNSUPPORTED_LIMIT, property range error) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 4, CU_FILE_DRIVER_VERSION_MISMATCH, nvidia-fs driver version mismatch) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 5, CU_FILE_DRIVER_VERSION_READ_ERROR, nvidia-fs driver version read error) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 6, CU_FILE_DRIVER_CLOSING, driver shutdown in progress) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 7, CU_FILE_PLATFORM_NOT_SUPPORTED, GPUDirect Storage not supported on current platform) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 8, CU_FILE_IO_NOT_SUPPORTED, GPUDirect Storage not supported on current file) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 9, CU_FILE_DEVICE_NOT_SUPPORTED, GPUDirect Storage not supported on current GPU) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 10, CU_FILE_NVFS_DRIVER_ERROR, nvidia-fs driver ioctl error) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 11, CU_FILE_CUDA_DRIVER_ERROR, CUDA Driver API error) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 12, CU_FILE_CUDA_POINTER_INVALID, invalid device pointer) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 13, CU_FILE_CUDA_MEMORY_TYPE_INVALID, invalid pointer memory type) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 14, CU_FILE_CUDA_POINTER_RANGE_ERROR, pointer range exceeds allocated address range) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 15, CU_FILE_CUDA_CONTEXT_MISMATCH, cuda context mismatch) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 16, CU_FILE_INVALID_MAPPING_SIZE, access beyond maximum pinned size) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 17, CU_FILE_INVALID_MAPPING_RANGE, access beyond mapped size) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 18, CU_FILE_INVALID_FILE_TYPE, unsupported file type) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 19, CU_FILE_INVALID_FILE_OPEN_FLAG, unsupported file open flags) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 20, CU_FILE_DIO_NOT_SET, fd direct IO not set) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 22, CU_FILE_INVALID_VALUE, invalid arguments) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 23, CU_FILE_MEMORY_ALREADY_REGISTERED, device pointer already registered) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 24, CU_FILE_MEMORY_NOT_REGISTERED, device pointer lookup failure) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 25, CU_FILE_PERMISSION_DENIED, driver or file access error) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 26, CU_FILE_DRIVER_ALREADY_OPEN, driver is already open) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 27, CU_FILE_HANDLE_NOT_REGISTERED, file descriptor is not registered) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 28, CU_FILE_HANDLE_ALREADY_REGISTERED, file descriptor is already registered) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 29, CU_FILE_DEVICE_NOT_FOUND, GPU device not found) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 30, CU_FILE_INTERNAL_ERROR, internal error) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 31, CU_FILE_GETNEWFD_FAILED, failed to obtain new file descriptor) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 33, CU_FILE_NVFS_SETUP_ERROR, NVFS driver initialization error) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 34, CU_FILE_IO_DISABLED, GPUDirect Storage disabled by config on current file)\
+ CUFILE_OP(CUFILEOP_BASE_ERR + 35, CU_FILE_BATCH_SUBMIT_FAILED, failed to submit batch operation)\
+ CUFILE_OP(CUFILEOP_BASE_ERR + 36, CU_FILE_GPU_MEMORY_PINNING_FAILED, failed to allocate pinned GPU Memory) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 37, CU_FILE_BATCH_FULL, queue full for batch operation) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 38, CU_FILE_ASYNC_NOT_SUPPORTED, cuFile stream operation not supported) \
+ CUFILE_OP(CUFILEOP_BASE_ERR + 39, CU_FILE_IO_MAX_ERROR, GPUDirect Storage Max Error)
+
+
+/**
+ * @brief cufileop status enum
+ *
+ * @note on success the error code is set to @ref CU_FILE_SUCCESS.
+ * @note The error code can be inspected using @ref IS_CUFILE_ERR and @ref CUFILE_ERRSTR.
+ * @note The error code if set to @ref CU_FILE_CUDA_DRIVER_ERROR, then cuda error can be inspected using @ref IS_CUDA_ERR and @ref CU_FILE_CUDA_ERR.
+ * @note Data path errors are captured via standard error codes
+ */
+typedef enum CUfileOpError {
+ /// @cond DOXYGEN_SKIP_MACRO
+ #define CUFILE_OP(code, name, string) name = code,
+ CUFILEOP_STATUS_ENTRIES
+ #undef CUFILE_OP
+ ///@endcond
+} CUfileOpError;
+
+/// @endcond
+
+/**
+ * @brief cufileop status string
+ */
+static inline const char *cufileop_status_error(CUfileOpError status)
+{
+ switch (status) {
+ /// @cond DOXYGEN_SKIP_MACRO
+ #define CUFILE_OP(code, name, string) \
+ case name: return #string;
+ CUFILEOP_STATUS_ENTRIES
+ #undef CUFILE_OP
+ ///@endcond
+ default:return "unknown cufile error";
+ }
+}
+
+/**
+ * @brief cufileop status string
+ */
+typedef struct CUfileError {
+
+ CUfileOpError err; // cufile error
+
+ CUresult cu_err; // cuda driver error
+
+}CUfileError_t;
+
+/**
+ * @brief error macros to inspect error status of type @ref CUfileOpError
+ */
+
+#define IS_CUFILE_ERR(err) \
+ (abs((err)) > CUFILEOP_BASE_ERR)
+
+#define CUFILE_ERRSTR(err) \
+ cufileop_status_error((CUfileOpError)abs((err)))
+
+#define IS_CUDA_ERR(status) \
+ ((status).err == CU_FILE_CUDA_DRIVER_ERROR)
+
+#define CU_FILE_CUDA_ERR(status) ((status).cu_err)
+
+/* driver properties */
+typedef enum CUfileDriverStatusFlags {
+ CU_FILE_LUSTRE_SUPPORTED = 0, /*!< Support for DDN LUSTRE */
+
+ CU_FILE_WEKAFS_SUPPORTED = 1, /*!< Support for WEKAFS */
+
+ CU_FILE_NFS_SUPPORTED = 2, /*!< Support for NFS */
+
+ CU_FILE_GPFS_SUPPORTED = 3, /*! < Support for GPFS */
+
+ CU_FILE_NVME_SUPPORTED = 4, /*!< Support for NVMe */
+
+ CU_FILE_NVMEOF_SUPPORTED = 5, /*!< Support for NVMeOF */
+
+ CU_FILE_SCSI_SUPPORTED = 6, /*!< Support for SCSI */
+
+ CU_FILE_SCALEFLUX_CSD_SUPPORTED = 7, /*!< Support for Scaleflux CSD*/
+
+ CU_FILE_NVMESH_SUPPORTED = 8, /*!< Support for NVMesh Block Dev*/
+ CU_FILE_BEEGFS_SUPPORTED = 9, /*!< Support for BeeGFS */
+
+}CUfileDriverStatusFlags_t;
+
+typedef enum CUfileDriverControlFlags {
+ CU_FILE_USE_POLL_MODE = 0 , /*!< use POLL mode. properties.use_poll_mode*/
+
+ CU_FILE_ALLOW_COMPAT_MODE = 1/*!< allow COMPATIBILITY mode. properties.allow_compat_mode*/
+
+}CUfileDriverControlFlags_t;
+
+typedef enum CUfileFeatureFlags {
+ CU_FILE_DYN_ROUTING_SUPPORTED = 0, /*!< Support for Dynamic routing to handle devices across the PCIe bridges */
+
+ CU_FILE_BATCH_IO_SUPPORTED = 1, /*!< Unsupported */
+
+ CU_FILE_STREAMS_SUPPORTED = 2, /*!< Unsupported */
+
+ CU_FILE_PARALLEL_IO_SUPPORTED = 3 /*!< Unsupported */
+}CUfileFeatureFlags_t;
+
+typedef struct CUfileDrvProps {
+ struct {
+ unsigned int major_version;
+
+ unsigned int minor_version;
+
+ size_t poll_thresh_size;
+
+ size_t max_direct_io_size;
+
+ unsigned int dstatusflags;
+
+ unsigned int dcontrolflags;
+
+ } nvfs;
+
+ unsigned int fflags;
+
+ unsigned int max_device_cache_size;
+
+ unsigned int per_buffer_cache_size;
+
+ unsigned int max_device_pinned_mem_size;
+
+ unsigned int max_batch_io_size;
+ unsigned int max_batch_io_timeout_msecs;
+}CUfileDrvProps_t;
+
+typedef struct sockaddr sockaddr_t;
+
+typedef struct cufileRDMAInfo
+{
+ int version;
+ int desc_len;
+ const char *desc_str;
+}cufileRDMAInfo_t;
+
+#define CU_FILE_RDMA_REGISTER 1
+#define CU_FILE_RDMA_RELAXED_ORDERING (1<<1)
+
+
+
+typedef struct CUfileFSOps {
+ /* NULL means discover using fstat */
+ const char* (*fs_type) (void *handle);
+
+ /* list of host addresses to use, NULL means no restriction */
+ int (*getRDMADeviceList)(void *handle, sockaddr_t **hostaddrs);
+
+ /* -1 no pref */
+ int (*getRDMADevicePriority)(void *handle, char*, size_t,
+ loff_t, sockaddr_t* hostaddr);
+
+ /* NULL means try VFS */
+ ssize_t (*read) (void *handle, char*, size_t, loff_t, cufileRDMAInfo_t*);
+ ssize_t (*write) (void *handle, const char *, size_t, loff_t , cufileRDMAInfo_t*);
+}CUfileFSOps_t;
+
+/* File Handle */
+enum CUfileFileHandleType {
+ CU_FILE_HANDLE_TYPE_OPAQUE_FD = 1, /*!< Linux based fd */
+
+ CU_FILE_HANDLE_TYPE_OPAQUE_WIN32 = 2, /*!< Windows based handle (unsupported) */
+
+ CU_FILE_HANDLE_TYPE_USERSPACE_FS = 3, /* Userspace based FS */
+};
+
+typedef struct CUfileDescr_t {
+ enum CUfileFileHandleType type; /* type of file being registered */
+ union {
+ int fd; /* Linux */
+ void *handle; /* Windows */
+ } handle;
+ const CUfileFSOps_t *fs_ops; /* file system operation table */
+}CUfileDescr_t;
+
+/**
+ * @brief File handle type
+ *
+ */
+typedef void* CUfileHandle_t;
+
+
+#pragma GCC visibility push(default)
+
+/**
+ * @brief cuFileHandleRegister is required, and performs extra checking that is memoized to provide increased performance on later cuFile operations.
+ *
+ * @param fh @ref CUfileHandle_t opaque file handle for IO operations
+ * @param descr @ref CUfileDescr_t file descriptor (OS agnostic)
+ *
+ * @return CU_FILE_SUCCESS on successful completion. fh will be updated for use in @ref cuFileRead, @ref cuFileWrite, @ref cuFileHandleDeregister
+ * @return CU_FILE_DRIVER_NOT_INITIALIZED on failure to load driver
+ * @return CU_FILE_IO_NOT_SUPPORTED - if filesystem is not supported
+ * @return CU_FILE_INVALID_VALUE if null or bad api arguments
+ * @return CU_FILE_INVALID_FILE_OPEN_FLAG if file is opened with unsupported modes like no O_DIRECT
+ * @return CU_FILE_INVALID_FILE_TYPE if filepath is not valid or is not a regular file
+ * @return CU_FILE_HANDLE_ALREADY_REGISTERED if file handle/descriptor is already registered
+ *
+ * Description
+ * cuFileHandleRegister registers the open file descriptor for use with cuFile IO operations.
+ *
+ * This API will ensure that the fileās descriptor is checked for GPUDirect Storage support and returns a valid file handle on CU_FILE_SUCCESS.
+ *
+ * @note the file needs to be opened in O_DIRECT mode to support GPUDirect Storage.
+ *
+ * @see cuFileRead
+ * @see cuFileWrite
+ * @see cuFileHandleDeregister
+ *
+ */
+CUfileError_t cuFileHandleRegister(CUfileHandle_t *fh, CUfileDescr_t *descr);
+
+/**
+ * @brief releases a registered filehandle from cuFile
+ *
+ * @param fh @ref CUfileHandle_t file handle
+ *
+ * @return void
+ *
+ * @see cuFileHandleRegister
+ */
+void cuFileHandleDeregister(CUfileHandle_t fh);
+
+/**
+ * @brief register an existing cudaMalloced memory with cuFile to pin for GPUDirect Storage access or
+ * register host allocated memory with cuFile.
+ *
+ * @param bufPtr_base buffer pointer allocated
+ * @param length size of memory region from the above specified bufPtr
+ * @param flags CU_FILE_RDMA_REGISTER
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_NVFS_DRIVER_ERROR
+ * @return CU_FILE_INVALID_VALUE
+ * @return CU_FILE_CUDA_ERROR for unsuported memory type
+ * @return CU_FILE_MEMORY_ALREADY_REGISTERED on error
+ * @return CU_FILE_GPU_MEMORY_PINNING_FAILED if not enough pinned memory is available
+ * @note This memory will be use to perform GPU direct DMA from the supported storage.
+ * @warning This API is intended for usecases where the memory is used as streaming buffer that is reused across multiple cuFile IO operations before calling @ref cuFileBufDeregister
+ *
+ * @see cuFileBufDeregister
+ * @see cuFileRead
+ * @see cuFileWrite
+ */
+CUfileError_t cuFileBufRegister(const void *bufPtr_base, size_t length, int flags);
+
+/**
+ * @brief deregister an already registered device or host memory from cuFile
+ *
+ * @param bufPtr_base buffer pointer to deregister
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_INVALID_VALUE on invalid memory pointer or unregistered memory pointer
+ *
+ * @see cuFileBufRegister
+ * @see cuFileRead
+ * @see cuFileWrite
+ */
+
+CUfileError_t cuFileBufDeregister(const void *bufPtr_base);
+
+/**
+ * @brief read data from a registered file handle to a specified device or host memory
+ *
+ * @param fh @ref CUfileHandle_t opaque file handle
+ * @param bufPtr_base base address of buffer in device or host memory
+ * @param size size bytes to read
+ * @param file_offset file-offset from begining of the file
+ * @param bufPtr_offset offset relative to the bufPtr_base pointer to read into.
+ *
+ * @return size of bytes successfully read
+ * @return -1 on error, in which case errno is set to indicate filesystem errors.
+ * @return all other errors will return a negative integer value of @ref CUfileOpError enum value.
+ *
+ * @note If the bufPtr is not registered with @ref cuFileBufRegister, the data will be buffered through preallocated pinned buffers if needed.
+ * @note This is useful for applications that need to perform IO to unaligned file offsets and/or size. This is also recommended
+ * for cases where the BAR1 memory size is smaller than the size of the allocated memory.
+ *
+ * @see cuFileBufRegister
+ * @see cuFileHandleRegister
+ * @see cuFileWrite
+ */
+
+ssize_t cuFileRead(CUfileHandle_t fh, void *bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset);
+
+/**
+ * @brief write data from a specified device or host memory to a registered file handle
+ *
+ * @param fh @ref CUfileHandle_t opaque file handle
+ * @param bufPtr_base base address of buffer in device or host memory
+ * @param size size bytes to write
+ * @param file_offset file-offset from begining of the file
+ * @param bufPtr_offset offset relative to the bufPtr_base pointer to write from.
+ *
+ * @return size of bytes successfully written
+ * @return -1 on error, in which case errno is set to indicate filesystem errors.
+ * @return all other errors will return a negative integer value of @ref CUfileOpError enum value.
+ *
+ * @note If the bufPtr is not registered with @ref cuFileBufRegister, the data will be buffered through preallocated pinned buffers if needed.
+ * @note This is useful for applications that need to perform IO to unaligned file offsets and/or size. This is also recommended
+ * for cases where the BAR1 memory size is smaller than the size of the allocated memory.
+ *
+ * @see cuFileBufRegister
+ * @see cuFileHandleRegister
+ * @see cuFileRead
+ */
+
+ssize_t cuFileWrite(CUfileHandle_t fh, const void *bufPtr_base, size_t size, off_t file_offset, off_t bufPtr_offset);
+
+// CUFile Driver APIs
+
+/**
+ * @brief
+ * Initialize the cuFile library and open the nvidia-fs driver
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_DRIVER_NOT_INITIALIZED
+ * @return CU_FILE_DRIVER_VERSION_MISMATCH on driver version mismatch error
+ *
+ * @see cuFileDriverClose
+ */
+CUfileError_t cuFileDriverOpen(void);
+
+CUfileError_t cuFileDriverClose(void);
+#define cuFileDriverClose cuFileDriverClose_v2
+/**
+ * @brief
+ * reset the cuFile library and release the nvidia-fs driver
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_DRIVER_CLOSING if there are any active IO operations using @ref cuFileRead or @ref cuFileWrite
+ *
+ * @see cuFileDriverOpen
+ */
+CUfileError_t cuFileDriverClose(void);
+
+/**
+ * @brief
+ * returns use count of cufile drivers at that moment by the process.
+ */
+long cuFileUseCount(void);
+
+/**
+ * @brief
+ * Gets the Driver session properties
+ *
+ * @return CU_FILE_SUCCESS on success
+ *
+ * @see cuFileDriverSetPollMode
+ * @see cuFileDriverSetMaxDirectIOSize
+ * @see cuFileDriverSetMaxCacheSize
+ * @see cuFileDriverSetMaxPinnedMemSize
+ */
+CUfileError_t cuFileDriverGetProperties(CUfileDrvProps_t *props);
+
+/**
+ * @brief
+ * Sets whether the Read/Write APIs use polling to do IO operations
+ *
+ * @param poll boolean to indicate whether to use poll mode or not
+ * @param poll_threshold_size max IO size to use for POLLING mode in KB
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
+ * @return CU_FILE_DRIVER_VERSION_MISMATCH, CU_FILE_DRIVER_UNSUPPORTED_LIMIT on error
+ *
+ * @warning This is an advanced command and should be tuned based on available system memory
+ *
+ * @see cuFileDriverGetProperties
+ */
+CUfileError_t cuFileDriverSetPollMode(bool poll, size_t poll_threshold_size);
+
+/**
+ * @brief
+ * Control parameter to set max IO size(KB) used by the library to talk to nvidia-fs driver
+ *
+ * @param max_direct_io_size maximum allowed direct io size in KB
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
+ * @return CU_FILE_DRIVER_VERSION_MISMATCH, CU_FILE_DRIVER_UNSUPPORTED_LIMIT on error
+ *
+ * @warning This is an advanced command and should be tuned based on available system memory
+ *
+ * @see cuFileDriverGetProperties
+ *
+ */
+CUfileError_t cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size);
+
+/**
+ * @brief
+ * Control parameter to set maximum GPU memory reserved per device by the library for internal buffering
+ *
+ * @param max_cache_size The maximum GPU buffer space per device used for internal use in KB
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
+ * @return CU_FILE_DRIVER_VERSION_MISMATCH, CU_FILE_DRIVER_UNSUPPORTED_LIMIT on error
+ *
+ * @warning This is an advanced command and should be tuned based on supported GPU memory
+ *
+ * @see cuFileDriverGetProperties
+ */
+CUfileError_t cuFileDriverSetMaxCacheSize(size_t max_cache_size);
+
+/**
+ * @brief
+ * Sets maximum buffer space that is pinned in KB for use by @ref cuFileBufRegister
+ *
+ * @param max_pinned_size maximum buffer space that is pinned in KB
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
+ * @return CU_FILE_DRIVER_VERSION_MISMATCH, CU_FILE_DRIVER_UNSUPPORTED_LIMIT on error
+ *
+ * @warning This is an advanced command and should be tuned based on supported GPU memory
+ *
+ * @see cuFileDriverGetProperties
+ *
+ */
+CUfileError_t cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size);
+
+//Experimental Batch API's
+
+
+typedef enum CUfileOpcode {
+ CUFILE_READ = 0,
+ CUFILE_WRITE
+}CUfileOpcode_t;
+
+typedef enum CUFILEStatus_enum {
+ CUFILE_WAITING = 0x000001, /* required value prior to submission */
+ CUFILE_PENDING = 0x000002, /* once enqueued */
+ CUFILE_INVALID = 0x000004, /* request was ill-formed or could not be enqueued */
+ CUFILE_CANCELED = 0x000008, /* request successfully canceled */
+ CUFILE_COMPLETE = 0x0000010, /* request successfully completed */
+ CUFILE_TIMEOUT = 0x0000020, /* request timed out */
+ CUFILE_FAILED = 0x0000040 /* unable to complete */
+}CUfileStatus_t;
+typedef enum cufileBatchMode {
+ CUFILE_BATCH = 1,
+} CUfileBatchMode_t;
+typedef struct CUfileIOParams {
+ CUfileBatchMode_t mode; // Must be the very first field.
+ union {
+ struct {
+ void *devPtr_base; //This can be a device memory or a host memory pointer.
+ off_t file_offset;
+ off_t devPtr_offset;
+ size_t size;
+ }batch;
+ }u;
+ CUfileHandle_t fh;
+ CUfileOpcode_t opcode;
+ void *cookie;
+}CUfileIOParams_t;
+typedef struct CUfileIOEvents {
+ void *cookie;
+ CUfileStatus_t status; /* status of the operation */
+ size_t ret; /* -ve error or amount of I/O done. */
+}CUfileIOEvents_t;
+
+typedef void* CUfileBatchHandle_t;
+
+CUfileError_t cuFileBatchIOSetUp(CUfileBatchHandle_t *batch_idp, unsigned nr);
+CUfileError_t cuFileBatchIOSubmit(CUfileBatchHandle_t batch_idp, unsigned nr, CUfileIOParams_t *iocbp, unsigned int flags);
+CUfileError_t cuFileBatchIOGetStatus(CUfileBatchHandle_t batch_idp, unsigned min_nr, unsigned* nr,
+ CUfileIOEvents_t *iocbp, struct timespec* timeout);
+CUfileError_t cuFileBatchIOCancel(CUfileBatchHandle_t batch_idp);
+void cuFileBatchIODestroy(CUfileBatchHandle_t batch_idp);
+
+//Async API's with cuda streams
+
+// cuFile stream API registration flags
+// buffer pointer offset is set at submission time
+#define CU_FILE_STREAM_FIXED_BUF_OFFSET 1
+// file offset is set at submission time
+#define CU_FILE_STREAM_FIXED_FILE_OFFSET 2
+// file size is set at submission time
+#define CU_FILE_STREAM_FIXED_FILE_SIZE 4
+// size, offset and buffer offset are 4k aligned
+#define CU_FILE_STREAM_PAGE_ALIGNED_INPUTS 8
+
+/**
+ *@brief
+
+ * @param fh The cuFile handle for the file.
+ * @param bufPtr_base base address of buffer in device or host memory
+ * @param size_p pointer to size bytes to read
+ * @note *size_p if the size is not known at the time of submission, then must provide the max possible size for I/O request.
+ * @param file_offset_p pointer to file-offset from begining of the file
+ * @param bufPtr_offset_p pointer to offset relative to the bufPtr_base pointer to read into.
+ * @param bytes_read_p pointer to the number of bytes that were successfully read.
+ * @param CUstream stream cuda stream for the operation.
+ *
+ * @return size of bytes successfully read in *bytes_read_p
+ * @return -1 on error, in which case errno is set to indicate filesystem errors.
+ * @return all other errors will return a negative integer value of @ref CUfileOpError enum value.
+ *
+ * @note If the bufPtr_base is not registered with @ref cuFileBufRegister, the data will be buffered through preallocated pinned buffers.
+ * @note This is useful for applications that need to perform IO to unaligned file offsets and/or size. This is also recommended
+ * for cases where the BAR1 memory size is smaller than the size of the allocated memory.
+ * @note If the stream is registered with cuFileStreamRegister, the IO setup and teardown overhead will be reduced.
+ * @note on cuda stream errors, the user must call cuFileStreamDeregister to release any outstanding cuFile resources for the stream.
+ *
+ *
+ * @see cuFileBufRegister
+ * @see cuFileHandleRegister
+ * @see cuFileRead
+ * @see cuFileStreamRegister
+ * @see cuFileStreamDeregister
+ */
+
+CUfileError_t cuFileReadAsync(CUfileHandle_t fh, void *bufPtr_base,
+ size_t *size_p, off_t *file_offset_p, off_t *bufPtr_offset_p, ssize_t *bytes_read_p, CUstream stream);
+
+/**
+ *@brief
+
+* @param fh The cuFile handle for the file.
+ * @param bufPtr_base base address of buffer in device or host memory
+ * @param size_p pointer to size bytes to write.
+ * @note *size_p if the size is not known at the time of submission, then must provide the max possible size for I/O request.
+ * @param file_offset_p pointer to file-offset from begining of the file
+ * @param bufPtr_offset_p pointer to offset relative to the bufPtr_base pointer to write from.
+ * @param bytes_written_p pointer to the number of bytes that were successfully written.
+ * @param CUstream cuda stream for the operation.
+ *
+ * @return size of bytes successfully written in *bytes_written_p
+ * @return -1 on error, in which case errno is set to indicate filesystem errors.
+ * @return all other errors will return a negative integer value of @ref CUfileOpError enum value.
+ *
+ * @note If the bufPtr_base is not registered with @ref cuFileBufRegister, the data will be buffered through preallocated pinned buffers.
+ * @note This is useful for applications that need to perform IO to unaligned file offsets and/or size. This is also recommended
+ * for cases where the BAR1 memory size is smaller than the size of the allocated memory.
+ * @note If the stream is registered with cuFileStreamRegister prior to this call, the IO setup and teardown overhead will be reduced.
+ * @note on cuda stream errors, the user must call cuFileStreamDeregister to release any outstanding cuFile resources for the stream.
+ *
+ * @see cuFileBufRegister
+ * @see cuFileHandleRegister
+ * @see cuFileWrite
+ * @see cuFileStreamRegister
+ * @see cuFileStreamDeregister
+ */
+
+CUfileError_t cuFileWriteAsync(CUfileHandle_t fh, void *bufPtr_base,
+ size_t *size_p, off_t *file_offset_p, off_t *bufPtr_offset_p, ssize_t *bytes_written_p, CUstream stream);
+
+/**
+ *@brief
+
+ * @param CUstream cuda stream for the operation.
+ * @param flags for the stream to improve the stream execution of IO based on input parameters.
+ * @note supported FLAGS are
+ * @note CU_FILE_STREAM_FIXED_BUF_OFFSET - buffer pointer offset is set at submission time
+ * @note CU_FILE_STREAM_FIXED_FILE_OFFSET - file offset is set at submission time
+ * @note CU_FILE_STREAM_FIXED_FILE_SIZE - file size is set at submission time
+ * @note CU_FILE_STREAM_PAGE_ALIGNED_INPUTS - size, offset and buffer offset are 4k aligned
+ *
+ * @note allocates resources needed to support cuFile operations asynchronously for the cuda stream
+ * @note This is useful for applications that need to perform IO to unaligned file offsets and/or size. This is also recommended
+ * for cases where the BAR1 memory size is smaller than the size of the allocated memory.
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
+ * @return CU_FILE_INVALID_VALUE if the stream is invalid
+ *
+ * @see cuFileReadAsync
+ * @see cuFileWriteAsync
+ * @see cuFileStreamDeregister
+ */
+
+CUfileError_t cuFileStreamRegister(CUstream stream, unsigned flags);
+
+/**
+ *@brief
+
+ * @param CUstream cuda stream for the operation.
+ *
+ * @note deallocates resources used by previous cuFile asynchronous operations for the cuda stream
+ * @note highly recommend to call after cuda stream errors to release any outstanding cuFile resources for this stream
+ * @note must be called before cuStreamDestroy call for the specified stream.
+ * @note This is useful for applications that need to perform IO to unaligned file offsets and/or size. This is also recommended
+ * for cases where the BAR1 memory size is smaller than the size of the allocated memory.
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_DRIVER_NOT_INITIALIZED if the driver is not initialized
+ * @return CU_FILE_INVALID_VALUE if the stream is invalid
+ *
+ * @see cuFileReadAsync
+ * @see cuFileWriteAsync
+ * @see cuFileStreamRegister
+ */
+
+CUfileError_t cuFileStreamDeregister(CUstream stream);
+
+/**
+ *@brief
+
+ * @returns cufile library version.
+ *
+ * @The version is returned as (1000 major + 10 minor).
+ * @For example, CUFILE 1.7.0 would be represented by 1070.
+ * @note This is useful for applications that need to inquire the library.
+ *
+ * @return CU_FILE_SUCCESS on success
+ * @return CU_FILE_INVALID_VALUE if the input parameter is null.
+ * @return CU_FILE_DRIVER_VERSION_READ_ERROR if the version is not available.
+ *
+ */
+
+CUfileError_t cuFileGetVersion(int *version);
+
+#pragma GCC visibility pop
+
+/// @cond DOXYGEN_SKIP_MACRO
+#endif // CUFILE_H
+/// @endcond
+#ifdef __cplusplus
+}
+#endif
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/lib/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/lib/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/lib/libcufile_rdma.so.1 b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/lib/libcufile_rdma.so.1
new file mode 100644
index 0000000000000000000000000000000000000000..ae4c65d661c568cf9eee2890c91ff2d8856254ab
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/cufile/lib/libcufile_rdma.so.1 differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/include/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/include/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/include/nvJitLink.h b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/include/nvJitLink.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc3efa2135bee586345b8ac13e73173c7293c2c5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/include/nvJitLink.h
@@ -0,0 +1,531 @@
+/*
+ * NVIDIA_COPYRIGHT_BEGIN
+ *
+ * Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved.
+ *
+ * NVIDIA CORPORATION and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA CORPORATION is strictly prohibited.
+ *
+ * NVIDIA_COPYRIGHT_END
+ */
+
+#ifndef nvJitLink_INCLUDED
+#define nvJitLink_INCLUDED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include
+#include
+
+/**
+ *
+ * \defgroup error Error codes
+ *
+ */
+
+/** \ingroup error
+ *
+ * \brief The enumerated type nvJitLinkResult defines API call result codes.
+ * nvJitLink APIs return nvJitLinkResult codes to indicate the result.
+ */
+
+typedef enum {
+ NVJITLINK_SUCCESS = 0,
+ NVJITLINK_ERROR_UNRECOGNIZED_OPTION,
+ NVJITLINK_ERROR_MISSING_ARCH, // -arch=sm_NN option not specified
+ NVJITLINK_ERROR_INVALID_INPUT,
+ NVJITLINK_ERROR_PTX_COMPILE,
+ NVJITLINK_ERROR_NVVM_COMPILE,
+ NVJITLINK_ERROR_INTERNAL,
+ NVJITLINK_ERROR_THREADPOOL,
+ NVJITLINK_ERROR_UNRECOGNIZED_INPUT,
+ NVJITLINK_ERROR_FINALIZE,
+#ifdef NEW_ERROR_CODES // These error codes will appear in a future CUDA release.
+ NVJITLINK_ERROR_NULL_INPUT,
+ NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS,
+ NVJITLINK_ERROR_INCORRECT_INPUT_TYPE,
+ NVJITLINK_ERROR_ARCH_MISMATCH,
+ NVJITLINK_ERROR_OUTDATED_LIBRARY,
+ NVJITLINK_ERROR_MISSING_FATBIN
+#endif
+} nvJitLinkResult;
+
+#ifndef NEW_ERROR_CODES // To avoid breaking compatibility, we map them to existing error codes for now.
+#define NVJITLINK_ERROR_NULL_INPUT NVJITLINK_ERROR_INVALID_INPUT
+#define NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS NVJITLINK_ERROR_INVALID_INPUT
+#define NVJITLINK_ERROR_INCORRECT_INPUT_TYPE NVJITLINK_ERROR_INVALID_INPUT
+#define NVJITLINK_ERROR_ARCH_MISMATCH NVJITLINK_ERROR_INTERNAL
+#define NVJITLINK_ERROR_OUTDATED_LIBRARY NVJITLINK_ERROR_INTERNAL
+#define NVJITLINK_ERROR_MISSING_FATBIN NVJITLINK_ERROR_INVALID_INPUT
+#endif
+
+/**
+ *
+ * \defgroup linking Linking
+ *
+ */
+
+/** \ingroup linking
+ *
+ * \brief The enumerated type nvJitLinkInputType defines the kind of inputs
+ * that can be passed to nvJitLinkAdd* APIs.
+ */
+
+typedef enum {
+ NVJITLINK_INPUT_NONE = 0, // error
+ NVJITLINK_INPUT_CUBIN = 1,
+ NVJITLINK_INPUT_PTX,
+ NVJITLINK_INPUT_LTOIR,
+ NVJITLINK_INPUT_FATBIN,
+ NVJITLINK_INPUT_OBJECT,
+ NVJITLINK_INPUT_LIBRARY,
+ NVJITLINK_INPUT_INDEX,
+ NVJITLINK_INPUT_ANY = 10 // will dynamically determine one of above types
+} nvJitLinkInputType;
+
+/**
+ * \defgroup options Supported Link Options
+ *
+ * nvJitLink supports the link options below.
+ * Option names are prefixed with a single dash (\c -).
+ * Options that take a value have an assignment operator (\c =)
+ * followed by the option value, with no spaces, e.g. \c "-arch=sm_90".
+ *
+ * The supported options are:
+ * - \c -arch=sm_ \n
+ * Pass SM architecture value. See nvcc for valid values of .
+ * Can use compute_ value instead if only generating PTX.
+ * This is a required option.
+ * - \c -maxrregcount= \n
+ * Maximum register count.
+ * - \c -time \n
+ * Print timing information to InfoLog.
+ * - \c -verbose \n
+ * Print verbose messages to InfoLog.
+ * - \c -lto \n
+ * Do link time optimization.
+ * - \c -ptx \n
+ * Emit ptx after linking instead of cubin; only supported with \c -lto
+ * - \c -O \n
+ * Optimization level. Only 0 and 3 are accepted.
+ * - \c -g \n
+ * Generate debug information.
+ * - \c -lineinfo \n
+ * Generate line information.
+ * - \c -ftz= \n
+ * Flush to zero.
+ * - \c -prec-div= \n
+ * Precise divide.
+ * - \c -prec-sqrt= \n
+ * Precise square root.
+ * - \c -fma= \n
+ * Fast multiply add.
+ * - \c -kernels-used= \n
+ * Pass list of kernels that are used; any not in the list can be removed.
+ * This option can be specified multiple times.
+ * - \c -variables-used= \n
+ * Pass list of variables that are used; any not in the list can be removed.
+ * This option can be specified multiple times.
+ * - \c -optimize-unused-variables \n
+ * Normally device code optimization is limited by not knowing what the
+ * host code references. With this option it can assume that if a variable
+ * is not referenced in device code then it can be removed.
+ * - \c -Xptxas= \n
+ * Pass to ptxas. This option can be called multiple times.
+ * - \c -split-compile= \n
+ * Split compilation maximum thread count. Use 0 to use all available processors.
+ * Value of 1 disables split compilation (default).
+ * - \c -split-compile-extended= \n
+ * A more aggressive form of split compilation available in LTO mode only.
+ * Accepts a maximum thread count value. Use 0 to use all available processors.
+ * Value of 1 disables extended split compilation (default).
+ * Note: This option can potentially impact performance of the compiled binary.
+ * - \c -jump-table-density= \n
+ * When doing LTO, specify the case density percentage in switch statements,
+ * and use it as a minimal threshold to determine whether jump table(brx.idx
+ * instruction) will be used to implement a switch statement. Default
+ * value is 101. The percentage ranges from 0 to 101 inclusively.
+ * - \c -no-cache \n
+ * Don't cache the intermediate steps of nvJitLink.
+ * - \c -device-stack-protector \n
+ * Enable stack canaries in device code.
+ * Stack canaries make it more difficult to exploit certain types of memory safety bugs involving stack-local variables.
+ * The compiler uses heuristics to assess the risk of such a bug in each function. Only those functions which are deemed high-risk make use of a stack canary.
+ */
+
+/**
+ * \ingroup linking
+ * \brief nvJitLinkHandle is the unit of linking, and an opaque handle for
+ * a program.
+ *
+ * To link inputs, an instance of nvJitLinkHandle must be created first with
+ * nvJitLinkCreate().
+ */
+
+typedef struct nvJitLink* nvJitLinkHandle; // opaque handle
+
+// For versioning we will have separate API version for each library version
+
+extern nvJitLinkResult __nvJitLinkCreate_12_6(
+ nvJitLinkHandle *handle,
+ uint32_t numOptions,
+ const char **options);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkCreate creates an instance of nvJitLinkHandle with the
+ * given input options, and sets the output parameter \p handle.
+ *
+ * \param [out] handle Address of nvJitLink handle.
+ * \param [in] numOptions Number of options passed.
+ * \param [in] options Array of size \p numOptions of option strings.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_UNRECOGNIZED_OPTION\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_MISSING_ARCH\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * It supports options listed in \ref options.
+ *
+ * \see nvJitLinkDestroy
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkCreate(
+ nvJitLinkHandle *handle,
+ uint32_t numOptions,
+ const char **options)
+{
+ return __nvJitLinkCreate_12_6 (handle, numOptions, options);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkDestroy_12_6 (nvJitLinkHandle *handle);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkDestroy frees the memory associated with the given handle
+ * and sets it to NULL.
+ *
+ * \param [in] handle Address of nvJitLink handle.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * \see nvJitLinkCreate
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkDestroy (nvJitLinkHandle *handle)
+{
+ return __nvJitLinkDestroy_12_6 (handle);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkAddData_12_6(
+ nvJitLinkHandle handle,
+ nvJitLinkInputType inputType,
+ const void *data,
+ size_t size,
+ const char *name); // name can be null
+/**
+ * \ingroup linking
+ * \brief nvJitLinkAddData adds data image to the link.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [in] inputType kind of input.
+ * \param [in] data pointer to data image in memory.
+ * \param [in] size size of the data.
+ * \param [in] name name of input object.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkAddData(
+ nvJitLinkHandle handle,
+ nvJitLinkInputType inputType,
+ const void *data,
+ size_t size,
+ const char *name) // name can be null
+{
+ return __nvJitLinkAddData_12_6 (handle, inputType, data, size, name);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkAddFile_12_6(
+ nvJitLinkHandle handle,
+ nvJitLinkInputType inputType,
+ const char *fileName); // includes path to file
+/**
+ * \ingroup linking
+ * \brief nvJitLinkAddFile reads data from file and links it in.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [in] inputType kind of input.
+ * \param [in] fileName name of file.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkAddFile(
+ nvJitLinkHandle handle,
+ nvJitLinkInputType inputType,
+ const char *fileName) // includes path to file
+{
+ return __nvJitLinkAddFile_12_6 (handle, inputType, fileName);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkComplete_12_6 (nvJitLinkHandle handle);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkComplete does the actual link.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkComplete (nvJitLinkHandle handle)
+{
+ return __nvJitLinkComplete_12_6 (handle);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkGetLinkedCubinSize_12_6(
+ nvJitLinkHandle handle,
+ size_t *size);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkGetLinkedCubinSize gets the size of the linked cubin.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [out] size Size of the linked cubin.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * \see nvJitLinkGetLinkedCubin
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkGetLinkedCubinSize(
+ nvJitLinkHandle handle,
+ size_t *size)
+{
+ return __nvJitLinkGetLinkedCubinSize_12_6 (handle, size);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkGetLinkedCubin_12_6(
+ nvJitLinkHandle handle,
+ void *cubin);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkGetLinkedCubin gets the linked cubin.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [out] cubin The linked cubin.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * User is responsible for allocating enough space to hold the \p cubin.
+ * \see nvJitLinkGetLinkedCubinSize
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkGetLinkedCubin(
+ nvJitLinkHandle handle,
+ void *cubin)
+{
+ return __nvJitLinkGetLinkedCubin_12_6 (handle, cubin);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkGetLinkedPtxSize_12_6(
+ nvJitLinkHandle handle,
+ size_t *size);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkGetLinkedPtxSize gets the size of the linked ptx.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [out] size Size of the linked PTX.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * Linked PTX is only available when using the \c -lto option.
+ * \see nvJitLinkGetLinkedPtx
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkGetLinkedPtxSize(
+ nvJitLinkHandle handle,
+ size_t *size)
+{
+ return __nvJitLinkGetLinkedPtxSize_12_6 (handle, size);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkGetLinkedPtx_12_6(
+ nvJitLinkHandle handle,
+ char *ptx);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkGetLinkedPtx gets the linked ptx.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [out] ptx The linked PTX.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * Linked PTX is only available when using the \c -lto option.
+ * User is responsible for allocating enough space to hold the \p ptx.
+ * \see nvJitLinkGetLinkedPtxSize
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkGetLinkedPtx(
+ nvJitLinkHandle handle,
+ char *ptx)
+{
+ return __nvJitLinkGetLinkedPtx_12_6 (handle, ptx);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkGetErrorLogSize_12_6(
+ nvJitLinkHandle handle,
+ size_t *size);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkGetErrorLogSize gets the size of the error log.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [out] size Size of the error log.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * \see nvJitLinkGetErrorLog
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkGetErrorLogSize(
+ nvJitLinkHandle handle,
+ size_t *size)
+{
+ return __nvJitLinkGetErrorLogSize_12_6 (handle, size);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkGetErrorLog_12_6(
+ nvJitLinkHandle handle,
+ char *log);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkGetErrorLog puts any error messages in the log.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [out] log The error log.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * User is responsible for allocating enough space to hold the \p log.
+ * \see nvJitLinkGetErrorLogSize
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkGetErrorLog(
+ nvJitLinkHandle handle,
+ char *log)
+{
+ return __nvJitLinkGetErrorLog_12_6 (handle, log);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkGetInfoLogSize_12_6(
+ nvJitLinkHandle handle,
+ size_t *size);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkGetInfoLogSize gets the size of the info log.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [out] size Size of the info log.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * \see nvJitLinkGetInfoLog
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkGetInfoLogSize(
+ nvJitLinkHandle handle,
+ size_t *size)
+{
+ return __nvJitLinkGetInfoLogSize_12_6 (handle, size);
+}
+#endif
+
+extern nvJitLinkResult __nvJitLinkGetInfoLog_12_6(
+ nvJitLinkHandle handle,
+ char *log);
+/**
+ * \ingroup linking
+ * \brief nvJitLinkGetInfoLog puts any info messages in the log.
+ *
+ * \param [in] handle nvJitLink handle.
+ * \param [out] log The info log.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ * User is responsible for allocating enough space to hold the \p log.
+ * \see nvJitLinkGetInfoLogSize
+ */
+#ifndef NVJITLINK_NO_INLINE
+static inline nvJitLinkResult nvJitLinkGetInfoLog(
+ nvJitLinkHandle handle,
+ char *log)
+{
+ return __nvJitLinkGetInfoLog_12_6 (handle, log);
+}
+#endif
+
+/**
+ * \ingroup linking
+ * \brief nvJitLinkVersion returns the current version of nvJitLink.
+ *
+ * \param [out] major The major version.
+ * \param [out] minor The minor version.
+ * \return
+ * - \link #nvJitLinkResult NVJITLINK_SUCCESS \endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INVALID_INPUT\endlink
+ * - \link #nvJitLinkResult NVJITLINK_ERROR_INTERNAL\endlink
+ *
+ */
+extern nvJitLinkResult nvJitLinkVersion(
+ unsigned int *major,
+ unsigned int *minor);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // nvJitLink_INCLUDED
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/lib/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia/nvjitlink/lib/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/INSTALLER b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/INSTALLER
new file mode 100644
index 0000000000000000000000000000000000000000..5c69047b2eb8235994febeeae1da4a82365a240a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/INSTALLER
@@ -0,0 +1 @@
+uv
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/License.txt b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/License.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b491c70e0aef319022ded661e111ddbd45b8a17f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/License.txt
@@ -0,0 +1,1568 @@
+End User License Agreement
+--------------------------
+
+
+Preface
+-------
+
+The Software License Agreement in Chapter 1 and the Supplement
+in Chapter 2 contain license terms and conditions that govern
+the use of NVIDIA software. By accepting this agreement, you
+agree to comply with all the terms and conditions applicable
+to the product(s) included herein.
+
+
+NVIDIA Driver
+
+
+Description
+
+This package contains the operating system driver and
+fundamental system software components for NVIDIA GPUs.
+
+
+NVIDIA CUDA Toolkit
+
+
+Description
+
+The NVIDIA CUDA Toolkit provides command-line and graphical
+tools for building, debugging and optimizing the performance
+of applications accelerated by NVIDIA GPUs, runtime and math
+libraries, and documentation including programming guides,
+user manuals, and API references.
+
+
+Default Install Location of CUDA Toolkit
+
+Windows platform:
+
+%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v#.#
+
+Linux platform:
+
+/usr/local/cuda-#.#
+
+Mac platform:
+
+/Developer/NVIDIA/CUDA-#.#
+
+
+NVIDIA CUDA Samples
+
+
+Description
+
+This package includes over 100+ CUDA examples that demonstrate
+various CUDA programming principles, and efficient CUDA
+implementation of algorithms in specific application domains.
+
+
+Default Install Location of CUDA Samples
+
+Windows platform:
+
+%ProgramData%\NVIDIA Corporation\CUDA Samples\v#.#
+
+Linux platform:
+
+/usr/local/cuda-#.#/samples
+
+and
+
+$HOME/NVIDIA_CUDA-#.#_Samples
+
+Mac platform:
+
+/Developer/NVIDIA/CUDA-#.#/samples
+
+
+NVIDIA Nsight Visual Studio Edition (Windows only)
+
+
+Description
+
+NVIDIA Nsight Development Platform, Visual Studio Edition is a
+development environment integrated into Microsoft Visual
+Studio that provides tools for debugging, profiling, analyzing
+and optimizing your GPU computing and graphics applications.
+
+
+Default Install Location of Nsight Visual Studio Edition
+
+Windows platform:
+
+%ProgramFiles(x86)%\NVIDIA Corporation\Nsight Visual Studio Edition #.#
+
+
+1. License Agreement for NVIDIA Software Development Kits
+---------------------------------------------------------
+
+
+Release Date: July 26, 2018
+---------------------------
+
+
+Important NoticeRead before downloading, installing,
+copying or using the licensed software:
+-------------------------------------------------------
+
+This license agreement, including exhibits attached
+("Agreementā) is a legal agreement between you and NVIDIA
+Corporation ("NVIDIA") and governs your use of a NVIDIA
+software development kit (āSDKā).
+
+Each SDK has its own set of software and materials, but here
+is a description of the types of items that may be included in
+a SDK: source code, header files, APIs, data sets and assets
+(examples include images, textures, models, scenes, videos,
+native API input/output files), binary software, sample code,
+libraries, utility programs, programming code and
+documentation.
+
+This Agreement can be accepted only by an adult of legal age
+of majority in the country in which the SDK is used.
+
+If you are entering into this Agreement on behalf of a company
+or other legal entity, you represent that you have the legal
+authority to bind the entity to this Agreement, in which case
+āyouā will mean the entity you represent.
+
+If you donāt have the required age or authority to accept
+this Agreement, or if you donāt accept all the terms and
+conditions of this Agreement, do not download, install or use
+the SDK.
+
+You agree to use the SDK only for purposes that are permitted
+by (a) this Agreement, and (b) any applicable law, regulation
+or generally accepted practices or guidelines in the relevant
+jurisdictions.
+
+
+1.1. License
+
+
+1.1.1. License Grant
+
+Subject to the terms of this Agreement, NVIDIA hereby grants
+you a non-exclusive, non-transferable license, without the
+right to sublicense (except as expressly provided in this
+Agreement) to:
+
+ 1. Install and use the SDK,
+
+ 2. Modify and create derivative works of sample source code
+ delivered in the SDK, and
+
+ 3. Distribute those portions of the SDK that are identified
+ in this Agreement as distributable, as incorporated in
+ object code format into a software application that meets
+ the distribution requirements indicated in this Agreement.
+
+
+1.1.2. Distribution Requirements
+
+These are the distribution requirements for you to exercise
+the distribution grant:
+
+ 1. Your application must have material additional
+ functionality, beyond the included portions of the SDK.
+
+ 2. The distributable portions of the SDK shall only be
+ accessed by your application.
+
+ 3. The following notice shall be included in modifications
+ and derivative works of sample source code distributed:
+ āThis software contains source code provided by NVIDIA
+ Corporation.ā
+
+ 4. Unless a developer tool is identified in this Agreement
+ as distributable, it is delivered for your internal use
+ only.
+
+ 5. The terms under which you distribute your application
+ must be consistent with the terms of this Agreement,
+ including (without limitation) terms relating to the
+ license grant and license restrictions and protection of
+ NVIDIAās intellectual property rights. Additionally, you
+ agree that you will protect the privacy, security and
+ legal rights of your application users.
+
+ 6. You agree to notify NVIDIA in writing of any known or
+ suspected distribution or use of the SDK not in compliance
+ with the requirements of this Agreement, and to enforce
+ the terms of your agreements with respect to distributed
+ SDK.
+
+
+1.1.3. Authorized Users
+
+You may allow employees and contractors of your entity or of
+your subsidiary(ies) to access and use the SDK from your
+secure network to perform work on your behalf.
+
+If you are an academic institution you may allow users
+enrolled or employed by the academic institution to access and
+use the SDK from your secure network.
+
+You are responsible for the compliance with the terms of this
+Agreement by your authorized users. If you become aware that
+your authorized users didnāt follow the terms of this
+Agreement, you agree to take reasonable steps to resolve the
+non-compliance and prevent new occurrences.
+
+
+1.1.4. Pre-Release SDK
+
+The SDK versions identified as alpha, beta, preview or
+otherwise as pre-release, may not be fully functional, may
+contain errors or design flaws, and may have reduced or
+different security, privacy, accessibility, availability, and
+reliability standards relative to commercial versions of
+NVIDIA software and materials. Use of a pre-release SDK may
+result in unexpected results, loss of data, project delays or
+other unpredictable damage or loss.
+
+You may use a pre-release SDK at your own risk, understanding
+that pre-release SDKs are not intended for use in production
+or business-critical systems.
+
+NVIDIA may choose not to make available a commercial version
+of any pre-release SDK. NVIDIA may also choose to abandon
+development and terminate the availability of a pre-release
+SDK at any time without liability.
+
+
+1.1.5. Updates
+
+NVIDIA may, at its option, make available patches, workarounds
+or other updates to this SDK. Unless the updates are provided
+with their separate governing terms, they are deemed part of
+the SDK licensed to you as provided in this Agreement. You
+agree that the form and content of the SDK that NVIDIA
+provides may change without prior notice to you. While NVIDIA
+generally maintains compatibility between versions, NVIDIA may
+in some cases make changes that introduce incompatibilities in
+future versions of the SDK.
+
+
+1.1.6. Third Party Licenses
+
+The SDK may come bundled with, or otherwise include or be
+distributed with, third party software licensed by a NVIDIA
+supplier and/or open source software provided under an open
+source license. Use of third party software is subject to the
+third-party license terms, or in the absence of third party
+terms, the terms of this Agreement. Copyright to third party
+software is held by the copyright holders indicated in the
+third-party software or license.
+
+
+1.1.7. Reservation of Rights
+
+NVIDIA reserves all rights, title, and interest in and to the
+SDK, not expressly granted to you under this Agreement.
+
+
+1.2. Limitations
+
+The following license limitations apply to your use of the
+SDK:
+
+ 1. You may not reverse engineer, decompile or disassemble,
+ or remove copyright or other proprietary notices from any
+ portion of the SDK or copies of the SDK.
+
+ 2. Except as expressly provided in this Agreement, you may
+ not copy, sell, rent, sublicense, transfer, distribute,
+ modify, or create derivative works of any portion of the
+ SDK. For clarity, you may not distribute or sublicense the
+ SDK as a stand-alone product.
+
+ 3. Unless you have an agreement with NVIDIA for this
+ purpose, you may not indicate that an application created
+ with the SDK is sponsored or endorsed by NVIDIA.
+
+ 4. You may not bypass, disable, or circumvent any
+ encryption, security, digital rights management or
+ authentication mechanism in the SDK.
+
+ 5. You may not use the SDK in any manner that would cause it
+ to become subject to an open source software license. As
+ examples, licenses that require as a condition of use,
+ modification, and/or distribution that the SDK be:
+
+ a. Disclosed or distributed in source code form;
+
+ b. Licensed for the purpose of making derivative works;
+ or
+
+ c. Redistributable at no charge.
+
+ 6. Unless you have an agreement with NVIDIA for this
+ purpose, you may not use the SDK with any system or
+ application where the use or failure of the system or
+ application can reasonably be expected to threaten or
+ result in personal injury, death, or catastrophic loss.
+ Examples include use in avionics, navigation, military,
+ medical, life support or other life critical applications.
+ NVIDIA does not design, test or manufacture the SDK for
+ these critical uses and NVIDIA shall not be liable to you
+ or any third party, in whole or in part, for any claims or
+ damages arising from such uses.
+
+ 7. You agree to defend, indemnify and hold harmless NVIDIA
+ and its affiliates, and their respective employees,
+ contractors, agents, officers and directors, from and
+ against any and all claims, damages, obligations, losses,
+ liabilities, costs or debt, fines, restitutions and
+ expenses (including but not limited to attorneyās fees
+ and costs incident to establishing the right of
+ indemnification) arising out of or related to your use of
+ the SDK outside of the scope of this Agreement, or not in
+ compliance with its terms.
+
+
+1.3. Ownership
+
+ 1. NVIDIA or its licensors hold all rights, title and
+ interest in and to the SDK and its modifications and
+ derivative works, including their respective intellectual
+ property rights, subject to your rights described in this
+ section. This SDK may include software and materials from
+ NVIDIAās licensors, and these licensors are intended
+ third party beneficiaries that may enforce this Agreement
+ with respect to their intellectual property rights.
+
+ 2. You hold all rights, title and interest in and to your
+ applications and your derivative works of the sample
+ source code delivered in the SDK, including their
+ respective intellectual property rights, subject to
+ NVIDIAās rights described in this section.
+
+ 3. You may, but donāt have to, provide to NVIDIA
+ suggestions, feature requests or other feedback regarding
+ the SDK, including possible enhancements or modifications
+ to the SDK. For any feedback that you voluntarily provide,
+ you hereby grant NVIDIA and its affiliates a perpetual,
+ non-exclusive, worldwide, irrevocable license to use,
+ reproduce, modify, license, sublicense (through multiple
+ tiers of sublicensees), and distribute (through multiple
+ tiers of distributors) it without the payment of any
+ royalties or fees to you. NVIDIA will use feedback at its
+ choice. NVIDIA is constantly looking for ways to improve
+ its products, so you may send feedback to NVIDIA through
+ the developer portal at https://developer.nvidia.com.
+
+
+1.4. No Warranties
+
+THE SDK IS PROVIDED BY NVIDIA āAS ISā AND āWITH ALL
+FAULTS.ā TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND
+ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND
+OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING,
+BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE
+ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO
+WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF
+DEALING OR COURSE OF TRADE.
+
+
+1.5. Limitation of Liability
+
+TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS
+AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
+PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS
+OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF
+PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION
+WITH THIS AGREEMENT OR THE USE OR PERFORMANCE OF THE SDK,
+WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH
+OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE),
+PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF
+LIABILITY. IN NO EVENT WILL NVIDIAāS AND ITS AFFILIATES
+TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS
+AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE
+NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS
+LIMIT.
+
+These exclusions and limitations of liability shall apply
+regardless if NVIDIA or its affiliates have been advised of
+the possibility of such damages, and regardless of whether a
+remedy fails its essential purpose. These exclusions and
+limitations of liability form an essential basis of the
+bargain between the parties, and, absent any of these
+exclusions or limitations of liability, the provisions of this
+Agreement, including, without limitation, the economic terms,
+would be substantially different.
+
+
+1.6. Termination
+
+ 1. This Agreement will continue to apply until terminated by
+ either you or NVIDIA as described below.
+
+ 2. If you want to terminate this Agreement, you may do so by
+ stopping to use the SDK.
+
+ 3. NVIDIA may, at any time, terminate this Agreement if:
+
+ a. (i) you fail to comply with any term of this
+ Agreement and the non-compliance is not fixed within
+ thirty (30) days following notice from NVIDIA (or
+ immediately if you violate NVIDIAās intellectual
+ property rights);
+
+ b. (ii) you commence or participate in any legal
+ proceeding against NVIDIA with respect to the SDK; or
+
+ c. (iii) NVIDIA decides to no longer provide the SDK in
+ a country or, in NVIDIAās sole discretion, the
+ continued use of it is no longer commercially viable.
+
+ 4. Upon any termination of this Agreement, you agree to
+ promptly discontinue use of the SDK and destroy all copies
+ in your possession or control. Your prior distributions in
+ accordance with this Agreement are not affected by the
+ termination of this Agreement. Upon written request, you
+ will certify in writing that you have complied with your
+ commitments under this section. Upon any termination of
+ this Agreement all provisions survive except for the
+ license grant provisions.
+
+
+1.7. General
+
+If you wish to assign this Agreement or your rights and
+obligations, including by merger, consolidation, dissolution
+or operation of law, contact NVIDIA to ask for permission. Any
+attempted assignment not approved by NVIDIA in writing shall
+be void and of no effect. NVIDIA may assign, delegate or
+transfer this Agreement and its rights and obligations, and if
+to a non-affiliate you will be notified.
+
+You agree to cooperate with NVIDIA and provide reasonably
+requested information to verify your compliance with this
+Agreement.
+
+This Agreement will be governed in all respects by the laws of
+the United States and of the State of Delaware as those laws
+are applied to contracts entered into and performed entirely
+within Delaware by Delaware residents, without regard to the
+conflicts of laws principles. The United Nations Convention on
+Contracts for the International Sale of Goods is specifically
+disclaimed. You agree to all terms of this Agreement in the
+English language.
+
+The state or federal courts residing in Santa Clara County,
+California shall have exclusive jurisdiction over any dispute
+or claim arising out of this Agreement. Notwithstanding this,
+you agree that NVIDIA shall still be allowed to apply for
+injunctive remedies or an equivalent type of urgent legal
+relief in any jurisdiction.
+
+If any court of competent jurisdiction determines that any
+provision of this Agreement is illegal, invalid or
+unenforceable, such provision will be construed as limited to
+the extent necessary to be consistent with and fully
+enforceable under the law and the remaining provisions will
+remain in full force and effect. Unless otherwise specified,
+remedies are cumulative.
+
+Each party acknowledges and agrees that the other is an
+independent contractor in the performance of this Agreement.
+
+The SDK has been developed entirely at private expense and is
+ācommercial itemsā consisting of ācommercial computer
+softwareā and ācommercial computer software
+documentationā provided with RESTRICTED RIGHTS. Use,
+duplication or disclosure by the U.S. Government or a U.S.
+Government subcontractor is subject to the restrictions in
+this Agreement pursuant to DFARS 227.7202-3(a) or as set forth
+in subparagraphs (c)(1) and (2) of the Commercial Computer
+Software - Restricted Rights clause at FAR 52.227-19, as
+applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas
+Expressway, Santa Clara, CA 95051.
+
+The SDK is subject to United States export laws and
+regulations. You agree that you will not ship, transfer or
+export the SDK into any country, or use the SDK in any manner,
+prohibited by the United States Bureau of Industry and
+Security or economic sanctions regulations administered by the
+U.S. Department of Treasuryās Office of Foreign Assets
+Control (OFAC), or any applicable export laws, restrictions or
+regulations. These laws include restrictions on destinations,
+end users and end use. By accepting this Agreement, you
+confirm that you are not a resident or citizen of any country
+currently embargoed by the U.S. and that you are not otherwise
+prohibited from receiving the SDK.
+
+Any notice delivered by NVIDIA to you under this Agreement
+will be delivered via mail, email or fax. You agree that any
+notices that NVIDIA sends you electronically will satisfy any
+legal communication requirements. Please direct your legal
+notices or other correspondence to NVIDIA Corporation, 2788
+San Tomas Expressway, Santa Clara, California 95051, United
+States of America, Attention: Legal Department.
+
+This Agreement and any exhibits incorporated into this
+Agreement constitute the entire agreement of the parties with
+respect to the subject matter of this Agreement and supersede
+all prior negotiations or documentation exchanged between the
+parties relating to this SDK license. Any additional and/or
+conflicting terms on documents issued by you are null, void,
+and invalid. Any amendment or waiver under this Agreement
+shall be in writing and signed by representatives of both
+parties.
+
+
+2. CUDA Toolkit Supplement to Software License Agreement for
+NVIDIA Software Development Kits
+------------------------------------------------------------
+
+
+Release date: August 16, 2018
+-----------------------------
+
+The terms in this supplement govern your use of the NVIDIA
+CUDA Toolkit SDK under the terms of your license agreement
+(āAgreementā) as modified by this supplement. Capitalized
+terms used but not defined below have the meaning assigned to
+them in the Agreement.
+
+This supplement is an exhibit to the Agreement and is
+incorporated as an integral part of the Agreement. In the
+event of conflict between the terms in this supplement and the
+terms in the Agreement, the terms in this supplement govern.
+
+
+2.1. License Scope
+
+The SDK is licensed for you to develop applications only for
+use in systems with NVIDIA GPUs.
+
+
+2.2. Distribution
+
+The portions of the SDK that are distributable under the
+Agreement are listed in Attachment A.
+
+
+2.3. Operating Systems
+
+Those portions of the SDK designed exclusively for use on the
+Linux or FreeBSD operating systems, or other operating systems
+derived from the source code to these operating systems, may
+be copied and redistributed for use in accordance with this
+Agreement, provided that the object code files are not
+modified in any way (except for unzipping of compressed
+files).
+
+
+2.4. Audio and Video Encoders and Decoders
+
+You acknowledge and agree that it is your sole responsibility
+to obtain any additional third-party licenses required to
+make, have made, use, have used, sell, import, and offer for
+sale your products or services that include or incorporate any
+third-party software and content relating to audio and/or
+video encoders and decoders from, including but not limited
+to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A.,
+MPEG-LA, and Coding Technologies. NVIDIA does not grant to you
+under this Agreement any necessary patent or other rights with
+respect to any audio and/or video encoders and decoders.
+
+
+2.5. Licensing
+
+If the distribution terms in this Agreement are not suitable
+for your organization, or for any questions regarding this
+Agreement, please contact NVIDIA at
+nvidia-compute-license-questions@nvidia.com.
+
+
+2.6. Attachment A
+
+The following portions of the SDK are distributable under the
+Agreement:
+
+Component
+
+CUDA Runtime
+
+Windows
+
+cudart.dll, cudart_static.lib, cudadevrt.lib
+
+Mac OSX
+
+libcudart.dylib, libcudart_static.a, libcudadevrt.a
+
+Linux
+
+libcudart.so, libcudart_static.a, libcudadevrt.a
+
+Android
+
+libcudart.so, libcudart_static.a, libcudadevrt.a
+
+Component
+
+CUDA FFT Library
+
+Windows
+
+cufft.dll, cufftw.dll, cufft.lib, cufftw.lib
+
+Mac OSX
+
+libcufft.dylib, libcufft_static.a, libcufftw.dylib,
+libcufftw_static.a
+
+Linux
+
+libcufft.so, libcufft_static.a, libcufftw.so,
+libcufftw_static.a
+
+Android
+
+libcufft.so, libcufft_static.a, libcufftw.so,
+libcufftw_static.a
+
+Component
+
+CUDA BLAS Library
+
+Windows
+
+cublas.dll, cublasLt.dll
+
+Mac OSX
+
+libcublas.dylib, libcublasLt.dylib, libcublas_static.a,
+libcublasLt_static.a
+
+Linux
+
+libcublas.so, libcublasLt.so, libcublas_static.a,
+libcublasLt_static.a
+
+Android
+
+libcublas.so, libcublasLt.so, libcublas_static.a,
+libcublasLt_static.a
+
+Component
+
+NVIDIA "Drop-in" BLAS Library
+
+Windows
+
+nvblas.dll
+
+Mac OSX
+
+libnvblas.dylib
+
+Linux
+
+libnvblas.so
+
+Component
+
+CUDA Sparse Matrix Library
+
+Windows
+
+cusparse.dll, cusparse.lib
+
+Mac OSX
+
+libcusparse.dylib, libcusparse_static.a
+
+Linux
+
+libcusparse.so, libcusparse_static.a
+
+Android
+
+libcusparse.so, libcusparse_static.a
+
+Component
+
+CUDA Linear Solver Library
+
+Windows
+
+cusolver.dll, cusolver.lib
+
+Mac OSX
+
+libcusolver.dylib, libcusolver_static.a
+
+Linux
+
+libcusolver.so, libcusolver_static.a
+
+Android
+
+libcusolver.so, libcusolver_static.a
+
+Component
+
+CUDA Random Number Generation Library
+
+Windows
+
+curand.dll, curand.lib
+
+Mac OSX
+
+libcurand.dylib, libcurand_static.a
+
+Linux
+
+libcurand.so, libcurand_static.a
+
+Android
+
+libcurand.so, libcurand_static.a
+
+Component
+
+CUDA Accelerated Graph Library
+
+Component
+
+NVIDIA Performance Primitives Library
+
+Windows
+
+nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll,
+nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll,
+nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib,
+nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll,
+nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib
+
+Mac OSX
+
+libnppc.dylib, libnppc_static.a, libnppial.dylib,
+libnppial_static.a, libnppicc.dylib, libnppicc_static.a,
+libnppicom.dylib, libnppicom_static.a, libnppidei.dylib,
+libnppidei_static.a, libnppif.dylib, libnppif_static.a,
+libnppig.dylib, libnppig_static.a, libnppim.dylib,
+libnppisu_static.a, libnppitc.dylib, libnppitc_static.a,
+libnpps.dylib, libnpps_static.a
+
+Linux
+
+libnppc.so, libnppc_static.a, libnppial.so,
+libnppial_static.a, libnppicc.so, libnppicc_static.a,
+libnppicom.so, libnppicom_static.a, libnppidei.so,
+libnppidei_static.a, libnppif.so, libnppif_static.a
+libnppig.so, libnppig_static.a, libnppim.so,
+libnppim_static.a, libnppist.so, libnppist_static.a,
+libnppisu.so, libnppisu_static.a, libnppitc.so
+libnppitc_static.a, libnpps.so, libnpps_static.a
+
+Android
+
+libnppc.so, libnppc_static.a, libnppial.so,
+libnppial_static.a, libnppicc.so, libnppicc_static.a,
+libnppicom.so, libnppicom_static.a, libnppidei.so,
+libnppidei_static.a, libnppif.so, libnppif_static.a
+libnppig.so, libnppig_static.a, libnppim.so,
+libnppim_static.a, libnppist.so, libnppist_static.a,
+libnppisu.so, libnppisu_static.a, libnppitc.so
+libnppitc_static.a, libnpps.so, libnpps_static.a
+
+Component
+
+NVIDIA JPEG Library
+
+Linux
+
+libnvjpeg.so, libnvjpeg_static.a
+
+Component
+
+Internal common library required for statically linking to
+cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP
+
+Mac OSX
+
+libculibos.a
+
+Linux
+
+libculibos.a
+
+Component
+
+NVIDIA Runtime Compilation Library and Header
+
+All
+
+nvrtc.h
+
+Windows
+
+nvrtc.dll, nvrtc-builtins.dll
+
+Mac OSX
+
+libnvrtc.dylib, libnvrtc-builtins.dylib
+
+Linux
+
+libnvrtc.so, libnvrtc-builtins.so
+
+Component
+
+NVIDIA Optimizing Compiler Library
+
+Windows
+
+nvvm.dll
+
+Mac OSX
+
+libnvvm.dylib
+
+Linux
+
+libnvvm.so
+
+Component
+
+NVIDIA Common Device Math Functions Library
+
+Windows
+
+libdevice.10.bc
+
+Mac OSX
+
+libdevice.10.bc
+
+Linux
+
+libdevice.10.bc
+
+Component
+
+CUDA Occupancy Calculation Header Library
+
+All
+
+cuda_occupancy.h
+
+Component
+
+CUDA Half Precision Headers
+
+All
+
+cuda_fp16.h, cuda_fp16.hpp
+
+Component
+
+CUDA Profiling Tools Interface (CUPTI) Library
+
+Windows
+
+cupti.dll
+
+Mac OSX
+
+libcupti.dylib
+
+Linux
+
+libcupti.so
+
+Component
+
+NVIDIA Tools Extension Library
+
+Windows
+
+nvToolsExt.dll, nvToolsExt.lib
+
+Mac OSX
+
+libnvToolsExt.dylib
+
+Linux
+
+libnvToolsExt.so
+
+Component
+
+NVIDIA CUDA Driver Libraries
+
+Linux
+
+libcuda.so, libnvidia-fatbinaryloader.so,
+libnvidia-ptxjitcompiler.so
+
+The NVIDIA CUDA Driver Libraries are only distributable in
+applications that meet this criteria:
+
+ 1. The application was developed starting from a NVIDIA CUDA
+ container obtained from Docker Hub or the NVIDIA GPU
+ Cloud, and
+
+ 2. The resulting application is packaged as a Docker
+ container and distributed to users on Docker Hub or the
+ NVIDIA GPU Cloud only.
+
+
+2.7. Attachment B
+
+
+Additional Licensing Obligations
+
+The following third party components included in the SOFTWARE
+are licensed to Licensee pursuant to the following terms and
+conditions:
+
+ 1. Licensee's use of the GDB third party component is
+ subject to the terms and conditions of GNU GPL v3:
+
+ This product includes copyrighted third-party software licensed
+ under the terms of the GNU General Public License v3 ("GPL v3").
+ All third-party software packages are copyright by their respective
+ authors. GPL v3 terms and conditions are hereby incorporated into
+ the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt
+
+ Consistent with these licensing requirements, the software
+ listed below is provided under the terms of the specified
+ open source software licenses. To obtain source code for
+ software provided under licenses that require
+ redistribution of source code, including the GNU General
+ Public License (GPL) and GNU Lesser General Public License
+ (LGPL), contact oss-requests@nvidia.com. This offer is
+ valid for a period of three (3) years from the date of the
+ distribution of this product by NVIDIA CORPORATION.
+
+ Component License
+ CUDA-GDB GPL v3
+
+ 2. Licensee represents and warrants that any and all third
+ party licensing and/or royalty payment obligations in
+ connection with Licensee's use of the H.264 video codecs
+ are solely the responsibility of Licensee.
+
+ 3. Licensee's use of the Thrust library is subject to the
+ terms and conditions of the Apache License Version 2.0.
+ All third-party software packages are copyright by their
+ respective authors. Apache License Version 2.0 terms and
+ conditions are hereby incorporated into the Agreement by
+ this reference.
+ http://www.apache.org/licenses/LICENSE-2.0.html
+
+ In addition, Licensee acknowledges the following notice:
+ Thrust includes source code from the Boost Iterator,
+ Tuple, System, and Random Number libraries.
+
+ Boost Software License - Version 1.0 - August 17th, 2003
+ . . . .
+
+ Permission is hereby granted, free of charge, to any person or
+ organization obtaining a copy of the software and accompanying
+ documentation covered by this license (the "Software") to use,
+ reproduce, display, distribute, execute, and transmit the Software,
+ and to prepare derivative works of the Software, and to permit
+ third-parties to whom the Software is furnished to do so, all
+ subject to the following:
+
+ The copyright notices in the Software and this entire statement,
+ including the above license grant, this restriction and the following
+ disclaimer, must be included in all copies of the Software, in whole
+ or in part, and all derivative works of the Software, unless such
+ copies or derivative works are solely in the form of machine-executable
+ object code generated by a source language processor.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+ NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
+ OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+ 4. Licensee's use of the LLVM third party component is
+ subject to the following terms and conditions:
+
+ ======================================================
+ LLVM Release License
+ ======================================================
+ University of Illinois/NCSA
+ Open Source License
+
+ Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.
+ All rights reserved.
+
+ Developed by:
+
+ LLVM Team
+
+ University of Illinois at Urbana-Champaign
+
+ http://llvm.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to
+ deal with the Software without restriction, including without limitation the
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimers.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimers in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of the LLVM Team, University of Illinois at Urbana-
+ Champaign, nor the names of its contributors may be used to endorse or
+ promote products derived from this Software without specific prior
+ written permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
+
+ 5. Licensee's use (e.g. nvprof) of the PCRE third party
+ component is subject to the following terms and
+ conditions:
+
+ ------------
+ PCRE LICENCE
+ ------------
+ PCRE is a library of functions to support regular expressions whose syntax
+ and semantics are as close as possible to those of the Perl 5 language.
+ Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
+ specified below. The documentation for PCRE, supplied in the "doc"
+ directory, is distributed under the same terms as the software itself. The
+ basic library functions are written in C and are freestanding. Also
+ included in the distribution is a set of C++ wrapper functions, and a just-
+ in-time compiler that can be used to optimize pattern matching. These are
+ both optional features that can be omitted when the library is built.
+
+ THE BASIC LIBRARY FUNCTIONS
+ ---------------------------
+ Written by: Philip Hazel
+ Email local part: ph10
+ Email domain: cam.ac.uk
+ University of Cambridge Computing Service,
+ Cambridge, England.
+ Copyright (c) 1997-2012 University of Cambridge
+ All rights reserved.
+
+ PCRE JUST-IN-TIME COMPILATION SUPPORT
+ -------------------------------------
+ Written by: Zoltan Herczeg
+ Email local part: hzmester
+ Emain domain: freemail.hu
+ Copyright(c) 2010-2012 Zoltan Herczeg
+ All rights reserved.
+
+ STACK-LESS JUST-IN-TIME COMPILER
+ --------------------------------
+ Written by: Zoltan Herczeg
+ Email local part: hzmester
+ Emain domain: freemail.hu
+ Copyright(c) 2009-2012 Zoltan Herczeg
+ All rights reserved.
+
+ THE C++ WRAPPER FUNCTIONS
+ -------------------------
+ Contributed by: Google Inc.
+ Copyright (c) 2007-2012, Google Inc.
+ All rights reserved.
+
+ THE "BSD" LICENCE
+ -----------------
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of the University of Cambridge nor the name of Google
+ Inc. nor the names of their contributors may be used to endorse or
+ promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ 6. Some of the cuBLAS library routines were written by or
+ derived from code written by Vasily Volkov and are subject
+ to the Modified Berkeley Software Distribution License as
+ follows:
+
+ Copyright (c) 2007-2009, Regents of the University of California
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the University of California, Berkeley nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ 7. Some of the cuBLAS library routines were written by or
+ derived from code written by Davide Barbieri and are
+ subject to the Modified Berkeley Software Distribution
+ License as follows:
+
+ Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata.
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ 8. Some of the cuBLAS library routines were derived from
+ code developed by the University of Tennessee and are
+ subject to the Modified Berkeley Software Distribution
+ License as follows:
+
+ Copyright (c) 2010 The University of Tennessee.
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer listed in this license in the documentation and/or
+ other materials provided with the distribution.
+ * Neither the name of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 9. Some of the cuBLAS library routines were written by or
+ derived from code written by Jonathan Hogg and are subject
+ to the Modified Berkeley Software Distribution License as
+ follows:
+
+ Copyright (c) 2012, The Science and Technology Facilities Council (STFC).
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the STFC nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 10. Some of the cuBLAS library routines were written by or
+ derived from code written by Ahmad M. Abdelfattah, David
+ Keyes, and Hatem Ltaief, and are subject to the Apache
+ License, Version 2.0, as follows:
+
+ -- (C) Copyright 2013 King Abdullah University of Science and Technology
+ Authors:
+ Ahmad Abdelfattah (ahmad.ahmad@kaust.edu.sa)
+ David Keyes (david.keyes@kaust.edu.sa)
+ Hatem Ltaief (hatem.ltaief@kaust.edu.sa)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the King Abdullah University of Science and
+ Technology nor the names of its contributors may be used to endorse
+ or promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+
+ 11. Some of the cuSPARSE library routines were written by or
+ derived from code written by Li-Wen Chang and are subject
+ to the NCSA Open Source License as follows:
+
+ Copyright (c) 2012, University of Illinois.
+
+ All rights reserved.
+
+ Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal with the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimers in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the names of IMPACT Group, University of Illinois, nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this Software without specific prior
+ written permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+ SOFTWARE.
+
+ 12. Some of the cuRAND library routines were written by or
+ derived from code written by Mutsuo Saito and Makoto
+ Matsumoto and are subject to the following license:
+
+ Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima
+ University. All rights reserved.
+
+ Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima
+ University and University of Tokyo. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the Hiroshima University nor the names of
+ its contributors may be used to endorse or promote products
+ derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 13. Some of the cuRAND library routines were derived from
+ code developed by D. E. Shaw Research and are subject to
+ the following license:
+
+ Copyright 2010-2011, D. E. Shaw Research.
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions, and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions, and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of D. E. Shaw Research nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 14. Some of the Math library routines were written by or
+ derived from code developed by Norbert Juffa and are
+ subject to the following license:
+
+ Copyright (c) 2015-2017, Norbert Juffa
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 15. Licensee's use of the lz4 third party component is
+ subject to the following terms and conditions:
+
+ Copyright (C) 2011-2013, Yann Collet.
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 16. The NPP library uses code from the Boost Math Toolkit,
+ and is subject to the following license:
+
+ Boost Software License - Version 1.0 - August 17th, 2003
+ . . . .
+
+ Permission is hereby granted, free of charge, to any person or
+ organization obtaining a copy of the software and accompanying
+ documentation covered by this license (the "Software") to use,
+ reproduce, display, distribute, execute, and transmit the Software,
+ and to prepare derivative works of the Software, and to permit
+ third-parties to whom the Software is furnished to do so, all
+ subject to the following:
+
+ The copyright notices in the Software and this entire statement,
+ including the above license grant, this restriction and the following
+ disclaimer, must be included in all copies of the Software, in whole
+ or in part, and all derivative works of the Software, unless such
+ copies or derivative works are solely in the form of machine-executable
+ object code generated by a source language processor.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+ NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
+ OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+ 17. Portions of the Nsight Eclipse Edition is subject to the
+ following license:
+
+ The Eclipse Foundation makes available all content in this plug-in
+ ("Content"). Unless otherwise indicated below, the Content is provided
+ to you under the terms and conditions of the Eclipse Public License
+ Version 1.0 ("EPL"). A copy of the EPL is available at http://
+ www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program"
+ will mean the Content.
+
+ If you did not receive this Content directly from the Eclipse
+ Foundation, the Content is being redistributed by another party
+ ("Redistributor") and different terms and conditions may apply to your
+ use of any object code in the Content. Check the Redistributor's
+ license that was provided with the Content. If no such license exists,
+ contact the Redistributor. Unless otherwise indicated below, the terms
+ and conditions of the EPL still apply to any source code in the
+ Content and such source code may be obtained at http://www.eclipse.org.
+
+ 18. Some of the cuBLAS library routines uses code from
+ OpenAI, which is subject to the following license:
+
+ License URL
+ https://github.com/openai/openai-gemm/blob/master/LICENSE
+
+ License Text
+ The MIT License
+
+ Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+ 19. Licensee's use of the Visual Studio Setup Configuration
+ Samples is subject to the following license:
+
+ The MIT License (MIT)
+ Copyright (C) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ 20. Licensee's use of linmath.h header for CPU functions for
+ GL vector/matrix operations from lunarG is subject to the
+ Apache License Version 2.0.
+
+ 21. The DX12-CUDA sample uses the d3dx12.h header, which is
+ subject to the MIT license .
+
+-----------------
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/METADATA b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/METADATA
new file mode 100644
index 0000000000000000000000000000000000000000..cc5f7aeba4051cc53825c38b2601dccc6841dd04
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/METADATA
@@ -0,0 +1,35 @@
+Metadata-Version: 2.1
+Name: nvidia-cuda-nvrtc-cu12
+Version: 12.6.77
+Summary: NVRTC native runtime libraries
+Home-page: https://developer.nvidia.com/cuda-zone
+Author: Nvidia CUDA Installer Team
+Author-email: compute_installer@nvidia.com
+License: NVIDIA Proprietary Software
+Keywords: cuda,nvidia,runtime,machine learning,deep learning
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: Education
+Classifier: Intended Audience :: Science/Research
+Classifier: License :: Other/Proprietary License
+Classifier: Natural Language :: English
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Topic :: Scientific/Engineering
+Classifier: Topic :: Scientific/Engineering :: Mathematics
+Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
+Classifier: Topic :: Software Development
+Classifier: Topic :: Software Development :: Libraries
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: POSIX :: Linux
+Requires-Python: >=3
+License-File: License.txt
+
+NVRTC native runtime libraries
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/RECORD b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/RECORD
new file mode 100644
index 0000000000000000000000000000000000000000..98e1c468a4ed5aaf9b0eadf1b89e80a0eec047d2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/RECORD
@@ -0,0 +1,14 @@
+nvidia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia/cuda_nvrtc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia/cuda_nvrtc/include/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia/cuda_nvrtc/include/nvrtc.h,sha256=I7eqtUihrj1vVtZF9uF3F0ztxeXHGmmOuzBQU0SkfrI,36712
+nvidia/cuda_nvrtc/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia/cuda_nvrtc/lib/libnvrtc-builtins.so.12.6,sha256=odX84-PvBKe15mBMC7F_QNOfmWWj9tCyt6K8MI4YntA,5322632
+nvidia/cuda_nvrtc/lib/libnvrtc.so.12,sha256=ztgwv_QGtVVSmMwerMhnC2u2uTeObleD-sU93PfLv1s,58726320
+nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
+nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/License.txt,sha256=rW9YU_ugyg0VnQ9Y1JrkmDDC-Mk_epJki5zpCttMbM0,59262
+nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/METADATA,sha256=rl6BG8YmFtRNaUGCrNk81VvfImBGCVS87agTmOtb5p4,1509
+nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/RECORD,,
+nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/WHEEL,sha256=RwQmhh9u1isdcmjtKWUeXWGEq6NgSi-cN5SopFlOUFw,108
+nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/top_level.txt,sha256=fTkAtiFuL16nUrB9ytDDtpytz2t0B4NvYTnRzwAhO14,7
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/REQUESTED b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/REQUESTED
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/WHEEL b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/WHEEL
new file mode 100644
index 0000000000000000000000000000000000000000..c14019752ca828b50ca8be6ba00f81960c78ab2b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/WHEEL
@@ -0,0 +1,5 @@
+Wheel-Version: 1.0
+Generator: setuptools (74.1.2)
+Root-Is-Purelib: true
+Tag: py3-none-manylinux2014_x86_64
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/top_level.txt b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/top_level.txt
new file mode 100644
index 0000000000000000000000000000000000000000..862f7abf232cdfbb928609856247292e81c9decb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cuda_nvrtc_cu12-12.6.77.dist-info/top_level.txt
@@ -0,0 +1 @@
+nvidia
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/INSTALLER b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/INSTALLER
new file mode 100644
index 0000000000000000000000000000000000000000..5c69047b2eb8235994febeeae1da4a82365a240a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/INSTALLER
@@ -0,0 +1 @@
+uv
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/License.txt b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/License.txt
new file mode 100644
index 0000000000000000000000000000000000000000..b491c70e0aef319022ded661e111ddbd45b8a17f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/License.txt
@@ -0,0 +1,1568 @@
+End User License Agreement
+--------------------------
+
+
+Preface
+-------
+
+The Software License Agreement in Chapter 1 and the Supplement
+in Chapter 2 contain license terms and conditions that govern
+the use of NVIDIA software. By accepting this agreement, you
+agree to comply with all the terms and conditions applicable
+to the product(s) included herein.
+
+
+NVIDIA Driver
+
+
+Description
+
+This package contains the operating system driver and
+fundamental system software components for NVIDIA GPUs.
+
+
+NVIDIA CUDA Toolkit
+
+
+Description
+
+The NVIDIA CUDA Toolkit provides command-line and graphical
+tools for building, debugging and optimizing the performance
+of applications accelerated by NVIDIA GPUs, runtime and math
+libraries, and documentation including programming guides,
+user manuals, and API references.
+
+
+Default Install Location of CUDA Toolkit
+
+Windows platform:
+
+%ProgramFiles%\NVIDIA GPU Computing Toolkit\CUDA\v#.#
+
+Linux platform:
+
+/usr/local/cuda-#.#
+
+Mac platform:
+
+/Developer/NVIDIA/CUDA-#.#
+
+
+NVIDIA CUDA Samples
+
+
+Description
+
+This package includes over 100+ CUDA examples that demonstrate
+various CUDA programming principles, and efficient CUDA
+implementation of algorithms in specific application domains.
+
+
+Default Install Location of CUDA Samples
+
+Windows platform:
+
+%ProgramData%\NVIDIA Corporation\CUDA Samples\v#.#
+
+Linux platform:
+
+/usr/local/cuda-#.#/samples
+
+and
+
+$HOME/NVIDIA_CUDA-#.#_Samples
+
+Mac platform:
+
+/Developer/NVIDIA/CUDA-#.#/samples
+
+
+NVIDIA Nsight Visual Studio Edition (Windows only)
+
+
+Description
+
+NVIDIA Nsight Development Platform, Visual Studio Edition is a
+development environment integrated into Microsoft Visual
+Studio that provides tools for debugging, profiling, analyzing
+and optimizing your GPU computing and graphics applications.
+
+
+Default Install Location of Nsight Visual Studio Edition
+
+Windows platform:
+
+%ProgramFiles(x86)%\NVIDIA Corporation\Nsight Visual Studio Edition #.#
+
+
+1. License Agreement for NVIDIA Software Development Kits
+---------------------------------------------------------
+
+
+Release Date: July 26, 2018
+---------------------------
+
+
+Important NoticeRead before downloading, installing,
+copying or using the licensed software:
+-------------------------------------------------------
+
+This license agreement, including exhibits attached
+("Agreementā) is a legal agreement between you and NVIDIA
+Corporation ("NVIDIA") and governs your use of a NVIDIA
+software development kit (āSDKā).
+
+Each SDK has its own set of software and materials, but here
+is a description of the types of items that may be included in
+a SDK: source code, header files, APIs, data sets and assets
+(examples include images, textures, models, scenes, videos,
+native API input/output files), binary software, sample code,
+libraries, utility programs, programming code and
+documentation.
+
+This Agreement can be accepted only by an adult of legal age
+of majority in the country in which the SDK is used.
+
+If you are entering into this Agreement on behalf of a company
+or other legal entity, you represent that you have the legal
+authority to bind the entity to this Agreement, in which case
+āyouā will mean the entity you represent.
+
+If you donāt have the required age or authority to accept
+this Agreement, or if you donāt accept all the terms and
+conditions of this Agreement, do not download, install or use
+the SDK.
+
+You agree to use the SDK only for purposes that are permitted
+by (a) this Agreement, and (b) any applicable law, regulation
+or generally accepted practices or guidelines in the relevant
+jurisdictions.
+
+
+1.1. License
+
+
+1.1.1. License Grant
+
+Subject to the terms of this Agreement, NVIDIA hereby grants
+you a non-exclusive, non-transferable license, without the
+right to sublicense (except as expressly provided in this
+Agreement) to:
+
+ 1. Install and use the SDK,
+
+ 2. Modify and create derivative works of sample source code
+ delivered in the SDK, and
+
+ 3. Distribute those portions of the SDK that are identified
+ in this Agreement as distributable, as incorporated in
+ object code format into a software application that meets
+ the distribution requirements indicated in this Agreement.
+
+
+1.1.2. Distribution Requirements
+
+These are the distribution requirements for you to exercise
+the distribution grant:
+
+ 1. Your application must have material additional
+ functionality, beyond the included portions of the SDK.
+
+ 2. The distributable portions of the SDK shall only be
+ accessed by your application.
+
+ 3. The following notice shall be included in modifications
+ and derivative works of sample source code distributed:
+ āThis software contains source code provided by NVIDIA
+ Corporation.ā
+
+ 4. Unless a developer tool is identified in this Agreement
+ as distributable, it is delivered for your internal use
+ only.
+
+ 5. The terms under which you distribute your application
+ must be consistent with the terms of this Agreement,
+ including (without limitation) terms relating to the
+ license grant and license restrictions and protection of
+ NVIDIAās intellectual property rights. Additionally, you
+ agree that you will protect the privacy, security and
+ legal rights of your application users.
+
+ 6. You agree to notify NVIDIA in writing of any known or
+ suspected distribution or use of the SDK not in compliance
+ with the requirements of this Agreement, and to enforce
+ the terms of your agreements with respect to distributed
+ SDK.
+
+
+1.1.3. Authorized Users
+
+You may allow employees and contractors of your entity or of
+your subsidiary(ies) to access and use the SDK from your
+secure network to perform work on your behalf.
+
+If you are an academic institution you may allow users
+enrolled or employed by the academic institution to access and
+use the SDK from your secure network.
+
+You are responsible for the compliance with the terms of this
+Agreement by your authorized users. If you become aware that
+your authorized users didnāt follow the terms of this
+Agreement, you agree to take reasonable steps to resolve the
+non-compliance and prevent new occurrences.
+
+
+1.1.4. Pre-Release SDK
+
+The SDK versions identified as alpha, beta, preview or
+otherwise as pre-release, may not be fully functional, may
+contain errors or design flaws, and may have reduced or
+different security, privacy, accessibility, availability, and
+reliability standards relative to commercial versions of
+NVIDIA software and materials. Use of a pre-release SDK may
+result in unexpected results, loss of data, project delays or
+other unpredictable damage or loss.
+
+You may use a pre-release SDK at your own risk, understanding
+that pre-release SDKs are not intended for use in production
+or business-critical systems.
+
+NVIDIA may choose not to make available a commercial version
+of any pre-release SDK. NVIDIA may also choose to abandon
+development and terminate the availability of a pre-release
+SDK at any time without liability.
+
+
+1.1.5. Updates
+
+NVIDIA may, at its option, make available patches, workarounds
+or other updates to this SDK. Unless the updates are provided
+with their separate governing terms, they are deemed part of
+the SDK licensed to you as provided in this Agreement. You
+agree that the form and content of the SDK that NVIDIA
+provides may change without prior notice to you. While NVIDIA
+generally maintains compatibility between versions, NVIDIA may
+in some cases make changes that introduce incompatibilities in
+future versions of the SDK.
+
+
+1.1.6. Third Party Licenses
+
+The SDK may come bundled with, or otherwise include or be
+distributed with, third party software licensed by a NVIDIA
+supplier and/or open source software provided under an open
+source license. Use of third party software is subject to the
+third-party license terms, or in the absence of third party
+terms, the terms of this Agreement. Copyright to third party
+software is held by the copyright holders indicated in the
+third-party software or license.
+
+
+1.1.7. Reservation of Rights
+
+NVIDIA reserves all rights, title, and interest in and to the
+SDK, not expressly granted to you under this Agreement.
+
+
+1.2. Limitations
+
+The following license limitations apply to your use of the
+SDK:
+
+ 1. You may not reverse engineer, decompile or disassemble,
+ or remove copyright or other proprietary notices from any
+ portion of the SDK or copies of the SDK.
+
+ 2. Except as expressly provided in this Agreement, you may
+ not copy, sell, rent, sublicense, transfer, distribute,
+ modify, or create derivative works of any portion of the
+ SDK. For clarity, you may not distribute or sublicense the
+ SDK as a stand-alone product.
+
+ 3. Unless you have an agreement with NVIDIA for this
+ purpose, you may not indicate that an application created
+ with the SDK is sponsored or endorsed by NVIDIA.
+
+ 4. You may not bypass, disable, or circumvent any
+ encryption, security, digital rights management or
+ authentication mechanism in the SDK.
+
+ 5. You may not use the SDK in any manner that would cause it
+ to become subject to an open source software license. As
+ examples, licenses that require as a condition of use,
+ modification, and/or distribution that the SDK be:
+
+ a. Disclosed or distributed in source code form;
+
+ b. Licensed for the purpose of making derivative works;
+ or
+
+ c. Redistributable at no charge.
+
+ 6. Unless you have an agreement with NVIDIA for this
+ purpose, you may not use the SDK with any system or
+ application where the use or failure of the system or
+ application can reasonably be expected to threaten or
+ result in personal injury, death, or catastrophic loss.
+ Examples include use in avionics, navigation, military,
+ medical, life support or other life critical applications.
+ NVIDIA does not design, test or manufacture the SDK for
+ these critical uses and NVIDIA shall not be liable to you
+ or any third party, in whole or in part, for any claims or
+ damages arising from such uses.
+
+ 7. You agree to defend, indemnify and hold harmless NVIDIA
+ and its affiliates, and their respective employees,
+ contractors, agents, officers and directors, from and
+ against any and all claims, damages, obligations, losses,
+ liabilities, costs or debt, fines, restitutions and
+ expenses (including but not limited to attorneyās fees
+ and costs incident to establishing the right of
+ indemnification) arising out of or related to your use of
+ the SDK outside of the scope of this Agreement, or not in
+ compliance with its terms.
+
+
+1.3. Ownership
+
+ 1. NVIDIA or its licensors hold all rights, title and
+ interest in and to the SDK and its modifications and
+ derivative works, including their respective intellectual
+ property rights, subject to your rights described in this
+ section. This SDK may include software and materials from
+ NVIDIAās licensors, and these licensors are intended
+ third party beneficiaries that may enforce this Agreement
+ with respect to their intellectual property rights.
+
+ 2. You hold all rights, title and interest in and to your
+ applications and your derivative works of the sample
+ source code delivered in the SDK, including their
+ respective intellectual property rights, subject to
+ NVIDIAās rights described in this section.
+
+ 3. You may, but donāt have to, provide to NVIDIA
+ suggestions, feature requests or other feedback regarding
+ the SDK, including possible enhancements or modifications
+ to the SDK. For any feedback that you voluntarily provide,
+ you hereby grant NVIDIA and its affiliates a perpetual,
+ non-exclusive, worldwide, irrevocable license to use,
+ reproduce, modify, license, sublicense (through multiple
+ tiers of sublicensees), and distribute (through multiple
+ tiers of distributors) it without the payment of any
+ royalties or fees to you. NVIDIA will use feedback at its
+ choice. NVIDIA is constantly looking for ways to improve
+ its products, so you may send feedback to NVIDIA through
+ the developer portal at https://developer.nvidia.com.
+
+
+1.4. No Warranties
+
+THE SDK IS PROVIDED BY NVIDIA āAS ISā AND āWITH ALL
+FAULTS.ā TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND
+ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND
+OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING,
+BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, OR THE
+ABSENCE OF ANY DEFECTS THEREIN, WHETHER LATENT OR PATENT. NO
+WARRANTY IS MADE ON THE BASIS OF TRADE USAGE, COURSE OF
+DEALING OR COURSE OF TRADE.
+
+
+1.5. Limitation of Liability
+
+TO THE MAXIMUM EXTENT PERMITTED BY LAW, NVIDIA AND ITS
+AFFILIATES SHALL NOT BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
+PUNITIVE OR CONSEQUENTIAL DAMAGES, OR ANY LOST PROFITS, LOSS
+OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR THE COSTS OF
+PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION
+WITH THIS AGREEMENT OR THE USE OR PERFORMANCE OF THE SDK,
+WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH
+OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE),
+PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF
+LIABILITY. IN NO EVENT WILL NVIDIAāS AND ITS AFFILIATES
+TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS
+AGREEMENT EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE
+NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS
+LIMIT.
+
+These exclusions and limitations of liability shall apply
+regardless if NVIDIA or its affiliates have been advised of
+the possibility of such damages, and regardless of whether a
+remedy fails its essential purpose. These exclusions and
+limitations of liability form an essential basis of the
+bargain between the parties, and, absent any of these
+exclusions or limitations of liability, the provisions of this
+Agreement, including, without limitation, the economic terms,
+would be substantially different.
+
+
+1.6. Termination
+
+ 1. This Agreement will continue to apply until terminated by
+ either you or NVIDIA as described below.
+
+ 2. If you want to terminate this Agreement, you may do so by
+ stopping to use the SDK.
+
+ 3. NVIDIA may, at any time, terminate this Agreement if:
+
+ a. (i) you fail to comply with any term of this
+ Agreement and the non-compliance is not fixed within
+ thirty (30) days following notice from NVIDIA (or
+ immediately if you violate NVIDIAās intellectual
+ property rights);
+
+ b. (ii) you commence or participate in any legal
+ proceeding against NVIDIA with respect to the SDK; or
+
+ c. (iii) NVIDIA decides to no longer provide the SDK in
+ a country or, in NVIDIAās sole discretion, the
+ continued use of it is no longer commercially viable.
+
+ 4. Upon any termination of this Agreement, you agree to
+ promptly discontinue use of the SDK and destroy all copies
+ in your possession or control. Your prior distributions in
+ accordance with this Agreement are not affected by the
+ termination of this Agreement. Upon written request, you
+ will certify in writing that you have complied with your
+ commitments under this section. Upon any termination of
+ this Agreement all provisions survive except for the
+ license grant provisions.
+
+
+1.7. General
+
+If you wish to assign this Agreement or your rights and
+obligations, including by merger, consolidation, dissolution
+or operation of law, contact NVIDIA to ask for permission. Any
+attempted assignment not approved by NVIDIA in writing shall
+be void and of no effect. NVIDIA may assign, delegate or
+transfer this Agreement and its rights and obligations, and if
+to a non-affiliate you will be notified.
+
+You agree to cooperate with NVIDIA and provide reasonably
+requested information to verify your compliance with this
+Agreement.
+
+This Agreement will be governed in all respects by the laws of
+the United States and of the State of Delaware as those laws
+are applied to contracts entered into and performed entirely
+within Delaware by Delaware residents, without regard to the
+conflicts of laws principles. The United Nations Convention on
+Contracts for the International Sale of Goods is specifically
+disclaimed. You agree to all terms of this Agreement in the
+English language.
+
+The state or federal courts residing in Santa Clara County,
+California shall have exclusive jurisdiction over any dispute
+or claim arising out of this Agreement. Notwithstanding this,
+you agree that NVIDIA shall still be allowed to apply for
+injunctive remedies or an equivalent type of urgent legal
+relief in any jurisdiction.
+
+If any court of competent jurisdiction determines that any
+provision of this Agreement is illegal, invalid or
+unenforceable, such provision will be construed as limited to
+the extent necessary to be consistent with and fully
+enforceable under the law and the remaining provisions will
+remain in full force and effect. Unless otherwise specified,
+remedies are cumulative.
+
+Each party acknowledges and agrees that the other is an
+independent contractor in the performance of this Agreement.
+
+The SDK has been developed entirely at private expense and is
+ācommercial itemsā consisting of ācommercial computer
+softwareā and ācommercial computer software
+documentationā provided with RESTRICTED RIGHTS. Use,
+duplication or disclosure by the U.S. Government or a U.S.
+Government subcontractor is subject to the restrictions in
+this Agreement pursuant to DFARS 227.7202-3(a) or as set forth
+in subparagraphs (c)(1) and (2) of the Commercial Computer
+Software - Restricted Rights clause at FAR 52.227-19, as
+applicable. Contractor/manufacturer is NVIDIA, 2788 San Tomas
+Expressway, Santa Clara, CA 95051.
+
+The SDK is subject to United States export laws and
+regulations. You agree that you will not ship, transfer or
+export the SDK into any country, or use the SDK in any manner,
+prohibited by the United States Bureau of Industry and
+Security or economic sanctions regulations administered by the
+U.S. Department of Treasuryās Office of Foreign Assets
+Control (OFAC), or any applicable export laws, restrictions or
+regulations. These laws include restrictions on destinations,
+end users and end use. By accepting this Agreement, you
+confirm that you are not a resident or citizen of any country
+currently embargoed by the U.S. and that you are not otherwise
+prohibited from receiving the SDK.
+
+Any notice delivered by NVIDIA to you under this Agreement
+will be delivered via mail, email or fax. You agree that any
+notices that NVIDIA sends you electronically will satisfy any
+legal communication requirements. Please direct your legal
+notices or other correspondence to NVIDIA Corporation, 2788
+San Tomas Expressway, Santa Clara, California 95051, United
+States of America, Attention: Legal Department.
+
+This Agreement and any exhibits incorporated into this
+Agreement constitute the entire agreement of the parties with
+respect to the subject matter of this Agreement and supersede
+all prior negotiations or documentation exchanged between the
+parties relating to this SDK license. Any additional and/or
+conflicting terms on documents issued by you are null, void,
+and invalid. Any amendment or waiver under this Agreement
+shall be in writing and signed by representatives of both
+parties.
+
+
+2. CUDA Toolkit Supplement to Software License Agreement for
+NVIDIA Software Development Kits
+------------------------------------------------------------
+
+
+Release date: August 16, 2018
+-----------------------------
+
+The terms in this supplement govern your use of the NVIDIA
+CUDA Toolkit SDK under the terms of your license agreement
+(āAgreementā) as modified by this supplement. Capitalized
+terms used but not defined below have the meaning assigned to
+them in the Agreement.
+
+This supplement is an exhibit to the Agreement and is
+incorporated as an integral part of the Agreement. In the
+event of conflict between the terms in this supplement and the
+terms in the Agreement, the terms in this supplement govern.
+
+
+2.1. License Scope
+
+The SDK is licensed for you to develop applications only for
+use in systems with NVIDIA GPUs.
+
+
+2.2. Distribution
+
+The portions of the SDK that are distributable under the
+Agreement are listed in Attachment A.
+
+
+2.3. Operating Systems
+
+Those portions of the SDK designed exclusively for use on the
+Linux or FreeBSD operating systems, or other operating systems
+derived from the source code to these operating systems, may
+be copied and redistributed for use in accordance with this
+Agreement, provided that the object code files are not
+modified in any way (except for unzipping of compressed
+files).
+
+
+2.4. Audio and Video Encoders and Decoders
+
+You acknowledge and agree that it is your sole responsibility
+to obtain any additional third-party licenses required to
+make, have made, use, have used, sell, import, and offer for
+sale your products or services that include or incorporate any
+third-party software and content relating to audio and/or
+video encoders and decoders from, including but not limited
+to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A.,
+MPEG-LA, and Coding Technologies. NVIDIA does not grant to you
+under this Agreement any necessary patent or other rights with
+respect to any audio and/or video encoders and decoders.
+
+
+2.5. Licensing
+
+If the distribution terms in this Agreement are not suitable
+for your organization, or for any questions regarding this
+Agreement, please contact NVIDIA at
+nvidia-compute-license-questions@nvidia.com.
+
+
+2.6. Attachment A
+
+The following portions of the SDK are distributable under the
+Agreement:
+
+Component
+
+CUDA Runtime
+
+Windows
+
+cudart.dll, cudart_static.lib, cudadevrt.lib
+
+Mac OSX
+
+libcudart.dylib, libcudart_static.a, libcudadevrt.a
+
+Linux
+
+libcudart.so, libcudart_static.a, libcudadevrt.a
+
+Android
+
+libcudart.so, libcudart_static.a, libcudadevrt.a
+
+Component
+
+CUDA FFT Library
+
+Windows
+
+cufft.dll, cufftw.dll, cufft.lib, cufftw.lib
+
+Mac OSX
+
+libcufft.dylib, libcufft_static.a, libcufftw.dylib,
+libcufftw_static.a
+
+Linux
+
+libcufft.so, libcufft_static.a, libcufftw.so,
+libcufftw_static.a
+
+Android
+
+libcufft.so, libcufft_static.a, libcufftw.so,
+libcufftw_static.a
+
+Component
+
+CUDA BLAS Library
+
+Windows
+
+cublas.dll, cublasLt.dll
+
+Mac OSX
+
+libcublas.dylib, libcublasLt.dylib, libcublas_static.a,
+libcublasLt_static.a
+
+Linux
+
+libcublas.so, libcublasLt.so, libcublas_static.a,
+libcublasLt_static.a
+
+Android
+
+libcublas.so, libcublasLt.so, libcublas_static.a,
+libcublasLt_static.a
+
+Component
+
+NVIDIA "Drop-in" BLAS Library
+
+Windows
+
+nvblas.dll
+
+Mac OSX
+
+libnvblas.dylib
+
+Linux
+
+libnvblas.so
+
+Component
+
+CUDA Sparse Matrix Library
+
+Windows
+
+cusparse.dll, cusparse.lib
+
+Mac OSX
+
+libcusparse.dylib, libcusparse_static.a
+
+Linux
+
+libcusparse.so, libcusparse_static.a
+
+Android
+
+libcusparse.so, libcusparse_static.a
+
+Component
+
+CUDA Linear Solver Library
+
+Windows
+
+cusolver.dll, cusolver.lib
+
+Mac OSX
+
+libcusolver.dylib, libcusolver_static.a
+
+Linux
+
+libcusolver.so, libcusolver_static.a
+
+Android
+
+libcusolver.so, libcusolver_static.a
+
+Component
+
+CUDA Random Number Generation Library
+
+Windows
+
+curand.dll, curand.lib
+
+Mac OSX
+
+libcurand.dylib, libcurand_static.a
+
+Linux
+
+libcurand.so, libcurand_static.a
+
+Android
+
+libcurand.so, libcurand_static.a
+
+Component
+
+CUDA Accelerated Graph Library
+
+Component
+
+NVIDIA Performance Primitives Library
+
+Windows
+
+nppc.dll, nppc.lib, nppial.dll, nppial.lib, nppicc.dll,
+nppicc.lib, nppicom.dll, nppicom.lib, nppidei.dll,
+nppidei.lib, nppif.dll, nppif.lib, nppig.dll, nppig.lib,
+nppim.dll, nppim.lib, nppist.dll, nppist.lib, nppisu.dll,
+nppisu.lib, nppitc.dll, nppitc.lib, npps.dll, npps.lib
+
+Mac OSX
+
+libnppc.dylib, libnppc_static.a, libnppial.dylib,
+libnppial_static.a, libnppicc.dylib, libnppicc_static.a,
+libnppicom.dylib, libnppicom_static.a, libnppidei.dylib,
+libnppidei_static.a, libnppif.dylib, libnppif_static.a,
+libnppig.dylib, libnppig_static.a, libnppim.dylib,
+libnppisu_static.a, libnppitc.dylib, libnppitc_static.a,
+libnpps.dylib, libnpps_static.a
+
+Linux
+
+libnppc.so, libnppc_static.a, libnppial.so,
+libnppial_static.a, libnppicc.so, libnppicc_static.a,
+libnppicom.so, libnppicom_static.a, libnppidei.so,
+libnppidei_static.a, libnppif.so, libnppif_static.a
+libnppig.so, libnppig_static.a, libnppim.so,
+libnppim_static.a, libnppist.so, libnppist_static.a,
+libnppisu.so, libnppisu_static.a, libnppitc.so
+libnppitc_static.a, libnpps.so, libnpps_static.a
+
+Android
+
+libnppc.so, libnppc_static.a, libnppial.so,
+libnppial_static.a, libnppicc.so, libnppicc_static.a,
+libnppicom.so, libnppicom_static.a, libnppidei.so,
+libnppidei_static.a, libnppif.so, libnppif_static.a
+libnppig.so, libnppig_static.a, libnppim.so,
+libnppim_static.a, libnppist.so, libnppist_static.a,
+libnppisu.so, libnppisu_static.a, libnppitc.so
+libnppitc_static.a, libnpps.so, libnpps_static.a
+
+Component
+
+NVIDIA JPEG Library
+
+Linux
+
+libnvjpeg.so, libnvjpeg_static.a
+
+Component
+
+Internal common library required for statically linking to
+cuBLAS, cuSPARSE, cuFFT, cuRAND, nvJPEG and NPP
+
+Mac OSX
+
+libculibos.a
+
+Linux
+
+libculibos.a
+
+Component
+
+NVIDIA Runtime Compilation Library and Header
+
+All
+
+nvrtc.h
+
+Windows
+
+nvrtc.dll, nvrtc-builtins.dll
+
+Mac OSX
+
+libnvrtc.dylib, libnvrtc-builtins.dylib
+
+Linux
+
+libnvrtc.so, libnvrtc-builtins.so
+
+Component
+
+NVIDIA Optimizing Compiler Library
+
+Windows
+
+nvvm.dll
+
+Mac OSX
+
+libnvvm.dylib
+
+Linux
+
+libnvvm.so
+
+Component
+
+NVIDIA Common Device Math Functions Library
+
+Windows
+
+libdevice.10.bc
+
+Mac OSX
+
+libdevice.10.bc
+
+Linux
+
+libdevice.10.bc
+
+Component
+
+CUDA Occupancy Calculation Header Library
+
+All
+
+cuda_occupancy.h
+
+Component
+
+CUDA Half Precision Headers
+
+All
+
+cuda_fp16.h, cuda_fp16.hpp
+
+Component
+
+CUDA Profiling Tools Interface (CUPTI) Library
+
+Windows
+
+cupti.dll
+
+Mac OSX
+
+libcupti.dylib
+
+Linux
+
+libcupti.so
+
+Component
+
+NVIDIA Tools Extension Library
+
+Windows
+
+nvToolsExt.dll, nvToolsExt.lib
+
+Mac OSX
+
+libnvToolsExt.dylib
+
+Linux
+
+libnvToolsExt.so
+
+Component
+
+NVIDIA CUDA Driver Libraries
+
+Linux
+
+libcuda.so, libnvidia-fatbinaryloader.so,
+libnvidia-ptxjitcompiler.so
+
+The NVIDIA CUDA Driver Libraries are only distributable in
+applications that meet this criteria:
+
+ 1. The application was developed starting from a NVIDIA CUDA
+ container obtained from Docker Hub or the NVIDIA GPU
+ Cloud, and
+
+ 2. The resulting application is packaged as a Docker
+ container and distributed to users on Docker Hub or the
+ NVIDIA GPU Cloud only.
+
+
+2.7. Attachment B
+
+
+Additional Licensing Obligations
+
+The following third party components included in the SOFTWARE
+are licensed to Licensee pursuant to the following terms and
+conditions:
+
+ 1. Licensee's use of the GDB third party component is
+ subject to the terms and conditions of GNU GPL v3:
+
+ This product includes copyrighted third-party software licensed
+ under the terms of the GNU General Public License v3 ("GPL v3").
+ All third-party software packages are copyright by their respective
+ authors. GPL v3 terms and conditions are hereby incorporated into
+ the Agreement by this reference: http://www.gnu.org/licenses/gpl.txt
+
+ Consistent with these licensing requirements, the software
+ listed below is provided under the terms of the specified
+ open source software licenses. To obtain source code for
+ software provided under licenses that require
+ redistribution of source code, including the GNU General
+ Public License (GPL) and GNU Lesser General Public License
+ (LGPL), contact oss-requests@nvidia.com. This offer is
+ valid for a period of three (3) years from the date of the
+ distribution of this product by NVIDIA CORPORATION.
+
+ Component License
+ CUDA-GDB GPL v3
+
+ 2. Licensee represents and warrants that any and all third
+ party licensing and/or royalty payment obligations in
+ connection with Licensee's use of the H.264 video codecs
+ are solely the responsibility of Licensee.
+
+ 3. Licensee's use of the Thrust library is subject to the
+ terms and conditions of the Apache License Version 2.0.
+ All third-party software packages are copyright by their
+ respective authors. Apache License Version 2.0 terms and
+ conditions are hereby incorporated into the Agreement by
+ this reference.
+ http://www.apache.org/licenses/LICENSE-2.0.html
+
+ In addition, Licensee acknowledges the following notice:
+ Thrust includes source code from the Boost Iterator,
+ Tuple, System, and Random Number libraries.
+
+ Boost Software License - Version 1.0 - August 17th, 2003
+ . . . .
+
+ Permission is hereby granted, free of charge, to any person or
+ organization obtaining a copy of the software and accompanying
+ documentation covered by this license (the "Software") to use,
+ reproduce, display, distribute, execute, and transmit the Software,
+ and to prepare derivative works of the Software, and to permit
+ third-parties to whom the Software is furnished to do so, all
+ subject to the following:
+
+ The copyright notices in the Software and this entire statement,
+ including the above license grant, this restriction and the following
+ disclaimer, must be included in all copies of the Software, in whole
+ or in part, and all derivative works of the Software, unless such
+ copies or derivative works are solely in the form of machine-executable
+ object code generated by a source language processor.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+ NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
+ OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+ 4. Licensee's use of the LLVM third party component is
+ subject to the following terms and conditions:
+
+ ======================================================
+ LLVM Release License
+ ======================================================
+ University of Illinois/NCSA
+ Open Source License
+
+ Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.
+ All rights reserved.
+
+ Developed by:
+
+ LLVM Team
+
+ University of Illinois at Urbana-Champaign
+
+ http://llvm.org
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to
+ deal with the Software without restriction, including without limitation the
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimers.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimers in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of the LLVM Team, University of Illinois at Urbana-
+ Champaign, nor the names of its contributors may be used to endorse or
+ promote products derived from this Software without specific prior
+ written permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS WITH THE SOFTWARE.
+
+ 5. Licensee's use (e.g. nvprof) of the PCRE third party
+ component is subject to the following terms and
+ conditions:
+
+ ------------
+ PCRE LICENCE
+ ------------
+ PCRE is a library of functions to support regular expressions whose syntax
+ and semantics are as close as possible to those of the Perl 5 language.
+ Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
+ specified below. The documentation for PCRE, supplied in the "doc"
+ directory, is distributed under the same terms as the software itself. The
+ basic library functions are written in C and are freestanding. Also
+ included in the distribution is a set of C++ wrapper functions, and a just-
+ in-time compiler that can be used to optimize pattern matching. These are
+ both optional features that can be omitted when the library is built.
+
+ THE BASIC LIBRARY FUNCTIONS
+ ---------------------------
+ Written by: Philip Hazel
+ Email local part: ph10
+ Email domain: cam.ac.uk
+ University of Cambridge Computing Service,
+ Cambridge, England.
+ Copyright (c) 1997-2012 University of Cambridge
+ All rights reserved.
+
+ PCRE JUST-IN-TIME COMPILATION SUPPORT
+ -------------------------------------
+ Written by: Zoltan Herczeg
+ Email local part: hzmester
+ Emain domain: freemail.hu
+ Copyright(c) 2010-2012 Zoltan Herczeg
+ All rights reserved.
+
+ STACK-LESS JUST-IN-TIME COMPILER
+ --------------------------------
+ Written by: Zoltan Herczeg
+ Email local part: hzmester
+ Emain domain: freemail.hu
+ Copyright(c) 2009-2012 Zoltan Herczeg
+ All rights reserved.
+
+ THE C++ WRAPPER FUNCTIONS
+ -------------------------
+ Contributed by: Google Inc.
+ Copyright (c) 2007-2012, Google Inc.
+ All rights reserved.
+
+ THE "BSD" LICENCE
+ -----------------
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the name of the University of Cambridge nor the name of Google
+ Inc. nor the names of their contributors may be used to endorse or
+ promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ 6. Some of the cuBLAS library routines were written by or
+ derived from code written by Vasily Volkov and are subject
+ to the Modified Berkeley Software Distribution License as
+ follows:
+
+ Copyright (c) 2007-2009, Regents of the University of California
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the University of California, Berkeley nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ 7. Some of the cuBLAS library routines were written by or
+ derived from code written by Davide Barbieri and are
+ subject to the Modified Berkeley Software Distribution
+ License as follows:
+
+ Copyright (c) 2008-2009 Davide Barbieri @ University of Rome Tor Vergata.
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+
+ 8. Some of the cuBLAS library routines were derived from
+ code developed by the University of Tennessee and are
+ subject to the Modified Berkeley Software Distribution
+ License as follows:
+
+ Copyright (c) 2010 The University of Tennessee.
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer listed in this license in the documentation and/or
+ other materials provided with the distribution.
+ * Neither the name of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 9. Some of the cuBLAS library routines were written by or
+ derived from code written by Jonathan Hogg and are subject
+ to the Modified Berkeley Software Distribution License as
+ follows:
+
+ Copyright (c) 2012, The Science and Technology Facilities Council (STFC).
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the STFC nor the names of its contributors
+ may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE STFC BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 10. Some of the cuBLAS library routines were written by or
+ derived from code written by Ahmad M. Abdelfattah, David
+ Keyes, and Hatem Ltaief, and are subject to the Apache
+ License, Version 2.0, as follows:
+
+ -- (C) Copyright 2013 King Abdullah University of Science and Technology
+ Authors:
+ Ahmad Abdelfattah (ahmad.ahmad@kaust.edu.sa)
+ David Keyes (david.keyes@kaust.edu.sa)
+ Hatem Ltaief (hatem.ltaief@kaust.edu.sa)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the King Abdullah University of Science and
+ Technology nor the names of its contributors may be used to endorse
+ or promote products derived from this software without specific prior
+ written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
+
+ 11. Some of the cuSPARSE library routines were written by or
+ derived from code written by Li-Wen Chang and are subject
+ to the NCSA Open Source License as follows:
+
+ Copyright (c) 2012, University of Illinois.
+
+ All rights reserved.
+
+ Developed by: IMPACT Group, University of Illinois, http://impact.crhc.illinois.edu
+
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal with the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimers in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the names of IMPACT Group, University of Illinois, nor
+ the names of its contributors may be used to endorse or promote
+ products derived from this Software without specific prior
+ written permission.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+ SOFTWARE.
+
+ 12. Some of the cuRAND library routines were written by or
+ derived from code written by Mutsuo Saito and Makoto
+ Matsumoto and are subject to the following license:
+
+ Copyright (c) 2009, 2010 Mutsuo Saito, Makoto Matsumoto and Hiroshima
+ University. All rights reserved.
+
+ Copyright (c) 2011 Mutsuo Saito, Makoto Matsumoto, Hiroshima
+ University and University of Tokyo. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the Hiroshima University nor the names of
+ its contributors may be used to endorse or promote products
+ derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 13. Some of the cuRAND library routines were derived from
+ code developed by D. E. Shaw Research and are subject to
+ the following license:
+
+ Copyright 2010-2011, D. E. Shaw Research.
+
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions, and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions, and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of D. E. Shaw Research nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 14. Some of the Math library routines were written by or
+ derived from code developed by Norbert Juffa and are
+ subject to the following license:
+
+ Copyright (c) 2015-2017, Norbert Juffa
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 15. Licensee's use of the lz4 third party component is
+ subject to the following terms and conditions:
+
+ Copyright (C) 2011-2013, Yann Collet.
+ BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ 16. The NPP library uses code from the Boost Math Toolkit,
+ and is subject to the following license:
+
+ Boost Software License - Version 1.0 - August 17th, 2003
+ . . . .
+
+ Permission is hereby granted, free of charge, to any person or
+ organization obtaining a copy of the software and accompanying
+ documentation covered by this license (the "Software") to use,
+ reproduce, display, distribute, execute, and transmit the Software,
+ and to prepare derivative works of the Software, and to permit
+ third-parties to whom the Software is furnished to do so, all
+ subject to the following:
+
+ The copyright notices in the Software and this entire statement,
+ including the above license grant, this restriction and the following
+ disclaimer, must be included in all copies of the Software, in whole
+ or in part, and all derivative works of the Software, unless such
+ copies or derivative works are solely in the form of machine-executable
+ object code generated by a source language processor.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+ NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR
+ OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+ 17. Portions of the Nsight Eclipse Edition is subject to the
+ following license:
+
+ The Eclipse Foundation makes available all content in this plug-in
+ ("Content"). Unless otherwise indicated below, the Content is provided
+ to you under the terms and conditions of the Eclipse Public License
+ Version 1.0 ("EPL"). A copy of the EPL is available at http://
+ www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, "Program"
+ will mean the Content.
+
+ If you did not receive this Content directly from the Eclipse
+ Foundation, the Content is being redistributed by another party
+ ("Redistributor") and different terms and conditions may apply to your
+ use of any object code in the Content. Check the Redistributor's
+ license that was provided with the Content. If no such license exists,
+ contact the Redistributor. Unless otherwise indicated below, the terms
+ and conditions of the EPL still apply to any source code in the
+ Content and such source code may be obtained at http://www.eclipse.org.
+
+ 18. Some of the cuBLAS library routines uses code from
+ OpenAI, which is subject to the following license:
+
+ License URL
+ https://github.com/openai/openai-gemm/blob/master/LICENSE
+
+ License Text
+ The MIT License
+
+ Copyright (c) 2016 OpenAI (http://openai.com), 2016 Google Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+ 19. Licensee's use of the Visual Studio Setup Configuration
+ Samples is subject to the following license:
+
+ The MIT License (MIT)
+ Copyright (C) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+ 20. Licensee's use of linmath.h header for CPU functions for
+ GL vector/matrix operations from lunarG is subject to the
+ Apache License Version 2.0.
+
+ 21. The DX12-CUDA sample uses the d3dx12.h header, which is
+ subject to the MIT license .
+
+-----------------
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/METADATA b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/METADATA
new file mode 100644
index 0000000000000000000000000000000000000000..141e4b02365e42ffe388ece5f1e835abc8b34892
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/METADATA
@@ -0,0 +1,36 @@
+Metadata-Version: 2.1
+Name: nvidia-cufft-cu12
+Version: 11.3.0.4
+Summary: CUFFT native runtime libraries
+Home-page: https://developer.nvidia.com/cuda-zone
+Author: Nvidia CUDA Installer Team
+Author-email: compute_installer@nvidia.com
+License: NVIDIA Proprietary Software
+Keywords: cuda,nvidia,runtime,machine learning,deep learning
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: Intended Audience :: Education
+Classifier: Intended Audience :: Science/Research
+Classifier: License :: Other/Proprietary License
+Classifier: Natural Language :: English
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Topic :: Scientific/Engineering
+Classifier: Topic :: Scientific/Engineering :: Mathematics
+Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
+Classifier: Topic :: Software Development
+Classifier: Topic :: Software Development :: Libraries
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: POSIX :: Linux
+Requires-Python: >=3
+License-File: License.txt
+Requires-Dist: nvidia-nvjitlink-cu12
+
+CUFFT native runtime libraries
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/RECORD b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/RECORD
new file mode 100644
index 0000000000000000000000000000000000000000..436a69d996f04cc8fc69fb009b311177e4b5978a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/RECORD
@@ -0,0 +1,17 @@
+nvidia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia/cufft/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia/cufft/include/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia/cufft/include/cudalibxt.h,sha256=9GDuRiOzJuO61zRDhIpWpF7XHp8FXSOIlHJNoIMwOZQ,4105
+nvidia/cufft/include/cufft.h,sha256=tRmMP4GNmrU02vzF0y2SK11BM8TQTK5heMYLE41GYJE,13168
+nvidia/cufft/include/cufftXt.h,sha256=R3MUFHMNqMae71HwFKPPcShI1HTJbHJYdrr-cRvqXe8,12945
+nvidia/cufft/include/cufftw.h,sha256=Uzfj1IVMlLQU_G50u84hXYX1K95HLXIwOcjQoAg5pGE,20051
+nvidia/cufft/lib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia/cufft/lib/libcufft.so.11,sha256=jn9S9etCsousKZQ6EhPZQL9MWb-fcwJyhkdKfY99yKI,278925008
+nvidia/cufft/lib/libcufftw.so.11,sha256=F7I1Q_kvRsC19ckNab6SjxuRjTfc7L9Fir0uI_RZgDI,2101480
+nvidia_cufft_cu12-11.3.0.4.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
+nvidia_cufft_cu12-11.3.0.4.dist-info/License.txt,sha256=rW9YU_ugyg0VnQ9Y1JrkmDDC-Mk_epJki5zpCttMbM0,59262
+nvidia_cufft_cu12-11.3.0.4.dist-info/METADATA,sha256=Uw97r58LKC1RLamKnlzHx1n9cmezU6qMz0dNlucv2Zc,1542
+nvidia_cufft_cu12-11.3.0.4.dist-info/RECORD,,
+nvidia_cufft_cu12-11.3.0.4.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia_cufft_cu12-11.3.0.4.dist-info/WHEEL,sha256=CLmCDi-3U0BMEYIar4BKFH4TFOkRFoYVA_v18zlwuO4,144
+nvidia_cufft_cu12-11.3.0.4.dist-info/top_level.txt,sha256=fTkAtiFuL16nUrB9ytDDtpytz2t0B4NvYTnRzwAhO14,7
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/REQUESTED b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/REQUESTED
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/WHEEL b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/WHEEL
new file mode 100644
index 0000000000000000000000000000000000000000..2a0a8619b008383b2915207329f5dd00736ccb31
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/WHEEL
@@ -0,0 +1,6 @@
+Wheel-Version: 1.0
+Generator: setuptools (75.3.0)
+Root-Is-Purelib: true
+Tag: py3-none-manylinux2014_x86_64
+Tag: py3-none-manylinux_2_17_x86_64
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/top_level.txt b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/top_level.txt
new file mode 100644
index 0000000000000000000000000000000000000000..862f7abf232cdfbb928609856247292e81c9decb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cufft_cu12-11.3.0.4.dist-info/top_level.txt
@@ -0,0 +1 @@
+nvidia
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/INSTALLER b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/INSTALLER
new file mode 100644
index 0000000000000000000000000000000000000000..5c69047b2eb8235994febeeae1da4a82365a240a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/INSTALLER
@@ -0,0 +1 @@
+uv
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/METADATA b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/METADATA
new file mode 100644
index 0000000000000000000000000000000000000000..1b1fcc8bf29df72a07f1702416d8c9e4995e208a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/METADATA
@@ -0,0 +1,129 @@
+Metadata-Version: 2.1
+Name: nvidia-cusparselt-cu12
+Version: 0.6.3
+Summary: NVIDIA cuSPARSELt
+Home-page: https://developer.nvidia.com/cusparselt
+Author: NVIDIA Corporation
+Author-email: cuda_installer@nvidia.com
+License: NVIDIA Proprietary Software
+Keywords: cuda,nvidia,machine learning,high-performance computing
+Classifier: Topic :: Scientific/Engineering
+Classifier: Environment :: GPU :: NVIDIA CUDA
+Classifier: Environment :: GPU :: NVIDIA CUDA :: 12
+Description-Content-Type: text/x-rst
+
+###################################################################################
+cuSPARSELt: A High-Performance CUDA Library for Sparse Matrix-Matrix Multiplication
+###################################################################################
+
+**NVIDIA cuSPARSELt** is a high-performance CUDA library dedicated to general matrix-matrix operations in which at least one operand is a sparse matrix:
+
+.. math::
+
+ D = Activation(\alpha op(A) \cdot op(B) + \beta op(C) + bias) \cdot scale
+
+where :math:`op(A)/op(B)` refers to in-place operations such as transpose/non-transpose, and :math:`alpha, beta, scale` are scalars.
+
+The *cuSPARSELt APIs* allow flexibility in the algorithm/operation selection, epilogue, and matrix characteristics, including memory layout, alignment, and data types.
+
+**Download:** `developer.nvidia.com/cusparselt/downloads `_
+
+**Provide Feedback:** `Math-Libs-Feedback@nvidia.com `_
+
+**Examples**:
+`cuSPARSELt Example 1 `_,
+`cuSPARSELt Example 2 `_
+
+**Blog post**:
+
+- `Exploiting NVIDIA Ampere Structured Sparsity with cuSPARSELt `_
+- `Structured Sparsity in the NVIDIA Ampere Architecture and Applications in Search Engines `__
+- `Making the Most of Structured Sparsity in the NVIDIA Ampere Architecture `__
+
+================================================================================
+Key Features
+================================================================================
+
+* *NVIDIA Sparse MMA tensor core* support
+* Mixed-precision computation support:
+
+ +--------------+----------------+-----------------+-------------+
+ | Input A/B | Input C | Output D | Compute |
+ +==============+================+=================+=============+
+ | `FP32` | `FP32` | `FP32` | `FP32` |
+ +--------------+----------------+-----------------+-------------+
+ | `FP16` | `FP16` | `FP16` | `FP32` |
+ + + + +-------------+
+ | | | | `FP16` |
+ +--------------+----------------+-----------------+-------------+
+ | `BF16` | `BF16` | `BF16` | `FP32` |
+ +--------------+----------------+-----------------+-------------+
+ | `INT8` | `INT8` | `INT8` | `INT32` |
+ + +----------------+-----------------+ +
+ | | `INT32` | `INT32` | |
+ + +----------------+-----------------+ +
+ | | `FP16` | `FP16` | |
+ + +----------------+-----------------+ +
+ | | `BF16` | `BF16` | |
+ +--------------+----------------+-----------------+-------------+
+ | `E4M3` | `FP16` | `E4M3` | `FP32` |
+ + +----------------+-----------------+ +
+ | | `BF16` | `E4M3` | |
+ + +----------------+-----------------+ +
+ | | `FP16` | `FP16` | |
+ + +----------------+-----------------+ +
+ | | `BF16` | `BF16` | |
+ + +----------------+-----------------+ +
+ | | `FP32` | `FP32` | |
+ +--------------+----------------+-----------------+-------------+
+ | `E5M2` | `FP16` | `E5M2` | `FP32` |
+ + +----------------+-----------------+ +
+ | | `BF16` | `E5M2` | |
+ + +----------------+-----------------+ +
+ | | `FP16` | `FP16` | |
+ + +----------------+-----------------+ +
+ | | `BF16` | `BF16` | |
+ + +----------------+-----------------+ +
+ | | `FP32` | `FP32` | |
+ +--------------+----------------+-----------------+-------------+
+
+* Matrix pruning and compression functionalities
+* Activation functions, bias vector, and output scaling
+* Batched computation (multiple matrices in a single run)
+* GEMM Split-K mode
+* Auto-tuning functionality (see `cusparseLtMatmulSearch()`)
+* NVTX ranging and Logging functionalities
+
+================================================================================
+Support
+================================================================================
+
+* *Supported SM Architectures*: `SM 8.0`, `SM 8.6`, `SM 8.9`, `SM 9.0`
+* *Supported CPU architectures and operating systems*:
+
++------------+--------------------+
+| OS | CPU archs |
++============+====================+
+| `Windows` | `x86_64` |
++------------+--------------------+
+| `Linux` | `x86_64`, `Arm64` |
++------------+--------------------+
+
+
+================================================================================
+Documentation
+================================================================================
+
+Please refer to https://docs.nvidia.com/cuda/cusparselt/index.html for the cuSPARSELt documentation.
+
+================================================================================
+Installation
+================================================================================
+
+The cuSPARSELt wheel can be installed as follows:
+
+.. code-block:: bash
+
+ pip install nvidia-cusparselt-cuXX
+
+where XX is the CUDA major version (currently CUDA 12 only is supported).
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/RECORD b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/RECORD
new file mode 100644
index 0000000000000000000000000000000000000000..1346ec771be6a3891f9e481b394d546c0949956e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/RECORD
@@ -0,0 +1,9 @@
+cusparselt/LICENSE.txt,sha256=6NFYiFpoG5Xsem_AbdjUpSmJ83TLE4DIpMj7J_09XV4,17948
+cusparselt/include/cusparseLt.h,sha256=3k5paHVVxmvhgj2UaclraSGK6ols2_8iOCZC2z3yc6k,16823
+cusparselt/lib/libcusparseLt.so.0,sha256=yMmBLIkdEv-ypN7jE0y2JwWxeVTHU0CN_gAYU60FHCk,237384129
+nvidia_cusparselt_cu12-0.6.3.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
+nvidia_cusparselt_cu12-0.6.3.dist-info/METADATA,sha256=2e9DmvT6t_aDmgPuxb_xqu0mkD6heg51sTbG0-acixE,6768
+nvidia_cusparselt_cu12-0.6.3.dist-info/RECORD,,
+nvidia_cusparselt_cu12-0.6.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+nvidia_cusparselt_cu12-0.6.3.dist-info/WHEEL,sha256=KCwKXpGGtPAep0bin_k7BN5gmRojqgBlmmZ8K9WRvPo,108
+nvidia_cusparselt_cu12-0.6.3.dist-info/top_level.txt,sha256=xqh0KNKTy3sVRvMfvpVzqXt3n2uEz0ruWp1XKEDANvk,11
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/REQUESTED b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/REQUESTED
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/WHEEL b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/WHEEL
new file mode 100644
index 0000000000000000000000000000000000000000..a02c495306656cad739a5b927cff72621c10ef40
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/WHEEL
@@ -0,0 +1,5 @@
+Wheel-Version: 1.0
+Generator: setuptools (75.1.0)
+Root-Is-Purelib: true
+Tag: py3-none-manylinux2014_x86_64
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/top_level.txt b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/top_level.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c46ed7c937f80185a9d1cafc27f6a64aa846fe07
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/nvidia_cusparselt_cu12-0.6.3.dist-info/top_level.txt
@@ -0,0 +1 @@
+cusparselt
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/INSTALLER b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/INSTALLER
new file mode 100644
index 0000000000000000000000000000000000000000..5c69047b2eb8235994febeeae1da4a82365a240a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/INSTALLER
@@ -0,0 +1 @@
+uv
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/METADATA b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/METADATA
new file mode 100644
index 0000000000000000000000000000000000000000..10b290a6cd1770506ae281a5fa469f6c110c364c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/METADATA
@@ -0,0 +1,105 @@
+Metadata-Version: 2.4
+Name: packaging
+Version: 25.0
+Summary: Core utilities for Python packages
+Author-email: Donald Stufft
+Requires-Python: >=3.8
+Description-Content-Type: text/x-rst
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: License :: OSI Approved :: BSD License
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3 :: Only
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
+Classifier: Programming Language :: Python :: 3.13
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Classifier: Programming Language :: Python :: Implementation :: PyPy
+Classifier: Typing :: Typed
+License-File: LICENSE
+License-File: LICENSE.APACHE
+License-File: LICENSE.BSD
+Project-URL: Documentation, https://packaging.pypa.io/
+Project-URL: Source, https://github.com/pypa/packaging
+
+packaging
+=========
+
+.. start-intro
+
+Reusable core utilities for various Python Packaging
+`interoperability specifications `_.
+
+This library provides utilities that implement the interoperability
+specifications which have clearly one correct behaviour (eg: :pep:`440`)
+or benefit greatly from having a single shared implementation (eg: :pep:`425`).
+
+.. end-intro
+
+The ``packaging`` project includes the following: version handling, specifiers,
+markers, requirements, tags, utilities.
+
+Documentation
+-------------
+
+The `documentation`_ provides information and the API for the following:
+
+- Version Handling
+- Specifiers
+- Markers
+- Requirements
+- Tags
+- Utilities
+
+Installation
+------------
+
+Use ``pip`` to install these utilities::
+
+ pip install packaging
+
+The ``packaging`` library uses calendar-based versioning (``YY.N``).
+
+Discussion
+----------
+
+If you run into bugs, you can file them in our `issue tracker`_.
+
+You can also join ``#pypa`` on Freenode to ask questions or get involved.
+
+
+.. _`documentation`: https://packaging.pypa.io/
+.. _`issue tracker`: https://github.com/pypa/packaging/issues
+
+
+Code of Conduct
+---------------
+
+Everyone interacting in the packaging project's codebases, issue trackers, chat
+rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
+
+.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
+
+Contributing
+------------
+
+The ``CONTRIBUTING.rst`` file outlines how to contribute to this project as
+well as how to report a potential security issue. The documentation for this
+project also covers information about `project development`_ and `security`_.
+
+.. _`project development`: https://packaging.pypa.io/en/latest/development/
+.. _`security`: https://packaging.pypa.io/en/latest/security/
+
+Project History
+---------------
+
+Please review the ``CHANGELOG.rst`` file or the `Changelog documentation`_ for
+recent changes and project history.
+
+.. _`Changelog documentation`: https://packaging.pypa.io/en/latest/changelog/
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/RECORD b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/RECORD
new file mode 100644
index 0000000000000000000000000000000000000000..08a804a1afe26f889b18e09de0bb62cfc3ad36f1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/RECORD
@@ -0,0 +1,25 @@
+packaging-25.0.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
+packaging-25.0.dist-info/METADATA,sha256=W2EaYJw4_vw9YWv0XSCuyY-31T8kXayp4sMPyFx6woI,3281
+packaging-25.0.dist-info/RECORD,,
+packaging-25.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+packaging-25.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
+packaging-25.0.dist-info/licenses/LICENSE,sha256=ytHvW9NA1z4HS6YU0m996spceUDD2MNIUuZcSQlobEg,197
+packaging-25.0.dist-info/licenses/LICENSE.APACHE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
+packaging-25.0.dist-info/licenses/LICENSE.BSD,sha256=tw5-m3QvHMb5SLNMFqo5_-zpQZY2S8iP8NIYDwAo-sU,1344
+packaging/__init__.py,sha256=_0cDiPVf2S-bNfVmZguxxzmrIYWlyASxpqph4qsJWUc,494
+packaging/_elffile.py,sha256=UkrbDtW7aeq3qqoAfU16ojyHZ1xsTvGke_WqMTKAKd0,3286
+packaging/_manylinux.py,sha256=t4y_-dTOcfr36gLY-ztiOpxxJFGO2ikC11HgfysGxiM,9596
+packaging/_musllinux.py,sha256=p9ZqNYiOItGee8KcZFeHF_YcdhVwGHdK6r-8lgixvGQ,2694
+packaging/_parser.py,sha256=gYfnj0pRHflVc4RHZit13KNTyN9iiVcU2RUCGi22BwM,10221
+packaging/_structures.py,sha256=q3eVNmbWJGG_S0Dit_S3Ao8qQqz_5PYTXFAKBZe5yr4,1431
+packaging/_tokenizer.py,sha256=OYzt7qKxylOAJ-q0XyK1qAycyPRYLfMPdGQKRXkZWyI,5310
+packaging/licenses/__init__.py,sha256=VsK4o27CJXWfTi8r2ybJmsBoCdhpnBWuNrskaCVKP7U,5715
+packaging/licenses/_spdx.py,sha256=oAm1ztPFwlsmCKe7lAAsv_OIOfS1cWDu9bNBkeu-2ns,48398
+packaging/markers.py,sha256=P0we27jm1xUzgGMJxBjtUFCIWeBxTsMeJTOJ6chZmAY,12049
+packaging/metadata.py,sha256=8IZErqQQnNm53dZZuYq4FGU4_dpyinMeH1QFBIWIkfE,34739
+packaging/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+packaging/requirements.py,sha256=gYyRSAdbrIyKDY66ugIDUQjRMvxkH2ALioTmX3tnL6o,2947
+packaging/specifiers.py,sha256=gtPu5DTc-F9baLq3FTGEK6dPhHGCuwwZetaY0PSV2gs,40055
+packaging/tags.py,sha256=41s97W9Zatrq2Ed7Rc3qeBDaHe8pKKvYq2mGjwahfXk,22745
+packaging/utils.py,sha256=0F3Hh9OFuRgrhTgGZUl5K22Fv1YP2tZl1z_2gO6kJiA,5050
+packaging/version.py,sha256=olfyuk_DPbflNkJ4wBWetXQ17c74x3DB501degUv7DY,16676
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/REQUESTED b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/REQUESTED
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/WHEEL b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/WHEEL
new file mode 100644
index 0000000000000000000000000000000000000000..d8b9936dad9ab2513fa6979f411560d3b6b57e37
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/WHEEL
@@ -0,0 +1,4 @@
+Wheel-Version: 1.0
+Generator: flit 3.12.0
+Root-Is-Purelib: true
+Tag: py3-none-any
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..6f62d44e4ef733c0e713afcd2371fed7f2b3de67
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE
@@ -0,0 +1,3 @@
+This software is made available under the terms of *either* of the licenses
+found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made
+under the terms of *both* these licenses.
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE.APACHE b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE.APACHE
new file mode 100644
index 0000000000000000000000000000000000000000..f433b1a53f5b830a205fd2df78e2b34974656c7b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE.APACHE
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE.BSD b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE.BSD
new file mode 100644
index 0000000000000000000000000000000000000000..42ce7b75c92fb01a3f6ed17eea363f756b7da582
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/packaging-25.0.dist-info/licenses/LICENSE.BSD
@@ -0,0 +1,23 @@
+Copyright (c) Donald Stufft and individual contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER
new file mode 100644
index 0000000000000000000000000000000000000000..5c69047b2eb8235994febeeae1da4a82365a240a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/INSTALLER
@@ -0,0 +1 @@
+uv
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/LICENSE b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..1e65815cf0b3132689485874a93034ede7206bf4
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/LICENSE
@@ -0,0 +1,54 @@
+Copyright 2017- Paul Ganssle
+Copyright 2017- dateutil contributors (see AUTHORS file)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+The above license applies to all contributions after 2017-12-01, as well as
+all contributions that have been re-licensed (see AUTHORS file for the list of
+contributors who have re-licensed their code).
+--------------------------------------------------------------------------------
+dateutil - Extensions to the standard Python datetime module.
+
+Copyright (c) 2003-2011 - Gustavo Niemeyer
+Copyright (c) 2012-2014 - Tomi PievilƤinen
+Copyright (c) 2014-2016 - Yaron de Leeuw
+Copyright (c) 2015- - Paul Ganssle
+Copyright (c) 2015- - dateutil contributors (see AUTHORS file)
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The above BSD License Applies to all code, even that also covered by Apache 2.0.
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA
new file mode 100644
index 0000000000000000000000000000000000000000..577f2bf2b7749e1b123b8225d610b1b257e430cc
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/METADATA
@@ -0,0 +1,204 @@
+Metadata-Version: 2.1
+Name: python-dateutil
+Version: 2.9.0.post0
+Summary: Extensions to the standard Python datetime module
+Home-page: https://github.com/dateutil/dateutil
+Author: Gustavo Niemeyer
+Author-email: gustavo@niemeyer.net
+Maintainer: Paul Ganssle
+Maintainer-email: dateutil@python.org
+License: Dual License
+Project-URL: Documentation, https://dateutil.readthedocs.io/en/stable/
+Project-URL: Source, https://github.com/dateutil/dateutil
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: BSD License
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
+Classifier: Topic :: Software Development :: Libraries
+Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,>=2.7
+Description-Content-Type: text/x-rst
+License-File: LICENSE
+Requires-Dist: six >=1.5
+
+dateutil - powerful extensions to datetime
+==========================================
+
+|pypi| |support| |licence|
+
+|gitter| |readthedocs|
+
+|travis| |appveyor| |pipelines| |coverage|
+
+.. |pypi| image:: https://img.shields.io/pypi/v/python-dateutil.svg?style=flat-square
+ :target: https://pypi.org/project/python-dateutil/
+ :alt: pypi version
+
+.. |support| image:: https://img.shields.io/pypi/pyversions/python-dateutil.svg?style=flat-square
+ :target: https://pypi.org/project/python-dateutil/
+ :alt: supported Python version
+
+.. |travis| image:: https://img.shields.io/travis/dateutil/dateutil/master.svg?style=flat-square&label=Travis%20Build
+ :target: https://travis-ci.org/dateutil/dateutil
+ :alt: travis build status
+
+.. |appveyor| image:: https://img.shields.io/appveyor/ci/dateutil/dateutil/master.svg?style=flat-square&logo=appveyor
+ :target: https://ci.appveyor.com/project/dateutil/dateutil
+ :alt: appveyor build status
+
+.. |pipelines| image:: https://dev.azure.com/pythondateutilazure/dateutil/_apis/build/status/dateutil.dateutil?branchName=master
+ :target: https://dev.azure.com/pythondateutilazure/dateutil/_build/latest?definitionId=1&branchName=master
+ :alt: azure pipelines build status
+
+.. |coverage| image:: https://codecov.io/gh/dateutil/dateutil/branch/master/graphs/badge.svg?branch=master
+ :target: https://codecov.io/gh/dateutil/dateutil?branch=master
+ :alt: Code coverage
+
+.. |gitter| image:: https://badges.gitter.im/dateutil/dateutil.svg
+ :alt: Join the chat at https://gitter.im/dateutil/dateutil
+ :target: https://gitter.im/dateutil/dateutil
+
+.. |licence| image:: https://img.shields.io/pypi/l/python-dateutil.svg?style=flat-square
+ :target: https://pypi.org/project/python-dateutil/
+ :alt: licence
+
+.. |readthedocs| image:: https://img.shields.io/readthedocs/dateutil/latest.svg?style=flat-square&label=Read%20the%20Docs
+ :alt: Read the documentation at https://dateutil.readthedocs.io/en/latest/
+ :target: https://dateutil.readthedocs.io/en/latest/
+
+The `dateutil` module provides powerful extensions to
+the standard `datetime` module, available in Python.
+
+Installation
+============
+`dateutil` can be installed from PyPI using `pip` (note that the package name is
+different from the importable name)::
+
+ pip install python-dateutil
+
+Download
+========
+dateutil is available on PyPI
+https://pypi.org/project/python-dateutil/
+
+The documentation is hosted at:
+https://dateutil.readthedocs.io/en/stable/
+
+Code
+====
+The code and issue tracker are hosted on GitHub:
+https://github.com/dateutil/dateutil/
+
+Features
+========
+
+* Computing of relative deltas (next month, next year,
+ next Monday, last week of month, etc);
+* Computing of relative deltas between two given
+ date and/or datetime objects;
+* Computing of dates based on very flexible recurrence rules,
+ using a superset of the `iCalendar `_
+ specification. Parsing of RFC strings is supported as well.
+* Generic parsing of dates in almost any string format;
+* Timezone (tzinfo) implementations for tzfile(5) format
+ files (/etc/localtime, /usr/share/zoneinfo, etc), TZ
+ environment string (in all known formats), iCalendar
+ format files, given ranges (with help from relative deltas),
+ local machine timezone, fixed offset timezone, UTC timezone,
+ and Windows registry-based time zones.
+* Internal up-to-date world timezone information based on
+ Olson's database.
+* Computing of Easter Sunday dates for any given year,
+ using Western, Orthodox or Julian algorithms;
+* A comprehensive test suite.
+
+Quick example
+=============
+Here's a snapshot, just to give an idea about the power of the
+package. For more examples, look at the documentation.
+
+Suppose you want to know how much time is left, in
+years/months/days/etc, before the next easter happening on a
+year with a Friday 13th in August, and you want to get today's
+date out of the "date" unix system command. Here is the code:
+
+.. code-block:: python3
+
+ >>> from dateutil.relativedelta import *
+ >>> from dateutil.easter import *
+ >>> from dateutil.rrule import *
+ >>> from dateutil.parser import *
+ >>> from datetime import *
+ >>> now = parse("Sat Oct 11 17:13:46 UTC 2003")
+ >>> today = now.date()
+ >>> year = rrule(YEARLY,dtstart=now,bymonth=8,bymonthday=13,byweekday=FR)[0].year
+ >>> rdelta = relativedelta(easter(year), today)
+ >>> print("Today is: %s" % today)
+ Today is: 2003-10-11
+ >>> print("Year with next Aug 13th on a Friday is: %s" % year)
+ Year with next Aug 13th on a Friday is: 2004
+ >>> print("How far is the Easter of that year: %s" % rdelta)
+ How far is the Easter of that year: relativedelta(months=+6)
+ >>> print("And the Easter of that year is: %s" % (today+rdelta))
+ And the Easter of that year is: 2004-04-11
+
+Being exactly 6 months ahead was **really** a coincidence :)
+
+Contributing
+============
+
+We welcome many types of contributions - bug reports, pull requests (code, infrastructure or documentation fixes). For more information about how to contribute to the project, see the ``CONTRIBUTING.md`` file in the repository.
+
+
+Author
+======
+The dateutil module was written by Gustavo Niemeyer
+in 2003.
+
+It is maintained by:
+
+* Gustavo Niemeyer 2003-2011
+* Tomi PievilƤinen 2012-2014
+* Yaron de Leeuw 2014-2016
+* Paul Ganssle 2015-
+
+Starting with version 2.4.1 and running until 2.8.2, all source and binary
+distributions will be signed by a PGP key that has, at the very least, been
+signed by the key which made the previous release. A table of release signing
+keys can be found below:
+
+=========== ============================
+Releases Signing key fingerprint
+=========== ============================
+2.4.1-2.8.2 `6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB`_
+=========== ============================
+
+New releases *may* have signed tags, but binary and source distributions
+uploaded to PyPI will no longer have GPG signatures attached.
+
+Contact
+=======
+Our mailing list is available at `dateutil@python.org `_. As it is hosted by the PSF, it is subject to the `PSF code of
+conduct `_.
+
+License
+=======
+
+All contributions after December 1, 2017 released under dual license - either `Apache 2.0 License `_ or the `BSD 3-Clause License `_. Contributions before December 1, 2017 - except those those explicitly relicensed - are released only under the BSD 3-Clause License.
+
+
+.. _6B49 ACBA DCF6 BD1C A206 67AB CD54 FCE3 D964 BEFB:
+ https://pgp.mit.edu/pks/lookup?op=vindex&search=0xCD54FCE3D964BEFB
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD
new file mode 100644
index 0000000000000000000000000000000000000000..80cde96581cce34e038232c05925ca054de05960
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/RECORD
@@ -0,0 +1,27 @@
+dateutil/__init__.py,sha256=Mqam67WO9IkTmUFyI66vS6IoSXTp9G388DadH2LCMLY,620
+dateutil/_common.py,sha256=77w0yytkrxlYbSn--lDVPUMabUXRR9I3lBv_vQRUqUY,932
+dateutil/_version.py,sha256=BV031OxDDAmy58neUg5yyqLkLaqIw7ibK9As3jiMib0,166
+dateutil/easter.py,sha256=dyBi-lKvimH1u_k6p7Z0JJK72QhqVtVBsqByvpEPKvc,2678
+dateutil/parser/__init__.py,sha256=wWk6GFuxTpjoggCGtgkceJoti4pVjl4_fHQXpNOaSYg,1766
+dateutil/parser/_parser.py,sha256=7klDdyicksQB_Xgl-3UAmBwzCYor1AIZqklIcT6dH_8,58796
+dateutil/parser/isoparser.py,sha256=8Fy999bnCd1frSdOYuOraWfJTtd5W7qQ51NwNuH_hXM,13233
+dateutil/relativedelta.py,sha256=IY_mglMjoZbYfrvloTY2ce02aiVjPIkiZfqgNTZRfuA,24903
+dateutil/rrule.py,sha256=KJzKlaCd1jEbu4A38ZltslaoAUh9nSbdbOFdjp70Kew,66557
+dateutil/tz/__init__.py,sha256=F-Mz13v6jYseklQf9Te9J6nzcLDmq47gORa61K35_FA,444
+dateutil/tz/_common.py,sha256=cgzDTANsOXvEc86cYF77EsliuSab8Puwpsl5-bX3_S4,12977
+dateutil/tz/_factories.py,sha256=unb6XQNXrPMveksTCU-Ag8jmVZs4SojoPUcAHpWnrvU,2569
+dateutil/tz/tz.py,sha256=EUnEdMfeThXiY6l4sh9yBabZ63_POzy01zSsh9thn1o,62855
+dateutil/tz/win.py,sha256=xJszWgSwE1xPx_HJj4ZkepyukC_hNy016WMcXhbRaB8,12935
+dateutil/tzwin.py,sha256=7Ar4vdQCnnM0mKR3MUjbIKsZrBVfHgdwsJZc_mGYRew,59
+dateutil/utils.py,sha256=dKCchEw8eObi0loGTx91unBxm_7UGlU3v_FjFMdqwYM,1965
+dateutil/zoneinfo/__init__.py,sha256=KYg0pthCMjcp5MXSEiBJn3nMjZeNZav7rlJw5-tz1S4,5889
+dateutil/zoneinfo/dateutil-zoneinfo.tar.gz,sha256=0-pS57bpaN4NiE3xKIGTWW-pW4A9tPkqGCeac5gARHU,156400
+dateutil/zoneinfo/rebuild.py,sha256=MiqYzCIHvNbMH-LdRYLv-4T0EIA7hDKt5GLR0IRTLdI,2392
+python_dateutil-2.9.0.post0.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
+python_dateutil-2.9.0.post0.dist-info/LICENSE,sha256=ugD1Gg2SgjtaHN4n2LW50jIeZ-2NqbwWPv-W1eF-V34,2889
+python_dateutil-2.9.0.post0.dist-info/METADATA,sha256=qdQ22jIr6AgzL5jYgyWZjofLaTpniplp_rTPrXKabpM,8354
+python_dateutil-2.9.0.post0.dist-info/RECORD,,
+python_dateutil-2.9.0.post0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+python_dateutil-2.9.0.post0.dist-info/WHEEL,sha256=-G_t0oGuE7UD0DrSpVZnq1hHMBV9DD2XkS5v7XpmTnk,110
+python_dateutil-2.9.0.post0.dist-info/top_level.txt,sha256=4tjdWkhRZvF7LA_BYe_L9gB2w_p2a-z5y6ArjaRkot8,9
+python_dateutil-2.9.0.post0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/REQUESTED b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/REQUESTED
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL
new file mode 100644
index 0000000000000000000000000000000000000000..4724c45738f6ac125bb3a21787855562e6870440
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/WHEEL
@@ -0,0 +1,6 @@
+Wheel-Version: 1.0
+Generator: bdist_wheel (0.42.0)
+Root-Is-Purelib: true
+Tag: py2-none-any
+Tag: py3-none-any
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt
new file mode 100644
index 0000000000000000000000000000000000000000..66501480ba5b63f98ee9a59c1f99e5e6917da6d9
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/top_level.txt
@@ -0,0 +1 @@
+dateutil
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe
new file mode 100644
index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/python_dateutil-2.9.0.post0.dist-info/zip-safe
@@ -0,0 +1 @@
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/INSTALLER b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/INSTALLER
new file mode 100644
index 0000000000000000000000000000000000000000..5c69047b2eb8235994febeeae1da4a82365a240a
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/INSTALLER
@@ -0,0 +1 @@
+uv
\ No newline at end of file
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/METADATA b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/METADATA
new file mode 100644
index 0000000000000000000000000000000000000000..2ec4ebf9b1c8691818e8d2b451a21e25c0dd80a3
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/METADATA
@@ -0,0 +1,307 @@
+Metadata-Version: 2.4
+Name: scikit-learn
+Version: 1.7.1
+Summary: A set of python modules for machine learning and data mining
+Maintainer-Email: scikit-learn developers
+License-Expression: BSD-3-Clause
+License-File: COPYING
+Classifier: Intended Audience :: Science/Research
+Classifier: Intended Audience :: Developers
+Classifier: Programming Language :: C
+Classifier: Programming Language :: Python
+Classifier: Topic :: Software Development
+Classifier: Topic :: Scientific/Engineering
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: Unix
+Classifier: Operating System :: MacOS
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Programming Language :: Python :: 3.12
+Classifier: Programming Language :: Python :: 3.13
+Classifier: Programming Language :: Python :: Implementation :: CPython
+Project-URL: homepage, https://scikit-learn.org
+Project-URL: source, https://github.com/scikit-learn/scikit-learn
+Project-URL: download, https://pypi.org/project/scikit-learn/#files
+Project-URL: tracker, https://github.com/scikit-learn/scikit-learn/issues
+Project-URL: release notes, https://scikit-learn.org/stable/whats_new
+Requires-Python: >=3.10
+Requires-Dist: numpy>=1.22.0
+Requires-Dist: scipy>=1.8.0
+Requires-Dist: joblib>=1.2.0
+Requires-Dist: threadpoolctl>=3.1.0
+Provides-Extra: build
+Requires-Dist: numpy>=1.22.0; extra == "build"
+Requires-Dist: scipy>=1.8.0; extra == "build"
+Requires-Dist: cython>=3.0.10; extra == "build"
+Requires-Dist: meson-python>=0.17.1; extra == "build"
+Provides-Extra: install
+Requires-Dist: numpy>=1.22.0; extra == "install"
+Requires-Dist: scipy>=1.8.0; extra == "install"
+Requires-Dist: joblib>=1.2.0; extra == "install"
+Requires-Dist: threadpoolctl>=3.1.0; extra == "install"
+Provides-Extra: benchmark
+Requires-Dist: matplotlib>=3.5.0; extra == "benchmark"
+Requires-Dist: pandas>=1.4.0; extra == "benchmark"
+Requires-Dist: memory_profiler>=0.57.0; extra == "benchmark"
+Provides-Extra: docs
+Requires-Dist: matplotlib>=3.5.0; extra == "docs"
+Requires-Dist: scikit-image>=0.19.0; extra == "docs"
+Requires-Dist: pandas>=1.4.0; extra == "docs"
+Requires-Dist: seaborn>=0.9.0; extra == "docs"
+Requires-Dist: memory_profiler>=0.57.0; extra == "docs"
+Requires-Dist: sphinx>=7.3.7; extra == "docs"
+Requires-Dist: sphinx-copybutton>=0.5.2; extra == "docs"
+Requires-Dist: sphinx-gallery>=0.17.1; extra == "docs"
+Requires-Dist: numpydoc>=1.2.0; extra == "docs"
+Requires-Dist: Pillow>=8.4.0; extra == "docs"
+Requires-Dist: pooch>=1.6.0; extra == "docs"
+Requires-Dist: sphinx-prompt>=1.4.0; extra == "docs"
+Requires-Dist: sphinxext-opengraph>=0.9.1; extra == "docs"
+Requires-Dist: plotly>=5.14.0; extra == "docs"
+Requires-Dist: polars>=0.20.30; extra == "docs"
+Requires-Dist: sphinx-design>=0.5.0; extra == "docs"
+Requires-Dist: sphinx-design>=0.6.0; extra == "docs"
+Requires-Dist: sphinxcontrib-sass>=0.3.4; extra == "docs"
+Requires-Dist: pydata-sphinx-theme>=0.15.3; extra == "docs"
+Requires-Dist: sphinx-remove-toctrees>=1.0.0.post1; extra == "docs"
+Requires-Dist: towncrier>=24.8.0; extra == "docs"
+Provides-Extra: examples
+Requires-Dist: matplotlib>=3.5.0; extra == "examples"
+Requires-Dist: scikit-image>=0.19.0; extra == "examples"
+Requires-Dist: pandas>=1.4.0; extra == "examples"
+Requires-Dist: seaborn>=0.9.0; extra == "examples"
+Requires-Dist: pooch>=1.6.0; extra == "examples"
+Requires-Dist: plotly>=5.14.0; extra == "examples"
+Provides-Extra: tests
+Requires-Dist: matplotlib>=3.5.0; extra == "tests"
+Requires-Dist: scikit-image>=0.19.0; extra == "tests"
+Requires-Dist: pandas>=1.4.0; extra == "tests"
+Requires-Dist: pytest>=7.1.2; extra == "tests"
+Requires-Dist: pytest-cov>=2.9.0; extra == "tests"
+Requires-Dist: ruff>=0.11.7; extra == "tests"
+Requires-Dist: mypy>=1.15; extra == "tests"
+Requires-Dist: pyamg>=4.2.1; extra == "tests"
+Requires-Dist: polars>=0.20.30; extra == "tests"
+Requires-Dist: pyarrow>=12.0.0; extra == "tests"
+Requires-Dist: numpydoc>=1.2.0; extra == "tests"
+Requires-Dist: pooch>=1.6.0; extra == "tests"
+Provides-Extra: maintenance
+Requires-Dist: conda-lock==3.0.1; extra == "maintenance"
+Description-Content-Type: text/x-rst
+
+.. -*- mode: rst -*-
+
+|Azure| |Codecov| |CircleCI| |Nightly wheels| |Ruff| |PythonVersion| |PyPi| |DOI| |Benchmark|
+
+.. |Azure| image:: https://dev.azure.com/scikit-learn/scikit-learn/_apis/build/status/scikit-learn.scikit-learn?branchName=main
+ :target: https://dev.azure.com/scikit-learn/scikit-learn/_build/latest?definitionId=1&branchName=main
+
+.. |CircleCI| image:: https://circleci.com/gh/scikit-learn/scikit-learn/tree/main.svg?style=shield
+ :target: https://circleci.com/gh/scikit-learn/scikit-learn
+
+.. |Codecov| image:: https://codecov.io/gh/scikit-learn/scikit-learn/branch/main/graph/badge.svg?token=Pk8G9gg3y9
+ :target: https://codecov.io/gh/scikit-learn/scikit-learn
+
+.. |Nightly wheels| image:: https://github.com/scikit-learn/scikit-learn/actions/workflows/wheels.yml/badge.svg?event=schedule
+ :target: https://github.com/scikit-learn/scikit-learn/actions?query=workflow%3A%22Wheel+builder%22+event%3Aschedule
+
+.. |Ruff| image:: https://img.shields.io/badge/code%20style-ruff-000000.svg
+ :target: https://github.com/astral-sh/ruff
+
+.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/scikit-learn.svg
+ :target: https://pypi.org/project/scikit-learn/
+
+.. |PyPi| image:: https://img.shields.io/pypi/v/scikit-learn
+ :target: https://pypi.org/project/scikit-learn
+
+.. |DOI| image:: https://zenodo.org/badge/21369/scikit-learn/scikit-learn.svg
+ :target: https://zenodo.org/badge/latestdoi/21369/scikit-learn/scikit-learn
+
+.. |Benchmark| image:: https://img.shields.io/badge/Benchmarked%20by-asv-blue
+ :target: https://scikit-learn.org/scikit-learn-benchmarks
+
+.. |PythonMinVersion| replace:: 3.10
+.. |NumPyMinVersion| replace:: 1.22.0
+.. |SciPyMinVersion| replace:: 1.8.0
+.. |JoblibMinVersion| replace:: 1.2.0
+.. |ThreadpoolctlMinVersion| replace:: 3.1.0
+.. |MatplotlibMinVersion| replace:: 3.5.0
+.. |Scikit-ImageMinVersion| replace:: 0.19.0
+.. |PandasMinVersion| replace:: 1.4.0
+.. |SeabornMinVersion| replace:: 0.9.0
+.. |PytestMinVersion| replace:: 7.1.2
+.. |PlotlyMinVersion| replace:: 5.14.0
+
+.. image:: https://raw.githubusercontent.com/scikit-learn/scikit-learn/main/doc/logos/scikit-learn-logo.png
+ :target: https://scikit-learn.org/
+
+**scikit-learn** is a Python module for machine learning built on top of
+SciPy and is distributed under the 3-Clause BSD license.
+
+The project was started in 2007 by David Cournapeau as a Google Summer
+of Code project, and since then many volunteers have contributed. See
+the `About us `__ page
+for a list of core contributors.
+
+It is currently maintained by a team of volunteers.
+
+Website: https://scikit-learn.org
+
+Installation
+------------
+
+Dependencies
+~~~~~~~~~~~~
+
+scikit-learn requires:
+
+- Python (>= |PythonMinVersion|)
+- NumPy (>= |NumPyMinVersion|)
+- SciPy (>= |SciPyMinVersion|)
+- joblib (>= |JoblibMinVersion|)
+- threadpoolctl (>= |ThreadpoolctlMinVersion|)
+
+=======
+
+Scikit-learn plotting capabilities (i.e., functions start with ``plot_`` and
+classes end with ``Display``) require Matplotlib (>= |MatplotlibMinVersion|).
+For running the examples Matplotlib >= |MatplotlibMinVersion| is required.
+A few examples require scikit-image >= |Scikit-ImageMinVersion|, a few examples
+require pandas >= |PandasMinVersion|, some examples require seaborn >=
+|SeabornMinVersion| and plotly >= |PlotlyMinVersion|.
+
+User installation
+~~~~~~~~~~~~~~~~~
+
+If you already have a working installation of NumPy and SciPy,
+the easiest way to install scikit-learn is using ``pip``::
+
+ pip install -U scikit-learn
+
+or ``conda``::
+
+ conda install -c conda-forge scikit-learn
+
+The documentation includes more detailed `installation instructions `_.
+
+
+Changelog
+---------
+
+See the `changelog `__
+for a history of notable changes to scikit-learn.
+
+Development
+-----------
+
+We welcome new contributors of all experience levels. The scikit-learn
+community goals are to be helpful, welcoming, and effective. The
+`Development Guide `_
+has detailed information about contributing code, documentation, tests, and
+more. We've included some basic information in this README.
+
+Important links
+~~~~~~~~~~~~~~~
+
+- Official source code repo: https://github.com/scikit-learn/scikit-learn
+- Download releases: https://pypi.org/project/scikit-learn/
+- Issue tracker: https://github.com/scikit-learn/scikit-learn/issues
+
+Source code
+~~~~~~~~~~~
+
+You can check the latest sources with the command::
+
+ git clone https://github.com/scikit-learn/scikit-learn.git
+
+Contributing
+~~~~~~~~~~~~
+
+To learn more about making a contribution to scikit-learn, please see our
+`Contributing guide
+`_.
+
+Testing
+~~~~~~~
+
+After installation, you can launch the test suite from outside the source
+directory (you will need to have ``pytest`` >= |PyTestMinVersion| installed)::
+
+ pytest sklearn
+
+See the web page https://scikit-learn.org/dev/developers/contributing.html#testing-and-improving-test-coverage
+for more information.
+
+ Random number generation can be controlled during testing by setting
+ the ``SKLEARN_SEED`` environment variable.
+
+Submitting a Pull Request
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Before opening a Pull Request, have a look at the
+full Contributing page to make sure your code complies
+with our guidelines: https://scikit-learn.org/stable/developers/index.html
+
+Project History
+---------------
+
+The project was started in 2007 by David Cournapeau as a Google Summer
+of Code project, and since then many volunteers have contributed. See
+the `About us `__ page
+for a list of core contributors.
+
+The project is currently maintained by a team of volunteers.
+
+**Note**: `scikit-learn` was previously referred to as `scikits.learn`.
+
+Help and Support
+----------------
+
+Documentation
+~~~~~~~~~~~~~
+
+- HTML documentation (stable release): https://scikit-learn.org
+- HTML documentation (development version): https://scikit-learn.org/dev/
+- FAQ: https://scikit-learn.org/stable/faq.html
+
+Communication
+~~~~~~~~~~~~~
+
+Main Channels
+^^^^^^^^^^^^^
+
+- **Website**: https://scikit-learn.org
+- **Blog**: https://blog.scikit-learn.org
+- **Mailing list**: https://mail.python.org/mailman/listinfo/scikit-learn
+
+Developer & Support
+^^^^^^^^^^^^^^^^^^^^^^
+
+- **GitHub Discussions**: https://github.com/scikit-learn/scikit-learn/discussions
+- **Stack Overflow**: https://stackoverflow.com/questions/tagged/scikit-learn
+- **Discord**: https://discord.gg/h9qyrK8Jc8
+
+Social Media Platforms
+^^^^^^^^^^^^^^^^^^^^^^
+
+- **LinkedIn**: https://www.linkedin.com/company/scikit-learn
+- **YouTube**: https://www.youtube.com/channel/UCJosFjYm0ZYVUARxuOZqnnw/playlists
+- **Facebook**: https://www.facebook.com/scikitlearnofficial/
+- **Instagram**: https://www.instagram.com/scikitlearnofficial/
+- **TikTok**: https://www.tiktok.com/@scikit.learn
+- **Bluesky**: https://bsky.app/profile/scikit-learn.org
+- **Mastodon**: https://mastodon.social/@sklearn@fosstodon.org
+
+Resources
+^^^^^^^^^
+
+- **Calendar**: https://blog.scikit-learn.org/calendar/
+- **Logos & Branding**: https://github.com/scikit-learn/scikit-learn/tree/main/doc/logos
+
+Citation
+~~~~~~~~
+
+If you use scikit-learn in a scientific publication, we would appreciate citations: https://scikit-learn.org/stable/about.html#citing-scikit-learn
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/RECORD b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/RECORD
new file mode 100644
index 0000000000000000000000000000000000000000..c3def4f04e54844626f0bbaf47b05319ac50ccd4
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/RECORD
@@ -0,0 +1,958 @@
+scikit_learn-1.7.1.dist-info/INSTALLER,sha256=5hhM4Q4mYTT9z6QB6PGpUAW81PGNFrYrdXMj4oM_6ak,2
+scikit_learn-1.7.1.dist-info/METADATA,sha256=kfnaI2JCT7RdHZv6hQO0n1zumVQ20SXfR3bZbfYuAsI,11784
+scikit_learn-1.7.1.dist-info/RECORD,,
+scikit_learn-1.7.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+scikit_learn-1.7.1.dist-info/WHEEL,sha256=sZM_NeUMz2G4fDenMf11eikcCxcLaQWiYRmjwQBavQs,137
+scikit_learn-1.7.1.dist-info/licenses/COPYING,sha256=_ebNwKhsZahFrxcIb5ZPejjZNEZ7fzYgOJSvMOzudkA,5078
+scikit_learn.libs/libgomp-a34b3233.so.1.0.0,sha256=On6uznIxkRvi-7Gz58tMtcLg-E4MK7c3OUcrWh_uyME,168193
+sklearn/__check_build/__init__.py,sha256=qOmiYYd8XWCN-knP2AdJLoNrN7E-Jn48vx1iZpYRugY,1843
+sklearn/__check_build/_check_build.cpython-310-x86_64-linux-gnu.so,sha256=kfI088e2Nl18zwEEzXS2NMkqtuYUlLMNTTNLdEk-x-w,41064
+sklearn/__check_build/_check_build.pyx,sha256=8uo0MEvoqggJXyJug6X1iOtrHEjEuRHEy8XK9EEEsVE,30
+sklearn/__check_build/meson.build,sha256=kYUehV7zeGx_ckXUuJZoUHqzFr_QjTkEQFpzUdCmUeM,135
+sklearn/__init__.py,sha256=UZUfg2wF4tfGx3xt9YjRpuuqkV9kYevn2dT9XHP-Fl8,4640
+sklearn/_build_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/_build_utils/tempita.py,sha256=D-5VlYirbKymB12g0lRet-BHq40YXbViGh51Ngr_yi8,1684
+sklearn/_build_utils/version.py,sha256=MXulZf33cp8otqGocAwKzSBIM6MUerYtE8fxqZsAfJA,448
+sklearn/_built_with_meson.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/_config.py,sha256=YzP6N9DtWSRDbPnw2xF3JKGdvAwkl5XDSXl-QqHETZs,14970
+sklearn/_cyutility.cpython-310-x86_64-linux-gnu.so,sha256=3_I0Pwiuiztt5jgoB2F8FoYMWo2nIYuDx56ILd5aH8Y,199832
+sklearn/_distributor_init.py,sha256=HJ3OJ8FgzN3a-dNHePdJd_rdMK7_GYsnqU_fe3VuipE,424
+sklearn/_isotonic.cpython-310-x86_64-linux-gnu.so,sha256=hKAAflOsBEAVut-c1ncNxX-iQuLfdppUyVSqNraOM7A,179664
+sklearn/_isotonic.pyx,sha256=L1JOQOTp5SoiZjzZKTczOtGuxilh_0bAluCk8Q9YM3Y,3733
+sklearn/_loss/__init__.py,sha256=ZGxLoo-OlLqcwI4Za5lYA31dcTayjaZzO54BjuymyBQ,687
+sklearn/_loss/_loss.cpython-310-x86_64-linux-gnu.so,sha256=avorXtWDH9rJ4M4kzyMPBVFoYFexDHWG5bWR1iLzWrY,2813465
+sklearn/_loss/_loss.pxd,sha256=8LvWX3YNUuv3E5KQtl2o68mEqzu3tFFGjk8Qn-9lnk0,4577
+sklearn/_loss/_loss.pyx.tp,sha256=PKBBX3n6ASIt5IuZYp8F4fWee5dK3RTNVyMrJKgfErA,53677
+sklearn/_loss/link.py,sha256=1-PzVdqnGp7eE1Q7UoILBLHwM9TRaYwN1P-jfXa7xp8,8126
+sklearn/_loss/loss.py,sha256=_39Z0lvdVL_hs8Llt_PjdmyoKwtzR-4cvIKFv9v1h1g,41317
+sklearn/_loss/meson.build,sha256=jltTivAK8aZP29ZOeyF6HuUihkj_qVV1UxhIm8Ux7uE,654
+sklearn/_loss/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/_loss/tests/test_link.py,sha256=XMHMLjmPA1RHLrAhexoMzVQRlokcCT9LMhajVVnneS0,3954
+sklearn/_loss/tests/test_loss.py,sha256=hSgF_G5R2cv1P3lrdYloiwdDYpimT-AwfU1jhcZ6FcQ,49712
+sklearn/_min_dependencies.py,sha256=Qvl6tAcvEqabDE6qyuOfRpNxA_tEFOBUTmTwyzHDH-k,2800
+sklearn/base.py,sha256=oq05xf9kkdBMNXOOlChg3vDoDWgArrFpDP1ov0a-jZE,47777
+sklearn/calibration.py,sha256=Tg-mX0eMYow7li9GGBH8UDfYvrniuNMbiiFD-P4ottU,51595
+sklearn/cluster/__init__.py,sha256=DPe0qNOVhLx5mSDInkJBNgxd-22nhkKLjBlRV-6fWYg,1476
+sklearn/cluster/_affinity_propagation.py,sha256=axsTYyWEvxM8Drc7hO9BDWKWwGgFi_wXqmByIgF21AU,20706
+sklearn/cluster/_agglomerative.py,sha256=RipbZwQoduArZZTJQmCfFnZr2JheIbB0NkWd4ruUTKM,49368
+sklearn/cluster/_bicluster.py,sha256=89i_H3m0wrBHvDw11qM2yKQ_dFZqa9-mKGpBIEHLU_w,21975
+sklearn/cluster/_birch.py,sha256=10YX8EiSfbXlnJnpRuTvBpb793HoR5wcLagtpFkRkTM,26834
+sklearn/cluster/_bisect_k_means.py,sha256=Z0WCdf03rpS3m1XkEjyIfBC_r6ch8cNtAJcA632nfzw,19359
+sklearn/cluster/_dbscan.py,sha256=25tD7FhfLbgcDUkU_jxP78lXqjCsqEx65vtH6WCjWMg,18529
+sklearn/cluster/_dbscan_inner.cpython-310-x86_64-linux-gnu.so,sha256=XNQf8Q0-uvA73W2u_ma1kqqWRtsBbXipkEnMCGQyFlw,78296
+sklearn/cluster/_dbscan_inner.pyx,sha256=JQ2riqW6JizG8wgHc2i_eKZUnNK_clS8dGE60NMCp1U,1318
+sklearn/cluster/_feature_agglomeration.py,sha256=2wo8vtVMqz0pwMb4cYVUTXcswjeGdkFbs3XNlaJMJn4,2426
+sklearn/cluster/_hdbscan/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/cluster/_hdbscan/_linkage.cpython-310-x86_64-linux-gnu.so,sha256=Vrq8F-CeFjw9REGdeUL9ISypd9vy27HxexPt0B9ndkM,134968
+sklearn/cluster/_hdbscan/_linkage.pyx,sha256=bDCkEDXyZ8M0t8wIp1uUiQWNrNuLVHaGQVw_NDFXpvU,10252
+sklearn/cluster/_hdbscan/_reachability.cpython-310-x86_64-linux-gnu.so,sha256=8K5lkp80gYMhJR505z7QWzZ4Fatl_WD5qQgc0_t42bE,246376
+sklearn/cluster/_hdbscan/_reachability.pyx,sha256=Ap27H1gEE43fLRtR4RqtJ5BnBSWoxeUKYhj4u2OtqHU,7774
+sklearn/cluster/_hdbscan/_tree.cpython-310-x86_64-linux-gnu.so,sha256=X9zK6dEIPe9nFJ5MjikSQx8F8dzxStr14e-iqN6-GaQ,274384
+sklearn/cluster/_hdbscan/_tree.pxd,sha256=Nm7ghFqifD2vLnyBoCQCn9eFsmoB8ITpEuCMItJZoM4,2150
+sklearn/cluster/_hdbscan/_tree.pyx,sha256=Fs7cI-3EjHEmLqFwDx4JvrO_vuil32llUG9w4-ElaSs,27781
+sklearn/cluster/_hdbscan/hdbscan.py,sha256=oQuEMFAJZWjbfOf34ghlgVEmn5tQBtSepy90scB0HVI,41019
+sklearn/cluster/_hdbscan/meson.build,sha256=7qnGFFfS5OsBpQLS6xdBUVIcUjzd_VZrkG8Sg1WEw0Y,492
+sklearn/cluster/_hdbscan/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/cluster/_hdbscan/tests/test_reachibility.py,sha256=HCzRrBdtYARu83re_Z-Mu-hEZzhVWKNzCDpuZD_M3rM,2065
+sklearn/cluster/_hierarchical_fast.cpython-310-x86_64-linux-gnu.so,sha256=yPwjWcimFSJZYEyI377sDPVgq0cF5nyY9igGDJCeOhU,215856
+sklearn/cluster/_hierarchical_fast.pxd,sha256=JlWtArNtEgc2RBeCJRADftNTPwNV_M-OAsAJz7lHqzY,245
+sklearn/cluster/_hierarchical_fast.pyx,sha256=DJe1c-WdbgLaClMwJjucwFwbGePFqnm0vPSdXyGQy2U,15927
+sklearn/cluster/_k_means_common.cpython-310-x86_64-linux-gnu.so,sha256=T-FhZqvhw_qEs2I9PlUeW2uBLaZyunPGbWlLAEZTLg0,409177
+sklearn/cluster/_k_means_common.pxd,sha256=6QW18TtC1wGpyTd0cdG9PxSYTiP4ZN3hj6ltJWrdaic,887
+sklearn/cluster/_k_means_common.pyx,sha256=w8e0U721_57eE97moyGYtGEULsDA1LhsHzqR6pvrD0s,10206
+sklearn/cluster/_k_means_elkan.cpython-310-x86_64-linux-gnu.so,sha256=6eUqCQhuc15jSsqeUNotqLTqd7ecVYtXOP0-UzFje9s,401169
+sklearn/cluster/_k_means_elkan.pyx,sha256=9qqaR6NCvT994gFfZVVV5nQ7qZOdYsr1UgPdXad_dQs,28164
+sklearn/cluster/_k_means_lloyd.cpython-310-x86_64-linux-gnu.so,sha256=QwaL6fNhS9mEwXJWmickNIiwJS57eMoH1GbNmXjGk1s,273993
+sklearn/cluster/_k_means_lloyd.pyx,sha256=Ns8rod9sRad_un-fpePHDOqwM6MB6lT-0_Fivhmm9E4,16472
+sklearn/cluster/_k_means_minibatch.cpython-310-x86_64-linux-gnu.so,sha256=R_LXAxPFP7nLKOLCGhruG8oBulFe7UI19ULYYXNYP_g,203921
+sklearn/cluster/_k_means_minibatch.pyx,sha256=ytlKAPQuIgC54Wc8t8OlzeS8qi6HMALyKcun4lWOjR4,8156
+sklearn/cluster/_kmeans.py,sha256=Lg2oA_QcyHDfRcWaJM0tqTxG0GR4X-8-jVwuSRLZyAM,81743
+sklearn/cluster/_mean_shift.py,sha256=r5TJitv8uVAwAP_15btOVXNzZzhwSzJOqXB4rDp-hwA,20284
+sklearn/cluster/_optics.py,sha256=E7IWBHG9ygbfgzKOumTQo-ft33nStfTDaDzoiuvF8xs,44932
+sklearn/cluster/_spectral.py,sha256=siT1f8-8plaS2L0f36nC1wrq1i1OShU_KPdFjRksuOA,30936
+sklearn/cluster/meson.build,sha256=UBtHRFqB7JvZQ3o6rP4FsLccnPlbs5WYYBXNlO1dfmQ,975
+sklearn/cluster/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/cluster/tests/common.py,sha256=1jmt9fXRXYt9TYCwJFcgDGV10slNNjJW7_2tRCSzJBY,880
+sklearn/cluster/tests/test_affinity_propagation.py,sha256=p-q92owXh0cG1oPD3d5VZOfQoZMwEeDfRlTAS25NTa0,11898
+sklearn/cluster/tests/test_bicluster.py,sha256=JJjahw-5rSvyNcKpz0ZtM1jl07jvLAB5D9zdzcqMXU4,9126
+sklearn/cluster/tests/test_birch.py,sha256=0c5tVBWc7lY4R-7oBwF8cpvI3-qploOHWp5poqF9KaY,8857
+sklearn/cluster/tests/test_bisect_k_means.py,sha256=1hf2vfXJ_0aIncY-bZMgx5TXTzGI49YCfVxChYrsLno,5139
+sklearn/cluster/tests/test_dbscan.py,sha256=8T5QOHsOI7ZnCYcBgcRE1AMT9IUanlFImxxsr3TKi1E,15704
+sklearn/cluster/tests/test_feature_agglomeration.py,sha256=V1apZXrZLF631DBVs72OMsZFGTHmb-ZdhvwXGd1vew0,1965
+sklearn/cluster/tests/test_hdbscan.py,sha256=xLYnVvA0Yo1KLqh_axWs1eQCqWGlJbaSiKVhf2QszpA,19401
+sklearn/cluster/tests/test_hierarchical.py,sha256=70Nqw-utJHu80ixqqOL2NC3nxZFOm-oBDaV2y1VIZtU,32118
+sklearn/cluster/tests/test_k_means.py,sha256=mmTpatBS9EzfckKi84LghrIIX30tbews5dUdYX4irsU,48754
+sklearn/cluster/tests/test_mean_shift.py,sha256=g6nBLNG0dPijUCTeM6ScqUpI9irAOv6tEG3U0n-rh-Y,7081
+sklearn/cluster/tests/test_optics.py,sha256=cPi7JaLpTVLTq37t0n6ZZyaPlLl4IckHTyuEA6aTG80,24537
+sklearn/cluster/tests/test_spectral.py,sha256=fDPwNrFgA-3PLF9RFNxhVvu5seE5c8bTDpoZxqHSvUM,11763
+sklearn/compose/__init__.py,sha256=XU4j8dd7SFuy5r0AfTLZ36XsEcIP_IqjQWNGC7Grs0g,631
+sklearn/compose/_column_transformer.py,sha256=Njlf2U8ar_L2mA-aXkttTluWJ7tu2HlN3cwKYpt9qeQ,63644
+sklearn/compose/_target.py,sha256=Nsyro18C-s-eUBDai6TItOx94Wms9KH_E_0Ut7Srzgo,14572
+sklearn/compose/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/compose/tests/test_column_transformer.py,sha256=cu5MEHZoKfYI3cbn_oTaV06G_4ODZ8Xe36JFhOgeiaU,94973
+sklearn/compose/tests/test_target.py,sha256=VaXk9tAcmkzckaqS5h7iwvW3MS-hcOzr7NhSsZs3nDE,14098
+sklearn/conftest.py,sha256=TH7GXOavTSmLTwOGKqaGldetfIOGMEja4RZ8bepC9jo,13083
+sklearn/covariance/__init__.py,sha256=IsRnf4hz1aAODGnrFiF3VaptjqC0NRqrHPW1iiDOj3s,1171
+sklearn/covariance/_elliptic_envelope.py,sha256=z0xSxlDx7IyvjXkmHH9wiYeM3Ub7oz6abuCG913aqJ8,9055
+sklearn/covariance/_empirical_covariance.py,sha256=8nmLvVu9kDRWrAIYPv0-maCUr6b3_HS8zcA4CF4i-wI,12297
+sklearn/covariance/_graph_lasso.py,sha256=ty136Rp5nd73TVUcbQn-0VpS8uzQFbYe4j9JTKhg8Ik,40298
+sklearn/covariance/_robust_covariance.py,sha256=q4Fu19fLfu9MI42icnD4g1Q73Qapvzj30DniREhvJ24,34403
+sklearn/covariance/_shrunk_covariance.py,sha256=4l2H9FOzMbdUUsOVaDLdfWjq3Xoi35epcEguU0uQzJ4,28038
+sklearn/covariance/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/covariance/tests/test_covariance.py,sha256=eAp8bVdc5VYO7-LakTQBEl8Bku-I1xcstkp-wn2sbm8,14038
+sklearn/covariance/tests/test_elliptic_envelope.py,sha256=xCxtRYDNADB22KJURLGRqI2OoWh4LLfazpjgsIWOzH4,1587
+sklearn/covariance/tests/test_graphical_lasso.py,sha256=WqWXj3Hxd_Q9jxFL2Jn3r_5lgYXAz7qESoI49wwEOzg,10972
+sklearn/covariance/tests/test_robust_covariance.py,sha256=IUtakkWbJCbM753mqbIs76536SHWZ4uK6sgXv-9qIUY,6370
+sklearn/cross_decomposition/__init__.py,sha256=o35MjQxe2HkuWiAEgtgMGvy3ui_Otfo8opg0yw2uUh8,244
+sklearn/cross_decomposition/_pls.py,sha256=fPyCpmeF6GKzRAVawwZc4Ffa56R26526DD9OUS2rSfI,36972
+sklearn/cross_decomposition/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/cross_decomposition/tests/test_pls.py,sha256=NK4bLt4YwegJnyDR7F7XuNwPeQ4WR-AqXVve1I5vkEY,23488
+sklearn/datasets/__init__.py,sha256=OIl-zBuJJkFSHzL6ZFJfB1EJ1s-j1adLtEyFaakQxy8,5186
+sklearn/datasets/_arff_parser.py,sha256=tjZDgNyIqQ1I6zPIwkxZyCXcrW1p_QNy9xLSO9_ZMMY,19160
+sklearn/datasets/_base.py,sha256=l8clUavEbBSMCMoOzIhfT5WWSnnFGIjG4G_BPrYYgM0,53388
+sklearn/datasets/_california_housing.py,sha256=W8PzRJpPbAp69aMcsSEGnIJyxe672j_gvW3wmLug34Y,7279
+sklearn/datasets/_covtype.py,sha256=icC_R-02b83gIWJQq53E4_6Q8n8UiAOzFKHzRsSYFYY,8075
+sklearn/datasets/_kddcup99.py,sha256=1f1Ss2pFpnsVmSZOSWGGZw7pvpLIBwR__jPevyfg0Lo,13961
+sklearn/datasets/_lfw.py,sha256=wObR1RrTviwH_K0RAFa_GjOAlZ74a6q2rszhrSq2J4o,22588
+sklearn/datasets/_olivetti_faces.py,sha256=_JgWZdUL7j51hNnquvZw76yvXChFhQnS-wSNBREoDUY,6075
+sklearn/datasets/_openml.py,sha256=ZWrtcER7wBb8m1qFtwlvgkfaDcpgk2j7Klz8rnTUKf4,41634
+sklearn/datasets/_rcv1.py,sha256=oBpLrSj4ENcQAmKBpakBYZIm7Ao-7CGqKET7J6HbWzg,11861
+sklearn/datasets/_samples_generator.py,sha256=0tJqRu2coJB9E_LAetgzVK13nc4HE_w3x9aHcepuCDQ,76834
+sklearn/datasets/_species_distributions.py,sha256=ZJjzcktxxA6hHOVb8y9CkiDolZtKlGO4GCUCQAIU1qc,9407
+sklearn/datasets/_svmlight_format_fast.cpython-310-x86_64-linux-gnu.so,sha256=FrW-5Ufx1F4nxUu-qbruUCd2SPwGRVO5pn-f6mKTUQE,471272
+sklearn/datasets/_svmlight_format_fast.pyx,sha256=9eDLPP_HvkuCzJbFH4hmlrsuAlYcD7CtEujLyET0yz0,7196
+sklearn/datasets/_svmlight_format_io.py,sha256=515Dc6TLQnKu_2HbNQTnZhZK5oHH2CwBHA03Y49EKdY,20839
+sklearn/datasets/_twenty_newsgroups.py,sha256=JOjPJEx34HAMdjcgGfd4r5SwUOL95OoePSUdzcyfTbs,20808
+sklearn/datasets/data/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/datasets/data/breast_cancer.csv,sha256=_tPrctBXXvYZIpP1CTxugBsUdrV30Dhr9EVVBFIhcu0,119913
+sklearn/datasets/data/diabetes_data_raw.csv.gz,sha256=o-lMx86gD4qE-l9jRSA5E6aO-kLfGPh935vq1yG_1QM,7105
+sklearn/datasets/data/diabetes_target.csv.gz,sha256=jlP2XrgR30PCBvNTS7OvDl_tITvDfta6NjEBV9YCOAM,1050
+sklearn/datasets/data/digits.csv.gz,sha256=CfZubeve4s0rWuWeDWq7tz_CsOAYXS4ZV-nrtR4jqiI,57523
+sklearn/datasets/data/iris.csv,sha256=8T_6j91W_Y5sjRbUCBo_vTEUvNCq5CVsQyBRac2dFEk,2734
+sklearn/datasets/data/linnerud_exercise.csv,sha256=y42MJJN2Q_okWWgu-4bF5me81t2TEJ7vgZZNnp8Rv4w,212
+sklearn/datasets/data/linnerud_physiological.csv,sha256=K_fgXBzX0K3w7KHkVpQfYkvtCk_JZpTWDQ_3hT7F_Pc,219
+sklearn/datasets/data/wine_data.csv,sha256=EOioApCLNPhuXajOli88gGaUvJhFChj2GFGvWfMkvt4,11157
+sklearn/datasets/descr/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/datasets/descr/breast_cancer.rst,sha256=PFhVGCpE0SyR8fsnOIdB-3C0uSukD7dC3Km15ATGjxk,4794
+sklearn/datasets/descr/california_housing.rst,sha256=Cr6d8BzCwbHjKZi21qSNLumQppwIzjx4zGIJbxSUEfE,1720
+sklearn/datasets/descr/covtype.rst,sha256=C6DmczitjtnrO-XhCIi8WqNT0uPgYnPWNYtKwJTwcn4,1191
+sklearn/datasets/descr/diabetes.rst,sha256=B9z8E5V6gkhb385Ers_7py55d1lZZtEYuB8WLLgn44E,1455
+sklearn/datasets/descr/digits.rst,sha256=jn5Y1hKVj32bDeGTHtaLIRcD7rI56Ajz2CxfCDfMAiI,2007
+sklearn/datasets/descr/iris.rst,sha256=cfhnSai8Uo0ht9sPlTMuMjDRMjGgXCcg5TeyxaqO9ek,2656
+sklearn/datasets/descr/kddcup99.rst,sha256=qRz2X8XmUh8IZKjzT1OAJd5sj91bBo0xpdcV5rS2Jko,3919
+sklearn/datasets/descr/lfw.rst,sha256=8sj8ApMwZDHabnaksL4S-WHS1V-k-divU7DGPJWP7Aw,4409
+sklearn/datasets/descr/linnerud.rst,sha256=jDI-AIsVeZZTVVWSiUztp5lEL4H2us847bgF3FSGb1s,704
+sklearn/datasets/descr/olivetti_faces.rst,sha256=i8Y7-g4fOPdLvupgJ8i_ze1pA0hGpfDgAoPCGvCPFxI,1834
+sklearn/datasets/descr/rcv1.rst,sha256=mLj4WU7aEVqaJg7hgSSe81oI74L6_pGECR72O8dEMZ4,2455
+sklearn/datasets/descr/species_distributions.rst,sha256=L80eaLcb9ymJOZyFLoQhDykU9dwiouRFRTD-_IrKFsI,1648
+sklearn/datasets/descr/twenty_newsgroups.rst,sha256=Z5efG4-mdET4H4sXgCt37IHL08EUzKbnucB190o_GD8,10923
+sklearn/datasets/descr/wine_data.rst,sha256=R4crlpp_b1Q_B9Jo2-Jq-3djwbQO5qpBTtee9y6t6cY,3355
+sklearn/datasets/images/README.txt,sha256=PH7xWh-iW5mNOMkhMjeGNZVare3B3PPkDmPcAJj2uPc,709
+sklearn/datasets/images/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/datasets/images/china.jpg,sha256=g3gCWtJRnWSdAuMr2YmQ20q1cjV9nwmEHC-_u0_vrSk,196653
+sklearn/datasets/images/flower.jpg,sha256=p39uxB41Ov34vf8uqYGylVU12NgylPjPpJz05CPdVjg,142987
+sklearn/datasets/meson.build,sha256=Vx9GBA1WjNkluNaLNncDqp7NsZ6jTw3Ymw7htBHfy2M,173
+sklearn/datasets/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_1/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_1/api-v1-jd-1.json.gz,sha256=hi4IUgokM6SVo7066f2ebHxUCpxjLbKbuCUnhMva13k,1786
+sklearn/datasets/tests/data/openml/id_1/api-v1-jdf-1.json.gz,sha256=qWba1Yz1-8kUo3StVVbAQU9e2WIjftVaN5_pbjCNAN4,889
+sklearn/datasets/tests/data/openml/id_1/api-v1-jdq-1.json.gz,sha256=hKhybSw_i7ynnVTYsZEVh0SxmTFG-PCDsRGo6nhTYFc,145
+sklearn/datasets/tests/data/openml/id_1/data-v1-dl-1.arff.gz,sha256=z-iUW5SXcLDaQtr1jOZ9HF_uJc97T9FFFhg3wqvAlCk,1841
+sklearn/datasets/tests/data/openml/id_1119/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_1119/api-v1-jd-1119.json.gz,sha256=xB5fuz5ZzU3oge18j4j5sDp1DVN7pjWByv3mqv13rcE,711
+sklearn/datasets/tests/data/openml/id_1119/api-v1-jdf-1119.json.gz,sha256=gviZ7cWctB_dZxslaiKOXgbfxeJMknEudQBbJRsACGU,1108
+sklearn/datasets/tests/data/openml/id_1119/api-v1-jdl-dn-adult-census-l-2-dv-1.json.gz,sha256=Sl3DbKl1gxOXiyqdecznY8b4TV2V8VrFV7PXSC8i7iE,364
+sklearn/datasets/tests/data/openml/id_1119/api-v1-jdl-dn-adult-census-l-2-s-act-.json.gz,sha256=bsCVV4iRT6gfaY6XpNGv93PXoSXtbnacYnGgtI_EAR0,363
+sklearn/datasets/tests/data/openml/id_1119/api-v1-jdq-1119.json.gz,sha256=73y8tYwu3P6kXAWLdR-vd4PnEEYqkk6arK2NR6fp-Us,1549
+sklearn/datasets/tests/data/openml/id_1119/data-v1-dl-54002.arff.gz,sha256=aTGvJWGV_N0uR92LD57fFvvwOxmOd7cOPf2Yd83wlRU,1190
+sklearn/datasets/tests/data/openml/id_1590/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_1590/api-v1-jd-1590.json.gz,sha256=mxBa3-3GtrgvRpXKm_4jI5MDTN95gDUj85em3Fv4JNE,1544
+sklearn/datasets/tests/data/openml/id_1590/api-v1-jdf-1590.json.gz,sha256=BG9eYFZGk_DzuOOCclyAEsPgWGRxOcJGhc7JhOQPzQA,1032
+sklearn/datasets/tests/data/openml/id_1590/api-v1-jdq-1590.json.gz,sha256=RLmw0pCh4zlpWkMUOPhAgAccVjUWHDl33Rf0wnsAo0o,1507
+sklearn/datasets/tests/data/openml/id_1590/data-v1-dl-1595261.arff.gz,sha256=7h3N9Y8vEHL33RtDOIlpxRvGz-d24-lGWuanVuXdsQo,1152
+sklearn/datasets/tests/data/openml/id_2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_2/api-v1-jd-2.json.gz,sha256=pnLUNbl6YDPf0dKlyCPSN60YZRAb1eQDzZm1vguk4Ds,1363
+sklearn/datasets/tests/data/openml/id_2/api-v1-jdf-2.json.gz,sha256=wbg4en0IAUocCYB65FjKdmarijxXnL-xieCcbX3okqY,866
+sklearn/datasets/tests/data/openml/id_2/api-v1-jdl-dn-anneal-l-2-dv-1.json.gz,sha256=6QCxkHlSJP9I5GocArEAINTJhroUKIDALIbwtHLe08k,309
+sklearn/datasets/tests/data/openml/id_2/api-v1-jdl-dn-anneal-l-2-s-act-.json.gz,sha256=_2Ily5gmDKTr7AFaGidU8qew2_tNDxfc9nJ1QhVOKhA,346
+sklearn/datasets/tests/data/openml/id_2/api-v1-jdq-2.json.gz,sha256=xG9sXyIdh33mBLkGQDsgy99nTxIlvNuz4VvRiCpppHE,1501
+sklearn/datasets/tests/data/openml/id_2/data-v1-dl-1666876.arff.gz,sha256=1XsrBMrlJjBmcONRaYncoyyIwVV4EyXdrELkPcIyLDA,1855
+sklearn/datasets/tests/data/openml/id_292/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_292/api-v1-jd-292.json.gz,sha256=Hmo4152PnlOizhG2i0FTBi1OluwLNo0CsuZPGzPFFpM,551
+sklearn/datasets/tests/data/openml/id_292/api-v1-jd-40981.json.gz,sha256=wm3L4wz7ORYfMFsrPUOptQrcizaNB0lWjEcQbL2yCJc,553
+sklearn/datasets/tests/data/openml/id_292/api-v1-jdf-292.json.gz,sha256=JVwW8z7Sln_hAM2AEafmn3iWA3JLHsLs-R3-tyBnwZA,306
+sklearn/datasets/tests/data/openml/id_292/api-v1-jdf-40981.json.gz,sha256=JVwW8z7Sln_hAM2AEafmn3iWA3JLHsLs-R3-tyBnwZA,306
+sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-dv-1-s-dact.json.gz,sha256=jvYCVCX9_F9zZVXqOFJSr1vL9iODYV24JIk2bU-WoKc,327
+sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-dv-1.json.gz,sha256=naCemmAx0GDsQW9jmmvzSYnmyIzmQdEGIeuQa6HYwpM,99
+sklearn/datasets/tests/data/openml/id_292/api-v1-jdl-dn-australian-l-2-s-act-.json.gz,sha256=NYkNCBZcgEUmtIqtRi18zAnoCL15dbpgS9YSuWCHl6w,319
+sklearn/datasets/tests/data/openml/id_292/data-v1-dl-49822.arff.gz,sha256=t-4kravUqu1kGbQ_6dP4bVX89L7g8WmK4h2GwnATFOM,2532
+sklearn/datasets/tests/data/openml/id_3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_3/api-v1-jd-3.json.gz,sha256=BmohZnmxl8xRlG4X7pouKCFUJZkbDOt_EJiMFPfz-Gk,2473
+sklearn/datasets/tests/data/openml/id_3/api-v1-jdf-3.json.gz,sha256=7E8ta8TfOIKwi7oBVx4HkqVveeCpItmEiXdzrNKEtCY,535
+sklearn/datasets/tests/data/openml/id_3/api-v1-jdq-3.json.gz,sha256=Ce8Zz60lxd5Ifduu88TQaMowY3d3MKKI39b1CWoMb0Y,1407
+sklearn/datasets/tests/data/openml/id_3/data-v1-dl-3.arff.gz,sha256=xj_fiGF2HxynBQn30tFpp8wFOYjHt8CcCabbYSTiCL4,19485
+sklearn/datasets/tests/data/openml/id_40589/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_40589/api-v1-jd-40589.json.gz,sha256=WdGqawLSNYwW-p5Pvv9SOjvRDr04x8NxkR-oM1573L8,598
+sklearn/datasets/tests/data/openml/id_40589/api-v1-jdf-40589.json.gz,sha256=gmurBXo5KfQRibxRr6ChdSaV5jzPIOEoymEp6eMyH8I,856
+sklearn/datasets/tests/data/openml/id_40589/api-v1-jdl-dn-emotions-l-2-dv-3.json.gz,sha256=Geayoqj-xUA8FGZCpNwuB31mo6Gsh-gjm9HdMckoq5w,315
+sklearn/datasets/tests/data/openml/id_40589/api-v1-jdl-dn-emotions-l-2-s-act-.json.gz,sha256=TaY6YBYzQLbhiSKr_n8fKnp9oj2mPCaTJJhdYf-qYHU,318
+sklearn/datasets/tests/data/openml/id_40589/api-v1-jdq-40589.json.gz,sha256=0PeXMZPrNdGemdHYvKPH86i40EEFCK80rVca7o7FqwU,913
+sklearn/datasets/tests/data/openml/id_40589/data-v1-dl-4644182.arff.gz,sha256=LEImVQgnzv81CcZxecRz4UOFzuIGU2Ni5XxeDfx3Ub8,4344
+sklearn/datasets/tests/data/openml/id_40675/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_40675/api-v1-jd-40675.json.gz,sha256=p4d3LWD7_MIaDpb9gZBvA1QuC5QtGdzJXa5HSYlTpP0,323
+sklearn/datasets/tests/data/openml/id_40675/api-v1-jdf-40675.json.gz,sha256=1I2WeXida699DTw0bjV211ibZjw2QJQvnB26duNV-qo,307
+sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-dv-1-s-dact.json.gz,sha256=Ie0ezF2HSVbpUak2HyUa-yFlrdqSeYyJyl4vl66A3Y8,317
+sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-dv-1.json.gz,sha256=rQpKVHdgU4D4gZzoQNu5KKPQhCZ8US9stQ1b4vfHa8I,85
+sklearn/datasets/tests/data/openml/id_40675/api-v1-jdl-dn-glass2-l-2-s-act-.json.gz,sha256=FBumMOA56kS7rvkqKI4tlk_Dqi74BalyO0qsc4ompic,88
+sklearn/datasets/tests/data/openml/id_40675/api-v1-jdq-40675.json.gz,sha256=iPzcOm_tVpfzbcJi9pv_-4FHZ84zb_KKId7zqsk3sIw,886
+sklearn/datasets/tests/data/openml/id_40675/data-v1-dl-4965250.arff.gz,sha256=VD0IhzEvQ9n2Wn4dCL54okNjafYy1zgrQTTOu1JaSKM,3000
+sklearn/datasets/tests/data/openml/id_40945/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_40945/api-v1-jd-40945.json.gz,sha256=AogsawLE4GjvKxbzfzOuPV6d0XyinQFmLGkk4WQn610,437
+sklearn/datasets/tests/data/openml/id_40945/api-v1-jdf-40945.json.gz,sha256=lfCTjf3xuH0P_E1SbyyR4JfvdolIC2k5cBJtkI8pEDA,320
+sklearn/datasets/tests/data/openml/id_40945/api-v1-jdq-40945.json.gz,sha256=nH5aRlVKtqgSGDLcDNn3pg9QNM7xpafWE0a72RJRa1Q,1042
+sklearn/datasets/tests/data/openml/id_40945/data-v1-dl-16826755.arff.gz,sha256=UW6WH1GYduX4mzOaA2SgjdZBYKw6TXbV7GKVW_1tbOU,32243
+sklearn/datasets/tests/data/openml/id_40966/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_40966/api-v1-jd-40966.json.gz,sha256=NsY8OsjJ21mRCsv0x3LNUwQMzQ6sCwRSYR3XrY2lBHQ,1660
+sklearn/datasets/tests/data/openml/id_40966/api-v1-jdf-40966.json.gz,sha256=itrI4vjLy_qWd6zdSSepYUMEZdLJlAGDIWC-RVz6ztg,3690
+sklearn/datasets/tests/data/openml/id_40966/api-v1-jdl-dn-miceprotein-l-2-dv-4.json.gz,sha256=8MIDtGJxdc679SfYGRekmZEa-RX28vRu5ySEKKlI1gM,325
+sklearn/datasets/tests/data/openml/id_40966/api-v1-jdl-dn-miceprotein-l-2-s-act-.json.gz,sha256=MBOWtKQsgUsaFQON38vPXIWQUBIxdH0NwqUAuEsv0N8,328
+sklearn/datasets/tests/data/openml/id_40966/api-v1-jdq-40966.json.gz,sha256=Pe6DmH__qOwg4js8q8ANQr63pGmva9gDkJmYwWh_pjQ,934
+sklearn/datasets/tests/data/openml/id_40966/data-v1-dl-17928620.arff.gz,sha256=HF_ZP_7H3rY6lA_WmFNN1-u32zSfwYOTAEHL8X5g4sw,6471
+sklearn/datasets/tests/data/openml/id_42074/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_42074/api-v1-jd-42074.json.gz,sha256=T8shVZW7giMyGUPw31D1pQE0Rb8YGdU9PLW_qQ2eecA,595
+sklearn/datasets/tests/data/openml/id_42074/api-v1-jdf-42074.json.gz,sha256=OLdOfwKmH_Vbz6xNhxA9W__EP-uwwBnZqqFi-PdpMGg,272
+sklearn/datasets/tests/data/openml/id_42074/api-v1-jdq-42074.json.gz,sha256=h0KnS9W8EgrNkYbIqHN8tCDtmwCfreALJOfOUhd5fyw,722
+sklearn/datasets/tests/data/openml/id_42074/data-v1-dl-21552912.arff.gz,sha256=9iPnd8CjaubIL64Qp8IIjLODKY6iRFlb-NyVRJyb5MQ,2326
+sklearn/datasets/tests/data/openml/id_42585/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_42585/api-v1-jd-42585.json.gz,sha256=fMvxOOBmOJX5z1ERNrxjlcFT9iOK8urLajZ-huFdGnE,1492
+sklearn/datasets/tests/data/openml/id_42585/api-v1-jdf-42585.json.gz,sha256=CYUEWkVMgYa05pDr77bOoe98EyksmNUKvaRwoP861CU,312
+sklearn/datasets/tests/data/openml/id_42585/api-v1-jdq-42585.json.gz,sha256=Nzbn_retMMaGdcLE5IqfsmLoAwjJCDsQDd0DOdofwoI,348
+sklearn/datasets/tests/data/openml/id_42585/data-v1-dl-21854866.arff.gz,sha256=yNAMZpBXap7Dnhy3cFThMpa-D966sPs1pkoOhie25vM,4519
+sklearn/datasets/tests/data/openml/id_561/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_561/api-v1-jd-561.json.gz,sha256=odOP3WAbZ7ucbRYVL1Pd8Wagz8_vT6hkOOiZv-RJImw,1798
+sklearn/datasets/tests/data/openml/id_561/api-v1-jdf-561.json.gz,sha256=QHQk-3nMMLjp_5CQCzvykkSsfzeX8ni1vmAoQ_lZtO4,425
+sklearn/datasets/tests/data/openml/id_561/api-v1-jdl-dn-cpu-l-2-dv-1.json.gz,sha256=BwOwriC5_3UIfcYBZA7ljxwq1naIWOohokUVHam6jkw,301
+sklearn/datasets/tests/data/openml/id_561/api-v1-jdl-dn-cpu-l-2-s-act-.json.gz,sha256=cNRZath5VHhjEJ2oZ1wreJ0H32a1Jtfry86WFsTJuUw,347
+sklearn/datasets/tests/data/openml/id_561/api-v1-jdq-561.json.gz,sha256=h0Oy2T0sYqgvtH4fvAArl-Ja3Ptb8fyya1itC-0VvUg,1074
+sklearn/datasets/tests/data/openml/id_561/data-v1-dl-52739.arff.gz,sha256=6WFCteAN_sJhewwi1xkrNAriwo7D_8OolMW-dGuXClk,3303
+sklearn/datasets/tests/data/openml/id_61/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_61/api-v1-jd-61.json.gz,sha256=pcfnmqQe9YCDj7n8GQYoDwdsR74XQf3dUATdtQDrV_4,898
+sklearn/datasets/tests/data/openml/id_61/api-v1-jdf-61.json.gz,sha256=M8vWrpRboElpNwqzVgTpNjyHJWOTSTOCtRGKidWThtY,268
+sklearn/datasets/tests/data/openml/id_61/api-v1-jdl-dn-iris-l-2-dv-1.json.gz,sha256=C84gquf9kDeW2W1bOjZ3twWPvF8_4Jlu6dSR5O4j0TI,293
+sklearn/datasets/tests/data/openml/id_61/api-v1-jdl-dn-iris-l-2-s-act-.json.gz,sha256=qfS5MXmX32PtjSuwc6OQY0TA4L4Bf9OE6uw2zti5S64,330
+sklearn/datasets/tests/data/openml/id_61/api-v1-jdq-61.json.gz,sha256=QkzUfBKlHHu42BafrID7VgHxUr14RoskHUsRW_fSLyA,1121
+sklearn/datasets/tests/data/openml/id_61/data-v1-dl-61.arff.gz,sha256=r-RzaSRgZjiYTlcyNRkQJdQZxUXTHciHTJa3L17F23M,2342
+sklearn/datasets/tests/data/openml/id_62/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/datasets/tests/data/openml/id_62/api-v1-jd-62.json.gz,sha256=fvNVGtR9SAI8Wh8c8HcEeppLlVRLuR1Khgl_i1dPjQc,656
+sklearn/datasets/tests/data/openml/id_62/api-v1-jdf-62.json.gz,sha256=SJsXcSbLfzNcsiBwkjO5RtOgrXHTi7ptSLeRhxRuWFo,817
+sklearn/datasets/tests/data/openml/id_62/api-v1-jdq-62.json.gz,sha256=J4pSpS1WnwfRTGp4d7EEdix32qxCn7H9mBegN41uxjQ,805
+sklearn/datasets/tests/data/openml/id_62/data-v1-dl-52352.arff.gz,sha256=-1gwyCES9ipADIKsHxtethwpwKfMcrpW0q7_D66KYPk,1625
+sklearn/datasets/tests/data/svmlight_classification.txt,sha256=an5ZLlFP2RJkK0iT8V6B5NLpNvZFUEzpTonY-Frcv0o,253
+sklearn/datasets/tests/data/svmlight_invalid.txt,sha256=ueCvdPekdiYpH8FAH_AW9MHiyMd9SulhrkJ8FQm3ol8,54
+sklearn/datasets/tests/data/svmlight_invalid_order.txt,sha256=xSNKVNcM7TuWkTyTZnQSTTcoBdERxUKoM2yz_gFCaHA,23
+sklearn/datasets/tests/data/svmlight_multilabel.txt,sha256=DsT6kKm83Ac7HLhmw6d6P0e2YNSdL7-ES3lgk7BozW4,104
+sklearn/datasets/tests/test_20news.py,sha256=-EdeU6SLVlTPCGtatJRplVBvPrt6AygXgeNz_9JF-8Y,5340
+sklearn/datasets/tests/test_arff_parser.py,sha256=n9WpxiBJ_AvltjDGmH8VLJyX6EXLWzhQQoGKTLYYbEI,8196
+sklearn/datasets/tests/test_base.py,sha256=ARlzPUqsECOclOcFbmglzjEAKIAlKYcEWDcpLEU5ppE,23022
+sklearn/datasets/tests/test_california_housing.py,sha256=-kGKf35jMxfB9PgvNryrL3Xqil_CVhoWFPqRGoCdBoU,1369
+sklearn/datasets/tests/test_common.py,sha256=F2J7ng0CH0Izs6yJ979ZrTfR_LO9stx_WoiE9y-kwgc,4392
+sklearn/datasets/tests/test_covtype.py,sha256=rnS0G-zkPov-roszvXRwiNBG50tciwMKe-D_RKe2OYY,1757
+sklearn/datasets/tests/test_kddcup99.py,sha256=5rw4Pva1EC2CO7imU9NVe0OqTrmTCu_4hElGpvZkUfk,2601
+sklearn/datasets/tests/test_lfw.py,sha256=YWNdfvIMcBbCfBfDSlaKBB1_9Q9qBXGe9VOaUUTFXac,7796
+sklearn/datasets/tests/test_olivetti_faces.py,sha256=d2r43YseviKoA9OyX6JvDyXvY8lFRfV__j5hippkYY0,919
+sklearn/datasets/tests/test_openml.py,sha256=RrIu0XL_1PqpegUN3pYJa5FM9QNCyCMX0kiIS_5DYvQ,54546
+sklearn/datasets/tests/test_rcv1.py,sha256=_MI_VuGKrZIIV-WMVxOEKMh94DqzhCrxV7l1E3NGkNM,2343
+sklearn/datasets/tests/test_samples_generator.py,sha256=CBWSP9td7WpU1vi8e2XiuMqauhXzvHHnXYJKZ22-56U,23846
+sklearn/datasets/tests/test_svmlight_format.py,sha256=mqKurK216uySN6hE-DAfHRt-6NHEGm4fBWyBIHpKCx0,20222
+sklearn/decomposition/__init__.py,sha256=joTYvN7TfssMwqycJWm9QjQqMknhLhm4CvpA3Xi3Jgg,1325
+sklearn/decomposition/_base.py,sha256=ghws6Nz8rN3zWFhk1DXbHAe-5oz9gpofEKey9G2Izx4,7147
+sklearn/decomposition/_cdnmf_fast.cpython-310-x86_64-linux-gnu.so,sha256=RYykXCL5MyiH_fkcA5LVszSHaIPZjyp9qGj9JZ0602w,117512
+sklearn/decomposition/_cdnmf_fast.pyx,sha256=ONJUPP9uKUn6uyUJHwHBD3qQeJmtM-7GFjFA8qCniJQ,1128
+sklearn/decomposition/_dict_learning.py,sha256=rIy4gcLaY434hn9jwcYQXTDvm0EB1ALgJ6cBoz8mDQ0,77761
+sklearn/decomposition/_factor_analysis.py,sha256=T-DH7_Wz9l3RJTDwzRTaPfQUCX9trhde3A_Yu3h9ysI,15245
+sklearn/decomposition/_fastica.py,sha256=araRZCVXh0BwHsGv4vp9p07DodDqTSrGPhKz77oFWwU,26553
+sklearn/decomposition/_incremental_pca.py,sha256=6dXXSI5OsmTXy8Ou8KhayQwf6n6wavqDiFa4z8C2fDg,16434
+sklearn/decomposition/_kernel_pca.py,sha256=-cHsZgTl-xECobnYgtUUnQQ2nrB5oEtFVhRHF_gWjWA,22379
+sklearn/decomposition/_lda.py,sha256=p26x3ZNmzm1bQeIkJTGxYrWiURgMdI-t4T2E3_nfXOM,34068
+sklearn/decomposition/_nmf.py,sha256=VY9hCOD73XvG06K934LiaZykUpGEgu_cXp--9xJ0-EA,81455
+sklearn/decomposition/_online_lda_fast.cpython-310-x86_64-linux-gnu.so,sha256=3OQSkA4qmhoyVOuYDLUwj-ZaBVWaJTYvhUg9nKeTf5w,174504
+sklearn/decomposition/_online_lda_fast.pyx,sha256=AMEYftJohmE84AayqSAn0CXbAb2ac_QAL_OSbjOsFJw,2842
+sklearn/decomposition/_pca.py,sha256=VjuYIRlMY-K79harkthjzcgFL7rlkkLOoAwNfECIlZw,34601
+sklearn/decomposition/_sparse_pca.py,sha256=Zjhwze5bnNBOnmU-aBK8KEcSbDj4hRDSZ-B8CC-UfiY,17916
+sklearn/decomposition/_truncated_svd.py,sha256=n-I_HryY_AvycFDZWt8wKWEZ8nGUM8BZYuYBHtb6qj0,11708
+sklearn/decomposition/meson.build,sha256=Ou8NjxEeKMUenExdqgH-7ijrec-bkKI8Q_21ScKCjzM,322
+sklearn/decomposition/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/decomposition/tests/test_dict_learning.py,sha256=ZnG9Zi7tcVkk8t1jwHjlHVqMt2-Zax0-R9Co7zgY3vo,30587
+sklearn/decomposition/tests/test_factor_analysis.py,sha256=WOiKlwnFn4WqelwLa8ERB4dZsUbjF32h3-OTtRgRzZA,4032
+sklearn/decomposition/tests/test_fastica.py,sha256=BFYeGAA9DGiZb4tVFpKi__0QtECEFk47qkPQFZ4xOus,15916
+sklearn/decomposition/tests/test_incremental_pca.py,sha256=Oa2iwpd53fnOFsVX_U6-54AFjRDS8gs84alpmqMKwOY,16897
+sklearn/decomposition/tests/test_kernel_pca.py,sha256=8h17WzyseYxwyMbR1LIweP_yF6CXkoIYEbLJBYto9T8,21021
+sklearn/decomposition/tests/test_nmf.py,sha256=TcuG7v5R864EHgikwlA3LtueImtLhVc0NU0D1YbAqYs,32219
+sklearn/decomposition/tests/test_online_lda.py,sha256=HQz3SUqlQ1BVMwhymTGcx1BdOliU_C1Y0RKrHR6XT4A,16023
+sklearn/decomposition/tests/test_pca.py,sha256=madikr_ZdbbGxMJRoV3mbMxm3IcaLcvXraAf-4uvMFw,41916
+sklearn/decomposition/tests/test_sparse_pca.py,sha256=BZiQPrCsQuk0k1gVt8769hhLZJdoKgrffGW0sxsbJYI,12077
+sklearn/decomposition/tests/test_truncated_svd.py,sha256=ZVJ_Jv-HX-3YM5uDZ4rA_U6SOxC6kRQGCIe-vxAgYj0,7242
+sklearn/discriminant_analysis.py,sha256=StVAOtSw-kEHgW4UunwMyrWx5aTcbDzkfurKH5uxYsI,40512
+sklearn/dummy.py,sha256=BGnZaLCwgpPTHZZy9qjvy2NFSTX4xQZXrsBhQgdVtJk,24507
+sklearn/ensemble/__init__.py,sha256=emYX8q4bOw4SGxORFbVKSzOsRZwhm2H04PqFab1_-oY,1374
+sklearn/ensemble/_bagging.py,sha256=h4FpdoDbNDT_JjCXGbUe0_CGpD_mmrRROKoXNGI589E,52239
+sklearn/ensemble/_base.py,sha256=-CfPYQHpnf0RJ-mU0WZyENQWpIyLHMYPXoJNAAyBpPY,10543
+sklearn/ensemble/_forest.py,sha256=xaQjDmN1PZZGdDY728RxeTQPKEMxMxctzh7O9Oc7buQ,117697
+sklearn/ensemble/_gb.py,sha256=Ao8IAFBxxZmOtu9EFACfs5G8svxz-OGFhPbx0Km0BZ0,87765
+sklearn/ensemble/_gradient_boosting.cpython-310-x86_64-linux-gnu.so,sha256=xB-0sP67L7r96jvrSjaHJbetUwmG_6yGbZSHbquYB2w,127136
+sklearn/ensemble/_gradient_boosting.pyx,sha256=Emsc3f3sNgCb7RgQV5f_mnXfDHPAI0N1gvQe6NaINwQ,8562
+sklearn/ensemble/_hist_gradient_boosting/__init__.py,sha256=CjfoMHKJd5hxBLWAbtW-lN4WAoAjhWpw8RwtcWmuX-s,246
+sklearn/ensemble/_hist_gradient_boosting/_binning.cpython-310-x86_64-linux-gnu.so,sha256=5y3SoWn1amuZOrZcdT7Re6YGcg3DszXB9p3wYjXojE4,92641
+sklearn/ensemble/_hist_gradient_boosting/_binning.pyx,sha256=iQH5QwuI4ia7LHDw8RclXqhwscEWTc2H7vshtH5usOE,2786
+sklearn/ensemble/_hist_gradient_boosting/_bitset.cpython-310-x86_64-linux-gnu.so,sha256=q9ceGvcfECb-jJcmig9nPxRDtyZUu_XlUWDq8mJ_DGc,80024
+sklearn/ensemble/_hist_gradient_boosting/_bitset.pxd,sha256=_5y92vr1nOs5_KyCfs2-E-hTnpEW5KTGjUTXMwthIQ0,708
+sklearn/ensemble/_hist_gradient_boosting/_bitset.pyx,sha256=Jyt_GO23ad6ZM7XKlEKxQlWV_j-s7cbVn83P44mr6d0,2540
+sklearn/ensemble/_hist_gradient_boosting/_gradient_boosting.cpython-310-x86_64-linux-gnu.so,sha256=5r3v3NUICZNXz5a64tUo6obwSzo3sjjNKqt4Haykl6w,96865
+sklearn/ensemble/_hist_gradient_boosting/_gradient_boosting.pyx,sha256=-0EYKZFppgamkie2aaQii29psvZjmd6g6rTAkeLOOos,1990
+sklearn/ensemble/_hist_gradient_boosting/_predictor.cpython-310-x86_64-linux-gnu.so,sha256=wu1OAJ9ecgbIKHkcJcYS7zpubXq17s7kJNx8GWXY2vc,133897
+sklearn/ensemble/_hist_gradient_boosting/_predictor.pyx,sha256=oBIH9D7SzdCdiv7n0hZA-o54TI4kFFDdkc-GUtN_1f0,9575
+sklearn/ensemble/_hist_gradient_boosting/binning.py,sha256=7ZuQXsKA4FbHw8xI6dm7puW_0xjsCFTzgDdlRC0RwI0,13925
+sklearn/ensemble/_hist_gradient_boosting/common.cpython-310-x86_64-linux-gnu.so,sha256=2OUg6YuO6SkFZ7eceqRPscPyGXqThxKMObxTuQkFLnM,45824
+sklearn/ensemble/_hist_gradient_boosting/common.pxd,sha256=MLDp9cP2k6UeUENyhJKBynnwTSoUnfAG-J32TucOZpk,1244
+sklearn/ensemble/_hist_gradient_boosting/common.pyx,sha256=FSvUdsBMiLIAmvk1eke3C0PBo0dcmUIJ1omN7a-B0kY,1747
+sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py,sha256=-I7BWx-GHWrIUXuOPlNIu0Ui6-MSfF2JEnUCB4tCf9w,97143
+sklearn/ensemble/_hist_gradient_boosting/grower.py,sha256=QM1v8cGeXwdP3pOUnQ3PjKAPJ9NX6g9T-MsuFSBacsk,32674
+sklearn/ensemble/_hist_gradient_boosting/histogram.cpython-310-x86_64-linux-gnu.so,sha256=3ewoECAzxvpN0N0QJ2AKIIofpnuUXur-g3rrBa_l1Gk,228569
+sklearn/ensemble/_hist_gradient_boosting/histogram.pyx,sha256=BB-f6QgDOPiQ_vUSUKTANZgpeeGON7Elpe6-yz8WwG0,20651
+sklearn/ensemble/_hist_gradient_boosting/meson.build,sha256=aNiFEGgexu7353QjlQ_MgjSL1hQK6wlBgLytMaZEgwE,979
+sklearn/ensemble/_hist_gradient_boosting/predictor.py,sha256=oBStnOotKnJcUp-lJCigLNOeOO4U0KywfrKo4zFBBzE,5029
+sklearn/ensemble/_hist_gradient_boosting/splitting.cpython-310-x86_64-linux-gnu.so,sha256=GTBeprW5smLCVXKjp2nF6VsqQps3gCYVMAT3vunHCkI,261345
+sklearn/ensemble/_hist_gradient_boosting/splitting.pyx,sha256=edDtSh-xGAJq7X7IWp-_hoTGpc-zaGFfcETr3WH7YXk,52287
+sklearn/ensemble/_hist_gradient_boosting/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/ensemble/_hist_gradient_boosting/tests/test_binning.py,sha256=aNXHw7u7IRAdEfHO2TWdjAmlj9y_SdhJir-w0yQ-fkc,16252
+sklearn/ensemble/_hist_gradient_boosting/tests/test_bitset.py,sha256=5QHny5G3p9tyExBsdsUVV2vFKgPI-vYDt-zvLpMBHXQ,2100
+sklearn/ensemble/_hist_gradient_boosting/tests/test_compare_lightgbm.py,sha256=yaUeaZ8g4F5J3Vrct3mfcR9djCMV2gKvn7ITF4QZtVM,10592
+sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py,sha256=P8jW5nyqUKP9iIpDIL6kooPxgxyv_3DlZbPiErP3_Vk,63145
+sklearn/ensemble/_hist_gradient_boosting/tests/test_grower.py,sha256=mDda3Xp-vF2Kgqdz3bj5UUtC4jUZR--dCesLwmDI50c,23152
+sklearn/ensemble/_hist_gradient_boosting/tests/test_histogram.py,sha256=PBoacgv-6rOI5lTpzCyaafC9eDvyA6tb94RnDw_wLhs,8681
+sklearn/ensemble/_hist_gradient_boosting/tests/test_monotonic_constraints.py,sha256=ucsF7gy_hskZ1oDK6GSD1lr9ypKNqadkEFXRGeaNHfQ,16940
+sklearn/ensemble/_hist_gradient_boosting/tests/test_predictor.py,sha256=wq5vXIMwh7Fr3wDeHGO2F-oNNXEH_hUdyOyS7SIGXpE,6345
+sklearn/ensemble/_hist_gradient_boosting/tests/test_splitting.py,sha256=nkX5rAlTeO6tPR4_K4Gc9bvViPu1HUboA7-vRdiTETo,38639
+sklearn/ensemble/_hist_gradient_boosting/tests/test_warm_start.py,sha256=3Q_3ZhKf94uvmADlNMj0Vpyp7gqjDd1czBzFW8pUuAQ,7933
+sklearn/ensemble/_hist_gradient_boosting/utils.py,sha256=RiXIru1WQYuMxoj7Ko141DeH32WctBmQZeTfKwYdRcA,5523
+sklearn/ensemble/_iforest.py,sha256=o3PaqtullSmCARwGI0MsVukYzMRopDdeVnhvM3VW2Lw,24264
+sklearn/ensemble/_stacking.py,sha256=Z8D7xDNAg2nxEM_B4us7RoYz7_1OcF-p9lj3izrcM6U,43546
+sklearn/ensemble/_voting.py,sha256=WL7_PjWtf8V4fdf9fOpIYB79qAxaTp8U4q1hjfrxsu4,24834
+sklearn/ensemble/_weight_boosting.py,sha256=Cl1PzwH0DG5CGcOH22Eacd_cmkysykABwgIgD99aTYA,41097
+sklearn/ensemble/meson.build,sha256=7nR6oq_djKOBo-7Yxc-UmB6uWVai4w5By9i10tBX4hE,224
+sklearn/ensemble/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/ensemble/tests/test_bagging.py,sha256=YS38i0QjCIZ_XY3YSwstXAo5pa_65v6JHcreb5T2NfQ,33682
+sklearn/ensemble/tests/test_base.py,sha256=dCynI18UuKx7HpGwnUSjfUR2GlTfhGRmO_UA_-kDu6A,3667
+sklearn/ensemble/tests/test_common.py,sha256=kUynrJPb67QHmQZaVC0KPWvJkZAhTEKEF5WFSO8pM2k,9106
+sklearn/ensemble/tests/test_forest.py,sha256=Oko4dDMgB2z6H-UbGaCxKiwG2ezbhqiGKjPnc2QyJAM,62801
+sklearn/ensemble/tests/test_gradient_boosting.py,sha256=zrUVq7La0QRrA34MccQBCqatrPJlOwzHxy34AG-h5YA,58761
+sklearn/ensemble/tests/test_iforest.py,sha256=s2wpk7-N9Hr6hRWYvOAhsbQTkrRqXbu3CYisUNud6nQ,13539
+sklearn/ensemble/tests/test_stacking.py,sha256=Gqiay4pCaaZ68F-jDcTixcEKb7te7ztR-w9W2xqYHEU,33490
+sklearn/ensemble/tests/test_voting.py,sha256=HLY47XeqyoSuHR5jAD25TIcLAvFt4Kjt0MxXNEUVkR8,27499
+sklearn/ensemble/tests/test_weight_boosting.py,sha256=EPyS-E7pWkcs4-bJGzM2gE1rDpTGshTTki4kXAf593U,21928
+sklearn/exceptions.py,sha256=CaaFS4DVbqhqUidiA-cMvTP6DR6qIFmEUzuiMS5HDec,7703
+sklearn/experimental/__init__.py,sha256=0SSV8qXhFfA8-T9zvuWasIT8bNbPXLUX4ZQZp0CoDzk,305
+sklearn/experimental/enable_halving_search_cv.py,sha256=4s1q_AiYCx7jiZGmc7uieges2_MsYh8ykfUi3UC4qMw,1290
+sklearn/experimental/enable_hist_gradient_boosting.py,sha256=0vehofwAKeWQbeQO0B0E0lulIWUk1q4pwBCMFERSm3Q,826
+sklearn/experimental/enable_iterative_imputer.py,sha256=IgDLGeBd6XtbGp-K5xuef6edPfHGaLNakuDMfE_Vj9A,768
+sklearn/experimental/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/experimental/tests/test_enable_hist_gradient_boosting.py,sha256=cAFugPf0tYSd-P2-GlcfvhG7YnKlfMoqE8Pff7yXG-4,672
+sklearn/experimental/tests/test_enable_iterative_imputer.py,sha256=LWtq99MTXXga2dq_ZcB0korId_7ctVxKtZLrFNZvFns,1689
+sklearn/experimental/tests/test_enable_successive_halving.py,sha256=MVt6aApWKiR3VnVRnY7GEoQdI8w-f2M--w60vS0B5vA,1896
+sklearn/externals/README,sha256=GFbJH7vHxxuzJLaVlul1GkfwjREK64RyEXUCWL1NSxk,270
+sklearn/externals/__init__.py,sha256=jo7XxwlsquXvHghwURnScmXn3XraDerjG1fNR_e11-U,42
+sklearn/externals/_arff.py,sha256=YXR8xgF1IxyugQV70YHNjmza2yuz86zhVM1i6AI-RSA,38341
+sklearn/externals/_array_api_compat_vendor.py,sha256=Gb7C65qVPo5gbKKlpq4jHtXWkgsN0wIrTQAaFBbais0,198
+sklearn/externals/_packaging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/externals/_packaging/_structures.py,sha256=Ofe3RryZqacr5auj4s7MsEylGigfeyf8sagFvK-rPv0,2922
+sklearn/externals/_packaging/version.py,sha256=IDbp4Q6S9OZ3mP57YCDerh4Xm0s6AUqSi6CbFJ3eQyI,16134
+sklearn/externals/_scipy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/externals/_scipy/sparse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/externals/_scipy/sparse/csgraph/__init__.py,sha256=GMAcZXBWt9Dp0QEOeCsQglt8CWB6_stqr7Wf_LfH0tE,34
+sklearn/externals/_scipy/sparse/csgraph/_laplacian.py,sha256=l1bAYnntljvIXc8mwJqSpLS6EBTjzMTb0XrW2_S1A1k,18166
+sklearn/externals/array_api_compat/LICENSE,sha256=T_2Xjj-hjQWNmMZncc_qftY0qvcCPPlhK4tV7umo8P4,1097
+sklearn/externals/array_api_compat/README.md,sha256=YjsmsQ3VNuGPaD7I6a_lvqGBVNBhm-k5ty-yWwIjjRY,67
+sklearn/externals/array_api_compat/__init__.py,sha256=zk6TZdJLBzT7Td3TKbCkYA1KIxKOsa-CKqDn0JCUq2I,992
+sklearn/externals/array_api_compat/_internal.py,sha256=pfbMacXgxBaLmhueWE54mtXrbBdxyLd2Gc7dHrxYtGk,1412
+sklearn/externals/array_api_compat/common/__init__.py,sha256=4IcMWP5rARLYe2_pgXDWEuj2YpM0c1G6Pb5pkbQ0QS8,38
+sklearn/externals/array_api_compat/common/_aliases.py,sha256=xvZcAGCBbbujmjh76EvaYDzgPfQhaHK8QH--CQI906U,19644
+sklearn/externals/array_api_compat/common/_fft.py,sha256=ckCR2uHtz0iaOkcuvqVunhz1khIdxQNKuVU0x1bfrq8,4669
+sklearn/externals/array_api_compat/common/_helpers.py,sha256=zIz2QmS4LEI-aT05xMzXTgZ6Y6aULKbxlZxWa_R-lb4,31586
+sklearn/externals/array_api_compat/common/_linalg.py,sha256=Wdf0FzzxJNEiGhOOsQKg8PnMusM3fVeN5CA4RBItF_Y,6856
+sklearn/externals/array_api_compat/common/_typing.py,sha256=Z5N8fYR_54UorD4IXFdOOigqYRDp6mNa-iA7703PKf4,4358
+sklearn/externals/array_api_compat/cupy/__init__.py,sha256=8KfEs6ULcXuZ4AUKBD_7L3XZfW8TOQayZPerR_YLeSI,390
+sklearn/externals/array_api_compat/cupy/_aliases.py,sha256=OgOoVRk-TI9t0hCsI82VLkebkZRdN7aXjamWMRw0yYQ,4842
+sklearn/externals/array_api_compat/cupy/_info.py,sha256=g3DwO5ps4bSlFU2pc_f4XTaLrkCYuSDlCw0Ql2wuqM8,10125
+sklearn/externals/array_api_compat/cupy/_typing.py,sha256=dkA_sAAgU1Zb1PNopuOsywbLeFK-rLWAY4V4Vj3-x0I,628
+sklearn/externals/array_api_compat/cupy/fft.py,sha256=xCAC42CNAwAyVW7uCREsSoAV23R3rL2dqrT7w877zuE,842
+sklearn/externals/array_api_compat/cupy/linalg.py,sha256=nKOM-_wcOHzHhEeV9KBzcMVNlviJK4nP1nFBUtvnjTM,1444
+sklearn/externals/array_api_compat/dask/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/externals/array_api_compat/dask/array/__init__.py,sha256=OkadrcCZUdp3KsB5q2fhTyAACW12gDXxW_A4ANGcAqY,320
+sklearn/externals/array_api_compat/dask/array/_aliases.py,sha256=ZmoAVGbsj04gcfE7R0V6N_7AXCZrhYSFXXfzJfJ5O4Y,10668
+sklearn/externals/array_api_compat/dask/array/_info.py,sha256=rpfvNrS4ZaZMEcaomlRFxx7Dqb_tohhDFvI6qYoaivI,12618
+sklearn/externals/array_api_compat/dask/array/fft.py,sha256=OZxTcLBCXKgVpbMo7Oqn9NH_7_9ZUHQdB6iP8WSYVfY,589
+sklearn/externals/array_api_compat/dask/array/linalg.py,sha256=AtkHftJ3hufuuSlZhRxR0RH9IureEet387rpn1h38XU,2451
+sklearn/externals/array_api_compat/numpy/__init__.py,sha256=7SOguTm7-yJgJPnFTlbk_4bPTltsgKLbkO59ZmoCODg,853
+sklearn/externals/array_api_compat/numpy/_aliases.py,sha256=SKaCfzc2eY1eAu3Yzm3JVuR3uUqL7PoXf6GyYyXpcw4,5715
+sklearn/externals/array_api_compat/numpy/_info.py,sha256=8KNJ09jKFfMH20wff67GJVPyoZ-e8-OUHF88THx-1Cs,10782
+sklearn/externals/array_api_compat/numpy/_typing.py,sha256=O03YoguInLXMcL5Q0JKHxRXSREgE0DCusVAZKAv-l10,626
+sklearn/externals/array_api_compat/numpy/fft.py,sha256=7oxAzAnFwsAH0J43eXFKRkJ_GKCVEC-7G_lz56pVBz8,779
+sklearn/externals/array_api_compat/numpy/linalg.py,sha256=ORu4MhuN6F5EXOy-lYHxfMHkRpVRx2VEC29rRwB8Bws,4039
+sklearn/externals/array_api_compat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/externals/array_api_compat/torch/__init__.py,sha256=o351abwQmNWcX00GBnGYHrpfM8pFiieFWRaf0NI-KFg,549
+sklearn/externals/array_api_compat/torch/_aliases.py,sha256=w_exCqFcAuB3TXtiqk_NpSHJ8D3ZawulLdjFxTvujQc,30261
+sklearn/externals/array_api_compat/torch/_info.py,sha256=-H2xD9z9SMf3GjIOW0jeRTUOvh4s8E9p9u_4LqawRZM,11889
+sklearn/externals/array_api_compat/torch/_typing.py,sha256=-uCkuTie1g9hb4vwPLK9eEnir9Zp67wAhrfaI_o-35E,108
+sklearn/externals/array_api_compat/torch/fft.py,sha256=9YO23YEbQr49gq_DrfJ7V0G41G7WlJC6rJAeqqOP7dw,1738
+sklearn/externals/array_api_compat/torch/linalg.py,sha256=acbcg80CjamMQ0JDAkrWL7FkyEW5MfmGVzQsrRT00jM,4799
+sklearn/externals/array_api_extra/LICENSE,sha256=WElDmP4Uf9znamiy3s1MCM46HqI3ttZ4UAHBX4IsbtY,1097
+sklearn/externals/array_api_extra/README.md,sha256=hujBWt3i3o5AkT4rUqbVle7qQ3LhbaSwl1VYPT33rig,66
+sklearn/externals/array_api_extra/__init__.py,sha256=Xsj-UtwQSb-PYz6mcJ76Bj0NPKmzOXcTzBeMBZY7EV8,660
+sklearn/externals/array_api_extra/_delegation.py,sha256=1biTXOZj5KyDCG2JEOgCGasKHu6n1UMF_9iuB8YP-wI,6345
+sklearn/externals/array_api_extra/_lib/__init__.py,sha256=GCx2h0v6DbmpkC0XDJkRzbZWcUqwwHEuVDoAeX7FrAI,91
+sklearn/externals/array_api_extra/_lib/_at.py,sha256=-ZPik4faGK6D_WvsCg9V926C0oF_x6Cmw8i3yfjvTyM,14970
+sklearn/externals/array_api_extra/_lib/_backends.py,sha256=MJ4r-NYRF9gSZkLJviYq7DeioyfgIWM9ErIkCavNANU,1754
+sklearn/externals/array_api_extra/_lib/_funcs.py,sha256=5kXrbceGaV7v2PlZiweQo7CXesB1TqXJzYegZib2yrk,28982
+sklearn/externals/array_api_extra/_lib/_lazy.py,sha256=abt1ee49uFMx3Nws8-BKee2j1qLwVUGx2trJfTHusGY,13682
+sklearn/externals/array_api_extra/_lib/_testing.py,sha256=TH7--PHPinrQ6gRZWMiCSyZGgTaZyXZ6AOSbvtPsAYQ,7658
+sklearn/externals/array_api_extra/_lib/_utils/__init__.py,sha256=8ICffM2MprXpWZd8ia0-5ZTnKtDfeZD0gExLveDrXZs,49
+sklearn/externals/array_api_extra/_lib/_utils/_compat.py,sha256=l_4tKMzUsfG3f_ZjczhYpuwhq8G76GtzxkgJ1fEhrzk,1724
+sklearn/externals/array_api_extra/_lib/_utils/_compat.pyi,sha256=M0UcaeFCqLPgGsF8N5mHw7s3bsrlbDfJY2uhLozJ97I,1675
+sklearn/externals/array_api_extra/_lib/_utils/_helpers.py,sha256=7rZIEG-g6xqVKs7erLlt-nLDTOomUmAh45rXP42fVW4,8234
+sklearn/externals/array_api_extra/_lib/_utils/_typing.py,sha256=FCc9Ocs2akiX3Wzwv7gWb737Azt_RRmsbEVT9dc9WU8,213
+sklearn/externals/array_api_extra/_lib/_utils/_typing.pyi,sha256=-XcCOYxOoKjgPeo3w9Pqg1KyYm6JTKm6aO_jD22CGoU,4725
+sklearn/externals/array_api_extra/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/externals/array_api_extra/testing.py,sha256=mw_0y_TzMmTP2wUV_ofAwcih0R_ymhUkQBrHBj9k_gM,11940
+sklearn/externals/conftest.py,sha256=8wfDBd_pWHl3PsD3IOGeZT4z0U-q2895fYvApMzq5gg,312
+sklearn/feature_extraction/__init__.py,sha256=I44s-WIjNSCKkaMvQ6k60KFhHD3Je34kYW5ebV4TYTk,396
+sklearn/feature_extraction/_dict_vectorizer.py,sha256=jjMZ8gPjjPihpP-sOjM1sFI_xt5WeqDem54-ZLQUZxw,16030
+sklearn/feature_extraction/_hash.py,sha256=R84FrVMR4ZvQ1vIg4P_rSg-sK2wb4werrEyfiq_wKFI,7795
+sklearn/feature_extraction/_hashing_fast.cpython-310-x86_64-linux-gnu.so,sha256=KK8D4ISTB3V4Gaeo_pYTZwuw2kYhO6_W_WXZOCPdCBc,94200
+sklearn/feature_extraction/_hashing_fast.pyx,sha256=V-PISJDpipnfNlxj6NxYhdq4LsaYwpudjdzSim1OKiw,3027
+sklearn/feature_extraction/_stop_words.py,sha256=ZEfwEZHSNFr0id2pPdBlZq-E9j6VFQM8S86gubzOweo,5725
+sklearn/feature_extraction/image.py,sha256=pAx59y5gZ0WDgExj7SnHstWEHTOvmZD_MyqoHfdX-BY,23563
+sklearn/feature_extraction/meson.build,sha256=5D4WuiUPvXvqJcQj-yqpkmQ2yxJ9yVr6T-_Q5Gk0Tw8,192
+sklearn/feature_extraction/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/feature_extraction/tests/test_dict_vectorizer.py,sha256=sJfcwyId7Xjrs3aakS-HjkPvt0dzuVLqIuCQmpxnN5U,8256
+sklearn/feature_extraction/tests/test_feature_hasher.py,sha256=WT6h7r7k7gwS3-CvxO4F4ssw4jXSfptTGQKJL9i4D58,5046
+sklearn/feature_extraction/tests/test_image.py,sha256=lALrGDEr4LzX0HCMKNtcrhzHrtqrL-j_QDsk8_zLfcU,12303
+sklearn/feature_extraction/tests/test_text.py,sha256=Yh1wrcKr7l2Axtuc-KsFwguAzG5UqxryV3_VzTbashY,52240
+sklearn/feature_extraction/text.py,sha256=v9e4fUrhPNj4sNfkGPSbrIKjVKrWIhDY0EPr5ZmoSIE,77382
+sklearn/feature_selection/__init__.py,sha256=_G69r4hI6pPZ_6Da8uPNMW1MBzdulQfgcrJuinCJ6Mc,1128
+sklearn/feature_selection/_base.py,sha256=lwJe6Qub7zyF6LHHrT3jZ4Y2asC2Eb6oPWC6hh2gwGQ,9426
+sklearn/feature_selection/_from_model.py,sha256=heQ8iO367qKPUYrHf2MgiSwyIXbtoDu_i5yht2hF80M,18651
+sklearn/feature_selection/_mutual_info.py,sha256=e8tJ69GdZu4VgpRW85nlxAXrY3Y4I8xg68xe79y2uDQ,19968
+sklearn/feature_selection/_rfe.py,sha256=Y8w0_KQLZtFAKvu2Q8tHNAGwFCGAN3abiXyjd39HR9o,37652
+sklearn/feature_selection/_sequential.py,sha256=c6dilPIHBKOCAYTGYWSWSg4VlCEsxXrg2MYMO7DfRaQ,13904
+sklearn/feature_selection/_univariate_selection.py,sha256=dnj6zNvGKDlnH7R-iOgco6a0U4OmCBg0zL8TtJSI5M4,40735
+sklearn/feature_selection/_variance_threshold.py,sha256=uxrTWbLzgx_b74XKUGmNwrSWMOjP0LDq7kXUD_mLQxY,4639
+sklearn/feature_selection/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/feature_selection/tests/test_base.py,sha256=ythpS8iRYjFm3VP581ikkgPobz12JrlTAYBTATIKKBU,4832
+sklearn/feature_selection/tests/test_chi2.py,sha256=c6L3cs9DYulMNUTjnZJo7VURucjhUHLYzG2EaRE9N1c,3139
+sklearn/feature_selection/tests/test_feature_select.py,sha256=59hWeQqIEOZJGcE5IL5y3jMnlBwFbpuwH855OKUgpsA,32507
+sklearn/feature_selection/tests/test_from_model.py,sha256=qAQAdvrS7SwnXpNY53qexquuMoWFAZyO_AZQVNdSKUk,23841
+sklearn/feature_selection/tests/test_mutual_info.py,sha256=IyCSjjXPkQez915cjtshElj_9xQVHY84a5aiCJMFP4s,9853
+sklearn/feature_selection/tests/test_rfe.py,sha256=xCDzFtO6UnnoApmEmPMHR61iii_IImfA1AZcwKR2xIo,25270
+sklearn/feature_selection/tests/test_sequential.py,sha256=9Z-naJRDVboKShzMI4xcWekQjwktpUwKT2hmaalAS3Y,10906
+sklearn/feature_selection/tests/test_variance_threshold.py,sha256=tKaSBkRgVBzo3xC0lT6nLNNzKW4M-5t_sAFJgUmr--g,2640
+sklearn/frozen/__init__.py,sha256=7zBEBZHkRwHUBRG1VAn6kPYJeFjFkktqSpLATohnI7o,148
+sklearn/frozen/_frozen.py,sha256=hKGn7cTTiE6Db0cBoehUCyRNbRcOObRPeBM7V0X_XC4,4985
+sklearn/frozen/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/frozen/tests/test_frozen.py,sha256=u7WjplRRlNCjNx77UMkBbVpXhuKFdM6TgVSmvwEzI_4,7069
+sklearn/gaussian_process/__init__.py,sha256=pK0Xi-lrrByscZP7Brgk92RC5Qy4AIDrOtFb71bpQ58,330
+sklearn/gaussian_process/_gpc.py,sha256=iL9epkfnD-q4-n0cpLf5ClLiV_2pWDNDkFqxGRfoxMw,39297
+sklearn/gaussian_process/_gpr.py,sha256=zpKQWpQkjfBtXtwxz3R_SWSGEixKsjKoMkhOCVsAM_U,28314
+sklearn/gaussian_process/kernels.py,sha256=l0uLSlAi-Mrax0cAPSDPZ3N7osIViS2rSQIFr7rrV3o,85106
+sklearn/gaussian_process/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/gaussian_process/tests/_mini_sequence_kernel.py,sha256=YpD-vtJFSVdzVmJxHDmEdFGl6cOQ4J98mLpjFCFThys,1571
+sklearn/gaussian_process/tests/test_gpc.py,sha256=XZIDGXYMKKgjB3Tn53Dnyit4oPrpDOE5GSlC61a-L0Y,11251
+sklearn/gaussian_process/tests/test_gpr.py,sha256=yTJz72nlINDcPygRoAjQTSZ8Mv79DoAhUq7CiqM4lXk,29682
+sklearn/gaussian_process/tests/test_kernels.py,sha256=izel3Fru6VdgNRGHxnwVqmVENxy06sYjDTF03iRI9mQ,14492
+sklearn/impute/__init__.py,sha256=ps33PrOn-LYpyam1EVU7mur1eIlt8huormM1mbDV1UI,1031
+sklearn/impute/_base.py,sha256=8xtPfsw7_5doIKVZeusk0F4_C3MLebx1TYbRIyt1AO8,42913
+sklearn/impute/_iterative.py,sha256=cgIyfyJjaV5HySQ5TxaX97Aywa8VpSkr5UJAtNd1iWI,40184
+sklearn/impute/_knn.py,sha256=1kvnVdpDEHsm-pZBTYhbNWIAtcMzWoDPJkLpIdeJFGo,14905
+sklearn/impute/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/impute/tests/test_base.py,sha256=L-RND6V8s4g40Uy65BIdQG1oEtHgOWBliBH4bUVdVQc,3367
+sklearn/impute/tests/test_common.py,sha256=G7WzU8u9bItkql-tlSTnRdekw0HPeCDfObCYQwcV63w,7616
+sklearn/impute/tests/test_impute.py,sha256=pUplIQ0TmQR21lY5SJoQ0ll21FmGoXrZtqPXVv_Ik9k,66345
+sklearn/impute/tests/test_knn.py,sha256=4FL0dBxzW_FooUpFuzgR6uYDH2Y4l9pLGJ1zkgy9b4Q,17540
+sklearn/inspection/__init__.py,sha256=Sb9g89Bjofq0OCfNUQlC3rfvHyGE__zWiXA2yvPhib8,485
+sklearn/inspection/_partial_dependence.py,sha256=BAR29VAvZyQ6bn6cNoEJmUQSWjF5uie6vjR-5RmxgrM,33439
+sklearn/inspection/_pd_utils.py,sha256=m01ubgd8W-ThbL95ATj7dRWK6nACermQBc0MrEPPQr8,2218
+sklearn/inspection/_permutation_importance.py,sha256=XqjjABRNDScQUAoJos5hhruGuRE1EdLLZTyc15BPblo,11395
+sklearn/inspection/_plot/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/inspection/_plot/decision_boundary.py,sha256=fJgQNeItWQB70nngLb-2_AJeOkL-Gq9P7eXng1_kPBI,22072
+sklearn/inspection/_plot/partial_dependence.py,sha256=kg2frhpo2AMCmhZWirf6aCSIbaD5svA0lqT6ee79e6Y,61426
+sklearn/inspection/_plot/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/inspection/_plot/tests/test_boundary_decision_display.py,sha256=kuwvW1ND7hZwEHz3dooYVl47rjVLy_gjuGqfGWMg_bs,24640
+sklearn/inspection/_plot/tests/test_plot_partial_dependence.py,sha256=KHHwbby3GhtkD_4x6fLlR0ZVU2nokGX2eDrDMW-JA9w,41417
+sklearn/inspection/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/inspection/tests/test_partial_dependence.py,sha256=7Bu-KuVvLuCZtQjBi6ZP-2sDmrN46isUtByOzd-pHLw,40976
+sklearn/inspection/tests/test_pd_utils.py,sha256=t-8K4YbQAbVK4pcI1P9hr8-0iEgc72x_1-868HAhLBg,1640
+sklearn/inspection/tests/test_permutation_importance.py,sha256=wDt75_tkjpDMffkcYn7jz6WeKZrkXgsBhtAO6nAa7WY,19840
+sklearn/isotonic.py,sha256=dIKBLNb4TNGdTKRJbP4iR0PM_MfLy4BlnZ4dF40zkAI,17371
+sklearn/kernel_approximation.py,sha256=AgM5jql4nyxrTD5zlw0DC1pROLRtlL2ttUOSI0B0hqw,39676
+sklearn/kernel_ridge.py,sha256=b9dyensnC3vnJhkIJSzoAtVO5-QDYP4cl7GGD_01IUE,9211
+sklearn/linear_model/__init__.py,sha256=m1s3A4BrvReDX5PliDalY53YhPfvh1s-x4efa1flIaE,2411
+sklearn/linear_model/_base.py,sha256=HS_9ugy0UJ0RmD-oe6QYfURpycGun9kZNGEoGyCzUTM,28901
+sklearn/linear_model/_bayes.py,sha256=5maNoqyc8gZCDHs7h-PVipebFfQW4_e7lxkW6Ef5r-c,29016
+sklearn/linear_model/_cd_fast.cpython-310-x86_64-linux-gnu.so,sha256=ASiBbaSGJnuF7N7PfZhW1KNJGALoBiYsj66XNHQwPd4,378624
+sklearn/linear_model/_cd_fast.pyx,sha256=ssLdsiFVGST1OFCXtygffSYCs1W-KQXClCY3662q99E,32804
+sklearn/linear_model/_coordinate_descent.py,sha256=3IOmDXrTDKvNPa571XyoYMrgeEbK-Zh_ijCFn-WtGg4,118398
+sklearn/linear_model/_glm/__init__.py,sha256=BmGWcP-GtYkT0WWUcbku9vHCWfCV6V8pniulKsbyrvU,318
+sklearn/linear_model/_glm/_newton_solver.py,sha256=ijZCrGUrsNQwgs1cRRRQpWq7oSJ7TUKmBPLXKOz3YsA,24477
+sklearn/linear_model/_glm/glm.py,sha256=6riFlb2eKwjvQUY_o_r4b8a6V5LCHMMqpNIwMAA7y3Y,32206
+sklearn/linear_model/_glm/tests/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/linear_model/_glm/tests/test_glm.py,sha256=OSNL5u1UYyCUnn02iorwIUzkgyAwV55euP3SB67usrw,42223
+sklearn/linear_model/_huber.py,sha256=7Cj6NId-S-iRPZtO6VAiyJDqczWKkAekEo7wqwLgStM,12690
+sklearn/linear_model/_least_angle.py,sha256=4546YB9iYpnryuxiVpb1piQXyTxQmba6Ki7qS90vw-s,82966
+sklearn/linear_model/_linear_loss.py,sha256=qQSX-bxYyAKk8bQ2z33b_pHBMLp1wXVmj5Zz5aCgEzQ,34113
+sklearn/linear_model/_logistic.py,sha256=_TM-DMQ83cxyJVQkVBaRvbwghoWEKRf9b55VC_TTAOU,90722
+sklearn/linear_model/_omp.py,sha256=--eDGLDRu_s8p_veALnGprMyzsIGV3AytfSuGXcfHPQ,38267
+sklearn/linear_model/_passive_aggressive.py,sha256=zF7znXaTn5M5cMRpHr6rNYllZoaD4Ohk6IXOE-skNBE,19264
+sklearn/linear_model/_perceptron.py,sha256=dZkROr_kx5MLVdiP9nTaHiIdQX9_q330-7SXrgV3pjk,7564
+sklearn/linear_model/_quantile.py,sha256=lIfK-QCEa0zNqZKed6ayrfU6QdKC9UKePFZPq4MD5aA,10471
+sklearn/linear_model/_ransac.py,sha256=gJgPVGQFGpREoSQSBAz-f9Ar8j-WgRLQ38bf9HitbkI,25733
+sklearn/linear_model/_ridge.py,sha256=oKjF4mYRwbyRqXroXWrdWbmKL6XJL_fCVGfqiL1uTOM,103515
+sklearn/linear_model/_sag.py,sha256=56X90dePIvQEQG6TDDr6PWMnoL6yYUQ10NQF49JiGhU,12286
+sklearn/linear_model/_sag_fast.cpython-310-x86_64-linux-gnu.so,sha256=p963OXcpCwwNnxcVNmeav3BlFjtxyMKLPFOTHVve_No,164992
+sklearn/linear_model/_sag_fast.pyx.tp,sha256=FFxDn4DS3e8zt5VfK9ZRIDIn0xusZJwbGWsd7QuX5Ks,24277
+sklearn/linear_model/_sgd_fast.cpython-310-x86_64-linux-gnu.so,sha256=ILJnUyc0xgR7946MrvhUFYCJA53kncPd2PrGiZBUV4E,239728
+sklearn/linear_model/_sgd_fast.pyx.tp,sha256=5ewo_7gSyywxQBqtEBL6V_eBmtJORSadRPURK2ZEFB0,20671
+sklearn/linear_model/_stochastic_gradient.py,sha256=3LoT_LCt_2ftIk78NJiw08zeoZFabk81kEQmt1Qd_TY,90146
+sklearn/linear_model/_theil_sen.py,sha256=krSq8Hr9ilc4EHCdiH5fm3pn_N3PgndHu-LCZUHIlCE,16405
+sklearn/linear_model/meson.build,sha256=UTRL_xsxXtXpbw4pokGzMgLjeuEj0HGgzGoQebqUZ3M,929
+sklearn/linear_model/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/linear_model/tests/test_base.py,sha256=XMSu3aWOFjB6o_0jG6plMG6TWjpuag1TOrQZCODz2Vo,27048
+sklearn/linear_model/tests/test_bayes.py,sha256=YrINPjqB0laIJxpcrVPI3uG7qUWJkE-Mntzp9P6Xf0I,11078
+sklearn/linear_model/tests/test_common.py,sha256=fUPlV7x4PGbNE6YloDEo2VsX2r4dPzc_B84w7MwefC8,7303
+sklearn/linear_model/tests/test_coordinate_descent.py,sha256=CmCoLW0BEYWwA7TqE1l3g-1llmKMldM3p_1korNXodc,63282
+sklearn/linear_model/tests/test_huber.py,sha256=au_AulAuqWt1XACGbWr5_1tw12M_g7Vi2U3LxvyflgM,7615
+sklearn/linear_model/tests/test_least_angle.py,sha256=Du1rm-UVjzDTjztRw_S-_OacyOscAg5yqAmSKwsrMbo,29609
+sklearn/linear_model/tests/test_linear_loss.py,sha256=2zMWRVfYQM_sVuvzTOYeG9Kl4N9XhyxSSbACCU_BUx4,17912
+sklearn/linear_model/tests/test_logistic.py,sha256=MEVeBDmj8qdMrHk03PdnD3wa8FPlonMf07sNdWOeHyY,85696
+sklearn/linear_model/tests/test_omp.py,sha256=ZG03dTxyJGmeajIo4fA8SN4Kxwz_rzcOTeEVkS6g3HY,9344
+sklearn/linear_model/tests/test_passive_aggressive.py,sha256=oylJ8F5LNg0br4zX2LXZRU8FMUECnhsaVL0r8mxmd1Q,8994
+sklearn/linear_model/tests/test_perceptron.py,sha256=rsNfXmS37bAZeZ04kRNhc2PXr4WjjTWDaxW_gNmMCkI,2608
+sklearn/linear_model/tests/test_quantile.py,sha256=JiOfB1V2NwuWeK-ed6hKmOpHPHj7CNEHp_ZZuGt4CZk,10689
+sklearn/linear_model/tests/test_ransac.py,sha256=bDDkKflBMv5vTMjAZPfjC0qvlA_VNNDhS9bYC6T3g2M,16790
+sklearn/linear_model/tests/test_ridge.py,sha256=Hpk-qE-_QoDKtaYezNqAhgBUxkQjRn4gAkrQU3fzI8U,81605
+sklearn/linear_model/tests/test_sag.py,sha256=ksURaaSDjzvHB203ZH6bRxd1s9fUkPhcAb62XAXjk7o,25807
+sklearn/linear_model/tests/test_sgd.py,sha256=4Lc9pjw9E9x5BA8KmkmKkqALcZzR2GFl0NCMQWQUZbo,69765
+sklearn/linear_model/tests/test_sparse_coordinate_descent.py,sha256=2_IRPgEBCa6eWM_vtHfVHqX8-LDN7pj027WSpFHjWys,12654
+sklearn/linear_model/tests/test_theil_sen.py,sha256=UIfe_oW99MnoSeNZeqf2nfzuMd2zzDq5a6rjxpHRkl4,10135
+sklearn/manifold/__init__.py,sha256=gl4f7rOHDtrpOYrQb3eQeUrRRT2Y5TZpwrgDfG-d0uE,565
+sklearn/manifold/_barnes_hut_tsne.cpython-310-x86_64-linux-gnu.so,sha256=4T9MoxWDRENcQKuxQMdXqkfIEMjNs_Lg1gKiyBex1Xc,134145
+sklearn/manifold/_barnes_hut_tsne.pyx,sha256=W2mN6eXTRn8kuBLdAV5S2LVyPxG6WemhA0z0CuLBuU8,11264
+sklearn/manifold/_isomap.py,sha256=h-X6biNZS5G33-1thUSn-qnDsRxg09kqMu5hD49WhV4,15686
+sklearn/manifold/_locally_linear.py,sha256=otP2a25Y6Tgf95IuhQB-rfJnZUzrMPHCYuOFTshu5XE,30541
+sklearn/manifold/_mds.py,sha256=_UaYQVKWUAFs_NuGS3vYL_58AE7gqFvX0oosb1ejSFc,26025
+sklearn/manifold/_spectral_embedding.py,sha256=5arXNyMZyZhEXQddoJgH6uahUiHxIeuw9-t0HZhekWY,29916
+sklearn/manifold/_t_sne.py,sha256=Vce22nRw2xWDeBiELqjA-vM17plPUqbRFl4kKz2pYEE,44265
+sklearn/manifold/_utils.cpython-310-x86_64-linux-gnu.so,sha256=D9F-Sd1d32rtDMY090dcbbfRsonFOqPnSKaHI8PexQ4,89520
+sklearn/manifold/_utils.pyx,sha256=o8U-cGOuCt2W0uJ6GTvTgALOmtPoUMyM4ZXsg0hmou0,3908
+sklearn/manifold/meson.build,sha256=sCySiLhLC1RumNBhRsAFZFM7GyU88lQxCrBVcZhWgtU,314
+sklearn/manifold/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/manifold/tests/test_isomap.py,sha256=Wl4voE-7ZRpK6YS6JKyEpAhccA0ReBlGyLNU-p4hQWc,12074
+sklearn/manifold/tests/test_locally_linear.py,sha256=yxsUuJ7vzm2VxiLi1fuZjzICS_0mXrwIicJHLC79eDM,5772
+sklearn/manifold/tests/test_mds.py,sha256=Q77vGfH1pB_LAiYYoKSAt7jaBGabAUtHyCwvMHmEz0k,7197
+sklearn/manifold/tests/test_spectral_embedding.py,sha256=YvmsFIvLYGZqn2FSXhSxU80P_vmYv4kVv7sR4jDouIQ,17775
+sklearn/manifold/tests/test_t_sne.py,sha256=xZPO7J--r2m3_bqMP4Odnz3_A16mmxu5A2aX_Bx4in4,39057
+sklearn/meson.build,sha256=ihYL4bRJExpefJ5vOIOJPU2Ufm1-jfhVN5Sht_E9nog,9808
+sklearn/metrics/__init__.py,sha256=mQOOWIFYPSJ60bPWNUH8RxXqL0K71gz9NYwj41YW6YM,4633
+sklearn/metrics/_base.py,sha256=ppcQ_yli1Z3SgwSvy7boSIDW4el9bmtp0ZxXr3XlQsw,6987
+sklearn/metrics/_classification.py,sha256=b-iLrbaQ3fNw-MVgqShvYFRKxQhiV2sz-kdXarWNnhQ,139502
+sklearn/metrics/_dist_metrics.cpython-310-x86_64-linux-gnu.so,sha256=n3H4fMRtfUiQCcQK9bosXvPj6q0ylI6fwV_UKmydor8,644840
+sklearn/metrics/_dist_metrics.pxd,sha256=U4vH-mgokzVA5-li0CRbFICY4gyJ8gOjtpQs6bQg7G8,7330
+sklearn/metrics/_dist_metrics.pxd.tp,sha256=YI-GhztvViANTOCY4cjexOnxGJNVdVN1tH2l7yyCV00,4378
+sklearn/metrics/_dist_metrics.pyx.tp,sha256=L9frrbHm0t3l6KXz_T_W9aEg7g0wagXDyHzJmzoMqJA,92197
+sklearn/metrics/_pairwise_distances_reduction/__init__.py,sha256=tUkZS268OxDpX4rYbbw8a0zG8W03xtpxo0lqIvIdZmI,5132
+sklearn/metrics/_pairwise_distances_reduction/_argkmin.cpython-310-x86_64-linux-gnu.so,sha256=TDBt5qsl7VNZwg10FwHD-lc_tK9B8yOkIITlnj31BFA,269969
+sklearn/metrics/_pairwise_distances_reduction/_argkmin.pxd.tp,sha256=eLGvaqpxdaoT1CgTTtzn9_PlCJ7fLMmZ_vqcDsTeBI0,979
+sklearn/metrics/_pairwise_distances_reduction/_argkmin.pyx.tp,sha256=2qtw0fq-UuAkxkz1nKLUOE-wSXosKNHrK8biI6ICxQs,19783
+sklearn/metrics/_pairwise_distances_reduction/_argkmin_classmode.cpython-310-x86_64-linux-gnu.so,sha256=rzVc2X64m3hKTmZu5StJ1bzr3xjKp1_3cOX89ZxS0Ns,171217
+sklearn/metrics/_pairwise_distances_reduction/_argkmin_classmode.pyx.tp,sha256=KHXJwDRXq58rYQYnjlgE8k8NUXl0Qz9vrpwKTee8z_M,6432
+sklearn/metrics/_pairwise_distances_reduction/_base.cpython-310-x86_64-linux-gnu.so,sha256=_liZ-V1SjJ0zdsv2-l-VfGterV65qA_6TxbHhhN_3Ck,237345
+sklearn/metrics/_pairwise_distances_reduction/_base.pxd.tp,sha256=vIOGH_zE7b8JUZ3DOC0ieX18ea7clFZzd1B2AnrYeek,3563
+sklearn/metrics/_pairwise_distances_reduction/_base.pyx.tp,sha256=h4sPRzksjOO35w6ByoulBx8wtb3zV44flEWYXXyaEAY,18353
+sklearn/metrics/_pairwise_distances_reduction/_classmode.pxd,sha256=DndeCKL21LyIGbp42nlWI9CKoyErDByZyQawUagL1XE,151
+sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.cpython-310-x86_64-linux-gnu.so,sha256=omf1lvpmHzl3gg1_wHPwe67GJhuwToK7crAzIA2Tj2s,386600
+sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.pxd.tp,sha256=7BR2LUjE2MELP3fV9OZH9tXakpsw8QQumBFi_CjMU0U,1948
+sklearn/metrics/_pairwise_distances_reduction/_datasets_pair.pyx.tp,sha256=ipbswS5TSNvw9lO_6tN-7E8ruDS5HbMDumfoxr5h0H0,15087
+sklearn/metrics/_pairwise_distances_reduction/_dispatcher.py,sha256=UsK6BZyrKlmIMxJy82Y65HfbEuegPLcODsZ8J5io3eo,29806
+sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.cpython-310-x86_64-linux-gnu.so,sha256=LYFwMV_BVYYtzzoLYG4ui1DWdOxAwth0qq9Q2u5HR6k,385752
+sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pxd.tp,sha256=bsr7Pmqj-09ciVAh5bMfyc6A8KgcQ_3WlPC0dBoWwfI,5925
+sklearn/metrics/_pairwise_distances_reduction/_middle_term_computer.pyx.tp,sha256=2RUfNdjCB6aJU4b42nNYZb2ILAYY74A9SGfu3zzn8Gc,20344
+sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.cpython-310-x86_64-linux-gnu.so,sha256=xqGlfyydwpse40znpGu5kwnBYd2MReLZXOw88qCzkdM,296385
+sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pxd.tp,sha256=gaUTpGpL4dPmjcwjnIrjlOs7RX4pUe9-T-6QDspl5No,3254
+sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors.pyx.tp,sha256=105e6MGHtvVGqQs3JkpD7BnYFcn8G1TPeQ4VIPGiF_4,19423
+sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors_classmode.cpython-310-x86_64-linux-gnu.so,sha256=xjhU9vo3xPAL64-qc2VLdiHaDwVPTR9weB2G1QdOi0c,204113
+sklearn/metrics/_pairwise_distances_reduction/_radius_neighbors_classmode.pyx.tp,sha256=J-hJcHrpN0bsPMGIMfFu_RYDVFaayvl4M8GMteOHRzA,7353
+sklearn/metrics/_pairwise_distances_reduction/meson.build,sha256=tlbyYpIVeIOkS1_9LoBk5br8jscbwBss7cFIO86uMyw,7540
+sklearn/metrics/_pairwise_fast.cpython-310-x86_64-linux-gnu.so,sha256=KAEOs4Fgzu_w6UjAZqVAYJWmcycbWQP444pNmIyFJpc,179401
+sklearn/metrics/_pairwise_fast.pyx,sha256=LmzoEGFiL-shm5pOwGHBR8Pue8Qz_cY0rNStYVSWxVQ,3460
+sklearn/metrics/_plot/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/metrics/_plot/confusion_matrix.py,sha256=YfXTo3iYAY0fokkz77iUbRgp75CfrbO8cWU9og6z4Ws,17330
+sklearn/metrics/_plot/det_curve.py,sha256=s7-5iGGsKSUlGxiGwK2UNKJ9C1L9MESU_XKNHHHaahE,12595
+sklearn/metrics/_plot/precision_recall_curve.py,sha256=xnFVrHXNK46OFsIqOMJBmHC4BDd2YRMLSNGk-uxjMQ8,19414
+sklearn/metrics/_plot/regression.py,sha256=_6smop2JeU3aS1LbKCZCNbjIVpQbFF4WR8mlyFnVOLw,14691
+sklearn/metrics/_plot/roc_curve.py,sha256=b3_-RNwVCVbXG7MxRf_8piAQrXwesJvRLl3IejDoR4A,28572
+sklearn/metrics/_plot/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/metrics/_plot/tests/test_common_curve_display.py,sha256=oq5eSPrDGbksf-x7TeNfXtvqZPJQwWG_nY6ixkumx2A,9825
+sklearn/metrics/_plot/tests/test_confusion_matrix_display.py,sha256=E1xT26QRcOHH8VvuLShq8ev5YQ_8bLsJmfkHW7dTiiE,13487
+sklearn/metrics/_plot/tests/test_det_curve_display.py,sha256=j8LJA2Ms-IoZjip1zvymtwORF6uTe4MBx6ldGAaqj_U,3633
+sklearn/metrics/_plot/tests/test_precision_recall_display.py,sha256=d5-4E3HOQXvMshtrKOUt7NIwwqe7-eknw8wouX_Y6TE,13884
+sklearn/metrics/_plot/tests/test_predict_error_display.py,sha256=3PnOYrgBf7bnw1zHCPWm28tVCeuZlR4hIQD2fR-9RfM,6007
+sklearn/metrics/_plot/tests/test_roc_curve_display.py,sha256=YiS8sF4nL9cZZE5iFxBimqO_prRgOgg__WgAN-bVAug,34828
+sklearn/metrics/_ranking.py,sha256=ofwC8LBCo5RcN2ksk3enRoAN0qkM3CJ99SaPIYvqP3Q,78995
+sklearn/metrics/_regression.py,sha256=c5RpBgYy5F6Ck-RdsRxCYIinZpZDKjJyAdJ9RsqeO8s,65002
+sklearn/metrics/_scorer.py,sha256=tvOiC__wKam3Th2I0E0NTtEUcl4Sq04l3QtWim4kEpI,41073
+sklearn/metrics/cluster/__init__.py,sha256=xQxpw9CyuWGDuqYT0Mrl82HTdseiQCGJD8wpEf_e1wQ,1415
+sklearn/metrics/cluster/_bicluster.py,sha256=gb0X2lNFVTCqmdi1YutW3c_W4ZqjiBKmgYWs57lxEUc,3637
+sklearn/metrics/cluster/_expected_mutual_info_fast.cpython-310-x86_64-linux-gnu.so,sha256=0tCuoh8vTr4-EtbKOovSsVh6qTQs_EnJDH3U9qYLo5s,107888
+sklearn/metrics/cluster/_expected_mutual_info_fast.pyx,sha256=UWIcBVPgxQ6dD99fmNtP_QdmK4jd-im2zIB4R0gqPMc,2687
+sklearn/metrics/cluster/_supervised.py,sha256=6sdhfvWBGmRz6KINd5Dnr3xK2QDPRDmNcc2PMLCmo34,45333
+sklearn/metrics/cluster/_unsupervised.py,sha256=JT-IKuqoswGQ3_w16yLb0qm773K_WQUDjkl4m8c35FE,17019
+sklearn/metrics/cluster/meson.build,sha256=j4LJu4kH3dRH5UZN-2B62MM4m3mXwq44hEIeBRLgd2w,164
+sklearn/metrics/cluster/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/metrics/cluster/tests/test_bicluster.py,sha256=KecSxviHfRfUMNVZ0g77Ykx96QAuKoax0YUY8paQjFg,1719
+sklearn/metrics/cluster/tests/test_common.py,sha256=sUBhJJbGfo2zPA-JJ73xXDXc7c_VI1870kdBxwkIoEk,8201
+sklearn/metrics/cluster/tests/test_supervised.py,sha256=GWrG7Suowna_Emut6bsGzf3z3ie5SDvh7Szs2OkrXJs,19370
+sklearn/metrics/cluster/tests/test_unsupervised.py,sha256=eAic9M_89S8Xbk1hEX0xyIeBW2GrAwPOTpNuNob3TaU,12269
+sklearn/metrics/meson.build,sha256=OH0IO4OSp5gSFTXVRZkj8zvyidbgtaoLJ2kZmON2PxE,1510
+sklearn/metrics/pairwise.py,sha256=zZsB-LFPhVvNWCG2w7w00Mnmv1Vgx7Z9-oT3hhKAbnI,91691
+sklearn/metrics/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/metrics/tests/test_classification.py,sha256=R4nU1hSRhS82WIhhEjVkJyZd5zuVEWRHOxMZxB5WH5E,120654
+sklearn/metrics/tests/test_common.py,sha256=2Coo4Hhq4TF3Oy4CFg_npBsubJDdFDo82x_ptuWFcTg,77273
+sklearn/metrics/tests/test_dist_metrics.py,sha256=vMpc3Q1sgD6nuWNXkKVQD46eGRkzn1S_w1w72ACLP2I,14995
+sklearn/metrics/tests/test_pairwise.py,sha256=f5VoV6kv-F-pEzPpmSdaM_jfuSts4X4RZDLQFrgPoME,58631
+sklearn/metrics/tests/test_pairwise_distances_reduction.py,sha256=t-ZNZ7RyXOkybyFvCxm7VU2UWgOjY2_roOE8UO89aig,53061
+sklearn/metrics/tests/test_ranking.py,sha256=PJH9La5JdFhTQJCTrgE7YrV_rkEv5zY9dUkZj30VnA0,83993
+sklearn/metrics/tests/test_regression.py,sha256=W8spjLxk7WZO42-gVGwnkapTCbvPVJoHQ1HFzOrIJgA,25924
+sklearn/metrics/tests/test_score_objects.py,sha256=JhAQazrHgDR2hx1mFUO6G2XR_A-tyAmkCktKduuPHY4,59004
+sklearn/mixture/__init__.py,sha256=o0w1PyZ4gXtcQcpvrGrYEn226ugS_Ne3kQ3ZJPGt6-8,276
+sklearn/mixture/_base.py,sha256=JloA758DB-woL_K_MymnLwN7wN6GS7gap5YFN8olobY,19241
+sklearn/mixture/_bayesian_mixture.py,sha256=PmRf4Dyqb0k995eZMi57_cvaIl_mqZ6Cr4zVX4oziCY,33573
+sklearn/mixture/_gaussian_mixture.py,sha256=xJ5DG7DKrD_cx61FepCZaJesbWuumhAXAMjfBrTFxq0,32736
+sklearn/mixture/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/mixture/tests/test_bayesian_mixture.py,sha256=23_HO3xRwo4hMpF60yjCVixeCsx4T4bZcd_OebiqmPA,17040
+sklearn/mixture/tests/test_gaussian_mixture.py,sha256=TJPWI0kChKEMvdF8RYDAa14Co_VhI_wAIIm0x4DJflY,50021
+sklearn/mixture/tests/test_mixture.py,sha256=ar7zjdUa-fsJQlroNmS8-Mj0brARolFyLEZrLdOIrWM,993
+sklearn/model_selection/__init__.py,sha256=EyWSMWF2i6eVm4VtUqG3e9xtniasEDVLt8Am-wUs4Io,2660
+sklearn/model_selection/_classification_threshold.py,sha256=NaKa_yc3fo3rn49nxSmTm0_ZYGzn0XK9AjImz78P2ws,32637
+sklearn/model_selection/_plot.py,sha256=J2LntPSgwlkDTYDkkh1Wn__ZZavYUup-yfqkg7b_MIw,34579
+sklearn/model_selection/_search.py,sha256=4bkqRGyiGWHShE9Y7outfmvbxzLtsmcDm2Yxk_If3TE,79924
+sklearn/model_selection/_search_successive_halving.py,sha256=AuDSR5cEbOvr1rAMOST1f1DvPNibA-PzZyCDYd0XwR4,45154
+sklearn/model_selection/_split.py,sha256=zrfGqOcIwVv6sCFiGVTy0YjCmCa0VWuMtM-P7tkPTcU,109612
+sklearn/model_selection/_validation.py,sha256=gFPz1-o_mkOmFStvMRBjnr42EjATs2XqBiLMgSGyvN4,95908
+sklearn/model_selection/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/model_selection/tests/common.py,sha256=PrR7WoVcn4MdG4DPrOvuZ1jrOIZPFPok20zannr4dwI,641
+sklearn/model_selection/tests/test_classification_threshold.py,sha256=dZ_fWiDJdiz9DFa3ZGBH1u5-cljeXrOY5DYixxw5rP4,23299
+sklearn/model_selection/tests/test_plot.py,sha256=goA_s29K0admCpVCSnWisPzLVf5-XvbTfwxev-DcDZ8,18456
+sklearn/model_selection/tests/test_search.py,sha256=I9KuCvt7N30CMiEdoue3BvMixiQ6JtPSQkJ7X_Yp-TQ,99221
+sklearn/model_selection/tests/test_split.py,sha256=m_eeANTxv3ZqIjLBy8L5ibfzgUMDNtEbsqdeJ8zlTN0,74292
+sklearn/model_selection/tests/test_successive_halving.py,sha256=liuAL9oXGDJM8a63Jpqjp_UmMTehJNnFlHZvjK08gRI,29010
+sklearn/model_selection/tests/test_validation.py,sha256=zY5nRfnG-Nl4Ljhbev2nPaaMNDLDXjwgFnjLtKrRLxk,92511
+sklearn/multiclass.py,sha256=X_8kN37ayDtZOe9k1AeAhz8Ttfvc9YBbr2isVTOabPk,44339
+sklearn/multioutput.py,sha256=cGafTqvPvgTLrZoDXWltAfJ8p_eTvA1xKgPsPJx2Zxs,45541
+sklearn/naive_bayes.py,sha256=7iZcCCF7K0oFQ72YTLEalitNL0yagVAzLoTxNktdN-w,55949
+sklearn/neighbors/__init__.py,sha256=AGlC69XvpiUJ2KeIs96WoogAF5GdQFv48c1BUnOR4tk,1251
+sklearn/neighbors/_ball_tree.cpython-310-x86_64-linux-gnu.so,sha256=uEYZsfmFJIVyqpiMSwDKo3v1NtAKT-xweWTkJgtU4dw,664400
+sklearn/neighbors/_ball_tree.pyx.tp,sha256=xqeo6v1L72VcadqIVGX7db8fNX9wI0X5tP3u3uz30UQ,9321
+sklearn/neighbors/_base.py,sha256=Zobunz82rnq5tXKpCTHmiTRejVq2sYeTYfsuoVmQ2eU,52312
+sklearn/neighbors/_binary_tree.pxi.tp,sha256=-TY-H2YOsJbKLfI4Xg9G6yc8tUujBszvEPeKs8UtEt4,100641
+sklearn/neighbors/_classification.py,sha256=TUGUxAjnEvwWrFvg2bqC9Wj8fWbQkvInIz9waKaDIew,35044
+sklearn/neighbors/_graph.py,sha256=SvWpzfkH-5xcG8TjkVT0cVNYbQf_kDtBPB1GC-iNfDw,24611
+sklearn/neighbors/_kd_tree.cpython-310-x86_64-linux-gnu.so,sha256=fBR5X_FTeUu-9WNv_kKl1VSoUZLzX88hx9RCyeU1eIY,674424
+sklearn/neighbors/_kd_tree.pyx.tp,sha256=ZM4_DcS7eUkXbpxBJ4OLXR6exLbkGUB7Kmd_Ou2H4N0,11117
+sklearn/neighbors/_kde.py,sha256=g3Tsl0vWeKT_rE8UYQI8mc8chg2KzJtRQtr0kirgHW4,12272
+sklearn/neighbors/_lof.py,sha256=oFd01Nt9be1BN09osbZ4xfZy0ehFTN3qnr54QapLTmM,19957
+sklearn/neighbors/_nca.py,sha256=rk8JChFYShvGqSwpLVjl9MaXZI_zc6BkIzCmk95wdb4,19864
+sklearn/neighbors/_nearest_centroid.py,sha256=a85jX0t6z64tI6afHzSqjW0rB0uwhABQV9DU10O0LIQ,13048
+sklearn/neighbors/_partition_nodes.cpython-310-x86_64-linux-gnu.so,sha256=-u91LgE-xVvocjeCjLmpwYSkifIOjhtstP5EROWD62w,28920
+sklearn/neighbors/_partition_nodes.pxd,sha256=rngZZqkJWPnBW8BRvk0FgM817-lcHgCoBWEd91X0Dbc,288
+sklearn/neighbors/_partition_nodes.pyx,sha256=iJw0PB95n4VgXORPMjDzLr0DJKgdfzoz_PUKyi0MelY,4120
+sklearn/neighbors/_quad_tree.cpython-310-x86_64-linux-gnu.so,sha256=LFyV0U6C8QuTi4TlNcGWA4nvUnuL-BfOWUU-N5A2AZk,191440
+sklearn/neighbors/_quad_tree.pxd,sha256=olKQpppK6rZ_HKcXS3swAb7dq_aTyOlcilY8bg_d1mw,4232
+sklearn/neighbors/_quad_tree.pyx,sha256=pztvIhqbZHC6iGre_wMDKY7o3qSZzu-bZDSzgB7ggCc,23664
+sklearn/neighbors/_regression.py,sha256=r5dKgxNNjwjdfuDzsOOeXsQ7S7tv3viPWjEReBjrEqg,18313
+sklearn/neighbors/_unsupervised.py,sha256=OXFrGjh8anfiEEflMk6fmZj0sZ6Ie4J-zfArTEhVQvM,6260
+sklearn/neighbors/meson.build,sha256=hZzIPGmdgKDqcNMm_WajOYj9-2gwXFpTxpAAdNWCzKM,1634
+sklearn/neighbors/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/neighbors/tests/test_ball_tree.py,sha256=hpoJiFpMrGxw0FEhd-KghO8zWtonaqSr1JgbKB7sdN0,7097
+sklearn/neighbors/tests/test_graph.py,sha256=QdJvyK2N138biDPhixx_Z9xbJ7R-aSxz5mhSSvh-HRg,3547
+sklearn/neighbors/tests/test_kd_tree.py,sha256=4cE2XJO0umuWnWPQluOMR9jfeJKDXmFETowsLElwKCI,3898
+sklearn/neighbors/tests/test_kde.py,sha256=kEZsv-8U0oWrkAVuzRidsqL5w1jQZ2b7tK9pFZYnm44,9745
+sklearn/neighbors/tests/test_lof.py,sha256=x0h5dzFQpRqSG91CviJa_cytpemWv2HPSe45leX-p60,13746
+sklearn/neighbors/tests/test_nca.py,sha256=CAT5f0TpDPc8hvpPHobj2y-41xuQDjk3d1dNmdiTeCg,19506
+sklearn/neighbors/tests/test_nearest_centroid.py,sha256=Uo0oebJiyjCnrkSx9mDN89EPbFjhmhV2c8boUEIXRyQ,7572
+sklearn/neighbors/tests/test_neighbors.py,sha256=Yi42k3z52_Qp96nIUnuAHPAbN4hd0yHlHrZM1zqaXH0,86776
+sklearn/neighbors/tests/test_neighbors_pipeline.py,sha256=CwllxS4T9cP2utY-xuui3GhgtjRBkA7759byS4LdQ3U,8147
+sklearn/neighbors/tests/test_neighbors_tree.py,sha256=8OagtxQTE0jNy7-rTbl4L9lEbCgarf6n_jkx1woYlOs,9297
+sklearn/neighbors/tests/test_quad_tree.py,sha256=y_WE4jNxliYos_SiICl_miGIya2IJlu71rXzwvQw2qk,4856
+sklearn/neural_network/__init__.py,sha256=p9-lqKAT-q-6wCIj0R97J1cflbINXL4-0X60SF3hhmY,276
+sklearn/neural_network/_base.py,sha256=bp4Z3TxnFtzH7VinDh9GAuywChqyz3NohImLLymG9jg,7983
+sklearn/neural_network/_multilayer_perceptron.py,sha256=q1Kcv3H4gaQR6so_P77eopnoWGm269xxuCM_LPLCIi0,65995
+sklearn/neural_network/_rbm.py,sha256=Bi37Of-5A-gfCoEBo62QbANnPD9WBdW_MVcYfYsey4s,14968
+sklearn/neural_network/_stochastic_optimizers.py,sha256=ldZWuIL10VpHq4tZ2PzJrTSWzAQjdpbzx7iJEbbFyMw,8838
+sklearn/neural_network/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/neural_network/tests/test_base.py,sha256=jSriY_p7h95ngec0Iggh2IwDpeR67RirQ5-q2RrP9Zc,1566
+sklearn/neural_network/tests/test_mlp.py,sha256=ICYTyg2Bf15s4nPhxBEjq5rUj38d8Dgr5dA2_PARTAM,36232
+sklearn/neural_network/tests/test_rbm.py,sha256=Ucezw6y1X0HU9PEC9lniKrqXplVXjfX5yjWueHIPPkg,8048
+sklearn/neural_network/tests/test_stochastic_optimizers.py,sha256=9JhAPo1Qc0sA735qPORoKtS04bCTts9lQ65P9Qlhtyo,4137
+sklearn/pipeline.py,sha256=CyAjrCn3Pr_-DUX-LSbKaqZO1edSCSeKxHSS4oCWJlk,84473
+sklearn/preprocessing/__init__.py,sha256=IW0_AGxFmhh1JCuwnVwBPv43_M_zkvoXO5aorgz82iQ,1503
+sklearn/preprocessing/_csr_polynomial_expansion.cpython-310-x86_64-linux-gnu.so,sha256=nTaj2rnmzZmJpFUGE4DkCigI12bHDH3kdQEqqy4vN8E,359576
+sklearn/preprocessing/_csr_polynomial_expansion.pyx,sha256=vbTDWGOdzC6xb_AxTj-WeYWghXDO0RYqlxKx7V-N3uw,9154
+sklearn/preprocessing/_data.py,sha256=ElUECg65yZ9Yd11VzzT2dc9hU598Cg3Q1qNssfDaHhU,127903
+sklearn/preprocessing/_discretization.py,sha256=wN5OGmOv7ZMIVa_UtqGIbfe7mye3cz100R36IpVTQzk,20951
+sklearn/preprocessing/_encoders.py,sha256=GCrYWMY88owm1rMyJQAGwFKlAuSDdAtbI2o8jnST25c,68416
+sklearn/preprocessing/_function_transformer.py,sha256=CPbugGU8C9ee1DkB6s5PaEtqFUMb5skgMxOnFmhDrpk,16990
+sklearn/preprocessing/_label.py,sha256=90zXmJLk9cFQSka5K9-QZ6WM4iA2_dxtctBkXML1gD8,31271
+sklearn/preprocessing/_polynomial.py,sha256=JysoQGJRO-QPba9ahIUMvNPotzBGCsnI7iU11bxR8Ys,46303
+sklearn/preprocessing/_target_encoder.py,sha256=bmH3lffWPuc1JhurIGfWC4Y1pG4orwX5HF1Jjdh2yro,20612
+sklearn/preprocessing/_target_encoder_fast.cpython-310-x86_64-linux-gnu.so,sha256=5Ee2kcX8ptIAFA75FM75ltPeCJ2cemLCRa25IYuNxwI,456536
+sklearn/preprocessing/_target_encoder_fast.pyx,sha256=svYh2Yd1T1ursqdyVJmR8CUIKIbVV-AyIFHw9AAHJ4g,5941
+sklearn/preprocessing/meson.build,sha256=D5DfSN_SRseZ2iljBqU9IKnue8HeH-27TnVDTQY1uhU,357
+sklearn/preprocessing/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/preprocessing/tests/test_common.py,sha256=1gLqwBEMTpCJOMsftAwACox0d8wbqfB9z-JtRLlx9NM,6793
+sklearn/preprocessing/tests/test_data.py,sha256=vh5nbrVqCjfgJQNnaUzUanqhzeAZCZadqqQzznqdXhc,98518
+sklearn/preprocessing/tests/test_discretization.py,sha256=B6drMSsu7tEiQ6wwdZ0QxULFvPwu_tQAmVsEu-o_Vx8,21803
+sklearn/preprocessing/tests/test_encoders.py,sha256=U5K77uivcfbz8er4roPXvIkcaUumoUAaBgld0SpXrJc,79539
+sklearn/preprocessing/tests/test_function_transformer.py,sha256=xPDnZiJwQx7WNDTPsaw1p1zXijcGdIvIYUDYY4tCX-I,19272
+sklearn/preprocessing/tests/test_label.py,sha256=7aCITA2EprYNs0yC0RzXfcFlu7wvk3VEZZ6MIqvpyXU,25641
+sklearn/preprocessing/tests/test_polynomial.py,sha256=VwYFsVxt0tzhm-ptXdLAzIh10QNG40R1h3oV1E5BUAw,41236
+sklearn/preprocessing/tests/test_target_encoder.py,sha256=WADxAKbtWNAIIoP30C_uEC-kfTnYR2Hf1hL6qV1YlbE,27802
+sklearn/random_projection.py,sha256=-aCd6ZoTf6iRFkZhws-IEmt_P7OctlVn9gQQyTo6Sfk,28351
+sklearn/semi_supervised/__init__.py,sha256=Qkdt7JhsauqNEyletlbs7aU9RPxnpghyTw_WionXWC4,435
+sklearn/semi_supervised/_label_propagation.py,sha256=NBZSDxTeFPwGbt_j8rCLggiVU35pDZpgZs4kxLdUSpM,21448
+sklearn/semi_supervised/_self_training.py,sha256=wUXp_i3rvYLw1bMSa6M-1WjtvW9uImMn8sM9u1bPjJo,22014
+sklearn/semi_supervised/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/semi_supervised/tests/test_label_propagation.py,sha256=1dxD9IP2hGuUybuPkdMuJRFnoC1Dlz_Fti4_EJRpbxE,8801
+sklearn/semi_supervised/tests/test_self_training.py,sha256=9NxdemICSM3BO9Jw77PzhuY4iQXmv4Jzoa9_9YfEyMo,14428
+sklearn/svm/__init__.py,sha256=UKj8B0uoG71h0SR5mcFPTxPp84peaKEjf1QWQaUwwSA,454
+sklearn/svm/_base.py,sha256=LUZHaaTiHTAQ_3TLO0KQVDpj2j4yyCk4skCQ0-qsWmk,42956
+sklearn/svm/_bounds.py,sha256=_BV2163ys85SYXAFw4SoF80rkCpyERqd0d3L8jI4aW4,3459
+sklearn/svm/_classes.py,sha256=7dpD6qGKXhFiTIw1JvA7m_9ObxbQZUvyroLfy5uh36Y,66217
+sklearn/svm/_liblinear.cpython-310-x86_64-linux-gnu.so,sha256=V8hFxuxeU14npjjDZeGcqI-YFtgzSdtsciN1_BPEZmA,186840
+sklearn/svm/_liblinear.pxi,sha256=H5Li48ad7cS3z_jZu1lAJDByXVT9kA78pEVQ-AJCerI,1719
+sklearn/svm/_liblinear.pyx,sha256=_I3KvUevamU1X-7Ev21XNcdlfu8z1Jbd3IOEXcjUOwE,4101
+sklearn/svm/_libsvm.cpython-310-x86_64-linux-gnu.so,sha256=3gS53v5mbv2SX8wxdKHutfIMSgJG2k8u8mIuH8A4Vas,449200
+sklearn/svm/_libsvm.pxi,sha256=cV0nEGKq3yrtKsNxHpioX0MOmwO_4dURv9gR7Ci8TKM,3186
+sklearn/svm/_libsvm.pyx,sha256=xG6wFD9ciyARvXbOliyAm2KJK7WR4dskyq5DwbTMRhg,26669
+sklearn/svm/_libsvm_sparse.cpython-310-x86_64-linux-gnu.so,sha256=p6pN_i8KLB6O-Eg-Rm-fnFrK8DUxsF0sOimjRnkGYlw,380448
+sklearn/svm/_libsvm_sparse.pyx,sha256=tDSRkgykLtwTg5rZGGMezynJCeJeln950PL-D1zZ4kY,18886
+sklearn/svm/_newrand.cpython-310-x86_64-linux-gnu.so,sha256=1xyZRqmqk040vkWHxqPaCk12uSTuzOKrqX7vhuZ7b_s,56616
+sklearn/svm/_newrand.pyx,sha256=9Wgz24TrfT03OhvSrJ50LOq-6dznY73cXToi_seg0hg,298
+sklearn/svm/meson.build,sha256=yS7MPRrPJ5pxtVemPkGo7wNzNVfIVzivnmP_elfNd3M,1218
+sklearn/svm/src/liblinear/COPYRIGHT,sha256=NvBI21ZR3UUPA-UTAWt3A2zJmkSmay_c7PT2QYZX4OE,1486
+sklearn/svm/src/liblinear/_cython_blas_helpers.h,sha256=x7EL4uLM9u9v0iJmEaQDFJgXEhxM-3lWQ1ax-78gtlE,458
+sklearn/svm/src/liblinear/liblinear_helper.c,sha256=9rtFOnID6rSuKKkkj1kGLhPAqbA01-pYIB_14JtlREw,6380
+sklearn/svm/src/liblinear/linear.cpp,sha256=-eupquURUIdGa-8VKFJpvXNP2Fl-DpC8fhZLOI8t9IM,62634
+sklearn/svm/src/liblinear/linear.h,sha256=w70N_Hu8NaTsmxYTffXfOTgpbK1nbcpzVAiT1OOsiNs,2458
+sklearn/svm/src/liblinear/tron.cpp,sha256=meJe2MJ4b5dOutshAAxU1i9EKZ1lXYp4dXbiL_zgyP4,4940
+sklearn/svm/src/liblinear/tron.h,sha256=rX95I3vubCVFvoPaI8vE6jqdsWTOvq5GHx8FUcOiRFE,768
+sklearn/svm/src/libsvm/LIBSVM_CHANGES,sha256=n5OrHZ65A9CqDFxpGfph5_tWGAuiRhdBI0xAGWoYx9I,769
+sklearn/svm/src/libsvm/_svm_cython_blas_helpers.h,sha256=H25CeF4GM3FQq0B6u3cQp1FZGAiGlbOOhgFqn4RIAFk,217
+sklearn/svm/src/libsvm/libsvm_helper.c,sha256=fVUEDyWrrX65g3pstPpnxWdvWZlIsB4BoD4XCQ5gy-c,11718
+sklearn/svm/src/libsvm/libsvm_sparse_helper.c,sha256=fWKVM9H_TNNUcVhymn678X2PYCM4S1KrD6ArcRbdW1I,13247
+sklearn/svm/src/libsvm/libsvm_template.cpp,sha256=de-H2Nxv6VI2P8KXyAirKS8IAdtJYKfqPoDn3mMaIyM,173
+sklearn/svm/src/libsvm/svm.cpp,sha256=kOPTJGIi9eDqTR9xRZ_lu0KxL9fDW799-6inxngLu88,69105
+sklearn/svm/src/libsvm/svm.h,sha256=Vhf4LRfqLp7dE8swI2LmAKF3lf6ZOjC6L10k1IXJ96I,6262
+sklearn/svm/src/newrand/newrand.h,sha256=VGF__VxEdrYCRWeldvGF2AQfmb6DTH2bwR3QnsAmhQg,1840
+sklearn/svm/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/svm/tests/test_bounds.py,sha256=17Uej-UAlNFcsiVQRJVg7UQQY1mwXTNAS-pqIH2Sh5g,5488
+sklearn/svm/tests/test_sparse.py,sha256=7Uelip6jrKqyDj3BSio9RWeXzoIDR7Qts4bGB4Ljeok,15713
+sklearn/svm/tests/test_svm.py,sha256=i0DQrT_gyJWvtwzJpB3W7nLkiufJja7xROvWTN8otqc,49321
+sklearn/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/tests/metadata_routing_common.py,sha256=SRXRZEbTLYwnN7oEgRBPV7kpjESVwULuIOSj1gt6DcQ,20209
+sklearn/tests/test_base.py,sha256=VrVLt_AaDs8x11DdWZFpAeOWeOUvSEE5Kcx3stUBRIU,33694
+sklearn/tests/test_build.py,sha256=n9OrwEnrrozhLRaYwJNWYHrL65d7UHpmLbTDfVNtpmg,1181
+sklearn/tests/test_calibration.py,sha256=fkdT26HTVN4YMQtsrAUBJu_M0WPI3UKDFc64lnFsHYE,42703
+sklearn/tests/test_check_build.py,sha256=udkTjCgk_hJbkNmyyWxCZaf3-rfGCNudkHY_dH3lXj0,300
+sklearn/tests/test_common.py,sha256=Lc6qj8HJ1vOQ26ku2NbX2sPoaEaFemZApoxMq3z1-Wg,13255
+sklearn/tests/test_config.py,sha256=IOKEMY6L4Aq9Ykp90fjo7cuj9ReTWu7DQuEUeKTh4mI,5787
+sklearn/tests/test_discriminant_analysis.py,sha256=VaWug3CYu_OLTFrJ_AM1IALfWTjldYc03ntlpWzyfxo,22689
+sklearn/tests/test_docstring_parameters.py,sha256=zdFK0a9qLNGSePIx5T3CsF1iAjHDBSogOQpDiMY2iQc,11672
+sklearn/tests/test_docstring_parameters_consistency.py,sha256=MEG4Rut5qEKBgrkImKzRvr-iNEqZUO4iyG1SK9KYSIc,4171
+sklearn/tests/test_docstrings.py,sha256=t1zNwka5FH2Y1r5uweYuZwHR6RuicG5VJfdaK8YerNc,6853
+sklearn/tests/test_dummy.py,sha256=kSSm0v9b-rcoGR5fCETFmd2qYOoBcYSUyNZ1T4nYcdY,22085
+sklearn/tests/test_init.py,sha256=0cET-MRZ2v0MeHqLg9XqubgyWB03xsD3QmE-vBKF73A,476
+sklearn/tests/test_isotonic.py,sha256=YnhVVK8aTb5liVOKnzIy67aXw4Hk9GabGzuFd22zF9Y,22331
+sklearn/tests/test_kernel_approximation.py,sha256=h52dmpdAJyRzf_tVYYIAlu7Ac3gC8jv1_DDYw9E8U7E,16579
+sklearn/tests/test_kernel_ridge.py,sha256=qkwUUjuY5O1uMiXi9gAS-wXOCHa62F5T7VJnNdZdGOE,2888
+sklearn/tests/test_metadata_routing.py,sha256=nWWuf5wDbvi-r9ZyYHXUGLmMVhjm4UXqYeLN2Xbjnzo,40635
+sklearn/tests/test_metaestimators.py,sha256=6DVdtUKP7r5y3VafOX5SlaTimtxuT-OlQKYRLBD-HnE,11471
+sklearn/tests/test_metaestimators_metadata_routing.py,sha256=BKNAA6CAKly7n1CPHKdccZdRHcf2taSEubRtzdHTbls,32009
+sklearn/tests/test_min_dependencies_readme.py,sha256=BprXGDEgArPAoWLvBP8YPefv5vvKPzONzB1bSrRnzaE,4576
+sklearn/tests/test_multiclass.py,sha256=w2LmmymBo9K4ZyfFmMX27nvHIljeoaZlTi6WJUx-Pns,33934
+sklearn/tests/test_multioutput.py,sha256=3enAkYXMhvEFxC2zeyD_nZl5afjhF-eFtMRLwYYo93I,30553
+sklearn/tests/test_naive_bayes.py,sha256=SePTMoTagDqYQznjFrc01tIBTpMiWSK9MKvbdBnL9rg,35184
+sklearn/tests/test_pipeline.py,sha256=ZKOndIopvrdYgcHQ-Kxq7sODSgQfys8bMP2Ol3Ut7QA,80841
+sklearn/tests/test_public_functions.py,sha256=sCP84pcI2ok33NM2n8kllIDxxinIoDmffbjuj7cohN0,16738
+sklearn/tests/test_random_projection.py,sha256=PHgMtjxt5qvy6IM0YY6eWmNLelxdT2H4kF8BQbUBeRc,19583
+sklearn/tree/__init__.py,sha256=w6EhQ5jlcvPSer8w3GTWY0RPufTiCmp2IaRqhYYdmbY,572
+sklearn/tree/_classes.py,sha256=DygqR1NKHxRMECLn888NTnF7KX21HJ5kg1BwA4tIu9g,77648
+sklearn/tree/_criterion.cpython-310-x86_64-linux-gnu.so,sha256=HPNOrqLvfUSn0kl2JZrd3ULCZ3d07YRSgpDDCnhBhz8,213496
+sklearn/tree/_criterion.pxd,sha256=K_TRUrtxRiX_4Q_AltNDYtkhYLerlREjq9F14hcGJrs,4491
+sklearn/tree/_criterion.pyx,sha256=ujjfJAUnJ2y2rpHiJe5xumhuLC5S1eSqTyFmpyELN28,61626
+sklearn/tree/_export.py,sha256=Bnz5BYL-MXWgX9nYQYEzUQqWazLLFYwT8vRKTB2zWfQ,40733
+sklearn/tree/_partitioner.cpython-310-x86_64-linux-gnu.so,sha256=M_2p9x7OePRoMW7uNLbuApEON9OcQPlF_oThJBZdn7k,182352
+sklearn/tree/_partitioner.pxd,sha256=Wlf1kIFiFeykzrO1YYXOcGd_RZwnUTO4YXTwNCVfXNA,4939
+sklearn/tree/_partitioner.pyx,sha256=CvptDNtr-F7WkHuOk0PVN8USOAczQ-U9jbmG-oCIOhs,31975
+sklearn/tree/_reingold_tilford.py,sha256=ImilHGv15TI5inwyBar79zEy-V-TxD5A9NUk0sBM91A,5157
+sklearn/tree/_splitter.cpython-310-x86_64-linux-gnu.so,sha256=SD-zMrv1sP3sumZReN5S7SFo1Rv4FRHC5P-Dlwfe-Nw,157232
+sklearn/tree/_splitter.pxd,sha256=Yq0osi__MEU1QIJ_rz6Oq940Eu5srHBUMTQptnnWRUY,4436
+sklearn/tree/_splitter.pyx,sha256=Gj0B-hAU-TBKi90MRwZu9_WXy8v0lQonNoinb1QlauE,33411
+sklearn/tree/_tree.cpython-310-x86_64-linux-gnu.so,sha256=T3JI8QhNKc6Ty2OxROGs-Bjyj6nXMWgoc-nYcnHBshY,512600
+sklearn/tree/_tree.pxd,sha256=0z7WppVbOyb-1kOv0eKSO6iBrySonlhScaPjf_YWlsw,5431
+sklearn/tree/_tree.pyx,sha256=gKlP2sGFwwKXm3BS8kHoFXAMPhVczyLp3qFBX9G1rnM,73917
+sklearn/tree/_utils.cpython-310-x86_64-linux-gnu.so,sha256=mxd2bVVZTIhKbLpBZisNyKaL3QRd3nenqET3mwJz424,147576
+sklearn/tree/_utils.pxd,sha256=x-vTBBqxgTB-py3mJ8QQ3fqDfEeexkzsLnKbXcgk-Z4,3622
+sklearn/tree/_utils.pyx,sha256=k-viNXwSoiZ8Xe-S9BxyBVIWQW8nFuN6TInVpDJVCDA,16609
+sklearn/tree/meson.build,sha256=h_vVyJ3Uap4rs3v7OnDqMq8gV0bxOmsYYdCZAi_G1tE,899
+sklearn/tree/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/tree/tests/test_export.py,sha256=ClpF28hE3ZKLU90Q1ncPw6mlZO_Gv2BTlgThBo3AzqE,21026
+sklearn/tree/tests/test_monotonic_tree.py,sha256=-UtlxTxsTe-30KfK7KsfniieAN2Iks8Z6l23UTjKoz4,18612
+sklearn/tree/tests/test_reingold_tilford.py,sha256=xRt_Hlm-fGJ2onva4L9eL5mNdcHwWhPEppwNjP4VEJs,1461
+sklearn/tree/tests/test_tree.py,sha256=QIq_89dUB30m99D7XbS2EqhiU48sqDZd1_QUz_36Jh8,99442
+sklearn/utils/__init__.py,sha256=3Nz2hkOhi9RofSV3J-1KDnEfiXXIosfxhCLVlclJ5X0,2134
+sklearn/utils/_arpack.py,sha256=dB4rJYnuwSUXl73JoLISQbYHSXeco10y3gjNKGGEAig,1209
+sklearn/utils/_array_api.py,sha256=hJTLyn5kuMCwGD5-C5peyDEWR2jEY1lZUzNYc2En-6A,34748
+sklearn/utils/_available_if.py,sha256=CUJT-FoWEUiSCJ7BnfBFZ__74shIuMbHSBhQpwbVgnE,2945
+sklearn/utils/_bunch.py,sha256=_QRWzRU0TcO0Suv-mUFfuvuNrvP0Avp-PI0RY7uxdbA,2176
+sklearn/utils/_chunking.py,sha256=fpnjaJDWTLndUv4bHfIlt2gk0YmPYdArtYljwVA0KsM,5438
+sklearn/utils/_cython_blas.cpython-310-x86_64-linux-gnu.so,sha256=NNZq1v68T-6LvXO4h5g_9_hLGaySWtDTbhzOebp0u0c,353320
+sklearn/utils/_cython_blas.pxd,sha256=Kx-TV-Wy3JD8JAROmcAB3623tmk01WnffCiFLResUZI,1565
+sklearn/utils/_cython_blas.pyx,sha256=c9hEUrULMKXia5j3Ia88YDaJ7Lv4RGsqqxY6HIF9oQY,8282
+sklearn/utils/_encode.py,sha256=bptNb3r5s1VW1eI--TJM0S-feBJ9ozOceq9ju1DioWs,11797
+sklearn/utils/_estimator_html_repr.py,sha256=fgZ19z0W2bb51uWISQtaOUYxD2nvPx-EHgIuc4jHiO0,898
+sklearn/utils/_fast_dict.cpython-310-x86_64-linux-gnu.so,sha256=FRoBZdRHbZ1Tl7bQ7G67JW1U8huv9TTlCWgylo_zg0w,172864
+sklearn/utils/_fast_dict.pxd,sha256=IyPazoB2nBPCRf-TrfMqGDl9xQSM9QmnNx1nDUcSNCo,516
+sklearn/utils/_fast_dict.pyx,sha256=H4RiRkSLH3syEzlAR54xArEAWURDmp8U4S17Adxbf2s,4652
+sklearn/utils/_heap.cpython-310-x86_64-linux-gnu.so,sha256=wx-gD3OmEpUqpS73BQRh78Cc4L1spDs_Dv3iGodDzSw,23448
+sklearn/utils/_heap.pxd,sha256=FXcpp-JAYxvFGZqLZ6IrJieDZ9_W2hP4sVOLY4fzJAQ,256
+sklearn/utils/_heap.pyx,sha256=ca-rKqGzTbGz7X-HuLF9VzkZ3CfNEiIF2Bh7QjfZQ7s,2253
+sklearn/utils/_indexing.py,sha256=WpNkZhzQf0SQkNGDhZT0bum6BgxpWFmYciTWQQaYLcU,26366
+sklearn/utils/_isfinite.cpython-310-x86_64-linux-gnu.so,sha256=3YF16I2TB44Qkf2wAZbhrarMkUKpJjgrX64gGzZ7aCc,117888
+sklearn/utils/_isfinite.pyx,sha256=PFLLYo0BWaxpfNP6t0O6r0cLY9KXZSzHQmVYQKYbBtI,1414
+sklearn/utils/_mask.py,sha256=QoXi1rB6ZLp5GfOmv5jY47Wv2IS20-NS7bTt1Phz8Wc,4890
+sklearn/utils/_metadata_requests.py,sha256=ZJOYUDL-YjvElm1jLLwTKndWzIW1n_ri57TqUJqxiU0,58245
+sklearn/utils/_missing.py,sha256=SerUx-LWOIZFw3i6uxWQ9KkJX5n3BWZJZFt6lELH1TE,1479
+sklearn/utils/_mocking.py,sha256=J7wTGzJL364cLCYeIfxNxmtPYSvM_gKRAcJ7WqFvRvg,13661
+sklearn/utils/_openmp_helpers.cpython-310-x86_64-linux-gnu.so,sha256=9xf4yOXso0OblMdFXejezXmoZ8uSEUv4V-bejNds8vk,84625
+sklearn/utils/_openmp_helpers.pxd,sha256=ORtNXjPXDBOmoHW6--54wwrMEIZptCAZ6T8CJPCuJ-0,1069
+sklearn/utils/_openmp_helpers.pyx,sha256=6NgzGt7XMaLuzqqigYqJzERWbpvW-pDJ36L8OAVfdKw,3143
+sklearn/utils/_optional_dependencies.py,sha256=ppUWhMBeNGhVcPjZDqrmDOujWZ_qApndumj6OesynOA,1300
+sklearn/utils/_param_validation.py,sha256=H3vhAp9Cbn-7JuTGozS-MwGoOlEcd1fHKmP0oq0Z2UY,28578
+sklearn/utils/_plotting.py,sha256=Tu8t4k0EhWACBvsH5t0TlFOVdeJ4wI9PXub8ZLdyadQ,15370
+sklearn/utils/_pprint.py,sha256=QtAc-rPoco7xOuky6RLmMafpzPKsxud9LEgCGAEh9gg,18520
+sklearn/utils/_random.cpython-310-x86_64-linux-gnu.so,sha256=z6at-CVlRFXhYH8CeH6vfHpQsN7h-Tl9j2gHXbNgE9g,242720
+sklearn/utils/_random.pxd,sha256=_9sOwgmCxQ3rJCvVPplc7FJ-2iJgXZxeU3q8bo2oXXE,1250
+sklearn/utils/_random.pyx,sha256=H1plEnif12DxB2ZKB8H_mkC5WxXrPHpeFRbTLSxZQUI,12589
+sklearn/utils/_repr_html/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/utils/_repr_html/base.py,sha256=ZrLqweuvYizwi5HzCx8261BkyF7ot9iQ9Xf2zJcOx-o,6146
+sklearn/utils/_repr_html/estimator.css,sha256=cypIOeM_ga4IcYEXJfke90HNLJ1bHmhM-uUh52wQER4,11237
+sklearn/utils/_repr_html/estimator.js,sha256=TeUu7jCSDl2Af2v9C8I2qGOMw-LCHbh7ED2EMsyQaEs,1730
+sklearn/utils/_repr_html/estimator.py,sha256=N-c-YguOE554YmjZ5In6k0J6Bsz4HJkZmqyeaFNf844,18069
+sklearn/utils/_repr_html/params.css,sha256=kbxocqXiZSXRJB697838Kl3bTBJ3PiZC3lWU3ZGNXJY,1896
+sklearn/utils/_repr_html/params.py,sha256=pUWHGeI_EWfN3Wxum5HCOlevm_qOMuEdgiIBNbPjhvs,2651
+sklearn/utils/_repr_html/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/utils/_repr_html/tests/test_estimator.py,sha256=EuxDDZhcJDR_Wlawk4vFMsXPXlqS2XUvZI1oWZfdCr4,21420
+sklearn/utils/_repr_html/tests/test_params.py,sha256=qimQsD0wAD3249bS-_9nvMg8m-_u4igjzXeBvO5utw4,2356
+sklearn/utils/_response.py,sha256=_-mr2y7YAVXx_lrZ2Cz2RUj54LVC4BVhzQzL7Qy6fco,12117
+sklearn/utils/_seq_dataset.cpython-310-x86_64-linux-gnu.so,sha256=3s_DgK_Gub2n0Dc7wC2VbfZxeWIHexlN5LcOLaeeab4,226520
+sklearn/utils/_seq_dataset.pxd.tp,sha256=XWHP_pzN2o5rQkKSgnZWO_VMdASTPOQap35ebvWnRXw,2567
+sklearn/utils/_seq_dataset.pyx.tp,sha256=tkpcGPtSGLrAJxE4GGzXydoMvvn_6jWs4EKLUGEWio4,12252
+sklearn/utils/_set_output.py,sha256=l8xL8wklyS8hBdF-6HYry4m8HlSrRQiGe58JIja758A,14793
+sklearn/utils/_show_versions.py,sha256=GL9Ca3wwOStKVdOYIqTv2vRB5BWCTwiJTBiQSIaYEmI,2548
+sklearn/utils/_sorting.cpython-310-x86_64-linux-gnu.so,sha256=v1nrqxAs8iSskH23v4tGyba40AvhtIsfGrOv7pBqn_k,28120
+sklearn/utils/_sorting.pxd,sha256=i8Bkh1j07pgP6pIvzFxFIZ7uAlR1fQOCbIHh7v04xw8,161
+sklearn/utils/_sorting.pyx,sha256=Q-F_hwd8KFokcfaVXOswOWXVjdIjiQREoQRLaRxl9dY,3280
+sklearn/utils/_tags.py,sha256=B4xmNHIdYlVdrFI1n5ji1_qZYdVcr_SWcAX6Ck_ZNns,12283
+sklearn/utils/_test_common/__init__.py,sha256=vKm4xxqJIfK6Tk6By-YU03YcE6pR1X1juFrOsacfZjY,79
+sklearn/utils/_test_common/instance_generator.py,sha256=36b7kvFHnuBhRyUgb49OLNYfUaHKR0bhc2aP3Pw55m8,50205
+sklearn/utils/_testing.py,sha256=1m-_LOB2ml38qvcf1QQ1Xd2ArwwmP7RpXR3e0P7tC-c,50818
+sklearn/utils/_typedefs.cpython-310-x86_64-linux-gnu.so,sha256=mCtEJBe1lMNEsL1guapFcvqptUtYUIaYmHY3gWI86-Q,153240
+sklearn/utils/_typedefs.pxd,sha256=gew7YuCZWwpo-JWXGDIrwJ2-K_6mB-C4Ghd_Zu9Gd-o,2090
+sklearn/utils/_typedefs.pyx,sha256=rX9ZIRqg-XFgtM4L3Mh0YAsmRHSnccxdg2nEs9_2Zns,428
+sklearn/utils/_unique.py,sha256=IBhmM0fwGmuhcNjtSf_1-OryOx1plPOGwXVE4sndDyM,2972
+sklearn/utils/_user_interface.py,sha256=dzS5H5O6prEkNLholFgBLWOfFp4u0Mw61mDBQFh5KZ4,1485
+sklearn/utils/_vector_sentinel.cpython-310-x86_64-linux-gnu.so,sha256=iB_UTmbxZhWqIKeanSKEhxGsMleZDxzTIgFwQtfnT2g,166544
+sklearn/utils/_vector_sentinel.pxd,sha256=G_im5dT6DaREJgMAGu2MCd-tj5E-elc5mYX4sulSYW0,296
+sklearn/utils/_vector_sentinel.pyx,sha256=H1GeEQ7qOSSwgo55sNUaiWzVb1vbAqOr03hnfR-B-o8,4458
+sklearn/utils/_weight_vector.cpython-310-x86_64-linux-gnu.so,sha256=yaAmPriUpETldyQvjtucTxjL36jaMlaB5A1dsa2bCpk,93152
+sklearn/utils/_weight_vector.pxd.tp,sha256=VXw0bYJBkzy0rFFI_wfwPFZsAnfdykJz0W_svYGXiKM,1389
+sklearn/utils/_weight_vector.pyx.tp,sha256=8NR10zND_aAQt2iKtOXIGm7nu665cVsXoKmaZioWH1I,6901
+sklearn/utils/arrayfuncs.cpython-310-x86_64-linux-gnu.so,sha256=UfXpGRSzyhG7c0-RMc8kuPLhizSgzVJIsoDXjqY1bLA,188200
+sklearn/utils/arrayfuncs.pyx,sha256=vw-BXUbdkWBH6l5XAGRMPB0Ek8lRdFouVrVPjPD-iBg,2908
+sklearn/utils/class_weight.py,sha256=zcSNeTVb852HxMJlTUj86mbuWJdWA2dSMS-ft3ESYZM,8722
+sklearn/utils/deprecation.py,sha256=wi1BfyMwrwx1vdgSsw42Vser4aeKnKsDdlNh2OIrhY0,4374
+sklearn/utils/discovery.py,sha256=vQzoj_8YHjepxOlGT1YbF2C871mjkUuYbQRpM6Dho4s,8698
+sklearn/utils/estimator_checks.py,sha256=9el1g3Vc_qXy2Dmo6sUGlco4lv9NMHL8qwFx7vZbtm4,193210
+sklearn/utils/extmath.py,sha256=ZfCd1ARG9C2HP5Oss244N9rf7yawYz-hSIBsiPkFXPQ,48516
+sklearn/utils/fixes.py,sha256=6U_XXwI976vOFzT2MkxeuFbtkOnbtWmpNsqv-RvqSgY,15211
+sklearn/utils/graph.py,sha256=Jorg2G33rvJEC9ySKfQ30Siu_KGZ3VLARo8U9xAKxAc,5696
+sklearn/utils/meson.build,sha256=B12-imQSrpXZL81WVtFk7kGtjI6yZPIW4hzqYdH3Djs,2575
+sklearn/utils/metadata_routing.py,sha256=yOqxU3x6s2TAQ35XN9uTR8DLQtAucuXbzjrjlLIyxKY,578
+sklearn/utils/metaestimators.py,sha256=OvXMa6tex9Gog2wzaHZqoMd1DYHEp02-Ubrz2czXWyE,5827
+sklearn/utils/multiclass.py,sha256=pAwNDXiul4QCW6UJP1MJGNLgsM8JBNo7vDtVpidihQE,20391
+sklearn/utils/murmurhash.cpython-310-x86_64-linux-gnu.so,sha256=uJdpVAqIXgqcKw9Nsy7_9J39rToAKxy-mcjri1zhRlM,138952
+sklearn/utils/murmurhash.pxd,sha256=Z8mj3dEhTQN1MdzvlHA7jS9lA6fjkqYFK1YTeVwC10o,876
+sklearn/utils/murmurhash.pyx,sha256=bRyDiVMurmKHJW32MNMqzmEA9Mj-eNR6zBoj5C6M4MU,4530
+sklearn/utils/optimize.py,sha256=GX3H4bzCVBZ1Fv6eUcgvU2d7zx-xBclNMRFCcqLuWn8,12298
+sklearn/utils/parallel.py,sha256=0f3yUjH024aVyf6zauOj1vhOmwlibQs7CFQUJCkoa00,6082
+sklearn/utils/random.py,sha256=8fAjBUbjcuhHypUwQ7X7GB7D-k-Y-RfhhOiZyQ182Sg,3683
+sklearn/utils/sparsefuncs.py,sha256=msAts1ikks1NEGG1EvTZhcp2VfIEsEEh3rkPAYlgLLo,22598
+sklearn/utils/sparsefuncs_fast.cpython-310-x86_64-linux-gnu.so,sha256=eInKQheiyUv5a4dDH8hI-j7pOGiOxZloCf2HhyBXMe0,765624
+sklearn/utils/sparsefuncs_fast.pyx,sha256=XcHvxCBHTlxwhn4kZX5FSrOl36ziouVbBJDhKpN5KtA,21795
+sklearn/utils/src/MurmurHash3.cpp,sha256=5BI_ft6ZWDOlbpDI-U1MM-bvqH5G2ssGgfLJWD5bozU,7968
+sklearn/utils/src/MurmurHash3.h,sha256=vX2iW09b4laQOwIwXSiTu14wfdkowndTzKgDAmHQPi4,1155
+sklearn/utils/stats.py,sha256=B7SSDY9D-KSUd9AdmsjIVtr5zWulMypyLmj7m9pLgqs,5035
+sklearn/utils/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
+sklearn/utils/tests/test_arpack.py,sha256=EL3_6a1iDpl8Q-0A8iv6YrwycX0zBwWsL_6cEm3i6lo,490
+sklearn/utils/tests/test_array_api.py,sha256=X079ez3xRzqPQ-6RhM0nJjVWhm8z-nu6ZtZASHBotGA,21062
+sklearn/utils/tests/test_arrayfuncs.py,sha256=DGbK5ejSO-_ibZDoeM5RlDNY7a8Z8eGScnq3cThQ1Js,1326
+sklearn/utils/tests/test_bunch.py,sha256=QZXKwtgneO2wcnnrbMVM_QNfVlVec8eLw0JYtL_ExMI,813
+sklearn/utils/tests/test_chunking.py,sha256=4ygjiWbrLWxqgYYKPZ2aHKRzJ93MD32kEajbgIO0C6s,2371
+sklearn/utils/tests/test_class_weight.py,sha256=K-vCvXz5GlqOl1h6QdPXRGs-svR82ql2fD6ndzPhsXI,12957
+sklearn/utils/tests/test_cython_blas.py,sha256=COhzY-WHwQLIF5qn_XvBPggWn9OfMw7J2IOLV63MKaw,6709
+sklearn/utils/tests/test_deprecation.py,sha256=BRp5wLhsGtSdDt1cWwF72kqqsqbNDvggGs_kETP0g0U,2294
+sklearn/utils/tests/test_encode.py,sha256=QiiG0ArBGF7ENYrvcgPGwjYgUdn3W6Ch_GE9VEF2DWI,9603
+sklearn/utils/tests/test_estimator_checks.py,sha256=_5OzYdijgENQQfL_zDN8TTntCCjXVq-MLtwqGnvHOhI,58138
+sklearn/utils/tests/test_estimator_html_repr.py,sha256=YeI-j1_CkTR82HpHi4vZflc9zshWQRBx_PT9qiWz_6Y,614
+sklearn/utils/tests/test_extmath.py,sha256=6lQ03gV-8CD0-02tJU7eVz4ORNgi00WfxDuHDhj2D1Q,39056
+sklearn/utils/tests/test_fast_dict.py,sha256=Y4wCGUJ4Wb1SkePK4HJsqQa3iL9rTqsbByU2X3P8KQY,1355
+sklearn/utils/tests/test_fixes.py,sha256=8w_0PiyUlBq1EebvaCMJdttuCFStZykRYGQ7sTCdzPs,5328
+sklearn/utils/tests/test_graph.py,sha256=0FGOXawAnpEg2wYW5PEkJsLmIlz1zVTIgFP5IJqdXpc,3047
+sklearn/utils/tests/test_indexing.py,sha256=P5ulIjFw0gkoHFRGSORlhCFt6_y7EbvcdHTNHOuM-jM,23721
+sklearn/utils/tests/test_mask.py,sha256=eEsLP_o7OqGGFt5Kj9vnobvHw4sNaVFzHCuE4rlyEd4,537
+sklearn/utils/tests/test_metaestimators.py,sha256=x_0agW4puaVCmqPwBrk3FrWIZeK3qgM9eNJWUxYD640,2107
+sklearn/utils/tests/test_missing.py,sha256=3lPgYdyvRkzPH-Bw82N282i_5_aYN7hHK-bkoPBw_Jg,709
+sklearn/utils/tests/test_mocking.py,sha256=S0W07EnpATWo5sy1V-FAoPpyhRT1DHOveb9PyXa7ibQ,5898
+sklearn/utils/tests/test_multiclass.py,sha256=h0GSlMbftD2sVtel14MDHd38u_7tVMGHI9uRJN8kIk4,22059
+sklearn/utils/tests/test_murmurhash.py,sha256=b-WKvPEJmp8XiIjGVDv_c_6mGOL-nz9XOvMFNXPpXeA,2516
+sklearn/utils/tests/test_optimize.py,sha256=FWWUjF2yJ_zIn41UCmik8iTKMeww7mp16Djq1UhPFKs,7603
+sklearn/utils/tests/test_parallel.py,sha256=ldqH6MqBTZCM6EIjHySSzlx3wRwWD0_cdV4DzQwpKcQ,5665
+sklearn/utils/tests/test_param_validation.py,sha256=fApmDQ01VznF_uaA4bKch0IqHHfBMLxAa1VMa_c7su4,24407
+sklearn/utils/tests/test_plotting.py,sha256=UWU43kvMkBbNoYJUAqDdgSHwINeiPxv3dnWc37PGy7E,19938
+sklearn/utils/tests/test_pprint.py,sha256=Bg9Sv8uNPfM3bDtWrIeahnXacdyGSjliIecPyHCqmTc,27858
+sklearn/utils/tests/test_random.py,sha256=wzhfCP5lhSm-5PaCvbcgqvsnuINkvJNVSanQZiRmc0s,7149
+sklearn/utils/tests/test_response.py,sha256=JW7hWzu3l8_c0GNU3AHxbPynknD7zaqXuvbGPLsFHEI,14142
+sklearn/utils/tests/test_seq_dataset.py,sha256=Nr1MGuCWVEM6T7OWPKDUxss7XzAaX1qFZwjN5KC_sFU,5868
+sklearn/utils/tests/test_set_output.py,sha256=sPtTyGoAsIXO4IkT6TYhSgXPeQu_Qt-kZ9gxErWeeos,16131
+sklearn/utils/tests/test_shortest_path.py,sha256=XN1SF7TfMo8tQCC-bUV2wK99jR32hEM7xZOl54NbIoQ,1846
+sklearn/utils/tests/test_show_versions.py,sha256=eMzrmzaMs6TO7JSMSfSokfAVW_daMms-7Xel5XyqKZc,1001
+sklearn/utils/tests/test_sparsefuncs.py,sha256=mnmWRDHuvKHT-rgkHoC48edn-sAguWAYzA-OfplR_4w,34943
+sklearn/utils/tests/test_stats.py,sha256=r1kIVHmemK0scdg_1M93HQXEjFCn3Lv9GkC6xj5-D7M,12576
+sklearn/utils/tests/test_tags.py,sha256=oQf8mu-ooCy2EZUiYsJer6se4BTwS93mx4IepysvU6A,4644
+sklearn/utils/tests/test_testing.py,sha256=LdQzf2249lqmo48vHNcNnFeQCt6PL-V09iLWTiRR1bQ,33119
+sklearn/utils/tests/test_typedefs.py,sha256=gc_bm54uF15dtX5rz0Cmw4OQQhscTHACRhjdkEkMx8o,735
+sklearn/utils/tests/test_unique.py,sha256=UMMRUrDYiTzxcf49N_ddIWWyvSySFBTzrPK7JY94fGU,1820
+sklearn/utils/tests/test_user_interface.py,sha256=Pn0bUwodt-TCy7f2KdYFOXQZ-2c2BI98rhpXTpCW4uE,1772
+sklearn/utils/tests/test_validation.py,sha256=95Bo4XIy3w4fGMLK7obcs73vWMFHwVj8aGYT3Hf0qd0,80550
+sklearn/utils/tests/test_weight_vector.py,sha256=eay4_mfrN7vg2ZGoXmZ06cU9CLQYBJKMR_dK6s2Wyic,665
+sklearn/utils/validation.py,sha256=rjyXLmReLQugBFno-CrFQPCmcPR0zCk4dalfTWPwzMI,108488
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/REQUESTED b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/REQUESTED
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/WHEEL b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/WHEEL
new file mode 100644
index 0000000000000000000000000000000000000000..4e4c38ae320920b8f083b87f408214cdecd350d2
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/WHEEL
@@ -0,0 +1,6 @@
+Wheel-Version: 1.0
+Generator: meson
+Root-Is-Purelib: false
+Tag: cp310-cp310-manylinux_2_17_x86_64
+Tag: cp310-cp310-manylinux2014_x86_64
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/licenses/COPYING b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/licenses/COPYING
new file mode 100644
index 0000000000000000000000000000000000000000..f2fc85ebc240fbc4201e5dbec01401bad114cf8c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scikit_learn-1.7.1.dist-info/licenses/COPYING
@@ -0,0 +1,112 @@
+BSD 3-Clause License
+
+Copyright (c) 2007-2024 The scikit-learn developers.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the name of the copyright holder nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+----
+
+This binary distribution of scikit-learn also bundles the following software:
+
+----
+
+Name: GCC runtime library
+Files: scikit_learn.libs/libgomp*.so*
+Availability: https://gcc.gnu.org/git/?p=gcc.git;a=tree;f=libgomp
+
+GCC RUNTIME LIBRARY EXCEPTION
+
+Version 3.1, 31 March 2009
+
+Copyright (C) 2009 Free Software Foundation, Inc.
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+This GCC Runtime Library Exception ("Exception") is an additional
+permission under section 7 of the GNU General Public License, version
+3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
+bears a notice placed by the copyright holder of the file stating that
+the file is governed by GPLv3 along with this Exception.
+
+When you use GCC to compile a program, GCC may combine portions of
+certain GCC header files and runtime libraries with the compiled
+program. The purpose of this Exception is to allow compilation of
+non-GPL (including proprietary) programs to use, in this way, the
+header files and runtime libraries covered by this Exception.
+
+0. Definitions.
+
+A file is an "Independent Module" if it either requires the Runtime
+Library for execution after a Compilation Process, or makes use of an
+interface provided by the Runtime Library, but is not otherwise based
+on the Runtime Library.
+
+"GCC" means a version of the GNU Compiler Collection, with or without
+modifications, governed by version 3 (or a specified later version) of
+the GNU General Public License (GPL) with the option of using any
+subsequent versions published by the FSF.
+
+"GPL-compatible Software" is software whose conditions of propagation,
+modification and use would permit combination with GCC in accord with
+the license of GCC.
+
+"Target Code" refers to output from any compiler for a real or virtual
+target processor architecture, in executable form or suitable for
+input to an assembler, loader, linker and/or execution
+phase. Notwithstanding that, Target Code does not include data in any
+format that is used as a compiler intermediate representation, or used
+for producing a compiler intermediate representation.
+
+The "Compilation Process" transforms code entirely represented in
+non-intermediate languages designed for human-written code, and/or in
+Java Virtual Machine byte code, into Target Code. Thus, for example,
+use of source code generators and preprocessors need not be considered
+part of the Compilation Process, since the Compilation Process can be
+understood as starting with the output of the generators or
+preprocessors.
+
+A Compilation Process is "Eligible" if it is done using GCC, alone or
+with other GPL-compatible software, or if it is done without using any
+work based on GCC. For example, using non-GPL-compatible Software to
+optimize any GCC intermediate representations would not qualify as an
+Eligible Compilation Process.
+
+1. Grant of Additional Permission.
+
+You have permission to propagate a work of Target Code formed by
+combining the Runtime Library with Independent Modules, even if such
+propagation would otherwise violate the terms of GPLv3, provided that
+all Target Code was generated by Eligible Compilation Processes. You
+may then convey such a combination under terms of your choice,
+consistent with the licensing of the Independent Modules.
+
+2. No Weakening of GCC Copyleft.
+
+The availability of this Exception does not imply any general
+presumption that third-party software is unaffected by the copyleft
+requirements of the license of GCC.
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/__config__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/__config__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..692be4fc8d5e476b33defdc34d24654a1b46fb75
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/__config__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..36e8a38020ac367efbe28ee95bf42f9d828e09f1
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/_distributor_init.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/_distributor_init.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f2df7bffe35e3362470930c7141d6d9b22b9f714
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/_distributor_init.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/version.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/version.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e5959375350b19c39672a7520301d4183cf9c562
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/__pycache__/version.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..a44a8c133b674aea416efeb4da469241b50a547f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/__init__.py
@@ -0,0 +1,131 @@
+"""
+=================================================
+Orthogonal distance regression (:mod:`scipy.odr`)
+=================================================
+
+.. currentmodule:: scipy.odr
+
+Package Content
+===============
+
+.. autosummary::
+ :toctree: generated/
+
+ Data -- The data to fit.
+ RealData -- Data with weights as actual std. dev.s and/or covariances.
+ Model -- Stores information about the function to be fit.
+ ODR -- Gathers all info & manages the main fitting routine.
+ Output -- Result from the fit.
+ odr -- Low-level function for ODR.
+
+ OdrWarning -- Warning about potential problems when running ODR.
+ OdrError -- Error exception.
+ OdrStop -- Stop exception.
+
+ polynomial -- Factory function for a general polynomial model.
+ exponential -- Exponential model
+ multilinear -- Arbitrary-dimensional linear model
+ unilinear -- Univariate linear model
+ quadratic -- Quadratic model
+
+Usage information
+=================
+
+Introduction
+------------
+
+Why Orthogonal Distance Regression (ODR)? Sometimes one has
+measurement errors in the explanatory (a.k.a., "independent")
+variable(s), not just the response (a.k.a., "dependent") variable(s).
+Ordinary Least Squares (OLS) fitting procedures treat the data for
+explanatory variables as fixed, i.e., not subject to error of any kind.
+Furthermore, OLS procedures require that the response variables be an
+explicit function of the explanatory variables; sometimes making the
+equation explicit is impractical and/or introduces errors. ODR can
+handle both of these cases with ease, and can even reduce to the OLS
+case if that is sufficient for the problem.
+
+ODRPACK is a FORTRAN-77 library for performing ODR with possibly
+non-linear fitting functions. It uses a modified trust-region
+Levenberg-Marquardt-type algorithm [1]_ to estimate the function
+parameters. The fitting functions are provided by Python functions
+operating on NumPy arrays. The required derivatives may be provided
+by Python functions as well, or may be estimated numerically. ODRPACK
+can do explicit or implicit ODR fits, or it can do OLS. Input and
+output variables may be multidimensional. Weights can be provided to
+account for different variances of the observations, and even
+covariances between dimensions of the variables.
+
+The `scipy.odr` package offers an object-oriented interface to
+ODRPACK, in addition to the low-level `odr` function.
+
+Additional background information about ODRPACK can be found in the
+`ODRPACK User's Guide
+`_, reading
+which is recommended.
+
+Basic usage
+-----------
+
+1. Define the function you want to fit against.::
+
+ def f(B, x):
+ '''Linear function y = m*x + b'''
+ # B is a vector of the parameters.
+ # x is an array of the current x values.
+ # x is in the same format as the x passed to Data or RealData.
+ #
+ # Return an array in the same format as y passed to Data or RealData.
+ return B[0]*x + B[1]
+
+2. Create a Model.::
+
+ linear = Model(f)
+
+3. Create a Data or RealData instance.::
+
+ mydata = Data(x, y, wd=1./power(sx,2), we=1./power(sy,2))
+
+ or, when the actual covariances are known::
+
+ mydata = RealData(x, y, sx=sx, sy=sy)
+
+4. Instantiate ODR with your data, model and initial parameter estimate.::
+
+ myodr = ODR(mydata, linear, beta0=[1., 2.])
+
+5. Run the fit.::
+
+ myoutput = myodr.run()
+
+6. Examine output.::
+
+ myoutput.pprint()
+
+
+References
+----------
+.. [1] P. T. Boggs and J. E. Rogers, "Orthogonal Distance Regression,"
+ in "Statistical analysis of measurement error models and
+ applications: proceedings of the AMS-IMS-SIAM joint summer research
+ conference held June 10-16, 1989," Contemporary Mathematics,
+ vol. 112, pg. 186, 1990.
+
+"""
+# version: 0.7
+# author: Robert Kern
+# date: 2006-09-21
+
+from ._odrpack import *
+from ._models import *
+from . import _add_newdocs
+
+# Deprecated namespaces, to be removed in v2.0.0
+from . import models, odrpack
+
+__all__ = [s for s in dir()
+ if not (s.startswith('_') or s in ('odr_stop', 'odr_error'))]
+
+from scipy._lib._testutils import PytestTester
+test = PytestTester(__name__)
+del PytestTester
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_add_newdocs.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_add_newdocs.py
new file mode 100644
index 0000000000000000000000000000000000000000..e09fb6cc8c5f1523dfbeaef466a5b76bd22c01bb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_add_newdocs.py
@@ -0,0 +1,34 @@
+from numpy.lib import add_newdoc
+
+add_newdoc('scipy.odr', 'odr',
+ """
+ odr(fcn, beta0, y, x, we=None, wd=None, fjacb=None, fjacd=None, extra_args=None,
+ ifixx=None, ifixb=None, job=0, iprint=0, errfile=None, rptfile=None, ndigit=0,
+ taufac=0.0, sstol=-1.0, partol=-1.0, maxit=-1, stpb=None, stpd=None, sclb=None,
+ scld=None, work=None, iwork=None, full_output=0)
+
+ Low-level function for ODR.
+
+ See Also
+ --------
+ ODR : The ODR class gathers all information and coordinates the running of the
+ main fitting routine.
+ Model : The Model class stores information about the function you wish to fit.
+ Data : The data to fit.
+ RealData : Data with weights as actual std. dev.s and/or covariances.
+
+ Notes
+ -----
+ This is a function performing the same operation as the `ODR`,
+ `Model`, and `Data` classes together. The parameters of this
+ function are explained in the class documentation.
+
+ """)
+
+add_newdoc('scipy.odr.__odrpack', '_set_exceptions',
+ """
+ _set_exceptions(odr_error, odr_stop)
+
+ Internal function: set exception classes.
+
+ """)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_models.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_models.py
new file mode 100644
index 0000000000000000000000000000000000000000..e0a8d2275dcc4698a9ea61be5871d62069be2599
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_models.py
@@ -0,0 +1,315 @@
+""" Collection of Model instances for use with the odrpack fitting package.
+"""
+import numpy as np
+from scipy.odr._odrpack import Model
+
+__all__ = ['Model', 'exponential', 'multilinear', 'unilinear', 'quadratic',
+ 'polynomial']
+
+
+def _lin_fcn(B, x):
+ a, b = B[0], B[1:]
+ b.shape = (b.shape[0], 1)
+
+ return a + (x*b).sum(axis=0)
+
+
+def _lin_fjb(B, x):
+ a = np.ones(x.shape[-1], float)
+ res = np.concatenate((a, x.ravel()))
+ res.shape = (B.shape[-1], x.shape[-1])
+ return res
+
+
+def _lin_fjd(B, x):
+ b = B[1:]
+ b = np.repeat(b, (x.shape[-1],)*b.shape[-1], axis=0)
+ b.shape = x.shape
+ return b
+
+
+def _lin_est(data):
+ # Eh. The answer is analytical, so just return all ones.
+ # Don't return zeros since that will interfere with
+ # ODRPACK's auto-scaling procedures.
+
+ if len(data.x.shape) == 2:
+ m = data.x.shape[0]
+ else:
+ m = 1
+
+ return np.ones((m + 1,), float)
+
+
+def _poly_fcn(B, x, powers):
+ a, b = B[0], B[1:]
+ b.shape = (b.shape[0], 1)
+
+ return a + np.sum(b * np.power(x, powers), axis=0)
+
+
+def _poly_fjacb(B, x, powers):
+ res = np.concatenate((np.ones(x.shape[-1], float),
+ np.power(x, powers).flat))
+ res.shape = (B.shape[-1], x.shape[-1])
+ return res
+
+
+def _poly_fjacd(B, x, powers):
+ b = B[1:]
+ b.shape = (b.shape[0], 1)
+
+ b = b * powers
+
+ return np.sum(b * np.power(x, powers-1), axis=0)
+
+
+def _exp_fcn(B, x):
+ return B[0] + np.exp(B[1] * x)
+
+
+def _exp_fjd(B, x):
+ return B[1] * np.exp(B[1] * x)
+
+
+def _exp_fjb(B, x):
+ res = np.concatenate((np.ones(x.shape[-1], float), x * np.exp(B[1] * x)))
+ res.shape = (2, x.shape[-1])
+ return res
+
+
+def _exp_est(data):
+ # Eh.
+ return np.array([1., 1.])
+
+
+class _MultilinearModel(Model):
+ r"""
+ Arbitrary-dimensional linear model
+
+ This model is defined by :math:`y=\beta_0 + \sum_{i=1}^m \beta_i x_i`
+
+ Examples
+ --------
+ We can calculate orthogonal distance regression with an arbitrary
+ dimensional linear model:
+
+ >>> from scipy import odr
+ >>> import numpy as np
+ >>> x = np.linspace(0.0, 5.0)
+ >>> y = 10.0 + 5.0 * x
+ >>> data = odr.Data(x, y)
+ >>> odr_obj = odr.ODR(data, odr.multilinear)
+ >>> output = odr_obj.run()
+ >>> print(output.beta)
+ [10. 5.]
+
+ """
+
+ def __init__(self):
+ super().__init__(
+ _lin_fcn, fjacb=_lin_fjb, fjacd=_lin_fjd, estimate=_lin_est,
+ meta={'name': 'Arbitrary-dimensional Linear',
+ 'equ': 'y = B_0 + Sum[i=1..m, B_i * x_i]',
+ 'TeXequ': r'$y=\beta_0 + \sum_{i=1}^m \beta_i x_i$'})
+
+
+multilinear = _MultilinearModel()
+
+
+def polynomial(order):
+ """
+ Factory function for a general polynomial model.
+
+ Parameters
+ ----------
+ order : int or sequence
+ If an integer, it becomes the order of the polynomial to fit. If
+ a sequence of numbers, then these are the explicit powers in the
+ polynomial.
+ A constant term (power 0) is always included, so don't include 0.
+ Thus, polynomial(n) is equivalent to polynomial(range(1, n+1)).
+
+ Returns
+ -------
+ polynomial : Model instance
+ Model instance.
+
+ Examples
+ --------
+ We can fit an input data using orthogonal distance regression (ODR) with
+ a polynomial model:
+
+ >>> import numpy as np
+ >>> import matplotlib.pyplot as plt
+ >>> from scipy import odr
+ >>> x = np.linspace(0.0, 5.0)
+ >>> y = np.sin(x)
+ >>> poly_model = odr.polynomial(3) # using third order polynomial model
+ >>> data = odr.Data(x, y)
+ >>> odr_obj = odr.ODR(data, poly_model)
+ >>> output = odr_obj.run() # running ODR fitting
+ >>> poly = np.poly1d(output.beta[::-1])
+ >>> poly_y = poly(x)
+ >>> plt.plot(x, y, label="input data")
+ >>> plt.plot(x, poly_y, label="polynomial ODR")
+ >>> plt.legend()
+ >>> plt.show()
+
+ """
+
+ powers = np.asarray(order)
+ if powers.shape == ():
+ # Scalar.
+ powers = np.arange(1, powers + 1)
+
+ powers.shape = (len(powers), 1)
+ len_beta = len(powers) + 1
+
+ def _poly_est(data, len_beta=len_beta):
+ # Eh. Ignore data and return all ones.
+ return np.ones((len_beta,), float)
+
+ return Model(_poly_fcn, fjacd=_poly_fjacd, fjacb=_poly_fjacb,
+ estimate=_poly_est, extra_args=(powers,),
+ meta={'name': 'Sorta-general Polynomial',
+ 'equ': 'y = B_0 + Sum[i=1..%s, B_i * (x**i)]' % (len_beta-1),
+ 'TeXequ': r'$y=\beta_0 + \sum_{i=1}^{%s} \beta_i x^i$' %
+ (len_beta-1)})
+
+
+class _ExponentialModel(Model):
+ r"""
+ Exponential model
+
+ This model is defined by :math:`y=\beta_0 + e^{\beta_1 x}`
+
+ Examples
+ --------
+ We can calculate orthogonal distance regression with an exponential model:
+
+ >>> from scipy import odr
+ >>> import numpy as np
+ >>> x = np.linspace(0.0, 5.0)
+ >>> y = -10.0 + np.exp(0.5*x)
+ >>> data = odr.Data(x, y)
+ >>> odr_obj = odr.ODR(data, odr.exponential)
+ >>> output = odr_obj.run()
+ >>> print(output.beta)
+ [-10. 0.5]
+
+ """
+
+ def __init__(self):
+ super().__init__(_exp_fcn, fjacd=_exp_fjd, fjacb=_exp_fjb,
+ estimate=_exp_est,
+ meta={'name': 'Exponential',
+ 'equ': 'y= B_0 + exp(B_1 * x)',
+ 'TeXequ': r'$y=\beta_0 + e^{\beta_1 x}$'})
+
+
+exponential = _ExponentialModel()
+
+
+def _unilin(B, x):
+ return x*B[0] + B[1]
+
+
+def _unilin_fjd(B, x):
+ return np.ones(x.shape, float) * B[0]
+
+
+def _unilin_fjb(B, x):
+ _ret = np.concatenate((x, np.ones(x.shape, float)))
+ _ret.shape = (2,) + x.shape
+
+ return _ret
+
+
+def _unilin_est(data):
+ return (1., 1.)
+
+
+def _quadratic(B, x):
+ return x*(x*B[0] + B[1]) + B[2]
+
+
+def _quad_fjd(B, x):
+ return 2*x*B[0] + B[1]
+
+
+def _quad_fjb(B, x):
+ _ret = np.concatenate((x*x, x, np.ones(x.shape, float)))
+ _ret.shape = (3,) + x.shape
+
+ return _ret
+
+
+def _quad_est(data):
+ return (1.,1.,1.)
+
+
+class _UnilinearModel(Model):
+ r"""
+ Univariate linear model
+
+ This model is defined by :math:`y = \beta_0 x + \beta_1`
+
+ Examples
+ --------
+ We can calculate orthogonal distance regression with an unilinear model:
+
+ >>> from scipy import odr
+ >>> import numpy as np
+ >>> x = np.linspace(0.0, 5.0)
+ >>> y = 1.0 * x + 2.0
+ >>> data = odr.Data(x, y)
+ >>> odr_obj = odr.ODR(data, odr.unilinear)
+ >>> output = odr_obj.run()
+ >>> print(output.beta)
+ [1. 2.]
+
+ """
+
+ def __init__(self):
+ super().__init__(_unilin, fjacd=_unilin_fjd, fjacb=_unilin_fjb,
+ estimate=_unilin_est,
+ meta={'name': 'Univariate Linear',
+ 'equ': 'y = B_0 * x + B_1',
+ 'TeXequ': '$y = \\beta_0 x + \\beta_1$'})
+
+
+unilinear = _UnilinearModel()
+
+
+class _QuadraticModel(Model):
+ r"""
+ Quadratic model
+
+ This model is defined by :math:`y = \beta_0 x^2 + \beta_1 x + \beta_2`
+
+ Examples
+ --------
+ We can calculate orthogonal distance regression with a quadratic model:
+
+ >>> from scipy import odr
+ >>> import numpy as np
+ >>> x = np.linspace(0.0, 5.0)
+ >>> y = 1.0 * x ** 2 + 2.0 * x + 3.0
+ >>> data = odr.Data(x, y)
+ >>> odr_obj = odr.ODR(data, odr.quadratic)
+ >>> output = odr_obj.run()
+ >>> print(output.beta)
+ [1. 2. 3.]
+
+ """
+
+ def __init__(self):
+ super().__init__(
+ _quadratic, fjacd=_quad_fjd, fjacb=_quad_fjb, estimate=_quad_est,
+ meta={'name': 'Quadratic',
+ 'equ': 'y = B_0*x**2 + B_1*x + B_2',
+ 'TeXequ': '$y = \\beta_0 x^2 + \\beta_1 x + \\beta_2'})
+
+
+quadratic = _QuadraticModel()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_odrpack.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_odrpack.py
new file mode 100644
index 0000000000000000000000000000000000000000..30d46aa3f4465f31b32e5f13f0b01b940981d489
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/_odrpack.py
@@ -0,0 +1,1154 @@
+"""
+Python wrappers for Orthogonal Distance Regression (ODRPACK).
+
+Notes
+=====
+
+* Array formats -- FORTRAN stores its arrays in memory column first, i.e., an
+ array element A(i, j, k) will be next to A(i+1, j, k). In C and, consequently,
+ NumPy, arrays are stored row first: A[i, j, k] is next to A[i, j, k+1]. For
+ efficiency and convenience, the input and output arrays of the fitting
+ function (and its Jacobians) are passed to FORTRAN without transposition.
+ Therefore, where the ODRPACK documentation says that the X array is of shape
+ (N, M), it will be passed to the Python function as an array of shape (M, N).
+ If M==1, the 1-D case, then nothing matters; if M>1, then your
+ Python functions will be dealing with arrays that are indexed in reverse of
+ the ODRPACK documentation. No real issue, but watch out for your indexing of
+ the Jacobians: the i,jth elements (@f_i/@x_j) evaluated at the nth
+ observation will be returned as jacd[j, i, n]. Except for the Jacobians, it
+ really is easier to deal with x[0] and x[1] than x[:,0] and x[:,1]. Of course,
+ you can always use the transpose() function from SciPy explicitly.
+
+* Examples -- See the accompanying file test/test.py for examples of how to set
+ up fits of your own. Some are taken from the User's Guide; some are from
+ other sources.
+
+* Models -- Some common models are instantiated in the accompanying module
+ models.py . Contributions are welcome.
+
+Credits
+=======
+
+* Thanks to Arnold Moene and Gerard Vermeulen for fixing some killer bugs.
+
+Robert Kern
+robert.kern@gmail.com
+
+"""
+import os
+from threading import Lock
+
+import numpy as np
+from warnings import warn
+from scipy.odr import __odrpack
+
+__all__ = ['odr', 'OdrWarning', 'OdrError', 'OdrStop',
+ 'Data', 'RealData', 'Model', 'Output', 'ODR',
+ 'odr_error', 'odr_stop']
+
+odr = __odrpack.odr
+ODR_LOCK = Lock()
+
+
+class OdrWarning(UserWarning):
+ """
+ Warning indicating that the data passed into
+ ODR will cause problems when passed into 'odr'
+ that the user should be aware of.
+ """
+ pass
+
+
+class OdrError(Exception):
+ """
+ Exception indicating an error in fitting.
+
+ This is raised by `~scipy.odr.odr` if an error occurs during fitting.
+ """
+ pass
+
+
+class OdrStop(Exception):
+ """
+ Exception stopping fitting.
+
+ You can raise this exception in your objective function to tell
+ `~scipy.odr.odr` to stop fitting.
+ """
+ pass
+
+
+# Backwards compatibility
+odr_error = OdrError
+odr_stop = OdrStop
+
+__odrpack._set_exceptions(OdrError, OdrStop)
+
+
+def _conv(obj, dtype=None):
+ """ Convert an object to the preferred form for input to the odr routine.
+ """
+
+ if obj is None:
+ return obj
+ else:
+ if dtype is None:
+ obj = np.asarray(obj)
+ else:
+ obj = np.asarray(obj, dtype)
+ if obj.shape == ():
+ # Scalar.
+ return obj.dtype.type(obj)
+ else:
+ return obj
+
+
+def _report_error(info):
+ """ Interprets the return code of the odr routine.
+
+ Parameters
+ ----------
+ info : int
+ The return code of the odr routine.
+
+ Returns
+ -------
+ problems : list(str)
+ A list of messages about why the odr() routine stopped.
+ """
+
+ stopreason = ('Blank',
+ 'Sum of squares convergence',
+ 'Parameter convergence',
+ 'Both sum of squares and parameter convergence',
+ 'Iteration limit reached')[info % 5]
+
+ if info >= 5:
+ # questionable results or fatal error
+
+ I = (info//10000 % 10,
+ info//1000 % 10,
+ info//100 % 10,
+ info//10 % 10,
+ info % 10)
+ problems = []
+
+ if I[0] == 0:
+ if I[1] != 0:
+ problems.append('Derivatives possibly not correct')
+ if I[2] != 0:
+ problems.append('Error occurred in callback')
+ if I[3] != 0:
+ problems.append('Problem is not full rank at solution')
+ problems.append(stopreason)
+ elif I[0] == 1:
+ if I[1] != 0:
+ problems.append('N < 1')
+ if I[2] != 0:
+ problems.append('M < 1')
+ if I[3] != 0:
+ problems.append('NP < 1 or NP > N')
+ if I[4] != 0:
+ problems.append('NQ < 1')
+ elif I[0] == 2:
+ if I[1] != 0:
+ problems.append('LDY and/or LDX incorrect')
+ if I[2] != 0:
+ problems.append('LDWE, LD2WE, LDWD, and/or LD2WD incorrect')
+ if I[3] != 0:
+ problems.append('LDIFX, LDSTPD, and/or LDSCLD incorrect')
+ if I[4] != 0:
+ problems.append('LWORK and/or LIWORK too small')
+ elif I[0] == 3:
+ if I[1] != 0:
+ problems.append('STPB and/or STPD incorrect')
+ if I[2] != 0:
+ problems.append('SCLB and/or SCLD incorrect')
+ if I[3] != 0:
+ problems.append('WE incorrect')
+ if I[4] != 0:
+ problems.append('WD incorrect')
+ elif I[0] == 4:
+ problems.append('Error in derivatives')
+ elif I[0] == 5:
+ problems.append('Error occurred in callback')
+ elif I[0] == 6:
+ problems.append('Numerical error detected')
+
+ return problems
+
+ else:
+ return [stopreason]
+
+
+class Data:
+ """
+ The data to fit.
+
+ Parameters
+ ----------
+ x : array_like
+ Observed data for the independent variable of the regression
+ y : array_like, optional
+ If array-like, observed data for the dependent variable of the
+ regression. A scalar input implies that the model to be used on
+ the data is implicit.
+ we : array_like, optional
+ If `we` is a scalar, then that value is used for all data points (and
+ all dimensions of the response variable).
+ If `we` is a rank-1 array of length q (the dimensionality of the
+ response variable), then this vector is the diagonal of the covariant
+ weighting matrix for all data points.
+ If `we` is a rank-1 array of length n (the number of data points), then
+ the i'th element is the weight for the i'th response variable
+ observation (single-dimensional only).
+ If `we` is a rank-2 array of shape (q, q), then this is the full
+ covariant weighting matrix broadcast to each observation.
+ If `we` is a rank-2 array of shape (q, n), then `we[:,i]` is the
+ diagonal of the covariant weighting matrix for the i'th observation.
+ If `we` is a rank-3 array of shape (q, q, n), then `we[:,:,i]` is the
+ full specification of the covariant weighting matrix for each
+ observation.
+ If the fit is implicit, then only a positive scalar value is used.
+ wd : array_like, optional
+ If `wd` is a scalar, then that value is used for all data points
+ (and all dimensions of the input variable). If `wd` = 0, then the
+ covariant weighting matrix for each observation is set to the identity
+ matrix (so each dimension of each observation has the same weight).
+ If `wd` is a rank-1 array of length m (the dimensionality of the input
+ variable), then this vector is the diagonal of the covariant weighting
+ matrix for all data points.
+ If `wd` is a rank-1 array of length n (the number of data points), then
+ the i'th element is the weight for the ith input variable observation
+ (single-dimensional only).
+ If `wd` is a rank-2 array of shape (m, m), then this is the full
+ covariant weighting matrix broadcast to each observation.
+ If `wd` is a rank-2 array of shape (m, n), then `wd[:,i]` is the
+ diagonal of the covariant weighting matrix for the ith observation.
+ If `wd` is a rank-3 array of shape (m, m, n), then `wd[:,:,i]` is the
+ full specification of the covariant weighting matrix for each
+ observation.
+ fix : array_like of ints, optional
+ The `fix` argument is the same as ifixx in the class ODR. It is an
+ array of integers with the same shape as data.x that determines which
+ input observations are treated as fixed. One can use a sequence of
+ length m (the dimensionality of the input observations) to fix some
+ dimensions for all observations. A value of 0 fixes the observation,
+ a value > 0 makes it free.
+ meta : dict, optional
+ Free-form dictionary for metadata.
+
+ Notes
+ -----
+ Each argument is attached to the member of the instance of the same name.
+ The structures of `x` and `y` are described in the Model class docstring.
+ If `y` is an integer, then the Data instance can only be used to fit with
+ implicit models where the dimensionality of the response is equal to the
+ specified value of `y`.
+
+ The `we` argument weights the effect a deviation in the response variable
+ has on the fit. The `wd` argument weights the effect a deviation in the
+ input variable has on the fit. To handle multidimensional inputs and
+ responses easily, the structure of these arguments has the n'th
+ dimensional axis first. These arguments heavily use the structured
+ arguments feature of ODRPACK to conveniently and flexibly support all
+ options. See the ODRPACK User's Guide for a full explanation of how these
+ weights are used in the algorithm. Basically, a higher value of the weight
+ for a particular data point makes a deviation at that point more
+ detrimental to the fit.
+
+ """
+
+ def __init__(self, x, y=None, we=None, wd=None, fix=None, meta=None):
+ self.x = _conv(x)
+
+ if not isinstance(self.x, np.ndarray):
+ raise ValueError("Expected an 'ndarray' of data for 'x', "
+ f"but instead got data of type '{type(self.x).__name__}'")
+
+ self.y = _conv(y)
+ self.we = _conv(we)
+ self.wd = _conv(wd)
+ self.fix = _conv(fix)
+ self.meta = {} if meta is None else meta
+
+ def set_meta(self, **kwds):
+ """ Update the metadata dictionary with the keywords and data provided
+ by keywords.
+
+ Examples
+ --------
+ ::
+
+ data.set_meta(lab="Ph 7; Lab 26", title="Ag110 + Ag108 Decay")
+ """
+
+ self.meta.update(kwds)
+
+ def __getattr__(self, attr):
+ """ Dispatch attribute access to the metadata dictionary.
+ """
+ if attr != "meta" and attr in self.meta:
+ return self.meta[attr]
+ else:
+ raise AttributeError(f"'{attr}' not in metadata")
+
+
+class RealData(Data):
+ """
+ The data, with weightings as actual standard deviations and/or
+ covariances.
+
+ Parameters
+ ----------
+ x : array_like
+ Observed data for the independent variable of the regression
+ y : array_like, optional
+ If array-like, observed data for the dependent variable of the
+ regression. A scalar input implies that the model to be used on
+ the data is implicit.
+ sx : array_like, optional
+ Standard deviations of `x`.
+ `sx` are standard deviations of `x` and are converted to weights by
+ dividing 1.0 by their squares.
+ sy : array_like, optional
+ Standard deviations of `y`.
+ `sy` are standard deviations of `y` and are converted to weights by
+ dividing 1.0 by their squares.
+ covx : array_like, optional
+ Covariance of `x`
+ `covx` is an array of covariance matrices of `x` and are converted to
+ weights by performing a matrix inversion on each observation's
+ covariance matrix.
+ covy : array_like, optional
+ Covariance of `y`
+ `covy` is an array of covariance matrices and are converted to
+ weights by performing a matrix inversion on each observation's
+ covariance matrix.
+ fix : array_like, optional
+ The argument and member fix is the same as Data.fix and ODR.ifixx:
+ It is an array of integers with the same shape as `x` that
+ determines which input observations are treated as fixed. One can
+ use a sequence of length m (the dimensionality of the input
+ observations) to fix some dimensions for all observations. A value
+ of 0 fixes the observation, a value > 0 makes it free.
+ meta : dict, optional
+ Free-form dictionary for metadata.
+
+ Notes
+ -----
+ The weights `wd` and `we` are computed from provided values as follows:
+
+ `sx` and `sy` are converted to weights by dividing 1.0 by their squares.
+ For example, ``wd = 1./np.power(`sx`, 2)``.
+
+ `covx` and `covy` are arrays of covariance matrices and are converted to
+ weights by performing a matrix inversion on each observation's covariance
+ matrix. For example, ``we[i] = np.linalg.inv(covy[i])``.
+
+ These arguments follow the same structured argument conventions as wd and
+ we only restricted by their natures: `sx` and `sy` can't be rank-3, but
+ `covx` and `covy` can be.
+
+ Only set *either* `sx` or `covx` (not both). Setting both will raise an
+ exception. Same with `sy` and `covy`.
+
+ """
+
+ def __init__(self, x, y=None, sx=None, sy=None, covx=None, covy=None,
+ fix=None, meta=None):
+ if (sx is not None) and (covx is not None):
+ raise ValueError("cannot set both sx and covx")
+ if (sy is not None) and (covy is not None):
+ raise ValueError("cannot set both sy and covy")
+
+ # Set flags for __getattr__
+ self._ga_flags = {}
+ if sx is not None:
+ self._ga_flags['wd'] = 'sx'
+ else:
+ self._ga_flags['wd'] = 'covx'
+ if sy is not None:
+ self._ga_flags['we'] = 'sy'
+ else:
+ self._ga_flags['we'] = 'covy'
+
+ self.x = _conv(x)
+
+ if not isinstance(self.x, np.ndarray):
+ raise ValueError("Expected an 'ndarray' of data for 'x', "
+ f"but instead got data of type '{type(self.x).__name__}'")
+
+ self.y = _conv(y)
+ self.sx = _conv(sx)
+ self.sy = _conv(sy)
+ self.covx = _conv(covx)
+ self.covy = _conv(covy)
+ self.fix = _conv(fix)
+ self.meta = {} if meta is None else meta
+
+ def _sd2wt(self, sd):
+ """ Convert standard deviation to weights.
+ """
+
+ return 1./np.power(sd, 2)
+
+ def _cov2wt(self, cov):
+ """ Convert covariance matrix(-ices) to weights.
+ """
+
+ from scipy.linalg import inv
+
+ if len(cov.shape) == 2:
+ return inv(cov)
+ else:
+ weights = np.zeros(cov.shape, float)
+
+ for i in range(cov.shape[-1]): # n
+ weights[:,:,i] = inv(cov[:,:,i])
+
+ return weights
+
+ def __getattr__(self, attr):
+
+ if attr not in ('wd', 'we'):
+ if attr != "meta" and attr in self.meta:
+ return self.meta[attr]
+ else:
+ raise AttributeError(f"'{attr}' not in metadata")
+ else:
+ lookup_tbl = {('wd', 'sx'): (self._sd2wt, self.sx),
+ ('wd', 'covx'): (self._cov2wt, self.covx),
+ ('we', 'sy'): (self._sd2wt, self.sy),
+ ('we', 'covy'): (self._cov2wt, self.covy)}
+
+ func, arg = lookup_tbl[(attr, self._ga_flags[attr])]
+
+ if arg is not None:
+ return func(*(arg,))
+ else:
+ return None
+
+
+class Model:
+ """
+ The Model class stores information about the function you wish to fit.
+
+ It stores the function itself, at the least, and optionally stores
+ functions which compute the Jacobians used during fitting. Also, one
+ can provide a function that will provide reasonable starting values
+ for the fit parameters possibly given the set of data.
+
+ Parameters
+ ----------
+ fcn : function
+ fcn(beta, x) --> y
+ fjacb : function
+ Jacobian of fcn wrt the fit parameters beta.
+
+ fjacb(beta, x) --> @f_i(x,B)/@B_j
+ fjacd : function
+ Jacobian of fcn wrt the (possibly multidimensional) input
+ variable.
+
+ fjacd(beta, x) --> @f_i(x,B)/@x_j
+ extra_args : tuple, optional
+ If specified, `extra_args` should be a tuple of extra
+ arguments to pass to `fcn`, `fjacb`, and `fjacd`. Each will be called
+ by `apply(fcn, (beta, x) + extra_args)`
+ estimate : array_like of rank-1
+ Provides estimates of the fit parameters from the data
+
+ estimate(data) --> estbeta
+ implicit : boolean
+ If TRUE, specifies that the model
+ is implicit; i.e `fcn(beta, x)` ~= 0 and there is no y data to fit
+ against
+ meta : dict, optional
+ freeform dictionary of metadata for the model
+
+ Notes
+ -----
+ Note that the `fcn`, `fjacb`, and `fjacd` operate on NumPy arrays and
+ return a NumPy array. The `estimate` object takes an instance of the
+ Data class.
+
+ Here are the rules for the shapes of the argument and return
+ arrays of the callback functions:
+
+ `x`
+ if the input data is single-dimensional, then `x` is rank-1
+ array; i.e., ``x = array([1, 2, 3, ...]); x.shape = (n,)``
+ If the input data is multi-dimensional, then `x` is a rank-2 array;
+ i.e., ``x = array([[1, 2, ...], [2, 4, ...]]); x.shape = (m, n)``.
+ In all cases, it has the same shape as the input data array passed to
+ `~scipy.odr.odr`. `m` is the dimensionality of the input data,
+ `n` is the number of observations.
+ `y`
+ if the response variable is single-dimensional, then `y` is a
+ rank-1 array, i.e., ``y = array([2, 4, ...]); y.shape = (n,)``.
+ If the response variable is multi-dimensional, then `y` is a rank-2
+ array, i.e., ``y = array([[2, 4, ...], [3, 6, ...]]); y.shape =
+ (q, n)`` where `q` is the dimensionality of the response variable.
+ `beta`
+ rank-1 array of length `p` where `p` is the number of parameters;
+ i.e. ``beta = array([B_1, B_2, ..., B_p])``
+ `fjacb`
+ if the response variable is multi-dimensional, then the
+ return array's shape is ``(q, p, n)`` such that ``fjacb(x,beta)[l,k,i] =
+ d f_l(X,B)/d B_k`` evaluated at the ith data point. If ``q == 1``, then
+ the return array is only rank-2 and with shape ``(p, n)``.
+ `fjacd`
+ as with fjacb, only the return array's shape is ``(q, m, n)``
+ such that ``fjacd(x,beta)[l,j,i] = d f_l(X,B)/d X_j`` at the ith data
+ point. If ``q == 1``, then the return array's shape is ``(m, n)``. If
+ ``m == 1``, the shape is (q, n). If `m == q == 1`, the shape is ``(n,)``.
+
+ """
+
+ def __init__(self, fcn, fjacb=None, fjacd=None,
+ extra_args=None, estimate=None, implicit=0, meta=None):
+
+ self.fcn = fcn
+ self.fjacb = fjacb
+ self.fjacd = fjacd
+
+ if extra_args is not None:
+ extra_args = tuple(extra_args)
+
+ self.extra_args = extra_args
+ self.estimate = estimate
+ self.implicit = implicit
+ self.meta = meta if meta is not None else {}
+
+ def set_meta(self, **kwds):
+ """ Update the metadata dictionary with the keywords and data provided
+ here.
+
+ Examples
+ --------
+ set_meta(name="Exponential", equation="y = a exp(b x) + c")
+ """
+
+ self.meta.update(kwds)
+
+ def __getattr__(self, attr):
+ """ Dispatch attribute access to the metadata.
+ """
+
+ if attr != "meta" and attr in self.meta:
+ return self.meta[attr]
+ else:
+ raise AttributeError(f"'{attr}' not in metadata")
+
+
+class Output:
+ """
+ The Output class stores the output of an ODR run.
+
+ Attributes
+ ----------
+ beta : ndarray
+ Estimated parameter values, of shape (q,).
+ sd_beta : ndarray
+ Standard deviations of the estimated parameters, of shape (p,).
+ cov_beta : ndarray
+ Covariance matrix of the estimated parameters, of shape (p,p).
+ Note that this `cov_beta` is not scaled by the residual variance
+ `res_var`, whereas `sd_beta` is. This means
+ ``np.sqrt(np.diag(output.cov_beta * output.res_var))`` is the same
+ result as `output.sd_beta`.
+ delta : ndarray, optional
+ Array of estimated errors in input variables, of same shape as `x`.
+ eps : ndarray, optional
+ Array of estimated errors in response variables, of same shape as `y`.
+ xplus : ndarray, optional
+ Array of ``x + delta``.
+ y : ndarray, optional
+ Array ``y = fcn(x + delta)``.
+ res_var : float, optional
+ Residual variance.
+ sum_square : float, optional
+ Sum of squares error.
+ sum_square_delta : float, optional
+ Sum of squares of delta error.
+ sum_square_eps : float, optional
+ Sum of squares of eps error.
+ inv_condnum : float, optional
+ Inverse condition number (cf. ODRPACK UG p. 77).
+ rel_error : float, optional
+ Relative error in function values computed within fcn.
+ work : ndarray, optional
+ Final work array.
+ work_ind : dict, optional
+ Indices into work for drawing out values (cf. ODRPACK UG p. 83).
+ info : int, optional
+ Reason for returning, as output by ODRPACK (cf. ODRPACK UG p. 38).
+ stopreason : list of str, optional
+ `info` interpreted into English.
+
+ Notes
+ -----
+ Takes one argument for initialization, the return value from the
+ function `~scipy.odr.odr`. The attributes listed as "optional" above are
+ only present if `~scipy.odr.odr` was run with ``full_output=1``.
+
+ """
+
+ def __init__(self, output):
+ self.beta = output[0]
+ self.sd_beta = output[1]
+ self.cov_beta = output[2]
+
+ if len(output) == 4:
+ # full output
+ self.__dict__.update(output[3])
+ self.stopreason = _report_error(self.info)
+
+ def pprint(self):
+ """ Pretty-print important results.
+ """
+
+ print('Beta:', self.beta)
+ print('Beta Std Error:', self.sd_beta)
+ print('Beta Covariance:', self.cov_beta)
+ if hasattr(self, 'info'):
+ print('Residual Variance:',self.res_var)
+ print('Inverse Condition #:', self.inv_condnum)
+ print('Reason(s) for Halting:')
+ for r in self.stopreason:
+ print(f' {r}')
+
+
+class ODR:
+ """
+ The ODR class gathers all information and coordinates the running of the
+ main fitting routine.
+
+ Members of instances of the ODR class have the same names as the arguments
+ to the initialization routine.
+
+ Parameters
+ ----------
+ data : Data class instance
+ instance of the Data class
+ model : Model class instance
+ instance of the Model class
+
+ Other Parameters
+ ----------------
+ beta0 : array_like of rank-1
+ a rank-1 sequence of initial parameter values. Optional if
+ model provides an "estimate" function to estimate these values.
+ delta0 : array_like of floats of rank-1, optional
+ a (double-precision) float array to hold the initial values of
+ the errors in the input variables. Must be same shape as data.x
+ ifixb : array_like of ints of rank-1, optional
+ sequence of integers with the same length as beta0 that determines
+ which parameters are held fixed. A value of 0 fixes the parameter,
+ a value > 0 makes the parameter free.
+ ifixx : array_like of ints with same shape as data.x, optional
+ an array of integers with the same shape as data.x that determines
+ which input observations are treated as fixed. One can use a sequence
+ of length m (the dimensionality of the input observations) to fix some
+ dimensions for all observations. A value of 0 fixes the observation,
+ a value > 0 makes it free.
+ job : int, optional
+ an integer telling ODRPACK what tasks to perform. See p. 31 of the
+ ODRPACK User's Guide if you absolutely must set the value here. Use the
+ method set_job post-initialization for a more readable interface.
+ iprint : int, optional
+ an integer telling ODRPACK what to print. See pp. 33-34 of the
+ ODRPACK User's Guide if you absolutely must set the value here. Use the
+ method set_iprint post-initialization for a more readable interface.
+ errfile : str, optional
+ string with the filename to print ODRPACK errors to. If the file already
+ exists, an error will be thrown. The `overwrite` argument can be used to
+ prevent this. *Do Not Open This File Yourself!*
+ rptfile : str, optional
+ string with the filename to print ODRPACK summaries to. If the file
+ already exists, an error will be thrown. The `overwrite` argument can be
+ used to prevent this. *Do Not Open This File Yourself!*
+ ndigit : int, optional
+ integer specifying the number of reliable digits in the computation
+ of the function.
+ taufac : float, optional
+ float specifying the initial trust region. The default value is 1.
+ The initial trust region is equal to taufac times the length of the
+ first computed Gauss-Newton step. taufac must be less than 1.
+ sstol : float, optional
+ float specifying the tolerance for convergence based on the relative
+ change in the sum-of-squares. The default value is eps**(1/2) where eps
+ is the smallest value such that 1 + eps > 1 for double precision
+ computation on the machine. sstol must be less than 1.
+ partol : float, optional
+ float specifying the tolerance for convergence based on the relative
+ change in the estimated parameters. The default value is eps**(2/3) for
+ explicit models and ``eps**(1/3)`` for implicit models. partol must be less
+ than 1.
+ maxit : int, optional
+ integer specifying the maximum number of iterations to perform. For
+ first runs, maxit is the total number of iterations performed and
+ defaults to 50. For restarts, maxit is the number of additional
+ iterations to perform and defaults to 10.
+ stpb : array_like, optional
+ sequence (``len(stpb) == len(beta0)``) of relative step sizes to compute
+ finite difference derivatives wrt the parameters.
+ stpd : optional
+ array (``stpd.shape == data.x.shape`` or ``stpd.shape == (m,)``) of relative
+ step sizes to compute finite difference derivatives wrt the input
+ variable errors. If stpd is a rank-1 array with length m (the
+ dimensionality of the input variable), then the values are broadcast to
+ all observations.
+ sclb : array_like, optional
+ sequence (``len(stpb) == len(beta0)``) of scaling factors for the
+ parameters. The purpose of these scaling factors are to scale all of
+ the parameters to around unity. Normally appropriate scaling factors
+ are computed if this argument is not specified. Specify them yourself
+ if the automatic procedure goes awry.
+ scld : array_like, optional
+ array (scld.shape == data.x.shape or scld.shape == (m,)) of scaling
+ factors for the *errors* in the input variables. Again, these factors
+ are automatically computed if you do not provide them. If scld.shape ==
+ (m,), then the scaling factors are broadcast to all observations.
+ work : ndarray, optional
+ array to hold the double-valued working data for ODRPACK. When
+ restarting, takes the value of self.output.work.
+ iwork : ndarray, optional
+ array to hold the integer-valued working data for ODRPACK. When
+ restarting, takes the value of self.output.iwork.
+ overwrite : bool, optional
+ If it is True, output files defined by `errfile` and `rptfile` are
+ overwritten. The default is False.
+
+ Attributes
+ ----------
+ data : Data
+ The data for this fit
+ model : Model
+ The model used in fit
+ output : Output
+ An instance if the Output class containing all of the returned
+ data from an invocation of ODR.run() or ODR.restart()
+
+ """
+
+ def __init__(self, data, model, beta0=None, delta0=None, ifixb=None,
+ ifixx=None, job=None, iprint=None, errfile=None, rptfile=None,
+ ndigit=None, taufac=None, sstol=None, partol=None, maxit=None,
+ stpb=None, stpd=None, sclb=None, scld=None, work=None, iwork=None,
+ overwrite=False):
+
+ self.data = data
+ self.model = model
+
+ if beta0 is None:
+ if self.model.estimate is not None:
+ self.beta0 = _conv(self.model.estimate(self.data))
+ else:
+ raise ValueError(
+ "must specify beta0 or provide an estimator with the model"
+ )
+ else:
+ self.beta0 = _conv(beta0)
+
+ if ifixx is None and data.fix is not None:
+ ifixx = data.fix
+
+ if overwrite:
+ # remove output files for overwriting.
+ if rptfile is not None and os.path.exists(rptfile):
+ os.remove(rptfile)
+ if errfile is not None and os.path.exists(errfile):
+ os.remove(errfile)
+
+ self.delta0 = _conv(delta0)
+ # These really are 32-bit integers in FORTRAN (gfortran), even on 64-bit
+ # platforms.
+ # XXX: some other FORTRAN compilers may not agree.
+ self.ifixx = _conv(ifixx, dtype=np.int32)
+ self.ifixb = _conv(ifixb, dtype=np.int32)
+ self.job = job
+ self.iprint = iprint
+ self.errfile = errfile
+ self.rptfile = rptfile
+ self.ndigit = ndigit
+ self.taufac = taufac
+ self.sstol = sstol
+ self.partol = partol
+ self.maxit = maxit
+ self.stpb = _conv(stpb)
+ self.stpd = _conv(stpd)
+ self.sclb = _conv(sclb)
+ self.scld = _conv(scld)
+ self.work = _conv(work)
+ self.iwork = _conv(iwork)
+
+ self.output = None
+
+ self._check()
+
+ def _check(self):
+ """ Check the inputs for consistency, but don't bother checking things
+ that the builtin function odr will check.
+ """
+
+ x_s = list(self.data.x.shape)
+
+ if isinstance(self.data.y, np.ndarray):
+ y_s = list(self.data.y.shape)
+ if self.model.implicit:
+ raise OdrError("an implicit model cannot use response data")
+ else:
+ # implicit model with q == self.data.y
+ y_s = [self.data.y, x_s[-1]]
+ if not self.model.implicit:
+ raise OdrError("an explicit model needs response data")
+ self.set_job(fit_type=1)
+
+ if x_s[-1] != y_s[-1]:
+ raise OdrError("number of observations do not match")
+
+ n = x_s[-1]
+
+ if len(x_s) == 2:
+ m = x_s[0]
+ else:
+ m = 1
+ if len(y_s) == 2:
+ q = y_s[0]
+ else:
+ q = 1
+
+ p = len(self.beta0)
+
+ # permissible output array shapes
+
+ fcn_perms = [(q, n)]
+ fjacd_perms = [(q, m, n)]
+ fjacb_perms = [(q, p, n)]
+
+ if q == 1:
+ fcn_perms.append((n,))
+ fjacd_perms.append((m, n))
+ fjacb_perms.append((p, n))
+ if m == 1:
+ fjacd_perms.append((q, n))
+ if p == 1:
+ fjacb_perms.append((q, n))
+ if m == q == 1:
+ fjacd_perms.append((n,))
+ if p == q == 1:
+ fjacb_perms.append((n,))
+
+ # try evaluating the supplied functions to make sure they provide
+ # sensible outputs
+
+ arglist = (self.beta0, self.data.x)
+ if self.model.extra_args is not None:
+ arglist = arglist + self.model.extra_args
+ res = self.model.fcn(*arglist)
+
+ if res.shape not in fcn_perms:
+ print(res.shape)
+ print(fcn_perms)
+ raise OdrError(f"fcn does not output {y_s}-shaped array")
+
+ if self.model.fjacd is not None:
+ res = self.model.fjacd(*arglist)
+ if res.shape not in fjacd_perms:
+ raise OdrError(
+ f"fjacd does not output {repr((q, m, n))}-shaped array")
+ if self.model.fjacb is not None:
+ res = self.model.fjacb(*arglist)
+ if res.shape not in fjacb_perms:
+ raise OdrError(
+ f"fjacb does not output {repr((q, p, n))}-shaped array")
+
+ # check shape of delta0
+
+ if self.delta0 is not None and self.delta0.shape != self.data.x.shape:
+ raise OdrError(
+ f"delta0 is not a {repr(self.data.x.shape)}-shaped array")
+
+ if self.data.x.size == 0:
+ warn("Empty data detected for ODR instance. "
+ "Do not expect any fitting to occur",
+ OdrWarning, stacklevel=3)
+
+ def _gen_work(self):
+ """ Generate a suitable work array if one does not already exist.
+ """
+
+ n = self.data.x.shape[-1]
+ p = self.beta0.shape[0]
+
+ if len(self.data.x.shape) == 2:
+ m = self.data.x.shape[0]
+ else:
+ m = 1
+
+ if self.model.implicit:
+ q = self.data.y
+ elif len(self.data.y.shape) == 2:
+ q = self.data.y.shape[0]
+ else:
+ q = 1
+
+ if self.data.we is None:
+ ldwe = ld2we = 1
+ elif len(self.data.we.shape) == 3:
+ ld2we, ldwe = self.data.we.shape[1:]
+ else:
+ we = self.data.we
+ ldwe = 1
+ ld2we = 1
+ if we.ndim == 1 and q == 1:
+ ldwe = n
+ elif we.ndim == 2:
+ if we.shape == (q, q):
+ ld2we = q
+ elif we.shape == (q, n):
+ ldwe = n
+
+ if self.job % 10 < 2:
+ # ODR not OLS
+ lwork = (18 + 11*p + p*p + m + m*m + 4*n*q + 6*n*m + 2*n*q*p +
+ 2*n*q*m + q*q + 5*q + q*(p+m) + ldwe*ld2we*q)
+ else:
+ # OLS not ODR
+ lwork = (18 + 11*p + p*p + m + m*m + 4*n*q + 2*n*m + 2*n*q*p +
+ 5*q + q*(p+m) + ldwe*ld2we*q)
+
+ if isinstance(self.work, np.ndarray) and self.work.shape == (lwork,)\
+ and self.work.dtype.str.endswith('f8'):
+ # the existing array is fine
+ return
+ else:
+ self.work = np.zeros((lwork,), float)
+
+ def set_job(self, fit_type=None, deriv=None, var_calc=None,
+ del_init=None, restart=None):
+ """
+ Sets the "job" parameter is a hopefully comprehensible way.
+
+ If an argument is not specified, then the value is left as is. The
+ default value from class initialization is for all of these options set
+ to 0.
+
+ Parameters
+ ----------
+ fit_type : {0, 1, 2} int
+ 0 -> explicit ODR
+
+ 1 -> implicit ODR
+
+ 2 -> ordinary least-squares
+ deriv : {0, 1, 2, 3} int
+ 0 -> forward finite differences
+
+ 1 -> central finite differences
+
+ 2 -> user-supplied derivatives (Jacobians) with results
+ checked by ODRPACK
+
+ 3 -> user-supplied derivatives, no checking
+ var_calc : {0, 1, 2} int
+ 0 -> calculate asymptotic covariance matrix and fit
+ parameter uncertainties (V_B, s_B) using derivatives
+ recomputed at the final solution
+
+ 1 -> calculate V_B and s_B using derivatives from last iteration
+
+ 2 -> do not calculate V_B and s_B
+ del_init : {0, 1} int
+ 0 -> initial input variable offsets set to 0
+
+ 1 -> initial offsets provided by user in variable "work"
+ restart : {0, 1} int
+ 0 -> fit is not a restart
+
+ 1 -> fit is a restart
+
+ Notes
+ -----
+ The permissible values are different from those given on pg. 31 of the
+ ODRPACK User's Guide only in that one cannot specify numbers greater than
+ the last value for each variable.
+
+ If one does not supply functions to compute the Jacobians, the fitting
+ procedure will change deriv to 0, finite differences, as a default. To
+ initialize the input variable offsets by yourself, set del_init to 1 and
+ put the offsets into the "work" variable correctly.
+
+ """
+
+ if self.job is None:
+ job_l = [0, 0, 0, 0, 0]
+ else:
+ job_l = [self.job // 10000 % 10,
+ self.job // 1000 % 10,
+ self.job // 100 % 10,
+ self.job // 10 % 10,
+ self.job % 10]
+
+ if fit_type in (0, 1, 2):
+ job_l[4] = fit_type
+ if deriv in (0, 1, 2, 3):
+ job_l[3] = deriv
+ if var_calc in (0, 1, 2):
+ job_l[2] = var_calc
+ if del_init in (0, 1):
+ job_l[1] = del_init
+ if restart in (0, 1):
+ job_l[0] = restart
+
+ self.job = (job_l[0]*10000 + job_l[1]*1000 +
+ job_l[2]*100 + job_l[3]*10 + job_l[4])
+
+ def set_iprint(self, init=None, so_init=None,
+ iter=None, so_iter=None, iter_step=None, final=None, so_final=None):
+ """ Set the iprint parameter for the printing of computation reports.
+
+ If any of the arguments are specified here, then they are set in the
+ iprint member. If iprint is not set manually or with this method, then
+ ODRPACK defaults to no printing. If no filename is specified with the
+ member rptfile, then ODRPACK prints to stdout. One can tell ODRPACK to
+ print to stdout in addition to the specified filename by setting the
+ so_* arguments to this function, but one cannot specify to print to
+ stdout but not a file since one can do that by not specifying a rptfile
+ filename.
+
+ There are three reports: initialization, iteration, and final reports.
+ They are represented by the arguments init, iter, and final
+ respectively. The permissible values are 0, 1, and 2 representing "no
+ report", "short report", and "long report" respectively.
+
+ The argument iter_step (0 <= iter_step <= 9) specifies how often to make
+ the iteration report; the report will be made for every iter_step'th
+ iteration starting with iteration one. If iter_step == 0, then no
+ iteration report is made, regardless of the other arguments.
+
+ If the rptfile is None, then any so_* arguments supplied will raise an
+ exception.
+ """
+ if self.iprint is None:
+ self.iprint = 0
+
+ ip = [self.iprint // 1000 % 10,
+ self.iprint // 100 % 10,
+ self.iprint // 10 % 10,
+ self.iprint % 10]
+
+ # make a list to convert iprint digits to/from argument inputs
+ # rptfile, stdout
+ ip2arg = [[0, 0], # none, none
+ [1, 0], # short, none
+ [2, 0], # long, none
+ [1, 1], # short, short
+ [2, 1], # long, short
+ [1, 2], # short, long
+ [2, 2]] # long, long
+
+ if (self.rptfile is None and
+ (so_init is not None or
+ so_iter is not None or
+ so_final is not None)):
+ raise OdrError(
+ "no rptfile specified, cannot output to stdout twice")
+
+ iprint_l = ip2arg[ip[0]] + ip2arg[ip[1]] + ip2arg[ip[3]]
+
+ if init is not None:
+ iprint_l[0] = init
+ if so_init is not None:
+ iprint_l[1] = so_init
+ if iter is not None:
+ iprint_l[2] = iter
+ if so_iter is not None:
+ iprint_l[3] = so_iter
+ if final is not None:
+ iprint_l[4] = final
+ if so_final is not None:
+ iprint_l[5] = so_final
+
+ if iter_step in range(10):
+ # 0..9
+ ip[2] = iter_step
+
+ ip[0] = ip2arg.index(iprint_l[0:2])
+ ip[1] = ip2arg.index(iprint_l[2:4])
+ ip[3] = ip2arg.index(iprint_l[4:6])
+
+ self.iprint = ip[0]*1000 + ip[1]*100 + ip[2]*10 + ip[3]
+
+ def run(self):
+ """ Run the fitting routine with all of the information given and with ``full_output=1``.
+
+ Returns
+ -------
+ output : Output instance
+ This object is also assigned to the attribute .output .
+ """ # noqa: E501
+
+ args = (self.model.fcn, self.beta0, self.data.y, self.data.x)
+ kwds = {'full_output': 1}
+ kwd_l = ['ifixx', 'ifixb', 'job', 'iprint', 'errfile', 'rptfile',
+ 'ndigit', 'taufac', 'sstol', 'partol', 'maxit', 'stpb',
+ 'stpd', 'sclb', 'scld', 'work', 'iwork']
+
+ if self.delta0 is not None and (self.job // 10000) % 10 == 0:
+ # delta0 provided and fit is not a restart
+ self._gen_work()
+
+ d0 = np.ravel(self.delta0)
+
+ self.work[:len(d0)] = d0
+
+ # set the kwds from other objects explicitly
+ if self.model.fjacb is not None:
+ kwds['fjacb'] = self.model.fjacb
+ if self.model.fjacd is not None:
+ kwds['fjacd'] = self.model.fjacd
+ if self.data.we is not None:
+ kwds['we'] = self.data.we
+ if self.data.wd is not None:
+ kwds['wd'] = self.data.wd
+ if self.model.extra_args is not None:
+ kwds['extra_args'] = self.model.extra_args
+
+ # implicitly set kwds from self's members
+ for attr in kwd_l:
+ obj = getattr(self, attr)
+ if obj is not None:
+ kwds[attr] = obj
+
+ with ODR_LOCK:
+ self.output = Output(odr(*args, **kwds))
+
+ return self.output
+
+ def restart(self, iter=None):
+ """ Restarts the run with iter more iterations.
+
+ Parameters
+ ----------
+ iter : int, optional
+ ODRPACK's default for the number of new iterations is 10.
+
+ Returns
+ -------
+ output : Output instance
+ This object is also assigned to the attribute .output .
+ """
+
+ if self.output is None:
+ raise OdrError("cannot restart: run() has not been called before")
+
+ self.set_job(restart=1)
+ self.work = self.output.work
+ self.iwork = self.output.iwork
+
+ self.maxit = iter
+
+ return self.run()
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/models.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/models.py
new file mode 100644
index 0000000000000000000000000000000000000000..0289b59747bb68a4954e58732ac69d7df144f5f6
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/models.py
@@ -0,0 +1,20 @@
+# This file is not meant for public use and will be removed in SciPy v2.0.0.
+# Use the `scipy.odr` namespace for importing the functions
+# included below.
+
+from scipy._lib.deprecation import _sub_module_deprecation
+
+__all__ = [ # noqa: F822
+ 'Model', 'exponential', 'multilinear', 'unilinear',
+ 'quadratic', 'polynomial'
+]
+
+
+def __dir__():
+ return __all__
+
+
+def __getattr__(name):
+ return _sub_module_deprecation(sub_package="odr", module="models",
+ private_modules=["_models"], all=__all__,
+ attribute=name)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/odrpack.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/odrpack.py
new file mode 100644
index 0000000000000000000000000000000000000000..192fb3342b7957703996957c882d44656706e41b
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/odrpack.py
@@ -0,0 +1,21 @@
+# This file is not meant for public use and will be removed in SciPy v2.0.0.
+# Use the `scipy.odr` namespace for importing the functions
+# included below.
+
+from scipy._lib.deprecation import _sub_module_deprecation
+
+__all__ = [ # noqa: F822
+ 'odr', 'OdrWarning', 'OdrError', 'OdrStop',
+ 'Data', 'RealData', 'Model', 'Output', 'ODR',
+ 'odr_error', 'odr_stop'
+]
+
+
+def __dir__():
+ return __all__
+
+
+def __getattr__(name):
+ return _sub_module_deprecation(sub_package="odr", module="odrpack",
+ private_modules=["_odrpack"], all=__all__,
+ attribute=name)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/tests/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/tests/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/tests/test_odr.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/tests/test_odr.py
new file mode 100644
index 0000000000000000000000000000000000000000..971cce6c55a84e08a182e3b25bf9a7e362937e01
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/odr/tests/test_odr.py
@@ -0,0 +1,607 @@
+import pickle
+import tempfile
+import shutil
+import os
+
+import numpy as np
+from numpy import pi
+from numpy.testing import (assert_array_almost_equal,
+ assert_equal, assert_warns,
+ assert_allclose)
+import pytest
+from pytest import raises as assert_raises
+
+from scipy.odr import (Data, Model, ODR, RealData, OdrStop, OdrWarning,
+ multilinear, exponential, unilinear, quadratic,
+ polynomial)
+
+
+class TestODR:
+
+ # Bad Data for 'x'
+
+ def test_bad_data(self):
+ assert_raises(ValueError, Data, 2, 1)
+ assert_raises(ValueError, RealData, 2, 1)
+
+ # Empty Data for 'x'
+ def empty_data_func(self, B, x):
+ return B[0]*x + B[1]
+
+ @pytest.mark.thread_unsafe
+ def test_empty_data(self):
+ beta0 = [0.02, 0.0]
+ linear = Model(self.empty_data_func)
+
+ empty_dat = Data([], [])
+ assert_warns(OdrWarning, ODR,
+ empty_dat, linear, beta0=beta0)
+
+ empty_dat = RealData([], [])
+ assert_warns(OdrWarning, ODR,
+ empty_dat, linear, beta0=beta0)
+
+ # Explicit Example
+
+ def explicit_fcn(self, B, x):
+ ret = B[0] + B[1] * np.power(np.exp(B[2]*x) - 1.0, 2)
+ return ret
+
+ def explicit_fjd(self, B, x):
+ eBx = np.exp(B[2]*x)
+ ret = B[1] * 2.0 * (eBx-1.0) * B[2] * eBx
+ return ret
+
+ def explicit_fjb(self, B, x):
+ eBx = np.exp(B[2]*x)
+ res = np.vstack([np.ones(x.shape[-1]),
+ np.power(eBx-1.0, 2),
+ B[1]*2.0*(eBx-1.0)*eBx*x])
+ return res
+
+ def test_explicit(self):
+ explicit_mod = Model(
+ self.explicit_fcn,
+ fjacb=self.explicit_fjb,
+ fjacd=self.explicit_fjd,
+ meta=dict(name='Sample Explicit Model',
+ ref='ODRPACK UG, pg. 39'),
+ )
+ explicit_dat = Data([0.,0.,5.,7.,7.5,10.,16.,26.,30.,34.,34.5,100.],
+ [1265.,1263.6,1258.,1254.,1253.,1249.8,1237.,1218.,1220.6,
+ 1213.8,1215.5,1212.])
+ explicit_odr = ODR(explicit_dat, explicit_mod, beta0=[1500.0, -50.0, -0.1],
+ ifixx=[0,0,1,1,1,1,1,1,1,1,1,0])
+ explicit_odr.set_job(deriv=2)
+ explicit_odr.set_iprint(init=0, iter=0, final=0)
+
+ out = explicit_odr.run()
+ assert_array_almost_equal(
+ out.beta,
+ np.array([1.2646548050648876e+03, -5.4018409956678255e+01,
+ -8.7849712165253724e-02]),
+ )
+ assert_array_almost_equal(
+ out.sd_beta,
+ np.array([1.0349270280543437, 1.583997785262061, 0.0063321988657267]),
+ )
+ assert_array_almost_equal(
+ out.cov_beta,
+ np.array([[4.4949592379003039e-01, -3.7421976890364739e-01,
+ -8.0978217468468912e-04],
+ [-3.7421976890364739e-01, 1.0529686462751804e+00,
+ -1.9453521827942002e-03],
+ [-8.0978217468468912e-04, -1.9453521827942002e-03,
+ 1.6827336938454476e-05]]),
+ )
+
+ # Implicit Example
+
+ def implicit_fcn(self, B, x):
+ return (B[2]*np.power(x[0]-B[0], 2) +
+ 2.0*B[3]*(x[0]-B[0])*(x[1]-B[1]) +
+ B[4]*np.power(x[1]-B[1], 2) - 1.0)
+
+ def test_implicit(self):
+ implicit_mod = Model(
+ self.implicit_fcn,
+ implicit=1,
+ meta=dict(name='Sample Implicit Model',
+ ref='ODRPACK UG, pg. 49'),
+ )
+ implicit_dat = Data([
+ [0.5,1.2,1.6,1.86,2.12,2.36,2.44,2.36,2.06,1.74,1.34,0.9,-0.28,
+ -0.78,-1.36,-1.9,-2.5,-2.88,-3.18,-3.44],
+ [-0.12,-0.6,-1.,-1.4,-2.54,-3.36,-4.,-4.75,-5.25,-5.64,-5.97,-6.32,
+ -6.44,-6.44,-6.41,-6.25,-5.88,-5.5,-5.24,-4.86]],
+ 1,
+ )
+ implicit_odr = ODR(implicit_dat, implicit_mod,
+ beta0=[-1.0, -3.0, 0.09, 0.02, 0.08])
+
+ out = implicit_odr.run()
+ assert_array_almost_equal(
+ out.beta,
+ np.array([-0.9993809167281279, -2.9310484652026476, 0.0875730502693354,
+ 0.0162299708984738, 0.0797537982976416]),
+ )
+ assert_array_almost_equal(
+ out.sd_beta,
+ np.array([0.1113840353364371, 0.1097673310686467, 0.0041060738314314,
+ 0.0027500347539902, 0.0034962501532468]),
+ )
+ assert_allclose(
+ out.cov_beta,
+ np.array([[2.1089274602333052e+00, -1.9437686411979040e+00,
+ 7.0263550868344446e-02, -4.7175267373474862e-02,
+ 5.2515575927380355e-02],
+ [-1.9437686411979040e+00, 2.0481509222414456e+00,
+ -6.1600515853057307e-02, 4.6268827806232933e-02,
+ -5.8822307501391467e-02],
+ [7.0263550868344446e-02, -6.1600515853057307e-02,
+ 2.8659542561579308e-03, -1.4628662260014491e-03,
+ 1.4528860663055824e-03],
+ [-4.7175267373474862e-02, 4.6268827806232933e-02,
+ -1.4628662260014491e-03, 1.2855592885514335e-03,
+ -1.2692942951415293e-03],
+ [5.2515575927380355e-02, -5.8822307501391467e-02,
+ 1.4528860663055824e-03, -1.2692942951415293e-03,
+ 2.0778813389755596e-03]]),
+ rtol=1e-6, atol=2e-6,
+ )
+
+ # Multi-variable Example
+
+ def multi_fcn(self, B, x):
+ if (x < 0.0).any():
+ raise OdrStop
+ theta = pi*B[3]/2.
+ ctheta = np.cos(theta)
+ stheta = np.sin(theta)
+ omega = np.power(2.*pi*x*np.exp(-B[2]), B[3])
+ phi = np.arctan2((omega*stheta), (1.0 + omega*ctheta))
+ r = (B[0] - B[1]) * np.power(np.sqrt(np.power(1.0 + omega*ctheta, 2) +
+ np.power(omega*stheta, 2)), -B[4])
+ ret = np.vstack([B[1] + r*np.cos(B[4]*phi),
+ r*np.sin(B[4]*phi)])
+ return ret
+
+ def test_multi(self):
+ multi_mod = Model(
+ self.multi_fcn,
+ meta=dict(name='Sample Multi-Response Model',
+ ref='ODRPACK UG, pg. 56'),
+ )
+
+ multi_x = np.array([30.0, 50.0, 70.0, 100.0, 150.0, 200.0, 300.0, 500.0,
+ 700.0, 1000.0, 1500.0, 2000.0, 3000.0, 5000.0, 7000.0, 10000.0,
+ 15000.0, 20000.0, 30000.0, 50000.0, 70000.0, 100000.0, 150000.0])
+ multi_y = np.array([
+ [4.22, 4.167, 4.132, 4.038, 4.019, 3.956, 3.884, 3.784, 3.713,
+ 3.633, 3.54, 3.433, 3.358, 3.258, 3.193, 3.128, 3.059, 2.984,
+ 2.934, 2.876, 2.838, 2.798, 2.759],
+ [0.136, 0.167, 0.188, 0.212, 0.236, 0.257, 0.276, 0.297, 0.309,
+ 0.311, 0.314, 0.311, 0.305, 0.289, 0.277, 0.255, 0.24, 0.218,
+ 0.202, 0.182, 0.168, 0.153, 0.139],
+ ])
+ n = len(multi_x)
+ multi_we = np.zeros((2, 2, n), dtype=float)
+ multi_ifixx = np.ones(n, dtype=int)
+ multi_delta = np.zeros(n, dtype=float)
+
+ multi_we[0,0,:] = 559.6
+ multi_we[1,0,:] = multi_we[0,1,:] = -1634.0
+ multi_we[1,1,:] = 8397.0
+
+ for i in range(n):
+ if multi_x[i] < 100.0:
+ multi_ifixx[i] = 0
+ elif multi_x[i] <= 150.0:
+ pass # defaults are fine
+ elif multi_x[i] <= 1000.0:
+ multi_delta[i] = 25.0
+ elif multi_x[i] <= 10000.0:
+ multi_delta[i] = 560.0
+ elif multi_x[i] <= 100000.0:
+ multi_delta[i] = 9500.0
+ else:
+ multi_delta[i] = 144000.0
+ if multi_x[i] == 100.0 or multi_x[i] == 150.0:
+ multi_we[:,:,i] = 0.0
+
+ multi_dat = Data(multi_x, multi_y, wd=1e-4/np.power(multi_x, 2),
+ we=multi_we)
+ multi_odr = ODR(multi_dat, multi_mod, beta0=[4.,2.,7.,.4,.5],
+ delta0=multi_delta, ifixx=multi_ifixx)
+ multi_odr.set_job(deriv=1, del_init=1)
+
+ out = multi_odr.run()
+ assert_array_almost_equal(
+ out.beta,
+ np.array([4.3799880305938963, 2.4333057577497703, 8.0028845899503978,
+ 0.5101147161764654, 0.5173902330489161]),
+ )
+ assert_array_almost_equal(
+ out.sd_beta,
+ np.array([0.0130625231081944, 0.0130499785273277, 0.1167085962217757,
+ 0.0132642749596149, 0.0288529201353984]),
+ )
+ assert_array_almost_equal(
+ out.cov_beta,
+ np.array([[0.0064918418231375, 0.0036159705923791, 0.0438637051470406,
+ -0.0058700836512467, 0.011281212888768],
+ [0.0036159705923791, 0.0064793789429006, 0.0517610978353126,
+ -0.0051181304940204, 0.0130726943624117],
+ [0.0438637051470406, 0.0517610978353126, 0.5182263323095322,
+ -0.0563083340093696, 0.1269490939468611],
+ [-0.0058700836512467, -0.0051181304940204, -0.0563083340093696,
+ 0.0066939246261263, -0.0140184391377962],
+ [0.011281212888768, 0.0130726943624117, 0.1269490939468611,
+ -0.0140184391377962, 0.0316733013820852]]),
+ )
+
+ # Pearson's Data
+ # K. Pearson, Philosophical Magazine, 2, 559 (1901)
+
+ def pearson_fcn(self, B, x):
+ return B[0] + B[1]*x
+
+ def test_pearson(self):
+ p_x = np.array([0.,.9,1.8,2.6,3.3,4.4,5.2,6.1,6.5,7.4])
+ p_y = np.array([5.9,5.4,4.4,4.6,3.5,3.7,2.8,2.8,2.4,1.5])
+ p_sx = np.array([.03,.03,.04,.035,.07,.11,.13,.22,.74,1.])
+ p_sy = np.array([1.,.74,.5,.35,.22,.22,.12,.12,.1,.04])
+
+ p_dat = RealData(p_x, p_y, sx=p_sx, sy=p_sy)
+
+ # Reverse the data to test invariance of results
+ pr_dat = RealData(p_y, p_x, sx=p_sy, sy=p_sx)
+
+ p_mod = Model(self.pearson_fcn, meta=dict(name='Uni-linear Fit'))
+
+ p_odr = ODR(p_dat, p_mod, beta0=[1.,1.])
+ pr_odr = ODR(pr_dat, p_mod, beta0=[1.,1.])
+
+ out = p_odr.run()
+ assert_array_almost_equal(
+ out.beta,
+ np.array([5.4767400299231674, -0.4796082367610305]),
+ )
+ assert_array_almost_equal(
+ out.sd_beta,
+ np.array([0.3590121690702467, 0.0706291186037444]),
+ )
+ assert_array_almost_equal(
+ out.cov_beta,
+ np.array([[0.0854275622946333, -0.0161807025443155],
+ [-0.0161807025443155, 0.003306337993922]]),
+ )
+
+ rout = pr_odr.run()
+ assert_array_almost_equal(
+ rout.beta,
+ np.array([11.4192022410781231, -2.0850374506165474]),
+ )
+ assert_array_almost_equal(
+ rout.sd_beta,
+ np.array([0.9820231665657161, 0.3070515616198911]),
+ )
+ assert_array_almost_equal(
+ rout.cov_beta,
+ np.array([[0.6391799462548782, -0.1955657291119177],
+ [-0.1955657291119177, 0.0624888159223392]]),
+ )
+
+ # Lorentz Peak
+ # The data is taken from one of the undergraduate physics labs I performed.
+
+ def lorentz(self, beta, x):
+ return (beta[0]*beta[1]*beta[2] / np.sqrt(np.power(x*x -
+ beta[2]*beta[2], 2.0) + np.power(beta[1]*x, 2.0)))
+
+ def test_lorentz(self):
+ l_sy = np.array([.29]*18)
+ l_sx = np.array([.000972971,.000948268,.000707632,.000706679,
+ .000706074, .000703918,.000698955,.000456856,
+ .000455207,.000662717,.000654619,.000652694,
+ .000000859202,.00106589,.00106378,.00125483, .00140818,.00241839])
+
+ l_dat = RealData(
+ [3.9094, 3.85945, 3.84976, 3.84716, 3.84551, 3.83964, 3.82608,
+ 3.78847, 3.78163, 3.72558, 3.70274, 3.6973, 3.67373, 3.65982,
+ 3.6562, 3.62498, 3.55525, 3.41886],
+ [652, 910.5, 984, 1000, 1007.5, 1053, 1160.5, 1409.5, 1430, 1122,
+ 957.5, 920, 777.5, 709.5, 698, 578.5, 418.5, 275.5],
+ sx=l_sx,
+ sy=l_sy,
+ )
+ l_mod = Model(self.lorentz, meta=dict(name='Lorentz Peak'))
+ l_odr = ODR(l_dat, l_mod, beta0=(1000., .1, 3.8))
+
+ out = l_odr.run()
+ assert_array_almost_equal(
+ out.beta,
+ np.array([1.4306780846149925e+03, 1.3390509034538309e-01,
+ 3.7798193600109009e+00]),
+ )
+ assert_array_almost_equal(
+ out.sd_beta,
+ np.array([7.3621186811330963e-01, 3.5068899941471650e-04,
+ 2.4451209281408992e-04]),
+ )
+ assert_array_almost_equal(
+ out.cov_beta,
+ np.array([[2.4714409064597873e-01, -6.9067261911110836e-05,
+ -3.1236953270424990e-05],
+ [-6.9067261911110836e-05, 5.6077531517333009e-08,
+ 3.6133261832722601e-08],
+ [-3.1236953270424990e-05, 3.6133261832722601e-08,
+ 2.7261220025171730e-08]]),
+ )
+
+ def test_ticket_1253(self):
+ def linear(c, x):
+ return c[0]*x+c[1]
+
+ c = [2.0, 3.0]
+ x = np.linspace(0, 10)
+ y = linear(c, x)
+
+ model = Model(linear)
+ data = Data(x, y, wd=1.0, we=1.0)
+ job = ODR(data, model, beta0=[1.0, 1.0])
+ result = job.run()
+ assert_equal(result.info, 2)
+
+ # Verify fix for gh-9140
+
+ def test_ifixx(self):
+ x1 = [-2.01, -0.99, -0.001, 1.02, 1.98]
+ x2 = [3.98, 1.01, 0.001, 0.998, 4.01]
+ fix = np.vstack((np.zeros_like(x1, dtype=int), np.ones_like(x2, dtype=int)))
+ data = Data(np.vstack((x1, x2)), y=1, fix=fix)
+ model = Model(lambda beta, x: x[1, :] - beta[0] * x[0, :]**2., implicit=True)
+
+ odr1 = ODR(data, model, beta0=np.array([1.]))
+ sol1 = odr1.run()
+ odr2 = ODR(data, model, beta0=np.array([1.]), ifixx=fix)
+ sol2 = odr2.run()
+ assert_equal(sol1.beta, sol2.beta)
+
+ # verify bugfix for #11800 in #11802
+ def test_ticket_11800(self):
+ # parameters
+ beta_true = np.array([1.0, 2.3, 1.1, -1.0, 1.3, 0.5])
+ nr_measurements = 10
+
+ std_dev_x = 0.01
+ x_error = np.array([[0.00063445, 0.00515731, 0.00162719, 0.01022866,
+ -0.01624845, 0.00482652, 0.00275988, -0.00714734, -0.00929201, -0.00687301],
+ [-0.00831623, -0.00821211, -0.00203459, 0.00938266, -0.00701829,
+ 0.0032169, 0.00259194, -0.00581017, -0.0030283, 0.01014164]])
+
+ std_dev_y = 0.05
+ y_error = np.array([[0.05275304, 0.04519563, -0.07524086, 0.03575642,
+ 0.04745194, 0.03806645, 0.07061601, -0.00753604, -0.02592543, -0.02394929],
+ [0.03632366, 0.06642266, 0.08373122, 0.03988822, -0.0092536,
+ -0.03750469, -0.03198903, 0.01642066, 0.01293648, -0.05627085]])
+
+ beta_solution = np.array([
+ 2.62920235756665876536e+00, -1.26608484996299608838e+02,
+ 1.29703572775403074502e+02, -1.88560985401185465804e+00,
+ 7.83834160771274923718e+01, -7.64124076838087091801e+01])
+
+ # model's function and Jacobians
+ def func(beta, x):
+ y0 = beta[0] + beta[1] * x[0, :] + beta[2] * x[1, :]
+ y1 = beta[3] + beta[4] * x[0, :] + beta[5] * x[1, :]
+
+ return np.vstack((y0, y1))
+
+ def df_dbeta_odr(beta, x):
+ nr_meas = np.shape(x)[1]
+ zeros = np.zeros(nr_meas)
+ ones = np.ones(nr_meas)
+
+ dy0 = np.array([ones, x[0, :], x[1, :], zeros, zeros, zeros])
+ dy1 = np.array([zeros, zeros, zeros, ones, x[0, :], x[1, :]])
+
+ return np.stack((dy0, dy1))
+
+ def df_dx_odr(beta, x):
+ nr_meas = np.shape(x)[1]
+ ones = np.ones(nr_meas)
+
+ dy0 = np.array([beta[1] * ones, beta[2] * ones])
+ dy1 = np.array([beta[4] * ones, beta[5] * ones])
+ return np.stack((dy0, dy1))
+
+ # do measurements with errors in independent and dependent variables
+ x0_true = np.linspace(1, 10, nr_measurements)
+ x1_true = np.linspace(1, 10, nr_measurements)
+ x_true = np.array([x0_true, x1_true])
+
+ y_true = func(beta_true, x_true)
+
+ x_meas = x_true + x_error
+ y_meas = y_true + y_error
+
+ # estimate model's parameters
+ model_f = Model(func, fjacb=df_dbeta_odr, fjacd=df_dx_odr)
+
+ data = RealData(x_meas, y_meas, sx=std_dev_x, sy=std_dev_y)
+
+ odr_obj = ODR(data, model_f, beta0=0.9 * beta_true, maxit=100)
+ #odr_obj.set_iprint(init=2, iter=0, iter_step=1, final=1)
+ odr_obj.set_job(deriv=3)
+
+ odr_out = odr_obj.run()
+
+ # check results
+ assert_equal(odr_out.info, 1)
+ assert_array_almost_equal(odr_out.beta, beta_solution)
+
+ def test_multilinear_model(self):
+ x = np.linspace(0.0, 5.0)
+ y = 10.0 + 5.0 * x
+ data = Data(x, y)
+ odr_obj = ODR(data, multilinear)
+ output = odr_obj.run()
+ assert_array_almost_equal(output.beta, [10.0, 5.0])
+
+ def test_exponential_model(self):
+ x = np.linspace(0.0, 5.0)
+ y = -10.0 + np.exp(0.5*x)
+ data = Data(x, y)
+ odr_obj = ODR(data, exponential)
+ output = odr_obj.run()
+ assert_array_almost_equal(output.beta, [-10.0, 0.5])
+
+ def test_polynomial_model(self):
+ x = np.linspace(0.0, 5.0)
+ y = 1.0 + 2.0 * x + 3.0 * x ** 2 + 4.0 * x ** 3
+ poly_model = polynomial(3)
+ data = Data(x, y)
+ odr_obj = ODR(data, poly_model)
+ output = odr_obj.run()
+ assert_array_almost_equal(output.beta, [1.0, 2.0, 3.0, 4.0])
+
+ def test_unilinear_model(self):
+ x = np.linspace(0.0, 5.0)
+ y = 1.0 * x + 2.0
+ data = Data(x, y)
+ odr_obj = ODR(data, unilinear)
+ output = odr_obj.run()
+ assert_array_almost_equal(output.beta, [1.0, 2.0])
+
+ def test_quadratic_model(self):
+ x = np.linspace(0.0, 5.0)
+ y = 1.0 * x ** 2 + 2.0 * x + 3.0
+ data = Data(x, y)
+ odr_obj = ODR(data, quadratic)
+ output = odr_obj.run()
+ assert_array_almost_equal(output.beta, [1.0, 2.0, 3.0])
+
+ def test_work_ind(self):
+
+ def func(par, x):
+ b0, b1 = par
+ return b0 + b1 * x
+
+ # generate some data
+ n_data = 4
+ x = np.arange(n_data)
+ y = np.where(x % 2, x + 0.1, x - 0.1)
+ x_err = np.full(n_data, 0.1)
+ y_err = np.full(n_data, 0.1)
+
+ # do the fitting
+ linear_model = Model(func)
+ real_data = RealData(x, y, sx=x_err, sy=y_err)
+ odr_obj = ODR(real_data, linear_model, beta0=[0.4, 0.4])
+ odr_obj.set_job(fit_type=0)
+ out = odr_obj.run()
+
+ sd_ind = out.work_ind['sd']
+ assert_array_almost_equal(out.sd_beta,
+ out.work[sd_ind:sd_ind + len(out.sd_beta)])
+
+ @pytest.mark.skipif(True, reason="Fortran I/O prone to crashing so better "
+ "not to run this test, see gh-13127")
+ def test_output_file_overwrite(self):
+ """
+ Verify fix for gh-1892
+ """
+ def func(b, x):
+ return b[0] + b[1] * x
+
+ p = Model(func)
+ data = Data(np.arange(10), 12 * np.arange(10))
+ tmp_dir = tempfile.mkdtemp()
+ error_file_path = os.path.join(tmp_dir, "error.dat")
+ report_file_path = os.path.join(tmp_dir, "report.dat")
+ try:
+ ODR(data, p, beta0=[0.1, 13], errfile=error_file_path,
+ rptfile=report_file_path).run()
+ ODR(data, p, beta0=[0.1, 13], errfile=error_file_path,
+ rptfile=report_file_path, overwrite=True).run()
+ finally:
+ # remove output files for clean up
+ shutil.rmtree(tmp_dir)
+
+ def test_odr_model_default_meta(self):
+ def func(b, x):
+ return b[0] + b[1] * x
+
+ p = Model(func)
+ p.set_meta(name='Sample Model Meta', ref='ODRPACK')
+ assert_equal(p.meta, {'name': 'Sample Model Meta', 'ref': 'ODRPACK'})
+
+ def test_work_array_del_init(self):
+ """
+ Verify fix for gh-18739 where del_init=1 fails.
+ """
+ def func(b, x):
+ return b[0] + b[1] * x
+
+ # generate some data
+ n_data = 4
+ x = np.arange(n_data)
+ y = np.where(x % 2, x + 0.1, x - 0.1)
+ x_err = np.full(n_data, 0.1)
+ y_err = np.full(n_data, 0.1)
+
+ linear_model = Model(func)
+ # Try various shapes of the `we` array from various `sy` and `covy`
+ rd0 = RealData(x, y, sx=x_err, sy=y_err)
+ rd1 = RealData(x, y, sx=x_err, sy=0.1)
+ rd2 = RealData(x, y, sx=x_err, sy=[0.1])
+ rd3 = RealData(x, y, sx=x_err, sy=np.full((1, n_data), 0.1))
+ rd4 = RealData(x, y, sx=x_err, covy=[[0.01]])
+ rd5 = RealData(x, y, sx=x_err, covy=np.full((1, 1, n_data), 0.01))
+ for rd in [rd0, rd1, rd2, rd3, rd4, rd5]:
+ odr_obj = ODR(rd, linear_model, beta0=[0.4, 0.4],
+ delta0=np.full(n_data, -0.1))
+ odr_obj.set_job(fit_type=0, del_init=1)
+ # Just make sure that it runs without raising an exception.
+ odr_obj.run()
+
+ def test_pickling_data(self):
+ x = np.linspace(0.0, 5.0)
+ y = 1.0 * x + 2.0
+ data = Data(x, y)
+
+ obj_pickle = pickle.dumps(data)
+ del data
+ pickle.loads(obj_pickle)
+
+ def test_pickling_real_data(self):
+ x = np.linspace(0.0, 5.0)
+ y = 1.0 * x + 2.0
+ data = RealData(x, y)
+
+ obj_pickle = pickle.dumps(data)
+ del data
+ pickle.loads(obj_pickle)
+
+ def test_pickling_model(self):
+ obj_pickle = pickle.dumps(unilinear)
+ pickle.loads(obj_pickle)
+
+ def test_pickling_odr(self):
+ x = np.linspace(0.0, 5.0)
+ y = 1.0 * x + 2.0
+ odr_obj = ODR(Data(x, y), unilinear)
+
+ obj_pickle = pickle.dumps(odr_obj)
+ del odr_obj
+ pickle.loads(obj_pickle)
+
+ def test_pickling_output(self):
+ x = np.linspace(0.0, 5.0)
+ y = 1.0 * x + 2.0
+ output = ODR(Data(x, y), unilinear).run
+
+ obj_pickle = pickle.dumps(output)
+ del output
+ pickle.loads(obj_pickle)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..00ab19af4748147d748fccb51a3710d5c711f4b4
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__init__.py
@@ -0,0 +1,210 @@
+r"""
+Compressed sparse graph routines (:mod:`scipy.sparse.csgraph`)
+==============================================================
+
+.. currentmodule:: scipy.sparse.csgraph
+
+Fast graph algorithms based on sparse matrix representations.
+
+Contents
+--------
+
+.. autosummary::
+ :toctree: generated/
+
+ connected_components -- determine connected components of a graph
+ laplacian -- compute the laplacian of a graph
+ shortest_path -- compute the shortest path between points on a positive graph
+ dijkstra -- use Dijkstra's algorithm for shortest path
+ floyd_warshall -- use the Floyd-Warshall algorithm for shortest path
+ bellman_ford -- use the Bellman-Ford algorithm for shortest path
+ johnson -- use Johnson's algorithm for shortest path
+ yen -- use Yen's algorithm for K-shortest paths between to nodes.
+ breadth_first_order -- compute a breadth-first order of nodes
+ depth_first_order -- compute a depth-first order of nodes
+ breadth_first_tree -- construct the breadth-first tree from a given node
+ depth_first_tree -- construct a depth-first tree from a given node
+ minimum_spanning_tree -- construct the minimum spanning tree of a graph
+ reverse_cuthill_mckee -- compute permutation for reverse Cuthill-McKee ordering
+ maximum_flow -- solve the maximum flow problem for a graph
+ maximum_bipartite_matching -- compute a maximum matching of a bipartite graph
+ min_weight_full_bipartite_matching - compute a minimum weight full matching of a bipartite graph
+ structural_rank -- compute the structural rank of a graph
+ NegativeCycleError
+
+.. autosummary::
+ :toctree: generated/
+
+ construct_dist_matrix
+ csgraph_from_dense
+ csgraph_from_masked
+ csgraph_masked_from_dense
+ csgraph_to_dense
+ csgraph_to_masked
+ reconstruct_path
+
+Graph Representations
+---------------------
+This module uses graphs which are stored in a matrix format. A
+graph with N nodes can be represented by an (N x N) adjacency matrix G.
+If there is a connection from node i to node j, then G[i, j] = w, where
+w is the weight of the connection. For nodes i and j which are
+not connected, the value depends on the representation:
+
+- for dense array representations, non-edges are represented by
+ G[i, j] = 0, infinity, or NaN.
+
+- for dense masked representations (of type np.ma.MaskedArray), non-edges
+ are represented by masked values. This can be useful when graphs with
+ zero-weight edges are desired.
+
+- for sparse array representations, non-edges are represented by
+ non-entries in the matrix. This sort of sparse representation also
+ allows for edges with zero weights.
+
+As a concrete example, imagine that you would like to represent the following
+undirected graph::
+
+ G
+
+ (0)
+ / \
+ 1 2
+ / \
+ (2) (1)
+
+This graph has three nodes, where node 0 and 1 are connected by an edge of
+weight 2, and nodes 0 and 2 are connected by an edge of weight 1.
+We can construct the dense, masked, and sparse representations as follows,
+keeping in mind that an undirected graph is represented by a symmetric matrix::
+
+ >>> import numpy as np
+ >>> G_dense = np.array([[0, 2, 1],
+ ... [2, 0, 0],
+ ... [1, 0, 0]])
+ >>> G_masked = np.ma.masked_values(G_dense, 0)
+ >>> from scipy.sparse import csr_array
+ >>> G_sparse = csr_array(G_dense)
+
+This becomes more difficult when zero edges are significant. For example,
+consider the situation when we slightly modify the above graph::
+
+ G2
+
+ (0)
+ / \
+ 0 2
+ / \
+ (2) (1)
+
+This is identical to the previous graph, except nodes 0 and 2 are connected
+by an edge of zero weight. In this case, the dense representation above
+leads to ambiguities: how can non-edges be represented if zero is a meaningful
+value? In this case, either a masked or sparse representation must be used
+to eliminate the ambiguity::
+
+ >>> import numpy as np
+ >>> G2_data = np.array([[np.inf, 2, 0 ],
+ ... [2, np.inf, np.inf],
+ ... [0, np.inf, np.inf]])
+ >>> G2_masked = np.ma.masked_invalid(G2_data)
+ >>> from scipy.sparse.csgraph import csgraph_from_dense
+ >>> # G2_sparse = csr_array(G2_data) would give the wrong result
+ >>> G2_sparse = csgraph_from_dense(G2_data, null_value=np.inf)
+ >>> G2_sparse.data
+ array([ 2., 0., 2., 0.])
+
+Here we have used a utility routine from the csgraph submodule in order to
+convert the dense representation to a sparse representation which can be
+understood by the algorithms in submodule. By viewing the data array, we
+can see that the zero values are explicitly encoded in the graph.
+
+Directed vs. undirected
+^^^^^^^^^^^^^^^^^^^^^^^
+Matrices may represent either directed or undirected graphs. This is
+specified throughout the csgraph module by a boolean keyword. Graphs are
+assumed to be directed by default. In a directed graph, traversal from node
+i to node j can be accomplished over the edge G[i, j], but not the edge
+G[j, i]. Consider the following dense graph::
+
+ >>> import numpy as np
+ >>> G_dense = np.array([[0, 1, 0],
+ ... [2, 0, 3],
+ ... [0, 4, 0]])
+
+When ``directed=True`` we get the graph::
+
+ ---1--> ---3-->
+ (0) (1) (2)
+ <--2--- <--4---
+
+In a non-directed graph, traversal from node i to node j can be
+accomplished over either G[i, j] or G[j, i]. If both edges are not null,
+and the two have unequal weights, then the smaller of the two is used.
+
+So for the same graph, when ``directed=False`` we get the graph::
+
+ (0)--1--(1)--3--(2)
+
+Note that a symmetric matrix will represent an undirected graph, regardless
+of whether the 'directed' keyword is set to True or False. In this case,
+using ``directed=True`` generally leads to more efficient computation.
+
+The routines in this module accept as input either scipy.sparse representations
+(csr, csc, or lil format), masked representations, or dense representations
+with non-edges indicated by zeros, infinities, and NaN entries.
+""" # noqa: E501
+
+__docformat__ = "restructuredtext en"
+
+__all__ = ['connected_components',
+ 'laplacian',
+ 'shortest_path',
+ 'floyd_warshall',
+ 'dijkstra',
+ 'bellman_ford',
+ 'johnson',
+ 'yen',
+ 'breadth_first_order',
+ 'depth_first_order',
+ 'breadth_first_tree',
+ 'depth_first_tree',
+ 'minimum_spanning_tree',
+ 'reverse_cuthill_mckee',
+ 'maximum_flow',
+ 'maximum_bipartite_matching',
+ 'min_weight_full_bipartite_matching',
+ 'structural_rank',
+ 'construct_dist_matrix',
+ 'reconstruct_path',
+ 'csgraph_masked_from_dense',
+ 'csgraph_from_dense',
+ 'csgraph_from_masked',
+ 'csgraph_to_dense',
+ 'csgraph_to_masked',
+ 'NegativeCycleError']
+
+from ._laplacian import laplacian
+from ._shortest_path import (
+ shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, yen,
+ NegativeCycleError
+)
+from ._traversal import (
+ breadth_first_order, depth_first_order, breadth_first_tree,
+ depth_first_tree, connected_components
+)
+from ._min_spanning_tree import minimum_spanning_tree
+from ._flow import maximum_flow
+from ._matching import (
+ maximum_bipartite_matching, min_weight_full_bipartite_matching
+)
+from ._reordering import reverse_cuthill_mckee, structural_rank
+from ._tools import (
+ construct_dist_matrix, reconstruct_path, csgraph_from_dense,
+ csgraph_to_dense, csgraph_masked_from_dense, csgraph_from_masked,
+ csgraph_to_masked
+)
+
+from scipy._lib._testutils import PytestTester
+test = PytestTester(__name__)
+del PytestTester
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..79f032b744fb5a38865e30e4eb697bfa2b0a5131
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/_laplacian.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/_laplacian.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f4f3dccea7d4b4890b90426c3341509bef1ca4f4
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/_laplacian.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/_validation.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/_validation.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ade8afbfe1ffc36c2c3abecb73e49d63faaf58b7
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/__pycache__/_validation.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/_laplacian.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/_laplacian.py
new file mode 100644
index 0000000000000000000000000000000000000000..e5529a0662a3f9db006bc5411664908f10d8fe23
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/_laplacian.py
@@ -0,0 +1,563 @@
+"""
+Laplacian of a compressed-sparse graph
+"""
+
+import numpy as np
+from scipy.sparse import issparse
+from scipy.sparse.linalg import LinearOperator
+from scipy.sparse._sputils import convert_pydata_sparse_to_scipy, is_pydata_spmatrix
+
+
+###############################################################################
+# Graph laplacian
+def laplacian(
+ csgraph,
+ normed=False,
+ return_diag=False,
+ use_out_degree=False,
+ *,
+ copy=True,
+ form="array",
+ dtype=None,
+ symmetrized=False,
+):
+ """
+ Return the Laplacian of a directed graph.
+
+ Parameters
+ ----------
+ csgraph : array_like or sparse array or matrix, 2 dimensions
+ compressed-sparse graph, with shape (N, N).
+ normed : bool, optional
+ If True, then compute symmetrically normalized Laplacian.
+ Default: False.
+ return_diag : bool, optional
+ If True, then also return an array related to vertex degrees.
+ Default: False.
+ use_out_degree : bool, optional
+ If True, then use out-degree instead of in-degree.
+ This distinction matters only if the graph is asymmetric.
+ Default: False.
+ copy: bool, optional
+ If False, then change `csgraph` in place if possible,
+ avoiding doubling the memory use.
+ Default: True, for backward compatibility.
+ form: 'array', or 'function', or 'lo'
+ Determines the format of the output Laplacian:
+
+ * 'array' is a numpy array;
+ * 'function' is a pointer to evaluating the Laplacian-vector
+ or Laplacian-matrix product;
+ * 'lo' results in the format of the `LinearOperator`.
+
+ Choosing 'function' or 'lo' always avoids doubling
+ the memory use, ignoring `copy` value.
+ Default: 'array', for backward compatibility.
+ dtype: None or one of numeric numpy dtypes, optional
+ The dtype of the output. If ``dtype=None``, the dtype of the
+ output matches the dtype of the input csgraph, except for
+ the case ``normed=True`` and integer-like csgraph, where
+ the output dtype is 'float' allowing accurate normalization,
+ but dramatically increasing the memory use.
+ Default: None, for backward compatibility.
+ symmetrized: bool, optional
+ If True, then the output Laplacian is symmetric/Hermitian.
+ The symmetrization is done by ``csgraph + csgraph.T.conj``
+ without dividing by 2 to preserve integer dtypes if possible
+ prior to the construction of the Laplacian.
+ The symmetrization will increase the memory footprint of
+ sparse matrices unless the sparsity pattern is symmetric or
+ `form` is 'function' or 'lo'.
+ Default: False, for backward compatibility.
+
+ Returns
+ -------
+ lap : ndarray, or sparse array or matrix, or `LinearOperator`
+ The N x N Laplacian of csgraph. It will be a NumPy array (dense)
+ if the input was dense, or a sparse array otherwise, or
+ the format of a function or `LinearOperator` if
+ `form` equals 'function' or 'lo', respectively.
+ diag : ndarray, optional
+ The length-N main diagonal of the Laplacian matrix.
+ For the normalized Laplacian, this is the array of square roots
+ of vertex degrees or 1 if the degree is zero.
+
+ Notes
+ -----
+ The Laplacian matrix of a graph is sometimes referred to as the
+ "Kirchhoff matrix" or just the "Laplacian", and is useful in many
+ parts of spectral graph theory.
+ In particular, the eigen-decomposition of the Laplacian can give
+ insight into many properties of the graph, e.g.,
+ is commonly used for spectral data embedding and clustering.
+
+ The constructed Laplacian doubles the memory use if ``copy=True`` and
+ ``form="array"`` which is the default.
+ Choosing ``copy=False`` has no effect unless ``form="array"``
+ or the matrix is sparse in the ``coo`` format, or dense array, except
+ for the integer input with ``normed=True`` that forces the float output.
+
+ Sparse input is reformatted into ``coo`` if ``form="array"``,
+ which is the default.
+
+ If the input adjacency matrix is not symmetric, the Laplacian is
+ also non-symmetric unless ``symmetrized=True`` is used.
+
+ Diagonal entries of the input adjacency matrix are ignored and
+ replaced with zeros for the purpose of normalization where ``normed=True``.
+ The normalization uses the inverse square roots of row-sums of the input
+ adjacency matrix, and thus may fail if the row-sums contain
+ negative or complex with a non-zero imaginary part values.
+
+ The normalization is symmetric, making the normalized Laplacian also
+ symmetric if the input csgraph was symmetric.
+
+ References
+ ----------
+ .. [1] Laplacian matrix. https://en.wikipedia.org/wiki/Laplacian_matrix
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse import csgraph
+
+ Our first illustration is the symmetric graph
+
+ >>> G = np.arange(4) * np.arange(4)[:, np.newaxis]
+ >>> G
+ array([[0, 0, 0, 0],
+ [0, 1, 2, 3],
+ [0, 2, 4, 6],
+ [0, 3, 6, 9]])
+
+ and its symmetric Laplacian matrix
+
+ >>> csgraph.laplacian(G)
+ array([[ 0, 0, 0, 0],
+ [ 0, 5, -2, -3],
+ [ 0, -2, 8, -6],
+ [ 0, -3, -6, 9]])
+
+ The non-symmetric graph
+
+ >>> G = np.arange(9).reshape(3, 3)
+ >>> G
+ array([[0, 1, 2],
+ [3, 4, 5],
+ [6, 7, 8]])
+
+ has different row- and column sums, resulting in two varieties
+ of the Laplacian matrix, using an in-degree, which is the default
+
+ >>> L_in_degree = csgraph.laplacian(G)
+ >>> L_in_degree
+ array([[ 9, -1, -2],
+ [-3, 8, -5],
+ [-6, -7, 7]])
+
+ or alternatively an out-degree
+
+ >>> L_out_degree = csgraph.laplacian(G, use_out_degree=True)
+ >>> L_out_degree
+ array([[ 3, -1, -2],
+ [-3, 8, -5],
+ [-6, -7, 13]])
+
+ Constructing a symmetric Laplacian matrix, one can add the two as
+
+ >>> L_in_degree + L_out_degree.T
+ array([[ 12, -4, -8],
+ [ -4, 16, -12],
+ [ -8, -12, 20]])
+
+ or use the ``symmetrized=True`` option
+
+ >>> csgraph.laplacian(G, symmetrized=True)
+ array([[ 12, -4, -8],
+ [ -4, 16, -12],
+ [ -8, -12, 20]])
+
+ that is equivalent to symmetrizing the original graph
+
+ >>> csgraph.laplacian(G + G.T)
+ array([[ 12, -4, -8],
+ [ -4, 16, -12],
+ [ -8, -12, 20]])
+
+ The goal of normalization is to make the non-zero diagonal entries
+ of the Laplacian matrix to be all unit, also scaling off-diagonal
+ entries correspondingly. The normalization can be done manually, e.g.,
+
+ >>> G = np.array([[0, 1, 1], [1, 0, 1], [1, 1, 0]])
+ >>> L, d = csgraph.laplacian(G, return_diag=True)
+ >>> L
+ array([[ 2, -1, -1],
+ [-1, 2, -1],
+ [-1, -1, 2]])
+ >>> d
+ array([2, 2, 2])
+ >>> scaling = np.sqrt(d)
+ >>> scaling
+ array([1.41421356, 1.41421356, 1.41421356])
+ >>> (1/scaling)*L*(1/scaling)
+ array([[ 1. , -0.5, -0.5],
+ [-0.5, 1. , -0.5],
+ [-0.5, -0.5, 1. ]])
+
+ Or using ``normed=True`` option
+
+ >>> L, d = csgraph.laplacian(G, return_diag=True, normed=True)
+ >>> L
+ array([[ 1. , -0.5, -0.5],
+ [-0.5, 1. , -0.5],
+ [-0.5, -0.5, 1. ]])
+
+ which now instead of the diagonal returns the scaling coefficients
+
+ >>> d
+ array([1.41421356, 1.41421356, 1.41421356])
+
+ Zero scaling coefficients are substituted with 1s, where scaling
+ has thus no effect, e.g.,
+
+ >>> G = np.array([[0, 0, 0], [0, 0, 1], [0, 1, 0]])
+ >>> G
+ array([[0, 0, 0],
+ [0, 0, 1],
+ [0, 1, 0]])
+ >>> L, d = csgraph.laplacian(G, return_diag=True, normed=True)
+ >>> L
+ array([[ 0., -0., -0.],
+ [-0., 1., -1.],
+ [-0., -1., 1.]])
+ >>> d
+ array([1., 1., 1.])
+
+ Only the symmetric normalization is implemented, resulting
+ in a symmetric Laplacian matrix if and only if its graph is symmetric
+ and has all non-negative degrees, like in the examples above.
+
+ The output Laplacian matrix is by default a dense array or a sparse
+ array or matrix inferring its class, shape, format, and dtype from
+ the input graph matrix:
+
+ >>> G = np.array([[0, 1, 1], [1, 0, 1], [1, 1, 0]]).astype(np.float32)
+ >>> G
+ array([[0., 1., 1.],
+ [1., 0., 1.],
+ [1., 1., 0.]], dtype=float32)
+ >>> csgraph.laplacian(G)
+ array([[ 2., -1., -1.],
+ [-1., 2., -1.],
+ [-1., -1., 2.]], dtype=float32)
+
+ but can alternatively be generated matrix-free as a LinearOperator:
+
+ >>> L = csgraph.laplacian(G, form="lo")
+ >>> L
+ <3x3 _CustomLinearOperator with dtype=float32>
+ >>> L(np.eye(3))
+ array([[ 2., -1., -1.],
+ [-1., 2., -1.],
+ [-1., -1., 2.]])
+
+ or as a lambda-function:
+
+ >>> L = csgraph.laplacian(G, form="function")
+ >>> L
+ . at 0x0000012AE6F5A598>
+ >>> L(np.eye(3))
+ array([[ 2., -1., -1.],
+ [-1., 2., -1.],
+ [-1., -1., 2.]])
+
+ The Laplacian matrix is used for
+ spectral data clustering and embedding
+ as well as for spectral graph partitioning.
+ Our final example illustrates the latter
+ for a noisy directed linear graph.
+
+ >>> from scipy.sparse import diags_array, random_array
+ >>> from scipy.sparse.linalg import lobpcg
+
+ Create a directed linear graph with ``N=35`` vertices
+ using a sparse adjacency matrix ``G``:
+
+ >>> N = 35
+ >>> G = diags_array(np.ones(N - 1), offsets=1, format="csr")
+
+ Fix a random seed ``rng`` and add a random sparse noise to the graph ``G``:
+
+ >>> rng = np.random.default_rng()
+ >>> G += 1e-2 * random_array((N, N), density=0.1, rng=rng)
+
+ Set initial approximations for eigenvectors:
+
+ >>> X = rng.random((N, 2))
+
+ The constant vector of ones is always a trivial eigenvector
+ of the non-normalized Laplacian to be filtered out:
+
+ >>> Y = np.ones((N, 1))
+
+ Alternating (1) the sign of the graph weights allows determining
+ labels for spectral max- and min- cuts in a single loop.
+ Since the graph is undirected, the option ``symmetrized=True``
+ must be used in the construction of the Laplacian.
+ The option ``normed=True`` cannot be used in (2) for the negative weights
+ here as the symmetric normalization evaluates square roots.
+ The option ``form="lo"`` in (2) is matrix-free, i.e., guarantees
+ a fixed memory footprint and read-only access to the graph.
+ Calling the eigenvalue solver ``lobpcg`` (3) computes the Fiedler vector
+ that determines the labels as the signs of its components in (5).
+ Since the sign in an eigenvector is not deterministic and can flip,
+ we fix the sign of the first component to be always +1 in (4).
+
+ >>> for cut in ["max", "min"]:
+ ... G = -G # 1.
+ ... L = csgraph.laplacian(G, symmetrized=True, form="lo") # 2.
+ ... _, eves = lobpcg(L, X, Y=Y, largest=False, tol=1e-2) # 3.
+ ... eves *= np.sign(eves[0, 0]) # 4.
+ ... print(cut + "-cut labels:\\n", 1 * (eves[:, 0]>0)) # 5.
+ max-cut labels:
+ [1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1]
+ min-cut labels:
+ [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
+
+ As anticipated for a (slightly noisy) linear graph,
+ the max-cut strips all the edges of the graph coloring all
+ odd vertices into one color and all even vertices into another one,
+ while the balanced min-cut partitions the graph
+ in the middle by deleting a single edge.
+ Both determined partitions are optimal.
+ """
+ is_pydata_sparse = is_pydata_spmatrix(csgraph)
+ if is_pydata_sparse:
+ pydata_sparse_cls = csgraph.__class__
+ csgraph = convert_pydata_sparse_to_scipy(csgraph)
+ if csgraph.ndim != 2 or csgraph.shape[0] != csgraph.shape[1]:
+ raise ValueError('csgraph must be a square matrix or array')
+
+ if normed and (
+ np.issubdtype(csgraph.dtype, np.signedinteger)
+ or np.issubdtype(csgraph.dtype, np.uint)
+ ):
+ csgraph = csgraph.astype(np.float64)
+
+ if form == "array":
+ create_lap = (
+ _laplacian_sparse if issparse(csgraph) else _laplacian_dense
+ )
+ else:
+ create_lap = (
+ _laplacian_sparse_flo
+ if issparse(csgraph)
+ else _laplacian_dense_flo
+ )
+
+ degree_axis = 1 if use_out_degree else 0
+
+ lap, d = create_lap(
+ csgraph,
+ normed=normed,
+ axis=degree_axis,
+ copy=copy,
+ form=form,
+ dtype=dtype,
+ symmetrized=symmetrized,
+ )
+ if is_pydata_sparse:
+ lap = pydata_sparse_cls.from_scipy_sparse(lap)
+ if return_diag:
+ return lap, d
+ return lap
+
+
+def _setdiag_dense(m, d):
+ step = len(d) + 1
+ m.flat[::step] = d
+
+
+def _laplace(m, d):
+ return lambda v: v * d[:, np.newaxis] - m @ v
+
+
+def _laplace_normed(m, d, nd):
+ laplace = _laplace(m, d)
+ return lambda v: nd[:, np.newaxis] * laplace(v * nd[:, np.newaxis])
+
+
+def _laplace_sym(m, d):
+ return (
+ lambda v: v * d[:, np.newaxis]
+ - m @ v
+ - np.transpose(np.conjugate(np.transpose(np.conjugate(v)) @ m))
+ )
+
+
+def _laplace_normed_sym(m, d, nd):
+ laplace_sym = _laplace_sym(m, d)
+ return lambda v: nd[:, np.newaxis] * laplace_sym(v * nd[:, np.newaxis])
+
+
+def _linearoperator(mv, shape, dtype):
+ return LinearOperator(matvec=mv, matmat=mv, shape=shape, dtype=dtype)
+
+
+def _laplacian_sparse_flo(graph, normed, axis, copy, form, dtype, symmetrized):
+ # The keyword argument `copy` is unused and has no effect here.
+ del copy
+
+ if dtype is None:
+ dtype = graph.dtype
+
+ graph_sum = np.asarray(graph.sum(axis=axis)).ravel()
+ graph_diagonal = graph.diagonal()
+ diag = graph_sum - graph_diagonal
+ if symmetrized:
+ graph_sum += np.asarray(graph.sum(axis=1 - axis)).ravel()
+ diag = graph_sum - graph_diagonal - graph_diagonal
+
+ if normed:
+ isolated_node_mask = diag == 0
+ w = np.where(isolated_node_mask, 1, np.sqrt(diag))
+ if symmetrized:
+ md = _laplace_normed_sym(graph, graph_sum, 1.0 / w)
+ else:
+ md = _laplace_normed(graph, graph_sum, 1.0 / w)
+ if form == "function":
+ return md, w.astype(dtype, copy=False)
+ elif form == "lo":
+ m = _linearoperator(md, shape=graph.shape, dtype=dtype)
+ return m, w.astype(dtype, copy=False)
+ else:
+ raise ValueError(f"Invalid form: {form!r}")
+ else:
+ if symmetrized:
+ md = _laplace_sym(graph, graph_sum)
+ else:
+ md = _laplace(graph, graph_sum)
+ if form == "function":
+ return md, diag.astype(dtype, copy=False)
+ elif form == "lo":
+ m = _linearoperator(md, shape=graph.shape, dtype=dtype)
+ return m, diag.astype(dtype, copy=False)
+ else:
+ raise ValueError(f"Invalid form: {form!r}")
+
+
+def _laplacian_sparse(graph, normed, axis, copy, form, dtype, symmetrized):
+ # The keyword argument `form` is unused and has no effect here.
+ del form
+
+ if dtype is None:
+ dtype = graph.dtype
+
+ needs_copy = False
+ if graph.format in ('lil', 'dok'):
+ m = graph.tocoo()
+ else:
+ m = graph
+ if copy:
+ needs_copy = True
+
+ if symmetrized:
+ m += m.T.conj()
+
+ w = np.asarray(m.sum(axis=axis)).ravel() - m.diagonal()
+ if normed:
+ m = m.tocoo(copy=needs_copy)
+ isolated_node_mask = (w == 0)
+ w = np.where(isolated_node_mask, 1, np.sqrt(w))
+ m.data /= w[m.row]
+ m.data /= w[m.col]
+ m.data *= -1
+ m.setdiag(1 - isolated_node_mask)
+ else:
+ if m.format == 'dia':
+ m = m.copy()
+ else:
+ m = m.tocoo(copy=needs_copy)
+ m.data *= -1
+ m.setdiag(w)
+
+ return m.astype(dtype, copy=False), w.astype(dtype)
+
+
+def _laplacian_dense_flo(graph, normed, axis, copy, form, dtype, symmetrized):
+
+ if copy:
+ m = np.array(graph)
+ else:
+ m = np.asarray(graph)
+
+ if dtype is None:
+ dtype = m.dtype
+
+ graph_sum = m.sum(axis=axis)
+ graph_diagonal = m.diagonal()
+ diag = graph_sum - graph_diagonal
+ if symmetrized:
+ graph_sum += m.sum(axis=1 - axis)
+ diag = graph_sum - graph_diagonal - graph_diagonal
+
+ if normed:
+ isolated_node_mask = diag == 0
+ w = np.where(isolated_node_mask, 1, np.sqrt(diag))
+ if symmetrized:
+ md = _laplace_normed_sym(m, graph_sum, 1.0 / w)
+ else:
+ md = _laplace_normed(m, graph_sum, 1.0 / w)
+ if form == "function":
+ return md, w.astype(dtype, copy=False)
+ elif form == "lo":
+ m = _linearoperator(md, shape=graph.shape, dtype=dtype)
+ return m, w.astype(dtype, copy=False)
+ else:
+ raise ValueError(f"Invalid form: {form!r}")
+ else:
+ if symmetrized:
+ md = _laplace_sym(m, graph_sum)
+ else:
+ md = _laplace(m, graph_sum)
+ if form == "function":
+ return md, diag.astype(dtype, copy=False)
+ elif form == "lo":
+ m = _linearoperator(md, shape=graph.shape, dtype=dtype)
+ return m, diag.astype(dtype, copy=False)
+ else:
+ raise ValueError(f"Invalid form: {form!r}")
+
+
+def _laplacian_dense(graph, normed, axis, copy, form, dtype, symmetrized):
+
+ if form != "array":
+ raise ValueError(f'{form!r} must be "array"')
+
+ if dtype is None:
+ dtype = graph.dtype
+
+ if copy:
+ m = np.array(graph)
+ else:
+ m = np.asarray(graph)
+
+ if dtype is None:
+ dtype = m.dtype
+
+ if symmetrized:
+ m += m.T.conj()
+ np.fill_diagonal(m, 0)
+ w = m.sum(axis=axis)
+ if normed:
+ isolated_node_mask = (w == 0)
+ w = np.where(isolated_node_mask, 1, np.sqrt(w))
+ m /= w
+ m /= w[:, np.newaxis]
+ m *= -1
+ _setdiag_dense(m, 1 - isolated_node_mask)
+ else:
+ m *= -1
+ _setdiag_dense(m, w)
+
+ return m.astype(dtype, copy=False), w.astype(dtype, copy=False)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/_validation.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/_validation.py
new file mode 100644
index 0000000000000000000000000000000000000000..6eb9ce811b73e751ebb1cd6b226b73f7bcfe7ceb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/_validation.py
@@ -0,0 +1,66 @@
+import numpy as np
+from scipy.sparse import issparse
+from scipy.sparse._sputils import convert_pydata_sparse_to_scipy
+from scipy.sparse.csgraph._tools import (
+ csgraph_to_dense, csgraph_from_dense,
+ csgraph_masked_from_dense, csgraph_from_masked
+)
+
+DTYPE = np.float64
+
+
+def validate_graph(csgraph, directed, dtype=DTYPE,
+ csr_output=True, dense_output=True,
+ copy_if_dense=False, copy_if_sparse=False,
+ null_value_in=0, null_value_out=np.inf,
+ infinity_null=True, nan_null=True):
+ """Routine for validation and conversion of csgraph inputs"""
+ if not (csr_output or dense_output):
+ raise ValueError("Internal: dense or csr output must be true")
+
+ accept_fv = [null_value_in]
+ if infinity_null:
+ accept_fv.append(np.inf)
+ if nan_null:
+ accept_fv.append(np.nan)
+ csgraph = convert_pydata_sparse_to_scipy(csgraph, accept_fv=accept_fv)
+
+ # if undirected and csc storage, then transposing in-place
+ # is quicker than later converting to csr.
+ if (not directed) and issparse(csgraph) and csgraph.format == "csc":
+ csgraph = csgraph.T
+
+ if issparse(csgraph):
+ if csr_output:
+ csgraph = csgraph.tocsr(copy=copy_if_sparse).astype(DTYPE, copy=False)
+ else:
+ csgraph = csgraph_to_dense(csgraph, null_value=null_value_out)
+ elif np.ma.isMaskedArray(csgraph):
+ if dense_output:
+ mask = csgraph.mask
+ csgraph = np.array(csgraph.data, dtype=DTYPE, copy=copy_if_dense)
+ csgraph[mask] = null_value_out
+ else:
+ csgraph = csgraph_from_masked(csgraph)
+ else:
+ if dense_output:
+ csgraph = csgraph_masked_from_dense(csgraph,
+ copy=copy_if_dense,
+ null_value=null_value_in,
+ nan_null=nan_null,
+ infinity_null=infinity_null)
+ mask = csgraph.mask
+ csgraph = np.asarray(csgraph.data, dtype=DTYPE)
+ csgraph[mask] = null_value_out
+ else:
+ csgraph = csgraph_from_dense(csgraph, null_value=null_value_in,
+ infinity_null=infinity_null,
+ nan_null=nan_null)
+
+ if csgraph.ndim != 2:
+ raise ValueError("compressed-sparse graph must be 2-D")
+
+ if csgraph.shape[0] != csgraph.shape[1]:
+ raise ValueError("compressed-sparse graph must be shape (N, N)")
+
+ return csgraph
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_conversions.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_conversions.py
new file mode 100644
index 0000000000000000000000000000000000000000..65f141e5b371367018a6e9985f8325850d8972da
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_conversions.py
@@ -0,0 +1,61 @@
+import numpy as np
+from numpy.testing import assert_array_almost_equal
+from scipy.sparse import csr_array
+from scipy.sparse.csgraph import csgraph_from_dense, csgraph_to_dense
+
+
+def test_csgraph_from_dense():
+ np.random.seed(1234)
+ G = np.random.random((10, 10))
+ some_nulls = (G < 0.4)
+ all_nulls = (G < 0.8)
+
+ for null_value in [0, np.nan, np.inf]:
+ G[all_nulls] = null_value
+ with np.errstate(invalid="ignore"):
+ G_csr = csgraph_from_dense(G, null_value=0)
+
+ G[all_nulls] = 0
+ assert_array_almost_equal(G, G_csr.toarray())
+
+ for null_value in [np.nan, np.inf]:
+ G[all_nulls] = 0
+ G[some_nulls] = null_value
+ with np.errstate(invalid="ignore"):
+ G_csr = csgraph_from_dense(G, null_value=0)
+
+ G[all_nulls] = 0
+ assert_array_almost_equal(G, G_csr.toarray())
+
+
+def test_csgraph_to_dense():
+ np.random.seed(1234)
+ G = np.random.random((10, 10))
+ nulls = (G < 0.8)
+ G[nulls] = np.inf
+
+ G_csr = csgraph_from_dense(G)
+
+ for null_value in [0, 10, -np.inf, np.inf]:
+ G[nulls] = null_value
+ assert_array_almost_equal(G, csgraph_to_dense(G_csr, null_value))
+
+
+def test_multiple_edges():
+ # create a random square matrix with an even number of elements
+ np.random.seed(1234)
+ X = np.random.random((10, 10))
+ Xcsr = csr_array(X)
+
+ # now double-up every other column
+ Xcsr.indices[::2] = Xcsr.indices[1::2]
+
+ # normal sparse toarray() will sum the duplicated edges
+ Xdense = Xcsr.toarray()
+ assert_array_almost_equal(Xdense[:, 1::2],
+ X[:, ::2] + X[:, 1::2])
+
+ # csgraph_to_dense chooses the minimum of each duplicated edge
+ Xdense = csgraph_to_dense(Xcsr)
+ assert_array_almost_equal(Xdense[:, 1::2],
+ np.minimum(X[:, ::2], X[:, 1::2]))
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_graph_laplacian.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_graph_laplacian.py
new file mode 100644
index 0000000000000000000000000000000000000000..0ed5e2edf92ef0cacc819fcbd06bc6d4e195cb44
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_graph_laplacian.py
@@ -0,0 +1,368 @@
+import pytest
+import numpy as np
+from numpy.testing import assert_allclose
+from pytest import raises as assert_raises
+from scipy import sparse
+
+from scipy.sparse import csgraph
+from scipy._lib._util import np_long, np_ulong
+
+
+def check_int_type(mat):
+ return np.issubdtype(mat.dtype, np.signedinteger) or np.issubdtype(
+ mat.dtype, np_ulong
+ )
+
+
+def test_laplacian_value_error():
+ for t in int, float, complex:
+ for m in ([1, 1],
+ [[[1]]],
+ [[1, 2, 3], [4, 5, 6]],
+ [[1, 2], [3, 4], [5, 5]]):
+ A = np.array(m, dtype=t)
+ assert_raises(ValueError, csgraph.laplacian, A)
+
+
+def _explicit_laplacian(x, normed=False):
+ if sparse.issparse(x):
+ x = x.toarray()
+ x = np.asarray(x)
+ y = -1.0 * x
+ for j in range(y.shape[0]):
+ y[j,j] = x[j,j+1:].sum() + x[j,:j].sum()
+ if normed:
+ d = np.diag(y).copy()
+ d[d == 0] = 1.0
+ y /= d[:,None]**.5
+ y /= d[None,:]**.5
+ return y
+
+
+def _check_symmetric_graph_laplacian(mat, normed, copy=True):
+ if not hasattr(mat, 'shape'):
+ mat = eval(mat, dict(np=np, sparse=sparse))
+
+ if sparse.issparse(mat):
+ sp_mat = mat
+ mat = sp_mat.toarray()
+ else:
+ sp_mat = sparse.csr_array(mat)
+
+ mat_copy = np.copy(mat)
+ sp_mat_copy = sparse.csr_array(sp_mat, copy=True)
+
+ n_nodes = mat.shape[0]
+ explicit_laplacian = _explicit_laplacian(mat, normed=normed)
+ laplacian = csgraph.laplacian(mat, normed=normed, copy=copy)
+ sp_laplacian = csgraph.laplacian(sp_mat, normed=normed,
+ copy=copy)
+
+ if copy:
+ assert_allclose(mat, mat_copy)
+ _assert_allclose_sparse(sp_mat, sp_mat_copy)
+ else:
+ if not (normed and check_int_type(mat)):
+ assert_allclose(laplacian, mat)
+ if sp_mat.format == 'coo':
+ _assert_allclose_sparse(sp_laplacian, sp_mat)
+
+ assert_allclose(laplacian, sp_laplacian.toarray())
+
+ for tested in [laplacian, sp_laplacian.toarray()]:
+ if not normed:
+ assert_allclose(tested.sum(axis=0), np.zeros(n_nodes))
+ assert_allclose(tested.T, tested)
+ assert_allclose(tested, explicit_laplacian)
+
+
+def test_symmetric_graph_laplacian():
+ symmetric_mats = (
+ 'np.arange(10) * np.arange(10)[:, np.newaxis]',
+ 'np.ones((7, 7))',
+ 'np.eye(19)',
+ 'sparse.diags([1, 1], [-1, 1], shape=(4, 4))',
+ 'sparse.diags([1, 1], [-1, 1], shape=(4, 4)).toarray()',
+ 'sparse.diags([1, 1], [-1, 1], shape=(4, 4)).todense()',
+ 'np.vander(np.arange(4)) + np.vander(np.arange(4)).T'
+ )
+ for mat in symmetric_mats:
+ for normed in True, False:
+ for copy in True, False:
+ _check_symmetric_graph_laplacian(mat, normed, copy)
+
+
+def _assert_allclose_sparse(a, b, **kwargs):
+ # helper function that can deal with sparse matrices
+ if sparse.issparse(a):
+ a = a.toarray()
+ if sparse.issparse(b):
+ b = b.toarray()
+ assert_allclose(a, b, **kwargs)
+
+
+def _check_laplacian_dtype_none(
+ A, desired_L, desired_d, normed, use_out_degree, copy, dtype, arr_type
+):
+ mat = arr_type(A, dtype=dtype)
+ L, d = csgraph.laplacian(
+ mat,
+ normed=normed,
+ return_diag=True,
+ use_out_degree=use_out_degree,
+ copy=copy,
+ dtype=None,
+ )
+ if normed and check_int_type(mat):
+ assert L.dtype == np.float64
+ assert d.dtype == np.float64
+ _assert_allclose_sparse(L, desired_L, atol=1e-12)
+ _assert_allclose_sparse(d, desired_d, atol=1e-12)
+ else:
+ assert L.dtype == dtype
+ assert d.dtype == dtype
+ desired_L = np.asarray(desired_L).astype(dtype)
+ desired_d = np.asarray(desired_d).astype(dtype)
+ _assert_allclose_sparse(L, desired_L, atol=1e-12)
+ _assert_allclose_sparse(d, desired_d, atol=1e-12)
+
+ if not copy:
+ if not (normed and check_int_type(mat)):
+ if type(mat) is np.ndarray:
+ assert_allclose(L, mat)
+ elif mat.format == "coo":
+ _assert_allclose_sparse(L, mat)
+
+
+def _check_laplacian_dtype(
+ A, desired_L, desired_d, normed, use_out_degree, copy, dtype, arr_type
+):
+ mat = arr_type(A, dtype=dtype)
+ L, d = csgraph.laplacian(
+ mat,
+ normed=normed,
+ return_diag=True,
+ use_out_degree=use_out_degree,
+ copy=copy,
+ dtype=dtype,
+ )
+ assert L.dtype == dtype
+ assert d.dtype == dtype
+ desired_L = np.asarray(desired_L).astype(dtype)
+ desired_d = np.asarray(desired_d).astype(dtype)
+ _assert_allclose_sparse(L, desired_L, atol=1e-12)
+ _assert_allclose_sparse(d, desired_d, atol=1e-12)
+
+ if not copy:
+ if not (normed and check_int_type(mat)):
+ if type(mat) is np.ndarray:
+ assert_allclose(L, mat)
+ elif mat.format == 'coo':
+ _assert_allclose_sparse(L, mat)
+
+
+INT_DTYPES = (np.intc, np_long, np.longlong)
+REAL_DTYPES = (np.float32, np.float64, np.longdouble)
+COMPLEX_DTYPES = (np.complex64, np.complex128, np.clongdouble)
+DTYPES = INT_DTYPES + REAL_DTYPES + COMPLEX_DTYPES
+
+
+@pytest.mark.parametrize("dtype", DTYPES)
+@pytest.mark.parametrize("arr_type", [np.array,
+ sparse.csr_matrix,
+ sparse.coo_matrix,
+ sparse.csr_array,
+ sparse.coo_array])
+@pytest.mark.parametrize("copy", [True, False])
+@pytest.mark.parametrize("normed", [True, False])
+@pytest.mark.parametrize("use_out_degree", [True, False])
+def test_asymmetric_laplacian(use_out_degree, normed,
+ copy, dtype, arr_type):
+ # adjacency matrix
+ A = [[0, 1, 0],
+ [4, 2, 0],
+ [0, 0, 0]]
+ A = arr_type(np.array(A), dtype=dtype)
+ A_copy = A.copy()
+
+ if not normed and use_out_degree:
+ # Laplacian matrix using out-degree
+ L = [[1, -1, 0],
+ [-4, 4, 0],
+ [0, 0, 0]]
+ d = [1, 4, 0]
+
+ if normed and use_out_degree:
+ # normalized Laplacian matrix using out-degree
+ L = [[1, -0.5, 0],
+ [-2, 1, 0],
+ [0, 0, 0]]
+ d = [1, 2, 1]
+
+ if not normed and not use_out_degree:
+ # Laplacian matrix using in-degree
+ L = [[4, -1, 0],
+ [-4, 1, 0],
+ [0, 0, 0]]
+ d = [4, 1, 0]
+
+ if normed and not use_out_degree:
+ # normalized Laplacian matrix using in-degree
+ L = [[1, -0.5, 0],
+ [-2, 1, 0],
+ [0, 0, 0]]
+ d = [2, 1, 1]
+
+ _check_laplacian_dtype_none(
+ A,
+ L,
+ d,
+ normed=normed,
+ use_out_degree=use_out_degree,
+ copy=copy,
+ dtype=dtype,
+ arr_type=arr_type,
+ )
+
+ _check_laplacian_dtype(
+ A_copy,
+ L,
+ d,
+ normed=normed,
+ use_out_degree=use_out_degree,
+ copy=copy,
+ dtype=dtype,
+ arr_type=arr_type,
+ )
+
+
+@pytest.mark.parametrize("fmt", ['csr', 'csc', 'coo', 'lil',
+ 'dok', 'dia', 'bsr'])
+@pytest.mark.parametrize("normed", [True, False])
+@pytest.mark.parametrize("copy", [True, False])
+def test_sparse_formats(fmt, normed, copy):
+ mat = sparse.diags_array([1, 1], offsets=[-1, 1], shape=(4, 4), format=fmt)
+ _check_symmetric_graph_laplacian(mat, normed, copy)
+
+
+@pytest.mark.parametrize(
+ "arr_type", [np.asarray,
+ sparse.csr_matrix,
+ sparse.coo_matrix,
+ sparse.csr_array,
+ sparse.coo_array]
+)
+@pytest.mark.parametrize("form", ["array", "function", "lo"])
+def test_laplacian_symmetrized(arr_type, form):
+ # adjacency matrix
+ n = 3
+ mat = arr_type(np.arange(n * n).reshape(n, n))
+ L_in, d_in = csgraph.laplacian(
+ mat,
+ return_diag=True,
+ form=form,
+ )
+ L_out, d_out = csgraph.laplacian(
+ mat,
+ return_diag=True,
+ use_out_degree=True,
+ form=form,
+ )
+ Ls, ds = csgraph.laplacian(
+ mat,
+ return_diag=True,
+ symmetrized=True,
+ form=form,
+ )
+ Ls_normed, ds_normed = csgraph.laplacian(
+ mat,
+ return_diag=True,
+ symmetrized=True,
+ normed=True,
+ form=form,
+ )
+ mat += mat.T
+ Lss, dss = csgraph.laplacian(mat, return_diag=True, form=form)
+ Lss_normed, dss_normed = csgraph.laplacian(
+ mat,
+ return_diag=True,
+ normed=True,
+ form=form,
+ )
+
+ assert_allclose(ds, d_in + d_out)
+ assert_allclose(ds, dss)
+ assert_allclose(ds_normed, dss_normed)
+
+ d = {}
+ for L in ["L_in", "L_out", "Ls", "Ls_normed", "Lss", "Lss_normed"]:
+ if form == "array":
+ d[L] = eval(L)
+ else:
+ d[L] = eval(L)(np.eye(n, dtype=mat.dtype))
+
+ _assert_allclose_sparse(d["Ls"], d["L_in"] + d["L_out"].T)
+ _assert_allclose_sparse(d["Ls"], d["Lss"])
+ _assert_allclose_sparse(d["Ls_normed"], d["Lss_normed"])
+
+
+@pytest.mark.parametrize(
+ "arr_type", [np.asarray,
+ sparse.csr_matrix,
+ sparse.coo_matrix,
+ sparse.csr_array,
+ sparse.coo_array]
+)
+@pytest.mark.parametrize("dtype", DTYPES)
+@pytest.mark.parametrize("normed", [True, False])
+@pytest.mark.parametrize("symmetrized", [True, False])
+@pytest.mark.parametrize("use_out_degree", [True, False])
+@pytest.mark.parametrize("form", ["function", "lo"])
+def test_format(dtype, arr_type, normed, symmetrized, use_out_degree, form):
+ n = 3
+ mat = [[0, 1, 0], [4, 2, 0], [0, 0, 0]]
+ mat = arr_type(np.array(mat), dtype=dtype)
+ Lo, do = csgraph.laplacian(
+ mat,
+ return_diag=True,
+ normed=normed,
+ symmetrized=symmetrized,
+ use_out_degree=use_out_degree,
+ dtype=dtype,
+ )
+ La, da = csgraph.laplacian(
+ mat,
+ return_diag=True,
+ normed=normed,
+ symmetrized=symmetrized,
+ use_out_degree=use_out_degree,
+ dtype=dtype,
+ form="array",
+ )
+ assert_allclose(do, da)
+ _assert_allclose_sparse(Lo, La)
+
+ L, d = csgraph.laplacian(
+ mat,
+ return_diag=True,
+ normed=normed,
+ symmetrized=symmetrized,
+ use_out_degree=use_out_degree,
+ dtype=dtype,
+ form=form,
+ )
+ assert_allclose(d, do)
+ assert d.dtype == dtype
+ Lm = L(np.eye(n, dtype=mat.dtype)).astype(dtype)
+ _assert_allclose_sparse(Lm, Lo, rtol=2e-7, atol=2e-7)
+ x = np.arange(6).reshape(3, 2)
+ if not (normed and dtype in INT_DTYPES):
+ assert_allclose(L(x), Lo @ x)
+ else:
+ # Normalized Lo is casted to integer, but L() is not
+ pass
+
+
+def test_format_error_message():
+ with pytest.raises(ValueError, match="Invalid form: 'toto'"):
+ _ = csgraph.laplacian(np.eye(1), form='toto')
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_matching.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_matching.py
new file mode 100644
index 0000000000000000000000000000000000000000..8477861d3e563c43379c615ec0913f47a4349abd
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_matching.py
@@ -0,0 +1,295 @@
+from itertools import product
+
+import numpy as np
+from numpy.testing import assert_array_equal, assert_equal
+import pytest
+
+from scipy.sparse import csr_array, diags_array
+from scipy.sparse.csgraph import (
+ maximum_bipartite_matching, min_weight_full_bipartite_matching
+)
+
+
+def test_maximum_bipartite_matching_raises_on_dense_input():
+ with pytest.raises(TypeError):
+ graph = np.array([[0, 1], [0, 0]])
+ maximum_bipartite_matching(graph)
+
+
+def test_maximum_bipartite_matching_empty_graph():
+ graph = csr_array((0, 0))
+ x = maximum_bipartite_matching(graph, perm_type='row')
+ y = maximum_bipartite_matching(graph, perm_type='column')
+ expected_matching = np.array([])
+ assert_array_equal(expected_matching, x)
+ assert_array_equal(expected_matching, y)
+
+
+def test_maximum_bipartite_matching_empty_left_partition():
+ graph = csr_array((2, 0))
+ x = maximum_bipartite_matching(graph, perm_type='row')
+ y = maximum_bipartite_matching(graph, perm_type='column')
+ assert_array_equal(np.array([]), x)
+ assert_array_equal(np.array([-1, -1]), y)
+
+
+def test_maximum_bipartite_matching_empty_right_partition():
+ graph = csr_array((0, 3))
+ x = maximum_bipartite_matching(graph, perm_type='row')
+ y = maximum_bipartite_matching(graph, perm_type='column')
+ assert_array_equal(np.array([-1, -1, -1]), x)
+ assert_array_equal(np.array([]), y)
+
+
+def test_maximum_bipartite_matching_graph_with_no_edges():
+ graph = csr_array((2, 2))
+ x = maximum_bipartite_matching(graph, perm_type='row')
+ y = maximum_bipartite_matching(graph, perm_type='column')
+ assert_array_equal(np.array([-1, -1]), x)
+ assert_array_equal(np.array([-1, -1]), y)
+
+
+def test_maximum_bipartite_matching_graph_that_causes_augmentation():
+ # In this graph, column 1 is initially assigned to row 1, but it should be
+ # reassigned to make room for row 2.
+ graph = csr_array([[1, 1], [1, 0]])
+ x = maximum_bipartite_matching(graph, perm_type='column')
+ y = maximum_bipartite_matching(graph, perm_type='row')
+ expected_matching = np.array([1, 0])
+ assert_array_equal(expected_matching, x)
+ assert_array_equal(expected_matching, y)
+
+
+def test_maximum_bipartite_matching_graph_with_more_rows_than_columns():
+ graph = csr_array([[1, 1], [1, 0], [0, 1]])
+ x = maximum_bipartite_matching(graph, perm_type='column')
+ y = maximum_bipartite_matching(graph, perm_type='row')
+ assert_array_equal(np.array([0, -1, 1]), x)
+ assert_array_equal(np.array([0, 2]), y)
+
+
+def test_maximum_bipartite_matching_graph_with_more_columns_than_rows():
+ graph = csr_array([[1, 1, 0], [0, 0, 1]])
+ x = maximum_bipartite_matching(graph, perm_type='column')
+ y = maximum_bipartite_matching(graph, perm_type='row')
+ assert_array_equal(np.array([0, 2]), x)
+ assert_array_equal(np.array([0, -1, 1]), y)
+
+
+def test_maximum_bipartite_matching_explicit_zeros_count_as_edges():
+ data = [0, 0]
+ indices = [1, 0]
+ indptr = [0, 1, 2]
+ graph = csr_array((data, indices, indptr), shape=(2, 2))
+ x = maximum_bipartite_matching(graph, perm_type='row')
+ y = maximum_bipartite_matching(graph, perm_type='column')
+ expected_matching = np.array([1, 0])
+ assert_array_equal(expected_matching, x)
+ assert_array_equal(expected_matching, y)
+
+
+def test_maximum_bipartite_matching_feasibility_of_result():
+ # This is a regression test for GitHub issue #11458
+ data = np.ones(50, dtype=int)
+ indices = [11, 12, 19, 22, 23, 5, 22, 3, 8, 10, 5, 6, 11, 12, 13, 5, 13,
+ 14, 20, 22, 3, 15, 3, 13, 14, 11, 12, 19, 22, 23, 5, 22, 3, 8,
+ 10, 5, 6, 11, 12, 13, 5, 13, 14, 20, 22, 3, 15, 3, 13, 14]
+ indptr = [0, 5, 7, 10, 10, 15, 20, 22, 22, 23, 25, 30, 32, 35, 35, 40, 45,
+ 47, 47, 48, 50]
+ graph = csr_array((data, indices, indptr), shape=(20, 25))
+ x = maximum_bipartite_matching(graph, perm_type='row')
+ y = maximum_bipartite_matching(graph, perm_type='column')
+ assert (x != -1).sum() == 13
+ assert (y != -1).sum() == 13
+ # Ensure that each element of the matching is in fact an edge in the graph.
+ for u, v in zip(range(graph.shape[0]), y):
+ if v != -1:
+ assert graph[u, v]
+ for u, v in zip(x, range(graph.shape[1])):
+ if u != -1:
+ assert graph[u, v]
+
+
+def test_matching_large_random_graph_with_one_edge_incident_to_each_vertex():
+ np.random.seed(42)
+ A = diags_array(np.ones(25), offsets=0, format='csr')
+ rand_perm = np.random.permutation(25)
+ rand_perm2 = np.random.permutation(25)
+
+ Rrow = np.arange(25)
+ Rcol = rand_perm
+ Rdata = np.ones(25, dtype=int)
+ Rmat = csr_array((Rdata, (Rrow, Rcol)))
+
+ Crow = rand_perm2
+ Ccol = np.arange(25)
+ Cdata = np.ones(25, dtype=int)
+ Cmat = csr_array((Cdata, (Crow, Ccol)))
+ # Randomly permute identity matrix
+ B = Rmat @ A @ Cmat
+
+ # Row permute
+ perm = maximum_bipartite_matching(B, perm_type='row')
+ Rrow = np.arange(25)
+ Rcol = perm
+ Rdata = np.ones(25, dtype=int)
+ Rmat = csr_array((Rdata, (Rrow, Rcol)))
+ C1 = Rmat @ B
+
+ # Column permute
+ perm2 = maximum_bipartite_matching(B, perm_type='column')
+ Crow = perm2
+ Ccol = np.arange(25)
+ Cdata = np.ones(25, dtype=int)
+ Cmat = csr_array((Cdata, (Crow, Ccol)))
+ C2 = B @ Cmat
+
+ # Should get identity matrix back
+ assert_equal(any(C1.diagonal() == 0), False)
+ assert_equal(any(C2.diagonal() == 0), False)
+
+
+@pytest.mark.parametrize('num_rows,num_cols', [(0, 0), (2, 0), (0, 3)])
+def test_min_weight_full_matching_trivial_graph(num_rows, num_cols):
+ biadjacency = csr_array((num_cols, num_rows))
+ row_ind, col_ind = min_weight_full_bipartite_matching(biadjacency)
+ assert len(row_ind) == 0
+ assert len(col_ind) == 0
+
+
+@pytest.mark.parametrize('biadjacency',
+ [
+ [[1, 1, 1], [1, 0, 0], [1, 0, 0]],
+ [[1, 1, 1], [0, 0, 1], [0, 0, 1]],
+ [[1, 0, 0, 1], [1, 1, 0, 1], [0, 0, 0, 0]],
+ [[1, 0, 0], [2, 0, 0]],
+ [[0, 1, 0], [0, 2, 0]],
+ [[1, 0], [2, 0], [5, 0]]
+ ])
+def test_min_weight_full_matching_infeasible_problems(biadjacency):
+ with pytest.raises(ValueError):
+ min_weight_full_bipartite_matching(csr_array(biadjacency))
+
+
+def test_min_weight_full_matching_large_infeasible():
+ # Regression test for GitHub issue #17269
+ a = np.asarray([
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.001],
+ [0.0, 0.11687445, 0.0, 0.0, 0.01319788, 0.07509257, 0.0,
+ 0.0, 0.0, 0.74228317, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.81087935, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.8408466, 0.0, 0.0, 0.0, 0.0, 0.01194389,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.82994211, 0.0, 0.0, 0.0, 0.11468516, 0.0, 0.0, 0.0,
+ 0.11173505, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.0, 0.0],
+ [0.18796507, 0.0, 0.04002318, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75883335,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.71545464, 0.0, 0.0, 0.0, 0.0, 0.0, 0.02748488,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.78470564, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.14829198,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.10870609, 0.0, 0.0, 0.0, 0.8918677, 0.0, 0.0, 0.0, 0.06306644,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+ 0.63844085, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.7442354, 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.09850549, 0.0, 0.0, 0.18638258,
+ 0.2769244, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.73182464, 0.0, 0.0, 0.46443561,
+ 0.38589284, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
+ [0.29510278, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.09666032, 0.0,
+ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
+ ])
+ with pytest.raises(ValueError, match='no full matching exists'):
+ min_weight_full_bipartite_matching(csr_array(a))
+
+
+@pytest.mark.thread_unsafe
+def test_explicit_zero_causes_warning():
+ with pytest.warns(UserWarning):
+ biadjacency = csr_array(((2, 0, 3), (0, 1, 1), (0, 2, 3)))
+ min_weight_full_bipartite_matching(biadjacency)
+
+
+# General test for linear sum assignment solvers to make it possible to rely
+# on the same tests for scipy.optimize.linear_sum_assignment.
+def linear_sum_assignment_assertions(
+ solver, array_type, sign, test_case
+):
+ cost_matrix, expected_cost = test_case
+ maximize = sign == -1
+ cost_matrix = sign * array_type(cost_matrix)
+ expected_cost = sign * np.array(expected_cost)
+
+ row_ind, col_ind = solver(cost_matrix, maximize=maximize)
+ assert_array_equal(row_ind, np.sort(row_ind))
+ assert_array_equal(expected_cost,
+ np.array(cost_matrix[row_ind, col_ind]).flatten())
+
+ cost_matrix = cost_matrix.T
+ row_ind, col_ind = solver(cost_matrix, maximize=maximize)
+ assert_array_equal(row_ind, np.sort(row_ind))
+ assert_array_equal(np.sort(expected_cost),
+ np.sort(np.array(
+ cost_matrix[row_ind, col_ind])).flatten())
+
+
+linear_sum_assignment_test_cases = product(
+ [-1, 1],
+ [
+ # Square
+ ([[400, 150, 400],
+ [400, 450, 600],
+ [300, 225, 300]],
+ [150, 400, 300]),
+
+ # Rectangular variant
+ ([[400, 150, 400, 1],
+ [400, 450, 600, 2],
+ [300, 225, 300, 3]],
+ [150, 2, 300]),
+
+ ([[10, 10, 8],
+ [9, 8, 1],
+ [9, 7, 4]],
+ [10, 1, 7]),
+
+ # Square
+ ([[10, 10, 8, 11],
+ [9, 8, 1, 1],
+ [9, 7, 4, 10]],
+ [10, 1, 4]),
+
+ # Rectangular variant
+ ([[10, float("inf"), float("inf")],
+ [float("inf"), float("inf"), 1],
+ [float("inf"), 7, float("inf")]],
+ [10, 1, 7])
+ ])
+
+
+@pytest.mark.parametrize('sign,test_case', linear_sum_assignment_test_cases)
+def test_min_weight_full_matching_small_inputs(sign, test_case):
+ linear_sum_assignment_assertions(
+ min_weight_full_bipartite_matching, csr_array, sign, test_case)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_reordering.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_reordering.py
new file mode 100644
index 0000000000000000000000000000000000000000..add76cdc29c39c079f386a6ca73075bb90b0a6e8
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_reordering.py
@@ -0,0 +1,70 @@
+import numpy as np
+from numpy.testing import assert_equal
+from scipy.sparse.csgraph import reverse_cuthill_mckee, structural_rank
+from scipy.sparse import csc_array, csr_array, coo_array
+
+
+def test_graph_reverse_cuthill_mckee():
+ A = np.array([[1, 0, 0, 0, 1, 0, 0, 0],
+ [0, 1, 1, 0, 0, 1, 0, 1],
+ [0, 1, 1, 0, 1, 0, 0, 0],
+ [0, 0, 0, 1, 0, 0, 1, 0],
+ [1, 0, 1, 0, 1, 0, 0, 0],
+ [0, 1, 0, 0, 0, 1, 0, 1],
+ [0, 0, 0, 1, 0, 0, 1, 0],
+ [0, 1, 0, 0, 0, 1, 0, 1]], dtype=int)
+
+ graph = csr_array(A)
+ perm = reverse_cuthill_mckee(graph)
+ correct_perm = np.array([6, 3, 7, 5, 1, 2, 4, 0])
+ assert_equal(perm, correct_perm)
+
+ # Test int64 indices input
+ graph.indices = graph.indices.astype('int64')
+ graph.indptr = graph.indptr.astype('int64')
+ perm = reverse_cuthill_mckee(graph, True)
+ assert_equal(perm, correct_perm)
+
+
+def test_graph_reverse_cuthill_mckee_ordering():
+ data = np.ones(63,dtype=int)
+ rows = np.array([0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2,
+ 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5,
+ 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9,
+ 9, 10, 10, 10, 10, 10, 11, 11, 11, 11,
+ 12, 12, 12, 13, 13, 13, 13, 14, 14, 14,
+ 14, 15, 15, 15, 15, 15])
+ cols = np.array([0, 2, 5, 8, 10, 1, 3, 9, 11, 0, 2,
+ 7, 10, 1, 3, 11, 4, 6, 12, 14, 0, 7, 13,
+ 15, 4, 6, 14, 2, 5, 7, 15, 0, 8, 10, 13,
+ 1, 9, 11, 0, 2, 8, 10, 15, 1, 3, 9, 11,
+ 4, 12, 14, 5, 8, 13, 15, 4, 6, 12, 14,
+ 5, 7, 10, 13, 15])
+ graph = csr_array((data, (rows,cols)))
+ perm = reverse_cuthill_mckee(graph)
+ correct_perm = np.array([12, 14, 4, 6, 10, 8, 2, 15,
+ 0, 13, 7, 5, 9, 11, 1, 3])
+ assert_equal(perm, correct_perm)
+
+
+def test_graph_structural_rank():
+ # Test square matrix #1
+ A = csc_array([[1, 1, 0],
+ [1, 0, 1],
+ [0, 1, 0]])
+ assert_equal(structural_rank(A), 3)
+
+ # Test square matrix #2
+ rows = np.array([0,0,0,0,0,1,1,2,2,3,3,3,3,3,3,4,4,5,5,6,6,7,7])
+ cols = np.array([0,1,2,3,4,2,5,2,6,0,1,3,5,6,7,4,5,5,6,2,6,2,4])
+ data = np.ones_like(rows)
+ B = coo_array((data,(rows,cols)), shape=(8,8))
+ assert_equal(structural_rank(B), 6)
+
+ #Test non-square matrix
+ C = csc_array([[1, 0, 2, 0],
+ [2, 0, 4, 0]])
+ assert_equal(structural_rank(C), 2)
+
+ #Test tall matrix
+ assert_equal(structural_rank(C.T), 2)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_shortest_path.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_shortest_path.py
new file mode 100644
index 0000000000000000000000000000000000000000..ba50f760e750ce1dbdec3624c2ab985fca1af7d1
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_shortest_path.py
@@ -0,0 +1,484 @@
+from io import StringIO
+import warnings
+import numpy as np
+from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_allclose
+from pytest import raises as assert_raises
+from scipy.sparse.csgraph import (shortest_path, dijkstra, johnson,
+ bellman_ford, construct_dist_matrix, yen,
+ NegativeCycleError)
+import scipy.sparse
+from scipy.io import mmread
+import pytest
+
+directed_G = np.array([[0, 3, 3, 0, 0],
+ [0, 0, 0, 2, 4],
+ [0, 0, 0, 0, 0],
+ [1, 0, 0, 0, 0],
+ [2, 0, 0, 2, 0]], dtype=float)
+
+undirected_G = np.array([[0, 3, 3, 1, 2],
+ [3, 0, 0, 2, 4],
+ [3, 0, 0, 0, 0],
+ [1, 2, 0, 0, 2],
+ [2, 4, 0, 2, 0]], dtype=float)
+
+unweighted_G = (directed_G > 0).astype(float)
+
+directed_SP = [[0, 3, 3, 5, 7],
+ [3, 0, 6, 2, 4],
+ [np.inf, np.inf, 0, np.inf, np.inf],
+ [1, 4, 4, 0, 8],
+ [2, 5, 5, 2, 0]]
+
+directed_2SP_0_to_3 = [[-9999, 0, -9999, 1, -9999],
+ [-9999, 0, -9999, 4, 1]]
+
+directed_sparse_zero_G = scipy.sparse.csr_array(
+ (
+ [0, 1, 2, 3, 1],
+ ([0, 1, 2, 3, 4], [1, 2, 0, 4, 3]),
+ ),
+ shape=(5, 5),
+)
+
+directed_sparse_zero_SP = [[0, 0, 1, np.inf, np.inf],
+ [3, 0, 1, np.inf, np.inf],
+ [2, 2, 0, np.inf, np.inf],
+ [np.inf, np.inf, np.inf, 0, 3],
+ [np.inf, np.inf, np.inf, 1, 0]]
+
+undirected_sparse_zero_G = scipy.sparse.csr_array(
+ (
+ [0, 0, 1, 1, 2, 2, 1, 1],
+ ([0, 1, 1, 2, 2, 0, 3, 4], [1, 0, 2, 1, 0, 2, 4, 3])
+ ),
+ shape=(5, 5),
+)
+
+undirected_sparse_zero_SP = [[0, 0, 1, np.inf, np.inf],
+ [0, 0, 1, np.inf, np.inf],
+ [1, 1, 0, np.inf, np.inf],
+ [np.inf, np.inf, np.inf, 0, 1],
+ [np.inf, np.inf, np.inf, 1, 0]]
+
+directed_pred = np.array([[-9999, 0, 0, 1, 1],
+ [3, -9999, 0, 1, 1],
+ [-9999, -9999, -9999, -9999, -9999],
+ [3, 0, 0, -9999, 1],
+ [4, 0, 0, 4, -9999]], dtype=float)
+
+undirected_SP = np.array([[0, 3, 3, 1, 2],
+ [3, 0, 6, 2, 4],
+ [3, 6, 0, 4, 5],
+ [1, 2, 4, 0, 2],
+ [2, 4, 5, 2, 0]], dtype=float)
+
+undirected_SP_limit_2 = np.array([[0, np.inf, np.inf, 1, 2],
+ [np.inf, 0, np.inf, 2, np.inf],
+ [np.inf, np.inf, 0, np.inf, np.inf],
+ [1, 2, np.inf, 0, 2],
+ [2, np.inf, np.inf, 2, 0]], dtype=float)
+
+undirected_SP_limit_0 = np.ones((5, 5), dtype=float) - np.eye(5)
+undirected_SP_limit_0[undirected_SP_limit_0 > 0] = np.inf
+
+undirected_pred = np.array([[-9999, 0, 0, 0, 0],
+ [1, -9999, 0, 1, 1],
+ [2, 0, -9999, 0, 0],
+ [3, 3, 0, -9999, 3],
+ [4, 4, 0, 4, -9999]], dtype=float)
+
+directed_negative_weighted_G = np.array([[0, 0, 0],
+ [-1, 0, 0],
+ [0, -1, 0]], dtype=float)
+
+directed_negative_weighted_SP = np.array([[0, np.inf, np.inf],
+ [-1, 0, np.inf],
+ [-2, -1, 0]], dtype=float)
+
+methods = ['auto', 'FW', 'D', 'BF', 'J']
+
+
+def test_dijkstra_limit():
+ limits = [0, 2, np.inf]
+ results = [undirected_SP_limit_0,
+ undirected_SP_limit_2,
+ undirected_SP]
+
+ def check(limit, result):
+ SP = dijkstra(undirected_G, directed=False, limit=limit)
+ assert_array_almost_equal(SP, result)
+
+ for limit, result in zip(limits, results):
+ check(limit, result)
+
+
+def test_directed():
+ def check(method):
+ SP = shortest_path(directed_G, method=method, directed=True,
+ overwrite=False)
+ assert_array_almost_equal(SP, directed_SP)
+
+ for method in methods:
+ check(method)
+
+
+def test_undirected():
+ def check(method, directed_in):
+ if directed_in:
+ SP1 = shortest_path(directed_G, method=method, directed=False,
+ overwrite=False)
+ assert_array_almost_equal(SP1, undirected_SP)
+ else:
+ SP2 = shortest_path(undirected_G, method=method, directed=True,
+ overwrite=False)
+ assert_array_almost_equal(SP2, undirected_SP)
+
+ for method in methods:
+ for directed_in in (True, False):
+ check(method, directed_in)
+
+
+def test_directed_sparse_zero():
+ # test directed sparse graph with zero-weight edge and two connected components
+ def check(method):
+ SP = shortest_path(directed_sparse_zero_G, method=method, directed=True,
+ overwrite=False)
+ assert_array_almost_equal(SP, directed_sparse_zero_SP)
+
+ for method in methods:
+ check(method)
+
+
+def test_undirected_sparse_zero():
+ def check(method, directed_in):
+ if directed_in:
+ SP1 = shortest_path(directed_sparse_zero_G, method=method, directed=False,
+ overwrite=False)
+ assert_array_almost_equal(SP1, undirected_sparse_zero_SP)
+ else:
+ SP2 = shortest_path(undirected_sparse_zero_G, method=method, directed=True,
+ overwrite=False)
+ assert_array_almost_equal(SP2, undirected_sparse_zero_SP)
+
+ for method in methods:
+ for directed_in in (True, False):
+ check(method, directed_in)
+
+
+@pytest.mark.parametrize('directed, SP_ans',
+ ((True, directed_SP),
+ (False, undirected_SP)))
+@pytest.mark.parametrize('indices', ([0, 2, 4], [0, 4], [3, 4], [0, 0]))
+def test_dijkstra_indices_min_only(directed, SP_ans, indices):
+ SP_ans = np.array(SP_ans)
+ indices = np.array(indices, dtype=np.int64)
+ min_ind_ans = indices[np.argmin(SP_ans[indices, :], axis=0)]
+ min_d_ans = np.zeros(SP_ans.shape[0], SP_ans.dtype)
+ for k in range(SP_ans.shape[0]):
+ min_d_ans[k] = SP_ans[min_ind_ans[k], k]
+ min_ind_ans[np.isinf(min_d_ans)] = -9999
+
+ SP, pred, sources = dijkstra(directed_G,
+ directed=directed,
+ indices=indices,
+ min_only=True,
+ return_predecessors=True)
+ assert_array_almost_equal(SP, min_d_ans)
+ assert_array_equal(min_ind_ans, sources)
+ SP = dijkstra(directed_G,
+ directed=directed,
+ indices=indices,
+ min_only=True,
+ return_predecessors=False)
+ assert_array_almost_equal(SP, min_d_ans)
+
+
+@pytest.mark.parametrize('n', (10, 100, 1000))
+def test_dijkstra_min_only_random(n):
+ rng = np.random.default_rng(7345782358920239234)
+ data = scipy.sparse.random_array((n, n), density=0.5, format='lil',
+ rng=rng, dtype=np.float64)
+ data.setdiag(np.zeros(n, dtype=np.bool_))
+ # choose some random vertices
+ v = np.arange(n)
+ rng.shuffle(v)
+ indices = v[:int(n*.1)]
+ ds, pred, sources = dijkstra(data,
+ directed=True,
+ indices=indices,
+ min_only=True,
+ return_predecessors=True)
+ for k in range(n):
+ p = pred[k]
+ s = sources[k]
+ while p != -9999:
+ assert sources[p] == s
+ p = pred[p]
+
+
+def test_dijkstra_random():
+ # reproduces the hang observed in gh-17782
+ n = 10
+ indices = [0, 4, 4, 5, 7, 9, 0, 6, 2, 3, 7, 9, 1, 2, 9, 2, 5, 6]
+ indptr = [0, 0, 2, 5, 6, 7, 8, 12, 15, 18, 18]
+ data = [0.33629, 0.40458, 0.47493, 0.42757, 0.11497, 0.91653, 0.69084,
+ 0.64979, 0.62555, 0.743, 0.01724, 0.99945, 0.31095, 0.15557,
+ 0.02439, 0.65814, 0.23478, 0.24072]
+ graph = scipy.sparse.csr_array((data, indices, indptr), shape=(n, n))
+ dijkstra(graph, directed=True, return_predecessors=True)
+
+
+def test_gh_17782_segfault():
+ text = """%%MatrixMarket matrix coordinate real general
+ 84 84 22
+ 2 1 4.699999809265137e+00
+ 6 14 1.199999973177910e-01
+ 9 6 1.199999973177910e-01
+ 10 16 2.012000083923340e+01
+ 11 10 1.422000026702881e+01
+ 12 1 9.645999908447266e+01
+ 13 18 2.012000083923340e+01
+ 14 13 4.679999828338623e+00
+ 15 11 1.199999973177910e-01
+ 16 12 1.199999973177910e-01
+ 18 15 1.199999973177910e-01
+ 32 2 2.299999952316284e+00
+ 33 20 6.000000000000000e+00
+ 33 32 5.000000000000000e+00
+ 36 9 3.720000028610229e+00
+ 36 37 3.720000028610229e+00
+ 36 38 3.720000028610229e+00
+ 37 44 8.159999847412109e+00
+ 38 32 7.903999328613281e+01
+ 43 20 2.400000000000000e+01
+ 43 33 4.000000000000000e+00
+ 44 43 6.028000259399414e+01
+ """
+ data = mmread(StringIO(text), spmatrix=False)
+ dijkstra(data, directed=True, return_predecessors=True)
+
+
+def test_shortest_path_indices():
+ indices = np.arange(4)
+
+ def check(func, indshape):
+ outshape = indshape + (5,)
+ SP = func(directed_G, directed=False,
+ indices=indices.reshape(indshape))
+ assert_array_almost_equal(SP, undirected_SP[indices].reshape(outshape))
+
+ for indshape in [(4,), (4, 1), (2, 2)]:
+ for func in (dijkstra, bellman_ford, johnson, shortest_path):
+ check(func, indshape)
+
+ assert_raises(ValueError, shortest_path, directed_G, method='FW',
+ indices=indices)
+
+
+def test_predecessors():
+ SP_res = {True: directed_SP,
+ False: undirected_SP}
+ pred_res = {True: directed_pred,
+ False: undirected_pred}
+
+ def check(method, directed):
+ SP, pred = shortest_path(directed_G, method, directed=directed,
+ overwrite=False,
+ return_predecessors=True)
+ assert_array_almost_equal(SP, SP_res[directed])
+ assert_array_almost_equal(pred, pred_res[directed])
+
+ for method in methods:
+ for directed in (True, False):
+ check(method, directed)
+
+
+def test_construct_shortest_path():
+ def check(method, directed):
+ SP1, pred = shortest_path(directed_G,
+ directed=directed,
+ overwrite=False,
+ return_predecessors=True)
+ SP2 = construct_dist_matrix(directed_G, pred, directed=directed)
+ assert_array_almost_equal(SP1, SP2)
+
+ for method in methods:
+ for directed in (True, False):
+ check(method, directed)
+
+
+def test_unweighted_path():
+ def check(method, directed):
+ SP1 = shortest_path(directed_G,
+ directed=directed,
+ overwrite=False,
+ unweighted=True)
+ SP2 = shortest_path(unweighted_G,
+ directed=directed,
+ overwrite=False,
+ unweighted=False)
+ assert_array_almost_equal(SP1, SP2)
+
+ for method in methods:
+ for directed in (True, False):
+ check(method, directed)
+
+
+def test_negative_cycles():
+ # create a small graph with a negative cycle
+ graph = np.ones([5, 5])
+ graph.flat[::6] = 0
+ graph[1, 2] = -2
+
+ def check(method, directed):
+ assert_raises(NegativeCycleError, shortest_path, graph, method,
+ directed)
+
+ for directed in (True, False):
+ for method in ['FW', 'J', 'BF']:
+ check(method, directed)
+
+ assert_raises(NegativeCycleError, yen, graph, 0, 1, 1,
+ directed=directed)
+
+
+@pytest.mark.parametrize("method", ['FW', 'J', 'BF'])
+def test_negative_weights(method):
+ SP = shortest_path(directed_negative_weighted_G, method, directed=True)
+ assert_allclose(SP, directed_negative_weighted_SP, atol=1e-10)
+
+
+def test_masked_input():
+ np.ma.masked_equal(directed_G, 0)
+
+ def check(method):
+ SP = shortest_path(directed_G, method=method, directed=True,
+ overwrite=False)
+ assert_array_almost_equal(SP, directed_SP)
+
+ for method in methods:
+ check(method)
+
+
+def test_overwrite():
+ G = np.array([[0, 3, 3, 1, 2],
+ [3, 0, 0, 2, 4],
+ [3, 0, 0, 0, 0],
+ [1, 2, 0, 0, 2],
+ [2, 4, 0, 2, 0]], dtype=float)
+ foo = G.copy()
+ shortest_path(foo, overwrite=False)
+ assert_array_equal(foo, G)
+
+
+@pytest.mark.parametrize('method', methods)
+def test_buffer(method):
+ # Smoke test that sparse matrices with read-only buffers (e.g., those from
+ # joblib workers) do not cause::
+ #
+ # ValueError: buffer source array is read-only
+ #
+ G = scipy.sparse.csr_array([[1.]])
+ G.data.flags['WRITEABLE'] = False
+ shortest_path(G, method=method)
+
+
+def test_NaN_warnings():
+ with warnings.catch_warnings(record=True) as record:
+ shortest_path(np.array([[0, 1], [np.nan, 0]]))
+ for r in record:
+ assert r.category is not RuntimeWarning
+
+
+def test_sparse_matrices():
+ # Test that using lil,csr and csc sparse matrix do not cause error
+ G_dense = np.array([[0, 3, 0, 0, 0],
+ [0, 0, -1, 0, 0],
+ [0, 0, 0, 2, 0],
+ [0, 0, 0, 0, 4],
+ [0, 0, 0, 0, 0]], dtype=float)
+ SP = shortest_path(G_dense)
+ G_csr = scipy.sparse.csr_array(G_dense)
+ G_csc = scipy.sparse.csc_array(G_dense)
+ G_lil = scipy.sparse.lil_array(G_dense)
+ assert_array_almost_equal(SP, shortest_path(G_csr))
+ assert_array_almost_equal(SP, shortest_path(G_csc))
+ assert_array_almost_equal(SP, shortest_path(G_lil))
+
+
+def test_yen_directed():
+ distances, predecessors = yen(
+ directed_G,
+ source=0,
+ sink=3,
+ K=2,
+ return_predecessors=True
+ )
+ assert_allclose(distances, [5., 9.])
+ assert_allclose(predecessors, directed_2SP_0_to_3)
+
+
+def test_yen_undirected():
+ distances = yen(
+ undirected_G,
+ source=0,
+ sink=3,
+ K=4,
+ )
+ assert_allclose(distances, [1., 4., 5., 8.])
+
+def test_yen_unweighted():
+ # Ask for more paths than there are, verify only the available paths are returned
+ distances, predecessors = yen(
+ directed_G,
+ source=0,
+ sink=3,
+ K=4,
+ unweighted=True,
+ return_predecessors=True,
+ )
+ assert_allclose(distances, [2., 3.])
+ assert_allclose(predecessors, directed_2SP_0_to_3)
+
+def test_yen_no_paths():
+ distances = yen(
+ directed_G,
+ source=2,
+ sink=3,
+ K=1,
+ )
+ assert distances.size == 0
+
+def test_yen_negative_weights():
+ distances = yen(
+ directed_negative_weighted_G,
+ source=2,
+ sink=0,
+ K=1,
+ )
+ assert_allclose(distances, [-2.])
+
+
+@pytest.mark.parametrize("min_only", (True, False))
+@pytest.mark.parametrize("directed", (True, False))
+@pytest.mark.parametrize("return_predecessors", (True, False))
+@pytest.mark.parametrize("index_dtype", (np.int32, np.int64))
+@pytest.mark.parametrize("indices", (None, [1]))
+def test_20904(min_only, directed, return_predecessors, index_dtype, indices):
+ """Test two failures from gh-20904: int32 and indices-as-None."""
+ adj_mat = scipy.sparse.eye_array(4, format="csr")
+ adj_mat = scipy.sparse.csr_array(
+ (
+ adj_mat.data,
+ adj_mat.indices.astype(index_dtype),
+ adj_mat.indptr.astype(index_dtype),
+ ),
+ )
+ dijkstra(
+ adj_mat,
+ directed,
+ indices=indices,
+ min_only=min_only,
+ return_predecessors=return_predecessors,
+ )
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_spanning_tree.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_spanning_tree.py
new file mode 100644
index 0000000000000000000000000000000000000000..3237a14584d42022184a54f174b809a2b06d16ed
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_spanning_tree.py
@@ -0,0 +1,66 @@
+"""Test the minimum spanning tree function"""
+import numpy as np
+from numpy.testing import assert_
+import numpy.testing as npt
+from scipy.sparse import csr_array
+from scipy.sparse.csgraph import minimum_spanning_tree
+
+
+def test_minimum_spanning_tree():
+
+ # Create a graph with two connected components.
+ graph = [[0,1,0,0,0],
+ [1,0,0,0,0],
+ [0,0,0,8,5],
+ [0,0,8,0,1],
+ [0,0,5,1,0]]
+ graph = np.asarray(graph)
+
+ # Create the expected spanning tree.
+ expected = [[0,1,0,0,0],
+ [0,0,0,0,0],
+ [0,0,0,0,5],
+ [0,0,0,0,1],
+ [0,0,0,0,0]]
+ expected = np.asarray(expected)
+
+ # Ensure minimum spanning tree code gives this expected output.
+ csgraph = csr_array(graph)
+ mintree = minimum_spanning_tree(csgraph)
+ mintree_array = mintree.toarray()
+ npt.assert_array_equal(mintree_array, expected,
+ 'Incorrect spanning tree found.')
+
+ # Ensure that the original graph was not modified.
+ npt.assert_array_equal(csgraph.toarray(), graph,
+ 'Original graph was modified.')
+
+ # Now let the algorithm modify the csgraph in place.
+ mintree = minimum_spanning_tree(csgraph, overwrite=True)
+ npt.assert_array_equal(mintree.toarray(), expected,
+ 'Graph was not properly modified to contain MST.')
+
+ np.random.seed(1234)
+ for N in (5, 10, 15, 20):
+
+ # Create a random graph.
+ graph = 3 + np.random.random((N, N))
+ csgraph = csr_array(graph)
+
+ # The spanning tree has at most N - 1 edges.
+ mintree = minimum_spanning_tree(csgraph)
+ assert_(mintree.nnz < N)
+
+ # Set the sub diagonal to 1 to create a known spanning tree.
+ idx = np.arange(N-1)
+ graph[idx,idx+1] = 1
+ csgraph = csr_array(graph)
+ mintree = minimum_spanning_tree(csgraph)
+
+ # We expect to see this pattern in the spanning tree and otherwise
+ # have this zero.
+ expected = np.zeros((N, N))
+ expected[idx, idx+1] = 1
+
+ npt.assert_array_equal(mintree.toarray(), expected,
+ 'Incorrect spanning tree found.')
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_traversal.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_traversal.py
new file mode 100644
index 0000000000000000000000000000000000000000..aef6def21b61ff6b8d8bfb990a3a69136349d7c5
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/csgraph/tests/test_traversal.py
@@ -0,0 +1,148 @@
+import numpy as np
+import pytest
+from numpy.testing import assert_array_almost_equal
+from scipy.sparse import csr_array, csr_matrix, coo_array, coo_matrix
+from scipy.sparse.csgraph import (breadth_first_tree, depth_first_tree,
+ csgraph_to_dense, csgraph_from_dense, csgraph_masked_from_dense)
+
+
+def test_graph_breadth_first():
+ csgraph = np.array([[0, 1, 2, 0, 0],
+ [1, 0, 0, 0, 3],
+ [2, 0, 0, 7, 0],
+ [0, 0, 7, 0, 1],
+ [0, 3, 0, 1, 0]])
+ csgraph = csgraph_from_dense(csgraph, null_value=0)
+
+ bfirst = np.array([[0, 1, 2, 0, 0],
+ [0, 0, 0, 0, 3],
+ [0, 0, 0, 7, 0],
+ [0, 0, 0, 0, 0],
+ [0, 0, 0, 0, 0]])
+
+ for directed in [True, False]:
+ bfirst_test = breadth_first_tree(csgraph, 0, directed)
+ assert_array_almost_equal(csgraph_to_dense(bfirst_test),
+ bfirst)
+
+
+def test_graph_depth_first():
+ csgraph = np.array([[0, 1, 2, 0, 0],
+ [1, 0, 0, 0, 3],
+ [2, 0, 0, 7, 0],
+ [0, 0, 7, 0, 1],
+ [0, 3, 0, 1, 0]])
+ csgraph = csgraph_from_dense(csgraph, null_value=0)
+
+ dfirst = np.array([[0, 1, 0, 0, 0],
+ [0, 0, 0, 0, 3],
+ [0, 0, 0, 0, 0],
+ [0, 0, 7, 0, 0],
+ [0, 0, 0, 1, 0]])
+
+ for directed in [True, False]:
+ dfirst_test = depth_first_tree(csgraph, 0, directed)
+ assert_array_almost_equal(csgraph_to_dense(dfirst_test), dfirst)
+
+
+def test_return_type():
+ from .._laplacian import laplacian
+ from .._min_spanning_tree import minimum_spanning_tree
+
+ np_csgraph = np.array([[0, 1, 2, 0, 0],
+ [1, 0, 0, 0, 3],
+ [2, 0, 0, 7, 0],
+ [0, 0, 7, 0, 1],
+ [0, 3, 0, 1, 0]])
+ csgraph = csr_array(np_csgraph)
+ assert isinstance(laplacian(csgraph), coo_array)
+ assert isinstance(minimum_spanning_tree(csgraph), csr_array)
+ for directed in [True, False]:
+ assert isinstance(depth_first_tree(csgraph, 0, directed), csr_array)
+ assert isinstance(breadth_first_tree(csgraph, 0, directed), csr_array)
+
+ csgraph = csgraph_from_dense(np_csgraph, null_value=0)
+ assert isinstance(csgraph, csr_array)
+ assert isinstance(laplacian(csgraph), coo_array)
+ assert isinstance(minimum_spanning_tree(csgraph), csr_array)
+ for directed in [True, False]:
+ assert isinstance(depth_first_tree(csgraph, 0, directed), csr_array)
+ assert isinstance(breadth_first_tree(csgraph, 0, directed), csr_array)
+
+ csgraph = csgraph_masked_from_dense(np_csgraph, null_value=0)
+ assert isinstance(csgraph, np.ma.MaskedArray)
+ assert csgraph._baseclass is np.ndarray
+ # laplacian doesnt work with masked arrays so not here
+ assert isinstance(minimum_spanning_tree(csgraph), csr_array)
+ for directed in [True, False]:
+ assert isinstance(depth_first_tree(csgraph, 0, directed), csr_array)
+ assert isinstance(breadth_first_tree(csgraph, 0, directed), csr_array)
+
+ # start of testing with matrix/spmatrix types
+ with np.testing.suppress_warnings() as sup:
+ sup.filter(DeprecationWarning, "the matrix subclass.*")
+ sup.filter(PendingDeprecationWarning, "the matrix subclass.*")
+
+ nm_csgraph = np.matrix([[0, 1, 2, 0, 0],
+ [1, 0, 0, 0, 3],
+ [2, 0, 0, 7, 0],
+ [0, 0, 7, 0, 1],
+ [0, 3, 0, 1, 0]])
+
+ csgraph = csr_matrix(nm_csgraph)
+ assert isinstance(laplacian(csgraph), coo_matrix)
+ assert isinstance(minimum_spanning_tree(csgraph), csr_matrix)
+ for directed in [True, False]:
+ assert isinstance(depth_first_tree(csgraph, 0, directed), csr_matrix)
+ assert isinstance(breadth_first_tree(csgraph, 0, directed), csr_matrix)
+
+ csgraph = csgraph_from_dense(nm_csgraph, null_value=0)
+ assert isinstance(csgraph, csr_matrix)
+ assert isinstance(laplacian(csgraph), coo_matrix)
+ assert isinstance(minimum_spanning_tree(csgraph), csr_matrix)
+ for directed in [True, False]:
+ assert isinstance(depth_first_tree(csgraph, 0, directed), csr_matrix)
+ assert isinstance(breadth_first_tree(csgraph, 0, directed), csr_matrix)
+
+ mm_csgraph = csgraph_masked_from_dense(nm_csgraph, null_value=0)
+ assert isinstance(mm_csgraph, np.ma.MaskedArray)
+ # laplacian doesnt work with masked arrays so not here
+ assert isinstance(minimum_spanning_tree(csgraph), csr_matrix)
+ for directed in [True, False]:
+ assert isinstance(depth_first_tree(csgraph, 0, directed), csr_matrix)
+ assert isinstance(breadth_first_tree(csgraph, 0, directed), csr_matrix)
+ # end of testing with matrix/spmatrix types
+
+
+def test_graph_breadth_first_trivial_graph():
+ csgraph = np.array([[0]])
+ csgraph = csgraph_from_dense(csgraph, null_value=0)
+
+ bfirst = np.array([[0]])
+
+ for directed in [True, False]:
+ bfirst_test = breadth_first_tree(csgraph, 0, directed)
+ assert_array_almost_equal(csgraph_to_dense(bfirst_test), bfirst)
+
+
+def test_graph_depth_first_trivial_graph():
+ csgraph = np.array([[0]])
+ csgraph = csgraph_from_dense(csgraph, null_value=0)
+
+ bfirst = np.array([[0]])
+
+ for directed in [True, False]:
+ bfirst_test = depth_first_tree(csgraph, 0, directed)
+ assert_array_almost_equal(csgraph_to_dense(bfirst_test),
+ bfirst)
+
+
+@pytest.mark.parametrize('directed', [True, False])
+@pytest.mark.parametrize('tree_func', [breadth_first_tree, depth_first_tree])
+def test_int64_indices(tree_func, directed):
+ # See https://github.com/scipy/scipy/issues/18716
+ g = csr_array(([1], np.array([[0], [1]], dtype=np.int64)), shape=(2, 2))
+ assert g.indices.dtype == np.int64
+ tree = tree_func(g, 0, directed=directed)
+ assert_array_almost_equal(csgraph_to_dense(tree), [[0, 1], [0, 0]])
+
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..27d1a92a64aae03fdf829b1758c1b49a958f93a2
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_expm_multiply.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_expm_multiply.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..dfaed094de3aaa800ef87e89306a196181c3f2f8
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_expm_multiply.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_interface.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_interface.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..db04f1482802366e8427c2a2bc3eeec30c2c5dd3
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_interface.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_matfuncs.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_matfuncs.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..40789f67a1d8022096fb44bcb275b37d8a8b132e
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_matfuncs.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_norm.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_norm.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..d87ce8cf83ba38a0d2783f108b4415b48035b2a5
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_norm.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_onenormest.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_onenormest.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..63da9526b08fe0465d3e9346250e742416b97821
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_onenormest.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_special_sparse_arrays.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_special_sparse_arrays.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ef66c224a48aa8c788718228d2b09c7b45adbc56
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_special_sparse_arrays.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_svdp.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_svdp.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..de55a99c76cfa2fa0e9ab4ef736c77b4009966ed
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/_svdp.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/dsolve.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/dsolve.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..952899db6c0248d8d70716aaade5da51552a9680
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/dsolve.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/eigen.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/eigen.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..a66b2b405a5af5d4ea3d2df20b17f9897984cc06
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/eigen.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/interface.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/interface.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c6dd5fcdacc9f56d734f91d8380d3a2a908630ac
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/interface.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/isolve.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/isolve.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..ddb03728609d4932ac7f295e062e5d1c6672dbcc
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/isolve.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/matfuncs.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/matfuncs.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..154ef6ae63dee714b31398623d6ca79fd62ed98e
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/__pycache__/matfuncs.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..90005e3af863d2f7913e6fc4ea8de85962a3efdf
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__init__.py
@@ -0,0 +1,71 @@
+"""
+Linear Solvers
+==============
+
+The default solver is SuperLU (included in the scipy distribution),
+which can solve real or complex linear systems in both single and
+double precisions. It is automatically replaced by UMFPACK, if
+available. Note that UMFPACK works in double precision only, so
+switch it off by::
+
+ >>> from scipy.sparse.linalg import spsolve, use_solver
+ >>> use_solver(useUmfpack=False)
+
+to solve in the single precision. See also use_solver documentation.
+
+Example session::
+
+ >>> from scipy.sparse import csc_array, dia_array
+ >>> from numpy import array
+ >>>
+ >>> print("Inverting a sparse linear system:")
+ >>> print("The sparse matrix (constructed from diagonals):")
+ >>> a = dia_array(([[1, 2, 3, 4, 5], [6, 5, 8, 9, 10]], [0, 1]), shape=(5, 5))
+ >>> b = array([1, 2, 3, 4, 5])
+ >>> print("Solve: single precision complex:")
+ >>> use_solver( useUmfpack = False )
+ >>> a = a.astype('F')
+ >>> x = spsolve(a, b)
+ >>> print(x)
+ >>> print("Error: ", a@x-b)
+ >>>
+ >>> print("Solve: double precision complex:")
+ >>> use_solver( useUmfpack = True )
+ >>> a = a.astype('D')
+ >>> x = spsolve(a, b)
+ >>> print(x)
+ >>> print("Error: ", a@x-b)
+ >>>
+ >>> print("Solve: double precision:")
+ >>> a = a.astype('d')
+ >>> x = spsolve(a, b)
+ >>> print(x)
+ >>> print("Error: ", a@x-b)
+ >>>
+ >>> print("Solve: single precision:")
+ >>> use_solver( useUmfpack = False )
+ >>> a = a.astype('f')
+ >>> x = spsolve(a, b.astype('f'))
+ >>> print(x)
+ >>> print("Error: ", a@x-b)
+
+"""
+
+#import umfpack
+#__doc__ = '\n\n'.join( (__doc__, umfpack.__doc__) )
+#del umfpack
+
+from .linsolve import *
+from ._superlu import SuperLU
+from . import _add_newdocs
+from . import linsolve
+
+__all__ = [
+ 'MatrixRankWarning', 'SuperLU', 'factorized',
+ 'spilu', 'splu', 'spsolve', 'is_sptriangular',
+ 'spsolve_triangular', 'use_solver', 'spbandwidth',
+]
+
+from scipy._lib._testutils import PytestTester
+test = PytestTester(__name__)
+del PytestTester
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..1871ce30c69f3a10596cefadab08681f09bef183
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/_add_newdocs.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/_add_newdocs.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..fb45eea70c7ca76f6f9aaa735afc915d2fb66c57
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/_add_newdocs.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/linsolve.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/linsolve.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..4d8870a2280271b29bfbd53cda5314538fb47e60
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/__pycache__/linsolve.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/_add_newdocs.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/_add_newdocs.py
new file mode 100644
index 0000000000000000000000000000000000000000..cec34dca456b36a1f77e64f853fc1d821f5215eb
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/_add_newdocs.py
@@ -0,0 +1,147 @@
+from numpy.lib import add_newdoc
+
+add_newdoc('scipy.sparse.linalg._dsolve._superlu', 'SuperLU',
+ """
+ LU factorization of a sparse matrix.
+
+ Factorization is represented as::
+
+ Pr @ A @ Pc = L @ U
+
+ To construct these `SuperLU` objects, call the `splu` and `spilu`
+ functions.
+
+ Attributes
+ ----------
+ shape
+ nnz
+ perm_c
+ perm_r
+ L
+ U
+
+ Methods
+ -------
+ solve
+
+ Notes
+ -----
+
+ .. versionadded:: 0.14.0
+
+ Examples
+ --------
+ The LU decomposition can be used to solve matrix equations. Consider:
+
+ >>> import numpy as np
+ >>> from scipy.sparse import csc_array
+ >>> from scipy.sparse.linalg import splu
+ >>> A = csc_array([[1,2,0,4], [1,0,0,1], [1,0,2,1], [2,2,1,0.]])
+
+ This can be solved for a given right-hand side:
+
+ >>> lu = splu(A)
+ >>> b = np.array([1, 2, 3, 4])
+ >>> x = lu.solve(b)
+ >>> A.dot(x)
+ array([ 1., 2., 3., 4.])
+
+ The ``lu`` object also contains an explicit representation of the
+ decomposition. The permutations are represented as mappings of
+ indices:
+
+ >>> lu.perm_r
+ array([2, 1, 3, 0], dtype=int32) # may vary
+ >>> lu.perm_c
+ array([0, 1, 3, 2], dtype=int32) # may vary
+
+ The L and U factors are sparse matrices in CSC format:
+
+ >>> lu.L.toarray()
+ array([[ 1. , 0. , 0. , 0. ], # may vary
+ [ 0.5, 1. , 0. , 0. ],
+ [ 0.5, -1. , 1. , 0. ],
+ [ 0.5, 1. , 0. , 1. ]])
+ >>> lu.U.toarray()
+ array([[ 2. , 2. , 0. , 1. ], # may vary
+ [ 0. , -1. , 1. , -0.5],
+ [ 0. , 0. , 5. , -1. ],
+ [ 0. , 0. , 0. , 2. ]])
+
+ The permutation matrices can be constructed:
+
+ >>> Pr = csc_array((np.ones(4), (lu.perm_r, np.arange(4))))
+ >>> Pc = csc_array((np.ones(4), (np.arange(4), lu.perm_c)))
+
+ We can reassemble the original matrix:
+
+ >>> (Pr.T @ (lu.L @ lu.U) @ Pc.T).toarray()
+ array([[ 1., 2., 0., 4.],
+ [ 1., 0., 0., 1.],
+ [ 1., 0., 2., 1.],
+ [ 2., 2., 1., 0.]])
+ """)
+
+add_newdoc('scipy.sparse.linalg._dsolve._superlu', 'SuperLU', ('solve',
+ """
+ solve(rhs[, trans])
+
+ Solves linear system of equations with one or several right-hand sides.
+
+ Parameters
+ ----------
+ rhs : ndarray, shape (n,) or (n, k)
+ Right hand side(s) of equation
+ trans : {'N', 'T', 'H'}, optional
+ Type of system to solve::
+
+ 'N': A @ x == rhs (default)
+ 'T': A^T @ x == rhs
+ 'H': A^H @ x == rhs
+
+ i.e., normal, transposed, and hermitian conjugate.
+
+ Returns
+ -------
+ x : ndarray, shape ``rhs.shape``
+ Solution vector(s)
+ """))
+
+add_newdoc('scipy.sparse.linalg._dsolve._superlu', 'SuperLU', ('L',
+ """
+ Lower triangular factor with unit diagonal as a
+ `scipy.sparse.csc_array`.
+
+ .. versionadded:: 0.14.0
+ """))
+
+add_newdoc('scipy.sparse.linalg._dsolve._superlu', 'SuperLU', ('U',
+ """
+ Upper triangular factor as a `scipy.sparse.csc_array`.
+
+ .. versionadded:: 0.14.0
+ """))
+
+add_newdoc('scipy.sparse.linalg._dsolve._superlu', 'SuperLU', ('shape',
+ """
+ Shape of the original matrix as a tuple of ints.
+ """))
+
+add_newdoc('scipy.sparse.linalg._dsolve._superlu', 'SuperLU', ('nnz',
+ """
+ Number of nonzero elements in the matrix.
+ """))
+
+add_newdoc('scipy.sparse.linalg._dsolve._superlu', 'SuperLU', ('perm_c',
+ """
+ Permutation Pc represented as an array of indices.
+
+ See the `SuperLU` docstring for details.
+ """))
+
+add_newdoc('scipy.sparse.linalg._dsolve._superlu', 'SuperLU', ('perm_r',
+ """
+ Permutation Pr represented as an array of indices.
+
+ See the `SuperLU` docstring for details.
+ """))
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/linsolve.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/linsolve.py
new file mode 100644
index 0000000000000000000000000000000000000000..192da969d89300d1c616f8f795d91ee4bf65ff8e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/linsolve.py
@@ -0,0 +1,873 @@
+from warnings import warn, catch_warnings, simplefilter
+
+import numpy as np
+from numpy import asarray
+from scipy.sparse import (issparse, SparseEfficiencyWarning,
+ csr_array, csc_array, eye_array, diags_array)
+from scipy.sparse._sputils import (is_pydata_spmatrix, convert_pydata_sparse_to_scipy,
+ get_index_dtype, safely_cast_index_arrays)
+from scipy.linalg import LinAlgError
+import copy
+import threading
+
+from . import _superlu
+
+noScikit = False
+try:
+ import scikits.umfpack as umfpack
+except ImportError:
+ noScikit = True
+
+useUmfpack = threading.local()
+
+
+__all__ = ['use_solver', 'spsolve', 'splu', 'spilu', 'factorized',
+ 'MatrixRankWarning', 'spsolve_triangular', 'is_sptriangular', 'spbandwidth']
+
+
+class MatrixRankWarning(UserWarning):
+ pass
+
+
+def use_solver(**kwargs):
+ """
+ Select default sparse direct solver to be used.
+
+ Parameters
+ ----------
+ useUmfpack : bool, optional
+ Use UMFPACK [1]_, [2]_, [3]_, [4]_. over SuperLU. Has effect only
+ if ``scikits.umfpack`` is installed. Default: True
+ assumeSortedIndices : bool, optional
+ Allow UMFPACK to skip the step of sorting indices for a CSR/CSC matrix.
+ Has effect only if useUmfpack is True and ``scikits.umfpack`` is
+ installed. Default: False
+
+ Notes
+ -----
+ The default sparse solver is UMFPACK when available
+ (``scikits.umfpack`` is installed). This can be changed by passing
+ useUmfpack = False, which then causes the always present SuperLU
+ based solver to be used.
+
+ UMFPACK requires a CSR/CSC matrix to have sorted column/row indices. If
+ sure that the matrix fulfills this, pass ``assumeSortedIndices=True``
+ to gain some speed.
+
+ References
+ ----------
+ .. [1] T. A. Davis, Algorithm 832: UMFPACK - an unsymmetric-pattern
+ multifrontal method with a column pre-ordering strategy, ACM
+ Trans. on Mathematical Software, 30(2), 2004, pp. 196--199.
+ https://dl.acm.org/doi/abs/10.1145/992200.992206
+
+ .. [2] T. A. Davis, A column pre-ordering strategy for the
+ unsymmetric-pattern multifrontal method, ACM Trans.
+ on Mathematical Software, 30(2), 2004, pp. 165--195.
+ https://dl.acm.org/doi/abs/10.1145/992200.992205
+
+ .. [3] T. A. Davis and I. S. Duff, A combined unifrontal/multifrontal
+ method for unsymmetric sparse matrices, ACM Trans. on
+ Mathematical Software, 25(1), 1999, pp. 1--19.
+ https://doi.org/10.1145/305658.287640
+
+ .. [4] T. A. Davis and I. S. Duff, An unsymmetric-pattern multifrontal
+ method for sparse LU factorization, SIAM J. Matrix Analysis and
+ Computations, 18(1), 1997, pp. 140--158.
+ https://doi.org/10.1137/S0895479894246905T.
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse.linalg import use_solver, spsolve
+ >>> from scipy.sparse import csc_array
+ >>> R = np.random.randn(5, 5)
+ >>> A = csc_array(R)
+ >>> b = np.random.randn(5)
+ >>> use_solver(useUmfpack=False) # enforce superLU over UMFPACK
+ >>> x = spsolve(A, b)
+ >>> np.allclose(A.dot(x), b)
+ True
+ >>> use_solver(useUmfpack=True) # reset umfPack usage to default
+ """
+ global useUmfpack
+ if 'useUmfpack' in kwargs:
+ useUmfpack.u = kwargs['useUmfpack']
+ if useUmfpack.u and 'assumeSortedIndices' in kwargs:
+ umfpack.configure(assumeSortedIndices=kwargs['assumeSortedIndices'])
+
+def _get_umf_family(A):
+ """Get umfpack family string given the sparse matrix dtype."""
+ _families = {
+ (np.float64, np.int32): 'di',
+ (np.complex128, np.int32): 'zi',
+ (np.float64, np.int64): 'dl',
+ (np.complex128, np.int64): 'zl'
+ }
+
+ # A.dtype.name can only be "float64" or
+ # "complex128" in control flow
+ f_type = getattr(np, A.dtype.name)
+ # control flow may allow for more index
+ # types to get through here
+ i_type = getattr(np, A.indices.dtype.name)
+
+ try:
+ family = _families[(f_type, i_type)]
+
+ except KeyError as e:
+ msg = ('only float64 or complex128 matrices with int32 or int64 '
+ f'indices are supported! (got: matrix: {f_type}, indices: {i_type})')
+ raise ValueError(msg) from e
+
+ # See gh-8278. Considered converting only if
+ # A.shape[0]*A.shape[1] > np.iinfo(np.int32).max,
+ # but that didn't always fix the issue.
+ family = family[0] + "l"
+ A_new = copy.copy(A)
+ A_new.indptr = np.asarray(A.indptr, dtype=np.int64)
+ A_new.indices = np.asarray(A.indices, dtype=np.int64)
+
+ return family, A_new
+
+def spsolve(A, b, permc_spec=None, use_umfpack=True):
+ """Solve the sparse linear system Ax=b, where b may be a vector or a matrix.
+
+ Parameters
+ ----------
+ A : ndarray or sparse array or matrix
+ The square matrix A will be converted into CSC or CSR form
+ b : ndarray or sparse array or matrix
+ The matrix or vector representing the right hand side of the equation.
+ If a vector, b.shape must be (n,) or (n, 1).
+ permc_spec : str, optional
+ How to permute the columns of the matrix for sparsity preservation.
+ (default: 'COLAMD')
+
+ - ``NATURAL``: natural ordering.
+ - ``MMD_ATA``: minimum degree ordering on the structure of A^T A.
+ - ``MMD_AT_PLUS_A``: minimum degree ordering on the structure of A^T+A.
+ - ``COLAMD``: approximate minimum degree column ordering [1]_, [2]_.
+
+ use_umfpack : bool, optional
+ if True (default) then use UMFPACK for the solution [3]_, [4]_, [5]_,
+ [6]_ . This is only referenced if b is a vector and
+ ``scikits.umfpack`` is installed.
+
+ Returns
+ -------
+ x : ndarray or sparse array or matrix
+ the solution of the sparse linear equation.
+ If b is a vector, then x is a vector of size A.shape[1]
+ If b is a matrix, then x is a matrix of size (A.shape[1], b.shape[1])
+
+ Notes
+ -----
+ For solving the matrix expression AX = B, this solver assumes the resulting
+ matrix X is sparse, as is often the case for very sparse inputs. If the
+ resulting X is dense, the construction of this sparse result will be
+ relatively expensive. In that case, consider converting A to a dense
+ matrix and using scipy.linalg.solve or its variants.
+
+ References
+ ----------
+ .. [1] T. A. Davis, J. R. Gilbert, S. Larimore, E. Ng, Algorithm 836:
+ COLAMD, an approximate column minimum degree ordering algorithm,
+ ACM Trans. on Mathematical Software, 30(3), 2004, pp. 377--380.
+ :doi:`10.1145/1024074.1024080`
+
+ .. [2] T. A. Davis, J. R. Gilbert, S. Larimore, E. Ng, A column approximate
+ minimum degree ordering algorithm, ACM Trans. on Mathematical
+ Software, 30(3), 2004, pp. 353--376. :doi:`10.1145/1024074.1024079`
+
+ .. [3] T. A. Davis, Algorithm 832: UMFPACK - an unsymmetric-pattern
+ multifrontal method with a column pre-ordering strategy, ACM
+ Trans. on Mathematical Software, 30(2), 2004, pp. 196--199.
+ https://dl.acm.org/doi/abs/10.1145/992200.992206
+
+ .. [4] T. A. Davis, A column pre-ordering strategy for the
+ unsymmetric-pattern multifrontal method, ACM Trans.
+ on Mathematical Software, 30(2), 2004, pp. 165--195.
+ https://dl.acm.org/doi/abs/10.1145/992200.992205
+
+ .. [5] T. A. Davis and I. S. Duff, A combined unifrontal/multifrontal
+ method for unsymmetric sparse matrices, ACM Trans. on
+ Mathematical Software, 25(1), 1999, pp. 1--19.
+ https://doi.org/10.1145/305658.287640
+
+ .. [6] T. A. Davis and I. S. Duff, An unsymmetric-pattern multifrontal
+ method for sparse LU factorization, SIAM J. Matrix Analysis and
+ Computations, 18(1), 1997, pp. 140--158.
+ https://doi.org/10.1137/S0895479894246905T.
+
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse import csc_array
+ >>> from scipy.sparse.linalg import spsolve
+ >>> A = csc_array([[3, 2, 0], [1, -1, 0], [0, 5, 1]], dtype=float)
+ >>> B = csc_array([[2, 0], [-1, 0], [2, 0]], dtype=float)
+ >>> x = spsolve(A, B)
+ >>> np.allclose(A.dot(x).toarray(), B.toarray())
+ True
+ """
+ is_pydata_sparse = is_pydata_spmatrix(b)
+ pydata_sparse_cls = b.__class__ if is_pydata_sparse else None
+ A = convert_pydata_sparse_to_scipy(A)
+ b = convert_pydata_sparse_to_scipy(b)
+
+ if not (issparse(A) and A.format in ("csc", "csr")):
+ A = csc_array(A)
+ warn('spsolve requires A be CSC or CSR matrix format',
+ SparseEfficiencyWarning, stacklevel=2)
+
+ # b is a vector only if b have shape (n,) or (n, 1)
+ b_is_sparse = issparse(b)
+ if not b_is_sparse:
+ b = asarray(b)
+ b_is_vector = ((b.ndim == 1) or (b.ndim == 2 and b.shape[1] == 1))
+
+ # sum duplicates for non-canonical format
+ A.sum_duplicates()
+ A = A._asfptype() # upcast to a floating point format
+ result_dtype = np.promote_types(A.dtype, b.dtype)
+ if A.dtype != result_dtype:
+ A = A.astype(result_dtype)
+ if b.dtype != result_dtype:
+ b = b.astype(result_dtype)
+
+ # validate input shapes
+ M, N = A.shape
+ if (M != N):
+ raise ValueError(f"matrix must be square (has shape {(M, N)})")
+
+ if M != b.shape[0]:
+ raise ValueError(f"matrix - rhs dimension mismatch ({A.shape} - {b.shape[0]})")
+
+ if not hasattr(useUmfpack, 'u'):
+ useUmfpack.u = not noScikit
+
+ use_umfpack = use_umfpack and useUmfpack.u
+
+ if b_is_vector and use_umfpack:
+ if b_is_sparse:
+ b_vec = b.toarray()
+ else:
+ b_vec = b
+ b_vec = asarray(b_vec, dtype=A.dtype).ravel()
+
+ if noScikit:
+ raise RuntimeError('Scikits.umfpack not installed.')
+
+ if A.dtype.char not in 'dD':
+ raise ValueError("convert matrix data to double, please, using"
+ " .astype(), or set linsolve.useUmfpack.u = False")
+
+ umf_family, A = _get_umf_family(A)
+ umf = umfpack.UmfpackContext(umf_family)
+ x = umf.linsolve(umfpack.UMFPACK_A, A, b_vec,
+ autoTranspose=True)
+ else:
+ if b_is_vector and b_is_sparse:
+ b = b.toarray()
+ b_is_sparse = False
+
+ if not b_is_sparse:
+ if A.format == "csc":
+ flag = 1 # CSC format
+ else:
+ flag = 0 # CSR format
+
+ indices = A.indices.astype(np.intc, copy=False)
+ indptr = A.indptr.astype(np.intc, copy=False)
+ options = dict(ColPerm=permc_spec)
+ x, info = _superlu.gssv(N, A.nnz, A.data, indices, indptr,
+ b, flag, options=options)
+ if info != 0:
+ warn("Matrix is exactly singular", MatrixRankWarning, stacklevel=2)
+ x.fill(np.nan)
+ if b_is_vector:
+ x = x.ravel()
+ else:
+ # b is sparse
+ Afactsolve = factorized(A)
+
+ if not (b.format == "csc" or is_pydata_spmatrix(b)):
+ warn('spsolve is more efficient when sparse b '
+ 'is in the CSC matrix format',
+ SparseEfficiencyWarning, stacklevel=2)
+ b = csc_array(b)
+
+ # Create a sparse output matrix by repeatedly applying
+ # the sparse factorization to solve columns of b.
+ data_segs = []
+ row_segs = []
+ col_segs = []
+ for j in range(b.shape[1]):
+ bj = b[:, j].toarray().ravel()
+ xj = Afactsolve(bj)
+ w = np.flatnonzero(xj)
+ segment_length = w.shape[0]
+ row_segs.append(w)
+ col_segs.append(np.full(segment_length, j, dtype=int))
+ data_segs.append(np.asarray(xj[w], dtype=A.dtype))
+ sparse_data = np.concatenate(data_segs)
+ idx_dtype = get_index_dtype(maxval=max(b.shape))
+ sparse_row = np.concatenate(row_segs, dtype=idx_dtype)
+ sparse_col = np.concatenate(col_segs, dtype=idx_dtype)
+ x = A.__class__((sparse_data, (sparse_row, sparse_col)),
+ shape=b.shape, dtype=A.dtype)
+
+ if is_pydata_sparse:
+ x = pydata_sparse_cls.from_scipy_sparse(x)
+
+ return x
+
+
+def splu(A, permc_spec=None, diag_pivot_thresh=None,
+ relax=None, panel_size=None, options=None):
+ """
+ Compute the LU decomposition of a sparse, square matrix.
+
+ Parameters
+ ----------
+ A : sparse array or matrix
+ Sparse array to factorize. Most efficient when provided in CSC
+ format. Other formats will be converted to CSC before factorization.
+ permc_spec : str, optional
+ How to permute the columns of the matrix for sparsity preservation.
+ (default: 'COLAMD')
+
+ - ``NATURAL``: natural ordering.
+ - ``MMD_ATA``: minimum degree ordering on the structure of A^T A.
+ - ``MMD_AT_PLUS_A``: minimum degree ordering on the structure of A^T+A.
+ - ``COLAMD``: approximate minimum degree column ordering
+
+ diag_pivot_thresh : float, optional
+ Threshold used for a diagonal entry to be an acceptable pivot.
+ See SuperLU user's guide for details [1]_
+ relax : int, optional
+ Expert option for customizing the degree of relaxing supernodes.
+ See SuperLU user's guide for details [1]_
+ panel_size : int, optional
+ Expert option for customizing the panel size.
+ See SuperLU user's guide for details [1]_
+ options : dict, optional
+ Dictionary containing additional expert options to SuperLU.
+ See SuperLU user guide [1]_ (section 2.4 on the 'Options' argument)
+ for more details. For example, you can specify
+ ``options=dict(Equil=False, IterRefine='SINGLE'))``
+ to turn equilibration off and perform a single iterative refinement.
+
+ Returns
+ -------
+ invA : scipy.sparse.linalg.SuperLU
+ Object, which has a ``solve`` method.
+
+ See also
+ --------
+ spilu : incomplete LU decomposition
+
+ Notes
+ -----
+ This function uses the SuperLU library.
+
+ References
+ ----------
+ .. [1] SuperLU https://portal.nersc.gov/project/sparse/superlu/
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse import csc_array
+ >>> from scipy.sparse.linalg import splu
+ >>> A = csc_array([[1., 0., 0.], [5., 0., 2.], [0., -1., 0.]], dtype=float)
+ >>> B = splu(A)
+ >>> x = np.array([1., 2., 3.], dtype=float)
+ >>> B.solve(x)
+ array([ 1. , -3. , -1.5])
+ >>> A.dot(B.solve(x))
+ array([ 1., 2., 3.])
+ >>> B.solve(A.dot(x))
+ array([ 1., 2., 3.])
+ """
+
+ if is_pydata_spmatrix(A):
+ A_cls = type(A)
+ def csc_construct_func(*a, cls=A_cls):
+ return cls.from_scipy_sparse(csc_array(*a))
+ A = A.to_scipy_sparse().tocsc()
+ else:
+ csc_construct_func = csc_array
+
+ if not (issparse(A) and A.format == "csc"):
+ A = csc_array(A)
+ warn('splu converted its input to CSC format',
+ SparseEfficiencyWarning, stacklevel=2)
+
+ # sum duplicates for non-canonical format
+ A.sum_duplicates()
+ A = A._asfptype() # upcast to a floating point format
+
+ M, N = A.shape
+ if (M != N):
+ raise ValueError("can only factor square matrices") # is this true?
+
+ indices, indptr = safely_cast_index_arrays(A, np.intc, "SuperLU")
+
+ _options = dict(DiagPivotThresh=diag_pivot_thresh, ColPerm=permc_spec,
+ PanelSize=panel_size, Relax=relax)
+ if options is not None:
+ _options.update(options)
+
+ # Ensure that no column permutations are applied
+ if (_options["ColPerm"] == "NATURAL"):
+ _options["SymmetricMode"] = True
+
+ return _superlu.gstrf(N, A.nnz, A.data, indices, indptr,
+ csc_construct_func=csc_construct_func,
+ ilu=False, options=_options)
+
+
+def spilu(A, drop_tol=None, fill_factor=None, drop_rule=None, permc_spec=None,
+ diag_pivot_thresh=None, relax=None, panel_size=None, options=None):
+ """
+ Compute an incomplete LU decomposition for a sparse, square matrix.
+
+ The resulting object is an approximation to the inverse of `A`.
+
+ Parameters
+ ----------
+ A : (N, N) array_like
+ Sparse array to factorize. Most efficient when provided in CSC format.
+ Other formats will be converted to CSC before factorization.
+ drop_tol : float, optional
+ Drop tolerance (0 <= tol <= 1) for an incomplete LU decomposition.
+ (default: 1e-4)
+ fill_factor : float, optional
+ Specifies the fill ratio upper bound (>= 1.0) for ILU. (default: 10)
+ drop_rule : str, optional
+ Comma-separated string of drop rules to use.
+ Available rules: ``basic``, ``prows``, ``column``, ``area``,
+ ``secondary``, ``dynamic``, ``interp``. (Default: ``basic,area``)
+
+ See SuperLU documentation for details.
+
+ Remaining other options
+ Same as for `splu`
+
+ Returns
+ -------
+ invA_approx : scipy.sparse.linalg.SuperLU
+ Object, which has a ``solve`` method.
+
+ See also
+ --------
+ splu : complete LU decomposition
+
+ Notes
+ -----
+ To improve the better approximation to the inverse, you may need to
+ increase `fill_factor` AND decrease `drop_tol`.
+
+ This function uses the SuperLU library.
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse import csc_array
+ >>> from scipy.sparse.linalg import spilu
+ >>> A = csc_array([[1., 0., 0.], [5., 0., 2.], [0., -1., 0.]], dtype=float)
+ >>> B = spilu(A)
+ >>> x = np.array([1., 2., 3.], dtype=float)
+ >>> B.solve(x)
+ array([ 1. , -3. , -1.5])
+ >>> A.dot(B.solve(x))
+ array([ 1., 2., 3.])
+ >>> B.solve(A.dot(x))
+ array([ 1., 2., 3.])
+ """
+
+ if is_pydata_spmatrix(A):
+ A_cls = type(A)
+ def csc_construct_func(*a, cls=A_cls):
+ return cls.from_scipy_sparse(csc_array(*a))
+ A = A.to_scipy_sparse().tocsc()
+ else:
+ csc_construct_func = csc_array
+
+ if not (issparse(A) and A.format == "csc"):
+ A = csc_array(A)
+ warn('spilu converted its input to CSC format',
+ SparseEfficiencyWarning, stacklevel=2)
+
+ # sum duplicates for non-canonical format
+ A.sum_duplicates()
+ A = A._asfptype() # upcast to a floating point format
+
+ M, N = A.shape
+ if (M != N):
+ raise ValueError("can only factor square matrices") # is this true?
+
+ indices, indptr = safely_cast_index_arrays(A, np.intc, "SuperLU")
+
+ _options = dict(ILU_DropRule=drop_rule, ILU_DropTol=drop_tol,
+ ILU_FillFactor=fill_factor,
+ DiagPivotThresh=diag_pivot_thresh, ColPerm=permc_spec,
+ PanelSize=panel_size, Relax=relax)
+ if options is not None:
+ _options.update(options)
+
+ # Ensure that no column permutations are applied
+ if (_options["ColPerm"] == "NATURAL"):
+ _options["SymmetricMode"] = True
+
+ return _superlu.gstrf(N, A.nnz, A.data, indices, indptr,
+ csc_construct_func=csc_construct_func,
+ ilu=True, options=_options)
+
+
+def factorized(A):
+ """
+ Return a function for solving a sparse linear system, with A pre-factorized.
+
+ Parameters
+ ----------
+ A : (N, N) array_like
+ Input. A in CSC format is most efficient. A CSR format matrix will
+ be converted to CSC before factorization.
+
+ Returns
+ -------
+ solve : callable
+ To solve the linear system of equations given in `A`, the `solve`
+ callable should be passed an ndarray of shape (N,).
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse.linalg import factorized
+ >>> from scipy.sparse import csc_array
+ >>> A = np.array([[ 3. , 2. , -1. ],
+ ... [ 2. , -2. , 4. ],
+ ... [-1. , 0.5, -1. ]])
+ >>> solve = factorized(csc_array(A)) # Makes LU decomposition.
+ >>> rhs1 = np.array([1, -2, 0])
+ >>> solve(rhs1) # Uses the LU factors.
+ array([ 1., -2., -2.])
+
+ """
+ if is_pydata_spmatrix(A):
+ A = A.to_scipy_sparse().tocsc()
+
+ if not hasattr(useUmfpack, 'u'):
+ useUmfpack.u = not noScikit
+
+ if useUmfpack.u:
+ if noScikit:
+ raise RuntimeError('Scikits.umfpack not installed.')
+
+ if not (issparse(A) and A.format == "csc"):
+ A = csc_array(A)
+ warn('splu converted its input to CSC format',
+ SparseEfficiencyWarning, stacklevel=2)
+
+ A = A._asfptype() # upcast to a floating point format
+
+ if A.dtype.char not in 'dD':
+ raise ValueError("convert matrix data to double, please, using"
+ " .astype(), or set linsolve.useUmfpack.u = False")
+
+ umf_family, A = _get_umf_family(A)
+ umf = umfpack.UmfpackContext(umf_family)
+
+ # Make LU decomposition.
+ umf.numeric(A)
+
+ def solve(b):
+ with np.errstate(divide="ignore", invalid="ignore"):
+ # Ignoring warnings with numpy >= 1.23.0, see gh-16523
+ result = umf.solve(umfpack.UMFPACK_A, A, b, autoTranspose=True)
+
+ return result
+
+ return solve
+ else:
+ return splu(A).solve
+
+
+def spsolve_triangular(A, b, lower=True, overwrite_A=False, overwrite_b=False,
+ unit_diagonal=False):
+ """
+ Solve the equation ``A x = b`` for `x`, assuming A is a triangular matrix.
+
+ Parameters
+ ----------
+ A : (M, M) sparse array or matrix
+ A sparse square triangular matrix. Should be in CSR or CSC format.
+ b : (M,) or (M, N) array_like
+ Right-hand side matrix in ``A x = b``
+ lower : bool, optional
+ Whether `A` is a lower or upper triangular matrix.
+ Default is lower triangular matrix.
+ overwrite_A : bool, optional
+ Allow changing `A`.
+ Enabling gives a performance gain. Default is False.
+ overwrite_b : bool, optional
+ Allow overwriting data in `b`.
+ Enabling gives a performance gain. Default is False.
+ If `overwrite_b` is True, it should be ensured that
+ `b` has an appropriate dtype to be able to store the result.
+ unit_diagonal : bool, optional
+ If True, diagonal elements of `a` are assumed to be 1.
+
+ .. versionadded:: 1.4.0
+
+ Returns
+ -------
+ x : (M,) or (M, N) ndarray
+ Solution to the system ``A x = b``. Shape of return matches shape
+ of `b`.
+
+ Raises
+ ------
+ LinAlgError
+ If `A` is singular or not triangular.
+ ValueError
+ If shape of `A` or shape of `b` do not match the requirements.
+
+ Notes
+ -----
+ .. versionadded:: 0.19.0
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse import csc_array
+ >>> from scipy.sparse.linalg import spsolve_triangular
+ >>> A = csc_array([[3, 0, 0], [1, -1, 0], [2, 0, 1]], dtype=float)
+ >>> B = np.array([[2, 0], [-1, 0], [2, 0]], dtype=float)
+ >>> x = spsolve_triangular(A, B)
+ >>> np.allclose(A.dot(x), B)
+ True
+ """
+
+ if is_pydata_spmatrix(A):
+ A = A.to_scipy_sparse().tocsc()
+
+ trans = "N"
+ if issparse(A) and A.format == "csr":
+ A = A.T
+ trans = "T"
+ lower = not lower
+
+ if not (issparse(A) and A.format == "csc"):
+ warn('CSC or CSR matrix format is required. Converting to CSC matrix.',
+ SparseEfficiencyWarning, stacklevel=2)
+ A = csc_array(A)
+ elif not overwrite_A:
+ A = A.copy()
+
+
+ M, N = A.shape
+ if M != N:
+ raise ValueError(
+ f'A must be a square matrix but its shape is {A.shape}.')
+
+ if unit_diagonal:
+ with catch_warnings():
+ simplefilter('ignore', SparseEfficiencyWarning)
+ A.setdiag(1)
+ else:
+ diag = A.diagonal()
+ if np.any(diag == 0):
+ raise LinAlgError(
+ 'A is singular: zero entry on diagonal.')
+ invdiag = 1/diag
+ if trans == "N":
+ A = A @ diags_array(invdiag)
+ else:
+ A = (A.T @ diags_array(invdiag)).T
+
+ # sum duplicates for non-canonical format
+ A.sum_duplicates()
+
+ b = np.asanyarray(b)
+
+ if b.ndim not in [1, 2]:
+ raise ValueError(
+ f'b must have 1 or 2 dims but its shape is {b.shape}.')
+ if M != b.shape[0]:
+ raise ValueError(
+ 'The size of the dimensions of A must be equal to '
+ 'the size of the first dimension of b but the shape of A is '
+ f'{A.shape} and the shape of b is {b.shape}.'
+ )
+
+ result_dtype = np.promote_types(np.promote_types(A.dtype, np.float32), b.dtype)
+ if A.dtype != result_dtype:
+ A = A.astype(result_dtype)
+ if b.dtype != result_dtype:
+ b = b.astype(result_dtype)
+ elif not overwrite_b:
+ b = b.copy()
+
+ if lower:
+ L = A
+ U = csc_array((N, N), dtype=result_dtype)
+ else:
+ L = eye_array(N, dtype=result_dtype, format='csc')
+ U = A
+ U.setdiag(0)
+
+ x, info = _superlu.gstrs(trans,
+ N, L.nnz, L.data, L.indices, L.indptr,
+ N, U.nnz, U.data, U.indices, U.indptr,
+ b)
+ if info:
+ raise LinAlgError('A is singular.')
+
+ if not unit_diagonal:
+ invdiag = invdiag.reshape(-1, *([1] * (len(x.shape) - 1)))
+ x = x * invdiag
+
+ return x
+
+
+def is_sptriangular(A):
+ """Returns 2-tuple indicating lower/upper triangular structure for sparse ``A``
+
+ Checks for triangular structure in ``A``. The result is summarized in
+ two boolean values ``lower`` and ``upper`` to designate whether ``A`` is
+ lower triangular or upper triangular respectively. Diagonal ``A`` will
+ result in both being True. Non-triangular structure results in False for both.
+
+ Only the sparse structure is used here. Values are not checked for zeros.
+
+ This function will convert a copy of ``A`` to CSC format if it is not already
+ CSR or CSC format. So it may be more efficient to convert it yourself if you
+ have other uses for the CSR/CSC version.
+
+ If ``A`` is not square, the portions outside the upper left square of the
+ matrix do not affect its triangular structure. You probably want to work
+ with the square portion of the matrix, though it is not requred here.
+
+ Parameters
+ ----------
+ A : SciPy sparse array or matrix
+ A sparse matrix preferrably in CSR or CSC format.
+
+ Returns
+ -------
+ lower, upper : 2-tuple of bool
+
+ .. versionadded:: 1.15.0
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse import csc_array, eye_array
+ >>> from scipy.sparse.linalg import is_sptriangular
+ >>> A = csc_array([[3, 0, 0], [1, -1, 0], [2, 0, 1]], dtype=float)
+ >>> is_sptriangular(A)
+ (True, False)
+ >>> D = eye_array(3, format='csr')
+ >>> is_sptriangular(D)
+ (True, True)
+ """
+ if not (issparse(A) and A.format in ("csc", "csr", "coo", "dia", "dok", "lil")):
+ warn('is_sptriangular needs sparse and not BSR format. Converting to CSR.',
+ SparseEfficiencyWarning, stacklevel=2)
+ A = csr_array(A)
+
+ # bsr is better off converting to csr
+ if A.format == "dia":
+ return A.offsets.max() <= 0, A.offsets.min() >= 0
+ elif A.format == "coo":
+ rows, cols = A.coords
+ return (cols <= rows).all(), (cols >= rows).all()
+ elif A.format == "dok":
+ return all(c <= r for r, c in A.keys()), all(c >= r for r, c in A.keys())
+ elif A.format == "lil":
+ lower = all(col <= row for row, cols in enumerate(A.rows) for col in cols)
+ upper = all(col >= row for row, cols in enumerate(A.rows) for col in cols)
+ return lower, upper
+ # format in ("csc", "csr")
+ indptr, indices = A.indptr, A.indices
+ N = len(indptr) - 1
+
+ lower, upper = True, True
+ # check middle, 1st, last col (treat as CSC and switch at end if CSR)
+ for col in [N // 2, 0, -1]:
+ rows = indices[indptr[col]:indptr[col + 1]]
+ upper = upper and (col >= rows).all()
+ lower = lower and (col <= rows).all()
+ if not upper and not lower:
+ return False, False
+ # check all cols
+ cols = np.repeat(np.arange(N), np.diff(indptr))
+ rows = indices
+ upper = upper and (cols >= rows).all()
+ lower = lower and (cols <= rows).all()
+ if A.format == 'csr':
+ return upper, lower
+ return lower, upper
+
+
+def spbandwidth(A):
+ """Return the lower and upper bandwidth of a 2D numeric array.
+
+ Computes the lower and upper limits on the bandwidth of the
+ sparse 2D array ``A``. The result is summarized as a 2-tuple
+ of positive integers ``(lo, hi)``. A zero denotes no sub/super
+ diagonal entries on that side (tringular). The maximum value
+ for ``lo``(``hi``) is one less than the number of rows(cols).
+
+ Only the sparse structure is used here. Values are not checked for zeros.
+
+ Parameters
+ ----------
+ A : SciPy sparse array or matrix
+ A sparse matrix preferrably in CSR or CSC format.
+
+ Returns
+ -------
+ below, above : 2-tuple of int
+ The distance to the farthest non-zero diagonal below/above the
+ main diagonal.
+
+ .. versionadded:: 1.15.0
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse.linalg import spbandwidth
+ >>> from scipy.sparse import csc_array, eye_array
+ >>> A = csc_array([[3, 0, 0], [1, -1, 0], [2, 0, 1]], dtype=float)
+ >>> spbandwidth(A)
+ (2, 0)
+ >>> D = eye_array(3, format='csr')
+ >>> spbandwidth(D)
+ (0, 0)
+ """
+ if not (issparse(A) and A.format in ("csc", "csr", "coo", "dia", "dok")):
+ warn('spbandwidth needs sparse format not LIL and BSR. Converting to CSR.',
+ SparseEfficiencyWarning, stacklevel=2)
+ A = csr_array(A)
+
+ # bsr and lil are better off converting to csr
+ if A.format == "dia":
+ return max(0, -A.offsets.min().item()), max(0, A.offsets.max().item())
+ if A.format in ("csc", "csr"):
+ indptr, indices = A.indptr, A.indices
+ N = len(indptr) - 1
+ gap = np.repeat(np.arange(N), np.diff(indptr)) - indices
+ if A.format == 'csr':
+ gap = -gap
+ elif A.format == "coo":
+ gap = A.coords[1] - A.coords[0]
+ elif A.format == "dok":
+ gap = [(c - r) for r, c in A.keys()] + [0]
+ return -min(gap), max(gap)
+ return max(-np.min(gap).item(), 0), max(np.max(gap).item(), 0)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/tests/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/tests/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/tests/test_linsolve.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/tests/test_linsolve.py
new file mode 100644
index 0000000000000000000000000000000000000000..c9c5bfed1b5458a8c43ee2234087f164f2a37a80
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_dsolve/tests/test_linsolve.py
@@ -0,0 +1,921 @@
+import sys
+import threading
+
+import numpy as np
+from numpy import array, finfo, arange, eye, all, unique, ones, dot
+import numpy.random as random
+from numpy.testing import (
+ assert_array_almost_equal, assert_almost_equal,
+ assert_equal, assert_array_equal, assert_, assert_allclose,
+ assert_warns, suppress_warnings)
+import pytest
+from pytest import raises as assert_raises
+
+import scipy.linalg
+from scipy.linalg import norm, inv
+from scipy.sparse import (dia_array, SparseEfficiencyWarning, csc_array,
+ csr_array, eye_array, issparse, dok_array, lil_array, bsr_array, kron)
+from scipy.sparse.linalg import SuperLU
+from scipy.sparse.linalg._dsolve import (spsolve, use_solver, splu, spilu,
+ MatrixRankWarning, _superlu, spsolve_triangular, factorized,
+ is_sptriangular, spbandwidth)
+import scipy.sparse
+
+from scipy._lib._testutils import check_free_memory
+from scipy._lib._util import ComplexWarning
+
+
+sup_sparse_efficiency = suppress_warnings()
+sup_sparse_efficiency.filter(SparseEfficiencyWarning)
+
+# scikits.umfpack is not a SciPy dependency but it is optionally used in
+# dsolve, so check whether it's available
+try:
+ import scikits.umfpack as umfpack
+ has_umfpack = True
+except ImportError:
+ has_umfpack = False
+
+def toarray(a):
+ if issparse(a):
+ return a.toarray()
+ else:
+ return a
+
+
+def setup_bug_8278():
+ N = 2 ** 6
+ h = 1/N
+ Ah1D = dia_array(([-1, 2, -1], [-1, 0, 1]), shape=(N-1, N-1))/(h**2)
+ eyeN = eye_array(N - 1)
+ A = (kron(eyeN, kron(eyeN, Ah1D))
+ + kron(eyeN, kron(Ah1D, eyeN))
+ + kron(Ah1D, kron(eyeN, eyeN)))
+ b = np.random.rand((N-1)**3)
+ return A, b
+
+
+class TestFactorized:
+ def setup_method(self):
+ n = 5
+ d = arange(n) + 1
+ self.n = n
+ self.A = dia_array(((d, 2*d, d[::-1]), (-3, 0, 5)), shape=(n,n)).tocsc()
+ random.seed(1234)
+
+ def _check_singular(self):
+ A = csc_array((5,5), dtype='d')
+ b = ones(5)
+ assert_array_almost_equal(0. * b, factorized(A)(b))
+
+ def _check_non_singular(self):
+ # Make a diagonal dominant, to make sure it is not singular
+ n = 5
+ a = csc_array(random.rand(n, n))
+ b = ones(n)
+
+ expected = splu(a).solve(b)
+ assert_array_almost_equal(factorized(a)(b), expected)
+
+ def test_singular_without_umfpack(self):
+ use_solver(useUmfpack=False)
+ with assert_raises(RuntimeError, match="Factor is exactly singular"):
+ self._check_singular()
+
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_singular_with_umfpack(self):
+ use_solver(useUmfpack=True)
+ with suppress_warnings() as sup:
+ sup.filter(RuntimeWarning, "divide by zero encountered in double_scalars")
+ assert_warns(umfpack.UmfpackWarning, self._check_singular)
+
+ def test_non_singular_without_umfpack(self):
+ use_solver(useUmfpack=False)
+ self._check_non_singular()
+
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_non_singular_with_umfpack(self):
+ use_solver(useUmfpack=True)
+ self._check_non_singular()
+
+ def test_cannot_factorize_nonsquare_matrix_without_umfpack(self):
+ use_solver(useUmfpack=False)
+ msg = "can only factor square matrices"
+ with assert_raises(ValueError, match=msg):
+ factorized(self.A[:, :4])
+
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_factorizes_nonsquare_matrix_with_umfpack(self):
+ use_solver(useUmfpack=True)
+ # does not raise
+ factorized(self.A[:,:4])
+
+ def test_call_with_incorrectly_sized_matrix_without_umfpack(self):
+ use_solver(useUmfpack=False)
+ solve = factorized(self.A)
+ b = random.rand(4)
+ B = random.rand(4, 3)
+ BB = random.rand(self.n, 3, 9)
+
+ with assert_raises(ValueError, match="is of incompatible size"):
+ solve(b)
+ with assert_raises(ValueError, match="is of incompatible size"):
+ solve(B)
+ with assert_raises(ValueError,
+ match="object too deep for desired array"):
+ solve(BB)
+
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_call_with_incorrectly_sized_matrix_with_umfpack(self):
+ use_solver(useUmfpack=True)
+ solve = factorized(self.A)
+ b = random.rand(4)
+ B = random.rand(4, 3)
+ BB = random.rand(self.n, 3, 9)
+
+ # does not raise
+ solve(b)
+ msg = "object too deep for desired array"
+ with assert_raises(ValueError, match=msg):
+ solve(B)
+ with assert_raises(ValueError, match=msg):
+ solve(BB)
+
+ def test_call_with_cast_to_complex_without_umfpack(self):
+ use_solver(useUmfpack=False)
+ solve = factorized(self.A)
+ b = random.rand(4)
+ for t in [np.complex64, np.complex128]:
+ with assert_raises(TypeError, match="Cannot cast array data"):
+ solve(b.astype(t))
+
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_call_with_cast_to_complex_with_umfpack(self):
+ use_solver(useUmfpack=True)
+ solve = factorized(self.A)
+ b = random.rand(4)
+ for t in [np.complex64, np.complex128]:
+ assert_warns(ComplexWarning, solve, b.astype(t))
+
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_assume_sorted_indices_flag(self):
+ # a sparse matrix with unsorted indices
+ unsorted_inds = np.array([2, 0, 1, 0])
+ data = np.array([10, 16, 5, 0.4])
+ indptr = np.array([0, 1, 2, 4])
+ A = csc_array((data, unsorted_inds, indptr), (3, 3))
+ b = ones(3)
+
+ # should raise when incorrectly assuming indices are sorted
+ use_solver(useUmfpack=True, assumeSortedIndices=True)
+ with assert_raises(RuntimeError,
+ match="UMFPACK_ERROR_invalid_matrix"):
+ factorized(A)
+
+ # should sort indices and succeed when not assuming indices are sorted
+ use_solver(useUmfpack=True, assumeSortedIndices=False)
+ expected = splu(A.copy()).solve(b)
+
+ assert_equal(A.has_sorted_indices, 0)
+ assert_array_almost_equal(factorized(A)(b), expected)
+
+ @pytest.mark.slow
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_bug_8278(self):
+ check_free_memory(8000)
+ use_solver(useUmfpack=True)
+ A, b = setup_bug_8278()
+ A = A.tocsc()
+ f = factorized(A)
+ x = f(b)
+ assert_array_almost_equal(A @ x, b)
+
+
+class TestLinsolve:
+ def setup_method(self):
+ use_solver(useUmfpack=False)
+
+ def test_singular(self):
+ A = csc_array((5,5), dtype='d')
+ b = array([1, 2, 3, 4, 5],dtype='d')
+ with suppress_warnings() as sup:
+ sup.filter(MatrixRankWarning, "Matrix is exactly singular")
+ x = spsolve(A, b)
+ assert_(not np.isfinite(x).any())
+
+ def test_singular_gh_3312(self):
+ # "Bad" test case that leads SuperLU to call LAPACK with invalid
+ # arguments. Check that it fails moderately gracefully.
+ ij = np.array([(17, 0), (17, 6), (17, 12), (10, 13)], dtype=np.int32)
+ v = np.array([0.284213, 0.94933781, 0.15767017, 0.38797296])
+ A = csc_array((v, ij.T), shape=(20, 20))
+ b = np.arange(20)
+
+ try:
+ # should either raise a runtime error or return value
+ # appropriate for singular input (which yields the warning)
+ with suppress_warnings() as sup:
+ sup.filter(MatrixRankWarning, "Matrix is exactly singular")
+ x = spsolve(A, b)
+ assert not np.isfinite(x).any()
+ except RuntimeError:
+ pass
+
+ @pytest.mark.parametrize('format', ['csc', 'csr'])
+ @pytest.mark.parametrize('idx_dtype', [np.int32, np.int64])
+ def test_twodiags(self, format: str, idx_dtype: np.dtype):
+ A = dia_array(([[1, 2, 3, 4, 5], [6, 5, 8, 9, 10]], [0, 1]),
+ shape=(5, 5)).asformat(format)
+ b = array([1, 2, 3, 4, 5])
+
+ # condition number of A
+ cond_A = norm(A.toarray(), 2) * norm(inv(A.toarray()), 2)
+
+ for t in ['f','d','F','D']:
+ eps = finfo(t).eps # floating point epsilon
+ b = b.astype(t)
+ Asp = A.astype(t)
+ Asp.indices = Asp.indices.astype(idx_dtype, copy=False)
+ Asp.indptr = Asp.indptr.astype(idx_dtype, copy=False)
+
+ x = spsolve(Asp, b)
+ assert_(norm(b - Asp@x) < 10 * cond_A * eps)
+
+ def test_bvector_smoketest(self):
+ Adense = array([[0., 1., 1.],
+ [1., 0., 1.],
+ [0., 0., 1.]])
+ As = csc_array(Adense)
+ random.seed(1234)
+ x = random.randn(3)
+ b = As@x
+ x2 = spsolve(As, b)
+
+ assert_array_almost_equal(x, x2)
+
+ def test_bmatrix_smoketest(self):
+ Adense = array([[0., 1., 1.],
+ [1., 0., 1.],
+ [0., 0., 1.]])
+ As = csc_array(Adense)
+ random.seed(1234)
+ x = random.randn(3, 4)
+ Bdense = As.dot(x)
+ Bs = csc_array(Bdense)
+ x2 = spsolve(As, Bs)
+ assert_array_almost_equal(x, x2.toarray())
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_non_square(self):
+ # A is not square.
+ A = ones((3, 4))
+ b = ones((4, 1))
+ assert_raises(ValueError, spsolve, A, b)
+ # A2 and b2 have incompatible shapes.
+ A2 = csc_array(eye(3))
+ b2 = array([1.0, 2.0])
+ assert_raises(ValueError, spsolve, A2, b2)
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_example_comparison(self):
+ row = array([0,0,1,2,2,2])
+ col = array([0,2,2,0,1,2])
+ data = array([1,2,3,-4,5,6])
+ sM = csr_array((data,(row,col)), shape=(3,3), dtype=float)
+ M = sM.toarray()
+
+ row = array([0,0,1,1,0,0])
+ col = array([0,2,1,1,0,0])
+ data = array([1,1,1,1,1,1])
+ sN = csr_array((data, (row,col)), shape=(3,3), dtype=float)
+ N = sN.toarray()
+
+ sX = spsolve(sM, sN)
+ X = scipy.linalg.solve(M, N)
+
+ assert_array_almost_equal(X, sX.toarray())
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_shape_compatibility(self):
+ use_solver(useUmfpack=True)
+ A = csc_array([[1., 0], [0, 2]])
+ bs = [
+ [1, 6],
+ array([1, 6]),
+ [[1], [6]],
+ array([[1], [6]]),
+ csc_array([[1], [6]]),
+ csr_array([[1], [6]]),
+ dok_array([[1], [6]]),
+ bsr_array([[1], [6]]),
+ array([[1., 2., 3.], [6., 8., 10.]]),
+ csc_array([[1., 2., 3.], [6., 8., 10.]]),
+ csr_array([[1., 2., 3.], [6., 8., 10.]]),
+ dok_array([[1., 2., 3.], [6., 8., 10.]]),
+ bsr_array([[1., 2., 3.], [6., 8., 10.]]),
+ ]
+
+ for b in bs:
+ x = np.linalg.solve(A.toarray(), toarray(b))
+ for spmattype in [csc_array, csr_array, dok_array, lil_array]:
+ x1 = spsolve(spmattype(A), b, use_umfpack=True)
+ x2 = spsolve(spmattype(A), b, use_umfpack=False)
+
+ # check solution
+ if x.ndim == 2 and x.shape[1] == 1:
+ # interprets also these as "vectors"
+ x = x.ravel()
+
+ assert_array_almost_equal(toarray(x1), x,
+ err_msg=repr((b, spmattype, 1)))
+ assert_array_almost_equal(toarray(x2), x,
+ err_msg=repr((b, spmattype, 2)))
+
+ # dense vs. sparse output ("vectors" are always dense)
+ if issparse(b) and x.ndim > 1:
+ assert_(issparse(x1), repr((b, spmattype, 1)))
+ assert_(issparse(x2), repr((b, spmattype, 2)))
+ else:
+ assert_(isinstance(x1, np.ndarray), repr((b, spmattype, 1)))
+ assert_(isinstance(x2, np.ndarray), repr((b, spmattype, 2)))
+
+ # check output shape
+ if x.ndim == 1:
+ # "vector"
+ assert_equal(x1.shape, (A.shape[1],))
+ assert_equal(x2.shape, (A.shape[1],))
+ else:
+ # "matrix"
+ assert_equal(x1.shape, x.shape)
+ assert_equal(x2.shape, x.shape)
+
+ A = csc_array((3, 3))
+ b = csc_array((1, 3))
+ assert_raises(ValueError, spsolve, A, b)
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_ndarray_support(self):
+ A = array([[1., 2.], [2., 0.]])
+ x = array([[1., 1.], [0.5, -0.5]])
+ b = array([[2., 0.], [2., 2.]])
+
+ assert_array_almost_equal(x, spsolve(A, b))
+
+ def test_gssv_badinput(self):
+ N = 10
+ d = arange(N) + 1.0
+ A = dia_array(((d, 2*d, d[::-1]), (-3, 0, 5)), shape=(N, N))
+
+ for container in (csc_array, csr_array):
+ A = container(A)
+ b = np.arange(N)
+
+ def not_c_contig(x):
+ return x.repeat(2)[::2]
+
+ def not_1dim(x):
+ return x[:,None]
+
+ def bad_type(x):
+ return x.astype(bool)
+
+ def too_short(x):
+ return x[:-1]
+
+ badops = [not_c_contig, not_1dim, bad_type, too_short]
+
+ for badop in badops:
+ msg = f"{container!r} {badop!r}"
+ # Not C-contiguous
+ assert_raises((ValueError, TypeError), _superlu.gssv,
+ N, A.nnz, badop(A.data), A.indices, A.indptr,
+ b, int(A.format == 'csc'), err_msg=msg)
+ assert_raises((ValueError, TypeError), _superlu.gssv,
+ N, A.nnz, A.data, badop(A.indices), A.indptr,
+ b, int(A.format == 'csc'), err_msg=msg)
+ assert_raises((ValueError, TypeError), _superlu.gssv,
+ N, A.nnz, A.data, A.indices, badop(A.indptr),
+ b, int(A.format == 'csc'), err_msg=msg)
+
+ def test_sparsity_preservation(self):
+ ident = csc_array([
+ [1, 0, 0],
+ [0, 1, 0],
+ [0, 0, 1]])
+ b = csc_array([
+ [0, 1],
+ [1, 0],
+ [0, 0]])
+ x = spsolve(ident, b)
+ assert_equal(ident.nnz, 3)
+ assert_equal(b.nnz, 2)
+ assert_equal(x.nnz, 2)
+ assert_allclose(x.toarray(), b.toarray(), atol=1e-12, rtol=1e-12)
+
+ def test_dtype_cast(self):
+ A_real = scipy.sparse.csr_array([[1, 2, 0],
+ [0, 0, 3],
+ [4, 0, 5]])
+ A_complex = scipy.sparse.csr_array([[1, 2, 0],
+ [0, 0, 3],
+ [4, 0, 5 + 1j]])
+ b_real = np.array([1,1,1])
+ b_complex = np.array([1,1,1]) + 1j*np.array([1,1,1])
+ x = spsolve(A_real, b_real)
+ assert_(np.issubdtype(x.dtype, np.floating))
+ x = spsolve(A_real, b_complex)
+ assert_(np.issubdtype(x.dtype, np.complexfloating))
+ x = spsolve(A_complex, b_real)
+ assert_(np.issubdtype(x.dtype, np.complexfloating))
+ x = spsolve(A_complex, b_complex)
+ assert_(np.issubdtype(x.dtype, np.complexfloating))
+
+ @pytest.mark.slow
+ @pytest.mark.skipif(not has_umfpack, reason="umfpack not available")
+ def test_bug_8278(self):
+ check_free_memory(8000)
+ use_solver(useUmfpack=True)
+ A, b = setup_bug_8278()
+ x = spsolve(A, b)
+ assert_array_almost_equal(A @ x, b)
+
+
+class TestSplu:
+ def setup_method(self):
+ use_solver(useUmfpack=False)
+ n = 40
+ d = arange(n) + 1
+ self.n = n
+ self.A = dia_array(((d, 2*d, d[::-1]), (-3, 0, 5)), shape=(n, n)).tocsc()
+ random.seed(1234)
+
+ def _smoketest(self, spxlu, check, dtype, idx_dtype):
+ if np.issubdtype(dtype, np.complexfloating):
+ A = self.A + 1j*self.A.T
+ else:
+ A = self.A
+
+ A = A.astype(dtype)
+ A.indices = A.indices.astype(idx_dtype, copy=False)
+ A.indptr = A.indptr.astype(idx_dtype, copy=False)
+ lu = spxlu(A)
+
+ rng = random.RandomState(1234)
+
+ # Input shapes
+ for k in [None, 1, 2, self.n, self.n+2]:
+ msg = f"k={k!r}"
+
+ if k is None:
+ b = rng.rand(self.n)
+ else:
+ b = rng.rand(self.n, k)
+
+ if np.issubdtype(dtype, np.complexfloating):
+ b = b + 1j*rng.rand(*b.shape)
+ b = b.astype(dtype)
+
+ x = lu.solve(b)
+ check(A, b, x, msg)
+
+ x = lu.solve(b, 'T')
+ check(A.T, b, x, msg)
+
+ x = lu.solve(b, 'H')
+ check(A.T.conj(), b, x, msg)
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_splu_smoketest(self):
+ self._internal_test_splu_smoketest()
+
+ def _internal_test_splu_smoketest(self):
+ # Check that splu works at all
+ def check(A, b, x, msg=""):
+ eps = np.finfo(A.dtype).eps
+ r = A @ x
+ assert_(abs(r - b).max() < 1e3*eps, msg)
+
+ for dtype in [np.float32, np.float64, np.complex64, np.complex128]:
+ for idx_dtype in [np.int32, np.int64]:
+ self._smoketest(splu, check, dtype, idx_dtype)
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_spilu_smoketest(self):
+ self._internal_test_spilu_smoketest()
+
+ def _internal_test_spilu_smoketest(self):
+ errors = []
+
+ def check(A, b, x, msg=""):
+ r = A @ x
+ err = abs(r - b).max()
+ assert_(err < 1e-2, msg)
+ if b.dtype in (np.float64, np.complex128):
+ errors.append(err)
+
+ for dtype in [np.float32, np.float64, np.complex64, np.complex128]:
+ for idx_dtype in [np.int32, np.int64]:
+ self._smoketest(spilu, check, dtype, idx_dtype)
+
+ assert_(max(errors) > 1e-5)
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_spilu_drop_rule(self):
+ # Test passing in the drop_rule argument to spilu.
+ A = eye_array(2)
+
+ rules = [
+ b'basic,area'.decode('ascii'), # unicode
+ b'basic,area', # ascii
+ [b'basic', b'area'.decode('ascii')]
+ ]
+ for rule in rules:
+ # Argument should be accepted
+ assert_(isinstance(spilu(A, drop_rule=rule), SuperLU))
+
+ def test_splu_nnz0(self):
+ A = csc_array((5,5), dtype='d')
+ assert_raises(RuntimeError, splu, A)
+
+ def test_spilu_nnz0(self):
+ A = csc_array((5,5), dtype='d')
+ assert_raises(RuntimeError, spilu, A)
+
+ def test_splu_basic(self):
+ # Test basic splu functionality.
+ n = 30
+ rng = random.RandomState(12)
+ a = rng.rand(n, n)
+ a[a < 0.95] = 0
+ # First test with a singular matrix
+ a[:, 0] = 0
+ a_ = csc_array(a)
+ # Matrix is exactly singular
+ assert_raises(RuntimeError, splu, a_)
+
+ # Make a diagonal dominant, to make sure it is not singular
+ a += 4*eye(n)
+ a_ = csc_array(a)
+ lu = splu(a_)
+ b = ones(n)
+ x = lu.solve(b)
+ assert_almost_equal(dot(a, x), b)
+
+ def test_splu_perm(self):
+ # Test the permutation vectors exposed by splu.
+ n = 30
+ a = random.random((n, n))
+ a[a < 0.95] = 0
+ # Make a diagonal dominant, to make sure it is not singular
+ a += 4*eye(n)
+ a_ = csc_array(a)
+ lu = splu(a_)
+ # Check that the permutation indices do belong to [0, n-1].
+ for perm in (lu.perm_r, lu.perm_c):
+ assert_(all(perm > -1))
+ assert_(all(perm < n))
+ assert_equal(len(unique(perm)), len(perm))
+
+ # Now make a symmetric, and test that the two permutation vectors are
+ # the same
+ # Note: a += a.T relies on undefined behavior.
+ a = a + a.T
+ a_ = csc_array(a)
+ lu = splu(a_)
+ assert_array_equal(lu.perm_r, lu.perm_c)
+
+ @pytest.mark.parametrize("splu_fun, rtol", [(splu, 1e-7), (spilu, 1e-1)])
+ def test_natural_permc(self, splu_fun, rtol):
+ # Test that the "NATURAL" permc_spec does not permute the matrix
+ rng = np.random.RandomState(42)
+ n = 500
+ p = 0.01
+ A = scipy.sparse.random(n, n, p, random_state=rng)
+ x = rng.rand(n)
+ # Make A diagonal dominant to make sure it is not singular
+ A += (n+1)*scipy.sparse.eye_array(n)
+ A_ = csc_array(A)
+ b = A_ @ x
+
+ # without permc_spec, permutation is not identity
+ lu = splu_fun(A_)
+ assert_(np.any(lu.perm_c != np.arange(n)))
+
+ # with permc_spec="NATURAL", permutation is identity
+ lu = splu_fun(A_, permc_spec="NATURAL")
+ assert_array_equal(lu.perm_c, np.arange(n))
+
+ # Also, lu decomposition is valid
+ x2 = lu.solve(b)
+ assert_allclose(x, x2, rtol=rtol)
+
+ @pytest.mark.skipif(not hasattr(sys, 'getrefcount'), reason="no sys.getrefcount")
+ def test_lu_refcount(self):
+ # Test that we are keeping track of the reference count with splu.
+ n = 30
+ a = random.random((n, n))
+ a[a < 0.95] = 0
+ # Make a diagonal dominant, to make sure it is not singular
+ a += 4*eye(n)
+ a_ = csc_array(a)
+ lu = splu(a_)
+
+ # And now test that we don't have a refcount bug
+ rc = sys.getrefcount(lu)
+ for attr in ('perm_r', 'perm_c'):
+ perm = getattr(lu, attr)
+ assert_equal(sys.getrefcount(lu), rc + 1)
+ del perm
+ assert_equal(sys.getrefcount(lu), rc)
+
+ def test_bad_inputs(self):
+ A = self.A.tocsc()
+
+ assert_raises(ValueError, splu, A[:,:4])
+ assert_raises(ValueError, spilu, A[:,:4])
+
+ for lu in [splu(A), spilu(A)]:
+ b = random.rand(42)
+ B = random.rand(42, 3)
+ BB = random.rand(self.n, 3, 9)
+ assert_raises(ValueError, lu.solve, b)
+ assert_raises(ValueError, lu.solve, B)
+ assert_raises(ValueError, lu.solve, BB)
+ assert_raises(TypeError, lu.solve,
+ b.astype(np.complex64))
+ assert_raises(TypeError, lu.solve,
+ b.astype(np.complex128))
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_superlu_dlamch_i386_nan(self):
+ # SuperLU 4.3 calls some functions returning floats without
+ # declaring them. On i386@linux call convention, this fails to
+ # clear floating point registers after call. As a result, NaN
+ # can appear in the next floating point operation made.
+ #
+ # Here's a test case that triggered the issue.
+ n = 8
+ d = np.arange(n) + 1
+ A = dia_array(((d, 2*d, d[::-1]), (-3, 0, 5)), shape=(n, n))
+ A = A.astype(np.float32)
+ spilu(A)
+ A = A + 1j*A
+ B = A.toarray()
+ assert_(not np.isnan(B).any())
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_lu_attr(self):
+
+ def check(dtype, complex_2=False):
+ A = self.A.astype(dtype)
+
+ if complex_2:
+ A = A + 1j*A.T
+
+ n = A.shape[0]
+ lu = splu(A)
+
+ # Check that the decomposition is as advertised
+
+ Pc = np.zeros((n, n))
+ Pc[np.arange(n), lu.perm_c] = 1
+
+ Pr = np.zeros((n, n))
+ Pr[lu.perm_r, np.arange(n)] = 1
+
+ Ad = A.toarray()
+ lhs = Pr.dot(Ad).dot(Pc)
+ rhs = (lu.L @ lu.U).toarray()
+
+ eps = np.finfo(dtype).eps
+
+ assert_allclose(lhs, rhs, atol=100*eps)
+
+ check(np.float32)
+ check(np.float64)
+ check(np.complex64)
+ check(np.complex128)
+ check(np.complex64, True)
+ check(np.complex128, True)
+
+ @pytest.mark.thread_unsafe
+ @pytest.mark.slow
+ @sup_sparse_efficiency
+ def test_threads_parallel(self):
+ oks = []
+
+ def worker():
+ try:
+ self.test_splu_basic()
+ self._internal_test_splu_smoketest()
+ self._internal_test_spilu_smoketest()
+ oks.append(True)
+ except Exception:
+ pass
+
+ threads = [threading.Thread(target=worker)
+ for k in range(20)]
+ for t in threads:
+ t.start()
+ for t in threads:
+ t.join()
+
+ assert_equal(len(oks), 20)
+
+ @pytest.mark.thread_unsafe
+ def test_singular_matrix(self):
+ # Test that SuperLU does not print to stdout when a singular matrix is
+ # passed. See gh-20993.
+ A = eye_array(10, format='csr')
+ A[-1, -1] = 0
+ b = np.zeros(10)
+ with pytest.warns(MatrixRankWarning):
+ res = spsolve(A, b)
+ assert np.isnan(res).all()
+
+
+class TestGstrsErrors:
+ def setup_method(self):
+ self.A = array([[1.0,2.0,3.0],[4.0,5.0,6.0],[7.0,8.0,9.0]], dtype=np.float64)
+ self.b = np.array([[1.0],[2.0],[3.0]], dtype=np.float64)
+
+ def test_trans(self):
+ L = scipy.sparse.tril(self.A, format='csc')
+ U = scipy.sparse.triu(self.A, k=1, format='csc')
+ with assert_raises(ValueError, match="trans must be N, T, or H"):
+ _superlu.gstrs('X', L.shape[0], L.nnz, L.data, L.indices, L.indptr,
+ U.shape[0], U.nnz, U.data, U.indices, U.indptr, self.b)
+
+ def test_shape_LU(self):
+ L = scipy.sparse.tril(self.A[0:2,0:2], format='csc')
+ U = scipy.sparse.triu(self.A, k=1, format='csc')
+ with assert_raises(ValueError, match="L and U must have the same dimension"):
+ _superlu.gstrs('N', L.shape[0], L.nnz, L.data, L.indices, L.indptr,
+ U.shape[0], U.nnz, U.data, U.indices, U.indptr, self.b)
+
+ def test_shape_b(self):
+ L = scipy.sparse.tril(self.A, format='csc')
+ U = scipy.sparse.triu(self.A, k=1, format='csc')
+ with assert_raises(ValueError, match="right hand side array has invalid shape"):
+ _superlu.gstrs('N', L.shape[0], L.nnz, L.data, L.indices, L.indptr,
+ U.shape[0], U.nnz, U.data, U.indices, U.indptr,
+ self.b[0:2])
+
+ def test_types_differ(self):
+ L = scipy.sparse.tril(self.A.astype(np.float32), format='csc')
+ U = scipy.sparse.triu(self.A, k=1, format='csc')
+ with assert_raises(TypeError, match="nzvals types of L and U differ"):
+ _superlu.gstrs('N', L.shape[0], L.nnz, L.data, L.indices, L.indptr,
+ U.shape[0], U.nnz, U.data, U.indices, U.indptr, self.b)
+
+ def test_types_unsupported(self):
+ L = scipy.sparse.tril(self.A.astype(np.uint8), format='csc')
+ U = scipy.sparse.triu(self.A.astype(np.uint8), k=1, format='csc')
+ with assert_raises(TypeError, match="nzvals is not of a type supported"):
+ _superlu.gstrs('N', L.shape[0], L.nnz, L.data, L.indices, L.indptr,
+ U.shape[0], U.nnz, U.data, U.indices, U.indptr,
+ self.b.astype(np.uint8))
+
+class TestSpsolveTriangular:
+ def setup_method(self):
+ use_solver(useUmfpack=False)
+
+ @pytest.mark.parametrize("fmt",["csr","csc"])
+ def test_zero_diagonal(self,fmt):
+ n = 5
+ rng = np.random.default_rng(43876432987)
+ A = rng.standard_normal((n, n))
+ b = np.arange(n)
+ A = scipy.sparse.tril(A, k=0, format=fmt)
+
+ x = spsolve_triangular(A, b, unit_diagonal=True, lower=True)
+
+ A.setdiag(1)
+ assert_allclose(A.dot(x), b)
+
+ # Regression test from gh-15199
+ A = np.array([[0, 0, 0], [1, 0, 0], [1, 1, 0]], dtype=np.float64)
+ b = np.array([1., 2., 3.])
+ with suppress_warnings() as sup:
+ sup.filter(SparseEfficiencyWarning, "CSC or CSR matrix format is")
+ spsolve_triangular(A, b, unit_diagonal=True)
+
+ @pytest.mark.parametrize("fmt",["csr","csc"])
+ def test_singular(self,fmt):
+ n = 5
+ if fmt == "csr":
+ A = csr_array((n, n))
+ else:
+ A = csc_array((n, n))
+ b = np.arange(n)
+ for lower in (True, False):
+ assert_raises(scipy.linalg.LinAlgError,
+ spsolve_triangular, A, b, lower=lower)
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_bad_shape(self):
+ # A is not square.
+ A = np.zeros((3, 4))
+ b = ones((4, 1))
+ assert_raises(ValueError, spsolve_triangular, A, b)
+ # A2 and b2 have incompatible shapes.
+ A2 = csr_array(eye(3))
+ b2 = array([1.0, 2.0])
+ assert_raises(ValueError, spsolve_triangular, A2, b2)
+
+ @pytest.mark.thread_unsafe
+ @sup_sparse_efficiency
+ def test_input_types(self):
+ A = array([[1., 0.], [1., 2.]])
+ b = array([[2., 0.], [2., 2.]])
+ for matrix_type in (array, csc_array, csr_array):
+ x = spsolve_triangular(matrix_type(A), b, lower=True)
+ assert_array_almost_equal(A.dot(x), b)
+
+ @pytest.mark.thread_unsafe
+ @pytest.mark.slow
+ @sup_sparse_efficiency
+ @pytest.mark.parametrize("n", [10, 10**2, 10**3])
+ @pytest.mark.parametrize("m", [1, 10])
+ @pytest.mark.parametrize("lower", [True, False])
+ @pytest.mark.parametrize("format", ["csr", "csc"])
+ @pytest.mark.parametrize("unit_diagonal", [False, True])
+ @pytest.mark.parametrize("choice_of_A", ["real", "complex"])
+ @pytest.mark.parametrize("choice_of_b", ["floats", "ints", "complexints"])
+ def test_random(self, n, m, lower, format, unit_diagonal, choice_of_A, choice_of_b):
+ def random_triangle_matrix(n, lower=True, format="csr", choice_of_A="real"):
+ if choice_of_A == "real":
+ dtype = np.float64
+ elif choice_of_A == "complex":
+ dtype = np.complex128
+ else:
+ raise ValueError("choice_of_A must be 'real' or 'complex'.")
+ rng = np.random.default_rng(789002319)
+ rvs = rng.random
+ A = scipy.sparse.random(n, n, density=0.1, format='lil', dtype=dtype,
+ random_state=rng, data_rvs=rvs)
+ if lower:
+ A = scipy.sparse.tril(A, format="lil")
+ else:
+ A = scipy.sparse.triu(A, format="lil")
+ for i in range(n):
+ A[i, i] = np.random.rand() + 1
+ if format == "csc":
+ A = A.tocsc(copy=False)
+ else:
+ A = A.tocsr(copy=False)
+ return A
+
+ np.random.seed(1234)
+ A = random_triangle_matrix(n, lower=lower)
+ if choice_of_b == "floats":
+ b = np.random.rand(n, m)
+ elif choice_of_b == "ints":
+ b = np.random.randint(-9, 9, (n, m))
+ elif choice_of_b == "complexints":
+ b = np.random.randint(-9, 9, (n, m)) + np.random.randint(-9, 9, (n, m)) * 1j
+ else:
+ raise ValueError(
+ "choice_of_b must be 'floats', 'ints', or 'complexints'.")
+ x = spsolve_triangular(A, b, lower=lower, unit_diagonal=unit_diagonal)
+ if unit_diagonal:
+ A.setdiag(1)
+ assert_allclose(A.dot(x), b, atol=1.5e-6)
+
+
+@pytest.mark.thread_unsafe
+@sup_sparse_efficiency
+@pytest.mark.parametrize("nnz", [10, 10**2, 10**3])
+@pytest.mark.parametrize("fmt", ["csr", "csc", "coo", "dia", "dok", "lil"])
+def test_is_sptriangular_and_spbandwidth(nnz, fmt):
+ rng = np.random.default_rng(42)
+
+ N = nnz // 2
+ dens = 0.1
+ A = scipy.sparse.random_array((N, N), density=dens, format="csr", rng=rng)
+ A[1, 3] = A[3, 1] = 22 # ensure not upper or lower
+ A = A.asformat(fmt)
+ AU = scipy.sparse.triu(A, format=fmt)
+ AL = scipy.sparse.tril(A, format=fmt)
+ D = 0.1 * scipy.sparse.eye_array(N, format=fmt)
+
+ assert is_sptriangular(A) == (False, False)
+ assert is_sptriangular(AL) == (True, False)
+ assert is_sptriangular(AU) == (False, True)
+ assert is_sptriangular(D) == (True, True)
+
+ assert spbandwidth(A) == scipy.linalg.bandwidth(A.toarray())
+ assert spbandwidth(AU) == scipy.linalg.bandwidth(AU.toarray())
+ assert spbandwidth(AL) == scipy.linalg.bandwidth(AL.toarray())
+ assert spbandwidth(D) == scipy.linalg.bandwidth(D.toarray())
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..25278d34ecd3353d409a25f7a94797902fe6ef93
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__init__.py
@@ -0,0 +1,22 @@
+"""
+Sparse Eigenvalue Solvers
+-------------------------
+
+The submodules of sparse.linalg._eigen:
+ 1. lobpcg: Locally Optimal Block Preconditioned Conjugate Gradient Method
+
+"""
+from .arpack import *
+from .lobpcg import *
+from ._svds import svds
+
+from . import arpack
+
+__all__ = [
+ 'ArpackError', 'ArpackNoConvergence',
+ 'eigs', 'eigsh', 'lobpcg', 'svds'
+]
+
+from scipy._lib._testutils import PytestTester
+test = PytestTester(__name__)
+del PytestTester
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..f72ea484c2e768d7e5d7ff4d99f4e32b950a995f
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__pycache__/_svds.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__pycache__/_svds.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b780320a47af635ca9e402c9e068e54cb81554c6
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/__pycache__/_svds.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/_svds.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/_svds.py
new file mode 100644
index 0000000000000000000000000000000000000000..ce57e841f9f163edd3945f248a653c94acd2a93c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/_svds.py
@@ -0,0 +1,540 @@
+import math
+import numpy as np
+
+from .arpack import _arpack # type: ignore[attr-defined]
+from . import eigsh
+
+from scipy._lib._util import check_random_state, _transition_to_rng
+from scipy.sparse.linalg._interface import LinearOperator, aslinearoperator
+from scipy.sparse.linalg._eigen.lobpcg import lobpcg # type: ignore[no-redef]
+from scipy.sparse.linalg._svdp import _svdp
+from scipy.linalg import svd
+
+arpack_int = _arpack.timing.nbx.dtype
+__all__ = ['svds']
+
+
+def _herm(x):
+ return x.T.conj()
+
+
+def _iv(A, k, ncv, tol, which, v0, maxiter,
+ return_singular, solver, rng):
+
+ # input validation/standardization for `solver`
+ # out of order because it's needed for other parameters
+ solver = str(solver).lower()
+ solvers = {"arpack", "lobpcg", "propack"}
+ if solver not in solvers:
+ raise ValueError(f"solver must be one of {solvers}.")
+
+ # input validation/standardization for `A`
+ A = aslinearoperator(A) # this takes care of some input validation
+ if not np.issubdtype(A.dtype, np.number):
+ message = "`A` must be of numeric data type."
+ raise ValueError(message)
+ if math.prod(A.shape) == 0:
+ message = "`A` must not be empty."
+ raise ValueError(message)
+
+ # input validation/standardization for `k`
+ kmax = min(A.shape) if solver == 'propack' else min(A.shape) - 1
+ if int(k) != k or not (0 < k <= kmax):
+ message = "`k` must be an integer satisfying `0 < k < min(A.shape)`."
+ raise ValueError(message)
+ k = int(k)
+
+ # input validation/standardization for `ncv`
+ if solver == "arpack" and ncv is not None:
+ if int(ncv) != ncv or not (k < ncv < min(A.shape)):
+ message = ("`ncv` must be an integer satisfying "
+ "`k < ncv < min(A.shape)`.")
+ raise ValueError(message)
+ ncv = int(ncv)
+
+ # input validation/standardization for `tol`
+ if tol < 0 or not np.isfinite(tol):
+ message = "`tol` must be a non-negative floating point value."
+ raise ValueError(message)
+ tol = float(tol)
+
+ # input validation/standardization for `which`
+ which = str(which).upper()
+ whichs = {'LM', 'SM'}
+ if which not in whichs:
+ raise ValueError(f"`which` must be in {whichs}.")
+
+ # input validation/standardization for `v0`
+ if v0 is not None:
+ v0 = np.atleast_1d(v0)
+ if not (np.issubdtype(v0.dtype, np.complexfloating)
+ or np.issubdtype(v0.dtype, np.floating)):
+ message = ("`v0` must be of floating or complex floating "
+ "data type.")
+ raise ValueError(message)
+
+ shape = (A.shape[0],) if solver == 'propack' else (min(A.shape),)
+ if v0.shape != shape:
+ message = f"`v0` must have shape {shape}."
+ raise ValueError(message)
+
+ # input validation/standardization for `maxiter`
+ if maxiter is not None and (int(maxiter) != maxiter or maxiter <= 0):
+ message = "`maxiter` must be a positive integer."
+ raise ValueError(message)
+ maxiter = int(maxiter) if maxiter is not None else maxiter
+
+ # input validation/standardization for `return_singular_vectors`
+ # not going to be flexible with this; too complicated for little gain
+ rs_options = {True, False, "vh", "u"}
+ if return_singular not in rs_options:
+ raise ValueError(f"`return_singular_vectors` must be in {rs_options}.")
+
+ rng = check_random_state(rng)
+
+ return (A, k, ncv, tol, which, v0, maxiter,
+ return_singular, solver, rng)
+
+
+@_transition_to_rng("random_state", position_num=9)
+def svds(A, k=6, ncv=None, tol=0, which='LM', v0=None,
+ maxiter=None, return_singular_vectors=True,
+ solver='arpack', rng=None, options=None):
+ """
+ Partial singular value decomposition of a sparse matrix.
+
+ Compute the largest or smallest `k` singular values and corresponding
+ singular vectors of a sparse matrix `A`. The order in which the singular
+ values are returned is not guaranteed.
+
+ In the descriptions below, let ``M, N = A.shape``.
+
+ Parameters
+ ----------
+ A : ndarray, sparse matrix, or LinearOperator
+ Matrix to decompose of a floating point numeric dtype.
+ k : int, default: 6
+ Number of singular values and singular vectors to compute.
+ Must satisfy ``1 <= k <= kmax``, where ``kmax=min(M, N)`` for
+ ``solver='propack'`` and ``kmax=min(M, N) - 1`` otherwise.
+ ncv : int, optional
+ When ``solver='arpack'``, this is the number of Lanczos vectors
+ generated. See :ref:`'arpack' ` for details.
+ When ``solver='lobpcg'`` or ``solver='propack'``, this parameter is
+ ignored.
+ tol : float, optional
+ Tolerance for singular values. Zero (default) means machine precision.
+ which : {'LM', 'SM'}
+ Which `k` singular values to find: either the largest magnitude ('LM')
+ or smallest magnitude ('SM') singular values.
+ v0 : ndarray, optional
+ The starting vector for iteration; see method-specific
+ documentation (:ref:`'arpack' `,
+ :ref:`'lobpcg' `), or
+ :ref:`'propack' ` for details.
+ maxiter : int, optional
+ Maximum number of iterations; see method-specific
+ documentation (:ref:`'arpack' `,
+ :ref:`'lobpcg' `), or
+ :ref:`'propack' ` for details.
+ return_singular_vectors : {True, False, "u", "vh"}
+ Singular values are always computed and returned; this parameter
+ controls the computation and return of singular vectors.
+
+ - ``True``: return singular vectors.
+ - ``False``: do not return singular vectors.
+ - ``"u"``: if ``M <= N``, compute only the left singular vectors and
+ return ``None`` for the right singular vectors. Otherwise, compute
+ all singular vectors.
+ - ``"vh"``: if ``M > N``, compute only the right singular vectors and
+ return ``None`` for the left singular vectors. Otherwise, compute
+ all singular vectors.
+
+ If ``solver='propack'``, the option is respected regardless of the
+ matrix shape.
+
+ solver : {'arpack', 'propack', 'lobpcg'}, optional
+ The solver used.
+ :ref:`'arpack' `,
+ :ref:`'lobpcg' `, and
+ :ref:`'propack' ` are supported.
+ Default: `'arpack'`.
+ rng : `numpy.random.Generator`, optional
+ Pseudorandom number generator state. When `rng` is None, a new
+ `numpy.random.Generator` is created using entropy from the
+ operating system. Types other than `numpy.random.Generator` are
+ passed to `numpy.random.default_rng` to instantiate a ``Generator``.
+ options : dict, optional
+ A dictionary of solver-specific options. No solver-specific options
+ are currently supported; this parameter is reserved for future use.
+
+ Returns
+ -------
+ u : ndarray, shape=(M, k)
+ Unitary matrix having left singular vectors as columns.
+ s : ndarray, shape=(k,)
+ The singular values.
+ vh : ndarray, shape=(k, N)
+ Unitary matrix having right singular vectors as rows.
+
+ Notes
+ -----
+ This is a naive implementation using ARPACK or LOBPCG as an eigensolver
+ on the matrix ``A.conj().T @ A`` or ``A @ A.conj().T``, depending on
+ which one is smaller size, followed by the Rayleigh-Ritz method
+ as postprocessing; see
+ Using the normal matrix, in Rayleigh-Ritz method, (2022, Nov. 19),
+ Wikipedia, https://w.wiki/4zms.
+
+ Alternatively, the PROPACK solver can be called.
+
+ Choices of the input matrix `A` numeric dtype may be limited.
+ Only ``solver="lobpcg"`` supports all floating point dtypes
+ real: 'np.float32', 'np.float64', 'np.longdouble' and
+ complex: 'np.complex64', 'np.complex128', 'np.clongdouble'.
+ The ``solver="arpack"`` supports only
+ 'np.float32', 'np.float64', and 'np.complex128'.
+
+ Examples
+ --------
+ Construct a matrix `A` from singular values and vectors.
+
+ >>> import numpy as np
+ >>> from scipy import sparse, linalg, stats
+ >>> from scipy.sparse.linalg import svds, aslinearoperator, LinearOperator
+
+ Construct a dense matrix `A` from singular values and vectors.
+
+ >>> rng = np.random.default_rng(258265244568965474821194062361901728911)
+ >>> orthogonal = stats.ortho_group.rvs(10, random_state=rng)
+ >>> s = [1e-3, 1, 2, 3, 4] # non-zero singular values
+ >>> u = orthogonal[:, :5] # left singular vectors
+ >>> vT = orthogonal[:, 5:].T # right singular vectors
+ >>> A = u @ np.diag(s) @ vT
+
+ With only four singular values/vectors, the SVD approximates the original
+ matrix.
+
+ >>> u4, s4, vT4 = svds(A, k=4)
+ >>> A4 = u4 @ np.diag(s4) @ vT4
+ >>> np.allclose(A4, A, atol=1e-3)
+ True
+
+ With all five non-zero singular values/vectors, we can reproduce
+ the original matrix more accurately.
+
+ >>> u5, s5, vT5 = svds(A, k=5)
+ >>> A5 = u5 @ np.diag(s5) @ vT5
+ >>> np.allclose(A5, A)
+ True
+
+ The singular values match the expected singular values.
+
+ >>> np.allclose(s5, s)
+ True
+
+ Since the singular values are not close to each other in this example,
+ every singular vector matches as expected up to a difference in sign.
+
+ >>> (np.allclose(np.abs(u5), np.abs(u)) and
+ ... np.allclose(np.abs(vT5), np.abs(vT)))
+ True
+
+ The singular vectors are also orthogonal.
+
+ >>> (np.allclose(u5.T @ u5, np.eye(5)) and
+ ... np.allclose(vT5 @ vT5.T, np.eye(5)))
+ True
+
+ If there are (nearly) multiple singular values, the corresponding
+ individual singular vectors may be unstable, but the whole invariant
+ subspace containing all such singular vectors is computed accurately
+ as can be measured by angles between subspaces via 'subspace_angles'.
+
+ >>> rng = np.random.default_rng(178686584221410808734965903901790843963)
+ >>> s = [1, 1 + 1e-6] # non-zero singular values
+ >>> u, _ = np.linalg.qr(rng.standard_normal((99, 2)))
+ >>> v, _ = np.linalg.qr(rng.standard_normal((99, 2)))
+ >>> vT = v.T
+ >>> A = u @ np.diag(s) @ vT
+ >>> A = A.astype(np.float32)
+ >>> u2, s2, vT2 = svds(A, k=2, rng=rng)
+ >>> np.allclose(s2, s)
+ True
+
+ The angles between the individual exact and computed singular vectors
+ may not be so small. To check use:
+
+ >>> (linalg.subspace_angles(u2[:, :1], u[:, :1]) +
+ ... linalg.subspace_angles(u2[:, 1:], u[:, 1:]))
+ array([0.06562513]) # may vary
+ >>> (linalg.subspace_angles(vT2[:1, :].T, vT[:1, :].T) +
+ ... linalg.subspace_angles(vT2[1:, :].T, vT[1:, :].T))
+ array([0.06562507]) # may vary
+
+ As opposed to the angles between the 2-dimensional invariant subspaces
+ that these vectors span, which are small for rights singular vectors
+
+ >>> linalg.subspace_angles(u2, u).sum() < 1e-6
+ True
+
+ as well as for left singular vectors.
+
+ >>> linalg.subspace_angles(vT2.T, vT.T).sum() < 1e-6
+ True
+
+ The next example follows that of 'sklearn.decomposition.TruncatedSVD'.
+
+ >>> rng = np.random.default_rng(0)
+ >>> X_dense = rng.random(size=(100, 100))
+ >>> X_dense[:, 2 * np.arange(50)] = 0
+ >>> X = sparse.csr_array(X_dense)
+ >>> _, singular_values, _ = svds(X, k=5, rng=rng)
+ >>> print(singular_values)
+ [ 4.3221... 4.4043... 4.4907... 4.5858... 35.4549...]
+
+ The function can be called without the transpose of the input matrix
+ ever explicitly constructed.
+
+ >>> rng = np.random.default_rng(102524723947864966825913730119128190974)
+ >>> G = sparse.random_array((8, 9), density=0.5, rng=rng)
+ >>> Glo = aslinearoperator(G)
+ >>> _, singular_values_svds, _ = svds(Glo, k=5, rng=rng)
+ >>> _, singular_values_svd, _ = linalg.svd(G.toarray())
+ >>> np.allclose(singular_values_svds, singular_values_svd[-4::-1])
+ True
+
+ The most memory efficient scenario is where neither
+ the original matrix, nor its transpose, is explicitly constructed.
+ Our example computes the smallest singular values and vectors
+ of 'LinearOperator' constructed from the numpy function 'np.diff' used
+ column-wise to be consistent with 'LinearOperator' operating on columns.
+
+ >>> diff0 = lambda a: np.diff(a, axis=0)
+
+ Let us create the matrix from 'diff0' to be used for validation only.
+
+ >>> n = 5 # The dimension of the space.
+ >>> M_from_diff0 = diff0(np.eye(n))
+ >>> print(M_from_diff0.astype(int))
+ [[-1 1 0 0 0]
+ [ 0 -1 1 0 0]
+ [ 0 0 -1 1 0]
+ [ 0 0 0 -1 1]]
+
+ The matrix 'M_from_diff0' is bi-diagonal and could be alternatively
+ created directly by
+
+ >>> M = - np.eye(n - 1, n, dtype=int)
+ >>> np.fill_diagonal(M[:,1:], 1)
+ >>> np.allclose(M, M_from_diff0)
+ True
+
+ Its transpose
+
+ >>> print(M.T)
+ [[-1 0 0 0]
+ [ 1 -1 0 0]
+ [ 0 1 -1 0]
+ [ 0 0 1 -1]
+ [ 0 0 0 1]]
+
+ can be viewed as the incidence matrix; see
+ Incidence matrix, (2022, Nov. 19), Wikipedia, https://w.wiki/5YXU,
+ of a linear graph with 5 vertices and 4 edges. The 5x5 normal matrix
+ ``M.T @ M`` thus is
+
+ >>> print(M.T @ M)
+ [[ 1 -1 0 0 0]
+ [-1 2 -1 0 0]
+ [ 0 -1 2 -1 0]
+ [ 0 0 -1 2 -1]
+ [ 0 0 0 -1 1]]
+
+ the graph Laplacian, while the actually used in 'svds' smaller size
+ 4x4 normal matrix ``M @ M.T``
+
+ >>> print(M @ M.T)
+ [[ 2 -1 0 0]
+ [-1 2 -1 0]
+ [ 0 -1 2 -1]
+ [ 0 0 -1 2]]
+
+ is the so-called edge-based Laplacian; see
+ Symmetric Laplacian via the incidence matrix, in Laplacian matrix,
+ (2022, Nov. 19), Wikipedia, https://w.wiki/5YXW.
+
+ The 'LinearOperator' setup needs the options 'rmatvec' and 'rmatmat'
+ of multiplication by the matrix transpose ``M.T``, but we want to be
+ matrix-free to save memory, so knowing how ``M.T`` looks like, we
+ manually construct the following function to be
+ used in ``rmatmat=diff0t``.
+
+ >>> def diff0t(a):
+ ... if a.ndim == 1:
+ ... a = a[:,np.newaxis] # Turn 1D into 2D array
+ ... d = np.zeros((a.shape[0] + 1, a.shape[1]), dtype=a.dtype)
+ ... d[0, :] = - a[0, :]
+ ... d[1:-1, :] = a[0:-1, :] - a[1:, :]
+ ... d[-1, :] = a[-1, :]
+ ... return d
+
+ We check that our function 'diff0t' for the matrix transpose is valid.
+
+ >>> np.allclose(M.T, diff0t(np.eye(n-1)))
+ True
+
+ Now we setup our matrix-free 'LinearOperator' called 'diff0_func_aslo'
+ and for validation the matrix-based 'diff0_matrix_aslo'.
+
+ >>> def diff0_func_aslo_def(n):
+ ... return LinearOperator(matvec=diff0,
+ ... matmat=diff0,
+ ... rmatvec=diff0t,
+ ... rmatmat=diff0t,
+ ... shape=(n - 1, n))
+ >>> diff0_func_aslo = diff0_func_aslo_def(n)
+ >>> diff0_matrix_aslo = aslinearoperator(M_from_diff0)
+
+ And validate both the matrix and its transpose in 'LinearOperator'.
+
+ >>> np.allclose(diff0_func_aslo(np.eye(n)),
+ ... diff0_matrix_aslo(np.eye(n)))
+ True
+ >>> np.allclose(diff0_func_aslo.T(np.eye(n-1)),
+ ... diff0_matrix_aslo.T(np.eye(n-1)))
+ True
+
+ Having the 'LinearOperator' setup validated, we run the solver.
+
+ >>> n = 100
+ >>> diff0_func_aslo = diff0_func_aslo_def(n)
+ >>> u, s, vT = svds(diff0_func_aslo, k=3, which='SM')
+
+ The singular values squared and the singular vectors are known
+ explicitly; see
+ Pure Dirichlet boundary conditions, in
+ Eigenvalues and eigenvectors of the second derivative,
+ (2022, Nov. 19), Wikipedia, https://w.wiki/5YX6,
+ since 'diff' corresponds to first
+ derivative, and its smaller size n-1 x n-1 normal matrix
+ ``M @ M.T`` represent the discrete second derivative with the Dirichlet
+ boundary conditions. We use these analytic expressions for validation.
+
+ >>> se = 2. * np.sin(np.pi * np.arange(1, 4) / (2. * n))
+ >>> ue = np.sqrt(2 / n) * np.sin(np.pi * np.outer(np.arange(1, n),
+ ... np.arange(1, 4)) / n)
+ >>> np.allclose(s, se, atol=1e-3)
+ True
+ >>> np.allclose(np.abs(u), np.abs(ue), atol=1e-6)
+ True
+
+ """
+ args = _iv(A, k, ncv, tol, which, v0, maxiter, return_singular_vectors,
+ solver, rng)
+ (A, k, ncv, tol, which, v0, maxiter,
+ return_singular_vectors, solver, rng) = args
+
+ largest = (which == 'LM')
+ n, m = A.shape
+
+ if n >= m:
+ X_dot = A.matvec
+ X_matmat = A.matmat
+ XH_dot = A.rmatvec
+ XH_mat = A.rmatmat
+ transpose = False
+ else:
+ X_dot = A.rmatvec
+ X_matmat = A.rmatmat
+ XH_dot = A.matvec
+ XH_mat = A.matmat
+ transpose = True
+
+ dtype = getattr(A, 'dtype', None)
+ if dtype is None:
+ dtype = A.dot(np.zeros([m, 1])).dtype
+
+ def matvec_XH_X(x):
+ return XH_dot(X_dot(x))
+
+ def matmat_XH_X(x):
+ return XH_mat(X_matmat(x))
+
+ XH_X = LinearOperator(matvec=matvec_XH_X, dtype=A.dtype,
+ matmat=matmat_XH_X,
+ shape=(min(A.shape), min(A.shape)))
+
+ # Get a low rank approximation of the implicitly defined gramian matrix.
+ # This is not a stable way to approach the problem.
+ if solver == 'lobpcg':
+
+ if k == 1 and v0 is not None:
+ X = np.reshape(v0, (-1, 1))
+ else:
+ X = rng.standard_normal(size=(min(A.shape), k))
+
+ _, eigvec = lobpcg(XH_X, X, tol=tol ** 2, maxiter=maxiter,
+ largest=largest)
+
+ elif solver == 'propack':
+ jobu = return_singular_vectors in {True, 'u'}
+ jobv = return_singular_vectors in {True, 'vh'}
+ irl_mode = (which == 'SM')
+ res = _svdp(A, k=k, tol=tol**2, which=which, maxiter=None,
+ compute_u=jobu, compute_v=jobv, irl_mode=irl_mode,
+ kmax=maxiter, v0=v0, rng=rng)
+
+ u, s, vh, _ = res # but we'll ignore bnd, the last output
+
+ # PROPACK order appears to be largest first. `svds` output order is not
+ # guaranteed, according to documentation, but for ARPACK and LOBPCG
+ # they actually are ordered smallest to largest, so reverse for
+ # consistency.
+ s = s[::-1]
+ u = u[:, ::-1]
+ vh = vh[::-1]
+
+ u = u if jobu else None
+ vh = vh if jobv else None
+
+ if return_singular_vectors:
+ return u, s, vh
+ else:
+ return s
+
+ elif solver == 'arpack' or solver is None:
+ if v0 is None:
+ v0 = rng.standard_normal(size=(min(A.shape),))
+ _, eigvec = eigsh(XH_X, k=k, tol=tol ** 2, maxiter=maxiter,
+ ncv=ncv, which=which, v0=v0)
+ # arpack do not guarantee exactly orthonormal eigenvectors
+ # for clustered eigenvalues, especially in complex arithmetic
+ eigvec, _ = np.linalg.qr(eigvec)
+
+ # the eigenvectors eigvec must be orthonomal here; see gh-16712
+ Av = X_matmat(eigvec)
+ if not return_singular_vectors:
+ s = svd(Av, compute_uv=False, overwrite_a=True)
+ return s[::-1]
+
+ # compute the left singular vectors of X and update the right ones
+ # accordingly
+ u, s, vh = svd(Av, full_matrices=False, overwrite_a=True)
+ u = u[:, ::-1]
+ s = s[::-1]
+ vh = vh[::-1]
+
+ jobu = return_singular_vectors in {True, 'u'}
+ jobv = return_singular_vectors in {True, 'vh'}
+
+ if transpose:
+ u_tmp = eigvec @ _herm(vh) if jobu else None
+ vh = _herm(u) if jobv else None
+ u = u_tmp
+ else:
+ if not jobu:
+ u = None
+ vh = vh @ _herm(eigvec) if jobv else None
+
+ return u, s, vh
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/_svds_doc.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/_svds_doc.py
new file mode 100644
index 0000000000000000000000000000000000000000..90b85876d2a69dd3c2efa56445e46c93bf0eaa9e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/_svds_doc.py
@@ -0,0 +1,382 @@
+def _svds_arpack_doc(A, k=6, ncv=None, tol=0, which='LM', v0=None,
+ maxiter=None, return_singular_vectors=True,
+ solver='arpack', rng=None):
+ """
+ Partial singular value decomposition of a sparse matrix using ARPACK.
+
+ Compute the largest or smallest `k` singular values and corresponding
+ singular vectors of a sparse matrix `A`. The order in which the singular
+ values are returned is not guaranteed.
+
+ In the descriptions below, let ``M, N = A.shape``.
+
+ Parameters
+ ----------
+ A : sparse matrix or LinearOperator
+ Matrix to decompose.
+ k : int, optional
+ Number of singular values and singular vectors to compute.
+ Must satisfy ``1 <= k <= min(M, N) - 1``.
+ Default is 6.
+ ncv : int, optional
+ The number of Lanczos vectors generated.
+ The default is ``min(n, max(2*k + 1, 20))``.
+ If specified, must satisfy ``k + 1 < ncv < min(M, N)``; ``ncv > 2*k``
+ is recommended.
+ tol : float, optional
+ Tolerance for singular values. Zero (default) means machine precision.
+ which : {'LM', 'SM'}
+ Which `k` singular values to find: either the largest magnitude ('LM')
+ or smallest magnitude ('SM') singular values.
+ v0 : ndarray, optional
+ The starting vector for iteration:
+ an (approximate) left singular vector if ``N > M`` and a right singular
+ vector otherwise. Must be of length ``min(M, N)``.
+ Default: random
+ maxiter : int, optional
+ Maximum number of Arnoldi update iterations allowed;
+ default is ``min(M, N) * 10``.
+ return_singular_vectors : {True, False, "u", "vh"}
+ Singular values are always computed and returned; this parameter
+ controls the computation and return of singular vectors.
+
+ - ``True``: return singular vectors.
+ - ``False``: do not return singular vectors.
+ - ``"u"``: if ``M <= N``, compute only the left singular vectors and
+ return ``None`` for the right singular vectors. Otherwise, compute
+ all singular vectors.
+ - ``"vh"``: if ``M > N``, compute only the right singular vectors and
+ return ``None`` for the left singular vectors. Otherwise, compute
+ all singular vectors.
+
+ solver : {'arpack', 'propack', 'lobpcg'}, optional
+ This is the solver-specific documentation for ``solver='arpack'``.
+ :ref:`'lobpcg' ` and
+ :ref:`'propack' `
+ are also supported.
+ rng : `numpy.random.Generator`, optional
+ Pseudorandom number generator state. When `rng` is None, a new
+ `numpy.random.Generator` is created using entropy from the
+ operating system. Types other than `numpy.random.Generator` are
+ passed to `numpy.random.default_rng` to instantiate a ``Generator``.
+ options : dict, optional
+ A dictionary of solver-specific options. No solver-specific options
+ are currently supported; this parameter is reserved for future use.
+
+ Returns
+ -------
+ u : ndarray, shape=(M, k)
+ Unitary matrix having left singular vectors as columns.
+ s : ndarray, shape=(k,)
+ The singular values.
+ vh : ndarray, shape=(k, N)
+ Unitary matrix having right singular vectors as rows.
+
+ Notes
+ -----
+ This is a naive implementation using ARPACK as an eigensolver
+ on ``A.conj().T @ A`` or ``A @ A.conj().T``, depending on which one is more
+ efficient.
+
+ Examples
+ --------
+ Construct a matrix ``A`` from singular values and vectors.
+
+ >>> import numpy as np
+ >>> from scipy.stats import ortho_group
+ >>> from scipy.sparse import csc_array, diags_array
+ >>> from scipy.sparse.linalg import svds
+ >>> rng = np.random.default_rng()
+ >>> orthogonal = csc_array(ortho_group.rvs(10, random_state=rng))
+ >>> s = [0.0001, 0.001, 3, 4, 5] # singular values
+ >>> u = orthogonal[:, :5] # left singular vectors
+ >>> vT = orthogonal[:, 5:].T # right singular vectors
+ >>> A = u @ diags_array(s) @ vT
+
+ With only three singular values/vectors, the SVD approximates the original
+ matrix.
+
+ >>> u2, s2, vT2 = svds(A, k=3, solver='arpack')
+ >>> A2 = u2 @ np.diag(s2) @ vT2
+ >>> np.allclose(A2, A.toarray(), atol=1e-3)
+ True
+
+ With all five singular values/vectors, we can reproduce the original
+ matrix.
+
+ >>> u3, s3, vT3 = svds(A, k=5, solver='arpack')
+ >>> A3 = u3 @ np.diag(s3) @ vT3
+ >>> np.allclose(A3, A.toarray())
+ True
+
+ The singular values match the expected singular values, and the singular
+ vectors are as expected up to a difference in sign.
+
+ >>> (np.allclose(s3, s) and
+ ... np.allclose(np.abs(u3), np.abs(u.toarray())) and
+ ... np.allclose(np.abs(vT3), np.abs(vT.toarray())))
+ True
+
+ The singular vectors are also orthogonal.
+
+ >>> (np.allclose(u3.T @ u3, np.eye(5)) and
+ ... np.allclose(vT3 @ vT3.T, np.eye(5)))
+ True
+ """
+ pass
+
+
+def _svds_lobpcg_doc(A, k=6, ncv=None, tol=0, which='LM', v0=None,
+ maxiter=None, return_singular_vectors=True,
+ solver='lobpcg', rng=None):
+ """
+ Partial singular value decomposition of a sparse matrix using LOBPCG.
+
+ Compute the largest or smallest `k` singular values and corresponding
+ singular vectors of a sparse matrix `A`. The order in which the singular
+ values are returned is not guaranteed.
+
+ In the descriptions below, let ``M, N = A.shape``.
+
+ Parameters
+ ----------
+ A : sparse matrix or LinearOperator
+ Matrix to decompose.
+ k : int, default: 6
+ Number of singular values and singular vectors to compute.
+ Must satisfy ``1 <= k <= min(M, N) - 1``.
+ ncv : int, optional
+ Ignored.
+ tol : float, optional
+ Tolerance for singular values. Zero (default) means machine precision.
+ which : {'LM', 'SM'}
+ Which `k` singular values to find: either the largest magnitude ('LM')
+ or smallest magnitude ('SM') singular values.
+ v0 : ndarray, optional
+ If `k` is 1, the starting vector for iteration:
+ an (approximate) left singular vector if ``N > M`` and a right singular
+ vector otherwise. Must be of length ``min(M, N)``.
+ Ignored otherwise.
+ Default: random
+ maxiter : int, default: 20
+ Maximum number of iterations.
+ return_singular_vectors : {True, False, "u", "vh"}
+ Singular values are always computed and returned; this parameter
+ controls the computation and return of singular vectors.
+
+ - ``True``: return singular vectors.
+ - ``False``: do not return singular vectors.
+ - ``"u"``: if ``M <= N``, compute only the left singular vectors and
+ return ``None`` for the right singular vectors. Otherwise, compute
+ all singular vectors.
+ - ``"vh"``: if ``M > N``, compute only the right singular vectors and
+ return ``None`` for the left singular vectors. Otherwise, compute
+ all singular vectors.
+
+ solver : {'arpack', 'propack', 'lobpcg'}, optional
+ This is the solver-specific documentation for ``solver='lobpcg'``.
+ :ref:`'arpack' ` and
+ :ref:`'propack' `
+ are also supported.
+ rng : `numpy.random.Generator`, optional
+ Pseudorandom number generator state. When `rng` is None, a new
+ `numpy.random.Generator` is created using entropy from the
+ operating system. Types other than `numpy.random.Generator` are
+ passed to `numpy.random.default_rng` to instantiate a ``Generator``.
+ options : dict, optional
+ A dictionary of solver-specific options. No solver-specific options
+ are currently supported; this parameter is reserved for future use.
+
+ Returns
+ -------
+ u : ndarray, shape=(M, k)
+ Unitary matrix having left singular vectors as columns.
+ s : ndarray, shape=(k,)
+ The singular values.
+ vh : ndarray, shape=(k, N)
+ Unitary matrix having right singular vectors as rows.
+
+ Notes
+ -----
+ This is a naive implementation using LOBPCG as an eigensolver
+ on ``A.conj().T @ A`` or ``A @ A.conj().T``, depending on which one is more
+ efficient.
+
+ Examples
+ --------
+ Construct a matrix ``A`` from singular values and vectors.
+
+ >>> import numpy as np
+ >>> from scipy.stats import ortho_group
+ >>> from scipy.sparse import csc_array, diags_array
+ >>> from scipy.sparse.linalg import svds
+ >>> rng = np.random.default_rng()
+ >>> orthogonal = csc_array(ortho_group.rvs(10, random_state=rng))
+ >>> s = [0.0001, 0.001, 3, 4, 5] # singular values
+ >>> u = orthogonal[:, :5] # left singular vectors
+ >>> vT = orthogonal[:, 5:].T # right singular vectors
+ >>> A = u @ diags_array(s) @ vT
+
+ With only three singular values/vectors, the SVD approximates the original
+ matrix.
+
+ >>> u2, s2, vT2 = svds(A, k=3, solver='lobpcg')
+ >>> A2 = u2 @ np.diag(s2) @ vT2
+ >>> np.allclose(A2, A.toarray(), atol=1e-3)
+ True
+
+ With all five singular values/vectors, we can reproduce the original
+ matrix.
+
+ >>> u3, s3, vT3 = svds(A, k=5, solver='lobpcg')
+ >>> A3 = u3 @ np.diag(s3) @ vT3
+ >>> np.allclose(A3, A.toarray())
+ True
+
+ The singular values match the expected singular values, and the singular
+ vectors are as expected up to a difference in sign.
+
+ >>> (np.allclose(s3, s) and
+ ... np.allclose(np.abs(u3), np.abs(u.todense())) and
+ ... np.allclose(np.abs(vT3), np.abs(vT.todense())))
+ True
+
+ The singular vectors are also orthogonal.
+
+ >>> (np.allclose(u3.T @ u3, np.eye(5)) and
+ ... np.allclose(vT3 @ vT3.T, np.eye(5)))
+ True
+
+ """
+ pass
+
+
+def _svds_propack_doc(A, k=6, ncv=None, tol=0, which='LM', v0=None,
+ maxiter=None, return_singular_vectors=True,
+ solver='propack', rng=None):
+ """
+ Partial singular value decomposition of a sparse matrix using PROPACK.
+
+ Compute the largest or smallest `k` singular values and corresponding
+ singular vectors of a sparse matrix `A`. The order in which the singular
+ values are returned is not guaranteed.
+
+ In the descriptions below, let ``M, N = A.shape``.
+
+ Parameters
+ ----------
+ A : sparse matrix or LinearOperator
+ Matrix to decompose. If `A` is a ``LinearOperator``
+ object, it must define both ``matvec`` and ``rmatvec`` methods.
+ k : int, default: 6
+ Number of singular values and singular vectors to compute.
+ Must satisfy ``1 <= k <= min(M, N)``.
+ ncv : int, optional
+ Ignored.
+ tol : float, optional
+ The desired relative accuracy for computed singular values.
+ Zero (default) means machine precision.
+ which : {'LM', 'SM'}
+ Which `k` singular values to find: either the largest magnitude ('LM')
+ or smallest magnitude ('SM') singular values. Note that choosing
+ ``which='SM'`` will force the ``irl`` option to be set ``True``.
+ v0 : ndarray, optional
+ Starting vector for iterations: must be of length ``A.shape[0]``.
+ If not specified, PROPACK will generate a starting vector.
+ maxiter : int, optional
+ Maximum number of iterations / maximal dimension of the Krylov
+ subspace. Default is ``10 * k``.
+ return_singular_vectors : {True, False, "u", "vh"}
+ Singular values are always computed and returned; this parameter
+ controls the computation and return of singular vectors.
+
+ - ``True``: return singular vectors.
+ - ``False``: do not return singular vectors.
+ - ``"u"``: compute only the left singular vectors; return ``None`` for
+ the right singular vectors.
+ - ``"vh"``: compute only the right singular vectors; return ``None``
+ for the left singular vectors.
+
+ solver : {'arpack', 'propack', 'lobpcg'}, optional
+ This is the solver-specific documentation for ``solver='propack'``.
+ :ref:`'arpack' ` and
+ :ref:`'lobpcg' `
+ are also supported.
+ rng : `numpy.random.Generator`, optional
+ Pseudorandom number generator state. When `rng` is None, a new
+ `numpy.random.Generator` is created using entropy from the
+ operating system. Types other than `numpy.random.Generator` are
+ passed to `numpy.random.default_rng` to instantiate a ``Generator``.
+ options : dict, optional
+ A dictionary of solver-specific options. No solver-specific options
+ are currently supported; this parameter is reserved for future use.
+
+ Returns
+ -------
+ u : ndarray, shape=(M, k)
+ Unitary matrix having left singular vectors as columns.
+ s : ndarray, shape=(k,)
+ The singular values.
+ vh : ndarray, shape=(k, N)
+ Unitary matrix having right singular vectors as rows.
+
+ Notes
+ -----
+ This is an interface to the Fortran library PROPACK [1]_.
+ The current default is to run with IRL mode disabled unless seeking the
+ smallest singular values/vectors (``which='SM'``).
+
+ References
+ ----------
+
+ .. [1] Larsen, Rasmus Munk. "PROPACK-Software for large and sparse SVD
+ calculations." Available online. URL
+ http://sun.stanford.edu/~rmunk/PROPACK (2004): 2008-2009.
+
+ Examples
+ --------
+ Construct a matrix ``A`` from singular values and vectors.
+
+ >>> import numpy as np
+ >>> from scipy.stats import ortho_group
+ >>> from scipy.sparse import csc_array, diags_array
+ >>> from scipy.sparse.linalg import svds
+ >>> rng = np.random.default_rng()
+ >>> orthogonal = csc_array(ortho_group.rvs(10, random_state=rng))
+ >>> s = [0.0001, 0.001, 3, 4, 5] # singular values
+ >>> u = orthogonal[:, :5] # left singular vectors
+ >>> vT = orthogonal[:, 5:].T # right singular vectors
+ >>> A = u @ diags_array(s) @ vT
+
+ With only three singular values/vectors, the SVD approximates the original
+ matrix.
+
+ >>> u2, s2, vT2 = svds(A, k=3, solver='propack')
+ >>> A2 = u2 @ np.diag(s2) @ vT2
+ >>> np.allclose(A2, A.todense(), atol=1e-3)
+ True
+
+ With all five singular values/vectors, we can reproduce the original
+ matrix.
+
+ >>> u3, s3, vT3 = svds(A, k=5, solver='propack')
+ >>> A3 = u3 @ np.diag(s3) @ vT3
+ >>> np.allclose(A3, A.todense())
+ True
+
+ The singular values match the expected singular values, and the singular
+ vectors are as expected up to a difference in sign.
+
+ >>> (np.allclose(s3, s) and
+ ... np.allclose(np.abs(u3), np.abs(u.toarray())) and
+ ... np.allclose(np.abs(vT3), np.abs(vT.toarray())))
+ True
+
+ The singular vectors are also orthogonal.
+
+ >>> (np.allclose(u3.T @ u3, np.eye(5)) and
+ ... np.allclose(vT3 @ vT3.T, np.eye(5)))
+ True
+
+ """
+ pass
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/COPYING b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/COPYING
new file mode 100644
index 0000000000000000000000000000000000000000..e87667e1b8c178e53c6a7c6268ebc09ab4b0476c
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/COPYING
@@ -0,0 +1,45 @@
+
+BSD Software License
+
+Pertains to ARPACK and P_ARPACK
+
+Copyright (c) 1996-2008 Rice University.
+Developed by D.C. Sorensen, R.B. Lehoucq, C. Yang, and K. Maschhoff.
+All rights reserved.
+
+Arpack has been renamed to arpack-ng.
+
+Copyright (c) 2001-2011 - Scilab Enterprises
+Updated by Allan Cornet, Sylvestre Ledru.
+
+Copyright (c) 2010 - Jordi GutiƩrrez Hermoso (Octave patch)
+
+Copyright (c) 2007 - SƩbastien Fabbro (gentoo patch)
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+- Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer listed
+ in this license in the documentation and/or other materials
+ provided with the distribution.
+
+- Neither the name of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..679b94480d7ff5a11e037ffb758f2214c6e5097f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__init__.py
@@ -0,0 +1,20 @@
+"""
+Eigenvalue solver using iterative methods.
+
+Find k eigenvectors and eigenvalues of a matrix A using the
+Arnoldi/Lanczos iterative methods from ARPACK [1]_,[2]_.
+
+These methods are most useful for large sparse matrices.
+
+ - eigs(A,k)
+ - eigsh(A,k)
+
+References
+----------
+.. [1] ARPACK Software, http://www.caam.rice.edu/software/ARPACK/
+.. [2] R. B. Lehoucq, D. C. Sorensen, and C. Yang, ARPACK USERS GUIDE:
+ Solution of Large Scale Eigenvalue Problems by Implicitly Restarted
+ Arnoldi Methods. SIAM, Philadelphia, PA, 1998.
+
+"""
+from .arpack import *
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..c69a578a33eaf22ec3beb0e769bfb16b38892eb6
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__pycache__/arpack.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__pycache__/arpack.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..260d45e6940e033553fc1b16e45addfa412ed3f0
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/__pycache__/arpack.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/arpack.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/arpack.py
new file mode 100644
index 0000000000000000000000000000000000000000..623b605b2da51b462c88b97c8083bc1a135cc161
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/arpack.py
@@ -0,0 +1,1700 @@
+"""
+Find a few eigenvectors and eigenvalues of a matrix.
+
+
+Uses ARPACK: https://github.com/opencollab/arpack-ng
+
+"""
+# Wrapper implementation notes
+#
+# ARPACK Entry Points
+# -------------------
+# The entry points to ARPACK are
+# - (s,d)seupd : single and double precision symmetric matrix
+# - (s,d,c,z)neupd: single,double,complex,double complex general matrix
+# This wrapper puts the *neupd (general matrix) interfaces in eigs()
+# and the *seupd (symmetric matrix) in eigsh().
+# There is no specialized interface for complex Hermitian matrices.
+# To find eigenvalues of a complex Hermitian matrix you
+# may use eigsh(), but eigsh() will simply call eigs()
+# and return the real part of the eigenvalues thus obtained.
+
+# Number of eigenvalues returned and complex eigenvalues
+# ------------------------------------------------------
+# The ARPACK nonsymmetric real and double interface (s,d)naupd return
+# eigenvalues and eigenvectors in real (float,double) arrays.
+# Since the eigenvalues and eigenvectors are, in general, complex
+# ARPACK puts the real and imaginary parts in consecutive entries
+# in real-valued arrays. This wrapper puts the real entries
+# into complex data types and attempts to return the requested eigenvalues
+# and eigenvectors.
+
+
+# Solver modes
+# ------------
+# ARPACK and handle shifted and shift-inverse computations
+# for eigenvalues by providing a shift (sigma) and a solver.
+
+import numpy as np
+import warnings
+from scipy.sparse.linalg._interface import aslinearoperator, LinearOperator
+from scipy.sparse import eye, issparse
+from scipy.linalg import eig, eigh, lu_factor, lu_solve
+from scipy.sparse._sputils import (
+ convert_pydata_sparse_to_scipy, isdense, is_pydata_spmatrix,
+)
+from scipy.sparse.linalg import gmres, splu
+from scipy._lib._util import _aligned_zeros
+from scipy._lib._threadsafety import ReentrancyLock
+from . import _arpack
+arpack_int = _arpack.timing.nbx.dtype
+
+__docformat__ = "restructuredtext en"
+
+__all__ = ['eigs', 'eigsh', 'ArpackError', 'ArpackNoConvergence']
+
+
+_type_conv = {'f': 's', 'd': 'd', 'F': 'c', 'D': 'z'}
+_ndigits = {'f': 5, 'd': 12, 'F': 5, 'D': 12}
+
+DNAUPD_ERRORS = {
+ 0: "Normal exit.",
+ 1: "Maximum number of iterations taken. "
+ "All possible eigenvalues of OP has been found. IPARAM(5) "
+ "returns the number of wanted converged Ritz values.",
+ 2: "No longer an informational error. Deprecated starting "
+ "with release 2 of ARPACK.",
+ 3: "No shifts could be applied during a cycle of the "
+ "Implicitly restarted Arnoldi iteration. One possibility "
+ "is to increase the size of NCV relative to NEV. ",
+ -1: "N must be positive.",
+ -2: "NEV must be positive.",
+ -3: "NCV-NEV >= 2 and less than or equal to N.",
+ -4: "The maximum number of Arnoldi update iterations allowed "
+ "must be greater than zero.",
+ -5: " WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI', 'SI'",
+ -6: "BMAT must be one of 'I' or 'G'.",
+ -7: "Length of private work array WORKL is not sufficient.",
+ -8: "Error return from LAPACK eigenvalue calculation;",
+ -9: "Starting vector is zero.",
+ -10: "IPARAM(7) must be 1,2,3,4.",
+ -11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
+ -12: "IPARAM(1) must be equal to 0 or 1.",
+ -13: "NEV and WHICH = 'BE' are incompatible.",
+ -9999: "Could not build an Arnoldi factorization. "
+ "IPARAM(5) returns the size of the current Arnoldi "
+ "factorization. The user is advised to check that "
+ "enough workspace and array storage has been allocated."
+}
+
+SNAUPD_ERRORS = DNAUPD_ERRORS
+
+ZNAUPD_ERRORS = DNAUPD_ERRORS.copy()
+ZNAUPD_ERRORS[-10] = "IPARAM(7) must be 1,2,3."
+
+CNAUPD_ERRORS = ZNAUPD_ERRORS
+
+DSAUPD_ERRORS = {
+ 0: "Normal exit.",
+ 1: "Maximum number of iterations taken. "
+ "All possible eigenvalues of OP has been found.",
+ 2: "No longer an informational error. Deprecated starting with "
+ "release 2 of ARPACK.",
+ 3: "No shifts could be applied during a cycle of the Implicitly "
+ "restarted Arnoldi iteration. One possibility is to increase "
+ "the size of NCV relative to NEV. ",
+ -1: "N must be positive.",
+ -2: "NEV must be positive.",
+ -3: "NCV must be greater than NEV and less than or equal to N.",
+ -4: "The maximum number of Arnoldi update iterations allowed "
+ "must be greater than zero.",
+ -5: "WHICH must be one of 'LM', 'SM', 'LA', 'SA' or 'BE'.",
+ -6: "BMAT must be one of 'I' or 'G'.",
+ -7: "Length of private work array WORKL is not sufficient.",
+ -8: "Error return from trid. eigenvalue calculation; "
+ "Informational error from LAPACK routine dsteqr .",
+ -9: "Starting vector is zero.",
+ -10: "IPARAM(7) must be 1,2,3,4,5.",
+ -11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
+ -12: "IPARAM(1) must be equal to 0 or 1.",
+ -13: "NEV and WHICH = 'BE' are incompatible. ",
+ -9999: "Could not build an Arnoldi factorization. "
+ "IPARAM(5) returns the size of the current Arnoldi "
+ "factorization. The user is advised to check that "
+ "enough workspace and array storage has been allocated.",
+}
+
+SSAUPD_ERRORS = DSAUPD_ERRORS
+
+DNEUPD_ERRORS = {
+ 0: "Normal exit.",
+ 1: "The Schur form computed by LAPACK routine dlahqr "
+ "could not be reordered by LAPACK routine dtrsen. "
+ "Re-enter subroutine dneupd with IPARAM(5)NCV and "
+ "increase the size of the arrays DR and DI to have "
+ "dimension at least dimension NCV and allocate at least NCV "
+ "columns for Z. NOTE: Not necessary if Z and V share "
+ "the same space. Please notify the authors if this error"
+ "occurs.",
+ -1: "N must be positive.",
+ -2: "NEV must be positive.",
+ -3: "NCV-NEV >= 2 and less than or equal to N.",
+ -5: "WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI', 'SI'",
+ -6: "BMAT must be one of 'I' or 'G'.",
+ -7: "Length of private work WORKL array is not sufficient.",
+ -8: "Error return from calculation of a real Schur form. "
+ "Informational error from LAPACK routine dlahqr .",
+ -9: "Error return from calculation of eigenvectors. "
+ "Informational error from LAPACK routine dtrevc.",
+ -10: "IPARAM(7) must be 1,2,3,4.",
+ -11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
+ -12: "HOWMNY = 'S' not yet implemented",
+ -13: "HOWMNY must be one of 'A' or 'P' if RVEC = .true.",
+ -14: "DNAUPD did not find any eigenvalues to sufficient "
+ "accuracy.",
+ -15: "DNEUPD got a different count of the number of converged "
+ "Ritz values than DNAUPD got. This indicates the user "
+ "probably made an error in passing data from DNAUPD to "
+ "DNEUPD or that the data was modified before entering "
+ "DNEUPD",
+}
+
+SNEUPD_ERRORS = DNEUPD_ERRORS.copy()
+SNEUPD_ERRORS[1] = ("The Schur form computed by LAPACK routine slahqr "
+ "could not be reordered by LAPACK routine strsen . "
+ "Re-enter subroutine dneupd with IPARAM(5)=NCV and "
+ "increase the size of the arrays DR and DI to have "
+ "dimension at least dimension NCV and allocate at least "
+ "NCV columns for Z. NOTE: Not necessary if Z and V share "
+ "the same space. Please notify the authors if this error "
+ "occurs.")
+SNEUPD_ERRORS[-14] = ("SNAUPD did not find any eigenvalues to sufficient "
+ "accuracy.")
+SNEUPD_ERRORS[-15] = ("SNEUPD got a different count of the number of "
+ "converged Ritz values than SNAUPD got. This indicates "
+ "the user probably made an error in passing data from "
+ "SNAUPD to SNEUPD or that the data was modified before "
+ "entering SNEUPD")
+
+ZNEUPD_ERRORS = {0: "Normal exit.",
+ 1: "The Schur form computed by LAPACK routine csheqr "
+ "could not be reordered by LAPACK routine ztrsen. "
+ "Re-enter subroutine zneupd with IPARAM(5)=NCV and "
+ "increase the size of the array D to have "
+ "dimension at least dimension NCV and allocate at least "
+ "NCV columns for Z. NOTE: Not necessary if Z and V share "
+ "the same space. Please notify the authors if this error "
+ "occurs.",
+ -1: "N must be positive.",
+ -2: "NEV must be positive.",
+ -3: "NCV-NEV >= 1 and less than or equal to N.",
+ -5: "WHICH must be one of 'LM', 'SM', 'LR', 'SR', 'LI', 'SI'",
+ -6: "BMAT must be one of 'I' or 'G'.",
+ -7: "Length of private work WORKL array is not sufficient.",
+ -8: "Error return from LAPACK eigenvalue calculation. "
+ "This should never happened.",
+ -9: "Error return from calculation of eigenvectors. "
+ "Informational error from LAPACK routine ztrevc.",
+ -10: "IPARAM(7) must be 1,2,3",
+ -11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
+ -12: "HOWMNY = 'S' not yet implemented",
+ -13: "HOWMNY must be one of 'A' or 'P' if RVEC = .true.",
+ -14: "ZNAUPD did not find any eigenvalues to sufficient "
+ "accuracy.",
+ -15: "ZNEUPD got a different count of the number of "
+ "converged Ritz values than ZNAUPD got. This "
+ "indicates the user probably made an error in passing "
+ "data from ZNAUPD to ZNEUPD or that the data was "
+ "modified before entering ZNEUPD"
+ }
+
+CNEUPD_ERRORS = ZNEUPD_ERRORS.copy()
+CNEUPD_ERRORS[-14] = ("CNAUPD did not find any eigenvalues to sufficient "
+ "accuracy.")
+CNEUPD_ERRORS[-15] = ("CNEUPD got a different count of the number of "
+ "converged Ritz values than CNAUPD got. This indicates "
+ "the user probably made an error in passing data from "
+ "CNAUPD to CNEUPD or that the data was modified before "
+ "entering CNEUPD")
+
+DSEUPD_ERRORS = {
+ 0: "Normal exit.",
+ -1: "N must be positive.",
+ -2: "NEV must be positive.",
+ -3: "NCV must be greater than NEV and less than or equal to N.",
+ -5: "WHICH must be one of 'LM', 'SM', 'LA', 'SA' or 'BE'.",
+ -6: "BMAT must be one of 'I' or 'G'.",
+ -7: "Length of private work WORKL array is not sufficient.",
+ -8: ("Error return from trid. eigenvalue calculation; "
+ "Information error from LAPACK routine dsteqr."),
+ -9: "Starting vector is zero.",
+ -10: "IPARAM(7) must be 1,2,3,4,5.",
+ -11: "IPARAM(7) = 1 and BMAT = 'G' are incompatible.",
+ -12: "NEV and WHICH = 'BE' are incompatible.",
+ -14: "DSAUPD did not find any eigenvalues to sufficient accuracy.",
+ -15: "HOWMNY must be one of 'A' or 'S' if RVEC = .true.",
+ -16: "HOWMNY = 'S' not yet implemented",
+ -17: ("DSEUPD got a different count of the number of converged "
+ "Ritz values than DSAUPD got. This indicates the user "
+ "probably made an error in passing data from DSAUPD to "
+ "DSEUPD or that the data was modified before entering "
+ "DSEUPD.")
+}
+
+SSEUPD_ERRORS = DSEUPD_ERRORS.copy()
+SSEUPD_ERRORS[-14] = ("SSAUPD did not find any eigenvalues "
+ "to sufficient accuracy.")
+SSEUPD_ERRORS[-17] = ("SSEUPD got a different count of the number of "
+ "converged "
+ "Ritz values than SSAUPD got. This indicates the user "
+ "probably made an error in passing data from SSAUPD to "
+ "SSEUPD or that the data was modified before entering "
+ "SSEUPD.")
+
+_SAUPD_ERRORS = {'d': DSAUPD_ERRORS,
+ 's': SSAUPD_ERRORS}
+_NAUPD_ERRORS = {'d': DNAUPD_ERRORS,
+ 's': SNAUPD_ERRORS,
+ 'z': ZNAUPD_ERRORS,
+ 'c': CNAUPD_ERRORS}
+_SEUPD_ERRORS = {'d': DSEUPD_ERRORS,
+ 's': SSEUPD_ERRORS}
+_NEUPD_ERRORS = {'d': DNEUPD_ERRORS,
+ 's': SNEUPD_ERRORS,
+ 'z': ZNEUPD_ERRORS,
+ 'c': CNEUPD_ERRORS}
+
+# accepted values of parameter WHICH in _SEUPD
+_SEUPD_WHICH = ['LM', 'SM', 'LA', 'SA', 'BE']
+
+# accepted values of parameter WHICH in _NAUPD
+_NEUPD_WHICH = ['LM', 'SM', 'LR', 'SR', 'LI', 'SI']
+
+
+class ArpackError(RuntimeError):
+ """
+ ARPACK error
+ """
+
+ def __init__(self, info, infodict=None):
+ if infodict is None:
+ infodict = _NAUPD_ERRORS
+
+ msg = infodict.get(info, "Unknown error")
+ super().__init__(f"ARPACK error {info}: {msg}")
+
+
+class ArpackNoConvergence(ArpackError):
+ """
+ ARPACK iteration did not converge
+
+ Attributes
+ ----------
+ eigenvalues : ndarray
+ Partial result. Converged eigenvalues.
+ eigenvectors : ndarray
+ Partial result. Converged eigenvectors.
+
+ """
+
+ def __init__(self, msg, eigenvalues, eigenvectors):
+ ArpackError.__init__(self, -1, {-1: msg})
+ self.eigenvalues = eigenvalues
+ self.eigenvectors = eigenvectors
+
+
+def choose_ncv(k):
+ """
+ Choose number of lanczos vectors based on target number
+ of singular/eigen values and vectors to compute, k.
+ """
+ return max(2 * k + 1, 20)
+
+
+class _ArpackParams:
+ def __init__(self, n, k, tp, mode=1, sigma=None,
+ ncv=None, v0=None, maxiter=None, which="LM", tol=0):
+ if k <= 0:
+ raise ValueError("k must be positive, k=%d" % k)
+
+ if maxiter is None:
+ maxiter = n * 10
+ if maxiter <= 0:
+ raise ValueError("maxiter must be positive, maxiter=%d" % maxiter)
+
+ if tp not in 'fdFD':
+ # Use `float64` libraries from integer dtypes.
+ if np.can_cast(tp, 'd'):
+ tp = 'd'
+ else:
+ raise ValueError("matrix type must be 'f', 'd', 'F', or 'D'")
+
+ if v0 is not None:
+ # ARPACK overwrites its initial resid, make a copy
+ self.resid = np.array(v0, copy=True)
+ info = 1
+ else:
+ # ARPACK will use a random initial vector.
+ self.resid = np.zeros(n, tp)
+ info = 0
+
+ if sigma is None:
+ #sigma not used
+ self.sigma = 0
+ else:
+ self.sigma = sigma
+
+ if ncv is None:
+ ncv = choose_ncv(k)
+ ncv = min(ncv, n)
+
+ self.v = np.zeros((n, ncv), tp) # holds Ritz vectors
+ self.iparam = np.zeros(11, arpack_int)
+
+ # set solver mode and parameters
+ ishfts = 1
+ self.mode = mode
+ self.iparam[0] = ishfts
+ self.iparam[2] = maxiter
+ self.iparam[3] = 1
+ self.iparam[6] = mode
+
+ self.n = n
+ self.tol = tol
+ self.k = k
+ self.maxiter = maxiter
+ self.ncv = ncv
+ self.which = which
+ self.tp = tp
+ self.info = info
+
+ self.converged = False
+ self.ido = 0
+
+ def _raise_no_convergence(self):
+ msg = "No convergence (%d iterations, %d/%d eigenvectors converged)"
+ k_ok = self.iparam[4]
+ num_iter = self.iparam[2]
+ try:
+ ev, vec = self.extract(True)
+ except ArpackError as err:
+ msg = f"{msg} [{err}]"
+ ev = np.zeros((0,))
+ vec = np.zeros((self.n, 0))
+ k_ok = 0
+ raise ArpackNoConvergence(msg % (num_iter, k_ok, self.k), ev, vec)
+
+
+class _SymmetricArpackParams(_ArpackParams):
+ def __init__(self, n, k, tp, matvec, mode=1, M_matvec=None,
+ Minv_matvec=None, sigma=None,
+ ncv=None, v0=None, maxiter=None, which="LM", tol=0):
+ # The following modes are supported:
+ # mode = 1:
+ # Solve the standard eigenvalue problem:
+ # A*x = lambda*x :
+ # A - symmetric
+ # Arguments should be
+ # matvec = left multiplication by A
+ # M_matvec = None [not used]
+ # Minv_matvec = None [not used]
+ #
+ # mode = 2:
+ # Solve the general eigenvalue problem:
+ # A*x = lambda*M*x
+ # A - symmetric
+ # M - symmetric positive definite
+ # Arguments should be
+ # matvec = left multiplication by A
+ # M_matvec = left multiplication by M
+ # Minv_matvec = left multiplication by M^-1
+ #
+ # mode = 3:
+ # Solve the general eigenvalue problem in shift-invert mode:
+ # A*x = lambda*M*x
+ # A - symmetric
+ # M - symmetric positive semi-definite
+ # Arguments should be
+ # matvec = None [not used]
+ # M_matvec = left multiplication by M
+ # or None, if M is the identity
+ # Minv_matvec = left multiplication by [A-sigma*M]^-1
+ #
+ # mode = 4:
+ # Solve the general eigenvalue problem in Buckling mode:
+ # A*x = lambda*AG*x
+ # A - symmetric positive semi-definite
+ # AG - symmetric indefinite
+ # Arguments should be
+ # matvec = left multiplication by A
+ # M_matvec = None [not used]
+ # Minv_matvec = left multiplication by [A-sigma*AG]^-1
+ #
+ # mode = 5:
+ # Solve the general eigenvalue problem in Cayley-transformed mode:
+ # A*x = lambda*M*x
+ # A - symmetric
+ # M - symmetric positive semi-definite
+ # Arguments should be
+ # matvec = left multiplication by A
+ # M_matvec = left multiplication by M
+ # or None, if M is the identity
+ # Minv_matvec = left multiplication by [A-sigma*M]^-1
+ if mode == 1:
+ if matvec is None:
+ raise ValueError("matvec must be specified for mode=1")
+ if M_matvec is not None:
+ raise ValueError("M_matvec cannot be specified for mode=1")
+ if Minv_matvec is not None:
+ raise ValueError("Minv_matvec cannot be specified for mode=1")
+
+ self.OP = matvec
+ self.B = lambda x: x
+ self.bmat = 'I'
+ elif mode == 2:
+ if matvec is None:
+ raise ValueError("matvec must be specified for mode=2")
+ if M_matvec is None:
+ raise ValueError("M_matvec must be specified for mode=2")
+ if Minv_matvec is None:
+ raise ValueError("Minv_matvec must be specified for mode=2")
+
+ self.OP = lambda x: Minv_matvec(matvec(x))
+ self.OPa = Minv_matvec
+ self.OPb = matvec
+ self.B = M_matvec
+ self.bmat = 'G'
+ elif mode == 3:
+ if matvec is not None:
+ raise ValueError("matvec must not be specified for mode=3")
+ if Minv_matvec is None:
+ raise ValueError("Minv_matvec must be specified for mode=3")
+
+ if M_matvec is None:
+ self.OP = Minv_matvec
+ self.OPa = Minv_matvec
+ self.B = lambda x: x
+ self.bmat = 'I'
+ else:
+ self.OP = lambda x: Minv_matvec(M_matvec(x))
+ self.OPa = Minv_matvec
+ self.B = M_matvec
+ self.bmat = 'G'
+ elif mode == 4:
+ if matvec is None:
+ raise ValueError("matvec must be specified for mode=4")
+ if M_matvec is not None:
+ raise ValueError("M_matvec must not be specified for mode=4")
+ if Minv_matvec is None:
+ raise ValueError("Minv_matvec must be specified for mode=4")
+ self.OPa = Minv_matvec
+ self.OP = lambda x: self.OPa(matvec(x))
+ self.B = matvec
+ self.bmat = 'G'
+ elif mode == 5:
+ if matvec is None:
+ raise ValueError("matvec must be specified for mode=5")
+ if Minv_matvec is None:
+ raise ValueError("Minv_matvec must be specified for mode=5")
+
+ self.OPa = Minv_matvec
+ self.A_matvec = matvec
+
+ if M_matvec is None:
+ self.OP = lambda x: Minv_matvec(matvec(x) + sigma * x)
+ self.B = lambda x: x
+ self.bmat = 'I'
+ else:
+ self.OP = lambda x: Minv_matvec(matvec(x)
+ + sigma * M_matvec(x))
+ self.B = M_matvec
+ self.bmat = 'G'
+ else:
+ raise ValueError("mode=%i not implemented" % mode)
+
+ if which not in _SEUPD_WHICH:
+ raise ValueError(f"which must be one of {' '.join(_SEUPD_WHICH)}")
+ if k >= n:
+ raise ValueError("k must be less than ndim(A), k=%d" % k)
+
+ _ArpackParams.__init__(self, n, k, tp, mode, sigma,
+ ncv, v0, maxiter, which, tol)
+
+ if self.ncv > n or self.ncv <= k:
+ raise ValueError(f"ncv must be k= n - 1:
+ raise ValueError("k must be less than ndim(A)-1, k=%d" % k)
+
+ _ArpackParams.__init__(self, n, k, tp, mode, sigma,
+ ncv, v0, maxiter, which, tol)
+
+ if self.ncv > n or self.ncv <= k + 1:
+ raise ValueError(f"ncv must be k+1 k, so we'll
+ # throw out this case.
+ nreturned -= 1
+ i += 1
+
+ else:
+ # real matrix, mode 3 or 4, imag(sigma) is nonzero:
+ # see remark 3 in neupd.f
+ # Build complex eigenvalues from real and imaginary parts
+ i = 0
+ while i <= k:
+ if abs(d[i].imag) == 0:
+ d[i] = np.dot(zr[:, i], self.matvec(zr[:, i]))
+ else:
+ if i < k:
+ z[:, i] = zr[:, i] + 1.0j * zr[:, i + 1]
+ z[:, i + 1] = z[:, i].conjugate()
+ d[i] = ((np.dot(zr[:, i],
+ self.matvec(zr[:, i]))
+ + np.dot(zr[:, i + 1],
+ self.matvec(zr[:, i + 1])))
+ + 1j * (np.dot(zr[:, i],
+ self.matvec(zr[:, i + 1]))
+ - np.dot(zr[:, i + 1],
+ self.matvec(zr[:, i]))))
+ d[i + 1] = d[i].conj()
+ i += 1
+ else:
+ #last eigenvalue is complex: the imaginary part of
+ # the eigenvector has not been returned
+ #this can only happen if nreturned > k, so we'll
+ # throw out this case.
+ nreturned -= 1
+ i += 1
+
+ # Now we have k+1 possible eigenvalues and eigenvectors
+ # Return the ones specified by the keyword "which"
+
+ if nreturned <= k:
+ # we got less or equal as many eigenvalues we wanted
+ d = d[:nreturned]
+ z = z[:, :nreturned]
+ else:
+ # we got one extra eigenvalue (likely a cc pair, but which?)
+ if self.mode in (1, 2):
+ rd = d
+ elif self.mode in (3, 4):
+ rd = 1 / (d - self.sigma)
+
+ if self.which in ['LR', 'SR']:
+ ind = np.argsort(rd.real)
+ elif self.which in ['LI', 'SI']:
+ # for LI,SI ARPACK returns largest,smallest
+ # abs(imaginary) (complex pairs come together)
+ ind = np.argsort(abs(rd.imag))
+ else:
+ ind = np.argsort(abs(rd))
+
+ if self.which in ['LR', 'LM', 'LI']:
+ ind = ind[-k:][::-1]
+ elif self.which in ['SR', 'SM', 'SI']:
+ ind = ind[:k]
+
+ d = d[ind]
+ z = z[:, ind]
+ else:
+ # complex is so much simpler...
+ d, z, ierr =\
+ self._arpack_extract(return_eigenvectors,
+ howmny, sselect, self.sigma, workev,
+ self.bmat, self.which, k, self.tol, self.resid,
+ self.v, self.iparam, self.ipntr,
+ self.workd, self.workl, self.rwork, ierr)
+
+ if ierr != 0:
+ raise ArpackError(ierr, infodict=self.extract_infodict)
+
+ k_ok = self.iparam[4]
+ d = d[:k_ok]
+ z = z[:, :k_ok]
+
+ if return_eigenvectors:
+ return d, z
+ else:
+ return d
+
+class SpLuInv(LinearOperator):
+ """
+ SpLuInv:
+ helper class to repeatedly solve M*x=b
+ using a sparse LU-decomposition of M
+ """
+
+ def __init__(self, M):
+ self.M_lu = splu(M)
+ self.shape = M.shape
+ self.dtype = M.dtype
+ self.isreal = not np.issubdtype(self.dtype, np.complexfloating)
+
+ def _matvec(self, x):
+ # careful here: splu.solve will throw away imaginary
+ # part of x if M is real
+ x = np.asarray(x)
+ if self.isreal and np.issubdtype(x.dtype, np.complexfloating):
+ return (self.M_lu.solve(np.real(x).astype(self.dtype))
+ + 1j * self.M_lu.solve(np.imag(x).astype(self.dtype)))
+ else:
+ return self.M_lu.solve(x.astype(self.dtype))
+
+
+class LuInv(LinearOperator):
+ """
+ LuInv:
+ helper class to repeatedly solve M*x=b
+ using an LU-decomposition of M
+ """
+
+ def __init__(self, M):
+ self.M_lu = lu_factor(M)
+ self.shape = M.shape
+ self.dtype = M.dtype
+
+ def _matvec(self, x):
+ return lu_solve(self.M_lu, x)
+
+
+def gmres_loose(A, b, tol):
+ """
+ gmres with looser termination condition.
+ """
+ b = np.asarray(b)
+ min_tol = 1000 * np.sqrt(b.size) * np.finfo(b.dtype).eps
+ return gmres(A, b, rtol=max(tol, min_tol), atol=0)
+
+
+class IterInv(LinearOperator):
+ """
+ IterInv:
+ helper class to repeatedly solve M*x=b
+ using an iterative method.
+ """
+
+ def __init__(self, M, ifunc=gmres_loose, tol=0):
+ self.M = M
+ if hasattr(M, 'dtype'):
+ self.dtype = M.dtype
+ else:
+ x = np.zeros(M.shape[1])
+ self.dtype = (M * x).dtype
+ self.shape = M.shape
+
+ if tol <= 0:
+ # when tol=0, ARPACK uses machine tolerance as calculated
+ # by LAPACK's _LAMCH function. We should match this
+ tol = 2 * np.finfo(self.dtype).eps
+ self.ifunc = ifunc
+ self.tol = tol
+
+ def _matvec(self, x):
+ b, info = self.ifunc(self.M, x, tol=self.tol)
+ if info != 0:
+ raise ValueError("Error in inverting M: function "
+ "%s did not converge (info = %i)."
+ % (self.ifunc.__name__, info))
+ return b
+
+
+class IterOpInv(LinearOperator):
+ """
+ IterOpInv:
+ helper class to repeatedly solve [A-sigma*M]*x = b
+ using an iterative method
+ """
+
+ def __init__(self, A, M, sigma, ifunc=gmres_loose, tol=0):
+ self.A = A
+ self.M = M
+ self.sigma = sigma
+
+ def mult_func(x):
+ return A.matvec(x) - sigma * M.matvec(x)
+
+ def mult_func_M_None(x):
+ return A.matvec(x) - sigma * x
+
+ x = np.zeros(A.shape[1])
+ if M is None:
+ dtype = mult_func_M_None(x).dtype
+ self.OP = LinearOperator(self.A.shape,
+ mult_func_M_None,
+ dtype=dtype)
+ else:
+ dtype = mult_func(x).dtype
+ self.OP = LinearOperator(self.A.shape,
+ mult_func,
+ dtype=dtype)
+ self.shape = A.shape
+
+ if tol <= 0:
+ # when tol=0, ARPACK uses machine tolerance as calculated
+ # by LAPACK's _LAMCH function. We should match this
+ tol = 2 * np.finfo(self.OP.dtype).eps
+ self.ifunc = ifunc
+ self.tol = tol
+
+ def _matvec(self, x):
+ b, info = self.ifunc(self.OP, x, tol=self.tol)
+ if info != 0:
+ raise ValueError("Error in inverting [A-sigma*M]: function "
+ "%s did not converge (info = %i)."
+ % (self.ifunc.__name__, info))
+ return b
+
+ @property
+ def dtype(self):
+ return self.OP.dtype
+
+
+def _fast_spmatrix_to_csc(A, hermitian=False):
+ """Convert sparse matrix to CSC (by transposing, if possible)"""
+ if (A.format == "csr" and hermitian
+ and not np.issubdtype(A.dtype, np.complexfloating)):
+ return A.T
+ elif is_pydata_spmatrix(A):
+ # No need to convert
+ return A
+ else:
+ return A.tocsc()
+
+
+def get_inv_matvec(M, hermitian=False, tol=0):
+ if isdense(M):
+ return LuInv(M).matvec
+ elif issparse(M) or is_pydata_spmatrix(M):
+ M = _fast_spmatrix_to_csc(M, hermitian=hermitian)
+ return SpLuInv(M).matvec
+ else:
+ return IterInv(M, tol=tol).matvec
+
+
+def get_OPinv_matvec(A, M, sigma, hermitian=False, tol=0):
+ if sigma == 0:
+ return get_inv_matvec(A, hermitian=hermitian, tol=tol)
+
+ if M is None:
+ #M is the identity matrix
+ if isdense(A):
+ if (np.issubdtype(A.dtype, np.complexfloating)
+ or np.imag(sigma) == 0):
+ A = np.copy(A)
+ else:
+ A = A + 0j
+ A.flat[::A.shape[1] + 1] -= sigma
+ return LuInv(A).matvec
+ elif issparse(A) or is_pydata_spmatrix(A):
+ A = A - sigma * eye(A.shape[0])
+ A = _fast_spmatrix_to_csc(A, hermitian=hermitian)
+ return SpLuInv(A).matvec
+ else:
+ return IterOpInv(aslinearoperator(A),
+ M, sigma, tol=tol).matvec
+ else:
+ if ((not isdense(A) and not issparse(A) and not is_pydata_spmatrix(A)) or
+ (not isdense(M) and not issparse(M) and not is_pydata_spmatrix(A))):
+ return IterOpInv(aslinearoperator(A),
+ aslinearoperator(M),
+ sigma, tol=tol).matvec
+ elif isdense(A) or isdense(M):
+ return LuInv(A - sigma * M).matvec
+ else:
+ OP = A - sigma * M
+ OP = _fast_spmatrix_to_csc(OP, hermitian=hermitian)
+ return SpLuInv(OP).matvec
+
+
+# ARPACK is not threadsafe or reentrant (SAVE variables), so we need a
+# lock and a re-entering check.
+_ARPACK_LOCK = ReentrancyLock("Nested calls to eigs/eighs not allowed: "
+ "ARPACK is not re-entrant")
+
+
+def eigs(A, k=6, M=None, sigma=None, which='LM', v0=None,
+ ncv=None, maxiter=None, tol=0, return_eigenvectors=True,
+ Minv=None, OPinv=None, OPpart=None):
+ """
+ Find k eigenvalues and eigenvectors of the square matrix A.
+
+ Solves ``A @ x[i] = w[i] * x[i]``, the standard eigenvalue problem
+ for w[i] eigenvalues with corresponding eigenvectors x[i].
+
+ If M is specified, solves ``A @ x[i] = w[i] * M @ x[i]``, the
+ generalized eigenvalue problem for w[i] eigenvalues
+ with corresponding eigenvectors x[i]
+
+ Parameters
+ ----------
+ A : ndarray, sparse matrix or LinearOperator
+ An array, sparse matrix, or LinearOperator representing
+ the operation ``A @ x``, where A is a real or complex square matrix.
+ k : int, optional
+ The number of eigenvalues and eigenvectors desired.
+ `k` must be smaller than N-1. It is not possible to compute all
+ eigenvectors of a matrix.
+ M : ndarray, sparse matrix or LinearOperator, optional
+ An array, sparse matrix, or LinearOperator representing
+ the operation M@x for the generalized eigenvalue problem
+
+ A @ x = w * M @ x.
+
+ M must represent a real symmetric matrix if A is real, and must
+ represent a complex Hermitian matrix if A is complex. For best
+ results, the data type of M should be the same as that of A.
+ Additionally:
+
+ If `sigma` is None, M is positive definite
+
+ If sigma is specified, M is positive semi-definite
+
+ If sigma is None, eigs requires an operator to compute the solution
+ of the linear equation ``M @ x = b``. This is done internally via a
+ (sparse) LU decomposition for an explicit matrix M, or via an
+ iterative solver for a general linear operator. Alternatively,
+ the user can supply the matrix or operator Minv, which gives
+ ``x = Minv @ b = M^-1 @ b``.
+ sigma : real or complex, optional
+ Find eigenvalues near sigma using shift-invert mode. This requires
+ an operator to compute the solution of the linear system
+ ``[A - sigma * M] @ x = b``, where M is the identity matrix if
+ unspecified. This is computed internally via a (sparse) LU
+ decomposition for explicit matrices A & M, or via an iterative
+ solver if either A or M is a general linear operator.
+ Alternatively, the user can supply the matrix or operator OPinv,
+ which gives ``x = OPinv @ b = [A - sigma * M]^-1 @ b``.
+ For a real matrix A, shift-invert can either be done in imaginary
+ mode or real mode, specified by the parameter OPpart ('r' or 'i').
+ Note that when sigma is specified, the keyword 'which' (below)
+ refers to the shifted eigenvalues ``w'[i]`` where:
+
+ If A is real and OPpart == 'r' (default),
+ ``w'[i] = 1/2 * [1/(w[i]-sigma) + 1/(w[i]-conj(sigma))]``.
+
+ If A is real and OPpart == 'i',
+ ``w'[i] = 1/2i * [1/(w[i]-sigma) - 1/(w[i]-conj(sigma))]``.
+
+ If A is complex, ``w'[i] = 1/(w[i]-sigma)``.
+
+ v0 : ndarray, optional
+ Starting vector for iteration.
+ Default: random
+ ncv : int, optional
+ The number of Lanczos vectors generated
+ `ncv` must be greater than `k`; it is recommended that ``ncv > 2*k``.
+ Default: ``min(n, max(2*k + 1, 20))``
+ which : str, ['LM' | 'SM' | 'LR' | 'SR' | 'LI' | 'SI'], optional
+ Which `k` eigenvectors and eigenvalues to find:
+
+ 'LM' : largest magnitude
+
+ 'SM' : smallest magnitude
+
+ 'LR' : largest real part
+
+ 'SR' : smallest real part
+
+ 'LI' : largest imaginary part
+
+ 'SI' : smallest imaginary part
+
+ When sigma != None, 'which' refers to the shifted eigenvalues w'[i]
+ (see discussion in 'sigma', above). ARPACK is generally better
+ at finding large values than small values. If small eigenvalues are
+ desired, consider using shift-invert mode for better performance.
+ maxiter : int, optional
+ Maximum number of Arnoldi update iterations allowed
+ Default: ``n*10``
+ tol : float, optional
+ Relative accuracy for eigenvalues (stopping criterion)
+ The default value of 0 implies machine precision.
+ return_eigenvectors : bool, optional
+ Return eigenvectors (True) in addition to eigenvalues
+ Minv : ndarray, sparse matrix or LinearOperator, optional
+ See notes in M, above.
+ OPinv : ndarray, sparse matrix or LinearOperator, optional
+ See notes in sigma, above.
+ OPpart : {'r' or 'i'}, optional
+ See notes in sigma, above
+
+ Returns
+ -------
+ w : ndarray
+ Array of k eigenvalues.
+ v : ndarray
+ An array of `k` eigenvectors.
+ ``v[:, i]`` is the eigenvector corresponding to the eigenvalue w[i].
+
+ Raises
+ ------
+ ArpackNoConvergence
+ When the requested convergence is not obtained.
+ The currently converged eigenvalues and eigenvectors can be found
+ as ``eigenvalues`` and ``eigenvectors`` attributes of the exception
+ object.
+
+ See Also
+ --------
+ eigsh : eigenvalues and eigenvectors for symmetric matrix A
+ svds : singular value decomposition for a matrix A
+
+ Notes
+ -----
+ This function is a wrapper to the ARPACK [1]_ SNEUPD, DNEUPD, CNEUPD,
+ ZNEUPD, functions which use the Implicitly Restarted Arnoldi Method to
+ find the eigenvalues and eigenvectors [2]_.
+
+ References
+ ----------
+ .. [1] ARPACK Software, https://github.com/opencollab/arpack-ng
+ .. [2] R. B. Lehoucq, D. C. Sorensen, and C. Yang, ARPACK USERS GUIDE:
+ Solution of Large Scale Eigenvalue Problems by Implicitly Restarted
+ Arnoldi Methods. SIAM, Philadelphia, PA, 1998.
+
+ Examples
+ --------
+ Find 6 eigenvectors of the identity matrix:
+
+ >>> import numpy as np
+ >>> from scipy.sparse.linalg import eigs
+ >>> id = np.eye(13)
+ >>> vals, vecs = eigs(id, k=6)
+ >>> vals
+ array([ 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j, 1.+0.j])
+ >>> vecs.shape
+ (13, 6)
+
+ """
+ A = convert_pydata_sparse_to_scipy(A)
+ M = convert_pydata_sparse_to_scipy(M)
+ if A.shape[0] != A.shape[1]:
+ raise ValueError(f'expected square matrix (shape={A.shape})')
+ if M is not None:
+ if M.shape != A.shape:
+ raise ValueError(f'wrong M dimensions {M.shape}, should be {A.shape}')
+ if np.dtype(M.dtype).char.lower() != np.dtype(A.dtype).char.lower():
+ warnings.warn('M does not have the same type precision as A. '
+ 'This may adversely affect ARPACK convergence',
+ stacklevel=2)
+
+ n = A.shape[0]
+
+ if k <= 0:
+ raise ValueError("k=%d must be greater than 0." % k)
+
+ if k >= n - 1:
+ warnings.warn("k >= N - 1 for N * N square matrix. "
+ "Attempting to use scipy.linalg.eig instead.",
+ RuntimeWarning, stacklevel=2)
+
+ if issparse(A):
+ raise TypeError("Cannot use scipy.linalg.eig for sparse A with "
+ "k >= N - 1. Use scipy.linalg.eig(A.toarray()) or"
+ " reduce k.")
+ if isinstance(A, LinearOperator):
+ raise TypeError("Cannot use scipy.linalg.eig for LinearOperator "
+ "A with k >= N - 1.")
+ if isinstance(M, LinearOperator):
+ raise TypeError("Cannot use scipy.linalg.eig for LinearOperator "
+ "M with k >= N - 1.")
+
+ return eig(A, b=M, right=return_eigenvectors)
+
+ if sigma is None:
+ matvec = aslinearoperator(A).matvec
+
+ if OPinv is not None:
+ raise ValueError("OPinv should not be specified "
+ "with sigma = None.")
+ if OPpart is not None:
+ raise ValueError("OPpart should not be specified with "
+ "sigma = None or complex A")
+
+ if M is None:
+ #standard eigenvalue problem
+ mode = 1
+ M_matvec = None
+ Minv_matvec = None
+ if Minv is not None:
+ raise ValueError("Minv should not be "
+ "specified with M = None.")
+ else:
+ #general eigenvalue problem
+ mode = 2
+ if Minv is None:
+ Minv_matvec = get_inv_matvec(M, hermitian=True, tol=tol)
+ else:
+ Minv = aslinearoperator(Minv)
+ Minv_matvec = Minv.matvec
+ M_matvec = aslinearoperator(M).matvec
+ else:
+ #sigma is not None: shift-invert mode
+ if np.issubdtype(A.dtype, np.complexfloating):
+ if OPpart is not None:
+ raise ValueError("OPpart should not be specified "
+ "with sigma=None or complex A")
+ mode = 3
+ elif OPpart is None or OPpart.lower() == 'r':
+ mode = 3
+ elif OPpart.lower() == 'i':
+ if np.imag(sigma) == 0:
+ raise ValueError("OPpart cannot be 'i' if sigma is real")
+ mode = 4
+ else:
+ raise ValueError("OPpart must be one of ('r','i')")
+
+ matvec = aslinearoperator(A).matvec
+ if Minv is not None:
+ raise ValueError("Minv should not be specified when sigma is")
+ if OPinv is None:
+ Minv_matvec = get_OPinv_matvec(A, M, sigma,
+ hermitian=False, tol=tol)
+ else:
+ OPinv = aslinearoperator(OPinv)
+ Minv_matvec = OPinv.matvec
+ if M is None:
+ M_matvec = None
+ else:
+ M_matvec = aslinearoperator(M).matvec
+
+ params = _UnsymmetricArpackParams(n, k, A.dtype.char, matvec, mode,
+ M_matvec, Minv_matvec, sigma,
+ ncv, v0, maxiter, which, tol)
+
+ with _ARPACK_LOCK:
+ while not params.converged:
+ params.iterate()
+
+ return params.extract(return_eigenvectors)
+
+
+def eigsh(A, k=6, M=None, sigma=None, which='LM', v0=None,
+ ncv=None, maxiter=None, tol=0, return_eigenvectors=True,
+ Minv=None, OPinv=None, mode='normal'):
+ """
+ Find k eigenvalues and eigenvectors of the real symmetric square matrix
+ or complex Hermitian matrix A.
+
+ Solves ``A @ x[i] = w[i] * x[i]``, the standard eigenvalue problem for
+ w[i] eigenvalues with corresponding eigenvectors x[i].
+
+ If M is specified, solves ``A @ x[i] = w[i] * M @ x[i]``, the
+ generalized eigenvalue problem for w[i] eigenvalues
+ with corresponding eigenvectors x[i].
+
+ Note that there is no specialized routine for the case when A is a complex
+ Hermitian matrix. In this case, ``eigsh()`` will call ``eigs()`` and return the
+ real parts of the eigenvalues thus obtained.
+
+ Parameters
+ ----------
+ A : ndarray, sparse matrix or LinearOperator
+ A square operator representing the operation ``A @ x``, where ``A`` is
+ real symmetric or complex Hermitian. For buckling mode (see below)
+ ``A`` must additionally be positive-definite.
+ k : int, optional
+ The number of eigenvalues and eigenvectors desired.
+ `k` must be smaller than N. It is not possible to compute all
+ eigenvectors of a matrix.
+
+ Returns
+ -------
+ w : array
+ Array of k eigenvalues.
+ v : array
+ An array representing the `k` eigenvectors. The column ``v[:, i]`` is
+ the eigenvector corresponding to the eigenvalue ``w[i]``.
+
+ Other Parameters
+ ----------------
+ M : An N x N matrix, array, sparse matrix, or linear operator representing
+ the operation ``M @ x`` for the generalized eigenvalue problem
+
+ A @ x = w * M @ x.
+
+ M must represent a real symmetric matrix if A is real, and must
+ represent a complex Hermitian matrix if A is complex. For best
+ results, the data type of M should be the same as that of A.
+ Additionally:
+
+ If sigma is None, M is symmetric positive definite.
+
+ If sigma is specified, M is symmetric positive semi-definite.
+
+ In buckling mode, M is symmetric indefinite.
+
+ If sigma is None, eigsh requires an operator to compute the solution
+ of the linear equation ``M @ x = b``. This is done internally via a
+ (sparse) LU decomposition for an explicit matrix M, or via an
+ iterative solver for a general linear operator. Alternatively,
+ the user can supply the matrix or operator Minv, which gives
+ ``x = Minv @ b = M^-1 @ b``.
+ sigma : real
+ Find eigenvalues near sigma using shift-invert mode. This requires
+ an operator to compute the solution of the linear system
+ ``[A - sigma * M] x = b``, where M is the identity matrix if
+ unspecified. This is computed internally via a (sparse) LU
+ decomposition for explicit matrices A & M, or via an iterative
+ solver if either A or M is a general linear operator.
+ Alternatively, the user can supply the matrix or operator OPinv,
+ which gives ``x = OPinv @ b = [A - sigma * M]^-1 @ b``.
+ Note that when sigma is specified, the keyword 'which' refers to
+ the shifted eigenvalues ``w'[i]`` where:
+
+ if mode == 'normal', ``w'[i] = 1 / (w[i] - sigma)``.
+
+ if mode == 'cayley', ``w'[i] = (w[i] + sigma) / (w[i] - sigma)``.
+
+ if mode == 'buckling', ``w'[i] = w[i] / (w[i] - sigma)``.
+
+ (see further discussion in 'mode' below)
+ v0 : ndarray, optional
+ Starting vector for iteration.
+ Default: random
+ ncv : int, optional
+ The number of Lanczos vectors generated ncv must be greater than k and
+ smaller than n; it is recommended that ``ncv > 2*k``.
+ Default: ``min(n, max(2*k + 1, 20))``
+ which : str ['LM' | 'SM' | 'LA' | 'SA' | 'BE']
+ If A is a complex Hermitian matrix, 'BE' is invalid.
+ Which `k` eigenvectors and eigenvalues to find:
+
+ 'LM' : Largest (in magnitude) eigenvalues.
+
+ 'SM' : Smallest (in magnitude) eigenvalues.
+
+ 'LA' : Largest (algebraic) eigenvalues.
+
+ 'SA' : Smallest (algebraic) eigenvalues.
+
+ 'BE' : Half (k/2) from each end of the spectrum.
+
+ When k is odd, return one more (k/2+1) from the high end.
+ When sigma != None, 'which' refers to the shifted eigenvalues ``w'[i]``
+ (see discussion in 'sigma', above). ARPACK is generally better
+ at finding large values than small values. If small eigenvalues are
+ desired, consider using shift-invert mode for better performance.
+ maxiter : int, optional
+ Maximum number of Arnoldi update iterations allowed.
+ Default: ``n*10``
+ tol : float
+ Relative accuracy for eigenvalues (stopping criterion).
+ The default value of 0 implies machine precision.
+ Minv : N x N matrix, array, sparse matrix, or LinearOperator
+ See notes in M, above.
+ OPinv : N x N matrix, array, sparse matrix, or LinearOperator
+ See notes in sigma, above.
+ return_eigenvectors : bool
+ Return eigenvectors (True) in addition to eigenvalues.
+ This value determines the order in which eigenvalues are sorted.
+ The sort order is also dependent on the `which` variable.
+
+ For which = 'LM' or 'SA':
+ If `return_eigenvectors` is True, eigenvalues are sorted by
+ algebraic value.
+
+ If `return_eigenvectors` is False, eigenvalues are sorted by
+ absolute value.
+
+ For which = 'BE' or 'LA':
+ eigenvalues are always sorted by algebraic value.
+
+ For which = 'SM':
+ If `return_eigenvectors` is True, eigenvalues are sorted by
+ algebraic value.
+
+ If `return_eigenvectors` is False, eigenvalues are sorted by
+ decreasing absolute value.
+
+ mode : string ['normal' | 'buckling' | 'cayley']
+ Specify strategy to use for shift-invert mode. This argument applies
+ only for real-valued A and sigma != None. For shift-invert mode,
+ ARPACK internally solves the eigenvalue problem
+ ``OP @ x'[i] = w'[i] * B @ x'[i]``
+ and transforms the resulting Ritz vectors x'[i] and Ritz values w'[i]
+ into the desired eigenvectors and eigenvalues of the problem
+ ``A @ x[i] = w[i] * M @ x[i]``.
+ The modes are as follows:
+
+ 'normal' :
+ OP = [A - sigma * M]^-1 @ M,
+ B = M,
+ w'[i] = 1 / (w[i] - sigma)
+
+ 'buckling' :
+ OP = [A - sigma * M]^-1 @ A,
+ B = A,
+ w'[i] = w[i] / (w[i] - sigma)
+
+ 'cayley' :
+ OP = [A - sigma * M]^-1 @ [A + sigma * M],
+ B = M,
+ w'[i] = (w[i] + sigma) / (w[i] - sigma)
+
+ The choice of mode will affect which eigenvalues are selected by
+ the keyword 'which', and can also impact the stability of
+ convergence (see [2] for a discussion).
+
+ Raises
+ ------
+ ArpackNoConvergence
+ When the requested convergence is not obtained.
+
+ The currently converged eigenvalues and eigenvectors can be found
+ as ``eigenvalues`` and ``eigenvectors`` attributes of the exception
+ object.
+
+ See Also
+ --------
+ eigs : eigenvalues and eigenvectors for a general (nonsymmetric) matrix A
+ svds : singular value decomposition for a matrix A
+
+ Notes
+ -----
+ This function is a wrapper to the ARPACK [1]_ SSEUPD and DSEUPD
+ functions which use the Implicitly Restarted Lanczos Method to
+ find the eigenvalues and eigenvectors [2]_.
+
+ References
+ ----------
+ .. [1] ARPACK Software, https://github.com/opencollab/arpack-ng
+ .. [2] R. B. Lehoucq, D. C. Sorensen, and C. Yang, ARPACK USERS GUIDE:
+ Solution of Large Scale Eigenvalue Problems by Implicitly Restarted
+ Arnoldi Methods. SIAM, Philadelphia, PA, 1998.
+
+ Examples
+ --------
+ >>> import numpy as np
+ >>> from scipy.sparse.linalg import eigsh
+ >>> identity = np.eye(13)
+ >>> eigenvalues, eigenvectors = eigsh(identity, k=6)
+ >>> eigenvalues
+ array([1., 1., 1., 1., 1., 1.])
+ >>> eigenvectors.shape
+ (13, 6)
+
+ """
+ # complex Hermitian matrices should be solved with eigs
+ if np.issubdtype(A.dtype, np.complexfloating):
+ if mode != 'normal':
+ raise ValueError(f"mode={mode} cannot be used with complex matrix A")
+ if which == 'BE':
+ raise ValueError("which='BE' cannot be used with complex matrix A")
+ elif which == 'LA':
+ which = 'LR'
+ elif which == 'SA':
+ which = 'SR'
+ ret = eigs(A, k, M=M, sigma=sigma, which=which, v0=v0,
+ ncv=ncv, maxiter=maxiter, tol=tol,
+ return_eigenvectors=return_eigenvectors, Minv=Minv,
+ OPinv=OPinv)
+
+ if return_eigenvectors:
+ return ret[0].real, ret[1]
+ else:
+ return ret.real
+
+ if A.shape[0] != A.shape[1]:
+ raise ValueError(f'expected square matrix (shape={A.shape})')
+ if M is not None:
+ if M.shape != A.shape:
+ raise ValueError(f'wrong M dimensions {M.shape}, should be {A.shape}')
+ if np.dtype(M.dtype).char.lower() != np.dtype(A.dtype).char.lower():
+ warnings.warn('M does not have the same type precision as A. '
+ 'This may adversely affect ARPACK convergence',
+ stacklevel=2)
+
+ n = A.shape[0]
+
+ if k <= 0:
+ raise ValueError("k must be greater than 0.")
+
+ if k >= n:
+ warnings.warn("k >= N for N * N square matrix. "
+ "Attempting to use scipy.linalg.eigh instead.",
+ RuntimeWarning, stacklevel=2)
+
+ if issparse(A):
+ raise TypeError("Cannot use scipy.linalg.eigh for sparse A with "
+ "k >= N. Use scipy.linalg.eigh(A.toarray()) or"
+ " reduce k.")
+ if isinstance(A, LinearOperator):
+ raise TypeError("Cannot use scipy.linalg.eigh for LinearOperator "
+ "A with k >= N.")
+ if isinstance(M, LinearOperator):
+ raise TypeError("Cannot use scipy.linalg.eigh for LinearOperator "
+ "M with k >= N.")
+
+ return eigh(A, b=M, eigvals_only=not return_eigenvectors)
+
+ if sigma is None:
+ A = aslinearoperator(A)
+ matvec = A.matvec
+
+ if OPinv is not None:
+ raise ValueError("OPinv should not be specified "
+ "with sigma = None.")
+ if M is None:
+ #standard eigenvalue problem
+ mode = 1
+ M_matvec = None
+ Minv_matvec = None
+ if Minv is not None:
+ raise ValueError("Minv should not be "
+ "specified with M = None.")
+ else:
+ #general eigenvalue problem
+ mode = 2
+ if Minv is None:
+ Minv_matvec = get_inv_matvec(M, hermitian=True, tol=tol)
+ else:
+ Minv = aslinearoperator(Minv)
+ Minv_matvec = Minv.matvec
+ M_matvec = aslinearoperator(M).matvec
+ else:
+ # sigma is not None: shift-invert mode
+ if Minv is not None:
+ raise ValueError("Minv should not be specified when sigma is")
+
+ # normal mode
+ if mode == 'normal':
+ mode = 3
+ matvec = None
+ if OPinv is None:
+ Minv_matvec = get_OPinv_matvec(A, M, sigma,
+ hermitian=True, tol=tol)
+ else:
+ OPinv = aslinearoperator(OPinv)
+ Minv_matvec = OPinv.matvec
+ if M is None:
+ M_matvec = None
+ else:
+ M = aslinearoperator(M)
+ M_matvec = M.matvec
+
+ # buckling mode
+ elif mode == 'buckling':
+ mode = 4
+ if OPinv is None:
+ Minv_matvec = get_OPinv_matvec(A, M, sigma,
+ hermitian=True, tol=tol)
+ else:
+ Minv_matvec = aslinearoperator(OPinv).matvec
+ matvec = aslinearoperator(A).matvec
+ M_matvec = None
+
+ # cayley-transform mode
+ elif mode == 'cayley':
+ mode = 5
+ matvec = aslinearoperator(A).matvec
+ if OPinv is None:
+ Minv_matvec = get_OPinv_matvec(A, M, sigma,
+ hermitian=True, tol=tol)
+ else:
+ Minv_matvec = aslinearoperator(OPinv).matvec
+ if M is None:
+ M_matvec = None
+ else:
+ M_matvec = aslinearoperator(M).matvec
+
+ # unrecognized mode
+ else:
+ raise ValueError(f"unrecognized mode '{mode}'")
+
+ params = _SymmetricArpackParams(n, k, A.dtype.char, matvec, mode,
+ M_matvec, Minv_matvec, sigma,
+ ncv, v0, maxiter, which, tol)
+
+ with _ARPACK_LOCK:
+ while not params.converged:
+ params.iterate()
+
+ return params.extract(return_eigenvectors)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/tests/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/tests/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/tests/test_arpack.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/tests/test_arpack.py
new file mode 100644
index 0000000000000000000000000000000000000000..e962798a9ffce0b380c17cdf1f9deb4d6fa83159
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/arpack/tests/test_arpack.py
@@ -0,0 +1,717 @@
+__usage__ = """
+To run tests locally:
+ python tests/test_arpack.py [-l] [-v]
+
+"""
+
+import threading
+import itertools
+
+import numpy as np
+
+from numpy.testing import assert_allclose, assert_equal, suppress_warnings
+from pytest import raises as assert_raises
+import pytest
+
+from numpy import dot, conj, random
+from scipy.linalg import eig, eigh
+from scipy.sparse import csc_array, csr_array, diags_array, random_array
+from scipy.sparse.linalg import LinearOperator, aslinearoperator
+from scipy.sparse.linalg._eigen.arpack import (eigs, eigsh, arpack,
+ ArpackNoConvergence)
+
+
+from scipy._lib._gcutils import assert_deallocated, IS_PYPY
+
+
+# precision for tests
+_ndigits = {'f': 3, 'd': 11, 'F': 3, 'D': 11}
+
+
+def _get_test_tolerance(type_char, mattype=None, D_type=None, which=None):
+ """
+ Return tolerance values suitable for a given test:
+
+ Parameters
+ ----------
+ type_char : {'f', 'd', 'F', 'D'}
+ Data type in ARPACK eigenvalue problem
+ mattype : {csr_array, aslinearoperator, asarray}, optional
+ Linear operator type
+
+ Returns
+ -------
+ tol
+ Tolerance to pass to the ARPACK routine
+ rtol
+ Relative tolerance for outputs
+ atol
+ Absolute tolerance for outputs
+
+ """
+
+ rtol = {'f': 3000 * np.finfo(np.float32).eps,
+ 'F': 3000 * np.finfo(np.float32).eps,
+ 'd': 2000 * np.finfo(np.float64).eps,
+ 'D': 2000 * np.finfo(np.float64).eps}[type_char]
+ atol = rtol
+ tol = 0
+
+ if mattype is aslinearoperator and type_char in ('f', 'F'):
+ # iterative methods in single precision: worse errors
+ # also: bump ARPACK tolerance so that the iterative method converges
+ tol = 30 * np.finfo(np.float32).eps
+ rtol *= 5
+
+ if (
+ isinstance(mattype, type) and issubclass(mattype, csr_array)
+ and type_char in ('f', 'F')
+ ):
+ # sparse in single precision: worse errors
+ rtol *= 5
+
+ if (
+ which in ('LM', 'SM', 'LA')
+ and D_type.name == "gen-hermitian-Mc"
+ ):
+ if type_char == 'F':
+ # missing case 1, 2, and more, from PR 14798
+ rtol *= 5
+
+ if type_char == 'D':
+ # missing more cases, from PR 14798
+ rtol *= 10
+ atol *= 10
+
+ return tol, rtol, atol
+
+
+def generate_matrix(N, complex_=False, hermitian=False,
+ pos_definite=False, sparse=False, rng=None):
+ M = rng.random((N, N))
+ if complex_:
+ M = M + 1j * rng.random((N, N))
+
+ if hermitian:
+ if pos_definite:
+ if sparse:
+ i = np.arange(N)
+ j = rng.randint(N, size=N-2)
+ i, j = np.meshgrid(i, j)
+ M[i, j] = 0
+ M = np.dot(M.conj(), M.T)
+ else:
+ M = np.dot(M.conj(), M.T)
+ if sparse:
+ i = rng.randint(N, size=N * N // 4)
+ j = rng.randint(N, size=N * N // 4)
+ ind = np.nonzero(i == j)
+ j[ind] = (j[ind] + 1) % N
+ M[i, j] = 0
+ M[j, i] = 0
+ else:
+ if sparse:
+ i = rng.randint(N, size=N * N // 2)
+ j = rng.randint(N, size=N * N // 2)
+ M[i, j] = 0
+ return M
+
+
+def generate_matrix_symmetric(N, pos_definite=False, sparse=False, rng=None):
+ M = rng.random((N, N))
+
+ M = 0.5 * (M + M.T) # Make M symmetric
+
+ if pos_definite:
+ Id = N * np.eye(N)
+ if sparse:
+ M = csr_array(M)
+ M += Id
+ else:
+ if sparse:
+ M = csr_array(M)
+
+ return M
+
+
+def assert_allclose_cc(actual, desired, **kw):
+ """Almost equal or complex conjugates almost equal"""
+ try:
+ assert_allclose(actual, desired, **kw)
+ except AssertionError:
+ assert_allclose(actual, conj(desired), **kw)
+
+
+def argsort_which(eigenvalues, typ, k, which,
+ sigma=None, OPpart=None, mode=None):
+ """Return sorted indices of eigenvalues using the "which" keyword
+ from eigs and eigsh"""
+ if sigma is None:
+ reval = np.round(eigenvalues, decimals=_ndigits[typ])
+ else:
+ if mode is None or mode == 'normal':
+ if OPpart is None:
+ reval = 1. / (eigenvalues - sigma)
+ elif OPpart == 'r':
+ reval = 0.5 * (1. / (eigenvalues - sigma)
+ + 1. / (eigenvalues - np.conj(sigma)))
+ elif OPpart == 'i':
+ reval = -0.5j * (1. / (eigenvalues - sigma)
+ - 1. / (eigenvalues - np.conj(sigma)))
+ elif mode == 'cayley':
+ reval = (eigenvalues + sigma) / (eigenvalues - sigma)
+ elif mode == 'buckling':
+ reval = eigenvalues / (eigenvalues - sigma)
+ else:
+ raise ValueError(f"mode='{mode}' not recognized")
+
+ reval = np.round(reval, decimals=_ndigits[typ])
+
+ if which in ['LM', 'SM']:
+ ind = np.argsort(abs(reval))
+ elif which in ['LR', 'SR', 'LA', 'SA', 'BE']:
+ ind = np.argsort(np.real(reval))
+ elif which in ['LI', 'SI']:
+ # for LI,SI ARPACK returns largest,smallest abs(imaginary) why?
+ if typ.islower():
+ ind = np.argsort(abs(np.imag(reval)))
+ else:
+ ind = np.argsort(np.imag(reval))
+ else:
+ raise ValueError(f"which='{which}' is unrecognized")
+
+ if which in ['LM', 'LA', 'LR', 'LI']:
+ return ind[-k:]
+ elif which in ['SM', 'SA', 'SR', 'SI']:
+ return ind[:k]
+ elif which == 'BE':
+ return np.concatenate((ind[:k//2], ind[k//2-k:]))
+
+
+def eval_evec(symmetric, d, typ, k, which, v0=None, sigma=None,
+ mattype=np.asarray, OPpart=None, mode='normal'):
+ general = ('bmat' in d)
+
+ if symmetric:
+ eigs_func = eigsh
+ else:
+ eigs_func = eigs
+
+ if general:
+ err = (f"error for {eigs_func.__name__}:general, typ={typ}, which={which}, "
+ f"sigma={sigma}, mattype={mattype.__name__},"
+ f" OPpart={OPpart}, mode={mode}")
+ else:
+ err = (f"error for {eigs_func.__name__}:standard, typ={typ}, which={which}, "
+ f"sigma={sigma}, mattype={mattype.__name__}, "
+ f"OPpart={OPpart}, mode={mode}")
+
+ a = d['mat'].astype(typ)
+ ac = mattype(a)
+
+ if general:
+ b = d['bmat'].astype(typ)
+ bc = mattype(b)
+
+ # get exact eigenvalues
+ exact_eval = d['eval'].astype(typ.upper())
+ ind = argsort_which(exact_eval, typ, k, which,
+ sigma, OPpart, mode)
+ exact_eval = exact_eval[ind]
+
+ # compute arpack eigenvalues
+ kwargs = dict(which=which, v0=v0, sigma=sigma)
+ if eigs_func is eigsh:
+ kwargs['mode'] = mode
+ else:
+ kwargs['OPpart'] = OPpart
+
+ # compute suitable tolerances
+ kwargs['tol'], rtol, atol = _get_test_tolerance(typ, mattype, d, which)
+ # on rare occasions, ARPACK routines return results that are proper
+ # eigenvalues and -vectors, but not necessarily the ones requested in
+ # the parameter which. This is inherent to the Krylov methods, and
+ # should not be treated as a failure. If such a rare situation
+ # occurs, the calculation is tried again (but at most a few times).
+ ntries = 0
+ while ntries < 5:
+ # solve
+ if general:
+ try:
+ eigenvalues, evec = eigs_func(ac, k, bc, **kwargs)
+ except ArpackNoConvergence:
+ kwargs['maxiter'] = 20*a.shape[0]
+ eigenvalues, evec = eigs_func(ac, k, bc, **kwargs)
+ else:
+ try:
+ eigenvalues, evec = eigs_func(ac, k, **kwargs)
+ except ArpackNoConvergence:
+ kwargs['maxiter'] = 20*a.shape[0]
+ eigenvalues, evec = eigs_func(ac, k, **kwargs)
+
+ ind = argsort_which(eigenvalues, typ, k, which,
+ sigma, OPpart, mode)
+ eigenvalues = eigenvalues[ind]
+ evec = evec[:, ind]
+
+ try:
+ # check eigenvalues
+ assert_allclose_cc(eigenvalues, exact_eval, rtol=rtol, atol=atol,
+ err_msg=err)
+ check_evecs = True
+ except AssertionError:
+ check_evecs = False
+ ntries += 1
+
+ if check_evecs:
+ # check eigenvectors
+ LHS = np.dot(a, evec)
+ if general:
+ RHS = eigenvalues * np.dot(b, evec)
+ else:
+ RHS = eigenvalues * evec
+
+ assert_allclose(LHS, RHS, rtol=rtol, atol=atol, err_msg=err)
+ break
+
+ # check eigenvalues
+ assert_allclose_cc(eigenvalues, exact_eval, rtol=rtol, atol=atol, err_msg=err)
+
+
+class DictWithRepr(dict):
+ def __init__(self, name):
+ self.name = name
+
+ def __repr__(self):
+ return f"<{self.name}>"
+
+
+class SymmetricParams:
+ def __init__(self):
+ self.eigs = eigsh
+ self.which = ['LM', 'SM', 'LA', 'SA', 'BE']
+ self.mattypes = [csr_array, aslinearoperator, np.asarray]
+ self.sigmas_modes = {None: ['normal'],
+ 0.5: ['normal', 'buckling', 'cayley']}
+
+ # generate matrices
+ # these should all be float32 so that the eigenvalues
+ # are the same in float32 and float64
+ N = 6
+ rng = np.random.RandomState(2300)
+ Ar = generate_matrix(N, hermitian=True,
+ pos_definite=True,
+ rng=rng).astype('f').astype('d')
+ M = generate_matrix(N, hermitian=True,
+ pos_definite=True,
+ rng=rng).astype('f').astype('d')
+ Ac = generate_matrix(N, hermitian=True, pos_definite=True,
+ complex_=True, rng=rng).astype('F').astype('D')
+ Mc = generate_matrix(N, hermitian=True, pos_definite=True,
+ complex_=True, rng=rng).astype('F').astype('D')
+ v0 = rng.random(N)
+
+ # standard symmetric problem
+ SS = DictWithRepr("std-symmetric")
+ SS['mat'] = Ar
+ SS['v0'] = v0
+ SS['eval'] = eigh(SS['mat'], eigvals_only=True)
+
+ # general symmetric problem
+ GS = DictWithRepr("gen-symmetric")
+ GS['mat'] = Ar
+ GS['bmat'] = M
+ GS['v0'] = v0
+ GS['eval'] = eigh(GS['mat'], GS['bmat'], eigvals_only=True)
+
+ # standard hermitian problem
+ SH = DictWithRepr("std-hermitian")
+ SH['mat'] = Ac
+ SH['v0'] = v0
+ SH['eval'] = eigh(SH['mat'], eigvals_only=True)
+
+ # general hermitian problem
+ GH = DictWithRepr("gen-hermitian")
+ GH['mat'] = Ac
+ GH['bmat'] = M
+ GH['v0'] = v0
+ GH['eval'] = eigh(GH['mat'], GH['bmat'], eigvals_only=True)
+
+ # general hermitian problem with hermitian M
+ GHc = DictWithRepr("gen-hermitian-Mc")
+ GHc['mat'] = Ac
+ GHc['bmat'] = Mc
+ GHc['v0'] = v0
+ GHc['eval'] = eigh(GHc['mat'], GHc['bmat'], eigvals_only=True)
+
+ self.real_test_cases = [SS, GS]
+ self.complex_test_cases = [SH, GH, GHc]
+
+
+class NonSymmetricParams:
+ def __init__(self):
+ self.eigs = eigs
+ self.which = ['LM', 'LR', 'LI'] # , 'SM', 'LR', 'SR', 'LI', 'SI']
+ self.mattypes = [csr_array, aslinearoperator, np.asarray]
+ self.sigmas_OPparts = {None: [None],
+ 0.1: ['r'],
+ 0.1 + 0.1j: ['r', 'i']}
+
+ # generate matrices
+ # these should all be float32 so that the eigenvalues
+ # are the same in float32 and float64
+ N = 6
+ rng = np.random.RandomState(2300)
+ Ar = generate_matrix(N, rng=rng).astype('f').astype('d')
+ M = generate_matrix(N, hermitian=True,
+ pos_definite=True, rng=rng).astype('f').astype('d')
+ Ac = generate_matrix(N, complex_=True, rng=rng).astype('F').astype('D')
+ v0 = rng.random(N)
+
+ # standard real nonsymmetric problem
+ SNR = DictWithRepr("std-real-nonsym")
+ SNR['mat'] = Ar
+ SNR['v0'] = v0
+ SNR['eval'] = eig(SNR['mat'], left=False, right=False)
+
+ # general real nonsymmetric problem
+ GNR = DictWithRepr("gen-real-nonsym")
+ GNR['mat'] = Ar
+ GNR['bmat'] = M
+ GNR['v0'] = v0
+ GNR['eval'] = eig(GNR['mat'], GNR['bmat'], left=False, right=False)
+
+ # standard complex nonsymmetric problem
+ SNC = DictWithRepr("std-cmplx-nonsym")
+ SNC['mat'] = Ac
+ SNC['v0'] = v0
+ SNC['eval'] = eig(SNC['mat'], left=False, right=False)
+
+ # general complex nonsymmetric problem
+ GNC = DictWithRepr("gen-cmplx-nonsym")
+ GNC['mat'] = Ac
+ GNC['bmat'] = M
+ GNC['v0'] = v0
+ GNC['eval'] = eig(GNC['mat'], GNC['bmat'], left=False, right=False)
+
+ self.real_test_cases = [SNR, GNR]
+ self.complex_test_cases = [SNC, GNC]
+
+
+@pytest.mark.iterations(1)
+@pytest.mark.thread_unsafe
+def test_symmetric_modes(num_parallel_threads):
+ assert num_parallel_threads == 1
+ params = SymmetricParams()
+ k = 2
+ symmetric = True
+ for D in params.real_test_cases:
+ for typ in 'fd':
+ for which in params.which:
+ for mattype in params.mattypes:
+ for (sigma, modes) in params.sigmas_modes.items():
+ for mode in modes:
+ eval_evec(symmetric, D, typ, k, which,
+ None, sigma, mattype, None, mode)
+
+
+def test_hermitian_modes():
+ params = SymmetricParams()
+ k = 2
+ symmetric = True
+ for D in params.complex_test_cases:
+ for typ in 'FD':
+ for which in params.which:
+ if which == 'BE':
+ continue # BE invalid for complex
+ for mattype in params.mattypes:
+ for sigma in params.sigmas_modes:
+ eval_evec(symmetric, D, typ, k, which,
+ None, sigma, mattype)
+
+
+def test_symmetric_starting_vector():
+ params = SymmetricParams()
+ symmetric = True
+ for k in [1, 2, 3, 4, 5]:
+ for D in params.real_test_cases:
+ for typ in 'fd':
+ v0 = random.rand(len(D['v0'])).astype(typ)
+ eval_evec(symmetric, D, typ, k, 'LM', v0)
+
+
+def test_symmetric_no_convergence():
+ rng = np.random.RandomState(1234)
+ m = generate_matrix(30, hermitian=True, pos_definite=True, rng=rng)
+ tol, rtol, atol = _get_test_tolerance('d')
+ try:
+ w, v = eigsh(m, 4, which='LM', v0=m[:, 0], maxiter=5, tol=tol, ncv=9)
+ raise AssertionError("Spurious no-error exit")
+ except ArpackNoConvergence as err:
+ k = len(err.eigenvalues)
+ if k <= 0:
+ raise AssertionError("Spurious no-eigenvalues-found case") from err
+ w, v = err.eigenvalues, err.eigenvectors
+ assert_allclose(dot(m, v), w * v, rtol=rtol, atol=atol)
+
+
+def test_real_nonsymmetric_modes():
+ params = NonSymmetricParams()
+ k = 2
+ symmetric = False
+ for D in params.real_test_cases:
+ for typ in 'fd':
+ for which in params.which:
+ for mattype in params.mattypes:
+ for sigma, OPparts in params.sigmas_OPparts.items():
+ for OPpart in OPparts:
+ eval_evec(symmetric, D, typ, k, which,
+ None, sigma, mattype, OPpart)
+
+
+def test_complex_nonsymmetric_modes():
+ params = NonSymmetricParams()
+ k = 2
+ symmetric = False
+ for D in params.complex_test_cases:
+ for typ in 'DF':
+ for which in params.which:
+ for mattype in params.mattypes:
+ for sigma in params.sigmas_OPparts:
+ eval_evec(symmetric, D, typ, k, which,
+ None, sigma, mattype)
+
+
+def test_standard_nonsymmetric_starting_vector():
+ params = NonSymmetricParams()
+ sigma = None
+ symmetric = False
+ for k in [1, 2, 3, 4]:
+ for d in params.complex_test_cases:
+ for typ in 'FD':
+ A = d['mat']
+ n = A.shape[0]
+ v0 = random.rand(n).astype(typ)
+ eval_evec(symmetric, d, typ, k, "LM", v0, sigma)
+
+
+def test_general_nonsymmetric_starting_vector():
+ params = NonSymmetricParams()
+ sigma = None
+ symmetric = False
+ for k in [1, 2, 3, 4]:
+ for d in params.complex_test_cases:
+ for typ in 'FD':
+ A = d['mat']
+ n = A.shape[0]
+ v0 = random.rand(n).astype(typ)
+ eval_evec(symmetric, d, typ, k, "LM", v0, sigma)
+
+
+def test_standard_nonsymmetric_no_convergence():
+ rng = np.random.RandomState(1234)
+ m = generate_matrix(30, complex_=True, rng=rng)
+ tol, rtol, atol = _get_test_tolerance('d')
+ try:
+ w, v = eigs(m, 4, which='LM', v0=m[:, 0], maxiter=5, tol=tol)
+ raise AssertionError("Spurious no-error exit")
+ except ArpackNoConvergence as err:
+ k = len(err.eigenvalues)
+ if k <= 0:
+ raise AssertionError("Spurious no-eigenvalues-found case") from err
+ w, v = err.eigenvalues, err.eigenvectors
+ for ww, vv in zip(w, v.T):
+ assert_allclose(dot(m, vv), ww * vv, rtol=rtol, atol=atol)
+
+
+def test_eigen_bad_shapes():
+ # A is not square.
+ A = csc_array(np.zeros((2, 3)))
+ assert_raises(ValueError, eigs, A)
+
+
+def test_eigen_bad_kwargs():
+ # Test eigen on wrong keyword argument
+ A = csc_array(np.zeros((8, 8)))
+ assert_raises(ValueError, eigs, A, which='XX')
+
+
+def test_ticket_1459_arpack_crash():
+ for dtype in [np.float32, np.float64]:
+ # This test does not seem to catch the issue for float32,
+ # but we made the same fix there, just to be sure
+
+ N = 6
+ k = 2
+
+ np.random.seed(2301)
+ A = np.random.random((N, N)).astype(dtype)
+ v0 = np.array([-0.71063568258907849895, -0.83185111795729227424,
+ -0.34365925382227402451, 0.46122533684552280420,
+ -0.58001341115969040629, -0.78844877570084292984e-01],
+ dtype=dtype)
+
+ # Should not crash:
+ evals, evecs = eigs(A, k, v0=v0)
+
+
+@pytest.mark.skipif(IS_PYPY, reason="Test not meaningful on PyPy")
+def test_linearoperator_deallocation():
+ # Check that the linear operators used by the Arpack wrappers are
+ # deallocatable by reference counting -- they are big objects, so
+ # Python's cyclic GC may not collect them fast enough before
+ # running out of memory if eigs/eigsh are called in a tight loop.
+
+ M_d = np.eye(10)
+ M_s = csc_array(M_d)
+ M_o = aslinearoperator(M_d)
+
+ with assert_deallocated(lambda: arpack.SpLuInv(M_s)):
+ pass
+ with assert_deallocated(lambda: arpack.LuInv(M_d)):
+ pass
+ with assert_deallocated(lambda: arpack.IterInv(M_s)):
+ pass
+ with assert_deallocated(lambda: arpack.IterOpInv(M_o, None, 0.3)):
+ pass
+ with assert_deallocated(lambda: arpack.IterOpInv(M_o, M_o, 0.3)):
+ pass
+
+
+@pytest.mark.thread_unsafe
+def test_parallel_threads():
+ results = []
+ v0 = np.random.rand(50)
+
+ def worker():
+ x = diags_array([1, -2, 1], offsets=[-1, 0, 1], shape=(50, 50))
+ w, v = eigs(x, k=3, v0=v0)
+ results.append(w)
+
+ w, v = eigsh(x, k=3, v0=v0)
+ results.append(w)
+
+ threads = [threading.Thread(target=worker) for k in range(10)]
+ for t in threads:
+ t.start()
+ for t in threads:
+ t.join()
+
+ worker()
+
+ for r in results:
+ assert_allclose(r, results[-1])
+
+
+def test_reentering():
+ # Just some linear operator that calls eigs recursively
+ def A_matvec(x):
+ x = diags_array([1, -2, 1], offsets=[-1, 0, 1], shape=(50, 50))
+ w, v = eigs(x, k=1)
+ return v / w[0]
+ A = LinearOperator(matvec=A_matvec, dtype=float, shape=(50, 50))
+
+ # The Fortran code is not reentrant, so this fails (gracefully, not crashing)
+ assert_raises(RuntimeError, eigs, A, k=1)
+ assert_raises(RuntimeError, eigsh, A, k=1)
+
+
+def test_regression_arpackng_1315():
+ # Check that issue arpack-ng/#1315 is not present.
+ # Adapted from arpack-ng/TESTS/bug_1315_single.c
+ # If this fails, then the installed ARPACK library is faulty.
+
+ for dtype in [np.float32, np.float64]:
+ np.random.seed(1234)
+
+ w0 = np.arange(1, 1000+1).astype(dtype)
+ A = diags_array([w0], offsets=[0], shape=(1000, 1000))
+
+ v0 = np.random.rand(1000).astype(dtype)
+ w, v = eigs(A, k=9, ncv=2*9+1, which="LM", v0=v0)
+
+ assert_allclose(np.sort(w), np.sort(w0[-9:]),
+ rtol=1e-4)
+
+
+def test_eigs_for_k_greater():
+ # Test eigs() for k beyond limits.
+ rng = np.random.RandomState(1234)
+ A_sparse = diags_array([1, -2, 1], offsets=[-1, 0, 1], shape=(4, 4)) # sparse
+ A = generate_matrix(4, sparse=False, rng=rng)
+ M_dense = rng.random((4, 4))
+ M_sparse = generate_matrix(4, sparse=True, rng=rng)
+ M_linop = aslinearoperator(M_dense)
+ eig_tuple1 = eig(A, b=M_dense)
+ eig_tuple2 = eig(A, b=M_sparse)
+
+ with suppress_warnings() as sup:
+ sup.filter(RuntimeWarning)
+
+ assert_equal(eigs(A, M=M_dense, k=3), eig_tuple1)
+ assert_equal(eigs(A, M=M_dense, k=4), eig_tuple1)
+ assert_equal(eigs(A, M=M_dense, k=5), eig_tuple1)
+ assert_equal(eigs(A, M=M_sparse, k=5), eig_tuple2)
+
+ # M as LinearOperator
+ assert_raises(TypeError, eigs, A, M=M_linop, k=3)
+
+ # Test 'A' for different types
+ assert_raises(TypeError, eigs, aslinearoperator(A), k=3)
+ assert_raises(TypeError, eigs, A_sparse, k=3)
+
+
+def test_eigsh_for_k_greater():
+ # Test eigsh() for k beyond limits.
+ rng = np.random.RandomState(1234)
+ A_sparse = diags_array([1, -2, 1], offsets=[-1, 0, 1], shape=(4, 4)) # sparse
+ A = generate_matrix(4, sparse=False, rng=rng)
+ M_dense = generate_matrix_symmetric(4, pos_definite=True, rng=rng)
+ M_sparse = generate_matrix_symmetric(
+ 4, pos_definite=True, sparse=True, rng=rng)
+ M_linop = aslinearoperator(M_dense)
+ eig_tuple1 = eigh(A, b=M_dense)
+ eig_tuple2 = eigh(A, b=M_sparse)
+
+ with suppress_warnings() as sup:
+ sup.filter(RuntimeWarning)
+
+ assert_equal(eigsh(A, M=M_dense, k=4), eig_tuple1)
+ assert_equal(eigsh(A, M=M_dense, k=5), eig_tuple1)
+ assert_equal(eigsh(A, M=M_sparse, k=5), eig_tuple2)
+
+ # M as LinearOperator
+ assert_raises(TypeError, eigsh, A, M=M_linop, k=4)
+
+ # Test 'A' for different types
+ assert_raises(TypeError, eigsh, aslinearoperator(A), k=4)
+ assert_raises(TypeError, eigsh, A_sparse, M=M_dense, k=4)
+
+
+def test_real_eigs_real_k_subset():
+ rng = np.random.default_rng(2)
+
+ n = 10
+ A = random_array(shape=(n, n), density=0.5, rng=rng)
+ A.data *= 2
+ A.data -= 1
+ A += A.T # make symmetric to test real eigenvalues
+
+ v0 = np.ones(n)
+
+ whichs = ['LM', 'SM', 'LR', 'SR', 'LI', 'SI']
+ dtypes = [np.float32, np.float64]
+
+ for which, sigma, dtype in itertools.product(whichs, [None, 0, 5], dtypes):
+ prev_w = np.array([], dtype=dtype)
+ eps = np.finfo(dtype).eps
+ for k in range(1, 9):
+ w, z = eigs(A.astype(dtype), k=k, which=which, sigma=sigma,
+ v0=v0.astype(dtype), tol=0)
+ assert_allclose(np.linalg.norm(A.dot(z) - z * w), 0, atol=np.sqrt(eps))
+
+ # Check that the set of eigenvalues for `k` is a subset of that for `k+1`
+ dist = abs(prev_w[:,None] - w).min(axis=1)
+ assert_allclose(dist, 0, atol=np.sqrt(eps))
+
+ prev_w = w
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..6ab5330361a6bcc2a8403f9b3788aedae750d57f
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__init__.py
@@ -0,0 +1,16 @@
+"""
+Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG)
+
+LOBPCG is a preconditioned eigensolver for large symmetric positive definite
+(SPD) generalized eigenproblems.
+
+Call the function lobpcg - see help for lobpcg.lobpcg.
+
+"""
+from .lobpcg import *
+
+__all__ = [s for s in dir() if not s.startswith('_')]
+
+from scipy._lib._testutils import PytestTester
+test = PytestTester(__name__)
+del PytestTester
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8f33ab27cb34c8c986b2ecf2d54361be138c4ae4
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__pycache__/lobpcg.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__pycache__/lobpcg.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..3c267ae171bd55557c04568cb53a2078dc04ab93
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/__pycache__/lobpcg.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py
new file mode 100644
index 0000000000000000000000000000000000000000..3bace8c76ccd11be7bb25f02806382a60ac5e9c7
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/lobpcg.py
@@ -0,0 +1,1110 @@
+"""
+Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG).
+
+References
+----------
+.. [1] A. V. Knyazev (2001),
+ Toward the Optimal Preconditioned Eigensolver: Locally Optimal
+ Block Preconditioned Conjugate Gradient Method.
+ SIAM Journal on Scientific Computing 23, no. 2,
+ pp. 517-541. :doi:`10.1137/S1064827500366124`
+
+.. [2] A. V. Knyazev, I. Lashuk, M. E. Argentati, and E. Ovchinnikov (2007),
+ Block Locally Optimal Preconditioned Eigenvalue Xolvers (BLOPEX)
+ in hypre and PETSc. :arxiv:`0705.2626`
+
+.. [3] A. V. Knyazev's C and MATLAB implementations:
+ https://github.com/lobpcg/blopex
+"""
+
+import warnings
+import numpy as np
+from scipy.linalg import (inv, eigh, cho_factor, cho_solve,
+ cholesky, LinAlgError)
+from scipy.sparse.linalg import LinearOperator
+from scipy.sparse import issparse
+
+__all__ = ["lobpcg"]
+
+
+def _report_nonhermitian(M, name):
+ """
+ Report if `M` is not a Hermitian matrix given its type.
+ """
+ from scipy.linalg import norm
+
+ md = M - M.T.conj()
+ nmd = norm(md, 1)
+ tol = 10 * np.finfo(M.dtype).eps
+ tol = max(tol, tol * norm(M, 1))
+ if nmd > tol:
+ warnings.warn(
+ f"Matrix {name} of the type {M.dtype} is not Hermitian: "
+ f"condition: {nmd} < {tol} fails.",
+ UserWarning, stacklevel=4
+ )
+
+def _as2d(ar):
+ """
+ If the input array is 2D return it, if it is 1D, append a dimension,
+ making it a column vector.
+ """
+ if ar.ndim == 2:
+ return ar
+ else: # Assume 1!
+ aux = np.asarray(ar)
+ aux.shape = (ar.shape[0], 1)
+ return aux
+
+
+def _makeMatMat(m):
+ if m is None:
+ return None
+ elif callable(m):
+ return lambda v: m(v)
+ else:
+ return lambda v: m @ v
+
+
+def _matmul_inplace(x, y, verbosityLevel=0):
+ """Perform 'np.matmul' in-place if possible.
+
+ If some sufficient conditions for inplace matmul are met, do so.
+ Otherwise try inplace update and fall back to overwrite if that fails.
+ """
+ if x.flags["CARRAY"] and x.shape[1] == y.shape[1] and x.dtype == y.dtype:
+ # conditions where we can guarantee that inplace updates will work;
+ # i.e. x is not a view/slice, x & y have compatible dtypes, and the
+ # shape of the result of x @ y matches the shape of x.
+ np.matmul(x, y, out=x)
+ else:
+ # ideally, we'd have an exhaustive list of conditions above when
+ # inplace updates are possible; since we don't, we opportunistically
+ # try if it works, and fall back to overwriting if necessary
+ try:
+ np.matmul(x, y, out=x)
+ except Exception:
+ if verbosityLevel:
+ warnings.warn(
+ "Inplace update of x = x @ y failed, "
+ "x needs to be overwritten.",
+ UserWarning, stacklevel=3
+ )
+ x = x @ y
+ return x
+
+
+def _applyConstraints(blockVectorV, factYBY, blockVectorBY, blockVectorY):
+ """Changes blockVectorV in-place."""
+ YBV = blockVectorBY.T.conj() @ blockVectorV
+ tmp = cho_solve(factYBY, YBV)
+ blockVectorV -= blockVectorY @ tmp
+
+
+def _b_orthonormalize(B, blockVectorV, blockVectorBV=None,
+ verbosityLevel=0):
+ """in-place B-orthonormalize the given block vector using Cholesky."""
+ if blockVectorBV is None:
+ if B is None:
+ blockVectorBV = blockVectorV
+ else:
+ try:
+ blockVectorBV = B(blockVectorV)
+ except Exception as e:
+ if verbosityLevel:
+ warnings.warn(
+ f"Secondary MatMul call failed with error\n"
+ f"{e}\n",
+ UserWarning, stacklevel=3
+ )
+ return None, None, None
+ if blockVectorBV.shape != blockVectorV.shape:
+ raise ValueError(
+ f"The shape {blockVectorV.shape} "
+ f"of the orthogonalized matrix not preserved\n"
+ f"and changed to {blockVectorBV.shape} "
+ f"after multiplying by the secondary matrix.\n"
+ )
+
+ VBV = blockVectorV.T.conj() @ blockVectorBV
+ try:
+ # VBV is a Cholesky factor from now on...
+ VBV = cholesky(VBV, overwrite_a=True)
+ VBV = inv(VBV, overwrite_a=True)
+ blockVectorV = _matmul_inplace(
+ blockVectorV, VBV,
+ verbosityLevel=verbosityLevel
+ )
+ if B is not None:
+ blockVectorBV = _matmul_inplace(
+ blockVectorBV, VBV,
+ verbosityLevel=verbosityLevel
+ )
+ return blockVectorV, blockVectorBV, VBV
+ except LinAlgError:
+ if verbosityLevel:
+ warnings.warn(
+ "Cholesky has failed.",
+ UserWarning, stacklevel=3
+ )
+ return None, None, None
+
+
+def _get_indx(_lambda, num, largest):
+ """Get `num` indices into `_lambda` depending on `largest` option."""
+ ii = np.argsort(_lambda)
+ if largest:
+ ii = ii[:-num - 1:-1]
+ else:
+ ii = ii[:num]
+
+ return ii
+
+
+def _handle_gramA_gramB_verbosity(gramA, gramB, verbosityLevel):
+ if verbosityLevel:
+ _report_nonhermitian(gramA, "gramA")
+ _report_nonhermitian(gramB, "gramB")
+
+
+def lobpcg(
+ A,
+ X,
+ B=None,
+ M=None,
+ Y=None,
+ tol=None,
+ maxiter=None,
+ largest=True,
+ verbosityLevel=0,
+ retLambdaHistory=False,
+ retResidualNormsHistory=False,
+ restartControl=20,
+):
+ """Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG).
+
+ LOBPCG is a preconditioned eigensolver for large real symmetric and complex
+ Hermitian definite generalized eigenproblems.
+
+ Parameters
+ ----------
+ A : {sparse matrix, ndarray, LinearOperator, callable object}
+ The Hermitian linear operator of the problem, usually given by a
+ sparse matrix. Often called the "stiffness matrix".
+ X : ndarray, float32 or float64
+ Initial approximation to the ``k`` eigenvectors (non-sparse).
+ If `A` has ``shape=(n,n)`` then `X` must have ``shape=(n,k)``.
+ B : {sparse matrix, ndarray, LinearOperator, callable object}
+ Optional. By default ``B = None``, which is equivalent to identity.
+ The right hand side operator in a generalized eigenproblem if present.
+ Often called the "mass matrix". Must be Hermitian positive definite.
+ M : {sparse matrix, ndarray, LinearOperator, callable object}
+ Optional. By default ``M = None``, which is equivalent to identity.
+ Preconditioner aiming to accelerate convergence.
+ Y : ndarray, float32 or float64, default: None
+ An ``n-by-sizeY`` ndarray of constraints with ``sizeY < n``.
+ The iterations will be performed in the ``B``-orthogonal complement
+ of the column-space of `Y`. `Y` must be full rank if present.
+ tol : scalar, optional
+ The default is ``tol=n*sqrt(eps)``.
+ Solver tolerance for the stopping criterion.
+ maxiter : int, default: 20
+ Maximum number of iterations.
+ largest : bool, default: True
+ When True, solve for the largest eigenvalues, otherwise the smallest.
+ verbosityLevel : int, optional
+ By default ``verbosityLevel=0`` no output.
+ Controls the solver standard/screen output.
+ retLambdaHistory : bool, default: False
+ Whether to return iterative eigenvalue history.
+ retResidualNormsHistory : bool, default: False
+ Whether to return iterative history of residual norms.
+ restartControl : int, optional.
+ Iterations restart if the residuals jump ``2**restartControl`` times
+ compared to the smallest recorded in ``retResidualNormsHistory``.
+ The default is ``restartControl=20``, making the restarts rare for
+ backward compatibility.
+
+ Returns
+ -------
+ lambda : ndarray of the shape ``(k, )``.
+ Array of ``k`` approximate eigenvalues.
+ v : ndarray of the same shape as ``X.shape``.
+ An array of ``k`` approximate eigenvectors.
+ lambdaHistory : ndarray, optional.
+ The eigenvalue history, if `retLambdaHistory` is ``True``.
+ ResidualNormsHistory : ndarray, optional.
+ The history of residual norms, if `retResidualNormsHistory`
+ is ``True``.
+
+ Notes
+ -----
+ The iterative loop runs ``maxit=maxiter`` (20 if ``maxit=None``)
+ iterations at most and finishes earlier if the tolerance is met.
+ Breaking backward compatibility with the previous version, LOBPCG
+ now returns the block of iterative vectors with the best accuracy rather
+ than the last one iterated, as a cure for possible divergence.
+
+ If ``X.dtype == np.float32`` and user-provided operations/multiplications
+ by `A`, `B`, and `M` all preserve the ``np.float32`` data type,
+ all the calculations and the output are in ``np.float32``.
+
+ The size of the iteration history output equals to the number of the best
+ (limited by `maxit`) iterations plus 3: initial, final, and postprocessing.
+
+ If both `retLambdaHistory` and `retResidualNormsHistory` are ``True``,
+ the return tuple has the following format
+ ``(lambda, V, lambda history, residual norms history)``.
+
+ In the following ``n`` denotes the matrix size and ``k`` the number
+ of required eigenvalues (smallest or largest).
+
+ The LOBPCG code internally solves eigenproblems of the size ``3k`` on every
+ iteration by calling the dense eigensolver `eigh`, so if ``k`` is not
+ small enough compared to ``n``, it makes no sense to call the LOBPCG code.
+ Moreover, if one calls the LOBPCG algorithm for ``5k > n``, it would likely
+ break internally, so the code calls the standard function `eigh` instead.
+ It is not that ``n`` should be large for the LOBPCG to work, but rather the
+ ratio ``n / k`` should be large. It you call LOBPCG with ``k=1``
+ and ``n=10``, it works though ``n`` is small. The method is intended
+ for extremely large ``n / k``.
+
+ The convergence speed depends basically on three factors:
+
+ 1. Quality of the initial approximations `X` to the seeking eigenvectors.
+ Randomly distributed around the origin vectors work well if no better
+ choice is known.
+
+ 2. Relative separation of the desired eigenvalues from the rest
+ of the eigenvalues. One can vary ``k`` to improve the separation.
+
+ 3. Proper preconditioning to shrink the spectral spread.
+ For example, a rod vibration test problem (under tests
+ directory) is ill-conditioned for large ``n``, so convergence will be
+ slow, unless efficient preconditioning is used. For this specific
+ problem, a good simple preconditioner function would be a linear solve
+ for `A`, which is easy to code since `A` is tridiagonal.
+
+ References
+ ----------
+ .. [1] A. V. Knyazev (2001),
+ Toward the Optimal Preconditioned Eigensolver: Locally Optimal
+ Block Preconditioned Conjugate Gradient Method.
+ SIAM Journal on Scientific Computing 23, no. 2,
+ pp. 517-541. :doi:`10.1137/S1064827500366124`
+
+ .. [2] A. V. Knyazev, I. Lashuk, M. E. Argentati, and E. Ovchinnikov
+ (2007), Block Locally Optimal Preconditioned Eigenvalue Xolvers
+ (BLOPEX) in hypre and PETSc. :arxiv:`0705.2626`
+
+ .. [3] A. V. Knyazev's C and MATLAB implementations:
+ https://github.com/lobpcg/blopex
+
+ Examples
+ --------
+ Our first example is minimalistic - find the largest eigenvalue of
+ a diagonal matrix by solving the non-generalized eigenvalue problem
+ ``A x = lambda x`` without constraints or preconditioning.
+
+ >>> import numpy as np
+ >>> from scipy.sparse import spdiags
+ >>> from scipy.sparse.linalg import LinearOperator, aslinearoperator
+ >>> from scipy.sparse.linalg import lobpcg
+
+ The square matrix size is
+
+ >>> n = 100
+
+ and its diagonal entries are 1, ..., 100 defined by
+
+ >>> vals = np.arange(1, n + 1).astype(np.int16)
+
+ The first mandatory input parameter in this test is
+ the sparse diagonal matrix `A`
+ of the eigenvalue problem ``A x = lambda x`` to solve.
+
+ >>> A = spdiags(vals, 0, n, n)
+ >>> A = A.astype(np.int16)
+ >>> A.toarray()
+ array([[ 1, 0, 0, ..., 0, 0, 0],
+ [ 0, 2, 0, ..., 0, 0, 0],
+ [ 0, 0, 3, ..., 0, 0, 0],
+ ...,
+ [ 0, 0, 0, ..., 98, 0, 0],
+ [ 0, 0, 0, ..., 0, 99, 0],
+ [ 0, 0, 0, ..., 0, 0, 100]], shape=(100, 100), dtype=int16)
+
+ The second mandatory input parameter `X` is a 2D array with the
+ row dimension determining the number of requested eigenvalues.
+ `X` is an initial guess for targeted eigenvectors.
+ `X` must have linearly independent columns.
+ If no initial approximations available, randomly oriented vectors
+ commonly work best, e.g., with components normally distributed
+ around zero or uniformly distributed on the interval [-1 1].
+ Setting the initial approximations to dtype ``np.float32``
+ forces all iterative values to dtype ``np.float32`` speeding up
+ the run while still allowing accurate eigenvalue computations.
+
+ >>> k = 1
+ >>> rng = np.random.default_rng()
+ >>> X = rng.normal(size=(n, k))
+ >>> X = X.astype(np.float32)
+
+ >>> eigenvalues, _ = lobpcg(A, X, maxiter=60)
+ >>> eigenvalues
+ array([100.], dtype=float32)
+
+ `lobpcg` needs only access the matrix product with `A` rather
+ then the matrix itself. Since the matrix `A` is diagonal in
+ this example, one can write a function of the matrix product
+ ``A @ X`` using the diagonal values ``vals`` only, e.g., by
+ element-wise multiplication with broadcasting in the lambda-function
+
+ >>> A_lambda = lambda X: vals[:, np.newaxis] * X
+
+ or the regular function
+
+ >>> def A_matmat(X):
+ ... return vals[:, np.newaxis] * X
+
+ and use the handle to one of these callables as an input
+
+ >>> eigenvalues, _ = lobpcg(A_lambda, X, maxiter=60)
+ >>> eigenvalues
+ array([100.], dtype=float32)
+ >>> eigenvalues, _ = lobpcg(A_matmat, X, maxiter=60)
+ >>> eigenvalues
+ array([100.], dtype=float32)
+
+ The traditional callable `LinearOperator` is no longer
+ necessary but still supported as the input to `lobpcg`.
+ Specifying ``matmat=A_matmat`` explicitly improves performance.
+
+ >>> A_lo = LinearOperator((n, n), matvec=A_matmat, matmat=A_matmat, dtype=np.int16)
+ >>> eigenvalues, _ = lobpcg(A_lo, X, maxiter=80)
+ >>> eigenvalues
+ array([100.], dtype=float32)
+
+ The least efficient callable option is `aslinearoperator`:
+
+ >>> eigenvalues, _ = lobpcg(aslinearoperator(A), X, maxiter=80)
+ >>> eigenvalues
+ array([100.], dtype=float32)
+
+ We now switch to computing the three smallest eigenvalues specifying
+
+ >>> k = 3
+ >>> X = np.random.default_rng().normal(size=(n, k))
+
+ and ``largest=False`` parameter
+
+ >>> eigenvalues, _ = lobpcg(A, X, largest=False, maxiter=90)
+ >>> print(eigenvalues)
+ [1. 2. 3.]
+
+ The next example illustrates computing 3 smallest eigenvalues of
+ the same matrix `A` given by the function handle ``A_matmat`` but
+ with constraints and preconditioning.
+
+ Constraints - an optional input parameter is a 2D array comprising
+ of column vectors that the eigenvectors must be orthogonal to
+
+ >>> Y = np.eye(n, 3)
+
+ The preconditioner acts as the inverse of `A` in this example, but
+ in the reduced precision ``np.float32`` even though the initial `X`
+ and thus all iterates and the output are in full ``np.float64``.
+
+ >>> inv_vals = 1./vals
+ >>> inv_vals = inv_vals.astype(np.float32)
+ >>> M = lambda X: inv_vals[:, np.newaxis] * X
+
+ Let us now solve the eigenvalue problem for the matrix `A` first
+ without preconditioning requesting 80 iterations
+
+ >>> eigenvalues, _ = lobpcg(A_matmat, X, Y=Y, largest=False, maxiter=80)
+ >>> eigenvalues
+ array([4., 5., 6.])
+ >>> eigenvalues.dtype
+ dtype('float64')
+
+ With preconditioning we need only 20 iterations from the same `X`
+
+ >>> eigenvalues, _ = lobpcg(A_matmat, X, Y=Y, M=M, largest=False, maxiter=20)
+ >>> eigenvalues
+ array([4., 5., 6.])
+
+ Note that the vectors passed in `Y` are the eigenvectors of the 3
+ smallest eigenvalues. The results returned above are orthogonal to those.
+
+ The primary matrix `A` may be indefinite, e.g., after shifting
+ ``vals`` by 50 from 1, ..., 100 to -49, ..., 50, we still can compute
+ the 3 smallest or largest eigenvalues.
+
+ >>> vals = vals - 50
+ >>> X = rng.normal(size=(n, k))
+ >>> eigenvalues, _ = lobpcg(A_matmat, X, largest=False, maxiter=99)
+ >>> eigenvalues
+ array([-49., -48., -47.])
+ >>> eigenvalues, _ = lobpcg(A_matmat, X, largest=True, maxiter=99)
+ >>> eigenvalues
+ array([50., 49., 48.])
+
+ """
+ blockVectorX = X
+ bestblockVectorX = blockVectorX
+ blockVectorY = Y
+ residualTolerance = tol
+ if maxiter is None:
+ maxiter = 20
+
+ bestIterationNumber = maxiter
+
+ sizeY = 0
+ if blockVectorY is not None:
+ if len(blockVectorY.shape) != 2:
+ warnings.warn(
+ f"Expected rank-2 array for argument Y, instead got "
+ f"{len(blockVectorY.shape)}, "
+ f"so ignore it and use no constraints.",
+ UserWarning, stacklevel=2
+ )
+ blockVectorY = None
+ else:
+ sizeY = blockVectorY.shape[1]
+
+ # Block size.
+ if blockVectorX is None:
+ raise ValueError("The mandatory initial matrix X cannot be None")
+ if len(blockVectorX.shape) != 2:
+ raise ValueError("expected rank-2 array for argument X")
+
+ n, sizeX = blockVectorX.shape
+
+ # Data type of iterates, determined by X, must be inexact
+ if not np.issubdtype(blockVectorX.dtype, np.inexact):
+ warnings.warn(
+ f"Data type for argument X is {blockVectorX.dtype}, "
+ f"which is not inexact, so casted to np.float32.",
+ UserWarning, stacklevel=2
+ )
+ blockVectorX = np.asarray(blockVectorX, dtype=np.float32)
+
+ if retLambdaHistory:
+ lambdaHistory = np.zeros((maxiter + 3, sizeX),
+ dtype=blockVectorX.dtype)
+ if retResidualNormsHistory:
+ residualNormsHistory = np.zeros((maxiter + 3, sizeX),
+ dtype=blockVectorX.dtype)
+
+ if verbosityLevel:
+ aux = "Solving "
+ if B is None:
+ aux += "standard"
+ else:
+ aux += "generalized"
+ aux += " eigenvalue problem with"
+ if M is None:
+ aux += "out"
+ aux += " preconditioning\n\n"
+ aux += "matrix size %d\n" % n
+ aux += "block size %d\n\n" % sizeX
+ if blockVectorY is None:
+ aux += "No constraints\n\n"
+ else:
+ if sizeY > 1:
+ aux += "%d constraints\n\n" % sizeY
+ else:
+ aux += "%d constraint\n\n" % sizeY
+ print(aux)
+
+ if (n - sizeY) < (5 * sizeX):
+ warnings.warn(
+ f"The problem size {n} minus the constraints size {sizeY} "
+ f"is too small relative to the block size {sizeX}. "
+ f"Using a dense eigensolver instead of LOBPCG iterations."
+ f"No output of the history of the iterations.",
+ UserWarning, stacklevel=2
+ )
+
+ sizeX = min(sizeX, n)
+
+ if blockVectorY is not None:
+ raise NotImplementedError(
+ "The dense eigensolver does not support constraints."
+ )
+
+ # Define the closed range of indices of eigenvalues to return.
+ if largest:
+ eigvals = (n - sizeX, n - 1)
+ else:
+ eigvals = (0, sizeX - 1)
+
+ try:
+ if isinstance(A, LinearOperator):
+ A = A(np.eye(n, dtype=int))
+ elif callable(A):
+ A = A(np.eye(n, dtype=int))
+ if A.shape != (n, n):
+ raise ValueError(
+ f"The shape {A.shape} of the primary matrix\n"
+ f"defined by a callable object is wrong.\n"
+ )
+ elif issparse(A):
+ A = A.toarray()
+ else:
+ A = np.asarray(A)
+ except Exception as e:
+ raise Exception(
+ f"Primary MatMul call failed with error\n"
+ f"{e}\n")
+
+ if B is not None:
+ try:
+ if isinstance(B, LinearOperator):
+ B = B(np.eye(n, dtype=int))
+ elif callable(B):
+ B = B(np.eye(n, dtype=int))
+ if B.shape != (n, n):
+ raise ValueError(
+ f"The shape {B.shape} of the secondary matrix\n"
+ f"defined by a callable object is wrong.\n"
+ )
+ elif issparse(B):
+ B = B.toarray()
+ else:
+ B = np.asarray(B)
+ except Exception as e:
+ raise Exception(
+ f"Secondary MatMul call failed with error\n"
+ f"{e}\n")
+
+ try:
+ vals, vecs = eigh(A,
+ B,
+ subset_by_index=eigvals,
+ check_finite=False)
+ if largest:
+ # Reverse order to be compatible with eigs() in 'LM' mode.
+ vals = vals[::-1]
+ vecs = vecs[:, ::-1]
+
+ return vals, vecs
+ except Exception as e:
+ raise Exception(
+ f"Dense eigensolver failed with error\n"
+ f"{e}\n"
+ )
+
+ if (residualTolerance is None) or (residualTolerance <= 0.0):
+ residualTolerance = np.sqrt(np.finfo(blockVectorX.dtype).eps) * n
+
+ A = _makeMatMat(A)
+ B = _makeMatMat(B)
+ M = _makeMatMat(M)
+
+ # Apply constraints to X.
+ if blockVectorY is not None:
+
+ if B is not None:
+ blockVectorBY = B(blockVectorY)
+ if blockVectorBY.shape != blockVectorY.shape:
+ raise ValueError(
+ f"The shape {blockVectorY.shape} "
+ f"of the constraint not preserved\n"
+ f"and changed to {blockVectorBY.shape} "
+ f"after multiplying by the secondary matrix.\n"
+ )
+ else:
+ blockVectorBY = blockVectorY
+
+ # gramYBY is a dense array.
+ gramYBY = blockVectorY.T.conj() @ blockVectorBY
+ try:
+ # gramYBY is a Cholesky factor from now on...
+ gramYBY = cho_factor(gramYBY, overwrite_a=True)
+ except LinAlgError as e:
+ raise ValueError("Linearly dependent constraints") from e
+
+ _applyConstraints(blockVectorX, gramYBY, blockVectorBY, blockVectorY)
+
+ ##
+ # B-orthonormalize X.
+ blockVectorX, blockVectorBX, _ = _b_orthonormalize(
+ B, blockVectorX, verbosityLevel=verbosityLevel)
+ if blockVectorX is None:
+ raise ValueError("Linearly dependent initial approximations")
+
+ ##
+ # Compute the initial Ritz vectors: solve the eigenproblem.
+ blockVectorAX = A(blockVectorX)
+ if blockVectorAX.shape != blockVectorX.shape:
+ raise ValueError(
+ f"The shape {blockVectorX.shape} "
+ f"of the initial approximations not preserved\n"
+ f"and changed to {blockVectorAX.shape} "
+ f"after multiplying by the primary matrix.\n"
+ )
+
+ gramXAX = blockVectorX.T.conj() @ blockVectorAX
+
+ _lambda, eigBlockVector = eigh(gramXAX, check_finite=False)
+ ii = _get_indx(_lambda, sizeX, largest)
+ _lambda = _lambda[ii]
+ if retLambdaHistory:
+ lambdaHistory[0, :] = _lambda
+
+ eigBlockVector = np.asarray(eigBlockVector[:, ii])
+ blockVectorX = _matmul_inplace(
+ blockVectorX, eigBlockVector,
+ verbosityLevel=verbosityLevel
+ )
+ blockVectorAX = _matmul_inplace(
+ blockVectorAX, eigBlockVector,
+ verbosityLevel=verbosityLevel
+ )
+ if B is not None:
+ blockVectorBX = _matmul_inplace(
+ blockVectorBX, eigBlockVector,
+ verbosityLevel=verbosityLevel
+ )
+
+ ##
+ # Active index set.
+ activeMask = np.ones((sizeX,), dtype=bool)
+
+ ##
+ # Main iteration loop.
+
+ blockVectorP = None # set during iteration
+ blockVectorAP = None
+ blockVectorBP = None
+
+ smallestResidualNorm = np.abs(np.finfo(blockVectorX.dtype).max)
+
+ iterationNumber = -1
+ restart = True
+ forcedRestart = False
+ explicitGramFlag = False
+ while iterationNumber < maxiter:
+ iterationNumber += 1
+
+ if B is not None:
+ aux = blockVectorBX * _lambda[np.newaxis, :]
+ else:
+ aux = blockVectorX * _lambda[np.newaxis, :]
+
+ blockVectorR = blockVectorAX - aux
+
+ aux = np.sum(blockVectorR.conj() * blockVectorR, 0)
+ residualNorms = np.sqrt(np.abs(aux))
+ if retResidualNormsHistory:
+ residualNormsHistory[iterationNumber, :] = residualNorms
+ residualNorm = np.sum(np.abs(residualNorms)) / sizeX
+
+ if residualNorm < smallestResidualNorm:
+ smallestResidualNorm = residualNorm
+ bestIterationNumber = iterationNumber
+ bestblockVectorX = blockVectorX
+ elif residualNorm > 2**restartControl * smallestResidualNorm:
+ forcedRestart = True
+ blockVectorAX = A(blockVectorX)
+ if blockVectorAX.shape != blockVectorX.shape:
+ raise ValueError(
+ f"The shape {blockVectorX.shape} "
+ f"of the restarted iterate not preserved\n"
+ f"and changed to {blockVectorAX.shape} "
+ f"after multiplying by the primary matrix.\n"
+ )
+ if B is not None:
+ blockVectorBX = B(blockVectorX)
+ if blockVectorBX.shape != blockVectorX.shape:
+ raise ValueError(
+ f"The shape {blockVectorX.shape} "
+ f"of the restarted iterate not preserved\n"
+ f"and changed to {blockVectorBX.shape} "
+ f"after multiplying by the secondary matrix.\n"
+ )
+
+ ii = np.where(residualNorms > residualTolerance, True, False)
+ activeMask = activeMask & ii
+ currentBlockSize = activeMask.sum()
+
+ if verbosityLevel:
+ print(f"iteration {iterationNumber}")
+ print(f"current block size: {currentBlockSize}")
+ print(f"eigenvalue(s):\n{_lambda}")
+ print(f"residual norm(s):\n{residualNorms}")
+
+ if currentBlockSize == 0:
+ break
+
+ activeBlockVectorR = _as2d(blockVectorR[:, activeMask])
+
+ if iterationNumber > 0:
+ activeBlockVectorP = _as2d(blockVectorP[:, activeMask])
+ activeBlockVectorAP = _as2d(blockVectorAP[:, activeMask])
+ if B is not None:
+ activeBlockVectorBP = _as2d(blockVectorBP[:, activeMask])
+
+ if M is not None:
+ # Apply preconditioner T to the active residuals.
+ activeBlockVectorR = M(activeBlockVectorR)
+
+ ##
+ # Apply constraints to the preconditioned residuals.
+ if blockVectorY is not None:
+ _applyConstraints(activeBlockVectorR,
+ gramYBY,
+ blockVectorBY,
+ blockVectorY)
+
+ ##
+ # B-orthogonalize the preconditioned residuals to X.
+ if B is not None:
+ activeBlockVectorR = activeBlockVectorR - (
+ blockVectorX @
+ (blockVectorBX.T.conj() @ activeBlockVectorR)
+ )
+ else:
+ activeBlockVectorR = activeBlockVectorR - (
+ blockVectorX @
+ (blockVectorX.T.conj() @ activeBlockVectorR)
+ )
+
+ ##
+ # B-orthonormalize the preconditioned residuals.
+ aux = _b_orthonormalize(
+ B, activeBlockVectorR, verbosityLevel=verbosityLevel)
+ activeBlockVectorR, activeBlockVectorBR, _ = aux
+
+ if activeBlockVectorR is None:
+ warnings.warn(
+ f"Failed at iteration {iterationNumber} with accuracies "
+ f"{residualNorms}\n not reaching the requested "
+ f"tolerance {residualTolerance}.",
+ UserWarning, stacklevel=2
+ )
+ break
+ activeBlockVectorAR = A(activeBlockVectorR)
+
+ if iterationNumber > 0:
+ if B is not None:
+ aux = _b_orthonormalize(
+ B, activeBlockVectorP, activeBlockVectorBP,
+ verbosityLevel=verbosityLevel
+ )
+ activeBlockVectorP, activeBlockVectorBP, invR = aux
+ else:
+ aux = _b_orthonormalize(B, activeBlockVectorP,
+ verbosityLevel=verbosityLevel)
+ activeBlockVectorP, _, invR = aux
+ # Function _b_orthonormalize returns None if Cholesky fails
+ if activeBlockVectorP is not None:
+ activeBlockVectorAP = _matmul_inplace(
+ activeBlockVectorAP, invR,
+ verbosityLevel=verbosityLevel
+ )
+ restart = forcedRestart
+ else:
+ restart = True
+
+ ##
+ # Perform the Rayleigh Ritz Procedure:
+ # Compute symmetric Gram matrices:
+
+ if activeBlockVectorAR.dtype == "float32":
+ myeps = 1
+ else:
+ myeps = np.sqrt(np.finfo(activeBlockVectorR.dtype).eps)
+
+ if residualNorms.max() > myeps and not explicitGramFlag:
+ explicitGramFlag = False
+ else:
+ # Once explicitGramFlag, forever explicitGramFlag.
+ explicitGramFlag = True
+
+ # Shared memory assignments to simplify the code
+ if B is None:
+ blockVectorBX = blockVectorX
+ activeBlockVectorBR = activeBlockVectorR
+ if not restart:
+ activeBlockVectorBP = activeBlockVectorP
+
+ # Common submatrices:
+ gramXAR = np.dot(blockVectorX.T.conj(), activeBlockVectorAR)
+ gramRAR = np.dot(activeBlockVectorR.T.conj(), activeBlockVectorAR)
+
+ gramDtype = activeBlockVectorAR.dtype
+ if explicitGramFlag:
+ gramRAR = (gramRAR + gramRAR.T.conj()) / 2
+ gramXAX = np.dot(blockVectorX.T.conj(), blockVectorAX)
+ gramXAX = (gramXAX + gramXAX.T.conj()) / 2
+ gramXBX = np.dot(blockVectorX.T.conj(), blockVectorBX)
+ gramRBR = np.dot(activeBlockVectorR.T.conj(), activeBlockVectorBR)
+ gramXBR = np.dot(blockVectorX.T.conj(), activeBlockVectorBR)
+ else:
+ gramXAX = np.diag(_lambda).astype(gramDtype)
+ gramXBX = np.eye(sizeX, dtype=gramDtype)
+ gramRBR = np.eye(currentBlockSize, dtype=gramDtype)
+ gramXBR = np.zeros((sizeX, currentBlockSize), dtype=gramDtype)
+
+ if not restart:
+ gramXAP = np.dot(blockVectorX.T.conj(), activeBlockVectorAP)
+ gramRAP = np.dot(activeBlockVectorR.T.conj(), activeBlockVectorAP)
+ gramPAP = np.dot(activeBlockVectorP.T.conj(), activeBlockVectorAP)
+ gramXBP = np.dot(blockVectorX.T.conj(), activeBlockVectorBP)
+ gramRBP = np.dot(activeBlockVectorR.T.conj(), activeBlockVectorBP)
+ if explicitGramFlag:
+ gramPAP = (gramPAP + gramPAP.T.conj()) / 2
+ gramPBP = np.dot(activeBlockVectorP.T.conj(),
+ activeBlockVectorBP)
+ else:
+ gramPBP = np.eye(currentBlockSize, dtype=gramDtype)
+
+ gramA = np.block(
+ [
+ [gramXAX, gramXAR, gramXAP],
+ [gramXAR.T.conj(), gramRAR, gramRAP],
+ [gramXAP.T.conj(), gramRAP.T.conj(), gramPAP],
+ ]
+ )
+ gramB = np.block(
+ [
+ [gramXBX, gramXBR, gramXBP],
+ [gramXBR.T.conj(), gramRBR, gramRBP],
+ [gramXBP.T.conj(), gramRBP.T.conj(), gramPBP],
+ ]
+ )
+
+ _handle_gramA_gramB_verbosity(gramA, gramB, verbosityLevel)
+
+ try:
+ _lambda, eigBlockVector = eigh(gramA,
+ gramB,
+ check_finite=False)
+ except LinAlgError as e:
+ # raise ValueError("eigh failed in lobpcg iterations") from e
+ if verbosityLevel:
+ warnings.warn(
+ f"eigh failed at iteration {iterationNumber} \n"
+ f"with error {e} causing a restart.\n",
+ UserWarning, stacklevel=2
+ )
+ # try again after dropping the direction vectors P from RR
+ restart = True
+
+ if restart:
+ gramA = np.block([[gramXAX, gramXAR], [gramXAR.T.conj(), gramRAR]])
+ gramB = np.block([[gramXBX, gramXBR], [gramXBR.T.conj(), gramRBR]])
+
+ _handle_gramA_gramB_verbosity(gramA, gramB, verbosityLevel)
+
+ try:
+ _lambda, eigBlockVector = eigh(gramA,
+ gramB,
+ check_finite=False)
+ except LinAlgError as e:
+ # raise ValueError("eigh failed in lobpcg iterations") from e
+ warnings.warn(
+ f"eigh failed at iteration {iterationNumber} with error\n"
+ f"{e}\n",
+ UserWarning, stacklevel=2
+ )
+ break
+
+ ii = _get_indx(_lambda, sizeX, largest)
+ _lambda = _lambda[ii]
+ eigBlockVector = eigBlockVector[:, ii]
+ if retLambdaHistory:
+ lambdaHistory[iterationNumber + 1, :] = _lambda
+
+ # Compute Ritz vectors.
+ if B is not None:
+ if not restart:
+ eigBlockVectorX = eigBlockVector[:sizeX]
+ eigBlockVectorR = eigBlockVector[sizeX:
+ sizeX + currentBlockSize]
+ eigBlockVectorP = eigBlockVector[sizeX + currentBlockSize:]
+
+ pp = np.dot(activeBlockVectorR, eigBlockVectorR)
+ pp += np.dot(activeBlockVectorP, eigBlockVectorP)
+
+ app = np.dot(activeBlockVectorAR, eigBlockVectorR)
+ app += np.dot(activeBlockVectorAP, eigBlockVectorP)
+
+ bpp = np.dot(activeBlockVectorBR, eigBlockVectorR)
+ bpp += np.dot(activeBlockVectorBP, eigBlockVectorP)
+ else:
+ eigBlockVectorX = eigBlockVector[:sizeX]
+ eigBlockVectorR = eigBlockVector[sizeX:]
+
+ pp = np.dot(activeBlockVectorR, eigBlockVectorR)
+ app = np.dot(activeBlockVectorAR, eigBlockVectorR)
+ bpp = np.dot(activeBlockVectorBR, eigBlockVectorR)
+
+ blockVectorX = np.dot(blockVectorX, eigBlockVectorX) + pp
+ blockVectorAX = np.dot(blockVectorAX, eigBlockVectorX) + app
+ blockVectorBX = np.dot(blockVectorBX, eigBlockVectorX) + bpp
+
+ blockVectorP, blockVectorAP, blockVectorBP = pp, app, bpp
+
+ else:
+ if not restart:
+ eigBlockVectorX = eigBlockVector[:sizeX]
+ eigBlockVectorR = eigBlockVector[sizeX:
+ sizeX + currentBlockSize]
+ eigBlockVectorP = eigBlockVector[sizeX + currentBlockSize:]
+
+ pp = np.dot(activeBlockVectorR, eigBlockVectorR)
+ pp += np.dot(activeBlockVectorP, eigBlockVectorP)
+
+ app = np.dot(activeBlockVectorAR, eigBlockVectorR)
+ app += np.dot(activeBlockVectorAP, eigBlockVectorP)
+ else:
+ eigBlockVectorX = eigBlockVector[:sizeX]
+ eigBlockVectorR = eigBlockVector[sizeX:]
+
+ pp = np.dot(activeBlockVectorR, eigBlockVectorR)
+ app = np.dot(activeBlockVectorAR, eigBlockVectorR)
+
+ blockVectorX = np.dot(blockVectorX, eigBlockVectorX) + pp
+ blockVectorAX = np.dot(blockVectorAX, eigBlockVectorX) + app
+
+ blockVectorP, blockVectorAP = pp, app
+
+ if B is not None:
+ aux = blockVectorBX * _lambda[np.newaxis, :]
+ else:
+ aux = blockVectorX * _lambda[np.newaxis, :]
+
+ blockVectorR = blockVectorAX - aux
+
+ aux = np.sum(blockVectorR.conj() * blockVectorR, 0)
+ residualNorms = np.sqrt(np.abs(aux))
+ # Use old lambda in case of early loop exit.
+ if retLambdaHistory:
+ lambdaHistory[iterationNumber + 1, :] = _lambda
+ if retResidualNormsHistory:
+ residualNormsHistory[iterationNumber + 1, :] = residualNorms
+ residualNorm = np.sum(np.abs(residualNorms)) / sizeX
+ if residualNorm < smallestResidualNorm:
+ smallestResidualNorm = residualNorm
+ bestIterationNumber = iterationNumber + 1
+ bestblockVectorX = blockVectorX
+
+ if np.max(np.abs(residualNorms)) > residualTolerance:
+ warnings.warn(
+ f"Exited at iteration {iterationNumber} with accuracies \n"
+ f"{residualNorms}\n"
+ f"not reaching the requested tolerance {residualTolerance}.\n"
+ f"Use iteration {bestIterationNumber} instead with accuracy \n"
+ f"{smallestResidualNorm}.\n",
+ UserWarning, stacklevel=2
+ )
+
+ if verbosityLevel:
+ print(f"Final iterative eigenvalue(s):\n{_lambda}")
+ print(f"Final iterative residual norm(s):\n{residualNorms}")
+
+ blockVectorX = bestblockVectorX
+ # Making eigenvectors "exactly" satisfy the blockVectorY constrains
+ if blockVectorY is not None:
+ _applyConstraints(blockVectorX,
+ gramYBY,
+ blockVectorBY,
+ blockVectorY)
+
+ # Making eigenvectors "exactly" othonormalized by final "exact" RR
+ blockVectorAX = A(blockVectorX)
+ if blockVectorAX.shape != blockVectorX.shape:
+ raise ValueError(
+ f"The shape {blockVectorX.shape} "
+ f"of the postprocessing iterate not preserved\n"
+ f"and changed to {blockVectorAX.shape} "
+ f"after multiplying by the primary matrix.\n"
+ )
+ gramXAX = np.dot(blockVectorX.T.conj(), blockVectorAX)
+
+ blockVectorBX = blockVectorX
+ if B is not None:
+ blockVectorBX = B(blockVectorX)
+ if blockVectorBX.shape != blockVectorX.shape:
+ raise ValueError(
+ f"The shape {blockVectorX.shape} "
+ f"of the postprocessing iterate not preserved\n"
+ f"and changed to {blockVectorBX.shape} "
+ f"after multiplying by the secondary matrix.\n"
+ )
+
+ gramXBX = np.dot(blockVectorX.T.conj(), blockVectorBX)
+ _handle_gramA_gramB_verbosity(gramXAX, gramXBX, verbosityLevel)
+ gramXAX = (gramXAX + gramXAX.T.conj()) / 2
+ gramXBX = (gramXBX + gramXBX.T.conj()) / 2
+ try:
+ _lambda, eigBlockVector = eigh(gramXAX,
+ gramXBX,
+ check_finite=False)
+ except LinAlgError as e:
+ raise ValueError("eigh has failed in lobpcg postprocessing") from e
+
+ ii = _get_indx(_lambda, sizeX, largest)
+ _lambda = _lambda[ii]
+ eigBlockVector = np.asarray(eigBlockVector[:, ii])
+
+ blockVectorX = np.dot(blockVectorX, eigBlockVector)
+ blockVectorAX = np.dot(blockVectorAX, eigBlockVector)
+
+ if B is not None:
+ blockVectorBX = np.dot(blockVectorBX, eigBlockVector)
+ aux = blockVectorBX * _lambda[np.newaxis, :]
+ else:
+ aux = blockVectorX * _lambda[np.newaxis, :]
+
+ blockVectorR = blockVectorAX - aux
+
+ aux = np.sum(blockVectorR.conj() * blockVectorR, 0)
+ residualNorms = np.sqrt(np.abs(aux))
+
+ if retLambdaHistory:
+ lambdaHistory[bestIterationNumber + 1, :] = _lambda
+ if retResidualNormsHistory:
+ residualNormsHistory[bestIterationNumber + 1, :] = residualNorms
+
+ if retLambdaHistory:
+ lambdaHistory = lambdaHistory[
+ : bestIterationNumber + 2, :]
+ if retResidualNormsHistory:
+ residualNormsHistory = residualNormsHistory[
+ : bestIterationNumber + 2, :]
+
+ if np.max(np.abs(residualNorms)) > residualTolerance:
+ warnings.warn(
+ f"Exited postprocessing with accuracies \n"
+ f"{residualNorms}\n"
+ f"not reaching the requested tolerance {residualTolerance}.",
+ UserWarning, stacklevel=2
+ )
+
+ if verbosityLevel:
+ print(f"Final postprocessing eigenvalue(s):\n{_lambda}")
+ print(f"Final residual norm(s):\n{residualNorms}")
+
+ if retLambdaHistory:
+ lambdaHistory = np.vsplit(lambdaHistory, np.shape(lambdaHistory)[0])
+ lambdaHistory = [np.squeeze(i) for i in lambdaHistory]
+ if retResidualNormsHistory:
+ residualNormsHistory = np.vsplit(residualNormsHistory,
+ np.shape(residualNormsHistory)[0])
+ residualNormsHistory = [np.squeeze(i) for i in residualNormsHistory]
+
+ if retLambdaHistory:
+ if retResidualNormsHistory:
+ return _lambda, blockVectorX, lambdaHistory, residualNormsHistory
+ else:
+ return _lambda, blockVectorX, lambdaHistory
+ else:
+ if retResidualNormsHistory:
+ return _lambda, blockVectorX, residualNormsHistory
+ else:
+ return _lambda, blockVectorX
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/tests/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/tests/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py
new file mode 100644
index 0000000000000000000000000000000000000000..850aa0c1b3f5d0c47c1ba66d518b8a7059c85e95
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py
@@ -0,0 +1,725 @@
+""" Test functions for the sparse.linalg._eigen.lobpcg module
+"""
+
+import itertools
+import platform
+import sys
+import pytest
+import numpy as np
+from numpy import ones, r_, diag
+from numpy.testing import (assert_almost_equal, assert_equal,
+ assert_allclose, assert_array_less)
+
+from scipy import sparse
+from scipy.linalg import (eigh, toeplitz,
+ cholesky_banded, cho_solve_banded)
+from scipy.sparse import dia_array, eye_array, csr_array
+from scipy.sparse.linalg import eigsh, LinearOperator
+from scipy.sparse.linalg._eigen.lobpcg import lobpcg
+from scipy.sparse.linalg._eigen.lobpcg.lobpcg import _b_orthonormalize
+from scipy._lib._util import np_long, np_ulong
+from scipy.sparse.linalg._special_sparse_arrays import (Sakurai,
+ MikotaPair)
+
+_IS_32BIT = (sys.maxsize < 2**32)
+
+INT_DTYPES = (np.intc, np_long, np.longlong, np.uintc, np_ulong, np.ulonglong)
+# np.half is unsupported on many test systems so excluded
+REAL_DTYPES = (np.float32, np.float64, np.longdouble)
+COMPLEX_DTYPES = (np.complex64, np.complex128, np.clongdouble)
+INEXACTDTYPES = REAL_DTYPES + COMPLEX_DTYPES
+ALLDTYPES = INT_DTYPES + INEXACTDTYPES
+
+
+def sign_align(A, B):
+ """Align signs of columns of A match those of B: column-wise remove
+ sign of A by multiplying with its sign then multiply in sign of B.
+ """
+ return np.array([col_A * np.sign(col_A[0]) * np.sign(col_B[0])
+ for col_A, col_B in zip(A.T, B.T)]).T
+
+def ElasticRod(n):
+ """Build the matrices for the generalized eigenvalue problem of the
+ fixed-free elastic rod vibration model.
+ """
+ L = 1.0
+ le = L/n
+ rho = 7.85e3
+ S = 1.e-4
+ E = 2.1e11
+ mass = rho*S*le/6.
+ k = E*S/le
+ A = k*(diag(r_[2.*ones(n-1), 1])-diag(ones(n-1), 1)-diag(ones(n-1), -1))
+ B = mass*(diag(r_[4.*ones(n-1), 2])+diag(ones(n-1), 1)+diag(ones(n-1), -1))
+ return A, B
+
+
+@pytest.mark.filterwarnings("ignore:The problem size")
+@pytest.mark.parametrize("n", [10, 20])
+@pytest.mark.filterwarnings("ignore:Exited at iteration")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_ElasticRod(n):
+ """Check eigh vs. lobpcg consistency for elastic rod model.
+ """
+ A, B = ElasticRod(n)
+ m = 2
+ rnd = np.random.RandomState(0)
+ X = rnd.standard_normal((n, m))
+ eigvals, _ = lobpcg(A, X, B=B, tol=1e-2, maxiter=50, largest=False)
+ eigvals.sort()
+ w, _ = eigh(A, b=B)
+ w.sort()
+ assert_almost_equal(w[:int(m/2)], eigvals[:int(m/2)], decimal=2)
+
+
+@pytest.mark.parametrize("n", [50])
+@pytest.mark.parametrize("m", [1, 2, 10])
+@pytest.mark.filterwarnings("ignore:Casting complex values to real")
+@pytest.mark.parametrize("Vdtype", INEXACTDTYPES)
+@pytest.mark.parametrize("Bdtype", ALLDTYPES)
+@pytest.mark.parametrize("BVdtype", INEXACTDTYPES)
+def test_b_orthonormalize(n, m, Vdtype, Bdtype, BVdtype):
+ """Test B-orthonormalization by Cholesky with callable 'B'.
+ The function '_b_orthonormalize' is key in LOBPCG but may
+ lead to numerical instabilities. The input vectors are often
+ badly scaled, so the function needs scale-invariant Cholesky;
+ see https://netlib.org/lapack/lawnspdf/lawn14.pdf.
+ """
+ rnd = np.random.RandomState(0)
+ X = rnd.standard_normal((n, m)).astype(Vdtype)
+ Xcopy = np.copy(X)
+ vals = np.arange(1, n+1, dtype=float)
+ B = dia_array(([vals], [0]), shape=(n, n)).astype(Bdtype)
+ BX = B @ X
+ BX = BX.astype(BVdtype)
+ is_all_complex = (np.issubdtype(Vdtype, np.complexfloating) and
+ np.issubdtype(BVdtype, np.complexfloating))
+ is_all_notcomplex = (not np.issubdtype(Vdtype, np.complexfloating) and
+ not np.issubdtype(Bdtype, np.complexfloating) and
+ not np.issubdtype(BVdtype, np.complexfloating))
+
+ # All complex or all not complex can calculate in-place
+ check_inplace = is_all_complex or is_all_notcomplex
+ # np.longdouble tol cannot be achieved on most systems
+ atol = m * n * max(np.finfo(Vdtype).eps,
+ np.finfo(BVdtype).eps,
+ np.finfo(np.float64).eps)
+
+ Xo, BXo, _ = _b_orthonormalize(lambda v: B @ v, X, BX)
+ if check_inplace:
+ # Check in-place
+ assert_equal(X, Xo)
+ assert_equal(id(X), id(Xo))
+ assert_equal(BX, BXo)
+ assert_equal(id(BX), id(BXo))
+ # Check BXo
+ assert_allclose(B @ Xo, BXo, atol=atol, rtol=atol)
+ # Check B-orthonormality
+ assert_allclose(Xo.T.conj() @ B @ Xo, np.identity(m),
+ atol=atol, rtol=atol)
+ # Repeat without BX in outputs
+ X = np.copy(Xcopy)
+ Xo1, BXo1, _ = _b_orthonormalize(lambda v: B @ v, X)
+ assert_allclose(Xo, Xo1, atol=atol, rtol=atol)
+ assert_allclose(BXo, BXo1, atol=atol, rtol=atol)
+ if check_inplace:
+ # Check in-place.
+ assert_equal(X, Xo1)
+ assert_equal(id(X), id(Xo1))
+ # Check BXo1
+ assert_allclose(B @ Xo1, BXo1, atol=atol, rtol=atol)
+
+ # Introduce column-scaling in X
+ scaling = 1.0 / np.geomspace(10, 1e10, num=m)
+ X = Xcopy * scaling
+ X = X.astype(Vdtype)
+ BX = B @ X
+ BX = BX.astype(BVdtype)
+ # Check scaling-invariance of Cholesky-based orthonormalization
+ Xo1, BXo1, _ = _b_orthonormalize(lambda v: B @ v, X, BX)
+ # The output should be the same, up the signs of the columns
+ Xo1 = sign_align(Xo1, Xo)
+ assert_allclose(Xo, Xo1, atol=atol, rtol=atol)
+ BXo1 = sign_align(BXo1, BXo)
+ assert_allclose(BXo, BXo1, atol=atol, rtol=atol)
+
+
+@pytest.mark.thread_unsafe
+@pytest.mark.filterwarnings("ignore:Exited at iteration 0")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_nonhermitian_warning(capsys):
+ """Check the warning of a Ritz matrix being not Hermitian
+ by feeding a non-Hermitian input matrix.
+ Also check stdout since verbosityLevel=1 and lack of stderr.
+ """
+ n = 10
+ X = np.arange(n * 2).reshape(n, 2).astype(np.float32)
+ A = np.arange(n * n).reshape(n, n).astype(np.float32)
+ with pytest.warns(UserWarning, match="Matrix gramA"):
+ _, _ = lobpcg(A, X, verbosityLevel=1, maxiter=0)
+ out, err = capsys.readouterr() # Capture output
+ assert out.startswith("Solving standard eigenvalue") # Test stdout
+ assert err == '' # Test empty stderr
+ # Make the matrix symmetric and the UserWarning disappears.
+ A += A.T
+ _, _ = lobpcg(A, X, verbosityLevel=1, maxiter=0)
+ out, err = capsys.readouterr() # Capture output
+ assert out.startswith("Solving standard eigenvalue") # Test stdout
+ assert err == '' # Test empty stderr
+
+
+def test_regression():
+ """Check the eigenvalue of the identity matrix is one.
+ """
+ # https://mail.python.org/pipermail/scipy-user/2010-October/026944.html
+ n = 10
+ X = np.ones((n, 1))
+ A = np.identity(n)
+ w, _ = lobpcg(A, X)
+ assert_allclose(w, [1])
+
+
+@pytest.mark.filterwarnings("ignore:The problem size")
+@pytest.mark.parametrize('n, m, m_excluded', [(30, 4, 3), (4, 2, 0)])
+def test_diagonal(n, m, m_excluded):
+ """Test ``m - m_excluded`` eigenvalues and eigenvectors of
+ diagonal matrices of the size ``n`` varying matrix formats:
+ dense array, spare matrix, and ``LinearOperator`` for both
+ matrixes in the generalized eigenvalue problem ``Av = cBv``
+ and for the preconditioner.
+ """
+ rnd = np.random.RandomState(0)
+
+ # Define the generalized eigenvalue problem Av = cBv
+ # where (c, v) is a generalized eigenpair,
+ # A is the diagonal matrix whose entries are 1,...n,
+ # B is the identity matrix.
+ vals = np.arange(1, n+1, dtype=float)
+ A_s = dia_array(([vals], [0]), shape=(n, n))
+ A_a = A_s.toarray()
+
+ def A_f(x):
+ return A_s @ x
+
+ A_lo = LinearOperator(matvec=A_f,
+ matmat=A_f,
+ shape=(n, n), dtype=float)
+
+ B_a = eye_array(n)
+ B_s = csr_array(B_a)
+
+ def B_f(x):
+ return B_a @ x
+
+ B_lo = LinearOperator(matvec=B_f,
+ matmat=B_f,
+ shape=(n, n), dtype=float)
+
+ # Let the preconditioner M be the inverse of A.
+ M_s = dia_array(([1./vals], [0]), shape=(n, n))
+ M_a = M_s.toarray()
+
+ def M_f(x):
+ return M_s @ x
+
+ M_lo = LinearOperator(matvec=M_f,
+ matmat=M_f,
+ shape=(n, n), dtype=float)
+
+ # Pick random initial vectors.
+ X = rnd.normal(size=(n, m))
+
+ # Require that the returned eigenvectors be in the orthogonal complement
+ # of the first few standard basis vectors.
+ if m_excluded > 0:
+ Y = np.eye(n, m_excluded)
+ else:
+ Y = None
+
+ for A in [A_a, A_s, A_lo]:
+ for B in [B_a, B_s, B_lo]:
+ for M in [M_a, M_s, M_lo]:
+ eigvals, vecs = lobpcg(A, X, B, M=M, Y=Y,
+ maxiter=40, largest=False)
+
+ assert_allclose(eigvals, np.arange(1+m_excluded,
+ 1+m_excluded+m))
+ _check_eigen(A, eigvals, vecs, rtol=1e-3, atol=1e-3)
+
+
+def _check_eigen(M, w, V, rtol=1e-8, atol=1e-14):
+ """Check if the eigenvalue residual is small.
+ """
+ mult_wV = np.multiply(w, V)
+ dot_MV = M.dot(V)
+ assert_allclose(mult_wV, dot_MV, rtol=rtol, atol=atol)
+
+
+def _check_fiedler(n, p):
+ """Check the Fiedler vector computation.
+ """
+ # This is not necessarily the recommended way to find the Fiedler vector.
+ col = np.zeros(n)
+ col[1] = 1
+ A = toeplitz(col)
+ D = np.diag(A.sum(axis=1))
+ L = D - A
+ # Compute the full eigendecomposition using tricks, e.g.
+ # http://www.cs.yale.edu/homes/spielman/561/2009/lect02-09.pdf
+ tmp = np.pi * np.arange(n) / n
+ analytic_w = 2 * (1 - np.cos(tmp))
+ analytic_V = np.cos(np.outer(np.arange(n) + 1/2, tmp))
+ _check_eigen(L, analytic_w, analytic_V)
+ # Compute the full eigendecomposition using eigh.
+ eigh_w, eigh_V = eigh(L)
+ _check_eigen(L, eigh_w, eigh_V)
+ # Check that the first eigenvalue is near zero and that the rest agree.
+ assert_array_less(np.abs([eigh_w[0], analytic_w[0]]), 1e-14)
+ assert_allclose(eigh_w[1:], analytic_w[1:])
+
+ # Check small lobpcg eigenvalues.
+ X = analytic_V[:, :p]
+ lobpcg_w, lobpcg_V = lobpcg(L, X, largest=False)
+ assert_equal(lobpcg_w.shape, (p,))
+ assert_equal(lobpcg_V.shape, (n, p))
+ _check_eigen(L, lobpcg_w, lobpcg_V)
+ assert_array_less(np.abs(np.min(lobpcg_w)), 1e-14)
+ assert_allclose(np.sort(lobpcg_w)[1:], analytic_w[1:p])
+
+ # Check large lobpcg eigenvalues.
+ X = analytic_V[:, -p:]
+ lobpcg_w, lobpcg_V = lobpcg(L, X, largest=True)
+ assert_equal(lobpcg_w.shape, (p,))
+ assert_equal(lobpcg_V.shape, (n, p))
+ _check_eigen(L, lobpcg_w, lobpcg_V)
+ assert_allclose(np.sort(lobpcg_w), analytic_w[-p:])
+
+ # Look for the Fiedler vector using good but not exactly correct guesses.
+ fiedler_guess = np.concatenate((np.ones(n//2), -np.ones(n-n//2)))
+ X = np.vstack((np.ones(n), fiedler_guess)).T
+ lobpcg_w, _ = lobpcg(L, X, largest=False)
+ # Mathematically, the smaller eigenvalue should be zero
+ # and the larger should be the algebraic connectivity.
+ lobpcg_w = np.sort(lobpcg_w)
+ assert_allclose(lobpcg_w, analytic_w[:2], atol=1e-14)
+
+
+@pytest.mark.thread_unsafe
+def test_fiedler_small_8():
+ """Check the dense workaround path for small matrices.
+ """
+ # This triggers the dense path because 8 < 2*5.
+ with pytest.warns(UserWarning, match="The problem size"):
+ _check_fiedler(8, 2)
+
+
+def test_fiedler_large_12():
+ """Check the dense workaround path avoided for non-small matrices.
+ """
+ # This does not trigger the dense path, because 2*5 <= 12.
+ _check_fiedler(12, 2)
+
+
+@pytest.mark.filterwarnings("ignore:Failed at iteration")
+@pytest.mark.filterwarnings("ignore:Exited at iteration")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_failure_to_run_iterations():
+ """Check that the code exits gracefully without breaking. Issue #10974.
+ The code may or not issue a warning, filtered out. Issue #15935, #17954.
+ """
+ rnd = np.random.RandomState(0)
+ X = rnd.standard_normal((100, 10))
+ A = X @ X.T
+ Q = rnd.standard_normal((X.shape[0], 4))
+ eigenvalues, _ = lobpcg(A, Q, maxiter=40, tol=1e-12)
+ assert np.max(eigenvalues) > 0
+
+
+@pytest.mark.thread_unsafe
+def test_failure_to_run_iterations_nonsymmetric():
+ """Check that the code exists gracefully without breaking
+ if the matrix in not symmetric.
+ """
+ A = np.zeros((10, 10))
+ A[0, 1] = 1
+ Q = np.ones((10, 1))
+ msg = "Exited at iteration 2|Exited postprocessing with accuracies.*"
+ with pytest.warns(UserWarning, match=msg):
+ eigenvalues, _ = lobpcg(A, Q, maxiter=20)
+ assert np.max(eigenvalues) > 0
+
+
+@pytest.mark.filterwarnings("ignore:The problem size")
+def test_hermitian():
+ """Check complex-value Hermitian cases.
+ """
+ rnd = np.random.RandomState(0)
+
+ sizes = [3, 12]
+ ks = [1, 2]
+ gens = [True, False]
+
+ for s, k, gen, dh, dx, db in (
+ itertools.product(sizes, ks, gens, gens, gens, gens)
+ ):
+ H = rnd.random((s, s)) + 1.j * rnd.random((s, s))
+ H = 10 * np.eye(s) + H + H.T.conj()
+ H = H.astype(np.complex128) if dh else H.astype(np.complex64)
+
+ X = rnd.standard_normal((s, k))
+ X = X + 1.j * rnd.standard_normal((s, k))
+ X = X.astype(np.complex128) if dx else X.astype(np.complex64)
+
+ if not gen:
+ B = np.eye(s)
+ w, v = lobpcg(H, X, maxiter=99, verbosityLevel=0)
+ # Also test mixing complex H with real B.
+ wb, _ = lobpcg(H, X, B, maxiter=99, verbosityLevel=0)
+ assert_allclose(w, wb, rtol=1e-6)
+ w0, _ = eigh(H)
+ else:
+ B = rnd.random((s, s)) + 1.j * rnd.random((s, s))
+ B = 10 * np.eye(s) + B.dot(B.T.conj())
+ B = B.astype(np.complex128) if db else B.astype(np.complex64)
+ w, v = lobpcg(H, X, B, maxiter=99, verbosityLevel=0)
+ w0, _ = eigh(H, B)
+
+ for wx, vx in zip(w, v.T):
+ # Check eigenvector
+ assert_allclose(np.linalg.norm(H.dot(vx) - B.dot(vx) * wx)
+ / np.linalg.norm(H.dot(vx)),
+ 0, atol=5e-2, rtol=0)
+
+ # Compare eigenvalues
+ j = np.argmin(abs(w0 - wx))
+ assert_allclose(wx, w0[j], rtol=1e-4)
+
+
+# The n=5 case tests the alternative small matrix code path that uses eigh().
+@pytest.mark.filterwarnings("ignore:The problem size")
+@pytest.mark.parametrize('n, atol', [(20, 1e-3), (5, 1e-8)])
+def test_eigsh_consistency(n, atol):
+ """Check eigsh vs. lobpcg consistency.
+ """
+ vals = np.arange(1, n+1, dtype=np.float64)
+ A = dia_array((vals, 0), shape=(n, n))
+ rnd = np.random.RandomState(0)
+ X = rnd.standard_normal((n, 2))
+ lvals, lvecs = lobpcg(A, X, largest=True, maxiter=100)
+ vals, _ = eigsh(A, k=2)
+
+ _check_eigen(A, lvals, lvecs, atol=atol, rtol=0)
+ assert_allclose(np.sort(vals), np.sort(lvals), atol=1e-14)
+
+
+@pytest.mark.thread_unsafe
+def test_verbosity():
+ """Check that nonzero verbosity level code runs.
+ """
+ rnd = np.random.RandomState(0)
+ X = rnd.standard_normal((10, 10))
+ A = X @ X.T
+ Q = rnd.standard_normal((X.shape[0], 1))
+ msg = "Exited at iteration.*|Exited postprocessing with accuracies.*"
+ with pytest.warns(UserWarning, match=msg):
+ _, _ = lobpcg(A, Q, maxiter=3, verbosityLevel=9)
+
+
+@pytest.mark.xfail(_IS_32BIT and sys.platform == 'win32',
+ reason="tolerance violation on windows")
+@pytest.mark.xfail(platform.machine() == 'ppc64le',
+ reason="fails on ppc64le")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_tolerance_float32():
+ """Check lobpcg for attainable tolerance in float32.
+ """
+ rnd = np.random.RandomState(0)
+ n = 50
+ m = 3
+ vals = -np.arange(1, n + 1)
+ A = dia_array(([vals], [0]), shape=(n, n))
+ A = A.astype(np.float32)
+ X = rnd.standard_normal((n, m))
+ X = X.astype(np.float32)
+ eigvals, _ = lobpcg(A, X, tol=1.25e-5, maxiter=50, verbosityLevel=0)
+ assert_allclose(eigvals, -np.arange(1, 1 + m), atol=2e-5, rtol=1e-5)
+
+
+@pytest.mark.parametrize("vdtype", INEXACTDTYPES)
+@pytest.mark.parametrize("mdtype", ALLDTYPES)
+@pytest.mark.parametrize("arr_type", [np.array,
+ sparse.csr_array,
+ sparse.coo_array])
+def test_dtypes(vdtype, mdtype, arr_type):
+ """Test lobpcg in various dtypes.
+ """
+ rnd = np.random.RandomState(0)
+ n = 12
+ m = 2
+ A = arr_type(np.diag(np.arange(1, n + 1)).astype(mdtype))
+ X = rnd.random((n, m))
+ X = X.astype(vdtype)
+ eigvals, eigvecs = lobpcg(A, X, tol=1e-2, largest=False)
+ assert_allclose(eigvals, np.arange(1, 1 + m), atol=1e-1)
+ # eigenvectors must be nearly real in any case
+ assert_allclose(np.sum(np.abs(eigvecs - eigvecs.conj())), 0, atol=1e-2)
+
+
+@pytest.mark.thread_unsafe
+@pytest.mark.filterwarnings("ignore:Exited at iteration")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_inplace_warning():
+ """Check lobpcg gives a warning in '_b_orthonormalize'
+ that in-place orthogonalization is impossible due to dtype mismatch.
+ """
+ rnd = np.random.RandomState(0)
+ n = 6
+ m = 1
+ vals = -np.arange(1, n + 1)
+ A = dia_array(([vals], [0]), shape=(n, n))
+ A = A.astype(np.cdouble)
+ X = rnd.standard_normal((n, m))
+ with pytest.warns(UserWarning, match="Inplace update"):
+ eigvals, _ = lobpcg(A, X, maxiter=2, verbosityLevel=1)
+
+
+@pytest.mark.thread_unsafe
+def test_maxit():
+ """Check lobpcg if maxit=maxiter runs maxiter iterations and
+ if maxit=None runs 20 iterations (the default)
+ by checking the size of the iteration history output, which should
+ be the number of iterations plus 3 (initial, final, and postprocessing)
+ typically when maxiter is small and the choice of the best is passive.
+ """
+ rnd = np.random.RandomState(0)
+ n = 50
+ m = 4
+ vals = -np.arange(1, n + 1)
+ A = dia_array(([vals], [0]), shape=(n, n))
+ A = A.astype(np.float32)
+ X = rnd.standard_normal((n, m))
+ X = X.astype(np.float64)
+ msg = "Exited at iteration.*|Exited postprocessing with accuracies.*"
+ for maxiter in range(1, 4):
+ with pytest.warns(UserWarning, match=msg):
+ _, _, l_h, r_h = lobpcg(A, X, tol=1e-8, maxiter=maxiter,
+ retLambdaHistory=True,
+ retResidualNormsHistory=True)
+ assert_allclose(np.shape(l_h)[0], maxiter+3)
+ assert_allclose(np.shape(r_h)[0], maxiter+3)
+ with pytest.warns(UserWarning, match=msg):
+ l, _, l_h, r_h = lobpcg(A, X, tol=1e-8,
+ retLambdaHistory=True,
+ retResidualNormsHistory=True)
+ assert_allclose(np.shape(l_h)[0], 20+3)
+ assert_allclose(np.shape(r_h)[0], 20+3)
+ # Check that eigenvalue output is the last one in history
+ assert_allclose(l, l_h[-1])
+ # Make sure that both history outputs are lists
+ assert isinstance(l_h, list)
+ assert isinstance(r_h, list)
+ # Make sure that both history lists are arrays-like
+ assert_allclose(np.shape(l_h), np.shape(np.asarray(l_h)))
+ assert_allclose(np.shape(r_h), np.shape(np.asarray(r_h)))
+
+
+@pytest.mark.xslow
+@pytest.mark.filterwarnings("ignore:Exited at iteration")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_sakurai():
+ """Check lobpcg and eighs accuracy for the Sakurai example
+ already used in `benchmarks/benchmarks/sparse_linalg_lobpcg.py`.
+ """
+ n = 50
+ tol = 100 * n * n * n* np.finfo(float).eps
+ sakurai_obj = Sakurai(n, dtype='int')
+ A = sakurai_obj
+ m = 3
+ ee = sakurai_obj.eigenvalues(3)
+ rng = np.random.default_rng(0)
+ X = rng.normal(size=(n, m))
+ el, _ = lobpcg(A, X, tol=1e-9, maxiter=5000, largest=False)
+ accuracy = max(abs(ee - el) / ee)
+ assert_allclose(accuracy, 0., atol=tol)
+ a_l = LinearOperator((n, n), matvec=A, matmat=A, dtype='float64')
+ ea, _ = eigsh(a_l, k=m, which='SA', tol=1e-9, maxiter=15000,
+ v0 = rng.normal(size=(n, 1)))
+ accuracy = max(abs(ee - ea) / ee)
+ assert_allclose(accuracy, 0., atol=tol)
+
+
+@pytest.mark.parametrize("n", [500, 1000])
+@pytest.mark.filterwarnings("ignore:Exited at iteration")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_sakurai_inverse(n):
+ """Check lobpcg and eighs accuracy for the sakurai_inverse example
+ already used in `benchmarks/benchmarks/sparse_linalg_lobpcg.py`.
+ """
+ def a(x):
+ return cho_solve_banded((c, False), x)
+ tol = 100 * n * n * n* np.finfo(float).eps
+ sakurai_obj = Sakurai(n)
+ A = sakurai_obj.tobanded().astype(np.float64)
+ m = 3
+ ee = sakurai_obj.eigenvalues(3)
+ rng = np.random.default_rng(0)
+ X = rng.normal(size=(n, m))
+ c = cholesky_banded(A)
+ el, _ = lobpcg(a, X, tol=1e-9, maxiter=8)
+ accuracy = max(abs(ee - 1. / el) / ee)
+ assert_allclose(accuracy, 0., atol=tol)
+ a_l = LinearOperator((n, n), matvec=a, matmat=a, dtype='float64')
+ ea, _ = eigsh(a_l, k=m, which='LA', tol=1e-9, maxiter=8,
+ v0 = rng.normal(size=(n, 1)))
+ accuracy = max(abs(ee - np.sort(1. / ea)) / ee)
+ assert_allclose(accuracy, 0., atol=tol)
+
+
+@pytest.mark.filterwarnings("ignore:The problem size")
+@pytest.mark.parametrize("n", [10, 20, 128, 256, 512, 1024, 2048])
+@pytest.mark.filterwarnings("ignore:Exited at iteration")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_MikotaPair(n):
+ """Check lobpcg and eighs accuracy for the Mikota example
+ already used in `benchmarks/benchmarks/sparse_linalg_lobpcg.py`.
+ """
+ def a(x):
+ return cho_solve_banded((c, False), x)
+ mik = MikotaPair(n)
+ mik_k = mik.k
+ mik_m = mik.m
+ Ac = mik_k
+ Bc = mik_m
+ Ab = mik_k.tobanded()
+ eigenvalues = mik.eigenvalues
+ if n == 10:
+ m = 3 # lobpcg calls eigh
+ elif n == 20:
+ m = 2
+ else:
+ m = 10
+ ee = eigenvalues(m)
+ tol = 100 * m * n * n * np.finfo(float).eps
+ rng = np.random.default_rng(0)
+ X = rng.normal(size=(n, m))
+ c = cholesky_banded(Ab.astype(np.float32))
+ el, _ = lobpcg(Ac, X, Bc, M=a, tol=1e-4,
+ maxiter=40, largest=False)
+ accuracy = max(abs(ee - el) / ee)
+ assert_allclose(accuracy, 0., atol=tol)
+ B = LinearOperator((n, n), matvec=Bc, matmat=Bc, dtype='float64')
+ A = LinearOperator((n, n), matvec=Ac, matmat=Ac, dtype='float64')
+ c = cholesky_banded(Ab)
+ a_l = LinearOperator((n, n), matvec=a, matmat=a, dtype='float64')
+ ea, _ = eigsh(B, k=m, M=A, Minv=a_l, which='LA', tol=1e-4, maxiter=50,
+ v0 = rng.normal(size=(n, 1)))
+ accuracy = max(abs(ee - np.sort(1./ea)) / ee)
+ assert_allclose(accuracy, 0., atol=tol)
+
+
+@pytest.mark.slow
+@pytest.mark.parametrize("n", [15])
+@pytest.mark.parametrize("m", [1, 2])
+@pytest.mark.filterwarnings("ignore:Exited at iteration")
+@pytest.mark.filterwarnings("ignore:Exited postprocessing")
+def test_diagonal_data_types(n, m):
+ """Check lobpcg for diagonal matrices for all matrix types.
+ Constraints are imposed, so a dense eigensolver eig cannot run.
+ """
+ rnd = np.random.RandomState(0)
+ # Define the generalized eigenvalue problem Av = cBv
+ # where (c, v) is a generalized eigenpair,
+ # and where we choose A and B to be diagonal.
+ vals = np.arange(1, n + 1)
+
+ list_sparse_format = ['bsr', 'coo', 'csc', 'csr', 'dia', 'dok', 'lil']
+ for s_f_i, s_f in enumerate(list_sparse_format):
+
+ As64 = dia_array(([vals * vals], [0]), shape=(n, n)).asformat(s_f)
+ As32 = As64.astype(np.float32)
+ Af64 = As64.toarray()
+ Af32 = Af64.astype(np.float32)
+
+ def As32f(x):
+ return As32 @ x
+ As32LO = LinearOperator(matvec=As32f,
+ matmat=As32f,
+ shape=(n, n),
+ dtype=As32.dtype)
+
+ listA = [Af64, As64, Af32, As32, As32f, As32LO, lambda v: As32 @ v]
+
+ Bs64 = dia_array(([vals], [0]), shape=(n, n)).asformat(s_f)
+ Bf64 = Bs64.toarray()
+ Bs32 = Bs64.astype(np.float32)
+
+ def Bs32f(x):
+ return Bs32 @ x
+ Bs32LO = LinearOperator(matvec=Bs32f,
+ matmat=Bs32f,
+ shape=(n, n),
+ dtype=Bs32.dtype)
+ listB = [Bf64, Bs64, Bs32, Bs32f, Bs32LO, lambda v: Bs32 @ v]
+
+ # Define the preconditioner function as LinearOperator.
+ Ms64 = dia_array(([1./vals], [0]), shape=(n, n)).asformat(s_f)
+
+ def Ms64precond(x):
+ return Ms64 @ x
+ Ms64precondLO = LinearOperator(matvec=Ms64precond,
+ matmat=Ms64precond,
+ shape=(n, n),
+ dtype=Ms64.dtype)
+ Mf64 = Ms64.toarray()
+
+ def Mf64precond(x):
+ return Mf64 @ x
+ Mf64precondLO = LinearOperator(matvec=Mf64precond,
+ matmat=Mf64precond,
+ shape=(n, n),
+ dtype=Mf64.dtype)
+ Ms32 = Ms64.astype(np.float32)
+
+ def Ms32precond(x):
+ return Ms32 @ x
+ Ms32precondLO = LinearOperator(matvec=Ms32precond,
+ matmat=Ms32precond,
+ shape=(n, n),
+ dtype=Ms32.dtype)
+ Mf32 = Ms32.toarray()
+
+ def Mf32precond(x):
+ return Mf32 @ x
+ Mf32precondLO = LinearOperator(matvec=Mf32precond,
+ matmat=Mf32precond,
+ shape=(n, n),
+ dtype=Mf32.dtype)
+ listM = [None, Ms64, Ms64precondLO, Mf64precondLO, Ms64precond,
+ Ms32, Ms32precondLO, Mf32precondLO, Ms32precond]
+
+ # Setup matrix of the initial approximation to the eigenvectors
+ # (cannot be sparse array).
+ Xf64 = rnd.random((n, m))
+ Xf32 = Xf64.astype(np.float32)
+ listX = [Xf64, Xf32]
+
+ # Require that the returned eigenvectors be in the orthogonal complement
+ # of the first few standard basis vectors (cannot be sparse array).
+ m_excluded = 3
+ Yf64 = np.eye(n, m_excluded, dtype=float)
+ Yf32 = np.eye(n, m_excluded, dtype=np.float32)
+ listY = [Yf64, Yf32]
+
+ tests = list(itertools.product(listA, listB, listM, listX, listY))
+
+ for A, B, M, X, Y in tests:
+ # This is one of the slower tests because there are >1,000 configs
+ # to test here. Flip a biased coin to decide whether to run each
+ # test to get decent coverage in less time.
+ if rnd.random() < 0.98:
+ continue # too many tests
+ eigvals, _ = lobpcg(A, X, B=B, M=M, Y=Y, tol=1e-4,
+ maxiter=100, largest=False)
+ assert_allclose(eigvals,
+ np.arange(1 + m_excluded, 1 + m_excluded + m),
+ atol=1e-5)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/tests/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/tests/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/tests/test_svds.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/tests/test_svds.py
new file mode 100644
index 0000000000000000000000000000000000000000..7fddf19af26811364ca8551021244e20c6da2239
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_eigen/tests/test_svds.py
@@ -0,0 +1,886 @@
+import re
+import copy
+import numpy as np
+
+from numpy.testing import assert_allclose, assert_equal, assert_array_equal
+import pytest
+
+from scipy.linalg import svd, null_space
+from scipy.sparse import csc_array, issparse, dia_array, random_array
+from scipy.sparse.linalg import LinearOperator, aslinearoperator
+from scipy.sparse.linalg import svds
+from scipy.sparse.linalg._eigen.arpack import ArpackNoConvergence
+
+
+# --- Helper Functions / Classes ---
+
+
+def sorted_svd(m, k, which='LM'):
+ # Compute svd of a dense matrix m, and return singular vectors/values
+ # sorted.
+ if issparse(m):
+ m = m.toarray()
+ u, s, vh = svd(m)
+ if which == 'LM':
+ ii = np.argsort(s)[-k:]
+ elif which == 'SM':
+ ii = np.argsort(s)[:k]
+ else:
+ raise ValueError(f"unknown which={which!r}")
+
+ return u[:, ii], s[ii], vh[ii]
+
+
+def _check_svds(A, k, u, s, vh, which="LM", check_usvh_A=False,
+ check_svd=True, atol=1e-10, rtol=1e-7):
+ n, m = A.shape
+
+ # Check shapes.
+ assert_equal(u.shape, (n, k))
+ assert_equal(s.shape, (k,))
+ assert_equal(vh.shape, (k, m))
+
+ # Check that the original matrix can be reconstituted.
+ A_rebuilt = (u*s).dot(vh)
+ assert_equal(A_rebuilt.shape, A.shape)
+ if check_usvh_A:
+ assert_allclose(A_rebuilt, A, atol=atol, rtol=rtol)
+
+ # Check that u is a semi-orthogonal matrix.
+ uh_u = np.dot(u.T.conj(), u)
+ assert_equal(uh_u.shape, (k, k))
+ assert_allclose(uh_u, np.identity(k), atol=atol, rtol=rtol)
+
+ # Check that vh is a semi-orthogonal matrix.
+ vh_v = np.dot(vh, vh.T.conj())
+ assert_equal(vh_v.shape, (k, k))
+ assert_allclose(vh_v, np.identity(k), atol=atol, rtol=rtol)
+
+ # Check that scipy.sparse.linalg.svds ~ scipy.linalg.svd
+ if check_svd:
+ u2, s2, vh2 = sorted_svd(A, k, which)
+ assert_allclose(np.abs(u), np.abs(u2), atol=atol, rtol=rtol)
+ assert_allclose(s, s2, atol=atol, rtol=rtol)
+ assert_allclose(np.abs(vh), np.abs(vh2), atol=atol, rtol=rtol)
+
+
+def _check_svds_n(A, k, u, s, vh, which="LM", check_res=True,
+ check_svd=True, atol=1e-10, rtol=1e-7):
+ n, m = A.shape
+
+ # Check shapes.
+ assert_equal(u.shape, (n, k))
+ assert_equal(s.shape, (k,))
+ assert_equal(vh.shape, (k, m))
+
+ # Check that u is a semi-orthogonal matrix.
+ uh_u = np.dot(u.T.conj(), u)
+ assert_equal(uh_u.shape, (k, k))
+ error = np.sum(np.abs(uh_u - np.identity(k))) / (k * k)
+ assert_allclose(error, 0.0, atol=atol, rtol=rtol)
+
+ # Check that vh is a semi-orthogonal matrix.
+ vh_v = np.dot(vh, vh.T.conj())
+ assert_equal(vh_v.shape, (k, k))
+ error = np.sum(np.abs(vh_v - np.identity(k))) / (k * k)
+ assert_allclose(error, 0.0, atol=atol, rtol=rtol)
+
+ # Check residuals
+ if check_res:
+ ru = A.T.conj() @ u - vh.T.conj() * s
+ rus = np.sum(np.abs(ru)) / (n * k)
+ rvh = A @ vh.T.conj() - u * s
+ rvhs = np.sum(np.abs(rvh)) / (m * k)
+ assert_allclose(rus, 0.0, atol=atol, rtol=rtol)
+ assert_allclose(rvhs, 0.0, atol=atol, rtol=rtol)
+
+ # Check that scipy.sparse.linalg.svds ~ scipy.linalg.svd
+ if check_svd:
+ u2, s2, vh2 = sorted_svd(A, k, which)
+ assert_allclose(s, s2, atol=atol, rtol=rtol)
+ A_rebuilt_svd = (u2*s2).dot(vh2)
+ A_rebuilt = (u*s).dot(vh)
+ assert_equal(A_rebuilt.shape, A.shape)
+ error = np.sum(np.abs(A_rebuilt_svd - A_rebuilt)) / (k * k)
+ assert_allclose(error, 0.0, atol=atol, rtol=rtol)
+
+
+class CheckingLinearOperator(LinearOperator):
+ def __init__(self, A):
+ self.A = A
+ self.dtype = A.dtype
+ self.shape = A.shape
+
+ def _matvec(self, x):
+ assert_equal(max(x.shape), np.size(x))
+ return self.A.dot(x)
+
+ def _rmatvec(self, x):
+ assert_equal(max(x.shape), np.size(x))
+ return self.A.T.conjugate().dot(x)
+
+
+# --- Test Input Validation ---
+# Tests input validation on parameters `k` and `which`.
+# Needs better input validation checks for all other parameters.
+
+class SVDSCommonTests:
+
+ solver = None
+
+ # some of these IV tests could run only once, say with solver=None
+
+ _A_empty_msg = "`A` must not be empty."
+ _A_dtype_msg = "`A` must be of numeric data type"
+ _A_type_msg = "type not understood"
+ _A_ndim_msg = "array must have ndim <= 2"
+ _A_validation_inputs = [
+ (np.asarray([[]]), ValueError, _A_empty_msg),
+ (np.array([['a', 'b'], ['c', 'd']], dtype='object'), ValueError, _A_dtype_msg),
+ ("hi", TypeError, _A_type_msg),
+ (np.asarray([[[1., 2.], [3., 4.]]]), ValueError, _A_ndim_msg)]
+
+ @pytest.mark.parametrize("args", _A_validation_inputs)
+ def test_svds_input_validation_A(self, args):
+ A, error_type, message = args
+ with pytest.raises(error_type, match=message):
+ svds(A, k=1, solver=self.solver, rng=0)
+
+ @pytest.mark.parametrize("which", ["LM", "SM"])
+ def test_svds_int_A(self, which):
+ A = np.asarray([[1, 2], [3, 4]])
+ if self.solver == 'lobpcg':
+ with pytest.warns(UserWarning, match="The problem size"):
+ res = svds(A, k=1, which=which, solver=self.solver, rng=0)
+ else:
+ res = svds(A, k=1, which=which, solver=self.solver, rng=0)
+ _check_svds(A, 1, *res, which=which, atol=8e-10)
+
+ def test_svds_diff0_docstring_example(self):
+ def diff0(a):
+ return np.diff(a, axis=0)
+ def diff0t(a):
+ if a.ndim == 1:
+ a = a[:,np.newaxis] # Turn 1D into 2D array
+ d = np.zeros((a.shape[0] + 1, a.shape[1]), dtype=a.dtype)
+ d[0, :] = - a[0, :]
+ d[1:-1, :] = a[0:-1, :] - a[1:, :]
+ d[-1, :] = a[-1, :]
+ return d
+ def diff0_func_aslo_def(n):
+ return LinearOperator(matvec=diff0,
+ matmat=diff0,
+ rmatvec=diff0t,
+ rmatmat=diff0t,
+ shape=(n - 1, n))
+ n = 100
+ diff0_func_aslo = diff0_func_aslo_def(n)
+ # preserve a use of legacy keyword `random_state` during SPEC 7 transition
+ u, s, _ = svds(diff0_func_aslo, k=3, which='SM', random_state=0)
+ se = 2. * np.sin(np.pi * np.arange(1, 4) / (2. * n))
+ ue = np.sqrt(2 / n) * np.sin(np.pi * np.outer(np.arange(1, n),
+ np.arange(1, 4)) / n)
+ assert_allclose(s, se, atol=1e-3)
+ assert_allclose(np.abs(u), np.abs(ue), atol=1e-6)
+
+ @pytest.mark.parametrize("k", [-1, 0, 3, 4, 5, 1.5, "1"])
+ def test_svds_input_validation_k_1(self, k):
+ rng = np.random.default_rng(0)
+ A = rng.random((4, 3))
+
+ # propack can do complete SVD
+ if self.solver == 'propack' and k == 3:
+ res = svds(A, k=k, solver=self.solver, rng=0)
+ _check_svds(A, k, *res, check_usvh_A=True, check_svd=True)
+ return
+
+ message = ("`k` must be an integer satisfying")
+ with pytest.raises(ValueError, match=message):
+ svds(A, k=k, solver=self.solver, rng=0)
+
+ def test_svds_input_validation_k_2(self):
+ # I think the stack trace is reasonable when `k` can't be converted
+ # to an int.
+ message = "int() argument must be a"
+ with pytest.raises(TypeError, match=re.escape(message)):
+ svds(np.eye(10), k=[], solver=self.solver, rng=0)
+
+ message = "invalid literal for int()"
+ with pytest.raises(ValueError, match=message):
+ svds(np.eye(10), k="hi", solver=self.solver, rng=0)
+
+ @pytest.mark.parametrize("tol", (-1, np.inf, np.nan))
+ def test_svds_input_validation_tol_1(self, tol):
+ message = "`tol` must be a non-negative floating point value."
+ with pytest.raises(ValueError, match=message):
+ svds(np.eye(10), tol=tol, solver=self.solver, rng=0)
+
+ @pytest.mark.parametrize("tol", ([], 'hi'))
+ def test_svds_input_validation_tol_2(self, tol):
+ # I think the stack trace is reasonable here
+ message = "'<' not supported between instances"
+ with pytest.raises(TypeError, match=message):
+ svds(np.eye(10), tol=tol, solver=self.solver, rng=0)
+
+ @pytest.mark.parametrize("which", ('LA', 'SA', 'ekki', 0))
+ def test_svds_input_validation_which(self, which):
+ # Regression test for a github issue.
+ # https://github.com/scipy/scipy/issues/4590
+ # Function was not checking for eigenvalue type and unintended
+ # values could be returned.
+ with pytest.raises(ValueError, match="`which` must be in"):
+ svds(np.eye(10), which=which, solver=self.solver, rng=0)
+
+ @pytest.mark.parametrize("transpose", (True, False))
+ @pytest.mark.parametrize("n", range(4, 9))
+ def test_svds_input_validation_v0_1(self, transpose, n):
+ rng = np.random.default_rng(0)
+ A = rng.random((5, 7))
+ v0 = rng.random(n)
+ if transpose:
+ A = A.T
+ k = 2
+ message = "`v0` must have shape"
+
+ required_length = (A.shape[0] if self.solver == 'propack'
+ else min(A.shape))
+ if n != required_length:
+ with pytest.raises(ValueError, match=message):
+ svds(A, k=k, v0=v0, solver=self.solver, rng=0)
+
+ def test_svds_input_validation_v0_2(self):
+ A = np.ones((10, 10))
+ v0 = np.ones((1, 10))
+ message = "`v0` must have shape"
+ with pytest.raises(ValueError, match=message):
+ svds(A, k=1, v0=v0, solver=self.solver, rng=0)
+
+ @pytest.mark.parametrize("v0", ("hi", 1, np.ones(10, dtype=int)))
+ def test_svds_input_validation_v0_3(self, v0):
+ A = np.ones((10, 10))
+ message = "`v0` must be of floating or complex floating data type."
+ with pytest.raises(ValueError, match=message):
+ svds(A, k=1, v0=v0, solver=self.solver, rng=0)
+
+ @pytest.mark.parametrize("maxiter", (-1, 0, 5.5))
+ def test_svds_input_validation_maxiter_1(self, maxiter):
+ message = ("`maxiter` must be a positive integer.")
+ with pytest.raises(ValueError, match=message):
+ svds(np.eye(10), maxiter=maxiter, solver=self.solver, rng=0)
+
+ def test_svds_input_validation_maxiter_2(self):
+ # I think the stack trace is reasonable when `k` can't be converted
+ # to an int.
+ message = "int() argument must be a"
+ with pytest.raises(TypeError, match=re.escape(message)):
+ svds(np.eye(10), maxiter=[], solver=self.solver, rng=0)
+
+ message = "invalid literal for int()"
+ with pytest.raises(ValueError, match=message):
+ svds(np.eye(10), maxiter="hi", solver=self.solver, rng=0)
+
+ @pytest.mark.parametrize("rsv", ('ekki', 10))
+ def test_svds_input_validation_return_singular_vectors(self, rsv):
+ message = "`return_singular_vectors` must be in"
+ with pytest.raises(ValueError, match=message):
+ svds(np.eye(10), return_singular_vectors=rsv, solver=self.solver, rng=0)
+
+ # --- Test Parameters ---
+ @pytest.mark.thread_unsafe
+ @pytest.mark.parametrize("k", [3, 5])
+ @pytest.mark.parametrize("which", ["LM", "SM"])
+ def test_svds_parameter_k_which(self, k, which):
+ # check that the `k` parameter sets the number of eigenvalues/
+ # eigenvectors returned.
+ # Also check that the `which` parameter sets whether the largest or
+ # smallest eigenvalues are returned
+ rng = np.random.default_rng(0)
+ A = rng.random((10, 10))
+ if self.solver == 'lobpcg':
+ with pytest.warns(UserWarning, match="The problem size"):
+ res = svds(A, k=k, which=which, solver=self.solver, rng=0)
+ else:
+ res = svds(A, k=k, which=which, solver=self.solver, rng=0)
+ _check_svds(A, k, *res, which=which, atol=1e-9, rtol=2e-13)
+
+ @pytest.mark.filterwarnings("ignore:Exited",
+ reason="Ignore LOBPCG early exit.")
+ # loop instead of parametrize for simplicity
+ def test_svds_parameter_tol(self):
+ # check the effect of the `tol` parameter on solver accuracy by solving
+ # the same problem with varying `tol` and comparing the eigenvalues
+ # against ground truth computed
+ n = 100 # matrix size
+ k = 3 # number of eigenvalues to check
+
+ # generate a random, sparse-ish matrix
+ # effect isn't apparent for matrices that are too small
+ rng = np.random.default_rng(0)
+ A = rng.random((n, n))
+ A[A > .1] = 0
+ A = A @ A.T
+
+ _, s, _ = svd(A) # calculate ground truth
+
+ # calculate the error as a function of `tol`
+ A = csc_array(A)
+
+ def err(tol):
+ _, s2, _ = svds(A, k=k, v0=np.ones(n), maxiter=1000,
+ solver=self.solver, tol=tol, rng=0)
+ return np.linalg.norm((s2 - s[k-1::-1])/s[k-1::-1])
+
+ tols = [1e-4, 1e-2, 1e0] # tolerance levels to check
+ # for 'arpack' and 'propack', accuracies make discrete steps
+ accuracies = {'propack': [1e-12, 1e-6, 1e-4],
+ 'arpack': [2.5e-15, 1e-10, 1e-10],
+ 'lobpcg': [2e-12, 4e-2, 2]}
+
+ for tol, accuracy in zip(tols, accuracies[self.solver]):
+ error = err(tol)
+ assert error < accuracy
+
+ def test_svd_v0(self):
+ # check that the `v0` parameter affects the solution
+ n = 100
+ k = 1
+ # If k != 1, LOBPCG needs more initial vectors, which are generated
+ # with rng, so it does not pass w/ k >= 2.
+ # For some other values of `n`, the AssertionErrors are not raised
+ # with different v0s, which is reasonable.
+
+ rng = np.random.default_rng(0)
+ A = rng.random((n, n))
+
+ # with the same v0, solutions are the same, and they are accurate
+ # v0 takes precedence over rng
+ v0a = rng.random(n)
+ res1a = svds(A, k, v0=v0a, solver=self.solver, rng=0)
+ res2a = svds(A, k, v0=v0a, solver=self.solver, rng=1)
+ for idx in range(3):
+ assert_allclose(res1a[idx], res2a[idx], rtol=1e-15, atol=2e-16)
+ _check_svds(A, k, *res1a)
+
+ # with the same v0, solutions are the same, and they are accurate
+ v0b = rng.random(n)
+ res1b = svds(A, k, v0=v0b, solver=self.solver, rng=2)
+ res2b = svds(A, k, v0=v0b, solver=self.solver, rng=3)
+ for idx in range(3):
+ assert_allclose(res1b[idx], res2b[idx], rtol=1e-15, atol=2e-16)
+ _check_svds(A, k, *res1b)
+
+ # with different v0, solutions can be numerically different
+ message = "Arrays are not equal"
+ with pytest.raises(AssertionError, match=message):
+ assert_equal(res1a, res1b)
+
+ def test_svd_rng(self):
+ # check that the `rng` parameter affects the solution
+ # Admittedly, `n` and `k` are chosen so that all solver pass all
+ # these checks. That's a tall order, since LOBPCG doesn't want to
+ # achieve the desired accuracy and ARPACK often returns the same
+ # singular values/vectors for different v0.
+ n = 100
+ k = 1
+
+ rng = np.random.default_rng(0)
+ A = rng.random((n, n))
+
+ # with the same rng, solutions are the same and accurate
+ res1a = svds(A, k, solver=self.solver, rng=0)
+ res2a = svds(A, k, solver=self.solver, rng=0)
+ for idx in range(3):
+ assert_allclose(res1a[idx], res2a[idx], rtol=1e-15, atol=2e-16)
+ _check_svds(A, k, *res1a)
+
+ # with the same rng, solutions are the same and accurate
+ res1b = svds(A, k, solver=self.solver, rng=1)
+ res2b = svds(A, k, solver=self.solver, rng=1)
+ for idx in range(3):
+ assert_allclose(res1b[idx], res2b[idx], rtol=1e-15, atol=2e-16)
+ _check_svds(A, k, *res1b)
+
+ # with different rng, solutions can be numerically different
+ message = "Arrays are not equal"
+ with pytest.raises(AssertionError, match=message):
+ assert_equal(res1a, res1b)
+
+ def test_svd_rng_2(self):
+ n = 100
+ k = 1
+
+ rng = np.random.default_rng(234981)
+ A = rng.random((n, n))
+ rng_2 = copy.deepcopy(rng)
+
+ # with the same rng, solutions are the same and accurate
+ res1a = svds(A, k, solver=self.solver, rng=rng)
+ res2a = svds(A, k, solver=self.solver, rng=rng_2)
+ for idx in range(3):
+ assert_allclose(res1a[idx], res2a[idx], rtol=1e-15, atol=2e-16)
+ _check_svds(A, k, *res1a)
+
+ @pytest.mark.filterwarnings("ignore:Exited",
+ reason="Ignore LOBPCG early exit.")
+ def test_svd_rng_3(self):
+ n = 100
+ k = 5
+
+ rng1 = np.random.default_rng(0)
+ rng2 = np.random.default_rng(234832)
+ A = rng1.random((n, n))
+
+ # rng in different state produces accurate - but not
+ # not necessarily identical - results
+ res1a = svds(A, k, solver=self.solver, rng=rng1, maxiter=1000)
+ res2a = svds(A, k, solver=self.solver, rng=rng2, maxiter=1000)
+ _check_svds(A, k, *res1a, atol=2e-7)
+ _check_svds(A, k, *res2a, atol=2e-7)
+
+ message = "Arrays are not equal"
+ with pytest.raises(AssertionError, match=message):
+ assert_equal(res1a, res2a)
+
+ @pytest.mark.thread_unsafe
+ @pytest.mark.filterwarnings("ignore:Exited postprocessing")
+ def test_svd_maxiter(self):
+ # check that maxiter works as expected: should not return accurate
+ # solution after 1 iteration, but should with default `maxiter`
+ A = np.diag(np.arange(9)).astype(np.float64)
+ k = 1
+ u, s, vh = sorted_svd(A, k)
+ # Use default maxiter by default
+ maxiter = None
+
+ if self.solver == 'arpack':
+ message = "ARPACK error -1: No convergence"
+ with pytest.raises(ArpackNoConvergence, match=message):
+ svds(A, k, ncv=3, maxiter=1, solver=self.solver, rng=0)
+ elif self.solver == 'lobpcg':
+ # Set maxiter higher so test passes without changing
+ # default and breaking backward compatibility (gh-20221)
+ maxiter = 30
+ with pytest.warns(UserWarning, match="Exited at iteration"):
+ svds(A, k, maxiter=1, solver=self.solver, rng=0)
+ elif self.solver == 'propack':
+ message = "k=1 singular triplets did not converge within"
+ with pytest.raises(np.linalg.LinAlgError, match=message):
+ svds(A, k, maxiter=1, solver=self.solver, rng=0)
+
+ ud, sd, vhd = svds(A, k, solver=self.solver, maxiter=maxiter, rng=0)
+ _check_svds(A, k, ud, sd, vhd, atol=1e-8)
+ assert_allclose(np.abs(ud), np.abs(u), atol=1e-8)
+ assert_allclose(np.abs(vhd), np.abs(vh), atol=1e-8)
+ assert_allclose(np.abs(sd), np.abs(s), atol=1e-9)
+
+ @pytest.mark.thread_unsafe
+ @pytest.mark.parametrize("rsv", (True, False, 'u', 'vh'))
+ @pytest.mark.parametrize("shape", ((5, 7), (6, 6), (7, 5)))
+ def test_svd_return_singular_vectors(self, rsv, shape):
+ # check that the return_singular_vectors parameter works as expected
+ rng = np.random.default_rng(0)
+ A = rng.random(shape)
+ k = 2
+ M, N = shape
+ u, s, vh = sorted_svd(A, k)
+
+ respect_u = True if self.solver == 'propack' else M <= N
+ respect_vh = True if self.solver == 'propack' else M > N
+
+ if self.solver == 'lobpcg':
+ with pytest.warns(UserWarning, match="The problem size"):
+ if rsv is False:
+ s2 = svds(A, k, return_singular_vectors=rsv,
+ solver=self.solver, rng=rng)
+ assert_allclose(s2, s)
+ elif rsv == 'u' and respect_u:
+ u2, s2, vh2 = svds(A, k, return_singular_vectors=rsv,
+ solver=self.solver, rng=rng)
+ assert_allclose(np.abs(u2), np.abs(u))
+ assert_allclose(s2, s)
+ assert vh2 is None
+ elif rsv == 'vh' and respect_vh:
+ u2, s2, vh2 = svds(A, k, return_singular_vectors=rsv,
+ solver=self.solver, rng=rng)
+ assert u2 is None
+ assert_allclose(s2, s)
+ assert_allclose(np.abs(vh2), np.abs(vh))
+ else:
+ u2, s2, vh2 = svds(A, k, return_singular_vectors=rsv,
+ solver=self.solver, rng=rng)
+ if u2 is not None:
+ assert_allclose(np.abs(u2), np.abs(u))
+ assert_allclose(s2, s)
+ if vh2 is not None:
+ assert_allclose(np.abs(vh2), np.abs(vh))
+ else:
+ if rsv is False:
+ s2 = svds(A, k, return_singular_vectors=rsv,
+ solver=self.solver, rng=rng)
+ assert_allclose(s2, s)
+ elif rsv == 'u' and respect_u:
+ u2, s2, vh2 = svds(A, k, return_singular_vectors=rsv,
+ solver=self.solver, rng=rng)
+ assert_allclose(np.abs(u2), np.abs(u))
+ assert_allclose(s2, s)
+ assert vh2 is None
+ elif rsv == 'vh' and respect_vh:
+ u2, s2, vh2 = svds(A, k, return_singular_vectors=rsv,
+ solver=self.solver, rng=rng)
+ assert u2 is None
+ assert_allclose(s2, s)
+ assert_allclose(np.abs(vh2), np.abs(vh))
+ else:
+ u2, s2, vh2 = svds(A, k, return_singular_vectors=rsv,
+ solver=self.solver, rng=rng)
+ if u2 is not None:
+ assert_allclose(np.abs(u2), np.abs(u))
+ assert_allclose(s2, s)
+ if vh2 is not None:
+ assert_allclose(np.abs(vh2), np.abs(vh))
+
+ # --- Test Basic Functionality ---
+ # Tests the accuracy of each solver for real and complex matrices provided
+ # as list, dense array, sparse matrix, and LinearOperator.
+
+ A1 = [[1, 2, 3], [3, 4, 3], [1 + 1j, 0, 2], [0, 0, 1]]
+ A2 = [[1, 2, 3, 8 + 5j], [3 - 2j, 4, 3, 5], [1, 0, 2, 3], [0, 0, 1, 0]]
+
+ @pytest.mark.thread_unsafe
+ @pytest.mark.filterwarnings("ignore:k >= N - 1",
+ reason="needed to demonstrate #16725")
+ @pytest.mark.parametrize('A', (A1, A2))
+ @pytest.mark.parametrize('k', range(1, 5))
+ # PROPACK fails a lot if @pytest.mark.parametrize('which', ("SM", "LM"))
+ @pytest.mark.parametrize('real', (True, False))
+ @pytest.mark.parametrize('transpose', (False, True))
+ # In gh-14299, it was suggested the `svds` should _not_ work with lists
+ @pytest.mark.parametrize('lo_type', (np.asarray, csc_array,
+ aslinearoperator))
+ def test_svd_simple(self, A, k, real, transpose, lo_type):
+
+ A = np.asarray(A)
+ A = np.real(A) if real else A
+ A = A.T if transpose else A
+ A2 = lo_type(A)
+
+ # could check for the appropriate errors, but that is tested above
+ if k > min(A.shape):
+ pytest.skip("`k` cannot be greater than `min(A.shape)`")
+ if self.solver != 'propack' and k >= min(A.shape):
+ pytest.skip("Only PROPACK supports complete SVD")
+ if self.solver == 'arpack' and not real and k == min(A.shape) - 1:
+ pytest.skip("#16725")
+
+ atol = 3e-10
+ if self.solver == 'propack':
+ atol = 3e-9 # otherwise test fails on Linux aarch64 (see gh-19855)
+
+ if self.solver == 'lobpcg':
+ with pytest.warns(UserWarning, match="The problem size"):
+ u, s, vh = svds(A2, k, solver=self.solver, rng=0)
+ else:
+ u, s, vh = svds(A2, k, solver=self.solver, rng=0)
+ _check_svds(A, k, u, s, vh, atol=atol)
+
+ @pytest.mark.thread_unsafe
+ def test_svd_linop(self):
+ solver = self.solver
+
+ nmks = [(6, 7, 3),
+ (9, 5, 4),
+ (10, 8, 5)]
+
+ def reorder(args):
+ U, s, VH = args
+ j = np.argsort(s)
+ return U[:, j], s[j], VH[j, :]
+
+ for n, m, k in nmks:
+ # Test svds on a LinearOperator.
+ A = np.random.RandomState(52).randn(n, m)
+ L = CheckingLinearOperator(A)
+
+ if solver == 'propack':
+ v0 = np.ones(n)
+ else:
+ v0 = np.ones(min(A.shape))
+ if solver == 'lobpcg':
+ with pytest.warns(UserWarning, match="The problem size"):
+ U1, s1, VH1 = reorder(svds(A, k, v0=v0, solver=solver, rng=0))
+ U2, s2, VH2 = reorder(svds(L, k, v0=v0, solver=solver, rng=0))
+ else:
+ U1, s1, VH1 = reorder(svds(A, k, v0=v0, solver=solver, rng=0))
+ U2, s2, VH2 = reorder(svds(L, k, v0=v0, solver=solver, rng=0))
+
+ assert_allclose(np.abs(U1), np.abs(U2))
+ assert_allclose(s1, s2)
+ assert_allclose(np.abs(VH1), np.abs(VH2))
+ assert_allclose(np.dot(U1, np.dot(np.diag(s1), VH1)),
+ np.dot(U2, np.dot(np.diag(s2), VH2)))
+
+ # Try again with which="SM".
+ A = np.random.RandomState(1909).randn(n, m)
+ L = CheckingLinearOperator(A)
+
+ # TODO: arpack crashes when v0=v0, which="SM"
+ kwargs = {'v0': v0} if solver not in {None, 'arpack'} else {}
+ if self.solver == 'lobpcg':
+ with pytest.warns(UserWarning, match="The problem size"):
+ U1, s1, VH1 = reorder(svds(A, k, which="SM", solver=solver,
+ rng=0, **kwargs))
+ U2, s2, VH2 = reorder(svds(L, k, which="SM", solver=solver,
+ rng=0, **kwargs))
+ else:
+ U1, s1, VH1 = reorder(svds(A, k, which="SM", solver=solver,
+ rng=0, **kwargs))
+ U2, s2, VH2 = reorder(svds(L, k, which="SM", solver=solver,
+ rng=0, **kwargs))
+
+ assert_allclose(np.abs(U1), np.abs(U2))
+ assert_allclose(s1 + 1, s2 + 1)
+ assert_allclose(np.abs(VH1), np.abs(VH2))
+ assert_allclose(np.dot(U1, np.dot(np.diag(s1), VH1)),
+ np.dot(U2, np.dot(np.diag(s2), VH2)))
+
+ if k < min(n, m) - 1:
+ # Complex input and explicit which="LM".
+ for (dt, eps) in [(complex, 1e-7), (np.complex64, 3e-3)]:
+ rng = np.random.RandomState(1648)
+ A = (rng.randn(n, m) + 1j * rng.randn(n, m)).astype(dt)
+ L = CheckingLinearOperator(A)
+
+ if self.solver == 'lobpcg':
+ with pytest.warns(UserWarning,
+ match="The problem size"):
+ U1, s1, VH1 = reorder(svds(A, k, which="LM",
+ solver=solver, rng=0))
+ U2, s2, VH2 = reorder(svds(L, k, which="LM",
+ solver=solver, rng=0))
+ else:
+ U1, s1, VH1 = reorder(svds(A, k, which="LM",
+ solver=solver, rng=0))
+ U2, s2, VH2 = reorder(svds(L, k, which="LM",
+ solver=solver, rng=0))
+
+ assert_allclose(np.abs(U1), np.abs(U2), rtol=eps)
+ assert_allclose(s1, s2, rtol=eps)
+ assert_allclose(np.abs(VH1), np.abs(VH2), rtol=eps)
+ assert_allclose(np.dot(U1, np.dot(np.diag(s1), VH1)),
+ np.dot(U2, np.dot(np.diag(s2), VH2)),
+ rtol=eps)
+
+ SHAPES = ((100, 100), (100, 101), (101, 100))
+
+ @pytest.mark.filterwarnings("ignore:Exited at iteration")
+ @pytest.mark.filterwarnings("ignore:Exited postprocessing")
+ @pytest.mark.parametrize("shape", SHAPES)
+ # ARPACK supports only dtype float, complex, or np.float32
+ @pytest.mark.parametrize("dtype", (float, complex, np.float32))
+ def test_small_sigma_sparse(self, shape, dtype):
+ # https://github.com/scipy/scipy/pull/11829
+ solver = self.solver
+ # 2do: PROPACK fails orthogonality of singular vectors
+ # if dtype == complex and self.solver == 'propack':
+ # pytest.skip("PROPACK unsupported for complex dtype")
+ rng = np.random.default_rng(0)
+ k = 5
+ (m, n) = shape
+ S = random_array(shape=(m, n), density=0.1, rng=rng)
+ if dtype is complex:
+ S = + 1j * random_array(shape=(m, n), density=0.1, rng=rng)
+ e = np.ones(m)
+ e[0:5] *= 1e1 ** np.arange(-5, 0, 1)
+ S = dia_array((e, 0), shape=(m, m)) @ S
+ S = S.astype(dtype)
+ u, s, vh = svds(S, k, which='SM', solver=solver, maxiter=1000, rng=0)
+ c_svd = False # partial SVD can be different from full SVD
+ _check_svds_n(S, k, u, s, vh, which="SM", check_svd=c_svd, atol=2e-1)
+
+ # --- Test Edge Cases ---
+ # Checks a few edge cases.
+ @pytest.mark.thread_unsafe
+ @pytest.mark.parametrize("shape", ((6, 5), (5, 5), (5, 6)))
+ @pytest.mark.parametrize("dtype", (float, complex))
+ def test_svd_LM_ones_matrix(self, shape, dtype):
+ # Check that svds can deal with matrix_rank less than k in LM mode.
+ k = 3
+ n, m = shape
+ A = np.ones((n, m), dtype=dtype)
+
+ if self.solver == 'lobpcg':
+ with pytest.warns(UserWarning, match="The problem size"):
+ U, s, VH = svds(A, k, solver=self.solver, rng=0)
+ else:
+ U, s, VH = svds(A, k, solver=self.solver, rng=0)
+
+ _check_svds(A, k, U, s, VH, check_usvh_A=True, check_svd=False)
+
+ # Check that the largest singular value is near sqrt(n*m)
+ # and the other singular values have been forced to zero.
+ assert_allclose(np.max(s), np.sqrt(n*m))
+ s = np.array(sorted(s)[:-1]) + 1
+ z = np.ones_like(s)
+ assert_allclose(s, z)
+
+ @pytest.mark.thread_unsafe
+ @pytest.mark.filterwarnings("ignore:k >= N - 1",
+ reason="needed to demonstrate #16725")
+ @pytest.mark.parametrize("shape", ((3, 4), (4, 4), (4, 3), (4, 2)))
+ @pytest.mark.parametrize("dtype", (float, complex))
+ def test_zero_matrix(self, shape, dtype):
+ # Check that svds can deal with matrices containing only zeros;
+ # see https://github.com/scipy/scipy/issues/3452/
+ # shape = (4, 2) is included because it is the particular case
+ # reported in the issue
+ k = 1
+ n, m = shape
+ A = np.zeros((n, m), dtype=dtype)
+
+ if (self.solver == 'arpack'):
+ pytest.skip('See gh-21110.')
+
+ if (self.solver == 'arpack' and dtype is complex
+ and k == min(A.shape) - 1):
+ pytest.skip("#16725")
+
+ if self.solver == 'propack':
+ pytest.skip("PROPACK failures unrelated to PR #16712")
+
+ if self.solver == 'lobpcg':
+ with pytest.warns(UserWarning, match="The problem size"):
+ U, s, VH = svds(A, k, solver=self.solver, rng=0)
+ else:
+ U, s, VH = svds(A, k, solver=self.solver, rng=0)
+
+ # Check some generic properties of svd.
+ _check_svds(A, k, U, s, VH, check_usvh_A=True, check_svd=False)
+
+ # Check that the singular values are zero.
+ assert_array_equal(s, 0)
+
+ @pytest.mark.parametrize("shape", ((20, 20), (20, 21), (21, 20)))
+ # ARPACK supports only dtype float, complex, or np.float32
+ @pytest.mark.parametrize("dtype", (float, complex, np.float32))
+ @pytest.mark.filterwarnings("ignore:Exited",
+ reason="Ignore LOBPCG early exit.")
+ def test_small_sigma(self, shape, dtype):
+ rng = np.random.default_rng(179847540)
+ A = rng.random(shape).astype(dtype)
+ u, _, vh = svd(A, full_matrices=False)
+ if dtype == np.float32:
+ e = 10.0
+ else:
+ e = 100.0
+ t = e**(-np.arange(len(vh))).astype(dtype)
+ A = (u*t).dot(vh)
+ k = 4
+ u, s, vh = svds(A, k, solver=self.solver, maxiter=100, rng=0)
+ t = np.sum(s > 0)
+ assert_equal(t, k)
+ # LOBPCG needs larger atol and rtol to pass
+ _check_svds_n(A, k, u, s, vh, atol=1e-3, rtol=1e0, check_svd=False)
+
+ # ARPACK supports only dtype float, complex, or np.float32
+ @pytest.mark.filterwarnings("ignore:The problem size")
+ @pytest.mark.parametrize("dtype", (float, complex, np.float32))
+ def test_small_sigma2(self, dtype):
+ rng = np.random.default_rng(179847540)
+ # create a 10x10 singular matrix with a 4-dim null space
+ dim = 4
+ size = 10
+ x = rng.random((size, size-dim))
+ y = x[:, :dim] * rng.random(dim)
+ mat = np.hstack((x, y))
+ mat = mat.astype(dtype)
+
+ nz = null_space(mat)
+ assert_equal(nz.shape[1], dim)
+
+ # Tolerances atol and rtol adjusted to pass np.float32
+ # Use non-sparse svd
+ u, s, vh = svd(mat)
+ # Singular values are 0:
+ assert_allclose(s[-dim:], 0, atol=1e-6, rtol=1e0)
+ # Smallest right singular vectors in null space:
+ assert_allclose(mat @ vh[-dim:, :].T, 0, atol=1e-6, rtol=1e0)
+
+ # Smallest singular values should be 0
+ sp_mat = csc_array(mat)
+ su, ss, svh = svds(sp_mat, k=dim, which='SM', solver=self.solver, rng=0)
+ # Smallest dim singular values are 0:
+ assert_allclose(ss, 0, atol=1e-5, rtol=1e0)
+ # Smallest singular vectors via svds in null space:
+ n, m = mat.shape
+ if n < m: # else the assert fails with some libraries unclear why
+ assert_allclose(sp_mat.transpose() @ su, 0, atol=1e-5, rtol=1e0)
+ assert_allclose(sp_mat @ svh.T, 0, atol=1e-5, rtol=1e0)
+
+# --- Perform tests with each solver ---
+
+
+class Test_SVDS_once:
+ @pytest.mark.parametrize("solver", ['ekki', object])
+ def test_svds_input_validation_solver(self, solver):
+ message = "solver must be one of"
+ with pytest.raises(ValueError, match=message):
+ svds(np.ones((3, 4)), k=2, solver=solver, rng=0)
+
+
+class Test_SVDS_ARPACK(SVDSCommonTests):
+
+ def setup_method(self):
+ self.solver = 'arpack'
+
+ @pytest.mark.parametrize("ncv", list(range(-1, 8)) + [4.5, "5"])
+ def test_svds_input_validation_ncv_1(self, ncv):
+ rng = np.random.default_rng(0)
+ A = rng.random((6, 7))
+ k = 3
+ if ncv in {4, 5}:
+ u, s, vh = svds(A, k=k, ncv=ncv, solver=self.solver, rng=0)
+ # partial decomposition, so don't check that u@diag(s)@vh=A;
+ # do check that scipy.sparse.linalg.svds ~ scipy.linalg.svd
+ _check_svds(A, k, u, s, vh)
+ else:
+ message = ("`ncv` must be an integer satisfying")
+ with pytest.raises(ValueError, match=message):
+ svds(A, k=k, ncv=ncv, solver=self.solver, rng=0)
+
+ def test_svds_input_validation_ncv_2(self):
+ # I think the stack trace is reasonable when `ncv` can't be converted
+ # to an int.
+ message = "int() argument must be a"
+ with pytest.raises(TypeError, match=re.escape(message)):
+ svds(np.eye(10), ncv=[], solver=self.solver, rng=0)
+
+ message = "invalid literal for int()"
+ with pytest.raises(ValueError, match=message):
+ svds(np.eye(10), ncv="hi", solver=self.solver, rng=0)
+
+ # I can't see a robust relationship between `ncv` and relevant outputs
+ # (e.g. accuracy, time), so no test of the parameter.
+
+
+class Test_SVDS_LOBPCG(SVDSCommonTests):
+
+ def setup_method(self):
+ self.solver = 'lobpcg'
+
+
+class Test_SVDS_PROPACK(SVDSCommonTests):
+
+ def setup_method(self):
+ self.solver = 'propack'
+
+ def test_svd_LM_ones_matrix(self):
+ message = ("PROPACK does not return orthonormal singular vectors "
+ "associated with zero singular values.")
+ # There are some other issues with this matrix of all ones, e.g.
+ # `which='sm'` and `k=1` returns the largest singular value
+ pytest.xfail(message)
+
+ def test_svd_LM_zeros_matrix(self):
+ message = ("PROPACK does not return orthonormal singular vectors "
+ "associated with zero singular values.")
+ pytest.xfail(message)
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__init__.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..3b57274542928e79c234bb6955849a90be21990e
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__init__.py
@@ -0,0 +1,20 @@
+"Iterative Solvers for Sparse Linear Systems"
+
+#from info import __doc__
+from .iterative import *
+from .minres import minres
+from .lgmres import lgmres
+from .lsqr import lsqr
+from .lsmr import lsmr
+from ._gcrotmk import gcrotmk
+from .tfqmr import tfqmr
+
+__all__ = [
+ 'bicg', 'bicgstab', 'cg', 'cgs', 'gcrotmk', 'gmres',
+ 'lgmres', 'lsmr', 'lsqr',
+ 'minres', 'qmr', 'tfqmr'
+]
+
+from scipy._lib._testutils import PytestTester
+test = PytestTester(__name__)
+del PytestTester
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/__init__.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..254e799ff934f8a77fff7d721fe6da107c9bb0ff
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/__init__.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/_gcrotmk.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/_gcrotmk.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..8b899aa9900d0796222109cb83d2d7594d89cb69
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/_gcrotmk.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/iterative.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/iterative.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..882d077280e578c3f89eafb9f7b265190444a59a
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/iterative.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lgmres.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lgmres.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..09e0f72264e925a710c86fc6cd19b5c2eee99f78
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lgmres.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lsmr.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lsmr.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..e89d7a464196e672a6fdc22eb5e804cbe2a085b8
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lsmr.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lsqr.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lsqr.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..0ce62a12c4dc3ff3d2787457a88b0b7f62378f05
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/lsqr.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/minres.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/minres.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..5c76fc471c56625c51f956f6eeab4ebf1ea02c0c
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/minres.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/tfqmr.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/tfqmr.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..b7ce22f6a30d7226a80be6481bd7af85821a9d8f
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/tfqmr.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/utils.cpython-310.pyc b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/utils.cpython-310.pyc
new file mode 100644
index 0000000000000000000000000000000000000000..55bdfbf4b11e45ab41e7eca32a0bf0f013458c66
Binary files /dev/null and b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/__pycache__/utils.cpython-310.pyc differ
diff --git a/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/_gcrotmk.py b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/_gcrotmk.py
new file mode 100644
index 0000000000000000000000000000000000000000..e5c1fe9daee2c5a955dd71de3e82f33e3dc02179
--- /dev/null
+++ b/Scripts_RSCM_sim_growth_n_climate_to_Yield/.venv/lib/python3.10/site-packages/scipy/sparse/linalg/_isolve/_gcrotmk.py
@@ -0,0 +1,503 @@
+# Copyright (C) 2015, Pauli Virtanen